@camstack/addon-provider-homeassistant 1.2.162 → 1.2.164

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.
@@ -1,4 +1,4 @@
1
- //#region ../types/dist/event-category-BGmz_oxW.mjs
1
+ //#region ../types/dist/event-category-DaIZi00R.mjs
2
2
  var EventCategory = /* @__PURE__ */ function(EventCategory) {
3
3
  EventCategory["SystemBoot"] = "system.boot";
4
4
  EventCategory["SystemAddonsReady"] = "system.addons-ready";
@@ -77,6 +77,13 @@ var EventCategory = /* @__PURE__ */ function(EventCategory) {
77
77
  */
78
78
  EventCategory["AddonLoadFailed"] = "addon.load-failed";
79
79
  /**
80
+ * A keychain value was stored or removed (D787). Carries the ref, its
81
+ * owner and the new version — NEVER the value. A process holding the ref
82
+ * drops its cached copy and the owning `BaseAddon` re-resolves its config.
83
+ * Telemetry (D8): a process that misses it still revalidates by version.
84
+ */
85
+ EventCategory["KeychainChanged"] = "keychain.changed";
86
+ /**
80
87
  * Addon recovered from a previous failure. Emitted when an addon
81
88
  * transitions from `failed` back to `healthy` (typically via the
82
89
  * monitor's auto-retry loop, or after manual `addons.retryLoad`).
@@ -499,15 +506,6 @@ var EventCategory = /* @__PURE__ */ function(EventCategory) {
499
506
  EventCategory["AgentWsDisconnected"] = "agent.ws.disconnected";
500
507
  EventCategory["AgentBackupActivated"] = "agent.backup.activated";
501
508
  EventCategory["OrchestrationSettingsUpdated"] = "orchestration.settings-updated";
502
- /**
503
- * Per-agent hwaccel preference changed (user override set, cleared, or
504
- * re-probed). Observability event — decoders pull the current pref at
505
- * `createSession`, so running sessions keep their current backend until
506
- * they rotate naturally (camera add/remove, stream restart). Future
507
- * work can wire a listener in stream-broker that force-rotates live
508
- * sessions; for now this event powers logs + admin-UI toast feedback.
509
- */
510
- EventCategory["PipelineAgentHwaccelChanged"] = "pipeline.agent-hwaccel-changed";
511
509
  EventCategory["MotionAnalysis"] = "detection.motion-analysis";
512
510
  /** All raw motion zones from CCL before minArea filter — for UI debug overlay. */
513
511
  EventCategory["MotionZonesRaw"] = "detection.motion-zones-raw";
@@ -5378,7 +5376,7 @@ var ZodIssueCode = {
5378
5376
  var ZodFirstPartyTypeKind;
5379
5377
  ZodFirstPartyTypeKind || (ZodFirstPartyTypeKind = {});
5380
5378
  //#endregion
5381
- //#region ../types/dist/sleep-C16NCZR2.mjs
5379
+ //#region ../types/dist/sleep-Cr5YOk3m.mjs
5382
5380
  /**
5383
5381
  * The audio chunk plane's byte format, and the ONE expansion from a coded
5384
5382
  * window to float samples (D455).
@@ -5457,6 +5455,97 @@ function buildAlawTable() {
5457
5455
  }
5458
5456
  buildUlawTable();
5459
5457
  buildAlawTable();
5458
+ /** Is this field's stored value a credential? */
5459
+ function isSecretConfigField(field) {
5460
+ if (field.type === "password") return true;
5461
+ return "secret" in field && field.secret === true;
5462
+ }
5463
+ /**
5464
+ * Is this field's value stored in the KEYCHAIN (D787)? Every secret field is,
5465
+ * by its TYPE, unless it opts out with `storage: 'inline'` — never by its name.
5466
+ */
5467
+ function isKeychainStoredField(field) {
5468
+ if (!isSecretConfigField(field)) return false;
5469
+ if (field.type === "textarea" && field.isJson === true) return false;
5470
+ return !("storage" in field && field.storage === "inline");
5471
+ }
5472
+ /**
5473
+ * What a settings blob holds where a secret used to be.
5474
+ *
5475
+ * A keychain-stored field never holds its value. It holds a self-describing
5476
+ * MARKER, `{"$secret":"secret://…","v":1}` — an object, never a string, so no
5477
+ * code can mistake it for a credential and no form can send it to a camera as
5478
+ * a password. The empty state is `null` / absent, never `''`.
5479
+ *
5480
+ * The same shapes travel to and from the admin UI:
5481
+ *
5482
+ * - read: `hydrateSchema` hands a secret field a {@link SecretFieldView}
5483
+ * (`{ $secret, v, set: true }`) or `null` — the browser learns whether a
5484
+ * value is set, never the value.
5485
+ * - write: an untouched field submits the view back unchanged (KEEP); a typed
5486
+ * value is a plain non-empty string (CHANGE); the Clear button submits
5487
+ * {@link SECRET_CLEAR} (CLEAR). `''`, `null` and the legacy redaction tokens
5488
+ * are KEEP — an empty string is what a defaults-fallback pushes back, and
5489
+ * treating it as "clear" is how a save destroyed a stored credential before.
5490
+ *
5491
+ * Pure and browser-safe.
5492
+ */
5493
+ var SECRET_CLEAR = { $secretClear: true };
5494
+ /** The `'***'` token D634 redaction writes for non-admins. */
5495
+ var LEGACY_DEVICE_REDACTION = "***";
5496
+ function isRecord$1(value) {
5497
+ return typeof value === "object" && value !== null && !Array.isArray(value);
5498
+ }
5499
+ function makeSecretMarker(ref) {
5500
+ return {
5501
+ $secret: ref,
5502
+ v: 1
5503
+ };
5504
+ }
5505
+ /** A stored marker: an object whose `$secret` is a non-empty string. */
5506
+ function isSecretMarker(value) {
5507
+ if (!isRecord$1(value)) return false;
5508
+ const ref = value["$secret"];
5509
+ return typeof ref === "string" && ref.length > 0;
5510
+ }
5511
+ function isSecretClear(value) {
5512
+ return isRecord$1(value) && value["$secretClear"] === true;
5513
+ }
5514
+ /**
5515
+ * The UI view of a stored secret field value: a marker becomes "set", inline
5516
+ * plaintext becomes "set (inline)", nothing becomes `null`. A value never
5517
+ * survives this function.
5518
+ */
5519
+ function toSecretFieldView(stored) {
5520
+ if (isSecretMarker(stored)) return {
5521
+ $secret: stored.$secret,
5522
+ v: 1,
5523
+ set: true
5524
+ };
5525
+ if (typeof stored === "string" && stored.length > 0) return {
5526
+ $secret: null,
5527
+ v: 1,
5528
+ set: true,
5529
+ inline: true
5530
+ };
5531
+ return null;
5532
+ }
5533
+ /**
5534
+ * Classify an incoming value for a secret path. Only a non-empty string that is
5535
+ * not a redaction token sets a value; only {@link SECRET_CLEAR} clears.
5536
+ * Everything else — a marker (ours or anyone's), a UI view, `''`, `null`,
5537
+ * `undefined`, a redaction token, a non-string — keeps what is stored.
5538
+ */
5539
+ function classifySecretWrite(incoming) {
5540
+ if (isSecretClear(incoming)) return { kind: "clear" };
5541
+ if (typeof incoming !== "string") return { kind: "keep" };
5542
+ if (incoming.length === 0) return { kind: "keep" };
5543
+ if (incoming === "__camstack_redacted__" || incoming === LEGACY_DEVICE_REDACTION) return { kind: "keep" };
5544
+ return {
5545
+ kind: "set",
5546
+ value: incoming
5547
+ };
5548
+ }
5460
5549
  Object.fromEntries([
5461
5550
  {
5462
5551
  id: "overview",
@@ -5628,33 +5717,19 @@ Object.fromEntries([
5628
5717
  function isValuelessField(field) {
5629
5718
  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";
5630
5719
  }
5631
- /**
5632
- * Merge a `ConfigUISchema` with a raw `values` record into a
5633
- * `ConfigUISchemaWithValues`. Used by every `get*Settings` backend endpoint
5634
- * before returning to the admin UI. Groups are walked recursively.
5635
- *
5636
- * For each leaf field:
5637
- * - structural fields (`separator`, `info`, `button`) pass through unchanged
5638
- * - other fields get `value = values[key] ?? field.default ?? null`
5639
- *
5640
- * Unknown keys in `values` (keys not declared in the schema) are silently
5641
- * ignored — they don't contribute to the output. Missing keys fall back to
5642
- * the schema default or `null`. This mirrors the old backend behaviour where
5643
- * `FormBuilder` rendered `values[key] ?? field.default`.
5644
- */
5645
- function hydrateSchema(schema, values) {
5720
+ function hydrateSchema(schema, values, options = {}) {
5646
5721
  return {
5647
5722
  ...schema.tabs ? { tabs: [...schema.tabs] } : {},
5648
5723
  sections: schema.sections.map((section) => ({
5649
5724
  ...section,
5650
- fields: section.fields.map((field) => hydrateField(field, values))
5725
+ fields: section.fields.map((field) => hydrateField(field, values, options))
5651
5726
  }))
5652
5727
  };
5653
5728
  }
5654
- function hydrateField(field, values) {
5729
+ function hydrateField(field, values, options) {
5655
5730
  if (isValuelessField(field)) return field;
5656
5731
  if (field.type === "group") {
5657
- const hydratedChildren = field.fields.map((child) => hydrateField(child, values));
5732
+ const hydratedChildren = field.fields.map((child) => hydrateField(child, values, options));
5658
5733
  return {
5659
5734
  ...field,
5660
5735
  fields: hydratedChildren
@@ -5663,7 +5738,7 @@ function hydrateField(field, values) {
5663
5738
  if (field.type === "sub-tabs") {
5664
5739
  const hydratedTabs = field.tabs.map((tab) => ({
5665
5740
  ...tab,
5666
- fields: tab.fields.map((child) => hydrateField(child, values))
5741
+ fields: tab.fields.map((child) => hydrateField(child, values, options))
5667
5742
  }));
5668
5743
  return {
5669
5744
  ...field,
@@ -5673,6 +5748,33 @@ function hydrateField(field, values) {
5673
5748
  const key = field.key;
5674
5749
  const storedValue = Object.prototype.hasOwnProperty.call(values, key) ? values[key] : void 0;
5675
5750
  const defaultValue = field.default;
5751
+ const asView = (v) => isSecretMarker(v) || options.inlineSecretsAsViews === true && v !== void 0;
5752
+ if (isKeychainStoredField(field) && asView(storedValue)) return {
5753
+ ...field,
5754
+ value: toSecretFieldView(storedValue)
5755
+ };
5756
+ if (isKeychainStoredField(field) && options.inlineSecretsAsViews === true) return {
5757
+ ...field,
5758
+ value: null
5759
+ };
5760
+ if (field.type === "editable-array" && Array.isArray(storedValue)) {
5761
+ const secretItemKeys = field.itemFields.filter((item) => "key" in item && isKeychainStoredField(item)).map((item) => "key" in item ? item.key : "");
5762
+ if (secretItemKeys.length > 0) {
5763
+ const rows = storedValue.map((row) => {
5764
+ if (row === null || typeof row !== "object" || Array.isArray(row)) return row;
5765
+ const out = { ...row };
5766
+ for (const k of secretItemKeys) {
5767
+ const v = Reflect.get(row, k);
5768
+ if (asView(v)) out[k] = toSecretFieldView(v);
5769
+ }
5770
+ return out;
5771
+ });
5772
+ return {
5773
+ ...field,
5774
+ value: rows
5775
+ };
5776
+ }
5777
+ }
5676
5778
  if (field.multiple) {
5677
5779
  const stored = Array.isArray(storedValue) ? storedValue : storedValue !== void 0 && storedValue !== null ? [storedValue] : [];
5678
5780
  const itemFallback = field.multiple.itemDefault !== void 0 ? field.multiple.itemDefault : defaultValue !== void 0 ? defaultValue : typeOf(field) === "string" ? "" : null;
@@ -5915,6 +6017,431 @@ function projectStore(store, perNodeKeys, nodeId) {
5915
6017
  }
5916
6018
  return out;
5917
6019
  }
6020
+ var GLOBAL_SCOPE = { kind: "global" };
6021
+ /** The scope every addon-wide (not per-node, not per-device) setting lives in. */
6022
+ function globalSecretScope() {
6023
+ return GLOBAL_SCOPE;
6024
+ }
6025
+ function encodeSegment(value) {
6026
+ return encodeURIComponent(value);
6027
+ }
6028
+ /**
6029
+ * The field path of a value inside an array item, addressed by the item's id:
6030
+ * `arrayItemFieldPath('providers', 'authentik', 'clientSecret')` →
6031
+ * `providers[authentik].clientSecret`.
6032
+ */
6033
+ function arrayItemFieldPath(arrayKey, itemId, fieldKey) {
6034
+ return `${arrayKey}[${encodeSegment(itemId)}].${fieldKey}`;
6035
+ }
6036
+ /** A write to a secret path could not be stored in the keychain, so it was refused. */
6037
+ var KeychainWriteRefusedError = class extends Error {
6038
+ fieldPath;
6039
+ constructor(fieldPath, cause) {
6040
+ super(`secret "${fieldPath}" was not saved: the keychain could not store it (${cause instanceof Error ? cause.message : String(cause)}). Nothing was written.`);
6041
+ this.fieldPath = fieldPath;
6042
+ this.name = "KeychainWriteRefusedError";
6043
+ }
6044
+ };
6045
+ var KEEP = { kind: "keep" };
6046
+ function isRecord(value) {
6047
+ return typeof value === "object" && value !== null && !Array.isArray(value);
6048
+ }
6049
+ function defaultMintId() {
6050
+ return globalThis.crypto.randomUUID();
6051
+ }
6052
+ /** Every marker ref anywhere under `value`. */
6053
+ function collectSecretMarkerRefs(value, out = []) {
6054
+ if (isSecretMarker(value)) {
6055
+ out.push(value.$secret);
6056
+ return out;
6057
+ }
6058
+ if (Array.isArray(value)) for (const item of value) collectSecretMarkerRefs(item, out);
6059
+ else if (isRecord(value)) for (const child of Object.values(value)) collectSecretMarkerRefs(child, out);
6060
+ return out;
6061
+ }
6062
+ async function storedValueEquals(secrets, marker, candidate) {
6063
+ const resolved = (await secrets.resolve([marker.$secret]))[marker.$secret];
6064
+ return resolved?.kind === "value" && resolved.value === candidate;
6065
+ }
6066
+ async function writeLeaf(ctx, incoming, stored, fieldPath) {
6067
+ const intent = classifySecretWrite(incoming);
6068
+ const ref = ctx.secrets.ref(ctx.scope, fieldPath);
6069
+ const storedIsOurs = isSecretMarker(stored) && stored.$secret === ref;
6070
+ if (intent.kind === "keep") return KEEP;
6071
+ if (intent.kind === "set" && !ctx.operatorWrite && typeof stored === "string" && stored === intent.value) return KEEP;
6072
+ if (intent.kind === "clear") {
6073
+ if (storedIsOurs) ctx.deletes.push(ref);
6074
+ return {
6075
+ kind: "value",
6076
+ value: null
6077
+ };
6078
+ }
6079
+ if (storedIsOurs && await storedValueEquals(ctx.secrets, stored, intent.value)) return {
6080
+ kind: "value",
6081
+ value: stored
6082
+ };
6083
+ try {
6084
+ await ctx.secrets.put(ref, intent.value);
6085
+ } catch (err) {
6086
+ throw new KeychainWriteRefusedError(fieldPath, err);
6087
+ }
6088
+ return {
6089
+ kind: "value",
6090
+ value: makeSecretMarker(ref)
6091
+ };
6092
+ }
6093
+ /** Apply a member result onto `out`: KEEP restores the stored member, or removes it. */
6094
+ function applyMember(out, key, result, storedParent) {
6095
+ if (result.kind === "value") {
6096
+ out[key] = result.value;
6097
+ return;
6098
+ }
6099
+ if (Object.prototype.hasOwnProperty.call(storedParent, key)) out[key] = storedParent[key];
6100
+ else delete out[key];
6101
+ }
6102
+ async function writeMembers(ctx, children, incoming, stored, pathOf) {
6103
+ const out = { ...incoming };
6104
+ for (const [member, node] of children) applyMember(out, member, await writeNode(ctx, node, incoming[member], stored[member], pathOf(member)), stored);
6105
+ return out;
6106
+ }
6107
+ function rowId(row, idKey) {
6108
+ const raw = row[idKey];
6109
+ if (typeof raw === "string" && raw.length > 0) return raw;
6110
+ if (typeof raw === "number" && Number.isFinite(raw)) return String(raw);
6111
+ return null;
6112
+ }
6113
+ async function writeArray(ctx, node, incoming, stored, fieldPath) {
6114
+ const storedRows = Array.isArray(stored) ? stored.filter(isRecord) : [];
6115
+ if (!Array.isArray(incoming)) {
6116
+ ctx.deletes.push(...collectSecretMarkerRefs(storedRows));
6117
+ return {
6118
+ kind: "value",
6119
+ value: incoming
6120
+ };
6121
+ }
6122
+ const storedById = /* @__PURE__ */ new Map();
6123
+ for (const row of storedRows) {
6124
+ const id = rowId(row, node.idKey);
6125
+ if (id !== null) storedById.set(id, row);
6126
+ }
6127
+ const kept = /* @__PURE__ */ new Set();
6128
+ const rows = [];
6129
+ for (const row of incoming) {
6130
+ if (!isRecord(row)) {
6131
+ rows.push(row);
6132
+ continue;
6133
+ }
6134
+ const id = rowId(row, node.idKey) ?? ctx.mintId();
6135
+ kept.add(id);
6136
+ const withId = {
6137
+ ...row,
6138
+ [node.idKey]: row[node.idKey] ?? id
6139
+ };
6140
+ if (rowId(withId, node.idKey) === null) withId[node.idKey] = id;
6141
+ const storedRow = storedById.get(id) ?? {};
6142
+ rows.push(await writeMembers(ctx, node.item, withId, storedRow, (member) => arrayItemFieldPath(fieldPath, id, member)));
6143
+ }
6144
+ for (const [id, row] of storedById) if (!kept.has(id)) ctx.deletes.push(...collectSecretMarkerRefs(row));
6145
+ return {
6146
+ kind: "value",
6147
+ value: rows
6148
+ };
6149
+ }
6150
+ async function writeNode(ctx, node, incoming, stored, fieldPath) {
6151
+ switch (node.kind) {
6152
+ case "leaf": return writeLeaf(ctx, incoming, stored, fieldPath);
6153
+ case "array": return writeArray(ctx, node, incoming, stored, fieldPath);
6154
+ case "object": {
6155
+ if (!isRecord(incoming)) {
6156
+ if (incoming === void 0) return KEEP;
6157
+ ctx.deletes.push(...collectSecretMarkerRefs(stored));
6158
+ return {
6159
+ kind: "value",
6160
+ value: incoming
6161
+ };
6162
+ }
6163
+ const storedObj = isRecord(stored) ? stored : {};
6164
+ return {
6165
+ kind: "value",
6166
+ value: await writeMembers(ctx, node.children, incoming, storedObj, (m) => `${fieldPath}.${m}`)
6167
+ };
6168
+ }
6169
+ }
6170
+ }
6171
+ /** Split a perNode-scoped key (`key@nodeId`). */
6172
+ function splitNodeKey(key) {
6173
+ const at = key.indexOf("@");
6174
+ return at <= 0 ? {
6175
+ base: key,
6176
+ nodeId: null
6177
+ } : {
6178
+ base: key.slice(0, at),
6179
+ nodeId: key.slice(at + 1)
6180
+ };
6181
+ }
6182
+ /** Rewrite a settings patch so no secret value reaches the blob. See the file doc. */
6183
+ async function transformSecretWrite(input) {
6184
+ const deletes = [];
6185
+ const base = {
6186
+ secrets: input.secrets,
6187
+ mintId: input.mintId ?? defaultMintId,
6188
+ deletes,
6189
+ operatorWrite: input.operatorWrite === true
6190
+ };
6191
+ const out = {};
6192
+ for (const [key, incoming] of Object.entries(input.patch)) {
6193
+ const { base: baseKey, nodeId } = splitNodeKey(key);
6194
+ const node = input.tree.get(baseKey);
6195
+ if (node === void 0) {
6196
+ out[key] = incoming;
6197
+ continue;
6198
+ }
6199
+ const scope = nodeId !== null && nodeId.length > 0 ? {
6200
+ kind: "node",
6201
+ nodeId
6202
+ } : input.scope ?? globalSecretScope();
6203
+ const result = await writeNode({
6204
+ ...base,
6205
+ scope
6206
+ }, node, incoming, input.stored[key], baseKey);
6207
+ if (result.kind === "value") out[key] = result.value;
6208
+ }
6209
+ return {
6210
+ patch: out,
6211
+ afterWrite: async () => {
6212
+ if (deletes.length === 0) return { orphaned: [] };
6213
+ try {
6214
+ await input.secrets.delete([...new Set(deletes)]);
6215
+ return { orphaned: [] };
6216
+ } catch {
6217
+ return { orphaned: [...new Set(deletes)] };
6218
+ }
6219
+ }
6220
+ };
6221
+ }
6222
+ /**
6223
+ * Replace every marker in `value` with its keychain value. Returns the SAME
6224
+ * reference when there is no marker (no allocation, no keychain call).
6225
+ */
6226
+ async function resolveSecretMarkers(value, secrets) {
6227
+ const refs = collectSecretMarkerRefs(value);
6228
+ if (refs.length === 0) return {
6229
+ value,
6230
+ unresolved: []
6231
+ };
6232
+ const answers = await secrets.resolve(refs);
6233
+ const unresolved = [];
6234
+ for (const ref of new Set(refs)) {
6235
+ const answer = answers[ref];
6236
+ if (answer === void 0) unresolved.push({
6237
+ ref,
6238
+ reason: "not-initialized"
6239
+ });
6240
+ else if (answer.kind === "unavailable") unresolved.push({
6241
+ ref,
6242
+ reason: answer.reason
6243
+ });
6244
+ else if (answer.kind === "missing" || answer.kind === "forbidden") unresolved.push({
6245
+ ref,
6246
+ reason: answer.kind
6247
+ });
6248
+ }
6249
+ const substitute = (v) => {
6250
+ if (isSecretMarker(v)) {
6251
+ const answer = answers[v.$secret];
6252
+ return answer?.kind === "value" ? {
6253
+ keep: true,
6254
+ value: answer.value
6255
+ } : {
6256
+ keep: false,
6257
+ value: void 0
6258
+ };
6259
+ }
6260
+ if (Array.isArray(v)) {
6261
+ const items = [];
6262
+ for (const item of v) {
6263
+ const s = substitute(item);
6264
+ if (s.keep) items.push(s.value);
6265
+ }
6266
+ return {
6267
+ keep: true,
6268
+ value: items
6269
+ };
6270
+ }
6271
+ if (isRecord(v)) {
6272
+ const out = {};
6273
+ for (const [k, child] of Object.entries(v)) {
6274
+ const s = substitute(child);
6275
+ if (s.keep) out[k] = s.value;
6276
+ }
6277
+ return {
6278
+ keep: true,
6279
+ value: out
6280
+ };
6281
+ }
6282
+ return {
6283
+ keep: true,
6284
+ value: v
6285
+ };
6286
+ };
6287
+ return {
6288
+ value: substitute(value).value,
6289
+ unresolved
6290
+ };
6291
+ }
6292
+ function touchesTree(tree, patch) {
6293
+ if (tree.size === 0) return false;
6294
+ for (const key of Object.keys(patch)) {
6295
+ const at = key.indexOf("@");
6296
+ if (tree.has(at > 0 ? key.slice(0, at) : key)) return true;
6297
+ }
6298
+ return false;
6299
+ }
6300
+ /** The blob as stored now; a failed read REFUSES the write instead of guessing. */
6301
+ async function readStoredAddonBlob(raw) {
6302
+ const threeWay = raw.readAddonStoreResult;
6303
+ if (threeWay === void 0) return raw.readAddonStore();
6304
+ const result = await threeWay.call(raw);
6305
+ if (result.kind === "failed") throw new Error(`settings write refused: the stored blob could not be read (${result.error})`);
6306
+ return result.kind === "missing" ? {} : result.value;
6307
+ }
6308
+ function createSecretAwareSettings(raw, opts) {
6309
+ const chains = /* @__PURE__ */ new Map();
6310
+ const serialize = (key, fn) => {
6311
+ const next = (chains.get(key) ?? Promise.resolve()).then(fn, fn);
6312
+ const tail = next.catch(() => void 0);
6313
+ chains.set(key, tail);
6314
+ tail.then(() => {
6315
+ if (chains.get(key) === tail) chains.delete(key);
6316
+ });
6317
+ return next;
6318
+ };
6319
+ const write = async (chainKey, tree, scope, patch, readStored, rawWrite) => {
6320
+ if (!touchesTree(tree, patch)) return rawWrite(patch);
6321
+ return serialize(chainKey, async () => {
6322
+ const stored = await readStored();
6323
+ const result = await transformSecretWrite({
6324
+ tree,
6325
+ secrets: opts.secrets,
6326
+ patch,
6327
+ stored,
6328
+ ...scope !== void 0 ? { scope } : {},
6329
+ operatorWrite: opts.isOperatorWrite?.() === true
6330
+ });
6331
+ if (Object.keys(result.patch).length > 0) await rawWrite(result.patch);
6332
+ const { orphaned } = await result.afterWrite();
6333
+ if (orphaned.length > 0) opts.onOrphaned(orphaned);
6334
+ });
6335
+ };
6336
+ const wrapped = {
6337
+ writeAddonStore: (patch) => write("addon", opts.addonTree(), void 0, patch, () => readStoredAddonBlob(raw), (p) => raw.writeAddonStore(p)),
6338
+ writeDeviceStore: (deviceId, patch) => write(`device:${deviceId}`, opts.deviceTree(), {
6339
+ kind: "device",
6340
+ deviceId
6341
+ }, patch, () => raw.readDeviceStore(deviceId), (p) => raw.writeDeviceStore(deviceId, p))
6342
+ };
6343
+ return new Proxy(raw, { get(target, prop, receiver) {
6344
+ if (prop === "writeAddonStore") return wrapped.writeAddonStore;
6345
+ if (prop === "writeDeviceStore") return wrapped.writeDeviceStore;
6346
+ const value = Reflect.get(target, prop, receiver);
6347
+ return typeof value === "function" ? value.bind(target) : value;
6348
+ } });
6349
+ }
6350
+ /** The context the addon sees: identical, except that its settings writes are secret-aware. */
6351
+ function withSecretAwareSettings(context, opts) {
6352
+ const raw = context.settings;
6353
+ if (raw === void 0) return context;
6354
+ const settings = createSecretAwareSettings(raw, opts);
6355
+ return new Proxy(context, { get(target, prop, receiver) {
6356
+ if (prop === "settings") return settings;
6357
+ return Reflect.get(target, prop, receiver);
6358
+ } });
6359
+ }
6360
+ var LEAF = { kind: "leaf" };
6361
+ var DEFAULT_ITEM_ID_KEY = "id";
6362
+ function collectFields(fields, out) {
6363
+ for (const field of fields) {
6364
+ if (field.type === "group") {
6365
+ collectFields(field.fields, out);
6366
+ continue;
6367
+ }
6368
+ if (field.type === "sub-tabs") {
6369
+ for (const tab of field.tabs) collectFields(tab.fields, out);
6370
+ continue;
6371
+ }
6372
+ if (field.type === "editable-array") {
6373
+ const item = /* @__PURE__ */ new Map();
6374
+ for (const itemField of field.itemFields) if ("key" in itemField && isKeychainStoredField(itemField)) item.set(itemField.key, LEAF);
6375
+ if (item.size > 0) out.set(field.key, {
6376
+ kind: "array",
6377
+ idKey: field.itemIdKey ?? DEFAULT_ITEM_ID_KEY,
6378
+ item
6379
+ });
6380
+ continue;
6381
+ }
6382
+ if (!("key" in field) || typeof field.key !== "string") continue;
6383
+ if (isKeychainStoredField(field)) out.set(field.key, LEAF);
6384
+ }
6385
+ }
6386
+ /** The secret tree a settings schema declares. */
6387
+ function secretTreeFromSchema(schema) {
6388
+ const out = /* @__PURE__ */ new Map();
6389
+ if (schema === null) return out;
6390
+ for (const section of schema.sections) collectFields(section.fields, out);
6391
+ return out;
6392
+ }
6393
+ /** Parse `a.b[id].c` into segments; throws on a malformed path (a declaration bug). */
6394
+ function parseSecretStatePath(path) {
6395
+ const segments = [];
6396
+ for (const raw of path.split(".")) {
6397
+ const m = /^([^[\]]+)(?:\[([^[\]]+)\])?$/.exec(raw);
6398
+ if (m === null || m[1] === void 0) throw new Error(`secretStatePaths: malformed path "${path}"`);
6399
+ segments.push(m[2] !== void 0 ? {
6400
+ key: m[1],
6401
+ idKey: m[2]
6402
+ } : { key: m[1] });
6403
+ }
6404
+ if (segments.length === 0) throw new Error(`secretStatePaths: empty path`);
6405
+ if (segments[segments.length - 1]?.idKey !== void 0) throw new Error(`secretStatePaths: "${path}" ends on an array — name the member that is secret`);
6406
+ return segments;
6407
+ }
6408
+ function insert(into, segments) {
6409
+ const [head, ...rest] = segments;
6410
+ if (head === void 0) return;
6411
+ if (rest.length === 0) {
6412
+ into.set(head.key, LEAF);
6413
+ return;
6414
+ }
6415
+ const existing = into.get(head.key);
6416
+ if (head.idKey !== void 0) {
6417
+ const item = new Map(existing?.kind === "array" ? existing.item : []);
6418
+ insert(item, rest);
6419
+ into.set(head.key, {
6420
+ kind: "array",
6421
+ idKey: head.idKey,
6422
+ item
6423
+ });
6424
+ return;
6425
+ }
6426
+ const children = new Map(existing?.kind === "object" ? existing.children : []);
6427
+ insert(children, rest);
6428
+ into.set(head.key, {
6429
+ kind: "object",
6430
+ children
6431
+ });
6432
+ }
6433
+ /** Add hidden-state paths (`secretStatePaths`) to a schema-derived tree. */
6434
+ function mergeSecretStatePaths(tree, paths) {
6435
+ if (paths.length === 0) return tree;
6436
+ const out = new Map(tree);
6437
+ for (const path of paths) insert(out, parseSecretStatePath(path));
6438
+ return out;
6439
+ }
6440
+ /** First retry of a secret the keychain could not serve; doubles to {@link SECRET_RETRY_MAX_MS}. */
6441
+ var SECRET_RETRY_FIRST_MS = 5e3;
6442
+ var SECRET_RETRY_MAX_MS = 5 * 6e4;
6443
+ /** Coalesces a burst of `keychain.changed` events into one re-resolve. */
6444
+ var SECRET_CHANGE_DEBOUNCE_MS = 250;
5918
6445
  /**
5919
6446
  * Base class for CamStack addons. Eliminates settings boilerplate:
5920
6447
  *
@@ -5984,6 +6511,25 @@ var BaseAddon = class {
5984
6511
  settingsStoreReady = false;
5985
6512
  /** Default config values. Provided via constructor. */
5986
6513
  defaults;
6514
+ /**
6515
+ * Hidden-state paths that hold secrets (D787) — values the addon writes
6516
+ * itself (`updateGlobalSettings`, `state()`) that no form field declares.
6517
+ * Stored in the keychain exactly like a `password` field. Syntax:
6518
+ * `'snapshotSigningKey'`, `'identity.pincode'`, `'tokens[userId].accessToken'`
6519
+ * (`key[<id field>]` addresses array items by id, never by index).
6520
+ */
6521
+ secretStatePaths = [];
6522
+ _addonSecretTree = null;
6523
+ _deviceSecretTree = null;
6524
+ /** Refs the last resolved config pointed at — a change to one re-resolves. */
6525
+ _configSecretRefs = /* @__PURE__ */ new Set();
6526
+ _unresolvedSecrets = [];
6527
+ _secretRetryTimer = null;
6528
+ _secretRetryDelayMs = SECRET_RETRY_FIRST_MS;
6529
+ _secretChangeTimer = null;
6530
+ _secretChangeUnsub = null;
6531
+ /** >0 while an OPERATOR's settings write is being applied. */
6532
+ _operatorWriteDepth = 0;
5987
6533
  constructor(defaults) {
5988
6534
  this.defaults = defaults;
5989
6535
  this._config = { ...defaults };
@@ -6019,8 +6565,18 @@ var BaseAddon = class {
6019
6565
  return this._config;
6020
6566
  }
6021
6567
  async initialize(context) {
6022
- this._ctx = context;
6568
+ const secrets = context.secrets;
6569
+ this._ctx = secrets !== void 0 ? withSecretAwareSettings(context, {
6570
+ secrets,
6571
+ addonTree: () => this.addonSecretTree(),
6572
+ deviceTree: () => this.deviceSecretTree(),
6573
+ onOrphaned: (refs) => context.logger.warn("keychain refs dropped by a settings write could not be deleted", { meta: { refs: [...refs] } }),
6574
+ isOperatorWrite: () => this._operatorWriteDepth > 0
6575
+ }) : context;
6023
6576
  await this.resolveConfig();
6577
+ if (secrets !== void 0) this._secretChangeUnsub = secrets.onChange((ref) => {
6578
+ if (this._configSecretRefs.has(ref)) this.scheduleSecretReresolve(SECRET_CHANGE_DEBOUNCE_MS);
6579
+ });
6024
6580
  const result = await this.onInitialize();
6025
6581
  this.emitLifecycle(EventCategory.AddonStarted);
6026
6582
  const normalized = normalizeAddonInitResult(result);
@@ -6053,6 +6609,12 @@ var BaseAddon = class {
6053
6609
  */
6054
6610
  async onHubReachable() {}
6055
6611
  async shutdown() {
6612
+ this._secretChangeUnsub?.();
6613
+ this._secretChangeUnsub = null;
6614
+ if (this._secretRetryTimer !== null) clearTimeout(this._secretRetryTimer);
6615
+ if (this._secretChangeTimer !== null) clearTimeout(this._secretChangeTimer);
6616
+ this._secretRetryTimer = null;
6617
+ this._secretChangeTimer = null;
6056
6618
  this.emitLifecycle(EventCategory.AddonStopped);
6057
6619
  if (this.autoEmitReadiness) this.emitReadinessForProviders("down");
6058
6620
  await this.onShutdown();
@@ -6131,7 +6693,7 @@ var BaseAddon = class {
6131
6693
  return hydrateSchema(schema, overlay ? {
6132
6694
  ...projected,
6133
6695
  ...overlay
6134
- } : projected);
6696
+ } : projected, { inlineSecretsAsViews: true });
6135
6697
  }
6136
6698
  /**
6137
6699
  * The integration-level view of this addon's settings: exactly the sections
@@ -6180,7 +6742,7 @@ var BaseAddon = class {
6180
6742
  return hydrateSchema({
6181
6743
  ...schema,
6182
6744
  sections
6183
- }, projected);
6745
+ }, projected, { inlineSecretsAsViews: true });
6184
6746
  }
6185
6747
  /**
6186
6748
  * The raw addon store PROJECTED onto the target node's bare per-node keys:
@@ -6234,18 +6796,50 @@ var BaseAddon = class {
6234
6796
  value: result.value[key]
6235
6797
  };
6236
6798
  }
6799
+ /**
6800
+ * The OPERATOR's write — a settings form or an admin API call, dispatched by
6801
+ * the kernel. Identical to {@link updateGlobalSettings}, except that a secret
6802
+ * the operator sends is stored as sent even when it equals a pre-keychain
6803
+ * inline value: the operator re-entering a password is a change, an addon
6804
+ * writing back what it read is not (D787).
6805
+ */
6806
+ async updateGlobalSettingsAsOperator(patch, nodeId) {
6807
+ this._operatorWriteDepth++;
6808
+ try {
6809
+ await this.applyGlobalPatch(patch, nodeId);
6810
+ } finally {
6811
+ this._operatorWriteDepth--;
6812
+ }
6813
+ }
6237
6814
  async updateGlobalSettings(patch, nodeId) {
6815
+ await this.applyGlobalPatch(patch, nodeId);
6816
+ }
6817
+ /**
6818
+ * REMOVE stored secrets — their keychain values and their markers (D787).
6819
+ *
6820
+ * Writing `''` to a secret field KEEPS what is stored (an empty string is
6821
+ * what a defaults fallback writes back, and it must never destroy a
6822
+ * credential), so code that means "forget this token" says so here. Without
6823
+ * a keychain (an older kernel) it writes `''`, as such code always did.
6824
+ */
6825
+ async clearSecrets(keys, nodeId) {
6826
+ const tree = this.addonSecretTree();
6827
+ const keychain = this._ctx?.secrets !== void 0;
6828
+ const patch = {};
6829
+ for (const key of keys) patch[key] = keychain && tree.has(key) ? SECRET_CLEAR : "";
6830
+ await this.applyGlobalPatch(patch, nodeId);
6831
+ }
6832
+ async applyGlobalPatch(barePatch, nodeId) {
6238
6833
  const keys = this.perNodeKeys();
6239
6834
  const localNode = normalizeNodeId(this._ctx?.kernel?.localNodeId);
6240
6835
  const target = normalizeNodeId(nodeId ?? this._ctx?.kernel?.localNodeId);
6241
- const barePatch = patch;
6242
6836
  const scoped = keys.size > 0 ? scopePatch(barePatch, keys, target) : barePatch;
6243
6837
  await this._ctx?.settings?.writeAddonStore(scoped);
6244
6838
  if (target !== localNode) return;
6245
6839
  await this.resolveConfig();
6246
6840
  await this.onConfigChanged();
6247
6841
  this.emitLifecycle(EventCategory.AddonUpdated, { level: "global" });
6248
- this.maybeAutoRestart(patch, this.globalSettingsSchema());
6842
+ this.maybeAutoRestart(Object.keys(barePatch), this.globalSettingsSchema());
6249
6843
  }
6250
6844
  /**
6251
6845
  * The set of field keys the global settings schema declares `perNode: true`
@@ -6270,7 +6864,7 @@ var BaseAddon = class {
6270
6864
  * time to return its response before the addon is torn down and
6271
6865
  * re-initialised by `AddonRegistryService.restartAddon`.
6272
6866
  */
6273
- maybeAutoRestart(patch, schema) {
6867
+ maybeAutoRestart(patchKeys, schema) {
6274
6868
  if (!schema) return;
6275
6869
  const restartKeys = /* @__PURE__ */ new Set();
6276
6870
  for (const section of schema.sections) for (const field of section.fields) {
@@ -6278,13 +6872,13 @@ var BaseAddon = class {
6278
6872
  if (field.requiresRestart) restartKeys.add(field.key);
6279
6873
  }
6280
6874
  if (restartKeys.size === 0) return;
6281
- if (!Object.keys(patch).some((k) => restartKeys.has(k))) return;
6875
+ if (!patchKeys.some((k) => restartKeys.has(k))) return;
6282
6876
  const ctx = this._ctx;
6283
6877
  if (!ctx) return;
6284
6878
  const addonId = ctx.id;
6285
6879
  setImmediate(() => {
6286
6880
  ctx.api.addons?.restartAddon?.mutate({ addonId }).then(() => {
6287
- ctx.logger.info("addon auto-restart triggered by restart-required setting change", { meta: { changedFields: Object.keys(patch).filter((k) => restartKeys.has(k)) } });
6881
+ ctx.logger.info("addon auto-restart triggered by restart-required setting change", { meta: { changedFields: patchKeys.filter((k) => restartKeys.has(k)) } });
6288
6882
  }).catch((err) => {
6289
6883
  ctx.logger.error("addon auto-restart failed", { meta: { error: err instanceof Error ? err.message : String(err) } });
6290
6884
  });
@@ -6293,7 +6887,7 @@ var BaseAddon = class {
6293
6887
  async getDeviceSettings(deviceId) {
6294
6888
  const schema = this.deviceSettingsSchema();
6295
6889
  if (!schema) return { sections: [] };
6296
- return hydrateSchema(schema, await this._ctx?.settings?.readDeviceStore(deviceId) ?? {});
6890
+ return hydrateSchema(schema, await this._ctx?.settings?.readDeviceStore(deviceId) ?? {}, { inlineSecretsAsViews: true });
6297
6891
  }
6298
6892
  async updateDeviceSettings(deviceId, patch) {
6299
6893
  await this._ctx?.settings?.writeDeviceStore(deviceId, patch);
@@ -6423,7 +7017,7 @@ var BaseAddon = class {
6423
7017
  * selection at boot (absent scoped key ⇒ the constructor default wins).
6424
7018
  */
6425
7019
  async resolveConfig() {
6426
- const stored = await this.readAddonStoreWithRetry();
7020
+ const stored = await this.resolveStoredSecrets(await this.readAddonStoreWithRetry());
6427
7021
  const perNode = this.perNodeKeys();
6428
7022
  const localNode = normalizeNodeId(this._ctx?.kernel?.localNodeId);
6429
7023
  const resolved = { ...this.defaults };
@@ -6448,7 +7042,7 @@ var BaseAddon = class {
6448
7042
  key,
6449
7043
  schema,
6450
7044
  fallback,
6451
- read: () => this.readAddonStoreWithRetry(),
7045
+ read: async () => this.resolveStoredSecrets(await this.readAddonStoreWithRetry()),
6452
7046
  write: async (patch) => {
6453
7047
  await this._ctx?.settings?.writeAddonStore(patch);
6454
7048
  },
@@ -6465,7 +7059,7 @@ var BaseAddon = class {
6465
7059
  key,
6466
7060
  schema,
6467
7061
  fallback,
6468
- read: async () => await this._ctx?.settings?.readDeviceStore(deviceId) ?? {},
7062
+ read: async () => this.resolveStoredSecrets(await this._ctx?.settings?.readDeviceStore(deviceId) ?? {}, false),
6469
7063
  write: async (patch) => {
6470
7064
  await this._ctx?.settings?.writeDeviceStore(deviceId, patch);
6471
7065
  },
@@ -6477,6 +7071,70 @@ var BaseAddon = class {
6477
7071
  } })
6478
7072
  });
6479
7073
  }
7074
+ /** The addon store's secret tree: schema fields by TYPE, plus `secretStatePaths`. */
7075
+ addonSecretTree() {
7076
+ this._addonSecretTree ??= mergeSecretStatePaths(secretTreeFromSchema(this.globalSettingsSchema()), this.secretStatePaths);
7077
+ return this._addonSecretTree;
7078
+ }
7079
+ deviceSecretTree() {
7080
+ this._deviceSecretTree ??= secretTreeFromSchema(this.deviceSettingsSchema());
7081
+ return this._deviceSecretTree;
7082
+ }
7083
+ /**
7084
+ * Secrets of this addon's stored config that could not be resolved on the
7085
+ * last read, with why. Non-empty means the addon is running WITHOUT them —
7086
+ * an addon whose function needs one should report itself degraded rather
7087
+ * than start on an empty credential.
7088
+ */
7089
+ get unresolvedSecrets() {
7090
+ return this._unresolvedSecrets;
7091
+ }
7092
+ /**
7093
+ * Substitute every keychain marker in a stored blob with its value. With no
7094
+ * keychain (no `ctx.secrets`) or no marker, the blob comes back unchanged.
7095
+ * An unresolvable value is LEFT OUT (never `''`), logged by ref — never by
7096
+ * value — and, when the cause can pass, retried with backoff. Nothing is
7097
+ * ever written back from here.
7098
+ */
7099
+ async resolveStoredSecrets(blob, trackForConfig = true) {
7100
+ const secrets = this._ctx?.secrets;
7101
+ if (secrets === void 0) return blob;
7102
+ const refs = collectSecretMarkerRefs(blob);
7103
+ if (trackForConfig) this._configSecretRefs = new Set(refs);
7104
+ if (refs.length === 0) {
7105
+ if (trackForConfig) this._unresolvedSecrets = [];
7106
+ return blob;
7107
+ }
7108
+ const { value, unresolved } = await resolveSecretMarkers(blob, secrets);
7109
+ if (trackForConfig) {
7110
+ this._unresolvedSecrets = unresolved;
7111
+ if (unresolved.length > 0) {
7112
+ this._ctx?.logger?.error?.("secret unavailable — running without it, will retry", { meta: { secrets: unresolved.map((u) => ({
7113
+ ref: u.ref,
7114
+ reason: u.reason
7115
+ })) } });
7116
+ if (unresolved.some((u) => u.reason !== "missing" && u.reason !== "forbidden")) {
7117
+ this.scheduleSecretReresolve(this._secretRetryDelayMs);
7118
+ this._secretRetryDelayMs = Math.min(this._secretRetryDelayMs * 2, SECRET_RETRY_MAX_MS);
7119
+ }
7120
+ } else this._secretRetryDelayMs = SECRET_RETRY_FIRST_MS;
7121
+ }
7122
+ return value;
7123
+ }
7124
+ /** Re-resolve the config (a keychain-only change, or a retry) and apply it. */
7125
+ scheduleSecretReresolve(delayMs) {
7126
+ const timerOf = delayMs === SECRET_CHANGE_DEBOUNCE_MS ? "_secretChangeTimer" : "_secretRetryTimer";
7127
+ if (this[timerOf] !== null) return;
7128
+ const timer = setTimeout(() => {
7129
+ this[timerOf] = null;
7130
+ if (this._ctx === null) return;
7131
+ this.resolveConfig().then(() => this.onConfigChanged()).catch((err) => {
7132
+ this._ctx?.logger?.error?.("re-resolving secrets failed", { meta: { error: err instanceof Error ? err.message : String(err) } });
7133
+ });
7134
+ }, delayMs);
7135
+ timer.unref?.();
7136
+ this[timerOf] = timer;
7137
+ }
6480
7138
  /**
6481
7139
  * Wrap `ctx.settings.readAddonStore()` with a short retry budget so a
6482
7140
  * transient settings-store outage (mid-restart of sqlite-settings, tsx-watch
@@ -6744,32 +7402,12 @@ object({
6744
7402
  audioCodec: string().optional(),
6745
7403
  metadata: record(string(), unknown()).readonly().optional()
6746
7404
  });
6747
- var EncodedPacketSchema = object({
6748
- type: _enum(["video", "audio"]),
6749
- data: _instanceof(Uint8Array),
6750
- pts: number(),
6751
- dts: number(),
6752
- keyframe: boolean(),
6753
- codec: string()
6754
- });
6755
- var DecodedFrameSchema = object({
6756
- data: _instanceof(Uint8Array),
6757
- width: number(),
6758
- height: number(),
6759
- format: _enum([
6760
- "jpeg",
6761
- "rgb",
6762
- "bgr",
6763
- "yuv420",
6764
- "gray"
6765
- ]),
6766
- timestamp: number()
6767
- });
6768
7405
  /**
6769
7406
  * Wire schema for `FrameHandle` — a zero-pixel, serialisable reference to a
6770
7407
  * frame in a shared-memory ring (Phase 5 / D9). Mirrors the `FrameHandle` TS
6771
- * interface in `interfaces/frame-handle.ts` field-for-field so a decoder cap
6772
- * method (`pullHandles`) can carry handles over tRPC / Moleculer.
7408
+ * interface in `interfaces/frame-handle.ts` field-for-field so a cap method
7409
+ * (the runner's native-crop and pipeline-executor inputs) can carry handles
7410
+ * over tRPC / Moleculer.
6773
7411
  *
6774
7412
  * The `satisfies` assertion below pins this schema to the interface: if a
6775
7413
  * field is added to / removed from `FrameHandle` without a matching schema
@@ -6795,50 +7433,6 @@ var FrameHandleSchema = object({
6795
7433
  slotCount: number().int().positive()
6796
7434
  });
6797
7435
  /**
6798
- * Pixel format a frame-handle subscriber can request from the broker
6799
- * (Phase 5 / D9). The packed, raster subset of `FrameFormat` — the formats a
6800
- * `frameSink: 'shm'` decoder session can write into a `FrameRing` slot.
6801
- * `jpeg` is excluded: a variable-length stream is not a fixed-stride ring
6802
- * payload, and no decoded-frame consumer requests it over the shm plane.
6803
- */
6804
- var FrameHandleFormatSchema = _enum([
6805
- "rgb",
6806
- "bgr",
6807
- "yuv420",
6808
- "gray"
6809
- ]);
6810
- /**
6811
- * Input for `stream-broker.subscribeFrames` (Phase 5 / D9). A consumer asks the
6812
- * broker for a `FrameHandle` stream of one `format`; the broker maintains one
6813
- * shared-memory ring per `(brokerId, format)` actually requested, so a `gray`
6814
- * subscriber (motion) and an `rgb` subscriber (detection) each read the format
6815
- * they asked for with no broker-side conversion.
6816
- */
6817
- var SubscribeFramesInputSchema = object({
6818
- brokerId: string(),
6819
- format: FrameHandleFormatSchema,
6820
- /**
6821
- * Optional reader-side cadence hint in frames per second. The broker does
6822
- * NOT throttle — latest-wins ring reads drop frames implicitly for a slow
6823
- * consumer. The value is echoed back in `SubscribeFramesResult.maxFps` so
6824
- * the consumer can pace its own `pullFrameHandles` polling.
6825
- */
6826
- maxFps: number().positive().optional(),
6827
- /** Short caller-identity tag (`motion`, `detection`, …) for diagnostics. */
6828
- tag: string().optional()
6829
- });
6830
- /**
6831
- * Result of `stream-broker.subscribeFrames`. The consumer then polls
6832
- * `pullFrameHandles({ subscriptionId, maxCount })` and feeds each returned
6833
- * `FrameHandle` to a `FrameRingReader`.
6834
- */
6835
- var SubscribeFramesResultSchema = object({
6836
- /** Opaque id the consumer passes to `pullFrameHandles` / `unsubscribeFrames`. */
6837
- subscriptionId: string(),
6838
- /** Reader-side cadence hint (frames/s) — echoes `SubscribeFramesInput.maxFps`. */
6839
- maxFps: number().nonnegative()
6840
- });
6841
- /**
6842
7436
  * Wire schema for a decoded audio chunk (Phase 5 / D9). Mirrors the
6843
7437
  * `DecodedAudioChunk` TS interface in `interfaces/stream-broker.ts`: PCM
6844
7438
  * sample bytes plus the track parameters a consumer needs to interpret them.
@@ -6846,8 +7440,8 @@ var SubscribeFramesResultSchema = object({
6846
7440
  * Audio chunks are tiny (a ~500ms AudioCodecSession window is a few KB of
6847
7441
  * Float32 PCM), so unlike video frames they ship their bytes INLINE over
6848
7442
  * tRPC / Moleculer — no shared-memory plane. `data` is typed `Uint8Array`
6849
- * (the wire-serialisable supertype of `Buffer`) to match `DecodedFrameSchema`
6850
- * / `EncodedPacketSchema`'s precedent; a `Buffer` is assignable to it.
7443
+ * (the wire-serialisable supertype of `Buffer`); a `Buffer` is assignable to
7444
+ * it.
6851
7445
  */
6852
7446
  var AudioChunkFormatSchema = _enum(AUDIO_CHUNK_FORMATS);
6853
7447
  var DecodedAudioChunkSchema = object({
@@ -6865,11 +7459,10 @@ var DecodedAudioChunkSchema = object({
6865
7459
  format: AudioChunkFormatSchema.optional()
6866
7460
  });
6867
7461
  /**
6868
- * Input for `stream-broker.subscribeAudioChunks` (Phase 5 / D9). The
6869
- * handle-free, ship-bytes-inline analogue of `subscribeFrames`: a consumer
6870
- * asks the broker for the decoded audio-chunk stream of one broker; the
6871
- * broker keeps a per-subscription bounded FIFO queue the consumer drains via
6872
- * `pullAudioChunks`.
7462
+ * Input for `stream-broker.subscribeAudioChunks` (Phase 5 / D9). Audio ships
7463
+ * its bytes inline: a consumer asks the broker for the decoded audio-chunk
7464
+ * stream of one broker; the broker keeps a per-subscription bounded FIFO queue
7465
+ * the consumer drains via `pullAudioChunks`.
6873
7466
  */
6874
7467
  var SubscribeAudioChunksInputSchema = object({
6875
7468
  brokerId: string(),
@@ -6900,9 +7493,7 @@ var BrokerStatsSchema = object({
6900
7493
  "stopped"
6901
7494
  ]),
6902
7495
  inputFps: number(),
6903
- decodeFps: number(),
6904
7496
  encodedSubscribers: number(),
6905
- decodedSubscribers: number(),
6906
7497
  uptimeMs: number(),
6907
7498
  bitrateKbps: number(),
6908
7499
  idrIntervalMs: number(),
@@ -6915,14 +7506,6 @@ var BrokerStatsSchema = object({
6915
7506
  preBufferMs: number(),
6916
7507
  preBufferPackets: number(),
6917
7508
  /**
6918
- * Moleculer node id of the decoder provider currently servicing this
6919
- * stream's decoded subscribers. `null` until the deferred decoder is
6920
- * created (no decoded clients yet, or codec not detected). Surfaces the
6921
- * runtime decoder placement so the UI can show "Decoder: <agent>" without
6922
- * a separate cap call per broker.
6923
- */
6924
- decoderNodeId: string().nullable(),
6925
- /**
6926
7509
  * Detected audio track parameters from the RTSP DESCRIBE / SDP. `null`
6927
7510
  * when the stream has no audio track or the broker is in cold start.
6928
7511
  * `supported = false` means the codec was detected but the local
@@ -7186,6 +7769,69 @@ method(object({ deviceId: number() }), array(StreamSourceEntrySchema)), method(o
7186
7769
  kind: "mutation",
7187
7770
  auth: "admin"
7188
7771
  }), method(object({ deviceId: number() }), unknown().nullable()), method(object({ deviceId: number() }), RawStateResultSchema.nullable(), { auth: "protected" });
7772
+ function defOf(schema) {
7773
+ return schema._zod?.def ?? {};
7774
+ }
7775
+ function declaredHere(schema) {
7776
+ return globalRegistry.get(schema)?.secret === true;
7777
+ }
7778
+ /** Wrapper kinds whose `innerType` is the field itself. */
7779
+ var WRAPPERS = new Set([
7780
+ "optional",
7781
+ "nullable",
7782
+ "default",
7783
+ "prefault",
7784
+ "catch",
7785
+ "readonly",
7786
+ "nonoptional"
7787
+ ]);
7788
+ /**
7789
+ * The schema layers that make up ONE field: the schema itself and every
7790
+ * wrapper below it (optional / default / nullable / readonly / catch), plus
7791
+ * both sides of a pipe (`z.preprocess` puts the real schema on `out`,
7792
+ * `.transform` on `in`).
7793
+ */
7794
+ function layersOf(schema) {
7795
+ const out = [];
7796
+ const queue = [schema];
7797
+ while (queue.length > 0) {
7798
+ const s = queue.shift();
7799
+ if (!s || out.includes(s)) continue;
7800
+ out.push(s);
7801
+ const def = defOf(s);
7802
+ if (def.type !== void 0 && WRAPPERS.has(def.type) && def.innerType) queue.push(def.innerType);
7803
+ if (def.type === "pipe") {
7804
+ if (def.in) queue.push(def.in);
7805
+ if (def.out) queue.push(def.out);
7806
+ }
7807
+ }
7808
+ return out;
7809
+ }
7810
+ /** True when any layer of this field declares `.meta({ secret: true })`. */
7811
+ function isZodSecret(schema) {
7812
+ return layersOf(schema).some(declaredHere);
7813
+ }
7814
+ /**
7815
+ * Every declared secret path in a config schema: dotted keys, `[]` for "each
7816
+ * element of this array" (`connection.password`, `rows[].token`). A declared
7817
+ * object or array is reported as one path and not descended into — everything
7818
+ * under it is secret.
7819
+ */
7820
+ function collectZodSecretPaths(schema, prefix = "") {
7821
+ if (isZodSecret(schema)) return prefix.length > 0 ? [prefix] : [];
7822
+ const paths = [];
7823
+ for (const layer of layersOf(schema)) {
7824
+ const def = defOf(layer);
7825
+ if (def.type === "object" && def.shape) for (const [key, child] of Object.entries(def.shape)) paths.push(...collectZodSecretPaths(child, prefix ? `${prefix}.${key}` : key));
7826
+ else if (def.type === "array" && def.element) paths.push(...collectZodSecretPaths(def.element, `${prefix}[]`));
7827
+ else if (def.type === "union" && def.options) for (const option of def.options) paths.push(...collectZodSecretPaths(option, prefix));
7828
+ else if (def.type === "intersection") {
7829
+ if (def.left) paths.push(...collectZodSecretPaths(def.left, prefix));
7830
+ if (def.right) paths.push(...collectZodSecretPaths(def.right, prefix));
7831
+ }
7832
+ }
7833
+ return [...new Set(paths)];
7834
+ }
7189
7835
  //#endregion
7190
7836
  //#region ../types/dist/err-msg-DX6i_MY4.mjs
7191
7837
  var DeviceType = /* @__PURE__ */ function(DeviceType) {
@@ -8451,8 +9097,8 @@ function buildAddonRouteProvider(id, routes) {
8451
9097
  const reply = buildCapturingReply(envelope);
8452
9098
  const request = {
8453
9099
  params: {
8454
- ...input.params,
8455
- ...match.params
9100
+ ...match.params,
9101
+ ...input.params
8456
9102
  },
8457
9103
  query: input.query,
8458
9104
  body: input.body,
@@ -10461,70 +11107,6 @@ var StorageLocationDeclarationSchema = object({
10461
11107
  "backup"
10462
11108
  ]).optional()
10463
11109
  });
10464
- var DecoderStatsSchema = object({
10465
- inputFps: number(),
10466
- outputFps: number(),
10467
- avgDecodeTimeMs: number(),
10468
- droppedFrames: number(),
10469
- /**
10470
- * Pull-mode adaptive-fps telemetry (optional — only pull sessions run the
10471
- * lag-driven controller; push sessions omit these). `lagMs` is the EWMA of
10472
- * the decoder's real-time drift (rising = falling behind live); `adaptiveFps`
10473
- * is the current lag-throttled emit rate (≤ `effectiveFps` ceiling).
10474
- */
10475
- lagMs: number().optional(),
10476
- effectiveFps: number().optional(),
10477
- adaptiveFps: number().optional()
10478
- });
10479
- var DecoderSessionConfigSchema = object({
10480
- codec: string(),
10481
- maxFps: number().default(0),
10482
- outputFormat: _enum([
10483
- "jpeg",
10484
- "rgb",
10485
- "bgr",
10486
- "yuv420",
10487
- "gray"
10488
- ]).default("jpeg"),
10489
- scale: number().default(1),
10490
- width: number().optional(),
10491
- height: number().optional(),
10492
- /**
10493
- * Identifier of the camera this decoder session serves. Optional
10494
- * because the cap is generic (any caller could request decode), but
10495
- * stream-broker passes it so decoder logs include `deviceId` for
10496
- * per-camera filtering when diagnosing failures (e.g. node-av
10497
- * sendPacket errors on a single hung camera).
10498
- */
10499
- deviceId: number().int().nonnegative().optional(),
10500
- /**
10501
- * Free-form tag for log scoping. Stream-broker uses
10502
- * `broker:<deviceId>/<profile>`. Decoder session logger surfaces it
10503
- * on every line so `grep tag=broker:5/high` filters one camera
10504
- * profile cleanly.
10505
- */
10506
- tag: string().optional(),
10507
- /**
10508
- * Where the session delivers decoded frames (Phase 5 / D9):
10509
- *
10510
- * - `'callback'` (default) — the legacy pixel path: decoded frames are
10511
- * buffered as `DecodedFrame`s and drained via `pullFrames`.
10512
- * - `'shm'` — the shared-memory frame plane: decoded frames are written
10513
- * into an OS shared-memory ring and drained as zero-pixel
10514
- * `FrameHandle`s via `pullHandles`. A session is one mode or the
10515
- * other — `pullFrames` returns nothing for an `'shm'` session and
10516
- * `pullHandles` returns nothing for a `'callback'` session.
10517
- */
10518
- frameSink: _enum(["callback", "shm"]).default("callback"),
10519
- /**
10520
- * Per-camera decoder DEBUG facility. When `true`, a pull-mode session emits
10521
- * a throttled (~1Hz) structured `decoder debug` line (effective/adaptive fps,
10522
- * real-time lag, dropped-frame delta, avg decode time, hwaccel). Mirrors the
10523
- * stream-broker's `streamingDebug` gate — off by default so production logs
10524
- * stay quiet and the emit path pays zero per-frame cost when disabled.
10525
- */
10526
- debug: boolean().optional()
10527
- });
10528
11110
  /**
10529
11111
  * Per-component log CHANNELS — the gate a hot path consults, and the registry
10530
11112
  * an addon declares its channels in.
@@ -10675,7 +11257,18 @@ var LABEL_SUPPLY_STEP_IDS = [
10675
11257
  ];
10676
11258
  /** Steps whose box a root detection can BE. */
10677
11259
  var CROP_SUPPLY_STEP_IDS = ["plate-detection", "face-detection"];
10678
- [...LABEL_SUPPLY_STEP_IDS, ...CROP_SUPPLY_STEP_IDS];
11260
+ /**
11261
+ * Steps whose per-detection MASK a root detection can carry (D737). The live
11262
+ * mask step is `segmentation` — a frame-plane refiner that runs its own model
11263
+ * once per detection crop. (`instance-segmentation` is a dormant step id that
11264
+ * no camera tree carries.)
11265
+ */
11266
+ var MASK_SUPPLY_STEP_IDS = ["segmentation"];
11267
+ [
11268
+ ...LABEL_SUPPLY_STEP_IDS,
11269
+ ...CROP_SUPPLY_STEP_IDS,
11270
+ ...MASK_SUPPLY_STEP_IDS
11271
+ ];
10679
11272
  var MODEL_FORMATS = [
10680
11273
  "onnx",
10681
11274
  "coreml",
@@ -10704,7 +11297,53 @@ var ModelFormatEntrySchema = object({
10704
11297
  /** Multi-file payload (directory members or sibling files). */
10705
11298
  files: array(string()).readonly().optional(),
10706
11299
  /** Runtime(s) that can use this format. If omitted, inferred from ModelFormat key */
10707
- runtimes: array(_enum(["python"])).readonly().optional()
11300
+ runtimes: array(_enum(["python"])).readonly().optional(),
11301
+ /**
11302
+ * Content revision of the artefact, for one hosted OFF the CamStack mirror.
11303
+ * A format on the mirror leaves it unset: its revision (the sha256 of its
11304
+ * weight file) comes from the downloader's generated table, kept in step
11305
+ * with the mirror by `scripts/check-hosted-model-revisions.ts` (D744). A
11306
+ * node records the revision it downloaded next to the file
11307
+ * (`<file>.revision`); a copy with no record or a different one is stale
11308
+ * unless its weight file hashes to the revision, and a stale copy is
11309
+ * downloaded again, the old one serving until the new one is complete. No
11310
+ * revision at all ⇒ a file on disk is current, whatever it holds (D743).
11311
+ */
11312
+ revision: string().min(1).optional()
11313
+ });
11314
+ /**
11315
+ * What a node holds for one (model, format) (D746). `current` is a complete
11316
+ * copy at its catalog revision — exactly what `downloaded: true` means.
11317
+ * `stale` is bytes on disk that are not (yet) proven current under D743/D744:
11318
+ * no or a different revision record, or a missing sibling. `missing` is no
11319
+ * copy. `downloaded` alone folds `stale` into "not downloaded", which hid
11320
+ * reclaimable bytes and a copy about to be replaced.
11321
+ */
11322
+ var ModelOnDiskStateSchema = _enum([
11323
+ "current",
11324
+ "stale",
11325
+ "missing"
11326
+ ]);
11327
+ /**
11328
+ * The numeric precision of one format's BUILD (D746) — reported only when the
11329
+ * build states it (file-name token, an INT8 variant, an EdgeTPU compile, a
11330
+ * CamStack Core ML export). Absent means "not stated", never "fp32".
11331
+ */
11332
+ var ModelFormatPrecisionSchema = _enum([
11333
+ "fp32",
11334
+ "fp16",
11335
+ "int8"
11336
+ ]);
11337
+ /**
11338
+ * One format of one model as a node's `pipelineExecutor.getSchema` reports it.
11339
+ * `onDisk` / `precision` are optional for version skew: a runner that predates
11340
+ * them omits them, and a reader falls back to `downloaded`.
11341
+ */
11342
+ var PipelineModelFormatStatusSchema = object({
11343
+ downloaded: boolean(),
11344
+ sizeMB: number(),
11345
+ onDisk: ModelOnDiskStateSchema.optional(),
11346
+ precision: ModelFormatPrecisionSchema.optional()
10708
11347
  });
10709
11348
  /**
10710
11349
  * Extra file that must be downloaded alongside the model (e.g., labels JSON, dict.txt).
@@ -10818,25 +11457,36 @@ var ModelLicenseSchema = preprocess((value) => typeof value === "string" ? { wei
10818
11457
  * - `crop`: the root draws the box the step would have found (`license_plate`
10819
11458
  * for plate-detection, `face` for face-detection). The box becomes a detail
10820
11459
  * child of the `parentMacro` detection that contains it — never a track.
11460
+ * - `mask`: the root's decode emits an instance mask with every detection (a
11461
+ * YOLO26-seg root, D737) — the `segmentation` step's result, carried on the
11462
+ * detection in the shape that step produces. Derived from the model's
11463
+ * postprocessor on read, never stored by an import.
10821
11464
  */
10822
- var RootStepSupplySchema = discriminatedUnion("kind", [object({
10823
- kind: literal("label"),
10824
- stepId: _enum(LABEL_SUPPLY_STEP_IDS),
10825
- labelToEffect: record(string(), string()),
10826
- uncovered: array(string()).readonly()
10827
- }), object({
10828
- kind: literal("crop"),
10829
- stepId: _enum(CROP_SUPPLY_STEP_IDS),
10830
- rootLabels: array(string()).readonly(),
10831
- parentMacro: _enum(["vehicle", "person"]),
10832
- childClass: _enum(["plate", "face"]),
10833
- /**
10834
- * The root's smaller input side, stamped on read by `rootSuppliesOf` from
10835
- * the model entry — what a step's `minRootInputPx` gate judges. Never
10836
- * stored by an import.
10837
- */
10838
- rootInputPx: number().int().positive().optional()
10839
- })]);
11465
+ var RootStepSupplySchema = discriminatedUnion("kind", [
11466
+ object({
11467
+ kind: literal("label"),
11468
+ stepId: _enum(LABEL_SUPPLY_STEP_IDS),
11469
+ labelToEffect: record(string(), string()),
11470
+ uncovered: array(string()).readonly()
11471
+ }),
11472
+ object({
11473
+ kind: literal("crop"),
11474
+ stepId: _enum(CROP_SUPPLY_STEP_IDS),
11475
+ rootLabels: array(string()).readonly(),
11476
+ parentMacro: _enum(["vehicle", "person"]),
11477
+ childClass: _enum(["plate", "face"]),
11478
+ /**
11479
+ * The root's smaller input side, stamped on read by `rootSuppliesOf` from
11480
+ * the model entry — what a step's `minRootInputPx` gate judges. Never
11481
+ * stored by an import.
11482
+ */
11483
+ rootInputPx: number().int().positive().optional()
11484
+ }),
11485
+ object({
11486
+ kind: literal("mask"),
11487
+ stepId: _enum(MASK_SUPPLY_STEP_IDS)
11488
+ })
11489
+ ]);
10840
11490
  var ModelCatalogEntrySchema = object({
10841
11491
  id: string(),
10842
11492
  name: string(),
@@ -10902,6 +11552,35 @@ var ModelCatalogEntrySchema = object({
10902
11552
  */
10903
11553
  defaultConfidence: number().min(0).max(1).optional(),
10904
11554
  /**
11555
+ * Per-MODEL default of the per-class confidence floors (`minConfidence<Macro>`
11556
+ * on a detector step), keyed by macro class: `{ person: 0.45 }`. A class
11557
+ * absent here runs at the step slider's global default. The same row shape
11558
+ * the floor measurement produces (`model-floors.json`: modelId → floors), so
11559
+ * a measured table is copied in as-is. An operator override is bound to the
11560
+ * model it was made for and does not survive a model change (D738). A custom
11561
+ * / imported model may declare it; without it, the global defaults apply.
11562
+ */
11563
+ defaultClassFloors: record(string(), number().min(0).max(1)).optional(),
11564
+ /**
11565
+ * The inference precision this model's OpenVINO IR needs on an Intel GPU.
11566
+ * Absent ⇒ the device default (f16 on a GPU). Set to `'f32'` for an FP32 IR
11567
+ * that produces invalid output at f16 — measured 2026-10-07 for YOLO26
11568
+ * base IRs (`yolo26s`: 0 true / 146 false positives; `yolo26m*`: NaN
11569
+ * scores) on the Core Ultra iGPU and the N100. Threaded to the pool as
11570
+ * `PoolModelConfig.gpuInferencePrecision`; the pool sets
11571
+ * INFERENCE_PRECISION_HINT on a GPU only. Costs ~60% latency on the GPU.
11572
+ */
11573
+ gpuInferencePrecision: _enum(["f32", "f16"]).optional(),
11574
+ /**
11575
+ * ROOT detectors only: per supplied step (`animal-classifier`, …), the
11576
+ * minimum DETECTION score from which this root's own fine label (species,
11577
+ * vehicle type — D736 root supply) is taken (D741). Below it the detection
11578
+ * keeps its macro class without the fine label. `1` = never take it from
11579
+ * this root. Absent ⇒ no floor beyond the macro floor. The supplied step's
11580
+ * `minConfidence` slider, bound to the ROOT model, overrides it.
11581
+ */
11582
+ suppliedLabelFloors: record(string(), number().min(0).max(1)).optional(),
11583
+ /**
10905
11584
  * When true, the executor produces a landmark-aligned crop (similarity warp
10906
11585
  * onto the canonical template) before this step runs, instead of a plain
10907
11586
  * axis-aligned bbox crop. Required for face-recognition embedders (ArcFace):
@@ -12642,13 +13321,6 @@ var BrokerRtspClientSchema = object({
12642
13321
  lastRtpAt: number(),
12643
13322
  bytesSent: number()
12644
13323
  });
12645
- var BrokerDecodedClientSchema = object({
12646
- tag: string(),
12647
- subscribedAt: number(),
12648
- maxFps: number(),
12649
- framesDelivered: number(),
12650
- framesDropped: number()
12651
- });
12652
13324
  var BrokerAudioClientSchema = object({
12653
13325
  tag: string(),
12654
13326
  subscribedAt: number(),
@@ -12740,7 +13412,6 @@ var BrokerEncodedClientSchema = object({
12740
13412
  });
12741
13413
  var BrokerClientsSchema = object({
12742
13414
  rtsp: array(BrokerRtspClientSchema).readonly(),
12743
- decoded: array(BrokerDecodedClientSchema).readonly(),
12744
13415
  audio: array(BrokerAudioClientSchema).readonly(),
12745
13416
  encoded: array(BrokerEncodedClientSchema).readonly(),
12746
13417
  pipeClients: number(),
@@ -13109,11 +13780,7 @@ method(object({
13109
13780
  auth: "admin"
13110
13781
  }), method(object({ brokerId: string() }), BrokerClientsSchema), method(object({
13111
13782
  brokerId: string(),
13112
- channel: _enum([
13113
- "rtsp",
13114
- "decoded",
13115
- "audio"
13116
- ]),
13783
+ channel: _enum(["rtsp", "audio"]),
13117
13784
  handle: string()
13118
13785
  }), object({ killed: boolean() }), {
13119
13786
  kind: "mutation",
@@ -13148,10 +13815,7 @@ method(object({
13148
13815
  }), method(SubscribeAudioChunksInputSchema, SubscribeAudioChunksResultSchema, { kind: "mutation" }), method(object({
13149
13816
  subscriptionId: string(),
13150
13817
  maxCount: number().int().positive().default(8)
13151
- }), array(DecodedAudioChunkSchema).readonly()), method(object({ subscriptionId: string() }), object({ released: boolean() }), { kind: "mutation" }), method(SubscribeFramesInputSchema, SubscribeFramesResultSchema, { kind: "mutation" }), method(object({
13152
- subscriptionId: string(),
13153
- maxCount: number().int().positive().default(4)
13154
- }), array(FrameHandleSchema).readonly()), method(object({ subscriptionId: string() }), object({ released: boolean() }), { kind: "mutation" }), method(object({
13818
+ }), array(DecodedAudioChunkSchema).readonly()), method(object({ subscriptionId: string() }), object({ released: boolean() }), { kind: "mutation" }), method(object({
13155
13819
  brokerId: string(),
13156
13820
  seconds: number().min(0).max(30)
13157
13821
  }), _void(), {
@@ -14411,53 +15075,201 @@ id: union([string(), number()]) }), {
14411
15075
  auth: "admin"
14412
15076
  });
14413
15077
  /**
14414
- * shm ring usage stats for a `frameSink: 'shm'` decoder session —
14415
- * exposed via `decoder.getShmStats` so downstream consumers can
14416
- * observe ring pressure (slot count, byte budget, hit/miss ratio).
15078
+ * `keychain` — the hub's encrypted store of secret values (D787).
15079
+ *
15080
+ * Settings blobs never hold a secret: they hold a marker
15081
+ * `{"$secret":"secret://<owner>/<scope>/<fieldPath>","v":1}` and the value
15082
+ * lives here, AES-256-GCM under a data key that a master key wraps. This cap
15083
+ * is the OWNER's door to its own values: every method is owner-checked
15084
+ * against the CALLER, never against anything the caller claims.
15085
+ *
15086
+ * Who the caller is: the transport stamps `callerAddonId` into the args of a
15087
+ * call that crossed a process (the parent `LocalChildRegistry` from the UDS
15088
+ * connection, the agent from its child's connection carried in
15089
+ * `$hub-cap-fwd`'s envelope). A stamp always overwrites; a wire call with no
15090
+ * stamp has its claim stripped. Only a hub in-process caller may state its own
15091
+ * identity — `ctx.secrets` does that with the addon id closed over. This is
15092
+ * identity against BUGS and misrouting, not against a malicious addon (every
15093
+ * runner is the same OS user): see the threat model in
15094
+ * `docs/design/2026-10-08-secrets-keychain.md`.
15095
+ *
15096
+ * `callerAddonId` is deliberately NOT in any input schema: the tRPC router
15097
+ * parses the input, so a session can never supply it, and the internal mount
15098
+ * floors every method to admin anyway (D240).
15099
+ *
15100
+ * Internal: addons reach it through `ctx.secrets`, never directly.
14417
15101
  */
14418
- var ShmRingStatsSchema = object({
14419
- sessionId: string(),
14420
- slotCount: number().int(),
14421
- slotByteLength: number().int(),
14422
- segmentBytes: number().int(),
14423
- budgetMb: number().int(),
14424
- framesWritten: number().int(),
14425
- getFrameHits: number().int(),
14426
- getFrameMisses: number().int()
14427
- });
14428
- method(object({ codec: string() }), boolean()), method(_void(), object({
15102
+ /** Why a value cannot be served right now. Never folded into "missing". */
15103
+ var KeychainUnavailableReasonSchema = _enum([
15104
+ "key-missing",
15105
+ "wrong-key",
15106
+ "key-file-unreadable",
15107
+ "store-unavailable",
15108
+ "not-initialized",
15109
+ "decrypt-failed"
15110
+ ]);
15111
+ var KeychainStateSchema = discriminatedUnion("state", [object({ state: literal("ready") }), object({
15112
+ state: literal("locked"),
15113
+ reason: KeychainUnavailableReasonSchema
15114
+ })]);
15115
+ var KeychainResolveEntrySchema = discriminatedUnion("kind", [
15116
+ object({
15117
+ kind: literal("value"),
15118
+ value: string(),
15119
+ version: number().int()
15120
+ }),
15121
+ object({ kind: literal("missing") }),
15122
+ object({
15123
+ kind: literal("unavailable"),
15124
+ reason: KeychainUnavailableReasonSchema
15125
+ }),
15126
+ object({ kind: literal("forbidden") })
15127
+ ]);
15128
+ var KeychainResolveResultSchema = record(string(), KeychainResolveEntrySchema);
15129
+ /** Metadata of one stored value — never the value. */
15130
+ var KeychainSecretMetaSchema = object({
15131
+ ref: string(),
15132
+ owner: string(),
15133
+ /** Formatted scope (`global`, `node/<id>`, `device/<id>`, …). */
15134
+ scope: string(),
15135
+ fieldPath: string(),
15136
+ version: number().int(),
15137
+ createdAt: number(),
15138
+ updatedAt: number(),
15139
+ /** `addon:<id>` | `user:<id>` | `system`. */
15140
+ updatedBy: string(),
15141
+ /** Coarse — written at most once an hour per ref. `null` = never read. */
15142
+ lastReadAt: number().nullable()
15143
+ });
15144
+ var RefListSchema = array(string().min(1)).max(512);
15145
+ method(object({
15146
+ ref: string().min(1),
15147
+ value: string().min(1)
15148
+ }), object({
15149
+ ref: string(),
15150
+ version: number().int()
15151
+ }), {
15152
+ kind: "mutation",
15153
+ auth: "admin"
15154
+ }), method(object({ refs: RefListSchema }), KeychainResolveResultSchema, { auth: "admin" }), method(object({ refs: RefListSchema }), object({ deleted: number().int() }), {
15155
+ kind: "mutation",
15156
+ auth: "admin"
15157
+ }), method(object({}), array(KeychainSecretMetaSchema).readonly(), { auth: "admin" }), method(object({}), KeychainStateSchema, { auth: "admin" });
15158
+ var KeychainKeySourceSchema = object({
15159
+ kind: _enum([
15160
+ "config-file",
15161
+ "previous-config-file",
15162
+ "platform",
15163
+ "default-file"
15164
+ ]),
15165
+ /** File sources only — a path is not a secret. */
15166
+ path: string().optional(),
15167
+ /**
15168
+ * True when a whole-volume backup of the data directory carries this key
15169
+ * next to the database it protects (the default file). The page warns.
15170
+ */
15171
+ sharesBackupWithDatabase: boolean()
15172
+ });
15173
+ var KeychainStatusSchema = object({
15174
+ keychain: KeychainStateSchema,
15175
+ /** The source of the master key in use; `null` while locked. */
15176
+ keySource: KeychainKeySourceSchema.nullable(),
15177
+ /** The source configured to be primary — differs from `keySource` while a rotation is pending. */
15178
+ configuredSource: KeychainKeySourceSchema,
15179
+ /** Short fingerprint of the master key in use (`HMAC(KEK, label)`, 16 hex). */
15180
+ fingerprint: string().nullable(),
15181
+ activeKeyId: string().nullable(),
15182
+ /**
15183
+ * The keychain unlocked with a NON-primary source: the configured primary
15184
+ * key is not the one that wraps the data key yet. `rotateMasterKey` moves it.
15185
+ */
15186
+ rotationPending: boolean(),
15187
+ /** Wrapped copies of the data key under a previous master key, kept until purged. */
15188
+ retiredWraps: number().int(),
15189
+ recoveryKeyDownloadedAt: number().nullable(),
15190
+ secretCount: number().int()
15191
+ });
15192
+ /**
15193
+ * Whether a stored value is still pointed at by its owner's settings.
15194
+ * `unknown` is a first-class answer: a scope whose blob could not be read is
15195
+ * never reported as an orphan (and never deleted as one).
15196
+ */
15197
+ var KeychainSecretUsageSchema = _enum([
15198
+ "in-use",
15199
+ "orphan",
15200
+ "unknown"
15201
+ ]);
15202
+ var KeychainAdminSecretSchema = KeychainSecretMetaSchema.extend({ usage: KeychainSecretUsageSchema });
15203
+ var KeychainAuditActionSchema = _enum([
15204
+ "put",
15205
+ "delete",
15206
+ "reveal",
15207
+ "rotate-master-key",
15208
+ "purge-retired-keys",
15209
+ "download-recovery-key",
15210
+ "delete-orphans",
15211
+ "reset",
15212
+ "initialize"
15213
+ ]);
15214
+ var KeychainAuditEntrySchema = object({
15215
+ id: string(),
15216
+ at: number(),
15217
+ action: KeychainAuditActionSchema,
15218
+ /** `addon:<id>` | `user:<id>` | `system`. */
15219
+ actor: string(),
15220
+ ref: string().nullable(),
15221
+ detail: string().nullable()
15222
+ });
15223
+ 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({
15224
+ value: string(),
15225
+ version: number().int()
15226
+ }), {
15227
+ kind: "mutation",
15228
+ auth: "admin",
15229
+ caller: "required"
15230
+ }), method(object({ refs: array(string().min(1)).max(1e3) }), object({
15231
+ deleted: array(string()).readonly(),
15232
+ kept: array(object({
15233
+ ref: string(),
15234
+ usage: KeychainSecretUsageSchema
15235
+ })).readonly()
15236
+ }), {
15237
+ kind: "mutation",
15238
+ auth: "admin",
15239
+ caller: "required"
15240
+ }), method(object({}), object({
15241
+ fingerprint: string(),
15242
+ keySource: KeychainKeySourceSchema
15243
+ }), {
15244
+ kind: "mutation",
15245
+ auth: "admin",
15246
+ caller: "required"
15247
+ }), method(object({}), object({ purged: number().int() }), {
15248
+ kind: "mutation",
15249
+ auth: "admin",
15250
+ caller: "required"
15251
+ }), method(object({}), object({
15252
+ key: string(),
15253
+ fingerprint: string(),
15254
+ keySource: KeychainKeySourceSchema
15255
+ }), {
15256
+ kind: "mutation",
15257
+ auth: "admin",
15258
+ caller: "required"
15259
+ }), method(object({ confirm: literal("RESET KEYCHAIN") }), object({
15260
+ archivedCollection: string().nullable(),
15261
+ archived: number().int()
15262
+ }), {
15263
+ kind: "mutation",
15264
+ auth: "admin",
15265
+ caller: "required"
15266
+ });
15267
+ method(_void(), object({
14429
15268
  id: string(),
14430
15269
  name: string(),
14431
- isPullMode: boolean().optional(),
14432
- priority: number().optional(),
14433
15270
  hwaccel: string().optional(),
14434
15271
  probedBestHwaccel: string().optional()
14435
- })), method(DecoderSessionConfigSchema, object({
14436
- sessionId: string(),
14437
- nodeId: string()
14438
- })), method(object({ sessionId: string() }), _void()), method(object({
14439
- sessionId: string(),
14440
- packet: EncodedPacketSchema
14441
- }), _void()), method(object({
14442
- sessionId: string(),
14443
- url: string()
14444
- }), _void()), method(object({
14445
- sessionId: string(),
14446
- maxCount: number().default(1),
14447
- waitMs: number().optional()
14448
- }), array(DecodedFrameSchema)), method(object({
14449
- sessionId: string(),
14450
- maxCount: number().default(1),
14451
- waitMs: number().optional()
14452
- }), array(FrameHandleSchema)), method(object({ handle: FrameHandleSchema }), DecodedFrameSchema.nullable()), method(object({ sessionId: string() }), ShmRingStatsSchema.nullable()), method(object({
14453
- sessionId: string(),
14454
- config: DecoderSessionConfigSchema.partial()
14455
- }), _void()), method(object({ sessionId: string() }), DecoderStatsSchema), method(_void(), array(object({
14456
- sessionId: string(),
14457
- codec: string(),
14458
- outputFormat: string(),
14459
- createdAtMs: number()
14460
- })).readonly()), method(_void(), object({ backend: string() }), {
15272
+ })), method(_void(), object({ backend: string() }), {
14461
15273
  kind: "mutation",
14462
15274
  auth: "admin"
14463
15275
  });
@@ -15691,6 +16503,10 @@ var DeviceInfoSchema = object({
15691
16503
  isCamera: boolean(),
15692
16504
  /** Current config values — serializable snapshot */
15693
16505
  config: record(string(), unknown()),
16506
+ /** Paths inside `config` the device's schema declares secret (D783) —
16507
+ * what the non-admin redaction withholds. Paths, never values. Absent
16508
+ * when the owning runner has not reported them. */
16509
+ secretConfigPaths: array(string()).optional(),
15694
16510
  /** Hardware + identity blob (manufacturer / model / firmware / sn /
15695
16511
  * uid / mac / …). Populated by drivers; editable via setMetadata. */
15696
16512
  metadata: record(string(), unknown()).nullable().optional(),
@@ -15896,12 +16712,22 @@ var DeviceRegisterPayloadSchema = object({
15896
16712
  * call (workers re-register on init), so probe-driven updates
15897
16713
  * (e.g. PTZ flag flipping after the abilities probe) propagate. */
15898
16714
  features: array(string()).optional(),
15899
- config: record(string(), unknown())
16715
+ config: record(string(), unknown()),
16716
+ /** Config paths the device's own schema DECLARES secret
16717
+ * (`.meta({ secret: true })` — dotted, `[]` for array items, e.g.
16718
+ * `connection.password`). Re-published on every register; the non-admin
16719
+ * redaction withholds them at any depth (D783). Optional: an older runner
16720
+ * omits it and the keyword backstop applies. */
16721
+ secretConfigPaths: array(string()).optional()
15900
16722
  });
15901
16723
  var DeviceRemovePayloadSchema = object({ deviceId: number() });
15902
16724
  var DevicePersistConfigPayloadSchema = object({
15903
16725
  deviceId: number(),
15904
- data: record(string(), unknown())
16726
+ data: record(string(), unknown()),
16727
+ /** The paths the device's schema declares secret (D783), when the caller
16728
+ * knows them — those values are kept in the keychain, not the blob (D787).
16729
+ * Absent: the paths the device last reported at `registerDevice` apply. */
16730
+ secretConfigPaths: array(string()).optional()
15905
16731
  });
15906
16732
  /** What a migration actually did, per switch. `unreachable` is a first-class
15907
16733
  * answer: a camera that could not be asked is not a camera that was silenced. */
@@ -17555,7 +18381,14 @@ var LoginMethodContributionSchema = discriminatedUnion("kind", [
17555
18381
  icon: string().optional(),
17556
18382
  /** Addon-owned HTTP route the button navigates to (GET). */
17557
18383
  startUrl: string(),
17558
- stage: LoginStageEnum
18384
+ stage: LoginStageEnum,
18385
+ /**
18386
+ * The provider names an external identity a signed-in user can link to
18387
+ * their own account (D782): `auth.listLinkableProviders` /
18388
+ * `beginExternalLink` offer exactly the redirect methods that set this,
18389
+ * whatever their id. Absent / false — a login button only (magic-link).
18390
+ */
18391
+ linkable: boolean().optional()
17559
18392
  }),
17560
18393
  object({
17561
18394
  kind: literal("widget"),
@@ -21975,8 +22808,8 @@ Object.freeze(Object.fromEntries([{
21975
22808
  var CLUSTER_STEP_SETTING_FIELDS = [{
21976
22809
  stepId: "face-embedding",
21977
22810
  key: "minLandmarkFaceSize",
21978
- label: "Min face size for recognition (detection px)",
21979
- 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.",
22811
+ label: "Min face size to embed (detection-frame px)",
22812
+ 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.",
21980
22813
  type: "slider",
21981
22814
  min: 0,
21982
22815
  max: 64,
@@ -22949,8 +23782,23 @@ var RetrainMacroClassSchema = _enum([
22949
23782
  ]);
22950
23783
  /** A subject to learn, or a phantom to unlearn (taught by OMISSION). */
22951
23784
  var RetrainAnnotationKindSchema = _enum(["subject", "model_error"]);
22952
- /** Did a human draw this box, or did the assist propose it? */
22953
- var RetrainAnnotationSourceSchema = _enum(["operator", "assist"]);
23785
+ /**
23786
+ * Where a box came from. A machine-sourced box is a DRAFT on the page until
23787
+ * the operator confirms it; once saved it keeps its source as provenance.
23788
+ *
23789
+ * - `operator` — drawn by hand.
23790
+ * - `assist` — proposed by a detector run on the copy (the camera's own
23791
+ * model, or a larger teacher model).
23792
+ * - `pipeline` — the box the live pipeline actually drew on that frame, read
23793
+ * back from the track store (never a re-run).
23794
+ * - `llm` — proposed by a vision-capable LLM profile.
23795
+ */
23796
+ var RetrainAnnotationSourceSchema = _enum([
23797
+ "operator",
23798
+ "assist",
23799
+ "pipeline",
23800
+ "llm"
23801
+ ]);
22954
23802
  /** Normalised `[0,1]` rectangle against the FULL frame — the canonical form. */
22955
23803
  var RetrainBboxSchema = object({
22956
23804
  x: number(),
@@ -22968,7 +23816,8 @@ var RetrainBboxSchema = object({
22968
23816
  */
22969
23817
  var RetrainAnnotationSchema = object({
22970
23818
  id: string(),
22971
- trackId: string(),
23819
+ /** The frame's track. Absent on a recording still, which has none. */
23820
+ trackId: string().optional(),
22972
23821
  deviceId: number(),
22973
23822
  /** The COPY in retrain storage — never the source track's media key. */
22974
23823
  mediaKey: string(),
@@ -23017,18 +23866,63 @@ var RetrainFrameCandidateSchema = object({
23017
23866
  * fail, whatever became of the original. */
23018
23867
  copied: boolean()
23019
23868
  });
23869
+ /**
23870
+ * One box the live pipeline drew on a copied frame — what a correction starts
23871
+ * from. Derived when the frame is listed, from the track store: the subject
23872
+ * box recorded on the source media row when there is one, else the track
23873
+ * position nearest the frame's capture time. Never stored as an annotation
23874
+ * until the operator confirms it.
23875
+ */
23876
+ var RetrainPipelineBoxSchema = object({
23877
+ /** Normalised `[0,1]` against the full frame. */
23878
+ bbox: RetrainBboxSchema,
23879
+ macroClass: RetrainMacroClassSchema,
23880
+ label: string().optional(),
23881
+ subLabel: string().optional(),
23882
+ /** The detection score of the position used, when it was recorded. */
23883
+ score: number().optional(),
23884
+ /** The root model that produced the track, when it was recorded. */
23885
+ modelId: string().optional(),
23886
+ trackId: string(),
23887
+ /** `subject-box`: recorded on this very frame. `position`: the track's
23888
+ * position nearest the capture time, `deltaMs` away. */
23889
+ basis: _enum(["subject-box", "position"]),
23890
+ deltaMs: number()
23891
+ });
23892
+ /**
23893
+ * Where a retrain frame came from: a TRACK's stored media (copy-on-select),
23894
+ * or the RECORDING at an instant — the frame a model saw nothing in has no
23895
+ * track at all.
23896
+ */
23897
+ var RetrainFrameOriginSchema = _enum(["track", "recording"]);
23020
23898
  /** A frame the dataset OWNS: bytes copied at selection time. */
23021
23899
  var RetrainFrameSchema = object({
23022
23900
  frameId: string(),
23023
23901
  deviceId: number(),
23024
- trackId: string(),
23025
- /** Provenance only. It may already point at nothing — that is expected. */
23026
- sourceMediaId: number().int(),
23902
+ origin: RetrainFrameOriginSchema,
23903
+ /** The track it was copied from. Absent on a recording still. */
23904
+ trackId: string().optional(),
23905
+ /** Provenance only. It may already point at nothing — that is expected.
23906
+ * Absent on a recording still. */
23907
+ sourceMediaId: number().int().optional(),
23908
+ /** A recording still: the playhead instant it was taken at. */
23909
+ epochMs: number().optional(),
23027
23910
  sourceKind: MediaFileKindEnum,
23028
23911
  sizeBytes: number().int(),
23029
23912
  width: number().int(),
23030
23913
  height: number().int(),
23031
- copiedAt: number()
23914
+ copiedAt: number(),
23915
+ /** When the CAMERA captured the frame. Absent on a copy taken before D785. */
23916
+ capturedAt: number().optional(),
23917
+ /** The operator's "every subject in this frame is boxed". Detector
23918
+ * evaluation keeps only complete frames: an unboxed subject would count as
23919
+ * a false positive. */
23920
+ complete: boolean(),
23921
+ /** The boxes the pipeline drew on this frame. Present on list answers;
23922
+ * empty when nothing the track store holds can be placed on it. */
23923
+ pipelineBoxes: array(RetrainPipelineBoxSchema).readonly().optional(),
23924
+ /** The named collections this frame belongs to. Present on list answers. */
23925
+ collectionIds: array(string()).readonly().optional()
23032
23926
  });
23033
23927
  /** Why a copy-on-select could not be honoured — named, never a silent skip. */
23034
23928
  var RetrainCopyRefusalSchema = _enum([
@@ -23049,6 +23943,53 @@ var RetrainFrameListSchema = object({
23049
23943
  /** What the page pre-selects — the native key frame when one survives. */
23050
23944
  autoPickMediaId: number().int().optional()
23051
23945
  });
23946
+ /**
23947
+ * Which frames an annotated export carries. Every field narrows; an empty
23948
+ * filter is every annotated copy. A dataset VERSION is a frozen `frameIds`
23949
+ * list owned by whoever trains (the training orchestrator), so `frameIds` is
23950
+ * the primitive a version export uses; `batchId` re-selects what an earlier
23951
+ * export carried (`exportedInBatch`).
23952
+ */
23953
+ var RetrainExportFilterSchema = object({
23954
+ deviceIds: array(number()).optional(),
23955
+ frameIds: array(string()).max(2e4).optional(),
23956
+ /** Only frames in at least one of these named collections. */
23957
+ collectionIds: array(string()).max(200).optional(),
23958
+ batchId: string().optional(),
23959
+ /** Only frames the operator marked complete (all subjects boxed). */
23960
+ completeOnly: boolean().optional()
23961
+ });
23962
+ /**
23963
+ * `frames`: the full frame copies, boxes in `annotations.json`.
23964
+ * `crops`: additionally one JPEG per subject, cut with the runtime detail-crop
23965
+ * convention — the classifier layout.
23966
+ */
23967
+ var RetrainExportLayoutSchema = _enum(["frames", "crops"]);
23968
+ /**
23969
+ * Where `writeRetrainArchive` streams the tar: one HTTP request whose body is
23970
+ * the archive, sent chunk by chunk. Covers a presigned PUT and a provider
23971
+ * addon's data-plane upload route alike. Headers are sent verbatim and never
23972
+ * logged.
23973
+ */
23974
+ var RetrainArchiveTargetSchema = object({
23975
+ kind: literal("http"),
23976
+ method: _enum(["PUT", "POST"]),
23977
+ url: string().url(),
23978
+ headers: record(string(), string()).optional()
23979
+ });
23980
+ var RetrainArchiveResultSchema = object({
23981
+ batchId: string(),
23982
+ frames: number().int(),
23983
+ crops: number().int(),
23984
+ annotations: number().int(),
23985
+ /** Frames planned but not shipped (unreadable copy, path too long). */
23986
+ missing: number().int(),
23987
+ bytes: number().int(),
23988
+ /** sha256 of the exact bytes sent. */
23989
+ sha256: string(),
23990
+ /** The target's HTTP status. */
23991
+ status: number().int()
23992
+ });
23052
23993
  /** What the operator asked the assist to look for. */
23053
23994
  var RetrainAssistSubjectSchema = discriminatedUnion("kind", [object({
23054
23995
  kind: literal("package"),
@@ -23078,6 +24019,109 @@ var RetrainAssistResultSchema = discriminatedUnion("kind", [object({
23078
24019
  reason: string(),
23079
24020
  detail: string().optional()
23080
24021
  })]);
24022
+ /** A named set over the retrain corpus — membership only, it owns no pixels. */
24023
+ var RetrainCollectionSchema = object({
24024
+ id: string(),
24025
+ name: string(),
24026
+ createdAt: number(),
24027
+ frameCount: number().int()
24028
+ });
24029
+ var RetrainCollectionCreateResultSchema = discriminatedUnion("kind", [object({
24030
+ kind: literal("created"),
24031
+ collection: RetrainCollectionSchema
24032
+ }), object({
24033
+ kind: literal("refused"),
24034
+ reason: _enum(["empty-name", "duplicate-name"])
24035
+ })]);
24036
+ var RetrainCollectionRenameResultSchema = discriminatedUnion("kind", [object({
24037
+ kind: literal("renamed"),
24038
+ collection: RetrainCollectionSchema
24039
+ }), object({
24040
+ kind: literal("refused"),
24041
+ reason: _enum([
24042
+ "empty-name",
24043
+ "duplicate-name",
24044
+ "unknown-collection"
24045
+ ])
24046
+ })]);
24047
+ /**
24048
+ * The outcome of adding the frame at a recording instant. Every refusal is
24049
+ * named: `still-unavailable` (not recording, a gap, or an undecodable frame —
24050
+ * `detail` says which), `still-busy` (the recorder is at its decode bound; try
24051
+ * again), `unreadable-image`, `write-failed`, `unknown-collection`.
24052
+ */
24053
+ var AddRetrainFrameFromRecordingResultSchema = discriminatedUnion("kind", [object({
24054
+ kind: literal("added"),
24055
+ collectionId: string(),
24056
+ frame: RetrainFrameSchema,
24057
+ /** The moment was already in the dataset; nothing was decoded. */
24058
+ reused: boolean()
24059
+ }), object({
24060
+ kind: literal("refused"),
24061
+ reason: _enum([
24062
+ "unknown-collection",
24063
+ "still-unavailable",
24064
+ "still-busy",
24065
+ "unreadable-image",
24066
+ "write-failed"
24067
+ ]),
24068
+ detail: string().optional()
24069
+ })]);
24070
+ /** A vision LLM profile the AI assist may use, and where it sends the frame. */
24071
+ var RetrainAssistProfileSchema = object({
24072
+ id: string(),
24073
+ name: string(),
24074
+ model: string(),
24075
+ kind: string(),
24076
+ /** `true` when the frame would leave the house (a cloud vendor, or an
24077
+ * endpoint that is not on the local network). The page confirms each such
24078
+ * run, and the provider refuses one without `allowCloud`. */
24079
+ leavesHouse: boolean()
24080
+ });
24081
+ /** A box the AI assist proposed: a draft, plus the model's own reason. */
24082
+ var RetrainLlmProposalSchema = RetrainAnnotationDraftSchema.extend({ reason: string() });
24083
+ /** What the AI assist said about a box that was already on the canvas. */
24084
+ var RetrainLlmReviewSchema = object({
24085
+ /** The `ref` the page sent the box under. */
24086
+ ref: string(),
24087
+ verdict: _enum([
24088
+ "confirmed",
24089
+ "wrong-class",
24090
+ "not-an-object",
24091
+ "uncertain"
24092
+ ]),
24093
+ suggestedClass: RetrainMacroClassSchema.optional(),
24094
+ reason: string()
24095
+ });
24096
+ /**
24097
+ * The AI assist's answer. `proposed` carries drafts (`source: 'llm'`, the
24098
+ * model and its confidence) and reviews; items the model got wrong (a box off
24099
+ * the frame, an unasked class, an unknown ref) are dropped and counted in
24100
+ * `rejected`. A whole answer that is not the schema is `malformed-answer`.
24101
+ */
24102
+ var RetrainLlmAssistResultSchema = discriminatedUnion("kind", [object({
24103
+ kind: literal("proposed"),
24104
+ profileId: string(),
24105
+ model: string(),
24106
+ /** The frame was sent outside the house for this answer. */
24107
+ leftHouse: boolean(),
24108
+ proposals: array(RetrainLlmProposalSchema).readonly(),
24109
+ reviews: array(RetrainLlmReviewSchema).readonly(),
24110
+ rejected: number().int()
24111
+ }), object({
24112
+ kind: literal("refused"),
24113
+ reason: _enum([
24114
+ "unknown-frame",
24115
+ "unreadable-frame",
24116
+ "unknown-profile",
24117
+ "profile-disabled",
24118
+ "no-vision",
24119
+ "cloud-not-confirmed",
24120
+ "llm-error",
24121
+ "malformed-answer"
24122
+ ]),
24123
+ detail: string().optional()
24124
+ })]);
23081
24125
  /** The outcome of a lifecycle move owned by the retrain page. */
23082
24126
  var RetrainTransitionResultSchema = object({
23083
24127
  trackId: string(),
@@ -23795,7 +24839,7 @@ DeviceType.Camera, method(object({ deviceId: number() }), array(TrackSchema).rea
23795
24839
  auth: "admin"
23796
24840
  }), method(object({
23797
24841
  deviceId: number(),
23798
- trackId: string(),
24842
+ trackId: string().optional(),
23799
24843
  frameId: string()
23800
24844
  }), object({
23801
24845
  removed: boolean(),
@@ -23812,7 +24856,8 @@ DeviceType.Camera, method(object({ deviceId: number() }), array(TrackSchema).rea
23812
24856
  auth: "admin"
23813
24857
  }), method(object({
23814
24858
  deviceId: number(),
23815
- trackId: string(),
24859
+ /** The frame's track, when it has one — checked against the frame. */
24860
+ trackId: string().optional(),
23816
24861
  frameId: string(),
23817
24862
  subject: RetrainAssistSubjectSchema,
23818
24863
  /** Which node runs it. Absent ⇒ wherever an unowned call lands. */
@@ -23820,12 +24865,16 @@ DeviceType.Camera, method(object({ deviceId: number() }), array(TrackSchema).rea
23820
24865
  }), RetrainAssistResultSchema, {
23821
24866
  kind: "mutation",
23822
24867
  auth: "admin"
23823
- }), method(object({ trackId: string() }), array(RetrainAnnotationSchema).readonly(), {
24868
+ }), method(object({
24869
+ trackId: string().optional(),
24870
+ frameIds: array(string()).max(2e3).optional()
24871
+ }), array(RetrainAnnotationSchema).readonly(), {
23824
24872
  kind: "query",
23825
24873
  auth: "admin"
23826
24874
  }), method(object({
23827
24875
  deviceId: number(),
23828
- trackId: string(),
24876
+ /** The frame's track, when it has one — checked against the frame. */
24877
+ trackId: string().optional(),
23829
24878
  frameId: string(),
23830
24879
  annotations: array(RetrainAnnotationDraftSchema)
23831
24880
  }), array(RetrainAnnotationSchema).readonly(), {
@@ -23843,7 +24892,91 @@ DeviceType.Camera, method(object({ deviceId: number() }), array(TrackSchema).rea
23843
24892
  }), RetrainTransitionResultSchema, {
23844
24893
  kind: "mutation",
23845
24894
  auth: "admin"
23846
- }), method(object({ deviceIds: array(number()).optional() }), object({ url: string() }), {
24895
+ }), method(RetrainExportFilterSchema.extend({ layout: RetrainExportLayoutSchema.optional() }), object({ url: string() }), {
24896
+ kind: "query",
24897
+ auth: "admin"
24898
+ }), method(object({
24899
+ deviceId: number(),
24900
+ trackId: string().optional(),
24901
+ frameId: string(),
24902
+ complete: boolean()
24903
+ }), RetrainFrameSchema, {
24904
+ kind: "mutation",
24905
+ auth: "admin"
24906
+ }), method(object({
24907
+ filter: RetrainExportFilterSchema,
24908
+ layout: RetrainExportLayoutSchema,
24909
+ target: RetrainArchiveTargetSchema
24910
+ }), RetrainArchiveResultSchema, {
24911
+ kind: "mutation",
24912
+ auth: "admin",
24913
+ timeoutMs: 60 * 6e4
24914
+ }), method(object({}), array(RetrainAssistProfileSchema).readonly(), {
24915
+ kind: "query",
24916
+ auth: "admin"
24917
+ }), method(object({
24918
+ deviceId: number(),
24919
+ trackId: string().optional(),
24920
+ frameId: string(),
24921
+ profileId: string(),
24922
+ classes: array(RetrainMacroClassSchema).min(1),
24923
+ boxes: array(object({
24924
+ ref: string(),
24925
+ bbox: RetrainBboxSchema,
24926
+ macroClass: RetrainMacroClassSchema,
24927
+ label: string().optional()
24928
+ })).max(50),
24929
+ allowCloud: boolean()
24930
+ }), RetrainLlmAssistResultSchema, {
24931
+ kind: "mutation",
24932
+ auth: "admin",
24933
+ timeoutMs: 18e4
24934
+ }), method(object({ name: string().max(120) }), RetrainCollectionCreateResultSchema, {
24935
+ kind: "mutation",
24936
+ auth: "admin"
24937
+ }), method(object({}), array(RetrainCollectionSchema).readonly(), {
24938
+ kind: "query",
24939
+ auth: "admin"
24940
+ }), method(object({
24941
+ id: string(),
24942
+ name: string().max(120)
24943
+ }), RetrainCollectionRenameResultSchema, {
24944
+ kind: "mutation",
24945
+ auth: "admin"
24946
+ }), method(object({ id: string() }), object({
24947
+ deleted: boolean(),
24948
+ removedFrames: number().int()
24949
+ }), {
24950
+ kind: "mutation",
24951
+ auth: "admin"
24952
+ }), method(object({
24953
+ collectionId: string(),
24954
+ deviceId: number(),
24955
+ epochMs: number()
24956
+ }), AddRetrainFrameFromRecordingResultSchema, {
24957
+ kind: "mutation",
24958
+ auth: "admin",
24959
+ timeoutMs: 6e4
24960
+ }), method(object({
24961
+ collectionId: string(),
24962
+ frameIds: array(string()).min(1).max(500)
24963
+ }), object({
24964
+ added: number().int(),
24965
+ alreadyMember: number().int(),
24966
+ unknownFrameIds: array(string()).readonly()
24967
+ }), {
24968
+ kind: "mutation",
24969
+ auth: "admin"
24970
+ }), method(object({
24971
+ collectionId: string(),
24972
+ frameId: string()
24973
+ }), object({
24974
+ removed: boolean(),
24975
+ deletedFrame: boolean()
24976
+ }), {
24977
+ kind: "mutation",
24978
+ auth: "admin"
24979
+ }), method(object({ collectionId: string() }), array(RetrainFrameSchema).readonly(), {
23847
24980
  kind: "query",
23848
24981
  auth: "admin"
23849
24982
  }), method(object({
@@ -23971,7 +25104,7 @@ var FrameRefSchema = object({
23971
25104
  timestamp: number(),
23972
25105
  capturedAt: number().optional()
23973
25106
  });
23974
- var ModelFormatSchema$1 = _enum([
25107
+ var ModelFormatSchema$2 = _enum([
23975
25108
  "onnx",
23976
25109
  "coreml",
23977
25110
  "openvino",
@@ -23989,7 +25122,7 @@ var PipelineSlotSchema = _enum([
23989
25122
  var PipelineEngineChoiceSchema = object({
23990
25123
  runtime: literal("python"),
23991
25124
  backend: string(),
23992
- format: ModelFormatSchema$1,
25125
+ format: ModelFormatSchema$2,
23993
25126
  device: string().optional()
23994
25127
  });
23995
25128
  /**
@@ -24028,28 +25161,10 @@ var PipelineDefaultStepSchema = lazy(() => object({
24028
25161
  group: string().optional(),
24029
25162
  settings: record(string(), unknown()).optional()
24030
25163
  }));
24031
- var PipelineTemplateStepSchema = lazy(() => object({
24032
- addonId: string(),
24033
- enabled: boolean(),
24034
- modelId: string(),
24035
- children: array(PipelineTemplateStepSchema).readonly(),
24036
- settings: record(string(), unknown()).optional()
24037
- }));
24038
- var PipelineTemplateSchema$1 = object({
24039
- id: string(),
24040
- name: string(),
24041
- createdAt: string(),
24042
- updatedAt: string(),
24043
- engine: PipelineEngineChoiceSchema,
24044
- steps: array(PipelineTemplateStepSchema).readonly()
24045
- });
24046
25164
  var PipelineModelOptionSchema = object({
24047
25165
  id: string(),
24048
25166
  name: string(),
24049
- formats: record(string(), object({
24050
- downloaded: boolean(),
24051
- sizeMB: number()
24052
- })),
25167
+ formats: record(string(), PipelineModelFormatStatusSchema),
24053
25168
  group: ModelVariantGroupSchema.optional(),
24054
25169
  legacy: boolean().optional(),
24055
25170
  provider: ModelProviderIdSchema.optional(),
@@ -24216,6 +25331,22 @@ method(_void(), array(PipelineEngineChoiceSchema)), method(_void(), PipelineEngi
24216
25331
  }), {
24217
25332
  kind: "mutation",
24218
25333
  auth: "admin"
25334
+ }), method(object({
25335
+ nodeId: string(),
25336
+ deviceIds: array(number()).readonly().optional(),
25337
+ dryRun: boolean()
25338
+ }), object({
25339
+ entries: array(object({
25340
+ deviceId: number(),
25341
+ keys: array(string()).readonly()
25342
+ })).readonly(),
25343
+ refused: array(object({
25344
+ deviceId: number(),
25345
+ reason: string()
25346
+ })).readonly()
25347
+ }), {
25348
+ kind: "mutation",
25349
+ auth: "admin"
24219
25350
  }), method(object({ nodeId: string() }), object({ unhealthy: array(object({
24220
25351
  /** `<backend>:<device>`, e.g. `openvino:gpu`. */
24221
25352
  deviceKey: string(),
@@ -24241,22 +25372,14 @@ method(_void(), array(PipelineEngineChoiceSchema)), method(_void(), PipelineEngi
24241
25372
  }), method(_void(), PipelineSchemaSchema), method(_void(), array(PipelineDefaultStepSchema).readonly().nullable()), method(_void(), PipelineConfigBridge), method(_void(), ConfigUISchemaBridge), method(object({
24242
25373
  steps: array(PipelineStepInputSchema),
24243
25374
  deviceKey: string().optional()
24244
- }), PipelineValidationResultSchema), method(_void(), array(PipelineTemplateSchema$1).readonly()), method(object({
24245
- name: string(),
24246
- steps: array(PipelineTemplateStepSchema).readonly(),
24247
- engine: PipelineEngineChoiceSchema
24248
- }), PipelineTemplateSchema$1, { kind: "mutation" }), method(object({
24249
- id: string(),
24250
- name: string().optional(),
24251
- steps: array(PipelineTemplateStepSchema).readonly().optional()
24252
- }), PipelineTemplateSchema$1, { kind: "mutation" }), method(object({ id: string() }), _void(), { kind: "mutation" }), method(_void(), InferenceCapabilitiesBridge), method(object({ addonId: string() }), ModelAvailabilityListBridge), method(object({
25375
+ }), PipelineValidationResultSchema), method(_void(), InferenceCapabilitiesBridge), method(object({ addonId: string() }), ModelAvailabilityListBridge), method(object({
24253
25376
  addonId: string(),
24254
25377
  modelId: string(),
24255
- format: ModelFormatSchema$1
25378
+ format: ModelFormatSchema$2
24256
25379
  }), DownloadModelResultSchema, { kind: "mutation" }), method(object({
24257
25380
  addonId: string(),
24258
25381
  modelId: string(),
24259
- format: ModelFormatSchema$1
25382
+ format: ModelFormatSchema$2
24260
25383
  }), object({ success: literal(true) }), { kind: "mutation" }), method(object({
24261
25384
  steps: array(PipelineStepInputSchema).min(1),
24262
25385
  frame: FrameInputSchema.optional(),
@@ -24413,6 +25536,763 @@ method(_void(), array(PipelineEngineChoiceSchema)), method(_void(), PipelineEngi
24413
25536
  filename: string().optional(),
24414
25537
  settings: record(string(), unknown()).optional()
24415
25538
  }), AudioTestResultSchema, { kind: "mutation" }), method(_void(), ConfigUISchemaNullableBridge);
25539
+ /**
25540
+ * The wire shapes of the Auto tune plan and apply (D745), used by the
25541
+ * `pipeline-orchestrator` cap. The recommender's own types
25542
+ * (`recommend.ts`) are the TS face of the same data; these
25543
+ * schemas are what crosses the cap boundary.
25544
+ */
25545
+ var ModelFormatSchema$1 = _enum(MODEL_FORMATS);
25546
+ /** The operator's range for it. */
25547
+ var MIN_SESSIONS_PER_DEVICE_RANGE = {
25548
+ min: 1,
25549
+ max: 8
25550
+ };
25551
+ var HardwareClassIdSchema = _enum([
25552
+ "intel-core-ultra",
25553
+ "intel-n-series",
25554
+ "apple-m-base",
25555
+ "apple-m-pro",
25556
+ "unknown"
25557
+ ]);
25558
+ var AcceleratorKindSchema = _enum([
25559
+ "intel-npu",
25560
+ "intel-igpu",
25561
+ "x86-cpu",
25562
+ "arm-cpu",
25563
+ "apple-ane",
25564
+ "coral"
25565
+ ]);
25566
+ var RecommendationReasonSchema = discriminatedUnion("kind", [
25567
+ object({
25568
+ kind: literal("capacity"),
25569
+ sessions: number(),
25570
+ minSessions: number()
25571
+ }),
25572
+ object({
25573
+ kind: literal("tie-faster"),
25574
+ over: string(),
25575
+ recallDelta: number()
25576
+ }),
25577
+ object({
25578
+ kind: literal("stepped-down"),
25579
+ from: string(),
25580
+ to: string(),
25581
+ limitedBy: string()
25582
+ }),
25583
+ object({
25584
+ kind: literal("no-fit-lightest"),
25585
+ sessions: number(),
25586
+ minSessions: number()
25587
+ }),
25588
+ object({
25589
+ kind: literal("derived-latency"),
25590
+ modelId: string()
25591
+ }),
25592
+ object({ kind: literal("cpu-device") }),
25593
+ object({ kind: literal("coral-untouched") }),
25594
+ object({ kind: literal("device-disabled") }),
25595
+ object({ kind: literal("device-unavailable") }),
25596
+ object({ kind: literal("node-offline") }),
25597
+ object({ kind: literal("no-hardware-facts") }),
25598
+ object({
25599
+ kind: literal("no-measured-data"),
25600
+ hardwareClass: HardwareClassIdSchema
25601
+ }),
25602
+ object({
25603
+ kind: literal("no-family-build"),
25604
+ format: ModelFormatSchema$1
25605
+ }),
25606
+ object({
25607
+ kind: literal("kept-custom-pin"),
25608
+ modelId: string(),
25609
+ deviceKey: string()
25610
+ })
25611
+ ]);
25612
+ /** Why a device is left exactly as it is, whatever the plan would pick (D786). */
25613
+ var KeptReasonSchema = _enum(["custom-pin"]);
25614
+ /**
25615
+ * Where a choice's latency came from (D791): this node's own benchmark
25616
+ * result, or the hardware-class table. Measured on the node beats the table.
25617
+ */
25618
+ var LatencySourceSchema = discriminatedUnion("kind", [object({ kind: literal("table") }), object({
25619
+ kind: literal("node-benchmark"),
25620
+ resultId: string(),
25621
+ measuredAtMs: number()
25622
+ })]);
25623
+ var DeviceModelChoiceSchema = object({
25624
+ modelId: string(),
25625
+ p50Ms: number(),
25626
+ fps: number(),
25627
+ measured: boolean(),
25628
+ /** Absent on a plan from before D791 — read as the table. */
25629
+ source: LatencySourceSchema.optional(),
25630
+ /** Parallel sessions at the camera rate with the headroom kept free: ⌊fps × (1 − headroom) / camera fps⌋. */
25631
+ capacitySessions: number(),
25632
+ personRecall: number()
25633
+ });
25634
+ var DeviceRecommendationSchema = object({
25635
+ deviceKey: string(),
25636
+ accelerator: AcceleratorKindSchema.nullable(),
25637
+ enabled: boolean(),
25638
+ available: boolean(),
25639
+ chosen: DeviceModelChoiceSchema.nullable(),
25640
+ /** Present when the device is kept as is: Apply writes nothing on it. */
25641
+ kept: KeptReasonSchema.optional(),
25642
+ reasons: array(RecommendationReasonSchema).readonly()
25643
+ });
25644
+ var NodeRecommendationSchema = object({
25645
+ nodeId: string(),
25646
+ reachable: boolean(),
25647
+ hardwareClass: HardwareClassIdSchema.nullable(),
25648
+ cpuModel: string().nullable(),
25649
+ skipped: boolean(),
25650
+ acceleratorModelId: string().nullable(),
25651
+ devices: array(DeviceRecommendationSchema).readonly(),
25652
+ reasons: array(RecommendationReasonSchema).readonly()
25653
+ });
25654
+ var ModelPinChangeSchema = object({
25655
+ stepId: string(),
25656
+ before: string().nullable(),
25657
+ after: string().nullable()
25658
+ });
25659
+ var NodeDeviceChangeSchema = object({
25660
+ nodeId: string(),
25661
+ deviceKey: string(),
25662
+ madeExplicit: boolean(),
25663
+ modelPins: array(ModelPinChangeSchema).readonly(),
25664
+ thresholds: array(object({
25665
+ stepId: string(),
25666
+ keys: array(string()).readonly()
25667
+ })).readonly()
25668
+ });
25669
+ var CameraOverrideClearSchema = object({
25670
+ deviceId: number(),
25671
+ source: _enum(["step-override", "wholesale"]),
25672
+ nodeId: string(),
25673
+ deviceKey: string().nullable(),
25674
+ stepId: string(),
25675
+ modelIdBefore: string().nullable(),
25676
+ keys: array(string()).readonly()
25677
+ });
25678
+ var DetectorStoreClearSchema = object({
25679
+ deviceId: number(),
25680
+ keys: array(string()).readonly()
25681
+ });
25682
+ var AutoTuneWarningSchema = discriminatedUnion("kind", [
25683
+ object({
25684
+ kind: literal("detector-store-cluster-wide"),
25685
+ skippedNodes: array(string()).readonly()
25686
+ }),
25687
+ object({
25688
+ kind: literal("detector-store-unreadable"),
25689
+ error: string()
25690
+ }),
25691
+ object({
25692
+ kind: literal("coral-enabled"),
25693
+ nodeId: string(),
25694
+ deviceKey: string()
25695
+ }),
25696
+ object({
25697
+ kind: literal("custom-pin-kept"),
25698
+ nodeId: string(),
25699
+ deviceKey: string().nullable(),
25700
+ deviceId: number().nullable(),
25701
+ modelId: string()
25702
+ }),
25703
+ object({
25704
+ kind: literal("custom-registry-unreadable"),
25705
+ error: string()
25706
+ })
25707
+ ]);
25708
+ var AutoTuneOptionsSchema = object({
25709
+ /** Share of each accelerator's throughput kept free (0.3–0.5). */
25710
+ headroom: number().min(.3).max(.5).default(.4),
25711
+ /**
25712
+ * The least number of parallel sessions every device must sustain at the
25713
+ * camera rate with the headroom kept free (D755). The most accurate model
25714
+ * that reaches it wins.
25715
+ */
25716
+ minSessionsPerDevice: number().int().min(MIN_SESSIONS_PER_DEVICE_RANGE.min).max(MIN_SESSIONS_PER_DEVICE_RANGE.max).default(2)
25717
+ });
25718
+ var AutoTunePlanSchema = object({
25719
+ /** Hash of everything the apply will write — the apply refuses a different one. */
25720
+ planHash: string(),
25721
+ family: literal("yolov9"),
25722
+ headroom: number(),
25723
+ minSessionsPerDevice: number(),
25724
+ /** The detection rate a session is counted at (the fastest camera running the pipeline root). */
25725
+ cameraFps: number(),
25726
+ generatedAt: number(),
25727
+ nodes: array(NodeRecommendationSchema).readonly(),
25728
+ nodeChanges: array(NodeDeviceChangeSchema).readonly(),
25729
+ cameraClears: array(CameraOverrideClearSchema).readonly(),
25730
+ detectorStoreClears: array(DetectorStoreClearSchema).readonly(),
25731
+ warnings: array(AutoTuneWarningSchema).readonly()
25732
+ });
25733
+ var AutoTuneApplyInputSchema = object({
25734
+ planHash: string(),
25735
+ headroom: number().min(.3).max(.5).default(.4),
25736
+ minSessionsPerDevice: number().int().min(MIN_SESSIONS_PER_DEVICE_RANGE.min).max(MIN_SESSIONS_PER_DEVICE_RANGE.max).default(2)
25737
+ });
25738
+ var AutoTunePhaseResultSchema = object({
25739
+ phase: _enum([
25740
+ "download",
25741
+ "camera-overrides",
25742
+ "detector-thresholds",
25743
+ "node-models",
25744
+ "redispatch"
25745
+ ]),
25746
+ ok: boolean(),
25747
+ detail: string()
25748
+ });
25749
+ var AutoTuneApplyResultSchema = discriminatedUnion("kind", [
25750
+ object({
25751
+ kind: literal("applied"),
25752
+ planHash: string(),
25753
+ phases: array(AutoTunePhaseResultSchema).readonly()
25754
+ }),
25755
+ object({
25756
+ kind: literal("aborted"),
25757
+ phases: array(AutoTunePhaseResultSchema).readonly()
25758
+ }),
25759
+ object({
25760
+ kind: literal("stale"),
25761
+ plan: AutoTunePlanSchema
25762
+ }),
25763
+ object({
25764
+ kind: literal("refused"),
25765
+ reason: _enum(["apply-in-progress"])
25766
+ })
25767
+ ]);
25768
+ /**
25769
+ * Wire shapes of the Load balancing surface (D748): the session placement
25770
+ * policy, the atomic share write, the observed placement statistics, the
25771
+ * hardware share suggestion and the stale device pins.
25772
+ */
25773
+ /**
25774
+ * How a new detection session picks its node and device.
25775
+ * - `least-loaded` — the historical rule: lowest `attached / weight`, a
25776
+ * constant node order at a tie (D37). An idle node always ties at 0, so a
25777
+ * weight only bites once a node already holds a session.
25778
+ * - `share` — the share of PARALLEL sessions is held to the weights, and a
25779
+ * full or drowning node yields to a free one (D748).
25780
+ */
25781
+ var SessionPlacementPolicySchema = _enum(["least-loaded", "share"]);
25782
+ var LoadBalancingSharesInputSchema = object({
25783
+ /** nodeId → share (> 0). A node left out keeps its weight. */
25784
+ nodes: record(string(), number().positive()).default({}),
25785
+ /** nodeId → deviceKey → share (> 0). A device left out keeps its weight. */
25786
+ devices: record(string(), record(string(), number().positive())).default({})
25787
+ });
25788
+ var PlacementStatsInputSchema = object({
25789
+ /** Window the observed shares are averaged over (default 1 h, max 24 h). */
25790
+ windowMs: number().int().min(6e4).max(1440 * 60 * 1e3).default(3600 * 1e3) });
25791
+ var PlacementDeviceStatsSchema = object({
25792
+ deviceKey: string(),
25793
+ /** Sessions running on this device now. */
25794
+ sessionsNow: number(),
25795
+ /** Sessions started on this device inside the window. */
25796
+ sessionsStarted: number(),
25797
+ /** Time-weighted share of the node's parallel sessions over the window (0–1); null = no session ran. */
25798
+ observedShare: number().nullable()
25799
+ });
25800
+ var PlacementNodeStatsSchema = object({
25801
+ nodeId: string(),
25802
+ sessionsNow: number(),
25803
+ sessionsStarted: number(),
25804
+ /** Time-weighted share of the cluster's parallel sessions over the window (0–1); null = none ran. */
25805
+ observedShare: number().nullable(),
25806
+ /** Most sessions this node ran at once inside the window. */
25807
+ peakSessions: number(),
25808
+ /** Sessions a share election handed elsewhere because this node was full or drowning. */
25809
+ yieldsAway: number(),
25810
+ devices: array(PlacementDeviceStatsSchema).readonly()
25811
+ });
25812
+ /** A camera's device pin that the session path cannot honour. */
25813
+ var StaleDevicePinSchema = object({
25814
+ deviceId: number(),
25815
+ deviceKey: string(),
25816
+ /** `disabled` — the key exists on some node but is not enabled anywhere; `absent` — no node has it. */
25817
+ reason: _enum(["disabled", "absent"])
25818
+ });
25819
+ var PlacementStatsSchema = object({
25820
+ policy: SessionPlacementPolicySchema,
25821
+ windowMs: number(),
25822
+ /** How much of the window was actually observed (the hub keeps it in memory). */
25823
+ observedForMs: number(),
25824
+ sessionsNow: number(),
25825
+ /** Most parallel sessions across the cluster inside the window. */
25826
+ clusterPeakSessions: number(),
25827
+ nodes: array(PlacementNodeStatsSchema).readonly(),
25828
+ stalePins: array(StaleDevicePinSchema).readonly()
25829
+ });
25830
+ /**
25831
+ * Where an automatic share's capacity comes from (D755).
25832
+ * - `hardware` — the static capacity of each device at its Auto tune model:
25833
+ * the measured latency table for the node's hardware class.
25834
+ * - `benchmark` — the node's own measured capacity (node benchmark results).
25835
+ * A node with no results falls back to `hardware`, and says so.
25836
+ */
25837
+ var CapacitySourceSchema = _enum(["hardware", "benchmark"]);
25838
+ /** Why a node under the `benchmark` source was sized from hardware instead. */
25839
+ var CapacityFallbackSchema = _enum(["no-benchmark-results", "partial-benchmark-results"]);
25840
+ var SuggestSharesInputSchema = object({
25841
+ headroom: number().min(.3).max(.5).default(.4),
25842
+ /** Default `hardware`. */
25843
+ source: CapacitySourceSchema.default("hardware")
25844
+ });
25845
+ var SuggestedDeviceShareSchema = object({
25846
+ deviceKey: string(),
25847
+ /** Share of the node (0–100, rounded). */
25848
+ share: number(),
25849
+ modelId: string().nullable(),
25850
+ /** Inferences per second at that model, from the measured table; null when sized by a benchmark. */
25851
+ fps: number().nullable(),
25852
+ /** False for a table cell derived from another chip; true for a measured cell or a benchmark. */
25853
+ measured: boolean(),
25854
+ /**
25855
+ * Advisory session cap: ⌊fps × (1 − headroom) / camera fps⌋ from the table,
25856
+ * or the benchmark's measured max sessions. Never enforced.
25857
+ */
25858
+ suggestedMaxSessions: number().nullable()
25859
+ });
25860
+ var SuggestedNodeShareSchema = object({
25861
+ nodeId: string(),
25862
+ /** Share of the cluster (0–100, rounded); null = node skipped (offline, unknown hardware). */
25863
+ share: number().nullable(),
25864
+ /** Parallel sessions the node sustains at the suggested models with the headroom kept free. */
25865
+ capacitySessions: number(),
25866
+ devices: array(SuggestedDeviceShareSchema).readonly(),
25867
+ skippedReason: string().nullable(),
25868
+ /** What this node's capacity was read from; null when the node is skipped. */
25869
+ capacitySource: CapacitySourceSchema.nullable(),
25870
+ /** Set when the `benchmark` source was asked for and this node used `hardware`. */
25871
+ capacityFallback: CapacityFallbackSchema.nullable()
25872
+ });
25873
+ var SuggestSharesResultSchema = object({
25874
+ headroom: number(),
25875
+ /** The source asked for; each node says what it actually used. */
25876
+ source: CapacitySourceSchema,
25877
+ /** Camera detection rate the capacity is counted in (the fastest camera's fps). */
25878
+ cameraFps: number(),
25879
+ /** The Auto tune capacity floor the models were picked at. */
25880
+ minSessionsPerDevice: number(),
25881
+ nodes: array(SuggestedNodeShareSchema).readonly()
25882
+ });
25883
+ /**
25884
+ * Where the node and device shares come from (D750, D755, D791).
25885
+ * - `benchmark` (default since D791) — each node's capacity as its own node
25886
+ * benchmark measured it; a node without fresh results is sized from
25887
+ * `hardware` and says so. Measured on the node beats the table.
25888
+ * - `hardware` — computed from each node's static capacity only (its
25889
+ * accelerators at their Auto tune models, from the latency table).
25890
+ * Both are recomputed whenever a node or device joins, leaves, is switched
25891
+ * on or off, changes model, or a benchmark result is written. No load input.
25892
+ * - `manual` — the operator's stored sliders.
25893
+ * Either way a node or device that cannot take sessions gives its share to
25894
+ * the others in proportion; the stored values are never rewritten for that.
25895
+ */
25896
+ var ShareSourceSchema = _enum([
25897
+ "hardware",
25898
+ "benchmark",
25899
+ "manual"
25900
+ ]);
25901
+ var SetShareSourceInputSchema = object({ source: ShareSourceSchema });
25902
+ object({
25903
+ nodes: record(string(), number()),
25904
+ devices: record(string(), record(string(), number()))
25905
+ });
25906
+ var EffectiveDeviceShareSchema = object({
25907
+ deviceKey: string(),
25908
+ /** Can take sessions now (enabled, available, can run the root). */
25909
+ eligible: boolean(),
25910
+ /** The share the source assigns, as a percentage of the node's devices. */
25911
+ configuredPct: number(),
25912
+ /** The share actually used, after an ineligible device's share went to the others. */
25913
+ effectivePct: number()
25914
+ });
25915
+ var EffectiveNodeShareSchema = object({
25916
+ nodeId: string(),
25917
+ eligible: boolean(),
25918
+ configuredPct: number(),
25919
+ effectivePct: number(),
25920
+ /** Automatic sources: what this node's share was computed from; null under `manual` or before the first answer. */
25921
+ capacitySource: CapacitySourceSchema.nullable(),
25922
+ /** Automatic `benchmark`: why this node used `hardware` instead. */
25923
+ capacityFallback: CapacityFallbackSchema.nullable(),
25924
+ devices: array(EffectiveDeviceShareSchema).readonly()
25925
+ });
25926
+ var EffectiveSharesSchema = object({
25927
+ source: ShareSourceSchema,
25928
+ policy: SessionPlacementPolicySchema,
25929
+ /** An automatic source with no computed answer yet: the stored sliders are used meanwhile. */
25930
+ autoPending: boolean(),
25931
+ /** When the automatic shares were last computed (ms epoch); null = never. */
25932
+ computedAt: number().nullable(),
25933
+ /** What made the system recompute them last. */
25934
+ trigger: string().nullable(),
25935
+ nodes: array(EffectiveNodeShareSchema).readonly(),
25936
+ /** The relative weights the election reads (before eligibility). */
25937
+ nodeWeights: record(string(), number()),
25938
+ deviceWeights: record(string(), record(string(), number()))
25939
+ });
25940
+ /**
25941
+ * Wire shapes of the node benchmark (D791): the operator's plan, the
25942
+ * preflight the confirmation shows, the run the orchestrator owns, what the
25943
+ * measuring runner reports, and the result rows Auto tune and the automatic
25944
+ * shares read.
25945
+ *
25946
+ * ONE node at a time, owned by the pipeline orchestrator. While a run is
25947
+ * active the cluster is in BENCHMARK MODE for that node: it is not a
25948
+ * detection candidate, camera pins naming it are ignored so its sessions move
25949
+ * elsewhere, and both come back when the mode ends — after a crash or a hub
25950
+ * restart too (a persisted manifest, reconciled against the registry).
25951
+ *
25952
+ * Two measurements, both on the node, driven by its own runner (frames never
25953
+ * cross a process at frame rate, D9):
25954
+ * - `device` — one accelerator × one candidate detector, root only, open
25955
+ * loop: how many streams at the camera rate it carries inside the frame
25956
+ * interval;
25957
+ * - `pipeline` — the chosen detector plus the operator's detail steps
25958
+ * (faces, plates, classifiers, CLIP…), on varied frames from the bench
25959
+ * clip: how many parallel sessions the node carries before latency, drops,
25960
+ * CPU, RAM or the event loop give out.
25961
+ */
25962
+ /** Defaults and bounds, one place. */
25963
+ var NODE_BENCHMARK_DEFAULTS = {
25964
+ fpsPerStream: 10,
25965
+ budgetMinutes: 45,
25966
+ minBudgetMinutes: 10,
25967
+ maxBudgetMinutes: 120,
25968
+ /** A result older than this no longer beats the table. */
25969
+ staleAfterDays: 30,
25970
+ /** Warm-in per ramp step (not accounted). */
25971
+ settleSec: 5,
25972
+ /** Accounted window per ramp step. */
25973
+ measureSec: 20,
25974
+ /** Longest the drain may take before the run is refused. */
25975
+ drainTimeoutSec: 120,
25976
+ /** Candidate models per device in one run. */
25977
+ maxModelsPerDevice: 6
25978
+ };
25979
+ /** The two measurements a run can make. */
25980
+ var NodeBenchmarkPhaseSchema = _enum(["device", "pipeline"]);
25981
+ var NodeBenchmarkDevicePlanSchema = object({
25982
+ /** `<backend>:<device>` — `openvino:npu`, `coreml:all`, `cpu`. */
25983
+ deviceKey: string().min(1),
25984
+ /**
25985
+ * Root detector candidates for the `device` measurement, in the order
25986
+ * measured. The FIRST is the one the `pipeline` measurement runs.
25987
+ */
25988
+ modelIds: array(string().min(1)).min(1).max(NODE_BENCHMARK_DEFAULTS.maxModelsPerDevice)
25989
+ });
25990
+ /** What the operator confirmed. */
25991
+ var NodeBenchmarkPlanSchema = object({
25992
+ nodeId: string().min(1),
25993
+ devices: array(NodeBenchmarkDevicePlanSchema).min(1),
25994
+ /** Which measurements run. At least one. */
25995
+ phases: array(NodeBenchmarkPhaseSchema).min(1).default(["device", "pipeline"]),
25996
+ /**
25997
+ * Detail steps (catalog step ids under the root: faces, plates,
25998
+ * classifiers, CLIP…) the `pipeline` measurement enables. The root
25999
+ * detector always runs.
26000
+ */
26001
+ steps: array(string().min(1)).default([]),
26002
+ /** Offered rate of one stream / session. */
26003
+ fpsPerStream: number().int().min(1).max(30).default(NODE_BENCHMARK_DEFAULTS.fpsPerStream),
26004
+ /** Hard deadline: the mode ends and the cluster is restored when it passes. */
26005
+ budgetMinutes: number().int().min(NODE_BENCHMARK_DEFAULTS.minBudgetMinutes).max(NODE_BENCHMARK_DEFAULTS.maxBudgetMinutes).default(NODE_BENCHMARK_DEFAULTS.budgetMinutes),
26006
+ /** Keep the models the run downloaded (default: delete what was not installed before). */
26007
+ keepDownloadedModels: boolean().default(false),
26008
+ /** Start although the other nodes' capacity does not cover the sessions running now. */
26009
+ acceptInsufficientHeadroom: boolean().default(false)
26010
+ });
26011
+ var NodeBenchmarkRefusalSchema = object({
26012
+ kind: _enum([
26013
+ "benchmark-active",
26014
+ "node-offline",
26015
+ "unknown-device",
26016
+ "no-phase",
26017
+ "insufficient-headroom"
26018
+ ]),
26019
+ detail: string(),
26020
+ overridable: boolean()
26021
+ });
26022
+ /** A camera whose detection leaves the node for the run. */
26023
+ var NodeBenchmarkMovingCameraSchema = object({
26024
+ deviceId: number(),
26025
+ /** Placed on the node now (a standing attach or a running session). */
26026
+ placedOnNode: boolean(),
26027
+ /** A node pin naming this node, ignored for the run. */
26028
+ pinnedToNode: boolean()
26029
+ });
26030
+ /** A camera that cannot leave: no other node can obtain its frames. */
26031
+ var NodeBenchmarkStayingCameraSchema = object({
26032
+ deviceId: number(),
26033
+ reason: literal("only-frame-source")
26034
+ });
26035
+ var NodeBenchmarkPreflightSchema = object({
26036
+ nodeId: string(),
26037
+ online: boolean(),
26038
+ moving: array(NodeBenchmarkMovingCameraSchema).readonly(),
26039
+ /** Keep running on the node during the run; the result is flagged contaminated. */
26040
+ staying: array(NodeBenchmarkStayingCameraSchema).readonly(),
26041
+ estimatedDurationMs: number(),
26042
+ /** The run ends and the cluster is restored at the latest after this long. */
26043
+ budgetMs: number(),
26044
+ phases: array(NodeBenchmarkPhaseSchema).readonly(),
26045
+ steps: array(string()).readonly(),
26046
+ devices: array(NodeBenchmarkDevicePlanSchema).readonly(),
26047
+ /** Parallel sessions the cluster runs now, and what the other nodes can carry. */
26048
+ headroom: object({
26049
+ sessionsNow: number(),
26050
+ otherNodesCapacitySessions: number().nullable()
26051
+ }),
26052
+ refusals: array(NodeBenchmarkRefusalSchema).readonly(),
26053
+ canStart: boolean()
26054
+ });
26055
+ /** Where the measuring runner is. */
26056
+ var NodeBenchProgressSchema = object({
26057
+ phase: _enum([
26058
+ "preparing",
26059
+ "device",
26060
+ "pipeline",
26061
+ "cleanup"
26062
+ ]),
26063
+ deviceKey: string().nullable(),
26064
+ modelId: string().nullable(),
26065
+ /** Streams (device) or sessions (pipeline) of the step running now. */
26066
+ load: number().nullable(),
26067
+ cellsDone: number(),
26068
+ cellsTotal: number(),
26069
+ message: string()
26070
+ });
26071
+ /** What limited a ramp. `none` = the ramp ran out of steps still passing. */
26072
+ var NodeBenchLimitSchema = _enum([
26073
+ "p95",
26074
+ "drops",
26075
+ "errors",
26076
+ "stall",
26077
+ "cpu",
26078
+ "ram",
26079
+ "none"
26080
+ ]);
26081
+ var NodeBenchRampStepSchema = object({
26082
+ load: number(),
26083
+ pass: boolean(),
26084
+ p95Ms: number(),
26085
+ dropRatio: number(),
26086
+ /** Completed frames per second over the accounted window. */
26087
+ fps: number(),
26088
+ cpuPct: number().nullable(),
26089
+ ramFreePct: number().nullable(),
26090
+ failReasons: array(string()).readonly()
26091
+ });
26092
+ var NodeBenchCellSchema = discriminatedUnion("phase", [object({
26093
+ phase: literal("device"),
26094
+ deviceKey: string(),
26095
+ modelId: string(),
26096
+ /** Single-stream latency (the K = 1 step). */
26097
+ p50Ms: number(),
26098
+ p95Ms: number(),
26099
+ p99Ms: number(),
26100
+ /** Frames per second sustained at the last passing step. */
26101
+ fps: number(),
26102
+ /** Streams at the camera rate the device carried inside the frame interval; 0 = not even one. */
26103
+ kMax: number(),
26104
+ limitedBy: NodeBenchLimitSchema,
26105
+ /** First call (model load + warm-up). */
26106
+ warmupMs: number(),
26107
+ ramp: array(NodeBenchRampStepSchema).readonly()
26108
+ }), object({
26109
+ phase: literal("pipeline"),
26110
+ deviceKey: string(),
26111
+ modelId: string(),
26112
+ steps: array(string()).readonly(),
26113
+ /** Parallel sessions at the camera rate the node carried; 0 = not even one. */
26114
+ maxSessions: number(),
26115
+ limitedBy: NodeBenchLimitSchema,
26116
+ /** Detail steps that produced at least one result on the clip — a step that never fired measured nothing. */
26117
+ stepsFired: array(string()).readonly(),
26118
+ warmupMs: number(),
26119
+ ramp: array(NodeBenchRampStepSchema).readonly()
26120
+ })]);
26121
+ /**
26122
+ * What a result was measured ON. A result whose fingerprint no longer matches
26123
+ * the node no longer beats the table.
26124
+ */
26125
+ var NodeBenchFingerprintSchema = object({
26126
+ pipelineVersion: string().nullable(),
26127
+ cpuModel: string().nullable(),
26128
+ ramGb: number().nullable(),
26129
+ os: string().nullable(),
26130
+ /** Per device: the pool the cells ran on (runtime + tuning). */
26131
+ pools: record(string(), object({
26132
+ runtime: string(),
26133
+ numWorkers: number(),
26134
+ concurrency: number(),
26135
+ batchMode: string()
26136
+ })).default({})
26137
+ });
26138
+ /** The frames the run used. */
26139
+ var NodeBenchClipSchema = object({
26140
+ /** `camstack-bench-v1` or `reference-images` (the fallback when the clip is not reachable). */
26141
+ id: string(),
26142
+ revision: string().nullable(),
26143
+ frames: number(),
26144
+ width: number(),
26145
+ height: number()
26146
+ });
26147
+ var NodeBenchRunnerInputSchema = object({
26148
+ runId: string().min(1),
26149
+ devices: array(NodeBenchmarkDevicePlanSchema).min(1),
26150
+ phases: array(NodeBenchmarkPhaseSchema).min(1),
26151
+ /** The full detail step tree root for the `pipeline` measurement is built on the node from these ids. */
26152
+ steps: array(string()).default([]),
26153
+ fpsPerStream: number().int().min(1).max(30),
26154
+ /** The runner stops on its own past this instant, whatever the hub does. */
26155
+ deadlineAtMs: number(),
26156
+ settleSec: number().min(0).max(60).default(NODE_BENCHMARK_DEFAULTS.settleSec),
26157
+ measureSec: number().min(2).max(300).default(NODE_BENCHMARK_DEFAULTS.measureSec),
26158
+ keepDownloadedModels: boolean().default(false)
26159
+ });
26160
+ var NodeBenchRunnerStateSchema = _enum([
26161
+ "running",
26162
+ "done",
26163
+ "failed",
26164
+ "aborted"
26165
+ ]);
26166
+ var NodeBenchRunnerStatusSchema = object({
26167
+ runId: string(),
26168
+ nodeId: string(),
26169
+ state: NodeBenchRunnerStateSchema,
26170
+ progress: NodeBenchProgressSchema.nullable(),
26171
+ /** Every finished cell so far — a run stopped half way keeps what it measured. */
26172
+ cells: array(NodeBenchCellSchema).readonly(),
26173
+ fingerprint: NodeBenchFingerprintSchema.nullable(),
26174
+ clip: NodeBenchClipSchema.nullable(),
26175
+ /** Cameras seen running on the node during the run (they share its pools). */
26176
+ activeCameraIds: array(number()).readonly(),
26177
+ /** Models the run downloaded and then deleted (not installed before). */
26178
+ deletedModels: array(string()).readonly(),
26179
+ error: string().nullable(),
26180
+ startedAtMs: number(),
26181
+ finishedAtMs: number().nullable()
26182
+ });
26183
+ var NodeBenchmarkStateSchema = _enum([
26184
+ "draining",
26185
+ "measuring",
26186
+ "restoring",
26187
+ "done",
26188
+ "failed",
26189
+ "aborted"
26190
+ ]);
26191
+ /** Why a run ended. */
26192
+ var NodeBenchmarkEndReasonSchema = _enum([
26193
+ "completed",
26194
+ "operator-abort",
26195
+ "deadline",
26196
+ "node-lost",
26197
+ "runner-lost",
26198
+ "hub-restart",
26199
+ "drain-timeout",
26200
+ "failed"
26201
+ ]);
26202
+ var NodeBenchmarkRunSchema = object({
26203
+ runId: string(),
26204
+ nodeId: string(),
26205
+ state: NodeBenchmarkStateSchema,
26206
+ plan: NodeBenchmarkPlanSchema,
26207
+ startedAtMs: number(),
26208
+ deadlineAtMs: number(),
26209
+ finishedAtMs: number().nullable(),
26210
+ endReason: NodeBenchmarkEndReasonSchema.nullable(),
26211
+ error: string().nullable(),
26212
+ /** Cameras moved off the node for the run. */
26213
+ moved: array(number()).readonly(),
26214
+ /** Cameras that stayed (their only frame source is the node). */
26215
+ staying: array(number()).readonly(),
26216
+ /** Something else ran on the node's pools during the run. */
26217
+ contaminated: boolean(),
26218
+ progress: NodeBenchProgressSchema.nullable(),
26219
+ resultIds: array(string()).readonly()
26220
+ });
26221
+ /** `getNodeBenchmarkStatus`: the active run (or the last one), and whether benchmark mode is on. */
26222
+ var NodeBenchmarkStatusSchema = object({
26223
+ /** The node the cluster is in benchmark mode for; null = none. */
26224
+ modeNodeId: string().nullable(),
26225
+ run: NodeBenchmarkRunSchema.nullable()
26226
+ });
26227
+ /**
26228
+ * One stored measurement — the only authority Auto tune and the automatic
26229
+ * shares read measured capacity from. Written by the orchestrator when a run
26230
+ * ends, never by anyone else.
26231
+ */
26232
+ var NodeBenchmarkResultSchema = object({
26233
+ id: string(),
26234
+ runId: string(),
26235
+ nodeId: string(),
26236
+ cell: NodeBenchCellSchema,
26237
+ fpsPerStream: number(),
26238
+ fingerprint: NodeBenchFingerprintSchema.nullable(),
26239
+ clip: NodeBenchClipSchema.nullable(),
26240
+ /** Other work shared the node's pools (a camera that could not move, or the hub's own duties). */
26241
+ contaminated: boolean(),
26242
+ stayingCameras: array(number()).readonly(),
26243
+ /** The run ended early; the cell itself completed. */
26244
+ partialRun: boolean(),
26245
+ measuredAtMs: number()
26246
+ });
26247
+ var ListNodeBenchmarkResultsInputSchema = object({
26248
+ nodeId: string().optional(),
26249
+ deviceKey: string().optional()
26250
+ });
26251
+ /** A result with its standing today: does it still beat the table? */
26252
+ var NodeBenchmarkResultViewSchema = NodeBenchmarkResultSchema.extend({
26253
+ /** `fresh` beats the table; `stale` falls back to it; `superseded` = a newer row covers the same cell. */
26254
+ standing: _enum([
26255
+ "fresh",
26256
+ "stale",
26257
+ "superseded"
26258
+ ]),
26259
+ staleWhy: _enum([
26260
+ "age",
26261
+ "runtime",
26262
+ "pool-tuning"
26263
+ ]).nullable()
26264
+ });
26265
+ object({
26266
+ runId: string(),
26267
+ nodeId: string(),
26268
+ startedAtMs: number(),
26269
+ deadlineAtMs: number(),
26270
+ plan: NodeBenchmarkPlanSchema,
26271
+ moved: array(number()).readonly(),
26272
+ staying: array(number()).readonly()
26273
+ });
26274
+ /** Candidate detectors per device, for the plan editor. */
26275
+ var NodeBenchmarkCandidatesSchema = object({
26276
+ nodeId: string(),
26277
+ reachable: boolean(),
26278
+ devices: array(object({
26279
+ deviceKey: string(),
26280
+ enabled: boolean(),
26281
+ available: boolean(),
26282
+ /** Ordered: what Auto tune would pick first, then the rest of the family by accuracy. */
26283
+ suggested: array(string()).readonly(),
26284
+ /** Every root detector the device has a build for. */
26285
+ all: array(string()).readonly(),
26286
+ /** The model the device runs now, when pinned. */
26287
+ currentModelId: string().nullable()
26288
+ })).readonly(),
26289
+ /** Detail steps the node's catalog offers under the root (for the `pipeline` measurement). */
26290
+ steps: array(object({
26291
+ id: string(),
26292
+ name: string(),
26293
+ slot: string()
26294
+ })).readonly()
26295
+ });
24416
26296
  object({
24417
26297
  activeCameras: number(),
24418
26298
  throttledCameras: number(),
@@ -25330,14 +27210,15 @@ var RunnerLocalLoadSchema = object({
25330
27210
  * Per-inference-device live load (multi-device C4). One entry per deviceKey
25331
27211
  * this runner currently has attached cameras on, so the orchestrator's second
25332
27212
  * `balance()` pass (over a node's devices) weights on real per-pool session
25333
- * counts. Empty on single-device / pre-multi-device runners. `queueDepthTotal`
25334
- * per device is 0 until the pool backlog gets a public accessor (follow-up).
27213
+ * counts. Empty on single-device / pre-multi-device runners. There is no
27214
+ * per-device queue depth: the inference pool's backlog has no accessor, and
27215
+ * a field that always read 0 was removed rather than shown as a measurement
27216
+ * (D762).
25335
27217
  */
25336
27218
  devices: array(object({
25337
27219
  deviceKey: string(),
25338
27220
  backend: string(),
25339
- attachedCameras: number(),
25340
- queueDepthTotal: number()
27221
+ attachedCameras: number()
25341
27222
  })).default([]),
25342
27223
  /** Hardware capability flags reported by this node. */
25343
27224
  hardware: object({
@@ -25540,7 +27421,16 @@ method(RunnerCameraConfigSchema, object({ success: literal(true) }), { kind: "mu
25540
27421
  }), ParkedTrackFrameSchema.nullable()), method(object({
25541
27422
  deviceId: number(),
25542
27423
  trackId: string()
25543
- }), object({ released: number().int().nonnegative() }), { kind: "mutation" });
27424
+ }), object({ released: number().int().nonnegative() }), { kind: "mutation" }), method(NodeBenchRunnerInputSchema, object({
27425
+ accepted: literal(true),
27426
+ runId: string()
27427
+ }), {
27428
+ kind: "mutation",
27429
+ auth: "admin"
27430
+ }), method(object({ runId: string() }), NodeBenchRunnerStatusSchema.nullable(), { auth: "admin" }), method(object({ runId: string() }), object({ aborted: boolean() }), {
27431
+ kind: "mutation",
27432
+ auth: "admin"
27433
+ });
25544
27434
  var CameraPipelineConfigSchema = object({
25545
27435
  engine: PipelineEngineChoiceSchema.optional(),
25546
27436
  steps: array(PipelineStepInputSchema).readonly(),
@@ -25551,14 +27441,6 @@ var CameraPipelineConfigSchema = object({
25551
27441
  settings: record(string(), unknown()).readonly().optional()
25552
27442
  }).nullable().optional()
25553
27443
  });
25554
- var PipelineTemplateSchema = object({
25555
- id: string(),
25556
- name: string(),
25557
- description: string().optional(),
25558
- config: CameraPipelineConfigSchema,
25559
- createdAt: string(),
25560
- updatedAt: string()
25561
- });
25562
27444
  var DeviceStepConfigSchema = object({
25563
27445
  modelId: string().optional(),
25564
27446
  settings: record(string(), unknown()).optional(),
@@ -25632,9 +27514,10 @@ var CameraStepOverridePatchSchema = object({
25632
27514
  modelId: string().optional(),
25633
27515
  settings: record(string(), unknown()).readonly().optional()
25634
27516
  });
27517
+ var CameraStepSettingsSchema = record(string(), record(string(), unknown()).readonly());
25635
27518
  var CameraPipelineSettingsSchema = object({
25636
- pinnedAgentNodeId: string().optional(),
25637
27519
  stepToggles: record(string(), boolean()).optional(),
27520
+ stepSettings: CameraStepSettingsSchema.optional(),
25638
27521
  stepOverridesByDevice: record(string(), record(string(), record(string(), CameraStepOverridePatchSchema))).optional(),
25639
27522
  pipelineByAgent: record(string(), CameraPipelineForAgentSchema).optional()
25640
27523
  });
@@ -25667,7 +27550,10 @@ var PipelineAssignmentSchema = object({
25667
27550
  });
25668
27551
  /**
25669
27552
  * Per-agent load summary surfaced to the load balancer + dashboards.
25670
- * Aggregated from each runner's `getLocalLoad` cap call.
27553
+ * Aggregated from each runner's `getLocalLoad` cap call. In the
27554
+ * `getAgentLoad` report, a single-device node's default-pool sessions (no
27555
+ * `deviceKey`) are credited to its one eligible device in `load.devices` —
27556
+ * the default pool IS that device (D745); the balancer's census stays raw.
25671
27557
  */
25672
27558
  var AgentLoadSummarySchema = object({
25673
27559
  nodeId: string(),
@@ -25756,26 +27642,27 @@ var CameraBrokerStatusSchema = object({
25756
27642
  width: number(),
25757
27643
  height: number(),
25758
27644
  subscribers: number(),
25759
- inFps: number(),
25760
- outFps: number()
27645
+ /**
27646
+ * Encoded packets/s the broker receives from the camera. null when the
27647
+ * broker's stats read failed — unknown, never 0 (a 0 here reads as a stall).
27648
+ * There is no output rate: decoding runs in the session decode workers, not
27649
+ * in the broker, so the broker's own decoded-frame rate is 0 on every live
27650
+ * camera and is not served (D758).
27651
+ */
27652
+ inFps: number().nullable()
25761
27653
  })).readonly(),
25762
27654
  webrtcSessions: number(),
25763
27655
  rtspRestream: boolean()
25764
27656
  });
25765
- /** Shared-memory ring statistics within the decoder block. */
25766
- var CameraDecoderShmSchema = object({
25767
- framesWritten: number(),
25768
- getFrameHits: number(),
25769
- getFrameMisses: number(),
25770
- budgetMb: number()
25771
- });
25772
- /** Decoder block — null when the decoder stage is unreachable or inactive. */
25773
- var CameraDecoderStatusSchema = object({
25774
- nodeId: string(),
25775
- formats: array(string()).readonly(),
25776
- sessionCount: number(),
25777
- shm: CameraDecoderShmSchema
25778
- });
27657
+ /**
27658
+ * Decoder block — WHERE decode runs (co-located with the detection node by
27659
+ * construction); null when the camera has no detection node. It carries no
27660
+ * frame counter: the shared-memory plane whose counters it used to serve is
27661
+ * gone, and those fields read 0 forever. Whether frames actually flow is read
27662
+ * from `detection.actualFps` (frames delivered to and processed by the
27663
+ * detector), never from a counter nothing feeds.
27664
+ */
27665
+ var CameraDecoderStatusSchema = object({ nodeId: string() });
25779
27666
  /** Motion block — null when motion detection is not active for this device. */
25780
27667
  var CameraMotionStatusSchema = object({
25781
27668
  enabled: boolean(),
@@ -26132,12 +28019,6 @@ method(object({
26132
28019
  }), object({ success: literal(true) }), {
26133
28020
  kind: "mutation",
26134
28021
  auth: "admin"
26135
- }), method(object({
26136
- agentNodeId: string(),
26137
- detectWeight: number().positive().nullable()
26138
- }), object({ success: literal(true) }), {
26139
- kind: "mutation",
26140
- auth: "admin"
26141
28022
  }), method(object({
26142
28023
  agentNodeId: string(),
26143
28024
  detect: boolean().nullable().optional(),
@@ -26179,6 +28060,30 @@ method(object({
26179
28060
  }), {
26180
28061
  kind: "mutation",
26181
28062
  auth: "admin"
28063
+ }), method(AutoTuneOptionsSchema, AutoTunePlanSchema, { auth: "admin" }), method(AutoTuneApplyInputSchema, AutoTuneApplyResultSchema, {
28064
+ kind: "mutation",
28065
+ auth: "admin"
28066
+ }), method(LoadBalancingSharesInputSchema, object({ success: literal(true) }), {
28067
+ kind: "mutation",
28068
+ auth: "admin"
28069
+ }), method(PlacementStatsInputSchema, PlacementStatsSchema, { auth: "admin" }), method(SuggestSharesInputSchema, SuggestSharesResultSchema, { auth: "admin" }), method(_void(), EffectiveSharesSchema, { auth: "admin" }), method(SetShareSourceInputSchema, object({ success: literal(true) }), {
28070
+ kind: "mutation",
28071
+ auth: "admin"
28072
+ }), method(NodeBenchmarkPlanSchema, NodeBenchmarkPreflightSchema, { auth: "admin" }), method(NodeBenchmarkPlanSchema, discriminatedUnion("kind", [object({
28073
+ kind: literal("started"),
28074
+ runId: string()
28075
+ }), object({
28076
+ kind: literal("refused"),
28077
+ preflight: NodeBenchmarkPreflightSchema
28078
+ })]), {
28079
+ kind: "mutation",
28080
+ auth: "admin"
28081
+ }), method(_void(), NodeBenchmarkStatusSchema, { auth: "admin" }), method(object({ runId: string() }), object({ aborted: boolean() }), {
28082
+ kind: "mutation",
28083
+ auth: "admin"
28084
+ }), method(object({ nodeId: string() }), NodeBenchmarkCandidatesSchema, { auth: "admin" }), method(ListNodeBenchmarkResultsInputSchema, array(NodeBenchmarkResultViewSchema).readonly(), { auth: "admin" }), method(object({ id: string() }), object({ deleted: boolean() }), {
28085
+ kind: "mutation",
28086
+ auth: "admin"
26182
28087
  }), method(object({ deviceId: number() }), CameraPipelineSettingsSchema.nullable()), method(object({
26183
28088
  deviceId: number(),
26184
28089
  addonId: string(),
@@ -26195,6 +28100,13 @@ method(object({
26195
28100
  }), object({ success: literal(true) }), {
26196
28101
  kind: "mutation",
26197
28102
  auth: "admin"
28103
+ }), method(object({
28104
+ deviceId: number(),
28105
+ addonId: string(),
28106
+ settings: record(string(), unknown()).nullable()
28107
+ }), object({ success: literal(true) }), {
28108
+ kind: "mutation",
28109
+ auth: "admin"
26198
28110
  }), method(object({
26199
28111
  deviceId: number(),
26200
28112
  agentNodeId: string(),
@@ -26218,25 +28130,7 @@ method(object({
26218
28130
  }), method(_void(), DiskReconcileJobSchema, {
26219
28131
  kind: "mutation",
26220
28132
  auth: "admin"
26221
- }), method(_void(), DiskReconcileJobSchema, { auth: "admin" }), method(_void(), array(PipelineTemplateSchema).readonly()), method(object({
26222
- name: string(),
26223
- description: string().optional(),
26224
- config: CameraPipelineConfigSchema
26225
- }), PipelineTemplateSchema, {
26226
- kind: "mutation",
26227
- auth: "admin"
26228
- }), method(object({
26229
- id: string(),
26230
- name: string().optional(),
26231
- description: string().optional(),
26232
- config: CameraPipelineConfigSchema.optional()
26233
- }), PipelineTemplateSchema, {
26234
- kind: "mutation",
26235
- auth: "admin"
26236
- }), method(object({ id: string() }), object({ success: literal(true) }), {
26237
- kind: "mutation",
26238
- auth: "admin"
26239
- });
28133
+ }), method(_void(), DiskReconcileJobSchema, { auth: "admin" });
26240
28134
  /**
26241
28135
  * Cap → event-kind mapping for the SENSOR / CONTROL cap families — the table
26242
28136
  * `pipeline-analytics.listEventKinds` uses to turn a linked device's bound
@@ -26826,7 +28720,19 @@ var SsoBridgeClaimsSchema = object({
26826
28720
  * editing a descriptor must not retroactively extend or shorten a link the
26827
28721
  * operator already consented to.
26828
28722
  */
26829
- refreshTtl: union([number().int().positive(), literal("never")]).optional()
28723
+ refreshTtl: union([number().int().positive(), literal("never")]).optional(),
28724
+ /**
28725
+ * Opaque handle of a hub-side LINK intent (D782). Set by an OIDC callback
28726
+ * that was started from a signed-in user's "Link" button: the finish then
28727
+ * links this identity to the intent's user instead of signing anyone in.
28728
+ * The handle carries no user id — the hub resolves it, single-use.
28729
+ */
28730
+ linkIntent: string().optional(),
28731
+ /**
28732
+ * Verified `iss` of the id_token behind an OIDC login bridge (D782). A
28733
+ * subject is unique only per issuer, so a link is bound to it.
28734
+ */
28735
+ issuer: string().optional()
26830
28736
  });
26831
28737
  method(object({
26832
28738
  claims: SsoBridgeClaimsSchema,
@@ -28485,8 +30391,6 @@ var WebrtcStreamChoiceSchema = object({
28485
30391
  ]).nullable(),
28486
30392
  /** Input FPS from the camera (null for adaptive). */
28487
30393
  inputFps: number().nullable(),
28488
- /** Decoded FPS (null for adaptive). */
28489
- decodeFps: number().nullable(),
28490
30394
  /** Bitrate in kbps (null for adaptive). */
28491
30395
  bitrateKbps: number().nullable()
28492
30396
  });
@@ -28763,7 +30667,22 @@ DeviceType.Camera, method(object({ deviceId: number().int().nonnegative() }), ar
28763
30667
  * field their hints were silently stripped by the schema and the
28764
30668
  * adaptive ladder started blind on the client's display size.
28765
30669
  */
28766
- hints: webrtcClientHintsSchema.optional()
30670
+ hints: webrtcClientHintsSchema.optional(),
30671
+ /**
30672
+ * Talk-back (D771): relay the PEER's audio to the device's speaker
30673
+ * through the `intercom` cap's push-talk triple. When `true` and the
30674
+ * offer lets the peer send audio, the answer's audio is `sendrecv`
30675
+ * and every inbound frame goes to `intercom.pushTalkAudio` for this
30676
+ * `deviceId`; absent/false answers `sendonly`, as for every viewer.
30677
+ *
30678
+ * TRUSTED-CALLER ONLY. Set by the Alexa export for an Echo on a camera
30679
+ * with `intercom`, when the linked user may control that camera. The
30680
+ * hub STRIPS it from every request-bound call (a browser), exactly as
30681
+ * it overwrites `relayOnly` — a viewer's talk permission is the
30682
+ * intercom cap's own surface (share tokens gate it there), and this
30683
+ * flag must not become a second door to the camera's speaker.
30684
+ */
30685
+ talkback: boolean().optional()
28767
30686
  }), object({
28768
30687
  sessionId: string(),
28769
30688
  sdpAnswer: string()
@@ -29137,6 +31056,59 @@ var AddonAutoUpdateSchema = ChannelWithInheritSchema;
29137
31056
  var RestartAddonResultSchema = unknown();
29138
31057
  var InstallPackageResultSchema = unknown();
29139
31058
  var ReloadPackagesResultSchema = unknown();
31059
+ /**
31060
+ * What an uninstall did on ONE node.
31061
+ * - `uninstalled` — removed: runner(s) stopped, caps gone, code deleted.
31062
+ * - `not-installed` — the node did not have it (nothing to do).
31063
+ * - `refused` — protected / bootstrap package; nothing touched.
31064
+ * - `failed` — attempted and did not complete; `error` says why.
31065
+ * - `pending-reconnect` — the node is OFFLINE: its record was pruned so the
31066
+ * back-fill never returns the package, and the stale-addon sweep removes the
31067
+ * copy when the node registers again (only once the hub no longer has it).
31068
+ */
31069
+ var UninstallNodeOutcomeSchema = _enum([
31070
+ "uninstalled",
31071
+ "not-installed",
31072
+ "refused",
31073
+ "failed",
31074
+ "pending-reconnect"
31075
+ ]);
31076
+ var UninstallNodeResultSchema = object({
31077
+ nodeId: string(),
31078
+ outcome: UninstallNodeOutcomeSchema,
31079
+ error: string().optional(),
31080
+ addonIds: array(string()).readonly(),
31081
+ runnersStopped: array(string()).readonly(),
31082
+ warnings: array(string()).readonly()
31083
+ });
31084
+ var UninstallPackageResultSchema = object({
31085
+ /** Every targeted node ended `uninstalled`, `not-installed` or `pending-reconnect`. */
31086
+ success: boolean(),
31087
+ packageName: string(),
31088
+ results: array(UninstallNodeResultSchema).readonly()
31089
+ });
31090
+ /**
31091
+ * `unreachable` lists online agents whose status read FAILED — absence from
31092
+ * `installations` is only "not installed" for a node that answered (D315).
31093
+ */
31094
+ var PackageInstallationsSchema = object({
31095
+ installations: array(object({
31096
+ packageName: string(),
31097
+ nodeId: string(),
31098
+ nodeName: string(),
31099
+ isHub: boolean(),
31100
+ isOnline: boolean(),
31101
+ version: string().nullable(),
31102
+ addonIds: array(string()).readonly(),
31103
+ source: _enum(["live", "recorded"]),
31104
+ /** The hub installs this package too. `false` on an agent row = an orphan. */
31105
+ onHub: boolean()
31106
+ })).readonly(),
31107
+ unreachable: array(object({
31108
+ nodeId: string(),
31109
+ error: string()
31110
+ })).readonly()
31111
+ });
29140
31112
  var BulkUpdateItemStatusSchema = _enum([
29141
31113
  "queued",
29142
31114
  "updating",
@@ -29219,10 +31191,14 @@ method(_void(), array(AddonListItemSchema).readonly()), method(object({
29219
31191
  }), method(object({ packageName: string() }), InstallPackageResultSchema, {
29220
31192
  kind: "mutation",
29221
31193
  auth: "admin"
29222
- }), method(_void(), boolean()), method(_void(), array(unknown()).readonly()), method(object({ packageName: string() }), unknown(), {
31194
+ }), method(_void(), boolean()), method(_void(), array(unknown()).readonly()), method(object({
31195
+ packageName: string().min(1),
31196
+ nodeId: string().optional(),
31197
+ everywhere: boolean().optional()
31198
+ }), UninstallPackageResultSchema, {
29223
31199
  kind: "mutation",
29224
31200
  auth: "admin"
29225
- }), method(_void(), ReloadPackagesResultSchema, {
31201
+ }), method(object({ packageName: string().optional() }), PackageInstallationsSchema, { auth: "admin" }), method(_void(), ReloadPackagesResultSchema, {
29226
31202
  kind: "mutation",
29227
31203
  auth: "admin"
29228
31204
  }), method(object({ query: string().optional() }), array(SearchResultSchema)), method(object({ nodeId: string().optional() }), array(PackageUpdateSchema).readonly(), { auth: "admin" }), method(object({
@@ -32313,6 +34289,9 @@ var CreateIntegrationInputSchema = object({
32313
34289
  enabled: boolean().optional(),
32314
34290
  info: record(string(), unknown()).optional(),
32315
34291
  settings: record(string(), unknown()).optional(),
34292
+ /** Keys of `settings` the form's schema declares secret (by type) — kept in
34293
+ * the keychain, not the table (D787). */
34294
+ secretKeys: array(string()).optional(),
32316
34295
  skipRestart: boolean().optional()
32317
34296
  });
32318
34297
  var UpdateIntegrationInputSchema = object({
@@ -32336,7 +34315,9 @@ method(_void(), array(IntegrationWithStateSchema)), method(object({ id: string()
32336
34315
  auth: "admin"
32337
34316
  }), method(object({ id: string() }), record(string(), unknown()), { auth: "admin" }), method(object({
32338
34317
  id: string(),
32339
- settings: record(string(), unknown())
34318
+ settings: record(string(), unknown()),
34319
+ /** Keys the form's schema declares secret (by type) — keychain-stored (D787). */
34320
+ secretKeys: array(string()).optional()
32340
34321
  }), object({ success: boolean() }), {
32341
34322
  kind: "mutation",
32342
34323
  auth: "admin"
@@ -39158,6 +41139,32 @@ var TotpStatusSchema = object({
39158
41139
  /** Null when no row exists OR the row is still pending confirmation. */
39159
41140
  confirmedAt: number().nullable()
39160
41141
  });
41142
+ /**
41143
+ * user-management — singleton capability for user accounts, API keys,
41144
+ * and scoped tokens.
41145
+ *
41146
+ * v2 model: every method gated by `auth: 'admin'`. Admin-only delegation
41147
+ * — the subset check on `setUserScopes` / `createScopedToken` is moot
41148
+ * because non-admins never reach these. If/when we open non-admin
41149
+ * delegation, structural caller-scope subset check goes inside the
41150
+ * provider.
41151
+ */
41152
+ var ExternalIdentitySchema = object({
41153
+ /** Login-method id of the provider instance, e.g. `auth-oidc/authentik`. */
41154
+ provider: string(),
41155
+ /** The IdP's stable subject (`sub`) for this account. */
41156
+ subject: string(),
41157
+ /** The verified `iss` of the IdP the identity was linked under — `sub` is unique only per issuer. */
41158
+ issuer: string(),
41159
+ userId: string(),
41160
+ /** What the IdP called the account at link time (username / email) — display only. */
41161
+ label: string().optional(),
41162
+ linkedAt: number()
41163
+ });
41164
+ var ExternalIdentityKeySchema = object({
41165
+ provider: string().min(1),
41166
+ subject: string().min(1)
41167
+ });
39161
41168
  method(_void(), array(UserSummarySchema), { auth: "admin" }), method(CreateUserInputSchema, UserSummarySchema, {
39162
41169
  kind: "mutation",
39163
41170
  auth: "admin",
@@ -39271,7 +41278,22 @@ method(_void(), array(UserSummarySchema), { auth: "admin" }), method(CreateUserI
39271
41278
  userId: string(),
39272
41279
  username: string(),
39273
41280
  scopes: array(TokenScopeSchema)
39274
- }).nullable(), { access: "view" }), method(_void(), array(OauthSessionSummarySchema), { auth: "admin" }), method(object({ id: string() }), object({ success: boolean() }), {
41281
+ }).nullable(), { access: "view" }), method(object({ userId: string() }), array(ExternalIdentitySchema), { auth: "admin" }), method(ExternalIdentityKeySchema, object({
41282
+ userId: string(),
41283
+ issuer: string()
41284
+ }).nullable(), { auth: "admin" }), method(ExternalIdentityKeySchema.extend({
41285
+ userId: string(),
41286
+ issuer: string().min(1),
41287
+ label: string().optional()
41288
+ }), object({ success: literal(true) }), {
41289
+ kind: "mutation",
41290
+ auth: "admin",
41291
+ access: "create"
41292
+ }), method(ExternalIdentityKeySchema.extend({ userId: string() }), object({ success: boolean() }), {
41293
+ kind: "mutation",
41294
+ auth: "admin",
41295
+ access: "delete"
41296
+ }), method(_void(), array(OauthSessionSummarySchema), { auth: "admin" }), method(object({ id: string() }), object({ success: boolean() }), {
39275
41297
  kind: "mutation",
39276
41298
  auth: "admin",
39277
41299
  access: "delete"
@@ -39973,6 +41995,16 @@ var zoneRulesCapability = {
39973
41995
  durability: "restored"
39974
41996
  };
39975
41997
  SOURCE_CAPS.filter((cap) => cap !== "switch" && cap !== "motion");
41998
+ Object.freeze({
41999
+ person: .5,
42000
+ vehicle: .5,
42001
+ animal: .5
42002
+ });
42003
+ Object.freeze({
42004
+ person: .65,
42005
+ vehicle: .65,
42006
+ animal: .65
42007
+ });
39976
42008
  /**
39977
42009
  * Accessory device helpers — shared across drivers.
39978
42010
  *
@@ -40448,7 +42480,8 @@ var BaseDevice = class {
40448
42480
  this.role = options.role;
40449
42481
  this.parentDeviceId = ctx.parentDeviceId;
40450
42482
  const seedData = ctx.persistedConfig ?? {};
40451
- this.config = DeviceConfig.fromSchema(schema, (data) => ctx.persistConfig(data), seedData, ({ droppedKeys, issues }) => {
42483
+ const declaredSecretPaths = collectZodSecretPaths(schema);
42484
+ this.config = DeviceConfig.fromSchema(schema, (data) => ctx.persistConfig(data, { secretConfigPaths: declaredSecretPaths }), seedData, ({ droppedKeys, issues }) => {
40452
42485
  ctx.logger.warn("Device config recovery: dropping invalid persisted fields", {
40453
42486
  tags: {
40454
42487
  deviceId: ctx.id,
@@ -41671,6 +43704,12 @@ Object.freeze({
41671
43704
  addonId: null,
41672
43705
  access: "view"
41673
43706
  },
43707
+ "addons.listInstallations": {
43708
+ capName: "addons",
43709
+ capScope: "system",
43710
+ addonId: null,
43711
+ access: "view"
43712
+ },
41674
43713
  "addons.listJobs": {
41675
43714
  capName: "addons",
41676
43715
  capScope: "system",
@@ -42853,90 +44892,18 @@ Object.freeze({
42853
44892
  addonId: null,
42854
44893
  access: "create"
42855
44894
  },
42856
- "decoder.createSession": {
42857
- capName: "decoder",
42858
- capScope: "system",
42859
- addonId: null,
42860
- access: "view"
42861
- },
42862
- "decoder.destroySession": {
42863
- capName: "decoder",
42864
- capScope: "system",
42865
- addonId: null,
42866
- access: "delete"
42867
- },
42868
- "decoder.getFrame": {
42869
- capName: "decoder",
42870
- capScope: "system",
42871
- addonId: null,
42872
- access: "view"
42873
- },
42874
44895
  "decoder.getInfo": {
42875
44896
  capName: "decoder",
42876
44897
  capScope: "system",
42877
44898
  addonId: null,
42878
44899
  access: "view"
42879
44900
  },
42880
- "decoder.getShmStats": {
42881
- capName: "decoder",
42882
- capScope: "system",
42883
- addonId: null,
42884
- access: "view"
42885
- },
42886
- "decoder.getStats": {
42887
- capName: "decoder",
42888
- capScope: "system",
42889
- addonId: null,
42890
- access: "view"
42891
- },
42892
- "decoder.listActiveSessions": {
42893
- capName: "decoder",
42894
- capScope: "system",
42895
- addonId: null,
42896
- access: "view"
42897
- },
42898
- "decoder.openStream": {
42899
- capName: "decoder",
42900
- capScope: "system",
42901
- addonId: null,
42902
- access: "view"
42903
- },
42904
- "decoder.pullFrames": {
42905
- capName: "decoder",
42906
- capScope: "system",
42907
- addonId: null,
42908
- access: "view"
42909
- },
42910
- "decoder.pullHandles": {
42911
- capName: "decoder",
42912
- capScope: "system",
42913
- addonId: null,
42914
- access: "view"
42915
- },
42916
- "decoder.pushPacket": {
42917
- capName: "decoder",
42918
- capScope: "system",
42919
- addonId: null,
42920
- access: "view"
42921
- },
42922
44901
  "decoder.reprobeHwaccel": {
42923
44902
  capName: "decoder",
42924
44903
  capScope: "system",
42925
44904
  addonId: null,
42926
44905
  access: "create"
42927
44906
  },
42928
- "decoder.supportsCodec": {
42929
- capName: "decoder",
42930
- capScope: "system",
42931
- addonId: null,
42932
- access: "view"
42933
- },
42934
- "decoder.updateConfig": {
42935
- capName: "decoder",
42936
- capScope: "system",
42937
- addonId: null,
42938
- access: "view"
42939
- },
42940
44907
  "detectionPipeline.applyDeviceSettingsPatch": {
42941
44908
  capName: "detection-pipeline",
42942
44909
  capScope: "device",
@@ -44203,6 +46170,90 @@ Object.freeze({
44203
46170
  addonId: null,
44204
46171
  access: "create"
44205
46172
  },
46173
+ "keychain.delete": {
46174
+ capName: "keychain",
46175
+ capScope: "system",
46176
+ addonId: null,
46177
+ access: "delete"
46178
+ },
46179
+ "keychain.getState": {
46180
+ capName: "keychain",
46181
+ capScope: "system",
46182
+ addonId: null,
46183
+ access: "view"
46184
+ },
46185
+ "keychain.listMeta": {
46186
+ capName: "keychain",
46187
+ capScope: "system",
46188
+ addonId: null,
46189
+ access: "view"
46190
+ },
46191
+ "keychain.put": {
46192
+ capName: "keychain",
46193
+ capScope: "system",
46194
+ addonId: null,
46195
+ access: "create"
46196
+ },
46197
+ "keychain.resolve": {
46198
+ capName: "keychain",
46199
+ capScope: "system",
46200
+ addonId: null,
46201
+ access: "view"
46202
+ },
46203
+ "keychainAdmin.deleteOrphans": {
46204
+ capName: "keychain-admin",
46205
+ capScope: "system",
46206
+ addonId: null,
46207
+ access: "delete"
46208
+ },
46209
+ "keychainAdmin.downloadRecoveryKey": {
46210
+ capName: "keychain-admin",
46211
+ capScope: "system",
46212
+ addonId: null,
46213
+ access: "create"
46214
+ },
46215
+ "keychainAdmin.listAudit": {
46216
+ capName: "keychain-admin",
46217
+ capScope: "system",
46218
+ addonId: null,
46219
+ access: "view"
46220
+ },
46221
+ "keychainAdmin.listSecrets": {
46222
+ capName: "keychain-admin",
46223
+ capScope: "system",
46224
+ addonId: null,
46225
+ access: "view"
46226
+ },
46227
+ "keychainAdmin.purgeRetiredKeys": {
46228
+ capName: "keychain-admin",
46229
+ capScope: "system",
46230
+ addonId: null,
46231
+ access: "delete"
46232
+ },
46233
+ "keychainAdmin.resetKeychain": {
46234
+ capName: "keychain-admin",
46235
+ capScope: "system",
46236
+ addonId: null,
46237
+ access: "delete"
46238
+ },
46239
+ "keychainAdmin.reveal": {
46240
+ capName: "keychain-admin",
46241
+ capScope: "system",
46242
+ addonId: null,
46243
+ access: "create"
46244
+ },
46245
+ "keychainAdmin.rotateMasterKey": {
46246
+ capName: "keychain-admin",
46247
+ capScope: "system",
46248
+ addonId: null,
46249
+ access: "create"
46250
+ },
46251
+ "keychainAdmin.status": {
46252
+ capName: "keychain-admin",
46253
+ capScope: "system",
46254
+ addonId: null,
46255
+ access: "view"
46256
+ },
44206
46257
  "lawnMowerControl.dock": {
44207
46258
  capName: "lawn-mower-control",
44208
46259
  capScope: "device",
@@ -45577,6 +47628,18 @@ Object.freeze({
45577
47628
  addonId: null,
45578
47629
  access: "create"
45579
47630
  },
47631
+ "pipelineAnalytics.addRetrainFrameFromRecording": {
47632
+ capName: "pipeline-analytics",
47633
+ capScope: "device",
47634
+ addonId: null,
47635
+ access: "create"
47636
+ },
47637
+ "pipelineAnalytics.addRetrainFramesToCollection": {
47638
+ capName: "pipeline-analytics",
47639
+ capScope: "device",
47640
+ addonId: null,
47641
+ access: "create"
47642
+ },
45580
47643
  "pipelineAnalytics.applyDeviceSettingsPatch": {
45581
47644
  capName: "pipeline-analytics",
45582
47645
  capScope: "device",
@@ -45625,12 +47688,24 @@ Object.freeze({
45625
47688
  addonId: null,
45626
47689
  access: "view"
45627
47690
  },
47691
+ "pipelineAnalytics.createRetrainCollection": {
47692
+ capName: "pipeline-analytics",
47693
+ capScope: "device",
47694
+ addonId: null,
47695
+ access: "create"
47696
+ },
45628
47697
  "pipelineAnalytics.deleteDeviceEvents": {
45629
47698
  capName: "pipeline-analytics",
45630
47699
  capScope: "device",
45631
47700
  addonId: null,
45632
47701
  access: "delete"
45633
47702
  },
47703
+ "pipelineAnalytics.deleteRetrainCollection": {
47704
+ capName: "pipeline-analytics",
47705
+ capScope: "device",
47706
+ addonId: null,
47707
+ access: "delete"
47708
+ },
45634
47709
  "pipelineAnalytics.deleteTracks": {
45635
47710
  capName: "pipeline-analytics",
45636
47711
  capScope: "device",
@@ -45835,6 +47910,24 @@ Object.freeze({
45835
47910
  addonId: null,
45836
47911
  access: "view"
45837
47912
  },
47913
+ "pipelineAnalytics.listRetrainAssistProfiles": {
47914
+ capName: "pipeline-analytics",
47915
+ capScope: "device",
47916
+ addonId: null,
47917
+ access: "view"
47918
+ },
47919
+ "pipelineAnalytics.listRetrainCollectionFrames": {
47920
+ capName: "pipeline-analytics",
47921
+ capScope: "device",
47922
+ addonId: null,
47923
+ access: "view"
47924
+ },
47925
+ "pipelineAnalytics.listRetrainCollections": {
47926
+ capName: "pipeline-analytics",
47927
+ capScope: "device",
47928
+ addonId: null,
47929
+ access: "view"
47930
+ },
45838
47931
  "pipelineAnalytics.listRetrainFrames": {
45839
47932
  capName: "pipeline-analytics",
45840
47933
  capScope: "device",
@@ -45883,6 +47976,12 @@ Object.freeze({
45883
47976
  addonId: null,
45884
47977
  access: "create"
45885
47978
  },
47979
+ "pipelineAnalytics.proposeRetrainAnnotationsWithLlm": {
47980
+ capName: "pipeline-analytics",
47981
+ capScope: "device",
47982
+ addonId: null,
47983
+ access: "create"
47984
+ },
45886
47985
  "pipelineAnalytics.pruneEvents": {
45887
47986
  capName: "pipeline-analytics",
45888
47987
  capScope: "device",
@@ -45937,6 +48036,18 @@ Object.freeze({
45937
48036
  addonId: null,
45938
48037
  access: "create"
45939
48038
  },
48039
+ "pipelineAnalytics.removeRetrainFrameFromCollection": {
48040
+ capName: "pipeline-analytics",
48041
+ capScope: "device",
48042
+ addonId: null,
48043
+ access: "delete"
48044
+ },
48045
+ "pipelineAnalytics.renameRetrainCollection": {
48046
+ capName: "pipeline-analytics",
48047
+ capScope: "device",
48048
+ addonId: null,
48049
+ access: "create"
48050
+ },
45940
48051
  "pipelineAnalytics.restageRetrainTrack": {
45941
48052
  capName: "pipeline-analytics",
45942
48053
  capScope: "device",
@@ -45967,6 +48078,12 @@ Object.freeze({
45967
48078
  addonId: null,
45968
48079
  access: "create"
45969
48080
  },
48081
+ "pipelineAnalytics.setRetrainFrameComplete": {
48082
+ capName: "pipeline-analytics",
48083
+ capScope: "device",
48084
+ addonId: null,
48085
+ access: "create"
48086
+ },
45970
48087
  "pipelineAnalytics.setTrackFlags": {
45971
48088
  capName: "pipeline-analytics",
45972
48089
  capScope: "device",
@@ -46003,6 +48120,12 @@ Object.freeze({
46003
48120
  addonId: null,
46004
48121
  access: "delete"
46005
48122
  },
48123
+ "pipelineAnalytics.writeRetrainArchive": {
48124
+ capName: "pipeline-analytics",
48125
+ capScope: "device",
48126
+ addonId: null,
48127
+ access: "create"
48128
+ },
46006
48129
  "pipelineExecutor.cacheFrameInPool": {
46007
48130
  capName: "pipeline-executor",
46008
48131
  capScope: "system",
@@ -46015,13 +48138,13 @@ Object.freeze({
46015
48138
  addonId: null,
46016
48139
  access: "delete"
46017
48140
  },
46018
- "pipelineExecutor.deleteModel": {
48141
+ "pipelineExecutor.clearModelBoundDeviceOverrides": {
46019
48142
  capName: "pipeline-executor",
46020
48143
  capScope: "system",
46021
48144
  addonId: null,
46022
48145
  access: "delete"
46023
48146
  },
46024
- "pipelineExecutor.deleteTemplate": {
48147
+ "pipelineExecutor.deleteModel": {
46025
48148
  capName: "pipeline-executor",
46026
48149
  capScope: "system",
46027
48150
  addonId: null,
@@ -46165,12 +48288,6 @@ Object.freeze({
46165
48288
  addonId: null,
46166
48289
  access: "view"
46167
48290
  },
46168
- "pipelineExecutor.listTemplates": {
46169
- capName: "pipeline-executor",
46170
- capScope: "system",
46171
- addonId: null,
46172
- access: "view"
46173
- },
46174
48291
  "pipelineExecutor.rearmInferenceDevice": {
46175
48292
  capName: "pipeline-executor",
46176
48293
  capScope: "system",
@@ -46195,12 +48312,6 @@ Object.freeze({
46195
48312
  addonId: null,
46196
48313
  access: "create"
46197
48314
  },
46198
- "pipelineExecutor.saveTemplate": {
46199
- capName: "pipeline-executor",
46200
- capScope: "system",
46201
- addonId: null,
46202
- access: "create"
46203
- },
46204
48315
  "pipelineExecutor.setVideoPipelineSteps": {
46205
48316
  capName: "pipeline-executor",
46206
48317
  capScope: "system",
@@ -46219,17 +48330,23 @@ Object.freeze({
46219
48330
  addonId: null,
46220
48331
  access: "create"
46221
48332
  },
46222
- "pipelineExecutor.updateTemplate": {
48333
+ "pipelineExecutor.validatePipeline": {
46223
48334
  capName: "pipeline-executor",
46224
48335
  capScope: "system",
46225
48336
  addonId: null,
48337
+ access: "view"
48338
+ },
48339
+ "pipelineOrchestrator.abortNodeBenchmark": {
48340
+ capName: "pipeline-orchestrator",
48341
+ capScope: "system",
48342
+ addonId: null,
46226
48343
  access: "create"
46227
48344
  },
46228
- "pipelineExecutor.validatePipeline": {
46229
- capName: "pipeline-executor",
48345
+ "pipelineOrchestrator.applyAutoTune": {
48346
+ capName: "pipeline-orchestrator",
46230
48347
  capScope: "system",
46231
48348
  addonId: null,
46232
- access: "view"
48349
+ access: "create"
46233
48350
  },
46234
48351
  "pipelineOrchestrator.applyDeviceSettingsPatch": {
46235
48352
  capName: "pipeline-orchestrator",
@@ -46249,7 +48366,7 @@ Object.freeze({
46249
48366
  addonId: null,
46250
48367
  access: "create"
46251
48368
  },
46252
- "pipelineOrchestrator.deleteTemplate": {
48369
+ "pipelineOrchestrator.deleteNodeBenchmarkResult": {
46253
48370
  capName: "pipeline-orchestrator",
46254
48371
  capScope: "system",
46255
48372
  addonId: null,
@@ -46345,6 +48462,12 @@ Object.freeze({
46345
48462
  addonId: null,
46346
48463
  access: "view"
46347
48464
  },
48465
+ "pipelineOrchestrator.getEffectiveShares": {
48466
+ capName: "pipeline-orchestrator",
48467
+ capScope: "system",
48468
+ addonId: null,
48469
+ access: "view"
48470
+ },
46348
48471
  "pipelineOrchestrator.getGlobalMetrics": {
46349
48472
  capName: "pipeline-orchestrator",
46350
48473
  capScope: "system",
@@ -46357,6 +48480,24 @@ Object.freeze({
46357
48480
  addonId: null,
46358
48481
  access: "view"
46359
48482
  },
48483
+ "pipelineOrchestrator.getNodeBenchmarkCandidates": {
48484
+ capName: "pipeline-orchestrator",
48485
+ capScope: "system",
48486
+ addonId: null,
48487
+ access: "view"
48488
+ },
48489
+ "pipelineOrchestrator.getNodeBenchmarkPreflight": {
48490
+ capName: "pipeline-orchestrator",
48491
+ capScope: "system",
48492
+ addonId: null,
48493
+ access: "view"
48494
+ },
48495
+ "pipelineOrchestrator.getNodeBenchmarkStatus": {
48496
+ capName: "pipeline-orchestrator",
48497
+ capScope: "system",
48498
+ addonId: null,
48499
+ access: "view"
48500
+ },
46360
48501
  "pipelineOrchestrator.getNodeInferenceDevices": {
46361
48502
  capName: "pipeline-orchestrator",
46362
48503
  capScope: "system",
@@ -46381,6 +48522,12 @@ Object.freeze({
46381
48522
  addonId: null,
46382
48523
  access: "view"
46383
48524
  },
48525
+ "pipelineOrchestrator.getPlacementStats": {
48526
+ capName: "pipeline-orchestrator",
48527
+ capScope: "system",
48528
+ addonId: null,
48529
+ access: "view"
48530
+ },
46384
48531
  "pipelineOrchestrator.getReconcileFromDiskStatus": {
46385
48532
  capName: "pipeline-orchestrator",
46386
48533
  capScope: "system",
@@ -46393,7 +48540,7 @@ Object.freeze({
46393
48540
  addonId: null,
46394
48541
  access: "view"
46395
48542
  },
46396
- "pipelineOrchestrator.listTemplates": {
48543
+ "pipelineOrchestrator.listNodeBenchmarkResults": {
46397
48544
  capName: "pipeline-orchestrator",
46398
48545
  capScope: "system",
46399
48546
  addonId: null,
@@ -46405,6 +48552,12 @@ Object.freeze({
46405
48552
  addonId: null,
46406
48553
  access: "create"
46407
48554
  },
48555
+ "pipelineOrchestrator.planAutoTune": {
48556
+ capName: "pipeline-orchestrator",
48557
+ capScope: "system",
48558
+ addonId: null,
48559
+ access: "view"
48560
+ },
46408
48561
  "pipelineOrchestrator.rebalance": {
46409
48562
  capName: "pipeline-orchestrator",
46410
48563
  capScope: "system",
@@ -46447,12 +48600,6 @@ Object.freeze({
46447
48600
  addonId: null,
46448
48601
  access: "create"
46449
48602
  },
46450
- "pipelineOrchestrator.saveTemplate": {
46451
- capName: "pipeline-orchestrator",
46452
- capScope: "system",
46453
- addonId: null,
46454
- access: "create"
46455
- },
46456
48603
  "pipelineOrchestrator.setAgentCapabilities": {
46457
48604
  capName: "pipeline-orchestrator",
46458
48605
  capScope: "system",
@@ -46465,12 +48612,6 @@ Object.freeze({
46465
48612
  addonId: null,
46466
48613
  access: "create"
46467
48614
  },
46468
- "pipelineOrchestrator.setAgentDetectWeight": {
46469
- capName: "pipeline-orchestrator",
46470
- capScope: "system",
46471
- addonId: null,
46472
- access: "create"
46473
- },
46474
48615
  "pipelineOrchestrator.setAgentInferenceDevices": {
46475
48616
  capName: "pipeline-orchestrator",
46476
48617
  capScope: "system",
@@ -46507,6 +48648,12 @@ Object.freeze({
46507
48648
  addonId: null,
46508
48649
  access: "create"
46509
48650
  },
48651
+ "pipelineOrchestrator.setCameraStepSettings": {
48652
+ capName: "pipeline-orchestrator",
48653
+ capScope: "system",
48654
+ addonId: null,
48655
+ access: "create"
48656
+ },
46510
48657
  "pipelineOrchestrator.setCameraStepToggle": {
46511
48658
  capName: "pipeline-orchestrator",
46512
48659
  capScope: "system",
@@ -46525,12 +48672,36 @@ Object.freeze({
46525
48672
  addonId: null,
46526
48673
  access: "create"
46527
48674
  },
48675
+ "pipelineOrchestrator.setLoadBalancingShares": {
48676
+ capName: "pipeline-orchestrator",
48677
+ capScope: "system",
48678
+ addonId: null,
48679
+ access: "create"
48680
+ },
46528
48681
  "pipelineOrchestrator.setPipelineDevicePin": {
46529
48682
  capName: "pipeline-orchestrator",
46530
48683
  capScope: "system",
46531
48684
  addonId: null,
46532
48685
  access: "create"
46533
48686
  },
48687
+ "pipelineOrchestrator.setShareSource": {
48688
+ capName: "pipeline-orchestrator",
48689
+ capScope: "system",
48690
+ addonId: null,
48691
+ access: "create"
48692
+ },
48693
+ "pipelineOrchestrator.startNodeBenchmark": {
48694
+ capName: "pipeline-orchestrator",
48695
+ capScope: "system",
48696
+ addonId: null,
48697
+ access: "create"
48698
+ },
48699
+ "pipelineOrchestrator.suggestShares": {
48700
+ capName: "pipeline-orchestrator",
48701
+ capScope: "system",
48702
+ addonId: null,
48703
+ access: "view"
48704
+ },
46534
48705
  "pipelineOrchestrator.unassignAudio": {
46535
48706
  capName: "pipeline-orchestrator",
46536
48707
  capScope: "system",
@@ -46543,8 +48714,8 @@ Object.freeze({
46543
48714
  addonId: null,
46544
48715
  access: "create"
46545
48716
  },
46546
- "pipelineOrchestrator.updateTemplate": {
46547
- capName: "pipeline-orchestrator",
48717
+ "pipelineRunner.abortNodeBench": {
48718
+ capName: "pipeline-runner",
46548
48719
  capScope: "system",
46549
48720
  addonId: null,
46550
48721
  access: "create"
@@ -46597,6 +48768,12 @@ Object.freeze({
46597
48768
  addonId: null,
46598
48769
  access: "view"
46599
48770
  },
48771
+ "pipelineRunner.getNodeBenchStatus": {
48772
+ capName: "pipeline-runner",
48773
+ capScope: "system",
48774
+ addonId: null,
48775
+ access: "view"
48776
+ },
46600
48777
  "pipelineRunner.getParkedTrackFrame": {
46601
48778
  capName: "pipeline-runner",
46602
48779
  capScope: "system",
@@ -46639,6 +48816,12 @@ Object.freeze({
46639
48816
  addonId: null,
46640
48817
  access: "create"
46641
48818
  },
48819
+ "pipelineRunner.startNodeBench": {
48820
+ capName: "pipeline-runner",
48821
+ capScope: "system",
48822
+ addonId: null,
48823
+ access: "create"
48824
+ },
46642
48825
  "plateGallery.assignPlate": {
46643
48826
  capName: "plate-gallery",
46644
48827
  capScope: "system",
@@ -47983,12 +50166,6 @@ Object.freeze({
47983
50166
  addonId: null,
47984
50167
  access: "view"
47985
50168
  },
47986
- "streamBroker.pullFrameHandles": {
47987
- capName: "stream-broker",
47988
- capScope: "system",
47989
- addonId: null,
47990
- access: "view"
47991
- },
47992
50169
  "streamBroker.regenerateRtspToken": {
47993
50170
  capName: "stream-broker",
47994
50171
  capScope: "system",
@@ -48055,12 +50232,6 @@ Object.freeze({
48055
50232
  addonId: null,
48056
50233
  access: "create"
48057
50234
  },
48058
- "streamBroker.subscribeFrames": {
48059
- capName: "stream-broker",
48060
- capScope: "system",
48061
- addonId: null,
48062
- access: "create"
48063
- },
48064
50235
  "streamBroker.unassignProfile": {
48065
50236
  capName: "stream-broker",
48066
50237
  capScope: "system",
@@ -48073,12 +50244,6 @@ Object.freeze({
48073
50244
  addonId: null,
48074
50245
  access: "create"
48075
50246
  },
48076
- "streamBroker.unsubscribeFrames": {
48077
- capName: "stream-broker",
48078
- capScope: "system",
48079
- addonId: null,
48080
- access: "create"
48081
- },
48082
50247
  "streamCatalog.getCatalog": {
48083
50248
  capName: "stream-catalog",
48084
50249
  capScope: "device",
@@ -48373,18 +50538,36 @@ Object.freeze({
48373
50538
  addonId: null,
48374
50539
  access: "delete"
48375
50540
  },
50541
+ "userManagement.findUserByExternalIdentity": {
50542
+ capName: "user-management",
50543
+ capScope: "system",
50544
+ addonId: null,
50545
+ access: "view"
50546
+ },
48376
50547
  "userManagement.getTotpStatus": {
48377
50548
  capName: "user-management",
48378
50549
  capScope: "system",
48379
50550
  addonId: null,
48380
50551
  access: "view"
48381
50552
  },
50553
+ "userManagement.linkExternalIdentity": {
50554
+ capName: "user-management",
50555
+ capScope: "system",
50556
+ addonId: null,
50557
+ access: "create"
50558
+ },
48382
50559
  "userManagement.listApiKeys": {
48383
50560
  capName: "user-management",
48384
50561
  capScope: "system",
48385
50562
  addonId: null,
48386
50563
  access: "view"
48387
50564
  },
50565
+ "userManagement.listExternalIdentities": {
50566
+ capName: "user-management",
50567
+ capScope: "system",
50568
+ addonId: null,
50569
+ access: "view"
50570
+ },
48388
50571
  "userManagement.listOauthSessions": {
48389
50572
  capName: "user-management",
48390
50573
  capScope: "system",
@@ -48463,6 +50646,12 @@ Object.freeze({
48463
50646
  addonId: null,
48464
50647
  access: "create"
48465
50648
  },
50649
+ "userManagement.unlinkExternalIdentity": {
50650
+ capName: "user-management",
50651
+ capScope: "system",
50652
+ addonId: null,
50653
+ access: "delete"
50654
+ },
48466
50655
  "userManagement.updateUser": {
48467
50656
  capName: "user-management",
48468
50657
  capScope: "system",
@@ -50592,11 +52781,6 @@ Object.freeze({
50592
52781
  form: "single",
50593
52782
  optional: false
50594
52783
  }],
50595
- "decoder.createSession": [{
50596
- name: "deviceId",
50597
- form: "single",
50598
- optional: true
50599
- }],
50600
52784
  "detectionPipeline.applyDeviceSettingsPatch": [{
50601
52785
  name: "deviceId",
50602
52786
  form: "single",
@@ -51567,6 +53751,11 @@ Object.freeze({
51567
53751
  form: "single",
51568
53752
  optional: false
51569
53753
  }],
53754
+ "pipelineAnalytics.addRetrainFrameFromRecording": [{
53755
+ name: "deviceId",
53756
+ form: "single",
53757
+ optional: false
53758
+ }],
51570
53759
  "pipelineAnalytics.applyDeviceSettingsPatch": [{
51571
53760
  name: "deviceId",
51572
53761
  form: "single",
@@ -51757,6 +53946,11 @@ Object.freeze({
51757
53946
  form: "single",
51758
53947
  optional: false
51759
53948
  }],
53949
+ "pipelineAnalytics.proposeRetrainAnnotationsWithLlm": [{
53950
+ name: "deviceId",
53951
+ form: "single",
53952
+ optional: false
53953
+ }],
51760
53954
  "pipelineAnalytics.pruneEventsBefore": [{
51761
53955
  name: "deviceId",
51762
53956
  form: "single",
@@ -51807,6 +54001,11 @@ Object.freeze({
51807
54001
  form: "single",
51808
54002
  optional: false
51809
54003
  }],
54004
+ "pipelineAnalytics.setRetrainFrameComplete": [{
54005
+ name: "deviceId",
54006
+ form: "single",
54007
+ optional: false
54008
+ }],
51810
54009
  "pipelineAnalytics.setTrackFlags": [{
51811
54010
  name: "deviceId",
51812
54011
  form: "single",
@@ -51827,6 +54026,11 @@ Object.freeze({
51827
54026
  form: "single",
51828
54027
  optional: false
51829
54028
  }],
54029
+ "pipelineExecutor.clearModelBoundDeviceOverrides": [{
54030
+ name: "deviceIds",
54031
+ form: "array",
54032
+ optional: true
54033
+ }],
51830
54034
  "pipelineExecutor.runPipeline": [{
51831
54035
  name: "deviceId",
51832
54036
  form: "single",
@@ -51932,6 +54136,11 @@ Object.freeze({
51932
54136
  form: "single",
51933
54137
  optional: false
51934
54138
  }],
54139
+ "pipelineOrchestrator.setCameraStepSettings": [{
54140
+ name: "deviceId",
54141
+ form: "single",
54142
+ optional: false
54143
+ }],
51935
54144
  "pipelineOrchestrator.setCameraStepToggle": [{
51936
54145
  name: "deviceId",
51937
54146
  form: "single",