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