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