@camstack/addon-provider-velux 0.2.26 → 0.2.28

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (3) hide show
  1. package/dist/addon.js +432 -50
  2. package/dist/addon.mjs +432 -50
  3. package/package.json +1 -1
package/dist/addon.js CHANGED
@@ -5801,6 +5801,13 @@ var BaseAddon = class {
5801
5801
  _readinessGeneration = typeof crypto !== "undefined" && crypto.randomUUID ? crypto.randomUUID() : Math.random().toString(36).slice(2, 14);
5802
5802
  /** Capability names this addon registered at init — used to emit matching `down` events on shutdown. */
5803
5803
  _registeredCapNames = [];
5804
+ /**
5805
+ * True only after `readAddonStore` actually answered. Constructor
5806
+ * defaults look like stored config when the store is down — a forked
5807
+ * addon that auto-starts from those defaults (cloudflare-tunnel quick
5808
+ * mode, 2026-08-25) is not "the operator chose this".
5809
+ */
5810
+ settingsStoreReady = false;
5804
5811
  /** Default config values. Provided via constructor. */
5805
5812
  defaults;
5806
5813
  constructor(defaults) {
@@ -6201,7 +6208,9 @@ var BaseAddon = class {
6201
6208
  ];
6202
6209
  let lastErr;
6203
6210
  for (let attempt = 0; attempt <= delaysMs.length; attempt++) try {
6204
- return await settings.readAddonStore() ?? {};
6211
+ const stored = await settings.readAddonStore() ?? {};
6212
+ this.settingsStoreReady = true;
6213
+ return stored;
6205
6214
  } catch (err) {
6206
6215
  lastErr = err;
6207
6216
  const msg = err instanceof Error ? err.message : String(err);
@@ -6209,6 +6218,7 @@ var BaseAddon = class {
6209
6218
  if (attempt === delaysMs.length) break;
6210
6219
  await new Promise((r) => setTimeout(r, delaysMs[attempt]));
6211
6220
  }
6221
+ this.settingsStoreReady = false;
6212
6222
  this._ctx?.logger?.warn?.("readAddonStore: settings-store unavailable after retries — using defaults", { meta: { error: lastErr instanceof Error ? lastErr.message : String(lastErr) } });
6213
6223
  return {};
6214
6224
  }
@@ -8020,6 +8030,15 @@ var LabelDefinitionSchema = object({
8020
8030
  description: string().optional(),
8021
8031
  icon: string().optional()
8022
8032
  });
8033
+ var ClassMapDefinitionSchema = object({
8034
+ mapping: record(string(), _enum([
8035
+ "person",
8036
+ "vehicle",
8037
+ "animal",
8038
+ "package"
8039
+ ])),
8040
+ preserveOriginal: boolean()
8041
+ });
8023
8042
  var MODEL_FORMATS = [
8024
8043
  "onnx",
8025
8044
  "coreml",
@@ -8103,6 +8122,12 @@ var ModelVariantGroupSchema = object({
8103
8122
  */
8104
8123
  resolution: number().int().positive().optional()
8105
8124
  });
8125
+ var ModelProviderIdSchema = _enum([
8126
+ "camstack",
8127
+ "frigate",
8128
+ "scrypted",
8129
+ "custom"
8130
+ ]);
8106
8131
  var ModelCatalogEntrySchema = object({
8107
8132
  id: string(),
8108
8133
  name: string(),
@@ -8198,7 +8223,19 @@ var ModelCatalogEntrySchema = object({
8198
8223
  * `id` stays the source of truth for resolution/download/persistence; grouping
8199
8224
  * is a presentation overlay resolved back to an `id`.
8200
8225
  */
8201
- group: ModelVariantGroupSchema.optional()
8226
+ group: ModelVariantGroupSchema.optional(),
8227
+ /**
8228
+ * Catalog source for the pipeline stepper's provider-first picker. Absent on
8229
+ * built-in CamStack entries (treated as `camstack`) and on registry rows
8230
+ * persisted before this field existed (`inferModelProvider` fills those).
8231
+ */
8232
+ provider: ModelProviderIdSchema.optional(),
8233
+ /**
8234
+ * Per-MODEL class map override. Absent ⇒ the step's `StepDefinition.classMap`
8235
+ * applies (Frigate / COCO public catalog). Set on a custom model whose raw
8236
+ * labels already ARE the CamStack macros (Scrypted identity map).
8237
+ */
8238
+ classMap: ClassMapDefinitionSchema.optional()
8202
8239
  });
8203
8240
  var ConvertTargetSchema = discriminatedUnion("format", [object({
8204
8241
  format: literal("openvino"),
@@ -8227,7 +8264,8 @@ var ModelConvertMetadataSchema = object({
8227
8264
  "ocr",
8228
8265
  "segmentation"
8229
8266
  ]),
8230
- faceAlignment: boolean().optional()
8267
+ faceAlignment: boolean().optional(),
8268
+ classMap: ClassMapDefinitionSchema.optional()
8231
8269
  });
8232
8270
  var ConvertResultSchema = object({
8233
8271
  entry: ModelCatalogEntrySchema,
@@ -11984,6 +12022,27 @@ var LinkedDeviceSchema = object({
11984
12022
  features: array(string()),
11985
12023
  producesTrackedEvents: boolean().optional()
11986
12024
  });
12025
+ /** One camera's resolved linked set, tagged with the camera it belongs to.
12026
+ * The batch answer needs the tag; the single-device answer already has it
12027
+ * from the input, which is why `getLinkedDevices` keeps the untagged shape. */
12028
+ var LinkedDevicesForDeviceSchema = object({
12029
+ deviceId: number(),
12030
+ mode: LinkedDevicesModeSchema,
12031
+ devices: array(LinkedDeviceSchema)
12032
+ });
12033
+ /** One device's binding map — the shape `getBindings`, `getBindingsBatch` and
12034
+ * `getAllBindings` all answer in. Declared once: three copies of the same
12035
+ * object literal is exactly how the three drift apart. */
12036
+ var DeviceBindingsForDeviceSchema = object({
12037
+ deviceId: number(),
12038
+ entries: array(object({
12039
+ capName: string(),
12040
+ kind: _enum(["native", "wrapped"]),
12041
+ providerAddonId: string(),
12042
+ providerNodeId: string(),
12043
+ nativeAddonId: string()
12044
+ }))
12045
+ });
11987
12046
  var SavedDeviceRowSchema = object({
11988
12047
  /** Numeric id reserved at allocateDeviceId time. */
11989
12048
  id: number(),
@@ -12209,11 +12268,25 @@ method(object({
12209
12268
  projection: _enum(["full", "slim"]).optional(),
12210
12269
  /** Return only camera devices. Filtering server-side instead of
12211
12270
  * shipping 293 rows to find 12. */
12212
- isCamera: boolean().optional()
12271
+ isCamera: boolean().optional(),
12272
+ /**
12273
+ * Return only these device ids. For the caller that already KNOWS the
12274
+ * handful it wants and needs a field the id-bearing answer does not
12275
+ * carry — the viewer's linked-devices panel joins `type` and `online`
12276
+ * onto ~8 linked ids and, unfiltered, dragged the fleet across to do
12277
+ * it: 433 KB slim / 958 KB full for 967 devices, on a query that
12278
+ * refetches on the reconcile interval, on a phone.
12279
+ *
12280
+ * Safe to send at a hub that predates it: Zod STRIPS unknown input
12281
+ * keys rather than rejecting them (verified against the live hub
12282
+ * 2026-08-25 — 967 rows came back), so an old hub answers exactly what
12283
+ * it answers today and the caller filters as it already does.
12284
+ */
12285
+ deviceIds: array(number()).optional()
12213
12286
  }), array(DeviceInfoSchema)), method(object({ deviceId: number() }), DeviceInfoSchema.nullable()), method(object({ parentDeviceId: number() }), array(DeviceInfoSchema)), method(object({ deviceId: number() }), object({
12214
12287
  mode: LinkedDevicesModeSchema,
12215
12288
  devices: array(LinkedDeviceSchema)
12216
- })), method(object({ deviceId: number() }), array(StreamSourceEntrySchema$1)), method(object({ deviceId: number() }), array(ConfigEntrySchema)), method(object({ deviceId: number() }), ConfigUISchemaOutput), method(object({
12289
+ })), 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({
12217
12290
  deviceId: number(),
12218
12291
  values: record(string(), unknown())
12219
12292
  }), object({ success: literal(true) }), {
@@ -12240,25 +12313,7 @@ method(object({
12240
12313
  }), method(object({ deviceId: number() }), array(StreamProbeResultSchema), {
12241
12314
  kind: "mutation",
12242
12315
  auth: "admin"
12243
- }), method(object({ deviceId: number() }), object({
12244
- deviceId: number(),
12245
- entries: array(object({
12246
- capName: string(),
12247
- kind: _enum(["native", "wrapped"]),
12248
- providerAddonId: string(),
12249
- providerNodeId: string(),
12250
- nativeAddonId: string()
12251
- }))
12252
- })), method(object({}), array(object({
12253
- deviceId: number(),
12254
- entries: array(object({
12255
- capName: string(),
12256
- kind: _enum(["native", "wrapped"]),
12257
- providerAddonId: string(),
12258
- providerNodeId: string(),
12259
- nativeAddonId: string()
12260
- }))
12261
- }))), method(object({
12316
+ }), method(object({ deviceId: number() }), DeviceBindingsForDeviceSchema), method(object({ deviceIds: array(number()) }), array(DeviceBindingsForDeviceSchema)), method(object({}), array(DeviceBindingsForDeviceSchema)), method(object({
12262
12317
  deviceId: number(),
12263
12318
  capName: string(),
12264
12319
  wrapperAddonId: string(),
@@ -14668,12 +14723,15 @@ var NcOccupancyConditionSchema = object({
14668
14723
  * there is no second switch that can disagree with the first and every rule
14669
14724
  * authored before the decision migrates for free (`audioModeOf`):
14670
14725
  *
14671
- * - **LABEL mode — `labels` present.** The rule fires on the FIRST frame the
14672
- * classifier labels with one of them. No window, no percentage:
14673
- * `hitPercent` and `samplingSeconds` are ignored, and the rule's own
14674
- * `throttle` cooldown is the only brake. The per-label confidence floor is
14675
- * the analyzer's (`classificationMinScore`, per device) a label only
14676
- * reaches this condition if the classifier was already confident enough.
14726
+ * - **LABEL mode — `labels` present.** The rule fires when `confirmHits`
14727
+ * labelled frames land inside `confirmWindowSec` (default 2 in 5 s).
14728
+ * `hitPercent` and `samplingSeconds` are still ignored a percentage of
14729
+ * frames is the wrong question for a classifier that labels 1–3 frames
14730
+ * per episode. The count window is the brake that drops a single-frame
14731
+ * false positive; the rule's own `throttle` cooldown is the other. The
14732
+ * per-label confidence floor is the analyzer's (`classificationMinScore`,
14733
+ * per device) — a label only reaches this condition if the classifier was
14734
+ * already confident enough. `confirmHits: 1` restores first-frame fire.
14677
14735
  * - **LEVEL mode — `dbThreshold` present, no labels.** The sampling window IS
14678
14736
  * the condition: at least `hitPercent`% of the samples over
14679
14737
  * `samplingSeconds` must be at or above `dbThreshold` dBFS (see
@@ -14700,14 +14758,22 @@ var NcOccupancyConditionSchema = object({
14700
14758
  * an operator who typed `dog` mean the same thing.
14701
14759
  */
14702
14760
  var NcAudioConditionSchema = object({
14703
- /** LABEL MODE: audio macro labels. Present ⇒ fires on the first labelled frame. */
14761
+ /** LABEL MODE: audio macro labels. Present ⇒ count-in-window confirm. */
14704
14762
  labels: array(string().min(1)).min(1).optional(),
14705
14763
  /** LEVEL MODE: floor in dBFS (negative-going, `0` = full scale). */
14706
14764
  dbThreshold: number().min(-96).max(0).optional(),
14707
14765
  /** LEVEL MODE ONLY: percentage of the window's samples that must be hits (1–100). */
14708
14766
  hitPercent: number().int().min(1).max(100).default(60),
14709
14767
  /** LEVEL MODE ONLY: length of the sampling window in seconds. */
14710
- samplingSeconds: number().int().min(1).max(300).default(10)
14768
+ samplingSeconds: number().int().min(1).max(300).default(10),
14769
+ /**
14770
+ * LABEL MODE: how many labelled frames must land inside
14771
+ * {@link NcAudioConditionSchema.shape.confirmWindowSec} before dispatch.
14772
+ * Absent ⇒ 2 (the matcher default). `1` is first-frame fire.
14773
+ */
14774
+ confirmHits: number().int().min(1).max(20).optional(),
14775
+ /** LABEL MODE: the window those frames must share, in seconds. Absent ⇒ 5. */
14776
+ confirmWindowSec: number().int().min(1).max(60).optional()
14711
14777
  });
14712
14778
  /**
14713
14779
  * Which zone-crossing DIRECTION a rule accepts (`ObjectEvent.zoneCrossing`).
@@ -17081,6 +17147,46 @@ var RecentTracksPageSchema = object({
17081
17147
  /** Cursor for the next page, or null when this page is the last. */
17082
17148
  nextCursor: string().nullable()
17083
17149
  });
17150
+ var LIST_GROUPS_DEFAULT_LIMIT = 40;
17151
+ var LIST_GROUPS_MAX_LIMIT = 100;
17152
+ var AnalyticsGroupRecordSchema = object({
17153
+ id: string(),
17154
+ deviceId: number().int(),
17155
+ openedAt: number().int(),
17156
+ closedAt: number().int(),
17157
+ timestamp: number().int(),
17158
+ memberCount: number().int(),
17159
+ memberTrackIds: array(string()).readonly(),
17160
+ className: string(),
17161
+ classes: array(string()).readonly(),
17162
+ /** Relative event-media path, or null when the group has no picture yet. */
17163
+ mediaUrl: string().nullable(),
17164
+ singleton: boolean()
17165
+ });
17166
+ var AnalyticsGroupMemberSchema = object({
17167
+ trackId: string(),
17168
+ deviceId: number().int(),
17169
+ className: string(),
17170
+ firstSeen: number().int(),
17171
+ lastSeen: number().int(),
17172
+ mediaUrl: string().nullable()
17173
+ });
17174
+ var AnalyticsGroupDetailSchema = AnalyticsGroupRecordSchema.extend({ members: array(AnalyticsGroupMemberSchema).readonly() });
17175
+ var ListGroupsQueryInput = object({
17176
+ /** Devices to merge. An empty array yields `{ groups: [], nextCursor: null }`. */
17177
+ deviceIds: array(number()),
17178
+ /** Window lower bound on `closedAt` (inclusive). */
17179
+ since: number().optional(),
17180
+ /** Window upper bound on `openedAt` (inclusive). */
17181
+ until: number().optional(),
17182
+ limit: number().int().min(1).max(LIST_GROUPS_MAX_LIMIT).default(LIST_GROUPS_DEFAULT_LIMIT),
17183
+ /** Opaque continuation cursor from a previous page's `nextCursor`. */
17184
+ cursor: string().optional()
17185
+ });
17186
+ var ListGroupsPageSchema = object({
17187
+ groups: array(AnalyticsGroupRecordSchema).readonly(),
17188
+ nextCursor: string().nullable()
17189
+ });
17084
17190
  var KeyEventQueryInput = object({
17085
17191
  deviceId: number(),
17086
17192
  /** Window lower bound (track firstSeen ≥ since). */
@@ -17156,7 +17262,9 @@ var TrackCascadeCountsSchema = object({
17156
17262
  /** Unassigned plate reads removed (best-effort; plate leg deferred to plate-intelligence). */
17157
17263
  plates: number().int(),
17158
17264
  /** Per-track CLIP search vectors removed (best-effort). */
17159
- embeddings: number().int()
17265
+ embeddings: number().int(),
17266
+ /** Group membership + group rows removed with their last member (best-effort). */
17267
+ groups: number().int()
17160
17268
  });
17161
17269
  /** Disk-wins reconcile: media rows whose blobs are gone, then empty tracks. */
17162
17270
  var DiskReconcileCountsSchema = object({
@@ -17302,7 +17410,10 @@ DeviceType.Camera, method(object({ deviceId: number() }), array(TrackSchema).rea
17302
17410
  * stationary registry). Default false: the timeline lists passages,
17303
17411
  * not parking records (operator decision, 2026-08-15). */
17304
17412
  includeStationary: boolean().optional()
17305
- }), array(TrackSchema).readonly()), method(RecentTracksQueryInput, RecentTracksPageSchema), method(object({ deviceId: number() }), _void(), {
17413
+ }), array(TrackSchema).readonly()), method(RecentTracksQueryInput, RecentTracksPageSchema), method(ListGroupsQueryInput, ListGroupsPageSchema), method(object({
17414
+ deviceId: number(),
17415
+ groupId: string().min(1)
17416
+ }), AnalyticsGroupDetailSchema.nullable()), method(object({ deviceId: number() }), _void(), {
17306
17417
  kind: "mutation",
17307
17418
  auth: "admin"
17308
17419
  }), 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({
@@ -17520,6 +17631,33 @@ var NativeCropRefSchema = object({
17520
17631
  h: number()
17521
17632
  })
17522
17633
  });
17634
+ object({
17635
+ crop: object({
17636
+ left: number(),
17637
+ top: number(),
17638
+ width: number().positive(),
17639
+ height: number().positive()
17640
+ }).optional(),
17641
+ content: object({
17642
+ width: number().int().positive(),
17643
+ height: number().int().positive()
17644
+ }),
17645
+ fit: _enum(["stretch", "contain"]),
17646
+ format: _enum([
17647
+ "rgb",
17648
+ "gray",
17649
+ "jpeg"
17650
+ ])
17651
+ });
17652
+ var FrameRefSchema = object({
17653
+ registryId: string().min(1),
17654
+ id: string().min(1),
17655
+ width: number().int().positive(),
17656
+ height: number().int().positive(),
17657
+ format: _enum(["rgb", "gray"]),
17658
+ timestamp: number(),
17659
+ capturedAt: number().optional()
17660
+ });
17523
17661
  var ModelFormatSchema$1 = _enum([
17524
17662
  "onnx",
17525
17663
  "coreml",
@@ -17585,7 +17723,8 @@ var PipelineModelOptionSchema = object({
17585
17723
  sizeMB: number()
17586
17724
  })),
17587
17725
  group: ModelVariantGroupSchema.optional(),
17588
- legacy: boolean().optional()
17726
+ legacy: boolean().optional(),
17727
+ provider: ModelProviderIdSchema.optional()
17589
17728
  });
17590
17729
  var ConfigFieldBridge = custom();
17591
17730
  var PipelineAddonSchemaSchema = object({
@@ -17764,6 +17903,12 @@ method(_void(), array(PipelineEngineChoiceSchema)), method(_void(), PipelineEngi
17764
17903
  steps: array(PipelineStepInputSchema).min(1),
17765
17904
  frame: FrameInputSchema.optional(),
17766
17905
  /**
17906
+ * Process-local lazy frame. Valid only when caller and provider resolve
17907
+ * in the same execution-group process; split/cross-node callers use
17908
+ * `frame`/`image` inline compatibility instead.
17909
+ */
17910
+ frameRef: FrameRefSchema.optional(),
17911
+ /**
17767
17912
  * CB5 shm passthrough — a `FrameHandle` naming the same ring slot
17768
17913
  * the decoded pixels live in. One more member of the one-of
17769
17914
  * frame/frameHandle/image/imageBase64/referenceImage group.
@@ -18059,7 +18204,10 @@ var NativeCropResultSchema = object({
18059
18204
  * Which source served this crop, so a quality-sensitive consumer (the native
18060
18205
  * `keyFrame`) can reject a degraded fallback:
18061
18206
  * - `native` — cut from the decode worker's retained NATIVE surface (the
18062
- * quality path).
18207
+ * quality path). A subject-tile serve is also native-resolution and stays
18208
+ * `native` here: the public enum cannot name `tile` without a breaking cap
18209
+ * change. Runner telemetry distinguishes lease vs tile via `source` on the
18210
+ * internal crop result (`nativeHits` vs `tileHits`).
18063
18211
  * - `ram-fullframe` — the native surface MISSED but the request was full-frame,
18064
18212
  * so the ≤640 RAM `RetainedFrameStore` served it (honest lower-res; legit for
18065
18213
  * the blank-frame guard / 640-snapshot resolve, NOT for the clean keyFrame).
@@ -18550,12 +18698,41 @@ var RunnerLocalLoadSchema = object({
18550
18698
  * legacy `OrchestratorMetricsSchema` shape so existing dashboards keep
18551
18699
  * working unchanged when they switch to reading from the runner cap.
18552
18700
  */
18701
+ var FrameLazyCountersSchema = object({
18702
+ framesDecoded: number(),
18703
+ framesAdmitted: number(),
18704
+ framesDroppedPixelFree: number(),
18705
+ viewsMaterialized: number(),
18706
+ viewsSkipped: number(),
18707
+ workerToRunnerBytes: number(),
18708
+ runnerToPoolRawBytes: number(),
18709
+ runnerToPoolJpegBytes: number(),
18710
+ onDemandFullFrameRequests: number(),
18711
+ onDemandCropRequests: number(),
18712
+ nativeHits: number(),
18713
+ nativeMisses: number(),
18714
+ tileHits: number(),
18715
+ tileMisses: number(),
18716
+ fallbackHits: number(),
18717
+ fallbackMisses: number(),
18718
+ retainedWritesAvoided: number(),
18719
+ residentRefs: number(),
18720
+ residentBytes: number(),
18721
+ releases: number(),
18722
+ evictions: number(),
18723
+ staleMisses: number()
18724
+ });
18725
+ var FrameLazyMetricsSchema = object({
18726
+ node: FrameLazyCountersSchema,
18727
+ cameras: array(FrameLazyCountersSchema.extend({ deviceId: number() }))
18728
+ });
18553
18729
  var RunnerLocalMetricsSchema = object({
18554
18730
  nodeId: string(),
18555
18731
  activeCameras: number(),
18556
18732
  throttledCameras: number(),
18557
18733
  avgInferenceTimeMs: number(),
18558
- queueDepth: number()
18734
+ queueDepth: number(),
18735
+ frameLazy: FrameLazyMetricsSchema.optional()
18559
18736
  });
18560
18737
  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({
18561
18738
  handle: FrameHandleSchema,
@@ -19855,6 +20032,9 @@ method(_void(), ProviderInfoSchema), method(object({ config: record(string(), un
19855
20032
  location: StorageLocationSchema,
19856
20033
  relativePath: string()
19857
20034
  }), _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" });
20035
+ /** Profile-exported FormBuilder schema. Shape is ConfigUISchema at the UI. */
20036
+ var ProfileSettingsSchemaBridge = unknown().nullable();
20037
+ var ProfileSettingsBagSchema = record(string(), unknown());
19858
20038
  /**
19859
20039
  * A live terminal session hosted by the provider addon. Output and input do
19860
20040
  * NOT flow through the capability — they use the addon data plane
@@ -19884,7 +20064,14 @@ var TerminalSessionInfoSchema = object({
19884
20064
  var TerminalProfileInfoSchema = object({
19885
20065
  profileId: string(),
19886
20066
  label: string(),
19887
- description: string().optional()
20067
+ description: string().optional(),
20068
+ /** Spawn defaults the instance form copies on create. */
20069
+ executable: string().optional(),
20070
+ args: array(string()).readonly().optional(),
20071
+ cwd: string().optional(),
20072
+ environment: array(string()).readonly().optional(),
20073
+ /** ConfigUISchema for instance knobs, or null when the profile has none. */
20074
+ settingsSchema: ProfileSettingsSchemaBridge.optional()
19888
20075
  });
19889
20076
  /**
19890
20077
  * A durable operator-created Terminal instance. Profiles are templates; only
@@ -19897,7 +20084,12 @@ var TerminalInstanceInfoSchema = object({
19897
20084
  profileId: string(),
19898
20085
  profileLabel: string(),
19899
20086
  name: string(),
19900
- enabled: boolean()
20087
+ enabled: boolean(),
20088
+ executable: string(),
20089
+ args: array(string()).readonly(),
20090
+ cwd: string(),
20091
+ environment: array(string()).readonly(),
20092
+ profileSettings: ProfileSettingsBagSchema
19901
20093
  });
19902
20094
  var TerminalLegacyCameraSchema = object({
19903
20095
  stableId: string(),
@@ -19927,7 +20119,23 @@ var TerminalOutputBatchSchema = object({
19927
20119
  method(_void(), array(TerminalProfileInfoSchema).readonly(), { auth: "admin" }), method(_void(), array(TerminalInstanceInfoSchema).readonly(), { auth: "admin" }), method(object({
19928
20120
  targetNodeId: string().min(1),
19929
20121
  profileId: string().min(1),
19930
- name: string().trim().min(1).max(160).optional()
20122
+ name: string().trim().min(1).max(160).optional(),
20123
+ executable: string().max(1024).optional(),
20124
+ args: array(string().max(2048)).max(64).optional(),
20125
+ cwd: string().max(1024).optional(),
20126
+ environment: array(string().max(4096)).max(64).optional(),
20127
+ profileSettings: ProfileSettingsBagSchema.optional()
20128
+ }), TerminalInstanceInfoSchema, {
20129
+ kind: "mutation",
20130
+ auth: "admin"
20131
+ }), method(object({
20132
+ instanceId: string().min(1),
20133
+ name: string().trim().min(1).max(160).optional(),
20134
+ executable: string().max(1024).optional(),
20135
+ args: array(string().max(2048)).max(64).optional(),
20136
+ cwd: string().max(1024).optional(),
20137
+ environment: array(string().max(4096)).max(64).optional(),
20138
+ profileSettings: ProfileSettingsBagSchema.optional()
19931
20139
  }), TerminalInstanceInfoSchema, {
19932
20140
  kind: "mutation",
19933
20141
  auth: "admin"
@@ -19949,7 +20157,11 @@ method(_void(), array(TerminalProfileInfoSchema).readonly(), { auth: "admin" }),
19949
20157
  }), method(_void(), array(TerminalSessionInfoSchema).readonly(), { auth: "admin" }), method(object({
19950
20158
  profileId: string(),
19951
20159
  cols: number().int().positive(),
19952
- rows: number().int().positive()
20160
+ rows: number().int().positive(),
20161
+ executable: string().max(1024).optional(),
20162
+ args: array(string().max(2048)).max(64).optional(),
20163
+ cwd: string().max(1024).optional(),
20164
+ environment: array(string().max(4096)).max(64).optional()
19953
20165
  }), TerminalSessionInfoSchema, {
19954
20166
  kind: "mutation",
19955
20167
  auth: "admin"
@@ -23824,10 +24036,10 @@ var lawnMowerControlCapability = {
23824
24036
  *
23825
24037
  * • The SDK (mobile / web client) consumes `getConnectionEndpoints()`
23826
24038
  * to receive an ordered list of candidate base URLs it should race
23827
- * on connect — LAN IPv4 first (lowest latency when on same network),
23828
- * then public hostname (if a tunnel is up), then IPv6. The SDK can
23829
- * race them with short timeouts and stick with the winner for the
23830
- * session.
24039
+ * on connect — LAN IPv4 and stable LAN IPv6 first (lowest latency
24040
+ * when on the same network), then public hostname (if a tunnel is
24041
+ * up). The SDK can race them with short timeouts and stick with the
24042
+ * winner for the session.
23831
24043
  *
23832
24044
  * Why hub-only: agents are not directly addressable by the operator's
23833
24045
  * clients — they reverse-connect to the hub. Exposing their interfaces
@@ -23982,6 +24194,17 @@ var NotificationEndpointSchema = object({
23982
24194
  /** What the ranking currently resolves to (null when nothing is reachable). */
23983
24195
  resolved: string().nullable()
23984
24196
  });
24197
+ /**
24198
+ * The URLs the SDK / viewer should race for API access. `baseUrls` empty =
24199
+ * AUTO (every LAN IPv4 + the public tunnel). `resolved` is what that choice
24200
+ * currently expands to, so the UI can show the effective set either way.
24201
+ */
24202
+ var ViewerEndpointsSchema = object({
24203
+ /** The operator's explicit race set, or empty for AUTO. */
24204
+ baseUrls: array(string()).readonly(),
24205
+ /** What the ranking currently resolves to (may be empty if nothing is up). */
24206
+ resolved: array(string()).readonly()
24207
+ });
23985
24208
  var AllowedAddressesSchema = object({
23986
24209
  /**
23987
24210
  * Allowlist of interface addresses operators have explicitly opted
@@ -23990,6 +24213,20 @@ var AllowedAddressesSchema = object({
23990
24213
  * Network Addresses admin page and persisted by the addon.
23991
24214
  */
23992
24215
  addresses: array(string()).readonly() });
24216
+ var TlsStatusSchema = object({
24217
+ mode: _enum([
24218
+ "generated",
24219
+ "uploaded",
24220
+ "disabled"
24221
+ ]),
24222
+ leafFingerprintSha256: string().nullable(),
24223
+ caFingerprintSha256: string().nullable(),
24224
+ validTo: string().nullable(),
24225
+ sans: array(string()),
24226
+ caCertPem: string().nullable(),
24227
+ reissueError: string().nullable(),
24228
+ restartRequired: boolean()
24229
+ });
23993
24230
  method(_void(), ListResultSchema), method(_void(), PreferredSchema), method(object({
23994
24231
  /**
23995
24232
  * LEGACY HINT — do not send from new code. Kept optional so clients
@@ -23999,17 +24236,31 @@ method(_void(), ListResultSchema), method(_void(), PreferredSchema), method(obje
23999
24236
  */
24000
24237
  port: number().int().min(1).max(65535).optional(),
24001
24238
  /** Include `http(s)://127.0.0.1:<port>` as the lowest-priority
24002
- * candidate. Default `true`. */
24239
+ * candidate. Default `false` — loopback is not a client route. */
24003
24240
  includeLoopback: boolean().optional(),
24004
- /** Skip IPv6 entries. Some legacy clients can't parse them.
24005
- * Default `false`. */
24241
+ /** Skip IPv6 entries. Default `false` the palette includes stable
24242
+ * LAN IPv6 (ICE/WebRTC uses dual-stack regardless). Pass `true` to
24243
+ * hide them. The viewer HTTP/WS race is `getViewerEndpoints`. */
24006
24244
  ipv4Only: boolean().optional(),
24007
24245
  /** Scheme to emit for LAN/loopback URLs. Default `'http'`.
24008
24246
  * Pass `'https'` when the caller is itself loaded over HTTPS
24009
24247
  * to avoid mixed-content blocks in the browser. The public
24010
24248
  * tunnel always emits `https://` regardless. */
24011
24249
  scheme: _enum(["http", "https"]).optional()
24012
- }), 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" });
24250
+ }), 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, {
24251
+ kind: "mutation",
24252
+ auth: "admin"
24253
+ }), method(object({
24254
+ certPem: string().min(1),
24255
+ keyPem: string().min(1),
24256
+ caPem: string().optional()
24257
+ }), TlsStatusSchema, {
24258
+ kind: "mutation",
24259
+ auth: "admin"
24260
+ }), method(_void(), object({ pem: string() })), method(_void(), TlsStatusSchema, {
24261
+ kind: "mutation",
24262
+ auth: "admin"
24263
+ });
24013
24264
  var LockControlStatusSchema = object({
24014
24265
  /** Lifecycle state of the lock. `jammed` means the motor reported
24015
24266
  * failure to reach the target — operator intervention required. */
@@ -25570,7 +25821,12 @@ var PlateInfoSchema = object({
25570
25821
  plateBbox: BoundingBoxSchema.optional(),
25571
25822
  /** keyFrame parity: MediaStore key of the track's native-resolution key frame. */
25572
25823
  keyFrameMediaKey: string().optional(),
25573
- base64: string().optional()
25824
+ base64: string().optional(),
25825
+ /**
25826
+ * Same crop as a data-plane URL. `getPlateByTrack` returns this and
25827
+ * never inlines JPEG; `listPlates` still inlines for the admin-ui.
25828
+ */
25829
+ cropUrl: string().optional()
25574
25830
  });
25575
25831
  var MediaFileLiteSchema = object({
25576
25832
  key: string(),
@@ -31094,6 +31350,12 @@ Object.freeze({
31094
31350
  addonId: null,
31095
31351
  access: "view"
31096
31352
  },
31353
+ "deviceManager.getBindingsBatch": {
31354
+ capName: "device-manager",
31355
+ capScope: "system",
31356
+ addonId: null,
31357
+ access: "view"
31358
+ },
31097
31359
  "deviceManager.getChildren": {
31098
31360
  capName: "device-manager",
31099
31361
  capScope: "system",
@@ -31154,6 +31416,12 @@ Object.freeze({
31154
31416
  addonId: null,
31155
31417
  access: "view"
31156
31418
  },
31419
+ "deviceManager.getLinkedDevicesBatch": {
31420
+ capName: "device-manager",
31421
+ capScope: "system",
31422
+ addonId: null,
31423
+ access: "view"
31424
+ },
31157
31425
  "deviceManager.getRoleDisplayDefaults": {
31158
31426
  capName: "device-manager",
31159
31427
  capScope: "system",
@@ -32036,6 +32304,12 @@ Object.freeze({
32036
32304
  addonId: null,
32037
32305
  access: "create"
32038
32306
  },
32307
+ "localNetwork.downloadCa": {
32308
+ capName: "local-network",
32309
+ capScope: "system",
32310
+ addonId: null,
32311
+ access: "view"
32312
+ },
32039
32313
  "localNetwork.getAllowedAddresses": {
32040
32314
  capName: "local-network",
32041
32315
  capScope: "system",
@@ -32060,18 +32334,42 @@ Object.freeze({
32060
32334
  addonId: null,
32061
32335
  access: "view"
32062
32336
  },
32337
+ "localNetwork.getTlsStatus": {
32338
+ capName: "local-network",
32339
+ capScope: "system",
32340
+ addonId: null,
32341
+ access: "view"
32342
+ },
32343
+ "localNetwork.getViewerEndpoints": {
32344
+ capName: "local-network",
32345
+ capScope: "system",
32346
+ addonId: null,
32347
+ access: "view"
32348
+ },
32063
32349
  "localNetwork.list": {
32064
32350
  capName: "local-network",
32065
32351
  capScope: "system",
32066
32352
  addonId: null,
32067
32353
  access: "view"
32068
32354
  },
32355
+ "localNetwork.regenerateCertificate": {
32356
+ capName: "local-network",
32357
+ capScope: "system",
32358
+ addonId: null,
32359
+ access: "create"
32360
+ },
32069
32361
  "localNetwork.resetAllowlistToBestMatch": {
32070
32362
  capName: "local-network",
32071
32363
  capScope: "system",
32072
32364
  addonId: null,
32073
32365
  access: "delete"
32074
32366
  },
32367
+ "localNetwork.revertToGeneratedCertificate": {
32368
+ capName: "local-network",
32369
+ capScope: "system",
32370
+ addonId: null,
32371
+ access: "create"
32372
+ },
32075
32373
  "localNetwork.setAllowedAddresses": {
32076
32374
  capName: "local-network",
32077
32375
  capScope: "system",
@@ -32084,6 +32382,18 @@ Object.freeze({
32084
32382
  addonId: null,
32085
32383
  access: "create"
32086
32384
  },
32385
+ "localNetwork.setViewerEndpoints": {
32386
+ capName: "local-network",
32387
+ capScope: "system",
32388
+ addonId: null,
32389
+ access: "create"
32390
+ },
32391
+ "localNetwork.uploadCertificate": {
32392
+ capName: "local-network",
32393
+ capScope: "system",
32394
+ addonId: null,
32395
+ access: "create"
32396
+ },
32087
32397
  "lockControl.lock": {
32088
32398
  capName: "lock-control",
32089
32399
  capScope: "device",
@@ -32882,6 +33192,12 @@ Object.freeze({
32882
33192
  addonId: null,
32883
33193
  access: "view"
32884
33194
  },
33195
+ "pipelineAnalytics.getGroup": {
33196
+ capName: "pipeline-analytics",
33197
+ capScope: "device",
33198
+ addonId: null,
33199
+ access: "view"
33200
+ },
32885
33201
  "pipelineAnalytics.getKeyEvents": {
32886
33202
  capName: "pipeline-analytics",
32887
33203
  capScope: "device",
@@ -32966,6 +33282,12 @@ Object.freeze({
32966
33282
  addonId: null,
32967
33283
  access: "view"
32968
33284
  },
33285
+ "pipelineAnalytics.listGroups": {
33286
+ capName: "pipeline-analytics",
33287
+ capScope: "device",
33288
+ addonId: null,
33289
+ access: "view"
33290
+ },
32969
33291
  "pipelineAnalytics.listOpsLog": {
32970
33292
  capName: "pipeline-analytics",
32971
33293
  capScope: "device",
@@ -34964,6 +35286,12 @@ Object.freeze({
34964
35286
  addonId: null,
34965
35287
  access: "create"
34966
35288
  },
35289
+ "terminalSession.updateInstance": {
35290
+ capName: "terminal-session",
35291
+ capScope: "system",
35292
+ addonId: null,
35293
+ access: "create"
35294
+ },
34967
35295
  "terminalSession.writeInput": {
34968
35296
  capName: "terminal-session",
34969
35297
  capScope: "system",
@@ -35741,6 +36069,11 @@ Object.freeze({
35741
36069
  form: "single",
35742
36070
  optional: false
35743
36071
  }],
36072
+ "deviceManager.getBindingsBatch": [{
36073
+ name: "deviceIds",
36074
+ form: "array",
36075
+ optional: false
36076
+ }],
35744
36077
  "deviceManager.getChildren": [{
35745
36078
  name: "parentDeviceId",
35746
36079
  form: "single",
@@ -35786,6 +36119,11 @@ Object.freeze({
35786
36119
  form: "single",
35787
36120
  optional: false
35788
36121
  }],
36122
+ "deviceManager.getLinkedDevicesBatch": [{
36123
+ name: "deviceIds",
36124
+ form: "array",
36125
+ optional: false
36126
+ }],
35789
36127
  "deviceManager.getSettingsSchema": [{
35790
36128
  name: "deviceId",
35791
36129
  form: "single",
@@ -35806,6 +36144,11 @@ Object.freeze({
35806
36144
  form: "single",
35807
36145
  optional: false
35808
36146
  }],
36147
+ "deviceManager.listAll": [{
36148
+ name: "deviceIds",
36149
+ form: "array",
36150
+ optional: true
36151
+ }],
35809
36152
  "deviceManager.loadConfig": [{
35810
36153
  name: "deviceId",
35811
36154
  form: "single",
@@ -36379,6 +36722,11 @@ Object.freeze({
36379
36722
  form: "single",
36380
36723
  optional: false
36381
36724
  }],
36725
+ "pipelineAnalytics.getGroup": [{
36726
+ name: "deviceId",
36727
+ form: "single",
36728
+ optional: false
36729
+ }],
36382
36730
  "pipelineAnalytics.getKeyEvents": [{
36383
36731
  name: "deviceId",
36384
36732
  form: "single",
@@ -36434,6 +36782,11 @@ Object.freeze({
36434
36782
  form: "array",
36435
36783
  optional: false
36436
36784
  }],
36785
+ "pipelineAnalytics.listGroups": [{
36786
+ name: "deviceIds",
36787
+ form: "array",
36788
+ optional: false
36789
+ }],
36437
36790
  "pipelineAnalytics.listOpsLog": [{
36438
36791
  name: "deviceId",
36439
36792
  form: "single",
@@ -37451,6 +37804,35 @@ Object.freeze(Object.fromEntries([{
37451
37804
  }]
37452
37805
  }].map((s) => [s.stepId, s.defaultModelId])));
37453
37806
  string().min(1);
37807
+ var CLUSTER_STEP_SETTING_FIELDS = [{
37808
+ stepId: "face-embedding",
37809
+ key: "minLandmarkFaceSize",
37810
+ label: "Min face size for recognition (detection px)",
37811
+ 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.",
37812
+ type: "slider",
37813
+ min: 0,
37814
+ max: 64,
37815
+ step: 2,
37816
+ default: 24
37817
+ }];
37818
+ function clusterStepSettingKey(stepId, fieldKey) {
37819
+ return `clusterStepSetting:${stepId}:${fieldKey}`;
37820
+ }
37821
+ var ClusterSettingNumberSchema = number().finite();
37822
+ function readClusterStepSettings(config) {
37823
+ const out = {};
37824
+ for (const field of CLUSTER_STEP_SETTING_FIELDS) {
37825
+ const parsed = ClusterSettingNumberSchema.safeParse(config[clusterStepSettingKey(field.stepId, field.key)]);
37826
+ const value = parsed.success ? parsed.data : field.default;
37827
+ const existing = out[field.stepId] ?? {};
37828
+ out[field.stepId] = {
37829
+ ...existing,
37830
+ [field.key]: value
37831
+ };
37832
+ }
37833
+ return out;
37834
+ }
37835
+ readClusterStepSettings({});
37454
37836
  object({
37455
37837
  /**
37456
37838
  * Fraction of the box's own size added on EACH side before cutting.