@camstack/addon-provider-tuya 0.2.120 → 0.2.122

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 +2972 -506
  2. package/dist/addon.mjs +2972 -506
  3. package/package.json +1 -1
package/dist/addon.mjs CHANGED
@@ -818,7 +818,7 @@ async function discoverDevices(options = {}, binder = createDgramBinder()) {
818
818
  return [...byId.values()];
819
819
  }
820
820
  //#endregion
821
- //#region ../types/dist/event-category-BGmz_oxW.mjs
821
+ //#region ../types/dist/event-category-DaIZi00R.mjs
822
822
  var EventCategory = /* @__PURE__ */ function(EventCategory) {
823
823
  EventCategory["SystemBoot"] = "system.boot";
824
824
  EventCategory["SystemAddonsReady"] = "system.addons-ready";
@@ -897,6 +897,13 @@ var EventCategory = /* @__PURE__ */ function(EventCategory) {
897
897
  */
898
898
  EventCategory["AddonLoadFailed"] = "addon.load-failed";
899
899
  /**
900
+ * A keychain value was stored or removed (D787). Carries the ref, its
901
+ * owner and the new version — NEVER the value. A process holding the ref
902
+ * drops its cached copy and the owning `BaseAddon` re-resolves its config.
903
+ * Telemetry (D8): a process that misses it still revalidates by version.
904
+ */
905
+ EventCategory["KeychainChanged"] = "keychain.changed";
906
+ /**
900
907
  * Addon recovered from a previous failure. Emitted when an addon
901
908
  * transitions from `failed` back to `healthy` (typically via the
902
909
  * monitor's auto-retry loop, or after manual `addons.retryLoad`).
@@ -1319,15 +1326,6 @@ var EventCategory = /* @__PURE__ */ function(EventCategory) {
1319
1326
  EventCategory["AgentWsDisconnected"] = "agent.ws.disconnected";
1320
1327
  EventCategory["AgentBackupActivated"] = "agent.backup.activated";
1321
1328
  EventCategory["OrchestrationSettingsUpdated"] = "orchestration.settings-updated";
1322
- /**
1323
- * Per-agent hwaccel preference changed (user override set, cleared, or
1324
- * re-probed). Observability event — decoders pull the current pref at
1325
- * `createSession`, so running sessions keep their current backend until
1326
- * they rotate naturally (camera add/remove, stream restart). Future
1327
- * work can wire a listener in stream-broker that force-rotates live
1328
- * sessions; for now this event powers logs + admin-UI toast feedback.
1329
- */
1330
- EventCategory["PipelineAgentHwaccelChanged"] = "pipeline.agent-hwaccel-changed";
1331
1329
  EventCategory["MotionAnalysis"] = "detection.motion-analysis";
1332
1330
  /** All raw motion zones from CCL before minArea filter — for UI debug overlay. */
1333
1331
  EventCategory["MotionZonesRaw"] = "detection.motion-zones-raw";
@@ -6198,7 +6196,7 @@ var ZodIssueCode = {
6198
6196
  var ZodFirstPartyTypeKind;
6199
6197
  ZodFirstPartyTypeKind || (ZodFirstPartyTypeKind = {});
6200
6198
  //#endregion
6201
- //#region ../types/dist/sleep-DXKLNFvA.mjs
6199
+ //#region ../types/dist/sleep-Cr5YOk3m.mjs
6202
6200
  /**
6203
6201
  * The audio chunk plane's byte format, and the ONE expansion from a coded
6204
6202
  * window to float samples (D455).
@@ -6277,6 +6275,97 @@ function buildAlawTable() {
6277
6275
  }
6278
6276
  buildUlawTable();
6279
6277
  buildAlawTable();
6278
+ /** Is this field's stored value a credential? */
6279
+ function isSecretConfigField(field) {
6280
+ if (field.type === "password") return true;
6281
+ return "secret" in field && field.secret === true;
6282
+ }
6283
+ /**
6284
+ * Is this field's value stored in the KEYCHAIN (D787)? Every secret field is,
6285
+ * by its TYPE, unless it opts out with `storage: 'inline'` — never by its name.
6286
+ */
6287
+ function isKeychainStoredField(field) {
6288
+ if (!isSecretConfigField(field)) return false;
6289
+ if (field.type === "textarea" && field.isJson === true) return false;
6290
+ return !("storage" in field && field.storage === "inline");
6291
+ }
6292
+ /**
6293
+ * What a settings blob holds where a secret used to be.
6294
+ *
6295
+ * A keychain-stored field never holds its value. It holds a self-describing
6296
+ * MARKER, `{"$secret":"secret://…","v":1}` — an object, never a string, so no
6297
+ * code can mistake it for a credential and no form can send it to a camera as
6298
+ * a password. The empty state is `null` / absent, never `''`.
6299
+ *
6300
+ * The same shapes travel to and from the admin UI:
6301
+ *
6302
+ * - read: `hydrateSchema` hands a secret field a {@link SecretFieldView}
6303
+ * (`{ $secret, v, set: true }`) or `null` — the browser learns whether a
6304
+ * value is set, never the value.
6305
+ * - write: an untouched field submits the view back unchanged (KEEP); a typed
6306
+ * value is a plain non-empty string (CHANGE); the Clear button submits
6307
+ * {@link SECRET_CLEAR} (CLEAR). `''`, `null` and the legacy redaction tokens
6308
+ * are KEEP — an empty string is what a defaults-fallback pushes back, and
6309
+ * treating it as "clear" is how a save destroyed a stored credential before.
6310
+ *
6311
+ * Pure and browser-safe.
6312
+ */
6313
+ var SECRET_CLEAR = { $secretClear: true };
6314
+ /** The `'***'` token D634 redaction writes for non-admins. */
6315
+ var LEGACY_DEVICE_REDACTION = "***";
6316
+ function isRecord$1(value) {
6317
+ return typeof value === "object" && value !== null && !Array.isArray(value);
6318
+ }
6319
+ function makeSecretMarker(ref) {
6320
+ return {
6321
+ $secret: ref,
6322
+ v: 1
6323
+ };
6324
+ }
6325
+ /** A stored marker: an object whose `$secret` is a non-empty string. */
6326
+ function isSecretMarker(value) {
6327
+ if (!isRecord$1(value)) return false;
6328
+ const ref = value["$secret"];
6329
+ return typeof ref === "string" && ref.length > 0;
6330
+ }
6331
+ function isSecretClear(value) {
6332
+ return isRecord$1(value) && value["$secretClear"] === true;
6333
+ }
6334
+ /**
6335
+ * The UI view of a stored secret field value: a marker becomes "set", inline
6336
+ * plaintext becomes "set (inline)", nothing becomes `null`. A value never
6337
+ * survives this function.
6338
+ */
6339
+ function toSecretFieldView(stored) {
6340
+ if (isSecretMarker(stored)) return {
6341
+ $secret: stored.$secret,
6342
+ v: 1,
6343
+ set: true
6344
+ };
6345
+ if (typeof stored === "string" && stored.length > 0) return {
6346
+ $secret: null,
6347
+ v: 1,
6348
+ set: true,
6349
+ inline: true
6350
+ };
6351
+ return null;
6352
+ }
6353
+ /**
6354
+ * Classify an incoming value for a secret path. Only a non-empty string that is
6355
+ * not a redaction token sets a value; only {@link SECRET_CLEAR} clears.
6356
+ * Everything else — a marker (ours or anyone's), a UI view, `''`, `null`,
6357
+ * `undefined`, a redaction token, a non-string — keeps what is stored.
6358
+ */
6359
+ function classifySecretWrite(incoming) {
6360
+ if (isSecretClear(incoming)) return { kind: "clear" };
6361
+ if (typeof incoming !== "string") return { kind: "keep" };
6362
+ if (incoming.length === 0) return { kind: "keep" };
6363
+ if (incoming === "__camstack_redacted__" || incoming === LEGACY_DEVICE_REDACTION) return { kind: "keep" };
6364
+ return {
6365
+ kind: "set",
6366
+ value: incoming
6367
+ };
6368
+ }
6280
6369
  Object.fromEntries([
6281
6370
  {
6282
6371
  id: "overview",
@@ -6448,33 +6537,19 @@ Object.fromEntries([
6448
6537
  function isValuelessField(field) {
6449
6538
  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";
6450
6539
  }
6451
- /**
6452
- * Merge a `ConfigUISchema` with a raw `values` record into a
6453
- * `ConfigUISchemaWithValues`. Used by every `get*Settings` backend endpoint
6454
- * before returning to the admin UI. Groups are walked recursively.
6455
- *
6456
- * For each leaf field:
6457
- * - structural fields (`separator`, `info`, `button`) pass through unchanged
6458
- * - other fields get `value = values[key] ?? field.default ?? null`
6459
- *
6460
- * Unknown keys in `values` (keys not declared in the schema) are silently
6461
- * ignored — they don't contribute to the output. Missing keys fall back to
6462
- * the schema default or `null`. This mirrors the old backend behaviour where
6463
- * `FormBuilder` rendered `values[key] ?? field.default`.
6464
- */
6465
- function hydrateSchema(schema, values) {
6540
+ function hydrateSchema(schema, values, options = {}) {
6466
6541
  return {
6467
6542
  ...schema.tabs ? { tabs: [...schema.tabs] } : {},
6468
6543
  sections: schema.sections.map((section) => ({
6469
6544
  ...section,
6470
- fields: section.fields.map((field) => hydrateField(field, values))
6545
+ fields: section.fields.map((field) => hydrateField(field, values, options))
6471
6546
  }))
6472
6547
  };
6473
6548
  }
6474
- function hydrateField(field, values) {
6549
+ function hydrateField(field, values, options) {
6475
6550
  if (isValuelessField(field)) return field;
6476
6551
  if (field.type === "group") {
6477
- const hydratedChildren = field.fields.map((child) => hydrateField(child, values));
6552
+ const hydratedChildren = field.fields.map((child) => hydrateField(child, values, options));
6478
6553
  return {
6479
6554
  ...field,
6480
6555
  fields: hydratedChildren
@@ -6483,7 +6558,7 @@ function hydrateField(field, values) {
6483
6558
  if (field.type === "sub-tabs") {
6484
6559
  const hydratedTabs = field.tabs.map((tab) => ({
6485
6560
  ...tab,
6486
- fields: tab.fields.map((child) => hydrateField(child, values))
6561
+ fields: tab.fields.map((child) => hydrateField(child, values, options))
6487
6562
  }));
6488
6563
  return {
6489
6564
  ...field,
@@ -6493,6 +6568,33 @@ function hydrateField(field, values) {
6493
6568
  const key = field.key;
6494
6569
  const storedValue = Object.prototype.hasOwnProperty.call(values, key) ? values[key] : void 0;
6495
6570
  const defaultValue = field.default;
6571
+ const asView = (v) => isSecretMarker(v) || options.inlineSecretsAsViews === true && v !== void 0;
6572
+ if (isKeychainStoredField(field) && asView(storedValue)) return {
6573
+ ...field,
6574
+ value: toSecretFieldView(storedValue)
6575
+ };
6576
+ if (isKeychainStoredField(field) && options.inlineSecretsAsViews === true) return {
6577
+ ...field,
6578
+ value: null
6579
+ };
6580
+ if (field.type === "editable-array" && Array.isArray(storedValue)) {
6581
+ const secretItemKeys = field.itemFields.filter((item) => "key" in item && isKeychainStoredField(item)).map((item) => "key" in item ? item.key : "");
6582
+ if (secretItemKeys.length > 0) {
6583
+ const rows = storedValue.map((row) => {
6584
+ if (row === null || typeof row !== "object" || Array.isArray(row)) return row;
6585
+ const out = { ...row };
6586
+ for (const k of secretItemKeys) {
6587
+ const v = Reflect.get(row, k);
6588
+ if (asView(v)) out[k] = toSecretFieldView(v);
6589
+ }
6590
+ return out;
6591
+ });
6592
+ return {
6593
+ ...field,
6594
+ value: rows
6595
+ };
6596
+ }
6597
+ }
6496
6598
  if (field.multiple) {
6497
6599
  const stored = Array.isArray(storedValue) ? storedValue : storedValue !== void 0 && storedValue !== null ? [storedValue] : [];
6498
6600
  const itemFallback = field.multiple.itemDefault !== void 0 ? field.multiple.itemDefault : defaultValue !== void 0 ? defaultValue : typeOf(field) === "string" ? "" : null;
@@ -6735,6 +6837,431 @@ function projectStore(store, perNodeKeys, nodeId) {
6735
6837
  }
6736
6838
  return out;
6737
6839
  }
6840
+ var GLOBAL_SCOPE = { kind: "global" };
6841
+ /** The scope every addon-wide (not per-node, not per-device) setting lives in. */
6842
+ function globalSecretScope() {
6843
+ return GLOBAL_SCOPE;
6844
+ }
6845
+ function encodeSegment(value) {
6846
+ return encodeURIComponent(value);
6847
+ }
6848
+ /**
6849
+ * The field path of a value inside an array item, addressed by the item's id:
6850
+ * `arrayItemFieldPath('providers', 'authentik', 'clientSecret')` →
6851
+ * `providers[authentik].clientSecret`.
6852
+ */
6853
+ function arrayItemFieldPath(arrayKey, itemId, fieldKey) {
6854
+ return `${arrayKey}[${encodeSegment(itemId)}].${fieldKey}`;
6855
+ }
6856
+ /** A write to a secret path could not be stored in the keychain, so it was refused. */
6857
+ var KeychainWriteRefusedError = class extends Error {
6858
+ fieldPath;
6859
+ constructor(fieldPath, cause) {
6860
+ super(`secret "${fieldPath}" was not saved: the keychain could not store it (${cause instanceof Error ? cause.message : String(cause)}). Nothing was written.`);
6861
+ this.fieldPath = fieldPath;
6862
+ this.name = "KeychainWriteRefusedError";
6863
+ }
6864
+ };
6865
+ var KEEP = { kind: "keep" };
6866
+ function isRecord(value) {
6867
+ return typeof value === "object" && value !== null && !Array.isArray(value);
6868
+ }
6869
+ function defaultMintId() {
6870
+ return globalThis.crypto.randomUUID();
6871
+ }
6872
+ /** Every marker ref anywhere under `value`. */
6873
+ function collectSecretMarkerRefs(value, out = []) {
6874
+ if (isSecretMarker(value)) {
6875
+ out.push(value.$secret);
6876
+ return out;
6877
+ }
6878
+ if (Array.isArray(value)) for (const item of value) collectSecretMarkerRefs(item, out);
6879
+ else if (isRecord(value)) for (const child of Object.values(value)) collectSecretMarkerRefs(child, out);
6880
+ return out;
6881
+ }
6882
+ async function storedValueEquals(secrets, marker, candidate) {
6883
+ const resolved = (await secrets.resolve([marker.$secret]))[marker.$secret];
6884
+ return resolved?.kind === "value" && resolved.value === candidate;
6885
+ }
6886
+ async function writeLeaf(ctx, incoming, stored, fieldPath) {
6887
+ const intent = classifySecretWrite(incoming);
6888
+ const ref = ctx.secrets.ref(ctx.scope, fieldPath);
6889
+ const storedIsOurs = isSecretMarker(stored) && stored.$secret === ref;
6890
+ if (intent.kind === "keep") return KEEP;
6891
+ if (intent.kind === "set" && !ctx.operatorWrite && typeof stored === "string" && stored === intent.value) return KEEP;
6892
+ if (intent.kind === "clear") {
6893
+ if (storedIsOurs) ctx.deletes.push(ref);
6894
+ return {
6895
+ kind: "value",
6896
+ value: null
6897
+ };
6898
+ }
6899
+ if (storedIsOurs && await storedValueEquals(ctx.secrets, stored, intent.value)) return {
6900
+ kind: "value",
6901
+ value: stored
6902
+ };
6903
+ try {
6904
+ await ctx.secrets.put(ref, intent.value);
6905
+ } catch (err) {
6906
+ throw new KeychainWriteRefusedError(fieldPath, err);
6907
+ }
6908
+ return {
6909
+ kind: "value",
6910
+ value: makeSecretMarker(ref)
6911
+ };
6912
+ }
6913
+ /** Apply a member result onto `out`: KEEP restores the stored member, or removes it. */
6914
+ function applyMember(out, key, result, storedParent) {
6915
+ if (result.kind === "value") {
6916
+ out[key] = result.value;
6917
+ return;
6918
+ }
6919
+ if (Object.prototype.hasOwnProperty.call(storedParent, key)) out[key] = storedParent[key];
6920
+ else delete out[key];
6921
+ }
6922
+ async function writeMembers(ctx, children, incoming, stored, pathOf) {
6923
+ const out = { ...incoming };
6924
+ for (const [member, node] of children) applyMember(out, member, await writeNode(ctx, node, incoming[member], stored[member], pathOf(member)), stored);
6925
+ return out;
6926
+ }
6927
+ function rowId(row, idKey) {
6928
+ const raw = row[idKey];
6929
+ if (typeof raw === "string" && raw.length > 0) return raw;
6930
+ if (typeof raw === "number" && Number.isFinite(raw)) return String(raw);
6931
+ return null;
6932
+ }
6933
+ async function writeArray(ctx, node, incoming, stored, fieldPath) {
6934
+ const storedRows = Array.isArray(stored) ? stored.filter(isRecord) : [];
6935
+ if (!Array.isArray(incoming)) {
6936
+ ctx.deletes.push(...collectSecretMarkerRefs(storedRows));
6937
+ return {
6938
+ kind: "value",
6939
+ value: incoming
6940
+ };
6941
+ }
6942
+ const storedById = /* @__PURE__ */ new Map();
6943
+ for (const row of storedRows) {
6944
+ const id = rowId(row, node.idKey);
6945
+ if (id !== null) storedById.set(id, row);
6946
+ }
6947
+ const kept = /* @__PURE__ */ new Set();
6948
+ const rows = [];
6949
+ for (const row of incoming) {
6950
+ if (!isRecord(row)) {
6951
+ rows.push(row);
6952
+ continue;
6953
+ }
6954
+ const id = rowId(row, node.idKey) ?? ctx.mintId();
6955
+ kept.add(id);
6956
+ const withId = {
6957
+ ...row,
6958
+ [node.idKey]: row[node.idKey] ?? id
6959
+ };
6960
+ if (rowId(withId, node.idKey) === null) withId[node.idKey] = id;
6961
+ const storedRow = storedById.get(id) ?? {};
6962
+ rows.push(await writeMembers(ctx, node.item, withId, storedRow, (member) => arrayItemFieldPath(fieldPath, id, member)));
6963
+ }
6964
+ for (const [id, row] of storedById) if (!kept.has(id)) ctx.deletes.push(...collectSecretMarkerRefs(row));
6965
+ return {
6966
+ kind: "value",
6967
+ value: rows
6968
+ };
6969
+ }
6970
+ async function writeNode(ctx, node, incoming, stored, fieldPath) {
6971
+ switch (node.kind) {
6972
+ case "leaf": return writeLeaf(ctx, incoming, stored, fieldPath);
6973
+ case "array": return writeArray(ctx, node, incoming, stored, fieldPath);
6974
+ case "object": {
6975
+ if (!isRecord(incoming)) {
6976
+ if (incoming === void 0) return KEEP;
6977
+ ctx.deletes.push(...collectSecretMarkerRefs(stored));
6978
+ return {
6979
+ kind: "value",
6980
+ value: incoming
6981
+ };
6982
+ }
6983
+ const storedObj = isRecord(stored) ? stored : {};
6984
+ return {
6985
+ kind: "value",
6986
+ value: await writeMembers(ctx, node.children, incoming, storedObj, (m) => `${fieldPath}.${m}`)
6987
+ };
6988
+ }
6989
+ }
6990
+ }
6991
+ /** Split a perNode-scoped key (`key@nodeId`). */
6992
+ function splitNodeKey(key) {
6993
+ const at = key.indexOf("@");
6994
+ return at <= 0 ? {
6995
+ base: key,
6996
+ nodeId: null
6997
+ } : {
6998
+ base: key.slice(0, at),
6999
+ nodeId: key.slice(at + 1)
7000
+ };
7001
+ }
7002
+ /** Rewrite a settings patch so no secret value reaches the blob. See the file doc. */
7003
+ async function transformSecretWrite(input) {
7004
+ const deletes = [];
7005
+ const base = {
7006
+ secrets: input.secrets,
7007
+ mintId: input.mintId ?? defaultMintId,
7008
+ deletes,
7009
+ operatorWrite: input.operatorWrite === true
7010
+ };
7011
+ const out = {};
7012
+ for (const [key, incoming] of Object.entries(input.patch)) {
7013
+ const { base: baseKey, nodeId } = splitNodeKey(key);
7014
+ const node = input.tree.get(baseKey);
7015
+ if (node === void 0) {
7016
+ out[key] = incoming;
7017
+ continue;
7018
+ }
7019
+ const scope = nodeId !== null && nodeId.length > 0 ? {
7020
+ kind: "node",
7021
+ nodeId
7022
+ } : input.scope ?? globalSecretScope();
7023
+ const result = await writeNode({
7024
+ ...base,
7025
+ scope
7026
+ }, node, incoming, input.stored[key], baseKey);
7027
+ if (result.kind === "value") out[key] = result.value;
7028
+ }
7029
+ return {
7030
+ patch: out,
7031
+ afterWrite: async () => {
7032
+ if (deletes.length === 0) return { orphaned: [] };
7033
+ try {
7034
+ await input.secrets.delete([...new Set(deletes)]);
7035
+ return { orphaned: [] };
7036
+ } catch {
7037
+ return { orphaned: [...new Set(deletes)] };
7038
+ }
7039
+ }
7040
+ };
7041
+ }
7042
+ /**
7043
+ * Replace every marker in `value` with its keychain value. Returns the SAME
7044
+ * reference when there is no marker (no allocation, no keychain call).
7045
+ */
7046
+ async function resolveSecretMarkers(value, secrets) {
7047
+ const refs = collectSecretMarkerRefs(value);
7048
+ if (refs.length === 0) return {
7049
+ value,
7050
+ unresolved: []
7051
+ };
7052
+ const answers = await secrets.resolve(refs);
7053
+ const unresolved = [];
7054
+ for (const ref of new Set(refs)) {
7055
+ const answer = answers[ref];
7056
+ if (answer === void 0) unresolved.push({
7057
+ ref,
7058
+ reason: "not-initialized"
7059
+ });
7060
+ else if (answer.kind === "unavailable") unresolved.push({
7061
+ ref,
7062
+ reason: answer.reason
7063
+ });
7064
+ else if (answer.kind === "missing" || answer.kind === "forbidden") unresolved.push({
7065
+ ref,
7066
+ reason: answer.kind
7067
+ });
7068
+ }
7069
+ const substitute = (v) => {
7070
+ if (isSecretMarker(v)) {
7071
+ const answer = answers[v.$secret];
7072
+ return answer?.kind === "value" ? {
7073
+ keep: true,
7074
+ value: answer.value
7075
+ } : {
7076
+ keep: false,
7077
+ value: void 0
7078
+ };
7079
+ }
7080
+ if (Array.isArray(v)) {
7081
+ const items = [];
7082
+ for (const item of v) {
7083
+ const s = substitute(item);
7084
+ if (s.keep) items.push(s.value);
7085
+ }
7086
+ return {
7087
+ keep: true,
7088
+ value: items
7089
+ };
7090
+ }
7091
+ if (isRecord(v)) {
7092
+ const out = {};
7093
+ for (const [k, child] of Object.entries(v)) {
7094
+ const s = substitute(child);
7095
+ if (s.keep) out[k] = s.value;
7096
+ }
7097
+ return {
7098
+ keep: true,
7099
+ value: out
7100
+ };
7101
+ }
7102
+ return {
7103
+ keep: true,
7104
+ value: v
7105
+ };
7106
+ };
7107
+ return {
7108
+ value: substitute(value).value,
7109
+ unresolved
7110
+ };
7111
+ }
7112
+ function touchesTree(tree, patch) {
7113
+ if (tree.size === 0) return false;
7114
+ for (const key of Object.keys(patch)) {
7115
+ const at = key.indexOf("@");
7116
+ if (tree.has(at > 0 ? key.slice(0, at) : key)) return true;
7117
+ }
7118
+ return false;
7119
+ }
7120
+ /** The blob as stored now; a failed read REFUSES the write instead of guessing. */
7121
+ async function readStoredAddonBlob(raw) {
7122
+ const threeWay = raw.readAddonStoreResult;
7123
+ if (threeWay === void 0) return raw.readAddonStore();
7124
+ const result = await threeWay.call(raw);
7125
+ if (result.kind === "failed") throw new Error(`settings write refused: the stored blob could not be read (${result.error})`);
7126
+ return result.kind === "missing" ? {} : result.value;
7127
+ }
7128
+ function createSecretAwareSettings(raw, opts) {
7129
+ const chains = /* @__PURE__ */ new Map();
7130
+ const serialize = (key, fn) => {
7131
+ const next = (chains.get(key) ?? Promise.resolve()).then(fn, fn);
7132
+ const tail = next.catch(() => void 0);
7133
+ chains.set(key, tail);
7134
+ tail.then(() => {
7135
+ if (chains.get(key) === tail) chains.delete(key);
7136
+ });
7137
+ return next;
7138
+ };
7139
+ const write = async (chainKey, tree, scope, patch, readStored, rawWrite) => {
7140
+ if (!touchesTree(tree, patch)) return rawWrite(patch);
7141
+ return serialize(chainKey, async () => {
7142
+ const stored = await readStored();
7143
+ const result = await transformSecretWrite({
7144
+ tree,
7145
+ secrets: opts.secrets,
7146
+ patch,
7147
+ stored,
7148
+ ...scope !== void 0 ? { scope } : {},
7149
+ operatorWrite: opts.isOperatorWrite?.() === true
7150
+ });
7151
+ if (Object.keys(result.patch).length > 0) await rawWrite(result.patch);
7152
+ const { orphaned } = await result.afterWrite();
7153
+ if (orphaned.length > 0) opts.onOrphaned(orphaned);
7154
+ });
7155
+ };
7156
+ const wrapped = {
7157
+ writeAddonStore: (patch) => write("addon", opts.addonTree(), void 0, patch, () => readStoredAddonBlob(raw), (p) => raw.writeAddonStore(p)),
7158
+ writeDeviceStore: (deviceId, patch) => write(`device:${deviceId}`, opts.deviceTree(), {
7159
+ kind: "device",
7160
+ deviceId
7161
+ }, patch, () => raw.readDeviceStore(deviceId), (p) => raw.writeDeviceStore(deviceId, p))
7162
+ };
7163
+ return new Proxy(raw, { get(target, prop, receiver) {
7164
+ if (prop === "writeAddonStore") return wrapped.writeAddonStore;
7165
+ if (prop === "writeDeviceStore") return wrapped.writeDeviceStore;
7166
+ const value = Reflect.get(target, prop, receiver);
7167
+ return typeof value === "function" ? value.bind(target) : value;
7168
+ } });
7169
+ }
7170
+ /** The context the addon sees: identical, except that its settings writes are secret-aware. */
7171
+ function withSecretAwareSettings(context, opts) {
7172
+ const raw = context.settings;
7173
+ if (raw === void 0) return context;
7174
+ const settings = createSecretAwareSettings(raw, opts);
7175
+ return new Proxy(context, { get(target, prop, receiver) {
7176
+ if (prop === "settings") return settings;
7177
+ return Reflect.get(target, prop, receiver);
7178
+ } });
7179
+ }
7180
+ var LEAF = { kind: "leaf" };
7181
+ var DEFAULT_ITEM_ID_KEY = "id";
7182
+ function collectFields(fields, out) {
7183
+ for (const field of fields) {
7184
+ if (field.type === "group") {
7185
+ collectFields(field.fields, out);
7186
+ continue;
7187
+ }
7188
+ if (field.type === "sub-tabs") {
7189
+ for (const tab of field.tabs) collectFields(tab.fields, out);
7190
+ continue;
7191
+ }
7192
+ if (field.type === "editable-array") {
7193
+ const item = /* @__PURE__ */ new Map();
7194
+ for (const itemField of field.itemFields) if ("key" in itemField && isKeychainStoredField(itemField)) item.set(itemField.key, LEAF);
7195
+ if (item.size > 0) out.set(field.key, {
7196
+ kind: "array",
7197
+ idKey: field.itemIdKey ?? DEFAULT_ITEM_ID_KEY,
7198
+ item
7199
+ });
7200
+ continue;
7201
+ }
7202
+ if (!("key" in field) || typeof field.key !== "string") continue;
7203
+ if (isKeychainStoredField(field)) out.set(field.key, LEAF);
7204
+ }
7205
+ }
7206
+ /** The secret tree a settings schema declares. */
7207
+ function secretTreeFromSchema(schema) {
7208
+ const out = /* @__PURE__ */ new Map();
7209
+ if (schema === null) return out;
7210
+ for (const section of schema.sections) collectFields(section.fields, out);
7211
+ return out;
7212
+ }
7213
+ /** Parse `a.b[id].c` into segments; throws on a malformed path (a declaration bug). */
7214
+ function parseSecretStatePath(path) {
7215
+ const segments = [];
7216
+ for (const raw of path.split(".")) {
7217
+ const m = /^([^[\]]+)(?:\[([^[\]]+)\])?$/.exec(raw);
7218
+ if (m === null || m[1] === void 0) throw new Error(`secretStatePaths: malformed path "${path}"`);
7219
+ segments.push(m[2] !== void 0 ? {
7220
+ key: m[1],
7221
+ idKey: m[2]
7222
+ } : { key: m[1] });
7223
+ }
7224
+ if (segments.length === 0) throw new Error(`secretStatePaths: empty path`);
7225
+ if (segments[segments.length - 1]?.idKey !== void 0) throw new Error(`secretStatePaths: "${path}" ends on an array — name the member that is secret`);
7226
+ return segments;
7227
+ }
7228
+ function insert(into, segments) {
7229
+ const [head, ...rest] = segments;
7230
+ if (head === void 0) return;
7231
+ if (rest.length === 0) {
7232
+ into.set(head.key, LEAF);
7233
+ return;
7234
+ }
7235
+ const existing = into.get(head.key);
7236
+ if (head.idKey !== void 0) {
7237
+ const item = new Map(existing?.kind === "array" ? existing.item : []);
7238
+ insert(item, rest);
7239
+ into.set(head.key, {
7240
+ kind: "array",
7241
+ idKey: head.idKey,
7242
+ item
7243
+ });
7244
+ return;
7245
+ }
7246
+ const children = new Map(existing?.kind === "object" ? existing.children : []);
7247
+ insert(children, rest);
7248
+ into.set(head.key, {
7249
+ kind: "object",
7250
+ children
7251
+ });
7252
+ }
7253
+ /** Add hidden-state paths (`secretStatePaths`) to a schema-derived tree. */
7254
+ function mergeSecretStatePaths(tree, paths) {
7255
+ if (paths.length === 0) return tree;
7256
+ const out = new Map(tree);
7257
+ for (const path of paths) insert(out, parseSecretStatePath(path));
7258
+ return out;
7259
+ }
7260
+ /** First retry of a secret the keychain could not serve; doubles to {@link SECRET_RETRY_MAX_MS}. */
7261
+ var SECRET_RETRY_FIRST_MS = 5e3;
7262
+ var SECRET_RETRY_MAX_MS = 5 * 6e4;
7263
+ /** Coalesces a burst of `keychain.changed` events into one re-resolve. */
7264
+ var SECRET_CHANGE_DEBOUNCE_MS = 250;
6738
7265
  /**
6739
7266
  * Base class for CamStack addons. Eliminates settings boilerplate:
6740
7267
  *
@@ -6804,6 +7331,25 @@ var BaseAddon = class {
6804
7331
  settingsStoreReady = false;
6805
7332
  /** Default config values. Provided via constructor. */
6806
7333
  defaults;
7334
+ /**
7335
+ * Hidden-state paths that hold secrets (D787) — values the addon writes
7336
+ * itself (`updateGlobalSettings`, `state()`) that no form field declares.
7337
+ * Stored in the keychain exactly like a `password` field. Syntax:
7338
+ * `'snapshotSigningKey'`, `'identity.pincode'`, `'tokens[userId].accessToken'`
7339
+ * (`key[<id field>]` addresses array items by id, never by index).
7340
+ */
7341
+ secretStatePaths = [];
7342
+ _addonSecretTree = null;
7343
+ _deviceSecretTree = null;
7344
+ /** Refs the last resolved config pointed at — a change to one re-resolves. */
7345
+ _configSecretRefs = /* @__PURE__ */ new Set();
7346
+ _unresolvedSecrets = [];
7347
+ _secretRetryTimer = null;
7348
+ _secretRetryDelayMs = SECRET_RETRY_FIRST_MS;
7349
+ _secretChangeTimer = null;
7350
+ _secretChangeUnsub = null;
7351
+ /** >0 while an OPERATOR's settings write is being applied. */
7352
+ _operatorWriteDepth = 0;
6807
7353
  constructor(defaults) {
6808
7354
  this.defaults = defaults;
6809
7355
  this._config = { ...defaults };
@@ -6839,8 +7385,18 @@ var BaseAddon = class {
6839
7385
  return this._config;
6840
7386
  }
6841
7387
  async initialize(context) {
6842
- this._ctx = context;
7388
+ const secrets = context.secrets;
7389
+ this._ctx = secrets !== void 0 ? withSecretAwareSettings(context, {
7390
+ secrets,
7391
+ addonTree: () => this.addonSecretTree(),
7392
+ deviceTree: () => this.deviceSecretTree(),
7393
+ onOrphaned: (refs) => context.logger.warn("keychain refs dropped by a settings write could not be deleted", { meta: { refs: [...refs] } }),
7394
+ isOperatorWrite: () => this._operatorWriteDepth > 0
7395
+ }) : context;
6843
7396
  await this.resolveConfig();
7397
+ if (secrets !== void 0) this._secretChangeUnsub = secrets.onChange((ref) => {
7398
+ if (this._configSecretRefs.has(ref)) this.scheduleSecretReresolve(SECRET_CHANGE_DEBOUNCE_MS);
7399
+ });
6844
7400
  const result = await this.onInitialize();
6845
7401
  this.emitLifecycle(EventCategory.AddonStarted);
6846
7402
  const normalized = normalizeAddonInitResult(result);
@@ -6873,6 +7429,12 @@ var BaseAddon = class {
6873
7429
  */
6874
7430
  async onHubReachable() {}
6875
7431
  async shutdown() {
7432
+ this._secretChangeUnsub?.();
7433
+ this._secretChangeUnsub = null;
7434
+ if (this._secretRetryTimer !== null) clearTimeout(this._secretRetryTimer);
7435
+ if (this._secretChangeTimer !== null) clearTimeout(this._secretChangeTimer);
7436
+ this._secretRetryTimer = null;
7437
+ this._secretChangeTimer = null;
6876
7438
  this.emitLifecycle(EventCategory.AddonStopped);
6877
7439
  if (this.autoEmitReadiness) this.emitReadinessForProviders("down");
6878
7440
  await this.onShutdown();
@@ -6951,7 +7513,7 @@ var BaseAddon = class {
6951
7513
  return hydrateSchema(schema, overlay ? {
6952
7514
  ...projected,
6953
7515
  ...overlay
6954
- } : projected);
7516
+ } : projected, { inlineSecretsAsViews: true });
6955
7517
  }
6956
7518
  /**
6957
7519
  * The integration-level view of this addon's settings: exactly the sections
@@ -7000,7 +7562,7 @@ var BaseAddon = class {
7000
7562
  return hydrateSchema({
7001
7563
  ...schema,
7002
7564
  sections
7003
- }, projected);
7565
+ }, projected, { inlineSecretsAsViews: true });
7004
7566
  }
7005
7567
  /**
7006
7568
  * The raw addon store PROJECTED onto the target node's bare per-node keys:
@@ -7054,18 +7616,50 @@ var BaseAddon = class {
7054
7616
  value: result.value[key]
7055
7617
  };
7056
7618
  }
7619
+ /**
7620
+ * The OPERATOR's write — a settings form or an admin API call, dispatched by
7621
+ * the kernel. Identical to {@link updateGlobalSettings}, except that a secret
7622
+ * the operator sends is stored as sent even when it equals a pre-keychain
7623
+ * inline value: the operator re-entering a password is a change, an addon
7624
+ * writing back what it read is not (D787).
7625
+ */
7626
+ async updateGlobalSettingsAsOperator(patch, nodeId) {
7627
+ this._operatorWriteDepth++;
7628
+ try {
7629
+ await this.applyGlobalPatch(patch, nodeId);
7630
+ } finally {
7631
+ this._operatorWriteDepth--;
7632
+ }
7633
+ }
7057
7634
  async updateGlobalSettings(patch, nodeId) {
7635
+ await this.applyGlobalPatch(patch, nodeId);
7636
+ }
7637
+ /**
7638
+ * REMOVE stored secrets — their keychain values and their markers (D787).
7639
+ *
7640
+ * Writing `''` to a secret field KEEPS what is stored (an empty string is
7641
+ * what a defaults fallback writes back, and it must never destroy a
7642
+ * credential), so code that means "forget this token" says so here. Without
7643
+ * a keychain (an older kernel) it writes `''`, as such code always did.
7644
+ */
7645
+ async clearSecrets(keys, nodeId) {
7646
+ const tree = this.addonSecretTree();
7647
+ const keychain = this._ctx?.secrets !== void 0;
7648
+ const patch = {};
7649
+ for (const key of keys) patch[key] = keychain && tree.has(key) ? SECRET_CLEAR : "";
7650
+ await this.applyGlobalPatch(patch, nodeId);
7651
+ }
7652
+ async applyGlobalPatch(barePatch, nodeId) {
7058
7653
  const keys = this.perNodeKeys();
7059
7654
  const localNode = normalizeNodeId(this._ctx?.kernel?.localNodeId);
7060
7655
  const target = normalizeNodeId(nodeId ?? this._ctx?.kernel?.localNodeId);
7061
- const barePatch = patch;
7062
7656
  const scoped = keys.size > 0 ? scopePatch(barePatch, keys, target) : barePatch;
7063
7657
  await this._ctx?.settings?.writeAddonStore(scoped);
7064
7658
  if (target !== localNode) return;
7065
7659
  await this.resolveConfig();
7066
7660
  await this.onConfigChanged();
7067
7661
  this.emitLifecycle(EventCategory.AddonUpdated, { level: "global" });
7068
- this.maybeAutoRestart(patch, this.globalSettingsSchema());
7662
+ this.maybeAutoRestart(Object.keys(barePatch), this.globalSettingsSchema());
7069
7663
  }
7070
7664
  /**
7071
7665
  * The set of field keys the global settings schema declares `perNode: true`
@@ -7090,7 +7684,7 @@ var BaseAddon = class {
7090
7684
  * time to return its response before the addon is torn down and
7091
7685
  * re-initialised by `AddonRegistryService.restartAddon`.
7092
7686
  */
7093
- maybeAutoRestart(patch, schema) {
7687
+ maybeAutoRestart(patchKeys, schema) {
7094
7688
  if (!schema) return;
7095
7689
  const restartKeys = /* @__PURE__ */ new Set();
7096
7690
  for (const section of schema.sections) for (const field of section.fields) {
@@ -7098,13 +7692,13 @@ var BaseAddon = class {
7098
7692
  if (field.requiresRestart) restartKeys.add(field.key);
7099
7693
  }
7100
7694
  if (restartKeys.size === 0) return;
7101
- if (!Object.keys(patch).some((k) => restartKeys.has(k))) return;
7695
+ if (!patchKeys.some((k) => restartKeys.has(k))) return;
7102
7696
  const ctx = this._ctx;
7103
7697
  if (!ctx) return;
7104
7698
  const addonId = ctx.id;
7105
7699
  setImmediate(() => {
7106
7700
  ctx.api.addons?.restartAddon?.mutate({ addonId }).then(() => {
7107
- ctx.logger.info("addon auto-restart triggered by restart-required setting change", { meta: { changedFields: Object.keys(patch).filter((k) => restartKeys.has(k)) } });
7701
+ ctx.logger.info("addon auto-restart triggered by restart-required setting change", { meta: { changedFields: patchKeys.filter((k) => restartKeys.has(k)) } });
7108
7702
  }).catch((err) => {
7109
7703
  ctx.logger.error("addon auto-restart failed", { meta: { error: err instanceof Error ? err.message : String(err) } });
7110
7704
  });
@@ -7113,7 +7707,7 @@ var BaseAddon = class {
7113
7707
  async getDeviceSettings(deviceId) {
7114
7708
  const schema = this.deviceSettingsSchema();
7115
7709
  if (!schema) return { sections: [] };
7116
- return hydrateSchema(schema, await this._ctx?.settings?.readDeviceStore(deviceId) ?? {});
7710
+ return hydrateSchema(schema, await this._ctx?.settings?.readDeviceStore(deviceId) ?? {}, { inlineSecretsAsViews: true });
7117
7711
  }
7118
7712
  async updateDeviceSettings(deviceId, patch) {
7119
7713
  await this._ctx?.settings?.writeDeviceStore(deviceId, patch);
@@ -7243,7 +7837,7 @@ var BaseAddon = class {
7243
7837
  * selection at boot (absent scoped key ⇒ the constructor default wins).
7244
7838
  */
7245
7839
  async resolveConfig() {
7246
- const stored = await this.readAddonStoreWithRetry();
7840
+ const stored = await this.resolveStoredSecrets(await this.readAddonStoreWithRetry());
7247
7841
  const perNode = this.perNodeKeys();
7248
7842
  const localNode = normalizeNodeId(this._ctx?.kernel?.localNodeId);
7249
7843
  const resolved = { ...this.defaults };
@@ -7268,7 +7862,7 @@ var BaseAddon = class {
7268
7862
  key,
7269
7863
  schema,
7270
7864
  fallback,
7271
- read: () => this.readAddonStoreWithRetry(),
7865
+ read: async () => this.resolveStoredSecrets(await this.readAddonStoreWithRetry()),
7272
7866
  write: async (patch) => {
7273
7867
  await this._ctx?.settings?.writeAddonStore(patch);
7274
7868
  },
@@ -7285,7 +7879,7 @@ var BaseAddon = class {
7285
7879
  key,
7286
7880
  schema,
7287
7881
  fallback,
7288
- read: async () => await this._ctx?.settings?.readDeviceStore(deviceId) ?? {},
7882
+ read: async () => this.resolveStoredSecrets(await this._ctx?.settings?.readDeviceStore(deviceId) ?? {}, false),
7289
7883
  write: async (patch) => {
7290
7884
  await this._ctx?.settings?.writeDeviceStore(deviceId, patch);
7291
7885
  },
@@ -7297,6 +7891,70 @@ var BaseAddon = class {
7297
7891
  } })
7298
7892
  });
7299
7893
  }
7894
+ /** The addon store's secret tree: schema fields by TYPE, plus `secretStatePaths`. */
7895
+ addonSecretTree() {
7896
+ this._addonSecretTree ??= mergeSecretStatePaths(secretTreeFromSchema(this.globalSettingsSchema()), this.secretStatePaths);
7897
+ return this._addonSecretTree;
7898
+ }
7899
+ deviceSecretTree() {
7900
+ this._deviceSecretTree ??= secretTreeFromSchema(this.deviceSettingsSchema());
7901
+ return this._deviceSecretTree;
7902
+ }
7903
+ /**
7904
+ * Secrets of this addon's stored config that could not be resolved on the
7905
+ * last read, with why. Non-empty means the addon is running WITHOUT them —
7906
+ * an addon whose function needs one should report itself degraded rather
7907
+ * than start on an empty credential.
7908
+ */
7909
+ get unresolvedSecrets() {
7910
+ return this._unresolvedSecrets;
7911
+ }
7912
+ /**
7913
+ * Substitute every keychain marker in a stored blob with its value. With no
7914
+ * keychain (no `ctx.secrets`) or no marker, the blob comes back unchanged.
7915
+ * An unresolvable value is LEFT OUT (never `''`), logged by ref — never by
7916
+ * value — and, when the cause can pass, retried with backoff. Nothing is
7917
+ * ever written back from here.
7918
+ */
7919
+ async resolveStoredSecrets(blob, trackForConfig = true) {
7920
+ const secrets = this._ctx?.secrets;
7921
+ if (secrets === void 0) return blob;
7922
+ const refs = collectSecretMarkerRefs(blob);
7923
+ if (trackForConfig) this._configSecretRefs = new Set(refs);
7924
+ if (refs.length === 0) {
7925
+ if (trackForConfig) this._unresolvedSecrets = [];
7926
+ return blob;
7927
+ }
7928
+ const { value, unresolved } = await resolveSecretMarkers(blob, secrets);
7929
+ if (trackForConfig) {
7930
+ this._unresolvedSecrets = unresolved;
7931
+ if (unresolved.length > 0) {
7932
+ this._ctx?.logger?.error?.("secret unavailable — running without it, will retry", { meta: { secrets: unresolved.map((u) => ({
7933
+ ref: u.ref,
7934
+ reason: u.reason
7935
+ })) } });
7936
+ if (unresolved.some((u) => u.reason !== "missing" && u.reason !== "forbidden")) {
7937
+ this.scheduleSecretReresolve(this._secretRetryDelayMs);
7938
+ this._secretRetryDelayMs = Math.min(this._secretRetryDelayMs * 2, SECRET_RETRY_MAX_MS);
7939
+ }
7940
+ } else this._secretRetryDelayMs = SECRET_RETRY_FIRST_MS;
7941
+ }
7942
+ return value;
7943
+ }
7944
+ /** Re-resolve the config (a keychain-only change, or a retry) and apply it. */
7945
+ scheduleSecretReresolve(delayMs) {
7946
+ const timerOf = delayMs === SECRET_CHANGE_DEBOUNCE_MS ? "_secretChangeTimer" : "_secretRetryTimer";
7947
+ if (this[timerOf] !== null) return;
7948
+ const timer = setTimeout(() => {
7949
+ this[timerOf] = null;
7950
+ if (this._ctx === null) return;
7951
+ this.resolveConfig().then(() => this.onConfigChanged()).catch((err) => {
7952
+ this._ctx?.logger?.error?.("re-resolving secrets failed", { meta: { error: err instanceof Error ? err.message : String(err) } });
7953
+ });
7954
+ }, delayMs);
7955
+ timer.unref?.();
7956
+ this[timerOf] = timer;
7957
+ }
7300
7958
  /**
7301
7959
  * Wrap `ctx.settings.readAddonStore()` with a short retry budget so a
7302
7960
  * transient settings-store outage (mid-restart of sqlite-settings, tsx-watch
@@ -7564,32 +8222,12 @@ object({
7564
8222
  audioCodec: string().optional(),
7565
8223
  metadata: record(string(), unknown()).readonly().optional()
7566
8224
  });
7567
- var EncodedPacketSchema = object({
7568
- type: _enum(["video", "audio"]),
7569
- data: _instanceof(Uint8Array),
7570
- pts: number(),
7571
- dts: number(),
7572
- keyframe: boolean(),
7573
- codec: string()
7574
- });
7575
- var DecodedFrameSchema = object({
7576
- data: _instanceof(Uint8Array),
7577
- width: number(),
7578
- height: number(),
7579
- format: _enum([
7580
- "jpeg",
7581
- "rgb",
7582
- "bgr",
7583
- "yuv420",
7584
- "gray"
7585
- ]),
7586
- timestamp: number()
7587
- });
7588
8225
  /**
7589
8226
  * Wire schema for `FrameHandle` — a zero-pixel, serialisable reference to a
7590
8227
  * frame in a shared-memory ring (Phase 5 / D9). Mirrors the `FrameHandle` TS
7591
- * interface in `interfaces/frame-handle.ts` field-for-field so a decoder cap
7592
- * method (`pullHandles`) can carry handles over tRPC / Moleculer.
8228
+ * interface in `interfaces/frame-handle.ts` field-for-field so a cap method
8229
+ * (the runner's native-crop and pipeline-executor inputs) can carry handles
8230
+ * over tRPC / Moleculer.
7593
8231
  *
7594
8232
  * The `satisfies` assertion below pins this schema to the interface: if a
7595
8233
  * field is added to / removed from `FrameHandle` without a matching schema
@@ -7615,50 +8253,6 @@ var FrameHandleSchema = object({
7615
8253
  slotCount: number().int().positive()
7616
8254
  });
7617
8255
  /**
7618
- * Pixel format a frame-handle subscriber can request from the broker
7619
- * (Phase 5 / D9). The packed, raster subset of `FrameFormat` — the formats a
7620
- * `frameSink: 'shm'` decoder session can write into a `FrameRing` slot.
7621
- * `jpeg` is excluded: a variable-length stream is not a fixed-stride ring
7622
- * payload, and no decoded-frame consumer requests it over the shm plane.
7623
- */
7624
- var FrameHandleFormatSchema = _enum([
7625
- "rgb",
7626
- "bgr",
7627
- "yuv420",
7628
- "gray"
7629
- ]);
7630
- /**
7631
- * Input for `stream-broker.subscribeFrames` (Phase 5 / D9). A consumer asks the
7632
- * broker for a `FrameHandle` stream of one `format`; the broker maintains one
7633
- * shared-memory ring per `(brokerId, format)` actually requested, so a `gray`
7634
- * subscriber (motion) and an `rgb` subscriber (detection) each read the format
7635
- * they asked for with no broker-side conversion.
7636
- */
7637
- var SubscribeFramesInputSchema = object({
7638
- brokerId: string(),
7639
- format: FrameHandleFormatSchema,
7640
- /**
7641
- * Optional reader-side cadence hint in frames per second. The broker does
7642
- * NOT throttle — latest-wins ring reads drop frames implicitly for a slow
7643
- * consumer. The value is echoed back in `SubscribeFramesResult.maxFps` so
7644
- * the consumer can pace its own `pullFrameHandles` polling.
7645
- */
7646
- maxFps: number().positive().optional(),
7647
- /** Short caller-identity tag (`motion`, `detection`, …) for diagnostics. */
7648
- tag: string().optional()
7649
- });
7650
- /**
7651
- * Result of `stream-broker.subscribeFrames`. The consumer then polls
7652
- * `pullFrameHandles({ subscriptionId, maxCount })` and feeds each returned
7653
- * `FrameHandle` to a `FrameRingReader`.
7654
- */
7655
- var SubscribeFramesResultSchema = object({
7656
- /** Opaque id the consumer passes to `pullFrameHandles` / `unsubscribeFrames`. */
7657
- subscriptionId: string(),
7658
- /** Reader-side cadence hint (frames/s) — echoes `SubscribeFramesInput.maxFps`. */
7659
- maxFps: number().nonnegative()
7660
- });
7661
- /**
7662
8256
  * Wire schema for a decoded audio chunk (Phase 5 / D9). Mirrors the
7663
8257
  * `DecodedAudioChunk` TS interface in `interfaces/stream-broker.ts`: PCM
7664
8258
  * sample bytes plus the track parameters a consumer needs to interpret them.
@@ -7666,8 +8260,8 @@ var SubscribeFramesResultSchema = object({
7666
8260
  * Audio chunks are tiny (a ~500ms AudioCodecSession window is a few KB of
7667
8261
  * Float32 PCM), so unlike video frames they ship their bytes INLINE over
7668
8262
  * tRPC / Moleculer — no shared-memory plane. `data` is typed `Uint8Array`
7669
- * (the wire-serialisable supertype of `Buffer`) to match `DecodedFrameSchema`
7670
- * / `EncodedPacketSchema`'s precedent; a `Buffer` is assignable to it.
8263
+ * (the wire-serialisable supertype of `Buffer`); a `Buffer` is assignable to
8264
+ * it.
7671
8265
  */
7672
8266
  var AudioChunkFormatSchema = _enum(AUDIO_CHUNK_FORMATS);
7673
8267
  var DecodedAudioChunkSchema = object({
@@ -7685,11 +8279,10 @@ var DecodedAudioChunkSchema = object({
7685
8279
  format: AudioChunkFormatSchema.optional()
7686
8280
  });
7687
8281
  /**
7688
- * Input for `stream-broker.subscribeAudioChunks` (Phase 5 / D9). The
7689
- * handle-free, ship-bytes-inline analogue of `subscribeFrames`: a consumer
7690
- * asks the broker for the decoded audio-chunk stream of one broker; the
7691
- * broker keeps a per-subscription bounded FIFO queue the consumer drains via
7692
- * `pullAudioChunks`.
8282
+ * Input for `stream-broker.subscribeAudioChunks` (Phase 5 / D9). Audio ships
8283
+ * its bytes inline: a consumer asks the broker for the decoded audio-chunk
8284
+ * stream of one broker; the broker keeps a per-subscription bounded FIFO queue
8285
+ * the consumer drains via `pullAudioChunks`.
7693
8286
  */
7694
8287
  var SubscribeAudioChunksInputSchema = object({
7695
8288
  brokerId: string(),
@@ -7720,9 +8313,7 @@ var BrokerStatsSchema = object({
7720
8313
  "stopped"
7721
8314
  ]),
7722
8315
  inputFps: number(),
7723
- decodeFps: number(),
7724
8316
  encodedSubscribers: number(),
7725
- decodedSubscribers: number(),
7726
8317
  uptimeMs: number(),
7727
8318
  bitrateKbps: number(),
7728
8319
  idrIntervalMs: number(),
@@ -7735,14 +8326,6 @@ var BrokerStatsSchema = object({
7735
8326
  preBufferMs: number(),
7736
8327
  preBufferPackets: number(),
7737
8328
  /**
7738
- * Moleculer node id of the decoder provider currently servicing this
7739
- * stream's decoded subscribers. `null` until the deferred decoder is
7740
- * created (no decoded clients yet, or codec not detected). Surfaces the
7741
- * runtime decoder placement so the UI can show "Decoder: <agent>" without
7742
- * a separate cap call per broker.
7743
- */
7744
- decoderNodeId: string().nullable(),
7745
- /**
7746
8329
  * Detected audio track parameters from the RTSP DESCRIBE / SDP. `null`
7747
8330
  * when the stream has no audio track or the broker is in cold start.
7748
8331
  * `supported = false` means the codec was detected but the local
@@ -7947,6 +8530,69 @@ method(object({ deviceId: number() }), array(StreamSourceEntrySchema)), method(o
7947
8530
  kind: "mutation",
7948
8531
  auth: "admin"
7949
8532
  }), method(object({ deviceId: number() }), unknown().nullable()), method(object({ deviceId: number() }), RawStateResultSchema.nullable(), { auth: "protected" });
8533
+ function defOf(schema) {
8534
+ return schema._zod?.def ?? {};
8535
+ }
8536
+ function declaredHere(schema) {
8537
+ return globalRegistry.get(schema)?.secret === true;
8538
+ }
8539
+ /** Wrapper kinds whose `innerType` is the field itself. */
8540
+ var WRAPPERS = new Set([
8541
+ "optional",
8542
+ "nullable",
8543
+ "default",
8544
+ "prefault",
8545
+ "catch",
8546
+ "readonly",
8547
+ "nonoptional"
8548
+ ]);
8549
+ /**
8550
+ * The schema layers that make up ONE field: the schema itself and every
8551
+ * wrapper below it (optional / default / nullable / readonly / catch), plus
8552
+ * both sides of a pipe (`z.preprocess` puts the real schema on `out`,
8553
+ * `.transform` on `in`).
8554
+ */
8555
+ function layersOf(schema) {
8556
+ const out = [];
8557
+ const queue = [schema];
8558
+ while (queue.length > 0) {
8559
+ const s = queue.shift();
8560
+ if (!s || out.includes(s)) continue;
8561
+ out.push(s);
8562
+ const def = defOf(s);
8563
+ if (def.type !== void 0 && WRAPPERS.has(def.type) && def.innerType) queue.push(def.innerType);
8564
+ if (def.type === "pipe") {
8565
+ if (def.in) queue.push(def.in);
8566
+ if (def.out) queue.push(def.out);
8567
+ }
8568
+ }
8569
+ return out;
8570
+ }
8571
+ /** True when any layer of this field declares `.meta({ secret: true })`. */
8572
+ function isZodSecret(schema) {
8573
+ return layersOf(schema).some(declaredHere);
8574
+ }
8575
+ /**
8576
+ * Every declared secret path in a config schema: dotted keys, `[]` for "each
8577
+ * element of this array" (`connection.password`, `rows[].token`). A declared
8578
+ * object or array is reported as one path and not descended into — everything
8579
+ * under it is secret.
8580
+ */
8581
+ function collectZodSecretPaths(schema, prefix = "") {
8582
+ if (isZodSecret(schema)) return prefix.length > 0 ? [prefix] : [];
8583
+ const paths = [];
8584
+ for (const layer of layersOf(schema)) {
8585
+ const def = defOf(layer);
8586
+ if (def.type === "object" && def.shape) for (const [key, child] of Object.entries(def.shape)) paths.push(...collectZodSecretPaths(child, prefix ? `${prefix}.${key}` : key));
8587
+ else if (def.type === "array" && def.element) paths.push(...collectZodSecretPaths(def.element, `${prefix}[]`));
8588
+ else if (def.type === "union" && def.options) for (const option of def.options) paths.push(...collectZodSecretPaths(option, prefix));
8589
+ else if (def.type === "intersection") {
8590
+ if (def.left) paths.push(...collectZodSecretPaths(def.left, prefix));
8591
+ if (def.right) paths.push(...collectZodSecretPaths(def.right, prefix));
8592
+ }
8593
+ }
8594
+ return [...new Set(paths)];
8595
+ }
7950
8596
  //#endregion
7951
8597
  //#region ../types/dist/err-msg-DX6i_MY4.mjs
7952
8598
  var DeviceType = /* @__PURE__ */ function(DeviceType) {
@@ -11078,70 +11724,6 @@ var StorageLocationDeclarationSchema = object({
11078
11724
  "backup"
11079
11725
  ]).optional()
11080
11726
  });
11081
- var DecoderStatsSchema = object({
11082
- inputFps: number(),
11083
- outputFps: number(),
11084
- avgDecodeTimeMs: number(),
11085
- droppedFrames: number(),
11086
- /**
11087
- * Pull-mode adaptive-fps telemetry (optional — only pull sessions run the
11088
- * lag-driven controller; push sessions omit these). `lagMs` is the EWMA of
11089
- * the decoder's real-time drift (rising = falling behind live); `adaptiveFps`
11090
- * is the current lag-throttled emit rate (≤ `effectiveFps` ceiling).
11091
- */
11092
- lagMs: number().optional(),
11093
- effectiveFps: number().optional(),
11094
- adaptiveFps: number().optional()
11095
- });
11096
- var DecoderSessionConfigSchema = object({
11097
- codec: string(),
11098
- maxFps: number().default(0),
11099
- outputFormat: _enum([
11100
- "jpeg",
11101
- "rgb",
11102
- "bgr",
11103
- "yuv420",
11104
- "gray"
11105
- ]).default("jpeg"),
11106
- scale: number().default(1),
11107
- width: number().optional(),
11108
- height: number().optional(),
11109
- /**
11110
- * Identifier of the camera this decoder session serves. Optional
11111
- * because the cap is generic (any caller could request decode), but
11112
- * stream-broker passes it so decoder logs include `deviceId` for
11113
- * per-camera filtering when diagnosing failures (e.g. node-av
11114
- * sendPacket errors on a single hung camera).
11115
- */
11116
- deviceId: number().int().nonnegative().optional(),
11117
- /**
11118
- * Free-form tag for log scoping. Stream-broker uses
11119
- * `broker:<deviceId>/<profile>`. Decoder session logger surfaces it
11120
- * on every line so `grep tag=broker:5/high` filters one camera
11121
- * profile cleanly.
11122
- */
11123
- tag: string().optional(),
11124
- /**
11125
- * Where the session delivers decoded frames (Phase 5 / D9):
11126
- *
11127
- * - `'callback'` (default) — the legacy pixel path: decoded frames are
11128
- * buffered as `DecodedFrame`s and drained via `pullFrames`.
11129
- * - `'shm'` — the shared-memory frame plane: decoded frames are written
11130
- * into an OS shared-memory ring and drained as zero-pixel
11131
- * `FrameHandle`s via `pullHandles`. A session is one mode or the
11132
- * other — `pullFrames` returns nothing for an `'shm'` session and
11133
- * `pullHandles` returns nothing for a `'callback'` session.
11134
- */
11135
- frameSink: _enum(["callback", "shm"]).default("callback"),
11136
- /**
11137
- * Per-camera decoder DEBUG facility. When `true`, a pull-mode session emits
11138
- * a throttled (~1Hz) structured `decoder debug` line (effective/adaptive fps,
11139
- * real-time lag, dropped-frame delta, avg decode time, hwaccel). Mirrors the
11140
- * stream-broker's `streamingDebug` gate — off by default so production logs
11141
- * stay quiet and the emit path pays zero per-frame cost when disabled.
11142
- */
11143
- debug: boolean().optional()
11144
- });
11145
11727
  /**
11146
11728
  * Per-component log CHANNELS — the gate a hot path consults, and the registry
11147
11729
  * an addon declares its channels in.
@@ -11284,6 +11866,26 @@ var ClipSearchStrictnessSchema = _enum([
11284
11866
  "balanced",
11285
11867
  "strict"
11286
11868
  ]);
11869
+ /** Steps whose effect a root label can BE. */
11870
+ var LABEL_SUPPLY_STEP_IDS = [
11871
+ "animal-classifier",
11872
+ "vehicle-classifier",
11873
+ "package-detection"
11874
+ ];
11875
+ /** Steps whose box a root detection can BE. */
11876
+ var CROP_SUPPLY_STEP_IDS = ["plate-detection", "face-detection"];
11877
+ /**
11878
+ * Steps whose per-detection MASK a root detection can carry (D737). The live
11879
+ * mask step is `segmentation` — a frame-plane refiner that runs its own model
11880
+ * once per detection crop. (`instance-segmentation` is a dormant step id that
11881
+ * no camera tree carries.)
11882
+ */
11883
+ var MASK_SUPPLY_STEP_IDS = ["segmentation"];
11884
+ [
11885
+ ...LABEL_SUPPLY_STEP_IDS,
11886
+ ...CROP_SUPPLY_STEP_IDS,
11887
+ ...MASK_SUPPLY_STEP_IDS
11888
+ ];
11287
11889
  var MODEL_FORMATS = [
11288
11890
  "onnx",
11289
11891
  "coreml",
@@ -11312,7 +11914,53 @@ var ModelFormatEntrySchema = object({
11312
11914
  /** Multi-file payload (directory members or sibling files). */
11313
11915
  files: array(string()).readonly().optional(),
11314
11916
  /** Runtime(s) that can use this format. If omitted, inferred from ModelFormat key */
11315
- runtimes: array(_enum(["python"])).readonly().optional()
11917
+ runtimes: array(_enum(["python"])).readonly().optional(),
11918
+ /**
11919
+ * Content revision of the artefact, for one hosted OFF the CamStack mirror.
11920
+ * A format on the mirror leaves it unset: its revision (the sha256 of its
11921
+ * weight file) comes from the downloader's generated table, kept in step
11922
+ * with the mirror by `scripts/check-hosted-model-revisions.ts` (D744). A
11923
+ * node records the revision it downloaded next to the file
11924
+ * (`<file>.revision`); a copy with no record or a different one is stale
11925
+ * unless its weight file hashes to the revision, and a stale copy is
11926
+ * downloaded again, the old one serving until the new one is complete. No
11927
+ * revision at all ⇒ a file on disk is current, whatever it holds (D743).
11928
+ */
11929
+ revision: string().min(1).optional()
11930
+ });
11931
+ /**
11932
+ * What a node holds for one (model, format) (D746). `current` is a complete
11933
+ * copy at its catalog revision — exactly what `downloaded: true` means.
11934
+ * `stale` is bytes on disk that are not (yet) proven current under D743/D744:
11935
+ * no or a different revision record, or a missing sibling. `missing` is no
11936
+ * copy. `downloaded` alone folds `stale` into "not downloaded", which hid
11937
+ * reclaimable bytes and a copy about to be replaced.
11938
+ */
11939
+ var ModelOnDiskStateSchema = _enum([
11940
+ "current",
11941
+ "stale",
11942
+ "missing"
11943
+ ]);
11944
+ /**
11945
+ * The numeric precision of one format's BUILD (D746) — reported only when the
11946
+ * build states it (file-name token, an INT8 variant, an EdgeTPU compile, a
11947
+ * CamStack Core ML export). Absent means "not stated", never "fp32".
11948
+ */
11949
+ var ModelFormatPrecisionSchema = _enum([
11950
+ "fp32",
11951
+ "fp16",
11952
+ "int8"
11953
+ ]);
11954
+ /**
11955
+ * One format of one model as a node's `pipelineExecutor.getSchema` reports it.
11956
+ * `onDisk` / `precision` are optional for version skew: a runner that predates
11957
+ * them omits them, and a reader falls back to `downloaded`.
11958
+ */
11959
+ var PipelineModelFormatStatusSchema = object({
11960
+ downloaded: boolean(),
11961
+ sizeMB: number(),
11962
+ onDisk: ModelOnDiskStateSchema.optional(),
11963
+ precision: ModelFormatPrecisionSchema.optional()
11316
11964
  });
11317
11965
  /**
11318
11966
  * Extra file that must be downloaded alongside the model (e.g., labels JSON, dict.txt).
@@ -11416,6 +12064,46 @@ var ModelLicenseSchema = preprocess((value) => typeof value === "string" ? { wei
11416
12064
  /** True when the weights or their data forbid commercial use. */
11417
12065
  nonCommercial: boolean().optional()
11418
12066
  }));
12067
+ /**
12068
+ * One step a ROOT detector can supply from its own output (D730) — see
12069
+ * `ModelCatalogEntry.suppliesSteps`.
12070
+ *
12071
+ * - `label`: the root's raw class IS the step's answer. `labelToEffect` maps
12072
+ * the root's label to the step's vocabulary; `uncovered` is the vocabulary
12073
+ * the root cannot produce (shown as unavailable, never a blocker).
12074
+ * - `crop`: the root draws the box the step would have found (`license_plate`
12075
+ * for plate-detection, `face` for face-detection). The box becomes a detail
12076
+ * child of the `parentMacro` detection that contains it — never a track.
12077
+ * - `mask`: the root's decode emits an instance mask with every detection (a
12078
+ * YOLO26-seg root, D737) — the `segmentation` step's result, carried on the
12079
+ * detection in the shape that step produces. Derived from the model's
12080
+ * postprocessor on read, never stored by an import.
12081
+ */
12082
+ var RootStepSupplySchema = discriminatedUnion("kind", [
12083
+ object({
12084
+ kind: literal("label"),
12085
+ stepId: _enum(LABEL_SUPPLY_STEP_IDS),
12086
+ labelToEffect: record(string(), string()),
12087
+ uncovered: array(string()).readonly()
12088
+ }),
12089
+ object({
12090
+ kind: literal("crop"),
12091
+ stepId: _enum(CROP_SUPPLY_STEP_IDS),
12092
+ rootLabels: array(string()).readonly(),
12093
+ parentMacro: _enum(["vehicle", "person"]),
12094
+ childClass: _enum(["plate", "face"]),
12095
+ /**
12096
+ * The root's smaller input side, stamped on read by `rootSuppliesOf` from
12097
+ * the model entry — what a step's `minRootInputPx` gate judges. Never
12098
+ * stored by an import.
12099
+ */
12100
+ rootInputPx: number().int().positive().optional()
12101
+ }),
12102
+ object({
12103
+ kind: literal("mask"),
12104
+ stepId: _enum(MASK_SUPPLY_STEP_IDS)
12105
+ })
12106
+ ]);
11419
12107
  var ModelCatalogEntrySchema = object({
11420
12108
  id: string(),
11421
12109
  name: string(),
@@ -11481,6 +12169,35 @@ var ModelCatalogEntrySchema = object({
11481
12169
  */
11482
12170
  defaultConfidence: number().min(0).max(1).optional(),
11483
12171
  /**
12172
+ * Per-MODEL default of the per-class confidence floors (`minConfidence<Macro>`
12173
+ * on a detector step), keyed by macro class: `{ person: 0.45 }`. A class
12174
+ * absent here runs at the step slider's global default. The same row shape
12175
+ * the floor measurement produces (`model-floors.json`: modelId → floors), so
12176
+ * a measured table is copied in as-is. An operator override is bound to the
12177
+ * model it was made for and does not survive a model change (D738). A custom
12178
+ * / imported model may declare it; without it, the global defaults apply.
12179
+ */
12180
+ defaultClassFloors: record(string(), number().min(0).max(1)).optional(),
12181
+ /**
12182
+ * The inference precision this model's OpenVINO IR needs on an Intel GPU.
12183
+ * Absent ⇒ the device default (f16 on a GPU). Set to `'f32'` for an FP32 IR
12184
+ * that produces invalid output at f16 — measured 2026-10-07 for YOLO26
12185
+ * base IRs (`yolo26s`: 0 true / 146 false positives; `yolo26m*`: NaN
12186
+ * scores) on the Core Ultra iGPU and the N100. Threaded to the pool as
12187
+ * `PoolModelConfig.gpuInferencePrecision`; the pool sets
12188
+ * INFERENCE_PRECISION_HINT on a GPU only. Costs ~60% latency on the GPU.
12189
+ */
12190
+ gpuInferencePrecision: _enum(["f32", "f16"]).optional(),
12191
+ /**
12192
+ * ROOT detectors only: per supplied step (`animal-classifier`, …), the
12193
+ * minimum DETECTION score from which this root's own fine label (species,
12194
+ * vehicle type — D736 root supply) is taken (D741). Below it the detection
12195
+ * keeps its macro class without the fine label. `1` = never take it from
12196
+ * this root. Absent ⇒ no floor beyond the macro floor. The supplied step's
12197
+ * `minConfidence` slider, bound to the ROOT model, overrides it.
12198
+ */
12199
+ suppliedLabelFloors: record(string(), number().min(0).max(1)).optional(),
12200
+ /**
11484
12201
  * When true, the executor produces a landmark-aligned crop (similarity warp
11485
12202
  * onto the canonical template) before this step runs, instead of a plain
11486
12203
  * axis-aligned bbox crop. Required for face-recognition embedders (ArcFace):
@@ -11542,6 +12259,16 @@ var ModelCatalogEntrySchema = object({
11542
12259
  */
11543
12260
  classMap: DetectionCatalogClassMapSchema.optional(),
11544
12261
  /**
12262
+ * The pipeline steps this ROOT detector can supply from its own output
12263
+ * (D730): its labels name a step's effect (`deer` for `animal-classifier`)
12264
+ * or draw a step's box (`license_plate` for `plate-detection`). Computed at
12265
+ * import from THIS model's labelmap by `deriveRootSupplies`, never written
12266
+ * by hand and never assumed per family; a row without it is derived on read
12267
+ * (`rootSuppliesOf`). Whether a camera uses it is the step's own
12268
+ * `useRootModel` flag (`resolveRootSupply`).
12269
+ */
12270
+ suppliesSteps: array(RootStepSupplySchema).readonly().optional(),
12271
+ /**
11545
12272
  * The model's CLIP feature-space contract (text encoder, dimension, vector
11546
12273
  * index, token window, search floor) — see `clip-model.ts`. Present ONLY on a
11547
12274
  * CLIP image encoder; its absence is what "not a CLIP model" means to the
@@ -13143,13 +13870,6 @@ var BrokerRtspClientSchema = object({
13143
13870
  lastRtpAt: number(),
13144
13871
  bytesSent: number()
13145
13872
  });
13146
- var BrokerDecodedClientSchema = object({
13147
- tag: string(),
13148
- subscribedAt: number(),
13149
- maxFps: number(),
13150
- framesDelivered: number(),
13151
- framesDropped: number()
13152
- });
13153
13873
  var BrokerAudioClientSchema = object({
13154
13874
  tag: string(),
13155
13875
  subscribedAt: number(),
@@ -13241,7 +13961,6 @@ var BrokerEncodedClientSchema = object({
13241
13961
  });
13242
13962
  var BrokerClientsSchema = object({
13243
13963
  rtsp: array(BrokerRtspClientSchema).readonly(),
13244
- decoded: array(BrokerDecodedClientSchema).readonly(),
13245
13964
  audio: array(BrokerAudioClientSchema).readonly(),
13246
13965
  encoded: array(BrokerEncodedClientSchema).readonly(),
13247
13966
  pipeClients: number(),
@@ -13610,11 +14329,7 @@ method(object({
13610
14329
  auth: "admin"
13611
14330
  }), method(object({ brokerId: string() }), BrokerClientsSchema), method(object({
13612
14331
  brokerId: string(),
13613
- channel: _enum([
13614
- "rtsp",
13615
- "decoded",
13616
- "audio"
13617
- ]),
14332
+ channel: _enum(["rtsp", "audio"]),
13618
14333
  handle: string()
13619
14334
  }), object({ killed: boolean() }), {
13620
14335
  kind: "mutation",
@@ -13649,10 +14364,7 @@ method(object({
13649
14364
  }), method(SubscribeAudioChunksInputSchema, SubscribeAudioChunksResultSchema, { kind: "mutation" }), method(object({
13650
14365
  subscriptionId: string(),
13651
14366
  maxCount: number().int().positive().default(8)
13652
- }), array(DecodedAudioChunkSchema).readonly()), method(object({ subscriptionId: string() }), object({ released: boolean() }), { kind: "mutation" }), method(SubscribeFramesInputSchema, SubscribeFramesResultSchema, { kind: "mutation" }), method(object({
13653
- subscriptionId: string(),
13654
- maxCount: number().int().positive().default(4)
13655
- }), array(FrameHandleSchema).readonly()), method(object({ subscriptionId: string() }), object({ released: boolean() }), { kind: "mutation" }), method(object({
14367
+ }), array(DecodedAudioChunkSchema).readonly()), method(object({ subscriptionId: string() }), object({ released: boolean() }), { kind: "mutation" }), method(object({
13656
14368
  brokerId: string(),
13657
14369
  seconds: number().min(0).max(30)
13658
14370
  }), _void(), {
@@ -14912,53 +15624,201 @@ id: union([string(), number()]) }), {
14912
15624
  auth: "admin"
14913
15625
  });
14914
15626
  /**
14915
- * shm ring usage stats for a `frameSink: 'shm'` decoder session —
14916
- * exposed via `decoder.getShmStats` so downstream consumers can
14917
- * observe ring pressure (slot count, byte budget, hit/miss ratio).
15627
+ * `keychain` — the hub's encrypted store of secret values (D787).
15628
+ *
15629
+ * Settings blobs never hold a secret: they hold a marker
15630
+ * `{"$secret":"secret://<owner>/<scope>/<fieldPath>","v":1}` and the value
15631
+ * lives here, AES-256-GCM under a data key that a master key wraps. This cap
15632
+ * is the OWNER's door to its own values: every method is owner-checked
15633
+ * against the CALLER, never against anything the caller claims.
15634
+ *
15635
+ * Who the caller is: the transport stamps `callerAddonId` into the args of a
15636
+ * call that crossed a process (the parent `LocalChildRegistry` from the UDS
15637
+ * connection, the agent from its child's connection carried in
15638
+ * `$hub-cap-fwd`'s envelope). A stamp always overwrites; a wire call with no
15639
+ * stamp has its claim stripped. Only a hub in-process caller may state its own
15640
+ * identity — `ctx.secrets` does that with the addon id closed over. This is
15641
+ * identity against BUGS and misrouting, not against a malicious addon (every
15642
+ * runner is the same OS user): see the threat model in
15643
+ * `docs/design/2026-10-08-secrets-keychain.md`.
15644
+ *
15645
+ * `callerAddonId` is deliberately NOT in any input schema: the tRPC router
15646
+ * parses the input, so a session can never supply it, and the internal mount
15647
+ * floors every method to admin anyway (D240).
15648
+ *
15649
+ * Internal: addons reach it through `ctx.secrets`, never directly.
14918
15650
  */
14919
- var ShmRingStatsSchema = object({
14920
- sessionId: string(),
14921
- slotCount: number().int(),
14922
- slotByteLength: number().int(),
14923
- segmentBytes: number().int(),
14924
- budgetMb: number().int(),
14925
- framesWritten: number().int(),
14926
- getFrameHits: number().int(),
14927
- getFrameMisses: number().int()
14928
- });
14929
- method(object({ codec: string() }), boolean()), method(_void(), object({
15651
+ /** Why a value cannot be served right now. Never folded into "missing". */
15652
+ var KeychainUnavailableReasonSchema = _enum([
15653
+ "key-missing",
15654
+ "wrong-key",
15655
+ "key-file-unreadable",
15656
+ "store-unavailable",
15657
+ "not-initialized",
15658
+ "decrypt-failed"
15659
+ ]);
15660
+ var KeychainStateSchema = discriminatedUnion("state", [object({ state: literal("ready") }), object({
15661
+ state: literal("locked"),
15662
+ reason: KeychainUnavailableReasonSchema
15663
+ })]);
15664
+ var KeychainResolveEntrySchema = discriminatedUnion("kind", [
15665
+ object({
15666
+ kind: literal("value"),
15667
+ value: string(),
15668
+ version: number().int()
15669
+ }),
15670
+ object({ kind: literal("missing") }),
15671
+ object({
15672
+ kind: literal("unavailable"),
15673
+ reason: KeychainUnavailableReasonSchema
15674
+ }),
15675
+ object({ kind: literal("forbidden") })
15676
+ ]);
15677
+ var KeychainResolveResultSchema = record(string(), KeychainResolveEntrySchema);
15678
+ /** Metadata of one stored value — never the value. */
15679
+ var KeychainSecretMetaSchema = object({
15680
+ ref: string(),
15681
+ owner: string(),
15682
+ /** Formatted scope (`global`, `node/<id>`, `device/<id>`, …). */
15683
+ scope: string(),
15684
+ fieldPath: string(),
15685
+ version: number().int(),
15686
+ createdAt: number(),
15687
+ updatedAt: number(),
15688
+ /** `addon:<id>` | `user:<id>` | `system`. */
15689
+ updatedBy: string(),
15690
+ /** Coarse — written at most once an hour per ref. `null` = never read. */
15691
+ lastReadAt: number().nullable()
15692
+ });
15693
+ var RefListSchema = array(string().min(1)).max(512);
15694
+ method(object({
15695
+ ref: string().min(1),
15696
+ value: string().min(1)
15697
+ }), object({
15698
+ ref: string(),
15699
+ version: number().int()
15700
+ }), {
15701
+ kind: "mutation",
15702
+ auth: "admin"
15703
+ }), method(object({ refs: RefListSchema }), KeychainResolveResultSchema, { auth: "admin" }), method(object({ refs: RefListSchema }), object({ deleted: number().int() }), {
15704
+ kind: "mutation",
15705
+ auth: "admin"
15706
+ }), method(object({}), array(KeychainSecretMetaSchema).readonly(), { auth: "admin" }), method(object({}), KeychainStateSchema, { auth: "admin" });
15707
+ var KeychainKeySourceSchema = object({
15708
+ kind: _enum([
15709
+ "config-file",
15710
+ "previous-config-file",
15711
+ "platform",
15712
+ "default-file"
15713
+ ]),
15714
+ /** File sources only — a path is not a secret. */
15715
+ path: string().optional(),
15716
+ /**
15717
+ * True when a whole-volume backup of the data directory carries this key
15718
+ * next to the database it protects (the default file). The page warns.
15719
+ */
15720
+ sharesBackupWithDatabase: boolean()
15721
+ });
15722
+ var KeychainStatusSchema = object({
15723
+ keychain: KeychainStateSchema,
15724
+ /** The source of the master key in use; `null` while locked. */
15725
+ keySource: KeychainKeySourceSchema.nullable(),
15726
+ /** The source configured to be primary — differs from `keySource` while a rotation is pending. */
15727
+ configuredSource: KeychainKeySourceSchema,
15728
+ /** Short fingerprint of the master key in use (`HMAC(KEK, label)`, 16 hex). */
15729
+ fingerprint: string().nullable(),
15730
+ activeKeyId: string().nullable(),
15731
+ /**
15732
+ * The keychain unlocked with a NON-primary source: the configured primary
15733
+ * key is not the one that wraps the data key yet. `rotateMasterKey` moves it.
15734
+ */
15735
+ rotationPending: boolean(),
15736
+ /** Wrapped copies of the data key under a previous master key, kept until purged. */
15737
+ retiredWraps: number().int(),
15738
+ recoveryKeyDownloadedAt: number().nullable(),
15739
+ secretCount: number().int()
15740
+ });
15741
+ /**
15742
+ * Whether a stored value is still pointed at by its owner's settings.
15743
+ * `unknown` is a first-class answer: a scope whose blob could not be read is
15744
+ * never reported as an orphan (and never deleted as one).
15745
+ */
15746
+ var KeychainSecretUsageSchema = _enum([
15747
+ "in-use",
15748
+ "orphan",
15749
+ "unknown"
15750
+ ]);
15751
+ var KeychainAdminSecretSchema = KeychainSecretMetaSchema.extend({ usage: KeychainSecretUsageSchema });
15752
+ var KeychainAuditActionSchema = _enum([
15753
+ "put",
15754
+ "delete",
15755
+ "reveal",
15756
+ "rotate-master-key",
15757
+ "purge-retired-keys",
15758
+ "download-recovery-key",
15759
+ "delete-orphans",
15760
+ "reset",
15761
+ "initialize"
15762
+ ]);
15763
+ var KeychainAuditEntrySchema = object({
15764
+ id: string(),
15765
+ at: number(),
15766
+ action: KeychainAuditActionSchema,
15767
+ /** `addon:<id>` | `user:<id>` | `system`. */
15768
+ actor: string(),
15769
+ ref: string().nullable(),
15770
+ detail: string().nullable()
15771
+ });
15772
+ 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({
15773
+ value: string(),
15774
+ version: number().int()
15775
+ }), {
15776
+ kind: "mutation",
15777
+ auth: "admin",
15778
+ caller: "required"
15779
+ }), method(object({ refs: array(string().min(1)).max(1e3) }), object({
15780
+ deleted: array(string()).readonly(),
15781
+ kept: array(object({
15782
+ ref: string(),
15783
+ usage: KeychainSecretUsageSchema
15784
+ })).readonly()
15785
+ }), {
15786
+ kind: "mutation",
15787
+ auth: "admin",
15788
+ caller: "required"
15789
+ }), method(object({}), object({
15790
+ fingerprint: string(),
15791
+ keySource: KeychainKeySourceSchema
15792
+ }), {
15793
+ kind: "mutation",
15794
+ auth: "admin",
15795
+ caller: "required"
15796
+ }), method(object({}), object({ purged: number().int() }), {
15797
+ kind: "mutation",
15798
+ auth: "admin",
15799
+ caller: "required"
15800
+ }), method(object({}), object({
15801
+ key: string(),
15802
+ fingerprint: string(),
15803
+ keySource: KeychainKeySourceSchema
15804
+ }), {
15805
+ kind: "mutation",
15806
+ auth: "admin",
15807
+ caller: "required"
15808
+ }), method(object({ confirm: literal("RESET KEYCHAIN") }), object({
15809
+ archivedCollection: string().nullable(),
15810
+ archived: number().int()
15811
+ }), {
15812
+ kind: "mutation",
15813
+ auth: "admin",
15814
+ caller: "required"
15815
+ });
15816
+ method(_void(), object({
14930
15817
  id: string(),
14931
15818
  name: string(),
14932
- isPullMode: boolean().optional(),
14933
- priority: number().optional(),
14934
15819
  hwaccel: string().optional(),
14935
15820
  probedBestHwaccel: string().optional()
14936
- })), method(DecoderSessionConfigSchema, object({
14937
- sessionId: string(),
14938
- nodeId: string()
14939
- })), method(object({ sessionId: string() }), _void()), method(object({
14940
- sessionId: string(),
14941
- packet: EncodedPacketSchema
14942
- }), _void()), method(object({
14943
- sessionId: string(),
14944
- url: string()
14945
- }), _void()), method(object({
14946
- sessionId: string(),
14947
- maxCount: number().default(1),
14948
- waitMs: number().optional()
14949
- }), array(DecodedFrameSchema)), method(object({
14950
- sessionId: string(),
14951
- maxCount: number().default(1),
14952
- waitMs: number().optional()
14953
- }), array(FrameHandleSchema)), method(object({ handle: FrameHandleSchema }), DecodedFrameSchema.nullable()), method(object({ sessionId: string() }), ShmRingStatsSchema.nullable()), method(object({
14954
- sessionId: string(),
14955
- config: DecoderSessionConfigSchema.partial()
14956
- }), _void()), method(object({ sessionId: string() }), DecoderStatsSchema), method(_void(), array(object({
14957
- sessionId: string(),
14958
- codec: string(),
14959
- outputFormat: string(),
14960
- createdAtMs: number()
14961
- })).readonly()), method(_void(), object({ backend: string() }), {
15821
+ })), method(_void(), object({ backend: string() }), {
14962
15822
  kind: "mutation",
14963
15823
  auth: "admin"
14964
15824
  });
@@ -15975,6 +16835,10 @@ var DeviceInfoSchema = object({
15975
16835
  isCamera: boolean(),
15976
16836
  /** Current config values — serializable snapshot */
15977
16837
  config: record(string(), unknown()),
16838
+ /** Paths inside `config` the device's schema declares secret (D783) —
16839
+ * what the non-admin redaction withholds. Paths, never values. Absent
16840
+ * when the owning runner has not reported them. */
16841
+ secretConfigPaths: array(string()).optional(),
15978
16842
  /** Hardware + identity blob (manufacturer / model / firmware / sn /
15979
16843
  * uid / mac / …). Populated by drivers; editable via setMetadata. */
15980
16844
  metadata: record(string(), unknown()).nullable().optional(),
@@ -16180,12 +17044,22 @@ var DeviceRegisterPayloadSchema = object({
16180
17044
  * call (workers re-register on init), so probe-driven updates
16181
17045
  * (e.g. PTZ flag flipping after the abilities probe) propagate. */
16182
17046
  features: array(string()).optional(),
16183
- config: record(string(), unknown())
17047
+ config: record(string(), unknown()),
17048
+ /** Config paths the device's own schema DECLARES secret
17049
+ * (`.meta({ secret: true })` — dotted, `[]` for array items, e.g.
17050
+ * `connection.password`). Re-published on every register; the non-admin
17051
+ * redaction withholds them at any depth (D783). Optional: an older runner
17052
+ * omits it and the keyword backstop applies. */
17053
+ secretConfigPaths: array(string()).optional()
16184
17054
  });
16185
17055
  var DeviceRemovePayloadSchema = object({ deviceId: number() });
16186
17056
  var DevicePersistConfigPayloadSchema = object({
16187
17057
  deviceId: number(),
16188
- data: record(string(), unknown())
17058
+ data: record(string(), unknown()),
17059
+ /** The paths the device's schema declares secret (D783), when the caller
17060
+ * knows them — those values are kept in the keychain, not the blob (D787).
17061
+ * Absent: the paths the device last reported at `registerDevice` apply. */
17062
+ secretConfigPaths: array(string()).optional()
16189
17063
  });
16190
17064
  /** What a migration actually did, per switch. `unreachable` is a first-class
16191
17065
  * answer: a camera that could not be asked is not a camera that was silenced. */
@@ -17007,6 +17881,12 @@ method(_void(), array(string()).readonly(), { auth: "admin" }), method(object({
17007
17881
  kind: "mutation",
17008
17882
  auth: "admin"
17009
17883
  });
17884
+ var HUB_ADDRESS_ROLES = [
17885
+ "appConnections",
17886
+ "notificationTaps",
17887
+ "internal",
17888
+ "publicEndpoint"
17889
+ ];
17010
17890
  /**
17011
17891
  * Transport bounds for AI capability methods.
17012
17892
  *
@@ -17833,7 +18713,14 @@ var LoginMethodContributionSchema = discriminatedUnion("kind", [
17833
18713
  icon: string().optional(),
17834
18714
  /** Addon-owned HTTP route the button navigates to (GET). */
17835
18715
  startUrl: string(),
17836
- stage: LoginStageEnum
18716
+ stage: LoginStageEnum,
18717
+ /**
18718
+ * The provider names an external identity a signed-in user can link to
18719
+ * their own account (D782): `auth.listLinkableProviders` /
18720
+ * `beginExternalLink` offer exactly the redirect methods that set this,
18721
+ * whatever their id. Absent / false — a login button only (magic-link).
18722
+ */
18723
+ linkable: boolean().optional()
17837
18724
  }),
17838
18725
  object({
17839
18726
  kind: literal("widget"),
@@ -19609,6 +20496,8 @@ var NcSystemEventKindSchema = _enum([
19609
20496
  "stream-offline",
19610
20497
  "node-online",
19611
20498
  "node-offline",
20499
+ "node-restarting",
20500
+ "node-updating",
19612
20501
  "node-inference-unavailable",
19613
20502
  "detection-blind",
19614
20503
  "addon-crash-loop",
@@ -21214,7 +22103,13 @@ var NcAlarmModeDelaysListSchema = array(object({
21214
22103
  * Absent = false (logged, not sent). Even when true it is not sent when that same sensor
21215
22104
  * is the one that starts the entry delay — the entry-delay notification already names it.
21216
22105
  */
21217
- notifySensorRewatched: boolean().optional()
22106
+ notifySensorRewatched: boolean().optional(),
22107
+ /**
22108
+ * D735: notify "ignored" when a sensor this arm bypassed really MOVED while armed (its own
22109
+ * change time is after the arm) and set nothing off. Absent = false (logged, not sent). A
22110
+ * re-sync, a recovery from `unavailable` or a duplicate is never announced, switch or not.
22111
+ */
22112
+ notifySensorIgnored: boolean().optional()
21218
22113
  })).max(8).refine(uniqueModes, { message: "modeDelays: at most one entry per arm mode" });
21219
22114
  var NcAlarmModeDelaysEditListSchema = array(object({
21220
22115
  mode: AlarmArmModeSchema,
@@ -21227,7 +22122,9 @@ var NcAlarmModeDelaysEditListSchema = array(object({
21227
22122
  /** D706: set the switch, or `null` to clear it (back to the default, false). */
21228
22123
  notifyDuringEntryDelay: boolean().nullable().optional(),
21229
22124
  /** D706: set the switch, or `null` to clear it (back to the default, false). */
21230
- notifySensorRewatched: boolean().nullable().optional()
22125
+ notifySensorRewatched: boolean().nullable().optional(),
22126
+ /** D735: set the switch, or `null` to clear it (back to the default, false). */
22127
+ notifySensorIgnored: boolean().nullable().optional()
21231
22128
  })).max(8).refine(uniqueModes, { message: "modeDelays: at most one edit per arm mode" });
21232
22129
  /** One switch of the alarm table: put ONE device on, or take it off, ONE mode's list. */
21233
22130
  var NcAlarmNonBlockingEditSchema = object({
@@ -22205,8 +23102,8 @@ Object.freeze(Object.fromEntries([{
22205
23102
  var CLUSTER_STEP_SETTING_FIELDS = [{
22206
23103
  stepId: "face-embedding",
22207
23104
  key: "minLandmarkFaceSize",
22208
- label: "Min face size for recognition (detection px)",
22209
- 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.",
23105
+ label: "Min face size to embed (detection-frame px)",
23106
+ 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.",
22210
23107
  type: "slider",
22211
23108
  min: 0,
22212
23109
  max: 64,
@@ -23179,8 +24076,23 @@ var RetrainMacroClassSchema = _enum([
23179
24076
  ]);
23180
24077
  /** A subject to learn, or a phantom to unlearn (taught by OMISSION). */
23181
24078
  var RetrainAnnotationKindSchema = _enum(["subject", "model_error"]);
23182
- /** Did a human draw this box, or did the assist propose it? */
23183
- var RetrainAnnotationSourceSchema = _enum(["operator", "assist"]);
24079
+ /**
24080
+ * Where a box came from. A machine-sourced box is a DRAFT on the page until
24081
+ * the operator confirms it; once saved it keeps its source as provenance.
24082
+ *
24083
+ * - `operator` — drawn by hand.
24084
+ * - `assist` — proposed by a detector run on the copy (the camera's own
24085
+ * model, or a larger teacher model).
24086
+ * - `pipeline` — the box the live pipeline actually drew on that frame, read
24087
+ * back from the track store (never a re-run).
24088
+ * - `llm` — proposed by a vision-capable LLM profile.
24089
+ */
24090
+ var RetrainAnnotationSourceSchema = _enum([
24091
+ "operator",
24092
+ "assist",
24093
+ "pipeline",
24094
+ "llm"
24095
+ ]);
23184
24096
  /** Normalised `[0,1]` rectangle against the FULL frame — the canonical form. */
23185
24097
  var RetrainBboxSchema = object({
23186
24098
  x: number(),
@@ -23198,7 +24110,8 @@ var RetrainBboxSchema = object({
23198
24110
  */
23199
24111
  var RetrainAnnotationSchema = object({
23200
24112
  id: string(),
23201
- trackId: string(),
24113
+ /** The frame's track. Absent on a recording still, which has none. */
24114
+ trackId: string().optional(),
23202
24115
  deviceId: number(),
23203
24116
  /** The COPY in retrain storage — never the source track's media key. */
23204
24117
  mediaKey: string(),
@@ -23247,18 +24160,63 @@ var RetrainFrameCandidateSchema = object({
23247
24160
  * fail, whatever became of the original. */
23248
24161
  copied: boolean()
23249
24162
  });
24163
+ /**
24164
+ * One box the live pipeline drew on a copied frame — what a correction starts
24165
+ * from. Derived when the frame is listed, from the track store: the subject
24166
+ * box recorded on the source media row when there is one, else the track
24167
+ * position nearest the frame's capture time. Never stored as an annotation
24168
+ * until the operator confirms it.
24169
+ */
24170
+ var RetrainPipelineBoxSchema = object({
24171
+ /** Normalised `[0,1]` against the full frame. */
24172
+ bbox: RetrainBboxSchema,
24173
+ macroClass: RetrainMacroClassSchema,
24174
+ label: string().optional(),
24175
+ subLabel: string().optional(),
24176
+ /** The detection score of the position used, when it was recorded. */
24177
+ score: number().optional(),
24178
+ /** The root model that produced the track, when it was recorded. */
24179
+ modelId: string().optional(),
24180
+ trackId: string(),
24181
+ /** `subject-box`: recorded on this very frame. `position`: the track's
24182
+ * position nearest the capture time, `deltaMs` away. */
24183
+ basis: _enum(["subject-box", "position"]),
24184
+ deltaMs: number()
24185
+ });
24186
+ /**
24187
+ * Where a retrain frame came from: a TRACK's stored media (copy-on-select),
24188
+ * or the RECORDING at an instant — the frame a model saw nothing in has no
24189
+ * track at all.
24190
+ */
24191
+ var RetrainFrameOriginSchema = _enum(["track", "recording"]);
23250
24192
  /** A frame the dataset OWNS: bytes copied at selection time. */
23251
24193
  var RetrainFrameSchema = object({
23252
24194
  frameId: string(),
23253
24195
  deviceId: number(),
23254
- trackId: string(),
23255
- /** Provenance only. It may already point at nothing — that is expected. */
23256
- sourceMediaId: number().int(),
24196
+ origin: RetrainFrameOriginSchema,
24197
+ /** The track it was copied from. Absent on a recording still. */
24198
+ trackId: string().optional(),
24199
+ /** Provenance only. It may already point at nothing — that is expected.
24200
+ * Absent on a recording still. */
24201
+ sourceMediaId: number().int().optional(),
24202
+ /** A recording still: the playhead instant it was taken at. */
24203
+ epochMs: number().optional(),
23257
24204
  sourceKind: MediaFileKindEnum,
23258
24205
  sizeBytes: number().int(),
23259
24206
  width: number().int(),
23260
24207
  height: number().int(),
23261
- copiedAt: number()
24208
+ copiedAt: number(),
24209
+ /** When the CAMERA captured the frame. Absent on a copy taken before D785. */
24210
+ capturedAt: number().optional(),
24211
+ /** The operator's "every subject in this frame is boxed". Detector
24212
+ * evaluation keeps only complete frames: an unboxed subject would count as
24213
+ * a false positive. */
24214
+ complete: boolean(),
24215
+ /** The boxes the pipeline drew on this frame. Present on list answers;
24216
+ * empty when nothing the track store holds can be placed on it. */
24217
+ pipelineBoxes: array(RetrainPipelineBoxSchema).readonly().optional(),
24218
+ /** The named collections this frame belongs to. Present on list answers. */
24219
+ collectionIds: array(string()).readonly().optional()
23262
24220
  });
23263
24221
  /** Why a copy-on-select could not be honoured — named, never a silent skip. */
23264
24222
  var RetrainCopyRefusalSchema = _enum([
@@ -23279,6 +24237,53 @@ var RetrainFrameListSchema = object({
23279
24237
  /** What the page pre-selects — the native key frame when one survives. */
23280
24238
  autoPickMediaId: number().int().optional()
23281
24239
  });
24240
+ /**
24241
+ * Which frames an annotated export carries. Every field narrows; an empty
24242
+ * filter is every annotated copy. A dataset VERSION is a frozen `frameIds`
24243
+ * list owned by whoever trains (the training orchestrator), so `frameIds` is
24244
+ * the primitive a version export uses; `batchId` re-selects what an earlier
24245
+ * export carried (`exportedInBatch`).
24246
+ */
24247
+ var RetrainExportFilterSchema = object({
24248
+ deviceIds: array(number()).optional(),
24249
+ frameIds: array(string()).max(2e4).optional(),
24250
+ /** Only frames in at least one of these named collections. */
24251
+ collectionIds: array(string()).max(200).optional(),
24252
+ batchId: string().optional(),
24253
+ /** Only frames the operator marked complete (all subjects boxed). */
24254
+ completeOnly: boolean().optional()
24255
+ });
24256
+ /**
24257
+ * `frames`: the full frame copies, boxes in `annotations.json`.
24258
+ * `crops`: additionally one JPEG per subject, cut with the runtime detail-crop
24259
+ * convention — the classifier layout.
24260
+ */
24261
+ var RetrainExportLayoutSchema = _enum(["frames", "crops"]);
24262
+ /**
24263
+ * Where `writeRetrainArchive` streams the tar: one HTTP request whose body is
24264
+ * the archive, sent chunk by chunk. Covers a presigned PUT and a provider
24265
+ * addon's data-plane upload route alike. Headers are sent verbatim and never
24266
+ * logged.
24267
+ */
24268
+ var RetrainArchiveTargetSchema = object({
24269
+ kind: literal("http"),
24270
+ method: _enum(["PUT", "POST"]),
24271
+ url: string().url(),
24272
+ headers: record(string(), string()).optional()
24273
+ });
24274
+ var RetrainArchiveResultSchema = object({
24275
+ batchId: string(),
24276
+ frames: number().int(),
24277
+ crops: number().int(),
24278
+ annotations: number().int(),
24279
+ /** Frames planned but not shipped (unreadable copy, path too long). */
24280
+ missing: number().int(),
24281
+ bytes: number().int(),
24282
+ /** sha256 of the exact bytes sent. */
24283
+ sha256: string(),
24284
+ /** The target's HTTP status. */
24285
+ status: number().int()
24286
+ });
23282
24287
  /** What the operator asked the assist to look for. */
23283
24288
  var RetrainAssistSubjectSchema = discriminatedUnion("kind", [object({
23284
24289
  kind: literal("package"),
@@ -23308,6 +24313,109 @@ var RetrainAssistResultSchema = discriminatedUnion("kind", [object({
23308
24313
  reason: string(),
23309
24314
  detail: string().optional()
23310
24315
  })]);
24316
+ /** A named set over the retrain corpus — membership only, it owns no pixels. */
24317
+ var RetrainCollectionSchema = object({
24318
+ id: string(),
24319
+ name: string(),
24320
+ createdAt: number(),
24321
+ frameCount: number().int()
24322
+ });
24323
+ var RetrainCollectionCreateResultSchema = discriminatedUnion("kind", [object({
24324
+ kind: literal("created"),
24325
+ collection: RetrainCollectionSchema
24326
+ }), object({
24327
+ kind: literal("refused"),
24328
+ reason: _enum(["empty-name", "duplicate-name"])
24329
+ })]);
24330
+ var RetrainCollectionRenameResultSchema = discriminatedUnion("kind", [object({
24331
+ kind: literal("renamed"),
24332
+ collection: RetrainCollectionSchema
24333
+ }), object({
24334
+ kind: literal("refused"),
24335
+ reason: _enum([
24336
+ "empty-name",
24337
+ "duplicate-name",
24338
+ "unknown-collection"
24339
+ ])
24340
+ })]);
24341
+ /**
24342
+ * The outcome of adding the frame at a recording instant. Every refusal is
24343
+ * named: `still-unavailable` (not recording, a gap, or an undecodable frame —
24344
+ * `detail` says which), `still-busy` (the recorder is at its decode bound; try
24345
+ * again), `unreadable-image`, `write-failed`, `unknown-collection`.
24346
+ */
24347
+ var AddRetrainFrameFromRecordingResultSchema = discriminatedUnion("kind", [object({
24348
+ kind: literal("added"),
24349
+ collectionId: string(),
24350
+ frame: RetrainFrameSchema,
24351
+ /** The moment was already in the dataset; nothing was decoded. */
24352
+ reused: boolean()
24353
+ }), object({
24354
+ kind: literal("refused"),
24355
+ reason: _enum([
24356
+ "unknown-collection",
24357
+ "still-unavailable",
24358
+ "still-busy",
24359
+ "unreadable-image",
24360
+ "write-failed"
24361
+ ]),
24362
+ detail: string().optional()
24363
+ })]);
24364
+ /** A vision LLM profile the AI assist may use, and where it sends the frame. */
24365
+ var RetrainAssistProfileSchema = object({
24366
+ id: string(),
24367
+ name: string(),
24368
+ model: string(),
24369
+ kind: string(),
24370
+ /** `true` when the frame would leave the house (a cloud vendor, or an
24371
+ * endpoint that is not on the local network). The page confirms each such
24372
+ * run, and the provider refuses one without `allowCloud`. */
24373
+ leavesHouse: boolean()
24374
+ });
24375
+ /** A box the AI assist proposed: a draft, plus the model's own reason. */
24376
+ var RetrainLlmProposalSchema = RetrainAnnotationDraftSchema.extend({ reason: string() });
24377
+ /** What the AI assist said about a box that was already on the canvas. */
24378
+ var RetrainLlmReviewSchema = object({
24379
+ /** The `ref` the page sent the box under. */
24380
+ ref: string(),
24381
+ verdict: _enum([
24382
+ "confirmed",
24383
+ "wrong-class",
24384
+ "not-an-object",
24385
+ "uncertain"
24386
+ ]),
24387
+ suggestedClass: RetrainMacroClassSchema.optional(),
24388
+ reason: string()
24389
+ });
24390
+ /**
24391
+ * The AI assist's answer. `proposed` carries drafts (`source: 'llm'`, the
24392
+ * model and its confidence) and reviews; items the model got wrong (a box off
24393
+ * the frame, an unasked class, an unknown ref) are dropped and counted in
24394
+ * `rejected`. A whole answer that is not the schema is `malformed-answer`.
24395
+ */
24396
+ var RetrainLlmAssistResultSchema = discriminatedUnion("kind", [object({
24397
+ kind: literal("proposed"),
24398
+ profileId: string(),
24399
+ model: string(),
24400
+ /** The frame was sent outside the house for this answer. */
24401
+ leftHouse: boolean(),
24402
+ proposals: array(RetrainLlmProposalSchema).readonly(),
24403
+ reviews: array(RetrainLlmReviewSchema).readonly(),
24404
+ rejected: number().int()
24405
+ }), object({
24406
+ kind: literal("refused"),
24407
+ reason: _enum([
24408
+ "unknown-frame",
24409
+ "unreadable-frame",
24410
+ "unknown-profile",
24411
+ "profile-disabled",
24412
+ "no-vision",
24413
+ "cloud-not-confirmed",
24414
+ "llm-error",
24415
+ "malformed-answer"
24416
+ ]),
24417
+ detail: string().optional()
24418
+ })]);
23311
24419
  /** The outcome of a lifecycle move owned by the retrain page. */
23312
24420
  var RetrainTransitionResultSchema = object({
23313
24421
  trackId: string(),
@@ -24025,7 +25133,7 @@ DeviceType.Camera, method(object({ deviceId: number() }), array(TrackSchema).rea
24025
25133
  auth: "admin"
24026
25134
  }), method(object({
24027
25135
  deviceId: number(),
24028
- trackId: string(),
25136
+ trackId: string().optional(),
24029
25137
  frameId: string()
24030
25138
  }), object({
24031
25139
  removed: boolean(),
@@ -24042,7 +25150,8 @@ DeviceType.Camera, method(object({ deviceId: number() }), array(TrackSchema).rea
24042
25150
  auth: "admin"
24043
25151
  }), method(object({
24044
25152
  deviceId: number(),
24045
- trackId: string(),
25153
+ /** The frame's track, when it has one — checked against the frame. */
25154
+ trackId: string().optional(),
24046
25155
  frameId: string(),
24047
25156
  subject: RetrainAssistSubjectSchema,
24048
25157
  /** Which node runs it. Absent ⇒ wherever an unowned call lands. */
@@ -24050,12 +25159,16 @@ DeviceType.Camera, method(object({ deviceId: number() }), array(TrackSchema).rea
24050
25159
  }), RetrainAssistResultSchema, {
24051
25160
  kind: "mutation",
24052
25161
  auth: "admin"
24053
- }), method(object({ trackId: string() }), array(RetrainAnnotationSchema).readonly(), {
25162
+ }), method(object({
25163
+ trackId: string().optional(),
25164
+ frameIds: array(string()).max(2e3).optional()
25165
+ }), array(RetrainAnnotationSchema).readonly(), {
24054
25166
  kind: "query",
24055
25167
  auth: "admin"
24056
25168
  }), method(object({
24057
25169
  deviceId: number(),
24058
- trackId: string(),
25170
+ /** The frame's track, when it has one — checked against the frame. */
25171
+ trackId: string().optional(),
24059
25172
  frameId: string(),
24060
25173
  annotations: array(RetrainAnnotationDraftSchema)
24061
25174
  }), array(RetrainAnnotationSchema).readonly(), {
@@ -24073,7 +25186,91 @@ DeviceType.Camera, method(object({ deviceId: number() }), array(TrackSchema).rea
24073
25186
  }), RetrainTransitionResultSchema, {
24074
25187
  kind: "mutation",
24075
25188
  auth: "admin"
24076
- }), method(object({ deviceIds: array(number()).optional() }), object({ url: string() }), {
25189
+ }), method(RetrainExportFilterSchema.extend({ layout: RetrainExportLayoutSchema.optional() }), object({ url: string() }), {
25190
+ kind: "query",
25191
+ auth: "admin"
25192
+ }), method(object({
25193
+ deviceId: number(),
25194
+ trackId: string().optional(),
25195
+ frameId: string(),
25196
+ complete: boolean()
25197
+ }), RetrainFrameSchema, {
25198
+ kind: "mutation",
25199
+ auth: "admin"
25200
+ }), method(object({
25201
+ filter: RetrainExportFilterSchema,
25202
+ layout: RetrainExportLayoutSchema,
25203
+ target: RetrainArchiveTargetSchema
25204
+ }), RetrainArchiveResultSchema, {
25205
+ kind: "mutation",
25206
+ auth: "admin",
25207
+ timeoutMs: 60 * 6e4
25208
+ }), method(object({}), array(RetrainAssistProfileSchema).readonly(), {
25209
+ kind: "query",
25210
+ auth: "admin"
25211
+ }), method(object({
25212
+ deviceId: number(),
25213
+ trackId: string().optional(),
25214
+ frameId: string(),
25215
+ profileId: string(),
25216
+ classes: array(RetrainMacroClassSchema).min(1),
25217
+ boxes: array(object({
25218
+ ref: string(),
25219
+ bbox: RetrainBboxSchema,
25220
+ macroClass: RetrainMacroClassSchema,
25221
+ label: string().optional()
25222
+ })).max(50),
25223
+ allowCloud: boolean()
25224
+ }), RetrainLlmAssistResultSchema, {
25225
+ kind: "mutation",
25226
+ auth: "admin",
25227
+ timeoutMs: 18e4
25228
+ }), method(object({ name: string().max(120) }), RetrainCollectionCreateResultSchema, {
25229
+ kind: "mutation",
25230
+ auth: "admin"
25231
+ }), method(object({}), array(RetrainCollectionSchema).readonly(), {
25232
+ kind: "query",
25233
+ auth: "admin"
25234
+ }), method(object({
25235
+ id: string(),
25236
+ name: string().max(120)
25237
+ }), RetrainCollectionRenameResultSchema, {
25238
+ kind: "mutation",
25239
+ auth: "admin"
25240
+ }), method(object({ id: string() }), object({
25241
+ deleted: boolean(),
25242
+ removedFrames: number().int()
25243
+ }), {
25244
+ kind: "mutation",
25245
+ auth: "admin"
25246
+ }), method(object({
25247
+ collectionId: string(),
25248
+ deviceId: number(),
25249
+ epochMs: number()
25250
+ }), AddRetrainFrameFromRecordingResultSchema, {
25251
+ kind: "mutation",
25252
+ auth: "admin",
25253
+ timeoutMs: 6e4
25254
+ }), method(object({
25255
+ collectionId: string(),
25256
+ frameIds: array(string()).min(1).max(500)
25257
+ }), object({
25258
+ added: number().int(),
25259
+ alreadyMember: number().int(),
25260
+ unknownFrameIds: array(string()).readonly()
25261
+ }), {
25262
+ kind: "mutation",
25263
+ auth: "admin"
25264
+ }), method(object({
25265
+ collectionId: string(),
25266
+ frameId: string()
25267
+ }), object({
25268
+ removed: boolean(),
25269
+ deletedFrame: boolean()
25270
+ }), {
25271
+ kind: "mutation",
25272
+ auth: "admin"
25273
+ }), method(object({ collectionId: string() }), array(RetrainFrameSchema).readonly(), {
24077
25274
  kind: "query",
24078
25275
  auth: "admin"
24079
25276
  }), method(object({
@@ -24126,6 +25323,34 @@ DeviceType.Camera, method(object({ deviceId: number() }), array(TrackSchema).rea
24126
25323
  timestamp: number()
24127
25324
  });
24128
25325
  /**
25326
+ * A root model's boxes standing in for one crop-kind step's own inference
25327
+ * (D730) — see `runPipeline.suppliedRoot`.
25328
+ */
25329
+ var SuppliedRootOutputSchema = object({
25330
+ stepId: string(),
25331
+ /** The root model that drew the boxes — stamped on the result. */
25332
+ modelId: string(),
25333
+ detections: array(object({
25334
+ /** `[x1, y1, x2, y2]` in the pixels of the call's image. */
25335
+ bbox: tuple([
25336
+ number(),
25337
+ number(),
25338
+ number(),
25339
+ number()
25340
+ ]),
25341
+ score: number(),
25342
+ /**
25343
+ * Five facial landmarks in the same pixels — a face the step's own
25344
+ * detector already re-found inside a root face box (D730), so its
25345
+ * embedder child aligns it exactly as it aligns any detected face.
25346
+ */
25347
+ landmarks: array(object({
25348
+ x: number(),
25349
+ y: number()
25350
+ })).optional()
25351
+ })).min(1)
25352
+ });
25353
+ /**
24129
25354
  * Reference to the frame's retained NATIVE surface + the parent crop's placement
24130
25355
  * within the frame, so the executor can re-cut a leaf child ROI at native
24131
25356
  * resolution on the detail plane. See the `runPipeline` `nativeCropRef` field.
@@ -24173,7 +25398,7 @@ var FrameRefSchema = object({
24173
25398
  timestamp: number(),
24174
25399
  capturedAt: number().optional()
24175
25400
  });
24176
- var ModelFormatSchema$1 = _enum([
25401
+ var ModelFormatSchema$2 = _enum([
24177
25402
  "onnx",
24178
25403
  "coreml",
24179
25404
  "openvino",
@@ -24191,7 +25416,7 @@ var PipelineSlotSchema = _enum([
24191
25416
  var PipelineEngineChoiceSchema = object({
24192
25417
  runtime: literal("python"),
24193
25418
  backend: string(),
24194
- format: ModelFormatSchema$1,
25419
+ format: ModelFormatSchema$2,
24195
25420
  device: string().optional()
24196
25421
  });
24197
25422
  /**
@@ -24230,32 +25455,15 @@ var PipelineDefaultStepSchema = lazy(() => object({
24230
25455
  group: string().optional(),
24231
25456
  settings: record(string(), unknown()).optional()
24232
25457
  }));
24233
- var PipelineTemplateStepSchema = lazy(() => object({
24234
- addonId: string(),
24235
- enabled: boolean(),
24236
- modelId: string(),
24237
- children: array(PipelineTemplateStepSchema).readonly(),
24238
- settings: record(string(), unknown()).optional()
24239
- }));
24240
- var PipelineTemplateSchema$1 = object({
24241
- id: string(),
24242
- name: string(),
24243
- createdAt: string(),
24244
- updatedAt: string(),
24245
- engine: PipelineEngineChoiceSchema,
24246
- steps: array(PipelineTemplateStepSchema).readonly()
24247
- });
24248
25458
  var PipelineModelOptionSchema = object({
24249
25459
  id: string(),
24250
25460
  name: string(),
24251
- formats: record(string(), object({
24252
- downloaded: boolean(),
24253
- sizeMB: number()
24254
- })),
25461
+ formats: record(string(), PipelineModelFormatStatusSchema),
24255
25462
  group: ModelVariantGroupSchema.optional(),
24256
25463
  legacy: boolean().optional(),
24257
25464
  provider: ModelProviderIdSchema.optional(),
24258
- defaultConfidence: number().optional()
25465
+ defaultConfidence: number().optional(),
25466
+ suppliesSteps: array(RootStepSupplySchema).readonly().optional()
24259
25467
  });
24260
25468
  var ConfigFieldBridge = custom();
24261
25469
  var PipelineAddonSchemaSchema = object({
@@ -24417,6 +25625,22 @@ method(_void(), array(PipelineEngineChoiceSchema)), method(_void(), PipelineEngi
24417
25625
  }), {
24418
25626
  kind: "mutation",
24419
25627
  auth: "admin"
25628
+ }), method(object({
25629
+ nodeId: string(),
25630
+ deviceIds: array(number()).readonly().optional(),
25631
+ dryRun: boolean()
25632
+ }), object({
25633
+ entries: array(object({
25634
+ deviceId: number(),
25635
+ keys: array(string()).readonly()
25636
+ })).readonly(),
25637
+ refused: array(object({
25638
+ deviceId: number(),
25639
+ reason: string()
25640
+ })).readonly()
25641
+ }), {
25642
+ kind: "mutation",
25643
+ auth: "admin"
24420
25644
  }), method(object({ nodeId: string() }), object({ unhealthy: array(object({
24421
25645
  /** `<backend>:<device>`, e.g. `openvino:gpu`. */
24422
25646
  deviceKey: string(),
@@ -24442,22 +25666,14 @@ method(_void(), array(PipelineEngineChoiceSchema)), method(_void(), PipelineEngi
24442
25666
  }), method(_void(), PipelineSchemaSchema), method(_void(), array(PipelineDefaultStepSchema).readonly().nullable()), method(_void(), PipelineConfigBridge), method(_void(), ConfigUISchemaBridge), method(object({
24443
25667
  steps: array(PipelineStepInputSchema),
24444
25668
  deviceKey: string().optional()
24445
- }), PipelineValidationResultSchema), method(_void(), array(PipelineTemplateSchema$1).readonly()), method(object({
24446
- name: string(),
24447
- steps: array(PipelineTemplateStepSchema).readonly(),
24448
- engine: PipelineEngineChoiceSchema
24449
- }), PipelineTemplateSchema$1, { kind: "mutation" }), method(object({
24450
- id: string(),
24451
- name: string().optional(),
24452
- steps: array(PipelineTemplateStepSchema).readonly().optional()
24453
- }), PipelineTemplateSchema$1, { kind: "mutation" }), method(object({ id: string() }), _void(), { kind: "mutation" }), method(_void(), InferenceCapabilitiesBridge), method(object({ addonId: string() }), ModelAvailabilityListBridge), method(object({
25669
+ }), PipelineValidationResultSchema), method(_void(), InferenceCapabilitiesBridge), method(object({ addonId: string() }), ModelAvailabilityListBridge), method(object({
24454
25670
  addonId: string(),
24455
25671
  modelId: string(),
24456
- format: ModelFormatSchema$1
25672
+ format: ModelFormatSchema$2
24457
25673
  }), DownloadModelResultSchema, { kind: "mutation" }), method(object({
24458
25674
  addonId: string(),
24459
25675
  modelId: string(),
24460
- format: ModelFormatSchema$1
25676
+ format: ModelFormatSchema$2
24461
25677
  }), object({ success: literal(true) }), { kind: "mutation" }), method(object({
24462
25678
  steps: array(PipelineStepInputSchema).min(1),
24463
25679
  frame: FrameInputSchema.optional(),
@@ -24523,7 +25739,16 @@ method(_void(), array(PipelineEngineChoiceSchema)), method(_void(), PipelineEngi
24523
25739
  * `device-not-servable`), and nothing reaches the camera's live
24524
25740
  * trace stream. Absent ⇒ unchanged behaviour.
24525
25741
  */
24526
- replay: literal(true).optional()
25742
+ replay: literal(true).optional(),
25743
+ /**
25744
+ * Root-supplied detections for the tree's ROOT step (D730). Set by
25745
+ * `runDetailSubtree` when the camera's root model supplies a crop-kind
25746
+ * step (a Frigate+ `license_plate` for `plate-detection`): the step is
25747
+ * NOT inferred, these boxes are its output, and its children (the plate
25748
+ * reader) run on them through their own crop policy. Boxes are in the
25749
+ * PIXELS of the image this call carries. Absent ⇒ the root step runs.
25750
+ */
25751
+ suppliedRoot: SuppliedRootOutputSchema.optional()
24527
25752
  }), PipelineRunResultBridge, { kind: "mutation" }), method(object({
24528
25753
  steps: array(PipelineStepInputSchema).min(1),
24529
25754
  frames: array(FrameInputSchema).min(1).max(255),
@@ -24605,6 +25830,763 @@ method(_void(), array(PipelineEngineChoiceSchema)), method(_void(), PipelineEngi
24605
25830
  filename: string().optional(),
24606
25831
  settings: record(string(), unknown()).optional()
24607
25832
  }), AudioTestResultSchema, { kind: "mutation" }), method(_void(), ConfigUISchemaNullableBridge);
25833
+ /**
25834
+ * The wire shapes of the Auto tune plan and apply (D745), used by the
25835
+ * `pipeline-orchestrator` cap. The recommender's own types
25836
+ * (`recommend.ts`) are the TS face of the same data; these
25837
+ * schemas are what crosses the cap boundary.
25838
+ */
25839
+ var ModelFormatSchema$1 = _enum(MODEL_FORMATS);
25840
+ /** The operator's range for it. */
25841
+ var MIN_SESSIONS_PER_DEVICE_RANGE = {
25842
+ min: 1,
25843
+ max: 8
25844
+ };
25845
+ var HardwareClassIdSchema = _enum([
25846
+ "intel-core-ultra",
25847
+ "intel-n-series",
25848
+ "apple-m-base",
25849
+ "apple-m-pro",
25850
+ "unknown"
25851
+ ]);
25852
+ var AcceleratorKindSchema = _enum([
25853
+ "intel-npu",
25854
+ "intel-igpu",
25855
+ "x86-cpu",
25856
+ "arm-cpu",
25857
+ "apple-ane",
25858
+ "coral"
25859
+ ]);
25860
+ var RecommendationReasonSchema = discriminatedUnion("kind", [
25861
+ object({
25862
+ kind: literal("capacity"),
25863
+ sessions: number(),
25864
+ minSessions: number()
25865
+ }),
25866
+ object({
25867
+ kind: literal("tie-faster"),
25868
+ over: string(),
25869
+ recallDelta: number()
25870
+ }),
25871
+ object({
25872
+ kind: literal("stepped-down"),
25873
+ from: string(),
25874
+ to: string(),
25875
+ limitedBy: string()
25876
+ }),
25877
+ object({
25878
+ kind: literal("no-fit-lightest"),
25879
+ sessions: number(),
25880
+ minSessions: number()
25881
+ }),
25882
+ object({
25883
+ kind: literal("derived-latency"),
25884
+ modelId: string()
25885
+ }),
25886
+ object({ kind: literal("cpu-device") }),
25887
+ object({ kind: literal("coral-untouched") }),
25888
+ object({ kind: literal("device-disabled") }),
25889
+ object({ kind: literal("device-unavailable") }),
25890
+ object({ kind: literal("node-offline") }),
25891
+ object({ kind: literal("no-hardware-facts") }),
25892
+ object({
25893
+ kind: literal("no-measured-data"),
25894
+ hardwareClass: HardwareClassIdSchema
25895
+ }),
25896
+ object({
25897
+ kind: literal("no-family-build"),
25898
+ format: ModelFormatSchema$1
25899
+ }),
25900
+ object({
25901
+ kind: literal("kept-custom-pin"),
25902
+ modelId: string(),
25903
+ deviceKey: string()
25904
+ })
25905
+ ]);
25906
+ /** Why a device is left exactly as it is, whatever the plan would pick (D786). */
25907
+ var KeptReasonSchema = _enum(["custom-pin"]);
25908
+ /**
25909
+ * Where a choice's latency came from (D791): this node's own benchmark
25910
+ * result, or the hardware-class table. Measured on the node beats the table.
25911
+ */
25912
+ var LatencySourceSchema = discriminatedUnion("kind", [object({ kind: literal("table") }), object({
25913
+ kind: literal("node-benchmark"),
25914
+ resultId: string(),
25915
+ measuredAtMs: number()
25916
+ })]);
25917
+ var DeviceModelChoiceSchema = object({
25918
+ modelId: string(),
25919
+ p50Ms: number(),
25920
+ fps: number(),
25921
+ measured: boolean(),
25922
+ /** Absent on a plan from before D791 — read as the table. */
25923
+ source: LatencySourceSchema.optional(),
25924
+ /** Parallel sessions at the camera rate with the headroom kept free: ⌊fps × (1 − headroom) / camera fps⌋. */
25925
+ capacitySessions: number(),
25926
+ personRecall: number()
25927
+ });
25928
+ var DeviceRecommendationSchema = object({
25929
+ deviceKey: string(),
25930
+ accelerator: AcceleratorKindSchema.nullable(),
25931
+ enabled: boolean(),
25932
+ available: boolean(),
25933
+ chosen: DeviceModelChoiceSchema.nullable(),
25934
+ /** Present when the device is kept as is: Apply writes nothing on it. */
25935
+ kept: KeptReasonSchema.optional(),
25936
+ reasons: array(RecommendationReasonSchema).readonly()
25937
+ });
25938
+ var NodeRecommendationSchema = object({
25939
+ nodeId: string(),
25940
+ reachable: boolean(),
25941
+ hardwareClass: HardwareClassIdSchema.nullable(),
25942
+ cpuModel: string().nullable(),
25943
+ skipped: boolean(),
25944
+ acceleratorModelId: string().nullable(),
25945
+ devices: array(DeviceRecommendationSchema).readonly(),
25946
+ reasons: array(RecommendationReasonSchema).readonly()
25947
+ });
25948
+ var ModelPinChangeSchema = object({
25949
+ stepId: string(),
25950
+ before: string().nullable(),
25951
+ after: string().nullable()
25952
+ });
25953
+ var NodeDeviceChangeSchema = object({
25954
+ nodeId: string(),
25955
+ deviceKey: string(),
25956
+ madeExplicit: boolean(),
25957
+ modelPins: array(ModelPinChangeSchema).readonly(),
25958
+ thresholds: array(object({
25959
+ stepId: string(),
25960
+ keys: array(string()).readonly()
25961
+ })).readonly()
25962
+ });
25963
+ var CameraOverrideClearSchema = object({
25964
+ deviceId: number(),
25965
+ source: _enum(["step-override", "wholesale"]),
25966
+ nodeId: string(),
25967
+ deviceKey: string().nullable(),
25968
+ stepId: string(),
25969
+ modelIdBefore: string().nullable(),
25970
+ keys: array(string()).readonly()
25971
+ });
25972
+ var DetectorStoreClearSchema = object({
25973
+ deviceId: number(),
25974
+ keys: array(string()).readonly()
25975
+ });
25976
+ var AutoTuneWarningSchema = discriminatedUnion("kind", [
25977
+ object({
25978
+ kind: literal("detector-store-cluster-wide"),
25979
+ skippedNodes: array(string()).readonly()
25980
+ }),
25981
+ object({
25982
+ kind: literal("detector-store-unreadable"),
25983
+ error: string()
25984
+ }),
25985
+ object({
25986
+ kind: literal("coral-enabled"),
25987
+ nodeId: string(),
25988
+ deviceKey: string()
25989
+ }),
25990
+ object({
25991
+ kind: literal("custom-pin-kept"),
25992
+ nodeId: string(),
25993
+ deviceKey: string().nullable(),
25994
+ deviceId: number().nullable(),
25995
+ modelId: string()
25996
+ }),
25997
+ object({
25998
+ kind: literal("custom-registry-unreadable"),
25999
+ error: string()
26000
+ })
26001
+ ]);
26002
+ var AutoTuneOptionsSchema = object({
26003
+ /** Share of each accelerator's throughput kept free (0.3–0.5). */
26004
+ headroom: number().min(.3).max(.5).default(.4),
26005
+ /**
26006
+ * The least number of parallel sessions every device must sustain at the
26007
+ * camera rate with the headroom kept free (D755). The most accurate model
26008
+ * that reaches it wins.
26009
+ */
26010
+ minSessionsPerDevice: number().int().min(MIN_SESSIONS_PER_DEVICE_RANGE.min).max(MIN_SESSIONS_PER_DEVICE_RANGE.max).default(2)
26011
+ });
26012
+ var AutoTunePlanSchema = object({
26013
+ /** Hash of everything the apply will write — the apply refuses a different one. */
26014
+ planHash: string(),
26015
+ family: literal("yolov9"),
26016
+ headroom: number(),
26017
+ minSessionsPerDevice: number(),
26018
+ /** The detection rate a session is counted at (the fastest camera running the pipeline root). */
26019
+ cameraFps: number(),
26020
+ generatedAt: number(),
26021
+ nodes: array(NodeRecommendationSchema).readonly(),
26022
+ nodeChanges: array(NodeDeviceChangeSchema).readonly(),
26023
+ cameraClears: array(CameraOverrideClearSchema).readonly(),
26024
+ detectorStoreClears: array(DetectorStoreClearSchema).readonly(),
26025
+ warnings: array(AutoTuneWarningSchema).readonly()
26026
+ });
26027
+ var AutoTuneApplyInputSchema = object({
26028
+ planHash: string(),
26029
+ headroom: number().min(.3).max(.5).default(.4),
26030
+ minSessionsPerDevice: number().int().min(MIN_SESSIONS_PER_DEVICE_RANGE.min).max(MIN_SESSIONS_PER_DEVICE_RANGE.max).default(2)
26031
+ });
26032
+ var AutoTunePhaseResultSchema = object({
26033
+ phase: _enum([
26034
+ "download",
26035
+ "camera-overrides",
26036
+ "detector-thresholds",
26037
+ "node-models",
26038
+ "redispatch"
26039
+ ]),
26040
+ ok: boolean(),
26041
+ detail: string()
26042
+ });
26043
+ var AutoTuneApplyResultSchema = discriminatedUnion("kind", [
26044
+ object({
26045
+ kind: literal("applied"),
26046
+ planHash: string(),
26047
+ phases: array(AutoTunePhaseResultSchema).readonly()
26048
+ }),
26049
+ object({
26050
+ kind: literal("aborted"),
26051
+ phases: array(AutoTunePhaseResultSchema).readonly()
26052
+ }),
26053
+ object({
26054
+ kind: literal("stale"),
26055
+ plan: AutoTunePlanSchema
26056
+ }),
26057
+ object({
26058
+ kind: literal("refused"),
26059
+ reason: _enum(["apply-in-progress"])
26060
+ })
26061
+ ]);
26062
+ /**
26063
+ * Wire shapes of the Load balancing surface (D748): the session placement
26064
+ * policy, the atomic share write, the observed placement statistics, the
26065
+ * hardware share suggestion and the stale device pins.
26066
+ */
26067
+ /**
26068
+ * How a new detection session picks its node and device.
26069
+ * - `least-loaded` — the historical rule: lowest `attached / weight`, a
26070
+ * constant node order at a tie (D37). An idle node always ties at 0, so a
26071
+ * weight only bites once a node already holds a session.
26072
+ * - `share` — the share of PARALLEL sessions is held to the weights, and a
26073
+ * full or drowning node yields to a free one (D748).
26074
+ */
26075
+ var SessionPlacementPolicySchema = _enum(["least-loaded", "share"]);
26076
+ var LoadBalancingSharesInputSchema = object({
26077
+ /** nodeId → share (> 0). A node left out keeps its weight. */
26078
+ nodes: record(string(), number().positive()).default({}),
26079
+ /** nodeId → deviceKey → share (> 0). A device left out keeps its weight. */
26080
+ devices: record(string(), record(string(), number().positive())).default({})
26081
+ });
26082
+ var PlacementStatsInputSchema = object({
26083
+ /** Window the observed shares are averaged over (default 1 h, max 24 h). */
26084
+ windowMs: number().int().min(6e4).max(1440 * 60 * 1e3).default(3600 * 1e3) });
26085
+ var PlacementDeviceStatsSchema = object({
26086
+ deviceKey: string(),
26087
+ /** Sessions running on this device now. */
26088
+ sessionsNow: number(),
26089
+ /** Sessions started on this device inside the window. */
26090
+ sessionsStarted: number(),
26091
+ /** Time-weighted share of the node's parallel sessions over the window (0–1); null = no session ran. */
26092
+ observedShare: number().nullable()
26093
+ });
26094
+ var PlacementNodeStatsSchema = object({
26095
+ nodeId: string(),
26096
+ sessionsNow: number(),
26097
+ sessionsStarted: number(),
26098
+ /** Time-weighted share of the cluster's parallel sessions over the window (0–1); null = none ran. */
26099
+ observedShare: number().nullable(),
26100
+ /** Most sessions this node ran at once inside the window. */
26101
+ peakSessions: number(),
26102
+ /** Sessions a share election handed elsewhere because this node was full or drowning. */
26103
+ yieldsAway: number(),
26104
+ devices: array(PlacementDeviceStatsSchema).readonly()
26105
+ });
26106
+ /** A camera's device pin that the session path cannot honour. */
26107
+ var StaleDevicePinSchema = object({
26108
+ deviceId: number(),
26109
+ deviceKey: string(),
26110
+ /** `disabled` — the key exists on some node but is not enabled anywhere; `absent` — no node has it. */
26111
+ reason: _enum(["disabled", "absent"])
26112
+ });
26113
+ var PlacementStatsSchema = object({
26114
+ policy: SessionPlacementPolicySchema,
26115
+ windowMs: number(),
26116
+ /** How much of the window was actually observed (the hub keeps it in memory). */
26117
+ observedForMs: number(),
26118
+ sessionsNow: number(),
26119
+ /** Most parallel sessions across the cluster inside the window. */
26120
+ clusterPeakSessions: number(),
26121
+ nodes: array(PlacementNodeStatsSchema).readonly(),
26122
+ stalePins: array(StaleDevicePinSchema).readonly()
26123
+ });
26124
+ /**
26125
+ * Where an automatic share's capacity comes from (D755).
26126
+ * - `hardware` — the static capacity of each device at its Auto tune model:
26127
+ * the measured latency table for the node's hardware class.
26128
+ * - `benchmark` — the node's own measured capacity (node benchmark results).
26129
+ * A node with no results falls back to `hardware`, and says so.
26130
+ */
26131
+ var CapacitySourceSchema = _enum(["hardware", "benchmark"]);
26132
+ /** Why a node under the `benchmark` source was sized from hardware instead. */
26133
+ var CapacityFallbackSchema = _enum(["no-benchmark-results", "partial-benchmark-results"]);
26134
+ var SuggestSharesInputSchema = object({
26135
+ headroom: number().min(.3).max(.5).default(.4),
26136
+ /** Default `hardware`. */
26137
+ source: CapacitySourceSchema.default("hardware")
26138
+ });
26139
+ var SuggestedDeviceShareSchema = object({
26140
+ deviceKey: string(),
26141
+ /** Share of the node (0–100, rounded). */
26142
+ share: number(),
26143
+ modelId: string().nullable(),
26144
+ /** Inferences per second at that model, from the measured table; null when sized by a benchmark. */
26145
+ fps: number().nullable(),
26146
+ /** False for a table cell derived from another chip; true for a measured cell or a benchmark. */
26147
+ measured: boolean(),
26148
+ /**
26149
+ * Advisory session cap: ⌊fps × (1 − headroom) / camera fps⌋ from the table,
26150
+ * or the benchmark's measured max sessions. Never enforced.
26151
+ */
26152
+ suggestedMaxSessions: number().nullable()
26153
+ });
26154
+ var SuggestedNodeShareSchema = object({
26155
+ nodeId: string(),
26156
+ /** Share of the cluster (0–100, rounded); null = node skipped (offline, unknown hardware). */
26157
+ share: number().nullable(),
26158
+ /** Parallel sessions the node sustains at the suggested models with the headroom kept free. */
26159
+ capacitySessions: number(),
26160
+ devices: array(SuggestedDeviceShareSchema).readonly(),
26161
+ skippedReason: string().nullable(),
26162
+ /** What this node's capacity was read from; null when the node is skipped. */
26163
+ capacitySource: CapacitySourceSchema.nullable(),
26164
+ /** Set when the `benchmark` source was asked for and this node used `hardware`. */
26165
+ capacityFallback: CapacityFallbackSchema.nullable()
26166
+ });
26167
+ var SuggestSharesResultSchema = object({
26168
+ headroom: number(),
26169
+ /** The source asked for; each node says what it actually used. */
26170
+ source: CapacitySourceSchema,
26171
+ /** Camera detection rate the capacity is counted in (the fastest camera's fps). */
26172
+ cameraFps: number(),
26173
+ /** The Auto tune capacity floor the models were picked at. */
26174
+ minSessionsPerDevice: number(),
26175
+ nodes: array(SuggestedNodeShareSchema).readonly()
26176
+ });
26177
+ /**
26178
+ * Where the node and device shares come from (D750, D755, D791).
26179
+ * - `benchmark` (default since D791) — each node's capacity as its own node
26180
+ * benchmark measured it; a node without fresh results is sized from
26181
+ * `hardware` and says so. Measured on the node beats the table.
26182
+ * - `hardware` — computed from each node's static capacity only (its
26183
+ * accelerators at their Auto tune models, from the latency table).
26184
+ * Both are recomputed whenever a node or device joins, leaves, is switched
26185
+ * on or off, changes model, or a benchmark result is written. No load input.
26186
+ * - `manual` — the operator's stored sliders.
26187
+ * Either way a node or device that cannot take sessions gives its share to
26188
+ * the others in proportion; the stored values are never rewritten for that.
26189
+ */
26190
+ var ShareSourceSchema = _enum([
26191
+ "hardware",
26192
+ "benchmark",
26193
+ "manual"
26194
+ ]);
26195
+ var SetShareSourceInputSchema = object({ source: ShareSourceSchema });
26196
+ object({
26197
+ nodes: record(string(), number()),
26198
+ devices: record(string(), record(string(), number()))
26199
+ });
26200
+ var EffectiveDeviceShareSchema = object({
26201
+ deviceKey: string(),
26202
+ /** Can take sessions now (enabled, available, can run the root). */
26203
+ eligible: boolean(),
26204
+ /** The share the source assigns, as a percentage of the node's devices. */
26205
+ configuredPct: number(),
26206
+ /** The share actually used, after an ineligible device's share went to the others. */
26207
+ effectivePct: number()
26208
+ });
26209
+ var EffectiveNodeShareSchema = object({
26210
+ nodeId: string(),
26211
+ eligible: boolean(),
26212
+ configuredPct: number(),
26213
+ effectivePct: number(),
26214
+ /** Automatic sources: what this node's share was computed from; null under `manual` or before the first answer. */
26215
+ capacitySource: CapacitySourceSchema.nullable(),
26216
+ /** Automatic `benchmark`: why this node used `hardware` instead. */
26217
+ capacityFallback: CapacityFallbackSchema.nullable(),
26218
+ devices: array(EffectiveDeviceShareSchema).readonly()
26219
+ });
26220
+ var EffectiveSharesSchema = object({
26221
+ source: ShareSourceSchema,
26222
+ policy: SessionPlacementPolicySchema,
26223
+ /** An automatic source with no computed answer yet: the stored sliders are used meanwhile. */
26224
+ autoPending: boolean(),
26225
+ /** When the automatic shares were last computed (ms epoch); null = never. */
26226
+ computedAt: number().nullable(),
26227
+ /** What made the system recompute them last. */
26228
+ trigger: string().nullable(),
26229
+ nodes: array(EffectiveNodeShareSchema).readonly(),
26230
+ /** The relative weights the election reads (before eligibility). */
26231
+ nodeWeights: record(string(), number()),
26232
+ deviceWeights: record(string(), record(string(), number()))
26233
+ });
26234
+ /**
26235
+ * Wire shapes of the node benchmark (D791): the operator's plan, the
26236
+ * preflight the confirmation shows, the run the orchestrator owns, what the
26237
+ * measuring runner reports, and the result rows Auto tune and the automatic
26238
+ * shares read.
26239
+ *
26240
+ * ONE node at a time, owned by the pipeline orchestrator. While a run is
26241
+ * active the cluster is in BENCHMARK MODE for that node: it is not a
26242
+ * detection candidate, camera pins naming it are ignored so its sessions move
26243
+ * elsewhere, and both come back when the mode ends — after a crash or a hub
26244
+ * restart too (a persisted manifest, reconciled against the registry).
26245
+ *
26246
+ * Two measurements, both on the node, driven by its own runner (frames never
26247
+ * cross a process at frame rate, D9):
26248
+ * - `device` — one accelerator × one candidate detector, root only, open
26249
+ * loop: how many streams at the camera rate it carries inside the frame
26250
+ * interval;
26251
+ * - `pipeline` — the chosen detector plus the operator's detail steps
26252
+ * (faces, plates, classifiers, CLIP…), on varied frames from the bench
26253
+ * clip: how many parallel sessions the node carries before latency, drops,
26254
+ * CPU, RAM or the event loop give out.
26255
+ */
26256
+ /** Defaults and bounds, one place. */
26257
+ var NODE_BENCHMARK_DEFAULTS = {
26258
+ fpsPerStream: 10,
26259
+ budgetMinutes: 45,
26260
+ minBudgetMinutes: 10,
26261
+ maxBudgetMinutes: 120,
26262
+ /** A result older than this no longer beats the table. */
26263
+ staleAfterDays: 30,
26264
+ /** Warm-in per ramp step (not accounted). */
26265
+ settleSec: 5,
26266
+ /** Accounted window per ramp step. */
26267
+ measureSec: 20,
26268
+ /** Longest the drain may take before the run is refused. */
26269
+ drainTimeoutSec: 120,
26270
+ /** Candidate models per device in one run. */
26271
+ maxModelsPerDevice: 6
26272
+ };
26273
+ /** The two measurements a run can make. */
26274
+ var NodeBenchmarkPhaseSchema = _enum(["device", "pipeline"]);
26275
+ var NodeBenchmarkDevicePlanSchema = object({
26276
+ /** `<backend>:<device>` — `openvino:npu`, `coreml:all`, `cpu`. */
26277
+ deviceKey: string().min(1),
26278
+ /**
26279
+ * Root detector candidates for the `device` measurement, in the order
26280
+ * measured. The FIRST is the one the `pipeline` measurement runs.
26281
+ */
26282
+ modelIds: array(string().min(1)).min(1).max(NODE_BENCHMARK_DEFAULTS.maxModelsPerDevice)
26283
+ });
26284
+ /** What the operator confirmed. */
26285
+ var NodeBenchmarkPlanSchema = object({
26286
+ nodeId: string().min(1),
26287
+ devices: array(NodeBenchmarkDevicePlanSchema).min(1),
26288
+ /** Which measurements run. At least one. */
26289
+ phases: array(NodeBenchmarkPhaseSchema).min(1).default(["device", "pipeline"]),
26290
+ /**
26291
+ * Detail steps (catalog step ids under the root: faces, plates,
26292
+ * classifiers, CLIP…) the `pipeline` measurement enables. The root
26293
+ * detector always runs.
26294
+ */
26295
+ steps: array(string().min(1)).default([]),
26296
+ /** Offered rate of one stream / session. */
26297
+ fpsPerStream: number().int().min(1).max(30).default(NODE_BENCHMARK_DEFAULTS.fpsPerStream),
26298
+ /** Hard deadline: the mode ends and the cluster is restored when it passes. */
26299
+ budgetMinutes: number().int().min(NODE_BENCHMARK_DEFAULTS.minBudgetMinutes).max(NODE_BENCHMARK_DEFAULTS.maxBudgetMinutes).default(NODE_BENCHMARK_DEFAULTS.budgetMinutes),
26300
+ /** Keep the models the run downloaded (default: delete what was not installed before). */
26301
+ keepDownloadedModels: boolean().default(false),
26302
+ /** Start although the other nodes' capacity does not cover the sessions running now. */
26303
+ acceptInsufficientHeadroom: boolean().default(false)
26304
+ });
26305
+ var NodeBenchmarkRefusalSchema = object({
26306
+ kind: _enum([
26307
+ "benchmark-active",
26308
+ "node-offline",
26309
+ "unknown-device",
26310
+ "no-phase",
26311
+ "insufficient-headroom"
26312
+ ]),
26313
+ detail: string(),
26314
+ overridable: boolean()
26315
+ });
26316
+ /** A camera whose detection leaves the node for the run. */
26317
+ var NodeBenchmarkMovingCameraSchema = object({
26318
+ deviceId: number(),
26319
+ /** Placed on the node now (a standing attach or a running session). */
26320
+ placedOnNode: boolean(),
26321
+ /** A node pin naming this node, ignored for the run. */
26322
+ pinnedToNode: boolean()
26323
+ });
26324
+ /** A camera that cannot leave: no other node can obtain its frames. */
26325
+ var NodeBenchmarkStayingCameraSchema = object({
26326
+ deviceId: number(),
26327
+ reason: literal("only-frame-source")
26328
+ });
26329
+ var NodeBenchmarkPreflightSchema = object({
26330
+ nodeId: string(),
26331
+ online: boolean(),
26332
+ moving: array(NodeBenchmarkMovingCameraSchema).readonly(),
26333
+ /** Keep running on the node during the run; the result is flagged contaminated. */
26334
+ staying: array(NodeBenchmarkStayingCameraSchema).readonly(),
26335
+ estimatedDurationMs: number(),
26336
+ /** The run ends and the cluster is restored at the latest after this long. */
26337
+ budgetMs: number(),
26338
+ phases: array(NodeBenchmarkPhaseSchema).readonly(),
26339
+ steps: array(string()).readonly(),
26340
+ devices: array(NodeBenchmarkDevicePlanSchema).readonly(),
26341
+ /** Parallel sessions the cluster runs now, and what the other nodes can carry. */
26342
+ headroom: object({
26343
+ sessionsNow: number(),
26344
+ otherNodesCapacitySessions: number().nullable()
26345
+ }),
26346
+ refusals: array(NodeBenchmarkRefusalSchema).readonly(),
26347
+ canStart: boolean()
26348
+ });
26349
+ /** Where the measuring runner is. */
26350
+ var NodeBenchProgressSchema = object({
26351
+ phase: _enum([
26352
+ "preparing",
26353
+ "device",
26354
+ "pipeline",
26355
+ "cleanup"
26356
+ ]),
26357
+ deviceKey: string().nullable(),
26358
+ modelId: string().nullable(),
26359
+ /** Streams (device) or sessions (pipeline) of the step running now. */
26360
+ load: number().nullable(),
26361
+ cellsDone: number(),
26362
+ cellsTotal: number(),
26363
+ message: string()
26364
+ });
26365
+ /** What limited a ramp. `none` = the ramp ran out of steps still passing. */
26366
+ var NodeBenchLimitSchema = _enum([
26367
+ "p95",
26368
+ "drops",
26369
+ "errors",
26370
+ "stall",
26371
+ "cpu",
26372
+ "ram",
26373
+ "none"
26374
+ ]);
26375
+ var NodeBenchRampStepSchema = object({
26376
+ load: number(),
26377
+ pass: boolean(),
26378
+ p95Ms: number(),
26379
+ dropRatio: number(),
26380
+ /** Completed frames per second over the accounted window. */
26381
+ fps: number(),
26382
+ cpuPct: number().nullable(),
26383
+ ramFreePct: number().nullable(),
26384
+ failReasons: array(string()).readonly()
26385
+ });
26386
+ var NodeBenchCellSchema = discriminatedUnion("phase", [object({
26387
+ phase: literal("device"),
26388
+ deviceKey: string(),
26389
+ modelId: string(),
26390
+ /** Single-stream latency (the K = 1 step). */
26391
+ p50Ms: number(),
26392
+ p95Ms: number(),
26393
+ p99Ms: number(),
26394
+ /** Frames per second sustained at the last passing step. */
26395
+ fps: number(),
26396
+ /** Streams at the camera rate the device carried inside the frame interval; 0 = not even one. */
26397
+ kMax: number(),
26398
+ limitedBy: NodeBenchLimitSchema,
26399
+ /** First call (model load + warm-up). */
26400
+ warmupMs: number(),
26401
+ ramp: array(NodeBenchRampStepSchema).readonly()
26402
+ }), object({
26403
+ phase: literal("pipeline"),
26404
+ deviceKey: string(),
26405
+ modelId: string(),
26406
+ steps: array(string()).readonly(),
26407
+ /** Parallel sessions at the camera rate the node carried; 0 = not even one. */
26408
+ maxSessions: number(),
26409
+ limitedBy: NodeBenchLimitSchema,
26410
+ /** Detail steps that produced at least one result on the clip — a step that never fired measured nothing. */
26411
+ stepsFired: array(string()).readonly(),
26412
+ warmupMs: number(),
26413
+ ramp: array(NodeBenchRampStepSchema).readonly()
26414
+ })]);
26415
+ /**
26416
+ * What a result was measured ON. A result whose fingerprint no longer matches
26417
+ * the node no longer beats the table.
26418
+ */
26419
+ var NodeBenchFingerprintSchema = object({
26420
+ pipelineVersion: string().nullable(),
26421
+ cpuModel: string().nullable(),
26422
+ ramGb: number().nullable(),
26423
+ os: string().nullable(),
26424
+ /** Per device: the pool the cells ran on (runtime + tuning). */
26425
+ pools: record(string(), object({
26426
+ runtime: string(),
26427
+ numWorkers: number(),
26428
+ concurrency: number(),
26429
+ batchMode: string()
26430
+ })).default({})
26431
+ });
26432
+ /** The frames the run used. */
26433
+ var NodeBenchClipSchema = object({
26434
+ /** `camstack-bench-v1` or `reference-images` (the fallback when the clip is not reachable). */
26435
+ id: string(),
26436
+ revision: string().nullable(),
26437
+ frames: number(),
26438
+ width: number(),
26439
+ height: number()
26440
+ });
26441
+ var NodeBenchRunnerInputSchema = object({
26442
+ runId: string().min(1),
26443
+ devices: array(NodeBenchmarkDevicePlanSchema).min(1),
26444
+ phases: array(NodeBenchmarkPhaseSchema).min(1),
26445
+ /** The full detail step tree root for the `pipeline` measurement is built on the node from these ids. */
26446
+ steps: array(string()).default([]),
26447
+ fpsPerStream: number().int().min(1).max(30),
26448
+ /** The runner stops on its own past this instant, whatever the hub does. */
26449
+ deadlineAtMs: number(),
26450
+ settleSec: number().min(0).max(60).default(NODE_BENCHMARK_DEFAULTS.settleSec),
26451
+ measureSec: number().min(2).max(300).default(NODE_BENCHMARK_DEFAULTS.measureSec),
26452
+ keepDownloadedModels: boolean().default(false)
26453
+ });
26454
+ var NodeBenchRunnerStateSchema = _enum([
26455
+ "running",
26456
+ "done",
26457
+ "failed",
26458
+ "aborted"
26459
+ ]);
26460
+ var NodeBenchRunnerStatusSchema = object({
26461
+ runId: string(),
26462
+ nodeId: string(),
26463
+ state: NodeBenchRunnerStateSchema,
26464
+ progress: NodeBenchProgressSchema.nullable(),
26465
+ /** Every finished cell so far — a run stopped half way keeps what it measured. */
26466
+ cells: array(NodeBenchCellSchema).readonly(),
26467
+ fingerprint: NodeBenchFingerprintSchema.nullable(),
26468
+ clip: NodeBenchClipSchema.nullable(),
26469
+ /** Cameras seen running on the node during the run (they share its pools). */
26470
+ activeCameraIds: array(number()).readonly(),
26471
+ /** Models the run downloaded and then deleted (not installed before). */
26472
+ deletedModels: array(string()).readonly(),
26473
+ error: string().nullable(),
26474
+ startedAtMs: number(),
26475
+ finishedAtMs: number().nullable()
26476
+ });
26477
+ var NodeBenchmarkStateSchema = _enum([
26478
+ "draining",
26479
+ "measuring",
26480
+ "restoring",
26481
+ "done",
26482
+ "failed",
26483
+ "aborted"
26484
+ ]);
26485
+ /** Why a run ended. */
26486
+ var NodeBenchmarkEndReasonSchema = _enum([
26487
+ "completed",
26488
+ "operator-abort",
26489
+ "deadline",
26490
+ "node-lost",
26491
+ "runner-lost",
26492
+ "hub-restart",
26493
+ "drain-timeout",
26494
+ "failed"
26495
+ ]);
26496
+ var NodeBenchmarkRunSchema = object({
26497
+ runId: string(),
26498
+ nodeId: string(),
26499
+ state: NodeBenchmarkStateSchema,
26500
+ plan: NodeBenchmarkPlanSchema,
26501
+ startedAtMs: number(),
26502
+ deadlineAtMs: number(),
26503
+ finishedAtMs: number().nullable(),
26504
+ endReason: NodeBenchmarkEndReasonSchema.nullable(),
26505
+ error: string().nullable(),
26506
+ /** Cameras moved off the node for the run. */
26507
+ moved: array(number()).readonly(),
26508
+ /** Cameras that stayed (their only frame source is the node). */
26509
+ staying: array(number()).readonly(),
26510
+ /** Something else ran on the node's pools during the run. */
26511
+ contaminated: boolean(),
26512
+ progress: NodeBenchProgressSchema.nullable(),
26513
+ resultIds: array(string()).readonly()
26514
+ });
26515
+ /** `getNodeBenchmarkStatus`: the active run (or the last one), and whether benchmark mode is on. */
26516
+ var NodeBenchmarkStatusSchema = object({
26517
+ /** The node the cluster is in benchmark mode for; null = none. */
26518
+ modeNodeId: string().nullable(),
26519
+ run: NodeBenchmarkRunSchema.nullable()
26520
+ });
26521
+ /**
26522
+ * One stored measurement — the only authority Auto tune and the automatic
26523
+ * shares read measured capacity from. Written by the orchestrator when a run
26524
+ * ends, never by anyone else.
26525
+ */
26526
+ var NodeBenchmarkResultSchema = object({
26527
+ id: string(),
26528
+ runId: string(),
26529
+ nodeId: string(),
26530
+ cell: NodeBenchCellSchema,
26531
+ fpsPerStream: number(),
26532
+ fingerprint: NodeBenchFingerprintSchema.nullable(),
26533
+ clip: NodeBenchClipSchema.nullable(),
26534
+ /** Other work shared the node's pools (a camera that could not move, or the hub's own duties). */
26535
+ contaminated: boolean(),
26536
+ stayingCameras: array(number()).readonly(),
26537
+ /** The run ended early; the cell itself completed. */
26538
+ partialRun: boolean(),
26539
+ measuredAtMs: number()
26540
+ });
26541
+ var ListNodeBenchmarkResultsInputSchema = object({
26542
+ nodeId: string().optional(),
26543
+ deviceKey: string().optional()
26544
+ });
26545
+ /** A result with its standing today: does it still beat the table? */
26546
+ var NodeBenchmarkResultViewSchema = NodeBenchmarkResultSchema.extend({
26547
+ /** `fresh` beats the table; `stale` falls back to it; `superseded` = a newer row covers the same cell. */
26548
+ standing: _enum([
26549
+ "fresh",
26550
+ "stale",
26551
+ "superseded"
26552
+ ]),
26553
+ staleWhy: _enum([
26554
+ "age",
26555
+ "runtime",
26556
+ "pool-tuning"
26557
+ ]).nullable()
26558
+ });
26559
+ object({
26560
+ runId: string(),
26561
+ nodeId: string(),
26562
+ startedAtMs: number(),
26563
+ deadlineAtMs: number(),
26564
+ plan: NodeBenchmarkPlanSchema,
26565
+ moved: array(number()).readonly(),
26566
+ staying: array(number()).readonly()
26567
+ });
26568
+ /** Candidate detectors per device, for the plan editor. */
26569
+ var NodeBenchmarkCandidatesSchema = object({
26570
+ nodeId: string(),
26571
+ reachable: boolean(),
26572
+ devices: array(object({
26573
+ deviceKey: string(),
26574
+ enabled: boolean(),
26575
+ available: boolean(),
26576
+ /** Ordered: what Auto tune would pick first, then the rest of the family by accuracy. */
26577
+ suggested: array(string()).readonly(),
26578
+ /** Every root detector the device has a build for. */
26579
+ all: array(string()).readonly(),
26580
+ /** The model the device runs now, when pinned. */
26581
+ currentModelId: string().nullable()
26582
+ })).readonly(),
26583
+ /** Detail steps the node's catalog offers under the root (for the `pipeline` measurement). */
26584
+ steps: array(object({
26585
+ id: string(),
26586
+ name: string(),
26587
+ slot: string()
26588
+ })).readonly()
26589
+ });
24608
26590
  object({
24609
26591
  activeCameras: number(),
24610
26592
  throttledCameras: number(),
@@ -25522,14 +27504,15 @@ var RunnerLocalLoadSchema = object({
25522
27504
  * Per-inference-device live load (multi-device C4). One entry per deviceKey
25523
27505
  * this runner currently has attached cameras on, so the orchestrator's second
25524
27506
  * `balance()` pass (over a node's devices) weights on real per-pool session
25525
- * counts. Empty on single-device / pre-multi-device runners. `queueDepthTotal`
25526
- * per device is 0 until the pool backlog gets a public accessor (follow-up).
27507
+ * counts. Empty on single-device / pre-multi-device runners. There is no
27508
+ * per-device queue depth: the inference pool's backlog has no accessor, and
27509
+ * a field that always read 0 was removed rather than shown as a measurement
27510
+ * (D762).
25527
27511
  */
25528
27512
  devices: array(object({
25529
27513
  deviceKey: string(),
25530
27514
  backend: string(),
25531
- attachedCameras: number(),
25532
- queueDepthTotal: number()
27515
+ attachedCameras: number()
25533
27516
  })).default([]),
25534
27517
  /** Hardware capability flags reported by this node. */
25535
27518
  hardware: object({
@@ -25665,7 +27648,22 @@ method(RunnerCameraConfigSchema, object({ success: literal(true) }), { kind: "mu
25665
27648
  */
25666
27649
  cropJpeg: string().optional(),
25667
27650
  parent: DetailParentSchema,
25668
- steps: array(string()).optional()
27651
+ steps: array(string()).optional(),
27652
+ /**
27653
+ * The camera's root model already drew this step's boxes (D730): a
27654
+ * `license_plate` inside the parent vehicle. The named step is NOT
27655
+ * inferred — these FRAME-space boxes are its output — and its
27656
+ * requested children (the plate reader) run on them. Absent ⇒ every
27657
+ * requested step infers as before.
27658
+ */
27659
+ supplied: object({
27660
+ stepId: string(),
27661
+ modelId: string(),
27662
+ boxes: array(object({
27663
+ bbox: NativeCropBboxSchema,
27664
+ score: number()
27665
+ })).min(1)
27666
+ }).optional()
25669
27667
  }), object({ details: array(DetailResultSchema) }).nullable(), { kind: "mutation" }), method(object({
25670
27668
  /** Catalog step id, e.g. `clip-embedding`. */
25671
27669
  stepId: string(),
@@ -25717,7 +27715,16 @@ method(RunnerCameraConfigSchema, object({ success: literal(true) }), { kind: "mu
25717
27715
  }), ParkedTrackFrameSchema.nullable()), method(object({
25718
27716
  deviceId: number(),
25719
27717
  trackId: string()
25720
- }), object({ released: number().int().nonnegative() }), { kind: "mutation" });
27718
+ }), object({ released: number().int().nonnegative() }), { kind: "mutation" }), method(NodeBenchRunnerInputSchema, object({
27719
+ accepted: literal(true),
27720
+ runId: string()
27721
+ }), {
27722
+ kind: "mutation",
27723
+ auth: "admin"
27724
+ }), method(object({ runId: string() }), NodeBenchRunnerStatusSchema.nullable(), { auth: "admin" }), method(object({ runId: string() }), object({ aborted: boolean() }), {
27725
+ kind: "mutation",
27726
+ auth: "admin"
27727
+ });
25721
27728
  var CameraPipelineConfigSchema = object({
25722
27729
  engine: PipelineEngineChoiceSchema.optional(),
25723
27730
  steps: array(PipelineStepInputSchema).readonly(),
@@ -25728,14 +27735,6 @@ var CameraPipelineConfigSchema = object({
25728
27735
  settings: record(string(), unknown()).readonly().optional()
25729
27736
  }).nullable().optional()
25730
27737
  });
25731
- var PipelineTemplateSchema = object({
25732
- id: string(),
25733
- name: string(),
25734
- description: string().optional(),
25735
- config: CameraPipelineConfigSchema,
25736
- createdAt: string(),
25737
- updatedAt: string()
25738
- });
25739
27738
  var DeviceStepConfigSchema = object({
25740
27739
  modelId: string().optional(),
25741
27740
  settings: record(string(), unknown()).optional(),
@@ -25809,9 +27808,10 @@ var CameraStepOverridePatchSchema = object({
25809
27808
  modelId: string().optional(),
25810
27809
  settings: record(string(), unknown()).readonly().optional()
25811
27810
  });
27811
+ var CameraStepSettingsSchema = record(string(), record(string(), unknown()).readonly());
25812
27812
  var CameraPipelineSettingsSchema = object({
25813
- pinnedAgentNodeId: string().optional(),
25814
27813
  stepToggles: record(string(), boolean()).optional(),
27814
+ stepSettings: CameraStepSettingsSchema.optional(),
25815
27815
  stepOverridesByDevice: record(string(), record(string(), record(string(), CameraStepOverridePatchSchema))).optional(),
25816
27816
  pipelineByAgent: record(string(), CameraPipelineForAgentSchema).optional()
25817
27817
  });
@@ -25844,7 +27844,10 @@ var PipelineAssignmentSchema = object({
25844
27844
  });
25845
27845
  /**
25846
27846
  * Per-agent load summary surfaced to the load balancer + dashboards.
25847
- * Aggregated from each runner's `getLocalLoad` cap call.
27847
+ * Aggregated from each runner's `getLocalLoad` cap call. In the
27848
+ * `getAgentLoad` report, a single-device node's default-pool sessions (no
27849
+ * `deviceKey`) are credited to its one eligible device in `load.devices` —
27850
+ * the default pool IS that device (D745); the balancer's census stays raw.
25848
27851
  */
25849
27852
  var AgentLoadSummarySchema = object({
25850
27853
  nodeId: string(),
@@ -25933,26 +27936,27 @@ var CameraBrokerStatusSchema = object({
25933
27936
  width: number(),
25934
27937
  height: number(),
25935
27938
  subscribers: number(),
25936
- inFps: number(),
25937
- outFps: number()
27939
+ /**
27940
+ * Encoded packets/s the broker receives from the camera. null when the
27941
+ * broker's stats read failed — unknown, never 0 (a 0 here reads as a stall).
27942
+ * There is no output rate: decoding runs in the session decode workers, not
27943
+ * in the broker, so the broker's own decoded-frame rate is 0 on every live
27944
+ * camera and is not served (D758).
27945
+ */
27946
+ inFps: number().nullable()
25938
27947
  })).readonly(),
25939
27948
  webrtcSessions: number(),
25940
27949
  rtspRestream: boolean()
25941
27950
  });
25942
- /** Shared-memory ring statistics within the decoder block. */
25943
- var CameraDecoderShmSchema = object({
25944
- framesWritten: number(),
25945
- getFrameHits: number(),
25946
- getFrameMisses: number(),
25947
- budgetMb: number()
25948
- });
25949
- /** Decoder block — null when the decoder stage is unreachable or inactive. */
25950
- var CameraDecoderStatusSchema = object({
25951
- nodeId: string(),
25952
- formats: array(string()).readonly(),
25953
- sessionCount: number(),
25954
- shm: CameraDecoderShmSchema
25955
- });
27951
+ /**
27952
+ * Decoder block — WHERE decode runs (co-located with the detection node by
27953
+ * construction); null when the camera has no detection node. It carries no
27954
+ * frame counter: the shared-memory plane whose counters it used to serve is
27955
+ * gone, and those fields read 0 forever. Whether frames actually flow is read
27956
+ * from `detection.actualFps` (frames delivered to and processed by the
27957
+ * detector), never from a counter nothing feeds.
27958
+ */
27959
+ var CameraDecoderStatusSchema = object({ nodeId: string() });
25956
27960
  /** Motion block — null when motion detection is not active for this device. */
25957
27961
  var CameraMotionStatusSchema = object({
25958
27962
  enabled: boolean(),
@@ -26309,12 +28313,6 @@ method(object({
26309
28313
  }), object({ success: literal(true) }), {
26310
28314
  kind: "mutation",
26311
28315
  auth: "admin"
26312
- }), method(object({
26313
- agentNodeId: string(),
26314
- detectWeight: number().positive().nullable()
26315
- }), object({ success: literal(true) }), {
26316
- kind: "mutation",
26317
- auth: "admin"
26318
28316
  }), method(object({
26319
28317
  agentNodeId: string(),
26320
28318
  detect: boolean().nullable().optional(),
@@ -26356,6 +28354,30 @@ method(object({
26356
28354
  }), {
26357
28355
  kind: "mutation",
26358
28356
  auth: "admin"
28357
+ }), method(AutoTuneOptionsSchema, AutoTunePlanSchema, { auth: "admin" }), method(AutoTuneApplyInputSchema, AutoTuneApplyResultSchema, {
28358
+ kind: "mutation",
28359
+ auth: "admin"
28360
+ }), method(LoadBalancingSharesInputSchema, object({ success: literal(true) }), {
28361
+ kind: "mutation",
28362
+ auth: "admin"
28363
+ }), method(PlacementStatsInputSchema, PlacementStatsSchema, { auth: "admin" }), method(SuggestSharesInputSchema, SuggestSharesResultSchema, { auth: "admin" }), method(_void(), EffectiveSharesSchema, { auth: "admin" }), method(SetShareSourceInputSchema, object({ success: literal(true) }), {
28364
+ kind: "mutation",
28365
+ auth: "admin"
28366
+ }), method(NodeBenchmarkPlanSchema, NodeBenchmarkPreflightSchema, { auth: "admin" }), method(NodeBenchmarkPlanSchema, discriminatedUnion("kind", [object({
28367
+ kind: literal("started"),
28368
+ runId: string()
28369
+ }), object({
28370
+ kind: literal("refused"),
28371
+ preflight: NodeBenchmarkPreflightSchema
28372
+ })]), {
28373
+ kind: "mutation",
28374
+ auth: "admin"
28375
+ }), method(_void(), NodeBenchmarkStatusSchema, { auth: "admin" }), method(object({ runId: string() }), object({ aborted: boolean() }), {
28376
+ kind: "mutation",
28377
+ auth: "admin"
28378
+ }), method(object({ nodeId: string() }), NodeBenchmarkCandidatesSchema, { auth: "admin" }), method(ListNodeBenchmarkResultsInputSchema, array(NodeBenchmarkResultViewSchema).readonly(), { auth: "admin" }), method(object({ id: string() }), object({ deleted: boolean() }), {
28379
+ kind: "mutation",
28380
+ auth: "admin"
26359
28381
  }), method(object({ deviceId: number() }), CameraPipelineSettingsSchema.nullable()), method(object({
26360
28382
  deviceId: number(),
26361
28383
  addonId: string(),
@@ -26372,6 +28394,13 @@ method(object({
26372
28394
  }), object({ success: literal(true) }), {
26373
28395
  kind: "mutation",
26374
28396
  auth: "admin"
28397
+ }), method(object({
28398
+ deviceId: number(),
28399
+ addonId: string(),
28400
+ settings: record(string(), unknown()).nullable()
28401
+ }), object({ success: literal(true) }), {
28402
+ kind: "mutation",
28403
+ auth: "admin"
26375
28404
  }), method(object({
26376
28405
  deviceId: number(),
26377
28406
  agentNodeId: string(),
@@ -26395,25 +28424,7 @@ method(object({
26395
28424
  }), method(_void(), DiskReconcileJobSchema, {
26396
28425
  kind: "mutation",
26397
28426
  auth: "admin"
26398
- }), method(_void(), DiskReconcileJobSchema, { auth: "admin" }), method(_void(), array(PipelineTemplateSchema).readonly()), method(object({
26399
- name: string(),
26400
- description: string().optional(),
26401
- config: CameraPipelineConfigSchema
26402
- }), PipelineTemplateSchema, {
26403
- kind: "mutation",
26404
- auth: "admin"
26405
- }), method(object({
26406
- id: string(),
26407
- name: string().optional(),
26408
- description: string().optional(),
26409
- config: CameraPipelineConfigSchema.optional()
26410
- }), PipelineTemplateSchema, {
26411
- kind: "mutation",
26412
- auth: "admin"
26413
- }), method(object({ id: string() }), object({ success: literal(true) }), {
26414
- kind: "mutation",
26415
- auth: "admin"
26416
- });
28427
+ }), method(_void(), DiskReconcileJobSchema, { auth: "admin" });
26417
28428
  /**
26418
28429
  * Cap → event-kind mapping for the SENSOR / CONTROL cap families — the table
26419
28430
  * `pipeline-analytics.listEventKinds` uses to turn a linked device's bound
@@ -27003,7 +29014,19 @@ var SsoBridgeClaimsSchema = object({
27003
29014
  * editing a descriptor must not retroactively extend or shorten a link the
27004
29015
  * operator already consented to.
27005
29016
  */
27006
- refreshTtl: union([number().int().positive(), literal("never")]).optional()
29017
+ refreshTtl: union([number().int().positive(), literal("never")]).optional(),
29018
+ /**
29019
+ * Opaque handle of a hub-side LINK intent (D782). Set by an OIDC callback
29020
+ * that was started from a signed-in user's "Link" button: the finish then
29021
+ * links this identity to the intent's user instead of signing anyone in.
29022
+ * The handle carries no user id — the hub resolves it, single-use.
29023
+ */
29024
+ linkIntent: string().optional(),
29025
+ /**
29026
+ * Verified `iss` of the id_token behind an OIDC login bridge (D782). A
29027
+ * subject is unique only per issuer, so a link is bound to it.
29028
+ */
29029
+ issuer: string().optional()
27007
29030
  });
27008
29031
  method(object({
27009
29032
  claims: SsoBridgeClaimsSchema,
@@ -28662,8 +30685,6 @@ var WebrtcStreamChoiceSchema = object({
28662
30685
  ]).nullable(),
28663
30686
  /** Input FPS from the camera (null for adaptive). */
28664
30687
  inputFps: number().nullable(),
28665
- /** Decoded FPS (null for adaptive). */
28666
- decodeFps: number().nullable(),
28667
30688
  /** Bitrate in kbps (null for adaptive). */
28668
30689
  bitrateKbps: number().nullable()
28669
30690
  });
@@ -28940,7 +30961,22 @@ DeviceType.Camera, method(object({ deviceId: number().int().nonnegative() }), ar
28940
30961
  * field their hints were silently stripped by the schema and the
28941
30962
  * adaptive ladder started blind on the client's display size.
28942
30963
  */
28943
- hints: webrtcClientHintsSchema.optional()
30964
+ hints: webrtcClientHintsSchema.optional(),
30965
+ /**
30966
+ * Talk-back (D771): relay the PEER's audio to the device's speaker
30967
+ * through the `intercom` cap's push-talk triple. When `true` and the
30968
+ * offer lets the peer send audio, the answer's audio is `sendrecv`
30969
+ * and every inbound frame goes to `intercom.pushTalkAudio` for this
30970
+ * `deviceId`; absent/false answers `sendonly`, as for every viewer.
30971
+ *
30972
+ * TRUSTED-CALLER ONLY. Set by the Alexa export for an Echo on a camera
30973
+ * with `intercom`, when the linked user may control that camera. The
30974
+ * hub STRIPS it from every request-bound call (a browser), exactly as
30975
+ * it overwrites `relayOnly` — a viewer's talk permission is the
30976
+ * intercom cap's own surface (share tokens gate it there), and this
30977
+ * flag must not become a second door to the camera's speaker.
30978
+ */
30979
+ talkback: boolean().optional()
28944
30980
  }), object({
28945
30981
  sessionId: string(),
28946
30982
  sdpAnswer: string()
@@ -28995,6 +31031,14 @@ DeviceType.Camera, method(object({ deviceId: number().int().nonnegative() }), ar
28995
31031
  */
28996
31032
  alive: boolean()
28997
31033
  })), method(object({
31034
+ deviceId: number().int().nonnegative(),
31035
+ sessionId: string(),
31036
+ downlinkMbps: number().nonnegative()
31037
+ }), object({
31038
+ outcome: _enum(["switching", "held"]),
31039
+ tier: CamProfileSchema.nullable(),
31040
+ reason: string()
31041
+ }), { kind: "mutation" }), method(object({
28998
31042
  deviceId: number().int().nonnegative(),
28999
31043
  sessionId: string()
29000
31044
  }), WebrtcSessionDebugSchema, { kind: "query" });
@@ -29234,6 +31278,59 @@ var AddonAutoUpdateSchema = ChannelWithInheritSchema;
29234
31278
  var RestartAddonResultSchema = unknown();
29235
31279
  var InstallPackageResultSchema = unknown();
29236
31280
  var ReloadPackagesResultSchema = unknown();
31281
+ /**
31282
+ * What an uninstall did on ONE node.
31283
+ * - `uninstalled` — removed: runner(s) stopped, caps gone, code deleted.
31284
+ * - `not-installed` — the node did not have it (nothing to do).
31285
+ * - `refused` — protected / bootstrap package; nothing touched.
31286
+ * - `failed` — attempted and did not complete; `error` says why.
31287
+ * - `pending-reconnect` — the node is OFFLINE: its record was pruned so the
31288
+ * back-fill never returns the package, and the stale-addon sweep removes the
31289
+ * copy when the node registers again (only once the hub no longer has it).
31290
+ */
31291
+ var UninstallNodeOutcomeSchema = _enum([
31292
+ "uninstalled",
31293
+ "not-installed",
31294
+ "refused",
31295
+ "failed",
31296
+ "pending-reconnect"
31297
+ ]);
31298
+ var UninstallNodeResultSchema = object({
31299
+ nodeId: string(),
31300
+ outcome: UninstallNodeOutcomeSchema,
31301
+ error: string().optional(),
31302
+ addonIds: array(string()).readonly(),
31303
+ runnersStopped: array(string()).readonly(),
31304
+ warnings: array(string()).readonly()
31305
+ });
31306
+ var UninstallPackageResultSchema = object({
31307
+ /** Every targeted node ended `uninstalled`, `not-installed` or `pending-reconnect`. */
31308
+ success: boolean(),
31309
+ packageName: string(),
31310
+ results: array(UninstallNodeResultSchema).readonly()
31311
+ });
31312
+ /**
31313
+ * `unreachable` lists online agents whose status read FAILED — absence from
31314
+ * `installations` is only "not installed" for a node that answered (D315).
31315
+ */
31316
+ var PackageInstallationsSchema = object({
31317
+ installations: array(object({
31318
+ packageName: string(),
31319
+ nodeId: string(),
31320
+ nodeName: string(),
31321
+ isHub: boolean(),
31322
+ isOnline: boolean(),
31323
+ version: string().nullable(),
31324
+ addonIds: array(string()).readonly(),
31325
+ source: _enum(["live", "recorded"]),
31326
+ /** The hub installs this package too. `false` on an agent row = an orphan. */
31327
+ onHub: boolean()
31328
+ })).readonly(),
31329
+ unreachable: array(object({
31330
+ nodeId: string(),
31331
+ error: string()
31332
+ })).readonly()
31333
+ });
29237
31334
  var BulkUpdateItemStatusSchema = _enum([
29238
31335
  "queued",
29239
31336
  "updating",
@@ -29316,10 +31413,14 @@ method(_void(), array(AddonListItemSchema).readonly()), method(object({
29316
31413
  }), method(object({ packageName: string() }), InstallPackageResultSchema, {
29317
31414
  kind: "mutation",
29318
31415
  auth: "admin"
29319
- }), method(_void(), boolean()), method(_void(), array(unknown()).readonly()), method(object({ packageName: string() }), unknown(), {
31416
+ }), method(_void(), boolean()), method(_void(), array(unknown()).readonly()), method(object({
31417
+ packageName: string().min(1),
31418
+ nodeId: string().optional(),
31419
+ everywhere: boolean().optional()
31420
+ }), UninstallPackageResultSchema, {
29320
31421
  kind: "mutation",
29321
31422
  auth: "admin"
29322
- }), method(_void(), ReloadPackagesResultSchema, {
31423
+ }), method(object({ packageName: string().optional() }), PackageInstallationsSchema, { auth: "admin" }), method(_void(), ReloadPackagesResultSchema, {
29323
31424
  kind: "mutation",
29324
31425
  auth: "admin"
29325
31426
  }), method(object({ query: string().optional() }), array(SearchResultSchema)), method(object({ nodeId: string().optional() }), array(PackageUpdateSchema).readonly(), { auth: "admin" }), method(object({
@@ -32392,6 +34493,9 @@ var CreateIntegrationInputSchema = object({
32392
34493
  enabled: boolean().optional(),
32393
34494
  info: record(string(), unknown()).optional(),
32394
34495
  settings: record(string(), unknown()).optional(),
34496
+ /** Keys of `settings` the form's schema declares secret (by type) — kept in
34497
+ * the keychain, not the table (D787). */
34498
+ secretKeys: array(string()).optional(),
32395
34499
  skipRestart: boolean().optional()
32396
34500
  });
32397
34501
  var UpdateIntegrationInputSchema = object({
@@ -32415,7 +34519,9 @@ method(_void(), array(IntegrationWithStateSchema)), method(object({ id: string()
32415
34519
  auth: "admin"
32416
34520
  }), method(object({ id: string() }), record(string(), unknown()), { auth: "admin" }), method(object({
32417
34521
  id: string(),
32418
- settings: record(string(), unknown())
34522
+ settings: record(string(), unknown()),
34523
+ /** Keys the form's schema declares secret (by type) — keychain-stored (D787). */
34524
+ secretKeys: array(string()).optional()
32419
34525
  }), object({ success: boolean() }), {
32420
34526
  kind: "mutation",
32421
34527
  auth: "admin"
@@ -32814,7 +34920,8 @@ var ConnectionEndpointSchema = object({
32814
34920
  "lan-ipv6",
32815
34921
  "public",
32816
34922
  "loopback",
32817
- "app-link"
34923
+ "app-link",
34924
+ "custom"
32818
34925
  ]),
32819
34926
  /**
32820
34927
  * Originating-interface kind — `lan`/`wifi`/`docker`/`vpn`/`other`/
@@ -32883,7 +34990,7 @@ var GetConnectionEndpointsResultSchema = object({
32883
34990
  localPort: AdvertisedLocalPortSchema
32884
34991
  });
32885
34992
  /**
32886
- * The address flagged for notification links. `baseUrl: null` = AUTO, which
34993
+ * The address flagged for notification taps (`notificationTaps`). `baseUrl: null` = AUTO, which
32887
34994
  * since D709 is the CamStack app link; `resolved` reports the effective value,
32888
34995
  * so the UI can show it either way.
32889
34996
  */
@@ -32916,6 +35023,72 @@ var ViewerEndpointsSchema = object({
32916
35023
  /** What the ranking currently resolves to (may be empty if nothing is up). */
32917
35024
  resolved: array(string()).readonly()
32918
35025
  });
35026
+ /**
35027
+ * DEPRECATED compatibility shape of `getHubAddresses` (D729 amendment, kept
35028
+ * for addons built against it): `cluster` is the `internal` role, `browser`
35029
+ * the `publicEndpoint` role; `override` is the flagged address.
35030
+ */
35031
+ var HubAddressSnapshotSchema = object({
35032
+ override: string().nullable(),
35033
+ resolved: string().nullable(),
35034
+ source: _enum([
35035
+ "override",
35036
+ "auto",
35037
+ "none"
35038
+ ])
35039
+ });
35040
+ var HubAddressesSchema = object({
35041
+ cluster: HubAddressSnapshotSchema,
35042
+ browser: HubAddressSnapshotSchema
35043
+ });
35044
+ /**
35045
+ * What an address is used for (`hub-address.ts`, D734). `appConnections` is
35046
+ * many-valued; `notificationTaps`, `publicEndpoint` and `internal` are carried
35047
+ * by at most one address.
35048
+ */
35049
+ var HubAddressRoleSchema = _enum(HUB_ADDRESS_ROLES);
35050
+ var RoleSourceSchema = _enum([
35051
+ "flagged",
35052
+ "auto",
35053
+ "none"
35054
+ ]);
35055
+ /** One single-valued role: the flagged address, the one in use, and why. */
35056
+ var HubAddressRoleResolutionSchema = object({
35057
+ /** The address carrying the flag, or null = automatic. */
35058
+ flagged: string().nullable(),
35059
+ /** The address in use, or null when nothing qualifies (never loopback). */
35060
+ resolved: string().nullable(),
35061
+ source: RoleSourceSchema
35062
+ });
35063
+ var HubAppConnectionsResolutionSchema = object({
35064
+ /** The addresses flagged `appConnections`, or empty = automatic. */
35065
+ flagged: array(string()).readonly(),
35066
+ /** What the apps race right now. */
35067
+ resolved: array(string()).readonly(),
35068
+ source: RoleSourceSchema
35069
+ });
35070
+ var HubAddressBookSchema = object({
35071
+ rows: array(ConnectionEndpointSchema.extend({
35072
+ /** In the hub's detected palette right now. */
35073
+ detected: boolean(),
35074
+ /** Entered by the operator (removable). */
35075
+ custom: boolean(),
35076
+ /** The roles explicitly flagged on this address. */
35077
+ flags: array(HubAddressRoleSchema).readonly(),
35078
+ /** The roles this address serves right now — flagged or automatic. */
35079
+ inUse: array(HubAddressRoleSchema).readonly(),
35080
+ /** The roles this address may be flagged with. */
35081
+ eligible: array(HubAddressRoleSchema).readonly()
35082
+ })).readonly(),
35083
+ roles: object({
35084
+ appConnections: HubAppConnectionsResolutionSchema,
35085
+ notificationTaps: HubAddressRoleResolutionSchema,
35086
+ internal: HubAddressRoleResolutionSchema,
35087
+ publicEndpoint: HubAddressRoleResolutionSchema
35088
+ }),
35089
+ /** The `hub=` an app link carries (D709), or null. */
35090
+ appLinkHub: string().nullable()
35091
+ });
32919
35092
  var AllowedAddressesSchema = object({
32920
35093
  /**
32921
35094
  * Allowlist of interface addresses operators have explicitly opted
@@ -32959,10 +35132,27 @@ method(_void(), ListResultSchema), method(_void(), PreferredSchema), method(obje
32959
35132
  * tunnel always emits `https://` regardless. */
32960
35133
  scheme: _enum(["http", "https"]).optional(),
32961
35134
  /** Append the CamStack app link entry (`kind: 'app-link'`, D709) —
32962
- * an address notification links can be flagged with, not a hub
35135
+ * an address notification taps can be flagged with, not a hub
32963
35136
  * route. Default `false`: racers and rankers never see it. */
32964
35137
  includeAppLink: boolean().optional()
32965
- }), 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, {
35138
+ }), 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({
35139
+ baseUrl: string(),
35140
+ label: string().max(80)
35141
+ }), HubAddressBookSchema, {
35142
+ kind: "mutation",
35143
+ auth: "admin"
35144
+ }), method(object({ baseUrl: string() }), HubAddressBookSchema, {
35145
+ kind: "mutation",
35146
+ auth: "admin"
35147
+ }), method(object({
35148
+ role: HubAddressRoleSchema,
35149
+ baseUrl: string().nullable(),
35150
+ enabled: boolean(),
35151
+ acceptInsecureHttp: boolean().optional()
35152
+ }), HubAddressBookSchema, {
35153
+ kind: "mutation",
35154
+ auth: "admin"
35155
+ }), 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, {
32966
35156
  kind: "mutation",
32967
35157
  auth: "admin"
32968
35158
  }), method(object({
@@ -33420,7 +35610,8 @@ var MotionStatusSchema = object({
33420
35610
  * writes this slice (not even a boot seed), and neither does the runner's
33421
35611
  * phase machine: its phase is "a session is attached" for every on-motion
33422
35612
  * session, not motion, and it now has its own `DetectionPhaseTransition`.
33423
- * A provider's `isDetected` answers from the hub's slice.
35613
+ * A provider's `isDetected` and `getStatus` answer from the hub's slice
35614
+ * (`hubMotionNativeProvider`).
33424
35615
  * - **Sensors** (Home Assistant binary sensors, Homematic, Matter, Alexa
33425
35616
  * imports) — the provider pushes both edges itself, from the upstream
33426
35617
  * system's own state change. That is the sensor's own fact.
@@ -39152,6 +41343,32 @@ var TotpStatusSchema = object({
39152
41343
  /** Null when no row exists OR the row is still pending confirmation. */
39153
41344
  confirmedAt: number().nullable()
39154
41345
  });
41346
+ /**
41347
+ * user-management — singleton capability for user accounts, API keys,
41348
+ * and scoped tokens.
41349
+ *
41350
+ * v2 model: every method gated by `auth: 'admin'`. Admin-only delegation
41351
+ * — the subset check on `setUserScopes` / `createScopedToken` is moot
41352
+ * because non-admins never reach these. If/when we open non-admin
41353
+ * delegation, structural caller-scope subset check goes inside the
41354
+ * provider.
41355
+ */
41356
+ var ExternalIdentitySchema = object({
41357
+ /** Login-method id of the provider instance, e.g. `auth-oidc/authentik`. */
41358
+ provider: string(),
41359
+ /** The IdP's stable subject (`sub`) for this account. */
41360
+ subject: string(),
41361
+ /** The verified `iss` of the IdP the identity was linked under — `sub` is unique only per issuer. */
41362
+ issuer: string(),
41363
+ userId: string(),
41364
+ /** What the IdP called the account at link time (username / email) — display only. */
41365
+ label: string().optional(),
41366
+ linkedAt: number()
41367
+ });
41368
+ var ExternalIdentityKeySchema = object({
41369
+ provider: string().min(1),
41370
+ subject: string().min(1)
41371
+ });
39155
41372
  method(_void(), array(UserSummarySchema), { auth: "admin" }), method(CreateUserInputSchema, UserSummarySchema, {
39156
41373
  kind: "mutation",
39157
41374
  auth: "admin",
@@ -39265,7 +41482,22 @@ method(_void(), array(UserSummarySchema), { auth: "admin" }), method(CreateUserI
39265
41482
  userId: string(),
39266
41483
  username: string(),
39267
41484
  scopes: array(TokenScopeSchema)
39268
- }).nullable(), { access: "view" }), method(_void(), array(OauthSessionSummarySchema), { auth: "admin" }), method(object({ id: string() }), object({ success: boolean() }), {
41485
+ }).nullable(), { access: "view" }), method(object({ userId: string() }), array(ExternalIdentitySchema), { auth: "admin" }), method(ExternalIdentityKeySchema, object({
41486
+ userId: string(),
41487
+ issuer: string()
41488
+ }).nullable(), { auth: "admin" }), method(ExternalIdentityKeySchema.extend({
41489
+ userId: string(),
41490
+ issuer: string().min(1),
41491
+ label: string().optional()
41492
+ }), object({ success: literal(true) }), {
41493
+ kind: "mutation",
41494
+ auth: "admin",
41495
+ access: "create"
41496
+ }), method(ExternalIdentityKeySchema.extend({ userId: string() }), object({ success: boolean() }), {
41497
+ kind: "mutation",
41498
+ auth: "admin",
41499
+ access: "delete"
41500
+ }), method(_void(), array(OauthSessionSummarySchema), { auth: "admin" }), method(object({ id: string() }), object({ success: boolean() }), {
39269
41501
  kind: "mutation",
39270
41502
  auth: "admin",
39271
41503
  access: "delete"
@@ -39967,6 +42199,16 @@ var zoneRulesCapability = {
39967
42199
  durability: "restored"
39968
42200
  };
39969
42201
  SOURCE_CAPS.filter((cap) => cap !== "switch" && cap !== "motion");
42202
+ Object.freeze({
42203
+ person: .5,
42204
+ vehicle: .5,
42205
+ animal: .5
42206
+ });
42207
+ Object.freeze({
42208
+ person: .65,
42209
+ vehicle: .65,
42210
+ animal: .65
42211
+ });
39970
42212
  /**
39971
42213
  * Accessory device helpers — shared across drivers.
39972
42214
  *
@@ -40442,7 +42684,8 @@ var BaseDevice = class {
40442
42684
  this.role = options.role;
40443
42685
  this.parentDeviceId = ctx.parentDeviceId;
40444
42686
  const seedData = ctx.persistedConfig ?? {};
40445
- this.config = DeviceConfig.fromSchema(schema, (data) => ctx.persistConfig(data), seedData, ({ droppedKeys, issues }) => {
42687
+ const declaredSecretPaths = collectZodSecretPaths(schema);
42688
+ this.config = DeviceConfig.fromSchema(schema, (data) => ctx.persistConfig(data, { secretConfigPaths: declaredSecretPaths }), seedData, ({ droppedKeys, issues }) => {
40446
42689
  ctx.logger.warn("Device config recovery: dropping invalid persisted fields", {
40447
42690
  tags: {
40448
42691
  deviceId: ctx.id,
@@ -41665,6 +43908,12 @@ Object.freeze({
41665
43908
  addonId: null,
41666
43909
  access: "view"
41667
43910
  },
43911
+ "addons.listInstallations": {
43912
+ capName: "addons",
43913
+ capScope: "system",
43914
+ addonId: null,
43915
+ access: "view"
43916
+ },
41668
43917
  "addons.listJobs": {
41669
43918
  capName: "addons",
41670
43919
  capScope: "system",
@@ -42847,90 +45096,18 @@ Object.freeze({
42847
45096
  addonId: null,
42848
45097
  access: "create"
42849
45098
  },
42850
- "decoder.createSession": {
42851
- capName: "decoder",
42852
- capScope: "system",
42853
- addonId: null,
42854
- access: "view"
42855
- },
42856
- "decoder.destroySession": {
42857
- capName: "decoder",
42858
- capScope: "system",
42859
- addonId: null,
42860
- access: "delete"
42861
- },
42862
- "decoder.getFrame": {
42863
- capName: "decoder",
42864
- capScope: "system",
42865
- addonId: null,
42866
- access: "view"
42867
- },
42868
45099
  "decoder.getInfo": {
42869
45100
  capName: "decoder",
42870
45101
  capScope: "system",
42871
45102
  addonId: null,
42872
45103
  access: "view"
42873
45104
  },
42874
- "decoder.getShmStats": {
42875
- capName: "decoder",
42876
- capScope: "system",
42877
- addonId: null,
42878
- access: "view"
42879
- },
42880
- "decoder.getStats": {
42881
- capName: "decoder",
42882
- capScope: "system",
42883
- addonId: null,
42884
- access: "view"
42885
- },
42886
- "decoder.listActiveSessions": {
42887
- capName: "decoder",
42888
- capScope: "system",
42889
- addonId: null,
42890
- access: "view"
42891
- },
42892
- "decoder.openStream": {
42893
- capName: "decoder",
42894
- capScope: "system",
42895
- addonId: null,
42896
- access: "view"
42897
- },
42898
- "decoder.pullFrames": {
42899
- capName: "decoder",
42900
- capScope: "system",
42901
- addonId: null,
42902
- access: "view"
42903
- },
42904
- "decoder.pullHandles": {
42905
- capName: "decoder",
42906
- capScope: "system",
42907
- addonId: null,
42908
- access: "view"
42909
- },
42910
- "decoder.pushPacket": {
42911
- capName: "decoder",
42912
- capScope: "system",
42913
- addonId: null,
42914
- access: "view"
42915
- },
42916
45105
  "decoder.reprobeHwaccel": {
42917
45106
  capName: "decoder",
42918
45107
  capScope: "system",
42919
45108
  addonId: null,
42920
45109
  access: "create"
42921
45110
  },
42922
- "decoder.supportsCodec": {
42923
- capName: "decoder",
42924
- capScope: "system",
42925
- addonId: null,
42926
- access: "view"
42927
- },
42928
- "decoder.updateConfig": {
42929
- capName: "decoder",
42930
- capScope: "system",
42931
- addonId: null,
42932
- access: "view"
42933
- },
42934
45111
  "detectionPipeline.applyDeviceSettingsPatch": {
42935
45112
  capName: "detection-pipeline",
42936
45113
  capScope: "device",
@@ -44197,6 +46374,90 @@ Object.freeze({
44197
46374
  addonId: null,
44198
46375
  access: "create"
44199
46376
  },
46377
+ "keychain.delete": {
46378
+ capName: "keychain",
46379
+ capScope: "system",
46380
+ addonId: null,
46381
+ access: "delete"
46382
+ },
46383
+ "keychain.getState": {
46384
+ capName: "keychain",
46385
+ capScope: "system",
46386
+ addonId: null,
46387
+ access: "view"
46388
+ },
46389
+ "keychain.listMeta": {
46390
+ capName: "keychain",
46391
+ capScope: "system",
46392
+ addonId: null,
46393
+ access: "view"
46394
+ },
46395
+ "keychain.put": {
46396
+ capName: "keychain",
46397
+ capScope: "system",
46398
+ addonId: null,
46399
+ access: "create"
46400
+ },
46401
+ "keychain.resolve": {
46402
+ capName: "keychain",
46403
+ capScope: "system",
46404
+ addonId: null,
46405
+ access: "view"
46406
+ },
46407
+ "keychainAdmin.deleteOrphans": {
46408
+ capName: "keychain-admin",
46409
+ capScope: "system",
46410
+ addonId: null,
46411
+ access: "delete"
46412
+ },
46413
+ "keychainAdmin.downloadRecoveryKey": {
46414
+ capName: "keychain-admin",
46415
+ capScope: "system",
46416
+ addonId: null,
46417
+ access: "create"
46418
+ },
46419
+ "keychainAdmin.listAudit": {
46420
+ capName: "keychain-admin",
46421
+ capScope: "system",
46422
+ addonId: null,
46423
+ access: "view"
46424
+ },
46425
+ "keychainAdmin.listSecrets": {
46426
+ capName: "keychain-admin",
46427
+ capScope: "system",
46428
+ addonId: null,
46429
+ access: "view"
46430
+ },
46431
+ "keychainAdmin.purgeRetiredKeys": {
46432
+ capName: "keychain-admin",
46433
+ capScope: "system",
46434
+ addonId: null,
46435
+ access: "delete"
46436
+ },
46437
+ "keychainAdmin.resetKeychain": {
46438
+ capName: "keychain-admin",
46439
+ capScope: "system",
46440
+ addonId: null,
46441
+ access: "delete"
46442
+ },
46443
+ "keychainAdmin.reveal": {
46444
+ capName: "keychain-admin",
46445
+ capScope: "system",
46446
+ addonId: null,
46447
+ access: "create"
46448
+ },
46449
+ "keychainAdmin.rotateMasterKey": {
46450
+ capName: "keychain-admin",
46451
+ capScope: "system",
46452
+ addonId: null,
46453
+ access: "create"
46454
+ },
46455
+ "keychainAdmin.status": {
46456
+ capName: "keychain-admin",
46457
+ capScope: "system",
46458
+ addonId: null,
46459
+ access: "view"
46460
+ },
44200
46461
  "lawnMowerControl.dock": {
44201
46462
  capName: "lawn-mower-control",
44202
46463
  capScope: "device",
@@ -44419,12 +46680,24 @@ Object.freeze({
44419
46680
  addonId: null,
44420
46681
  access: "view"
44421
46682
  },
46683
+ "localNetwork.addCustomAddress": {
46684
+ capName: "local-network",
46685
+ capScope: "system",
46686
+ addonId: null,
46687
+ access: "create"
46688
+ },
44422
46689
  "localNetwork.downloadCa": {
44423
46690
  capName: "local-network",
44424
46691
  capScope: "system",
44425
46692
  addonId: null,
44426
46693
  access: "view"
44427
46694
  },
46695
+ "localNetwork.getAddresses": {
46696
+ capName: "local-network",
46697
+ capScope: "system",
46698
+ addonId: null,
46699
+ access: "view"
46700
+ },
44428
46701
  "localNetwork.getAllowedAddresses": {
44429
46702
  capName: "local-network",
44430
46703
  capScope: "system",
@@ -44437,6 +46710,12 @@ Object.freeze({
44437
46710
  addonId: null,
44438
46711
  access: "view"
44439
46712
  },
46713
+ "localNetwork.getHubAddresses": {
46714
+ capName: "local-network",
46715
+ capScope: "system",
46716
+ addonId: null,
46717
+ access: "view"
46718
+ },
44440
46719
  "localNetwork.getNotificationEndpoint": {
44441
46720
  capName: "local-network",
44442
46721
  capScope: "system",
@@ -44473,6 +46752,12 @@ Object.freeze({
44473
46752
  addonId: null,
44474
46753
  access: "create"
44475
46754
  },
46755
+ "localNetwork.removeCustomAddress": {
46756
+ capName: "local-network",
46757
+ capScope: "system",
46758
+ addonId: null,
46759
+ access: "delete"
46760
+ },
44476
46761
  "localNetwork.resetAllowlistToBestMatch": {
44477
46762
  capName: "local-network",
44478
46763
  capScope: "system",
@@ -44485,6 +46770,12 @@ Object.freeze({
44485
46770
  addonId: null,
44486
46771
  access: "create"
44487
46772
  },
46773
+ "localNetwork.setAddressRole": {
46774
+ capName: "local-network",
46775
+ capScope: "system",
46776
+ addonId: null,
46777
+ access: "create"
46778
+ },
44488
46779
  "localNetwork.setAllowedAddresses": {
44489
46780
  capName: "local-network",
44490
46781
  capScope: "system",
@@ -45541,6 +47832,18 @@ Object.freeze({
45541
47832
  addonId: null,
45542
47833
  access: "create"
45543
47834
  },
47835
+ "pipelineAnalytics.addRetrainFrameFromRecording": {
47836
+ capName: "pipeline-analytics",
47837
+ capScope: "device",
47838
+ addonId: null,
47839
+ access: "create"
47840
+ },
47841
+ "pipelineAnalytics.addRetrainFramesToCollection": {
47842
+ capName: "pipeline-analytics",
47843
+ capScope: "device",
47844
+ addonId: null,
47845
+ access: "create"
47846
+ },
45544
47847
  "pipelineAnalytics.applyDeviceSettingsPatch": {
45545
47848
  capName: "pipeline-analytics",
45546
47849
  capScope: "device",
@@ -45589,12 +47892,24 @@ Object.freeze({
45589
47892
  addonId: null,
45590
47893
  access: "view"
45591
47894
  },
47895
+ "pipelineAnalytics.createRetrainCollection": {
47896
+ capName: "pipeline-analytics",
47897
+ capScope: "device",
47898
+ addonId: null,
47899
+ access: "create"
47900
+ },
45592
47901
  "pipelineAnalytics.deleteDeviceEvents": {
45593
47902
  capName: "pipeline-analytics",
45594
47903
  capScope: "device",
45595
47904
  addonId: null,
45596
47905
  access: "delete"
45597
47906
  },
47907
+ "pipelineAnalytics.deleteRetrainCollection": {
47908
+ capName: "pipeline-analytics",
47909
+ capScope: "device",
47910
+ addonId: null,
47911
+ access: "delete"
47912
+ },
45598
47913
  "pipelineAnalytics.deleteTracks": {
45599
47914
  capName: "pipeline-analytics",
45600
47915
  capScope: "device",
@@ -45799,6 +48114,24 @@ Object.freeze({
45799
48114
  addonId: null,
45800
48115
  access: "view"
45801
48116
  },
48117
+ "pipelineAnalytics.listRetrainAssistProfiles": {
48118
+ capName: "pipeline-analytics",
48119
+ capScope: "device",
48120
+ addonId: null,
48121
+ access: "view"
48122
+ },
48123
+ "pipelineAnalytics.listRetrainCollectionFrames": {
48124
+ capName: "pipeline-analytics",
48125
+ capScope: "device",
48126
+ addonId: null,
48127
+ access: "view"
48128
+ },
48129
+ "pipelineAnalytics.listRetrainCollections": {
48130
+ capName: "pipeline-analytics",
48131
+ capScope: "device",
48132
+ addonId: null,
48133
+ access: "view"
48134
+ },
45802
48135
  "pipelineAnalytics.listRetrainFrames": {
45803
48136
  capName: "pipeline-analytics",
45804
48137
  capScope: "device",
@@ -45847,6 +48180,12 @@ Object.freeze({
45847
48180
  addonId: null,
45848
48181
  access: "create"
45849
48182
  },
48183
+ "pipelineAnalytics.proposeRetrainAnnotationsWithLlm": {
48184
+ capName: "pipeline-analytics",
48185
+ capScope: "device",
48186
+ addonId: null,
48187
+ access: "create"
48188
+ },
45850
48189
  "pipelineAnalytics.pruneEvents": {
45851
48190
  capName: "pipeline-analytics",
45852
48191
  capScope: "device",
@@ -45901,6 +48240,18 @@ Object.freeze({
45901
48240
  addonId: null,
45902
48241
  access: "create"
45903
48242
  },
48243
+ "pipelineAnalytics.removeRetrainFrameFromCollection": {
48244
+ capName: "pipeline-analytics",
48245
+ capScope: "device",
48246
+ addonId: null,
48247
+ access: "delete"
48248
+ },
48249
+ "pipelineAnalytics.renameRetrainCollection": {
48250
+ capName: "pipeline-analytics",
48251
+ capScope: "device",
48252
+ addonId: null,
48253
+ access: "create"
48254
+ },
45904
48255
  "pipelineAnalytics.restageRetrainTrack": {
45905
48256
  capName: "pipeline-analytics",
45906
48257
  capScope: "device",
@@ -45931,6 +48282,12 @@ Object.freeze({
45931
48282
  addonId: null,
45932
48283
  access: "create"
45933
48284
  },
48285
+ "pipelineAnalytics.setRetrainFrameComplete": {
48286
+ capName: "pipeline-analytics",
48287
+ capScope: "device",
48288
+ addonId: null,
48289
+ access: "create"
48290
+ },
45934
48291
  "pipelineAnalytics.setTrackFlags": {
45935
48292
  capName: "pipeline-analytics",
45936
48293
  capScope: "device",
@@ -45967,6 +48324,12 @@ Object.freeze({
45967
48324
  addonId: null,
45968
48325
  access: "delete"
45969
48326
  },
48327
+ "pipelineAnalytics.writeRetrainArchive": {
48328
+ capName: "pipeline-analytics",
48329
+ capScope: "device",
48330
+ addonId: null,
48331
+ access: "create"
48332
+ },
45970
48333
  "pipelineExecutor.cacheFrameInPool": {
45971
48334
  capName: "pipeline-executor",
45972
48335
  capScope: "system",
@@ -45979,13 +48342,13 @@ Object.freeze({
45979
48342
  addonId: null,
45980
48343
  access: "delete"
45981
48344
  },
45982
- "pipelineExecutor.deleteModel": {
48345
+ "pipelineExecutor.clearModelBoundDeviceOverrides": {
45983
48346
  capName: "pipeline-executor",
45984
48347
  capScope: "system",
45985
48348
  addonId: null,
45986
48349
  access: "delete"
45987
48350
  },
45988
- "pipelineExecutor.deleteTemplate": {
48351
+ "pipelineExecutor.deleteModel": {
45989
48352
  capName: "pipeline-executor",
45990
48353
  capScope: "system",
45991
48354
  addonId: null,
@@ -46129,12 +48492,6 @@ Object.freeze({
46129
48492
  addonId: null,
46130
48493
  access: "view"
46131
48494
  },
46132
- "pipelineExecutor.listTemplates": {
46133
- capName: "pipeline-executor",
46134
- capScope: "system",
46135
- addonId: null,
46136
- access: "view"
46137
- },
46138
48495
  "pipelineExecutor.rearmInferenceDevice": {
46139
48496
  capName: "pipeline-executor",
46140
48497
  capScope: "system",
@@ -46159,12 +48516,6 @@ Object.freeze({
46159
48516
  addonId: null,
46160
48517
  access: "create"
46161
48518
  },
46162
- "pipelineExecutor.saveTemplate": {
46163
- capName: "pipeline-executor",
46164
- capScope: "system",
46165
- addonId: null,
46166
- access: "create"
46167
- },
46168
48519
  "pipelineExecutor.setVideoPipelineSteps": {
46169
48520
  capName: "pipeline-executor",
46170
48521
  capScope: "system",
@@ -46183,17 +48534,23 @@ Object.freeze({
46183
48534
  addonId: null,
46184
48535
  access: "create"
46185
48536
  },
46186
- "pipelineExecutor.updateTemplate": {
48537
+ "pipelineExecutor.validatePipeline": {
46187
48538
  capName: "pipeline-executor",
46188
48539
  capScope: "system",
46189
48540
  addonId: null,
48541
+ access: "view"
48542
+ },
48543
+ "pipelineOrchestrator.abortNodeBenchmark": {
48544
+ capName: "pipeline-orchestrator",
48545
+ capScope: "system",
48546
+ addonId: null,
46190
48547
  access: "create"
46191
48548
  },
46192
- "pipelineExecutor.validatePipeline": {
46193
- capName: "pipeline-executor",
48549
+ "pipelineOrchestrator.applyAutoTune": {
48550
+ capName: "pipeline-orchestrator",
46194
48551
  capScope: "system",
46195
48552
  addonId: null,
46196
- access: "view"
48553
+ access: "create"
46197
48554
  },
46198
48555
  "pipelineOrchestrator.applyDeviceSettingsPatch": {
46199
48556
  capName: "pipeline-orchestrator",
@@ -46213,7 +48570,7 @@ Object.freeze({
46213
48570
  addonId: null,
46214
48571
  access: "create"
46215
48572
  },
46216
- "pipelineOrchestrator.deleteTemplate": {
48573
+ "pipelineOrchestrator.deleteNodeBenchmarkResult": {
46217
48574
  capName: "pipeline-orchestrator",
46218
48575
  capScope: "system",
46219
48576
  addonId: null,
@@ -46309,6 +48666,12 @@ Object.freeze({
46309
48666
  addonId: null,
46310
48667
  access: "view"
46311
48668
  },
48669
+ "pipelineOrchestrator.getEffectiveShares": {
48670
+ capName: "pipeline-orchestrator",
48671
+ capScope: "system",
48672
+ addonId: null,
48673
+ access: "view"
48674
+ },
46312
48675
  "pipelineOrchestrator.getGlobalMetrics": {
46313
48676
  capName: "pipeline-orchestrator",
46314
48677
  capScope: "system",
@@ -46321,6 +48684,24 @@ Object.freeze({
46321
48684
  addonId: null,
46322
48685
  access: "view"
46323
48686
  },
48687
+ "pipelineOrchestrator.getNodeBenchmarkCandidates": {
48688
+ capName: "pipeline-orchestrator",
48689
+ capScope: "system",
48690
+ addonId: null,
48691
+ access: "view"
48692
+ },
48693
+ "pipelineOrchestrator.getNodeBenchmarkPreflight": {
48694
+ capName: "pipeline-orchestrator",
48695
+ capScope: "system",
48696
+ addonId: null,
48697
+ access: "view"
48698
+ },
48699
+ "pipelineOrchestrator.getNodeBenchmarkStatus": {
48700
+ capName: "pipeline-orchestrator",
48701
+ capScope: "system",
48702
+ addonId: null,
48703
+ access: "view"
48704
+ },
46324
48705
  "pipelineOrchestrator.getNodeInferenceDevices": {
46325
48706
  capName: "pipeline-orchestrator",
46326
48707
  capScope: "system",
@@ -46345,6 +48726,12 @@ Object.freeze({
46345
48726
  addonId: null,
46346
48727
  access: "view"
46347
48728
  },
48729
+ "pipelineOrchestrator.getPlacementStats": {
48730
+ capName: "pipeline-orchestrator",
48731
+ capScope: "system",
48732
+ addonId: null,
48733
+ access: "view"
48734
+ },
46348
48735
  "pipelineOrchestrator.getReconcileFromDiskStatus": {
46349
48736
  capName: "pipeline-orchestrator",
46350
48737
  capScope: "system",
@@ -46357,7 +48744,7 @@ Object.freeze({
46357
48744
  addonId: null,
46358
48745
  access: "view"
46359
48746
  },
46360
- "pipelineOrchestrator.listTemplates": {
48747
+ "pipelineOrchestrator.listNodeBenchmarkResults": {
46361
48748
  capName: "pipeline-orchestrator",
46362
48749
  capScope: "system",
46363
48750
  addonId: null,
@@ -46369,6 +48756,12 @@ Object.freeze({
46369
48756
  addonId: null,
46370
48757
  access: "create"
46371
48758
  },
48759
+ "pipelineOrchestrator.planAutoTune": {
48760
+ capName: "pipeline-orchestrator",
48761
+ capScope: "system",
48762
+ addonId: null,
48763
+ access: "view"
48764
+ },
46372
48765
  "pipelineOrchestrator.rebalance": {
46373
48766
  capName: "pipeline-orchestrator",
46374
48767
  capScope: "system",
@@ -46411,12 +48804,6 @@ Object.freeze({
46411
48804
  addonId: null,
46412
48805
  access: "create"
46413
48806
  },
46414
- "pipelineOrchestrator.saveTemplate": {
46415
- capName: "pipeline-orchestrator",
46416
- capScope: "system",
46417
- addonId: null,
46418
- access: "create"
46419
- },
46420
48807
  "pipelineOrchestrator.setAgentCapabilities": {
46421
48808
  capName: "pipeline-orchestrator",
46422
48809
  capScope: "system",
@@ -46429,12 +48816,6 @@ Object.freeze({
46429
48816
  addonId: null,
46430
48817
  access: "create"
46431
48818
  },
46432
- "pipelineOrchestrator.setAgentDetectWeight": {
46433
- capName: "pipeline-orchestrator",
46434
- capScope: "system",
46435
- addonId: null,
46436
- access: "create"
46437
- },
46438
48819
  "pipelineOrchestrator.setAgentInferenceDevices": {
46439
48820
  capName: "pipeline-orchestrator",
46440
48821
  capScope: "system",
@@ -46471,6 +48852,12 @@ Object.freeze({
46471
48852
  addonId: null,
46472
48853
  access: "create"
46473
48854
  },
48855
+ "pipelineOrchestrator.setCameraStepSettings": {
48856
+ capName: "pipeline-orchestrator",
48857
+ capScope: "system",
48858
+ addonId: null,
48859
+ access: "create"
48860
+ },
46474
48861
  "pipelineOrchestrator.setCameraStepToggle": {
46475
48862
  capName: "pipeline-orchestrator",
46476
48863
  capScope: "system",
@@ -46489,12 +48876,36 @@ Object.freeze({
46489
48876
  addonId: null,
46490
48877
  access: "create"
46491
48878
  },
48879
+ "pipelineOrchestrator.setLoadBalancingShares": {
48880
+ capName: "pipeline-orchestrator",
48881
+ capScope: "system",
48882
+ addonId: null,
48883
+ access: "create"
48884
+ },
46492
48885
  "pipelineOrchestrator.setPipelineDevicePin": {
46493
48886
  capName: "pipeline-orchestrator",
46494
48887
  capScope: "system",
46495
48888
  addonId: null,
46496
48889
  access: "create"
46497
48890
  },
48891
+ "pipelineOrchestrator.setShareSource": {
48892
+ capName: "pipeline-orchestrator",
48893
+ capScope: "system",
48894
+ addonId: null,
48895
+ access: "create"
48896
+ },
48897
+ "pipelineOrchestrator.startNodeBenchmark": {
48898
+ capName: "pipeline-orchestrator",
48899
+ capScope: "system",
48900
+ addonId: null,
48901
+ access: "create"
48902
+ },
48903
+ "pipelineOrchestrator.suggestShares": {
48904
+ capName: "pipeline-orchestrator",
48905
+ capScope: "system",
48906
+ addonId: null,
48907
+ access: "view"
48908
+ },
46498
48909
  "pipelineOrchestrator.unassignAudio": {
46499
48910
  capName: "pipeline-orchestrator",
46500
48911
  capScope: "system",
@@ -46507,8 +48918,8 @@ Object.freeze({
46507
48918
  addonId: null,
46508
48919
  access: "create"
46509
48920
  },
46510
- "pipelineOrchestrator.updateTemplate": {
46511
- capName: "pipeline-orchestrator",
48921
+ "pipelineRunner.abortNodeBench": {
48922
+ capName: "pipeline-runner",
46512
48923
  capScope: "system",
46513
48924
  addonId: null,
46514
48925
  access: "create"
@@ -46561,6 +48972,12 @@ Object.freeze({
46561
48972
  addonId: null,
46562
48973
  access: "view"
46563
48974
  },
48975
+ "pipelineRunner.getNodeBenchStatus": {
48976
+ capName: "pipeline-runner",
48977
+ capScope: "system",
48978
+ addonId: null,
48979
+ access: "view"
48980
+ },
46564
48981
  "pipelineRunner.getParkedTrackFrame": {
46565
48982
  capName: "pipeline-runner",
46566
48983
  capScope: "system",
@@ -46603,6 +49020,12 @@ Object.freeze({
46603
49020
  addonId: null,
46604
49021
  access: "create"
46605
49022
  },
49023
+ "pipelineRunner.startNodeBench": {
49024
+ capName: "pipeline-runner",
49025
+ capScope: "system",
49026
+ addonId: null,
49027
+ access: "create"
49028
+ },
46606
49029
  "plateGallery.assignPlate": {
46607
49030
  capName: "plate-gallery",
46608
49031
  capScope: "system",
@@ -47947,12 +50370,6 @@ Object.freeze({
47947
50370
  addonId: null,
47948
50371
  access: "view"
47949
50372
  },
47950
- "streamBroker.pullFrameHandles": {
47951
- capName: "stream-broker",
47952
- capScope: "system",
47953
- addonId: null,
47954
- access: "view"
47955
- },
47956
50373
  "streamBroker.regenerateRtspToken": {
47957
50374
  capName: "stream-broker",
47958
50375
  capScope: "system",
@@ -48019,12 +50436,6 @@ Object.freeze({
48019
50436
  addonId: null,
48020
50437
  access: "create"
48021
50438
  },
48022
- "streamBroker.subscribeFrames": {
48023
- capName: "stream-broker",
48024
- capScope: "system",
48025
- addonId: null,
48026
- access: "create"
48027
- },
48028
50439
  "streamBroker.unassignProfile": {
48029
50440
  capName: "stream-broker",
48030
50441
  capScope: "system",
@@ -48037,12 +50448,6 @@ Object.freeze({
48037
50448
  addonId: null,
48038
50449
  access: "create"
48039
50450
  },
48040
- "streamBroker.unsubscribeFrames": {
48041
- capName: "stream-broker",
48042
- capScope: "system",
48043
- addonId: null,
48044
- access: "create"
48045
- },
48046
50451
  "streamCatalog.getCatalog": {
48047
50452
  capName: "stream-catalog",
48048
50453
  capScope: "device",
@@ -48337,18 +50742,36 @@ Object.freeze({
48337
50742
  addonId: null,
48338
50743
  access: "delete"
48339
50744
  },
50745
+ "userManagement.findUserByExternalIdentity": {
50746
+ capName: "user-management",
50747
+ capScope: "system",
50748
+ addonId: null,
50749
+ access: "view"
50750
+ },
48340
50751
  "userManagement.getTotpStatus": {
48341
50752
  capName: "user-management",
48342
50753
  capScope: "system",
48343
50754
  addonId: null,
48344
50755
  access: "view"
48345
50756
  },
50757
+ "userManagement.linkExternalIdentity": {
50758
+ capName: "user-management",
50759
+ capScope: "system",
50760
+ addonId: null,
50761
+ access: "create"
50762
+ },
48346
50763
  "userManagement.listApiKeys": {
48347
50764
  capName: "user-management",
48348
50765
  capScope: "system",
48349
50766
  addonId: null,
48350
50767
  access: "view"
48351
50768
  },
50769
+ "userManagement.listExternalIdentities": {
50770
+ capName: "user-management",
50771
+ capScope: "system",
50772
+ addonId: null,
50773
+ access: "view"
50774
+ },
48352
50775
  "userManagement.listOauthSessions": {
48353
50776
  capName: "user-management",
48354
50777
  capScope: "system",
@@ -48427,6 +50850,12 @@ Object.freeze({
48427
50850
  addonId: null,
48428
50851
  access: "create"
48429
50852
  },
50853
+ "userManagement.unlinkExternalIdentity": {
50854
+ capName: "user-management",
50855
+ capScope: "system",
50856
+ addonId: null,
50857
+ access: "delete"
50858
+ },
48430
50859
  "userManagement.updateUser": {
48431
50860
  capName: "user-management",
48432
50861
  capScope: "system",
@@ -48739,6 +51168,12 @@ Object.freeze({
48739
51168
  addonId: null,
48740
51169
  access: "create"
48741
51170
  },
51171
+ "webrtcSession.applyDownlinkProbe": {
51172
+ capName: "webrtc-session",
51173
+ capScope: "device",
51174
+ addonId: null,
51175
+ access: "create"
51176
+ },
48742
51177
  "webrtcSession.closeSession": {
48743
51178
  capName: "webrtc-session",
48744
51179
  capScope: "device",
@@ -50550,11 +52985,6 @@ Object.freeze({
50550
52985
  form: "single",
50551
52986
  optional: false
50552
52987
  }],
50553
- "decoder.createSession": [{
50554
- name: "deviceId",
50555
- form: "single",
50556
- optional: true
50557
- }],
50558
52988
  "detectionPipeline.applyDeviceSettingsPatch": [{
50559
52989
  name: "deviceId",
50560
52990
  form: "single",
@@ -51525,6 +53955,11 @@ Object.freeze({
51525
53955
  form: "single",
51526
53956
  optional: false
51527
53957
  }],
53958
+ "pipelineAnalytics.addRetrainFrameFromRecording": [{
53959
+ name: "deviceId",
53960
+ form: "single",
53961
+ optional: false
53962
+ }],
51528
53963
  "pipelineAnalytics.applyDeviceSettingsPatch": [{
51529
53964
  name: "deviceId",
51530
53965
  form: "single",
@@ -51715,6 +54150,11 @@ Object.freeze({
51715
54150
  form: "single",
51716
54151
  optional: false
51717
54152
  }],
54153
+ "pipelineAnalytics.proposeRetrainAnnotationsWithLlm": [{
54154
+ name: "deviceId",
54155
+ form: "single",
54156
+ optional: false
54157
+ }],
51718
54158
  "pipelineAnalytics.pruneEventsBefore": [{
51719
54159
  name: "deviceId",
51720
54160
  form: "single",
@@ -51765,6 +54205,11 @@ Object.freeze({
51765
54205
  form: "single",
51766
54206
  optional: false
51767
54207
  }],
54208
+ "pipelineAnalytics.setRetrainFrameComplete": [{
54209
+ name: "deviceId",
54210
+ form: "single",
54211
+ optional: false
54212
+ }],
51768
54213
  "pipelineAnalytics.setTrackFlags": [{
51769
54214
  name: "deviceId",
51770
54215
  form: "single",
@@ -51785,6 +54230,11 @@ Object.freeze({
51785
54230
  form: "single",
51786
54231
  optional: false
51787
54232
  }],
54233
+ "pipelineExecutor.clearModelBoundDeviceOverrides": [{
54234
+ name: "deviceIds",
54235
+ form: "array",
54236
+ optional: true
54237
+ }],
51788
54238
  "pipelineExecutor.runPipeline": [{
51789
54239
  name: "deviceId",
51790
54240
  form: "single",
@@ -51890,6 +54340,11 @@ Object.freeze({
51890
54340
  form: "single",
51891
54341
  optional: false
51892
54342
  }],
54343
+ "pipelineOrchestrator.setCameraStepSettings": [{
54344
+ name: "deviceId",
54345
+ form: "single",
54346
+ optional: false
54347
+ }],
51893
54348
  "pipelineOrchestrator.setCameraStepToggle": [{
51894
54349
  name: "deviceId",
51895
54350
  form: "single",
@@ -52661,6 +55116,11 @@ Object.freeze({
52661
55116
  form: "single",
52662
55117
  optional: false
52663
55118
  }],
55119
+ "webrtcSession.applyDownlinkProbe": [{
55120
+ name: "deviceId",
55121
+ form: "single",
55122
+ optional: false
55123
+ }],
52664
55124
  "webrtcSession.closeSession": [{
52665
55125
  name: "deviceId",
52666
55126
  form: "single",
@@ -52890,6 +55350,8 @@ new Map(Object.entries({
52890
55350
  "detection-blind": "device-events",
52891
55351
  "node-online": "system",
52892
55352
  "node-offline": "system",
55353
+ "node-restarting": "system",
55354
+ "node-updating": "system",
52893
55355
  "node-inference-unavailable": "system",
52894
55356
  "addon-crash-loop": "system",
52895
55357
  "addon-update-available": "system",
@@ -52967,6 +55429,7 @@ var NC_SYSTEM_EVENT_KIND_GROUP_SPECS = [
52967
55429
  kinds: [
52968
55430
  "node-offline",
52969
55431
  "node-online",
55432
+ "node-restarting",
52970
55433
  "node-inference-unavailable"
52971
55434
  ]
52972
55435
  },
@@ -52988,6 +55451,7 @@ var NC_SYSTEM_EVENT_KIND_GROUP_SPECS = [
52988
55451
  label: "Server & container updates",
52989
55452
  kinds: [
52990
55453
  "server-update-available",
55454
+ "node-updating",
52991
55455
  "server-updated",
52992
55456
  "wrapper-update-available"
52993
55457
  ]
@@ -53135,6 +55599,7 @@ var STATE_SUMMARY_SECTION_VARS = [
53135
55599
  kinds: [
53136
55600
  "node-offline",
53137
55601
  "node-online",
55602
+ "node-restarting",
53138
55603
  "node-inference-unavailable"
53139
55604
  ]
53140
55605
  },
@@ -53156,6 +55621,7 @@ var STATE_SUMMARY_SECTION_VARS = [
53156
55621
  example: "server 1.2.377 → 1.2.378",
53157
55622
  kinds: [
53158
55623
  "server-update-available",
55624
+ "node-updating",
53159
55625
  "server-updated",
53160
55626
  "wrapper-update-available"
53161
55627
  ]
@@ -53188,7 +55654,7 @@ var STATE_SUMMARY_VARS = [
53188
55654
  {
53189
55655
  name: "summarySection",
53190
55656
  label: "Summary: this section",
53191
- description: "The section a per-section summary row is about (D698); on a summary sent as one message, every section it reports, comma-separated.",
55657
+ description: "The section a per-section summary row is about; on a summary sent as one message, every section it reports, comma-separated.",
53192
55658
  example: "Batterie scariche",
53193
55659
  group: "system",
53194
55660
  families: ["rule"],
@@ -53823,7 +56289,7 @@ var TuyaRegionSchema = _enum(TUYA_REGION_VALUES);
53823
56289
  */
53824
56290
  var tuyaConfigSchema = object({
53825
56291
  accessId: string().min(1).describe("Tuya IoT project Access ID / Client ID"),
53826
- accessSecret: string().min(1).describe("Tuya IoT project Access Secret / Client Secret"),
56292
+ accessSecret: string().min(1).describe("Tuya IoT project Access Secret / Client Secret").meta({ secret: true }),
53827
56293
  region: TuyaRegionSchema.default("eu").describe("Tuya cloud data-centre region"),
53828
56294
  discoveryTimeoutMs: preprocess((v) => v === "" || v === null ? void 0 : v, number().int().min(1e3).max(3e4).default(6e3)).describe("LAN discovery sweep window (ms) used to resolve device IP / protocol version")
53829
56295
  });
@@ -54088,7 +56554,7 @@ var tuyaConnections = new TuyaConnectionResolver();
54088
56554
  var tuyaDeviceConfigSchema = object({
54089
56555
  integrationId: string().min(1).describe("Owning Tuya integration id"),
54090
56556
  tuyaDeviceId: string().min(1).describe("Tuya cloud device id (gwId/devId)"),
54091
- localKey: string().min(1).describe("Device local key (from the Tuya cloud)"),
56557
+ localKey: string().min(1).describe("Device local key (from the Tuya cloud)").meta({ secret: true }),
54092
56558
  host: string().default("").describe("Device LAN IP / host"),
54093
56559
  version: string().default("3.3").describe("Tuya protocol version (3.1–3.5)"),
54094
56560
  switchDp: string().default("1").describe("Boolean DP a raw switch drives"),