@camstack/addon-smtp-nodemailer 1.2.117 → 1.2.119

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.
@@ -36,7 +36,7 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
36
36
  }) : target, mod));
37
37
  var __toCommonJS = (mod) => __hasOwnProp.call(mod, "module.exports") ? mod["module.exports"] : __copyProps(__defProp({}, "__esModule", { value: true }), mod);
38
38
  //#endregion
39
- //#region ../types/dist/event-category-BGmz_oxW.mjs
39
+ //#region ../types/dist/event-category-DaIZi00R.mjs
40
40
  var EventCategory = /* @__PURE__ */ function(EventCategory) {
41
41
  EventCategory["SystemBoot"] = "system.boot";
42
42
  EventCategory["SystemAddonsReady"] = "system.addons-ready";
@@ -115,6 +115,13 @@ var EventCategory = /* @__PURE__ */ function(EventCategory) {
115
115
  */
116
116
  EventCategory["AddonLoadFailed"] = "addon.load-failed";
117
117
  /**
118
+ * A keychain value was stored or removed (D787). Carries the ref, its
119
+ * owner and the new version — NEVER the value. A process holding the ref
120
+ * drops its cached copy and the owning `BaseAddon` re-resolves its config.
121
+ * Telemetry (D8): a process that misses it still revalidates by version.
122
+ */
123
+ EventCategory["KeychainChanged"] = "keychain.changed";
124
+ /**
118
125
  * Addon recovered from a previous failure. Emitted when an addon
119
126
  * transitions from `failed` back to `healthy` (typically via the
120
127
  * monitor's auto-retry loop, or after manual `addons.retryLoad`).
@@ -537,15 +544,6 @@ var EventCategory = /* @__PURE__ */ function(EventCategory) {
537
544
  EventCategory["AgentWsDisconnected"] = "agent.ws.disconnected";
538
545
  EventCategory["AgentBackupActivated"] = "agent.backup.activated";
539
546
  EventCategory["OrchestrationSettingsUpdated"] = "orchestration.settings-updated";
540
- /**
541
- * Per-agent hwaccel preference changed (user override set, cleared, or
542
- * re-probed). Observability event — decoders pull the current pref at
543
- * `createSession`, so running sessions keep their current backend until
544
- * they rotate naturally (camera add/remove, stream restart). Future
545
- * work can wire a listener in stream-broker that force-rotates live
546
- * sessions; for now this event powers logs + admin-UI toast feedback.
547
- */
548
- EventCategory["PipelineAgentHwaccelChanged"] = "pipeline.agent-hwaccel-changed";
549
547
  EventCategory["MotionAnalysis"] = "detection.motion-analysis";
550
548
  /** All raw motion zones from CCL before minArea filter — for UI debug overlay. */
551
549
  EventCategory["MotionZonesRaw"] = "detection.motion-zones-raw";
@@ -5416,7 +5414,7 @@ var ZodIssueCode = {
5416
5414
  var ZodFirstPartyTypeKind;
5417
5415
  ZodFirstPartyTypeKind || (ZodFirstPartyTypeKind = {});
5418
5416
  //#endregion
5419
- //#region ../types/dist/sleep-DXKLNFvA.mjs
5417
+ //#region ../types/dist/sleep-Cr5YOk3m.mjs
5420
5418
  /**
5421
5419
  * The audio chunk plane's byte format, and the ONE expansion from a coded
5422
5420
  * window to float samples (D455).
@@ -5495,6 +5493,97 @@ function buildAlawTable() {
5495
5493
  }
5496
5494
  buildUlawTable();
5497
5495
  buildAlawTable();
5496
+ /** Is this field's stored value a credential? */
5497
+ function isSecretConfigField(field) {
5498
+ if (field.type === "password") return true;
5499
+ return "secret" in field && field.secret === true;
5500
+ }
5501
+ /**
5502
+ * Is this field's value stored in the KEYCHAIN (D787)? Every secret field is,
5503
+ * by its TYPE, unless it opts out with `storage: 'inline'` — never by its name.
5504
+ */
5505
+ function isKeychainStoredField(field) {
5506
+ if (!isSecretConfigField(field)) return false;
5507
+ if (field.type === "textarea" && field.isJson === true) return false;
5508
+ return !("storage" in field && field.storage === "inline");
5509
+ }
5510
+ /**
5511
+ * What a settings blob holds where a secret used to be.
5512
+ *
5513
+ * A keychain-stored field never holds its value. It holds a self-describing
5514
+ * MARKER, `{"$secret":"secret://…","v":1}` — an object, never a string, so no
5515
+ * code can mistake it for a credential and no form can send it to a camera as
5516
+ * a password. The empty state is `null` / absent, never `''`.
5517
+ *
5518
+ * The same shapes travel to and from the admin UI:
5519
+ *
5520
+ * - read: `hydrateSchema` hands a secret field a {@link SecretFieldView}
5521
+ * (`{ $secret, v, set: true }`) or `null` — the browser learns whether a
5522
+ * value is set, never the value.
5523
+ * - write: an untouched field submits the view back unchanged (KEEP); a typed
5524
+ * value is a plain non-empty string (CHANGE); the Clear button submits
5525
+ * {@link SECRET_CLEAR} (CLEAR). `''`, `null` and the legacy redaction tokens
5526
+ * are KEEP — an empty string is what a defaults-fallback pushes back, and
5527
+ * treating it as "clear" is how a save destroyed a stored credential before.
5528
+ *
5529
+ * Pure and browser-safe.
5530
+ */
5531
+ var SECRET_CLEAR = { $secretClear: true };
5532
+ /** The `'***'` token D634 redaction writes for non-admins. */
5533
+ var LEGACY_DEVICE_REDACTION = "***";
5534
+ function isRecord$1(value) {
5535
+ return typeof value === "object" && value !== null && !Array.isArray(value);
5536
+ }
5537
+ function makeSecretMarker(ref) {
5538
+ return {
5539
+ $secret: ref,
5540
+ v: 1
5541
+ };
5542
+ }
5543
+ /** A stored marker: an object whose `$secret` is a non-empty string. */
5544
+ function isSecretMarker(value) {
5545
+ if (!isRecord$1(value)) return false;
5546
+ const ref = value["$secret"];
5547
+ return typeof ref === "string" && ref.length > 0;
5548
+ }
5549
+ function isSecretClear(value) {
5550
+ return isRecord$1(value) && value["$secretClear"] === true;
5551
+ }
5552
+ /**
5553
+ * The UI view of a stored secret field value: a marker becomes "set", inline
5554
+ * plaintext becomes "set (inline)", nothing becomes `null`. A value never
5555
+ * survives this function.
5556
+ */
5557
+ function toSecretFieldView(stored) {
5558
+ if (isSecretMarker(stored)) return {
5559
+ $secret: stored.$secret,
5560
+ v: 1,
5561
+ set: true
5562
+ };
5563
+ if (typeof stored === "string" && stored.length > 0) return {
5564
+ $secret: null,
5565
+ v: 1,
5566
+ set: true,
5567
+ inline: true
5568
+ };
5569
+ return null;
5570
+ }
5571
+ /**
5572
+ * Classify an incoming value for a secret path. Only a non-empty string that is
5573
+ * not a redaction token sets a value; only {@link SECRET_CLEAR} clears.
5574
+ * Everything else — a marker (ours or anyone's), a UI view, `''`, `null`,
5575
+ * `undefined`, a redaction token, a non-string — keeps what is stored.
5576
+ */
5577
+ function classifySecretWrite(incoming) {
5578
+ if (isSecretClear(incoming)) return { kind: "clear" };
5579
+ if (typeof incoming !== "string") return { kind: "keep" };
5580
+ if (incoming.length === 0) return { kind: "keep" };
5581
+ if (incoming === "__camstack_redacted__" || incoming === LEGACY_DEVICE_REDACTION) return { kind: "keep" };
5582
+ return {
5583
+ kind: "set",
5584
+ value: incoming
5585
+ };
5586
+ }
5498
5587
  Object.fromEntries([
5499
5588
  {
5500
5589
  id: "overview",
@@ -5666,33 +5755,19 @@ Object.fromEntries([
5666
5755
  function isValuelessField(field) {
5667
5756
  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";
5668
5757
  }
5669
- /**
5670
- * Merge a `ConfigUISchema` with a raw `values` record into a
5671
- * `ConfigUISchemaWithValues`. Used by every `get*Settings` backend endpoint
5672
- * before returning to the admin UI. Groups are walked recursively.
5673
- *
5674
- * For each leaf field:
5675
- * - structural fields (`separator`, `info`, `button`) pass through unchanged
5676
- * - other fields get `value = values[key] ?? field.default ?? null`
5677
- *
5678
- * Unknown keys in `values` (keys not declared in the schema) are silently
5679
- * ignored — they don't contribute to the output. Missing keys fall back to
5680
- * the schema default or `null`. This mirrors the old backend behaviour where
5681
- * `FormBuilder` rendered `values[key] ?? field.default`.
5682
- */
5683
- function hydrateSchema(schema, values) {
5758
+ function hydrateSchema(schema, values, options = {}) {
5684
5759
  return {
5685
5760
  ...schema.tabs ? { tabs: [...schema.tabs] } : {},
5686
5761
  sections: schema.sections.map((section) => ({
5687
5762
  ...section,
5688
- fields: section.fields.map((field) => hydrateField(field, values))
5763
+ fields: section.fields.map((field) => hydrateField(field, values, options))
5689
5764
  }))
5690
5765
  };
5691
5766
  }
5692
- function hydrateField(field, values) {
5767
+ function hydrateField(field, values, options) {
5693
5768
  if (isValuelessField(field)) return field;
5694
5769
  if (field.type === "group") {
5695
- const hydratedChildren = field.fields.map((child) => hydrateField(child, values));
5770
+ const hydratedChildren = field.fields.map((child) => hydrateField(child, values, options));
5696
5771
  return {
5697
5772
  ...field,
5698
5773
  fields: hydratedChildren
@@ -5701,7 +5776,7 @@ function hydrateField(field, values) {
5701
5776
  if (field.type === "sub-tabs") {
5702
5777
  const hydratedTabs = field.tabs.map((tab) => ({
5703
5778
  ...tab,
5704
- fields: tab.fields.map((child) => hydrateField(child, values))
5779
+ fields: tab.fields.map((child) => hydrateField(child, values, options))
5705
5780
  }));
5706
5781
  return {
5707
5782
  ...field,
@@ -5711,6 +5786,33 @@ function hydrateField(field, values) {
5711
5786
  const key = field.key;
5712
5787
  const storedValue = Object.prototype.hasOwnProperty.call(values, key) ? values[key] : void 0;
5713
5788
  const defaultValue = field.default;
5789
+ const asView = (v) => isSecretMarker(v) || options.inlineSecretsAsViews === true && v !== void 0;
5790
+ if (isKeychainStoredField(field) && asView(storedValue)) return {
5791
+ ...field,
5792
+ value: toSecretFieldView(storedValue)
5793
+ };
5794
+ if (isKeychainStoredField(field) && options.inlineSecretsAsViews === true) return {
5795
+ ...field,
5796
+ value: null
5797
+ };
5798
+ if (field.type === "editable-array" && Array.isArray(storedValue)) {
5799
+ const secretItemKeys = field.itemFields.filter((item) => "key" in item && isKeychainStoredField(item)).map((item) => "key" in item ? item.key : "");
5800
+ if (secretItemKeys.length > 0) {
5801
+ const rows = storedValue.map((row) => {
5802
+ if (row === null || typeof row !== "object" || Array.isArray(row)) return row;
5803
+ const out = { ...row };
5804
+ for (const k of secretItemKeys) {
5805
+ const v = Reflect.get(row, k);
5806
+ if (asView(v)) out[k] = toSecretFieldView(v);
5807
+ }
5808
+ return out;
5809
+ });
5810
+ return {
5811
+ ...field,
5812
+ value: rows
5813
+ };
5814
+ }
5815
+ }
5714
5816
  if (field.multiple) {
5715
5817
  const stored = Array.isArray(storedValue) ? storedValue : storedValue !== void 0 && storedValue !== null ? [storedValue] : [];
5716
5818
  const itemFallback = field.multiple.itemDefault !== void 0 ? field.multiple.itemDefault : defaultValue !== void 0 ? defaultValue : typeOf(field) === "string" ? "" : null;
@@ -5953,6 +6055,431 @@ function projectStore(store, perNodeKeys, nodeId) {
5953
6055
  }
5954
6056
  return out;
5955
6057
  }
6058
+ var GLOBAL_SCOPE = { kind: "global" };
6059
+ /** The scope every addon-wide (not per-node, not per-device) setting lives in. */
6060
+ function globalSecretScope() {
6061
+ return GLOBAL_SCOPE;
6062
+ }
6063
+ function encodeSegment(value) {
6064
+ return encodeURIComponent(value);
6065
+ }
6066
+ /**
6067
+ * The field path of a value inside an array item, addressed by the item's id:
6068
+ * `arrayItemFieldPath('providers', 'authentik', 'clientSecret')` →
6069
+ * `providers[authentik].clientSecret`.
6070
+ */
6071
+ function arrayItemFieldPath(arrayKey, itemId, fieldKey) {
6072
+ return `${arrayKey}[${encodeSegment(itemId)}].${fieldKey}`;
6073
+ }
6074
+ /** A write to a secret path could not be stored in the keychain, so it was refused. */
6075
+ var KeychainWriteRefusedError = class extends Error {
6076
+ fieldPath;
6077
+ constructor(fieldPath, cause) {
6078
+ super(`secret "${fieldPath}" was not saved: the keychain could not store it (${cause instanceof Error ? cause.message : String(cause)}). Nothing was written.`);
6079
+ this.fieldPath = fieldPath;
6080
+ this.name = "KeychainWriteRefusedError";
6081
+ }
6082
+ };
6083
+ var KEEP = { kind: "keep" };
6084
+ function isRecord(value) {
6085
+ return typeof value === "object" && value !== null && !Array.isArray(value);
6086
+ }
6087
+ function defaultMintId() {
6088
+ return globalThis.crypto.randomUUID();
6089
+ }
6090
+ /** Every marker ref anywhere under `value`. */
6091
+ function collectSecretMarkerRefs(value, out = []) {
6092
+ if (isSecretMarker(value)) {
6093
+ out.push(value.$secret);
6094
+ return out;
6095
+ }
6096
+ if (Array.isArray(value)) for (const item of value) collectSecretMarkerRefs(item, out);
6097
+ else if (isRecord(value)) for (const child of Object.values(value)) collectSecretMarkerRefs(child, out);
6098
+ return out;
6099
+ }
6100
+ async function storedValueEquals(secrets, marker, candidate) {
6101
+ const resolved = (await secrets.resolve([marker.$secret]))[marker.$secret];
6102
+ return resolved?.kind === "value" && resolved.value === candidate;
6103
+ }
6104
+ async function writeLeaf(ctx, incoming, stored, fieldPath) {
6105
+ const intent = classifySecretWrite(incoming);
6106
+ const ref = ctx.secrets.ref(ctx.scope, fieldPath);
6107
+ const storedIsOurs = isSecretMarker(stored) && stored.$secret === ref;
6108
+ if (intent.kind === "keep") return KEEP;
6109
+ if (intent.kind === "set" && !ctx.operatorWrite && typeof stored === "string" && stored === intent.value) return KEEP;
6110
+ if (intent.kind === "clear") {
6111
+ if (storedIsOurs) ctx.deletes.push(ref);
6112
+ return {
6113
+ kind: "value",
6114
+ value: null
6115
+ };
6116
+ }
6117
+ if (storedIsOurs && await storedValueEquals(ctx.secrets, stored, intent.value)) return {
6118
+ kind: "value",
6119
+ value: stored
6120
+ };
6121
+ try {
6122
+ await ctx.secrets.put(ref, intent.value);
6123
+ } catch (err) {
6124
+ throw new KeychainWriteRefusedError(fieldPath, err);
6125
+ }
6126
+ return {
6127
+ kind: "value",
6128
+ value: makeSecretMarker(ref)
6129
+ };
6130
+ }
6131
+ /** Apply a member result onto `out`: KEEP restores the stored member, or removes it. */
6132
+ function applyMember(out, key, result, storedParent) {
6133
+ if (result.kind === "value") {
6134
+ out[key] = result.value;
6135
+ return;
6136
+ }
6137
+ if (Object.prototype.hasOwnProperty.call(storedParent, key)) out[key] = storedParent[key];
6138
+ else delete out[key];
6139
+ }
6140
+ async function writeMembers(ctx, children, incoming, stored, pathOf) {
6141
+ const out = { ...incoming };
6142
+ for (const [member, node] of children) applyMember(out, member, await writeNode(ctx, node, incoming[member], stored[member], pathOf(member)), stored);
6143
+ return out;
6144
+ }
6145
+ function rowId(row, idKey) {
6146
+ const raw = row[idKey];
6147
+ if (typeof raw === "string" && raw.length > 0) return raw;
6148
+ if (typeof raw === "number" && Number.isFinite(raw)) return String(raw);
6149
+ return null;
6150
+ }
6151
+ async function writeArray(ctx, node, incoming, stored, fieldPath) {
6152
+ const storedRows = Array.isArray(stored) ? stored.filter(isRecord) : [];
6153
+ if (!Array.isArray(incoming)) {
6154
+ ctx.deletes.push(...collectSecretMarkerRefs(storedRows));
6155
+ return {
6156
+ kind: "value",
6157
+ value: incoming
6158
+ };
6159
+ }
6160
+ const storedById = /* @__PURE__ */ new Map();
6161
+ for (const row of storedRows) {
6162
+ const id = rowId(row, node.idKey);
6163
+ if (id !== null) storedById.set(id, row);
6164
+ }
6165
+ const kept = /* @__PURE__ */ new Set();
6166
+ const rows = [];
6167
+ for (const row of incoming) {
6168
+ if (!isRecord(row)) {
6169
+ rows.push(row);
6170
+ continue;
6171
+ }
6172
+ const id = rowId(row, node.idKey) ?? ctx.mintId();
6173
+ kept.add(id);
6174
+ const withId = {
6175
+ ...row,
6176
+ [node.idKey]: row[node.idKey] ?? id
6177
+ };
6178
+ if (rowId(withId, node.idKey) === null) withId[node.idKey] = id;
6179
+ const storedRow = storedById.get(id) ?? {};
6180
+ rows.push(await writeMembers(ctx, node.item, withId, storedRow, (member) => arrayItemFieldPath(fieldPath, id, member)));
6181
+ }
6182
+ for (const [id, row] of storedById) if (!kept.has(id)) ctx.deletes.push(...collectSecretMarkerRefs(row));
6183
+ return {
6184
+ kind: "value",
6185
+ value: rows
6186
+ };
6187
+ }
6188
+ async function writeNode(ctx, node, incoming, stored, fieldPath) {
6189
+ switch (node.kind) {
6190
+ case "leaf": return writeLeaf(ctx, incoming, stored, fieldPath);
6191
+ case "array": return writeArray(ctx, node, incoming, stored, fieldPath);
6192
+ case "object": {
6193
+ if (!isRecord(incoming)) {
6194
+ if (incoming === void 0) return KEEP;
6195
+ ctx.deletes.push(...collectSecretMarkerRefs(stored));
6196
+ return {
6197
+ kind: "value",
6198
+ value: incoming
6199
+ };
6200
+ }
6201
+ const storedObj = isRecord(stored) ? stored : {};
6202
+ return {
6203
+ kind: "value",
6204
+ value: await writeMembers(ctx, node.children, incoming, storedObj, (m) => `${fieldPath}.${m}`)
6205
+ };
6206
+ }
6207
+ }
6208
+ }
6209
+ /** Split a perNode-scoped key (`key@nodeId`). */
6210
+ function splitNodeKey(key) {
6211
+ const at = key.indexOf("@");
6212
+ return at <= 0 ? {
6213
+ base: key,
6214
+ nodeId: null
6215
+ } : {
6216
+ base: key.slice(0, at),
6217
+ nodeId: key.slice(at + 1)
6218
+ };
6219
+ }
6220
+ /** Rewrite a settings patch so no secret value reaches the blob. See the file doc. */
6221
+ async function transformSecretWrite(input) {
6222
+ const deletes = [];
6223
+ const base = {
6224
+ secrets: input.secrets,
6225
+ mintId: input.mintId ?? defaultMintId,
6226
+ deletes,
6227
+ operatorWrite: input.operatorWrite === true
6228
+ };
6229
+ const out = {};
6230
+ for (const [key, incoming] of Object.entries(input.patch)) {
6231
+ const { base: baseKey, nodeId } = splitNodeKey(key);
6232
+ const node = input.tree.get(baseKey);
6233
+ if (node === void 0) {
6234
+ out[key] = incoming;
6235
+ continue;
6236
+ }
6237
+ const scope = nodeId !== null && nodeId.length > 0 ? {
6238
+ kind: "node",
6239
+ nodeId
6240
+ } : input.scope ?? globalSecretScope();
6241
+ const result = await writeNode({
6242
+ ...base,
6243
+ scope
6244
+ }, node, incoming, input.stored[key], baseKey);
6245
+ if (result.kind === "value") out[key] = result.value;
6246
+ }
6247
+ return {
6248
+ patch: out,
6249
+ afterWrite: async () => {
6250
+ if (deletes.length === 0) return { orphaned: [] };
6251
+ try {
6252
+ await input.secrets.delete([...new Set(deletes)]);
6253
+ return { orphaned: [] };
6254
+ } catch {
6255
+ return { orphaned: [...new Set(deletes)] };
6256
+ }
6257
+ }
6258
+ };
6259
+ }
6260
+ /**
6261
+ * Replace every marker in `value` with its keychain value. Returns the SAME
6262
+ * reference when there is no marker (no allocation, no keychain call).
6263
+ */
6264
+ async function resolveSecretMarkers(value, secrets) {
6265
+ const refs = collectSecretMarkerRefs(value);
6266
+ if (refs.length === 0) return {
6267
+ value,
6268
+ unresolved: []
6269
+ };
6270
+ const answers = await secrets.resolve(refs);
6271
+ const unresolved = [];
6272
+ for (const ref of new Set(refs)) {
6273
+ const answer = answers[ref];
6274
+ if (answer === void 0) unresolved.push({
6275
+ ref,
6276
+ reason: "not-initialized"
6277
+ });
6278
+ else if (answer.kind === "unavailable") unresolved.push({
6279
+ ref,
6280
+ reason: answer.reason
6281
+ });
6282
+ else if (answer.kind === "missing" || answer.kind === "forbidden") unresolved.push({
6283
+ ref,
6284
+ reason: answer.kind
6285
+ });
6286
+ }
6287
+ const substitute = (v) => {
6288
+ if (isSecretMarker(v)) {
6289
+ const answer = answers[v.$secret];
6290
+ return answer?.kind === "value" ? {
6291
+ keep: true,
6292
+ value: answer.value
6293
+ } : {
6294
+ keep: false,
6295
+ value: void 0
6296
+ };
6297
+ }
6298
+ if (Array.isArray(v)) {
6299
+ const items = [];
6300
+ for (const item of v) {
6301
+ const s = substitute(item);
6302
+ if (s.keep) items.push(s.value);
6303
+ }
6304
+ return {
6305
+ keep: true,
6306
+ value: items
6307
+ };
6308
+ }
6309
+ if (isRecord(v)) {
6310
+ const out = {};
6311
+ for (const [k, child] of Object.entries(v)) {
6312
+ const s = substitute(child);
6313
+ if (s.keep) out[k] = s.value;
6314
+ }
6315
+ return {
6316
+ keep: true,
6317
+ value: out
6318
+ };
6319
+ }
6320
+ return {
6321
+ keep: true,
6322
+ value: v
6323
+ };
6324
+ };
6325
+ return {
6326
+ value: substitute(value).value,
6327
+ unresolved
6328
+ };
6329
+ }
6330
+ function touchesTree(tree, patch) {
6331
+ if (tree.size === 0) return false;
6332
+ for (const key of Object.keys(patch)) {
6333
+ const at = key.indexOf("@");
6334
+ if (tree.has(at > 0 ? key.slice(0, at) : key)) return true;
6335
+ }
6336
+ return false;
6337
+ }
6338
+ /** The blob as stored now; a failed read REFUSES the write instead of guessing. */
6339
+ async function readStoredAddonBlob(raw) {
6340
+ const threeWay = raw.readAddonStoreResult;
6341
+ if (threeWay === void 0) return raw.readAddonStore();
6342
+ const result = await threeWay.call(raw);
6343
+ if (result.kind === "failed") throw new Error(`settings write refused: the stored blob could not be read (${result.error})`);
6344
+ return result.kind === "missing" ? {} : result.value;
6345
+ }
6346
+ function createSecretAwareSettings(raw, opts) {
6347
+ const chains = /* @__PURE__ */ new Map();
6348
+ const serialize = (key, fn) => {
6349
+ const next = (chains.get(key) ?? Promise.resolve()).then(fn, fn);
6350
+ const tail = next.catch(() => void 0);
6351
+ chains.set(key, tail);
6352
+ tail.then(() => {
6353
+ if (chains.get(key) === tail) chains.delete(key);
6354
+ });
6355
+ return next;
6356
+ };
6357
+ const write = async (chainKey, tree, scope, patch, readStored, rawWrite) => {
6358
+ if (!touchesTree(tree, patch)) return rawWrite(patch);
6359
+ return serialize(chainKey, async () => {
6360
+ const stored = await readStored();
6361
+ const result = await transformSecretWrite({
6362
+ tree,
6363
+ secrets: opts.secrets,
6364
+ patch,
6365
+ stored,
6366
+ ...scope !== void 0 ? { scope } : {},
6367
+ operatorWrite: opts.isOperatorWrite?.() === true
6368
+ });
6369
+ if (Object.keys(result.patch).length > 0) await rawWrite(result.patch);
6370
+ const { orphaned } = await result.afterWrite();
6371
+ if (orphaned.length > 0) opts.onOrphaned(orphaned);
6372
+ });
6373
+ };
6374
+ const wrapped = {
6375
+ writeAddonStore: (patch) => write("addon", opts.addonTree(), void 0, patch, () => readStoredAddonBlob(raw), (p) => raw.writeAddonStore(p)),
6376
+ writeDeviceStore: (deviceId, patch) => write(`device:${deviceId}`, opts.deviceTree(), {
6377
+ kind: "device",
6378
+ deviceId
6379
+ }, patch, () => raw.readDeviceStore(deviceId), (p) => raw.writeDeviceStore(deviceId, p))
6380
+ };
6381
+ return new Proxy(raw, { get(target, prop, receiver) {
6382
+ if (prop === "writeAddonStore") return wrapped.writeAddonStore;
6383
+ if (prop === "writeDeviceStore") return wrapped.writeDeviceStore;
6384
+ const value = Reflect.get(target, prop, receiver);
6385
+ return typeof value === "function" ? value.bind(target) : value;
6386
+ } });
6387
+ }
6388
+ /** The context the addon sees: identical, except that its settings writes are secret-aware. */
6389
+ function withSecretAwareSettings(context, opts) {
6390
+ const raw = context.settings;
6391
+ if (raw === void 0) return context;
6392
+ const settings = createSecretAwareSettings(raw, opts);
6393
+ return new Proxy(context, { get(target, prop, receiver) {
6394
+ if (prop === "settings") return settings;
6395
+ return Reflect.get(target, prop, receiver);
6396
+ } });
6397
+ }
6398
+ var LEAF = { kind: "leaf" };
6399
+ var DEFAULT_ITEM_ID_KEY = "id";
6400
+ function collectFields(fields, out) {
6401
+ for (const field of fields) {
6402
+ if (field.type === "group") {
6403
+ collectFields(field.fields, out);
6404
+ continue;
6405
+ }
6406
+ if (field.type === "sub-tabs") {
6407
+ for (const tab of field.tabs) collectFields(tab.fields, out);
6408
+ continue;
6409
+ }
6410
+ if (field.type === "editable-array") {
6411
+ const item = /* @__PURE__ */ new Map();
6412
+ for (const itemField of field.itemFields) if ("key" in itemField && isKeychainStoredField(itemField)) item.set(itemField.key, LEAF);
6413
+ if (item.size > 0) out.set(field.key, {
6414
+ kind: "array",
6415
+ idKey: field.itemIdKey ?? DEFAULT_ITEM_ID_KEY,
6416
+ item
6417
+ });
6418
+ continue;
6419
+ }
6420
+ if (!("key" in field) || typeof field.key !== "string") continue;
6421
+ if (isKeychainStoredField(field)) out.set(field.key, LEAF);
6422
+ }
6423
+ }
6424
+ /** The secret tree a settings schema declares. */
6425
+ function secretTreeFromSchema(schema) {
6426
+ const out = /* @__PURE__ */ new Map();
6427
+ if (schema === null) return out;
6428
+ for (const section of schema.sections) collectFields(section.fields, out);
6429
+ return out;
6430
+ }
6431
+ /** Parse `a.b[id].c` into segments; throws on a malformed path (a declaration bug). */
6432
+ function parseSecretStatePath(path) {
6433
+ const segments = [];
6434
+ for (const raw of path.split(".")) {
6435
+ const m = /^([^[\]]+)(?:\[([^[\]]+)\])?$/.exec(raw);
6436
+ if (m === null || m[1] === void 0) throw new Error(`secretStatePaths: malformed path "${path}"`);
6437
+ segments.push(m[2] !== void 0 ? {
6438
+ key: m[1],
6439
+ idKey: m[2]
6440
+ } : { key: m[1] });
6441
+ }
6442
+ if (segments.length === 0) throw new Error(`secretStatePaths: empty path`);
6443
+ if (segments[segments.length - 1]?.idKey !== void 0) throw new Error(`secretStatePaths: "${path}" ends on an array — name the member that is secret`);
6444
+ return segments;
6445
+ }
6446
+ function insert(into, segments) {
6447
+ const [head, ...rest] = segments;
6448
+ if (head === void 0) return;
6449
+ if (rest.length === 0) {
6450
+ into.set(head.key, LEAF);
6451
+ return;
6452
+ }
6453
+ const existing = into.get(head.key);
6454
+ if (head.idKey !== void 0) {
6455
+ const item = new Map(existing?.kind === "array" ? existing.item : []);
6456
+ insert(item, rest);
6457
+ into.set(head.key, {
6458
+ kind: "array",
6459
+ idKey: head.idKey,
6460
+ item
6461
+ });
6462
+ return;
6463
+ }
6464
+ const children = new Map(existing?.kind === "object" ? existing.children : []);
6465
+ insert(children, rest);
6466
+ into.set(head.key, {
6467
+ kind: "object",
6468
+ children
6469
+ });
6470
+ }
6471
+ /** Add hidden-state paths (`secretStatePaths`) to a schema-derived tree. */
6472
+ function mergeSecretStatePaths(tree, paths) {
6473
+ if (paths.length === 0) return tree;
6474
+ const out = new Map(tree);
6475
+ for (const path of paths) insert(out, parseSecretStatePath(path));
6476
+ return out;
6477
+ }
6478
+ /** First retry of a secret the keychain could not serve; doubles to {@link SECRET_RETRY_MAX_MS}. */
6479
+ var SECRET_RETRY_FIRST_MS = 5e3;
6480
+ var SECRET_RETRY_MAX_MS = 5 * 6e4;
6481
+ /** Coalesces a burst of `keychain.changed` events into one re-resolve. */
6482
+ var SECRET_CHANGE_DEBOUNCE_MS = 250;
5956
6483
  /**
5957
6484
  * Base class for CamStack addons. Eliminates settings boilerplate:
5958
6485
  *
@@ -6022,6 +6549,25 @@ var BaseAddon = class {
6022
6549
  settingsStoreReady = false;
6023
6550
  /** Default config values. Provided via constructor. */
6024
6551
  defaults;
6552
+ /**
6553
+ * Hidden-state paths that hold secrets (D787) — values the addon writes
6554
+ * itself (`updateGlobalSettings`, `state()`) that no form field declares.
6555
+ * Stored in the keychain exactly like a `password` field. Syntax:
6556
+ * `'snapshotSigningKey'`, `'identity.pincode'`, `'tokens[userId].accessToken'`
6557
+ * (`key[<id field>]` addresses array items by id, never by index).
6558
+ */
6559
+ secretStatePaths = [];
6560
+ _addonSecretTree = null;
6561
+ _deviceSecretTree = null;
6562
+ /** Refs the last resolved config pointed at — a change to one re-resolves. */
6563
+ _configSecretRefs = /* @__PURE__ */ new Set();
6564
+ _unresolvedSecrets = [];
6565
+ _secretRetryTimer = null;
6566
+ _secretRetryDelayMs = SECRET_RETRY_FIRST_MS;
6567
+ _secretChangeTimer = null;
6568
+ _secretChangeUnsub = null;
6569
+ /** >0 while an OPERATOR's settings write is being applied. */
6570
+ _operatorWriteDepth = 0;
6025
6571
  constructor(defaults) {
6026
6572
  this.defaults = defaults;
6027
6573
  this._config = { ...defaults };
@@ -6057,8 +6603,18 @@ var BaseAddon = class {
6057
6603
  return this._config;
6058
6604
  }
6059
6605
  async initialize(context) {
6060
- this._ctx = context;
6606
+ const secrets = context.secrets;
6607
+ this._ctx = secrets !== void 0 ? withSecretAwareSettings(context, {
6608
+ secrets,
6609
+ addonTree: () => this.addonSecretTree(),
6610
+ deviceTree: () => this.deviceSecretTree(),
6611
+ onOrphaned: (refs) => context.logger.warn("keychain refs dropped by a settings write could not be deleted", { meta: { refs: [...refs] } }),
6612
+ isOperatorWrite: () => this._operatorWriteDepth > 0
6613
+ }) : context;
6061
6614
  await this.resolveConfig();
6615
+ if (secrets !== void 0) this._secretChangeUnsub = secrets.onChange((ref) => {
6616
+ if (this._configSecretRefs.has(ref)) this.scheduleSecretReresolve(SECRET_CHANGE_DEBOUNCE_MS);
6617
+ });
6062
6618
  const result = await this.onInitialize();
6063
6619
  this.emitLifecycle(EventCategory.AddonStarted);
6064
6620
  const normalized = normalizeAddonInitResult(result);
@@ -6091,6 +6647,12 @@ var BaseAddon = class {
6091
6647
  */
6092
6648
  async onHubReachable() {}
6093
6649
  async shutdown() {
6650
+ this._secretChangeUnsub?.();
6651
+ this._secretChangeUnsub = null;
6652
+ if (this._secretRetryTimer !== null) clearTimeout(this._secretRetryTimer);
6653
+ if (this._secretChangeTimer !== null) clearTimeout(this._secretChangeTimer);
6654
+ this._secretRetryTimer = null;
6655
+ this._secretChangeTimer = null;
6094
6656
  this.emitLifecycle(EventCategory.AddonStopped);
6095
6657
  if (this.autoEmitReadiness) this.emitReadinessForProviders("down");
6096
6658
  await this.onShutdown();
@@ -6169,7 +6731,7 @@ var BaseAddon = class {
6169
6731
  return hydrateSchema(schema, overlay ? {
6170
6732
  ...projected,
6171
6733
  ...overlay
6172
- } : projected);
6734
+ } : projected, { inlineSecretsAsViews: true });
6173
6735
  }
6174
6736
  /**
6175
6737
  * The integration-level view of this addon's settings: exactly the sections
@@ -6218,7 +6780,7 @@ var BaseAddon = class {
6218
6780
  return hydrateSchema({
6219
6781
  ...schema,
6220
6782
  sections
6221
- }, projected);
6783
+ }, projected, { inlineSecretsAsViews: true });
6222
6784
  }
6223
6785
  /**
6224
6786
  * The raw addon store PROJECTED onto the target node's bare per-node keys:
@@ -6272,18 +6834,50 @@ var BaseAddon = class {
6272
6834
  value: result.value[key]
6273
6835
  };
6274
6836
  }
6837
+ /**
6838
+ * The OPERATOR's write — a settings form or an admin API call, dispatched by
6839
+ * the kernel. Identical to {@link updateGlobalSettings}, except that a secret
6840
+ * the operator sends is stored as sent even when it equals a pre-keychain
6841
+ * inline value: the operator re-entering a password is a change, an addon
6842
+ * writing back what it read is not (D787).
6843
+ */
6844
+ async updateGlobalSettingsAsOperator(patch, nodeId) {
6845
+ this._operatorWriteDepth++;
6846
+ try {
6847
+ await this.applyGlobalPatch(patch, nodeId);
6848
+ } finally {
6849
+ this._operatorWriteDepth--;
6850
+ }
6851
+ }
6275
6852
  async updateGlobalSettings(patch, nodeId) {
6853
+ await this.applyGlobalPatch(patch, nodeId);
6854
+ }
6855
+ /**
6856
+ * REMOVE stored secrets — their keychain values and their markers (D787).
6857
+ *
6858
+ * Writing `''` to a secret field KEEPS what is stored (an empty string is
6859
+ * what a defaults fallback writes back, and it must never destroy a
6860
+ * credential), so code that means "forget this token" says so here. Without
6861
+ * a keychain (an older kernel) it writes `''`, as such code always did.
6862
+ */
6863
+ async clearSecrets(keys, nodeId) {
6864
+ const tree = this.addonSecretTree();
6865
+ const keychain = this._ctx?.secrets !== void 0;
6866
+ const patch = {};
6867
+ for (const key of keys) patch[key] = keychain && tree.has(key) ? SECRET_CLEAR : "";
6868
+ await this.applyGlobalPatch(patch, nodeId);
6869
+ }
6870
+ async applyGlobalPatch(barePatch, nodeId) {
6276
6871
  const keys = this.perNodeKeys();
6277
6872
  const localNode = normalizeNodeId(this._ctx?.kernel?.localNodeId);
6278
6873
  const target = normalizeNodeId(nodeId ?? this._ctx?.kernel?.localNodeId);
6279
- const barePatch = patch;
6280
6874
  const scoped = keys.size > 0 ? scopePatch(barePatch, keys, target) : barePatch;
6281
6875
  await this._ctx?.settings?.writeAddonStore(scoped);
6282
6876
  if (target !== localNode) return;
6283
6877
  await this.resolveConfig();
6284
6878
  await this.onConfigChanged();
6285
6879
  this.emitLifecycle(EventCategory.AddonUpdated, { level: "global" });
6286
- this.maybeAutoRestart(patch, this.globalSettingsSchema());
6880
+ this.maybeAutoRestart(Object.keys(barePatch), this.globalSettingsSchema());
6287
6881
  }
6288
6882
  /**
6289
6883
  * The set of field keys the global settings schema declares `perNode: true`
@@ -6308,7 +6902,7 @@ var BaseAddon = class {
6308
6902
  * time to return its response before the addon is torn down and
6309
6903
  * re-initialised by `AddonRegistryService.restartAddon`.
6310
6904
  */
6311
- maybeAutoRestart(patch, schema) {
6905
+ maybeAutoRestart(patchKeys, schema) {
6312
6906
  if (!schema) return;
6313
6907
  const restartKeys = /* @__PURE__ */ new Set();
6314
6908
  for (const section of schema.sections) for (const field of section.fields) {
@@ -6316,13 +6910,13 @@ var BaseAddon = class {
6316
6910
  if (field.requiresRestart) restartKeys.add(field.key);
6317
6911
  }
6318
6912
  if (restartKeys.size === 0) return;
6319
- if (!Object.keys(patch).some((k) => restartKeys.has(k))) return;
6913
+ if (!patchKeys.some((k) => restartKeys.has(k))) return;
6320
6914
  const ctx = this._ctx;
6321
6915
  if (!ctx) return;
6322
6916
  const addonId = ctx.id;
6323
6917
  setImmediate(() => {
6324
6918
  ctx.api.addons?.restartAddon?.mutate({ addonId }).then(() => {
6325
- ctx.logger.info("addon auto-restart triggered by restart-required setting change", { meta: { changedFields: Object.keys(patch).filter((k) => restartKeys.has(k)) } });
6919
+ ctx.logger.info("addon auto-restart triggered by restart-required setting change", { meta: { changedFields: patchKeys.filter((k) => restartKeys.has(k)) } });
6326
6920
  }).catch((err) => {
6327
6921
  ctx.logger.error("addon auto-restart failed", { meta: { error: err instanceof Error ? err.message : String(err) } });
6328
6922
  });
@@ -6331,7 +6925,7 @@ var BaseAddon = class {
6331
6925
  async getDeviceSettings(deviceId) {
6332
6926
  const schema = this.deviceSettingsSchema();
6333
6927
  if (!schema) return { sections: [] };
6334
- return hydrateSchema(schema, await this._ctx?.settings?.readDeviceStore(deviceId) ?? {});
6928
+ return hydrateSchema(schema, await this._ctx?.settings?.readDeviceStore(deviceId) ?? {}, { inlineSecretsAsViews: true });
6335
6929
  }
6336
6930
  async updateDeviceSettings(deviceId, patch) {
6337
6931
  await this._ctx?.settings?.writeDeviceStore(deviceId, patch);
@@ -6461,7 +7055,7 @@ var BaseAddon = class {
6461
7055
  * selection at boot (absent scoped key ⇒ the constructor default wins).
6462
7056
  */
6463
7057
  async resolveConfig() {
6464
- const stored = await this.readAddonStoreWithRetry();
7058
+ const stored = await this.resolveStoredSecrets(await this.readAddonStoreWithRetry());
6465
7059
  const perNode = this.perNodeKeys();
6466
7060
  const localNode = normalizeNodeId(this._ctx?.kernel?.localNodeId);
6467
7061
  const resolved = { ...this.defaults };
@@ -6486,7 +7080,7 @@ var BaseAddon = class {
6486
7080
  key,
6487
7081
  schema,
6488
7082
  fallback,
6489
- read: () => this.readAddonStoreWithRetry(),
7083
+ read: async () => this.resolveStoredSecrets(await this.readAddonStoreWithRetry()),
6490
7084
  write: async (patch) => {
6491
7085
  await this._ctx?.settings?.writeAddonStore(patch);
6492
7086
  },
@@ -6503,7 +7097,7 @@ var BaseAddon = class {
6503
7097
  key,
6504
7098
  schema,
6505
7099
  fallback,
6506
- read: async () => await this._ctx?.settings?.readDeviceStore(deviceId) ?? {},
7100
+ read: async () => this.resolveStoredSecrets(await this._ctx?.settings?.readDeviceStore(deviceId) ?? {}, false),
6507
7101
  write: async (patch) => {
6508
7102
  await this._ctx?.settings?.writeDeviceStore(deviceId, patch);
6509
7103
  },
@@ -6515,6 +7109,70 @@ var BaseAddon = class {
6515
7109
  } })
6516
7110
  });
6517
7111
  }
7112
+ /** The addon store's secret tree: schema fields by TYPE, plus `secretStatePaths`. */
7113
+ addonSecretTree() {
7114
+ this._addonSecretTree ??= mergeSecretStatePaths(secretTreeFromSchema(this.globalSettingsSchema()), this.secretStatePaths);
7115
+ return this._addonSecretTree;
7116
+ }
7117
+ deviceSecretTree() {
7118
+ this._deviceSecretTree ??= secretTreeFromSchema(this.deviceSettingsSchema());
7119
+ return this._deviceSecretTree;
7120
+ }
7121
+ /**
7122
+ * Secrets of this addon's stored config that could not be resolved on the
7123
+ * last read, with why. Non-empty means the addon is running WITHOUT them —
7124
+ * an addon whose function needs one should report itself degraded rather
7125
+ * than start on an empty credential.
7126
+ */
7127
+ get unresolvedSecrets() {
7128
+ return this._unresolvedSecrets;
7129
+ }
7130
+ /**
7131
+ * Substitute every keychain marker in a stored blob with its value. With no
7132
+ * keychain (no `ctx.secrets`) or no marker, the blob comes back unchanged.
7133
+ * An unresolvable value is LEFT OUT (never `''`), logged by ref — never by
7134
+ * value — and, when the cause can pass, retried with backoff. Nothing is
7135
+ * ever written back from here.
7136
+ */
7137
+ async resolveStoredSecrets(blob, trackForConfig = true) {
7138
+ const secrets = this._ctx?.secrets;
7139
+ if (secrets === void 0) return blob;
7140
+ const refs = collectSecretMarkerRefs(blob);
7141
+ if (trackForConfig) this._configSecretRefs = new Set(refs);
7142
+ if (refs.length === 0) {
7143
+ if (trackForConfig) this._unresolvedSecrets = [];
7144
+ return blob;
7145
+ }
7146
+ const { value, unresolved } = await resolveSecretMarkers(blob, secrets);
7147
+ if (trackForConfig) {
7148
+ this._unresolvedSecrets = unresolved;
7149
+ if (unresolved.length > 0) {
7150
+ this._ctx?.logger?.error?.("secret unavailable — running without it, will retry", { meta: { secrets: unresolved.map((u) => ({
7151
+ ref: u.ref,
7152
+ reason: u.reason
7153
+ })) } });
7154
+ if (unresolved.some((u) => u.reason !== "missing" && u.reason !== "forbidden")) {
7155
+ this.scheduleSecretReresolve(this._secretRetryDelayMs);
7156
+ this._secretRetryDelayMs = Math.min(this._secretRetryDelayMs * 2, SECRET_RETRY_MAX_MS);
7157
+ }
7158
+ } else this._secretRetryDelayMs = SECRET_RETRY_FIRST_MS;
7159
+ }
7160
+ return value;
7161
+ }
7162
+ /** Re-resolve the config (a keychain-only change, or a retry) and apply it. */
7163
+ scheduleSecretReresolve(delayMs) {
7164
+ const timerOf = delayMs === SECRET_CHANGE_DEBOUNCE_MS ? "_secretChangeTimer" : "_secretRetryTimer";
7165
+ if (this[timerOf] !== null) return;
7166
+ const timer = setTimeout(() => {
7167
+ this[timerOf] = null;
7168
+ if (this._ctx === null) return;
7169
+ this.resolveConfig().then(() => this.onConfigChanged()).catch((err) => {
7170
+ this._ctx?.logger?.error?.("re-resolving secrets failed", { meta: { error: err instanceof Error ? err.message : String(err) } });
7171
+ });
7172
+ }, delayMs);
7173
+ timer.unref?.();
7174
+ this[timerOf] = timer;
7175
+ }
6518
7176
  /**
6519
7177
  * Wrap `ctx.settings.readAddonStore()` with a short retry budget so a
6520
7178
  * transient settings-store outage (mid-restart of sqlite-settings, tsx-watch
@@ -6782,32 +7440,12 @@ object({
6782
7440
  audioCodec: string().optional(),
6783
7441
  metadata: record(string(), unknown()).readonly().optional()
6784
7442
  });
6785
- var EncodedPacketSchema = object({
6786
- type: _enum(["video", "audio"]),
6787
- data: _instanceof(Uint8Array),
6788
- pts: number(),
6789
- dts: number(),
6790
- keyframe: boolean(),
6791
- codec: string()
6792
- });
6793
- var DecodedFrameSchema = object({
6794
- data: _instanceof(Uint8Array),
6795
- width: number(),
6796
- height: number(),
6797
- format: _enum([
6798
- "jpeg",
6799
- "rgb",
6800
- "bgr",
6801
- "yuv420",
6802
- "gray"
6803
- ]),
6804
- timestamp: number()
6805
- });
6806
7443
  /**
6807
7444
  * Wire schema for `FrameHandle` — a zero-pixel, serialisable reference to a
6808
7445
  * frame in a shared-memory ring (Phase 5 / D9). Mirrors the `FrameHandle` TS
6809
- * interface in `interfaces/frame-handle.ts` field-for-field so a decoder cap
6810
- * method (`pullHandles`) can carry handles over tRPC / Moleculer.
7446
+ * interface in `interfaces/frame-handle.ts` field-for-field so a cap method
7447
+ * (the runner's native-crop and pipeline-executor inputs) can carry handles
7448
+ * over tRPC / Moleculer.
6811
7449
  *
6812
7450
  * The `satisfies` assertion below pins this schema to the interface: if a
6813
7451
  * field is added to / removed from `FrameHandle` without a matching schema
@@ -6833,50 +7471,6 @@ var FrameHandleSchema = object({
6833
7471
  slotCount: number().int().positive()
6834
7472
  });
6835
7473
  /**
6836
- * Pixel format a frame-handle subscriber can request from the broker
6837
- * (Phase 5 / D9). The packed, raster subset of `FrameFormat` — the formats a
6838
- * `frameSink: 'shm'` decoder session can write into a `FrameRing` slot.
6839
- * `jpeg` is excluded: a variable-length stream is not a fixed-stride ring
6840
- * payload, and no decoded-frame consumer requests it over the shm plane.
6841
- */
6842
- var FrameHandleFormatSchema = _enum([
6843
- "rgb",
6844
- "bgr",
6845
- "yuv420",
6846
- "gray"
6847
- ]);
6848
- /**
6849
- * Input for `stream-broker.subscribeFrames` (Phase 5 / D9). A consumer asks the
6850
- * broker for a `FrameHandle` stream of one `format`; the broker maintains one
6851
- * shared-memory ring per `(brokerId, format)` actually requested, so a `gray`
6852
- * subscriber (motion) and an `rgb` subscriber (detection) each read the format
6853
- * they asked for with no broker-side conversion.
6854
- */
6855
- var SubscribeFramesInputSchema = object({
6856
- brokerId: string(),
6857
- format: FrameHandleFormatSchema,
6858
- /**
6859
- * Optional reader-side cadence hint in frames per second. The broker does
6860
- * NOT throttle — latest-wins ring reads drop frames implicitly for a slow
6861
- * consumer. The value is echoed back in `SubscribeFramesResult.maxFps` so
6862
- * the consumer can pace its own `pullFrameHandles` polling.
6863
- */
6864
- maxFps: number().positive().optional(),
6865
- /** Short caller-identity tag (`motion`, `detection`, …) for diagnostics. */
6866
- tag: string().optional()
6867
- });
6868
- /**
6869
- * Result of `stream-broker.subscribeFrames`. The consumer then polls
6870
- * `pullFrameHandles({ subscriptionId, maxCount })` and feeds each returned
6871
- * `FrameHandle` to a `FrameRingReader`.
6872
- */
6873
- var SubscribeFramesResultSchema = object({
6874
- /** Opaque id the consumer passes to `pullFrameHandles` / `unsubscribeFrames`. */
6875
- subscriptionId: string(),
6876
- /** Reader-side cadence hint (frames/s) — echoes `SubscribeFramesInput.maxFps`. */
6877
- maxFps: number().nonnegative()
6878
- });
6879
- /**
6880
7474
  * Wire schema for a decoded audio chunk (Phase 5 / D9). Mirrors the
6881
7475
  * `DecodedAudioChunk` TS interface in `interfaces/stream-broker.ts`: PCM
6882
7476
  * sample bytes plus the track parameters a consumer needs to interpret them.
@@ -6884,8 +7478,8 @@ var SubscribeFramesResultSchema = object({
6884
7478
  * Audio chunks are tiny (a ~500ms AudioCodecSession window is a few KB of
6885
7479
  * Float32 PCM), so unlike video frames they ship their bytes INLINE over
6886
7480
  * tRPC / Moleculer — no shared-memory plane. `data` is typed `Uint8Array`
6887
- * (the wire-serialisable supertype of `Buffer`) to match `DecodedFrameSchema`
6888
- * / `EncodedPacketSchema`'s precedent; a `Buffer` is assignable to it.
7481
+ * (the wire-serialisable supertype of `Buffer`); a `Buffer` is assignable to
7482
+ * it.
6889
7483
  */
6890
7484
  var AudioChunkFormatSchema = _enum(AUDIO_CHUNK_FORMATS);
6891
7485
  var DecodedAudioChunkSchema = object({
@@ -6903,11 +7497,10 @@ var DecodedAudioChunkSchema = object({
6903
7497
  format: AudioChunkFormatSchema.optional()
6904
7498
  });
6905
7499
  /**
6906
- * Input for `stream-broker.subscribeAudioChunks` (Phase 5 / D9). The
6907
- * handle-free, ship-bytes-inline analogue of `subscribeFrames`: a consumer
6908
- * asks the broker for the decoded audio-chunk stream of one broker; the
6909
- * broker keeps a per-subscription bounded FIFO queue the consumer drains via
6910
- * `pullAudioChunks`.
7500
+ * Input for `stream-broker.subscribeAudioChunks` (Phase 5 / D9). Audio ships
7501
+ * its bytes inline: a consumer asks the broker for the decoded audio-chunk
7502
+ * stream of one broker; the broker keeps a per-subscription bounded FIFO queue
7503
+ * the consumer drains via `pullAudioChunks`.
6911
7504
  */
6912
7505
  var SubscribeAudioChunksInputSchema = object({
6913
7506
  brokerId: string(),
@@ -6938,9 +7531,7 @@ var BrokerStatsSchema = object({
6938
7531
  "stopped"
6939
7532
  ]),
6940
7533
  inputFps: number(),
6941
- decodeFps: number(),
6942
7534
  encodedSubscribers: number(),
6943
- decodedSubscribers: number(),
6944
7535
  uptimeMs: number(),
6945
7536
  bitrateKbps: number(),
6946
7537
  idrIntervalMs: number(),
@@ -6953,14 +7544,6 @@ var BrokerStatsSchema = object({
6953
7544
  preBufferMs: number(),
6954
7545
  preBufferPackets: number(),
6955
7546
  /**
6956
- * Moleculer node id of the decoder provider currently servicing this
6957
- * stream's decoded subscribers. `null` until the deferred decoder is
6958
- * created (no decoded clients yet, or codec not detected). Surfaces the
6959
- * runtime decoder placement so the UI can show "Decoder: <agent>" without
6960
- * a separate cap call per broker.
6961
- */
6962
- decoderNodeId: string().nullable(),
6963
- /**
6964
7547
  * Detected audio track parameters from the RTSP DESCRIBE / SDP. `null`
6965
7548
  * when the stream has no audio track or the broker is in cold start.
6966
7549
  * `supported = false` means the codec was detected but the local
@@ -10282,70 +10865,6 @@ var StorageLocationDeclarationSchema = object({
10282
10865
  "backup"
10283
10866
  ]).optional()
10284
10867
  });
10285
- var DecoderStatsSchema = object({
10286
- inputFps: number(),
10287
- outputFps: number(),
10288
- avgDecodeTimeMs: number(),
10289
- droppedFrames: number(),
10290
- /**
10291
- * Pull-mode adaptive-fps telemetry (optional — only pull sessions run the
10292
- * lag-driven controller; push sessions omit these). `lagMs` is the EWMA of
10293
- * the decoder's real-time drift (rising = falling behind live); `adaptiveFps`
10294
- * is the current lag-throttled emit rate (≤ `effectiveFps` ceiling).
10295
- */
10296
- lagMs: number().optional(),
10297
- effectiveFps: number().optional(),
10298
- adaptiveFps: number().optional()
10299
- });
10300
- var DecoderSessionConfigSchema = object({
10301
- codec: string(),
10302
- maxFps: number().default(0),
10303
- outputFormat: _enum([
10304
- "jpeg",
10305
- "rgb",
10306
- "bgr",
10307
- "yuv420",
10308
- "gray"
10309
- ]).default("jpeg"),
10310
- scale: number().default(1),
10311
- width: number().optional(),
10312
- height: number().optional(),
10313
- /**
10314
- * Identifier of the camera this decoder session serves. Optional
10315
- * because the cap is generic (any caller could request decode), but
10316
- * stream-broker passes it so decoder logs include `deviceId` for
10317
- * per-camera filtering when diagnosing failures (e.g. node-av
10318
- * sendPacket errors on a single hung camera).
10319
- */
10320
- deviceId: number().int().nonnegative().optional(),
10321
- /**
10322
- * Free-form tag for log scoping. Stream-broker uses
10323
- * `broker:<deviceId>/<profile>`. Decoder session logger surfaces it
10324
- * on every line so `grep tag=broker:5/high` filters one camera
10325
- * profile cleanly.
10326
- */
10327
- tag: string().optional(),
10328
- /**
10329
- * Where the session delivers decoded frames (Phase 5 / D9):
10330
- *
10331
- * - `'callback'` (default) — the legacy pixel path: decoded frames are
10332
- * buffered as `DecodedFrame`s and drained via `pullFrames`.
10333
- * - `'shm'` — the shared-memory frame plane: decoded frames are written
10334
- * into an OS shared-memory ring and drained as zero-pixel
10335
- * `FrameHandle`s via `pullHandles`. A session is one mode or the
10336
- * other — `pullFrames` returns nothing for an `'shm'` session and
10337
- * `pullHandles` returns nothing for a `'callback'` session.
10338
- */
10339
- frameSink: _enum(["callback", "shm"]).default("callback"),
10340
- /**
10341
- * Per-camera decoder DEBUG facility. When `true`, a pull-mode session emits
10342
- * a throttled (~1Hz) structured `decoder debug` line (effective/adaptive fps,
10343
- * real-time lag, dropped-frame delta, avg decode time, hwaccel). Mirrors the
10344
- * stream-broker's `streamingDebug` gate — off by default so production logs
10345
- * stay quiet and the emit path pays zero per-frame cost when disabled.
10346
- */
10347
- debug: boolean().optional()
10348
- });
10349
10868
  /**
10350
10869
  * Per-component log CHANNELS — the gate a hot path consults, and the registry
10351
10870
  * an addon declares its channels in.
@@ -10488,6 +11007,26 @@ var ClipSearchStrictnessSchema = _enum([
10488
11007
  "balanced",
10489
11008
  "strict"
10490
11009
  ]);
11010
+ /** Steps whose effect a root label can BE. */
11011
+ var LABEL_SUPPLY_STEP_IDS = [
11012
+ "animal-classifier",
11013
+ "vehicle-classifier",
11014
+ "package-detection"
11015
+ ];
11016
+ /** Steps whose box a root detection can BE. */
11017
+ var CROP_SUPPLY_STEP_IDS = ["plate-detection", "face-detection"];
11018
+ /**
11019
+ * Steps whose per-detection MASK a root detection can carry (D737). The live
11020
+ * mask step is `segmentation` — a frame-plane refiner that runs its own model
11021
+ * once per detection crop. (`instance-segmentation` is a dormant step id that
11022
+ * no camera tree carries.)
11023
+ */
11024
+ var MASK_SUPPLY_STEP_IDS = ["segmentation"];
11025
+ [
11026
+ ...LABEL_SUPPLY_STEP_IDS,
11027
+ ...CROP_SUPPLY_STEP_IDS,
11028
+ ...MASK_SUPPLY_STEP_IDS
11029
+ ];
10491
11030
  var MODEL_FORMATS = [
10492
11031
  "onnx",
10493
11032
  "coreml",
@@ -10516,7 +11055,53 @@ var ModelFormatEntrySchema = object({
10516
11055
  /** Multi-file payload (directory members or sibling files). */
10517
11056
  files: array(string()).readonly().optional(),
10518
11057
  /** Runtime(s) that can use this format. If omitted, inferred from ModelFormat key */
10519
- runtimes: array(_enum(["python"])).readonly().optional()
11058
+ runtimes: array(_enum(["python"])).readonly().optional(),
11059
+ /**
11060
+ * Content revision of the artefact, for one hosted OFF the CamStack mirror.
11061
+ * A format on the mirror leaves it unset: its revision (the sha256 of its
11062
+ * weight file) comes from the downloader's generated table, kept in step
11063
+ * with the mirror by `scripts/check-hosted-model-revisions.ts` (D744). A
11064
+ * node records the revision it downloaded next to the file
11065
+ * (`<file>.revision`); a copy with no record or a different one is stale
11066
+ * unless its weight file hashes to the revision, and a stale copy is
11067
+ * downloaded again, the old one serving until the new one is complete. No
11068
+ * revision at all ⇒ a file on disk is current, whatever it holds (D743).
11069
+ */
11070
+ revision: string().min(1).optional()
11071
+ });
11072
+ /**
11073
+ * What a node holds for one (model, format) (D746). `current` is a complete
11074
+ * copy at its catalog revision — exactly what `downloaded: true` means.
11075
+ * `stale` is bytes on disk that are not (yet) proven current under D743/D744:
11076
+ * no or a different revision record, or a missing sibling. `missing` is no
11077
+ * copy. `downloaded` alone folds `stale` into "not downloaded", which hid
11078
+ * reclaimable bytes and a copy about to be replaced.
11079
+ */
11080
+ var ModelOnDiskStateSchema = _enum([
11081
+ "current",
11082
+ "stale",
11083
+ "missing"
11084
+ ]);
11085
+ /**
11086
+ * The numeric precision of one format's BUILD (D746) — reported only when the
11087
+ * build states it (file-name token, an INT8 variant, an EdgeTPU compile, a
11088
+ * CamStack Core ML export). Absent means "not stated", never "fp32".
11089
+ */
11090
+ var ModelFormatPrecisionSchema = _enum([
11091
+ "fp32",
11092
+ "fp16",
11093
+ "int8"
11094
+ ]);
11095
+ /**
11096
+ * One format of one model as a node's `pipelineExecutor.getSchema` reports it.
11097
+ * `onDisk` / `precision` are optional for version skew: a runner that predates
11098
+ * them omits them, and a reader falls back to `downloaded`.
11099
+ */
11100
+ var PipelineModelFormatStatusSchema = object({
11101
+ downloaded: boolean(),
11102
+ sizeMB: number(),
11103
+ onDisk: ModelOnDiskStateSchema.optional(),
11104
+ precision: ModelFormatPrecisionSchema.optional()
10520
11105
  });
10521
11106
  /**
10522
11107
  * Extra file that must be downloaded alongside the model (e.g., labels JSON, dict.txt).
@@ -10557,11 +11142,11 @@ var ModelVariantGroupSchema = object({
10557
11142
  /** Quantization axis. Omit ⇒ the fp32 base build. */
10558
11143
  precision: _enum(["fp32", "int8"]).optional(),
10559
11144
  /**
10560
- * Speed-optimization axis. Omit ⇒ the standard build. `fast` marks a
10561
- * latency-optimized export (e.g. ReLU-activation variant) — the slot the
10562
- * future performance variants plug into.
11145
+ * Training / latency-variant axis. Omit ⇒ the standard build. `test` marks
11146
+ * an alternate training of the same family (Scrypted `relu_test`); chip
11147
+ * label is "Test".
10563
11148
  */
10564
- optimization: _enum(["standard", "fast"]).optional(),
11149
+ optimization: _enum(["standard", "test"]).optional(),
10565
11150
  /**
10566
11151
  * Input-resolution axis (square input side, px). Omit ⇒ the family's native
10567
11152
  * resolution (640 for yolo26). Reduced-input builds (320 / 256) are a big,
@@ -10584,9 +11169,10 @@ var ModelProviderIdSchema = _enum([
10584
11169
  * are per upstream. A persisted custom-model row written when this field was a
10585
11170
  * string still parses — the string is lifted into `{ weights }`.
10586
11171
  *
10587
- * Every licence surface (the admin "Models and licenses" page,
10588
- * `THIRD_PARTY_MODELS.md`, the Hugging Face model table) is GENERATED from
10589
- * these records by `scripts/gen-model-licenses.ts` (D661).
11172
+ * Every machine licence surface (`THIRD_PARTY_MODELS.md`, the Hugging Face
11173
+ * model table) is GENERATED from these records by
11174
+ * `scripts/gen-model-licenses.ts` (D661). Operator-facing docs live in
11175
+ * `camstack/docs` → `/docs/detection/models`.
10590
11176
  */
10591
11177
  var ModelLicenseSchema = preprocess((value) => typeof value === "string" ? { weights: value } : value, object({
10592
11178
  /** SPDX id of the WEIGHTS' terms, a `LicenseRef-*` for non-SPDX terms, or `UNKNOWN`. */
@@ -10619,6 +11205,46 @@ var ModelLicenseSchema = preprocess((value) => typeof value === "string" ? { wei
10619
11205
  /** True when the weights or their data forbid commercial use. */
10620
11206
  nonCommercial: boolean().optional()
10621
11207
  }));
11208
+ /**
11209
+ * One step a ROOT detector can supply from its own output (D730) — see
11210
+ * `ModelCatalogEntry.suppliesSteps`.
11211
+ *
11212
+ * - `label`: the root's raw class IS the step's answer. `labelToEffect` maps
11213
+ * the root's label to the step's vocabulary; `uncovered` is the vocabulary
11214
+ * the root cannot produce (shown as unavailable, never a blocker).
11215
+ * - `crop`: the root draws the box the step would have found (`license_plate`
11216
+ * for plate-detection, `face` for face-detection). The box becomes a detail
11217
+ * child of the `parentMacro` detection that contains it — never a track.
11218
+ * - `mask`: the root's decode emits an instance mask with every detection (a
11219
+ * YOLO26-seg root, D737) — the `segmentation` step's result, carried on the
11220
+ * detection in the shape that step produces. Derived from the model's
11221
+ * postprocessor on read, never stored by an import.
11222
+ */
11223
+ var RootStepSupplySchema = discriminatedUnion("kind", [
11224
+ object({
11225
+ kind: literal("label"),
11226
+ stepId: _enum(LABEL_SUPPLY_STEP_IDS),
11227
+ labelToEffect: record(string(), string()),
11228
+ uncovered: array(string()).readonly()
11229
+ }),
11230
+ object({
11231
+ kind: literal("crop"),
11232
+ stepId: _enum(CROP_SUPPLY_STEP_IDS),
11233
+ rootLabels: array(string()).readonly(),
11234
+ parentMacro: _enum(["vehicle", "person"]),
11235
+ childClass: _enum(["plate", "face"]),
11236
+ /**
11237
+ * The root's smaller input side, stamped on read by `rootSuppliesOf` from
11238
+ * the model entry — what a step's `minRootInputPx` gate judges. Never
11239
+ * stored by an import.
11240
+ */
11241
+ rootInputPx: number().int().positive().optional()
11242
+ }),
11243
+ object({
11244
+ kind: literal("mask"),
11245
+ stepId: _enum(MASK_SUPPLY_STEP_IDS)
11246
+ })
11247
+ ]);
10622
11248
  var ModelCatalogEntrySchema = object({
10623
11249
  id: string(),
10624
11250
  name: string(),
@@ -10684,6 +11310,35 @@ var ModelCatalogEntrySchema = object({
10684
11310
  */
10685
11311
  defaultConfidence: number().min(0).max(1).optional(),
10686
11312
  /**
11313
+ * Per-MODEL default of the per-class confidence floors (`minConfidence<Macro>`
11314
+ * on a detector step), keyed by macro class: `{ person: 0.45 }`. A class
11315
+ * absent here runs at the step slider's global default. The same row shape
11316
+ * the floor measurement produces (`model-floors.json`: modelId → floors), so
11317
+ * a measured table is copied in as-is. An operator override is bound to the
11318
+ * model it was made for and does not survive a model change (D738). A custom
11319
+ * / imported model may declare it; without it, the global defaults apply.
11320
+ */
11321
+ defaultClassFloors: record(string(), number().min(0).max(1)).optional(),
11322
+ /**
11323
+ * The inference precision this model's OpenVINO IR needs on an Intel GPU.
11324
+ * Absent ⇒ the device default (f16 on a GPU). Set to `'f32'` for an FP32 IR
11325
+ * that produces invalid output at f16 — measured 2026-10-07 for YOLO26
11326
+ * base IRs (`yolo26s`: 0 true / 146 false positives; `yolo26m*`: NaN
11327
+ * scores) on the Core Ultra iGPU and the N100. Threaded to the pool as
11328
+ * `PoolModelConfig.gpuInferencePrecision`; the pool sets
11329
+ * INFERENCE_PRECISION_HINT on a GPU only. Costs ~60% latency on the GPU.
11330
+ */
11331
+ gpuInferencePrecision: _enum(["f32", "f16"]).optional(),
11332
+ /**
11333
+ * ROOT detectors only: per supplied step (`animal-classifier`, …), the
11334
+ * minimum DETECTION score from which this root's own fine label (species,
11335
+ * vehicle type — D736 root supply) is taken (D741). Below it the detection
11336
+ * keeps its macro class without the fine label. `1` = never take it from
11337
+ * this root. Absent ⇒ no floor beyond the macro floor. The supplied step's
11338
+ * `minConfidence` slider, bound to the ROOT model, overrides it.
11339
+ */
11340
+ suppliedLabelFloors: record(string(), number().min(0).max(1)).optional(),
11341
+ /**
10687
11342
  * When true, the executor produces a landmark-aligned crop (similarity warp
10688
11343
  * onto the canonical template) before this step runs, instead of a plain
10689
11344
  * axis-aligned bbox crop. Required for face-recognition embedders (ArcFace):
@@ -10745,6 +11400,16 @@ var ModelCatalogEntrySchema = object({
10745
11400
  */
10746
11401
  classMap: DetectionCatalogClassMapSchema.optional(),
10747
11402
  /**
11403
+ * The pipeline steps this ROOT detector can supply from its own output
11404
+ * (D730): its labels name a step's effect (`deer` for `animal-classifier`)
11405
+ * or draw a step's box (`license_plate` for `plate-detection`). Computed at
11406
+ * import from THIS model's labelmap by `deriveRootSupplies`, never written
11407
+ * by hand and never assumed per family; a row without it is derived on read
11408
+ * (`rootSuppliesOf`). Whether a camera uses it is the step's own
11409
+ * `useRootModel` flag (`resolveRootSupply`).
11410
+ */
11411
+ suppliesSteps: array(RootStepSupplySchema).readonly().optional(),
11412
+ /**
10748
11413
  * The model's CLIP feature-space contract (text encoder, dimension, vector
10749
11414
  * index, token window, search floor) — see `clip-model.ts`. Present ONLY on a
10750
11415
  * CLIP image encoder; its absence is what "not a CLIP model" means to the
@@ -12346,13 +13011,6 @@ var BrokerRtspClientSchema = object({
12346
13011
  lastRtpAt: number(),
12347
13012
  bytesSent: number()
12348
13013
  });
12349
- var BrokerDecodedClientSchema = object({
12350
- tag: string(),
12351
- subscribedAt: number(),
12352
- maxFps: number(),
12353
- framesDelivered: number(),
12354
- framesDropped: number()
12355
- });
12356
13014
  var BrokerAudioClientSchema = object({
12357
13015
  tag: string(),
12358
13016
  subscribedAt: number(),
@@ -12444,7 +13102,6 @@ var BrokerEncodedClientSchema = object({
12444
13102
  });
12445
13103
  var BrokerClientsSchema = object({
12446
13104
  rtsp: array(BrokerRtspClientSchema).readonly(),
12447
- decoded: array(BrokerDecodedClientSchema).readonly(),
12448
13105
  audio: array(BrokerAudioClientSchema).readonly(),
12449
13106
  encoded: array(BrokerEncodedClientSchema).readonly(),
12450
13107
  pipeClients: number(),
@@ -12813,11 +13470,7 @@ method(object({
12813
13470
  auth: "admin"
12814
13471
  }), method(object({ brokerId: string() }), BrokerClientsSchema), method(object({
12815
13472
  brokerId: string(),
12816
- channel: _enum([
12817
- "rtsp",
12818
- "decoded",
12819
- "audio"
12820
- ]),
13473
+ channel: _enum(["rtsp", "audio"]),
12821
13474
  handle: string()
12822
13475
  }), object({ killed: boolean() }), {
12823
13476
  kind: "mutation",
@@ -12852,10 +13505,7 @@ method(object({
12852
13505
  }), method(SubscribeAudioChunksInputSchema, SubscribeAudioChunksResultSchema, { kind: "mutation" }), method(object({
12853
13506
  subscriptionId: string(),
12854
13507
  maxCount: number().int().positive().default(8)
12855
- }), array(DecodedAudioChunkSchema).readonly()), method(object({ subscriptionId: string() }), object({ released: boolean() }), { kind: "mutation" }), method(SubscribeFramesInputSchema, SubscribeFramesResultSchema, { kind: "mutation" }), method(object({
12856
- subscriptionId: string(),
12857
- maxCount: number().int().positive().default(4)
12858
- }), array(FrameHandleSchema).readonly()), method(object({ subscriptionId: string() }), object({ released: boolean() }), { kind: "mutation" }), method(object({
13508
+ }), array(DecodedAudioChunkSchema).readonly()), method(object({ subscriptionId: string() }), object({ released: boolean() }), { kind: "mutation" }), method(object({
12859
13509
  brokerId: string(),
12860
13510
  seconds: number().min(0).max(30)
12861
13511
  }), _void(), {
@@ -14013,53 +14663,201 @@ id: union([string(), number()]) }), {
14013
14663
  auth: "admin"
14014
14664
  });
14015
14665
  /**
14016
- * shm ring usage stats for a `frameSink: 'shm'` decoder session —
14017
- * exposed via `decoder.getShmStats` so downstream consumers can
14018
- * observe ring pressure (slot count, byte budget, hit/miss ratio).
14666
+ * `keychain` — the hub's encrypted store of secret values (D787).
14667
+ *
14668
+ * Settings blobs never hold a secret: they hold a marker
14669
+ * `{"$secret":"secret://<owner>/<scope>/<fieldPath>","v":1}` and the value
14670
+ * lives here, AES-256-GCM under a data key that a master key wraps. This cap
14671
+ * is the OWNER's door to its own values: every method is owner-checked
14672
+ * against the CALLER, never against anything the caller claims.
14673
+ *
14674
+ * Who the caller is: the transport stamps `callerAddonId` into the args of a
14675
+ * call that crossed a process (the parent `LocalChildRegistry` from the UDS
14676
+ * connection, the agent from its child's connection carried in
14677
+ * `$hub-cap-fwd`'s envelope). A stamp always overwrites; a wire call with no
14678
+ * stamp has its claim stripped. Only a hub in-process caller may state its own
14679
+ * identity — `ctx.secrets` does that with the addon id closed over. This is
14680
+ * identity against BUGS and misrouting, not against a malicious addon (every
14681
+ * runner is the same OS user): see the threat model in
14682
+ * `docs/design/2026-10-08-secrets-keychain.md`.
14683
+ *
14684
+ * `callerAddonId` is deliberately NOT in any input schema: the tRPC router
14685
+ * parses the input, so a session can never supply it, and the internal mount
14686
+ * floors every method to admin anyway (D240).
14687
+ *
14688
+ * Internal: addons reach it through `ctx.secrets`, never directly.
14019
14689
  */
14020
- var ShmRingStatsSchema = object({
14021
- sessionId: string(),
14022
- slotCount: number().int(),
14023
- slotByteLength: number().int(),
14024
- segmentBytes: number().int(),
14025
- budgetMb: number().int(),
14026
- framesWritten: number().int(),
14027
- getFrameHits: number().int(),
14028
- getFrameMisses: number().int()
14029
- });
14030
- method(object({ codec: string() }), boolean()), method(_void(), object({
14690
+ /** Why a value cannot be served right now. Never folded into "missing". */
14691
+ var KeychainUnavailableReasonSchema = _enum([
14692
+ "key-missing",
14693
+ "wrong-key",
14694
+ "key-file-unreadable",
14695
+ "store-unavailable",
14696
+ "not-initialized",
14697
+ "decrypt-failed"
14698
+ ]);
14699
+ var KeychainStateSchema = discriminatedUnion("state", [object({ state: literal("ready") }), object({
14700
+ state: literal("locked"),
14701
+ reason: KeychainUnavailableReasonSchema
14702
+ })]);
14703
+ var KeychainResolveEntrySchema = discriminatedUnion("kind", [
14704
+ object({
14705
+ kind: literal("value"),
14706
+ value: string(),
14707
+ version: number().int()
14708
+ }),
14709
+ object({ kind: literal("missing") }),
14710
+ object({
14711
+ kind: literal("unavailable"),
14712
+ reason: KeychainUnavailableReasonSchema
14713
+ }),
14714
+ object({ kind: literal("forbidden") })
14715
+ ]);
14716
+ var KeychainResolveResultSchema = record(string(), KeychainResolveEntrySchema);
14717
+ /** Metadata of one stored value — never the value. */
14718
+ var KeychainSecretMetaSchema = object({
14719
+ ref: string(),
14720
+ owner: string(),
14721
+ /** Formatted scope (`global`, `node/<id>`, `device/<id>`, …). */
14722
+ scope: string(),
14723
+ fieldPath: string(),
14724
+ version: number().int(),
14725
+ createdAt: number(),
14726
+ updatedAt: number(),
14727
+ /** `addon:<id>` | `user:<id>` | `system`. */
14728
+ updatedBy: string(),
14729
+ /** Coarse — written at most once an hour per ref. `null` = never read. */
14730
+ lastReadAt: number().nullable()
14731
+ });
14732
+ var RefListSchema = array(string().min(1)).max(512);
14733
+ method(object({
14734
+ ref: string().min(1),
14735
+ value: string().min(1)
14736
+ }), object({
14737
+ ref: string(),
14738
+ version: number().int()
14739
+ }), {
14740
+ kind: "mutation",
14741
+ auth: "admin"
14742
+ }), method(object({ refs: RefListSchema }), KeychainResolveResultSchema, { auth: "admin" }), method(object({ refs: RefListSchema }), object({ deleted: number().int() }), {
14743
+ kind: "mutation",
14744
+ auth: "admin"
14745
+ }), method(object({}), array(KeychainSecretMetaSchema).readonly(), { auth: "admin" }), method(object({}), KeychainStateSchema, { auth: "admin" });
14746
+ var KeychainKeySourceSchema = object({
14747
+ kind: _enum([
14748
+ "config-file",
14749
+ "previous-config-file",
14750
+ "platform",
14751
+ "default-file"
14752
+ ]),
14753
+ /** File sources only — a path is not a secret. */
14754
+ path: string().optional(),
14755
+ /**
14756
+ * True when a whole-volume backup of the data directory carries this key
14757
+ * next to the database it protects (the default file). The page warns.
14758
+ */
14759
+ sharesBackupWithDatabase: boolean()
14760
+ });
14761
+ var KeychainStatusSchema = object({
14762
+ keychain: KeychainStateSchema,
14763
+ /** The source of the master key in use; `null` while locked. */
14764
+ keySource: KeychainKeySourceSchema.nullable(),
14765
+ /** The source configured to be primary — differs from `keySource` while a rotation is pending. */
14766
+ configuredSource: KeychainKeySourceSchema,
14767
+ /** Short fingerprint of the master key in use (`HMAC(KEK, label)`, 16 hex). */
14768
+ fingerprint: string().nullable(),
14769
+ activeKeyId: string().nullable(),
14770
+ /**
14771
+ * The keychain unlocked with a NON-primary source: the configured primary
14772
+ * key is not the one that wraps the data key yet. `rotateMasterKey` moves it.
14773
+ */
14774
+ rotationPending: boolean(),
14775
+ /** Wrapped copies of the data key under a previous master key, kept until purged. */
14776
+ retiredWraps: number().int(),
14777
+ recoveryKeyDownloadedAt: number().nullable(),
14778
+ secretCount: number().int()
14779
+ });
14780
+ /**
14781
+ * Whether a stored value is still pointed at by its owner's settings.
14782
+ * `unknown` is a first-class answer: a scope whose blob could not be read is
14783
+ * never reported as an orphan (and never deleted as one).
14784
+ */
14785
+ var KeychainSecretUsageSchema = _enum([
14786
+ "in-use",
14787
+ "orphan",
14788
+ "unknown"
14789
+ ]);
14790
+ var KeychainAdminSecretSchema = KeychainSecretMetaSchema.extend({ usage: KeychainSecretUsageSchema });
14791
+ var KeychainAuditActionSchema = _enum([
14792
+ "put",
14793
+ "delete",
14794
+ "reveal",
14795
+ "rotate-master-key",
14796
+ "purge-retired-keys",
14797
+ "download-recovery-key",
14798
+ "delete-orphans",
14799
+ "reset",
14800
+ "initialize"
14801
+ ]);
14802
+ var KeychainAuditEntrySchema = object({
14803
+ id: string(),
14804
+ at: number(),
14805
+ action: KeychainAuditActionSchema,
14806
+ /** `addon:<id>` | `user:<id>` | `system`. */
14807
+ actor: string(),
14808
+ ref: string().nullable(),
14809
+ detail: string().nullable()
14810
+ });
14811
+ 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({
14812
+ value: string(),
14813
+ version: number().int()
14814
+ }), {
14815
+ kind: "mutation",
14816
+ auth: "admin",
14817
+ caller: "required"
14818
+ }), method(object({ refs: array(string().min(1)).max(1e3) }), object({
14819
+ deleted: array(string()).readonly(),
14820
+ kept: array(object({
14821
+ ref: string(),
14822
+ usage: KeychainSecretUsageSchema
14823
+ })).readonly()
14824
+ }), {
14825
+ kind: "mutation",
14826
+ auth: "admin",
14827
+ caller: "required"
14828
+ }), method(object({}), object({
14829
+ fingerprint: string(),
14830
+ keySource: KeychainKeySourceSchema
14831
+ }), {
14832
+ kind: "mutation",
14833
+ auth: "admin",
14834
+ caller: "required"
14835
+ }), method(object({}), object({ purged: number().int() }), {
14836
+ kind: "mutation",
14837
+ auth: "admin",
14838
+ caller: "required"
14839
+ }), method(object({}), object({
14840
+ key: string(),
14841
+ fingerprint: string(),
14842
+ keySource: KeychainKeySourceSchema
14843
+ }), {
14844
+ kind: "mutation",
14845
+ auth: "admin",
14846
+ caller: "required"
14847
+ }), method(object({ confirm: literal("RESET KEYCHAIN") }), object({
14848
+ archivedCollection: string().nullable(),
14849
+ archived: number().int()
14850
+ }), {
14851
+ kind: "mutation",
14852
+ auth: "admin",
14853
+ caller: "required"
14854
+ });
14855
+ method(_void(), object({
14031
14856
  id: string(),
14032
14857
  name: string(),
14033
- isPullMode: boolean().optional(),
14034
- priority: number().optional(),
14035
14858
  hwaccel: string().optional(),
14036
14859
  probedBestHwaccel: string().optional()
14037
- })), method(DecoderSessionConfigSchema, object({
14038
- sessionId: string(),
14039
- nodeId: string()
14040
- })), method(object({ sessionId: string() }), _void()), method(object({
14041
- sessionId: string(),
14042
- packet: EncodedPacketSchema
14043
- }), _void()), method(object({
14044
- sessionId: string(),
14045
- url: string()
14046
- }), _void()), method(object({
14047
- sessionId: string(),
14048
- maxCount: number().default(1),
14049
- waitMs: number().optional()
14050
- }), array(DecodedFrameSchema)), method(object({
14051
- sessionId: string(),
14052
- maxCount: number().default(1),
14053
- waitMs: number().optional()
14054
- }), array(FrameHandleSchema)), method(object({ handle: FrameHandleSchema }), DecodedFrameSchema.nullable()), method(object({ sessionId: string() }), ShmRingStatsSchema.nullable()), method(object({
14055
- sessionId: string(),
14056
- config: DecoderSessionConfigSchema.partial()
14057
- }), _void()), method(object({ sessionId: string() }), DecoderStatsSchema), method(_void(), array(object({
14058
- sessionId: string(),
14059
- codec: string(),
14060
- outputFormat: string(),
14061
- createdAtMs: number()
14062
- })).readonly()), method(_void(), object({ backend: string() }), {
14860
+ })), method(_void(), object({ backend: string() }), {
14063
14861
  kind: "mutation",
14064
14862
  auth: "admin"
14065
14863
  });
@@ -14115,7 +14913,7 @@ DeviceType.Camera;
14115
14913
  * This matters here more than anywhere else in the repo, because every provider
14116
14914
  * that knows a device's host knows its PASSWORD too: `{ host, port, username,
14117
14915
  * password }` sit in one object on Hikvision, Amcrest, Reolink and ONVIF alike,
14118
- * and `http://admin:hunter2@192.168.x.x/` is a URL a browser accepts. The
14916
+ * and `http://admin:hunter2@192.168.60.139/` is a URL a browser accepts. The
14119
14917
  * camera's own page will ask for its own login. That is correct, and pre-
14120
14918
  * filling it is the operator's business, not ours.
14121
14919
  *
@@ -14871,6 +15669,10 @@ var DeviceInfoSchema = object({
14871
15669
  isCamera: boolean(),
14872
15670
  /** Current config values — serializable snapshot */
14873
15671
  config: record(string(), unknown()),
15672
+ /** Paths inside `config` the device's schema declares secret (D783) —
15673
+ * what the non-admin redaction withholds. Paths, never values. Absent
15674
+ * when the owning runner has not reported them. */
15675
+ secretConfigPaths: array(string()).optional(),
14874
15676
  /** Hardware + identity blob (manufacturer / model / firmware / sn /
14875
15677
  * uid / mac / …). Populated by drivers; editable via setMetadata. */
14876
15678
  metadata: record(string(), unknown()).nullable().optional(),
@@ -15076,12 +15878,22 @@ var DeviceRegisterPayloadSchema = object({
15076
15878
  * call (workers re-register on init), so probe-driven updates
15077
15879
  * (e.g. PTZ flag flipping after the abilities probe) propagate. */
15078
15880
  features: array(string()).optional(),
15079
- config: record(string(), unknown())
15881
+ config: record(string(), unknown()),
15882
+ /** Config paths the device's own schema DECLARES secret
15883
+ * (`.meta({ secret: true })` — dotted, `[]` for array items, e.g.
15884
+ * `connection.password`). Re-published on every register; the non-admin
15885
+ * redaction withholds them at any depth (D783). Optional: an older runner
15886
+ * omits it and the keyword backstop applies. */
15887
+ secretConfigPaths: array(string()).optional()
15080
15888
  });
15081
15889
  var DeviceRemovePayloadSchema = object({ deviceId: number() });
15082
15890
  var DevicePersistConfigPayloadSchema = object({
15083
15891
  deviceId: number(),
15084
- data: record(string(), unknown())
15892
+ data: record(string(), unknown()),
15893
+ /** The paths the device's schema declares secret (D783), when the caller
15894
+ * knows them — those values are kept in the keychain, not the blob (D787).
15895
+ * Absent: the paths the device last reported at `registerDevice` apply. */
15896
+ secretConfigPaths: array(string()).optional()
15085
15897
  });
15086
15898
  /** What a migration actually did, per switch. `unreachable` is a first-class
15087
15899
  * answer: a camera that could not be asked is not a camera that was silenced. */
@@ -15903,6 +16715,12 @@ method(_void(), array(string()).readonly(), { auth: "admin" }), method(object({
15903
16715
  kind: "mutation",
15904
16716
  auth: "admin"
15905
16717
  });
16718
+ var HUB_ADDRESS_ROLES = [
16719
+ "appConnections",
16720
+ "notificationTaps",
16721
+ "internal",
16722
+ "publicEndpoint"
16723
+ ];
15906
16724
  /**
15907
16725
  * Transport bounds for AI capability methods.
15908
16726
  *
@@ -16729,7 +17547,14 @@ var LoginMethodContributionSchema = discriminatedUnion("kind", [
16729
17547
  icon: string().optional(),
16730
17548
  /** Addon-owned HTTP route the button navigates to (GET). */
16731
17549
  startUrl: string(),
16732
- stage: LoginStageEnum
17550
+ stage: LoginStageEnum,
17551
+ /**
17552
+ * The provider names an external identity a signed-in user can link to
17553
+ * their own account (D782): `auth.listLinkableProviders` /
17554
+ * `beginExternalLink` offer exactly the redirect methods that set this,
17555
+ * whatever their id. Absent / false — a login button only (magic-link).
17556
+ */
17557
+ linkable: boolean().optional()
16733
17558
  }),
16734
17559
  object({
16735
17560
  kind: literal("widget"),
@@ -17099,7 +17924,7 @@ method(object({
17099
17924
  timeoutMs: 6e5
17100
17925
  });
17101
17926
  method(object({
17102
- nodeId: string(),
17927
+ targetNodeId: string(),
17103
17928
  modelId: string(),
17104
17929
  format: _enum(MODEL_FORMATS),
17105
17930
  entry: ModelCatalogEntrySchema
@@ -18467,6 +19292,8 @@ var NcSystemEventKindSchema = _enum([
18467
19292
  "stream-offline",
18468
19293
  "node-online",
18469
19294
  "node-offline",
19295
+ "node-restarting",
19296
+ "node-updating",
18470
19297
  "node-inference-unavailable",
18471
19298
  "detection-blind",
18472
19299
  "addon-crash-loop",
@@ -19565,8 +20392,9 @@ var NcRuleSchema = NcRuleInputSchema.extend({
19565
20392
  disabledTargetIds: array(string()).default([])
19566
20393
  });
19567
20394
  /**
19568
- * The state-summary SECTIONS (D647 / D698): the D637 kind groups that report a
19569
- * still-true state. `backups-exports` and `alarm` are not sections — a completed
20395
+ * The state-summary SECTIONS (D647 / D698 / D708): the D637 kind groups that
20396
+ * report a still-true state. `addons` is the crash-looped addons only and
20397
+ * `addon-updates` the addons that are behind (D708 split them). `backups-exports` and `alarm` are not sections — a completed
19570
20398
  * job is not an open state, and the alarm stays instant.
19571
20399
  */
19572
20400
  var NcStateSummarySectionIdSchema = _enum([
@@ -19578,6 +20406,7 @@ var NcStateSummarySectionIdSchema = _enum([
19578
20406
  "detection-blind",
19579
20407
  "nodes",
19580
20408
  "addons",
20409
+ "addon-updates",
19581
20410
  "updates"
19582
20411
  ]);
19583
20412
  /** One section of a previewed state summary. `unavailable` = its state could not be read. */
@@ -20058,7 +20887,25 @@ var NcAlarmModeDelaysListSchema = array(object({
20058
20887
  * When this mode may be armed. Absent / null = always allowed (same as a
20059
20888
  * rule with no `schedule`). Evaluated with {@link isScheduleActive}.
20060
20889
  */
20061
- schedule: NcScheduleSchema.optional()
20890
+ schedule: NcScheduleSchema.optional(),
20891
+ /**
20892
+ * D706: while this mode's ENTRY DELAY runs, do the alarm rules' own pushes go out (as an
20893
+ * intrusion naming the locations)? Absent = false — the entry-delay notification is the
20894
+ * only one, and the matches ride the triggered notification's mosaic (D705).
20895
+ */
20896
+ notifyDuringEntryDelay: boolean().optional(),
20897
+ /**
20898
+ * D706: notify "watched again" when a sensor this arm bypassed closes and opens again.
20899
+ * Absent = false (logged, not sent). Even when true it is not sent when that same sensor
20900
+ * is the one that starts the entry delay — the entry-delay notification already names it.
20901
+ */
20902
+ notifySensorRewatched: boolean().optional(),
20903
+ /**
20904
+ * D735: notify "ignored" when a sensor this arm bypassed really MOVED while armed (its own
20905
+ * change time is after the arm) and set nothing off. Absent = false (logged, not sent). A
20906
+ * re-sync, a recovery from `unavailable` or a duplicate is never announced, switch or not.
20907
+ */
20908
+ notifySensorIgnored: boolean().optional()
20062
20909
  })).max(8).refine(uniqueModes, { message: "modeDelays: at most one entry per arm mode" });
20063
20910
  var NcAlarmModeDelaysEditListSchema = array(object({
20064
20911
  mode: AlarmArmModeSchema,
@@ -20067,7 +20914,13 @@ var NcAlarmModeDelaysEditListSchema = array(object({
20067
20914
  triggeredDurationSec: NcAlarmTriggeredSecSchema.nullable().optional(),
20068
20915
  postTriggeredAction: NcAlarmPostTriggeredActionSchema.nullable().optional(),
20069
20916
  /** Set a schedule, or `null` to clear (mode always allowed again). */
20070
- schedule: NcScheduleSchema.nullable().optional()
20917
+ schedule: NcScheduleSchema.nullable().optional(),
20918
+ /** D706: set the switch, or `null` to clear it (back to the default, false). */
20919
+ notifyDuringEntryDelay: boolean().nullable().optional(),
20920
+ /** D706: set the switch, or `null` to clear it (back to the default, false). */
20921
+ notifySensorRewatched: boolean().nullable().optional(),
20922
+ /** D735: set the switch, or `null` to clear it (back to the default, false). */
20923
+ notifySensorIgnored: boolean().nullable().optional()
20071
20924
  })).max(8).refine(uniqueModes, { message: "modeDelays: at most one edit per arm mode" });
20072
20925
  /** One switch of the alarm table: put ONE device on, or take it off, ONE mode's list. */
20073
20926
  var NcAlarmNonBlockingEditSchema = object({
@@ -21028,45 +21881,25 @@ Object.freeze(Object.fromEntries([{
21028
21881
  label: "Face recognition model",
21029
21882
  defaultModelId: "auraface-r100",
21030
21883
  indexName: "the enrolled face gallery",
21031
- options: [
21032
- {
21033
- id: "auraface-r100",
21034
- label: "AuraFace R100"
21035
- },
21036
- {
21037
- id: "arcface-r100",
21038
- label: "ArcFace (ResNet34)"
21039
- },
21040
- {
21041
- id: "inception-resnet-v1",
21042
- label: "Inception ResNet V1"
21043
- }
21044
- ]
21884
+ options: [{
21885
+ id: "auraface-r100",
21886
+ label: "AuraFace R100"
21887
+ }]
21045
21888
  }, {
21046
21889
  stepId: "clip-embedding",
21047
21890
  label: "Semantic search model",
21048
- defaultModelId: "mobileclip-s1",
21891
+ defaultModelId: "siglip2-b16-224",
21049
21892
  indexName: "the object semantic-search index",
21050
- options: [
21051
- {
21052
- id: "mobileclip-s1",
21053
- label: "MobileCLIP S1"
21054
- },
21055
- {
21056
- id: "mobileclip-s2",
21057
- label: "MobileCLIP S2"
21058
- },
21059
- {
21060
- id: "siglip2-b16-224",
21061
- label: "SigLIP2 B/16 (Apache-2.0)"
21062
- }
21063
- ]
21893
+ options: [{
21894
+ id: "siglip2-b16-224",
21895
+ label: "SigLIP2 B/16 (Apache-2.0)"
21896
+ }]
21064
21897
  }].map((s) => [s.stepId, s.defaultModelId])));
21065
21898
  var CLUSTER_STEP_SETTING_FIELDS = [{
21066
21899
  stepId: "face-embedding",
21067
21900
  key: "minLandmarkFaceSize",
21068
- label: "Min face size for recognition (detection px)",
21069
- 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.",
21901
+ label: "Min face size to embed (detection-frame px)",
21902
+ 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.",
21070
21903
  type: "slider",
21071
21904
  min: 0,
21072
21905
  max: 64,
@@ -22039,8 +22872,23 @@ var RetrainMacroClassSchema = _enum([
22039
22872
  ]);
22040
22873
  /** A subject to learn, or a phantom to unlearn (taught by OMISSION). */
22041
22874
  var RetrainAnnotationKindSchema = _enum(["subject", "model_error"]);
22042
- /** Did a human draw this box, or did the assist propose it? */
22043
- var RetrainAnnotationSourceSchema = _enum(["operator", "assist"]);
22875
+ /**
22876
+ * Where a box came from. A machine-sourced box is a DRAFT on the page until
22877
+ * the operator confirms it; once saved it keeps its source as provenance.
22878
+ *
22879
+ * - `operator` — drawn by hand.
22880
+ * - `assist` — proposed by a detector run on the copy (the camera's own
22881
+ * model, or a larger teacher model).
22882
+ * - `pipeline` — the box the live pipeline actually drew on that frame, read
22883
+ * back from the track store (never a re-run).
22884
+ * - `llm` — proposed by a vision-capable LLM profile.
22885
+ */
22886
+ var RetrainAnnotationSourceSchema = _enum([
22887
+ "operator",
22888
+ "assist",
22889
+ "pipeline",
22890
+ "llm"
22891
+ ]);
22044
22892
  /** Normalised `[0,1]` rectangle against the FULL frame — the canonical form. */
22045
22893
  var RetrainBboxSchema = object({
22046
22894
  x: number(),
@@ -22058,7 +22906,8 @@ var RetrainBboxSchema = object({
22058
22906
  */
22059
22907
  var RetrainAnnotationSchema = object({
22060
22908
  id: string(),
22061
- trackId: string(),
22909
+ /** The frame's track. Absent on a recording still, which has none. */
22910
+ trackId: string().optional(),
22062
22911
  deviceId: number(),
22063
22912
  /** The COPY in retrain storage — never the source track's media key. */
22064
22913
  mediaKey: string(),
@@ -22107,18 +22956,63 @@ var RetrainFrameCandidateSchema = object({
22107
22956
  * fail, whatever became of the original. */
22108
22957
  copied: boolean()
22109
22958
  });
22959
+ /**
22960
+ * One box the live pipeline drew on a copied frame — what a correction starts
22961
+ * from. Derived when the frame is listed, from the track store: the subject
22962
+ * box recorded on the source media row when there is one, else the track
22963
+ * position nearest the frame's capture time. Never stored as an annotation
22964
+ * until the operator confirms it.
22965
+ */
22966
+ var RetrainPipelineBoxSchema = object({
22967
+ /** Normalised `[0,1]` against the full frame. */
22968
+ bbox: RetrainBboxSchema,
22969
+ macroClass: RetrainMacroClassSchema,
22970
+ label: string().optional(),
22971
+ subLabel: string().optional(),
22972
+ /** The detection score of the position used, when it was recorded. */
22973
+ score: number().optional(),
22974
+ /** The root model that produced the track, when it was recorded. */
22975
+ modelId: string().optional(),
22976
+ trackId: string(),
22977
+ /** `subject-box`: recorded on this very frame. `position`: the track's
22978
+ * position nearest the capture time, `deltaMs` away. */
22979
+ basis: _enum(["subject-box", "position"]),
22980
+ deltaMs: number()
22981
+ });
22982
+ /**
22983
+ * Where a retrain frame came from: a TRACK's stored media (copy-on-select),
22984
+ * or the RECORDING at an instant — the frame a model saw nothing in has no
22985
+ * track at all.
22986
+ */
22987
+ var RetrainFrameOriginSchema = _enum(["track", "recording"]);
22110
22988
  /** A frame the dataset OWNS: bytes copied at selection time. */
22111
22989
  var RetrainFrameSchema = object({
22112
22990
  frameId: string(),
22113
22991
  deviceId: number(),
22114
- trackId: string(),
22115
- /** Provenance only. It may already point at nothing — that is expected. */
22116
- sourceMediaId: number().int(),
22992
+ origin: RetrainFrameOriginSchema,
22993
+ /** The track it was copied from. Absent on a recording still. */
22994
+ trackId: string().optional(),
22995
+ /** Provenance only. It may already point at nothing — that is expected.
22996
+ * Absent on a recording still. */
22997
+ sourceMediaId: number().int().optional(),
22998
+ /** A recording still: the playhead instant it was taken at. */
22999
+ epochMs: number().optional(),
22117
23000
  sourceKind: MediaFileKindEnum,
22118
23001
  sizeBytes: number().int(),
22119
23002
  width: number().int(),
22120
23003
  height: number().int(),
22121
- copiedAt: number()
23004
+ copiedAt: number(),
23005
+ /** When the CAMERA captured the frame. Absent on a copy taken before D785. */
23006
+ capturedAt: number().optional(),
23007
+ /** The operator's "every subject in this frame is boxed". Detector
23008
+ * evaluation keeps only complete frames: an unboxed subject would count as
23009
+ * a false positive. */
23010
+ complete: boolean(),
23011
+ /** The boxes the pipeline drew on this frame. Present on list answers;
23012
+ * empty when nothing the track store holds can be placed on it. */
23013
+ pipelineBoxes: array(RetrainPipelineBoxSchema).readonly().optional(),
23014
+ /** The named collections this frame belongs to. Present on list answers. */
23015
+ collectionIds: array(string()).readonly().optional()
22122
23016
  });
22123
23017
  /** Why a copy-on-select could not be honoured — named, never a silent skip. */
22124
23018
  var RetrainCopyRefusalSchema = _enum([
@@ -22139,6 +23033,53 @@ var RetrainFrameListSchema = object({
22139
23033
  /** What the page pre-selects — the native key frame when one survives. */
22140
23034
  autoPickMediaId: number().int().optional()
22141
23035
  });
23036
+ /**
23037
+ * Which frames an annotated export carries. Every field narrows; an empty
23038
+ * filter is every annotated copy. A dataset VERSION is a frozen `frameIds`
23039
+ * list owned by whoever trains (the training orchestrator), so `frameIds` is
23040
+ * the primitive a version export uses; `batchId` re-selects what an earlier
23041
+ * export carried (`exportedInBatch`).
23042
+ */
23043
+ var RetrainExportFilterSchema = object({
23044
+ deviceIds: array(number()).optional(),
23045
+ frameIds: array(string()).max(2e4).optional(),
23046
+ /** Only frames in at least one of these named collections. */
23047
+ collectionIds: array(string()).max(200).optional(),
23048
+ batchId: string().optional(),
23049
+ /** Only frames the operator marked complete (all subjects boxed). */
23050
+ completeOnly: boolean().optional()
23051
+ });
23052
+ /**
23053
+ * `frames`: the full frame copies, boxes in `annotations.json`.
23054
+ * `crops`: additionally one JPEG per subject, cut with the runtime detail-crop
23055
+ * convention — the classifier layout.
23056
+ */
23057
+ var RetrainExportLayoutSchema = _enum(["frames", "crops"]);
23058
+ /**
23059
+ * Where `writeRetrainArchive` streams the tar: one HTTP request whose body is
23060
+ * the archive, sent chunk by chunk. Covers a presigned PUT and a provider
23061
+ * addon's data-plane upload route alike. Headers are sent verbatim and never
23062
+ * logged.
23063
+ */
23064
+ var RetrainArchiveTargetSchema = object({
23065
+ kind: literal("http"),
23066
+ method: _enum(["PUT", "POST"]),
23067
+ url: string().url(),
23068
+ headers: record(string(), string()).optional()
23069
+ });
23070
+ var RetrainArchiveResultSchema = object({
23071
+ batchId: string(),
23072
+ frames: number().int(),
23073
+ crops: number().int(),
23074
+ annotations: number().int(),
23075
+ /** Frames planned but not shipped (unreadable copy, path too long). */
23076
+ missing: number().int(),
23077
+ bytes: number().int(),
23078
+ /** sha256 of the exact bytes sent. */
23079
+ sha256: string(),
23080
+ /** The target's HTTP status. */
23081
+ status: number().int()
23082
+ });
22142
23083
  /** What the operator asked the assist to look for. */
22143
23084
  var RetrainAssistSubjectSchema = discriminatedUnion("kind", [object({
22144
23085
  kind: literal("package"),
@@ -22168,6 +23109,109 @@ var RetrainAssistResultSchema = discriminatedUnion("kind", [object({
22168
23109
  reason: string(),
22169
23110
  detail: string().optional()
22170
23111
  })]);
23112
+ /** A named set over the retrain corpus — membership only, it owns no pixels. */
23113
+ var RetrainCollectionSchema = object({
23114
+ id: string(),
23115
+ name: string(),
23116
+ createdAt: number(),
23117
+ frameCount: number().int()
23118
+ });
23119
+ var RetrainCollectionCreateResultSchema = discriminatedUnion("kind", [object({
23120
+ kind: literal("created"),
23121
+ collection: RetrainCollectionSchema
23122
+ }), object({
23123
+ kind: literal("refused"),
23124
+ reason: _enum(["empty-name", "duplicate-name"])
23125
+ })]);
23126
+ var RetrainCollectionRenameResultSchema = discriminatedUnion("kind", [object({
23127
+ kind: literal("renamed"),
23128
+ collection: RetrainCollectionSchema
23129
+ }), object({
23130
+ kind: literal("refused"),
23131
+ reason: _enum([
23132
+ "empty-name",
23133
+ "duplicate-name",
23134
+ "unknown-collection"
23135
+ ])
23136
+ })]);
23137
+ /**
23138
+ * The outcome of adding the frame at a recording instant. Every refusal is
23139
+ * named: `still-unavailable` (not recording, a gap, or an undecodable frame —
23140
+ * `detail` says which), `still-busy` (the recorder is at its decode bound; try
23141
+ * again), `unreadable-image`, `write-failed`, `unknown-collection`.
23142
+ */
23143
+ var AddRetrainFrameFromRecordingResultSchema = discriminatedUnion("kind", [object({
23144
+ kind: literal("added"),
23145
+ collectionId: string(),
23146
+ frame: RetrainFrameSchema,
23147
+ /** The moment was already in the dataset; nothing was decoded. */
23148
+ reused: boolean()
23149
+ }), object({
23150
+ kind: literal("refused"),
23151
+ reason: _enum([
23152
+ "unknown-collection",
23153
+ "still-unavailable",
23154
+ "still-busy",
23155
+ "unreadable-image",
23156
+ "write-failed"
23157
+ ]),
23158
+ detail: string().optional()
23159
+ })]);
23160
+ /** A vision LLM profile the AI assist may use, and where it sends the frame. */
23161
+ var RetrainAssistProfileSchema = object({
23162
+ id: string(),
23163
+ name: string(),
23164
+ model: string(),
23165
+ kind: string(),
23166
+ /** `true` when the frame would leave the house (a cloud vendor, or an
23167
+ * endpoint that is not on the local network). The page confirms each such
23168
+ * run, and the provider refuses one without `allowCloud`. */
23169
+ leavesHouse: boolean()
23170
+ });
23171
+ /** A box the AI assist proposed: a draft, plus the model's own reason. */
23172
+ var RetrainLlmProposalSchema = RetrainAnnotationDraftSchema.extend({ reason: string() });
23173
+ /** What the AI assist said about a box that was already on the canvas. */
23174
+ var RetrainLlmReviewSchema = object({
23175
+ /** The `ref` the page sent the box under. */
23176
+ ref: string(),
23177
+ verdict: _enum([
23178
+ "confirmed",
23179
+ "wrong-class",
23180
+ "not-an-object",
23181
+ "uncertain"
23182
+ ]),
23183
+ suggestedClass: RetrainMacroClassSchema.optional(),
23184
+ reason: string()
23185
+ });
23186
+ /**
23187
+ * The AI assist's answer. `proposed` carries drafts (`source: 'llm'`, the
23188
+ * model and its confidence) and reviews; items the model got wrong (a box off
23189
+ * the frame, an unasked class, an unknown ref) are dropped and counted in
23190
+ * `rejected`. A whole answer that is not the schema is `malformed-answer`.
23191
+ */
23192
+ var RetrainLlmAssistResultSchema = discriminatedUnion("kind", [object({
23193
+ kind: literal("proposed"),
23194
+ profileId: string(),
23195
+ model: string(),
23196
+ /** The frame was sent outside the house for this answer. */
23197
+ leftHouse: boolean(),
23198
+ proposals: array(RetrainLlmProposalSchema).readonly(),
23199
+ reviews: array(RetrainLlmReviewSchema).readonly(),
23200
+ rejected: number().int()
23201
+ }), object({
23202
+ kind: literal("refused"),
23203
+ reason: _enum([
23204
+ "unknown-frame",
23205
+ "unreadable-frame",
23206
+ "unknown-profile",
23207
+ "profile-disabled",
23208
+ "no-vision",
23209
+ "cloud-not-confirmed",
23210
+ "llm-error",
23211
+ "malformed-answer"
23212
+ ]),
23213
+ detail: string().optional()
23214
+ })]);
22171
23215
  /** The outcome of a lifecycle move owned by the retrain page. */
22172
23216
  var RetrainTransitionResultSchema = object({
22173
23217
  trackId: string(),
@@ -22885,7 +23929,7 @@ DeviceType.Camera, method(object({ deviceId: number() }), array(TrackSchema).rea
22885
23929
  auth: "admin"
22886
23930
  }), method(object({
22887
23931
  deviceId: number(),
22888
- trackId: string(),
23932
+ trackId: string().optional(),
22889
23933
  frameId: string()
22890
23934
  }), object({
22891
23935
  removed: boolean(),
@@ -22902,7 +23946,8 @@ DeviceType.Camera, method(object({ deviceId: number() }), array(TrackSchema).rea
22902
23946
  auth: "admin"
22903
23947
  }), method(object({
22904
23948
  deviceId: number(),
22905
- trackId: string(),
23949
+ /** The frame's track, when it has one — checked against the frame. */
23950
+ trackId: string().optional(),
22906
23951
  frameId: string(),
22907
23952
  subject: RetrainAssistSubjectSchema,
22908
23953
  /** Which node runs it. Absent ⇒ wherever an unowned call lands. */
@@ -22910,12 +23955,16 @@ DeviceType.Camera, method(object({ deviceId: number() }), array(TrackSchema).rea
22910
23955
  }), RetrainAssistResultSchema, {
22911
23956
  kind: "mutation",
22912
23957
  auth: "admin"
22913
- }), method(object({ trackId: string() }), array(RetrainAnnotationSchema).readonly(), {
23958
+ }), method(object({
23959
+ trackId: string().optional(),
23960
+ frameIds: array(string()).max(2e3).optional()
23961
+ }), array(RetrainAnnotationSchema).readonly(), {
22914
23962
  kind: "query",
22915
23963
  auth: "admin"
22916
23964
  }), method(object({
22917
23965
  deviceId: number(),
22918
- trackId: string(),
23966
+ /** The frame's track, when it has one — checked against the frame. */
23967
+ trackId: string().optional(),
22919
23968
  frameId: string(),
22920
23969
  annotations: array(RetrainAnnotationDraftSchema)
22921
23970
  }), array(RetrainAnnotationSchema).readonly(), {
@@ -22933,7 +23982,91 @@ DeviceType.Camera, method(object({ deviceId: number() }), array(TrackSchema).rea
22933
23982
  }), RetrainTransitionResultSchema, {
22934
23983
  kind: "mutation",
22935
23984
  auth: "admin"
22936
- }), method(object({ deviceIds: array(number()).optional() }), object({ url: string() }), {
23985
+ }), method(RetrainExportFilterSchema.extend({ layout: RetrainExportLayoutSchema.optional() }), object({ url: string() }), {
23986
+ kind: "query",
23987
+ auth: "admin"
23988
+ }), method(object({
23989
+ deviceId: number(),
23990
+ trackId: string().optional(),
23991
+ frameId: string(),
23992
+ complete: boolean()
23993
+ }), RetrainFrameSchema, {
23994
+ kind: "mutation",
23995
+ auth: "admin"
23996
+ }), method(object({
23997
+ filter: RetrainExportFilterSchema,
23998
+ layout: RetrainExportLayoutSchema,
23999
+ target: RetrainArchiveTargetSchema
24000
+ }), RetrainArchiveResultSchema, {
24001
+ kind: "mutation",
24002
+ auth: "admin",
24003
+ timeoutMs: 60 * 6e4
24004
+ }), method(object({}), array(RetrainAssistProfileSchema).readonly(), {
24005
+ kind: "query",
24006
+ auth: "admin"
24007
+ }), method(object({
24008
+ deviceId: number(),
24009
+ trackId: string().optional(),
24010
+ frameId: string(),
24011
+ profileId: string(),
24012
+ classes: array(RetrainMacroClassSchema).min(1),
24013
+ boxes: array(object({
24014
+ ref: string(),
24015
+ bbox: RetrainBboxSchema,
24016
+ macroClass: RetrainMacroClassSchema,
24017
+ label: string().optional()
24018
+ })).max(50),
24019
+ allowCloud: boolean()
24020
+ }), RetrainLlmAssistResultSchema, {
24021
+ kind: "mutation",
24022
+ auth: "admin",
24023
+ timeoutMs: 18e4
24024
+ }), method(object({ name: string().max(120) }), RetrainCollectionCreateResultSchema, {
24025
+ kind: "mutation",
24026
+ auth: "admin"
24027
+ }), method(object({}), array(RetrainCollectionSchema).readonly(), {
24028
+ kind: "query",
24029
+ auth: "admin"
24030
+ }), method(object({
24031
+ id: string(),
24032
+ name: string().max(120)
24033
+ }), RetrainCollectionRenameResultSchema, {
24034
+ kind: "mutation",
24035
+ auth: "admin"
24036
+ }), method(object({ id: string() }), object({
24037
+ deleted: boolean(),
24038
+ removedFrames: number().int()
24039
+ }), {
24040
+ kind: "mutation",
24041
+ auth: "admin"
24042
+ }), method(object({
24043
+ collectionId: string(),
24044
+ deviceId: number(),
24045
+ epochMs: number()
24046
+ }), AddRetrainFrameFromRecordingResultSchema, {
24047
+ kind: "mutation",
24048
+ auth: "admin",
24049
+ timeoutMs: 6e4
24050
+ }), method(object({
24051
+ collectionId: string(),
24052
+ frameIds: array(string()).min(1).max(500)
24053
+ }), object({
24054
+ added: number().int(),
24055
+ alreadyMember: number().int(),
24056
+ unknownFrameIds: array(string()).readonly()
24057
+ }), {
24058
+ kind: "mutation",
24059
+ auth: "admin"
24060
+ }), method(object({
24061
+ collectionId: string(),
24062
+ frameId: string()
24063
+ }), object({
24064
+ removed: boolean(),
24065
+ deletedFrame: boolean()
24066
+ }), {
24067
+ kind: "mutation",
24068
+ auth: "admin"
24069
+ }), method(object({ collectionId: string() }), array(RetrainFrameSchema).readonly(), {
22937
24070
  kind: "query",
22938
24071
  auth: "admin"
22939
24072
  }), method(object({
@@ -22986,6 +24119,34 @@ DeviceType.Camera, method(object({ deviceId: number() }), array(TrackSchema).rea
22986
24119
  timestamp: number()
22987
24120
  });
22988
24121
  /**
24122
+ * A root model's boxes standing in for one crop-kind step's own inference
24123
+ * (D730) — see `runPipeline.suppliedRoot`.
24124
+ */
24125
+ var SuppliedRootOutputSchema = object({
24126
+ stepId: string(),
24127
+ /** The root model that drew the boxes — stamped on the result. */
24128
+ modelId: string(),
24129
+ detections: array(object({
24130
+ /** `[x1, y1, x2, y2]` in the pixels of the call's image. */
24131
+ bbox: tuple([
24132
+ number(),
24133
+ number(),
24134
+ number(),
24135
+ number()
24136
+ ]),
24137
+ score: number(),
24138
+ /**
24139
+ * Five facial landmarks in the same pixels — a face the step's own
24140
+ * detector already re-found inside a root face box (D730), so its
24141
+ * embedder child aligns it exactly as it aligns any detected face.
24142
+ */
24143
+ landmarks: array(object({
24144
+ x: number(),
24145
+ y: number()
24146
+ })).optional()
24147
+ })).min(1)
24148
+ });
24149
+ /**
22989
24150
  * Reference to the frame's retained NATIVE surface + the parent crop's placement
22990
24151
  * within the frame, so the executor can re-cut a leaf child ROI at native
22991
24152
  * resolution on the detail plane. See the `runPipeline` `nativeCropRef` field.
@@ -23033,7 +24194,7 @@ var FrameRefSchema = object({
23033
24194
  timestamp: number(),
23034
24195
  capturedAt: number().optional()
23035
24196
  });
23036
- var ModelFormatSchema$1 = _enum([
24197
+ var ModelFormatSchema$2 = _enum([
23037
24198
  "onnx",
23038
24199
  "coreml",
23039
24200
  "openvino",
@@ -23051,7 +24212,7 @@ var PipelineSlotSchema = _enum([
23051
24212
  var PipelineEngineChoiceSchema = object({
23052
24213
  runtime: literal("python"),
23053
24214
  backend: string(),
23054
- format: ModelFormatSchema$1,
24215
+ format: ModelFormatSchema$2,
23055
24216
  device: string().optional()
23056
24217
  });
23057
24218
  /**
@@ -23090,32 +24251,15 @@ var PipelineDefaultStepSchema = lazy(() => object({
23090
24251
  group: string().optional(),
23091
24252
  settings: record(string(), unknown()).optional()
23092
24253
  }));
23093
- var PipelineTemplateStepSchema = lazy(() => object({
23094
- addonId: string(),
23095
- enabled: boolean(),
23096
- modelId: string(),
23097
- children: array(PipelineTemplateStepSchema).readonly(),
23098
- settings: record(string(), unknown()).optional()
23099
- }));
23100
- var PipelineTemplateSchema$1 = object({
23101
- id: string(),
23102
- name: string(),
23103
- createdAt: string(),
23104
- updatedAt: string(),
23105
- engine: PipelineEngineChoiceSchema,
23106
- steps: array(PipelineTemplateStepSchema).readonly()
23107
- });
23108
24254
  var PipelineModelOptionSchema = object({
23109
24255
  id: string(),
23110
24256
  name: string(),
23111
- formats: record(string(), object({
23112
- downloaded: boolean(),
23113
- sizeMB: number()
23114
- })),
24257
+ formats: record(string(), PipelineModelFormatStatusSchema),
23115
24258
  group: ModelVariantGroupSchema.optional(),
23116
24259
  legacy: boolean().optional(),
23117
24260
  provider: ModelProviderIdSchema.optional(),
23118
- defaultConfidence: number().optional()
24261
+ defaultConfidence: number().optional(),
24262
+ suppliesSteps: array(RootStepSupplySchema).readonly().optional()
23119
24263
  });
23120
24264
  var ConfigFieldBridge = custom();
23121
24265
  var PipelineAddonSchemaSchema = object({
@@ -23277,6 +24421,22 @@ method(_void(), array(PipelineEngineChoiceSchema)), method(_void(), PipelineEngi
23277
24421
  }), {
23278
24422
  kind: "mutation",
23279
24423
  auth: "admin"
24424
+ }), method(object({
24425
+ nodeId: string(),
24426
+ deviceIds: array(number()).readonly().optional(),
24427
+ dryRun: boolean()
24428
+ }), object({
24429
+ entries: array(object({
24430
+ deviceId: number(),
24431
+ keys: array(string()).readonly()
24432
+ })).readonly(),
24433
+ refused: array(object({
24434
+ deviceId: number(),
24435
+ reason: string()
24436
+ })).readonly()
24437
+ }), {
24438
+ kind: "mutation",
24439
+ auth: "admin"
23280
24440
  }), method(object({ nodeId: string() }), object({ unhealthy: array(object({
23281
24441
  /** `<backend>:<device>`, e.g. `openvino:gpu`. */
23282
24442
  deviceKey: string(),
@@ -23302,22 +24462,14 @@ method(_void(), array(PipelineEngineChoiceSchema)), method(_void(), PipelineEngi
23302
24462
  }), method(_void(), PipelineSchemaSchema), method(_void(), array(PipelineDefaultStepSchema).readonly().nullable()), method(_void(), PipelineConfigBridge), method(_void(), ConfigUISchemaBridge), method(object({
23303
24463
  steps: array(PipelineStepInputSchema),
23304
24464
  deviceKey: string().optional()
23305
- }), PipelineValidationResultSchema), method(_void(), array(PipelineTemplateSchema$1).readonly()), method(object({
23306
- name: string(),
23307
- steps: array(PipelineTemplateStepSchema).readonly(),
23308
- engine: PipelineEngineChoiceSchema
23309
- }), PipelineTemplateSchema$1, { kind: "mutation" }), method(object({
23310
- id: string(),
23311
- name: string().optional(),
23312
- steps: array(PipelineTemplateStepSchema).readonly().optional()
23313
- }), PipelineTemplateSchema$1, { kind: "mutation" }), method(object({ id: string() }), _void(), { kind: "mutation" }), method(_void(), InferenceCapabilitiesBridge), method(object({ addonId: string() }), ModelAvailabilityListBridge), method(object({
24465
+ }), PipelineValidationResultSchema), method(_void(), InferenceCapabilitiesBridge), method(object({ addonId: string() }), ModelAvailabilityListBridge), method(object({
23314
24466
  addonId: string(),
23315
24467
  modelId: string(),
23316
- format: ModelFormatSchema$1
24468
+ format: ModelFormatSchema$2
23317
24469
  }), DownloadModelResultSchema, { kind: "mutation" }), method(object({
23318
24470
  addonId: string(),
23319
24471
  modelId: string(),
23320
- format: ModelFormatSchema$1
24472
+ format: ModelFormatSchema$2
23321
24473
  }), object({ success: literal(true) }), { kind: "mutation" }), method(object({
23322
24474
  steps: array(PipelineStepInputSchema).min(1),
23323
24475
  frame: FrameInputSchema.optional(),
@@ -23383,7 +24535,16 @@ method(_void(), array(PipelineEngineChoiceSchema)), method(_void(), PipelineEngi
23383
24535
  * `device-not-servable`), and nothing reaches the camera's live
23384
24536
  * trace stream. Absent ⇒ unchanged behaviour.
23385
24537
  */
23386
- replay: literal(true).optional()
24538
+ replay: literal(true).optional(),
24539
+ /**
24540
+ * Root-supplied detections for the tree's ROOT step (D730). Set by
24541
+ * `runDetailSubtree` when the camera's root model supplies a crop-kind
24542
+ * step (a Frigate+ `license_plate` for `plate-detection`): the step is
24543
+ * NOT inferred, these boxes are its output, and its children (the plate
24544
+ * reader) run on them through their own crop policy. Boxes are in the
24545
+ * PIXELS of the image this call carries. Absent ⇒ the root step runs.
24546
+ */
24547
+ suppliedRoot: SuppliedRootOutputSchema.optional()
23387
24548
  }), PipelineRunResultBridge, { kind: "mutation" }), method(object({
23388
24549
  steps: array(PipelineStepInputSchema).min(1),
23389
24550
  frames: array(FrameInputSchema).min(1).max(255),
@@ -23465,6 +24626,763 @@ method(_void(), array(PipelineEngineChoiceSchema)), method(_void(), PipelineEngi
23465
24626
  filename: string().optional(),
23466
24627
  settings: record(string(), unknown()).optional()
23467
24628
  }), AudioTestResultSchema, { kind: "mutation" }), method(_void(), ConfigUISchemaNullableBridge);
24629
+ /**
24630
+ * The wire shapes of the Auto tune plan and apply (D745), used by the
24631
+ * `pipeline-orchestrator` cap. The recommender's own types
24632
+ * (`recommend.ts`) are the TS face of the same data; these
24633
+ * schemas are what crosses the cap boundary.
24634
+ */
24635
+ var ModelFormatSchema$1 = _enum(MODEL_FORMATS);
24636
+ /** The operator's range for it. */
24637
+ var MIN_SESSIONS_PER_DEVICE_RANGE = {
24638
+ min: 1,
24639
+ max: 8
24640
+ };
24641
+ var HardwareClassIdSchema = _enum([
24642
+ "intel-core-ultra",
24643
+ "intel-n-series",
24644
+ "apple-m-base",
24645
+ "apple-m-pro",
24646
+ "unknown"
24647
+ ]);
24648
+ var AcceleratorKindSchema = _enum([
24649
+ "intel-npu",
24650
+ "intel-igpu",
24651
+ "x86-cpu",
24652
+ "arm-cpu",
24653
+ "apple-ane",
24654
+ "coral"
24655
+ ]);
24656
+ var RecommendationReasonSchema = discriminatedUnion("kind", [
24657
+ object({
24658
+ kind: literal("capacity"),
24659
+ sessions: number(),
24660
+ minSessions: number()
24661
+ }),
24662
+ object({
24663
+ kind: literal("tie-faster"),
24664
+ over: string(),
24665
+ recallDelta: number()
24666
+ }),
24667
+ object({
24668
+ kind: literal("stepped-down"),
24669
+ from: string(),
24670
+ to: string(),
24671
+ limitedBy: string()
24672
+ }),
24673
+ object({
24674
+ kind: literal("no-fit-lightest"),
24675
+ sessions: number(),
24676
+ minSessions: number()
24677
+ }),
24678
+ object({
24679
+ kind: literal("derived-latency"),
24680
+ modelId: string()
24681
+ }),
24682
+ object({ kind: literal("cpu-device") }),
24683
+ object({ kind: literal("coral-untouched") }),
24684
+ object({ kind: literal("device-disabled") }),
24685
+ object({ kind: literal("device-unavailable") }),
24686
+ object({ kind: literal("node-offline") }),
24687
+ object({ kind: literal("no-hardware-facts") }),
24688
+ object({
24689
+ kind: literal("no-measured-data"),
24690
+ hardwareClass: HardwareClassIdSchema
24691
+ }),
24692
+ object({
24693
+ kind: literal("no-family-build"),
24694
+ format: ModelFormatSchema$1
24695
+ }),
24696
+ object({
24697
+ kind: literal("kept-custom-pin"),
24698
+ modelId: string(),
24699
+ deviceKey: string()
24700
+ })
24701
+ ]);
24702
+ /** Why a device is left exactly as it is, whatever the plan would pick (D786). */
24703
+ var KeptReasonSchema = _enum(["custom-pin"]);
24704
+ /**
24705
+ * Where a choice's latency came from (D791): this node's own benchmark
24706
+ * result, or the hardware-class table. Measured on the node beats the table.
24707
+ */
24708
+ var LatencySourceSchema = discriminatedUnion("kind", [object({ kind: literal("table") }), object({
24709
+ kind: literal("node-benchmark"),
24710
+ resultId: string(),
24711
+ measuredAtMs: number()
24712
+ })]);
24713
+ var DeviceModelChoiceSchema = object({
24714
+ modelId: string(),
24715
+ p50Ms: number(),
24716
+ fps: number(),
24717
+ measured: boolean(),
24718
+ /** Absent on a plan from before D791 — read as the table. */
24719
+ source: LatencySourceSchema.optional(),
24720
+ /** Parallel sessions at the camera rate with the headroom kept free: ⌊fps × (1 − headroom) / camera fps⌋. */
24721
+ capacitySessions: number(),
24722
+ personRecall: number()
24723
+ });
24724
+ var DeviceRecommendationSchema = object({
24725
+ deviceKey: string(),
24726
+ accelerator: AcceleratorKindSchema.nullable(),
24727
+ enabled: boolean(),
24728
+ available: boolean(),
24729
+ chosen: DeviceModelChoiceSchema.nullable(),
24730
+ /** Present when the device is kept as is: Apply writes nothing on it. */
24731
+ kept: KeptReasonSchema.optional(),
24732
+ reasons: array(RecommendationReasonSchema).readonly()
24733
+ });
24734
+ var NodeRecommendationSchema = object({
24735
+ nodeId: string(),
24736
+ reachable: boolean(),
24737
+ hardwareClass: HardwareClassIdSchema.nullable(),
24738
+ cpuModel: string().nullable(),
24739
+ skipped: boolean(),
24740
+ acceleratorModelId: string().nullable(),
24741
+ devices: array(DeviceRecommendationSchema).readonly(),
24742
+ reasons: array(RecommendationReasonSchema).readonly()
24743
+ });
24744
+ var ModelPinChangeSchema = object({
24745
+ stepId: string(),
24746
+ before: string().nullable(),
24747
+ after: string().nullable()
24748
+ });
24749
+ var NodeDeviceChangeSchema = object({
24750
+ nodeId: string(),
24751
+ deviceKey: string(),
24752
+ madeExplicit: boolean(),
24753
+ modelPins: array(ModelPinChangeSchema).readonly(),
24754
+ thresholds: array(object({
24755
+ stepId: string(),
24756
+ keys: array(string()).readonly()
24757
+ })).readonly()
24758
+ });
24759
+ var CameraOverrideClearSchema = object({
24760
+ deviceId: number(),
24761
+ source: _enum(["step-override", "wholesale"]),
24762
+ nodeId: string(),
24763
+ deviceKey: string().nullable(),
24764
+ stepId: string(),
24765
+ modelIdBefore: string().nullable(),
24766
+ keys: array(string()).readonly()
24767
+ });
24768
+ var DetectorStoreClearSchema = object({
24769
+ deviceId: number(),
24770
+ keys: array(string()).readonly()
24771
+ });
24772
+ var AutoTuneWarningSchema = discriminatedUnion("kind", [
24773
+ object({
24774
+ kind: literal("detector-store-cluster-wide"),
24775
+ skippedNodes: array(string()).readonly()
24776
+ }),
24777
+ object({
24778
+ kind: literal("detector-store-unreadable"),
24779
+ error: string()
24780
+ }),
24781
+ object({
24782
+ kind: literal("coral-enabled"),
24783
+ nodeId: string(),
24784
+ deviceKey: string()
24785
+ }),
24786
+ object({
24787
+ kind: literal("custom-pin-kept"),
24788
+ nodeId: string(),
24789
+ deviceKey: string().nullable(),
24790
+ deviceId: number().nullable(),
24791
+ modelId: string()
24792
+ }),
24793
+ object({
24794
+ kind: literal("custom-registry-unreadable"),
24795
+ error: string()
24796
+ })
24797
+ ]);
24798
+ var AutoTuneOptionsSchema = object({
24799
+ /** Share of each accelerator's throughput kept free (0.3–0.5). */
24800
+ headroom: number().min(.3).max(.5).default(.4),
24801
+ /**
24802
+ * The least number of parallel sessions every device must sustain at the
24803
+ * camera rate with the headroom kept free (D755). The most accurate model
24804
+ * that reaches it wins.
24805
+ */
24806
+ minSessionsPerDevice: number().int().min(MIN_SESSIONS_PER_DEVICE_RANGE.min).max(MIN_SESSIONS_PER_DEVICE_RANGE.max).default(2)
24807
+ });
24808
+ var AutoTunePlanSchema = object({
24809
+ /** Hash of everything the apply will write — the apply refuses a different one. */
24810
+ planHash: string(),
24811
+ family: literal("yolov9"),
24812
+ headroom: number(),
24813
+ minSessionsPerDevice: number(),
24814
+ /** The detection rate a session is counted at (the fastest camera running the pipeline root). */
24815
+ cameraFps: number(),
24816
+ generatedAt: number(),
24817
+ nodes: array(NodeRecommendationSchema).readonly(),
24818
+ nodeChanges: array(NodeDeviceChangeSchema).readonly(),
24819
+ cameraClears: array(CameraOverrideClearSchema).readonly(),
24820
+ detectorStoreClears: array(DetectorStoreClearSchema).readonly(),
24821
+ warnings: array(AutoTuneWarningSchema).readonly()
24822
+ });
24823
+ var AutoTuneApplyInputSchema = object({
24824
+ planHash: string(),
24825
+ headroom: number().min(.3).max(.5).default(.4),
24826
+ minSessionsPerDevice: number().int().min(MIN_SESSIONS_PER_DEVICE_RANGE.min).max(MIN_SESSIONS_PER_DEVICE_RANGE.max).default(2)
24827
+ });
24828
+ var AutoTunePhaseResultSchema = object({
24829
+ phase: _enum([
24830
+ "download",
24831
+ "camera-overrides",
24832
+ "detector-thresholds",
24833
+ "node-models",
24834
+ "redispatch"
24835
+ ]),
24836
+ ok: boolean(),
24837
+ detail: string()
24838
+ });
24839
+ var AutoTuneApplyResultSchema = discriminatedUnion("kind", [
24840
+ object({
24841
+ kind: literal("applied"),
24842
+ planHash: string(),
24843
+ phases: array(AutoTunePhaseResultSchema).readonly()
24844
+ }),
24845
+ object({
24846
+ kind: literal("aborted"),
24847
+ phases: array(AutoTunePhaseResultSchema).readonly()
24848
+ }),
24849
+ object({
24850
+ kind: literal("stale"),
24851
+ plan: AutoTunePlanSchema
24852
+ }),
24853
+ object({
24854
+ kind: literal("refused"),
24855
+ reason: _enum(["apply-in-progress"])
24856
+ })
24857
+ ]);
24858
+ /**
24859
+ * Wire shapes of the Load balancing surface (D748): the session placement
24860
+ * policy, the atomic share write, the observed placement statistics, the
24861
+ * hardware share suggestion and the stale device pins.
24862
+ */
24863
+ /**
24864
+ * How a new detection session picks its node and device.
24865
+ * - `least-loaded` — the historical rule: lowest `attached / weight`, a
24866
+ * constant node order at a tie (D37). An idle node always ties at 0, so a
24867
+ * weight only bites once a node already holds a session.
24868
+ * - `share` — the share of PARALLEL sessions is held to the weights, and a
24869
+ * full or drowning node yields to a free one (D748).
24870
+ */
24871
+ var SessionPlacementPolicySchema = _enum(["least-loaded", "share"]);
24872
+ var LoadBalancingSharesInputSchema = object({
24873
+ /** nodeId → share (> 0). A node left out keeps its weight. */
24874
+ nodes: record(string(), number().positive()).default({}),
24875
+ /** nodeId → deviceKey → share (> 0). A device left out keeps its weight. */
24876
+ devices: record(string(), record(string(), number().positive())).default({})
24877
+ });
24878
+ var PlacementStatsInputSchema = object({
24879
+ /** Window the observed shares are averaged over (default 1 h, max 24 h). */
24880
+ windowMs: number().int().min(6e4).max(1440 * 60 * 1e3).default(3600 * 1e3) });
24881
+ var PlacementDeviceStatsSchema = object({
24882
+ deviceKey: string(),
24883
+ /** Sessions running on this device now. */
24884
+ sessionsNow: number(),
24885
+ /** Sessions started on this device inside the window. */
24886
+ sessionsStarted: number(),
24887
+ /** Time-weighted share of the node's parallel sessions over the window (0–1); null = no session ran. */
24888
+ observedShare: number().nullable()
24889
+ });
24890
+ var PlacementNodeStatsSchema = object({
24891
+ nodeId: string(),
24892
+ sessionsNow: number(),
24893
+ sessionsStarted: number(),
24894
+ /** Time-weighted share of the cluster's parallel sessions over the window (0–1); null = none ran. */
24895
+ observedShare: number().nullable(),
24896
+ /** Most sessions this node ran at once inside the window. */
24897
+ peakSessions: number(),
24898
+ /** Sessions a share election handed elsewhere because this node was full or drowning. */
24899
+ yieldsAway: number(),
24900
+ devices: array(PlacementDeviceStatsSchema).readonly()
24901
+ });
24902
+ /** A camera's device pin that the session path cannot honour. */
24903
+ var StaleDevicePinSchema = object({
24904
+ deviceId: number(),
24905
+ deviceKey: string(),
24906
+ /** `disabled` — the key exists on some node but is not enabled anywhere; `absent` — no node has it. */
24907
+ reason: _enum(["disabled", "absent"])
24908
+ });
24909
+ var PlacementStatsSchema = object({
24910
+ policy: SessionPlacementPolicySchema,
24911
+ windowMs: number(),
24912
+ /** How much of the window was actually observed (the hub keeps it in memory). */
24913
+ observedForMs: number(),
24914
+ sessionsNow: number(),
24915
+ /** Most parallel sessions across the cluster inside the window. */
24916
+ clusterPeakSessions: number(),
24917
+ nodes: array(PlacementNodeStatsSchema).readonly(),
24918
+ stalePins: array(StaleDevicePinSchema).readonly()
24919
+ });
24920
+ /**
24921
+ * Where an automatic share's capacity comes from (D755).
24922
+ * - `hardware` — the static capacity of each device at its Auto tune model:
24923
+ * the measured latency table for the node's hardware class.
24924
+ * - `benchmark` — the node's own measured capacity (node benchmark results).
24925
+ * A node with no results falls back to `hardware`, and says so.
24926
+ */
24927
+ var CapacitySourceSchema = _enum(["hardware", "benchmark"]);
24928
+ /** Why a node under the `benchmark` source was sized from hardware instead. */
24929
+ var CapacityFallbackSchema = _enum(["no-benchmark-results", "partial-benchmark-results"]);
24930
+ var SuggestSharesInputSchema = object({
24931
+ headroom: number().min(.3).max(.5).default(.4),
24932
+ /** Default `hardware`. */
24933
+ source: CapacitySourceSchema.default("hardware")
24934
+ });
24935
+ var SuggestedDeviceShareSchema = object({
24936
+ deviceKey: string(),
24937
+ /** Share of the node (0–100, rounded). */
24938
+ share: number(),
24939
+ modelId: string().nullable(),
24940
+ /** Inferences per second at that model, from the measured table; null when sized by a benchmark. */
24941
+ fps: number().nullable(),
24942
+ /** False for a table cell derived from another chip; true for a measured cell or a benchmark. */
24943
+ measured: boolean(),
24944
+ /**
24945
+ * Advisory session cap: ⌊fps × (1 − headroom) / camera fps⌋ from the table,
24946
+ * or the benchmark's measured max sessions. Never enforced.
24947
+ */
24948
+ suggestedMaxSessions: number().nullable()
24949
+ });
24950
+ var SuggestedNodeShareSchema = object({
24951
+ nodeId: string(),
24952
+ /** Share of the cluster (0–100, rounded); null = node skipped (offline, unknown hardware). */
24953
+ share: number().nullable(),
24954
+ /** Parallel sessions the node sustains at the suggested models with the headroom kept free. */
24955
+ capacitySessions: number(),
24956
+ devices: array(SuggestedDeviceShareSchema).readonly(),
24957
+ skippedReason: string().nullable(),
24958
+ /** What this node's capacity was read from; null when the node is skipped. */
24959
+ capacitySource: CapacitySourceSchema.nullable(),
24960
+ /** Set when the `benchmark` source was asked for and this node used `hardware`. */
24961
+ capacityFallback: CapacityFallbackSchema.nullable()
24962
+ });
24963
+ var SuggestSharesResultSchema = object({
24964
+ headroom: number(),
24965
+ /** The source asked for; each node says what it actually used. */
24966
+ source: CapacitySourceSchema,
24967
+ /** Camera detection rate the capacity is counted in (the fastest camera's fps). */
24968
+ cameraFps: number(),
24969
+ /** The Auto tune capacity floor the models were picked at. */
24970
+ minSessionsPerDevice: number(),
24971
+ nodes: array(SuggestedNodeShareSchema).readonly()
24972
+ });
24973
+ /**
24974
+ * Where the node and device shares come from (D750, D755, D791).
24975
+ * - `benchmark` (default since D791) — each node's capacity as its own node
24976
+ * benchmark measured it; a node without fresh results is sized from
24977
+ * `hardware` and says so. Measured on the node beats the table.
24978
+ * - `hardware` — computed from each node's static capacity only (its
24979
+ * accelerators at their Auto tune models, from the latency table).
24980
+ * Both are recomputed whenever a node or device joins, leaves, is switched
24981
+ * on or off, changes model, or a benchmark result is written. No load input.
24982
+ * - `manual` — the operator's stored sliders.
24983
+ * Either way a node or device that cannot take sessions gives its share to
24984
+ * the others in proportion; the stored values are never rewritten for that.
24985
+ */
24986
+ var ShareSourceSchema = _enum([
24987
+ "hardware",
24988
+ "benchmark",
24989
+ "manual"
24990
+ ]);
24991
+ var SetShareSourceInputSchema = object({ source: ShareSourceSchema });
24992
+ object({
24993
+ nodes: record(string(), number()),
24994
+ devices: record(string(), record(string(), number()))
24995
+ });
24996
+ var EffectiveDeviceShareSchema = object({
24997
+ deviceKey: string(),
24998
+ /** Can take sessions now (enabled, available, can run the root). */
24999
+ eligible: boolean(),
25000
+ /** The share the source assigns, as a percentage of the node's devices. */
25001
+ configuredPct: number(),
25002
+ /** The share actually used, after an ineligible device's share went to the others. */
25003
+ effectivePct: number()
25004
+ });
25005
+ var EffectiveNodeShareSchema = object({
25006
+ nodeId: string(),
25007
+ eligible: boolean(),
25008
+ configuredPct: number(),
25009
+ effectivePct: number(),
25010
+ /** Automatic sources: what this node's share was computed from; null under `manual` or before the first answer. */
25011
+ capacitySource: CapacitySourceSchema.nullable(),
25012
+ /** Automatic `benchmark`: why this node used `hardware` instead. */
25013
+ capacityFallback: CapacityFallbackSchema.nullable(),
25014
+ devices: array(EffectiveDeviceShareSchema).readonly()
25015
+ });
25016
+ var EffectiveSharesSchema = object({
25017
+ source: ShareSourceSchema,
25018
+ policy: SessionPlacementPolicySchema,
25019
+ /** An automatic source with no computed answer yet: the stored sliders are used meanwhile. */
25020
+ autoPending: boolean(),
25021
+ /** When the automatic shares were last computed (ms epoch); null = never. */
25022
+ computedAt: number().nullable(),
25023
+ /** What made the system recompute them last. */
25024
+ trigger: string().nullable(),
25025
+ nodes: array(EffectiveNodeShareSchema).readonly(),
25026
+ /** The relative weights the election reads (before eligibility). */
25027
+ nodeWeights: record(string(), number()),
25028
+ deviceWeights: record(string(), record(string(), number()))
25029
+ });
25030
+ /**
25031
+ * Wire shapes of the node benchmark (D791): the operator's plan, the
25032
+ * preflight the confirmation shows, the run the orchestrator owns, what the
25033
+ * measuring runner reports, and the result rows Auto tune and the automatic
25034
+ * shares read.
25035
+ *
25036
+ * ONE node at a time, owned by the pipeline orchestrator. While a run is
25037
+ * active the cluster is in BENCHMARK MODE for that node: it is not a
25038
+ * detection candidate, camera pins naming it are ignored so its sessions move
25039
+ * elsewhere, and both come back when the mode ends — after a crash or a hub
25040
+ * restart too (a persisted manifest, reconciled against the registry).
25041
+ *
25042
+ * Two measurements, both on the node, driven by its own runner (frames never
25043
+ * cross a process at frame rate, D9):
25044
+ * - `device` — one accelerator × one candidate detector, root only, open
25045
+ * loop: how many streams at the camera rate it carries inside the frame
25046
+ * interval;
25047
+ * - `pipeline` — the chosen detector plus the operator's detail steps
25048
+ * (faces, plates, classifiers, CLIP…), on varied frames from the bench
25049
+ * clip: how many parallel sessions the node carries before latency, drops,
25050
+ * CPU, RAM or the event loop give out.
25051
+ */
25052
+ /** Defaults and bounds, one place. */
25053
+ var NODE_BENCHMARK_DEFAULTS = {
25054
+ fpsPerStream: 10,
25055
+ budgetMinutes: 45,
25056
+ minBudgetMinutes: 10,
25057
+ maxBudgetMinutes: 120,
25058
+ /** A result older than this no longer beats the table. */
25059
+ staleAfterDays: 30,
25060
+ /** Warm-in per ramp step (not accounted). */
25061
+ settleSec: 5,
25062
+ /** Accounted window per ramp step. */
25063
+ measureSec: 20,
25064
+ /** Longest the drain may take before the run is refused. */
25065
+ drainTimeoutSec: 120,
25066
+ /** Candidate models per device in one run. */
25067
+ maxModelsPerDevice: 6
25068
+ };
25069
+ /** The two measurements a run can make. */
25070
+ var NodeBenchmarkPhaseSchema = _enum(["device", "pipeline"]);
25071
+ var NodeBenchmarkDevicePlanSchema = object({
25072
+ /** `<backend>:<device>` — `openvino:npu`, `coreml:all`, `cpu`. */
25073
+ deviceKey: string().min(1),
25074
+ /**
25075
+ * Root detector candidates for the `device` measurement, in the order
25076
+ * measured. The FIRST is the one the `pipeline` measurement runs.
25077
+ */
25078
+ modelIds: array(string().min(1)).min(1).max(NODE_BENCHMARK_DEFAULTS.maxModelsPerDevice)
25079
+ });
25080
+ /** What the operator confirmed. */
25081
+ var NodeBenchmarkPlanSchema = object({
25082
+ nodeId: string().min(1),
25083
+ devices: array(NodeBenchmarkDevicePlanSchema).min(1),
25084
+ /** Which measurements run. At least one. */
25085
+ phases: array(NodeBenchmarkPhaseSchema).min(1).default(["device", "pipeline"]),
25086
+ /**
25087
+ * Detail steps (catalog step ids under the root: faces, plates,
25088
+ * classifiers, CLIP…) the `pipeline` measurement enables. The root
25089
+ * detector always runs.
25090
+ */
25091
+ steps: array(string().min(1)).default([]),
25092
+ /** Offered rate of one stream / session. */
25093
+ fpsPerStream: number().int().min(1).max(30).default(NODE_BENCHMARK_DEFAULTS.fpsPerStream),
25094
+ /** Hard deadline: the mode ends and the cluster is restored when it passes. */
25095
+ budgetMinutes: number().int().min(NODE_BENCHMARK_DEFAULTS.minBudgetMinutes).max(NODE_BENCHMARK_DEFAULTS.maxBudgetMinutes).default(NODE_BENCHMARK_DEFAULTS.budgetMinutes),
25096
+ /** Keep the models the run downloaded (default: delete what was not installed before). */
25097
+ keepDownloadedModels: boolean().default(false),
25098
+ /** Start although the other nodes' capacity does not cover the sessions running now. */
25099
+ acceptInsufficientHeadroom: boolean().default(false)
25100
+ });
25101
+ var NodeBenchmarkRefusalSchema = object({
25102
+ kind: _enum([
25103
+ "benchmark-active",
25104
+ "node-offline",
25105
+ "unknown-device",
25106
+ "no-phase",
25107
+ "insufficient-headroom"
25108
+ ]),
25109
+ detail: string(),
25110
+ overridable: boolean()
25111
+ });
25112
+ /** A camera whose detection leaves the node for the run. */
25113
+ var NodeBenchmarkMovingCameraSchema = object({
25114
+ deviceId: number(),
25115
+ /** Placed on the node now (a standing attach or a running session). */
25116
+ placedOnNode: boolean(),
25117
+ /** A node pin naming this node, ignored for the run. */
25118
+ pinnedToNode: boolean()
25119
+ });
25120
+ /** A camera that cannot leave: no other node can obtain its frames. */
25121
+ var NodeBenchmarkStayingCameraSchema = object({
25122
+ deviceId: number(),
25123
+ reason: literal("only-frame-source")
25124
+ });
25125
+ var NodeBenchmarkPreflightSchema = object({
25126
+ nodeId: string(),
25127
+ online: boolean(),
25128
+ moving: array(NodeBenchmarkMovingCameraSchema).readonly(),
25129
+ /** Keep running on the node during the run; the result is flagged contaminated. */
25130
+ staying: array(NodeBenchmarkStayingCameraSchema).readonly(),
25131
+ estimatedDurationMs: number(),
25132
+ /** The run ends and the cluster is restored at the latest after this long. */
25133
+ budgetMs: number(),
25134
+ phases: array(NodeBenchmarkPhaseSchema).readonly(),
25135
+ steps: array(string()).readonly(),
25136
+ devices: array(NodeBenchmarkDevicePlanSchema).readonly(),
25137
+ /** Parallel sessions the cluster runs now, and what the other nodes can carry. */
25138
+ headroom: object({
25139
+ sessionsNow: number(),
25140
+ otherNodesCapacitySessions: number().nullable()
25141
+ }),
25142
+ refusals: array(NodeBenchmarkRefusalSchema).readonly(),
25143
+ canStart: boolean()
25144
+ });
25145
+ /** Where the measuring runner is. */
25146
+ var NodeBenchProgressSchema = object({
25147
+ phase: _enum([
25148
+ "preparing",
25149
+ "device",
25150
+ "pipeline",
25151
+ "cleanup"
25152
+ ]),
25153
+ deviceKey: string().nullable(),
25154
+ modelId: string().nullable(),
25155
+ /** Streams (device) or sessions (pipeline) of the step running now. */
25156
+ load: number().nullable(),
25157
+ cellsDone: number(),
25158
+ cellsTotal: number(),
25159
+ message: string()
25160
+ });
25161
+ /** What limited a ramp. `none` = the ramp ran out of steps still passing. */
25162
+ var NodeBenchLimitSchema = _enum([
25163
+ "p95",
25164
+ "drops",
25165
+ "errors",
25166
+ "stall",
25167
+ "cpu",
25168
+ "ram",
25169
+ "none"
25170
+ ]);
25171
+ var NodeBenchRampStepSchema = object({
25172
+ load: number(),
25173
+ pass: boolean(),
25174
+ p95Ms: number(),
25175
+ dropRatio: number(),
25176
+ /** Completed frames per second over the accounted window. */
25177
+ fps: number(),
25178
+ cpuPct: number().nullable(),
25179
+ ramFreePct: number().nullable(),
25180
+ failReasons: array(string()).readonly()
25181
+ });
25182
+ var NodeBenchCellSchema = discriminatedUnion("phase", [object({
25183
+ phase: literal("device"),
25184
+ deviceKey: string(),
25185
+ modelId: string(),
25186
+ /** Single-stream latency (the K = 1 step). */
25187
+ p50Ms: number(),
25188
+ p95Ms: number(),
25189
+ p99Ms: number(),
25190
+ /** Frames per second sustained at the last passing step. */
25191
+ fps: number(),
25192
+ /** Streams at the camera rate the device carried inside the frame interval; 0 = not even one. */
25193
+ kMax: number(),
25194
+ limitedBy: NodeBenchLimitSchema,
25195
+ /** First call (model load + warm-up). */
25196
+ warmupMs: number(),
25197
+ ramp: array(NodeBenchRampStepSchema).readonly()
25198
+ }), object({
25199
+ phase: literal("pipeline"),
25200
+ deviceKey: string(),
25201
+ modelId: string(),
25202
+ steps: array(string()).readonly(),
25203
+ /** Parallel sessions at the camera rate the node carried; 0 = not even one. */
25204
+ maxSessions: number(),
25205
+ limitedBy: NodeBenchLimitSchema,
25206
+ /** Detail steps that produced at least one result on the clip — a step that never fired measured nothing. */
25207
+ stepsFired: array(string()).readonly(),
25208
+ warmupMs: number(),
25209
+ ramp: array(NodeBenchRampStepSchema).readonly()
25210
+ })]);
25211
+ /**
25212
+ * What a result was measured ON. A result whose fingerprint no longer matches
25213
+ * the node no longer beats the table.
25214
+ */
25215
+ var NodeBenchFingerprintSchema = object({
25216
+ pipelineVersion: string().nullable(),
25217
+ cpuModel: string().nullable(),
25218
+ ramGb: number().nullable(),
25219
+ os: string().nullable(),
25220
+ /** Per device: the pool the cells ran on (runtime + tuning). */
25221
+ pools: record(string(), object({
25222
+ runtime: string(),
25223
+ numWorkers: number(),
25224
+ concurrency: number(),
25225
+ batchMode: string()
25226
+ })).default({})
25227
+ });
25228
+ /** The frames the run used. */
25229
+ var NodeBenchClipSchema = object({
25230
+ /** `camstack-bench-v1` or `reference-images` (the fallback when the clip is not reachable). */
25231
+ id: string(),
25232
+ revision: string().nullable(),
25233
+ frames: number(),
25234
+ width: number(),
25235
+ height: number()
25236
+ });
25237
+ var NodeBenchRunnerInputSchema = object({
25238
+ runId: string().min(1),
25239
+ devices: array(NodeBenchmarkDevicePlanSchema).min(1),
25240
+ phases: array(NodeBenchmarkPhaseSchema).min(1),
25241
+ /** The full detail step tree root for the `pipeline` measurement is built on the node from these ids. */
25242
+ steps: array(string()).default([]),
25243
+ fpsPerStream: number().int().min(1).max(30),
25244
+ /** The runner stops on its own past this instant, whatever the hub does. */
25245
+ deadlineAtMs: number(),
25246
+ settleSec: number().min(0).max(60).default(NODE_BENCHMARK_DEFAULTS.settleSec),
25247
+ measureSec: number().min(2).max(300).default(NODE_BENCHMARK_DEFAULTS.measureSec),
25248
+ keepDownloadedModels: boolean().default(false)
25249
+ });
25250
+ var NodeBenchRunnerStateSchema = _enum([
25251
+ "running",
25252
+ "done",
25253
+ "failed",
25254
+ "aborted"
25255
+ ]);
25256
+ var NodeBenchRunnerStatusSchema = object({
25257
+ runId: string(),
25258
+ nodeId: string(),
25259
+ state: NodeBenchRunnerStateSchema,
25260
+ progress: NodeBenchProgressSchema.nullable(),
25261
+ /** Every finished cell so far — a run stopped half way keeps what it measured. */
25262
+ cells: array(NodeBenchCellSchema).readonly(),
25263
+ fingerprint: NodeBenchFingerprintSchema.nullable(),
25264
+ clip: NodeBenchClipSchema.nullable(),
25265
+ /** Cameras seen running on the node during the run (they share its pools). */
25266
+ activeCameraIds: array(number()).readonly(),
25267
+ /** Models the run downloaded and then deleted (not installed before). */
25268
+ deletedModels: array(string()).readonly(),
25269
+ error: string().nullable(),
25270
+ startedAtMs: number(),
25271
+ finishedAtMs: number().nullable()
25272
+ });
25273
+ var NodeBenchmarkStateSchema = _enum([
25274
+ "draining",
25275
+ "measuring",
25276
+ "restoring",
25277
+ "done",
25278
+ "failed",
25279
+ "aborted"
25280
+ ]);
25281
+ /** Why a run ended. */
25282
+ var NodeBenchmarkEndReasonSchema = _enum([
25283
+ "completed",
25284
+ "operator-abort",
25285
+ "deadline",
25286
+ "node-lost",
25287
+ "runner-lost",
25288
+ "hub-restart",
25289
+ "drain-timeout",
25290
+ "failed"
25291
+ ]);
25292
+ var NodeBenchmarkRunSchema = object({
25293
+ runId: string(),
25294
+ nodeId: string(),
25295
+ state: NodeBenchmarkStateSchema,
25296
+ plan: NodeBenchmarkPlanSchema,
25297
+ startedAtMs: number(),
25298
+ deadlineAtMs: number(),
25299
+ finishedAtMs: number().nullable(),
25300
+ endReason: NodeBenchmarkEndReasonSchema.nullable(),
25301
+ error: string().nullable(),
25302
+ /** Cameras moved off the node for the run. */
25303
+ moved: array(number()).readonly(),
25304
+ /** Cameras that stayed (their only frame source is the node). */
25305
+ staying: array(number()).readonly(),
25306
+ /** Something else ran on the node's pools during the run. */
25307
+ contaminated: boolean(),
25308
+ progress: NodeBenchProgressSchema.nullable(),
25309
+ resultIds: array(string()).readonly()
25310
+ });
25311
+ /** `getNodeBenchmarkStatus`: the active run (or the last one), and whether benchmark mode is on. */
25312
+ var NodeBenchmarkStatusSchema = object({
25313
+ /** The node the cluster is in benchmark mode for; null = none. */
25314
+ modeNodeId: string().nullable(),
25315
+ run: NodeBenchmarkRunSchema.nullable()
25316
+ });
25317
+ /**
25318
+ * One stored measurement — the only authority Auto tune and the automatic
25319
+ * shares read measured capacity from. Written by the orchestrator when a run
25320
+ * ends, never by anyone else.
25321
+ */
25322
+ var NodeBenchmarkResultSchema = object({
25323
+ id: string(),
25324
+ runId: string(),
25325
+ nodeId: string(),
25326
+ cell: NodeBenchCellSchema,
25327
+ fpsPerStream: number(),
25328
+ fingerprint: NodeBenchFingerprintSchema.nullable(),
25329
+ clip: NodeBenchClipSchema.nullable(),
25330
+ /** Other work shared the node's pools (a camera that could not move, or the hub's own duties). */
25331
+ contaminated: boolean(),
25332
+ stayingCameras: array(number()).readonly(),
25333
+ /** The run ended early; the cell itself completed. */
25334
+ partialRun: boolean(),
25335
+ measuredAtMs: number()
25336
+ });
25337
+ var ListNodeBenchmarkResultsInputSchema = object({
25338
+ nodeId: string().optional(),
25339
+ deviceKey: string().optional()
25340
+ });
25341
+ /** A result with its standing today: does it still beat the table? */
25342
+ var NodeBenchmarkResultViewSchema = NodeBenchmarkResultSchema.extend({
25343
+ /** `fresh` beats the table; `stale` falls back to it; `superseded` = a newer row covers the same cell. */
25344
+ standing: _enum([
25345
+ "fresh",
25346
+ "stale",
25347
+ "superseded"
25348
+ ]),
25349
+ staleWhy: _enum([
25350
+ "age",
25351
+ "runtime",
25352
+ "pool-tuning"
25353
+ ]).nullable()
25354
+ });
25355
+ object({
25356
+ runId: string(),
25357
+ nodeId: string(),
25358
+ startedAtMs: number(),
25359
+ deadlineAtMs: number(),
25360
+ plan: NodeBenchmarkPlanSchema,
25361
+ moved: array(number()).readonly(),
25362
+ staying: array(number()).readonly()
25363
+ });
25364
+ /** Candidate detectors per device, for the plan editor. */
25365
+ var NodeBenchmarkCandidatesSchema = object({
25366
+ nodeId: string(),
25367
+ reachable: boolean(),
25368
+ devices: array(object({
25369
+ deviceKey: string(),
25370
+ enabled: boolean(),
25371
+ available: boolean(),
25372
+ /** Ordered: what Auto tune would pick first, then the rest of the family by accuracy. */
25373
+ suggested: array(string()).readonly(),
25374
+ /** Every root detector the device has a build for. */
25375
+ all: array(string()).readonly(),
25376
+ /** The model the device runs now, when pinned. */
25377
+ currentModelId: string().nullable()
25378
+ })).readonly(),
25379
+ /** Detail steps the node's catalog offers under the root (for the `pipeline` measurement). */
25380
+ steps: array(object({
25381
+ id: string(),
25382
+ name: string(),
25383
+ slot: string()
25384
+ })).readonly()
25385
+ });
23468
25386
  object({
23469
25387
  activeCameras: number(),
23470
25388
  throttledCameras: number(),
@@ -23908,6 +25826,22 @@ var MotionSourceEnum = _enum([
23908
25826
  "device-activity"
23909
25827
  ]);
23910
25828
  /**
25829
+ * What opened an on-motion detection SESSION: the motion source that passed the
25830
+ * camera's `motionSources` gate, and what raised it (the camera itself, or a
25831
+ * sensor the operator attached — D672). `sensorName` is the attached sensor's
25832
+ * device name as the orchestrator's camera-sensors resolution last read it;
25833
+ * absent when unknown or when the camera itself triggered.
25834
+ *
25835
+ * Carried on the session attach ONLY so the runner's `DetectionPhaseTransition`
25836
+ * can say what started the session (D672 rule 11, amended 2026-10-06). The
25837
+ * runner never decides anything on it.
25838
+ */
25839
+ var SessionTriggerSchema = object({
25840
+ source: MotionSourceEnum,
25841
+ triggeredBy: MotionTriggeredBySchema,
25842
+ sensorName: string().optional()
25843
+ });
25844
+ /**
23911
25845
  * List of motion sources active on a camera. Empty array is valid:
23912
25846
  * "no source" — happens for battery cams without firmware motion when
23913
25847
  * the operator hasn't opted into the SW analyzer (would hold the
@@ -24159,6 +26093,14 @@ var RunnerCameraConfigSchema = object({
24159
26093
  */
24160
26094
  motionSources: MotionSourcesSchema.default(["analyzer"]),
24161
26095
  /**
26096
+ * What opened this attach, on a SESSION attach only (see
26097
+ * {@link SessionTriggerSchema}). OPTIONAL with no default: absent on a
26098
+ * standing attach, an occupancy burst, a re-dispatch with no motion event
26099
+ * behind it, and every attach from an orchestrator older than the field — the
26100
+ * runner then names no source on the phase event.
26101
+ */
26102
+ sessionTrigger: SessionTriggerSchema.optional(),
26103
+ /**
24162
26104
  * WHICH root detector runs for this camera. The detection counterpart of
24163
26105
  * {@link motionSources}, same shape and same discipline: a per-camera list
24164
26106
  * of sources the system understands, vendor-agnostic, owned here.
@@ -24318,14 +26260,15 @@ var RunnerLocalLoadSchema = object({
24318
26260
  * Per-inference-device live load (multi-device C4). One entry per deviceKey
24319
26261
  * this runner currently has attached cameras on, so the orchestrator's second
24320
26262
  * `balance()` pass (over a node's devices) weights on real per-pool session
24321
- * counts. Empty on single-device / pre-multi-device runners. `queueDepthTotal`
24322
- * per device is 0 until the pool backlog gets a public accessor (follow-up).
26263
+ * counts. Empty on single-device / pre-multi-device runners. There is no
26264
+ * per-device queue depth: the inference pool's backlog has no accessor, and
26265
+ * a field that always read 0 was removed rather than shown as a measurement
26266
+ * (D762).
24323
26267
  */
24324
26268
  devices: array(object({
24325
26269
  deviceKey: string(),
24326
26270
  backend: string(),
24327
- attachedCameras: number(),
24328
- queueDepthTotal: number()
26271
+ attachedCameras: number()
24329
26272
  })).default([]),
24330
26273
  /** Hardware capability flags reported by this node. */
24331
26274
  hardware: object({
@@ -24461,7 +26404,22 @@ method(RunnerCameraConfigSchema, object({ success: literal(true) }), { kind: "mu
24461
26404
  */
24462
26405
  cropJpeg: string().optional(),
24463
26406
  parent: DetailParentSchema,
24464
- steps: array(string()).optional()
26407
+ steps: array(string()).optional(),
26408
+ /**
26409
+ * The camera's root model already drew this step's boxes (D730): a
26410
+ * `license_plate` inside the parent vehicle. The named step is NOT
26411
+ * inferred — these FRAME-space boxes are its output — and its
26412
+ * requested children (the plate reader) run on them. Absent ⇒ every
26413
+ * requested step infers as before.
26414
+ */
26415
+ supplied: object({
26416
+ stepId: string(),
26417
+ modelId: string(),
26418
+ boxes: array(object({
26419
+ bbox: NativeCropBboxSchema,
26420
+ score: number()
26421
+ })).min(1)
26422
+ }).optional()
24465
26423
  }), object({ details: array(DetailResultSchema) }).nullable(), { kind: "mutation" }), method(object({
24466
26424
  /** Catalog step id, e.g. `clip-embedding`. */
24467
26425
  stepId: string(),
@@ -24513,7 +26471,16 @@ method(RunnerCameraConfigSchema, object({ success: literal(true) }), { kind: "mu
24513
26471
  }), ParkedTrackFrameSchema.nullable()), method(object({
24514
26472
  deviceId: number(),
24515
26473
  trackId: string()
24516
- }), object({ released: number().int().nonnegative() }), { kind: "mutation" });
26474
+ }), object({ released: number().int().nonnegative() }), { kind: "mutation" }), method(NodeBenchRunnerInputSchema, object({
26475
+ accepted: literal(true),
26476
+ runId: string()
26477
+ }), {
26478
+ kind: "mutation",
26479
+ auth: "admin"
26480
+ }), method(object({ runId: string() }), NodeBenchRunnerStatusSchema.nullable(), { auth: "admin" }), method(object({ runId: string() }), object({ aborted: boolean() }), {
26481
+ kind: "mutation",
26482
+ auth: "admin"
26483
+ });
24517
26484
  var CameraPipelineConfigSchema = object({
24518
26485
  engine: PipelineEngineChoiceSchema.optional(),
24519
26486
  steps: array(PipelineStepInputSchema).readonly(),
@@ -24524,14 +26491,6 @@ var CameraPipelineConfigSchema = object({
24524
26491
  settings: record(string(), unknown()).readonly().optional()
24525
26492
  }).nullable().optional()
24526
26493
  });
24527
- var PipelineTemplateSchema = object({
24528
- id: string(),
24529
- name: string(),
24530
- description: string().optional(),
24531
- config: CameraPipelineConfigSchema,
24532
- createdAt: string(),
24533
- updatedAt: string()
24534
- });
24535
26494
  var DeviceStepConfigSchema = object({
24536
26495
  modelId: string().optional(),
24537
26496
  settings: record(string(), unknown()).optional(),
@@ -24605,9 +26564,10 @@ var CameraStepOverridePatchSchema = object({
24605
26564
  modelId: string().optional(),
24606
26565
  settings: record(string(), unknown()).readonly().optional()
24607
26566
  });
26567
+ var CameraStepSettingsSchema = record(string(), record(string(), unknown()).readonly());
24608
26568
  var CameraPipelineSettingsSchema = object({
24609
- pinnedAgentNodeId: string().optional(),
24610
26569
  stepToggles: record(string(), boolean()).optional(),
26570
+ stepSettings: CameraStepSettingsSchema.optional(),
24611
26571
  stepOverridesByDevice: record(string(), record(string(), record(string(), CameraStepOverridePatchSchema))).optional(),
24612
26572
  pipelineByAgent: record(string(), CameraPipelineForAgentSchema).optional()
24613
26573
  });
@@ -24640,7 +26600,10 @@ var PipelineAssignmentSchema = object({
24640
26600
  });
24641
26601
  /**
24642
26602
  * Per-agent load summary surfaced to the load balancer + dashboards.
24643
- * Aggregated from each runner's `getLocalLoad` cap call.
26603
+ * Aggregated from each runner's `getLocalLoad` cap call. In the
26604
+ * `getAgentLoad` report, a single-device node's default-pool sessions (no
26605
+ * `deviceKey`) are credited to its one eligible device in `load.devices` —
26606
+ * the default pool IS that device (D745); the balancer's census stays raw.
24644
26607
  */
24645
26608
  var AgentLoadSummarySchema = object({
24646
26609
  nodeId: string(),
@@ -24729,26 +26692,27 @@ var CameraBrokerStatusSchema = object({
24729
26692
  width: number(),
24730
26693
  height: number(),
24731
26694
  subscribers: number(),
24732
- inFps: number(),
24733
- outFps: number()
26695
+ /**
26696
+ * Encoded packets/s the broker receives from the camera. null when the
26697
+ * broker's stats read failed — unknown, never 0 (a 0 here reads as a stall).
26698
+ * There is no output rate: decoding runs in the session decode workers, not
26699
+ * in the broker, so the broker's own decoded-frame rate is 0 on every live
26700
+ * camera and is not served (D758).
26701
+ */
26702
+ inFps: number().nullable()
24734
26703
  })).readonly(),
24735
26704
  webrtcSessions: number(),
24736
26705
  rtspRestream: boolean()
24737
26706
  });
24738
- /** Shared-memory ring statistics within the decoder block. */
24739
- var CameraDecoderShmSchema = object({
24740
- framesWritten: number(),
24741
- getFrameHits: number(),
24742
- getFrameMisses: number(),
24743
- budgetMb: number()
24744
- });
24745
- /** Decoder block — null when the decoder stage is unreachable or inactive. */
24746
- var CameraDecoderStatusSchema = object({
24747
- nodeId: string(),
24748
- formats: array(string()).readonly(),
24749
- sessionCount: number(),
24750
- shm: CameraDecoderShmSchema
24751
- });
26707
+ /**
26708
+ * Decoder block — WHERE decode runs (co-located with the detection node by
26709
+ * construction); null when the camera has no detection node. It carries no
26710
+ * frame counter: the shared-memory plane whose counters it used to serve is
26711
+ * gone, and those fields read 0 forever. Whether frames actually flow is read
26712
+ * from `detection.actualFps` (frames delivered to and processed by the
26713
+ * detector), never from a counter nothing feeds.
26714
+ */
26715
+ var CameraDecoderStatusSchema = object({ nodeId: string() });
24752
26716
  /** Motion block — null when motion detection is not active for this device. */
24753
26717
  var CameraMotionStatusSchema = object({
24754
26718
  enabled: boolean(),
@@ -25105,12 +27069,6 @@ method(object({
25105
27069
  }), object({ success: literal(true) }), {
25106
27070
  kind: "mutation",
25107
27071
  auth: "admin"
25108
- }), method(object({
25109
- agentNodeId: string(),
25110
- detectWeight: number().positive().nullable()
25111
- }), object({ success: literal(true) }), {
25112
- kind: "mutation",
25113
- auth: "admin"
25114
27072
  }), method(object({
25115
27073
  agentNodeId: string(),
25116
27074
  detect: boolean().nullable().optional(),
@@ -25152,6 +27110,30 @@ method(object({
25152
27110
  }), {
25153
27111
  kind: "mutation",
25154
27112
  auth: "admin"
27113
+ }), method(AutoTuneOptionsSchema, AutoTunePlanSchema, { auth: "admin" }), method(AutoTuneApplyInputSchema, AutoTuneApplyResultSchema, {
27114
+ kind: "mutation",
27115
+ auth: "admin"
27116
+ }), method(LoadBalancingSharesInputSchema, object({ success: literal(true) }), {
27117
+ kind: "mutation",
27118
+ auth: "admin"
27119
+ }), method(PlacementStatsInputSchema, PlacementStatsSchema, { auth: "admin" }), method(SuggestSharesInputSchema, SuggestSharesResultSchema, { auth: "admin" }), method(_void(), EffectiveSharesSchema, { auth: "admin" }), method(SetShareSourceInputSchema, object({ success: literal(true) }), {
27120
+ kind: "mutation",
27121
+ auth: "admin"
27122
+ }), method(NodeBenchmarkPlanSchema, NodeBenchmarkPreflightSchema, { auth: "admin" }), method(NodeBenchmarkPlanSchema, discriminatedUnion("kind", [object({
27123
+ kind: literal("started"),
27124
+ runId: string()
27125
+ }), object({
27126
+ kind: literal("refused"),
27127
+ preflight: NodeBenchmarkPreflightSchema
27128
+ })]), {
27129
+ kind: "mutation",
27130
+ auth: "admin"
27131
+ }), method(_void(), NodeBenchmarkStatusSchema, { auth: "admin" }), method(object({ runId: string() }), object({ aborted: boolean() }), {
27132
+ kind: "mutation",
27133
+ auth: "admin"
27134
+ }), method(object({ nodeId: string() }), NodeBenchmarkCandidatesSchema, { auth: "admin" }), method(ListNodeBenchmarkResultsInputSchema, array(NodeBenchmarkResultViewSchema).readonly(), { auth: "admin" }), method(object({ id: string() }), object({ deleted: boolean() }), {
27135
+ kind: "mutation",
27136
+ auth: "admin"
25155
27137
  }), method(object({ deviceId: number() }), CameraPipelineSettingsSchema.nullable()), method(object({
25156
27138
  deviceId: number(),
25157
27139
  addonId: string(),
@@ -25168,6 +27150,13 @@ method(object({
25168
27150
  }), object({ success: literal(true) }), {
25169
27151
  kind: "mutation",
25170
27152
  auth: "admin"
27153
+ }), method(object({
27154
+ deviceId: number(),
27155
+ addonId: string(),
27156
+ settings: record(string(), unknown()).nullable()
27157
+ }), object({ success: literal(true) }), {
27158
+ kind: "mutation",
27159
+ auth: "admin"
25171
27160
  }), method(object({
25172
27161
  deviceId: number(),
25173
27162
  agentNodeId: string(),
@@ -25191,25 +27180,7 @@ method(object({
25191
27180
  }), method(_void(), DiskReconcileJobSchema, {
25192
27181
  kind: "mutation",
25193
27182
  auth: "admin"
25194
- }), method(_void(), DiskReconcileJobSchema, { auth: "admin" }), method(_void(), array(PipelineTemplateSchema).readonly()), method(object({
25195
- name: string(),
25196
- description: string().optional(),
25197
- config: CameraPipelineConfigSchema
25198
- }), PipelineTemplateSchema, {
25199
- kind: "mutation",
25200
- auth: "admin"
25201
- }), method(object({
25202
- id: string(),
25203
- name: string().optional(),
25204
- description: string().optional(),
25205
- config: CameraPipelineConfigSchema.optional()
25206
- }), PipelineTemplateSchema, {
25207
- kind: "mutation",
25208
- auth: "admin"
25209
- }), method(object({ id: string() }), object({ success: literal(true) }), {
25210
- kind: "mutation",
25211
- auth: "admin"
25212
- });
27183
+ }), method(_void(), DiskReconcileJobSchema, { auth: "admin" });
25213
27184
  /**
25214
27185
  * Cap → event-kind mapping for the SENSOR / CONTROL cap families — the table
25215
27186
  * `pipeline-analytics.listEventKinds` uses to turn a linked device's bound
@@ -25812,7 +27783,19 @@ var SsoBridgeClaimsSchema = object({
25812
27783
  * editing a descriptor must not retroactively extend or shorten a link the
25813
27784
  * operator already consented to.
25814
27785
  */
25815
- refreshTtl: union([number().int().positive(), literal("never")]).optional()
27786
+ refreshTtl: union([number().int().positive(), literal("never")]).optional(),
27787
+ /**
27788
+ * Opaque handle of a hub-side LINK intent (D782). Set by an OIDC callback
27789
+ * that was started from a signed-in user's "Link" button: the finish then
27790
+ * links this identity to the intent's user instead of signing anyone in.
27791
+ * The handle carries no user id — the hub resolves it, single-use.
27792
+ */
27793
+ linkIntent: string().optional(),
27794
+ /**
27795
+ * Verified `iss` of the id_token behind an OIDC login bridge (D782). A
27796
+ * subject is unique only per issuer, so a link is bound to it.
27797
+ */
27798
+ issuer: string().optional()
25816
27799
  });
25817
27800
  method(object({
25818
27801
  claims: SsoBridgeClaimsSchema,
@@ -27442,8 +29425,6 @@ var WebrtcStreamChoiceSchema = object({
27442
29425
  ]).nullable(),
27443
29426
  /** Input FPS from the camera (null for adaptive). */
27444
29427
  inputFps: number().nullable(),
27445
- /** Decoded FPS (null for adaptive). */
27446
- decodeFps: number().nullable(),
27447
29428
  /** Bitrate in kbps (null for adaptive). */
27448
29429
  bitrateKbps: number().nullable()
27449
29430
  });
@@ -27720,7 +29701,22 @@ DeviceType.Camera, method(object({ deviceId: number().int().nonnegative() }), ar
27720
29701
  * field their hints were silently stripped by the schema and the
27721
29702
  * adaptive ladder started blind on the client's display size.
27722
29703
  */
27723
- hints: webrtcClientHintsSchema.optional()
29704
+ hints: webrtcClientHintsSchema.optional(),
29705
+ /**
29706
+ * Talk-back (D771): relay the PEER's audio to the device's speaker
29707
+ * through the `intercom` cap's push-talk triple. When `true` and the
29708
+ * offer lets the peer send audio, the answer's audio is `sendrecv`
29709
+ * and every inbound frame goes to `intercom.pushTalkAudio` for this
29710
+ * `deviceId`; absent/false answers `sendonly`, as for every viewer.
29711
+ *
29712
+ * TRUSTED-CALLER ONLY. Set by the Alexa export for an Echo on a camera
29713
+ * with `intercom`, when the linked user may control that camera. The
29714
+ * hub STRIPS it from every request-bound call (a browser), exactly as
29715
+ * it overwrites `relayOnly` — a viewer's talk permission is the
29716
+ * intercom cap's own surface (share tokens gate it there), and this
29717
+ * flag must not become a second door to the camera's speaker.
29718
+ */
29719
+ talkback: boolean().optional()
27724
29720
  }), object({
27725
29721
  sessionId: string(),
27726
29722
  sdpAnswer: string()
@@ -27775,6 +29771,14 @@ DeviceType.Camera, method(object({ deviceId: number().int().nonnegative() }), ar
27775
29771
  */
27776
29772
  alive: boolean()
27777
29773
  })), method(object({
29774
+ deviceId: number().int().nonnegative(),
29775
+ sessionId: string(),
29776
+ downlinkMbps: number().nonnegative()
29777
+ }), object({
29778
+ outcome: _enum(["switching", "held"]),
29779
+ tier: CamProfileSchema.nullable(),
29780
+ reason: string()
29781
+ }), { kind: "mutation" }), method(object({
27778
29782
  deviceId: number().int().nonnegative(),
27779
29783
  sessionId: string()
27780
29784
  }), WebrtcSessionDebugSchema, { kind: "query" });
@@ -28014,6 +30018,59 @@ var AddonAutoUpdateSchema = ChannelWithInheritSchema;
28014
30018
  var RestartAddonResultSchema = unknown();
28015
30019
  var InstallPackageResultSchema = unknown();
28016
30020
  var ReloadPackagesResultSchema = unknown();
30021
+ /**
30022
+ * What an uninstall did on ONE node.
30023
+ * - `uninstalled` — removed: runner(s) stopped, caps gone, code deleted.
30024
+ * - `not-installed` — the node did not have it (nothing to do).
30025
+ * - `refused` — protected / bootstrap package; nothing touched.
30026
+ * - `failed` — attempted and did not complete; `error` says why.
30027
+ * - `pending-reconnect` — the node is OFFLINE: its record was pruned so the
30028
+ * back-fill never returns the package, and the stale-addon sweep removes the
30029
+ * copy when the node registers again (only once the hub no longer has it).
30030
+ */
30031
+ var UninstallNodeOutcomeSchema = _enum([
30032
+ "uninstalled",
30033
+ "not-installed",
30034
+ "refused",
30035
+ "failed",
30036
+ "pending-reconnect"
30037
+ ]);
30038
+ var UninstallNodeResultSchema = object({
30039
+ nodeId: string(),
30040
+ outcome: UninstallNodeOutcomeSchema,
30041
+ error: string().optional(),
30042
+ addonIds: array(string()).readonly(),
30043
+ runnersStopped: array(string()).readonly(),
30044
+ warnings: array(string()).readonly()
30045
+ });
30046
+ var UninstallPackageResultSchema = object({
30047
+ /** Every targeted node ended `uninstalled`, `not-installed` or `pending-reconnect`. */
30048
+ success: boolean(),
30049
+ packageName: string(),
30050
+ results: array(UninstallNodeResultSchema).readonly()
30051
+ });
30052
+ /**
30053
+ * `unreachable` lists online agents whose status read FAILED — absence from
30054
+ * `installations` is only "not installed" for a node that answered (D315).
30055
+ */
30056
+ var PackageInstallationsSchema = object({
30057
+ installations: array(object({
30058
+ packageName: string(),
30059
+ nodeId: string(),
30060
+ nodeName: string(),
30061
+ isHub: boolean(),
30062
+ isOnline: boolean(),
30063
+ version: string().nullable(),
30064
+ addonIds: array(string()).readonly(),
30065
+ source: _enum(["live", "recorded"]),
30066
+ /** The hub installs this package too. `false` on an agent row = an orphan. */
30067
+ onHub: boolean()
30068
+ })).readonly(),
30069
+ unreachable: array(object({
30070
+ nodeId: string(),
30071
+ error: string()
30072
+ })).readonly()
30073
+ });
28017
30074
  var BulkUpdateItemStatusSchema = _enum([
28018
30075
  "queued",
28019
30076
  "updating",
@@ -28096,10 +30153,14 @@ method(_void(), array(AddonListItemSchema).readonly()), method(object({
28096
30153
  }), method(object({ packageName: string() }), InstallPackageResultSchema, {
28097
30154
  kind: "mutation",
28098
30155
  auth: "admin"
28099
- }), method(_void(), boolean()), method(_void(), array(unknown()).readonly()), method(object({ packageName: string() }), unknown(), {
30156
+ }), method(_void(), boolean()), method(_void(), array(unknown()).readonly()), method(object({
30157
+ packageName: string().min(1),
30158
+ nodeId: string().optional(),
30159
+ everywhere: boolean().optional()
30160
+ }), UninstallPackageResultSchema, {
28100
30161
  kind: "mutation",
28101
30162
  auth: "admin"
28102
- }), method(_void(), ReloadPackagesResultSchema, {
30163
+ }), method(object({ packageName: string().optional() }), PackageInstallationsSchema, { auth: "admin" }), method(_void(), ReloadPackagesResultSchema, {
28103
30164
  kind: "mutation",
28104
30165
  auth: "admin"
28105
30166
  }), method(object({ query: string().optional() }), array(SearchResultSchema)), method(object({ nodeId: string().optional() }), array(PackageUpdateSchema).readonly(), { auth: "admin" }), method(object({
@@ -30167,6 +32228,9 @@ var CreateIntegrationInputSchema = object({
30167
32228
  enabled: boolean().optional(),
30168
32229
  info: record(string(), unknown()).optional(),
30169
32230
  settings: record(string(), unknown()).optional(),
32231
+ /** Keys of `settings` the form's schema declares secret (by type) — kept in
32232
+ * the keychain, not the table (D787). */
32233
+ secretKeys: array(string()).optional(),
30170
32234
  skipRestart: boolean().optional()
30171
32235
  });
30172
32236
  var UpdateIntegrationInputSchema = object({
@@ -30190,7 +32254,9 @@ method(_void(), array(IntegrationWithStateSchema)), method(object({ id: string()
30190
32254
  auth: "admin"
30191
32255
  }), method(object({ id: string() }), record(string(), unknown()), { auth: "admin" }), method(object({
30192
32256
  id: string(),
30193
- settings: record(string(), unknown())
32257
+ settings: record(string(), unknown()),
32258
+ /** Keys the form's schema declares secret (by type) — keychain-stored (D787). */
32259
+ secretKeys: array(string()).optional()
30194
32260
  }), object({ success: boolean() }), {
30195
32261
  kind: "mutation",
30196
32262
  auth: "admin"
@@ -30395,7 +32461,7 @@ var LocalInterfaceSchema = object({
30395
32461
  name: string(),
30396
32462
  family: _enum(["IPv4", "IPv6"]),
30397
32463
  address: string(),
30398
- /** CIDR shorthand (e.g. `192.168.x.x/24`). Empty when OS doesn't expose. */
32464
+ /** CIDR shorthand (e.g. `192.168.10.10/24`). Empty when OS doesn't expose. */
30399
32465
  cidr: string(),
30400
32466
  /** OS netmask. Stable across calls so the SDK can hash on it. */
30401
32467
  netmask: string(),
@@ -30449,7 +32515,9 @@ var ConnectionEndpointSchema = object({
30449
32515
  "lan-ipv4",
30450
32516
  "lan-ipv6",
30451
32517
  "public",
30452
- "loopback"
32518
+ "loopback",
32519
+ "app-link",
32520
+ "custom"
30453
32521
  ]),
30454
32522
  /**
30455
32523
  * Originating-interface kind — `lan`/`wifi`/`docker`/`vpn`/`other`/
@@ -30518,15 +32586,27 @@ var GetConnectionEndpointsResultSchema = object({
30518
32586
  localPort: AdvertisedLocalPortSchema
30519
32587
  });
30520
32588
  /**
30521
- * The chosen outbound endpoint for notification artifacts. `baseUrl: null` =
30522
- * AUTO (resolved from the candidate ranking at send time); `resolved` reports
30523
- * what AUTO currently picks, so the UI can show the effective value either way.
32589
+ * The address flagged for notification taps (`notificationTaps`). `baseUrl: null` = AUTO, which
32590
+ * since D709 is the CamStack app link; `resolved` reports the effective value,
32591
+ * so the UI can show it either way.
30524
32592
  */
30525
32593
  var NotificationEndpointSchema = object({
30526
32594
  /** The operator's explicit choice, or null for AUTO. */
30527
32595
  baseUrl: string().nullable(),
30528
- /** What the ranking currently resolves to (null when nothing is reachable). */
30529
- resolved: string().nullable()
32596
+ /**
32597
+ * The effective flagged address: the explicit choice, else (AUTO) the
32598
+ * CamStack app link `https://camstack.zentik.app` (D709). A pre-D709 hub
32599
+ * answered the public tunnel / mesh here, or null.
32600
+ */
32601
+ resolved: string().nullable(),
32602
+ /**
32603
+ * The hub origin an app link carries as `hub=` (D709): the hub's best
32604
+ * public HTTPS address — the tunnel, then the mesh (Tailscale MagicDNS) —
32605
+ * picked from this cap's own palette by `pickAppLinkHub`. `null` when the
32606
+ * hub advertises neither; the app link is then minted without `hub=`.
32607
+ * Absent on a pre-D709 hub.
32608
+ */
32609
+ appLinkHub: string().nullable()
30530
32610
  });
30531
32611
  /**
30532
32612
  * The URLs the SDK / viewer should race for API access. `baseUrls` empty =
@@ -30539,6 +32619,72 @@ var ViewerEndpointsSchema = object({
30539
32619
  /** What the ranking currently resolves to (may be empty if nothing is up). */
30540
32620
  resolved: array(string()).readonly()
30541
32621
  });
32622
+ /**
32623
+ * DEPRECATED compatibility shape of `getHubAddresses` (D729 amendment, kept
32624
+ * for addons built against it): `cluster` is the `internal` role, `browser`
32625
+ * the `publicEndpoint` role; `override` is the flagged address.
32626
+ */
32627
+ var HubAddressSnapshotSchema = object({
32628
+ override: string().nullable(),
32629
+ resolved: string().nullable(),
32630
+ source: _enum([
32631
+ "override",
32632
+ "auto",
32633
+ "none"
32634
+ ])
32635
+ });
32636
+ var HubAddressesSchema = object({
32637
+ cluster: HubAddressSnapshotSchema,
32638
+ browser: HubAddressSnapshotSchema
32639
+ });
32640
+ /**
32641
+ * What an address is used for (`hub-address.ts`, D734). `appConnections` is
32642
+ * many-valued; `notificationTaps`, `publicEndpoint` and `internal` are carried
32643
+ * by at most one address.
32644
+ */
32645
+ var HubAddressRoleSchema = _enum(HUB_ADDRESS_ROLES);
32646
+ var RoleSourceSchema = _enum([
32647
+ "flagged",
32648
+ "auto",
32649
+ "none"
32650
+ ]);
32651
+ /** One single-valued role: the flagged address, the one in use, and why. */
32652
+ var HubAddressRoleResolutionSchema = object({
32653
+ /** The address carrying the flag, or null = automatic. */
32654
+ flagged: string().nullable(),
32655
+ /** The address in use, or null when nothing qualifies (never loopback). */
32656
+ resolved: string().nullable(),
32657
+ source: RoleSourceSchema
32658
+ });
32659
+ var HubAppConnectionsResolutionSchema = object({
32660
+ /** The addresses flagged `appConnections`, or empty = automatic. */
32661
+ flagged: array(string()).readonly(),
32662
+ /** What the apps race right now. */
32663
+ resolved: array(string()).readonly(),
32664
+ source: RoleSourceSchema
32665
+ });
32666
+ var HubAddressBookSchema = object({
32667
+ rows: array(ConnectionEndpointSchema.extend({
32668
+ /** In the hub's detected palette right now. */
32669
+ detected: boolean(),
32670
+ /** Entered by the operator (removable). */
32671
+ custom: boolean(),
32672
+ /** The roles explicitly flagged on this address. */
32673
+ flags: array(HubAddressRoleSchema).readonly(),
32674
+ /** The roles this address serves right now — flagged or automatic. */
32675
+ inUse: array(HubAddressRoleSchema).readonly(),
32676
+ /** The roles this address may be flagged with. */
32677
+ eligible: array(HubAddressRoleSchema).readonly()
32678
+ })).readonly(),
32679
+ roles: object({
32680
+ appConnections: HubAppConnectionsResolutionSchema,
32681
+ notificationTaps: HubAddressRoleResolutionSchema,
32682
+ internal: HubAddressRoleResolutionSchema,
32683
+ publicEndpoint: HubAddressRoleResolutionSchema
32684
+ }),
32685
+ /** The `hub=` an app link carries (D709), or null. */
32686
+ appLinkHub: string().nullable()
32687
+ });
30542
32688
  var AllowedAddressesSchema = object({
30543
32689
  /**
30544
32690
  * Allowlist of interface addresses operators have explicitly opted
@@ -30580,8 +32726,29 @@ method(_void(), ListResultSchema), method(_void(), PreferredSchema), method(obje
30580
32726
  * Pass `'https'` when the caller is itself loaded over HTTPS
30581
32727
  * to avoid mixed-content blocks in the browser. The public
30582
32728
  * tunnel always emits `https://` regardless. */
30583
- scheme: _enum(["http", "https"]).optional()
30584
- }), 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, {
32729
+ scheme: _enum(["http", "https"]).optional(),
32730
+ /** Append the CamStack app link entry (`kind: 'app-link'`, D709) —
32731
+ * an address notification taps can be flagged with, not a hub
32732
+ * route. Default `false`: racers and rankers never see it. */
32733
+ includeAppLink: boolean().optional()
32734
+ }), 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({
32735
+ baseUrl: string(),
32736
+ label: string().max(80)
32737
+ }), HubAddressBookSchema, {
32738
+ kind: "mutation",
32739
+ auth: "admin"
32740
+ }), method(object({ baseUrl: string() }), HubAddressBookSchema, {
32741
+ kind: "mutation",
32742
+ auth: "admin"
32743
+ }), method(object({
32744
+ role: HubAddressRoleSchema,
32745
+ baseUrl: string().nullable(),
32746
+ enabled: boolean(),
32747
+ acceptInsecureHttp: boolean().optional()
32748
+ }), HubAddressBookSchema, {
32749
+ kind: "mutation",
32750
+ auth: "admin"
32751
+ }), 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, {
30585
32752
  kind: "mutation",
30586
32753
  auth: "admin"
30587
32754
  }), method(object({
@@ -30841,7 +33008,7 @@ var MeshPeerSchema = object({
30841
33008
  tags: array(string()).readonly(),
30842
33009
  /** True when the peer advertises itself as an exit-node candidate. */
30843
33010
  exitNodeOption: boolean(),
30844
- /** Subnet routes the peer advertises (e.g. `["192.168.x.x/24"]`). */
33011
+ /** Subnet routes the peer advertises (e.g. `["192.168.10.0/24"]`). */
30845
33012
  advertisedRoutes: array(string()).readonly(),
30846
33013
  /** Owner account login (e.g. `foo@example.com`). Null for tagged peers. */
30847
33014
  userLogin: string().nullable(),
@@ -30971,7 +33138,8 @@ object({
30971
33138
  * writes this slice (not even a boot seed), and neither does the runner's
30972
33139
  * phase machine: its phase is "a session is attached" for every on-motion
30973
33140
  * session, not motion, and it now has its own `DetectionPhaseTransition`.
30974
- * A provider's `isDetected` answers from the hub's slice.
33141
+ * A provider's `isDetected` and `getStatus` answer from the hub's slice
33142
+ * (`hubMotionNativeProvider`).
30975
33143
  * - **Sensors** (Home Assistant binary sensors, Homematic, Matter, Alexa
30976
33144
  * imports) — the provider pushes both edges itself, from the upstream
30977
33145
  * system's own state change. That is the sensor's own fact.
@@ -31785,7 +33953,13 @@ var OsdStatusSchema = object({ overlays: array(object({
31785
33953
  */
31786
33954
  availablePositions: array(OsdPositionEnum).readonly(),
31787
33955
  /** Firmware does not allow editing the `text` field (e.g. timestamp). */
31788
- readOnly: boolean().optional()
33956
+ readOnly: boolean().optional(),
33957
+ /**
33958
+ * Firmware text ceiling for this overlay. Absent = no known limit.
33959
+ * The OSD manager truncates here on every write — never stores its own
33960
+ * copy on the binding.
33961
+ */
33962
+ maxCharacters: number().int().positive().optional()
31789
33963
  })).readonly() });
31790
33964
  var OsdOverlayPatchSchema = object({
31791
33965
  enabled: boolean().optional(),
@@ -31836,7 +34010,9 @@ var OsdTemplateBindingSchema = object({
31836
34010
  valuePath: string().min(1).max(64),
31837
34011
  /** Convert TO this unit at render (`tryConvertUnit`). Absent = source unit. */
31838
34012
  displayUnit: string().max(16).optional(),
31839
- maxDecimals: number().int().min(0).max(4).default(1)
34013
+ maxDecimals: number().int().min(0).max(4).default(1),
34014
+ /** Raw value → display text (same shape as slot binding). Empty string hides. */
34015
+ valueMap: record(string(), string()).optional()
31840
34016
  });
31841
34017
  /**
31842
34018
  * A named template: bindings (alias → leaf field) + a parser that
@@ -31886,18 +34062,11 @@ var OsdSlotBindingSchema = object({
31886
34062
  source: OsdSourceSchema,
31887
34063
  /** `${value}` and `${unit}` are substituted; every occurrence. */
31888
34064
  template: string().max(96).default("${value}"),
31889
- /** Truncate with an ellipsis past this length. Absent = no limit. */
31890
- maxCharacters: number().int().min(4).max(64).optional(),
31891
34065
  /**
31892
34066
  * Decimal places for a numeric value. `0` yields an integer — the
31893
34067
  * documented workaround for firmwares that reject `.` in overlay text.
31894
34068
  */
31895
34069
  maxDecimals: number().int().min(0).max(4).default(1),
31896
- /**
31897
- * Appended via `${unit}` when no unit conversion produces a label.
31898
- * Prefer `source.displayUnit` for converted device-state values.
31899
- */
31900
- unitLabel: string().max(8).optional(),
31901
34070
  /** Raw value → display text, e.g. `{"true":"MOTION","false":""}`. */
31902
34071
  valueMap: record(string(), string()).optional(),
31903
34072
  /** Time windows in which the slot is shown. Absent = always. */
@@ -31906,9 +34075,7 @@ var OsdSlotBindingSchema = object({
31906
34075
  * Display gate, in the notification centre's condition vocabulary.
31907
34076
  * Only the keys reported by `getConditionSupport` are accepted.
31908
34077
  */
31909
- conditions: NcConditionsSchema.optional(),
31910
- /** Rendered when the gate is closed or the value unreadable. Empty = hide. */
31911
- fallbackText: string().max(64).default("")
34078
+ conditions: NcConditionsSchema.optional()
31912
34079
  });
31913
34080
  /** One camera slot, as the operator sees it: firmware truth + our binding. */
31914
34081
  var OsdSlotViewSchema = object({
@@ -35598,6 +37765,32 @@ var TotpStatusSchema = object({
35598
37765
  /** Null when no row exists OR the row is still pending confirmation. */
35599
37766
  confirmedAt: number().nullable()
35600
37767
  });
37768
+ /**
37769
+ * user-management — singleton capability for user accounts, API keys,
37770
+ * and scoped tokens.
37771
+ *
37772
+ * v2 model: every method gated by `auth: 'admin'`. Admin-only delegation
37773
+ * — the subset check on `setUserScopes` / `createScopedToken` is moot
37774
+ * because non-admins never reach these. If/when we open non-admin
37775
+ * delegation, structural caller-scope subset check goes inside the
37776
+ * provider.
37777
+ */
37778
+ var ExternalIdentitySchema = object({
37779
+ /** Login-method id of the provider instance, e.g. `auth-oidc/authentik`. */
37780
+ provider: string(),
37781
+ /** The IdP's stable subject (`sub`) for this account. */
37782
+ subject: string(),
37783
+ /** The verified `iss` of the IdP the identity was linked under — `sub` is unique only per issuer. */
37784
+ issuer: string(),
37785
+ userId: string(),
37786
+ /** What the IdP called the account at link time (username / email) — display only. */
37787
+ label: string().optional(),
37788
+ linkedAt: number()
37789
+ });
37790
+ var ExternalIdentityKeySchema = object({
37791
+ provider: string().min(1),
37792
+ subject: string().min(1)
37793
+ });
35601
37794
  method(_void(), array(UserSummarySchema), { auth: "admin" }), method(CreateUserInputSchema, UserSummarySchema, {
35602
37795
  kind: "mutation",
35603
37796
  auth: "admin",
@@ -35711,7 +37904,22 @@ method(_void(), array(UserSummarySchema), { auth: "admin" }), method(CreateUserI
35711
37904
  userId: string(),
35712
37905
  username: string(),
35713
37906
  scopes: array(TokenScopeSchema)
35714
- }).nullable(), { access: "view" }), method(_void(), array(OauthSessionSummarySchema), { auth: "admin" }), method(object({ id: string() }), object({ success: boolean() }), {
37907
+ }).nullable(), { access: "view" }), method(object({ userId: string() }), array(ExternalIdentitySchema), { auth: "admin" }), method(ExternalIdentityKeySchema, object({
37908
+ userId: string(),
37909
+ issuer: string()
37910
+ }).nullable(), { auth: "admin" }), method(ExternalIdentityKeySchema.extend({
37911
+ userId: string(),
37912
+ issuer: string().min(1),
37913
+ label: string().optional()
37914
+ }), object({ success: literal(true) }), {
37915
+ kind: "mutation",
37916
+ auth: "admin",
37917
+ access: "create"
37918
+ }), method(ExternalIdentityKeySchema.extend({ userId: string() }), object({ success: boolean() }), {
37919
+ kind: "mutation",
37920
+ auth: "admin",
37921
+ access: "delete"
37922
+ }), method(_void(), array(OauthSessionSummarySchema), { auth: "admin" }), method(object({ id: string() }), object({ success: boolean() }), {
35715
37923
  kind: "mutation",
35716
37924
  auth: "admin",
35717
37925
  access: "delete"
@@ -36103,6 +38311,16 @@ DeviceType.Camera, method(object({
36103
38311
  package: array(ZoneRuleSchema).readonly()
36104
38312
  });
36105
38313
  SOURCE_CAPS.filter((cap) => cap !== "switch" && cap !== "motion");
38314
+ Object.freeze({
38315
+ person: .5,
38316
+ vehicle: .5,
38317
+ animal: .5
38318
+ });
38319
+ Object.freeze({
38320
+ person: .65,
38321
+ vehicle: .65,
38322
+ animal: .65
38323
+ });
36106
38324
  /**
36107
38325
  * Accessory device helpers — shared across drivers.
36108
38326
  *
@@ -36277,6 +38495,12 @@ Object.freeze({
36277
38495
  addonId: null,
36278
38496
  access: "view"
36279
38497
  },
38498
+ "addons.listInstallations": {
38499
+ capName: "addons",
38500
+ capScope: "system",
38501
+ addonId: null,
38502
+ access: "view"
38503
+ },
36280
38504
  "addons.listJobs": {
36281
38505
  capName: "addons",
36282
38506
  capScope: "system",
@@ -37459,90 +39683,18 @@ Object.freeze({
37459
39683
  addonId: null,
37460
39684
  access: "create"
37461
39685
  },
37462
- "decoder.createSession": {
37463
- capName: "decoder",
37464
- capScope: "system",
37465
- addonId: null,
37466
- access: "view"
37467
- },
37468
- "decoder.destroySession": {
37469
- capName: "decoder",
37470
- capScope: "system",
37471
- addonId: null,
37472
- access: "delete"
37473
- },
37474
- "decoder.getFrame": {
37475
- capName: "decoder",
37476
- capScope: "system",
37477
- addonId: null,
37478
- access: "view"
37479
- },
37480
39686
  "decoder.getInfo": {
37481
39687
  capName: "decoder",
37482
39688
  capScope: "system",
37483
39689
  addonId: null,
37484
39690
  access: "view"
37485
39691
  },
37486
- "decoder.getShmStats": {
37487
- capName: "decoder",
37488
- capScope: "system",
37489
- addonId: null,
37490
- access: "view"
37491
- },
37492
- "decoder.getStats": {
37493
- capName: "decoder",
37494
- capScope: "system",
37495
- addonId: null,
37496
- access: "view"
37497
- },
37498
- "decoder.listActiveSessions": {
37499
- capName: "decoder",
37500
- capScope: "system",
37501
- addonId: null,
37502
- access: "view"
37503
- },
37504
- "decoder.openStream": {
37505
- capName: "decoder",
37506
- capScope: "system",
37507
- addonId: null,
37508
- access: "view"
37509
- },
37510
- "decoder.pullFrames": {
37511
- capName: "decoder",
37512
- capScope: "system",
37513
- addonId: null,
37514
- access: "view"
37515
- },
37516
- "decoder.pullHandles": {
37517
- capName: "decoder",
37518
- capScope: "system",
37519
- addonId: null,
37520
- access: "view"
37521
- },
37522
- "decoder.pushPacket": {
37523
- capName: "decoder",
37524
- capScope: "system",
37525
- addonId: null,
37526
- access: "view"
37527
- },
37528
39692
  "decoder.reprobeHwaccel": {
37529
39693
  capName: "decoder",
37530
39694
  capScope: "system",
37531
39695
  addonId: null,
37532
39696
  access: "create"
37533
39697
  },
37534
- "decoder.supportsCodec": {
37535
- capName: "decoder",
37536
- capScope: "system",
37537
- addonId: null,
37538
- access: "view"
37539
- },
37540
- "decoder.updateConfig": {
37541
- capName: "decoder",
37542
- capScope: "system",
37543
- addonId: null,
37544
- access: "view"
37545
- },
37546
39698
  "detectionPipeline.applyDeviceSettingsPatch": {
37547
39699
  capName: "detection-pipeline",
37548
39700
  capScope: "device",
@@ -38809,6 +40961,90 @@ Object.freeze({
38809
40961
  addonId: null,
38810
40962
  access: "create"
38811
40963
  },
40964
+ "keychain.delete": {
40965
+ capName: "keychain",
40966
+ capScope: "system",
40967
+ addonId: null,
40968
+ access: "delete"
40969
+ },
40970
+ "keychain.getState": {
40971
+ capName: "keychain",
40972
+ capScope: "system",
40973
+ addonId: null,
40974
+ access: "view"
40975
+ },
40976
+ "keychain.listMeta": {
40977
+ capName: "keychain",
40978
+ capScope: "system",
40979
+ addonId: null,
40980
+ access: "view"
40981
+ },
40982
+ "keychain.put": {
40983
+ capName: "keychain",
40984
+ capScope: "system",
40985
+ addonId: null,
40986
+ access: "create"
40987
+ },
40988
+ "keychain.resolve": {
40989
+ capName: "keychain",
40990
+ capScope: "system",
40991
+ addonId: null,
40992
+ access: "view"
40993
+ },
40994
+ "keychainAdmin.deleteOrphans": {
40995
+ capName: "keychain-admin",
40996
+ capScope: "system",
40997
+ addonId: null,
40998
+ access: "delete"
40999
+ },
41000
+ "keychainAdmin.downloadRecoveryKey": {
41001
+ capName: "keychain-admin",
41002
+ capScope: "system",
41003
+ addonId: null,
41004
+ access: "create"
41005
+ },
41006
+ "keychainAdmin.listAudit": {
41007
+ capName: "keychain-admin",
41008
+ capScope: "system",
41009
+ addonId: null,
41010
+ access: "view"
41011
+ },
41012
+ "keychainAdmin.listSecrets": {
41013
+ capName: "keychain-admin",
41014
+ capScope: "system",
41015
+ addonId: null,
41016
+ access: "view"
41017
+ },
41018
+ "keychainAdmin.purgeRetiredKeys": {
41019
+ capName: "keychain-admin",
41020
+ capScope: "system",
41021
+ addonId: null,
41022
+ access: "delete"
41023
+ },
41024
+ "keychainAdmin.resetKeychain": {
41025
+ capName: "keychain-admin",
41026
+ capScope: "system",
41027
+ addonId: null,
41028
+ access: "delete"
41029
+ },
41030
+ "keychainAdmin.reveal": {
41031
+ capName: "keychain-admin",
41032
+ capScope: "system",
41033
+ addonId: null,
41034
+ access: "create"
41035
+ },
41036
+ "keychainAdmin.rotateMasterKey": {
41037
+ capName: "keychain-admin",
41038
+ capScope: "system",
41039
+ addonId: null,
41040
+ access: "create"
41041
+ },
41042
+ "keychainAdmin.status": {
41043
+ capName: "keychain-admin",
41044
+ capScope: "system",
41045
+ addonId: null,
41046
+ access: "view"
41047
+ },
38812
41048
  "lawnMowerControl.dock": {
38813
41049
  capName: "lawn-mower-control",
38814
41050
  capScope: "device",
@@ -39031,12 +41267,24 @@ Object.freeze({
39031
41267
  addonId: null,
39032
41268
  access: "view"
39033
41269
  },
41270
+ "localNetwork.addCustomAddress": {
41271
+ capName: "local-network",
41272
+ capScope: "system",
41273
+ addonId: null,
41274
+ access: "create"
41275
+ },
39034
41276
  "localNetwork.downloadCa": {
39035
41277
  capName: "local-network",
39036
41278
  capScope: "system",
39037
41279
  addonId: null,
39038
41280
  access: "view"
39039
41281
  },
41282
+ "localNetwork.getAddresses": {
41283
+ capName: "local-network",
41284
+ capScope: "system",
41285
+ addonId: null,
41286
+ access: "view"
41287
+ },
39040
41288
  "localNetwork.getAllowedAddresses": {
39041
41289
  capName: "local-network",
39042
41290
  capScope: "system",
@@ -39049,6 +41297,12 @@ Object.freeze({
39049
41297
  addonId: null,
39050
41298
  access: "view"
39051
41299
  },
41300
+ "localNetwork.getHubAddresses": {
41301
+ capName: "local-network",
41302
+ capScope: "system",
41303
+ addonId: null,
41304
+ access: "view"
41305
+ },
39052
41306
  "localNetwork.getNotificationEndpoint": {
39053
41307
  capName: "local-network",
39054
41308
  capScope: "system",
@@ -39085,6 +41339,12 @@ Object.freeze({
39085
41339
  addonId: null,
39086
41340
  access: "create"
39087
41341
  },
41342
+ "localNetwork.removeCustomAddress": {
41343
+ capName: "local-network",
41344
+ capScope: "system",
41345
+ addonId: null,
41346
+ access: "delete"
41347
+ },
39088
41348
  "localNetwork.resetAllowlistToBestMatch": {
39089
41349
  capName: "local-network",
39090
41350
  capScope: "system",
@@ -39097,6 +41357,12 @@ Object.freeze({
39097
41357
  addonId: null,
39098
41358
  access: "create"
39099
41359
  },
41360
+ "localNetwork.setAddressRole": {
41361
+ capName: "local-network",
41362
+ capScope: "system",
41363
+ addonId: null,
41364
+ access: "create"
41365
+ },
39100
41366
  "localNetwork.setAllowedAddresses": {
39101
41367
  capName: "local-network",
39102
41368
  capScope: "system",
@@ -40153,6 +42419,18 @@ Object.freeze({
40153
42419
  addonId: null,
40154
42420
  access: "create"
40155
42421
  },
42422
+ "pipelineAnalytics.addRetrainFrameFromRecording": {
42423
+ capName: "pipeline-analytics",
42424
+ capScope: "device",
42425
+ addonId: null,
42426
+ access: "create"
42427
+ },
42428
+ "pipelineAnalytics.addRetrainFramesToCollection": {
42429
+ capName: "pipeline-analytics",
42430
+ capScope: "device",
42431
+ addonId: null,
42432
+ access: "create"
42433
+ },
40156
42434
  "pipelineAnalytics.applyDeviceSettingsPatch": {
40157
42435
  capName: "pipeline-analytics",
40158
42436
  capScope: "device",
@@ -40201,12 +42479,24 @@ Object.freeze({
40201
42479
  addonId: null,
40202
42480
  access: "view"
40203
42481
  },
42482
+ "pipelineAnalytics.createRetrainCollection": {
42483
+ capName: "pipeline-analytics",
42484
+ capScope: "device",
42485
+ addonId: null,
42486
+ access: "create"
42487
+ },
40204
42488
  "pipelineAnalytics.deleteDeviceEvents": {
40205
42489
  capName: "pipeline-analytics",
40206
42490
  capScope: "device",
40207
42491
  addonId: null,
40208
42492
  access: "delete"
40209
42493
  },
42494
+ "pipelineAnalytics.deleteRetrainCollection": {
42495
+ capName: "pipeline-analytics",
42496
+ capScope: "device",
42497
+ addonId: null,
42498
+ access: "delete"
42499
+ },
40210
42500
  "pipelineAnalytics.deleteTracks": {
40211
42501
  capName: "pipeline-analytics",
40212
42502
  capScope: "device",
@@ -40411,6 +42701,24 @@ Object.freeze({
40411
42701
  addonId: null,
40412
42702
  access: "view"
40413
42703
  },
42704
+ "pipelineAnalytics.listRetrainAssistProfiles": {
42705
+ capName: "pipeline-analytics",
42706
+ capScope: "device",
42707
+ addonId: null,
42708
+ access: "view"
42709
+ },
42710
+ "pipelineAnalytics.listRetrainCollectionFrames": {
42711
+ capName: "pipeline-analytics",
42712
+ capScope: "device",
42713
+ addonId: null,
42714
+ access: "view"
42715
+ },
42716
+ "pipelineAnalytics.listRetrainCollections": {
42717
+ capName: "pipeline-analytics",
42718
+ capScope: "device",
42719
+ addonId: null,
42720
+ access: "view"
42721
+ },
40414
42722
  "pipelineAnalytics.listRetrainFrames": {
40415
42723
  capName: "pipeline-analytics",
40416
42724
  capScope: "device",
@@ -40459,6 +42767,12 @@ Object.freeze({
40459
42767
  addonId: null,
40460
42768
  access: "create"
40461
42769
  },
42770
+ "pipelineAnalytics.proposeRetrainAnnotationsWithLlm": {
42771
+ capName: "pipeline-analytics",
42772
+ capScope: "device",
42773
+ addonId: null,
42774
+ access: "create"
42775
+ },
40462
42776
  "pipelineAnalytics.pruneEvents": {
40463
42777
  capName: "pipeline-analytics",
40464
42778
  capScope: "device",
@@ -40513,6 +42827,18 @@ Object.freeze({
40513
42827
  addonId: null,
40514
42828
  access: "create"
40515
42829
  },
42830
+ "pipelineAnalytics.removeRetrainFrameFromCollection": {
42831
+ capName: "pipeline-analytics",
42832
+ capScope: "device",
42833
+ addonId: null,
42834
+ access: "delete"
42835
+ },
42836
+ "pipelineAnalytics.renameRetrainCollection": {
42837
+ capName: "pipeline-analytics",
42838
+ capScope: "device",
42839
+ addonId: null,
42840
+ access: "create"
42841
+ },
40516
42842
  "pipelineAnalytics.restageRetrainTrack": {
40517
42843
  capName: "pipeline-analytics",
40518
42844
  capScope: "device",
@@ -40543,6 +42869,12 @@ Object.freeze({
40543
42869
  addonId: null,
40544
42870
  access: "create"
40545
42871
  },
42872
+ "pipelineAnalytics.setRetrainFrameComplete": {
42873
+ capName: "pipeline-analytics",
42874
+ capScope: "device",
42875
+ addonId: null,
42876
+ access: "create"
42877
+ },
40546
42878
  "pipelineAnalytics.setTrackFlags": {
40547
42879
  capName: "pipeline-analytics",
40548
42880
  capScope: "device",
@@ -40579,6 +42911,12 @@ Object.freeze({
40579
42911
  addonId: null,
40580
42912
  access: "delete"
40581
42913
  },
42914
+ "pipelineAnalytics.writeRetrainArchive": {
42915
+ capName: "pipeline-analytics",
42916
+ capScope: "device",
42917
+ addonId: null,
42918
+ access: "create"
42919
+ },
40582
42920
  "pipelineExecutor.cacheFrameInPool": {
40583
42921
  capName: "pipeline-executor",
40584
42922
  capScope: "system",
@@ -40591,13 +42929,13 @@ Object.freeze({
40591
42929
  addonId: null,
40592
42930
  access: "delete"
40593
42931
  },
40594
- "pipelineExecutor.deleteModel": {
42932
+ "pipelineExecutor.clearModelBoundDeviceOverrides": {
40595
42933
  capName: "pipeline-executor",
40596
42934
  capScope: "system",
40597
42935
  addonId: null,
40598
42936
  access: "delete"
40599
42937
  },
40600
- "pipelineExecutor.deleteTemplate": {
42938
+ "pipelineExecutor.deleteModel": {
40601
42939
  capName: "pipeline-executor",
40602
42940
  capScope: "system",
40603
42941
  addonId: null,
@@ -40741,12 +43079,6 @@ Object.freeze({
40741
43079
  addonId: null,
40742
43080
  access: "view"
40743
43081
  },
40744
- "pipelineExecutor.listTemplates": {
40745
- capName: "pipeline-executor",
40746
- capScope: "system",
40747
- addonId: null,
40748
- access: "view"
40749
- },
40750
43082
  "pipelineExecutor.rearmInferenceDevice": {
40751
43083
  capName: "pipeline-executor",
40752
43084
  capScope: "system",
@@ -40771,12 +43103,6 @@ Object.freeze({
40771
43103
  addonId: null,
40772
43104
  access: "create"
40773
43105
  },
40774
- "pipelineExecutor.saveTemplate": {
40775
- capName: "pipeline-executor",
40776
- capScope: "system",
40777
- addonId: null,
40778
- access: "create"
40779
- },
40780
43106
  "pipelineExecutor.setVideoPipelineSteps": {
40781
43107
  capName: "pipeline-executor",
40782
43108
  capScope: "system",
@@ -40795,17 +43121,23 @@ Object.freeze({
40795
43121
  addonId: null,
40796
43122
  access: "create"
40797
43123
  },
40798
- "pipelineExecutor.updateTemplate": {
43124
+ "pipelineExecutor.validatePipeline": {
40799
43125
  capName: "pipeline-executor",
40800
43126
  capScope: "system",
40801
43127
  addonId: null,
43128
+ access: "view"
43129
+ },
43130
+ "pipelineOrchestrator.abortNodeBenchmark": {
43131
+ capName: "pipeline-orchestrator",
43132
+ capScope: "system",
43133
+ addonId: null,
40802
43134
  access: "create"
40803
43135
  },
40804
- "pipelineExecutor.validatePipeline": {
40805
- capName: "pipeline-executor",
43136
+ "pipelineOrchestrator.applyAutoTune": {
43137
+ capName: "pipeline-orchestrator",
40806
43138
  capScope: "system",
40807
43139
  addonId: null,
40808
- access: "view"
43140
+ access: "create"
40809
43141
  },
40810
43142
  "pipelineOrchestrator.applyDeviceSettingsPatch": {
40811
43143
  capName: "pipeline-orchestrator",
@@ -40825,7 +43157,7 @@ Object.freeze({
40825
43157
  addonId: null,
40826
43158
  access: "create"
40827
43159
  },
40828
- "pipelineOrchestrator.deleteTemplate": {
43160
+ "pipelineOrchestrator.deleteNodeBenchmarkResult": {
40829
43161
  capName: "pipeline-orchestrator",
40830
43162
  capScope: "system",
40831
43163
  addonId: null,
@@ -40921,6 +43253,12 @@ Object.freeze({
40921
43253
  addonId: null,
40922
43254
  access: "view"
40923
43255
  },
43256
+ "pipelineOrchestrator.getEffectiveShares": {
43257
+ capName: "pipeline-orchestrator",
43258
+ capScope: "system",
43259
+ addonId: null,
43260
+ access: "view"
43261
+ },
40924
43262
  "pipelineOrchestrator.getGlobalMetrics": {
40925
43263
  capName: "pipeline-orchestrator",
40926
43264
  capScope: "system",
@@ -40933,6 +43271,24 @@ Object.freeze({
40933
43271
  addonId: null,
40934
43272
  access: "view"
40935
43273
  },
43274
+ "pipelineOrchestrator.getNodeBenchmarkCandidates": {
43275
+ capName: "pipeline-orchestrator",
43276
+ capScope: "system",
43277
+ addonId: null,
43278
+ access: "view"
43279
+ },
43280
+ "pipelineOrchestrator.getNodeBenchmarkPreflight": {
43281
+ capName: "pipeline-orchestrator",
43282
+ capScope: "system",
43283
+ addonId: null,
43284
+ access: "view"
43285
+ },
43286
+ "pipelineOrchestrator.getNodeBenchmarkStatus": {
43287
+ capName: "pipeline-orchestrator",
43288
+ capScope: "system",
43289
+ addonId: null,
43290
+ access: "view"
43291
+ },
40936
43292
  "pipelineOrchestrator.getNodeInferenceDevices": {
40937
43293
  capName: "pipeline-orchestrator",
40938
43294
  capScope: "system",
@@ -40957,6 +43313,12 @@ Object.freeze({
40957
43313
  addonId: null,
40958
43314
  access: "view"
40959
43315
  },
43316
+ "pipelineOrchestrator.getPlacementStats": {
43317
+ capName: "pipeline-orchestrator",
43318
+ capScope: "system",
43319
+ addonId: null,
43320
+ access: "view"
43321
+ },
40960
43322
  "pipelineOrchestrator.getReconcileFromDiskStatus": {
40961
43323
  capName: "pipeline-orchestrator",
40962
43324
  capScope: "system",
@@ -40969,7 +43331,7 @@ Object.freeze({
40969
43331
  addonId: null,
40970
43332
  access: "view"
40971
43333
  },
40972
- "pipelineOrchestrator.listTemplates": {
43334
+ "pipelineOrchestrator.listNodeBenchmarkResults": {
40973
43335
  capName: "pipeline-orchestrator",
40974
43336
  capScope: "system",
40975
43337
  addonId: null,
@@ -40981,6 +43343,12 @@ Object.freeze({
40981
43343
  addonId: null,
40982
43344
  access: "create"
40983
43345
  },
43346
+ "pipelineOrchestrator.planAutoTune": {
43347
+ capName: "pipeline-orchestrator",
43348
+ capScope: "system",
43349
+ addonId: null,
43350
+ access: "view"
43351
+ },
40984
43352
  "pipelineOrchestrator.rebalance": {
40985
43353
  capName: "pipeline-orchestrator",
40986
43354
  capScope: "system",
@@ -41023,12 +43391,6 @@ Object.freeze({
41023
43391
  addonId: null,
41024
43392
  access: "create"
41025
43393
  },
41026
- "pipelineOrchestrator.saveTemplate": {
41027
- capName: "pipeline-orchestrator",
41028
- capScope: "system",
41029
- addonId: null,
41030
- access: "create"
41031
- },
41032
43394
  "pipelineOrchestrator.setAgentCapabilities": {
41033
43395
  capName: "pipeline-orchestrator",
41034
43396
  capScope: "system",
@@ -41041,12 +43403,6 @@ Object.freeze({
41041
43403
  addonId: null,
41042
43404
  access: "create"
41043
43405
  },
41044
- "pipelineOrchestrator.setAgentDetectWeight": {
41045
- capName: "pipeline-orchestrator",
41046
- capScope: "system",
41047
- addonId: null,
41048
- access: "create"
41049
- },
41050
43406
  "pipelineOrchestrator.setAgentInferenceDevices": {
41051
43407
  capName: "pipeline-orchestrator",
41052
43408
  capScope: "system",
@@ -41083,6 +43439,12 @@ Object.freeze({
41083
43439
  addonId: null,
41084
43440
  access: "create"
41085
43441
  },
43442
+ "pipelineOrchestrator.setCameraStepSettings": {
43443
+ capName: "pipeline-orchestrator",
43444
+ capScope: "system",
43445
+ addonId: null,
43446
+ access: "create"
43447
+ },
41086
43448
  "pipelineOrchestrator.setCameraStepToggle": {
41087
43449
  capName: "pipeline-orchestrator",
41088
43450
  capScope: "system",
@@ -41101,12 +43463,36 @@ Object.freeze({
41101
43463
  addonId: null,
41102
43464
  access: "create"
41103
43465
  },
43466
+ "pipelineOrchestrator.setLoadBalancingShares": {
43467
+ capName: "pipeline-orchestrator",
43468
+ capScope: "system",
43469
+ addonId: null,
43470
+ access: "create"
43471
+ },
41104
43472
  "pipelineOrchestrator.setPipelineDevicePin": {
41105
43473
  capName: "pipeline-orchestrator",
41106
43474
  capScope: "system",
41107
43475
  addonId: null,
41108
43476
  access: "create"
41109
43477
  },
43478
+ "pipelineOrchestrator.setShareSource": {
43479
+ capName: "pipeline-orchestrator",
43480
+ capScope: "system",
43481
+ addonId: null,
43482
+ access: "create"
43483
+ },
43484
+ "pipelineOrchestrator.startNodeBenchmark": {
43485
+ capName: "pipeline-orchestrator",
43486
+ capScope: "system",
43487
+ addonId: null,
43488
+ access: "create"
43489
+ },
43490
+ "pipelineOrchestrator.suggestShares": {
43491
+ capName: "pipeline-orchestrator",
43492
+ capScope: "system",
43493
+ addonId: null,
43494
+ access: "view"
43495
+ },
41110
43496
  "pipelineOrchestrator.unassignAudio": {
41111
43497
  capName: "pipeline-orchestrator",
41112
43498
  capScope: "system",
@@ -41119,8 +43505,8 @@ Object.freeze({
41119
43505
  addonId: null,
41120
43506
  access: "create"
41121
43507
  },
41122
- "pipelineOrchestrator.updateTemplate": {
41123
- capName: "pipeline-orchestrator",
43508
+ "pipelineRunner.abortNodeBench": {
43509
+ capName: "pipeline-runner",
41124
43510
  capScope: "system",
41125
43511
  addonId: null,
41126
43512
  access: "create"
@@ -41173,6 +43559,12 @@ Object.freeze({
41173
43559
  addonId: null,
41174
43560
  access: "view"
41175
43561
  },
43562
+ "pipelineRunner.getNodeBenchStatus": {
43563
+ capName: "pipeline-runner",
43564
+ capScope: "system",
43565
+ addonId: null,
43566
+ access: "view"
43567
+ },
41176
43568
  "pipelineRunner.getParkedTrackFrame": {
41177
43569
  capName: "pipeline-runner",
41178
43570
  capScope: "system",
@@ -41215,6 +43607,12 @@ Object.freeze({
41215
43607
  addonId: null,
41216
43608
  access: "create"
41217
43609
  },
43610
+ "pipelineRunner.startNodeBench": {
43611
+ capName: "pipeline-runner",
43612
+ capScope: "system",
43613
+ addonId: null,
43614
+ access: "create"
43615
+ },
41218
43616
  "plateGallery.assignPlate": {
41219
43617
  capName: "plate-gallery",
41220
43618
  capScope: "system",
@@ -42559,12 +44957,6 @@ Object.freeze({
42559
44957
  addonId: null,
42560
44958
  access: "view"
42561
44959
  },
42562
- "streamBroker.pullFrameHandles": {
42563
- capName: "stream-broker",
42564
- capScope: "system",
42565
- addonId: null,
42566
- access: "view"
42567
- },
42568
44960
  "streamBroker.regenerateRtspToken": {
42569
44961
  capName: "stream-broker",
42570
44962
  capScope: "system",
@@ -42631,12 +45023,6 @@ Object.freeze({
42631
45023
  addonId: null,
42632
45024
  access: "create"
42633
45025
  },
42634
- "streamBroker.subscribeFrames": {
42635
- capName: "stream-broker",
42636
- capScope: "system",
42637
- addonId: null,
42638
- access: "create"
42639
- },
42640
45026
  "streamBroker.unassignProfile": {
42641
45027
  capName: "stream-broker",
42642
45028
  capScope: "system",
@@ -42649,12 +45035,6 @@ Object.freeze({
42649
45035
  addonId: null,
42650
45036
  access: "create"
42651
45037
  },
42652
- "streamBroker.unsubscribeFrames": {
42653
- capName: "stream-broker",
42654
- capScope: "system",
42655
- addonId: null,
42656
- access: "create"
42657
- },
42658
45038
  "streamCatalog.getCatalog": {
42659
45039
  capName: "stream-catalog",
42660
45040
  capScope: "device",
@@ -42949,18 +45329,36 @@ Object.freeze({
42949
45329
  addonId: null,
42950
45330
  access: "delete"
42951
45331
  },
45332
+ "userManagement.findUserByExternalIdentity": {
45333
+ capName: "user-management",
45334
+ capScope: "system",
45335
+ addonId: null,
45336
+ access: "view"
45337
+ },
42952
45338
  "userManagement.getTotpStatus": {
42953
45339
  capName: "user-management",
42954
45340
  capScope: "system",
42955
45341
  addonId: null,
42956
45342
  access: "view"
42957
45343
  },
45344
+ "userManagement.linkExternalIdentity": {
45345
+ capName: "user-management",
45346
+ capScope: "system",
45347
+ addonId: null,
45348
+ access: "create"
45349
+ },
42958
45350
  "userManagement.listApiKeys": {
42959
45351
  capName: "user-management",
42960
45352
  capScope: "system",
42961
45353
  addonId: null,
42962
45354
  access: "view"
42963
45355
  },
45356
+ "userManagement.listExternalIdentities": {
45357
+ capName: "user-management",
45358
+ capScope: "system",
45359
+ addonId: null,
45360
+ access: "view"
45361
+ },
42964
45362
  "userManagement.listOauthSessions": {
42965
45363
  capName: "user-management",
42966
45364
  capScope: "system",
@@ -43039,6 +45437,12 @@ Object.freeze({
43039
45437
  addonId: null,
43040
45438
  access: "create"
43041
45439
  },
45440
+ "userManagement.unlinkExternalIdentity": {
45441
+ capName: "user-management",
45442
+ capScope: "system",
45443
+ addonId: null,
45444
+ access: "delete"
45445
+ },
43042
45446
  "userManagement.updateUser": {
43043
45447
  capName: "user-management",
43044
45448
  capScope: "system",
@@ -43351,6 +45755,12 @@ Object.freeze({
43351
45755
  addonId: null,
43352
45756
  access: "create"
43353
45757
  },
45758
+ "webrtcSession.applyDownlinkProbe": {
45759
+ capName: "webrtc-session",
45760
+ capScope: "device",
45761
+ addonId: null,
45762
+ access: "create"
45763
+ },
43354
45764
  "webrtcSession.closeSession": {
43355
45765
  capName: "webrtc-session",
43356
45766
  capScope: "device",
@@ -45162,11 +47572,6 @@ Object.freeze({
45162
47572
  form: "single",
45163
47573
  optional: false
45164
47574
  }],
45165
- "decoder.createSession": [{
45166
- name: "deviceId",
45167
- form: "single",
45168
- optional: true
45169
- }],
45170
47575
  "detectionPipeline.applyDeviceSettingsPatch": [{
45171
47576
  name: "deviceId",
45172
47577
  form: "single",
@@ -46137,6 +48542,11 @@ Object.freeze({
46137
48542
  form: "single",
46138
48543
  optional: false
46139
48544
  }],
48545
+ "pipelineAnalytics.addRetrainFrameFromRecording": [{
48546
+ name: "deviceId",
48547
+ form: "single",
48548
+ optional: false
48549
+ }],
46140
48550
  "pipelineAnalytics.applyDeviceSettingsPatch": [{
46141
48551
  name: "deviceId",
46142
48552
  form: "single",
@@ -46327,6 +48737,11 @@ Object.freeze({
46327
48737
  form: "single",
46328
48738
  optional: false
46329
48739
  }],
48740
+ "pipelineAnalytics.proposeRetrainAnnotationsWithLlm": [{
48741
+ name: "deviceId",
48742
+ form: "single",
48743
+ optional: false
48744
+ }],
46330
48745
  "pipelineAnalytics.pruneEventsBefore": [{
46331
48746
  name: "deviceId",
46332
48747
  form: "single",
@@ -46377,6 +48792,11 @@ Object.freeze({
46377
48792
  form: "single",
46378
48793
  optional: false
46379
48794
  }],
48795
+ "pipelineAnalytics.setRetrainFrameComplete": [{
48796
+ name: "deviceId",
48797
+ form: "single",
48798
+ optional: false
48799
+ }],
46380
48800
  "pipelineAnalytics.setTrackFlags": [{
46381
48801
  name: "deviceId",
46382
48802
  form: "single",
@@ -46397,6 +48817,11 @@ Object.freeze({
46397
48817
  form: "single",
46398
48818
  optional: false
46399
48819
  }],
48820
+ "pipelineExecutor.clearModelBoundDeviceOverrides": [{
48821
+ name: "deviceIds",
48822
+ form: "array",
48823
+ optional: true
48824
+ }],
46400
48825
  "pipelineExecutor.runPipeline": [{
46401
48826
  name: "deviceId",
46402
48827
  form: "single",
@@ -46502,6 +48927,11 @@ Object.freeze({
46502
48927
  form: "single",
46503
48928
  optional: false
46504
48929
  }],
48930
+ "pipelineOrchestrator.setCameraStepSettings": [{
48931
+ name: "deviceId",
48932
+ form: "single",
48933
+ optional: false
48934
+ }],
46505
48935
  "pipelineOrchestrator.setCameraStepToggle": [{
46506
48936
  name: "deviceId",
46507
48937
  form: "single",
@@ -47273,6 +49703,11 @@ Object.freeze({
47273
49703
  form: "single",
47274
49704
  optional: false
47275
49705
  }],
49706
+ "webrtcSession.applyDownlinkProbe": [{
49707
+ name: "deviceId",
49708
+ form: "single",
49709
+ optional: false
49710
+ }],
47276
49711
  "webrtcSession.closeSession": [{
47277
49712
  name: "deviceId",
47278
49713
  form: "single",
@@ -47502,6 +49937,8 @@ new Map(Object.entries({
47502
49937
  "detection-blind": "device-events",
47503
49938
  "node-online": "system",
47504
49939
  "node-offline": "system",
49940
+ "node-restarting": "system",
49941
+ "node-updating": "system",
47505
49942
  "node-inference-unavailable": "system",
47506
49943
  "addon-crash-loop": "system",
47507
49944
  "addon-update-available": "system",
@@ -47579,18 +50016,21 @@ var NC_SYSTEM_EVENT_KIND_GROUP_SPECS = [
47579
50016
  kinds: [
47580
50017
  "node-offline",
47581
50018
  "node-online",
50019
+ "node-restarting",
47582
50020
  "node-inference-unavailable"
47583
50021
  ]
47584
50022
  },
47585
50023
  {
47586
50024
  id: "addons",
47587
50025
  family: "system",
47588
- label: "Addons",
47589
- kinds: [
47590
- "addon-crash-loop",
47591
- "addon-update-available",
47592
- "addon-updated"
47593
- ]
50026
+ label: "Addons stopped",
50027
+ kinds: ["addon-crash-loop"]
50028
+ },
50029
+ {
50030
+ id: "addon-updates",
50031
+ family: "system",
50032
+ label: "Addon updates",
50033
+ kinds: ["addon-update-available", "addon-updated"]
47594
50034
  },
47595
50035
  {
47596
50036
  id: "updates",
@@ -47598,6 +50038,7 @@ var NC_SYSTEM_EVENT_KIND_GROUP_SPECS = [
47598
50038
  label: "Server & container updates",
47599
50039
  kinds: [
47600
50040
  "server-update-available",
50041
+ "node-updating",
47601
50042
  "server-updated",
47602
50043
  "wrapper-update-available"
47603
50044
  ]
@@ -47745,18 +50186,21 @@ var STATE_SUMMARY_SECTION_VARS = [
47745
50186
  kinds: [
47746
50187
  "node-offline",
47747
50188
  "node-online",
50189
+ "node-restarting",
47748
50190
  "node-inference-unavailable"
47749
50191
  ]
47750
50192
  },
47751
50193
  {
47752
50194
  name: "summaryAddons",
47753
- label: "Summary: addons",
47754
- example: "@camstack/addon-recorder 1.2.3 → 1.2.4",
47755
- kinds: [
47756
- "addon-crash-loop",
47757
- "addon-update-available",
47758
- "addon-updated"
47759
- ]
50195
+ label: "Summary: addons stopped",
50196
+ example: "hub — recorder stopped after repeated crashes",
50197
+ kinds: ["addon-crash-loop"]
50198
+ },
50199
+ {
50200
+ name: "summaryAddonUpdates",
50201
+ label: "Summary: addon updates",
50202
+ example: "hub:\n• @camstack/addon-recorder 1.2.3 → 1.2.4",
50203
+ kinds: ["addon-update-available", "addon-updated"]
47760
50204
  },
47761
50205
  {
47762
50206
  name: "summaryUpdates",
@@ -47764,6 +50208,7 @@ var STATE_SUMMARY_SECTION_VARS = [
47764
50208
  example: "server 1.2.377 → 1.2.378",
47765
50209
  kinds: [
47766
50210
  "server-update-available",
50211
+ "node-updating",
47767
50212
  "server-updated",
47768
50213
  "wrapper-update-available"
47769
50214
  ]
@@ -47796,7 +50241,7 @@ var STATE_SUMMARY_VARS = [
47796
50241
  {
47797
50242
  name: "summarySection",
47798
50243
  label: "Summary: this section",
47799
- description: "The section a per-section summary row is about (D698); on a summary sent as one message, every section it reports, comma-separated.",
50244
+ description: "The section a per-section summary row is about; on a summary sent as one message, every section it reports, comma-separated.",
47800
50245
  example: "Batterie scariche",
47801
50246
  group: "system",
47802
50247
  families: ["rule"],
@@ -47840,6 +50285,7 @@ var STATE_SUMMARY_VARS = [
47840
50285
  [...RULE_BODY_ONLY],
47841
50286
  [...RULE_TEXT],
47842
50287
  ([...RULE_TEXT], [...DEVICE_EVENTS]),
50288
+ ([...RULE_TEXT], [...COMBINED_ALARM]),
47843
50289
  ([...RULE_TEXT], [...DEVICE_EVENTS]),
47844
50290
  ([...RULE_TEXT], [...BATTERY, ...CONSUMABLE]),
47845
50291
  ([...RULE_TEXT], [...CONSUMABLE]),
@@ -47880,6 +50326,8 @@ var STATE_SUMMARY_VARS = [
47880
50326
  [...RULE_TEXT],
47881
50327
  [...RULE_TEXT],
47882
50328
  [...RULE_TEXT],
50329
+ [...RULE_TEXT],
50330
+ [...RULE_TEXT],
47883
50331
  ...STATE_SUMMARY_VARS
47884
50332
  ];
47885
50333
  new Set([
@@ -59424,7 +61872,7 @@ var DEFAULT_CONFIG = object({
59424
61872
  * may still STARTTLS — nodemailer auto-detects. */
59425
61873
  secure: boolean().default(false),
59426
61874
  username: string().default(""),
59427
- password: string().default(""),
61875
+ password: string().default("").meta({ secret: true }),
59428
61876
  /** Default `From` address — used when the caller omits `from`. */
59429
61877
  fromAddress: string().default(""),
59430
61878
  /** Optional display name prefixing the `From` address. */