@camstack/addon-provider-amcrest 0.2.131 → 0.2.133

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (3) hide show
  1. package/dist/addon.js +3000 -566
  2. package/dist/addon.mjs +3000 -566
  3. package/package.json +1 -1
package/dist/addon.mjs CHANGED
@@ -13,7 +13,7 @@ import { networkInterfaces } from "node:os";
13
13
  var __commonJSMin = (cb, mod) => () => (mod || (cb((mod = { exports: {} }).exports, mod), cb = null), mod.exports);
14
14
  var __require = /* @__PURE__ */ createRequire(import.meta.url);
15
15
  //#endregion
16
- //#region ../types/dist/event-category-BGmz_oxW.mjs
16
+ //#region ../types/dist/event-category-DaIZi00R.mjs
17
17
  var EventCategory = /* @__PURE__ */ function(EventCategory) {
18
18
  EventCategory["SystemBoot"] = "system.boot";
19
19
  EventCategory["SystemAddonsReady"] = "system.addons-ready";
@@ -92,6 +92,13 @@ var EventCategory = /* @__PURE__ */ function(EventCategory) {
92
92
  */
93
93
  EventCategory["AddonLoadFailed"] = "addon.load-failed";
94
94
  /**
95
+ * A keychain value was stored or removed (D787). Carries the ref, its
96
+ * owner and the new version — NEVER the value. A process holding the ref
97
+ * drops its cached copy and the owning `BaseAddon` re-resolves its config.
98
+ * Telemetry (D8): a process that misses it still revalidates by version.
99
+ */
100
+ EventCategory["KeychainChanged"] = "keychain.changed";
101
+ /**
95
102
  * Addon recovered from a previous failure. Emitted when an addon
96
103
  * transitions from `failed` back to `healthy` (typically via the
97
104
  * monitor's auto-retry loop, or after manual `addons.retryLoad`).
@@ -514,15 +521,6 @@ var EventCategory = /* @__PURE__ */ function(EventCategory) {
514
521
  EventCategory["AgentWsDisconnected"] = "agent.ws.disconnected";
515
522
  EventCategory["AgentBackupActivated"] = "agent.backup.activated";
516
523
  EventCategory["OrchestrationSettingsUpdated"] = "orchestration.settings-updated";
517
- /**
518
- * Per-agent hwaccel preference changed (user override set, cleared, or
519
- * re-probed). Observability event — decoders pull the current pref at
520
- * `createSession`, so running sessions keep their current backend until
521
- * they rotate naturally (camera add/remove, stream restart). Future
522
- * work can wire a listener in stream-broker that force-rotates live
523
- * sessions; for now this event powers logs + admin-UI toast feedback.
524
- */
525
- EventCategory["PipelineAgentHwaccelChanged"] = "pipeline.agent-hwaccel-changed";
526
524
  EventCategory["MotionAnalysis"] = "detection.motion-analysis";
527
525
  /** All raw motion zones from CCL before minArea filter — for UI debug overlay. */
528
526
  EventCategory["MotionZonesRaw"] = "detection.motion-zones-raw";
@@ -5393,7 +5391,7 @@ var ZodIssueCode = {
5393
5391
  var ZodFirstPartyTypeKind;
5394
5392
  ZodFirstPartyTypeKind || (ZodFirstPartyTypeKind = {});
5395
5393
  //#endregion
5396
- //#region ../types/dist/sleep-DXKLNFvA.mjs
5394
+ //#region ../types/dist/sleep-Cr5YOk3m.mjs
5397
5395
  /**
5398
5396
  * The audio chunk plane's byte format, and the ONE expansion from a coded
5399
5397
  * window to float samples (D455).
@@ -5472,6 +5470,97 @@ function buildAlawTable() {
5472
5470
  }
5473
5471
  buildUlawTable();
5474
5472
  buildAlawTable();
5473
+ /** Is this field's stored value a credential? */
5474
+ function isSecretConfigField(field) {
5475
+ if (field.type === "password") return true;
5476
+ return "secret" in field && field.secret === true;
5477
+ }
5478
+ /**
5479
+ * Is this field's value stored in the KEYCHAIN (D787)? Every secret field is,
5480
+ * by its TYPE, unless it opts out with `storage: 'inline'` — never by its name.
5481
+ */
5482
+ function isKeychainStoredField(field) {
5483
+ if (!isSecretConfigField(field)) return false;
5484
+ if (field.type === "textarea" && field.isJson === true) return false;
5485
+ return !("storage" in field && field.storage === "inline");
5486
+ }
5487
+ /**
5488
+ * What a settings blob holds where a secret used to be.
5489
+ *
5490
+ * A keychain-stored field never holds its value. It holds a self-describing
5491
+ * MARKER, `{"$secret":"secret://…","v":1}` — an object, never a string, so no
5492
+ * code can mistake it for a credential and no form can send it to a camera as
5493
+ * a password. The empty state is `null` / absent, never `''`.
5494
+ *
5495
+ * The same shapes travel to and from the admin UI:
5496
+ *
5497
+ * - read: `hydrateSchema` hands a secret field a {@link SecretFieldView}
5498
+ * (`{ $secret, v, set: true }`) or `null` — the browser learns whether a
5499
+ * value is set, never the value.
5500
+ * - write: an untouched field submits the view back unchanged (KEEP); a typed
5501
+ * value is a plain non-empty string (CHANGE); the Clear button submits
5502
+ * {@link SECRET_CLEAR} (CLEAR). `''`, `null` and the legacy redaction tokens
5503
+ * are KEEP — an empty string is what a defaults-fallback pushes back, and
5504
+ * treating it as "clear" is how a save destroyed a stored credential before.
5505
+ *
5506
+ * Pure and browser-safe.
5507
+ */
5508
+ var SECRET_CLEAR = { $secretClear: true };
5509
+ /** The `'***'` token D634 redaction writes for non-admins. */
5510
+ var LEGACY_DEVICE_REDACTION = "***";
5511
+ function isRecord$1$1(value) {
5512
+ return typeof value === "object" && value !== null && !Array.isArray(value);
5513
+ }
5514
+ function makeSecretMarker(ref) {
5515
+ return {
5516
+ $secret: ref,
5517
+ v: 1
5518
+ };
5519
+ }
5520
+ /** A stored marker: an object whose `$secret` is a non-empty string. */
5521
+ function isSecretMarker(value) {
5522
+ if (!isRecord$1$1(value)) return false;
5523
+ const ref = value["$secret"];
5524
+ return typeof ref === "string" && ref.length > 0;
5525
+ }
5526
+ function isSecretClear(value) {
5527
+ return isRecord$1$1(value) && value["$secretClear"] === true;
5528
+ }
5529
+ /**
5530
+ * The UI view of a stored secret field value: a marker becomes "set", inline
5531
+ * plaintext becomes "set (inline)", nothing becomes `null`. A value never
5532
+ * survives this function.
5533
+ */
5534
+ function toSecretFieldView(stored) {
5535
+ if (isSecretMarker(stored)) return {
5536
+ $secret: stored.$secret,
5537
+ v: 1,
5538
+ set: true
5539
+ };
5540
+ if (typeof stored === "string" && stored.length > 0) return {
5541
+ $secret: null,
5542
+ v: 1,
5543
+ set: true,
5544
+ inline: true
5545
+ };
5546
+ return null;
5547
+ }
5548
+ /**
5549
+ * Classify an incoming value for a secret path. Only a non-empty string that is
5550
+ * not a redaction token sets a value; only {@link SECRET_CLEAR} clears.
5551
+ * Everything else — a marker (ours or anyone's), a UI view, `''`, `null`,
5552
+ * `undefined`, a redaction token, a non-string — keeps what is stored.
5553
+ */
5554
+ function classifySecretWrite(incoming) {
5555
+ if (isSecretClear(incoming)) return { kind: "clear" };
5556
+ if (typeof incoming !== "string") return { kind: "keep" };
5557
+ if (incoming.length === 0) return { kind: "keep" };
5558
+ if (incoming === "__camstack_redacted__" || incoming === LEGACY_DEVICE_REDACTION) return { kind: "keep" };
5559
+ return {
5560
+ kind: "set",
5561
+ value: incoming
5562
+ };
5563
+ }
5475
5564
  Object.fromEntries([
5476
5565
  {
5477
5566
  id: "overview",
@@ -5643,33 +5732,19 @@ Object.fromEntries([
5643
5732
  function isValuelessField(field) {
5644
5733
  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";
5645
5734
  }
5646
- /**
5647
- * Merge a `ConfigUISchema` with a raw `values` record into a
5648
- * `ConfigUISchemaWithValues`. Used by every `get*Settings` backend endpoint
5649
- * before returning to the admin UI. Groups are walked recursively.
5650
- *
5651
- * For each leaf field:
5652
- * - structural fields (`separator`, `info`, `button`) pass through unchanged
5653
- * - other fields get `value = values[key] ?? field.default ?? null`
5654
- *
5655
- * Unknown keys in `values` (keys not declared in the schema) are silently
5656
- * ignored — they don't contribute to the output. Missing keys fall back to
5657
- * the schema default or `null`. This mirrors the old backend behaviour where
5658
- * `FormBuilder` rendered `values[key] ?? field.default`.
5659
- */
5660
- function hydrateSchema(schema, values) {
5735
+ function hydrateSchema(schema, values, options = {}) {
5661
5736
  return {
5662
5737
  ...schema.tabs ? { tabs: [...schema.tabs] } : {},
5663
5738
  sections: schema.sections.map((section) => ({
5664
5739
  ...section,
5665
- fields: section.fields.map((field) => hydrateField(field, values))
5740
+ fields: section.fields.map((field) => hydrateField(field, values, options))
5666
5741
  }))
5667
5742
  };
5668
5743
  }
5669
- function hydrateField(field, values) {
5744
+ function hydrateField(field, values, options) {
5670
5745
  if (isValuelessField(field)) return field;
5671
5746
  if (field.type === "group") {
5672
- const hydratedChildren = field.fields.map((child) => hydrateField(child, values));
5747
+ const hydratedChildren = field.fields.map((child) => hydrateField(child, values, options));
5673
5748
  return {
5674
5749
  ...field,
5675
5750
  fields: hydratedChildren
@@ -5678,7 +5753,7 @@ function hydrateField(field, values) {
5678
5753
  if (field.type === "sub-tabs") {
5679
5754
  const hydratedTabs = field.tabs.map((tab) => ({
5680
5755
  ...tab,
5681
- fields: tab.fields.map((child) => hydrateField(child, values))
5756
+ fields: tab.fields.map((child) => hydrateField(child, values, options))
5682
5757
  }));
5683
5758
  return {
5684
5759
  ...field,
@@ -5688,6 +5763,33 @@ function hydrateField(field, values) {
5688
5763
  const key = field.key;
5689
5764
  const storedValue = Object.prototype.hasOwnProperty.call(values, key) ? values[key] : void 0;
5690
5765
  const defaultValue = field.default;
5766
+ const asView = (v) => isSecretMarker(v) || options.inlineSecretsAsViews === true && v !== void 0;
5767
+ if (isKeychainStoredField(field) && asView(storedValue)) return {
5768
+ ...field,
5769
+ value: toSecretFieldView(storedValue)
5770
+ };
5771
+ if (isKeychainStoredField(field) && options.inlineSecretsAsViews === true) return {
5772
+ ...field,
5773
+ value: null
5774
+ };
5775
+ if (field.type === "editable-array" && Array.isArray(storedValue)) {
5776
+ const secretItemKeys = field.itemFields.filter((item) => "key" in item && isKeychainStoredField(item)).map((item) => "key" in item ? item.key : "");
5777
+ if (secretItemKeys.length > 0) {
5778
+ const rows = storedValue.map((row) => {
5779
+ if (row === null || typeof row !== "object" || Array.isArray(row)) return row;
5780
+ const out = { ...row };
5781
+ for (const k of secretItemKeys) {
5782
+ const v = Reflect.get(row, k);
5783
+ if (asView(v)) out[k] = toSecretFieldView(v);
5784
+ }
5785
+ return out;
5786
+ });
5787
+ return {
5788
+ ...field,
5789
+ value: rows
5790
+ };
5791
+ }
5792
+ }
5691
5793
  if (field.multiple) {
5692
5794
  const stored = Array.isArray(storedValue) ? storedValue : storedValue !== void 0 && storedValue !== null ? [storedValue] : [];
5693
5795
  const itemFallback = field.multiple.itemDefault !== void 0 ? field.multiple.itemDefault : defaultValue !== void 0 ? defaultValue : typeOf(field) === "string" ? "" : null;
@@ -5930,6 +6032,431 @@ function projectStore(store, perNodeKeys, nodeId) {
5930
6032
  }
5931
6033
  return out;
5932
6034
  }
6035
+ var GLOBAL_SCOPE = { kind: "global" };
6036
+ /** The scope every addon-wide (not per-node, not per-device) setting lives in. */
6037
+ function globalSecretScope() {
6038
+ return GLOBAL_SCOPE;
6039
+ }
6040
+ function encodeSegment(value) {
6041
+ return encodeURIComponent(value);
6042
+ }
6043
+ /**
6044
+ * The field path of a value inside an array item, addressed by the item's id:
6045
+ * `arrayItemFieldPath('providers', 'authentik', 'clientSecret')` →
6046
+ * `providers[authentik].clientSecret`.
6047
+ */
6048
+ function arrayItemFieldPath(arrayKey, itemId, fieldKey) {
6049
+ return `${arrayKey}[${encodeSegment(itemId)}].${fieldKey}`;
6050
+ }
6051
+ /** A write to a secret path could not be stored in the keychain, so it was refused. */
6052
+ var KeychainWriteRefusedError = class extends Error {
6053
+ fieldPath;
6054
+ constructor(fieldPath, cause) {
6055
+ super(`secret "${fieldPath}" was not saved: the keychain could not store it (${cause instanceof Error ? cause.message : String(cause)}). Nothing was written.`);
6056
+ this.fieldPath = fieldPath;
6057
+ this.name = "KeychainWriteRefusedError";
6058
+ }
6059
+ };
6060
+ var KEEP = { kind: "keep" };
6061
+ function isRecord$2(value) {
6062
+ return typeof value === "object" && value !== null && !Array.isArray(value);
6063
+ }
6064
+ function defaultMintId() {
6065
+ return globalThis.crypto.randomUUID();
6066
+ }
6067
+ /** Every marker ref anywhere under `value`. */
6068
+ function collectSecretMarkerRefs(value, out = []) {
6069
+ if (isSecretMarker(value)) {
6070
+ out.push(value.$secret);
6071
+ return out;
6072
+ }
6073
+ if (Array.isArray(value)) for (const item of value) collectSecretMarkerRefs(item, out);
6074
+ else if (isRecord$2(value)) for (const child of Object.values(value)) collectSecretMarkerRefs(child, out);
6075
+ return out;
6076
+ }
6077
+ async function storedValueEquals(secrets, marker, candidate) {
6078
+ const resolved = (await secrets.resolve([marker.$secret]))[marker.$secret];
6079
+ return resolved?.kind === "value" && resolved.value === candidate;
6080
+ }
6081
+ async function writeLeaf(ctx, incoming, stored, fieldPath) {
6082
+ const intent = classifySecretWrite(incoming);
6083
+ const ref = ctx.secrets.ref(ctx.scope, fieldPath);
6084
+ const storedIsOurs = isSecretMarker(stored) && stored.$secret === ref;
6085
+ if (intent.kind === "keep") return KEEP;
6086
+ if (intent.kind === "set" && !ctx.operatorWrite && typeof stored === "string" && stored === intent.value) return KEEP;
6087
+ if (intent.kind === "clear") {
6088
+ if (storedIsOurs) ctx.deletes.push(ref);
6089
+ return {
6090
+ kind: "value",
6091
+ value: null
6092
+ };
6093
+ }
6094
+ if (storedIsOurs && await storedValueEquals(ctx.secrets, stored, intent.value)) return {
6095
+ kind: "value",
6096
+ value: stored
6097
+ };
6098
+ try {
6099
+ await ctx.secrets.put(ref, intent.value);
6100
+ } catch (err) {
6101
+ throw new KeychainWriteRefusedError(fieldPath, err);
6102
+ }
6103
+ return {
6104
+ kind: "value",
6105
+ value: makeSecretMarker(ref)
6106
+ };
6107
+ }
6108
+ /** Apply a member result onto `out`: KEEP restores the stored member, or removes it. */
6109
+ function applyMember(out, key, result, storedParent) {
6110
+ if (result.kind === "value") {
6111
+ out[key] = result.value;
6112
+ return;
6113
+ }
6114
+ if (Object.prototype.hasOwnProperty.call(storedParent, key)) out[key] = storedParent[key];
6115
+ else delete out[key];
6116
+ }
6117
+ async function writeMembers(ctx, children, incoming, stored, pathOf) {
6118
+ const out = { ...incoming };
6119
+ for (const [member, node] of children) applyMember(out, member, await writeNode(ctx, node, incoming[member], stored[member], pathOf(member)), stored);
6120
+ return out;
6121
+ }
6122
+ function rowId(row, idKey) {
6123
+ const raw = row[idKey];
6124
+ if (typeof raw === "string" && raw.length > 0) return raw;
6125
+ if (typeof raw === "number" && Number.isFinite(raw)) return String(raw);
6126
+ return null;
6127
+ }
6128
+ async function writeArray(ctx, node, incoming, stored, fieldPath) {
6129
+ const storedRows = Array.isArray(stored) ? stored.filter(isRecord$2) : [];
6130
+ if (!Array.isArray(incoming)) {
6131
+ ctx.deletes.push(...collectSecretMarkerRefs(storedRows));
6132
+ return {
6133
+ kind: "value",
6134
+ value: incoming
6135
+ };
6136
+ }
6137
+ const storedById = /* @__PURE__ */ new Map();
6138
+ for (const row of storedRows) {
6139
+ const id = rowId(row, node.idKey);
6140
+ if (id !== null) storedById.set(id, row);
6141
+ }
6142
+ const kept = /* @__PURE__ */ new Set();
6143
+ const rows = [];
6144
+ for (const row of incoming) {
6145
+ if (!isRecord$2(row)) {
6146
+ rows.push(row);
6147
+ continue;
6148
+ }
6149
+ const id = rowId(row, node.idKey) ?? ctx.mintId();
6150
+ kept.add(id);
6151
+ const withId = {
6152
+ ...row,
6153
+ [node.idKey]: row[node.idKey] ?? id
6154
+ };
6155
+ if (rowId(withId, node.idKey) === null) withId[node.idKey] = id;
6156
+ const storedRow = storedById.get(id) ?? {};
6157
+ rows.push(await writeMembers(ctx, node.item, withId, storedRow, (member) => arrayItemFieldPath(fieldPath, id, member)));
6158
+ }
6159
+ for (const [id, row] of storedById) if (!kept.has(id)) ctx.deletes.push(...collectSecretMarkerRefs(row));
6160
+ return {
6161
+ kind: "value",
6162
+ value: rows
6163
+ };
6164
+ }
6165
+ async function writeNode(ctx, node, incoming, stored, fieldPath) {
6166
+ switch (node.kind) {
6167
+ case "leaf": return writeLeaf(ctx, incoming, stored, fieldPath);
6168
+ case "array": return writeArray(ctx, node, incoming, stored, fieldPath);
6169
+ case "object": {
6170
+ if (!isRecord$2(incoming)) {
6171
+ if (incoming === void 0) return KEEP;
6172
+ ctx.deletes.push(...collectSecretMarkerRefs(stored));
6173
+ return {
6174
+ kind: "value",
6175
+ value: incoming
6176
+ };
6177
+ }
6178
+ const storedObj = isRecord$2(stored) ? stored : {};
6179
+ return {
6180
+ kind: "value",
6181
+ value: await writeMembers(ctx, node.children, incoming, storedObj, (m) => `${fieldPath}.${m}`)
6182
+ };
6183
+ }
6184
+ }
6185
+ }
6186
+ /** Split a perNode-scoped key (`key@nodeId`). */
6187
+ function splitNodeKey(key) {
6188
+ const at = key.indexOf("@");
6189
+ return at <= 0 ? {
6190
+ base: key,
6191
+ nodeId: null
6192
+ } : {
6193
+ base: key.slice(0, at),
6194
+ nodeId: key.slice(at + 1)
6195
+ };
6196
+ }
6197
+ /** Rewrite a settings patch so no secret value reaches the blob. See the file doc. */
6198
+ async function transformSecretWrite(input) {
6199
+ const deletes = [];
6200
+ const base = {
6201
+ secrets: input.secrets,
6202
+ mintId: input.mintId ?? defaultMintId,
6203
+ deletes,
6204
+ operatorWrite: input.operatorWrite === true
6205
+ };
6206
+ const out = {};
6207
+ for (const [key, incoming] of Object.entries(input.patch)) {
6208
+ const { base: baseKey, nodeId } = splitNodeKey(key);
6209
+ const node = input.tree.get(baseKey);
6210
+ if (node === void 0) {
6211
+ out[key] = incoming;
6212
+ continue;
6213
+ }
6214
+ const scope = nodeId !== null && nodeId.length > 0 ? {
6215
+ kind: "node",
6216
+ nodeId
6217
+ } : input.scope ?? globalSecretScope();
6218
+ const result = await writeNode({
6219
+ ...base,
6220
+ scope
6221
+ }, node, incoming, input.stored[key], baseKey);
6222
+ if (result.kind === "value") out[key] = result.value;
6223
+ }
6224
+ return {
6225
+ patch: out,
6226
+ afterWrite: async () => {
6227
+ if (deletes.length === 0) return { orphaned: [] };
6228
+ try {
6229
+ await input.secrets.delete([...new Set(deletes)]);
6230
+ return { orphaned: [] };
6231
+ } catch {
6232
+ return { orphaned: [...new Set(deletes)] };
6233
+ }
6234
+ }
6235
+ };
6236
+ }
6237
+ /**
6238
+ * Replace every marker in `value` with its keychain value. Returns the SAME
6239
+ * reference when there is no marker (no allocation, no keychain call).
6240
+ */
6241
+ async function resolveSecretMarkers(value, secrets) {
6242
+ const refs = collectSecretMarkerRefs(value);
6243
+ if (refs.length === 0) return {
6244
+ value,
6245
+ unresolved: []
6246
+ };
6247
+ const answers = await secrets.resolve(refs);
6248
+ const unresolved = [];
6249
+ for (const ref of new Set(refs)) {
6250
+ const answer = answers[ref];
6251
+ if (answer === void 0) unresolved.push({
6252
+ ref,
6253
+ reason: "not-initialized"
6254
+ });
6255
+ else if (answer.kind === "unavailable") unresolved.push({
6256
+ ref,
6257
+ reason: answer.reason
6258
+ });
6259
+ else if (answer.kind === "missing" || answer.kind === "forbidden") unresolved.push({
6260
+ ref,
6261
+ reason: answer.kind
6262
+ });
6263
+ }
6264
+ const substitute = (v) => {
6265
+ if (isSecretMarker(v)) {
6266
+ const answer = answers[v.$secret];
6267
+ return answer?.kind === "value" ? {
6268
+ keep: true,
6269
+ value: answer.value
6270
+ } : {
6271
+ keep: false,
6272
+ value: void 0
6273
+ };
6274
+ }
6275
+ if (Array.isArray(v)) {
6276
+ const items = [];
6277
+ for (const item of v) {
6278
+ const s = substitute(item);
6279
+ if (s.keep) items.push(s.value);
6280
+ }
6281
+ return {
6282
+ keep: true,
6283
+ value: items
6284
+ };
6285
+ }
6286
+ if (isRecord$2(v)) {
6287
+ const out = {};
6288
+ for (const [k, child] of Object.entries(v)) {
6289
+ const s = substitute(child);
6290
+ if (s.keep) out[k] = s.value;
6291
+ }
6292
+ return {
6293
+ keep: true,
6294
+ value: out
6295
+ };
6296
+ }
6297
+ return {
6298
+ keep: true,
6299
+ value: v
6300
+ };
6301
+ };
6302
+ return {
6303
+ value: substitute(value).value,
6304
+ unresolved
6305
+ };
6306
+ }
6307
+ function touchesTree(tree, patch) {
6308
+ if (tree.size === 0) return false;
6309
+ for (const key of Object.keys(patch)) {
6310
+ const at = key.indexOf("@");
6311
+ if (tree.has(at > 0 ? key.slice(0, at) : key)) return true;
6312
+ }
6313
+ return false;
6314
+ }
6315
+ /** The blob as stored now; a failed read REFUSES the write instead of guessing. */
6316
+ async function readStoredAddonBlob(raw) {
6317
+ const threeWay = raw.readAddonStoreResult;
6318
+ if (threeWay === void 0) return raw.readAddonStore();
6319
+ const result = await threeWay.call(raw);
6320
+ if (result.kind === "failed") throw new Error(`settings write refused: the stored blob could not be read (${result.error})`);
6321
+ return result.kind === "missing" ? {} : result.value;
6322
+ }
6323
+ function createSecretAwareSettings(raw, opts) {
6324
+ const chains = /* @__PURE__ */ new Map();
6325
+ const serialize = (key, fn) => {
6326
+ const next = (chains.get(key) ?? Promise.resolve()).then(fn, fn);
6327
+ const tail = next.catch(() => void 0);
6328
+ chains.set(key, tail);
6329
+ tail.then(() => {
6330
+ if (chains.get(key) === tail) chains.delete(key);
6331
+ });
6332
+ return next;
6333
+ };
6334
+ const write = async (chainKey, tree, scope, patch, readStored, rawWrite) => {
6335
+ if (!touchesTree(tree, patch)) return rawWrite(patch);
6336
+ return serialize(chainKey, async () => {
6337
+ const stored = await readStored();
6338
+ const result = await transformSecretWrite({
6339
+ tree,
6340
+ secrets: opts.secrets,
6341
+ patch,
6342
+ stored,
6343
+ ...scope !== void 0 ? { scope } : {},
6344
+ operatorWrite: opts.isOperatorWrite?.() === true
6345
+ });
6346
+ if (Object.keys(result.patch).length > 0) await rawWrite(result.patch);
6347
+ const { orphaned } = await result.afterWrite();
6348
+ if (orphaned.length > 0) opts.onOrphaned(orphaned);
6349
+ });
6350
+ };
6351
+ const wrapped = {
6352
+ writeAddonStore: (patch) => write("addon", opts.addonTree(), void 0, patch, () => readStoredAddonBlob(raw), (p) => raw.writeAddonStore(p)),
6353
+ writeDeviceStore: (deviceId, patch) => write(`device:${deviceId}`, opts.deviceTree(), {
6354
+ kind: "device",
6355
+ deviceId
6356
+ }, patch, () => raw.readDeviceStore(deviceId), (p) => raw.writeDeviceStore(deviceId, p))
6357
+ };
6358
+ return new Proxy(raw, { get(target, prop, receiver) {
6359
+ if (prop === "writeAddonStore") return wrapped.writeAddonStore;
6360
+ if (prop === "writeDeviceStore") return wrapped.writeDeviceStore;
6361
+ const value = Reflect.get(target, prop, receiver);
6362
+ return typeof value === "function" ? value.bind(target) : value;
6363
+ } });
6364
+ }
6365
+ /** The context the addon sees: identical, except that its settings writes are secret-aware. */
6366
+ function withSecretAwareSettings(context, opts) {
6367
+ const raw = context.settings;
6368
+ if (raw === void 0) return context;
6369
+ const settings = createSecretAwareSettings(raw, opts);
6370
+ return new Proxy(context, { get(target, prop, receiver) {
6371
+ if (prop === "settings") return settings;
6372
+ return Reflect.get(target, prop, receiver);
6373
+ } });
6374
+ }
6375
+ var LEAF = { kind: "leaf" };
6376
+ var DEFAULT_ITEM_ID_KEY = "id";
6377
+ function collectFields(fields, out) {
6378
+ for (const field of fields) {
6379
+ if (field.type === "group") {
6380
+ collectFields(field.fields, out);
6381
+ continue;
6382
+ }
6383
+ if (field.type === "sub-tabs") {
6384
+ for (const tab of field.tabs) collectFields(tab.fields, out);
6385
+ continue;
6386
+ }
6387
+ if (field.type === "editable-array") {
6388
+ const item = /* @__PURE__ */ new Map();
6389
+ for (const itemField of field.itemFields) if ("key" in itemField && isKeychainStoredField(itemField)) item.set(itemField.key, LEAF);
6390
+ if (item.size > 0) out.set(field.key, {
6391
+ kind: "array",
6392
+ idKey: field.itemIdKey ?? DEFAULT_ITEM_ID_KEY,
6393
+ item
6394
+ });
6395
+ continue;
6396
+ }
6397
+ if (!("key" in field) || typeof field.key !== "string") continue;
6398
+ if (isKeychainStoredField(field)) out.set(field.key, LEAF);
6399
+ }
6400
+ }
6401
+ /** The secret tree a settings schema declares. */
6402
+ function secretTreeFromSchema(schema) {
6403
+ const out = /* @__PURE__ */ new Map();
6404
+ if (schema === null) return out;
6405
+ for (const section of schema.sections) collectFields(section.fields, out);
6406
+ return out;
6407
+ }
6408
+ /** Parse `a.b[id].c` into segments; throws on a malformed path (a declaration bug). */
6409
+ function parseSecretStatePath(path) {
6410
+ const segments = [];
6411
+ for (const raw of path.split(".")) {
6412
+ const m = /^([^[\]]+)(?:\[([^[\]]+)\])?$/.exec(raw);
6413
+ if (m === null || m[1] === void 0) throw new Error(`secretStatePaths: malformed path "${path}"`);
6414
+ segments.push(m[2] !== void 0 ? {
6415
+ key: m[1],
6416
+ idKey: m[2]
6417
+ } : { key: m[1] });
6418
+ }
6419
+ if (segments.length === 0) throw new Error(`secretStatePaths: empty path`);
6420
+ if (segments[segments.length - 1]?.idKey !== void 0) throw new Error(`secretStatePaths: "${path}" ends on an array — name the member that is secret`);
6421
+ return segments;
6422
+ }
6423
+ function insert(into, segments) {
6424
+ const [head, ...rest] = segments;
6425
+ if (head === void 0) return;
6426
+ if (rest.length === 0) {
6427
+ into.set(head.key, LEAF);
6428
+ return;
6429
+ }
6430
+ const existing = into.get(head.key);
6431
+ if (head.idKey !== void 0) {
6432
+ const item = new Map(existing?.kind === "array" ? existing.item : []);
6433
+ insert(item, rest);
6434
+ into.set(head.key, {
6435
+ kind: "array",
6436
+ idKey: head.idKey,
6437
+ item
6438
+ });
6439
+ return;
6440
+ }
6441
+ const children = new Map(existing?.kind === "object" ? existing.children : []);
6442
+ insert(children, rest);
6443
+ into.set(head.key, {
6444
+ kind: "object",
6445
+ children
6446
+ });
6447
+ }
6448
+ /** Add hidden-state paths (`secretStatePaths`) to a schema-derived tree. */
6449
+ function mergeSecretStatePaths(tree, paths) {
6450
+ if (paths.length === 0) return tree;
6451
+ const out = new Map(tree);
6452
+ for (const path of paths) insert(out, parseSecretStatePath(path));
6453
+ return out;
6454
+ }
6455
+ /** First retry of a secret the keychain could not serve; doubles to {@link SECRET_RETRY_MAX_MS}. */
6456
+ var SECRET_RETRY_FIRST_MS = 5e3;
6457
+ var SECRET_RETRY_MAX_MS = 5 * 6e4;
6458
+ /** Coalesces a burst of `keychain.changed` events into one re-resolve. */
6459
+ var SECRET_CHANGE_DEBOUNCE_MS = 250;
5933
6460
  /**
5934
6461
  * Base class for CamStack addons. Eliminates settings boilerplate:
5935
6462
  *
@@ -5999,6 +6526,25 @@ var BaseAddon = class {
5999
6526
  settingsStoreReady = false;
6000
6527
  /** Default config values. Provided via constructor. */
6001
6528
  defaults;
6529
+ /**
6530
+ * Hidden-state paths that hold secrets (D787) — values the addon writes
6531
+ * itself (`updateGlobalSettings`, `state()`) that no form field declares.
6532
+ * Stored in the keychain exactly like a `password` field. Syntax:
6533
+ * `'snapshotSigningKey'`, `'identity.pincode'`, `'tokens[userId].accessToken'`
6534
+ * (`key[<id field>]` addresses array items by id, never by index).
6535
+ */
6536
+ secretStatePaths = [];
6537
+ _addonSecretTree = null;
6538
+ _deviceSecretTree = null;
6539
+ /** Refs the last resolved config pointed at — a change to one re-resolves. */
6540
+ _configSecretRefs = /* @__PURE__ */ new Set();
6541
+ _unresolvedSecrets = [];
6542
+ _secretRetryTimer = null;
6543
+ _secretRetryDelayMs = SECRET_RETRY_FIRST_MS;
6544
+ _secretChangeTimer = null;
6545
+ _secretChangeUnsub = null;
6546
+ /** >0 while an OPERATOR's settings write is being applied. */
6547
+ _operatorWriteDepth = 0;
6002
6548
  constructor(defaults) {
6003
6549
  this.defaults = defaults;
6004
6550
  this._config = { ...defaults };
@@ -6034,8 +6580,18 @@ var BaseAddon = class {
6034
6580
  return this._config;
6035
6581
  }
6036
6582
  async initialize(context) {
6037
- this._ctx = context;
6583
+ const secrets = context.secrets;
6584
+ this._ctx = secrets !== void 0 ? withSecretAwareSettings(context, {
6585
+ secrets,
6586
+ addonTree: () => this.addonSecretTree(),
6587
+ deviceTree: () => this.deviceSecretTree(),
6588
+ onOrphaned: (refs) => context.logger.warn("keychain refs dropped by a settings write could not be deleted", { meta: { refs: [...refs] } }),
6589
+ isOperatorWrite: () => this._operatorWriteDepth > 0
6590
+ }) : context;
6038
6591
  await this.resolveConfig();
6592
+ if (secrets !== void 0) this._secretChangeUnsub = secrets.onChange((ref) => {
6593
+ if (this._configSecretRefs.has(ref)) this.scheduleSecretReresolve(SECRET_CHANGE_DEBOUNCE_MS);
6594
+ });
6039
6595
  const result = await this.onInitialize();
6040
6596
  this.emitLifecycle(EventCategory.AddonStarted);
6041
6597
  const normalized = normalizeAddonInitResult(result);
@@ -6068,6 +6624,12 @@ var BaseAddon = class {
6068
6624
  */
6069
6625
  async onHubReachable() {}
6070
6626
  async shutdown() {
6627
+ this._secretChangeUnsub?.();
6628
+ this._secretChangeUnsub = null;
6629
+ if (this._secretRetryTimer !== null) clearTimeout(this._secretRetryTimer);
6630
+ if (this._secretChangeTimer !== null) clearTimeout(this._secretChangeTimer);
6631
+ this._secretRetryTimer = null;
6632
+ this._secretChangeTimer = null;
6071
6633
  this.emitLifecycle(EventCategory.AddonStopped);
6072
6634
  if (this.autoEmitReadiness) this.emitReadinessForProviders("down");
6073
6635
  await this.onShutdown();
@@ -6146,7 +6708,7 @@ var BaseAddon = class {
6146
6708
  return hydrateSchema(schema, overlay ? {
6147
6709
  ...projected,
6148
6710
  ...overlay
6149
- } : projected);
6711
+ } : projected, { inlineSecretsAsViews: true });
6150
6712
  }
6151
6713
  /**
6152
6714
  * The integration-level view of this addon's settings: exactly the sections
@@ -6195,7 +6757,7 @@ var BaseAddon = class {
6195
6757
  return hydrateSchema({
6196
6758
  ...schema,
6197
6759
  sections
6198
- }, projected);
6760
+ }, projected, { inlineSecretsAsViews: true });
6199
6761
  }
6200
6762
  /**
6201
6763
  * The raw addon store PROJECTED onto the target node's bare per-node keys:
@@ -6249,18 +6811,50 @@ var BaseAddon = class {
6249
6811
  value: result.value[key]
6250
6812
  };
6251
6813
  }
6814
+ /**
6815
+ * The OPERATOR's write — a settings form or an admin API call, dispatched by
6816
+ * the kernel. Identical to {@link updateGlobalSettings}, except that a secret
6817
+ * the operator sends is stored as sent even when it equals a pre-keychain
6818
+ * inline value: the operator re-entering a password is a change, an addon
6819
+ * writing back what it read is not (D787).
6820
+ */
6821
+ async updateGlobalSettingsAsOperator(patch, nodeId) {
6822
+ this._operatorWriteDepth++;
6823
+ try {
6824
+ await this.applyGlobalPatch(patch, nodeId);
6825
+ } finally {
6826
+ this._operatorWriteDepth--;
6827
+ }
6828
+ }
6252
6829
  async updateGlobalSettings(patch, nodeId) {
6830
+ await this.applyGlobalPatch(patch, nodeId);
6831
+ }
6832
+ /**
6833
+ * REMOVE stored secrets — their keychain values and their markers (D787).
6834
+ *
6835
+ * Writing `''` to a secret field KEEPS what is stored (an empty string is
6836
+ * what a defaults fallback writes back, and it must never destroy a
6837
+ * credential), so code that means "forget this token" says so here. Without
6838
+ * a keychain (an older kernel) it writes `''`, as such code always did.
6839
+ */
6840
+ async clearSecrets(keys, nodeId) {
6841
+ const tree = this.addonSecretTree();
6842
+ const keychain = this._ctx?.secrets !== void 0;
6843
+ const patch = {};
6844
+ for (const key of keys) patch[key] = keychain && tree.has(key) ? SECRET_CLEAR : "";
6845
+ await this.applyGlobalPatch(patch, nodeId);
6846
+ }
6847
+ async applyGlobalPatch(barePatch, nodeId) {
6253
6848
  const keys = this.perNodeKeys();
6254
6849
  const localNode = normalizeNodeId(this._ctx?.kernel?.localNodeId);
6255
6850
  const target = normalizeNodeId(nodeId ?? this._ctx?.kernel?.localNodeId);
6256
- const barePatch = patch;
6257
6851
  const scoped = keys.size > 0 ? scopePatch(barePatch, keys, target) : barePatch;
6258
6852
  await this._ctx?.settings?.writeAddonStore(scoped);
6259
6853
  if (target !== localNode) return;
6260
6854
  await this.resolveConfig();
6261
6855
  await this.onConfigChanged();
6262
6856
  this.emitLifecycle(EventCategory.AddonUpdated, { level: "global" });
6263
- this.maybeAutoRestart(patch, this.globalSettingsSchema());
6857
+ this.maybeAutoRestart(Object.keys(barePatch), this.globalSettingsSchema());
6264
6858
  }
6265
6859
  /**
6266
6860
  * The set of field keys the global settings schema declares `perNode: true`
@@ -6285,7 +6879,7 @@ var BaseAddon = class {
6285
6879
  * time to return its response before the addon is torn down and
6286
6880
  * re-initialised by `AddonRegistryService.restartAddon`.
6287
6881
  */
6288
- maybeAutoRestart(patch, schema) {
6882
+ maybeAutoRestart(patchKeys, schema) {
6289
6883
  if (!schema) return;
6290
6884
  const restartKeys = /* @__PURE__ */ new Set();
6291
6885
  for (const section of schema.sections) for (const field of section.fields) {
@@ -6293,13 +6887,13 @@ var BaseAddon = class {
6293
6887
  if (field.requiresRestart) restartKeys.add(field.key);
6294
6888
  }
6295
6889
  if (restartKeys.size === 0) return;
6296
- if (!Object.keys(patch).some((k) => restartKeys.has(k))) return;
6890
+ if (!patchKeys.some((k) => restartKeys.has(k))) return;
6297
6891
  const ctx = this._ctx;
6298
6892
  if (!ctx) return;
6299
6893
  const addonId = ctx.id;
6300
6894
  setImmediate(() => {
6301
6895
  ctx.api.addons?.restartAddon?.mutate({ addonId }).then(() => {
6302
- ctx.logger.info("addon auto-restart triggered by restart-required setting change", { meta: { changedFields: Object.keys(patch).filter((k) => restartKeys.has(k)) } });
6896
+ ctx.logger.info("addon auto-restart triggered by restart-required setting change", { meta: { changedFields: patchKeys.filter((k) => restartKeys.has(k)) } });
6303
6897
  }).catch((err) => {
6304
6898
  ctx.logger.error("addon auto-restart failed", { meta: { error: err instanceof Error ? err.message : String(err) } });
6305
6899
  });
@@ -6308,7 +6902,7 @@ var BaseAddon = class {
6308
6902
  async getDeviceSettings(deviceId) {
6309
6903
  const schema = this.deviceSettingsSchema();
6310
6904
  if (!schema) return { sections: [] };
6311
- return hydrateSchema(schema, await this._ctx?.settings?.readDeviceStore(deviceId) ?? {});
6905
+ return hydrateSchema(schema, await this._ctx?.settings?.readDeviceStore(deviceId) ?? {}, { inlineSecretsAsViews: true });
6312
6906
  }
6313
6907
  async updateDeviceSettings(deviceId, patch) {
6314
6908
  await this._ctx?.settings?.writeDeviceStore(deviceId, patch);
@@ -6438,7 +7032,7 @@ var BaseAddon = class {
6438
7032
  * selection at boot (absent scoped key ⇒ the constructor default wins).
6439
7033
  */
6440
7034
  async resolveConfig() {
6441
- const stored = await this.readAddonStoreWithRetry();
7035
+ const stored = await this.resolveStoredSecrets(await this.readAddonStoreWithRetry());
6442
7036
  const perNode = this.perNodeKeys();
6443
7037
  const localNode = normalizeNodeId(this._ctx?.kernel?.localNodeId);
6444
7038
  const resolved = { ...this.defaults };
@@ -6463,7 +7057,7 @@ var BaseAddon = class {
6463
7057
  key,
6464
7058
  schema,
6465
7059
  fallback,
6466
- read: () => this.readAddonStoreWithRetry(),
7060
+ read: async () => this.resolveStoredSecrets(await this.readAddonStoreWithRetry()),
6467
7061
  write: async (patch) => {
6468
7062
  await this._ctx?.settings?.writeAddonStore(patch);
6469
7063
  },
@@ -6480,7 +7074,7 @@ var BaseAddon = class {
6480
7074
  key,
6481
7075
  schema,
6482
7076
  fallback,
6483
- read: async () => await this._ctx?.settings?.readDeviceStore(deviceId) ?? {},
7077
+ read: async () => this.resolveStoredSecrets(await this._ctx?.settings?.readDeviceStore(deviceId) ?? {}, false),
6484
7078
  write: async (patch) => {
6485
7079
  await this._ctx?.settings?.writeDeviceStore(deviceId, patch);
6486
7080
  },
@@ -6492,6 +7086,70 @@ var BaseAddon = class {
6492
7086
  } })
6493
7087
  });
6494
7088
  }
7089
+ /** The addon store's secret tree: schema fields by TYPE, plus `secretStatePaths`. */
7090
+ addonSecretTree() {
7091
+ this._addonSecretTree ??= mergeSecretStatePaths(secretTreeFromSchema(this.globalSettingsSchema()), this.secretStatePaths);
7092
+ return this._addonSecretTree;
7093
+ }
7094
+ deviceSecretTree() {
7095
+ this._deviceSecretTree ??= secretTreeFromSchema(this.deviceSettingsSchema());
7096
+ return this._deviceSecretTree;
7097
+ }
7098
+ /**
7099
+ * Secrets of this addon's stored config that could not be resolved on the
7100
+ * last read, with why. Non-empty means the addon is running WITHOUT them —
7101
+ * an addon whose function needs one should report itself degraded rather
7102
+ * than start on an empty credential.
7103
+ */
7104
+ get unresolvedSecrets() {
7105
+ return this._unresolvedSecrets;
7106
+ }
7107
+ /**
7108
+ * Substitute every keychain marker in a stored blob with its value. With no
7109
+ * keychain (no `ctx.secrets`) or no marker, the blob comes back unchanged.
7110
+ * An unresolvable value is LEFT OUT (never `''`), logged by ref — never by
7111
+ * value — and, when the cause can pass, retried with backoff. Nothing is
7112
+ * ever written back from here.
7113
+ */
7114
+ async resolveStoredSecrets(blob, trackForConfig = true) {
7115
+ const secrets = this._ctx?.secrets;
7116
+ if (secrets === void 0) return blob;
7117
+ const refs = collectSecretMarkerRefs(blob);
7118
+ if (trackForConfig) this._configSecretRefs = new Set(refs);
7119
+ if (refs.length === 0) {
7120
+ if (trackForConfig) this._unresolvedSecrets = [];
7121
+ return blob;
7122
+ }
7123
+ const { value, unresolved } = await resolveSecretMarkers(blob, secrets);
7124
+ if (trackForConfig) {
7125
+ this._unresolvedSecrets = unresolved;
7126
+ if (unresolved.length > 0) {
7127
+ this._ctx?.logger?.error?.("secret unavailable — running without it, will retry", { meta: { secrets: unresolved.map((u) => ({
7128
+ ref: u.ref,
7129
+ reason: u.reason
7130
+ })) } });
7131
+ if (unresolved.some((u) => u.reason !== "missing" && u.reason !== "forbidden")) {
7132
+ this.scheduleSecretReresolve(this._secretRetryDelayMs);
7133
+ this._secretRetryDelayMs = Math.min(this._secretRetryDelayMs * 2, SECRET_RETRY_MAX_MS);
7134
+ }
7135
+ } else this._secretRetryDelayMs = SECRET_RETRY_FIRST_MS;
7136
+ }
7137
+ return value;
7138
+ }
7139
+ /** Re-resolve the config (a keychain-only change, or a retry) and apply it. */
7140
+ scheduleSecretReresolve(delayMs) {
7141
+ const timerOf = delayMs === SECRET_CHANGE_DEBOUNCE_MS ? "_secretChangeTimer" : "_secretRetryTimer";
7142
+ if (this[timerOf] !== null) return;
7143
+ const timer = setTimeout(() => {
7144
+ this[timerOf] = null;
7145
+ if (this._ctx === null) return;
7146
+ this.resolveConfig().then(() => this.onConfigChanged()).catch((err) => {
7147
+ this._ctx?.logger?.error?.("re-resolving secrets failed", { meta: { error: err instanceof Error ? err.message : String(err) } });
7148
+ });
7149
+ }, delayMs);
7150
+ timer.unref?.();
7151
+ this[timerOf] = timer;
7152
+ }
6495
7153
  /**
6496
7154
  * Wrap `ctx.settings.readAddonStore()` with a short retry budget so a
6497
7155
  * transient settings-store outage (mid-restart of sqlite-settings, tsx-watch
@@ -6759,32 +7417,12 @@ object({
6759
7417
  audioCodec: string().optional(),
6760
7418
  metadata: record(string(), unknown()).readonly().optional()
6761
7419
  });
6762
- var EncodedPacketSchema = object({
6763
- type: _enum(["video", "audio"]),
6764
- data: _instanceof(Uint8Array),
6765
- pts: number(),
6766
- dts: number(),
6767
- keyframe: boolean(),
6768
- codec: string()
6769
- });
6770
- var DecodedFrameSchema = object({
6771
- data: _instanceof(Uint8Array),
6772
- width: number(),
6773
- height: number(),
6774
- format: _enum([
6775
- "jpeg",
6776
- "rgb",
6777
- "bgr",
6778
- "yuv420",
6779
- "gray"
6780
- ]),
6781
- timestamp: number()
6782
- });
6783
7420
  /**
6784
7421
  * Wire schema for `FrameHandle` — a zero-pixel, serialisable reference to a
6785
7422
  * frame in a shared-memory ring (Phase 5 / D9). Mirrors the `FrameHandle` TS
6786
- * interface in `interfaces/frame-handle.ts` field-for-field so a decoder cap
6787
- * method (`pullHandles`) can carry handles over tRPC / Moleculer.
7423
+ * interface in `interfaces/frame-handle.ts` field-for-field so a cap method
7424
+ * (the runner's native-crop and pipeline-executor inputs) can carry handles
7425
+ * over tRPC / Moleculer.
6788
7426
  *
6789
7427
  * The `satisfies` assertion below pins this schema to the interface: if a
6790
7428
  * field is added to / removed from `FrameHandle` without a matching schema
@@ -6810,50 +7448,6 @@ var FrameHandleSchema = object({
6810
7448
  slotCount: number().int().positive()
6811
7449
  });
6812
7450
  /**
6813
- * Pixel format a frame-handle subscriber can request from the broker
6814
- * (Phase 5 / D9). The packed, raster subset of `FrameFormat` — the formats a
6815
- * `frameSink: 'shm'` decoder session can write into a `FrameRing` slot.
6816
- * `jpeg` is excluded: a variable-length stream is not a fixed-stride ring
6817
- * payload, and no decoded-frame consumer requests it over the shm plane.
6818
- */
6819
- var FrameHandleFormatSchema = _enum([
6820
- "rgb",
6821
- "bgr",
6822
- "yuv420",
6823
- "gray"
6824
- ]);
6825
- /**
6826
- * Input for `stream-broker.subscribeFrames` (Phase 5 / D9). A consumer asks the
6827
- * broker for a `FrameHandle` stream of one `format`; the broker maintains one
6828
- * shared-memory ring per `(brokerId, format)` actually requested, so a `gray`
6829
- * subscriber (motion) and an `rgb` subscriber (detection) each read the format
6830
- * they asked for with no broker-side conversion.
6831
- */
6832
- var SubscribeFramesInputSchema = object({
6833
- brokerId: string(),
6834
- format: FrameHandleFormatSchema,
6835
- /**
6836
- * Optional reader-side cadence hint in frames per second. The broker does
6837
- * NOT throttle — latest-wins ring reads drop frames implicitly for a slow
6838
- * consumer. The value is echoed back in `SubscribeFramesResult.maxFps` so
6839
- * the consumer can pace its own `pullFrameHandles` polling.
6840
- */
6841
- maxFps: number().positive().optional(),
6842
- /** Short caller-identity tag (`motion`, `detection`, …) for diagnostics. */
6843
- tag: string().optional()
6844
- });
6845
- /**
6846
- * Result of `stream-broker.subscribeFrames`. The consumer then polls
6847
- * `pullFrameHandles({ subscriptionId, maxCount })` and feeds each returned
6848
- * `FrameHandle` to a `FrameRingReader`.
6849
- */
6850
- var SubscribeFramesResultSchema = object({
6851
- /** Opaque id the consumer passes to `pullFrameHandles` / `unsubscribeFrames`. */
6852
- subscriptionId: string(),
6853
- /** Reader-side cadence hint (frames/s) — echoes `SubscribeFramesInput.maxFps`. */
6854
- maxFps: number().nonnegative()
6855
- });
6856
- /**
6857
7451
  * Wire schema for a decoded audio chunk (Phase 5 / D9). Mirrors the
6858
7452
  * `DecodedAudioChunk` TS interface in `interfaces/stream-broker.ts`: PCM
6859
7453
  * sample bytes plus the track parameters a consumer needs to interpret them.
@@ -6861,8 +7455,8 @@ var SubscribeFramesResultSchema = object({
6861
7455
  * Audio chunks are tiny (a ~500ms AudioCodecSession window is a few KB of
6862
7456
  * Float32 PCM), so unlike video frames they ship their bytes INLINE over
6863
7457
  * tRPC / Moleculer — no shared-memory plane. `data` is typed `Uint8Array`
6864
- * (the wire-serialisable supertype of `Buffer`) to match `DecodedFrameSchema`
6865
- * / `EncodedPacketSchema`'s precedent; a `Buffer` is assignable to it.
7458
+ * (the wire-serialisable supertype of `Buffer`); a `Buffer` is assignable to
7459
+ * it.
6866
7460
  */
6867
7461
  var AudioChunkFormatSchema = _enum(AUDIO_CHUNK_FORMATS);
6868
7462
  var DecodedAudioChunkSchema = object({
@@ -6880,11 +7474,10 @@ var DecodedAudioChunkSchema = object({
6880
7474
  format: AudioChunkFormatSchema.optional()
6881
7475
  });
6882
7476
  /**
6883
- * Input for `stream-broker.subscribeAudioChunks` (Phase 5 / D9). The
6884
- * handle-free, ship-bytes-inline analogue of `subscribeFrames`: a consumer
6885
- * asks the broker for the decoded audio-chunk stream of one broker; the
6886
- * broker keeps a per-subscription bounded FIFO queue the consumer drains via
6887
- * `pullAudioChunks`.
7477
+ * Input for `stream-broker.subscribeAudioChunks` (Phase 5 / D9). Audio ships
7478
+ * its bytes inline: a consumer asks the broker for the decoded audio-chunk
7479
+ * stream of one broker; the broker keeps a per-subscription bounded FIFO queue
7480
+ * the consumer drains via `pullAudioChunks`.
6888
7481
  */
6889
7482
  var SubscribeAudioChunksInputSchema = object({
6890
7483
  brokerId: string(),
@@ -6915,9 +7508,7 @@ var BrokerStatsSchema = object({
6915
7508
  "stopped"
6916
7509
  ]),
6917
7510
  inputFps: number(),
6918
- decodeFps: number(),
6919
7511
  encodedSubscribers: number(),
6920
- decodedSubscribers: number(),
6921
7512
  uptimeMs: number(),
6922
7513
  bitrateKbps: number(),
6923
7514
  idrIntervalMs: number(),
@@ -6930,14 +7521,6 @@ var BrokerStatsSchema = object({
6930
7521
  preBufferMs: number(),
6931
7522
  preBufferPackets: number(),
6932
7523
  /**
6933
- * Moleculer node id of the decoder provider currently servicing this
6934
- * stream's decoded subscribers. `null` until the deferred decoder is
6935
- * created (no decoded clients yet, or codec not detected). Surfaces the
6936
- * runtime decoder placement so the UI can show "Decoder: <agent>" without
6937
- * a separate cap call per broker.
6938
- */
6939
- decoderNodeId: string().nullable(),
6940
- /**
6941
7524
  * Detected audio track parameters from the RTSP DESCRIBE / SDP. `null`
6942
7525
  * when the stream has no audio track or the broker is in cold start.
6943
7526
  * `supported = false` means the codec was detected but the local
@@ -7142,6 +7725,69 @@ method(object({ deviceId: number() }), array(StreamSourceEntrySchema)), method(o
7142
7725
  kind: "mutation",
7143
7726
  auth: "admin"
7144
7727
  }), method(object({ deviceId: number() }), unknown().nullable()), method(object({ deviceId: number() }), RawStateResultSchema.nullable(), { auth: "protected" });
7728
+ function defOf(schema) {
7729
+ return schema._zod?.def ?? {};
7730
+ }
7731
+ function declaredHere(schema) {
7732
+ return globalRegistry.get(schema)?.secret === true;
7733
+ }
7734
+ /** Wrapper kinds whose `innerType` is the field itself. */
7735
+ var WRAPPERS = new Set([
7736
+ "optional",
7737
+ "nullable",
7738
+ "default",
7739
+ "prefault",
7740
+ "catch",
7741
+ "readonly",
7742
+ "nonoptional"
7743
+ ]);
7744
+ /**
7745
+ * The schema layers that make up ONE field: the schema itself and every
7746
+ * wrapper below it (optional / default / nullable / readonly / catch), plus
7747
+ * both sides of a pipe (`z.preprocess` puts the real schema on `out`,
7748
+ * `.transform` on `in`).
7749
+ */
7750
+ function layersOf(schema) {
7751
+ const out = [];
7752
+ const queue = [schema];
7753
+ while (queue.length > 0) {
7754
+ const s = queue.shift();
7755
+ if (!s || out.includes(s)) continue;
7756
+ out.push(s);
7757
+ const def = defOf(s);
7758
+ if (def.type !== void 0 && WRAPPERS.has(def.type) && def.innerType) queue.push(def.innerType);
7759
+ if (def.type === "pipe") {
7760
+ if (def.in) queue.push(def.in);
7761
+ if (def.out) queue.push(def.out);
7762
+ }
7763
+ }
7764
+ return out;
7765
+ }
7766
+ /** True when any layer of this field declares `.meta({ secret: true })`. */
7767
+ function isZodSecret(schema) {
7768
+ return layersOf(schema).some(declaredHere);
7769
+ }
7770
+ /**
7771
+ * Every declared secret path in a config schema: dotted keys, `[]` for "each
7772
+ * element of this array" (`connection.password`, `rows[].token`). A declared
7773
+ * object or array is reported as one path and not descended into — everything
7774
+ * under it is secret.
7775
+ */
7776
+ function collectZodSecretPaths(schema, prefix = "") {
7777
+ if (isZodSecret(schema)) return prefix.length > 0 ? [prefix] : [];
7778
+ const paths = [];
7779
+ for (const layer of layersOf(schema)) {
7780
+ const def = defOf(layer);
7781
+ if (def.type === "object" && def.shape) for (const [key, child] of Object.entries(def.shape)) paths.push(...collectZodSecretPaths(child, prefix ? `${prefix}.${key}` : key));
7782
+ else if (def.type === "array" && def.element) paths.push(...collectZodSecretPaths(def.element, `${prefix}[]`));
7783
+ else if (def.type === "union" && def.options) for (const option of def.options) paths.push(...collectZodSecretPaths(option, prefix));
7784
+ else if (def.type === "intersection") {
7785
+ if (def.left) paths.push(...collectZodSecretPaths(def.left, prefix));
7786
+ if (def.right) paths.push(...collectZodSecretPaths(def.right, prefix));
7787
+ }
7788
+ }
7789
+ return [...new Set(paths)];
7790
+ }
7145
7791
  //#endregion
7146
7792
  //#region ../types/dist/err-msg-DX6i_MY4.mjs
7147
7793
  var DeviceType = /* @__PURE__ */ function(DeviceType) {
@@ -10283,70 +10929,6 @@ var StorageLocationDeclarationSchema = object({
10283
10929
  "backup"
10284
10930
  ]).optional()
10285
10931
  });
10286
- var DecoderStatsSchema = object({
10287
- inputFps: number(),
10288
- outputFps: number(),
10289
- avgDecodeTimeMs: number(),
10290
- droppedFrames: number(),
10291
- /**
10292
- * Pull-mode adaptive-fps telemetry (optional — only pull sessions run the
10293
- * lag-driven controller; push sessions omit these). `lagMs` is the EWMA of
10294
- * the decoder's real-time drift (rising = falling behind live); `adaptiveFps`
10295
- * is the current lag-throttled emit rate (≤ `effectiveFps` ceiling).
10296
- */
10297
- lagMs: number().optional(),
10298
- effectiveFps: number().optional(),
10299
- adaptiveFps: number().optional()
10300
- });
10301
- var DecoderSessionConfigSchema = object({
10302
- codec: string(),
10303
- maxFps: number().default(0),
10304
- outputFormat: _enum([
10305
- "jpeg",
10306
- "rgb",
10307
- "bgr",
10308
- "yuv420",
10309
- "gray"
10310
- ]).default("jpeg"),
10311
- scale: number().default(1),
10312
- width: number().optional(),
10313
- height: number().optional(),
10314
- /**
10315
- * Identifier of the camera this decoder session serves. Optional
10316
- * because the cap is generic (any caller could request decode), but
10317
- * stream-broker passes it so decoder logs include `deviceId` for
10318
- * per-camera filtering when diagnosing failures (e.g. node-av
10319
- * sendPacket errors on a single hung camera).
10320
- */
10321
- deviceId: number().int().nonnegative().optional(),
10322
- /**
10323
- * Free-form tag for log scoping. Stream-broker uses
10324
- * `broker:<deviceId>/<profile>`. Decoder session logger surfaces it
10325
- * on every line so `grep tag=broker:5/high` filters one camera
10326
- * profile cleanly.
10327
- */
10328
- tag: string().optional(),
10329
- /**
10330
- * Where the session delivers decoded frames (Phase 5 / D9):
10331
- *
10332
- * - `'callback'` (default) — the legacy pixel path: decoded frames are
10333
- * buffered as `DecodedFrame`s and drained via `pullFrames`.
10334
- * - `'shm'` — the shared-memory frame plane: decoded frames are written
10335
- * into an OS shared-memory ring and drained as zero-pixel
10336
- * `FrameHandle`s via `pullHandles`. A session is one mode or the
10337
- * other — `pullFrames` returns nothing for an `'shm'` session and
10338
- * `pullHandles` returns nothing for a `'callback'` session.
10339
- */
10340
- frameSink: _enum(["callback", "shm"]).default("callback"),
10341
- /**
10342
- * Per-camera decoder DEBUG facility. When `true`, a pull-mode session emits
10343
- * a throttled (~1Hz) structured `decoder debug` line (effective/adaptive fps,
10344
- * real-time lag, dropped-frame delta, avg decode time, hwaccel). Mirrors the
10345
- * stream-broker's `streamingDebug` gate — off by default so production logs
10346
- * stay quiet and the emit path pays zero per-frame cost when disabled.
10347
- */
10348
- debug: boolean().optional()
10349
- });
10350
10932
  /**
10351
10933
  * Per-component log CHANNELS — the gate a hot path consults, and the registry
10352
10934
  * an addon declares its channels in.
@@ -10489,57 +11071,26 @@ var ClipSearchStrictnessSchema = _enum([
10489
11071
  "balanced",
10490
11072
  "strict"
10491
11073
  ]);
10492
- new Set([
10493
- {
10494
- id: "person",
10495
- name: "Person"
10496
- },
10497
- {
10498
- id: "vehicle",
10499
- name: "Vehicle"
10500
- },
10501
- {
10502
- id: "animal",
10503
- name: "Animal"
10504
- },
10505
- {
10506
- id: "package",
10507
- name: "Package"
10508
- }
10509
- ].map((l) => l.id));
10510
- var COCO_TO_MACRO = {
10511
- mapping: {
10512
- person: "person",
10513
- bicycle: "vehicle",
10514
- car: "vehicle",
10515
- motorcycle: "vehicle",
10516
- airplane: "vehicle",
10517
- bus: "vehicle",
10518
- train: "vehicle",
10519
- truck: "vehicle",
10520
- boat: "vehicle",
10521
- bird: "animal",
10522
- cat: "animal",
10523
- dog: "animal",
10524
- horse: "animal",
10525
- sheep: "animal",
10526
- cow: "animal",
10527
- elephant: "animal",
10528
- bear: "animal",
10529
- zebra: "animal",
10530
- giraffe: "animal",
10531
- suitcase: "package",
10532
- backpack: "package",
10533
- handbag: "package"
10534
- },
10535
- preserveOriginal: false
10536
- };
10537
- /** Steps a root detector may declare it fills. */
10538
- var FILLABLE_STEP_IDS = [
11074
+ /** Steps whose effect a root label can BE. */
11075
+ var LABEL_SUPPLY_STEP_IDS = [
10539
11076
  "animal-classifier",
10540
11077
  "vehicle-classifier",
10541
11078
  "package-detection"
10542
11079
  ];
11080
+ /** Steps whose box a root detection can BE. */
11081
+ var CROP_SUPPLY_STEP_IDS = ["plate-detection", "face-detection"];
11082
+ /**
11083
+ * Steps whose per-detection MASK a root detection can carry (D737). The live
11084
+ * mask step is `segmentation` — a frame-plane refiner that runs its own model
11085
+ * once per detection crop. (`instance-segmentation` is a dormant step id that
11086
+ * no camera tree carries.)
11087
+ */
11088
+ var MASK_SUPPLY_STEP_IDS = ["segmentation"];
11089
+ [
11090
+ ...LABEL_SUPPLY_STEP_IDS,
11091
+ ...CROP_SUPPLY_STEP_IDS,
11092
+ ...MASK_SUPPLY_STEP_IDS
11093
+ ];
10543
11094
  var MODEL_FORMATS = [
10544
11095
  "onnx",
10545
11096
  "coreml",
@@ -10568,7 +11119,53 @@ var ModelFormatEntrySchema = object({
10568
11119
  /** Multi-file payload (directory members or sibling files). */
10569
11120
  files: array(string()).readonly().optional(),
10570
11121
  /** Runtime(s) that can use this format. If omitted, inferred from ModelFormat key */
10571
- runtimes: array(_enum(["python"])).readonly().optional()
11122
+ runtimes: array(_enum(["python"])).readonly().optional(),
11123
+ /**
11124
+ * Content revision of the artefact, for one hosted OFF the CamStack mirror.
11125
+ * A format on the mirror leaves it unset: its revision (the sha256 of its
11126
+ * weight file) comes from the downloader's generated table, kept in step
11127
+ * with the mirror by `scripts/check-hosted-model-revisions.ts` (D744). A
11128
+ * node records the revision it downloaded next to the file
11129
+ * (`<file>.revision`); a copy with no record or a different one is stale
11130
+ * unless its weight file hashes to the revision, and a stale copy is
11131
+ * downloaded again, the old one serving until the new one is complete. No
11132
+ * revision at all ⇒ a file on disk is current, whatever it holds (D743).
11133
+ */
11134
+ revision: string().min(1).optional()
11135
+ });
11136
+ /**
11137
+ * What a node holds for one (model, format) (D746). `current` is a complete
11138
+ * copy at its catalog revision — exactly what `downloaded: true` means.
11139
+ * `stale` is bytes on disk that are not (yet) proven current under D743/D744:
11140
+ * no or a different revision record, or a missing sibling. `missing` is no
11141
+ * copy. `downloaded` alone folds `stale` into "not downloaded", which hid
11142
+ * reclaimable bytes and a copy about to be replaced.
11143
+ */
11144
+ var ModelOnDiskStateSchema = _enum([
11145
+ "current",
11146
+ "stale",
11147
+ "missing"
11148
+ ]);
11149
+ /**
11150
+ * The numeric precision of one format's BUILD (D746) — reported only when the
11151
+ * build states it (file-name token, an INT8 variant, an EdgeTPU compile, a
11152
+ * CamStack Core ML export). Absent means "not stated", never "fp32".
11153
+ */
11154
+ var ModelFormatPrecisionSchema = _enum([
11155
+ "fp32",
11156
+ "fp16",
11157
+ "int8"
11158
+ ]);
11159
+ /**
11160
+ * One format of one model as a node's `pipelineExecutor.getSchema` reports it.
11161
+ * `onDisk` / `precision` are optional for version skew: a runner that predates
11162
+ * them omits them, and a reader falls back to `downloaded`.
11163
+ */
11164
+ var PipelineModelFormatStatusSchema = object({
11165
+ downloaded: boolean(),
11166
+ sizeMB: number(),
11167
+ onDisk: ModelOnDiskStateSchema.optional(),
11168
+ precision: ModelFormatPrecisionSchema.optional()
10572
11169
  });
10573
11170
  /**
10574
11171
  * Extra file that must be downloaded alongside the model (e.g., labels JSON, dict.txt).
@@ -10672,12 +11269,46 @@ var ModelLicenseSchema = preprocess((value) => typeof value === "string" ? { wei
10672
11269
  /** True when the weights or their data forbid commercial use. */
10673
11270
  nonCommercial: boolean().optional()
10674
11271
  }));
10675
- /** One `fillsClassifierEffects` entry — see `ModelCatalogEntry.fillsClassifierEffects`. */
10676
- var FillsClassifierEffectSchema = object({
10677
- stepId: _enum(FILLABLE_STEP_IDS),
10678
- labelToEffect: record(string(), string()),
10679
- uncovered: array(string()).readonly()
10680
- });
11272
+ /**
11273
+ * One step a ROOT detector can supply from its own output (D730) — see
11274
+ * `ModelCatalogEntry.suppliesSteps`.
11275
+ *
11276
+ * - `label`: the root's raw class IS the step's answer. `labelToEffect` maps
11277
+ * the root's label to the step's vocabulary; `uncovered` is the vocabulary
11278
+ * the root cannot produce (shown as unavailable, never a blocker).
11279
+ * - `crop`: the root draws the box the step would have found (`license_plate`
11280
+ * for plate-detection, `face` for face-detection). The box becomes a detail
11281
+ * child of the `parentMacro` detection that contains it — never a track.
11282
+ * - `mask`: the root's decode emits an instance mask with every detection (a
11283
+ * YOLO26-seg root, D737) — the `segmentation` step's result, carried on the
11284
+ * detection in the shape that step produces. Derived from the model's
11285
+ * postprocessor on read, never stored by an import.
11286
+ */
11287
+ var RootStepSupplySchema = discriminatedUnion("kind", [
11288
+ object({
11289
+ kind: literal("label"),
11290
+ stepId: _enum(LABEL_SUPPLY_STEP_IDS),
11291
+ labelToEffect: record(string(), string()),
11292
+ uncovered: array(string()).readonly()
11293
+ }),
11294
+ object({
11295
+ kind: literal("crop"),
11296
+ stepId: _enum(CROP_SUPPLY_STEP_IDS),
11297
+ rootLabels: array(string()).readonly(),
11298
+ parentMacro: _enum(["vehicle", "person"]),
11299
+ childClass: _enum(["plate", "face"]),
11300
+ /**
11301
+ * The root's smaller input side, stamped on read by `rootSuppliesOf` from
11302
+ * the model entry — what a step's `minRootInputPx` gate judges. Never
11303
+ * stored by an import.
11304
+ */
11305
+ rootInputPx: number().int().positive().optional()
11306
+ }),
11307
+ object({
11308
+ kind: literal("mask"),
11309
+ stepId: _enum(MASK_SUPPLY_STEP_IDS)
11310
+ })
11311
+ ]);
10681
11312
  var ModelCatalogEntrySchema = object({
10682
11313
  id: string(),
10683
11314
  name: string(),
@@ -10743,6 +11374,35 @@ var ModelCatalogEntrySchema = object({
10743
11374
  */
10744
11375
  defaultConfidence: number().min(0).max(1).optional(),
10745
11376
  /**
11377
+ * Per-MODEL default of the per-class confidence floors (`minConfidence<Macro>`
11378
+ * on a detector step), keyed by macro class: `{ person: 0.45 }`. A class
11379
+ * absent here runs at the step slider's global default. The same row shape
11380
+ * the floor measurement produces (`model-floors.json`: modelId → floors), so
11381
+ * a measured table is copied in as-is. An operator override is bound to the
11382
+ * model it was made for and does not survive a model change (D738). A custom
11383
+ * / imported model may declare it; without it, the global defaults apply.
11384
+ */
11385
+ defaultClassFloors: record(string(), number().min(0).max(1)).optional(),
11386
+ /**
11387
+ * The inference precision this model's OpenVINO IR needs on an Intel GPU.
11388
+ * Absent ⇒ the device default (f16 on a GPU). Set to `'f32'` for an FP32 IR
11389
+ * that produces invalid output at f16 — measured 2026-10-07 for YOLO26
11390
+ * base IRs (`yolo26s`: 0 true / 146 false positives; `yolo26m*`: NaN
11391
+ * scores) on the Core Ultra iGPU and the N100. Threaded to the pool as
11392
+ * `PoolModelConfig.gpuInferencePrecision`; the pool sets
11393
+ * INFERENCE_PRECISION_HINT on a GPU only. Costs ~60% latency on the GPU.
11394
+ */
11395
+ gpuInferencePrecision: _enum(["f32", "f16"]).optional(),
11396
+ /**
11397
+ * ROOT detectors only: per supplied step (`animal-classifier`, …), the
11398
+ * minimum DETECTION score from which this root's own fine label (species,
11399
+ * vehicle type — D736 root supply) is taken (D741). Below it the detection
11400
+ * keeps its macro class without the fine label. `1` = never take it from
11401
+ * this root. Absent ⇒ no floor beyond the macro floor. The supplied step's
11402
+ * `minConfidence` slider, bound to the ROOT model, overrides it.
11403
+ */
11404
+ suppliedLabelFloors: record(string(), number().min(0).max(1)).optional(),
11405
+ /**
10746
11406
  * When true, the executor produces a landmark-aligned crop (similarity warp
10747
11407
  * onto the canonical template) before this step runs, instead of a plain
10748
11408
  * axis-aligned bbox crop. Required for face-recognition embedders (ArcFace):
@@ -10804,15 +11464,15 @@ var ModelCatalogEntrySchema = object({
10804
11464
  */
10805
11465
  classMap: DetectionCatalogClassMapSchema.optional(),
10806
11466
  /**
10807
- * The pipeline steps this ROOT detector already does the work of (D715):
10808
- * its labels name the effect the step exists to produce (`deer` for
10809
- * `animal-classifier`, `package` for `package-detection`). Derived from the
10810
- * labelmap by `deriveClassifierFills`, never hand-written; a COCO model
10811
- * declares none. Whether a declaration is honoured is the step's own
10812
- * `labelLink` policy (`resolveLabelLink`). `labelToEffect` values are in
10813
- * `FILLABLE_STEP_VOCABULARIES` (guard `check-label-link-vocabulary`).
11467
+ * The pipeline steps this ROOT detector can supply from its own output
11468
+ * (D730): its labels name a step's effect (`deer` for `animal-classifier`)
11469
+ * or draw a step's box (`license_plate` for `plate-detection`). Computed at
11470
+ * import from THIS model's labelmap by `deriveRootSupplies`, never written
11471
+ * by hand and never assumed per family; a row without it is derived on read
11472
+ * (`rootSuppliesOf`). Whether a camera uses it is the step's own
11473
+ * `useRootModel` flag (`resolveRootSupply`).
10814
11474
  */
10815
- fillsClassifierEffects: array(FillsClassifierEffectSchema).readonly().optional(),
11475
+ suppliesSteps: array(RootStepSupplySchema).readonly().optional(),
10816
11476
  /**
10817
11477
  * The model's CLIP feature-space contract (text encoder, dimension, vector
10818
11478
  * index, token window, search floor) — see `clip-model.ts`. Present ONLY on a
@@ -12415,13 +13075,6 @@ var BrokerRtspClientSchema = object({
12415
13075
  lastRtpAt: number(),
12416
13076
  bytesSent: number()
12417
13077
  });
12418
- var BrokerDecodedClientSchema = object({
12419
- tag: string(),
12420
- subscribedAt: number(),
12421
- maxFps: number(),
12422
- framesDelivered: number(),
12423
- framesDropped: number()
12424
- });
12425
13078
  var BrokerAudioClientSchema = object({
12426
13079
  tag: string(),
12427
13080
  subscribedAt: number(),
@@ -12513,7 +13166,6 @@ var BrokerEncodedClientSchema = object({
12513
13166
  });
12514
13167
  var BrokerClientsSchema = object({
12515
13168
  rtsp: array(BrokerRtspClientSchema).readonly(),
12516
- decoded: array(BrokerDecodedClientSchema).readonly(),
12517
13169
  audio: array(BrokerAudioClientSchema).readonly(),
12518
13170
  encoded: array(BrokerEncodedClientSchema).readonly(),
12519
13171
  pipeClients: number(),
@@ -12882,11 +13534,7 @@ method(object({
12882
13534
  auth: "admin"
12883
13535
  }), method(object({ brokerId: string() }), BrokerClientsSchema), method(object({
12884
13536
  brokerId: string(),
12885
- channel: _enum([
12886
- "rtsp",
12887
- "decoded",
12888
- "audio"
12889
- ]),
13537
+ channel: _enum(["rtsp", "audio"]),
12890
13538
  handle: string()
12891
13539
  }), object({ killed: boolean() }), {
12892
13540
  kind: "mutation",
@@ -12921,10 +13569,7 @@ method(object({
12921
13569
  }), method(SubscribeAudioChunksInputSchema, SubscribeAudioChunksResultSchema, { kind: "mutation" }), method(object({
12922
13570
  subscriptionId: string(),
12923
13571
  maxCount: number().int().positive().default(8)
12924
- }), array(DecodedAudioChunkSchema).readonly()), method(object({ subscriptionId: string() }), object({ released: boolean() }), { kind: "mutation" }), method(SubscribeFramesInputSchema, SubscribeFramesResultSchema, { kind: "mutation" }), method(object({
12925
- subscriptionId: string(),
12926
- maxCount: number().int().positive().default(4)
12927
- }), array(FrameHandleSchema).readonly()), method(object({ subscriptionId: string() }), object({ released: boolean() }), { kind: "mutation" }), method(object({
13572
+ }), array(DecodedAudioChunkSchema).readonly()), method(object({ subscriptionId: string() }), object({ released: boolean() }), { kind: "mutation" }), method(object({
12928
13573
  brokerId: string(),
12929
13574
  seconds: number().min(0).max(30)
12930
13575
  }), _void(), {
@@ -14184,53 +14829,201 @@ id: union([string(), number()]) }), {
14184
14829
  auth: "admin"
14185
14830
  });
14186
14831
  /**
14187
- * shm ring usage stats for a `frameSink: 'shm'` decoder session —
14188
- * exposed via `decoder.getShmStats` so downstream consumers can
14189
- * observe ring pressure (slot count, byte budget, hit/miss ratio).
14832
+ * `keychain` — the hub's encrypted store of secret values (D787).
14833
+ *
14834
+ * Settings blobs never hold a secret: they hold a marker
14835
+ * `{"$secret":"secret://<owner>/<scope>/<fieldPath>","v":1}` and the value
14836
+ * lives here, AES-256-GCM under a data key that a master key wraps. This cap
14837
+ * is the OWNER's door to its own values: every method is owner-checked
14838
+ * against the CALLER, never against anything the caller claims.
14839
+ *
14840
+ * Who the caller is: the transport stamps `callerAddonId` into the args of a
14841
+ * call that crossed a process (the parent `LocalChildRegistry` from the UDS
14842
+ * connection, the agent from its child's connection carried in
14843
+ * `$hub-cap-fwd`'s envelope). A stamp always overwrites; a wire call with no
14844
+ * stamp has its claim stripped. Only a hub in-process caller may state its own
14845
+ * identity — `ctx.secrets` does that with the addon id closed over. This is
14846
+ * identity against BUGS and misrouting, not against a malicious addon (every
14847
+ * runner is the same OS user): see the threat model in
14848
+ * `docs/design/2026-10-08-secrets-keychain.md`.
14849
+ *
14850
+ * `callerAddonId` is deliberately NOT in any input schema: the tRPC router
14851
+ * parses the input, so a session can never supply it, and the internal mount
14852
+ * floors every method to admin anyway (D240).
14853
+ *
14854
+ * Internal: addons reach it through `ctx.secrets`, never directly.
14855
+ */
14856
+ /** Why a value cannot be served right now. Never folded into "missing". */
14857
+ var KeychainUnavailableReasonSchema = _enum([
14858
+ "key-missing",
14859
+ "wrong-key",
14860
+ "key-file-unreadable",
14861
+ "store-unavailable",
14862
+ "not-initialized",
14863
+ "decrypt-failed"
14864
+ ]);
14865
+ var KeychainStateSchema = discriminatedUnion("state", [object({ state: literal("ready") }), object({
14866
+ state: literal("locked"),
14867
+ reason: KeychainUnavailableReasonSchema
14868
+ })]);
14869
+ var KeychainResolveEntrySchema = discriminatedUnion("kind", [
14870
+ object({
14871
+ kind: literal("value"),
14872
+ value: string(),
14873
+ version: number().int()
14874
+ }),
14875
+ object({ kind: literal("missing") }),
14876
+ object({
14877
+ kind: literal("unavailable"),
14878
+ reason: KeychainUnavailableReasonSchema
14879
+ }),
14880
+ object({ kind: literal("forbidden") })
14881
+ ]);
14882
+ var KeychainResolveResultSchema = record(string(), KeychainResolveEntrySchema);
14883
+ /** Metadata of one stored value — never the value. */
14884
+ var KeychainSecretMetaSchema = object({
14885
+ ref: string(),
14886
+ owner: string(),
14887
+ /** Formatted scope (`global`, `node/<id>`, `device/<id>`, …). */
14888
+ scope: string(),
14889
+ fieldPath: string(),
14890
+ version: number().int(),
14891
+ createdAt: number(),
14892
+ updatedAt: number(),
14893
+ /** `addon:<id>` | `user:<id>` | `system`. */
14894
+ updatedBy: string(),
14895
+ /** Coarse — written at most once an hour per ref. `null` = never read. */
14896
+ lastReadAt: number().nullable()
14897
+ });
14898
+ var RefListSchema = array(string().min(1)).max(512);
14899
+ method(object({
14900
+ ref: string().min(1),
14901
+ value: string().min(1)
14902
+ }), object({
14903
+ ref: string(),
14904
+ version: number().int()
14905
+ }), {
14906
+ kind: "mutation",
14907
+ auth: "admin"
14908
+ }), method(object({ refs: RefListSchema }), KeychainResolveResultSchema, { auth: "admin" }), method(object({ refs: RefListSchema }), object({ deleted: number().int() }), {
14909
+ kind: "mutation",
14910
+ auth: "admin"
14911
+ }), method(object({}), array(KeychainSecretMetaSchema).readonly(), { auth: "admin" }), method(object({}), KeychainStateSchema, { auth: "admin" });
14912
+ var KeychainKeySourceSchema = object({
14913
+ kind: _enum([
14914
+ "config-file",
14915
+ "previous-config-file",
14916
+ "platform",
14917
+ "default-file"
14918
+ ]),
14919
+ /** File sources only — a path is not a secret. */
14920
+ path: string().optional(),
14921
+ /**
14922
+ * True when a whole-volume backup of the data directory carries this key
14923
+ * next to the database it protects (the default file). The page warns.
14924
+ */
14925
+ sharesBackupWithDatabase: boolean()
14926
+ });
14927
+ var KeychainStatusSchema = object({
14928
+ keychain: KeychainStateSchema,
14929
+ /** The source of the master key in use; `null` while locked. */
14930
+ keySource: KeychainKeySourceSchema.nullable(),
14931
+ /** The source configured to be primary — differs from `keySource` while a rotation is pending. */
14932
+ configuredSource: KeychainKeySourceSchema,
14933
+ /** Short fingerprint of the master key in use (`HMAC(KEK, label)`, 16 hex). */
14934
+ fingerprint: string().nullable(),
14935
+ activeKeyId: string().nullable(),
14936
+ /**
14937
+ * The keychain unlocked with a NON-primary source: the configured primary
14938
+ * key is not the one that wraps the data key yet. `rotateMasterKey` moves it.
14939
+ */
14940
+ rotationPending: boolean(),
14941
+ /** Wrapped copies of the data key under a previous master key, kept until purged. */
14942
+ retiredWraps: number().int(),
14943
+ recoveryKeyDownloadedAt: number().nullable(),
14944
+ secretCount: number().int()
14945
+ });
14946
+ /**
14947
+ * Whether a stored value is still pointed at by its owner's settings.
14948
+ * `unknown` is a first-class answer: a scope whose blob could not be read is
14949
+ * never reported as an orphan (and never deleted as one).
14190
14950
  */
14191
- var ShmRingStatsSchema = object({
14192
- sessionId: string(),
14193
- slotCount: number().int(),
14194
- slotByteLength: number().int(),
14195
- segmentBytes: number().int(),
14196
- budgetMb: number().int(),
14197
- framesWritten: number().int(),
14198
- getFrameHits: number().int(),
14199
- getFrameMisses: number().int()
14200
- });
14201
- method(object({ codec: string() }), boolean()), method(_void(), object({
14951
+ var KeychainSecretUsageSchema = _enum([
14952
+ "in-use",
14953
+ "orphan",
14954
+ "unknown"
14955
+ ]);
14956
+ var KeychainAdminSecretSchema = KeychainSecretMetaSchema.extend({ usage: KeychainSecretUsageSchema });
14957
+ var KeychainAuditActionSchema = _enum([
14958
+ "put",
14959
+ "delete",
14960
+ "reveal",
14961
+ "rotate-master-key",
14962
+ "purge-retired-keys",
14963
+ "download-recovery-key",
14964
+ "delete-orphans",
14965
+ "reset",
14966
+ "initialize"
14967
+ ]);
14968
+ var KeychainAuditEntrySchema = object({
14969
+ id: string(),
14970
+ at: number(),
14971
+ action: KeychainAuditActionSchema,
14972
+ /** `addon:<id>` | `user:<id>` | `system`. */
14973
+ actor: string(),
14974
+ ref: string().nullable(),
14975
+ detail: string().nullable()
14976
+ });
14977
+ 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({
14978
+ value: string(),
14979
+ version: number().int()
14980
+ }), {
14981
+ kind: "mutation",
14982
+ auth: "admin",
14983
+ caller: "required"
14984
+ }), method(object({ refs: array(string().min(1)).max(1e3) }), object({
14985
+ deleted: array(string()).readonly(),
14986
+ kept: array(object({
14987
+ ref: string(),
14988
+ usage: KeychainSecretUsageSchema
14989
+ })).readonly()
14990
+ }), {
14991
+ kind: "mutation",
14992
+ auth: "admin",
14993
+ caller: "required"
14994
+ }), method(object({}), object({
14995
+ fingerprint: string(),
14996
+ keySource: KeychainKeySourceSchema
14997
+ }), {
14998
+ kind: "mutation",
14999
+ auth: "admin",
15000
+ caller: "required"
15001
+ }), method(object({}), object({ purged: number().int() }), {
15002
+ kind: "mutation",
15003
+ auth: "admin",
15004
+ caller: "required"
15005
+ }), method(object({}), object({
15006
+ key: string(),
15007
+ fingerprint: string(),
15008
+ keySource: KeychainKeySourceSchema
15009
+ }), {
15010
+ kind: "mutation",
15011
+ auth: "admin",
15012
+ caller: "required"
15013
+ }), method(object({ confirm: literal("RESET KEYCHAIN") }), object({
15014
+ archivedCollection: string().nullable(),
15015
+ archived: number().int()
15016
+ }), {
15017
+ kind: "mutation",
15018
+ auth: "admin",
15019
+ caller: "required"
15020
+ });
15021
+ method(_void(), object({
14202
15022
  id: string(),
14203
15023
  name: string(),
14204
- isPullMode: boolean().optional(),
14205
- priority: number().optional(),
14206
15024
  hwaccel: string().optional(),
14207
15025
  probedBestHwaccel: string().optional()
14208
- })), method(DecoderSessionConfigSchema, object({
14209
- sessionId: string(),
14210
- nodeId: string()
14211
- })), method(object({ sessionId: string() }), _void()), method(object({
14212
- sessionId: string(),
14213
- packet: EncodedPacketSchema
14214
- }), _void()), method(object({
14215
- sessionId: string(),
14216
- url: string()
14217
- }), _void()), method(object({
14218
- sessionId: string(),
14219
- maxCount: number().default(1),
14220
- waitMs: number().optional()
14221
- }), array(DecodedFrameSchema)), method(object({
14222
- sessionId: string(),
14223
- maxCount: number().default(1),
14224
- waitMs: number().optional()
14225
- }), array(FrameHandleSchema)), method(object({ handle: FrameHandleSchema }), DecodedFrameSchema.nullable()), method(object({ sessionId: string() }), ShmRingStatsSchema.nullable()), method(object({
14226
- sessionId: string(),
14227
- config: DecoderSessionConfigSchema.partial()
14228
- }), _void()), method(object({ sessionId: string() }), DecoderStatsSchema), method(_void(), array(object({
14229
- sessionId: string(),
14230
- codec: string(),
14231
- outputFormat: string(),
14232
- createdAtMs: number()
14233
- })).readonly()), method(_void(), object({ backend: string() }), {
15026
+ })), method(_void(), object({ backend: string() }), {
14234
15027
  kind: "mutation",
14235
15028
  auth: "admin"
14236
15029
  });
@@ -15343,6 +16136,10 @@ var DeviceInfoSchema = object({
15343
16136
  isCamera: boolean(),
15344
16137
  /** Current config values — serializable snapshot */
15345
16138
  config: record(string(), unknown()),
16139
+ /** Paths inside `config` the device's schema declares secret (D783) —
16140
+ * what the non-admin redaction withholds. Paths, never values. Absent
16141
+ * when the owning runner has not reported them. */
16142
+ secretConfigPaths: array(string()).optional(),
15346
16143
  /** Hardware + identity blob (manufacturer / model / firmware / sn /
15347
16144
  * uid / mac / …). Populated by drivers; editable via setMetadata. */
15348
16145
  metadata: record(string(), unknown()).nullable().optional(),
@@ -15548,12 +16345,22 @@ var DeviceRegisterPayloadSchema = object({
15548
16345
  * call (workers re-register on init), so probe-driven updates
15549
16346
  * (e.g. PTZ flag flipping after the abilities probe) propagate. */
15550
16347
  features: array(string()).optional(),
15551
- config: record(string(), unknown())
16348
+ config: record(string(), unknown()),
16349
+ /** Config paths the device's own schema DECLARES secret
16350
+ * (`.meta({ secret: true })` — dotted, `[]` for array items, e.g.
16351
+ * `connection.password`). Re-published on every register; the non-admin
16352
+ * redaction withholds them at any depth (D783). Optional: an older runner
16353
+ * omits it and the keyword backstop applies. */
16354
+ secretConfigPaths: array(string()).optional()
15552
16355
  });
15553
16356
  var DeviceRemovePayloadSchema = object({ deviceId: number() });
15554
16357
  var DevicePersistConfigPayloadSchema = object({
15555
16358
  deviceId: number(),
15556
- data: record(string(), unknown())
16359
+ data: record(string(), unknown()),
16360
+ /** The paths the device's schema declares secret (D783), when the caller
16361
+ * knows them — those values are kept in the keychain, not the blob (D787).
16362
+ * Absent: the paths the device last reported at `registerDevice` apply. */
16363
+ secretConfigPaths: array(string()).optional()
15557
16364
  });
15558
16365
  /** What a migration actually did, per switch. `unreachable` is a first-class
15559
16366
  * answer: a camera that could not be asked is not a camera that was silenced. */
@@ -16375,6 +17182,12 @@ method(_void(), array(string()).readonly(), { auth: "admin" }), method(object({
16375
17182
  kind: "mutation",
16376
17183
  auth: "admin"
16377
17184
  });
17185
+ var HUB_ADDRESS_ROLES = [
17186
+ "appConnections",
17187
+ "notificationTaps",
17188
+ "internal",
17189
+ "publicEndpoint"
17190
+ ];
16378
17191
  /**
16379
17192
  * Transport bounds for AI capability methods.
16380
17193
  *
@@ -17201,7 +18014,14 @@ var LoginMethodContributionSchema = discriminatedUnion("kind", [
17201
18014
  icon: string().optional(),
17202
18015
  /** Addon-owned HTTP route the button navigates to (GET). */
17203
18016
  startUrl: string(),
17204
- stage: LoginStageEnum
18017
+ stage: LoginStageEnum,
18018
+ /**
18019
+ * The provider names an external identity a signed-in user can link to
18020
+ * their own account (D782): `auth.listLinkableProviders` /
18021
+ * `beginExternalLink` offer exactly the redirect methods that set this,
18022
+ * whatever their id. Absent / false — a login button only (magic-link).
18023
+ */
18024
+ linkable: boolean().optional()
17205
18025
  }),
17206
18026
  object({
17207
18027
  kind: literal("widget"),
@@ -18137,6 +18957,51 @@ method(object({}), array(TargetKindSchema)), method(object({}), array(TargetSche
18137
18957
  kind: "mutation",
18138
18958
  auth: "admin"
18139
18959
  });
18960
+ new Set([
18961
+ {
18962
+ id: "person",
18963
+ name: "Person"
18964
+ },
18965
+ {
18966
+ id: "vehicle",
18967
+ name: "Vehicle"
18968
+ },
18969
+ {
18970
+ id: "animal",
18971
+ name: "Animal"
18972
+ },
18973
+ {
18974
+ id: "package",
18975
+ name: "Package"
18976
+ }
18977
+ ].map((l) => l.id));
18978
+ var COCO_TO_MACRO = {
18979
+ mapping: {
18980
+ person: "person",
18981
+ bicycle: "vehicle",
18982
+ car: "vehicle",
18983
+ motorcycle: "vehicle",
18984
+ airplane: "vehicle",
18985
+ bus: "vehicle",
18986
+ train: "vehicle",
18987
+ truck: "vehicle",
18988
+ boat: "vehicle",
18989
+ bird: "animal",
18990
+ cat: "animal",
18991
+ dog: "animal",
18992
+ horse: "animal",
18993
+ sheep: "animal",
18994
+ cow: "animal",
18995
+ elephant: "animal",
18996
+ bear: "animal",
18997
+ zebra: "animal",
18998
+ giraffe: "animal",
18999
+ suitcase: "package",
19000
+ backpack: "package",
19001
+ handbag: "package"
19002
+ },
19003
+ preserveOriginal: false
19004
+ };
18140
19005
  var AUDIO_MACRO_LABELS = [
18141
19006
  {
18142
19007
  id: "speech",
@@ -20539,7 +21404,13 @@ var NcAlarmModeDelaysListSchema = array(object({
20539
21404
  * Absent = false (logged, not sent). Even when true it is not sent when that same sensor
20540
21405
  * is the one that starts the entry delay — the entry-delay notification already names it.
20541
21406
  */
20542
- notifySensorRewatched: boolean().optional()
21407
+ notifySensorRewatched: boolean().optional(),
21408
+ /**
21409
+ * D735: notify "ignored" when a sensor this arm bypassed really MOVED while armed (its own
21410
+ * change time is after the arm) and set nothing off. Absent = false (logged, not sent). A
21411
+ * re-sync, a recovery from `unavailable` or a duplicate is never announced, switch or not.
21412
+ */
21413
+ notifySensorIgnored: boolean().optional()
20543
21414
  })).max(8).refine(uniqueModes, { message: "modeDelays: at most one entry per arm mode" });
20544
21415
  var NcAlarmModeDelaysEditListSchema = array(object({
20545
21416
  mode: AlarmArmModeSchema,
@@ -20552,7 +21423,9 @@ var NcAlarmModeDelaysEditListSchema = array(object({
20552
21423
  /** D706: set the switch, or `null` to clear it (back to the default, false). */
20553
21424
  notifyDuringEntryDelay: boolean().nullable().optional(),
20554
21425
  /** D706: set the switch, or `null` to clear it (back to the default, false). */
20555
- notifySensorRewatched: boolean().nullable().optional()
21426
+ notifySensorRewatched: boolean().nullable().optional(),
21427
+ /** D735: set the switch, or `null` to clear it (back to the default, false). */
21428
+ notifySensorIgnored: boolean().nullable().optional()
20556
21429
  })).max(8).refine(uniqueModes, { message: "modeDelays: at most one edit per arm mode" });
20557
21430
  /** One switch of the alarm table: put ONE device on, or take it off, ONE mode's list. */
20558
21431
  var NcAlarmNonBlockingEditSchema = object({
@@ -21530,8 +22403,8 @@ Object.freeze(Object.fromEntries([{
21530
22403
  var CLUSTER_STEP_SETTING_FIELDS = [{
21531
22404
  stepId: "face-embedding",
21532
22405
  key: "minLandmarkFaceSize",
21533
- label: "Min face size for recognition (detection px)",
21534
- 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.",
22406
+ label: "Min face size to embed (detection-frame px)",
22407
+ 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.",
21535
22408
  type: "slider",
21536
22409
  min: 0,
21537
22410
  max: 64,
@@ -22504,8 +23377,23 @@ var RetrainMacroClassSchema = _enum([
22504
23377
  ]);
22505
23378
  /** A subject to learn, or a phantom to unlearn (taught by OMISSION). */
22506
23379
  var RetrainAnnotationKindSchema = _enum(["subject", "model_error"]);
22507
- /** Did a human draw this box, or did the assist propose it? */
22508
- var RetrainAnnotationSourceSchema = _enum(["operator", "assist"]);
23380
+ /**
23381
+ * Where a box came from. A machine-sourced box is a DRAFT on the page until
23382
+ * the operator confirms it; once saved it keeps its source as provenance.
23383
+ *
23384
+ * - `operator` — drawn by hand.
23385
+ * - `assist` — proposed by a detector run on the copy (the camera's own
23386
+ * model, or a larger teacher model).
23387
+ * - `pipeline` — the box the live pipeline actually drew on that frame, read
23388
+ * back from the track store (never a re-run).
23389
+ * - `llm` — proposed by a vision-capable LLM profile.
23390
+ */
23391
+ var RetrainAnnotationSourceSchema = _enum([
23392
+ "operator",
23393
+ "assist",
23394
+ "pipeline",
23395
+ "llm"
23396
+ ]);
22509
23397
  /** Normalised `[0,1]` rectangle against the FULL frame — the canonical form. */
22510
23398
  var RetrainBboxSchema = object({
22511
23399
  x: number(),
@@ -22523,7 +23411,8 @@ var RetrainBboxSchema = object({
22523
23411
  */
22524
23412
  var RetrainAnnotationSchema = object({
22525
23413
  id: string(),
22526
- trackId: string(),
23414
+ /** The frame's track. Absent on a recording still, which has none. */
23415
+ trackId: string().optional(),
22527
23416
  deviceId: number(),
22528
23417
  /** The COPY in retrain storage — never the source track's media key. */
22529
23418
  mediaKey: string(),
@@ -22572,18 +23461,63 @@ var RetrainFrameCandidateSchema = object({
22572
23461
  * fail, whatever became of the original. */
22573
23462
  copied: boolean()
22574
23463
  });
23464
+ /**
23465
+ * One box the live pipeline drew on a copied frame — what a correction starts
23466
+ * from. Derived when the frame is listed, from the track store: the subject
23467
+ * box recorded on the source media row when there is one, else the track
23468
+ * position nearest the frame's capture time. Never stored as an annotation
23469
+ * until the operator confirms it.
23470
+ */
23471
+ var RetrainPipelineBoxSchema = object({
23472
+ /** Normalised `[0,1]` against the full frame. */
23473
+ bbox: RetrainBboxSchema,
23474
+ macroClass: RetrainMacroClassSchema,
23475
+ label: string().optional(),
23476
+ subLabel: string().optional(),
23477
+ /** The detection score of the position used, when it was recorded. */
23478
+ score: number().optional(),
23479
+ /** The root model that produced the track, when it was recorded. */
23480
+ modelId: string().optional(),
23481
+ trackId: string(),
23482
+ /** `subject-box`: recorded on this very frame. `position`: the track's
23483
+ * position nearest the capture time, `deltaMs` away. */
23484
+ basis: _enum(["subject-box", "position"]),
23485
+ deltaMs: number()
23486
+ });
23487
+ /**
23488
+ * Where a retrain frame came from: a TRACK's stored media (copy-on-select),
23489
+ * or the RECORDING at an instant — the frame a model saw nothing in has no
23490
+ * track at all.
23491
+ */
23492
+ var RetrainFrameOriginSchema = _enum(["track", "recording"]);
22575
23493
  /** A frame the dataset OWNS: bytes copied at selection time. */
22576
23494
  var RetrainFrameSchema = object({
22577
23495
  frameId: string(),
22578
23496
  deviceId: number(),
22579
- trackId: string(),
22580
- /** Provenance only. It may already point at nothing — that is expected. */
22581
- sourceMediaId: number().int(),
23497
+ origin: RetrainFrameOriginSchema,
23498
+ /** The track it was copied from. Absent on a recording still. */
23499
+ trackId: string().optional(),
23500
+ /** Provenance only. It may already point at nothing — that is expected.
23501
+ * Absent on a recording still. */
23502
+ sourceMediaId: number().int().optional(),
23503
+ /** A recording still: the playhead instant it was taken at. */
23504
+ epochMs: number().optional(),
22582
23505
  sourceKind: MediaFileKindEnum,
22583
23506
  sizeBytes: number().int(),
22584
23507
  width: number().int(),
22585
23508
  height: number().int(),
22586
- copiedAt: number()
23509
+ copiedAt: number(),
23510
+ /** When the CAMERA captured the frame. Absent on a copy taken before D785. */
23511
+ capturedAt: number().optional(),
23512
+ /** The operator's "every subject in this frame is boxed". Detector
23513
+ * evaluation keeps only complete frames: an unboxed subject would count as
23514
+ * a false positive. */
23515
+ complete: boolean(),
23516
+ /** The boxes the pipeline drew on this frame. Present on list answers;
23517
+ * empty when nothing the track store holds can be placed on it. */
23518
+ pipelineBoxes: array(RetrainPipelineBoxSchema).readonly().optional(),
23519
+ /** The named collections this frame belongs to. Present on list answers. */
23520
+ collectionIds: array(string()).readonly().optional()
22587
23521
  });
22588
23522
  /** Why a copy-on-select could not be honoured — named, never a silent skip. */
22589
23523
  var RetrainCopyRefusalSchema = _enum([
@@ -22604,6 +23538,53 @@ var RetrainFrameListSchema = object({
22604
23538
  /** What the page pre-selects — the native key frame when one survives. */
22605
23539
  autoPickMediaId: number().int().optional()
22606
23540
  });
23541
+ /**
23542
+ * Which frames an annotated export carries. Every field narrows; an empty
23543
+ * filter is every annotated copy. A dataset VERSION is a frozen `frameIds`
23544
+ * list owned by whoever trains (the training orchestrator), so `frameIds` is
23545
+ * the primitive a version export uses; `batchId` re-selects what an earlier
23546
+ * export carried (`exportedInBatch`).
23547
+ */
23548
+ var RetrainExportFilterSchema = object({
23549
+ deviceIds: array(number()).optional(),
23550
+ frameIds: array(string()).max(2e4).optional(),
23551
+ /** Only frames in at least one of these named collections. */
23552
+ collectionIds: array(string()).max(200).optional(),
23553
+ batchId: string().optional(),
23554
+ /** Only frames the operator marked complete (all subjects boxed). */
23555
+ completeOnly: boolean().optional()
23556
+ });
23557
+ /**
23558
+ * `frames`: the full frame copies, boxes in `annotations.json`.
23559
+ * `crops`: additionally one JPEG per subject, cut with the runtime detail-crop
23560
+ * convention — the classifier layout.
23561
+ */
23562
+ var RetrainExportLayoutSchema = _enum(["frames", "crops"]);
23563
+ /**
23564
+ * Where `writeRetrainArchive` streams the tar: one HTTP request whose body is
23565
+ * the archive, sent chunk by chunk. Covers a presigned PUT and a provider
23566
+ * addon's data-plane upload route alike. Headers are sent verbatim and never
23567
+ * logged.
23568
+ */
23569
+ var RetrainArchiveTargetSchema = object({
23570
+ kind: literal("http"),
23571
+ method: _enum(["PUT", "POST"]),
23572
+ url: string().url(),
23573
+ headers: record(string(), string()).optional()
23574
+ });
23575
+ var RetrainArchiveResultSchema = object({
23576
+ batchId: string(),
23577
+ frames: number().int(),
23578
+ crops: number().int(),
23579
+ annotations: number().int(),
23580
+ /** Frames planned but not shipped (unreadable copy, path too long). */
23581
+ missing: number().int(),
23582
+ bytes: number().int(),
23583
+ /** sha256 of the exact bytes sent. */
23584
+ sha256: string(),
23585
+ /** The target's HTTP status. */
23586
+ status: number().int()
23587
+ });
22607
23588
  /** What the operator asked the assist to look for. */
22608
23589
  var RetrainAssistSubjectSchema = discriminatedUnion("kind", [object({
22609
23590
  kind: literal("package"),
@@ -22633,6 +23614,109 @@ var RetrainAssistResultSchema = discriminatedUnion("kind", [object({
22633
23614
  reason: string(),
22634
23615
  detail: string().optional()
22635
23616
  })]);
23617
+ /** A named set over the retrain corpus — membership only, it owns no pixels. */
23618
+ var RetrainCollectionSchema = object({
23619
+ id: string(),
23620
+ name: string(),
23621
+ createdAt: number(),
23622
+ frameCount: number().int()
23623
+ });
23624
+ var RetrainCollectionCreateResultSchema = discriminatedUnion("kind", [object({
23625
+ kind: literal("created"),
23626
+ collection: RetrainCollectionSchema
23627
+ }), object({
23628
+ kind: literal("refused"),
23629
+ reason: _enum(["empty-name", "duplicate-name"])
23630
+ })]);
23631
+ var RetrainCollectionRenameResultSchema = discriminatedUnion("kind", [object({
23632
+ kind: literal("renamed"),
23633
+ collection: RetrainCollectionSchema
23634
+ }), object({
23635
+ kind: literal("refused"),
23636
+ reason: _enum([
23637
+ "empty-name",
23638
+ "duplicate-name",
23639
+ "unknown-collection"
23640
+ ])
23641
+ })]);
23642
+ /**
23643
+ * The outcome of adding the frame at a recording instant. Every refusal is
23644
+ * named: `still-unavailable` (not recording, a gap, or an undecodable frame —
23645
+ * `detail` says which), `still-busy` (the recorder is at its decode bound; try
23646
+ * again), `unreadable-image`, `write-failed`, `unknown-collection`.
23647
+ */
23648
+ var AddRetrainFrameFromRecordingResultSchema = discriminatedUnion("kind", [object({
23649
+ kind: literal("added"),
23650
+ collectionId: string(),
23651
+ frame: RetrainFrameSchema,
23652
+ /** The moment was already in the dataset; nothing was decoded. */
23653
+ reused: boolean()
23654
+ }), object({
23655
+ kind: literal("refused"),
23656
+ reason: _enum([
23657
+ "unknown-collection",
23658
+ "still-unavailable",
23659
+ "still-busy",
23660
+ "unreadable-image",
23661
+ "write-failed"
23662
+ ]),
23663
+ detail: string().optional()
23664
+ })]);
23665
+ /** A vision LLM profile the AI assist may use, and where it sends the frame. */
23666
+ var RetrainAssistProfileSchema = object({
23667
+ id: string(),
23668
+ name: string(),
23669
+ model: string(),
23670
+ kind: string(),
23671
+ /** `true` when the frame would leave the house (a cloud vendor, or an
23672
+ * endpoint that is not on the local network). The page confirms each such
23673
+ * run, and the provider refuses one without `allowCloud`. */
23674
+ leavesHouse: boolean()
23675
+ });
23676
+ /** A box the AI assist proposed: a draft, plus the model's own reason. */
23677
+ var RetrainLlmProposalSchema = RetrainAnnotationDraftSchema.extend({ reason: string() });
23678
+ /** What the AI assist said about a box that was already on the canvas. */
23679
+ var RetrainLlmReviewSchema = object({
23680
+ /** The `ref` the page sent the box under. */
23681
+ ref: string(),
23682
+ verdict: _enum([
23683
+ "confirmed",
23684
+ "wrong-class",
23685
+ "not-an-object",
23686
+ "uncertain"
23687
+ ]),
23688
+ suggestedClass: RetrainMacroClassSchema.optional(),
23689
+ reason: string()
23690
+ });
23691
+ /**
23692
+ * The AI assist's answer. `proposed` carries drafts (`source: 'llm'`, the
23693
+ * model and its confidence) and reviews; items the model got wrong (a box off
23694
+ * the frame, an unasked class, an unknown ref) are dropped and counted in
23695
+ * `rejected`. A whole answer that is not the schema is `malformed-answer`.
23696
+ */
23697
+ var RetrainLlmAssistResultSchema = discriminatedUnion("kind", [object({
23698
+ kind: literal("proposed"),
23699
+ profileId: string(),
23700
+ model: string(),
23701
+ /** The frame was sent outside the house for this answer. */
23702
+ leftHouse: boolean(),
23703
+ proposals: array(RetrainLlmProposalSchema).readonly(),
23704
+ reviews: array(RetrainLlmReviewSchema).readonly(),
23705
+ rejected: number().int()
23706
+ }), object({
23707
+ kind: literal("refused"),
23708
+ reason: _enum([
23709
+ "unknown-frame",
23710
+ "unreadable-frame",
23711
+ "unknown-profile",
23712
+ "profile-disabled",
23713
+ "no-vision",
23714
+ "cloud-not-confirmed",
23715
+ "llm-error",
23716
+ "malformed-answer"
23717
+ ]),
23718
+ detail: string().optional()
23719
+ })]);
22636
23720
  /** The outcome of a lifecycle move owned by the retrain page. */
22637
23721
  var RetrainTransitionResultSchema = object({
22638
23722
  trackId: string(),
@@ -23350,7 +24434,7 @@ DeviceType.Camera, method(object({ deviceId: number() }), array(TrackSchema).rea
23350
24434
  auth: "admin"
23351
24435
  }), method(object({
23352
24436
  deviceId: number(),
23353
- trackId: string(),
24437
+ trackId: string().optional(),
23354
24438
  frameId: string()
23355
24439
  }), object({
23356
24440
  removed: boolean(),
@@ -23367,7 +24451,8 @@ DeviceType.Camera, method(object({ deviceId: number() }), array(TrackSchema).rea
23367
24451
  auth: "admin"
23368
24452
  }), method(object({
23369
24453
  deviceId: number(),
23370
- trackId: string(),
24454
+ /** The frame's track, when it has one — checked against the frame. */
24455
+ trackId: string().optional(),
23371
24456
  frameId: string(),
23372
24457
  subject: RetrainAssistSubjectSchema,
23373
24458
  /** Which node runs it. Absent ⇒ wherever an unowned call lands. */
@@ -23375,12 +24460,16 @@ DeviceType.Camera, method(object({ deviceId: number() }), array(TrackSchema).rea
23375
24460
  }), RetrainAssistResultSchema, {
23376
24461
  kind: "mutation",
23377
24462
  auth: "admin"
23378
- }), method(object({ trackId: string() }), array(RetrainAnnotationSchema).readonly(), {
24463
+ }), method(object({
24464
+ trackId: string().optional(),
24465
+ frameIds: array(string()).max(2e3).optional()
24466
+ }), array(RetrainAnnotationSchema).readonly(), {
23379
24467
  kind: "query",
23380
24468
  auth: "admin"
23381
24469
  }), method(object({
23382
24470
  deviceId: number(),
23383
- trackId: string(),
24471
+ /** The frame's track, when it has one — checked against the frame. */
24472
+ trackId: string().optional(),
23384
24473
  frameId: string(),
23385
24474
  annotations: array(RetrainAnnotationDraftSchema)
23386
24475
  }), array(RetrainAnnotationSchema).readonly(), {
@@ -23398,7 +24487,91 @@ DeviceType.Camera, method(object({ deviceId: number() }), array(TrackSchema).rea
23398
24487
  }), RetrainTransitionResultSchema, {
23399
24488
  kind: "mutation",
23400
24489
  auth: "admin"
23401
- }), method(object({ deviceIds: array(number()).optional() }), object({ url: string() }), {
24490
+ }), method(RetrainExportFilterSchema.extend({ layout: RetrainExportLayoutSchema.optional() }), object({ url: string() }), {
24491
+ kind: "query",
24492
+ auth: "admin"
24493
+ }), method(object({
24494
+ deviceId: number(),
24495
+ trackId: string().optional(),
24496
+ frameId: string(),
24497
+ complete: boolean()
24498
+ }), RetrainFrameSchema, {
24499
+ kind: "mutation",
24500
+ auth: "admin"
24501
+ }), method(object({
24502
+ filter: RetrainExportFilterSchema,
24503
+ layout: RetrainExportLayoutSchema,
24504
+ target: RetrainArchiveTargetSchema
24505
+ }), RetrainArchiveResultSchema, {
24506
+ kind: "mutation",
24507
+ auth: "admin",
24508
+ timeoutMs: 60 * 6e4
24509
+ }), method(object({}), array(RetrainAssistProfileSchema).readonly(), {
24510
+ kind: "query",
24511
+ auth: "admin"
24512
+ }), method(object({
24513
+ deviceId: number(),
24514
+ trackId: string().optional(),
24515
+ frameId: string(),
24516
+ profileId: string(),
24517
+ classes: array(RetrainMacroClassSchema).min(1),
24518
+ boxes: array(object({
24519
+ ref: string(),
24520
+ bbox: RetrainBboxSchema,
24521
+ macroClass: RetrainMacroClassSchema,
24522
+ label: string().optional()
24523
+ })).max(50),
24524
+ allowCloud: boolean()
24525
+ }), RetrainLlmAssistResultSchema, {
24526
+ kind: "mutation",
24527
+ auth: "admin",
24528
+ timeoutMs: 18e4
24529
+ }), method(object({ name: string().max(120) }), RetrainCollectionCreateResultSchema, {
24530
+ kind: "mutation",
24531
+ auth: "admin"
24532
+ }), method(object({}), array(RetrainCollectionSchema).readonly(), {
24533
+ kind: "query",
24534
+ auth: "admin"
24535
+ }), method(object({
24536
+ id: string(),
24537
+ name: string().max(120)
24538
+ }), RetrainCollectionRenameResultSchema, {
24539
+ kind: "mutation",
24540
+ auth: "admin"
24541
+ }), method(object({ id: string() }), object({
24542
+ deleted: boolean(),
24543
+ removedFrames: number().int()
24544
+ }), {
24545
+ kind: "mutation",
24546
+ auth: "admin"
24547
+ }), method(object({
24548
+ collectionId: string(),
24549
+ deviceId: number(),
24550
+ epochMs: number()
24551
+ }), AddRetrainFrameFromRecordingResultSchema, {
24552
+ kind: "mutation",
24553
+ auth: "admin",
24554
+ timeoutMs: 6e4
24555
+ }), method(object({
24556
+ collectionId: string(),
24557
+ frameIds: array(string()).min(1).max(500)
24558
+ }), object({
24559
+ added: number().int(),
24560
+ alreadyMember: number().int(),
24561
+ unknownFrameIds: array(string()).readonly()
24562
+ }), {
24563
+ kind: "mutation",
24564
+ auth: "admin"
24565
+ }), method(object({
24566
+ collectionId: string(),
24567
+ frameId: string()
24568
+ }), object({
24569
+ removed: boolean(),
24570
+ deletedFrame: boolean()
24571
+ }), {
24572
+ kind: "mutation",
24573
+ auth: "admin"
24574
+ }), method(object({ collectionId: string() }), array(RetrainFrameSchema).readonly(), {
23402
24575
  kind: "query",
23403
24576
  auth: "admin"
23404
24577
  }), method(object({
@@ -23451,6 +24624,34 @@ DeviceType.Camera, method(object({ deviceId: number() }), array(TrackSchema).rea
23451
24624
  timestamp: number()
23452
24625
  });
23453
24626
  /**
24627
+ * A root model's boxes standing in for one crop-kind step's own inference
24628
+ * (D730) — see `runPipeline.suppliedRoot`.
24629
+ */
24630
+ var SuppliedRootOutputSchema = object({
24631
+ stepId: string(),
24632
+ /** The root model that drew the boxes — stamped on the result. */
24633
+ modelId: string(),
24634
+ detections: array(object({
24635
+ /** `[x1, y1, x2, y2]` in the pixels of the call's image. */
24636
+ bbox: tuple([
24637
+ number(),
24638
+ number(),
24639
+ number(),
24640
+ number()
24641
+ ]),
24642
+ score: number(),
24643
+ /**
24644
+ * Five facial landmarks in the same pixels — a face the step's own
24645
+ * detector already re-found inside a root face box (D730), so its
24646
+ * embedder child aligns it exactly as it aligns any detected face.
24647
+ */
24648
+ landmarks: array(object({
24649
+ x: number(),
24650
+ y: number()
24651
+ })).optional()
24652
+ })).min(1)
24653
+ });
24654
+ /**
23454
24655
  * Reference to the frame's retained NATIVE surface + the parent crop's placement
23455
24656
  * within the frame, so the executor can re-cut a leaf child ROI at native
23456
24657
  * resolution on the detail plane. See the `runPipeline` `nativeCropRef` field.
@@ -23498,7 +24699,7 @@ var FrameRefSchema = object({
23498
24699
  timestamp: number(),
23499
24700
  capturedAt: number().optional()
23500
24701
  });
23501
- var ModelFormatSchema$1 = _enum([
24702
+ var ModelFormatSchema$2 = _enum([
23502
24703
  "onnx",
23503
24704
  "coreml",
23504
24705
  "openvino",
@@ -23516,7 +24717,7 @@ var PipelineSlotSchema = _enum([
23516
24717
  var PipelineEngineChoiceSchema = object({
23517
24718
  runtime: literal("python"),
23518
24719
  backend: string(),
23519
- format: ModelFormatSchema$1,
24720
+ format: ModelFormatSchema$2,
23520
24721
  device: string().optional()
23521
24722
  });
23522
24723
  /**
@@ -23555,33 +24756,15 @@ var PipelineDefaultStepSchema = lazy(() => object({
23555
24756
  group: string().optional(),
23556
24757
  settings: record(string(), unknown()).optional()
23557
24758
  }));
23558
- var PipelineTemplateStepSchema = lazy(() => object({
23559
- addonId: string(),
23560
- enabled: boolean(),
23561
- modelId: string(),
23562
- children: array(PipelineTemplateStepSchema).readonly(),
23563
- settings: record(string(), unknown()).optional()
23564
- }));
23565
- var PipelineTemplateSchema$1 = object({
23566
- id: string(),
23567
- name: string(),
23568
- createdAt: string(),
23569
- updatedAt: string(),
23570
- engine: PipelineEngineChoiceSchema,
23571
- steps: array(PipelineTemplateStepSchema).readonly()
23572
- });
23573
24759
  var PipelineModelOptionSchema = object({
23574
24760
  id: string(),
23575
24761
  name: string(),
23576
- formats: record(string(), object({
23577
- downloaded: boolean(),
23578
- sizeMB: number()
23579
- })),
24762
+ formats: record(string(), PipelineModelFormatStatusSchema),
23580
24763
  group: ModelVariantGroupSchema.optional(),
23581
24764
  legacy: boolean().optional(),
23582
24765
  provider: ModelProviderIdSchema.optional(),
23583
24766
  defaultConfidence: number().optional(),
23584
- fillsClassifierEffects: array(FillsClassifierEffectSchema).readonly().optional()
24767
+ suppliesSteps: array(RootStepSupplySchema).readonly().optional()
23585
24768
  });
23586
24769
  var ConfigFieldBridge = custom();
23587
24770
  var PipelineAddonSchemaSchema = object({
@@ -23743,6 +24926,22 @@ method(_void(), array(PipelineEngineChoiceSchema)), method(_void(), PipelineEngi
23743
24926
  }), {
23744
24927
  kind: "mutation",
23745
24928
  auth: "admin"
24929
+ }), method(object({
24930
+ nodeId: string(),
24931
+ deviceIds: array(number()).readonly().optional(),
24932
+ dryRun: boolean()
24933
+ }), object({
24934
+ entries: array(object({
24935
+ deviceId: number(),
24936
+ keys: array(string()).readonly()
24937
+ })).readonly(),
24938
+ refused: array(object({
24939
+ deviceId: number(),
24940
+ reason: string()
24941
+ })).readonly()
24942
+ }), {
24943
+ kind: "mutation",
24944
+ auth: "admin"
23746
24945
  }), method(object({ nodeId: string() }), object({ unhealthy: array(object({
23747
24946
  /** `<backend>:<device>`, e.g. `openvino:gpu`. */
23748
24947
  deviceKey: string(),
@@ -23768,22 +24967,14 @@ method(_void(), array(PipelineEngineChoiceSchema)), method(_void(), PipelineEngi
23768
24967
  }), method(_void(), PipelineSchemaSchema), method(_void(), array(PipelineDefaultStepSchema).readonly().nullable()), method(_void(), PipelineConfigBridge), method(_void(), ConfigUISchemaBridge), method(object({
23769
24968
  steps: array(PipelineStepInputSchema),
23770
24969
  deviceKey: string().optional()
23771
- }), PipelineValidationResultSchema), method(_void(), array(PipelineTemplateSchema$1).readonly()), method(object({
23772
- name: string(),
23773
- steps: array(PipelineTemplateStepSchema).readonly(),
23774
- engine: PipelineEngineChoiceSchema
23775
- }), PipelineTemplateSchema$1, { kind: "mutation" }), method(object({
23776
- id: string(),
23777
- name: string().optional(),
23778
- steps: array(PipelineTemplateStepSchema).readonly().optional()
23779
- }), PipelineTemplateSchema$1, { kind: "mutation" }), method(object({ id: string() }), _void(), { kind: "mutation" }), method(_void(), InferenceCapabilitiesBridge), method(object({ addonId: string() }), ModelAvailabilityListBridge), method(object({
24970
+ }), PipelineValidationResultSchema), method(_void(), InferenceCapabilitiesBridge), method(object({ addonId: string() }), ModelAvailabilityListBridge), method(object({
23780
24971
  addonId: string(),
23781
24972
  modelId: string(),
23782
- format: ModelFormatSchema$1
24973
+ format: ModelFormatSchema$2
23783
24974
  }), DownloadModelResultSchema, { kind: "mutation" }), method(object({
23784
24975
  addonId: string(),
23785
24976
  modelId: string(),
23786
- format: ModelFormatSchema$1
24977
+ format: ModelFormatSchema$2
23787
24978
  }), object({ success: literal(true) }), { kind: "mutation" }), method(object({
23788
24979
  steps: array(PipelineStepInputSchema).min(1),
23789
24980
  frame: FrameInputSchema.optional(),
@@ -23849,7 +25040,16 @@ method(_void(), array(PipelineEngineChoiceSchema)), method(_void(), PipelineEngi
23849
25040
  * `device-not-servable`), and nothing reaches the camera's live
23850
25041
  * trace stream. Absent ⇒ unchanged behaviour.
23851
25042
  */
23852
- replay: literal(true).optional()
25043
+ replay: literal(true).optional(),
25044
+ /**
25045
+ * Root-supplied detections for the tree's ROOT step (D730). Set by
25046
+ * `runDetailSubtree` when the camera's root model supplies a crop-kind
25047
+ * step (a Frigate+ `license_plate` for `plate-detection`): the step is
25048
+ * NOT inferred, these boxes are its output, and its children (the plate
25049
+ * reader) run on them through their own crop policy. Boxes are in the
25050
+ * PIXELS of the image this call carries. Absent ⇒ the root step runs.
25051
+ */
25052
+ suppliedRoot: SuppliedRootOutputSchema.optional()
23853
25053
  }), PipelineRunResultBridge, { kind: "mutation" }), method(object({
23854
25054
  steps: array(PipelineStepInputSchema).min(1),
23855
25055
  frames: array(FrameInputSchema).min(1).max(255),
@@ -23931,6 +25131,763 @@ method(_void(), array(PipelineEngineChoiceSchema)), method(_void(), PipelineEngi
23931
25131
  filename: string().optional(),
23932
25132
  settings: record(string(), unknown()).optional()
23933
25133
  }), AudioTestResultSchema, { kind: "mutation" }), method(_void(), ConfigUISchemaNullableBridge);
25134
+ /**
25135
+ * The wire shapes of the Auto tune plan and apply (D745), used by the
25136
+ * `pipeline-orchestrator` cap. The recommender's own types
25137
+ * (`recommend.ts`) are the TS face of the same data; these
25138
+ * schemas are what crosses the cap boundary.
25139
+ */
25140
+ var ModelFormatSchema$1 = _enum(MODEL_FORMATS);
25141
+ /** The operator's range for it. */
25142
+ var MIN_SESSIONS_PER_DEVICE_RANGE = {
25143
+ min: 1,
25144
+ max: 8
25145
+ };
25146
+ var HardwareClassIdSchema = _enum([
25147
+ "intel-core-ultra",
25148
+ "intel-n-series",
25149
+ "apple-m-base",
25150
+ "apple-m-pro",
25151
+ "unknown"
25152
+ ]);
25153
+ var AcceleratorKindSchema = _enum([
25154
+ "intel-npu",
25155
+ "intel-igpu",
25156
+ "x86-cpu",
25157
+ "arm-cpu",
25158
+ "apple-ane",
25159
+ "coral"
25160
+ ]);
25161
+ var RecommendationReasonSchema = discriminatedUnion("kind", [
25162
+ object({
25163
+ kind: literal("capacity"),
25164
+ sessions: number(),
25165
+ minSessions: number()
25166
+ }),
25167
+ object({
25168
+ kind: literal("tie-faster"),
25169
+ over: string(),
25170
+ recallDelta: number()
25171
+ }),
25172
+ object({
25173
+ kind: literal("stepped-down"),
25174
+ from: string(),
25175
+ to: string(),
25176
+ limitedBy: string()
25177
+ }),
25178
+ object({
25179
+ kind: literal("no-fit-lightest"),
25180
+ sessions: number(),
25181
+ minSessions: number()
25182
+ }),
25183
+ object({
25184
+ kind: literal("derived-latency"),
25185
+ modelId: string()
25186
+ }),
25187
+ object({ kind: literal("cpu-device") }),
25188
+ object({ kind: literal("coral-untouched") }),
25189
+ object({ kind: literal("device-disabled") }),
25190
+ object({ kind: literal("device-unavailable") }),
25191
+ object({ kind: literal("node-offline") }),
25192
+ object({ kind: literal("no-hardware-facts") }),
25193
+ object({
25194
+ kind: literal("no-measured-data"),
25195
+ hardwareClass: HardwareClassIdSchema
25196
+ }),
25197
+ object({
25198
+ kind: literal("no-family-build"),
25199
+ format: ModelFormatSchema$1
25200
+ }),
25201
+ object({
25202
+ kind: literal("kept-custom-pin"),
25203
+ modelId: string(),
25204
+ deviceKey: string()
25205
+ })
25206
+ ]);
25207
+ /** Why a device is left exactly as it is, whatever the plan would pick (D786). */
25208
+ var KeptReasonSchema = _enum(["custom-pin"]);
25209
+ /**
25210
+ * Where a choice's latency came from (D791): this node's own benchmark
25211
+ * result, or the hardware-class table. Measured on the node beats the table.
25212
+ */
25213
+ var LatencySourceSchema = discriminatedUnion("kind", [object({ kind: literal("table") }), object({
25214
+ kind: literal("node-benchmark"),
25215
+ resultId: string(),
25216
+ measuredAtMs: number()
25217
+ })]);
25218
+ var DeviceModelChoiceSchema = object({
25219
+ modelId: string(),
25220
+ p50Ms: number(),
25221
+ fps: number(),
25222
+ measured: boolean(),
25223
+ /** Absent on a plan from before D791 — read as the table. */
25224
+ source: LatencySourceSchema.optional(),
25225
+ /** Parallel sessions at the camera rate with the headroom kept free: ⌊fps × (1 − headroom) / camera fps⌋. */
25226
+ capacitySessions: number(),
25227
+ personRecall: number()
25228
+ });
25229
+ var DeviceRecommendationSchema = object({
25230
+ deviceKey: string(),
25231
+ accelerator: AcceleratorKindSchema.nullable(),
25232
+ enabled: boolean(),
25233
+ available: boolean(),
25234
+ chosen: DeviceModelChoiceSchema.nullable(),
25235
+ /** Present when the device is kept as is: Apply writes nothing on it. */
25236
+ kept: KeptReasonSchema.optional(),
25237
+ reasons: array(RecommendationReasonSchema).readonly()
25238
+ });
25239
+ var NodeRecommendationSchema = object({
25240
+ nodeId: string(),
25241
+ reachable: boolean(),
25242
+ hardwareClass: HardwareClassIdSchema.nullable(),
25243
+ cpuModel: string().nullable(),
25244
+ skipped: boolean(),
25245
+ acceleratorModelId: string().nullable(),
25246
+ devices: array(DeviceRecommendationSchema).readonly(),
25247
+ reasons: array(RecommendationReasonSchema).readonly()
25248
+ });
25249
+ var ModelPinChangeSchema = object({
25250
+ stepId: string(),
25251
+ before: string().nullable(),
25252
+ after: string().nullable()
25253
+ });
25254
+ var NodeDeviceChangeSchema = object({
25255
+ nodeId: string(),
25256
+ deviceKey: string(),
25257
+ madeExplicit: boolean(),
25258
+ modelPins: array(ModelPinChangeSchema).readonly(),
25259
+ thresholds: array(object({
25260
+ stepId: string(),
25261
+ keys: array(string()).readonly()
25262
+ })).readonly()
25263
+ });
25264
+ var CameraOverrideClearSchema = object({
25265
+ deviceId: number(),
25266
+ source: _enum(["step-override", "wholesale"]),
25267
+ nodeId: string(),
25268
+ deviceKey: string().nullable(),
25269
+ stepId: string(),
25270
+ modelIdBefore: string().nullable(),
25271
+ keys: array(string()).readonly()
25272
+ });
25273
+ var DetectorStoreClearSchema = object({
25274
+ deviceId: number(),
25275
+ keys: array(string()).readonly()
25276
+ });
25277
+ var AutoTuneWarningSchema = discriminatedUnion("kind", [
25278
+ object({
25279
+ kind: literal("detector-store-cluster-wide"),
25280
+ skippedNodes: array(string()).readonly()
25281
+ }),
25282
+ object({
25283
+ kind: literal("detector-store-unreadable"),
25284
+ error: string()
25285
+ }),
25286
+ object({
25287
+ kind: literal("coral-enabled"),
25288
+ nodeId: string(),
25289
+ deviceKey: string()
25290
+ }),
25291
+ object({
25292
+ kind: literal("custom-pin-kept"),
25293
+ nodeId: string(),
25294
+ deviceKey: string().nullable(),
25295
+ deviceId: number().nullable(),
25296
+ modelId: string()
25297
+ }),
25298
+ object({
25299
+ kind: literal("custom-registry-unreadable"),
25300
+ error: string()
25301
+ })
25302
+ ]);
25303
+ var AutoTuneOptionsSchema = object({
25304
+ /** Share of each accelerator's throughput kept free (0.3–0.5). */
25305
+ headroom: number().min(.3).max(.5).default(.4),
25306
+ /**
25307
+ * The least number of parallel sessions every device must sustain at the
25308
+ * camera rate with the headroom kept free (D755). The most accurate model
25309
+ * that reaches it wins.
25310
+ */
25311
+ minSessionsPerDevice: number().int().min(MIN_SESSIONS_PER_DEVICE_RANGE.min).max(MIN_SESSIONS_PER_DEVICE_RANGE.max).default(2)
25312
+ });
25313
+ var AutoTunePlanSchema = object({
25314
+ /** Hash of everything the apply will write — the apply refuses a different one. */
25315
+ planHash: string(),
25316
+ family: literal("yolov9"),
25317
+ headroom: number(),
25318
+ minSessionsPerDevice: number(),
25319
+ /** The detection rate a session is counted at (the fastest camera running the pipeline root). */
25320
+ cameraFps: number(),
25321
+ generatedAt: number(),
25322
+ nodes: array(NodeRecommendationSchema).readonly(),
25323
+ nodeChanges: array(NodeDeviceChangeSchema).readonly(),
25324
+ cameraClears: array(CameraOverrideClearSchema).readonly(),
25325
+ detectorStoreClears: array(DetectorStoreClearSchema).readonly(),
25326
+ warnings: array(AutoTuneWarningSchema).readonly()
25327
+ });
25328
+ var AutoTuneApplyInputSchema = object({
25329
+ planHash: string(),
25330
+ headroom: number().min(.3).max(.5).default(.4),
25331
+ minSessionsPerDevice: number().int().min(MIN_SESSIONS_PER_DEVICE_RANGE.min).max(MIN_SESSIONS_PER_DEVICE_RANGE.max).default(2)
25332
+ });
25333
+ var AutoTunePhaseResultSchema = object({
25334
+ phase: _enum([
25335
+ "download",
25336
+ "camera-overrides",
25337
+ "detector-thresholds",
25338
+ "node-models",
25339
+ "redispatch"
25340
+ ]),
25341
+ ok: boolean(),
25342
+ detail: string()
25343
+ });
25344
+ var AutoTuneApplyResultSchema = discriminatedUnion("kind", [
25345
+ object({
25346
+ kind: literal("applied"),
25347
+ planHash: string(),
25348
+ phases: array(AutoTunePhaseResultSchema).readonly()
25349
+ }),
25350
+ object({
25351
+ kind: literal("aborted"),
25352
+ phases: array(AutoTunePhaseResultSchema).readonly()
25353
+ }),
25354
+ object({
25355
+ kind: literal("stale"),
25356
+ plan: AutoTunePlanSchema
25357
+ }),
25358
+ object({
25359
+ kind: literal("refused"),
25360
+ reason: _enum(["apply-in-progress"])
25361
+ })
25362
+ ]);
25363
+ /**
25364
+ * Wire shapes of the Load balancing surface (D748): the session placement
25365
+ * policy, the atomic share write, the observed placement statistics, the
25366
+ * hardware share suggestion and the stale device pins.
25367
+ */
25368
+ /**
25369
+ * How a new detection session picks its node and device.
25370
+ * - `least-loaded` — the historical rule: lowest `attached / weight`, a
25371
+ * constant node order at a tie (D37). An idle node always ties at 0, so a
25372
+ * weight only bites once a node already holds a session.
25373
+ * - `share` — the share of PARALLEL sessions is held to the weights, and a
25374
+ * full or drowning node yields to a free one (D748).
25375
+ */
25376
+ var SessionPlacementPolicySchema = _enum(["least-loaded", "share"]);
25377
+ var LoadBalancingSharesInputSchema = object({
25378
+ /** nodeId → share (> 0). A node left out keeps its weight. */
25379
+ nodes: record(string(), number().positive()).default({}),
25380
+ /** nodeId → deviceKey → share (> 0). A device left out keeps its weight. */
25381
+ devices: record(string(), record(string(), number().positive())).default({})
25382
+ });
25383
+ var PlacementStatsInputSchema = object({
25384
+ /** Window the observed shares are averaged over (default 1 h, max 24 h). */
25385
+ windowMs: number().int().min(6e4).max(1440 * 60 * 1e3).default(3600 * 1e3) });
25386
+ var PlacementDeviceStatsSchema = object({
25387
+ deviceKey: string(),
25388
+ /** Sessions running on this device now. */
25389
+ sessionsNow: number(),
25390
+ /** Sessions started on this device inside the window. */
25391
+ sessionsStarted: number(),
25392
+ /** Time-weighted share of the node's parallel sessions over the window (0–1); null = no session ran. */
25393
+ observedShare: number().nullable()
25394
+ });
25395
+ var PlacementNodeStatsSchema = object({
25396
+ nodeId: string(),
25397
+ sessionsNow: number(),
25398
+ sessionsStarted: number(),
25399
+ /** Time-weighted share of the cluster's parallel sessions over the window (0–1); null = none ran. */
25400
+ observedShare: number().nullable(),
25401
+ /** Most sessions this node ran at once inside the window. */
25402
+ peakSessions: number(),
25403
+ /** Sessions a share election handed elsewhere because this node was full or drowning. */
25404
+ yieldsAway: number(),
25405
+ devices: array(PlacementDeviceStatsSchema).readonly()
25406
+ });
25407
+ /** A camera's device pin that the session path cannot honour. */
25408
+ var StaleDevicePinSchema = object({
25409
+ deviceId: number(),
25410
+ deviceKey: string(),
25411
+ /** `disabled` — the key exists on some node but is not enabled anywhere; `absent` — no node has it. */
25412
+ reason: _enum(["disabled", "absent"])
25413
+ });
25414
+ var PlacementStatsSchema = object({
25415
+ policy: SessionPlacementPolicySchema,
25416
+ windowMs: number(),
25417
+ /** How much of the window was actually observed (the hub keeps it in memory). */
25418
+ observedForMs: number(),
25419
+ sessionsNow: number(),
25420
+ /** Most parallel sessions across the cluster inside the window. */
25421
+ clusterPeakSessions: number(),
25422
+ nodes: array(PlacementNodeStatsSchema).readonly(),
25423
+ stalePins: array(StaleDevicePinSchema).readonly()
25424
+ });
25425
+ /**
25426
+ * Where an automatic share's capacity comes from (D755).
25427
+ * - `hardware` — the static capacity of each device at its Auto tune model:
25428
+ * the measured latency table for the node's hardware class.
25429
+ * - `benchmark` — the node's own measured capacity (node benchmark results).
25430
+ * A node with no results falls back to `hardware`, and says so.
25431
+ */
25432
+ var CapacitySourceSchema = _enum(["hardware", "benchmark"]);
25433
+ /** Why a node under the `benchmark` source was sized from hardware instead. */
25434
+ var CapacityFallbackSchema = _enum(["no-benchmark-results", "partial-benchmark-results"]);
25435
+ var SuggestSharesInputSchema = object({
25436
+ headroom: number().min(.3).max(.5).default(.4),
25437
+ /** Default `hardware`. */
25438
+ source: CapacitySourceSchema.default("hardware")
25439
+ });
25440
+ var SuggestedDeviceShareSchema = object({
25441
+ deviceKey: string(),
25442
+ /** Share of the node (0–100, rounded). */
25443
+ share: number(),
25444
+ modelId: string().nullable(),
25445
+ /** Inferences per second at that model, from the measured table; null when sized by a benchmark. */
25446
+ fps: number().nullable(),
25447
+ /** False for a table cell derived from another chip; true for a measured cell or a benchmark. */
25448
+ measured: boolean(),
25449
+ /**
25450
+ * Advisory session cap: ⌊fps × (1 − headroom) / camera fps⌋ from the table,
25451
+ * or the benchmark's measured max sessions. Never enforced.
25452
+ */
25453
+ suggestedMaxSessions: number().nullable()
25454
+ });
25455
+ var SuggestedNodeShareSchema = object({
25456
+ nodeId: string(),
25457
+ /** Share of the cluster (0–100, rounded); null = node skipped (offline, unknown hardware). */
25458
+ share: number().nullable(),
25459
+ /** Parallel sessions the node sustains at the suggested models with the headroom kept free. */
25460
+ capacitySessions: number(),
25461
+ devices: array(SuggestedDeviceShareSchema).readonly(),
25462
+ skippedReason: string().nullable(),
25463
+ /** What this node's capacity was read from; null when the node is skipped. */
25464
+ capacitySource: CapacitySourceSchema.nullable(),
25465
+ /** Set when the `benchmark` source was asked for and this node used `hardware`. */
25466
+ capacityFallback: CapacityFallbackSchema.nullable()
25467
+ });
25468
+ var SuggestSharesResultSchema = object({
25469
+ headroom: number(),
25470
+ /** The source asked for; each node says what it actually used. */
25471
+ source: CapacitySourceSchema,
25472
+ /** Camera detection rate the capacity is counted in (the fastest camera's fps). */
25473
+ cameraFps: number(),
25474
+ /** The Auto tune capacity floor the models were picked at. */
25475
+ minSessionsPerDevice: number(),
25476
+ nodes: array(SuggestedNodeShareSchema).readonly()
25477
+ });
25478
+ /**
25479
+ * Where the node and device shares come from (D750, D755, D791).
25480
+ * - `benchmark` (default since D791) — each node's capacity as its own node
25481
+ * benchmark measured it; a node without fresh results is sized from
25482
+ * `hardware` and says so. Measured on the node beats the table.
25483
+ * - `hardware` — computed from each node's static capacity only (its
25484
+ * accelerators at their Auto tune models, from the latency table).
25485
+ * Both are recomputed whenever a node or device joins, leaves, is switched
25486
+ * on or off, changes model, or a benchmark result is written. No load input.
25487
+ * - `manual` — the operator's stored sliders.
25488
+ * Either way a node or device that cannot take sessions gives its share to
25489
+ * the others in proportion; the stored values are never rewritten for that.
25490
+ */
25491
+ var ShareSourceSchema = _enum([
25492
+ "hardware",
25493
+ "benchmark",
25494
+ "manual"
25495
+ ]);
25496
+ var SetShareSourceInputSchema = object({ source: ShareSourceSchema });
25497
+ object({
25498
+ nodes: record(string(), number()),
25499
+ devices: record(string(), record(string(), number()))
25500
+ });
25501
+ var EffectiveDeviceShareSchema = object({
25502
+ deviceKey: string(),
25503
+ /** Can take sessions now (enabled, available, can run the root). */
25504
+ eligible: boolean(),
25505
+ /** The share the source assigns, as a percentage of the node's devices. */
25506
+ configuredPct: number(),
25507
+ /** The share actually used, after an ineligible device's share went to the others. */
25508
+ effectivePct: number()
25509
+ });
25510
+ var EffectiveNodeShareSchema = object({
25511
+ nodeId: string(),
25512
+ eligible: boolean(),
25513
+ configuredPct: number(),
25514
+ effectivePct: number(),
25515
+ /** Automatic sources: what this node's share was computed from; null under `manual` or before the first answer. */
25516
+ capacitySource: CapacitySourceSchema.nullable(),
25517
+ /** Automatic `benchmark`: why this node used `hardware` instead. */
25518
+ capacityFallback: CapacityFallbackSchema.nullable(),
25519
+ devices: array(EffectiveDeviceShareSchema).readonly()
25520
+ });
25521
+ var EffectiveSharesSchema = object({
25522
+ source: ShareSourceSchema,
25523
+ policy: SessionPlacementPolicySchema,
25524
+ /** An automatic source with no computed answer yet: the stored sliders are used meanwhile. */
25525
+ autoPending: boolean(),
25526
+ /** When the automatic shares were last computed (ms epoch); null = never. */
25527
+ computedAt: number().nullable(),
25528
+ /** What made the system recompute them last. */
25529
+ trigger: string().nullable(),
25530
+ nodes: array(EffectiveNodeShareSchema).readonly(),
25531
+ /** The relative weights the election reads (before eligibility). */
25532
+ nodeWeights: record(string(), number()),
25533
+ deviceWeights: record(string(), record(string(), number()))
25534
+ });
25535
+ /**
25536
+ * Wire shapes of the node benchmark (D791): the operator's plan, the
25537
+ * preflight the confirmation shows, the run the orchestrator owns, what the
25538
+ * measuring runner reports, and the result rows Auto tune and the automatic
25539
+ * shares read.
25540
+ *
25541
+ * ONE node at a time, owned by the pipeline orchestrator. While a run is
25542
+ * active the cluster is in BENCHMARK MODE for that node: it is not a
25543
+ * detection candidate, camera pins naming it are ignored so its sessions move
25544
+ * elsewhere, and both come back when the mode ends — after a crash or a hub
25545
+ * restart too (a persisted manifest, reconciled against the registry).
25546
+ *
25547
+ * Two measurements, both on the node, driven by its own runner (frames never
25548
+ * cross a process at frame rate, D9):
25549
+ * - `device` — one accelerator × one candidate detector, root only, open
25550
+ * loop: how many streams at the camera rate it carries inside the frame
25551
+ * interval;
25552
+ * - `pipeline` — the chosen detector plus the operator's detail steps
25553
+ * (faces, plates, classifiers, CLIP…), on varied frames from the bench
25554
+ * clip: how many parallel sessions the node carries before latency, drops,
25555
+ * CPU, RAM or the event loop give out.
25556
+ */
25557
+ /** Defaults and bounds, one place. */
25558
+ var NODE_BENCHMARK_DEFAULTS = {
25559
+ fpsPerStream: 10,
25560
+ budgetMinutes: 45,
25561
+ minBudgetMinutes: 10,
25562
+ maxBudgetMinutes: 120,
25563
+ /** A result older than this no longer beats the table. */
25564
+ staleAfterDays: 30,
25565
+ /** Warm-in per ramp step (not accounted). */
25566
+ settleSec: 5,
25567
+ /** Accounted window per ramp step. */
25568
+ measureSec: 20,
25569
+ /** Longest the drain may take before the run is refused. */
25570
+ drainTimeoutSec: 120,
25571
+ /** Candidate models per device in one run. */
25572
+ maxModelsPerDevice: 6
25573
+ };
25574
+ /** The two measurements a run can make. */
25575
+ var NodeBenchmarkPhaseSchema = _enum(["device", "pipeline"]);
25576
+ var NodeBenchmarkDevicePlanSchema = object({
25577
+ /** `<backend>:<device>` — `openvino:npu`, `coreml:all`, `cpu`. */
25578
+ deviceKey: string().min(1),
25579
+ /**
25580
+ * Root detector candidates for the `device` measurement, in the order
25581
+ * measured. The FIRST is the one the `pipeline` measurement runs.
25582
+ */
25583
+ modelIds: array(string().min(1)).min(1).max(NODE_BENCHMARK_DEFAULTS.maxModelsPerDevice)
25584
+ });
25585
+ /** What the operator confirmed. */
25586
+ var NodeBenchmarkPlanSchema = object({
25587
+ nodeId: string().min(1),
25588
+ devices: array(NodeBenchmarkDevicePlanSchema).min(1),
25589
+ /** Which measurements run. At least one. */
25590
+ phases: array(NodeBenchmarkPhaseSchema).min(1).default(["device", "pipeline"]),
25591
+ /**
25592
+ * Detail steps (catalog step ids under the root: faces, plates,
25593
+ * classifiers, CLIP…) the `pipeline` measurement enables. The root
25594
+ * detector always runs.
25595
+ */
25596
+ steps: array(string().min(1)).default([]),
25597
+ /** Offered rate of one stream / session. */
25598
+ fpsPerStream: number().int().min(1).max(30).default(NODE_BENCHMARK_DEFAULTS.fpsPerStream),
25599
+ /** Hard deadline: the mode ends and the cluster is restored when it passes. */
25600
+ budgetMinutes: number().int().min(NODE_BENCHMARK_DEFAULTS.minBudgetMinutes).max(NODE_BENCHMARK_DEFAULTS.maxBudgetMinutes).default(NODE_BENCHMARK_DEFAULTS.budgetMinutes),
25601
+ /** Keep the models the run downloaded (default: delete what was not installed before). */
25602
+ keepDownloadedModels: boolean().default(false),
25603
+ /** Start although the other nodes' capacity does not cover the sessions running now. */
25604
+ acceptInsufficientHeadroom: boolean().default(false)
25605
+ });
25606
+ var NodeBenchmarkRefusalSchema = object({
25607
+ kind: _enum([
25608
+ "benchmark-active",
25609
+ "node-offline",
25610
+ "unknown-device",
25611
+ "no-phase",
25612
+ "insufficient-headroom"
25613
+ ]),
25614
+ detail: string(),
25615
+ overridable: boolean()
25616
+ });
25617
+ /** A camera whose detection leaves the node for the run. */
25618
+ var NodeBenchmarkMovingCameraSchema = object({
25619
+ deviceId: number(),
25620
+ /** Placed on the node now (a standing attach or a running session). */
25621
+ placedOnNode: boolean(),
25622
+ /** A node pin naming this node, ignored for the run. */
25623
+ pinnedToNode: boolean()
25624
+ });
25625
+ /** A camera that cannot leave: no other node can obtain its frames. */
25626
+ var NodeBenchmarkStayingCameraSchema = object({
25627
+ deviceId: number(),
25628
+ reason: literal("only-frame-source")
25629
+ });
25630
+ var NodeBenchmarkPreflightSchema = object({
25631
+ nodeId: string(),
25632
+ online: boolean(),
25633
+ moving: array(NodeBenchmarkMovingCameraSchema).readonly(),
25634
+ /** Keep running on the node during the run; the result is flagged contaminated. */
25635
+ staying: array(NodeBenchmarkStayingCameraSchema).readonly(),
25636
+ estimatedDurationMs: number(),
25637
+ /** The run ends and the cluster is restored at the latest after this long. */
25638
+ budgetMs: number(),
25639
+ phases: array(NodeBenchmarkPhaseSchema).readonly(),
25640
+ steps: array(string()).readonly(),
25641
+ devices: array(NodeBenchmarkDevicePlanSchema).readonly(),
25642
+ /** Parallel sessions the cluster runs now, and what the other nodes can carry. */
25643
+ headroom: object({
25644
+ sessionsNow: number(),
25645
+ otherNodesCapacitySessions: number().nullable()
25646
+ }),
25647
+ refusals: array(NodeBenchmarkRefusalSchema).readonly(),
25648
+ canStart: boolean()
25649
+ });
25650
+ /** Where the measuring runner is. */
25651
+ var NodeBenchProgressSchema = object({
25652
+ phase: _enum([
25653
+ "preparing",
25654
+ "device",
25655
+ "pipeline",
25656
+ "cleanup"
25657
+ ]),
25658
+ deviceKey: string().nullable(),
25659
+ modelId: string().nullable(),
25660
+ /** Streams (device) or sessions (pipeline) of the step running now. */
25661
+ load: number().nullable(),
25662
+ cellsDone: number(),
25663
+ cellsTotal: number(),
25664
+ message: string()
25665
+ });
25666
+ /** What limited a ramp. `none` = the ramp ran out of steps still passing. */
25667
+ var NodeBenchLimitSchema = _enum([
25668
+ "p95",
25669
+ "drops",
25670
+ "errors",
25671
+ "stall",
25672
+ "cpu",
25673
+ "ram",
25674
+ "none"
25675
+ ]);
25676
+ var NodeBenchRampStepSchema = object({
25677
+ load: number(),
25678
+ pass: boolean(),
25679
+ p95Ms: number(),
25680
+ dropRatio: number(),
25681
+ /** Completed frames per second over the accounted window. */
25682
+ fps: number(),
25683
+ cpuPct: number().nullable(),
25684
+ ramFreePct: number().nullable(),
25685
+ failReasons: array(string()).readonly()
25686
+ });
25687
+ var NodeBenchCellSchema = discriminatedUnion("phase", [object({
25688
+ phase: literal("device"),
25689
+ deviceKey: string(),
25690
+ modelId: string(),
25691
+ /** Single-stream latency (the K = 1 step). */
25692
+ p50Ms: number(),
25693
+ p95Ms: number(),
25694
+ p99Ms: number(),
25695
+ /** Frames per second sustained at the last passing step. */
25696
+ fps: number(),
25697
+ /** Streams at the camera rate the device carried inside the frame interval; 0 = not even one. */
25698
+ kMax: number(),
25699
+ limitedBy: NodeBenchLimitSchema,
25700
+ /** First call (model load + warm-up). */
25701
+ warmupMs: number(),
25702
+ ramp: array(NodeBenchRampStepSchema).readonly()
25703
+ }), object({
25704
+ phase: literal("pipeline"),
25705
+ deviceKey: string(),
25706
+ modelId: string(),
25707
+ steps: array(string()).readonly(),
25708
+ /** Parallel sessions at the camera rate the node carried; 0 = not even one. */
25709
+ maxSessions: number(),
25710
+ limitedBy: NodeBenchLimitSchema,
25711
+ /** Detail steps that produced at least one result on the clip — a step that never fired measured nothing. */
25712
+ stepsFired: array(string()).readonly(),
25713
+ warmupMs: number(),
25714
+ ramp: array(NodeBenchRampStepSchema).readonly()
25715
+ })]);
25716
+ /**
25717
+ * What a result was measured ON. A result whose fingerprint no longer matches
25718
+ * the node no longer beats the table.
25719
+ */
25720
+ var NodeBenchFingerprintSchema = object({
25721
+ pipelineVersion: string().nullable(),
25722
+ cpuModel: string().nullable(),
25723
+ ramGb: number().nullable(),
25724
+ os: string().nullable(),
25725
+ /** Per device: the pool the cells ran on (runtime + tuning). */
25726
+ pools: record(string(), object({
25727
+ runtime: string(),
25728
+ numWorkers: number(),
25729
+ concurrency: number(),
25730
+ batchMode: string()
25731
+ })).default({})
25732
+ });
25733
+ /** The frames the run used. */
25734
+ var NodeBenchClipSchema = object({
25735
+ /** `camstack-bench-v1` or `reference-images` (the fallback when the clip is not reachable). */
25736
+ id: string(),
25737
+ revision: string().nullable(),
25738
+ frames: number(),
25739
+ width: number(),
25740
+ height: number()
25741
+ });
25742
+ var NodeBenchRunnerInputSchema = object({
25743
+ runId: string().min(1),
25744
+ devices: array(NodeBenchmarkDevicePlanSchema).min(1),
25745
+ phases: array(NodeBenchmarkPhaseSchema).min(1),
25746
+ /** The full detail step tree root for the `pipeline` measurement is built on the node from these ids. */
25747
+ steps: array(string()).default([]),
25748
+ fpsPerStream: number().int().min(1).max(30),
25749
+ /** The runner stops on its own past this instant, whatever the hub does. */
25750
+ deadlineAtMs: number(),
25751
+ settleSec: number().min(0).max(60).default(NODE_BENCHMARK_DEFAULTS.settleSec),
25752
+ measureSec: number().min(2).max(300).default(NODE_BENCHMARK_DEFAULTS.measureSec),
25753
+ keepDownloadedModels: boolean().default(false)
25754
+ });
25755
+ var NodeBenchRunnerStateSchema = _enum([
25756
+ "running",
25757
+ "done",
25758
+ "failed",
25759
+ "aborted"
25760
+ ]);
25761
+ var NodeBenchRunnerStatusSchema = object({
25762
+ runId: string(),
25763
+ nodeId: string(),
25764
+ state: NodeBenchRunnerStateSchema,
25765
+ progress: NodeBenchProgressSchema.nullable(),
25766
+ /** Every finished cell so far — a run stopped half way keeps what it measured. */
25767
+ cells: array(NodeBenchCellSchema).readonly(),
25768
+ fingerprint: NodeBenchFingerprintSchema.nullable(),
25769
+ clip: NodeBenchClipSchema.nullable(),
25770
+ /** Cameras seen running on the node during the run (they share its pools). */
25771
+ activeCameraIds: array(number()).readonly(),
25772
+ /** Models the run downloaded and then deleted (not installed before). */
25773
+ deletedModels: array(string()).readonly(),
25774
+ error: string().nullable(),
25775
+ startedAtMs: number(),
25776
+ finishedAtMs: number().nullable()
25777
+ });
25778
+ var NodeBenchmarkStateSchema = _enum([
25779
+ "draining",
25780
+ "measuring",
25781
+ "restoring",
25782
+ "done",
25783
+ "failed",
25784
+ "aborted"
25785
+ ]);
25786
+ /** Why a run ended. */
25787
+ var NodeBenchmarkEndReasonSchema = _enum([
25788
+ "completed",
25789
+ "operator-abort",
25790
+ "deadline",
25791
+ "node-lost",
25792
+ "runner-lost",
25793
+ "hub-restart",
25794
+ "drain-timeout",
25795
+ "failed"
25796
+ ]);
25797
+ var NodeBenchmarkRunSchema = object({
25798
+ runId: string(),
25799
+ nodeId: string(),
25800
+ state: NodeBenchmarkStateSchema,
25801
+ plan: NodeBenchmarkPlanSchema,
25802
+ startedAtMs: number(),
25803
+ deadlineAtMs: number(),
25804
+ finishedAtMs: number().nullable(),
25805
+ endReason: NodeBenchmarkEndReasonSchema.nullable(),
25806
+ error: string().nullable(),
25807
+ /** Cameras moved off the node for the run. */
25808
+ moved: array(number()).readonly(),
25809
+ /** Cameras that stayed (their only frame source is the node). */
25810
+ staying: array(number()).readonly(),
25811
+ /** Something else ran on the node's pools during the run. */
25812
+ contaminated: boolean(),
25813
+ progress: NodeBenchProgressSchema.nullable(),
25814
+ resultIds: array(string()).readonly()
25815
+ });
25816
+ /** `getNodeBenchmarkStatus`: the active run (or the last one), and whether benchmark mode is on. */
25817
+ var NodeBenchmarkStatusSchema = object({
25818
+ /** The node the cluster is in benchmark mode for; null = none. */
25819
+ modeNodeId: string().nullable(),
25820
+ run: NodeBenchmarkRunSchema.nullable()
25821
+ });
25822
+ /**
25823
+ * One stored measurement — the only authority Auto tune and the automatic
25824
+ * shares read measured capacity from. Written by the orchestrator when a run
25825
+ * ends, never by anyone else.
25826
+ */
25827
+ var NodeBenchmarkResultSchema = object({
25828
+ id: string(),
25829
+ runId: string(),
25830
+ nodeId: string(),
25831
+ cell: NodeBenchCellSchema,
25832
+ fpsPerStream: number(),
25833
+ fingerprint: NodeBenchFingerprintSchema.nullable(),
25834
+ clip: NodeBenchClipSchema.nullable(),
25835
+ /** Other work shared the node's pools (a camera that could not move, or the hub's own duties). */
25836
+ contaminated: boolean(),
25837
+ stayingCameras: array(number()).readonly(),
25838
+ /** The run ended early; the cell itself completed. */
25839
+ partialRun: boolean(),
25840
+ measuredAtMs: number()
25841
+ });
25842
+ var ListNodeBenchmarkResultsInputSchema = object({
25843
+ nodeId: string().optional(),
25844
+ deviceKey: string().optional()
25845
+ });
25846
+ /** A result with its standing today: does it still beat the table? */
25847
+ var NodeBenchmarkResultViewSchema = NodeBenchmarkResultSchema.extend({
25848
+ /** `fresh` beats the table; `stale` falls back to it; `superseded` = a newer row covers the same cell. */
25849
+ standing: _enum([
25850
+ "fresh",
25851
+ "stale",
25852
+ "superseded"
25853
+ ]),
25854
+ staleWhy: _enum([
25855
+ "age",
25856
+ "runtime",
25857
+ "pool-tuning"
25858
+ ]).nullable()
25859
+ });
25860
+ object({
25861
+ runId: string(),
25862
+ nodeId: string(),
25863
+ startedAtMs: number(),
25864
+ deadlineAtMs: number(),
25865
+ plan: NodeBenchmarkPlanSchema,
25866
+ moved: array(number()).readonly(),
25867
+ staying: array(number()).readonly()
25868
+ });
25869
+ /** Candidate detectors per device, for the plan editor. */
25870
+ var NodeBenchmarkCandidatesSchema = object({
25871
+ nodeId: string(),
25872
+ reachable: boolean(),
25873
+ devices: array(object({
25874
+ deviceKey: string(),
25875
+ enabled: boolean(),
25876
+ available: boolean(),
25877
+ /** Ordered: what Auto tune would pick first, then the rest of the family by accuracy. */
25878
+ suggested: array(string()).readonly(),
25879
+ /** Every root detector the device has a build for. */
25880
+ all: array(string()).readonly(),
25881
+ /** The model the device runs now, when pinned. */
25882
+ currentModelId: string().nullable()
25883
+ })).readonly(),
25884
+ /** Detail steps the node's catalog offers under the root (for the `pipeline` measurement). */
25885
+ steps: array(object({
25886
+ id: string(),
25887
+ name: string(),
25888
+ slot: string()
25889
+ })).readonly()
25890
+ });
23934
25891
  object({
23935
25892
  activeCameras: number(),
23936
25893
  throttledCameras: number(),
@@ -24848,14 +26805,15 @@ var RunnerLocalLoadSchema = object({
24848
26805
  * Per-inference-device live load (multi-device C4). One entry per deviceKey
24849
26806
  * this runner currently has attached cameras on, so the orchestrator's second
24850
26807
  * `balance()` pass (over a node's devices) weights on real per-pool session
24851
- * counts. Empty on single-device / pre-multi-device runners. `queueDepthTotal`
24852
- * per device is 0 until the pool backlog gets a public accessor (follow-up).
26808
+ * counts. Empty on single-device / pre-multi-device runners. There is no
26809
+ * per-device queue depth: the inference pool's backlog has no accessor, and
26810
+ * a field that always read 0 was removed rather than shown as a measurement
26811
+ * (D762).
24853
26812
  */
24854
26813
  devices: array(object({
24855
26814
  deviceKey: string(),
24856
26815
  backend: string(),
24857
- attachedCameras: number(),
24858
- queueDepthTotal: number()
26816
+ attachedCameras: number()
24859
26817
  })).default([]),
24860
26818
  /** Hardware capability flags reported by this node. */
24861
26819
  hardware: object({
@@ -24991,7 +26949,22 @@ method(RunnerCameraConfigSchema, object({ success: literal(true) }), { kind: "mu
24991
26949
  */
24992
26950
  cropJpeg: string().optional(),
24993
26951
  parent: DetailParentSchema,
24994
- steps: array(string()).optional()
26952
+ steps: array(string()).optional(),
26953
+ /**
26954
+ * The camera's root model already drew this step's boxes (D730): a
26955
+ * `license_plate` inside the parent vehicle. The named step is NOT
26956
+ * inferred — these FRAME-space boxes are its output — and its
26957
+ * requested children (the plate reader) run on them. Absent ⇒ every
26958
+ * requested step infers as before.
26959
+ */
26960
+ supplied: object({
26961
+ stepId: string(),
26962
+ modelId: string(),
26963
+ boxes: array(object({
26964
+ bbox: NativeCropBboxSchema,
26965
+ score: number()
26966
+ })).min(1)
26967
+ }).optional()
24995
26968
  }), object({ details: array(DetailResultSchema) }).nullable(), { kind: "mutation" }), method(object({
24996
26969
  /** Catalog step id, e.g. `clip-embedding`. */
24997
26970
  stepId: string(),
@@ -25043,7 +27016,16 @@ method(RunnerCameraConfigSchema, object({ success: literal(true) }), { kind: "mu
25043
27016
  }), ParkedTrackFrameSchema.nullable()), method(object({
25044
27017
  deviceId: number(),
25045
27018
  trackId: string()
25046
- }), object({ released: number().int().nonnegative() }), { kind: "mutation" });
27019
+ }), object({ released: number().int().nonnegative() }), { kind: "mutation" }), method(NodeBenchRunnerInputSchema, object({
27020
+ accepted: literal(true),
27021
+ runId: string()
27022
+ }), {
27023
+ kind: "mutation",
27024
+ auth: "admin"
27025
+ }), method(object({ runId: string() }), NodeBenchRunnerStatusSchema.nullable(), { auth: "admin" }), method(object({ runId: string() }), object({ aborted: boolean() }), {
27026
+ kind: "mutation",
27027
+ auth: "admin"
27028
+ });
25047
27029
  var CameraPipelineConfigSchema = object({
25048
27030
  engine: PipelineEngineChoiceSchema.optional(),
25049
27031
  steps: array(PipelineStepInputSchema).readonly(),
@@ -25054,14 +27036,6 @@ var CameraPipelineConfigSchema = object({
25054
27036
  settings: record(string(), unknown()).readonly().optional()
25055
27037
  }).nullable().optional()
25056
27038
  });
25057
- var PipelineTemplateSchema = object({
25058
- id: string(),
25059
- name: string(),
25060
- description: string().optional(),
25061
- config: CameraPipelineConfigSchema,
25062
- createdAt: string(),
25063
- updatedAt: string()
25064
- });
25065
27039
  var DeviceStepConfigSchema = object({
25066
27040
  modelId: string().optional(),
25067
27041
  settings: record(string(), unknown()).optional(),
@@ -25135,9 +27109,10 @@ var CameraStepOverridePatchSchema = object({
25135
27109
  modelId: string().optional(),
25136
27110
  settings: record(string(), unknown()).readonly().optional()
25137
27111
  });
27112
+ var CameraStepSettingsSchema = record(string(), record(string(), unknown()).readonly());
25138
27113
  var CameraPipelineSettingsSchema = object({
25139
- pinnedAgentNodeId: string().optional(),
25140
27114
  stepToggles: record(string(), boolean()).optional(),
27115
+ stepSettings: CameraStepSettingsSchema.optional(),
25141
27116
  stepOverridesByDevice: record(string(), record(string(), record(string(), CameraStepOverridePatchSchema))).optional(),
25142
27117
  pipelineByAgent: record(string(), CameraPipelineForAgentSchema).optional()
25143
27118
  });
@@ -25170,7 +27145,10 @@ var PipelineAssignmentSchema = object({
25170
27145
  });
25171
27146
  /**
25172
27147
  * Per-agent load summary surfaced to the load balancer + dashboards.
25173
- * Aggregated from each runner's `getLocalLoad` cap call.
27148
+ * Aggregated from each runner's `getLocalLoad` cap call. In the
27149
+ * `getAgentLoad` report, a single-device node's default-pool sessions (no
27150
+ * `deviceKey`) are credited to its one eligible device in `load.devices` —
27151
+ * the default pool IS that device (D745); the balancer's census stays raw.
25174
27152
  */
25175
27153
  var AgentLoadSummarySchema = object({
25176
27154
  nodeId: string(),
@@ -25259,26 +27237,27 @@ var CameraBrokerStatusSchema = object({
25259
27237
  width: number(),
25260
27238
  height: number(),
25261
27239
  subscribers: number(),
25262
- inFps: number(),
25263
- outFps: number()
27240
+ /**
27241
+ * Encoded packets/s the broker receives from the camera. null when the
27242
+ * broker's stats read failed — unknown, never 0 (a 0 here reads as a stall).
27243
+ * There is no output rate: decoding runs in the session decode workers, not
27244
+ * in the broker, so the broker's own decoded-frame rate is 0 on every live
27245
+ * camera and is not served (D758).
27246
+ */
27247
+ inFps: number().nullable()
25264
27248
  })).readonly(),
25265
27249
  webrtcSessions: number(),
25266
27250
  rtspRestream: boolean()
25267
27251
  });
25268
- /** Shared-memory ring statistics within the decoder block. */
25269
- var CameraDecoderShmSchema = object({
25270
- framesWritten: number(),
25271
- getFrameHits: number(),
25272
- getFrameMisses: number(),
25273
- budgetMb: number()
25274
- });
25275
- /** Decoder block — null when the decoder stage is unreachable or inactive. */
25276
- var CameraDecoderStatusSchema = object({
25277
- nodeId: string(),
25278
- formats: array(string()).readonly(),
25279
- sessionCount: number(),
25280
- shm: CameraDecoderShmSchema
25281
- });
27252
+ /**
27253
+ * Decoder block — WHERE decode runs (co-located with the detection node by
27254
+ * construction); null when the camera has no detection node. It carries no
27255
+ * frame counter: the shared-memory plane whose counters it used to serve is
27256
+ * gone, and those fields read 0 forever. Whether frames actually flow is read
27257
+ * from `detection.actualFps` (frames delivered to and processed by the
27258
+ * detector), never from a counter nothing feeds.
27259
+ */
27260
+ var CameraDecoderStatusSchema = object({ nodeId: string() });
25282
27261
  /** Motion block — null when motion detection is not active for this device. */
25283
27262
  var CameraMotionStatusSchema = object({
25284
27263
  enabled: boolean(),
@@ -25635,12 +27614,6 @@ method(object({
25635
27614
  }), object({ success: literal(true) }), {
25636
27615
  kind: "mutation",
25637
27616
  auth: "admin"
25638
- }), method(object({
25639
- agentNodeId: string(),
25640
- detectWeight: number().positive().nullable()
25641
- }), object({ success: literal(true) }), {
25642
- kind: "mutation",
25643
- auth: "admin"
25644
27617
  }), method(object({
25645
27618
  agentNodeId: string(),
25646
27619
  detect: boolean().nullable().optional(),
@@ -25682,6 +27655,30 @@ method(object({
25682
27655
  }), {
25683
27656
  kind: "mutation",
25684
27657
  auth: "admin"
27658
+ }), method(AutoTuneOptionsSchema, AutoTunePlanSchema, { auth: "admin" }), method(AutoTuneApplyInputSchema, AutoTuneApplyResultSchema, {
27659
+ kind: "mutation",
27660
+ auth: "admin"
27661
+ }), method(LoadBalancingSharesInputSchema, object({ success: literal(true) }), {
27662
+ kind: "mutation",
27663
+ auth: "admin"
27664
+ }), method(PlacementStatsInputSchema, PlacementStatsSchema, { auth: "admin" }), method(SuggestSharesInputSchema, SuggestSharesResultSchema, { auth: "admin" }), method(_void(), EffectiveSharesSchema, { auth: "admin" }), method(SetShareSourceInputSchema, object({ success: literal(true) }), {
27665
+ kind: "mutation",
27666
+ auth: "admin"
27667
+ }), method(NodeBenchmarkPlanSchema, NodeBenchmarkPreflightSchema, { auth: "admin" }), method(NodeBenchmarkPlanSchema, discriminatedUnion("kind", [object({
27668
+ kind: literal("started"),
27669
+ runId: string()
27670
+ }), object({
27671
+ kind: literal("refused"),
27672
+ preflight: NodeBenchmarkPreflightSchema
27673
+ })]), {
27674
+ kind: "mutation",
27675
+ auth: "admin"
27676
+ }), method(_void(), NodeBenchmarkStatusSchema, { auth: "admin" }), method(object({ runId: string() }), object({ aborted: boolean() }), {
27677
+ kind: "mutation",
27678
+ auth: "admin"
27679
+ }), method(object({ nodeId: string() }), NodeBenchmarkCandidatesSchema, { auth: "admin" }), method(ListNodeBenchmarkResultsInputSchema, array(NodeBenchmarkResultViewSchema).readonly(), { auth: "admin" }), method(object({ id: string() }), object({ deleted: boolean() }), {
27680
+ kind: "mutation",
27681
+ auth: "admin"
25685
27682
  }), method(object({ deviceId: number() }), CameraPipelineSettingsSchema.nullable()), method(object({
25686
27683
  deviceId: number(),
25687
27684
  addonId: string(),
@@ -25698,6 +27695,13 @@ method(object({
25698
27695
  }), object({ success: literal(true) }), {
25699
27696
  kind: "mutation",
25700
27697
  auth: "admin"
27698
+ }), method(object({
27699
+ deviceId: number(),
27700
+ addonId: string(),
27701
+ settings: record(string(), unknown()).nullable()
27702
+ }), object({ success: literal(true) }), {
27703
+ kind: "mutation",
27704
+ auth: "admin"
25701
27705
  }), method(object({
25702
27706
  deviceId: number(),
25703
27707
  agentNodeId: string(),
@@ -25721,25 +27725,7 @@ method(object({
25721
27725
  }), method(_void(), DiskReconcileJobSchema, {
25722
27726
  kind: "mutation",
25723
27727
  auth: "admin"
25724
- }), method(_void(), DiskReconcileJobSchema, { auth: "admin" }), method(_void(), array(PipelineTemplateSchema).readonly()), method(object({
25725
- name: string(),
25726
- description: string().optional(),
25727
- config: CameraPipelineConfigSchema
25728
- }), PipelineTemplateSchema, {
25729
- kind: "mutation",
25730
- auth: "admin"
25731
- }), method(object({
25732
- id: string(),
25733
- name: string().optional(),
25734
- description: string().optional(),
25735
- config: CameraPipelineConfigSchema.optional()
25736
- }), PipelineTemplateSchema, {
25737
- kind: "mutation",
25738
- auth: "admin"
25739
- }), method(object({ id: string() }), object({ success: literal(true) }), {
25740
- kind: "mutation",
25741
- auth: "admin"
25742
- });
27728
+ }), method(_void(), DiskReconcileJobSchema, { auth: "admin" });
25743
27729
  /**
25744
27730
  * Cap → event-kind mapping for the SENSOR / CONTROL cap families — the table
25745
27731
  * `pipeline-analytics.listEventKinds` uses to turn a linked device's bound
@@ -26433,7 +28419,19 @@ var SsoBridgeClaimsSchema = object({
26433
28419
  * editing a descriptor must not retroactively extend or shorten a link the
26434
28420
  * operator already consented to.
26435
28421
  */
26436
- refreshTtl: union([number().int().positive(), literal("never")]).optional()
28422
+ refreshTtl: union([number().int().positive(), literal("never")]).optional(),
28423
+ /**
28424
+ * Opaque handle of a hub-side LINK intent (D782). Set by an OIDC callback
28425
+ * that was started from a signed-in user's "Link" button: the finish then
28426
+ * links this identity to the intent's user instead of signing anyone in.
28427
+ * The handle carries no user id — the hub resolves it, single-use.
28428
+ */
28429
+ linkIntent: string().optional(),
28430
+ /**
28431
+ * Verified `iss` of the id_token behind an OIDC login bridge (D782). A
28432
+ * subject is unique only per issuer, so a link is bound to it.
28433
+ */
28434
+ issuer: string().optional()
26437
28435
  });
26438
28436
  method(object({
26439
28437
  claims: SsoBridgeClaimsSchema,
@@ -28501,8 +30499,6 @@ var WebrtcStreamChoiceSchema = object({
28501
30499
  ]).nullable(),
28502
30500
  /** Input FPS from the camera (null for adaptive). */
28503
30501
  inputFps: number().nullable(),
28504
- /** Decoded FPS (null for adaptive). */
28505
- decodeFps: number().nullable(),
28506
30502
  /** Bitrate in kbps (null for adaptive). */
28507
30503
  bitrateKbps: number().nullable()
28508
30504
  });
@@ -28779,7 +30775,22 @@ DeviceType.Camera, method(object({ deviceId: number().int().nonnegative() }), ar
28779
30775
  * field their hints were silently stripped by the schema and the
28780
30776
  * adaptive ladder started blind on the client's display size.
28781
30777
  */
28782
- hints: webrtcClientHintsSchema.optional()
30778
+ hints: webrtcClientHintsSchema.optional(),
30779
+ /**
30780
+ * Talk-back (D771): relay the PEER's audio to the device's speaker
30781
+ * through the `intercom` cap's push-talk triple. When `true` and the
30782
+ * offer lets the peer send audio, the answer's audio is `sendrecv`
30783
+ * and every inbound frame goes to `intercom.pushTalkAudio` for this
30784
+ * `deviceId`; absent/false answers `sendonly`, as for every viewer.
30785
+ *
30786
+ * TRUSTED-CALLER ONLY. Set by the Alexa export for an Echo on a camera
30787
+ * with `intercom`, when the linked user may control that camera. The
30788
+ * hub STRIPS it from every request-bound call (a browser), exactly as
30789
+ * it overwrites `relayOnly` — a viewer's talk permission is the
30790
+ * intercom cap's own surface (share tokens gate it there), and this
30791
+ * flag must not become a second door to the camera's speaker.
30792
+ */
30793
+ talkback: boolean().optional()
28783
30794
  }), object({
28784
30795
  sessionId: string(),
28785
30796
  sdpAnswer: string()
@@ -28834,6 +30845,14 @@ DeviceType.Camera, method(object({ deviceId: number().int().nonnegative() }), ar
28834
30845
  */
28835
30846
  alive: boolean()
28836
30847
  })), method(object({
30848
+ deviceId: number().int().nonnegative(),
30849
+ sessionId: string(),
30850
+ downlinkMbps: number().nonnegative()
30851
+ }), object({
30852
+ outcome: _enum(["switching", "held"]),
30853
+ tier: CamProfileSchema.nullable(),
30854
+ reason: string()
30855
+ }), { kind: "mutation" }), method(object({
28837
30856
  deviceId: number().int().nonnegative(),
28838
30857
  sessionId: string()
28839
30858
  }), WebrtcSessionDebugSchema, { kind: "query" });
@@ -29073,6 +31092,59 @@ var AddonAutoUpdateSchema = ChannelWithInheritSchema;
29073
31092
  var RestartAddonResultSchema = unknown();
29074
31093
  var InstallPackageResultSchema = unknown();
29075
31094
  var ReloadPackagesResultSchema = unknown();
31095
+ /**
31096
+ * What an uninstall did on ONE node.
31097
+ * - `uninstalled` — removed: runner(s) stopped, caps gone, code deleted.
31098
+ * - `not-installed` — the node did not have it (nothing to do).
31099
+ * - `refused` — protected / bootstrap package; nothing touched.
31100
+ * - `failed` — attempted and did not complete; `error` says why.
31101
+ * - `pending-reconnect` — the node is OFFLINE: its record was pruned so the
31102
+ * back-fill never returns the package, and the stale-addon sweep removes the
31103
+ * copy when the node registers again (only once the hub no longer has it).
31104
+ */
31105
+ var UninstallNodeOutcomeSchema = _enum([
31106
+ "uninstalled",
31107
+ "not-installed",
31108
+ "refused",
31109
+ "failed",
31110
+ "pending-reconnect"
31111
+ ]);
31112
+ var UninstallNodeResultSchema = object({
31113
+ nodeId: string(),
31114
+ outcome: UninstallNodeOutcomeSchema,
31115
+ error: string().optional(),
31116
+ addonIds: array(string()).readonly(),
31117
+ runnersStopped: array(string()).readonly(),
31118
+ warnings: array(string()).readonly()
31119
+ });
31120
+ var UninstallPackageResultSchema = object({
31121
+ /** Every targeted node ended `uninstalled`, `not-installed` or `pending-reconnect`. */
31122
+ success: boolean(),
31123
+ packageName: string(),
31124
+ results: array(UninstallNodeResultSchema).readonly()
31125
+ });
31126
+ /**
31127
+ * `unreachable` lists online agents whose status read FAILED — absence from
31128
+ * `installations` is only "not installed" for a node that answered (D315).
31129
+ */
31130
+ var PackageInstallationsSchema = object({
31131
+ installations: array(object({
31132
+ packageName: string(),
31133
+ nodeId: string(),
31134
+ nodeName: string(),
31135
+ isHub: boolean(),
31136
+ isOnline: boolean(),
31137
+ version: string().nullable(),
31138
+ addonIds: array(string()).readonly(),
31139
+ source: _enum(["live", "recorded"]),
31140
+ /** The hub installs this package too. `false` on an agent row = an orphan. */
31141
+ onHub: boolean()
31142
+ })).readonly(),
31143
+ unreachable: array(object({
31144
+ nodeId: string(),
31145
+ error: string()
31146
+ })).readonly()
31147
+ });
29076
31148
  var BulkUpdateItemStatusSchema = _enum([
29077
31149
  "queued",
29078
31150
  "updating",
@@ -29155,10 +31227,14 @@ method(_void(), array(AddonListItemSchema).readonly()), method(object({
29155
31227
  }), method(object({ packageName: string() }), InstallPackageResultSchema, {
29156
31228
  kind: "mutation",
29157
31229
  auth: "admin"
29158
- }), method(_void(), boolean()), method(_void(), array(unknown()).readonly()), method(object({ packageName: string() }), unknown(), {
31230
+ }), method(_void(), boolean()), method(_void(), array(unknown()).readonly()), method(object({
31231
+ packageName: string().min(1),
31232
+ nodeId: string().optional(),
31233
+ everywhere: boolean().optional()
31234
+ }), UninstallPackageResultSchema, {
29159
31235
  kind: "mutation",
29160
31236
  auth: "admin"
29161
- }), method(_void(), ReloadPackagesResultSchema, {
31237
+ }), method(object({ packageName: string().optional() }), PackageInstallationsSchema, { auth: "admin" }), method(_void(), ReloadPackagesResultSchema, {
29162
31238
  kind: "mutation",
29163
31239
  auth: "admin"
29164
31240
  }), method(object({ query: string().optional() }), array(SearchResultSchema)), method(object({ nodeId: string().optional() }), array(PackageUpdateSchema).readonly(), { auth: "admin" }), method(object({
@@ -32223,6 +34299,9 @@ var CreateIntegrationInputSchema = object({
32223
34299
  enabled: boolean().optional(),
32224
34300
  info: record(string(), unknown()).optional(),
32225
34301
  settings: record(string(), unknown()).optional(),
34302
+ /** Keys of `settings` the form's schema declares secret (by type) — kept in
34303
+ * the keychain, not the table (D787). */
34304
+ secretKeys: array(string()).optional(),
32226
34305
  skipRestart: boolean().optional()
32227
34306
  });
32228
34307
  var UpdateIntegrationInputSchema = object({
@@ -32246,7 +34325,9 @@ method(_void(), array(IntegrationWithStateSchema)), method(object({ id: string()
32246
34325
  auth: "admin"
32247
34326
  }), method(object({ id: string() }), record(string(), unknown()), { auth: "admin" }), method(object({
32248
34327
  id: string(),
32249
- settings: record(string(), unknown())
34328
+ settings: record(string(), unknown()),
34329
+ /** Keys the form's schema declares secret (by type) — keychain-stored (D787). */
34330
+ secretKeys: array(string()).optional()
32250
34331
  }), object({ success: boolean() }), {
32251
34332
  kind: "mutation",
32252
34333
  auth: "admin"
@@ -32645,7 +34726,8 @@ var ConnectionEndpointSchema = object({
32645
34726
  "lan-ipv6",
32646
34727
  "public",
32647
34728
  "loopback",
32648
- "app-link"
34729
+ "app-link",
34730
+ "custom"
32649
34731
  ]),
32650
34732
  /**
32651
34733
  * Originating-interface kind — `lan`/`wifi`/`docker`/`vpn`/`other`/
@@ -32714,7 +34796,7 @@ var GetConnectionEndpointsResultSchema = object({
32714
34796
  localPort: AdvertisedLocalPortSchema
32715
34797
  });
32716
34798
  /**
32717
- * The address flagged for notification links. `baseUrl: null` = AUTO, which
34799
+ * The address flagged for notification taps (`notificationTaps`). `baseUrl: null` = AUTO, which
32718
34800
  * since D709 is the CamStack app link; `resolved` reports the effective value,
32719
34801
  * so the UI can show it either way.
32720
34802
  */
@@ -32747,6 +34829,72 @@ var ViewerEndpointsSchema = object({
32747
34829
  /** What the ranking currently resolves to (may be empty if nothing is up). */
32748
34830
  resolved: array(string()).readonly()
32749
34831
  });
34832
+ /**
34833
+ * DEPRECATED compatibility shape of `getHubAddresses` (D729 amendment, kept
34834
+ * for addons built against it): `cluster` is the `internal` role, `browser`
34835
+ * the `publicEndpoint` role; `override` is the flagged address.
34836
+ */
34837
+ var HubAddressSnapshotSchema = object({
34838
+ override: string().nullable(),
34839
+ resolved: string().nullable(),
34840
+ source: _enum([
34841
+ "override",
34842
+ "auto",
34843
+ "none"
34844
+ ])
34845
+ });
34846
+ var HubAddressesSchema = object({
34847
+ cluster: HubAddressSnapshotSchema,
34848
+ browser: HubAddressSnapshotSchema
34849
+ });
34850
+ /**
34851
+ * What an address is used for (`hub-address.ts`, D734). `appConnections` is
34852
+ * many-valued; `notificationTaps`, `publicEndpoint` and `internal` are carried
34853
+ * by at most one address.
34854
+ */
34855
+ var HubAddressRoleSchema = _enum(HUB_ADDRESS_ROLES);
34856
+ var RoleSourceSchema = _enum([
34857
+ "flagged",
34858
+ "auto",
34859
+ "none"
34860
+ ]);
34861
+ /** One single-valued role: the flagged address, the one in use, and why. */
34862
+ var HubAddressRoleResolutionSchema = object({
34863
+ /** The address carrying the flag, or null = automatic. */
34864
+ flagged: string().nullable(),
34865
+ /** The address in use, or null when nothing qualifies (never loopback). */
34866
+ resolved: string().nullable(),
34867
+ source: RoleSourceSchema
34868
+ });
34869
+ var HubAppConnectionsResolutionSchema = object({
34870
+ /** The addresses flagged `appConnections`, or empty = automatic. */
34871
+ flagged: array(string()).readonly(),
34872
+ /** What the apps race right now. */
34873
+ resolved: array(string()).readonly(),
34874
+ source: RoleSourceSchema
34875
+ });
34876
+ var HubAddressBookSchema = object({
34877
+ rows: array(ConnectionEndpointSchema.extend({
34878
+ /** In the hub's detected palette right now. */
34879
+ detected: boolean(),
34880
+ /** Entered by the operator (removable). */
34881
+ custom: boolean(),
34882
+ /** The roles explicitly flagged on this address. */
34883
+ flags: array(HubAddressRoleSchema).readonly(),
34884
+ /** The roles this address serves right now — flagged or automatic. */
34885
+ inUse: array(HubAddressRoleSchema).readonly(),
34886
+ /** The roles this address may be flagged with. */
34887
+ eligible: array(HubAddressRoleSchema).readonly()
34888
+ })).readonly(),
34889
+ roles: object({
34890
+ appConnections: HubAppConnectionsResolutionSchema,
34891
+ notificationTaps: HubAddressRoleResolutionSchema,
34892
+ internal: HubAddressRoleResolutionSchema,
34893
+ publicEndpoint: HubAddressRoleResolutionSchema
34894
+ }),
34895
+ /** The `hub=` an app link carries (D709), or null. */
34896
+ appLinkHub: string().nullable()
34897
+ });
32750
34898
  var AllowedAddressesSchema = object({
32751
34899
  /**
32752
34900
  * Allowlist of interface addresses operators have explicitly opted
@@ -32790,10 +34938,27 @@ method(_void(), ListResultSchema), method(_void(), PreferredSchema), method(obje
32790
34938
  * tunnel always emits `https://` regardless. */
32791
34939
  scheme: _enum(["http", "https"]).optional(),
32792
34940
  /** Append the CamStack app link entry (`kind: 'app-link'`, D709) —
32793
- * an address notification links can be flagged with, not a hub
34941
+ * an address notification taps can be flagged with, not a hub
32794
34942
  * route. Default `false`: racers and rankers never see it. */
32795
34943
  includeAppLink: boolean().optional()
32796
- }), GetConnectionEndpointsResultSchema), method(_void(), NotificationEndpointSchema), method(object({ baseUrl: string().nullable() }), NotificationEndpointSchema, { kind: "mutation" }), method(_void(), ViewerEndpointsSchema), method(object({ baseUrls: array(string()).readonly() }), ViewerEndpointsSchema, { kind: "mutation" }), method(_void(), AllowedAddressesSchema), method(AllowedAddressesSchema, object({ success: literal(true) }), { kind: "mutation" }), method(_void(), AllowedAddressesSchema, { kind: "mutation" }), method(_void(), TlsStatusSchema), method(object({ reason: string().optional() }), TlsStatusSchema, {
34944
+ }), GetConnectionEndpointsResultSchema), method(_void(), NotificationEndpointSchema), method(object({ baseUrl: string().nullable() }), NotificationEndpointSchema, { kind: "mutation" }), method(_void(), ViewerEndpointsSchema), method(object({ baseUrls: array(string()).readonly() }), ViewerEndpointsSchema, { kind: "mutation" }), method(object({ scheme: _enum(["http", "https"]).optional() }).optional(), HubAddressBookSchema), method(object({
34945
+ baseUrl: string(),
34946
+ label: string().max(80)
34947
+ }), HubAddressBookSchema, {
34948
+ kind: "mutation",
34949
+ auth: "admin"
34950
+ }), method(object({ baseUrl: string() }), HubAddressBookSchema, {
34951
+ kind: "mutation",
34952
+ auth: "admin"
34953
+ }), method(object({
34954
+ role: HubAddressRoleSchema,
34955
+ baseUrl: string().nullable(),
34956
+ enabled: boolean(),
34957
+ acceptInsecureHttp: boolean().optional()
34958
+ }), HubAddressBookSchema, {
34959
+ kind: "mutation",
34960
+ auth: "admin"
34961
+ }), method(_void(), HubAddressesSchema), method(_void(), AllowedAddressesSchema), method(AllowedAddressesSchema, object({ success: literal(true) }), { kind: "mutation" }), method(_void(), AllowedAddressesSchema, { kind: "mutation" }), method(_void(), TlsStatusSchema), method(object({ reason: string().optional() }), TlsStatusSchema, {
32797
34962
  kind: "mutation",
32798
34963
  auth: "admin"
32799
34964
  }), method(object({
@@ -39446,6 +41611,32 @@ var TotpStatusSchema = object({
39446
41611
  /** Null when no row exists OR the row is still pending confirmation. */
39447
41612
  confirmedAt: number().nullable()
39448
41613
  });
41614
+ /**
41615
+ * user-management — singleton capability for user accounts, API keys,
41616
+ * and scoped tokens.
41617
+ *
41618
+ * v2 model: every method gated by `auth: 'admin'`. Admin-only delegation
41619
+ * — the subset check on `setUserScopes` / `createScopedToken` is moot
41620
+ * because non-admins never reach these. If/when we open non-admin
41621
+ * delegation, structural caller-scope subset check goes inside the
41622
+ * provider.
41623
+ */
41624
+ var ExternalIdentitySchema = object({
41625
+ /** Login-method id of the provider instance, e.g. `auth-oidc/authentik`. */
41626
+ provider: string(),
41627
+ /** The IdP's stable subject (`sub`) for this account. */
41628
+ subject: string(),
41629
+ /** The verified `iss` of the IdP the identity was linked under — `sub` is unique only per issuer. */
41630
+ issuer: string(),
41631
+ userId: string(),
41632
+ /** What the IdP called the account at link time (username / email) — display only. */
41633
+ label: string().optional(),
41634
+ linkedAt: number()
41635
+ });
41636
+ var ExternalIdentityKeySchema = object({
41637
+ provider: string().min(1),
41638
+ subject: string().min(1)
41639
+ });
39449
41640
  method(_void(), array(UserSummarySchema), { auth: "admin" }), method(CreateUserInputSchema, UserSummarySchema, {
39450
41641
  kind: "mutation",
39451
41642
  auth: "admin",
@@ -39559,7 +41750,22 @@ method(_void(), array(UserSummarySchema), { auth: "admin" }), method(CreateUserI
39559
41750
  userId: string(),
39560
41751
  username: string(),
39561
41752
  scopes: array(TokenScopeSchema)
39562
- }).nullable(), { access: "view" }), method(_void(), array(OauthSessionSummarySchema), { auth: "admin" }), method(object({ id: string() }), object({ success: boolean() }), {
41753
+ }).nullable(), { access: "view" }), method(object({ userId: string() }), array(ExternalIdentitySchema), { auth: "admin" }), method(ExternalIdentityKeySchema, object({
41754
+ userId: string(),
41755
+ issuer: string()
41756
+ }).nullable(), { auth: "admin" }), method(ExternalIdentityKeySchema.extend({
41757
+ userId: string(),
41758
+ issuer: string().min(1),
41759
+ label: string().optional()
41760
+ }), object({ success: literal(true) }), {
41761
+ kind: "mutation",
41762
+ auth: "admin",
41763
+ access: "create"
41764
+ }), method(ExternalIdentityKeySchema.extend({ userId: string() }), object({ success: boolean() }), {
41765
+ kind: "mutation",
41766
+ auth: "admin",
41767
+ access: "delete"
41768
+ }), method(_void(), array(OauthSessionSummarySchema), { auth: "admin" }), method(object({ id: string() }), object({ success: boolean() }), {
39563
41769
  kind: "mutation",
39564
41770
  auth: "admin",
39565
41771
  access: "delete"
@@ -40261,6 +42467,16 @@ var zoneRulesCapability = {
40261
42467
  durability: "restored"
40262
42468
  };
40263
42469
  SOURCE_CAPS.filter((cap) => cap !== "switch" && cap !== "motion");
42470
+ Object.freeze({
42471
+ person: .5,
42472
+ vehicle: .5,
42473
+ animal: .5
42474
+ });
42475
+ Object.freeze({
42476
+ person: .65,
42477
+ vehicle: .65,
42478
+ animal: .65
42479
+ });
40264
42480
  /**
40265
42481
  * Accessory device helpers — shared across drivers.
40266
42482
  *
@@ -40736,7 +42952,8 @@ var BaseDevice = class {
40736
42952
  this.role = options.role;
40737
42953
  this.parentDeviceId = ctx.parentDeviceId;
40738
42954
  const seedData = ctx.persistedConfig ?? {};
40739
- this.config = DeviceConfig.fromSchema(schema, (data) => ctx.persistConfig(data), seedData, ({ droppedKeys, issues }) => {
42955
+ const declaredSecretPaths = collectZodSecretPaths(schema);
42956
+ this.config = DeviceConfig.fromSchema(schema, (data) => ctx.persistConfig(data, { secretConfigPaths: declaredSecretPaths }), seedData, ({ droppedKeys, issues }) => {
40740
42957
  ctx.logger.warn("Device config recovery: dropping invalid persisted fields", {
40741
42958
  tags: {
40742
42959
  deviceId: ctx.id,
@@ -41959,6 +44176,12 @@ Object.freeze({
41959
44176
  addonId: null,
41960
44177
  access: "view"
41961
44178
  },
44179
+ "addons.listInstallations": {
44180
+ capName: "addons",
44181
+ capScope: "system",
44182
+ addonId: null,
44183
+ access: "view"
44184
+ },
41962
44185
  "addons.listJobs": {
41963
44186
  capName: "addons",
41964
44187
  capScope: "system",
@@ -43141,90 +45364,18 @@ Object.freeze({
43141
45364
  addonId: null,
43142
45365
  access: "create"
43143
45366
  },
43144
- "decoder.createSession": {
43145
- capName: "decoder",
43146
- capScope: "system",
43147
- addonId: null,
43148
- access: "view"
43149
- },
43150
- "decoder.destroySession": {
43151
- capName: "decoder",
43152
- capScope: "system",
43153
- addonId: null,
43154
- access: "delete"
43155
- },
43156
- "decoder.getFrame": {
43157
- capName: "decoder",
43158
- capScope: "system",
43159
- addonId: null,
43160
- access: "view"
43161
- },
43162
45367
  "decoder.getInfo": {
43163
45368
  capName: "decoder",
43164
45369
  capScope: "system",
43165
45370
  addonId: null,
43166
45371
  access: "view"
43167
45372
  },
43168
- "decoder.getShmStats": {
43169
- capName: "decoder",
43170
- capScope: "system",
43171
- addonId: null,
43172
- access: "view"
43173
- },
43174
- "decoder.getStats": {
43175
- capName: "decoder",
43176
- capScope: "system",
43177
- addonId: null,
43178
- access: "view"
43179
- },
43180
- "decoder.listActiveSessions": {
43181
- capName: "decoder",
43182
- capScope: "system",
43183
- addonId: null,
43184
- access: "view"
43185
- },
43186
- "decoder.openStream": {
43187
- capName: "decoder",
43188
- capScope: "system",
43189
- addonId: null,
43190
- access: "view"
43191
- },
43192
- "decoder.pullFrames": {
43193
- capName: "decoder",
43194
- capScope: "system",
43195
- addonId: null,
43196
- access: "view"
43197
- },
43198
- "decoder.pullHandles": {
43199
- capName: "decoder",
43200
- capScope: "system",
43201
- addonId: null,
43202
- access: "view"
43203
- },
43204
- "decoder.pushPacket": {
43205
- capName: "decoder",
43206
- capScope: "system",
43207
- addonId: null,
43208
- access: "view"
43209
- },
43210
45373
  "decoder.reprobeHwaccel": {
43211
45374
  capName: "decoder",
43212
45375
  capScope: "system",
43213
45376
  addonId: null,
43214
45377
  access: "create"
43215
45378
  },
43216
- "decoder.supportsCodec": {
43217
- capName: "decoder",
43218
- capScope: "system",
43219
- addonId: null,
43220
- access: "view"
43221
- },
43222
- "decoder.updateConfig": {
43223
- capName: "decoder",
43224
- capScope: "system",
43225
- addonId: null,
43226
- access: "view"
43227
- },
43228
45379
  "detectionPipeline.applyDeviceSettingsPatch": {
43229
45380
  capName: "detection-pipeline",
43230
45381
  capScope: "device",
@@ -44491,6 +46642,90 @@ Object.freeze({
44491
46642
  addonId: null,
44492
46643
  access: "create"
44493
46644
  },
46645
+ "keychain.delete": {
46646
+ capName: "keychain",
46647
+ capScope: "system",
46648
+ addonId: null,
46649
+ access: "delete"
46650
+ },
46651
+ "keychain.getState": {
46652
+ capName: "keychain",
46653
+ capScope: "system",
46654
+ addonId: null,
46655
+ access: "view"
46656
+ },
46657
+ "keychain.listMeta": {
46658
+ capName: "keychain",
46659
+ capScope: "system",
46660
+ addonId: null,
46661
+ access: "view"
46662
+ },
46663
+ "keychain.put": {
46664
+ capName: "keychain",
46665
+ capScope: "system",
46666
+ addonId: null,
46667
+ access: "create"
46668
+ },
46669
+ "keychain.resolve": {
46670
+ capName: "keychain",
46671
+ capScope: "system",
46672
+ addonId: null,
46673
+ access: "view"
46674
+ },
46675
+ "keychainAdmin.deleteOrphans": {
46676
+ capName: "keychain-admin",
46677
+ capScope: "system",
46678
+ addonId: null,
46679
+ access: "delete"
46680
+ },
46681
+ "keychainAdmin.downloadRecoveryKey": {
46682
+ capName: "keychain-admin",
46683
+ capScope: "system",
46684
+ addonId: null,
46685
+ access: "create"
46686
+ },
46687
+ "keychainAdmin.listAudit": {
46688
+ capName: "keychain-admin",
46689
+ capScope: "system",
46690
+ addonId: null,
46691
+ access: "view"
46692
+ },
46693
+ "keychainAdmin.listSecrets": {
46694
+ capName: "keychain-admin",
46695
+ capScope: "system",
46696
+ addonId: null,
46697
+ access: "view"
46698
+ },
46699
+ "keychainAdmin.purgeRetiredKeys": {
46700
+ capName: "keychain-admin",
46701
+ capScope: "system",
46702
+ addonId: null,
46703
+ access: "delete"
46704
+ },
46705
+ "keychainAdmin.resetKeychain": {
46706
+ capName: "keychain-admin",
46707
+ capScope: "system",
46708
+ addonId: null,
46709
+ access: "delete"
46710
+ },
46711
+ "keychainAdmin.reveal": {
46712
+ capName: "keychain-admin",
46713
+ capScope: "system",
46714
+ addonId: null,
46715
+ access: "create"
46716
+ },
46717
+ "keychainAdmin.rotateMasterKey": {
46718
+ capName: "keychain-admin",
46719
+ capScope: "system",
46720
+ addonId: null,
46721
+ access: "create"
46722
+ },
46723
+ "keychainAdmin.status": {
46724
+ capName: "keychain-admin",
46725
+ capScope: "system",
46726
+ addonId: null,
46727
+ access: "view"
46728
+ },
44494
46729
  "lawnMowerControl.dock": {
44495
46730
  capName: "lawn-mower-control",
44496
46731
  capScope: "device",
@@ -44713,12 +46948,24 @@ Object.freeze({
44713
46948
  addonId: null,
44714
46949
  access: "view"
44715
46950
  },
46951
+ "localNetwork.addCustomAddress": {
46952
+ capName: "local-network",
46953
+ capScope: "system",
46954
+ addonId: null,
46955
+ access: "create"
46956
+ },
44716
46957
  "localNetwork.downloadCa": {
44717
46958
  capName: "local-network",
44718
46959
  capScope: "system",
44719
46960
  addonId: null,
44720
46961
  access: "view"
44721
46962
  },
46963
+ "localNetwork.getAddresses": {
46964
+ capName: "local-network",
46965
+ capScope: "system",
46966
+ addonId: null,
46967
+ access: "view"
46968
+ },
44722
46969
  "localNetwork.getAllowedAddresses": {
44723
46970
  capName: "local-network",
44724
46971
  capScope: "system",
@@ -44731,6 +46978,12 @@ Object.freeze({
44731
46978
  addonId: null,
44732
46979
  access: "view"
44733
46980
  },
46981
+ "localNetwork.getHubAddresses": {
46982
+ capName: "local-network",
46983
+ capScope: "system",
46984
+ addonId: null,
46985
+ access: "view"
46986
+ },
44734
46987
  "localNetwork.getNotificationEndpoint": {
44735
46988
  capName: "local-network",
44736
46989
  capScope: "system",
@@ -44767,6 +47020,12 @@ Object.freeze({
44767
47020
  addonId: null,
44768
47021
  access: "create"
44769
47022
  },
47023
+ "localNetwork.removeCustomAddress": {
47024
+ capName: "local-network",
47025
+ capScope: "system",
47026
+ addonId: null,
47027
+ access: "delete"
47028
+ },
44770
47029
  "localNetwork.resetAllowlistToBestMatch": {
44771
47030
  capName: "local-network",
44772
47031
  capScope: "system",
@@ -44779,6 +47038,12 @@ Object.freeze({
44779
47038
  addonId: null,
44780
47039
  access: "create"
44781
47040
  },
47041
+ "localNetwork.setAddressRole": {
47042
+ capName: "local-network",
47043
+ capScope: "system",
47044
+ addonId: null,
47045
+ access: "create"
47046
+ },
44782
47047
  "localNetwork.setAllowedAddresses": {
44783
47048
  capName: "local-network",
44784
47049
  capScope: "system",
@@ -45835,6 +48100,18 @@ Object.freeze({
45835
48100
  addonId: null,
45836
48101
  access: "create"
45837
48102
  },
48103
+ "pipelineAnalytics.addRetrainFrameFromRecording": {
48104
+ capName: "pipeline-analytics",
48105
+ capScope: "device",
48106
+ addonId: null,
48107
+ access: "create"
48108
+ },
48109
+ "pipelineAnalytics.addRetrainFramesToCollection": {
48110
+ capName: "pipeline-analytics",
48111
+ capScope: "device",
48112
+ addonId: null,
48113
+ access: "create"
48114
+ },
45838
48115
  "pipelineAnalytics.applyDeviceSettingsPatch": {
45839
48116
  capName: "pipeline-analytics",
45840
48117
  capScope: "device",
@@ -45883,12 +48160,24 @@ Object.freeze({
45883
48160
  addonId: null,
45884
48161
  access: "view"
45885
48162
  },
48163
+ "pipelineAnalytics.createRetrainCollection": {
48164
+ capName: "pipeline-analytics",
48165
+ capScope: "device",
48166
+ addonId: null,
48167
+ access: "create"
48168
+ },
45886
48169
  "pipelineAnalytics.deleteDeviceEvents": {
45887
48170
  capName: "pipeline-analytics",
45888
48171
  capScope: "device",
45889
48172
  addonId: null,
45890
48173
  access: "delete"
45891
48174
  },
48175
+ "pipelineAnalytics.deleteRetrainCollection": {
48176
+ capName: "pipeline-analytics",
48177
+ capScope: "device",
48178
+ addonId: null,
48179
+ access: "delete"
48180
+ },
45892
48181
  "pipelineAnalytics.deleteTracks": {
45893
48182
  capName: "pipeline-analytics",
45894
48183
  capScope: "device",
@@ -46093,6 +48382,24 @@ Object.freeze({
46093
48382
  addonId: null,
46094
48383
  access: "view"
46095
48384
  },
48385
+ "pipelineAnalytics.listRetrainAssistProfiles": {
48386
+ capName: "pipeline-analytics",
48387
+ capScope: "device",
48388
+ addonId: null,
48389
+ access: "view"
48390
+ },
48391
+ "pipelineAnalytics.listRetrainCollectionFrames": {
48392
+ capName: "pipeline-analytics",
48393
+ capScope: "device",
48394
+ addonId: null,
48395
+ access: "view"
48396
+ },
48397
+ "pipelineAnalytics.listRetrainCollections": {
48398
+ capName: "pipeline-analytics",
48399
+ capScope: "device",
48400
+ addonId: null,
48401
+ access: "view"
48402
+ },
46096
48403
  "pipelineAnalytics.listRetrainFrames": {
46097
48404
  capName: "pipeline-analytics",
46098
48405
  capScope: "device",
@@ -46141,6 +48448,12 @@ Object.freeze({
46141
48448
  addonId: null,
46142
48449
  access: "create"
46143
48450
  },
48451
+ "pipelineAnalytics.proposeRetrainAnnotationsWithLlm": {
48452
+ capName: "pipeline-analytics",
48453
+ capScope: "device",
48454
+ addonId: null,
48455
+ access: "create"
48456
+ },
46144
48457
  "pipelineAnalytics.pruneEvents": {
46145
48458
  capName: "pipeline-analytics",
46146
48459
  capScope: "device",
@@ -46195,6 +48508,18 @@ Object.freeze({
46195
48508
  addonId: null,
46196
48509
  access: "create"
46197
48510
  },
48511
+ "pipelineAnalytics.removeRetrainFrameFromCollection": {
48512
+ capName: "pipeline-analytics",
48513
+ capScope: "device",
48514
+ addonId: null,
48515
+ access: "delete"
48516
+ },
48517
+ "pipelineAnalytics.renameRetrainCollection": {
48518
+ capName: "pipeline-analytics",
48519
+ capScope: "device",
48520
+ addonId: null,
48521
+ access: "create"
48522
+ },
46198
48523
  "pipelineAnalytics.restageRetrainTrack": {
46199
48524
  capName: "pipeline-analytics",
46200
48525
  capScope: "device",
@@ -46225,6 +48550,12 @@ Object.freeze({
46225
48550
  addonId: null,
46226
48551
  access: "create"
46227
48552
  },
48553
+ "pipelineAnalytics.setRetrainFrameComplete": {
48554
+ capName: "pipeline-analytics",
48555
+ capScope: "device",
48556
+ addonId: null,
48557
+ access: "create"
48558
+ },
46228
48559
  "pipelineAnalytics.setTrackFlags": {
46229
48560
  capName: "pipeline-analytics",
46230
48561
  capScope: "device",
@@ -46261,6 +48592,12 @@ Object.freeze({
46261
48592
  addonId: null,
46262
48593
  access: "delete"
46263
48594
  },
48595
+ "pipelineAnalytics.writeRetrainArchive": {
48596
+ capName: "pipeline-analytics",
48597
+ capScope: "device",
48598
+ addonId: null,
48599
+ access: "create"
48600
+ },
46264
48601
  "pipelineExecutor.cacheFrameInPool": {
46265
48602
  capName: "pipeline-executor",
46266
48603
  capScope: "system",
@@ -46273,13 +48610,13 @@ Object.freeze({
46273
48610
  addonId: null,
46274
48611
  access: "delete"
46275
48612
  },
46276
- "pipelineExecutor.deleteModel": {
48613
+ "pipelineExecutor.clearModelBoundDeviceOverrides": {
46277
48614
  capName: "pipeline-executor",
46278
48615
  capScope: "system",
46279
48616
  addonId: null,
46280
48617
  access: "delete"
46281
48618
  },
46282
- "pipelineExecutor.deleteTemplate": {
48619
+ "pipelineExecutor.deleteModel": {
46283
48620
  capName: "pipeline-executor",
46284
48621
  capScope: "system",
46285
48622
  addonId: null,
@@ -46423,12 +48760,6 @@ Object.freeze({
46423
48760
  addonId: null,
46424
48761
  access: "view"
46425
48762
  },
46426
- "pipelineExecutor.listTemplates": {
46427
- capName: "pipeline-executor",
46428
- capScope: "system",
46429
- addonId: null,
46430
- access: "view"
46431
- },
46432
48763
  "pipelineExecutor.rearmInferenceDevice": {
46433
48764
  capName: "pipeline-executor",
46434
48765
  capScope: "system",
@@ -46453,12 +48784,6 @@ Object.freeze({
46453
48784
  addonId: null,
46454
48785
  access: "create"
46455
48786
  },
46456
- "pipelineExecutor.saveTemplate": {
46457
- capName: "pipeline-executor",
46458
- capScope: "system",
46459
- addonId: null,
46460
- access: "create"
46461
- },
46462
48787
  "pipelineExecutor.setVideoPipelineSteps": {
46463
48788
  capName: "pipeline-executor",
46464
48789
  capScope: "system",
@@ -46477,17 +48802,23 @@ Object.freeze({
46477
48802
  addonId: null,
46478
48803
  access: "create"
46479
48804
  },
46480
- "pipelineExecutor.updateTemplate": {
48805
+ "pipelineExecutor.validatePipeline": {
46481
48806
  capName: "pipeline-executor",
46482
48807
  capScope: "system",
46483
48808
  addonId: null,
48809
+ access: "view"
48810
+ },
48811
+ "pipelineOrchestrator.abortNodeBenchmark": {
48812
+ capName: "pipeline-orchestrator",
48813
+ capScope: "system",
48814
+ addonId: null,
46484
48815
  access: "create"
46485
48816
  },
46486
- "pipelineExecutor.validatePipeline": {
46487
- capName: "pipeline-executor",
48817
+ "pipelineOrchestrator.applyAutoTune": {
48818
+ capName: "pipeline-orchestrator",
46488
48819
  capScope: "system",
46489
48820
  addonId: null,
46490
- access: "view"
48821
+ access: "create"
46491
48822
  },
46492
48823
  "pipelineOrchestrator.applyDeviceSettingsPatch": {
46493
48824
  capName: "pipeline-orchestrator",
@@ -46507,7 +48838,7 @@ Object.freeze({
46507
48838
  addonId: null,
46508
48839
  access: "create"
46509
48840
  },
46510
- "pipelineOrchestrator.deleteTemplate": {
48841
+ "pipelineOrchestrator.deleteNodeBenchmarkResult": {
46511
48842
  capName: "pipeline-orchestrator",
46512
48843
  capScope: "system",
46513
48844
  addonId: null,
@@ -46603,6 +48934,12 @@ Object.freeze({
46603
48934
  addonId: null,
46604
48935
  access: "view"
46605
48936
  },
48937
+ "pipelineOrchestrator.getEffectiveShares": {
48938
+ capName: "pipeline-orchestrator",
48939
+ capScope: "system",
48940
+ addonId: null,
48941
+ access: "view"
48942
+ },
46606
48943
  "pipelineOrchestrator.getGlobalMetrics": {
46607
48944
  capName: "pipeline-orchestrator",
46608
48945
  capScope: "system",
@@ -46615,6 +48952,24 @@ Object.freeze({
46615
48952
  addonId: null,
46616
48953
  access: "view"
46617
48954
  },
48955
+ "pipelineOrchestrator.getNodeBenchmarkCandidates": {
48956
+ capName: "pipeline-orchestrator",
48957
+ capScope: "system",
48958
+ addonId: null,
48959
+ access: "view"
48960
+ },
48961
+ "pipelineOrchestrator.getNodeBenchmarkPreflight": {
48962
+ capName: "pipeline-orchestrator",
48963
+ capScope: "system",
48964
+ addonId: null,
48965
+ access: "view"
48966
+ },
48967
+ "pipelineOrchestrator.getNodeBenchmarkStatus": {
48968
+ capName: "pipeline-orchestrator",
48969
+ capScope: "system",
48970
+ addonId: null,
48971
+ access: "view"
48972
+ },
46618
48973
  "pipelineOrchestrator.getNodeInferenceDevices": {
46619
48974
  capName: "pipeline-orchestrator",
46620
48975
  capScope: "system",
@@ -46639,6 +48994,12 @@ Object.freeze({
46639
48994
  addonId: null,
46640
48995
  access: "view"
46641
48996
  },
48997
+ "pipelineOrchestrator.getPlacementStats": {
48998
+ capName: "pipeline-orchestrator",
48999
+ capScope: "system",
49000
+ addonId: null,
49001
+ access: "view"
49002
+ },
46642
49003
  "pipelineOrchestrator.getReconcileFromDiskStatus": {
46643
49004
  capName: "pipeline-orchestrator",
46644
49005
  capScope: "system",
@@ -46651,7 +49012,7 @@ Object.freeze({
46651
49012
  addonId: null,
46652
49013
  access: "view"
46653
49014
  },
46654
- "pipelineOrchestrator.listTemplates": {
49015
+ "pipelineOrchestrator.listNodeBenchmarkResults": {
46655
49016
  capName: "pipeline-orchestrator",
46656
49017
  capScope: "system",
46657
49018
  addonId: null,
@@ -46663,6 +49024,12 @@ Object.freeze({
46663
49024
  addonId: null,
46664
49025
  access: "create"
46665
49026
  },
49027
+ "pipelineOrchestrator.planAutoTune": {
49028
+ capName: "pipeline-orchestrator",
49029
+ capScope: "system",
49030
+ addonId: null,
49031
+ access: "view"
49032
+ },
46666
49033
  "pipelineOrchestrator.rebalance": {
46667
49034
  capName: "pipeline-orchestrator",
46668
49035
  capScope: "system",
@@ -46705,12 +49072,6 @@ Object.freeze({
46705
49072
  addonId: null,
46706
49073
  access: "create"
46707
49074
  },
46708
- "pipelineOrchestrator.saveTemplate": {
46709
- capName: "pipeline-orchestrator",
46710
- capScope: "system",
46711
- addonId: null,
46712
- access: "create"
46713
- },
46714
49075
  "pipelineOrchestrator.setAgentCapabilities": {
46715
49076
  capName: "pipeline-orchestrator",
46716
49077
  capScope: "system",
@@ -46723,12 +49084,6 @@ Object.freeze({
46723
49084
  addonId: null,
46724
49085
  access: "create"
46725
49086
  },
46726
- "pipelineOrchestrator.setAgentDetectWeight": {
46727
- capName: "pipeline-orchestrator",
46728
- capScope: "system",
46729
- addonId: null,
46730
- access: "create"
46731
- },
46732
49087
  "pipelineOrchestrator.setAgentInferenceDevices": {
46733
49088
  capName: "pipeline-orchestrator",
46734
49089
  capScope: "system",
@@ -46765,6 +49120,12 @@ Object.freeze({
46765
49120
  addonId: null,
46766
49121
  access: "create"
46767
49122
  },
49123
+ "pipelineOrchestrator.setCameraStepSettings": {
49124
+ capName: "pipeline-orchestrator",
49125
+ capScope: "system",
49126
+ addonId: null,
49127
+ access: "create"
49128
+ },
46768
49129
  "pipelineOrchestrator.setCameraStepToggle": {
46769
49130
  capName: "pipeline-orchestrator",
46770
49131
  capScope: "system",
@@ -46783,12 +49144,36 @@ Object.freeze({
46783
49144
  addonId: null,
46784
49145
  access: "create"
46785
49146
  },
49147
+ "pipelineOrchestrator.setLoadBalancingShares": {
49148
+ capName: "pipeline-orchestrator",
49149
+ capScope: "system",
49150
+ addonId: null,
49151
+ access: "create"
49152
+ },
46786
49153
  "pipelineOrchestrator.setPipelineDevicePin": {
46787
49154
  capName: "pipeline-orchestrator",
46788
49155
  capScope: "system",
46789
49156
  addonId: null,
46790
49157
  access: "create"
46791
49158
  },
49159
+ "pipelineOrchestrator.setShareSource": {
49160
+ capName: "pipeline-orchestrator",
49161
+ capScope: "system",
49162
+ addonId: null,
49163
+ access: "create"
49164
+ },
49165
+ "pipelineOrchestrator.startNodeBenchmark": {
49166
+ capName: "pipeline-orchestrator",
49167
+ capScope: "system",
49168
+ addonId: null,
49169
+ access: "create"
49170
+ },
49171
+ "pipelineOrchestrator.suggestShares": {
49172
+ capName: "pipeline-orchestrator",
49173
+ capScope: "system",
49174
+ addonId: null,
49175
+ access: "view"
49176
+ },
46792
49177
  "pipelineOrchestrator.unassignAudio": {
46793
49178
  capName: "pipeline-orchestrator",
46794
49179
  capScope: "system",
@@ -46801,8 +49186,8 @@ Object.freeze({
46801
49186
  addonId: null,
46802
49187
  access: "create"
46803
49188
  },
46804
- "pipelineOrchestrator.updateTemplate": {
46805
- capName: "pipeline-orchestrator",
49189
+ "pipelineRunner.abortNodeBench": {
49190
+ capName: "pipeline-runner",
46806
49191
  capScope: "system",
46807
49192
  addonId: null,
46808
49193
  access: "create"
@@ -46855,6 +49240,12 @@ Object.freeze({
46855
49240
  addonId: null,
46856
49241
  access: "view"
46857
49242
  },
49243
+ "pipelineRunner.getNodeBenchStatus": {
49244
+ capName: "pipeline-runner",
49245
+ capScope: "system",
49246
+ addonId: null,
49247
+ access: "view"
49248
+ },
46858
49249
  "pipelineRunner.getParkedTrackFrame": {
46859
49250
  capName: "pipeline-runner",
46860
49251
  capScope: "system",
@@ -46897,6 +49288,12 @@ Object.freeze({
46897
49288
  addonId: null,
46898
49289
  access: "create"
46899
49290
  },
49291
+ "pipelineRunner.startNodeBench": {
49292
+ capName: "pipeline-runner",
49293
+ capScope: "system",
49294
+ addonId: null,
49295
+ access: "create"
49296
+ },
46900
49297
  "plateGallery.assignPlate": {
46901
49298
  capName: "plate-gallery",
46902
49299
  capScope: "system",
@@ -48241,12 +50638,6 @@ Object.freeze({
48241
50638
  addonId: null,
48242
50639
  access: "view"
48243
50640
  },
48244
- "streamBroker.pullFrameHandles": {
48245
- capName: "stream-broker",
48246
- capScope: "system",
48247
- addonId: null,
48248
- access: "view"
48249
- },
48250
50641
  "streamBroker.regenerateRtspToken": {
48251
50642
  capName: "stream-broker",
48252
50643
  capScope: "system",
@@ -48313,12 +50704,6 @@ Object.freeze({
48313
50704
  addonId: null,
48314
50705
  access: "create"
48315
50706
  },
48316
- "streamBroker.subscribeFrames": {
48317
- capName: "stream-broker",
48318
- capScope: "system",
48319
- addonId: null,
48320
- access: "create"
48321
- },
48322
50707
  "streamBroker.unassignProfile": {
48323
50708
  capName: "stream-broker",
48324
50709
  capScope: "system",
@@ -48331,12 +50716,6 @@ Object.freeze({
48331
50716
  addonId: null,
48332
50717
  access: "create"
48333
50718
  },
48334
- "streamBroker.unsubscribeFrames": {
48335
- capName: "stream-broker",
48336
- capScope: "system",
48337
- addonId: null,
48338
- access: "create"
48339
- },
48340
50719
  "streamCatalog.getCatalog": {
48341
50720
  capName: "stream-catalog",
48342
50721
  capScope: "device",
@@ -48631,18 +51010,36 @@ Object.freeze({
48631
51010
  addonId: null,
48632
51011
  access: "delete"
48633
51012
  },
51013
+ "userManagement.findUserByExternalIdentity": {
51014
+ capName: "user-management",
51015
+ capScope: "system",
51016
+ addonId: null,
51017
+ access: "view"
51018
+ },
48634
51019
  "userManagement.getTotpStatus": {
48635
51020
  capName: "user-management",
48636
51021
  capScope: "system",
48637
51022
  addonId: null,
48638
51023
  access: "view"
48639
51024
  },
51025
+ "userManagement.linkExternalIdentity": {
51026
+ capName: "user-management",
51027
+ capScope: "system",
51028
+ addonId: null,
51029
+ access: "create"
51030
+ },
48640
51031
  "userManagement.listApiKeys": {
48641
51032
  capName: "user-management",
48642
51033
  capScope: "system",
48643
51034
  addonId: null,
48644
51035
  access: "view"
48645
51036
  },
51037
+ "userManagement.listExternalIdentities": {
51038
+ capName: "user-management",
51039
+ capScope: "system",
51040
+ addonId: null,
51041
+ access: "view"
51042
+ },
48646
51043
  "userManagement.listOauthSessions": {
48647
51044
  capName: "user-management",
48648
51045
  capScope: "system",
@@ -48721,6 +51118,12 @@ Object.freeze({
48721
51118
  addonId: null,
48722
51119
  access: "create"
48723
51120
  },
51121
+ "userManagement.unlinkExternalIdentity": {
51122
+ capName: "user-management",
51123
+ capScope: "system",
51124
+ addonId: null,
51125
+ access: "delete"
51126
+ },
48724
51127
  "userManagement.updateUser": {
48725
51128
  capName: "user-management",
48726
51129
  capScope: "system",
@@ -49033,6 +51436,12 @@ Object.freeze({
49033
51436
  addonId: null,
49034
51437
  access: "create"
49035
51438
  },
51439
+ "webrtcSession.applyDownlinkProbe": {
51440
+ capName: "webrtc-session",
51441
+ capScope: "device",
51442
+ addonId: null,
51443
+ access: "create"
51444
+ },
49036
51445
  "webrtcSession.closeSession": {
49037
51446
  capName: "webrtc-session",
49038
51447
  capScope: "device",
@@ -51050,11 +53459,6 @@ Object.freeze({
51050
53459
  form: "single",
51051
53460
  optional: false
51052
53461
  }],
51053
- "decoder.createSession": [{
51054
- name: "deviceId",
51055
- form: "single",
51056
- optional: true
51057
- }],
51058
53462
  "detectionPipeline.applyDeviceSettingsPatch": [{
51059
53463
  name: "deviceId",
51060
53464
  form: "single",
@@ -52025,6 +54429,11 @@ Object.freeze({
52025
54429
  form: "single",
52026
54430
  optional: false
52027
54431
  }],
54432
+ "pipelineAnalytics.addRetrainFrameFromRecording": [{
54433
+ name: "deviceId",
54434
+ form: "single",
54435
+ optional: false
54436
+ }],
52028
54437
  "pipelineAnalytics.applyDeviceSettingsPatch": [{
52029
54438
  name: "deviceId",
52030
54439
  form: "single",
@@ -52215,6 +54624,11 @@ Object.freeze({
52215
54624
  form: "single",
52216
54625
  optional: false
52217
54626
  }],
54627
+ "pipelineAnalytics.proposeRetrainAnnotationsWithLlm": [{
54628
+ name: "deviceId",
54629
+ form: "single",
54630
+ optional: false
54631
+ }],
52218
54632
  "pipelineAnalytics.pruneEventsBefore": [{
52219
54633
  name: "deviceId",
52220
54634
  form: "single",
@@ -52265,6 +54679,11 @@ Object.freeze({
52265
54679
  form: "single",
52266
54680
  optional: false
52267
54681
  }],
54682
+ "pipelineAnalytics.setRetrainFrameComplete": [{
54683
+ name: "deviceId",
54684
+ form: "single",
54685
+ optional: false
54686
+ }],
52268
54687
  "pipelineAnalytics.setTrackFlags": [{
52269
54688
  name: "deviceId",
52270
54689
  form: "single",
@@ -52285,6 +54704,11 @@ Object.freeze({
52285
54704
  form: "single",
52286
54705
  optional: false
52287
54706
  }],
54707
+ "pipelineExecutor.clearModelBoundDeviceOverrides": [{
54708
+ name: "deviceIds",
54709
+ form: "array",
54710
+ optional: true
54711
+ }],
52288
54712
  "pipelineExecutor.runPipeline": [{
52289
54713
  name: "deviceId",
52290
54714
  form: "single",
@@ -52390,6 +54814,11 @@ Object.freeze({
52390
54814
  form: "single",
52391
54815
  optional: false
52392
54816
  }],
54817
+ "pipelineOrchestrator.setCameraStepSettings": [{
54818
+ name: "deviceId",
54819
+ form: "single",
54820
+ optional: false
54821
+ }],
52393
54822
  "pipelineOrchestrator.setCameraStepToggle": [{
52394
54823
  name: "deviceId",
52395
54824
  form: "single",
@@ -53161,6 +55590,11 @@ Object.freeze({
53161
55590
  form: "single",
53162
55591
  optional: false
53163
55592
  }],
55593
+ "webrtcSession.applyDownlinkProbe": [{
55594
+ name: "deviceId",
55595
+ form: "single",
55596
+ optional: false
55597
+ }],
53164
55598
  "webrtcSession.closeSession": [{
53165
55599
  name: "deviceId",
53166
55600
  form: "single",
@@ -53694,7 +56128,7 @@ var STATE_SUMMARY_VARS = [
53694
56128
  {
53695
56129
  name: "summarySection",
53696
56130
  label: "Summary: this section",
53697
- description: "The section a per-section summary row is about (D698); on a summary sent as one message, every section it reports, comma-separated.",
56131
+ description: "The section a per-section summary row is about; on a summary sent as one message, every section it reports, comma-separated.",
53698
56132
  example: "Batterie scariche",
53699
56133
  group: "system",
53700
56134
  families: ["rule"],
@@ -56292,7 +58726,7 @@ var amcrestCameraSchema = object({
56292
58726
  port: number().int().min(1).max(65535).default(80).describe("HTTP CGI port"),
56293
58727
  https: boolean().default(false).describe("Use HTTPS for CGI"),
56294
58728
  username: string().default("admin").describe("Username"),
56295
- password: string().default("").describe("Password"),
58729
+ password: string().default("").describe("Password").meta({ secret: true }),
56296
58730
  channel: number().int().min(1).default(1).describe("Camera channel (1-based)"),
56297
58731
  deviceCache: amcrestDeviceCacheSchema.optional()
56298
58732
  });
@@ -59464,7 +61898,7 @@ function writeJpeg(res, bytes, headOnly) {
59464
61898
  * Node-only (`node:child_process`), so it lives under `@camstack/types/node`.
59465
61899
  */
59466
61900
  /** The detail a site refusing for want of a binary puts in its refusal. */
59467
- var NO_PINNED_FFMPEG_DETAIL = "no pinned ffmpeg on this node (D540)";
61901
+ var NO_PINNED_FFMPEG_DETAIL = "no pinned ffmpeg on this node";
59468
61902
  /**
59469
61903
  * {@link pinnedFfmpegSpawner}, asked at the point of use through the node's
59470
61904
  * resolver (`memoizePinnedFfmpeg`). A site that keeps the RESOLVER rather than