@camstack/addon-osd-manager 0.1.188 → 0.1.190

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (19) hide show
  1. package/dist/{MotionZonesSettings-DO_aSGvS.mjs → MotionZonesSettings-Bu5cG8Nn.mjs} +2 -2
  2. package/dist/{PrivacyMaskSettings-Dz9m4TPF.mjs → PrivacyMaskSettings-D6dKZaUy.mjs} +4 -4
  3. package/dist/{SceneMonitorEditor-B3c9J7f3.mjs → SceneMonitorEditor-CQOKJvlI.mjs} +3 -3
  4. package/dist/_stub.js +5632 -5591
  5. package/dist/{_virtual_mf-localSharedImportMap___mfe_internal__addon_osd_manager_page-DmGUOsEt.mjs → _virtual_mf-localSharedImportMap___mfe_internal__addon_osd_manager_page-COS742kp.mjs} +3 -3
  6. package/dist/_virtual_mf___mfe_internal__addon_osd_manager_page__loadShare___mf_0_camstack_mf_1_types__loadShare__.js-DX4fnanS.mjs +26 -0
  7. package/dist/addon-osd-manager.css +1 -1
  8. package/dist/{hostInit-CWYNKBoP.mjs → hostInit-DKr2qNjM.mjs} +2 -2
  9. package/dist/index.js +2139 -60
  10. package/dist/index.mjs +2139 -60
  11. package/dist/{player-overlays-CYJONP8_.mjs → player-overlays-DeovLOpb.mjs} +1 -1
  12. package/dist/remoteEntry.js +1 -1
  13. package/dist/{responsive-CLeY6HgJ.mjs → responsive-SPEdfsGi.mjs} +1 -1
  14. package/dist/{scene-monitor-copy-CAiAEjTG.mjs → scene-monitor-copy-DiAzNFxa.mjs} +1 -1
  15. package/dist/{square-94BJB2Ov.mjs → square-C-hgouUR.mjs} +1 -1
  16. package/dist/{trash-2-CSe4YYX5.mjs → trash-2-DnRyzFp8.mjs} +1 -1
  17. package/dist/{virtual_mf-REMOTE_ENTRY_ID___mfe_internal__addon_osd_manager_page__remoteEntry_js-DrK1e36i.mjs → virtual_mf-REMOTE_ENTRY_ID___mfe_internal__addon_osd_manager_page__remoteEntry_js-BHhohvcl.mjs} +1 -1
  18. package/package.json +1 -1
  19. package/dist/_virtual_mf___mfe_internal__addon_osd_manager_page__loadShare___mf_0_camstack_mf_1_types__loadShare__.js-elInKoqy.mjs +0 -26
package/dist/index.mjs CHANGED
@@ -1,4 +1,4 @@
1
- //#region ../types/dist/event-category-B_0XEcLF.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`).
@@ -5369,7 +5376,7 @@ var ZodIssueCode = {
5369
5376
  var ZodFirstPartyTypeKind;
5370
5377
  ZodFirstPartyTypeKind || (ZodFirstPartyTypeKind = {});
5371
5378
  //#endregion
5372
- //#region ../types/dist/sleep-BNeXenvr.mjs
5379
+ //#region ../types/dist/sleep-Cr5YOk3m.mjs
5373
5380
  /**
5374
5381
  * The audio chunk plane's byte format, and the ONE expansion from a coded
5375
5382
  * window to float samples (D455).
@@ -5448,6 +5455,97 @@ function buildAlawTable() {
5448
5455
  }
5449
5456
  buildUlawTable();
5450
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
+ }
5451
5549
  Object.fromEntries([
5452
5550
  {
5453
5551
  id: "overview",
@@ -5619,33 +5717,19 @@ Object.fromEntries([
5619
5717
  function isValuelessField(field) {
5620
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";
5621
5719
  }
5622
- /**
5623
- * Merge a `ConfigUISchema` with a raw `values` record into a
5624
- * `ConfigUISchemaWithValues`. Used by every `get*Settings` backend endpoint
5625
- * before returning to the admin UI. Groups are walked recursively.
5626
- *
5627
- * For each leaf field:
5628
- * - structural fields (`separator`, `info`, `button`) pass through unchanged
5629
- * - other fields get `value = values[key] ?? field.default ?? null`
5630
- *
5631
- * Unknown keys in `values` (keys not declared in the schema) are silently
5632
- * ignored — they don't contribute to the output. Missing keys fall back to
5633
- * the schema default or `null`. This mirrors the old backend behaviour where
5634
- * `FormBuilder` rendered `values[key] ?? field.default`.
5635
- */
5636
- function hydrateSchema(schema, values) {
5720
+ function hydrateSchema(schema, values, options = {}) {
5637
5721
  return {
5638
5722
  ...schema.tabs ? { tabs: [...schema.tabs] } : {},
5639
5723
  sections: schema.sections.map((section) => ({
5640
5724
  ...section,
5641
- fields: section.fields.map((field) => hydrateField(field, values))
5725
+ fields: section.fields.map((field) => hydrateField(field, values, options))
5642
5726
  }))
5643
5727
  };
5644
5728
  }
5645
- function hydrateField(field, values) {
5729
+ function hydrateField(field, values, options) {
5646
5730
  if (isValuelessField(field)) return field;
5647
5731
  if (field.type === "group") {
5648
- const hydratedChildren = field.fields.map((child) => hydrateField(child, values));
5732
+ const hydratedChildren = field.fields.map((child) => hydrateField(child, values, options));
5649
5733
  return {
5650
5734
  ...field,
5651
5735
  fields: hydratedChildren
@@ -5654,7 +5738,7 @@ function hydrateField(field, values) {
5654
5738
  if (field.type === "sub-tabs") {
5655
5739
  const hydratedTabs = field.tabs.map((tab) => ({
5656
5740
  ...tab,
5657
- fields: tab.fields.map((child) => hydrateField(child, values))
5741
+ fields: tab.fields.map((child) => hydrateField(child, values, options))
5658
5742
  }));
5659
5743
  return {
5660
5744
  ...field,
@@ -5664,6 +5748,33 @@ function hydrateField(field, values) {
5664
5748
  const key = field.key;
5665
5749
  const storedValue = Object.prototype.hasOwnProperty.call(values, key) ? values[key] : void 0;
5666
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
+ }
5667
5778
  if (field.multiple) {
5668
5779
  const stored = Array.isArray(storedValue) ? storedValue : storedValue !== void 0 && storedValue !== null ? [storedValue] : [];
5669
5780
  const itemFallback = field.multiple.itemDefault !== void 0 ? field.multiple.itemDefault : defaultValue !== void 0 ? defaultValue : typeOf(field) === "string" ? "" : null;
@@ -5906,6 +6017,431 @@ function projectStore(store, perNodeKeys, nodeId) {
5906
6017
  }
5907
6018
  return out;
5908
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;
5909
6445
  /**
5910
6446
  * Base class for CamStack addons. Eliminates settings boilerplate:
5911
6447
  *
@@ -5975,6 +6511,25 @@ var BaseAddon = class {
5975
6511
  settingsStoreReady = false;
5976
6512
  /** Default config values. Provided via constructor. */
5977
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;
5978
6533
  constructor(defaults) {
5979
6534
  this.defaults = defaults;
5980
6535
  this._config = { ...defaults };
@@ -6010,8 +6565,18 @@ var BaseAddon = class {
6010
6565
  return this._config;
6011
6566
  }
6012
6567
  async initialize(context) {
6013
- 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;
6014
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
+ });
6015
6580
  const result = await this.onInitialize();
6016
6581
  this.emitLifecycle(EventCategory.AddonStarted);
6017
6582
  const normalized = normalizeAddonInitResult(result);
@@ -6044,6 +6609,12 @@ var BaseAddon = class {
6044
6609
  */
6045
6610
  async onHubReachable() {}
6046
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;
6047
6618
  this.emitLifecycle(EventCategory.AddonStopped);
6048
6619
  if (this.autoEmitReadiness) this.emitReadinessForProviders("down");
6049
6620
  await this.onShutdown();
@@ -6122,7 +6693,7 @@ var BaseAddon = class {
6122
6693
  return hydrateSchema(schema, overlay ? {
6123
6694
  ...projected,
6124
6695
  ...overlay
6125
- } : projected);
6696
+ } : projected, { inlineSecretsAsViews: true });
6126
6697
  }
6127
6698
  /**
6128
6699
  * The integration-level view of this addon's settings: exactly the sections
@@ -6171,7 +6742,7 @@ var BaseAddon = class {
6171
6742
  return hydrateSchema({
6172
6743
  ...schema,
6173
6744
  sections
6174
- }, projected);
6745
+ }, projected, { inlineSecretsAsViews: true });
6175
6746
  }
6176
6747
  /**
6177
6748
  * The raw addon store PROJECTED onto the target node's bare per-node keys:
@@ -6225,18 +6796,50 @@ var BaseAddon = class {
6225
6796
  value: result.value[key]
6226
6797
  };
6227
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
+ }
6228
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) {
6229
6833
  const keys = this.perNodeKeys();
6230
6834
  const localNode = normalizeNodeId(this._ctx?.kernel?.localNodeId);
6231
6835
  const target = normalizeNodeId(nodeId ?? this._ctx?.kernel?.localNodeId);
6232
- const barePatch = patch;
6233
6836
  const scoped = keys.size > 0 ? scopePatch(barePatch, keys, target) : barePatch;
6234
6837
  await this._ctx?.settings?.writeAddonStore(scoped);
6235
6838
  if (target !== localNode) return;
6236
6839
  await this.resolveConfig();
6237
6840
  await this.onConfigChanged();
6238
6841
  this.emitLifecycle(EventCategory.AddonUpdated, { level: "global" });
6239
- this.maybeAutoRestart(patch, this.globalSettingsSchema());
6842
+ this.maybeAutoRestart(Object.keys(barePatch), this.globalSettingsSchema());
6240
6843
  }
6241
6844
  /**
6242
6845
  * The set of field keys the global settings schema declares `perNode: true`
@@ -6261,7 +6864,7 @@ var BaseAddon = class {
6261
6864
  * time to return its response before the addon is torn down and
6262
6865
  * re-initialised by `AddonRegistryService.restartAddon`.
6263
6866
  */
6264
- maybeAutoRestart(patch, schema) {
6867
+ maybeAutoRestart(patchKeys, schema) {
6265
6868
  if (!schema) return;
6266
6869
  const restartKeys = /* @__PURE__ */ new Set();
6267
6870
  for (const section of schema.sections) for (const field of section.fields) {
@@ -6269,13 +6872,13 @@ var BaseAddon = class {
6269
6872
  if (field.requiresRestart) restartKeys.add(field.key);
6270
6873
  }
6271
6874
  if (restartKeys.size === 0) return;
6272
- if (!Object.keys(patch).some((k) => restartKeys.has(k))) return;
6875
+ if (!patchKeys.some((k) => restartKeys.has(k))) return;
6273
6876
  const ctx = this._ctx;
6274
6877
  if (!ctx) return;
6275
6878
  const addonId = ctx.id;
6276
6879
  setImmediate(() => {
6277
6880
  ctx.api.addons?.restartAddon?.mutate({ addonId }).then(() => {
6278
- 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)) } });
6279
6882
  }).catch((err) => {
6280
6883
  ctx.logger.error("addon auto-restart failed", { meta: { error: err instanceof Error ? err.message : String(err) } });
6281
6884
  });
@@ -6284,7 +6887,7 @@ var BaseAddon = class {
6284
6887
  async getDeviceSettings(deviceId) {
6285
6888
  const schema = this.deviceSettingsSchema();
6286
6889
  if (!schema) return { sections: [] };
6287
- return hydrateSchema(schema, await this._ctx?.settings?.readDeviceStore(deviceId) ?? {});
6890
+ return hydrateSchema(schema, await this._ctx?.settings?.readDeviceStore(deviceId) ?? {}, { inlineSecretsAsViews: true });
6288
6891
  }
6289
6892
  async updateDeviceSettings(deviceId, patch) {
6290
6893
  await this._ctx?.settings?.writeDeviceStore(deviceId, patch);
@@ -6414,7 +7017,7 @@ var BaseAddon = class {
6414
7017
  * selection at boot (absent scoped key ⇒ the constructor default wins).
6415
7018
  */
6416
7019
  async resolveConfig() {
6417
- const stored = await this.readAddonStoreWithRetry();
7020
+ const stored = await this.resolveStoredSecrets(await this.readAddonStoreWithRetry());
6418
7021
  const perNode = this.perNodeKeys();
6419
7022
  const localNode = normalizeNodeId(this._ctx?.kernel?.localNodeId);
6420
7023
  const resolved = { ...this.defaults };
@@ -6439,7 +7042,7 @@ var BaseAddon = class {
6439
7042
  key,
6440
7043
  schema,
6441
7044
  fallback,
6442
- read: () => this.readAddonStoreWithRetry(),
7045
+ read: async () => this.resolveStoredSecrets(await this.readAddonStoreWithRetry()),
6443
7046
  write: async (patch) => {
6444
7047
  await this._ctx?.settings?.writeAddonStore(patch);
6445
7048
  },
@@ -6456,7 +7059,7 @@ var BaseAddon = class {
6456
7059
  key,
6457
7060
  schema,
6458
7061
  fallback,
6459
- read: async () => await this._ctx?.settings?.readDeviceStore(deviceId) ?? {},
7062
+ read: async () => this.resolveStoredSecrets(await this._ctx?.settings?.readDeviceStore(deviceId) ?? {}, false),
6460
7063
  write: async (patch) => {
6461
7064
  await this._ctx?.settings?.writeDeviceStore(deviceId, patch);
6462
7065
  },
@@ -6468,6 +7071,70 @@ var BaseAddon = class {
6468
7071
  } })
6469
7072
  });
6470
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
+ }
6471
7138
  /**
6472
7139
  * Wrap `ctx.settings.readAddonStore()` with a short retry budget so a
6473
7140
  * transient settings-store outage (mid-restart of sqlite-settings, tsx-watch
@@ -15271,6 +15938,254 @@ id: union([string(), number()]) }), {
15271
15938
  })
15272
15939
  }
15273
15940
  };
15941
+ /**
15942
+ * `keychain` — the hub's encrypted store of secret values (D787).
15943
+ *
15944
+ * Settings blobs never hold a secret: they hold a marker
15945
+ * `{"$secret":"secret://<owner>/<scope>/<fieldPath>","v":1}` and the value
15946
+ * lives here, AES-256-GCM under a data key that a master key wraps. This cap
15947
+ * is the OWNER's door to its own values: every method is owner-checked
15948
+ * against the CALLER, never against anything the caller claims.
15949
+ *
15950
+ * Who the caller is: the transport stamps `callerAddonId` into the args of a
15951
+ * call that crossed a process (the parent `LocalChildRegistry` from the UDS
15952
+ * connection, the agent from its child's connection carried in
15953
+ * `$hub-cap-fwd`'s envelope). A stamp always overwrites; a wire call with no
15954
+ * stamp has its claim stripped. Only a hub in-process caller may state its own
15955
+ * identity — `ctx.secrets` does that with the addon id closed over. This is
15956
+ * identity against BUGS and misrouting, not against a malicious addon (every
15957
+ * runner is the same OS user): see the threat model in
15958
+ * `docs/design/2026-10-08-secrets-keychain.md`.
15959
+ *
15960
+ * `callerAddonId` is deliberately NOT in any input schema: the tRPC router
15961
+ * parses the input, so a session can never supply it, and the internal mount
15962
+ * floors every method to admin anyway (D240).
15963
+ *
15964
+ * Internal: addons reach it through `ctx.secrets`, never directly.
15965
+ */
15966
+ /** Why a value cannot be served right now. Never folded into "missing". */
15967
+ var KeychainUnavailableReasonSchema = _enum([
15968
+ "key-missing",
15969
+ "wrong-key",
15970
+ "key-file-unreadable",
15971
+ "store-unavailable",
15972
+ "not-initialized",
15973
+ "decrypt-failed"
15974
+ ]);
15975
+ var KeychainStateSchema = discriminatedUnion("state", [object({ state: literal("ready") }), object({
15976
+ state: literal("locked"),
15977
+ reason: KeychainUnavailableReasonSchema
15978
+ })]);
15979
+ var KeychainResolveEntrySchema = discriminatedUnion("kind", [
15980
+ object({
15981
+ kind: literal("value"),
15982
+ value: string(),
15983
+ version: number().int()
15984
+ }),
15985
+ object({ kind: literal("missing") }),
15986
+ object({
15987
+ kind: literal("unavailable"),
15988
+ reason: KeychainUnavailableReasonSchema
15989
+ }),
15990
+ object({ kind: literal("forbidden") })
15991
+ ]);
15992
+ var KeychainResolveResultSchema = record(string(), KeychainResolveEntrySchema);
15993
+ /** Metadata of one stored value — never the value. */
15994
+ var KeychainSecretMetaSchema = object({
15995
+ ref: string(),
15996
+ owner: string(),
15997
+ /** Formatted scope (`global`, `node/<id>`, `device/<id>`, …). */
15998
+ scope: string(),
15999
+ fieldPath: string(),
16000
+ version: number().int(),
16001
+ createdAt: number(),
16002
+ updatedAt: number(),
16003
+ /** `addon:<id>` | `user:<id>` | `system`. */
16004
+ updatedBy: string(),
16005
+ /** Coarse — written at most once an hour per ref. `null` = never read. */
16006
+ lastReadAt: number().nullable()
16007
+ });
16008
+ var RefListSchema = array(string().min(1)).max(512);
16009
+ var keychainCapability = {
16010
+ name: "keychain",
16011
+ scope: "system",
16012
+ mode: "singleton",
16013
+ internal: true,
16014
+ methods: {
16015
+ /** Store (or replace) the caller's value at `ref`. Refused while locked. */
16016
+ put: method(object({
16017
+ ref: string().min(1),
16018
+ value: string().min(1)
16019
+ }), object({
16020
+ ref: string(),
16021
+ version: number().int()
16022
+ }), {
16023
+ kind: "mutation",
16024
+ auth: "admin"
16025
+ }),
16026
+ /**
16027
+ * Resolve the caller's refs in one round-trip. A locked keychain answers
16028
+ * `unavailable` per ref — never `missing`, never an empty value.
16029
+ */
16030
+ resolve: method(object({ refs: RefListSchema }), KeychainResolveResultSchema, { auth: "admin" }),
16031
+ /** Remove the caller's refs. Unknown refs are ignored. */
16032
+ delete: method(object({ refs: RefListSchema }), object({ deleted: number().int() }), {
16033
+ kind: "mutation",
16034
+ auth: "admin"
16035
+ }),
16036
+ /** The caller's own refs, metadata only. */
16037
+ listMeta: method(object({}), array(KeychainSecretMetaSchema).readonly(), { auth: "admin" }),
16038
+ /** Whether values can be served — the save path refuses a write while locked. */
16039
+ getState: method(object({}), KeychainStateSchema, { auth: "admin" })
16040
+ }
16041
+ };
16042
+ var KeychainKeySourceSchema = object({
16043
+ kind: _enum([
16044
+ "config-file",
16045
+ "previous-config-file",
16046
+ "platform",
16047
+ "default-file"
16048
+ ]),
16049
+ /** File sources only — a path is not a secret. */
16050
+ path: string().optional(),
16051
+ /**
16052
+ * True when a whole-volume backup of the data directory carries this key
16053
+ * next to the database it protects (the default file). The page warns.
16054
+ */
16055
+ sharesBackupWithDatabase: boolean()
16056
+ });
16057
+ var KeychainStatusSchema = object({
16058
+ keychain: KeychainStateSchema,
16059
+ /** The source of the master key in use; `null` while locked. */
16060
+ keySource: KeychainKeySourceSchema.nullable(),
16061
+ /** The source configured to be primary — differs from `keySource` while a rotation is pending. */
16062
+ configuredSource: KeychainKeySourceSchema,
16063
+ /** Short fingerprint of the master key in use (`HMAC(KEK, label)`, 16 hex). */
16064
+ fingerprint: string().nullable(),
16065
+ activeKeyId: string().nullable(),
16066
+ /**
16067
+ * The keychain unlocked with a NON-primary source: the configured primary
16068
+ * key is not the one that wraps the data key yet. `rotateMasterKey` moves it.
16069
+ */
16070
+ rotationPending: boolean(),
16071
+ /** Wrapped copies of the data key under a previous master key, kept until purged. */
16072
+ retiredWraps: number().int(),
16073
+ recoveryKeyDownloadedAt: number().nullable(),
16074
+ secretCount: number().int()
16075
+ });
16076
+ /**
16077
+ * Whether a stored value is still pointed at by its owner's settings.
16078
+ * `unknown` is a first-class answer: a scope whose blob could not be read is
16079
+ * never reported as an orphan (and never deleted as one).
16080
+ */
16081
+ var KeychainSecretUsageSchema = _enum([
16082
+ "in-use",
16083
+ "orphan",
16084
+ "unknown"
16085
+ ]);
16086
+ var KeychainAdminSecretSchema = KeychainSecretMetaSchema.extend({ usage: KeychainSecretUsageSchema });
16087
+ var KeychainAuditActionSchema = _enum([
16088
+ "put",
16089
+ "delete",
16090
+ "reveal",
16091
+ "rotate-master-key",
16092
+ "purge-retired-keys",
16093
+ "download-recovery-key",
16094
+ "delete-orphans",
16095
+ "reset",
16096
+ "initialize"
16097
+ ]);
16098
+ var KeychainAuditEntrySchema = object({
16099
+ id: string(),
16100
+ at: number(),
16101
+ action: KeychainAuditActionSchema,
16102
+ /** `addon:<id>` | `user:<id>` | `system`. */
16103
+ actor: string(),
16104
+ ref: string().nullable(),
16105
+ detail: string().nullable()
16106
+ });
16107
+ var keychainAdminCapability = {
16108
+ name: "keychain-admin",
16109
+ scope: "system",
16110
+ mode: "singleton",
16111
+ methods: {
16112
+ status: method(object({}), KeychainStatusSchema, { auth: "admin" }),
16113
+ listSecrets: method(object({}), array(KeychainAdminSecretSchema).readonly(), { auth: "admin" }),
16114
+ listAudit: method(object({ limit: number().int().min(1).max(500).optional() }), array(KeychainAuditEntrySchema).readonly(), { auth: "admin" }),
16115
+ /**
16116
+ * Show one value to the operator. Audited. The UI hides it again after a
16117
+ * few seconds; nothing caches it.
16118
+ */
16119
+ reveal: method(object({ ref: string().min(1) }), object({
16120
+ value: string(),
16121
+ version: number().int()
16122
+ }), {
16123
+ kind: "mutation",
16124
+ auth: "admin",
16125
+ caller: "required"
16126
+ }),
16127
+ /** Delete refs no owner points at any more. Re-checked here; `unknown` is kept. */
16128
+ deleteOrphans: method(object({ refs: array(string().min(1)).max(1e3) }), object({
16129
+ deleted: array(string()).readonly(),
16130
+ kept: array(object({
16131
+ ref: string(),
16132
+ usage: KeychainSecretUsageSchema
16133
+ })).readonly()
16134
+ }), {
16135
+ kind: "mutation",
16136
+ auth: "admin",
16137
+ caller: "required"
16138
+ }),
16139
+ /**
16140
+ * Wrap the data key under the configured primary master key.
16141
+ *
16142
+ * Pending rotation (the keychain unlocked with a previous source): re-wrap
16143
+ * under the primary. Otherwise, with the default file as primary: generate
16144
+ * a new master key, write it there, re-wrap. A file or OS-keychain primary
16145
+ * that is already in use cannot be replaced from here — put the new key at
16146
+ * the source, keep the old one as `keychain.previousKeyFile`, restart, and
16147
+ * rotate. No value is re-encrypted either way; the previous wrap is kept
16148
+ * (retired) until purged.
16149
+ */
16150
+ rotateMasterKey: method(object({}), object({
16151
+ fingerprint: string(),
16152
+ keySource: KeychainKeySourceSchema
16153
+ }), {
16154
+ kind: "mutation",
16155
+ auth: "admin",
16156
+ caller: "required"
16157
+ }),
16158
+ purgeRetiredKeys: method(object({}), object({ purged: number().int() }), {
16159
+ kind: "mutation",
16160
+ auth: "admin",
16161
+ caller: "required"
16162
+ }),
16163
+ /** The master key, base64. Audited; marks the recovery copy as taken. */
16164
+ downloadRecoveryKey: method(object({}), object({
16165
+ key: string(),
16166
+ fingerprint: string(),
16167
+ keySource: KeychainKeySourceSchema
16168
+ }), {
16169
+ kind: "mutation",
16170
+ auth: "admin",
16171
+ caller: "required"
16172
+ }),
16173
+ /**
16174
+ * Lost-key recovery: archive every stored value into a
16175
+ * `keychain:secrets-orphaned-<ts>` table and start over with a new data
16176
+ * key. Every secret field then reads "not set". Requires the typed
16177
+ * confirmation {@link KEYCHAIN_RESET_CONFIRMATION}.
16178
+ */
16179
+ resetKeychain: method(object({ confirm: literal("RESET KEYCHAIN") }), object({
16180
+ archivedCollection: string().nullable(),
16181
+ archived: number().int()
16182
+ }), {
16183
+ kind: "mutation",
16184
+ auth: "admin",
16185
+ caller: "required"
16186
+ })
16187
+ }
16188
+ };
15274
16189
  var decoderCapability = {
15275
16190
  name: "decoder",
15276
16191
  scope: "system",
@@ -16376,6 +17291,10 @@ var DeviceInfoSchema = object({
16376
17291
  isCamera: boolean(),
16377
17292
  /** Current config values — serializable snapshot */
16378
17293
  config: record(string(), unknown()),
17294
+ /** Paths inside `config` the device's schema declares secret (D783) —
17295
+ * what the non-admin redaction withholds. Paths, never values. Absent
17296
+ * when the owning runner has not reported them. */
17297
+ secretConfigPaths: array(string()).optional(),
16379
17298
  /** Hardware + identity blob (manufacturer / model / firmware / sn /
16380
17299
  * uid / mac / …). Populated by drivers; editable via setMetadata. */
16381
17300
  metadata: record(string(), unknown()).nullable().optional(),
@@ -16596,12 +17515,22 @@ var DeviceRegisterPayloadSchema = object({
16596
17515
  * call (workers re-register on init), so probe-driven updates
16597
17516
  * (e.g. PTZ flag flipping after the abilities probe) propagate. */
16598
17517
  features: array(string()).optional(),
16599
- config: record(string(), unknown())
17518
+ config: record(string(), unknown()),
17519
+ /** Config paths the device's own schema DECLARES secret
17520
+ * (`.meta({ secret: true })` — dotted, `[]` for array items, e.g.
17521
+ * `connection.password`). Re-published on every register; the non-admin
17522
+ * redaction withholds them at any depth (D783). Optional: an older runner
17523
+ * omits it and the keyword backstop applies. */
17524
+ secretConfigPaths: array(string()).optional()
16600
17525
  });
16601
17526
  var DeviceRemovePayloadSchema = object({ deviceId: number() });
16602
17527
  var DevicePersistConfigPayloadSchema = object({
16603
17528
  deviceId: number(),
16604
- data: record(string(), unknown())
17529
+ data: record(string(), unknown()),
17530
+ /** The paths the device's schema declares secret (D783), when the caller
17531
+ * knows them — those values are kept in the keychain, not the blob (D787).
17532
+ * Absent: the paths the device last reported at `registerDevice` apply. */
17533
+ secretConfigPaths: array(string()).optional()
16605
17534
  });
16606
17535
  /** What a migration actually did, per switch. `unreachable` is a first-class
16607
17536
  * answer: a camera that could not be asked is not a camera that was silenced. */
@@ -19220,7 +20149,14 @@ var LoginMethodContributionSchema = discriminatedUnion("kind", [
19220
20149
  icon: string().optional(),
19221
20150
  /** Addon-owned HTTP route the button navigates to (GET). */
19222
20151
  startUrl: string(),
19223
- stage: LoginStageEnum
20152
+ stage: LoginStageEnum,
20153
+ /**
20154
+ * The provider names an external identity a signed-in user can link to
20155
+ * their own account (D782): `auth.listLinkableProviders` /
20156
+ * `beginExternalLink` offer exactly the redirect methods that set this,
20157
+ * whatever their id. Absent / false — a login button only (magic-link).
20158
+ */
20159
+ linkable: boolean().optional()
19224
20160
  }),
19225
20161
  object({
19226
20162
  kind: literal("widget"),
@@ -25498,8 +26434,23 @@ var RetrainMacroClassSchema = _enum([
25498
26434
  ]);
25499
26435
  /** A subject to learn, or a phantom to unlearn (taught by OMISSION). */
25500
26436
  var RetrainAnnotationKindSchema = _enum(["subject", "model_error"]);
25501
- /** Did a human draw this box, or did the assist propose it? */
25502
- var RetrainAnnotationSourceSchema = _enum(["operator", "assist"]);
26437
+ /**
26438
+ * Where a box came from. A machine-sourced box is a DRAFT on the page until
26439
+ * the operator confirms it; once saved it keeps its source as provenance.
26440
+ *
26441
+ * - `operator` — drawn by hand.
26442
+ * - `assist` — proposed by a detector run on the copy (the camera's own
26443
+ * model, or a larger teacher model).
26444
+ * - `pipeline` — the box the live pipeline actually drew on that frame, read
26445
+ * back from the track store (never a re-run).
26446
+ * - `llm` — proposed by a vision-capable LLM profile.
26447
+ */
26448
+ var RetrainAnnotationSourceSchema = _enum([
26449
+ "operator",
26450
+ "assist",
26451
+ "pipeline",
26452
+ "llm"
26453
+ ]);
25503
26454
  /** Normalised `[0,1]` rectangle against the FULL frame — the canonical form. */
25504
26455
  var RetrainBboxSchema = object({
25505
26456
  x: number(),
@@ -25517,7 +26468,8 @@ var RetrainBboxSchema = object({
25517
26468
  */
25518
26469
  var RetrainAnnotationSchema = object({
25519
26470
  id: string(),
25520
- trackId: string(),
26471
+ /** The frame's track. Absent on a recording still, which has none. */
26472
+ trackId: string().optional(),
25521
26473
  deviceId: number(),
25522
26474
  /** The COPY in retrain storage — never the source track's media key. */
25523
26475
  mediaKey: string(),
@@ -25566,18 +26518,63 @@ var RetrainFrameCandidateSchema = object({
25566
26518
  * fail, whatever became of the original. */
25567
26519
  copied: boolean()
25568
26520
  });
26521
+ /**
26522
+ * One box the live pipeline drew on a copied frame — what a correction starts
26523
+ * from. Derived when the frame is listed, from the track store: the subject
26524
+ * box recorded on the source media row when there is one, else the track
26525
+ * position nearest the frame's capture time. Never stored as an annotation
26526
+ * until the operator confirms it.
26527
+ */
26528
+ var RetrainPipelineBoxSchema = object({
26529
+ /** Normalised `[0,1]` against the full frame. */
26530
+ bbox: RetrainBboxSchema,
26531
+ macroClass: RetrainMacroClassSchema,
26532
+ label: string().optional(),
26533
+ subLabel: string().optional(),
26534
+ /** The detection score of the position used, when it was recorded. */
26535
+ score: number().optional(),
26536
+ /** The root model that produced the track, when it was recorded. */
26537
+ modelId: string().optional(),
26538
+ trackId: string(),
26539
+ /** `subject-box`: recorded on this very frame. `position`: the track's
26540
+ * position nearest the capture time, `deltaMs` away. */
26541
+ basis: _enum(["subject-box", "position"]),
26542
+ deltaMs: number()
26543
+ });
26544
+ /**
26545
+ * Where a retrain frame came from: a TRACK's stored media (copy-on-select),
26546
+ * or the RECORDING at an instant — the frame a model saw nothing in has no
26547
+ * track at all.
26548
+ */
26549
+ var RetrainFrameOriginSchema = _enum(["track", "recording"]);
25569
26550
  /** A frame the dataset OWNS: bytes copied at selection time. */
25570
26551
  var RetrainFrameSchema = object({
25571
26552
  frameId: string(),
25572
26553
  deviceId: number(),
25573
- trackId: string(),
25574
- /** Provenance only. It may already point at nothing — that is expected. */
25575
- sourceMediaId: number().int(),
26554
+ origin: RetrainFrameOriginSchema,
26555
+ /** The track it was copied from. Absent on a recording still. */
26556
+ trackId: string().optional(),
26557
+ /** Provenance only. It may already point at nothing — that is expected.
26558
+ * Absent on a recording still. */
26559
+ sourceMediaId: number().int().optional(),
26560
+ /** A recording still: the playhead instant it was taken at. */
26561
+ epochMs: number().optional(),
25576
26562
  sourceKind: MediaFileKindEnum,
25577
26563
  sizeBytes: number().int(),
25578
26564
  width: number().int(),
25579
26565
  height: number().int(),
25580
- copiedAt: number()
26566
+ copiedAt: number(),
26567
+ /** When the CAMERA captured the frame. Absent on a copy taken before D785. */
26568
+ capturedAt: number().optional(),
26569
+ /** The operator's "every subject in this frame is boxed". Detector
26570
+ * evaluation keeps only complete frames: an unboxed subject would count as
26571
+ * a false positive. */
26572
+ complete: boolean(),
26573
+ /** The boxes the pipeline drew on this frame. Present on list answers;
26574
+ * empty when nothing the track store holds can be placed on it. */
26575
+ pipelineBoxes: array(RetrainPipelineBoxSchema).readonly().optional(),
26576
+ /** The named collections this frame belongs to. Present on list answers. */
26577
+ collectionIds: array(string()).readonly().optional()
25581
26578
  });
25582
26579
  /** Why a copy-on-select could not be honoured — named, never a silent skip. */
25583
26580
  var RetrainCopyRefusalSchema = _enum([
@@ -25598,6 +26595,53 @@ var RetrainFrameListSchema = object({
25598
26595
  /** What the page pre-selects — the native key frame when one survives. */
25599
26596
  autoPickMediaId: number().int().optional()
25600
26597
  });
26598
+ /**
26599
+ * Which frames an annotated export carries. Every field narrows; an empty
26600
+ * filter is every annotated copy. A dataset VERSION is a frozen `frameIds`
26601
+ * list owned by whoever trains (the training orchestrator), so `frameIds` is
26602
+ * the primitive a version export uses; `batchId` re-selects what an earlier
26603
+ * export carried (`exportedInBatch`).
26604
+ */
26605
+ var RetrainExportFilterSchema = object({
26606
+ deviceIds: array(number()).optional(),
26607
+ frameIds: array(string()).max(2e4).optional(),
26608
+ /** Only frames in at least one of these named collections. */
26609
+ collectionIds: array(string()).max(200).optional(),
26610
+ batchId: string().optional(),
26611
+ /** Only frames the operator marked complete (all subjects boxed). */
26612
+ completeOnly: boolean().optional()
26613
+ });
26614
+ /**
26615
+ * `frames`: the full frame copies, boxes in `annotations.json`.
26616
+ * `crops`: additionally one JPEG per subject, cut with the runtime detail-crop
26617
+ * convention — the classifier layout.
26618
+ */
26619
+ var RetrainExportLayoutSchema = _enum(["frames", "crops"]);
26620
+ /**
26621
+ * Where `writeRetrainArchive` streams the tar: one HTTP request whose body is
26622
+ * the archive, sent chunk by chunk. Covers a presigned PUT and a provider
26623
+ * addon's data-plane upload route alike. Headers are sent verbatim and never
26624
+ * logged.
26625
+ */
26626
+ var RetrainArchiveTargetSchema = object({
26627
+ kind: literal("http"),
26628
+ method: _enum(["PUT", "POST"]),
26629
+ url: string().url(),
26630
+ headers: record(string(), string()).optional()
26631
+ });
26632
+ var RetrainArchiveResultSchema = object({
26633
+ batchId: string(),
26634
+ frames: number().int(),
26635
+ crops: number().int(),
26636
+ annotations: number().int(),
26637
+ /** Frames planned but not shipped (unreadable copy, path too long). */
26638
+ missing: number().int(),
26639
+ bytes: number().int(),
26640
+ /** sha256 of the exact bytes sent. */
26641
+ sha256: string(),
26642
+ /** The target's HTTP status. */
26643
+ status: number().int()
26644
+ });
25601
26645
  /** What the operator asked the assist to look for. */
25602
26646
  var RetrainAssistSubjectSchema = discriminatedUnion("kind", [object({
25603
26647
  kind: literal("package"),
@@ -25627,6 +26671,109 @@ var RetrainAssistResultSchema = discriminatedUnion("kind", [object({
25627
26671
  reason: string(),
25628
26672
  detail: string().optional()
25629
26673
  })]);
26674
+ /** A named set over the retrain corpus — membership only, it owns no pixels. */
26675
+ var RetrainCollectionSchema = object({
26676
+ id: string(),
26677
+ name: string(),
26678
+ createdAt: number(),
26679
+ frameCount: number().int()
26680
+ });
26681
+ var RetrainCollectionCreateResultSchema = discriminatedUnion("kind", [object({
26682
+ kind: literal("created"),
26683
+ collection: RetrainCollectionSchema
26684
+ }), object({
26685
+ kind: literal("refused"),
26686
+ reason: _enum(["empty-name", "duplicate-name"])
26687
+ })]);
26688
+ var RetrainCollectionRenameResultSchema = discriminatedUnion("kind", [object({
26689
+ kind: literal("renamed"),
26690
+ collection: RetrainCollectionSchema
26691
+ }), object({
26692
+ kind: literal("refused"),
26693
+ reason: _enum([
26694
+ "empty-name",
26695
+ "duplicate-name",
26696
+ "unknown-collection"
26697
+ ])
26698
+ })]);
26699
+ /**
26700
+ * The outcome of adding the frame at a recording instant. Every refusal is
26701
+ * named: `still-unavailable` (not recording, a gap, or an undecodable frame —
26702
+ * `detail` says which), `still-busy` (the recorder is at its decode bound; try
26703
+ * again), `unreadable-image`, `write-failed`, `unknown-collection`.
26704
+ */
26705
+ var AddRetrainFrameFromRecordingResultSchema = discriminatedUnion("kind", [object({
26706
+ kind: literal("added"),
26707
+ collectionId: string(),
26708
+ frame: RetrainFrameSchema,
26709
+ /** The moment was already in the dataset; nothing was decoded. */
26710
+ reused: boolean()
26711
+ }), object({
26712
+ kind: literal("refused"),
26713
+ reason: _enum([
26714
+ "unknown-collection",
26715
+ "still-unavailable",
26716
+ "still-busy",
26717
+ "unreadable-image",
26718
+ "write-failed"
26719
+ ]),
26720
+ detail: string().optional()
26721
+ })]);
26722
+ /** A vision LLM profile the AI assist may use, and where it sends the frame. */
26723
+ var RetrainAssistProfileSchema = object({
26724
+ id: string(),
26725
+ name: string(),
26726
+ model: string(),
26727
+ kind: string(),
26728
+ /** `true` when the frame would leave the house (a cloud vendor, or an
26729
+ * endpoint that is not on the local network). The page confirms each such
26730
+ * run, and the provider refuses one without `allowCloud`. */
26731
+ leavesHouse: boolean()
26732
+ });
26733
+ /** A box the AI assist proposed: a draft, plus the model's own reason. */
26734
+ var RetrainLlmProposalSchema = RetrainAnnotationDraftSchema.extend({ reason: string() });
26735
+ /** What the AI assist said about a box that was already on the canvas. */
26736
+ var RetrainLlmReviewSchema = object({
26737
+ /** The `ref` the page sent the box under. */
26738
+ ref: string(),
26739
+ verdict: _enum([
26740
+ "confirmed",
26741
+ "wrong-class",
26742
+ "not-an-object",
26743
+ "uncertain"
26744
+ ]),
26745
+ suggestedClass: RetrainMacroClassSchema.optional(),
26746
+ reason: string()
26747
+ });
26748
+ /**
26749
+ * The AI assist's answer. `proposed` carries drafts (`source: 'llm'`, the
26750
+ * model and its confidence) and reviews; items the model got wrong (a box off
26751
+ * the frame, an unasked class, an unknown ref) are dropped and counted in
26752
+ * `rejected`. A whole answer that is not the schema is `malformed-answer`.
26753
+ */
26754
+ var RetrainLlmAssistResultSchema = discriminatedUnion("kind", [object({
26755
+ kind: literal("proposed"),
26756
+ profileId: string(),
26757
+ model: string(),
26758
+ /** The frame was sent outside the house for this answer. */
26759
+ leftHouse: boolean(),
26760
+ proposals: array(RetrainLlmProposalSchema).readonly(),
26761
+ reviews: array(RetrainLlmReviewSchema).readonly(),
26762
+ rejected: number().int()
26763
+ }), object({
26764
+ kind: literal("refused"),
26765
+ reason: _enum([
26766
+ "unknown-frame",
26767
+ "unreadable-frame",
26768
+ "unknown-profile",
26769
+ "profile-disabled",
26770
+ "no-vision",
26771
+ "cloud-not-confirmed",
26772
+ "llm-error",
26773
+ "malformed-answer"
26774
+ ]),
26775
+ detail: string().optional()
26776
+ })]);
25630
26777
  /** The outcome of a lifecycle move owned by the retrain page. */
25631
26778
  var RetrainTransitionResultSchema = object({
25632
26779
  trackId: string(),
@@ -26813,7 +27960,7 @@ var pipelineAnalyticsCapability = {
26813
27960
  * a frame leaves the dataset before export. */
26814
27961
  deselectRetrainFrame: method(object({
26815
27962
  deviceId: number(),
26816
- trackId: string(),
27963
+ trackId: string().optional(),
26817
27964
  frameId: string()
26818
27965
  }), object({
26819
27966
  removed: boolean(),
@@ -26856,7 +28003,8 @@ var pipelineAnalyticsCapability = {
26856
28003
  */
26857
28004
  proposeRetrainAnnotations: method(object({
26858
28005
  deviceId: number(),
26859
- trackId: string(),
28006
+ /** The frame's track, when it has one — checked against the frame. */
28007
+ trackId: string().optional(),
26860
28008
  frameId: string(),
26861
28009
  subject: RetrainAssistSubjectSchema,
26862
28010
  /** Which node runs it. Absent ⇒ wherever an unowned call lands. */
@@ -26865,8 +28013,12 @@ var pipelineAnalyticsCapability = {
26865
28013
  kind: "mutation",
26866
28014
  auth: "admin"
26867
28015
  }),
26868
- /** Every annotation on a track, oldest first. */
26869
- listRetrainAnnotations: method(object({ trackId: string() }), array(RetrainAnnotationSchema).readonly(), {
28016
+ /** Every annotation on a track, or on named frames (a recording still has
28017
+ * no track), oldest first. One of the two is required. */
28018
+ listRetrainAnnotations: method(object({
28019
+ trackId: string().optional(),
28020
+ frameIds: array(string()).max(2e3).optional()
28021
+ }), array(RetrainAnnotationSchema).readonly(), {
26870
28022
  kind: "query",
26871
28023
  auth: "admin"
26872
28024
  }),
@@ -26885,7 +28037,8 @@ var pipelineAnalyticsCapability = {
26885
28037
  */
26886
28038
  saveRetrainAnnotations: method(object({
26887
28039
  deviceId: number(),
26888
- trackId: string(),
28040
+ /** The frame's track, when it has one — checked against the frame. */
28041
+ trackId: string().optional(),
26889
28042
  frameId: string(),
26890
28043
  annotations: array(RetrainAnnotationDraftSchema)
26891
28044
  }), array(RetrainAnnotationSchema).readonly(), {
@@ -26937,7 +28090,146 @@ var pipelineAnalyticsCapability = {
26937
28090
  * out, so two crops of the same subject can never end up in one feature
26938
28091
  * space (D52).
26939
28092
  */
26940
- getRetrainExportUrl: method(object({ deviceIds: array(number()).optional() }), object({ url: string() }), {
28093
+ getRetrainExportUrl: method(RetrainExportFilterSchema.extend({ layout: RetrainExportLayoutSchema.optional() }), object({ url: string() }), {
28094
+ kind: "query",
28095
+ auth: "admin"
28096
+ }),
28097
+ /**
28098
+ * The operator's "every subject in this frame is boxed" — set and cleared
28099
+ * by hand, never derived: a frame with no box may be a complete hard
28100
+ * negative, and a frame with three boxes may still miss a fourth person.
28101
+ */
28102
+ setRetrainFrameComplete: method(object({
28103
+ deviceId: number(),
28104
+ trackId: string().optional(),
28105
+ frameId: string(),
28106
+ complete: boolean()
28107
+ }), RetrainFrameSchema, {
28108
+ kind: "mutation",
28109
+ auth: "admin"
28110
+ }),
28111
+ /**
28112
+ * Stream the annotated archive to a TARGET instead of a browser — the
28113
+ * same tar `getRetrainExportUrl` serves (manifest first, one JPEG in
28114
+ * memory at a time, paced), written chunk by chunk into one HTTP request.
28115
+ * The bytes never cross this cap and never land on the hub's disk; the
28116
+ * answer is what was sent, with its sha256.
28117
+ */
28118
+ writeRetrainArchive: method(object({
28119
+ filter: RetrainExportFilterSchema,
28120
+ layout: RetrainExportLayoutSchema,
28121
+ target: RetrainArchiveTargetSchema
28122
+ }), RetrainArchiveResultSchema, {
28123
+ kind: "mutation",
28124
+ auth: "admin",
28125
+ timeoutMs: 60 * 6e4
28126
+ }),
28127
+ /** The enabled, vision-capable LLM profiles, each saying whether a frame
28128
+ * sent to it leaves the house. */
28129
+ listRetrainAssistProfiles: method(object({}), array(RetrainAssistProfileSchema).readonly(), {
28130
+ kind: "query",
28131
+ auth: "admin"
28132
+ }),
28133
+ /**
28134
+ * Ask a vision LLM (the `llm` capability) about ONE copied frame: list the
28135
+ * objects of `classes` with boxes, and review the boxes already on the
28136
+ * canvas (sent by `ref`). Answers drafts (`source: 'llm'`) and reviews —
28137
+ * nothing is stored, nothing is accepted. A profile that sends the frame
28138
+ * outside the house is refused unless `allowCloud` says the operator
28139
+ * confirmed this run.
28140
+ */
28141
+ proposeRetrainAnnotationsWithLlm: method(object({
28142
+ deviceId: number(),
28143
+ trackId: string().optional(),
28144
+ frameId: string(),
28145
+ profileId: string(),
28146
+ classes: array(RetrainMacroClassSchema).min(1),
28147
+ boxes: array(object({
28148
+ ref: string(),
28149
+ bbox: RetrainBboxSchema,
28150
+ macroClass: RetrainMacroClassSchema,
28151
+ label: string().optional()
28152
+ })).max(50),
28153
+ allowCloud: boolean()
28154
+ }), RetrainLlmAssistResultSchema, {
28155
+ kind: "mutation",
28156
+ auth: "admin",
28157
+ timeoutMs: 18e4
28158
+ }),
28159
+ /**
28160
+ * Create a named collection — a set over the retrain corpus ("packages
28161
+ * porch night"). Names are unique case-insensitively and never empty;
28162
+ * both refusals are named.
28163
+ */
28164
+ createRetrainCollection: method(object({ name: string().max(120) }), RetrainCollectionCreateResultSchema, {
28165
+ kind: "mutation",
28166
+ auth: "admin"
28167
+ }),
28168
+ /** Every collection, newest first, with its frame count. */
28169
+ listRetrainCollections: method(object({}), array(RetrainCollectionSchema).readonly(), {
28170
+ kind: "query",
28171
+ auth: "admin"
28172
+ }),
28173
+ renameRetrainCollection: method(object({
28174
+ id: string(),
28175
+ name: string().max(120)
28176
+ }), RetrainCollectionRenameResultSchema, {
28177
+ kind: "mutation",
28178
+ auth: "admin"
28179
+ }),
28180
+ /**
28181
+ * Delete a collection. Its recording stills that no other collection
28182
+ * holds are deleted with their annotations (nothing else reaches them);
28183
+ * frames copied from tracks always stay in the dataset.
28184
+ */
28185
+ deleteRetrainCollection: method(object({ id: string() }), object({
28186
+ deleted: boolean(),
28187
+ removedFrames: number().int()
28188
+ }), {
28189
+ kind: "mutation",
28190
+ auth: "admin"
28191
+ }),
28192
+ /**
28193
+ * Add the frame at a recording instant to a collection — the frame the
28194
+ * model may have seen NOTHING in. The recorder re-decodes the native
28195
+ * frame at `epochMs`; the dataset copies it (trackless, durable). The same
28196
+ * moment twice is one copy. Every refusal is named.
28197
+ */
28198
+ addRetrainFrameFromRecording: method(object({
28199
+ collectionId: string(),
28200
+ deviceId: number(),
28201
+ epochMs: number()
28202
+ }), AddRetrainFrameFromRecordingResultSchema, {
28203
+ kind: "mutation",
28204
+ auth: "admin",
28205
+ timeoutMs: 6e4
28206
+ }),
28207
+ /** Add frames already in the dataset to a collection. */
28208
+ addRetrainFramesToCollection: method(object({
28209
+ collectionId: string(),
28210
+ frameIds: array(string()).min(1).max(500)
28211
+ }), object({
28212
+ added: number().int(),
28213
+ alreadyMember: number().int(),
28214
+ unknownFrameIds: array(string()).readonly()
28215
+ }), {
28216
+ kind: "mutation",
28217
+ auth: "admin"
28218
+ }),
28219
+ /** Remove a frame from a collection. A recording still left in no
28220
+ * collection is deleted with its annotations (`deletedFrame`). */
28221
+ removeRetrainFrameFromCollection: method(object({
28222
+ collectionId: string(),
28223
+ frameId: string()
28224
+ }), object({
28225
+ removed: boolean(),
28226
+ deletedFrame: boolean()
28227
+ }), {
28228
+ kind: "mutation",
28229
+ auth: "admin"
28230
+ }),
28231
+ /** The frames of a collection, with their pipeline boxes. */
28232
+ listRetrainCollectionFrames: method(object({ collectionId: string() }), array(RetrainFrameSchema).readonly(), {
26941
28233
  kind: "query",
26942
28234
  auth: "admin"
26943
28235
  }),
@@ -27880,13 +29172,31 @@ var RecommendationReasonSchema = discriminatedUnion("kind", [
27880
29172
  object({
27881
29173
  kind: literal("no-family-build"),
27882
29174
  format: ModelFormatSchema$1
29175
+ }),
29176
+ object({
29177
+ kind: literal("kept-custom-pin"),
29178
+ modelId: string(),
29179
+ deviceKey: string()
27883
29180
  })
27884
29181
  ]);
29182
+ /** Why a device is left exactly as it is, whatever the plan would pick (D786). */
29183
+ var KeptReasonSchema = _enum(["custom-pin"]);
29184
+ /**
29185
+ * Where a choice's latency came from (D791): this node's own benchmark
29186
+ * result, or the hardware-class table. Measured on the node beats the table.
29187
+ */
29188
+ var LatencySourceSchema = discriminatedUnion("kind", [object({ kind: literal("table") }), object({
29189
+ kind: literal("node-benchmark"),
29190
+ resultId: string(),
29191
+ measuredAtMs: number()
29192
+ })]);
27885
29193
  var DeviceModelChoiceSchema = object({
27886
29194
  modelId: string(),
27887
29195
  p50Ms: number(),
27888
29196
  fps: number(),
27889
29197
  measured: boolean(),
29198
+ /** Absent on a plan from before D791 — read as the table. */
29199
+ source: LatencySourceSchema.optional(),
27890
29200
  /** Parallel sessions at the camera rate with the headroom kept free: ⌊fps × (1 − headroom) / camera fps⌋. */
27891
29201
  capacitySessions: number(),
27892
29202
  personRecall: number()
@@ -27897,6 +29207,8 @@ var DeviceRecommendationSchema = object({
27897
29207
  enabled: boolean(),
27898
29208
  available: boolean(),
27899
29209
  chosen: DeviceModelChoiceSchema.nullable(),
29210
+ /** Present when the device is kept as is: Apply writes nothing on it. */
29211
+ kept: KeptReasonSchema.optional(),
27900
29212
  reasons: array(RecommendationReasonSchema).readonly()
27901
29213
  });
27902
29214
  var NodeRecommendationSchema = object({
@@ -27950,6 +29262,17 @@ var AutoTuneWarningSchema = discriminatedUnion("kind", [
27950
29262
  kind: literal("coral-enabled"),
27951
29263
  nodeId: string(),
27952
29264
  deviceKey: string()
29265
+ }),
29266
+ object({
29267
+ kind: literal("custom-pin-kept"),
29268
+ nodeId: string(),
29269
+ deviceKey: string().nullable(),
29270
+ deviceId: number().nullable(),
29271
+ modelId: string()
29272
+ }),
29273
+ object({
29274
+ kind: literal("custom-registry-unreadable"),
29275
+ error: string()
27953
29276
  })
27954
29277
  ]);
27955
29278
  var AutoTuneOptionsSchema = object({
@@ -28128,13 +29451,14 @@ var SuggestSharesResultSchema = object({
28128
29451
  nodes: array(SuggestedNodeShareSchema).readonly()
28129
29452
  });
28130
29453
  /**
28131
- * Where the node and device shares come from (D750, D755).
28132
- * - `hardware` (default) — computed by the system from each node's static
28133
- * capacity (its accelerators at their Auto tune models, from the measured
28134
- * latency table), recomputed whenever a node or device joins, leaves, is
28135
- * switched on or off, or changes model. No load input.
28136
- * - `benchmark` — the same, from each node's measured capacity (node
28137
- * benchmark results); a node without results falls back to `hardware`.
29454
+ * Where the node and device shares come from (D750, D755, D791).
29455
+ * - `benchmark` (default since D791) — each node's capacity as its own node
29456
+ * benchmark measured it; a node without fresh results is sized from
29457
+ * `hardware` and says so. Measured on the node beats the table.
29458
+ * - `hardware` — computed from each node's static capacity only (its
29459
+ * accelerators at their Auto tune models, from the latency table).
29460
+ * Both are recomputed whenever a node or device joins, leaves, is switched
29461
+ * on or off, changes model, or a benchmark result is written. No load input.
28138
29462
  * - `manual` — the operator's stored sliders.
28139
29463
  * Either way a node or device that cannot take sessions gives its share to
28140
29464
  * the others in proportion; the stored values are never rewritten for that.
@@ -28183,6 +29507,362 @@ var EffectiveSharesSchema = object({
28183
29507
  nodeWeights: record(string(), number()),
28184
29508
  deviceWeights: record(string(), record(string(), number()))
28185
29509
  });
29510
+ /**
29511
+ * Wire shapes of the node benchmark (D791): the operator's plan, the
29512
+ * preflight the confirmation shows, the run the orchestrator owns, what the
29513
+ * measuring runner reports, and the result rows Auto tune and the automatic
29514
+ * shares read.
29515
+ *
29516
+ * ONE node at a time, owned by the pipeline orchestrator. While a run is
29517
+ * active the cluster is in BENCHMARK MODE for that node: it is not a
29518
+ * detection candidate, camera pins naming it are ignored so its sessions move
29519
+ * elsewhere, and both come back when the mode ends — after a crash or a hub
29520
+ * restart too (a persisted manifest, reconciled against the registry).
29521
+ *
29522
+ * Two measurements, both on the node, driven by its own runner (frames never
29523
+ * cross a process at frame rate, D9):
29524
+ * - `device` — one accelerator × one candidate detector, root only, open
29525
+ * loop: how many streams at the camera rate it carries inside the frame
29526
+ * interval;
29527
+ * - `pipeline` — the chosen detector plus the operator's detail steps
29528
+ * (faces, plates, classifiers, CLIP…), on varied frames from the bench
29529
+ * clip: how many parallel sessions the node carries before latency, drops,
29530
+ * CPU, RAM or the event loop give out.
29531
+ */
29532
+ /** Defaults and bounds, one place. */
29533
+ var NODE_BENCHMARK_DEFAULTS = {
29534
+ fpsPerStream: 10,
29535
+ budgetMinutes: 45,
29536
+ minBudgetMinutes: 10,
29537
+ maxBudgetMinutes: 120,
29538
+ /** A result older than this no longer beats the table. */
29539
+ staleAfterDays: 30,
29540
+ /** Warm-in per ramp step (not accounted). */
29541
+ settleSec: 5,
29542
+ /** Accounted window per ramp step. */
29543
+ measureSec: 20,
29544
+ /** Longest the drain may take before the run is refused. */
29545
+ drainTimeoutSec: 120,
29546
+ /** Candidate models per device in one run. */
29547
+ maxModelsPerDevice: 6
29548
+ };
29549
+ /** The two measurements a run can make. */
29550
+ var NodeBenchmarkPhaseSchema = _enum(["device", "pipeline"]);
29551
+ var NodeBenchmarkDevicePlanSchema = object({
29552
+ /** `<backend>:<device>` — `openvino:npu`, `coreml:all`, `cpu`. */
29553
+ deviceKey: string().min(1),
29554
+ /**
29555
+ * Root detector candidates for the `device` measurement, in the order
29556
+ * measured. The FIRST is the one the `pipeline` measurement runs.
29557
+ */
29558
+ modelIds: array(string().min(1)).min(1).max(NODE_BENCHMARK_DEFAULTS.maxModelsPerDevice)
29559
+ });
29560
+ /** What the operator confirmed. */
29561
+ var NodeBenchmarkPlanSchema = object({
29562
+ nodeId: string().min(1),
29563
+ devices: array(NodeBenchmarkDevicePlanSchema).min(1),
29564
+ /** Which measurements run. At least one. */
29565
+ phases: array(NodeBenchmarkPhaseSchema).min(1).default(["device", "pipeline"]),
29566
+ /**
29567
+ * Detail steps (catalog step ids under the root: faces, plates,
29568
+ * classifiers, CLIP…) the `pipeline` measurement enables. The root
29569
+ * detector always runs.
29570
+ */
29571
+ steps: array(string().min(1)).default([]),
29572
+ /** Offered rate of one stream / session. */
29573
+ fpsPerStream: number().int().min(1).max(30).default(NODE_BENCHMARK_DEFAULTS.fpsPerStream),
29574
+ /** Hard deadline: the mode ends and the cluster is restored when it passes. */
29575
+ budgetMinutes: number().int().min(NODE_BENCHMARK_DEFAULTS.minBudgetMinutes).max(NODE_BENCHMARK_DEFAULTS.maxBudgetMinutes).default(NODE_BENCHMARK_DEFAULTS.budgetMinutes),
29576
+ /** Keep the models the run downloaded (default: delete what was not installed before). */
29577
+ keepDownloadedModels: boolean().default(false),
29578
+ /** Start although the other nodes' capacity does not cover the sessions running now. */
29579
+ acceptInsufficientHeadroom: boolean().default(false)
29580
+ });
29581
+ var NodeBenchmarkRefusalSchema = object({
29582
+ kind: _enum([
29583
+ "benchmark-active",
29584
+ "node-offline",
29585
+ "unknown-device",
29586
+ "no-phase",
29587
+ "insufficient-headroom"
29588
+ ]),
29589
+ detail: string(),
29590
+ overridable: boolean()
29591
+ });
29592
+ /** A camera whose detection leaves the node for the run. */
29593
+ var NodeBenchmarkMovingCameraSchema = object({
29594
+ deviceId: number(),
29595
+ /** Placed on the node now (a standing attach or a running session). */
29596
+ placedOnNode: boolean(),
29597
+ /** A node pin naming this node, ignored for the run. */
29598
+ pinnedToNode: boolean()
29599
+ });
29600
+ /** A camera that cannot leave: no other node can obtain its frames. */
29601
+ var NodeBenchmarkStayingCameraSchema = object({
29602
+ deviceId: number(),
29603
+ reason: literal("only-frame-source")
29604
+ });
29605
+ var NodeBenchmarkPreflightSchema = object({
29606
+ nodeId: string(),
29607
+ online: boolean(),
29608
+ moving: array(NodeBenchmarkMovingCameraSchema).readonly(),
29609
+ /** Keep running on the node during the run; the result is flagged contaminated. */
29610
+ staying: array(NodeBenchmarkStayingCameraSchema).readonly(),
29611
+ estimatedDurationMs: number(),
29612
+ /** The run ends and the cluster is restored at the latest after this long. */
29613
+ budgetMs: number(),
29614
+ phases: array(NodeBenchmarkPhaseSchema).readonly(),
29615
+ steps: array(string()).readonly(),
29616
+ devices: array(NodeBenchmarkDevicePlanSchema).readonly(),
29617
+ /** Parallel sessions the cluster runs now, and what the other nodes can carry. */
29618
+ headroom: object({
29619
+ sessionsNow: number(),
29620
+ otherNodesCapacitySessions: number().nullable()
29621
+ }),
29622
+ refusals: array(NodeBenchmarkRefusalSchema).readonly(),
29623
+ canStart: boolean()
29624
+ });
29625
+ /** Where the measuring runner is. */
29626
+ var NodeBenchProgressSchema = object({
29627
+ phase: _enum([
29628
+ "preparing",
29629
+ "device",
29630
+ "pipeline",
29631
+ "cleanup"
29632
+ ]),
29633
+ deviceKey: string().nullable(),
29634
+ modelId: string().nullable(),
29635
+ /** Streams (device) or sessions (pipeline) of the step running now. */
29636
+ load: number().nullable(),
29637
+ cellsDone: number(),
29638
+ cellsTotal: number(),
29639
+ message: string()
29640
+ });
29641
+ /** What limited a ramp. `none` = the ramp ran out of steps still passing. */
29642
+ var NodeBenchLimitSchema = _enum([
29643
+ "p95",
29644
+ "drops",
29645
+ "errors",
29646
+ "stall",
29647
+ "cpu",
29648
+ "ram",
29649
+ "none"
29650
+ ]);
29651
+ var NodeBenchRampStepSchema = object({
29652
+ load: number(),
29653
+ pass: boolean(),
29654
+ p95Ms: number(),
29655
+ dropRatio: number(),
29656
+ /** Completed frames per second over the accounted window. */
29657
+ fps: number(),
29658
+ cpuPct: number().nullable(),
29659
+ ramFreePct: number().nullable(),
29660
+ failReasons: array(string()).readonly()
29661
+ });
29662
+ var NodeBenchCellSchema = discriminatedUnion("phase", [object({
29663
+ phase: literal("device"),
29664
+ deviceKey: string(),
29665
+ modelId: string(),
29666
+ /** Single-stream latency (the K = 1 step). */
29667
+ p50Ms: number(),
29668
+ p95Ms: number(),
29669
+ p99Ms: number(),
29670
+ /** Frames per second sustained at the last passing step. */
29671
+ fps: number(),
29672
+ /** Streams at the camera rate the device carried inside the frame interval; 0 = not even one. */
29673
+ kMax: number(),
29674
+ limitedBy: NodeBenchLimitSchema,
29675
+ /** First call (model load + warm-up). */
29676
+ warmupMs: number(),
29677
+ ramp: array(NodeBenchRampStepSchema).readonly()
29678
+ }), object({
29679
+ phase: literal("pipeline"),
29680
+ deviceKey: string(),
29681
+ modelId: string(),
29682
+ steps: array(string()).readonly(),
29683
+ /** Parallel sessions at the camera rate the node carried; 0 = not even one. */
29684
+ maxSessions: number(),
29685
+ limitedBy: NodeBenchLimitSchema,
29686
+ /** Detail steps that produced at least one result on the clip — a step that never fired measured nothing. */
29687
+ stepsFired: array(string()).readonly(),
29688
+ warmupMs: number(),
29689
+ ramp: array(NodeBenchRampStepSchema).readonly()
29690
+ })]);
29691
+ /**
29692
+ * What a result was measured ON. A result whose fingerprint no longer matches
29693
+ * the node no longer beats the table.
29694
+ */
29695
+ var NodeBenchFingerprintSchema = object({
29696
+ pipelineVersion: string().nullable(),
29697
+ cpuModel: string().nullable(),
29698
+ ramGb: number().nullable(),
29699
+ os: string().nullable(),
29700
+ /** Per device: the pool the cells ran on (runtime + tuning). */
29701
+ pools: record(string(), object({
29702
+ runtime: string(),
29703
+ numWorkers: number(),
29704
+ concurrency: number(),
29705
+ batchMode: string()
29706
+ })).default({})
29707
+ });
29708
+ /** The frames the run used. */
29709
+ var NodeBenchClipSchema = object({
29710
+ /** `camstack-bench-v1` or `reference-images` (the fallback when the clip is not reachable). */
29711
+ id: string(),
29712
+ revision: string().nullable(),
29713
+ frames: number(),
29714
+ width: number(),
29715
+ height: number()
29716
+ });
29717
+ var NodeBenchRunnerInputSchema = object({
29718
+ runId: string().min(1),
29719
+ devices: array(NodeBenchmarkDevicePlanSchema).min(1),
29720
+ phases: array(NodeBenchmarkPhaseSchema).min(1),
29721
+ /** The full detail step tree root for the `pipeline` measurement is built on the node from these ids. */
29722
+ steps: array(string()).default([]),
29723
+ fpsPerStream: number().int().min(1).max(30),
29724
+ /** The runner stops on its own past this instant, whatever the hub does. */
29725
+ deadlineAtMs: number(),
29726
+ settleSec: number().min(0).max(60).default(NODE_BENCHMARK_DEFAULTS.settleSec),
29727
+ measureSec: number().min(2).max(300).default(NODE_BENCHMARK_DEFAULTS.measureSec),
29728
+ keepDownloadedModels: boolean().default(false)
29729
+ });
29730
+ var NodeBenchRunnerStateSchema = _enum([
29731
+ "running",
29732
+ "done",
29733
+ "failed",
29734
+ "aborted"
29735
+ ]);
29736
+ var NodeBenchRunnerStatusSchema = object({
29737
+ runId: string(),
29738
+ nodeId: string(),
29739
+ state: NodeBenchRunnerStateSchema,
29740
+ progress: NodeBenchProgressSchema.nullable(),
29741
+ /** Every finished cell so far — a run stopped half way keeps what it measured. */
29742
+ cells: array(NodeBenchCellSchema).readonly(),
29743
+ fingerprint: NodeBenchFingerprintSchema.nullable(),
29744
+ clip: NodeBenchClipSchema.nullable(),
29745
+ /** Cameras seen running on the node during the run (they share its pools). */
29746
+ activeCameraIds: array(number()).readonly(),
29747
+ /** Models the run downloaded and then deleted (not installed before). */
29748
+ deletedModels: array(string()).readonly(),
29749
+ error: string().nullable(),
29750
+ startedAtMs: number(),
29751
+ finishedAtMs: number().nullable()
29752
+ });
29753
+ var NodeBenchmarkStateSchema = _enum([
29754
+ "draining",
29755
+ "measuring",
29756
+ "restoring",
29757
+ "done",
29758
+ "failed",
29759
+ "aborted"
29760
+ ]);
29761
+ /** Why a run ended. */
29762
+ var NodeBenchmarkEndReasonSchema = _enum([
29763
+ "completed",
29764
+ "operator-abort",
29765
+ "deadline",
29766
+ "node-lost",
29767
+ "runner-lost",
29768
+ "hub-restart",
29769
+ "drain-timeout",
29770
+ "failed"
29771
+ ]);
29772
+ var NodeBenchmarkRunSchema = object({
29773
+ runId: string(),
29774
+ nodeId: string(),
29775
+ state: NodeBenchmarkStateSchema,
29776
+ plan: NodeBenchmarkPlanSchema,
29777
+ startedAtMs: number(),
29778
+ deadlineAtMs: number(),
29779
+ finishedAtMs: number().nullable(),
29780
+ endReason: NodeBenchmarkEndReasonSchema.nullable(),
29781
+ error: string().nullable(),
29782
+ /** Cameras moved off the node for the run. */
29783
+ moved: array(number()).readonly(),
29784
+ /** Cameras that stayed (their only frame source is the node). */
29785
+ staying: array(number()).readonly(),
29786
+ /** Something else ran on the node's pools during the run. */
29787
+ contaminated: boolean(),
29788
+ progress: NodeBenchProgressSchema.nullable(),
29789
+ resultIds: array(string()).readonly()
29790
+ });
29791
+ /** `getNodeBenchmarkStatus`: the active run (or the last one), and whether benchmark mode is on. */
29792
+ var NodeBenchmarkStatusSchema = object({
29793
+ /** The node the cluster is in benchmark mode for; null = none. */
29794
+ modeNodeId: string().nullable(),
29795
+ run: NodeBenchmarkRunSchema.nullable()
29796
+ });
29797
+ /**
29798
+ * One stored measurement — the only authority Auto tune and the automatic
29799
+ * shares read measured capacity from. Written by the orchestrator when a run
29800
+ * ends, never by anyone else.
29801
+ */
29802
+ var NodeBenchmarkResultSchema = object({
29803
+ id: string(),
29804
+ runId: string(),
29805
+ nodeId: string(),
29806
+ cell: NodeBenchCellSchema,
29807
+ fpsPerStream: number(),
29808
+ fingerprint: NodeBenchFingerprintSchema.nullable(),
29809
+ clip: NodeBenchClipSchema.nullable(),
29810
+ /** Other work shared the node's pools (a camera that could not move, or the hub's own duties). */
29811
+ contaminated: boolean(),
29812
+ stayingCameras: array(number()).readonly(),
29813
+ /** The run ended early; the cell itself completed. */
29814
+ partialRun: boolean(),
29815
+ measuredAtMs: number()
29816
+ });
29817
+ var ListNodeBenchmarkResultsInputSchema = object({
29818
+ nodeId: string().optional(),
29819
+ deviceKey: string().optional()
29820
+ });
29821
+ /** A result with its standing today: does it still beat the table? */
29822
+ var NodeBenchmarkResultViewSchema = NodeBenchmarkResultSchema.extend({
29823
+ /** `fresh` beats the table; `stale` falls back to it; `superseded` = a newer row covers the same cell. */
29824
+ standing: _enum([
29825
+ "fresh",
29826
+ "stale",
29827
+ "superseded"
29828
+ ]),
29829
+ staleWhy: _enum([
29830
+ "age",
29831
+ "runtime",
29832
+ "pool-tuning"
29833
+ ]).nullable()
29834
+ });
29835
+ object({
29836
+ runId: string(),
29837
+ nodeId: string(),
29838
+ startedAtMs: number(),
29839
+ deadlineAtMs: number(),
29840
+ plan: NodeBenchmarkPlanSchema,
29841
+ moved: array(number()).readonly(),
29842
+ staying: array(number()).readonly()
29843
+ });
29844
+ /** Candidate detectors per device, for the plan editor. */
29845
+ var NodeBenchmarkCandidatesSchema = object({
29846
+ nodeId: string(),
29847
+ reachable: boolean(),
29848
+ devices: array(object({
29849
+ deviceKey: string(),
29850
+ enabled: boolean(),
29851
+ available: boolean(),
29852
+ /** Ordered: what Auto tune would pick first, then the rest of the family by accuracy. */
29853
+ suggested: array(string()).readonly(),
29854
+ /** Every root detector the device has a build for. */
29855
+ all: array(string()).readonly(),
29856
+ /** The model the device runs now, when pinned. */
29857
+ currentModelId: string().nullable()
29858
+ })).readonly(),
29859
+ /** Detail steps the node's catalog offers under the root (for the `pipeline` measurement). */
29860
+ steps: array(object({
29861
+ id: string(),
29862
+ name: string(),
29863
+ slot: string()
29864
+ })).readonly()
29865
+ });
28186
29866
  object({
28187
29867
  activeCameras: number(),
28188
29868
  throttledCameras: number(),
@@ -29501,7 +31181,30 @@ var pipelineRunnerCapability = {
29501
31181
  releaseParkedTrackFrames: method(object({
29502
31182
  deviceId: number(),
29503
31183
  trackId: string()
29504
- }), object({ released: number().int().nonnegative() }), { kind: "mutation" })
31184
+ }), object({ released: number().int().nonnegative() }), { kind: "mutation" }),
31185
+ /**
31186
+ * Start measuring THIS node for the orchestrator's node benchmark: the
31187
+ * bench clip decoded once into RAM, each device × candidate detector on an
31188
+ * open-loop ramp (`device`), then the chosen pipeline with the requested
31189
+ * detail steps (`pipeline`). Everything runs in-process with the executor
31190
+ * — no frame crosses a node (D9) — and writes nothing: no track, event,
31191
+ * media or notification. Reached by `nodePin(nodeId)`. Answers at once;
31192
+ * one run per node; the run stops itself at `deadlineAtMs`.
31193
+ */
31194
+ startNodeBench: method(NodeBenchRunnerInputSchema, object({
31195
+ accepted: literal(true),
31196
+ runId: string()
31197
+ }), {
31198
+ kind: "mutation",
31199
+ auth: "admin"
31200
+ }),
31201
+ /** The run's progress and every finished cell; null when this runner does not know `runId`. */
31202
+ getNodeBenchStatus: method(object({ runId: string() }), NodeBenchRunnerStatusSchema.nullable(), { auth: "admin" }),
31203
+ /** Stop the run; what it finished is kept. */
31204
+ abortNodeBench: method(object({ runId: string() }), object({ aborted: boolean() }), {
31205
+ kind: "mutation",
31206
+ auth: "admin"
31207
+ })
29505
31208
  }
29506
31209
  };
29507
31210
  var CameraPipelineConfigSchema = object({
@@ -30429,6 +32132,51 @@ var pipelineOrchestratorCapability = {
30429
32132
  kind: "mutation",
30430
32133
  auth: "admin"
30431
32134
  }),
32135
+ /**
32136
+ * Node benchmark — what a run of this plan would do, without doing it:
32137
+ * the cameras that leave the node, those that cannot (the node is their
32138
+ * only frame source; they stay and flag the run), the estimated duration
32139
+ * and every reason it may not start. The confirmation shows this.
32140
+ */
32141
+ getNodeBenchmarkPreflight: method(NodeBenchmarkPlanSchema, NodeBenchmarkPreflightSchema, { auth: "admin" }),
32142
+ /**
32143
+ * Node benchmark — start ONE run (cluster-wide lock). The orchestrator
32144
+ * persists a restore manifest, enters benchmark mode for the node (out of
32145
+ * placement, its camera pins ignored, nothing rewritten), drains it, drives
32146
+ * the node's own runner, then restores — always, including after an
32147
+ * abort, a lost node or a hub restart. Answers at once; poll
32148
+ * `getNodeBenchmarkStatus`. Refused runs carry the preflight.
32149
+ */
32150
+ startNodeBenchmark: method(NodeBenchmarkPlanSchema, discriminatedUnion("kind", [object({
32151
+ kind: literal("started"),
32152
+ runId: string()
32153
+ }), object({
32154
+ kind: literal("refused"),
32155
+ preflight: NodeBenchmarkPreflightSchema
32156
+ })]), {
32157
+ kind: "mutation",
32158
+ auth: "admin"
32159
+ }),
32160
+ /** Node benchmark — the active run (or the last one) and the node in benchmark mode. */
32161
+ getNodeBenchmarkStatus: method(_void(), NodeBenchmarkStatusSchema, { auth: "admin" }),
32162
+ /** Node benchmark — stop the active run; the cluster is restored as it was. */
32163
+ abortNodeBenchmark: method(object({ runId: string() }), object({ aborted: boolean() }), {
32164
+ kind: "mutation",
32165
+ auth: "admin"
32166
+ }),
32167
+ /**
32168
+ * Node benchmark — root detector candidates per device (what Auto tune
32169
+ * would pick first, then the family) and the detail steps the node's
32170
+ * catalog offers, for the plan editor.
32171
+ */
32172
+ getNodeBenchmarkCandidates: method(object({ nodeId: string() }), NodeBenchmarkCandidatesSchema, { auth: "admin" }),
32173
+ /** Node benchmark — stored results, newest first, each with its standing today. */
32174
+ listNodeBenchmarkResults: method(ListNodeBenchmarkResultsInputSchema, array(NodeBenchmarkResultViewSchema).readonly(), { auth: "admin" }),
32175
+ /** Node benchmark — delete one result; Auto tune and the shares stop reading it. */
32176
+ deleteNodeBenchmarkResult: method(object({ id: string() }), object({ deleted: boolean() }), {
32177
+ kind: "mutation",
32178
+ auth: "admin"
32179
+ }),
30432
32180
  /** Read one camera's settings. Null when never touched (inherits agent defaults fully). */
30433
32181
  getCameraSettings: method(object({ deviceId: number() }), CameraPipelineSettingsSchema.nullable()),
30434
32182
  /** Set or clear the 3-state toggle for one (camera, addonId). Pass `enabled: null` to clear and revert to agent default. */
@@ -31318,7 +33066,19 @@ var SsoBridgeClaimsSchema = object({
31318
33066
  * editing a descriptor must not retroactively extend or shorten a link the
31319
33067
  * operator already consented to.
31320
33068
  */
31321
- refreshTtl: union([number().int().positive(), literal("never")]).optional()
33069
+ refreshTtl: union([number().int().positive(), literal("never")]).optional(),
33070
+ /**
33071
+ * Opaque handle of a hub-side LINK intent (D782). Set by an OIDC callback
33072
+ * that was started from a signed-in user's "Link" button: the finish then
33073
+ * links this identity to the intent's user instead of signing anyone in.
33074
+ * The handle carries no user id — the hub resolves it, single-use.
33075
+ */
33076
+ linkIntent: string().optional(),
33077
+ /**
33078
+ * Verified `iss` of the id_token behind an OIDC login bridge (D782). A
33079
+ * subject is unique only per issuer, so a link is bound to it.
33080
+ */
33081
+ issuer: string().optional()
31322
33082
  });
31323
33083
  var ssoBridgeCapability = {
31324
33084
  name: "sso-bridge",
@@ -33847,7 +35607,22 @@ var webrtcSessionCapability = {
33847
35607
  * field their hints were silently stripped by the schema and the
33848
35608
  * adaptive ladder started blind on the client's display size.
33849
35609
  */
33850
- hints: webrtcClientHintsSchema.optional()
35610
+ hints: webrtcClientHintsSchema.optional(),
35611
+ /**
35612
+ * Talk-back (D771): relay the PEER's audio to the device's speaker
35613
+ * through the `intercom` cap's push-talk triple. When `true` and the
35614
+ * offer lets the peer send audio, the answer's audio is `sendrecv`
35615
+ * and every inbound frame goes to `intercom.pushTalkAudio` for this
35616
+ * `deviceId`; absent/false answers `sendonly`, as for every viewer.
35617
+ *
35618
+ * TRUSTED-CALLER ONLY. Set by the Alexa export for an Echo on a camera
35619
+ * with `intercom`, when the linked user may control that camera. The
35620
+ * hub STRIPS it from every request-bound call (a browser), exactly as
35621
+ * it overwrites `relayOnly` — a viewer's talk permission is the
35622
+ * intercom cap's own surface (share tokens gate it there), and this
35623
+ * flag must not become a second door to the camera's speaker.
35624
+ */
35625
+ talkback: boolean().optional()
33851
35626
  }), object({
33852
35627
  sessionId: string(),
33853
35628
  sdpAnswer: string()
@@ -37818,6 +39593,9 @@ var CreateIntegrationInputSchema = object({
37818
39593
  enabled: boolean().optional(),
37819
39594
  info: record(string(), unknown()).optional(),
37820
39595
  settings: record(string(), unknown()).optional(),
39596
+ /** Keys of `settings` the form's schema declares secret (by type) — kept in
39597
+ * the keychain, not the table (D787). */
39598
+ secretKeys: array(string()).optional(),
37821
39599
  skipRestart: boolean().optional()
37822
39600
  });
37823
39601
  var UpdateIntegrationInputSchema = object({
@@ -37853,7 +39631,9 @@ var integrationsCapability = {
37853
39631
  getSettings: method(object({ id: string() }), record(string(), unknown()), { auth: "admin" }),
37854
39632
  setSettings: method(object({
37855
39633
  id: string(),
37856
- settings: record(string(), unknown())
39634
+ settings: record(string(), unknown()),
39635
+ /** Keys the form's schema declares secret (by type) — keychain-stored (D787). */
39636
+ secretKeys: array(string()).optional()
37857
39637
  }), object({ success: boolean() }), {
37858
39638
  kind: "mutation",
37859
39639
  auth: "admin"
@@ -45653,6 +47433,22 @@ var TotpStatusSchema = object({
45653
47433
  * delegation, structural caller-scope subset check goes inside the
45654
47434
  * provider.
45655
47435
  */
47436
+ var ExternalIdentitySchema = object({
47437
+ /** Login-method id of the provider instance, e.g. `auth-oidc/authentik`. */
47438
+ provider: string(),
47439
+ /** The IdP's stable subject (`sub`) for this account. */
47440
+ subject: string(),
47441
+ /** The verified `iss` of the IdP the identity was linked under — `sub` is unique only per issuer. */
47442
+ issuer: string(),
47443
+ userId: string(),
47444
+ /** What the IdP called the account at link time (username / email) — display only. */
47445
+ label: string().optional(),
47446
+ linkedAt: number()
47447
+ });
47448
+ var ExternalIdentityKeySchema = object({
47449
+ provider: string().min(1),
47450
+ subject: string().min(1)
47451
+ });
45656
47452
  var userManagementCapability = {
45657
47453
  name: "user-management",
45658
47454
  scope: "system",
@@ -45795,6 +47591,32 @@ var userManagementCapability = {
45795
47591
  username: string(),
45796
47592
  scopes: array(TokenScopeSchema)
45797
47593
  }).nullable(), { access: "view" }),
47594
+ listExternalIdentities: method(object({ userId: string() }), array(ExternalIdentitySchema), { auth: "admin" }),
47595
+ /** The user an identity is linked to, or `null`. */
47596
+ findUserByExternalIdentity: method(ExternalIdentityKeySchema, object({
47597
+ userId: string(),
47598
+ issuer: string()
47599
+ }).nullable(), { auth: "admin" }),
47600
+ /**
47601
+ * Link `(provider, subject)` to `userId`. Idempotent for the same user;
47602
+ * REFUSES (throws) an identity already linked to another user, and a
47603
+ * user that does not exist.
47604
+ */
47605
+ linkExternalIdentity: method(ExternalIdentityKeySchema.extend({
47606
+ userId: string(),
47607
+ issuer: string().min(1),
47608
+ label: string().optional()
47609
+ }), object({ success: literal(true) }), {
47610
+ kind: "mutation",
47611
+ auth: "admin",
47612
+ access: "create"
47613
+ }),
47614
+ /** Remove one link of `userId`. `success: false` when it was not linked to that user. */
47615
+ unlinkExternalIdentity: method(ExternalIdentityKeySchema.extend({ userId: string() }), object({ success: boolean() }), {
47616
+ kind: "mutation",
47617
+ auth: "admin",
47618
+ access: "delete"
47619
+ }),
45798
47620
  listOauthSessions: method(_void(), array(OauthSessionSummarySchema), { auth: "admin" }),
45799
47621
  revokeOauthSession: method(object({ id: string() }), object({ success: boolean() }), {
45800
47622
  kind: "mutation",
@@ -49466,6 +51288,90 @@ Object.freeze({
49466
51288
  addonId: null,
49467
51289
  access: "create"
49468
51290
  },
51291
+ "keychain.delete": {
51292
+ capName: "keychain",
51293
+ capScope: "system",
51294
+ addonId: null,
51295
+ access: "delete"
51296
+ },
51297
+ "keychain.getState": {
51298
+ capName: "keychain",
51299
+ capScope: "system",
51300
+ addonId: null,
51301
+ access: "view"
51302
+ },
51303
+ "keychain.listMeta": {
51304
+ capName: "keychain",
51305
+ capScope: "system",
51306
+ addonId: null,
51307
+ access: "view"
51308
+ },
51309
+ "keychain.put": {
51310
+ capName: "keychain",
51311
+ capScope: "system",
51312
+ addonId: null,
51313
+ access: "create"
51314
+ },
51315
+ "keychain.resolve": {
51316
+ capName: "keychain",
51317
+ capScope: "system",
51318
+ addonId: null,
51319
+ access: "view"
51320
+ },
51321
+ "keychainAdmin.deleteOrphans": {
51322
+ capName: "keychain-admin",
51323
+ capScope: "system",
51324
+ addonId: null,
51325
+ access: "delete"
51326
+ },
51327
+ "keychainAdmin.downloadRecoveryKey": {
51328
+ capName: "keychain-admin",
51329
+ capScope: "system",
51330
+ addonId: null,
51331
+ access: "create"
51332
+ },
51333
+ "keychainAdmin.listAudit": {
51334
+ capName: "keychain-admin",
51335
+ capScope: "system",
51336
+ addonId: null,
51337
+ access: "view"
51338
+ },
51339
+ "keychainAdmin.listSecrets": {
51340
+ capName: "keychain-admin",
51341
+ capScope: "system",
51342
+ addonId: null,
51343
+ access: "view"
51344
+ },
51345
+ "keychainAdmin.purgeRetiredKeys": {
51346
+ capName: "keychain-admin",
51347
+ capScope: "system",
51348
+ addonId: null,
51349
+ access: "delete"
51350
+ },
51351
+ "keychainAdmin.resetKeychain": {
51352
+ capName: "keychain-admin",
51353
+ capScope: "system",
51354
+ addonId: null,
51355
+ access: "delete"
51356
+ },
51357
+ "keychainAdmin.reveal": {
51358
+ capName: "keychain-admin",
51359
+ capScope: "system",
51360
+ addonId: null,
51361
+ access: "create"
51362
+ },
51363
+ "keychainAdmin.rotateMasterKey": {
51364
+ capName: "keychain-admin",
51365
+ capScope: "system",
51366
+ addonId: null,
51367
+ access: "create"
51368
+ },
51369
+ "keychainAdmin.status": {
51370
+ capName: "keychain-admin",
51371
+ capScope: "system",
51372
+ addonId: null,
51373
+ access: "view"
51374
+ },
49469
51375
  "lawnMowerControl.dock": {
49470
51376
  capName: "lawn-mower-control",
49471
51377
  capScope: "device",
@@ -50840,6 +52746,18 @@ Object.freeze({
50840
52746
  addonId: null,
50841
52747
  access: "create"
50842
52748
  },
52749
+ "pipelineAnalytics.addRetrainFrameFromRecording": {
52750
+ capName: "pipeline-analytics",
52751
+ capScope: "device",
52752
+ addonId: null,
52753
+ access: "create"
52754
+ },
52755
+ "pipelineAnalytics.addRetrainFramesToCollection": {
52756
+ capName: "pipeline-analytics",
52757
+ capScope: "device",
52758
+ addonId: null,
52759
+ access: "create"
52760
+ },
50843
52761
  "pipelineAnalytics.applyDeviceSettingsPatch": {
50844
52762
  capName: "pipeline-analytics",
50845
52763
  capScope: "device",
@@ -50888,12 +52806,24 @@ Object.freeze({
50888
52806
  addonId: null,
50889
52807
  access: "view"
50890
52808
  },
52809
+ "pipelineAnalytics.createRetrainCollection": {
52810
+ capName: "pipeline-analytics",
52811
+ capScope: "device",
52812
+ addonId: null,
52813
+ access: "create"
52814
+ },
50891
52815
  "pipelineAnalytics.deleteDeviceEvents": {
50892
52816
  capName: "pipeline-analytics",
50893
52817
  capScope: "device",
50894
52818
  addonId: null,
50895
52819
  access: "delete"
50896
52820
  },
52821
+ "pipelineAnalytics.deleteRetrainCollection": {
52822
+ capName: "pipeline-analytics",
52823
+ capScope: "device",
52824
+ addonId: null,
52825
+ access: "delete"
52826
+ },
50897
52827
  "pipelineAnalytics.deleteTracks": {
50898
52828
  capName: "pipeline-analytics",
50899
52829
  capScope: "device",
@@ -51098,6 +53028,24 @@ Object.freeze({
51098
53028
  addonId: null,
51099
53029
  access: "view"
51100
53030
  },
53031
+ "pipelineAnalytics.listRetrainAssistProfiles": {
53032
+ capName: "pipeline-analytics",
53033
+ capScope: "device",
53034
+ addonId: null,
53035
+ access: "view"
53036
+ },
53037
+ "pipelineAnalytics.listRetrainCollectionFrames": {
53038
+ capName: "pipeline-analytics",
53039
+ capScope: "device",
53040
+ addonId: null,
53041
+ access: "view"
53042
+ },
53043
+ "pipelineAnalytics.listRetrainCollections": {
53044
+ capName: "pipeline-analytics",
53045
+ capScope: "device",
53046
+ addonId: null,
53047
+ access: "view"
53048
+ },
51101
53049
  "pipelineAnalytics.listRetrainFrames": {
51102
53050
  capName: "pipeline-analytics",
51103
53051
  capScope: "device",
@@ -51146,6 +53094,12 @@ Object.freeze({
51146
53094
  addonId: null,
51147
53095
  access: "create"
51148
53096
  },
53097
+ "pipelineAnalytics.proposeRetrainAnnotationsWithLlm": {
53098
+ capName: "pipeline-analytics",
53099
+ capScope: "device",
53100
+ addonId: null,
53101
+ access: "create"
53102
+ },
51149
53103
  "pipelineAnalytics.pruneEvents": {
51150
53104
  capName: "pipeline-analytics",
51151
53105
  capScope: "device",
@@ -51200,6 +53154,18 @@ Object.freeze({
51200
53154
  addonId: null,
51201
53155
  access: "create"
51202
53156
  },
53157
+ "pipelineAnalytics.removeRetrainFrameFromCollection": {
53158
+ capName: "pipeline-analytics",
53159
+ capScope: "device",
53160
+ addonId: null,
53161
+ access: "delete"
53162
+ },
53163
+ "pipelineAnalytics.renameRetrainCollection": {
53164
+ capName: "pipeline-analytics",
53165
+ capScope: "device",
53166
+ addonId: null,
53167
+ access: "create"
53168
+ },
51203
53169
  "pipelineAnalytics.restageRetrainTrack": {
51204
53170
  capName: "pipeline-analytics",
51205
53171
  capScope: "device",
@@ -51230,6 +53196,12 @@ Object.freeze({
51230
53196
  addonId: null,
51231
53197
  access: "create"
51232
53198
  },
53199
+ "pipelineAnalytics.setRetrainFrameComplete": {
53200
+ capName: "pipeline-analytics",
53201
+ capScope: "device",
53202
+ addonId: null,
53203
+ access: "create"
53204
+ },
51233
53205
  "pipelineAnalytics.setTrackFlags": {
51234
53206
  capName: "pipeline-analytics",
51235
53207
  capScope: "device",
@@ -51266,6 +53238,12 @@ Object.freeze({
51266
53238
  addonId: null,
51267
53239
  access: "delete"
51268
53240
  },
53241
+ "pipelineAnalytics.writeRetrainArchive": {
53242
+ capName: "pipeline-analytics",
53243
+ capScope: "device",
53244
+ addonId: null,
53245
+ access: "create"
53246
+ },
51269
53247
  "pipelineExecutor.cacheFrameInPool": {
51270
53248
  capName: "pipeline-executor",
51271
53249
  capScope: "system",
@@ -51476,6 +53454,12 @@ Object.freeze({
51476
53454
  addonId: null,
51477
53455
  access: "view"
51478
53456
  },
53457
+ "pipelineOrchestrator.abortNodeBenchmark": {
53458
+ capName: "pipeline-orchestrator",
53459
+ capScope: "system",
53460
+ addonId: null,
53461
+ access: "create"
53462
+ },
51479
53463
  "pipelineOrchestrator.applyAutoTune": {
51480
53464
  capName: "pipeline-orchestrator",
51481
53465
  capScope: "system",
@@ -51500,6 +53484,12 @@ Object.freeze({
51500
53484
  addonId: null,
51501
53485
  access: "create"
51502
53486
  },
53487
+ "pipelineOrchestrator.deleteNodeBenchmarkResult": {
53488
+ capName: "pipeline-orchestrator",
53489
+ capScope: "system",
53490
+ addonId: null,
53491
+ access: "delete"
53492
+ },
51503
53493
  "pipelineOrchestrator.getAgentLoad": {
51504
53494
  capName: "pipeline-orchestrator",
51505
53495
  capScope: "system",
@@ -51608,6 +53598,24 @@ Object.freeze({
51608
53598
  addonId: null,
51609
53599
  access: "view"
51610
53600
  },
53601
+ "pipelineOrchestrator.getNodeBenchmarkCandidates": {
53602
+ capName: "pipeline-orchestrator",
53603
+ capScope: "system",
53604
+ addonId: null,
53605
+ access: "view"
53606
+ },
53607
+ "pipelineOrchestrator.getNodeBenchmarkPreflight": {
53608
+ capName: "pipeline-orchestrator",
53609
+ capScope: "system",
53610
+ addonId: null,
53611
+ access: "view"
53612
+ },
53613
+ "pipelineOrchestrator.getNodeBenchmarkStatus": {
53614
+ capName: "pipeline-orchestrator",
53615
+ capScope: "system",
53616
+ addonId: null,
53617
+ access: "view"
53618
+ },
51611
53619
  "pipelineOrchestrator.getNodeInferenceDevices": {
51612
53620
  capName: "pipeline-orchestrator",
51613
53621
  capScope: "system",
@@ -51650,6 +53658,12 @@ Object.freeze({
51650
53658
  addonId: null,
51651
53659
  access: "view"
51652
53660
  },
53661
+ "pipelineOrchestrator.listNodeBenchmarkResults": {
53662
+ capName: "pipeline-orchestrator",
53663
+ capScope: "system",
53664
+ addonId: null,
53665
+ access: "view"
53666
+ },
51653
53667
  "pipelineOrchestrator.pauseForStorageMigration": {
51654
53668
  capName: "pipeline-orchestrator",
51655
53669
  capScope: "system",
@@ -51794,6 +53808,12 @@ Object.freeze({
51794
53808
  addonId: null,
51795
53809
  access: "create"
51796
53810
  },
53811
+ "pipelineOrchestrator.startNodeBenchmark": {
53812
+ capName: "pipeline-orchestrator",
53813
+ capScope: "system",
53814
+ addonId: null,
53815
+ access: "create"
53816
+ },
51797
53817
  "pipelineOrchestrator.suggestShares": {
51798
53818
  capName: "pipeline-orchestrator",
51799
53819
  capScope: "system",
@@ -51812,6 +53832,12 @@ Object.freeze({
51812
53832
  addonId: null,
51813
53833
  access: "create"
51814
53834
  },
53835
+ "pipelineRunner.abortNodeBench": {
53836
+ capName: "pipeline-runner",
53837
+ capScope: "system",
53838
+ addonId: null,
53839
+ access: "create"
53840
+ },
51815
53841
  "pipelineRunner.attachCamera": {
51816
53842
  capName: "pipeline-runner",
51817
53843
  capScope: "system",
@@ -51860,6 +53886,12 @@ Object.freeze({
51860
53886
  addonId: null,
51861
53887
  access: "view"
51862
53888
  },
53889
+ "pipelineRunner.getNodeBenchStatus": {
53890
+ capName: "pipeline-runner",
53891
+ capScope: "system",
53892
+ addonId: null,
53893
+ access: "view"
53894
+ },
51863
53895
  "pipelineRunner.getParkedTrackFrame": {
51864
53896
  capName: "pipeline-runner",
51865
53897
  capScope: "system",
@@ -51902,6 +53934,12 @@ Object.freeze({
51902
53934
  addonId: null,
51903
53935
  access: "create"
51904
53936
  },
53937
+ "pipelineRunner.startNodeBench": {
53938
+ capName: "pipeline-runner",
53939
+ capScope: "system",
53940
+ addonId: null,
53941
+ access: "create"
53942
+ },
51905
53943
  "plateGallery.assignPlate": {
51906
53944
  capName: "plate-gallery",
51907
53945
  capScope: "system",
@@ -53618,18 +55656,36 @@ Object.freeze({
53618
55656
  addonId: null,
53619
55657
  access: "delete"
53620
55658
  },
55659
+ "userManagement.findUserByExternalIdentity": {
55660
+ capName: "user-management",
55661
+ capScope: "system",
55662
+ addonId: null,
55663
+ access: "view"
55664
+ },
53621
55665
  "userManagement.getTotpStatus": {
53622
55666
  capName: "user-management",
53623
55667
  capScope: "system",
53624
55668
  addonId: null,
53625
55669
  access: "view"
53626
55670
  },
55671
+ "userManagement.linkExternalIdentity": {
55672
+ capName: "user-management",
55673
+ capScope: "system",
55674
+ addonId: null,
55675
+ access: "create"
55676
+ },
53627
55677
  "userManagement.listApiKeys": {
53628
55678
  capName: "user-management",
53629
55679
  capScope: "system",
53630
55680
  addonId: null,
53631
55681
  access: "view"
53632
55682
  },
55683
+ "userManagement.listExternalIdentities": {
55684
+ capName: "user-management",
55685
+ capScope: "system",
55686
+ addonId: null,
55687
+ access: "view"
55688
+ },
53633
55689
  "userManagement.listOauthSessions": {
53634
55690
  capName: "user-management",
53635
55691
  capScope: "system",
@@ -53708,6 +55764,12 @@ Object.freeze({
53708
55764
  addonId: null,
53709
55765
  access: "create"
53710
55766
  },
55767
+ "userManagement.unlinkExternalIdentity": {
55768
+ capName: "user-management",
55769
+ capScope: "system",
55770
+ addonId: null,
55771
+ access: "delete"
55772
+ },
53711
55773
  "userManagement.updateUser": {
53712
55774
  capName: "user-management",
53713
55775
  capScope: "system",
@@ -55557,6 +57619,8 @@ var ALL_CAPABILITY_DEFINITIONS = [
55557
57619
  imageSettingsCapability,
55558
57620
  integrationsCapability,
55559
57621
  intercomCapability,
57622
+ keychainCapability,
57623
+ keychainAdminCapability,
55560
57624
  lawnMowerControlCapability,
55561
57625
  llmCapability,
55562
57626
  llmRuntimeCapability,
@@ -56983,6 +59047,11 @@ Object.freeze({
56983
59047
  form: "single",
56984
59048
  optional: false
56985
59049
  }],
59050
+ "pipelineAnalytics.addRetrainFrameFromRecording": [{
59051
+ name: "deviceId",
59052
+ form: "single",
59053
+ optional: false
59054
+ }],
56986
59055
  "pipelineAnalytics.applyDeviceSettingsPatch": [{
56987
59056
  name: "deviceId",
56988
59057
  form: "single",
@@ -57173,6 +59242,11 @@ Object.freeze({
57173
59242
  form: "single",
57174
59243
  optional: false
57175
59244
  }],
59245
+ "pipelineAnalytics.proposeRetrainAnnotationsWithLlm": [{
59246
+ name: "deviceId",
59247
+ form: "single",
59248
+ optional: false
59249
+ }],
57176
59250
  "pipelineAnalytics.pruneEventsBefore": [{
57177
59251
  name: "deviceId",
57178
59252
  form: "single",
@@ -57223,6 +59297,11 @@ Object.freeze({
57223
59297
  form: "single",
57224
59298
  optional: false
57225
59299
  }],
59300
+ "pipelineAnalytics.setRetrainFrameComplete": [{
59301
+ name: "deviceId",
59302
+ form: "single",
59303
+ optional: false
59304
+ }],
57226
59305
  "pipelineAnalytics.setTrackFlags": [{
57227
59306
  name: "deviceId",
57228
59307
  form: "single",