@camstack/addon-provider-onvif 1.1.21 → 1.1.23

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 (3) hide show
  1. package/dist/addon.js +498 -94
  2. package/dist/addon.mjs +498 -94
  3. package/package.json +4 -1
package/dist/addon.mjs CHANGED
@@ -4632,7 +4632,7 @@ function _instanceof(cls, params = {}) {
4632
4632
  return inst;
4633
4633
  }
4634
4634
  //#endregion
4635
- //#region ../types/dist/sleep-Cc14_yxc.mjs
4635
+ //#region ../types/dist/sleep-BC9Yqte7.mjs
4636
4636
  var EventCategory = /* @__PURE__ */ function(EventCategory) {
4637
4637
  EventCategory["SystemBoot"] = "system.boot";
4638
4638
  EventCategory["SystemAddonsReady"] = "system.addons-ready";
@@ -5353,10 +5353,6 @@ function hydrateField(field, values) {
5353
5353
  };
5354
5354
  }
5355
5355
  const rawValue = storedValue !== void 0 ? storedValue : defaultValue !== void 0 ? defaultValue : null;
5356
- if (field.type === "password") return {
5357
- ...field,
5358
- value: ""
5359
- };
5360
5356
  const value = field.type === "textarea" && field.isJson && rawValue !== null && typeof rawValue === "object" ? JSON.stringify(rawValue, null, 2) : rawValue;
5361
5357
  return {
5362
5358
  ...field,
@@ -6740,6 +6736,21 @@ function method(input, output, options) {
6740
6736
  timeoutMs: options?.timeoutMs
6741
6737
  };
6742
6738
  }
6739
+ /**
6740
+ * A wrapper/system-only method: served exclusively by the cap's system-level
6741
+ * provider (`InferProvider`), and OPTIONAL on `InferNativeProvider` so per-device
6742
+ * driver natives don't stub out a wrapper concern (e.g. a cross-device cache
6743
+ * overview). The `systemOnly: true` literal is what `InferNativeProvider` keys on.
6744
+ */
6745
+ function systemMethod(input, output, options) {
6746
+ return {
6747
+ ...method(input, output, options),
6748
+ systemOnly: true
6749
+ };
6750
+ }
6751
+ var StaticDirOutputSchema$1 = object({ staticDir: string() });
6752
+ var VersionOutputSchema$1 = object({ version: string() });
6753
+ method(_void(), StaticDirOutputSchema$1), method(_void(), VersionOutputSchema$1);
6743
6754
  var StaticDirOutputSchema = object({ staticDir: string() });
6744
6755
  var VersionOutputSchema = object({ version: string() });
6745
6756
  method(_void(), StaticDirOutputSchema), method(_void(), VersionOutputSchema);
@@ -10482,7 +10493,7 @@ var BoundingBoxSchema = object({
10482
10493
  w: number(),
10483
10494
  h: number()
10484
10495
  });
10485
- var SpatialDetectionSchema = object({
10496
+ object({
10486
10497
  class: string(),
10487
10498
  originalClass: string(),
10488
10499
  score: number(),
@@ -10657,6 +10668,7 @@ var PipelineAddonSchemaSchema = object({
10657
10668
  defaultModelId: string(),
10658
10669
  defaultModelIdByFormat: record(string(), string()).optional(),
10659
10670
  enabledByDefault: boolean().optional(),
10671
+ backfillIntoExistingOverrides: boolean().optional(),
10660
10672
  defaultConfidence: number(),
10661
10673
  group: string().optional(),
10662
10674
  configSchema: array(ConfigFieldBridge).readonly().optional()
@@ -10673,11 +10685,6 @@ var PipelineSchemaSchema = object({
10673
10685
  selectedEngine: PipelineEngineChoiceSchema,
10674
10686
  slots: array(PipelineSlotSchemaSchema).readonly()
10675
10687
  });
10676
- var DetectorOutputSchema = object({
10677
- detections: array(SpatialDetectionSchema).readonly(),
10678
- inferenceMs: number(),
10679
- modelId: string()
10680
- });
10681
10688
  var EngineProvisioningSchema = object({
10682
10689
  runtimeId: _enum([
10683
10690
  "onnx",
@@ -10802,7 +10809,7 @@ method(_void(), array(PipelineEngineChoiceSchema)), method(_void(), PipelineEngi
10802
10809
  auth: "admin"
10803
10810
  }), method(object({ nodeId: string() }), object({
10804
10811
  success: literal(true),
10805
- regeneratedModelId: string().nullable()
10812
+ clearedDevices: number()
10806
10813
  }), {
10807
10814
  kind: "mutation",
10808
10815
  auth: "admin"
@@ -10823,10 +10830,6 @@ method(_void(), array(PipelineEngineChoiceSchema)), method(_void(), PipelineEngi
10823
10830
  modelId: string(),
10824
10831
  format: ModelFormatSchema$1
10825
10832
  }), object({ success: literal(true) }), { kind: "mutation" }), method(object({
10826
- addonId: string(),
10827
- frame: FrameInputSchema,
10828
- config: record(string(), unknown()).optional()
10829
- }), DetectorOutputSchema), method(object({
10830
10833
  engine: PipelineEngineChoiceSchema.optional(),
10831
10834
  steps: array(PipelineStepInputSchema).min(1),
10832
10835
  frame: FrameInputSchema.optional(),
@@ -10972,6 +10975,25 @@ DeviceType.Camera, method(object({ deviceId: number() }), array(ZoneSchema).read
10972
10975
  auth: "admin"
10973
10976
  }), object({ zones: array(ZoneSchema).readonly() });
10974
10977
  /**
10978
+ * A bounding box in NORMALIZED [0,1] frame coordinates for `getNativeCrop`. The
10979
+ * decode worker resolves it against the RETAINED native frame's real pixel dims,
10980
+ * so the caller supplies only the detection-res bbox divided by the detection
10981
+ * dims — no native resolution to plumb.
10982
+ */
10983
+ var NativeCropBboxSchema = object({
10984
+ x: number(),
10985
+ y: number(),
10986
+ w: number(),
10987
+ h: number()
10988
+ });
10989
+ /** Result of a best-effort native-resolution crop (`getNativeCrop`). */
10990
+ var NativeCropResultSchema = object({
10991
+ /** Packed rgb (24-bit) pixels of the crop. */
10992
+ bytes: _instanceof(Uint8Array),
10993
+ width: number().int().positive(),
10994
+ height: number().int().positive()
10995
+ });
10996
+ /**
10975
10997
  * Per-camera tunable ranges + defaults. Single source of truth used
10976
10998
  * by both the Zod data schema (validation + default fallback) and
10977
10999
  * the device settings UI (slider min/max/step). Touch one place and
@@ -11227,7 +11249,11 @@ var RunnerLocalMetricsSchema = object({
11227
11249
  avgInferenceTimeMs: number(),
11228
11250
  queueDepth: number()
11229
11251
  });
11230
- method(RunnerCameraConfigSchema, object({ success: literal(true) }), { kind: "mutation" }), method(object({ deviceId: number() }), object({ success: literal(true) }), { kind: "mutation" }), method(ReportMotionInputSchema, object({ success: literal(true) }), { kind: "mutation" }), method(_void(), RunnerLocalLoadSchema), method(_void(), RunnerLocalMetricsSchema), method(object({ deviceId: number() }), CameraMetricsSchema.nullable()), method(_void(), array(CameraMetricsWithDeviceIdSchema).readonly()), method(_void(), array(number()).readonly());
11252
+ method(RunnerCameraConfigSchema, object({ success: literal(true) }), { kind: "mutation" }), method(object({ deviceId: number() }), object({ success: literal(true) }), { kind: "mutation" }), method(ReportMotionInputSchema, object({ success: literal(true) }), { kind: "mutation" }), method(_void(), RunnerLocalLoadSchema), method(_void(), RunnerLocalMetricsSchema), method(object({ deviceId: number() }), CameraMetricsSchema.nullable()), method(_void(), array(CameraMetricsWithDeviceIdSchema).readonly()), method(_void(), array(number()).readonly()), method(object({
11253
+ handle: FrameHandleSchema,
11254
+ bbox: NativeCropBboxSchema,
11255
+ maxWidth: number().int().positive().optional()
11256
+ }), NativeCropResultSchema.nullable());
11231
11257
  object({
11232
11258
  detected: boolean(),
11233
11259
  /** Ms epoch of the last detected-true observation. Null if never detected. */
@@ -12815,7 +12841,9 @@ var AddonPageDeclarationSchema$1 = object({
12815
12841
  icon: string(),
12816
12842
  path: string(),
12817
12843
  remoteName: string(),
12818
- bundle: string()
12844
+ bundle: string(),
12845
+ section: string().optional(),
12846
+ sectionLabel: string().optional()
12819
12847
  });
12820
12848
  var AddonPageInfoSchema = object({
12821
12849
  addonId: string(),
@@ -12855,7 +12883,18 @@ var AddonPageDeclarationSchema = object({
12855
12883
  * the static-file route can compute an mtime-based cache-buster URL
12856
12884
  * without a separate filesystem stat.
12857
12885
  */
12858
- bundle: string()
12886
+ bundle: string(),
12887
+ /**
12888
+ * Sidebar section this page docks into. Well-known ids: `'detection'`,
12889
+ * `'cluster'`, `'administration'` — the page renders inside that group.
12890
+ * Any OTHER string creates (or joins) a custom section rendered after
12891
+ * the built-in groups; its label comes from `sectionLabel` (first
12892
+ * declaration wins), falling back to the id. Absent → the legacy
12893
+ * "Addon Pages" group.
12894
+ */
12895
+ section: string().optional(),
12896
+ /** Display label for a CUSTOM `section` id (ignored for well-known ids). */
12897
+ sectionLabel: string().optional()
12859
12898
  });
12860
12899
  method(_void(), array(AddonPageDeclarationSchema).readonly());
12861
12900
  var AddonHttpRouteSchema = object({
@@ -13071,6 +13110,17 @@ var WidgetMetadataSchema = object({
13071
13110
  deviceContext: boolean().default(false),
13072
13111
  integrationContext: boolean().default(false)
13073
13112
  }),
13113
+ /**
13114
+ * Loadable BEFORE authentication. The normal widget registry listing
13115
+ * (`addon-widgets.listWidgets`) is auth-gated, so a pre-auth surface
13116
+ * (the login page) cannot discover a widget through it. A widget that
13117
+ * declares `preAuth: true` marks itself as safe to mount on a pre-auth
13118
+ * screen — it is surfaced through the PUBLIC `auth.listLoginMethods`
13119
+ * login-method contribution channel (see `login-method.cap.ts`) rather
13120
+ * than the authenticated registry, and its bundle is served by the
13121
+ * public `/api/addon-widgets/:addonId/*` static route. Defaults false.
13122
+ */
13123
+ preAuth: boolean().optional().default(false),
13074
13124
  /** Dashboard placement HINTS (operator can override per instance). */
13075
13125
  defaultSize: WidgetSizeEnum.default("md"),
13076
13126
  allowedSizes: array(WidgetSizeEnum).readonly().default([
@@ -13372,6 +13422,66 @@ method(object({
13372
13422
  password: string()
13373
13423
  }), AuthResultSchema.nullable(), { kind: "mutation" }), method(object({ state: string() }), string()), method(record(string(), string()), AuthResultSchema, { kind: "mutation" }), method(object({ token: string() }), AuthResultSchema.nullable());
13374
13424
  /**
13425
+ * `login-method` — collection cap through which auth addons contribute
13426
+ * their pre-auth login surfaces to the login page. This is the SINGLE,
13427
+ * generic mechanism that supersedes the dead `auth.listProviders` reader:
13428
+ * every auth addon (OIDC, magic-link, WebAuthn/passkey) registers a
13429
+ * `login-method` provider and the PUBLIC `auth.listLoginMethods`
13430
+ * procedure aggregates them for the unauthenticated login page.
13431
+ *
13432
+ * A contribution is a discriminated union on `kind`:
13433
+ *
13434
+ * - `redirect` — a declarative button. The login page renders a generic
13435
+ * button that navigates to `startUrl` (an addon-owned HTTP route).
13436
+ * Covers OIDC (`/addon/auth-oidc/<id>/start`) and magic-link with
13437
+ * ZERO shell-side JS. A future SSO addon plugs in the same way — the
13438
+ * login page needs NO change.
13439
+ *
13440
+ * - `widget` — a Module-Federation widget the login page mounts (via
13441
+ * `loadRemoteBundle`) for an in-page ceremony. Covers the passkey
13442
+ * login ceremony, which must run `@simplewebauthn/browser` INSIDE the
13443
+ * addon bundle. The referenced widget also declares `preAuth: true` in
13444
+ * its `addon-widgets-source` catalog entry. `auth.listLoginMethods`
13445
+ * stamps a public `bundleUrl` from `addonId` + `bundle`.
13446
+ *
13447
+ * Every contribution carries a `stage`:
13448
+ * - `primary` — shown on the first credentials screen (OIDC /
13449
+ * magic-link buttons; a future usernameless passkey).
13450
+ * - `second-factor` — shown AFTER the password leg, gated on the
13451
+ * returned `factors` (passkey-as-2FA today).
13452
+ *
13453
+ * `mount: skip` — the cap is read server-side by the core auth router
13454
+ * (`registry.getCollection('login-method')`), never mounted as its own
13455
+ * tRPC router.
13456
+ */
13457
+ /** When a login method renders in the two-phase login flow. */
13458
+ var LoginStageEnum = _enum(["primary", "second-factor"]);
13459
+ /** One login-method contribution — redirect button OR pre-auth widget. */
13460
+ var LoginMethodContributionSchema = discriminatedUnion("kind", [object({
13461
+ kind: literal("redirect"),
13462
+ /** Stable id within the login-method set (e.g. `auth-oidc/google`). */
13463
+ id: string(),
13464
+ /** Operator-facing button label. */
13465
+ label: string(),
13466
+ /** lucide-react icon name. */
13467
+ icon: string().optional(),
13468
+ /** Addon-owned HTTP route the button navigates to (GET). */
13469
+ startUrl: string(),
13470
+ stage: LoginStageEnum
13471
+ }), object({
13472
+ kind: literal("widget"),
13473
+ /** Stable id within the login-method set (e.g. `auth-webauthn/passkey-login`). */
13474
+ id: string(),
13475
+ /** Owning addon id — drives the public bundle URL + the MF namespace. */
13476
+ addonId: string(),
13477
+ /** Bundle filename inside the addon's dist dir (`remoteEntry.js`). */
13478
+ bundle: string(),
13479
+ /** MF remote descriptor — `{ remoteName, exposedModule, componentKey }`. */
13480
+ remote: WidgetRemoteSchema,
13481
+ stage: LoginStageEnum
13482
+ })]);
13483
+ method(_void(), array(LoginMethodContributionSchema).readonly());
13484
+ /**
13375
13485
  * Orchestrator-side destination metadata. The orchestrator computes
13376
13486
  * `id = <addonId>:<subId>` from its provider lookup so consumers
13377
13487
  * (admin UI, restore flow) see one canonical key.
@@ -15475,7 +15585,17 @@ var TrackSchema = object({
15475
15585
  /** Cumulative normalized distance travelled (0..1 units = full frame width). */
15476
15586
  totalDistance: number(),
15477
15587
  state: TrackStateSchema,
15478
- active: boolean()
15588
+ active: boolean(),
15589
+ /** Deterministic key-event importance score in [0,1] (server-computed at
15590
+ * track expiry, recomputed on late label). Absent on legacy rows written
15591
+ * before scoring shipped — consumers degrade to absence / compute-on-read. */
15592
+ importance: number().optional(),
15593
+ /** Id of the track's highest-confidence ObjectEvent (its representative
15594
+ * "best" frame). Absent when the track produced no object events. */
15595
+ bestEventId: string().optional(),
15596
+ /** Tag of the importance sub-signal that dominated the score
15597
+ * (identity|dwell|proximity|class|confidence|travel|zone). */
15598
+ importanceReason: string().optional()
15479
15599
  });
15480
15600
  var BaseEventFields = {
15481
15601
  id: string(),
@@ -15540,8 +15660,18 @@ var ObjectEventSchema = object({
15540
15660
  frameHeight: number().optional(),
15541
15661
  /** MediaStore key for the crop attached to this event (if any). */
15542
15662
  mediaKey: string().optional(),
15663
+ /** Design B: MediaStore key of the track's native-resolution key frame (the
15664
+ * best-detection full frame). Resolve via the event-media data-plane
15665
+ * (`/addon/<addonId>/event-media/<keyFrameMediaKey>`) for a detail view that
15666
+ * draws `bbox` over the native frame. Absent on legacy rows / non-decoded
15667
+ * sources — consumers fall back to `mediaKey` (the tight crop). */
15668
+ keyFrameMediaKey: string().optional(),
15543
15669
  /** Populated by B5 (recording playback URL for this event). */
15544
- mediaUrl: string().optional()
15670
+ mediaUrl: string().optional(),
15671
+ /** The parent track's key-event importance [0,1], propagated to every object
15672
+ * event of the track (so an event row can be sorted by importance without a
15673
+ * track join). Absent on legacy rows / before the track was scored. */
15674
+ importance: number().optional()
15545
15675
  });
15546
15676
  var AudioEventSchema = object({
15547
15677
  ...BaseEventFields,
@@ -15565,7 +15695,8 @@ var MediaFileKindEnum = _enum([
15565
15695
  "fullFrame",
15566
15696
  "fullFrameBoxed",
15567
15697
  "faceCrop",
15568
- "plateCrop"
15698
+ "plateCrop",
15699
+ "keyFrame"
15569
15700
  ]);
15570
15701
  var MediaFileSchema = object({
15571
15702
  key: string(),
@@ -15586,6 +15717,32 @@ var DeviceEventQueryInput = object({
15586
15717
  projection: _enum(["full", "slim"]).optional()
15587
15718
  });
15588
15719
  var ObjectEventQueryInput = DeviceEventQueryInput.extend({ classFilter: string().optional() });
15720
+ var KeyEventQueryInput = object({
15721
+ deviceId: number(),
15722
+ /** Window lower bound (track firstSeen ≥ since). */
15723
+ since: number(),
15724
+ /** Window upper bound (track firstSeen ≤ until). */
15725
+ until: number(),
15726
+ limit: number().int().min(1).max(200).default(50),
15727
+ /** Drop tracks scoring below this importance. */
15728
+ minImportance: number().min(0).max(1).optional(),
15729
+ /** Restrict to a single class (e.g. 'person'). */
15730
+ classFilter: string().optional()
15731
+ });
15732
+ var KeyEventSchema = object({
15733
+ /** The representative event id (the track's best ObjectEvent, else its trackId). */
15734
+ id: string(),
15735
+ trackId: string(),
15736
+ /** Track start time (firstSeen). */
15737
+ timestamp: number(),
15738
+ className: string(),
15739
+ label: string().optional(),
15740
+ importance: number(),
15741
+ /** Highest-confidence ObjectEvent id for the track (empty when none). */
15742
+ bestEventId: string(),
15743
+ /** Track lifetime in ms (lastSeen - firstSeen). */
15744
+ windowMs: number().optional()
15745
+ });
15589
15746
  var TrackedDetectionSchema = object({
15590
15747
  trackId: string(),
15591
15748
  className: string(),
@@ -15615,7 +15772,7 @@ DeviceType.Camera, method(object({ deviceId: number() }), array(TrackSchema).rea
15615
15772
  }), array(TrackSchema).readonly()), method(object({ deviceId: number() }), _void(), {
15616
15773
  kind: "mutation",
15617
15774
  auth: "admin"
15618
- }), method(DeviceEventQueryInput, array(MotionEventSchema).readonly()), method(ObjectEventQueryInput, array(ObjectEventSchema).readonly()), method(DeviceEventQueryInput, array(AudioEventSchema).readonly()), method(object({
15775
+ }), method(DeviceEventQueryInput, array(MotionEventSchema).readonly()), method(ObjectEventQueryInput, array(ObjectEventSchema).readonly()), method(DeviceEventQueryInput, array(AudioEventSchema).readonly()), method(KeyEventQueryInput, array(KeyEventSchema).readonly()), method(object({
15619
15776
  deviceId: number(),
15620
15777
  since: number(),
15621
15778
  until: number(),
@@ -15689,7 +15846,12 @@ var AgentPipelineSettingsSchema = object({
15689
15846
  detectWeight: number().positive().optional(),
15690
15847
  /** Node is eligible to run the detection pipeline (decode + inference). */
15691
15848
  detect: boolean().optional(),
15692
- /** Node is eligible to host decoder sessions. */
15849
+ /**
15850
+ * DEPRECATED AND IGNORED. Decode is always co-located with its frame
15851
+ * consumer, so decode eligibility IS detect eligibility. Kept optional in
15852
+ * the schema ONLY so persisted stores written before the removal still
15853
+ * parse — no code reads it and no write path emits it.
15854
+ */
15693
15855
  decode: boolean().optional(),
15694
15856
  /** Node is eligible to run audio-analyzer sessions. */
15695
15857
  audio: boolean().optional(),
@@ -15750,25 +15912,6 @@ var PipelineAssignmentSchema = object({
15750
15912
  assignedAt: number()
15751
15913
  });
15752
15914
  /**
15753
- * Decoder placement record. Symmetric to `PipelineAssignmentSchema` but for
15754
- * the decoder-node placement domain (`balanceDecoder` decision: manual pin
15755
- * → co-located with pipeline → capacity).
15756
- */
15757
- var DecoderAssignmentSchema = object({
15758
- deviceId: number(),
15759
- /** Moleculer node id of the decoder provider currently responsible for this camera. */
15760
- decoderNodeId: string(),
15761
- /** True when the assignment was set manually via `assignDecoder`, false when chosen by the balancer. */
15762
- pinned: boolean(),
15763
- /** Why this assignment was made — useful for debugging the decoder balancer. */
15764
- reason: _enum([
15765
- "manual",
15766
- "co-located",
15767
- "capacity",
15768
- "hardware-affinity"
15769
- ])
15770
- });
15771
- /**
15772
15915
  * Per-agent load summary surfaced to the load balancer + dashboards.
15773
15916
  * Aggregated from each runner's `getLocalLoad` cap call.
15774
15917
  */
@@ -15974,15 +16117,6 @@ method(object({
15974
16117
  }), method(_void(), IngestOwnerSchema), method(object({
15975
16118
  deviceId: number(),
15976
16119
  nodeId: string()
15977
- }), _void(), {
15978
- kind: "mutation",
15979
- auth: "admin"
15980
- }), method(object({ deviceId: number() }), _void(), {
15981
- kind: "mutation",
15982
- auth: "admin"
15983
- }), method(_void(), array(DecoderAssignmentSchema).readonly()), method(object({
15984
- deviceId: number(),
15985
- nodeId: string()
15986
16120
  }), object({ success: literal(true) }), {
15987
16121
  kind: "mutation",
15988
16122
  auth: "admin"
@@ -16001,10 +16135,7 @@ method(object({
16001
16135
  nodeId: string(),
16002
16136
  pinned: boolean(),
16003
16137
  assignedAt: number()
16004
- }))), method(object({
16005
- deviceId: number(),
16006
- pipelineNodeId: string().optional()
16007
- }), DecoderAssignmentSchema), method(object({ agentNodeId: string() }), AgentPipelineSettingsSchema.nullable()), method(_void(), array(object({
16138
+ }))), method(object({ agentNodeId: string() }), AgentPipelineSettingsSchema.nullable()), method(_void(), array(object({
16008
16139
  nodeId: string(),
16009
16140
  settings: AgentPipelineSettingsSchema
16010
16141
  })).readonly()), method(object({
@@ -16034,7 +16165,6 @@ method(object({
16034
16165
  }), method(object({
16035
16166
  agentNodeId: string(),
16036
16167
  detect: boolean().nullable().optional(),
16037
- decode: boolean().nullable().optional(),
16038
16168
  audio: boolean().nullable().optional(),
16039
16169
  ingest: boolean().nullable().optional()
16040
16170
  }), object({ success: literal(true) }), {
@@ -16046,6 +16176,15 @@ method(object({
16046
16176
  }), object({ success: literal(true) }), {
16047
16177
  kind: "mutation",
16048
16178
  auth: "admin"
16179
+ }), method(object({ agentNodeId: string() }), object({
16180
+ success: literal(true),
16181
+ /** Hardware-aware default detection model now in effect on the node (null when unresolvable). */
16182
+ effectiveModelId: string().nullable(),
16183
+ /** Number of cameras whose node-scoped overrides were cleared. */
16184
+ clearedCameraOverrides: number()
16185
+ }), {
16186
+ kind: "mutation",
16187
+ auth: "admin"
16049
16188
  }), method(object({ deviceId: number() }), CameraPipelineSettingsSchema.nullable()), method(object({
16050
16189
  deviceId: number(),
16051
16190
  addonId: string(),
@@ -16091,6 +16230,131 @@ method(object({
16091
16230
  auth: "admin"
16092
16231
  });
16093
16232
  /**
16233
+ * server-management — per-NODE singleton capability for a node's ROOT
16234
+ * package lifecycle (runtime-updatable node packages, phase 2: hub + docker
16235
+ * agents).
16236
+ *
16237
+ * Each node's root package (`@camstack/server` on the hub, `@camstack/agent`
16238
+ * on agents) carries the whole software stack in its npm dep tree, so ONE
16239
+ * version describes the node. Updates install into
16240
+ * `<dataDir>/server-root/versions/<v>/` and apply on restart via the baked
16241
+ * starter (probation boot + auto-rollback to N-1).
16242
+ *
16243
+ * Providers:
16244
+ * - HUB: `ServerUpdateService` behind the `server-provided` mount
16245
+ * (`buildServerProviders` in trpc.router.ts) — the default target for
16246
+ * unpinned calls.
16247
+ * - AGENT: `AgentUpdateService` registered by the agent bootstrap under
16248
+ * the synthetic `agent-runtime` addonId and declared in the agent's
16249
+ * `$hub.registerNode` manifest.
16250
+ *
16251
+ * Node routing: singleton caps get the codegen/runtime-builder `nodeId`
16252
+ * injection on every method — `input.nodeId` (or `nodePin(nodeId)` from the
16253
+ * SDK) routes the call to that node's provider via the standard remote
16254
+ * proxy (`createCapabilityProxy` → `$agent-cap-fwd` → the agent's
16255
+ * in-process provider lookup). No `nodeId` → the hub's own provider.
16256
+ *
16257
+ * Spec: docs/superpowers/specs/2026-07-12-runtime-updatable-node-packages-design.md
16258
+ */
16259
+ /**
16260
+ * Where the running hub's code was loaded from:
16261
+ * - `workspace` — dev checkout (tsx / workspace dist); the starter defers to
16262
+ * plain resolution and runtime updates are refused.
16263
+ * - `baked` — the immutable image seed closure (no data-dir root active).
16264
+ * - `data-root` — the runtime-updatable `<dataDir>/server-root` closure.
16265
+ */
16266
+ var ServerBootModeSchema = _enum([
16267
+ "workspace",
16268
+ "baked",
16269
+ "data-root"
16270
+ ]);
16271
+ /**
16272
+ * Update lifecycle state:
16273
+ * - `idle` / `checking` / `staging` — steady / in-flight registry work.
16274
+ * - `pending-restart` — a version is staged and the node has NOT yet
16275
+ * restarted onto it (still running the OLD version).
16276
+ * - `awaiting-confirmation` — the node HAS restarted onto the staged version
16277
+ * (it is the active probation boot) and is waiting to confirm boot-health.
16278
+ * Apply/rollback are refused in this state and the node must NOT be
16279
+ * manually restarted, or the probation boot auto-rolls-back.
16280
+ */
16281
+ var ServerUpdateStateSchema = _enum([
16282
+ "idle",
16283
+ "checking",
16284
+ "staging",
16285
+ "pending-restart",
16286
+ "awaiting-confirmation"
16287
+ ]);
16288
+ var ServerRollbackInfoSchema = object({
16289
+ /** The version that failed (or was manually rolled back). */
16290
+ fromVersion: string(),
16291
+ /** The version rolled back to; null = the baked seed. */
16292
+ toVersion: string().nullable(),
16293
+ atMs: number(),
16294
+ reason: string()
16295
+ });
16296
+ var ServerPackageStatusSchema = object({
16297
+ /** Root package name (`@camstack/server` on the hub). */
16298
+ packageName: string(),
16299
+ /** Version of the code the running process ACTUALLY loaded. */
16300
+ runningVersion: string().nullable(),
16301
+ /** Node.js runtime version the node's process runs on (`process.versions.node`). */
16302
+ nodeRuntimeVersion: string().nullable(),
16303
+ /** Active data-dir root version; null when booted from seed/workspace. */
16304
+ activeVersion: string().nullable(),
16305
+ /** N-1 version kept for rollback; null when no previous version exists. */
16306
+ previousVersion: string().nullable(),
16307
+ /** Version of the immutable baked seed closure (image fallback). */
16308
+ seedVersion: string().nullable(),
16309
+ /** Latest registry version from the most recent check (null = never checked). */
16310
+ latestVersion: string().nullable(),
16311
+ updateAvailable: boolean(),
16312
+ bootMode: ServerBootModeSchema,
16313
+ updateState: ServerUpdateStateSchema,
16314
+ /** Version staged + awaiting its probation boot, when one is pending. */
16315
+ pendingVersion: string().nullable(),
16316
+ /** Set when the last freshly-activated version failed its boot health-check. */
16317
+ rolledBack: ServerRollbackInfoSchema.nullable(),
16318
+ /**
16319
+ * True when `server-root/state.json` EXISTS but is unreadable/corrupt — the
16320
+ * hub is running from the baked seed (or workspace) while installed data-dir
16321
+ * versions are being IGNORED. Surfaced as a warning in the UI.
16322
+ */
16323
+ stateFileCorrupt: boolean(),
16324
+ lastCheckedAtMs: number().nullable()
16325
+ });
16326
+ var ServerUpdateCheckResultSchema = object({
16327
+ packageName: string(),
16328
+ runningVersion: string().nullable(),
16329
+ latestVersion: string().nullable(),
16330
+ updateAvailable: boolean(),
16331
+ checkedAtMs: number(),
16332
+ /** Non-null when the registry lookup failed (offline, bad registry, …). */
16333
+ error: string().nullable()
16334
+ });
16335
+ var ServerUpdateActionResultSchema = object({
16336
+ accepted: boolean(),
16337
+ targetVersion: string().nullable(),
16338
+ /** True when a graceful restart was scheduled to apply the change. */
16339
+ restarting: boolean(),
16340
+ message: string()
16341
+ });
16342
+ method(_void(), ServerPackageStatusSchema, { auth: "admin" }), method(_void(), ServerUpdateCheckResultSchema, {
16343
+ kind: "mutation",
16344
+ auth: "admin"
16345
+ }), method(object({
16346
+ /** Explicit target version; omitted = latest from the registry. */
16347
+ version: string().optional() }), ServerUpdateActionResultSchema, {
16348
+ kind: "mutation",
16349
+ auth: "admin"
16350
+ }), method(_void(), ServerUpdateActionResultSchema, {
16351
+ kind: "mutation",
16352
+ auth: "admin"
16353
+ }), method(_void(), ServerUpdateActionResultSchema, {
16354
+ kind: "mutation",
16355
+ auth: "admin"
16356
+ });
16357
+ /**
16094
16358
  * Query filter for settings-store collections.
16095
16359
  */
16096
16360
  var QueryFilterSchema = object({
@@ -16312,7 +16576,20 @@ var snapshotCapability = {
16312
16576
  invalidateCache: method(object({ deviceId: number() }), _void(), {
16313
16577
  kind: "mutation",
16314
16578
  auth: "admin"
16315
- })
16579
+ }),
16580
+ /**
16581
+ * Cache-only batch overview — answers from the wrapper's in-memory cache in
16582
+ * O(n) and NEVER triggers a capture. Lets a grid skip requesting images for
16583
+ * devices that never produced a frame, and gives it an ETag per device for
16584
+ * conditional (304-able) image fetches. `lastCapturedAt`/`cacheAgeMs`/`etag`
16585
+ * are null for a device with no cached frame.
16586
+ */
16587
+ getSnapshotOverview: systemMethod(object({ deviceIds: array(number()).min(1).max(200) }), array(object({
16588
+ deviceId: number(),
16589
+ lastCapturedAt: number().nullable(),
16590
+ cacheAgeMs: number().nullable(),
16591
+ etag: string().nullable()
16592
+ })))
16316
16593
  },
16317
16594
  status: {
16318
16595
  schema: SnapshotStatusSchema,
@@ -16569,10 +16846,32 @@ method(_void(), array(TurnServerSchema).readonly());
16569
16846
  * b. `finishAuthentication({userId, response})` → server verifies
16570
16847
  * the assertion, bumps the credential counter, returns ok.
16571
16848
  *
16849
+ * 2b. Usernameless (discoverable-credential) authentication — the
16850
+ * passkey IS the primary factor, no password leg:
16851
+ * a. `beginDiscoverableAuthentication({})` → assertion options with
16852
+ * EMPTY `allowCredentials` (the browser offers every resident
16853
+ * passkey it holds for this RP) + `userVerification: 'required'`
16854
+ * (the passkey replaces both factors, so UV is mandatory).
16855
+ * The challenge is stored server-side, NOT bound to any user.
16856
+ * b. `finishDiscoverableAuthentication({response})` → the provider
16857
+ * resolves the credential by the response's credential id,
16858
+ * verifies the assertion against the stored challenge + that
16859
+ * credential's public key/counter, and returns the OWNING
16860
+ * `userId` — the caller (core auth router) mints the session.
16861
+ *
16572
16862
  * 3. Management:
16573
16863
  * - `listPasskeys({userId})` — enumerate user's enrolled credentials.
16574
16864
  * - `removePasskey({userId, credentialId})` — revoke one credential.
16575
16865
  *
16866
+ * 4. Second-factor preference (opt-in, default OFF):
16867
+ * Enrolling a passkey only enables passkey-FIRST sign-in. It is
16868
+ * demanded as a second factor after a password login ONLY when the
16869
+ * user explicitly opts in via `setSecondFactorPreference`.
16870
+ * - `getSecondFactorPreference({userId})` → `{ enabled }` (missing
16871
+ * row ⇒ `enabled: false`).
16872
+ * - `setSecondFactorPreference({userId, enabled})` — persisted by
16873
+ * the providing addon beside its credentials.
16874
+ *
16576
16875
  * Challenges are short-lived (5 min, in-memory). The cap is internal —
16577
16876
  * the admin-ui composes the begin/finish round-trip and never exposes
16578
16877
  * the cap to non-admins.
@@ -16615,6 +16914,17 @@ method(object({
16615
16914
  }), object({ verified: boolean() }), {
16616
16915
  kind: "mutation",
16617
16916
  access: "view"
16917
+ }), method(object({}), object({ optionsJSON: record(string(), unknown()) }), {
16918
+ kind: "mutation",
16919
+ access: "view"
16920
+ }), method(object({
16921
+ /** AuthenticationResponseJSON from the browser. */
16922
+ response: record(string(), unknown()) }), object({
16923
+ verified: boolean(),
16924
+ userId: string().nullable()
16925
+ }), {
16926
+ kind: "mutation",
16927
+ access: "view"
16618
16928
  }), method(object({ userId: string() }), array(PasskeySummarySchema), { auth: "admin" }), method(object({
16619
16929
  userId: string(),
16620
16930
  credentialId: string()
@@ -16622,6 +16932,13 @@ method(object({
16622
16932
  kind: "mutation",
16623
16933
  auth: "admin",
16624
16934
  access: "delete"
16935
+ }), method(object({ userId: string() }), object({ enabled: boolean() }), { auth: "admin" }), method(object({
16936
+ userId: string(),
16937
+ enabled: boolean()
16938
+ }), object({ success: literal(true) }), {
16939
+ kind: "mutation",
16940
+ auth: "admin",
16941
+ access: "create"
16625
16942
  });
16626
16943
  /**
16627
16944
  * `videoclips` — the unified, navigable-clip surface for a camera.
@@ -17423,7 +17740,17 @@ var FaceInfoSchema = object({
17423
17740
  recognizedIdentityId: string().optional(),
17424
17741
  identityName: string().optional(),
17425
17742
  assigned: boolean(),
17426
- base64: string().optional()
17743
+ base64: string().optional(),
17744
+ /** Design B: the face bbox (pixel space) on the key frame — lets a detail
17745
+ * view draw the box over the native `keyFrameMediaKey` frame. Absent on
17746
+ * legacy rows written before design B. */
17747
+ faceBbox: BoundingBoxSchema.optional(),
17748
+ /** Design B: MediaStore key of the track's native-resolution key frame.
17749
+ * Fetch the native JPEG via the event-media data-plane
17750
+ * (`/addon/<addonId>/event-media/<keyFrameMediaKey>`). Absent when the
17751
+ * track produced no key frame (e.g. native/onboard source) — the UI falls
17752
+ * back to the inline `base64` face crop. */
17753
+ keyFrameMediaKey: string().optional()
17427
17754
  });
17428
17755
  var FaceFilterEnum = _enum([
17429
17756
  "unassigned",
@@ -18120,6 +18447,16 @@ var TopologyCategorySchema = object({
18120
18447
  healthy: number(),
18121
18448
  addons: array(TopologyCategoryAddonSchema).readonly()
18122
18449
  });
18450
+ /**
18451
+ * The node's runtime-updatable ROOT package (`@camstack/server` on the hub,
18452
+ * `@camstack/agent` on agents) as reported by its `registerNode` manifest —
18453
+ * version visibility for the Server management surface. Nullable: offline
18454
+ * rows and pre-phase-2 nodes report none.
18455
+ */
18456
+ var TopologyRootPackageSchema = object({
18457
+ name: string(),
18458
+ version: string()
18459
+ });
18123
18460
  var TopologyNodeSchema = object({
18124
18461
  id: string(),
18125
18462
  name: string(),
@@ -18143,7 +18480,8 @@ var TopologyNodeSchema = object({
18143
18480
  status: string()
18144
18481
  })).readonly(),
18145
18482
  processes: array(TopologyProcessSchema).readonly(),
18146
- categories: array(TopologyCategorySchema).readonly()
18483
+ categories: array(TopologyCategorySchema).readonly(),
18484
+ rootPackage: TopologyRootPackageSchema.nullable()
18147
18485
  });
18148
18486
  var CapUsageEdgeSchema = object({
18149
18487
  callerAddonId: string(),
@@ -20985,6 +21323,12 @@ Object.freeze({
20985
21323
  addonId: null,
20986
21324
  access: "create"
20987
21325
  },
21326
+ "loginMethod.getLoginMethods": {
21327
+ capName: "login-method",
21328
+ capScope: "system",
21329
+ addonId: null,
21330
+ access: "view"
21331
+ },
20988
21332
  "mediaPlayer.next": {
20989
21333
  capName: "media-player",
20990
21334
  capScope: "device",
@@ -21567,6 +21911,12 @@ Object.freeze({
21567
21911
  addonId: null,
21568
21912
  access: "view"
21569
21913
  },
21914
+ "pipelineAnalytics.getKeyEvents": {
21915
+ capName: "pipeline-analytics",
21916
+ capScope: "device",
21917
+ addonId: null,
21918
+ access: "view"
21919
+ },
21570
21920
  "pipelineAnalytics.getMotionEvents": {
21571
21921
  capName: "pipeline-analytics",
21572
21922
  capScope: "device",
@@ -21615,23 +21965,23 @@ Object.freeze({
21615
21965
  addonId: null,
21616
21966
  access: "create"
21617
21967
  },
21618
- "pipelineExecutor.deleteModel": {
21968
+ "pipelineExecutor.clearDeviceOverrides": {
21619
21969
  capName: "pipeline-executor",
21620
21970
  capScope: "system",
21621
21971
  addonId: null,
21622
21972
  access: "delete"
21623
21973
  },
21624
- "pipelineExecutor.deleteTemplate": {
21974
+ "pipelineExecutor.deleteModel": {
21625
21975
  capName: "pipeline-executor",
21626
21976
  capScope: "system",
21627
21977
  addonId: null,
21628
21978
  access: "delete"
21629
21979
  },
21630
- "pipelineExecutor.detect": {
21980
+ "pipelineExecutor.deleteTemplate": {
21631
21981
  capName: "pipeline-executor",
21632
21982
  capScope: "system",
21633
21983
  addonId: null,
21634
- access: "view"
21984
+ access: "delete"
21635
21985
  },
21636
21986
  "pipelineExecutor.downloadModel": {
21637
21987
  capName: "pipeline-executor",
@@ -21777,12 +22127,6 @@ Object.freeze({
21777
22127
  addonId: null,
21778
22128
  access: "create"
21779
22129
  },
21780
- "pipelineExecutor.resetToDefault": {
21781
- capName: "pipeline-executor",
21782
- capScope: "system",
21783
- addonId: null,
21784
- access: "delete"
21785
- },
21786
22130
  "pipelineExecutor.runAudioTest": {
21787
22131
  capName: "pipeline-executor",
21788
22132
  capScope: "system",
@@ -21843,12 +22187,6 @@ Object.freeze({
21843
22187
  addonId: null,
21844
22188
  access: "create"
21845
22189
  },
21846
- "pipelineOrchestrator.assignDecoder": {
21847
- capName: "pipeline-orchestrator",
21848
- capScope: "system",
21849
- addonId: null,
21850
- access: "create"
21851
- },
21852
22190
  "pipelineOrchestrator.assignPipeline": {
21853
22191
  capName: "pipeline-orchestrator",
21854
22192
  capScope: "system",
@@ -21927,18 +22265,6 @@ Object.freeze({
21927
22265
  addonId: null,
21928
22266
  access: "view"
21929
22267
  },
21930
- "pipelineOrchestrator.getDecoderAssignment": {
21931
- capName: "pipeline-orchestrator",
21932
- capScope: "system",
21933
- addonId: null,
21934
- access: "view"
21935
- },
21936
- "pipelineOrchestrator.getDecoderAssignments": {
21937
- capName: "pipeline-orchestrator",
21938
- capScope: "system",
21939
- addonId: null,
21940
- access: "view"
21941
- },
21942
22268
  "pipelineOrchestrator.getGlobalMetrics": {
21943
22269
  capName: "pipeline-orchestrator",
21944
22270
  capScope: "system",
@@ -21987,6 +22313,12 @@ Object.freeze({
21987
22313
  addonId: null,
21988
22314
  access: "delete"
21989
22315
  },
22316
+ "pipelineOrchestrator.resetNodePipelineDefaults": {
22317
+ capName: "pipeline-orchestrator",
22318
+ capScope: "system",
22319
+ addonId: null,
22320
+ access: "delete"
22321
+ },
21990
22322
  "pipelineOrchestrator.resolvePipeline": {
21991
22323
  capName: "pipeline-orchestrator",
21992
22324
  capScope: "system",
@@ -22059,12 +22391,6 @@ Object.freeze({
22059
22391
  addonId: null,
22060
22392
  access: "create"
22061
22393
  },
22062
- "pipelineOrchestrator.unassignDecoder": {
22063
- capName: "pipeline-orchestrator",
22064
- capScope: "system",
22065
- addonId: null,
22066
- access: "create"
22067
- },
22068
22394
  "pipelineOrchestrator.unassignPipeline": {
22069
22395
  capName: "pipeline-orchestrator",
22070
22396
  capScope: "system",
@@ -22119,6 +22445,12 @@ Object.freeze({
22119
22445
  addonId: null,
22120
22446
  access: "view"
22121
22447
  },
22448
+ "pipelineRunner.getNativeCrop": {
22449
+ capName: "pipeline-runner",
22450
+ capScope: "system",
22451
+ addonId: null,
22452
+ access: "view"
22453
+ },
22122
22454
  "pipelineRunner.reportMotion": {
22123
22455
  capName: "pipeline-runner",
22124
22456
  capScope: "system",
@@ -22371,6 +22703,36 @@ Object.freeze({
22371
22703
  addonId: null,
22372
22704
  access: "create"
22373
22705
  },
22706
+ "serverManagement.applyServerUpdate": {
22707
+ capName: "server-management",
22708
+ capScope: "system",
22709
+ addonId: null,
22710
+ access: "create"
22711
+ },
22712
+ "serverManagement.checkServerUpdate": {
22713
+ capName: "server-management",
22714
+ capScope: "system",
22715
+ addonId: null,
22716
+ access: "create"
22717
+ },
22718
+ "serverManagement.getServerPackageStatus": {
22719
+ capName: "server-management",
22720
+ capScope: "system",
22721
+ addonId: null,
22722
+ access: "view"
22723
+ },
22724
+ "serverManagement.restartServer": {
22725
+ capName: "server-management",
22726
+ capScope: "system",
22727
+ addonId: null,
22728
+ access: "create"
22729
+ },
22730
+ "serverManagement.rollbackServerUpdate": {
22731
+ capName: "server-management",
22732
+ capScope: "system",
22733
+ addonId: null,
22734
+ access: "create"
22735
+ },
22374
22736
  "settingsStore.count": {
22375
22737
  capName: "settings-store",
22376
22738
  capScope: "system",
@@ -22455,6 +22817,12 @@ Object.freeze({
22455
22817
  addonId: null,
22456
22818
  access: "view"
22457
22819
  },
22820
+ "snapshot.getSnapshotOverview": {
22821
+ capName: "snapshot",
22822
+ capScope: "device",
22823
+ addonId: null,
22824
+ access: "view"
22825
+ },
22458
22826
  "snapshot.invalidateCache": {
22459
22827
  capName: "snapshot",
22460
22828
  capScope: "device",
@@ -23133,6 +23501,12 @@ Object.freeze({
23133
23501
  addonId: null,
23134
23502
  access: "view"
23135
23503
  },
23504
+ "userPasskeys.beginDiscoverableAuthentication": {
23505
+ capName: "user-passkeys",
23506
+ capScope: "system",
23507
+ addonId: null,
23508
+ access: "view"
23509
+ },
23136
23510
  "userPasskeys.beginRegistration": {
23137
23511
  capName: "user-passkeys",
23138
23512
  capScope: "system",
@@ -23145,12 +23519,24 @@ Object.freeze({
23145
23519
  addonId: null,
23146
23520
  access: "view"
23147
23521
  },
23522
+ "userPasskeys.finishDiscoverableAuthentication": {
23523
+ capName: "user-passkeys",
23524
+ capScope: "system",
23525
+ addonId: null,
23526
+ access: "view"
23527
+ },
23148
23528
  "userPasskeys.finishRegistration": {
23149
23529
  capName: "user-passkeys",
23150
23530
  capScope: "system",
23151
23531
  addonId: null,
23152
23532
  access: "create"
23153
23533
  },
23534
+ "userPasskeys.getSecondFactorPreference": {
23535
+ capName: "user-passkeys",
23536
+ capScope: "system",
23537
+ addonId: null,
23538
+ access: "view"
23539
+ },
23154
23540
  "userPasskeys.listPasskeys": {
23155
23541
  capName: "user-passkeys",
23156
23542
  capScope: "system",
@@ -23163,6 +23549,12 @@ Object.freeze({
23163
23549
  addonId: null,
23164
23550
  access: "delete"
23165
23551
  },
23552
+ "userPasskeys.setSecondFactorPreference": {
23553
+ capName: "user-passkeys",
23554
+ capScope: "system",
23555
+ addonId: null,
23556
+ access: "create"
23557
+ },
23166
23558
  "vacuumControl.locate": {
23167
23559
  capName: "vacuum-control",
23168
23560
  capScope: "device",
@@ -23235,6 +23627,18 @@ Object.freeze({
23235
23627
  addonId: null,
23236
23628
  access: "view"
23237
23629
  },
23630
+ "viewerUi.getStaticDir": {
23631
+ capName: "viewer-ui",
23632
+ capScope: "system",
23633
+ addonId: null,
23634
+ access: "view"
23635
+ },
23636
+ "viewerUi.getVersion": {
23637
+ capName: "viewer-ui",
23638
+ capScope: "system",
23639
+ addonId: null,
23640
+ access: "view"
23641
+ },
23238
23642
  "waterHeater.setAway": {
23239
23643
  capName: "water-heater",
23240
23644
  capScope: "device",