@camstack/addon-provider-rtsp 1.2.26 → 1.2.28

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 +432 -50
  2. package/dist/addon.mjs +432 -50
  3. package/package.json +1 -1
package/dist/addon.mjs CHANGED
@@ -5801,6 +5801,13 @@ var BaseAddon = class {
5801
5801
  _readinessGeneration = typeof crypto !== "undefined" && crypto.randomUUID ? crypto.randomUUID() : Math.random().toString(36).slice(2, 14);
5802
5802
  /** Capability names this addon registered at init — used to emit matching `down` events on shutdown. */
5803
5803
  _registeredCapNames = [];
5804
+ /**
5805
+ * True only after `readAddonStore` actually answered. Constructor
5806
+ * defaults look like stored config when the store is down — a forked
5807
+ * addon that auto-starts from those defaults (cloudflare-tunnel quick
5808
+ * mode, 2026-08-25) is not "the operator chose this".
5809
+ */
5810
+ settingsStoreReady = false;
5804
5811
  /** Default config values. Provided via constructor. */
5805
5812
  defaults;
5806
5813
  constructor(defaults) {
@@ -6201,7 +6208,9 @@ var BaseAddon = class {
6201
6208
  ];
6202
6209
  let lastErr;
6203
6210
  for (let attempt = 0; attempt <= delaysMs.length; attempt++) try {
6204
- return await settings.readAddonStore() ?? {};
6211
+ const stored = await settings.readAddonStore() ?? {};
6212
+ this.settingsStoreReady = true;
6213
+ return stored;
6205
6214
  } catch (err) {
6206
6215
  lastErr = err;
6207
6216
  const msg = err instanceof Error ? err.message : String(err);
@@ -6209,6 +6218,7 @@ var BaseAddon = class {
6209
6218
  if (attempt === delaysMs.length) break;
6210
6219
  await new Promise((r) => setTimeout(r, delaysMs[attempt]));
6211
6220
  }
6221
+ this.settingsStoreReady = false;
6212
6222
  this._ctx?.logger?.warn?.("readAddonStore: settings-store unavailable after retries — using defaults", { meta: { error: lastErr instanceof Error ? lastErr.message : String(lastErr) } });
6213
6223
  return {};
6214
6224
  }
@@ -8052,6 +8062,15 @@ var LabelDefinitionSchema = object({
8052
8062
  description: string().optional(),
8053
8063
  icon: string().optional()
8054
8064
  });
8065
+ var ClassMapDefinitionSchema = object({
8066
+ mapping: record(string(), _enum([
8067
+ "person",
8068
+ "vehicle",
8069
+ "animal",
8070
+ "package"
8071
+ ])),
8072
+ preserveOriginal: boolean()
8073
+ });
8055
8074
  var MODEL_FORMATS = [
8056
8075
  "onnx",
8057
8076
  "coreml",
@@ -8135,6 +8154,12 @@ var ModelVariantGroupSchema = object({
8135
8154
  */
8136
8155
  resolution: number().int().positive().optional()
8137
8156
  });
8157
+ var ModelProviderIdSchema = _enum([
8158
+ "camstack",
8159
+ "frigate",
8160
+ "scrypted",
8161
+ "custom"
8162
+ ]);
8138
8163
  var ModelCatalogEntrySchema = object({
8139
8164
  id: string(),
8140
8165
  name: string(),
@@ -8230,7 +8255,19 @@ var ModelCatalogEntrySchema = object({
8230
8255
  * `id` stays the source of truth for resolution/download/persistence; grouping
8231
8256
  * is a presentation overlay resolved back to an `id`.
8232
8257
  */
8233
- group: ModelVariantGroupSchema.optional()
8258
+ group: ModelVariantGroupSchema.optional(),
8259
+ /**
8260
+ * Catalog source for the pipeline stepper's provider-first picker. Absent on
8261
+ * built-in CamStack entries (treated as `camstack`) and on registry rows
8262
+ * persisted before this field existed (`inferModelProvider` fills those).
8263
+ */
8264
+ provider: ModelProviderIdSchema.optional(),
8265
+ /**
8266
+ * Per-MODEL class map override. Absent ⇒ the step's `StepDefinition.classMap`
8267
+ * applies (Frigate / COCO public catalog). Set on a custom model whose raw
8268
+ * labels already ARE the CamStack macros (Scrypted identity map).
8269
+ */
8270
+ classMap: ClassMapDefinitionSchema.optional()
8234
8271
  });
8235
8272
  var ConvertTargetSchema = discriminatedUnion("format", [object({
8236
8273
  format: literal("openvino"),
@@ -8259,7 +8296,8 @@ var ModelConvertMetadataSchema = object({
8259
8296
  "ocr",
8260
8297
  "segmentation"
8261
8298
  ]),
8262
- faceAlignment: boolean().optional()
8299
+ faceAlignment: boolean().optional(),
8300
+ classMap: ClassMapDefinitionSchema.optional()
8263
8301
  });
8264
8302
  var ConvertResultSchema = object({
8265
8303
  entry: ModelCatalogEntrySchema,
@@ -12016,6 +12054,27 @@ var LinkedDeviceSchema = object({
12016
12054
  features: array(string()),
12017
12055
  producesTrackedEvents: boolean().optional()
12018
12056
  });
12057
+ /** One camera's resolved linked set, tagged with the camera it belongs to.
12058
+ * The batch answer needs the tag; the single-device answer already has it
12059
+ * from the input, which is why `getLinkedDevices` keeps the untagged shape. */
12060
+ var LinkedDevicesForDeviceSchema = object({
12061
+ deviceId: number(),
12062
+ mode: LinkedDevicesModeSchema,
12063
+ devices: array(LinkedDeviceSchema)
12064
+ });
12065
+ /** One device's binding map — the shape `getBindings`, `getBindingsBatch` and
12066
+ * `getAllBindings` all answer in. Declared once: three copies of the same
12067
+ * object literal is exactly how the three drift apart. */
12068
+ var DeviceBindingsForDeviceSchema = object({
12069
+ deviceId: number(),
12070
+ entries: array(object({
12071
+ capName: string(),
12072
+ kind: _enum(["native", "wrapped"]),
12073
+ providerAddonId: string(),
12074
+ providerNodeId: string(),
12075
+ nativeAddonId: string()
12076
+ }))
12077
+ });
12019
12078
  var SavedDeviceRowSchema = object({
12020
12079
  /** Numeric id reserved at allocateDeviceId time. */
12021
12080
  id: number(),
@@ -12241,11 +12300,25 @@ method(object({
12241
12300
  projection: _enum(["full", "slim"]).optional(),
12242
12301
  /** Return only camera devices. Filtering server-side instead of
12243
12302
  * shipping 293 rows to find 12. */
12244
- isCamera: boolean().optional()
12303
+ isCamera: boolean().optional(),
12304
+ /**
12305
+ * Return only these device ids. For the caller that already KNOWS the
12306
+ * handful it wants and needs a field the id-bearing answer does not
12307
+ * carry — the viewer's linked-devices panel joins `type` and `online`
12308
+ * onto ~8 linked ids and, unfiltered, dragged the fleet across to do
12309
+ * it: 433 KB slim / 958 KB full for 967 devices, on a query that
12310
+ * refetches on the reconcile interval, on a phone.
12311
+ *
12312
+ * Safe to send at a hub that predates it: Zod STRIPS unknown input
12313
+ * keys rather than rejecting them (verified against the live hub
12314
+ * 2026-08-25 — 967 rows came back), so an old hub answers exactly what
12315
+ * it answers today and the caller filters as it already does.
12316
+ */
12317
+ deviceIds: array(number()).optional()
12245
12318
  }), array(DeviceInfoSchema)), method(object({ deviceId: number() }), DeviceInfoSchema.nullable()), method(object({ parentDeviceId: number() }), array(DeviceInfoSchema)), method(object({ deviceId: number() }), object({
12246
12319
  mode: LinkedDevicesModeSchema,
12247
12320
  devices: array(LinkedDeviceSchema)
12248
- })), method(object({ deviceId: number() }), array(StreamSourceEntrySchema$1)), method(object({ deviceId: number() }), array(ConfigEntrySchema)), method(object({ deviceId: number() }), ConfigUISchemaOutput), method(object({
12321
+ })), method(object({ deviceIds: array(number()) }), array(LinkedDevicesForDeviceSchema)), method(object({ deviceId: number() }), array(StreamSourceEntrySchema$1)), method(object({ deviceId: number() }), array(ConfigEntrySchema)), method(object({ deviceId: number() }), ConfigUISchemaOutput), method(object({
12249
12322
  deviceId: number(),
12250
12323
  values: record(string(), unknown())
12251
12324
  }), object({ success: literal(true) }), {
@@ -12272,25 +12345,7 @@ method(object({
12272
12345
  }), method(object({ deviceId: number() }), array(StreamProbeResultSchema), {
12273
12346
  kind: "mutation",
12274
12347
  auth: "admin"
12275
- }), method(object({ deviceId: number() }), object({
12276
- deviceId: number(),
12277
- entries: array(object({
12278
- capName: string(),
12279
- kind: _enum(["native", "wrapped"]),
12280
- providerAddonId: string(),
12281
- providerNodeId: string(),
12282
- nativeAddonId: string()
12283
- }))
12284
- })), method(object({}), array(object({
12285
- deviceId: number(),
12286
- entries: array(object({
12287
- capName: string(),
12288
- kind: _enum(["native", "wrapped"]),
12289
- providerAddonId: string(),
12290
- providerNodeId: string(),
12291
- nativeAddonId: string()
12292
- }))
12293
- }))), method(object({
12348
+ }), method(object({ deviceId: number() }), DeviceBindingsForDeviceSchema), method(object({ deviceIds: array(number()) }), array(DeviceBindingsForDeviceSchema)), method(object({}), array(DeviceBindingsForDeviceSchema)), method(object({
12294
12349
  deviceId: number(),
12295
12350
  capName: string(),
12296
12351
  wrapperAddonId: string(),
@@ -14700,12 +14755,15 @@ var NcOccupancyConditionSchema = object({
14700
14755
  * there is no second switch that can disagree with the first and every rule
14701
14756
  * authored before the decision migrates for free (`audioModeOf`):
14702
14757
  *
14703
- * - **LABEL mode — `labels` present.** The rule fires on the FIRST frame the
14704
- * classifier labels with one of them. No window, no percentage:
14705
- * `hitPercent` and `samplingSeconds` are ignored, and the rule's own
14706
- * `throttle` cooldown is the only brake. The per-label confidence floor is
14707
- * the analyzer's (`classificationMinScore`, per device) a label only
14708
- * reaches this condition if the classifier was already confident enough.
14758
+ * - **LABEL mode — `labels` present.** The rule fires when `confirmHits`
14759
+ * labelled frames land inside `confirmWindowSec` (default 2 in 5 s).
14760
+ * `hitPercent` and `samplingSeconds` are still ignored a percentage of
14761
+ * frames is the wrong question for a classifier that labels 1–3 frames
14762
+ * per episode. The count window is the brake that drops a single-frame
14763
+ * false positive; the rule's own `throttle` cooldown is the other. The
14764
+ * per-label confidence floor is the analyzer's (`classificationMinScore`,
14765
+ * per device) — a label only reaches this condition if the classifier was
14766
+ * already confident enough. `confirmHits: 1` restores first-frame fire.
14709
14767
  * - **LEVEL mode — `dbThreshold` present, no labels.** The sampling window IS
14710
14768
  * the condition: at least `hitPercent`% of the samples over
14711
14769
  * `samplingSeconds` must be at or above `dbThreshold` dBFS (see
@@ -14732,14 +14790,22 @@ var NcOccupancyConditionSchema = object({
14732
14790
  * an operator who typed `dog` mean the same thing.
14733
14791
  */
14734
14792
  var NcAudioConditionSchema = object({
14735
- /** LABEL MODE: audio macro labels. Present ⇒ fires on the first labelled frame. */
14793
+ /** LABEL MODE: audio macro labels. Present ⇒ count-in-window confirm. */
14736
14794
  labels: array(string().min(1)).min(1).optional(),
14737
14795
  /** LEVEL MODE: floor in dBFS (negative-going, `0` = full scale). */
14738
14796
  dbThreshold: number().min(-96).max(0).optional(),
14739
14797
  /** LEVEL MODE ONLY: percentage of the window's samples that must be hits (1–100). */
14740
14798
  hitPercent: number().int().min(1).max(100).default(60),
14741
14799
  /** LEVEL MODE ONLY: length of the sampling window in seconds. */
14742
- samplingSeconds: number().int().min(1).max(300).default(10)
14800
+ samplingSeconds: number().int().min(1).max(300).default(10),
14801
+ /**
14802
+ * LABEL MODE: how many labelled frames must land inside
14803
+ * {@link NcAudioConditionSchema.shape.confirmWindowSec} before dispatch.
14804
+ * Absent ⇒ 2 (the matcher default). `1` is first-frame fire.
14805
+ */
14806
+ confirmHits: number().int().min(1).max(20).optional(),
14807
+ /** LABEL MODE: the window those frames must share, in seconds. Absent ⇒ 5. */
14808
+ confirmWindowSec: number().int().min(1).max(60).optional()
14743
14809
  });
14744
14810
  /**
14745
14811
  * Which zone-crossing DIRECTION a rule accepts (`ObjectEvent.zoneCrossing`).
@@ -17113,6 +17179,46 @@ var RecentTracksPageSchema = object({
17113
17179
  /** Cursor for the next page, or null when this page is the last. */
17114
17180
  nextCursor: string().nullable()
17115
17181
  });
17182
+ var LIST_GROUPS_DEFAULT_LIMIT = 40;
17183
+ var LIST_GROUPS_MAX_LIMIT = 100;
17184
+ var AnalyticsGroupRecordSchema = object({
17185
+ id: string(),
17186
+ deviceId: number().int(),
17187
+ openedAt: number().int(),
17188
+ closedAt: number().int(),
17189
+ timestamp: number().int(),
17190
+ memberCount: number().int(),
17191
+ memberTrackIds: array(string()).readonly(),
17192
+ className: string(),
17193
+ classes: array(string()).readonly(),
17194
+ /** Relative event-media path, or null when the group has no picture yet. */
17195
+ mediaUrl: string().nullable(),
17196
+ singleton: boolean()
17197
+ });
17198
+ var AnalyticsGroupMemberSchema = object({
17199
+ trackId: string(),
17200
+ deviceId: number().int(),
17201
+ className: string(),
17202
+ firstSeen: number().int(),
17203
+ lastSeen: number().int(),
17204
+ mediaUrl: string().nullable()
17205
+ });
17206
+ var AnalyticsGroupDetailSchema = AnalyticsGroupRecordSchema.extend({ members: array(AnalyticsGroupMemberSchema).readonly() });
17207
+ var ListGroupsQueryInput = object({
17208
+ /** Devices to merge. An empty array yields `{ groups: [], nextCursor: null }`. */
17209
+ deviceIds: array(number()),
17210
+ /** Window lower bound on `closedAt` (inclusive). */
17211
+ since: number().optional(),
17212
+ /** Window upper bound on `openedAt` (inclusive). */
17213
+ until: number().optional(),
17214
+ limit: number().int().min(1).max(LIST_GROUPS_MAX_LIMIT).default(LIST_GROUPS_DEFAULT_LIMIT),
17215
+ /** Opaque continuation cursor from a previous page's `nextCursor`. */
17216
+ cursor: string().optional()
17217
+ });
17218
+ var ListGroupsPageSchema = object({
17219
+ groups: array(AnalyticsGroupRecordSchema).readonly(),
17220
+ nextCursor: string().nullable()
17221
+ });
17116
17222
  var KeyEventQueryInput = object({
17117
17223
  deviceId: number(),
17118
17224
  /** Window lower bound (track firstSeen ≥ since). */
@@ -17188,7 +17294,9 @@ var TrackCascadeCountsSchema = object({
17188
17294
  /** Unassigned plate reads removed (best-effort; plate leg deferred to plate-intelligence). */
17189
17295
  plates: number().int(),
17190
17296
  /** Per-track CLIP search vectors removed (best-effort). */
17191
- embeddings: number().int()
17297
+ embeddings: number().int(),
17298
+ /** Group membership + group rows removed with their last member (best-effort). */
17299
+ groups: number().int()
17192
17300
  });
17193
17301
  /** Disk-wins reconcile: media rows whose blobs are gone, then empty tracks. */
17194
17302
  var DiskReconcileCountsSchema = object({
@@ -17334,7 +17442,10 @@ DeviceType.Camera, method(object({ deviceId: number() }), array(TrackSchema).rea
17334
17442
  * stationary registry). Default false: the timeline lists passages,
17335
17443
  * not parking records (operator decision, 2026-08-15). */
17336
17444
  includeStationary: boolean().optional()
17337
- }), array(TrackSchema).readonly()), method(RecentTracksQueryInput, RecentTracksPageSchema), method(object({ deviceId: number() }), _void(), {
17445
+ }), array(TrackSchema).readonly()), method(RecentTracksQueryInput, RecentTracksPageSchema), method(ListGroupsQueryInput, ListGroupsPageSchema), method(object({
17446
+ deviceId: number(),
17447
+ groupId: string().min(1)
17448
+ }), AnalyticsGroupDetailSchema.nullable()), method(object({ deviceId: number() }), _void(), {
17338
17449
  kind: "mutation",
17339
17450
  auth: "admin"
17340
17451
  }), method(DeviceEventQueryInput, array(MotionEventSchema).readonly()), method(ObjectEventQueryInput, array(ObjectEventSchema).readonly()), method(DeviceEventQueryInput, array(AudioEventSchema).readonly()), method(object({ deviceId: number() }), array(EventKindDescriptorSchema).readonly()), method(object({ deviceIds: array(number()).min(1).max(200) }), array(EventKindsForDeviceSchema).readonly()), method(object({
@@ -17552,6 +17663,33 @@ var NativeCropRefSchema = object({
17552
17663
  h: number()
17553
17664
  })
17554
17665
  });
17666
+ object({
17667
+ crop: object({
17668
+ left: number(),
17669
+ top: number(),
17670
+ width: number().positive(),
17671
+ height: number().positive()
17672
+ }).optional(),
17673
+ content: object({
17674
+ width: number().int().positive(),
17675
+ height: number().int().positive()
17676
+ }),
17677
+ fit: _enum(["stretch", "contain"]),
17678
+ format: _enum([
17679
+ "rgb",
17680
+ "gray",
17681
+ "jpeg"
17682
+ ])
17683
+ });
17684
+ var FrameRefSchema = object({
17685
+ registryId: string().min(1),
17686
+ id: string().min(1),
17687
+ width: number().int().positive(),
17688
+ height: number().int().positive(),
17689
+ format: _enum(["rgb", "gray"]),
17690
+ timestamp: number(),
17691
+ capturedAt: number().optional()
17692
+ });
17555
17693
  var ModelFormatSchema$1 = _enum([
17556
17694
  "onnx",
17557
17695
  "coreml",
@@ -17617,7 +17755,8 @@ var PipelineModelOptionSchema = object({
17617
17755
  sizeMB: number()
17618
17756
  })),
17619
17757
  group: ModelVariantGroupSchema.optional(),
17620
- legacy: boolean().optional()
17758
+ legacy: boolean().optional(),
17759
+ provider: ModelProviderIdSchema.optional()
17621
17760
  });
17622
17761
  var ConfigFieldBridge = custom();
17623
17762
  var PipelineAddonSchemaSchema = object({
@@ -17796,6 +17935,12 @@ method(_void(), array(PipelineEngineChoiceSchema)), method(_void(), PipelineEngi
17796
17935
  steps: array(PipelineStepInputSchema).min(1),
17797
17936
  frame: FrameInputSchema.optional(),
17798
17937
  /**
17938
+ * Process-local lazy frame. Valid only when caller and provider resolve
17939
+ * in the same execution-group process; split/cross-node callers use
17940
+ * `frame`/`image` inline compatibility instead.
17941
+ */
17942
+ frameRef: FrameRefSchema.optional(),
17943
+ /**
17799
17944
  * CB5 shm passthrough — a `FrameHandle` naming the same ring slot
17800
17945
  * the decoded pixels live in. One more member of the one-of
17801
17946
  * frame/frameHandle/image/imageBase64/referenceImage group.
@@ -18091,7 +18236,10 @@ var NativeCropResultSchema = object({
18091
18236
  * Which source served this crop, so a quality-sensitive consumer (the native
18092
18237
  * `keyFrame`) can reject a degraded fallback:
18093
18238
  * - `native` — cut from the decode worker's retained NATIVE surface (the
18094
- * quality path).
18239
+ * quality path). A subject-tile serve is also native-resolution and stays
18240
+ * `native` here: the public enum cannot name `tile` without a breaking cap
18241
+ * change. Runner telemetry distinguishes lease vs tile via `source` on the
18242
+ * internal crop result (`nativeHits` vs `tileHits`).
18095
18243
  * - `ram-fullframe` — the native surface MISSED but the request was full-frame,
18096
18244
  * so the ≤640 RAM `RetainedFrameStore` served it (honest lower-res; legit for
18097
18245
  * the blank-frame guard / 640-snapshot resolve, NOT for the clean keyFrame).
@@ -18582,12 +18730,41 @@ var RunnerLocalLoadSchema = object({
18582
18730
  * legacy `OrchestratorMetricsSchema` shape so existing dashboards keep
18583
18731
  * working unchanged when they switch to reading from the runner cap.
18584
18732
  */
18733
+ var FrameLazyCountersSchema = object({
18734
+ framesDecoded: number(),
18735
+ framesAdmitted: number(),
18736
+ framesDroppedPixelFree: number(),
18737
+ viewsMaterialized: number(),
18738
+ viewsSkipped: number(),
18739
+ workerToRunnerBytes: number(),
18740
+ runnerToPoolRawBytes: number(),
18741
+ runnerToPoolJpegBytes: number(),
18742
+ onDemandFullFrameRequests: number(),
18743
+ onDemandCropRequests: number(),
18744
+ nativeHits: number(),
18745
+ nativeMisses: number(),
18746
+ tileHits: number(),
18747
+ tileMisses: number(),
18748
+ fallbackHits: number(),
18749
+ fallbackMisses: number(),
18750
+ retainedWritesAvoided: number(),
18751
+ residentRefs: number(),
18752
+ residentBytes: number(),
18753
+ releases: number(),
18754
+ evictions: number(),
18755
+ staleMisses: number()
18756
+ });
18757
+ var FrameLazyMetricsSchema = object({
18758
+ node: FrameLazyCountersSchema,
18759
+ cameras: array(FrameLazyCountersSchema.extend({ deviceId: number() }))
18760
+ });
18585
18761
  var RunnerLocalMetricsSchema = object({
18586
18762
  nodeId: string(),
18587
18763
  activeCameras: number(),
18588
18764
  throttledCameras: number(),
18589
18765
  avgInferenceTimeMs: number(),
18590
- queueDepth: number()
18766
+ queueDepth: number(),
18767
+ frameLazy: FrameLazyMetricsSchema.optional()
18591
18768
  });
18592
18769
  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({
18593
18770
  handle: FrameHandleSchema,
@@ -19991,6 +20168,9 @@ method(_void(), ProviderInfoSchema), method(object({ config: record(string(), un
19991
20168
  location: StorageLocationSchema,
19992
20169
  relativePath: string()
19993
20170
  }), _void(), { kind: "mutation" }), method(object({ location: StorageLocationSchema }), number().nullable()), method(BeginUploadInputSchema, BeginUploadResultSchema, { kind: "mutation" }), method(WriteChunkInputSchema, _void(), { kind: "mutation" }), method(FinalizeUploadInputSchema, _void(), { kind: "mutation" }), method(AbortUploadInputSchema, _void(), { kind: "mutation" }), method(BeginDownloadInputSchema, BeginDownloadResultSchema, { kind: "mutation" }), method(ReadChunkInputSchema, _instanceof(Uint8Array)), method(EndDownloadInputSchema, _void(), { kind: "mutation" });
20171
+ /** Profile-exported FormBuilder schema. Shape is ConfigUISchema at the UI. */
20172
+ var ProfileSettingsSchemaBridge = unknown().nullable();
20173
+ var ProfileSettingsBagSchema = record(string(), unknown());
19994
20174
  /**
19995
20175
  * A live terminal session hosted by the provider addon. Output and input do
19996
20176
  * NOT flow through the capability — they use the addon data plane
@@ -20020,7 +20200,14 @@ var TerminalSessionInfoSchema = object({
20020
20200
  var TerminalProfileInfoSchema = object({
20021
20201
  profileId: string(),
20022
20202
  label: string(),
20023
- description: string().optional()
20203
+ description: string().optional(),
20204
+ /** Spawn defaults the instance form copies on create. */
20205
+ executable: string().optional(),
20206
+ args: array(string()).readonly().optional(),
20207
+ cwd: string().optional(),
20208
+ environment: array(string()).readonly().optional(),
20209
+ /** ConfigUISchema for instance knobs, or null when the profile has none. */
20210
+ settingsSchema: ProfileSettingsSchemaBridge.optional()
20024
20211
  });
20025
20212
  /**
20026
20213
  * A durable operator-created Terminal instance. Profiles are templates; only
@@ -20033,7 +20220,12 @@ var TerminalInstanceInfoSchema = object({
20033
20220
  profileId: string(),
20034
20221
  profileLabel: string(),
20035
20222
  name: string(),
20036
- enabled: boolean()
20223
+ enabled: boolean(),
20224
+ executable: string(),
20225
+ args: array(string()).readonly(),
20226
+ cwd: string(),
20227
+ environment: array(string()).readonly(),
20228
+ profileSettings: ProfileSettingsBagSchema
20037
20229
  });
20038
20230
  var TerminalLegacyCameraSchema = object({
20039
20231
  stableId: string(),
@@ -20063,7 +20255,23 @@ var TerminalOutputBatchSchema = object({
20063
20255
  method(_void(), array(TerminalProfileInfoSchema).readonly(), { auth: "admin" }), method(_void(), array(TerminalInstanceInfoSchema).readonly(), { auth: "admin" }), method(object({
20064
20256
  targetNodeId: string().min(1),
20065
20257
  profileId: string().min(1),
20066
- name: string().trim().min(1).max(160).optional()
20258
+ name: string().trim().min(1).max(160).optional(),
20259
+ executable: string().max(1024).optional(),
20260
+ args: array(string().max(2048)).max(64).optional(),
20261
+ cwd: string().max(1024).optional(),
20262
+ environment: array(string().max(4096)).max(64).optional(),
20263
+ profileSettings: ProfileSettingsBagSchema.optional()
20264
+ }), TerminalInstanceInfoSchema, {
20265
+ kind: "mutation",
20266
+ auth: "admin"
20267
+ }), method(object({
20268
+ instanceId: string().min(1),
20269
+ name: string().trim().min(1).max(160).optional(),
20270
+ executable: string().max(1024).optional(),
20271
+ args: array(string().max(2048)).max(64).optional(),
20272
+ cwd: string().max(1024).optional(),
20273
+ environment: array(string().max(4096)).max(64).optional(),
20274
+ profileSettings: ProfileSettingsBagSchema.optional()
20067
20275
  }), TerminalInstanceInfoSchema, {
20068
20276
  kind: "mutation",
20069
20277
  auth: "admin"
@@ -20085,7 +20293,11 @@ method(_void(), array(TerminalProfileInfoSchema).readonly(), { auth: "admin" }),
20085
20293
  }), method(_void(), array(TerminalSessionInfoSchema).readonly(), { auth: "admin" }), method(object({
20086
20294
  profileId: string(),
20087
20295
  cols: number().int().positive(),
20088
- rows: number().int().positive()
20296
+ rows: number().int().positive(),
20297
+ executable: string().max(1024).optional(),
20298
+ args: array(string().max(2048)).max(64).optional(),
20299
+ cwd: string().max(1024).optional(),
20300
+ environment: array(string().max(4096)).max(64).optional()
20089
20301
  }), TerminalSessionInfoSchema, {
20090
20302
  kind: "mutation",
20091
20303
  auth: "admin"
@@ -23968,10 +24180,10 @@ var lawnMowerControlCapability = {
23968
24180
  *
23969
24181
  * • The SDK (mobile / web client) consumes `getConnectionEndpoints()`
23970
24182
  * to receive an ordered list of candidate base URLs it should race
23971
- * on connect — LAN IPv4 first (lowest latency when on same network),
23972
- * then public hostname (if a tunnel is up), then IPv6. The SDK can
23973
- * race them with short timeouts and stick with the winner for the
23974
- * session.
24183
+ * on connect — LAN IPv4 and stable LAN IPv6 first (lowest latency
24184
+ * when on the same network), then public hostname (if a tunnel is
24185
+ * up). The SDK can race them with short timeouts and stick with the
24186
+ * winner for the session.
23975
24187
  *
23976
24188
  * Why hub-only: agents are not directly addressable by the operator's
23977
24189
  * clients — they reverse-connect to the hub. Exposing their interfaces
@@ -24126,6 +24338,17 @@ var NotificationEndpointSchema = object({
24126
24338
  /** What the ranking currently resolves to (null when nothing is reachable). */
24127
24339
  resolved: string().nullable()
24128
24340
  });
24341
+ /**
24342
+ * The URLs the SDK / viewer should race for API access. `baseUrls` empty =
24343
+ * AUTO (every LAN IPv4 + the public tunnel). `resolved` is what that choice
24344
+ * currently expands to, so the UI can show the effective set either way.
24345
+ */
24346
+ var ViewerEndpointsSchema = object({
24347
+ /** The operator's explicit race set, or empty for AUTO. */
24348
+ baseUrls: array(string()).readonly(),
24349
+ /** What the ranking currently resolves to (may be empty if nothing is up). */
24350
+ resolved: array(string()).readonly()
24351
+ });
24129
24352
  var AllowedAddressesSchema = object({
24130
24353
  /**
24131
24354
  * Allowlist of interface addresses operators have explicitly opted
@@ -24134,6 +24357,20 @@ var AllowedAddressesSchema = object({
24134
24357
  * Network Addresses admin page and persisted by the addon.
24135
24358
  */
24136
24359
  addresses: array(string()).readonly() });
24360
+ var TlsStatusSchema = object({
24361
+ mode: _enum([
24362
+ "generated",
24363
+ "uploaded",
24364
+ "disabled"
24365
+ ]),
24366
+ leafFingerprintSha256: string().nullable(),
24367
+ caFingerprintSha256: string().nullable(),
24368
+ validTo: string().nullable(),
24369
+ sans: array(string()),
24370
+ caCertPem: string().nullable(),
24371
+ reissueError: string().nullable(),
24372
+ restartRequired: boolean()
24373
+ });
24137
24374
  method(_void(), ListResultSchema), method(_void(), PreferredSchema), method(object({
24138
24375
  /**
24139
24376
  * LEGACY HINT — do not send from new code. Kept optional so clients
@@ -24143,17 +24380,31 @@ method(_void(), ListResultSchema), method(_void(), PreferredSchema), method(obje
24143
24380
  */
24144
24381
  port: number().int().min(1).max(65535).optional(),
24145
24382
  /** Include `http(s)://127.0.0.1:<port>` as the lowest-priority
24146
- * candidate. Default `true`. */
24383
+ * candidate. Default `false` — loopback is not a client route. */
24147
24384
  includeLoopback: boolean().optional(),
24148
- /** Skip IPv6 entries. Some legacy clients can't parse them.
24149
- * Default `false`. */
24385
+ /** Skip IPv6 entries. Default `false` the palette includes stable
24386
+ * LAN IPv6 (ICE/WebRTC uses dual-stack regardless). Pass `true` to
24387
+ * hide them. The viewer HTTP/WS race is `getViewerEndpoints`. */
24150
24388
  ipv4Only: boolean().optional(),
24151
24389
  /** Scheme to emit for LAN/loopback URLs. Default `'http'`.
24152
24390
  * Pass `'https'` when the caller is itself loaded over HTTPS
24153
24391
  * to avoid mixed-content blocks in the browser. The public
24154
24392
  * tunnel always emits `https://` regardless. */
24155
24393
  scheme: _enum(["http", "https"]).optional()
24156
- }), GetConnectionEndpointsResultSchema), method(_void(), NotificationEndpointSchema), method(object({ baseUrl: string().nullable() }), NotificationEndpointSchema, { kind: "mutation" }), method(_void(), AllowedAddressesSchema), method(AllowedAddressesSchema, object({ success: literal(true) }), { kind: "mutation" }), method(_void(), AllowedAddressesSchema, { kind: "mutation" });
24394
+ }), GetConnectionEndpointsResultSchema), method(_void(), NotificationEndpointSchema), method(object({ baseUrl: string().nullable() }), NotificationEndpointSchema, { kind: "mutation" }), method(_void(), ViewerEndpointsSchema), method(object({ baseUrls: array(string()).readonly() }), ViewerEndpointsSchema, { kind: "mutation" }), method(_void(), AllowedAddressesSchema), method(AllowedAddressesSchema, object({ success: literal(true) }), { kind: "mutation" }), method(_void(), AllowedAddressesSchema, { kind: "mutation" }), method(_void(), TlsStatusSchema), method(object({ reason: string().optional() }), TlsStatusSchema, {
24395
+ kind: "mutation",
24396
+ auth: "admin"
24397
+ }), method(object({
24398
+ certPem: string().min(1),
24399
+ keyPem: string().min(1),
24400
+ caPem: string().optional()
24401
+ }), TlsStatusSchema, {
24402
+ kind: "mutation",
24403
+ auth: "admin"
24404
+ }), method(_void(), object({ pem: string() })), method(_void(), TlsStatusSchema, {
24405
+ kind: "mutation",
24406
+ auth: "admin"
24407
+ });
24157
24408
  var LockControlStatusSchema = object({
24158
24409
  /** Lifecycle state of the lock. `jammed` means the motor reported
24159
24410
  * failure to reach the target — operator intervention required. */
@@ -25714,7 +25965,12 @@ var PlateInfoSchema = object({
25714
25965
  plateBbox: BoundingBoxSchema.optional(),
25715
25966
  /** keyFrame parity: MediaStore key of the track's native-resolution key frame. */
25716
25967
  keyFrameMediaKey: string().optional(),
25717
- base64: string().optional()
25968
+ base64: string().optional(),
25969
+ /**
25970
+ * Same crop as a data-plane URL. `getPlateByTrack` returns this and
25971
+ * never inlines JPEG; `listPlates` still inlines for the admin-ui.
25972
+ */
25973
+ cropUrl: string().optional()
25718
25974
  });
25719
25975
  var MediaFileLiteSchema = object({
25720
25976
  key: string(),
@@ -31304,6 +31560,12 @@ Object.freeze({
31304
31560
  addonId: null,
31305
31561
  access: "view"
31306
31562
  },
31563
+ "deviceManager.getBindingsBatch": {
31564
+ capName: "device-manager",
31565
+ capScope: "system",
31566
+ addonId: null,
31567
+ access: "view"
31568
+ },
31307
31569
  "deviceManager.getChildren": {
31308
31570
  capName: "device-manager",
31309
31571
  capScope: "system",
@@ -31364,6 +31626,12 @@ Object.freeze({
31364
31626
  addonId: null,
31365
31627
  access: "view"
31366
31628
  },
31629
+ "deviceManager.getLinkedDevicesBatch": {
31630
+ capName: "device-manager",
31631
+ capScope: "system",
31632
+ addonId: null,
31633
+ access: "view"
31634
+ },
31367
31635
  "deviceManager.getRoleDisplayDefaults": {
31368
31636
  capName: "device-manager",
31369
31637
  capScope: "system",
@@ -32246,6 +32514,12 @@ Object.freeze({
32246
32514
  addonId: null,
32247
32515
  access: "create"
32248
32516
  },
32517
+ "localNetwork.downloadCa": {
32518
+ capName: "local-network",
32519
+ capScope: "system",
32520
+ addonId: null,
32521
+ access: "view"
32522
+ },
32249
32523
  "localNetwork.getAllowedAddresses": {
32250
32524
  capName: "local-network",
32251
32525
  capScope: "system",
@@ -32270,18 +32544,42 @@ Object.freeze({
32270
32544
  addonId: null,
32271
32545
  access: "view"
32272
32546
  },
32547
+ "localNetwork.getTlsStatus": {
32548
+ capName: "local-network",
32549
+ capScope: "system",
32550
+ addonId: null,
32551
+ access: "view"
32552
+ },
32553
+ "localNetwork.getViewerEndpoints": {
32554
+ capName: "local-network",
32555
+ capScope: "system",
32556
+ addonId: null,
32557
+ access: "view"
32558
+ },
32273
32559
  "localNetwork.list": {
32274
32560
  capName: "local-network",
32275
32561
  capScope: "system",
32276
32562
  addonId: null,
32277
32563
  access: "view"
32278
32564
  },
32565
+ "localNetwork.regenerateCertificate": {
32566
+ capName: "local-network",
32567
+ capScope: "system",
32568
+ addonId: null,
32569
+ access: "create"
32570
+ },
32279
32571
  "localNetwork.resetAllowlistToBestMatch": {
32280
32572
  capName: "local-network",
32281
32573
  capScope: "system",
32282
32574
  addonId: null,
32283
32575
  access: "delete"
32284
32576
  },
32577
+ "localNetwork.revertToGeneratedCertificate": {
32578
+ capName: "local-network",
32579
+ capScope: "system",
32580
+ addonId: null,
32581
+ access: "create"
32582
+ },
32285
32583
  "localNetwork.setAllowedAddresses": {
32286
32584
  capName: "local-network",
32287
32585
  capScope: "system",
@@ -32294,6 +32592,18 @@ Object.freeze({
32294
32592
  addonId: null,
32295
32593
  access: "create"
32296
32594
  },
32595
+ "localNetwork.setViewerEndpoints": {
32596
+ capName: "local-network",
32597
+ capScope: "system",
32598
+ addonId: null,
32599
+ access: "create"
32600
+ },
32601
+ "localNetwork.uploadCertificate": {
32602
+ capName: "local-network",
32603
+ capScope: "system",
32604
+ addonId: null,
32605
+ access: "create"
32606
+ },
32297
32607
  "lockControl.lock": {
32298
32608
  capName: "lock-control",
32299
32609
  capScope: "device",
@@ -33092,6 +33402,12 @@ Object.freeze({
33092
33402
  addonId: null,
33093
33403
  access: "view"
33094
33404
  },
33405
+ "pipelineAnalytics.getGroup": {
33406
+ capName: "pipeline-analytics",
33407
+ capScope: "device",
33408
+ addonId: null,
33409
+ access: "view"
33410
+ },
33095
33411
  "pipelineAnalytics.getKeyEvents": {
33096
33412
  capName: "pipeline-analytics",
33097
33413
  capScope: "device",
@@ -33176,6 +33492,12 @@ Object.freeze({
33176
33492
  addonId: null,
33177
33493
  access: "view"
33178
33494
  },
33495
+ "pipelineAnalytics.listGroups": {
33496
+ capName: "pipeline-analytics",
33497
+ capScope: "device",
33498
+ addonId: null,
33499
+ access: "view"
33500
+ },
33179
33501
  "pipelineAnalytics.listOpsLog": {
33180
33502
  capName: "pipeline-analytics",
33181
33503
  capScope: "device",
@@ -35174,6 +35496,12 @@ Object.freeze({
35174
35496
  addonId: null,
35175
35497
  access: "create"
35176
35498
  },
35499
+ "terminalSession.updateInstance": {
35500
+ capName: "terminal-session",
35501
+ capScope: "system",
35502
+ addonId: null,
35503
+ access: "create"
35504
+ },
35177
35505
  "terminalSession.writeInput": {
35178
35506
  capName: "terminal-session",
35179
35507
  capScope: "system",
@@ -35951,6 +36279,11 @@ Object.freeze({
35951
36279
  form: "single",
35952
36280
  optional: false
35953
36281
  }],
36282
+ "deviceManager.getBindingsBatch": [{
36283
+ name: "deviceIds",
36284
+ form: "array",
36285
+ optional: false
36286
+ }],
35954
36287
  "deviceManager.getChildren": [{
35955
36288
  name: "parentDeviceId",
35956
36289
  form: "single",
@@ -35996,6 +36329,11 @@ Object.freeze({
35996
36329
  form: "single",
35997
36330
  optional: false
35998
36331
  }],
36332
+ "deviceManager.getLinkedDevicesBatch": [{
36333
+ name: "deviceIds",
36334
+ form: "array",
36335
+ optional: false
36336
+ }],
35999
36337
  "deviceManager.getSettingsSchema": [{
36000
36338
  name: "deviceId",
36001
36339
  form: "single",
@@ -36016,6 +36354,11 @@ Object.freeze({
36016
36354
  form: "single",
36017
36355
  optional: false
36018
36356
  }],
36357
+ "deviceManager.listAll": [{
36358
+ name: "deviceIds",
36359
+ form: "array",
36360
+ optional: true
36361
+ }],
36019
36362
  "deviceManager.loadConfig": [{
36020
36363
  name: "deviceId",
36021
36364
  form: "single",
@@ -36589,6 +36932,11 @@ Object.freeze({
36589
36932
  form: "single",
36590
36933
  optional: false
36591
36934
  }],
36935
+ "pipelineAnalytics.getGroup": [{
36936
+ name: "deviceId",
36937
+ form: "single",
36938
+ optional: false
36939
+ }],
36592
36940
  "pipelineAnalytics.getKeyEvents": [{
36593
36941
  name: "deviceId",
36594
36942
  form: "single",
@@ -36644,6 +36992,11 @@ Object.freeze({
36644
36992
  form: "array",
36645
36993
  optional: false
36646
36994
  }],
36995
+ "pipelineAnalytics.listGroups": [{
36996
+ name: "deviceIds",
36997
+ form: "array",
36998
+ optional: false
36999
+ }],
36647
37000
  "pipelineAnalytics.listOpsLog": [{
36648
37001
  name: "deviceId",
36649
37002
  form: "single",
@@ -37661,6 +38014,35 @@ Object.freeze(Object.fromEntries([{
37661
38014
  }]
37662
38015
  }].map((s) => [s.stepId, s.defaultModelId])));
37663
38016
  string().min(1);
38017
+ var CLUSTER_STEP_SETTING_FIELDS = [{
38018
+ stepId: "face-embedding",
38019
+ key: "minLandmarkFaceSize",
38020
+ label: "Min face size for recognition (detection px)",
38021
+ description: "Refuse to embed a face smaller than this IN THE DETECTION FRAME. Applies to every node — the enrolled gallery is one index, and two admission floors would fill it from two policies. 0 disables the gate.",
38022
+ type: "slider",
38023
+ min: 0,
38024
+ max: 64,
38025
+ step: 2,
38026
+ default: 24
38027
+ }];
38028
+ function clusterStepSettingKey(stepId, fieldKey) {
38029
+ return `clusterStepSetting:${stepId}:${fieldKey}`;
38030
+ }
38031
+ var ClusterSettingNumberSchema = number().finite();
38032
+ function readClusterStepSettings(config) {
38033
+ const out = {};
38034
+ for (const field of CLUSTER_STEP_SETTING_FIELDS) {
38035
+ const parsed = ClusterSettingNumberSchema.safeParse(config[clusterStepSettingKey(field.stepId, field.key)]);
38036
+ const value = parsed.success ? parsed.data : field.default;
38037
+ const existing = out[field.stepId] ?? {};
38038
+ out[field.stepId] = {
38039
+ ...existing,
38040
+ [field.key]: value
38041
+ };
38042
+ }
38043
+ return out;
38044
+ }
38045
+ readClusterStepSettings({});
37664
38046
  object({
37665
38047
  /**
37666
38048
  * Fraction of the box's own size added on EACH side before cutting.