@camstack/addon-agent-ui 1.2.27 → 1.2.29

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/dist/addon.js +433 -51
  2. package/package.json +1 -1
package/dist/addon.js CHANGED
@@ -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
  }
@@ -8014,6 +8024,15 @@ var LabelDefinitionSchema = object({
8014
8024
  description: string().optional(),
8015
8025
  icon: string().optional()
8016
8026
  });
8027
+ var ClassMapDefinitionSchema = object({
8028
+ mapping: record(string(), _enum([
8029
+ "person",
8030
+ "vehicle",
8031
+ "animal",
8032
+ "package"
8033
+ ])),
8034
+ preserveOriginal: boolean()
8035
+ });
8017
8036
  var MODEL_FORMATS = [
8018
8037
  "onnx",
8019
8038
  "coreml",
@@ -8097,6 +8116,12 @@ var ModelVariantGroupSchema = object({
8097
8116
  */
8098
8117
  resolution: number().int().positive().optional()
8099
8118
  });
8119
+ var ModelProviderIdSchema = _enum([
8120
+ "camstack",
8121
+ "frigate",
8122
+ "scrypted",
8123
+ "custom"
8124
+ ]);
8100
8125
  var ModelCatalogEntrySchema = object({
8101
8126
  id: string(),
8102
8127
  name: string(),
@@ -8192,7 +8217,19 @@ var ModelCatalogEntrySchema = object({
8192
8217
  * `id` stays the source of truth for resolution/download/persistence; grouping
8193
8218
  * is a presentation overlay resolved back to an `id`.
8194
8219
  */
8195
- group: ModelVariantGroupSchema.optional()
8220
+ group: ModelVariantGroupSchema.optional(),
8221
+ /**
8222
+ * Catalog source for the pipeline stepper's provider-first picker. Absent on
8223
+ * built-in CamStack entries (treated as `camstack`) and on registry rows
8224
+ * persisted before this field existed (`inferModelProvider` fills those).
8225
+ */
8226
+ provider: ModelProviderIdSchema.optional(),
8227
+ /**
8228
+ * Per-MODEL class map override. Absent ⇒ the step's `StepDefinition.classMap`
8229
+ * applies (Frigate / COCO public catalog). Set on a custom model whose raw
8230
+ * labels already ARE the CamStack macros (Scrypted identity map).
8231
+ */
8232
+ classMap: ClassMapDefinitionSchema.optional()
8196
8233
  });
8197
8234
  var ConvertTargetSchema = discriminatedUnion("format", [object({
8198
8235
  format: literal("openvino"),
@@ -8221,7 +8258,8 @@ var ModelConvertMetadataSchema = object({
8221
8258
  "ocr",
8222
8259
  "segmentation"
8223
8260
  ]),
8224
- faceAlignment: boolean().optional()
8261
+ faceAlignment: boolean().optional(),
8262
+ classMap: ClassMapDefinitionSchema.optional()
8225
8263
  });
8226
8264
  var ConvertResultSchema = object({
8227
8265
  entry: ModelCatalogEntrySchema,
@@ -11714,6 +11752,27 @@ var LinkedDeviceSchema = object({
11714
11752
  features: array(string()),
11715
11753
  producesTrackedEvents: boolean().optional()
11716
11754
  });
11755
+ /** One camera's resolved linked set, tagged with the camera it belongs to.
11756
+ * The batch answer needs the tag; the single-device answer already has it
11757
+ * from the input, which is why `getLinkedDevices` keeps the untagged shape. */
11758
+ var LinkedDevicesForDeviceSchema = object({
11759
+ deviceId: number(),
11760
+ mode: LinkedDevicesModeSchema,
11761
+ devices: array(LinkedDeviceSchema)
11762
+ });
11763
+ /** One device's binding map — the shape `getBindings`, `getBindingsBatch` and
11764
+ * `getAllBindings` all answer in. Declared once: three copies of the same
11765
+ * object literal is exactly how the three drift apart. */
11766
+ var DeviceBindingsForDeviceSchema = object({
11767
+ deviceId: number(),
11768
+ entries: array(object({
11769
+ capName: string(),
11770
+ kind: _enum(["native", "wrapped"]),
11771
+ providerAddonId: string(),
11772
+ providerNodeId: string(),
11773
+ nativeAddonId: string()
11774
+ }))
11775
+ });
11717
11776
  var SavedDeviceRowSchema = object({
11718
11777
  /** Numeric id reserved at allocateDeviceId time. */
11719
11778
  id: number(),
@@ -11939,11 +11998,25 @@ method(object({
11939
11998
  projection: _enum(["full", "slim"]).optional(),
11940
11999
  /** Return only camera devices. Filtering server-side instead of
11941
12000
  * shipping 293 rows to find 12. */
11942
- isCamera: boolean().optional()
12001
+ isCamera: boolean().optional(),
12002
+ /**
12003
+ * Return only these device ids. For the caller that already KNOWS the
12004
+ * handful it wants and needs a field the id-bearing answer does not
12005
+ * carry — the viewer's linked-devices panel joins `type` and `online`
12006
+ * onto ~8 linked ids and, unfiltered, dragged the fleet across to do
12007
+ * it: 433 KB slim / 958 KB full for 967 devices, on a query that
12008
+ * refetches on the reconcile interval, on a phone.
12009
+ *
12010
+ * Safe to send at a hub that predates it: Zod STRIPS unknown input
12011
+ * keys rather than rejecting them (verified against the live hub
12012
+ * 2026-08-25 — 967 rows came back), so an old hub answers exactly what
12013
+ * it answers today and the caller filters as it already does.
12014
+ */
12015
+ deviceIds: array(number()).optional()
11943
12016
  }), array(DeviceInfoSchema)), method(object({ deviceId: number() }), DeviceInfoSchema.nullable()), method(object({ parentDeviceId: number() }), array(DeviceInfoSchema)), method(object({ deviceId: number() }), object({
11944
12017
  mode: LinkedDevicesModeSchema,
11945
12018
  devices: array(LinkedDeviceSchema)
11946
- })), method(object({ deviceId: number() }), array(StreamSourceEntrySchema$1)), method(object({ deviceId: number() }), array(ConfigEntrySchema)), method(object({ deviceId: number() }), ConfigUISchemaOutput), method(object({
12019
+ })), 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({
11947
12020
  deviceId: number(),
11948
12021
  values: record(string(), unknown())
11949
12022
  }), object({ success: literal(true) }), {
@@ -11970,25 +12043,7 @@ method(object({
11970
12043
  }), method(object({ deviceId: number() }), array(StreamProbeResultSchema), {
11971
12044
  kind: "mutation",
11972
12045
  auth: "admin"
11973
- }), method(object({ deviceId: number() }), 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({}), array(object({
11983
- deviceId: number(),
11984
- entries: array(object({
11985
- capName: string(),
11986
- kind: _enum(["native", "wrapped"]),
11987
- providerAddonId: string(),
11988
- providerNodeId: string(),
11989
- nativeAddonId: string()
11990
- }))
11991
- }))), method(object({
12046
+ }), method(object({ deviceId: number() }), DeviceBindingsForDeviceSchema), method(object({ deviceIds: array(number()) }), array(DeviceBindingsForDeviceSchema)), method(object({}), array(DeviceBindingsForDeviceSchema)), method(object({
11992
12047
  deviceId: number(),
11993
12048
  capName: string(),
11994
12049
  wrapperAddonId: string(),
@@ -14360,12 +14415,15 @@ var NcOccupancyConditionSchema = object({
14360
14415
  * there is no second switch that can disagree with the first and every rule
14361
14416
  * authored before the decision migrates for free (`audioModeOf`):
14362
14417
  *
14363
- * - **LABEL mode — `labels` present.** The rule fires on the FIRST frame the
14364
- * classifier labels with one of them. No window, no percentage:
14365
- * `hitPercent` and `samplingSeconds` are ignored, and the rule's own
14366
- * `throttle` cooldown is the only brake. The per-label confidence floor is
14367
- * the analyzer's (`classificationMinScore`, per device) a label only
14368
- * reaches this condition if the classifier was already confident enough.
14418
+ * - **LABEL mode — `labels` present.** The rule fires when `confirmHits`
14419
+ * labelled frames land inside `confirmWindowSec` (default 2 in 5 s).
14420
+ * `hitPercent` and `samplingSeconds` are still ignored a percentage of
14421
+ * frames is the wrong question for a classifier that labels 1–3 frames
14422
+ * per episode. The count window is the brake that drops a single-frame
14423
+ * false positive; the rule's own `throttle` cooldown is the other. The
14424
+ * per-label confidence floor is the analyzer's (`classificationMinScore`,
14425
+ * per device) — a label only reaches this condition if the classifier was
14426
+ * already confident enough. `confirmHits: 1` restores first-frame fire.
14369
14427
  * - **LEVEL mode — `dbThreshold` present, no labels.** The sampling window IS
14370
14428
  * the condition: at least `hitPercent`% of the samples over
14371
14429
  * `samplingSeconds` must be at or above `dbThreshold` dBFS (see
@@ -14392,14 +14450,22 @@ var NcOccupancyConditionSchema = object({
14392
14450
  * an operator who typed `dog` mean the same thing.
14393
14451
  */
14394
14452
  var NcAudioConditionSchema = object({
14395
- /** LABEL MODE: audio macro labels. Present ⇒ fires on the first labelled frame. */
14453
+ /** LABEL MODE: audio macro labels. Present ⇒ count-in-window confirm. */
14396
14454
  labels: array(string().min(1)).min(1).optional(),
14397
14455
  /** LEVEL MODE: floor in dBFS (negative-going, `0` = full scale). */
14398
14456
  dbThreshold: number().min(-96).max(0).optional(),
14399
14457
  /** LEVEL MODE ONLY: percentage of the window's samples that must be hits (1–100). */
14400
14458
  hitPercent: number().int().min(1).max(100).default(60),
14401
14459
  /** LEVEL MODE ONLY: length of the sampling window in seconds. */
14402
- samplingSeconds: number().int().min(1).max(300).default(10)
14460
+ samplingSeconds: number().int().min(1).max(300).default(10),
14461
+ /**
14462
+ * LABEL MODE: how many labelled frames must land inside
14463
+ * {@link NcAudioConditionSchema.shape.confirmWindowSec} before dispatch.
14464
+ * Absent ⇒ 2 (the matcher default). `1` is first-frame fire.
14465
+ */
14466
+ confirmHits: number().int().min(1).max(20).optional(),
14467
+ /** LABEL MODE: the window those frames must share, in seconds. Absent ⇒ 5. */
14468
+ confirmWindowSec: number().int().min(1).max(60).optional()
14403
14469
  });
14404
14470
  /**
14405
14471
  * Which zone-crossing DIRECTION a rule accepts (`ObjectEvent.zoneCrossing`).
@@ -16773,6 +16839,46 @@ var RecentTracksPageSchema = object({
16773
16839
  /** Cursor for the next page, or null when this page is the last. */
16774
16840
  nextCursor: string().nullable()
16775
16841
  });
16842
+ var LIST_GROUPS_DEFAULT_LIMIT = 40;
16843
+ var LIST_GROUPS_MAX_LIMIT = 100;
16844
+ var AnalyticsGroupRecordSchema = object({
16845
+ id: string(),
16846
+ deviceId: number().int(),
16847
+ openedAt: number().int(),
16848
+ closedAt: number().int(),
16849
+ timestamp: number().int(),
16850
+ memberCount: number().int(),
16851
+ memberTrackIds: array(string()).readonly(),
16852
+ className: string(),
16853
+ classes: array(string()).readonly(),
16854
+ /** Relative event-media path, or null when the group has no picture yet. */
16855
+ mediaUrl: string().nullable(),
16856
+ singleton: boolean()
16857
+ });
16858
+ var AnalyticsGroupMemberSchema = object({
16859
+ trackId: string(),
16860
+ deviceId: number().int(),
16861
+ className: string(),
16862
+ firstSeen: number().int(),
16863
+ lastSeen: number().int(),
16864
+ mediaUrl: string().nullable()
16865
+ });
16866
+ var AnalyticsGroupDetailSchema = AnalyticsGroupRecordSchema.extend({ members: array(AnalyticsGroupMemberSchema).readonly() });
16867
+ var ListGroupsQueryInput = object({
16868
+ /** Devices to merge. An empty array yields `{ groups: [], nextCursor: null }`. */
16869
+ deviceIds: array(number()),
16870
+ /** Window lower bound on `closedAt` (inclusive). */
16871
+ since: number().optional(),
16872
+ /** Window upper bound on `openedAt` (inclusive). */
16873
+ until: number().optional(),
16874
+ limit: number().int().min(1).max(LIST_GROUPS_MAX_LIMIT).default(LIST_GROUPS_DEFAULT_LIMIT),
16875
+ /** Opaque continuation cursor from a previous page's `nextCursor`. */
16876
+ cursor: string().optional()
16877
+ });
16878
+ var ListGroupsPageSchema = object({
16879
+ groups: array(AnalyticsGroupRecordSchema).readonly(),
16880
+ nextCursor: string().nullable()
16881
+ });
16776
16882
  var KeyEventQueryInput = object({
16777
16883
  deviceId: number(),
16778
16884
  /** Window lower bound (track firstSeen ≥ since). */
@@ -16848,7 +16954,9 @@ var TrackCascadeCountsSchema = object({
16848
16954
  /** Unassigned plate reads removed (best-effort; plate leg deferred to plate-intelligence). */
16849
16955
  plates: number().int(),
16850
16956
  /** Per-track CLIP search vectors removed (best-effort). */
16851
- embeddings: number().int()
16957
+ embeddings: number().int(),
16958
+ /** Group membership + group rows removed with their last member (best-effort). */
16959
+ groups: number().int()
16852
16960
  });
16853
16961
  /** Disk-wins reconcile: media rows whose blobs are gone, then empty tracks. */
16854
16962
  var DiskReconcileCountsSchema = object({
@@ -16994,7 +17102,10 @@ DeviceType.Camera, method(object({ deviceId: number() }), array(TrackSchema).rea
16994
17102
  * stationary registry). Default false: the timeline lists passages,
16995
17103
  * not parking records (operator decision, 2026-08-15). */
16996
17104
  includeStationary: boolean().optional()
16997
- }), array(TrackSchema).readonly()), method(RecentTracksQueryInput, RecentTracksPageSchema), method(object({ deviceId: number() }), _void(), {
17105
+ }), array(TrackSchema).readonly()), method(RecentTracksQueryInput, RecentTracksPageSchema), method(ListGroupsQueryInput, ListGroupsPageSchema), method(object({
17106
+ deviceId: number(),
17107
+ groupId: string().min(1)
17108
+ }), AnalyticsGroupDetailSchema.nullable()), method(object({ deviceId: number() }), _void(), {
16998
17109
  kind: "mutation",
16999
17110
  auth: "admin"
17000
17111
  }), 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({
@@ -17212,6 +17323,33 @@ var NativeCropRefSchema = object({
17212
17323
  h: number()
17213
17324
  })
17214
17325
  });
17326
+ object({
17327
+ crop: object({
17328
+ left: number(),
17329
+ top: number(),
17330
+ width: number().positive(),
17331
+ height: number().positive()
17332
+ }).optional(),
17333
+ content: object({
17334
+ width: number().int().positive(),
17335
+ height: number().int().positive()
17336
+ }),
17337
+ fit: _enum(["stretch", "contain"]),
17338
+ format: _enum([
17339
+ "rgb",
17340
+ "gray",
17341
+ "jpeg"
17342
+ ])
17343
+ });
17344
+ var FrameRefSchema = object({
17345
+ registryId: string().min(1),
17346
+ id: string().min(1),
17347
+ width: number().int().positive(),
17348
+ height: number().int().positive(),
17349
+ format: _enum(["rgb", "gray"]),
17350
+ timestamp: number(),
17351
+ capturedAt: number().optional()
17352
+ });
17215
17353
  var ModelFormatSchema$1 = _enum([
17216
17354
  "onnx",
17217
17355
  "coreml",
@@ -17277,7 +17415,8 @@ var PipelineModelOptionSchema = object({
17277
17415
  sizeMB: number()
17278
17416
  })),
17279
17417
  group: ModelVariantGroupSchema.optional(),
17280
- legacy: boolean().optional()
17418
+ legacy: boolean().optional(),
17419
+ provider: ModelProviderIdSchema.optional()
17281
17420
  });
17282
17421
  var ConfigFieldBridge = custom();
17283
17422
  var PipelineAddonSchemaSchema = object({
@@ -17456,6 +17595,12 @@ method(_void(), array(PipelineEngineChoiceSchema)), method(_void(), PipelineEngi
17456
17595
  steps: array(PipelineStepInputSchema).min(1),
17457
17596
  frame: FrameInputSchema.optional(),
17458
17597
  /**
17598
+ * Process-local lazy frame. Valid only when caller and provider resolve
17599
+ * in the same execution-group process; split/cross-node callers use
17600
+ * `frame`/`image` inline compatibility instead.
17601
+ */
17602
+ frameRef: FrameRefSchema.optional(),
17603
+ /**
17459
17604
  * CB5 shm passthrough — a `FrameHandle` naming the same ring slot
17460
17605
  * the decoded pixels live in. One more member of the one-of
17461
17606
  * frame/frameHandle/image/imageBase64/referenceImage group.
@@ -17711,7 +17856,10 @@ var NativeCropResultSchema = object({
17711
17856
  * Which source served this crop, so a quality-sensitive consumer (the native
17712
17857
  * `keyFrame`) can reject a degraded fallback:
17713
17858
  * - `native` — cut from the decode worker's retained NATIVE surface (the
17714
- * quality path).
17859
+ * quality path). A subject-tile serve is also native-resolution and stays
17860
+ * `native` here: the public enum cannot name `tile` without a breaking cap
17861
+ * change. Runner telemetry distinguishes lease vs tile via `source` on the
17862
+ * internal crop result (`nativeHits` vs `tileHits`).
17715
17863
  * - `ram-fullframe` — the native surface MISSED but the request was full-frame,
17716
17864
  * so the ≤640 RAM `RetainedFrameStore` served it (honest lower-res; legit for
17717
17865
  * the blank-frame guard / 640-snapshot resolve, NOT for the clean keyFrame).
@@ -18202,12 +18350,41 @@ var RunnerLocalLoadSchema = object({
18202
18350
  * legacy `OrchestratorMetricsSchema` shape so existing dashboards keep
18203
18351
  * working unchanged when they switch to reading from the runner cap.
18204
18352
  */
18353
+ var FrameLazyCountersSchema = object({
18354
+ framesDecoded: number(),
18355
+ framesAdmitted: number(),
18356
+ framesDroppedPixelFree: number(),
18357
+ viewsMaterialized: number(),
18358
+ viewsSkipped: number(),
18359
+ workerToRunnerBytes: number(),
18360
+ runnerToPoolRawBytes: number(),
18361
+ runnerToPoolJpegBytes: number(),
18362
+ onDemandFullFrameRequests: number(),
18363
+ onDemandCropRequests: number(),
18364
+ nativeHits: number(),
18365
+ nativeMisses: number(),
18366
+ tileHits: number(),
18367
+ tileMisses: number(),
18368
+ fallbackHits: number(),
18369
+ fallbackMisses: number(),
18370
+ retainedWritesAvoided: number(),
18371
+ residentRefs: number(),
18372
+ residentBytes: number(),
18373
+ releases: number(),
18374
+ evictions: number(),
18375
+ staleMisses: number()
18376
+ });
18377
+ var FrameLazyMetricsSchema = object({
18378
+ node: FrameLazyCountersSchema,
18379
+ cameras: array(FrameLazyCountersSchema.extend({ deviceId: number() }))
18380
+ });
18205
18381
  var RunnerLocalMetricsSchema = object({
18206
18382
  nodeId: string(),
18207
18383
  activeCameras: number(),
18208
18384
  throttledCameras: number(),
18209
18385
  avgInferenceTimeMs: number(),
18210
- queueDepth: number()
18386
+ queueDepth: number(),
18387
+ frameLazy: FrameLazyMetricsSchema.optional()
18211
18388
  });
18212
18389
  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({
18213
18390
  handle: FrameHandleSchema,
@@ -19507,6 +19684,9 @@ method(_void(), ProviderInfoSchema), method(object({ config: record(string(), un
19507
19684
  location: StorageLocationSchema,
19508
19685
  relativePath: string()
19509
19686
  }), _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" });
19687
+ /** Profile-exported FormBuilder schema. Shape is ConfigUISchema at the UI. */
19688
+ var ProfileSettingsSchemaBridge = unknown().nullable();
19689
+ var ProfileSettingsBagSchema = record(string(), unknown());
19510
19690
  /**
19511
19691
  * A live terminal session hosted by the provider addon. Output and input do
19512
19692
  * NOT flow through the capability — they use the addon data plane
@@ -19536,7 +19716,14 @@ var TerminalSessionInfoSchema = object({
19536
19716
  var TerminalProfileInfoSchema = object({
19537
19717
  profileId: string(),
19538
19718
  label: string(),
19539
- description: string().optional()
19719
+ description: string().optional(),
19720
+ /** Spawn defaults the instance form copies on create. */
19721
+ executable: string().optional(),
19722
+ args: array(string()).readonly().optional(),
19723
+ cwd: string().optional(),
19724
+ environment: array(string()).readonly().optional(),
19725
+ /** ConfigUISchema for instance knobs, or null when the profile has none. */
19726
+ settingsSchema: ProfileSettingsSchemaBridge.optional()
19540
19727
  });
19541
19728
  /**
19542
19729
  * A durable operator-created Terminal instance. Profiles are templates; only
@@ -19549,7 +19736,12 @@ var TerminalInstanceInfoSchema = object({
19549
19736
  profileId: string(),
19550
19737
  profileLabel: string(),
19551
19738
  name: string(),
19552
- enabled: boolean()
19739
+ enabled: boolean(),
19740
+ executable: string(),
19741
+ args: array(string()).readonly(),
19742
+ cwd: string(),
19743
+ environment: array(string()).readonly(),
19744
+ profileSettings: ProfileSettingsBagSchema
19553
19745
  });
19554
19746
  var TerminalLegacyCameraSchema = object({
19555
19747
  stableId: string(),
@@ -19579,7 +19771,23 @@ var TerminalOutputBatchSchema = object({
19579
19771
  method(_void(), array(TerminalProfileInfoSchema).readonly(), { auth: "admin" }), method(_void(), array(TerminalInstanceInfoSchema).readonly(), { auth: "admin" }), method(object({
19580
19772
  targetNodeId: string().min(1),
19581
19773
  profileId: string().min(1),
19582
- name: string().trim().min(1).max(160).optional()
19774
+ name: string().trim().min(1).max(160).optional(),
19775
+ executable: string().max(1024).optional(),
19776
+ args: array(string().max(2048)).max(64).optional(),
19777
+ cwd: string().max(1024).optional(),
19778
+ environment: array(string().max(4096)).max(64).optional(),
19779
+ profileSettings: ProfileSettingsBagSchema.optional()
19780
+ }), TerminalInstanceInfoSchema, {
19781
+ kind: "mutation",
19782
+ auth: "admin"
19783
+ }), method(object({
19784
+ instanceId: string().min(1),
19785
+ name: string().trim().min(1).max(160).optional(),
19786
+ executable: string().max(1024).optional(),
19787
+ args: array(string().max(2048)).max(64).optional(),
19788
+ cwd: string().max(1024).optional(),
19789
+ environment: array(string().max(4096)).max(64).optional(),
19790
+ profileSettings: ProfileSettingsBagSchema.optional()
19583
19791
  }), TerminalInstanceInfoSchema, {
19584
19792
  kind: "mutation",
19585
19793
  auth: "admin"
@@ -19601,7 +19809,11 @@ method(_void(), array(TerminalProfileInfoSchema).readonly(), { auth: "admin" }),
19601
19809
  }), method(_void(), array(TerminalSessionInfoSchema).readonly(), { auth: "admin" }), method(object({
19602
19810
  profileId: string(),
19603
19811
  cols: number().int().positive(),
19604
- rows: number().int().positive()
19812
+ rows: number().int().positive(),
19813
+ executable: string().max(1024).optional(),
19814
+ args: array(string().max(2048)).max(64).optional(),
19815
+ cwd: string().max(1024).optional(),
19816
+ environment: array(string().max(4096)).max(64).optional()
19605
19817
  }), TerminalSessionInfoSchema, {
19606
19818
  kind: "mutation",
19607
19819
  auth: "admin"
@@ -22383,10 +22595,10 @@ DeviceType.LawnMower, method(object({ deviceId: number().int().nonnegative() }),
22383
22595
  *
22384
22596
  * • The SDK (mobile / web client) consumes `getConnectionEndpoints()`
22385
22597
  * to receive an ordered list of candidate base URLs it should race
22386
- * on connect — LAN IPv4 first (lowest latency when on same network),
22387
- * then public hostname (if a tunnel is up), then IPv6. The SDK can
22388
- * race them with short timeouts and stick with the winner for the
22389
- * session.
22598
+ * on connect — LAN IPv4 and stable LAN IPv6 first (lowest latency
22599
+ * when on the same network), then public hostname (if a tunnel is
22600
+ * up). The SDK can race them with short timeouts and stick with the
22601
+ * winner for the session.
22390
22602
  *
22391
22603
  * Why hub-only: agents are not directly addressable by the operator's
22392
22604
  * clients — they reverse-connect to the hub. Exposing their interfaces
@@ -22541,6 +22753,17 @@ var NotificationEndpointSchema = object({
22541
22753
  /** What the ranking currently resolves to (null when nothing is reachable). */
22542
22754
  resolved: string().nullable()
22543
22755
  });
22756
+ /**
22757
+ * The URLs the SDK / viewer should race for API access. `baseUrls` empty =
22758
+ * AUTO (every LAN IPv4 + the public tunnel). `resolved` is what that choice
22759
+ * currently expands to, so the UI can show the effective set either way.
22760
+ */
22761
+ var ViewerEndpointsSchema = object({
22762
+ /** The operator's explicit race set, or empty for AUTO. */
22763
+ baseUrls: array(string()).readonly(),
22764
+ /** What the ranking currently resolves to (may be empty if nothing is up). */
22765
+ resolved: array(string()).readonly()
22766
+ });
22544
22767
  var AllowedAddressesSchema = object({
22545
22768
  /**
22546
22769
  * Allowlist of interface addresses operators have explicitly opted
@@ -22549,6 +22772,20 @@ var AllowedAddressesSchema = object({
22549
22772
  * Network Addresses admin page and persisted by the addon.
22550
22773
  */
22551
22774
  addresses: array(string()).readonly() });
22775
+ var TlsStatusSchema = object({
22776
+ mode: _enum([
22777
+ "generated",
22778
+ "uploaded",
22779
+ "disabled"
22780
+ ]),
22781
+ leafFingerprintSha256: string().nullable(),
22782
+ caFingerprintSha256: string().nullable(),
22783
+ validTo: string().nullable(),
22784
+ sans: array(string()),
22785
+ caCertPem: string().nullable(),
22786
+ reissueError: string().nullable(),
22787
+ restartRequired: boolean()
22788
+ });
22552
22789
  method(_void(), ListResultSchema), method(_void(), PreferredSchema), method(object({
22553
22790
  /**
22554
22791
  * LEGACY HINT — do not send from new code. Kept optional so clients
@@ -22558,17 +22795,31 @@ method(_void(), ListResultSchema), method(_void(), PreferredSchema), method(obje
22558
22795
  */
22559
22796
  port: number().int().min(1).max(65535).optional(),
22560
22797
  /** Include `http(s)://127.0.0.1:<port>` as the lowest-priority
22561
- * candidate. Default `true`. */
22798
+ * candidate. Default `false` — loopback is not a client route. */
22562
22799
  includeLoopback: boolean().optional(),
22563
- /** Skip IPv6 entries. Some legacy clients can't parse them.
22564
- * Default `false`. */
22800
+ /** Skip IPv6 entries. Default `false` the palette includes stable
22801
+ * LAN IPv6 (ICE/WebRTC uses dual-stack regardless). Pass `true` to
22802
+ * hide them. The viewer HTTP/WS race is `getViewerEndpoints`. */
22565
22803
  ipv4Only: boolean().optional(),
22566
22804
  /** Scheme to emit for LAN/loopback URLs. Default `'http'`.
22567
22805
  * Pass `'https'` when the caller is itself loaded over HTTPS
22568
22806
  * to avoid mixed-content blocks in the browser. The public
22569
22807
  * tunnel always emits `https://` regardless. */
22570
22808
  scheme: _enum(["http", "https"]).optional()
22571
- }), 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" });
22809
+ }), 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, {
22810
+ kind: "mutation",
22811
+ auth: "admin"
22812
+ }), method(object({
22813
+ certPem: string().min(1),
22814
+ keyPem: string().min(1),
22815
+ caPem: string().optional()
22816
+ }), TlsStatusSchema, {
22817
+ kind: "mutation",
22818
+ auth: "admin"
22819
+ }), method(_void(), object({ pem: string() })), method(_void(), TlsStatusSchema, {
22820
+ kind: "mutation",
22821
+ auth: "admin"
22822
+ });
22572
22823
  object({
22573
22824
  /** Lifecycle state of the lock. `jammed` means the motor reported
22574
22825
  * failure to reach the target — operator intervention required. */
@@ -23749,7 +24000,12 @@ var PlateInfoSchema = object({
23749
24000
  plateBbox: BoundingBoxSchema.optional(),
23750
24001
  /** keyFrame parity: MediaStore key of the track's native-resolution key frame. */
23751
24002
  keyFrameMediaKey: string().optional(),
23752
- base64: string().optional()
24003
+ base64: string().optional(),
24004
+ /**
24005
+ * Same crop as a data-plane URL. `getPlateByTrack` returns this and
24006
+ * never inlines JPEG; `listPlates` still inlines for the admin-ui.
24007
+ */
24008
+ cropUrl: string().optional()
23753
24009
  });
23754
24010
  var MediaFileLiteSchema = object({
23755
24011
  key: string(),
@@ -27389,6 +27645,12 @@ Object.freeze({
27389
27645
  addonId: null,
27390
27646
  access: "view"
27391
27647
  },
27648
+ "deviceManager.getBindingsBatch": {
27649
+ capName: "device-manager",
27650
+ capScope: "system",
27651
+ addonId: null,
27652
+ access: "view"
27653
+ },
27392
27654
  "deviceManager.getChildren": {
27393
27655
  capName: "device-manager",
27394
27656
  capScope: "system",
@@ -27449,6 +27711,12 @@ Object.freeze({
27449
27711
  addonId: null,
27450
27712
  access: "view"
27451
27713
  },
27714
+ "deviceManager.getLinkedDevicesBatch": {
27715
+ capName: "device-manager",
27716
+ capScope: "system",
27717
+ addonId: null,
27718
+ access: "view"
27719
+ },
27452
27720
  "deviceManager.getRoleDisplayDefaults": {
27453
27721
  capName: "device-manager",
27454
27722
  capScope: "system",
@@ -28331,6 +28599,12 @@ Object.freeze({
28331
28599
  addonId: null,
28332
28600
  access: "create"
28333
28601
  },
28602
+ "localNetwork.downloadCa": {
28603
+ capName: "local-network",
28604
+ capScope: "system",
28605
+ addonId: null,
28606
+ access: "view"
28607
+ },
28334
28608
  "localNetwork.getAllowedAddresses": {
28335
28609
  capName: "local-network",
28336
28610
  capScope: "system",
@@ -28355,18 +28629,42 @@ Object.freeze({
28355
28629
  addonId: null,
28356
28630
  access: "view"
28357
28631
  },
28632
+ "localNetwork.getTlsStatus": {
28633
+ capName: "local-network",
28634
+ capScope: "system",
28635
+ addonId: null,
28636
+ access: "view"
28637
+ },
28638
+ "localNetwork.getViewerEndpoints": {
28639
+ capName: "local-network",
28640
+ capScope: "system",
28641
+ addonId: null,
28642
+ access: "view"
28643
+ },
28358
28644
  "localNetwork.list": {
28359
28645
  capName: "local-network",
28360
28646
  capScope: "system",
28361
28647
  addonId: null,
28362
28648
  access: "view"
28363
28649
  },
28650
+ "localNetwork.regenerateCertificate": {
28651
+ capName: "local-network",
28652
+ capScope: "system",
28653
+ addonId: null,
28654
+ access: "create"
28655
+ },
28364
28656
  "localNetwork.resetAllowlistToBestMatch": {
28365
28657
  capName: "local-network",
28366
28658
  capScope: "system",
28367
28659
  addonId: null,
28368
28660
  access: "delete"
28369
28661
  },
28662
+ "localNetwork.revertToGeneratedCertificate": {
28663
+ capName: "local-network",
28664
+ capScope: "system",
28665
+ addonId: null,
28666
+ access: "create"
28667
+ },
28370
28668
  "localNetwork.setAllowedAddresses": {
28371
28669
  capName: "local-network",
28372
28670
  capScope: "system",
@@ -28379,6 +28677,18 @@ Object.freeze({
28379
28677
  addonId: null,
28380
28678
  access: "create"
28381
28679
  },
28680
+ "localNetwork.setViewerEndpoints": {
28681
+ capName: "local-network",
28682
+ capScope: "system",
28683
+ addonId: null,
28684
+ access: "create"
28685
+ },
28686
+ "localNetwork.uploadCertificate": {
28687
+ capName: "local-network",
28688
+ capScope: "system",
28689
+ addonId: null,
28690
+ access: "create"
28691
+ },
28382
28692
  "lockControl.lock": {
28383
28693
  capName: "lock-control",
28384
28694
  capScope: "device",
@@ -29177,6 +29487,12 @@ Object.freeze({
29177
29487
  addonId: null,
29178
29488
  access: "view"
29179
29489
  },
29490
+ "pipelineAnalytics.getGroup": {
29491
+ capName: "pipeline-analytics",
29492
+ capScope: "device",
29493
+ addonId: null,
29494
+ access: "view"
29495
+ },
29180
29496
  "pipelineAnalytics.getKeyEvents": {
29181
29497
  capName: "pipeline-analytics",
29182
29498
  capScope: "device",
@@ -29261,6 +29577,12 @@ Object.freeze({
29261
29577
  addonId: null,
29262
29578
  access: "view"
29263
29579
  },
29580
+ "pipelineAnalytics.listGroups": {
29581
+ capName: "pipeline-analytics",
29582
+ capScope: "device",
29583
+ addonId: null,
29584
+ access: "view"
29585
+ },
29264
29586
  "pipelineAnalytics.listOpsLog": {
29265
29587
  capName: "pipeline-analytics",
29266
29588
  capScope: "device",
@@ -31259,6 +31581,12 @@ Object.freeze({
31259
31581
  addonId: null,
31260
31582
  access: "create"
31261
31583
  },
31584
+ "terminalSession.updateInstance": {
31585
+ capName: "terminal-session",
31586
+ capScope: "system",
31587
+ addonId: null,
31588
+ access: "create"
31589
+ },
31262
31590
  "terminalSession.writeInput": {
31263
31591
  capName: "terminal-session",
31264
31592
  capScope: "system",
@@ -32036,6 +32364,11 @@ Object.freeze({
32036
32364
  form: "single",
32037
32365
  optional: false
32038
32366
  }],
32367
+ "deviceManager.getBindingsBatch": [{
32368
+ name: "deviceIds",
32369
+ form: "array",
32370
+ optional: false
32371
+ }],
32039
32372
  "deviceManager.getChildren": [{
32040
32373
  name: "parentDeviceId",
32041
32374
  form: "single",
@@ -32081,6 +32414,11 @@ Object.freeze({
32081
32414
  form: "single",
32082
32415
  optional: false
32083
32416
  }],
32417
+ "deviceManager.getLinkedDevicesBatch": [{
32418
+ name: "deviceIds",
32419
+ form: "array",
32420
+ optional: false
32421
+ }],
32084
32422
  "deviceManager.getSettingsSchema": [{
32085
32423
  name: "deviceId",
32086
32424
  form: "single",
@@ -32101,6 +32439,11 @@ Object.freeze({
32101
32439
  form: "single",
32102
32440
  optional: false
32103
32441
  }],
32442
+ "deviceManager.listAll": [{
32443
+ name: "deviceIds",
32444
+ form: "array",
32445
+ optional: true
32446
+ }],
32104
32447
  "deviceManager.loadConfig": [{
32105
32448
  name: "deviceId",
32106
32449
  form: "single",
@@ -32674,6 +33017,11 @@ Object.freeze({
32674
33017
  form: "single",
32675
33018
  optional: false
32676
33019
  }],
33020
+ "pipelineAnalytics.getGroup": [{
33021
+ name: "deviceId",
33022
+ form: "single",
33023
+ optional: false
33024
+ }],
32677
33025
  "pipelineAnalytics.getKeyEvents": [{
32678
33026
  name: "deviceId",
32679
33027
  form: "single",
@@ -32729,6 +33077,11 @@ Object.freeze({
32729
33077
  form: "array",
32730
33078
  optional: false
32731
33079
  }],
33080
+ "pipelineAnalytics.listGroups": [{
33081
+ name: "deviceIds",
33082
+ form: "array",
33083
+ optional: false
33084
+ }],
32732
33085
  "pipelineAnalytics.listOpsLog": [{
32733
33086
  name: "deviceId",
32734
33087
  form: "single",
@@ -33746,6 +34099,35 @@ Object.freeze(Object.fromEntries([{
33746
34099
  }]
33747
34100
  }].map((s) => [s.stepId, s.defaultModelId])));
33748
34101
  string().min(1);
34102
+ var CLUSTER_STEP_SETTING_FIELDS = [{
34103
+ stepId: "face-embedding",
34104
+ key: "minLandmarkFaceSize",
34105
+ label: "Min face size for recognition (detection px)",
34106
+ 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.",
34107
+ type: "slider",
34108
+ min: 0,
34109
+ max: 64,
34110
+ step: 2,
34111
+ default: 24
34112
+ }];
34113
+ function clusterStepSettingKey(stepId, fieldKey) {
34114
+ return `clusterStepSetting:${stepId}:${fieldKey}`;
34115
+ }
34116
+ var ClusterSettingNumberSchema = number().finite();
34117
+ function readClusterStepSettings(config) {
34118
+ const out = {};
34119
+ for (const field of CLUSTER_STEP_SETTING_FIELDS) {
34120
+ const parsed = ClusterSettingNumberSchema.safeParse(config[clusterStepSettingKey(field.stepId, field.key)]);
34121
+ const value = parsed.success ? parsed.data : field.default;
34122
+ const existing = out[field.stepId] ?? {};
34123
+ out[field.stepId] = {
34124
+ ...existing,
34125
+ [field.key]: value
34126
+ };
34127
+ }
34128
+ return out;
34129
+ }
34130
+ readClusterStepSettings({});
33749
34131
  object({
33750
34132
  /**
33751
34133
  * Fraction of the box's own size added on EACH side before cutting.
@@ -33916,7 +34298,7 @@ var AgentUIAddon = class extends BaseAddon {
33916
34298
  capability: adminUiCapability,
33917
34299
  provider: {
33918
34300
  getStaticDir: async () => ({ staticDir: path.resolve(__dirname) }),
33919
- getVersion: async () => ({ version: "1.2.27" })
34301
+ getVersion: async () => ({ version: "1.2.29" })
33920
34302
  }
33921
34303
  }];
33922
34304
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@camstack/addon-agent-ui",
3
- "version": "1.2.27",
3
+ "version": "1.2.29",
4
4
  "description": "Agent UI — lightweight status dashboard served by every agent node",
5
5
  "keywords": [
6
6
  "camstack",