@cortex-agent/server 2026.10.21 → 2026.10.25
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +10 -6
- package/defaults/context/projects/AGENTS.md +1 -1
- package/defaults/gitignore +3 -3
- package/defaults/hooks/new-session-hook.mjs +1 -1
- package/defaults/hooks/status-md-guard.mjs +6 -6
- package/defaults/plugins/cortex-system/plugin.json +1 -1
- package/defaults/plugins/cortex-system/skills/client-manage/SKILL.md +16 -9
- package/defaults/plugins/cortex-system/skills/project-init/SKILL.md +2 -2
- package/defaults/rules/agents-md.md +1 -1
- package/defaults/rules/issues-md.md +1 -1
- package/defaults/rules/meta-conventions.md +3 -3
- package/defaults/rules/mission-md.md +1 -1
- package/defaults/rules/status-md.md +1 -1
- package/dist/agent-adapter/claude/bg-task-tracker.d.ts +3 -1
- package/dist/agent-adapter/claude/bg-task-tracker.js +6 -2
- package/dist/agent-adapter/claude/mcp-config.js +11 -0
- package/dist/agent-adapter/claude/turn-machine.d.ts +2 -1
- package/dist/agent-adapter/claude/turn-machine.js +8 -5
- package/dist/agent-adapter/continuation-phase.d.ts +6 -3
- package/dist/agent-adapter/continuation-phase.js +8 -3
- package/dist/agent-adapter/run-events.d.ts +4 -0
- package/dist/agent-adapter/types.d.ts +9 -2
- package/dist/build-info.json +1 -0
- package/dist/client-bundle/client.mjs +10 -5
- package/dist/client-bundle/manifest.json +2 -2
- package/dist/core/claude-credentials.d.ts +6 -0
- package/dist/core/claude-credentials.js +11 -0
- package/dist/core/gateway-generator.d.ts +17 -0
- package/dist/core/gateway-generator.js +42 -4
- package/dist/core/hook-bus.d.ts +1 -1
- package/dist/core/hook-bus.js +1 -8
- package/dist/core/locales/en.d.ts +1 -0
- package/dist/core/locales/slices/init.d.ts +1 -0
- package/dist/core/locales/slices/init.js +2 -0
- package/dist/core/log.d.ts +3 -0
- package/dist/core/log.js +18 -1
- package/dist/core/settings-spec.d.ts +5 -0
- package/dist/core/settings-spec.js +4 -0
- package/dist/core/types/agent-types.d.ts +3 -1
- package/dist/core/types/environment-types.d.ts +1 -6
- package/dist/domain/agents/environments/registry.js +3 -2
- package/dist/domain/agents/environments/schema.d.ts +3 -2
- package/dist/domain/agents/environments/schema.js +4 -3
- package/dist/domain/auth/auth-watch.js +48 -18
- package/dist/domain/mcp/tools/context.d.ts +0 -1
- package/dist/domain/mcp/tools/context.js +0 -1
- package/dist/domain/monitor/event-loop-monitor.d.ts +2 -0
- package/dist/domain/monitor/event-loop-monitor.js +5 -1
- package/dist/domain/plugins/authoring.d.ts +8 -1
- package/dist/domain/plugins/authoring.js +24 -9
- package/dist/domain/plugins/runtime-gc.d.ts +7 -0
- package/dist/domain/plugins/runtime-gc.js +52 -19
- package/dist/domain/plugins/runtime.js +2 -1
- package/dist/domain/remote/client-bootstrap.js +1 -1
- package/dist/domain/remote/client-manager.js +6 -1
- package/dist/domain/runs/retryable-errors.js +3 -1
- package/dist/domain/runs/service.d.ts +0 -9
- package/dist/domain/runs/service.js +29 -15
- package/dist/domain/scheduling/builtin-job-controller.d.ts +3 -1
- package/dist/domain/scheduling/builtin-job-controller.js +5 -2
- package/dist/domain/scheduling/builtin-jobs.js +7 -0
- package/dist/domain/scheduling/scheduler.js +14 -5
- package/dist/domain/system/server-update-check.js +2 -1
- package/dist/domain/telemetry/bus-collector.d.ts +3 -0
- package/dist/domain/telemetry/bus-collector.js +22 -0
- package/dist/domain/telemetry/child-exit.d.ts +11 -0
- package/dist/domain/telemetry/child-exit.js +36 -0
- package/dist/domain/telemetry/client-kind.d.ts +4 -0
- package/dist/domain/telemetry/client-kind.js +7 -0
- package/dist/domain/telemetry/crash-limits.d.ts +15 -0
- package/dist/domain/telemetry/crash-limits.js +50 -0
- package/dist/domain/telemetry/crash.d.ts +25 -0
- package/dist/domain/telemetry/crash.js +70 -0
- package/dist/domain/telemetry/daily-upload.d.ts +5 -0
- package/dist/domain/telemetry/daily-upload.js +20 -0
- package/dist/domain/telemetry/daily.d.ts +5 -0
- package/dist/domain/telemetry/daily.js +104 -0
- package/dist/domain/telemetry/endpoint.d.ts +7 -0
- package/dist/domain/telemetry/endpoint.js +40 -0
- package/dist/domain/telemetry/envelope.d.ts +6 -0
- package/dist/domain/telemetry/envelope.js +35 -0
- package/dist/domain/telemetry/error-digest.d.ts +7 -0
- package/dist/domain/telemetry/error-digest.js +43 -0
- package/dist/domain/telemetry/funnel.d.ts +6 -0
- package/dist/domain/telemetry/funnel.js +22 -0
- package/dist/domain/telemetry/gate.d.ts +19 -0
- package/dist/domain/telemetry/gate.js +67 -0
- package/dist/domain/telemetry/heartbeat.d.ts +17 -0
- package/dist/domain/telemetry/heartbeat.js +49 -0
- package/dist/domain/telemetry/info.d.ts +9 -0
- package/dist/domain/telemetry/info.js +12 -0
- package/dist/domain/telemetry/init-answer.d.ts +12 -0
- package/dist/domain/telemetry/init-answer.js +42 -0
- package/dist/domain/telemetry/install-id.d.ts +5 -0
- package/dist/domain/telemetry/install-id.js +42 -0
- package/dist/domain/telemetry/normalize.d.ts +33 -0
- package/dist/domain/telemetry/normalize.js +88 -0
- package/dist/domain/telemetry/outbox.d.ts +18 -0
- package/dist/domain/telemetry/outbox.js +93 -0
- package/dist/domain/telemetry/panic-group.d.ts +4 -0
- package/dist/domain/telemetry/panic-group.js +51 -0
- package/dist/domain/telemetry/paths.d.ts +7 -0
- package/dist/domain/telemetry/paths.js +11 -0
- package/dist/domain/telemetry/redact.d.ts +18 -0
- package/dist/domain/telemetry/redact.js +109 -0
- package/dist/domain/telemetry/rollup-types.d.ts +81 -0
- package/dist/domain/telemetry/rollup-types.js +31 -0
- package/dist/domain/telemetry/rollup.d.ts +16 -0
- package/dist/domain/telemetry/rollup.js +102 -0
- package/dist/domain/telemetry/schema.d.ts +931 -0
- package/dist/domain/telemetry/schema.js +275 -0
- package/dist/domain/telemetry/service.d.ts +34 -0
- package/dist/domain/telemetry/service.js +146 -0
- package/dist/domain/telemetry/state.d.ts +17 -0
- package/dist/domain/telemetry/state.js +29 -0
- package/dist/domain/telemetry/turns.d.ts +17 -0
- package/dist/domain/telemetry/turns.js +176 -0
- package/dist/domain/telemetry/upgrade.d.ts +14 -0
- package/dist/domain/telemetry/upgrade.js +87 -0
- package/dist/domain/telemetry/uploader.d.ts +21 -0
- package/dist/domain/telemetry/uploader.js +82 -0
- package/dist/domain/telemetry/usage.d.ts +25 -0
- package/dist/domain/telemetry/usage.js +153 -0
- package/dist/domain/telemetry/web-report.d.ts +8 -0
- package/dist/domain/telemetry/web-report.js +15 -0
- package/dist/domain/ui-service/app-router.d.ts +69 -25
- package/dist/domain/ui-service/app-router.js +9 -2
- package/dist/domain/ui-service/input-schemas.d.ts +68 -4
- package/dist/domain/ui-service/input-schemas.js +9 -1
- package/dist/domain/ui-service/mutate/approvals.d.ts +3 -2
- package/dist/domain/ui-service/mutate/approvals.js +3 -2
- package/dist/domain/ui-service/mutate/plugin-packages.js +1 -1
- package/dist/domain/ui-service/mutate/telemetry.d.ts +5 -0
- package/dist/domain/ui-service/mutate/telemetry.js +6 -0
- package/dist/domain/ui-service/query/approvals.js +4 -3
- package/dist/domain/ui-service/query/machine-probe.d.ts +1 -1
- package/dist/domain/ui-service/query/machine-probe.js +3 -2
- package/dist/domain/ui-service/query/models.d.ts +3 -0
- package/dist/domain/ui-service/query/models.js +47 -30
- package/dist/domain/ui-service/query/plugin-source.js +4 -3
- package/dist/domain/ui-service/query/sessions.js +1 -0
- package/dist/domain/ui-service/query/telemetry.d.ts +3 -0
- package/dist/domain/ui-service/query/telemetry.js +4 -0
- package/dist/domain/ui-service/trpc.d.ts +8 -3
- package/dist/domain/ui-service/trpc.js +1 -1
- package/dist/domain/ui-service/types.d.ts +20 -2
- package/dist/domain/ui-service/ui-service.d.ts +33 -4
- package/dist/domain/ui-service/ui-service.js +19 -18
- package/dist/entry/app.js +20 -2
- package/dist/entry/cli-help.js +27 -14
- package/dist/entry/daemon.d.ts +1 -1
- package/dist/entry/daemon.js +86 -72
- package/dist/entry/init.d.ts +3 -0
- package/dist/entry/init.js +50 -28
- package/dist/entry/shutdown.js +3 -0
- package/dist/entry/signal-cli.js +8 -11
- package/dist/entry/start-ui-http.js +40 -18
- package/dist/entry/telemetry-wiring.d.ts +12 -0
- package/dist/entry/telemetry-wiring.js +56 -0
- package/dist/entry/ui-cli.d.ts +0 -11
- package/dist/entry/ui-cli.js +42 -33
- package/dist/events/event-types.d.ts +1 -4
- package/dist/orchestration/routing/message-router.js +2 -0
- package/dist/orchestration/routing/webhook.js +2 -0
- package/dist/orchestration/transcript-sink.d.ts +6 -0
- package/dist/orchestration/transcript-sink.js +17 -0
- package/dist/orchestration/waitpoint-ingress.js +3 -0
- package/dist/platform/ui-http/ui-auth-routes.d.ts +2 -0
- package/dist/platform/ui-http/ui-auth-routes.js +9 -2
- package/dist/platform/ui-http/ui-device-routes.d.ts +13 -0
- package/dist/platform/ui-http/ui-device-routes.js +81 -0
- package/dist/platform/ui-http/ui-devices.d.ts +24 -0
- package/dist/platform/ui-http/ui-devices.js +107 -0
- package/dist/platform/ui-http/ui-http-server.d.ts +10 -3
- package/dist/platform/ui-http/ui-http-server.js +11 -7
- package/dist/platform/ui-http/ui-pairing.d.ts +25 -0
- package/dist/platform/ui-http/ui-pairing.js +98 -0
- package/dist/store/gitignore-migration.d.ts +2 -0
- package/dist/store/gitignore-migration.js +16 -0
- package/dist/store/hook-registry.d.ts +1 -1
- package/dist/store/hook-registry.js +11 -6
- package/dist/store/session-registry-journal.js +3 -0
- package/dist/store/version-migrations.d.ts +5 -0
- package/dist/store/version-migrations.js +117 -80
- package/dist/tui/components/Dashboard.js +4 -3
- package/dist/tui/hooks/useDashboardData.js +1 -1
- package/package.json +3 -3
- package/web/dist/assets/{board-math-css-CB4GJ6qO.js → board-math-css-spk7yR6n.js} +1 -1
- package/web/dist/assets/index-BQ69u-92.css +1 -0
- package/web/dist/assets/{index-cIGFv27z.js → index-CKNLatCd.js} +1 -1
- package/web/dist/assets/index-CkzWfC98.js +525 -0
- package/web/dist/index.html +2 -2
- package/web/dist/assets/index-CaSZPg_H.css +0 -1
- package/web/dist/assets/index-CzOR7Edh.js +0 -522
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import type { UiService } from './types.js';
|
|
2
2
|
export declare function createAppRouter(service: UiService): import("@trpc/server").TRPCBuiltRouter<{
|
|
3
|
-
ctx:
|
|
3
|
+
ctx: import("./trpc.js").UiRequestContext;
|
|
4
4
|
meta: object;
|
|
5
5
|
errorShape: import("@trpc/server").TRPCDefaultErrorShape;
|
|
6
6
|
transformer: false;
|
|
7
7
|
}, import("@trpc/server").TRPCDecorateCreateRouterOptions<{
|
|
8
8
|
projects: import("@trpc/server").TRPCBuiltRouter<{
|
|
9
|
-
ctx:
|
|
9
|
+
ctx: import("./trpc.js").UiRequestContext;
|
|
10
10
|
meta: object;
|
|
11
11
|
errorShape: import("@trpc/server").TRPCDefaultErrorShape;
|
|
12
12
|
transformer: false;
|
|
@@ -25,7 +25,7 @@ export declare function createAppRouter(service: UiService): import("@trpc/serve
|
|
|
25
25
|
}>;
|
|
26
26
|
}>>;
|
|
27
27
|
sessions: import("@trpc/server").TRPCBuiltRouter<{
|
|
28
|
-
ctx:
|
|
28
|
+
ctx: import("./trpc.js").UiRequestContext;
|
|
29
29
|
meta: object;
|
|
30
30
|
errorShape: import("@trpc/server").TRPCDefaultErrorShape;
|
|
31
31
|
transformer: false;
|
|
@@ -231,7 +231,7 @@ export declare function createAppRouter(service: UiService): import("@trpc/serve
|
|
|
231
231
|
}>;
|
|
232
232
|
}>>;
|
|
233
233
|
schedules: import("@trpc/server").TRPCBuiltRouter<{
|
|
234
|
-
ctx:
|
|
234
|
+
ctx: import("./trpc.js").UiRequestContext;
|
|
235
235
|
meta: object;
|
|
236
236
|
errorShape: import("@trpc/server").TRPCDefaultErrorShape;
|
|
237
237
|
transformer: false;
|
|
@@ -294,7 +294,7 @@ export declare function createAppRouter(service: UiService): import("@trpc/serve
|
|
|
294
294
|
}>;
|
|
295
295
|
}>>;
|
|
296
296
|
boards: import("@trpc/server").TRPCBuiltRouter<{
|
|
297
|
-
ctx:
|
|
297
|
+
ctx: import("./trpc.js").UiRequestContext;
|
|
298
298
|
meta: object;
|
|
299
299
|
errorShape: import("@trpc/server").TRPCDefaultErrorShape;
|
|
300
300
|
transformer: false;
|
|
@@ -327,7 +327,7 @@ export declare function createAppRouter(service: UiService): import("@trpc/serve
|
|
|
327
327
|
}>;
|
|
328
328
|
}>>;
|
|
329
329
|
executions: import("@trpc/server").TRPCBuiltRouter<{
|
|
330
|
-
ctx:
|
|
330
|
+
ctx: import("./trpc.js").UiRequestContext;
|
|
331
331
|
meta: object;
|
|
332
332
|
errorShape: import("@trpc/server").TRPCDefaultErrorShape;
|
|
333
333
|
transformer: false;
|
|
@@ -356,7 +356,7 @@ export declare function createAppRouter(service: UiService): import("@trpc/serve
|
|
|
356
356
|
}>;
|
|
357
357
|
}>>;
|
|
358
358
|
waitpoints: import("@trpc/server").TRPCBuiltRouter<{
|
|
359
|
-
ctx:
|
|
359
|
+
ctx: import("./trpc.js").UiRequestContext;
|
|
360
360
|
meta: object;
|
|
361
361
|
errorShape: import("@trpc/server").TRPCDefaultErrorShape;
|
|
362
362
|
transformer: false;
|
|
@@ -377,7 +377,7 @@ export declare function createAppRouter(service: UiService): import("@trpc/serve
|
|
|
377
377
|
}>;
|
|
378
378
|
}>>;
|
|
379
379
|
memory: import("@trpc/server").TRPCBuiltRouter<{
|
|
380
|
-
ctx:
|
|
380
|
+
ctx: import("./trpc.js").UiRequestContext;
|
|
381
381
|
meta: object;
|
|
382
382
|
errorShape: import("@trpc/server").TRPCDefaultErrorShape;
|
|
383
383
|
transformer: false;
|
|
@@ -399,7 +399,7 @@ export declare function createAppRouter(service: UiService): import("@trpc/serve
|
|
|
399
399
|
}>;
|
|
400
400
|
}>>;
|
|
401
401
|
approvals: import("@trpc/server").TRPCBuiltRouter<{
|
|
402
|
-
ctx:
|
|
402
|
+
ctx: import("./trpc.js").UiRequestContext;
|
|
403
403
|
meta: object;
|
|
404
404
|
errorShape: import("@trpc/server").TRPCDefaultErrorShape;
|
|
405
405
|
transformer: false;
|
|
@@ -437,7 +437,7 @@ export declare function createAppRouter(service: UiService): import("@trpc/serve
|
|
|
437
437
|
}>;
|
|
438
438
|
}>>;
|
|
439
439
|
issues: import("@trpc/server").TRPCBuiltRouter<{
|
|
440
|
-
ctx:
|
|
440
|
+
ctx: import("./trpc.js").UiRequestContext;
|
|
441
441
|
meta: object;
|
|
442
442
|
errorShape: import("@trpc/server").TRPCDefaultErrorShape;
|
|
443
443
|
transformer: false;
|
|
@@ -467,7 +467,7 @@ export declare function createAppRouter(service: UiService): import("@trpc/serve
|
|
|
467
467
|
}>;
|
|
468
468
|
}>>;
|
|
469
469
|
notes: import("@trpc/server").TRPCBuiltRouter<{
|
|
470
|
-
ctx:
|
|
470
|
+
ctx: import("./trpc.js").UiRequestContext;
|
|
471
471
|
meta: object;
|
|
472
472
|
errorShape: import("@trpc/server").TRPCDefaultErrorShape;
|
|
473
473
|
transformer: false;
|
|
@@ -522,7 +522,7 @@ export declare function createAppRouter(service: UiService): import("@trpc/serve
|
|
|
522
522
|
}>;
|
|
523
523
|
}>>;
|
|
524
524
|
cost: import("@trpc/server").TRPCBuiltRouter<{
|
|
525
|
-
ctx:
|
|
525
|
+
ctx: import("./trpc.js").UiRequestContext;
|
|
526
526
|
meta: object;
|
|
527
527
|
errorShape: import("@trpc/server").TRPCDefaultErrorShape;
|
|
528
528
|
transformer: false;
|
|
@@ -536,7 +536,7 @@ export declare function createAppRouter(service: UiService): import("@trpc/serve
|
|
|
536
536
|
}>;
|
|
537
537
|
}>>;
|
|
538
538
|
config: import("@trpc/server").TRPCBuiltRouter<{
|
|
539
|
-
ctx:
|
|
539
|
+
ctx: import("./trpc.js").UiRequestContext;
|
|
540
540
|
meta: object;
|
|
541
541
|
errorShape: import("@trpc/server").TRPCDefaultErrorShape;
|
|
542
542
|
transformer: false;
|
|
@@ -600,7 +600,7 @@ export declare function createAppRouter(service: UiService): import("@trpc/serve
|
|
|
600
600
|
}>;
|
|
601
601
|
}>>;
|
|
602
602
|
models: import("@trpc/server").TRPCBuiltRouter<{
|
|
603
|
-
ctx:
|
|
603
|
+
ctx: import("./trpc.js").UiRequestContext;
|
|
604
604
|
meta: object;
|
|
605
605
|
errorShape: import("@trpc/server").TRPCDefaultErrorShape;
|
|
606
606
|
transformer: false;
|
|
@@ -611,7 +611,7 @@ export declare function createAppRouter(service: UiService): import("@trpc/serve
|
|
|
611
611
|
meta: object;
|
|
612
612
|
}>;
|
|
613
613
|
favorites: import("@trpc/server").TRPCBuiltRouter<{
|
|
614
|
-
ctx:
|
|
614
|
+
ctx: import("./trpc.js").UiRequestContext;
|
|
615
615
|
meta: object;
|
|
616
616
|
errorShape: import("@trpc/server").TRPCDefaultErrorShape;
|
|
617
617
|
transformer: false;
|
|
@@ -652,7 +652,7 @@ export declare function createAppRouter(service: UiService): import("@trpc/serve
|
|
|
652
652
|
}>;
|
|
653
653
|
}>>;
|
|
654
654
|
auth: import("@trpc/server").TRPCBuiltRouter<{
|
|
655
|
-
ctx:
|
|
655
|
+
ctx: import("./trpc.js").UiRequestContext;
|
|
656
656
|
meta: object;
|
|
657
657
|
errorShape: import("@trpc/server").TRPCDefaultErrorShape;
|
|
658
658
|
transformer: false;
|
|
@@ -743,7 +743,7 @@ export declare function createAppRouter(service: UiService): import("@trpc/serve
|
|
|
743
743
|
}>;
|
|
744
744
|
}>>;
|
|
745
745
|
usageSharing: import("@trpc/server").TRPCBuiltRouter<{
|
|
746
|
-
ctx:
|
|
746
|
+
ctx: import("./trpc.js").UiRequestContext;
|
|
747
747
|
meta: object;
|
|
748
748
|
errorShape: import("@trpc/server").TRPCDefaultErrorShape;
|
|
749
749
|
transformer: false;
|
|
@@ -764,8 +764,51 @@ export declare function createAppRouter(service: UiService): import("@trpc/serve
|
|
|
764
764
|
meta: object;
|
|
765
765
|
}>;
|
|
766
766
|
}>>;
|
|
767
|
+
telemetry: import("@trpc/server").TRPCBuiltRouter<{
|
|
768
|
+
ctx: import("./trpc.js").UiRequestContext;
|
|
769
|
+
meta: object;
|
|
770
|
+
errorShape: import("@trpc/server").TRPCDefaultErrorShape;
|
|
771
|
+
transformer: false;
|
|
772
|
+
}, import("@trpc/server").TRPCDecorateCreateRouterOptions<{
|
|
773
|
+
info: import("@trpc/server").TRPCQueryProcedure<{
|
|
774
|
+
input: Record<string, never>;
|
|
775
|
+
output: import("./types.js").TelemetryInfo;
|
|
776
|
+
meta: object;
|
|
777
|
+
}>;
|
|
778
|
+
report: import("@trpc/server").TRPCMutationProcedure<{
|
|
779
|
+
input: {
|
|
780
|
+
kind: "crash";
|
|
781
|
+
crashKind: "renderError" | "unhandledRejection" | "windowError";
|
|
782
|
+
errorName: string;
|
|
783
|
+
message: string;
|
|
784
|
+
stack: string;
|
|
785
|
+
route?: string;
|
|
786
|
+
buildStamp?: string;
|
|
787
|
+
uptimeS?: number;
|
|
788
|
+
} | {
|
|
789
|
+
kind: "native_crash";
|
|
790
|
+
component: "android" | "desktop";
|
|
791
|
+
at: string;
|
|
792
|
+
message: string;
|
|
793
|
+
stack: string;
|
|
794
|
+
appVersion: string;
|
|
795
|
+
} | {
|
|
796
|
+
kind: "load";
|
|
797
|
+
ttfbMs?: number;
|
|
798
|
+
firstRenderMs?: number;
|
|
799
|
+
interactiveMs?: number;
|
|
800
|
+
} | {
|
|
801
|
+
kind: "sse_reconnect";
|
|
802
|
+
count: number;
|
|
803
|
+
};
|
|
804
|
+
output: {
|
|
805
|
+
ok: true;
|
|
806
|
+
};
|
|
807
|
+
meta: object;
|
|
808
|
+
}>;
|
|
809
|
+
}>>;
|
|
767
810
|
hooks: import("@trpc/server").TRPCBuiltRouter<{
|
|
768
|
-
ctx:
|
|
811
|
+
ctx: import("./trpc.js").UiRequestContext;
|
|
769
812
|
meta: object;
|
|
770
813
|
errorShape: import("@trpc/server").TRPCDefaultErrorShape;
|
|
771
814
|
transformer: false;
|
|
@@ -785,7 +828,7 @@ export declare function createAppRouter(service: UiService): import("@trpc/serve
|
|
|
785
828
|
timeoutSec?: number;
|
|
786
829
|
backends?: ("claude" | "pi")[];
|
|
787
830
|
requiresTool?: string;
|
|
788
|
-
result?: "
|
|
831
|
+
result?: "none" | "stdout-as-prompt";
|
|
789
832
|
enabled?: boolean;
|
|
790
833
|
id: string;
|
|
791
834
|
};
|
|
@@ -802,7 +845,7 @@ export declare function createAppRouter(service: UiService): import("@trpc/serve
|
|
|
802
845
|
timeoutSec?: number;
|
|
803
846
|
backends?: ("claude" | "pi")[];
|
|
804
847
|
requiresTool?: string;
|
|
805
|
-
result?: "
|
|
848
|
+
result?: "none" | "stdout-as-prompt";
|
|
806
849
|
enabled?: boolean;
|
|
807
850
|
id: string;
|
|
808
851
|
};
|
|
@@ -834,7 +877,7 @@ export declare function createAppRouter(service: UiService): import("@trpc/serve
|
|
|
834
877
|
}>;
|
|
835
878
|
}>>;
|
|
836
879
|
machines: import("@trpc/server").TRPCBuiltRouter<{
|
|
837
|
-
ctx:
|
|
880
|
+
ctx: import("./trpc.js").UiRequestContext;
|
|
838
881
|
meta: object;
|
|
839
882
|
errorShape: import("@trpc/server").TRPCDefaultErrorShape;
|
|
840
883
|
transformer: false;
|
|
@@ -853,7 +896,7 @@ export declare function createAppRouter(service: UiService): import("@trpc/serve
|
|
|
853
896
|
}>;
|
|
854
897
|
}>>;
|
|
855
898
|
skills: import("@trpc/server").TRPCBuiltRouter<{
|
|
856
|
-
ctx:
|
|
899
|
+
ctx: import("./trpc.js").UiRequestContext;
|
|
857
900
|
meta: object;
|
|
858
901
|
errorShape: import("@trpc/server").TRPCDefaultErrorShape;
|
|
859
902
|
transformer: false;
|
|
@@ -873,7 +916,7 @@ export declare function createAppRouter(service: UiService): import("@trpc/serve
|
|
|
873
916
|
}>;
|
|
874
917
|
}>>;
|
|
875
918
|
plugins: import("@trpc/server").TRPCBuiltRouter<{
|
|
876
|
-
ctx:
|
|
919
|
+
ctx: import("./trpc.js").UiRequestContext;
|
|
877
920
|
meta: object;
|
|
878
921
|
errorShape: import("@trpc/server").TRPCDefaultErrorShape;
|
|
879
922
|
transformer: false;
|
|
@@ -991,13 +1034,14 @@ export declare function createAppRouter(service: UiService): import("@trpc/serve
|
|
|
991
1034
|
env?: Record<string, string>;
|
|
992
1035
|
headers?: Record<string, string>;
|
|
993
1036
|
}[];
|
|
1037
|
+
baseHash: string;
|
|
994
1038
|
};
|
|
995
1039
|
output: import("./types.js").PluginsMcpRead;
|
|
996
1040
|
meta: object;
|
|
997
1041
|
}>;
|
|
998
1042
|
}>>;
|
|
999
1043
|
environments: import("@trpc/server").TRPCBuiltRouter<{
|
|
1000
|
-
ctx:
|
|
1044
|
+
ctx: import("./trpc.js").UiRequestContext;
|
|
1001
1045
|
meta: object;
|
|
1002
1046
|
errorShape: import("@trpc/server").TRPCDefaultErrorShape;
|
|
1003
1047
|
transformer: false;
|
|
@@ -1048,7 +1092,7 @@ export declare function createAppRouter(service: UiService): import("@trpc/serve
|
|
|
1048
1092
|
}>;
|
|
1049
1093
|
}>>;
|
|
1050
1094
|
system: import("@trpc/server").TRPCBuiltRouter<{
|
|
1051
|
-
ctx:
|
|
1095
|
+
ctx: import("./trpc.js").UiRequestContext;
|
|
1052
1096
|
meta: object;
|
|
1053
1097
|
errorShape: import("@trpc/server").TRPCDefaultErrorShape;
|
|
1054
1098
|
transformer: false;
|
|
@@ -2,7 +2,7 @@ import { platformSettingsInput } from '../../core/platform-settings-spec.js';
|
|
|
2
2
|
import { TRPCError } from '@trpc/server';
|
|
3
3
|
import { z } from 'zod';
|
|
4
4
|
import { router, publicProcedure } from './trpc.js';
|
|
5
|
-
import { projectsListInput, projectsCreateInput, sessionsListInput, sessionsTranscriptInput, sessionsSubagentTranscriptInput, sessionsDebugDetailsInput, sessionsCreateInput, sessionsSendInput, sessionsCancelInput, sessionsCompactInput, sessionsSetAgentInput, sessionsSetSelectionInput, sessionsCreateAndSendInput, sessionsMarkReadInput, sessionsSetStarredInput, sessionsRenameInput, sessionsMarkManyReadInput, sessionsAnswerQuestionInput, sessionsRespondPlanInput, sessionsRespondDecisionInput, sessionsCancelResumeInput, sessionsRewindInput, sessionsResolveMediaInput, sessionsPendingInteractionInput, schedulesListInput, boardsListInput, boardsGetInput, boardsDecisionsInput, boardsStyleInput, executionsListInput, waitpointsListInput, executionsGetInput, memoryTreeInput, memoryFileInput, approvalsListInput, approvalsApproveInput, approvalsRejectInput, approvalsRequestInput, issuesListInput, issueActionInput, notesListInput, noteAddInput, noteUpdateInput, noteSetCompletedInput, noteActionInput, notesClearCompletedInput, costSummaryInput, executionsCancelInput, waitpointsCancelInput, scheduleActionInput, scheduleAddInput, scheduleUpdateInput, configGetInput, configSetInput, configSetProviderRateLimitPolicyInput, authStatusInput, authFlowStateInput, authStartLoginInput, authRespondPromptInput, authCancelFlowInput, authLogoutInput, authSyncGatewayInput, authCustomProvidersInput, authUpsertCustomProviderInput, authRemoveCustomProviderInput, usageSharingGetInput, usageSharingSetInput, hooksListInput, hooksCreateInput, hooksUpdateInput, hooksSetEnabledInput, hooksRemoveInput, hooksTestInput, modelsFavoriteInput, modelsSetDefaultInput, modelsSetThinkingInput, modelsCatalogInput, machinesListInput, machineDetailInput, skillsListInput, skillsSessionInput, pluginsListInput, pluginsAssignInput, pluginsSkillFileInput, pluginsSkillWriteInput, pluginsSkillCreateInput, pluginsSkillMoveInput, pluginsSkillRemoveInput, pluginsSkillRevertInput, pluginsCreateInput, pluginsRemoveInput, pluginsConvertInput, pluginsMcpReadInput, pluginsMcpWriteInput, environmentsListInput, environmentsGetInput, environmentsValidateInput, environmentsSaveInput, environmentsDeleteInput, environmentsSavePromptInput, systemDaemonStatusInput, systemRateLimitStatusInput, systemUsageStatusInput, systemNoticesInput, systemRestartInput, systemClearRateLimitInput, systemRefreshUsageInput, systemRedeemUsageResetInput, systemUpdateStatusInput, systemCheckUpdateInput, systemApplyUpdateInput, systemSkipUpdateInput, } from './input-schemas.js';
|
|
5
|
+
import { projectsListInput, projectsCreateInput, sessionsListInput, sessionsTranscriptInput, sessionsSubagentTranscriptInput, sessionsDebugDetailsInput, sessionsCreateInput, sessionsSendInput, sessionsCancelInput, sessionsCompactInput, sessionsSetAgentInput, sessionsSetSelectionInput, sessionsCreateAndSendInput, sessionsMarkReadInput, sessionsSetStarredInput, sessionsRenameInput, sessionsMarkManyReadInput, sessionsAnswerQuestionInput, sessionsRespondPlanInput, sessionsRespondDecisionInput, sessionsCancelResumeInput, sessionsRewindInput, sessionsResolveMediaInput, sessionsPendingInteractionInput, schedulesListInput, boardsListInput, boardsGetInput, boardsDecisionsInput, boardsStyleInput, executionsListInput, waitpointsListInput, executionsGetInput, memoryTreeInput, memoryFileInput, approvalsListInput, approvalsApproveInput, approvalsRejectInput, approvalsRequestInput, issuesListInput, issueActionInput, notesListInput, noteAddInput, noteUpdateInput, noteSetCompletedInput, noteActionInput, notesClearCompletedInput, costSummaryInput, executionsCancelInput, waitpointsCancelInput, scheduleActionInput, scheduleAddInput, scheduleUpdateInput, configGetInput, configSetInput, configSetProviderRateLimitPolicyInput, authStatusInput, authFlowStateInput, authStartLoginInput, authRespondPromptInput, authCancelFlowInput, authLogoutInput, authSyncGatewayInput, authCustomProvidersInput, authUpsertCustomProviderInput, authRemoveCustomProviderInput, usageSharingGetInput, usageSharingSetInput, telemetryInfoInput, telemetryReportInput, hooksListInput, hooksCreateInput, hooksUpdateInput, hooksSetEnabledInput, hooksRemoveInput, hooksTestInput, modelsFavoriteInput, modelsSetDefaultInput, modelsSetThinkingInput, modelsCatalogInput, machinesListInput, machineDetailInput, skillsListInput, skillsSessionInput, pluginsListInput, pluginsAssignInput, pluginsSkillFileInput, pluginsSkillWriteInput, pluginsSkillCreateInput, pluginsSkillMoveInput, pluginsSkillRemoveInput, pluginsSkillRevertInput, pluginsCreateInput, pluginsRemoveInput, pluginsConvertInput, pluginsMcpReadInput, pluginsMcpWriteInput, environmentsListInput, environmentsGetInput, environmentsValidateInput, environmentsSaveInput, environmentsDeleteInput, environmentsSavePromptInput, systemDaemonStatusInput, systemRateLimitStatusInput, systemUsageStatusInput, systemNoticesInput, systemRestartInput, systemClearRateLimitInput, systemRefreshUsageInput, systemRedeemUsageResetInput, systemUpdateStatusInput, systemCheckUpdateInput, systemApplyUpdateInput, systemSkipUpdateInput, } from './input-schemas.js';
|
|
6
6
|
// ── Subscribe filter input (no keyed schema for subscribe; router-local) ──
|
|
7
7
|
const subscribeFilterInput = z.object({
|
|
8
8
|
events: z.array(z.string()),
|
|
@@ -56,7 +56,7 @@ function makeQuery(uiService, scope, schema) {
|
|
|
56
56
|
function makeMutation(uiService, op, schema) {
|
|
57
57
|
return publicProcedure
|
|
58
58
|
.input(schema)
|
|
59
|
-
.mutation(async ({ input }) => unwrap(await uiService.mutate(op, input)));
|
|
59
|
+
.mutation(async ({ input, ctx }) => unwrap(await uiService.mutate(op, input, { client: ctx.client ?? null })));
|
|
60
60
|
}
|
|
61
61
|
// ── AppRouter ─────────────────────────────────────────────────────────────────────
|
|
62
62
|
function projectsRouter(service) {
|
|
@@ -198,6 +198,12 @@ function usageSharingRouter(service) {
|
|
|
198
198
|
set: makeMutation(service, 'usageSharing.set', usageSharingSetInput),
|
|
199
199
|
});
|
|
200
200
|
}
|
|
201
|
+
function telemetryRouter(service) {
|
|
202
|
+
return router({
|
|
203
|
+
info: makeQuery(service, 'telemetry.info', telemetryInfoInput),
|
|
204
|
+
report: makeMutation(service, 'telemetry.report', telemetryReportInput),
|
|
205
|
+
});
|
|
206
|
+
}
|
|
201
207
|
function systemRouter(service) {
|
|
202
208
|
return router({
|
|
203
209
|
daemonStatus: makeQuery(service, 'system.daemonStatus', systemDaemonStatusInput),
|
|
@@ -294,6 +300,7 @@ export function createAppRouter(service) {
|
|
|
294
300
|
models: modelsRouter(service),
|
|
295
301
|
auth: authRouter(service),
|
|
296
302
|
usageSharing: usageSharingRouter(service),
|
|
303
|
+
telemetry: telemetryRouter(service),
|
|
297
304
|
hooks: hooksRouter(service),
|
|
298
305
|
machines: machinesRouter(service),
|
|
299
306
|
skills: skillsRouter(service),
|
|
@@ -21,6 +21,39 @@ export declare const usageSharingSetInput: z.ZodObject<{
|
|
|
21
21
|
org: z.ZodOptional<z.ZodString>;
|
|
22
22
|
email: z.ZodOptional<z.ZodString>;
|
|
23
23
|
}, z.core.$strip>;
|
|
24
|
+
export declare const telemetryInfoInput: z.ZodObject<{}, z.core.$strip>;
|
|
25
|
+
export declare const telemetryReportInput: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
26
|
+
kind: z.ZodLiteral<"crash">;
|
|
27
|
+
crashKind: z.ZodEnum<{
|
|
28
|
+
renderError: "renderError";
|
|
29
|
+
unhandledRejection: "unhandledRejection";
|
|
30
|
+
windowError: "windowError";
|
|
31
|
+
}>;
|
|
32
|
+
errorName: z.ZodString;
|
|
33
|
+
message: z.ZodString;
|
|
34
|
+
stack: z.ZodString;
|
|
35
|
+
route: z.ZodNullable<z.ZodString>;
|
|
36
|
+
buildStamp: z.ZodNullable<z.ZodString>;
|
|
37
|
+
uptimeS: z.ZodNullable<z.ZodNumber>;
|
|
38
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
39
|
+
kind: z.ZodLiteral<"native_crash">;
|
|
40
|
+
component: z.ZodEnum<{
|
|
41
|
+
android: "android";
|
|
42
|
+
desktop: "desktop";
|
|
43
|
+
}>;
|
|
44
|
+
at: z.ZodISODateTime;
|
|
45
|
+
message: z.ZodString;
|
|
46
|
+
stack: z.ZodString;
|
|
47
|
+
appVersion: z.ZodString;
|
|
48
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
49
|
+
kind: z.ZodLiteral<"load">;
|
|
50
|
+
ttfbMs: z.ZodNullable<z.ZodNumber>;
|
|
51
|
+
firstRenderMs: z.ZodNullable<z.ZodNumber>;
|
|
52
|
+
interactiveMs: z.ZodNullable<z.ZodNumber>;
|
|
53
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
54
|
+
kind: z.ZodLiteral<"sse_reconnect">;
|
|
55
|
+
count: z.ZodNumber;
|
|
56
|
+
}, z.core.$strip>], "kind">;
|
|
24
57
|
export declare const modelsCatalogInput: z.ZodObject<{}, z.core.$strip>;
|
|
25
58
|
export declare const machinesListInput: z.ZodObject<{}, z.core.$strip>;
|
|
26
59
|
export declare const machineDetailInput: z.ZodObject<{
|
|
@@ -275,7 +308,6 @@ export declare const hooksCreateInput: z.ZodObject<{
|
|
|
275
308
|
}>>>;
|
|
276
309
|
requiresTool: z.ZodOptional<z.ZodString>;
|
|
277
310
|
result: z.ZodOptional<z.ZodEnum<{
|
|
278
|
-
"hook-result": "hook-result";
|
|
279
311
|
none: "none";
|
|
280
312
|
"stdout-as-prompt": "stdout-as-prompt";
|
|
281
313
|
}>>;
|
|
@@ -295,7 +327,6 @@ export declare const hooksUpdateInput: z.ZodObject<{
|
|
|
295
327
|
}>>>;
|
|
296
328
|
requiresTool: z.ZodOptional<z.ZodString>;
|
|
297
329
|
result: z.ZodOptional<z.ZodEnum<{
|
|
298
|
-
"hook-result": "hook-result";
|
|
299
330
|
none: "none";
|
|
300
331
|
"stdout-as-prompt": "stdout-as-prompt";
|
|
301
332
|
}>>;
|
|
@@ -397,6 +428,7 @@ export declare const pluginsMcpWriteInput: z.ZodObject<{
|
|
|
397
428
|
env: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodNullable<z.ZodString>>>;
|
|
398
429
|
headers: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodNullable<z.ZodString>>>;
|
|
399
430
|
}, z.core.$strip>>;
|
|
431
|
+
baseHash: z.ZodString;
|
|
400
432
|
}, z.core.$strip>;
|
|
401
433
|
export declare const environmentsGetInput: z.ZodObject<{
|
|
402
434
|
name: z.ZodString;
|
|
@@ -565,6 +597,7 @@ export declare const queryInputSchemas: {
|
|
|
565
597
|
}, z.core.$strip>;
|
|
566
598
|
'auth.customProviders': z.ZodObject<{}, z.core.$strip>;
|
|
567
599
|
'usageSharing.get': z.ZodObject<{}, z.core.$strip>;
|
|
600
|
+
'telemetry.info': z.ZodObject<{}, z.core.$strip>;
|
|
568
601
|
'models.catalog': z.ZodObject<{}, z.core.$strip>;
|
|
569
602
|
'hooks.list': z.ZodObject<{}, z.core.$strip>;
|
|
570
603
|
'machines.list': z.ZodObject<{}, z.core.$strip>;
|
|
@@ -896,6 +929,38 @@ export declare const mutateInputSchemas: {
|
|
|
896
929
|
org: z.ZodOptional<z.ZodString>;
|
|
897
930
|
email: z.ZodOptional<z.ZodString>;
|
|
898
931
|
}, z.core.$strip>;
|
|
932
|
+
'telemetry.report': z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
933
|
+
kind: z.ZodLiteral<"crash">;
|
|
934
|
+
crashKind: z.ZodEnum<{
|
|
935
|
+
renderError: "renderError";
|
|
936
|
+
unhandledRejection: "unhandledRejection";
|
|
937
|
+
windowError: "windowError";
|
|
938
|
+
}>;
|
|
939
|
+
errorName: z.ZodString;
|
|
940
|
+
message: z.ZodString;
|
|
941
|
+
stack: z.ZodString;
|
|
942
|
+
route: z.ZodNullable<z.ZodString>;
|
|
943
|
+
buildStamp: z.ZodNullable<z.ZodString>;
|
|
944
|
+
uptimeS: z.ZodNullable<z.ZodNumber>;
|
|
945
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
946
|
+
kind: z.ZodLiteral<"native_crash">;
|
|
947
|
+
component: z.ZodEnum<{
|
|
948
|
+
android: "android";
|
|
949
|
+
desktop: "desktop";
|
|
950
|
+
}>;
|
|
951
|
+
at: z.ZodISODateTime;
|
|
952
|
+
message: z.ZodString;
|
|
953
|
+
stack: z.ZodString;
|
|
954
|
+
appVersion: z.ZodString;
|
|
955
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
956
|
+
kind: z.ZodLiteral<"load">;
|
|
957
|
+
ttfbMs: z.ZodNullable<z.ZodNumber>;
|
|
958
|
+
firstRenderMs: z.ZodNullable<z.ZodNumber>;
|
|
959
|
+
interactiveMs: z.ZodNullable<z.ZodNumber>;
|
|
960
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
961
|
+
kind: z.ZodLiteral<"sse_reconnect">;
|
|
962
|
+
count: z.ZodNumber;
|
|
963
|
+
}, z.core.$strip>], "kind">;
|
|
899
964
|
'hooks.create': z.ZodObject<{
|
|
900
965
|
event: z.ZodString;
|
|
901
966
|
matcher: z.ZodOptional<z.ZodString>;
|
|
@@ -909,7 +974,6 @@ export declare const mutateInputSchemas: {
|
|
|
909
974
|
}>>>;
|
|
910
975
|
requiresTool: z.ZodOptional<z.ZodString>;
|
|
911
976
|
result: z.ZodOptional<z.ZodEnum<{
|
|
912
|
-
"hook-result": "hook-result";
|
|
913
977
|
none: "none";
|
|
914
978
|
"stdout-as-prompt": "stdout-as-prompt";
|
|
915
979
|
}>>;
|
|
@@ -929,7 +993,6 @@ export declare const mutateInputSchemas: {
|
|
|
929
993
|
}>>>;
|
|
930
994
|
requiresTool: z.ZodOptional<z.ZodString>;
|
|
931
995
|
result: z.ZodOptional<z.ZodEnum<{
|
|
932
|
-
"hook-result": "hook-result";
|
|
933
996
|
none: "none";
|
|
934
997
|
"stdout-as-prompt": "stdout-as-prompt";
|
|
935
998
|
}>>;
|
|
@@ -1027,6 +1090,7 @@ export declare const mutateInputSchemas: {
|
|
|
1027
1090
|
env: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodNullable<z.ZodString>>>;
|
|
1028
1091
|
headers: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodNullable<z.ZodString>>>;
|
|
1029
1092
|
}, z.core.$strip>>;
|
|
1093
|
+
baseHash: z.ZodString;
|
|
1030
1094
|
}, z.core.$strip>;
|
|
1031
1095
|
'environments.validate': z.ZodObject<{
|
|
1032
1096
|
name: z.ZodString;
|
|
@@ -5,6 +5,7 @@ import { RESET_PROVIDERS } from '../costs/reset-account.js';
|
|
|
5
5
|
import { sessionsSetStarredInput, sessionsRenameInput } from './session-metadata-schemas.js';
|
|
6
6
|
export { sessionsSetStarredInput, sessionsRenameInput } from './session-metadata-schemas.js';
|
|
7
7
|
import { t } from '../../core/i18n.js';
|
|
8
|
+
import { WebTelemetryReportSchema } from '../telemetry/schema.js';
|
|
8
9
|
import { SETTINGS_SPEC } from '../../core/settings-spec.js';
|
|
9
10
|
import { CUSTOM_PROVIDER_APIS, CUSTOM_PROVIDER_NAME_RE, } from '../pi-providers/custom-provider-model.js';
|
|
10
11
|
import { sessionsListInput, sessionsTranscriptInput, sessionsSubagentTranscriptInput, sessionsDebugDetailsInput, sessionsPendingInteractionInput, schedulesListInput, boardsListInput, boardsGetInput, boardsDecisionsInput, boardsStyleInput, executionsListInput, executionsGetInput, waitpointsListInput, memoryTreeInput, memoryFileInput, approvalsListInput, issuesListInput, notesListInput, } from './query-input-schemas.js';
|
|
@@ -29,6 +30,10 @@ export const usageSharingSetInput = z.object({
|
|
|
29
30
|
org: z.string().trim().optional(),
|
|
30
31
|
email: z.string().trim().optional(),
|
|
31
32
|
});
|
|
33
|
+
// telemetry.info / telemetry.report — anonymous product telemetry. The report payload is the
|
|
34
|
+
// shared wire schema; the server redacts and folds it in.
|
|
35
|
+
export const telemetryInfoInput = z.object({});
|
|
36
|
+
export const telemetryReportInput = WebTelemetryReportSchema;
|
|
32
37
|
// models.catalog — discover selectable models and gateway routes.
|
|
33
38
|
export const modelsCatalogInput = z.object({});
|
|
34
39
|
export const machinesListInput = z.object({});
|
|
@@ -375,7 +380,7 @@ const hookDraftShape = {
|
|
|
375
380
|
timeoutSec: z.number().finite().positive().optional(),
|
|
376
381
|
backends: z.array(z.enum(['claude', 'pi'])).optional(),
|
|
377
382
|
requiresTool: z.string().min(1).optional(),
|
|
378
|
-
result: z.enum(['
|
|
383
|
+
result: z.enum(['stdout-as-prompt', 'none']).optional(),
|
|
379
384
|
enabled: z.boolean().optional(),
|
|
380
385
|
};
|
|
381
386
|
/** The loader requires exactly one of script/command; reject the other two shapes up front. */
|
|
@@ -475,6 +480,7 @@ export const pluginsMcpWriteInput = z.object({
|
|
|
475
480
|
env: pluginSecretPatch.optional(),
|
|
476
481
|
headers: pluginSecretPatch.optional(),
|
|
477
482
|
})).max(32),
|
|
483
|
+
baseHash: sha256HashInput,
|
|
478
484
|
});
|
|
479
485
|
// environments.get / validate / save / delete — the environment editing surface. The name pattern
|
|
480
486
|
// mirrors the environment writer's: the filename IS the identity, so anything that could escape the
|
|
@@ -605,6 +611,7 @@ export const queryInputSchemas = {
|
|
|
605
611
|
'auth.flowState': authFlowStateInput,
|
|
606
612
|
'auth.customProviders': authCustomProvidersInput,
|
|
607
613
|
'usageSharing.get': usageSharingGetInput,
|
|
614
|
+
'telemetry.info': telemetryInfoInput,
|
|
608
615
|
'models.catalog': modelsCatalogInput,
|
|
609
616
|
'hooks.list': hooksListInput,
|
|
610
617
|
'machines.list': machinesListInput,
|
|
@@ -669,6 +676,7 @@ export const mutateInputSchemas = {
|
|
|
669
676
|
'auth.upsertCustomProvider': authUpsertCustomProviderInput,
|
|
670
677
|
'auth.removeCustomProvider': authRemoveCustomProviderInput,
|
|
671
678
|
'usageSharing.set': usageSharingSetInput,
|
|
679
|
+
'telemetry.report': telemetryReportInput,
|
|
672
680
|
'hooks.create': hooksCreateInput,
|
|
673
681
|
'hooks.update': hooksUpdateInput,
|
|
674
682
|
'hooks.setEnabled': hooksSetEnabledInput,
|
|
@@ -12,8 +12,9 @@ export declare function applyApprovalDecision(md: string, id: string, decision:
|
|
|
12
12
|
export declare function handleApproveApproval(deps: UiServiceDeps, args: MutateArgs<'approvals.approve'>): Promise<Result<ApprovalMutateReturn>>;
|
|
13
13
|
export declare function handleRejectApproval(deps: UiServiceDeps, args: MutateArgs<'approvals.reject'>): Promise<Result<ApprovalMutateReturn>>;
|
|
14
14
|
/**
|
|
15
|
-
* Build the markdown block for a queued high-privilege operation
|
|
16
|
-
*
|
|
15
|
+
* Build the markdown block for a queued high-privilege operation in the PENDING_APPROVALS.md entry
|
|
16
|
+
* format (`## <date> <title>` plus `- **Field**:` bullets), so `parseApprovals` reads it back and
|
|
17
|
+
* the Approval Center renders it.
|
|
17
18
|
* SECURITY: every prose field is SERVER-constructed from the closed `kind` enum — the browser never
|
|
18
19
|
* supplies markdown. The only free-text input, `machineName`, is sanitized (newlines stripped,
|
|
19
20
|
* length-capped) so it cannot inject a new `##` heading or bullet. Returns the heading line (for a
|
|
@@ -65,8 +65,9 @@ export async function handleRejectApproval(deps, args) {
|
|
|
65
65
|
return decide(deps, args.id, 'rejected', args.feedback);
|
|
66
66
|
}
|
|
67
67
|
/**
|
|
68
|
-
* Build the markdown block for a queued high-privilege operation
|
|
69
|
-
*
|
|
68
|
+
* Build the markdown block for a queued high-privilege operation in the PENDING_APPROVALS.md entry
|
|
69
|
+
* format (`## <date> <title>` plus `- **Field**:` bullets), so `parseApprovals` reads it back and
|
|
70
|
+
* the Approval Center renders it.
|
|
70
71
|
* SECURITY: every prose field is SERVER-constructed from the closed `kind` enum — the browser never
|
|
71
72
|
* supplies markdown. The only free-text input, `machineName`, is sanitized (newlines stripped,
|
|
72
73
|
* length-capped) so it cannot inject a new `##` heading or bullet. Returns the heading line (for a
|
|
@@ -146,7 +146,7 @@ export async function handlePluginsMcpWrite(_deps, args) {
|
|
|
146
146
|
for (const server of args.servers) {
|
|
147
147
|
next[server.name] = buildServer(server, current[server.name]);
|
|
148
148
|
}
|
|
149
|
-
writeMcpEnvelope(args.pluginId, next);
|
|
149
|
+
writeMcpEnvelope(args.pluginId, next, args.baseHash);
|
|
150
150
|
return readMcpDrafts(args.pluginId);
|
|
151
151
|
});
|
|
152
152
|
}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { MutateArgs, Result, UiCallContext, UiServiceDeps } from '../types.js';
|
|
2
|
+
/** A web-side observation (crash, load timing, reconnects); always acknowledged. */
|
|
3
|
+
export declare function handleTelemetryReport(_deps: UiServiceDeps, args: MutateArgs<'telemetry.report'>, ctx: UiCallContext): Promise<Result<{
|
|
4
|
+
ok: true;
|
|
5
|
+
}>>;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { recordWebReport } from '../../telemetry/web-report.js';
|
|
2
|
+
/** A web-side observation (crash, load timing, reconnects); always acknowledged. */
|
|
3
|
+
export async function handleTelemetryReport(_deps, args, ctx) {
|
|
4
|
+
recordWebReport(args, ctx.client);
|
|
5
|
+
return { ok: true, data: { ok: true } };
|
|
6
|
+
}
|
|
@@ -8,10 +8,11 @@ const FIELD_KEYS = {
|
|
|
8
8
|
Reason: 'reason',
|
|
9
9
|
Impact: 'impact',
|
|
10
10
|
'Command/Action': 'command',
|
|
11
|
-
// Owning project
|
|
11
|
+
// Owning project, an optional bullet on hand-written entries. The approval-gate builder omits it
|
|
12
|
+
// (system-level operations), so those entries parse to null.
|
|
12
13
|
Project: 'projectId',
|
|
13
|
-
// The only real origin/task carrier — an OPTIONAL freeform bullet
|
|
14
|
-
//
|
|
14
|
+
// The only real origin/task carrier — an OPTIONAL freeform bullet some hand-written entries add.
|
|
15
|
+
// The approval-gate builder never emits it; honest null when absent.
|
|
15
16
|
Provenance: 'provenance',
|
|
16
17
|
};
|
|
17
18
|
// Words that close an entry without being a plain `approved` — the queue is hand-edited, and a
|
|
@@ -3,7 +3,7 @@ import type { MachineGpu, MachineVitals } from '../types.js';
|
|
|
3
3
|
export declare const PROBE_TIMEOUT_MS = 15000;
|
|
4
4
|
/**
|
|
5
5
|
* One command, one round trip. Every stage is individually failure-tolerant (`2>/dev/null`) so a
|
|
6
|
-
* host without nvidia-smi
|
|
6
|
+
* host without nvidia-smi or /proc still returns the sections it can fill — the parser maps
|
|
7
7
|
* the missing ones to null rather than to zero. `df -kP` forces POSIX single-line output.
|
|
8
8
|
*/
|
|
9
9
|
export declare function buildProbeCommand(cortexPath: string | null): string;
|
|
@@ -7,7 +7,7 @@ function shellQuote(value) {
|
|
|
7
7
|
}
|
|
8
8
|
/**
|
|
9
9
|
* One command, one round trip. Every stage is individually failure-tolerant (`2>/dev/null`) so a
|
|
10
|
-
* host without nvidia-smi
|
|
10
|
+
* host without nvidia-smi or /proc still returns the sections it can fill — the parser maps
|
|
11
11
|
* the missing ones to null rather than to zero. `df -kP` forces POSIX single-line output.
|
|
12
12
|
*/
|
|
13
13
|
export function buildProbeCommand(cortexPath) {
|
|
@@ -20,7 +20,8 @@ export function buildProbeCommand(cortexPath) {
|
|
|
20
20
|
`echo '##SYS'`,
|
|
21
21
|
'echo "cores=$(nproc 2>/dev/null)"',
|
|
22
22
|
`echo "load1=$(cut -d' ' -f1 /proc/loadavg 2>/dev/null)"`,
|
|
23
|
-
`free
|
|
23
|
+
// Git Bash has no `free`, and its /proc/meminfo lacks MemAvailable; MemFree there is available memory.
|
|
24
|
+
`awk '/^MemTotal:/{t=$2} /^MemAvailable:/{a=$2} /^MemFree:/{f=$2} END{if(a=="")a=f; if(t>0&&a!="")printf "memTotalMb=%d\\nmemUsedMb=%d\\n", t/1024, (t-a)/1024}' /proc/meminfo 2>/dev/null`,
|
|
24
25
|
`df -kP ${diskTarget} 2>/dev/null | awk 'NR==2{printf "diskTotalKb=%s\\ndiskFreeKb=%s\\n", $2, $4}'`,
|
|
25
26
|
`echo "uptimeSec=$(cut -d' ' -f1 /proc/uptime 2>/dev/null)"`,
|
|
26
27
|
].join('\n');
|
|
@@ -3,6 +3,9 @@ import { type CustomProviderView } from '../../pi-providers/index.js';
|
|
|
3
3
|
import type { ModelCatalogSnapshot, UiServiceDeps, QueryParams } from '../types.js';
|
|
4
4
|
type GatewayReader = () => Record<string, string[]>;
|
|
5
5
|
export interface ModelsCatalogReaders {
|
|
6
|
+
/** Whether this host holds any Claude credential. Defaults to the host's stores; injected in
|
|
7
|
+
* tests so the catalog never depends on this machine's login. */
|
|
8
|
+
claudeAvailable?: () => boolean;
|
|
6
9
|
/** The Anthropic models this account can reach, waiting out a cold fetch. Defaults to the host
|
|
7
10
|
* discovery singleton; injected in tests so the catalog never depends on a live credential. */
|
|
8
11
|
claudeModels?: () => Promise<DiscoveredAnthropicModel[]>;
|