@camstack/addon-provider-tuya 0.2.26 → 0.2.28

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (3) hide show
  1. package/dist/addon.js +432 -50
  2. package/dist/addon.mjs +432 -50
  3. package/package.json +1 -1
package/dist/addon.js CHANGED
@@ -6621,6 +6621,13 @@ var BaseAddon = class {
6621
6621
  _readinessGeneration = typeof crypto !== "undefined" && crypto.randomUUID ? crypto.randomUUID() : Math.random().toString(36).slice(2, 14);
6622
6622
  /** Capability names this addon registered at init — used to emit matching `down` events on shutdown. */
6623
6623
  _registeredCapNames = [];
6624
+ /**
6625
+ * True only after `readAddonStore` actually answered. Constructor
6626
+ * defaults look like stored config when the store is down — a forked
6627
+ * addon that auto-starts from those defaults (cloudflare-tunnel quick
6628
+ * mode, 2026-08-25) is not "the operator chose this".
6629
+ */
6630
+ settingsStoreReady = false;
6624
6631
  /** Default config values. Provided via constructor. */
6625
6632
  defaults;
6626
6633
  constructor(defaults) {
@@ -7021,7 +7028,9 @@ var BaseAddon = class {
7021
7028
  ];
7022
7029
  let lastErr;
7023
7030
  for (let attempt = 0; attempt <= delaysMs.length; attempt++) try {
7024
- return await settings.readAddonStore() ?? {};
7031
+ const stored = await settings.readAddonStore() ?? {};
7032
+ this.settingsStoreReady = true;
7033
+ return stored;
7025
7034
  } catch (err) {
7026
7035
  lastErr = err;
7027
7036
  const msg = err instanceof Error ? err.message : String(err);
@@ -7029,6 +7038,7 @@ var BaseAddon = class {
7029
7038
  if (attempt === delaysMs.length) break;
7030
7039
  await new Promise((r) => setTimeout(r, delaysMs[attempt]));
7031
7040
  }
7041
+ this.settingsStoreReady = false;
7032
7042
  this._ctx?.logger?.warn?.("readAddonStore: settings-store unavailable after retries — using defaults", { meta: { error: lastErr instanceof Error ? lastErr.message : String(lastErr) } });
7033
7043
  return {};
7034
7044
  }
@@ -8840,6 +8850,15 @@ var LabelDefinitionSchema = object({
8840
8850
  description: string().optional(),
8841
8851
  icon: string().optional()
8842
8852
  });
8853
+ var ClassMapDefinitionSchema = object({
8854
+ mapping: record(string(), _enum([
8855
+ "person",
8856
+ "vehicle",
8857
+ "animal",
8858
+ "package"
8859
+ ])),
8860
+ preserveOriginal: boolean()
8861
+ });
8843
8862
  var MODEL_FORMATS = [
8844
8863
  "onnx",
8845
8864
  "coreml",
@@ -8923,6 +8942,12 @@ var ModelVariantGroupSchema = object({
8923
8942
  */
8924
8943
  resolution: number().int().positive().optional()
8925
8944
  });
8945
+ var ModelProviderIdSchema = _enum([
8946
+ "camstack",
8947
+ "frigate",
8948
+ "scrypted",
8949
+ "custom"
8950
+ ]);
8926
8951
  var ModelCatalogEntrySchema = object({
8927
8952
  id: string(),
8928
8953
  name: string(),
@@ -9018,7 +9043,19 @@ var ModelCatalogEntrySchema = object({
9018
9043
  * `id` stays the source of truth for resolution/download/persistence; grouping
9019
9044
  * is a presentation overlay resolved back to an `id`.
9020
9045
  */
9021
- group: ModelVariantGroupSchema.optional()
9046
+ group: ModelVariantGroupSchema.optional(),
9047
+ /**
9048
+ * Catalog source for the pipeline stepper's provider-first picker. Absent on
9049
+ * built-in CamStack entries (treated as `camstack`) and on registry rows
9050
+ * persisted before this field existed (`inferModelProvider` fills those).
9051
+ */
9052
+ provider: ModelProviderIdSchema.optional(),
9053
+ /**
9054
+ * Per-MODEL class map override. Absent ⇒ the step's `StepDefinition.classMap`
9055
+ * applies (Frigate / COCO public catalog). Set on a custom model whose raw
9056
+ * labels already ARE the CamStack macros (Scrypted identity map).
9057
+ */
9058
+ classMap: ClassMapDefinitionSchema.optional()
9022
9059
  });
9023
9060
  var ConvertTargetSchema = discriminatedUnion("format", [object({
9024
9061
  format: literal("openvino"),
@@ -9047,7 +9084,8 @@ var ModelConvertMetadataSchema = object({
9047
9084
  "ocr",
9048
9085
  "segmentation"
9049
9086
  ]),
9050
- faceAlignment: boolean().optional()
9087
+ faceAlignment: boolean().optional(),
9088
+ classMap: ClassMapDefinitionSchema.optional()
9051
9089
  });
9052
9090
  var ConvertResultSchema = object({
9053
9091
  entry: ModelCatalogEntrySchema,
@@ -12821,6 +12859,27 @@ var LinkedDeviceSchema = object({
12821
12859
  features: array(string()),
12822
12860
  producesTrackedEvents: boolean().optional()
12823
12861
  });
12862
+ /** One camera's resolved linked set, tagged with the camera it belongs to.
12863
+ * The batch answer needs the tag; the single-device answer already has it
12864
+ * from the input, which is why `getLinkedDevices` keeps the untagged shape. */
12865
+ var LinkedDevicesForDeviceSchema = object({
12866
+ deviceId: number(),
12867
+ mode: LinkedDevicesModeSchema,
12868
+ devices: array(LinkedDeviceSchema)
12869
+ });
12870
+ /** One device's binding map — the shape `getBindings`, `getBindingsBatch` and
12871
+ * `getAllBindings` all answer in. Declared once: three copies of the same
12872
+ * object literal is exactly how the three drift apart. */
12873
+ var DeviceBindingsForDeviceSchema = object({
12874
+ deviceId: number(),
12875
+ entries: array(object({
12876
+ capName: string(),
12877
+ kind: _enum(["native", "wrapped"]),
12878
+ providerAddonId: string(),
12879
+ providerNodeId: string(),
12880
+ nativeAddonId: string()
12881
+ }))
12882
+ });
12824
12883
  var SavedDeviceRowSchema = object({
12825
12884
  /** Numeric id reserved at allocateDeviceId time. */
12826
12885
  id: number(),
@@ -13046,11 +13105,25 @@ method(object({
13046
13105
  projection: _enum(["full", "slim"]).optional(),
13047
13106
  /** Return only camera devices. Filtering server-side instead of
13048
13107
  * shipping 293 rows to find 12. */
13049
- isCamera: boolean().optional()
13108
+ isCamera: boolean().optional(),
13109
+ /**
13110
+ * Return only these device ids. For the caller that already KNOWS the
13111
+ * handful it wants and needs a field the id-bearing answer does not
13112
+ * carry — the viewer's linked-devices panel joins `type` and `online`
13113
+ * onto ~8 linked ids and, unfiltered, dragged the fleet across to do
13114
+ * it: 433 KB slim / 958 KB full for 967 devices, on a query that
13115
+ * refetches on the reconcile interval, on a phone.
13116
+ *
13117
+ * Safe to send at a hub that predates it: Zod STRIPS unknown input
13118
+ * keys rather than rejecting them (verified against the live hub
13119
+ * 2026-08-25 — 967 rows came back), so an old hub answers exactly what
13120
+ * it answers today and the caller filters as it already does.
13121
+ */
13122
+ deviceIds: array(number()).optional()
13050
13123
  }), array(DeviceInfoSchema)), method(object({ deviceId: number() }), DeviceInfoSchema.nullable()), method(object({ parentDeviceId: number() }), array(DeviceInfoSchema)), method(object({ deviceId: number() }), object({
13051
13124
  mode: LinkedDevicesModeSchema,
13052
13125
  devices: array(LinkedDeviceSchema)
13053
- })), method(object({ deviceId: number() }), array(StreamSourceEntrySchema$1)), method(object({ deviceId: number() }), array(ConfigEntrySchema)), method(object({ deviceId: number() }), ConfigUISchemaOutput), method(object({
13126
+ })), 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({
13054
13127
  deviceId: number(),
13055
13128
  values: record(string(), unknown())
13056
13129
  }), object({ success: literal(true) }), {
@@ -13077,25 +13150,7 @@ method(object({
13077
13150
  }), method(object({ deviceId: number() }), array(StreamProbeResultSchema), {
13078
13151
  kind: "mutation",
13079
13152
  auth: "admin"
13080
- }), method(object({ deviceId: number() }), object({
13081
- deviceId: number(),
13082
- entries: array(object({
13083
- capName: string(),
13084
- kind: _enum(["native", "wrapped"]),
13085
- providerAddonId: string(),
13086
- providerNodeId: string(),
13087
- nativeAddonId: string()
13088
- }))
13089
- })), method(object({}), array(object({
13090
- deviceId: number(),
13091
- entries: array(object({
13092
- capName: string(),
13093
- kind: _enum(["native", "wrapped"]),
13094
- providerAddonId: string(),
13095
- providerNodeId: string(),
13096
- nativeAddonId: string()
13097
- }))
13098
- }))), method(object({
13153
+ }), method(object({ deviceId: number() }), DeviceBindingsForDeviceSchema), method(object({ deviceIds: array(number()) }), array(DeviceBindingsForDeviceSchema)), method(object({}), array(DeviceBindingsForDeviceSchema)), method(object({
13099
13154
  deviceId: number(),
13100
13155
  capName: string(),
13101
13156
  wrapperAddonId: string(),
@@ -15505,12 +15560,15 @@ var NcOccupancyConditionSchema = object({
15505
15560
  * there is no second switch that can disagree with the first and every rule
15506
15561
  * authored before the decision migrates for free (`audioModeOf`):
15507
15562
  *
15508
- * - **LABEL mode — `labels` present.** The rule fires on the FIRST frame the
15509
- * classifier labels with one of them. No window, no percentage:
15510
- * `hitPercent` and `samplingSeconds` are ignored, and the rule's own
15511
- * `throttle` cooldown is the only brake. The per-label confidence floor is
15512
- * the analyzer's (`classificationMinScore`, per device) a label only
15513
- * reaches this condition if the classifier was already confident enough.
15563
+ * - **LABEL mode — `labels` present.** The rule fires when `confirmHits`
15564
+ * labelled frames land inside `confirmWindowSec` (default 2 in 5 s).
15565
+ * `hitPercent` and `samplingSeconds` are still ignored a percentage of
15566
+ * frames is the wrong question for a classifier that labels 1–3 frames
15567
+ * per episode. The count window is the brake that drops a single-frame
15568
+ * false positive; the rule's own `throttle` cooldown is the other. The
15569
+ * per-label confidence floor is the analyzer's (`classificationMinScore`,
15570
+ * per device) — a label only reaches this condition if the classifier was
15571
+ * already confident enough. `confirmHits: 1` restores first-frame fire.
15514
15572
  * - **LEVEL mode — `dbThreshold` present, no labels.** The sampling window IS
15515
15573
  * the condition: at least `hitPercent`% of the samples over
15516
15574
  * `samplingSeconds` must be at or above `dbThreshold` dBFS (see
@@ -15537,14 +15595,22 @@ var NcOccupancyConditionSchema = object({
15537
15595
  * an operator who typed `dog` mean the same thing.
15538
15596
  */
15539
15597
  var NcAudioConditionSchema = object({
15540
- /** LABEL MODE: audio macro labels. Present ⇒ fires on the first labelled frame. */
15598
+ /** LABEL MODE: audio macro labels. Present ⇒ count-in-window confirm. */
15541
15599
  labels: array(string().min(1)).min(1).optional(),
15542
15600
  /** LEVEL MODE: floor in dBFS (negative-going, `0` = full scale). */
15543
15601
  dbThreshold: number().min(-96).max(0).optional(),
15544
15602
  /** LEVEL MODE ONLY: percentage of the window's samples that must be hits (1–100). */
15545
15603
  hitPercent: number().int().min(1).max(100).default(60),
15546
15604
  /** LEVEL MODE ONLY: length of the sampling window in seconds. */
15547
- samplingSeconds: number().int().min(1).max(300).default(10)
15605
+ samplingSeconds: number().int().min(1).max(300).default(10),
15606
+ /**
15607
+ * LABEL MODE: how many labelled frames must land inside
15608
+ * {@link NcAudioConditionSchema.shape.confirmWindowSec} before dispatch.
15609
+ * Absent ⇒ 2 (the matcher default). `1` is first-frame fire.
15610
+ */
15611
+ confirmHits: number().int().min(1).max(20).optional(),
15612
+ /** LABEL MODE: the window those frames must share, in seconds. Absent ⇒ 5. */
15613
+ confirmWindowSec: number().int().min(1).max(60).optional()
15548
15614
  });
15549
15615
  /**
15550
15616
  * Which zone-crossing DIRECTION a rule accepts (`ObjectEvent.zoneCrossing`).
@@ -17918,6 +17984,46 @@ var RecentTracksPageSchema = object({
17918
17984
  /** Cursor for the next page, or null when this page is the last. */
17919
17985
  nextCursor: string().nullable()
17920
17986
  });
17987
+ var LIST_GROUPS_DEFAULT_LIMIT = 40;
17988
+ var LIST_GROUPS_MAX_LIMIT = 100;
17989
+ var AnalyticsGroupRecordSchema = object({
17990
+ id: string(),
17991
+ deviceId: number().int(),
17992
+ openedAt: number().int(),
17993
+ closedAt: number().int(),
17994
+ timestamp: number().int(),
17995
+ memberCount: number().int(),
17996
+ memberTrackIds: array(string()).readonly(),
17997
+ className: string(),
17998
+ classes: array(string()).readonly(),
17999
+ /** Relative event-media path, or null when the group has no picture yet. */
18000
+ mediaUrl: string().nullable(),
18001
+ singleton: boolean()
18002
+ });
18003
+ var AnalyticsGroupMemberSchema = object({
18004
+ trackId: string(),
18005
+ deviceId: number().int(),
18006
+ className: string(),
18007
+ firstSeen: number().int(),
18008
+ lastSeen: number().int(),
18009
+ mediaUrl: string().nullable()
18010
+ });
18011
+ var AnalyticsGroupDetailSchema = AnalyticsGroupRecordSchema.extend({ members: array(AnalyticsGroupMemberSchema).readonly() });
18012
+ var ListGroupsQueryInput = object({
18013
+ /** Devices to merge. An empty array yields `{ groups: [], nextCursor: null }`. */
18014
+ deviceIds: array(number()),
18015
+ /** Window lower bound on `closedAt` (inclusive). */
18016
+ since: number().optional(),
18017
+ /** Window upper bound on `openedAt` (inclusive). */
18018
+ until: number().optional(),
18019
+ limit: number().int().min(1).max(LIST_GROUPS_MAX_LIMIT).default(LIST_GROUPS_DEFAULT_LIMIT),
18020
+ /** Opaque continuation cursor from a previous page's `nextCursor`. */
18021
+ cursor: string().optional()
18022
+ });
18023
+ var ListGroupsPageSchema = object({
18024
+ groups: array(AnalyticsGroupRecordSchema).readonly(),
18025
+ nextCursor: string().nullable()
18026
+ });
17921
18027
  var KeyEventQueryInput = object({
17922
18028
  deviceId: number(),
17923
18029
  /** Window lower bound (track firstSeen ≥ since). */
@@ -17993,7 +18099,9 @@ var TrackCascadeCountsSchema = object({
17993
18099
  /** Unassigned plate reads removed (best-effort; plate leg deferred to plate-intelligence). */
17994
18100
  plates: number().int(),
17995
18101
  /** Per-track CLIP search vectors removed (best-effort). */
17996
- embeddings: number().int()
18102
+ embeddings: number().int(),
18103
+ /** Group membership + group rows removed with their last member (best-effort). */
18104
+ groups: number().int()
17997
18105
  });
17998
18106
  /** Disk-wins reconcile: media rows whose blobs are gone, then empty tracks. */
17999
18107
  var DiskReconcileCountsSchema = object({
@@ -18139,7 +18247,10 @@ DeviceType.Camera, method(object({ deviceId: number() }), array(TrackSchema).rea
18139
18247
  * stationary registry). Default false: the timeline lists passages,
18140
18248
  * not parking records (operator decision, 2026-08-15). */
18141
18249
  includeStationary: boolean().optional()
18142
- }), array(TrackSchema).readonly()), method(RecentTracksQueryInput, RecentTracksPageSchema), method(object({ deviceId: number() }), _void(), {
18250
+ }), array(TrackSchema).readonly()), method(RecentTracksQueryInput, RecentTracksPageSchema), method(ListGroupsQueryInput, ListGroupsPageSchema), method(object({
18251
+ deviceId: number(),
18252
+ groupId: string().min(1)
18253
+ }), AnalyticsGroupDetailSchema.nullable()), method(object({ deviceId: number() }), _void(), {
18143
18254
  kind: "mutation",
18144
18255
  auth: "admin"
18145
18256
  }), 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({
@@ -18357,6 +18468,33 @@ var NativeCropRefSchema = object({
18357
18468
  h: number()
18358
18469
  })
18359
18470
  });
18471
+ object({
18472
+ crop: object({
18473
+ left: number(),
18474
+ top: number(),
18475
+ width: number().positive(),
18476
+ height: number().positive()
18477
+ }).optional(),
18478
+ content: object({
18479
+ width: number().int().positive(),
18480
+ height: number().int().positive()
18481
+ }),
18482
+ fit: _enum(["stretch", "contain"]),
18483
+ format: _enum([
18484
+ "rgb",
18485
+ "gray",
18486
+ "jpeg"
18487
+ ])
18488
+ });
18489
+ var FrameRefSchema = object({
18490
+ registryId: string().min(1),
18491
+ id: string().min(1),
18492
+ width: number().int().positive(),
18493
+ height: number().int().positive(),
18494
+ format: _enum(["rgb", "gray"]),
18495
+ timestamp: number(),
18496
+ capturedAt: number().optional()
18497
+ });
18360
18498
  var ModelFormatSchema$1 = _enum([
18361
18499
  "onnx",
18362
18500
  "coreml",
@@ -18422,7 +18560,8 @@ var PipelineModelOptionSchema = object({
18422
18560
  sizeMB: number()
18423
18561
  })),
18424
18562
  group: ModelVariantGroupSchema.optional(),
18425
- legacy: boolean().optional()
18563
+ legacy: boolean().optional(),
18564
+ provider: ModelProviderIdSchema.optional()
18426
18565
  });
18427
18566
  var ConfigFieldBridge = custom();
18428
18567
  var PipelineAddonSchemaSchema = object({
@@ -18601,6 +18740,12 @@ method(_void(), array(PipelineEngineChoiceSchema)), method(_void(), PipelineEngi
18601
18740
  steps: array(PipelineStepInputSchema).min(1),
18602
18741
  frame: FrameInputSchema.optional(),
18603
18742
  /**
18743
+ * Process-local lazy frame. Valid only when caller and provider resolve
18744
+ * in the same execution-group process; split/cross-node callers use
18745
+ * `frame`/`image` inline compatibility instead.
18746
+ */
18747
+ frameRef: FrameRefSchema.optional(),
18748
+ /**
18604
18749
  * CB5 shm passthrough — a `FrameHandle` naming the same ring slot
18605
18750
  * the decoded pixels live in. One more member of the one-of
18606
18751
  * frame/frameHandle/image/imageBase64/referenceImage group.
@@ -18896,7 +19041,10 @@ var NativeCropResultSchema = object({
18896
19041
  * Which source served this crop, so a quality-sensitive consumer (the native
18897
19042
  * `keyFrame`) can reject a degraded fallback:
18898
19043
  * - `native` — cut from the decode worker's retained NATIVE surface (the
18899
- * quality path).
19044
+ * quality path). A subject-tile serve is also native-resolution and stays
19045
+ * `native` here: the public enum cannot name `tile` without a breaking cap
19046
+ * change. Runner telemetry distinguishes lease vs tile via `source` on the
19047
+ * internal crop result (`nativeHits` vs `tileHits`).
18900
19048
  * - `ram-fullframe` — the native surface MISSED but the request was full-frame,
18901
19049
  * so the ≤640 RAM `RetainedFrameStore` served it (honest lower-res; legit for
18902
19050
  * the blank-frame guard / 640-snapshot resolve, NOT for the clean keyFrame).
@@ -19387,12 +19535,41 @@ var RunnerLocalLoadSchema = object({
19387
19535
  * legacy `OrchestratorMetricsSchema` shape so existing dashboards keep
19388
19536
  * working unchanged when they switch to reading from the runner cap.
19389
19537
  */
19538
+ var FrameLazyCountersSchema = object({
19539
+ framesDecoded: number(),
19540
+ framesAdmitted: number(),
19541
+ framesDroppedPixelFree: number(),
19542
+ viewsMaterialized: number(),
19543
+ viewsSkipped: number(),
19544
+ workerToRunnerBytes: number(),
19545
+ runnerToPoolRawBytes: number(),
19546
+ runnerToPoolJpegBytes: number(),
19547
+ onDemandFullFrameRequests: number(),
19548
+ onDemandCropRequests: number(),
19549
+ nativeHits: number(),
19550
+ nativeMisses: number(),
19551
+ tileHits: number(),
19552
+ tileMisses: number(),
19553
+ fallbackHits: number(),
19554
+ fallbackMisses: number(),
19555
+ retainedWritesAvoided: number(),
19556
+ residentRefs: number(),
19557
+ residentBytes: number(),
19558
+ releases: number(),
19559
+ evictions: number(),
19560
+ staleMisses: number()
19561
+ });
19562
+ var FrameLazyMetricsSchema = object({
19563
+ node: FrameLazyCountersSchema,
19564
+ cameras: array(FrameLazyCountersSchema.extend({ deviceId: number() }))
19565
+ });
19390
19566
  var RunnerLocalMetricsSchema = object({
19391
19567
  nodeId: string(),
19392
19568
  activeCameras: number(),
19393
19569
  throttledCameras: number(),
19394
19570
  avgInferenceTimeMs: number(),
19395
- queueDepth: number()
19571
+ queueDepth: number(),
19572
+ frameLazy: FrameLazyMetricsSchema.optional()
19396
19573
  });
19397
19574
  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({
19398
19575
  handle: FrameHandleSchema,
@@ -20692,6 +20869,9 @@ method(_void(), ProviderInfoSchema), method(object({ config: record(string(), un
20692
20869
  location: StorageLocationSchema,
20693
20870
  relativePath: string()
20694
20871
  }), _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" });
20872
+ /** Profile-exported FormBuilder schema. Shape is ConfigUISchema at the UI. */
20873
+ var ProfileSettingsSchemaBridge = unknown().nullable();
20874
+ var ProfileSettingsBagSchema = record(string(), unknown());
20695
20875
  /**
20696
20876
  * A live terminal session hosted by the provider addon. Output and input do
20697
20877
  * NOT flow through the capability — they use the addon data plane
@@ -20721,7 +20901,14 @@ var TerminalSessionInfoSchema = object({
20721
20901
  var TerminalProfileInfoSchema = object({
20722
20902
  profileId: string(),
20723
20903
  label: string(),
20724
- description: string().optional()
20904
+ description: string().optional(),
20905
+ /** Spawn defaults the instance form copies on create. */
20906
+ executable: string().optional(),
20907
+ args: array(string()).readonly().optional(),
20908
+ cwd: string().optional(),
20909
+ environment: array(string()).readonly().optional(),
20910
+ /** ConfigUISchema for instance knobs, or null when the profile has none. */
20911
+ settingsSchema: ProfileSettingsSchemaBridge.optional()
20725
20912
  });
20726
20913
  /**
20727
20914
  * A durable operator-created Terminal instance. Profiles are templates; only
@@ -20734,7 +20921,12 @@ var TerminalInstanceInfoSchema = object({
20734
20921
  profileId: string(),
20735
20922
  profileLabel: string(),
20736
20923
  name: string(),
20737
- enabled: boolean()
20924
+ enabled: boolean(),
20925
+ executable: string(),
20926
+ args: array(string()).readonly(),
20927
+ cwd: string(),
20928
+ environment: array(string()).readonly(),
20929
+ profileSettings: ProfileSettingsBagSchema
20738
20930
  });
20739
20931
  var TerminalLegacyCameraSchema = object({
20740
20932
  stableId: string(),
@@ -20764,7 +20956,23 @@ var TerminalOutputBatchSchema = object({
20764
20956
  method(_void(), array(TerminalProfileInfoSchema).readonly(), { auth: "admin" }), method(_void(), array(TerminalInstanceInfoSchema).readonly(), { auth: "admin" }), method(object({
20765
20957
  targetNodeId: string().min(1),
20766
20958
  profileId: string().min(1),
20767
- name: string().trim().min(1).max(160).optional()
20959
+ name: string().trim().min(1).max(160).optional(),
20960
+ executable: string().max(1024).optional(),
20961
+ args: array(string().max(2048)).max(64).optional(),
20962
+ cwd: string().max(1024).optional(),
20963
+ environment: array(string().max(4096)).max(64).optional(),
20964
+ profileSettings: ProfileSettingsBagSchema.optional()
20965
+ }), TerminalInstanceInfoSchema, {
20966
+ kind: "mutation",
20967
+ auth: "admin"
20968
+ }), method(object({
20969
+ instanceId: string().min(1),
20970
+ name: string().trim().min(1).max(160).optional(),
20971
+ executable: string().max(1024).optional(),
20972
+ args: array(string().max(2048)).max(64).optional(),
20973
+ cwd: string().max(1024).optional(),
20974
+ environment: array(string().max(4096)).max(64).optional(),
20975
+ profileSettings: ProfileSettingsBagSchema.optional()
20768
20976
  }), TerminalInstanceInfoSchema, {
20769
20977
  kind: "mutation",
20770
20978
  auth: "admin"
@@ -20786,7 +20994,11 @@ method(_void(), array(TerminalProfileInfoSchema).readonly(), { auth: "admin" }),
20786
20994
  }), method(_void(), array(TerminalSessionInfoSchema).readonly(), { auth: "admin" }), method(object({
20787
20995
  profileId: string(),
20788
20996
  cols: number().int().positive(),
20789
- rows: number().int().positive()
20997
+ rows: number().int().positive(),
20998
+ executable: string().max(1024).optional(),
20999
+ args: array(string().max(2048)).max(64).optional(),
21000
+ cwd: string().max(1024).optional(),
21001
+ environment: array(string().max(4096)).max(64).optional()
20790
21002
  }), TerminalSessionInfoSchema, {
20791
21003
  kind: "mutation",
20792
21004
  auth: "admin"
@@ -24669,10 +24881,10 @@ var lawnMowerControlCapability = {
24669
24881
  *
24670
24882
  * • The SDK (mobile / web client) consumes `getConnectionEndpoints()`
24671
24883
  * to receive an ordered list of candidate base URLs it should race
24672
- * on connect — LAN IPv4 first (lowest latency when on same network),
24673
- * then public hostname (if a tunnel is up), then IPv6. The SDK can
24674
- * race them with short timeouts and stick with the winner for the
24675
- * session.
24884
+ * on connect — LAN IPv4 and stable LAN IPv6 first (lowest latency
24885
+ * when on the same network), then public hostname (if a tunnel is
24886
+ * up). The SDK can race them with short timeouts and stick with the
24887
+ * winner for the session.
24676
24888
  *
24677
24889
  * Why hub-only: agents are not directly addressable by the operator's
24678
24890
  * clients — they reverse-connect to the hub. Exposing their interfaces
@@ -24827,6 +25039,17 @@ var NotificationEndpointSchema = object({
24827
25039
  /** What the ranking currently resolves to (null when nothing is reachable). */
24828
25040
  resolved: string().nullable()
24829
25041
  });
25042
+ /**
25043
+ * The URLs the SDK / viewer should race for API access. `baseUrls` empty =
25044
+ * AUTO (every LAN IPv4 + the public tunnel). `resolved` is what that choice
25045
+ * currently expands to, so the UI can show the effective set either way.
25046
+ */
25047
+ var ViewerEndpointsSchema = object({
25048
+ /** The operator's explicit race set, or empty for AUTO. */
25049
+ baseUrls: array(string()).readonly(),
25050
+ /** What the ranking currently resolves to (may be empty if nothing is up). */
25051
+ resolved: array(string()).readonly()
25052
+ });
24830
25053
  var AllowedAddressesSchema = object({
24831
25054
  /**
24832
25055
  * Allowlist of interface addresses operators have explicitly opted
@@ -24835,6 +25058,20 @@ var AllowedAddressesSchema = object({
24835
25058
  * Network Addresses admin page and persisted by the addon.
24836
25059
  */
24837
25060
  addresses: array(string()).readonly() });
25061
+ var TlsStatusSchema = object({
25062
+ mode: _enum([
25063
+ "generated",
25064
+ "uploaded",
25065
+ "disabled"
25066
+ ]),
25067
+ leafFingerprintSha256: string().nullable(),
25068
+ caFingerprintSha256: string().nullable(),
25069
+ validTo: string().nullable(),
25070
+ sans: array(string()),
25071
+ caCertPem: string().nullable(),
25072
+ reissueError: string().nullable(),
25073
+ restartRequired: boolean()
25074
+ });
24838
25075
  method(_void(), ListResultSchema), method(_void(), PreferredSchema), method(object({
24839
25076
  /**
24840
25077
  * LEGACY HINT — do not send from new code. Kept optional so clients
@@ -24844,17 +25081,31 @@ method(_void(), ListResultSchema), method(_void(), PreferredSchema), method(obje
24844
25081
  */
24845
25082
  port: number().int().min(1).max(65535).optional(),
24846
25083
  /** Include `http(s)://127.0.0.1:<port>` as the lowest-priority
24847
- * candidate. Default `true`. */
25084
+ * candidate. Default `false` — loopback is not a client route. */
24848
25085
  includeLoopback: boolean().optional(),
24849
- /** Skip IPv6 entries. Some legacy clients can't parse them.
24850
- * Default `false`. */
25086
+ /** Skip IPv6 entries. Default `false` the palette includes stable
25087
+ * LAN IPv6 (ICE/WebRTC uses dual-stack regardless). Pass `true` to
25088
+ * hide them. The viewer HTTP/WS race is `getViewerEndpoints`. */
24851
25089
  ipv4Only: boolean().optional(),
24852
25090
  /** Scheme to emit for LAN/loopback URLs. Default `'http'`.
24853
25091
  * Pass `'https'` when the caller is itself loaded over HTTPS
24854
25092
  * to avoid mixed-content blocks in the browser. The public
24855
25093
  * tunnel always emits `https://` regardless. */
24856
25094
  scheme: _enum(["http", "https"]).optional()
24857
- }), 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" });
25095
+ }), 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, {
25096
+ kind: "mutation",
25097
+ auth: "admin"
25098
+ }), method(object({
25099
+ certPem: string().min(1),
25100
+ keyPem: string().min(1),
25101
+ caPem: string().optional()
25102
+ }), TlsStatusSchema, {
25103
+ kind: "mutation",
25104
+ auth: "admin"
25105
+ }), method(_void(), object({ pem: string() })), method(_void(), TlsStatusSchema, {
25106
+ kind: "mutation",
25107
+ auth: "admin"
25108
+ });
24858
25109
  var LockControlStatusSchema = object({
24859
25110
  /** Lifecycle state of the lock. `jammed` means the motor reported
24860
25111
  * failure to reach the target — operator intervention required. */
@@ -26415,7 +26666,12 @@ var PlateInfoSchema = object({
26415
26666
  plateBbox: BoundingBoxSchema.optional(),
26416
26667
  /** keyFrame parity: MediaStore key of the track's native-resolution key frame. */
26417
26668
  keyFrameMediaKey: string().optional(),
26418
- base64: string().optional()
26669
+ base64: string().optional(),
26670
+ /**
26671
+ * Same crop as a data-plane URL. `getPlateByTrack` returns this and
26672
+ * never inlines JPEG; `listPlates` still inlines for the admin-ui.
26673
+ */
26674
+ cropUrl: string().optional()
26419
26675
  });
26420
26676
  var MediaFileLiteSchema = object({
26421
26677
  key: string(),
@@ -31939,6 +32195,12 @@ Object.freeze({
31939
32195
  addonId: null,
31940
32196
  access: "view"
31941
32197
  },
32198
+ "deviceManager.getBindingsBatch": {
32199
+ capName: "device-manager",
32200
+ capScope: "system",
32201
+ addonId: null,
32202
+ access: "view"
32203
+ },
31942
32204
  "deviceManager.getChildren": {
31943
32205
  capName: "device-manager",
31944
32206
  capScope: "system",
@@ -31999,6 +32261,12 @@ Object.freeze({
31999
32261
  addonId: null,
32000
32262
  access: "view"
32001
32263
  },
32264
+ "deviceManager.getLinkedDevicesBatch": {
32265
+ capName: "device-manager",
32266
+ capScope: "system",
32267
+ addonId: null,
32268
+ access: "view"
32269
+ },
32002
32270
  "deviceManager.getRoleDisplayDefaults": {
32003
32271
  capName: "device-manager",
32004
32272
  capScope: "system",
@@ -32881,6 +33149,12 @@ Object.freeze({
32881
33149
  addonId: null,
32882
33150
  access: "create"
32883
33151
  },
33152
+ "localNetwork.downloadCa": {
33153
+ capName: "local-network",
33154
+ capScope: "system",
33155
+ addonId: null,
33156
+ access: "view"
33157
+ },
32884
33158
  "localNetwork.getAllowedAddresses": {
32885
33159
  capName: "local-network",
32886
33160
  capScope: "system",
@@ -32905,18 +33179,42 @@ Object.freeze({
32905
33179
  addonId: null,
32906
33180
  access: "view"
32907
33181
  },
33182
+ "localNetwork.getTlsStatus": {
33183
+ capName: "local-network",
33184
+ capScope: "system",
33185
+ addonId: null,
33186
+ access: "view"
33187
+ },
33188
+ "localNetwork.getViewerEndpoints": {
33189
+ capName: "local-network",
33190
+ capScope: "system",
33191
+ addonId: null,
33192
+ access: "view"
33193
+ },
32908
33194
  "localNetwork.list": {
32909
33195
  capName: "local-network",
32910
33196
  capScope: "system",
32911
33197
  addonId: null,
32912
33198
  access: "view"
32913
33199
  },
33200
+ "localNetwork.regenerateCertificate": {
33201
+ capName: "local-network",
33202
+ capScope: "system",
33203
+ addonId: null,
33204
+ access: "create"
33205
+ },
32914
33206
  "localNetwork.resetAllowlistToBestMatch": {
32915
33207
  capName: "local-network",
32916
33208
  capScope: "system",
32917
33209
  addonId: null,
32918
33210
  access: "delete"
32919
33211
  },
33212
+ "localNetwork.revertToGeneratedCertificate": {
33213
+ capName: "local-network",
33214
+ capScope: "system",
33215
+ addonId: null,
33216
+ access: "create"
33217
+ },
32920
33218
  "localNetwork.setAllowedAddresses": {
32921
33219
  capName: "local-network",
32922
33220
  capScope: "system",
@@ -32929,6 +33227,18 @@ Object.freeze({
32929
33227
  addonId: null,
32930
33228
  access: "create"
32931
33229
  },
33230
+ "localNetwork.setViewerEndpoints": {
33231
+ capName: "local-network",
33232
+ capScope: "system",
33233
+ addonId: null,
33234
+ access: "create"
33235
+ },
33236
+ "localNetwork.uploadCertificate": {
33237
+ capName: "local-network",
33238
+ capScope: "system",
33239
+ addonId: null,
33240
+ access: "create"
33241
+ },
32932
33242
  "lockControl.lock": {
32933
33243
  capName: "lock-control",
32934
33244
  capScope: "device",
@@ -33727,6 +34037,12 @@ Object.freeze({
33727
34037
  addonId: null,
33728
34038
  access: "view"
33729
34039
  },
34040
+ "pipelineAnalytics.getGroup": {
34041
+ capName: "pipeline-analytics",
34042
+ capScope: "device",
34043
+ addonId: null,
34044
+ access: "view"
34045
+ },
33730
34046
  "pipelineAnalytics.getKeyEvents": {
33731
34047
  capName: "pipeline-analytics",
33732
34048
  capScope: "device",
@@ -33811,6 +34127,12 @@ Object.freeze({
33811
34127
  addonId: null,
33812
34128
  access: "view"
33813
34129
  },
34130
+ "pipelineAnalytics.listGroups": {
34131
+ capName: "pipeline-analytics",
34132
+ capScope: "device",
34133
+ addonId: null,
34134
+ access: "view"
34135
+ },
33814
34136
  "pipelineAnalytics.listOpsLog": {
33815
34137
  capName: "pipeline-analytics",
33816
34138
  capScope: "device",
@@ -35809,6 +36131,12 @@ Object.freeze({
35809
36131
  addonId: null,
35810
36132
  access: "create"
35811
36133
  },
36134
+ "terminalSession.updateInstance": {
36135
+ capName: "terminal-session",
36136
+ capScope: "system",
36137
+ addonId: null,
36138
+ access: "create"
36139
+ },
35812
36140
  "terminalSession.writeInput": {
35813
36141
  capName: "terminal-session",
35814
36142
  capScope: "system",
@@ -36586,6 +36914,11 @@ Object.freeze({
36586
36914
  form: "single",
36587
36915
  optional: false
36588
36916
  }],
36917
+ "deviceManager.getBindingsBatch": [{
36918
+ name: "deviceIds",
36919
+ form: "array",
36920
+ optional: false
36921
+ }],
36589
36922
  "deviceManager.getChildren": [{
36590
36923
  name: "parentDeviceId",
36591
36924
  form: "single",
@@ -36631,6 +36964,11 @@ Object.freeze({
36631
36964
  form: "single",
36632
36965
  optional: false
36633
36966
  }],
36967
+ "deviceManager.getLinkedDevicesBatch": [{
36968
+ name: "deviceIds",
36969
+ form: "array",
36970
+ optional: false
36971
+ }],
36634
36972
  "deviceManager.getSettingsSchema": [{
36635
36973
  name: "deviceId",
36636
36974
  form: "single",
@@ -36651,6 +36989,11 @@ Object.freeze({
36651
36989
  form: "single",
36652
36990
  optional: false
36653
36991
  }],
36992
+ "deviceManager.listAll": [{
36993
+ name: "deviceIds",
36994
+ form: "array",
36995
+ optional: true
36996
+ }],
36654
36997
  "deviceManager.loadConfig": [{
36655
36998
  name: "deviceId",
36656
36999
  form: "single",
@@ -37224,6 +37567,11 @@ Object.freeze({
37224
37567
  form: "single",
37225
37568
  optional: false
37226
37569
  }],
37570
+ "pipelineAnalytics.getGroup": [{
37571
+ name: "deviceId",
37572
+ form: "single",
37573
+ optional: false
37574
+ }],
37227
37575
  "pipelineAnalytics.getKeyEvents": [{
37228
37576
  name: "deviceId",
37229
37577
  form: "single",
@@ -37279,6 +37627,11 @@ Object.freeze({
37279
37627
  form: "array",
37280
37628
  optional: false
37281
37629
  }],
37630
+ "pipelineAnalytics.listGroups": [{
37631
+ name: "deviceIds",
37632
+ form: "array",
37633
+ optional: false
37634
+ }],
37282
37635
  "pipelineAnalytics.listOpsLog": [{
37283
37636
  name: "deviceId",
37284
37637
  form: "single",
@@ -38296,6 +38649,35 @@ Object.freeze(Object.fromEntries([{
38296
38649
  }]
38297
38650
  }].map((s) => [s.stepId, s.defaultModelId])));
38298
38651
  string().min(1);
38652
+ var CLUSTER_STEP_SETTING_FIELDS = [{
38653
+ stepId: "face-embedding",
38654
+ key: "minLandmarkFaceSize",
38655
+ label: "Min face size for recognition (detection px)",
38656
+ 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.",
38657
+ type: "slider",
38658
+ min: 0,
38659
+ max: 64,
38660
+ step: 2,
38661
+ default: 24
38662
+ }];
38663
+ function clusterStepSettingKey(stepId, fieldKey) {
38664
+ return `clusterStepSetting:${stepId}:${fieldKey}`;
38665
+ }
38666
+ var ClusterSettingNumberSchema = number().finite();
38667
+ function readClusterStepSettings(config) {
38668
+ const out = {};
38669
+ for (const field of CLUSTER_STEP_SETTING_FIELDS) {
38670
+ const parsed = ClusterSettingNumberSchema.safeParse(config[clusterStepSettingKey(field.stepId, field.key)]);
38671
+ const value = parsed.success ? parsed.data : field.default;
38672
+ const existing = out[field.stepId] ?? {};
38673
+ out[field.stepId] = {
38674
+ ...existing,
38675
+ [field.key]: value
38676
+ };
38677
+ }
38678
+ return out;
38679
+ }
38680
+ readClusterStepSettings({});
38299
38681
  object({
38300
38682
  /**
38301
38683
  * Fraction of the box's own size added on EACH side before cutting.