@camstack/addon-provider-rtsp 1.2.121 → 1.2.123

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 +2971 -505
  2. package/dist/addon.mjs +2971 -505
  3. package/package.json +1 -1
package/dist/addon.mjs CHANGED
@@ -1,5 +1,5 @@
1
1
  import net from "node:net";
2
- //#region ../types/dist/event-category-BGmz_oxW.mjs
2
+ //#region ../types/dist/event-category-DaIZi00R.mjs
3
3
  var EventCategory = /* @__PURE__ */ function(EventCategory) {
4
4
  EventCategory["SystemBoot"] = "system.boot";
5
5
  EventCategory["SystemAddonsReady"] = "system.addons-ready";
@@ -78,6 +78,13 @@ var EventCategory = /* @__PURE__ */ function(EventCategory) {
78
78
  */
79
79
  EventCategory["AddonLoadFailed"] = "addon.load-failed";
80
80
  /**
81
+ * A keychain value was stored or removed (D787). Carries the ref, its
82
+ * owner and the new version — NEVER the value. A process holding the ref
83
+ * drops its cached copy and the owning `BaseAddon` re-resolves its config.
84
+ * Telemetry (D8): a process that misses it still revalidates by version.
85
+ */
86
+ EventCategory["KeychainChanged"] = "keychain.changed";
87
+ /**
81
88
  * Addon recovered from a previous failure. Emitted when an addon
82
89
  * transitions from `failed` back to `healthy` (typically via the
83
90
  * monitor's auto-retry loop, or after manual `addons.retryLoad`).
@@ -500,15 +507,6 @@ var EventCategory = /* @__PURE__ */ function(EventCategory) {
500
507
  EventCategory["AgentWsDisconnected"] = "agent.ws.disconnected";
501
508
  EventCategory["AgentBackupActivated"] = "agent.backup.activated";
502
509
  EventCategory["OrchestrationSettingsUpdated"] = "orchestration.settings-updated";
503
- /**
504
- * Per-agent hwaccel preference changed (user override set, cleared, or
505
- * re-probed). Observability event — decoders pull the current pref at
506
- * `createSession`, so running sessions keep their current backend until
507
- * they rotate naturally (camera add/remove, stream restart). Future
508
- * work can wire a listener in stream-broker that force-rotates live
509
- * sessions; for now this event powers logs + admin-UI toast feedback.
510
- */
511
- EventCategory["PipelineAgentHwaccelChanged"] = "pipeline.agent-hwaccel-changed";
512
510
  EventCategory["MotionAnalysis"] = "detection.motion-analysis";
513
511
  /** All raw motion zones from CCL before minArea filter — for UI debug overlay. */
514
512
  EventCategory["MotionZonesRaw"] = "detection.motion-zones-raw";
@@ -5379,7 +5377,7 @@ var ZodIssueCode = {
5379
5377
  var ZodFirstPartyTypeKind;
5380
5378
  ZodFirstPartyTypeKind || (ZodFirstPartyTypeKind = {});
5381
5379
  //#endregion
5382
- //#region ../types/dist/sleep-DXKLNFvA.mjs
5380
+ //#region ../types/dist/sleep-Cr5YOk3m.mjs
5383
5381
  /**
5384
5382
  * The audio chunk plane's byte format, and the ONE expansion from a coded
5385
5383
  * window to float samples (D455).
@@ -5458,6 +5456,97 @@ function buildAlawTable() {
5458
5456
  }
5459
5457
  buildUlawTable();
5460
5458
  buildAlawTable();
5459
+ /** Is this field's stored value a credential? */
5460
+ function isSecretConfigField(field) {
5461
+ if (field.type === "password") return true;
5462
+ return "secret" in field && field.secret === true;
5463
+ }
5464
+ /**
5465
+ * Is this field's value stored in the KEYCHAIN (D787)? Every secret field is,
5466
+ * by its TYPE, unless it opts out with `storage: 'inline'` — never by its name.
5467
+ */
5468
+ function isKeychainStoredField(field) {
5469
+ if (!isSecretConfigField(field)) return false;
5470
+ if (field.type === "textarea" && field.isJson === true) return false;
5471
+ return !("storage" in field && field.storage === "inline");
5472
+ }
5473
+ /**
5474
+ * What a settings blob holds where a secret used to be.
5475
+ *
5476
+ * A keychain-stored field never holds its value. It holds a self-describing
5477
+ * MARKER, `{"$secret":"secret://…","v":1}` — an object, never a string, so no
5478
+ * code can mistake it for a credential and no form can send it to a camera as
5479
+ * a password. The empty state is `null` / absent, never `''`.
5480
+ *
5481
+ * The same shapes travel to and from the admin UI:
5482
+ *
5483
+ * - read: `hydrateSchema` hands a secret field a {@link SecretFieldView}
5484
+ * (`{ $secret, v, set: true }`) or `null` — the browser learns whether a
5485
+ * value is set, never the value.
5486
+ * - write: an untouched field submits the view back unchanged (KEEP); a typed
5487
+ * value is a plain non-empty string (CHANGE); the Clear button submits
5488
+ * {@link SECRET_CLEAR} (CLEAR). `''`, `null` and the legacy redaction tokens
5489
+ * are KEEP — an empty string is what a defaults-fallback pushes back, and
5490
+ * treating it as "clear" is how a save destroyed a stored credential before.
5491
+ *
5492
+ * Pure and browser-safe.
5493
+ */
5494
+ var SECRET_CLEAR = { $secretClear: true };
5495
+ /** The `'***'` token D634 redaction writes for non-admins. */
5496
+ var LEGACY_DEVICE_REDACTION = "***";
5497
+ function isRecord$1(value) {
5498
+ return typeof value === "object" && value !== null && !Array.isArray(value);
5499
+ }
5500
+ function makeSecretMarker(ref) {
5501
+ return {
5502
+ $secret: ref,
5503
+ v: 1
5504
+ };
5505
+ }
5506
+ /** A stored marker: an object whose `$secret` is a non-empty string. */
5507
+ function isSecretMarker(value) {
5508
+ if (!isRecord$1(value)) return false;
5509
+ const ref = value["$secret"];
5510
+ return typeof ref === "string" && ref.length > 0;
5511
+ }
5512
+ function isSecretClear(value) {
5513
+ return isRecord$1(value) && value["$secretClear"] === true;
5514
+ }
5515
+ /**
5516
+ * The UI view of a stored secret field value: a marker becomes "set", inline
5517
+ * plaintext becomes "set (inline)", nothing becomes `null`. A value never
5518
+ * survives this function.
5519
+ */
5520
+ function toSecretFieldView(stored) {
5521
+ if (isSecretMarker(stored)) return {
5522
+ $secret: stored.$secret,
5523
+ v: 1,
5524
+ set: true
5525
+ };
5526
+ if (typeof stored === "string" && stored.length > 0) return {
5527
+ $secret: null,
5528
+ v: 1,
5529
+ set: true,
5530
+ inline: true
5531
+ };
5532
+ return null;
5533
+ }
5534
+ /**
5535
+ * Classify an incoming value for a secret path. Only a non-empty string that is
5536
+ * not a redaction token sets a value; only {@link SECRET_CLEAR} clears.
5537
+ * Everything else — a marker (ours or anyone's), a UI view, `''`, `null`,
5538
+ * `undefined`, a redaction token, a non-string — keeps what is stored.
5539
+ */
5540
+ function classifySecretWrite(incoming) {
5541
+ if (isSecretClear(incoming)) return { kind: "clear" };
5542
+ if (typeof incoming !== "string") return { kind: "keep" };
5543
+ if (incoming.length === 0) return { kind: "keep" };
5544
+ if (incoming === "__camstack_redacted__" || incoming === LEGACY_DEVICE_REDACTION) return { kind: "keep" };
5545
+ return {
5546
+ kind: "set",
5547
+ value: incoming
5548
+ };
5549
+ }
5461
5550
  Object.fromEntries([
5462
5551
  {
5463
5552
  id: "overview",
@@ -5629,33 +5718,19 @@ Object.fromEntries([
5629
5718
  function isValuelessField(field) {
5630
5719
  return field.type === "separator" || field.type === "info" || field.type === "qr-code" || field.type === "button" || field.type === "object-array" || field.type === "widget" || field.type === "addon-action-button" || field.type === "device-action-button";
5631
5720
  }
5632
- /**
5633
- * Merge a `ConfigUISchema` with a raw `values` record into a
5634
- * `ConfigUISchemaWithValues`. Used by every `get*Settings` backend endpoint
5635
- * before returning to the admin UI. Groups are walked recursively.
5636
- *
5637
- * For each leaf field:
5638
- * - structural fields (`separator`, `info`, `button`) pass through unchanged
5639
- * - other fields get `value = values[key] ?? field.default ?? null`
5640
- *
5641
- * Unknown keys in `values` (keys not declared in the schema) are silently
5642
- * ignored — they don't contribute to the output. Missing keys fall back to
5643
- * the schema default or `null`. This mirrors the old backend behaviour where
5644
- * `FormBuilder` rendered `values[key] ?? field.default`.
5645
- */
5646
- function hydrateSchema(schema, values) {
5721
+ function hydrateSchema(schema, values, options = {}) {
5647
5722
  return {
5648
5723
  ...schema.tabs ? { tabs: [...schema.tabs] } : {},
5649
5724
  sections: schema.sections.map((section) => ({
5650
5725
  ...section,
5651
- fields: section.fields.map((field) => hydrateField(field, values))
5726
+ fields: section.fields.map((field) => hydrateField(field, values, options))
5652
5727
  }))
5653
5728
  };
5654
5729
  }
5655
- function hydrateField(field, values) {
5730
+ function hydrateField(field, values, options) {
5656
5731
  if (isValuelessField(field)) return field;
5657
5732
  if (field.type === "group") {
5658
- const hydratedChildren = field.fields.map((child) => hydrateField(child, values));
5733
+ const hydratedChildren = field.fields.map((child) => hydrateField(child, values, options));
5659
5734
  return {
5660
5735
  ...field,
5661
5736
  fields: hydratedChildren
@@ -5664,7 +5739,7 @@ function hydrateField(field, values) {
5664
5739
  if (field.type === "sub-tabs") {
5665
5740
  const hydratedTabs = field.tabs.map((tab) => ({
5666
5741
  ...tab,
5667
- fields: tab.fields.map((child) => hydrateField(child, values))
5742
+ fields: tab.fields.map((child) => hydrateField(child, values, options))
5668
5743
  }));
5669
5744
  return {
5670
5745
  ...field,
@@ -5674,6 +5749,33 @@ function hydrateField(field, values) {
5674
5749
  const key = field.key;
5675
5750
  const storedValue = Object.prototype.hasOwnProperty.call(values, key) ? values[key] : void 0;
5676
5751
  const defaultValue = field.default;
5752
+ const asView = (v) => isSecretMarker(v) || options.inlineSecretsAsViews === true && v !== void 0;
5753
+ if (isKeychainStoredField(field) && asView(storedValue)) return {
5754
+ ...field,
5755
+ value: toSecretFieldView(storedValue)
5756
+ };
5757
+ if (isKeychainStoredField(field) && options.inlineSecretsAsViews === true) return {
5758
+ ...field,
5759
+ value: null
5760
+ };
5761
+ if (field.type === "editable-array" && Array.isArray(storedValue)) {
5762
+ const secretItemKeys = field.itemFields.filter((item) => "key" in item && isKeychainStoredField(item)).map((item) => "key" in item ? item.key : "");
5763
+ if (secretItemKeys.length > 0) {
5764
+ const rows = storedValue.map((row) => {
5765
+ if (row === null || typeof row !== "object" || Array.isArray(row)) return row;
5766
+ const out = { ...row };
5767
+ for (const k of secretItemKeys) {
5768
+ const v = Reflect.get(row, k);
5769
+ if (asView(v)) out[k] = toSecretFieldView(v);
5770
+ }
5771
+ return out;
5772
+ });
5773
+ return {
5774
+ ...field,
5775
+ value: rows
5776
+ };
5777
+ }
5778
+ }
5677
5779
  if (field.multiple) {
5678
5780
  const stored = Array.isArray(storedValue) ? storedValue : storedValue !== void 0 && storedValue !== null ? [storedValue] : [];
5679
5781
  const itemFallback = field.multiple.itemDefault !== void 0 ? field.multiple.itemDefault : defaultValue !== void 0 ? defaultValue : typeOf(field) === "string" ? "" : null;
@@ -5916,6 +6018,431 @@ function projectStore(store, perNodeKeys, nodeId) {
5916
6018
  }
5917
6019
  return out;
5918
6020
  }
6021
+ var GLOBAL_SCOPE = { kind: "global" };
6022
+ /** The scope every addon-wide (not per-node, not per-device) setting lives in. */
6023
+ function globalSecretScope() {
6024
+ return GLOBAL_SCOPE;
6025
+ }
6026
+ function encodeSegment(value) {
6027
+ return encodeURIComponent(value);
6028
+ }
6029
+ /**
6030
+ * The field path of a value inside an array item, addressed by the item's id:
6031
+ * `arrayItemFieldPath('providers', 'authentik', 'clientSecret')` →
6032
+ * `providers[authentik].clientSecret`.
6033
+ */
6034
+ function arrayItemFieldPath(arrayKey, itemId, fieldKey) {
6035
+ return `${arrayKey}[${encodeSegment(itemId)}].${fieldKey}`;
6036
+ }
6037
+ /** A write to a secret path could not be stored in the keychain, so it was refused. */
6038
+ var KeychainWriteRefusedError = class extends Error {
6039
+ fieldPath;
6040
+ constructor(fieldPath, cause) {
6041
+ super(`secret "${fieldPath}" was not saved: the keychain could not store it (${cause instanceof Error ? cause.message : String(cause)}). Nothing was written.`);
6042
+ this.fieldPath = fieldPath;
6043
+ this.name = "KeychainWriteRefusedError";
6044
+ }
6045
+ };
6046
+ var KEEP = { kind: "keep" };
6047
+ function isRecord(value) {
6048
+ return typeof value === "object" && value !== null && !Array.isArray(value);
6049
+ }
6050
+ function defaultMintId() {
6051
+ return globalThis.crypto.randomUUID();
6052
+ }
6053
+ /** Every marker ref anywhere under `value`. */
6054
+ function collectSecretMarkerRefs(value, out = []) {
6055
+ if (isSecretMarker(value)) {
6056
+ out.push(value.$secret);
6057
+ return out;
6058
+ }
6059
+ if (Array.isArray(value)) for (const item of value) collectSecretMarkerRefs(item, out);
6060
+ else if (isRecord(value)) for (const child of Object.values(value)) collectSecretMarkerRefs(child, out);
6061
+ return out;
6062
+ }
6063
+ async function storedValueEquals(secrets, marker, candidate) {
6064
+ const resolved = (await secrets.resolve([marker.$secret]))[marker.$secret];
6065
+ return resolved?.kind === "value" && resolved.value === candidate;
6066
+ }
6067
+ async function writeLeaf(ctx, incoming, stored, fieldPath) {
6068
+ const intent = classifySecretWrite(incoming);
6069
+ const ref = ctx.secrets.ref(ctx.scope, fieldPath);
6070
+ const storedIsOurs = isSecretMarker(stored) && stored.$secret === ref;
6071
+ if (intent.kind === "keep") return KEEP;
6072
+ if (intent.kind === "set" && !ctx.operatorWrite && typeof stored === "string" && stored === intent.value) return KEEP;
6073
+ if (intent.kind === "clear") {
6074
+ if (storedIsOurs) ctx.deletes.push(ref);
6075
+ return {
6076
+ kind: "value",
6077
+ value: null
6078
+ };
6079
+ }
6080
+ if (storedIsOurs && await storedValueEquals(ctx.secrets, stored, intent.value)) return {
6081
+ kind: "value",
6082
+ value: stored
6083
+ };
6084
+ try {
6085
+ await ctx.secrets.put(ref, intent.value);
6086
+ } catch (err) {
6087
+ throw new KeychainWriteRefusedError(fieldPath, err);
6088
+ }
6089
+ return {
6090
+ kind: "value",
6091
+ value: makeSecretMarker(ref)
6092
+ };
6093
+ }
6094
+ /** Apply a member result onto `out`: KEEP restores the stored member, or removes it. */
6095
+ function applyMember(out, key, result, storedParent) {
6096
+ if (result.kind === "value") {
6097
+ out[key] = result.value;
6098
+ return;
6099
+ }
6100
+ if (Object.prototype.hasOwnProperty.call(storedParent, key)) out[key] = storedParent[key];
6101
+ else delete out[key];
6102
+ }
6103
+ async function writeMembers(ctx, children, incoming, stored, pathOf) {
6104
+ const out = { ...incoming };
6105
+ for (const [member, node] of children) applyMember(out, member, await writeNode(ctx, node, incoming[member], stored[member], pathOf(member)), stored);
6106
+ return out;
6107
+ }
6108
+ function rowId(row, idKey) {
6109
+ const raw = row[idKey];
6110
+ if (typeof raw === "string" && raw.length > 0) return raw;
6111
+ if (typeof raw === "number" && Number.isFinite(raw)) return String(raw);
6112
+ return null;
6113
+ }
6114
+ async function writeArray(ctx, node, incoming, stored, fieldPath) {
6115
+ const storedRows = Array.isArray(stored) ? stored.filter(isRecord) : [];
6116
+ if (!Array.isArray(incoming)) {
6117
+ ctx.deletes.push(...collectSecretMarkerRefs(storedRows));
6118
+ return {
6119
+ kind: "value",
6120
+ value: incoming
6121
+ };
6122
+ }
6123
+ const storedById = /* @__PURE__ */ new Map();
6124
+ for (const row of storedRows) {
6125
+ const id = rowId(row, node.idKey);
6126
+ if (id !== null) storedById.set(id, row);
6127
+ }
6128
+ const kept = /* @__PURE__ */ new Set();
6129
+ const rows = [];
6130
+ for (const row of incoming) {
6131
+ if (!isRecord(row)) {
6132
+ rows.push(row);
6133
+ continue;
6134
+ }
6135
+ const id = rowId(row, node.idKey) ?? ctx.mintId();
6136
+ kept.add(id);
6137
+ const withId = {
6138
+ ...row,
6139
+ [node.idKey]: row[node.idKey] ?? id
6140
+ };
6141
+ if (rowId(withId, node.idKey) === null) withId[node.idKey] = id;
6142
+ const storedRow = storedById.get(id) ?? {};
6143
+ rows.push(await writeMembers(ctx, node.item, withId, storedRow, (member) => arrayItemFieldPath(fieldPath, id, member)));
6144
+ }
6145
+ for (const [id, row] of storedById) if (!kept.has(id)) ctx.deletes.push(...collectSecretMarkerRefs(row));
6146
+ return {
6147
+ kind: "value",
6148
+ value: rows
6149
+ };
6150
+ }
6151
+ async function writeNode(ctx, node, incoming, stored, fieldPath) {
6152
+ switch (node.kind) {
6153
+ case "leaf": return writeLeaf(ctx, incoming, stored, fieldPath);
6154
+ case "array": return writeArray(ctx, node, incoming, stored, fieldPath);
6155
+ case "object": {
6156
+ if (!isRecord(incoming)) {
6157
+ if (incoming === void 0) return KEEP;
6158
+ ctx.deletes.push(...collectSecretMarkerRefs(stored));
6159
+ return {
6160
+ kind: "value",
6161
+ value: incoming
6162
+ };
6163
+ }
6164
+ const storedObj = isRecord(stored) ? stored : {};
6165
+ return {
6166
+ kind: "value",
6167
+ value: await writeMembers(ctx, node.children, incoming, storedObj, (m) => `${fieldPath}.${m}`)
6168
+ };
6169
+ }
6170
+ }
6171
+ }
6172
+ /** Split a perNode-scoped key (`key@nodeId`). */
6173
+ function splitNodeKey(key) {
6174
+ const at = key.indexOf("@");
6175
+ return at <= 0 ? {
6176
+ base: key,
6177
+ nodeId: null
6178
+ } : {
6179
+ base: key.slice(0, at),
6180
+ nodeId: key.slice(at + 1)
6181
+ };
6182
+ }
6183
+ /** Rewrite a settings patch so no secret value reaches the blob. See the file doc. */
6184
+ async function transformSecretWrite(input) {
6185
+ const deletes = [];
6186
+ const base = {
6187
+ secrets: input.secrets,
6188
+ mintId: input.mintId ?? defaultMintId,
6189
+ deletes,
6190
+ operatorWrite: input.operatorWrite === true
6191
+ };
6192
+ const out = {};
6193
+ for (const [key, incoming] of Object.entries(input.patch)) {
6194
+ const { base: baseKey, nodeId } = splitNodeKey(key);
6195
+ const node = input.tree.get(baseKey);
6196
+ if (node === void 0) {
6197
+ out[key] = incoming;
6198
+ continue;
6199
+ }
6200
+ const scope = nodeId !== null && nodeId.length > 0 ? {
6201
+ kind: "node",
6202
+ nodeId
6203
+ } : input.scope ?? globalSecretScope();
6204
+ const result = await writeNode({
6205
+ ...base,
6206
+ scope
6207
+ }, node, incoming, input.stored[key], baseKey);
6208
+ if (result.kind === "value") out[key] = result.value;
6209
+ }
6210
+ return {
6211
+ patch: out,
6212
+ afterWrite: async () => {
6213
+ if (deletes.length === 0) return { orphaned: [] };
6214
+ try {
6215
+ await input.secrets.delete([...new Set(deletes)]);
6216
+ return { orphaned: [] };
6217
+ } catch {
6218
+ return { orphaned: [...new Set(deletes)] };
6219
+ }
6220
+ }
6221
+ };
6222
+ }
6223
+ /**
6224
+ * Replace every marker in `value` with its keychain value. Returns the SAME
6225
+ * reference when there is no marker (no allocation, no keychain call).
6226
+ */
6227
+ async function resolveSecretMarkers(value, secrets) {
6228
+ const refs = collectSecretMarkerRefs(value);
6229
+ if (refs.length === 0) return {
6230
+ value,
6231
+ unresolved: []
6232
+ };
6233
+ const answers = await secrets.resolve(refs);
6234
+ const unresolved = [];
6235
+ for (const ref of new Set(refs)) {
6236
+ const answer = answers[ref];
6237
+ if (answer === void 0) unresolved.push({
6238
+ ref,
6239
+ reason: "not-initialized"
6240
+ });
6241
+ else if (answer.kind === "unavailable") unresolved.push({
6242
+ ref,
6243
+ reason: answer.reason
6244
+ });
6245
+ else if (answer.kind === "missing" || answer.kind === "forbidden") unresolved.push({
6246
+ ref,
6247
+ reason: answer.kind
6248
+ });
6249
+ }
6250
+ const substitute = (v) => {
6251
+ if (isSecretMarker(v)) {
6252
+ const answer = answers[v.$secret];
6253
+ return answer?.kind === "value" ? {
6254
+ keep: true,
6255
+ value: answer.value
6256
+ } : {
6257
+ keep: false,
6258
+ value: void 0
6259
+ };
6260
+ }
6261
+ if (Array.isArray(v)) {
6262
+ const items = [];
6263
+ for (const item of v) {
6264
+ const s = substitute(item);
6265
+ if (s.keep) items.push(s.value);
6266
+ }
6267
+ return {
6268
+ keep: true,
6269
+ value: items
6270
+ };
6271
+ }
6272
+ if (isRecord(v)) {
6273
+ const out = {};
6274
+ for (const [k, child] of Object.entries(v)) {
6275
+ const s = substitute(child);
6276
+ if (s.keep) out[k] = s.value;
6277
+ }
6278
+ return {
6279
+ keep: true,
6280
+ value: out
6281
+ };
6282
+ }
6283
+ return {
6284
+ keep: true,
6285
+ value: v
6286
+ };
6287
+ };
6288
+ return {
6289
+ value: substitute(value).value,
6290
+ unresolved
6291
+ };
6292
+ }
6293
+ function touchesTree(tree, patch) {
6294
+ if (tree.size === 0) return false;
6295
+ for (const key of Object.keys(patch)) {
6296
+ const at = key.indexOf("@");
6297
+ if (tree.has(at > 0 ? key.slice(0, at) : key)) return true;
6298
+ }
6299
+ return false;
6300
+ }
6301
+ /** The blob as stored now; a failed read REFUSES the write instead of guessing. */
6302
+ async function readStoredAddonBlob(raw) {
6303
+ const threeWay = raw.readAddonStoreResult;
6304
+ if (threeWay === void 0) return raw.readAddonStore();
6305
+ const result = await threeWay.call(raw);
6306
+ if (result.kind === "failed") throw new Error(`settings write refused: the stored blob could not be read (${result.error})`);
6307
+ return result.kind === "missing" ? {} : result.value;
6308
+ }
6309
+ function createSecretAwareSettings(raw, opts) {
6310
+ const chains = /* @__PURE__ */ new Map();
6311
+ const serialize = (key, fn) => {
6312
+ const next = (chains.get(key) ?? Promise.resolve()).then(fn, fn);
6313
+ const tail = next.catch(() => void 0);
6314
+ chains.set(key, tail);
6315
+ tail.then(() => {
6316
+ if (chains.get(key) === tail) chains.delete(key);
6317
+ });
6318
+ return next;
6319
+ };
6320
+ const write = async (chainKey, tree, scope, patch, readStored, rawWrite) => {
6321
+ if (!touchesTree(tree, patch)) return rawWrite(patch);
6322
+ return serialize(chainKey, async () => {
6323
+ const stored = await readStored();
6324
+ const result = await transformSecretWrite({
6325
+ tree,
6326
+ secrets: opts.secrets,
6327
+ patch,
6328
+ stored,
6329
+ ...scope !== void 0 ? { scope } : {},
6330
+ operatorWrite: opts.isOperatorWrite?.() === true
6331
+ });
6332
+ if (Object.keys(result.patch).length > 0) await rawWrite(result.patch);
6333
+ const { orphaned } = await result.afterWrite();
6334
+ if (orphaned.length > 0) opts.onOrphaned(orphaned);
6335
+ });
6336
+ };
6337
+ const wrapped = {
6338
+ writeAddonStore: (patch) => write("addon", opts.addonTree(), void 0, patch, () => readStoredAddonBlob(raw), (p) => raw.writeAddonStore(p)),
6339
+ writeDeviceStore: (deviceId, patch) => write(`device:${deviceId}`, opts.deviceTree(), {
6340
+ kind: "device",
6341
+ deviceId
6342
+ }, patch, () => raw.readDeviceStore(deviceId), (p) => raw.writeDeviceStore(deviceId, p))
6343
+ };
6344
+ return new Proxy(raw, { get(target, prop, receiver) {
6345
+ if (prop === "writeAddonStore") return wrapped.writeAddonStore;
6346
+ if (prop === "writeDeviceStore") return wrapped.writeDeviceStore;
6347
+ const value = Reflect.get(target, prop, receiver);
6348
+ return typeof value === "function" ? value.bind(target) : value;
6349
+ } });
6350
+ }
6351
+ /** The context the addon sees: identical, except that its settings writes are secret-aware. */
6352
+ function withSecretAwareSettings(context, opts) {
6353
+ const raw = context.settings;
6354
+ if (raw === void 0) return context;
6355
+ const settings = createSecretAwareSettings(raw, opts);
6356
+ return new Proxy(context, { get(target, prop, receiver) {
6357
+ if (prop === "settings") return settings;
6358
+ return Reflect.get(target, prop, receiver);
6359
+ } });
6360
+ }
6361
+ var LEAF = { kind: "leaf" };
6362
+ var DEFAULT_ITEM_ID_KEY = "id";
6363
+ function collectFields(fields, out) {
6364
+ for (const field of fields) {
6365
+ if (field.type === "group") {
6366
+ collectFields(field.fields, out);
6367
+ continue;
6368
+ }
6369
+ if (field.type === "sub-tabs") {
6370
+ for (const tab of field.tabs) collectFields(tab.fields, out);
6371
+ continue;
6372
+ }
6373
+ if (field.type === "editable-array") {
6374
+ const item = /* @__PURE__ */ new Map();
6375
+ for (const itemField of field.itemFields) if ("key" in itemField && isKeychainStoredField(itemField)) item.set(itemField.key, LEAF);
6376
+ if (item.size > 0) out.set(field.key, {
6377
+ kind: "array",
6378
+ idKey: field.itemIdKey ?? DEFAULT_ITEM_ID_KEY,
6379
+ item
6380
+ });
6381
+ continue;
6382
+ }
6383
+ if (!("key" in field) || typeof field.key !== "string") continue;
6384
+ if (isKeychainStoredField(field)) out.set(field.key, LEAF);
6385
+ }
6386
+ }
6387
+ /** The secret tree a settings schema declares. */
6388
+ function secretTreeFromSchema(schema) {
6389
+ const out = /* @__PURE__ */ new Map();
6390
+ if (schema === null) return out;
6391
+ for (const section of schema.sections) collectFields(section.fields, out);
6392
+ return out;
6393
+ }
6394
+ /** Parse `a.b[id].c` into segments; throws on a malformed path (a declaration bug). */
6395
+ function parseSecretStatePath(path) {
6396
+ const segments = [];
6397
+ for (const raw of path.split(".")) {
6398
+ const m = /^([^[\]]+)(?:\[([^[\]]+)\])?$/.exec(raw);
6399
+ if (m === null || m[1] === void 0) throw new Error(`secretStatePaths: malformed path "${path}"`);
6400
+ segments.push(m[2] !== void 0 ? {
6401
+ key: m[1],
6402
+ idKey: m[2]
6403
+ } : { key: m[1] });
6404
+ }
6405
+ if (segments.length === 0) throw new Error(`secretStatePaths: empty path`);
6406
+ if (segments[segments.length - 1]?.idKey !== void 0) throw new Error(`secretStatePaths: "${path}" ends on an array — name the member that is secret`);
6407
+ return segments;
6408
+ }
6409
+ function insert(into, segments) {
6410
+ const [head, ...rest] = segments;
6411
+ if (head === void 0) return;
6412
+ if (rest.length === 0) {
6413
+ into.set(head.key, LEAF);
6414
+ return;
6415
+ }
6416
+ const existing = into.get(head.key);
6417
+ if (head.idKey !== void 0) {
6418
+ const item = new Map(existing?.kind === "array" ? existing.item : []);
6419
+ insert(item, rest);
6420
+ into.set(head.key, {
6421
+ kind: "array",
6422
+ idKey: head.idKey,
6423
+ item
6424
+ });
6425
+ return;
6426
+ }
6427
+ const children = new Map(existing?.kind === "object" ? existing.children : []);
6428
+ insert(children, rest);
6429
+ into.set(head.key, {
6430
+ kind: "object",
6431
+ children
6432
+ });
6433
+ }
6434
+ /** Add hidden-state paths (`secretStatePaths`) to a schema-derived tree. */
6435
+ function mergeSecretStatePaths(tree, paths) {
6436
+ if (paths.length === 0) return tree;
6437
+ const out = new Map(tree);
6438
+ for (const path of paths) insert(out, parseSecretStatePath(path));
6439
+ return out;
6440
+ }
6441
+ /** First retry of a secret the keychain could not serve; doubles to {@link SECRET_RETRY_MAX_MS}. */
6442
+ var SECRET_RETRY_FIRST_MS = 5e3;
6443
+ var SECRET_RETRY_MAX_MS = 5 * 6e4;
6444
+ /** Coalesces a burst of `keychain.changed` events into one re-resolve. */
6445
+ var SECRET_CHANGE_DEBOUNCE_MS = 250;
5919
6446
  /**
5920
6447
  * Base class for CamStack addons. Eliminates settings boilerplate:
5921
6448
  *
@@ -5985,6 +6512,25 @@ var BaseAddon = class {
5985
6512
  settingsStoreReady = false;
5986
6513
  /** Default config values. Provided via constructor. */
5987
6514
  defaults;
6515
+ /**
6516
+ * Hidden-state paths that hold secrets (D787) — values the addon writes
6517
+ * itself (`updateGlobalSettings`, `state()`) that no form field declares.
6518
+ * Stored in the keychain exactly like a `password` field. Syntax:
6519
+ * `'snapshotSigningKey'`, `'identity.pincode'`, `'tokens[userId].accessToken'`
6520
+ * (`key[<id field>]` addresses array items by id, never by index).
6521
+ */
6522
+ secretStatePaths = [];
6523
+ _addonSecretTree = null;
6524
+ _deviceSecretTree = null;
6525
+ /** Refs the last resolved config pointed at — a change to one re-resolves. */
6526
+ _configSecretRefs = /* @__PURE__ */ new Set();
6527
+ _unresolvedSecrets = [];
6528
+ _secretRetryTimer = null;
6529
+ _secretRetryDelayMs = SECRET_RETRY_FIRST_MS;
6530
+ _secretChangeTimer = null;
6531
+ _secretChangeUnsub = null;
6532
+ /** >0 while an OPERATOR's settings write is being applied. */
6533
+ _operatorWriteDepth = 0;
5988
6534
  constructor(defaults) {
5989
6535
  this.defaults = defaults;
5990
6536
  this._config = { ...defaults };
@@ -6020,8 +6566,18 @@ var BaseAddon = class {
6020
6566
  return this._config;
6021
6567
  }
6022
6568
  async initialize(context) {
6023
- this._ctx = context;
6569
+ const secrets = context.secrets;
6570
+ this._ctx = secrets !== void 0 ? withSecretAwareSettings(context, {
6571
+ secrets,
6572
+ addonTree: () => this.addonSecretTree(),
6573
+ deviceTree: () => this.deviceSecretTree(),
6574
+ onOrphaned: (refs) => context.logger.warn("keychain refs dropped by a settings write could not be deleted", { meta: { refs: [...refs] } }),
6575
+ isOperatorWrite: () => this._operatorWriteDepth > 0
6576
+ }) : context;
6024
6577
  await this.resolveConfig();
6578
+ if (secrets !== void 0) this._secretChangeUnsub = secrets.onChange((ref) => {
6579
+ if (this._configSecretRefs.has(ref)) this.scheduleSecretReresolve(SECRET_CHANGE_DEBOUNCE_MS);
6580
+ });
6025
6581
  const result = await this.onInitialize();
6026
6582
  this.emitLifecycle(EventCategory.AddonStarted);
6027
6583
  const normalized = normalizeAddonInitResult(result);
@@ -6054,6 +6610,12 @@ var BaseAddon = class {
6054
6610
  */
6055
6611
  async onHubReachable() {}
6056
6612
  async shutdown() {
6613
+ this._secretChangeUnsub?.();
6614
+ this._secretChangeUnsub = null;
6615
+ if (this._secretRetryTimer !== null) clearTimeout(this._secretRetryTimer);
6616
+ if (this._secretChangeTimer !== null) clearTimeout(this._secretChangeTimer);
6617
+ this._secretRetryTimer = null;
6618
+ this._secretChangeTimer = null;
6057
6619
  this.emitLifecycle(EventCategory.AddonStopped);
6058
6620
  if (this.autoEmitReadiness) this.emitReadinessForProviders("down");
6059
6621
  await this.onShutdown();
@@ -6132,7 +6694,7 @@ var BaseAddon = class {
6132
6694
  return hydrateSchema(schema, overlay ? {
6133
6695
  ...projected,
6134
6696
  ...overlay
6135
- } : projected);
6697
+ } : projected, { inlineSecretsAsViews: true });
6136
6698
  }
6137
6699
  /**
6138
6700
  * The integration-level view of this addon's settings: exactly the sections
@@ -6181,7 +6743,7 @@ var BaseAddon = class {
6181
6743
  return hydrateSchema({
6182
6744
  ...schema,
6183
6745
  sections
6184
- }, projected);
6746
+ }, projected, { inlineSecretsAsViews: true });
6185
6747
  }
6186
6748
  /**
6187
6749
  * The raw addon store PROJECTED onto the target node's bare per-node keys:
@@ -6235,18 +6797,50 @@ var BaseAddon = class {
6235
6797
  value: result.value[key]
6236
6798
  };
6237
6799
  }
6800
+ /**
6801
+ * The OPERATOR's write — a settings form or an admin API call, dispatched by
6802
+ * the kernel. Identical to {@link updateGlobalSettings}, except that a secret
6803
+ * the operator sends is stored as sent even when it equals a pre-keychain
6804
+ * inline value: the operator re-entering a password is a change, an addon
6805
+ * writing back what it read is not (D787).
6806
+ */
6807
+ async updateGlobalSettingsAsOperator(patch, nodeId) {
6808
+ this._operatorWriteDepth++;
6809
+ try {
6810
+ await this.applyGlobalPatch(patch, nodeId);
6811
+ } finally {
6812
+ this._operatorWriteDepth--;
6813
+ }
6814
+ }
6238
6815
  async updateGlobalSettings(patch, nodeId) {
6816
+ await this.applyGlobalPatch(patch, nodeId);
6817
+ }
6818
+ /**
6819
+ * REMOVE stored secrets — their keychain values and their markers (D787).
6820
+ *
6821
+ * Writing `''` to a secret field KEEPS what is stored (an empty string is
6822
+ * what a defaults fallback writes back, and it must never destroy a
6823
+ * credential), so code that means "forget this token" says so here. Without
6824
+ * a keychain (an older kernel) it writes `''`, as such code always did.
6825
+ */
6826
+ async clearSecrets(keys, nodeId) {
6827
+ const tree = this.addonSecretTree();
6828
+ const keychain = this._ctx?.secrets !== void 0;
6829
+ const patch = {};
6830
+ for (const key of keys) patch[key] = keychain && tree.has(key) ? SECRET_CLEAR : "";
6831
+ await this.applyGlobalPatch(patch, nodeId);
6832
+ }
6833
+ async applyGlobalPatch(barePatch, nodeId) {
6239
6834
  const keys = this.perNodeKeys();
6240
6835
  const localNode = normalizeNodeId(this._ctx?.kernel?.localNodeId);
6241
6836
  const target = normalizeNodeId(nodeId ?? this._ctx?.kernel?.localNodeId);
6242
- const barePatch = patch;
6243
6837
  const scoped = keys.size > 0 ? scopePatch(barePatch, keys, target) : barePatch;
6244
6838
  await this._ctx?.settings?.writeAddonStore(scoped);
6245
6839
  if (target !== localNode) return;
6246
6840
  await this.resolveConfig();
6247
6841
  await this.onConfigChanged();
6248
6842
  this.emitLifecycle(EventCategory.AddonUpdated, { level: "global" });
6249
- this.maybeAutoRestart(patch, this.globalSettingsSchema());
6843
+ this.maybeAutoRestart(Object.keys(barePatch), this.globalSettingsSchema());
6250
6844
  }
6251
6845
  /**
6252
6846
  * The set of field keys the global settings schema declares `perNode: true`
@@ -6271,7 +6865,7 @@ var BaseAddon = class {
6271
6865
  * time to return its response before the addon is torn down and
6272
6866
  * re-initialised by `AddonRegistryService.restartAddon`.
6273
6867
  */
6274
- maybeAutoRestart(patch, schema) {
6868
+ maybeAutoRestart(patchKeys, schema) {
6275
6869
  if (!schema) return;
6276
6870
  const restartKeys = /* @__PURE__ */ new Set();
6277
6871
  for (const section of schema.sections) for (const field of section.fields) {
@@ -6279,13 +6873,13 @@ var BaseAddon = class {
6279
6873
  if (field.requiresRestart) restartKeys.add(field.key);
6280
6874
  }
6281
6875
  if (restartKeys.size === 0) return;
6282
- if (!Object.keys(patch).some((k) => restartKeys.has(k))) return;
6876
+ if (!patchKeys.some((k) => restartKeys.has(k))) return;
6283
6877
  const ctx = this._ctx;
6284
6878
  if (!ctx) return;
6285
6879
  const addonId = ctx.id;
6286
6880
  setImmediate(() => {
6287
6881
  ctx.api.addons?.restartAddon?.mutate({ addonId }).then(() => {
6288
- ctx.logger.info("addon auto-restart triggered by restart-required setting change", { meta: { changedFields: Object.keys(patch).filter((k) => restartKeys.has(k)) } });
6882
+ ctx.logger.info("addon auto-restart triggered by restart-required setting change", { meta: { changedFields: patchKeys.filter((k) => restartKeys.has(k)) } });
6289
6883
  }).catch((err) => {
6290
6884
  ctx.logger.error("addon auto-restart failed", { meta: { error: err instanceof Error ? err.message : String(err) } });
6291
6885
  });
@@ -6294,7 +6888,7 @@ var BaseAddon = class {
6294
6888
  async getDeviceSettings(deviceId) {
6295
6889
  const schema = this.deviceSettingsSchema();
6296
6890
  if (!schema) return { sections: [] };
6297
- return hydrateSchema(schema, await this._ctx?.settings?.readDeviceStore(deviceId) ?? {});
6891
+ return hydrateSchema(schema, await this._ctx?.settings?.readDeviceStore(deviceId) ?? {}, { inlineSecretsAsViews: true });
6298
6892
  }
6299
6893
  async updateDeviceSettings(deviceId, patch) {
6300
6894
  await this._ctx?.settings?.writeDeviceStore(deviceId, patch);
@@ -6424,7 +7018,7 @@ var BaseAddon = class {
6424
7018
  * selection at boot (absent scoped key ⇒ the constructor default wins).
6425
7019
  */
6426
7020
  async resolveConfig() {
6427
- const stored = await this.readAddonStoreWithRetry();
7021
+ const stored = await this.resolveStoredSecrets(await this.readAddonStoreWithRetry());
6428
7022
  const perNode = this.perNodeKeys();
6429
7023
  const localNode = normalizeNodeId(this._ctx?.kernel?.localNodeId);
6430
7024
  const resolved = { ...this.defaults };
@@ -6449,7 +7043,7 @@ var BaseAddon = class {
6449
7043
  key,
6450
7044
  schema,
6451
7045
  fallback,
6452
- read: () => this.readAddonStoreWithRetry(),
7046
+ read: async () => this.resolveStoredSecrets(await this.readAddonStoreWithRetry()),
6453
7047
  write: async (patch) => {
6454
7048
  await this._ctx?.settings?.writeAddonStore(patch);
6455
7049
  },
@@ -6466,7 +7060,7 @@ var BaseAddon = class {
6466
7060
  key,
6467
7061
  schema,
6468
7062
  fallback,
6469
- read: async () => await this._ctx?.settings?.readDeviceStore(deviceId) ?? {},
7063
+ read: async () => this.resolveStoredSecrets(await this._ctx?.settings?.readDeviceStore(deviceId) ?? {}, false),
6470
7064
  write: async (patch) => {
6471
7065
  await this._ctx?.settings?.writeDeviceStore(deviceId, patch);
6472
7066
  },
@@ -6478,6 +7072,70 @@ var BaseAddon = class {
6478
7072
  } })
6479
7073
  });
6480
7074
  }
7075
+ /** The addon store's secret tree: schema fields by TYPE, plus `secretStatePaths`. */
7076
+ addonSecretTree() {
7077
+ this._addonSecretTree ??= mergeSecretStatePaths(secretTreeFromSchema(this.globalSettingsSchema()), this.secretStatePaths);
7078
+ return this._addonSecretTree;
7079
+ }
7080
+ deviceSecretTree() {
7081
+ this._deviceSecretTree ??= secretTreeFromSchema(this.deviceSettingsSchema());
7082
+ return this._deviceSecretTree;
7083
+ }
7084
+ /**
7085
+ * Secrets of this addon's stored config that could not be resolved on the
7086
+ * last read, with why. Non-empty means the addon is running WITHOUT them —
7087
+ * an addon whose function needs one should report itself degraded rather
7088
+ * than start on an empty credential.
7089
+ */
7090
+ get unresolvedSecrets() {
7091
+ return this._unresolvedSecrets;
7092
+ }
7093
+ /**
7094
+ * Substitute every keychain marker in a stored blob with its value. With no
7095
+ * keychain (no `ctx.secrets`) or no marker, the blob comes back unchanged.
7096
+ * An unresolvable value is LEFT OUT (never `''`), logged by ref — never by
7097
+ * value — and, when the cause can pass, retried with backoff. Nothing is
7098
+ * ever written back from here.
7099
+ */
7100
+ async resolveStoredSecrets(blob, trackForConfig = true) {
7101
+ const secrets = this._ctx?.secrets;
7102
+ if (secrets === void 0) return blob;
7103
+ const refs = collectSecretMarkerRefs(blob);
7104
+ if (trackForConfig) this._configSecretRefs = new Set(refs);
7105
+ if (refs.length === 0) {
7106
+ if (trackForConfig) this._unresolvedSecrets = [];
7107
+ return blob;
7108
+ }
7109
+ const { value, unresolved } = await resolveSecretMarkers(blob, secrets);
7110
+ if (trackForConfig) {
7111
+ this._unresolvedSecrets = unresolved;
7112
+ if (unresolved.length > 0) {
7113
+ this._ctx?.logger?.error?.("secret unavailable — running without it, will retry", { meta: { secrets: unresolved.map((u) => ({
7114
+ ref: u.ref,
7115
+ reason: u.reason
7116
+ })) } });
7117
+ if (unresolved.some((u) => u.reason !== "missing" && u.reason !== "forbidden")) {
7118
+ this.scheduleSecretReresolve(this._secretRetryDelayMs);
7119
+ this._secretRetryDelayMs = Math.min(this._secretRetryDelayMs * 2, SECRET_RETRY_MAX_MS);
7120
+ }
7121
+ } else this._secretRetryDelayMs = SECRET_RETRY_FIRST_MS;
7122
+ }
7123
+ return value;
7124
+ }
7125
+ /** Re-resolve the config (a keychain-only change, or a retry) and apply it. */
7126
+ scheduleSecretReresolve(delayMs) {
7127
+ const timerOf = delayMs === SECRET_CHANGE_DEBOUNCE_MS ? "_secretChangeTimer" : "_secretRetryTimer";
7128
+ if (this[timerOf] !== null) return;
7129
+ const timer = setTimeout(() => {
7130
+ this[timerOf] = null;
7131
+ if (this._ctx === null) return;
7132
+ this.resolveConfig().then(() => this.onConfigChanged()).catch((err) => {
7133
+ this._ctx?.logger?.error?.("re-resolving secrets failed", { meta: { error: err instanceof Error ? err.message : String(err) } });
7134
+ });
7135
+ }, delayMs);
7136
+ timer.unref?.();
7137
+ this[timerOf] = timer;
7138
+ }
6481
7139
  /**
6482
7140
  * Wrap `ctx.settings.readAddonStore()` with a short retry budget so a
6483
7141
  * transient settings-store outage (mid-restart of sqlite-settings, tsx-watch
@@ -6745,32 +7403,12 @@ object({
6745
7403
  audioCodec: string().optional(),
6746
7404
  metadata: record(string(), unknown()).readonly().optional()
6747
7405
  });
6748
- var EncodedPacketSchema = object({
6749
- type: _enum(["video", "audio"]),
6750
- data: _instanceof(Uint8Array),
6751
- pts: number(),
6752
- dts: number(),
6753
- keyframe: boolean(),
6754
- codec: string()
6755
- });
6756
- var DecodedFrameSchema = object({
6757
- data: _instanceof(Uint8Array),
6758
- width: number(),
6759
- height: number(),
6760
- format: _enum([
6761
- "jpeg",
6762
- "rgb",
6763
- "bgr",
6764
- "yuv420",
6765
- "gray"
6766
- ]),
6767
- timestamp: number()
6768
- });
6769
7406
  /**
6770
7407
  * Wire schema for `FrameHandle` — a zero-pixel, serialisable reference to a
6771
7408
  * frame in a shared-memory ring (Phase 5 / D9). Mirrors the `FrameHandle` TS
6772
- * interface in `interfaces/frame-handle.ts` field-for-field so a decoder cap
6773
- * method (`pullHandles`) can carry handles over tRPC / Moleculer.
7409
+ * interface in `interfaces/frame-handle.ts` field-for-field so a cap method
7410
+ * (the runner's native-crop and pipeline-executor inputs) can carry handles
7411
+ * over tRPC / Moleculer.
6774
7412
  *
6775
7413
  * The `satisfies` assertion below pins this schema to the interface: if a
6776
7414
  * field is added to / removed from `FrameHandle` without a matching schema
@@ -6796,50 +7434,6 @@ var FrameHandleSchema = object({
6796
7434
  slotCount: number().int().positive()
6797
7435
  });
6798
7436
  /**
6799
- * Pixel format a frame-handle subscriber can request from the broker
6800
- * (Phase 5 / D9). The packed, raster subset of `FrameFormat` — the formats a
6801
- * `frameSink: 'shm'` decoder session can write into a `FrameRing` slot.
6802
- * `jpeg` is excluded: a variable-length stream is not a fixed-stride ring
6803
- * payload, and no decoded-frame consumer requests it over the shm plane.
6804
- */
6805
- var FrameHandleFormatSchema = _enum([
6806
- "rgb",
6807
- "bgr",
6808
- "yuv420",
6809
- "gray"
6810
- ]);
6811
- /**
6812
- * Input for `stream-broker.subscribeFrames` (Phase 5 / D9). A consumer asks the
6813
- * broker for a `FrameHandle` stream of one `format`; the broker maintains one
6814
- * shared-memory ring per `(brokerId, format)` actually requested, so a `gray`
6815
- * subscriber (motion) and an `rgb` subscriber (detection) each read the format
6816
- * they asked for with no broker-side conversion.
6817
- */
6818
- var SubscribeFramesInputSchema = object({
6819
- brokerId: string(),
6820
- format: FrameHandleFormatSchema,
6821
- /**
6822
- * Optional reader-side cadence hint in frames per second. The broker does
6823
- * NOT throttle — latest-wins ring reads drop frames implicitly for a slow
6824
- * consumer. The value is echoed back in `SubscribeFramesResult.maxFps` so
6825
- * the consumer can pace its own `pullFrameHandles` polling.
6826
- */
6827
- maxFps: number().positive().optional(),
6828
- /** Short caller-identity tag (`motion`, `detection`, …) for diagnostics. */
6829
- tag: string().optional()
6830
- });
6831
- /**
6832
- * Result of `stream-broker.subscribeFrames`. The consumer then polls
6833
- * `pullFrameHandles({ subscriptionId, maxCount })` and feeds each returned
6834
- * `FrameHandle` to a `FrameRingReader`.
6835
- */
6836
- var SubscribeFramesResultSchema = object({
6837
- /** Opaque id the consumer passes to `pullFrameHandles` / `unsubscribeFrames`. */
6838
- subscriptionId: string(),
6839
- /** Reader-side cadence hint (frames/s) — echoes `SubscribeFramesInput.maxFps`. */
6840
- maxFps: number().nonnegative()
6841
- });
6842
- /**
6843
7437
  * Wire schema for a decoded audio chunk (Phase 5 / D9). Mirrors the
6844
7438
  * `DecodedAudioChunk` TS interface in `interfaces/stream-broker.ts`: PCM
6845
7439
  * sample bytes plus the track parameters a consumer needs to interpret them.
@@ -6847,8 +7441,8 @@ var SubscribeFramesResultSchema = object({
6847
7441
  * Audio chunks are tiny (a ~500ms AudioCodecSession window is a few KB of
6848
7442
  * Float32 PCM), so unlike video frames they ship their bytes INLINE over
6849
7443
  * tRPC / Moleculer — no shared-memory plane. `data` is typed `Uint8Array`
6850
- * (the wire-serialisable supertype of `Buffer`) to match `DecodedFrameSchema`
6851
- * / `EncodedPacketSchema`'s precedent; a `Buffer` is assignable to it.
7444
+ * (the wire-serialisable supertype of `Buffer`); a `Buffer` is assignable to
7445
+ * it.
6852
7446
  */
6853
7447
  var AudioChunkFormatSchema = _enum(AUDIO_CHUNK_FORMATS);
6854
7448
  var DecodedAudioChunkSchema = object({
@@ -6866,11 +7460,10 @@ var DecodedAudioChunkSchema = object({
6866
7460
  format: AudioChunkFormatSchema.optional()
6867
7461
  });
6868
7462
  /**
6869
- * Input for `stream-broker.subscribeAudioChunks` (Phase 5 / D9). The
6870
- * handle-free, ship-bytes-inline analogue of `subscribeFrames`: a consumer
6871
- * asks the broker for the decoded audio-chunk stream of one broker; the
6872
- * broker keeps a per-subscription bounded FIFO queue the consumer drains via
6873
- * `pullAudioChunks`.
7463
+ * Input for `stream-broker.subscribeAudioChunks` (Phase 5 / D9). Audio ships
7464
+ * its bytes inline: a consumer asks the broker for the decoded audio-chunk
7465
+ * stream of one broker; the broker keeps a per-subscription bounded FIFO queue
7466
+ * the consumer drains via `pullAudioChunks`.
6874
7467
  */
6875
7468
  var SubscribeAudioChunksInputSchema = object({
6876
7469
  brokerId: string(),
@@ -6901,9 +7494,7 @@ var BrokerStatsSchema = object({
6901
7494
  "stopped"
6902
7495
  ]),
6903
7496
  inputFps: number(),
6904
- decodeFps: number(),
6905
7497
  encodedSubscribers: number(),
6906
- decodedSubscribers: number(),
6907
7498
  uptimeMs: number(),
6908
7499
  bitrateKbps: number(),
6909
7500
  idrIntervalMs: number(),
@@ -6916,14 +7507,6 @@ var BrokerStatsSchema = object({
6916
7507
  preBufferMs: number(),
6917
7508
  preBufferPackets: number(),
6918
7509
  /**
6919
- * Moleculer node id of the decoder provider currently servicing this
6920
- * stream's decoded subscribers. `null` until the deferred decoder is
6921
- * created (no decoded clients yet, or codec not detected). Surfaces the
6922
- * runtime decoder placement so the UI can show "Decoder: <agent>" without
6923
- * a separate cap call per broker.
6924
- */
6925
- decoderNodeId: string().nullable(),
6926
- /**
6927
7510
  * Detected audio track parameters from the RTSP DESCRIBE / SDP. `null`
6928
7511
  * when the stream has no audio track or the broker is in cold start.
6929
7512
  * `supported = false` means the codec was detected but the local
@@ -7128,6 +7711,69 @@ method(object({ deviceId: number() }), array(StreamSourceEntrySchema)), method(o
7128
7711
  kind: "mutation",
7129
7712
  auth: "admin"
7130
7713
  }), method(object({ deviceId: number() }), unknown().nullable()), method(object({ deviceId: number() }), RawStateResultSchema.nullable(), { auth: "protected" });
7714
+ function defOf(schema) {
7715
+ return schema._zod?.def ?? {};
7716
+ }
7717
+ function declaredHere(schema) {
7718
+ return globalRegistry.get(schema)?.secret === true;
7719
+ }
7720
+ /** Wrapper kinds whose `innerType` is the field itself. */
7721
+ var WRAPPERS = new Set([
7722
+ "optional",
7723
+ "nullable",
7724
+ "default",
7725
+ "prefault",
7726
+ "catch",
7727
+ "readonly",
7728
+ "nonoptional"
7729
+ ]);
7730
+ /**
7731
+ * The schema layers that make up ONE field: the schema itself and every
7732
+ * wrapper below it (optional / default / nullable / readonly / catch), plus
7733
+ * both sides of a pipe (`z.preprocess` puts the real schema on `out`,
7734
+ * `.transform` on `in`).
7735
+ */
7736
+ function layersOf(schema) {
7737
+ const out = [];
7738
+ const queue = [schema];
7739
+ while (queue.length > 0) {
7740
+ const s = queue.shift();
7741
+ if (!s || out.includes(s)) continue;
7742
+ out.push(s);
7743
+ const def = defOf(s);
7744
+ if (def.type !== void 0 && WRAPPERS.has(def.type) && def.innerType) queue.push(def.innerType);
7745
+ if (def.type === "pipe") {
7746
+ if (def.in) queue.push(def.in);
7747
+ if (def.out) queue.push(def.out);
7748
+ }
7749
+ }
7750
+ return out;
7751
+ }
7752
+ /** True when any layer of this field declares `.meta({ secret: true })`. */
7753
+ function isZodSecret(schema) {
7754
+ return layersOf(schema).some(declaredHere);
7755
+ }
7756
+ /**
7757
+ * Every declared secret path in a config schema: dotted keys, `[]` for "each
7758
+ * element of this array" (`connection.password`, `rows[].token`). A declared
7759
+ * object or array is reported as one path and not descended into — everything
7760
+ * under it is secret.
7761
+ */
7762
+ function collectZodSecretPaths(schema, prefix = "") {
7763
+ if (isZodSecret(schema)) return prefix.length > 0 ? [prefix] : [];
7764
+ const paths = [];
7765
+ for (const layer of layersOf(schema)) {
7766
+ const def = defOf(layer);
7767
+ if (def.type === "object" && def.shape) for (const [key, child] of Object.entries(def.shape)) paths.push(...collectZodSecretPaths(child, prefix ? `${prefix}.${key}` : key));
7768
+ else if (def.type === "array" && def.element) paths.push(...collectZodSecretPaths(def.element, `${prefix}[]`));
7769
+ else if (def.type === "union" && def.options) for (const option of def.options) paths.push(...collectZodSecretPaths(option, prefix));
7770
+ else if (def.type === "intersection") {
7771
+ if (def.left) paths.push(...collectZodSecretPaths(def.left, prefix));
7772
+ if (def.right) paths.push(...collectZodSecretPaths(def.right, prefix));
7773
+ }
7774
+ }
7775
+ return [...new Set(paths)];
7776
+ }
7131
7777
  //#endregion
7132
7778
  //#region ../types/dist/err-msg-DX6i_MY4.mjs
7133
7779
  var DeviceType = /* @__PURE__ */ function(DeviceType) {
@@ -10291,70 +10937,6 @@ var StorageLocationDeclarationSchema = object({
10291
10937
  "backup"
10292
10938
  ]).optional()
10293
10939
  });
10294
- var DecoderStatsSchema = object({
10295
- inputFps: number(),
10296
- outputFps: number(),
10297
- avgDecodeTimeMs: number(),
10298
- droppedFrames: number(),
10299
- /**
10300
- * Pull-mode adaptive-fps telemetry (optional — only pull sessions run the
10301
- * lag-driven controller; push sessions omit these). `lagMs` is the EWMA of
10302
- * the decoder's real-time drift (rising = falling behind live); `adaptiveFps`
10303
- * is the current lag-throttled emit rate (≤ `effectiveFps` ceiling).
10304
- */
10305
- lagMs: number().optional(),
10306
- effectiveFps: number().optional(),
10307
- adaptiveFps: number().optional()
10308
- });
10309
- var DecoderSessionConfigSchema = object({
10310
- codec: string(),
10311
- maxFps: number().default(0),
10312
- outputFormat: _enum([
10313
- "jpeg",
10314
- "rgb",
10315
- "bgr",
10316
- "yuv420",
10317
- "gray"
10318
- ]).default("jpeg"),
10319
- scale: number().default(1),
10320
- width: number().optional(),
10321
- height: number().optional(),
10322
- /**
10323
- * Identifier of the camera this decoder session serves. Optional
10324
- * because the cap is generic (any caller could request decode), but
10325
- * stream-broker passes it so decoder logs include `deviceId` for
10326
- * per-camera filtering when diagnosing failures (e.g. node-av
10327
- * sendPacket errors on a single hung camera).
10328
- */
10329
- deviceId: number().int().nonnegative().optional(),
10330
- /**
10331
- * Free-form tag for log scoping. Stream-broker uses
10332
- * `broker:<deviceId>/<profile>`. Decoder session logger surfaces it
10333
- * on every line so `grep tag=broker:5/high` filters one camera
10334
- * profile cleanly.
10335
- */
10336
- tag: string().optional(),
10337
- /**
10338
- * Where the session delivers decoded frames (Phase 5 / D9):
10339
- *
10340
- * - `'callback'` (default) — the legacy pixel path: decoded frames are
10341
- * buffered as `DecodedFrame`s and drained via `pullFrames`.
10342
- * - `'shm'` — the shared-memory frame plane: decoded frames are written
10343
- * into an OS shared-memory ring and drained as zero-pixel
10344
- * `FrameHandle`s via `pullHandles`. A session is one mode or the
10345
- * other — `pullFrames` returns nothing for an `'shm'` session and
10346
- * `pullHandles` returns nothing for a `'callback'` session.
10347
- */
10348
- frameSink: _enum(["callback", "shm"]).default("callback"),
10349
- /**
10350
- * Per-camera decoder DEBUG facility. When `true`, a pull-mode session emits
10351
- * a throttled (~1Hz) structured `decoder debug` line (effective/adaptive fps,
10352
- * real-time lag, dropped-frame delta, avg decode time, hwaccel). Mirrors the
10353
- * stream-broker's `streamingDebug` gate — off by default so production logs
10354
- * stay quiet and the emit path pays zero per-frame cost when disabled.
10355
- */
10356
- debug: boolean().optional()
10357
- });
10358
10940
  /**
10359
10941
  * Per-component log CHANNELS — the gate a hot path consults, and the registry
10360
10942
  * an addon declares its channels in.
@@ -10497,6 +11079,26 @@ var ClipSearchStrictnessSchema = _enum([
10497
11079
  "balanced",
10498
11080
  "strict"
10499
11081
  ]);
11082
+ /** Steps whose effect a root label can BE. */
11083
+ var LABEL_SUPPLY_STEP_IDS = [
11084
+ "animal-classifier",
11085
+ "vehicle-classifier",
11086
+ "package-detection"
11087
+ ];
11088
+ /** Steps whose box a root detection can BE. */
11089
+ var CROP_SUPPLY_STEP_IDS = ["plate-detection", "face-detection"];
11090
+ /**
11091
+ * Steps whose per-detection MASK a root detection can carry (D737). The live
11092
+ * mask step is `segmentation` — a frame-plane refiner that runs its own model
11093
+ * once per detection crop. (`instance-segmentation` is a dormant step id that
11094
+ * no camera tree carries.)
11095
+ */
11096
+ var MASK_SUPPLY_STEP_IDS = ["segmentation"];
11097
+ [
11098
+ ...LABEL_SUPPLY_STEP_IDS,
11099
+ ...CROP_SUPPLY_STEP_IDS,
11100
+ ...MASK_SUPPLY_STEP_IDS
11101
+ ];
10500
11102
  var MODEL_FORMATS = [
10501
11103
  "onnx",
10502
11104
  "coreml",
@@ -10525,7 +11127,53 @@ var ModelFormatEntrySchema = object({
10525
11127
  /** Multi-file payload (directory members or sibling files). */
10526
11128
  files: array(string()).readonly().optional(),
10527
11129
  /** Runtime(s) that can use this format. If omitted, inferred from ModelFormat key */
10528
- runtimes: array(_enum(["python"])).readonly().optional()
11130
+ runtimes: array(_enum(["python"])).readonly().optional(),
11131
+ /**
11132
+ * Content revision of the artefact, for one hosted OFF the CamStack mirror.
11133
+ * A format on the mirror leaves it unset: its revision (the sha256 of its
11134
+ * weight file) comes from the downloader's generated table, kept in step
11135
+ * with the mirror by `scripts/check-hosted-model-revisions.ts` (D744). A
11136
+ * node records the revision it downloaded next to the file
11137
+ * (`<file>.revision`); a copy with no record or a different one is stale
11138
+ * unless its weight file hashes to the revision, and a stale copy is
11139
+ * downloaded again, the old one serving until the new one is complete. No
11140
+ * revision at all ⇒ a file on disk is current, whatever it holds (D743).
11141
+ */
11142
+ revision: string().min(1).optional()
11143
+ });
11144
+ /**
11145
+ * What a node holds for one (model, format) (D746). `current` is a complete
11146
+ * copy at its catalog revision — exactly what `downloaded: true` means.
11147
+ * `stale` is bytes on disk that are not (yet) proven current under D743/D744:
11148
+ * no or a different revision record, or a missing sibling. `missing` is no
11149
+ * copy. `downloaded` alone folds `stale` into "not downloaded", which hid
11150
+ * reclaimable bytes and a copy about to be replaced.
11151
+ */
11152
+ var ModelOnDiskStateSchema = _enum([
11153
+ "current",
11154
+ "stale",
11155
+ "missing"
11156
+ ]);
11157
+ /**
11158
+ * The numeric precision of one format's BUILD (D746) — reported only when the
11159
+ * build states it (file-name token, an INT8 variant, an EdgeTPU compile, a
11160
+ * CamStack Core ML export). Absent means "not stated", never "fp32".
11161
+ */
11162
+ var ModelFormatPrecisionSchema = _enum([
11163
+ "fp32",
11164
+ "fp16",
11165
+ "int8"
11166
+ ]);
11167
+ /**
11168
+ * One format of one model as a node's `pipelineExecutor.getSchema` reports it.
11169
+ * `onDisk` / `precision` are optional for version skew: a runner that predates
11170
+ * them omits them, and a reader falls back to `downloaded`.
11171
+ */
11172
+ var PipelineModelFormatStatusSchema = object({
11173
+ downloaded: boolean(),
11174
+ sizeMB: number(),
11175
+ onDisk: ModelOnDiskStateSchema.optional(),
11176
+ precision: ModelFormatPrecisionSchema.optional()
10529
11177
  });
10530
11178
  /**
10531
11179
  * Extra file that must be downloaded alongside the model (e.g., labels JSON, dict.txt).
@@ -10629,6 +11277,46 @@ var ModelLicenseSchema = preprocess((value) => typeof value === "string" ? { wei
10629
11277
  /** True when the weights or their data forbid commercial use. */
10630
11278
  nonCommercial: boolean().optional()
10631
11279
  }));
11280
+ /**
11281
+ * One step a ROOT detector can supply from its own output (D730) — see
11282
+ * `ModelCatalogEntry.suppliesSteps`.
11283
+ *
11284
+ * - `label`: the root's raw class IS the step's answer. `labelToEffect` maps
11285
+ * the root's label to the step's vocabulary; `uncovered` is the vocabulary
11286
+ * the root cannot produce (shown as unavailable, never a blocker).
11287
+ * - `crop`: the root draws the box the step would have found (`license_plate`
11288
+ * for plate-detection, `face` for face-detection). The box becomes a detail
11289
+ * child of the `parentMacro` detection that contains it — never a track.
11290
+ * - `mask`: the root's decode emits an instance mask with every detection (a
11291
+ * YOLO26-seg root, D737) — the `segmentation` step's result, carried on the
11292
+ * detection in the shape that step produces. Derived from the model's
11293
+ * postprocessor on read, never stored by an import.
11294
+ */
11295
+ var RootStepSupplySchema = discriminatedUnion("kind", [
11296
+ object({
11297
+ kind: literal("label"),
11298
+ stepId: _enum(LABEL_SUPPLY_STEP_IDS),
11299
+ labelToEffect: record(string(), string()),
11300
+ uncovered: array(string()).readonly()
11301
+ }),
11302
+ object({
11303
+ kind: literal("crop"),
11304
+ stepId: _enum(CROP_SUPPLY_STEP_IDS),
11305
+ rootLabels: array(string()).readonly(),
11306
+ parentMacro: _enum(["vehicle", "person"]),
11307
+ childClass: _enum(["plate", "face"]),
11308
+ /**
11309
+ * The root's smaller input side, stamped on read by `rootSuppliesOf` from
11310
+ * the model entry — what a step's `minRootInputPx` gate judges. Never
11311
+ * stored by an import.
11312
+ */
11313
+ rootInputPx: number().int().positive().optional()
11314
+ }),
11315
+ object({
11316
+ kind: literal("mask"),
11317
+ stepId: _enum(MASK_SUPPLY_STEP_IDS)
11318
+ })
11319
+ ]);
10632
11320
  var ModelCatalogEntrySchema = object({
10633
11321
  id: string(),
10634
11322
  name: string(),
@@ -10694,6 +11382,35 @@ var ModelCatalogEntrySchema = object({
10694
11382
  */
10695
11383
  defaultConfidence: number().min(0).max(1).optional(),
10696
11384
  /**
11385
+ * Per-MODEL default of the per-class confidence floors (`minConfidence<Macro>`
11386
+ * on a detector step), keyed by macro class: `{ person: 0.45 }`. A class
11387
+ * absent here runs at the step slider's global default. The same row shape
11388
+ * the floor measurement produces (`model-floors.json`: modelId → floors), so
11389
+ * a measured table is copied in as-is. An operator override is bound to the
11390
+ * model it was made for and does not survive a model change (D738). A custom
11391
+ * / imported model may declare it; without it, the global defaults apply.
11392
+ */
11393
+ defaultClassFloors: record(string(), number().min(0).max(1)).optional(),
11394
+ /**
11395
+ * The inference precision this model's OpenVINO IR needs on an Intel GPU.
11396
+ * Absent ⇒ the device default (f16 on a GPU). Set to `'f32'` for an FP32 IR
11397
+ * that produces invalid output at f16 — measured 2026-10-07 for YOLO26
11398
+ * base IRs (`yolo26s`: 0 true / 146 false positives; `yolo26m*`: NaN
11399
+ * scores) on the Core Ultra iGPU and the N100. Threaded to the pool as
11400
+ * `PoolModelConfig.gpuInferencePrecision`; the pool sets
11401
+ * INFERENCE_PRECISION_HINT on a GPU only. Costs ~60% latency on the GPU.
11402
+ */
11403
+ gpuInferencePrecision: _enum(["f32", "f16"]).optional(),
11404
+ /**
11405
+ * ROOT detectors only: per supplied step (`animal-classifier`, …), the
11406
+ * minimum DETECTION score from which this root's own fine label (species,
11407
+ * vehicle type — D736 root supply) is taken (D741). Below it the detection
11408
+ * keeps its macro class without the fine label. `1` = never take it from
11409
+ * this root. Absent ⇒ no floor beyond the macro floor. The supplied step's
11410
+ * `minConfidence` slider, bound to the ROOT model, overrides it.
11411
+ */
11412
+ suppliedLabelFloors: record(string(), number().min(0).max(1)).optional(),
11413
+ /**
10697
11414
  * When true, the executor produces a landmark-aligned crop (similarity warp
10698
11415
  * onto the canonical template) before this step runs, instead of a plain
10699
11416
  * axis-aligned bbox crop. Required for face-recognition embedders (ArcFace):
@@ -10755,6 +11472,16 @@ var ModelCatalogEntrySchema = object({
10755
11472
  */
10756
11473
  classMap: DetectionCatalogClassMapSchema.optional(),
10757
11474
  /**
11475
+ * The pipeline steps this ROOT detector can supply from its own output
11476
+ * (D730): its labels name a step's effect (`deer` for `animal-classifier`)
11477
+ * or draw a step's box (`license_plate` for `plate-detection`). Computed at
11478
+ * import from THIS model's labelmap by `deriveRootSupplies`, never written
11479
+ * by hand and never assumed per family; a row without it is derived on read
11480
+ * (`rootSuppliesOf`). Whether a camera uses it is the step's own
11481
+ * `useRootModel` flag (`resolveRootSupply`).
11482
+ */
11483
+ suppliesSteps: array(RootStepSupplySchema).readonly().optional(),
11484
+ /**
10758
11485
  * The model's CLIP feature-space contract (text encoder, dimension, vector
10759
11486
  * index, token window, search floor) — see `clip-model.ts`. Present ONLY on a
10760
11487
  * CLIP image encoder; its absence is what "not a CLIP model" means to the
@@ -12356,13 +13083,6 @@ var BrokerRtspClientSchema = object({
12356
13083
  lastRtpAt: number(),
12357
13084
  bytesSent: number()
12358
13085
  });
12359
- var BrokerDecodedClientSchema = object({
12360
- tag: string(),
12361
- subscribedAt: number(),
12362
- maxFps: number(),
12363
- framesDelivered: number(),
12364
- framesDropped: number()
12365
- });
12366
13086
  var BrokerAudioClientSchema = object({
12367
13087
  tag: string(),
12368
13088
  subscribedAt: number(),
@@ -12454,7 +13174,6 @@ var BrokerEncodedClientSchema = object({
12454
13174
  });
12455
13175
  var BrokerClientsSchema = object({
12456
13176
  rtsp: array(BrokerRtspClientSchema).readonly(),
12457
- decoded: array(BrokerDecodedClientSchema).readonly(),
12458
13177
  audio: array(BrokerAudioClientSchema).readonly(),
12459
13178
  encoded: array(BrokerEncodedClientSchema).readonly(),
12460
13179
  pipeClients: number(),
@@ -12823,11 +13542,7 @@ method(object({
12823
13542
  auth: "admin"
12824
13543
  }), method(object({ brokerId: string() }), BrokerClientsSchema), method(object({
12825
13544
  brokerId: string(),
12826
- channel: _enum([
12827
- "rtsp",
12828
- "decoded",
12829
- "audio"
12830
- ]),
13545
+ channel: _enum(["rtsp", "audio"]),
12831
13546
  handle: string()
12832
13547
  }), object({ killed: boolean() }), {
12833
13548
  kind: "mutation",
@@ -12862,10 +13577,7 @@ method(object({
12862
13577
  }), method(SubscribeAudioChunksInputSchema, SubscribeAudioChunksResultSchema, { kind: "mutation" }), method(object({
12863
13578
  subscriptionId: string(),
12864
13579
  maxCount: number().int().positive().default(8)
12865
- }), array(DecodedAudioChunkSchema).readonly()), method(object({ subscriptionId: string() }), object({ released: boolean() }), { kind: "mutation" }), method(SubscribeFramesInputSchema, SubscribeFramesResultSchema, { kind: "mutation" }), method(object({
12866
- subscriptionId: string(),
12867
- maxCount: number().int().positive().default(4)
12868
- }), array(FrameHandleSchema).readonly()), method(object({ subscriptionId: string() }), object({ released: boolean() }), { kind: "mutation" }), method(object({
13580
+ }), array(DecodedAudioChunkSchema).readonly()), method(object({ subscriptionId: string() }), object({ released: boolean() }), { kind: "mutation" }), method(object({
12869
13581
  brokerId: string(),
12870
13582
  seconds: number().min(0).max(30)
12871
13583
  }), _void(), {
@@ -14125,53 +14837,201 @@ id: union([string(), number()]) }), {
14125
14837
  auth: "admin"
14126
14838
  });
14127
14839
  /**
14128
- * shm ring usage stats for a `frameSink: 'shm'` decoder session —
14129
- * exposed via `decoder.getShmStats` so downstream consumers can
14130
- * observe ring pressure (slot count, byte budget, hit/miss ratio).
14840
+ * `keychain` — the hub's encrypted store of secret values (D787).
14841
+ *
14842
+ * Settings blobs never hold a secret: they hold a marker
14843
+ * `{"$secret":"secret://<owner>/<scope>/<fieldPath>","v":1}` and the value
14844
+ * lives here, AES-256-GCM under a data key that a master key wraps. This cap
14845
+ * is the OWNER's door to its own values: every method is owner-checked
14846
+ * against the CALLER, never against anything the caller claims.
14847
+ *
14848
+ * Who the caller is: the transport stamps `callerAddonId` into the args of a
14849
+ * call that crossed a process (the parent `LocalChildRegistry` from the UDS
14850
+ * connection, the agent from its child's connection carried in
14851
+ * `$hub-cap-fwd`'s envelope). A stamp always overwrites; a wire call with no
14852
+ * stamp has its claim stripped. Only a hub in-process caller may state its own
14853
+ * identity — `ctx.secrets` does that with the addon id closed over. This is
14854
+ * identity against BUGS and misrouting, not against a malicious addon (every
14855
+ * runner is the same OS user): see the threat model in
14856
+ * `docs/design/2026-10-08-secrets-keychain.md`.
14857
+ *
14858
+ * `callerAddonId` is deliberately NOT in any input schema: the tRPC router
14859
+ * parses the input, so a session can never supply it, and the internal mount
14860
+ * floors every method to admin anyway (D240).
14861
+ *
14862
+ * Internal: addons reach it through `ctx.secrets`, never directly.
14131
14863
  */
14132
- var ShmRingStatsSchema = object({
14133
- sessionId: string(),
14134
- slotCount: number().int(),
14135
- slotByteLength: number().int(),
14136
- segmentBytes: number().int(),
14137
- budgetMb: number().int(),
14138
- framesWritten: number().int(),
14139
- getFrameHits: number().int(),
14140
- getFrameMisses: number().int()
14141
- });
14142
- method(object({ codec: string() }), boolean()), method(_void(), object({
14864
+ /** Why a value cannot be served right now. Never folded into "missing". */
14865
+ var KeychainUnavailableReasonSchema = _enum([
14866
+ "key-missing",
14867
+ "wrong-key",
14868
+ "key-file-unreadable",
14869
+ "store-unavailable",
14870
+ "not-initialized",
14871
+ "decrypt-failed"
14872
+ ]);
14873
+ var KeychainStateSchema = discriminatedUnion("state", [object({ state: literal("ready") }), object({
14874
+ state: literal("locked"),
14875
+ reason: KeychainUnavailableReasonSchema
14876
+ })]);
14877
+ var KeychainResolveEntrySchema = discriminatedUnion("kind", [
14878
+ object({
14879
+ kind: literal("value"),
14880
+ value: string(),
14881
+ version: number().int()
14882
+ }),
14883
+ object({ kind: literal("missing") }),
14884
+ object({
14885
+ kind: literal("unavailable"),
14886
+ reason: KeychainUnavailableReasonSchema
14887
+ }),
14888
+ object({ kind: literal("forbidden") })
14889
+ ]);
14890
+ var KeychainResolveResultSchema = record(string(), KeychainResolveEntrySchema);
14891
+ /** Metadata of one stored value — never the value. */
14892
+ var KeychainSecretMetaSchema = object({
14893
+ ref: string(),
14894
+ owner: string(),
14895
+ /** Formatted scope (`global`, `node/<id>`, `device/<id>`, …). */
14896
+ scope: string(),
14897
+ fieldPath: string(),
14898
+ version: number().int(),
14899
+ createdAt: number(),
14900
+ updatedAt: number(),
14901
+ /** `addon:<id>` | `user:<id>` | `system`. */
14902
+ updatedBy: string(),
14903
+ /** Coarse — written at most once an hour per ref. `null` = never read. */
14904
+ lastReadAt: number().nullable()
14905
+ });
14906
+ var RefListSchema = array(string().min(1)).max(512);
14907
+ method(object({
14908
+ ref: string().min(1),
14909
+ value: string().min(1)
14910
+ }), object({
14911
+ ref: string(),
14912
+ version: number().int()
14913
+ }), {
14914
+ kind: "mutation",
14915
+ auth: "admin"
14916
+ }), method(object({ refs: RefListSchema }), KeychainResolveResultSchema, { auth: "admin" }), method(object({ refs: RefListSchema }), object({ deleted: number().int() }), {
14917
+ kind: "mutation",
14918
+ auth: "admin"
14919
+ }), method(object({}), array(KeychainSecretMetaSchema).readonly(), { auth: "admin" }), method(object({}), KeychainStateSchema, { auth: "admin" });
14920
+ var KeychainKeySourceSchema = object({
14921
+ kind: _enum([
14922
+ "config-file",
14923
+ "previous-config-file",
14924
+ "platform",
14925
+ "default-file"
14926
+ ]),
14927
+ /** File sources only — a path is not a secret. */
14928
+ path: string().optional(),
14929
+ /**
14930
+ * True when a whole-volume backup of the data directory carries this key
14931
+ * next to the database it protects (the default file). The page warns.
14932
+ */
14933
+ sharesBackupWithDatabase: boolean()
14934
+ });
14935
+ var KeychainStatusSchema = object({
14936
+ keychain: KeychainStateSchema,
14937
+ /** The source of the master key in use; `null` while locked. */
14938
+ keySource: KeychainKeySourceSchema.nullable(),
14939
+ /** The source configured to be primary — differs from `keySource` while a rotation is pending. */
14940
+ configuredSource: KeychainKeySourceSchema,
14941
+ /** Short fingerprint of the master key in use (`HMAC(KEK, label)`, 16 hex). */
14942
+ fingerprint: string().nullable(),
14943
+ activeKeyId: string().nullable(),
14944
+ /**
14945
+ * The keychain unlocked with a NON-primary source: the configured primary
14946
+ * key is not the one that wraps the data key yet. `rotateMasterKey` moves it.
14947
+ */
14948
+ rotationPending: boolean(),
14949
+ /** Wrapped copies of the data key under a previous master key, kept until purged. */
14950
+ retiredWraps: number().int(),
14951
+ recoveryKeyDownloadedAt: number().nullable(),
14952
+ secretCount: number().int()
14953
+ });
14954
+ /**
14955
+ * Whether a stored value is still pointed at by its owner's settings.
14956
+ * `unknown` is a first-class answer: a scope whose blob could not be read is
14957
+ * never reported as an orphan (and never deleted as one).
14958
+ */
14959
+ var KeychainSecretUsageSchema = _enum([
14960
+ "in-use",
14961
+ "orphan",
14962
+ "unknown"
14963
+ ]);
14964
+ var KeychainAdminSecretSchema = KeychainSecretMetaSchema.extend({ usage: KeychainSecretUsageSchema });
14965
+ var KeychainAuditActionSchema = _enum([
14966
+ "put",
14967
+ "delete",
14968
+ "reveal",
14969
+ "rotate-master-key",
14970
+ "purge-retired-keys",
14971
+ "download-recovery-key",
14972
+ "delete-orphans",
14973
+ "reset",
14974
+ "initialize"
14975
+ ]);
14976
+ var KeychainAuditEntrySchema = object({
14977
+ id: string(),
14978
+ at: number(),
14979
+ action: KeychainAuditActionSchema,
14980
+ /** `addon:<id>` | `user:<id>` | `system`. */
14981
+ actor: string(),
14982
+ ref: string().nullable(),
14983
+ detail: string().nullable()
14984
+ });
14985
+ method(object({}), KeychainStatusSchema, { auth: "admin" }), method(object({}), array(KeychainAdminSecretSchema).readonly(), { auth: "admin" }), method(object({ limit: number().int().min(1).max(500).optional() }), array(KeychainAuditEntrySchema).readonly(), { auth: "admin" }), method(object({ ref: string().min(1) }), object({
14986
+ value: string(),
14987
+ version: number().int()
14988
+ }), {
14989
+ kind: "mutation",
14990
+ auth: "admin",
14991
+ caller: "required"
14992
+ }), method(object({ refs: array(string().min(1)).max(1e3) }), object({
14993
+ deleted: array(string()).readonly(),
14994
+ kept: array(object({
14995
+ ref: string(),
14996
+ usage: KeychainSecretUsageSchema
14997
+ })).readonly()
14998
+ }), {
14999
+ kind: "mutation",
15000
+ auth: "admin",
15001
+ caller: "required"
15002
+ }), method(object({}), object({
15003
+ fingerprint: string(),
15004
+ keySource: KeychainKeySourceSchema
15005
+ }), {
15006
+ kind: "mutation",
15007
+ auth: "admin",
15008
+ caller: "required"
15009
+ }), method(object({}), object({ purged: number().int() }), {
15010
+ kind: "mutation",
15011
+ auth: "admin",
15012
+ caller: "required"
15013
+ }), method(object({}), object({
15014
+ key: string(),
15015
+ fingerprint: string(),
15016
+ keySource: KeychainKeySourceSchema
15017
+ }), {
15018
+ kind: "mutation",
15019
+ auth: "admin",
15020
+ caller: "required"
15021
+ }), method(object({ confirm: literal("RESET KEYCHAIN") }), object({
15022
+ archivedCollection: string().nullable(),
15023
+ archived: number().int()
15024
+ }), {
15025
+ kind: "mutation",
15026
+ auth: "admin",
15027
+ caller: "required"
15028
+ });
15029
+ method(_void(), object({
14143
15030
  id: string(),
14144
15031
  name: string(),
14145
- isPullMode: boolean().optional(),
14146
- priority: number().optional(),
14147
15032
  hwaccel: string().optional(),
14148
15033
  probedBestHwaccel: string().optional()
14149
- })), method(DecoderSessionConfigSchema, object({
14150
- sessionId: string(),
14151
- nodeId: string()
14152
- })), method(object({ sessionId: string() }), _void()), method(object({
14153
- sessionId: string(),
14154
- packet: EncodedPacketSchema
14155
- }), _void()), method(object({
14156
- sessionId: string(),
14157
- url: string()
14158
- }), _void()), method(object({
14159
- sessionId: string(),
14160
- maxCount: number().default(1),
14161
- waitMs: number().optional()
14162
- }), array(DecodedFrameSchema)), method(object({
14163
- sessionId: string(),
14164
- maxCount: number().default(1),
14165
- waitMs: number().optional()
14166
- }), array(FrameHandleSchema)), method(object({ handle: FrameHandleSchema }), DecodedFrameSchema.nullable()), method(object({ sessionId: string() }), ShmRingStatsSchema.nullable()), method(object({
14167
- sessionId: string(),
14168
- config: DecoderSessionConfigSchema.partial()
14169
- }), _void()), method(object({ sessionId: string() }), DecoderStatsSchema), method(_void(), array(object({
14170
- sessionId: string(),
14171
- codec: string(),
14172
- outputFormat: string(),
14173
- createdAtMs: number()
14174
- })).readonly()), method(_void(), object({ backend: string() }), {
15034
+ })), method(_void(), object({ backend: string() }), {
14175
15035
  kind: "mutation",
14176
15036
  auth: "admin"
14177
15037
  });
@@ -15171,6 +16031,10 @@ var DeviceInfoSchema = object({
15171
16031
  isCamera: boolean(),
15172
16032
  /** Current config values — serializable snapshot */
15173
16033
  config: record(string(), unknown()),
16034
+ /** Paths inside `config` the device's schema declares secret (D783) —
16035
+ * what the non-admin redaction withholds. Paths, never values. Absent
16036
+ * when the owning runner has not reported them. */
16037
+ secretConfigPaths: array(string()).optional(),
15174
16038
  /** Hardware + identity blob (manufacturer / model / firmware / sn /
15175
16039
  * uid / mac / …). Populated by drivers; editable via setMetadata. */
15176
16040
  metadata: record(string(), unknown()).nullable().optional(),
@@ -15376,12 +16240,22 @@ var DeviceRegisterPayloadSchema = object({
15376
16240
  * call (workers re-register on init), so probe-driven updates
15377
16241
  * (e.g. PTZ flag flipping after the abilities probe) propagate. */
15378
16242
  features: array(string()).optional(),
15379
- config: record(string(), unknown())
16243
+ config: record(string(), unknown()),
16244
+ /** Config paths the device's own schema DECLARES secret
16245
+ * (`.meta({ secret: true })` — dotted, `[]` for array items, e.g.
16246
+ * `connection.password`). Re-published on every register; the non-admin
16247
+ * redaction withholds them at any depth (D783). Optional: an older runner
16248
+ * omits it and the keyword backstop applies. */
16249
+ secretConfigPaths: array(string()).optional()
15380
16250
  });
15381
16251
  var DeviceRemovePayloadSchema = object({ deviceId: number() });
15382
16252
  var DevicePersistConfigPayloadSchema = object({
15383
16253
  deviceId: number(),
15384
- data: record(string(), unknown())
16254
+ data: record(string(), unknown()),
16255
+ /** The paths the device's schema declares secret (D783), when the caller
16256
+ * knows them — those values are kept in the keychain, not the blob (D787).
16257
+ * Absent: the paths the device last reported at `registerDevice` apply. */
16258
+ secretConfigPaths: array(string()).optional()
15385
16259
  });
15386
16260
  /** What a migration actually did, per switch. `unreachable` is a first-class
15387
16261
  * answer: a camera that could not be asked is not a camera that was silenced. */
@@ -16203,6 +17077,12 @@ method(_void(), array(string()).readonly(), { auth: "admin" }), method(object({
16203
17077
  kind: "mutation",
16204
17078
  auth: "admin"
16205
17079
  });
17080
+ var HUB_ADDRESS_ROLES = [
17081
+ "appConnections",
17082
+ "notificationTaps",
17083
+ "internal",
17084
+ "publicEndpoint"
17085
+ ];
16206
17086
  /**
16207
17087
  * Transport bounds for AI capability methods.
16208
17088
  *
@@ -17029,7 +17909,14 @@ var LoginMethodContributionSchema = discriminatedUnion("kind", [
17029
17909
  icon: string().optional(),
17030
17910
  /** Addon-owned HTTP route the button navigates to (GET). */
17031
17911
  startUrl: string(),
17032
- stage: LoginStageEnum
17912
+ stage: LoginStageEnum,
17913
+ /**
17914
+ * The provider names an external identity a signed-in user can link to
17915
+ * their own account (D782): `auth.listLinkableProviders` /
17916
+ * `beginExternalLink` offer exactly the redirect methods that set this,
17917
+ * whatever their id. Absent / false — a login button only (magic-link).
17918
+ */
17919
+ linkable: boolean().optional()
17033
17920
  }),
17034
17921
  object({
17035
17922
  kind: literal("widget"),
@@ -18805,6 +19692,8 @@ var NcSystemEventKindSchema = _enum([
18805
19692
  "stream-offline",
18806
19693
  "node-online",
18807
19694
  "node-offline",
19695
+ "node-restarting",
19696
+ "node-updating",
18808
19697
  "node-inference-unavailable",
18809
19698
  "detection-blind",
18810
19699
  "addon-crash-loop",
@@ -20410,7 +21299,13 @@ var NcAlarmModeDelaysListSchema = array(object({
20410
21299
  * Absent = false (logged, not sent). Even when true it is not sent when that same sensor
20411
21300
  * is the one that starts the entry delay — the entry-delay notification already names it.
20412
21301
  */
20413
- notifySensorRewatched: boolean().optional()
21302
+ notifySensorRewatched: boolean().optional(),
21303
+ /**
21304
+ * D735: notify "ignored" when a sensor this arm bypassed really MOVED while armed (its own
21305
+ * change time is after the arm) and set nothing off. Absent = false (logged, not sent). A
21306
+ * re-sync, a recovery from `unavailable` or a duplicate is never announced, switch or not.
21307
+ */
21308
+ notifySensorIgnored: boolean().optional()
20414
21309
  })).max(8).refine(uniqueModes, { message: "modeDelays: at most one entry per arm mode" });
20415
21310
  var NcAlarmModeDelaysEditListSchema = array(object({
20416
21311
  mode: AlarmArmModeSchema,
@@ -20423,7 +21318,9 @@ var NcAlarmModeDelaysEditListSchema = array(object({
20423
21318
  /** D706: set the switch, or `null` to clear it (back to the default, false). */
20424
21319
  notifyDuringEntryDelay: boolean().nullable().optional(),
20425
21320
  /** D706: set the switch, or `null` to clear it (back to the default, false). */
20426
- notifySensorRewatched: boolean().nullable().optional()
21321
+ notifySensorRewatched: boolean().nullable().optional(),
21322
+ /** D735: set the switch, or `null` to clear it (back to the default, false). */
21323
+ notifySensorIgnored: boolean().nullable().optional()
20427
21324
  })).max(8).refine(uniqueModes, { message: "modeDelays: at most one edit per arm mode" });
20428
21325
  /** One switch of the alarm table: put ONE device on, or take it off, ONE mode's list. */
20429
21326
  var NcAlarmNonBlockingEditSchema = object({
@@ -21401,8 +22298,8 @@ Object.freeze(Object.fromEntries([{
21401
22298
  var CLUSTER_STEP_SETTING_FIELDS = [{
21402
22299
  stepId: "face-embedding",
21403
22300
  key: "minLandmarkFaceSize",
21404
- label: "Min face size for recognition (detection px)",
21405
- 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.",
22301
+ label: "Min face size to embed (detection-frame px)",
22302
+ description: "Faces smaller than this in the small frame the detector sees are not embedded, so they can never be recognised. Below it the face cannot be aligned reliably and a bad embedding matches everyone. Same value on every node. 0 = no limit.",
21406
22303
  type: "slider",
21407
22304
  min: 0,
21408
22305
  max: 64,
@@ -22375,8 +23272,23 @@ var RetrainMacroClassSchema = _enum([
22375
23272
  ]);
22376
23273
  /** A subject to learn, or a phantom to unlearn (taught by OMISSION). */
22377
23274
  var RetrainAnnotationKindSchema = _enum(["subject", "model_error"]);
22378
- /** Did a human draw this box, or did the assist propose it? */
22379
- var RetrainAnnotationSourceSchema = _enum(["operator", "assist"]);
23275
+ /**
23276
+ * Where a box came from. A machine-sourced box is a DRAFT on the page until
23277
+ * the operator confirms it; once saved it keeps its source as provenance.
23278
+ *
23279
+ * - `operator` — drawn by hand.
23280
+ * - `assist` — proposed by a detector run on the copy (the camera's own
23281
+ * model, or a larger teacher model).
23282
+ * - `pipeline` — the box the live pipeline actually drew on that frame, read
23283
+ * back from the track store (never a re-run).
23284
+ * - `llm` — proposed by a vision-capable LLM profile.
23285
+ */
23286
+ var RetrainAnnotationSourceSchema = _enum([
23287
+ "operator",
23288
+ "assist",
23289
+ "pipeline",
23290
+ "llm"
23291
+ ]);
22380
23292
  /** Normalised `[0,1]` rectangle against the FULL frame — the canonical form. */
22381
23293
  var RetrainBboxSchema = object({
22382
23294
  x: number(),
@@ -22394,7 +23306,8 @@ var RetrainBboxSchema = object({
22394
23306
  */
22395
23307
  var RetrainAnnotationSchema = object({
22396
23308
  id: string(),
22397
- trackId: string(),
23309
+ /** The frame's track. Absent on a recording still, which has none. */
23310
+ trackId: string().optional(),
22398
23311
  deviceId: number(),
22399
23312
  /** The COPY in retrain storage — never the source track's media key. */
22400
23313
  mediaKey: string(),
@@ -22443,18 +23356,63 @@ var RetrainFrameCandidateSchema = object({
22443
23356
  * fail, whatever became of the original. */
22444
23357
  copied: boolean()
22445
23358
  });
23359
+ /**
23360
+ * One box the live pipeline drew on a copied frame — what a correction starts
23361
+ * from. Derived when the frame is listed, from the track store: the subject
23362
+ * box recorded on the source media row when there is one, else the track
23363
+ * position nearest the frame's capture time. Never stored as an annotation
23364
+ * until the operator confirms it.
23365
+ */
23366
+ var RetrainPipelineBoxSchema = object({
23367
+ /** Normalised `[0,1]` against the full frame. */
23368
+ bbox: RetrainBboxSchema,
23369
+ macroClass: RetrainMacroClassSchema,
23370
+ label: string().optional(),
23371
+ subLabel: string().optional(),
23372
+ /** The detection score of the position used, when it was recorded. */
23373
+ score: number().optional(),
23374
+ /** The root model that produced the track, when it was recorded. */
23375
+ modelId: string().optional(),
23376
+ trackId: string(),
23377
+ /** `subject-box`: recorded on this very frame. `position`: the track's
23378
+ * position nearest the capture time, `deltaMs` away. */
23379
+ basis: _enum(["subject-box", "position"]),
23380
+ deltaMs: number()
23381
+ });
23382
+ /**
23383
+ * Where a retrain frame came from: a TRACK's stored media (copy-on-select),
23384
+ * or the RECORDING at an instant — the frame a model saw nothing in has no
23385
+ * track at all.
23386
+ */
23387
+ var RetrainFrameOriginSchema = _enum(["track", "recording"]);
22446
23388
  /** A frame the dataset OWNS: bytes copied at selection time. */
22447
23389
  var RetrainFrameSchema = object({
22448
23390
  frameId: string(),
22449
23391
  deviceId: number(),
22450
- trackId: string(),
22451
- /** Provenance only. It may already point at nothing — that is expected. */
22452
- sourceMediaId: number().int(),
23392
+ origin: RetrainFrameOriginSchema,
23393
+ /** The track it was copied from. Absent on a recording still. */
23394
+ trackId: string().optional(),
23395
+ /** Provenance only. It may already point at nothing — that is expected.
23396
+ * Absent on a recording still. */
23397
+ sourceMediaId: number().int().optional(),
23398
+ /** A recording still: the playhead instant it was taken at. */
23399
+ epochMs: number().optional(),
22453
23400
  sourceKind: MediaFileKindEnum,
22454
23401
  sizeBytes: number().int(),
22455
23402
  width: number().int(),
22456
23403
  height: number().int(),
22457
- copiedAt: number()
23404
+ copiedAt: number(),
23405
+ /** When the CAMERA captured the frame. Absent on a copy taken before D785. */
23406
+ capturedAt: number().optional(),
23407
+ /** The operator's "every subject in this frame is boxed". Detector
23408
+ * evaluation keeps only complete frames: an unboxed subject would count as
23409
+ * a false positive. */
23410
+ complete: boolean(),
23411
+ /** The boxes the pipeline drew on this frame. Present on list answers;
23412
+ * empty when nothing the track store holds can be placed on it. */
23413
+ pipelineBoxes: array(RetrainPipelineBoxSchema).readonly().optional(),
23414
+ /** The named collections this frame belongs to. Present on list answers. */
23415
+ collectionIds: array(string()).readonly().optional()
22458
23416
  });
22459
23417
  /** Why a copy-on-select could not be honoured — named, never a silent skip. */
22460
23418
  var RetrainCopyRefusalSchema = _enum([
@@ -22475,6 +23433,53 @@ var RetrainFrameListSchema = object({
22475
23433
  /** What the page pre-selects — the native key frame when one survives. */
22476
23434
  autoPickMediaId: number().int().optional()
22477
23435
  });
23436
+ /**
23437
+ * Which frames an annotated export carries. Every field narrows; an empty
23438
+ * filter is every annotated copy. A dataset VERSION is a frozen `frameIds`
23439
+ * list owned by whoever trains (the training orchestrator), so `frameIds` is
23440
+ * the primitive a version export uses; `batchId` re-selects what an earlier
23441
+ * export carried (`exportedInBatch`).
23442
+ */
23443
+ var RetrainExportFilterSchema = object({
23444
+ deviceIds: array(number()).optional(),
23445
+ frameIds: array(string()).max(2e4).optional(),
23446
+ /** Only frames in at least one of these named collections. */
23447
+ collectionIds: array(string()).max(200).optional(),
23448
+ batchId: string().optional(),
23449
+ /** Only frames the operator marked complete (all subjects boxed). */
23450
+ completeOnly: boolean().optional()
23451
+ });
23452
+ /**
23453
+ * `frames`: the full frame copies, boxes in `annotations.json`.
23454
+ * `crops`: additionally one JPEG per subject, cut with the runtime detail-crop
23455
+ * convention — the classifier layout.
23456
+ */
23457
+ var RetrainExportLayoutSchema = _enum(["frames", "crops"]);
23458
+ /**
23459
+ * Where `writeRetrainArchive` streams the tar: one HTTP request whose body is
23460
+ * the archive, sent chunk by chunk. Covers a presigned PUT and a provider
23461
+ * addon's data-plane upload route alike. Headers are sent verbatim and never
23462
+ * logged.
23463
+ */
23464
+ var RetrainArchiveTargetSchema = object({
23465
+ kind: literal("http"),
23466
+ method: _enum(["PUT", "POST"]),
23467
+ url: string().url(),
23468
+ headers: record(string(), string()).optional()
23469
+ });
23470
+ var RetrainArchiveResultSchema = object({
23471
+ batchId: string(),
23472
+ frames: number().int(),
23473
+ crops: number().int(),
23474
+ annotations: number().int(),
23475
+ /** Frames planned but not shipped (unreadable copy, path too long). */
23476
+ missing: number().int(),
23477
+ bytes: number().int(),
23478
+ /** sha256 of the exact bytes sent. */
23479
+ sha256: string(),
23480
+ /** The target's HTTP status. */
23481
+ status: number().int()
23482
+ });
22478
23483
  /** What the operator asked the assist to look for. */
22479
23484
  var RetrainAssistSubjectSchema = discriminatedUnion("kind", [object({
22480
23485
  kind: literal("package"),
@@ -22504,6 +23509,109 @@ var RetrainAssistResultSchema = discriminatedUnion("kind", [object({
22504
23509
  reason: string(),
22505
23510
  detail: string().optional()
22506
23511
  })]);
23512
+ /** A named set over the retrain corpus — membership only, it owns no pixels. */
23513
+ var RetrainCollectionSchema = object({
23514
+ id: string(),
23515
+ name: string(),
23516
+ createdAt: number(),
23517
+ frameCount: number().int()
23518
+ });
23519
+ var RetrainCollectionCreateResultSchema = discriminatedUnion("kind", [object({
23520
+ kind: literal("created"),
23521
+ collection: RetrainCollectionSchema
23522
+ }), object({
23523
+ kind: literal("refused"),
23524
+ reason: _enum(["empty-name", "duplicate-name"])
23525
+ })]);
23526
+ var RetrainCollectionRenameResultSchema = discriminatedUnion("kind", [object({
23527
+ kind: literal("renamed"),
23528
+ collection: RetrainCollectionSchema
23529
+ }), object({
23530
+ kind: literal("refused"),
23531
+ reason: _enum([
23532
+ "empty-name",
23533
+ "duplicate-name",
23534
+ "unknown-collection"
23535
+ ])
23536
+ })]);
23537
+ /**
23538
+ * The outcome of adding the frame at a recording instant. Every refusal is
23539
+ * named: `still-unavailable` (not recording, a gap, or an undecodable frame —
23540
+ * `detail` says which), `still-busy` (the recorder is at its decode bound; try
23541
+ * again), `unreadable-image`, `write-failed`, `unknown-collection`.
23542
+ */
23543
+ var AddRetrainFrameFromRecordingResultSchema = discriminatedUnion("kind", [object({
23544
+ kind: literal("added"),
23545
+ collectionId: string(),
23546
+ frame: RetrainFrameSchema,
23547
+ /** The moment was already in the dataset; nothing was decoded. */
23548
+ reused: boolean()
23549
+ }), object({
23550
+ kind: literal("refused"),
23551
+ reason: _enum([
23552
+ "unknown-collection",
23553
+ "still-unavailable",
23554
+ "still-busy",
23555
+ "unreadable-image",
23556
+ "write-failed"
23557
+ ]),
23558
+ detail: string().optional()
23559
+ })]);
23560
+ /** A vision LLM profile the AI assist may use, and where it sends the frame. */
23561
+ var RetrainAssistProfileSchema = object({
23562
+ id: string(),
23563
+ name: string(),
23564
+ model: string(),
23565
+ kind: string(),
23566
+ /** `true` when the frame would leave the house (a cloud vendor, or an
23567
+ * endpoint that is not on the local network). The page confirms each such
23568
+ * run, and the provider refuses one without `allowCloud`. */
23569
+ leavesHouse: boolean()
23570
+ });
23571
+ /** A box the AI assist proposed: a draft, plus the model's own reason. */
23572
+ var RetrainLlmProposalSchema = RetrainAnnotationDraftSchema.extend({ reason: string() });
23573
+ /** What the AI assist said about a box that was already on the canvas. */
23574
+ var RetrainLlmReviewSchema = object({
23575
+ /** The `ref` the page sent the box under. */
23576
+ ref: string(),
23577
+ verdict: _enum([
23578
+ "confirmed",
23579
+ "wrong-class",
23580
+ "not-an-object",
23581
+ "uncertain"
23582
+ ]),
23583
+ suggestedClass: RetrainMacroClassSchema.optional(),
23584
+ reason: string()
23585
+ });
23586
+ /**
23587
+ * The AI assist's answer. `proposed` carries drafts (`source: 'llm'`, the
23588
+ * model and its confidence) and reviews; items the model got wrong (a box off
23589
+ * the frame, an unasked class, an unknown ref) are dropped and counted in
23590
+ * `rejected`. A whole answer that is not the schema is `malformed-answer`.
23591
+ */
23592
+ var RetrainLlmAssistResultSchema = discriminatedUnion("kind", [object({
23593
+ kind: literal("proposed"),
23594
+ profileId: string(),
23595
+ model: string(),
23596
+ /** The frame was sent outside the house for this answer. */
23597
+ leftHouse: boolean(),
23598
+ proposals: array(RetrainLlmProposalSchema).readonly(),
23599
+ reviews: array(RetrainLlmReviewSchema).readonly(),
23600
+ rejected: number().int()
23601
+ }), object({
23602
+ kind: literal("refused"),
23603
+ reason: _enum([
23604
+ "unknown-frame",
23605
+ "unreadable-frame",
23606
+ "unknown-profile",
23607
+ "profile-disabled",
23608
+ "no-vision",
23609
+ "cloud-not-confirmed",
23610
+ "llm-error",
23611
+ "malformed-answer"
23612
+ ]),
23613
+ detail: string().optional()
23614
+ })]);
22507
23615
  /** The outcome of a lifecycle move owned by the retrain page. */
22508
23616
  var RetrainTransitionResultSchema = object({
22509
23617
  trackId: string(),
@@ -23221,7 +24329,7 @@ DeviceType.Camera, method(object({ deviceId: number() }), array(TrackSchema).rea
23221
24329
  auth: "admin"
23222
24330
  }), method(object({
23223
24331
  deviceId: number(),
23224
- trackId: string(),
24332
+ trackId: string().optional(),
23225
24333
  frameId: string()
23226
24334
  }), object({
23227
24335
  removed: boolean(),
@@ -23238,7 +24346,8 @@ DeviceType.Camera, method(object({ deviceId: number() }), array(TrackSchema).rea
23238
24346
  auth: "admin"
23239
24347
  }), method(object({
23240
24348
  deviceId: number(),
23241
- trackId: string(),
24349
+ /** The frame's track, when it has one — checked against the frame. */
24350
+ trackId: string().optional(),
23242
24351
  frameId: string(),
23243
24352
  subject: RetrainAssistSubjectSchema,
23244
24353
  /** Which node runs it. Absent ⇒ wherever an unowned call lands. */
@@ -23246,12 +24355,16 @@ DeviceType.Camera, method(object({ deviceId: number() }), array(TrackSchema).rea
23246
24355
  }), RetrainAssistResultSchema, {
23247
24356
  kind: "mutation",
23248
24357
  auth: "admin"
23249
- }), method(object({ trackId: string() }), array(RetrainAnnotationSchema).readonly(), {
24358
+ }), method(object({
24359
+ trackId: string().optional(),
24360
+ frameIds: array(string()).max(2e3).optional()
24361
+ }), array(RetrainAnnotationSchema).readonly(), {
23250
24362
  kind: "query",
23251
24363
  auth: "admin"
23252
24364
  }), method(object({
23253
24365
  deviceId: number(),
23254
- trackId: string(),
24366
+ /** The frame's track, when it has one — checked against the frame. */
24367
+ trackId: string().optional(),
23255
24368
  frameId: string(),
23256
24369
  annotations: array(RetrainAnnotationDraftSchema)
23257
24370
  }), array(RetrainAnnotationSchema).readonly(), {
@@ -23269,7 +24382,91 @@ DeviceType.Camera, method(object({ deviceId: number() }), array(TrackSchema).rea
23269
24382
  }), RetrainTransitionResultSchema, {
23270
24383
  kind: "mutation",
23271
24384
  auth: "admin"
23272
- }), method(object({ deviceIds: array(number()).optional() }), object({ url: string() }), {
24385
+ }), method(RetrainExportFilterSchema.extend({ layout: RetrainExportLayoutSchema.optional() }), object({ url: string() }), {
24386
+ kind: "query",
24387
+ auth: "admin"
24388
+ }), method(object({
24389
+ deviceId: number(),
24390
+ trackId: string().optional(),
24391
+ frameId: string(),
24392
+ complete: boolean()
24393
+ }), RetrainFrameSchema, {
24394
+ kind: "mutation",
24395
+ auth: "admin"
24396
+ }), method(object({
24397
+ filter: RetrainExportFilterSchema,
24398
+ layout: RetrainExportLayoutSchema,
24399
+ target: RetrainArchiveTargetSchema
24400
+ }), RetrainArchiveResultSchema, {
24401
+ kind: "mutation",
24402
+ auth: "admin",
24403
+ timeoutMs: 60 * 6e4
24404
+ }), method(object({}), array(RetrainAssistProfileSchema).readonly(), {
24405
+ kind: "query",
24406
+ auth: "admin"
24407
+ }), method(object({
24408
+ deviceId: number(),
24409
+ trackId: string().optional(),
24410
+ frameId: string(),
24411
+ profileId: string(),
24412
+ classes: array(RetrainMacroClassSchema).min(1),
24413
+ boxes: array(object({
24414
+ ref: string(),
24415
+ bbox: RetrainBboxSchema,
24416
+ macroClass: RetrainMacroClassSchema,
24417
+ label: string().optional()
24418
+ })).max(50),
24419
+ allowCloud: boolean()
24420
+ }), RetrainLlmAssistResultSchema, {
24421
+ kind: "mutation",
24422
+ auth: "admin",
24423
+ timeoutMs: 18e4
24424
+ }), method(object({ name: string().max(120) }), RetrainCollectionCreateResultSchema, {
24425
+ kind: "mutation",
24426
+ auth: "admin"
24427
+ }), method(object({}), array(RetrainCollectionSchema).readonly(), {
24428
+ kind: "query",
24429
+ auth: "admin"
24430
+ }), method(object({
24431
+ id: string(),
24432
+ name: string().max(120)
24433
+ }), RetrainCollectionRenameResultSchema, {
24434
+ kind: "mutation",
24435
+ auth: "admin"
24436
+ }), method(object({ id: string() }), object({
24437
+ deleted: boolean(),
24438
+ removedFrames: number().int()
24439
+ }), {
24440
+ kind: "mutation",
24441
+ auth: "admin"
24442
+ }), method(object({
24443
+ collectionId: string(),
24444
+ deviceId: number(),
24445
+ epochMs: number()
24446
+ }), AddRetrainFrameFromRecordingResultSchema, {
24447
+ kind: "mutation",
24448
+ auth: "admin",
24449
+ timeoutMs: 6e4
24450
+ }), method(object({
24451
+ collectionId: string(),
24452
+ frameIds: array(string()).min(1).max(500)
24453
+ }), object({
24454
+ added: number().int(),
24455
+ alreadyMember: number().int(),
24456
+ unknownFrameIds: array(string()).readonly()
24457
+ }), {
24458
+ kind: "mutation",
24459
+ auth: "admin"
24460
+ }), method(object({
24461
+ collectionId: string(),
24462
+ frameId: string()
24463
+ }), object({
24464
+ removed: boolean(),
24465
+ deletedFrame: boolean()
24466
+ }), {
24467
+ kind: "mutation",
24468
+ auth: "admin"
24469
+ }), method(object({ collectionId: string() }), array(RetrainFrameSchema).readonly(), {
23273
24470
  kind: "query",
23274
24471
  auth: "admin"
23275
24472
  }), method(object({
@@ -23322,6 +24519,34 @@ DeviceType.Camera, method(object({ deviceId: number() }), array(TrackSchema).rea
23322
24519
  timestamp: number()
23323
24520
  });
23324
24521
  /**
24522
+ * A root model's boxes standing in for one crop-kind step's own inference
24523
+ * (D730) — see `runPipeline.suppliedRoot`.
24524
+ */
24525
+ var SuppliedRootOutputSchema = object({
24526
+ stepId: string(),
24527
+ /** The root model that drew the boxes — stamped on the result. */
24528
+ modelId: string(),
24529
+ detections: array(object({
24530
+ /** `[x1, y1, x2, y2]` in the pixels of the call's image. */
24531
+ bbox: tuple([
24532
+ number(),
24533
+ number(),
24534
+ number(),
24535
+ number()
24536
+ ]),
24537
+ score: number(),
24538
+ /**
24539
+ * Five facial landmarks in the same pixels — a face the step's own
24540
+ * detector already re-found inside a root face box (D730), so its
24541
+ * embedder child aligns it exactly as it aligns any detected face.
24542
+ */
24543
+ landmarks: array(object({
24544
+ x: number(),
24545
+ y: number()
24546
+ })).optional()
24547
+ })).min(1)
24548
+ });
24549
+ /**
23325
24550
  * Reference to the frame's retained NATIVE surface + the parent crop's placement
23326
24551
  * within the frame, so the executor can re-cut a leaf child ROI at native
23327
24552
  * resolution on the detail plane. See the `runPipeline` `nativeCropRef` field.
@@ -23369,7 +24594,7 @@ var FrameRefSchema = object({
23369
24594
  timestamp: number(),
23370
24595
  capturedAt: number().optional()
23371
24596
  });
23372
- var ModelFormatSchema$1 = _enum([
24597
+ var ModelFormatSchema$2 = _enum([
23373
24598
  "onnx",
23374
24599
  "coreml",
23375
24600
  "openvino",
@@ -23387,7 +24612,7 @@ var PipelineSlotSchema = _enum([
23387
24612
  var PipelineEngineChoiceSchema = object({
23388
24613
  runtime: literal("python"),
23389
24614
  backend: string(),
23390
- format: ModelFormatSchema$1,
24615
+ format: ModelFormatSchema$2,
23391
24616
  device: string().optional()
23392
24617
  });
23393
24618
  /**
@@ -23426,32 +24651,15 @@ var PipelineDefaultStepSchema = lazy(() => object({
23426
24651
  group: string().optional(),
23427
24652
  settings: record(string(), unknown()).optional()
23428
24653
  }));
23429
- var PipelineTemplateStepSchema = lazy(() => object({
23430
- addonId: string(),
23431
- enabled: boolean(),
23432
- modelId: string(),
23433
- children: array(PipelineTemplateStepSchema).readonly(),
23434
- settings: record(string(), unknown()).optional()
23435
- }));
23436
- var PipelineTemplateSchema$1 = object({
23437
- id: string(),
23438
- name: string(),
23439
- createdAt: string(),
23440
- updatedAt: string(),
23441
- engine: PipelineEngineChoiceSchema,
23442
- steps: array(PipelineTemplateStepSchema).readonly()
23443
- });
23444
24654
  var PipelineModelOptionSchema = object({
23445
24655
  id: string(),
23446
24656
  name: string(),
23447
- formats: record(string(), object({
23448
- downloaded: boolean(),
23449
- sizeMB: number()
23450
- })),
24657
+ formats: record(string(), PipelineModelFormatStatusSchema),
23451
24658
  group: ModelVariantGroupSchema.optional(),
23452
24659
  legacy: boolean().optional(),
23453
24660
  provider: ModelProviderIdSchema.optional(),
23454
- defaultConfidence: number().optional()
24661
+ defaultConfidence: number().optional(),
24662
+ suppliesSteps: array(RootStepSupplySchema).readonly().optional()
23455
24663
  });
23456
24664
  var ConfigFieldBridge = custom();
23457
24665
  var PipelineAddonSchemaSchema = object({
@@ -23613,6 +24821,22 @@ method(_void(), array(PipelineEngineChoiceSchema)), method(_void(), PipelineEngi
23613
24821
  }), {
23614
24822
  kind: "mutation",
23615
24823
  auth: "admin"
24824
+ }), method(object({
24825
+ nodeId: string(),
24826
+ deviceIds: array(number()).readonly().optional(),
24827
+ dryRun: boolean()
24828
+ }), object({
24829
+ entries: array(object({
24830
+ deviceId: number(),
24831
+ keys: array(string()).readonly()
24832
+ })).readonly(),
24833
+ refused: array(object({
24834
+ deviceId: number(),
24835
+ reason: string()
24836
+ })).readonly()
24837
+ }), {
24838
+ kind: "mutation",
24839
+ auth: "admin"
23616
24840
  }), method(object({ nodeId: string() }), object({ unhealthy: array(object({
23617
24841
  /** `<backend>:<device>`, e.g. `openvino:gpu`. */
23618
24842
  deviceKey: string(),
@@ -23638,22 +24862,14 @@ method(_void(), array(PipelineEngineChoiceSchema)), method(_void(), PipelineEngi
23638
24862
  }), method(_void(), PipelineSchemaSchema), method(_void(), array(PipelineDefaultStepSchema).readonly().nullable()), method(_void(), PipelineConfigBridge), method(_void(), ConfigUISchemaBridge), method(object({
23639
24863
  steps: array(PipelineStepInputSchema),
23640
24864
  deviceKey: string().optional()
23641
- }), PipelineValidationResultSchema), method(_void(), array(PipelineTemplateSchema$1).readonly()), method(object({
23642
- name: string(),
23643
- steps: array(PipelineTemplateStepSchema).readonly(),
23644
- engine: PipelineEngineChoiceSchema
23645
- }), PipelineTemplateSchema$1, { kind: "mutation" }), method(object({
23646
- id: string(),
23647
- name: string().optional(),
23648
- steps: array(PipelineTemplateStepSchema).readonly().optional()
23649
- }), PipelineTemplateSchema$1, { kind: "mutation" }), method(object({ id: string() }), _void(), { kind: "mutation" }), method(_void(), InferenceCapabilitiesBridge), method(object({ addonId: string() }), ModelAvailabilityListBridge), method(object({
24865
+ }), PipelineValidationResultSchema), method(_void(), InferenceCapabilitiesBridge), method(object({ addonId: string() }), ModelAvailabilityListBridge), method(object({
23650
24866
  addonId: string(),
23651
24867
  modelId: string(),
23652
- format: ModelFormatSchema$1
24868
+ format: ModelFormatSchema$2
23653
24869
  }), DownloadModelResultSchema, { kind: "mutation" }), method(object({
23654
24870
  addonId: string(),
23655
24871
  modelId: string(),
23656
- format: ModelFormatSchema$1
24872
+ format: ModelFormatSchema$2
23657
24873
  }), object({ success: literal(true) }), { kind: "mutation" }), method(object({
23658
24874
  steps: array(PipelineStepInputSchema).min(1),
23659
24875
  frame: FrameInputSchema.optional(),
@@ -23719,7 +24935,16 @@ method(_void(), array(PipelineEngineChoiceSchema)), method(_void(), PipelineEngi
23719
24935
  * `device-not-servable`), and nothing reaches the camera's live
23720
24936
  * trace stream. Absent ⇒ unchanged behaviour.
23721
24937
  */
23722
- replay: literal(true).optional()
24938
+ replay: literal(true).optional(),
24939
+ /**
24940
+ * Root-supplied detections for the tree's ROOT step (D730). Set by
24941
+ * `runDetailSubtree` when the camera's root model supplies a crop-kind
24942
+ * step (a Frigate+ `license_plate` for `plate-detection`): the step is
24943
+ * NOT inferred, these boxes are its output, and its children (the plate
24944
+ * reader) run on them through their own crop policy. Boxes are in the
24945
+ * PIXELS of the image this call carries. Absent ⇒ the root step runs.
24946
+ */
24947
+ suppliedRoot: SuppliedRootOutputSchema.optional()
23723
24948
  }), PipelineRunResultBridge, { kind: "mutation" }), method(object({
23724
24949
  steps: array(PipelineStepInputSchema).min(1),
23725
24950
  frames: array(FrameInputSchema).min(1).max(255),
@@ -23801,6 +25026,763 @@ method(_void(), array(PipelineEngineChoiceSchema)), method(_void(), PipelineEngi
23801
25026
  filename: string().optional(),
23802
25027
  settings: record(string(), unknown()).optional()
23803
25028
  }), AudioTestResultSchema, { kind: "mutation" }), method(_void(), ConfigUISchemaNullableBridge);
25029
+ /**
25030
+ * The wire shapes of the Auto tune plan and apply (D745), used by the
25031
+ * `pipeline-orchestrator` cap. The recommender's own types
25032
+ * (`recommend.ts`) are the TS face of the same data; these
25033
+ * schemas are what crosses the cap boundary.
25034
+ */
25035
+ var ModelFormatSchema$1 = _enum(MODEL_FORMATS);
25036
+ /** The operator's range for it. */
25037
+ var MIN_SESSIONS_PER_DEVICE_RANGE = {
25038
+ min: 1,
25039
+ max: 8
25040
+ };
25041
+ var HardwareClassIdSchema = _enum([
25042
+ "intel-core-ultra",
25043
+ "intel-n-series",
25044
+ "apple-m-base",
25045
+ "apple-m-pro",
25046
+ "unknown"
25047
+ ]);
25048
+ var AcceleratorKindSchema = _enum([
25049
+ "intel-npu",
25050
+ "intel-igpu",
25051
+ "x86-cpu",
25052
+ "arm-cpu",
25053
+ "apple-ane",
25054
+ "coral"
25055
+ ]);
25056
+ var RecommendationReasonSchema = discriminatedUnion("kind", [
25057
+ object({
25058
+ kind: literal("capacity"),
25059
+ sessions: number(),
25060
+ minSessions: number()
25061
+ }),
25062
+ object({
25063
+ kind: literal("tie-faster"),
25064
+ over: string(),
25065
+ recallDelta: number()
25066
+ }),
25067
+ object({
25068
+ kind: literal("stepped-down"),
25069
+ from: string(),
25070
+ to: string(),
25071
+ limitedBy: string()
25072
+ }),
25073
+ object({
25074
+ kind: literal("no-fit-lightest"),
25075
+ sessions: number(),
25076
+ minSessions: number()
25077
+ }),
25078
+ object({
25079
+ kind: literal("derived-latency"),
25080
+ modelId: string()
25081
+ }),
25082
+ object({ kind: literal("cpu-device") }),
25083
+ object({ kind: literal("coral-untouched") }),
25084
+ object({ kind: literal("device-disabled") }),
25085
+ object({ kind: literal("device-unavailable") }),
25086
+ object({ kind: literal("node-offline") }),
25087
+ object({ kind: literal("no-hardware-facts") }),
25088
+ object({
25089
+ kind: literal("no-measured-data"),
25090
+ hardwareClass: HardwareClassIdSchema
25091
+ }),
25092
+ object({
25093
+ kind: literal("no-family-build"),
25094
+ format: ModelFormatSchema$1
25095
+ }),
25096
+ object({
25097
+ kind: literal("kept-custom-pin"),
25098
+ modelId: string(),
25099
+ deviceKey: string()
25100
+ })
25101
+ ]);
25102
+ /** Why a device is left exactly as it is, whatever the plan would pick (D786). */
25103
+ var KeptReasonSchema = _enum(["custom-pin"]);
25104
+ /**
25105
+ * Where a choice's latency came from (D791): this node's own benchmark
25106
+ * result, or the hardware-class table. Measured on the node beats the table.
25107
+ */
25108
+ var LatencySourceSchema = discriminatedUnion("kind", [object({ kind: literal("table") }), object({
25109
+ kind: literal("node-benchmark"),
25110
+ resultId: string(),
25111
+ measuredAtMs: number()
25112
+ })]);
25113
+ var DeviceModelChoiceSchema = object({
25114
+ modelId: string(),
25115
+ p50Ms: number(),
25116
+ fps: number(),
25117
+ measured: boolean(),
25118
+ /** Absent on a plan from before D791 — read as the table. */
25119
+ source: LatencySourceSchema.optional(),
25120
+ /** Parallel sessions at the camera rate with the headroom kept free: ⌊fps × (1 − headroom) / camera fps⌋. */
25121
+ capacitySessions: number(),
25122
+ personRecall: number()
25123
+ });
25124
+ var DeviceRecommendationSchema = object({
25125
+ deviceKey: string(),
25126
+ accelerator: AcceleratorKindSchema.nullable(),
25127
+ enabled: boolean(),
25128
+ available: boolean(),
25129
+ chosen: DeviceModelChoiceSchema.nullable(),
25130
+ /** Present when the device is kept as is: Apply writes nothing on it. */
25131
+ kept: KeptReasonSchema.optional(),
25132
+ reasons: array(RecommendationReasonSchema).readonly()
25133
+ });
25134
+ var NodeRecommendationSchema = object({
25135
+ nodeId: string(),
25136
+ reachable: boolean(),
25137
+ hardwareClass: HardwareClassIdSchema.nullable(),
25138
+ cpuModel: string().nullable(),
25139
+ skipped: boolean(),
25140
+ acceleratorModelId: string().nullable(),
25141
+ devices: array(DeviceRecommendationSchema).readonly(),
25142
+ reasons: array(RecommendationReasonSchema).readonly()
25143
+ });
25144
+ var ModelPinChangeSchema = object({
25145
+ stepId: string(),
25146
+ before: string().nullable(),
25147
+ after: string().nullable()
25148
+ });
25149
+ var NodeDeviceChangeSchema = object({
25150
+ nodeId: string(),
25151
+ deviceKey: string(),
25152
+ madeExplicit: boolean(),
25153
+ modelPins: array(ModelPinChangeSchema).readonly(),
25154
+ thresholds: array(object({
25155
+ stepId: string(),
25156
+ keys: array(string()).readonly()
25157
+ })).readonly()
25158
+ });
25159
+ var CameraOverrideClearSchema = object({
25160
+ deviceId: number(),
25161
+ source: _enum(["step-override", "wholesale"]),
25162
+ nodeId: string(),
25163
+ deviceKey: string().nullable(),
25164
+ stepId: string(),
25165
+ modelIdBefore: string().nullable(),
25166
+ keys: array(string()).readonly()
25167
+ });
25168
+ var DetectorStoreClearSchema = object({
25169
+ deviceId: number(),
25170
+ keys: array(string()).readonly()
25171
+ });
25172
+ var AutoTuneWarningSchema = discriminatedUnion("kind", [
25173
+ object({
25174
+ kind: literal("detector-store-cluster-wide"),
25175
+ skippedNodes: array(string()).readonly()
25176
+ }),
25177
+ object({
25178
+ kind: literal("detector-store-unreadable"),
25179
+ error: string()
25180
+ }),
25181
+ object({
25182
+ kind: literal("coral-enabled"),
25183
+ nodeId: string(),
25184
+ deviceKey: string()
25185
+ }),
25186
+ object({
25187
+ kind: literal("custom-pin-kept"),
25188
+ nodeId: string(),
25189
+ deviceKey: string().nullable(),
25190
+ deviceId: number().nullable(),
25191
+ modelId: string()
25192
+ }),
25193
+ object({
25194
+ kind: literal("custom-registry-unreadable"),
25195
+ error: string()
25196
+ })
25197
+ ]);
25198
+ var AutoTuneOptionsSchema = object({
25199
+ /** Share of each accelerator's throughput kept free (0.3–0.5). */
25200
+ headroom: number().min(.3).max(.5).default(.4),
25201
+ /**
25202
+ * The least number of parallel sessions every device must sustain at the
25203
+ * camera rate with the headroom kept free (D755). The most accurate model
25204
+ * that reaches it wins.
25205
+ */
25206
+ minSessionsPerDevice: number().int().min(MIN_SESSIONS_PER_DEVICE_RANGE.min).max(MIN_SESSIONS_PER_DEVICE_RANGE.max).default(2)
25207
+ });
25208
+ var AutoTunePlanSchema = object({
25209
+ /** Hash of everything the apply will write — the apply refuses a different one. */
25210
+ planHash: string(),
25211
+ family: literal("yolov9"),
25212
+ headroom: number(),
25213
+ minSessionsPerDevice: number(),
25214
+ /** The detection rate a session is counted at (the fastest camera running the pipeline root). */
25215
+ cameraFps: number(),
25216
+ generatedAt: number(),
25217
+ nodes: array(NodeRecommendationSchema).readonly(),
25218
+ nodeChanges: array(NodeDeviceChangeSchema).readonly(),
25219
+ cameraClears: array(CameraOverrideClearSchema).readonly(),
25220
+ detectorStoreClears: array(DetectorStoreClearSchema).readonly(),
25221
+ warnings: array(AutoTuneWarningSchema).readonly()
25222
+ });
25223
+ var AutoTuneApplyInputSchema = object({
25224
+ planHash: string(),
25225
+ headroom: number().min(.3).max(.5).default(.4),
25226
+ minSessionsPerDevice: number().int().min(MIN_SESSIONS_PER_DEVICE_RANGE.min).max(MIN_SESSIONS_PER_DEVICE_RANGE.max).default(2)
25227
+ });
25228
+ var AutoTunePhaseResultSchema = object({
25229
+ phase: _enum([
25230
+ "download",
25231
+ "camera-overrides",
25232
+ "detector-thresholds",
25233
+ "node-models",
25234
+ "redispatch"
25235
+ ]),
25236
+ ok: boolean(),
25237
+ detail: string()
25238
+ });
25239
+ var AutoTuneApplyResultSchema = discriminatedUnion("kind", [
25240
+ object({
25241
+ kind: literal("applied"),
25242
+ planHash: string(),
25243
+ phases: array(AutoTunePhaseResultSchema).readonly()
25244
+ }),
25245
+ object({
25246
+ kind: literal("aborted"),
25247
+ phases: array(AutoTunePhaseResultSchema).readonly()
25248
+ }),
25249
+ object({
25250
+ kind: literal("stale"),
25251
+ plan: AutoTunePlanSchema
25252
+ }),
25253
+ object({
25254
+ kind: literal("refused"),
25255
+ reason: _enum(["apply-in-progress"])
25256
+ })
25257
+ ]);
25258
+ /**
25259
+ * Wire shapes of the Load balancing surface (D748): the session placement
25260
+ * policy, the atomic share write, the observed placement statistics, the
25261
+ * hardware share suggestion and the stale device pins.
25262
+ */
25263
+ /**
25264
+ * How a new detection session picks its node and device.
25265
+ * - `least-loaded` — the historical rule: lowest `attached / weight`, a
25266
+ * constant node order at a tie (D37). An idle node always ties at 0, so a
25267
+ * weight only bites once a node already holds a session.
25268
+ * - `share` — the share of PARALLEL sessions is held to the weights, and a
25269
+ * full or drowning node yields to a free one (D748).
25270
+ */
25271
+ var SessionPlacementPolicySchema = _enum(["least-loaded", "share"]);
25272
+ var LoadBalancingSharesInputSchema = object({
25273
+ /** nodeId → share (> 0). A node left out keeps its weight. */
25274
+ nodes: record(string(), number().positive()).default({}),
25275
+ /** nodeId → deviceKey → share (> 0). A device left out keeps its weight. */
25276
+ devices: record(string(), record(string(), number().positive())).default({})
25277
+ });
25278
+ var PlacementStatsInputSchema = object({
25279
+ /** Window the observed shares are averaged over (default 1 h, max 24 h). */
25280
+ windowMs: number().int().min(6e4).max(1440 * 60 * 1e3).default(3600 * 1e3) });
25281
+ var PlacementDeviceStatsSchema = object({
25282
+ deviceKey: string(),
25283
+ /** Sessions running on this device now. */
25284
+ sessionsNow: number(),
25285
+ /** Sessions started on this device inside the window. */
25286
+ sessionsStarted: number(),
25287
+ /** Time-weighted share of the node's parallel sessions over the window (0–1); null = no session ran. */
25288
+ observedShare: number().nullable()
25289
+ });
25290
+ var PlacementNodeStatsSchema = object({
25291
+ nodeId: string(),
25292
+ sessionsNow: number(),
25293
+ sessionsStarted: number(),
25294
+ /** Time-weighted share of the cluster's parallel sessions over the window (0–1); null = none ran. */
25295
+ observedShare: number().nullable(),
25296
+ /** Most sessions this node ran at once inside the window. */
25297
+ peakSessions: number(),
25298
+ /** Sessions a share election handed elsewhere because this node was full or drowning. */
25299
+ yieldsAway: number(),
25300
+ devices: array(PlacementDeviceStatsSchema).readonly()
25301
+ });
25302
+ /** A camera's device pin that the session path cannot honour. */
25303
+ var StaleDevicePinSchema = object({
25304
+ deviceId: number(),
25305
+ deviceKey: string(),
25306
+ /** `disabled` — the key exists on some node but is not enabled anywhere; `absent` — no node has it. */
25307
+ reason: _enum(["disabled", "absent"])
25308
+ });
25309
+ var PlacementStatsSchema = object({
25310
+ policy: SessionPlacementPolicySchema,
25311
+ windowMs: number(),
25312
+ /** How much of the window was actually observed (the hub keeps it in memory). */
25313
+ observedForMs: number(),
25314
+ sessionsNow: number(),
25315
+ /** Most parallel sessions across the cluster inside the window. */
25316
+ clusterPeakSessions: number(),
25317
+ nodes: array(PlacementNodeStatsSchema).readonly(),
25318
+ stalePins: array(StaleDevicePinSchema).readonly()
25319
+ });
25320
+ /**
25321
+ * Where an automatic share's capacity comes from (D755).
25322
+ * - `hardware` — the static capacity of each device at its Auto tune model:
25323
+ * the measured latency table for the node's hardware class.
25324
+ * - `benchmark` — the node's own measured capacity (node benchmark results).
25325
+ * A node with no results falls back to `hardware`, and says so.
25326
+ */
25327
+ var CapacitySourceSchema = _enum(["hardware", "benchmark"]);
25328
+ /** Why a node under the `benchmark` source was sized from hardware instead. */
25329
+ var CapacityFallbackSchema = _enum(["no-benchmark-results", "partial-benchmark-results"]);
25330
+ var SuggestSharesInputSchema = object({
25331
+ headroom: number().min(.3).max(.5).default(.4),
25332
+ /** Default `hardware`. */
25333
+ source: CapacitySourceSchema.default("hardware")
25334
+ });
25335
+ var SuggestedDeviceShareSchema = object({
25336
+ deviceKey: string(),
25337
+ /** Share of the node (0–100, rounded). */
25338
+ share: number(),
25339
+ modelId: string().nullable(),
25340
+ /** Inferences per second at that model, from the measured table; null when sized by a benchmark. */
25341
+ fps: number().nullable(),
25342
+ /** False for a table cell derived from another chip; true for a measured cell or a benchmark. */
25343
+ measured: boolean(),
25344
+ /**
25345
+ * Advisory session cap: ⌊fps × (1 − headroom) / camera fps⌋ from the table,
25346
+ * or the benchmark's measured max sessions. Never enforced.
25347
+ */
25348
+ suggestedMaxSessions: number().nullable()
25349
+ });
25350
+ var SuggestedNodeShareSchema = object({
25351
+ nodeId: string(),
25352
+ /** Share of the cluster (0–100, rounded); null = node skipped (offline, unknown hardware). */
25353
+ share: number().nullable(),
25354
+ /** Parallel sessions the node sustains at the suggested models with the headroom kept free. */
25355
+ capacitySessions: number(),
25356
+ devices: array(SuggestedDeviceShareSchema).readonly(),
25357
+ skippedReason: string().nullable(),
25358
+ /** What this node's capacity was read from; null when the node is skipped. */
25359
+ capacitySource: CapacitySourceSchema.nullable(),
25360
+ /** Set when the `benchmark` source was asked for and this node used `hardware`. */
25361
+ capacityFallback: CapacityFallbackSchema.nullable()
25362
+ });
25363
+ var SuggestSharesResultSchema = object({
25364
+ headroom: number(),
25365
+ /** The source asked for; each node says what it actually used. */
25366
+ source: CapacitySourceSchema,
25367
+ /** Camera detection rate the capacity is counted in (the fastest camera's fps). */
25368
+ cameraFps: number(),
25369
+ /** The Auto tune capacity floor the models were picked at. */
25370
+ minSessionsPerDevice: number(),
25371
+ nodes: array(SuggestedNodeShareSchema).readonly()
25372
+ });
25373
+ /**
25374
+ * Where the node and device shares come from (D750, D755, D791).
25375
+ * - `benchmark` (default since D791) — each node's capacity as its own node
25376
+ * benchmark measured it; a node without fresh results is sized from
25377
+ * `hardware` and says so. Measured on the node beats the table.
25378
+ * - `hardware` — computed from each node's static capacity only (its
25379
+ * accelerators at their Auto tune models, from the latency table).
25380
+ * Both are recomputed whenever a node or device joins, leaves, is switched
25381
+ * on or off, changes model, or a benchmark result is written. No load input.
25382
+ * - `manual` — the operator's stored sliders.
25383
+ * Either way a node or device that cannot take sessions gives its share to
25384
+ * the others in proportion; the stored values are never rewritten for that.
25385
+ */
25386
+ var ShareSourceSchema = _enum([
25387
+ "hardware",
25388
+ "benchmark",
25389
+ "manual"
25390
+ ]);
25391
+ var SetShareSourceInputSchema = object({ source: ShareSourceSchema });
25392
+ object({
25393
+ nodes: record(string(), number()),
25394
+ devices: record(string(), record(string(), number()))
25395
+ });
25396
+ var EffectiveDeviceShareSchema = object({
25397
+ deviceKey: string(),
25398
+ /** Can take sessions now (enabled, available, can run the root). */
25399
+ eligible: boolean(),
25400
+ /** The share the source assigns, as a percentage of the node's devices. */
25401
+ configuredPct: number(),
25402
+ /** The share actually used, after an ineligible device's share went to the others. */
25403
+ effectivePct: number()
25404
+ });
25405
+ var EffectiveNodeShareSchema = object({
25406
+ nodeId: string(),
25407
+ eligible: boolean(),
25408
+ configuredPct: number(),
25409
+ effectivePct: number(),
25410
+ /** Automatic sources: what this node's share was computed from; null under `manual` or before the first answer. */
25411
+ capacitySource: CapacitySourceSchema.nullable(),
25412
+ /** Automatic `benchmark`: why this node used `hardware` instead. */
25413
+ capacityFallback: CapacityFallbackSchema.nullable(),
25414
+ devices: array(EffectiveDeviceShareSchema).readonly()
25415
+ });
25416
+ var EffectiveSharesSchema = object({
25417
+ source: ShareSourceSchema,
25418
+ policy: SessionPlacementPolicySchema,
25419
+ /** An automatic source with no computed answer yet: the stored sliders are used meanwhile. */
25420
+ autoPending: boolean(),
25421
+ /** When the automatic shares were last computed (ms epoch); null = never. */
25422
+ computedAt: number().nullable(),
25423
+ /** What made the system recompute them last. */
25424
+ trigger: string().nullable(),
25425
+ nodes: array(EffectiveNodeShareSchema).readonly(),
25426
+ /** The relative weights the election reads (before eligibility). */
25427
+ nodeWeights: record(string(), number()),
25428
+ deviceWeights: record(string(), record(string(), number()))
25429
+ });
25430
+ /**
25431
+ * Wire shapes of the node benchmark (D791): the operator's plan, the
25432
+ * preflight the confirmation shows, the run the orchestrator owns, what the
25433
+ * measuring runner reports, and the result rows Auto tune and the automatic
25434
+ * shares read.
25435
+ *
25436
+ * ONE node at a time, owned by the pipeline orchestrator. While a run is
25437
+ * active the cluster is in BENCHMARK MODE for that node: it is not a
25438
+ * detection candidate, camera pins naming it are ignored so its sessions move
25439
+ * elsewhere, and both come back when the mode ends — after a crash or a hub
25440
+ * restart too (a persisted manifest, reconciled against the registry).
25441
+ *
25442
+ * Two measurements, both on the node, driven by its own runner (frames never
25443
+ * cross a process at frame rate, D9):
25444
+ * - `device` — one accelerator × one candidate detector, root only, open
25445
+ * loop: how many streams at the camera rate it carries inside the frame
25446
+ * interval;
25447
+ * - `pipeline` — the chosen detector plus the operator's detail steps
25448
+ * (faces, plates, classifiers, CLIP…), on varied frames from the bench
25449
+ * clip: how many parallel sessions the node carries before latency, drops,
25450
+ * CPU, RAM or the event loop give out.
25451
+ */
25452
+ /** Defaults and bounds, one place. */
25453
+ var NODE_BENCHMARK_DEFAULTS = {
25454
+ fpsPerStream: 10,
25455
+ budgetMinutes: 45,
25456
+ minBudgetMinutes: 10,
25457
+ maxBudgetMinutes: 120,
25458
+ /** A result older than this no longer beats the table. */
25459
+ staleAfterDays: 30,
25460
+ /** Warm-in per ramp step (not accounted). */
25461
+ settleSec: 5,
25462
+ /** Accounted window per ramp step. */
25463
+ measureSec: 20,
25464
+ /** Longest the drain may take before the run is refused. */
25465
+ drainTimeoutSec: 120,
25466
+ /** Candidate models per device in one run. */
25467
+ maxModelsPerDevice: 6
25468
+ };
25469
+ /** The two measurements a run can make. */
25470
+ var NodeBenchmarkPhaseSchema = _enum(["device", "pipeline"]);
25471
+ var NodeBenchmarkDevicePlanSchema = object({
25472
+ /** `<backend>:<device>` — `openvino:npu`, `coreml:all`, `cpu`. */
25473
+ deviceKey: string().min(1),
25474
+ /**
25475
+ * Root detector candidates for the `device` measurement, in the order
25476
+ * measured. The FIRST is the one the `pipeline` measurement runs.
25477
+ */
25478
+ modelIds: array(string().min(1)).min(1).max(NODE_BENCHMARK_DEFAULTS.maxModelsPerDevice)
25479
+ });
25480
+ /** What the operator confirmed. */
25481
+ var NodeBenchmarkPlanSchema = object({
25482
+ nodeId: string().min(1),
25483
+ devices: array(NodeBenchmarkDevicePlanSchema).min(1),
25484
+ /** Which measurements run. At least one. */
25485
+ phases: array(NodeBenchmarkPhaseSchema).min(1).default(["device", "pipeline"]),
25486
+ /**
25487
+ * Detail steps (catalog step ids under the root: faces, plates,
25488
+ * classifiers, CLIP…) the `pipeline` measurement enables. The root
25489
+ * detector always runs.
25490
+ */
25491
+ steps: array(string().min(1)).default([]),
25492
+ /** Offered rate of one stream / session. */
25493
+ fpsPerStream: number().int().min(1).max(30).default(NODE_BENCHMARK_DEFAULTS.fpsPerStream),
25494
+ /** Hard deadline: the mode ends and the cluster is restored when it passes. */
25495
+ budgetMinutes: number().int().min(NODE_BENCHMARK_DEFAULTS.minBudgetMinutes).max(NODE_BENCHMARK_DEFAULTS.maxBudgetMinutes).default(NODE_BENCHMARK_DEFAULTS.budgetMinutes),
25496
+ /** Keep the models the run downloaded (default: delete what was not installed before). */
25497
+ keepDownloadedModels: boolean().default(false),
25498
+ /** Start although the other nodes' capacity does not cover the sessions running now. */
25499
+ acceptInsufficientHeadroom: boolean().default(false)
25500
+ });
25501
+ var NodeBenchmarkRefusalSchema = object({
25502
+ kind: _enum([
25503
+ "benchmark-active",
25504
+ "node-offline",
25505
+ "unknown-device",
25506
+ "no-phase",
25507
+ "insufficient-headroom"
25508
+ ]),
25509
+ detail: string(),
25510
+ overridable: boolean()
25511
+ });
25512
+ /** A camera whose detection leaves the node for the run. */
25513
+ var NodeBenchmarkMovingCameraSchema = object({
25514
+ deviceId: number(),
25515
+ /** Placed on the node now (a standing attach or a running session). */
25516
+ placedOnNode: boolean(),
25517
+ /** A node pin naming this node, ignored for the run. */
25518
+ pinnedToNode: boolean()
25519
+ });
25520
+ /** A camera that cannot leave: no other node can obtain its frames. */
25521
+ var NodeBenchmarkStayingCameraSchema = object({
25522
+ deviceId: number(),
25523
+ reason: literal("only-frame-source")
25524
+ });
25525
+ var NodeBenchmarkPreflightSchema = object({
25526
+ nodeId: string(),
25527
+ online: boolean(),
25528
+ moving: array(NodeBenchmarkMovingCameraSchema).readonly(),
25529
+ /** Keep running on the node during the run; the result is flagged contaminated. */
25530
+ staying: array(NodeBenchmarkStayingCameraSchema).readonly(),
25531
+ estimatedDurationMs: number(),
25532
+ /** The run ends and the cluster is restored at the latest after this long. */
25533
+ budgetMs: number(),
25534
+ phases: array(NodeBenchmarkPhaseSchema).readonly(),
25535
+ steps: array(string()).readonly(),
25536
+ devices: array(NodeBenchmarkDevicePlanSchema).readonly(),
25537
+ /** Parallel sessions the cluster runs now, and what the other nodes can carry. */
25538
+ headroom: object({
25539
+ sessionsNow: number(),
25540
+ otherNodesCapacitySessions: number().nullable()
25541
+ }),
25542
+ refusals: array(NodeBenchmarkRefusalSchema).readonly(),
25543
+ canStart: boolean()
25544
+ });
25545
+ /** Where the measuring runner is. */
25546
+ var NodeBenchProgressSchema = object({
25547
+ phase: _enum([
25548
+ "preparing",
25549
+ "device",
25550
+ "pipeline",
25551
+ "cleanup"
25552
+ ]),
25553
+ deviceKey: string().nullable(),
25554
+ modelId: string().nullable(),
25555
+ /** Streams (device) or sessions (pipeline) of the step running now. */
25556
+ load: number().nullable(),
25557
+ cellsDone: number(),
25558
+ cellsTotal: number(),
25559
+ message: string()
25560
+ });
25561
+ /** What limited a ramp. `none` = the ramp ran out of steps still passing. */
25562
+ var NodeBenchLimitSchema = _enum([
25563
+ "p95",
25564
+ "drops",
25565
+ "errors",
25566
+ "stall",
25567
+ "cpu",
25568
+ "ram",
25569
+ "none"
25570
+ ]);
25571
+ var NodeBenchRampStepSchema = object({
25572
+ load: number(),
25573
+ pass: boolean(),
25574
+ p95Ms: number(),
25575
+ dropRatio: number(),
25576
+ /** Completed frames per second over the accounted window. */
25577
+ fps: number(),
25578
+ cpuPct: number().nullable(),
25579
+ ramFreePct: number().nullable(),
25580
+ failReasons: array(string()).readonly()
25581
+ });
25582
+ var NodeBenchCellSchema = discriminatedUnion("phase", [object({
25583
+ phase: literal("device"),
25584
+ deviceKey: string(),
25585
+ modelId: string(),
25586
+ /** Single-stream latency (the K = 1 step). */
25587
+ p50Ms: number(),
25588
+ p95Ms: number(),
25589
+ p99Ms: number(),
25590
+ /** Frames per second sustained at the last passing step. */
25591
+ fps: number(),
25592
+ /** Streams at the camera rate the device carried inside the frame interval; 0 = not even one. */
25593
+ kMax: number(),
25594
+ limitedBy: NodeBenchLimitSchema,
25595
+ /** First call (model load + warm-up). */
25596
+ warmupMs: number(),
25597
+ ramp: array(NodeBenchRampStepSchema).readonly()
25598
+ }), object({
25599
+ phase: literal("pipeline"),
25600
+ deviceKey: string(),
25601
+ modelId: string(),
25602
+ steps: array(string()).readonly(),
25603
+ /** Parallel sessions at the camera rate the node carried; 0 = not even one. */
25604
+ maxSessions: number(),
25605
+ limitedBy: NodeBenchLimitSchema,
25606
+ /** Detail steps that produced at least one result on the clip — a step that never fired measured nothing. */
25607
+ stepsFired: array(string()).readonly(),
25608
+ warmupMs: number(),
25609
+ ramp: array(NodeBenchRampStepSchema).readonly()
25610
+ })]);
25611
+ /**
25612
+ * What a result was measured ON. A result whose fingerprint no longer matches
25613
+ * the node no longer beats the table.
25614
+ */
25615
+ var NodeBenchFingerprintSchema = object({
25616
+ pipelineVersion: string().nullable(),
25617
+ cpuModel: string().nullable(),
25618
+ ramGb: number().nullable(),
25619
+ os: string().nullable(),
25620
+ /** Per device: the pool the cells ran on (runtime + tuning). */
25621
+ pools: record(string(), object({
25622
+ runtime: string(),
25623
+ numWorkers: number(),
25624
+ concurrency: number(),
25625
+ batchMode: string()
25626
+ })).default({})
25627
+ });
25628
+ /** The frames the run used. */
25629
+ var NodeBenchClipSchema = object({
25630
+ /** `camstack-bench-v1` or `reference-images` (the fallback when the clip is not reachable). */
25631
+ id: string(),
25632
+ revision: string().nullable(),
25633
+ frames: number(),
25634
+ width: number(),
25635
+ height: number()
25636
+ });
25637
+ var NodeBenchRunnerInputSchema = object({
25638
+ runId: string().min(1),
25639
+ devices: array(NodeBenchmarkDevicePlanSchema).min(1),
25640
+ phases: array(NodeBenchmarkPhaseSchema).min(1),
25641
+ /** The full detail step tree root for the `pipeline` measurement is built on the node from these ids. */
25642
+ steps: array(string()).default([]),
25643
+ fpsPerStream: number().int().min(1).max(30),
25644
+ /** The runner stops on its own past this instant, whatever the hub does. */
25645
+ deadlineAtMs: number(),
25646
+ settleSec: number().min(0).max(60).default(NODE_BENCHMARK_DEFAULTS.settleSec),
25647
+ measureSec: number().min(2).max(300).default(NODE_BENCHMARK_DEFAULTS.measureSec),
25648
+ keepDownloadedModels: boolean().default(false)
25649
+ });
25650
+ var NodeBenchRunnerStateSchema = _enum([
25651
+ "running",
25652
+ "done",
25653
+ "failed",
25654
+ "aborted"
25655
+ ]);
25656
+ var NodeBenchRunnerStatusSchema = object({
25657
+ runId: string(),
25658
+ nodeId: string(),
25659
+ state: NodeBenchRunnerStateSchema,
25660
+ progress: NodeBenchProgressSchema.nullable(),
25661
+ /** Every finished cell so far — a run stopped half way keeps what it measured. */
25662
+ cells: array(NodeBenchCellSchema).readonly(),
25663
+ fingerprint: NodeBenchFingerprintSchema.nullable(),
25664
+ clip: NodeBenchClipSchema.nullable(),
25665
+ /** Cameras seen running on the node during the run (they share its pools). */
25666
+ activeCameraIds: array(number()).readonly(),
25667
+ /** Models the run downloaded and then deleted (not installed before). */
25668
+ deletedModels: array(string()).readonly(),
25669
+ error: string().nullable(),
25670
+ startedAtMs: number(),
25671
+ finishedAtMs: number().nullable()
25672
+ });
25673
+ var NodeBenchmarkStateSchema = _enum([
25674
+ "draining",
25675
+ "measuring",
25676
+ "restoring",
25677
+ "done",
25678
+ "failed",
25679
+ "aborted"
25680
+ ]);
25681
+ /** Why a run ended. */
25682
+ var NodeBenchmarkEndReasonSchema = _enum([
25683
+ "completed",
25684
+ "operator-abort",
25685
+ "deadline",
25686
+ "node-lost",
25687
+ "runner-lost",
25688
+ "hub-restart",
25689
+ "drain-timeout",
25690
+ "failed"
25691
+ ]);
25692
+ var NodeBenchmarkRunSchema = object({
25693
+ runId: string(),
25694
+ nodeId: string(),
25695
+ state: NodeBenchmarkStateSchema,
25696
+ plan: NodeBenchmarkPlanSchema,
25697
+ startedAtMs: number(),
25698
+ deadlineAtMs: number(),
25699
+ finishedAtMs: number().nullable(),
25700
+ endReason: NodeBenchmarkEndReasonSchema.nullable(),
25701
+ error: string().nullable(),
25702
+ /** Cameras moved off the node for the run. */
25703
+ moved: array(number()).readonly(),
25704
+ /** Cameras that stayed (their only frame source is the node). */
25705
+ staying: array(number()).readonly(),
25706
+ /** Something else ran on the node's pools during the run. */
25707
+ contaminated: boolean(),
25708
+ progress: NodeBenchProgressSchema.nullable(),
25709
+ resultIds: array(string()).readonly()
25710
+ });
25711
+ /** `getNodeBenchmarkStatus`: the active run (or the last one), and whether benchmark mode is on. */
25712
+ var NodeBenchmarkStatusSchema = object({
25713
+ /** The node the cluster is in benchmark mode for; null = none. */
25714
+ modeNodeId: string().nullable(),
25715
+ run: NodeBenchmarkRunSchema.nullable()
25716
+ });
25717
+ /**
25718
+ * One stored measurement — the only authority Auto tune and the automatic
25719
+ * shares read measured capacity from. Written by the orchestrator when a run
25720
+ * ends, never by anyone else.
25721
+ */
25722
+ var NodeBenchmarkResultSchema = object({
25723
+ id: string(),
25724
+ runId: string(),
25725
+ nodeId: string(),
25726
+ cell: NodeBenchCellSchema,
25727
+ fpsPerStream: number(),
25728
+ fingerprint: NodeBenchFingerprintSchema.nullable(),
25729
+ clip: NodeBenchClipSchema.nullable(),
25730
+ /** Other work shared the node's pools (a camera that could not move, or the hub's own duties). */
25731
+ contaminated: boolean(),
25732
+ stayingCameras: array(number()).readonly(),
25733
+ /** The run ended early; the cell itself completed. */
25734
+ partialRun: boolean(),
25735
+ measuredAtMs: number()
25736
+ });
25737
+ var ListNodeBenchmarkResultsInputSchema = object({
25738
+ nodeId: string().optional(),
25739
+ deviceKey: string().optional()
25740
+ });
25741
+ /** A result with its standing today: does it still beat the table? */
25742
+ var NodeBenchmarkResultViewSchema = NodeBenchmarkResultSchema.extend({
25743
+ /** `fresh` beats the table; `stale` falls back to it; `superseded` = a newer row covers the same cell. */
25744
+ standing: _enum([
25745
+ "fresh",
25746
+ "stale",
25747
+ "superseded"
25748
+ ]),
25749
+ staleWhy: _enum([
25750
+ "age",
25751
+ "runtime",
25752
+ "pool-tuning"
25753
+ ]).nullable()
25754
+ });
25755
+ object({
25756
+ runId: string(),
25757
+ nodeId: string(),
25758
+ startedAtMs: number(),
25759
+ deadlineAtMs: number(),
25760
+ plan: NodeBenchmarkPlanSchema,
25761
+ moved: array(number()).readonly(),
25762
+ staying: array(number()).readonly()
25763
+ });
25764
+ /** Candidate detectors per device, for the plan editor. */
25765
+ var NodeBenchmarkCandidatesSchema = object({
25766
+ nodeId: string(),
25767
+ reachable: boolean(),
25768
+ devices: array(object({
25769
+ deviceKey: string(),
25770
+ enabled: boolean(),
25771
+ available: boolean(),
25772
+ /** Ordered: what Auto tune would pick first, then the rest of the family by accuracy. */
25773
+ suggested: array(string()).readonly(),
25774
+ /** Every root detector the device has a build for. */
25775
+ all: array(string()).readonly(),
25776
+ /** The model the device runs now, when pinned. */
25777
+ currentModelId: string().nullable()
25778
+ })).readonly(),
25779
+ /** Detail steps the node's catalog offers under the root (for the `pipeline` measurement). */
25780
+ steps: array(object({
25781
+ id: string(),
25782
+ name: string(),
25783
+ slot: string()
25784
+ })).readonly()
25785
+ });
23804
25786
  object({
23805
25787
  activeCameras: number(),
23806
25788
  throttledCameras: number(),
@@ -24718,14 +26700,15 @@ var RunnerLocalLoadSchema = object({
24718
26700
  * Per-inference-device live load (multi-device C4). One entry per deviceKey
24719
26701
  * this runner currently has attached cameras on, so the orchestrator's second
24720
26702
  * `balance()` pass (over a node's devices) weights on real per-pool session
24721
- * counts. Empty on single-device / pre-multi-device runners. `queueDepthTotal`
24722
- * per device is 0 until the pool backlog gets a public accessor (follow-up).
26703
+ * counts. Empty on single-device / pre-multi-device runners. There is no
26704
+ * per-device queue depth: the inference pool's backlog has no accessor, and
26705
+ * a field that always read 0 was removed rather than shown as a measurement
26706
+ * (D762).
24723
26707
  */
24724
26708
  devices: array(object({
24725
26709
  deviceKey: string(),
24726
26710
  backend: string(),
24727
- attachedCameras: number(),
24728
- queueDepthTotal: number()
26711
+ attachedCameras: number()
24729
26712
  })).default([]),
24730
26713
  /** Hardware capability flags reported by this node. */
24731
26714
  hardware: object({
@@ -24861,7 +26844,22 @@ method(RunnerCameraConfigSchema, object({ success: literal(true) }), { kind: "mu
24861
26844
  */
24862
26845
  cropJpeg: string().optional(),
24863
26846
  parent: DetailParentSchema,
24864
- steps: array(string()).optional()
26847
+ steps: array(string()).optional(),
26848
+ /**
26849
+ * The camera's root model already drew this step's boxes (D730): a
26850
+ * `license_plate` inside the parent vehicle. The named step is NOT
26851
+ * inferred — these FRAME-space boxes are its output — and its
26852
+ * requested children (the plate reader) run on them. Absent ⇒ every
26853
+ * requested step infers as before.
26854
+ */
26855
+ supplied: object({
26856
+ stepId: string(),
26857
+ modelId: string(),
26858
+ boxes: array(object({
26859
+ bbox: NativeCropBboxSchema,
26860
+ score: number()
26861
+ })).min(1)
26862
+ }).optional()
24865
26863
  }), object({ details: array(DetailResultSchema) }).nullable(), { kind: "mutation" }), method(object({
24866
26864
  /** Catalog step id, e.g. `clip-embedding`. */
24867
26865
  stepId: string(),
@@ -24913,7 +26911,16 @@ method(RunnerCameraConfigSchema, object({ success: literal(true) }), { kind: "mu
24913
26911
  }), ParkedTrackFrameSchema.nullable()), method(object({
24914
26912
  deviceId: number(),
24915
26913
  trackId: string()
24916
- }), object({ released: number().int().nonnegative() }), { kind: "mutation" });
26914
+ }), object({ released: number().int().nonnegative() }), { kind: "mutation" }), method(NodeBenchRunnerInputSchema, object({
26915
+ accepted: literal(true),
26916
+ runId: string()
26917
+ }), {
26918
+ kind: "mutation",
26919
+ auth: "admin"
26920
+ }), method(object({ runId: string() }), NodeBenchRunnerStatusSchema.nullable(), { auth: "admin" }), method(object({ runId: string() }), object({ aborted: boolean() }), {
26921
+ kind: "mutation",
26922
+ auth: "admin"
26923
+ });
24917
26924
  var CameraPipelineConfigSchema = object({
24918
26925
  engine: PipelineEngineChoiceSchema.optional(),
24919
26926
  steps: array(PipelineStepInputSchema).readonly(),
@@ -24924,14 +26931,6 @@ var CameraPipelineConfigSchema = object({
24924
26931
  settings: record(string(), unknown()).readonly().optional()
24925
26932
  }).nullable().optional()
24926
26933
  });
24927
- var PipelineTemplateSchema = object({
24928
- id: string(),
24929
- name: string(),
24930
- description: string().optional(),
24931
- config: CameraPipelineConfigSchema,
24932
- createdAt: string(),
24933
- updatedAt: string()
24934
- });
24935
26934
  var DeviceStepConfigSchema = object({
24936
26935
  modelId: string().optional(),
24937
26936
  settings: record(string(), unknown()).optional(),
@@ -25005,9 +27004,10 @@ var CameraStepOverridePatchSchema = object({
25005
27004
  modelId: string().optional(),
25006
27005
  settings: record(string(), unknown()).readonly().optional()
25007
27006
  });
27007
+ var CameraStepSettingsSchema = record(string(), record(string(), unknown()).readonly());
25008
27008
  var CameraPipelineSettingsSchema = object({
25009
- pinnedAgentNodeId: string().optional(),
25010
27009
  stepToggles: record(string(), boolean()).optional(),
27010
+ stepSettings: CameraStepSettingsSchema.optional(),
25011
27011
  stepOverridesByDevice: record(string(), record(string(), record(string(), CameraStepOverridePatchSchema))).optional(),
25012
27012
  pipelineByAgent: record(string(), CameraPipelineForAgentSchema).optional()
25013
27013
  });
@@ -25040,7 +27040,10 @@ var PipelineAssignmentSchema = object({
25040
27040
  });
25041
27041
  /**
25042
27042
  * Per-agent load summary surfaced to the load balancer + dashboards.
25043
- * Aggregated from each runner's `getLocalLoad` cap call.
27043
+ * Aggregated from each runner's `getLocalLoad` cap call. In the
27044
+ * `getAgentLoad` report, a single-device node's default-pool sessions (no
27045
+ * `deviceKey`) are credited to its one eligible device in `load.devices` —
27046
+ * the default pool IS that device (D745); the balancer's census stays raw.
25044
27047
  */
25045
27048
  var AgentLoadSummarySchema = object({
25046
27049
  nodeId: string(),
@@ -25129,26 +27132,27 @@ var CameraBrokerStatusSchema = object({
25129
27132
  width: number(),
25130
27133
  height: number(),
25131
27134
  subscribers: number(),
25132
- inFps: number(),
25133
- outFps: number()
27135
+ /**
27136
+ * Encoded packets/s the broker receives from the camera. null when the
27137
+ * broker's stats read failed — unknown, never 0 (a 0 here reads as a stall).
27138
+ * There is no output rate: decoding runs in the session decode workers, not
27139
+ * in the broker, so the broker's own decoded-frame rate is 0 on every live
27140
+ * camera and is not served (D758).
27141
+ */
27142
+ inFps: number().nullable()
25134
27143
  })).readonly(),
25135
27144
  webrtcSessions: number(),
25136
27145
  rtspRestream: boolean()
25137
27146
  });
25138
- /** Shared-memory ring statistics within the decoder block. */
25139
- var CameraDecoderShmSchema = object({
25140
- framesWritten: number(),
25141
- getFrameHits: number(),
25142
- getFrameMisses: number(),
25143
- budgetMb: number()
25144
- });
25145
- /** Decoder block — null when the decoder stage is unreachable or inactive. */
25146
- var CameraDecoderStatusSchema = object({
25147
- nodeId: string(),
25148
- formats: array(string()).readonly(),
25149
- sessionCount: number(),
25150
- shm: CameraDecoderShmSchema
25151
- });
27147
+ /**
27148
+ * Decoder block — WHERE decode runs (co-located with the detection node by
27149
+ * construction); null when the camera has no detection node. It carries no
27150
+ * frame counter: the shared-memory plane whose counters it used to serve is
27151
+ * gone, and those fields read 0 forever. Whether frames actually flow is read
27152
+ * from `detection.actualFps` (frames delivered to and processed by the
27153
+ * detector), never from a counter nothing feeds.
27154
+ */
27155
+ var CameraDecoderStatusSchema = object({ nodeId: string() });
25152
27156
  /** Motion block — null when motion detection is not active for this device. */
25153
27157
  var CameraMotionStatusSchema = object({
25154
27158
  enabled: boolean(),
@@ -25505,12 +27509,6 @@ method(object({
25505
27509
  }), object({ success: literal(true) }), {
25506
27510
  kind: "mutation",
25507
27511
  auth: "admin"
25508
- }), method(object({
25509
- agentNodeId: string(),
25510
- detectWeight: number().positive().nullable()
25511
- }), object({ success: literal(true) }), {
25512
- kind: "mutation",
25513
- auth: "admin"
25514
27512
  }), method(object({
25515
27513
  agentNodeId: string(),
25516
27514
  detect: boolean().nullable().optional(),
@@ -25552,6 +27550,30 @@ method(object({
25552
27550
  }), {
25553
27551
  kind: "mutation",
25554
27552
  auth: "admin"
27553
+ }), method(AutoTuneOptionsSchema, AutoTunePlanSchema, { auth: "admin" }), method(AutoTuneApplyInputSchema, AutoTuneApplyResultSchema, {
27554
+ kind: "mutation",
27555
+ auth: "admin"
27556
+ }), method(LoadBalancingSharesInputSchema, object({ success: literal(true) }), {
27557
+ kind: "mutation",
27558
+ auth: "admin"
27559
+ }), method(PlacementStatsInputSchema, PlacementStatsSchema, { auth: "admin" }), method(SuggestSharesInputSchema, SuggestSharesResultSchema, { auth: "admin" }), method(_void(), EffectiveSharesSchema, { auth: "admin" }), method(SetShareSourceInputSchema, object({ success: literal(true) }), {
27560
+ kind: "mutation",
27561
+ auth: "admin"
27562
+ }), method(NodeBenchmarkPlanSchema, NodeBenchmarkPreflightSchema, { auth: "admin" }), method(NodeBenchmarkPlanSchema, discriminatedUnion("kind", [object({
27563
+ kind: literal("started"),
27564
+ runId: string()
27565
+ }), object({
27566
+ kind: literal("refused"),
27567
+ preflight: NodeBenchmarkPreflightSchema
27568
+ })]), {
27569
+ kind: "mutation",
27570
+ auth: "admin"
27571
+ }), method(_void(), NodeBenchmarkStatusSchema, { auth: "admin" }), method(object({ runId: string() }), object({ aborted: boolean() }), {
27572
+ kind: "mutation",
27573
+ auth: "admin"
27574
+ }), method(object({ nodeId: string() }), NodeBenchmarkCandidatesSchema, { auth: "admin" }), method(ListNodeBenchmarkResultsInputSchema, array(NodeBenchmarkResultViewSchema).readonly(), { auth: "admin" }), method(object({ id: string() }), object({ deleted: boolean() }), {
27575
+ kind: "mutation",
27576
+ auth: "admin"
25555
27577
  }), method(object({ deviceId: number() }), CameraPipelineSettingsSchema.nullable()), method(object({
25556
27578
  deviceId: number(),
25557
27579
  addonId: string(),
@@ -25568,6 +27590,13 @@ method(object({
25568
27590
  }), object({ success: literal(true) }), {
25569
27591
  kind: "mutation",
25570
27592
  auth: "admin"
27593
+ }), method(object({
27594
+ deviceId: number(),
27595
+ addonId: string(),
27596
+ settings: record(string(), unknown()).nullable()
27597
+ }), object({ success: literal(true) }), {
27598
+ kind: "mutation",
27599
+ auth: "admin"
25571
27600
  }), method(object({
25572
27601
  deviceId: number(),
25573
27602
  agentNodeId: string(),
@@ -25591,25 +27620,7 @@ method(object({
25591
27620
  }), method(_void(), DiskReconcileJobSchema, {
25592
27621
  kind: "mutation",
25593
27622
  auth: "admin"
25594
- }), method(_void(), DiskReconcileJobSchema, { auth: "admin" }), method(_void(), array(PipelineTemplateSchema).readonly()), method(object({
25595
- name: string(),
25596
- description: string().optional(),
25597
- config: CameraPipelineConfigSchema
25598
- }), PipelineTemplateSchema, {
25599
- kind: "mutation",
25600
- auth: "admin"
25601
- }), method(object({
25602
- id: string(),
25603
- name: string().optional(),
25604
- description: string().optional(),
25605
- config: CameraPipelineConfigSchema.optional()
25606
- }), PipelineTemplateSchema, {
25607
- kind: "mutation",
25608
- auth: "admin"
25609
- }), method(object({ id: string() }), object({ success: literal(true) }), {
25610
- kind: "mutation",
25611
- auth: "admin"
25612
- });
27623
+ }), method(_void(), DiskReconcileJobSchema, { auth: "admin" });
25613
27624
  /**
25614
27625
  * Cap → event-kind mapping for the SENSOR / CONTROL cap families — the table
25615
27626
  * `pipeline-analytics.listEventKinds` uses to turn a linked device's bound
@@ -26303,7 +28314,19 @@ var SsoBridgeClaimsSchema = object({
26303
28314
  * editing a descriptor must not retroactively extend or shorten a link the
26304
28315
  * operator already consented to.
26305
28316
  */
26306
- refreshTtl: union([number().int().positive(), literal("never")]).optional()
28317
+ refreshTtl: union([number().int().positive(), literal("never")]).optional(),
28318
+ /**
28319
+ * Opaque handle of a hub-side LINK intent (D782). Set by an OIDC callback
28320
+ * that was started from a signed-in user's "Link" button: the finish then
28321
+ * links this identity to the intent's user instead of signing anyone in.
28322
+ * The handle carries no user id — the hub resolves it, single-use.
28323
+ */
28324
+ linkIntent: string().optional(),
28325
+ /**
28326
+ * Verified `iss` of the id_token behind an OIDC login bridge (D782). A
28327
+ * subject is unique only per issuer, so a link is bound to it.
28328
+ */
28329
+ issuer: string().optional()
26307
28330
  });
26308
28331
  method(object({
26309
28332
  claims: SsoBridgeClaimsSchema,
@@ -27962,8 +29985,6 @@ var WebrtcStreamChoiceSchema = object({
27962
29985
  ]).nullable(),
27963
29986
  /** Input FPS from the camera (null for adaptive). */
27964
29987
  inputFps: number().nullable(),
27965
- /** Decoded FPS (null for adaptive). */
27966
- decodeFps: number().nullable(),
27967
29988
  /** Bitrate in kbps (null for adaptive). */
27968
29989
  bitrateKbps: number().nullable()
27969
29990
  });
@@ -28240,7 +30261,22 @@ DeviceType.Camera, method(object({ deviceId: number().int().nonnegative() }), ar
28240
30261
  * field their hints were silently stripped by the schema and the
28241
30262
  * adaptive ladder started blind on the client's display size.
28242
30263
  */
28243
- hints: webrtcClientHintsSchema.optional()
30264
+ hints: webrtcClientHintsSchema.optional(),
30265
+ /**
30266
+ * Talk-back (D771): relay the PEER's audio to the device's speaker
30267
+ * through the `intercom` cap's push-talk triple. When `true` and the
30268
+ * offer lets the peer send audio, the answer's audio is `sendrecv`
30269
+ * and every inbound frame goes to `intercom.pushTalkAudio` for this
30270
+ * `deviceId`; absent/false answers `sendonly`, as for every viewer.
30271
+ *
30272
+ * TRUSTED-CALLER ONLY. Set by the Alexa export for an Echo on a camera
30273
+ * with `intercom`, when the linked user may control that camera. The
30274
+ * hub STRIPS it from every request-bound call (a browser), exactly as
30275
+ * it overwrites `relayOnly` — a viewer's talk permission is the
30276
+ * intercom cap's own surface (share tokens gate it there), and this
30277
+ * flag must not become a second door to the camera's speaker.
30278
+ */
30279
+ talkback: boolean().optional()
28244
30280
  }), object({
28245
30281
  sessionId: string(),
28246
30282
  sdpAnswer: string()
@@ -28295,6 +30331,14 @@ DeviceType.Camera, method(object({ deviceId: number().int().nonnegative() }), ar
28295
30331
  */
28296
30332
  alive: boolean()
28297
30333
  })), method(object({
30334
+ deviceId: number().int().nonnegative(),
30335
+ sessionId: string(),
30336
+ downlinkMbps: number().nonnegative()
30337
+ }), object({
30338
+ outcome: _enum(["switching", "held"]),
30339
+ tier: CamProfileSchema.nullable(),
30340
+ reason: string()
30341
+ }), { kind: "mutation" }), method(object({
28298
30342
  deviceId: number().int().nonnegative(),
28299
30343
  sessionId: string()
28300
30344
  }), WebrtcSessionDebugSchema, { kind: "query" });
@@ -28534,6 +30578,59 @@ var AddonAutoUpdateSchema = ChannelWithInheritSchema;
28534
30578
  var RestartAddonResultSchema = unknown();
28535
30579
  var InstallPackageResultSchema = unknown();
28536
30580
  var ReloadPackagesResultSchema = unknown();
30581
+ /**
30582
+ * What an uninstall did on ONE node.
30583
+ * - `uninstalled` — removed: runner(s) stopped, caps gone, code deleted.
30584
+ * - `not-installed` — the node did not have it (nothing to do).
30585
+ * - `refused` — protected / bootstrap package; nothing touched.
30586
+ * - `failed` — attempted and did not complete; `error` says why.
30587
+ * - `pending-reconnect` — the node is OFFLINE: its record was pruned so the
30588
+ * back-fill never returns the package, and the stale-addon sweep removes the
30589
+ * copy when the node registers again (only once the hub no longer has it).
30590
+ */
30591
+ var UninstallNodeOutcomeSchema = _enum([
30592
+ "uninstalled",
30593
+ "not-installed",
30594
+ "refused",
30595
+ "failed",
30596
+ "pending-reconnect"
30597
+ ]);
30598
+ var UninstallNodeResultSchema = object({
30599
+ nodeId: string(),
30600
+ outcome: UninstallNodeOutcomeSchema,
30601
+ error: string().optional(),
30602
+ addonIds: array(string()).readonly(),
30603
+ runnersStopped: array(string()).readonly(),
30604
+ warnings: array(string()).readonly()
30605
+ });
30606
+ var UninstallPackageResultSchema = object({
30607
+ /** Every targeted node ended `uninstalled`, `not-installed` or `pending-reconnect`. */
30608
+ success: boolean(),
30609
+ packageName: string(),
30610
+ results: array(UninstallNodeResultSchema).readonly()
30611
+ });
30612
+ /**
30613
+ * `unreachable` lists online agents whose status read FAILED — absence from
30614
+ * `installations` is only "not installed" for a node that answered (D315).
30615
+ */
30616
+ var PackageInstallationsSchema = object({
30617
+ installations: array(object({
30618
+ packageName: string(),
30619
+ nodeId: string(),
30620
+ nodeName: string(),
30621
+ isHub: boolean(),
30622
+ isOnline: boolean(),
30623
+ version: string().nullable(),
30624
+ addonIds: array(string()).readonly(),
30625
+ source: _enum(["live", "recorded"]),
30626
+ /** The hub installs this package too. `false` on an agent row = an orphan. */
30627
+ onHub: boolean()
30628
+ })).readonly(),
30629
+ unreachable: array(object({
30630
+ nodeId: string(),
30631
+ error: string()
30632
+ })).readonly()
30633
+ });
28537
30634
  var BulkUpdateItemStatusSchema = _enum([
28538
30635
  "queued",
28539
30636
  "updating",
@@ -28616,10 +30713,14 @@ method(_void(), array(AddonListItemSchema).readonly()), method(object({
28616
30713
  }), method(object({ packageName: string() }), InstallPackageResultSchema, {
28617
30714
  kind: "mutation",
28618
30715
  auth: "admin"
28619
- }), method(_void(), boolean()), method(_void(), array(unknown()).readonly()), method(object({ packageName: string() }), unknown(), {
30716
+ }), method(_void(), boolean()), method(_void(), array(unknown()).readonly()), method(object({
30717
+ packageName: string().min(1),
30718
+ nodeId: string().optional(),
30719
+ everywhere: boolean().optional()
30720
+ }), UninstallPackageResultSchema, {
28620
30721
  kind: "mutation",
28621
30722
  auth: "admin"
28622
- }), method(_void(), ReloadPackagesResultSchema, {
30723
+ }), method(object({ packageName: string().optional() }), PackageInstallationsSchema, { auth: "admin" }), method(_void(), ReloadPackagesResultSchema, {
28623
30724
  kind: "mutation",
28624
30725
  auth: "admin"
28625
30726
  }), method(object({ query: string().optional() }), array(SearchResultSchema)), method(object({ nodeId: string().optional() }), array(PackageUpdateSchema).readonly(), { auth: "admin" }), method(object({
@@ -31692,6 +33793,9 @@ var CreateIntegrationInputSchema = object({
31692
33793
  enabled: boolean().optional(),
31693
33794
  info: record(string(), unknown()).optional(),
31694
33795
  settings: record(string(), unknown()).optional(),
33796
+ /** Keys of `settings` the form's schema declares secret (by type) — kept in
33797
+ * the keychain, not the table (D787). */
33798
+ secretKeys: array(string()).optional(),
31695
33799
  skipRestart: boolean().optional()
31696
33800
  });
31697
33801
  var UpdateIntegrationInputSchema = object({
@@ -31715,7 +33819,9 @@ method(_void(), array(IntegrationWithStateSchema)), method(object({ id: string()
31715
33819
  auth: "admin"
31716
33820
  }), method(object({ id: string() }), record(string(), unknown()), { auth: "admin" }), method(object({
31717
33821
  id: string(),
31718
- settings: record(string(), unknown())
33822
+ settings: record(string(), unknown()),
33823
+ /** Keys the form's schema declares secret (by type) — keychain-stored (D787). */
33824
+ secretKeys: array(string()).optional()
31719
33825
  }), object({ success: boolean() }), {
31720
33826
  kind: "mutation",
31721
33827
  auth: "admin"
@@ -32114,7 +34220,8 @@ var ConnectionEndpointSchema = object({
32114
34220
  "lan-ipv6",
32115
34221
  "public",
32116
34222
  "loopback",
32117
- "app-link"
34223
+ "app-link",
34224
+ "custom"
32118
34225
  ]),
32119
34226
  /**
32120
34227
  * Originating-interface kind — `lan`/`wifi`/`docker`/`vpn`/`other`/
@@ -32183,7 +34290,7 @@ var GetConnectionEndpointsResultSchema = object({
32183
34290
  localPort: AdvertisedLocalPortSchema
32184
34291
  });
32185
34292
  /**
32186
- * The address flagged for notification links. `baseUrl: null` = AUTO, which
34293
+ * The address flagged for notification taps (`notificationTaps`). `baseUrl: null` = AUTO, which
32187
34294
  * since D709 is the CamStack app link; `resolved` reports the effective value,
32188
34295
  * so the UI can show it either way.
32189
34296
  */
@@ -32216,6 +34323,72 @@ var ViewerEndpointsSchema = object({
32216
34323
  /** What the ranking currently resolves to (may be empty if nothing is up). */
32217
34324
  resolved: array(string()).readonly()
32218
34325
  });
34326
+ /**
34327
+ * DEPRECATED compatibility shape of `getHubAddresses` (D729 amendment, kept
34328
+ * for addons built against it): `cluster` is the `internal` role, `browser`
34329
+ * the `publicEndpoint` role; `override` is the flagged address.
34330
+ */
34331
+ var HubAddressSnapshotSchema = object({
34332
+ override: string().nullable(),
34333
+ resolved: string().nullable(),
34334
+ source: _enum([
34335
+ "override",
34336
+ "auto",
34337
+ "none"
34338
+ ])
34339
+ });
34340
+ var HubAddressesSchema = object({
34341
+ cluster: HubAddressSnapshotSchema,
34342
+ browser: HubAddressSnapshotSchema
34343
+ });
34344
+ /**
34345
+ * What an address is used for (`hub-address.ts`, D734). `appConnections` is
34346
+ * many-valued; `notificationTaps`, `publicEndpoint` and `internal` are carried
34347
+ * by at most one address.
34348
+ */
34349
+ var HubAddressRoleSchema = _enum(HUB_ADDRESS_ROLES);
34350
+ var RoleSourceSchema = _enum([
34351
+ "flagged",
34352
+ "auto",
34353
+ "none"
34354
+ ]);
34355
+ /** One single-valued role: the flagged address, the one in use, and why. */
34356
+ var HubAddressRoleResolutionSchema = object({
34357
+ /** The address carrying the flag, or null = automatic. */
34358
+ flagged: string().nullable(),
34359
+ /** The address in use, or null when nothing qualifies (never loopback). */
34360
+ resolved: string().nullable(),
34361
+ source: RoleSourceSchema
34362
+ });
34363
+ var HubAppConnectionsResolutionSchema = object({
34364
+ /** The addresses flagged `appConnections`, or empty = automatic. */
34365
+ flagged: array(string()).readonly(),
34366
+ /** What the apps race right now. */
34367
+ resolved: array(string()).readonly(),
34368
+ source: RoleSourceSchema
34369
+ });
34370
+ var HubAddressBookSchema = object({
34371
+ rows: array(ConnectionEndpointSchema.extend({
34372
+ /** In the hub's detected palette right now. */
34373
+ detected: boolean(),
34374
+ /** Entered by the operator (removable). */
34375
+ custom: boolean(),
34376
+ /** The roles explicitly flagged on this address. */
34377
+ flags: array(HubAddressRoleSchema).readonly(),
34378
+ /** The roles this address serves right now — flagged or automatic. */
34379
+ inUse: array(HubAddressRoleSchema).readonly(),
34380
+ /** The roles this address may be flagged with. */
34381
+ eligible: array(HubAddressRoleSchema).readonly()
34382
+ })).readonly(),
34383
+ roles: object({
34384
+ appConnections: HubAppConnectionsResolutionSchema,
34385
+ notificationTaps: HubAddressRoleResolutionSchema,
34386
+ internal: HubAddressRoleResolutionSchema,
34387
+ publicEndpoint: HubAddressRoleResolutionSchema
34388
+ }),
34389
+ /** The `hub=` an app link carries (D709), or null. */
34390
+ appLinkHub: string().nullable()
34391
+ });
32219
34392
  var AllowedAddressesSchema = object({
32220
34393
  /**
32221
34394
  * Allowlist of interface addresses operators have explicitly opted
@@ -32259,10 +34432,27 @@ method(_void(), ListResultSchema), method(_void(), PreferredSchema), method(obje
32259
34432
  * tunnel always emits `https://` regardless. */
32260
34433
  scheme: _enum(["http", "https"]).optional(),
32261
34434
  /** Append the CamStack app link entry (`kind: 'app-link'`, D709) —
32262
- * an address notification links can be flagged with, not a hub
34435
+ * an address notification taps can be flagged with, not a hub
32263
34436
  * route. Default `false`: racers and rankers never see it. */
32264
34437
  includeAppLink: boolean().optional()
32265
- }), 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, {
34438
+ }), 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(object({ scheme: _enum(["http", "https"]).optional() }).optional(), HubAddressBookSchema), method(object({
34439
+ baseUrl: string(),
34440
+ label: string().max(80)
34441
+ }), HubAddressBookSchema, {
34442
+ kind: "mutation",
34443
+ auth: "admin"
34444
+ }), method(object({ baseUrl: string() }), HubAddressBookSchema, {
34445
+ kind: "mutation",
34446
+ auth: "admin"
34447
+ }), method(object({
34448
+ role: HubAddressRoleSchema,
34449
+ baseUrl: string().nullable(),
34450
+ enabled: boolean(),
34451
+ acceptInsecureHttp: boolean().optional()
34452
+ }), HubAddressBookSchema, {
34453
+ kind: "mutation",
34454
+ auth: "admin"
34455
+ }), method(_void(), HubAddressesSchema), 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, {
32266
34456
  kind: "mutation",
32267
34457
  auth: "admin"
32268
34458
  }), method(object({
@@ -32720,7 +34910,8 @@ var MotionStatusSchema = object({
32720
34910
  * writes this slice (not even a boot seed), and neither does the runner's
32721
34911
  * phase machine: its phase is "a session is attached" for every on-motion
32722
34912
  * session, not motion, and it now has its own `DetectionPhaseTransition`.
32723
- * A provider's `isDetected` answers from the hub's slice.
34913
+ * A provider's `isDetected` and `getStatus` answer from the hub's slice
34914
+ * (`hubMotionNativeProvider`).
32724
34915
  * - **Sensors** (Home Assistant binary sensors, Homematic, Matter, Alexa
32725
34916
  * imports) — the provider pushes both edges itself, from the upstream
32726
34917
  * system's own state change. That is the sensor's own fact.
@@ -38452,6 +40643,32 @@ var TotpStatusSchema = object({
38452
40643
  /** Null when no row exists OR the row is still pending confirmation. */
38453
40644
  confirmedAt: number().nullable()
38454
40645
  });
40646
+ /**
40647
+ * user-management — singleton capability for user accounts, API keys,
40648
+ * and scoped tokens.
40649
+ *
40650
+ * v2 model: every method gated by `auth: 'admin'`. Admin-only delegation
40651
+ * — the subset check on `setUserScopes` / `createScopedToken` is moot
40652
+ * because non-admins never reach these. If/when we open non-admin
40653
+ * delegation, structural caller-scope subset check goes inside the
40654
+ * provider.
40655
+ */
40656
+ var ExternalIdentitySchema = object({
40657
+ /** Login-method id of the provider instance, e.g. `auth-oidc/authentik`. */
40658
+ provider: string(),
40659
+ /** The IdP's stable subject (`sub`) for this account. */
40660
+ subject: string(),
40661
+ /** The verified `iss` of the IdP the identity was linked under — `sub` is unique only per issuer. */
40662
+ issuer: string(),
40663
+ userId: string(),
40664
+ /** What the IdP called the account at link time (username / email) — display only. */
40665
+ label: string().optional(),
40666
+ linkedAt: number()
40667
+ });
40668
+ var ExternalIdentityKeySchema = object({
40669
+ provider: string().min(1),
40670
+ subject: string().min(1)
40671
+ });
38455
40672
  method(_void(), array(UserSummarySchema), { auth: "admin" }), method(CreateUserInputSchema, UserSummarySchema, {
38456
40673
  kind: "mutation",
38457
40674
  auth: "admin",
@@ -38565,7 +40782,22 @@ method(_void(), array(UserSummarySchema), { auth: "admin" }), method(CreateUserI
38565
40782
  userId: string(),
38566
40783
  username: string(),
38567
40784
  scopes: array(TokenScopeSchema)
38568
- }).nullable(), { access: "view" }), method(_void(), array(OauthSessionSummarySchema), { auth: "admin" }), method(object({ id: string() }), object({ success: boolean() }), {
40785
+ }).nullable(), { access: "view" }), method(object({ userId: string() }), array(ExternalIdentitySchema), { auth: "admin" }), method(ExternalIdentityKeySchema, object({
40786
+ userId: string(),
40787
+ issuer: string()
40788
+ }).nullable(), { auth: "admin" }), method(ExternalIdentityKeySchema.extend({
40789
+ userId: string(),
40790
+ issuer: string().min(1),
40791
+ label: string().optional()
40792
+ }), object({ success: literal(true) }), {
40793
+ kind: "mutation",
40794
+ auth: "admin",
40795
+ access: "create"
40796
+ }), method(ExternalIdentityKeySchema.extend({ userId: string() }), object({ success: boolean() }), {
40797
+ kind: "mutation",
40798
+ auth: "admin",
40799
+ access: "delete"
40800
+ }), method(_void(), array(OauthSessionSummarySchema), { auth: "admin" }), method(object({ id: string() }), object({ success: boolean() }), {
38569
40801
  kind: "mutation",
38570
40802
  auth: "admin",
38571
40803
  access: "delete"
@@ -39267,6 +41499,16 @@ var zoneRulesCapability = {
39267
41499
  durability: "restored"
39268
41500
  };
39269
41501
  SOURCE_CAPS.filter((cap) => cap !== "switch" && cap !== "motion");
41502
+ Object.freeze({
41503
+ person: .5,
41504
+ vehicle: .5,
41505
+ animal: .5
41506
+ });
41507
+ Object.freeze({
41508
+ person: .65,
41509
+ vehicle: .65,
41510
+ animal: .65
41511
+ });
39270
41512
  /**
39271
41513
  * Accessory device helpers — shared across drivers.
39272
41514
  *
@@ -39742,7 +41984,8 @@ var BaseDevice = class {
39742
41984
  this.role = options.role;
39743
41985
  this.parentDeviceId = ctx.parentDeviceId;
39744
41986
  const seedData = ctx.persistedConfig ?? {};
39745
- this.config = DeviceConfig.fromSchema(schema, (data) => ctx.persistConfig(data), seedData, ({ droppedKeys, issues }) => {
41987
+ const declaredSecretPaths = collectZodSecretPaths(schema);
41988
+ this.config = DeviceConfig.fromSchema(schema, (data) => ctx.persistConfig(data, { secretConfigPaths: declaredSecretPaths }), seedData, ({ droppedKeys, issues }) => {
39746
41989
  ctx.logger.warn("Device config recovery: dropping invalid persisted fields", {
39747
41990
  tags: {
39748
41991
  deviceId: ctx.id,
@@ -40965,6 +43208,12 @@ Object.freeze({
40965
43208
  addonId: null,
40966
43209
  access: "view"
40967
43210
  },
43211
+ "addons.listInstallations": {
43212
+ capName: "addons",
43213
+ capScope: "system",
43214
+ addonId: null,
43215
+ access: "view"
43216
+ },
40968
43217
  "addons.listJobs": {
40969
43218
  capName: "addons",
40970
43219
  capScope: "system",
@@ -42147,90 +44396,18 @@ Object.freeze({
42147
44396
  addonId: null,
42148
44397
  access: "create"
42149
44398
  },
42150
- "decoder.createSession": {
42151
- capName: "decoder",
42152
- capScope: "system",
42153
- addonId: null,
42154
- access: "view"
42155
- },
42156
- "decoder.destroySession": {
42157
- capName: "decoder",
42158
- capScope: "system",
42159
- addonId: null,
42160
- access: "delete"
42161
- },
42162
- "decoder.getFrame": {
42163
- capName: "decoder",
42164
- capScope: "system",
42165
- addonId: null,
42166
- access: "view"
42167
- },
42168
44399
  "decoder.getInfo": {
42169
44400
  capName: "decoder",
42170
44401
  capScope: "system",
42171
44402
  addonId: null,
42172
44403
  access: "view"
42173
44404
  },
42174
- "decoder.getShmStats": {
42175
- capName: "decoder",
42176
- capScope: "system",
42177
- addonId: null,
42178
- access: "view"
42179
- },
42180
- "decoder.getStats": {
42181
- capName: "decoder",
42182
- capScope: "system",
42183
- addonId: null,
42184
- access: "view"
42185
- },
42186
- "decoder.listActiveSessions": {
42187
- capName: "decoder",
42188
- capScope: "system",
42189
- addonId: null,
42190
- access: "view"
42191
- },
42192
- "decoder.openStream": {
42193
- capName: "decoder",
42194
- capScope: "system",
42195
- addonId: null,
42196
- access: "view"
42197
- },
42198
- "decoder.pullFrames": {
42199
- capName: "decoder",
42200
- capScope: "system",
42201
- addonId: null,
42202
- access: "view"
42203
- },
42204
- "decoder.pullHandles": {
42205
- capName: "decoder",
42206
- capScope: "system",
42207
- addonId: null,
42208
- access: "view"
42209
- },
42210
- "decoder.pushPacket": {
42211
- capName: "decoder",
42212
- capScope: "system",
42213
- addonId: null,
42214
- access: "view"
42215
- },
42216
44405
  "decoder.reprobeHwaccel": {
42217
44406
  capName: "decoder",
42218
44407
  capScope: "system",
42219
44408
  addonId: null,
42220
44409
  access: "create"
42221
44410
  },
42222
- "decoder.supportsCodec": {
42223
- capName: "decoder",
42224
- capScope: "system",
42225
- addonId: null,
42226
- access: "view"
42227
- },
42228
- "decoder.updateConfig": {
42229
- capName: "decoder",
42230
- capScope: "system",
42231
- addonId: null,
42232
- access: "view"
42233
- },
42234
44411
  "detectionPipeline.applyDeviceSettingsPatch": {
42235
44412
  capName: "detection-pipeline",
42236
44413
  capScope: "device",
@@ -43497,6 +45674,90 @@ Object.freeze({
43497
45674
  addonId: null,
43498
45675
  access: "create"
43499
45676
  },
45677
+ "keychain.delete": {
45678
+ capName: "keychain",
45679
+ capScope: "system",
45680
+ addonId: null,
45681
+ access: "delete"
45682
+ },
45683
+ "keychain.getState": {
45684
+ capName: "keychain",
45685
+ capScope: "system",
45686
+ addonId: null,
45687
+ access: "view"
45688
+ },
45689
+ "keychain.listMeta": {
45690
+ capName: "keychain",
45691
+ capScope: "system",
45692
+ addonId: null,
45693
+ access: "view"
45694
+ },
45695
+ "keychain.put": {
45696
+ capName: "keychain",
45697
+ capScope: "system",
45698
+ addonId: null,
45699
+ access: "create"
45700
+ },
45701
+ "keychain.resolve": {
45702
+ capName: "keychain",
45703
+ capScope: "system",
45704
+ addonId: null,
45705
+ access: "view"
45706
+ },
45707
+ "keychainAdmin.deleteOrphans": {
45708
+ capName: "keychain-admin",
45709
+ capScope: "system",
45710
+ addonId: null,
45711
+ access: "delete"
45712
+ },
45713
+ "keychainAdmin.downloadRecoveryKey": {
45714
+ capName: "keychain-admin",
45715
+ capScope: "system",
45716
+ addonId: null,
45717
+ access: "create"
45718
+ },
45719
+ "keychainAdmin.listAudit": {
45720
+ capName: "keychain-admin",
45721
+ capScope: "system",
45722
+ addonId: null,
45723
+ access: "view"
45724
+ },
45725
+ "keychainAdmin.listSecrets": {
45726
+ capName: "keychain-admin",
45727
+ capScope: "system",
45728
+ addonId: null,
45729
+ access: "view"
45730
+ },
45731
+ "keychainAdmin.purgeRetiredKeys": {
45732
+ capName: "keychain-admin",
45733
+ capScope: "system",
45734
+ addonId: null,
45735
+ access: "delete"
45736
+ },
45737
+ "keychainAdmin.resetKeychain": {
45738
+ capName: "keychain-admin",
45739
+ capScope: "system",
45740
+ addonId: null,
45741
+ access: "delete"
45742
+ },
45743
+ "keychainAdmin.reveal": {
45744
+ capName: "keychain-admin",
45745
+ capScope: "system",
45746
+ addonId: null,
45747
+ access: "create"
45748
+ },
45749
+ "keychainAdmin.rotateMasterKey": {
45750
+ capName: "keychain-admin",
45751
+ capScope: "system",
45752
+ addonId: null,
45753
+ access: "create"
45754
+ },
45755
+ "keychainAdmin.status": {
45756
+ capName: "keychain-admin",
45757
+ capScope: "system",
45758
+ addonId: null,
45759
+ access: "view"
45760
+ },
43500
45761
  "lawnMowerControl.dock": {
43501
45762
  capName: "lawn-mower-control",
43502
45763
  capScope: "device",
@@ -43719,12 +45980,24 @@ Object.freeze({
43719
45980
  addonId: null,
43720
45981
  access: "view"
43721
45982
  },
45983
+ "localNetwork.addCustomAddress": {
45984
+ capName: "local-network",
45985
+ capScope: "system",
45986
+ addonId: null,
45987
+ access: "create"
45988
+ },
43722
45989
  "localNetwork.downloadCa": {
43723
45990
  capName: "local-network",
43724
45991
  capScope: "system",
43725
45992
  addonId: null,
43726
45993
  access: "view"
43727
45994
  },
45995
+ "localNetwork.getAddresses": {
45996
+ capName: "local-network",
45997
+ capScope: "system",
45998
+ addonId: null,
45999
+ access: "view"
46000
+ },
43728
46001
  "localNetwork.getAllowedAddresses": {
43729
46002
  capName: "local-network",
43730
46003
  capScope: "system",
@@ -43737,6 +46010,12 @@ Object.freeze({
43737
46010
  addonId: null,
43738
46011
  access: "view"
43739
46012
  },
46013
+ "localNetwork.getHubAddresses": {
46014
+ capName: "local-network",
46015
+ capScope: "system",
46016
+ addonId: null,
46017
+ access: "view"
46018
+ },
43740
46019
  "localNetwork.getNotificationEndpoint": {
43741
46020
  capName: "local-network",
43742
46021
  capScope: "system",
@@ -43773,6 +46052,12 @@ Object.freeze({
43773
46052
  addonId: null,
43774
46053
  access: "create"
43775
46054
  },
46055
+ "localNetwork.removeCustomAddress": {
46056
+ capName: "local-network",
46057
+ capScope: "system",
46058
+ addonId: null,
46059
+ access: "delete"
46060
+ },
43776
46061
  "localNetwork.resetAllowlistToBestMatch": {
43777
46062
  capName: "local-network",
43778
46063
  capScope: "system",
@@ -43785,6 +46070,12 @@ Object.freeze({
43785
46070
  addonId: null,
43786
46071
  access: "create"
43787
46072
  },
46073
+ "localNetwork.setAddressRole": {
46074
+ capName: "local-network",
46075
+ capScope: "system",
46076
+ addonId: null,
46077
+ access: "create"
46078
+ },
43788
46079
  "localNetwork.setAllowedAddresses": {
43789
46080
  capName: "local-network",
43790
46081
  capScope: "system",
@@ -44841,6 +47132,18 @@ Object.freeze({
44841
47132
  addonId: null,
44842
47133
  access: "create"
44843
47134
  },
47135
+ "pipelineAnalytics.addRetrainFrameFromRecording": {
47136
+ capName: "pipeline-analytics",
47137
+ capScope: "device",
47138
+ addonId: null,
47139
+ access: "create"
47140
+ },
47141
+ "pipelineAnalytics.addRetrainFramesToCollection": {
47142
+ capName: "pipeline-analytics",
47143
+ capScope: "device",
47144
+ addonId: null,
47145
+ access: "create"
47146
+ },
44844
47147
  "pipelineAnalytics.applyDeviceSettingsPatch": {
44845
47148
  capName: "pipeline-analytics",
44846
47149
  capScope: "device",
@@ -44889,12 +47192,24 @@ Object.freeze({
44889
47192
  addonId: null,
44890
47193
  access: "view"
44891
47194
  },
47195
+ "pipelineAnalytics.createRetrainCollection": {
47196
+ capName: "pipeline-analytics",
47197
+ capScope: "device",
47198
+ addonId: null,
47199
+ access: "create"
47200
+ },
44892
47201
  "pipelineAnalytics.deleteDeviceEvents": {
44893
47202
  capName: "pipeline-analytics",
44894
47203
  capScope: "device",
44895
47204
  addonId: null,
44896
47205
  access: "delete"
44897
47206
  },
47207
+ "pipelineAnalytics.deleteRetrainCollection": {
47208
+ capName: "pipeline-analytics",
47209
+ capScope: "device",
47210
+ addonId: null,
47211
+ access: "delete"
47212
+ },
44898
47213
  "pipelineAnalytics.deleteTracks": {
44899
47214
  capName: "pipeline-analytics",
44900
47215
  capScope: "device",
@@ -45099,6 +47414,24 @@ Object.freeze({
45099
47414
  addonId: null,
45100
47415
  access: "view"
45101
47416
  },
47417
+ "pipelineAnalytics.listRetrainAssistProfiles": {
47418
+ capName: "pipeline-analytics",
47419
+ capScope: "device",
47420
+ addonId: null,
47421
+ access: "view"
47422
+ },
47423
+ "pipelineAnalytics.listRetrainCollectionFrames": {
47424
+ capName: "pipeline-analytics",
47425
+ capScope: "device",
47426
+ addonId: null,
47427
+ access: "view"
47428
+ },
47429
+ "pipelineAnalytics.listRetrainCollections": {
47430
+ capName: "pipeline-analytics",
47431
+ capScope: "device",
47432
+ addonId: null,
47433
+ access: "view"
47434
+ },
45102
47435
  "pipelineAnalytics.listRetrainFrames": {
45103
47436
  capName: "pipeline-analytics",
45104
47437
  capScope: "device",
@@ -45147,6 +47480,12 @@ Object.freeze({
45147
47480
  addonId: null,
45148
47481
  access: "create"
45149
47482
  },
47483
+ "pipelineAnalytics.proposeRetrainAnnotationsWithLlm": {
47484
+ capName: "pipeline-analytics",
47485
+ capScope: "device",
47486
+ addonId: null,
47487
+ access: "create"
47488
+ },
45150
47489
  "pipelineAnalytics.pruneEvents": {
45151
47490
  capName: "pipeline-analytics",
45152
47491
  capScope: "device",
@@ -45201,6 +47540,18 @@ Object.freeze({
45201
47540
  addonId: null,
45202
47541
  access: "create"
45203
47542
  },
47543
+ "pipelineAnalytics.removeRetrainFrameFromCollection": {
47544
+ capName: "pipeline-analytics",
47545
+ capScope: "device",
47546
+ addonId: null,
47547
+ access: "delete"
47548
+ },
47549
+ "pipelineAnalytics.renameRetrainCollection": {
47550
+ capName: "pipeline-analytics",
47551
+ capScope: "device",
47552
+ addonId: null,
47553
+ access: "create"
47554
+ },
45204
47555
  "pipelineAnalytics.restageRetrainTrack": {
45205
47556
  capName: "pipeline-analytics",
45206
47557
  capScope: "device",
@@ -45231,6 +47582,12 @@ Object.freeze({
45231
47582
  addonId: null,
45232
47583
  access: "create"
45233
47584
  },
47585
+ "pipelineAnalytics.setRetrainFrameComplete": {
47586
+ capName: "pipeline-analytics",
47587
+ capScope: "device",
47588
+ addonId: null,
47589
+ access: "create"
47590
+ },
45234
47591
  "pipelineAnalytics.setTrackFlags": {
45235
47592
  capName: "pipeline-analytics",
45236
47593
  capScope: "device",
@@ -45267,6 +47624,12 @@ Object.freeze({
45267
47624
  addonId: null,
45268
47625
  access: "delete"
45269
47626
  },
47627
+ "pipelineAnalytics.writeRetrainArchive": {
47628
+ capName: "pipeline-analytics",
47629
+ capScope: "device",
47630
+ addonId: null,
47631
+ access: "create"
47632
+ },
45270
47633
  "pipelineExecutor.cacheFrameInPool": {
45271
47634
  capName: "pipeline-executor",
45272
47635
  capScope: "system",
@@ -45279,13 +47642,13 @@ Object.freeze({
45279
47642
  addonId: null,
45280
47643
  access: "delete"
45281
47644
  },
45282
- "pipelineExecutor.deleteModel": {
47645
+ "pipelineExecutor.clearModelBoundDeviceOverrides": {
45283
47646
  capName: "pipeline-executor",
45284
47647
  capScope: "system",
45285
47648
  addonId: null,
45286
47649
  access: "delete"
45287
47650
  },
45288
- "pipelineExecutor.deleteTemplate": {
47651
+ "pipelineExecutor.deleteModel": {
45289
47652
  capName: "pipeline-executor",
45290
47653
  capScope: "system",
45291
47654
  addonId: null,
@@ -45429,12 +47792,6 @@ Object.freeze({
45429
47792
  addonId: null,
45430
47793
  access: "view"
45431
47794
  },
45432
- "pipelineExecutor.listTemplates": {
45433
- capName: "pipeline-executor",
45434
- capScope: "system",
45435
- addonId: null,
45436
- access: "view"
45437
- },
45438
47795
  "pipelineExecutor.rearmInferenceDevice": {
45439
47796
  capName: "pipeline-executor",
45440
47797
  capScope: "system",
@@ -45459,12 +47816,6 @@ Object.freeze({
45459
47816
  addonId: null,
45460
47817
  access: "create"
45461
47818
  },
45462
- "pipelineExecutor.saveTemplate": {
45463
- capName: "pipeline-executor",
45464
- capScope: "system",
45465
- addonId: null,
45466
- access: "create"
45467
- },
45468
47819
  "pipelineExecutor.setVideoPipelineSteps": {
45469
47820
  capName: "pipeline-executor",
45470
47821
  capScope: "system",
@@ -45483,17 +47834,23 @@ Object.freeze({
45483
47834
  addonId: null,
45484
47835
  access: "create"
45485
47836
  },
45486
- "pipelineExecutor.updateTemplate": {
47837
+ "pipelineExecutor.validatePipeline": {
45487
47838
  capName: "pipeline-executor",
45488
47839
  capScope: "system",
45489
47840
  addonId: null,
47841
+ access: "view"
47842
+ },
47843
+ "pipelineOrchestrator.abortNodeBenchmark": {
47844
+ capName: "pipeline-orchestrator",
47845
+ capScope: "system",
47846
+ addonId: null,
45490
47847
  access: "create"
45491
47848
  },
45492
- "pipelineExecutor.validatePipeline": {
45493
- capName: "pipeline-executor",
47849
+ "pipelineOrchestrator.applyAutoTune": {
47850
+ capName: "pipeline-orchestrator",
45494
47851
  capScope: "system",
45495
47852
  addonId: null,
45496
- access: "view"
47853
+ access: "create"
45497
47854
  },
45498
47855
  "pipelineOrchestrator.applyDeviceSettingsPatch": {
45499
47856
  capName: "pipeline-orchestrator",
@@ -45513,7 +47870,7 @@ Object.freeze({
45513
47870
  addonId: null,
45514
47871
  access: "create"
45515
47872
  },
45516
- "pipelineOrchestrator.deleteTemplate": {
47873
+ "pipelineOrchestrator.deleteNodeBenchmarkResult": {
45517
47874
  capName: "pipeline-orchestrator",
45518
47875
  capScope: "system",
45519
47876
  addonId: null,
@@ -45609,6 +47966,12 @@ Object.freeze({
45609
47966
  addonId: null,
45610
47967
  access: "view"
45611
47968
  },
47969
+ "pipelineOrchestrator.getEffectiveShares": {
47970
+ capName: "pipeline-orchestrator",
47971
+ capScope: "system",
47972
+ addonId: null,
47973
+ access: "view"
47974
+ },
45612
47975
  "pipelineOrchestrator.getGlobalMetrics": {
45613
47976
  capName: "pipeline-orchestrator",
45614
47977
  capScope: "system",
@@ -45621,6 +47984,24 @@ Object.freeze({
45621
47984
  addonId: null,
45622
47985
  access: "view"
45623
47986
  },
47987
+ "pipelineOrchestrator.getNodeBenchmarkCandidates": {
47988
+ capName: "pipeline-orchestrator",
47989
+ capScope: "system",
47990
+ addonId: null,
47991
+ access: "view"
47992
+ },
47993
+ "pipelineOrchestrator.getNodeBenchmarkPreflight": {
47994
+ capName: "pipeline-orchestrator",
47995
+ capScope: "system",
47996
+ addonId: null,
47997
+ access: "view"
47998
+ },
47999
+ "pipelineOrchestrator.getNodeBenchmarkStatus": {
48000
+ capName: "pipeline-orchestrator",
48001
+ capScope: "system",
48002
+ addonId: null,
48003
+ access: "view"
48004
+ },
45624
48005
  "pipelineOrchestrator.getNodeInferenceDevices": {
45625
48006
  capName: "pipeline-orchestrator",
45626
48007
  capScope: "system",
@@ -45645,6 +48026,12 @@ Object.freeze({
45645
48026
  addonId: null,
45646
48027
  access: "view"
45647
48028
  },
48029
+ "pipelineOrchestrator.getPlacementStats": {
48030
+ capName: "pipeline-orchestrator",
48031
+ capScope: "system",
48032
+ addonId: null,
48033
+ access: "view"
48034
+ },
45648
48035
  "pipelineOrchestrator.getReconcileFromDiskStatus": {
45649
48036
  capName: "pipeline-orchestrator",
45650
48037
  capScope: "system",
@@ -45657,7 +48044,7 @@ Object.freeze({
45657
48044
  addonId: null,
45658
48045
  access: "view"
45659
48046
  },
45660
- "pipelineOrchestrator.listTemplates": {
48047
+ "pipelineOrchestrator.listNodeBenchmarkResults": {
45661
48048
  capName: "pipeline-orchestrator",
45662
48049
  capScope: "system",
45663
48050
  addonId: null,
@@ -45669,6 +48056,12 @@ Object.freeze({
45669
48056
  addonId: null,
45670
48057
  access: "create"
45671
48058
  },
48059
+ "pipelineOrchestrator.planAutoTune": {
48060
+ capName: "pipeline-orchestrator",
48061
+ capScope: "system",
48062
+ addonId: null,
48063
+ access: "view"
48064
+ },
45672
48065
  "pipelineOrchestrator.rebalance": {
45673
48066
  capName: "pipeline-orchestrator",
45674
48067
  capScope: "system",
@@ -45711,12 +48104,6 @@ Object.freeze({
45711
48104
  addonId: null,
45712
48105
  access: "create"
45713
48106
  },
45714
- "pipelineOrchestrator.saveTemplate": {
45715
- capName: "pipeline-orchestrator",
45716
- capScope: "system",
45717
- addonId: null,
45718
- access: "create"
45719
- },
45720
48107
  "pipelineOrchestrator.setAgentCapabilities": {
45721
48108
  capName: "pipeline-orchestrator",
45722
48109
  capScope: "system",
@@ -45729,12 +48116,6 @@ Object.freeze({
45729
48116
  addonId: null,
45730
48117
  access: "create"
45731
48118
  },
45732
- "pipelineOrchestrator.setAgentDetectWeight": {
45733
- capName: "pipeline-orchestrator",
45734
- capScope: "system",
45735
- addonId: null,
45736
- access: "create"
45737
- },
45738
48119
  "pipelineOrchestrator.setAgentInferenceDevices": {
45739
48120
  capName: "pipeline-orchestrator",
45740
48121
  capScope: "system",
@@ -45771,6 +48152,12 @@ Object.freeze({
45771
48152
  addonId: null,
45772
48153
  access: "create"
45773
48154
  },
48155
+ "pipelineOrchestrator.setCameraStepSettings": {
48156
+ capName: "pipeline-orchestrator",
48157
+ capScope: "system",
48158
+ addonId: null,
48159
+ access: "create"
48160
+ },
45774
48161
  "pipelineOrchestrator.setCameraStepToggle": {
45775
48162
  capName: "pipeline-orchestrator",
45776
48163
  capScope: "system",
@@ -45789,12 +48176,36 @@ Object.freeze({
45789
48176
  addonId: null,
45790
48177
  access: "create"
45791
48178
  },
48179
+ "pipelineOrchestrator.setLoadBalancingShares": {
48180
+ capName: "pipeline-orchestrator",
48181
+ capScope: "system",
48182
+ addonId: null,
48183
+ access: "create"
48184
+ },
45792
48185
  "pipelineOrchestrator.setPipelineDevicePin": {
45793
48186
  capName: "pipeline-orchestrator",
45794
48187
  capScope: "system",
45795
48188
  addonId: null,
45796
48189
  access: "create"
45797
48190
  },
48191
+ "pipelineOrchestrator.setShareSource": {
48192
+ capName: "pipeline-orchestrator",
48193
+ capScope: "system",
48194
+ addonId: null,
48195
+ access: "create"
48196
+ },
48197
+ "pipelineOrchestrator.startNodeBenchmark": {
48198
+ capName: "pipeline-orchestrator",
48199
+ capScope: "system",
48200
+ addonId: null,
48201
+ access: "create"
48202
+ },
48203
+ "pipelineOrchestrator.suggestShares": {
48204
+ capName: "pipeline-orchestrator",
48205
+ capScope: "system",
48206
+ addonId: null,
48207
+ access: "view"
48208
+ },
45798
48209
  "pipelineOrchestrator.unassignAudio": {
45799
48210
  capName: "pipeline-orchestrator",
45800
48211
  capScope: "system",
@@ -45807,8 +48218,8 @@ Object.freeze({
45807
48218
  addonId: null,
45808
48219
  access: "create"
45809
48220
  },
45810
- "pipelineOrchestrator.updateTemplate": {
45811
- capName: "pipeline-orchestrator",
48221
+ "pipelineRunner.abortNodeBench": {
48222
+ capName: "pipeline-runner",
45812
48223
  capScope: "system",
45813
48224
  addonId: null,
45814
48225
  access: "create"
@@ -45861,6 +48272,12 @@ Object.freeze({
45861
48272
  addonId: null,
45862
48273
  access: "view"
45863
48274
  },
48275
+ "pipelineRunner.getNodeBenchStatus": {
48276
+ capName: "pipeline-runner",
48277
+ capScope: "system",
48278
+ addonId: null,
48279
+ access: "view"
48280
+ },
45864
48281
  "pipelineRunner.getParkedTrackFrame": {
45865
48282
  capName: "pipeline-runner",
45866
48283
  capScope: "system",
@@ -45903,6 +48320,12 @@ Object.freeze({
45903
48320
  addonId: null,
45904
48321
  access: "create"
45905
48322
  },
48323
+ "pipelineRunner.startNodeBench": {
48324
+ capName: "pipeline-runner",
48325
+ capScope: "system",
48326
+ addonId: null,
48327
+ access: "create"
48328
+ },
45906
48329
  "plateGallery.assignPlate": {
45907
48330
  capName: "plate-gallery",
45908
48331
  capScope: "system",
@@ -47247,12 +49670,6 @@ Object.freeze({
47247
49670
  addonId: null,
47248
49671
  access: "view"
47249
49672
  },
47250
- "streamBroker.pullFrameHandles": {
47251
- capName: "stream-broker",
47252
- capScope: "system",
47253
- addonId: null,
47254
- access: "view"
47255
- },
47256
49673
  "streamBroker.regenerateRtspToken": {
47257
49674
  capName: "stream-broker",
47258
49675
  capScope: "system",
@@ -47319,12 +49736,6 @@ Object.freeze({
47319
49736
  addonId: null,
47320
49737
  access: "create"
47321
49738
  },
47322
- "streamBroker.subscribeFrames": {
47323
- capName: "stream-broker",
47324
- capScope: "system",
47325
- addonId: null,
47326
- access: "create"
47327
- },
47328
49739
  "streamBroker.unassignProfile": {
47329
49740
  capName: "stream-broker",
47330
49741
  capScope: "system",
@@ -47337,12 +49748,6 @@ Object.freeze({
47337
49748
  addonId: null,
47338
49749
  access: "create"
47339
49750
  },
47340
- "streamBroker.unsubscribeFrames": {
47341
- capName: "stream-broker",
47342
- capScope: "system",
47343
- addonId: null,
47344
- access: "create"
47345
- },
47346
49751
  "streamCatalog.getCatalog": {
47347
49752
  capName: "stream-catalog",
47348
49753
  capScope: "device",
@@ -47637,18 +50042,36 @@ Object.freeze({
47637
50042
  addonId: null,
47638
50043
  access: "delete"
47639
50044
  },
50045
+ "userManagement.findUserByExternalIdentity": {
50046
+ capName: "user-management",
50047
+ capScope: "system",
50048
+ addonId: null,
50049
+ access: "view"
50050
+ },
47640
50051
  "userManagement.getTotpStatus": {
47641
50052
  capName: "user-management",
47642
50053
  capScope: "system",
47643
50054
  addonId: null,
47644
50055
  access: "view"
47645
50056
  },
50057
+ "userManagement.linkExternalIdentity": {
50058
+ capName: "user-management",
50059
+ capScope: "system",
50060
+ addonId: null,
50061
+ access: "create"
50062
+ },
47646
50063
  "userManagement.listApiKeys": {
47647
50064
  capName: "user-management",
47648
50065
  capScope: "system",
47649
50066
  addonId: null,
47650
50067
  access: "view"
47651
50068
  },
50069
+ "userManagement.listExternalIdentities": {
50070
+ capName: "user-management",
50071
+ capScope: "system",
50072
+ addonId: null,
50073
+ access: "view"
50074
+ },
47652
50075
  "userManagement.listOauthSessions": {
47653
50076
  capName: "user-management",
47654
50077
  capScope: "system",
@@ -47727,6 +50150,12 @@ Object.freeze({
47727
50150
  addonId: null,
47728
50151
  access: "create"
47729
50152
  },
50153
+ "userManagement.unlinkExternalIdentity": {
50154
+ capName: "user-management",
50155
+ capScope: "system",
50156
+ addonId: null,
50157
+ access: "delete"
50158
+ },
47730
50159
  "userManagement.updateUser": {
47731
50160
  capName: "user-management",
47732
50161
  capScope: "system",
@@ -48039,6 +50468,12 @@ Object.freeze({
48039
50468
  addonId: null,
48040
50469
  access: "create"
48041
50470
  },
50471
+ "webrtcSession.applyDownlinkProbe": {
50472
+ capName: "webrtc-session",
50473
+ capScope: "device",
50474
+ addonId: null,
50475
+ access: "create"
50476
+ },
48042
50477
  "webrtcSession.closeSession": {
48043
50478
  capName: "webrtc-session",
48044
50479
  capScope: "device",
@@ -49916,11 +52351,6 @@ Object.freeze({
49916
52351
  form: "single",
49917
52352
  optional: false
49918
52353
  }],
49919
- "decoder.createSession": [{
49920
- name: "deviceId",
49921
- form: "single",
49922
- optional: true
49923
- }],
49924
52354
  "detectionPipeline.applyDeviceSettingsPatch": [{
49925
52355
  name: "deviceId",
49926
52356
  form: "single",
@@ -50891,6 +53321,11 @@ Object.freeze({
50891
53321
  form: "single",
50892
53322
  optional: false
50893
53323
  }],
53324
+ "pipelineAnalytics.addRetrainFrameFromRecording": [{
53325
+ name: "deviceId",
53326
+ form: "single",
53327
+ optional: false
53328
+ }],
50894
53329
  "pipelineAnalytics.applyDeviceSettingsPatch": [{
50895
53330
  name: "deviceId",
50896
53331
  form: "single",
@@ -51081,6 +53516,11 @@ Object.freeze({
51081
53516
  form: "single",
51082
53517
  optional: false
51083
53518
  }],
53519
+ "pipelineAnalytics.proposeRetrainAnnotationsWithLlm": [{
53520
+ name: "deviceId",
53521
+ form: "single",
53522
+ optional: false
53523
+ }],
51084
53524
  "pipelineAnalytics.pruneEventsBefore": [{
51085
53525
  name: "deviceId",
51086
53526
  form: "single",
@@ -51131,6 +53571,11 @@ Object.freeze({
51131
53571
  form: "single",
51132
53572
  optional: false
51133
53573
  }],
53574
+ "pipelineAnalytics.setRetrainFrameComplete": [{
53575
+ name: "deviceId",
53576
+ form: "single",
53577
+ optional: false
53578
+ }],
51134
53579
  "pipelineAnalytics.setTrackFlags": [{
51135
53580
  name: "deviceId",
51136
53581
  form: "single",
@@ -51151,6 +53596,11 @@ Object.freeze({
51151
53596
  form: "single",
51152
53597
  optional: false
51153
53598
  }],
53599
+ "pipelineExecutor.clearModelBoundDeviceOverrides": [{
53600
+ name: "deviceIds",
53601
+ form: "array",
53602
+ optional: true
53603
+ }],
51154
53604
  "pipelineExecutor.runPipeline": [{
51155
53605
  name: "deviceId",
51156
53606
  form: "single",
@@ -51256,6 +53706,11 @@ Object.freeze({
51256
53706
  form: "single",
51257
53707
  optional: false
51258
53708
  }],
53709
+ "pipelineOrchestrator.setCameraStepSettings": [{
53710
+ name: "deviceId",
53711
+ form: "single",
53712
+ optional: false
53713
+ }],
51259
53714
  "pipelineOrchestrator.setCameraStepToggle": [{
51260
53715
  name: "deviceId",
51261
53716
  form: "single",
@@ -52027,6 +54482,11 @@ Object.freeze({
52027
54482
  form: "single",
52028
54483
  optional: false
52029
54484
  }],
54485
+ "webrtcSession.applyDownlinkProbe": [{
54486
+ name: "deviceId",
54487
+ form: "single",
54488
+ optional: false
54489
+ }],
52030
54490
  "webrtcSession.closeSession": [{
52031
54491
  name: "deviceId",
52032
54492
  form: "single",
@@ -52256,6 +54716,8 @@ new Map(Object.entries({
52256
54716
  "detection-blind": "device-events",
52257
54717
  "node-online": "system",
52258
54718
  "node-offline": "system",
54719
+ "node-restarting": "system",
54720
+ "node-updating": "system",
52259
54721
  "node-inference-unavailable": "system",
52260
54722
  "addon-crash-loop": "system",
52261
54723
  "addon-update-available": "system",
@@ -52333,6 +54795,7 @@ var NC_SYSTEM_EVENT_KIND_GROUP_SPECS = [
52333
54795
  kinds: [
52334
54796
  "node-offline",
52335
54797
  "node-online",
54798
+ "node-restarting",
52336
54799
  "node-inference-unavailable"
52337
54800
  ]
52338
54801
  },
@@ -52354,6 +54817,7 @@ var NC_SYSTEM_EVENT_KIND_GROUP_SPECS = [
52354
54817
  label: "Server & container updates",
52355
54818
  kinds: [
52356
54819
  "server-update-available",
54820
+ "node-updating",
52357
54821
  "server-updated",
52358
54822
  "wrapper-update-available"
52359
54823
  ]
@@ -52501,6 +54965,7 @@ var STATE_SUMMARY_SECTION_VARS = [
52501
54965
  kinds: [
52502
54966
  "node-offline",
52503
54967
  "node-online",
54968
+ "node-restarting",
52504
54969
  "node-inference-unavailable"
52505
54970
  ]
52506
54971
  },
@@ -52522,6 +54987,7 @@ var STATE_SUMMARY_SECTION_VARS = [
52522
54987
  example: "server 1.2.377 → 1.2.378",
52523
54988
  kinds: [
52524
54989
  "server-update-available",
54990
+ "node-updating",
52525
54991
  "server-updated",
52526
54992
  "wrapper-update-available"
52527
54993
  ]
@@ -52554,7 +55020,7 @@ var STATE_SUMMARY_VARS = [
52554
55020
  {
52555
55021
  name: "summarySection",
52556
55022
  label: "Summary: this section",
52557
- description: "The section a per-section summary row is about (D698); on a summary sent as one message, every section it reports, comma-separated.",
55023
+ description: "The section a per-section summary row is about; on a summary sent as one message, every section it reports, comma-separated.",
52558
55024
  example: "Batterie scariche",
52559
55025
  group: "system",
52560
55026
  families: ["rule"],
@@ -53315,7 +55781,7 @@ var rtspCameraSchema = object({
53315
55781
  })).min(1)).describe("Published RTSP streams"),
53316
55782
  snapshotUrl: string().default("").describe("Snapshot URL (optional)"),
53317
55783
  username: string().default("").describe("Username"),
53318
- password: string().default("").describe("Password")
55784
+ password: string().default("").describe("Password").meta({ secret: true })
53319
55785
  });
53320
55786
  /**
53321
55787
  * Legacy storage shape: `[{ label: 'high'|'mid'|'low', url }]`.