@camstack/addon-matter-broker 0.2.25 → 0.2.27

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
@@ -5813,6 +5813,13 @@ var BaseAddon = class {
5813
5813
  _readinessGeneration = typeof crypto !== "undefined" && crypto.randomUUID ? crypto.randomUUID() : Math.random().toString(36).slice(2, 14);
5814
5814
  /** Capability names this addon registered at init — used to emit matching `down` events on shutdown. */
5815
5815
  _registeredCapNames = [];
5816
+ /**
5817
+ * True only after `readAddonStore` actually answered. Constructor
5818
+ * defaults look like stored config when the store is down — a forked
5819
+ * addon that auto-starts from those defaults (cloudflare-tunnel quick
5820
+ * mode, 2026-08-25) is not "the operator chose this".
5821
+ */
5822
+ settingsStoreReady = false;
5816
5823
  /** Default config values. Provided via constructor. */
5817
5824
  defaults;
5818
5825
  constructor(defaults) {
@@ -6213,7 +6220,9 @@ var BaseAddon = class {
6213
6220
  ];
6214
6221
  let lastErr;
6215
6222
  for (let attempt = 0; attempt <= delaysMs.length; attempt++) try {
6216
- return await settings.readAddonStore() ?? {};
6223
+ const stored = await settings.readAddonStore() ?? {};
6224
+ this.settingsStoreReady = true;
6225
+ return stored;
6217
6226
  } catch (err) {
6218
6227
  lastErr = err;
6219
6228
  const msg = err instanceof Error ? err.message : String(err);
@@ -6221,6 +6230,7 @@ var BaseAddon = class {
6221
6230
  if (attempt === delaysMs.length) break;
6222
6231
  await new Promise((r) => setTimeout(r, delaysMs[attempt]));
6223
6232
  }
6233
+ this.settingsStoreReady = false;
6224
6234
  this._ctx?.logger?.warn?.("readAddonStore: settings-store unavailable after retries — using defaults", { meta: { error: lastErr instanceof Error ? lastErr.message : String(lastErr) } });
6225
6235
  return {};
6226
6236
  }
@@ -8032,6 +8042,15 @@ var LabelDefinitionSchema = object({
8032
8042
  description: string$2().optional(),
8033
8043
  icon: string$2().optional()
8034
8044
  });
8045
+ var ClassMapDefinitionSchema = object({
8046
+ mapping: record(string$2(), _enum([
8047
+ "person",
8048
+ "vehicle",
8049
+ "animal",
8050
+ "package"
8051
+ ])),
8052
+ preserveOriginal: boolean()
8053
+ });
8035
8054
  var MODEL_FORMATS = [
8036
8055
  "onnx",
8037
8056
  "coreml",
@@ -8115,6 +8134,12 @@ var ModelVariantGroupSchema = object({
8115
8134
  */
8116
8135
  resolution: number().int().positive().optional()
8117
8136
  });
8137
+ var ModelProviderIdSchema = _enum([
8138
+ "camstack",
8139
+ "frigate",
8140
+ "scrypted",
8141
+ "custom"
8142
+ ]);
8118
8143
  var ModelCatalogEntrySchema = object({
8119
8144
  id: string$2(),
8120
8145
  name: string$2(),
@@ -8210,7 +8235,19 @@ var ModelCatalogEntrySchema = object({
8210
8235
  * `id` stays the source of truth for resolution/download/persistence; grouping
8211
8236
  * is a presentation overlay resolved back to an `id`.
8212
8237
  */
8213
- group: ModelVariantGroupSchema.optional()
8238
+ group: ModelVariantGroupSchema.optional(),
8239
+ /**
8240
+ * Catalog source for the pipeline stepper's provider-first picker. Absent on
8241
+ * built-in CamStack entries (treated as `camstack`) and on registry rows
8242
+ * persisted before this field existed (`inferModelProvider` fills those).
8243
+ */
8244
+ provider: ModelProviderIdSchema.optional(),
8245
+ /**
8246
+ * Per-MODEL class map override. Absent ⇒ the step's `StepDefinition.classMap`
8247
+ * applies (Frigate / COCO public catalog). Set on a custom model whose raw
8248
+ * labels already ARE the CamStack macros (Scrypted identity map).
8249
+ */
8250
+ classMap: ClassMapDefinitionSchema.optional()
8214
8251
  });
8215
8252
  var ConvertTargetSchema = discriminatedUnion("format", [object({
8216
8253
  format: literal("openvino"),
@@ -8239,7 +8276,8 @@ var ModelConvertMetadataSchema = object({
8239
8276
  "ocr",
8240
8277
  "segmentation"
8241
8278
  ]),
8242
- faceAlignment: boolean().optional()
8279
+ faceAlignment: boolean().optional(),
8280
+ classMap: ClassMapDefinitionSchema.optional()
8243
8281
  });
8244
8282
  var ConvertResultSchema = object({
8245
8283
  entry: ModelCatalogEntrySchema,
@@ -12062,6 +12100,27 @@ var LinkedDeviceSchema = object({
12062
12100
  features: array(string$2()),
12063
12101
  producesTrackedEvents: boolean().optional()
12064
12102
  });
12103
+ /** One camera's resolved linked set, tagged with the camera it belongs to.
12104
+ * The batch answer needs the tag; the single-device answer already has it
12105
+ * from the input, which is why `getLinkedDevices` keeps the untagged shape. */
12106
+ var LinkedDevicesForDeviceSchema = object({
12107
+ deviceId: number(),
12108
+ mode: LinkedDevicesModeSchema,
12109
+ devices: array(LinkedDeviceSchema)
12110
+ });
12111
+ /** One device's binding map — the shape `getBindings`, `getBindingsBatch` and
12112
+ * `getAllBindings` all answer in. Declared once: three copies of the same
12113
+ * object literal is exactly how the three drift apart. */
12114
+ var DeviceBindingsForDeviceSchema = object({
12115
+ deviceId: number(),
12116
+ entries: array(object({
12117
+ capName: string$2(),
12118
+ kind: _enum(["native", "wrapped"]),
12119
+ providerAddonId: string$2(),
12120
+ providerNodeId: string$2(),
12121
+ nativeAddonId: string$2()
12122
+ }))
12123
+ });
12065
12124
  var SavedDeviceRowSchema = object({
12066
12125
  /** Numeric id reserved at allocateDeviceId time. */
12067
12126
  id: number(),
@@ -12287,11 +12346,25 @@ method(object({
12287
12346
  projection: _enum(["full", "slim"]).optional(),
12288
12347
  /** Return only camera devices. Filtering server-side instead of
12289
12348
  * shipping 293 rows to find 12. */
12290
- isCamera: boolean().optional()
12349
+ isCamera: boolean().optional(),
12350
+ /**
12351
+ * Return only these device ids. For the caller that already KNOWS the
12352
+ * handful it wants and needs a field the id-bearing answer does not
12353
+ * carry — the viewer's linked-devices panel joins `type` and `online`
12354
+ * onto ~8 linked ids and, unfiltered, dragged the fleet across to do
12355
+ * it: 433 KB slim / 958 KB full for 967 devices, on a query that
12356
+ * refetches on the reconcile interval, on a phone.
12357
+ *
12358
+ * Safe to send at a hub that predates it: Zod STRIPS unknown input
12359
+ * keys rather than rejecting them (verified against the live hub
12360
+ * 2026-08-25 — 967 rows came back), so an old hub answers exactly what
12361
+ * it answers today and the caller filters as it already does.
12362
+ */
12363
+ deviceIds: array(number()).optional()
12291
12364
  }), array(DeviceInfoSchema)), method(object({ deviceId: number() }), DeviceInfoSchema.nullable()), method(object({ parentDeviceId: number() }), array(DeviceInfoSchema)), method(object({ deviceId: number() }), object({
12292
12365
  mode: LinkedDevicesModeSchema,
12293
12366
  devices: array(LinkedDeviceSchema)
12294
- })), method(object({ deviceId: number() }), array(StreamSourceEntrySchema$1)), method(object({ deviceId: number() }), array(ConfigEntrySchema)), method(object({ deviceId: number() }), ConfigUISchemaOutput), method(object({
12367
+ })), 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({
12295
12368
  deviceId: number(),
12296
12369
  values: record(string$2(), unknown())
12297
12370
  }), object({ success: literal(true) }), {
@@ -12318,25 +12391,7 @@ method(object({
12318
12391
  }), method(object({ deviceId: number() }), array(StreamProbeResultSchema), {
12319
12392
  kind: "mutation",
12320
12393
  auth: "admin"
12321
- }), method(object({ deviceId: number() }), object({
12322
- deviceId: number(),
12323
- entries: array(object({
12324
- capName: string$2(),
12325
- kind: _enum(["native", "wrapped"]),
12326
- providerAddonId: string$2(),
12327
- providerNodeId: string$2(),
12328
- nativeAddonId: string$2()
12329
- }))
12330
- })), method(object({}), array(object({
12331
- deviceId: number(),
12332
- entries: array(object({
12333
- capName: string$2(),
12334
- kind: _enum(["native", "wrapped"]),
12335
- providerAddonId: string$2(),
12336
- providerNodeId: string$2(),
12337
- nativeAddonId: string$2()
12338
- }))
12339
- }))), method(object({
12394
+ }), method(object({ deviceId: number() }), DeviceBindingsForDeviceSchema), method(object({ deviceIds: array(number()) }), array(DeviceBindingsForDeviceSchema)), method(object({}), array(DeviceBindingsForDeviceSchema)), method(object({
12340
12395
  deviceId: number(),
12341
12396
  capName: string$2(),
12342
12397
  wrapperAddonId: string$2(),
@@ -14746,12 +14801,15 @@ var NcOccupancyConditionSchema = object({
14746
14801
  * there is no second switch that can disagree with the first and every rule
14747
14802
  * authored before the decision migrates for free (`audioModeOf`):
14748
14803
  *
14749
- * - **LABEL mode — `labels` present.** The rule fires on the FIRST frame the
14750
- * classifier labels with one of them. No window, no percentage:
14751
- * `hitPercent` and `samplingSeconds` are ignored, and the rule's own
14752
- * `throttle` cooldown is the only brake. The per-label confidence floor is
14753
- * the analyzer's (`classificationMinScore`, per device) — a label only
14754
- * reaches this condition if the classifier was already confident enough.
14804
+ * - **LABEL mode — `labels` present.** The rule fires when `confirmHits`
14805
+ * labelled frames land inside `confirmWindowSec` (default 2 in 5 s).
14806
+ * `hitPercent` and `samplingSeconds` are still ignored — a percentage of
14807
+ * frames is the wrong question for a classifier that labels 1–3 frames
14808
+ * per episode. The count window is the brake that drops a single-frame
14809
+ * false positive; the rule's own `throttle` cooldown is the other. The
14810
+ * per-label confidence floor is the analyzer's (`classificationMinScore`,
14811
+ * per device) — a label only reaches this condition if the classifier was
14812
+ * already confident enough. `confirmHits: 1` restores first-frame fire.
14755
14813
  * - **LEVEL mode — `dbThreshold` present, no labels.** The sampling window IS
14756
14814
  * the condition: at least `hitPercent`% of the samples over
14757
14815
  * `samplingSeconds` must be at or above `dbThreshold` dBFS (see
@@ -14778,14 +14836,22 @@ var NcOccupancyConditionSchema = object({
14778
14836
  * an operator who typed `dog` mean the same thing.
14779
14837
  */
14780
14838
  var NcAudioConditionSchema = object({
14781
- /** LABEL MODE: audio macro labels. Present ⇒ fires on the first labelled frame. */
14839
+ /** LABEL MODE: audio macro labels. Present ⇒ count-in-window confirm. */
14782
14840
  labels: array(string$2().min(1)).min(1).optional(),
14783
14841
  /** LEVEL MODE: floor in dBFS (negative-going, `0` = full scale). */
14784
14842
  dbThreshold: number().min(-96).max(0).optional(),
14785
14843
  /** LEVEL MODE ONLY: percentage of the window's samples that must be hits (1–100). */
14786
14844
  hitPercent: number().int().min(1).max(100).default(60),
14787
14845
  /** LEVEL MODE ONLY: length of the sampling window in seconds. */
14788
- samplingSeconds: number().int().min(1).max(300).default(10)
14846
+ samplingSeconds: number().int().min(1).max(300).default(10),
14847
+ /**
14848
+ * LABEL MODE: how many labelled frames must land inside
14849
+ * {@link NcAudioConditionSchema.shape.confirmWindowSec} before dispatch.
14850
+ * Absent ⇒ 2 (the matcher default). `1` is first-frame fire.
14851
+ */
14852
+ confirmHits: number().int().min(1).max(20).optional(),
14853
+ /** LABEL MODE: the window those frames must share, in seconds. Absent ⇒ 5. */
14854
+ confirmWindowSec: number().int().min(1).max(60).optional()
14789
14855
  });
14790
14856
  /**
14791
14857
  * Which zone-crossing DIRECTION a rule accepts (`ObjectEvent.zoneCrossing`).
@@ -17159,6 +17225,46 @@ var RecentTracksPageSchema = object({
17159
17225
  /** Cursor for the next page, or null when this page is the last. */
17160
17226
  nextCursor: string$2().nullable()
17161
17227
  });
17228
+ var LIST_GROUPS_DEFAULT_LIMIT = 40;
17229
+ var LIST_GROUPS_MAX_LIMIT = 100;
17230
+ var AnalyticsGroupRecordSchema = object({
17231
+ id: string$2(),
17232
+ deviceId: number().int(),
17233
+ openedAt: number().int(),
17234
+ closedAt: number().int(),
17235
+ timestamp: number().int(),
17236
+ memberCount: number().int(),
17237
+ memberTrackIds: array(string$2()).readonly(),
17238
+ className: string$2(),
17239
+ classes: array(string$2()).readonly(),
17240
+ /** Relative event-media path, or null when the group has no picture yet. */
17241
+ mediaUrl: string$2().nullable(),
17242
+ singleton: boolean()
17243
+ });
17244
+ var AnalyticsGroupMemberSchema = object({
17245
+ trackId: string$2(),
17246
+ deviceId: number().int(),
17247
+ className: string$2(),
17248
+ firstSeen: number().int(),
17249
+ lastSeen: number().int(),
17250
+ mediaUrl: string$2().nullable()
17251
+ });
17252
+ var AnalyticsGroupDetailSchema = AnalyticsGroupRecordSchema.extend({ members: array(AnalyticsGroupMemberSchema).readonly() });
17253
+ var ListGroupsQueryInput = object({
17254
+ /** Devices to merge. An empty array yields `{ groups: [], nextCursor: null }`. */
17255
+ deviceIds: array(number()),
17256
+ /** Window lower bound on `closedAt` (inclusive). */
17257
+ since: number().optional(),
17258
+ /** Window upper bound on `openedAt` (inclusive). */
17259
+ until: number().optional(),
17260
+ limit: number().int().min(1).max(LIST_GROUPS_MAX_LIMIT).default(LIST_GROUPS_DEFAULT_LIMIT),
17261
+ /** Opaque continuation cursor from a previous page's `nextCursor`. */
17262
+ cursor: string$2().optional()
17263
+ });
17264
+ var ListGroupsPageSchema = object({
17265
+ groups: array(AnalyticsGroupRecordSchema).readonly(),
17266
+ nextCursor: string$2().nullable()
17267
+ });
17162
17268
  var KeyEventQueryInput = object({
17163
17269
  deviceId: number(),
17164
17270
  /** Window lower bound (track firstSeen ≥ since). */
@@ -17234,7 +17340,9 @@ var TrackCascadeCountsSchema = object({
17234
17340
  /** Unassigned plate reads removed (best-effort; plate leg deferred to plate-intelligence). */
17235
17341
  plates: number().int(),
17236
17342
  /** Per-track CLIP search vectors removed (best-effort). */
17237
- embeddings: number().int()
17343
+ embeddings: number().int(),
17344
+ /** Group membership + group rows removed with their last member (best-effort). */
17345
+ groups: number().int()
17238
17346
  });
17239
17347
  /** Disk-wins reconcile: media rows whose blobs are gone, then empty tracks. */
17240
17348
  var DiskReconcileCountsSchema = object({
@@ -17380,7 +17488,10 @@ DeviceType.Camera, method(object({ deviceId: number() }), array(TrackSchema).rea
17380
17488
  * stationary registry). Default false: the timeline lists passages,
17381
17489
  * not parking records (operator decision, 2026-08-15). */
17382
17490
  includeStationary: boolean().optional()
17383
- }), array(TrackSchema).readonly()), method(RecentTracksQueryInput, RecentTracksPageSchema), method(object({ deviceId: number() }), _void(), {
17491
+ }), array(TrackSchema).readonly()), method(RecentTracksQueryInput, RecentTracksPageSchema), method(ListGroupsQueryInput, ListGroupsPageSchema), method(object({
17492
+ deviceId: number(),
17493
+ groupId: string$2().min(1)
17494
+ }), AnalyticsGroupDetailSchema.nullable()), method(object({ deviceId: number() }), _void(), {
17384
17495
  kind: "mutation",
17385
17496
  auth: "admin"
17386
17497
  }), 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({
@@ -17598,6 +17709,33 @@ var NativeCropRefSchema = object({
17598
17709
  h: number()
17599
17710
  })
17600
17711
  });
17712
+ object({
17713
+ crop: object({
17714
+ left: number(),
17715
+ top: number(),
17716
+ width: number().positive(),
17717
+ height: number().positive()
17718
+ }).optional(),
17719
+ content: object({
17720
+ width: number().int().positive(),
17721
+ height: number().int().positive()
17722
+ }),
17723
+ fit: _enum(["stretch", "contain"]),
17724
+ format: _enum([
17725
+ "rgb",
17726
+ "gray",
17727
+ "jpeg"
17728
+ ])
17729
+ });
17730
+ var FrameRefSchema = object({
17731
+ registryId: string$2().min(1),
17732
+ id: string$2().min(1),
17733
+ width: number().int().positive(),
17734
+ height: number().int().positive(),
17735
+ format: _enum(["rgb", "gray"]),
17736
+ timestamp: number(),
17737
+ capturedAt: number().optional()
17738
+ });
17601
17739
  var ModelFormatSchema$1 = _enum([
17602
17740
  "onnx",
17603
17741
  "coreml",
@@ -17663,7 +17801,8 @@ var PipelineModelOptionSchema = object({
17663
17801
  sizeMB: number()
17664
17802
  })),
17665
17803
  group: ModelVariantGroupSchema.optional(),
17666
- legacy: boolean().optional()
17804
+ legacy: boolean().optional(),
17805
+ provider: ModelProviderIdSchema.optional()
17667
17806
  });
17668
17807
  var ConfigFieldBridge = custom();
17669
17808
  var PipelineAddonSchemaSchema = object({
@@ -17842,6 +17981,12 @@ method(_void(), array(PipelineEngineChoiceSchema)), method(_void(), PipelineEngi
17842
17981
  steps: array(PipelineStepInputSchema).min(1),
17843
17982
  frame: FrameInputSchema.optional(),
17844
17983
  /**
17984
+ * Process-local lazy frame. Valid only when caller and provider resolve
17985
+ * in the same execution-group process; split/cross-node callers use
17986
+ * `frame`/`image` inline compatibility instead.
17987
+ */
17988
+ frameRef: FrameRefSchema.optional(),
17989
+ /**
17845
17990
  * CB5 shm passthrough — a `FrameHandle` naming the same ring slot
17846
17991
  * the decoded pixels live in. One more member of the one-of
17847
17992
  * frame/frameHandle/image/imageBase64/referenceImage group.
@@ -18137,7 +18282,10 @@ var NativeCropResultSchema = object({
18137
18282
  * Which source served this crop, so a quality-sensitive consumer (the native
18138
18283
  * `keyFrame`) can reject a degraded fallback:
18139
18284
  * - `native` — cut from the decode worker's retained NATIVE surface (the
18140
- * quality path).
18285
+ * quality path). A subject-tile serve is also native-resolution and stays
18286
+ * `native` here: the public enum cannot name `tile` without a breaking cap
18287
+ * change. Runner telemetry distinguishes lease vs tile via `source` on the
18288
+ * internal crop result (`nativeHits` vs `tileHits`).
18141
18289
  * - `ram-fullframe` — the native surface MISSED but the request was full-frame,
18142
18290
  * so the ≤640 RAM `RetainedFrameStore` served it (honest lower-res; legit for
18143
18291
  * the blank-frame guard / 640-snapshot resolve, NOT for the clean keyFrame).
@@ -18628,12 +18776,41 @@ var RunnerLocalLoadSchema = object({
18628
18776
  * legacy `OrchestratorMetricsSchema` shape so existing dashboards keep
18629
18777
  * working unchanged when they switch to reading from the runner cap.
18630
18778
  */
18779
+ var FrameLazyCountersSchema = object({
18780
+ framesDecoded: number(),
18781
+ framesAdmitted: number(),
18782
+ framesDroppedPixelFree: number(),
18783
+ viewsMaterialized: number(),
18784
+ viewsSkipped: number(),
18785
+ workerToRunnerBytes: number(),
18786
+ runnerToPoolRawBytes: number(),
18787
+ runnerToPoolJpegBytes: number(),
18788
+ onDemandFullFrameRequests: number(),
18789
+ onDemandCropRequests: number(),
18790
+ nativeHits: number(),
18791
+ nativeMisses: number(),
18792
+ tileHits: number(),
18793
+ tileMisses: number(),
18794
+ fallbackHits: number(),
18795
+ fallbackMisses: number(),
18796
+ retainedWritesAvoided: number(),
18797
+ residentRefs: number(),
18798
+ residentBytes: number(),
18799
+ releases: number(),
18800
+ evictions: number(),
18801
+ staleMisses: number()
18802
+ });
18803
+ var FrameLazyMetricsSchema = object({
18804
+ node: FrameLazyCountersSchema,
18805
+ cameras: array(FrameLazyCountersSchema.extend({ deviceId: number() }))
18806
+ });
18631
18807
  var RunnerLocalMetricsSchema = object({
18632
18808
  nodeId: string$2(),
18633
18809
  activeCameras: number(),
18634
18810
  throttledCameras: number(),
18635
18811
  avgInferenceTimeMs: number(),
18636
- queueDepth: number()
18812
+ queueDepth: number(),
18813
+ frameLazy: FrameLazyMetricsSchema.optional()
18637
18814
  });
18638
18815
  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({
18639
18816
  handle: FrameHandleSchema,
@@ -19933,6 +20110,9 @@ method(_void(), ProviderInfoSchema), method(object({ config: record(string$2(),
19933
20110
  location: StorageLocationSchema,
19934
20111
  relativePath: string$2()
19935
20112
  }), _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" });
20113
+ /** Profile-exported FormBuilder schema. Shape is ConfigUISchema at the UI. */
20114
+ var ProfileSettingsSchemaBridge = unknown().nullable();
20115
+ var ProfileSettingsBagSchema = record(string$2(), unknown());
19936
20116
  /**
19937
20117
  * A live terminal session hosted by the provider addon. Output and input do
19938
20118
  * NOT flow through the capability — they use the addon data plane
@@ -19962,7 +20142,14 @@ var TerminalSessionInfoSchema = object({
19962
20142
  var TerminalProfileInfoSchema = object({
19963
20143
  profileId: string$2(),
19964
20144
  label: string$2(),
19965
- description: string$2().optional()
20145
+ description: string$2().optional(),
20146
+ /** Spawn defaults the instance form copies on create. */
20147
+ executable: string$2().optional(),
20148
+ args: array(string$2()).readonly().optional(),
20149
+ cwd: string$2().optional(),
20150
+ environment: array(string$2()).readonly().optional(),
20151
+ /** ConfigUISchema for instance knobs, or null when the profile has none. */
20152
+ settingsSchema: ProfileSettingsSchemaBridge.optional()
19966
20153
  });
19967
20154
  /**
19968
20155
  * A durable operator-created Terminal instance. Profiles are templates; only
@@ -19975,7 +20162,12 @@ var TerminalInstanceInfoSchema = object({
19975
20162
  profileId: string$2(),
19976
20163
  profileLabel: string$2(),
19977
20164
  name: string$2(),
19978
- enabled: boolean()
20165
+ enabled: boolean(),
20166
+ executable: string$2(),
20167
+ args: array(string$2()).readonly(),
20168
+ cwd: string$2(),
20169
+ environment: array(string$2()).readonly(),
20170
+ profileSettings: ProfileSettingsBagSchema
19979
20171
  });
19980
20172
  var TerminalLegacyCameraSchema = object({
19981
20173
  stableId: string$2(),
@@ -20005,7 +20197,23 @@ var TerminalOutputBatchSchema = object({
20005
20197
  method(_void(), array(TerminalProfileInfoSchema).readonly(), { auth: "admin" }), method(_void(), array(TerminalInstanceInfoSchema).readonly(), { auth: "admin" }), method(object({
20006
20198
  targetNodeId: string$2().min(1),
20007
20199
  profileId: string$2().min(1),
20008
- name: string$2().trim().min(1).max(160).optional()
20200
+ name: string$2().trim().min(1).max(160).optional(),
20201
+ executable: string$2().max(1024).optional(),
20202
+ args: array(string$2().max(2048)).max(64).optional(),
20203
+ cwd: string$2().max(1024).optional(),
20204
+ environment: array(string$2().max(4096)).max(64).optional(),
20205
+ profileSettings: ProfileSettingsBagSchema.optional()
20206
+ }), TerminalInstanceInfoSchema, {
20207
+ kind: "mutation",
20208
+ auth: "admin"
20209
+ }), method(object({
20210
+ instanceId: string$2().min(1),
20211
+ name: string$2().trim().min(1).max(160).optional(),
20212
+ executable: string$2().max(1024).optional(),
20213
+ args: array(string$2().max(2048)).max(64).optional(),
20214
+ cwd: string$2().max(1024).optional(),
20215
+ environment: array(string$2().max(4096)).max(64).optional(),
20216
+ profileSettings: ProfileSettingsBagSchema.optional()
20009
20217
  }), TerminalInstanceInfoSchema, {
20010
20218
  kind: "mutation",
20011
20219
  auth: "admin"
@@ -20027,7 +20235,11 @@ method(_void(), array(TerminalProfileInfoSchema).readonly(), { auth: "admin" }),
20027
20235
  }), method(_void(), array(TerminalSessionInfoSchema).readonly(), { auth: "admin" }), method(object({
20028
20236
  profileId: string$2(),
20029
20237
  cols: number().int().positive(),
20030
- rows: number().int().positive()
20238
+ rows: number().int().positive(),
20239
+ executable: string$2().max(1024).optional(),
20240
+ args: array(string$2().max(2048)).max(64).optional(),
20241
+ cwd: string$2().max(1024).optional(),
20242
+ environment: array(string$2().max(4096)).max(64).optional()
20031
20243
  }), TerminalSessionInfoSchema, {
20032
20244
  kind: "mutation",
20033
20245
  auth: "admin"
@@ -23919,10 +24131,10 @@ var lawnMowerControlCapability = {
23919
24131
  *
23920
24132
  * • The SDK (mobile / web client) consumes `getConnectionEndpoints()`
23921
24133
  * to receive an ordered list of candidate base URLs it should race
23922
- * on connect — LAN IPv4 first (lowest latency when on same network),
23923
- * then public hostname (if a tunnel is up), then IPv6. The SDK can
23924
- * race them with short timeouts and stick with the winner for the
23925
- * session.
24134
+ * on connect — LAN IPv4 and stable LAN IPv6 first (lowest latency
24135
+ * when on the same network), then public hostname (if a tunnel is
24136
+ * up). The SDK can race them with short timeouts and stick with the
24137
+ * winner for the session.
23926
24138
  *
23927
24139
  * Why hub-only: agents are not directly addressable by the operator's
23928
24140
  * clients — they reverse-connect to the hub. Exposing their interfaces
@@ -24077,6 +24289,17 @@ var NotificationEndpointSchema = object({
24077
24289
  /** What the ranking currently resolves to (null when nothing is reachable). */
24078
24290
  resolved: string$2().nullable()
24079
24291
  });
24292
+ /**
24293
+ * The URLs the SDK / viewer should race for API access. `baseUrls` empty =
24294
+ * AUTO (every LAN IPv4 + the public tunnel). `resolved` is what that choice
24295
+ * currently expands to, so the UI can show the effective set either way.
24296
+ */
24297
+ var ViewerEndpointsSchema = object({
24298
+ /** The operator's explicit race set, or empty for AUTO. */
24299
+ baseUrls: array(string$2()).readonly(),
24300
+ /** What the ranking currently resolves to (may be empty if nothing is up). */
24301
+ resolved: array(string$2()).readonly()
24302
+ });
24080
24303
  var AllowedAddressesSchema = object({
24081
24304
  /**
24082
24305
  * Allowlist of interface addresses operators have explicitly opted
@@ -24085,6 +24308,20 @@ var AllowedAddressesSchema = object({
24085
24308
  * Network Addresses admin page and persisted by the addon.
24086
24309
  */
24087
24310
  addresses: array(string$2()).readonly() });
24311
+ var TlsStatusSchema = object({
24312
+ mode: _enum([
24313
+ "generated",
24314
+ "uploaded",
24315
+ "disabled"
24316
+ ]),
24317
+ leafFingerprintSha256: string$2().nullable(),
24318
+ caFingerprintSha256: string$2().nullable(),
24319
+ validTo: string$2().nullable(),
24320
+ sans: array(string$2()),
24321
+ caCertPem: string$2().nullable(),
24322
+ reissueError: string$2().nullable(),
24323
+ restartRequired: boolean()
24324
+ });
24088
24325
  method(_void(), ListResultSchema), method(_void(), PreferredSchema), method(object({
24089
24326
  /**
24090
24327
  * LEGACY HINT — do not send from new code. Kept optional so clients
@@ -24094,17 +24331,31 @@ method(_void(), ListResultSchema), method(_void(), PreferredSchema), method(obje
24094
24331
  */
24095
24332
  port: number().int().min(1).max(65535).optional(),
24096
24333
  /** Include `http(s)://127.0.0.1:<port>` as the lowest-priority
24097
- * candidate. Default `true`. */
24334
+ * candidate. Default `false` — loopback is not a client route. */
24098
24335
  includeLoopback: boolean().optional(),
24099
- /** Skip IPv6 entries. Some legacy clients can't parse them.
24100
- * Default `false`. */
24336
+ /** Skip IPv6 entries. Default `false` — the palette includes stable
24337
+ * LAN IPv6 (ICE/WebRTC uses dual-stack regardless). Pass `true` to
24338
+ * hide them. The viewer HTTP/WS race is `getViewerEndpoints`. */
24101
24339
  ipv4Only: boolean().optional(),
24102
24340
  /** Scheme to emit for LAN/loopback URLs. Default `'http'`.
24103
24341
  * Pass `'https'` when the caller is itself loaded over HTTPS
24104
24342
  * to avoid mixed-content blocks in the browser. The public
24105
24343
  * tunnel always emits `https://` regardless. */
24106
24344
  scheme: _enum(["http", "https"]).optional()
24107
- }), GetConnectionEndpointsResultSchema), method(_void(), NotificationEndpointSchema), method(object({ baseUrl: string$2().nullable() }), NotificationEndpointSchema, { kind: "mutation" }), method(_void(), AllowedAddressesSchema), method(AllowedAddressesSchema, object({ success: literal(true) }), { kind: "mutation" }), method(_void(), AllowedAddressesSchema, { kind: "mutation" });
24345
+ }), GetConnectionEndpointsResultSchema), method(_void(), NotificationEndpointSchema), method(object({ baseUrl: string$2().nullable() }), NotificationEndpointSchema, { kind: "mutation" }), method(_void(), ViewerEndpointsSchema), method(object({ baseUrls: array(string$2()).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$2().optional() }), TlsStatusSchema, {
24346
+ kind: "mutation",
24347
+ auth: "admin"
24348
+ }), method(object({
24349
+ certPem: string$2().min(1),
24350
+ keyPem: string$2().min(1),
24351
+ caPem: string$2().optional()
24352
+ }), TlsStatusSchema, {
24353
+ kind: "mutation",
24354
+ auth: "admin"
24355
+ }), method(_void(), object({ pem: string$2() })), method(_void(), TlsStatusSchema, {
24356
+ kind: "mutation",
24357
+ auth: "admin"
24358
+ });
24108
24359
  var LockControlStatusSchema = object({
24109
24360
  /** Lifecycle state of the lock. `jammed` means the motor reported
24110
24361
  * failure to reach the target — operator intervention required. */
@@ -25665,7 +25916,12 @@ var PlateInfoSchema = object({
25665
25916
  plateBbox: BoundingBoxSchema.optional(),
25666
25917
  /** keyFrame parity: MediaStore key of the track's native-resolution key frame. */
25667
25918
  keyFrameMediaKey: string$2().optional(),
25668
- base64: string$2().optional()
25919
+ base64: string$2().optional(),
25920
+ /**
25921
+ * Same crop as a data-plane URL. `getPlateByTrack` returns this and
25922
+ * never inlines JPEG; `listPlates` still inlines for the admin-ui.
25923
+ */
25924
+ cropUrl: string$2().optional()
25669
25925
  });
25670
25926
  var MediaFileLiteSchema = object({
25671
25927
  key: string$2(),
@@ -31189,6 +31445,12 @@ Object.freeze({
31189
31445
  addonId: null,
31190
31446
  access: "view"
31191
31447
  },
31448
+ "deviceManager.getBindingsBatch": {
31449
+ capName: "device-manager",
31450
+ capScope: "system",
31451
+ addonId: null,
31452
+ access: "view"
31453
+ },
31192
31454
  "deviceManager.getChildren": {
31193
31455
  capName: "device-manager",
31194
31456
  capScope: "system",
@@ -31249,6 +31511,12 @@ Object.freeze({
31249
31511
  addonId: null,
31250
31512
  access: "view"
31251
31513
  },
31514
+ "deviceManager.getLinkedDevicesBatch": {
31515
+ capName: "device-manager",
31516
+ capScope: "system",
31517
+ addonId: null,
31518
+ access: "view"
31519
+ },
31252
31520
  "deviceManager.getRoleDisplayDefaults": {
31253
31521
  capName: "device-manager",
31254
31522
  capScope: "system",
@@ -32131,6 +32399,12 @@ Object.freeze({
32131
32399
  addonId: null,
32132
32400
  access: "create"
32133
32401
  },
32402
+ "localNetwork.downloadCa": {
32403
+ capName: "local-network",
32404
+ capScope: "system",
32405
+ addonId: null,
32406
+ access: "view"
32407
+ },
32134
32408
  "localNetwork.getAllowedAddresses": {
32135
32409
  capName: "local-network",
32136
32410
  capScope: "system",
@@ -32155,18 +32429,42 @@ Object.freeze({
32155
32429
  addonId: null,
32156
32430
  access: "view"
32157
32431
  },
32432
+ "localNetwork.getTlsStatus": {
32433
+ capName: "local-network",
32434
+ capScope: "system",
32435
+ addonId: null,
32436
+ access: "view"
32437
+ },
32438
+ "localNetwork.getViewerEndpoints": {
32439
+ capName: "local-network",
32440
+ capScope: "system",
32441
+ addonId: null,
32442
+ access: "view"
32443
+ },
32158
32444
  "localNetwork.list": {
32159
32445
  capName: "local-network",
32160
32446
  capScope: "system",
32161
32447
  addonId: null,
32162
32448
  access: "view"
32163
32449
  },
32450
+ "localNetwork.regenerateCertificate": {
32451
+ capName: "local-network",
32452
+ capScope: "system",
32453
+ addonId: null,
32454
+ access: "create"
32455
+ },
32164
32456
  "localNetwork.resetAllowlistToBestMatch": {
32165
32457
  capName: "local-network",
32166
32458
  capScope: "system",
32167
32459
  addonId: null,
32168
32460
  access: "delete"
32169
32461
  },
32462
+ "localNetwork.revertToGeneratedCertificate": {
32463
+ capName: "local-network",
32464
+ capScope: "system",
32465
+ addonId: null,
32466
+ access: "create"
32467
+ },
32170
32468
  "localNetwork.setAllowedAddresses": {
32171
32469
  capName: "local-network",
32172
32470
  capScope: "system",
@@ -32179,6 +32477,18 @@ Object.freeze({
32179
32477
  addonId: null,
32180
32478
  access: "create"
32181
32479
  },
32480
+ "localNetwork.setViewerEndpoints": {
32481
+ capName: "local-network",
32482
+ capScope: "system",
32483
+ addonId: null,
32484
+ access: "create"
32485
+ },
32486
+ "localNetwork.uploadCertificate": {
32487
+ capName: "local-network",
32488
+ capScope: "system",
32489
+ addonId: null,
32490
+ access: "create"
32491
+ },
32182
32492
  "lockControl.lock": {
32183
32493
  capName: "lock-control",
32184
32494
  capScope: "device",
@@ -32977,6 +33287,12 @@ Object.freeze({
32977
33287
  addonId: null,
32978
33288
  access: "view"
32979
33289
  },
33290
+ "pipelineAnalytics.getGroup": {
33291
+ capName: "pipeline-analytics",
33292
+ capScope: "device",
33293
+ addonId: null,
33294
+ access: "view"
33295
+ },
32980
33296
  "pipelineAnalytics.getKeyEvents": {
32981
33297
  capName: "pipeline-analytics",
32982
33298
  capScope: "device",
@@ -33061,6 +33377,12 @@ Object.freeze({
33061
33377
  addonId: null,
33062
33378
  access: "view"
33063
33379
  },
33380
+ "pipelineAnalytics.listGroups": {
33381
+ capName: "pipeline-analytics",
33382
+ capScope: "device",
33383
+ addonId: null,
33384
+ access: "view"
33385
+ },
33064
33386
  "pipelineAnalytics.listOpsLog": {
33065
33387
  capName: "pipeline-analytics",
33066
33388
  capScope: "device",
@@ -35059,6 +35381,12 @@ Object.freeze({
35059
35381
  addonId: null,
35060
35382
  access: "create"
35061
35383
  },
35384
+ "terminalSession.updateInstance": {
35385
+ capName: "terminal-session",
35386
+ capScope: "system",
35387
+ addonId: null,
35388
+ access: "create"
35389
+ },
35062
35390
  "terminalSession.writeInput": {
35063
35391
  capName: "terminal-session",
35064
35392
  capScope: "system",
@@ -35836,6 +36164,11 @@ Object.freeze({
35836
36164
  form: "single",
35837
36165
  optional: false
35838
36166
  }],
36167
+ "deviceManager.getBindingsBatch": [{
36168
+ name: "deviceIds",
36169
+ form: "array",
36170
+ optional: false
36171
+ }],
35839
36172
  "deviceManager.getChildren": [{
35840
36173
  name: "parentDeviceId",
35841
36174
  form: "single",
@@ -35881,6 +36214,11 @@ Object.freeze({
35881
36214
  form: "single",
35882
36215
  optional: false
35883
36216
  }],
36217
+ "deviceManager.getLinkedDevicesBatch": [{
36218
+ name: "deviceIds",
36219
+ form: "array",
36220
+ optional: false
36221
+ }],
35884
36222
  "deviceManager.getSettingsSchema": [{
35885
36223
  name: "deviceId",
35886
36224
  form: "single",
@@ -35901,6 +36239,11 @@ Object.freeze({
35901
36239
  form: "single",
35902
36240
  optional: false
35903
36241
  }],
36242
+ "deviceManager.listAll": [{
36243
+ name: "deviceIds",
36244
+ form: "array",
36245
+ optional: true
36246
+ }],
35904
36247
  "deviceManager.loadConfig": [{
35905
36248
  name: "deviceId",
35906
36249
  form: "single",
@@ -36474,6 +36817,11 @@ Object.freeze({
36474
36817
  form: "single",
36475
36818
  optional: false
36476
36819
  }],
36820
+ "pipelineAnalytics.getGroup": [{
36821
+ name: "deviceId",
36822
+ form: "single",
36823
+ optional: false
36824
+ }],
36477
36825
  "pipelineAnalytics.getKeyEvents": [{
36478
36826
  name: "deviceId",
36479
36827
  form: "single",
@@ -36529,6 +36877,11 @@ Object.freeze({
36529
36877
  form: "array",
36530
36878
  optional: false
36531
36879
  }],
36880
+ "pipelineAnalytics.listGroups": [{
36881
+ name: "deviceIds",
36882
+ form: "array",
36883
+ optional: false
36884
+ }],
36532
36885
  "pipelineAnalytics.listOpsLog": [{
36533
36886
  name: "deviceId",
36534
36887
  form: "single",
@@ -37546,6 +37899,35 @@ Object.freeze(Object.fromEntries([{
37546
37899
  }]
37547
37900
  }].map((s) => [s.stepId, s.defaultModelId])));
37548
37901
  string$2().min(1);
37902
+ var CLUSTER_STEP_SETTING_FIELDS = [{
37903
+ stepId: "face-embedding",
37904
+ key: "minLandmarkFaceSize",
37905
+ label: "Min face size for recognition (detection px)",
37906
+ 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.",
37907
+ type: "slider",
37908
+ min: 0,
37909
+ max: 64,
37910
+ step: 2,
37911
+ default: 24
37912
+ }];
37913
+ function clusterStepSettingKey(stepId, fieldKey) {
37914
+ return `clusterStepSetting:${stepId}:${fieldKey}`;
37915
+ }
37916
+ var ClusterSettingNumberSchema = number().finite();
37917
+ function readClusterStepSettings(config) {
37918
+ const out = {};
37919
+ for (const field of CLUSTER_STEP_SETTING_FIELDS) {
37920
+ const parsed = ClusterSettingNumberSchema.safeParse(config[clusterStepSettingKey(field.stepId, field.key)]);
37921
+ const value = parsed.success ? parsed.data : field.default;
37922
+ const existing = out[field.stepId] ?? {};
37923
+ out[field.stepId] = {
37924
+ ...existing,
37925
+ [field.key]: value
37926
+ };
37927
+ }
37928
+ return out;
37929
+ }
37930
+ readClusterStepSettings({});
37549
37931
  object({
37550
37932
  /**
37551
37933
  * Fraction of the box's own size added on EACH side before cutting.