@camstack/addon-mqtt-broker 1.2.26 → 1.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.
@@ -5846,6 +5846,13 @@ var BaseAddon = class {
5846
5846
  _readinessGeneration = typeof crypto !== "undefined" && crypto.randomUUID ? crypto.randomUUID() : Math.random().toString(36).slice(2, 14);
5847
5847
  /** Capability names this addon registered at init — used to emit matching `down` events on shutdown. */
5848
5848
  _registeredCapNames = [];
5849
+ /**
5850
+ * True only after `readAddonStore` actually answered. Constructor
5851
+ * defaults look like stored config when the store is down — a forked
5852
+ * addon that auto-starts from those defaults (cloudflare-tunnel quick
5853
+ * mode, 2026-08-25) is not "the operator chose this".
5854
+ */
5855
+ settingsStoreReady = false;
5849
5856
  /** Default config values. Provided via constructor. */
5850
5857
  defaults;
5851
5858
  constructor(defaults) {
@@ -6246,7 +6253,9 @@ var BaseAddon = class {
6246
6253
  ];
6247
6254
  let lastErr;
6248
6255
  for (let attempt = 0; attempt <= delaysMs.length; attempt++) try {
6249
- return await settings.readAddonStore() ?? {};
6256
+ const stored = await settings.readAddonStore() ?? {};
6257
+ this.settingsStoreReady = true;
6258
+ return stored;
6250
6259
  } catch (err) {
6251
6260
  lastErr = err;
6252
6261
  const msg = err instanceof Error ? err.message : String(err);
@@ -6254,6 +6263,7 @@ var BaseAddon = class {
6254
6263
  if (attempt === delaysMs.length) break;
6255
6264
  await new Promise((r) => setTimeout(r, delaysMs[attempt]));
6256
6265
  }
6266
+ this.settingsStoreReady = false;
6257
6267
  this._ctx?.logger?.warn?.("readAddonStore: settings-store unavailable after retries — using defaults", { meta: { error: lastErr instanceof Error ? lastErr.message : String(lastErr) } });
6258
6268
  return {};
6259
6269
  }
@@ -8049,6 +8059,15 @@ var LabelDefinitionSchema = object({
8049
8059
  description: string().optional(),
8050
8060
  icon: string().optional()
8051
8061
  });
8062
+ var ClassMapDefinitionSchema = object({
8063
+ mapping: record(string(), _enum([
8064
+ "person",
8065
+ "vehicle",
8066
+ "animal",
8067
+ "package"
8068
+ ])),
8069
+ preserveOriginal: boolean()
8070
+ });
8052
8071
  var MODEL_FORMATS = [
8053
8072
  "onnx",
8054
8073
  "coreml",
@@ -8132,6 +8151,12 @@ var ModelVariantGroupSchema = object({
8132
8151
  */
8133
8152
  resolution: number().int().positive().optional()
8134
8153
  });
8154
+ var ModelProviderIdSchema = _enum([
8155
+ "camstack",
8156
+ "frigate",
8157
+ "scrypted",
8158
+ "custom"
8159
+ ]);
8135
8160
  var ModelCatalogEntrySchema = object({
8136
8161
  id: string(),
8137
8162
  name: string(),
@@ -8227,7 +8252,19 @@ var ModelCatalogEntrySchema = object({
8227
8252
  * `id` stays the source of truth for resolution/download/persistence; grouping
8228
8253
  * is a presentation overlay resolved back to an `id`.
8229
8254
  */
8230
- group: ModelVariantGroupSchema.optional()
8255
+ group: ModelVariantGroupSchema.optional(),
8256
+ /**
8257
+ * Catalog source for the pipeline stepper's provider-first picker. Absent on
8258
+ * built-in CamStack entries (treated as `camstack`) and on registry rows
8259
+ * persisted before this field existed (`inferModelProvider` fills those).
8260
+ */
8261
+ provider: ModelProviderIdSchema.optional(),
8262
+ /**
8263
+ * Per-MODEL class map override. Absent ⇒ the step's `StepDefinition.classMap`
8264
+ * applies (Frigate / COCO public catalog). Set on a custom model whose raw
8265
+ * labels already ARE the CamStack macros (Scrypted identity map).
8266
+ */
8267
+ classMap: ClassMapDefinitionSchema.optional()
8231
8268
  });
8232
8269
  var ConvertTargetSchema = discriminatedUnion("format", [object({
8233
8270
  format: literal("openvino"),
@@ -8256,7 +8293,8 @@ var ModelConvertMetadataSchema = object({
8256
8293
  "ocr",
8257
8294
  "segmentation"
8258
8295
  ]),
8259
- faceAlignment: boolean().optional()
8296
+ faceAlignment: boolean().optional(),
8297
+ classMap: ClassMapDefinitionSchema.optional()
8260
8298
  });
8261
8299
  var ConvertResultSchema = object({
8262
8300
  entry: ModelCatalogEntrySchema,
@@ -11798,6 +11836,27 @@ var LinkedDeviceSchema = object({
11798
11836
  features: array(string()),
11799
11837
  producesTrackedEvents: boolean().optional()
11800
11838
  });
11839
+ /** One camera's resolved linked set, tagged with the camera it belongs to.
11840
+ * The batch answer needs the tag; the single-device answer already has it
11841
+ * from the input, which is why `getLinkedDevices` keeps the untagged shape. */
11842
+ var LinkedDevicesForDeviceSchema = object({
11843
+ deviceId: number(),
11844
+ mode: LinkedDevicesModeSchema,
11845
+ devices: array(LinkedDeviceSchema)
11846
+ });
11847
+ /** One device's binding map — the shape `getBindings`, `getBindingsBatch` and
11848
+ * `getAllBindings` all answer in. Declared once: three copies of the same
11849
+ * object literal is exactly how the three drift apart. */
11850
+ var DeviceBindingsForDeviceSchema = object({
11851
+ deviceId: number(),
11852
+ entries: array(object({
11853
+ capName: string(),
11854
+ kind: _enum(["native", "wrapped"]),
11855
+ providerAddonId: string(),
11856
+ providerNodeId: string(),
11857
+ nativeAddonId: string()
11858
+ }))
11859
+ });
11801
11860
  var SavedDeviceRowSchema = object({
11802
11861
  /** Numeric id reserved at allocateDeviceId time. */
11803
11862
  id: number(),
@@ -12023,11 +12082,25 @@ method(object({
12023
12082
  projection: _enum(["full", "slim"]).optional(),
12024
12083
  /** Return only camera devices. Filtering server-side instead of
12025
12084
  * shipping 293 rows to find 12. */
12026
- isCamera: boolean().optional()
12085
+ isCamera: boolean().optional(),
12086
+ /**
12087
+ * Return only these device ids. For the caller that already KNOWS the
12088
+ * handful it wants and needs a field the id-bearing answer does not
12089
+ * carry — the viewer's linked-devices panel joins `type` and `online`
12090
+ * onto ~8 linked ids and, unfiltered, dragged the fleet across to do
12091
+ * it: 433 KB slim / 958 KB full for 967 devices, on a query that
12092
+ * refetches on the reconcile interval, on a phone.
12093
+ *
12094
+ * Safe to send at a hub that predates it: Zod STRIPS unknown input
12095
+ * keys rather than rejecting them (verified against the live hub
12096
+ * 2026-08-25 — 967 rows came back), so an old hub answers exactly what
12097
+ * it answers today and the caller filters as it already does.
12098
+ */
12099
+ deviceIds: array(number()).optional()
12027
12100
  }), array(DeviceInfoSchema)), method(object({ deviceId: number() }), DeviceInfoSchema.nullable()), method(object({ parentDeviceId: number() }), array(DeviceInfoSchema)), method(object({ deviceId: number() }), object({
12028
12101
  mode: LinkedDevicesModeSchema,
12029
12102
  devices: array(LinkedDeviceSchema)
12030
- })), method(object({ deviceId: number() }), array(StreamSourceEntrySchema$1)), method(object({ deviceId: number() }), array(ConfigEntrySchema)), method(object({ deviceId: number() }), ConfigUISchemaOutput), method(object({
12103
+ })), 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({
12031
12104
  deviceId: number(),
12032
12105
  values: record(string(), unknown())
12033
12106
  }), object({ success: literal(true) }), {
@@ -12054,25 +12127,7 @@ method(object({
12054
12127
  }), method(object({ deviceId: number() }), array(StreamProbeResultSchema), {
12055
12128
  kind: "mutation",
12056
12129
  auth: "admin"
12057
- }), method(object({ deviceId: number() }), object({
12058
- deviceId: number(),
12059
- entries: array(object({
12060
- capName: string(),
12061
- kind: _enum(["native", "wrapped"]),
12062
- providerAddonId: string(),
12063
- providerNodeId: string(),
12064
- nativeAddonId: string()
12065
- }))
12066
- })), method(object({}), array(object({
12067
- deviceId: number(),
12068
- entries: array(object({
12069
- capName: string(),
12070
- kind: _enum(["native", "wrapped"]),
12071
- providerAddonId: string(),
12072
- providerNodeId: string(),
12073
- nativeAddonId: string()
12074
- }))
12075
- }))), method(object({
12130
+ }), method(object({ deviceId: number() }), DeviceBindingsForDeviceSchema), method(object({ deviceIds: array(number()) }), array(DeviceBindingsForDeviceSchema)), method(object({}), array(DeviceBindingsForDeviceSchema)), method(object({
12076
12131
  deviceId: number(),
12077
12132
  capName: string(),
12078
12133
  wrapperAddonId: string(),
@@ -14463,12 +14518,15 @@ var NcOccupancyConditionSchema = object({
14463
14518
  * there is no second switch that can disagree with the first and every rule
14464
14519
  * authored before the decision migrates for free (`audioModeOf`):
14465
14520
  *
14466
- * - **LABEL mode — `labels` present.** The rule fires on the FIRST frame the
14467
- * classifier labels with one of them. No window, no percentage:
14468
- * `hitPercent` and `samplingSeconds` are ignored, and the rule's own
14469
- * `throttle` cooldown is the only brake. The per-label confidence floor is
14470
- * the analyzer's (`classificationMinScore`, per device) a label only
14471
- * reaches this condition if the classifier was already confident enough.
14521
+ * - **LABEL mode — `labels` present.** The rule fires when `confirmHits`
14522
+ * labelled frames land inside `confirmWindowSec` (default 2 in 5 s).
14523
+ * `hitPercent` and `samplingSeconds` are still ignored a percentage of
14524
+ * frames is the wrong question for a classifier that labels 1–3 frames
14525
+ * per episode. The count window is the brake that drops a single-frame
14526
+ * false positive; the rule's own `throttle` cooldown is the other. The
14527
+ * per-label confidence floor is the analyzer's (`classificationMinScore`,
14528
+ * per device) — a label only reaches this condition if the classifier was
14529
+ * already confident enough. `confirmHits: 1` restores first-frame fire.
14472
14530
  * - **LEVEL mode — `dbThreshold` present, no labels.** The sampling window IS
14473
14531
  * the condition: at least `hitPercent`% of the samples over
14474
14532
  * `samplingSeconds` must be at or above `dbThreshold` dBFS (see
@@ -14495,14 +14553,22 @@ var NcOccupancyConditionSchema = object({
14495
14553
  * an operator who typed `dog` mean the same thing.
14496
14554
  */
14497
14555
  var NcAudioConditionSchema = object({
14498
- /** LABEL MODE: audio macro labels. Present ⇒ fires on the first labelled frame. */
14556
+ /** LABEL MODE: audio macro labels. Present ⇒ count-in-window confirm. */
14499
14557
  labels: array(string().min(1)).min(1).optional(),
14500
14558
  /** LEVEL MODE: floor in dBFS (negative-going, `0` = full scale). */
14501
14559
  dbThreshold: number().min(-96).max(0).optional(),
14502
14560
  /** LEVEL MODE ONLY: percentage of the window's samples that must be hits (1–100). */
14503
14561
  hitPercent: number().int().min(1).max(100).default(60),
14504
14562
  /** LEVEL MODE ONLY: length of the sampling window in seconds. */
14505
- samplingSeconds: number().int().min(1).max(300).default(10)
14563
+ samplingSeconds: number().int().min(1).max(300).default(10),
14564
+ /**
14565
+ * LABEL MODE: how many labelled frames must land inside
14566
+ * {@link NcAudioConditionSchema.shape.confirmWindowSec} before dispatch.
14567
+ * Absent ⇒ 2 (the matcher default). `1` is first-frame fire.
14568
+ */
14569
+ confirmHits: number().int().min(1).max(20).optional(),
14570
+ /** LABEL MODE: the window those frames must share, in seconds. Absent ⇒ 5. */
14571
+ confirmWindowSec: number().int().min(1).max(60).optional()
14506
14572
  });
14507
14573
  /**
14508
14574
  * Which zone-crossing DIRECTION a rule accepts (`ObjectEvent.zoneCrossing`).
@@ -16876,6 +16942,46 @@ var RecentTracksPageSchema = object({
16876
16942
  /** Cursor for the next page, or null when this page is the last. */
16877
16943
  nextCursor: string().nullable()
16878
16944
  });
16945
+ var LIST_GROUPS_DEFAULT_LIMIT = 40;
16946
+ var LIST_GROUPS_MAX_LIMIT = 100;
16947
+ var AnalyticsGroupRecordSchema = object({
16948
+ id: string(),
16949
+ deviceId: number().int(),
16950
+ openedAt: number().int(),
16951
+ closedAt: number().int(),
16952
+ timestamp: number().int(),
16953
+ memberCount: number().int(),
16954
+ memberTrackIds: array(string()).readonly(),
16955
+ className: string(),
16956
+ classes: array(string()).readonly(),
16957
+ /** Relative event-media path, or null when the group has no picture yet. */
16958
+ mediaUrl: string().nullable(),
16959
+ singleton: boolean()
16960
+ });
16961
+ var AnalyticsGroupMemberSchema = object({
16962
+ trackId: string(),
16963
+ deviceId: number().int(),
16964
+ className: string(),
16965
+ firstSeen: number().int(),
16966
+ lastSeen: number().int(),
16967
+ mediaUrl: string().nullable()
16968
+ });
16969
+ var AnalyticsGroupDetailSchema = AnalyticsGroupRecordSchema.extend({ members: array(AnalyticsGroupMemberSchema).readonly() });
16970
+ var ListGroupsQueryInput = object({
16971
+ /** Devices to merge. An empty array yields `{ groups: [], nextCursor: null }`. */
16972
+ deviceIds: array(number()),
16973
+ /** Window lower bound on `closedAt` (inclusive). */
16974
+ since: number().optional(),
16975
+ /** Window upper bound on `openedAt` (inclusive). */
16976
+ until: number().optional(),
16977
+ limit: number().int().min(1).max(LIST_GROUPS_MAX_LIMIT).default(LIST_GROUPS_DEFAULT_LIMIT),
16978
+ /** Opaque continuation cursor from a previous page's `nextCursor`. */
16979
+ cursor: string().optional()
16980
+ });
16981
+ var ListGroupsPageSchema = object({
16982
+ groups: array(AnalyticsGroupRecordSchema).readonly(),
16983
+ nextCursor: string().nullable()
16984
+ });
16879
16985
  var KeyEventQueryInput = object({
16880
16986
  deviceId: number(),
16881
16987
  /** Window lower bound (track firstSeen ≥ since). */
@@ -16951,7 +17057,9 @@ var TrackCascadeCountsSchema = object({
16951
17057
  /** Unassigned plate reads removed (best-effort; plate leg deferred to plate-intelligence). */
16952
17058
  plates: number().int(),
16953
17059
  /** Per-track CLIP search vectors removed (best-effort). */
16954
- embeddings: number().int()
17060
+ embeddings: number().int(),
17061
+ /** Group membership + group rows removed with their last member (best-effort). */
17062
+ groups: number().int()
16955
17063
  });
16956
17064
  /** Disk-wins reconcile: media rows whose blobs are gone, then empty tracks. */
16957
17065
  var DiskReconcileCountsSchema = object({
@@ -17097,7 +17205,10 @@ DeviceType.Camera, method(object({ deviceId: number() }), array(TrackSchema).rea
17097
17205
  * stationary registry). Default false: the timeline lists passages,
17098
17206
  * not parking records (operator decision, 2026-08-15). */
17099
17207
  includeStationary: boolean().optional()
17100
- }), array(TrackSchema).readonly()), method(RecentTracksQueryInput, RecentTracksPageSchema), method(object({ deviceId: number() }), _void(), {
17208
+ }), array(TrackSchema).readonly()), method(RecentTracksQueryInput, RecentTracksPageSchema), method(ListGroupsQueryInput, ListGroupsPageSchema), method(object({
17209
+ deviceId: number(),
17210
+ groupId: string().min(1)
17211
+ }), AnalyticsGroupDetailSchema.nullable()), method(object({ deviceId: number() }), _void(), {
17101
17212
  kind: "mutation",
17102
17213
  auth: "admin"
17103
17214
  }), 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({
@@ -17315,6 +17426,33 @@ var NativeCropRefSchema = object({
17315
17426
  h: number()
17316
17427
  })
17317
17428
  });
17429
+ object({
17430
+ crop: object({
17431
+ left: number(),
17432
+ top: number(),
17433
+ width: number().positive(),
17434
+ height: number().positive()
17435
+ }).optional(),
17436
+ content: object({
17437
+ width: number().int().positive(),
17438
+ height: number().int().positive()
17439
+ }),
17440
+ fit: _enum(["stretch", "contain"]),
17441
+ format: _enum([
17442
+ "rgb",
17443
+ "gray",
17444
+ "jpeg"
17445
+ ])
17446
+ });
17447
+ var FrameRefSchema = object({
17448
+ registryId: string().min(1),
17449
+ id: string().min(1),
17450
+ width: number().int().positive(),
17451
+ height: number().int().positive(),
17452
+ format: _enum(["rgb", "gray"]),
17453
+ timestamp: number(),
17454
+ capturedAt: number().optional()
17455
+ });
17318
17456
  var ModelFormatSchema$1 = _enum([
17319
17457
  "onnx",
17320
17458
  "coreml",
@@ -17380,7 +17518,8 @@ var PipelineModelOptionSchema = object({
17380
17518
  sizeMB: number()
17381
17519
  })),
17382
17520
  group: ModelVariantGroupSchema.optional(),
17383
- legacy: boolean().optional()
17521
+ legacy: boolean().optional(),
17522
+ provider: ModelProviderIdSchema.optional()
17384
17523
  });
17385
17524
  var ConfigFieldBridge = custom();
17386
17525
  var PipelineAddonSchemaSchema = object({
@@ -17559,6 +17698,12 @@ method(_void(), array(PipelineEngineChoiceSchema)), method(_void(), PipelineEngi
17559
17698
  steps: array(PipelineStepInputSchema).min(1),
17560
17699
  frame: FrameInputSchema.optional(),
17561
17700
  /**
17701
+ * Process-local lazy frame. Valid only when caller and provider resolve
17702
+ * in the same execution-group process; split/cross-node callers use
17703
+ * `frame`/`image` inline compatibility instead.
17704
+ */
17705
+ frameRef: FrameRefSchema.optional(),
17706
+ /**
17562
17707
  * CB5 shm passthrough — a `FrameHandle` naming the same ring slot
17563
17708
  * the decoded pixels live in. One more member of the one-of
17564
17709
  * frame/frameHandle/image/imageBase64/referenceImage group.
@@ -17814,7 +17959,10 @@ var NativeCropResultSchema = object({
17814
17959
  * Which source served this crop, so a quality-sensitive consumer (the native
17815
17960
  * `keyFrame`) can reject a degraded fallback:
17816
17961
  * - `native` — cut from the decode worker's retained NATIVE surface (the
17817
- * quality path).
17962
+ * quality path). A subject-tile serve is also native-resolution and stays
17963
+ * `native` here: the public enum cannot name `tile` without a breaking cap
17964
+ * change. Runner telemetry distinguishes lease vs tile via `source` on the
17965
+ * internal crop result (`nativeHits` vs `tileHits`).
17818
17966
  * - `ram-fullframe` — the native surface MISSED but the request was full-frame,
17819
17967
  * so the ≤640 RAM `RetainedFrameStore` served it (honest lower-res; legit for
17820
17968
  * the blank-frame guard / 640-snapshot resolve, NOT for the clean keyFrame).
@@ -18305,12 +18453,41 @@ var RunnerLocalLoadSchema = object({
18305
18453
  * legacy `OrchestratorMetricsSchema` shape so existing dashboards keep
18306
18454
  * working unchanged when they switch to reading from the runner cap.
18307
18455
  */
18456
+ var FrameLazyCountersSchema = object({
18457
+ framesDecoded: number(),
18458
+ framesAdmitted: number(),
18459
+ framesDroppedPixelFree: number(),
18460
+ viewsMaterialized: number(),
18461
+ viewsSkipped: number(),
18462
+ workerToRunnerBytes: number(),
18463
+ runnerToPoolRawBytes: number(),
18464
+ runnerToPoolJpegBytes: number(),
18465
+ onDemandFullFrameRequests: number(),
18466
+ onDemandCropRequests: number(),
18467
+ nativeHits: number(),
18468
+ nativeMisses: number(),
18469
+ tileHits: number(),
18470
+ tileMisses: number(),
18471
+ fallbackHits: number(),
18472
+ fallbackMisses: number(),
18473
+ retainedWritesAvoided: number(),
18474
+ residentRefs: number(),
18475
+ residentBytes: number(),
18476
+ releases: number(),
18477
+ evictions: number(),
18478
+ staleMisses: number()
18479
+ });
18480
+ var FrameLazyMetricsSchema = object({
18481
+ node: FrameLazyCountersSchema,
18482
+ cameras: array(FrameLazyCountersSchema.extend({ deviceId: number() }))
18483
+ });
18308
18484
  var RunnerLocalMetricsSchema = object({
18309
18485
  nodeId: string(),
18310
18486
  activeCameras: number(),
18311
18487
  throttledCameras: number(),
18312
18488
  avgInferenceTimeMs: number(),
18313
- queueDepth: number()
18489
+ queueDepth: number(),
18490
+ frameLazy: FrameLazyMetricsSchema.optional()
18314
18491
  });
18315
18492
  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({
18316
18493
  handle: FrameHandleSchema,
@@ -19610,6 +19787,9 @@ method(_void(), ProviderInfoSchema), method(object({ config: record(string(), un
19610
19787
  location: StorageLocationSchema,
19611
19788
  relativePath: string()
19612
19789
  }), _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" });
19790
+ /** Profile-exported FormBuilder schema. Shape is ConfigUISchema at the UI. */
19791
+ var ProfileSettingsSchemaBridge = unknown().nullable();
19792
+ var ProfileSettingsBagSchema = record(string(), unknown());
19613
19793
  /**
19614
19794
  * A live terminal session hosted by the provider addon. Output and input do
19615
19795
  * NOT flow through the capability — they use the addon data plane
@@ -19639,7 +19819,14 @@ var TerminalSessionInfoSchema = object({
19639
19819
  var TerminalProfileInfoSchema = object({
19640
19820
  profileId: string(),
19641
19821
  label: string(),
19642
- description: string().optional()
19822
+ description: string().optional(),
19823
+ /** Spawn defaults the instance form copies on create. */
19824
+ executable: string().optional(),
19825
+ args: array(string()).readonly().optional(),
19826
+ cwd: string().optional(),
19827
+ environment: array(string()).readonly().optional(),
19828
+ /** ConfigUISchema for instance knobs, or null when the profile has none. */
19829
+ settingsSchema: ProfileSettingsSchemaBridge.optional()
19643
19830
  });
19644
19831
  /**
19645
19832
  * A durable operator-created Terminal instance. Profiles are templates; only
@@ -19652,7 +19839,12 @@ var TerminalInstanceInfoSchema = object({
19652
19839
  profileId: string(),
19653
19840
  profileLabel: string(),
19654
19841
  name: string(),
19655
- enabled: boolean()
19842
+ enabled: boolean(),
19843
+ executable: string(),
19844
+ args: array(string()).readonly(),
19845
+ cwd: string(),
19846
+ environment: array(string()).readonly(),
19847
+ profileSettings: ProfileSettingsBagSchema
19656
19848
  });
19657
19849
  var TerminalLegacyCameraSchema = object({
19658
19850
  stableId: string(),
@@ -19682,7 +19874,23 @@ var TerminalOutputBatchSchema = object({
19682
19874
  method(_void(), array(TerminalProfileInfoSchema).readonly(), { auth: "admin" }), method(_void(), array(TerminalInstanceInfoSchema).readonly(), { auth: "admin" }), method(object({
19683
19875
  targetNodeId: string().min(1),
19684
19876
  profileId: string().min(1),
19685
- name: string().trim().min(1).max(160).optional()
19877
+ name: string().trim().min(1).max(160).optional(),
19878
+ executable: string().max(1024).optional(),
19879
+ args: array(string().max(2048)).max(64).optional(),
19880
+ cwd: string().max(1024).optional(),
19881
+ environment: array(string().max(4096)).max(64).optional(),
19882
+ profileSettings: ProfileSettingsBagSchema.optional()
19883
+ }), TerminalInstanceInfoSchema, {
19884
+ kind: "mutation",
19885
+ auth: "admin"
19886
+ }), method(object({
19887
+ instanceId: string().min(1),
19888
+ name: string().trim().min(1).max(160).optional(),
19889
+ executable: string().max(1024).optional(),
19890
+ args: array(string().max(2048)).max(64).optional(),
19891
+ cwd: string().max(1024).optional(),
19892
+ environment: array(string().max(4096)).max(64).optional(),
19893
+ profileSettings: ProfileSettingsBagSchema.optional()
19686
19894
  }), TerminalInstanceInfoSchema, {
19687
19895
  kind: "mutation",
19688
19896
  auth: "admin"
@@ -19704,7 +19912,11 @@ method(_void(), array(TerminalProfileInfoSchema).readonly(), { auth: "admin" }),
19704
19912
  }), method(_void(), array(TerminalSessionInfoSchema).readonly(), { auth: "admin" }), method(object({
19705
19913
  profileId: string(),
19706
19914
  cols: number().int().positive(),
19707
- rows: number().int().positive()
19915
+ rows: number().int().positive(),
19916
+ executable: string().max(1024).optional(),
19917
+ args: array(string().max(2048)).max(64).optional(),
19918
+ cwd: string().max(1024).optional(),
19919
+ environment: array(string().max(4096)).max(64).optional()
19708
19920
  }), TerminalSessionInfoSchema, {
19709
19921
  kind: "mutation",
19710
19922
  auth: "admin"
@@ -22486,10 +22698,10 @@ DeviceType.LawnMower, method(object({ deviceId: number().int().nonnegative() }),
22486
22698
  *
22487
22699
  * • The SDK (mobile / web client) consumes `getConnectionEndpoints()`
22488
22700
  * to receive an ordered list of candidate base URLs it should race
22489
- * on connect — LAN IPv4 first (lowest latency when on same network),
22490
- * then public hostname (if a tunnel is up), then IPv6. The SDK can
22491
- * race them with short timeouts and stick with the winner for the
22492
- * session.
22701
+ * on connect — LAN IPv4 and stable LAN IPv6 first (lowest latency
22702
+ * when on the same network), then public hostname (if a tunnel is
22703
+ * up). The SDK can race them with short timeouts and stick with the
22704
+ * winner for the session.
22493
22705
  *
22494
22706
  * Why hub-only: agents are not directly addressable by the operator's
22495
22707
  * clients — they reverse-connect to the hub. Exposing their interfaces
@@ -22644,6 +22856,17 @@ var NotificationEndpointSchema = object({
22644
22856
  /** What the ranking currently resolves to (null when nothing is reachable). */
22645
22857
  resolved: string().nullable()
22646
22858
  });
22859
+ /**
22860
+ * The URLs the SDK / viewer should race for API access. `baseUrls` empty =
22861
+ * AUTO (every LAN IPv4 + the public tunnel). `resolved` is what that choice
22862
+ * currently expands to, so the UI can show the effective set either way.
22863
+ */
22864
+ var ViewerEndpointsSchema = object({
22865
+ /** The operator's explicit race set, or empty for AUTO. */
22866
+ baseUrls: array(string()).readonly(),
22867
+ /** What the ranking currently resolves to (may be empty if nothing is up). */
22868
+ resolved: array(string()).readonly()
22869
+ });
22647
22870
  var AllowedAddressesSchema = object({
22648
22871
  /**
22649
22872
  * Allowlist of interface addresses operators have explicitly opted
@@ -22652,6 +22875,20 @@ var AllowedAddressesSchema = object({
22652
22875
  * Network Addresses admin page and persisted by the addon.
22653
22876
  */
22654
22877
  addresses: array(string()).readonly() });
22878
+ var TlsStatusSchema = object({
22879
+ mode: _enum([
22880
+ "generated",
22881
+ "uploaded",
22882
+ "disabled"
22883
+ ]),
22884
+ leafFingerprintSha256: string().nullable(),
22885
+ caFingerprintSha256: string().nullable(),
22886
+ validTo: string().nullable(),
22887
+ sans: array(string()),
22888
+ caCertPem: string().nullable(),
22889
+ reissueError: string().nullable(),
22890
+ restartRequired: boolean()
22891
+ });
22655
22892
  method(_void(), ListResultSchema), method(_void(), PreferredSchema), method(object({
22656
22893
  /**
22657
22894
  * LEGACY HINT — do not send from new code. Kept optional so clients
@@ -22661,17 +22898,31 @@ method(_void(), ListResultSchema), method(_void(), PreferredSchema), method(obje
22661
22898
  */
22662
22899
  port: number().int().min(1).max(65535).optional(),
22663
22900
  /** Include `http(s)://127.0.0.1:<port>` as the lowest-priority
22664
- * candidate. Default `true`. */
22901
+ * candidate. Default `false` — loopback is not a client route. */
22665
22902
  includeLoopback: boolean().optional(),
22666
- /** Skip IPv6 entries. Some legacy clients can't parse them.
22667
- * Default `false`. */
22903
+ /** Skip IPv6 entries. Default `false` the palette includes stable
22904
+ * LAN IPv6 (ICE/WebRTC uses dual-stack regardless). Pass `true` to
22905
+ * hide them. The viewer HTTP/WS race is `getViewerEndpoints`. */
22668
22906
  ipv4Only: boolean().optional(),
22669
22907
  /** Scheme to emit for LAN/loopback URLs. Default `'http'`.
22670
22908
  * Pass `'https'` when the caller is itself loaded over HTTPS
22671
22909
  * to avoid mixed-content blocks in the browser. The public
22672
22910
  * tunnel always emits `https://` regardless. */
22673
22911
  scheme: _enum(["http", "https"]).optional()
22674
- }), 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" });
22912
+ }), 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, {
22913
+ kind: "mutation",
22914
+ auth: "admin"
22915
+ }), method(object({
22916
+ certPem: string().min(1),
22917
+ keyPem: string().min(1),
22918
+ caPem: string().optional()
22919
+ }), TlsStatusSchema, {
22920
+ kind: "mutation",
22921
+ auth: "admin"
22922
+ }), method(_void(), object({ pem: string() })), method(_void(), TlsStatusSchema, {
22923
+ kind: "mutation",
22924
+ auth: "admin"
22925
+ });
22675
22926
  object({
22676
22927
  /** Lifecycle state of the lock. `jammed` means the motor reported
22677
22928
  * failure to reach the target — operator intervention required. */
@@ -23852,7 +24103,12 @@ var PlateInfoSchema = object({
23852
24103
  plateBbox: BoundingBoxSchema.optional(),
23853
24104
  /** keyFrame parity: MediaStore key of the track's native-resolution key frame. */
23854
24105
  keyFrameMediaKey: string().optional(),
23855
- base64: string().optional()
24106
+ base64: string().optional(),
24107
+ /**
24108
+ * Same crop as a data-plane URL. `getPlateByTrack` returns this and
24109
+ * never inlines JPEG; `listPlates` still inlines for the admin-ui.
24110
+ */
24111
+ cropUrl: string().optional()
23856
24112
  });
23857
24113
  var MediaFileLiteSchema = object({
23858
24114
  key: string(),
@@ -27492,6 +27748,12 @@ Object.freeze({
27492
27748
  addonId: null,
27493
27749
  access: "view"
27494
27750
  },
27751
+ "deviceManager.getBindingsBatch": {
27752
+ capName: "device-manager",
27753
+ capScope: "system",
27754
+ addonId: null,
27755
+ access: "view"
27756
+ },
27495
27757
  "deviceManager.getChildren": {
27496
27758
  capName: "device-manager",
27497
27759
  capScope: "system",
@@ -27552,6 +27814,12 @@ Object.freeze({
27552
27814
  addonId: null,
27553
27815
  access: "view"
27554
27816
  },
27817
+ "deviceManager.getLinkedDevicesBatch": {
27818
+ capName: "device-manager",
27819
+ capScope: "system",
27820
+ addonId: null,
27821
+ access: "view"
27822
+ },
27555
27823
  "deviceManager.getRoleDisplayDefaults": {
27556
27824
  capName: "device-manager",
27557
27825
  capScope: "system",
@@ -28434,6 +28702,12 @@ Object.freeze({
28434
28702
  addonId: null,
28435
28703
  access: "create"
28436
28704
  },
28705
+ "localNetwork.downloadCa": {
28706
+ capName: "local-network",
28707
+ capScope: "system",
28708
+ addonId: null,
28709
+ access: "view"
28710
+ },
28437
28711
  "localNetwork.getAllowedAddresses": {
28438
28712
  capName: "local-network",
28439
28713
  capScope: "system",
@@ -28458,18 +28732,42 @@ Object.freeze({
28458
28732
  addonId: null,
28459
28733
  access: "view"
28460
28734
  },
28735
+ "localNetwork.getTlsStatus": {
28736
+ capName: "local-network",
28737
+ capScope: "system",
28738
+ addonId: null,
28739
+ access: "view"
28740
+ },
28741
+ "localNetwork.getViewerEndpoints": {
28742
+ capName: "local-network",
28743
+ capScope: "system",
28744
+ addonId: null,
28745
+ access: "view"
28746
+ },
28461
28747
  "localNetwork.list": {
28462
28748
  capName: "local-network",
28463
28749
  capScope: "system",
28464
28750
  addonId: null,
28465
28751
  access: "view"
28466
28752
  },
28753
+ "localNetwork.regenerateCertificate": {
28754
+ capName: "local-network",
28755
+ capScope: "system",
28756
+ addonId: null,
28757
+ access: "create"
28758
+ },
28467
28759
  "localNetwork.resetAllowlistToBestMatch": {
28468
28760
  capName: "local-network",
28469
28761
  capScope: "system",
28470
28762
  addonId: null,
28471
28763
  access: "delete"
28472
28764
  },
28765
+ "localNetwork.revertToGeneratedCertificate": {
28766
+ capName: "local-network",
28767
+ capScope: "system",
28768
+ addonId: null,
28769
+ access: "create"
28770
+ },
28473
28771
  "localNetwork.setAllowedAddresses": {
28474
28772
  capName: "local-network",
28475
28773
  capScope: "system",
@@ -28482,6 +28780,18 @@ Object.freeze({
28482
28780
  addonId: null,
28483
28781
  access: "create"
28484
28782
  },
28783
+ "localNetwork.setViewerEndpoints": {
28784
+ capName: "local-network",
28785
+ capScope: "system",
28786
+ addonId: null,
28787
+ access: "create"
28788
+ },
28789
+ "localNetwork.uploadCertificate": {
28790
+ capName: "local-network",
28791
+ capScope: "system",
28792
+ addonId: null,
28793
+ access: "create"
28794
+ },
28485
28795
  "lockControl.lock": {
28486
28796
  capName: "lock-control",
28487
28797
  capScope: "device",
@@ -29280,6 +29590,12 @@ Object.freeze({
29280
29590
  addonId: null,
29281
29591
  access: "view"
29282
29592
  },
29593
+ "pipelineAnalytics.getGroup": {
29594
+ capName: "pipeline-analytics",
29595
+ capScope: "device",
29596
+ addonId: null,
29597
+ access: "view"
29598
+ },
29283
29599
  "pipelineAnalytics.getKeyEvents": {
29284
29600
  capName: "pipeline-analytics",
29285
29601
  capScope: "device",
@@ -29364,6 +29680,12 @@ Object.freeze({
29364
29680
  addonId: null,
29365
29681
  access: "view"
29366
29682
  },
29683
+ "pipelineAnalytics.listGroups": {
29684
+ capName: "pipeline-analytics",
29685
+ capScope: "device",
29686
+ addonId: null,
29687
+ access: "view"
29688
+ },
29367
29689
  "pipelineAnalytics.listOpsLog": {
29368
29690
  capName: "pipeline-analytics",
29369
29691
  capScope: "device",
@@ -31362,6 +31684,12 @@ Object.freeze({
31362
31684
  addonId: null,
31363
31685
  access: "create"
31364
31686
  },
31687
+ "terminalSession.updateInstance": {
31688
+ capName: "terminal-session",
31689
+ capScope: "system",
31690
+ addonId: null,
31691
+ access: "create"
31692
+ },
31365
31693
  "terminalSession.writeInput": {
31366
31694
  capName: "terminal-session",
31367
31695
  capScope: "system",
@@ -32139,6 +32467,11 @@ Object.freeze({
32139
32467
  form: "single",
32140
32468
  optional: false
32141
32469
  }],
32470
+ "deviceManager.getBindingsBatch": [{
32471
+ name: "deviceIds",
32472
+ form: "array",
32473
+ optional: false
32474
+ }],
32142
32475
  "deviceManager.getChildren": [{
32143
32476
  name: "parentDeviceId",
32144
32477
  form: "single",
@@ -32184,6 +32517,11 @@ Object.freeze({
32184
32517
  form: "single",
32185
32518
  optional: false
32186
32519
  }],
32520
+ "deviceManager.getLinkedDevicesBatch": [{
32521
+ name: "deviceIds",
32522
+ form: "array",
32523
+ optional: false
32524
+ }],
32187
32525
  "deviceManager.getSettingsSchema": [{
32188
32526
  name: "deviceId",
32189
32527
  form: "single",
@@ -32204,6 +32542,11 @@ Object.freeze({
32204
32542
  form: "single",
32205
32543
  optional: false
32206
32544
  }],
32545
+ "deviceManager.listAll": [{
32546
+ name: "deviceIds",
32547
+ form: "array",
32548
+ optional: true
32549
+ }],
32207
32550
  "deviceManager.loadConfig": [{
32208
32551
  name: "deviceId",
32209
32552
  form: "single",
@@ -32777,6 +33120,11 @@ Object.freeze({
32777
33120
  form: "single",
32778
33121
  optional: false
32779
33122
  }],
33123
+ "pipelineAnalytics.getGroup": [{
33124
+ name: "deviceId",
33125
+ form: "single",
33126
+ optional: false
33127
+ }],
32780
33128
  "pipelineAnalytics.getKeyEvents": [{
32781
33129
  name: "deviceId",
32782
33130
  form: "single",
@@ -32832,6 +33180,11 @@ Object.freeze({
32832
33180
  form: "array",
32833
33181
  optional: false
32834
33182
  }],
33183
+ "pipelineAnalytics.listGroups": [{
33184
+ name: "deviceIds",
33185
+ form: "array",
33186
+ optional: false
33187
+ }],
32835
33188
  "pipelineAnalytics.listOpsLog": [{
32836
33189
  name: "deviceId",
32837
33190
  form: "single",
@@ -33849,6 +34202,35 @@ Object.freeze(Object.fromEntries([{
33849
34202
  }]
33850
34203
  }].map((s) => [s.stepId, s.defaultModelId])));
33851
34204
  string().min(1);
34205
+ var CLUSTER_STEP_SETTING_FIELDS = [{
34206
+ stepId: "face-embedding",
34207
+ key: "minLandmarkFaceSize",
34208
+ label: "Min face size for recognition (detection px)",
34209
+ 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.",
34210
+ type: "slider",
34211
+ min: 0,
34212
+ max: 64,
34213
+ step: 2,
34214
+ default: 24
34215
+ }];
34216
+ function clusterStepSettingKey(stepId, fieldKey) {
34217
+ return `clusterStepSetting:${stepId}:${fieldKey}`;
34218
+ }
34219
+ var ClusterSettingNumberSchema = number().finite();
34220
+ function readClusterStepSettings(config) {
34221
+ const out = {};
34222
+ for (const field of CLUSTER_STEP_SETTING_FIELDS) {
34223
+ const parsed = ClusterSettingNumberSchema.safeParse(config[clusterStepSettingKey(field.stepId, field.key)]);
34224
+ const value = parsed.success ? parsed.data : field.default;
34225
+ const existing = out[field.stepId] ?? {};
34226
+ out[field.stepId] = {
34227
+ ...existing,
34228
+ [field.key]: value
34229
+ };
34230
+ }
34231
+ return out;
34232
+ }
34233
+ readClusterStepSettings({});
33852
34234
  object({
33853
34235
  /**
33854
34236
  * Fraction of the box's own size added on EACH side before cutting.