@camstack/addon-auth 1.2.130 → 1.2.132

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,4 +1,4 @@
1
- //#region ../types/dist/event-category-BGmz_oxW.mjs
1
+ //#region ../types/dist/event-category-DaIZi00R.mjs
2
2
  var EventCategory = /* @__PURE__ */ function(EventCategory) {
3
3
  EventCategory["SystemBoot"] = "system.boot";
4
4
  EventCategory["SystemAddonsReady"] = "system.addons-ready";
@@ -77,6 +77,13 @@ var EventCategory = /* @__PURE__ */ function(EventCategory) {
77
77
  */
78
78
  EventCategory["AddonLoadFailed"] = "addon.load-failed";
79
79
  /**
80
+ * A keychain value was stored or removed (D787). Carries the ref, its
81
+ * owner and the new version — NEVER the value. A process holding the ref
82
+ * drops its cached copy and the owning `BaseAddon` re-resolves its config.
83
+ * Telemetry (D8): a process that misses it still revalidates by version.
84
+ */
85
+ EventCategory["KeychainChanged"] = "keychain.changed";
86
+ /**
80
87
  * Addon recovered from a previous failure. Emitted when an addon
81
88
  * transitions from `failed` back to `healthy` (typically via the
82
89
  * monitor's auto-retry loop, or after manual `addons.retryLoad`).
@@ -499,15 +506,6 @@ var EventCategory = /* @__PURE__ */ function(EventCategory) {
499
506
  EventCategory["AgentWsDisconnected"] = "agent.ws.disconnected";
500
507
  EventCategory["AgentBackupActivated"] = "agent.backup.activated";
501
508
  EventCategory["OrchestrationSettingsUpdated"] = "orchestration.settings-updated";
502
- /**
503
- * Per-agent hwaccel preference changed (user override set, cleared, or
504
- * re-probed). Observability event — decoders pull the current pref at
505
- * `createSession`, so running sessions keep their current backend until
506
- * they rotate naturally (camera add/remove, stream restart). Future
507
- * work can wire a listener in stream-broker that force-rotates live
508
- * sessions; for now this event powers logs + admin-UI toast feedback.
509
- */
510
- EventCategory["PipelineAgentHwaccelChanged"] = "pipeline.agent-hwaccel-changed";
511
509
  EventCategory["MotionAnalysis"] = "detection.motion-analysis";
512
510
  /** All raw motion zones from CCL before minArea filter — for UI debug overlay. */
513
511
  EventCategory["MotionZonesRaw"] = "detection.motion-zones-raw";
@@ -5378,7 +5376,7 @@ var ZodIssueCode = {
5378
5376
  var ZodFirstPartyTypeKind;
5379
5377
  ZodFirstPartyTypeKind || (ZodFirstPartyTypeKind = {});
5380
5378
  //#endregion
5381
- //#region ../types/dist/sleep-C16NCZR2.mjs
5379
+ //#region ../types/dist/sleep-Cr5YOk3m.mjs
5382
5380
  /**
5383
5381
  * The audio chunk plane's byte format, and the ONE expansion from a coded
5384
5382
  * window to float samples (D455).
@@ -5457,6 +5455,97 @@ function buildAlawTable() {
5457
5455
  }
5458
5456
  buildUlawTable();
5459
5457
  buildAlawTable();
5458
+ /** Is this field's stored value a credential? */
5459
+ function isSecretConfigField(field) {
5460
+ if (field.type === "password") return true;
5461
+ return "secret" in field && field.secret === true;
5462
+ }
5463
+ /**
5464
+ * Is this field's value stored in the KEYCHAIN (D787)? Every secret field is,
5465
+ * by its TYPE, unless it opts out with `storage: 'inline'` — never by its name.
5466
+ */
5467
+ function isKeychainStoredField(field) {
5468
+ if (!isSecretConfigField(field)) return false;
5469
+ if (field.type === "textarea" && field.isJson === true) return false;
5470
+ return !("storage" in field && field.storage === "inline");
5471
+ }
5472
+ /**
5473
+ * What a settings blob holds where a secret used to be.
5474
+ *
5475
+ * A keychain-stored field never holds its value. It holds a self-describing
5476
+ * MARKER, `{"$secret":"secret://…","v":1}` — an object, never a string, so no
5477
+ * code can mistake it for a credential and no form can send it to a camera as
5478
+ * a password. The empty state is `null` / absent, never `''`.
5479
+ *
5480
+ * The same shapes travel to and from the admin UI:
5481
+ *
5482
+ * - read: `hydrateSchema` hands a secret field a {@link SecretFieldView}
5483
+ * (`{ $secret, v, set: true }`) or `null` — the browser learns whether a
5484
+ * value is set, never the value.
5485
+ * - write: an untouched field submits the view back unchanged (KEEP); a typed
5486
+ * value is a plain non-empty string (CHANGE); the Clear button submits
5487
+ * {@link SECRET_CLEAR} (CLEAR). `''`, `null` and the legacy redaction tokens
5488
+ * are KEEP — an empty string is what a defaults-fallback pushes back, and
5489
+ * treating it as "clear" is how a save destroyed a stored credential before.
5490
+ *
5491
+ * Pure and browser-safe.
5492
+ */
5493
+ var SECRET_CLEAR = { $secretClear: true };
5494
+ /** The `'***'` token D634 redaction writes for non-admins. */
5495
+ var LEGACY_DEVICE_REDACTION = "***";
5496
+ function isRecord$1(value) {
5497
+ return typeof value === "object" && value !== null && !Array.isArray(value);
5498
+ }
5499
+ function makeSecretMarker(ref) {
5500
+ return {
5501
+ $secret: ref,
5502
+ v: 1
5503
+ };
5504
+ }
5505
+ /** A stored marker: an object whose `$secret` is a non-empty string. */
5506
+ function isSecretMarker(value) {
5507
+ if (!isRecord$1(value)) return false;
5508
+ const ref = value["$secret"];
5509
+ return typeof ref === "string" && ref.length > 0;
5510
+ }
5511
+ function isSecretClear(value) {
5512
+ return isRecord$1(value) && value["$secretClear"] === true;
5513
+ }
5514
+ /**
5515
+ * The UI view of a stored secret field value: a marker becomes "set", inline
5516
+ * plaintext becomes "set (inline)", nothing becomes `null`. A value never
5517
+ * survives this function.
5518
+ */
5519
+ function toSecretFieldView(stored) {
5520
+ if (isSecretMarker(stored)) return {
5521
+ $secret: stored.$secret,
5522
+ v: 1,
5523
+ set: true
5524
+ };
5525
+ if (typeof stored === "string" && stored.length > 0) return {
5526
+ $secret: null,
5527
+ v: 1,
5528
+ set: true,
5529
+ inline: true
5530
+ };
5531
+ return null;
5532
+ }
5533
+ /**
5534
+ * Classify an incoming value for a secret path. Only a non-empty string that is
5535
+ * not a redaction token sets a value; only {@link SECRET_CLEAR} clears.
5536
+ * Everything else — a marker (ours or anyone's), a UI view, `''`, `null`,
5537
+ * `undefined`, a redaction token, a non-string — keeps what is stored.
5538
+ */
5539
+ function classifySecretWrite(incoming) {
5540
+ if (isSecretClear(incoming)) return { kind: "clear" };
5541
+ if (typeof incoming !== "string") return { kind: "keep" };
5542
+ if (incoming.length === 0) return { kind: "keep" };
5543
+ if (incoming === "__camstack_redacted__" || incoming === LEGACY_DEVICE_REDACTION) return { kind: "keep" };
5544
+ return {
5545
+ kind: "set",
5546
+ value: incoming
5547
+ };
5548
+ }
5460
5549
  Object.fromEntries([
5461
5550
  {
5462
5551
  id: "overview",
@@ -5628,33 +5717,19 @@ Object.fromEntries([
5628
5717
  function isValuelessField(field) {
5629
5718
  return field.type === "separator" || field.type === "info" || field.type === "qr-code" || field.type === "button" || field.type === "object-array" || field.type === "widget" || field.type === "addon-action-button" || field.type === "device-action-button";
5630
5719
  }
5631
- /**
5632
- * Merge a `ConfigUISchema` with a raw `values` record into a
5633
- * `ConfigUISchemaWithValues`. Used by every `get*Settings` backend endpoint
5634
- * before returning to the admin UI. Groups are walked recursively.
5635
- *
5636
- * For each leaf field:
5637
- * - structural fields (`separator`, `info`, `button`) pass through unchanged
5638
- * - other fields get `value = values[key] ?? field.default ?? null`
5639
- *
5640
- * Unknown keys in `values` (keys not declared in the schema) are silently
5641
- * ignored — they don't contribute to the output. Missing keys fall back to
5642
- * the schema default or `null`. This mirrors the old backend behaviour where
5643
- * `FormBuilder` rendered `values[key] ?? field.default`.
5644
- */
5645
- function hydrateSchema(schema, values) {
5720
+ function hydrateSchema(schema, values, options = {}) {
5646
5721
  return {
5647
5722
  ...schema.tabs ? { tabs: [...schema.tabs] } : {},
5648
5723
  sections: schema.sections.map((section) => ({
5649
5724
  ...section,
5650
- fields: section.fields.map((field) => hydrateField(field, values))
5725
+ fields: section.fields.map((field) => hydrateField(field, values, options))
5651
5726
  }))
5652
5727
  };
5653
5728
  }
5654
- function hydrateField(field, values) {
5729
+ function hydrateField(field, values, options) {
5655
5730
  if (isValuelessField(field)) return field;
5656
5731
  if (field.type === "group") {
5657
- const hydratedChildren = field.fields.map((child) => hydrateField(child, values));
5732
+ const hydratedChildren = field.fields.map((child) => hydrateField(child, values, options));
5658
5733
  return {
5659
5734
  ...field,
5660
5735
  fields: hydratedChildren
@@ -5663,7 +5738,7 @@ function hydrateField(field, values) {
5663
5738
  if (field.type === "sub-tabs") {
5664
5739
  const hydratedTabs = field.tabs.map((tab) => ({
5665
5740
  ...tab,
5666
- fields: tab.fields.map((child) => hydrateField(child, values))
5741
+ fields: tab.fields.map((child) => hydrateField(child, values, options))
5667
5742
  }));
5668
5743
  return {
5669
5744
  ...field,
@@ -5673,6 +5748,33 @@ function hydrateField(field, values) {
5673
5748
  const key = field.key;
5674
5749
  const storedValue = Object.prototype.hasOwnProperty.call(values, key) ? values[key] : void 0;
5675
5750
  const defaultValue = field.default;
5751
+ const asView = (v) => isSecretMarker(v) || options.inlineSecretsAsViews === true && v !== void 0;
5752
+ if (isKeychainStoredField(field) && asView(storedValue)) return {
5753
+ ...field,
5754
+ value: toSecretFieldView(storedValue)
5755
+ };
5756
+ if (isKeychainStoredField(field) && options.inlineSecretsAsViews === true) return {
5757
+ ...field,
5758
+ value: null
5759
+ };
5760
+ if (field.type === "editable-array" && Array.isArray(storedValue)) {
5761
+ const secretItemKeys = field.itemFields.filter((item) => "key" in item && isKeychainStoredField(item)).map((item) => "key" in item ? item.key : "");
5762
+ if (secretItemKeys.length > 0) {
5763
+ const rows = storedValue.map((row) => {
5764
+ if (row === null || typeof row !== "object" || Array.isArray(row)) return row;
5765
+ const out = { ...row };
5766
+ for (const k of secretItemKeys) {
5767
+ const v = Reflect.get(row, k);
5768
+ if (asView(v)) out[k] = toSecretFieldView(v);
5769
+ }
5770
+ return out;
5771
+ });
5772
+ return {
5773
+ ...field,
5774
+ value: rows
5775
+ };
5776
+ }
5777
+ }
5676
5778
  if (field.multiple) {
5677
5779
  const stored = Array.isArray(storedValue) ? storedValue : storedValue !== void 0 && storedValue !== null ? [storedValue] : [];
5678
5780
  const itemFallback = field.multiple.itemDefault !== void 0 ? field.multiple.itemDefault : defaultValue !== void 0 ? defaultValue : typeOf(field) === "string" ? "" : null;
@@ -5915,6 +6017,431 @@ function projectStore(store, perNodeKeys, nodeId) {
5915
6017
  }
5916
6018
  return out;
5917
6019
  }
6020
+ var GLOBAL_SCOPE = { kind: "global" };
6021
+ /** The scope every addon-wide (not per-node, not per-device) setting lives in. */
6022
+ function globalSecretScope() {
6023
+ return GLOBAL_SCOPE;
6024
+ }
6025
+ function encodeSegment(value) {
6026
+ return encodeURIComponent(value);
6027
+ }
6028
+ /**
6029
+ * The field path of a value inside an array item, addressed by the item's id:
6030
+ * `arrayItemFieldPath('providers', 'authentik', 'clientSecret')` →
6031
+ * `providers[authentik].clientSecret`.
6032
+ */
6033
+ function arrayItemFieldPath(arrayKey, itemId, fieldKey) {
6034
+ return `${arrayKey}[${encodeSegment(itemId)}].${fieldKey}`;
6035
+ }
6036
+ /** A write to a secret path could not be stored in the keychain, so it was refused. */
6037
+ var KeychainWriteRefusedError = class extends Error {
6038
+ fieldPath;
6039
+ constructor(fieldPath, cause) {
6040
+ super(`secret "${fieldPath}" was not saved: the keychain could not store it (${cause instanceof Error ? cause.message : String(cause)}). Nothing was written.`);
6041
+ this.fieldPath = fieldPath;
6042
+ this.name = "KeychainWriteRefusedError";
6043
+ }
6044
+ };
6045
+ var KEEP = { kind: "keep" };
6046
+ function isRecord(value) {
6047
+ return typeof value === "object" && value !== null && !Array.isArray(value);
6048
+ }
6049
+ function defaultMintId() {
6050
+ return globalThis.crypto.randomUUID();
6051
+ }
6052
+ /** Every marker ref anywhere under `value`. */
6053
+ function collectSecretMarkerRefs(value, out = []) {
6054
+ if (isSecretMarker(value)) {
6055
+ out.push(value.$secret);
6056
+ return out;
6057
+ }
6058
+ if (Array.isArray(value)) for (const item of value) collectSecretMarkerRefs(item, out);
6059
+ else if (isRecord(value)) for (const child of Object.values(value)) collectSecretMarkerRefs(child, out);
6060
+ return out;
6061
+ }
6062
+ async function storedValueEquals(secrets, marker, candidate) {
6063
+ const resolved = (await secrets.resolve([marker.$secret]))[marker.$secret];
6064
+ return resolved?.kind === "value" && resolved.value === candidate;
6065
+ }
6066
+ async function writeLeaf(ctx, incoming, stored, fieldPath) {
6067
+ const intent = classifySecretWrite(incoming);
6068
+ const ref = ctx.secrets.ref(ctx.scope, fieldPath);
6069
+ const storedIsOurs = isSecretMarker(stored) && stored.$secret === ref;
6070
+ if (intent.kind === "keep") return KEEP;
6071
+ if (intent.kind === "set" && !ctx.operatorWrite && typeof stored === "string" && stored === intent.value) return KEEP;
6072
+ if (intent.kind === "clear") {
6073
+ if (storedIsOurs) ctx.deletes.push(ref);
6074
+ return {
6075
+ kind: "value",
6076
+ value: null
6077
+ };
6078
+ }
6079
+ if (storedIsOurs && await storedValueEquals(ctx.secrets, stored, intent.value)) return {
6080
+ kind: "value",
6081
+ value: stored
6082
+ };
6083
+ try {
6084
+ await ctx.secrets.put(ref, intent.value);
6085
+ } catch (err) {
6086
+ throw new KeychainWriteRefusedError(fieldPath, err);
6087
+ }
6088
+ return {
6089
+ kind: "value",
6090
+ value: makeSecretMarker(ref)
6091
+ };
6092
+ }
6093
+ /** Apply a member result onto `out`: KEEP restores the stored member, or removes it. */
6094
+ function applyMember(out, key, result, storedParent) {
6095
+ if (result.kind === "value") {
6096
+ out[key] = result.value;
6097
+ return;
6098
+ }
6099
+ if (Object.prototype.hasOwnProperty.call(storedParent, key)) out[key] = storedParent[key];
6100
+ else delete out[key];
6101
+ }
6102
+ async function writeMembers(ctx, children, incoming, stored, pathOf) {
6103
+ const out = { ...incoming };
6104
+ for (const [member, node] of children) applyMember(out, member, await writeNode(ctx, node, incoming[member], stored[member], pathOf(member)), stored);
6105
+ return out;
6106
+ }
6107
+ function rowId(row, idKey) {
6108
+ const raw = row[idKey];
6109
+ if (typeof raw === "string" && raw.length > 0) return raw;
6110
+ if (typeof raw === "number" && Number.isFinite(raw)) return String(raw);
6111
+ return null;
6112
+ }
6113
+ async function writeArray(ctx, node, incoming, stored, fieldPath) {
6114
+ const storedRows = Array.isArray(stored) ? stored.filter(isRecord) : [];
6115
+ if (!Array.isArray(incoming)) {
6116
+ ctx.deletes.push(...collectSecretMarkerRefs(storedRows));
6117
+ return {
6118
+ kind: "value",
6119
+ value: incoming
6120
+ };
6121
+ }
6122
+ const storedById = /* @__PURE__ */ new Map();
6123
+ for (const row of storedRows) {
6124
+ const id = rowId(row, node.idKey);
6125
+ if (id !== null) storedById.set(id, row);
6126
+ }
6127
+ const kept = /* @__PURE__ */ new Set();
6128
+ const rows = [];
6129
+ for (const row of incoming) {
6130
+ if (!isRecord(row)) {
6131
+ rows.push(row);
6132
+ continue;
6133
+ }
6134
+ const id = rowId(row, node.idKey) ?? ctx.mintId();
6135
+ kept.add(id);
6136
+ const withId = {
6137
+ ...row,
6138
+ [node.idKey]: row[node.idKey] ?? id
6139
+ };
6140
+ if (rowId(withId, node.idKey) === null) withId[node.idKey] = id;
6141
+ const storedRow = storedById.get(id) ?? {};
6142
+ rows.push(await writeMembers(ctx, node.item, withId, storedRow, (member) => arrayItemFieldPath(fieldPath, id, member)));
6143
+ }
6144
+ for (const [id, row] of storedById) if (!kept.has(id)) ctx.deletes.push(...collectSecretMarkerRefs(row));
6145
+ return {
6146
+ kind: "value",
6147
+ value: rows
6148
+ };
6149
+ }
6150
+ async function writeNode(ctx, node, incoming, stored, fieldPath) {
6151
+ switch (node.kind) {
6152
+ case "leaf": return writeLeaf(ctx, incoming, stored, fieldPath);
6153
+ case "array": return writeArray(ctx, node, incoming, stored, fieldPath);
6154
+ case "object": {
6155
+ if (!isRecord(incoming)) {
6156
+ if (incoming === void 0) return KEEP;
6157
+ ctx.deletes.push(...collectSecretMarkerRefs(stored));
6158
+ return {
6159
+ kind: "value",
6160
+ value: incoming
6161
+ };
6162
+ }
6163
+ const storedObj = isRecord(stored) ? stored : {};
6164
+ return {
6165
+ kind: "value",
6166
+ value: await writeMembers(ctx, node.children, incoming, storedObj, (m) => `${fieldPath}.${m}`)
6167
+ };
6168
+ }
6169
+ }
6170
+ }
6171
+ /** Split a perNode-scoped key (`key@nodeId`). */
6172
+ function splitNodeKey(key) {
6173
+ const at = key.indexOf("@");
6174
+ return at <= 0 ? {
6175
+ base: key,
6176
+ nodeId: null
6177
+ } : {
6178
+ base: key.slice(0, at),
6179
+ nodeId: key.slice(at + 1)
6180
+ };
6181
+ }
6182
+ /** Rewrite a settings patch so no secret value reaches the blob. See the file doc. */
6183
+ async function transformSecretWrite(input) {
6184
+ const deletes = [];
6185
+ const base = {
6186
+ secrets: input.secrets,
6187
+ mintId: input.mintId ?? defaultMintId,
6188
+ deletes,
6189
+ operatorWrite: input.operatorWrite === true
6190
+ };
6191
+ const out = {};
6192
+ for (const [key, incoming] of Object.entries(input.patch)) {
6193
+ const { base: baseKey, nodeId } = splitNodeKey(key);
6194
+ const node = input.tree.get(baseKey);
6195
+ if (node === void 0) {
6196
+ out[key] = incoming;
6197
+ continue;
6198
+ }
6199
+ const scope = nodeId !== null && nodeId.length > 0 ? {
6200
+ kind: "node",
6201
+ nodeId
6202
+ } : input.scope ?? globalSecretScope();
6203
+ const result = await writeNode({
6204
+ ...base,
6205
+ scope
6206
+ }, node, incoming, input.stored[key], baseKey);
6207
+ if (result.kind === "value") out[key] = result.value;
6208
+ }
6209
+ return {
6210
+ patch: out,
6211
+ afterWrite: async () => {
6212
+ if (deletes.length === 0) return { orphaned: [] };
6213
+ try {
6214
+ await input.secrets.delete([...new Set(deletes)]);
6215
+ return { orphaned: [] };
6216
+ } catch {
6217
+ return { orphaned: [...new Set(deletes)] };
6218
+ }
6219
+ }
6220
+ };
6221
+ }
6222
+ /**
6223
+ * Replace every marker in `value` with its keychain value. Returns the SAME
6224
+ * reference when there is no marker (no allocation, no keychain call).
6225
+ */
6226
+ async function resolveSecretMarkers(value, secrets) {
6227
+ const refs = collectSecretMarkerRefs(value);
6228
+ if (refs.length === 0) return {
6229
+ value,
6230
+ unresolved: []
6231
+ };
6232
+ const answers = await secrets.resolve(refs);
6233
+ const unresolved = [];
6234
+ for (const ref of new Set(refs)) {
6235
+ const answer = answers[ref];
6236
+ if (answer === void 0) unresolved.push({
6237
+ ref,
6238
+ reason: "not-initialized"
6239
+ });
6240
+ else if (answer.kind === "unavailable") unresolved.push({
6241
+ ref,
6242
+ reason: answer.reason
6243
+ });
6244
+ else if (answer.kind === "missing" || answer.kind === "forbidden") unresolved.push({
6245
+ ref,
6246
+ reason: answer.kind
6247
+ });
6248
+ }
6249
+ const substitute = (v) => {
6250
+ if (isSecretMarker(v)) {
6251
+ const answer = answers[v.$secret];
6252
+ return answer?.kind === "value" ? {
6253
+ keep: true,
6254
+ value: answer.value
6255
+ } : {
6256
+ keep: false,
6257
+ value: void 0
6258
+ };
6259
+ }
6260
+ if (Array.isArray(v)) {
6261
+ const items = [];
6262
+ for (const item of v) {
6263
+ const s = substitute(item);
6264
+ if (s.keep) items.push(s.value);
6265
+ }
6266
+ return {
6267
+ keep: true,
6268
+ value: items
6269
+ };
6270
+ }
6271
+ if (isRecord(v)) {
6272
+ const out = {};
6273
+ for (const [k, child] of Object.entries(v)) {
6274
+ const s = substitute(child);
6275
+ if (s.keep) out[k] = s.value;
6276
+ }
6277
+ return {
6278
+ keep: true,
6279
+ value: out
6280
+ };
6281
+ }
6282
+ return {
6283
+ keep: true,
6284
+ value: v
6285
+ };
6286
+ };
6287
+ return {
6288
+ value: substitute(value).value,
6289
+ unresolved
6290
+ };
6291
+ }
6292
+ function touchesTree(tree, patch) {
6293
+ if (tree.size === 0) return false;
6294
+ for (const key of Object.keys(patch)) {
6295
+ const at = key.indexOf("@");
6296
+ if (tree.has(at > 0 ? key.slice(0, at) : key)) return true;
6297
+ }
6298
+ return false;
6299
+ }
6300
+ /** The blob as stored now; a failed read REFUSES the write instead of guessing. */
6301
+ async function readStoredAddonBlob(raw) {
6302
+ const threeWay = raw.readAddonStoreResult;
6303
+ if (threeWay === void 0) return raw.readAddonStore();
6304
+ const result = await threeWay.call(raw);
6305
+ if (result.kind === "failed") throw new Error(`settings write refused: the stored blob could not be read (${result.error})`);
6306
+ return result.kind === "missing" ? {} : result.value;
6307
+ }
6308
+ function createSecretAwareSettings(raw, opts) {
6309
+ const chains = /* @__PURE__ */ new Map();
6310
+ const serialize = (key, fn) => {
6311
+ const next = (chains.get(key) ?? Promise.resolve()).then(fn, fn);
6312
+ const tail = next.catch(() => void 0);
6313
+ chains.set(key, tail);
6314
+ tail.then(() => {
6315
+ if (chains.get(key) === tail) chains.delete(key);
6316
+ });
6317
+ return next;
6318
+ };
6319
+ const write = async (chainKey, tree, scope, patch, readStored, rawWrite) => {
6320
+ if (!touchesTree(tree, patch)) return rawWrite(patch);
6321
+ return serialize(chainKey, async () => {
6322
+ const stored = await readStored();
6323
+ const result = await transformSecretWrite({
6324
+ tree,
6325
+ secrets: opts.secrets,
6326
+ patch,
6327
+ stored,
6328
+ ...scope !== void 0 ? { scope } : {},
6329
+ operatorWrite: opts.isOperatorWrite?.() === true
6330
+ });
6331
+ if (Object.keys(result.patch).length > 0) await rawWrite(result.patch);
6332
+ const { orphaned } = await result.afterWrite();
6333
+ if (orphaned.length > 0) opts.onOrphaned(orphaned);
6334
+ });
6335
+ };
6336
+ const wrapped = {
6337
+ writeAddonStore: (patch) => write("addon", opts.addonTree(), void 0, patch, () => readStoredAddonBlob(raw), (p) => raw.writeAddonStore(p)),
6338
+ writeDeviceStore: (deviceId, patch) => write(`device:${deviceId}`, opts.deviceTree(), {
6339
+ kind: "device",
6340
+ deviceId
6341
+ }, patch, () => raw.readDeviceStore(deviceId), (p) => raw.writeDeviceStore(deviceId, p))
6342
+ };
6343
+ return new Proxy(raw, { get(target, prop, receiver) {
6344
+ if (prop === "writeAddonStore") return wrapped.writeAddonStore;
6345
+ if (prop === "writeDeviceStore") return wrapped.writeDeviceStore;
6346
+ const value = Reflect.get(target, prop, receiver);
6347
+ return typeof value === "function" ? value.bind(target) : value;
6348
+ } });
6349
+ }
6350
+ /** The context the addon sees: identical, except that its settings writes are secret-aware. */
6351
+ function withSecretAwareSettings(context, opts) {
6352
+ const raw = context.settings;
6353
+ if (raw === void 0) return context;
6354
+ const settings = createSecretAwareSettings(raw, opts);
6355
+ return new Proxy(context, { get(target, prop, receiver) {
6356
+ if (prop === "settings") return settings;
6357
+ return Reflect.get(target, prop, receiver);
6358
+ } });
6359
+ }
6360
+ var LEAF = { kind: "leaf" };
6361
+ var DEFAULT_ITEM_ID_KEY = "id";
6362
+ function collectFields(fields, out) {
6363
+ for (const field of fields) {
6364
+ if (field.type === "group") {
6365
+ collectFields(field.fields, out);
6366
+ continue;
6367
+ }
6368
+ if (field.type === "sub-tabs") {
6369
+ for (const tab of field.tabs) collectFields(tab.fields, out);
6370
+ continue;
6371
+ }
6372
+ if (field.type === "editable-array") {
6373
+ const item = /* @__PURE__ */ new Map();
6374
+ for (const itemField of field.itemFields) if ("key" in itemField && isKeychainStoredField(itemField)) item.set(itemField.key, LEAF);
6375
+ if (item.size > 0) out.set(field.key, {
6376
+ kind: "array",
6377
+ idKey: field.itemIdKey ?? DEFAULT_ITEM_ID_KEY,
6378
+ item
6379
+ });
6380
+ continue;
6381
+ }
6382
+ if (!("key" in field) || typeof field.key !== "string") continue;
6383
+ if (isKeychainStoredField(field)) out.set(field.key, LEAF);
6384
+ }
6385
+ }
6386
+ /** The secret tree a settings schema declares. */
6387
+ function secretTreeFromSchema(schema) {
6388
+ const out = /* @__PURE__ */ new Map();
6389
+ if (schema === null) return out;
6390
+ for (const section of schema.sections) collectFields(section.fields, out);
6391
+ return out;
6392
+ }
6393
+ /** Parse `a.b[id].c` into segments; throws on a malformed path (a declaration bug). */
6394
+ function parseSecretStatePath(path) {
6395
+ const segments = [];
6396
+ for (const raw of path.split(".")) {
6397
+ const m = /^([^[\]]+)(?:\[([^[\]]+)\])?$/.exec(raw);
6398
+ if (m === null || m[1] === void 0) throw new Error(`secretStatePaths: malformed path "${path}"`);
6399
+ segments.push(m[2] !== void 0 ? {
6400
+ key: m[1],
6401
+ idKey: m[2]
6402
+ } : { key: m[1] });
6403
+ }
6404
+ if (segments.length === 0) throw new Error(`secretStatePaths: empty path`);
6405
+ if (segments[segments.length - 1]?.idKey !== void 0) throw new Error(`secretStatePaths: "${path}" ends on an array — name the member that is secret`);
6406
+ return segments;
6407
+ }
6408
+ function insert(into, segments) {
6409
+ const [head, ...rest] = segments;
6410
+ if (head === void 0) return;
6411
+ if (rest.length === 0) {
6412
+ into.set(head.key, LEAF);
6413
+ return;
6414
+ }
6415
+ const existing = into.get(head.key);
6416
+ if (head.idKey !== void 0) {
6417
+ const item = new Map(existing?.kind === "array" ? existing.item : []);
6418
+ insert(item, rest);
6419
+ into.set(head.key, {
6420
+ kind: "array",
6421
+ idKey: head.idKey,
6422
+ item
6423
+ });
6424
+ return;
6425
+ }
6426
+ const children = new Map(existing?.kind === "object" ? existing.children : []);
6427
+ insert(children, rest);
6428
+ into.set(head.key, {
6429
+ kind: "object",
6430
+ children
6431
+ });
6432
+ }
6433
+ /** Add hidden-state paths (`secretStatePaths`) to a schema-derived tree. */
6434
+ function mergeSecretStatePaths(tree, paths) {
6435
+ if (paths.length === 0) return tree;
6436
+ const out = new Map(tree);
6437
+ for (const path of paths) insert(out, parseSecretStatePath(path));
6438
+ return out;
6439
+ }
6440
+ /** First retry of a secret the keychain could not serve; doubles to {@link SECRET_RETRY_MAX_MS}. */
6441
+ var SECRET_RETRY_FIRST_MS = 5e3;
6442
+ var SECRET_RETRY_MAX_MS = 5 * 6e4;
6443
+ /** Coalesces a burst of `keychain.changed` events into one re-resolve. */
6444
+ var SECRET_CHANGE_DEBOUNCE_MS = 250;
5918
6445
  /**
5919
6446
  * Base class for CamStack addons. Eliminates settings boilerplate:
5920
6447
  *
@@ -5984,6 +6511,25 @@ var BaseAddon = class {
5984
6511
  settingsStoreReady = false;
5985
6512
  /** Default config values. Provided via constructor. */
5986
6513
  defaults;
6514
+ /**
6515
+ * Hidden-state paths that hold secrets (D787) — values the addon writes
6516
+ * itself (`updateGlobalSettings`, `state()`) that no form field declares.
6517
+ * Stored in the keychain exactly like a `password` field. Syntax:
6518
+ * `'snapshotSigningKey'`, `'identity.pincode'`, `'tokens[userId].accessToken'`
6519
+ * (`key[<id field>]` addresses array items by id, never by index).
6520
+ */
6521
+ secretStatePaths = [];
6522
+ _addonSecretTree = null;
6523
+ _deviceSecretTree = null;
6524
+ /** Refs the last resolved config pointed at — a change to one re-resolves. */
6525
+ _configSecretRefs = /* @__PURE__ */ new Set();
6526
+ _unresolvedSecrets = [];
6527
+ _secretRetryTimer = null;
6528
+ _secretRetryDelayMs = SECRET_RETRY_FIRST_MS;
6529
+ _secretChangeTimer = null;
6530
+ _secretChangeUnsub = null;
6531
+ /** >0 while an OPERATOR's settings write is being applied. */
6532
+ _operatorWriteDepth = 0;
5987
6533
  constructor(defaults) {
5988
6534
  this.defaults = defaults;
5989
6535
  this._config = { ...defaults };
@@ -6019,8 +6565,18 @@ var BaseAddon = class {
6019
6565
  return this._config;
6020
6566
  }
6021
6567
  async initialize(context) {
6022
- this._ctx = context;
6568
+ const secrets = context.secrets;
6569
+ this._ctx = secrets !== void 0 ? withSecretAwareSettings(context, {
6570
+ secrets,
6571
+ addonTree: () => this.addonSecretTree(),
6572
+ deviceTree: () => this.deviceSecretTree(),
6573
+ onOrphaned: (refs) => context.logger.warn("keychain refs dropped by a settings write could not be deleted", { meta: { refs: [...refs] } }),
6574
+ isOperatorWrite: () => this._operatorWriteDepth > 0
6575
+ }) : context;
6023
6576
  await this.resolveConfig();
6577
+ if (secrets !== void 0) this._secretChangeUnsub = secrets.onChange((ref) => {
6578
+ if (this._configSecretRefs.has(ref)) this.scheduleSecretReresolve(SECRET_CHANGE_DEBOUNCE_MS);
6579
+ });
6024
6580
  const result = await this.onInitialize();
6025
6581
  this.emitLifecycle(EventCategory.AddonStarted);
6026
6582
  const normalized = normalizeAddonInitResult(result);
@@ -6053,6 +6609,12 @@ var BaseAddon = class {
6053
6609
  */
6054
6610
  async onHubReachable() {}
6055
6611
  async shutdown() {
6612
+ this._secretChangeUnsub?.();
6613
+ this._secretChangeUnsub = null;
6614
+ if (this._secretRetryTimer !== null) clearTimeout(this._secretRetryTimer);
6615
+ if (this._secretChangeTimer !== null) clearTimeout(this._secretChangeTimer);
6616
+ this._secretRetryTimer = null;
6617
+ this._secretChangeTimer = null;
6056
6618
  this.emitLifecycle(EventCategory.AddonStopped);
6057
6619
  if (this.autoEmitReadiness) this.emitReadinessForProviders("down");
6058
6620
  await this.onShutdown();
@@ -6131,7 +6693,7 @@ var BaseAddon = class {
6131
6693
  return hydrateSchema(schema, overlay ? {
6132
6694
  ...projected,
6133
6695
  ...overlay
6134
- } : projected);
6696
+ } : projected, { inlineSecretsAsViews: true });
6135
6697
  }
6136
6698
  /**
6137
6699
  * The integration-level view of this addon's settings: exactly the sections
@@ -6180,7 +6742,7 @@ var BaseAddon = class {
6180
6742
  return hydrateSchema({
6181
6743
  ...schema,
6182
6744
  sections
6183
- }, projected);
6745
+ }, projected, { inlineSecretsAsViews: true });
6184
6746
  }
6185
6747
  /**
6186
6748
  * The raw addon store PROJECTED onto the target node's bare per-node keys:
@@ -6234,18 +6796,50 @@ var BaseAddon = class {
6234
6796
  value: result.value[key]
6235
6797
  };
6236
6798
  }
6799
+ /**
6800
+ * The OPERATOR's write — a settings form or an admin API call, dispatched by
6801
+ * the kernel. Identical to {@link updateGlobalSettings}, except that a secret
6802
+ * the operator sends is stored as sent even when it equals a pre-keychain
6803
+ * inline value: the operator re-entering a password is a change, an addon
6804
+ * writing back what it read is not (D787).
6805
+ */
6806
+ async updateGlobalSettingsAsOperator(patch, nodeId) {
6807
+ this._operatorWriteDepth++;
6808
+ try {
6809
+ await this.applyGlobalPatch(patch, nodeId);
6810
+ } finally {
6811
+ this._operatorWriteDepth--;
6812
+ }
6813
+ }
6237
6814
  async updateGlobalSettings(patch, nodeId) {
6815
+ await this.applyGlobalPatch(patch, nodeId);
6816
+ }
6817
+ /**
6818
+ * REMOVE stored secrets — their keychain values and their markers (D787).
6819
+ *
6820
+ * Writing `''` to a secret field KEEPS what is stored (an empty string is
6821
+ * what a defaults fallback writes back, and it must never destroy a
6822
+ * credential), so code that means "forget this token" says so here. Without
6823
+ * a keychain (an older kernel) it writes `''`, as such code always did.
6824
+ */
6825
+ async clearSecrets(keys, nodeId) {
6826
+ const tree = this.addonSecretTree();
6827
+ const keychain = this._ctx?.secrets !== void 0;
6828
+ const patch = {};
6829
+ for (const key of keys) patch[key] = keychain && tree.has(key) ? SECRET_CLEAR : "";
6830
+ await this.applyGlobalPatch(patch, nodeId);
6831
+ }
6832
+ async applyGlobalPatch(barePatch, nodeId) {
6238
6833
  const keys = this.perNodeKeys();
6239
6834
  const localNode = normalizeNodeId(this._ctx?.kernel?.localNodeId);
6240
6835
  const target = normalizeNodeId(nodeId ?? this._ctx?.kernel?.localNodeId);
6241
- const barePatch = patch;
6242
6836
  const scoped = keys.size > 0 ? scopePatch(barePatch, keys, target) : barePatch;
6243
6837
  await this._ctx?.settings?.writeAddonStore(scoped);
6244
6838
  if (target !== localNode) return;
6245
6839
  await this.resolveConfig();
6246
6840
  await this.onConfigChanged();
6247
6841
  this.emitLifecycle(EventCategory.AddonUpdated, { level: "global" });
6248
- this.maybeAutoRestart(patch, this.globalSettingsSchema());
6842
+ this.maybeAutoRestart(Object.keys(barePatch), this.globalSettingsSchema());
6249
6843
  }
6250
6844
  /**
6251
6845
  * The set of field keys the global settings schema declares `perNode: true`
@@ -6270,7 +6864,7 @@ var BaseAddon = class {
6270
6864
  * time to return its response before the addon is torn down and
6271
6865
  * re-initialised by `AddonRegistryService.restartAddon`.
6272
6866
  */
6273
- maybeAutoRestart(patch, schema) {
6867
+ maybeAutoRestart(patchKeys, schema) {
6274
6868
  if (!schema) return;
6275
6869
  const restartKeys = /* @__PURE__ */ new Set();
6276
6870
  for (const section of schema.sections) for (const field of section.fields) {
@@ -6278,13 +6872,13 @@ var BaseAddon = class {
6278
6872
  if (field.requiresRestart) restartKeys.add(field.key);
6279
6873
  }
6280
6874
  if (restartKeys.size === 0) return;
6281
- if (!Object.keys(patch).some((k) => restartKeys.has(k))) return;
6875
+ if (!patchKeys.some((k) => restartKeys.has(k))) return;
6282
6876
  const ctx = this._ctx;
6283
6877
  if (!ctx) return;
6284
6878
  const addonId = ctx.id;
6285
6879
  setImmediate(() => {
6286
6880
  ctx.api.addons?.restartAddon?.mutate({ addonId }).then(() => {
6287
- ctx.logger.info("addon auto-restart triggered by restart-required setting change", { meta: { changedFields: Object.keys(patch).filter((k) => restartKeys.has(k)) } });
6881
+ ctx.logger.info("addon auto-restart triggered by restart-required setting change", { meta: { changedFields: patchKeys.filter((k) => restartKeys.has(k)) } });
6288
6882
  }).catch((err) => {
6289
6883
  ctx.logger.error("addon auto-restart failed", { meta: { error: err instanceof Error ? err.message : String(err) } });
6290
6884
  });
@@ -6293,7 +6887,7 @@ var BaseAddon = class {
6293
6887
  async getDeviceSettings(deviceId) {
6294
6888
  const schema = this.deviceSettingsSchema();
6295
6889
  if (!schema) return { sections: [] };
6296
- return hydrateSchema(schema, await this._ctx?.settings?.readDeviceStore(deviceId) ?? {});
6890
+ return hydrateSchema(schema, await this._ctx?.settings?.readDeviceStore(deviceId) ?? {}, { inlineSecretsAsViews: true });
6297
6891
  }
6298
6892
  async updateDeviceSettings(deviceId, patch) {
6299
6893
  await this._ctx?.settings?.writeDeviceStore(deviceId, patch);
@@ -6423,7 +7017,7 @@ var BaseAddon = class {
6423
7017
  * selection at boot (absent scoped key ⇒ the constructor default wins).
6424
7018
  */
6425
7019
  async resolveConfig() {
6426
- const stored = await this.readAddonStoreWithRetry();
7020
+ const stored = await this.resolveStoredSecrets(await this.readAddonStoreWithRetry());
6427
7021
  const perNode = this.perNodeKeys();
6428
7022
  const localNode = normalizeNodeId(this._ctx?.kernel?.localNodeId);
6429
7023
  const resolved = { ...this.defaults };
@@ -6448,7 +7042,7 @@ var BaseAddon = class {
6448
7042
  key,
6449
7043
  schema,
6450
7044
  fallback,
6451
- read: () => this.readAddonStoreWithRetry(),
7045
+ read: async () => this.resolveStoredSecrets(await this.readAddonStoreWithRetry()),
6452
7046
  write: async (patch) => {
6453
7047
  await this._ctx?.settings?.writeAddonStore(patch);
6454
7048
  },
@@ -6465,7 +7059,7 @@ var BaseAddon = class {
6465
7059
  key,
6466
7060
  schema,
6467
7061
  fallback,
6468
- read: async () => await this._ctx?.settings?.readDeviceStore(deviceId) ?? {},
7062
+ read: async () => this.resolveStoredSecrets(await this._ctx?.settings?.readDeviceStore(deviceId) ?? {}, false),
6469
7063
  write: async (patch) => {
6470
7064
  await this._ctx?.settings?.writeDeviceStore(deviceId, patch);
6471
7065
  },
@@ -6477,6 +7071,70 @@ var BaseAddon = class {
6477
7071
  } })
6478
7072
  });
6479
7073
  }
7074
+ /** The addon store's secret tree: schema fields by TYPE, plus `secretStatePaths`. */
7075
+ addonSecretTree() {
7076
+ this._addonSecretTree ??= mergeSecretStatePaths(secretTreeFromSchema(this.globalSettingsSchema()), this.secretStatePaths);
7077
+ return this._addonSecretTree;
7078
+ }
7079
+ deviceSecretTree() {
7080
+ this._deviceSecretTree ??= secretTreeFromSchema(this.deviceSettingsSchema());
7081
+ return this._deviceSecretTree;
7082
+ }
7083
+ /**
7084
+ * Secrets of this addon's stored config that could not be resolved on the
7085
+ * last read, with why. Non-empty means the addon is running WITHOUT them —
7086
+ * an addon whose function needs one should report itself degraded rather
7087
+ * than start on an empty credential.
7088
+ */
7089
+ get unresolvedSecrets() {
7090
+ return this._unresolvedSecrets;
7091
+ }
7092
+ /**
7093
+ * Substitute every keychain marker in a stored blob with its value. With no
7094
+ * keychain (no `ctx.secrets`) or no marker, the blob comes back unchanged.
7095
+ * An unresolvable value is LEFT OUT (never `''`), logged by ref — never by
7096
+ * value — and, when the cause can pass, retried with backoff. Nothing is
7097
+ * ever written back from here.
7098
+ */
7099
+ async resolveStoredSecrets(blob, trackForConfig = true) {
7100
+ const secrets = this._ctx?.secrets;
7101
+ if (secrets === void 0) return blob;
7102
+ const refs = collectSecretMarkerRefs(blob);
7103
+ if (trackForConfig) this._configSecretRefs = new Set(refs);
7104
+ if (refs.length === 0) {
7105
+ if (trackForConfig) this._unresolvedSecrets = [];
7106
+ return blob;
7107
+ }
7108
+ const { value, unresolved } = await resolveSecretMarkers(blob, secrets);
7109
+ if (trackForConfig) {
7110
+ this._unresolvedSecrets = unresolved;
7111
+ if (unresolved.length > 0) {
7112
+ this._ctx?.logger?.error?.("secret unavailable — running without it, will retry", { meta: { secrets: unresolved.map((u) => ({
7113
+ ref: u.ref,
7114
+ reason: u.reason
7115
+ })) } });
7116
+ if (unresolved.some((u) => u.reason !== "missing" && u.reason !== "forbidden")) {
7117
+ this.scheduleSecretReresolve(this._secretRetryDelayMs);
7118
+ this._secretRetryDelayMs = Math.min(this._secretRetryDelayMs * 2, SECRET_RETRY_MAX_MS);
7119
+ }
7120
+ } else this._secretRetryDelayMs = SECRET_RETRY_FIRST_MS;
7121
+ }
7122
+ return value;
7123
+ }
7124
+ /** Re-resolve the config (a keychain-only change, or a retry) and apply it. */
7125
+ scheduleSecretReresolve(delayMs) {
7126
+ const timerOf = delayMs === SECRET_CHANGE_DEBOUNCE_MS ? "_secretChangeTimer" : "_secretRetryTimer";
7127
+ if (this[timerOf] !== null) return;
7128
+ const timer = setTimeout(() => {
7129
+ this[timerOf] = null;
7130
+ if (this._ctx === null) return;
7131
+ this.resolveConfig().then(() => this.onConfigChanged()).catch((err) => {
7132
+ this._ctx?.logger?.error?.("re-resolving secrets failed", { meta: { error: err instanceof Error ? err.message : String(err) } });
7133
+ });
7134
+ }, delayMs);
7135
+ timer.unref?.();
7136
+ this[timerOf] = timer;
7137
+ }
6480
7138
  /**
6481
7139
  * Wrap `ctx.settings.readAddonStore()` with a short retry budget so a
6482
7140
  * transient settings-store outage (mid-restart of sqlite-settings, tsx-watch
@@ -6744,32 +7402,12 @@ object({
6744
7402
  audioCodec: string().optional(),
6745
7403
  metadata: record(string(), unknown()).readonly().optional()
6746
7404
  });
6747
- var EncodedPacketSchema = object({
6748
- type: _enum(["video", "audio"]),
6749
- data: _instanceof(Uint8Array),
6750
- pts: number(),
6751
- dts: number(),
6752
- keyframe: boolean(),
6753
- codec: string()
6754
- });
6755
- var DecodedFrameSchema = object({
6756
- data: _instanceof(Uint8Array),
6757
- width: number(),
6758
- height: number(),
6759
- format: _enum([
6760
- "jpeg",
6761
- "rgb",
6762
- "bgr",
6763
- "yuv420",
6764
- "gray"
6765
- ]),
6766
- timestamp: number()
6767
- });
6768
7405
  /**
6769
7406
  * Wire schema for `FrameHandle` — a zero-pixel, serialisable reference to a
6770
7407
  * frame in a shared-memory ring (Phase 5 / D9). Mirrors the `FrameHandle` TS
6771
- * interface in `interfaces/frame-handle.ts` field-for-field so a decoder cap
6772
- * method (`pullHandles`) can carry handles over tRPC / Moleculer.
7408
+ * interface in `interfaces/frame-handle.ts` field-for-field so a cap method
7409
+ * (the runner's native-crop and pipeline-executor inputs) can carry handles
7410
+ * over tRPC / Moleculer.
6773
7411
  *
6774
7412
  * The `satisfies` assertion below pins this schema to the interface: if a
6775
7413
  * field is added to / removed from `FrameHandle` without a matching schema
@@ -6795,50 +7433,6 @@ var FrameHandleSchema = object({
6795
7433
  slotCount: number().int().positive()
6796
7434
  });
6797
7435
  /**
6798
- * Pixel format a frame-handle subscriber can request from the broker
6799
- * (Phase 5 / D9). The packed, raster subset of `FrameFormat` — the formats a
6800
- * `frameSink: 'shm'` decoder session can write into a `FrameRing` slot.
6801
- * `jpeg` is excluded: a variable-length stream is not a fixed-stride ring
6802
- * payload, and no decoded-frame consumer requests it over the shm plane.
6803
- */
6804
- var FrameHandleFormatSchema = _enum([
6805
- "rgb",
6806
- "bgr",
6807
- "yuv420",
6808
- "gray"
6809
- ]);
6810
- /**
6811
- * Input for `stream-broker.subscribeFrames` (Phase 5 / D9). A consumer asks the
6812
- * broker for a `FrameHandle` stream of one `format`; the broker maintains one
6813
- * shared-memory ring per `(brokerId, format)` actually requested, so a `gray`
6814
- * subscriber (motion) and an `rgb` subscriber (detection) each read the format
6815
- * they asked for with no broker-side conversion.
6816
- */
6817
- var SubscribeFramesInputSchema = object({
6818
- brokerId: string(),
6819
- format: FrameHandleFormatSchema,
6820
- /**
6821
- * Optional reader-side cadence hint in frames per second. The broker does
6822
- * NOT throttle — latest-wins ring reads drop frames implicitly for a slow
6823
- * consumer. The value is echoed back in `SubscribeFramesResult.maxFps` so
6824
- * the consumer can pace its own `pullFrameHandles` polling.
6825
- */
6826
- maxFps: number().positive().optional(),
6827
- /** Short caller-identity tag (`motion`, `detection`, …) for diagnostics. */
6828
- tag: string().optional()
6829
- });
6830
- /**
6831
- * Result of `stream-broker.subscribeFrames`. The consumer then polls
6832
- * `pullFrameHandles({ subscriptionId, maxCount })` and feeds each returned
6833
- * `FrameHandle` to a `FrameRingReader`.
6834
- */
6835
- var SubscribeFramesResultSchema = object({
6836
- /** Opaque id the consumer passes to `pullFrameHandles` / `unsubscribeFrames`. */
6837
- subscriptionId: string(),
6838
- /** Reader-side cadence hint (frames/s) — echoes `SubscribeFramesInput.maxFps`. */
6839
- maxFps: number().nonnegative()
6840
- });
6841
- /**
6842
7436
  * Wire schema for a decoded audio chunk (Phase 5 / D9). Mirrors the
6843
7437
  * `DecodedAudioChunk` TS interface in `interfaces/stream-broker.ts`: PCM
6844
7438
  * sample bytes plus the track parameters a consumer needs to interpret them.
@@ -6846,8 +7440,8 @@ var SubscribeFramesResultSchema = object({
6846
7440
  * Audio chunks are tiny (a ~500ms AudioCodecSession window is a few KB of
6847
7441
  * Float32 PCM), so unlike video frames they ship their bytes INLINE over
6848
7442
  * tRPC / Moleculer — no shared-memory plane. `data` is typed `Uint8Array`
6849
- * (the wire-serialisable supertype of `Buffer`) to match `DecodedFrameSchema`
6850
- * / `EncodedPacketSchema`'s precedent; a `Buffer` is assignable to it.
7443
+ * (the wire-serialisable supertype of `Buffer`); a `Buffer` is assignable to
7444
+ * it.
6851
7445
  */
6852
7446
  var AudioChunkFormatSchema = _enum(AUDIO_CHUNK_FORMATS);
6853
7447
  var DecodedAudioChunkSchema = object({
@@ -6865,11 +7459,10 @@ var DecodedAudioChunkSchema = object({
6865
7459
  format: AudioChunkFormatSchema.optional()
6866
7460
  });
6867
7461
  /**
6868
- * Input for `stream-broker.subscribeAudioChunks` (Phase 5 / D9). The
6869
- * handle-free, ship-bytes-inline analogue of `subscribeFrames`: a consumer
6870
- * asks the broker for the decoded audio-chunk stream of one broker; the
6871
- * broker keeps a per-subscription bounded FIFO queue the consumer drains via
6872
- * `pullAudioChunks`.
7462
+ * Input for `stream-broker.subscribeAudioChunks` (Phase 5 / D9). Audio ships
7463
+ * its bytes inline: a consumer asks the broker for the decoded audio-chunk
7464
+ * stream of one broker; the broker keeps a per-subscription bounded FIFO queue
7465
+ * the consumer drains via `pullAudioChunks`.
6873
7466
  */
6874
7467
  var SubscribeAudioChunksInputSchema = object({
6875
7468
  brokerId: string(),
@@ -6900,9 +7493,7 @@ var BrokerStatsSchema = object({
6900
7493
  "stopped"
6901
7494
  ]),
6902
7495
  inputFps: number(),
6903
- decodeFps: number(),
6904
7496
  encodedSubscribers: number(),
6905
- decodedSubscribers: number(),
6906
7497
  uptimeMs: number(),
6907
7498
  bitrateKbps: number(),
6908
7499
  idrIntervalMs: number(),
@@ -6915,14 +7506,6 @@ var BrokerStatsSchema = object({
6915
7506
  preBufferMs: number(),
6916
7507
  preBufferPackets: number(),
6917
7508
  /**
6918
- * Moleculer node id of the decoder provider currently servicing this
6919
- * stream's decoded subscribers. `null` until the deferred decoder is
6920
- * created (no decoded clients yet, or codec not detected). Surfaces the
6921
- * runtime decoder placement so the UI can show "Decoder: <agent>" without
6922
- * a separate cap call per broker.
6923
- */
6924
- decoderNodeId: string().nullable(),
6925
- /**
6926
7509
  * Detected audio track parameters from the RTSP DESCRIBE / SDP. `null`
6927
7510
  * when the stream has no audio track or the broker is in cold start.
6928
7511
  * `supported = false` means the codec was detected but the local
@@ -8388,8 +8971,8 @@ function buildAddonRouteProvider(id, routes) {
8388
8971
  const reply = buildCapturingReply(envelope);
8389
8972
  const request = {
8390
8973
  params: {
8391
- ...input.params,
8392
- ...match.params
8974
+ ...match.params,
8975
+ ...input.params
8393
8976
  },
8394
8977
  query: input.query,
8395
8978
  body: input.body,
@@ -10371,70 +10954,6 @@ var StorageLocationDeclarationSchema = object({
10371
10954
  "backup"
10372
10955
  ]).optional()
10373
10956
  });
10374
- var DecoderStatsSchema = object({
10375
- inputFps: number(),
10376
- outputFps: number(),
10377
- avgDecodeTimeMs: number(),
10378
- droppedFrames: number(),
10379
- /**
10380
- * Pull-mode adaptive-fps telemetry (optional — only pull sessions run the
10381
- * lag-driven controller; push sessions omit these). `lagMs` is the EWMA of
10382
- * the decoder's real-time drift (rising = falling behind live); `adaptiveFps`
10383
- * is the current lag-throttled emit rate (≤ `effectiveFps` ceiling).
10384
- */
10385
- lagMs: number().optional(),
10386
- effectiveFps: number().optional(),
10387
- adaptiveFps: number().optional()
10388
- });
10389
- var DecoderSessionConfigSchema = object({
10390
- codec: string(),
10391
- maxFps: number().default(0),
10392
- outputFormat: _enum([
10393
- "jpeg",
10394
- "rgb",
10395
- "bgr",
10396
- "yuv420",
10397
- "gray"
10398
- ]).default("jpeg"),
10399
- scale: number().default(1),
10400
- width: number().optional(),
10401
- height: number().optional(),
10402
- /**
10403
- * Identifier of the camera this decoder session serves. Optional
10404
- * because the cap is generic (any caller could request decode), but
10405
- * stream-broker passes it so decoder logs include `deviceId` for
10406
- * per-camera filtering when diagnosing failures (e.g. node-av
10407
- * sendPacket errors on a single hung camera).
10408
- */
10409
- deviceId: number().int().nonnegative().optional(),
10410
- /**
10411
- * Free-form tag for log scoping. Stream-broker uses
10412
- * `broker:<deviceId>/<profile>`. Decoder session logger surfaces it
10413
- * on every line so `grep tag=broker:5/high` filters one camera
10414
- * profile cleanly.
10415
- */
10416
- tag: string().optional(),
10417
- /**
10418
- * Where the session delivers decoded frames (Phase 5 / D9):
10419
- *
10420
- * - `'callback'` (default) — the legacy pixel path: decoded frames are
10421
- * buffered as `DecodedFrame`s and drained via `pullFrames`.
10422
- * - `'shm'` — the shared-memory frame plane: decoded frames are written
10423
- * into an OS shared-memory ring and drained as zero-pixel
10424
- * `FrameHandle`s via `pullHandles`. A session is one mode or the
10425
- * other — `pullFrames` returns nothing for an `'shm'` session and
10426
- * `pullHandles` returns nothing for a `'callback'` session.
10427
- */
10428
- frameSink: _enum(["callback", "shm"]).default("callback"),
10429
- /**
10430
- * Per-camera decoder DEBUG facility. When `true`, a pull-mode session emits
10431
- * a throttled (~1Hz) structured `decoder debug` line (effective/adaptive fps,
10432
- * real-time lag, dropped-frame delta, avg decode time, hwaccel). Mirrors the
10433
- * stream-broker's `streamingDebug` gate — off by default so production logs
10434
- * stay quiet and the emit path pays zero per-frame cost when disabled.
10435
- */
10436
- debug: boolean().optional()
10437
- });
10438
10957
  /**
10439
10958
  * Per-component log CHANNELS — the gate a hot path consults, and the registry
10440
10959
  * an addon declares its channels in.
@@ -10585,7 +11104,18 @@ var LABEL_SUPPLY_STEP_IDS = [
10585
11104
  ];
10586
11105
  /** Steps whose box a root detection can BE. */
10587
11106
  var CROP_SUPPLY_STEP_IDS = ["plate-detection", "face-detection"];
10588
- [...LABEL_SUPPLY_STEP_IDS, ...CROP_SUPPLY_STEP_IDS];
11107
+ /**
11108
+ * Steps whose per-detection MASK a root detection can carry (D737). The live
11109
+ * mask step is `segmentation` — a frame-plane refiner that runs its own model
11110
+ * once per detection crop. (`instance-segmentation` is a dormant step id that
11111
+ * no camera tree carries.)
11112
+ */
11113
+ var MASK_SUPPLY_STEP_IDS = ["segmentation"];
11114
+ [
11115
+ ...LABEL_SUPPLY_STEP_IDS,
11116
+ ...CROP_SUPPLY_STEP_IDS,
11117
+ ...MASK_SUPPLY_STEP_IDS
11118
+ ];
10589
11119
  var MODEL_FORMATS = [
10590
11120
  "onnx",
10591
11121
  "coreml",
@@ -10614,7 +11144,53 @@ var ModelFormatEntrySchema = object({
10614
11144
  /** Multi-file payload (directory members or sibling files). */
10615
11145
  files: array(string()).readonly().optional(),
10616
11146
  /** Runtime(s) that can use this format. If omitted, inferred from ModelFormat key */
10617
- runtimes: array(_enum(["python"])).readonly().optional()
11147
+ runtimes: array(_enum(["python"])).readonly().optional(),
11148
+ /**
11149
+ * Content revision of the artefact, for one hosted OFF the CamStack mirror.
11150
+ * A format on the mirror leaves it unset: its revision (the sha256 of its
11151
+ * weight file) comes from the downloader's generated table, kept in step
11152
+ * with the mirror by `scripts/check-hosted-model-revisions.ts` (D744). A
11153
+ * node records the revision it downloaded next to the file
11154
+ * (`<file>.revision`); a copy with no record or a different one is stale
11155
+ * unless its weight file hashes to the revision, and a stale copy is
11156
+ * downloaded again, the old one serving until the new one is complete. No
11157
+ * revision at all ⇒ a file on disk is current, whatever it holds (D743).
11158
+ */
11159
+ revision: string().min(1).optional()
11160
+ });
11161
+ /**
11162
+ * What a node holds for one (model, format) (D746). `current` is a complete
11163
+ * copy at its catalog revision — exactly what `downloaded: true` means.
11164
+ * `stale` is bytes on disk that are not (yet) proven current under D743/D744:
11165
+ * no or a different revision record, or a missing sibling. `missing` is no
11166
+ * copy. `downloaded` alone folds `stale` into "not downloaded", which hid
11167
+ * reclaimable bytes and a copy about to be replaced.
11168
+ */
11169
+ var ModelOnDiskStateSchema = _enum([
11170
+ "current",
11171
+ "stale",
11172
+ "missing"
11173
+ ]);
11174
+ /**
11175
+ * The numeric precision of one format's BUILD (D746) — reported only when the
11176
+ * build states it (file-name token, an INT8 variant, an EdgeTPU compile, a
11177
+ * CamStack Core ML export). Absent means "not stated", never "fp32".
11178
+ */
11179
+ var ModelFormatPrecisionSchema = _enum([
11180
+ "fp32",
11181
+ "fp16",
11182
+ "int8"
11183
+ ]);
11184
+ /**
11185
+ * One format of one model as a node's `pipelineExecutor.getSchema` reports it.
11186
+ * `onDisk` / `precision` are optional for version skew: a runner that predates
11187
+ * them omits them, and a reader falls back to `downloaded`.
11188
+ */
11189
+ var PipelineModelFormatStatusSchema = object({
11190
+ downloaded: boolean(),
11191
+ sizeMB: number(),
11192
+ onDisk: ModelOnDiskStateSchema.optional(),
11193
+ precision: ModelFormatPrecisionSchema.optional()
10618
11194
  });
10619
11195
  /**
10620
11196
  * Extra file that must be downloaded alongside the model (e.g., labels JSON, dict.txt).
@@ -10728,25 +11304,36 @@ var ModelLicenseSchema = preprocess((value) => typeof value === "string" ? { wei
10728
11304
  * - `crop`: the root draws the box the step would have found (`license_plate`
10729
11305
  * for plate-detection, `face` for face-detection). The box becomes a detail
10730
11306
  * child of the `parentMacro` detection that contains it — never a track.
11307
+ * - `mask`: the root's decode emits an instance mask with every detection (a
11308
+ * YOLO26-seg root, D737) — the `segmentation` step's result, carried on the
11309
+ * detection in the shape that step produces. Derived from the model's
11310
+ * postprocessor on read, never stored by an import.
10731
11311
  */
10732
- var RootStepSupplySchema = discriminatedUnion("kind", [object({
10733
- kind: literal("label"),
10734
- stepId: _enum(LABEL_SUPPLY_STEP_IDS),
10735
- labelToEffect: record(string(), string()),
10736
- uncovered: array(string()).readonly()
10737
- }), object({
10738
- kind: literal("crop"),
10739
- stepId: _enum(CROP_SUPPLY_STEP_IDS),
10740
- rootLabels: array(string()).readonly(),
10741
- parentMacro: _enum(["vehicle", "person"]),
10742
- childClass: _enum(["plate", "face"]),
10743
- /**
10744
- * The root's smaller input side, stamped on read by `rootSuppliesOf` from
10745
- * the model entry — what a step's `minRootInputPx` gate judges. Never
10746
- * stored by an import.
10747
- */
10748
- rootInputPx: number().int().positive().optional()
10749
- })]);
11312
+ var RootStepSupplySchema = discriminatedUnion("kind", [
11313
+ object({
11314
+ kind: literal("label"),
11315
+ stepId: _enum(LABEL_SUPPLY_STEP_IDS),
11316
+ labelToEffect: record(string(), string()),
11317
+ uncovered: array(string()).readonly()
11318
+ }),
11319
+ object({
11320
+ kind: literal("crop"),
11321
+ stepId: _enum(CROP_SUPPLY_STEP_IDS),
11322
+ rootLabels: array(string()).readonly(),
11323
+ parentMacro: _enum(["vehicle", "person"]),
11324
+ childClass: _enum(["plate", "face"]),
11325
+ /**
11326
+ * The root's smaller input side, stamped on read by `rootSuppliesOf` from
11327
+ * the model entry — what a step's `minRootInputPx` gate judges. Never
11328
+ * stored by an import.
11329
+ */
11330
+ rootInputPx: number().int().positive().optional()
11331
+ }),
11332
+ object({
11333
+ kind: literal("mask"),
11334
+ stepId: _enum(MASK_SUPPLY_STEP_IDS)
11335
+ })
11336
+ ]);
10750
11337
  var ModelCatalogEntrySchema = object({
10751
11338
  id: string(),
10752
11339
  name: string(),
@@ -10812,6 +11399,35 @@ var ModelCatalogEntrySchema = object({
10812
11399
  */
10813
11400
  defaultConfidence: number().min(0).max(1).optional(),
10814
11401
  /**
11402
+ * Per-MODEL default of the per-class confidence floors (`minConfidence<Macro>`
11403
+ * on a detector step), keyed by macro class: `{ person: 0.45 }`. A class
11404
+ * absent here runs at the step slider's global default. The same row shape
11405
+ * the floor measurement produces (`model-floors.json`: modelId → floors), so
11406
+ * a measured table is copied in as-is. An operator override is bound to the
11407
+ * model it was made for and does not survive a model change (D738). A custom
11408
+ * / imported model may declare it; without it, the global defaults apply.
11409
+ */
11410
+ defaultClassFloors: record(string(), number().min(0).max(1)).optional(),
11411
+ /**
11412
+ * The inference precision this model's OpenVINO IR needs on an Intel GPU.
11413
+ * Absent ⇒ the device default (f16 on a GPU). Set to `'f32'` for an FP32 IR
11414
+ * that produces invalid output at f16 — measured 2026-10-07 for YOLO26
11415
+ * base IRs (`yolo26s`: 0 true / 146 false positives; `yolo26m*`: NaN
11416
+ * scores) on the Core Ultra iGPU and the N100. Threaded to the pool as
11417
+ * `PoolModelConfig.gpuInferencePrecision`; the pool sets
11418
+ * INFERENCE_PRECISION_HINT on a GPU only. Costs ~60% latency on the GPU.
11419
+ */
11420
+ gpuInferencePrecision: _enum(["f32", "f16"]).optional(),
11421
+ /**
11422
+ * ROOT detectors only: per supplied step (`animal-classifier`, …), the
11423
+ * minimum DETECTION score from which this root's own fine label (species,
11424
+ * vehicle type — D736 root supply) is taken (D741). Below it the detection
11425
+ * keeps its macro class without the fine label. `1` = never take it from
11426
+ * this root. Absent ⇒ no floor beyond the macro floor. The supplied step's
11427
+ * `minConfidence` slider, bound to the ROOT model, overrides it.
11428
+ */
11429
+ suppliedLabelFloors: record(string(), number().min(0).max(1)).optional(),
11430
+ /**
10815
11431
  * When true, the executor produces a landmark-aligned crop (similarity warp
10816
11432
  * onto the canonical template) before this step runs, instead of a plain
10817
11433
  * axis-aligned bbox crop. Required for face-recognition embedders (ArcFace):
@@ -12535,13 +13151,6 @@ var BrokerRtspClientSchema = object({
12535
13151
  lastRtpAt: number(),
12536
13152
  bytesSent: number()
12537
13153
  });
12538
- var BrokerDecodedClientSchema = object({
12539
- tag: string(),
12540
- subscribedAt: number(),
12541
- maxFps: number(),
12542
- framesDelivered: number(),
12543
- framesDropped: number()
12544
- });
12545
13154
  var BrokerAudioClientSchema = object({
12546
13155
  tag: string(),
12547
13156
  subscribedAt: number(),
@@ -12633,7 +13242,6 @@ var BrokerEncodedClientSchema = object({
12633
13242
  });
12634
13243
  var BrokerClientsSchema = object({
12635
13244
  rtsp: array(BrokerRtspClientSchema).readonly(),
12636
- decoded: array(BrokerDecodedClientSchema).readonly(),
12637
13245
  audio: array(BrokerAudioClientSchema).readonly(),
12638
13246
  encoded: array(BrokerEncodedClientSchema).readonly(),
12639
13247
  pipeClients: number(),
@@ -13002,11 +13610,7 @@ method(object({
13002
13610
  auth: "admin"
13003
13611
  }), method(object({ brokerId: string() }), BrokerClientsSchema), method(object({
13004
13612
  brokerId: string(),
13005
- channel: _enum([
13006
- "rtsp",
13007
- "decoded",
13008
- "audio"
13009
- ]),
13613
+ channel: _enum(["rtsp", "audio"]),
13010
13614
  handle: string()
13011
13615
  }), object({ killed: boolean() }), {
13012
13616
  kind: "mutation",
@@ -13041,10 +13645,7 @@ method(object({
13041
13645
  }), method(SubscribeAudioChunksInputSchema, SubscribeAudioChunksResultSchema, { kind: "mutation" }), method(object({
13042
13646
  subscriptionId: string(),
13043
13647
  maxCount: number().int().positive().default(8)
13044
- }), array(DecodedAudioChunkSchema).readonly()), method(object({ subscriptionId: string() }), object({ released: boolean() }), { kind: "mutation" }), method(SubscribeFramesInputSchema, SubscribeFramesResultSchema, { kind: "mutation" }), method(object({
13045
- subscriptionId: string(),
13046
- maxCount: number().int().positive().default(4)
13047
- }), array(FrameHandleSchema).readonly()), method(object({ subscriptionId: string() }), object({ released: boolean() }), { kind: "mutation" }), method(object({
13648
+ }), array(DecodedAudioChunkSchema).readonly()), method(object({ subscriptionId: string() }), object({ released: boolean() }), { kind: "mutation" }), method(object({
13048
13649
  brokerId: string(),
13049
13650
  seconds: number().min(0).max(30)
13050
13651
  }), _void(), {
@@ -14202,53 +14803,201 @@ id: union([string(), number()]) }), {
14202
14803
  auth: "admin"
14203
14804
  });
14204
14805
  /**
14205
- * shm ring usage stats for a `frameSink: 'shm'` decoder session —
14206
- * exposed via `decoder.getShmStats` so downstream consumers can
14207
- * observe ring pressure (slot count, byte budget, hit/miss ratio).
14806
+ * `keychain` — the hub's encrypted store of secret values (D787).
14807
+ *
14808
+ * Settings blobs never hold a secret: they hold a marker
14809
+ * `{"$secret":"secret://<owner>/<scope>/<fieldPath>","v":1}` and the value
14810
+ * lives here, AES-256-GCM under a data key that a master key wraps. This cap
14811
+ * is the OWNER's door to its own values: every method is owner-checked
14812
+ * against the CALLER, never against anything the caller claims.
14813
+ *
14814
+ * Who the caller is: the transport stamps `callerAddonId` into the args of a
14815
+ * call that crossed a process (the parent `LocalChildRegistry` from the UDS
14816
+ * connection, the agent from its child's connection carried in
14817
+ * `$hub-cap-fwd`'s envelope). A stamp always overwrites; a wire call with no
14818
+ * stamp has its claim stripped. Only a hub in-process caller may state its own
14819
+ * identity — `ctx.secrets` does that with the addon id closed over. This is
14820
+ * identity against BUGS and misrouting, not against a malicious addon (every
14821
+ * runner is the same OS user): see the threat model in
14822
+ * `docs/design/2026-10-08-secrets-keychain.md`.
14823
+ *
14824
+ * `callerAddonId` is deliberately NOT in any input schema: the tRPC router
14825
+ * parses the input, so a session can never supply it, and the internal mount
14826
+ * floors every method to admin anyway (D240).
14827
+ *
14828
+ * Internal: addons reach it through `ctx.secrets`, never directly.
14208
14829
  */
14209
- var ShmRingStatsSchema = object({
14210
- sessionId: string(),
14211
- slotCount: number().int(),
14212
- slotByteLength: number().int(),
14213
- segmentBytes: number().int(),
14214
- budgetMb: number().int(),
14215
- framesWritten: number().int(),
14216
- getFrameHits: number().int(),
14217
- getFrameMisses: number().int()
14218
- });
14219
- method(object({ codec: string() }), boolean()), method(_void(), object({
14830
+ /** Why a value cannot be served right now. Never folded into "missing". */
14831
+ var KeychainUnavailableReasonSchema = _enum([
14832
+ "key-missing",
14833
+ "wrong-key",
14834
+ "key-file-unreadable",
14835
+ "store-unavailable",
14836
+ "not-initialized",
14837
+ "decrypt-failed"
14838
+ ]);
14839
+ var KeychainStateSchema = discriminatedUnion("state", [object({ state: literal("ready") }), object({
14840
+ state: literal("locked"),
14841
+ reason: KeychainUnavailableReasonSchema
14842
+ })]);
14843
+ var KeychainResolveEntrySchema = discriminatedUnion("kind", [
14844
+ object({
14845
+ kind: literal("value"),
14846
+ value: string(),
14847
+ version: number().int()
14848
+ }),
14849
+ object({ kind: literal("missing") }),
14850
+ object({
14851
+ kind: literal("unavailable"),
14852
+ reason: KeychainUnavailableReasonSchema
14853
+ }),
14854
+ object({ kind: literal("forbidden") })
14855
+ ]);
14856
+ var KeychainResolveResultSchema = record(string(), KeychainResolveEntrySchema);
14857
+ /** Metadata of one stored value — never the value. */
14858
+ var KeychainSecretMetaSchema = object({
14859
+ ref: string(),
14860
+ owner: string(),
14861
+ /** Formatted scope (`global`, `node/<id>`, `device/<id>`, …). */
14862
+ scope: string(),
14863
+ fieldPath: string(),
14864
+ version: number().int(),
14865
+ createdAt: number(),
14866
+ updatedAt: number(),
14867
+ /** `addon:<id>` | `user:<id>` | `system`. */
14868
+ updatedBy: string(),
14869
+ /** Coarse — written at most once an hour per ref. `null` = never read. */
14870
+ lastReadAt: number().nullable()
14871
+ });
14872
+ var RefListSchema = array(string().min(1)).max(512);
14873
+ method(object({
14874
+ ref: string().min(1),
14875
+ value: string().min(1)
14876
+ }), object({
14877
+ ref: string(),
14878
+ version: number().int()
14879
+ }), {
14880
+ kind: "mutation",
14881
+ auth: "admin"
14882
+ }), method(object({ refs: RefListSchema }), KeychainResolveResultSchema, { auth: "admin" }), method(object({ refs: RefListSchema }), object({ deleted: number().int() }), {
14883
+ kind: "mutation",
14884
+ auth: "admin"
14885
+ }), method(object({}), array(KeychainSecretMetaSchema).readonly(), { auth: "admin" }), method(object({}), KeychainStateSchema, { auth: "admin" });
14886
+ var KeychainKeySourceSchema = object({
14887
+ kind: _enum([
14888
+ "config-file",
14889
+ "previous-config-file",
14890
+ "platform",
14891
+ "default-file"
14892
+ ]),
14893
+ /** File sources only — a path is not a secret. */
14894
+ path: string().optional(),
14895
+ /**
14896
+ * True when a whole-volume backup of the data directory carries this key
14897
+ * next to the database it protects (the default file). The page warns.
14898
+ */
14899
+ sharesBackupWithDatabase: boolean()
14900
+ });
14901
+ var KeychainStatusSchema = object({
14902
+ keychain: KeychainStateSchema,
14903
+ /** The source of the master key in use; `null` while locked. */
14904
+ keySource: KeychainKeySourceSchema.nullable(),
14905
+ /** The source configured to be primary — differs from `keySource` while a rotation is pending. */
14906
+ configuredSource: KeychainKeySourceSchema,
14907
+ /** Short fingerprint of the master key in use (`HMAC(KEK, label)`, 16 hex). */
14908
+ fingerprint: string().nullable(),
14909
+ activeKeyId: string().nullable(),
14910
+ /**
14911
+ * The keychain unlocked with a NON-primary source: the configured primary
14912
+ * key is not the one that wraps the data key yet. `rotateMasterKey` moves it.
14913
+ */
14914
+ rotationPending: boolean(),
14915
+ /** Wrapped copies of the data key under a previous master key, kept until purged. */
14916
+ retiredWraps: number().int(),
14917
+ recoveryKeyDownloadedAt: number().nullable(),
14918
+ secretCount: number().int()
14919
+ });
14920
+ /**
14921
+ * Whether a stored value is still pointed at by its owner's settings.
14922
+ * `unknown` is a first-class answer: a scope whose blob could not be read is
14923
+ * never reported as an orphan (and never deleted as one).
14924
+ */
14925
+ var KeychainSecretUsageSchema = _enum([
14926
+ "in-use",
14927
+ "orphan",
14928
+ "unknown"
14929
+ ]);
14930
+ var KeychainAdminSecretSchema = KeychainSecretMetaSchema.extend({ usage: KeychainSecretUsageSchema });
14931
+ var KeychainAuditActionSchema = _enum([
14932
+ "put",
14933
+ "delete",
14934
+ "reveal",
14935
+ "rotate-master-key",
14936
+ "purge-retired-keys",
14937
+ "download-recovery-key",
14938
+ "delete-orphans",
14939
+ "reset",
14940
+ "initialize"
14941
+ ]);
14942
+ var KeychainAuditEntrySchema = object({
14943
+ id: string(),
14944
+ at: number(),
14945
+ action: KeychainAuditActionSchema,
14946
+ /** `addon:<id>` | `user:<id>` | `system`. */
14947
+ actor: string(),
14948
+ ref: string().nullable(),
14949
+ detail: string().nullable()
14950
+ });
14951
+ 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({
14952
+ value: string(),
14953
+ version: number().int()
14954
+ }), {
14955
+ kind: "mutation",
14956
+ auth: "admin",
14957
+ caller: "required"
14958
+ }), method(object({ refs: array(string().min(1)).max(1e3) }), object({
14959
+ deleted: array(string()).readonly(),
14960
+ kept: array(object({
14961
+ ref: string(),
14962
+ usage: KeychainSecretUsageSchema
14963
+ })).readonly()
14964
+ }), {
14965
+ kind: "mutation",
14966
+ auth: "admin",
14967
+ caller: "required"
14968
+ }), method(object({}), object({
14969
+ fingerprint: string(),
14970
+ keySource: KeychainKeySourceSchema
14971
+ }), {
14972
+ kind: "mutation",
14973
+ auth: "admin",
14974
+ caller: "required"
14975
+ }), method(object({}), object({ purged: number().int() }), {
14976
+ kind: "mutation",
14977
+ auth: "admin",
14978
+ caller: "required"
14979
+ }), method(object({}), object({
14980
+ key: string(),
14981
+ fingerprint: string(),
14982
+ keySource: KeychainKeySourceSchema
14983
+ }), {
14984
+ kind: "mutation",
14985
+ auth: "admin",
14986
+ caller: "required"
14987
+ }), method(object({ confirm: literal("RESET KEYCHAIN") }), object({
14988
+ archivedCollection: string().nullable(),
14989
+ archived: number().int()
14990
+ }), {
14991
+ kind: "mutation",
14992
+ auth: "admin",
14993
+ caller: "required"
14994
+ });
14995
+ method(_void(), object({
14220
14996
  id: string(),
14221
14997
  name: string(),
14222
- isPullMode: boolean().optional(),
14223
- priority: number().optional(),
14224
14998
  hwaccel: string().optional(),
14225
14999
  probedBestHwaccel: string().optional()
14226
- })), method(DecoderSessionConfigSchema, object({
14227
- sessionId: string(),
14228
- nodeId: string()
14229
- })), method(object({ sessionId: string() }), _void()), method(object({
14230
- sessionId: string(),
14231
- packet: EncodedPacketSchema
14232
- }), _void()), method(object({
14233
- sessionId: string(),
14234
- url: string()
14235
- }), _void()), method(object({
14236
- sessionId: string(),
14237
- maxCount: number().default(1),
14238
- waitMs: number().optional()
14239
- }), array(DecodedFrameSchema)), method(object({
14240
- sessionId: string(),
14241
- maxCount: number().default(1),
14242
- waitMs: number().optional()
14243
- }), array(FrameHandleSchema)), method(object({ handle: FrameHandleSchema }), DecodedFrameSchema.nullable()), method(object({ sessionId: string() }), ShmRingStatsSchema.nullable()), method(object({
14244
- sessionId: string(),
14245
- config: DecoderSessionConfigSchema.partial()
14246
- }), _void()), method(object({ sessionId: string() }), DecoderStatsSchema), method(_void(), array(object({
14247
- sessionId: string(),
14248
- codec: string(),
14249
- outputFormat: string(),
14250
- createdAtMs: number()
14251
- })).readonly()), method(_void(), object({ backend: string() }), {
15000
+ })), method(_void(), object({ backend: string() }), {
14252
15001
  kind: "mutation",
14253
15002
  auth: "admin"
14254
15003
  });
@@ -15060,6 +15809,10 @@ var DeviceInfoSchema = object({
15060
15809
  isCamera: boolean(),
15061
15810
  /** Current config values — serializable snapshot */
15062
15811
  config: record(string(), unknown()),
15812
+ /** Paths inside `config` the device's schema declares secret (D783) —
15813
+ * what the non-admin redaction withholds. Paths, never values. Absent
15814
+ * when the owning runner has not reported them. */
15815
+ secretConfigPaths: array(string()).optional(),
15063
15816
  /** Hardware + identity blob (manufacturer / model / firmware / sn /
15064
15817
  * uid / mac / …). Populated by drivers; editable via setMetadata. */
15065
15818
  metadata: record(string(), unknown()).nullable().optional(),
@@ -15265,12 +16018,22 @@ var DeviceRegisterPayloadSchema = object({
15265
16018
  * call (workers re-register on init), so probe-driven updates
15266
16019
  * (e.g. PTZ flag flipping after the abilities probe) propagate. */
15267
16020
  features: array(string()).optional(),
15268
- config: record(string(), unknown())
16021
+ config: record(string(), unknown()),
16022
+ /** Config paths the device's own schema DECLARES secret
16023
+ * (`.meta({ secret: true })` — dotted, `[]` for array items, e.g.
16024
+ * `connection.password`). Re-published on every register; the non-admin
16025
+ * redaction withholds them at any depth (D783). Optional: an older runner
16026
+ * omits it and the keyword backstop applies. */
16027
+ secretConfigPaths: array(string()).optional()
15269
16028
  });
15270
16029
  var DeviceRemovePayloadSchema = object({ deviceId: number() });
15271
16030
  var DevicePersistConfigPayloadSchema = object({
15272
16031
  deviceId: number(),
15273
- data: record(string(), unknown())
16032
+ data: record(string(), unknown()),
16033
+ /** The paths the device's schema declares secret (D783), when the caller
16034
+ * knows them — those values are kept in the keychain, not the blob (D787).
16035
+ * Absent: the paths the device last reported at `registerDevice` apply. */
16036
+ secretConfigPaths: array(string()).optional()
15274
16037
  });
15275
16038
  /** What a migration actually did, per switch. `unreachable` is a first-class
15276
16039
  * answer: a camera that could not be asked is not a camera that was silenced. */
@@ -16924,7 +17687,14 @@ var LoginMethodContributionSchema = discriminatedUnion("kind", [
16924
17687
  icon: string().optional(),
16925
17688
  /** Addon-owned HTTP route the button navigates to (GET). */
16926
17689
  startUrl: string(),
16927
- stage: LoginStageEnum
17690
+ stage: LoginStageEnum,
17691
+ /**
17692
+ * The provider names an external identity a signed-in user can link to
17693
+ * their own account (D782): `auth.listLinkableProviders` /
17694
+ * `beginExternalLink` offer exactly the redirect methods that set this,
17695
+ * whatever their id. Absent / false — a login button only (magic-link).
17696
+ */
17697
+ linkable: boolean().optional()
16928
17698
  }),
16929
17699
  object({
16930
17700
  kind: literal("widget"),
@@ -21276,8 +22046,8 @@ Object.freeze(Object.fromEntries([{
21276
22046
  var CLUSTER_STEP_SETTING_FIELDS = [{
21277
22047
  stepId: "face-embedding",
21278
22048
  key: "minLandmarkFaceSize",
21279
- label: "Min face size for recognition (detection px)",
21280
- 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.",
22049
+ label: "Min face size to embed (detection-frame px)",
22050
+ 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.",
21281
22051
  type: "slider",
21282
22052
  min: 0,
21283
22053
  max: 64,
@@ -22250,8 +23020,23 @@ var RetrainMacroClassSchema = _enum([
22250
23020
  ]);
22251
23021
  /** A subject to learn, or a phantom to unlearn (taught by OMISSION). */
22252
23022
  var RetrainAnnotationKindSchema = _enum(["subject", "model_error"]);
22253
- /** Did a human draw this box, or did the assist propose it? */
22254
- var RetrainAnnotationSourceSchema = _enum(["operator", "assist"]);
23023
+ /**
23024
+ * Where a box came from. A machine-sourced box is a DRAFT on the page until
23025
+ * the operator confirms it; once saved it keeps its source as provenance.
23026
+ *
23027
+ * - `operator` — drawn by hand.
23028
+ * - `assist` — proposed by a detector run on the copy (the camera's own
23029
+ * model, or a larger teacher model).
23030
+ * - `pipeline` — the box the live pipeline actually drew on that frame, read
23031
+ * back from the track store (never a re-run).
23032
+ * - `llm` — proposed by a vision-capable LLM profile.
23033
+ */
23034
+ var RetrainAnnotationSourceSchema = _enum([
23035
+ "operator",
23036
+ "assist",
23037
+ "pipeline",
23038
+ "llm"
23039
+ ]);
22255
23040
  /** Normalised `[0,1]` rectangle against the FULL frame — the canonical form. */
22256
23041
  var RetrainBboxSchema = object({
22257
23042
  x: number(),
@@ -22269,7 +23054,8 @@ var RetrainBboxSchema = object({
22269
23054
  */
22270
23055
  var RetrainAnnotationSchema = object({
22271
23056
  id: string(),
22272
- trackId: string(),
23057
+ /** The frame's track. Absent on a recording still, which has none. */
23058
+ trackId: string().optional(),
22273
23059
  deviceId: number(),
22274
23060
  /** The COPY in retrain storage — never the source track's media key. */
22275
23061
  mediaKey: string(),
@@ -22318,18 +23104,63 @@ var RetrainFrameCandidateSchema = object({
22318
23104
  * fail, whatever became of the original. */
22319
23105
  copied: boolean()
22320
23106
  });
23107
+ /**
23108
+ * One box the live pipeline drew on a copied frame — what a correction starts
23109
+ * from. Derived when the frame is listed, from the track store: the subject
23110
+ * box recorded on the source media row when there is one, else the track
23111
+ * position nearest the frame's capture time. Never stored as an annotation
23112
+ * until the operator confirms it.
23113
+ */
23114
+ var RetrainPipelineBoxSchema = object({
23115
+ /** Normalised `[0,1]` against the full frame. */
23116
+ bbox: RetrainBboxSchema,
23117
+ macroClass: RetrainMacroClassSchema,
23118
+ label: string().optional(),
23119
+ subLabel: string().optional(),
23120
+ /** The detection score of the position used, when it was recorded. */
23121
+ score: number().optional(),
23122
+ /** The root model that produced the track, when it was recorded. */
23123
+ modelId: string().optional(),
23124
+ trackId: string(),
23125
+ /** `subject-box`: recorded on this very frame. `position`: the track's
23126
+ * position nearest the capture time, `deltaMs` away. */
23127
+ basis: _enum(["subject-box", "position"]),
23128
+ deltaMs: number()
23129
+ });
23130
+ /**
23131
+ * Where a retrain frame came from: a TRACK's stored media (copy-on-select),
23132
+ * or the RECORDING at an instant — the frame a model saw nothing in has no
23133
+ * track at all.
23134
+ */
23135
+ var RetrainFrameOriginSchema = _enum(["track", "recording"]);
22321
23136
  /** A frame the dataset OWNS: bytes copied at selection time. */
22322
23137
  var RetrainFrameSchema = object({
22323
23138
  frameId: string(),
22324
23139
  deviceId: number(),
22325
- trackId: string(),
22326
- /** Provenance only. It may already point at nothing — that is expected. */
22327
- sourceMediaId: number().int(),
23140
+ origin: RetrainFrameOriginSchema,
23141
+ /** The track it was copied from. Absent on a recording still. */
23142
+ trackId: string().optional(),
23143
+ /** Provenance only. It may already point at nothing — that is expected.
23144
+ * Absent on a recording still. */
23145
+ sourceMediaId: number().int().optional(),
23146
+ /** A recording still: the playhead instant it was taken at. */
23147
+ epochMs: number().optional(),
22328
23148
  sourceKind: MediaFileKindEnum,
22329
23149
  sizeBytes: number().int(),
22330
23150
  width: number().int(),
22331
23151
  height: number().int(),
22332
- copiedAt: number()
23152
+ copiedAt: number(),
23153
+ /** When the CAMERA captured the frame. Absent on a copy taken before D785. */
23154
+ capturedAt: number().optional(),
23155
+ /** The operator's "every subject in this frame is boxed". Detector
23156
+ * evaluation keeps only complete frames: an unboxed subject would count as
23157
+ * a false positive. */
23158
+ complete: boolean(),
23159
+ /** The boxes the pipeline drew on this frame. Present on list answers;
23160
+ * empty when nothing the track store holds can be placed on it. */
23161
+ pipelineBoxes: array(RetrainPipelineBoxSchema).readonly().optional(),
23162
+ /** The named collections this frame belongs to. Present on list answers. */
23163
+ collectionIds: array(string()).readonly().optional()
22333
23164
  });
22334
23165
  /** Why a copy-on-select could not be honoured — named, never a silent skip. */
22335
23166
  var RetrainCopyRefusalSchema = _enum([
@@ -22350,6 +23181,53 @@ var RetrainFrameListSchema = object({
22350
23181
  /** What the page pre-selects — the native key frame when one survives. */
22351
23182
  autoPickMediaId: number().int().optional()
22352
23183
  });
23184
+ /**
23185
+ * Which frames an annotated export carries. Every field narrows; an empty
23186
+ * filter is every annotated copy. A dataset VERSION is a frozen `frameIds`
23187
+ * list owned by whoever trains (the training orchestrator), so `frameIds` is
23188
+ * the primitive a version export uses; `batchId` re-selects what an earlier
23189
+ * export carried (`exportedInBatch`).
23190
+ */
23191
+ var RetrainExportFilterSchema = object({
23192
+ deviceIds: array(number()).optional(),
23193
+ frameIds: array(string()).max(2e4).optional(),
23194
+ /** Only frames in at least one of these named collections. */
23195
+ collectionIds: array(string()).max(200).optional(),
23196
+ batchId: string().optional(),
23197
+ /** Only frames the operator marked complete (all subjects boxed). */
23198
+ completeOnly: boolean().optional()
23199
+ });
23200
+ /**
23201
+ * `frames`: the full frame copies, boxes in `annotations.json`.
23202
+ * `crops`: additionally one JPEG per subject, cut with the runtime detail-crop
23203
+ * convention — the classifier layout.
23204
+ */
23205
+ var RetrainExportLayoutSchema = _enum(["frames", "crops"]);
23206
+ /**
23207
+ * Where `writeRetrainArchive` streams the tar: one HTTP request whose body is
23208
+ * the archive, sent chunk by chunk. Covers a presigned PUT and a provider
23209
+ * addon's data-plane upload route alike. Headers are sent verbatim and never
23210
+ * logged.
23211
+ */
23212
+ var RetrainArchiveTargetSchema = object({
23213
+ kind: literal("http"),
23214
+ method: _enum(["PUT", "POST"]),
23215
+ url: string().url(),
23216
+ headers: record(string(), string()).optional()
23217
+ });
23218
+ var RetrainArchiveResultSchema = object({
23219
+ batchId: string(),
23220
+ frames: number().int(),
23221
+ crops: number().int(),
23222
+ annotations: number().int(),
23223
+ /** Frames planned but not shipped (unreadable copy, path too long). */
23224
+ missing: number().int(),
23225
+ bytes: number().int(),
23226
+ /** sha256 of the exact bytes sent. */
23227
+ sha256: string(),
23228
+ /** The target's HTTP status. */
23229
+ status: number().int()
23230
+ });
22353
23231
  /** What the operator asked the assist to look for. */
22354
23232
  var RetrainAssistSubjectSchema = discriminatedUnion("kind", [object({
22355
23233
  kind: literal("package"),
@@ -22379,6 +23257,109 @@ var RetrainAssistResultSchema = discriminatedUnion("kind", [object({
22379
23257
  reason: string(),
22380
23258
  detail: string().optional()
22381
23259
  })]);
23260
+ /** A named set over the retrain corpus — membership only, it owns no pixels. */
23261
+ var RetrainCollectionSchema = object({
23262
+ id: string(),
23263
+ name: string(),
23264
+ createdAt: number(),
23265
+ frameCount: number().int()
23266
+ });
23267
+ var RetrainCollectionCreateResultSchema = discriminatedUnion("kind", [object({
23268
+ kind: literal("created"),
23269
+ collection: RetrainCollectionSchema
23270
+ }), object({
23271
+ kind: literal("refused"),
23272
+ reason: _enum(["empty-name", "duplicate-name"])
23273
+ })]);
23274
+ var RetrainCollectionRenameResultSchema = discriminatedUnion("kind", [object({
23275
+ kind: literal("renamed"),
23276
+ collection: RetrainCollectionSchema
23277
+ }), object({
23278
+ kind: literal("refused"),
23279
+ reason: _enum([
23280
+ "empty-name",
23281
+ "duplicate-name",
23282
+ "unknown-collection"
23283
+ ])
23284
+ })]);
23285
+ /**
23286
+ * The outcome of adding the frame at a recording instant. Every refusal is
23287
+ * named: `still-unavailable` (not recording, a gap, or an undecodable frame —
23288
+ * `detail` says which), `still-busy` (the recorder is at its decode bound; try
23289
+ * again), `unreadable-image`, `write-failed`, `unknown-collection`.
23290
+ */
23291
+ var AddRetrainFrameFromRecordingResultSchema = discriminatedUnion("kind", [object({
23292
+ kind: literal("added"),
23293
+ collectionId: string(),
23294
+ frame: RetrainFrameSchema,
23295
+ /** The moment was already in the dataset; nothing was decoded. */
23296
+ reused: boolean()
23297
+ }), object({
23298
+ kind: literal("refused"),
23299
+ reason: _enum([
23300
+ "unknown-collection",
23301
+ "still-unavailable",
23302
+ "still-busy",
23303
+ "unreadable-image",
23304
+ "write-failed"
23305
+ ]),
23306
+ detail: string().optional()
23307
+ })]);
23308
+ /** A vision LLM profile the AI assist may use, and where it sends the frame. */
23309
+ var RetrainAssistProfileSchema = object({
23310
+ id: string(),
23311
+ name: string(),
23312
+ model: string(),
23313
+ kind: string(),
23314
+ /** `true` when the frame would leave the house (a cloud vendor, or an
23315
+ * endpoint that is not on the local network). The page confirms each such
23316
+ * run, and the provider refuses one without `allowCloud`. */
23317
+ leavesHouse: boolean()
23318
+ });
23319
+ /** A box the AI assist proposed: a draft, plus the model's own reason. */
23320
+ var RetrainLlmProposalSchema = RetrainAnnotationDraftSchema.extend({ reason: string() });
23321
+ /** What the AI assist said about a box that was already on the canvas. */
23322
+ var RetrainLlmReviewSchema = object({
23323
+ /** The `ref` the page sent the box under. */
23324
+ ref: string(),
23325
+ verdict: _enum([
23326
+ "confirmed",
23327
+ "wrong-class",
23328
+ "not-an-object",
23329
+ "uncertain"
23330
+ ]),
23331
+ suggestedClass: RetrainMacroClassSchema.optional(),
23332
+ reason: string()
23333
+ });
23334
+ /**
23335
+ * The AI assist's answer. `proposed` carries drafts (`source: 'llm'`, the
23336
+ * model and its confidence) and reviews; items the model got wrong (a box off
23337
+ * the frame, an unasked class, an unknown ref) are dropped and counted in
23338
+ * `rejected`. A whole answer that is not the schema is `malformed-answer`.
23339
+ */
23340
+ var RetrainLlmAssistResultSchema = discriminatedUnion("kind", [object({
23341
+ kind: literal("proposed"),
23342
+ profileId: string(),
23343
+ model: string(),
23344
+ /** The frame was sent outside the house for this answer. */
23345
+ leftHouse: boolean(),
23346
+ proposals: array(RetrainLlmProposalSchema).readonly(),
23347
+ reviews: array(RetrainLlmReviewSchema).readonly(),
23348
+ rejected: number().int()
23349
+ }), object({
23350
+ kind: literal("refused"),
23351
+ reason: _enum([
23352
+ "unknown-frame",
23353
+ "unreadable-frame",
23354
+ "unknown-profile",
23355
+ "profile-disabled",
23356
+ "no-vision",
23357
+ "cloud-not-confirmed",
23358
+ "llm-error",
23359
+ "malformed-answer"
23360
+ ]),
23361
+ detail: string().optional()
23362
+ })]);
22382
23363
  /** The outcome of a lifecycle move owned by the retrain page. */
22383
23364
  var RetrainTransitionResultSchema = object({
22384
23365
  trackId: string(),
@@ -23096,7 +24077,7 @@ DeviceType.Camera, method(object({ deviceId: number() }), array(TrackSchema).rea
23096
24077
  auth: "admin"
23097
24078
  }), method(object({
23098
24079
  deviceId: number(),
23099
- trackId: string(),
24080
+ trackId: string().optional(),
23100
24081
  frameId: string()
23101
24082
  }), object({
23102
24083
  removed: boolean(),
@@ -23113,7 +24094,8 @@ DeviceType.Camera, method(object({ deviceId: number() }), array(TrackSchema).rea
23113
24094
  auth: "admin"
23114
24095
  }), method(object({
23115
24096
  deviceId: number(),
23116
- trackId: string(),
24097
+ /** The frame's track, when it has one — checked against the frame. */
24098
+ trackId: string().optional(),
23117
24099
  frameId: string(),
23118
24100
  subject: RetrainAssistSubjectSchema,
23119
24101
  /** Which node runs it. Absent ⇒ wherever an unowned call lands. */
@@ -23121,12 +24103,16 @@ DeviceType.Camera, method(object({ deviceId: number() }), array(TrackSchema).rea
23121
24103
  }), RetrainAssistResultSchema, {
23122
24104
  kind: "mutation",
23123
24105
  auth: "admin"
23124
- }), method(object({ trackId: string() }), array(RetrainAnnotationSchema).readonly(), {
24106
+ }), method(object({
24107
+ trackId: string().optional(),
24108
+ frameIds: array(string()).max(2e3).optional()
24109
+ }), array(RetrainAnnotationSchema).readonly(), {
23125
24110
  kind: "query",
23126
24111
  auth: "admin"
23127
24112
  }), method(object({
23128
24113
  deviceId: number(),
23129
- trackId: string(),
24114
+ /** The frame's track, when it has one — checked against the frame. */
24115
+ trackId: string().optional(),
23130
24116
  frameId: string(),
23131
24117
  annotations: array(RetrainAnnotationDraftSchema)
23132
24118
  }), array(RetrainAnnotationSchema).readonly(), {
@@ -23144,7 +24130,91 @@ DeviceType.Camera, method(object({ deviceId: number() }), array(TrackSchema).rea
23144
24130
  }), RetrainTransitionResultSchema, {
23145
24131
  kind: "mutation",
23146
24132
  auth: "admin"
23147
- }), method(object({ deviceIds: array(number()).optional() }), object({ url: string() }), {
24133
+ }), method(RetrainExportFilterSchema.extend({ layout: RetrainExportLayoutSchema.optional() }), object({ url: string() }), {
24134
+ kind: "query",
24135
+ auth: "admin"
24136
+ }), method(object({
24137
+ deviceId: number(),
24138
+ trackId: string().optional(),
24139
+ frameId: string(),
24140
+ complete: boolean()
24141
+ }), RetrainFrameSchema, {
24142
+ kind: "mutation",
24143
+ auth: "admin"
24144
+ }), method(object({
24145
+ filter: RetrainExportFilterSchema,
24146
+ layout: RetrainExportLayoutSchema,
24147
+ target: RetrainArchiveTargetSchema
24148
+ }), RetrainArchiveResultSchema, {
24149
+ kind: "mutation",
24150
+ auth: "admin",
24151
+ timeoutMs: 60 * 6e4
24152
+ }), method(object({}), array(RetrainAssistProfileSchema).readonly(), {
24153
+ kind: "query",
24154
+ auth: "admin"
24155
+ }), method(object({
24156
+ deviceId: number(),
24157
+ trackId: string().optional(),
24158
+ frameId: string(),
24159
+ profileId: string(),
24160
+ classes: array(RetrainMacroClassSchema).min(1),
24161
+ boxes: array(object({
24162
+ ref: string(),
24163
+ bbox: RetrainBboxSchema,
24164
+ macroClass: RetrainMacroClassSchema,
24165
+ label: string().optional()
24166
+ })).max(50),
24167
+ allowCloud: boolean()
24168
+ }), RetrainLlmAssistResultSchema, {
24169
+ kind: "mutation",
24170
+ auth: "admin",
24171
+ timeoutMs: 18e4
24172
+ }), method(object({ name: string().max(120) }), RetrainCollectionCreateResultSchema, {
24173
+ kind: "mutation",
24174
+ auth: "admin"
24175
+ }), method(object({}), array(RetrainCollectionSchema).readonly(), {
24176
+ kind: "query",
24177
+ auth: "admin"
24178
+ }), method(object({
24179
+ id: string(),
24180
+ name: string().max(120)
24181
+ }), RetrainCollectionRenameResultSchema, {
24182
+ kind: "mutation",
24183
+ auth: "admin"
24184
+ }), method(object({ id: string() }), object({
24185
+ deleted: boolean(),
24186
+ removedFrames: number().int()
24187
+ }), {
24188
+ kind: "mutation",
24189
+ auth: "admin"
24190
+ }), method(object({
24191
+ collectionId: string(),
24192
+ deviceId: number(),
24193
+ epochMs: number()
24194
+ }), AddRetrainFrameFromRecordingResultSchema, {
24195
+ kind: "mutation",
24196
+ auth: "admin",
24197
+ timeoutMs: 6e4
24198
+ }), method(object({
24199
+ collectionId: string(),
24200
+ frameIds: array(string()).min(1).max(500)
24201
+ }), object({
24202
+ added: number().int(),
24203
+ alreadyMember: number().int(),
24204
+ unknownFrameIds: array(string()).readonly()
24205
+ }), {
24206
+ kind: "mutation",
24207
+ auth: "admin"
24208
+ }), method(object({
24209
+ collectionId: string(),
24210
+ frameId: string()
24211
+ }), object({
24212
+ removed: boolean(),
24213
+ deletedFrame: boolean()
24214
+ }), {
24215
+ kind: "mutation",
24216
+ auth: "admin"
24217
+ }), method(object({ collectionId: string() }), array(RetrainFrameSchema).readonly(), {
23148
24218
  kind: "query",
23149
24219
  auth: "admin"
23150
24220
  }), method(object({
@@ -23272,7 +24342,7 @@ var FrameRefSchema = object({
23272
24342
  timestamp: number(),
23273
24343
  capturedAt: number().optional()
23274
24344
  });
23275
- var ModelFormatSchema$1 = _enum([
24345
+ var ModelFormatSchema$2 = _enum([
23276
24346
  "onnx",
23277
24347
  "coreml",
23278
24348
  "openvino",
@@ -23290,7 +24360,7 @@ var PipelineSlotSchema = _enum([
23290
24360
  var PipelineEngineChoiceSchema = object({
23291
24361
  runtime: literal("python"),
23292
24362
  backend: string(),
23293
- format: ModelFormatSchema$1,
24363
+ format: ModelFormatSchema$2,
23294
24364
  device: string().optional()
23295
24365
  });
23296
24366
  /**
@@ -23329,28 +24399,10 @@ var PipelineDefaultStepSchema = lazy(() => object({
23329
24399
  group: string().optional(),
23330
24400
  settings: record(string(), unknown()).optional()
23331
24401
  }));
23332
- var PipelineTemplateStepSchema = lazy(() => object({
23333
- addonId: string(),
23334
- enabled: boolean(),
23335
- modelId: string(),
23336
- children: array(PipelineTemplateStepSchema).readonly(),
23337
- settings: record(string(), unknown()).optional()
23338
- }));
23339
- var PipelineTemplateSchema$1 = object({
23340
- id: string(),
23341
- name: string(),
23342
- createdAt: string(),
23343
- updatedAt: string(),
23344
- engine: PipelineEngineChoiceSchema,
23345
- steps: array(PipelineTemplateStepSchema).readonly()
23346
- });
23347
24402
  var PipelineModelOptionSchema = object({
23348
24403
  id: string(),
23349
24404
  name: string(),
23350
- formats: record(string(), object({
23351
- downloaded: boolean(),
23352
- sizeMB: number()
23353
- })),
24405
+ formats: record(string(), PipelineModelFormatStatusSchema),
23354
24406
  group: ModelVariantGroupSchema.optional(),
23355
24407
  legacy: boolean().optional(),
23356
24408
  provider: ModelProviderIdSchema.optional(),
@@ -23517,6 +24569,22 @@ method(_void(), array(PipelineEngineChoiceSchema)), method(_void(), PipelineEngi
23517
24569
  }), {
23518
24570
  kind: "mutation",
23519
24571
  auth: "admin"
24572
+ }), method(object({
24573
+ nodeId: string(),
24574
+ deviceIds: array(number()).readonly().optional(),
24575
+ dryRun: boolean()
24576
+ }), object({
24577
+ entries: array(object({
24578
+ deviceId: number(),
24579
+ keys: array(string()).readonly()
24580
+ })).readonly(),
24581
+ refused: array(object({
24582
+ deviceId: number(),
24583
+ reason: string()
24584
+ })).readonly()
24585
+ }), {
24586
+ kind: "mutation",
24587
+ auth: "admin"
23520
24588
  }), method(object({ nodeId: string() }), object({ unhealthy: array(object({
23521
24589
  /** `<backend>:<device>`, e.g. `openvino:gpu`. */
23522
24590
  deviceKey: string(),
@@ -23542,22 +24610,14 @@ method(_void(), array(PipelineEngineChoiceSchema)), method(_void(), PipelineEngi
23542
24610
  }), method(_void(), PipelineSchemaSchema), method(_void(), array(PipelineDefaultStepSchema).readonly().nullable()), method(_void(), PipelineConfigBridge), method(_void(), ConfigUISchemaBridge), method(object({
23543
24611
  steps: array(PipelineStepInputSchema),
23544
24612
  deviceKey: string().optional()
23545
- }), PipelineValidationResultSchema), method(_void(), array(PipelineTemplateSchema$1).readonly()), method(object({
23546
- name: string(),
23547
- steps: array(PipelineTemplateStepSchema).readonly(),
23548
- engine: PipelineEngineChoiceSchema
23549
- }), PipelineTemplateSchema$1, { kind: "mutation" }), method(object({
23550
- id: string(),
23551
- name: string().optional(),
23552
- steps: array(PipelineTemplateStepSchema).readonly().optional()
23553
- }), PipelineTemplateSchema$1, { kind: "mutation" }), method(object({ id: string() }), _void(), { kind: "mutation" }), method(_void(), InferenceCapabilitiesBridge), method(object({ addonId: string() }), ModelAvailabilityListBridge), method(object({
24613
+ }), PipelineValidationResultSchema), method(_void(), InferenceCapabilitiesBridge), method(object({ addonId: string() }), ModelAvailabilityListBridge), method(object({
23554
24614
  addonId: string(),
23555
24615
  modelId: string(),
23556
- format: ModelFormatSchema$1
24616
+ format: ModelFormatSchema$2
23557
24617
  }), DownloadModelResultSchema, { kind: "mutation" }), method(object({
23558
24618
  addonId: string(),
23559
24619
  modelId: string(),
23560
- format: ModelFormatSchema$1
24620
+ format: ModelFormatSchema$2
23561
24621
  }), object({ success: literal(true) }), { kind: "mutation" }), method(object({
23562
24622
  steps: array(PipelineStepInputSchema).min(1),
23563
24623
  frame: FrameInputSchema.optional(),
@@ -23714,6 +24774,763 @@ method(_void(), array(PipelineEngineChoiceSchema)), method(_void(), PipelineEngi
23714
24774
  filename: string().optional(),
23715
24775
  settings: record(string(), unknown()).optional()
23716
24776
  }), AudioTestResultSchema, { kind: "mutation" }), method(_void(), ConfigUISchemaNullableBridge);
24777
+ /**
24778
+ * The wire shapes of the Auto tune plan and apply (D745), used by the
24779
+ * `pipeline-orchestrator` cap. The recommender's own types
24780
+ * (`recommend.ts`) are the TS face of the same data; these
24781
+ * schemas are what crosses the cap boundary.
24782
+ */
24783
+ var ModelFormatSchema$1 = _enum(MODEL_FORMATS);
24784
+ /** The operator's range for it. */
24785
+ var MIN_SESSIONS_PER_DEVICE_RANGE = {
24786
+ min: 1,
24787
+ max: 8
24788
+ };
24789
+ var HardwareClassIdSchema = _enum([
24790
+ "intel-core-ultra",
24791
+ "intel-n-series",
24792
+ "apple-m-base",
24793
+ "apple-m-pro",
24794
+ "unknown"
24795
+ ]);
24796
+ var AcceleratorKindSchema = _enum([
24797
+ "intel-npu",
24798
+ "intel-igpu",
24799
+ "x86-cpu",
24800
+ "arm-cpu",
24801
+ "apple-ane",
24802
+ "coral"
24803
+ ]);
24804
+ var RecommendationReasonSchema = discriminatedUnion("kind", [
24805
+ object({
24806
+ kind: literal("capacity"),
24807
+ sessions: number(),
24808
+ minSessions: number()
24809
+ }),
24810
+ object({
24811
+ kind: literal("tie-faster"),
24812
+ over: string(),
24813
+ recallDelta: number()
24814
+ }),
24815
+ object({
24816
+ kind: literal("stepped-down"),
24817
+ from: string(),
24818
+ to: string(),
24819
+ limitedBy: string()
24820
+ }),
24821
+ object({
24822
+ kind: literal("no-fit-lightest"),
24823
+ sessions: number(),
24824
+ minSessions: number()
24825
+ }),
24826
+ object({
24827
+ kind: literal("derived-latency"),
24828
+ modelId: string()
24829
+ }),
24830
+ object({ kind: literal("cpu-device") }),
24831
+ object({ kind: literal("coral-untouched") }),
24832
+ object({ kind: literal("device-disabled") }),
24833
+ object({ kind: literal("device-unavailable") }),
24834
+ object({ kind: literal("node-offline") }),
24835
+ object({ kind: literal("no-hardware-facts") }),
24836
+ object({
24837
+ kind: literal("no-measured-data"),
24838
+ hardwareClass: HardwareClassIdSchema
24839
+ }),
24840
+ object({
24841
+ kind: literal("no-family-build"),
24842
+ format: ModelFormatSchema$1
24843
+ }),
24844
+ object({
24845
+ kind: literal("kept-custom-pin"),
24846
+ modelId: string(),
24847
+ deviceKey: string()
24848
+ })
24849
+ ]);
24850
+ /** Why a device is left exactly as it is, whatever the plan would pick (D786). */
24851
+ var KeptReasonSchema = _enum(["custom-pin"]);
24852
+ /**
24853
+ * Where a choice's latency came from (D791): this node's own benchmark
24854
+ * result, or the hardware-class table. Measured on the node beats the table.
24855
+ */
24856
+ var LatencySourceSchema = discriminatedUnion("kind", [object({ kind: literal("table") }), object({
24857
+ kind: literal("node-benchmark"),
24858
+ resultId: string(),
24859
+ measuredAtMs: number()
24860
+ })]);
24861
+ var DeviceModelChoiceSchema = object({
24862
+ modelId: string(),
24863
+ p50Ms: number(),
24864
+ fps: number(),
24865
+ measured: boolean(),
24866
+ /** Absent on a plan from before D791 — read as the table. */
24867
+ source: LatencySourceSchema.optional(),
24868
+ /** Parallel sessions at the camera rate with the headroom kept free: ⌊fps × (1 − headroom) / camera fps⌋. */
24869
+ capacitySessions: number(),
24870
+ personRecall: number()
24871
+ });
24872
+ var DeviceRecommendationSchema = object({
24873
+ deviceKey: string(),
24874
+ accelerator: AcceleratorKindSchema.nullable(),
24875
+ enabled: boolean(),
24876
+ available: boolean(),
24877
+ chosen: DeviceModelChoiceSchema.nullable(),
24878
+ /** Present when the device is kept as is: Apply writes nothing on it. */
24879
+ kept: KeptReasonSchema.optional(),
24880
+ reasons: array(RecommendationReasonSchema).readonly()
24881
+ });
24882
+ var NodeRecommendationSchema = object({
24883
+ nodeId: string(),
24884
+ reachable: boolean(),
24885
+ hardwareClass: HardwareClassIdSchema.nullable(),
24886
+ cpuModel: string().nullable(),
24887
+ skipped: boolean(),
24888
+ acceleratorModelId: string().nullable(),
24889
+ devices: array(DeviceRecommendationSchema).readonly(),
24890
+ reasons: array(RecommendationReasonSchema).readonly()
24891
+ });
24892
+ var ModelPinChangeSchema = object({
24893
+ stepId: string(),
24894
+ before: string().nullable(),
24895
+ after: string().nullable()
24896
+ });
24897
+ var NodeDeviceChangeSchema = object({
24898
+ nodeId: string(),
24899
+ deviceKey: string(),
24900
+ madeExplicit: boolean(),
24901
+ modelPins: array(ModelPinChangeSchema).readonly(),
24902
+ thresholds: array(object({
24903
+ stepId: string(),
24904
+ keys: array(string()).readonly()
24905
+ })).readonly()
24906
+ });
24907
+ var CameraOverrideClearSchema = object({
24908
+ deviceId: number(),
24909
+ source: _enum(["step-override", "wholesale"]),
24910
+ nodeId: string(),
24911
+ deviceKey: string().nullable(),
24912
+ stepId: string(),
24913
+ modelIdBefore: string().nullable(),
24914
+ keys: array(string()).readonly()
24915
+ });
24916
+ var DetectorStoreClearSchema = object({
24917
+ deviceId: number(),
24918
+ keys: array(string()).readonly()
24919
+ });
24920
+ var AutoTuneWarningSchema = discriminatedUnion("kind", [
24921
+ object({
24922
+ kind: literal("detector-store-cluster-wide"),
24923
+ skippedNodes: array(string()).readonly()
24924
+ }),
24925
+ object({
24926
+ kind: literal("detector-store-unreadable"),
24927
+ error: string()
24928
+ }),
24929
+ object({
24930
+ kind: literal("coral-enabled"),
24931
+ nodeId: string(),
24932
+ deviceKey: string()
24933
+ }),
24934
+ object({
24935
+ kind: literal("custom-pin-kept"),
24936
+ nodeId: string(),
24937
+ deviceKey: string().nullable(),
24938
+ deviceId: number().nullable(),
24939
+ modelId: string()
24940
+ }),
24941
+ object({
24942
+ kind: literal("custom-registry-unreadable"),
24943
+ error: string()
24944
+ })
24945
+ ]);
24946
+ var AutoTuneOptionsSchema = object({
24947
+ /** Share of each accelerator's throughput kept free (0.3–0.5). */
24948
+ headroom: number().min(.3).max(.5).default(.4),
24949
+ /**
24950
+ * The least number of parallel sessions every device must sustain at the
24951
+ * camera rate with the headroom kept free (D755). The most accurate model
24952
+ * that reaches it wins.
24953
+ */
24954
+ minSessionsPerDevice: number().int().min(MIN_SESSIONS_PER_DEVICE_RANGE.min).max(MIN_SESSIONS_PER_DEVICE_RANGE.max).default(2)
24955
+ });
24956
+ var AutoTunePlanSchema = object({
24957
+ /** Hash of everything the apply will write — the apply refuses a different one. */
24958
+ planHash: string(),
24959
+ family: literal("yolov9"),
24960
+ headroom: number(),
24961
+ minSessionsPerDevice: number(),
24962
+ /** The detection rate a session is counted at (the fastest camera running the pipeline root). */
24963
+ cameraFps: number(),
24964
+ generatedAt: number(),
24965
+ nodes: array(NodeRecommendationSchema).readonly(),
24966
+ nodeChanges: array(NodeDeviceChangeSchema).readonly(),
24967
+ cameraClears: array(CameraOverrideClearSchema).readonly(),
24968
+ detectorStoreClears: array(DetectorStoreClearSchema).readonly(),
24969
+ warnings: array(AutoTuneWarningSchema).readonly()
24970
+ });
24971
+ var AutoTuneApplyInputSchema = object({
24972
+ planHash: string(),
24973
+ headroom: number().min(.3).max(.5).default(.4),
24974
+ minSessionsPerDevice: number().int().min(MIN_SESSIONS_PER_DEVICE_RANGE.min).max(MIN_SESSIONS_PER_DEVICE_RANGE.max).default(2)
24975
+ });
24976
+ var AutoTunePhaseResultSchema = object({
24977
+ phase: _enum([
24978
+ "download",
24979
+ "camera-overrides",
24980
+ "detector-thresholds",
24981
+ "node-models",
24982
+ "redispatch"
24983
+ ]),
24984
+ ok: boolean(),
24985
+ detail: string()
24986
+ });
24987
+ var AutoTuneApplyResultSchema = discriminatedUnion("kind", [
24988
+ object({
24989
+ kind: literal("applied"),
24990
+ planHash: string(),
24991
+ phases: array(AutoTunePhaseResultSchema).readonly()
24992
+ }),
24993
+ object({
24994
+ kind: literal("aborted"),
24995
+ phases: array(AutoTunePhaseResultSchema).readonly()
24996
+ }),
24997
+ object({
24998
+ kind: literal("stale"),
24999
+ plan: AutoTunePlanSchema
25000
+ }),
25001
+ object({
25002
+ kind: literal("refused"),
25003
+ reason: _enum(["apply-in-progress"])
25004
+ })
25005
+ ]);
25006
+ /**
25007
+ * Wire shapes of the Load balancing surface (D748): the session placement
25008
+ * policy, the atomic share write, the observed placement statistics, the
25009
+ * hardware share suggestion and the stale device pins.
25010
+ */
25011
+ /**
25012
+ * How a new detection session picks its node and device.
25013
+ * - `least-loaded` — the historical rule: lowest `attached / weight`, a
25014
+ * constant node order at a tie (D37). An idle node always ties at 0, so a
25015
+ * weight only bites once a node already holds a session.
25016
+ * - `share` — the share of PARALLEL sessions is held to the weights, and a
25017
+ * full or drowning node yields to a free one (D748).
25018
+ */
25019
+ var SessionPlacementPolicySchema = _enum(["least-loaded", "share"]);
25020
+ var LoadBalancingSharesInputSchema = object({
25021
+ /** nodeId → share (> 0). A node left out keeps its weight. */
25022
+ nodes: record(string(), number().positive()).default({}),
25023
+ /** nodeId → deviceKey → share (> 0). A device left out keeps its weight. */
25024
+ devices: record(string(), record(string(), number().positive())).default({})
25025
+ });
25026
+ var PlacementStatsInputSchema = object({
25027
+ /** Window the observed shares are averaged over (default 1 h, max 24 h). */
25028
+ windowMs: number().int().min(6e4).max(1440 * 60 * 1e3).default(3600 * 1e3) });
25029
+ var PlacementDeviceStatsSchema = object({
25030
+ deviceKey: string(),
25031
+ /** Sessions running on this device now. */
25032
+ sessionsNow: number(),
25033
+ /** Sessions started on this device inside the window. */
25034
+ sessionsStarted: number(),
25035
+ /** Time-weighted share of the node's parallel sessions over the window (0–1); null = no session ran. */
25036
+ observedShare: number().nullable()
25037
+ });
25038
+ var PlacementNodeStatsSchema = object({
25039
+ nodeId: string(),
25040
+ sessionsNow: number(),
25041
+ sessionsStarted: number(),
25042
+ /** Time-weighted share of the cluster's parallel sessions over the window (0–1); null = none ran. */
25043
+ observedShare: number().nullable(),
25044
+ /** Most sessions this node ran at once inside the window. */
25045
+ peakSessions: number(),
25046
+ /** Sessions a share election handed elsewhere because this node was full or drowning. */
25047
+ yieldsAway: number(),
25048
+ devices: array(PlacementDeviceStatsSchema).readonly()
25049
+ });
25050
+ /** A camera's device pin that the session path cannot honour. */
25051
+ var StaleDevicePinSchema = object({
25052
+ deviceId: number(),
25053
+ deviceKey: string(),
25054
+ /** `disabled` — the key exists on some node but is not enabled anywhere; `absent` — no node has it. */
25055
+ reason: _enum(["disabled", "absent"])
25056
+ });
25057
+ var PlacementStatsSchema = object({
25058
+ policy: SessionPlacementPolicySchema,
25059
+ windowMs: number(),
25060
+ /** How much of the window was actually observed (the hub keeps it in memory). */
25061
+ observedForMs: number(),
25062
+ sessionsNow: number(),
25063
+ /** Most parallel sessions across the cluster inside the window. */
25064
+ clusterPeakSessions: number(),
25065
+ nodes: array(PlacementNodeStatsSchema).readonly(),
25066
+ stalePins: array(StaleDevicePinSchema).readonly()
25067
+ });
25068
+ /**
25069
+ * Where an automatic share's capacity comes from (D755).
25070
+ * - `hardware` — the static capacity of each device at its Auto tune model:
25071
+ * the measured latency table for the node's hardware class.
25072
+ * - `benchmark` — the node's own measured capacity (node benchmark results).
25073
+ * A node with no results falls back to `hardware`, and says so.
25074
+ */
25075
+ var CapacitySourceSchema = _enum(["hardware", "benchmark"]);
25076
+ /** Why a node under the `benchmark` source was sized from hardware instead. */
25077
+ var CapacityFallbackSchema = _enum(["no-benchmark-results", "partial-benchmark-results"]);
25078
+ var SuggestSharesInputSchema = object({
25079
+ headroom: number().min(.3).max(.5).default(.4),
25080
+ /** Default `hardware`. */
25081
+ source: CapacitySourceSchema.default("hardware")
25082
+ });
25083
+ var SuggestedDeviceShareSchema = object({
25084
+ deviceKey: string(),
25085
+ /** Share of the node (0–100, rounded). */
25086
+ share: number(),
25087
+ modelId: string().nullable(),
25088
+ /** Inferences per second at that model, from the measured table; null when sized by a benchmark. */
25089
+ fps: number().nullable(),
25090
+ /** False for a table cell derived from another chip; true for a measured cell or a benchmark. */
25091
+ measured: boolean(),
25092
+ /**
25093
+ * Advisory session cap: ⌊fps × (1 − headroom) / camera fps⌋ from the table,
25094
+ * or the benchmark's measured max sessions. Never enforced.
25095
+ */
25096
+ suggestedMaxSessions: number().nullable()
25097
+ });
25098
+ var SuggestedNodeShareSchema = object({
25099
+ nodeId: string(),
25100
+ /** Share of the cluster (0–100, rounded); null = node skipped (offline, unknown hardware). */
25101
+ share: number().nullable(),
25102
+ /** Parallel sessions the node sustains at the suggested models with the headroom kept free. */
25103
+ capacitySessions: number(),
25104
+ devices: array(SuggestedDeviceShareSchema).readonly(),
25105
+ skippedReason: string().nullable(),
25106
+ /** What this node's capacity was read from; null when the node is skipped. */
25107
+ capacitySource: CapacitySourceSchema.nullable(),
25108
+ /** Set when the `benchmark` source was asked for and this node used `hardware`. */
25109
+ capacityFallback: CapacityFallbackSchema.nullable()
25110
+ });
25111
+ var SuggestSharesResultSchema = object({
25112
+ headroom: number(),
25113
+ /** The source asked for; each node says what it actually used. */
25114
+ source: CapacitySourceSchema,
25115
+ /** Camera detection rate the capacity is counted in (the fastest camera's fps). */
25116
+ cameraFps: number(),
25117
+ /** The Auto tune capacity floor the models were picked at. */
25118
+ minSessionsPerDevice: number(),
25119
+ nodes: array(SuggestedNodeShareSchema).readonly()
25120
+ });
25121
+ /**
25122
+ * Where the node and device shares come from (D750, D755, D791).
25123
+ * - `benchmark` (default since D791) — each node's capacity as its own node
25124
+ * benchmark measured it; a node without fresh results is sized from
25125
+ * `hardware` and says so. Measured on the node beats the table.
25126
+ * - `hardware` — computed from each node's static capacity only (its
25127
+ * accelerators at their Auto tune models, from the latency table).
25128
+ * Both are recomputed whenever a node or device joins, leaves, is switched
25129
+ * on or off, changes model, or a benchmark result is written. No load input.
25130
+ * - `manual` — the operator's stored sliders.
25131
+ * Either way a node or device that cannot take sessions gives its share to
25132
+ * the others in proportion; the stored values are never rewritten for that.
25133
+ */
25134
+ var ShareSourceSchema = _enum([
25135
+ "hardware",
25136
+ "benchmark",
25137
+ "manual"
25138
+ ]);
25139
+ var SetShareSourceInputSchema = object({ source: ShareSourceSchema });
25140
+ object({
25141
+ nodes: record(string(), number()),
25142
+ devices: record(string(), record(string(), number()))
25143
+ });
25144
+ var EffectiveDeviceShareSchema = object({
25145
+ deviceKey: string(),
25146
+ /** Can take sessions now (enabled, available, can run the root). */
25147
+ eligible: boolean(),
25148
+ /** The share the source assigns, as a percentage of the node's devices. */
25149
+ configuredPct: number(),
25150
+ /** The share actually used, after an ineligible device's share went to the others. */
25151
+ effectivePct: number()
25152
+ });
25153
+ var EffectiveNodeShareSchema = object({
25154
+ nodeId: string(),
25155
+ eligible: boolean(),
25156
+ configuredPct: number(),
25157
+ effectivePct: number(),
25158
+ /** Automatic sources: what this node's share was computed from; null under `manual` or before the first answer. */
25159
+ capacitySource: CapacitySourceSchema.nullable(),
25160
+ /** Automatic `benchmark`: why this node used `hardware` instead. */
25161
+ capacityFallback: CapacityFallbackSchema.nullable(),
25162
+ devices: array(EffectiveDeviceShareSchema).readonly()
25163
+ });
25164
+ var EffectiveSharesSchema = object({
25165
+ source: ShareSourceSchema,
25166
+ policy: SessionPlacementPolicySchema,
25167
+ /** An automatic source with no computed answer yet: the stored sliders are used meanwhile. */
25168
+ autoPending: boolean(),
25169
+ /** When the automatic shares were last computed (ms epoch); null = never. */
25170
+ computedAt: number().nullable(),
25171
+ /** What made the system recompute them last. */
25172
+ trigger: string().nullable(),
25173
+ nodes: array(EffectiveNodeShareSchema).readonly(),
25174
+ /** The relative weights the election reads (before eligibility). */
25175
+ nodeWeights: record(string(), number()),
25176
+ deviceWeights: record(string(), record(string(), number()))
25177
+ });
25178
+ /**
25179
+ * Wire shapes of the node benchmark (D791): the operator's plan, the
25180
+ * preflight the confirmation shows, the run the orchestrator owns, what the
25181
+ * measuring runner reports, and the result rows Auto tune and the automatic
25182
+ * shares read.
25183
+ *
25184
+ * ONE node at a time, owned by the pipeline orchestrator. While a run is
25185
+ * active the cluster is in BENCHMARK MODE for that node: it is not a
25186
+ * detection candidate, camera pins naming it are ignored so its sessions move
25187
+ * elsewhere, and both come back when the mode ends — after a crash or a hub
25188
+ * restart too (a persisted manifest, reconciled against the registry).
25189
+ *
25190
+ * Two measurements, both on the node, driven by its own runner (frames never
25191
+ * cross a process at frame rate, D9):
25192
+ * - `device` — one accelerator × one candidate detector, root only, open
25193
+ * loop: how many streams at the camera rate it carries inside the frame
25194
+ * interval;
25195
+ * - `pipeline` — the chosen detector plus the operator's detail steps
25196
+ * (faces, plates, classifiers, CLIP…), on varied frames from the bench
25197
+ * clip: how many parallel sessions the node carries before latency, drops,
25198
+ * CPU, RAM or the event loop give out.
25199
+ */
25200
+ /** Defaults and bounds, one place. */
25201
+ var NODE_BENCHMARK_DEFAULTS = {
25202
+ fpsPerStream: 10,
25203
+ budgetMinutes: 45,
25204
+ minBudgetMinutes: 10,
25205
+ maxBudgetMinutes: 120,
25206
+ /** A result older than this no longer beats the table. */
25207
+ staleAfterDays: 30,
25208
+ /** Warm-in per ramp step (not accounted). */
25209
+ settleSec: 5,
25210
+ /** Accounted window per ramp step. */
25211
+ measureSec: 20,
25212
+ /** Longest the drain may take before the run is refused. */
25213
+ drainTimeoutSec: 120,
25214
+ /** Candidate models per device in one run. */
25215
+ maxModelsPerDevice: 6
25216
+ };
25217
+ /** The two measurements a run can make. */
25218
+ var NodeBenchmarkPhaseSchema = _enum(["device", "pipeline"]);
25219
+ var NodeBenchmarkDevicePlanSchema = object({
25220
+ /** `<backend>:<device>` — `openvino:npu`, `coreml:all`, `cpu`. */
25221
+ deviceKey: string().min(1),
25222
+ /**
25223
+ * Root detector candidates for the `device` measurement, in the order
25224
+ * measured. The FIRST is the one the `pipeline` measurement runs.
25225
+ */
25226
+ modelIds: array(string().min(1)).min(1).max(NODE_BENCHMARK_DEFAULTS.maxModelsPerDevice)
25227
+ });
25228
+ /** What the operator confirmed. */
25229
+ var NodeBenchmarkPlanSchema = object({
25230
+ nodeId: string().min(1),
25231
+ devices: array(NodeBenchmarkDevicePlanSchema).min(1),
25232
+ /** Which measurements run. At least one. */
25233
+ phases: array(NodeBenchmarkPhaseSchema).min(1).default(["device", "pipeline"]),
25234
+ /**
25235
+ * Detail steps (catalog step ids under the root: faces, plates,
25236
+ * classifiers, CLIP…) the `pipeline` measurement enables. The root
25237
+ * detector always runs.
25238
+ */
25239
+ steps: array(string().min(1)).default([]),
25240
+ /** Offered rate of one stream / session. */
25241
+ fpsPerStream: number().int().min(1).max(30).default(NODE_BENCHMARK_DEFAULTS.fpsPerStream),
25242
+ /** Hard deadline: the mode ends and the cluster is restored when it passes. */
25243
+ budgetMinutes: number().int().min(NODE_BENCHMARK_DEFAULTS.minBudgetMinutes).max(NODE_BENCHMARK_DEFAULTS.maxBudgetMinutes).default(NODE_BENCHMARK_DEFAULTS.budgetMinutes),
25244
+ /** Keep the models the run downloaded (default: delete what was not installed before). */
25245
+ keepDownloadedModels: boolean().default(false),
25246
+ /** Start although the other nodes' capacity does not cover the sessions running now. */
25247
+ acceptInsufficientHeadroom: boolean().default(false)
25248
+ });
25249
+ var NodeBenchmarkRefusalSchema = object({
25250
+ kind: _enum([
25251
+ "benchmark-active",
25252
+ "node-offline",
25253
+ "unknown-device",
25254
+ "no-phase",
25255
+ "insufficient-headroom"
25256
+ ]),
25257
+ detail: string(),
25258
+ overridable: boolean()
25259
+ });
25260
+ /** A camera whose detection leaves the node for the run. */
25261
+ var NodeBenchmarkMovingCameraSchema = object({
25262
+ deviceId: number(),
25263
+ /** Placed on the node now (a standing attach or a running session). */
25264
+ placedOnNode: boolean(),
25265
+ /** A node pin naming this node, ignored for the run. */
25266
+ pinnedToNode: boolean()
25267
+ });
25268
+ /** A camera that cannot leave: no other node can obtain its frames. */
25269
+ var NodeBenchmarkStayingCameraSchema = object({
25270
+ deviceId: number(),
25271
+ reason: literal("only-frame-source")
25272
+ });
25273
+ var NodeBenchmarkPreflightSchema = object({
25274
+ nodeId: string(),
25275
+ online: boolean(),
25276
+ moving: array(NodeBenchmarkMovingCameraSchema).readonly(),
25277
+ /** Keep running on the node during the run; the result is flagged contaminated. */
25278
+ staying: array(NodeBenchmarkStayingCameraSchema).readonly(),
25279
+ estimatedDurationMs: number(),
25280
+ /** The run ends and the cluster is restored at the latest after this long. */
25281
+ budgetMs: number(),
25282
+ phases: array(NodeBenchmarkPhaseSchema).readonly(),
25283
+ steps: array(string()).readonly(),
25284
+ devices: array(NodeBenchmarkDevicePlanSchema).readonly(),
25285
+ /** Parallel sessions the cluster runs now, and what the other nodes can carry. */
25286
+ headroom: object({
25287
+ sessionsNow: number(),
25288
+ otherNodesCapacitySessions: number().nullable()
25289
+ }),
25290
+ refusals: array(NodeBenchmarkRefusalSchema).readonly(),
25291
+ canStart: boolean()
25292
+ });
25293
+ /** Where the measuring runner is. */
25294
+ var NodeBenchProgressSchema = object({
25295
+ phase: _enum([
25296
+ "preparing",
25297
+ "device",
25298
+ "pipeline",
25299
+ "cleanup"
25300
+ ]),
25301
+ deviceKey: string().nullable(),
25302
+ modelId: string().nullable(),
25303
+ /** Streams (device) or sessions (pipeline) of the step running now. */
25304
+ load: number().nullable(),
25305
+ cellsDone: number(),
25306
+ cellsTotal: number(),
25307
+ message: string()
25308
+ });
25309
+ /** What limited a ramp. `none` = the ramp ran out of steps still passing. */
25310
+ var NodeBenchLimitSchema = _enum([
25311
+ "p95",
25312
+ "drops",
25313
+ "errors",
25314
+ "stall",
25315
+ "cpu",
25316
+ "ram",
25317
+ "none"
25318
+ ]);
25319
+ var NodeBenchRampStepSchema = object({
25320
+ load: number(),
25321
+ pass: boolean(),
25322
+ p95Ms: number(),
25323
+ dropRatio: number(),
25324
+ /** Completed frames per second over the accounted window. */
25325
+ fps: number(),
25326
+ cpuPct: number().nullable(),
25327
+ ramFreePct: number().nullable(),
25328
+ failReasons: array(string()).readonly()
25329
+ });
25330
+ var NodeBenchCellSchema = discriminatedUnion("phase", [object({
25331
+ phase: literal("device"),
25332
+ deviceKey: string(),
25333
+ modelId: string(),
25334
+ /** Single-stream latency (the K = 1 step). */
25335
+ p50Ms: number(),
25336
+ p95Ms: number(),
25337
+ p99Ms: number(),
25338
+ /** Frames per second sustained at the last passing step. */
25339
+ fps: number(),
25340
+ /** Streams at the camera rate the device carried inside the frame interval; 0 = not even one. */
25341
+ kMax: number(),
25342
+ limitedBy: NodeBenchLimitSchema,
25343
+ /** First call (model load + warm-up). */
25344
+ warmupMs: number(),
25345
+ ramp: array(NodeBenchRampStepSchema).readonly()
25346
+ }), object({
25347
+ phase: literal("pipeline"),
25348
+ deviceKey: string(),
25349
+ modelId: string(),
25350
+ steps: array(string()).readonly(),
25351
+ /** Parallel sessions at the camera rate the node carried; 0 = not even one. */
25352
+ maxSessions: number(),
25353
+ limitedBy: NodeBenchLimitSchema,
25354
+ /** Detail steps that produced at least one result on the clip — a step that never fired measured nothing. */
25355
+ stepsFired: array(string()).readonly(),
25356
+ warmupMs: number(),
25357
+ ramp: array(NodeBenchRampStepSchema).readonly()
25358
+ })]);
25359
+ /**
25360
+ * What a result was measured ON. A result whose fingerprint no longer matches
25361
+ * the node no longer beats the table.
25362
+ */
25363
+ var NodeBenchFingerprintSchema = object({
25364
+ pipelineVersion: string().nullable(),
25365
+ cpuModel: string().nullable(),
25366
+ ramGb: number().nullable(),
25367
+ os: string().nullable(),
25368
+ /** Per device: the pool the cells ran on (runtime + tuning). */
25369
+ pools: record(string(), object({
25370
+ runtime: string(),
25371
+ numWorkers: number(),
25372
+ concurrency: number(),
25373
+ batchMode: string()
25374
+ })).default({})
25375
+ });
25376
+ /** The frames the run used. */
25377
+ var NodeBenchClipSchema = object({
25378
+ /** `camstack-bench-v1` or `reference-images` (the fallback when the clip is not reachable). */
25379
+ id: string(),
25380
+ revision: string().nullable(),
25381
+ frames: number(),
25382
+ width: number(),
25383
+ height: number()
25384
+ });
25385
+ var NodeBenchRunnerInputSchema = object({
25386
+ runId: string().min(1),
25387
+ devices: array(NodeBenchmarkDevicePlanSchema).min(1),
25388
+ phases: array(NodeBenchmarkPhaseSchema).min(1),
25389
+ /** The full detail step tree root for the `pipeline` measurement is built on the node from these ids. */
25390
+ steps: array(string()).default([]),
25391
+ fpsPerStream: number().int().min(1).max(30),
25392
+ /** The runner stops on its own past this instant, whatever the hub does. */
25393
+ deadlineAtMs: number(),
25394
+ settleSec: number().min(0).max(60).default(NODE_BENCHMARK_DEFAULTS.settleSec),
25395
+ measureSec: number().min(2).max(300).default(NODE_BENCHMARK_DEFAULTS.measureSec),
25396
+ keepDownloadedModels: boolean().default(false)
25397
+ });
25398
+ var NodeBenchRunnerStateSchema = _enum([
25399
+ "running",
25400
+ "done",
25401
+ "failed",
25402
+ "aborted"
25403
+ ]);
25404
+ var NodeBenchRunnerStatusSchema = object({
25405
+ runId: string(),
25406
+ nodeId: string(),
25407
+ state: NodeBenchRunnerStateSchema,
25408
+ progress: NodeBenchProgressSchema.nullable(),
25409
+ /** Every finished cell so far — a run stopped half way keeps what it measured. */
25410
+ cells: array(NodeBenchCellSchema).readonly(),
25411
+ fingerprint: NodeBenchFingerprintSchema.nullable(),
25412
+ clip: NodeBenchClipSchema.nullable(),
25413
+ /** Cameras seen running on the node during the run (they share its pools). */
25414
+ activeCameraIds: array(number()).readonly(),
25415
+ /** Models the run downloaded and then deleted (not installed before). */
25416
+ deletedModels: array(string()).readonly(),
25417
+ error: string().nullable(),
25418
+ startedAtMs: number(),
25419
+ finishedAtMs: number().nullable()
25420
+ });
25421
+ var NodeBenchmarkStateSchema = _enum([
25422
+ "draining",
25423
+ "measuring",
25424
+ "restoring",
25425
+ "done",
25426
+ "failed",
25427
+ "aborted"
25428
+ ]);
25429
+ /** Why a run ended. */
25430
+ var NodeBenchmarkEndReasonSchema = _enum([
25431
+ "completed",
25432
+ "operator-abort",
25433
+ "deadline",
25434
+ "node-lost",
25435
+ "runner-lost",
25436
+ "hub-restart",
25437
+ "drain-timeout",
25438
+ "failed"
25439
+ ]);
25440
+ var NodeBenchmarkRunSchema = object({
25441
+ runId: string(),
25442
+ nodeId: string(),
25443
+ state: NodeBenchmarkStateSchema,
25444
+ plan: NodeBenchmarkPlanSchema,
25445
+ startedAtMs: number(),
25446
+ deadlineAtMs: number(),
25447
+ finishedAtMs: number().nullable(),
25448
+ endReason: NodeBenchmarkEndReasonSchema.nullable(),
25449
+ error: string().nullable(),
25450
+ /** Cameras moved off the node for the run. */
25451
+ moved: array(number()).readonly(),
25452
+ /** Cameras that stayed (their only frame source is the node). */
25453
+ staying: array(number()).readonly(),
25454
+ /** Something else ran on the node's pools during the run. */
25455
+ contaminated: boolean(),
25456
+ progress: NodeBenchProgressSchema.nullable(),
25457
+ resultIds: array(string()).readonly()
25458
+ });
25459
+ /** `getNodeBenchmarkStatus`: the active run (or the last one), and whether benchmark mode is on. */
25460
+ var NodeBenchmarkStatusSchema = object({
25461
+ /** The node the cluster is in benchmark mode for; null = none. */
25462
+ modeNodeId: string().nullable(),
25463
+ run: NodeBenchmarkRunSchema.nullable()
25464
+ });
25465
+ /**
25466
+ * One stored measurement — the only authority Auto tune and the automatic
25467
+ * shares read measured capacity from. Written by the orchestrator when a run
25468
+ * ends, never by anyone else.
25469
+ */
25470
+ var NodeBenchmarkResultSchema = object({
25471
+ id: string(),
25472
+ runId: string(),
25473
+ nodeId: string(),
25474
+ cell: NodeBenchCellSchema,
25475
+ fpsPerStream: number(),
25476
+ fingerprint: NodeBenchFingerprintSchema.nullable(),
25477
+ clip: NodeBenchClipSchema.nullable(),
25478
+ /** Other work shared the node's pools (a camera that could not move, or the hub's own duties). */
25479
+ contaminated: boolean(),
25480
+ stayingCameras: array(number()).readonly(),
25481
+ /** The run ended early; the cell itself completed. */
25482
+ partialRun: boolean(),
25483
+ measuredAtMs: number()
25484
+ });
25485
+ var ListNodeBenchmarkResultsInputSchema = object({
25486
+ nodeId: string().optional(),
25487
+ deviceKey: string().optional()
25488
+ });
25489
+ /** A result with its standing today: does it still beat the table? */
25490
+ var NodeBenchmarkResultViewSchema = NodeBenchmarkResultSchema.extend({
25491
+ /** `fresh` beats the table; `stale` falls back to it; `superseded` = a newer row covers the same cell. */
25492
+ standing: _enum([
25493
+ "fresh",
25494
+ "stale",
25495
+ "superseded"
25496
+ ]),
25497
+ staleWhy: _enum([
25498
+ "age",
25499
+ "runtime",
25500
+ "pool-tuning"
25501
+ ]).nullable()
25502
+ });
25503
+ object({
25504
+ runId: string(),
25505
+ nodeId: string(),
25506
+ startedAtMs: number(),
25507
+ deadlineAtMs: number(),
25508
+ plan: NodeBenchmarkPlanSchema,
25509
+ moved: array(number()).readonly(),
25510
+ staying: array(number()).readonly()
25511
+ });
25512
+ /** Candidate detectors per device, for the plan editor. */
25513
+ var NodeBenchmarkCandidatesSchema = object({
25514
+ nodeId: string(),
25515
+ reachable: boolean(),
25516
+ devices: array(object({
25517
+ deviceKey: string(),
25518
+ enabled: boolean(),
25519
+ available: boolean(),
25520
+ /** Ordered: what Auto tune would pick first, then the rest of the family by accuracy. */
25521
+ suggested: array(string()).readonly(),
25522
+ /** Every root detector the device has a build for. */
25523
+ all: array(string()).readonly(),
25524
+ /** The model the device runs now, when pinned. */
25525
+ currentModelId: string().nullable()
25526
+ })).readonly(),
25527
+ /** Detail steps the node's catalog offers under the root (for the `pipeline` measurement). */
25528
+ steps: array(object({
25529
+ id: string(),
25530
+ name: string(),
25531
+ slot: string()
25532
+ })).readonly()
25533
+ });
23717
25534
  object({
23718
25535
  activeCameras: number(),
23719
25536
  throttledCameras: number(),
@@ -24591,14 +26408,15 @@ var RunnerLocalLoadSchema = object({
24591
26408
  * Per-inference-device live load (multi-device C4). One entry per deviceKey
24592
26409
  * this runner currently has attached cameras on, so the orchestrator's second
24593
26410
  * `balance()` pass (over a node's devices) weights on real per-pool session
24594
- * counts. Empty on single-device / pre-multi-device runners. `queueDepthTotal`
24595
- * per device is 0 until the pool backlog gets a public accessor (follow-up).
26411
+ * counts. Empty on single-device / pre-multi-device runners. There is no
26412
+ * per-device queue depth: the inference pool's backlog has no accessor, and
26413
+ * a field that always read 0 was removed rather than shown as a measurement
26414
+ * (D762).
24596
26415
  */
24597
26416
  devices: array(object({
24598
26417
  deviceKey: string(),
24599
26418
  backend: string(),
24600
- attachedCameras: number(),
24601
- queueDepthTotal: number()
26419
+ attachedCameras: number()
24602
26420
  })).default([]),
24603
26421
  /** Hardware capability flags reported by this node. */
24604
26422
  hardware: object({
@@ -24801,7 +26619,16 @@ method(RunnerCameraConfigSchema, object({ success: literal(true) }), { kind: "mu
24801
26619
  }), ParkedTrackFrameSchema.nullable()), method(object({
24802
26620
  deviceId: number(),
24803
26621
  trackId: string()
24804
- }), object({ released: number().int().nonnegative() }), { kind: "mutation" });
26622
+ }), object({ released: number().int().nonnegative() }), { kind: "mutation" }), method(NodeBenchRunnerInputSchema, object({
26623
+ accepted: literal(true),
26624
+ runId: string()
26625
+ }), {
26626
+ kind: "mutation",
26627
+ auth: "admin"
26628
+ }), method(object({ runId: string() }), NodeBenchRunnerStatusSchema.nullable(), { auth: "admin" }), method(object({ runId: string() }), object({ aborted: boolean() }), {
26629
+ kind: "mutation",
26630
+ auth: "admin"
26631
+ });
24805
26632
  var CameraPipelineConfigSchema = object({
24806
26633
  engine: PipelineEngineChoiceSchema.optional(),
24807
26634
  steps: array(PipelineStepInputSchema).readonly(),
@@ -24812,14 +26639,6 @@ var CameraPipelineConfigSchema = object({
24812
26639
  settings: record(string(), unknown()).readonly().optional()
24813
26640
  }).nullable().optional()
24814
26641
  });
24815
- var PipelineTemplateSchema = object({
24816
- id: string(),
24817
- name: string(),
24818
- description: string().optional(),
24819
- config: CameraPipelineConfigSchema,
24820
- createdAt: string(),
24821
- updatedAt: string()
24822
- });
24823
26642
  var DeviceStepConfigSchema = object({
24824
26643
  modelId: string().optional(),
24825
26644
  settings: record(string(), unknown()).optional(),
@@ -24893,9 +26712,10 @@ var CameraStepOverridePatchSchema = object({
24893
26712
  modelId: string().optional(),
24894
26713
  settings: record(string(), unknown()).readonly().optional()
24895
26714
  });
26715
+ var CameraStepSettingsSchema = record(string(), record(string(), unknown()).readonly());
24896
26716
  var CameraPipelineSettingsSchema = object({
24897
- pinnedAgentNodeId: string().optional(),
24898
26717
  stepToggles: record(string(), boolean()).optional(),
26718
+ stepSettings: CameraStepSettingsSchema.optional(),
24899
26719
  stepOverridesByDevice: record(string(), record(string(), record(string(), CameraStepOverridePatchSchema))).optional(),
24900
26720
  pipelineByAgent: record(string(), CameraPipelineForAgentSchema).optional()
24901
26721
  });
@@ -24928,7 +26748,10 @@ var PipelineAssignmentSchema = object({
24928
26748
  });
24929
26749
  /**
24930
26750
  * Per-agent load summary surfaced to the load balancer + dashboards.
24931
- * Aggregated from each runner's `getLocalLoad` cap call.
26751
+ * Aggregated from each runner's `getLocalLoad` cap call. In the
26752
+ * `getAgentLoad` report, a single-device node's default-pool sessions (no
26753
+ * `deviceKey`) are credited to its one eligible device in `load.devices` —
26754
+ * the default pool IS that device (D745); the balancer's census stays raw.
24932
26755
  */
24933
26756
  var AgentLoadSummarySchema = object({
24934
26757
  nodeId: string(),
@@ -25017,26 +26840,27 @@ var CameraBrokerStatusSchema = object({
25017
26840
  width: number(),
25018
26841
  height: number(),
25019
26842
  subscribers: number(),
25020
- inFps: number(),
25021
- outFps: number()
26843
+ /**
26844
+ * Encoded packets/s the broker receives from the camera. null when the
26845
+ * broker's stats read failed — unknown, never 0 (a 0 here reads as a stall).
26846
+ * There is no output rate: decoding runs in the session decode workers, not
26847
+ * in the broker, so the broker's own decoded-frame rate is 0 on every live
26848
+ * camera and is not served (D758).
26849
+ */
26850
+ inFps: number().nullable()
25022
26851
  })).readonly(),
25023
26852
  webrtcSessions: number(),
25024
26853
  rtspRestream: boolean()
25025
26854
  });
25026
- /** Shared-memory ring statistics within the decoder block. */
25027
- var CameraDecoderShmSchema = object({
25028
- framesWritten: number(),
25029
- getFrameHits: number(),
25030
- getFrameMisses: number(),
25031
- budgetMb: number()
25032
- });
25033
- /** Decoder block — null when the decoder stage is unreachable or inactive. */
25034
- var CameraDecoderStatusSchema = object({
25035
- nodeId: string(),
25036
- formats: array(string()).readonly(),
25037
- sessionCount: number(),
25038
- shm: CameraDecoderShmSchema
25039
- });
26855
+ /**
26856
+ * Decoder block — WHERE decode runs (co-located with the detection node by
26857
+ * construction); null when the camera has no detection node. It carries no
26858
+ * frame counter: the shared-memory plane whose counters it used to serve is
26859
+ * gone, and those fields read 0 forever. Whether frames actually flow is read
26860
+ * from `detection.actualFps` (frames delivered to and processed by the
26861
+ * detector), never from a counter nothing feeds.
26862
+ */
26863
+ var CameraDecoderStatusSchema = object({ nodeId: string() });
25040
26864
  /** Motion block — null when motion detection is not active for this device. */
25041
26865
  var CameraMotionStatusSchema = object({
25042
26866
  enabled: boolean(),
@@ -25393,12 +27217,6 @@ method(object({
25393
27217
  }), object({ success: literal(true) }), {
25394
27218
  kind: "mutation",
25395
27219
  auth: "admin"
25396
- }), method(object({
25397
- agentNodeId: string(),
25398
- detectWeight: number().positive().nullable()
25399
- }), object({ success: literal(true) }), {
25400
- kind: "mutation",
25401
- auth: "admin"
25402
27220
  }), method(object({
25403
27221
  agentNodeId: string(),
25404
27222
  detect: boolean().nullable().optional(),
@@ -25440,6 +27258,30 @@ method(object({
25440
27258
  }), {
25441
27259
  kind: "mutation",
25442
27260
  auth: "admin"
27261
+ }), method(AutoTuneOptionsSchema, AutoTunePlanSchema, { auth: "admin" }), method(AutoTuneApplyInputSchema, AutoTuneApplyResultSchema, {
27262
+ kind: "mutation",
27263
+ auth: "admin"
27264
+ }), method(LoadBalancingSharesInputSchema, object({ success: literal(true) }), {
27265
+ kind: "mutation",
27266
+ auth: "admin"
27267
+ }), method(PlacementStatsInputSchema, PlacementStatsSchema, { auth: "admin" }), method(SuggestSharesInputSchema, SuggestSharesResultSchema, { auth: "admin" }), method(_void(), EffectiveSharesSchema, { auth: "admin" }), method(SetShareSourceInputSchema, object({ success: literal(true) }), {
27268
+ kind: "mutation",
27269
+ auth: "admin"
27270
+ }), method(NodeBenchmarkPlanSchema, NodeBenchmarkPreflightSchema, { auth: "admin" }), method(NodeBenchmarkPlanSchema, discriminatedUnion("kind", [object({
27271
+ kind: literal("started"),
27272
+ runId: string()
27273
+ }), object({
27274
+ kind: literal("refused"),
27275
+ preflight: NodeBenchmarkPreflightSchema
27276
+ })]), {
27277
+ kind: "mutation",
27278
+ auth: "admin"
27279
+ }), method(_void(), NodeBenchmarkStatusSchema, { auth: "admin" }), method(object({ runId: string() }), object({ aborted: boolean() }), {
27280
+ kind: "mutation",
27281
+ auth: "admin"
27282
+ }), method(object({ nodeId: string() }), NodeBenchmarkCandidatesSchema, { auth: "admin" }), method(ListNodeBenchmarkResultsInputSchema, array(NodeBenchmarkResultViewSchema).readonly(), { auth: "admin" }), method(object({ id: string() }), object({ deleted: boolean() }), {
27283
+ kind: "mutation",
27284
+ auth: "admin"
25443
27285
  }), method(object({ deviceId: number() }), CameraPipelineSettingsSchema.nullable()), method(object({
25444
27286
  deviceId: number(),
25445
27287
  addonId: string(),
@@ -25456,6 +27298,13 @@ method(object({
25456
27298
  }), object({ success: literal(true) }), {
25457
27299
  kind: "mutation",
25458
27300
  auth: "admin"
27301
+ }), method(object({
27302
+ deviceId: number(),
27303
+ addonId: string(),
27304
+ settings: record(string(), unknown()).nullable()
27305
+ }), object({ success: literal(true) }), {
27306
+ kind: "mutation",
27307
+ auth: "admin"
25459
27308
  }), method(object({
25460
27309
  deviceId: number(),
25461
27310
  agentNodeId: string(),
@@ -25479,25 +27328,7 @@ method(object({
25479
27328
  }), method(_void(), DiskReconcileJobSchema, {
25480
27329
  kind: "mutation",
25481
27330
  auth: "admin"
25482
- }), method(_void(), DiskReconcileJobSchema, { auth: "admin" }), method(_void(), array(PipelineTemplateSchema).readonly()), method(object({
25483
- name: string(),
25484
- description: string().optional(),
25485
- config: CameraPipelineConfigSchema
25486
- }), PipelineTemplateSchema, {
25487
- kind: "mutation",
25488
- auth: "admin"
25489
- }), method(object({
25490
- id: string(),
25491
- name: string().optional(),
25492
- description: string().optional(),
25493
- config: CameraPipelineConfigSchema.optional()
25494
- }), PipelineTemplateSchema, {
25495
- kind: "mutation",
25496
- auth: "admin"
25497
- }), method(object({ id: string() }), object({ success: literal(true) }), {
25498
- kind: "mutation",
25499
- auth: "admin"
25500
- });
27331
+ }), method(_void(), DiskReconcileJobSchema, { auth: "admin" });
25501
27332
  /**
25502
27333
  * Cap → event-kind mapping for the SENSOR / CONTROL cap families — the table
25503
27334
  * `pipeline-analytics.listEventKinds` uses to turn a linked device's bound
@@ -26087,7 +27918,19 @@ var SsoBridgeClaimsSchema = object({
26087
27918
  * editing a descriptor must not retroactively extend or shorten a link the
26088
27919
  * operator already consented to.
26089
27920
  */
26090
- refreshTtl: union([number().int().positive(), literal("never")]).optional()
27921
+ refreshTtl: union([number().int().positive(), literal("never")]).optional(),
27922
+ /**
27923
+ * Opaque handle of a hub-side LINK intent (D782). Set by an OIDC callback
27924
+ * that was started from a signed-in user's "Link" button: the finish then
27925
+ * links this identity to the intent's user instead of signing anyone in.
27926
+ * The handle carries no user id — the hub resolves it, single-use.
27927
+ */
27928
+ linkIntent: string().optional(),
27929
+ /**
27930
+ * Verified `iss` of the id_token behind an OIDC login bridge (D782). A
27931
+ * subject is unique only per issuer, so a link is bound to it.
27932
+ */
27933
+ issuer: string().optional()
26091
27934
  });
26092
27935
  method(object({
26093
27936
  claims: SsoBridgeClaimsSchema,
@@ -27752,8 +29595,6 @@ var WebrtcStreamChoiceSchema = object({
27752
29595
  ]).nullable(),
27753
29596
  /** Input FPS from the camera (null for adaptive). */
27754
29597
  inputFps: number().nullable(),
27755
- /** Decoded FPS (null for adaptive). */
27756
- decodeFps: number().nullable(),
27757
29598
  /** Bitrate in kbps (null for adaptive). */
27758
29599
  bitrateKbps: number().nullable()
27759
29600
  });
@@ -28030,7 +29871,22 @@ DeviceType.Camera, method(object({ deviceId: number().int().nonnegative() }), ar
28030
29871
  * field their hints were silently stripped by the schema and the
28031
29872
  * adaptive ladder started blind on the client's display size.
28032
29873
  */
28033
- hints: webrtcClientHintsSchema.optional()
29874
+ hints: webrtcClientHintsSchema.optional(),
29875
+ /**
29876
+ * Talk-back (D771): relay the PEER's audio to the device's speaker
29877
+ * through the `intercom` cap's push-talk triple. When `true` and the
29878
+ * offer lets the peer send audio, the answer's audio is `sendrecv`
29879
+ * and every inbound frame goes to `intercom.pushTalkAudio` for this
29880
+ * `deviceId`; absent/false answers `sendonly`, as for every viewer.
29881
+ *
29882
+ * TRUSTED-CALLER ONLY. Set by the Alexa export for an Echo on a camera
29883
+ * with `intercom`, when the linked user may control that camera. The
29884
+ * hub STRIPS it from every request-bound call (a browser), exactly as
29885
+ * it overwrites `relayOnly` — a viewer's talk permission is the
29886
+ * intercom cap's own surface (share tokens gate it there), and this
29887
+ * flag must not become a second door to the camera's speaker.
29888
+ */
29889
+ talkback: boolean().optional()
28034
29890
  }), object({
28035
29891
  sessionId: string(),
28036
29892
  sdpAnswer: string()
@@ -28332,6 +30188,59 @@ var AddonAutoUpdateSchema = ChannelWithInheritSchema;
28332
30188
  var RestartAddonResultSchema = unknown();
28333
30189
  var InstallPackageResultSchema = unknown();
28334
30190
  var ReloadPackagesResultSchema = unknown();
30191
+ /**
30192
+ * What an uninstall did on ONE node.
30193
+ * - `uninstalled` — removed: runner(s) stopped, caps gone, code deleted.
30194
+ * - `not-installed` — the node did not have it (nothing to do).
30195
+ * - `refused` — protected / bootstrap package; nothing touched.
30196
+ * - `failed` — attempted and did not complete; `error` says why.
30197
+ * - `pending-reconnect` — the node is OFFLINE: its record was pruned so the
30198
+ * back-fill never returns the package, and the stale-addon sweep removes the
30199
+ * copy when the node registers again (only once the hub no longer has it).
30200
+ */
30201
+ var UninstallNodeOutcomeSchema = _enum([
30202
+ "uninstalled",
30203
+ "not-installed",
30204
+ "refused",
30205
+ "failed",
30206
+ "pending-reconnect"
30207
+ ]);
30208
+ var UninstallNodeResultSchema = object({
30209
+ nodeId: string(),
30210
+ outcome: UninstallNodeOutcomeSchema,
30211
+ error: string().optional(),
30212
+ addonIds: array(string()).readonly(),
30213
+ runnersStopped: array(string()).readonly(),
30214
+ warnings: array(string()).readonly()
30215
+ });
30216
+ var UninstallPackageResultSchema = object({
30217
+ /** Every targeted node ended `uninstalled`, `not-installed` or `pending-reconnect`. */
30218
+ success: boolean(),
30219
+ packageName: string(),
30220
+ results: array(UninstallNodeResultSchema).readonly()
30221
+ });
30222
+ /**
30223
+ * `unreachable` lists online agents whose status read FAILED — absence from
30224
+ * `installations` is only "not installed" for a node that answered (D315).
30225
+ */
30226
+ var PackageInstallationsSchema = object({
30227
+ installations: array(object({
30228
+ packageName: string(),
30229
+ nodeId: string(),
30230
+ nodeName: string(),
30231
+ isHub: boolean(),
30232
+ isOnline: boolean(),
30233
+ version: string().nullable(),
30234
+ addonIds: array(string()).readonly(),
30235
+ source: _enum(["live", "recorded"]),
30236
+ /** The hub installs this package too. `false` on an agent row = an orphan. */
30237
+ onHub: boolean()
30238
+ })).readonly(),
30239
+ unreachable: array(object({
30240
+ nodeId: string(),
30241
+ error: string()
30242
+ })).readonly()
30243
+ });
28335
30244
  var BulkUpdateItemStatusSchema = _enum([
28336
30245
  "queued",
28337
30246
  "updating",
@@ -28414,10 +30323,14 @@ method(_void(), array(AddonListItemSchema).readonly()), method(object({
28414
30323
  }), method(object({ packageName: string() }), InstallPackageResultSchema, {
28415
30324
  kind: "mutation",
28416
30325
  auth: "admin"
28417
- }), method(_void(), boolean()), method(_void(), array(unknown()).readonly()), method(object({ packageName: string() }), unknown(), {
30326
+ }), method(_void(), boolean()), method(_void(), array(unknown()).readonly()), method(object({
30327
+ packageName: string().min(1),
30328
+ nodeId: string().optional(),
30329
+ everywhere: boolean().optional()
30330
+ }), UninstallPackageResultSchema, {
28418
30331
  kind: "mutation",
28419
30332
  auth: "admin"
28420
- }), method(_void(), ReloadPackagesResultSchema, {
30333
+ }), method(object({ packageName: string().optional() }), PackageInstallationsSchema, { auth: "admin" }), method(_void(), ReloadPackagesResultSchema, {
28421
30334
  kind: "mutation",
28422
30335
  auth: "admin"
28423
30336
  }), method(object({ query: string().optional() }), array(SearchResultSchema)), method(object({ nodeId: string().optional() }), array(PackageUpdateSchema).readonly(), { auth: "admin" }), method(object({
@@ -30485,6 +32398,9 @@ var CreateIntegrationInputSchema = object({
30485
32398
  enabled: boolean().optional(),
30486
32399
  info: record(string(), unknown()).optional(),
30487
32400
  settings: record(string(), unknown()).optional(),
32401
+ /** Keys of `settings` the form's schema declares secret (by type) — kept in
32402
+ * the keychain, not the table (D787). */
32403
+ secretKeys: array(string()).optional(),
30488
32404
  skipRestart: boolean().optional()
30489
32405
  });
30490
32406
  var UpdateIntegrationInputSchema = object({
@@ -30508,7 +32424,9 @@ method(_void(), array(IntegrationWithStateSchema)), method(object({ id: string()
30508
32424
  auth: "admin"
30509
32425
  }), method(object({ id: string() }), record(string(), unknown()), { auth: "admin" }), method(object({
30510
32426
  id: string(),
30511
- settings: record(string(), unknown())
32427
+ settings: record(string(), unknown()),
32428
+ /** Keys the form's schema declares secret (by type) — keychain-stored (D787). */
32429
+ secretKeys: array(string()).optional()
30512
32430
  }), object({ success: boolean() }), {
30513
32431
  kind: "mutation",
30514
32432
  auth: "admin"
@@ -36017,6 +37935,32 @@ var TotpStatusSchema = object({
36017
37935
  /** Null when no row exists OR the row is still pending confirmation. */
36018
37936
  confirmedAt: number().nullable()
36019
37937
  });
37938
+ /**
37939
+ * user-management — singleton capability for user accounts, API keys,
37940
+ * and scoped tokens.
37941
+ *
37942
+ * v2 model: every method gated by `auth: 'admin'`. Admin-only delegation
37943
+ * — the subset check on `setUserScopes` / `createScopedToken` is moot
37944
+ * because non-admins never reach these. If/when we open non-admin
37945
+ * delegation, structural caller-scope subset check goes inside the
37946
+ * provider.
37947
+ */
37948
+ var ExternalIdentitySchema = object({
37949
+ /** Login-method id of the provider instance, e.g. `auth-oidc/authentik`. */
37950
+ provider: string(),
37951
+ /** The IdP's stable subject (`sub`) for this account. */
37952
+ subject: string(),
37953
+ /** The verified `iss` of the IdP the identity was linked under — `sub` is unique only per issuer. */
37954
+ issuer: string(),
37955
+ userId: string(),
37956
+ /** What the IdP called the account at link time (username / email) — display only. */
37957
+ label: string().optional(),
37958
+ linkedAt: number()
37959
+ });
37960
+ var ExternalIdentityKeySchema = object({
37961
+ provider: string().min(1),
37962
+ subject: string().min(1)
37963
+ });
36020
37964
  method(_void(), array(UserSummarySchema), { auth: "admin" }), method(CreateUserInputSchema, UserSummarySchema, {
36021
37965
  kind: "mutation",
36022
37966
  auth: "admin",
@@ -36130,7 +38074,22 @@ method(_void(), array(UserSummarySchema), { auth: "admin" }), method(CreateUserI
36130
38074
  userId: string(),
36131
38075
  username: string(),
36132
38076
  scopes: array(TokenScopeSchema)
36133
- }).nullable(), { access: "view" }), method(_void(), array(OauthSessionSummarySchema), { auth: "admin" }), method(object({ id: string() }), object({ success: boolean() }), {
38077
+ }).nullable(), { access: "view" }), method(object({ userId: string() }), array(ExternalIdentitySchema), { auth: "admin" }), method(ExternalIdentityKeySchema, object({
38078
+ userId: string(),
38079
+ issuer: string()
38080
+ }).nullable(), { auth: "admin" }), method(ExternalIdentityKeySchema.extend({
38081
+ userId: string(),
38082
+ issuer: string().min(1),
38083
+ label: string().optional()
38084
+ }), object({ success: literal(true) }), {
38085
+ kind: "mutation",
38086
+ auth: "admin",
38087
+ access: "create"
38088
+ }), method(ExternalIdentityKeySchema.extend({ userId: string() }), object({ success: boolean() }), {
38089
+ kind: "mutation",
38090
+ auth: "admin",
38091
+ access: "delete"
38092
+ }), method(_void(), array(OauthSessionSummarySchema), { auth: "admin" }), method(object({ id: string() }), object({ success: boolean() }), {
36134
38093
  kind: "mutation",
36135
38094
  auth: "admin",
36136
38095
  access: "delete"
@@ -36522,6 +38481,16 @@ DeviceType.Camera, method(object({
36522
38481
  package: array(ZoneRuleSchema).readonly()
36523
38482
  });
36524
38483
  SOURCE_CAPS.filter((cap) => cap !== "switch" && cap !== "motion");
38484
+ Object.freeze({
38485
+ person: .5,
38486
+ vehicle: .5,
38487
+ animal: .5
38488
+ });
38489
+ Object.freeze({
38490
+ person: .65,
38491
+ vehicle: .65,
38492
+ animal: .65
38493
+ });
36525
38494
  /**
36526
38495
  * Accessory device helpers — shared across drivers.
36527
38496
  *
@@ -36696,6 +38665,12 @@ Object.freeze({
36696
38665
  addonId: null,
36697
38666
  access: "view"
36698
38667
  },
38668
+ "addons.listInstallations": {
38669
+ capName: "addons",
38670
+ capScope: "system",
38671
+ addonId: null,
38672
+ access: "view"
38673
+ },
36699
38674
  "addons.listJobs": {
36700
38675
  capName: "addons",
36701
38676
  capScope: "system",
@@ -37878,90 +39853,18 @@ Object.freeze({
37878
39853
  addonId: null,
37879
39854
  access: "create"
37880
39855
  },
37881
- "decoder.createSession": {
37882
- capName: "decoder",
37883
- capScope: "system",
37884
- addonId: null,
37885
- access: "view"
37886
- },
37887
- "decoder.destroySession": {
37888
- capName: "decoder",
37889
- capScope: "system",
37890
- addonId: null,
37891
- access: "delete"
37892
- },
37893
- "decoder.getFrame": {
37894
- capName: "decoder",
37895
- capScope: "system",
37896
- addonId: null,
37897
- access: "view"
37898
- },
37899
39856
  "decoder.getInfo": {
37900
39857
  capName: "decoder",
37901
39858
  capScope: "system",
37902
39859
  addonId: null,
37903
39860
  access: "view"
37904
39861
  },
37905
- "decoder.getShmStats": {
37906
- capName: "decoder",
37907
- capScope: "system",
37908
- addonId: null,
37909
- access: "view"
37910
- },
37911
- "decoder.getStats": {
37912
- capName: "decoder",
37913
- capScope: "system",
37914
- addonId: null,
37915
- access: "view"
37916
- },
37917
- "decoder.listActiveSessions": {
37918
- capName: "decoder",
37919
- capScope: "system",
37920
- addonId: null,
37921
- access: "view"
37922
- },
37923
- "decoder.openStream": {
37924
- capName: "decoder",
37925
- capScope: "system",
37926
- addonId: null,
37927
- access: "view"
37928
- },
37929
- "decoder.pullFrames": {
37930
- capName: "decoder",
37931
- capScope: "system",
37932
- addonId: null,
37933
- access: "view"
37934
- },
37935
- "decoder.pullHandles": {
37936
- capName: "decoder",
37937
- capScope: "system",
37938
- addonId: null,
37939
- access: "view"
37940
- },
37941
- "decoder.pushPacket": {
37942
- capName: "decoder",
37943
- capScope: "system",
37944
- addonId: null,
37945
- access: "view"
37946
- },
37947
39862
  "decoder.reprobeHwaccel": {
37948
39863
  capName: "decoder",
37949
39864
  capScope: "system",
37950
39865
  addonId: null,
37951
39866
  access: "create"
37952
39867
  },
37953
- "decoder.supportsCodec": {
37954
- capName: "decoder",
37955
- capScope: "system",
37956
- addonId: null,
37957
- access: "view"
37958
- },
37959
- "decoder.updateConfig": {
37960
- capName: "decoder",
37961
- capScope: "system",
37962
- addonId: null,
37963
- access: "view"
37964
- },
37965
39868
  "detectionPipeline.applyDeviceSettingsPatch": {
37966
39869
  capName: "detection-pipeline",
37967
39870
  capScope: "device",
@@ -39228,6 +41131,90 @@ Object.freeze({
39228
41131
  addonId: null,
39229
41132
  access: "create"
39230
41133
  },
41134
+ "keychain.delete": {
41135
+ capName: "keychain",
41136
+ capScope: "system",
41137
+ addonId: null,
41138
+ access: "delete"
41139
+ },
41140
+ "keychain.getState": {
41141
+ capName: "keychain",
41142
+ capScope: "system",
41143
+ addonId: null,
41144
+ access: "view"
41145
+ },
41146
+ "keychain.listMeta": {
41147
+ capName: "keychain",
41148
+ capScope: "system",
41149
+ addonId: null,
41150
+ access: "view"
41151
+ },
41152
+ "keychain.put": {
41153
+ capName: "keychain",
41154
+ capScope: "system",
41155
+ addonId: null,
41156
+ access: "create"
41157
+ },
41158
+ "keychain.resolve": {
41159
+ capName: "keychain",
41160
+ capScope: "system",
41161
+ addonId: null,
41162
+ access: "view"
41163
+ },
41164
+ "keychainAdmin.deleteOrphans": {
41165
+ capName: "keychain-admin",
41166
+ capScope: "system",
41167
+ addonId: null,
41168
+ access: "delete"
41169
+ },
41170
+ "keychainAdmin.downloadRecoveryKey": {
41171
+ capName: "keychain-admin",
41172
+ capScope: "system",
41173
+ addonId: null,
41174
+ access: "create"
41175
+ },
41176
+ "keychainAdmin.listAudit": {
41177
+ capName: "keychain-admin",
41178
+ capScope: "system",
41179
+ addonId: null,
41180
+ access: "view"
41181
+ },
41182
+ "keychainAdmin.listSecrets": {
41183
+ capName: "keychain-admin",
41184
+ capScope: "system",
41185
+ addonId: null,
41186
+ access: "view"
41187
+ },
41188
+ "keychainAdmin.purgeRetiredKeys": {
41189
+ capName: "keychain-admin",
41190
+ capScope: "system",
41191
+ addonId: null,
41192
+ access: "delete"
41193
+ },
41194
+ "keychainAdmin.resetKeychain": {
41195
+ capName: "keychain-admin",
41196
+ capScope: "system",
41197
+ addonId: null,
41198
+ access: "delete"
41199
+ },
41200
+ "keychainAdmin.reveal": {
41201
+ capName: "keychain-admin",
41202
+ capScope: "system",
41203
+ addonId: null,
41204
+ access: "create"
41205
+ },
41206
+ "keychainAdmin.rotateMasterKey": {
41207
+ capName: "keychain-admin",
41208
+ capScope: "system",
41209
+ addonId: null,
41210
+ access: "create"
41211
+ },
41212
+ "keychainAdmin.status": {
41213
+ capName: "keychain-admin",
41214
+ capScope: "system",
41215
+ addonId: null,
41216
+ access: "view"
41217
+ },
39231
41218
  "lawnMowerControl.dock": {
39232
41219
  capName: "lawn-mower-control",
39233
41220
  capScope: "device",
@@ -40602,6 +42589,18 @@ Object.freeze({
40602
42589
  addonId: null,
40603
42590
  access: "create"
40604
42591
  },
42592
+ "pipelineAnalytics.addRetrainFrameFromRecording": {
42593
+ capName: "pipeline-analytics",
42594
+ capScope: "device",
42595
+ addonId: null,
42596
+ access: "create"
42597
+ },
42598
+ "pipelineAnalytics.addRetrainFramesToCollection": {
42599
+ capName: "pipeline-analytics",
42600
+ capScope: "device",
42601
+ addonId: null,
42602
+ access: "create"
42603
+ },
40605
42604
  "pipelineAnalytics.applyDeviceSettingsPatch": {
40606
42605
  capName: "pipeline-analytics",
40607
42606
  capScope: "device",
@@ -40650,12 +42649,24 @@ Object.freeze({
40650
42649
  addonId: null,
40651
42650
  access: "view"
40652
42651
  },
42652
+ "pipelineAnalytics.createRetrainCollection": {
42653
+ capName: "pipeline-analytics",
42654
+ capScope: "device",
42655
+ addonId: null,
42656
+ access: "create"
42657
+ },
40653
42658
  "pipelineAnalytics.deleteDeviceEvents": {
40654
42659
  capName: "pipeline-analytics",
40655
42660
  capScope: "device",
40656
42661
  addonId: null,
40657
42662
  access: "delete"
40658
42663
  },
42664
+ "pipelineAnalytics.deleteRetrainCollection": {
42665
+ capName: "pipeline-analytics",
42666
+ capScope: "device",
42667
+ addonId: null,
42668
+ access: "delete"
42669
+ },
40659
42670
  "pipelineAnalytics.deleteTracks": {
40660
42671
  capName: "pipeline-analytics",
40661
42672
  capScope: "device",
@@ -40860,6 +42871,24 @@ Object.freeze({
40860
42871
  addonId: null,
40861
42872
  access: "view"
40862
42873
  },
42874
+ "pipelineAnalytics.listRetrainAssistProfiles": {
42875
+ capName: "pipeline-analytics",
42876
+ capScope: "device",
42877
+ addonId: null,
42878
+ access: "view"
42879
+ },
42880
+ "pipelineAnalytics.listRetrainCollectionFrames": {
42881
+ capName: "pipeline-analytics",
42882
+ capScope: "device",
42883
+ addonId: null,
42884
+ access: "view"
42885
+ },
42886
+ "pipelineAnalytics.listRetrainCollections": {
42887
+ capName: "pipeline-analytics",
42888
+ capScope: "device",
42889
+ addonId: null,
42890
+ access: "view"
42891
+ },
40863
42892
  "pipelineAnalytics.listRetrainFrames": {
40864
42893
  capName: "pipeline-analytics",
40865
42894
  capScope: "device",
@@ -40908,6 +42937,12 @@ Object.freeze({
40908
42937
  addonId: null,
40909
42938
  access: "create"
40910
42939
  },
42940
+ "pipelineAnalytics.proposeRetrainAnnotationsWithLlm": {
42941
+ capName: "pipeline-analytics",
42942
+ capScope: "device",
42943
+ addonId: null,
42944
+ access: "create"
42945
+ },
40911
42946
  "pipelineAnalytics.pruneEvents": {
40912
42947
  capName: "pipeline-analytics",
40913
42948
  capScope: "device",
@@ -40962,6 +42997,18 @@ Object.freeze({
40962
42997
  addonId: null,
40963
42998
  access: "create"
40964
42999
  },
43000
+ "pipelineAnalytics.removeRetrainFrameFromCollection": {
43001
+ capName: "pipeline-analytics",
43002
+ capScope: "device",
43003
+ addonId: null,
43004
+ access: "delete"
43005
+ },
43006
+ "pipelineAnalytics.renameRetrainCollection": {
43007
+ capName: "pipeline-analytics",
43008
+ capScope: "device",
43009
+ addonId: null,
43010
+ access: "create"
43011
+ },
40965
43012
  "pipelineAnalytics.restageRetrainTrack": {
40966
43013
  capName: "pipeline-analytics",
40967
43014
  capScope: "device",
@@ -40992,6 +43039,12 @@ Object.freeze({
40992
43039
  addonId: null,
40993
43040
  access: "create"
40994
43041
  },
43042
+ "pipelineAnalytics.setRetrainFrameComplete": {
43043
+ capName: "pipeline-analytics",
43044
+ capScope: "device",
43045
+ addonId: null,
43046
+ access: "create"
43047
+ },
40995
43048
  "pipelineAnalytics.setTrackFlags": {
40996
43049
  capName: "pipeline-analytics",
40997
43050
  capScope: "device",
@@ -41028,6 +43081,12 @@ Object.freeze({
41028
43081
  addonId: null,
41029
43082
  access: "delete"
41030
43083
  },
43084
+ "pipelineAnalytics.writeRetrainArchive": {
43085
+ capName: "pipeline-analytics",
43086
+ capScope: "device",
43087
+ addonId: null,
43088
+ access: "create"
43089
+ },
41031
43090
  "pipelineExecutor.cacheFrameInPool": {
41032
43091
  capName: "pipeline-executor",
41033
43092
  capScope: "system",
@@ -41040,13 +43099,13 @@ Object.freeze({
41040
43099
  addonId: null,
41041
43100
  access: "delete"
41042
43101
  },
41043
- "pipelineExecutor.deleteModel": {
43102
+ "pipelineExecutor.clearModelBoundDeviceOverrides": {
41044
43103
  capName: "pipeline-executor",
41045
43104
  capScope: "system",
41046
43105
  addonId: null,
41047
43106
  access: "delete"
41048
43107
  },
41049
- "pipelineExecutor.deleteTemplate": {
43108
+ "pipelineExecutor.deleteModel": {
41050
43109
  capName: "pipeline-executor",
41051
43110
  capScope: "system",
41052
43111
  addonId: null,
@@ -41190,12 +43249,6 @@ Object.freeze({
41190
43249
  addonId: null,
41191
43250
  access: "view"
41192
43251
  },
41193
- "pipelineExecutor.listTemplates": {
41194
- capName: "pipeline-executor",
41195
- capScope: "system",
41196
- addonId: null,
41197
- access: "view"
41198
- },
41199
43252
  "pipelineExecutor.rearmInferenceDevice": {
41200
43253
  capName: "pipeline-executor",
41201
43254
  capScope: "system",
@@ -41220,12 +43273,6 @@ Object.freeze({
41220
43273
  addonId: null,
41221
43274
  access: "create"
41222
43275
  },
41223
- "pipelineExecutor.saveTemplate": {
41224
- capName: "pipeline-executor",
41225
- capScope: "system",
41226
- addonId: null,
41227
- access: "create"
41228
- },
41229
43276
  "pipelineExecutor.setVideoPipelineSteps": {
41230
43277
  capName: "pipeline-executor",
41231
43278
  capScope: "system",
@@ -41244,17 +43291,23 @@ Object.freeze({
41244
43291
  addonId: null,
41245
43292
  access: "create"
41246
43293
  },
41247
- "pipelineExecutor.updateTemplate": {
43294
+ "pipelineExecutor.validatePipeline": {
41248
43295
  capName: "pipeline-executor",
41249
43296
  capScope: "system",
41250
43297
  addonId: null,
43298
+ access: "view"
43299
+ },
43300
+ "pipelineOrchestrator.abortNodeBenchmark": {
43301
+ capName: "pipeline-orchestrator",
43302
+ capScope: "system",
43303
+ addonId: null,
41251
43304
  access: "create"
41252
43305
  },
41253
- "pipelineExecutor.validatePipeline": {
41254
- capName: "pipeline-executor",
43306
+ "pipelineOrchestrator.applyAutoTune": {
43307
+ capName: "pipeline-orchestrator",
41255
43308
  capScope: "system",
41256
43309
  addonId: null,
41257
- access: "view"
43310
+ access: "create"
41258
43311
  },
41259
43312
  "pipelineOrchestrator.applyDeviceSettingsPatch": {
41260
43313
  capName: "pipeline-orchestrator",
@@ -41274,7 +43327,7 @@ Object.freeze({
41274
43327
  addonId: null,
41275
43328
  access: "create"
41276
43329
  },
41277
- "pipelineOrchestrator.deleteTemplate": {
43330
+ "pipelineOrchestrator.deleteNodeBenchmarkResult": {
41278
43331
  capName: "pipeline-orchestrator",
41279
43332
  capScope: "system",
41280
43333
  addonId: null,
@@ -41370,6 +43423,12 @@ Object.freeze({
41370
43423
  addonId: null,
41371
43424
  access: "view"
41372
43425
  },
43426
+ "pipelineOrchestrator.getEffectiveShares": {
43427
+ capName: "pipeline-orchestrator",
43428
+ capScope: "system",
43429
+ addonId: null,
43430
+ access: "view"
43431
+ },
41373
43432
  "pipelineOrchestrator.getGlobalMetrics": {
41374
43433
  capName: "pipeline-orchestrator",
41375
43434
  capScope: "system",
@@ -41382,6 +43441,24 @@ Object.freeze({
41382
43441
  addonId: null,
41383
43442
  access: "view"
41384
43443
  },
43444
+ "pipelineOrchestrator.getNodeBenchmarkCandidates": {
43445
+ capName: "pipeline-orchestrator",
43446
+ capScope: "system",
43447
+ addonId: null,
43448
+ access: "view"
43449
+ },
43450
+ "pipelineOrchestrator.getNodeBenchmarkPreflight": {
43451
+ capName: "pipeline-orchestrator",
43452
+ capScope: "system",
43453
+ addonId: null,
43454
+ access: "view"
43455
+ },
43456
+ "pipelineOrchestrator.getNodeBenchmarkStatus": {
43457
+ capName: "pipeline-orchestrator",
43458
+ capScope: "system",
43459
+ addonId: null,
43460
+ access: "view"
43461
+ },
41385
43462
  "pipelineOrchestrator.getNodeInferenceDevices": {
41386
43463
  capName: "pipeline-orchestrator",
41387
43464
  capScope: "system",
@@ -41406,6 +43483,12 @@ Object.freeze({
41406
43483
  addonId: null,
41407
43484
  access: "view"
41408
43485
  },
43486
+ "pipelineOrchestrator.getPlacementStats": {
43487
+ capName: "pipeline-orchestrator",
43488
+ capScope: "system",
43489
+ addonId: null,
43490
+ access: "view"
43491
+ },
41409
43492
  "pipelineOrchestrator.getReconcileFromDiskStatus": {
41410
43493
  capName: "pipeline-orchestrator",
41411
43494
  capScope: "system",
@@ -41418,7 +43501,7 @@ Object.freeze({
41418
43501
  addonId: null,
41419
43502
  access: "view"
41420
43503
  },
41421
- "pipelineOrchestrator.listTemplates": {
43504
+ "pipelineOrchestrator.listNodeBenchmarkResults": {
41422
43505
  capName: "pipeline-orchestrator",
41423
43506
  capScope: "system",
41424
43507
  addonId: null,
@@ -41430,6 +43513,12 @@ Object.freeze({
41430
43513
  addonId: null,
41431
43514
  access: "create"
41432
43515
  },
43516
+ "pipelineOrchestrator.planAutoTune": {
43517
+ capName: "pipeline-orchestrator",
43518
+ capScope: "system",
43519
+ addonId: null,
43520
+ access: "view"
43521
+ },
41433
43522
  "pipelineOrchestrator.rebalance": {
41434
43523
  capName: "pipeline-orchestrator",
41435
43524
  capScope: "system",
@@ -41472,12 +43561,6 @@ Object.freeze({
41472
43561
  addonId: null,
41473
43562
  access: "create"
41474
43563
  },
41475
- "pipelineOrchestrator.saveTemplate": {
41476
- capName: "pipeline-orchestrator",
41477
- capScope: "system",
41478
- addonId: null,
41479
- access: "create"
41480
- },
41481
43564
  "pipelineOrchestrator.setAgentCapabilities": {
41482
43565
  capName: "pipeline-orchestrator",
41483
43566
  capScope: "system",
@@ -41490,12 +43573,6 @@ Object.freeze({
41490
43573
  addonId: null,
41491
43574
  access: "create"
41492
43575
  },
41493
- "pipelineOrchestrator.setAgentDetectWeight": {
41494
- capName: "pipeline-orchestrator",
41495
- capScope: "system",
41496
- addonId: null,
41497
- access: "create"
41498
- },
41499
43576
  "pipelineOrchestrator.setAgentInferenceDevices": {
41500
43577
  capName: "pipeline-orchestrator",
41501
43578
  capScope: "system",
@@ -41532,6 +43609,12 @@ Object.freeze({
41532
43609
  addonId: null,
41533
43610
  access: "create"
41534
43611
  },
43612
+ "pipelineOrchestrator.setCameraStepSettings": {
43613
+ capName: "pipeline-orchestrator",
43614
+ capScope: "system",
43615
+ addonId: null,
43616
+ access: "create"
43617
+ },
41535
43618
  "pipelineOrchestrator.setCameraStepToggle": {
41536
43619
  capName: "pipeline-orchestrator",
41537
43620
  capScope: "system",
@@ -41550,12 +43633,36 @@ Object.freeze({
41550
43633
  addonId: null,
41551
43634
  access: "create"
41552
43635
  },
43636
+ "pipelineOrchestrator.setLoadBalancingShares": {
43637
+ capName: "pipeline-orchestrator",
43638
+ capScope: "system",
43639
+ addonId: null,
43640
+ access: "create"
43641
+ },
41553
43642
  "pipelineOrchestrator.setPipelineDevicePin": {
41554
43643
  capName: "pipeline-orchestrator",
41555
43644
  capScope: "system",
41556
43645
  addonId: null,
41557
43646
  access: "create"
41558
43647
  },
43648
+ "pipelineOrchestrator.setShareSource": {
43649
+ capName: "pipeline-orchestrator",
43650
+ capScope: "system",
43651
+ addonId: null,
43652
+ access: "create"
43653
+ },
43654
+ "pipelineOrchestrator.startNodeBenchmark": {
43655
+ capName: "pipeline-orchestrator",
43656
+ capScope: "system",
43657
+ addonId: null,
43658
+ access: "create"
43659
+ },
43660
+ "pipelineOrchestrator.suggestShares": {
43661
+ capName: "pipeline-orchestrator",
43662
+ capScope: "system",
43663
+ addonId: null,
43664
+ access: "view"
43665
+ },
41559
43666
  "pipelineOrchestrator.unassignAudio": {
41560
43667
  capName: "pipeline-orchestrator",
41561
43668
  capScope: "system",
@@ -41568,8 +43675,8 @@ Object.freeze({
41568
43675
  addonId: null,
41569
43676
  access: "create"
41570
43677
  },
41571
- "pipelineOrchestrator.updateTemplate": {
41572
- capName: "pipeline-orchestrator",
43678
+ "pipelineRunner.abortNodeBench": {
43679
+ capName: "pipeline-runner",
41573
43680
  capScope: "system",
41574
43681
  addonId: null,
41575
43682
  access: "create"
@@ -41622,6 +43729,12 @@ Object.freeze({
41622
43729
  addonId: null,
41623
43730
  access: "view"
41624
43731
  },
43732
+ "pipelineRunner.getNodeBenchStatus": {
43733
+ capName: "pipeline-runner",
43734
+ capScope: "system",
43735
+ addonId: null,
43736
+ access: "view"
43737
+ },
41625
43738
  "pipelineRunner.getParkedTrackFrame": {
41626
43739
  capName: "pipeline-runner",
41627
43740
  capScope: "system",
@@ -41664,6 +43777,12 @@ Object.freeze({
41664
43777
  addonId: null,
41665
43778
  access: "create"
41666
43779
  },
43780
+ "pipelineRunner.startNodeBench": {
43781
+ capName: "pipeline-runner",
43782
+ capScope: "system",
43783
+ addonId: null,
43784
+ access: "create"
43785
+ },
41667
43786
  "plateGallery.assignPlate": {
41668
43787
  capName: "plate-gallery",
41669
43788
  capScope: "system",
@@ -43008,12 +45127,6 @@ Object.freeze({
43008
45127
  addonId: null,
43009
45128
  access: "view"
43010
45129
  },
43011
- "streamBroker.pullFrameHandles": {
43012
- capName: "stream-broker",
43013
- capScope: "system",
43014
- addonId: null,
43015
- access: "view"
43016
- },
43017
45130
  "streamBroker.regenerateRtspToken": {
43018
45131
  capName: "stream-broker",
43019
45132
  capScope: "system",
@@ -43080,12 +45193,6 @@ Object.freeze({
43080
45193
  addonId: null,
43081
45194
  access: "create"
43082
45195
  },
43083
- "streamBroker.subscribeFrames": {
43084
- capName: "stream-broker",
43085
- capScope: "system",
43086
- addonId: null,
43087
- access: "create"
43088
- },
43089
45196
  "streamBroker.unassignProfile": {
43090
45197
  capName: "stream-broker",
43091
45198
  capScope: "system",
@@ -43098,12 +45205,6 @@ Object.freeze({
43098
45205
  addonId: null,
43099
45206
  access: "create"
43100
45207
  },
43101
- "streamBroker.unsubscribeFrames": {
43102
- capName: "stream-broker",
43103
- capScope: "system",
43104
- addonId: null,
43105
- access: "create"
43106
- },
43107
45208
  "streamCatalog.getCatalog": {
43108
45209
  capName: "stream-catalog",
43109
45210
  capScope: "device",
@@ -43398,18 +45499,36 @@ Object.freeze({
43398
45499
  addonId: null,
43399
45500
  access: "delete"
43400
45501
  },
45502
+ "userManagement.findUserByExternalIdentity": {
45503
+ capName: "user-management",
45504
+ capScope: "system",
45505
+ addonId: null,
45506
+ access: "view"
45507
+ },
43401
45508
  "userManagement.getTotpStatus": {
43402
45509
  capName: "user-management",
43403
45510
  capScope: "system",
43404
45511
  addonId: null,
43405
45512
  access: "view"
43406
45513
  },
45514
+ "userManagement.linkExternalIdentity": {
45515
+ capName: "user-management",
45516
+ capScope: "system",
45517
+ addonId: null,
45518
+ access: "create"
45519
+ },
43407
45520
  "userManagement.listApiKeys": {
43408
45521
  capName: "user-management",
43409
45522
  capScope: "system",
43410
45523
  addonId: null,
43411
45524
  access: "view"
43412
45525
  },
45526
+ "userManagement.listExternalIdentities": {
45527
+ capName: "user-management",
45528
+ capScope: "system",
45529
+ addonId: null,
45530
+ access: "view"
45531
+ },
43413
45532
  "userManagement.listOauthSessions": {
43414
45533
  capName: "user-management",
43415
45534
  capScope: "system",
@@ -43488,6 +45607,12 @@ Object.freeze({
43488
45607
  addonId: null,
43489
45608
  access: "create"
43490
45609
  },
45610
+ "userManagement.unlinkExternalIdentity": {
45611
+ capName: "user-management",
45612
+ capScope: "system",
45613
+ addonId: null,
45614
+ access: "delete"
45615
+ },
43491
45616
  "userManagement.updateUser": {
43492
45617
  capName: "user-management",
43493
45618
  capScope: "system",
@@ -45251,7 +47376,11 @@ var DISPLAY_ICON_VOCABULARY = [
45251
47376
  ];
45252
47377
  DISPLAY_ICON_VOCABULARY.map((e) => e.key);
45253
47378
  DISPLAY_ICON_VOCABULARY.filter((e) => e.aliasOf === void 0).map((e) => e.key);
45254
- new Map(DISPLAY_ICON_VOCABULARY.map((e) => [e.key, e]));
47379
+ var ENTRY_BY_KEY = new Map(DISPLAY_ICON_VOCABULARY.map((e) => [e.key, e]));
47380
+ /** Is this a key of the shared vocabulary? */
47381
+ function isDisplayIconKey(value) {
47382
+ return typeof value === "string" && ENTRY_BY_KEY.has(value);
47383
+ }
45255
47384
  Object.freeze({
45256
47385
  "accessories.getStatus": [{
45257
47386
  name: "deviceId",
@@ -45617,11 +47746,6 @@ Object.freeze({
45617
47746
  form: "single",
45618
47747
  optional: false
45619
47748
  }],
45620
- "decoder.createSession": [{
45621
- name: "deviceId",
45622
- form: "single",
45623
- optional: true
45624
- }],
45625
47749
  "detectionPipeline.applyDeviceSettingsPatch": [{
45626
47750
  name: "deviceId",
45627
47751
  form: "single",
@@ -46592,6 +48716,11 @@ Object.freeze({
46592
48716
  form: "single",
46593
48717
  optional: false
46594
48718
  }],
48719
+ "pipelineAnalytics.addRetrainFrameFromRecording": [{
48720
+ name: "deviceId",
48721
+ form: "single",
48722
+ optional: false
48723
+ }],
46595
48724
  "pipelineAnalytics.applyDeviceSettingsPatch": [{
46596
48725
  name: "deviceId",
46597
48726
  form: "single",
@@ -46782,6 +48911,11 @@ Object.freeze({
46782
48911
  form: "single",
46783
48912
  optional: false
46784
48913
  }],
48914
+ "pipelineAnalytics.proposeRetrainAnnotationsWithLlm": [{
48915
+ name: "deviceId",
48916
+ form: "single",
48917
+ optional: false
48918
+ }],
46785
48919
  "pipelineAnalytics.pruneEventsBefore": [{
46786
48920
  name: "deviceId",
46787
48921
  form: "single",
@@ -46832,6 +48966,11 @@ Object.freeze({
46832
48966
  form: "single",
46833
48967
  optional: false
46834
48968
  }],
48969
+ "pipelineAnalytics.setRetrainFrameComplete": [{
48970
+ name: "deviceId",
48971
+ form: "single",
48972
+ optional: false
48973
+ }],
46835
48974
  "pipelineAnalytics.setTrackFlags": [{
46836
48975
  name: "deviceId",
46837
48976
  form: "single",
@@ -46852,6 +48991,11 @@ Object.freeze({
46852
48991
  form: "single",
46853
48992
  optional: false
46854
48993
  }],
48994
+ "pipelineExecutor.clearModelBoundDeviceOverrides": [{
48995
+ name: "deviceIds",
48996
+ form: "array",
48997
+ optional: true
48998
+ }],
46855
48999
  "pipelineExecutor.runPipeline": [{
46856
49000
  name: "deviceId",
46857
49001
  form: "single",
@@ -46957,6 +49101,11 @@ Object.freeze({
46957
49101
  form: "single",
46958
49102
  optional: false
46959
49103
  }],
49104
+ "pipelineOrchestrator.setCameraStepSettings": [{
49105
+ name: "deviceId",
49106
+ form: "single",
49107
+ optional: false
49108
+ }],
46960
49109
  "pipelineOrchestrator.setCameraStepToggle": [{
46961
49110
  name: "deviceId",
46962
49111
  form: "single",
@@ -48873,14 +51022,4 @@ DEFAULT_NATIVE_LEASE_SETTINGS.admission;
48873
51022
  var MB = 1024 * 1024;
48874
51023
  1024 * MB, 3072 * MB;
48875
51024
  //#endregion
48876
- //#region src/hub-browser-origin.ts
48877
- async function hubBrowserOrigin(localNetwork, logger) {
48878
- try {
48879
- return (await localNetwork.getAddresses.query()).roles.publicEndpoint.resolved;
48880
- } catch (err) {
48881
- logger.warn("hub address unavailable from local-network — using the localhost default", { meta: { error: err instanceof Error ? err.message : String(err) } });
48882
- return null;
48883
- }
48884
- }
48885
- //#endregion
48886
- export { buildAddonRouteProvider as a, errMsg as c, boolean as d, number as f, authProviderCapability as i, BaseAddon as l, string as m, addonRoutesCapability as n, loginMethodCapability as o, object as p, addonWidgetsSourceCapability as r, userPasskeysCapability as s, hubBrowserOrigin as t, array as u };
51025
+ export { isDisplayIconKey as a, errMsg as c, boolean as d, number as f, buildAddonRouteProvider as i, BaseAddon as l, string as m, addonWidgetsSourceCapability as n, loginMethodCapability as o, object as p, authProviderCapability as r, userPasskeysCapability as s, addonRoutesCapability as t, array as u };