@camstack/system 1.1.35 → 1.1.37

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.
Files changed (53) hide show
  1. package/dist/addon-runner.js +87 -35
  2. package/dist/addon-runner.mjs +87 -35
  3. package/dist/builtins/addon-pages-aggregator/addon-pages-aggregator.addon.d.ts +8 -4
  4. package/dist/builtins/addon-pages-aggregator/addon-pages-aggregator.addon.js +22 -10
  5. package/dist/builtins/addon-pages-aggregator/addon-pages-aggregator.addon.mjs +23 -11
  6. package/dist/builtins/addon-widgets-aggregator/addon-widgets-aggregator.addon.d.ts +4 -0
  7. package/dist/builtins/addon-widgets-aggregator/addon-widgets-aggregator.addon.js +23 -9
  8. package/dist/builtins/addon-widgets-aggregator/addon-widgets-aggregator.addon.mjs +24 -10
  9. package/dist/builtins/alerts/alerts.addon.js +1 -1
  10. package/dist/builtins/alerts/alerts.addon.mjs +1 -1
  11. package/dist/builtins/backup-orchestrator/backup-orchestrator.addon.js +1 -1
  12. package/dist/builtins/backup-orchestrator/backup-orchestrator.addon.mjs +1 -1
  13. package/dist/builtins/console-logging/index.js +1 -1
  14. package/dist/builtins/console-logging/index.mjs +1 -1
  15. package/dist/builtins/device-manager/device-manager.addon.js +1 -1
  16. package/dist/builtins/device-manager/device-manager.addon.mjs +1 -1
  17. package/dist/builtins/hub-forwarder/index.js +1 -1
  18. package/dist/builtins/hub-forwarder/index.mjs +1 -1
  19. package/dist/builtins/local-auth/local-auth.addon.js +1 -1
  20. package/dist/builtins/local-auth/local-auth.addon.mjs +1 -1
  21. package/dist/builtins/local-network/local-network.addon.js +1 -1
  22. package/dist/builtins/local-network/local-network.addon.mjs +1 -1
  23. package/dist/builtins/native-metrics/native-metrics.addon.js +1 -1
  24. package/dist/builtins/native-metrics/native-metrics.addon.mjs +1 -1
  25. package/dist/builtins/platform-probe/index.js +1 -1
  26. package/dist/builtins/platform-probe/index.mjs +1 -1
  27. package/dist/builtins/remote-access-orchestrator/remote-access-orchestrator.addon.js +1 -1
  28. package/dist/builtins/remote-access-orchestrator/remote-access-orchestrator.addon.mjs +1 -1
  29. package/dist/builtins/snapshot/index.js +1 -1
  30. package/dist/builtins/snapshot/index.mjs +1 -1
  31. package/dist/builtins/sqlite-storage/filesystem-storage.addon.js +1 -1
  32. package/dist/builtins/sqlite-storage/filesystem-storage.addon.mjs +1 -1
  33. package/dist/builtins/sqlite-storage/sqlite-settings.addon.js +1 -1
  34. package/dist/builtins/sqlite-storage/sqlite-settings.addon.mjs +1 -1
  35. package/dist/builtins/storage-orchestrator/storage-orchestrator.addon.js +1 -1
  36. package/dist/builtins/storage-orchestrator/storage-orchestrator.addon.mjs +1 -1
  37. package/dist/builtins/system-config/system-config.addon.js +1 -1
  38. package/dist/builtins/system-config/system-config.addon.mjs +1 -1
  39. package/dist/builtins/winston-logging/index.js +1 -1
  40. package/dist/builtins/winston-logging/index.mjs +1 -1
  41. package/dist/{dist-DlGZpWo8.mjs → dist-CU3lb_Ys.mjs} +401 -125
  42. package/dist/{dist-DriXJoVg.js → dist-fRVWwrkF.js} +401 -125
  43. package/dist/index.js +26 -7
  44. package/dist/index.mjs +26 -7
  45. package/dist/kernel/index.d.ts +1 -1
  46. package/dist/kernel/moleculer/child-cap-descriptors.d.ts +34 -0
  47. package/dist/kernel/moleculer/child-cap-dispatch.d.ts +10 -2
  48. package/dist/kernel/moleculer/node-registry.d.ts +22 -1
  49. package/dist/kernel/moleculer/register-node-client.d.ts +8 -5
  50. package/dist/kernel/transport/child-cap-protocol.d.ts +20 -0
  51. package/dist/{manifest-python-deps-MUu1e33G.mjs → manifest-python-deps-4QvOLiBn.mjs} +5 -3
  52. package/dist/{manifest-python-deps-jZA_Qorz.js → manifest-python-deps-B6ahe90k.js} +5 -3
  53. package/package.json +1 -1
@@ -1,5 +1,5 @@
1
1
  import { z } from "zod";
2
- //#region ../types/dist/sleep-Cc14_yxc.mjs
2
+ //#region ../types/dist/sleep-DJaTV2D7.mjs
3
3
  var EventCategory = /* @__PURE__ */ function(EventCategory) {
4
4
  EventCategory["SystemBoot"] = "system.boot";
5
5
  EventCategory["SystemAddonsReady"] = "system.addons-ready";
@@ -721,10 +721,6 @@ function hydrateField(field, values) {
721
721
  };
722
722
  }
723
723
  const rawValue = storedValue !== void 0 ? storedValue : defaultValue !== void 0 ? defaultValue : null;
724
- if (field.type === "password") return {
725
- ...field,
726
- value: ""
727
- };
728
724
  const value = field.type === "textarea" && field.isJson && rawValue !== null && typeof rawValue === "object" ? JSON.stringify(rawValue, null, 2) : rawValue;
729
725
  return {
730
726
  ...field,
@@ -2606,13 +2602,32 @@ function event(data) {
2606
2602
  function isDeviceConfigCap(def) {
2607
2603
  return def?.deviceConfig !== void 0;
2608
2604
  }
2609
- var StaticDirOutputSchema = z.object({ staticDir: z.string() });
2610
- var VersionOutputSchema = z.object({ version: z.string() });
2605
+ var StaticDirOutputSchema$1 = z.object({ staticDir: z.string() });
2606
+ var VersionOutputSchema$1 = z.object({ version: z.string() });
2611
2607
  var adminUiCapability = {
2612
2608
  name: "admin-ui",
2613
2609
  scope: "system",
2614
2610
  mode: "singleton",
2615
2611
  internal: true,
2612
+ methods: {
2613
+ getStaticDir: method(z.void(), StaticDirOutputSchema$1),
2614
+ getVersion: method(z.void(), VersionOutputSchema$1)
2615
+ }
2616
+ };
2617
+ var StaticDirOutputSchema = z.object({ staticDir: z.string() });
2618
+ var VersionOutputSchema = z.object({ version: z.string() });
2619
+ /**
2620
+ * viewer-ui — serves the CamStack VIEWER web build (the Expo/React-Native
2621
+ * universal client's PWA export) from the hub, alongside admin-ui. Mirrors
2622
+ * `admin-ui` exactly: a singleton, server-internal cap exposing the static
2623
+ * dist directory + build version so `main.ts` can mount the SPA under a
2624
+ * dedicated prefix.
2625
+ */
2626
+ var viewerUiCapability = {
2627
+ name: "viewer-ui",
2628
+ scope: "system",
2629
+ mode: "singleton",
2630
+ internal: true,
2616
2631
  methods: {
2617
2632
  getStaticDir: method(z.void(), StaticDirOutputSchema),
2618
2633
  getVersion: method(z.void(), VersionOutputSchema)
@@ -7707,7 +7722,7 @@ var BoundingBoxSchema = z.object({
7707
7722
  w: z.number(),
7708
7723
  h: z.number()
7709
7724
  });
7710
- var SpatialDetectionSchema = z.object({
7725
+ z.object({
7711
7726
  class: z.string(),
7712
7727
  originalClass: z.string(),
7713
7728
  score: z.number(),
@@ -7912,11 +7927,6 @@ var PipelineSchemaSchema = z.object({
7912
7927
  selectedEngine: PipelineEngineChoiceSchema,
7913
7928
  slots: z.array(PipelineSlotSchemaSchema).readonly()
7914
7929
  });
7915
- var DetectorOutputSchema = z.object({
7916
- detections: z.array(SpatialDetectionSchema).readonly(),
7917
- inferenceMs: z.number(),
7918
- modelId: z.string()
7919
- });
7920
7930
  var EngineProvisioningSchema = z.object({
7921
7931
  runtimeId: z.enum([
7922
7932
  "onnx",
@@ -8082,23 +8092,23 @@ var pipelineExecutorCapability = {
8082
8092
  auth: "admin"
8083
8093
  }),
8084
8094
  /**
8085
- * Reset ONE node's detection-pipeline to its factory defaults, forcing
8086
- * regeneration of the (now hardware-aware) default object-detection
8087
- * model. `nodeId` is the ROUTING key — the generated cap-router strips
8088
- * it (default `nodeIdMode: 'routing'`, same as `getSelectedEngine` /
8089
- * `getDefaultSteps`) and dispatches to that node, so the provider method
8090
- * runs ON the target node and receives no `nodeId`.
8095
+ * Clear THIS node's executor-side PER-DEVICE settings stores (the
8096
+ * per-camera step overrides the object-detection root reads via
8097
+ * `applyDeviceOverridesToTree`). `nodeId` is the ROUTING key — the
8098
+ * generated cap-router strips it (default `nodeIdMode: 'routing'`) and
8099
+ * dispatches to that node, so the provider method runs ON the target
8100
+ * node and receives no `nodeId`.
8091
8101
  *
8092
- * Clears the node's persisted global pipeline seed (`pipelineSteps`) +
8093
- * legacy engine blob (`pipelineEngine`) and every device's per-camera
8094
- * step overrides, then re-seeds the hardware-aware default tree. Returns
8095
- * the regenerated object-detection model id (null when the default tree
8096
- * has no detector for this node's engine format) so the caller can
8097
- * verify the reset without a second round-trip.
8102
+ * This is the slimmed executor leg of the orchestrator's
8103
+ * `resetNodePipelineDefaults` flow (which owns the real reset: node
8104
+ * addonDefaults pins + per-camera orchestrator overrides). The legacy
8105
+ * `resetToDefault` which reset a persisted global step-tree seed
8106
+ * nothing in the live per-camera path read was removed together with
8107
+ * that seed.
8098
8108
  */
8099
- resetToDefault: method(z.object({ nodeId: z.string() }), z.object({
8109
+ clearDeviceOverrides: method(z.object({ nodeId: z.string() }), z.object({
8100
8110
  success: z.literal(true),
8101
- regeneratedModelId: z.string().nullable()
8111
+ clearedDevices: z.number()
8102
8112
  }), {
8103
8113
  kind: "mutation",
8104
8114
  auth: "admin"
@@ -8144,11 +8154,6 @@ var pipelineExecutorCapability = {
8144
8154
  modelId: z.string(),
8145
8155
  format: ModelFormatSchema$1
8146
8156
  }), z.object({ success: z.literal(true) }), { kind: "mutation" }),
8147
- detect: method(z.object({
8148
- addonId: z.string(),
8149
- frame: FrameInputSchema,
8150
- config: z.record(z.string(), z.unknown()).optional()
8151
- }), DetectorOutputSchema),
8152
8157
  /**
8153
8158
  * Stateless single-frame execution. Callers (runner, benchmark) pass
8154
8159
  * the complete `engine` + `steps` tree; the executor holds no state
@@ -11041,7 +11046,9 @@ var AddonPageDeclarationSchema$1 = z.object({
11041
11046
  icon: z.string(),
11042
11047
  path: z.string(),
11043
11048
  remoteName: z.string(),
11044
- bundle: z.string()
11049
+ bundle: z.string(),
11050
+ section: z.string().optional(),
11051
+ sectionLabel: z.string().optional()
11045
11052
  });
11046
11053
  var AddonPageInfoSchema = z.object({
11047
11054
  addonId: z.string(),
@@ -11086,7 +11093,18 @@ var AddonPageDeclarationSchema = z.object({
11086
11093
  * the static-file route can compute an mtime-based cache-buster URL
11087
11094
  * without a separate filesystem stat.
11088
11095
  */
11089
- bundle: z.string()
11096
+ bundle: z.string(),
11097
+ /**
11098
+ * Sidebar section this page docks into. Well-known ids: `'detection'`,
11099
+ * `'cluster'`, `'administration'` — the page renders inside that group.
11100
+ * Any OTHER string creates (or joins) a custom section rendered after
11101
+ * the built-in groups; its label comes from `sectionLabel` (first
11102
+ * declaration wins), falling back to the id. Absent → the legacy
11103
+ * "Addon Pages" group.
11104
+ */
11105
+ section: z.string().optional(),
11106
+ /** Display label for a CUSTOM `section` id (ignored for well-known ids). */
11107
+ sectionLabel: z.string().optional()
11090
11108
  });
11091
11109
  var addonPagesSourceCapability = {
11092
11110
  name: "addon-pages-source",
@@ -11364,6 +11382,17 @@ var WidgetMetadataSchema = z.object({
11364
11382
  deviceContext: z.boolean().default(false),
11365
11383
  integrationContext: z.boolean().default(false)
11366
11384
  }),
11385
+ /**
11386
+ * Loadable BEFORE authentication. The normal widget registry listing
11387
+ * (`addon-widgets.listWidgets`) is auth-gated, so a pre-auth surface
11388
+ * (the login page) cannot discover a widget through it. A widget that
11389
+ * declares `preAuth: true` marks itself as safe to mount on a pre-auth
11390
+ * screen — it is surfaced through the PUBLIC `auth.listLoginMethods`
11391
+ * login-method contribution channel (see `login-method.cap.ts`) rather
11392
+ * than the authenticated registry, and its bundle is served by the
11393
+ * public `/api/addon-widgets/:addonId/*` static route. Defaults false.
11394
+ */
11395
+ preAuth: z.boolean().optional().default(false),
11367
11396
  /** Dashboard placement HINTS (operator can override per instance). */
11368
11397
  defaultSize: WidgetSizeEnum.default("md"),
11369
11398
  allowedSizes: z.array(WidgetSizeEnum).readonly().default([
@@ -11802,6 +11831,87 @@ var authProviderCapability = {
11802
11831
  mount: { kind: "skip" }
11803
11832
  };
11804
11833
  /**
11834
+ * `login-method` — collection cap through which auth addons contribute
11835
+ * their pre-auth login surfaces to the login page. This is the SINGLE,
11836
+ * generic mechanism that supersedes the dead `auth.listProviders` reader:
11837
+ * every auth addon (OIDC, magic-link, WebAuthn/passkey) registers a
11838
+ * `login-method` provider and the PUBLIC `auth.listLoginMethods`
11839
+ * procedure aggregates them for the unauthenticated login page.
11840
+ *
11841
+ * A contribution is a discriminated union on `kind`:
11842
+ *
11843
+ * - `redirect` — a declarative button. The login page renders a generic
11844
+ * button that navigates to `startUrl` (an addon-owned HTTP route).
11845
+ * Covers OIDC (`/addon/auth-oidc/<id>/start`) and magic-link with
11846
+ * ZERO shell-side JS. A future SSO addon plugs in the same way — the
11847
+ * login page needs NO change.
11848
+ *
11849
+ * - `widget` — a Module-Federation widget the login page mounts (via
11850
+ * `loadRemoteBundle`) for an in-page ceremony. Covers the passkey
11851
+ * login ceremony, which must run `@simplewebauthn/browser` INSIDE the
11852
+ * addon bundle. The referenced widget also declares `preAuth: true` in
11853
+ * its `addon-widgets-source` catalog entry. `auth.listLoginMethods`
11854
+ * stamps a public `bundleUrl` from `addonId` + `bundle`.
11855
+ *
11856
+ * Every contribution carries a `stage`:
11857
+ * - `primary` — shown on the first credentials screen (OIDC /
11858
+ * magic-link buttons; a future usernameless passkey).
11859
+ * - `second-factor` — shown AFTER the password leg, gated on the
11860
+ * returned `factors` (passkey-as-2FA today).
11861
+ *
11862
+ * `mount: skip` — the cap is read server-side by the core auth router
11863
+ * (`registry.getCollection('login-method')`), never mounted as its own
11864
+ * tRPC router.
11865
+ */
11866
+ /** When a login method renders in the two-phase login flow. */
11867
+ var LoginStageEnum = z.enum(["primary", "second-factor"]);
11868
+ /**
11869
+ * A declarative redirect button — the login page navigates to `startUrl`.
11870
+ * OIDC and magic-link contribute this; a future SSO addon does too.
11871
+ */
11872
+ var RedirectLoginMethodSchema = z.object({
11873
+ kind: z.literal("redirect"),
11874
+ /** Stable id within the login-method set (e.g. `auth-oidc/google`). */
11875
+ id: z.string(),
11876
+ /** Operator-facing button label. */
11877
+ label: z.string(),
11878
+ /** lucide-react icon name. */
11879
+ icon: z.string().optional(),
11880
+ /** Addon-owned HTTP route the button navigates to (GET). */
11881
+ startUrl: z.string(),
11882
+ stage: LoginStageEnum
11883
+ });
11884
+ /**
11885
+ * A Module-Federation widget the login page mounts for an in-page
11886
+ * ceremony. `bundle` + `addonId` let `auth.listLoginMethods` stamp a
11887
+ * public `bundleUrl`; `remote` is the MF descriptor `loadRemoteBundle`
11888
+ * consumes. No `bundleUrl` here — it is server-stamped on the public
11889
+ * output so the addon never encodes the static-route scheme.
11890
+ */
11891
+ var WidgetLoginMethodSchema = z.object({
11892
+ kind: z.literal("widget"),
11893
+ /** Stable id within the login-method set (e.g. `auth-webauthn/passkey-login`). */
11894
+ id: z.string(),
11895
+ /** Owning addon id — drives the public bundle URL + the MF namespace. */
11896
+ addonId: z.string(),
11897
+ /** Bundle filename inside the addon's dist dir (`remoteEntry.js`). */
11898
+ bundle: z.string(),
11899
+ /** MF remote descriptor — `{ remoteName, exposedModule, componentKey }`. */
11900
+ remote: WidgetRemoteSchema,
11901
+ stage: LoginStageEnum
11902
+ });
11903
+ /** One login-method contribution — redirect button OR pre-auth widget. */
11904
+ var LoginMethodContributionSchema = z.discriminatedUnion("kind", [RedirectLoginMethodSchema, WidgetLoginMethodSchema]);
11905
+ var loginMethodCapability = {
11906
+ name: "login-method",
11907
+ scope: "system",
11908
+ mode: "collection",
11909
+ internal: true,
11910
+ methods: { getLoginMethods: method(z.void(), z.array(LoginMethodContributionSchema).readonly()) },
11911
+ /** BIG PLAN 2: declarative mount hint — read by `@camstack/system` `buildCapRouters`. */
11912
+ mount: { kind: "skip" }
11913
+ };
11914
+ /**
11805
11915
  * Orchestrator-side destination metadata. The orchestrator computes
11806
11916
  * `id = <addonId>:<subId>` from its provider lookup so consumers
11807
11917
  * (admin UI, restore flow) see one canonical key.
@@ -15034,7 +15144,12 @@ var AgentPipelineSettingsSchema = z.object({
15034
15144
  detectWeight: z.number().positive().optional(),
15035
15145
  /** Node is eligible to run the detection pipeline (decode + inference). */
15036
15146
  detect: z.boolean().optional(),
15037
- /** Node is eligible to host decoder sessions. */
15147
+ /**
15148
+ * DEPRECATED AND IGNORED. Decode is always co-located with its frame
15149
+ * consumer, so decode eligibility IS detect eligibility. Kept optional in
15150
+ * the schema ONLY so persisted stores written before the removal still
15151
+ * parse — no code reads it and no write path emits it.
15152
+ */
15038
15153
  decode: z.boolean().optional(),
15039
15154
  /** Node is eligible to run audio-analyzer sessions. */
15040
15155
  audio: z.boolean().optional(),
@@ -15095,25 +15210,6 @@ var PipelineAssignmentSchema = z.object({
15095
15210
  assignedAt: z.number()
15096
15211
  });
15097
15212
  /**
15098
- * Decoder placement record. Symmetric to `PipelineAssignmentSchema` but for
15099
- * the decoder-node placement domain (`balanceDecoder` decision: manual pin
15100
- * → co-located with pipeline → capacity).
15101
- */
15102
- var DecoderAssignmentSchema = z.object({
15103
- deviceId: z.number(),
15104
- /** Moleculer node id of the decoder provider currently responsible for this camera. */
15105
- decoderNodeId: z.string(),
15106
- /** True when the assignment was set manually via `assignDecoder`, false when chosen by the balancer. */
15107
- pinned: z.boolean(),
15108
- /** Why this assignment was made — useful for debugging the decoder balancer. */
15109
- reason: z.enum([
15110
- "manual",
15111
- "co-located",
15112
- "capacity",
15113
- "hardware-affinity"
15114
- ])
15115
- });
15116
- /**
15117
15213
  * Per-agent load summary surfaced to the load balancer + dashboards.
15118
15214
  * Aggregated from each runner's `getLocalLoad` cap call.
15119
15215
  */
@@ -15400,21 +15496,6 @@ var pipelineOrchestratorCapability = {
15400
15496
  * present. Defaults to `{ ownerNodeId: 'hub' }`.
15401
15497
  */
15402
15498
  getIngestOwner: method(z.void(), IngestOwnerSchema),
15403
- /** Pin a device's decoder to a specific node. */
15404
- assignDecoder: method(z.object({
15405
- deviceId: z.number(),
15406
- nodeId: z.string()
15407
- }), z.void(), {
15408
- kind: "mutation",
15409
- auth: "admin"
15410
- }),
15411
- /** Clear a device's decoder pin (revert to auto). */
15412
- unassignDecoder: method(z.object({ deviceId: z.number() }), z.void(), {
15413
- kind: "mutation",
15414
- auth: "admin"
15415
- }),
15416
- /** Get every camera's decoder placement. */
15417
- getDecoderAssignments: method(z.void(), z.array(DecoderAssignmentSchema).readonly()),
15418
15499
  /** Pin a device's audio analysis to a specific cluster node. */
15419
15500
  assignAudio: method(z.object({
15420
15501
  deviceId: z.number(),
@@ -15446,23 +15527,6 @@ var pipelineOrchestratorCapability = {
15446
15527
  pinned: z.boolean(),
15447
15528
  assignedAt: z.number()
15448
15529
  }))),
15449
- /**
15450
- * Get one camera's decoder placement (computed if not yet pinned).
15451
- *
15452
- * ADVISORY today: reports the orchestrator's decoder preference only.
15453
- * Actual decode placement is broker-owned (local-node pin + frame-plane
15454
- * co-location guard). Reserved to become the binding source/decoder-owner
15455
- * control in the stream-LB epic (Phase 2).
15456
- *
15457
- * `pipelineNodeId` is the node already chosen to run inference for
15458
- * this camera. When provided, the balancer prefers co-location with
15459
- * it; omitted → falls back to the last known assignment in the
15460
- * `assignments` map and finally to 'hub'.
15461
- */
15462
- getDecoderAssignment: method(z.object({
15463
- deviceId: z.number(),
15464
- pipelineNodeId: z.string().optional()
15465
- }), DecoderAssignmentSchema),
15466
15530
  /** Read one agent's settings. Null when not yet seeded. */
15467
15531
  getAgentSettings: method(z.object({ agentNodeId: z.string() }), AgentPipelineSettingsSchema.nullable()),
15468
15532
  /** Enumerate every agent's settings (hub + remote runners). */
@@ -15532,14 +15596,15 @@ var pipelineOrchestratorCapability = {
15532
15596
  * `enabledDecoderNodes`, `enabledAudioNodes`, `remoteSourcingNodes`).
15533
15597
  * Each flag is optional in the patch: omit a flag to leave it unchanged,
15534
15598
  * pass `null` to reset it to the node default (`hub` → capable, every
15535
- * other node → not). Detection/decode/audio eligibility is derived from
15536
- * these flags across the cluster; changing them re-derives the enabled
15537
- * sets and reconciles dispatch immediately.
15599
+ * other node → not). Detection/audio eligibility is derived from these
15600
+ * flags across the cluster; changing them re-derives the enabled sets
15601
+ * and reconciles dispatch immediately. There is NO separate decode flag:
15602
+ * decode is always co-located with its frame consumer, so decode
15603
+ * eligibility IS detect eligibility.
15538
15604
  */
15539
15605
  setAgentCapabilities: method(z.object({
15540
15606
  agentNodeId: z.string(),
15541
15607
  detect: z.boolean().nullable().optional(),
15542
- decode: z.boolean().nullable().optional(),
15543
15608
  audio: z.boolean().nullable().optional(),
15544
15609
  ingest: z.boolean().nullable().optional()
15545
15610
  }), z.object({ success: z.literal(true) }), {
@@ -15562,6 +15627,34 @@ var pipelineOrchestratorCapability = {
15562
15627
  kind: "mutation",
15563
15628
  auth: "admin"
15564
15629
  }),
15630
+ /**
15631
+ * Reset one node's pipeline to its hardware-aware defaults — the HONEST
15632
+ * reset (replaces the executor's legacy `resetToDefault`, which cleared a
15633
+ * dead persisted step-tree seed nothing in the live path read):
15634
+ * (a) strips every `modelId` pin from that node's
15635
+ * `agentSettings.addonDefaults` (cells revert to Auto — the node
15636
+ * resolves its own hardware-aware format default at runtime);
15637
+ * (b) clears per-camera step overrides scoped to that node
15638
+ * (`stepOverridesByAgent[node]` + the wholesale
15639
+ * `pipelineByAgent[node]` escape hatch);
15640
+ * (c) clears the executor-side per-device settings stores on that node
15641
+ * (`pipelineExecutor.clearDeviceOverrides`);
15642
+ * (d) hot-reloads every camera assigned to the node.
15643
+ *
15644
+ * Returns the EFFECTIVE post-reset object-detection model for the node
15645
+ * (the executor's pure hardware-aware default) so the UI can report what
15646
+ * will actually run — not a value that never reaches the live path.
15647
+ */
15648
+ resetNodePipelineDefaults: method(z.object({ agentNodeId: z.string() }), z.object({
15649
+ success: z.literal(true),
15650
+ /** Hardware-aware default detection model now in effect on the node (null when unresolvable). */
15651
+ effectiveModelId: z.string().nullable(),
15652
+ /** Number of cameras whose node-scoped overrides were cleared. */
15653
+ clearedCameraOverrides: z.number()
15654
+ }), {
15655
+ kind: "mutation",
15656
+ auth: "admin"
15657
+ }),
15565
15658
  /** Read one camera's settings. Null when never touched (inherits agent defaults fully). */
15566
15659
  getCameraSettings: method(z.object({ deviceId: z.number() }), CameraPipelineSettingsSchema.nullable()),
15567
15660
  /** Set or clear the 3-state toggle for one (camera, addonId). Pass `enabled: null` to clear and revert to agent default. */
@@ -15654,6 +15747,151 @@ var pipelineOrchestratorCapability = {
15654
15747
  }
15655
15748
  };
15656
15749
  /**
15750
+ * server-management — per-NODE singleton capability for a node's ROOT
15751
+ * package lifecycle (runtime-updatable node packages, phase 2: hub + docker
15752
+ * agents).
15753
+ *
15754
+ * Each node's root package (`@camstack/server` on the hub, `@camstack/agent`
15755
+ * on agents) carries the whole software stack in its npm dep tree, so ONE
15756
+ * version describes the node. Updates install into
15757
+ * `<dataDir>/server-root/versions/<v>/` and apply on restart via the baked
15758
+ * starter (probation boot + auto-rollback to N-1).
15759
+ *
15760
+ * Providers:
15761
+ * - HUB: `ServerUpdateService` behind the `server-provided` mount
15762
+ * (`buildServerProviders` in trpc.router.ts) — the default target for
15763
+ * unpinned calls.
15764
+ * - AGENT: `AgentUpdateService` registered by the agent bootstrap under
15765
+ * the synthetic `agent-runtime` addonId and declared in the agent's
15766
+ * `$hub.registerNode` manifest.
15767
+ *
15768
+ * Node routing: singleton caps get the codegen/runtime-builder `nodeId`
15769
+ * injection on every method — `input.nodeId` (or `nodePin(nodeId)` from the
15770
+ * SDK) routes the call to that node's provider via the standard remote
15771
+ * proxy (`createCapabilityProxy` → `$agent-cap-fwd` → the agent's
15772
+ * in-process provider lookup). No `nodeId` → the hub's own provider.
15773
+ *
15774
+ * Spec: docs/superpowers/specs/2026-07-12-runtime-updatable-node-packages-design.md
15775
+ */
15776
+ /**
15777
+ * Where the running hub's code was loaded from:
15778
+ * - `workspace` — dev checkout (tsx / workspace dist); the starter defers to
15779
+ * plain resolution and runtime updates are refused.
15780
+ * - `baked` — the immutable image seed closure (no data-dir root active).
15781
+ * - `data-root` — the runtime-updatable `<dataDir>/server-root` closure.
15782
+ */
15783
+ var ServerBootModeSchema = z.enum([
15784
+ "workspace",
15785
+ "baked",
15786
+ "data-root"
15787
+ ]);
15788
+ /**
15789
+ * Update lifecycle state:
15790
+ * - `idle` / `checking` / `staging` — steady / in-flight registry work.
15791
+ * - `pending-restart` — a version is staged and the node has NOT yet
15792
+ * restarted onto it (still running the OLD version).
15793
+ * - `awaiting-confirmation` — the node HAS restarted onto the staged version
15794
+ * (it is the active probation boot) and is waiting to confirm boot-health.
15795
+ * Apply/rollback are refused in this state and the node must NOT be
15796
+ * manually restarted, or the probation boot auto-rolls-back.
15797
+ */
15798
+ var ServerUpdateStateSchema = z.enum([
15799
+ "idle",
15800
+ "checking",
15801
+ "staging",
15802
+ "pending-restart",
15803
+ "awaiting-confirmation"
15804
+ ]);
15805
+ var ServerRollbackInfoSchema = z.object({
15806
+ /** The version that failed (or was manually rolled back). */
15807
+ fromVersion: z.string(),
15808
+ /** The version rolled back to; null = the baked seed. */
15809
+ toVersion: z.string().nullable(),
15810
+ atMs: z.number(),
15811
+ reason: z.string()
15812
+ });
15813
+ var ServerPackageStatusSchema = z.object({
15814
+ /** Root package name (`@camstack/server` on the hub). */
15815
+ packageName: z.string(),
15816
+ /** Version of the code the running process ACTUALLY loaded. */
15817
+ runningVersion: z.string().nullable(),
15818
+ /** Node.js runtime version the node's process runs on (`process.versions.node`). */
15819
+ nodeRuntimeVersion: z.string().nullable(),
15820
+ /** Active data-dir root version; null when booted from seed/workspace. */
15821
+ activeVersion: z.string().nullable(),
15822
+ /** N-1 version kept for rollback; null when no previous version exists. */
15823
+ previousVersion: z.string().nullable(),
15824
+ /** Version of the immutable baked seed closure (image fallback). */
15825
+ seedVersion: z.string().nullable(),
15826
+ /** Latest registry version from the most recent check (null = never checked). */
15827
+ latestVersion: z.string().nullable(),
15828
+ updateAvailable: z.boolean(),
15829
+ bootMode: ServerBootModeSchema,
15830
+ updateState: ServerUpdateStateSchema,
15831
+ /** Version staged + awaiting its probation boot, when one is pending. */
15832
+ pendingVersion: z.string().nullable(),
15833
+ /** Set when the last freshly-activated version failed its boot health-check. */
15834
+ rolledBack: ServerRollbackInfoSchema.nullable(),
15835
+ /**
15836
+ * True when `server-root/state.json` EXISTS but is unreadable/corrupt — the
15837
+ * hub is running from the baked seed (or workspace) while installed data-dir
15838
+ * versions are being IGNORED. Surfaced as a warning in the UI.
15839
+ */
15840
+ stateFileCorrupt: z.boolean(),
15841
+ lastCheckedAtMs: z.number().nullable()
15842
+ });
15843
+ var ServerUpdateCheckResultSchema = z.object({
15844
+ packageName: z.string(),
15845
+ runningVersion: z.string().nullable(),
15846
+ latestVersion: z.string().nullable(),
15847
+ updateAvailable: z.boolean(),
15848
+ checkedAtMs: z.number(),
15849
+ /** Non-null when the registry lookup failed (offline, bad registry, …). */
15850
+ error: z.string().nullable()
15851
+ });
15852
+ var ServerUpdateActionResultSchema = z.object({
15853
+ accepted: z.boolean(),
15854
+ targetVersion: z.string().nullable(),
15855
+ /** True when a graceful restart was scheduled to apply the change. */
15856
+ restarting: z.boolean(),
15857
+ message: z.string()
15858
+ });
15859
+ var serverManagementCapability = {
15860
+ name: "server-management",
15861
+ scope: "system",
15862
+ mode: "singleton",
15863
+ methods: {
15864
+ getServerPackageStatus: method(z.void(), ServerPackageStatusSchema, { auth: "admin" }),
15865
+ checkServerUpdate: method(z.void(), ServerUpdateCheckResultSchema, {
15866
+ kind: "mutation",
15867
+ auth: "admin"
15868
+ }),
15869
+ applyServerUpdate: method(z.object({
15870
+ /** Explicit target version; omitted = latest from the registry. */
15871
+ version: z.string().optional() }), ServerUpdateActionResultSchema, {
15872
+ kind: "mutation",
15873
+ auth: "admin"
15874
+ }),
15875
+ rollbackServerUpdate: method(z.void(), ServerUpdateActionResultSchema, {
15876
+ kind: "mutation",
15877
+ auth: "admin"
15878
+ }),
15879
+ /**
15880
+ * Plain process restart of the node's root process — no version change.
15881
+ * The supervisor (docker restart policy / launchd / Electron main)
15882
+ * relaunches and the starter loads the SAME active version. Refused while
15883
+ * a stage is in flight or a version is already staged awaiting restart
15884
+ * (use apply/rollback instead, so the pending version is not skipped).
15885
+ */
15886
+ restartServer: method(z.void(), ServerUpdateActionResultSchema, {
15887
+ kind: "mutation",
15888
+ auth: "admin"
15889
+ })
15890
+ },
15891
+ /** BIG PLAN 2: declarative mount hint — read by `@camstack/system` `buildCapRouters`. */
15892
+ mount: { kind: "server-provided" }
15893
+ };
15894
+ /**
15657
15895
  * Query filter for settings-store collections.
15658
15896
  */
15659
15897
  var QueryFilterSchema = z.object({
@@ -18519,6 +18757,16 @@ var TopologyCategorySchema = z.object({
18519
18757
  healthy: z.number(),
18520
18758
  addons: z.array(TopologyCategoryAddonSchema).readonly()
18521
18759
  });
18760
+ /**
18761
+ * The node's runtime-updatable ROOT package (`@camstack/server` on the hub,
18762
+ * `@camstack/agent` on agents) as reported by its `registerNode` manifest —
18763
+ * version visibility for the Server management surface. Nullable: offline
18764
+ * rows and pre-phase-2 nodes report none.
18765
+ */
18766
+ var TopologyRootPackageSchema = z.object({
18767
+ name: z.string(),
18768
+ version: z.string()
18769
+ });
18522
18770
  var TopologyNodeSchema = z.object({
18523
18771
  id: z.string(),
18524
18772
  name: z.string(),
@@ -18542,7 +18790,8 @@ var TopologyNodeSchema = z.object({
18542
18790
  status: z.string()
18543
18791
  })).readonly(),
18544
18792
  processes: z.array(TopologyProcessSchema).readonly(),
18545
- categories: z.array(TopologyCategorySchema).readonly()
18793
+ categories: z.array(TopologyCategorySchema).readonly(),
18794
+ rootPackage: TopologyRootPackageSchema.nullable()
18546
18795
  });
18547
18796
  var CapUsageEdgeSchema = z.object({
18548
18797
  callerAddonId: z.string(),
@@ -20005,6 +20254,7 @@ var ALL_CAPABILITY_DEFINITIONS = [
20005
20254
  localNetworkCapability,
20006
20255
  lockControlCapability,
20007
20256
  logDestinationCapability,
20257
+ loginMethodCapability,
20008
20258
  mediaPlayerCapability,
20009
20259
  meshNetworkCapability,
20010
20260
  metricsProviderCapability,
@@ -20040,6 +20290,7 @@ var ALL_CAPABILITY_DEFINITIONS = [
20040
20290
  rebootCapability,
20041
20291
  recordingCapability,
20042
20292
  scriptRunnerCapability,
20293
+ serverManagementCapability,
20043
20294
  settingsStoreCapability,
20044
20295
  smokeCapability,
20045
20296
  smtpProviderCapability,
@@ -20064,6 +20315,7 @@ var ALL_CAPABILITY_DEFINITIONS = [
20064
20315
  valveCapability,
20065
20316
  vibrationCapability,
20066
20317
  videoclipsCapability,
20318
+ viewerUiCapability,
20067
20319
  waterHeaterCapability,
20068
20320
  weatherCapability,
20069
20321
  webrtcSessionCapability,
@@ -22120,6 +22372,12 @@ var METHOD_ACCESS_MAP = Object.freeze({
22120
22372
  addonId: null,
22121
22373
  access: "create"
22122
22374
  },
22375
+ "loginMethod.getLoginMethods": {
22376
+ capName: "login-method",
22377
+ capScope: "system",
22378
+ addonId: null,
22379
+ access: "view"
22380
+ },
22123
22381
  "mediaPlayer.next": {
22124
22382
  capName: "media-player",
22125
22383
  capScope: "device",
@@ -22750,23 +23008,23 @@ var METHOD_ACCESS_MAP = Object.freeze({
22750
23008
  addonId: null,
22751
23009
  access: "create"
22752
23010
  },
22753
- "pipelineExecutor.deleteModel": {
23011
+ "pipelineExecutor.clearDeviceOverrides": {
22754
23012
  capName: "pipeline-executor",
22755
23013
  capScope: "system",
22756
23014
  addonId: null,
22757
23015
  access: "delete"
22758
23016
  },
22759
- "pipelineExecutor.deleteTemplate": {
23017
+ "pipelineExecutor.deleteModel": {
22760
23018
  capName: "pipeline-executor",
22761
23019
  capScope: "system",
22762
23020
  addonId: null,
22763
23021
  access: "delete"
22764
23022
  },
22765
- "pipelineExecutor.detect": {
23023
+ "pipelineExecutor.deleteTemplate": {
22766
23024
  capName: "pipeline-executor",
22767
23025
  capScope: "system",
22768
23026
  addonId: null,
22769
- access: "view"
23027
+ access: "delete"
22770
23028
  },
22771
23029
  "pipelineExecutor.downloadModel": {
22772
23030
  capName: "pipeline-executor",
@@ -22912,12 +23170,6 @@ var METHOD_ACCESS_MAP = Object.freeze({
22912
23170
  addonId: null,
22913
23171
  access: "create"
22914
23172
  },
22915
- "pipelineExecutor.resetToDefault": {
22916
- capName: "pipeline-executor",
22917
- capScope: "system",
22918
- addonId: null,
22919
- access: "delete"
22920
- },
22921
23173
  "pipelineExecutor.runAudioTest": {
22922
23174
  capName: "pipeline-executor",
22923
23175
  capScope: "system",
@@ -22978,12 +23230,6 @@ var METHOD_ACCESS_MAP = Object.freeze({
22978
23230
  addonId: null,
22979
23231
  access: "create"
22980
23232
  },
22981
- "pipelineOrchestrator.assignDecoder": {
22982
- capName: "pipeline-orchestrator",
22983
- capScope: "system",
22984
- addonId: null,
22985
- access: "create"
22986
- },
22987
23233
  "pipelineOrchestrator.assignPipeline": {
22988
23234
  capName: "pipeline-orchestrator",
22989
23235
  capScope: "system",
@@ -23062,18 +23308,6 @@ var METHOD_ACCESS_MAP = Object.freeze({
23062
23308
  addonId: null,
23063
23309
  access: "view"
23064
23310
  },
23065
- "pipelineOrchestrator.getDecoderAssignment": {
23066
- capName: "pipeline-orchestrator",
23067
- capScope: "system",
23068
- addonId: null,
23069
- access: "view"
23070
- },
23071
- "pipelineOrchestrator.getDecoderAssignments": {
23072
- capName: "pipeline-orchestrator",
23073
- capScope: "system",
23074
- addonId: null,
23075
- access: "view"
23076
- },
23077
23311
  "pipelineOrchestrator.getGlobalMetrics": {
23078
23312
  capName: "pipeline-orchestrator",
23079
23313
  capScope: "system",
@@ -23122,6 +23356,12 @@ var METHOD_ACCESS_MAP = Object.freeze({
23122
23356
  addonId: null,
23123
23357
  access: "delete"
23124
23358
  },
23359
+ "pipelineOrchestrator.resetNodePipelineDefaults": {
23360
+ capName: "pipeline-orchestrator",
23361
+ capScope: "system",
23362
+ addonId: null,
23363
+ access: "delete"
23364
+ },
23125
23365
  "pipelineOrchestrator.resolvePipeline": {
23126
23366
  capName: "pipeline-orchestrator",
23127
23367
  capScope: "system",
@@ -23194,12 +23434,6 @@ var METHOD_ACCESS_MAP = Object.freeze({
23194
23434
  addonId: null,
23195
23435
  access: "create"
23196
23436
  },
23197
- "pipelineOrchestrator.unassignDecoder": {
23198
- capName: "pipeline-orchestrator",
23199
- capScope: "system",
23200
- addonId: null,
23201
- access: "create"
23202
- },
23203
23437
  "pipelineOrchestrator.unassignPipeline": {
23204
23438
  capName: "pipeline-orchestrator",
23205
23439
  capScope: "system",
@@ -23506,6 +23740,36 @@ var METHOD_ACCESS_MAP = Object.freeze({
23506
23740
  addonId: null,
23507
23741
  access: "create"
23508
23742
  },
23743
+ "serverManagement.applyServerUpdate": {
23744
+ capName: "server-management",
23745
+ capScope: "system",
23746
+ addonId: null,
23747
+ access: "create"
23748
+ },
23749
+ "serverManagement.checkServerUpdate": {
23750
+ capName: "server-management",
23751
+ capScope: "system",
23752
+ addonId: null,
23753
+ access: "create"
23754
+ },
23755
+ "serverManagement.getServerPackageStatus": {
23756
+ capName: "server-management",
23757
+ capScope: "system",
23758
+ addonId: null,
23759
+ access: "view"
23760
+ },
23761
+ "serverManagement.restartServer": {
23762
+ capName: "server-management",
23763
+ capScope: "system",
23764
+ addonId: null,
23765
+ access: "create"
23766
+ },
23767
+ "serverManagement.rollbackServerUpdate": {
23768
+ capName: "server-management",
23769
+ capScope: "system",
23770
+ addonId: null,
23771
+ access: "create"
23772
+ },
23509
23773
  "settingsStore.count": {
23510
23774
  capName: "settings-store",
23511
23775
  capScope: "system",
@@ -24370,6 +24634,18 @@ var METHOD_ACCESS_MAP = Object.freeze({
24370
24634
  addonId: null,
24371
24635
  access: "view"
24372
24636
  },
24637
+ "viewerUi.getStaticDir": {
24638
+ capName: "viewer-ui",
24639
+ capScope: "system",
24640
+ addonId: null,
24641
+ access: "view"
24642
+ },
24643
+ "viewerUi.getVersion": {
24644
+ capName: "viewer-ui",
24645
+ capScope: "system",
24646
+ addonId: null,
24647
+ access: "view"
24648
+ },
24373
24649
  "waterHeater.setAway": {
24374
24650
  capName: "water-heater",
24375
24651
  capScope: "device",