Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,14 +30,14 @@ jobs:
cache: npm
- run: npm ci
- run: npm run typecheck
- run: npm test
- name: Tool and plugin regressions
run: node --import tsx --test tools/*.test.mjs tools/*.test.mts plugins/rdk-camera-workshop/mcp/*.test.mjs
- uses: actions/setup-python@v5
with:
python-version: '3.12'
- name: Install numerical fixture dependency
run: python3 -m pip install 'numpy>=1.24,<3'
- name: Install Python test dependencies
run: python3 -m pip install 'numpy>=1.24,<3' Pillow
- run: npm test
- name: Tool and plugin regressions
run: node --import tsx --test tools/*.test.mjs tools/*.test.mts plugins/rdk-camera-workshop/mcp/*.test.mjs
- name: Python camera and release controller regressions
run: |
set -eu
Expand Down
170 changes: 14 additions & 156 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,8 @@
"@supabase/supabase-js": "^2.100.1",
"express": "^4.22.2",
"pg": "8.21.0",
"undici": "7.30.0",
"zod": "^3.24.0"
"undici": "7.30.1",
"zod": "4.6.7"
},
"devDependencies": {
"@types/express": "^5.0.0",
Expand Down
2 changes: 1 addition & 1 deletion server/monitoring/alert-config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -806,7 +806,7 @@ const alertConfigSchema = z
postgres: z.array(z.string().trim().min(2).max(160)).max(30),
})
.strict(),
rules: z.record(z.enum(ruleKeys), ruleSchema),
rules: z.partialRecord(z.enum(ruleKeys), ruleSchema),
preservedRules: z.record(z.string(), z.unknown()).default({}),
})
.strict()
Expand Down
2 changes: 1 addition & 1 deletion server/monitoring/collection-workspace-service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ function safeConfig(value: unknown): boolean {
};
return !!value && typeof value === 'object' && !Array.isArray(value) && visit(value, 0) && Buffer.byteLength(JSON.stringify(value)) <= 16 * 1024;
}
const configSchema = z.record(z.unknown()).refine(safeConfig);
const configSchema = z.record(z.string(), z.unknown()).refine(safeConfig);
const filterSchema = z.object({ keywords: z.array(short(100)).min(1).max(20), mode: z.enum(['include', 'exclude']) }).strict();
const qualitySchema = z.object({ minBytes: z.number().int().min(0).max(MAX_ARTIFACT_BYTES) }).strict();
const recipeSchema = z.object({ name: short(160), project: short(120), source: z.enum(['cloud', 'edge']), moduleId: opaque, moduleVersion: z.literal('1.0.0'), config: configSchema, filter: filterSchema.optional(), quality: qualitySchema.optional(), createDataset: z.boolean() }).strict();
Expand Down
2 changes: 1 addition & 1 deletion server/monitoring/data-center-service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ const taskSchema = taskInputSchema.extend({ id: uuid, status: z.enum(['planned',
const datasetSchema = datasetInputSchema.extend({ id: uuid, version: z.number().int().min(1), assets: z.array(assetSchema).min(1).max(MAX_DATASET_ASSETS), createdAt: stamp }).strict();
const evidenceSchema = evidenceInputSchema.extend({ id: uuid, sha256: sha, createdAt: stamp, measurementSource: z.literal('reported').optional(), improvement: z.number().finite().optional(), passed: z.boolean().optional(), criterion: criterionSchema.optional() }).strict();
const loopSchema = loopInputSchema.extend({ id: uuid, status: z.enum(['open', 'analyzed', 'evaluated', 'deployed', 'verified', 'verification_failed']), evidence: z.array(evidenceSchema).max(64), createdAt: stamp, updatedAt: stamp }).strict();
const accountSchema = z.object({ ownerHash: sha, assets: z.array(assetSchema).max(10000), tasks: z.array(taskSchema).max(2000), datasets: z.array(datasetSchema).max(2000), loops: z.array(loopSchema).max(2000), collectionTokens: z.record(sha) }).strict();
const accountSchema = z.object({ ownerHash: sha, assets: z.array(assetSchema).max(10000), tasks: z.array(taskSchema).max(2000), datasets: z.array(datasetSchema).max(2000), loops: z.array(loopSchema).max(2000), collectionTokens: z.record(z.string(), sha) }).strict();
const storeSchema = z.object({ schemaVersion: z.literal(1), accounts: z.array(accountSchema).max(2000) }).strict();
const envelopeSchema = z.object({ sha256: sha, payload: storeSchema }).strict();
type Store = z.infer<typeof storeSchema>;
Expand Down
2 changes: 1 addition & 1 deletion server/monitoring/edge-llm-service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ const textSchema = z.string().trim().min(1).max(160).refine((value) => !/[\x00-\
const operationSchema = z.enum(EDGE_LLM_JOB_OPERATIONS);
const runnerStatusSchema = z.enum(['queued', 'running', 'succeeded', 'failed', 'unknown']);
const timestampSchema = z.string().max(40).refine((value) => /^\d{4}-\d\d-\d\dT/.test(value) && Number.isFinite(Date.parse(value)));
const jsonObjectSchema = z.record(z.unknown());
const jsonObjectSchema = z.record(z.string(), z.unknown());
const terminal = (status: string) => status === 'succeeded' || status === 'failed' || status === 'superseded';
const hash = (value: string) => createHash('sha256').update(value).digest('hex');
function canonical(value: unknown): unknown { if (Array.isArray(value)) return value.map(canonical); if (value && typeof value === 'object') return Object.fromEntries(Object.entries(value).sort(([a], [b]) => a.localeCompare(b)).map(([key, item]) => [key, canonical(item)])); return value; }
Expand Down
2 changes: 1 addition & 1 deletion server/monitoring/platform-assistant-tasks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ const revision = z.number().int().positive().max(Number.MAX_SAFE_INTEGER);
const stamp = z.string().datetime();
const statusSchema = z.enum(['running', 'awaiting_confirmation', 'completed', 'failed', 'interrupted']);
const feedbackSchema = z.enum(['helpful', 'not_helpful']);
const contextSchema = z.record(z.unknown());
const contextSchema = z.record(z.string(), z.unknown());
const historySchema = z.array(z.object({ role: z.enum(['user', 'assistant']), content: z.string().max(8_000) }).strict()).max(12);
const operationSchema = z.object({ id: z.string().min(1).max(512), description: z.string().max(500),
status: z.number().int().min(100).max(599), ok: z.boolean(), data: z.unknown() }).strict();
Expand Down
2 changes: 1 addition & 1 deletion server/monitoring/plugin-routes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ export async function disposeConfiguredPlugins(): Promise<void> {
}
type Options = { runtime?: PluginRuntime; mcp?: PluginMcpClient; access?: RequestHandler; owner?: (req: Request) => string };
const revisionSchema = z.object({ expectedRevision: z.number().int().min(1) }).strict();
const argsSchema = z.record(z.unknown());
const argsSchema = z.record(z.string(), z.unknown());
const queryArgs = (req: Request) => {
if (Object.keys(req.query).some(key => !['args', 'tenant'].includes(key)) || (req.query.tenant !== undefined && (typeof req.query.tenant !== 'string' || req.query.tenant.length > 128)) || (req.query.args !== undefined && (typeof req.query.args !== 'string' || req.query.args.length > 8192))) throw new PluginError('plugin_invalid_arguments', 400);
if (req.query.args === undefined) return {};
Expand Down
2 changes: 1 addition & 1 deletion server/monitoring/vision-workshop-ai-model.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ type VisionMessage = { role: 'system' | 'user'; content: string | Array<{ type:
export type VisionDebugModelCaller = (request: { messages: VisionMessage[]; tools: unknown[]; tool_choice: unknown; signal?: AbortSignal }) => Promise<{ model: string; toolCalls: Array<{ name: string; arguments: string }> }>;
const decisionSchema = z.object({
action: z.enum(['adjust', 'keep', 'restore', 'stop']),
values: z.record(z.union([z.number().finite(), z.boolean()])).optional(),
values: z.record(z.string(), z.union([z.number().finite(), z.boolean()])).optional(),
patches: z.array(z.object({ path: z.string(), value: z.number().finite(), reason: z.string().trim().min(1).max(240) }).strict()).min(1).max(3).optional(),
notes: z.string().trim().min(1).max(1600),
assessment: z.object({ improved: z.boolean(), sceneUsable: z.boolean(), goalSatisfied: z.boolean(),
Expand Down
Loading
Loading