@camstack/addon-provider-amcrest 0.1.6 → 0.1.8

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.js CHANGED
@@ -4633,7 +4633,7 @@ function _instanceof(cls, params = {}) {
4633
4633
  return inst;
4634
4634
  }
4635
4635
  //#endregion
4636
- //#region ../types/dist/sleep-Cc14_yxc.mjs
4636
+ //#region ../types/dist/sleep-BC9Yqte7.mjs
4637
4637
  var EventCategory = /* @__PURE__ */ function(EventCategory) {
4638
4638
  EventCategory["SystemBoot"] = "system.boot";
4639
4639
  EventCategory["SystemAddonsReady"] = "system.addons-ready";
@@ -5354,10 +5354,6 @@ function hydrateField(field, values) {
5354
5354
  };
5355
5355
  }
5356
5356
  const rawValue = storedValue !== void 0 ? storedValue : defaultValue !== void 0 ? defaultValue : null;
5357
- if (field.type === "password") return {
5358
- ...field,
5359
- value: ""
5360
- };
5361
5357
  const value = field.type === "textarea" && field.isJson && rawValue !== null && typeof rawValue === "object" ? JSON.stringify(rawValue, null, 2) : rawValue;
5362
5358
  return {
5363
5359
  ...field,
@@ -6741,10 +6737,25 @@ function method(input, output, options) {
6741
6737
  timeoutMs: options?.timeoutMs
6742
6738
  };
6743
6739
  }
6740
+ /**
6741
+ * A wrapper/system-only method: served exclusively by the cap's system-level
6742
+ * provider (`InferProvider`), and OPTIONAL on `InferNativeProvider` so per-device
6743
+ * driver natives don't stub out a wrapper concern (e.g. a cross-device cache
6744
+ * overview). The `systemOnly: true` literal is what `InferNativeProvider` keys on.
6745
+ */
6746
+ function systemMethod(input, output, options) {
6747
+ return {
6748
+ ...method(input, output, options),
6749
+ systemOnly: true
6750
+ };
6751
+ }
6744
6752
  /** Shorthand to define an event schema */
6745
6753
  function event(data) {
6746
6754
  return { data };
6747
6755
  }
6756
+ var StaticDirOutputSchema$1 = object({ staticDir: string() });
6757
+ var VersionOutputSchema$1 = object({ version: string() });
6758
+ method(_void(), StaticDirOutputSchema$1), method(_void(), VersionOutputSchema$1);
6748
6759
  var StaticDirOutputSchema = object({ staticDir: string() });
6749
6760
  var VersionOutputSchema = object({ version: string() });
6750
6761
  method(_void(), StaticDirOutputSchema), method(_void(), VersionOutputSchema);
@@ -11656,7 +11667,7 @@ var BoundingBoxSchema = object({
11656
11667
  w: number(),
11657
11668
  h: number()
11658
11669
  });
11659
- var SpatialDetectionSchema = object({
11670
+ object({
11660
11671
  class: string(),
11661
11672
  originalClass: string(),
11662
11673
  score: number(),
@@ -11831,6 +11842,7 @@ var PipelineAddonSchemaSchema = object({
11831
11842
  defaultModelId: string(),
11832
11843
  defaultModelIdByFormat: record(string(), string()).optional(),
11833
11844
  enabledByDefault: boolean().optional(),
11845
+ backfillIntoExistingOverrides: boolean().optional(),
11834
11846
  defaultConfidence: number(),
11835
11847
  group: string().optional(),
11836
11848
  configSchema: array(ConfigFieldBridge).readonly().optional()
@@ -11847,11 +11859,6 @@ var PipelineSchemaSchema = object({
11847
11859
  selectedEngine: PipelineEngineChoiceSchema,
11848
11860
  slots: array(PipelineSlotSchemaSchema).readonly()
11849
11861
  });
11850
- var DetectorOutputSchema = object({
11851
- detections: array(SpatialDetectionSchema).readonly(),
11852
- inferenceMs: number(),
11853
- modelId: string()
11854
- });
11855
11862
  var EngineProvisioningSchema = object({
11856
11863
  runtimeId: _enum([
11857
11864
  "onnx",
@@ -11976,7 +11983,7 @@ method(_void(), array(PipelineEngineChoiceSchema)), method(_void(), PipelineEngi
11976
11983
  auth: "admin"
11977
11984
  }), method(object({ nodeId: string() }), object({
11978
11985
  success: literal(true),
11979
- regeneratedModelId: string().nullable()
11986
+ clearedDevices: number()
11980
11987
  }), {
11981
11988
  kind: "mutation",
11982
11989
  auth: "admin"
@@ -11997,10 +12004,6 @@ method(_void(), array(PipelineEngineChoiceSchema)), method(_void(), PipelineEngi
11997
12004
  modelId: string(),
11998
12005
  format: ModelFormatSchema$1
11999
12006
  }), object({ success: literal(true) }), { kind: "mutation" }), method(object({
12000
- addonId: string(),
12001
- frame: FrameInputSchema,
12002
- config: record(string(), unknown()).optional()
12003
- }), DetectorOutputSchema), method(object({
12004
12007
  engine: PipelineEngineChoiceSchema.optional(),
12005
12008
  steps: array(PipelineStepInputSchema).min(1),
12006
12009
  frame: FrameInputSchema.optional(),
@@ -12179,6 +12182,25 @@ var zonesCapability = {
12179
12182
  runtimeState: object({ zones: array(ZoneSchema).readonly() })
12180
12183
  };
12181
12184
  /**
12185
+ * A bounding box in NORMALIZED [0,1] frame coordinates for `getNativeCrop`. The
12186
+ * decode worker resolves it against the RETAINED native frame's real pixel dims,
12187
+ * so the caller supplies only the detection-res bbox divided by the detection
12188
+ * dims — no native resolution to plumb.
12189
+ */
12190
+ var NativeCropBboxSchema = object({
12191
+ x: number(),
12192
+ y: number(),
12193
+ w: number(),
12194
+ h: number()
12195
+ });
12196
+ /** Result of a best-effort native-resolution crop (`getNativeCrop`). */
12197
+ var NativeCropResultSchema = object({
12198
+ /** Packed rgb (24-bit) pixels of the crop. */
12199
+ bytes: _instanceof(Uint8Array),
12200
+ width: number().int().positive(),
12201
+ height: number().int().positive()
12202
+ });
12203
+ /**
12182
12204
  * Per-camera tunable ranges + defaults. Single source of truth used
12183
12205
  * by both the Zod data schema (validation + default fallback) and
12184
12206
  * the device settings UI (slider min/max/step). Touch one place and
@@ -12434,7 +12456,11 @@ var RunnerLocalMetricsSchema = object({
12434
12456
  avgInferenceTimeMs: number(),
12435
12457
  queueDepth: number()
12436
12458
  });
12437
- 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());
12459
+ 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({
12460
+ handle: FrameHandleSchema,
12461
+ bbox: NativeCropBboxSchema,
12462
+ maxWidth: number().int().positive().optional()
12463
+ }), NativeCropResultSchema.nullable());
12438
12464
  /**
12439
12465
  * Hardware / firmware motion sensor cap — binary detected state plus
12440
12466
  * a timestamp of the last observation. Distinct from
@@ -15365,7 +15391,9 @@ var AddonPageDeclarationSchema$1 = object({
15365
15391
  icon: string(),
15366
15392
  path: string(),
15367
15393
  remoteName: string(),
15368
- bundle: string()
15394
+ bundle: string(),
15395
+ section: string().optional(),
15396
+ sectionLabel: string().optional()
15369
15397
  });
15370
15398
  var AddonPageInfoSchema = object({
15371
15399
  addonId: string(),
@@ -15405,7 +15433,18 @@ var AddonPageDeclarationSchema = object({
15405
15433
  * the static-file route can compute an mtime-based cache-buster URL
15406
15434
  * without a separate filesystem stat.
15407
15435
  */
15408
- bundle: string()
15436
+ bundle: string(),
15437
+ /**
15438
+ * Sidebar section this page docks into. Well-known ids: `'detection'`,
15439
+ * `'cluster'`, `'administration'` — the page renders inside that group.
15440
+ * Any OTHER string creates (or joins) a custom section rendered after
15441
+ * the built-in groups; its label comes from `sectionLabel` (first
15442
+ * declaration wins), falling back to the id. Absent → the legacy
15443
+ * "Addon Pages" group.
15444
+ */
15445
+ section: string().optional(),
15446
+ /** Display label for a CUSTOM `section` id (ignored for well-known ids). */
15447
+ sectionLabel: string().optional()
15409
15448
  });
15410
15449
  method(_void(), array(AddonPageDeclarationSchema).readonly());
15411
15450
  var AddonHttpRouteSchema = object({
@@ -15621,6 +15660,17 @@ var WidgetMetadataSchema = object({
15621
15660
  deviceContext: boolean().default(false),
15622
15661
  integrationContext: boolean().default(false)
15623
15662
  }),
15663
+ /**
15664
+ * Loadable BEFORE authentication. The normal widget registry listing
15665
+ * (`addon-widgets.listWidgets`) is auth-gated, so a pre-auth surface
15666
+ * (the login page) cannot discover a widget through it. A widget that
15667
+ * declares `preAuth: true` marks itself as safe to mount on a pre-auth
15668
+ * screen — it is surfaced through the PUBLIC `auth.listLoginMethods`
15669
+ * login-method contribution channel (see `login-method.cap.ts`) rather
15670
+ * than the authenticated registry, and its bundle is served by the
15671
+ * public `/api/addon-widgets/:addonId/*` static route. Defaults false.
15672
+ */
15673
+ preAuth: boolean().optional().default(false),
15624
15674
  /** Dashboard placement HINTS (operator can override per instance). */
15625
15675
  defaultSize: WidgetSizeEnum.default("md"),
15626
15676
  allowedSizes: array(WidgetSizeEnum).readonly().default([
@@ -15922,6 +15972,66 @@ method(object({
15922
15972
  password: string()
15923
15973
  }), AuthResultSchema.nullable(), { kind: "mutation" }), method(object({ state: string() }), string()), method(record(string(), string()), AuthResultSchema, { kind: "mutation" }), method(object({ token: string() }), AuthResultSchema.nullable());
15924
15974
  /**
15975
+ * `login-method` — collection cap through which auth addons contribute
15976
+ * their pre-auth login surfaces to the login page. This is the SINGLE,
15977
+ * generic mechanism that supersedes the dead `auth.listProviders` reader:
15978
+ * every auth addon (OIDC, magic-link, WebAuthn/passkey) registers a
15979
+ * `login-method` provider and the PUBLIC `auth.listLoginMethods`
15980
+ * procedure aggregates them for the unauthenticated login page.
15981
+ *
15982
+ * A contribution is a discriminated union on `kind`:
15983
+ *
15984
+ * - `redirect` — a declarative button. The login page renders a generic
15985
+ * button that navigates to `startUrl` (an addon-owned HTTP route).
15986
+ * Covers OIDC (`/addon/auth-oidc/<id>/start`) and magic-link with
15987
+ * ZERO shell-side JS. A future SSO addon plugs in the same way — the
15988
+ * login page needs NO change.
15989
+ *
15990
+ * - `widget` — a Module-Federation widget the login page mounts (via
15991
+ * `loadRemoteBundle`) for an in-page ceremony. Covers the passkey
15992
+ * login ceremony, which must run `@simplewebauthn/browser` INSIDE the
15993
+ * addon bundle. The referenced widget also declares `preAuth: true` in
15994
+ * its `addon-widgets-source` catalog entry. `auth.listLoginMethods`
15995
+ * stamps a public `bundleUrl` from `addonId` + `bundle`.
15996
+ *
15997
+ * Every contribution carries a `stage`:
15998
+ * - `primary` — shown on the first credentials screen (OIDC /
15999
+ * magic-link buttons; a future usernameless passkey).
16000
+ * - `second-factor` — shown AFTER the password leg, gated on the
16001
+ * returned `factors` (passkey-as-2FA today).
16002
+ *
16003
+ * `mount: skip` — the cap is read server-side by the core auth router
16004
+ * (`registry.getCollection('login-method')`), never mounted as its own
16005
+ * tRPC router.
16006
+ */
16007
+ /** When a login method renders in the two-phase login flow. */
16008
+ var LoginStageEnum = _enum(["primary", "second-factor"]);
16009
+ /** One login-method contribution — redirect button OR pre-auth widget. */
16010
+ var LoginMethodContributionSchema = discriminatedUnion("kind", [object({
16011
+ kind: literal("redirect"),
16012
+ /** Stable id within the login-method set (e.g. `auth-oidc/google`). */
16013
+ id: string(),
16014
+ /** Operator-facing button label. */
16015
+ label: string(),
16016
+ /** lucide-react icon name. */
16017
+ icon: string().optional(),
16018
+ /** Addon-owned HTTP route the button navigates to (GET). */
16019
+ startUrl: string(),
16020
+ stage: LoginStageEnum
16021
+ }), object({
16022
+ kind: literal("widget"),
16023
+ /** Stable id within the login-method set (e.g. `auth-webauthn/passkey-login`). */
16024
+ id: string(),
16025
+ /** Owning addon id — drives the public bundle URL + the MF namespace. */
16026
+ addonId: string(),
16027
+ /** Bundle filename inside the addon's dist dir (`remoteEntry.js`). */
16028
+ bundle: string(),
16029
+ /** MF remote descriptor — `{ remoteName, exposedModule, componentKey }`. */
16030
+ remote: WidgetRemoteSchema,
16031
+ stage: LoginStageEnum
16032
+ })]);
16033
+ method(_void(), array(LoginMethodContributionSchema).readonly());
16034
+ /**
15925
16035
  * Orchestrator-side destination metadata. The orchestrator computes
15926
16036
  * `id = <addonId>:<subId>` from its provider lookup so consumers
15927
16037
  * (admin UI, restore flow) see one canonical key.
@@ -18025,7 +18135,17 @@ var TrackSchema = object({
18025
18135
  /** Cumulative normalized distance travelled (0..1 units = full frame width). */
18026
18136
  totalDistance: number(),
18027
18137
  state: TrackStateSchema,
18028
- active: boolean()
18138
+ active: boolean(),
18139
+ /** Deterministic key-event importance score in [0,1] (server-computed at
18140
+ * track expiry, recomputed on late label). Absent on legacy rows written
18141
+ * before scoring shipped — consumers degrade to absence / compute-on-read. */
18142
+ importance: number().optional(),
18143
+ /** Id of the track's highest-confidence ObjectEvent (its representative
18144
+ * "best" frame). Absent when the track produced no object events. */
18145
+ bestEventId: string().optional(),
18146
+ /** Tag of the importance sub-signal that dominated the score
18147
+ * (identity|dwell|proximity|class|confidence|travel|zone). */
18148
+ importanceReason: string().optional()
18029
18149
  });
18030
18150
  var BaseEventFields = {
18031
18151
  id: string(),
@@ -18090,8 +18210,18 @@ var ObjectEventSchema = object({
18090
18210
  frameHeight: number().optional(),
18091
18211
  /** MediaStore key for the crop attached to this event (if any). */
18092
18212
  mediaKey: string().optional(),
18213
+ /** Design B: MediaStore key of the track's native-resolution key frame (the
18214
+ * best-detection full frame). Resolve via the event-media data-plane
18215
+ * (`/addon/<addonId>/event-media/<keyFrameMediaKey>`) for a detail view that
18216
+ * draws `bbox` over the native frame. Absent on legacy rows / non-decoded
18217
+ * sources — consumers fall back to `mediaKey` (the tight crop). */
18218
+ keyFrameMediaKey: string().optional(),
18093
18219
  /** Populated by B5 (recording playback URL for this event). */
18094
- mediaUrl: string().optional()
18220
+ mediaUrl: string().optional(),
18221
+ /** The parent track's key-event importance [0,1], propagated to every object
18222
+ * event of the track (so an event row can be sorted by importance without a
18223
+ * track join). Absent on legacy rows / before the track was scored. */
18224
+ importance: number().optional()
18095
18225
  });
18096
18226
  var AudioEventSchema = object({
18097
18227
  ...BaseEventFields,
@@ -18115,7 +18245,8 @@ var MediaFileKindEnum = _enum([
18115
18245
  "fullFrame",
18116
18246
  "fullFrameBoxed",
18117
18247
  "faceCrop",
18118
- "plateCrop"
18248
+ "plateCrop",
18249
+ "keyFrame"
18119
18250
  ]);
18120
18251
  var MediaFileSchema = object({
18121
18252
  key: string(),
@@ -18136,6 +18267,32 @@ var DeviceEventQueryInput = object({
18136
18267
  projection: _enum(["full", "slim"]).optional()
18137
18268
  });
18138
18269
  var ObjectEventQueryInput = DeviceEventQueryInput.extend({ classFilter: string().optional() });
18270
+ var KeyEventQueryInput = object({
18271
+ deviceId: number(),
18272
+ /** Window lower bound (track firstSeen ≥ since). */
18273
+ since: number(),
18274
+ /** Window upper bound (track firstSeen ≤ until). */
18275
+ until: number(),
18276
+ limit: number().int().min(1).max(200).default(50),
18277
+ /** Drop tracks scoring below this importance. */
18278
+ minImportance: number().min(0).max(1).optional(),
18279
+ /** Restrict to a single class (e.g. 'person'). */
18280
+ classFilter: string().optional()
18281
+ });
18282
+ var KeyEventSchema = object({
18283
+ /** The representative event id (the track's best ObjectEvent, else its trackId). */
18284
+ id: string(),
18285
+ trackId: string(),
18286
+ /** Track start time (firstSeen). */
18287
+ timestamp: number(),
18288
+ className: string(),
18289
+ label: string().optional(),
18290
+ importance: number(),
18291
+ /** Highest-confidence ObjectEvent id for the track (empty when none). */
18292
+ bestEventId: string(),
18293
+ /** Track lifetime in ms (lastSeen - firstSeen). */
18294
+ windowMs: number().optional()
18295
+ });
18139
18296
  var TrackedDetectionSchema = object({
18140
18297
  trackId: string(),
18141
18298
  className: string(),
@@ -18165,7 +18322,7 @@ DeviceType.Camera, method(object({ deviceId: number() }), array(TrackSchema).rea
18165
18322
  }), array(TrackSchema).readonly()), method(object({ deviceId: number() }), _void(), {
18166
18323
  kind: "mutation",
18167
18324
  auth: "admin"
18168
- }), method(DeviceEventQueryInput, array(MotionEventSchema).readonly()), method(ObjectEventQueryInput, array(ObjectEventSchema).readonly()), method(DeviceEventQueryInput, array(AudioEventSchema).readonly()), method(object({
18325
+ }), method(DeviceEventQueryInput, array(MotionEventSchema).readonly()), method(ObjectEventQueryInput, array(ObjectEventSchema).readonly()), method(DeviceEventQueryInput, array(AudioEventSchema).readonly()), method(KeyEventQueryInput, array(KeyEventSchema).readonly()), method(object({
18169
18326
  deviceId: number(),
18170
18327
  since: number(),
18171
18328
  until: number(),
@@ -18239,7 +18396,12 @@ var AgentPipelineSettingsSchema = object({
18239
18396
  detectWeight: number().positive().optional(),
18240
18397
  /** Node is eligible to run the detection pipeline (decode + inference). */
18241
18398
  detect: boolean().optional(),
18242
- /** Node is eligible to host decoder sessions. */
18399
+ /**
18400
+ * DEPRECATED AND IGNORED. Decode is always co-located with its frame
18401
+ * consumer, so decode eligibility IS detect eligibility. Kept optional in
18402
+ * the schema ONLY so persisted stores written before the removal still
18403
+ * parse — no code reads it and no write path emits it.
18404
+ */
18243
18405
  decode: boolean().optional(),
18244
18406
  /** Node is eligible to run audio-analyzer sessions. */
18245
18407
  audio: boolean().optional(),
@@ -18300,25 +18462,6 @@ var PipelineAssignmentSchema = object({
18300
18462
  assignedAt: number()
18301
18463
  });
18302
18464
  /**
18303
- * Decoder placement record. Symmetric to `PipelineAssignmentSchema` but for
18304
- * the decoder-node placement domain (`balanceDecoder` decision: manual pin
18305
- * → co-located with pipeline → capacity).
18306
- */
18307
- var DecoderAssignmentSchema = object({
18308
- deviceId: number(),
18309
- /** Moleculer node id of the decoder provider currently responsible for this camera. */
18310
- decoderNodeId: string(),
18311
- /** True when the assignment was set manually via `assignDecoder`, false when chosen by the balancer. */
18312
- pinned: boolean(),
18313
- /** Why this assignment was made — useful for debugging the decoder balancer. */
18314
- reason: _enum([
18315
- "manual",
18316
- "co-located",
18317
- "capacity",
18318
- "hardware-affinity"
18319
- ])
18320
- });
18321
- /**
18322
18465
  * Per-agent load summary surfaced to the load balancer + dashboards.
18323
18466
  * Aggregated from each runner's `getLocalLoad` cap call.
18324
18467
  */
@@ -18524,15 +18667,6 @@ method(object({
18524
18667
  }), method(_void(), IngestOwnerSchema), method(object({
18525
18668
  deviceId: number(),
18526
18669
  nodeId: string()
18527
- }), _void(), {
18528
- kind: "mutation",
18529
- auth: "admin"
18530
- }), method(object({ deviceId: number() }), _void(), {
18531
- kind: "mutation",
18532
- auth: "admin"
18533
- }), method(_void(), array(DecoderAssignmentSchema).readonly()), method(object({
18534
- deviceId: number(),
18535
- nodeId: string()
18536
18670
  }), object({ success: literal(true) }), {
18537
18671
  kind: "mutation",
18538
18672
  auth: "admin"
@@ -18551,10 +18685,7 @@ method(object({
18551
18685
  nodeId: string(),
18552
18686
  pinned: boolean(),
18553
18687
  assignedAt: number()
18554
- }))), method(object({
18555
- deviceId: number(),
18556
- pipelineNodeId: string().optional()
18557
- }), DecoderAssignmentSchema), method(object({ agentNodeId: string() }), AgentPipelineSettingsSchema.nullable()), method(_void(), array(object({
18688
+ }))), method(object({ agentNodeId: string() }), AgentPipelineSettingsSchema.nullable()), method(_void(), array(object({
18558
18689
  nodeId: string(),
18559
18690
  settings: AgentPipelineSettingsSchema
18560
18691
  })).readonly()), method(object({
@@ -18584,7 +18715,6 @@ method(object({
18584
18715
  }), method(object({
18585
18716
  agentNodeId: string(),
18586
18717
  detect: boolean().nullable().optional(),
18587
- decode: boolean().nullable().optional(),
18588
18718
  audio: boolean().nullable().optional(),
18589
18719
  ingest: boolean().nullable().optional()
18590
18720
  }), object({ success: literal(true) }), {
@@ -18596,6 +18726,15 @@ method(object({
18596
18726
  }), object({ success: literal(true) }), {
18597
18727
  kind: "mutation",
18598
18728
  auth: "admin"
18729
+ }), method(object({ agentNodeId: string() }), object({
18730
+ success: literal(true),
18731
+ /** Hardware-aware default detection model now in effect on the node (null when unresolvable). */
18732
+ effectiveModelId: string().nullable(),
18733
+ /** Number of cameras whose node-scoped overrides were cleared. */
18734
+ clearedCameraOverrides: number()
18735
+ }), {
18736
+ kind: "mutation",
18737
+ auth: "admin"
18599
18738
  }), method(object({ deviceId: number() }), CameraPipelineSettingsSchema.nullable()), method(object({
18600
18739
  deviceId: number(),
18601
18740
  addonId: string(),
@@ -18641,6 +18780,131 @@ method(object({
18641
18780
  auth: "admin"
18642
18781
  });
18643
18782
  /**
18783
+ * server-management — per-NODE singleton capability for a node's ROOT
18784
+ * package lifecycle (runtime-updatable node packages, phase 2: hub + docker
18785
+ * agents).
18786
+ *
18787
+ * Each node's root package (`@camstack/server` on the hub, `@camstack/agent`
18788
+ * on agents) carries the whole software stack in its npm dep tree, so ONE
18789
+ * version describes the node. Updates install into
18790
+ * `<dataDir>/server-root/versions/<v>/` and apply on restart via the baked
18791
+ * starter (probation boot + auto-rollback to N-1).
18792
+ *
18793
+ * Providers:
18794
+ * - HUB: `ServerUpdateService` behind the `server-provided` mount
18795
+ * (`buildServerProviders` in trpc.router.ts) — the default target for
18796
+ * unpinned calls.
18797
+ * - AGENT: `AgentUpdateService` registered by the agent bootstrap under
18798
+ * the synthetic `agent-runtime` addonId and declared in the agent's
18799
+ * `$hub.registerNode` manifest.
18800
+ *
18801
+ * Node routing: singleton caps get the codegen/runtime-builder `nodeId`
18802
+ * injection on every method — `input.nodeId` (or `nodePin(nodeId)` from the
18803
+ * SDK) routes the call to that node's provider via the standard remote
18804
+ * proxy (`createCapabilityProxy` → `$agent-cap-fwd` → the agent's
18805
+ * in-process provider lookup). No `nodeId` → the hub's own provider.
18806
+ *
18807
+ * Spec: docs/superpowers/specs/2026-07-12-runtime-updatable-node-packages-design.md
18808
+ */
18809
+ /**
18810
+ * Where the running hub's code was loaded from:
18811
+ * - `workspace` — dev checkout (tsx / workspace dist); the starter defers to
18812
+ * plain resolution and runtime updates are refused.
18813
+ * - `baked` — the immutable image seed closure (no data-dir root active).
18814
+ * - `data-root` — the runtime-updatable `<dataDir>/server-root` closure.
18815
+ */
18816
+ var ServerBootModeSchema = _enum([
18817
+ "workspace",
18818
+ "baked",
18819
+ "data-root"
18820
+ ]);
18821
+ /**
18822
+ * Update lifecycle state:
18823
+ * - `idle` / `checking` / `staging` — steady / in-flight registry work.
18824
+ * - `pending-restart` — a version is staged and the node has NOT yet
18825
+ * restarted onto it (still running the OLD version).
18826
+ * - `awaiting-confirmation` — the node HAS restarted onto the staged version
18827
+ * (it is the active probation boot) and is waiting to confirm boot-health.
18828
+ * Apply/rollback are refused in this state and the node must NOT be
18829
+ * manually restarted, or the probation boot auto-rolls-back.
18830
+ */
18831
+ var ServerUpdateStateSchema = _enum([
18832
+ "idle",
18833
+ "checking",
18834
+ "staging",
18835
+ "pending-restart",
18836
+ "awaiting-confirmation"
18837
+ ]);
18838
+ var ServerRollbackInfoSchema = object({
18839
+ /** The version that failed (or was manually rolled back). */
18840
+ fromVersion: string(),
18841
+ /** The version rolled back to; null = the baked seed. */
18842
+ toVersion: string().nullable(),
18843
+ atMs: number(),
18844
+ reason: string()
18845
+ });
18846
+ var ServerPackageStatusSchema = object({
18847
+ /** Root package name (`@camstack/server` on the hub). */
18848
+ packageName: string(),
18849
+ /** Version of the code the running process ACTUALLY loaded. */
18850
+ runningVersion: string().nullable(),
18851
+ /** Node.js runtime version the node's process runs on (`process.versions.node`). */
18852
+ nodeRuntimeVersion: string().nullable(),
18853
+ /** Active data-dir root version; null when booted from seed/workspace. */
18854
+ activeVersion: string().nullable(),
18855
+ /** N-1 version kept for rollback; null when no previous version exists. */
18856
+ previousVersion: string().nullable(),
18857
+ /** Version of the immutable baked seed closure (image fallback). */
18858
+ seedVersion: string().nullable(),
18859
+ /** Latest registry version from the most recent check (null = never checked). */
18860
+ latestVersion: string().nullable(),
18861
+ updateAvailable: boolean(),
18862
+ bootMode: ServerBootModeSchema,
18863
+ updateState: ServerUpdateStateSchema,
18864
+ /** Version staged + awaiting its probation boot, when one is pending. */
18865
+ pendingVersion: string().nullable(),
18866
+ /** Set when the last freshly-activated version failed its boot health-check. */
18867
+ rolledBack: ServerRollbackInfoSchema.nullable(),
18868
+ /**
18869
+ * True when `server-root/state.json` EXISTS but is unreadable/corrupt — the
18870
+ * hub is running from the baked seed (or workspace) while installed data-dir
18871
+ * versions are being IGNORED. Surfaced as a warning in the UI.
18872
+ */
18873
+ stateFileCorrupt: boolean(),
18874
+ lastCheckedAtMs: number().nullable()
18875
+ });
18876
+ var ServerUpdateCheckResultSchema = object({
18877
+ packageName: string(),
18878
+ runningVersion: string().nullable(),
18879
+ latestVersion: string().nullable(),
18880
+ updateAvailable: boolean(),
18881
+ checkedAtMs: number(),
18882
+ /** Non-null when the registry lookup failed (offline, bad registry, …). */
18883
+ error: string().nullable()
18884
+ });
18885
+ var ServerUpdateActionResultSchema = object({
18886
+ accepted: boolean(),
18887
+ targetVersion: string().nullable(),
18888
+ /** True when a graceful restart was scheduled to apply the change. */
18889
+ restarting: boolean(),
18890
+ message: string()
18891
+ });
18892
+ method(_void(), ServerPackageStatusSchema, { auth: "admin" }), method(_void(), ServerUpdateCheckResultSchema, {
18893
+ kind: "mutation",
18894
+ auth: "admin"
18895
+ }), method(object({
18896
+ /** Explicit target version; omitted = latest from the registry. */
18897
+ version: string().optional() }), ServerUpdateActionResultSchema, {
18898
+ kind: "mutation",
18899
+ auth: "admin"
18900
+ }), method(_void(), ServerUpdateActionResultSchema, {
18901
+ kind: "mutation",
18902
+ auth: "admin"
18903
+ }), method(_void(), ServerUpdateActionResultSchema, {
18904
+ kind: "mutation",
18905
+ auth: "admin"
18906
+ });
18907
+ /**
18644
18908
  * Query filter for settings-store collections.
18645
18909
  */
18646
18910
  var QueryFilterSchema = object({
@@ -18862,7 +19126,20 @@ var snapshotCapability = {
18862
19126
  invalidateCache: method(object({ deviceId: number() }), _void(), {
18863
19127
  kind: "mutation",
18864
19128
  auth: "admin"
18865
- })
19129
+ }),
19130
+ /**
19131
+ * Cache-only batch overview — answers from the wrapper's in-memory cache in
19132
+ * O(n) and NEVER triggers a capture. Lets a grid skip requesting images for
19133
+ * devices that never produced a frame, and gives it an ETag per device for
19134
+ * conditional (304-able) image fetches. `lastCapturedAt`/`cacheAgeMs`/`etag`
19135
+ * are null for a device with no cached frame.
19136
+ */
19137
+ getSnapshotOverview: systemMethod(object({ deviceIds: array(number()).min(1).max(200) }), array(object({
19138
+ deviceId: number(),
19139
+ lastCapturedAt: number().nullable(),
19140
+ cacheAgeMs: number().nullable(),
19141
+ etag: string().nullable()
19142
+ })))
18866
19143
  },
18867
19144
  status: {
18868
19145
  schema: SnapshotStatusSchema,
@@ -19119,10 +19396,32 @@ method(_void(), array(TurnServerSchema).readonly());
19119
19396
  * b. `finishAuthentication({userId, response})` → server verifies
19120
19397
  * the assertion, bumps the credential counter, returns ok.
19121
19398
  *
19399
+ * 2b. Usernameless (discoverable-credential) authentication — the
19400
+ * passkey IS the primary factor, no password leg:
19401
+ * a. `beginDiscoverableAuthentication({})` → assertion options with
19402
+ * EMPTY `allowCredentials` (the browser offers every resident
19403
+ * passkey it holds for this RP) + `userVerification: 'required'`
19404
+ * (the passkey replaces both factors, so UV is mandatory).
19405
+ * The challenge is stored server-side, NOT bound to any user.
19406
+ * b. `finishDiscoverableAuthentication({response})` → the provider
19407
+ * resolves the credential by the response's credential id,
19408
+ * verifies the assertion against the stored challenge + that
19409
+ * credential's public key/counter, and returns the OWNING
19410
+ * `userId` — the caller (core auth router) mints the session.
19411
+ *
19122
19412
  * 3. Management:
19123
19413
  * - `listPasskeys({userId})` — enumerate user's enrolled credentials.
19124
19414
  * - `removePasskey({userId, credentialId})` — revoke one credential.
19125
19415
  *
19416
+ * 4. Second-factor preference (opt-in, default OFF):
19417
+ * Enrolling a passkey only enables passkey-FIRST sign-in. It is
19418
+ * demanded as a second factor after a password login ONLY when the
19419
+ * user explicitly opts in via `setSecondFactorPreference`.
19420
+ * - `getSecondFactorPreference({userId})` → `{ enabled }` (missing
19421
+ * row ⇒ `enabled: false`).
19422
+ * - `setSecondFactorPreference({userId, enabled})` — persisted by
19423
+ * the providing addon beside its credentials.
19424
+ *
19126
19425
  * Challenges are short-lived (5 min, in-memory). The cap is internal —
19127
19426
  * the admin-ui composes the begin/finish round-trip and never exposes
19128
19427
  * the cap to non-admins.
@@ -19165,6 +19464,17 @@ method(object({
19165
19464
  }), object({ verified: boolean() }), {
19166
19465
  kind: "mutation",
19167
19466
  access: "view"
19467
+ }), method(object({}), object({ optionsJSON: record(string(), unknown()) }), {
19468
+ kind: "mutation",
19469
+ access: "view"
19470
+ }), method(object({
19471
+ /** AuthenticationResponseJSON from the browser. */
19472
+ response: record(string(), unknown()) }), object({
19473
+ verified: boolean(),
19474
+ userId: string().nullable()
19475
+ }), {
19476
+ kind: "mutation",
19477
+ access: "view"
19168
19478
  }), method(object({ userId: string() }), array(PasskeySummarySchema), { auth: "admin" }), method(object({
19169
19479
  userId: string(),
19170
19480
  credentialId: string()
@@ -19172,6 +19482,13 @@ method(object({
19172
19482
  kind: "mutation",
19173
19483
  auth: "admin",
19174
19484
  access: "delete"
19485
+ }), method(object({ userId: string() }), object({ enabled: boolean() }), { auth: "admin" }), method(object({
19486
+ userId: string(),
19487
+ enabled: boolean()
19488
+ }), object({ success: literal(true) }), {
19489
+ kind: "mutation",
19490
+ auth: "admin",
19491
+ access: "create"
19175
19492
  });
19176
19493
  /**
19177
19494
  * `videoclips` — the unified, navigable-clip surface for a camera.
@@ -19973,7 +20290,17 @@ var FaceInfoSchema = object({
19973
20290
  recognizedIdentityId: string().optional(),
19974
20291
  identityName: string().optional(),
19975
20292
  assigned: boolean(),
19976
- base64: string().optional()
20293
+ base64: string().optional(),
20294
+ /** Design B: the face bbox (pixel space) on the key frame — lets a detail
20295
+ * view draw the box over the native `keyFrameMediaKey` frame. Absent on
20296
+ * legacy rows written before design B. */
20297
+ faceBbox: BoundingBoxSchema.optional(),
20298
+ /** Design B: MediaStore key of the track's native-resolution key frame.
20299
+ * Fetch the native JPEG via the event-media data-plane
20300
+ * (`/addon/<addonId>/event-media/<keyFrameMediaKey>`). Absent when the
20301
+ * track produced no key frame (e.g. native/onboard source) — the UI falls
20302
+ * back to the inline `base64` face crop. */
20303
+ keyFrameMediaKey: string().optional()
19977
20304
  });
19978
20305
  var FaceFilterEnum = _enum([
19979
20306
  "unassigned",
@@ -20670,6 +20997,16 @@ var TopologyCategorySchema = object({
20670
20997
  healthy: number(),
20671
20998
  addons: array(TopologyCategoryAddonSchema).readonly()
20672
20999
  });
21000
+ /**
21001
+ * The node's runtime-updatable ROOT package (`@camstack/server` on the hub,
21002
+ * `@camstack/agent` on agents) as reported by its `registerNode` manifest —
21003
+ * version visibility for the Server management surface. Nullable: offline
21004
+ * rows and pre-phase-2 nodes report none.
21005
+ */
21006
+ var TopologyRootPackageSchema = object({
21007
+ name: string(),
21008
+ version: string()
21009
+ });
20673
21010
  var TopologyNodeSchema = object({
20674
21011
  id: string(),
20675
21012
  name: string(),
@@ -20693,7 +21030,8 @@ var TopologyNodeSchema = object({
20693
21030
  status: string()
20694
21031
  })).readonly(),
20695
21032
  processes: array(TopologyProcessSchema).readonly(),
20696
- categories: array(TopologyCategorySchema).readonly()
21033
+ categories: array(TopologyCategorySchema).readonly(),
21034
+ rootPackage: TopologyRootPackageSchema.nullable()
20697
21035
  });
20698
21036
  var CapUsageEdgeSchema = object({
20699
21037
  callerAddonId: string(),
@@ -23792,6 +24130,12 @@ Object.freeze({
23792
24130
  addonId: null,
23793
24131
  access: "create"
23794
24132
  },
24133
+ "loginMethod.getLoginMethods": {
24134
+ capName: "login-method",
24135
+ capScope: "system",
24136
+ addonId: null,
24137
+ access: "view"
24138
+ },
23795
24139
  "mediaPlayer.next": {
23796
24140
  capName: "media-player",
23797
24141
  capScope: "device",
@@ -24374,6 +24718,12 @@ Object.freeze({
24374
24718
  addonId: null,
24375
24719
  access: "view"
24376
24720
  },
24721
+ "pipelineAnalytics.getKeyEvents": {
24722
+ capName: "pipeline-analytics",
24723
+ capScope: "device",
24724
+ addonId: null,
24725
+ access: "view"
24726
+ },
24377
24727
  "pipelineAnalytics.getMotionEvents": {
24378
24728
  capName: "pipeline-analytics",
24379
24729
  capScope: "device",
@@ -24422,23 +24772,23 @@ Object.freeze({
24422
24772
  addonId: null,
24423
24773
  access: "create"
24424
24774
  },
24425
- "pipelineExecutor.deleteModel": {
24775
+ "pipelineExecutor.clearDeviceOverrides": {
24426
24776
  capName: "pipeline-executor",
24427
24777
  capScope: "system",
24428
24778
  addonId: null,
24429
24779
  access: "delete"
24430
24780
  },
24431
- "pipelineExecutor.deleteTemplate": {
24781
+ "pipelineExecutor.deleteModel": {
24432
24782
  capName: "pipeline-executor",
24433
24783
  capScope: "system",
24434
24784
  addonId: null,
24435
24785
  access: "delete"
24436
24786
  },
24437
- "pipelineExecutor.detect": {
24787
+ "pipelineExecutor.deleteTemplate": {
24438
24788
  capName: "pipeline-executor",
24439
24789
  capScope: "system",
24440
24790
  addonId: null,
24441
- access: "view"
24791
+ access: "delete"
24442
24792
  },
24443
24793
  "pipelineExecutor.downloadModel": {
24444
24794
  capName: "pipeline-executor",
@@ -24584,12 +24934,6 @@ Object.freeze({
24584
24934
  addonId: null,
24585
24935
  access: "create"
24586
24936
  },
24587
- "pipelineExecutor.resetToDefault": {
24588
- capName: "pipeline-executor",
24589
- capScope: "system",
24590
- addonId: null,
24591
- access: "delete"
24592
- },
24593
24937
  "pipelineExecutor.runAudioTest": {
24594
24938
  capName: "pipeline-executor",
24595
24939
  capScope: "system",
@@ -24650,12 +24994,6 @@ Object.freeze({
24650
24994
  addonId: null,
24651
24995
  access: "create"
24652
24996
  },
24653
- "pipelineOrchestrator.assignDecoder": {
24654
- capName: "pipeline-orchestrator",
24655
- capScope: "system",
24656
- addonId: null,
24657
- access: "create"
24658
- },
24659
24997
  "pipelineOrchestrator.assignPipeline": {
24660
24998
  capName: "pipeline-orchestrator",
24661
24999
  capScope: "system",
@@ -24734,18 +25072,6 @@ Object.freeze({
24734
25072
  addonId: null,
24735
25073
  access: "view"
24736
25074
  },
24737
- "pipelineOrchestrator.getDecoderAssignment": {
24738
- capName: "pipeline-orchestrator",
24739
- capScope: "system",
24740
- addonId: null,
24741
- access: "view"
24742
- },
24743
- "pipelineOrchestrator.getDecoderAssignments": {
24744
- capName: "pipeline-orchestrator",
24745
- capScope: "system",
24746
- addonId: null,
24747
- access: "view"
24748
- },
24749
25075
  "pipelineOrchestrator.getGlobalMetrics": {
24750
25076
  capName: "pipeline-orchestrator",
24751
25077
  capScope: "system",
@@ -24794,6 +25120,12 @@ Object.freeze({
24794
25120
  addonId: null,
24795
25121
  access: "delete"
24796
25122
  },
25123
+ "pipelineOrchestrator.resetNodePipelineDefaults": {
25124
+ capName: "pipeline-orchestrator",
25125
+ capScope: "system",
25126
+ addonId: null,
25127
+ access: "delete"
25128
+ },
24797
25129
  "pipelineOrchestrator.resolvePipeline": {
24798
25130
  capName: "pipeline-orchestrator",
24799
25131
  capScope: "system",
@@ -24866,12 +25198,6 @@ Object.freeze({
24866
25198
  addonId: null,
24867
25199
  access: "create"
24868
25200
  },
24869
- "pipelineOrchestrator.unassignDecoder": {
24870
- capName: "pipeline-orchestrator",
24871
- capScope: "system",
24872
- addonId: null,
24873
- access: "create"
24874
- },
24875
25201
  "pipelineOrchestrator.unassignPipeline": {
24876
25202
  capName: "pipeline-orchestrator",
24877
25203
  capScope: "system",
@@ -24926,6 +25252,12 @@ Object.freeze({
24926
25252
  addonId: null,
24927
25253
  access: "view"
24928
25254
  },
25255
+ "pipelineRunner.getNativeCrop": {
25256
+ capName: "pipeline-runner",
25257
+ capScope: "system",
25258
+ addonId: null,
25259
+ access: "view"
25260
+ },
24929
25261
  "pipelineRunner.reportMotion": {
24930
25262
  capName: "pipeline-runner",
24931
25263
  capScope: "system",
@@ -25178,6 +25510,36 @@ Object.freeze({
25178
25510
  addonId: null,
25179
25511
  access: "create"
25180
25512
  },
25513
+ "serverManagement.applyServerUpdate": {
25514
+ capName: "server-management",
25515
+ capScope: "system",
25516
+ addonId: null,
25517
+ access: "create"
25518
+ },
25519
+ "serverManagement.checkServerUpdate": {
25520
+ capName: "server-management",
25521
+ capScope: "system",
25522
+ addonId: null,
25523
+ access: "create"
25524
+ },
25525
+ "serverManagement.getServerPackageStatus": {
25526
+ capName: "server-management",
25527
+ capScope: "system",
25528
+ addonId: null,
25529
+ access: "view"
25530
+ },
25531
+ "serverManagement.restartServer": {
25532
+ capName: "server-management",
25533
+ capScope: "system",
25534
+ addonId: null,
25535
+ access: "create"
25536
+ },
25537
+ "serverManagement.rollbackServerUpdate": {
25538
+ capName: "server-management",
25539
+ capScope: "system",
25540
+ addonId: null,
25541
+ access: "create"
25542
+ },
25181
25543
  "settingsStore.count": {
25182
25544
  capName: "settings-store",
25183
25545
  capScope: "system",
@@ -25262,6 +25624,12 @@ Object.freeze({
25262
25624
  addonId: null,
25263
25625
  access: "view"
25264
25626
  },
25627
+ "snapshot.getSnapshotOverview": {
25628
+ capName: "snapshot",
25629
+ capScope: "device",
25630
+ addonId: null,
25631
+ access: "view"
25632
+ },
25265
25633
  "snapshot.invalidateCache": {
25266
25634
  capName: "snapshot",
25267
25635
  capScope: "device",
@@ -25940,6 +26308,12 @@ Object.freeze({
25940
26308
  addonId: null,
25941
26309
  access: "view"
25942
26310
  },
26311
+ "userPasskeys.beginDiscoverableAuthentication": {
26312
+ capName: "user-passkeys",
26313
+ capScope: "system",
26314
+ addonId: null,
26315
+ access: "view"
26316
+ },
25943
26317
  "userPasskeys.beginRegistration": {
25944
26318
  capName: "user-passkeys",
25945
26319
  capScope: "system",
@@ -25952,12 +26326,24 @@ Object.freeze({
25952
26326
  addonId: null,
25953
26327
  access: "view"
25954
26328
  },
26329
+ "userPasskeys.finishDiscoverableAuthentication": {
26330
+ capName: "user-passkeys",
26331
+ capScope: "system",
26332
+ addonId: null,
26333
+ access: "view"
26334
+ },
25955
26335
  "userPasskeys.finishRegistration": {
25956
26336
  capName: "user-passkeys",
25957
26337
  capScope: "system",
25958
26338
  addonId: null,
25959
26339
  access: "create"
25960
26340
  },
26341
+ "userPasskeys.getSecondFactorPreference": {
26342
+ capName: "user-passkeys",
26343
+ capScope: "system",
26344
+ addonId: null,
26345
+ access: "view"
26346
+ },
25961
26347
  "userPasskeys.listPasskeys": {
25962
26348
  capName: "user-passkeys",
25963
26349
  capScope: "system",
@@ -25970,6 +26356,12 @@ Object.freeze({
25970
26356
  addonId: null,
25971
26357
  access: "delete"
25972
26358
  },
26359
+ "userPasskeys.setSecondFactorPreference": {
26360
+ capName: "user-passkeys",
26361
+ capScope: "system",
26362
+ addonId: null,
26363
+ access: "create"
26364
+ },
25973
26365
  "vacuumControl.locate": {
25974
26366
  capName: "vacuum-control",
25975
26367
  capScope: "device",
@@ -26042,6 +26434,18 @@ Object.freeze({
26042
26434
  addonId: null,
26043
26435
  access: "view"
26044
26436
  },
26437
+ "viewerUi.getStaticDir": {
26438
+ capName: "viewer-ui",
26439
+ capScope: "system",
26440
+ addonId: null,
26441
+ access: "view"
26442
+ },
26443
+ "viewerUi.getVersion": {
26444
+ capName: "viewer-ui",
26445
+ capScope: "system",
26446
+ addonId: null,
26447
+ access: "view"
26448
+ },
26045
26449
  "waterHeater.setAway": {
26046
26450
  capName: "water-heater",
26047
26451
  capScope: "device",