@camstack/addon-provider-amcrest 0.2.27 → 0.2.29

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
@@ -5806,6 +5806,13 @@ var BaseAddon = class {
5806
5806
  _readinessGeneration = typeof crypto !== "undefined" && crypto.randomUUID ? crypto.randomUUID() : Math.random().toString(36).slice(2, 14);
5807
5807
  /** Capability names this addon registered at init — used to emit matching `down` events on shutdown. */
5808
5808
  _registeredCapNames = [];
5809
+ /**
5810
+ * True only after `readAddonStore` actually answered. Constructor
5811
+ * defaults look like stored config when the store is down — a forked
5812
+ * addon that auto-starts from those defaults (cloudflare-tunnel quick
5813
+ * mode, 2026-08-25) is not "the operator chose this".
5814
+ */
5815
+ settingsStoreReady = false;
5809
5816
  /** Default config values. Provided via constructor. */
5810
5817
  defaults;
5811
5818
  constructor(defaults) {
@@ -6206,7 +6213,9 @@ var BaseAddon = class {
6206
6213
  ];
6207
6214
  let lastErr;
6208
6215
  for (let attempt = 0; attempt <= delaysMs.length; attempt++) try {
6209
- return await settings.readAddonStore() ?? {};
6216
+ const stored = await settings.readAddonStore() ?? {};
6217
+ this.settingsStoreReady = true;
6218
+ return stored;
6210
6219
  } catch (err) {
6211
6220
  lastErr = err;
6212
6221
  const msg = err instanceof Error ? err.message : String(err);
@@ -6214,6 +6223,7 @@ var BaseAddon = class {
6214
6223
  if (attempt === delaysMs.length) break;
6215
6224
  await new Promise((r) => setTimeout(r, delaysMs[attempt]));
6216
6225
  }
6226
+ this.settingsStoreReady = false;
6217
6227
  this._ctx?.logger?.warn?.("readAddonStore: settings-store unavailable after retries — using defaults", { meta: { error: lastErr instanceof Error ? lastErr.message : String(lastErr) } });
6218
6228
  return {};
6219
6229
  }
@@ -8013,6 +8023,15 @@ var LabelDefinitionSchema = object({
8013
8023
  description: string().optional(),
8014
8024
  icon: string().optional()
8015
8025
  });
8026
+ var ClassMapDefinitionSchema = object({
8027
+ mapping: record(string(), _enum([
8028
+ "person",
8029
+ "vehicle",
8030
+ "animal",
8031
+ "package"
8032
+ ])),
8033
+ preserveOriginal: boolean()
8034
+ });
8016
8035
  var MODEL_FORMATS = [
8017
8036
  "onnx",
8018
8037
  "coreml",
@@ -8096,6 +8115,12 @@ var ModelVariantGroupSchema = object({
8096
8115
  */
8097
8116
  resolution: number().int().positive().optional()
8098
8117
  });
8118
+ var ModelProviderIdSchema = _enum([
8119
+ "camstack",
8120
+ "frigate",
8121
+ "scrypted",
8122
+ "custom"
8123
+ ]);
8099
8124
  var ModelCatalogEntrySchema = object({
8100
8125
  id: string(),
8101
8126
  name: string(),
@@ -8191,7 +8216,19 @@ var ModelCatalogEntrySchema = object({
8191
8216
  * `id` stays the source of truth for resolution/download/persistence; grouping
8192
8217
  * is a presentation overlay resolved back to an `id`.
8193
8218
  */
8194
- group: ModelVariantGroupSchema.optional()
8219
+ group: ModelVariantGroupSchema.optional(),
8220
+ /**
8221
+ * Catalog source for the pipeline stepper's provider-first picker. Absent on
8222
+ * built-in CamStack entries (treated as `camstack`) and on registry rows
8223
+ * persisted before this field existed (`inferModelProvider` fills those).
8224
+ */
8225
+ provider: ModelProviderIdSchema.optional(),
8226
+ /**
8227
+ * Per-MODEL class map override. Absent ⇒ the step's `StepDefinition.classMap`
8228
+ * applies (Frigate / COCO public catalog). Set on a custom model whose raw
8229
+ * labels already ARE the CamStack macros (Scrypted identity map).
8230
+ */
8231
+ classMap: ClassMapDefinitionSchema.optional()
8195
8232
  });
8196
8233
  var ConvertTargetSchema = discriminatedUnion("format", [object({
8197
8234
  format: literal("openvino"),
@@ -8220,7 +8257,8 @@ var ModelConvertMetadataSchema = object({
8220
8257
  "ocr",
8221
8258
  "segmentation"
8222
8259
  ]),
8223
- faceAlignment: boolean().optional()
8260
+ faceAlignment: boolean().optional(),
8261
+ classMap: ClassMapDefinitionSchema.optional()
8224
8262
  });
8225
8263
  var ConvertResultSchema = object({
8226
8264
  entry: ModelCatalogEntrySchema,
@@ -11977,6 +12015,27 @@ var LinkedDeviceSchema = object({
11977
12015
  features: array(string()),
11978
12016
  producesTrackedEvents: boolean().optional()
11979
12017
  });
12018
+ /** One camera's resolved linked set, tagged with the camera it belongs to.
12019
+ * The batch answer needs the tag; the single-device answer already has it
12020
+ * from the input, which is why `getLinkedDevices` keeps the untagged shape. */
12021
+ var LinkedDevicesForDeviceSchema = object({
12022
+ deviceId: number(),
12023
+ mode: LinkedDevicesModeSchema,
12024
+ devices: array(LinkedDeviceSchema)
12025
+ });
12026
+ /** One device's binding map — the shape `getBindings`, `getBindingsBatch` and
12027
+ * `getAllBindings` all answer in. Declared once: three copies of the same
12028
+ * object literal is exactly how the three drift apart. */
12029
+ var DeviceBindingsForDeviceSchema = object({
12030
+ deviceId: number(),
12031
+ entries: array(object({
12032
+ capName: string(),
12033
+ kind: _enum(["native", "wrapped"]),
12034
+ providerAddonId: string(),
12035
+ providerNodeId: string(),
12036
+ nativeAddonId: string()
12037
+ }))
12038
+ });
11980
12039
  var SavedDeviceRowSchema = object({
11981
12040
  /** Numeric id reserved at allocateDeviceId time. */
11982
12041
  id: number(),
@@ -12202,11 +12261,25 @@ method(object({
12202
12261
  projection: _enum(["full", "slim"]).optional(),
12203
12262
  /** Return only camera devices. Filtering server-side instead of
12204
12263
  * shipping 293 rows to find 12. */
12205
- isCamera: boolean().optional()
12264
+ isCamera: boolean().optional(),
12265
+ /**
12266
+ * Return only these device ids. For the caller that already KNOWS the
12267
+ * handful it wants and needs a field the id-bearing answer does not
12268
+ * carry — the viewer's linked-devices panel joins `type` and `online`
12269
+ * onto ~8 linked ids and, unfiltered, dragged the fleet across to do
12270
+ * it: 433 KB slim / 958 KB full for 967 devices, on a query that
12271
+ * refetches on the reconcile interval, on a phone.
12272
+ *
12273
+ * Safe to send at a hub that predates it: Zod STRIPS unknown input
12274
+ * keys rather than rejecting them (verified against the live hub
12275
+ * 2026-08-25 — 967 rows came back), so an old hub answers exactly what
12276
+ * it answers today and the caller filters as it already does.
12277
+ */
12278
+ deviceIds: array(number()).optional()
12206
12279
  }), array(DeviceInfoSchema)), method(object({ deviceId: number() }), DeviceInfoSchema.nullable()), method(object({ parentDeviceId: number() }), array(DeviceInfoSchema)), method(object({ deviceId: number() }), object({
12207
12280
  mode: LinkedDevicesModeSchema,
12208
12281
  devices: array(LinkedDeviceSchema)
12209
- })), method(object({ deviceId: number() }), array(StreamSourceEntrySchema$1)), method(object({ deviceId: number() }), array(ConfigEntrySchema)), method(object({ deviceId: number() }), ConfigUISchemaOutput), method(object({
12282
+ })), 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({
12210
12283
  deviceId: number(),
12211
12284
  values: record(string(), unknown())
12212
12285
  }), object({ success: literal(true) }), {
@@ -12233,25 +12306,7 @@ method(object({
12233
12306
  }), method(object({ deviceId: number() }), array(StreamProbeResultSchema), {
12234
12307
  kind: "mutation",
12235
12308
  auth: "admin"
12236
- }), method(object({ deviceId: number() }), object({
12237
- deviceId: number(),
12238
- entries: array(object({
12239
- capName: string(),
12240
- kind: _enum(["native", "wrapped"]),
12241
- providerAddonId: string(),
12242
- providerNodeId: string(),
12243
- nativeAddonId: string()
12244
- }))
12245
- })), method(object({}), array(object({
12246
- deviceId: number(),
12247
- entries: array(object({
12248
- capName: string(),
12249
- kind: _enum(["native", "wrapped"]),
12250
- providerAddonId: string(),
12251
- providerNodeId: string(),
12252
- nativeAddonId: string()
12253
- }))
12254
- }))), method(object({
12309
+ }), method(object({ deviceId: number() }), DeviceBindingsForDeviceSchema), method(object({ deviceIds: array(number()) }), array(DeviceBindingsForDeviceSchema)), method(object({}), array(DeviceBindingsForDeviceSchema)), method(object({
12255
12310
  deviceId: number(),
12256
12311
  capName: string(),
12257
12312
  wrapperAddonId: string(),
@@ -14661,12 +14716,15 @@ var NcOccupancyConditionSchema = object({
14661
14716
  * there is no second switch that can disagree with the first and every rule
14662
14717
  * authored before the decision migrates for free (`audioModeOf`):
14663
14718
  *
14664
- * - **LABEL mode — `labels` present.** The rule fires on the FIRST frame the
14665
- * classifier labels with one of them. No window, no percentage:
14666
- * `hitPercent` and `samplingSeconds` are ignored, and the rule's own
14667
- * `throttle` cooldown is the only brake. The per-label confidence floor is
14668
- * the analyzer's (`classificationMinScore`, per device) a label only
14669
- * reaches this condition if the classifier was already confident enough.
14719
+ * - **LABEL mode — `labels` present.** The rule fires when `confirmHits`
14720
+ * labelled frames land inside `confirmWindowSec` (default 2 in 5 s).
14721
+ * `hitPercent` and `samplingSeconds` are still ignored a percentage of
14722
+ * frames is the wrong question for a classifier that labels 1–3 frames
14723
+ * per episode. The count window is the brake that drops a single-frame
14724
+ * false positive; the rule's own `throttle` cooldown is the other. The
14725
+ * per-label confidence floor is the analyzer's (`classificationMinScore`,
14726
+ * per device) — a label only reaches this condition if the classifier was
14727
+ * already confident enough. `confirmHits: 1` restores first-frame fire.
14670
14728
  * - **LEVEL mode — `dbThreshold` present, no labels.** The sampling window IS
14671
14729
  * the condition: at least `hitPercent`% of the samples over
14672
14730
  * `samplingSeconds` must be at or above `dbThreshold` dBFS (see
@@ -14693,14 +14751,22 @@ var NcOccupancyConditionSchema = object({
14693
14751
  * an operator who typed `dog` mean the same thing.
14694
14752
  */
14695
14753
  var NcAudioConditionSchema = object({
14696
- /** LABEL MODE: audio macro labels. Present ⇒ fires on the first labelled frame. */
14754
+ /** LABEL MODE: audio macro labels. Present ⇒ count-in-window confirm. */
14697
14755
  labels: array(string().min(1)).min(1).optional(),
14698
14756
  /** LEVEL MODE: floor in dBFS (negative-going, `0` = full scale). */
14699
14757
  dbThreshold: number().min(-96).max(0).optional(),
14700
14758
  /** LEVEL MODE ONLY: percentage of the window's samples that must be hits (1–100). */
14701
14759
  hitPercent: number().int().min(1).max(100).default(60),
14702
14760
  /** LEVEL MODE ONLY: length of the sampling window in seconds. */
14703
- samplingSeconds: number().int().min(1).max(300).default(10)
14761
+ samplingSeconds: number().int().min(1).max(300).default(10),
14762
+ /**
14763
+ * LABEL MODE: how many labelled frames must land inside
14764
+ * {@link NcAudioConditionSchema.shape.confirmWindowSec} before dispatch.
14765
+ * Absent ⇒ 2 (the matcher default). `1` is first-frame fire.
14766
+ */
14767
+ confirmHits: number().int().min(1).max(20).optional(),
14768
+ /** LABEL MODE: the window those frames must share, in seconds. Absent ⇒ 5. */
14769
+ confirmWindowSec: number().int().min(1).max(60).optional()
14704
14770
  });
14705
14771
  /**
14706
14772
  * Which zone-crossing DIRECTION a rule accepts (`ObjectEvent.zoneCrossing`).
@@ -17074,6 +17140,46 @@ var RecentTracksPageSchema = object({
17074
17140
  /** Cursor for the next page, or null when this page is the last. */
17075
17141
  nextCursor: string().nullable()
17076
17142
  });
17143
+ var LIST_GROUPS_DEFAULT_LIMIT = 40;
17144
+ var LIST_GROUPS_MAX_LIMIT = 100;
17145
+ var AnalyticsGroupRecordSchema = object({
17146
+ id: string(),
17147
+ deviceId: number().int(),
17148
+ openedAt: number().int(),
17149
+ closedAt: number().int(),
17150
+ timestamp: number().int(),
17151
+ memberCount: number().int(),
17152
+ memberTrackIds: array(string()).readonly(),
17153
+ className: string(),
17154
+ classes: array(string()).readonly(),
17155
+ /** Relative event-media path, or null when the group has no picture yet. */
17156
+ mediaUrl: string().nullable(),
17157
+ singleton: boolean()
17158
+ });
17159
+ var AnalyticsGroupMemberSchema = object({
17160
+ trackId: string(),
17161
+ deviceId: number().int(),
17162
+ className: string(),
17163
+ firstSeen: number().int(),
17164
+ lastSeen: number().int(),
17165
+ mediaUrl: string().nullable()
17166
+ });
17167
+ var AnalyticsGroupDetailSchema = AnalyticsGroupRecordSchema.extend({ members: array(AnalyticsGroupMemberSchema).readonly() });
17168
+ var ListGroupsQueryInput = object({
17169
+ /** Devices to merge. An empty array yields `{ groups: [], nextCursor: null }`. */
17170
+ deviceIds: array(number()),
17171
+ /** Window lower bound on `closedAt` (inclusive). */
17172
+ since: number().optional(),
17173
+ /** Window upper bound on `openedAt` (inclusive). */
17174
+ until: number().optional(),
17175
+ limit: number().int().min(1).max(LIST_GROUPS_MAX_LIMIT).default(LIST_GROUPS_DEFAULT_LIMIT),
17176
+ /** Opaque continuation cursor from a previous page's `nextCursor`. */
17177
+ cursor: string().optional()
17178
+ });
17179
+ var ListGroupsPageSchema = object({
17180
+ groups: array(AnalyticsGroupRecordSchema).readonly(),
17181
+ nextCursor: string().nullable()
17182
+ });
17077
17183
  var KeyEventQueryInput = object({
17078
17184
  deviceId: number(),
17079
17185
  /** Window lower bound (track firstSeen ≥ since). */
@@ -17149,7 +17255,9 @@ var TrackCascadeCountsSchema = object({
17149
17255
  /** Unassigned plate reads removed (best-effort; plate leg deferred to plate-intelligence). */
17150
17256
  plates: number().int(),
17151
17257
  /** Per-track CLIP search vectors removed (best-effort). */
17152
- embeddings: number().int()
17258
+ embeddings: number().int(),
17259
+ /** Group membership + group rows removed with their last member (best-effort). */
17260
+ groups: number().int()
17153
17261
  });
17154
17262
  /** Disk-wins reconcile: media rows whose blobs are gone, then empty tracks. */
17155
17263
  var DiskReconcileCountsSchema = object({
@@ -17295,7 +17403,10 @@ DeviceType.Camera, method(object({ deviceId: number() }), array(TrackSchema).rea
17295
17403
  * stationary registry). Default false: the timeline lists passages,
17296
17404
  * not parking records (operator decision, 2026-08-15). */
17297
17405
  includeStationary: boolean().optional()
17298
- }), array(TrackSchema).readonly()), method(RecentTracksQueryInput, RecentTracksPageSchema), method(object({ deviceId: number() }), _void(), {
17406
+ }), array(TrackSchema).readonly()), method(RecentTracksQueryInput, RecentTracksPageSchema), method(ListGroupsQueryInput, ListGroupsPageSchema), method(object({
17407
+ deviceId: number(),
17408
+ groupId: string().min(1)
17409
+ }), AnalyticsGroupDetailSchema.nullable()), method(object({ deviceId: number() }), _void(), {
17299
17410
  kind: "mutation",
17300
17411
  auth: "admin"
17301
17412
  }), 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({
@@ -17513,6 +17624,33 @@ var NativeCropRefSchema = object({
17513
17624
  h: number()
17514
17625
  })
17515
17626
  });
17627
+ object({
17628
+ crop: object({
17629
+ left: number(),
17630
+ top: number(),
17631
+ width: number().positive(),
17632
+ height: number().positive()
17633
+ }).optional(),
17634
+ content: object({
17635
+ width: number().int().positive(),
17636
+ height: number().int().positive()
17637
+ }),
17638
+ fit: _enum(["stretch", "contain"]),
17639
+ format: _enum([
17640
+ "rgb",
17641
+ "gray",
17642
+ "jpeg"
17643
+ ])
17644
+ });
17645
+ var FrameRefSchema = object({
17646
+ registryId: string().min(1),
17647
+ id: string().min(1),
17648
+ width: number().int().positive(),
17649
+ height: number().int().positive(),
17650
+ format: _enum(["rgb", "gray"]),
17651
+ timestamp: number(),
17652
+ capturedAt: number().optional()
17653
+ });
17516
17654
  var ModelFormatSchema$1 = _enum([
17517
17655
  "onnx",
17518
17656
  "coreml",
@@ -17578,7 +17716,8 @@ var PipelineModelOptionSchema = object({
17578
17716
  sizeMB: number()
17579
17717
  })),
17580
17718
  group: ModelVariantGroupSchema.optional(),
17581
- legacy: boolean().optional()
17719
+ legacy: boolean().optional(),
17720
+ provider: ModelProviderIdSchema.optional()
17582
17721
  });
17583
17722
  var ConfigFieldBridge = custom();
17584
17723
  var PipelineAddonSchemaSchema = object({
@@ -17757,6 +17896,12 @@ method(_void(), array(PipelineEngineChoiceSchema)), method(_void(), PipelineEngi
17757
17896
  steps: array(PipelineStepInputSchema).min(1),
17758
17897
  frame: FrameInputSchema.optional(),
17759
17898
  /**
17899
+ * Process-local lazy frame. Valid only when caller and provider resolve
17900
+ * in the same execution-group process; split/cross-node callers use
17901
+ * `frame`/`image` inline compatibility instead.
17902
+ */
17903
+ frameRef: FrameRefSchema.optional(),
17904
+ /**
17760
17905
  * CB5 shm passthrough — a `FrameHandle` naming the same ring slot
17761
17906
  * the decoded pixels live in. One more member of the one-of
17762
17907
  * frame/frameHandle/image/imageBase64/referenceImage group.
@@ -18052,7 +18197,10 @@ var NativeCropResultSchema = object({
18052
18197
  * Which source served this crop, so a quality-sensitive consumer (the native
18053
18198
  * `keyFrame`) can reject a degraded fallback:
18054
18199
  * - `native` — cut from the decode worker's retained NATIVE surface (the
18055
- * quality path).
18200
+ * quality path). A subject-tile serve is also native-resolution and stays
18201
+ * `native` here: the public enum cannot name `tile` without a breaking cap
18202
+ * change. Runner telemetry distinguishes lease vs tile via `source` on the
18203
+ * internal crop result (`nativeHits` vs `tileHits`).
18056
18204
  * - `ram-fullframe` — the native surface MISSED but the request was full-frame,
18057
18205
  * so the ≤640 RAM `RetainedFrameStore` served it (honest lower-res; legit for
18058
18206
  * the blank-frame guard / 640-snapshot resolve, NOT for the clean keyFrame).
@@ -18543,12 +18691,41 @@ var RunnerLocalLoadSchema = object({
18543
18691
  * legacy `OrchestratorMetricsSchema` shape so existing dashboards keep
18544
18692
  * working unchanged when they switch to reading from the runner cap.
18545
18693
  */
18694
+ var FrameLazyCountersSchema = object({
18695
+ framesDecoded: number(),
18696
+ framesAdmitted: number(),
18697
+ framesDroppedPixelFree: number(),
18698
+ viewsMaterialized: number(),
18699
+ viewsSkipped: number(),
18700
+ workerToRunnerBytes: number(),
18701
+ runnerToPoolRawBytes: number(),
18702
+ runnerToPoolJpegBytes: number(),
18703
+ onDemandFullFrameRequests: number(),
18704
+ onDemandCropRequests: number(),
18705
+ nativeHits: number(),
18706
+ nativeMisses: number(),
18707
+ tileHits: number(),
18708
+ tileMisses: number(),
18709
+ fallbackHits: number(),
18710
+ fallbackMisses: number(),
18711
+ retainedWritesAvoided: number(),
18712
+ residentRefs: number(),
18713
+ residentBytes: number(),
18714
+ releases: number(),
18715
+ evictions: number(),
18716
+ staleMisses: number()
18717
+ });
18718
+ var FrameLazyMetricsSchema = object({
18719
+ node: FrameLazyCountersSchema,
18720
+ cameras: array(FrameLazyCountersSchema.extend({ deviceId: number() }))
18721
+ });
18546
18722
  var RunnerLocalMetricsSchema = object({
18547
18723
  nodeId: string(),
18548
18724
  activeCameras: number(),
18549
18725
  throttledCameras: number(),
18550
18726
  avgInferenceTimeMs: number(),
18551
- queueDepth: number()
18727
+ queueDepth: number(),
18728
+ frameLazy: FrameLazyMetricsSchema.optional()
18552
18729
  });
18553
18730
  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({
18554
18731
  handle: FrameHandleSchema,
@@ -19952,6 +20129,9 @@ method(_void(), ProviderInfoSchema), method(object({ config: record(string(), un
19952
20129
  location: StorageLocationSchema,
19953
20130
  relativePath: string()
19954
20131
  }), _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" });
20132
+ /** Profile-exported FormBuilder schema. Shape is ConfigUISchema at the UI. */
20133
+ var ProfileSettingsSchemaBridge = unknown().nullable();
20134
+ var ProfileSettingsBagSchema = record(string(), unknown());
19955
20135
  /**
19956
20136
  * A live terminal session hosted by the provider addon. Output and input do
19957
20137
  * NOT flow through the capability — they use the addon data plane
@@ -19981,7 +20161,14 @@ var TerminalSessionInfoSchema = object({
19981
20161
  var TerminalProfileInfoSchema = object({
19982
20162
  profileId: string(),
19983
20163
  label: string(),
19984
- description: string().optional()
20164
+ description: string().optional(),
20165
+ /** Spawn defaults the instance form copies on create. */
20166
+ executable: string().optional(),
20167
+ args: array(string()).readonly().optional(),
20168
+ cwd: string().optional(),
20169
+ environment: array(string()).readonly().optional(),
20170
+ /** ConfigUISchema for instance knobs, or null when the profile has none. */
20171
+ settingsSchema: ProfileSettingsSchemaBridge.optional()
19985
20172
  });
19986
20173
  /**
19987
20174
  * A durable operator-created Terminal instance. Profiles are templates; only
@@ -19994,7 +20181,12 @@ var TerminalInstanceInfoSchema = object({
19994
20181
  profileId: string(),
19995
20182
  profileLabel: string(),
19996
20183
  name: string(),
19997
- enabled: boolean()
20184
+ enabled: boolean(),
20185
+ executable: string(),
20186
+ args: array(string()).readonly(),
20187
+ cwd: string(),
20188
+ environment: array(string()).readonly(),
20189
+ profileSettings: ProfileSettingsBagSchema
19998
20190
  });
19999
20191
  var TerminalLegacyCameraSchema = object({
20000
20192
  stableId: string(),
@@ -20024,7 +20216,23 @@ var TerminalOutputBatchSchema = object({
20024
20216
  method(_void(), array(TerminalProfileInfoSchema).readonly(), { auth: "admin" }), method(_void(), array(TerminalInstanceInfoSchema).readonly(), { auth: "admin" }), method(object({
20025
20217
  targetNodeId: string().min(1),
20026
20218
  profileId: string().min(1),
20027
- name: string().trim().min(1).max(160).optional()
20219
+ name: string().trim().min(1).max(160).optional(),
20220
+ executable: string().max(1024).optional(),
20221
+ args: array(string().max(2048)).max(64).optional(),
20222
+ cwd: string().max(1024).optional(),
20223
+ environment: array(string().max(4096)).max(64).optional(),
20224
+ profileSettings: ProfileSettingsBagSchema.optional()
20225
+ }), TerminalInstanceInfoSchema, {
20226
+ kind: "mutation",
20227
+ auth: "admin"
20228
+ }), method(object({
20229
+ instanceId: string().min(1),
20230
+ name: string().trim().min(1).max(160).optional(),
20231
+ executable: string().max(1024).optional(),
20232
+ args: array(string().max(2048)).max(64).optional(),
20233
+ cwd: string().max(1024).optional(),
20234
+ environment: array(string().max(4096)).max(64).optional(),
20235
+ profileSettings: ProfileSettingsBagSchema.optional()
20028
20236
  }), TerminalInstanceInfoSchema, {
20029
20237
  kind: "mutation",
20030
20238
  auth: "admin"
@@ -20046,7 +20254,11 @@ method(_void(), array(TerminalProfileInfoSchema).readonly(), { auth: "admin" }),
20046
20254
  }), method(_void(), array(TerminalSessionInfoSchema).readonly(), { auth: "admin" }), method(object({
20047
20255
  profileId: string(),
20048
20256
  cols: number().int().positive(),
20049
- rows: number().int().positive()
20257
+ rows: number().int().positive(),
20258
+ executable: string().max(1024).optional(),
20259
+ args: array(string().max(2048)).max(64).optional(),
20260
+ cwd: string().max(1024).optional(),
20261
+ environment: array(string().max(4096)).max(64).optional()
20050
20262
  }), TerminalSessionInfoSchema, {
20051
20263
  kind: "mutation",
20052
20264
  auth: "admin"
@@ -23921,10 +24133,10 @@ var lawnMowerControlCapability = {
23921
24133
  *
23922
24134
  * • The SDK (mobile / web client) consumes `getConnectionEndpoints()`
23923
24135
  * to receive an ordered list of candidate base URLs it should race
23924
- * on connect — LAN IPv4 first (lowest latency when on same network),
23925
- * then public hostname (if a tunnel is up), then IPv6. The SDK can
23926
- * race them with short timeouts and stick with the winner for the
23927
- * session.
24136
+ * on connect — LAN IPv4 and stable LAN IPv6 first (lowest latency
24137
+ * when on the same network), then public hostname (if a tunnel is
24138
+ * up). The SDK can race them with short timeouts and stick with the
24139
+ * winner for the session.
23928
24140
  *
23929
24141
  * Why hub-only: agents are not directly addressable by the operator's
23930
24142
  * clients — they reverse-connect to the hub. Exposing their interfaces
@@ -24079,6 +24291,17 @@ var NotificationEndpointSchema = object({
24079
24291
  /** What the ranking currently resolves to (null when nothing is reachable). */
24080
24292
  resolved: string().nullable()
24081
24293
  });
24294
+ /**
24295
+ * The URLs the SDK / viewer should race for API access. `baseUrls` empty =
24296
+ * AUTO (every LAN IPv4 + the public tunnel). `resolved` is what that choice
24297
+ * currently expands to, so the UI can show the effective set either way.
24298
+ */
24299
+ var ViewerEndpointsSchema = object({
24300
+ /** The operator's explicit race set, or empty for AUTO. */
24301
+ baseUrls: array(string()).readonly(),
24302
+ /** What the ranking currently resolves to (may be empty if nothing is up). */
24303
+ resolved: array(string()).readonly()
24304
+ });
24082
24305
  var AllowedAddressesSchema = object({
24083
24306
  /**
24084
24307
  * Allowlist of interface addresses operators have explicitly opted
@@ -24087,6 +24310,20 @@ var AllowedAddressesSchema = object({
24087
24310
  * Network Addresses admin page and persisted by the addon.
24088
24311
  */
24089
24312
  addresses: array(string()).readonly() });
24313
+ var TlsStatusSchema = object({
24314
+ mode: _enum([
24315
+ "generated",
24316
+ "uploaded",
24317
+ "disabled"
24318
+ ]),
24319
+ leafFingerprintSha256: string().nullable(),
24320
+ caFingerprintSha256: string().nullable(),
24321
+ validTo: string().nullable(),
24322
+ sans: array(string()),
24323
+ caCertPem: string().nullable(),
24324
+ reissueError: string().nullable(),
24325
+ restartRequired: boolean()
24326
+ });
24090
24327
  method(_void(), ListResultSchema), method(_void(), PreferredSchema), method(object({
24091
24328
  /**
24092
24329
  * LEGACY HINT — do not send from new code. Kept optional so clients
@@ -24096,17 +24333,31 @@ method(_void(), ListResultSchema), method(_void(), PreferredSchema), method(obje
24096
24333
  */
24097
24334
  port: number().int().min(1).max(65535).optional(),
24098
24335
  /** Include `http(s)://127.0.0.1:<port>` as the lowest-priority
24099
- * candidate. Default `true`. */
24336
+ * candidate. Default `false` — loopback is not a client route. */
24100
24337
  includeLoopback: boolean().optional(),
24101
- /** Skip IPv6 entries. Some legacy clients can't parse them.
24102
- * Default `false`. */
24338
+ /** Skip IPv6 entries. Default `false` the palette includes stable
24339
+ * LAN IPv6 (ICE/WebRTC uses dual-stack regardless). Pass `true` to
24340
+ * hide them. The viewer HTTP/WS race is `getViewerEndpoints`. */
24103
24341
  ipv4Only: boolean().optional(),
24104
24342
  /** Scheme to emit for LAN/loopback URLs. Default `'http'`.
24105
24343
  * Pass `'https'` when the caller is itself loaded over HTTPS
24106
24344
  * to avoid mixed-content blocks in the browser. The public
24107
24345
  * tunnel always emits `https://` regardless. */
24108
24346
  scheme: _enum(["http", "https"]).optional()
24109
- }), GetConnectionEndpointsResultSchema), method(_void(), NotificationEndpointSchema), method(object({ baseUrl: string().nullable() }), NotificationEndpointSchema, { kind: "mutation" }), method(_void(), AllowedAddressesSchema), method(AllowedAddressesSchema, object({ success: literal(true) }), { kind: "mutation" }), method(_void(), AllowedAddressesSchema, { kind: "mutation" });
24347
+ }), GetConnectionEndpointsResultSchema), method(_void(), NotificationEndpointSchema), method(object({ baseUrl: string().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, {
24348
+ kind: "mutation",
24349
+ auth: "admin"
24350
+ }), method(object({
24351
+ certPem: string().min(1),
24352
+ keyPem: string().min(1),
24353
+ caPem: string().optional()
24354
+ }), TlsStatusSchema, {
24355
+ kind: "mutation",
24356
+ auth: "admin"
24357
+ }), method(_void(), object({ pem: string() })), method(_void(), TlsStatusSchema, {
24358
+ kind: "mutation",
24359
+ auth: "admin"
24360
+ });
24110
24361
  var LockControlStatusSchema = object({
24111
24362
  /** Lifecycle state of the lock. `jammed` means the motor reported
24112
24363
  * failure to reach the target — operator intervention required. */
@@ -25713,7 +25964,12 @@ var PlateInfoSchema = object({
25713
25964
  plateBbox: BoundingBoxSchema.optional(),
25714
25965
  /** keyFrame parity: MediaStore key of the track's native-resolution key frame. */
25715
25966
  keyFrameMediaKey: string().optional(),
25716
- base64: string().optional()
25967
+ base64: string().optional(),
25968
+ /**
25969
+ * Same crop as a data-plane URL. `getPlateByTrack` returns this and
25970
+ * never inlines JPEG; `listPlates` still inlines for the admin-ui.
25971
+ */
25972
+ cropUrl: string().optional()
25717
25973
  });
25718
25974
  var MediaFileLiteSchema = object({
25719
25975
  key: string(),
@@ -31683,6 +31939,12 @@ Object.freeze({
31683
31939
  addonId: null,
31684
31940
  access: "view"
31685
31941
  },
31942
+ "deviceManager.getBindingsBatch": {
31943
+ capName: "device-manager",
31944
+ capScope: "system",
31945
+ addonId: null,
31946
+ access: "view"
31947
+ },
31686
31948
  "deviceManager.getChildren": {
31687
31949
  capName: "device-manager",
31688
31950
  capScope: "system",
@@ -31743,6 +32005,12 @@ Object.freeze({
31743
32005
  addonId: null,
31744
32006
  access: "view"
31745
32007
  },
32008
+ "deviceManager.getLinkedDevicesBatch": {
32009
+ capName: "device-manager",
32010
+ capScope: "system",
32011
+ addonId: null,
32012
+ access: "view"
32013
+ },
31746
32014
  "deviceManager.getRoleDisplayDefaults": {
31747
32015
  capName: "device-manager",
31748
32016
  capScope: "system",
@@ -32625,6 +32893,12 @@ Object.freeze({
32625
32893
  addonId: null,
32626
32894
  access: "create"
32627
32895
  },
32896
+ "localNetwork.downloadCa": {
32897
+ capName: "local-network",
32898
+ capScope: "system",
32899
+ addonId: null,
32900
+ access: "view"
32901
+ },
32628
32902
  "localNetwork.getAllowedAddresses": {
32629
32903
  capName: "local-network",
32630
32904
  capScope: "system",
@@ -32649,18 +32923,42 @@ Object.freeze({
32649
32923
  addonId: null,
32650
32924
  access: "view"
32651
32925
  },
32926
+ "localNetwork.getTlsStatus": {
32927
+ capName: "local-network",
32928
+ capScope: "system",
32929
+ addonId: null,
32930
+ access: "view"
32931
+ },
32932
+ "localNetwork.getViewerEndpoints": {
32933
+ capName: "local-network",
32934
+ capScope: "system",
32935
+ addonId: null,
32936
+ access: "view"
32937
+ },
32652
32938
  "localNetwork.list": {
32653
32939
  capName: "local-network",
32654
32940
  capScope: "system",
32655
32941
  addonId: null,
32656
32942
  access: "view"
32657
32943
  },
32944
+ "localNetwork.regenerateCertificate": {
32945
+ capName: "local-network",
32946
+ capScope: "system",
32947
+ addonId: null,
32948
+ access: "create"
32949
+ },
32658
32950
  "localNetwork.resetAllowlistToBestMatch": {
32659
32951
  capName: "local-network",
32660
32952
  capScope: "system",
32661
32953
  addonId: null,
32662
32954
  access: "delete"
32663
32955
  },
32956
+ "localNetwork.revertToGeneratedCertificate": {
32957
+ capName: "local-network",
32958
+ capScope: "system",
32959
+ addonId: null,
32960
+ access: "create"
32961
+ },
32664
32962
  "localNetwork.setAllowedAddresses": {
32665
32963
  capName: "local-network",
32666
32964
  capScope: "system",
@@ -32673,6 +32971,18 @@ Object.freeze({
32673
32971
  addonId: null,
32674
32972
  access: "create"
32675
32973
  },
32974
+ "localNetwork.setViewerEndpoints": {
32975
+ capName: "local-network",
32976
+ capScope: "system",
32977
+ addonId: null,
32978
+ access: "create"
32979
+ },
32980
+ "localNetwork.uploadCertificate": {
32981
+ capName: "local-network",
32982
+ capScope: "system",
32983
+ addonId: null,
32984
+ access: "create"
32985
+ },
32676
32986
  "lockControl.lock": {
32677
32987
  capName: "lock-control",
32678
32988
  capScope: "device",
@@ -33471,6 +33781,12 @@ Object.freeze({
33471
33781
  addonId: null,
33472
33782
  access: "view"
33473
33783
  },
33784
+ "pipelineAnalytics.getGroup": {
33785
+ capName: "pipeline-analytics",
33786
+ capScope: "device",
33787
+ addonId: null,
33788
+ access: "view"
33789
+ },
33474
33790
  "pipelineAnalytics.getKeyEvents": {
33475
33791
  capName: "pipeline-analytics",
33476
33792
  capScope: "device",
@@ -33555,6 +33871,12 @@ Object.freeze({
33555
33871
  addonId: null,
33556
33872
  access: "view"
33557
33873
  },
33874
+ "pipelineAnalytics.listGroups": {
33875
+ capName: "pipeline-analytics",
33876
+ capScope: "device",
33877
+ addonId: null,
33878
+ access: "view"
33879
+ },
33558
33880
  "pipelineAnalytics.listOpsLog": {
33559
33881
  capName: "pipeline-analytics",
33560
33882
  capScope: "device",
@@ -35553,6 +35875,12 @@ Object.freeze({
35553
35875
  addonId: null,
35554
35876
  access: "create"
35555
35877
  },
35878
+ "terminalSession.updateInstance": {
35879
+ capName: "terminal-session",
35880
+ capScope: "system",
35881
+ addonId: null,
35882
+ access: "create"
35883
+ },
35556
35884
  "terminalSession.writeInput": {
35557
35885
  capName: "terminal-session",
35558
35886
  capScope: "system",
@@ -36330,6 +36658,11 @@ Object.freeze({
36330
36658
  form: "single",
36331
36659
  optional: false
36332
36660
  }],
36661
+ "deviceManager.getBindingsBatch": [{
36662
+ name: "deviceIds",
36663
+ form: "array",
36664
+ optional: false
36665
+ }],
36333
36666
  "deviceManager.getChildren": [{
36334
36667
  name: "parentDeviceId",
36335
36668
  form: "single",
@@ -36375,6 +36708,11 @@ Object.freeze({
36375
36708
  form: "single",
36376
36709
  optional: false
36377
36710
  }],
36711
+ "deviceManager.getLinkedDevicesBatch": [{
36712
+ name: "deviceIds",
36713
+ form: "array",
36714
+ optional: false
36715
+ }],
36378
36716
  "deviceManager.getSettingsSchema": [{
36379
36717
  name: "deviceId",
36380
36718
  form: "single",
@@ -36395,6 +36733,11 @@ Object.freeze({
36395
36733
  form: "single",
36396
36734
  optional: false
36397
36735
  }],
36736
+ "deviceManager.listAll": [{
36737
+ name: "deviceIds",
36738
+ form: "array",
36739
+ optional: true
36740
+ }],
36398
36741
  "deviceManager.loadConfig": [{
36399
36742
  name: "deviceId",
36400
36743
  form: "single",
@@ -36968,6 +37311,11 @@ Object.freeze({
36968
37311
  form: "single",
36969
37312
  optional: false
36970
37313
  }],
37314
+ "pipelineAnalytics.getGroup": [{
37315
+ name: "deviceId",
37316
+ form: "single",
37317
+ optional: false
37318
+ }],
36971
37319
  "pipelineAnalytics.getKeyEvents": [{
36972
37320
  name: "deviceId",
36973
37321
  form: "single",
@@ -37023,6 +37371,11 @@ Object.freeze({
37023
37371
  form: "array",
37024
37372
  optional: false
37025
37373
  }],
37374
+ "pipelineAnalytics.listGroups": [{
37375
+ name: "deviceIds",
37376
+ form: "array",
37377
+ optional: false
37378
+ }],
37026
37379
  "pipelineAnalytics.listOpsLog": [{
37027
37380
  name: "deviceId",
37028
37381
  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.