@camstack/addon-remote-storage 1.2.25 → 1.2.27

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.
@@ -5802,6 +5802,13 @@ var BaseAddon = class {
5802
5802
  _readinessGeneration = typeof crypto !== "undefined" && crypto.randomUUID ? crypto.randomUUID() : Math.random().toString(36).slice(2, 14);
5803
5803
  /** Capability names this addon registered at init — used to emit matching `down` events on shutdown. */
5804
5804
  _registeredCapNames = [];
5805
+ /**
5806
+ * True only after `readAddonStore` actually answered. Constructor
5807
+ * defaults look like stored config when the store is down — a forked
5808
+ * addon that auto-starts from those defaults (cloudflare-tunnel quick
5809
+ * mode, 2026-08-25) is not "the operator chose this".
5810
+ */
5811
+ settingsStoreReady = false;
5805
5812
  /** Default config values. Provided via constructor. */
5806
5813
  defaults;
5807
5814
  constructor(defaults) {
@@ -6202,7 +6209,9 @@ var BaseAddon = class {
6202
6209
  ];
6203
6210
  let lastErr;
6204
6211
  for (let attempt = 0; attempt <= delaysMs.length; attempt++) try {
6205
- return await settings.readAddonStore() ?? {};
6212
+ const stored = await settings.readAddonStore() ?? {};
6213
+ this.settingsStoreReady = true;
6214
+ return stored;
6206
6215
  } catch (err) {
6207
6216
  lastErr = err;
6208
6217
  const msg = err instanceof Error ? err.message : String(err);
@@ -6210,6 +6219,7 @@ var BaseAddon = class {
6210
6219
  if (attempt === delaysMs.length) break;
6211
6220
  await new Promise((r) => setTimeout(r, delaysMs[attempt]));
6212
6221
  }
6222
+ this.settingsStoreReady = false;
6213
6223
  this._ctx?.logger?.warn?.("readAddonStore: settings-store unavailable after retries — using defaults", { meta: { error: lastErr instanceof Error ? lastErr.message : String(lastErr) } });
6214
6224
  return {};
6215
6225
  }
@@ -8005,6 +8015,15 @@ var LabelDefinitionSchema = object({
8005
8015
  description: string().optional(),
8006
8016
  icon: string().optional()
8007
8017
  });
8018
+ var ClassMapDefinitionSchema = object({
8019
+ mapping: record(string(), _enum([
8020
+ "person",
8021
+ "vehicle",
8022
+ "animal",
8023
+ "package"
8024
+ ])),
8025
+ preserveOriginal: boolean()
8026
+ });
8008
8027
  var MODEL_FORMATS = [
8009
8028
  "onnx",
8010
8029
  "coreml",
@@ -8088,6 +8107,12 @@ var ModelVariantGroupSchema = object({
8088
8107
  */
8089
8108
  resolution: number().int().positive().optional()
8090
8109
  });
8110
+ var ModelProviderIdSchema = _enum([
8111
+ "camstack",
8112
+ "frigate",
8113
+ "scrypted",
8114
+ "custom"
8115
+ ]);
8091
8116
  var ModelCatalogEntrySchema = object({
8092
8117
  id: string(),
8093
8118
  name: string(),
@@ -8183,7 +8208,19 @@ var ModelCatalogEntrySchema = object({
8183
8208
  * `id` stays the source of truth for resolution/download/persistence; grouping
8184
8209
  * is a presentation overlay resolved back to an `id`.
8185
8210
  */
8186
- group: ModelVariantGroupSchema.optional()
8211
+ group: ModelVariantGroupSchema.optional(),
8212
+ /**
8213
+ * Catalog source for the pipeline stepper's provider-first picker. Absent on
8214
+ * built-in CamStack entries (treated as `camstack`) and on registry rows
8215
+ * persisted before this field existed (`inferModelProvider` fills those).
8216
+ */
8217
+ provider: ModelProviderIdSchema.optional(),
8218
+ /**
8219
+ * Per-MODEL class map override. Absent ⇒ the step's `StepDefinition.classMap`
8220
+ * applies (Frigate / COCO public catalog). Set on a custom model whose raw
8221
+ * labels already ARE the CamStack macros (Scrypted identity map).
8222
+ */
8223
+ classMap: ClassMapDefinitionSchema.optional()
8187
8224
  });
8188
8225
  var ConvertTargetSchema = discriminatedUnion("format", [object({
8189
8226
  format: literal("openvino"),
@@ -8212,7 +8249,8 @@ var ModelConvertMetadataSchema = object({
8212
8249
  "ocr",
8213
8250
  "segmentation"
8214
8251
  ]),
8215
- faceAlignment: boolean().optional()
8252
+ faceAlignment: boolean().optional(),
8253
+ classMap: ClassMapDefinitionSchema.optional()
8216
8254
  });
8217
8255
  var ConvertResultSchema = object({
8218
8256
  entry: ModelCatalogEntrySchema,
@@ -11705,6 +11743,27 @@ var LinkedDeviceSchema = object({
11705
11743
  features: array(string()),
11706
11744
  producesTrackedEvents: boolean().optional()
11707
11745
  });
11746
+ /** One camera's resolved linked set, tagged with the camera it belongs to.
11747
+ * The batch answer needs the tag; the single-device answer already has it
11748
+ * from the input, which is why `getLinkedDevices` keeps the untagged shape. */
11749
+ var LinkedDevicesForDeviceSchema = object({
11750
+ deviceId: number(),
11751
+ mode: LinkedDevicesModeSchema,
11752
+ devices: array(LinkedDeviceSchema)
11753
+ });
11754
+ /** One device's binding map — the shape `getBindings`, `getBindingsBatch` and
11755
+ * `getAllBindings` all answer in. Declared once: three copies of the same
11756
+ * object literal is exactly how the three drift apart. */
11757
+ var DeviceBindingsForDeviceSchema = object({
11758
+ deviceId: number(),
11759
+ entries: array(object({
11760
+ capName: string(),
11761
+ kind: _enum(["native", "wrapped"]),
11762
+ providerAddonId: string(),
11763
+ providerNodeId: string(),
11764
+ nativeAddonId: string()
11765
+ }))
11766
+ });
11708
11767
  var SavedDeviceRowSchema = object({
11709
11768
  /** Numeric id reserved at allocateDeviceId time. */
11710
11769
  id: number(),
@@ -11930,11 +11989,25 @@ method(object({
11930
11989
  projection: _enum(["full", "slim"]).optional(),
11931
11990
  /** Return only camera devices. Filtering server-side instead of
11932
11991
  * shipping 293 rows to find 12. */
11933
- isCamera: boolean().optional()
11992
+ isCamera: boolean().optional(),
11993
+ /**
11994
+ * Return only these device ids. For the caller that already KNOWS the
11995
+ * handful it wants and needs a field the id-bearing answer does not
11996
+ * carry — the viewer's linked-devices panel joins `type` and `online`
11997
+ * onto ~8 linked ids and, unfiltered, dragged the fleet across to do
11998
+ * it: 433 KB slim / 958 KB full for 967 devices, on a query that
11999
+ * refetches on the reconcile interval, on a phone.
12000
+ *
12001
+ * Safe to send at a hub that predates it: Zod STRIPS unknown input
12002
+ * keys rather than rejecting them (verified against the live hub
12003
+ * 2026-08-25 — 967 rows came back), so an old hub answers exactly what
12004
+ * it answers today and the caller filters as it already does.
12005
+ */
12006
+ deviceIds: array(number()).optional()
11934
12007
  }), array(DeviceInfoSchema)), method(object({ deviceId: number() }), DeviceInfoSchema.nullable()), method(object({ parentDeviceId: number() }), array(DeviceInfoSchema)), method(object({ deviceId: number() }), object({
11935
12008
  mode: LinkedDevicesModeSchema,
11936
12009
  devices: array(LinkedDeviceSchema)
11937
- })), method(object({ deviceId: number() }), array(StreamSourceEntrySchema$1)), method(object({ deviceId: number() }), array(ConfigEntrySchema)), method(object({ deviceId: number() }), ConfigUISchemaOutput), method(object({
12010
+ })), 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({
11938
12011
  deviceId: number(),
11939
12012
  values: record(string(), unknown())
11940
12013
  }), object({ success: literal(true) }), {
@@ -11961,25 +12034,7 @@ method(object({
11961
12034
  }), method(object({ deviceId: number() }), array(StreamProbeResultSchema), {
11962
12035
  kind: "mutation",
11963
12036
  auth: "admin"
11964
- }), method(object({ deviceId: number() }), object({
11965
- deviceId: number(),
11966
- entries: array(object({
11967
- capName: string(),
11968
- kind: _enum(["native", "wrapped"]),
11969
- providerAddonId: string(),
11970
- providerNodeId: string(),
11971
- nativeAddonId: string()
11972
- }))
11973
- })), method(object({}), array(object({
11974
- deviceId: number(),
11975
- entries: array(object({
11976
- capName: string(),
11977
- kind: _enum(["native", "wrapped"]),
11978
- providerAddonId: string(),
11979
- providerNodeId: string(),
11980
- nativeAddonId: string()
11981
- }))
11982
- }))), method(object({
12037
+ }), method(object({ deviceId: number() }), DeviceBindingsForDeviceSchema), method(object({ deviceIds: array(number()) }), array(DeviceBindingsForDeviceSchema)), method(object({}), array(DeviceBindingsForDeviceSchema)), method(object({
11983
12038
  deviceId: number(),
11984
12039
  capName: string(),
11985
12040
  wrapperAddonId: string(),
@@ -14351,12 +14406,15 @@ var NcOccupancyConditionSchema = object({
14351
14406
  * there is no second switch that can disagree with the first and every rule
14352
14407
  * authored before the decision migrates for free (`audioModeOf`):
14353
14408
  *
14354
- * - **LABEL mode — `labels` present.** The rule fires on the FIRST frame the
14355
- * classifier labels with one of them. No window, no percentage:
14356
- * `hitPercent` and `samplingSeconds` are ignored, and the rule's own
14357
- * `throttle` cooldown is the only brake. The per-label confidence floor is
14358
- * the analyzer's (`classificationMinScore`, per device) a label only
14359
- * reaches this condition if the classifier was already confident enough.
14409
+ * - **LABEL mode — `labels` present.** The rule fires when `confirmHits`
14410
+ * labelled frames land inside `confirmWindowSec` (default 2 in 5 s).
14411
+ * `hitPercent` and `samplingSeconds` are still ignored a percentage of
14412
+ * frames is the wrong question for a classifier that labels 1–3 frames
14413
+ * per episode. The count window is the brake that drops a single-frame
14414
+ * false positive; the rule's own `throttle` cooldown is the other. The
14415
+ * per-label confidence floor is the analyzer's (`classificationMinScore`,
14416
+ * per device) — a label only reaches this condition if the classifier was
14417
+ * already confident enough. `confirmHits: 1` restores first-frame fire.
14360
14418
  * - **LEVEL mode — `dbThreshold` present, no labels.** The sampling window IS
14361
14419
  * the condition: at least `hitPercent`% of the samples over
14362
14420
  * `samplingSeconds` must be at or above `dbThreshold` dBFS (see
@@ -14383,14 +14441,22 @@ var NcOccupancyConditionSchema = object({
14383
14441
  * an operator who typed `dog` mean the same thing.
14384
14442
  */
14385
14443
  var NcAudioConditionSchema = object({
14386
- /** LABEL MODE: audio macro labels. Present ⇒ fires on the first labelled frame. */
14444
+ /** LABEL MODE: audio macro labels. Present ⇒ count-in-window confirm. */
14387
14445
  labels: array(string().min(1)).min(1).optional(),
14388
14446
  /** LEVEL MODE: floor in dBFS (negative-going, `0` = full scale). */
14389
14447
  dbThreshold: number().min(-96).max(0).optional(),
14390
14448
  /** LEVEL MODE ONLY: percentage of the window's samples that must be hits (1–100). */
14391
14449
  hitPercent: number().int().min(1).max(100).default(60),
14392
14450
  /** LEVEL MODE ONLY: length of the sampling window in seconds. */
14393
- samplingSeconds: number().int().min(1).max(300).default(10)
14451
+ samplingSeconds: number().int().min(1).max(300).default(10),
14452
+ /**
14453
+ * LABEL MODE: how many labelled frames must land inside
14454
+ * {@link NcAudioConditionSchema.shape.confirmWindowSec} before dispatch.
14455
+ * Absent ⇒ 2 (the matcher default). `1` is first-frame fire.
14456
+ */
14457
+ confirmHits: number().int().min(1).max(20).optional(),
14458
+ /** LABEL MODE: the window those frames must share, in seconds. Absent ⇒ 5. */
14459
+ confirmWindowSec: number().int().min(1).max(60).optional()
14394
14460
  });
14395
14461
  /**
14396
14462
  * Which zone-crossing DIRECTION a rule accepts (`ObjectEvent.zoneCrossing`).
@@ -16764,6 +16830,46 @@ var RecentTracksPageSchema = object({
16764
16830
  /** Cursor for the next page, or null when this page is the last. */
16765
16831
  nextCursor: string().nullable()
16766
16832
  });
16833
+ var LIST_GROUPS_DEFAULT_LIMIT = 40;
16834
+ var LIST_GROUPS_MAX_LIMIT = 100;
16835
+ var AnalyticsGroupRecordSchema = object({
16836
+ id: string(),
16837
+ deviceId: number().int(),
16838
+ openedAt: number().int(),
16839
+ closedAt: number().int(),
16840
+ timestamp: number().int(),
16841
+ memberCount: number().int(),
16842
+ memberTrackIds: array(string()).readonly(),
16843
+ className: string(),
16844
+ classes: array(string()).readonly(),
16845
+ /** Relative event-media path, or null when the group has no picture yet. */
16846
+ mediaUrl: string().nullable(),
16847
+ singleton: boolean()
16848
+ });
16849
+ var AnalyticsGroupMemberSchema = object({
16850
+ trackId: string(),
16851
+ deviceId: number().int(),
16852
+ className: string(),
16853
+ firstSeen: number().int(),
16854
+ lastSeen: number().int(),
16855
+ mediaUrl: string().nullable()
16856
+ });
16857
+ var AnalyticsGroupDetailSchema = AnalyticsGroupRecordSchema.extend({ members: array(AnalyticsGroupMemberSchema).readonly() });
16858
+ var ListGroupsQueryInput = object({
16859
+ /** Devices to merge. An empty array yields `{ groups: [], nextCursor: null }`. */
16860
+ deviceIds: array(number()),
16861
+ /** Window lower bound on `closedAt` (inclusive). */
16862
+ since: number().optional(),
16863
+ /** Window upper bound on `openedAt` (inclusive). */
16864
+ until: number().optional(),
16865
+ limit: number().int().min(1).max(LIST_GROUPS_MAX_LIMIT).default(LIST_GROUPS_DEFAULT_LIMIT),
16866
+ /** Opaque continuation cursor from a previous page's `nextCursor`. */
16867
+ cursor: string().optional()
16868
+ });
16869
+ var ListGroupsPageSchema = object({
16870
+ groups: array(AnalyticsGroupRecordSchema).readonly(),
16871
+ nextCursor: string().nullable()
16872
+ });
16767
16873
  var KeyEventQueryInput = object({
16768
16874
  deviceId: number(),
16769
16875
  /** Window lower bound (track firstSeen ≥ since). */
@@ -16839,7 +16945,9 @@ var TrackCascadeCountsSchema = object({
16839
16945
  /** Unassigned plate reads removed (best-effort; plate leg deferred to plate-intelligence). */
16840
16946
  plates: number().int(),
16841
16947
  /** Per-track CLIP search vectors removed (best-effort). */
16842
- embeddings: number().int()
16948
+ embeddings: number().int(),
16949
+ /** Group membership + group rows removed with their last member (best-effort). */
16950
+ groups: number().int()
16843
16951
  });
16844
16952
  /** Disk-wins reconcile: media rows whose blobs are gone, then empty tracks. */
16845
16953
  var DiskReconcileCountsSchema = object({
@@ -16985,7 +17093,10 @@ DeviceType.Camera, method(object({ deviceId: number() }), array(TrackSchema).rea
16985
17093
  * stationary registry). Default false: the timeline lists passages,
16986
17094
  * not parking records (operator decision, 2026-08-15). */
16987
17095
  includeStationary: boolean().optional()
16988
- }), array(TrackSchema).readonly()), method(RecentTracksQueryInput, RecentTracksPageSchema), method(object({ deviceId: number() }), _void(), {
17096
+ }), array(TrackSchema).readonly()), method(RecentTracksQueryInput, RecentTracksPageSchema), method(ListGroupsQueryInput, ListGroupsPageSchema), method(object({
17097
+ deviceId: number(),
17098
+ groupId: string().min(1)
17099
+ }), AnalyticsGroupDetailSchema.nullable()), method(object({ deviceId: number() }), _void(), {
16989
17100
  kind: "mutation",
16990
17101
  auth: "admin"
16991
17102
  }), 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({
@@ -17203,6 +17314,33 @@ var NativeCropRefSchema = object({
17203
17314
  h: number()
17204
17315
  })
17205
17316
  });
17317
+ object({
17318
+ crop: object({
17319
+ left: number(),
17320
+ top: number(),
17321
+ width: number().positive(),
17322
+ height: number().positive()
17323
+ }).optional(),
17324
+ content: object({
17325
+ width: number().int().positive(),
17326
+ height: number().int().positive()
17327
+ }),
17328
+ fit: _enum(["stretch", "contain"]),
17329
+ format: _enum([
17330
+ "rgb",
17331
+ "gray",
17332
+ "jpeg"
17333
+ ])
17334
+ });
17335
+ var FrameRefSchema = object({
17336
+ registryId: string().min(1),
17337
+ id: string().min(1),
17338
+ width: number().int().positive(),
17339
+ height: number().int().positive(),
17340
+ format: _enum(["rgb", "gray"]),
17341
+ timestamp: number(),
17342
+ capturedAt: number().optional()
17343
+ });
17206
17344
  var ModelFormatSchema$1 = _enum([
17207
17345
  "onnx",
17208
17346
  "coreml",
@@ -17268,7 +17406,8 @@ var PipelineModelOptionSchema = object({
17268
17406
  sizeMB: number()
17269
17407
  })),
17270
17408
  group: ModelVariantGroupSchema.optional(),
17271
- legacy: boolean().optional()
17409
+ legacy: boolean().optional(),
17410
+ provider: ModelProviderIdSchema.optional()
17272
17411
  });
17273
17412
  var ConfigFieldBridge = custom();
17274
17413
  var PipelineAddonSchemaSchema = object({
@@ -17447,6 +17586,12 @@ method(_void(), array(PipelineEngineChoiceSchema)), method(_void(), PipelineEngi
17447
17586
  steps: array(PipelineStepInputSchema).min(1),
17448
17587
  frame: FrameInputSchema.optional(),
17449
17588
  /**
17589
+ * Process-local lazy frame. Valid only when caller and provider resolve
17590
+ * in the same execution-group process; split/cross-node callers use
17591
+ * `frame`/`image` inline compatibility instead.
17592
+ */
17593
+ frameRef: FrameRefSchema.optional(),
17594
+ /**
17450
17595
  * CB5 shm passthrough — a `FrameHandle` naming the same ring slot
17451
17596
  * the decoded pixels live in. One more member of the one-of
17452
17597
  * frame/frameHandle/image/imageBase64/referenceImage group.
@@ -17702,7 +17847,10 @@ var NativeCropResultSchema = object({
17702
17847
  * Which source served this crop, so a quality-sensitive consumer (the native
17703
17848
  * `keyFrame`) can reject a degraded fallback:
17704
17849
  * - `native` — cut from the decode worker's retained NATIVE surface (the
17705
- * quality path).
17850
+ * quality path). A subject-tile serve is also native-resolution and stays
17851
+ * `native` here: the public enum cannot name `tile` without a breaking cap
17852
+ * change. Runner telemetry distinguishes lease vs tile via `source` on the
17853
+ * internal crop result (`nativeHits` vs `tileHits`).
17706
17854
  * - `ram-fullframe` — the native surface MISSED but the request was full-frame,
17707
17855
  * so the ≤640 RAM `RetainedFrameStore` served it (honest lower-res; legit for
17708
17856
  * the blank-frame guard / 640-snapshot resolve, NOT for the clean keyFrame).
@@ -18193,12 +18341,41 @@ var RunnerLocalLoadSchema = object({
18193
18341
  * legacy `OrchestratorMetricsSchema` shape so existing dashboards keep
18194
18342
  * working unchanged when they switch to reading from the runner cap.
18195
18343
  */
18344
+ var FrameLazyCountersSchema = object({
18345
+ framesDecoded: number(),
18346
+ framesAdmitted: number(),
18347
+ framesDroppedPixelFree: number(),
18348
+ viewsMaterialized: number(),
18349
+ viewsSkipped: number(),
18350
+ workerToRunnerBytes: number(),
18351
+ runnerToPoolRawBytes: number(),
18352
+ runnerToPoolJpegBytes: number(),
18353
+ onDemandFullFrameRequests: number(),
18354
+ onDemandCropRequests: number(),
18355
+ nativeHits: number(),
18356
+ nativeMisses: number(),
18357
+ tileHits: number(),
18358
+ tileMisses: number(),
18359
+ fallbackHits: number(),
18360
+ fallbackMisses: number(),
18361
+ retainedWritesAvoided: number(),
18362
+ residentRefs: number(),
18363
+ residentBytes: number(),
18364
+ releases: number(),
18365
+ evictions: number(),
18366
+ staleMisses: number()
18367
+ });
18368
+ var FrameLazyMetricsSchema = object({
18369
+ node: FrameLazyCountersSchema,
18370
+ cameras: array(FrameLazyCountersSchema.extend({ deviceId: number() }))
18371
+ });
18196
18372
  var RunnerLocalMetricsSchema = object({
18197
18373
  nodeId: string(),
18198
18374
  activeCameras: number(),
18199
18375
  throttledCameras: number(),
18200
18376
  avgInferenceTimeMs: number(),
18201
- queueDepth: number()
18377
+ queueDepth: number(),
18378
+ frameLazy: FrameLazyMetricsSchema.optional()
18202
18379
  });
18203
18380
  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({
18204
18381
  handle: FrameHandleSchema,
@@ -19543,6 +19720,9 @@ var storageProviderCapability = {
19543
19720
  endDownload: method(EndDownloadInputSchema, _void(), { kind: "mutation" })
19544
19721
  }
19545
19722
  };
19723
+ /** Profile-exported FormBuilder schema. Shape is ConfigUISchema at the UI. */
19724
+ var ProfileSettingsSchemaBridge = unknown().nullable();
19725
+ var ProfileSettingsBagSchema = record(string(), unknown());
19546
19726
  /**
19547
19727
  * A live terminal session hosted by the provider addon. Output and input do
19548
19728
  * NOT flow through the capability — they use the addon data plane
@@ -19572,7 +19752,14 @@ var TerminalSessionInfoSchema = object({
19572
19752
  var TerminalProfileInfoSchema = object({
19573
19753
  profileId: string(),
19574
19754
  label: string(),
19575
- description: string().optional()
19755
+ description: string().optional(),
19756
+ /** Spawn defaults the instance form copies on create. */
19757
+ executable: string().optional(),
19758
+ args: array(string()).readonly().optional(),
19759
+ cwd: string().optional(),
19760
+ environment: array(string()).readonly().optional(),
19761
+ /** ConfigUISchema for instance knobs, or null when the profile has none. */
19762
+ settingsSchema: ProfileSettingsSchemaBridge.optional()
19576
19763
  });
19577
19764
  /**
19578
19765
  * A durable operator-created Terminal instance. Profiles are templates; only
@@ -19585,7 +19772,12 @@ var TerminalInstanceInfoSchema = object({
19585
19772
  profileId: string(),
19586
19773
  profileLabel: string(),
19587
19774
  name: string(),
19588
- enabled: boolean()
19775
+ enabled: boolean(),
19776
+ executable: string(),
19777
+ args: array(string()).readonly(),
19778
+ cwd: string(),
19779
+ environment: array(string()).readonly(),
19780
+ profileSettings: ProfileSettingsBagSchema
19589
19781
  });
19590
19782
  var TerminalLegacyCameraSchema = object({
19591
19783
  stableId: string(),
@@ -19615,7 +19807,23 @@ var TerminalOutputBatchSchema = object({
19615
19807
  method(_void(), array(TerminalProfileInfoSchema).readonly(), { auth: "admin" }), method(_void(), array(TerminalInstanceInfoSchema).readonly(), { auth: "admin" }), method(object({
19616
19808
  targetNodeId: string().min(1),
19617
19809
  profileId: string().min(1),
19618
- name: string().trim().min(1).max(160).optional()
19810
+ name: string().trim().min(1).max(160).optional(),
19811
+ executable: string().max(1024).optional(),
19812
+ args: array(string().max(2048)).max(64).optional(),
19813
+ cwd: string().max(1024).optional(),
19814
+ environment: array(string().max(4096)).max(64).optional(),
19815
+ profileSettings: ProfileSettingsBagSchema.optional()
19816
+ }), TerminalInstanceInfoSchema, {
19817
+ kind: "mutation",
19818
+ auth: "admin"
19819
+ }), method(object({
19820
+ instanceId: string().min(1),
19821
+ name: string().trim().min(1).max(160).optional(),
19822
+ executable: string().max(1024).optional(),
19823
+ args: array(string().max(2048)).max(64).optional(),
19824
+ cwd: string().max(1024).optional(),
19825
+ environment: array(string().max(4096)).max(64).optional(),
19826
+ profileSettings: ProfileSettingsBagSchema.optional()
19619
19827
  }), TerminalInstanceInfoSchema, {
19620
19828
  kind: "mutation",
19621
19829
  auth: "admin"
@@ -19637,7 +19845,11 @@ method(_void(), array(TerminalProfileInfoSchema).readonly(), { auth: "admin" }),
19637
19845
  }), method(_void(), array(TerminalSessionInfoSchema).readonly(), { auth: "admin" }), method(object({
19638
19846
  profileId: string(),
19639
19847
  cols: number().int().positive(),
19640
- rows: number().int().positive()
19848
+ rows: number().int().positive(),
19849
+ executable: string().max(1024).optional(),
19850
+ args: array(string().max(2048)).max(64).optional(),
19851
+ cwd: string().max(1024).optional(),
19852
+ environment: array(string().max(4096)).max(64).optional()
19641
19853
  }), TerminalSessionInfoSchema, {
19642
19854
  kind: "mutation",
19643
19855
  auth: "admin"
@@ -22419,10 +22631,10 @@ DeviceType.LawnMower, method(object({ deviceId: number().int().nonnegative() }),
22419
22631
  *
22420
22632
  * • The SDK (mobile / web client) consumes `getConnectionEndpoints()`
22421
22633
  * to receive an ordered list of candidate base URLs it should race
22422
- * on connect — LAN IPv4 first (lowest latency when on same network),
22423
- * then public hostname (if a tunnel is up), then IPv6. The SDK can
22424
- * race them with short timeouts and stick with the winner for the
22425
- * session.
22634
+ * on connect — LAN IPv4 and stable LAN IPv6 first (lowest latency
22635
+ * when on the same network), then public hostname (if a tunnel is
22636
+ * up). The SDK can race them with short timeouts and stick with the
22637
+ * winner for the session.
22426
22638
  *
22427
22639
  * Why hub-only: agents are not directly addressable by the operator's
22428
22640
  * clients — they reverse-connect to the hub. Exposing their interfaces
@@ -22577,6 +22789,17 @@ var NotificationEndpointSchema = object({
22577
22789
  /** What the ranking currently resolves to (null when nothing is reachable). */
22578
22790
  resolved: string().nullable()
22579
22791
  });
22792
+ /**
22793
+ * The URLs the SDK / viewer should race for API access. `baseUrls` empty =
22794
+ * AUTO (every LAN IPv4 + the public tunnel). `resolved` is what that choice
22795
+ * currently expands to, so the UI can show the effective set either way.
22796
+ */
22797
+ var ViewerEndpointsSchema = object({
22798
+ /** The operator's explicit race set, or empty for AUTO. */
22799
+ baseUrls: array(string()).readonly(),
22800
+ /** What the ranking currently resolves to (may be empty if nothing is up). */
22801
+ resolved: array(string()).readonly()
22802
+ });
22580
22803
  var AllowedAddressesSchema = object({
22581
22804
  /**
22582
22805
  * Allowlist of interface addresses operators have explicitly opted
@@ -22585,6 +22808,20 @@ var AllowedAddressesSchema = object({
22585
22808
  * Network Addresses admin page and persisted by the addon.
22586
22809
  */
22587
22810
  addresses: array(string()).readonly() });
22811
+ var TlsStatusSchema = object({
22812
+ mode: _enum([
22813
+ "generated",
22814
+ "uploaded",
22815
+ "disabled"
22816
+ ]),
22817
+ leafFingerprintSha256: string().nullable(),
22818
+ caFingerprintSha256: string().nullable(),
22819
+ validTo: string().nullable(),
22820
+ sans: array(string()),
22821
+ caCertPem: string().nullable(),
22822
+ reissueError: string().nullable(),
22823
+ restartRequired: boolean()
22824
+ });
22588
22825
  method(_void(), ListResultSchema), method(_void(), PreferredSchema), method(object({
22589
22826
  /**
22590
22827
  * LEGACY HINT — do not send from new code. Kept optional so clients
@@ -22594,17 +22831,31 @@ method(_void(), ListResultSchema), method(_void(), PreferredSchema), method(obje
22594
22831
  */
22595
22832
  port: number().int().min(1).max(65535).optional(),
22596
22833
  /** Include `http(s)://127.0.0.1:<port>` as the lowest-priority
22597
- * candidate. Default `true`. */
22834
+ * candidate. Default `false` — loopback is not a client route. */
22598
22835
  includeLoopback: boolean().optional(),
22599
- /** Skip IPv6 entries. Some legacy clients can't parse them.
22600
- * Default `false`. */
22836
+ /** Skip IPv6 entries. Default `false` the palette includes stable
22837
+ * LAN IPv6 (ICE/WebRTC uses dual-stack regardless). Pass `true` to
22838
+ * hide them. The viewer HTTP/WS race is `getViewerEndpoints`. */
22601
22839
  ipv4Only: boolean().optional(),
22602
22840
  /** Scheme to emit for LAN/loopback URLs. Default `'http'`.
22603
22841
  * Pass `'https'` when the caller is itself loaded over HTTPS
22604
22842
  * to avoid mixed-content blocks in the browser. The public
22605
22843
  * tunnel always emits `https://` regardless. */
22606
22844
  scheme: _enum(["http", "https"]).optional()
22607
- }), 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" });
22845
+ }), 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, {
22846
+ kind: "mutation",
22847
+ auth: "admin"
22848
+ }), method(object({
22849
+ certPem: string().min(1),
22850
+ keyPem: string().min(1),
22851
+ caPem: string().optional()
22852
+ }), TlsStatusSchema, {
22853
+ kind: "mutation",
22854
+ auth: "admin"
22855
+ }), method(_void(), object({ pem: string() })), method(_void(), TlsStatusSchema, {
22856
+ kind: "mutation",
22857
+ auth: "admin"
22858
+ });
22608
22859
  object({
22609
22860
  /** Lifecycle state of the lock. `jammed` means the motor reported
22610
22861
  * failure to reach the target — operator intervention required. */
@@ -23785,7 +24036,12 @@ var PlateInfoSchema = object({
23785
24036
  plateBbox: BoundingBoxSchema.optional(),
23786
24037
  /** keyFrame parity: MediaStore key of the track's native-resolution key frame. */
23787
24038
  keyFrameMediaKey: string().optional(),
23788
- base64: string().optional()
24039
+ base64: string().optional(),
24040
+ /**
24041
+ * Same crop as a data-plane URL. `getPlateByTrack` returns this and
24042
+ * never inlines JPEG; `listPlates` still inlines for the admin-ui.
24043
+ */
24044
+ cropUrl: string().optional()
23789
24045
  });
23790
24046
  var MediaFileLiteSchema = object({
23791
24047
  key: string(),
@@ -27425,6 +27681,12 @@ Object.freeze({
27425
27681
  addonId: null,
27426
27682
  access: "view"
27427
27683
  },
27684
+ "deviceManager.getBindingsBatch": {
27685
+ capName: "device-manager",
27686
+ capScope: "system",
27687
+ addonId: null,
27688
+ access: "view"
27689
+ },
27428
27690
  "deviceManager.getChildren": {
27429
27691
  capName: "device-manager",
27430
27692
  capScope: "system",
@@ -27485,6 +27747,12 @@ Object.freeze({
27485
27747
  addonId: null,
27486
27748
  access: "view"
27487
27749
  },
27750
+ "deviceManager.getLinkedDevicesBatch": {
27751
+ capName: "device-manager",
27752
+ capScope: "system",
27753
+ addonId: null,
27754
+ access: "view"
27755
+ },
27488
27756
  "deviceManager.getRoleDisplayDefaults": {
27489
27757
  capName: "device-manager",
27490
27758
  capScope: "system",
@@ -28367,6 +28635,12 @@ Object.freeze({
28367
28635
  addonId: null,
28368
28636
  access: "create"
28369
28637
  },
28638
+ "localNetwork.downloadCa": {
28639
+ capName: "local-network",
28640
+ capScope: "system",
28641
+ addonId: null,
28642
+ access: "view"
28643
+ },
28370
28644
  "localNetwork.getAllowedAddresses": {
28371
28645
  capName: "local-network",
28372
28646
  capScope: "system",
@@ -28391,18 +28665,42 @@ Object.freeze({
28391
28665
  addonId: null,
28392
28666
  access: "view"
28393
28667
  },
28668
+ "localNetwork.getTlsStatus": {
28669
+ capName: "local-network",
28670
+ capScope: "system",
28671
+ addonId: null,
28672
+ access: "view"
28673
+ },
28674
+ "localNetwork.getViewerEndpoints": {
28675
+ capName: "local-network",
28676
+ capScope: "system",
28677
+ addonId: null,
28678
+ access: "view"
28679
+ },
28394
28680
  "localNetwork.list": {
28395
28681
  capName: "local-network",
28396
28682
  capScope: "system",
28397
28683
  addonId: null,
28398
28684
  access: "view"
28399
28685
  },
28686
+ "localNetwork.regenerateCertificate": {
28687
+ capName: "local-network",
28688
+ capScope: "system",
28689
+ addonId: null,
28690
+ access: "create"
28691
+ },
28400
28692
  "localNetwork.resetAllowlistToBestMatch": {
28401
28693
  capName: "local-network",
28402
28694
  capScope: "system",
28403
28695
  addonId: null,
28404
28696
  access: "delete"
28405
28697
  },
28698
+ "localNetwork.revertToGeneratedCertificate": {
28699
+ capName: "local-network",
28700
+ capScope: "system",
28701
+ addonId: null,
28702
+ access: "create"
28703
+ },
28406
28704
  "localNetwork.setAllowedAddresses": {
28407
28705
  capName: "local-network",
28408
28706
  capScope: "system",
@@ -28415,6 +28713,18 @@ Object.freeze({
28415
28713
  addonId: null,
28416
28714
  access: "create"
28417
28715
  },
28716
+ "localNetwork.setViewerEndpoints": {
28717
+ capName: "local-network",
28718
+ capScope: "system",
28719
+ addonId: null,
28720
+ access: "create"
28721
+ },
28722
+ "localNetwork.uploadCertificate": {
28723
+ capName: "local-network",
28724
+ capScope: "system",
28725
+ addonId: null,
28726
+ access: "create"
28727
+ },
28418
28728
  "lockControl.lock": {
28419
28729
  capName: "lock-control",
28420
28730
  capScope: "device",
@@ -29213,6 +29523,12 @@ Object.freeze({
29213
29523
  addonId: null,
29214
29524
  access: "view"
29215
29525
  },
29526
+ "pipelineAnalytics.getGroup": {
29527
+ capName: "pipeline-analytics",
29528
+ capScope: "device",
29529
+ addonId: null,
29530
+ access: "view"
29531
+ },
29216
29532
  "pipelineAnalytics.getKeyEvents": {
29217
29533
  capName: "pipeline-analytics",
29218
29534
  capScope: "device",
@@ -29297,6 +29613,12 @@ Object.freeze({
29297
29613
  addonId: null,
29298
29614
  access: "view"
29299
29615
  },
29616
+ "pipelineAnalytics.listGroups": {
29617
+ capName: "pipeline-analytics",
29618
+ capScope: "device",
29619
+ addonId: null,
29620
+ access: "view"
29621
+ },
29300
29622
  "pipelineAnalytics.listOpsLog": {
29301
29623
  capName: "pipeline-analytics",
29302
29624
  capScope: "device",
@@ -31295,6 +31617,12 @@ Object.freeze({
31295
31617
  addonId: null,
31296
31618
  access: "create"
31297
31619
  },
31620
+ "terminalSession.updateInstance": {
31621
+ capName: "terminal-session",
31622
+ capScope: "system",
31623
+ addonId: null,
31624
+ access: "create"
31625
+ },
31298
31626
  "terminalSession.writeInput": {
31299
31627
  capName: "terminal-session",
31300
31628
  capScope: "system",
@@ -32072,6 +32400,11 @@ Object.freeze({
32072
32400
  form: "single",
32073
32401
  optional: false
32074
32402
  }],
32403
+ "deviceManager.getBindingsBatch": [{
32404
+ name: "deviceIds",
32405
+ form: "array",
32406
+ optional: false
32407
+ }],
32075
32408
  "deviceManager.getChildren": [{
32076
32409
  name: "parentDeviceId",
32077
32410
  form: "single",
@@ -32117,6 +32450,11 @@ Object.freeze({
32117
32450
  form: "single",
32118
32451
  optional: false
32119
32452
  }],
32453
+ "deviceManager.getLinkedDevicesBatch": [{
32454
+ name: "deviceIds",
32455
+ form: "array",
32456
+ optional: false
32457
+ }],
32120
32458
  "deviceManager.getSettingsSchema": [{
32121
32459
  name: "deviceId",
32122
32460
  form: "single",
@@ -32137,6 +32475,11 @@ Object.freeze({
32137
32475
  form: "single",
32138
32476
  optional: false
32139
32477
  }],
32478
+ "deviceManager.listAll": [{
32479
+ name: "deviceIds",
32480
+ form: "array",
32481
+ optional: true
32482
+ }],
32140
32483
  "deviceManager.loadConfig": [{
32141
32484
  name: "deviceId",
32142
32485
  form: "single",
@@ -32710,6 +33053,11 @@ Object.freeze({
32710
33053
  form: "single",
32711
33054
  optional: false
32712
33055
  }],
33056
+ "pipelineAnalytics.getGroup": [{
33057
+ name: "deviceId",
33058
+ form: "single",
33059
+ optional: false
33060
+ }],
32713
33061
  "pipelineAnalytics.getKeyEvents": [{
32714
33062
  name: "deviceId",
32715
33063
  form: "single",
@@ -32765,6 +33113,11 @@ Object.freeze({
32765
33113
  form: "array",
32766
33114
  optional: false
32767
33115
  }],
33116
+ "pipelineAnalytics.listGroups": [{
33117
+ name: "deviceIds",
33118
+ form: "array",
33119
+ optional: false
33120
+ }],
32768
33121
  "pipelineAnalytics.listOpsLog": [{
32769
33122
  name: "deviceId",
32770
33123
  form: "single",
@@ -33782,6 +34135,35 @@ Object.freeze(Object.fromEntries([{
33782
34135
  }]
33783
34136
  }].map((s) => [s.stepId, s.defaultModelId])));
33784
34137
  string().min(1);
34138
+ var CLUSTER_STEP_SETTING_FIELDS = [{
34139
+ stepId: "face-embedding",
34140
+ key: "minLandmarkFaceSize",
34141
+ label: "Min face size for recognition (detection px)",
34142
+ 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.",
34143
+ type: "slider",
34144
+ min: 0,
34145
+ max: 64,
34146
+ step: 2,
34147
+ default: 24
34148
+ }];
34149
+ function clusterStepSettingKey(stepId, fieldKey) {
34150
+ return `clusterStepSetting:${stepId}:${fieldKey}`;
34151
+ }
34152
+ var ClusterSettingNumberSchema = number().finite();
34153
+ function readClusterStepSettings(config) {
34154
+ const out = {};
34155
+ for (const field of CLUSTER_STEP_SETTING_FIELDS) {
34156
+ const parsed = ClusterSettingNumberSchema.safeParse(config[clusterStepSettingKey(field.stepId, field.key)]);
34157
+ const value = parsed.success ? parsed.data : field.default;
34158
+ const existing = out[field.stepId] ?? {};
34159
+ out[field.stepId] = {
34160
+ ...existing,
34161
+ [field.key]: value
34162
+ };
34163
+ }
34164
+ return out;
34165
+ }
34166
+ readClusterStepSettings({});
33785
34167
  object({
33786
34168
  /**
33787
34169
  * Fraction of the box's own size added on EACH side before cutting.