@camstack/addon-provider-hikvision 1.2.145 → 1.2.147

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 +2722 -513
  2. package/dist/addon.mjs +2722 -513
  3. package/package.json +1 -1
package/dist/addon.mjs CHANGED
@@ -12,7 +12,7 @@ import { networkInterfaces } from "node:os";
12
12
  var __commonJSMin = (cb, mod) => () => (mod || (cb((mod = { exports: {} }).exports, mod), cb = null), mod.exports);
13
13
  var __require = /* @__PURE__ */ createRequire(import.meta.url);
14
14
  //#endregion
15
- //#region ../types/dist/event-category-BGmz_oxW.mjs
15
+ //#region ../types/dist/event-category-DaIZi00R.mjs
16
16
  var EventCategory = /* @__PURE__ */ function(EventCategory) {
17
17
  EventCategory["SystemBoot"] = "system.boot";
18
18
  EventCategory["SystemAddonsReady"] = "system.addons-ready";
@@ -91,6 +91,13 @@ var EventCategory = /* @__PURE__ */ function(EventCategory) {
91
91
  */
92
92
  EventCategory["AddonLoadFailed"] = "addon.load-failed";
93
93
  /**
94
+ * A keychain value was stored or removed (D787). Carries the ref, its
95
+ * owner and the new version — NEVER the value. A process holding the ref
96
+ * drops its cached copy and the owning `BaseAddon` re-resolves its config.
97
+ * Telemetry (D8): a process that misses it still revalidates by version.
98
+ */
99
+ EventCategory["KeychainChanged"] = "keychain.changed";
100
+ /**
94
101
  * Addon recovered from a previous failure. Emitted when an addon
95
102
  * transitions from `failed` back to `healthy` (typically via the
96
103
  * monitor's auto-retry loop, or after manual `addons.retryLoad`).
@@ -513,15 +520,6 @@ var EventCategory = /* @__PURE__ */ function(EventCategory) {
513
520
  EventCategory["AgentWsDisconnected"] = "agent.ws.disconnected";
514
521
  EventCategory["AgentBackupActivated"] = "agent.backup.activated";
515
522
  EventCategory["OrchestrationSettingsUpdated"] = "orchestration.settings-updated";
516
- /**
517
- * Per-agent hwaccel preference changed (user override set, cleared, or
518
- * re-probed). Observability event — decoders pull the current pref at
519
- * `createSession`, so running sessions keep their current backend until
520
- * they rotate naturally (camera add/remove, stream restart). Future
521
- * work can wire a listener in stream-broker that force-rotates live
522
- * sessions; for now this event powers logs + admin-UI toast feedback.
523
- */
524
- EventCategory["PipelineAgentHwaccelChanged"] = "pipeline.agent-hwaccel-changed";
525
523
  EventCategory["MotionAnalysis"] = "detection.motion-analysis";
526
524
  /** All raw motion zones from CCL before minArea filter — for UI debug overlay. */
527
525
  EventCategory["MotionZonesRaw"] = "detection.motion-zones-raw";
@@ -5392,7 +5390,7 @@ var ZodIssueCode = {
5392
5390
  var ZodFirstPartyTypeKind;
5393
5391
  ZodFirstPartyTypeKind || (ZodFirstPartyTypeKind = {});
5394
5392
  //#endregion
5395
- //#region ../types/dist/sleep-C16NCZR2.mjs
5393
+ //#region ../types/dist/sleep-Cr5YOk3m.mjs
5396
5394
  /**
5397
5395
  * The audio chunk plane's byte format, and the ONE expansion from a coded
5398
5396
  * window to float samples (D455).
@@ -5471,6 +5469,97 @@ function buildAlawTable() {
5471
5469
  }
5472
5470
  buildUlawTable();
5473
5471
  buildAlawTable();
5472
+ /** Is this field's stored value a credential? */
5473
+ function isSecretConfigField(field) {
5474
+ if (field.type === "password") return true;
5475
+ return "secret" in field && field.secret === true;
5476
+ }
5477
+ /**
5478
+ * Is this field's value stored in the KEYCHAIN (D787)? Every secret field is,
5479
+ * by its TYPE, unless it opts out with `storage: 'inline'` — never by its name.
5480
+ */
5481
+ function isKeychainStoredField(field) {
5482
+ if (!isSecretConfigField(field)) return false;
5483
+ if (field.type === "textarea" && field.isJson === true) return false;
5484
+ return !("storage" in field && field.storage === "inline");
5485
+ }
5486
+ /**
5487
+ * What a settings blob holds where a secret used to be.
5488
+ *
5489
+ * A keychain-stored field never holds its value. It holds a self-describing
5490
+ * MARKER, `{"$secret":"secret://…","v":1}` — an object, never a string, so no
5491
+ * code can mistake it for a credential and no form can send it to a camera as
5492
+ * a password. The empty state is `null` / absent, never `''`.
5493
+ *
5494
+ * The same shapes travel to and from the admin UI:
5495
+ *
5496
+ * - read: `hydrateSchema` hands a secret field a {@link SecretFieldView}
5497
+ * (`{ $secret, v, set: true }`) or `null` — the browser learns whether a
5498
+ * value is set, never the value.
5499
+ * - write: an untouched field submits the view back unchanged (KEEP); a typed
5500
+ * value is a plain non-empty string (CHANGE); the Clear button submits
5501
+ * {@link SECRET_CLEAR} (CLEAR). `''`, `null` and the legacy redaction tokens
5502
+ * are KEEP — an empty string is what a defaults-fallback pushes back, and
5503
+ * treating it as "clear" is how a save destroyed a stored credential before.
5504
+ *
5505
+ * Pure and browser-safe.
5506
+ */
5507
+ var SECRET_CLEAR = { $secretClear: true };
5508
+ /** The `'***'` token D634 redaction writes for non-admins. */
5509
+ var LEGACY_DEVICE_REDACTION = "***";
5510
+ function isRecord$1(value) {
5511
+ return typeof value === "object" && value !== null && !Array.isArray(value);
5512
+ }
5513
+ function makeSecretMarker(ref) {
5514
+ return {
5515
+ $secret: ref,
5516
+ v: 1
5517
+ };
5518
+ }
5519
+ /** A stored marker: an object whose `$secret` is a non-empty string. */
5520
+ function isSecretMarker(value) {
5521
+ if (!isRecord$1(value)) return false;
5522
+ const ref = value["$secret"];
5523
+ return typeof ref === "string" && ref.length > 0;
5524
+ }
5525
+ function isSecretClear(value) {
5526
+ return isRecord$1(value) && value["$secretClear"] === true;
5527
+ }
5528
+ /**
5529
+ * The UI view of a stored secret field value: a marker becomes "set", inline
5530
+ * plaintext becomes "set (inline)", nothing becomes `null`. A value never
5531
+ * survives this function.
5532
+ */
5533
+ function toSecretFieldView(stored) {
5534
+ if (isSecretMarker(stored)) return {
5535
+ $secret: stored.$secret,
5536
+ v: 1,
5537
+ set: true
5538
+ };
5539
+ if (typeof stored === "string" && stored.length > 0) return {
5540
+ $secret: null,
5541
+ v: 1,
5542
+ set: true,
5543
+ inline: true
5544
+ };
5545
+ return null;
5546
+ }
5547
+ /**
5548
+ * Classify an incoming value for a secret path. Only a non-empty string that is
5549
+ * not a redaction token sets a value; only {@link SECRET_CLEAR} clears.
5550
+ * Everything else — a marker (ours or anyone's), a UI view, `''`, `null`,
5551
+ * `undefined`, a redaction token, a non-string — keeps what is stored.
5552
+ */
5553
+ function classifySecretWrite(incoming) {
5554
+ if (isSecretClear(incoming)) return { kind: "clear" };
5555
+ if (typeof incoming !== "string") return { kind: "keep" };
5556
+ if (incoming.length === 0) return { kind: "keep" };
5557
+ if (incoming === "__camstack_redacted__" || incoming === LEGACY_DEVICE_REDACTION) return { kind: "keep" };
5558
+ return {
5559
+ kind: "set",
5560
+ value: incoming
5561
+ };
5562
+ }
5474
5563
  Object.fromEntries([
5475
5564
  {
5476
5565
  id: "overview",
@@ -5642,33 +5731,19 @@ Object.fromEntries([
5642
5731
  function isValuelessField(field) {
5643
5732
  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";
5644
5733
  }
5645
- /**
5646
- * Merge a `ConfigUISchema` with a raw `values` record into a
5647
- * `ConfigUISchemaWithValues`. Used by every `get*Settings` backend endpoint
5648
- * before returning to the admin UI. Groups are walked recursively.
5649
- *
5650
- * For each leaf field:
5651
- * - structural fields (`separator`, `info`, `button`) pass through unchanged
5652
- * - other fields get `value = values[key] ?? field.default ?? null`
5653
- *
5654
- * Unknown keys in `values` (keys not declared in the schema) are silently
5655
- * ignored — they don't contribute to the output. Missing keys fall back to
5656
- * the schema default or `null`. This mirrors the old backend behaviour where
5657
- * `FormBuilder` rendered `values[key] ?? field.default`.
5658
- */
5659
- function hydrateSchema(schema, values) {
5734
+ function hydrateSchema(schema, values, options = {}) {
5660
5735
  return {
5661
5736
  ...schema.tabs ? { tabs: [...schema.tabs] } : {},
5662
5737
  sections: schema.sections.map((section) => ({
5663
5738
  ...section,
5664
- fields: section.fields.map((field) => hydrateField(field, values))
5739
+ fields: section.fields.map((field) => hydrateField(field, values, options))
5665
5740
  }))
5666
5741
  };
5667
5742
  }
5668
- function hydrateField(field, values) {
5743
+ function hydrateField(field, values, options) {
5669
5744
  if (isValuelessField(field)) return field;
5670
5745
  if (field.type === "group") {
5671
- const hydratedChildren = field.fields.map((child) => hydrateField(child, values));
5746
+ const hydratedChildren = field.fields.map((child) => hydrateField(child, values, options));
5672
5747
  return {
5673
5748
  ...field,
5674
5749
  fields: hydratedChildren
@@ -5677,7 +5752,7 @@ function hydrateField(field, values) {
5677
5752
  if (field.type === "sub-tabs") {
5678
5753
  const hydratedTabs = field.tabs.map((tab) => ({
5679
5754
  ...tab,
5680
- fields: tab.fields.map((child) => hydrateField(child, values))
5755
+ fields: tab.fields.map((child) => hydrateField(child, values, options))
5681
5756
  }));
5682
5757
  return {
5683
5758
  ...field,
@@ -5687,6 +5762,33 @@ function hydrateField(field, values) {
5687
5762
  const key = field.key;
5688
5763
  const storedValue = Object.prototype.hasOwnProperty.call(values, key) ? values[key] : void 0;
5689
5764
  const defaultValue = field.default;
5765
+ const asView = (v) => isSecretMarker(v) || options.inlineSecretsAsViews === true && v !== void 0;
5766
+ if (isKeychainStoredField(field) && asView(storedValue)) return {
5767
+ ...field,
5768
+ value: toSecretFieldView(storedValue)
5769
+ };
5770
+ if (isKeychainStoredField(field) && options.inlineSecretsAsViews === true) return {
5771
+ ...field,
5772
+ value: null
5773
+ };
5774
+ if (field.type === "editable-array" && Array.isArray(storedValue)) {
5775
+ const secretItemKeys = field.itemFields.filter((item) => "key" in item && isKeychainStoredField(item)).map((item) => "key" in item ? item.key : "");
5776
+ if (secretItemKeys.length > 0) {
5777
+ const rows = storedValue.map((row) => {
5778
+ if (row === null || typeof row !== "object" || Array.isArray(row)) return row;
5779
+ const out = { ...row };
5780
+ for (const k of secretItemKeys) {
5781
+ const v = Reflect.get(row, k);
5782
+ if (asView(v)) out[k] = toSecretFieldView(v);
5783
+ }
5784
+ return out;
5785
+ });
5786
+ return {
5787
+ ...field,
5788
+ value: rows
5789
+ };
5790
+ }
5791
+ }
5690
5792
  if (field.multiple) {
5691
5793
  const stored = Array.isArray(storedValue) ? storedValue : storedValue !== void 0 && storedValue !== null ? [storedValue] : [];
5692
5794
  const itemFallback = field.multiple.itemDefault !== void 0 ? field.multiple.itemDefault : defaultValue !== void 0 ? defaultValue : typeOf(field) === "string" ? "" : null;
@@ -5929,6 +6031,431 @@ function projectStore(store, perNodeKeys, nodeId) {
5929
6031
  }
5930
6032
  return out;
5931
6033
  }
6034
+ var GLOBAL_SCOPE = { kind: "global" };
6035
+ /** The scope every addon-wide (not per-node, not per-device) setting lives in. */
6036
+ function globalSecretScope() {
6037
+ return GLOBAL_SCOPE;
6038
+ }
6039
+ function encodeSegment(value) {
6040
+ return encodeURIComponent(value);
6041
+ }
6042
+ /**
6043
+ * The field path of a value inside an array item, addressed by the item's id:
6044
+ * `arrayItemFieldPath('providers', 'authentik', 'clientSecret')` →
6045
+ * `providers[authentik].clientSecret`.
6046
+ */
6047
+ function arrayItemFieldPath(arrayKey, itemId, fieldKey) {
6048
+ return `${arrayKey}[${encodeSegment(itemId)}].${fieldKey}`;
6049
+ }
6050
+ /** A write to a secret path could not be stored in the keychain, so it was refused. */
6051
+ var KeychainWriteRefusedError = class extends Error {
6052
+ fieldPath;
6053
+ constructor(fieldPath, cause) {
6054
+ super(`secret "${fieldPath}" was not saved: the keychain could not store it (${cause instanceof Error ? cause.message : String(cause)}). Nothing was written.`);
6055
+ this.fieldPath = fieldPath;
6056
+ this.name = "KeychainWriteRefusedError";
6057
+ }
6058
+ };
6059
+ var KEEP = { kind: "keep" };
6060
+ function isRecord(value) {
6061
+ return typeof value === "object" && value !== null && !Array.isArray(value);
6062
+ }
6063
+ function defaultMintId() {
6064
+ return globalThis.crypto.randomUUID();
6065
+ }
6066
+ /** Every marker ref anywhere under `value`. */
6067
+ function collectSecretMarkerRefs(value, out = []) {
6068
+ if (isSecretMarker(value)) {
6069
+ out.push(value.$secret);
6070
+ return out;
6071
+ }
6072
+ if (Array.isArray(value)) for (const item of value) collectSecretMarkerRefs(item, out);
6073
+ else if (isRecord(value)) for (const child of Object.values(value)) collectSecretMarkerRefs(child, out);
6074
+ return out;
6075
+ }
6076
+ async function storedValueEquals(secrets, marker, candidate) {
6077
+ const resolved = (await secrets.resolve([marker.$secret]))[marker.$secret];
6078
+ return resolved?.kind === "value" && resolved.value === candidate;
6079
+ }
6080
+ async function writeLeaf(ctx, incoming, stored, fieldPath) {
6081
+ const intent = classifySecretWrite(incoming);
6082
+ const ref = ctx.secrets.ref(ctx.scope, fieldPath);
6083
+ const storedIsOurs = isSecretMarker(stored) && stored.$secret === ref;
6084
+ if (intent.kind === "keep") return KEEP;
6085
+ if (intent.kind === "set" && !ctx.operatorWrite && typeof stored === "string" && stored === intent.value) return KEEP;
6086
+ if (intent.kind === "clear") {
6087
+ if (storedIsOurs) ctx.deletes.push(ref);
6088
+ return {
6089
+ kind: "value",
6090
+ value: null
6091
+ };
6092
+ }
6093
+ if (storedIsOurs && await storedValueEquals(ctx.secrets, stored, intent.value)) return {
6094
+ kind: "value",
6095
+ value: stored
6096
+ };
6097
+ try {
6098
+ await ctx.secrets.put(ref, intent.value);
6099
+ } catch (err) {
6100
+ throw new KeychainWriteRefusedError(fieldPath, err);
6101
+ }
6102
+ return {
6103
+ kind: "value",
6104
+ value: makeSecretMarker(ref)
6105
+ };
6106
+ }
6107
+ /** Apply a member result onto `out`: KEEP restores the stored member, or removes it. */
6108
+ function applyMember(out, key, result, storedParent) {
6109
+ if (result.kind === "value") {
6110
+ out[key] = result.value;
6111
+ return;
6112
+ }
6113
+ if (Object.prototype.hasOwnProperty.call(storedParent, key)) out[key] = storedParent[key];
6114
+ else delete out[key];
6115
+ }
6116
+ async function writeMembers(ctx, children, incoming, stored, pathOf) {
6117
+ const out = { ...incoming };
6118
+ for (const [member, node] of children) applyMember(out, member, await writeNode(ctx, node, incoming[member], stored[member], pathOf(member)), stored);
6119
+ return out;
6120
+ }
6121
+ function rowId(row, idKey) {
6122
+ const raw = row[idKey];
6123
+ if (typeof raw === "string" && raw.length > 0) return raw;
6124
+ if (typeof raw === "number" && Number.isFinite(raw)) return String(raw);
6125
+ return null;
6126
+ }
6127
+ async function writeArray(ctx, node, incoming, stored, fieldPath) {
6128
+ const storedRows = Array.isArray(stored) ? stored.filter(isRecord) : [];
6129
+ if (!Array.isArray(incoming)) {
6130
+ ctx.deletes.push(...collectSecretMarkerRefs(storedRows));
6131
+ return {
6132
+ kind: "value",
6133
+ value: incoming
6134
+ };
6135
+ }
6136
+ const storedById = /* @__PURE__ */ new Map();
6137
+ for (const row of storedRows) {
6138
+ const id = rowId(row, node.idKey);
6139
+ if (id !== null) storedById.set(id, row);
6140
+ }
6141
+ const kept = /* @__PURE__ */ new Set();
6142
+ const rows = [];
6143
+ for (const row of incoming) {
6144
+ if (!isRecord(row)) {
6145
+ rows.push(row);
6146
+ continue;
6147
+ }
6148
+ const id = rowId(row, node.idKey) ?? ctx.mintId();
6149
+ kept.add(id);
6150
+ const withId = {
6151
+ ...row,
6152
+ [node.idKey]: row[node.idKey] ?? id
6153
+ };
6154
+ if (rowId(withId, node.idKey) === null) withId[node.idKey] = id;
6155
+ const storedRow = storedById.get(id) ?? {};
6156
+ rows.push(await writeMembers(ctx, node.item, withId, storedRow, (member) => arrayItemFieldPath(fieldPath, id, member)));
6157
+ }
6158
+ for (const [id, row] of storedById) if (!kept.has(id)) ctx.deletes.push(...collectSecretMarkerRefs(row));
6159
+ return {
6160
+ kind: "value",
6161
+ value: rows
6162
+ };
6163
+ }
6164
+ async function writeNode(ctx, node, incoming, stored, fieldPath) {
6165
+ switch (node.kind) {
6166
+ case "leaf": return writeLeaf(ctx, incoming, stored, fieldPath);
6167
+ case "array": return writeArray(ctx, node, incoming, stored, fieldPath);
6168
+ case "object": {
6169
+ if (!isRecord(incoming)) {
6170
+ if (incoming === void 0) return KEEP;
6171
+ ctx.deletes.push(...collectSecretMarkerRefs(stored));
6172
+ return {
6173
+ kind: "value",
6174
+ value: incoming
6175
+ };
6176
+ }
6177
+ const storedObj = isRecord(stored) ? stored : {};
6178
+ return {
6179
+ kind: "value",
6180
+ value: await writeMembers(ctx, node.children, incoming, storedObj, (m) => `${fieldPath}.${m}`)
6181
+ };
6182
+ }
6183
+ }
6184
+ }
6185
+ /** Split a perNode-scoped key (`key@nodeId`). */
6186
+ function splitNodeKey(key) {
6187
+ const at = key.indexOf("@");
6188
+ return at <= 0 ? {
6189
+ base: key,
6190
+ nodeId: null
6191
+ } : {
6192
+ base: key.slice(0, at),
6193
+ nodeId: key.slice(at + 1)
6194
+ };
6195
+ }
6196
+ /** Rewrite a settings patch so no secret value reaches the blob. See the file doc. */
6197
+ async function transformSecretWrite(input) {
6198
+ const deletes = [];
6199
+ const base = {
6200
+ secrets: input.secrets,
6201
+ mintId: input.mintId ?? defaultMintId,
6202
+ deletes,
6203
+ operatorWrite: input.operatorWrite === true
6204
+ };
6205
+ const out = {};
6206
+ for (const [key, incoming] of Object.entries(input.patch)) {
6207
+ const { base: baseKey, nodeId } = splitNodeKey(key);
6208
+ const node = input.tree.get(baseKey);
6209
+ if (node === void 0) {
6210
+ out[key] = incoming;
6211
+ continue;
6212
+ }
6213
+ const scope = nodeId !== null && nodeId.length > 0 ? {
6214
+ kind: "node",
6215
+ nodeId
6216
+ } : input.scope ?? globalSecretScope();
6217
+ const result = await writeNode({
6218
+ ...base,
6219
+ scope
6220
+ }, node, incoming, input.stored[key], baseKey);
6221
+ if (result.kind === "value") out[key] = result.value;
6222
+ }
6223
+ return {
6224
+ patch: out,
6225
+ afterWrite: async () => {
6226
+ if (deletes.length === 0) return { orphaned: [] };
6227
+ try {
6228
+ await input.secrets.delete([...new Set(deletes)]);
6229
+ return { orphaned: [] };
6230
+ } catch {
6231
+ return { orphaned: [...new Set(deletes)] };
6232
+ }
6233
+ }
6234
+ };
6235
+ }
6236
+ /**
6237
+ * Replace every marker in `value` with its keychain value. Returns the SAME
6238
+ * reference when there is no marker (no allocation, no keychain call).
6239
+ */
6240
+ async function resolveSecretMarkers(value, secrets) {
6241
+ const refs = collectSecretMarkerRefs(value);
6242
+ if (refs.length === 0) return {
6243
+ value,
6244
+ unresolved: []
6245
+ };
6246
+ const answers = await secrets.resolve(refs);
6247
+ const unresolved = [];
6248
+ for (const ref of new Set(refs)) {
6249
+ const answer = answers[ref];
6250
+ if (answer === void 0) unresolved.push({
6251
+ ref,
6252
+ reason: "not-initialized"
6253
+ });
6254
+ else if (answer.kind === "unavailable") unresolved.push({
6255
+ ref,
6256
+ reason: answer.reason
6257
+ });
6258
+ else if (answer.kind === "missing" || answer.kind === "forbidden") unresolved.push({
6259
+ ref,
6260
+ reason: answer.kind
6261
+ });
6262
+ }
6263
+ const substitute = (v) => {
6264
+ if (isSecretMarker(v)) {
6265
+ const answer = answers[v.$secret];
6266
+ return answer?.kind === "value" ? {
6267
+ keep: true,
6268
+ value: answer.value
6269
+ } : {
6270
+ keep: false,
6271
+ value: void 0
6272
+ };
6273
+ }
6274
+ if (Array.isArray(v)) {
6275
+ const items = [];
6276
+ for (const item of v) {
6277
+ const s = substitute(item);
6278
+ if (s.keep) items.push(s.value);
6279
+ }
6280
+ return {
6281
+ keep: true,
6282
+ value: items
6283
+ };
6284
+ }
6285
+ if (isRecord(v)) {
6286
+ const out = {};
6287
+ for (const [k, child] of Object.entries(v)) {
6288
+ const s = substitute(child);
6289
+ if (s.keep) out[k] = s.value;
6290
+ }
6291
+ return {
6292
+ keep: true,
6293
+ value: out
6294
+ };
6295
+ }
6296
+ return {
6297
+ keep: true,
6298
+ value: v
6299
+ };
6300
+ };
6301
+ return {
6302
+ value: substitute(value).value,
6303
+ unresolved
6304
+ };
6305
+ }
6306
+ function touchesTree(tree, patch) {
6307
+ if (tree.size === 0) return false;
6308
+ for (const key of Object.keys(patch)) {
6309
+ const at = key.indexOf("@");
6310
+ if (tree.has(at > 0 ? key.slice(0, at) : key)) return true;
6311
+ }
6312
+ return false;
6313
+ }
6314
+ /** The blob as stored now; a failed read REFUSES the write instead of guessing. */
6315
+ async function readStoredAddonBlob(raw) {
6316
+ const threeWay = raw.readAddonStoreResult;
6317
+ if (threeWay === void 0) return raw.readAddonStore();
6318
+ const result = await threeWay.call(raw);
6319
+ if (result.kind === "failed") throw new Error(`settings write refused: the stored blob could not be read (${result.error})`);
6320
+ return result.kind === "missing" ? {} : result.value;
6321
+ }
6322
+ function createSecretAwareSettings(raw, opts) {
6323
+ const chains = /* @__PURE__ */ new Map();
6324
+ const serialize = (key, fn) => {
6325
+ const next = (chains.get(key) ?? Promise.resolve()).then(fn, fn);
6326
+ const tail = next.catch(() => void 0);
6327
+ chains.set(key, tail);
6328
+ tail.then(() => {
6329
+ if (chains.get(key) === tail) chains.delete(key);
6330
+ });
6331
+ return next;
6332
+ };
6333
+ const write = async (chainKey, tree, scope, patch, readStored, rawWrite) => {
6334
+ if (!touchesTree(tree, patch)) return rawWrite(patch);
6335
+ return serialize(chainKey, async () => {
6336
+ const stored = await readStored();
6337
+ const result = await transformSecretWrite({
6338
+ tree,
6339
+ secrets: opts.secrets,
6340
+ patch,
6341
+ stored,
6342
+ ...scope !== void 0 ? { scope } : {},
6343
+ operatorWrite: opts.isOperatorWrite?.() === true
6344
+ });
6345
+ if (Object.keys(result.patch).length > 0) await rawWrite(result.patch);
6346
+ const { orphaned } = await result.afterWrite();
6347
+ if (orphaned.length > 0) opts.onOrphaned(orphaned);
6348
+ });
6349
+ };
6350
+ const wrapped = {
6351
+ writeAddonStore: (patch) => write("addon", opts.addonTree(), void 0, patch, () => readStoredAddonBlob(raw), (p) => raw.writeAddonStore(p)),
6352
+ writeDeviceStore: (deviceId, patch) => write(`device:${deviceId}`, opts.deviceTree(), {
6353
+ kind: "device",
6354
+ deviceId
6355
+ }, patch, () => raw.readDeviceStore(deviceId), (p) => raw.writeDeviceStore(deviceId, p))
6356
+ };
6357
+ return new Proxy(raw, { get(target, prop, receiver) {
6358
+ if (prop === "writeAddonStore") return wrapped.writeAddonStore;
6359
+ if (prop === "writeDeviceStore") return wrapped.writeDeviceStore;
6360
+ const value = Reflect.get(target, prop, receiver);
6361
+ return typeof value === "function" ? value.bind(target) : value;
6362
+ } });
6363
+ }
6364
+ /** The context the addon sees: identical, except that its settings writes are secret-aware. */
6365
+ function withSecretAwareSettings(context, opts) {
6366
+ const raw = context.settings;
6367
+ if (raw === void 0) return context;
6368
+ const settings = createSecretAwareSettings(raw, opts);
6369
+ return new Proxy(context, { get(target, prop, receiver) {
6370
+ if (prop === "settings") return settings;
6371
+ return Reflect.get(target, prop, receiver);
6372
+ } });
6373
+ }
6374
+ var LEAF = { kind: "leaf" };
6375
+ var DEFAULT_ITEM_ID_KEY = "id";
6376
+ function collectFields(fields, out) {
6377
+ for (const field of fields) {
6378
+ if (field.type === "group") {
6379
+ collectFields(field.fields, out);
6380
+ continue;
6381
+ }
6382
+ if (field.type === "sub-tabs") {
6383
+ for (const tab of field.tabs) collectFields(tab.fields, out);
6384
+ continue;
6385
+ }
6386
+ if (field.type === "editable-array") {
6387
+ const item = /* @__PURE__ */ new Map();
6388
+ for (const itemField of field.itemFields) if ("key" in itemField && isKeychainStoredField(itemField)) item.set(itemField.key, LEAF);
6389
+ if (item.size > 0) out.set(field.key, {
6390
+ kind: "array",
6391
+ idKey: field.itemIdKey ?? DEFAULT_ITEM_ID_KEY,
6392
+ item
6393
+ });
6394
+ continue;
6395
+ }
6396
+ if (!("key" in field) || typeof field.key !== "string") continue;
6397
+ if (isKeychainStoredField(field)) out.set(field.key, LEAF);
6398
+ }
6399
+ }
6400
+ /** The secret tree a settings schema declares. */
6401
+ function secretTreeFromSchema(schema) {
6402
+ const out = /* @__PURE__ */ new Map();
6403
+ if (schema === null) return out;
6404
+ for (const section of schema.sections) collectFields(section.fields, out);
6405
+ return out;
6406
+ }
6407
+ /** Parse `a.b[id].c` into segments; throws on a malformed path (a declaration bug). */
6408
+ function parseSecretStatePath(path) {
6409
+ const segments = [];
6410
+ for (const raw of path.split(".")) {
6411
+ const m = /^([^[\]]+)(?:\[([^[\]]+)\])?$/.exec(raw);
6412
+ if (m === null || m[1] === void 0) throw new Error(`secretStatePaths: malformed path "${path}"`);
6413
+ segments.push(m[2] !== void 0 ? {
6414
+ key: m[1],
6415
+ idKey: m[2]
6416
+ } : { key: m[1] });
6417
+ }
6418
+ if (segments.length === 0) throw new Error(`secretStatePaths: empty path`);
6419
+ if (segments[segments.length - 1]?.idKey !== void 0) throw new Error(`secretStatePaths: "${path}" ends on an array — name the member that is secret`);
6420
+ return segments;
6421
+ }
6422
+ function insert(into, segments) {
6423
+ const [head, ...rest] = segments;
6424
+ if (head === void 0) return;
6425
+ if (rest.length === 0) {
6426
+ into.set(head.key, LEAF);
6427
+ return;
6428
+ }
6429
+ const existing = into.get(head.key);
6430
+ if (head.idKey !== void 0) {
6431
+ const item = new Map(existing?.kind === "array" ? existing.item : []);
6432
+ insert(item, rest);
6433
+ into.set(head.key, {
6434
+ kind: "array",
6435
+ idKey: head.idKey,
6436
+ item
6437
+ });
6438
+ return;
6439
+ }
6440
+ const children = new Map(existing?.kind === "object" ? existing.children : []);
6441
+ insert(children, rest);
6442
+ into.set(head.key, {
6443
+ kind: "object",
6444
+ children
6445
+ });
6446
+ }
6447
+ /** Add hidden-state paths (`secretStatePaths`) to a schema-derived tree. */
6448
+ function mergeSecretStatePaths(tree, paths) {
6449
+ if (paths.length === 0) return tree;
6450
+ const out = new Map(tree);
6451
+ for (const path of paths) insert(out, parseSecretStatePath(path));
6452
+ return out;
6453
+ }
6454
+ /** First retry of a secret the keychain could not serve; doubles to {@link SECRET_RETRY_MAX_MS}. */
6455
+ var SECRET_RETRY_FIRST_MS = 5e3;
6456
+ var SECRET_RETRY_MAX_MS = 5 * 6e4;
6457
+ /** Coalesces a burst of `keychain.changed` events into one re-resolve. */
6458
+ var SECRET_CHANGE_DEBOUNCE_MS = 250;
5932
6459
  /**
5933
6460
  * Base class for CamStack addons. Eliminates settings boilerplate:
5934
6461
  *
@@ -5998,6 +6525,25 @@ var BaseAddon = class {
5998
6525
  settingsStoreReady = false;
5999
6526
  /** Default config values. Provided via constructor. */
6000
6527
  defaults;
6528
+ /**
6529
+ * Hidden-state paths that hold secrets (D787) — values the addon writes
6530
+ * itself (`updateGlobalSettings`, `state()`) that no form field declares.
6531
+ * Stored in the keychain exactly like a `password` field. Syntax:
6532
+ * `'snapshotSigningKey'`, `'identity.pincode'`, `'tokens[userId].accessToken'`
6533
+ * (`key[<id field>]` addresses array items by id, never by index).
6534
+ */
6535
+ secretStatePaths = [];
6536
+ _addonSecretTree = null;
6537
+ _deviceSecretTree = null;
6538
+ /** Refs the last resolved config pointed at — a change to one re-resolves. */
6539
+ _configSecretRefs = /* @__PURE__ */ new Set();
6540
+ _unresolvedSecrets = [];
6541
+ _secretRetryTimer = null;
6542
+ _secretRetryDelayMs = SECRET_RETRY_FIRST_MS;
6543
+ _secretChangeTimer = null;
6544
+ _secretChangeUnsub = null;
6545
+ /** >0 while an OPERATOR's settings write is being applied. */
6546
+ _operatorWriteDepth = 0;
6001
6547
  constructor(defaults) {
6002
6548
  this.defaults = defaults;
6003
6549
  this._config = { ...defaults };
@@ -6033,8 +6579,18 @@ var BaseAddon = class {
6033
6579
  return this._config;
6034
6580
  }
6035
6581
  async initialize(context) {
6036
- this._ctx = context;
6582
+ const secrets = context.secrets;
6583
+ this._ctx = secrets !== void 0 ? withSecretAwareSettings(context, {
6584
+ secrets,
6585
+ addonTree: () => this.addonSecretTree(),
6586
+ deviceTree: () => this.deviceSecretTree(),
6587
+ onOrphaned: (refs) => context.logger.warn("keychain refs dropped by a settings write could not be deleted", { meta: { refs: [...refs] } }),
6588
+ isOperatorWrite: () => this._operatorWriteDepth > 0
6589
+ }) : context;
6037
6590
  await this.resolveConfig();
6591
+ if (secrets !== void 0) this._secretChangeUnsub = secrets.onChange((ref) => {
6592
+ if (this._configSecretRefs.has(ref)) this.scheduleSecretReresolve(SECRET_CHANGE_DEBOUNCE_MS);
6593
+ });
6038
6594
  const result = await this.onInitialize();
6039
6595
  this.emitLifecycle(EventCategory.AddonStarted);
6040
6596
  const normalized = normalizeAddonInitResult(result);
@@ -6067,6 +6623,12 @@ var BaseAddon = class {
6067
6623
  */
6068
6624
  async onHubReachable() {}
6069
6625
  async shutdown() {
6626
+ this._secretChangeUnsub?.();
6627
+ this._secretChangeUnsub = null;
6628
+ if (this._secretRetryTimer !== null) clearTimeout(this._secretRetryTimer);
6629
+ if (this._secretChangeTimer !== null) clearTimeout(this._secretChangeTimer);
6630
+ this._secretRetryTimer = null;
6631
+ this._secretChangeTimer = null;
6070
6632
  this.emitLifecycle(EventCategory.AddonStopped);
6071
6633
  if (this.autoEmitReadiness) this.emitReadinessForProviders("down");
6072
6634
  await this.onShutdown();
@@ -6145,7 +6707,7 @@ var BaseAddon = class {
6145
6707
  return hydrateSchema(schema, overlay ? {
6146
6708
  ...projected,
6147
6709
  ...overlay
6148
- } : projected);
6710
+ } : projected, { inlineSecretsAsViews: true });
6149
6711
  }
6150
6712
  /**
6151
6713
  * The integration-level view of this addon's settings: exactly the sections
@@ -6194,7 +6756,7 @@ var BaseAddon = class {
6194
6756
  return hydrateSchema({
6195
6757
  ...schema,
6196
6758
  sections
6197
- }, projected);
6759
+ }, projected, { inlineSecretsAsViews: true });
6198
6760
  }
6199
6761
  /**
6200
6762
  * The raw addon store PROJECTED onto the target node's bare per-node keys:
@@ -6248,18 +6810,50 @@ var BaseAddon = class {
6248
6810
  value: result.value[key]
6249
6811
  };
6250
6812
  }
6813
+ /**
6814
+ * The OPERATOR's write — a settings form or an admin API call, dispatched by
6815
+ * the kernel. Identical to {@link updateGlobalSettings}, except that a secret
6816
+ * the operator sends is stored as sent even when it equals a pre-keychain
6817
+ * inline value: the operator re-entering a password is a change, an addon
6818
+ * writing back what it read is not (D787).
6819
+ */
6820
+ async updateGlobalSettingsAsOperator(patch, nodeId) {
6821
+ this._operatorWriteDepth++;
6822
+ try {
6823
+ await this.applyGlobalPatch(patch, nodeId);
6824
+ } finally {
6825
+ this._operatorWriteDepth--;
6826
+ }
6827
+ }
6251
6828
  async updateGlobalSettings(patch, nodeId) {
6829
+ await this.applyGlobalPatch(patch, nodeId);
6830
+ }
6831
+ /**
6832
+ * REMOVE stored secrets — their keychain values and their markers (D787).
6833
+ *
6834
+ * Writing `''` to a secret field KEEPS what is stored (an empty string is
6835
+ * what a defaults fallback writes back, and it must never destroy a
6836
+ * credential), so code that means "forget this token" says so here. Without
6837
+ * a keychain (an older kernel) it writes `''`, as such code always did.
6838
+ */
6839
+ async clearSecrets(keys, nodeId) {
6840
+ const tree = this.addonSecretTree();
6841
+ const keychain = this._ctx?.secrets !== void 0;
6842
+ const patch = {};
6843
+ for (const key of keys) patch[key] = keychain && tree.has(key) ? SECRET_CLEAR : "";
6844
+ await this.applyGlobalPatch(patch, nodeId);
6845
+ }
6846
+ async applyGlobalPatch(barePatch, nodeId) {
6252
6847
  const keys = this.perNodeKeys();
6253
6848
  const localNode = normalizeNodeId(this._ctx?.kernel?.localNodeId);
6254
6849
  const target = normalizeNodeId(nodeId ?? this._ctx?.kernel?.localNodeId);
6255
- const barePatch = patch;
6256
6850
  const scoped = keys.size > 0 ? scopePatch(barePatch, keys, target) : barePatch;
6257
6851
  await this._ctx?.settings?.writeAddonStore(scoped);
6258
6852
  if (target !== localNode) return;
6259
6853
  await this.resolveConfig();
6260
6854
  await this.onConfigChanged();
6261
6855
  this.emitLifecycle(EventCategory.AddonUpdated, { level: "global" });
6262
- this.maybeAutoRestart(patch, this.globalSettingsSchema());
6856
+ this.maybeAutoRestart(Object.keys(barePatch), this.globalSettingsSchema());
6263
6857
  }
6264
6858
  /**
6265
6859
  * The set of field keys the global settings schema declares `perNode: true`
@@ -6284,7 +6878,7 @@ var BaseAddon = class {
6284
6878
  * time to return its response before the addon is torn down and
6285
6879
  * re-initialised by `AddonRegistryService.restartAddon`.
6286
6880
  */
6287
- maybeAutoRestart(patch, schema) {
6881
+ maybeAutoRestart(patchKeys, schema) {
6288
6882
  if (!schema) return;
6289
6883
  const restartKeys = /* @__PURE__ */ new Set();
6290
6884
  for (const section of schema.sections) for (const field of section.fields) {
@@ -6292,13 +6886,13 @@ var BaseAddon = class {
6292
6886
  if (field.requiresRestart) restartKeys.add(field.key);
6293
6887
  }
6294
6888
  if (restartKeys.size === 0) return;
6295
- if (!Object.keys(patch).some((k) => restartKeys.has(k))) return;
6889
+ if (!patchKeys.some((k) => restartKeys.has(k))) return;
6296
6890
  const ctx = this._ctx;
6297
6891
  if (!ctx) return;
6298
6892
  const addonId = ctx.id;
6299
6893
  setImmediate(() => {
6300
6894
  ctx.api.addons?.restartAddon?.mutate({ addonId }).then(() => {
6301
- ctx.logger.info("addon auto-restart triggered by restart-required setting change", { meta: { changedFields: Object.keys(patch).filter((k) => restartKeys.has(k)) } });
6895
+ ctx.logger.info("addon auto-restart triggered by restart-required setting change", { meta: { changedFields: patchKeys.filter((k) => restartKeys.has(k)) } });
6302
6896
  }).catch((err) => {
6303
6897
  ctx.logger.error("addon auto-restart failed", { meta: { error: err instanceof Error ? err.message : String(err) } });
6304
6898
  });
@@ -6307,7 +6901,7 @@ var BaseAddon = class {
6307
6901
  async getDeviceSettings(deviceId) {
6308
6902
  const schema = this.deviceSettingsSchema();
6309
6903
  if (!schema) return { sections: [] };
6310
- return hydrateSchema(schema, await this._ctx?.settings?.readDeviceStore(deviceId) ?? {});
6904
+ return hydrateSchema(schema, await this._ctx?.settings?.readDeviceStore(deviceId) ?? {}, { inlineSecretsAsViews: true });
6311
6905
  }
6312
6906
  async updateDeviceSettings(deviceId, patch) {
6313
6907
  await this._ctx?.settings?.writeDeviceStore(deviceId, patch);
@@ -6437,7 +7031,7 @@ var BaseAddon = class {
6437
7031
  * selection at boot (absent scoped key ⇒ the constructor default wins).
6438
7032
  */
6439
7033
  async resolveConfig() {
6440
- const stored = await this.readAddonStoreWithRetry();
7034
+ const stored = await this.resolveStoredSecrets(await this.readAddonStoreWithRetry());
6441
7035
  const perNode = this.perNodeKeys();
6442
7036
  const localNode = normalizeNodeId(this._ctx?.kernel?.localNodeId);
6443
7037
  const resolved = { ...this.defaults };
@@ -6462,7 +7056,7 @@ var BaseAddon = class {
6462
7056
  key,
6463
7057
  schema,
6464
7058
  fallback,
6465
- read: () => this.readAddonStoreWithRetry(),
7059
+ read: async () => this.resolveStoredSecrets(await this.readAddonStoreWithRetry()),
6466
7060
  write: async (patch) => {
6467
7061
  await this._ctx?.settings?.writeAddonStore(patch);
6468
7062
  },
@@ -6479,7 +7073,7 @@ var BaseAddon = class {
6479
7073
  key,
6480
7074
  schema,
6481
7075
  fallback,
6482
- read: async () => await this._ctx?.settings?.readDeviceStore(deviceId) ?? {},
7076
+ read: async () => this.resolveStoredSecrets(await this._ctx?.settings?.readDeviceStore(deviceId) ?? {}, false),
6483
7077
  write: async (patch) => {
6484
7078
  await this._ctx?.settings?.writeDeviceStore(deviceId, patch);
6485
7079
  },
@@ -6491,6 +7085,70 @@ var BaseAddon = class {
6491
7085
  } })
6492
7086
  });
6493
7087
  }
7088
+ /** The addon store's secret tree: schema fields by TYPE, plus `secretStatePaths`. */
7089
+ addonSecretTree() {
7090
+ this._addonSecretTree ??= mergeSecretStatePaths(secretTreeFromSchema(this.globalSettingsSchema()), this.secretStatePaths);
7091
+ return this._addonSecretTree;
7092
+ }
7093
+ deviceSecretTree() {
7094
+ this._deviceSecretTree ??= secretTreeFromSchema(this.deviceSettingsSchema());
7095
+ return this._deviceSecretTree;
7096
+ }
7097
+ /**
7098
+ * Secrets of this addon's stored config that could not be resolved on the
7099
+ * last read, with why. Non-empty means the addon is running WITHOUT them —
7100
+ * an addon whose function needs one should report itself degraded rather
7101
+ * than start on an empty credential.
7102
+ */
7103
+ get unresolvedSecrets() {
7104
+ return this._unresolvedSecrets;
7105
+ }
7106
+ /**
7107
+ * Substitute every keychain marker in a stored blob with its value. With no
7108
+ * keychain (no `ctx.secrets`) or no marker, the blob comes back unchanged.
7109
+ * An unresolvable value is LEFT OUT (never `''`), logged by ref — never by
7110
+ * value — and, when the cause can pass, retried with backoff. Nothing is
7111
+ * ever written back from here.
7112
+ */
7113
+ async resolveStoredSecrets(blob, trackForConfig = true) {
7114
+ const secrets = this._ctx?.secrets;
7115
+ if (secrets === void 0) return blob;
7116
+ const refs = collectSecretMarkerRefs(blob);
7117
+ if (trackForConfig) this._configSecretRefs = new Set(refs);
7118
+ if (refs.length === 0) {
7119
+ if (trackForConfig) this._unresolvedSecrets = [];
7120
+ return blob;
7121
+ }
7122
+ const { value, unresolved } = await resolveSecretMarkers(blob, secrets);
7123
+ if (trackForConfig) {
7124
+ this._unresolvedSecrets = unresolved;
7125
+ if (unresolved.length > 0) {
7126
+ this._ctx?.logger?.error?.("secret unavailable — running without it, will retry", { meta: { secrets: unresolved.map((u) => ({
7127
+ ref: u.ref,
7128
+ reason: u.reason
7129
+ })) } });
7130
+ if (unresolved.some((u) => u.reason !== "missing" && u.reason !== "forbidden")) {
7131
+ this.scheduleSecretReresolve(this._secretRetryDelayMs);
7132
+ this._secretRetryDelayMs = Math.min(this._secretRetryDelayMs * 2, SECRET_RETRY_MAX_MS);
7133
+ }
7134
+ } else this._secretRetryDelayMs = SECRET_RETRY_FIRST_MS;
7135
+ }
7136
+ return value;
7137
+ }
7138
+ /** Re-resolve the config (a keychain-only change, or a retry) and apply it. */
7139
+ scheduleSecretReresolve(delayMs) {
7140
+ const timerOf = delayMs === SECRET_CHANGE_DEBOUNCE_MS ? "_secretChangeTimer" : "_secretRetryTimer";
7141
+ if (this[timerOf] !== null) return;
7142
+ const timer = setTimeout(() => {
7143
+ this[timerOf] = null;
7144
+ if (this._ctx === null) return;
7145
+ this.resolveConfig().then(() => this.onConfigChanged()).catch((err) => {
7146
+ this._ctx?.logger?.error?.("re-resolving secrets failed", { meta: { error: err instanceof Error ? err.message : String(err) } });
7147
+ });
7148
+ }, delayMs);
7149
+ timer.unref?.();
7150
+ this[timerOf] = timer;
7151
+ }
6494
7152
  /**
6495
7153
  * Wrap `ctx.settings.readAddonStore()` with a short retry budget so a
6496
7154
  * transient settings-store outage (mid-restart of sqlite-settings, tsx-watch
@@ -6758,32 +7416,12 @@ object({
6758
7416
  audioCodec: string().optional(),
6759
7417
  metadata: record(string(), unknown()).readonly().optional()
6760
7418
  });
6761
- var EncodedPacketSchema = object({
6762
- type: _enum(["video", "audio"]),
6763
- data: _instanceof(Uint8Array),
6764
- pts: number(),
6765
- dts: number(),
6766
- keyframe: boolean(),
6767
- codec: string()
6768
- });
6769
- var DecodedFrameSchema = object({
6770
- data: _instanceof(Uint8Array),
6771
- width: number(),
6772
- height: number(),
6773
- format: _enum([
6774
- "jpeg",
6775
- "rgb",
6776
- "bgr",
6777
- "yuv420",
6778
- "gray"
6779
- ]),
6780
- timestamp: number()
6781
- });
6782
7419
  /**
6783
7420
  * Wire schema for `FrameHandle` — a zero-pixel, serialisable reference to a
6784
7421
  * frame in a shared-memory ring (Phase 5 / D9). Mirrors the `FrameHandle` TS
6785
- * interface in `interfaces/frame-handle.ts` field-for-field so a decoder cap
6786
- * method (`pullHandles`) can carry handles over tRPC / Moleculer.
7422
+ * interface in `interfaces/frame-handle.ts` field-for-field so a cap method
7423
+ * (the runner's native-crop and pipeline-executor inputs) can carry handles
7424
+ * over tRPC / Moleculer.
6787
7425
  *
6788
7426
  * The `satisfies` assertion below pins this schema to the interface: if a
6789
7427
  * field is added to / removed from `FrameHandle` without a matching schema
@@ -6809,50 +7447,6 @@ var FrameHandleSchema = object({
6809
7447
  slotCount: number().int().positive()
6810
7448
  });
6811
7449
  /**
6812
- * Pixel format a frame-handle subscriber can request from the broker
6813
- * (Phase 5 / D9). The packed, raster subset of `FrameFormat` — the formats a
6814
- * `frameSink: 'shm'` decoder session can write into a `FrameRing` slot.
6815
- * `jpeg` is excluded: a variable-length stream is not a fixed-stride ring
6816
- * payload, and no decoded-frame consumer requests it over the shm plane.
6817
- */
6818
- var FrameHandleFormatSchema = _enum([
6819
- "rgb",
6820
- "bgr",
6821
- "yuv420",
6822
- "gray"
6823
- ]);
6824
- /**
6825
- * Input for `stream-broker.subscribeFrames` (Phase 5 / D9). A consumer asks the
6826
- * broker for a `FrameHandle` stream of one `format`; the broker maintains one
6827
- * shared-memory ring per `(brokerId, format)` actually requested, so a `gray`
6828
- * subscriber (motion) and an `rgb` subscriber (detection) each read the format
6829
- * they asked for with no broker-side conversion.
6830
- */
6831
- var SubscribeFramesInputSchema = object({
6832
- brokerId: string(),
6833
- format: FrameHandleFormatSchema,
6834
- /**
6835
- * Optional reader-side cadence hint in frames per second. The broker does
6836
- * NOT throttle — latest-wins ring reads drop frames implicitly for a slow
6837
- * consumer. The value is echoed back in `SubscribeFramesResult.maxFps` so
6838
- * the consumer can pace its own `pullFrameHandles` polling.
6839
- */
6840
- maxFps: number().positive().optional(),
6841
- /** Short caller-identity tag (`motion`, `detection`, …) for diagnostics. */
6842
- tag: string().optional()
6843
- });
6844
- /**
6845
- * Result of `stream-broker.subscribeFrames`. The consumer then polls
6846
- * `pullFrameHandles({ subscriptionId, maxCount })` and feeds each returned
6847
- * `FrameHandle` to a `FrameRingReader`.
6848
- */
6849
- var SubscribeFramesResultSchema = object({
6850
- /** Opaque id the consumer passes to `pullFrameHandles` / `unsubscribeFrames`. */
6851
- subscriptionId: string(),
6852
- /** Reader-side cadence hint (frames/s) — echoes `SubscribeFramesInput.maxFps`. */
6853
- maxFps: number().nonnegative()
6854
- });
6855
- /**
6856
7450
  * Wire schema for a decoded audio chunk (Phase 5 / D9). Mirrors the
6857
7451
  * `DecodedAudioChunk` TS interface in `interfaces/stream-broker.ts`: PCM
6858
7452
  * sample bytes plus the track parameters a consumer needs to interpret them.
@@ -6860,8 +7454,8 @@ var SubscribeFramesResultSchema = object({
6860
7454
  * Audio chunks are tiny (a ~500ms AudioCodecSession window is a few KB of
6861
7455
  * Float32 PCM), so unlike video frames they ship their bytes INLINE over
6862
7456
  * tRPC / Moleculer — no shared-memory plane. `data` is typed `Uint8Array`
6863
- * (the wire-serialisable supertype of `Buffer`) to match `DecodedFrameSchema`
6864
- * / `EncodedPacketSchema`'s precedent; a `Buffer` is assignable to it.
7457
+ * (the wire-serialisable supertype of `Buffer`); a `Buffer` is assignable to
7458
+ * it.
6865
7459
  */
6866
7460
  var AudioChunkFormatSchema = _enum(AUDIO_CHUNK_FORMATS);
6867
7461
  var DecodedAudioChunkSchema = object({
@@ -6879,11 +7473,10 @@ var DecodedAudioChunkSchema = object({
6879
7473
  format: AudioChunkFormatSchema.optional()
6880
7474
  });
6881
7475
  /**
6882
- * Input for `stream-broker.subscribeAudioChunks` (Phase 5 / D9). The
6883
- * handle-free, ship-bytes-inline analogue of `subscribeFrames`: a consumer
6884
- * asks the broker for the decoded audio-chunk stream of one broker; the
6885
- * broker keeps a per-subscription bounded FIFO queue the consumer drains via
6886
- * `pullAudioChunks`.
7476
+ * Input for `stream-broker.subscribeAudioChunks` (Phase 5 / D9). Audio ships
7477
+ * its bytes inline: a consumer asks the broker for the decoded audio-chunk
7478
+ * stream of one broker; the broker keeps a per-subscription bounded FIFO queue
7479
+ * the consumer drains via `pullAudioChunks`.
6887
7480
  */
6888
7481
  var SubscribeAudioChunksInputSchema = object({
6889
7482
  brokerId: string(),
@@ -6914,9 +7507,7 @@ var BrokerStatsSchema = object({
6914
7507
  "stopped"
6915
7508
  ]),
6916
7509
  inputFps: number(),
6917
- decodeFps: number(),
6918
7510
  encodedSubscribers: number(),
6919
- decodedSubscribers: number(),
6920
7511
  uptimeMs: number(),
6921
7512
  bitrateKbps: number(),
6922
7513
  idrIntervalMs: number(),
@@ -6929,14 +7520,6 @@ var BrokerStatsSchema = object({
6929
7520
  preBufferMs: number(),
6930
7521
  preBufferPackets: number(),
6931
7522
  /**
6932
- * Moleculer node id of the decoder provider currently servicing this
6933
- * stream's decoded subscribers. `null` until the deferred decoder is
6934
- * created (no decoded clients yet, or codec not detected). Surfaces the
6935
- * runtime decoder placement so the UI can show "Decoder: <agent>" without
6936
- * a separate cap call per broker.
6937
- */
6938
- decoderNodeId: string().nullable(),
6939
- /**
6940
7523
  * Detected audio track parameters from the RTSP DESCRIBE / SDP. `null`
6941
7524
  * when the stream has no audio track or the broker is in cold start.
6942
7525
  * `supported = false` means the codec was detected but the local
@@ -7153,6 +7736,69 @@ method(object({ deviceId: number() }), array(StreamSourceEntrySchema)), method(o
7153
7736
  kind: "mutation",
7154
7737
  auth: "admin"
7155
7738
  }), method(object({ deviceId: number() }), unknown().nullable()), method(object({ deviceId: number() }), RawStateResultSchema.nullable(), { auth: "protected" });
7739
+ function defOf(schema) {
7740
+ return schema._zod?.def ?? {};
7741
+ }
7742
+ function declaredHere(schema) {
7743
+ return globalRegistry.get(schema)?.secret === true;
7744
+ }
7745
+ /** Wrapper kinds whose `innerType` is the field itself. */
7746
+ var WRAPPERS = new Set([
7747
+ "optional",
7748
+ "nullable",
7749
+ "default",
7750
+ "prefault",
7751
+ "catch",
7752
+ "readonly",
7753
+ "nonoptional"
7754
+ ]);
7755
+ /**
7756
+ * The schema layers that make up ONE field: the schema itself and every
7757
+ * wrapper below it (optional / default / nullable / readonly / catch), plus
7758
+ * both sides of a pipe (`z.preprocess` puts the real schema on `out`,
7759
+ * `.transform` on `in`).
7760
+ */
7761
+ function layersOf(schema) {
7762
+ const out = [];
7763
+ const queue = [schema];
7764
+ while (queue.length > 0) {
7765
+ const s = queue.shift();
7766
+ if (!s || out.includes(s)) continue;
7767
+ out.push(s);
7768
+ const def = defOf(s);
7769
+ if (def.type !== void 0 && WRAPPERS.has(def.type) && def.innerType) queue.push(def.innerType);
7770
+ if (def.type === "pipe") {
7771
+ if (def.in) queue.push(def.in);
7772
+ if (def.out) queue.push(def.out);
7773
+ }
7774
+ }
7775
+ return out;
7776
+ }
7777
+ /** True when any layer of this field declares `.meta({ secret: true })`. */
7778
+ function isZodSecret(schema) {
7779
+ return layersOf(schema).some(declaredHere);
7780
+ }
7781
+ /**
7782
+ * Every declared secret path in a config schema: dotted keys, `[]` for "each
7783
+ * element of this array" (`connection.password`, `rows[].token`). A declared
7784
+ * object or array is reported as one path and not descended into — everything
7785
+ * under it is secret.
7786
+ */
7787
+ function collectZodSecretPaths(schema, prefix = "") {
7788
+ if (isZodSecret(schema)) return prefix.length > 0 ? [prefix] : [];
7789
+ const paths = [];
7790
+ for (const layer of layersOf(schema)) {
7791
+ const def = defOf(layer);
7792
+ if (def.type === "object" && def.shape) for (const [key, child] of Object.entries(def.shape)) paths.push(...collectZodSecretPaths(child, prefix ? `${prefix}.${key}` : key));
7793
+ else if (def.type === "array" && def.element) paths.push(...collectZodSecretPaths(def.element, `${prefix}[]`));
7794
+ else if (def.type === "union" && def.options) for (const option of def.options) paths.push(...collectZodSecretPaths(option, prefix));
7795
+ else if (def.type === "intersection") {
7796
+ if (def.left) paths.push(...collectZodSecretPaths(def.left, prefix));
7797
+ if (def.right) paths.push(...collectZodSecretPaths(def.right, prefix));
7798
+ }
7799
+ }
7800
+ return [...new Set(paths)];
7801
+ }
7156
7802
  //#endregion
7157
7803
  //#region ../types/dist/err-msg-DX6i_MY4.mjs
7158
7804
  var DeviceType = /* @__PURE__ */ function(DeviceType) {
@@ -10294,70 +10940,6 @@ var StorageLocationDeclarationSchema = object({
10294
10940
  "backup"
10295
10941
  ]).optional()
10296
10942
  });
10297
- var DecoderStatsSchema = object({
10298
- inputFps: number(),
10299
- outputFps: number(),
10300
- avgDecodeTimeMs: number(),
10301
- droppedFrames: number(),
10302
- /**
10303
- * Pull-mode adaptive-fps telemetry (optional — only pull sessions run the
10304
- * lag-driven controller; push sessions omit these). `lagMs` is the EWMA of
10305
- * the decoder's real-time drift (rising = falling behind live); `adaptiveFps`
10306
- * is the current lag-throttled emit rate (≤ `effectiveFps` ceiling).
10307
- */
10308
- lagMs: number().optional(),
10309
- effectiveFps: number().optional(),
10310
- adaptiveFps: number().optional()
10311
- });
10312
- var DecoderSessionConfigSchema = object({
10313
- codec: string(),
10314
- maxFps: number().default(0),
10315
- outputFormat: _enum([
10316
- "jpeg",
10317
- "rgb",
10318
- "bgr",
10319
- "yuv420",
10320
- "gray"
10321
- ]).default("jpeg"),
10322
- scale: number().default(1),
10323
- width: number().optional(),
10324
- height: number().optional(),
10325
- /**
10326
- * Identifier of the camera this decoder session serves. Optional
10327
- * because the cap is generic (any caller could request decode), but
10328
- * stream-broker passes it so decoder logs include `deviceId` for
10329
- * per-camera filtering when diagnosing failures (e.g. node-av
10330
- * sendPacket errors on a single hung camera).
10331
- */
10332
- deviceId: number().int().nonnegative().optional(),
10333
- /**
10334
- * Free-form tag for log scoping. Stream-broker uses
10335
- * `broker:<deviceId>/<profile>`. Decoder session logger surfaces it
10336
- * on every line so `grep tag=broker:5/high` filters one camera
10337
- * profile cleanly.
10338
- */
10339
- tag: string().optional(),
10340
- /**
10341
- * Where the session delivers decoded frames (Phase 5 / D9):
10342
- *
10343
- * - `'callback'` (default) — the legacy pixel path: decoded frames are
10344
- * buffered as `DecodedFrame`s and drained via `pullFrames`.
10345
- * - `'shm'` — the shared-memory frame plane: decoded frames are written
10346
- * into an OS shared-memory ring and drained as zero-pixel
10347
- * `FrameHandle`s via `pullHandles`. A session is one mode or the
10348
- * other — `pullFrames` returns nothing for an `'shm'` session and
10349
- * `pullHandles` returns nothing for a `'callback'` session.
10350
- */
10351
- frameSink: _enum(["callback", "shm"]).default("callback"),
10352
- /**
10353
- * Per-camera decoder DEBUG facility. When `true`, a pull-mode session emits
10354
- * a throttled (~1Hz) structured `decoder debug` line (effective/adaptive fps,
10355
- * real-time lag, dropped-frame delta, avg decode time, hwaccel). Mirrors the
10356
- * stream-broker's `streamingDebug` gate — off by default so production logs
10357
- * stay quiet and the emit path pays zero per-frame cost when disabled.
10358
- */
10359
- debug: boolean().optional()
10360
- });
10361
10943
  var EU_DST = {
10362
10944
  offsetHours: 1,
10363
10945
  startMonth: 3,
@@ -10789,7 +11371,18 @@ var LABEL_SUPPLY_STEP_IDS = [
10789
11371
  ];
10790
11372
  /** Steps whose box a root detection can BE. */
10791
11373
  var CROP_SUPPLY_STEP_IDS = ["plate-detection", "face-detection"];
10792
- [...LABEL_SUPPLY_STEP_IDS, ...CROP_SUPPLY_STEP_IDS];
11374
+ /**
11375
+ * Steps whose per-detection MASK a root detection can carry (D737). The live
11376
+ * mask step is `segmentation` — a frame-plane refiner that runs its own model
11377
+ * once per detection crop. (`instance-segmentation` is a dormant step id that
11378
+ * no camera tree carries.)
11379
+ */
11380
+ var MASK_SUPPLY_STEP_IDS = ["segmentation"];
11381
+ [
11382
+ ...LABEL_SUPPLY_STEP_IDS,
11383
+ ...CROP_SUPPLY_STEP_IDS,
11384
+ ...MASK_SUPPLY_STEP_IDS
11385
+ ];
10793
11386
  var MODEL_FORMATS = [
10794
11387
  "onnx",
10795
11388
  "coreml",
@@ -10818,7 +11411,53 @@ var ModelFormatEntrySchema = object({
10818
11411
  /** Multi-file payload (directory members or sibling files). */
10819
11412
  files: array(string()).readonly().optional(),
10820
11413
  /** Runtime(s) that can use this format. If omitted, inferred from ModelFormat key */
10821
- runtimes: array(_enum(["python"])).readonly().optional()
11414
+ runtimes: array(_enum(["python"])).readonly().optional(),
11415
+ /**
11416
+ * Content revision of the artefact, for one hosted OFF the CamStack mirror.
11417
+ * A format on the mirror leaves it unset: its revision (the sha256 of its
11418
+ * weight file) comes from the downloader's generated table, kept in step
11419
+ * with the mirror by `scripts/check-hosted-model-revisions.ts` (D744). A
11420
+ * node records the revision it downloaded next to the file
11421
+ * (`<file>.revision`); a copy with no record or a different one is stale
11422
+ * unless its weight file hashes to the revision, and a stale copy is
11423
+ * downloaded again, the old one serving until the new one is complete. No
11424
+ * revision at all ⇒ a file on disk is current, whatever it holds (D743).
11425
+ */
11426
+ revision: string().min(1).optional()
11427
+ });
11428
+ /**
11429
+ * What a node holds for one (model, format) (D746). `current` is a complete
11430
+ * copy at its catalog revision — exactly what `downloaded: true` means.
11431
+ * `stale` is bytes on disk that are not (yet) proven current under D743/D744:
11432
+ * no or a different revision record, or a missing sibling. `missing` is no
11433
+ * copy. `downloaded` alone folds `stale` into "not downloaded", which hid
11434
+ * reclaimable bytes and a copy about to be replaced.
11435
+ */
11436
+ var ModelOnDiskStateSchema = _enum([
11437
+ "current",
11438
+ "stale",
11439
+ "missing"
11440
+ ]);
11441
+ /**
11442
+ * The numeric precision of one format's BUILD (D746) — reported only when the
11443
+ * build states it (file-name token, an INT8 variant, an EdgeTPU compile, a
11444
+ * CamStack Core ML export). Absent means "not stated", never "fp32".
11445
+ */
11446
+ var ModelFormatPrecisionSchema = _enum([
11447
+ "fp32",
11448
+ "fp16",
11449
+ "int8"
11450
+ ]);
11451
+ /**
11452
+ * One format of one model as a node's `pipelineExecutor.getSchema` reports it.
11453
+ * `onDisk` / `precision` are optional for version skew: a runner that predates
11454
+ * them omits them, and a reader falls back to `downloaded`.
11455
+ */
11456
+ var PipelineModelFormatStatusSchema = object({
11457
+ downloaded: boolean(),
11458
+ sizeMB: number(),
11459
+ onDisk: ModelOnDiskStateSchema.optional(),
11460
+ precision: ModelFormatPrecisionSchema.optional()
10822
11461
  });
10823
11462
  /**
10824
11463
  * Extra file that must be downloaded alongside the model (e.g., labels JSON, dict.txt).
@@ -10932,25 +11571,36 @@ var ModelLicenseSchema = preprocess((value) => typeof value === "string" ? { wei
10932
11571
  * - `crop`: the root draws the box the step would have found (`license_plate`
10933
11572
  * for plate-detection, `face` for face-detection). The box becomes a detail
10934
11573
  * child of the `parentMacro` detection that contains it — never a track.
11574
+ * - `mask`: the root's decode emits an instance mask with every detection (a
11575
+ * YOLO26-seg root, D737) — the `segmentation` step's result, carried on the
11576
+ * detection in the shape that step produces. Derived from the model's
11577
+ * postprocessor on read, never stored by an import.
10935
11578
  */
10936
- var RootStepSupplySchema = discriminatedUnion("kind", [object({
10937
- kind: literal("label"),
10938
- stepId: _enum(LABEL_SUPPLY_STEP_IDS),
10939
- labelToEffect: record(string(), string()),
10940
- uncovered: array(string()).readonly()
10941
- }), object({
10942
- kind: literal("crop"),
10943
- stepId: _enum(CROP_SUPPLY_STEP_IDS),
10944
- rootLabels: array(string()).readonly(),
10945
- parentMacro: _enum(["vehicle", "person"]),
10946
- childClass: _enum(["plate", "face"]),
10947
- /**
10948
- * The root's smaller input side, stamped on read by `rootSuppliesOf` from
10949
- * the model entry — what a step's `minRootInputPx` gate judges. Never
10950
- * stored by an import.
10951
- */
10952
- rootInputPx: number().int().positive().optional()
10953
- })]);
11579
+ var RootStepSupplySchema = discriminatedUnion("kind", [
11580
+ object({
11581
+ kind: literal("label"),
11582
+ stepId: _enum(LABEL_SUPPLY_STEP_IDS),
11583
+ labelToEffect: record(string(), string()),
11584
+ uncovered: array(string()).readonly()
11585
+ }),
11586
+ object({
11587
+ kind: literal("crop"),
11588
+ stepId: _enum(CROP_SUPPLY_STEP_IDS),
11589
+ rootLabels: array(string()).readonly(),
11590
+ parentMacro: _enum(["vehicle", "person"]),
11591
+ childClass: _enum(["plate", "face"]),
11592
+ /**
11593
+ * The root's smaller input side, stamped on read by `rootSuppliesOf` from
11594
+ * the model entry — what a step's `minRootInputPx` gate judges. Never
11595
+ * stored by an import.
11596
+ */
11597
+ rootInputPx: number().int().positive().optional()
11598
+ }),
11599
+ object({
11600
+ kind: literal("mask"),
11601
+ stepId: _enum(MASK_SUPPLY_STEP_IDS)
11602
+ })
11603
+ ]);
10954
11604
  var ModelCatalogEntrySchema = object({
10955
11605
  id: string(),
10956
11606
  name: string(),
@@ -11016,6 +11666,35 @@ var ModelCatalogEntrySchema = object({
11016
11666
  */
11017
11667
  defaultConfidence: number().min(0).max(1).optional(),
11018
11668
  /**
11669
+ * Per-MODEL default of the per-class confidence floors (`minConfidence<Macro>`
11670
+ * on a detector step), keyed by macro class: `{ person: 0.45 }`. A class
11671
+ * absent here runs at the step slider's global default. The same row shape
11672
+ * the floor measurement produces (`model-floors.json`: modelId → floors), so
11673
+ * a measured table is copied in as-is. An operator override is bound to the
11674
+ * model it was made for and does not survive a model change (D738). A custom
11675
+ * / imported model may declare it; without it, the global defaults apply.
11676
+ */
11677
+ defaultClassFloors: record(string(), number().min(0).max(1)).optional(),
11678
+ /**
11679
+ * The inference precision this model's OpenVINO IR needs on an Intel GPU.
11680
+ * Absent ⇒ the device default (f16 on a GPU). Set to `'f32'` for an FP32 IR
11681
+ * that produces invalid output at f16 — measured 2026-10-07 for YOLO26
11682
+ * base IRs (`yolo26s`: 0 true / 146 false positives; `yolo26m*`: NaN
11683
+ * scores) on the Core Ultra iGPU and the N100. Threaded to the pool as
11684
+ * `PoolModelConfig.gpuInferencePrecision`; the pool sets
11685
+ * INFERENCE_PRECISION_HINT on a GPU only. Costs ~60% latency on the GPU.
11686
+ */
11687
+ gpuInferencePrecision: _enum(["f32", "f16"]).optional(),
11688
+ /**
11689
+ * ROOT detectors only: per supplied step (`animal-classifier`, …), the
11690
+ * minimum DETECTION score from which this root's own fine label (species,
11691
+ * vehicle type — D736 root supply) is taken (D741). Below it the detection
11692
+ * keeps its macro class without the fine label. `1` = never take it from
11693
+ * this root. Absent ⇒ no floor beyond the macro floor. The supplied step's
11694
+ * `minConfidence` slider, bound to the ROOT model, overrides it.
11695
+ */
11696
+ suppliedLabelFloors: record(string(), number().min(0).max(1)).optional(),
11697
+ /**
11019
11698
  * When true, the executor produces a landmark-aligned crop (similarity warp
11020
11699
  * onto the canonical template) before this step runs, instead of a plain
11021
11700
  * axis-aligned bbox crop. Required for face-recognition embedders (ArcFace):
@@ -12688,13 +13367,6 @@ var BrokerRtspClientSchema = object({
12688
13367
  lastRtpAt: number(),
12689
13368
  bytesSent: number()
12690
13369
  });
12691
- var BrokerDecodedClientSchema = object({
12692
- tag: string(),
12693
- subscribedAt: number(),
12694
- maxFps: number(),
12695
- framesDelivered: number(),
12696
- framesDropped: number()
12697
- });
12698
13370
  var BrokerAudioClientSchema = object({
12699
13371
  tag: string(),
12700
13372
  subscribedAt: number(),
@@ -12786,7 +13458,6 @@ var BrokerEncodedClientSchema = object({
12786
13458
  });
12787
13459
  var BrokerClientsSchema = object({
12788
13460
  rtsp: array(BrokerRtspClientSchema).readonly(),
12789
- decoded: array(BrokerDecodedClientSchema).readonly(),
12790
13461
  audio: array(BrokerAudioClientSchema).readonly(),
12791
13462
  encoded: array(BrokerEncodedClientSchema).readonly(),
12792
13463
  pipeClients: number(),
@@ -13155,11 +13826,7 @@ method(object({
13155
13826
  auth: "admin"
13156
13827
  }), method(object({ brokerId: string() }), BrokerClientsSchema), method(object({
13157
13828
  brokerId: string(),
13158
- channel: _enum([
13159
- "rtsp",
13160
- "decoded",
13161
- "audio"
13162
- ]),
13829
+ channel: _enum(["rtsp", "audio"]),
13163
13830
  handle: string()
13164
13831
  }), object({ killed: boolean() }), {
13165
13832
  kind: "mutation",
@@ -13194,10 +13861,7 @@ method(object({
13194
13861
  }), method(SubscribeAudioChunksInputSchema, SubscribeAudioChunksResultSchema, { kind: "mutation" }), method(object({
13195
13862
  subscriptionId: string(),
13196
13863
  maxCount: number().int().positive().default(8)
13197
- }), array(DecodedAudioChunkSchema).readonly()), method(object({ subscriptionId: string() }), object({ released: boolean() }), { kind: "mutation" }), method(SubscribeFramesInputSchema, SubscribeFramesResultSchema, { kind: "mutation" }), method(object({
13198
- subscriptionId: string(),
13199
- maxCount: number().int().positive().default(4)
13200
- }), array(FrameHandleSchema).readonly()), method(object({ subscriptionId: string() }), object({ released: boolean() }), { kind: "mutation" }), method(object({
13864
+ }), array(DecodedAudioChunkSchema).readonly()), method(object({ subscriptionId: string() }), object({ released: boolean() }), { kind: "mutation" }), method(object({
13201
13865
  brokerId: string(),
13202
13866
  seconds: number().min(0).max(30)
13203
13867
  }), _void(), {
@@ -14457,53 +15121,201 @@ id: union([string(), number()]) }), {
14457
15121
  auth: "admin"
14458
15122
  });
14459
15123
  /**
14460
- * shm ring usage stats for a `frameSink: 'shm'` decoder session —
14461
- * exposed via `decoder.getShmStats` so downstream consumers can
14462
- * observe ring pressure (slot count, byte budget, hit/miss ratio).
15124
+ * `keychain` — the hub's encrypted store of secret values (D787).
15125
+ *
15126
+ * Settings blobs never hold a secret: they hold a marker
15127
+ * `{"$secret":"secret://<owner>/<scope>/<fieldPath>","v":1}` and the value
15128
+ * lives here, AES-256-GCM under a data key that a master key wraps. This cap
15129
+ * is the OWNER's door to its own values: every method is owner-checked
15130
+ * against the CALLER, never against anything the caller claims.
15131
+ *
15132
+ * Who the caller is: the transport stamps `callerAddonId` into the args of a
15133
+ * call that crossed a process (the parent `LocalChildRegistry` from the UDS
15134
+ * connection, the agent from its child's connection carried in
15135
+ * `$hub-cap-fwd`'s envelope). A stamp always overwrites; a wire call with no
15136
+ * stamp has its claim stripped. Only a hub in-process caller may state its own
15137
+ * identity — `ctx.secrets` does that with the addon id closed over. This is
15138
+ * identity against BUGS and misrouting, not against a malicious addon (every
15139
+ * runner is the same OS user): see the threat model in
15140
+ * `docs/design/2026-10-08-secrets-keychain.md`.
15141
+ *
15142
+ * `callerAddonId` is deliberately NOT in any input schema: the tRPC router
15143
+ * parses the input, so a session can never supply it, and the internal mount
15144
+ * floors every method to admin anyway (D240).
15145
+ *
15146
+ * Internal: addons reach it through `ctx.secrets`, never directly.
15147
+ */
15148
+ /** Why a value cannot be served right now. Never folded into "missing". */
15149
+ var KeychainUnavailableReasonSchema = _enum([
15150
+ "key-missing",
15151
+ "wrong-key",
15152
+ "key-file-unreadable",
15153
+ "store-unavailable",
15154
+ "not-initialized",
15155
+ "decrypt-failed"
15156
+ ]);
15157
+ var KeychainStateSchema = discriminatedUnion("state", [object({ state: literal("ready") }), object({
15158
+ state: literal("locked"),
15159
+ reason: KeychainUnavailableReasonSchema
15160
+ })]);
15161
+ var KeychainResolveEntrySchema = discriminatedUnion("kind", [
15162
+ object({
15163
+ kind: literal("value"),
15164
+ value: string(),
15165
+ version: number().int()
15166
+ }),
15167
+ object({ kind: literal("missing") }),
15168
+ object({
15169
+ kind: literal("unavailable"),
15170
+ reason: KeychainUnavailableReasonSchema
15171
+ }),
15172
+ object({ kind: literal("forbidden") })
15173
+ ]);
15174
+ var KeychainResolveResultSchema = record(string(), KeychainResolveEntrySchema);
15175
+ /** Metadata of one stored value — never the value. */
15176
+ var KeychainSecretMetaSchema = object({
15177
+ ref: string(),
15178
+ owner: string(),
15179
+ /** Formatted scope (`global`, `node/<id>`, `device/<id>`, …). */
15180
+ scope: string(),
15181
+ fieldPath: string(),
15182
+ version: number().int(),
15183
+ createdAt: number(),
15184
+ updatedAt: number(),
15185
+ /** `addon:<id>` | `user:<id>` | `system`. */
15186
+ updatedBy: string(),
15187
+ /** Coarse — written at most once an hour per ref. `null` = never read. */
15188
+ lastReadAt: number().nullable()
15189
+ });
15190
+ var RefListSchema = array(string().min(1)).max(512);
15191
+ method(object({
15192
+ ref: string().min(1),
15193
+ value: string().min(1)
15194
+ }), object({
15195
+ ref: string(),
15196
+ version: number().int()
15197
+ }), {
15198
+ kind: "mutation",
15199
+ auth: "admin"
15200
+ }), method(object({ refs: RefListSchema }), KeychainResolveResultSchema, { auth: "admin" }), method(object({ refs: RefListSchema }), object({ deleted: number().int() }), {
15201
+ kind: "mutation",
15202
+ auth: "admin"
15203
+ }), method(object({}), array(KeychainSecretMetaSchema).readonly(), { auth: "admin" }), method(object({}), KeychainStateSchema, { auth: "admin" });
15204
+ var KeychainKeySourceSchema = object({
15205
+ kind: _enum([
15206
+ "config-file",
15207
+ "previous-config-file",
15208
+ "platform",
15209
+ "default-file"
15210
+ ]),
15211
+ /** File sources only — a path is not a secret. */
15212
+ path: string().optional(),
15213
+ /**
15214
+ * True when a whole-volume backup of the data directory carries this key
15215
+ * next to the database it protects (the default file). The page warns.
15216
+ */
15217
+ sharesBackupWithDatabase: boolean()
15218
+ });
15219
+ var KeychainStatusSchema = object({
15220
+ keychain: KeychainStateSchema,
15221
+ /** The source of the master key in use; `null` while locked. */
15222
+ keySource: KeychainKeySourceSchema.nullable(),
15223
+ /** The source configured to be primary — differs from `keySource` while a rotation is pending. */
15224
+ configuredSource: KeychainKeySourceSchema,
15225
+ /** Short fingerprint of the master key in use (`HMAC(KEK, label)`, 16 hex). */
15226
+ fingerprint: string().nullable(),
15227
+ activeKeyId: string().nullable(),
15228
+ /**
15229
+ * The keychain unlocked with a NON-primary source: the configured primary
15230
+ * key is not the one that wraps the data key yet. `rotateMasterKey` moves it.
15231
+ */
15232
+ rotationPending: boolean(),
15233
+ /** Wrapped copies of the data key under a previous master key, kept until purged. */
15234
+ retiredWraps: number().int(),
15235
+ recoveryKeyDownloadedAt: number().nullable(),
15236
+ secretCount: number().int()
15237
+ });
15238
+ /**
15239
+ * Whether a stored value is still pointed at by its owner's settings.
15240
+ * `unknown` is a first-class answer: a scope whose blob could not be read is
15241
+ * never reported as an orphan (and never deleted as one).
14463
15242
  */
14464
- var ShmRingStatsSchema = object({
14465
- sessionId: string(),
14466
- slotCount: number().int(),
14467
- slotByteLength: number().int(),
14468
- segmentBytes: number().int(),
14469
- budgetMb: number().int(),
14470
- framesWritten: number().int(),
14471
- getFrameHits: number().int(),
14472
- getFrameMisses: number().int()
14473
- });
14474
- method(object({ codec: string() }), boolean()), method(_void(), object({
15243
+ var KeychainSecretUsageSchema = _enum([
15244
+ "in-use",
15245
+ "orphan",
15246
+ "unknown"
15247
+ ]);
15248
+ var KeychainAdminSecretSchema = KeychainSecretMetaSchema.extend({ usage: KeychainSecretUsageSchema });
15249
+ var KeychainAuditActionSchema = _enum([
15250
+ "put",
15251
+ "delete",
15252
+ "reveal",
15253
+ "rotate-master-key",
15254
+ "purge-retired-keys",
15255
+ "download-recovery-key",
15256
+ "delete-orphans",
15257
+ "reset",
15258
+ "initialize"
15259
+ ]);
15260
+ var KeychainAuditEntrySchema = object({
15261
+ id: string(),
15262
+ at: number(),
15263
+ action: KeychainAuditActionSchema,
15264
+ /** `addon:<id>` | `user:<id>` | `system`. */
15265
+ actor: string(),
15266
+ ref: string().nullable(),
15267
+ detail: string().nullable()
15268
+ });
15269
+ 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({
15270
+ value: string(),
15271
+ version: number().int()
15272
+ }), {
15273
+ kind: "mutation",
15274
+ auth: "admin",
15275
+ caller: "required"
15276
+ }), method(object({ refs: array(string().min(1)).max(1e3) }), object({
15277
+ deleted: array(string()).readonly(),
15278
+ kept: array(object({
15279
+ ref: string(),
15280
+ usage: KeychainSecretUsageSchema
15281
+ })).readonly()
15282
+ }), {
15283
+ kind: "mutation",
15284
+ auth: "admin",
15285
+ caller: "required"
15286
+ }), method(object({}), object({
15287
+ fingerprint: string(),
15288
+ keySource: KeychainKeySourceSchema
15289
+ }), {
15290
+ kind: "mutation",
15291
+ auth: "admin",
15292
+ caller: "required"
15293
+ }), method(object({}), object({ purged: number().int() }), {
15294
+ kind: "mutation",
15295
+ auth: "admin",
15296
+ caller: "required"
15297
+ }), method(object({}), object({
15298
+ key: string(),
15299
+ fingerprint: string(),
15300
+ keySource: KeychainKeySourceSchema
15301
+ }), {
15302
+ kind: "mutation",
15303
+ auth: "admin",
15304
+ caller: "required"
15305
+ }), method(object({ confirm: literal("RESET KEYCHAIN") }), object({
15306
+ archivedCollection: string().nullable(),
15307
+ archived: number().int()
15308
+ }), {
15309
+ kind: "mutation",
15310
+ auth: "admin",
15311
+ caller: "required"
15312
+ });
15313
+ method(_void(), object({
14475
15314
  id: string(),
14476
15315
  name: string(),
14477
- isPullMode: boolean().optional(),
14478
- priority: number().optional(),
14479
15316
  hwaccel: string().optional(),
14480
15317
  probedBestHwaccel: string().optional()
14481
- })), method(DecoderSessionConfigSchema, object({
14482
- sessionId: string(),
14483
- nodeId: string()
14484
- })), method(object({ sessionId: string() }), _void()), method(object({
14485
- sessionId: string(),
14486
- packet: EncodedPacketSchema
14487
- }), _void()), method(object({
14488
- sessionId: string(),
14489
- url: string()
14490
- }), _void()), method(object({
14491
- sessionId: string(),
14492
- maxCount: number().default(1),
14493
- waitMs: number().optional()
14494
- }), array(DecodedFrameSchema)), method(object({
14495
- sessionId: string(),
14496
- maxCount: number().default(1),
14497
- waitMs: number().optional()
14498
- }), array(FrameHandleSchema)), method(object({ handle: FrameHandleSchema }), DecodedFrameSchema.nullable()), method(object({ sessionId: string() }), ShmRingStatsSchema.nullable()), method(object({
14499
- sessionId: string(),
14500
- config: DecoderSessionConfigSchema.partial()
14501
- }), _void()), method(object({ sessionId: string() }), DecoderStatsSchema), method(_void(), array(object({
14502
- sessionId: string(),
14503
- codec: string(),
14504
- outputFormat: string(),
14505
- createdAtMs: number()
14506
- })).readonly()), method(_void(), object({ backend: string() }), {
15318
+ })), method(_void(), object({ backend: string() }), {
14507
15319
  kind: "mutation",
14508
15320
  auth: "admin"
14509
15321
  });
@@ -15616,6 +16428,10 @@ var DeviceInfoSchema = object({
15616
16428
  isCamera: boolean(),
15617
16429
  /** Current config values — serializable snapshot */
15618
16430
  config: record(string(), unknown()),
16431
+ /** Paths inside `config` the device's schema declares secret (D783) —
16432
+ * what the non-admin redaction withholds. Paths, never values. Absent
16433
+ * when the owning runner has not reported them. */
16434
+ secretConfigPaths: array(string()).optional(),
15619
16435
  /** Hardware + identity blob (manufacturer / model / firmware / sn /
15620
16436
  * uid / mac / …). Populated by drivers; editable via setMetadata. */
15621
16437
  metadata: record(string(), unknown()).nullable().optional(),
@@ -15821,12 +16637,22 @@ var DeviceRegisterPayloadSchema = object({
15821
16637
  * call (workers re-register on init), so probe-driven updates
15822
16638
  * (e.g. PTZ flag flipping after the abilities probe) propagate. */
15823
16639
  features: array(string()).optional(),
15824
- config: record(string(), unknown())
16640
+ config: record(string(), unknown()),
16641
+ /** Config paths the device's own schema DECLARES secret
16642
+ * (`.meta({ secret: true })` — dotted, `[]` for array items, e.g.
16643
+ * `connection.password`). Re-published on every register; the non-admin
16644
+ * redaction withholds them at any depth (D783). Optional: an older runner
16645
+ * omits it and the keyword backstop applies. */
16646
+ secretConfigPaths: array(string()).optional()
15825
16647
  });
15826
16648
  var DeviceRemovePayloadSchema = object({ deviceId: number() });
15827
16649
  var DevicePersistConfigPayloadSchema = object({
15828
16650
  deviceId: number(),
15829
- data: record(string(), unknown())
16651
+ data: record(string(), unknown()),
16652
+ /** The paths the device's schema declares secret (D783), when the caller
16653
+ * knows them — those values are kept in the keychain, not the blob (D787).
16654
+ * Absent: the paths the device last reported at `registerDevice` apply. */
16655
+ secretConfigPaths: array(string()).optional()
15830
16656
  });
15831
16657
  /** What a migration actually did, per switch. `unreachable` is a first-class
15832
16658
  * answer: a camera that could not be asked is not a camera that was silenced. */
@@ -17499,7 +18325,14 @@ var LoginMethodContributionSchema = discriminatedUnion("kind", [
17499
18325
  icon: string().optional(),
17500
18326
  /** Addon-owned HTTP route the button navigates to (GET). */
17501
18327
  startUrl: string(),
17502
- stage: LoginStageEnum
18328
+ stage: LoginStageEnum,
18329
+ /**
18330
+ * The provider names an external identity a signed-in user can link to
18331
+ * their own account (D782): `auth.listLinkableProviders` /
18332
+ * `beginExternalLink` offer exactly the redirect methods that set this,
18333
+ * whatever their id. Absent / false — a login button only (magic-link).
18334
+ */
18335
+ linkable: boolean().optional()
17503
18336
  }),
17504
18337
  object({
17505
18338
  kind: literal("widget"),
@@ -21881,8 +22714,8 @@ Object.freeze(Object.fromEntries([{
21881
22714
  var CLUSTER_STEP_SETTING_FIELDS = [{
21882
22715
  stepId: "face-embedding",
21883
22716
  key: "minLandmarkFaceSize",
21884
- label: "Min face size for recognition (detection px)",
21885
- 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.",
22717
+ label: "Min face size to embed (detection-frame px)",
22718
+ 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.",
21886
22719
  type: "slider",
21887
22720
  min: 0,
21888
22721
  max: 64,
@@ -22855,8 +23688,23 @@ var RetrainMacroClassSchema = _enum([
22855
23688
  ]);
22856
23689
  /** A subject to learn, or a phantom to unlearn (taught by OMISSION). */
22857
23690
  var RetrainAnnotationKindSchema = _enum(["subject", "model_error"]);
22858
- /** Did a human draw this box, or did the assist propose it? */
22859
- var RetrainAnnotationSourceSchema = _enum(["operator", "assist"]);
23691
+ /**
23692
+ * Where a box came from. A machine-sourced box is a DRAFT on the page until
23693
+ * the operator confirms it; once saved it keeps its source as provenance.
23694
+ *
23695
+ * - `operator` — drawn by hand.
23696
+ * - `assist` — proposed by a detector run on the copy (the camera's own
23697
+ * model, or a larger teacher model).
23698
+ * - `pipeline` — the box the live pipeline actually drew on that frame, read
23699
+ * back from the track store (never a re-run).
23700
+ * - `llm` — proposed by a vision-capable LLM profile.
23701
+ */
23702
+ var RetrainAnnotationSourceSchema = _enum([
23703
+ "operator",
23704
+ "assist",
23705
+ "pipeline",
23706
+ "llm"
23707
+ ]);
22860
23708
  /** Normalised `[0,1]` rectangle against the FULL frame — the canonical form. */
22861
23709
  var RetrainBboxSchema = object({
22862
23710
  x: number(),
@@ -22874,7 +23722,8 @@ var RetrainBboxSchema = object({
22874
23722
  */
22875
23723
  var RetrainAnnotationSchema = object({
22876
23724
  id: string(),
22877
- trackId: string(),
23725
+ /** The frame's track. Absent on a recording still, which has none. */
23726
+ trackId: string().optional(),
22878
23727
  deviceId: number(),
22879
23728
  /** The COPY in retrain storage — never the source track's media key. */
22880
23729
  mediaKey: string(),
@@ -22923,18 +23772,63 @@ var RetrainFrameCandidateSchema = object({
22923
23772
  * fail, whatever became of the original. */
22924
23773
  copied: boolean()
22925
23774
  });
23775
+ /**
23776
+ * One box the live pipeline drew on a copied frame — what a correction starts
23777
+ * from. Derived when the frame is listed, from the track store: the subject
23778
+ * box recorded on the source media row when there is one, else the track
23779
+ * position nearest the frame's capture time. Never stored as an annotation
23780
+ * until the operator confirms it.
23781
+ */
23782
+ var RetrainPipelineBoxSchema = object({
23783
+ /** Normalised `[0,1]` against the full frame. */
23784
+ bbox: RetrainBboxSchema,
23785
+ macroClass: RetrainMacroClassSchema,
23786
+ label: string().optional(),
23787
+ subLabel: string().optional(),
23788
+ /** The detection score of the position used, when it was recorded. */
23789
+ score: number().optional(),
23790
+ /** The root model that produced the track, when it was recorded. */
23791
+ modelId: string().optional(),
23792
+ trackId: string(),
23793
+ /** `subject-box`: recorded on this very frame. `position`: the track's
23794
+ * position nearest the capture time, `deltaMs` away. */
23795
+ basis: _enum(["subject-box", "position"]),
23796
+ deltaMs: number()
23797
+ });
23798
+ /**
23799
+ * Where a retrain frame came from: a TRACK's stored media (copy-on-select),
23800
+ * or the RECORDING at an instant — the frame a model saw nothing in has no
23801
+ * track at all.
23802
+ */
23803
+ var RetrainFrameOriginSchema = _enum(["track", "recording"]);
22926
23804
  /** A frame the dataset OWNS: bytes copied at selection time. */
22927
23805
  var RetrainFrameSchema = object({
22928
23806
  frameId: string(),
22929
23807
  deviceId: number(),
22930
- trackId: string(),
22931
- /** Provenance only. It may already point at nothing — that is expected. */
22932
- sourceMediaId: number().int(),
23808
+ origin: RetrainFrameOriginSchema,
23809
+ /** The track it was copied from. Absent on a recording still. */
23810
+ trackId: string().optional(),
23811
+ /** Provenance only. It may already point at nothing — that is expected.
23812
+ * Absent on a recording still. */
23813
+ sourceMediaId: number().int().optional(),
23814
+ /** A recording still: the playhead instant it was taken at. */
23815
+ epochMs: number().optional(),
22933
23816
  sourceKind: MediaFileKindEnum,
22934
23817
  sizeBytes: number().int(),
22935
23818
  width: number().int(),
22936
23819
  height: number().int(),
22937
- copiedAt: number()
23820
+ copiedAt: number(),
23821
+ /** When the CAMERA captured the frame. Absent on a copy taken before D785. */
23822
+ capturedAt: number().optional(),
23823
+ /** The operator's "every subject in this frame is boxed". Detector
23824
+ * evaluation keeps only complete frames: an unboxed subject would count as
23825
+ * a false positive. */
23826
+ complete: boolean(),
23827
+ /** The boxes the pipeline drew on this frame. Present on list answers;
23828
+ * empty when nothing the track store holds can be placed on it. */
23829
+ pipelineBoxes: array(RetrainPipelineBoxSchema).readonly().optional(),
23830
+ /** The named collections this frame belongs to. Present on list answers. */
23831
+ collectionIds: array(string()).readonly().optional()
22938
23832
  });
22939
23833
  /** Why a copy-on-select could not be honoured — named, never a silent skip. */
22940
23834
  var RetrainCopyRefusalSchema = _enum([
@@ -22955,6 +23849,53 @@ var RetrainFrameListSchema = object({
22955
23849
  /** What the page pre-selects — the native key frame when one survives. */
22956
23850
  autoPickMediaId: number().int().optional()
22957
23851
  });
23852
+ /**
23853
+ * Which frames an annotated export carries. Every field narrows; an empty
23854
+ * filter is every annotated copy. A dataset VERSION is a frozen `frameIds`
23855
+ * list owned by whoever trains (the training orchestrator), so `frameIds` is
23856
+ * the primitive a version export uses; `batchId` re-selects what an earlier
23857
+ * export carried (`exportedInBatch`).
23858
+ */
23859
+ var RetrainExportFilterSchema = object({
23860
+ deviceIds: array(number()).optional(),
23861
+ frameIds: array(string()).max(2e4).optional(),
23862
+ /** Only frames in at least one of these named collections. */
23863
+ collectionIds: array(string()).max(200).optional(),
23864
+ batchId: string().optional(),
23865
+ /** Only frames the operator marked complete (all subjects boxed). */
23866
+ completeOnly: boolean().optional()
23867
+ });
23868
+ /**
23869
+ * `frames`: the full frame copies, boxes in `annotations.json`.
23870
+ * `crops`: additionally one JPEG per subject, cut with the runtime detail-crop
23871
+ * convention — the classifier layout.
23872
+ */
23873
+ var RetrainExportLayoutSchema = _enum(["frames", "crops"]);
23874
+ /**
23875
+ * Where `writeRetrainArchive` streams the tar: one HTTP request whose body is
23876
+ * the archive, sent chunk by chunk. Covers a presigned PUT and a provider
23877
+ * addon's data-plane upload route alike. Headers are sent verbatim and never
23878
+ * logged.
23879
+ */
23880
+ var RetrainArchiveTargetSchema = object({
23881
+ kind: literal("http"),
23882
+ method: _enum(["PUT", "POST"]),
23883
+ url: string().url(),
23884
+ headers: record(string(), string()).optional()
23885
+ });
23886
+ var RetrainArchiveResultSchema = object({
23887
+ batchId: string(),
23888
+ frames: number().int(),
23889
+ crops: number().int(),
23890
+ annotations: number().int(),
23891
+ /** Frames planned but not shipped (unreadable copy, path too long). */
23892
+ missing: number().int(),
23893
+ bytes: number().int(),
23894
+ /** sha256 of the exact bytes sent. */
23895
+ sha256: string(),
23896
+ /** The target's HTTP status. */
23897
+ status: number().int()
23898
+ });
22958
23899
  /** What the operator asked the assist to look for. */
22959
23900
  var RetrainAssistSubjectSchema = discriminatedUnion("kind", [object({
22960
23901
  kind: literal("package"),
@@ -22984,6 +23925,109 @@ var RetrainAssistResultSchema = discriminatedUnion("kind", [object({
22984
23925
  reason: string(),
22985
23926
  detail: string().optional()
22986
23927
  })]);
23928
+ /** A named set over the retrain corpus — membership only, it owns no pixels. */
23929
+ var RetrainCollectionSchema = object({
23930
+ id: string(),
23931
+ name: string(),
23932
+ createdAt: number(),
23933
+ frameCount: number().int()
23934
+ });
23935
+ var RetrainCollectionCreateResultSchema = discriminatedUnion("kind", [object({
23936
+ kind: literal("created"),
23937
+ collection: RetrainCollectionSchema
23938
+ }), object({
23939
+ kind: literal("refused"),
23940
+ reason: _enum(["empty-name", "duplicate-name"])
23941
+ })]);
23942
+ var RetrainCollectionRenameResultSchema = discriminatedUnion("kind", [object({
23943
+ kind: literal("renamed"),
23944
+ collection: RetrainCollectionSchema
23945
+ }), object({
23946
+ kind: literal("refused"),
23947
+ reason: _enum([
23948
+ "empty-name",
23949
+ "duplicate-name",
23950
+ "unknown-collection"
23951
+ ])
23952
+ })]);
23953
+ /**
23954
+ * The outcome of adding the frame at a recording instant. Every refusal is
23955
+ * named: `still-unavailable` (not recording, a gap, or an undecodable frame —
23956
+ * `detail` says which), `still-busy` (the recorder is at its decode bound; try
23957
+ * again), `unreadable-image`, `write-failed`, `unknown-collection`.
23958
+ */
23959
+ var AddRetrainFrameFromRecordingResultSchema = discriminatedUnion("kind", [object({
23960
+ kind: literal("added"),
23961
+ collectionId: string(),
23962
+ frame: RetrainFrameSchema,
23963
+ /** The moment was already in the dataset; nothing was decoded. */
23964
+ reused: boolean()
23965
+ }), object({
23966
+ kind: literal("refused"),
23967
+ reason: _enum([
23968
+ "unknown-collection",
23969
+ "still-unavailable",
23970
+ "still-busy",
23971
+ "unreadable-image",
23972
+ "write-failed"
23973
+ ]),
23974
+ detail: string().optional()
23975
+ })]);
23976
+ /** A vision LLM profile the AI assist may use, and where it sends the frame. */
23977
+ var RetrainAssistProfileSchema = object({
23978
+ id: string(),
23979
+ name: string(),
23980
+ model: string(),
23981
+ kind: string(),
23982
+ /** `true` when the frame would leave the house (a cloud vendor, or an
23983
+ * endpoint that is not on the local network). The page confirms each such
23984
+ * run, and the provider refuses one without `allowCloud`. */
23985
+ leavesHouse: boolean()
23986
+ });
23987
+ /** A box the AI assist proposed: a draft, plus the model's own reason. */
23988
+ var RetrainLlmProposalSchema = RetrainAnnotationDraftSchema.extend({ reason: string() });
23989
+ /** What the AI assist said about a box that was already on the canvas. */
23990
+ var RetrainLlmReviewSchema = object({
23991
+ /** The `ref` the page sent the box under. */
23992
+ ref: string(),
23993
+ verdict: _enum([
23994
+ "confirmed",
23995
+ "wrong-class",
23996
+ "not-an-object",
23997
+ "uncertain"
23998
+ ]),
23999
+ suggestedClass: RetrainMacroClassSchema.optional(),
24000
+ reason: string()
24001
+ });
24002
+ /**
24003
+ * The AI assist's answer. `proposed` carries drafts (`source: 'llm'`, the
24004
+ * model and its confidence) and reviews; items the model got wrong (a box off
24005
+ * the frame, an unasked class, an unknown ref) are dropped and counted in
24006
+ * `rejected`. A whole answer that is not the schema is `malformed-answer`.
24007
+ */
24008
+ var RetrainLlmAssistResultSchema = discriminatedUnion("kind", [object({
24009
+ kind: literal("proposed"),
24010
+ profileId: string(),
24011
+ model: string(),
24012
+ /** The frame was sent outside the house for this answer. */
24013
+ leftHouse: boolean(),
24014
+ proposals: array(RetrainLlmProposalSchema).readonly(),
24015
+ reviews: array(RetrainLlmReviewSchema).readonly(),
24016
+ rejected: number().int()
24017
+ }), object({
24018
+ kind: literal("refused"),
24019
+ reason: _enum([
24020
+ "unknown-frame",
24021
+ "unreadable-frame",
24022
+ "unknown-profile",
24023
+ "profile-disabled",
24024
+ "no-vision",
24025
+ "cloud-not-confirmed",
24026
+ "llm-error",
24027
+ "malformed-answer"
24028
+ ]),
24029
+ detail: string().optional()
24030
+ })]);
22987
24031
  /** The outcome of a lifecycle move owned by the retrain page. */
22988
24032
  var RetrainTransitionResultSchema = object({
22989
24033
  trackId: string(),
@@ -23701,7 +24745,7 @@ DeviceType.Camera, method(object({ deviceId: number() }), array(TrackSchema).rea
23701
24745
  auth: "admin"
23702
24746
  }), method(object({
23703
24747
  deviceId: number(),
23704
- trackId: string(),
24748
+ trackId: string().optional(),
23705
24749
  frameId: string()
23706
24750
  }), object({
23707
24751
  removed: boolean(),
@@ -23718,7 +24762,8 @@ DeviceType.Camera, method(object({ deviceId: number() }), array(TrackSchema).rea
23718
24762
  auth: "admin"
23719
24763
  }), method(object({
23720
24764
  deviceId: number(),
23721
- trackId: string(),
24765
+ /** The frame's track, when it has one — checked against the frame. */
24766
+ trackId: string().optional(),
23722
24767
  frameId: string(),
23723
24768
  subject: RetrainAssistSubjectSchema,
23724
24769
  /** Which node runs it. Absent ⇒ wherever an unowned call lands. */
@@ -23726,12 +24771,16 @@ DeviceType.Camera, method(object({ deviceId: number() }), array(TrackSchema).rea
23726
24771
  }), RetrainAssistResultSchema, {
23727
24772
  kind: "mutation",
23728
24773
  auth: "admin"
23729
- }), method(object({ trackId: string() }), array(RetrainAnnotationSchema).readonly(), {
24774
+ }), method(object({
24775
+ trackId: string().optional(),
24776
+ frameIds: array(string()).max(2e3).optional()
24777
+ }), array(RetrainAnnotationSchema).readonly(), {
23730
24778
  kind: "query",
23731
24779
  auth: "admin"
23732
24780
  }), method(object({
23733
24781
  deviceId: number(),
23734
- trackId: string(),
24782
+ /** The frame's track, when it has one — checked against the frame. */
24783
+ trackId: string().optional(),
23735
24784
  frameId: string(),
23736
24785
  annotations: array(RetrainAnnotationDraftSchema)
23737
24786
  }), array(RetrainAnnotationSchema).readonly(), {
@@ -23749,7 +24798,91 @@ DeviceType.Camera, method(object({ deviceId: number() }), array(TrackSchema).rea
23749
24798
  }), RetrainTransitionResultSchema, {
23750
24799
  kind: "mutation",
23751
24800
  auth: "admin"
23752
- }), method(object({ deviceIds: array(number()).optional() }), object({ url: string() }), {
24801
+ }), method(RetrainExportFilterSchema.extend({ layout: RetrainExportLayoutSchema.optional() }), object({ url: string() }), {
24802
+ kind: "query",
24803
+ auth: "admin"
24804
+ }), method(object({
24805
+ deviceId: number(),
24806
+ trackId: string().optional(),
24807
+ frameId: string(),
24808
+ complete: boolean()
24809
+ }), RetrainFrameSchema, {
24810
+ kind: "mutation",
24811
+ auth: "admin"
24812
+ }), method(object({
24813
+ filter: RetrainExportFilterSchema,
24814
+ layout: RetrainExportLayoutSchema,
24815
+ target: RetrainArchiveTargetSchema
24816
+ }), RetrainArchiveResultSchema, {
24817
+ kind: "mutation",
24818
+ auth: "admin",
24819
+ timeoutMs: 60 * 6e4
24820
+ }), method(object({}), array(RetrainAssistProfileSchema).readonly(), {
24821
+ kind: "query",
24822
+ auth: "admin"
24823
+ }), method(object({
24824
+ deviceId: number(),
24825
+ trackId: string().optional(),
24826
+ frameId: string(),
24827
+ profileId: string(),
24828
+ classes: array(RetrainMacroClassSchema).min(1),
24829
+ boxes: array(object({
24830
+ ref: string(),
24831
+ bbox: RetrainBboxSchema,
24832
+ macroClass: RetrainMacroClassSchema,
24833
+ label: string().optional()
24834
+ })).max(50),
24835
+ allowCloud: boolean()
24836
+ }), RetrainLlmAssistResultSchema, {
24837
+ kind: "mutation",
24838
+ auth: "admin",
24839
+ timeoutMs: 18e4
24840
+ }), method(object({ name: string().max(120) }), RetrainCollectionCreateResultSchema, {
24841
+ kind: "mutation",
24842
+ auth: "admin"
24843
+ }), method(object({}), array(RetrainCollectionSchema).readonly(), {
24844
+ kind: "query",
24845
+ auth: "admin"
24846
+ }), method(object({
24847
+ id: string(),
24848
+ name: string().max(120)
24849
+ }), RetrainCollectionRenameResultSchema, {
24850
+ kind: "mutation",
24851
+ auth: "admin"
24852
+ }), method(object({ id: string() }), object({
24853
+ deleted: boolean(),
24854
+ removedFrames: number().int()
24855
+ }), {
24856
+ kind: "mutation",
24857
+ auth: "admin"
24858
+ }), method(object({
24859
+ collectionId: string(),
24860
+ deviceId: number(),
24861
+ epochMs: number()
24862
+ }), AddRetrainFrameFromRecordingResultSchema, {
24863
+ kind: "mutation",
24864
+ auth: "admin",
24865
+ timeoutMs: 6e4
24866
+ }), method(object({
24867
+ collectionId: string(),
24868
+ frameIds: array(string()).min(1).max(500)
24869
+ }), object({
24870
+ added: number().int(),
24871
+ alreadyMember: number().int(),
24872
+ unknownFrameIds: array(string()).readonly()
24873
+ }), {
24874
+ kind: "mutation",
24875
+ auth: "admin"
24876
+ }), method(object({
24877
+ collectionId: string(),
24878
+ frameId: string()
24879
+ }), object({
24880
+ removed: boolean(),
24881
+ deletedFrame: boolean()
24882
+ }), {
24883
+ kind: "mutation",
24884
+ auth: "admin"
24885
+ }), method(object({ collectionId: string() }), array(RetrainFrameSchema).readonly(), {
23753
24886
  kind: "query",
23754
24887
  auth: "admin"
23755
24888
  }), method(object({
@@ -23877,7 +25010,7 @@ var FrameRefSchema = object({
23877
25010
  timestamp: number(),
23878
25011
  capturedAt: number().optional()
23879
25012
  });
23880
- var ModelFormatSchema$1 = _enum([
25013
+ var ModelFormatSchema$2 = _enum([
23881
25014
  "onnx",
23882
25015
  "coreml",
23883
25016
  "openvino",
@@ -23895,7 +25028,7 @@ var PipelineSlotSchema = _enum([
23895
25028
  var PipelineEngineChoiceSchema = object({
23896
25029
  runtime: literal("python"),
23897
25030
  backend: string(),
23898
- format: ModelFormatSchema$1,
25031
+ format: ModelFormatSchema$2,
23899
25032
  device: string().optional()
23900
25033
  });
23901
25034
  /**
@@ -23934,28 +25067,10 @@ var PipelineDefaultStepSchema = lazy(() => object({
23934
25067
  group: string().optional(),
23935
25068
  settings: record(string(), unknown()).optional()
23936
25069
  }));
23937
- var PipelineTemplateStepSchema = lazy(() => object({
23938
- addonId: string(),
23939
- enabled: boolean(),
23940
- modelId: string(),
23941
- children: array(PipelineTemplateStepSchema).readonly(),
23942
- settings: record(string(), unknown()).optional()
23943
- }));
23944
- var PipelineTemplateSchema$1 = object({
23945
- id: string(),
23946
- name: string(),
23947
- createdAt: string(),
23948
- updatedAt: string(),
23949
- engine: PipelineEngineChoiceSchema,
23950
- steps: array(PipelineTemplateStepSchema).readonly()
23951
- });
23952
25070
  var PipelineModelOptionSchema = object({
23953
25071
  id: string(),
23954
25072
  name: string(),
23955
- formats: record(string(), object({
23956
- downloaded: boolean(),
23957
- sizeMB: number()
23958
- })),
25073
+ formats: record(string(), PipelineModelFormatStatusSchema),
23959
25074
  group: ModelVariantGroupSchema.optional(),
23960
25075
  legacy: boolean().optional(),
23961
25076
  provider: ModelProviderIdSchema.optional(),
@@ -24122,6 +25237,22 @@ method(_void(), array(PipelineEngineChoiceSchema)), method(_void(), PipelineEngi
24122
25237
  }), {
24123
25238
  kind: "mutation",
24124
25239
  auth: "admin"
25240
+ }), method(object({
25241
+ nodeId: string(),
25242
+ deviceIds: array(number()).readonly().optional(),
25243
+ dryRun: boolean()
25244
+ }), object({
25245
+ entries: array(object({
25246
+ deviceId: number(),
25247
+ keys: array(string()).readonly()
25248
+ })).readonly(),
25249
+ refused: array(object({
25250
+ deviceId: number(),
25251
+ reason: string()
25252
+ })).readonly()
25253
+ }), {
25254
+ kind: "mutation",
25255
+ auth: "admin"
24125
25256
  }), method(object({ nodeId: string() }), object({ unhealthy: array(object({
24126
25257
  /** `<backend>:<device>`, e.g. `openvino:gpu`. */
24127
25258
  deviceKey: string(),
@@ -24147,22 +25278,14 @@ method(_void(), array(PipelineEngineChoiceSchema)), method(_void(), PipelineEngi
24147
25278
  }), method(_void(), PipelineSchemaSchema), method(_void(), array(PipelineDefaultStepSchema).readonly().nullable()), method(_void(), PipelineConfigBridge), method(_void(), ConfigUISchemaBridge), method(object({
24148
25279
  steps: array(PipelineStepInputSchema),
24149
25280
  deviceKey: string().optional()
24150
- }), PipelineValidationResultSchema), method(_void(), array(PipelineTemplateSchema$1).readonly()), method(object({
24151
- name: string(),
24152
- steps: array(PipelineTemplateStepSchema).readonly(),
24153
- engine: PipelineEngineChoiceSchema
24154
- }), PipelineTemplateSchema$1, { kind: "mutation" }), method(object({
24155
- id: string(),
24156
- name: string().optional(),
24157
- steps: array(PipelineTemplateStepSchema).readonly().optional()
24158
- }), PipelineTemplateSchema$1, { kind: "mutation" }), method(object({ id: string() }), _void(), { kind: "mutation" }), method(_void(), InferenceCapabilitiesBridge), method(object({ addonId: string() }), ModelAvailabilityListBridge), method(object({
25281
+ }), PipelineValidationResultSchema), method(_void(), InferenceCapabilitiesBridge), method(object({ addonId: string() }), ModelAvailabilityListBridge), method(object({
24159
25282
  addonId: string(),
24160
25283
  modelId: string(),
24161
- format: ModelFormatSchema$1
25284
+ format: ModelFormatSchema$2
24162
25285
  }), DownloadModelResultSchema, { kind: "mutation" }), method(object({
24163
25286
  addonId: string(),
24164
25287
  modelId: string(),
24165
- format: ModelFormatSchema$1
25288
+ format: ModelFormatSchema$2
24166
25289
  }), object({ success: literal(true) }), { kind: "mutation" }), method(object({
24167
25290
  steps: array(PipelineStepInputSchema).min(1),
24168
25291
  frame: FrameInputSchema.optional(),
@@ -24319,6 +25442,763 @@ method(_void(), array(PipelineEngineChoiceSchema)), method(_void(), PipelineEngi
24319
25442
  filename: string().optional(),
24320
25443
  settings: record(string(), unknown()).optional()
24321
25444
  }), AudioTestResultSchema, { kind: "mutation" }), method(_void(), ConfigUISchemaNullableBridge);
25445
+ /**
25446
+ * The wire shapes of the Auto tune plan and apply (D745), used by the
25447
+ * `pipeline-orchestrator` cap. The recommender's own types
25448
+ * (`recommend.ts`) are the TS face of the same data; these
25449
+ * schemas are what crosses the cap boundary.
25450
+ */
25451
+ var ModelFormatSchema$1 = _enum(MODEL_FORMATS);
25452
+ /** The operator's range for it. */
25453
+ var MIN_SESSIONS_PER_DEVICE_RANGE = {
25454
+ min: 1,
25455
+ max: 8
25456
+ };
25457
+ var HardwareClassIdSchema = _enum([
25458
+ "intel-core-ultra",
25459
+ "intel-n-series",
25460
+ "apple-m-base",
25461
+ "apple-m-pro",
25462
+ "unknown"
25463
+ ]);
25464
+ var AcceleratorKindSchema = _enum([
25465
+ "intel-npu",
25466
+ "intel-igpu",
25467
+ "x86-cpu",
25468
+ "arm-cpu",
25469
+ "apple-ane",
25470
+ "coral"
25471
+ ]);
25472
+ var RecommendationReasonSchema = discriminatedUnion("kind", [
25473
+ object({
25474
+ kind: literal("capacity"),
25475
+ sessions: number(),
25476
+ minSessions: number()
25477
+ }),
25478
+ object({
25479
+ kind: literal("tie-faster"),
25480
+ over: string(),
25481
+ recallDelta: number()
25482
+ }),
25483
+ object({
25484
+ kind: literal("stepped-down"),
25485
+ from: string(),
25486
+ to: string(),
25487
+ limitedBy: string()
25488
+ }),
25489
+ object({
25490
+ kind: literal("no-fit-lightest"),
25491
+ sessions: number(),
25492
+ minSessions: number()
25493
+ }),
25494
+ object({
25495
+ kind: literal("derived-latency"),
25496
+ modelId: string()
25497
+ }),
25498
+ object({ kind: literal("cpu-device") }),
25499
+ object({ kind: literal("coral-untouched") }),
25500
+ object({ kind: literal("device-disabled") }),
25501
+ object({ kind: literal("device-unavailable") }),
25502
+ object({ kind: literal("node-offline") }),
25503
+ object({ kind: literal("no-hardware-facts") }),
25504
+ object({
25505
+ kind: literal("no-measured-data"),
25506
+ hardwareClass: HardwareClassIdSchema
25507
+ }),
25508
+ object({
25509
+ kind: literal("no-family-build"),
25510
+ format: ModelFormatSchema$1
25511
+ }),
25512
+ object({
25513
+ kind: literal("kept-custom-pin"),
25514
+ modelId: string(),
25515
+ deviceKey: string()
25516
+ })
25517
+ ]);
25518
+ /** Why a device is left exactly as it is, whatever the plan would pick (D786). */
25519
+ var KeptReasonSchema = _enum(["custom-pin"]);
25520
+ /**
25521
+ * Where a choice's latency came from (D791): this node's own benchmark
25522
+ * result, or the hardware-class table. Measured on the node beats the table.
25523
+ */
25524
+ var LatencySourceSchema = discriminatedUnion("kind", [object({ kind: literal("table") }), object({
25525
+ kind: literal("node-benchmark"),
25526
+ resultId: string(),
25527
+ measuredAtMs: number()
25528
+ })]);
25529
+ var DeviceModelChoiceSchema = object({
25530
+ modelId: string(),
25531
+ p50Ms: number(),
25532
+ fps: number(),
25533
+ measured: boolean(),
25534
+ /** Absent on a plan from before D791 — read as the table. */
25535
+ source: LatencySourceSchema.optional(),
25536
+ /** Parallel sessions at the camera rate with the headroom kept free: ⌊fps × (1 − headroom) / camera fps⌋. */
25537
+ capacitySessions: number(),
25538
+ personRecall: number()
25539
+ });
25540
+ var DeviceRecommendationSchema = object({
25541
+ deviceKey: string(),
25542
+ accelerator: AcceleratorKindSchema.nullable(),
25543
+ enabled: boolean(),
25544
+ available: boolean(),
25545
+ chosen: DeviceModelChoiceSchema.nullable(),
25546
+ /** Present when the device is kept as is: Apply writes nothing on it. */
25547
+ kept: KeptReasonSchema.optional(),
25548
+ reasons: array(RecommendationReasonSchema).readonly()
25549
+ });
25550
+ var NodeRecommendationSchema = object({
25551
+ nodeId: string(),
25552
+ reachable: boolean(),
25553
+ hardwareClass: HardwareClassIdSchema.nullable(),
25554
+ cpuModel: string().nullable(),
25555
+ skipped: boolean(),
25556
+ acceleratorModelId: string().nullable(),
25557
+ devices: array(DeviceRecommendationSchema).readonly(),
25558
+ reasons: array(RecommendationReasonSchema).readonly()
25559
+ });
25560
+ var ModelPinChangeSchema = object({
25561
+ stepId: string(),
25562
+ before: string().nullable(),
25563
+ after: string().nullable()
25564
+ });
25565
+ var NodeDeviceChangeSchema = object({
25566
+ nodeId: string(),
25567
+ deviceKey: string(),
25568
+ madeExplicit: boolean(),
25569
+ modelPins: array(ModelPinChangeSchema).readonly(),
25570
+ thresholds: array(object({
25571
+ stepId: string(),
25572
+ keys: array(string()).readonly()
25573
+ })).readonly()
25574
+ });
25575
+ var CameraOverrideClearSchema = object({
25576
+ deviceId: number(),
25577
+ source: _enum(["step-override", "wholesale"]),
25578
+ nodeId: string(),
25579
+ deviceKey: string().nullable(),
25580
+ stepId: string(),
25581
+ modelIdBefore: string().nullable(),
25582
+ keys: array(string()).readonly()
25583
+ });
25584
+ var DetectorStoreClearSchema = object({
25585
+ deviceId: number(),
25586
+ keys: array(string()).readonly()
25587
+ });
25588
+ var AutoTuneWarningSchema = discriminatedUnion("kind", [
25589
+ object({
25590
+ kind: literal("detector-store-cluster-wide"),
25591
+ skippedNodes: array(string()).readonly()
25592
+ }),
25593
+ object({
25594
+ kind: literal("detector-store-unreadable"),
25595
+ error: string()
25596
+ }),
25597
+ object({
25598
+ kind: literal("coral-enabled"),
25599
+ nodeId: string(),
25600
+ deviceKey: string()
25601
+ }),
25602
+ object({
25603
+ kind: literal("custom-pin-kept"),
25604
+ nodeId: string(),
25605
+ deviceKey: string().nullable(),
25606
+ deviceId: number().nullable(),
25607
+ modelId: string()
25608
+ }),
25609
+ object({
25610
+ kind: literal("custom-registry-unreadable"),
25611
+ error: string()
25612
+ })
25613
+ ]);
25614
+ var AutoTuneOptionsSchema = object({
25615
+ /** Share of each accelerator's throughput kept free (0.3–0.5). */
25616
+ headroom: number().min(.3).max(.5).default(.4),
25617
+ /**
25618
+ * The least number of parallel sessions every device must sustain at the
25619
+ * camera rate with the headroom kept free (D755). The most accurate model
25620
+ * that reaches it wins.
25621
+ */
25622
+ minSessionsPerDevice: number().int().min(MIN_SESSIONS_PER_DEVICE_RANGE.min).max(MIN_SESSIONS_PER_DEVICE_RANGE.max).default(2)
25623
+ });
25624
+ var AutoTunePlanSchema = object({
25625
+ /** Hash of everything the apply will write — the apply refuses a different one. */
25626
+ planHash: string(),
25627
+ family: literal("yolov9"),
25628
+ headroom: number(),
25629
+ minSessionsPerDevice: number(),
25630
+ /** The detection rate a session is counted at (the fastest camera running the pipeline root). */
25631
+ cameraFps: number(),
25632
+ generatedAt: number(),
25633
+ nodes: array(NodeRecommendationSchema).readonly(),
25634
+ nodeChanges: array(NodeDeviceChangeSchema).readonly(),
25635
+ cameraClears: array(CameraOverrideClearSchema).readonly(),
25636
+ detectorStoreClears: array(DetectorStoreClearSchema).readonly(),
25637
+ warnings: array(AutoTuneWarningSchema).readonly()
25638
+ });
25639
+ var AutoTuneApplyInputSchema = object({
25640
+ planHash: string(),
25641
+ headroom: number().min(.3).max(.5).default(.4),
25642
+ minSessionsPerDevice: number().int().min(MIN_SESSIONS_PER_DEVICE_RANGE.min).max(MIN_SESSIONS_PER_DEVICE_RANGE.max).default(2)
25643
+ });
25644
+ var AutoTunePhaseResultSchema = object({
25645
+ phase: _enum([
25646
+ "download",
25647
+ "camera-overrides",
25648
+ "detector-thresholds",
25649
+ "node-models",
25650
+ "redispatch"
25651
+ ]),
25652
+ ok: boolean(),
25653
+ detail: string()
25654
+ });
25655
+ var AutoTuneApplyResultSchema = discriminatedUnion("kind", [
25656
+ object({
25657
+ kind: literal("applied"),
25658
+ planHash: string(),
25659
+ phases: array(AutoTunePhaseResultSchema).readonly()
25660
+ }),
25661
+ object({
25662
+ kind: literal("aborted"),
25663
+ phases: array(AutoTunePhaseResultSchema).readonly()
25664
+ }),
25665
+ object({
25666
+ kind: literal("stale"),
25667
+ plan: AutoTunePlanSchema
25668
+ }),
25669
+ object({
25670
+ kind: literal("refused"),
25671
+ reason: _enum(["apply-in-progress"])
25672
+ })
25673
+ ]);
25674
+ /**
25675
+ * Wire shapes of the Load balancing surface (D748): the session placement
25676
+ * policy, the atomic share write, the observed placement statistics, the
25677
+ * hardware share suggestion and the stale device pins.
25678
+ */
25679
+ /**
25680
+ * How a new detection session picks its node and device.
25681
+ * - `least-loaded` — the historical rule: lowest `attached / weight`, a
25682
+ * constant node order at a tie (D37). An idle node always ties at 0, so a
25683
+ * weight only bites once a node already holds a session.
25684
+ * - `share` — the share of PARALLEL sessions is held to the weights, and a
25685
+ * full or drowning node yields to a free one (D748).
25686
+ */
25687
+ var SessionPlacementPolicySchema = _enum(["least-loaded", "share"]);
25688
+ var LoadBalancingSharesInputSchema = object({
25689
+ /** nodeId → share (> 0). A node left out keeps its weight. */
25690
+ nodes: record(string(), number().positive()).default({}),
25691
+ /** nodeId → deviceKey → share (> 0). A device left out keeps its weight. */
25692
+ devices: record(string(), record(string(), number().positive())).default({})
25693
+ });
25694
+ var PlacementStatsInputSchema = object({
25695
+ /** Window the observed shares are averaged over (default 1 h, max 24 h). */
25696
+ windowMs: number().int().min(6e4).max(1440 * 60 * 1e3).default(3600 * 1e3) });
25697
+ var PlacementDeviceStatsSchema = object({
25698
+ deviceKey: string(),
25699
+ /** Sessions running on this device now. */
25700
+ sessionsNow: number(),
25701
+ /** Sessions started on this device inside the window. */
25702
+ sessionsStarted: number(),
25703
+ /** Time-weighted share of the node's parallel sessions over the window (0–1); null = no session ran. */
25704
+ observedShare: number().nullable()
25705
+ });
25706
+ var PlacementNodeStatsSchema = object({
25707
+ nodeId: string(),
25708
+ sessionsNow: number(),
25709
+ sessionsStarted: number(),
25710
+ /** Time-weighted share of the cluster's parallel sessions over the window (0–1); null = none ran. */
25711
+ observedShare: number().nullable(),
25712
+ /** Most sessions this node ran at once inside the window. */
25713
+ peakSessions: number(),
25714
+ /** Sessions a share election handed elsewhere because this node was full or drowning. */
25715
+ yieldsAway: number(),
25716
+ devices: array(PlacementDeviceStatsSchema).readonly()
25717
+ });
25718
+ /** A camera's device pin that the session path cannot honour. */
25719
+ var StaleDevicePinSchema = object({
25720
+ deviceId: number(),
25721
+ deviceKey: string(),
25722
+ /** `disabled` — the key exists on some node but is not enabled anywhere; `absent` — no node has it. */
25723
+ reason: _enum(["disabled", "absent"])
25724
+ });
25725
+ var PlacementStatsSchema = object({
25726
+ policy: SessionPlacementPolicySchema,
25727
+ windowMs: number(),
25728
+ /** How much of the window was actually observed (the hub keeps it in memory). */
25729
+ observedForMs: number(),
25730
+ sessionsNow: number(),
25731
+ /** Most parallel sessions across the cluster inside the window. */
25732
+ clusterPeakSessions: number(),
25733
+ nodes: array(PlacementNodeStatsSchema).readonly(),
25734
+ stalePins: array(StaleDevicePinSchema).readonly()
25735
+ });
25736
+ /**
25737
+ * Where an automatic share's capacity comes from (D755).
25738
+ * - `hardware` — the static capacity of each device at its Auto tune model:
25739
+ * the measured latency table for the node's hardware class.
25740
+ * - `benchmark` — the node's own measured capacity (node benchmark results).
25741
+ * A node with no results falls back to `hardware`, and says so.
25742
+ */
25743
+ var CapacitySourceSchema = _enum(["hardware", "benchmark"]);
25744
+ /** Why a node under the `benchmark` source was sized from hardware instead. */
25745
+ var CapacityFallbackSchema = _enum(["no-benchmark-results", "partial-benchmark-results"]);
25746
+ var SuggestSharesInputSchema = object({
25747
+ headroom: number().min(.3).max(.5).default(.4),
25748
+ /** Default `hardware`. */
25749
+ source: CapacitySourceSchema.default("hardware")
25750
+ });
25751
+ var SuggestedDeviceShareSchema = object({
25752
+ deviceKey: string(),
25753
+ /** Share of the node (0–100, rounded). */
25754
+ share: number(),
25755
+ modelId: string().nullable(),
25756
+ /** Inferences per second at that model, from the measured table; null when sized by a benchmark. */
25757
+ fps: number().nullable(),
25758
+ /** False for a table cell derived from another chip; true for a measured cell or a benchmark. */
25759
+ measured: boolean(),
25760
+ /**
25761
+ * Advisory session cap: ⌊fps × (1 − headroom) / camera fps⌋ from the table,
25762
+ * or the benchmark's measured max sessions. Never enforced.
25763
+ */
25764
+ suggestedMaxSessions: number().nullable()
25765
+ });
25766
+ var SuggestedNodeShareSchema = object({
25767
+ nodeId: string(),
25768
+ /** Share of the cluster (0–100, rounded); null = node skipped (offline, unknown hardware). */
25769
+ share: number().nullable(),
25770
+ /** Parallel sessions the node sustains at the suggested models with the headroom kept free. */
25771
+ capacitySessions: number(),
25772
+ devices: array(SuggestedDeviceShareSchema).readonly(),
25773
+ skippedReason: string().nullable(),
25774
+ /** What this node's capacity was read from; null when the node is skipped. */
25775
+ capacitySource: CapacitySourceSchema.nullable(),
25776
+ /** Set when the `benchmark` source was asked for and this node used `hardware`. */
25777
+ capacityFallback: CapacityFallbackSchema.nullable()
25778
+ });
25779
+ var SuggestSharesResultSchema = object({
25780
+ headroom: number(),
25781
+ /** The source asked for; each node says what it actually used. */
25782
+ source: CapacitySourceSchema,
25783
+ /** Camera detection rate the capacity is counted in (the fastest camera's fps). */
25784
+ cameraFps: number(),
25785
+ /** The Auto tune capacity floor the models were picked at. */
25786
+ minSessionsPerDevice: number(),
25787
+ nodes: array(SuggestedNodeShareSchema).readonly()
25788
+ });
25789
+ /**
25790
+ * Where the node and device shares come from (D750, D755, D791).
25791
+ * - `benchmark` (default since D791) — each node's capacity as its own node
25792
+ * benchmark measured it; a node without fresh results is sized from
25793
+ * `hardware` and says so. Measured on the node beats the table.
25794
+ * - `hardware` — computed from each node's static capacity only (its
25795
+ * accelerators at their Auto tune models, from the latency table).
25796
+ * Both are recomputed whenever a node or device joins, leaves, is switched
25797
+ * on or off, changes model, or a benchmark result is written. No load input.
25798
+ * - `manual` — the operator's stored sliders.
25799
+ * Either way a node or device that cannot take sessions gives its share to
25800
+ * the others in proportion; the stored values are never rewritten for that.
25801
+ */
25802
+ var ShareSourceSchema = _enum([
25803
+ "hardware",
25804
+ "benchmark",
25805
+ "manual"
25806
+ ]);
25807
+ var SetShareSourceInputSchema = object({ source: ShareSourceSchema });
25808
+ object({
25809
+ nodes: record(string(), number()),
25810
+ devices: record(string(), record(string(), number()))
25811
+ });
25812
+ var EffectiveDeviceShareSchema = object({
25813
+ deviceKey: string(),
25814
+ /** Can take sessions now (enabled, available, can run the root). */
25815
+ eligible: boolean(),
25816
+ /** The share the source assigns, as a percentage of the node's devices. */
25817
+ configuredPct: number(),
25818
+ /** The share actually used, after an ineligible device's share went to the others. */
25819
+ effectivePct: number()
25820
+ });
25821
+ var EffectiveNodeShareSchema = object({
25822
+ nodeId: string(),
25823
+ eligible: boolean(),
25824
+ configuredPct: number(),
25825
+ effectivePct: number(),
25826
+ /** Automatic sources: what this node's share was computed from; null under `manual` or before the first answer. */
25827
+ capacitySource: CapacitySourceSchema.nullable(),
25828
+ /** Automatic `benchmark`: why this node used `hardware` instead. */
25829
+ capacityFallback: CapacityFallbackSchema.nullable(),
25830
+ devices: array(EffectiveDeviceShareSchema).readonly()
25831
+ });
25832
+ var EffectiveSharesSchema = object({
25833
+ source: ShareSourceSchema,
25834
+ policy: SessionPlacementPolicySchema,
25835
+ /** An automatic source with no computed answer yet: the stored sliders are used meanwhile. */
25836
+ autoPending: boolean(),
25837
+ /** When the automatic shares were last computed (ms epoch); null = never. */
25838
+ computedAt: number().nullable(),
25839
+ /** What made the system recompute them last. */
25840
+ trigger: string().nullable(),
25841
+ nodes: array(EffectiveNodeShareSchema).readonly(),
25842
+ /** The relative weights the election reads (before eligibility). */
25843
+ nodeWeights: record(string(), number()),
25844
+ deviceWeights: record(string(), record(string(), number()))
25845
+ });
25846
+ /**
25847
+ * Wire shapes of the node benchmark (D791): the operator's plan, the
25848
+ * preflight the confirmation shows, the run the orchestrator owns, what the
25849
+ * measuring runner reports, and the result rows Auto tune and the automatic
25850
+ * shares read.
25851
+ *
25852
+ * ONE node at a time, owned by the pipeline orchestrator. While a run is
25853
+ * active the cluster is in BENCHMARK MODE for that node: it is not a
25854
+ * detection candidate, camera pins naming it are ignored so its sessions move
25855
+ * elsewhere, and both come back when the mode ends — after a crash or a hub
25856
+ * restart too (a persisted manifest, reconciled against the registry).
25857
+ *
25858
+ * Two measurements, both on the node, driven by its own runner (frames never
25859
+ * cross a process at frame rate, D9):
25860
+ * - `device` — one accelerator × one candidate detector, root only, open
25861
+ * loop: how many streams at the camera rate it carries inside the frame
25862
+ * interval;
25863
+ * - `pipeline` — the chosen detector plus the operator's detail steps
25864
+ * (faces, plates, classifiers, CLIP…), on varied frames from the bench
25865
+ * clip: how many parallel sessions the node carries before latency, drops,
25866
+ * CPU, RAM or the event loop give out.
25867
+ */
25868
+ /** Defaults and bounds, one place. */
25869
+ var NODE_BENCHMARK_DEFAULTS = {
25870
+ fpsPerStream: 10,
25871
+ budgetMinutes: 45,
25872
+ minBudgetMinutes: 10,
25873
+ maxBudgetMinutes: 120,
25874
+ /** A result older than this no longer beats the table. */
25875
+ staleAfterDays: 30,
25876
+ /** Warm-in per ramp step (not accounted). */
25877
+ settleSec: 5,
25878
+ /** Accounted window per ramp step. */
25879
+ measureSec: 20,
25880
+ /** Longest the drain may take before the run is refused. */
25881
+ drainTimeoutSec: 120,
25882
+ /** Candidate models per device in one run. */
25883
+ maxModelsPerDevice: 6
25884
+ };
25885
+ /** The two measurements a run can make. */
25886
+ var NodeBenchmarkPhaseSchema = _enum(["device", "pipeline"]);
25887
+ var NodeBenchmarkDevicePlanSchema = object({
25888
+ /** `<backend>:<device>` — `openvino:npu`, `coreml:all`, `cpu`. */
25889
+ deviceKey: string().min(1),
25890
+ /**
25891
+ * Root detector candidates for the `device` measurement, in the order
25892
+ * measured. The FIRST is the one the `pipeline` measurement runs.
25893
+ */
25894
+ modelIds: array(string().min(1)).min(1).max(NODE_BENCHMARK_DEFAULTS.maxModelsPerDevice)
25895
+ });
25896
+ /** What the operator confirmed. */
25897
+ var NodeBenchmarkPlanSchema = object({
25898
+ nodeId: string().min(1),
25899
+ devices: array(NodeBenchmarkDevicePlanSchema).min(1),
25900
+ /** Which measurements run. At least one. */
25901
+ phases: array(NodeBenchmarkPhaseSchema).min(1).default(["device", "pipeline"]),
25902
+ /**
25903
+ * Detail steps (catalog step ids under the root: faces, plates,
25904
+ * classifiers, CLIP…) the `pipeline` measurement enables. The root
25905
+ * detector always runs.
25906
+ */
25907
+ steps: array(string().min(1)).default([]),
25908
+ /** Offered rate of one stream / session. */
25909
+ fpsPerStream: number().int().min(1).max(30).default(NODE_BENCHMARK_DEFAULTS.fpsPerStream),
25910
+ /** Hard deadline: the mode ends and the cluster is restored when it passes. */
25911
+ budgetMinutes: number().int().min(NODE_BENCHMARK_DEFAULTS.minBudgetMinutes).max(NODE_BENCHMARK_DEFAULTS.maxBudgetMinutes).default(NODE_BENCHMARK_DEFAULTS.budgetMinutes),
25912
+ /** Keep the models the run downloaded (default: delete what was not installed before). */
25913
+ keepDownloadedModels: boolean().default(false),
25914
+ /** Start although the other nodes' capacity does not cover the sessions running now. */
25915
+ acceptInsufficientHeadroom: boolean().default(false)
25916
+ });
25917
+ var NodeBenchmarkRefusalSchema = object({
25918
+ kind: _enum([
25919
+ "benchmark-active",
25920
+ "node-offline",
25921
+ "unknown-device",
25922
+ "no-phase",
25923
+ "insufficient-headroom"
25924
+ ]),
25925
+ detail: string(),
25926
+ overridable: boolean()
25927
+ });
25928
+ /** A camera whose detection leaves the node for the run. */
25929
+ var NodeBenchmarkMovingCameraSchema = object({
25930
+ deviceId: number(),
25931
+ /** Placed on the node now (a standing attach or a running session). */
25932
+ placedOnNode: boolean(),
25933
+ /** A node pin naming this node, ignored for the run. */
25934
+ pinnedToNode: boolean()
25935
+ });
25936
+ /** A camera that cannot leave: no other node can obtain its frames. */
25937
+ var NodeBenchmarkStayingCameraSchema = object({
25938
+ deviceId: number(),
25939
+ reason: literal("only-frame-source")
25940
+ });
25941
+ var NodeBenchmarkPreflightSchema = object({
25942
+ nodeId: string(),
25943
+ online: boolean(),
25944
+ moving: array(NodeBenchmarkMovingCameraSchema).readonly(),
25945
+ /** Keep running on the node during the run; the result is flagged contaminated. */
25946
+ staying: array(NodeBenchmarkStayingCameraSchema).readonly(),
25947
+ estimatedDurationMs: number(),
25948
+ /** The run ends and the cluster is restored at the latest after this long. */
25949
+ budgetMs: number(),
25950
+ phases: array(NodeBenchmarkPhaseSchema).readonly(),
25951
+ steps: array(string()).readonly(),
25952
+ devices: array(NodeBenchmarkDevicePlanSchema).readonly(),
25953
+ /** Parallel sessions the cluster runs now, and what the other nodes can carry. */
25954
+ headroom: object({
25955
+ sessionsNow: number(),
25956
+ otherNodesCapacitySessions: number().nullable()
25957
+ }),
25958
+ refusals: array(NodeBenchmarkRefusalSchema).readonly(),
25959
+ canStart: boolean()
25960
+ });
25961
+ /** Where the measuring runner is. */
25962
+ var NodeBenchProgressSchema = object({
25963
+ phase: _enum([
25964
+ "preparing",
25965
+ "device",
25966
+ "pipeline",
25967
+ "cleanup"
25968
+ ]),
25969
+ deviceKey: string().nullable(),
25970
+ modelId: string().nullable(),
25971
+ /** Streams (device) or sessions (pipeline) of the step running now. */
25972
+ load: number().nullable(),
25973
+ cellsDone: number(),
25974
+ cellsTotal: number(),
25975
+ message: string()
25976
+ });
25977
+ /** What limited a ramp. `none` = the ramp ran out of steps still passing. */
25978
+ var NodeBenchLimitSchema = _enum([
25979
+ "p95",
25980
+ "drops",
25981
+ "errors",
25982
+ "stall",
25983
+ "cpu",
25984
+ "ram",
25985
+ "none"
25986
+ ]);
25987
+ var NodeBenchRampStepSchema = object({
25988
+ load: number(),
25989
+ pass: boolean(),
25990
+ p95Ms: number(),
25991
+ dropRatio: number(),
25992
+ /** Completed frames per second over the accounted window. */
25993
+ fps: number(),
25994
+ cpuPct: number().nullable(),
25995
+ ramFreePct: number().nullable(),
25996
+ failReasons: array(string()).readonly()
25997
+ });
25998
+ var NodeBenchCellSchema = discriminatedUnion("phase", [object({
25999
+ phase: literal("device"),
26000
+ deviceKey: string(),
26001
+ modelId: string(),
26002
+ /** Single-stream latency (the K = 1 step). */
26003
+ p50Ms: number(),
26004
+ p95Ms: number(),
26005
+ p99Ms: number(),
26006
+ /** Frames per second sustained at the last passing step. */
26007
+ fps: number(),
26008
+ /** Streams at the camera rate the device carried inside the frame interval; 0 = not even one. */
26009
+ kMax: number(),
26010
+ limitedBy: NodeBenchLimitSchema,
26011
+ /** First call (model load + warm-up). */
26012
+ warmupMs: number(),
26013
+ ramp: array(NodeBenchRampStepSchema).readonly()
26014
+ }), object({
26015
+ phase: literal("pipeline"),
26016
+ deviceKey: string(),
26017
+ modelId: string(),
26018
+ steps: array(string()).readonly(),
26019
+ /** Parallel sessions at the camera rate the node carried; 0 = not even one. */
26020
+ maxSessions: number(),
26021
+ limitedBy: NodeBenchLimitSchema,
26022
+ /** Detail steps that produced at least one result on the clip — a step that never fired measured nothing. */
26023
+ stepsFired: array(string()).readonly(),
26024
+ warmupMs: number(),
26025
+ ramp: array(NodeBenchRampStepSchema).readonly()
26026
+ })]);
26027
+ /**
26028
+ * What a result was measured ON. A result whose fingerprint no longer matches
26029
+ * the node no longer beats the table.
26030
+ */
26031
+ var NodeBenchFingerprintSchema = object({
26032
+ pipelineVersion: string().nullable(),
26033
+ cpuModel: string().nullable(),
26034
+ ramGb: number().nullable(),
26035
+ os: string().nullable(),
26036
+ /** Per device: the pool the cells ran on (runtime + tuning). */
26037
+ pools: record(string(), object({
26038
+ runtime: string(),
26039
+ numWorkers: number(),
26040
+ concurrency: number(),
26041
+ batchMode: string()
26042
+ })).default({})
26043
+ });
26044
+ /** The frames the run used. */
26045
+ var NodeBenchClipSchema = object({
26046
+ /** `camstack-bench-v1` or `reference-images` (the fallback when the clip is not reachable). */
26047
+ id: string(),
26048
+ revision: string().nullable(),
26049
+ frames: number(),
26050
+ width: number(),
26051
+ height: number()
26052
+ });
26053
+ var NodeBenchRunnerInputSchema = object({
26054
+ runId: string().min(1),
26055
+ devices: array(NodeBenchmarkDevicePlanSchema).min(1),
26056
+ phases: array(NodeBenchmarkPhaseSchema).min(1),
26057
+ /** The full detail step tree root for the `pipeline` measurement is built on the node from these ids. */
26058
+ steps: array(string()).default([]),
26059
+ fpsPerStream: number().int().min(1).max(30),
26060
+ /** The runner stops on its own past this instant, whatever the hub does. */
26061
+ deadlineAtMs: number(),
26062
+ settleSec: number().min(0).max(60).default(NODE_BENCHMARK_DEFAULTS.settleSec),
26063
+ measureSec: number().min(2).max(300).default(NODE_BENCHMARK_DEFAULTS.measureSec),
26064
+ keepDownloadedModels: boolean().default(false)
26065
+ });
26066
+ var NodeBenchRunnerStateSchema = _enum([
26067
+ "running",
26068
+ "done",
26069
+ "failed",
26070
+ "aborted"
26071
+ ]);
26072
+ var NodeBenchRunnerStatusSchema = object({
26073
+ runId: string(),
26074
+ nodeId: string(),
26075
+ state: NodeBenchRunnerStateSchema,
26076
+ progress: NodeBenchProgressSchema.nullable(),
26077
+ /** Every finished cell so far — a run stopped half way keeps what it measured. */
26078
+ cells: array(NodeBenchCellSchema).readonly(),
26079
+ fingerprint: NodeBenchFingerprintSchema.nullable(),
26080
+ clip: NodeBenchClipSchema.nullable(),
26081
+ /** Cameras seen running on the node during the run (they share its pools). */
26082
+ activeCameraIds: array(number()).readonly(),
26083
+ /** Models the run downloaded and then deleted (not installed before). */
26084
+ deletedModels: array(string()).readonly(),
26085
+ error: string().nullable(),
26086
+ startedAtMs: number(),
26087
+ finishedAtMs: number().nullable()
26088
+ });
26089
+ var NodeBenchmarkStateSchema = _enum([
26090
+ "draining",
26091
+ "measuring",
26092
+ "restoring",
26093
+ "done",
26094
+ "failed",
26095
+ "aborted"
26096
+ ]);
26097
+ /** Why a run ended. */
26098
+ var NodeBenchmarkEndReasonSchema = _enum([
26099
+ "completed",
26100
+ "operator-abort",
26101
+ "deadline",
26102
+ "node-lost",
26103
+ "runner-lost",
26104
+ "hub-restart",
26105
+ "drain-timeout",
26106
+ "failed"
26107
+ ]);
26108
+ var NodeBenchmarkRunSchema = object({
26109
+ runId: string(),
26110
+ nodeId: string(),
26111
+ state: NodeBenchmarkStateSchema,
26112
+ plan: NodeBenchmarkPlanSchema,
26113
+ startedAtMs: number(),
26114
+ deadlineAtMs: number(),
26115
+ finishedAtMs: number().nullable(),
26116
+ endReason: NodeBenchmarkEndReasonSchema.nullable(),
26117
+ error: string().nullable(),
26118
+ /** Cameras moved off the node for the run. */
26119
+ moved: array(number()).readonly(),
26120
+ /** Cameras that stayed (their only frame source is the node). */
26121
+ staying: array(number()).readonly(),
26122
+ /** Something else ran on the node's pools during the run. */
26123
+ contaminated: boolean(),
26124
+ progress: NodeBenchProgressSchema.nullable(),
26125
+ resultIds: array(string()).readonly()
26126
+ });
26127
+ /** `getNodeBenchmarkStatus`: the active run (or the last one), and whether benchmark mode is on. */
26128
+ var NodeBenchmarkStatusSchema = object({
26129
+ /** The node the cluster is in benchmark mode for; null = none. */
26130
+ modeNodeId: string().nullable(),
26131
+ run: NodeBenchmarkRunSchema.nullable()
26132
+ });
26133
+ /**
26134
+ * One stored measurement — the only authority Auto tune and the automatic
26135
+ * shares read measured capacity from. Written by the orchestrator when a run
26136
+ * ends, never by anyone else.
26137
+ */
26138
+ var NodeBenchmarkResultSchema = object({
26139
+ id: string(),
26140
+ runId: string(),
26141
+ nodeId: string(),
26142
+ cell: NodeBenchCellSchema,
26143
+ fpsPerStream: number(),
26144
+ fingerprint: NodeBenchFingerprintSchema.nullable(),
26145
+ clip: NodeBenchClipSchema.nullable(),
26146
+ /** Other work shared the node's pools (a camera that could not move, or the hub's own duties). */
26147
+ contaminated: boolean(),
26148
+ stayingCameras: array(number()).readonly(),
26149
+ /** The run ended early; the cell itself completed. */
26150
+ partialRun: boolean(),
26151
+ measuredAtMs: number()
26152
+ });
26153
+ var ListNodeBenchmarkResultsInputSchema = object({
26154
+ nodeId: string().optional(),
26155
+ deviceKey: string().optional()
26156
+ });
26157
+ /** A result with its standing today: does it still beat the table? */
26158
+ var NodeBenchmarkResultViewSchema = NodeBenchmarkResultSchema.extend({
26159
+ /** `fresh` beats the table; `stale` falls back to it; `superseded` = a newer row covers the same cell. */
26160
+ standing: _enum([
26161
+ "fresh",
26162
+ "stale",
26163
+ "superseded"
26164
+ ]),
26165
+ staleWhy: _enum([
26166
+ "age",
26167
+ "runtime",
26168
+ "pool-tuning"
26169
+ ]).nullable()
26170
+ });
26171
+ object({
26172
+ runId: string(),
26173
+ nodeId: string(),
26174
+ startedAtMs: number(),
26175
+ deadlineAtMs: number(),
26176
+ plan: NodeBenchmarkPlanSchema,
26177
+ moved: array(number()).readonly(),
26178
+ staying: array(number()).readonly()
26179
+ });
26180
+ /** Candidate detectors per device, for the plan editor. */
26181
+ var NodeBenchmarkCandidatesSchema = object({
26182
+ nodeId: string(),
26183
+ reachable: boolean(),
26184
+ devices: array(object({
26185
+ deviceKey: string(),
26186
+ enabled: boolean(),
26187
+ available: boolean(),
26188
+ /** Ordered: what Auto tune would pick first, then the rest of the family by accuracy. */
26189
+ suggested: array(string()).readonly(),
26190
+ /** Every root detector the device has a build for. */
26191
+ all: array(string()).readonly(),
26192
+ /** The model the device runs now, when pinned. */
26193
+ currentModelId: string().nullable()
26194
+ })).readonly(),
26195
+ /** Detail steps the node's catalog offers under the root (for the `pipeline` measurement). */
26196
+ steps: array(object({
26197
+ id: string(),
26198
+ name: string(),
26199
+ slot: string()
26200
+ })).readonly()
26201
+ });
24322
26202
  object({
24323
26203
  activeCameras: number(),
24324
26204
  throttledCameras: number(),
@@ -25236,14 +27116,15 @@ var RunnerLocalLoadSchema = object({
25236
27116
  * Per-inference-device live load (multi-device C4). One entry per deviceKey
25237
27117
  * this runner currently has attached cameras on, so the orchestrator's second
25238
27118
  * `balance()` pass (over a node's devices) weights on real per-pool session
25239
- * counts. Empty on single-device / pre-multi-device runners. `queueDepthTotal`
25240
- * per device is 0 until the pool backlog gets a public accessor (follow-up).
27119
+ * counts. Empty on single-device / pre-multi-device runners. There is no
27120
+ * per-device queue depth: the inference pool's backlog has no accessor, and
27121
+ * a field that always read 0 was removed rather than shown as a measurement
27122
+ * (D762).
25241
27123
  */
25242
27124
  devices: array(object({
25243
27125
  deviceKey: string(),
25244
27126
  backend: string(),
25245
- attachedCameras: number(),
25246
- queueDepthTotal: number()
27127
+ attachedCameras: number()
25247
27128
  })).default([]),
25248
27129
  /** Hardware capability flags reported by this node. */
25249
27130
  hardware: object({
@@ -25446,7 +27327,16 @@ method(RunnerCameraConfigSchema, object({ success: literal(true) }), { kind: "mu
25446
27327
  }), ParkedTrackFrameSchema.nullable()), method(object({
25447
27328
  deviceId: number(),
25448
27329
  trackId: string()
25449
- }), object({ released: number().int().nonnegative() }), { kind: "mutation" });
27330
+ }), object({ released: number().int().nonnegative() }), { kind: "mutation" }), method(NodeBenchRunnerInputSchema, object({
27331
+ accepted: literal(true),
27332
+ runId: string()
27333
+ }), {
27334
+ kind: "mutation",
27335
+ auth: "admin"
27336
+ }), method(object({ runId: string() }), NodeBenchRunnerStatusSchema.nullable(), { auth: "admin" }), method(object({ runId: string() }), object({ aborted: boolean() }), {
27337
+ kind: "mutation",
27338
+ auth: "admin"
27339
+ });
25450
27340
  var CameraPipelineConfigSchema = object({
25451
27341
  engine: PipelineEngineChoiceSchema.optional(),
25452
27342
  steps: array(PipelineStepInputSchema).readonly(),
@@ -25457,14 +27347,6 @@ var CameraPipelineConfigSchema = object({
25457
27347
  settings: record(string(), unknown()).readonly().optional()
25458
27348
  }).nullable().optional()
25459
27349
  });
25460
- var PipelineTemplateSchema = object({
25461
- id: string(),
25462
- name: string(),
25463
- description: string().optional(),
25464
- config: CameraPipelineConfigSchema,
25465
- createdAt: string(),
25466
- updatedAt: string()
25467
- });
25468
27350
  var DeviceStepConfigSchema = object({
25469
27351
  modelId: string().optional(),
25470
27352
  settings: record(string(), unknown()).optional(),
@@ -25538,9 +27420,10 @@ var CameraStepOverridePatchSchema = object({
25538
27420
  modelId: string().optional(),
25539
27421
  settings: record(string(), unknown()).readonly().optional()
25540
27422
  });
27423
+ var CameraStepSettingsSchema = record(string(), record(string(), unknown()).readonly());
25541
27424
  var CameraPipelineSettingsSchema = object({
25542
- pinnedAgentNodeId: string().optional(),
25543
27425
  stepToggles: record(string(), boolean()).optional(),
27426
+ stepSettings: CameraStepSettingsSchema.optional(),
25544
27427
  stepOverridesByDevice: record(string(), record(string(), record(string(), CameraStepOverridePatchSchema))).optional(),
25545
27428
  pipelineByAgent: record(string(), CameraPipelineForAgentSchema).optional()
25546
27429
  });
@@ -25573,7 +27456,10 @@ var PipelineAssignmentSchema = object({
25573
27456
  });
25574
27457
  /**
25575
27458
  * Per-agent load summary surfaced to the load balancer + dashboards.
25576
- * Aggregated from each runner's `getLocalLoad` cap call.
27459
+ * Aggregated from each runner's `getLocalLoad` cap call. In the
27460
+ * `getAgentLoad` report, a single-device node's default-pool sessions (no
27461
+ * `deviceKey`) are credited to its one eligible device in `load.devices` —
27462
+ * the default pool IS that device (D745); the balancer's census stays raw.
25577
27463
  */
25578
27464
  var AgentLoadSummarySchema = object({
25579
27465
  nodeId: string(),
@@ -25662,26 +27548,27 @@ var CameraBrokerStatusSchema = object({
25662
27548
  width: number(),
25663
27549
  height: number(),
25664
27550
  subscribers: number(),
25665
- inFps: number(),
25666
- outFps: number()
27551
+ /**
27552
+ * Encoded packets/s the broker receives from the camera. null when the
27553
+ * broker's stats read failed — unknown, never 0 (a 0 here reads as a stall).
27554
+ * There is no output rate: decoding runs in the session decode workers, not
27555
+ * in the broker, so the broker's own decoded-frame rate is 0 on every live
27556
+ * camera and is not served (D758).
27557
+ */
27558
+ inFps: number().nullable()
25667
27559
  })).readonly(),
25668
27560
  webrtcSessions: number(),
25669
27561
  rtspRestream: boolean()
25670
27562
  });
25671
- /** Shared-memory ring statistics within the decoder block. */
25672
- var CameraDecoderShmSchema = object({
25673
- framesWritten: number(),
25674
- getFrameHits: number(),
25675
- getFrameMisses: number(),
25676
- budgetMb: number()
25677
- });
25678
- /** Decoder block — null when the decoder stage is unreachable or inactive. */
25679
- var CameraDecoderStatusSchema = object({
25680
- nodeId: string(),
25681
- formats: array(string()).readonly(),
25682
- sessionCount: number(),
25683
- shm: CameraDecoderShmSchema
25684
- });
27563
+ /**
27564
+ * Decoder block — WHERE decode runs (co-located with the detection node by
27565
+ * construction); null when the camera has no detection node. It carries no
27566
+ * frame counter: the shared-memory plane whose counters it used to serve is
27567
+ * gone, and those fields read 0 forever. Whether frames actually flow is read
27568
+ * from `detection.actualFps` (frames delivered to and processed by the
27569
+ * detector), never from a counter nothing feeds.
27570
+ */
27571
+ var CameraDecoderStatusSchema = object({ nodeId: string() });
25685
27572
  /** Motion block — null when motion detection is not active for this device. */
25686
27573
  var CameraMotionStatusSchema = object({
25687
27574
  enabled: boolean(),
@@ -26038,12 +27925,6 @@ method(object({
26038
27925
  }), object({ success: literal(true) }), {
26039
27926
  kind: "mutation",
26040
27927
  auth: "admin"
26041
- }), method(object({
26042
- agentNodeId: string(),
26043
- detectWeight: number().positive().nullable()
26044
- }), object({ success: literal(true) }), {
26045
- kind: "mutation",
26046
- auth: "admin"
26047
27928
  }), method(object({
26048
27929
  agentNodeId: string(),
26049
27930
  detect: boolean().nullable().optional(),
@@ -26085,6 +27966,30 @@ method(object({
26085
27966
  }), {
26086
27967
  kind: "mutation",
26087
27968
  auth: "admin"
27969
+ }), method(AutoTuneOptionsSchema, AutoTunePlanSchema, { auth: "admin" }), method(AutoTuneApplyInputSchema, AutoTuneApplyResultSchema, {
27970
+ kind: "mutation",
27971
+ auth: "admin"
27972
+ }), method(LoadBalancingSharesInputSchema, object({ success: literal(true) }), {
27973
+ kind: "mutation",
27974
+ auth: "admin"
27975
+ }), method(PlacementStatsInputSchema, PlacementStatsSchema, { auth: "admin" }), method(SuggestSharesInputSchema, SuggestSharesResultSchema, { auth: "admin" }), method(_void(), EffectiveSharesSchema, { auth: "admin" }), method(SetShareSourceInputSchema, object({ success: literal(true) }), {
27976
+ kind: "mutation",
27977
+ auth: "admin"
27978
+ }), method(NodeBenchmarkPlanSchema, NodeBenchmarkPreflightSchema, { auth: "admin" }), method(NodeBenchmarkPlanSchema, discriminatedUnion("kind", [object({
27979
+ kind: literal("started"),
27980
+ runId: string()
27981
+ }), object({
27982
+ kind: literal("refused"),
27983
+ preflight: NodeBenchmarkPreflightSchema
27984
+ })]), {
27985
+ kind: "mutation",
27986
+ auth: "admin"
27987
+ }), method(_void(), NodeBenchmarkStatusSchema, { auth: "admin" }), method(object({ runId: string() }), object({ aborted: boolean() }), {
27988
+ kind: "mutation",
27989
+ auth: "admin"
27990
+ }), method(object({ nodeId: string() }), NodeBenchmarkCandidatesSchema, { auth: "admin" }), method(ListNodeBenchmarkResultsInputSchema, array(NodeBenchmarkResultViewSchema).readonly(), { auth: "admin" }), method(object({ id: string() }), object({ deleted: boolean() }), {
27991
+ kind: "mutation",
27992
+ auth: "admin"
26088
27993
  }), method(object({ deviceId: number() }), CameraPipelineSettingsSchema.nullable()), method(object({
26089
27994
  deviceId: number(),
26090
27995
  addonId: string(),
@@ -26101,6 +28006,13 @@ method(object({
26101
28006
  }), object({ success: literal(true) }), {
26102
28007
  kind: "mutation",
26103
28008
  auth: "admin"
28009
+ }), method(object({
28010
+ deviceId: number(),
28011
+ addonId: string(),
28012
+ settings: record(string(), unknown()).nullable()
28013
+ }), object({ success: literal(true) }), {
28014
+ kind: "mutation",
28015
+ auth: "admin"
26104
28016
  }), method(object({
26105
28017
  deviceId: number(),
26106
28018
  agentNodeId: string(),
@@ -26124,25 +28036,7 @@ method(object({
26124
28036
  }), method(_void(), DiskReconcileJobSchema, {
26125
28037
  kind: "mutation",
26126
28038
  auth: "admin"
26127
- }), method(_void(), DiskReconcileJobSchema, { auth: "admin" }), method(_void(), array(PipelineTemplateSchema).readonly()), method(object({
26128
- name: string(),
26129
- description: string().optional(),
26130
- config: CameraPipelineConfigSchema
26131
- }), PipelineTemplateSchema, {
26132
- kind: "mutation",
26133
- auth: "admin"
26134
- }), method(object({
26135
- id: string(),
26136
- name: string().optional(),
26137
- description: string().optional(),
26138
- config: CameraPipelineConfigSchema.optional()
26139
- }), PipelineTemplateSchema, {
26140
- kind: "mutation",
26141
- auth: "admin"
26142
- }), method(object({ id: string() }), object({ success: literal(true) }), {
26143
- kind: "mutation",
26144
- auth: "admin"
26145
- });
28039
+ }), method(_void(), DiskReconcileJobSchema, { auth: "admin" });
26146
28040
  /**
26147
28041
  * Cap → event-kind mapping for the SENSOR / CONTROL cap families — the table
26148
28042
  * `pipeline-analytics.listEventKinds` uses to turn a linked device's bound
@@ -26836,7 +28730,19 @@ var SsoBridgeClaimsSchema = object({
26836
28730
  * editing a descriptor must not retroactively extend or shorten a link the
26837
28731
  * operator already consented to.
26838
28732
  */
26839
- refreshTtl: union([number().int().positive(), literal("never")]).optional()
28733
+ refreshTtl: union([number().int().positive(), literal("never")]).optional(),
28734
+ /**
28735
+ * Opaque handle of a hub-side LINK intent (D782). Set by an OIDC callback
28736
+ * that was started from a signed-in user's "Link" button: the finish then
28737
+ * links this identity to the intent's user instead of signing anyone in.
28738
+ * The handle carries no user id — the hub resolves it, single-use.
28739
+ */
28740
+ linkIntent: string().optional(),
28741
+ /**
28742
+ * Verified `iss` of the id_token behind an OIDC login bridge (D782). A
28743
+ * subject is unique only per issuer, so a link is bound to it.
28744
+ */
28745
+ issuer: string().optional()
26840
28746
  });
26841
28747
  method(object({
26842
28748
  claims: SsoBridgeClaimsSchema,
@@ -28913,8 +30819,6 @@ var WebrtcStreamChoiceSchema = object({
28913
30819
  ]).nullable(),
28914
30820
  /** Input FPS from the camera (null for adaptive). */
28915
30821
  inputFps: number().nullable(),
28916
- /** Decoded FPS (null for adaptive). */
28917
- decodeFps: number().nullable(),
28918
30822
  /** Bitrate in kbps (null for adaptive). */
28919
30823
  bitrateKbps: number().nullable()
28920
30824
  });
@@ -29191,7 +31095,22 @@ DeviceType.Camera, method(object({ deviceId: number().int().nonnegative() }), ar
29191
31095
  * field their hints were silently stripped by the schema and the
29192
31096
  * adaptive ladder started blind on the client's display size.
29193
31097
  */
29194
- hints: webrtcClientHintsSchema.optional()
31098
+ hints: webrtcClientHintsSchema.optional(),
31099
+ /**
31100
+ * Talk-back (D771): relay the PEER's audio to the device's speaker
31101
+ * through the `intercom` cap's push-talk triple. When `true` and the
31102
+ * offer lets the peer send audio, the answer's audio is `sendrecv`
31103
+ * and every inbound frame goes to `intercom.pushTalkAudio` for this
31104
+ * `deviceId`; absent/false answers `sendonly`, as for every viewer.
31105
+ *
31106
+ * TRUSTED-CALLER ONLY. Set by the Alexa export for an Echo on a camera
31107
+ * with `intercom`, when the linked user may control that camera. The
31108
+ * hub STRIPS it from every request-bound call (a browser), exactly as
31109
+ * it overwrites `relayOnly` — a viewer's talk permission is the
31110
+ * intercom cap's own surface (share tokens gate it there), and this
31111
+ * flag must not become a second door to the camera's speaker.
31112
+ */
31113
+ talkback: boolean().optional()
29195
31114
  }), object({
29196
31115
  sessionId: string(),
29197
31116
  sdpAnswer: string()
@@ -29493,6 +31412,59 @@ var AddonAutoUpdateSchema = ChannelWithInheritSchema;
29493
31412
  var RestartAddonResultSchema = unknown();
29494
31413
  var InstallPackageResultSchema = unknown();
29495
31414
  var ReloadPackagesResultSchema = unknown();
31415
+ /**
31416
+ * What an uninstall did on ONE node.
31417
+ * - `uninstalled` — removed: runner(s) stopped, caps gone, code deleted.
31418
+ * - `not-installed` — the node did not have it (nothing to do).
31419
+ * - `refused` — protected / bootstrap package; nothing touched.
31420
+ * - `failed` — attempted and did not complete; `error` says why.
31421
+ * - `pending-reconnect` — the node is OFFLINE: its record was pruned so the
31422
+ * back-fill never returns the package, and the stale-addon sweep removes the
31423
+ * copy when the node registers again (only once the hub no longer has it).
31424
+ */
31425
+ var UninstallNodeOutcomeSchema = _enum([
31426
+ "uninstalled",
31427
+ "not-installed",
31428
+ "refused",
31429
+ "failed",
31430
+ "pending-reconnect"
31431
+ ]);
31432
+ var UninstallNodeResultSchema = object({
31433
+ nodeId: string(),
31434
+ outcome: UninstallNodeOutcomeSchema,
31435
+ error: string().optional(),
31436
+ addonIds: array(string()).readonly(),
31437
+ runnersStopped: array(string()).readonly(),
31438
+ warnings: array(string()).readonly()
31439
+ });
31440
+ var UninstallPackageResultSchema = object({
31441
+ /** Every targeted node ended `uninstalled`, `not-installed` or `pending-reconnect`. */
31442
+ success: boolean(),
31443
+ packageName: string(),
31444
+ results: array(UninstallNodeResultSchema).readonly()
31445
+ });
31446
+ /**
31447
+ * `unreachable` lists online agents whose status read FAILED — absence from
31448
+ * `installations` is only "not installed" for a node that answered (D315).
31449
+ */
31450
+ var PackageInstallationsSchema = object({
31451
+ installations: array(object({
31452
+ packageName: string(),
31453
+ nodeId: string(),
31454
+ nodeName: string(),
31455
+ isHub: boolean(),
31456
+ isOnline: boolean(),
31457
+ version: string().nullable(),
31458
+ addonIds: array(string()).readonly(),
31459
+ source: _enum(["live", "recorded"]),
31460
+ /** The hub installs this package too. `false` on an agent row = an orphan. */
31461
+ onHub: boolean()
31462
+ })).readonly(),
31463
+ unreachable: array(object({
31464
+ nodeId: string(),
31465
+ error: string()
31466
+ })).readonly()
31467
+ });
29496
31468
  var BulkUpdateItemStatusSchema = _enum([
29497
31469
  "queued",
29498
31470
  "updating",
@@ -29575,10 +31547,14 @@ method(_void(), array(AddonListItemSchema).readonly()), method(object({
29575
31547
  }), method(object({ packageName: string() }), InstallPackageResultSchema, {
29576
31548
  kind: "mutation",
29577
31549
  auth: "admin"
29578
- }), method(_void(), boolean()), method(_void(), array(unknown()).readonly()), method(object({ packageName: string() }), unknown(), {
31550
+ }), method(_void(), boolean()), method(_void(), array(unknown()).readonly()), method(object({
31551
+ packageName: string().min(1),
31552
+ nodeId: string().optional(),
31553
+ everywhere: boolean().optional()
31554
+ }), UninstallPackageResultSchema, {
29579
31555
  kind: "mutation",
29580
31556
  auth: "admin"
29581
- }), method(_void(), ReloadPackagesResultSchema, {
31557
+ }), method(object({ packageName: string().optional() }), PackageInstallationsSchema, { auth: "admin" }), method(_void(), ReloadPackagesResultSchema, {
29582
31558
  kind: "mutation",
29583
31559
  auth: "admin"
29584
31560
  }), method(object({ query: string().optional() }), array(SearchResultSchema)), method(object({ nodeId: string().optional() }), array(PackageUpdateSchema).readonly(), { auth: "admin" }), method(object({
@@ -32643,6 +34619,9 @@ var CreateIntegrationInputSchema = object({
32643
34619
  enabled: boolean().optional(),
32644
34620
  info: record(string(), unknown()).optional(),
32645
34621
  settings: record(string(), unknown()).optional(),
34622
+ /** Keys of `settings` the form's schema declares secret (by type) — kept in
34623
+ * the keychain, not the table (D787). */
34624
+ secretKeys: array(string()).optional(),
32646
34625
  skipRestart: boolean().optional()
32647
34626
  });
32648
34627
  var UpdateIntegrationInputSchema = object({
@@ -32666,7 +34645,9 @@ method(_void(), array(IntegrationWithStateSchema)), method(object({ id: string()
32666
34645
  auth: "admin"
32667
34646
  }), method(object({ id: string() }), record(string(), unknown()), { auth: "admin" }), method(object({
32668
34647
  id: string(),
32669
- settings: record(string(), unknown())
34648
+ settings: record(string(), unknown()),
34649
+ /** Keys the form's schema declares secret (by type) — keychain-stored (D787). */
34650
+ secretKeys: array(string()).optional()
32670
34651
  }), object({ success: boolean() }), {
32671
34652
  kind: "mutation",
32672
34653
  auth: "admin"
@@ -40049,6 +42030,32 @@ var TotpStatusSchema = object({
40049
42030
  /** Null when no row exists OR the row is still pending confirmation. */
40050
42031
  confirmedAt: number().nullable()
40051
42032
  });
42033
+ /**
42034
+ * user-management — singleton capability for user accounts, API keys,
42035
+ * and scoped tokens.
42036
+ *
42037
+ * v2 model: every method gated by `auth: 'admin'`. Admin-only delegation
42038
+ * — the subset check on `setUserScopes` / `createScopedToken` is moot
42039
+ * because non-admins never reach these. If/when we open non-admin
42040
+ * delegation, structural caller-scope subset check goes inside the
42041
+ * provider.
42042
+ */
42043
+ var ExternalIdentitySchema = object({
42044
+ /** Login-method id of the provider instance, e.g. `auth-oidc/authentik`. */
42045
+ provider: string(),
42046
+ /** The IdP's stable subject (`sub`) for this account. */
42047
+ subject: string(),
42048
+ /** The verified `iss` of the IdP the identity was linked under — `sub` is unique only per issuer. */
42049
+ issuer: string(),
42050
+ userId: string(),
42051
+ /** What the IdP called the account at link time (username / email) — display only. */
42052
+ label: string().optional(),
42053
+ linkedAt: number()
42054
+ });
42055
+ var ExternalIdentityKeySchema = object({
42056
+ provider: string().min(1),
42057
+ subject: string().min(1)
42058
+ });
40052
42059
  method(_void(), array(UserSummarySchema), { auth: "admin" }), method(CreateUserInputSchema, UserSummarySchema, {
40053
42060
  kind: "mutation",
40054
42061
  auth: "admin",
@@ -40162,7 +42169,22 @@ method(_void(), array(UserSummarySchema), { auth: "admin" }), method(CreateUserI
40162
42169
  userId: string(),
40163
42170
  username: string(),
40164
42171
  scopes: array(TokenScopeSchema)
40165
- }).nullable(), { access: "view" }), method(_void(), array(OauthSessionSummarySchema), { auth: "admin" }), method(object({ id: string() }), object({ success: boolean() }), {
42172
+ }).nullable(), { access: "view" }), method(object({ userId: string() }), array(ExternalIdentitySchema), { auth: "admin" }), method(ExternalIdentityKeySchema, object({
42173
+ userId: string(),
42174
+ issuer: string()
42175
+ }).nullable(), { auth: "admin" }), method(ExternalIdentityKeySchema.extend({
42176
+ userId: string(),
42177
+ issuer: string().min(1),
42178
+ label: string().optional()
42179
+ }), object({ success: literal(true) }), {
42180
+ kind: "mutation",
42181
+ auth: "admin",
42182
+ access: "create"
42183
+ }), method(ExternalIdentityKeySchema.extend({ userId: string() }), object({ success: boolean() }), {
42184
+ kind: "mutation",
42185
+ auth: "admin",
42186
+ access: "delete"
42187
+ }), method(_void(), array(OauthSessionSummarySchema), { auth: "admin" }), method(object({ id: string() }), object({ success: boolean() }), {
40166
42188
  kind: "mutation",
40167
42189
  auth: "admin",
40168
42190
  access: "delete"
@@ -40864,6 +42886,16 @@ var zoneRulesCapability = {
40864
42886
  durability: "restored"
40865
42887
  };
40866
42888
  SOURCE_CAPS.filter((cap) => cap !== "switch" && cap !== "motion");
42889
+ Object.freeze({
42890
+ person: .5,
42891
+ vehicle: .5,
42892
+ animal: .5
42893
+ });
42894
+ Object.freeze({
42895
+ person: .65,
42896
+ vehicle: .65,
42897
+ animal: .65
42898
+ });
40867
42899
  /**
40868
42900
  * Accessory device helpers — shared across drivers.
40869
42901
  *
@@ -41354,7 +43386,8 @@ var BaseDevice = class {
41354
43386
  this.role = options.role;
41355
43387
  this.parentDeviceId = ctx.parentDeviceId;
41356
43388
  const seedData = ctx.persistedConfig ?? {};
41357
- this.config = DeviceConfig.fromSchema(schema, (data) => ctx.persistConfig(data), seedData, ({ droppedKeys, issues }) => {
43389
+ const declaredSecretPaths = collectZodSecretPaths(schema);
43390
+ this.config = DeviceConfig.fromSchema(schema, (data) => ctx.persistConfig(data, { secretConfigPaths: declaredSecretPaths }), seedData, ({ droppedKeys, issues }) => {
41358
43391
  ctx.logger.warn("Device config recovery: dropping invalid persisted fields", {
41359
43392
  tags: {
41360
43393
  deviceId: ctx.id,
@@ -42577,6 +44610,12 @@ Object.freeze({
42577
44610
  addonId: null,
42578
44611
  access: "view"
42579
44612
  },
44613
+ "addons.listInstallations": {
44614
+ capName: "addons",
44615
+ capScope: "system",
44616
+ addonId: null,
44617
+ access: "view"
44618
+ },
42580
44619
  "addons.listJobs": {
42581
44620
  capName: "addons",
42582
44621
  capScope: "system",
@@ -43759,90 +45798,18 @@ Object.freeze({
43759
45798
  addonId: null,
43760
45799
  access: "create"
43761
45800
  },
43762
- "decoder.createSession": {
43763
- capName: "decoder",
43764
- capScope: "system",
43765
- addonId: null,
43766
- access: "view"
43767
- },
43768
- "decoder.destroySession": {
43769
- capName: "decoder",
43770
- capScope: "system",
43771
- addonId: null,
43772
- access: "delete"
43773
- },
43774
- "decoder.getFrame": {
43775
- capName: "decoder",
43776
- capScope: "system",
43777
- addonId: null,
43778
- access: "view"
43779
- },
43780
45801
  "decoder.getInfo": {
43781
45802
  capName: "decoder",
43782
45803
  capScope: "system",
43783
45804
  addonId: null,
43784
45805
  access: "view"
43785
45806
  },
43786
- "decoder.getShmStats": {
43787
- capName: "decoder",
43788
- capScope: "system",
43789
- addonId: null,
43790
- access: "view"
43791
- },
43792
- "decoder.getStats": {
43793
- capName: "decoder",
43794
- capScope: "system",
43795
- addonId: null,
43796
- access: "view"
43797
- },
43798
- "decoder.listActiveSessions": {
43799
- capName: "decoder",
43800
- capScope: "system",
43801
- addonId: null,
43802
- access: "view"
43803
- },
43804
- "decoder.openStream": {
43805
- capName: "decoder",
43806
- capScope: "system",
43807
- addonId: null,
43808
- access: "view"
43809
- },
43810
- "decoder.pullFrames": {
43811
- capName: "decoder",
43812
- capScope: "system",
43813
- addonId: null,
43814
- access: "view"
43815
- },
43816
- "decoder.pullHandles": {
43817
- capName: "decoder",
43818
- capScope: "system",
43819
- addonId: null,
43820
- access: "view"
43821
- },
43822
- "decoder.pushPacket": {
43823
- capName: "decoder",
43824
- capScope: "system",
43825
- addonId: null,
43826
- access: "view"
43827
- },
43828
45807
  "decoder.reprobeHwaccel": {
43829
45808
  capName: "decoder",
43830
45809
  capScope: "system",
43831
45810
  addonId: null,
43832
45811
  access: "create"
43833
45812
  },
43834
- "decoder.supportsCodec": {
43835
- capName: "decoder",
43836
- capScope: "system",
43837
- addonId: null,
43838
- access: "view"
43839
- },
43840
- "decoder.updateConfig": {
43841
- capName: "decoder",
43842
- capScope: "system",
43843
- addonId: null,
43844
- access: "view"
43845
- },
43846
45813
  "detectionPipeline.applyDeviceSettingsPatch": {
43847
45814
  capName: "detection-pipeline",
43848
45815
  capScope: "device",
@@ -45109,6 +47076,90 @@ Object.freeze({
45109
47076
  addonId: null,
45110
47077
  access: "create"
45111
47078
  },
47079
+ "keychain.delete": {
47080
+ capName: "keychain",
47081
+ capScope: "system",
47082
+ addonId: null,
47083
+ access: "delete"
47084
+ },
47085
+ "keychain.getState": {
47086
+ capName: "keychain",
47087
+ capScope: "system",
47088
+ addonId: null,
47089
+ access: "view"
47090
+ },
47091
+ "keychain.listMeta": {
47092
+ capName: "keychain",
47093
+ capScope: "system",
47094
+ addonId: null,
47095
+ access: "view"
47096
+ },
47097
+ "keychain.put": {
47098
+ capName: "keychain",
47099
+ capScope: "system",
47100
+ addonId: null,
47101
+ access: "create"
47102
+ },
47103
+ "keychain.resolve": {
47104
+ capName: "keychain",
47105
+ capScope: "system",
47106
+ addonId: null,
47107
+ access: "view"
47108
+ },
47109
+ "keychainAdmin.deleteOrphans": {
47110
+ capName: "keychain-admin",
47111
+ capScope: "system",
47112
+ addonId: null,
47113
+ access: "delete"
47114
+ },
47115
+ "keychainAdmin.downloadRecoveryKey": {
47116
+ capName: "keychain-admin",
47117
+ capScope: "system",
47118
+ addonId: null,
47119
+ access: "create"
47120
+ },
47121
+ "keychainAdmin.listAudit": {
47122
+ capName: "keychain-admin",
47123
+ capScope: "system",
47124
+ addonId: null,
47125
+ access: "view"
47126
+ },
47127
+ "keychainAdmin.listSecrets": {
47128
+ capName: "keychain-admin",
47129
+ capScope: "system",
47130
+ addonId: null,
47131
+ access: "view"
47132
+ },
47133
+ "keychainAdmin.purgeRetiredKeys": {
47134
+ capName: "keychain-admin",
47135
+ capScope: "system",
47136
+ addonId: null,
47137
+ access: "delete"
47138
+ },
47139
+ "keychainAdmin.resetKeychain": {
47140
+ capName: "keychain-admin",
47141
+ capScope: "system",
47142
+ addonId: null,
47143
+ access: "delete"
47144
+ },
47145
+ "keychainAdmin.reveal": {
47146
+ capName: "keychain-admin",
47147
+ capScope: "system",
47148
+ addonId: null,
47149
+ access: "create"
47150
+ },
47151
+ "keychainAdmin.rotateMasterKey": {
47152
+ capName: "keychain-admin",
47153
+ capScope: "system",
47154
+ addonId: null,
47155
+ access: "create"
47156
+ },
47157
+ "keychainAdmin.status": {
47158
+ capName: "keychain-admin",
47159
+ capScope: "system",
47160
+ addonId: null,
47161
+ access: "view"
47162
+ },
45112
47163
  "lawnMowerControl.dock": {
45113
47164
  capName: "lawn-mower-control",
45114
47165
  capScope: "device",
@@ -46483,6 +48534,18 @@ Object.freeze({
46483
48534
  addonId: null,
46484
48535
  access: "create"
46485
48536
  },
48537
+ "pipelineAnalytics.addRetrainFrameFromRecording": {
48538
+ capName: "pipeline-analytics",
48539
+ capScope: "device",
48540
+ addonId: null,
48541
+ access: "create"
48542
+ },
48543
+ "pipelineAnalytics.addRetrainFramesToCollection": {
48544
+ capName: "pipeline-analytics",
48545
+ capScope: "device",
48546
+ addonId: null,
48547
+ access: "create"
48548
+ },
46486
48549
  "pipelineAnalytics.applyDeviceSettingsPatch": {
46487
48550
  capName: "pipeline-analytics",
46488
48551
  capScope: "device",
@@ -46531,12 +48594,24 @@ Object.freeze({
46531
48594
  addonId: null,
46532
48595
  access: "view"
46533
48596
  },
48597
+ "pipelineAnalytics.createRetrainCollection": {
48598
+ capName: "pipeline-analytics",
48599
+ capScope: "device",
48600
+ addonId: null,
48601
+ access: "create"
48602
+ },
46534
48603
  "pipelineAnalytics.deleteDeviceEvents": {
46535
48604
  capName: "pipeline-analytics",
46536
48605
  capScope: "device",
46537
48606
  addonId: null,
46538
48607
  access: "delete"
46539
48608
  },
48609
+ "pipelineAnalytics.deleteRetrainCollection": {
48610
+ capName: "pipeline-analytics",
48611
+ capScope: "device",
48612
+ addonId: null,
48613
+ access: "delete"
48614
+ },
46540
48615
  "pipelineAnalytics.deleteTracks": {
46541
48616
  capName: "pipeline-analytics",
46542
48617
  capScope: "device",
@@ -46741,6 +48816,24 @@ Object.freeze({
46741
48816
  addonId: null,
46742
48817
  access: "view"
46743
48818
  },
48819
+ "pipelineAnalytics.listRetrainAssistProfiles": {
48820
+ capName: "pipeline-analytics",
48821
+ capScope: "device",
48822
+ addonId: null,
48823
+ access: "view"
48824
+ },
48825
+ "pipelineAnalytics.listRetrainCollectionFrames": {
48826
+ capName: "pipeline-analytics",
48827
+ capScope: "device",
48828
+ addonId: null,
48829
+ access: "view"
48830
+ },
48831
+ "pipelineAnalytics.listRetrainCollections": {
48832
+ capName: "pipeline-analytics",
48833
+ capScope: "device",
48834
+ addonId: null,
48835
+ access: "view"
48836
+ },
46744
48837
  "pipelineAnalytics.listRetrainFrames": {
46745
48838
  capName: "pipeline-analytics",
46746
48839
  capScope: "device",
@@ -46789,6 +48882,12 @@ Object.freeze({
46789
48882
  addonId: null,
46790
48883
  access: "create"
46791
48884
  },
48885
+ "pipelineAnalytics.proposeRetrainAnnotationsWithLlm": {
48886
+ capName: "pipeline-analytics",
48887
+ capScope: "device",
48888
+ addonId: null,
48889
+ access: "create"
48890
+ },
46792
48891
  "pipelineAnalytics.pruneEvents": {
46793
48892
  capName: "pipeline-analytics",
46794
48893
  capScope: "device",
@@ -46843,6 +48942,18 @@ Object.freeze({
46843
48942
  addonId: null,
46844
48943
  access: "create"
46845
48944
  },
48945
+ "pipelineAnalytics.removeRetrainFrameFromCollection": {
48946
+ capName: "pipeline-analytics",
48947
+ capScope: "device",
48948
+ addonId: null,
48949
+ access: "delete"
48950
+ },
48951
+ "pipelineAnalytics.renameRetrainCollection": {
48952
+ capName: "pipeline-analytics",
48953
+ capScope: "device",
48954
+ addonId: null,
48955
+ access: "create"
48956
+ },
46846
48957
  "pipelineAnalytics.restageRetrainTrack": {
46847
48958
  capName: "pipeline-analytics",
46848
48959
  capScope: "device",
@@ -46873,6 +48984,12 @@ Object.freeze({
46873
48984
  addonId: null,
46874
48985
  access: "create"
46875
48986
  },
48987
+ "pipelineAnalytics.setRetrainFrameComplete": {
48988
+ capName: "pipeline-analytics",
48989
+ capScope: "device",
48990
+ addonId: null,
48991
+ access: "create"
48992
+ },
46876
48993
  "pipelineAnalytics.setTrackFlags": {
46877
48994
  capName: "pipeline-analytics",
46878
48995
  capScope: "device",
@@ -46909,6 +49026,12 @@ Object.freeze({
46909
49026
  addonId: null,
46910
49027
  access: "delete"
46911
49028
  },
49029
+ "pipelineAnalytics.writeRetrainArchive": {
49030
+ capName: "pipeline-analytics",
49031
+ capScope: "device",
49032
+ addonId: null,
49033
+ access: "create"
49034
+ },
46912
49035
  "pipelineExecutor.cacheFrameInPool": {
46913
49036
  capName: "pipeline-executor",
46914
49037
  capScope: "system",
@@ -46921,13 +49044,13 @@ Object.freeze({
46921
49044
  addonId: null,
46922
49045
  access: "delete"
46923
49046
  },
46924
- "pipelineExecutor.deleteModel": {
49047
+ "pipelineExecutor.clearModelBoundDeviceOverrides": {
46925
49048
  capName: "pipeline-executor",
46926
49049
  capScope: "system",
46927
49050
  addonId: null,
46928
49051
  access: "delete"
46929
49052
  },
46930
- "pipelineExecutor.deleteTemplate": {
49053
+ "pipelineExecutor.deleteModel": {
46931
49054
  capName: "pipeline-executor",
46932
49055
  capScope: "system",
46933
49056
  addonId: null,
@@ -47071,12 +49194,6 @@ Object.freeze({
47071
49194
  addonId: null,
47072
49195
  access: "view"
47073
49196
  },
47074
- "pipelineExecutor.listTemplates": {
47075
- capName: "pipeline-executor",
47076
- capScope: "system",
47077
- addonId: null,
47078
- access: "view"
47079
- },
47080
49197
  "pipelineExecutor.rearmInferenceDevice": {
47081
49198
  capName: "pipeline-executor",
47082
49199
  capScope: "system",
@@ -47101,12 +49218,6 @@ Object.freeze({
47101
49218
  addonId: null,
47102
49219
  access: "create"
47103
49220
  },
47104
- "pipelineExecutor.saveTemplate": {
47105
- capName: "pipeline-executor",
47106
- capScope: "system",
47107
- addonId: null,
47108
- access: "create"
47109
- },
47110
49221
  "pipelineExecutor.setVideoPipelineSteps": {
47111
49222
  capName: "pipeline-executor",
47112
49223
  capScope: "system",
@@ -47125,17 +49236,23 @@ Object.freeze({
47125
49236
  addonId: null,
47126
49237
  access: "create"
47127
49238
  },
47128
- "pipelineExecutor.updateTemplate": {
49239
+ "pipelineExecutor.validatePipeline": {
47129
49240
  capName: "pipeline-executor",
47130
49241
  capScope: "system",
47131
49242
  addonId: null,
49243
+ access: "view"
49244
+ },
49245
+ "pipelineOrchestrator.abortNodeBenchmark": {
49246
+ capName: "pipeline-orchestrator",
49247
+ capScope: "system",
49248
+ addonId: null,
47132
49249
  access: "create"
47133
49250
  },
47134
- "pipelineExecutor.validatePipeline": {
47135
- capName: "pipeline-executor",
49251
+ "pipelineOrchestrator.applyAutoTune": {
49252
+ capName: "pipeline-orchestrator",
47136
49253
  capScope: "system",
47137
49254
  addonId: null,
47138
- access: "view"
49255
+ access: "create"
47139
49256
  },
47140
49257
  "pipelineOrchestrator.applyDeviceSettingsPatch": {
47141
49258
  capName: "pipeline-orchestrator",
@@ -47155,7 +49272,7 @@ Object.freeze({
47155
49272
  addonId: null,
47156
49273
  access: "create"
47157
49274
  },
47158
- "pipelineOrchestrator.deleteTemplate": {
49275
+ "pipelineOrchestrator.deleteNodeBenchmarkResult": {
47159
49276
  capName: "pipeline-orchestrator",
47160
49277
  capScope: "system",
47161
49278
  addonId: null,
@@ -47251,6 +49368,12 @@ Object.freeze({
47251
49368
  addonId: null,
47252
49369
  access: "view"
47253
49370
  },
49371
+ "pipelineOrchestrator.getEffectiveShares": {
49372
+ capName: "pipeline-orchestrator",
49373
+ capScope: "system",
49374
+ addonId: null,
49375
+ access: "view"
49376
+ },
47254
49377
  "pipelineOrchestrator.getGlobalMetrics": {
47255
49378
  capName: "pipeline-orchestrator",
47256
49379
  capScope: "system",
@@ -47263,6 +49386,24 @@ Object.freeze({
47263
49386
  addonId: null,
47264
49387
  access: "view"
47265
49388
  },
49389
+ "pipelineOrchestrator.getNodeBenchmarkCandidates": {
49390
+ capName: "pipeline-orchestrator",
49391
+ capScope: "system",
49392
+ addonId: null,
49393
+ access: "view"
49394
+ },
49395
+ "pipelineOrchestrator.getNodeBenchmarkPreflight": {
49396
+ capName: "pipeline-orchestrator",
49397
+ capScope: "system",
49398
+ addonId: null,
49399
+ access: "view"
49400
+ },
49401
+ "pipelineOrchestrator.getNodeBenchmarkStatus": {
49402
+ capName: "pipeline-orchestrator",
49403
+ capScope: "system",
49404
+ addonId: null,
49405
+ access: "view"
49406
+ },
47266
49407
  "pipelineOrchestrator.getNodeInferenceDevices": {
47267
49408
  capName: "pipeline-orchestrator",
47268
49409
  capScope: "system",
@@ -47287,6 +49428,12 @@ Object.freeze({
47287
49428
  addonId: null,
47288
49429
  access: "view"
47289
49430
  },
49431
+ "pipelineOrchestrator.getPlacementStats": {
49432
+ capName: "pipeline-orchestrator",
49433
+ capScope: "system",
49434
+ addonId: null,
49435
+ access: "view"
49436
+ },
47290
49437
  "pipelineOrchestrator.getReconcileFromDiskStatus": {
47291
49438
  capName: "pipeline-orchestrator",
47292
49439
  capScope: "system",
@@ -47299,7 +49446,7 @@ Object.freeze({
47299
49446
  addonId: null,
47300
49447
  access: "view"
47301
49448
  },
47302
- "pipelineOrchestrator.listTemplates": {
49449
+ "pipelineOrchestrator.listNodeBenchmarkResults": {
47303
49450
  capName: "pipeline-orchestrator",
47304
49451
  capScope: "system",
47305
49452
  addonId: null,
@@ -47311,6 +49458,12 @@ Object.freeze({
47311
49458
  addonId: null,
47312
49459
  access: "create"
47313
49460
  },
49461
+ "pipelineOrchestrator.planAutoTune": {
49462
+ capName: "pipeline-orchestrator",
49463
+ capScope: "system",
49464
+ addonId: null,
49465
+ access: "view"
49466
+ },
47314
49467
  "pipelineOrchestrator.rebalance": {
47315
49468
  capName: "pipeline-orchestrator",
47316
49469
  capScope: "system",
@@ -47353,12 +49506,6 @@ Object.freeze({
47353
49506
  addonId: null,
47354
49507
  access: "create"
47355
49508
  },
47356
- "pipelineOrchestrator.saveTemplate": {
47357
- capName: "pipeline-orchestrator",
47358
- capScope: "system",
47359
- addonId: null,
47360
- access: "create"
47361
- },
47362
49509
  "pipelineOrchestrator.setAgentCapabilities": {
47363
49510
  capName: "pipeline-orchestrator",
47364
49511
  capScope: "system",
@@ -47371,12 +49518,6 @@ Object.freeze({
47371
49518
  addonId: null,
47372
49519
  access: "create"
47373
49520
  },
47374
- "pipelineOrchestrator.setAgentDetectWeight": {
47375
- capName: "pipeline-orchestrator",
47376
- capScope: "system",
47377
- addonId: null,
47378
- access: "create"
47379
- },
47380
49521
  "pipelineOrchestrator.setAgentInferenceDevices": {
47381
49522
  capName: "pipeline-orchestrator",
47382
49523
  capScope: "system",
@@ -47413,6 +49554,12 @@ Object.freeze({
47413
49554
  addonId: null,
47414
49555
  access: "create"
47415
49556
  },
49557
+ "pipelineOrchestrator.setCameraStepSettings": {
49558
+ capName: "pipeline-orchestrator",
49559
+ capScope: "system",
49560
+ addonId: null,
49561
+ access: "create"
49562
+ },
47416
49563
  "pipelineOrchestrator.setCameraStepToggle": {
47417
49564
  capName: "pipeline-orchestrator",
47418
49565
  capScope: "system",
@@ -47431,12 +49578,36 @@ Object.freeze({
47431
49578
  addonId: null,
47432
49579
  access: "create"
47433
49580
  },
49581
+ "pipelineOrchestrator.setLoadBalancingShares": {
49582
+ capName: "pipeline-orchestrator",
49583
+ capScope: "system",
49584
+ addonId: null,
49585
+ access: "create"
49586
+ },
47434
49587
  "pipelineOrchestrator.setPipelineDevicePin": {
47435
49588
  capName: "pipeline-orchestrator",
47436
49589
  capScope: "system",
47437
49590
  addonId: null,
47438
49591
  access: "create"
47439
49592
  },
49593
+ "pipelineOrchestrator.setShareSource": {
49594
+ capName: "pipeline-orchestrator",
49595
+ capScope: "system",
49596
+ addonId: null,
49597
+ access: "create"
49598
+ },
49599
+ "pipelineOrchestrator.startNodeBenchmark": {
49600
+ capName: "pipeline-orchestrator",
49601
+ capScope: "system",
49602
+ addonId: null,
49603
+ access: "create"
49604
+ },
49605
+ "pipelineOrchestrator.suggestShares": {
49606
+ capName: "pipeline-orchestrator",
49607
+ capScope: "system",
49608
+ addonId: null,
49609
+ access: "view"
49610
+ },
47440
49611
  "pipelineOrchestrator.unassignAudio": {
47441
49612
  capName: "pipeline-orchestrator",
47442
49613
  capScope: "system",
@@ -47449,8 +49620,8 @@ Object.freeze({
47449
49620
  addonId: null,
47450
49621
  access: "create"
47451
49622
  },
47452
- "pipelineOrchestrator.updateTemplate": {
47453
- capName: "pipeline-orchestrator",
49623
+ "pipelineRunner.abortNodeBench": {
49624
+ capName: "pipeline-runner",
47454
49625
  capScope: "system",
47455
49626
  addonId: null,
47456
49627
  access: "create"
@@ -47503,6 +49674,12 @@ Object.freeze({
47503
49674
  addonId: null,
47504
49675
  access: "view"
47505
49676
  },
49677
+ "pipelineRunner.getNodeBenchStatus": {
49678
+ capName: "pipeline-runner",
49679
+ capScope: "system",
49680
+ addonId: null,
49681
+ access: "view"
49682
+ },
47506
49683
  "pipelineRunner.getParkedTrackFrame": {
47507
49684
  capName: "pipeline-runner",
47508
49685
  capScope: "system",
@@ -47545,6 +49722,12 @@ Object.freeze({
47545
49722
  addonId: null,
47546
49723
  access: "create"
47547
49724
  },
49725
+ "pipelineRunner.startNodeBench": {
49726
+ capName: "pipeline-runner",
49727
+ capScope: "system",
49728
+ addonId: null,
49729
+ access: "create"
49730
+ },
47548
49731
  "plateGallery.assignPlate": {
47549
49732
  capName: "plate-gallery",
47550
49733
  capScope: "system",
@@ -48889,12 +51072,6 @@ Object.freeze({
48889
51072
  addonId: null,
48890
51073
  access: "view"
48891
51074
  },
48892
- "streamBroker.pullFrameHandles": {
48893
- capName: "stream-broker",
48894
- capScope: "system",
48895
- addonId: null,
48896
- access: "view"
48897
- },
48898
51075
  "streamBroker.regenerateRtspToken": {
48899
51076
  capName: "stream-broker",
48900
51077
  capScope: "system",
@@ -48961,12 +51138,6 @@ Object.freeze({
48961
51138
  addonId: null,
48962
51139
  access: "create"
48963
51140
  },
48964
- "streamBroker.subscribeFrames": {
48965
- capName: "stream-broker",
48966
- capScope: "system",
48967
- addonId: null,
48968
- access: "create"
48969
- },
48970
51141
  "streamBroker.unassignProfile": {
48971
51142
  capName: "stream-broker",
48972
51143
  capScope: "system",
@@ -48979,12 +51150,6 @@ Object.freeze({
48979
51150
  addonId: null,
48980
51151
  access: "create"
48981
51152
  },
48982
- "streamBroker.unsubscribeFrames": {
48983
- capName: "stream-broker",
48984
- capScope: "system",
48985
- addonId: null,
48986
- access: "create"
48987
- },
48988
51153
  "streamCatalog.getCatalog": {
48989
51154
  capName: "stream-catalog",
48990
51155
  capScope: "device",
@@ -49279,18 +51444,36 @@ Object.freeze({
49279
51444
  addonId: null,
49280
51445
  access: "delete"
49281
51446
  },
51447
+ "userManagement.findUserByExternalIdentity": {
51448
+ capName: "user-management",
51449
+ capScope: "system",
51450
+ addonId: null,
51451
+ access: "view"
51452
+ },
49282
51453
  "userManagement.getTotpStatus": {
49283
51454
  capName: "user-management",
49284
51455
  capScope: "system",
49285
51456
  addonId: null,
49286
51457
  access: "view"
49287
51458
  },
51459
+ "userManagement.linkExternalIdentity": {
51460
+ capName: "user-management",
51461
+ capScope: "system",
51462
+ addonId: null,
51463
+ access: "create"
51464
+ },
49288
51465
  "userManagement.listApiKeys": {
49289
51466
  capName: "user-management",
49290
51467
  capScope: "system",
49291
51468
  addonId: null,
49292
51469
  access: "view"
49293
51470
  },
51471
+ "userManagement.listExternalIdentities": {
51472
+ capName: "user-management",
51473
+ capScope: "system",
51474
+ addonId: null,
51475
+ access: "view"
51476
+ },
49294
51477
  "userManagement.listOauthSessions": {
49295
51478
  capName: "user-management",
49296
51479
  capScope: "system",
@@ -49369,6 +51552,12 @@ Object.freeze({
49369
51552
  addonId: null,
49370
51553
  access: "create"
49371
51554
  },
51555
+ "userManagement.unlinkExternalIdentity": {
51556
+ capName: "user-management",
51557
+ capScope: "system",
51558
+ addonId: null,
51559
+ access: "delete"
51560
+ },
49372
51561
  "userManagement.updateUser": {
49373
51562
  capName: "user-management",
49374
51563
  capScope: "system",
@@ -51716,11 +53905,6 @@ Object.freeze({
51716
53905
  form: "single",
51717
53906
  optional: false
51718
53907
  }],
51719
- "decoder.createSession": [{
51720
- name: "deviceId",
51721
- form: "single",
51722
- optional: true
51723
- }],
51724
53908
  "detectionPipeline.applyDeviceSettingsPatch": [{
51725
53909
  name: "deviceId",
51726
53910
  form: "single",
@@ -52691,6 +54875,11 @@ Object.freeze({
52691
54875
  form: "single",
52692
54876
  optional: false
52693
54877
  }],
54878
+ "pipelineAnalytics.addRetrainFrameFromRecording": [{
54879
+ name: "deviceId",
54880
+ form: "single",
54881
+ optional: false
54882
+ }],
52694
54883
  "pipelineAnalytics.applyDeviceSettingsPatch": [{
52695
54884
  name: "deviceId",
52696
54885
  form: "single",
@@ -52881,6 +55070,11 @@ Object.freeze({
52881
55070
  form: "single",
52882
55071
  optional: false
52883
55072
  }],
55073
+ "pipelineAnalytics.proposeRetrainAnnotationsWithLlm": [{
55074
+ name: "deviceId",
55075
+ form: "single",
55076
+ optional: false
55077
+ }],
52884
55078
  "pipelineAnalytics.pruneEventsBefore": [{
52885
55079
  name: "deviceId",
52886
55080
  form: "single",
@@ -52931,6 +55125,11 @@ Object.freeze({
52931
55125
  form: "single",
52932
55126
  optional: false
52933
55127
  }],
55128
+ "pipelineAnalytics.setRetrainFrameComplete": [{
55129
+ name: "deviceId",
55130
+ form: "single",
55131
+ optional: false
55132
+ }],
52934
55133
  "pipelineAnalytics.setTrackFlags": [{
52935
55134
  name: "deviceId",
52936
55135
  form: "single",
@@ -52951,6 +55150,11 @@ Object.freeze({
52951
55150
  form: "single",
52952
55151
  optional: false
52953
55152
  }],
55153
+ "pipelineExecutor.clearModelBoundDeviceOverrides": [{
55154
+ name: "deviceIds",
55155
+ form: "array",
55156
+ optional: true
55157
+ }],
52954
55158
  "pipelineExecutor.runPipeline": [{
52955
55159
  name: "deviceId",
52956
55160
  form: "single",
@@ -53056,6 +55260,11 @@ Object.freeze({
53056
55260
  form: "single",
53057
55261
  optional: false
53058
55262
  }],
55263
+ "pipelineOrchestrator.setCameraStepSettings": [{
55264
+ name: "deviceId",
55265
+ form: "single",
55266
+ optional: false
55267
+ }],
53059
55268
  "pipelineOrchestrator.setCameraStepToggle": [{
53060
55269
  name: "deviceId",
53061
55270
  form: "single",
@@ -58506,7 +60715,7 @@ var hikvisionCameraSchema = object({
58506
60715
  */
58507
60716
  https: boolean().default(false),
58508
60717
  username: string().default("admin").describe("ISAPI user"),
58509
- password: string().describe("ISAPI password"),
60718
+ password: string().describe("ISAPI password").meta({ secret: true }),
58510
60719
  /**
58511
60720
  * RTSP transport hint forwarded to the broker as `transportmode`.
58512
60721
  * Most installations use `unicast`; multicast needs explicit