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