@camstack/addon-provider-homeassistant 1.2.39 → 1.2.41

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.
@@ -5800,6 +5800,13 @@ var BaseAddon = class {
5800
5800
  _readinessGeneration = typeof crypto !== "undefined" && crypto.randomUUID ? crypto.randomUUID() : Math.random().toString(36).slice(2, 14);
5801
5801
  /** Capability names this addon registered at init — used to emit matching `down` events on shutdown. */
5802
5802
  _registeredCapNames = [];
5803
+ /**
5804
+ * True only after `readAddonStore` actually answered. Constructor
5805
+ * defaults look like stored config when the store is down — a forked
5806
+ * addon that auto-starts from those defaults (cloudflare-tunnel quick
5807
+ * mode, 2026-08-25) is not "the operator chose this".
5808
+ */
5809
+ settingsStoreReady = false;
5803
5810
  /** Default config values. Provided via constructor. */
5804
5811
  defaults;
5805
5812
  constructor(defaults) {
@@ -6200,7 +6207,9 @@ var BaseAddon = class {
6200
6207
  ];
6201
6208
  let lastErr;
6202
6209
  for (let attempt = 0; attempt <= delaysMs.length; attempt++) try {
6203
- return await settings.readAddonStore() ?? {};
6210
+ const stored = await settings.readAddonStore() ?? {};
6211
+ this.settingsStoreReady = true;
6212
+ return stored;
6204
6213
  } catch (err) {
6205
6214
  lastErr = err;
6206
6215
  const msg = err instanceof Error ? err.message : String(err);
@@ -6208,6 +6217,7 @@ var BaseAddon = class {
6208
6217
  if (attempt === delaysMs.length) break;
6209
6218
  await new Promise((r) => setTimeout(r, delaysMs[attempt]));
6210
6219
  }
6220
+ this.settingsStoreReady = false;
6211
6221
  this._ctx?.logger?.warn?.("readAddonStore: settings-store unavailable after retries — using defaults", { meta: { error: lastErr instanceof Error ? lastErr.message : String(lastErr) } });
6212
6222
  return {};
6213
6223
  }
@@ -8138,6 +8148,15 @@ var LabelDefinitionSchema = object({
8138
8148
  description: string().optional(),
8139
8149
  icon: string().optional()
8140
8150
  });
8151
+ var ClassMapDefinitionSchema = object({
8152
+ mapping: record(string(), _enum([
8153
+ "person",
8154
+ "vehicle",
8155
+ "animal",
8156
+ "package"
8157
+ ])),
8158
+ preserveOriginal: boolean()
8159
+ });
8141
8160
  var MODEL_FORMATS = [
8142
8161
  "onnx",
8143
8162
  "coreml",
@@ -8221,6 +8240,12 @@ var ModelVariantGroupSchema = object({
8221
8240
  */
8222
8241
  resolution: number().int().positive().optional()
8223
8242
  });
8243
+ var ModelProviderIdSchema = _enum([
8244
+ "camstack",
8245
+ "frigate",
8246
+ "scrypted",
8247
+ "custom"
8248
+ ]);
8224
8249
  var ModelCatalogEntrySchema = object({
8225
8250
  id: string(),
8226
8251
  name: string(),
@@ -8316,7 +8341,19 @@ var ModelCatalogEntrySchema = object({
8316
8341
  * `id` stays the source of truth for resolution/download/persistence; grouping
8317
8342
  * is a presentation overlay resolved back to an `id`.
8318
8343
  */
8319
- group: ModelVariantGroupSchema.optional()
8344
+ group: ModelVariantGroupSchema.optional(),
8345
+ /**
8346
+ * Catalog source for the pipeline stepper's provider-first picker. Absent on
8347
+ * built-in CamStack entries (treated as `camstack`) and on registry rows
8348
+ * persisted before this field existed (`inferModelProvider` fills those).
8349
+ */
8350
+ provider: ModelProviderIdSchema.optional(),
8351
+ /**
8352
+ * Per-MODEL class map override. Absent ⇒ the step's `StepDefinition.classMap`
8353
+ * applies (Frigate / COCO public catalog). Set on a custom model whose raw
8354
+ * labels already ARE the CamStack macros (Scrypted identity map).
8355
+ */
8356
+ classMap: ClassMapDefinitionSchema.optional()
8320
8357
  });
8321
8358
  var ConvertTargetSchema = discriminatedUnion("format", [object({
8322
8359
  format: literal("openvino"),
@@ -8345,7 +8382,8 @@ var ModelConvertMetadataSchema = object({
8345
8382
  "ocr",
8346
8383
  "segmentation"
8347
8384
  ]),
8348
- faceAlignment: boolean().optional()
8385
+ faceAlignment: boolean().optional(),
8386
+ classMap: ClassMapDefinitionSchema.optional()
8349
8387
  });
8350
8388
  var ConvertResultSchema = object({
8351
8389
  entry: ModelCatalogEntrySchema,
@@ -12257,6 +12295,27 @@ var LinkedDeviceSchema = object({
12257
12295
  features: array(string()),
12258
12296
  producesTrackedEvents: boolean().optional()
12259
12297
  });
12298
+ /** One camera's resolved linked set, tagged with the camera it belongs to.
12299
+ * The batch answer needs the tag; the single-device answer already has it
12300
+ * from the input, which is why `getLinkedDevices` keeps the untagged shape. */
12301
+ var LinkedDevicesForDeviceSchema = object({
12302
+ deviceId: number(),
12303
+ mode: LinkedDevicesModeSchema,
12304
+ devices: array(LinkedDeviceSchema)
12305
+ });
12306
+ /** One device's binding map — the shape `getBindings`, `getBindingsBatch` and
12307
+ * `getAllBindings` all answer in. Declared once: three copies of the same
12308
+ * object literal is exactly how the three drift apart. */
12309
+ var DeviceBindingsForDeviceSchema = object({
12310
+ deviceId: number(),
12311
+ entries: array(object({
12312
+ capName: string(),
12313
+ kind: _enum(["native", "wrapped"]),
12314
+ providerAddonId: string(),
12315
+ providerNodeId: string(),
12316
+ nativeAddonId: string()
12317
+ }))
12318
+ });
12260
12319
  var SavedDeviceRowSchema = object({
12261
12320
  /** Numeric id reserved at allocateDeviceId time. */
12262
12321
  id: number(),
@@ -12482,11 +12541,25 @@ method(object({
12482
12541
  projection: _enum(["full", "slim"]).optional(),
12483
12542
  /** Return only camera devices. Filtering server-side instead of
12484
12543
  * shipping 293 rows to find 12. */
12485
- isCamera: boolean().optional()
12544
+ isCamera: boolean().optional(),
12545
+ /**
12546
+ * Return only these device ids. For the caller that already KNOWS the
12547
+ * handful it wants and needs a field the id-bearing answer does not
12548
+ * carry — the viewer's linked-devices panel joins `type` and `online`
12549
+ * onto ~8 linked ids and, unfiltered, dragged the fleet across to do
12550
+ * it: 433 KB slim / 958 KB full for 967 devices, on a query that
12551
+ * refetches on the reconcile interval, on a phone.
12552
+ *
12553
+ * Safe to send at a hub that predates it: Zod STRIPS unknown input
12554
+ * keys rather than rejecting them (verified against the live hub
12555
+ * 2026-08-25 — 967 rows came back), so an old hub answers exactly what
12556
+ * it answers today and the caller filters as it already does.
12557
+ */
12558
+ deviceIds: array(number()).optional()
12486
12559
  }), array(DeviceInfoSchema)), method(object({ deviceId: number() }), DeviceInfoSchema.nullable()), method(object({ parentDeviceId: number() }), array(DeviceInfoSchema)), method(object({ deviceId: number() }), object({
12487
12560
  mode: LinkedDevicesModeSchema,
12488
12561
  devices: array(LinkedDeviceSchema)
12489
- })), method(object({ deviceId: number() }), array(StreamSourceEntrySchema$1)), method(object({ deviceId: number() }), array(ConfigEntrySchema)), method(object({ deviceId: number() }), ConfigUISchemaOutput), method(object({
12562
+ })), 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({
12490
12563
  deviceId: number(),
12491
12564
  values: record(string(), unknown())
12492
12565
  }), object({ success: literal(true) }), {
@@ -12513,25 +12586,7 @@ method(object({
12513
12586
  }), method(object({ deviceId: number() }), array(StreamProbeResultSchema), {
12514
12587
  kind: "mutation",
12515
12588
  auth: "admin"
12516
- }), method(object({ deviceId: number() }), object({
12517
- deviceId: number(),
12518
- entries: array(object({
12519
- capName: string(),
12520
- kind: _enum(["native", "wrapped"]),
12521
- providerAddonId: string(),
12522
- providerNodeId: string(),
12523
- nativeAddonId: string()
12524
- }))
12525
- })), method(object({}), array(object({
12526
- deviceId: number(),
12527
- entries: array(object({
12528
- capName: string(),
12529
- kind: _enum(["native", "wrapped"]),
12530
- providerAddonId: string(),
12531
- providerNodeId: string(),
12532
- nativeAddonId: string()
12533
- }))
12534
- }))), method(object({
12589
+ }), method(object({ deviceId: number() }), DeviceBindingsForDeviceSchema), method(object({ deviceIds: array(number()) }), array(DeviceBindingsForDeviceSchema)), method(object({}), array(DeviceBindingsForDeviceSchema)), method(object({
12535
12590
  deviceId: number(),
12536
12591
  capName: string(),
12537
12592
  wrapperAddonId: string(),
@@ -14955,12 +15010,15 @@ var NcOccupancyConditionSchema = object({
14955
15010
  * there is no second switch that can disagree with the first and every rule
14956
15011
  * authored before the decision migrates for free (`audioModeOf`):
14957
15012
  *
14958
- * - **LABEL mode — `labels` present.** The rule fires on the FIRST frame the
14959
- * classifier labels with one of them. No window, no percentage:
14960
- * `hitPercent` and `samplingSeconds` are ignored, and the rule's own
14961
- * `throttle` cooldown is the only brake. The per-label confidence floor is
14962
- * the analyzer's (`classificationMinScore`, per device) a label only
14963
- * reaches this condition if the classifier was already confident enough.
15013
+ * - **LABEL mode — `labels` present.** The rule fires when `confirmHits`
15014
+ * labelled frames land inside `confirmWindowSec` (default 2 in 5 s).
15015
+ * `hitPercent` and `samplingSeconds` are still ignored a percentage of
15016
+ * frames is the wrong question for a classifier that labels 1–3 frames
15017
+ * per episode. The count window is the brake that drops a single-frame
15018
+ * false positive; the rule's own `throttle` cooldown is the other. The
15019
+ * per-label confidence floor is the analyzer's (`classificationMinScore`,
15020
+ * per device) — a label only reaches this condition if the classifier was
15021
+ * already confident enough. `confirmHits: 1` restores first-frame fire.
14964
15022
  * - **LEVEL mode — `dbThreshold` present, no labels.** The sampling window IS
14965
15023
  * the condition: at least `hitPercent`% of the samples over
14966
15024
  * `samplingSeconds` must be at or above `dbThreshold` dBFS (see
@@ -14987,14 +15045,22 @@ var NcOccupancyConditionSchema = object({
14987
15045
  * an operator who typed `dog` mean the same thing.
14988
15046
  */
14989
15047
  var NcAudioConditionSchema = object({
14990
- /** LABEL MODE: audio macro labels. Present ⇒ fires on the first labelled frame. */
15048
+ /** LABEL MODE: audio macro labels. Present ⇒ count-in-window confirm. */
14991
15049
  labels: array(string().min(1)).min(1).optional(),
14992
15050
  /** LEVEL MODE: floor in dBFS (negative-going, `0` = full scale). */
14993
15051
  dbThreshold: number().min(-96).max(0).optional(),
14994
15052
  /** LEVEL MODE ONLY: percentage of the window's samples that must be hits (1–100). */
14995
15053
  hitPercent: number().int().min(1).max(100).default(60),
14996
15054
  /** LEVEL MODE ONLY: length of the sampling window in seconds. */
14997
- samplingSeconds: number().int().min(1).max(300).default(10)
15055
+ samplingSeconds: number().int().min(1).max(300).default(10),
15056
+ /**
15057
+ * LABEL MODE: how many labelled frames must land inside
15058
+ * {@link NcAudioConditionSchema.shape.confirmWindowSec} before dispatch.
15059
+ * Absent ⇒ 2 (the matcher default). `1` is first-frame fire.
15060
+ */
15061
+ confirmHits: number().int().min(1).max(20).optional(),
15062
+ /** LABEL MODE: the window those frames must share, in seconds. Absent ⇒ 5. */
15063
+ confirmWindowSec: number().int().min(1).max(60).optional()
14998
15064
  });
14999
15065
  /**
15000
15066
  * Which zone-crossing DIRECTION a rule accepts (`ObjectEvent.zoneCrossing`).
@@ -17374,6 +17440,46 @@ var RecentTracksPageSchema = object({
17374
17440
  /** Cursor for the next page, or null when this page is the last. */
17375
17441
  nextCursor: string().nullable()
17376
17442
  });
17443
+ var LIST_GROUPS_DEFAULT_LIMIT = 40;
17444
+ var LIST_GROUPS_MAX_LIMIT = 100;
17445
+ var AnalyticsGroupRecordSchema = object({
17446
+ id: string(),
17447
+ deviceId: number().int(),
17448
+ openedAt: number().int(),
17449
+ closedAt: number().int(),
17450
+ timestamp: number().int(),
17451
+ memberCount: number().int(),
17452
+ memberTrackIds: array(string()).readonly(),
17453
+ className: string(),
17454
+ classes: array(string()).readonly(),
17455
+ /** Relative event-media path, or null when the group has no picture yet. */
17456
+ mediaUrl: string().nullable(),
17457
+ singleton: boolean()
17458
+ });
17459
+ var AnalyticsGroupMemberSchema = object({
17460
+ trackId: string(),
17461
+ deviceId: number().int(),
17462
+ className: string(),
17463
+ firstSeen: number().int(),
17464
+ lastSeen: number().int(),
17465
+ mediaUrl: string().nullable()
17466
+ });
17467
+ var AnalyticsGroupDetailSchema = AnalyticsGroupRecordSchema.extend({ members: array(AnalyticsGroupMemberSchema).readonly() });
17468
+ var ListGroupsQueryInput = object({
17469
+ /** Devices to merge. An empty array yields `{ groups: [], nextCursor: null }`. */
17470
+ deviceIds: array(number()),
17471
+ /** Window lower bound on `closedAt` (inclusive). */
17472
+ since: number().optional(),
17473
+ /** Window upper bound on `openedAt` (inclusive). */
17474
+ until: number().optional(),
17475
+ limit: number().int().min(1).max(LIST_GROUPS_MAX_LIMIT).default(LIST_GROUPS_DEFAULT_LIMIT),
17476
+ /** Opaque continuation cursor from a previous page's `nextCursor`. */
17477
+ cursor: string().optional()
17478
+ });
17479
+ var ListGroupsPageSchema = object({
17480
+ groups: array(AnalyticsGroupRecordSchema).readonly(),
17481
+ nextCursor: string().nullable()
17482
+ });
17377
17483
  var KeyEventQueryInput = object({
17378
17484
  deviceId: number(),
17379
17485
  /** Window lower bound (track firstSeen ≥ since). */
@@ -17449,7 +17555,9 @@ var TrackCascadeCountsSchema = object({
17449
17555
  /** Unassigned plate reads removed (best-effort; plate leg deferred to plate-intelligence). */
17450
17556
  plates: number().int(),
17451
17557
  /** Per-track CLIP search vectors removed (best-effort). */
17452
- embeddings: number().int()
17558
+ embeddings: number().int(),
17559
+ /** Group membership + group rows removed with their last member (best-effort). */
17560
+ groups: number().int()
17453
17561
  });
17454
17562
  /** Disk-wins reconcile: media rows whose blobs are gone, then empty tracks. */
17455
17563
  var DiskReconcileCountsSchema = object({
@@ -17595,7 +17703,10 @@ DeviceType.Camera, method(object({ deviceId: number() }), array(TrackSchema).rea
17595
17703
  * stationary registry). Default false: the timeline lists passages,
17596
17704
  * not parking records (operator decision, 2026-08-15). */
17597
17705
  includeStationary: boolean().optional()
17598
- }), array(TrackSchema).readonly()), method(RecentTracksQueryInput, RecentTracksPageSchema), method(object({ deviceId: number() }), _void(), {
17706
+ }), array(TrackSchema).readonly()), method(RecentTracksQueryInput, RecentTracksPageSchema), method(ListGroupsQueryInput, ListGroupsPageSchema), method(object({
17707
+ deviceId: number(),
17708
+ groupId: string().min(1)
17709
+ }), AnalyticsGroupDetailSchema.nullable()), method(object({ deviceId: number() }), _void(), {
17599
17710
  kind: "mutation",
17600
17711
  auth: "admin"
17601
17712
  }), 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({
@@ -17813,6 +17924,33 @@ var NativeCropRefSchema = object({
17813
17924
  h: number()
17814
17925
  })
17815
17926
  });
17927
+ object({
17928
+ crop: object({
17929
+ left: number(),
17930
+ top: number(),
17931
+ width: number().positive(),
17932
+ height: number().positive()
17933
+ }).optional(),
17934
+ content: object({
17935
+ width: number().int().positive(),
17936
+ height: number().int().positive()
17937
+ }),
17938
+ fit: _enum(["stretch", "contain"]),
17939
+ format: _enum([
17940
+ "rgb",
17941
+ "gray",
17942
+ "jpeg"
17943
+ ])
17944
+ });
17945
+ var FrameRefSchema = object({
17946
+ registryId: string().min(1),
17947
+ id: string().min(1),
17948
+ width: number().int().positive(),
17949
+ height: number().int().positive(),
17950
+ format: _enum(["rgb", "gray"]),
17951
+ timestamp: number(),
17952
+ capturedAt: number().optional()
17953
+ });
17816
17954
  var ModelFormatSchema$1 = _enum([
17817
17955
  "onnx",
17818
17956
  "coreml",
@@ -17878,7 +18016,8 @@ var PipelineModelOptionSchema = object({
17878
18016
  sizeMB: number()
17879
18017
  })),
17880
18018
  group: ModelVariantGroupSchema.optional(),
17881
- legacy: boolean().optional()
18019
+ legacy: boolean().optional(),
18020
+ provider: ModelProviderIdSchema.optional()
17882
18021
  });
17883
18022
  var ConfigFieldBridge = custom();
17884
18023
  var PipelineAddonSchemaSchema = object({
@@ -18057,6 +18196,12 @@ method(_void(), array(PipelineEngineChoiceSchema)), method(_void(), PipelineEngi
18057
18196
  steps: array(PipelineStepInputSchema).min(1),
18058
18197
  frame: FrameInputSchema.optional(),
18059
18198
  /**
18199
+ * Process-local lazy frame. Valid only when caller and provider resolve
18200
+ * in the same execution-group process; split/cross-node callers use
18201
+ * `frame`/`image` inline compatibility instead.
18202
+ */
18203
+ frameRef: FrameRefSchema.optional(),
18204
+ /**
18060
18205
  * CB5 shm passthrough — a `FrameHandle` naming the same ring slot
18061
18206
  * the decoded pixels live in. One more member of the one-of
18062
18207
  * frame/frameHandle/image/imageBase64/referenceImage group.
@@ -18352,7 +18497,10 @@ var NativeCropResultSchema = object({
18352
18497
  * Which source served this crop, so a quality-sensitive consumer (the native
18353
18498
  * `keyFrame`) can reject a degraded fallback:
18354
18499
  * - `native` — cut from the decode worker's retained NATIVE surface (the
18355
- * quality path).
18500
+ * quality path). A subject-tile serve is also native-resolution and stays
18501
+ * `native` here: the public enum cannot name `tile` without a breaking cap
18502
+ * change. Runner telemetry distinguishes lease vs tile via `source` on the
18503
+ * internal crop result (`nativeHits` vs `tileHits`).
18356
18504
  * - `ram-fullframe` — the native surface MISSED but the request was full-frame,
18357
18505
  * so the ≤640 RAM `RetainedFrameStore` served it (honest lower-res; legit for
18358
18506
  * the blank-frame guard / 640-snapshot resolve, NOT for the clean keyFrame).
@@ -18843,12 +18991,41 @@ var RunnerLocalLoadSchema = object({
18843
18991
  * legacy `OrchestratorMetricsSchema` shape so existing dashboards keep
18844
18992
  * working unchanged when they switch to reading from the runner cap.
18845
18993
  */
18994
+ var FrameLazyCountersSchema = object({
18995
+ framesDecoded: number(),
18996
+ framesAdmitted: number(),
18997
+ framesDroppedPixelFree: number(),
18998
+ viewsMaterialized: number(),
18999
+ viewsSkipped: number(),
19000
+ workerToRunnerBytes: number(),
19001
+ runnerToPoolRawBytes: number(),
19002
+ runnerToPoolJpegBytes: number(),
19003
+ onDemandFullFrameRequests: number(),
19004
+ onDemandCropRequests: number(),
19005
+ nativeHits: number(),
19006
+ nativeMisses: number(),
19007
+ tileHits: number(),
19008
+ tileMisses: number(),
19009
+ fallbackHits: number(),
19010
+ fallbackMisses: number(),
19011
+ retainedWritesAvoided: number(),
19012
+ residentRefs: number(),
19013
+ residentBytes: number(),
19014
+ releases: number(),
19015
+ evictions: number(),
19016
+ staleMisses: number()
19017
+ });
19018
+ var FrameLazyMetricsSchema = object({
19019
+ node: FrameLazyCountersSchema,
19020
+ cameras: array(FrameLazyCountersSchema.extend({ deviceId: number() }))
19021
+ });
18846
19022
  var RunnerLocalMetricsSchema = object({
18847
19023
  nodeId: string(),
18848
19024
  activeCameras: number(),
18849
19025
  throttledCameras: number(),
18850
19026
  avgInferenceTimeMs: number(),
18851
- queueDepth: number()
19027
+ queueDepth: number(),
19028
+ frameLazy: FrameLazyMetricsSchema.optional()
18852
19029
  });
18853
19030
  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({
18854
19031
  handle: FrameHandleSchema,
@@ -20148,6 +20325,9 @@ method(_void(), ProviderInfoSchema), method(object({ config: record(string(), un
20148
20325
  location: StorageLocationSchema,
20149
20326
  relativePath: string()
20150
20327
  }), _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" });
20328
+ /** Profile-exported FormBuilder schema. Shape is ConfigUISchema at the UI. */
20329
+ var ProfileSettingsSchemaBridge = unknown().nullable();
20330
+ var ProfileSettingsBagSchema = record(string(), unknown());
20151
20331
  /**
20152
20332
  * A live terminal session hosted by the provider addon. Output and input do
20153
20333
  * NOT flow through the capability — they use the addon data plane
@@ -20177,7 +20357,14 @@ var TerminalSessionInfoSchema = object({
20177
20357
  var TerminalProfileInfoSchema = object({
20178
20358
  profileId: string(),
20179
20359
  label: string(),
20180
- description: string().optional()
20360
+ description: string().optional(),
20361
+ /** Spawn defaults the instance form copies on create. */
20362
+ executable: string().optional(),
20363
+ args: array(string()).readonly().optional(),
20364
+ cwd: string().optional(),
20365
+ environment: array(string()).readonly().optional(),
20366
+ /** ConfigUISchema for instance knobs, or null when the profile has none. */
20367
+ settingsSchema: ProfileSettingsSchemaBridge.optional()
20181
20368
  });
20182
20369
  /**
20183
20370
  * A durable operator-created Terminal instance. Profiles are templates; only
@@ -20190,7 +20377,12 @@ var TerminalInstanceInfoSchema = object({
20190
20377
  profileId: string(),
20191
20378
  profileLabel: string(),
20192
20379
  name: string(),
20193
- enabled: boolean()
20380
+ enabled: boolean(),
20381
+ executable: string(),
20382
+ args: array(string()).readonly(),
20383
+ cwd: string(),
20384
+ environment: array(string()).readonly(),
20385
+ profileSettings: ProfileSettingsBagSchema
20194
20386
  });
20195
20387
  var TerminalLegacyCameraSchema = object({
20196
20388
  stableId: string(),
@@ -20220,7 +20412,23 @@ var TerminalOutputBatchSchema = object({
20220
20412
  method(_void(), array(TerminalProfileInfoSchema).readonly(), { auth: "admin" }), method(_void(), array(TerminalInstanceInfoSchema).readonly(), { auth: "admin" }), method(object({
20221
20413
  targetNodeId: string().min(1),
20222
20414
  profileId: string().min(1),
20223
- name: string().trim().min(1).max(160).optional()
20415
+ name: string().trim().min(1).max(160).optional(),
20416
+ executable: string().max(1024).optional(),
20417
+ args: array(string().max(2048)).max(64).optional(),
20418
+ cwd: string().max(1024).optional(),
20419
+ environment: array(string().max(4096)).max(64).optional(),
20420
+ profileSettings: ProfileSettingsBagSchema.optional()
20421
+ }), TerminalInstanceInfoSchema, {
20422
+ kind: "mutation",
20423
+ auth: "admin"
20424
+ }), method(object({
20425
+ instanceId: string().min(1),
20426
+ name: string().trim().min(1).max(160).optional(),
20427
+ executable: string().max(1024).optional(),
20428
+ args: array(string().max(2048)).max(64).optional(),
20429
+ cwd: string().max(1024).optional(),
20430
+ environment: array(string().max(4096)).max(64).optional(),
20431
+ profileSettings: ProfileSettingsBagSchema.optional()
20224
20432
  }), TerminalInstanceInfoSchema, {
20225
20433
  kind: "mutation",
20226
20434
  auth: "admin"
@@ -20242,7 +20450,11 @@ method(_void(), array(TerminalProfileInfoSchema).readonly(), { auth: "admin" }),
20242
20450
  }), method(_void(), array(TerminalSessionInfoSchema).readonly(), { auth: "admin" }), method(object({
20243
20451
  profileId: string(),
20244
20452
  cols: number().int().positive(),
20245
- rows: number().int().positive()
20453
+ rows: number().int().positive(),
20454
+ executable: string().max(1024).optional(),
20455
+ args: array(string().max(2048)).max(64).optional(),
20456
+ cwd: string().max(1024).optional(),
20457
+ environment: array(string().max(4096)).max(64).optional()
20246
20458
  }), TerminalSessionInfoSchema, {
20247
20459
  kind: "mutation",
20248
20460
  auth: "admin"
@@ -24206,10 +24418,10 @@ var lawnMowerControlCapability = {
24206
24418
  *
24207
24419
  * • The SDK (mobile / web client) consumes `getConnectionEndpoints()`
24208
24420
  * to receive an ordered list of candidate base URLs it should race
24209
- * on connect — LAN IPv4 first (lowest latency when on same network),
24210
- * then public hostname (if a tunnel is up), then IPv6. The SDK can
24211
- * race them with short timeouts and stick with the winner for the
24212
- * session.
24421
+ * on connect — LAN IPv4 and stable LAN IPv6 first (lowest latency
24422
+ * when on the same network), then public hostname (if a tunnel is
24423
+ * up). The SDK can race them with short timeouts and stick with the
24424
+ * winner for the session.
24213
24425
  *
24214
24426
  * Why hub-only: agents are not directly addressable by the operator's
24215
24427
  * clients — they reverse-connect to the hub. Exposing their interfaces
@@ -24364,6 +24576,17 @@ var NotificationEndpointSchema = object({
24364
24576
  /** What the ranking currently resolves to (null when nothing is reachable). */
24365
24577
  resolved: string().nullable()
24366
24578
  });
24579
+ /**
24580
+ * The URLs the SDK / viewer should race for API access. `baseUrls` empty =
24581
+ * AUTO (every LAN IPv4 + the public tunnel). `resolved` is what that choice
24582
+ * currently expands to, so the UI can show the effective set either way.
24583
+ */
24584
+ var ViewerEndpointsSchema = object({
24585
+ /** The operator's explicit race set, or empty for AUTO. */
24586
+ baseUrls: array(string()).readonly(),
24587
+ /** What the ranking currently resolves to (may be empty if nothing is up). */
24588
+ resolved: array(string()).readonly()
24589
+ });
24367
24590
  var AllowedAddressesSchema = object({
24368
24591
  /**
24369
24592
  * Allowlist of interface addresses operators have explicitly opted
@@ -24372,6 +24595,20 @@ var AllowedAddressesSchema = object({
24372
24595
  * Network Addresses admin page and persisted by the addon.
24373
24596
  */
24374
24597
  addresses: array(string()).readonly() });
24598
+ var TlsStatusSchema = object({
24599
+ mode: _enum([
24600
+ "generated",
24601
+ "uploaded",
24602
+ "disabled"
24603
+ ]),
24604
+ leafFingerprintSha256: string().nullable(),
24605
+ caFingerprintSha256: string().nullable(),
24606
+ validTo: string().nullable(),
24607
+ sans: array(string()),
24608
+ caCertPem: string().nullable(),
24609
+ reissueError: string().nullable(),
24610
+ restartRequired: boolean()
24611
+ });
24375
24612
  method(_void(), ListResultSchema), method(_void(), PreferredSchema), method(object({
24376
24613
  /**
24377
24614
  * LEGACY HINT — do not send from new code. Kept optional so clients
@@ -24381,17 +24618,31 @@ method(_void(), ListResultSchema), method(_void(), PreferredSchema), method(obje
24381
24618
  */
24382
24619
  port: number().int().min(1).max(65535).optional(),
24383
24620
  /** Include `http(s)://127.0.0.1:<port>` as the lowest-priority
24384
- * candidate. Default `true`. */
24621
+ * candidate. Default `false` — loopback is not a client route. */
24385
24622
  includeLoopback: boolean().optional(),
24386
- /** Skip IPv6 entries. Some legacy clients can't parse them.
24387
- * Default `false`. */
24623
+ /** Skip IPv6 entries. Default `false` the palette includes stable
24624
+ * LAN IPv6 (ICE/WebRTC uses dual-stack regardless). Pass `true` to
24625
+ * hide them. The viewer HTTP/WS race is `getViewerEndpoints`. */
24388
24626
  ipv4Only: boolean().optional(),
24389
24627
  /** Scheme to emit for LAN/loopback URLs. Default `'http'`.
24390
24628
  * Pass `'https'` when the caller is itself loaded over HTTPS
24391
24629
  * to avoid mixed-content blocks in the browser. The public
24392
24630
  * tunnel always emits `https://` regardless. */
24393
24631
  scheme: _enum(["http", "https"]).optional()
24394
- }), 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" });
24632
+ }), 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, {
24633
+ kind: "mutation",
24634
+ auth: "admin"
24635
+ }), method(object({
24636
+ certPem: string().min(1),
24637
+ keyPem: string().min(1),
24638
+ caPem: string().optional()
24639
+ }), TlsStatusSchema, {
24640
+ kind: "mutation",
24641
+ auth: "admin"
24642
+ }), method(_void(), object({ pem: string() })), method(_void(), TlsStatusSchema, {
24643
+ kind: "mutation",
24644
+ auth: "admin"
24645
+ });
24395
24646
  var LockControlStatusSchema = object({
24396
24647
  /** Lifecycle state of the lock. `jammed` means the motor reported
24397
24648
  * failure to reach the target — operator intervention required. */
@@ -25952,7 +26203,12 @@ var PlateInfoSchema = object({
25952
26203
  plateBbox: BoundingBoxSchema.optional(),
25953
26204
  /** keyFrame parity: MediaStore key of the track's native-resolution key frame. */
25954
26205
  keyFrameMediaKey: string().optional(),
25955
- base64: string().optional()
26206
+ base64: string().optional(),
26207
+ /**
26208
+ * Same crop as a data-plane URL. `getPlateByTrack` returns this and
26209
+ * never inlines JPEG; `listPlates` still inlines for the admin-ui.
26210
+ */
26211
+ cropUrl: string().optional()
25956
26212
  });
25957
26213
  var MediaFileLiteSchema = object({
25958
26214
  key: string(),
@@ -31476,6 +31732,12 @@ Object.freeze({
31476
31732
  addonId: null,
31477
31733
  access: "view"
31478
31734
  },
31735
+ "deviceManager.getBindingsBatch": {
31736
+ capName: "device-manager",
31737
+ capScope: "system",
31738
+ addonId: null,
31739
+ access: "view"
31740
+ },
31479
31741
  "deviceManager.getChildren": {
31480
31742
  capName: "device-manager",
31481
31743
  capScope: "system",
@@ -31536,6 +31798,12 @@ Object.freeze({
31536
31798
  addonId: null,
31537
31799
  access: "view"
31538
31800
  },
31801
+ "deviceManager.getLinkedDevicesBatch": {
31802
+ capName: "device-manager",
31803
+ capScope: "system",
31804
+ addonId: null,
31805
+ access: "view"
31806
+ },
31539
31807
  "deviceManager.getRoleDisplayDefaults": {
31540
31808
  capName: "device-manager",
31541
31809
  capScope: "system",
@@ -32418,6 +32686,12 @@ Object.freeze({
32418
32686
  addonId: null,
32419
32687
  access: "create"
32420
32688
  },
32689
+ "localNetwork.downloadCa": {
32690
+ capName: "local-network",
32691
+ capScope: "system",
32692
+ addonId: null,
32693
+ access: "view"
32694
+ },
32421
32695
  "localNetwork.getAllowedAddresses": {
32422
32696
  capName: "local-network",
32423
32697
  capScope: "system",
@@ -32442,18 +32716,42 @@ Object.freeze({
32442
32716
  addonId: null,
32443
32717
  access: "view"
32444
32718
  },
32719
+ "localNetwork.getTlsStatus": {
32720
+ capName: "local-network",
32721
+ capScope: "system",
32722
+ addonId: null,
32723
+ access: "view"
32724
+ },
32725
+ "localNetwork.getViewerEndpoints": {
32726
+ capName: "local-network",
32727
+ capScope: "system",
32728
+ addonId: null,
32729
+ access: "view"
32730
+ },
32445
32731
  "localNetwork.list": {
32446
32732
  capName: "local-network",
32447
32733
  capScope: "system",
32448
32734
  addonId: null,
32449
32735
  access: "view"
32450
32736
  },
32737
+ "localNetwork.regenerateCertificate": {
32738
+ capName: "local-network",
32739
+ capScope: "system",
32740
+ addonId: null,
32741
+ access: "create"
32742
+ },
32451
32743
  "localNetwork.resetAllowlistToBestMatch": {
32452
32744
  capName: "local-network",
32453
32745
  capScope: "system",
32454
32746
  addonId: null,
32455
32747
  access: "delete"
32456
32748
  },
32749
+ "localNetwork.revertToGeneratedCertificate": {
32750
+ capName: "local-network",
32751
+ capScope: "system",
32752
+ addonId: null,
32753
+ access: "create"
32754
+ },
32457
32755
  "localNetwork.setAllowedAddresses": {
32458
32756
  capName: "local-network",
32459
32757
  capScope: "system",
@@ -32466,6 +32764,18 @@ Object.freeze({
32466
32764
  addonId: null,
32467
32765
  access: "create"
32468
32766
  },
32767
+ "localNetwork.setViewerEndpoints": {
32768
+ capName: "local-network",
32769
+ capScope: "system",
32770
+ addonId: null,
32771
+ access: "create"
32772
+ },
32773
+ "localNetwork.uploadCertificate": {
32774
+ capName: "local-network",
32775
+ capScope: "system",
32776
+ addonId: null,
32777
+ access: "create"
32778
+ },
32469
32779
  "lockControl.lock": {
32470
32780
  capName: "lock-control",
32471
32781
  capScope: "device",
@@ -33264,6 +33574,12 @@ Object.freeze({
33264
33574
  addonId: null,
33265
33575
  access: "view"
33266
33576
  },
33577
+ "pipelineAnalytics.getGroup": {
33578
+ capName: "pipeline-analytics",
33579
+ capScope: "device",
33580
+ addonId: null,
33581
+ access: "view"
33582
+ },
33267
33583
  "pipelineAnalytics.getKeyEvents": {
33268
33584
  capName: "pipeline-analytics",
33269
33585
  capScope: "device",
@@ -33348,6 +33664,12 @@ Object.freeze({
33348
33664
  addonId: null,
33349
33665
  access: "view"
33350
33666
  },
33667
+ "pipelineAnalytics.listGroups": {
33668
+ capName: "pipeline-analytics",
33669
+ capScope: "device",
33670
+ addonId: null,
33671
+ access: "view"
33672
+ },
33351
33673
  "pipelineAnalytics.listOpsLog": {
33352
33674
  capName: "pipeline-analytics",
33353
33675
  capScope: "device",
@@ -35346,6 +35668,12 @@ Object.freeze({
35346
35668
  addonId: null,
35347
35669
  access: "create"
35348
35670
  },
35671
+ "terminalSession.updateInstance": {
35672
+ capName: "terminal-session",
35673
+ capScope: "system",
35674
+ addonId: null,
35675
+ access: "create"
35676
+ },
35349
35677
  "terminalSession.writeInput": {
35350
35678
  capName: "terminal-session",
35351
35679
  capScope: "system",
@@ -36123,6 +36451,11 @@ Object.freeze({
36123
36451
  form: "single",
36124
36452
  optional: false
36125
36453
  }],
36454
+ "deviceManager.getBindingsBatch": [{
36455
+ name: "deviceIds",
36456
+ form: "array",
36457
+ optional: false
36458
+ }],
36126
36459
  "deviceManager.getChildren": [{
36127
36460
  name: "parentDeviceId",
36128
36461
  form: "single",
@@ -36168,6 +36501,11 @@ Object.freeze({
36168
36501
  form: "single",
36169
36502
  optional: false
36170
36503
  }],
36504
+ "deviceManager.getLinkedDevicesBatch": [{
36505
+ name: "deviceIds",
36506
+ form: "array",
36507
+ optional: false
36508
+ }],
36171
36509
  "deviceManager.getSettingsSchema": [{
36172
36510
  name: "deviceId",
36173
36511
  form: "single",
@@ -36188,6 +36526,11 @@ Object.freeze({
36188
36526
  form: "single",
36189
36527
  optional: false
36190
36528
  }],
36529
+ "deviceManager.listAll": [{
36530
+ name: "deviceIds",
36531
+ form: "array",
36532
+ optional: true
36533
+ }],
36191
36534
  "deviceManager.loadConfig": [{
36192
36535
  name: "deviceId",
36193
36536
  form: "single",
@@ -36761,6 +37104,11 @@ Object.freeze({
36761
37104
  form: "single",
36762
37105
  optional: false
36763
37106
  }],
37107
+ "pipelineAnalytics.getGroup": [{
37108
+ name: "deviceId",
37109
+ form: "single",
37110
+ optional: false
37111
+ }],
36764
37112
  "pipelineAnalytics.getKeyEvents": [{
36765
37113
  name: "deviceId",
36766
37114
  form: "single",
@@ -36816,6 +37164,11 @@ Object.freeze({
36816
37164
  form: "array",
36817
37165
  optional: false
36818
37166
  }],
37167
+ "pipelineAnalytics.listGroups": [{
37168
+ name: "deviceIds",
37169
+ form: "array",
37170
+ optional: false
37171
+ }],
36819
37172
  "pipelineAnalytics.listOpsLog": [{
36820
37173
  name: "deviceId",
36821
37174
  form: "single",
@@ -38040,6 +38393,35 @@ Object.freeze(Object.fromEntries([{
38040
38393
  }]
38041
38394
  }].map((s) => [s.stepId, s.defaultModelId])));
38042
38395
  string().min(1);
38396
+ var CLUSTER_STEP_SETTING_FIELDS = [{
38397
+ stepId: "face-embedding",
38398
+ key: "minLandmarkFaceSize",
38399
+ label: "Min face size for recognition (detection px)",
38400
+ 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.",
38401
+ type: "slider",
38402
+ min: 0,
38403
+ max: 64,
38404
+ step: 2,
38405
+ default: 24
38406
+ }];
38407
+ function clusterStepSettingKey(stepId, fieldKey) {
38408
+ return `clusterStepSetting:${stepId}:${fieldKey}`;
38409
+ }
38410
+ var ClusterSettingNumberSchema = number().finite();
38411
+ function readClusterStepSettings(config) {
38412
+ const out = {};
38413
+ for (const field of CLUSTER_STEP_SETTING_FIELDS) {
38414
+ const parsed = ClusterSettingNumberSchema.safeParse(config[clusterStepSettingKey(field.stepId, field.key)]);
38415
+ const value = parsed.success ? parsed.data : field.default;
38416
+ const existing = out[field.stepId] ?? {};
38417
+ out[field.stepId] = {
38418
+ ...existing,
38419
+ [field.key]: value
38420
+ };
38421
+ }
38422
+ return out;
38423
+ }
38424
+ readClusterStepSettings({});
38043
38425
  object({
38044
38426
  /**
38045
38427
  * Fraction of the box's own size added on EACH side before cutting.