@camstack/addon-provider-hikvision 1.1.20 → 1.1.22

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
@@ -4636,7 +4636,7 @@ function _instanceof(cls, params = {}) {
4636
4636
  return inst;
4637
4637
  }
4638
4638
  //#endregion
4639
- //#region ../types/dist/sleep-Cc14_yxc.mjs
4639
+ //#region ../types/dist/sleep-BC9Yqte7.mjs
4640
4640
  var EventCategory = /* @__PURE__ */ function(EventCategory) {
4641
4641
  EventCategory["SystemBoot"] = "system.boot";
4642
4642
  EventCategory["SystemAddonsReady"] = "system.addons-ready";
@@ -5357,10 +5357,6 @@ function hydrateField(field, values) {
5357
5357
  };
5358
5358
  }
5359
5359
  const rawValue = storedValue !== void 0 ? storedValue : defaultValue !== void 0 ? defaultValue : null;
5360
- if (field.type === "password") return {
5361
- ...field,
5362
- value: ""
5363
- };
5364
5360
  const value = field.type === "textarea" && field.isJson && rawValue !== null && typeof rawValue === "object" ? JSON.stringify(rawValue, null, 2) : rawValue;
5365
5361
  return {
5366
5362
  ...field,
@@ -6744,10 +6740,25 @@ function method(input, output, options) {
6744
6740
  timeoutMs: options?.timeoutMs
6745
6741
  };
6746
6742
  }
6743
+ /**
6744
+ * A wrapper/system-only method: served exclusively by the cap's system-level
6745
+ * provider (`InferProvider`), and OPTIONAL on `InferNativeProvider` so per-device
6746
+ * driver natives don't stub out a wrapper concern (e.g. a cross-device cache
6747
+ * overview). The `systemOnly: true` literal is what `InferNativeProvider` keys on.
6748
+ */
6749
+ function systemMethod(input, output, options) {
6750
+ return {
6751
+ ...method(input, output, options),
6752
+ systemOnly: true
6753
+ };
6754
+ }
6747
6755
  /** Shorthand to define an event schema */
6748
6756
  function event(data) {
6749
6757
  return { data };
6750
6758
  }
6759
+ var StaticDirOutputSchema$1 = object({ staticDir: string() });
6760
+ var VersionOutputSchema$1 = object({ version: string() });
6761
+ method(_void(), StaticDirOutputSchema$1), method(_void(), VersionOutputSchema$1);
6751
6762
  var StaticDirOutputSchema = object({ staticDir: string() });
6752
6763
  var VersionOutputSchema = object({ version: string() });
6753
6764
  method(_void(), StaticDirOutputSchema), method(_void(), VersionOutputSchema);
@@ -11849,7 +11860,7 @@ var BoundingBoxSchema = object({
11849
11860
  w: number(),
11850
11861
  h: number()
11851
11862
  });
11852
- var SpatialDetectionSchema = object({
11863
+ object({
11853
11864
  class: string(),
11854
11865
  originalClass: string(),
11855
11866
  score: number(),
@@ -12024,6 +12035,7 @@ var PipelineAddonSchemaSchema = object({
12024
12035
  defaultModelId: string(),
12025
12036
  defaultModelIdByFormat: record(string(), string()).optional(),
12026
12037
  enabledByDefault: boolean().optional(),
12038
+ backfillIntoExistingOverrides: boolean().optional(),
12027
12039
  defaultConfidence: number(),
12028
12040
  group: string().optional(),
12029
12041
  configSchema: array(ConfigFieldBridge).readonly().optional()
@@ -12040,11 +12052,6 @@ var PipelineSchemaSchema = object({
12040
12052
  selectedEngine: PipelineEngineChoiceSchema,
12041
12053
  slots: array(PipelineSlotSchemaSchema).readonly()
12042
12054
  });
12043
- var DetectorOutputSchema = object({
12044
- detections: array(SpatialDetectionSchema).readonly(),
12045
- inferenceMs: number(),
12046
- modelId: string()
12047
- });
12048
12055
  var EngineProvisioningSchema = object({
12049
12056
  runtimeId: _enum([
12050
12057
  "onnx",
@@ -12169,7 +12176,7 @@ method(_void(), array(PipelineEngineChoiceSchema)), method(_void(), PipelineEngi
12169
12176
  auth: "admin"
12170
12177
  }), method(object({ nodeId: string() }), object({
12171
12178
  success: literal(true),
12172
- regeneratedModelId: string().nullable()
12179
+ clearedDevices: number()
12173
12180
  }), {
12174
12181
  kind: "mutation",
12175
12182
  auth: "admin"
@@ -12190,10 +12197,6 @@ method(_void(), array(PipelineEngineChoiceSchema)), method(_void(), PipelineEngi
12190
12197
  modelId: string(),
12191
12198
  format: ModelFormatSchema$1
12192
12199
  }), object({ success: literal(true) }), { kind: "mutation" }), method(object({
12193
- addonId: string(),
12194
- frame: FrameInputSchema,
12195
- config: record(string(), unknown()).optional()
12196
- }), DetectorOutputSchema), method(object({
12197
12200
  engine: PipelineEngineChoiceSchema.optional(),
12198
12201
  steps: array(PipelineStepInputSchema).min(1),
12199
12202
  frame: FrameInputSchema.optional(),
@@ -12372,6 +12375,25 @@ var zonesCapability = {
12372
12375
  runtimeState: object({ zones: array(ZoneSchema).readonly() })
12373
12376
  };
12374
12377
  /**
12378
+ * A bounding box in NORMALIZED [0,1] frame coordinates for `getNativeCrop`. The
12379
+ * decode worker resolves it against the RETAINED native frame's real pixel dims,
12380
+ * so the caller supplies only the detection-res bbox divided by the detection
12381
+ * dims — no native resolution to plumb.
12382
+ */
12383
+ var NativeCropBboxSchema = object({
12384
+ x: number(),
12385
+ y: number(),
12386
+ w: number(),
12387
+ h: number()
12388
+ });
12389
+ /** Result of a best-effort native-resolution crop (`getNativeCrop`). */
12390
+ var NativeCropResultSchema = object({
12391
+ /** Packed rgb (24-bit) pixels of the crop. */
12392
+ bytes: _instanceof(Uint8Array),
12393
+ width: number().int().positive(),
12394
+ height: number().int().positive()
12395
+ });
12396
+ /**
12375
12397
  * Per-camera tunable ranges + defaults. Single source of truth used
12376
12398
  * by both the Zod data schema (validation + default fallback) and
12377
12399
  * the device settings UI (slider min/max/step). Touch one place and
@@ -12627,7 +12649,11 @@ var RunnerLocalMetricsSchema = object({
12627
12649
  avgInferenceTimeMs: number(),
12628
12650
  queueDepth: number()
12629
12651
  });
12630
- 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());
12652
+ 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({
12653
+ handle: FrameHandleSchema,
12654
+ bbox: NativeCropBboxSchema,
12655
+ maxWidth: number().int().positive().optional()
12656
+ }), NativeCropResultSchema.nullable());
12631
12657
  /**
12632
12658
  * Hardware / firmware motion sensor cap — binary detected state plus
12633
12659
  * a timestamp of the last observation. Distinct from
@@ -15558,7 +15584,9 @@ var AddonPageDeclarationSchema$1 = object({
15558
15584
  icon: string(),
15559
15585
  path: string(),
15560
15586
  remoteName: string(),
15561
- bundle: string()
15587
+ bundle: string(),
15588
+ section: string().optional(),
15589
+ sectionLabel: string().optional()
15562
15590
  });
15563
15591
  var AddonPageInfoSchema = object({
15564
15592
  addonId: string(),
@@ -15598,7 +15626,18 @@ var AddonPageDeclarationSchema = object({
15598
15626
  * the static-file route can compute an mtime-based cache-buster URL
15599
15627
  * without a separate filesystem stat.
15600
15628
  */
15601
- bundle: string()
15629
+ bundle: string(),
15630
+ /**
15631
+ * Sidebar section this page docks into. Well-known ids: `'detection'`,
15632
+ * `'cluster'`, `'administration'` — the page renders inside that group.
15633
+ * Any OTHER string creates (or joins) a custom section rendered after
15634
+ * the built-in groups; its label comes from `sectionLabel` (first
15635
+ * declaration wins), falling back to the id. Absent → the legacy
15636
+ * "Addon Pages" group.
15637
+ */
15638
+ section: string().optional(),
15639
+ /** Display label for a CUSTOM `section` id (ignored for well-known ids). */
15640
+ sectionLabel: string().optional()
15602
15641
  });
15603
15642
  method(_void(), array(AddonPageDeclarationSchema).readonly());
15604
15643
  var AddonHttpRouteSchema = object({
@@ -15814,6 +15853,17 @@ var WidgetMetadataSchema = object({
15814
15853
  deviceContext: boolean().default(false),
15815
15854
  integrationContext: boolean().default(false)
15816
15855
  }),
15856
+ /**
15857
+ * Loadable BEFORE authentication. The normal widget registry listing
15858
+ * (`addon-widgets.listWidgets`) is auth-gated, so a pre-auth surface
15859
+ * (the login page) cannot discover a widget through it. A widget that
15860
+ * declares `preAuth: true` marks itself as safe to mount on a pre-auth
15861
+ * screen — it is surfaced through the PUBLIC `auth.listLoginMethods`
15862
+ * login-method contribution channel (see `login-method.cap.ts`) rather
15863
+ * than the authenticated registry, and its bundle is served by the
15864
+ * public `/api/addon-widgets/:addonId/*` static route. Defaults false.
15865
+ */
15866
+ preAuth: boolean().optional().default(false),
15817
15867
  /** Dashboard placement HINTS (operator can override per instance). */
15818
15868
  defaultSize: WidgetSizeEnum.default("md"),
15819
15869
  allowedSizes: array(WidgetSizeEnum).readonly().default([
@@ -16115,6 +16165,66 @@ method(object({
16115
16165
  password: string()
16116
16166
  }), AuthResultSchema.nullable(), { kind: "mutation" }), method(object({ state: string() }), string()), method(record(string(), string()), AuthResultSchema, { kind: "mutation" }), method(object({ token: string() }), AuthResultSchema.nullable());
16117
16167
  /**
16168
+ * `login-method` — collection cap through which auth addons contribute
16169
+ * their pre-auth login surfaces to the login page. This is the SINGLE,
16170
+ * generic mechanism that supersedes the dead `auth.listProviders` reader:
16171
+ * every auth addon (OIDC, magic-link, WebAuthn/passkey) registers a
16172
+ * `login-method` provider and the PUBLIC `auth.listLoginMethods`
16173
+ * procedure aggregates them for the unauthenticated login page.
16174
+ *
16175
+ * A contribution is a discriminated union on `kind`:
16176
+ *
16177
+ * - `redirect` — a declarative button. The login page renders a generic
16178
+ * button that navigates to `startUrl` (an addon-owned HTTP route).
16179
+ * Covers OIDC (`/addon/auth-oidc/<id>/start`) and magic-link with
16180
+ * ZERO shell-side JS. A future SSO addon plugs in the same way — the
16181
+ * login page needs NO change.
16182
+ *
16183
+ * - `widget` — a Module-Federation widget the login page mounts (via
16184
+ * `loadRemoteBundle`) for an in-page ceremony. Covers the passkey
16185
+ * login ceremony, which must run `@simplewebauthn/browser` INSIDE the
16186
+ * addon bundle. The referenced widget also declares `preAuth: true` in
16187
+ * its `addon-widgets-source` catalog entry. `auth.listLoginMethods`
16188
+ * stamps a public `bundleUrl` from `addonId` + `bundle`.
16189
+ *
16190
+ * Every contribution carries a `stage`:
16191
+ * - `primary` — shown on the first credentials screen (OIDC /
16192
+ * magic-link buttons; a future usernameless passkey).
16193
+ * - `second-factor` — shown AFTER the password leg, gated on the
16194
+ * returned `factors` (passkey-as-2FA today).
16195
+ *
16196
+ * `mount: skip` — the cap is read server-side by the core auth router
16197
+ * (`registry.getCollection('login-method')`), never mounted as its own
16198
+ * tRPC router.
16199
+ */
16200
+ /** When a login method renders in the two-phase login flow. */
16201
+ var LoginStageEnum = _enum(["primary", "second-factor"]);
16202
+ /** One login-method contribution — redirect button OR pre-auth widget. */
16203
+ var LoginMethodContributionSchema = discriminatedUnion("kind", [object({
16204
+ kind: literal("redirect"),
16205
+ /** Stable id within the login-method set (e.g. `auth-oidc/google`). */
16206
+ id: string(),
16207
+ /** Operator-facing button label. */
16208
+ label: string(),
16209
+ /** lucide-react icon name. */
16210
+ icon: string().optional(),
16211
+ /** Addon-owned HTTP route the button navigates to (GET). */
16212
+ startUrl: string(),
16213
+ stage: LoginStageEnum
16214
+ }), object({
16215
+ kind: literal("widget"),
16216
+ /** Stable id within the login-method set (e.g. `auth-webauthn/passkey-login`). */
16217
+ id: string(),
16218
+ /** Owning addon id — drives the public bundle URL + the MF namespace. */
16219
+ addonId: string(),
16220
+ /** Bundle filename inside the addon's dist dir (`remoteEntry.js`). */
16221
+ bundle: string(),
16222
+ /** MF remote descriptor — `{ remoteName, exposedModule, componentKey }`. */
16223
+ remote: WidgetRemoteSchema,
16224
+ stage: LoginStageEnum
16225
+ })]);
16226
+ method(_void(), array(LoginMethodContributionSchema).readonly());
16227
+ /**
16118
16228
  * Orchestrator-side destination metadata. The orchestrator computes
16119
16229
  * `id = <addonId>:<subId>` from its provider lookup so consumers
16120
16230
  * (admin UI, restore flow) see one canonical key.
@@ -18230,7 +18340,17 @@ var TrackSchema = object({
18230
18340
  /** Cumulative normalized distance travelled (0..1 units = full frame width). */
18231
18341
  totalDistance: number(),
18232
18342
  state: TrackStateSchema,
18233
- active: boolean()
18343
+ active: boolean(),
18344
+ /** Deterministic key-event importance score in [0,1] (server-computed at
18345
+ * track expiry, recomputed on late label). Absent on legacy rows written
18346
+ * before scoring shipped — consumers degrade to absence / compute-on-read. */
18347
+ importance: number().optional(),
18348
+ /** Id of the track's highest-confidence ObjectEvent (its representative
18349
+ * "best" frame). Absent when the track produced no object events. */
18350
+ bestEventId: string().optional(),
18351
+ /** Tag of the importance sub-signal that dominated the score
18352
+ * (identity|dwell|proximity|class|confidence|travel|zone). */
18353
+ importanceReason: string().optional()
18234
18354
  });
18235
18355
  var BaseEventFields = {
18236
18356
  id: string(),
@@ -18295,8 +18415,18 @@ var ObjectEventSchema = object({
18295
18415
  frameHeight: number().optional(),
18296
18416
  /** MediaStore key for the crop attached to this event (if any). */
18297
18417
  mediaKey: string().optional(),
18418
+ /** Design B: MediaStore key of the track's native-resolution key frame (the
18419
+ * best-detection full frame). Resolve via the event-media data-plane
18420
+ * (`/addon/<addonId>/event-media/<keyFrameMediaKey>`) for a detail view that
18421
+ * draws `bbox` over the native frame. Absent on legacy rows / non-decoded
18422
+ * sources — consumers fall back to `mediaKey` (the tight crop). */
18423
+ keyFrameMediaKey: string().optional(),
18298
18424
  /** Populated by B5 (recording playback URL for this event). */
18299
- mediaUrl: string().optional()
18425
+ mediaUrl: string().optional(),
18426
+ /** The parent track's key-event importance [0,1], propagated to every object
18427
+ * event of the track (so an event row can be sorted by importance without a
18428
+ * track join). Absent on legacy rows / before the track was scored. */
18429
+ importance: number().optional()
18300
18430
  });
18301
18431
  var AudioEventSchema = object({
18302
18432
  ...BaseEventFields,
@@ -18320,7 +18450,8 @@ var MediaFileKindEnum = _enum([
18320
18450
  "fullFrame",
18321
18451
  "fullFrameBoxed",
18322
18452
  "faceCrop",
18323
- "plateCrop"
18453
+ "plateCrop",
18454
+ "keyFrame"
18324
18455
  ]);
18325
18456
  var MediaFileSchema = object({
18326
18457
  key: string(),
@@ -18341,6 +18472,32 @@ var DeviceEventQueryInput = object({
18341
18472
  projection: _enum(["full", "slim"]).optional()
18342
18473
  });
18343
18474
  var ObjectEventQueryInput = DeviceEventQueryInput.extend({ classFilter: string().optional() });
18475
+ var KeyEventQueryInput = object({
18476
+ deviceId: number(),
18477
+ /** Window lower bound (track firstSeen ≥ since). */
18478
+ since: number(),
18479
+ /** Window upper bound (track firstSeen ≤ until). */
18480
+ until: number(),
18481
+ limit: number().int().min(1).max(200).default(50),
18482
+ /** Drop tracks scoring below this importance. */
18483
+ minImportance: number().min(0).max(1).optional(),
18484
+ /** Restrict to a single class (e.g. 'person'). */
18485
+ classFilter: string().optional()
18486
+ });
18487
+ var KeyEventSchema = object({
18488
+ /** The representative event id (the track's best ObjectEvent, else its trackId). */
18489
+ id: string(),
18490
+ trackId: string(),
18491
+ /** Track start time (firstSeen). */
18492
+ timestamp: number(),
18493
+ className: string(),
18494
+ label: string().optional(),
18495
+ importance: number(),
18496
+ /** Highest-confidence ObjectEvent id for the track (empty when none). */
18497
+ bestEventId: string(),
18498
+ /** Track lifetime in ms (lastSeen - firstSeen). */
18499
+ windowMs: number().optional()
18500
+ });
18344
18501
  var TrackedDetectionSchema = object({
18345
18502
  trackId: string(),
18346
18503
  className: string(),
@@ -18370,7 +18527,7 @@ DeviceType.Camera, method(object({ deviceId: number() }), array(TrackSchema).rea
18370
18527
  }), array(TrackSchema).readonly()), method(object({ deviceId: number() }), _void(), {
18371
18528
  kind: "mutation",
18372
18529
  auth: "admin"
18373
- }), method(DeviceEventQueryInput, array(MotionEventSchema).readonly()), method(ObjectEventQueryInput, array(ObjectEventSchema).readonly()), method(DeviceEventQueryInput, array(AudioEventSchema).readonly()), method(object({
18530
+ }), method(DeviceEventQueryInput, array(MotionEventSchema).readonly()), method(ObjectEventQueryInput, array(ObjectEventSchema).readonly()), method(DeviceEventQueryInput, array(AudioEventSchema).readonly()), method(KeyEventQueryInput, array(KeyEventSchema).readonly()), method(object({
18374
18531
  deviceId: number(),
18375
18532
  since: number(),
18376
18533
  until: number(),
@@ -18444,7 +18601,12 @@ var AgentPipelineSettingsSchema = object({
18444
18601
  detectWeight: number().positive().optional(),
18445
18602
  /** Node is eligible to run the detection pipeline (decode + inference). */
18446
18603
  detect: boolean().optional(),
18447
- /** Node is eligible to host decoder sessions. */
18604
+ /**
18605
+ * DEPRECATED AND IGNORED. Decode is always co-located with its frame
18606
+ * consumer, so decode eligibility IS detect eligibility. Kept optional in
18607
+ * the schema ONLY so persisted stores written before the removal still
18608
+ * parse — no code reads it and no write path emits it.
18609
+ */
18448
18610
  decode: boolean().optional(),
18449
18611
  /** Node is eligible to run audio-analyzer sessions. */
18450
18612
  audio: boolean().optional(),
@@ -18505,25 +18667,6 @@ var PipelineAssignmentSchema = object({
18505
18667
  assignedAt: number()
18506
18668
  });
18507
18669
  /**
18508
- * Decoder placement record. Symmetric to `PipelineAssignmentSchema` but for
18509
- * the decoder-node placement domain (`balanceDecoder` decision: manual pin
18510
- * → co-located with pipeline → capacity).
18511
- */
18512
- var DecoderAssignmentSchema = object({
18513
- deviceId: number(),
18514
- /** Moleculer node id of the decoder provider currently responsible for this camera. */
18515
- decoderNodeId: string(),
18516
- /** True when the assignment was set manually via `assignDecoder`, false when chosen by the balancer. */
18517
- pinned: boolean(),
18518
- /** Why this assignment was made — useful for debugging the decoder balancer. */
18519
- reason: _enum([
18520
- "manual",
18521
- "co-located",
18522
- "capacity",
18523
- "hardware-affinity"
18524
- ])
18525
- });
18526
- /**
18527
18670
  * Per-agent load summary surfaced to the load balancer + dashboards.
18528
18671
  * Aggregated from each runner's `getLocalLoad` cap call.
18529
18672
  */
@@ -18729,15 +18872,6 @@ method(object({
18729
18872
  }), method(_void(), IngestOwnerSchema), method(object({
18730
18873
  deviceId: number(),
18731
18874
  nodeId: string()
18732
- }), _void(), {
18733
- kind: "mutation",
18734
- auth: "admin"
18735
- }), method(object({ deviceId: number() }), _void(), {
18736
- kind: "mutation",
18737
- auth: "admin"
18738
- }), method(_void(), array(DecoderAssignmentSchema).readonly()), method(object({
18739
- deviceId: number(),
18740
- nodeId: string()
18741
18875
  }), object({ success: literal(true) }), {
18742
18876
  kind: "mutation",
18743
18877
  auth: "admin"
@@ -18756,10 +18890,7 @@ method(object({
18756
18890
  nodeId: string(),
18757
18891
  pinned: boolean(),
18758
18892
  assignedAt: number()
18759
- }))), method(object({
18760
- deviceId: number(),
18761
- pipelineNodeId: string().optional()
18762
- }), DecoderAssignmentSchema), method(object({ agentNodeId: string() }), AgentPipelineSettingsSchema.nullable()), method(_void(), array(object({
18893
+ }))), method(object({ agentNodeId: string() }), AgentPipelineSettingsSchema.nullable()), method(_void(), array(object({
18763
18894
  nodeId: string(),
18764
18895
  settings: AgentPipelineSettingsSchema
18765
18896
  })).readonly()), method(object({
@@ -18789,7 +18920,6 @@ method(object({
18789
18920
  }), method(object({
18790
18921
  agentNodeId: string(),
18791
18922
  detect: boolean().nullable().optional(),
18792
- decode: boolean().nullable().optional(),
18793
18923
  audio: boolean().nullable().optional(),
18794
18924
  ingest: boolean().nullable().optional()
18795
18925
  }), object({ success: literal(true) }), {
@@ -18801,6 +18931,15 @@ method(object({
18801
18931
  }), object({ success: literal(true) }), {
18802
18932
  kind: "mutation",
18803
18933
  auth: "admin"
18934
+ }), method(object({ agentNodeId: string() }), object({
18935
+ success: literal(true),
18936
+ /** Hardware-aware default detection model now in effect on the node (null when unresolvable). */
18937
+ effectiveModelId: string().nullable(),
18938
+ /** Number of cameras whose node-scoped overrides were cleared. */
18939
+ clearedCameraOverrides: number()
18940
+ }), {
18941
+ kind: "mutation",
18942
+ auth: "admin"
18804
18943
  }), method(object({ deviceId: number() }), CameraPipelineSettingsSchema.nullable()), method(object({
18805
18944
  deviceId: number(),
18806
18945
  addonId: string(),
@@ -18846,6 +18985,131 @@ method(object({
18846
18985
  auth: "admin"
18847
18986
  });
18848
18987
  /**
18988
+ * server-management — per-NODE singleton capability for a node's ROOT
18989
+ * package lifecycle (runtime-updatable node packages, phase 2: hub + docker
18990
+ * agents).
18991
+ *
18992
+ * Each node's root package (`@camstack/server` on the hub, `@camstack/agent`
18993
+ * on agents) carries the whole software stack in its npm dep tree, so ONE
18994
+ * version describes the node. Updates install into
18995
+ * `<dataDir>/server-root/versions/<v>/` and apply on restart via the baked
18996
+ * starter (probation boot + auto-rollback to N-1).
18997
+ *
18998
+ * Providers:
18999
+ * - HUB: `ServerUpdateService` behind the `server-provided` mount
19000
+ * (`buildServerProviders` in trpc.router.ts) — the default target for
19001
+ * unpinned calls.
19002
+ * - AGENT: `AgentUpdateService` registered by the agent bootstrap under
19003
+ * the synthetic `agent-runtime` addonId and declared in the agent's
19004
+ * `$hub.registerNode` manifest.
19005
+ *
19006
+ * Node routing: singleton caps get the codegen/runtime-builder `nodeId`
19007
+ * injection on every method — `input.nodeId` (or `nodePin(nodeId)` from the
19008
+ * SDK) routes the call to that node's provider via the standard remote
19009
+ * proxy (`createCapabilityProxy` → `$agent-cap-fwd` → the agent's
19010
+ * in-process provider lookup). No `nodeId` → the hub's own provider.
19011
+ *
19012
+ * Spec: docs/superpowers/specs/2026-07-12-runtime-updatable-node-packages-design.md
19013
+ */
19014
+ /**
19015
+ * Where the running hub's code was loaded from:
19016
+ * - `workspace` — dev checkout (tsx / workspace dist); the starter defers to
19017
+ * plain resolution and runtime updates are refused.
19018
+ * - `baked` — the immutable image seed closure (no data-dir root active).
19019
+ * - `data-root` — the runtime-updatable `<dataDir>/server-root` closure.
19020
+ */
19021
+ var ServerBootModeSchema = _enum([
19022
+ "workspace",
19023
+ "baked",
19024
+ "data-root"
19025
+ ]);
19026
+ /**
19027
+ * Update lifecycle state:
19028
+ * - `idle` / `checking` / `staging` — steady / in-flight registry work.
19029
+ * - `pending-restart` — a version is staged and the node has NOT yet
19030
+ * restarted onto it (still running the OLD version).
19031
+ * - `awaiting-confirmation` — the node HAS restarted onto the staged version
19032
+ * (it is the active probation boot) and is waiting to confirm boot-health.
19033
+ * Apply/rollback are refused in this state and the node must NOT be
19034
+ * manually restarted, or the probation boot auto-rolls-back.
19035
+ */
19036
+ var ServerUpdateStateSchema = _enum([
19037
+ "idle",
19038
+ "checking",
19039
+ "staging",
19040
+ "pending-restart",
19041
+ "awaiting-confirmation"
19042
+ ]);
19043
+ var ServerRollbackInfoSchema = object({
19044
+ /** The version that failed (or was manually rolled back). */
19045
+ fromVersion: string(),
19046
+ /** The version rolled back to; null = the baked seed. */
19047
+ toVersion: string().nullable(),
19048
+ atMs: number(),
19049
+ reason: string()
19050
+ });
19051
+ var ServerPackageStatusSchema = object({
19052
+ /** Root package name (`@camstack/server` on the hub). */
19053
+ packageName: string(),
19054
+ /** Version of the code the running process ACTUALLY loaded. */
19055
+ runningVersion: string().nullable(),
19056
+ /** Node.js runtime version the node's process runs on (`process.versions.node`). */
19057
+ nodeRuntimeVersion: string().nullable(),
19058
+ /** Active data-dir root version; null when booted from seed/workspace. */
19059
+ activeVersion: string().nullable(),
19060
+ /** N-1 version kept for rollback; null when no previous version exists. */
19061
+ previousVersion: string().nullable(),
19062
+ /** Version of the immutable baked seed closure (image fallback). */
19063
+ seedVersion: string().nullable(),
19064
+ /** Latest registry version from the most recent check (null = never checked). */
19065
+ latestVersion: string().nullable(),
19066
+ updateAvailable: boolean(),
19067
+ bootMode: ServerBootModeSchema,
19068
+ updateState: ServerUpdateStateSchema,
19069
+ /** Version staged + awaiting its probation boot, when one is pending. */
19070
+ pendingVersion: string().nullable(),
19071
+ /** Set when the last freshly-activated version failed its boot health-check. */
19072
+ rolledBack: ServerRollbackInfoSchema.nullable(),
19073
+ /**
19074
+ * True when `server-root/state.json` EXISTS but is unreadable/corrupt — the
19075
+ * hub is running from the baked seed (or workspace) while installed data-dir
19076
+ * versions are being IGNORED. Surfaced as a warning in the UI.
19077
+ */
19078
+ stateFileCorrupt: boolean(),
19079
+ lastCheckedAtMs: number().nullable()
19080
+ });
19081
+ var ServerUpdateCheckResultSchema = object({
19082
+ packageName: string(),
19083
+ runningVersion: string().nullable(),
19084
+ latestVersion: string().nullable(),
19085
+ updateAvailable: boolean(),
19086
+ checkedAtMs: number(),
19087
+ /** Non-null when the registry lookup failed (offline, bad registry, …). */
19088
+ error: string().nullable()
19089
+ });
19090
+ var ServerUpdateActionResultSchema = object({
19091
+ accepted: boolean(),
19092
+ targetVersion: string().nullable(),
19093
+ /** True when a graceful restart was scheduled to apply the change. */
19094
+ restarting: boolean(),
19095
+ message: string()
19096
+ });
19097
+ method(_void(), ServerPackageStatusSchema, { auth: "admin" }), method(_void(), ServerUpdateCheckResultSchema, {
19098
+ kind: "mutation",
19099
+ auth: "admin"
19100
+ }), method(object({
19101
+ /** Explicit target version; omitted = latest from the registry. */
19102
+ version: string().optional() }), ServerUpdateActionResultSchema, {
19103
+ kind: "mutation",
19104
+ auth: "admin"
19105
+ }), method(_void(), ServerUpdateActionResultSchema, {
19106
+ kind: "mutation",
19107
+ auth: "admin"
19108
+ }), method(_void(), ServerUpdateActionResultSchema, {
19109
+ kind: "mutation",
19110
+ auth: "admin"
19111
+ });
19112
+ /**
18849
19113
  * Query filter for settings-store collections.
18850
19114
  */
18851
19115
  var QueryFilterSchema = object({
@@ -19067,7 +19331,20 @@ var snapshotCapability = {
19067
19331
  invalidateCache: method(object({ deviceId: number() }), _void(), {
19068
19332
  kind: "mutation",
19069
19333
  auth: "admin"
19070
- })
19334
+ }),
19335
+ /**
19336
+ * Cache-only batch overview — answers from the wrapper's in-memory cache in
19337
+ * O(n) and NEVER triggers a capture. Lets a grid skip requesting images for
19338
+ * devices that never produced a frame, and gives it an ETag per device for
19339
+ * conditional (304-able) image fetches. `lastCapturedAt`/`cacheAgeMs`/`etag`
19340
+ * are null for a device with no cached frame.
19341
+ */
19342
+ getSnapshotOverview: systemMethod(object({ deviceIds: array(number()).min(1).max(200) }), array(object({
19343
+ deviceId: number(),
19344
+ lastCapturedAt: number().nullable(),
19345
+ cacheAgeMs: number().nullable(),
19346
+ etag: string().nullable()
19347
+ })))
19071
19348
  },
19072
19349
  status: {
19073
19350
  schema: SnapshotStatusSchema,
@@ -19324,10 +19601,32 @@ method(_void(), array(TurnServerSchema).readonly());
19324
19601
  * b. `finishAuthentication({userId, response})` → server verifies
19325
19602
  * the assertion, bumps the credential counter, returns ok.
19326
19603
  *
19604
+ * 2b. Usernameless (discoverable-credential) authentication — the
19605
+ * passkey IS the primary factor, no password leg:
19606
+ * a. `beginDiscoverableAuthentication({})` → assertion options with
19607
+ * EMPTY `allowCredentials` (the browser offers every resident
19608
+ * passkey it holds for this RP) + `userVerification: 'required'`
19609
+ * (the passkey replaces both factors, so UV is mandatory).
19610
+ * The challenge is stored server-side, NOT bound to any user.
19611
+ * b. `finishDiscoverableAuthentication({response})` → the provider
19612
+ * resolves the credential by the response's credential id,
19613
+ * verifies the assertion against the stored challenge + that
19614
+ * credential's public key/counter, and returns the OWNING
19615
+ * `userId` — the caller (core auth router) mints the session.
19616
+ *
19327
19617
  * 3. Management:
19328
19618
  * - `listPasskeys({userId})` — enumerate user's enrolled credentials.
19329
19619
  * - `removePasskey({userId, credentialId})` — revoke one credential.
19330
19620
  *
19621
+ * 4. Second-factor preference (opt-in, default OFF):
19622
+ * Enrolling a passkey only enables passkey-FIRST sign-in. It is
19623
+ * demanded as a second factor after a password login ONLY when the
19624
+ * user explicitly opts in via `setSecondFactorPreference`.
19625
+ * - `getSecondFactorPreference({userId})` → `{ enabled }` (missing
19626
+ * row ⇒ `enabled: false`).
19627
+ * - `setSecondFactorPreference({userId, enabled})` — persisted by
19628
+ * the providing addon beside its credentials.
19629
+ *
19331
19630
  * Challenges are short-lived (5 min, in-memory). The cap is internal —
19332
19631
  * the admin-ui composes the begin/finish round-trip and never exposes
19333
19632
  * the cap to non-admins.
@@ -19370,6 +19669,17 @@ method(object({
19370
19669
  }), object({ verified: boolean() }), {
19371
19670
  kind: "mutation",
19372
19671
  access: "view"
19672
+ }), method(object({}), object({ optionsJSON: record(string(), unknown()) }), {
19673
+ kind: "mutation",
19674
+ access: "view"
19675
+ }), method(object({
19676
+ /** AuthenticationResponseJSON from the browser. */
19677
+ response: record(string(), unknown()) }), object({
19678
+ verified: boolean(),
19679
+ userId: string().nullable()
19680
+ }), {
19681
+ kind: "mutation",
19682
+ access: "view"
19373
19683
  }), method(object({ userId: string() }), array(PasskeySummarySchema), { auth: "admin" }), method(object({
19374
19684
  userId: string(),
19375
19685
  credentialId: string()
@@ -19377,6 +19687,13 @@ method(object({
19377
19687
  kind: "mutation",
19378
19688
  auth: "admin",
19379
19689
  access: "delete"
19690
+ }), method(object({ userId: string() }), object({ enabled: boolean() }), { auth: "admin" }), method(object({
19691
+ userId: string(),
19692
+ enabled: boolean()
19693
+ }), object({ success: literal(true) }), {
19694
+ kind: "mutation",
19695
+ auth: "admin",
19696
+ access: "create"
19380
19697
  });
19381
19698
  /**
19382
19699
  * `videoclips` — the unified, navigable-clip surface for a camera.
@@ -20178,7 +20495,17 @@ var FaceInfoSchema = object({
20178
20495
  recognizedIdentityId: string().optional(),
20179
20496
  identityName: string().optional(),
20180
20497
  assigned: boolean(),
20181
- base64: string().optional()
20498
+ base64: string().optional(),
20499
+ /** Design B: the face bbox (pixel space) on the key frame — lets a detail
20500
+ * view draw the box over the native `keyFrameMediaKey` frame. Absent on
20501
+ * legacy rows written before design B. */
20502
+ faceBbox: BoundingBoxSchema.optional(),
20503
+ /** Design B: MediaStore key of the track's native-resolution key frame.
20504
+ * Fetch the native JPEG via the event-media data-plane
20505
+ * (`/addon/<addonId>/event-media/<keyFrameMediaKey>`). Absent when the
20506
+ * track produced no key frame (e.g. native/onboard source) — the UI falls
20507
+ * back to the inline `base64` face crop. */
20508
+ keyFrameMediaKey: string().optional()
20182
20509
  });
20183
20510
  var FaceFilterEnum = _enum([
20184
20511
  "unassigned",
@@ -20926,6 +21253,16 @@ var TopologyCategorySchema = object({
20926
21253
  healthy: number(),
20927
21254
  addons: array(TopologyCategoryAddonSchema).readonly()
20928
21255
  });
21256
+ /**
21257
+ * The node's runtime-updatable ROOT package (`@camstack/server` on the hub,
21258
+ * `@camstack/agent` on agents) as reported by its `registerNode` manifest —
21259
+ * version visibility for the Server management surface. Nullable: offline
21260
+ * rows and pre-phase-2 nodes report none.
21261
+ */
21262
+ var TopologyRootPackageSchema = object({
21263
+ name: string(),
21264
+ version: string()
21265
+ });
20929
21266
  var TopologyNodeSchema = object({
20930
21267
  id: string(),
20931
21268
  name: string(),
@@ -20949,7 +21286,8 @@ var TopologyNodeSchema = object({
20949
21286
  status: string()
20950
21287
  })).readonly(),
20951
21288
  processes: array(TopologyProcessSchema).readonly(),
20952
- categories: array(TopologyCategorySchema).readonly()
21289
+ categories: array(TopologyCategorySchema).readonly(),
21290
+ rootPackage: TopologyRootPackageSchema.nullable()
20953
21291
  });
20954
21292
  var CapUsageEdgeSchema = object({
20955
21293
  callerAddonId: string(),
@@ -24073,6 +24411,12 @@ Object.freeze({
24073
24411
  addonId: null,
24074
24412
  access: "create"
24075
24413
  },
24414
+ "loginMethod.getLoginMethods": {
24415
+ capName: "login-method",
24416
+ capScope: "system",
24417
+ addonId: null,
24418
+ access: "view"
24419
+ },
24076
24420
  "mediaPlayer.next": {
24077
24421
  capName: "media-player",
24078
24422
  capScope: "device",
@@ -24655,6 +24999,12 @@ Object.freeze({
24655
24999
  addonId: null,
24656
25000
  access: "view"
24657
25001
  },
25002
+ "pipelineAnalytics.getKeyEvents": {
25003
+ capName: "pipeline-analytics",
25004
+ capScope: "device",
25005
+ addonId: null,
25006
+ access: "view"
25007
+ },
24658
25008
  "pipelineAnalytics.getMotionEvents": {
24659
25009
  capName: "pipeline-analytics",
24660
25010
  capScope: "device",
@@ -24703,23 +25053,23 @@ Object.freeze({
24703
25053
  addonId: null,
24704
25054
  access: "create"
24705
25055
  },
24706
- "pipelineExecutor.deleteModel": {
25056
+ "pipelineExecutor.clearDeviceOverrides": {
24707
25057
  capName: "pipeline-executor",
24708
25058
  capScope: "system",
24709
25059
  addonId: null,
24710
25060
  access: "delete"
24711
25061
  },
24712
- "pipelineExecutor.deleteTemplate": {
25062
+ "pipelineExecutor.deleteModel": {
24713
25063
  capName: "pipeline-executor",
24714
25064
  capScope: "system",
24715
25065
  addonId: null,
24716
25066
  access: "delete"
24717
25067
  },
24718
- "pipelineExecutor.detect": {
25068
+ "pipelineExecutor.deleteTemplate": {
24719
25069
  capName: "pipeline-executor",
24720
25070
  capScope: "system",
24721
25071
  addonId: null,
24722
- access: "view"
25072
+ access: "delete"
24723
25073
  },
24724
25074
  "pipelineExecutor.downloadModel": {
24725
25075
  capName: "pipeline-executor",
@@ -24865,12 +25215,6 @@ Object.freeze({
24865
25215
  addonId: null,
24866
25216
  access: "create"
24867
25217
  },
24868
- "pipelineExecutor.resetToDefault": {
24869
- capName: "pipeline-executor",
24870
- capScope: "system",
24871
- addonId: null,
24872
- access: "delete"
24873
- },
24874
25218
  "pipelineExecutor.runAudioTest": {
24875
25219
  capName: "pipeline-executor",
24876
25220
  capScope: "system",
@@ -24931,12 +25275,6 @@ Object.freeze({
24931
25275
  addonId: null,
24932
25276
  access: "create"
24933
25277
  },
24934
- "pipelineOrchestrator.assignDecoder": {
24935
- capName: "pipeline-orchestrator",
24936
- capScope: "system",
24937
- addonId: null,
24938
- access: "create"
24939
- },
24940
25278
  "pipelineOrchestrator.assignPipeline": {
24941
25279
  capName: "pipeline-orchestrator",
24942
25280
  capScope: "system",
@@ -25015,18 +25353,6 @@ Object.freeze({
25015
25353
  addonId: null,
25016
25354
  access: "view"
25017
25355
  },
25018
- "pipelineOrchestrator.getDecoderAssignment": {
25019
- capName: "pipeline-orchestrator",
25020
- capScope: "system",
25021
- addonId: null,
25022
- access: "view"
25023
- },
25024
- "pipelineOrchestrator.getDecoderAssignments": {
25025
- capName: "pipeline-orchestrator",
25026
- capScope: "system",
25027
- addonId: null,
25028
- access: "view"
25029
- },
25030
25356
  "pipelineOrchestrator.getGlobalMetrics": {
25031
25357
  capName: "pipeline-orchestrator",
25032
25358
  capScope: "system",
@@ -25075,6 +25401,12 @@ Object.freeze({
25075
25401
  addonId: null,
25076
25402
  access: "delete"
25077
25403
  },
25404
+ "pipelineOrchestrator.resetNodePipelineDefaults": {
25405
+ capName: "pipeline-orchestrator",
25406
+ capScope: "system",
25407
+ addonId: null,
25408
+ access: "delete"
25409
+ },
25078
25410
  "pipelineOrchestrator.resolvePipeline": {
25079
25411
  capName: "pipeline-orchestrator",
25080
25412
  capScope: "system",
@@ -25147,12 +25479,6 @@ Object.freeze({
25147
25479
  addonId: null,
25148
25480
  access: "create"
25149
25481
  },
25150
- "pipelineOrchestrator.unassignDecoder": {
25151
- capName: "pipeline-orchestrator",
25152
- capScope: "system",
25153
- addonId: null,
25154
- access: "create"
25155
- },
25156
25482
  "pipelineOrchestrator.unassignPipeline": {
25157
25483
  capName: "pipeline-orchestrator",
25158
25484
  capScope: "system",
@@ -25207,6 +25533,12 @@ Object.freeze({
25207
25533
  addonId: null,
25208
25534
  access: "view"
25209
25535
  },
25536
+ "pipelineRunner.getNativeCrop": {
25537
+ capName: "pipeline-runner",
25538
+ capScope: "system",
25539
+ addonId: null,
25540
+ access: "view"
25541
+ },
25210
25542
  "pipelineRunner.reportMotion": {
25211
25543
  capName: "pipeline-runner",
25212
25544
  capScope: "system",
@@ -25459,6 +25791,36 @@ Object.freeze({
25459
25791
  addonId: null,
25460
25792
  access: "create"
25461
25793
  },
25794
+ "serverManagement.applyServerUpdate": {
25795
+ capName: "server-management",
25796
+ capScope: "system",
25797
+ addonId: null,
25798
+ access: "create"
25799
+ },
25800
+ "serverManagement.checkServerUpdate": {
25801
+ capName: "server-management",
25802
+ capScope: "system",
25803
+ addonId: null,
25804
+ access: "create"
25805
+ },
25806
+ "serverManagement.getServerPackageStatus": {
25807
+ capName: "server-management",
25808
+ capScope: "system",
25809
+ addonId: null,
25810
+ access: "view"
25811
+ },
25812
+ "serverManagement.restartServer": {
25813
+ capName: "server-management",
25814
+ capScope: "system",
25815
+ addonId: null,
25816
+ access: "create"
25817
+ },
25818
+ "serverManagement.rollbackServerUpdate": {
25819
+ capName: "server-management",
25820
+ capScope: "system",
25821
+ addonId: null,
25822
+ access: "create"
25823
+ },
25462
25824
  "settingsStore.count": {
25463
25825
  capName: "settings-store",
25464
25826
  capScope: "system",
@@ -25543,6 +25905,12 @@ Object.freeze({
25543
25905
  addonId: null,
25544
25906
  access: "view"
25545
25907
  },
25908
+ "snapshot.getSnapshotOverview": {
25909
+ capName: "snapshot",
25910
+ capScope: "device",
25911
+ addonId: null,
25912
+ access: "view"
25913
+ },
25546
25914
  "snapshot.invalidateCache": {
25547
25915
  capName: "snapshot",
25548
25916
  capScope: "device",
@@ -26221,6 +26589,12 @@ Object.freeze({
26221
26589
  addonId: null,
26222
26590
  access: "view"
26223
26591
  },
26592
+ "userPasskeys.beginDiscoverableAuthentication": {
26593
+ capName: "user-passkeys",
26594
+ capScope: "system",
26595
+ addonId: null,
26596
+ access: "view"
26597
+ },
26224
26598
  "userPasskeys.beginRegistration": {
26225
26599
  capName: "user-passkeys",
26226
26600
  capScope: "system",
@@ -26233,12 +26607,24 @@ Object.freeze({
26233
26607
  addonId: null,
26234
26608
  access: "view"
26235
26609
  },
26610
+ "userPasskeys.finishDiscoverableAuthentication": {
26611
+ capName: "user-passkeys",
26612
+ capScope: "system",
26613
+ addonId: null,
26614
+ access: "view"
26615
+ },
26236
26616
  "userPasskeys.finishRegistration": {
26237
26617
  capName: "user-passkeys",
26238
26618
  capScope: "system",
26239
26619
  addonId: null,
26240
26620
  access: "create"
26241
26621
  },
26622
+ "userPasskeys.getSecondFactorPreference": {
26623
+ capName: "user-passkeys",
26624
+ capScope: "system",
26625
+ addonId: null,
26626
+ access: "view"
26627
+ },
26242
26628
  "userPasskeys.listPasskeys": {
26243
26629
  capName: "user-passkeys",
26244
26630
  capScope: "system",
@@ -26251,6 +26637,12 @@ Object.freeze({
26251
26637
  addonId: null,
26252
26638
  access: "delete"
26253
26639
  },
26640
+ "userPasskeys.setSecondFactorPreference": {
26641
+ capName: "user-passkeys",
26642
+ capScope: "system",
26643
+ addonId: null,
26644
+ access: "create"
26645
+ },
26254
26646
  "vacuumControl.locate": {
26255
26647
  capName: "vacuum-control",
26256
26648
  capScope: "device",
@@ -26323,6 +26715,18 @@ Object.freeze({
26323
26715
  addonId: null,
26324
26716
  access: "view"
26325
26717
  },
26718
+ "viewerUi.getStaticDir": {
26719
+ capName: "viewer-ui",
26720
+ capScope: "system",
26721
+ addonId: null,
26722
+ access: "view"
26723
+ },
26724
+ "viewerUi.getVersion": {
26725
+ capName: "viewer-ui",
26726
+ capScope: "system",
26727
+ addonId: null,
26728
+ access: "view"
26729
+ },
26326
26730
  "waterHeater.setAway": {
26327
26731
  capName: "water-heater",
26328
26732
  capScope: "device",