@camstack/addon-model-studio 1.1.217 → 1.1.219

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 (21) hide show
  1. package/dist/{MotionZonesSettings-B4T-Lq49.mjs → MotionZonesSettings-iznKgqTW.mjs} +2 -2
  2. package/dist/{PrivacyMaskSettings-RuT2sLzN.mjs → PrivacyMaskSettings-C6wGkgut.mjs} +4 -4
  3. package/dist/{SceneMonitorEditor-BnWT3tyK.mjs → SceneMonitorEditor-DJAIMI8W.mjs} +3 -3
  4. package/dist/_stub.js +4770 -4773
  5. package/dist/{_virtual_mf-localSharedImportMap___mfe_internal__addon_model_studio_page-BPVoz67A.mjs → _virtual_mf-localSharedImportMap___mfe_internal__addon_model_studio_page-gHc6KKdS.mjs} +3 -3
  6. package/dist/_virtual_mf___mfe_internal__addon_model_studio_page__loadShare___mf_0_camstack_mf_1_types__loadShare__.js-ClV5IShH.mjs +26 -0
  7. package/dist/addon-model-studio.css +1 -1
  8. package/dist/{hostInit-zqvyamS8.mjs → hostInit-8-vvEvUj.mjs} +2 -2
  9. package/dist/model-studio.addon.js +1978 -60
  10. package/dist/model-studio.addon.mjs +1978 -60
  11. package/dist/{player-overlays-BU4aAx02.mjs → player-overlays-DDqfVhHf.mjs} +1 -1
  12. package/dist/remoteEntry.js +1 -1
  13. package/dist/{responsive-CU7BiLwa.mjs → responsive-sVlbSBci.mjs} +1 -1
  14. package/dist/{scene-monitor-copy-BX9UvcxQ.mjs → scene-monitor-copy-D_xseg_c.mjs} +1 -1
  15. package/dist/{square-DhCedQoj.mjs → square-VW_5OacX.mjs} +1 -1
  16. package/dist/{trash-2-BCjCExeI.mjs → trash-2-C1-_5_yP.mjs} +1 -1
  17. package/dist/{virtual_mf-REMOTE_ENTRY_ID___mfe_internal__addon_model_studio_page__remoteEntry_js-XvoS0Enz.mjs → virtual_mf-REMOTE_ENTRY_ID___mfe_internal__addon_model_studio_page__remoteEntry_js-BgyWayNh.mjs} +1 -1
  18. package/package.json +1 -1
  19. package/python/__tests__/test_calibration.py +56 -0
  20. package/python/convert_lib.py +45 -16
  21. package/dist/_virtual_mf___mfe_internal__addon_model_studio_page__loadShare___mf_0_camstack_mf_1_types__loadShare__.js-DgQsf8Wc.mjs +0 -26
@@ -393,7 +393,7 @@ function buildScryptedRegistryDescriptor(entry) {
393
393
  };
394
394
  }
395
395
  //#endregion
396
- //#region ../types/dist/event-category-B_0XEcLF.mjs
396
+ //#region ../types/dist/event-category-DaIZi00R.mjs
397
397
  var EventCategory = /* @__PURE__ */ function(EventCategory) {
398
398
  EventCategory["SystemBoot"] = "system.boot";
399
399
  EventCategory["SystemAddonsReady"] = "system.addons-ready";
@@ -472,6 +472,13 @@ var EventCategory = /* @__PURE__ */ function(EventCategory) {
472
472
  */
473
473
  EventCategory["AddonLoadFailed"] = "addon.load-failed";
474
474
  /**
475
+ * A keychain value was stored or removed (D787). Carries the ref, its
476
+ * owner and the new version — NEVER the value. A process holding the ref
477
+ * drops its cached copy and the owning `BaseAddon` re-resolves its config.
478
+ * Telemetry (D8): a process that misses it still revalidates by version.
479
+ */
480
+ EventCategory["KeychainChanged"] = "keychain.changed";
481
+ /**
475
482
  * Addon recovered from a previous failure. Emitted when an addon
476
483
  * transitions from `failed` back to `healthy` (typically via the
477
484
  * monitor's auto-retry loop, or after manual `addons.retryLoad`).
@@ -5764,7 +5771,7 @@ var ZodIssueCode = {
5764
5771
  var ZodFirstPartyTypeKind;
5765
5772
  ZodFirstPartyTypeKind || (ZodFirstPartyTypeKind = {});
5766
5773
  //#endregion
5767
- //#region ../types/dist/sleep-BNeXenvr.mjs
5774
+ //#region ../types/dist/sleep-Cr5YOk3m.mjs
5768
5775
  /**
5769
5776
  * The audio chunk plane's byte format, and the ONE expansion from a coded
5770
5777
  * window to float samples (D455).
@@ -5843,6 +5850,97 @@ function buildAlawTable() {
5843
5850
  }
5844
5851
  buildUlawTable();
5845
5852
  buildAlawTable();
5853
+ /** Is this field's stored value a credential? */
5854
+ function isSecretConfigField(field) {
5855
+ if (field.type === "password") return true;
5856
+ return "secret" in field && field.secret === true;
5857
+ }
5858
+ /**
5859
+ * Is this field's value stored in the KEYCHAIN (D787)? Every secret field is,
5860
+ * by its TYPE, unless it opts out with `storage: 'inline'` — never by its name.
5861
+ */
5862
+ function isKeychainStoredField(field) {
5863
+ if (!isSecretConfigField(field)) return false;
5864
+ if (field.type === "textarea" && field.isJson === true) return false;
5865
+ return !("storage" in field && field.storage === "inline");
5866
+ }
5867
+ /**
5868
+ * What a settings blob holds where a secret used to be.
5869
+ *
5870
+ * A keychain-stored field never holds its value. It holds a self-describing
5871
+ * MARKER, `{"$secret":"secret://…","v":1}` — an object, never a string, so no
5872
+ * code can mistake it for a credential and no form can send it to a camera as
5873
+ * a password. The empty state is `null` / absent, never `''`.
5874
+ *
5875
+ * The same shapes travel to and from the admin UI:
5876
+ *
5877
+ * - read: `hydrateSchema` hands a secret field a {@link SecretFieldView}
5878
+ * (`{ $secret, v, set: true }`) or `null` — the browser learns whether a
5879
+ * value is set, never the value.
5880
+ * - write: an untouched field submits the view back unchanged (KEEP); a typed
5881
+ * value is a plain non-empty string (CHANGE); the Clear button submits
5882
+ * {@link SECRET_CLEAR} (CLEAR). `''`, `null` and the legacy redaction tokens
5883
+ * are KEEP — an empty string is what a defaults-fallback pushes back, and
5884
+ * treating it as "clear" is how a save destroyed a stored credential before.
5885
+ *
5886
+ * Pure and browser-safe.
5887
+ */
5888
+ var SECRET_CLEAR = { $secretClear: true };
5889
+ /** The `'***'` token D634 redaction writes for non-admins. */
5890
+ var LEGACY_DEVICE_REDACTION = "***";
5891
+ function isRecord$1(value) {
5892
+ return typeof value === "object" && value !== null && !Array.isArray(value);
5893
+ }
5894
+ function makeSecretMarker(ref) {
5895
+ return {
5896
+ $secret: ref,
5897
+ v: 1
5898
+ };
5899
+ }
5900
+ /** A stored marker: an object whose `$secret` is a non-empty string. */
5901
+ function isSecretMarker(value) {
5902
+ if (!isRecord$1(value)) return false;
5903
+ const ref = value["$secret"];
5904
+ return typeof ref === "string" && ref.length > 0;
5905
+ }
5906
+ function isSecretClear(value) {
5907
+ return isRecord$1(value) && value["$secretClear"] === true;
5908
+ }
5909
+ /**
5910
+ * The UI view of a stored secret field value: a marker becomes "set", inline
5911
+ * plaintext becomes "set (inline)", nothing becomes `null`. A value never
5912
+ * survives this function.
5913
+ */
5914
+ function toSecretFieldView(stored) {
5915
+ if (isSecretMarker(stored)) return {
5916
+ $secret: stored.$secret,
5917
+ v: 1,
5918
+ set: true
5919
+ };
5920
+ if (typeof stored === "string" && stored.length > 0) return {
5921
+ $secret: null,
5922
+ v: 1,
5923
+ set: true,
5924
+ inline: true
5925
+ };
5926
+ return null;
5927
+ }
5928
+ /**
5929
+ * Classify an incoming value for a secret path. Only a non-empty string that is
5930
+ * not a redaction token sets a value; only {@link SECRET_CLEAR} clears.
5931
+ * Everything else — a marker (ours or anyone's), a UI view, `''`, `null`,
5932
+ * `undefined`, a redaction token, a non-string — keeps what is stored.
5933
+ */
5934
+ function classifySecretWrite(incoming) {
5935
+ if (isSecretClear(incoming)) return { kind: "clear" };
5936
+ if (typeof incoming !== "string") return { kind: "keep" };
5937
+ if (incoming.length === 0) return { kind: "keep" };
5938
+ if (incoming === "__camstack_redacted__" || incoming === LEGACY_DEVICE_REDACTION) return { kind: "keep" };
5939
+ return {
5940
+ kind: "set",
5941
+ value: incoming
5942
+ };
5943
+ }
5846
5944
  Object.fromEntries([
5847
5945
  {
5848
5946
  id: "overview",
@@ -6014,33 +6112,19 @@ Object.fromEntries([
6014
6112
  function isValuelessField(field) {
6015
6113
  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";
6016
6114
  }
6017
- /**
6018
- * Merge a `ConfigUISchema` with a raw `values` record into a
6019
- * `ConfigUISchemaWithValues`. Used by every `get*Settings` backend endpoint
6020
- * before returning to the admin UI. Groups are walked recursively.
6021
- *
6022
- * For each leaf field:
6023
- * - structural fields (`separator`, `info`, `button`) pass through unchanged
6024
- * - other fields get `value = values[key] ?? field.default ?? null`
6025
- *
6026
- * Unknown keys in `values` (keys not declared in the schema) are silently
6027
- * ignored — they don't contribute to the output. Missing keys fall back to
6028
- * the schema default or `null`. This mirrors the old backend behaviour where
6029
- * `FormBuilder` rendered `values[key] ?? field.default`.
6030
- */
6031
- function hydrateSchema(schema, values) {
6115
+ function hydrateSchema(schema, values, options = {}) {
6032
6116
  return {
6033
6117
  ...schema.tabs ? { tabs: [...schema.tabs] } : {},
6034
6118
  sections: schema.sections.map((section) => ({
6035
6119
  ...section,
6036
- fields: section.fields.map((field) => hydrateField(field, values))
6120
+ fields: section.fields.map((field) => hydrateField(field, values, options))
6037
6121
  }))
6038
6122
  };
6039
6123
  }
6040
- function hydrateField(field, values) {
6124
+ function hydrateField(field, values, options) {
6041
6125
  if (isValuelessField(field)) return field;
6042
6126
  if (field.type === "group") {
6043
- const hydratedChildren = field.fields.map((child) => hydrateField(child, values));
6127
+ const hydratedChildren = field.fields.map((child) => hydrateField(child, values, options));
6044
6128
  return {
6045
6129
  ...field,
6046
6130
  fields: hydratedChildren
@@ -6049,7 +6133,7 @@ function hydrateField(field, values) {
6049
6133
  if (field.type === "sub-tabs") {
6050
6134
  const hydratedTabs = field.tabs.map((tab) => ({
6051
6135
  ...tab,
6052
- fields: tab.fields.map((child) => hydrateField(child, values))
6136
+ fields: tab.fields.map((child) => hydrateField(child, values, options))
6053
6137
  }));
6054
6138
  return {
6055
6139
  ...field,
@@ -6059,6 +6143,33 @@ function hydrateField(field, values) {
6059
6143
  const key = field.key;
6060
6144
  const storedValue = Object.prototype.hasOwnProperty.call(values, key) ? values[key] : void 0;
6061
6145
  const defaultValue = field.default;
6146
+ const asView = (v) => isSecretMarker(v) || options.inlineSecretsAsViews === true && v !== void 0;
6147
+ if (isKeychainStoredField(field) && asView(storedValue)) return {
6148
+ ...field,
6149
+ value: toSecretFieldView(storedValue)
6150
+ };
6151
+ if (isKeychainStoredField(field) && options.inlineSecretsAsViews === true) return {
6152
+ ...field,
6153
+ value: null
6154
+ };
6155
+ if (field.type === "editable-array" && Array.isArray(storedValue)) {
6156
+ const secretItemKeys = field.itemFields.filter((item) => "key" in item && isKeychainStoredField(item)).map((item) => "key" in item ? item.key : "");
6157
+ if (secretItemKeys.length > 0) {
6158
+ const rows = storedValue.map((row) => {
6159
+ if (row === null || typeof row !== "object" || Array.isArray(row)) return row;
6160
+ const out = { ...row };
6161
+ for (const k of secretItemKeys) {
6162
+ const v = Reflect.get(row, k);
6163
+ if (asView(v)) out[k] = toSecretFieldView(v);
6164
+ }
6165
+ return out;
6166
+ });
6167
+ return {
6168
+ ...field,
6169
+ value: rows
6170
+ };
6171
+ }
6172
+ }
6062
6173
  if (field.multiple) {
6063
6174
  const stored = Array.isArray(storedValue) ? storedValue : storedValue !== void 0 && storedValue !== null ? [storedValue] : [];
6064
6175
  const itemFallback = field.multiple.itemDefault !== void 0 ? field.multiple.itemDefault : defaultValue !== void 0 ? defaultValue : typeOf(field) === "string" ? "" : null;
@@ -6301,6 +6412,431 @@ function projectStore(store, perNodeKeys, nodeId) {
6301
6412
  }
6302
6413
  return out;
6303
6414
  }
6415
+ var GLOBAL_SCOPE = { kind: "global" };
6416
+ /** The scope every addon-wide (not per-node, not per-device) setting lives in. */
6417
+ function globalSecretScope() {
6418
+ return GLOBAL_SCOPE;
6419
+ }
6420
+ function encodeSegment(value) {
6421
+ return encodeURIComponent(value);
6422
+ }
6423
+ /**
6424
+ * The field path of a value inside an array item, addressed by the item's id:
6425
+ * `arrayItemFieldPath('providers', 'authentik', 'clientSecret')` →
6426
+ * `providers[authentik].clientSecret`.
6427
+ */
6428
+ function arrayItemFieldPath(arrayKey, itemId, fieldKey) {
6429
+ return `${arrayKey}[${encodeSegment(itemId)}].${fieldKey}`;
6430
+ }
6431
+ /** A write to a secret path could not be stored in the keychain, so it was refused. */
6432
+ var KeychainWriteRefusedError = class extends Error {
6433
+ fieldPath;
6434
+ constructor(fieldPath, cause) {
6435
+ super(`secret "${fieldPath}" was not saved: the keychain could not store it (${cause instanceof Error ? cause.message : String(cause)}). Nothing was written.`);
6436
+ this.fieldPath = fieldPath;
6437
+ this.name = "KeychainWriteRefusedError";
6438
+ }
6439
+ };
6440
+ var KEEP = { kind: "keep" };
6441
+ function isRecord$2(value) {
6442
+ return typeof value === "object" && value !== null && !Array.isArray(value);
6443
+ }
6444
+ function defaultMintId() {
6445
+ return globalThis.crypto.randomUUID();
6446
+ }
6447
+ /** Every marker ref anywhere under `value`. */
6448
+ function collectSecretMarkerRefs(value, out = []) {
6449
+ if (isSecretMarker(value)) {
6450
+ out.push(value.$secret);
6451
+ return out;
6452
+ }
6453
+ if (Array.isArray(value)) for (const item of value) collectSecretMarkerRefs(item, out);
6454
+ else if (isRecord$2(value)) for (const child of Object.values(value)) collectSecretMarkerRefs(child, out);
6455
+ return out;
6456
+ }
6457
+ async function storedValueEquals(secrets, marker, candidate) {
6458
+ const resolved = (await secrets.resolve([marker.$secret]))[marker.$secret];
6459
+ return resolved?.kind === "value" && resolved.value === candidate;
6460
+ }
6461
+ async function writeLeaf(ctx, incoming, stored, fieldPath) {
6462
+ const intent = classifySecretWrite(incoming);
6463
+ const ref = ctx.secrets.ref(ctx.scope, fieldPath);
6464
+ const storedIsOurs = isSecretMarker(stored) && stored.$secret === ref;
6465
+ if (intent.kind === "keep") return KEEP;
6466
+ if (intent.kind === "set" && !ctx.operatorWrite && typeof stored === "string" && stored === intent.value) return KEEP;
6467
+ if (intent.kind === "clear") {
6468
+ if (storedIsOurs) ctx.deletes.push(ref);
6469
+ return {
6470
+ kind: "value",
6471
+ value: null
6472
+ };
6473
+ }
6474
+ if (storedIsOurs && await storedValueEquals(ctx.secrets, stored, intent.value)) return {
6475
+ kind: "value",
6476
+ value: stored
6477
+ };
6478
+ try {
6479
+ await ctx.secrets.put(ref, intent.value);
6480
+ } catch (err) {
6481
+ throw new KeychainWriteRefusedError(fieldPath, err);
6482
+ }
6483
+ return {
6484
+ kind: "value",
6485
+ value: makeSecretMarker(ref)
6486
+ };
6487
+ }
6488
+ /** Apply a member result onto `out`: KEEP restores the stored member, or removes it. */
6489
+ function applyMember(out, key, result, storedParent) {
6490
+ if (result.kind === "value") {
6491
+ out[key] = result.value;
6492
+ return;
6493
+ }
6494
+ if (Object.prototype.hasOwnProperty.call(storedParent, key)) out[key] = storedParent[key];
6495
+ else delete out[key];
6496
+ }
6497
+ async function writeMembers(ctx, children, incoming, stored, pathOf) {
6498
+ const out = { ...incoming };
6499
+ for (const [member, node] of children) applyMember(out, member, await writeNode(ctx, node, incoming[member], stored[member], pathOf(member)), stored);
6500
+ return out;
6501
+ }
6502
+ function rowId(row, idKey) {
6503
+ const raw = row[idKey];
6504
+ if (typeof raw === "string" && raw.length > 0) return raw;
6505
+ if (typeof raw === "number" && Number.isFinite(raw)) return String(raw);
6506
+ return null;
6507
+ }
6508
+ async function writeArray(ctx, node, incoming, stored, fieldPath) {
6509
+ const storedRows = Array.isArray(stored) ? stored.filter(isRecord$2) : [];
6510
+ if (!Array.isArray(incoming)) {
6511
+ ctx.deletes.push(...collectSecretMarkerRefs(storedRows));
6512
+ return {
6513
+ kind: "value",
6514
+ value: incoming
6515
+ };
6516
+ }
6517
+ const storedById = /* @__PURE__ */ new Map();
6518
+ for (const row of storedRows) {
6519
+ const id = rowId(row, node.idKey);
6520
+ if (id !== null) storedById.set(id, row);
6521
+ }
6522
+ const kept = /* @__PURE__ */ new Set();
6523
+ const rows = [];
6524
+ for (const row of incoming) {
6525
+ if (!isRecord$2(row)) {
6526
+ rows.push(row);
6527
+ continue;
6528
+ }
6529
+ const id = rowId(row, node.idKey) ?? ctx.mintId();
6530
+ kept.add(id);
6531
+ const withId = {
6532
+ ...row,
6533
+ [node.idKey]: row[node.idKey] ?? id
6534
+ };
6535
+ if (rowId(withId, node.idKey) === null) withId[node.idKey] = id;
6536
+ const storedRow = storedById.get(id) ?? {};
6537
+ rows.push(await writeMembers(ctx, node.item, withId, storedRow, (member) => arrayItemFieldPath(fieldPath, id, member)));
6538
+ }
6539
+ for (const [id, row] of storedById) if (!kept.has(id)) ctx.deletes.push(...collectSecretMarkerRefs(row));
6540
+ return {
6541
+ kind: "value",
6542
+ value: rows
6543
+ };
6544
+ }
6545
+ async function writeNode(ctx, node, incoming, stored, fieldPath) {
6546
+ switch (node.kind) {
6547
+ case "leaf": return writeLeaf(ctx, incoming, stored, fieldPath);
6548
+ case "array": return writeArray(ctx, node, incoming, stored, fieldPath);
6549
+ case "object": {
6550
+ if (!isRecord$2(incoming)) {
6551
+ if (incoming === void 0) return KEEP;
6552
+ ctx.deletes.push(...collectSecretMarkerRefs(stored));
6553
+ return {
6554
+ kind: "value",
6555
+ value: incoming
6556
+ };
6557
+ }
6558
+ const storedObj = isRecord$2(stored) ? stored : {};
6559
+ return {
6560
+ kind: "value",
6561
+ value: await writeMembers(ctx, node.children, incoming, storedObj, (m) => `${fieldPath}.${m}`)
6562
+ };
6563
+ }
6564
+ }
6565
+ }
6566
+ /** Split a perNode-scoped key (`key@nodeId`). */
6567
+ function splitNodeKey(key) {
6568
+ const at = key.indexOf("@");
6569
+ return at <= 0 ? {
6570
+ base: key,
6571
+ nodeId: null
6572
+ } : {
6573
+ base: key.slice(0, at),
6574
+ nodeId: key.slice(at + 1)
6575
+ };
6576
+ }
6577
+ /** Rewrite a settings patch so no secret value reaches the blob. See the file doc. */
6578
+ async function transformSecretWrite(input) {
6579
+ const deletes = [];
6580
+ const base = {
6581
+ secrets: input.secrets,
6582
+ mintId: input.mintId ?? defaultMintId,
6583
+ deletes,
6584
+ operatorWrite: input.operatorWrite === true
6585
+ };
6586
+ const out = {};
6587
+ for (const [key, incoming] of Object.entries(input.patch)) {
6588
+ const { base: baseKey, nodeId } = splitNodeKey(key);
6589
+ const node = input.tree.get(baseKey);
6590
+ if (node === void 0) {
6591
+ out[key] = incoming;
6592
+ continue;
6593
+ }
6594
+ const scope = nodeId !== null && nodeId.length > 0 ? {
6595
+ kind: "node",
6596
+ nodeId
6597
+ } : input.scope ?? globalSecretScope();
6598
+ const result = await writeNode({
6599
+ ...base,
6600
+ scope
6601
+ }, node, incoming, input.stored[key], baseKey);
6602
+ if (result.kind === "value") out[key] = result.value;
6603
+ }
6604
+ return {
6605
+ patch: out,
6606
+ afterWrite: async () => {
6607
+ if (deletes.length === 0) return { orphaned: [] };
6608
+ try {
6609
+ await input.secrets.delete([...new Set(deletes)]);
6610
+ return { orphaned: [] };
6611
+ } catch {
6612
+ return { orphaned: [...new Set(deletes)] };
6613
+ }
6614
+ }
6615
+ };
6616
+ }
6617
+ /**
6618
+ * Replace every marker in `value` with its keychain value. Returns the SAME
6619
+ * reference when there is no marker (no allocation, no keychain call).
6620
+ */
6621
+ async function resolveSecretMarkers(value, secrets) {
6622
+ const refs = collectSecretMarkerRefs(value);
6623
+ if (refs.length === 0) return {
6624
+ value,
6625
+ unresolved: []
6626
+ };
6627
+ const answers = await secrets.resolve(refs);
6628
+ const unresolved = [];
6629
+ for (const ref of new Set(refs)) {
6630
+ const answer = answers[ref];
6631
+ if (answer === void 0) unresolved.push({
6632
+ ref,
6633
+ reason: "not-initialized"
6634
+ });
6635
+ else if (answer.kind === "unavailable") unresolved.push({
6636
+ ref,
6637
+ reason: answer.reason
6638
+ });
6639
+ else if (answer.kind === "missing" || answer.kind === "forbidden") unresolved.push({
6640
+ ref,
6641
+ reason: answer.kind
6642
+ });
6643
+ }
6644
+ const substitute = (v) => {
6645
+ if (isSecretMarker(v)) {
6646
+ const answer = answers[v.$secret];
6647
+ return answer?.kind === "value" ? {
6648
+ keep: true,
6649
+ value: answer.value
6650
+ } : {
6651
+ keep: false,
6652
+ value: void 0
6653
+ };
6654
+ }
6655
+ if (Array.isArray(v)) {
6656
+ const items = [];
6657
+ for (const item of v) {
6658
+ const s = substitute(item);
6659
+ if (s.keep) items.push(s.value);
6660
+ }
6661
+ return {
6662
+ keep: true,
6663
+ value: items
6664
+ };
6665
+ }
6666
+ if (isRecord$2(v)) {
6667
+ const out = {};
6668
+ for (const [k, child] of Object.entries(v)) {
6669
+ const s = substitute(child);
6670
+ if (s.keep) out[k] = s.value;
6671
+ }
6672
+ return {
6673
+ keep: true,
6674
+ value: out
6675
+ };
6676
+ }
6677
+ return {
6678
+ keep: true,
6679
+ value: v
6680
+ };
6681
+ };
6682
+ return {
6683
+ value: substitute(value).value,
6684
+ unresolved
6685
+ };
6686
+ }
6687
+ function touchesTree(tree, patch) {
6688
+ if (tree.size === 0) return false;
6689
+ for (const key of Object.keys(patch)) {
6690
+ const at = key.indexOf("@");
6691
+ if (tree.has(at > 0 ? key.slice(0, at) : key)) return true;
6692
+ }
6693
+ return false;
6694
+ }
6695
+ /** The blob as stored now; a failed read REFUSES the write instead of guessing. */
6696
+ async function readStoredAddonBlob(raw) {
6697
+ const threeWay = raw.readAddonStoreResult;
6698
+ if (threeWay === void 0) return raw.readAddonStore();
6699
+ const result = await threeWay.call(raw);
6700
+ if (result.kind === "failed") throw new Error(`settings write refused: the stored blob could not be read (${result.error})`);
6701
+ return result.kind === "missing" ? {} : result.value;
6702
+ }
6703
+ function createSecretAwareSettings(raw, opts) {
6704
+ const chains = /* @__PURE__ */ new Map();
6705
+ const serialize = (key, fn) => {
6706
+ const next = (chains.get(key) ?? Promise.resolve()).then(fn, fn);
6707
+ const tail = next.catch(() => void 0);
6708
+ chains.set(key, tail);
6709
+ tail.then(() => {
6710
+ if (chains.get(key) === tail) chains.delete(key);
6711
+ });
6712
+ return next;
6713
+ };
6714
+ const write = async (chainKey, tree, scope, patch, readStored, rawWrite) => {
6715
+ if (!touchesTree(tree, patch)) return rawWrite(patch);
6716
+ return serialize(chainKey, async () => {
6717
+ const stored = await readStored();
6718
+ const result = await transformSecretWrite({
6719
+ tree,
6720
+ secrets: opts.secrets,
6721
+ patch,
6722
+ stored,
6723
+ ...scope !== void 0 ? { scope } : {},
6724
+ operatorWrite: opts.isOperatorWrite?.() === true
6725
+ });
6726
+ if (Object.keys(result.patch).length > 0) await rawWrite(result.patch);
6727
+ const { orphaned } = await result.afterWrite();
6728
+ if (orphaned.length > 0) opts.onOrphaned(orphaned);
6729
+ });
6730
+ };
6731
+ const wrapped = {
6732
+ writeAddonStore: (patch) => write("addon", opts.addonTree(), void 0, patch, () => readStoredAddonBlob(raw), (p) => raw.writeAddonStore(p)),
6733
+ writeDeviceStore: (deviceId, patch) => write(`device:${deviceId}`, opts.deviceTree(), {
6734
+ kind: "device",
6735
+ deviceId
6736
+ }, patch, () => raw.readDeviceStore(deviceId), (p) => raw.writeDeviceStore(deviceId, p))
6737
+ };
6738
+ return new Proxy(raw, { get(target, prop, receiver) {
6739
+ if (prop === "writeAddonStore") return wrapped.writeAddonStore;
6740
+ if (prop === "writeDeviceStore") return wrapped.writeDeviceStore;
6741
+ const value = Reflect.get(target, prop, receiver);
6742
+ return typeof value === "function" ? value.bind(target) : value;
6743
+ } });
6744
+ }
6745
+ /** The context the addon sees: identical, except that its settings writes are secret-aware. */
6746
+ function withSecretAwareSettings(context, opts) {
6747
+ const raw = context.settings;
6748
+ if (raw === void 0) return context;
6749
+ const settings = createSecretAwareSettings(raw, opts);
6750
+ return new Proxy(context, { get(target, prop, receiver) {
6751
+ if (prop === "settings") return settings;
6752
+ return Reflect.get(target, prop, receiver);
6753
+ } });
6754
+ }
6755
+ var LEAF = { kind: "leaf" };
6756
+ var DEFAULT_ITEM_ID_KEY = "id";
6757
+ function collectFields(fields, out) {
6758
+ for (const field of fields) {
6759
+ if (field.type === "group") {
6760
+ collectFields(field.fields, out);
6761
+ continue;
6762
+ }
6763
+ if (field.type === "sub-tabs") {
6764
+ for (const tab of field.tabs) collectFields(tab.fields, out);
6765
+ continue;
6766
+ }
6767
+ if (field.type === "editable-array") {
6768
+ const item = /* @__PURE__ */ new Map();
6769
+ for (const itemField of field.itemFields) if ("key" in itemField && isKeychainStoredField(itemField)) item.set(itemField.key, LEAF);
6770
+ if (item.size > 0) out.set(field.key, {
6771
+ kind: "array",
6772
+ idKey: field.itemIdKey ?? DEFAULT_ITEM_ID_KEY,
6773
+ item
6774
+ });
6775
+ continue;
6776
+ }
6777
+ if (!("key" in field) || typeof field.key !== "string") continue;
6778
+ if (isKeychainStoredField(field)) out.set(field.key, LEAF);
6779
+ }
6780
+ }
6781
+ /** The secret tree a settings schema declares. */
6782
+ function secretTreeFromSchema(schema) {
6783
+ const out = /* @__PURE__ */ new Map();
6784
+ if (schema === null) return out;
6785
+ for (const section of schema.sections) collectFields(section.fields, out);
6786
+ return out;
6787
+ }
6788
+ /** Parse `a.b[id].c` into segments; throws on a malformed path (a declaration bug). */
6789
+ function parseSecretStatePath(path) {
6790
+ const segments = [];
6791
+ for (const raw of path.split(".")) {
6792
+ const m = /^([^[\]]+)(?:\[([^[\]]+)\])?$/.exec(raw);
6793
+ if (m === null || m[1] === void 0) throw new Error(`secretStatePaths: malformed path "${path}"`);
6794
+ segments.push(m[2] !== void 0 ? {
6795
+ key: m[1],
6796
+ idKey: m[2]
6797
+ } : { key: m[1] });
6798
+ }
6799
+ if (segments.length === 0) throw new Error(`secretStatePaths: empty path`);
6800
+ if (segments[segments.length - 1]?.idKey !== void 0) throw new Error(`secretStatePaths: "${path}" ends on an array — name the member that is secret`);
6801
+ return segments;
6802
+ }
6803
+ function insert(into, segments) {
6804
+ const [head, ...rest] = segments;
6805
+ if (head === void 0) return;
6806
+ if (rest.length === 0) {
6807
+ into.set(head.key, LEAF);
6808
+ return;
6809
+ }
6810
+ const existing = into.get(head.key);
6811
+ if (head.idKey !== void 0) {
6812
+ const item = new Map(existing?.kind === "array" ? existing.item : []);
6813
+ insert(item, rest);
6814
+ into.set(head.key, {
6815
+ kind: "array",
6816
+ idKey: head.idKey,
6817
+ item
6818
+ });
6819
+ return;
6820
+ }
6821
+ const children = new Map(existing?.kind === "object" ? existing.children : []);
6822
+ insert(children, rest);
6823
+ into.set(head.key, {
6824
+ kind: "object",
6825
+ children
6826
+ });
6827
+ }
6828
+ /** Add hidden-state paths (`secretStatePaths`) to a schema-derived tree. */
6829
+ function mergeSecretStatePaths(tree, paths) {
6830
+ if (paths.length === 0) return tree;
6831
+ const out = new Map(tree);
6832
+ for (const path of paths) insert(out, parseSecretStatePath(path));
6833
+ return out;
6834
+ }
6835
+ /** First retry of a secret the keychain could not serve; doubles to {@link SECRET_RETRY_MAX_MS}. */
6836
+ var SECRET_RETRY_FIRST_MS = 5e3;
6837
+ var SECRET_RETRY_MAX_MS = 5 * 6e4;
6838
+ /** Coalesces a burst of `keychain.changed` events into one re-resolve. */
6839
+ var SECRET_CHANGE_DEBOUNCE_MS = 250;
6304
6840
  /**
6305
6841
  * Base class for CamStack addons. Eliminates settings boilerplate:
6306
6842
  *
@@ -6370,6 +6906,25 @@ var BaseAddon = class {
6370
6906
  settingsStoreReady = false;
6371
6907
  /** Default config values. Provided via constructor. */
6372
6908
  defaults;
6909
+ /**
6910
+ * Hidden-state paths that hold secrets (D787) — values the addon writes
6911
+ * itself (`updateGlobalSettings`, `state()`) that no form field declares.
6912
+ * Stored in the keychain exactly like a `password` field. Syntax:
6913
+ * `'snapshotSigningKey'`, `'identity.pincode'`, `'tokens[userId].accessToken'`
6914
+ * (`key[<id field>]` addresses array items by id, never by index).
6915
+ */
6916
+ secretStatePaths = [];
6917
+ _addonSecretTree = null;
6918
+ _deviceSecretTree = null;
6919
+ /** Refs the last resolved config pointed at — a change to one re-resolves. */
6920
+ _configSecretRefs = /* @__PURE__ */ new Set();
6921
+ _unresolvedSecrets = [];
6922
+ _secretRetryTimer = null;
6923
+ _secretRetryDelayMs = SECRET_RETRY_FIRST_MS;
6924
+ _secretChangeTimer = null;
6925
+ _secretChangeUnsub = null;
6926
+ /** >0 while an OPERATOR's settings write is being applied. */
6927
+ _operatorWriteDepth = 0;
6373
6928
  constructor(defaults) {
6374
6929
  this.defaults = defaults;
6375
6930
  this._config = { ...defaults };
@@ -6405,8 +6960,18 @@ var BaseAddon = class {
6405
6960
  return this._config;
6406
6961
  }
6407
6962
  async initialize(context) {
6408
- this._ctx = context;
6963
+ const secrets = context.secrets;
6964
+ this._ctx = secrets !== void 0 ? withSecretAwareSettings(context, {
6965
+ secrets,
6966
+ addonTree: () => this.addonSecretTree(),
6967
+ deviceTree: () => this.deviceSecretTree(),
6968
+ onOrphaned: (refs) => context.logger.warn("keychain refs dropped by a settings write could not be deleted", { meta: { refs: [...refs] } }),
6969
+ isOperatorWrite: () => this._operatorWriteDepth > 0
6970
+ }) : context;
6409
6971
  await this.resolveConfig();
6972
+ if (secrets !== void 0) this._secretChangeUnsub = secrets.onChange((ref) => {
6973
+ if (this._configSecretRefs.has(ref)) this.scheduleSecretReresolve(SECRET_CHANGE_DEBOUNCE_MS);
6974
+ });
6410
6975
  const result = await this.onInitialize();
6411
6976
  this.emitLifecycle(EventCategory.AddonStarted);
6412
6977
  const normalized = normalizeAddonInitResult(result);
@@ -6439,6 +7004,12 @@ var BaseAddon = class {
6439
7004
  */
6440
7005
  async onHubReachable() {}
6441
7006
  async shutdown() {
7007
+ this._secretChangeUnsub?.();
7008
+ this._secretChangeUnsub = null;
7009
+ if (this._secretRetryTimer !== null) clearTimeout(this._secretRetryTimer);
7010
+ if (this._secretChangeTimer !== null) clearTimeout(this._secretChangeTimer);
7011
+ this._secretRetryTimer = null;
7012
+ this._secretChangeTimer = null;
6442
7013
  this.emitLifecycle(EventCategory.AddonStopped);
6443
7014
  if (this.autoEmitReadiness) this.emitReadinessForProviders("down");
6444
7015
  await this.onShutdown();
@@ -6517,7 +7088,7 @@ var BaseAddon = class {
6517
7088
  return hydrateSchema(schema, overlay ? {
6518
7089
  ...projected,
6519
7090
  ...overlay
6520
- } : projected);
7091
+ } : projected, { inlineSecretsAsViews: true });
6521
7092
  }
6522
7093
  /**
6523
7094
  * The integration-level view of this addon's settings: exactly the sections
@@ -6566,7 +7137,7 @@ var BaseAddon = class {
6566
7137
  return hydrateSchema({
6567
7138
  ...schema,
6568
7139
  sections
6569
- }, projected);
7140
+ }, projected, { inlineSecretsAsViews: true });
6570
7141
  }
6571
7142
  /**
6572
7143
  * The raw addon store PROJECTED onto the target node's bare per-node keys:
@@ -6620,18 +7191,50 @@ var BaseAddon = class {
6620
7191
  value: result.value[key]
6621
7192
  };
6622
7193
  }
7194
+ /**
7195
+ * The OPERATOR's write — a settings form or an admin API call, dispatched by
7196
+ * the kernel. Identical to {@link updateGlobalSettings}, except that a secret
7197
+ * the operator sends is stored as sent even when it equals a pre-keychain
7198
+ * inline value: the operator re-entering a password is a change, an addon
7199
+ * writing back what it read is not (D787).
7200
+ */
7201
+ async updateGlobalSettingsAsOperator(patch, nodeId) {
7202
+ this._operatorWriteDepth++;
7203
+ try {
7204
+ await this.applyGlobalPatch(patch, nodeId);
7205
+ } finally {
7206
+ this._operatorWriteDepth--;
7207
+ }
7208
+ }
6623
7209
  async updateGlobalSettings(patch, nodeId) {
7210
+ await this.applyGlobalPatch(patch, nodeId);
7211
+ }
7212
+ /**
7213
+ * REMOVE stored secrets — their keychain values and their markers (D787).
7214
+ *
7215
+ * Writing `''` to a secret field KEEPS what is stored (an empty string is
7216
+ * what a defaults fallback writes back, and it must never destroy a
7217
+ * credential), so code that means "forget this token" says so here. Without
7218
+ * a keychain (an older kernel) it writes `''`, as such code always did.
7219
+ */
7220
+ async clearSecrets(keys, nodeId) {
7221
+ const tree = this.addonSecretTree();
7222
+ const keychain = this._ctx?.secrets !== void 0;
7223
+ const patch = {};
7224
+ for (const key of keys) patch[key] = keychain && tree.has(key) ? SECRET_CLEAR : "";
7225
+ await this.applyGlobalPatch(patch, nodeId);
7226
+ }
7227
+ async applyGlobalPatch(barePatch, nodeId) {
6624
7228
  const keys = this.perNodeKeys();
6625
7229
  const localNode = normalizeNodeId(this._ctx?.kernel?.localNodeId);
6626
7230
  const target = normalizeNodeId(nodeId ?? this._ctx?.kernel?.localNodeId);
6627
- const barePatch = patch;
6628
7231
  const scoped = keys.size > 0 ? scopePatch(barePatch, keys, target) : barePatch;
6629
7232
  await this._ctx?.settings?.writeAddonStore(scoped);
6630
7233
  if (target !== localNode) return;
6631
7234
  await this.resolveConfig();
6632
7235
  await this.onConfigChanged();
6633
7236
  this.emitLifecycle(EventCategory.AddonUpdated, { level: "global" });
6634
- this.maybeAutoRestart(patch, this.globalSettingsSchema());
7237
+ this.maybeAutoRestart(Object.keys(barePatch), this.globalSettingsSchema());
6635
7238
  }
6636
7239
  /**
6637
7240
  * The set of field keys the global settings schema declares `perNode: true`
@@ -6656,7 +7259,7 @@ var BaseAddon = class {
6656
7259
  * time to return its response before the addon is torn down and
6657
7260
  * re-initialised by `AddonRegistryService.restartAddon`.
6658
7261
  */
6659
- maybeAutoRestart(patch, schema) {
7262
+ maybeAutoRestart(patchKeys, schema) {
6660
7263
  if (!schema) return;
6661
7264
  const restartKeys = /* @__PURE__ */ new Set();
6662
7265
  for (const section of schema.sections) for (const field of section.fields) {
@@ -6664,13 +7267,13 @@ var BaseAddon = class {
6664
7267
  if (field.requiresRestart) restartKeys.add(field.key);
6665
7268
  }
6666
7269
  if (restartKeys.size === 0) return;
6667
- if (!Object.keys(patch).some((k) => restartKeys.has(k))) return;
7270
+ if (!patchKeys.some((k) => restartKeys.has(k))) return;
6668
7271
  const ctx = this._ctx;
6669
7272
  if (!ctx) return;
6670
7273
  const addonId = ctx.id;
6671
7274
  setImmediate(() => {
6672
7275
  ctx.api.addons?.restartAddon?.mutate({ addonId }).then(() => {
6673
- ctx.logger.info("addon auto-restart triggered by restart-required setting change", { meta: { changedFields: Object.keys(patch).filter((k) => restartKeys.has(k)) } });
7276
+ ctx.logger.info("addon auto-restart triggered by restart-required setting change", { meta: { changedFields: patchKeys.filter((k) => restartKeys.has(k)) } });
6674
7277
  }).catch((err) => {
6675
7278
  ctx.logger.error("addon auto-restart failed", { meta: { error: err instanceof Error ? err.message : String(err) } });
6676
7279
  });
@@ -6679,7 +7282,7 @@ var BaseAddon = class {
6679
7282
  async getDeviceSettings(deviceId) {
6680
7283
  const schema = this.deviceSettingsSchema();
6681
7284
  if (!schema) return { sections: [] };
6682
- return hydrateSchema(schema, await this._ctx?.settings?.readDeviceStore(deviceId) ?? {});
7285
+ return hydrateSchema(schema, await this._ctx?.settings?.readDeviceStore(deviceId) ?? {}, { inlineSecretsAsViews: true });
6683
7286
  }
6684
7287
  async updateDeviceSettings(deviceId, patch) {
6685
7288
  await this._ctx?.settings?.writeDeviceStore(deviceId, patch);
@@ -6809,7 +7412,7 @@ var BaseAddon = class {
6809
7412
  * selection at boot (absent scoped key ⇒ the constructor default wins).
6810
7413
  */
6811
7414
  async resolveConfig() {
6812
- const stored = await this.readAddonStoreWithRetry();
7415
+ const stored = await this.resolveStoredSecrets(await this.readAddonStoreWithRetry());
6813
7416
  const perNode = this.perNodeKeys();
6814
7417
  const localNode = normalizeNodeId(this._ctx?.kernel?.localNodeId);
6815
7418
  const resolved = { ...this.defaults };
@@ -6834,7 +7437,7 @@ var BaseAddon = class {
6834
7437
  key,
6835
7438
  schema,
6836
7439
  fallback,
6837
- read: () => this.readAddonStoreWithRetry(),
7440
+ read: async () => this.resolveStoredSecrets(await this.readAddonStoreWithRetry()),
6838
7441
  write: async (patch) => {
6839
7442
  await this._ctx?.settings?.writeAddonStore(patch);
6840
7443
  },
@@ -6851,7 +7454,7 @@ var BaseAddon = class {
6851
7454
  key,
6852
7455
  schema,
6853
7456
  fallback,
6854
- read: async () => await this._ctx?.settings?.readDeviceStore(deviceId) ?? {},
7457
+ read: async () => this.resolveStoredSecrets(await this._ctx?.settings?.readDeviceStore(deviceId) ?? {}, false),
6855
7458
  write: async (patch) => {
6856
7459
  await this._ctx?.settings?.writeDeviceStore(deviceId, patch);
6857
7460
  },
@@ -6863,6 +7466,70 @@ var BaseAddon = class {
6863
7466
  } })
6864
7467
  });
6865
7468
  }
7469
+ /** The addon store's secret tree: schema fields by TYPE, plus `secretStatePaths`. */
7470
+ addonSecretTree() {
7471
+ this._addonSecretTree ??= mergeSecretStatePaths(secretTreeFromSchema(this.globalSettingsSchema()), this.secretStatePaths);
7472
+ return this._addonSecretTree;
7473
+ }
7474
+ deviceSecretTree() {
7475
+ this._deviceSecretTree ??= secretTreeFromSchema(this.deviceSettingsSchema());
7476
+ return this._deviceSecretTree;
7477
+ }
7478
+ /**
7479
+ * Secrets of this addon's stored config that could not be resolved on the
7480
+ * last read, with why. Non-empty means the addon is running WITHOUT them —
7481
+ * an addon whose function needs one should report itself degraded rather
7482
+ * than start on an empty credential.
7483
+ */
7484
+ get unresolvedSecrets() {
7485
+ return this._unresolvedSecrets;
7486
+ }
7487
+ /**
7488
+ * Substitute every keychain marker in a stored blob with its value. With no
7489
+ * keychain (no `ctx.secrets`) or no marker, the blob comes back unchanged.
7490
+ * An unresolvable value is LEFT OUT (never `''`), logged by ref — never by
7491
+ * value — and, when the cause can pass, retried with backoff. Nothing is
7492
+ * ever written back from here.
7493
+ */
7494
+ async resolveStoredSecrets(blob, trackForConfig = true) {
7495
+ const secrets = this._ctx?.secrets;
7496
+ if (secrets === void 0) return blob;
7497
+ const refs = collectSecretMarkerRefs(blob);
7498
+ if (trackForConfig) this._configSecretRefs = new Set(refs);
7499
+ if (refs.length === 0) {
7500
+ if (trackForConfig) this._unresolvedSecrets = [];
7501
+ return blob;
7502
+ }
7503
+ const { value, unresolved } = await resolveSecretMarkers(blob, secrets);
7504
+ if (trackForConfig) {
7505
+ this._unresolvedSecrets = unresolved;
7506
+ if (unresolved.length > 0) {
7507
+ this._ctx?.logger?.error?.("secret unavailable — running without it, will retry", { meta: { secrets: unresolved.map((u) => ({
7508
+ ref: u.ref,
7509
+ reason: u.reason
7510
+ })) } });
7511
+ if (unresolved.some((u) => u.reason !== "missing" && u.reason !== "forbidden")) {
7512
+ this.scheduleSecretReresolve(this._secretRetryDelayMs);
7513
+ this._secretRetryDelayMs = Math.min(this._secretRetryDelayMs * 2, SECRET_RETRY_MAX_MS);
7514
+ }
7515
+ } else this._secretRetryDelayMs = SECRET_RETRY_FIRST_MS;
7516
+ }
7517
+ return value;
7518
+ }
7519
+ /** Re-resolve the config (a keychain-only change, or a retry) and apply it. */
7520
+ scheduleSecretReresolve(delayMs) {
7521
+ const timerOf = delayMs === SECRET_CHANGE_DEBOUNCE_MS ? "_secretChangeTimer" : "_secretRetryTimer";
7522
+ if (this[timerOf] !== null) return;
7523
+ const timer = setTimeout(() => {
7524
+ this[timerOf] = null;
7525
+ if (this._ctx === null) return;
7526
+ this.resolveConfig().then(() => this.onConfigChanged()).catch((err) => {
7527
+ this._ctx?.logger?.error?.("re-resolving secrets failed", { meta: { error: err instanceof Error ? err.message : String(err) } });
7528
+ });
7529
+ }, delayMs);
7530
+ timer.unref?.();
7531
+ this[timerOf] = timer;
7532
+ }
6866
7533
  /**
6867
7534
  * Wrap `ctx.settings.readAddonStore()` with a short retry budget so a
6868
7535
  * transient settings-store outage (mid-restart of sqlite-settings, tsx-watch
@@ -14605,6 +15272,196 @@ id: union([string(), number()]) }), {
14605
15272
  kind: "mutation",
14606
15273
  auth: "admin"
14607
15274
  });
15275
+ /**
15276
+ * `keychain` — the hub's encrypted store of secret values (D787).
15277
+ *
15278
+ * Settings blobs never hold a secret: they hold a marker
15279
+ * `{"$secret":"secret://<owner>/<scope>/<fieldPath>","v":1}` and the value
15280
+ * lives here, AES-256-GCM under a data key that a master key wraps. This cap
15281
+ * is the OWNER's door to its own values: every method is owner-checked
15282
+ * against the CALLER, never against anything the caller claims.
15283
+ *
15284
+ * Who the caller is: the transport stamps `callerAddonId` into the args of a
15285
+ * call that crossed a process (the parent `LocalChildRegistry` from the UDS
15286
+ * connection, the agent from its child's connection carried in
15287
+ * `$hub-cap-fwd`'s envelope). A stamp always overwrites; a wire call with no
15288
+ * stamp has its claim stripped. Only a hub in-process caller may state its own
15289
+ * identity — `ctx.secrets` does that with the addon id closed over. This is
15290
+ * identity against BUGS and misrouting, not against a malicious addon (every
15291
+ * runner is the same OS user): see the threat model in
15292
+ * `docs/design/2026-10-08-secrets-keychain.md`.
15293
+ *
15294
+ * `callerAddonId` is deliberately NOT in any input schema: the tRPC router
15295
+ * parses the input, so a session can never supply it, and the internal mount
15296
+ * floors every method to admin anyway (D240).
15297
+ *
15298
+ * Internal: addons reach it through `ctx.secrets`, never directly.
15299
+ */
15300
+ /** Why a value cannot be served right now. Never folded into "missing". */
15301
+ var KeychainUnavailableReasonSchema = _enum([
15302
+ "key-missing",
15303
+ "wrong-key",
15304
+ "key-file-unreadable",
15305
+ "store-unavailable",
15306
+ "not-initialized",
15307
+ "decrypt-failed"
15308
+ ]);
15309
+ var KeychainStateSchema = discriminatedUnion("state", [object({ state: literal("ready") }), object({
15310
+ state: literal("locked"),
15311
+ reason: KeychainUnavailableReasonSchema
15312
+ })]);
15313
+ var KeychainResolveEntrySchema = discriminatedUnion("kind", [
15314
+ object({
15315
+ kind: literal("value"),
15316
+ value: string(),
15317
+ version: number().int()
15318
+ }),
15319
+ object({ kind: literal("missing") }),
15320
+ object({
15321
+ kind: literal("unavailable"),
15322
+ reason: KeychainUnavailableReasonSchema
15323
+ }),
15324
+ object({ kind: literal("forbidden") })
15325
+ ]);
15326
+ var KeychainResolveResultSchema = record(string(), KeychainResolveEntrySchema);
15327
+ /** Metadata of one stored value — never the value. */
15328
+ var KeychainSecretMetaSchema = object({
15329
+ ref: string(),
15330
+ owner: string(),
15331
+ /** Formatted scope (`global`, `node/<id>`, `device/<id>`, …). */
15332
+ scope: string(),
15333
+ fieldPath: string(),
15334
+ version: number().int(),
15335
+ createdAt: number(),
15336
+ updatedAt: number(),
15337
+ /** `addon:<id>` | `user:<id>` | `system`. */
15338
+ updatedBy: string(),
15339
+ /** Coarse — written at most once an hour per ref. `null` = never read. */
15340
+ lastReadAt: number().nullable()
15341
+ });
15342
+ var RefListSchema = array(string().min(1)).max(512);
15343
+ method(object({
15344
+ ref: string().min(1),
15345
+ value: string().min(1)
15346
+ }), object({
15347
+ ref: string(),
15348
+ version: number().int()
15349
+ }), {
15350
+ kind: "mutation",
15351
+ auth: "admin"
15352
+ }), method(object({ refs: RefListSchema }), KeychainResolveResultSchema, { auth: "admin" }), method(object({ refs: RefListSchema }), object({ deleted: number().int() }), {
15353
+ kind: "mutation",
15354
+ auth: "admin"
15355
+ }), method(object({}), array(KeychainSecretMetaSchema).readonly(), { auth: "admin" }), method(object({}), KeychainStateSchema, { auth: "admin" });
15356
+ var KeychainKeySourceSchema = object({
15357
+ kind: _enum([
15358
+ "config-file",
15359
+ "previous-config-file",
15360
+ "platform",
15361
+ "default-file"
15362
+ ]),
15363
+ /** File sources only — a path is not a secret. */
15364
+ path: string().optional(),
15365
+ /**
15366
+ * True when a whole-volume backup of the data directory carries this key
15367
+ * next to the database it protects (the default file). The page warns.
15368
+ */
15369
+ sharesBackupWithDatabase: boolean()
15370
+ });
15371
+ var KeychainStatusSchema = object({
15372
+ keychain: KeychainStateSchema,
15373
+ /** The source of the master key in use; `null` while locked. */
15374
+ keySource: KeychainKeySourceSchema.nullable(),
15375
+ /** The source configured to be primary — differs from `keySource` while a rotation is pending. */
15376
+ configuredSource: KeychainKeySourceSchema,
15377
+ /** Short fingerprint of the master key in use (`HMAC(KEK, label)`, 16 hex). */
15378
+ fingerprint: string().nullable(),
15379
+ activeKeyId: string().nullable(),
15380
+ /**
15381
+ * The keychain unlocked with a NON-primary source: the configured primary
15382
+ * key is not the one that wraps the data key yet. `rotateMasterKey` moves it.
15383
+ */
15384
+ rotationPending: boolean(),
15385
+ /** Wrapped copies of the data key under a previous master key, kept until purged. */
15386
+ retiredWraps: number().int(),
15387
+ recoveryKeyDownloadedAt: number().nullable(),
15388
+ secretCount: number().int()
15389
+ });
15390
+ /**
15391
+ * Whether a stored value is still pointed at by its owner's settings.
15392
+ * `unknown` is a first-class answer: a scope whose blob could not be read is
15393
+ * never reported as an orphan (and never deleted as one).
15394
+ */
15395
+ var KeychainSecretUsageSchema = _enum([
15396
+ "in-use",
15397
+ "orphan",
15398
+ "unknown"
15399
+ ]);
15400
+ var KeychainAdminSecretSchema = KeychainSecretMetaSchema.extend({ usage: KeychainSecretUsageSchema });
15401
+ var KeychainAuditActionSchema = _enum([
15402
+ "put",
15403
+ "delete",
15404
+ "reveal",
15405
+ "rotate-master-key",
15406
+ "purge-retired-keys",
15407
+ "download-recovery-key",
15408
+ "delete-orphans",
15409
+ "reset",
15410
+ "initialize"
15411
+ ]);
15412
+ var KeychainAuditEntrySchema = object({
15413
+ id: string(),
15414
+ at: number(),
15415
+ action: KeychainAuditActionSchema,
15416
+ /** `addon:<id>` | `user:<id>` | `system`. */
15417
+ actor: string(),
15418
+ ref: string().nullable(),
15419
+ detail: string().nullable()
15420
+ });
15421
+ method(object({}), KeychainStatusSchema, { auth: "admin" }), method(object({}), array(KeychainAdminSecretSchema).readonly(), { auth: "admin" }), method(object({ limit: number().int().min(1).max(500).optional() }), array(KeychainAuditEntrySchema).readonly(), { auth: "admin" }), method(object({ ref: string().min(1) }), object({
15422
+ value: string(),
15423
+ version: number().int()
15424
+ }), {
15425
+ kind: "mutation",
15426
+ auth: "admin",
15427
+ caller: "required"
15428
+ }), method(object({ refs: array(string().min(1)).max(1e3) }), object({
15429
+ deleted: array(string()).readonly(),
15430
+ kept: array(object({
15431
+ ref: string(),
15432
+ usage: KeychainSecretUsageSchema
15433
+ })).readonly()
15434
+ }), {
15435
+ kind: "mutation",
15436
+ auth: "admin",
15437
+ caller: "required"
15438
+ }), method(object({}), object({
15439
+ fingerprint: string(),
15440
+ keySource: KeychainKeySourceSchema
15441
+ }), {
15442
+ kind: "mutation",
15443
+ auth: "admin",
15444
+ caller: "required"
15445
+ }), method(object({}), object({ purged: number().int() }), {
15446
+ kind: "mutation",
15447
+ auth: "admin",
15448
+ caller: "required"
15449
+ }), method(object({}), object({
15450
+ key: string(),
15451
+ fingerprint: string(),
15452
+ keySource: KeychainKeySourceSchema
15453
+ }), {
15454
+ kind: "mutation",
15455
+ auth: "admin",
15456
+ caller: "required"
15457
+ }), method(object({ confirm: literal("RESET KEYCHAIN") }), object({
15458
+ archivedCollection: string().nullable(),
15459
+ archived: number().int()
15460
+ }), {
15461
+ kind: "mutation",
15462
+ auth: "admin",
15463
+ caller: "required"
15464
+ });
14608
15465
  method(_void(), object({
14609
15466
  id: string(),
14610
15467
  name: string(),
@@ -15422,6 +16279,10 @@ var DeviceInfoSchema = object({
15422
16279
  isCamera: boolean(),
15423
16280
  /** Current config values — serializable snapshot */
15424
16281
  config: record(string(), unknown()),
16282
+ /** Paths inside `config` the device's schema declares secret (D783) —
16283
+ * what the non-admin redaction withholds. Paths, never values. Absent
16284
+ * when the owning runner has not reported them. */
16285
+ secretConfigPaths: array(string()).optional(),
15425
16286
  /** Hardware + identity blob (manufacturer / model / firmware / sn /
15426
16287
  * uid / mac / …). Populated by drivers; editable via setMetadata. */
15427
16288
  metadata: record(string(), unknown()).nullable().optional(),
@@ -15627,12 +16488,22 @@ var DeviceRegisterPayloadSchema = object({
15627
16488
  * call (workers re-register on init), so probe-driven updates
15628
16489
  * (e.g. PTZ flag flipping after the abilities probe) propagate. */
15629
16490
  features: array(string()).optional(),
15630
- config: record(string(), unknown())
16491
+ config: record(string(), unknown()),
16492
+ /** Config paths the device's own schema DECLARES secret
16493
+ * (`.meta({ secret: true })` — dotted, `[]` for array items, e.g.
16494
+ * `connection.password`). Re-published on every register; the non-admin
16495
+ * redaction withholds them at any depth (D783). Optional: an older runner
16496
+ * omits it and the keyword backstop applies. */
16497
+ secretConfigPaths: array(string()).optional()
15631
16498
  });
15632
16499
  var DeviceRemovePayloadSchema = object({ deviceId: number() });
15633
16500
  var DevicePersistConfigPayloadSchema = object({
15634
16501
  deviceId: number(),
15635
- data: record(string(), unknown())
16502
+ data: record(string(), unknown()),
16503
+ /** The paths the device's schema declares secret (D783), when the caller
16504
+ * knows them — those values are kept in the keychain, not the blob (D787).
16505
+ * Absent: the paths the device last reported at `registerDevice` apply. */
16506
+ secretConfigPaths: array(string()).optional()
15636
16507
  });
15637
16508
  /** What a migration actually did, per switch. `unreachable` is a first-class
15638
16509
  * answer: a camera that could not be asked is not a camera that was silenced. */
@@ -17286,7 +18157,14 @@ var LoginMethodContributionSchema = discriminatedUnion("kind", [
17286
18157
  icon: string().optional(),
17287
18158
  /** Addon-owned HTTP route the button navigates to (GET). */
17288
18159
  startUrl: string(),
17289
- stage: LoginStageEnum
18160
+ stage: LoginStageEnum,
18161
+ /**
18162
+ * The provider names an external identity a signed-in user can link to
18163
+ * their own account (D782): `auth.listLinkableProviders` /
18164
+ * `beginExternalLink` offer exactly the redirect methods that set this,
18165
+ * whatever their id. Absent / false — a login button only (magic-link).
18166
+ */
18167
+ linkable: boolean().optional()
17290
18168
  }),
17291
18169
  object({
17292
18170
  kind: literal("widget"),
@@ -22610,8 +23488,23 @@ var RetrainMacroClassSchema = _enum([
22610
23488
  ]);
22611
23489
  /** A subject to learn, or a phantom to unlearn (taught by OMISSION). */
22612
23490
  var RetrainAnnotationKindSchema = _enum(["subject", "model_error"]);
22613
- /** Did a human draw this box, or did the assist propose it? */
22614
- var RetrainAnnotationSourceSchema = _enum(["operator", "assist"]);
23491
+ /**
23492
+ * Where a box came from. A machine-sourced box is a DRAFT on the page until
23493
+ * the operator confirms it; once saved it keeps its source as provenance.
23494
+ *
23495
+ * - `operator` — drawn by hand.
23496
+ * - `assist` — proposed by a detector run on the copy (the camera's own
23497
+ * model, or a larger teacher model).
23498
+ * - `pipeline` — the box the live pipeline actually drew on that frame, read
23499
+ * back from the track store (never a re-run).
23500
+ * - `llm` — proposed by a vision-capable LLM profile.
23501
+ */
23502
+ var RetrainAnnotationSourceSchema = _enum([
23503
+ "operator",
23504
+ "assist",
23505
+ "pipeline",
23506
+ "llm"
23507
+ ]);
22615
23508
  /** Normalised `[0,1]` rectangle against the FULL frame — the canonical form. */
22616
23509
  var RetrainBboxSchema = object({
22617
23510
  x: number(),
@@ -22629,7 +23522,8 @@ var RetrainBboxSchema = object({
22629
23522
  */
22630
23523
  var RetrainAnnotationSchema = object({
22631
23524
  id: string(),
22632
- trackId: string(),
23525
+ /** The frame's track. Absent on a recording still, which has none. */
23526
+ trackId: string().optional(),
22633
23527
  deviceId: number(),
22634
23528
  /** The COPY in retrain storage — never the source track's media key. */
22635
23529
  mediaKey: string(),
@@ -22678,18 +23572,63 @@ var RetrainFrameCandidateSchema = object({
22678
23572
  * fail, whatever became of the original. */
22679
23573
  copied: boolean()
22680
23574
  });
23575
+ /**
23576
+ * One box the live pipeline drew on a copied frame — what a correction starts
23577
+ * from. Derived when the frame is listed, from the track store: the subject
23578
+ * box recorded on the source media row when there is one, else the track
23579
+ * position nearest the frame's capture time. Never stored as an annotation
23580
+ * until the operator confirms it.
23581
+ */
23582
+ var RetrainPipelineBoxSchema = object({
23583
+ /** Normalised `[0,1]` against the full frame. */
23584
+ bbox: RetrainBboxSchema,
23585
+ macroClass: RetrainMacroClassSchema,
23586
+ label: string().optional(),
23587
+ subLabel: string().optional(),
23588
+ /** The detection score of the position used, when it was recorded. */
23589
+ score: number().optional(),
23590
+ /** The root model that produced the track, when it was recorded. */
23591
+ modelId: string().optional(),
23592
+ trackId: string(),
23593
+ /** `subject-box`: recorded on this very frame. `position`: the track's
23594
+ * position nearest the capture time, `deltaMs` away. */
23595
+ basis: _enum(["subject-box", "position"]),
23596
+ deltaMs: number()
23597
+ });
23598
+ /**
23599
+ * Where a retrain frame came from: a TRACK's stored media (copy-on-select),
23600
+ * or the RECORDING at an instant — the frame a model saw nothing in has no
23601
+ * track at all.
23602
+ */
23603
+ var RetrainFrameOriginSchema = _enum(["track", "recording"]);
22681
23604
  /** A frame the dataset OWNS: bytes copied at selection time. */
22682
23605
  var RetrainFrameSchema = object({
22683
23606
  frameId: string(),
22684
23607
  deviceId: number(),
22685
- trackId: string(),
22686
- /** Provenance only. It may already point at nothing — that is expected. */
22687
- sourceMediaId: number().int(),
23608
+ origin: RetrainFrameOriginSchema,
23609
+ /** The track it was copied from. Absent on a recording still. */
23610
+ trackId: string().optional(),
23611
+ /** Provenance only. It may already point at nothing — that is expected.
23612
+ * Absent on a recording still. */
23613
+ sourceMediaId: number().int().optional(),
23614
+ /** A recording still: the playhead instant it was taken at. */
23615
+ epochMs: number().optional(),
22688
23616
  sourceKind: MediaFileKindEnum,
22689
23617
  sizeBytes: number().int(),
22690
23618
  width: number().int(),
22691
23619
  height: number().int(),
22692
- copiedAt: number()
23620
+ copiedAt: number(),
23621
+ /** When the CAMERA captured the frame. Absent on a copy taken before D785. */
23622
+ capturedAt: number().optional(),
23623
+ /** The operator's "every subject in this frame is boxed". Detector
23624
+ * evaluation keeps only complete frames: an unboxed subject would count as
23625
+ * a false positive. */
23626
+ complete: boolean(),
23627
+ /** The boxes the pipeline drew on this frame. Present on list answers;
23628
+ * empty when nothing the track store holds can be placed on it. */
23629
+ pipelineBoxes: array(RetrainPipelineBoxSchema).readonly().optional(),
23630
+ /** The named collections this frame belongs to. Present on list answers. */
23631
+ collectionIds: array(string()).readonly().optional()
22693
23632
  });
22694
23633
  /** Why a copy-on-select could not be honoured — named, never a silent skip. */
22695
23634
  var RetrainCopyRefusalSchema = _enum([
@@ -22710,6 +23649,53 @@ var RetrainFrameListSchema = object({
22710
23649
  /** What the page pre-selects — the native key frame when one survives. */
22711
23650
  autoPickMediaId: number().int().optional()
22712
23651
  });
23652
+ /**
23653
+ * Which frames an annotated export carries. Every field narrows; an empty
23654
+ * filter is every annotated copy. A dataset VERSION is a frozen `frameIds`
23655
+ * list owned by whoever trains (the training orchestrator), so `frameIds` is
23656
+ * the primitive a version export uses; `batchId` re-selects what an earlier
23657
+ * export carried (`exportedInBatch`).
23658
+ */
23659
+ var RetrainExportFilterSchema = object({
23660
+ deviceIds: array(number()).optional(),
23661
+ frameIds: array(string()).max(2e4).optional(),
23662
+ /** Only frames in at least one of these named collections. */
23663
+ collectionIds: array(string()).max(200).optional(),
23664
+ batchId: string().optional(),
23665
+ /** Only frames the operator marked complete (all subjects boxed). */
23666
+ completeOnly: boolean().optional()
23667
+ });
23668
+ /**
23669
+ * `frames`: the full frame copies, boxes in `annotations.json`.
23670
+ * `crops`: additionally one JPEG per subject, cut with the runtime detail-crop
23671
+ * convention — the classifier layout.
23672
+ */
23673
+ var RetrainExportLayoutSchema = _enum(["frames", "crops"]);
23674
+ /**
23675
+ * Where `writeRetrainArchive` streams the tar: one HTTP request whose body is
23676
+ * the archive, sent chunk by chunk. Covers a presigned PUT and a provider
23677
+ * addon's data-plane upload route alike. Headers are sent verbatim and never
23678
+ * logged.
23679
+ */
23680
+ var RetrainArchiveTargetSchema = object({
23681
+ kind: literal("http"),
23682
+ method: _enum(["PUT", "POST"]),
23683
+ url: string().url(),
23684
+ headers: record(string(), string()).optional()
23685
+ });
23686
+ var RetrainArchiveResultSchema = object({
23687
+ batchId: string(),
23688
+ frames: number().int(),
23689
+ crops: number().int(),
23690
+ annotations: number().int(),
23691
+ /** Frames planned but not shipped (unreadable copy, path too long). */
23692
+ missing: number().int(),
23693
+ bytes: number().int(),
23694
+ /** sha256 of the exact bytes sent. */
23695
+ sha256: string(),
23696
+ /** The target's HTTP status. */
23697
+ status: number().int()
23698
+ });
22713
23699
  /** What the operator asked the assist to look for. */
22714
23700
  var RetrainAssistSubjectSchema = discriminatedUnion("kind", [object({
22715
23701
  kind: literal("package"),
@@ -22739,6 +23725,109 @@ var RetrainAssistResultSchema = discriminatedUnion("kind", [object({
22739
23725
  reason: string(),
22740
23726
  detail: string().optional()
22741
23727
  })]);
23728
+ /** A named set over the retrain corpus — membership only, it owns no pixels. */
23729
+ var RetrainCollectionSchema = object({
23730
+ id: string(),
23731
+ name: string(),
23732
+ createdAt: number(),
23733
+ frameCount: number().int()
23734
+ });
23735
+ var RetrainCollectionCreateResultSchema = discriminatedUnion("kind", [object({
23736
+ kind: literal("created"),
23737
+ collection: RetrainCollectionSchema
23738
+ }), object({
23739
+ kind: literal("refused"),
23740
+ reason: _enum(["empty-name", "duplicate-name"])
23741
+ })]);
23742
+ var RetrainCollectionRenameResultSchema = discriminatedUnion("kind", [object({
23743
+ kind: literal("renamed"),
23744
+ collection: RetrainCollectionSchema
23745
+ }), object({
23746
+ kind: literal("refused"),
23747
+ reason: _enum([
23748
+ "empty-name",
23749
+ "duplicate-name",
23750
+ "unknown-collection"
23751
+ ])
23752
+ })]);
23753
+ /**
23754
+ * The outcome of adding the frame at a recording instant. Every refusal is
23755
+ * named: `still-unavailable` (not recording, a gap, or an undecodable frame —
23756
+ * `detail` says which), `still-busy` (the recorder is at its decode bound; try
23757
+ * again), `unreadable-image`, `write-failed`, `unknown-collection`.
23758
+ */
23759
+ var AddRetrainFrameFromRecordingResultSchema = discriminatedUnion("kind", [object({
23760
+ kind: literal("added"),
23761
+ collectionId: string(),
23762
+ frame: RetrainFrameSchema,
23763
+ /** The moment was already in the dataset; nothing was decoded. */
23764
+ reused: boolean()
23765
+ }), object({
23766
+ kind: literal("refused"),
23767
+ reason: _enum([
23768
+ "unknown-collection",
23769
+ "still-unavailable",
23770
+ "still-busy",
23771
+ "unreadable-image",
23772
+ "write-failed"
23773
+ ]),
23774
+ detail: string().optional()
23775
+ })]);
23776
+ /** A vision LLM profile the AI assist may use, and where it sends the frame. */
23777
+ var RetrainAssistProfileSchema = object({
23778
+ id: string(),
23779
+ name: string(),
23780
+ model: string(),
23781
+ kind: string(),
23782
+ /** `true` when the frame would leave the house (a cloud vendor, or an
23783
+ * endpoint that is not on the local network). The page confirms each such
23784
+ * run, and the provider refuses one without `allowCloud`. */
23785
+ leavesHouse: boolean()
23786
+ });
23787
+ /** A box the AI assist proposed: a draft, plus the model's own reason. */
23788
+ var RetrainLlmProposalSchema = RetrainAnnotationDraftSchema.extend({ reason: string() });
23789
+ /** What the AI assist said about a box that was already on the canvas. */
23790
+ var RetrainLlmReviewSchema = object({
23791
+ /** The `ref` the page sent the box under. */
23792
+ ref: string(),
23793
+ verdict: _enum([
23794
+ "confirmed",
23795
+ "wrong-class",
23796
+ "not-an-object",
23797
+ "uncertain"
23798
+ ]),
23799
+ suggestedClass: RetrainMacroClassSchema.optional(),
23800
+ reason: string()
23801
+ });
23802
+ /**
23803
+ * The AI assist's answer. `proposed` carries drafts (`source: 'llm'`, the
23804
+ * model and its confidence) and reviews; items the model got wrong (a box off
23805
+ * the frame, an unasked class, an unknown ref) are dropped and counted in
23806
+ * `rejected`. A whole answer that is not the schema is `malformed-answer`.
23807
+ */
23808
+ var RetrainLlmAssistResultSchema = discriminatedUnion("kind", [object({
23809
+ kind: literal("proposed"),
23810
+ profileId: string(),
23811
+ model: string(),
23812
+ /** The frame was sent outside the house for this answer. */
23813
+ leftHouse: boolean(),
23814
+ proposals: array(RetrainLlmProposalSchema).readonly(),
23815
+ reviews: array(RetrainLlmReviewSchema).readonly(),
23816
+ rejected: number().int()
23817
+ }), object({
23818
+ kind: literal("refused"),
23819
+ reason: _enum([
23820
+ "unknown-frame",
23821
+ "unreadable-frame",
23822
+ "unknown-profile",
23823
+ "profile-disabled",
23824
+ "no-vision",
23825
+ "cloud-not-confirmed",
23826
+ "llm-error",
23827
+ "malformed-answer"
23828
+ ]),
23829
+ detail: string().optional()
23830
+ })]);
22742
23831
  /** The outcome of a lifecycle move owned by the retrain page. */
22743
23832
  var RetrainTransitionResultSchema = object({
22744
23833
  trackId: string(),
@@ -23456,7 +24545,7 @@ DeviceType.Camera, method(object({ deviceId: number() }), array(TrackSchema).rea
23456
24545
  auth: "admin"
23457
24546
  }), method(object({
23458
24547
  deviceId: number(),
23459
- trackId: string(),
24548
+ trackId: string().optional(),
23460
24549
  frameId: string()
23461
24550
  }), object({
23462
24551
  removed: boolean(),
@@ -23473,7 +24562,8 @@ DeviceType.Camera, method(object({ deviceId: number() }), array(TrackSchema).rea
23473
24562
  auth: "admin"
23474
24563
  }), method(object({
23475
24564
  deviceId: number(),
23476
- trackId: string(),
24565
+ /** The frame's track, when it has one — checked against the frame. */
24566
+ trackId: string().optional(),
23477
24567
  frameId: string(),
23478
24568
  subject: RetrainAssistSubjectSchema,
23479
24569
  /** Which node runs it. Absent ⇒ wherever an unowned call lands. */
@@ -23481,12 +24571,16 @@ DeviceType.Camera, method(object({ deviceId: number() }), array(TrackSchema).rea
23481
24571
  }), RetrainAssistResultSchema, {
23482
24572
  kind: "mutation",
23483
24573
  auth: "admin"
23484
- }), method(object({ trackId: string() }), array(RetrainAnnotationSchema).readonly(), {
24574
+ }), method(object({
24575
+ trackId: string().optional(),
24576
+ frameIds: array(string()).max(2e3).optional()
24577
+ }), array(RetrainAnnotationSchema).readonly(), {
23485
24578
  kind: "query",
23486
24579
  auth: "admin"
23487
24580
  }), method(object({
23488
24581
  deviceId: number(),
23489
- trackId: string(),
24582
+ /** The frame's track, when it has one — checked against the frame. */
24583
+ trackId: string().optional(),
23490
24584
  frameId: string(),
23491
24585
  annotations: array(RetrainAnnotationDraftSchema)
23492
24586
  }), array(RetrainAnnotationSchema).readonly(), {
@@ -23504,7 +24598,91 @@ DeviceType.Camera, method(object({ deviceId: number() }), array(TrackSchema).rea
23504
24598
  }), RetrainTransitionResultSchema, {
23505
24599
  kind: "mutation",
23506
24600
  auth: "admin"
23507
- }), method(object({ deviceIds: array(number()).optional() }), object({ url: string() }), {
24601
+ }), method(RetrainExportFilterSchema.extend({ layout: RetrainExportLayoutSchema.optional() }), object({ url: string() }), {
24602
+ kind: "query",
24603
+ auth: "admin"
24604
+ }), method(object({
24605
+ deviceId: number(),
24606
+ trackId: string().optional(),
24607
+ frameId: string(),
24608
+ complete: boolean()
24609
+ }), RetrainFrameSchema, {
24610
+ kind: "mutation",
24611
+ auth: "admin"
24612
+ }), method(object({
24613
+ filter: RetrainExportFilterSchema,
24614
+ layout: RetrainExportLayoutSchema,
24615
+ target: RetrainArchiveTargetSchema
24616
+ }), RetrainArchiveResultSchema, {
24617
+ kind: "mutation",
24618
+ auth: "admin",
24619
+ timeoutMs: 60 * 6e4
24620
+ }), method(object({}), array(RetrainAssistProfileSchema).readonly(), {
24621
+ kind: "query",
24622
+ auth: "admin"
24623
+ }), method(object({
24624
+ deviceId: number(),
24625
+ trackId: string().optional(),
24626
+ frameId: string(),
24627
+ profileId: string(),
24628
+ classes: array(RetrainMacroClassSchema).min(1),
24629
+ boxes: array(object({
24630
+ ref: string(),
24631
+ bbox: RetrainBboxSchema,
24632
+ macroClass: RetrainMacroClassSchema,
24633
+ label: string().optional()
24634
+ })).max(50),
24635
+ allowCloud: boolean()
24636
+ }), RetrainLlmAssistResultSchema, {
24637
+ kind: "mutation",
24638
+ auth: "admin",
24639
+ timeoutMs: 18e4
24640
+ }), method(object({ name: string().max(120) }), RetrainCollectionCreateResultSchema, {
24641
+ kind: "mutation",
24642
+ auth: "admin"
24643
+ }), method(object({}), array(RetrainCollectionSchema).readonly(), {
24644
+ kind: "query",
24645
+ auth: "admin"
24646
+ }), method(object({
24647
+ id: string(),
24648
+ name: string().max(120)
24649
+ }), RetrainCollectionRenameResultSchema, {
24650
+ kind: "mutation",
24651
+ auth: "admin"
24652
+ }), method(object({ id: string() }), object({
24653
+ deleted: boolean(),
24654
+ removedFrames: number().int()
24655
+ }), {
24656
+ kind: "mutation",
24657
+ auth: "admin"
24658
+ }), method(object({
24659
+ collectionId: string(),
24660
+ deviceId: number(),
24661
+ epochMs: number()
24662
+ }), AddRetrainFrameFromRecordingResultSchema, {
24663
+ kind: "mutation",
24664
+ auth: "admin",
24665
+ timeoutMs: 6e4
24666
+ }), method(object({
24667
+ collectionId: string(),
24668
+ frameIds: array(string()).min(1).max(500)
24669
+ }), object({
24670
+ added: number().int(),
24671
+ alreadyMember: number().int(),
24672
+ unknownFrameIds: array(string()).readonly()
24673
+ }), {
24674
+ kind: "mutation",
24675
+ auth: "admin"
24676
+ }), method(object({
24677
+ collectionId: string(),
24678
+ frameId: string()
24679
+ }), object({
24680
+ removed: boolean(),
24681
+ deletedFrame: boolean()
24682
+ }), {
24683
+ kind: "mutation",
24684
+ auth: "admin"
24685
+ }), method(object({ collectionId: string() }), array(RetrainFrameSchema).readonly(), {
23508
24686
  kind: "query",
23509
24687
  auth: "admin"
23510
24688
  }), method(object({
@@ -24130,13 +25308,31 @@ var RecommendationReasonSchema = discriminatedUnion("kind", [
24130
25308
  object({
24131
25309
  kind: literal("no-family-build"),
24132
25310
  format: ModelFormatSchema$1
25311
+ }),
25312
+ object({
25313
+ kind: literal("kept-custom-pin"),
25314
+ modelId: string(),
25315
+ deviceKey: string()
24133
25316
  })
24134
25317
  ]);
25318
+ /** Why a device is left exactly as it is, whatever the plan would pick (D786). */
25319
+ var KeptReasonSchema = _enum(["custom-pin"]);
25320
+ /**
25321
+ * Where a choice's latency came from (D791): this node's own benchmark
25322
+ * result, or the hardware-class table. Measured on the node beats the table.
25323
+ */
25324
+ var LatencySourceSchema = discriminatedUnion("kind", [object({ kind: literal("table") }), object({
25325
+ kind: literal("node-benchmark"),
25326
+ resultId: string(),
25327
+ measuredAtMs: number()
25328
+ })]);
24135
25329
  var DeviceModelChoiceSchema = object({
24136
25330
  modelId: string(),
24137
25331
  p50Ms: number(),
24138
25332
  fps: number(),
24139
25333
  measured: boolean(),
25334
+ /** Absent on a plan from before D791 — read as the table. */
25335
+ source: LatencySourceSchema.optional(),
24140
25336
  /** Parallel sessions at the camera rate with the headroom kept free: ⌊fps × (1 − headroom) / camera fps⌋. */
24141
25337
  capacitySessions: number(),
24142
25338
  personRecall: number()
@@ -24147,6 +25343,8 @@ var DeviceRecommendationSchema = object({
24147
25343
  enabled: boolean(),
24148
25344
  available: boolean(),
24149
25345
  chosen: DeviceModelChoiceSchema.nullable(),
25346
+ /** Present when the device is kept as is: Apply writes nothing on it. */
25347
+ kept: KeptReasonSchema.optional(),
24150
25348
  reasons: array(RecommendationReasonSchema).readonly()
24151
25349
  });
24152
25350
  var NodeRecommendationSchema = object({
@@ -24200,6 +25398,17 @@ var AutoTuneWarningSchema = discriminatedUnion("kind", [
24200
25398
  kind: literal("coral-enabled"),
24201
25399
  nodeId: string(),
24202
25400
  deviceKey: string()
25401
+ }),
25402
+ object({
25403
+ kind: literal("custom-pin-kept"),
25404
+ nodeId: string(),
25405
+ deviceKey: string().nullable(),
25406
+ deviceId: number().nullable(),
25407
+ modelId: string()
25408
+ }),
25409
+ object({
25410
+ kind: literal("custom-registry-unreadable"),
25411
+ error: string()
24203
25412
  })
24204
25413
  ]);
24205
25414
  var AutoTuneOptionsSchema = object({
@@ -24378,13 +25587,14 @@ var SuggestSharesResultSchema = object({
24378
25587
  nodes: array(SuggestedNodeShareSchema).readonly()
24379
25588
  });
24380
25589
  /**
24381
- * Where the node and device shares come from (D750, D755).
24382
- * - `hardware` (default) — computed by the system from each node's static
24383
- * capacity (its accelerators at their Auto tune models, from the measured
24384
- * latency table), recomputed whenever a node or device joins, leaves, is
24385
- * switched on or off, or changes model. No load input.
24386
- * - `benchmark` — the same, from each node's measured capacity (node
24387
- * benchmark results); a node without results falls back to `hardware`.
25590
+ * Where the node and device shares come from (D750, D755, D791).
25591
+ * - `benchmark` (default since D791) — each node's capacity as its own node
25592
+ * benchmark measured it; a node without fresh results is sized from
25593
+ * `hardware` and says so. Measured on the node beats the table.
25594
+ * - `hardware` — computed from each node's static capacity only (its
25595
+ * accelerators at their Auto tune models, from the latency table).
25596
+ * Both are recomputed whenever a node or device joins, leaves, is switched
25597
+ * on or off, changes model, or a benchmark result is written. No load input.
24388
25598
  * - `manual` — the operator's stored sliders.
24389
25599
  * Either way a node or device that cannot take sessions gives its share to
24390
25600
  * the others in proportion; the stored values are never rewritten for that.
@@ -24433,6 +25643,362 @@ var EffectiveSharesSchema = object({
24433
25643
  nodeWeights: record(string(), number()),
24434
25644
  deviceWeights: record(string(), record(string(), number()))
24435
25645
  });
25646
+ /**
25647
+ * Wire shapes of the node benchmark (D791): the operator's plan, the
25648
+ * preflight the confirmation shows, the run the orchestrator owns, what the
25649
+ * measuring runner reports, and the result rows Auto tune and the automatic
25650
+ * shares read.
25651
+ *
25652
+ * ONE node at a time, owned by the pipeline orchestrator. While a run is
25653
+ * active the cluster is in BENCHMARK MODE for that node: it is not a
25654
+ * detection candidate, camera pins naming it are ignored so its sessions move
25655
+ * elsewhere, and both come back when the mode ends — after a crash or a hub
25656
+ * restart too (a persisted manifest, reconciled against the registry).
25657
+ *
25658
+ * Two measurements, both on the node, driven by its own runner (frames never
25659
+ * cross a process at frame rate, D9):
25660
+ * - `device` — one accelerator × one candidate detector, root only, open
25661
+ * loop: how many streams at the camera rate it carries inside the frame
25662
+ * interval;
25663
+ * - `pipeline` — the chosen detector plus the operator's detail steps
25664
+ * (faces, plates, classifiers, CLIP…), on varied frames from the bench
25665
+ * clip: how many parallel sessions the node carries before latency, drops,
25666
+ * CPU, RAM or the event loop give out.
25667
+ */
25668
+ /** Defaults and bounds, one place. */
25669
+ var NODE_BENCHMARK_DEFAULTS = {
25670
+ fpsPerStream: 10,
25671
+ budgetMinutes: 45,
25672
+ minBudgetMinutes: 10,
25673
+ maxBudgetMinutes: 120,
25674
+ /** A result older than this no longer beats the table. */
25675
+ staleAfterDays: 30,
25676
+ /** Warm-in per ramp step (not accounted). */
25677
+ settleSec: 5,
25678
+ /** Accounted window per ramp step. */
25679
+ measureSec: 20,
25680
+ /** Longest the drain may take before the run is refused. */
25681
+ drainTimeoutSec: 120,
25682
+ /** Candidate models per device in one run. */
25683
+ maxModelsPerDevice: 6
25684
+ };
25685
+ /** The two measurements a run can make. */
25686
+ var NodeBenchmarkPhaseSchema = _enum(["device", "pipeline"]);
25687
+ var NodeBenchmarkDevicePlanSchema = object({
25688
+ /** `<backend>:<device>` — `openvino:npu`, `coreml:all`, `cpu`. */
25689
+ deviceKey: string().min(1),
25690
+ /**
25691
+ * Root detector candidates for the `device` measurement, in the order
25692
+ * measured. The FIRST is the one the `pipeline` measurement runs.
25693
+ */
25694
+ modelIds: array(string().min(1)).min(1).max(NODE_BENCHMARK_DEFAULTS.maxModelsPerDevice)
25695
+ });
25696
+ /** What the operator confirmed. */
25697
+ var NodeBenchmarkPlanSchema = object({
25698
+ nodeId: string().min(1),
25699
+ devices: array(NodeBenchmarkDevicePlanSchema).min(1),
25700
+ /** Which measurements run. At least one. */
25701
+ phases: array(NodeBenchmarkPhaseSchema).min(1).default(["device", "pipeline"]),
25702
+ /**
25703
+ * Detail steps (catalog step ids under the root: faces, plates,
25704
+ * classifiers, CLIP…) the `pipeline` measurement enables. The root
25705
+ * detector always runs.
25706
+ */
25707
+ steps: array(string().min(1)).default([]),
25708
+ /** Offered rate of one stream / session. */
25709
+ fpsPerStream: number().int().min(1).max(30).default(NODE_BENCHMARK_DEFAULTS.fpsPerStream),
25710
+ /** Hard deadline: the mode ends and the cluster is restored when it passes. */
25711
+ budgetMinutes: number().int().min(NODE_BENCHMARK_DEFAULTS.minBudgetMinutes).max(NODE_BENCHMARK_DEFAULTS.maxBudgetMinutes).default(NODE_BENCHMARK_DEFAULTS.budgetMinutes),
25712
+ /** Keep the models the run downloaded (default: delete what was not installed before). */
25713
+ keepDownloadedModels: boolean().default(false),
25714
+ /** Start although the other nodes' capacity does not cover the sessions running now. */
25715
+ acceptInsufficientHeadroom: boolean().default(false)
25716
+ });
25717
+ var NodeBenchmarkRefusalSchema = object({
25718
+ kind: _enum([
25719
+ "benchmark-active",
25720
+ "node-offline",
25721
+ "unknown-device",
25722
+ "no-phase",
25723
+ "insufficient-headroom"
25724
+ ]),
25725
+ detail: string(),
25726
+ overridable: boolean()
25727
+ });
25728
+ /** A camera whose detection leaves the node for the run. */
25729
+ var NodeBenchmarkMovingCameraSchema = object({
25730
+ deviceId: number(),
25731
+ /** Placed on the node now (a standing attach or a running session). */
25732
+ placedOnNode: boolean(),
25733
+ /** A node pin naming this node, ignored for the run. */
25734
+ pinnedToNode: boolean()
25735
+ });
25736
+ /** A camera that cannot leave: no other node can obtain its frames. */
25737
+ var NodeBenchmarkStayingCameraSchema = object({
25738
+ deviceId: number(),
25739
+ reason: literal("only-frame-source")
25740
+ });
25741
+ var NodeBenchmarkPreflightSchema = object({
25742
+ nodeId: string(),
25743
+ online: boolean(),
25744
+ moving: array(NodeBenchmarkMovingCameraSchema).readonly(),
25745
+ /** Keep running on the node during the run; the result is flagged contaminated. */
25746
+ staying: array(NodeBenchmarkStayingCameraSchema).readonly(),
25747
+ estimatedDurationMs: number(),
25748
+ /** The run ends and the cluster is restored at the latest after this long. */
25749
+ budgetMs: number(),
25750
+ phases: array(NodeBenchmarkPhaseSchema).readonly(),
25751
+ steps: array(string()).readonly(),
25752
+ devices: array(NodeBenchmarkDevicePlanSchema).readonly(),
25753
+ /** Parallel sessions the cluster runs now, and what the other nodes can carry. */
25754
+ headroom: object({
25755
+ sessionsNow: number(),
25756
+ otherNodesCapacitySessions: number().nullable()
25757
+ }),
25758
+ refusals: array(NodeBenchmarkRefusalSchema).readonly(),
25759
+ canStart: boolean()
25760
+ });
25761
+ /** Where the measuring runner is. */
25762
+ var NodeBenchProgressSchema = object({
25763
+ phase: _enum([
25764
+ "preparing",
25765
+ "device",
25766
+ "pipeline",
25767
+ "cleanup"
25768
+ ]),
25769
+ deviceKey: string().nullable(),
25770
+ modelId: string().nullable(),
25771
+ /** Streams (device) or sessions (pipeline) of the step running now. */
25772
+ load: number().nullable(),
25773
+ cellsDone: number(),
25774
+ cellsTotal: number(),
25775
+ message: string()
25776
+ });
25777
+ /** What limited a ramp. `none` = the ramp ran out of steps still passing. */
25778
+ var NodeBenchLimitSchema = _enum([
25779
+ "p95",
25780
+ "drops",
25781
+ "errors",
25782
+ "stall",
25783
+ "cpu",
25784
+ "ram",
25785
+ "none"
25786
+ ]);
25787
+ var NodeBenchRampStepSchema = object({
25788
+ load: number(),
25789
+ pass: boolean(),
25790
+ p95Ms: number(),
25791
+ dropRatio: number(),
25792
+ /** Completed frames per second over the accounted window. */
25793
+ fps: number(),
25794
+ cpuPct: number().nullable(),
25795
+ ramFreePct: number().nullable(),
25796
+ failReasons: array(string()).readonly()
25797
+ });
25798
+ var NodeBenchCellSchema = discriminatedUnion("phase", [object({
25799
+ phase: literal("device"),
25800
+ deviceKey: string(),
25801
+ modelId: string(),
25802
+ /** Single-stream latency (the K = 1 step). */
25803
+ p50Ms: number(),
25804
+ p95Ms: number(),
25805
+ p99Ms: number(),
25806
+ /** Frames per second sustained at the last passing step. */
25807
+ fps: number(),
25808
+ /** Streams at the camera rate the device carried inside the frame interval; 0 = not even one. */
25809
+ kMax: number(),
25810
+ limitedBy: NodeBenchLimitSchema,
25811
+ /** First call (model load + warm-up). */
25812
+ warmupMs: number(),
25813
+ ramp: array(NodeBenchRampStepSchema).readonly()
25814
+ }), object({
25815
+ phase: literal("pipeline"),
25816
+ deviceKey: string(),
25817
+ modelId: string(),
25818
+ steps: array(string()).readonly(),
25819
+ /** Parallel sessions at the camera rate the node carried; 0 = not even one. */
25820
+ maxSessions: number(),
25821
+ limitedBy: NodeBenchLimitSchema,
25822
+ /** Detail steps that produced at least one result on the clip — a step that never fired measured nothing. */
25823
+ stepsFired: array(string()).readonly(),
25824
+ warmupMs: number(),
25825
+ ramp: array(NodeBenchRampStepSchema).readonly()
25826
+ })]);
25827
+ /**
25828
+ * What a result was measured ON. A result whose fingerprint no longer matches
25829
+ * the node no longer beats the table.
25830
+ */
25831
+ var NodeBenchFingerprintSchema = object({
25832
+ pipelineVersion: string().nullable(),
25833
+ cpuModel: string().nullable(),
25834
+ ramGb: number().nullable(),
25835
+ os: string().nullable(),
25836
+ /** Per device: the pool the cells ran on (runtime + tuning). */
25837
+ pools: record(string(), object({
25838
+ runtime: string(),
25839
+ numWorkers: number(),
25840
+ concurrency: number(),
25841
+ batchMode: string()
25842
+ })).default({})
25843
+ });
25844
+ /** The frames the run used. */
25845
+ var NodeBenchClipSchema = object({
25846
+ /** `camstack-bench-v1` or `reference-images` (the fallback when the clip is not reachable). */
25847
+ id: string(),
25848
+ revision: string().nullable(),
25849
+ frames: number(),
25850
+ width: number(),
25851
+ height: number()
25852
+ });
25853
+ var NodeBenchRunnerInputSchema = object({
25854
+ runId: string().min(1),
25855
+ devices: array(NodeBenchmarkDevicePlanSchema).min(1),
25856
+ phases: array(NodeBenchmarkPhaseSchema).min(1),
25857
+ /** The full detail step tree root for the `pipeline` measurement is built on the node from these ids. */
25858
+ steps: array(string()).default([]),
25859
+ fpsPerStream: number().int().min(1).max(30),
25860
+ /** The runner stops on its own past this instant, whatever the hub does. */
25861
+ deadlineAtMs: number(),
25862
+ settleSec: number().min(0).max(60).default(NODE_BENCHMARK_DEFAULTS.settleSec),
25863
+ measureSec: number().min(2).max(300).default(NODE_BENCHMARK_DEFAULTS.measureSec),
25864
+ keepDownloadedModels: boolean().default(false)
25865
+ });
25866
+ var NodeBenchRunnerStateSchema = _enum([
25867
+ "running",
25868
+ "done",
25869
+ "failed",
25870
+ "aborted"
25871
+ ]);
25872
+ var NodeBenchRunnerStatusSchema = object({
25873
+ runId: string(),
25874
+ nodeId: string(),
25875
+ state: NodeBenchRunnerStateSchema,
25876
+ progress: NodeBenchProgressSchema.nullable(),
25877
+ /** Every finished cell so far — a run stopped half way keeps what it measured. */
25878
+ cells: array(NodeBenchCellSchema).readonly(),
25879
+ fingerprint: NodeBenchFingerprintSchema.nullable(),
25880
+ clip: NodeBenchClipSchema.nullable(),
25881
+ /** Cameras seen running on the node during the run (they share its pools). */
25882
+ activeCameraIds: array(number()).readonly(),
25883
+ /** Models the run downloaded and then deleted (not installed before). */
25884
+ deletedModels: array(string()).readonly(),
25885
+ error: string().nullable(),
25886
+ startedAtMs: number(),
25887
+ finishedAtMs: number().nullable()
25888
+ });
25889
+ var NodeBenchmarkStateSchema = _enum([
25890
+ "draining",
25891
+ "measuring",
25892
+ "restoring",
25893
+ "done",
25894
+ "failed",
25895
+ "aborted"
25896
+ ]);
25897
+ /** Why a run ended. */
25898
+ var NodeBenchmarkEndReasonSchema = _enum([
25899
+ "completed",
25900
+ "operator-abort",
25901
+ "deadline",
25902
+ "node-lost",
25903
+ "runner-lost",
25904
+ "hub-restart",
25905
+ "drain-timeout",
25906
+ "failed"
25907
+ ]);
25908
+ var NodeBenchmarkRunSchema = object({
25909
+ runId: string(),
25910
+ nodeId: string(),
25911
+ state: NodeBenchmarkStateSchema,
25912
+ plan: NodeBenchmarkPlanSchema,
25913
+ startedAtMs: number(),
25914
+ deadlineAtMs: number(),
25915
+ finishedAtMs: number().nullable(),
25916
+ endReason: NodeBenchmarkEndReasonSchema.nullable(),
25917
+ error: string().nullable(),
25918
+ /** Cameras moved off the node for the run. */
25919
+ moved: array(number()).readonly(),
25920
+ /** Cameras that stayed (their only frame source is the node). */
25921
+ staying: array(number()).readonly(),
25922
+ /** Something else ran on the node's pools during the run. */
25923
+ contaminated: boolean(),
25924
+ progress: NodeBenchProgressSchema.nullable(),
25925
+ resultIds: array(string()).readonly()
25926
+ });
25927
+ /** `getNodeBenchmarkStatus`: the active run (or the last one), and whether benchmark mode is on. */
25928
+ var NodeBenchmarkStatusSchema = object({
25929
+ /** The node the cluster is in benchmark mode for; null = none. */
25930
+ modeNodeId: string().nullable(),
25931
+ run: NodeBenchmarkRunSchema.nullable()
25932
+ });
25933
+ /**
25934
+ * One stored measurement — the only authority Auto tune and the automatic
25935
+ * shares read measured capacity from. Written by the orchestrator when a run
25936
+ * ends, never by anyone else.
25937
+ */
25938
+ var NodeBenchmarkResultSchema = object({
25939
+ id: string(),
25940
+ runId: string(),
25941
+ nodeId: string(),
25942
+ cell: NodeBenchCellSchema,
25943
+ fpsPerStream: number(),
25944
+ fingerprint: NodeBenchFingerprintSchema.nullable(),
25945
+ clip: NodeBenchClipSchema.nullable(),
25946
+ /** Other work shared the node's pools (a camera that could not move, or the hub's own duties). */
25947
+ contaminated: boolean(),
25948
+ stayingCameras: array(number()).readonly(),
25949
+ /** The run ended early; the cell itself completed. */
25950
+ partialRun: boolean(),
25951
+ measuredAtMs: number()
25952
+ });
25953
+ var ListNodeBenchmarkResultsInputSchema = object({
25954
+ nodeId: string().optional(),
25955
+ deviceKey: string().optional()
25956
+ });
25957
+ /** A result with its standing today: does it still beat the table? */
25958
+ var NodeBenchmarkResultViewSchema = NodeBenchmarkResultSchema.extend({
25959
+ /** `fresh` beats the table; `stale` falls back to it; `superseded` = a newer row covers the same cell. */
25960
+ standing: _enum([
25961
+ "fresh",
25962
+ "stale",
25963
+ "superseded"
25964
+ ]),
25965
+ staleWhy: _enum([
25966
+ "age",
25967
+ "runtime",
25968
+ "pool-tuning"
25969
+ ]).nullable()
25970
+ });
25971
+ object({
25972
+ runId: string(),
25973
+ nodeId: string(),
25974
+ startedAtMs: number(),
25975
+ deadlineAtMs: number(),
25976
+ plan: NodeBenchmarkPlanSchema,
25977
+ moved: array(number()).readonly(),
25978
+ staying: array(number()).readonly()
25979
+ });
25980
+ /** Candidate detectors per device, for the plan editor. */
25981
+ var NodeBenchmarkCandidatesSchema = object({
25982
+ nodeId: string(),
25983
+ reachable: boolean(),
25984
+ devices: array(object({
25985
+ deviceKey: string(),
25986
+ enabled: boolean(),
25987
+ available: boolean(),
25988
+ /** Ordered: what Auto tune would pick first, then the rest of the family by accuracy. */
25989
+ suggested: array(string()).readonly(),
25990
+ /** Every root detector the device has a build for. */
25991
+ all: array(string()).readonly(),
25992
+ /** The model the device runs now, when pinned. */
25993
+ currentModelId: string().nullable()
25994
+ })).readonly(),
25995
+ /** Detail steps the node's catalog offers under the root (for the `pipeline` measurement). */
25996
+ steps: array(object({
25997
+ id: string(),
25998
+ name: string(),
25999
+ slot: string()
26000
+ })).readonly()
26001
+ });
24436
26002
  object({
24437
26003
  activeCameras: number(),
24438
26004
  throttledCameras: number(),
@@ -25521,7 +27087,16 @@ method(RunnerCameraConfigSchema, object({ success: literal(true) }), { kind: "mu
25521
27087
  }), ParkedTrackFrameSchema.nullable()), method(object({
25522
27088
  deviceId: number(),
25523
27089
  trackId: string()
25524
- }), object({ released: number().int().nonnegative() }), { kind: "mutation" });
27090
+ }), object({ released: number().int().nonnegative() }), { kind: "mutation" }), method(NodeBenchRunnerInputSchema, object({
27091
+ accepted: literal(true),
27092
+ runId: string()
27093
+ }), {
27094
+ kind: "mutation",
27095
+ auth: "admin"
27096
+ }), method(object({ runId: string() }), NodeBenchRunnerStatusSchema.nullable(), { auth: "admin" }), method(object({ runId: string() }), object({ aborted: boolean() }), {
27097
+ kind: "mutation",
27098
+ auth: "admin"
27099
+ });
25525
27100
  var CameraPipelineConfigSchema = object({
25526
27101
  engine: PipelineEngineChoiceSchema.optional(),
25527
27102
  steps: array(PipelineStepInputSchema).readonly(),
@@ -26160,6 +27735,21 @@ method(object({
26160
27735
  }), method(PlacementStatsInputSchema, PlacementStatsSchema, { auth: "admin" }), method(SuggestSharesInputSchema, SuggestSharesResultSchema, { auth: "admin" }), method(_void(), EffectiveSharesSchema, { auth: "admin" }), method(SetShareSourceInputSchema, object({ success: literal(true) }), {
26161
27736
  kind: "mutation",
26162
27737
  auth: "admin"
27738
+ }), method(NodeBenchmarkPlanSchema, NodeBenchmarkPreflightSchema, { auth: "admin" }), method(NodeBenchmarkPlanSchema, discriminatedUnion("kind", [object({
27739
+ kind: literal("started"),
27740
+ runId: string()
27741
+ }), object({
27742
+ kind: literal("refused"),
27743
+ preflight: NodeBenchmarkPreflightSchema
27744
+ })]), {
27745
+ kind: "mutation",
27746
+ auth: "admin"
27747
+ }), method(_void(), NodeBenchmarkStatusSchema, { auth: "admin" }), method(object({ runId: string() }), object({ aborted: boolean() }), {
27748
+ kind: "mutation",
27749
+ auth: "admin"
27750
+ }), method(object({ nodeId: string() }), NodeBenchmarkCandidatesSchema, { auth: "admin" }), method(ListNodeBenchmarkResultsInputSchema, array(NodeBenchmarkResultViewSchema).readonly(), { auth: "admin" }), method(object({ id: string() }), object({ deleted: boolean() }), {
27751
+ kind: "mutation",
27752
+ auth: "admin"
26163
27753
  }), method(object({ deviceId: number() }), CameraPipelineSettingsSchema.nullable()), method(object({
26164
27754
  deviceId: number(),
26165
27755
  addonId: string(),
@@ -26796,7 +28386,19 @@ var SsoBridgeClaimsSchema = object({
26796
28386
  * editing a descriptor must not retroactively extend or shorten a link the
26797
28387
  * operator already consented to.
26798
28388
  */
26799
- refreshTtl: union([number().int().positive(), literal("never")]).optional()
28389
+ refreshTtl: union([number().int().positive(), literal("never")]).optional(),
28390
+ /**
28391
+ * Opaque handle of a hub-side LINK intent (D782). Set by an OIDC callback
28392
+ * that was started from a signed-in user's "Link" button: the finish then
28393
+ * links this identity to the intent's user instead of signing anyone in.
28394
+ * The handle carries no user id — the hub resolves it, single-use.
28395
+ */
28396
+ linkIntent: string().optional(),
28397
+ /**
28398
+ * Verified `iss` of the id_token behind an OIDC login bridge (D782). A
28399
+ * subject is unique only per issuer, so a link is bound to it.
28400
+ */
28401
+ issuer: string().optional()
26800
28402
  });
26801
28403
  method(object({
26802
28404
  claims: SsoBridgeClaimsSchema,
@@ -28702,7 +30304,22 @@ DeviceType.Camera, method(object({ deviceId: number().int().nonnegative() }), ar
28702
30304
  * field their hints were silently stripped by the schema and the
28703
30305
  * adaptive ladder started blind on the client's display size.
28704
30306
  */
28705
- hints: webrtcClientHintsSchema.optional()
30307
+ hints: webrtcClientHintsSchema.optional(),
30308
+ /**
30309
+ * Talk-back (D771): relay the PEER's audio to the device's speaker
30310
+ * through the `intercom` cap's push-talk triple. When `true` and the
30311
+ * offer lets the peer send audio, the answer's audio is `sendrecv`
30312
+ * and every inbound frame goes to `intercom.pushTalkAudio` for this
30313
+ * `deviceId`; absent/false answers `sendonly`, as for every viewer.
30314
+ *
30315
+ * TRUSTED-CALLER ONLY. Set by the Alexa export for an Echo on a camera
30316
+ * with `intercom`, when the linked user may control that camera. The
30317
+ * hub STRIPS it from every request-bound call (a browser), exactly as
30318
+ * it overwrites `relayOnly` — a viewer's talk permission is the
30319
+ * intercom cap's own surface (share tokens gate it there), and this
30320
+ * flag must not become a second door to the camera's speaker.
30321
+ */
30322
+ talkback: boolean().optional()
28706
30323
  }), object({
28707
30324
  sessionId: string(),
28708
30325
  sdpAnswer: string()
@@ -31214,6 +32831,9 @@ var CreateIntegrationInputSchema = object({
31214
32831
  enabled: boolean().optional(),
31215
32832
  info: record(string(), unknown()).optional(),
31216
32833
  settings: record(string(), unknown()).optional(),
32834
+ /** Keys of `settings` the form's schema declares secret (by type) — kept in
32835
+ * the keychain, not the table (D787). */
32836
+ secretKeys: array(string()).optional(),
31217
32837
  skipRestart: boolean().optional()
31218
32838
  });
31219
32839
  var UpdateIntegrationInputSchema = object({
@@ -31237,7 +32857,9 @@ method(_void(), array(IntegrationWithStateSchema)), method(object({ id: string()
31237
32857
  auth: "admin"
31238
32858
  }), method(object({ id: string() }), record(string(), unknown()), { auth: "admin" }), method(object({
31239
32859
  id: string(),
31240
- settings: record(string(), unknown())
32860
+ settings: record(string(), unknown()),
32861
+ /** Keys the form's schema declares secret (by type) — keychain-stored (D787). */
32862
+ secretKeys: array(string()).optional()
31241
32863
  }), object({ success: boolean() }), {
31242
32864
  kind: "mutation",
31243
32865
  auth: "admin"
@@ -36746,6 +38368,32 @@ var TotpStatusSchema = object({
36746
38368
  /** Null when no row exists OR the row is still pending confirmation. */
36747
38369
  confirmedAt: number().nullable()
36748
38370
  });
38371
+ /**
38372
+ * user-management — singleton capability for user accounts, API keys,
38373
+ * and scoped tokens.
38374
+ *
38375
+ * v2 model: every method gated by `auth: 'admin'`. Admin-only delegation
38376
+ * — the subset check on `setUserScopes` / `createScopedToken` is moot
38377
+ * because non-admins never reach these. If/when we open non-admin
38378
+ * delegation, structural caller-scope subset check goes inside the
38379
+ * provider.
38380
+ */
38381
+ var ExternalIdentitySchema = object({
38382
+ /** Login-method id of the provider instance, e.g. `auth-oidc/authentik`. */
38383
+ provider: string(),
38384
+ /** The IdP's stable subject (`sub`) for this account. */
38385
+ subject: string(),
38386
+ /** The verified `iss` of the IdP the identity was linked under — `sub` is unique only per issuer. */
38387
+ issuer: string(),
38388
+ userId: string(),
38389
+ /** What the IdP called the account at link time (username / email) — display only. */
38390
+ label: string().optional(),
38391
+ linkedAt: number()
38392
+ });
38393
+ var ExternalIdentityKeySchema = object({
38394
+ provider: string().min(1),
38395
+ subject: string().min(1)
38396
+ });
36749
38397
  method(_void(), array(UserSummarySchema), { auth: "admin" }), method(CreateUserInputSchema, UserSummarySchema, {
36750
38398
  kind: "mutation",
36751
38399
  auth: "admin",
@@ -36859,7 +38507,22 @@ method(_void(), array(UserSummarySchema), { auth: "admin" }), method(CreateUserI
36859
38507
  userId: string(),
36860
38508
  username: string(),
36861
38509
  scopes: array(TokenScopeSchema)
36862
- }).nullable(), { access: "view" }), method(_void(), array(OauthSessionSummarySchema), { auth: "admin" }), method(object({ id: string() }), object({ success: boolean() }), {
38510
+ }).nullable(), { access: "view" }), method(object({ userId: string() }), array(ExternalIdentitySchema), { auth: "admin" }), method(ExternalIdentityKeySchema, object({
38511
+ userId: string(),
38512
+ issuer: string()
38513
+ }).nullable(), { auth: "admin" }), method(ExternalIdentityKeySchema.extend({
38514
+ userId: string(),
38515
+ issuer: string().min(1),
38516
+ label: string().optional()
38517
+ }), object({ success: literal(true) }), {
38518
+ kind: "mutation",
38519
+ auth: "admin",
38520
+ access: "create"
38521
+ }), method(ExternalIdentityKeySchema.extend({ userId: string() }), object({ success: boolean() }), {
38522
+ kind: "mutation",
38523
+ auth: "admin",
38524
+ access: "delete"
38525
+ }), method(_void(), array(OauthSessionSummarySchema), { auth: "admin" }), method(object({ id: string() }), object({ success: boolean() }), {
36863
38526
  kind: "mutation",
36864
38527
  auth: "admin",
36865
38528
  access: "delete"
@@ -39999,6 +41662,90 @@ Object.freeze({
39999
41662
  addonId: null,
40000
41663
  access: "create"
40001
41664
  },
41665
+ "keychain.delete": {
41666
+ capName: "keychain",
41667
+ capScope: "system",
41668
+ addonId: null,
41669
+ access: "delete"
41670
+ },
41671
+ "keychain.getState": {
41672
+ capName: "keychain",
41673
+ capScope: "system",
41674
+ addonId: null,
41675
+ access: "view"
41676
+ },
41677
+ "keychain.listMeta": {
41678
+ capName: "keychain",
41679
+ capScope: "system",
41680
+ addonId: null,
41681
+ access: "view"
41682
+ },
41683
+ "keychain.put": {
41684
+ capName: "keychain",
41685
+ capScope: "system",
41686
+ addonId: null,
41687
+ access: "create"
41688
+ },
41689
+ "keychain.resolve": {
41690
+ capName: "keychain",
41691
+ capScope: "system",
41692
+ addonId: null,
41693
+ access: "view"
41694
+ },
41695
+ "keychainAdmin.deleteOrphans": {
41696
+ capName: "keychain-admin",
41697
+ capScope: "system",
41698
+ addonId: null,
41699
+ access: "delete"
41700
+ },
41701
+ "keychainAdmin.downloadRecoveryKey": {
41702
+ capName: "keychain-admin",
41703
+ capScope: "system",
41704
+ addonId: null,
41705
+ access: "create"
41706
+ },
41707
+ "keychainAdmin.listAudit": {
41708
+ capName: "keychain-admin",
41709
+ capScope: "system",
41710
+ addonId: null,
41711
+ access: "view"
41712
+ },
41713
+ "keychainAdmin.listSecrets": {
41714
+ capName: "keychain-admin",
41715
+ capScope: "system",
41716
+ addonId: null,
41717
+ access: "view"
41718
+ },
41719
+ "keychainAdmin.purgeRetiredKeys": {
41720
+ capName: "keychain-admin",
41721
+ capScope: "system",
41722
+ addonId: null,
41723
+ access: "delete"
41724
+ },
41725
+ "keychainAdmin.resetKeychain": {
41726
+ capName: "keychain-admin",
41727
+ capScope: "system",
41728
+ addonId: null,
41729
+ access: "delete"
41730
+ },
41731
+ "keychainAdmin.reveal": {
41732
+ capName: "keychain-admin",
41733
+ capScope: "system",
41734
+ addonId: null,
41735
+ access: "create"
41736
+ },
41737
+ "keychainAdmin.rotateMasterKey": {
41738
+ capName: "keychain-admin",
41739
+ capScope: "system",
41740
+ addonId: null,
41741
+ access: "create"
41742
+ },
41743
+ "keychainAdmin.status": {
41744
+ capName: "keychain-admin",
41745
+ capScope: "system",
41746
+ addonId: null,
41747
+ access: "view"
41748
+ },
40002
41749
  "lawnMowerControl.dock": {
40003
41750
  capName: "lawn-mower-control",
40004
41751
  capScope: "device",
@@ -41373,6 +43120,18 @@ Object.freeze({
41373
43120
  addonId: null,
41374
43121
  access: "create"
41375
43122
  },
43123
+ "pipelineAnalytics.addRetrainFrameFromRecording": {
43124
+ capName: "pipeline-analytics",
43125
+ capScope: "device",
43126
+ addonId: null,
43127
+ access: "create"
43128
+ },
43129
+ "pipelineAnalytics.addRetrainFramesToCollection": {
43130
+ capName: "pipeline-analytics",
43131
+ capScope: "device",
43132
+ addonId: null,
43133
+ access: "create"
43134
+ },
41376
43135
  "pipelineAnalytics.applyDeviceSettingsPatch": {
41377
43136
  capName: "pipeline-analytics",
41378
43137
  capScope: "device",
@@ -41421,12 +43180,24 @@ Object.freeze({
41421
43180
  addonId: null,
41422
43181
  access: "view"
41423
43182
  },
43183
+ "pipelineAnalytics.createRetrainCollection": {
43184
+ capName: "pipeline-analytics",
43185
+ capScope: "device",
43186
+ addonId: null,
43187
+ access: "create"
43188
+ },
41424
43189
  "pipelineAnalytics.deleteDeviceEvents": {
41425
43190
  capName: "pipeline-analytics",
41426
43191
  capScope: "device",
41427
43192
  addonId: null,
41428
43193
  access: "delete"
41429
43194
  },
43195
+ "pipelineAnalytics.deleteRetrainCollection": {
43196
+ capName: "pipeline-analytics",
43197
+ capScope: "device",
43198
+ addonId: null,
43199
+ access: "delete"
43200
+ },
41430
43201
  "pipelineAnalytics.deleteTracks": {
41431
43202
  capName: "pipeline-analytics",
41432
43203
  capScope: "device",
@@ -41631,6 +43402,24 @@ Object.freeze({
41631
43402
  addonId: null,
41632
43403
  access: "view"
41633
43404
  },
43405
+ "pipelineAnalytics.listRetrainAssistProfiles": {
43406
+ capName: "pipeline-analytics",
43407
+ capScope: "device",
43408
+ addonId: null,
43409
+ access: "view"
43410
+ },
43411
+ "pipelineAnalytics.listRetrainCollectionFrames": {
43412
+ capName: "pipeline-analytics",
43413
+ capScope: "device",
43414
+ addonId: null,
43415
+ access: "view"
43416
+ },
43417
+ "pipelineAnalytics.listRetrainCollections": {
43418
+ capName: "pipeline-analytics",
43419
+ capScope: "device",
43420
+ addonId: null,
43421
+ access: "view"
43422
+ },
41634
43423
  "pipelineAnalytics.listRetrainFrames": {
41635
43424
  capName: "pipeline-analytics",
41636
43425
  capScope: "device",
@@ -41679,6 +43468,12 @@ Object.freeze({
41679
43468
  addonId: null,
41680
43469
  access: "create"
41681
43470
  },
43471
+ "pipelineAnalytics.proposeRetrainAnnotationsWithLlm": {
43472
+ capName: "pipeline-analytics",
43473
+ capScope: "device",
43474
+ addonId: null,
43475
+ access: "create"
43476
+ },
41682
43477
  "pipelineAnalytics.pruneEvents": {
41683
43478
  capName: "pipeline-analytics",
41684
43479
  capScope: "device",
@@ -41733,6 +43528,18 @@ Object.freeze({
41733
43528
  addonId: null,
41734
43529
  access: "create"
41735
43530
  },
43531
+ "pipelineAnalytics.removeRetrainFrameFromCollection": {
43532
+ capName: "pipeline-analytics",
43533
+ capScope: "device",
43534
+ addonId: null,
43535
+ access: "delete"
43536
+ },
43537
+ "pipelineAnalytics.renameRetrainCollection": {
43538
+ capName: "pipeline-analytics",
43539
+ capScope: "device",
43540
+ addonId: null,
43541
+ access: "create"
43542
+ },
41736
43543
  "pipelineAnalytics.restageRetrainTrack": {
41737
43544
  capName: "pipeline-analytics",
41738
43545
  capScope: "device",
@@ -41763,6 +43570,12 @@ Object.freeze({
41763
43570
  addonId: null,
41764
43571
  access: "create"
41765
43572
  },
43573
+ "pipelineAnalytics.setRetrainFrameComplete": {
43574
+ capName: "pipeline-analytics",
43575
+ capScope: "device",
43576
+ addonId: null,
43577
+ access: "create"
43578
+ },
41766
43579
  "pipelineAnalytics.setTrackFlags": {
41767
43580
  capName: "pipeline-analytics",
41768
43581
  capScope: "device",
@@ -41799,6 +43612,12 @@ Object.freeze({
41799
43612
  addonId: null,
41800
43613
  access: "delete"
41801
43614
  },
43615
+ "pipelineAnalytics.writeRetrainArchive": {
43616
+ capName: "pipeline-analytics",
43617
+ capScope: "device",
43618
+ addonId: null,
43619
+ access: "create"
43620
+ },
41802
43621
  "pipelineExecutor.cacheFrameInPool": {
41803
43622
  capName: "pipeline-executor",
41804
43623
  capScope: "system",
@@ -42009,6 +43828,12 @@ Object.freeze({
42009
43828
  addonId: null,
42010
43829
  access: "view"
42011
43830
  },
43831
+ "pipelineOrchestrator.abortNodeBenchmark": {
43832
+ capName: "pipeline-orchestrator",
43833
+ capScope: "system",
43834
+ addonId: null,
43835
+ access: "create"
43836
+ },
42012
43837
  "pipelineOrchestrator.applyAutoTune": {
42013
43838
  capName: "pipeline-orchestrator",
42014
43839
  capScope: "system",
@@ -42033,6 +43858,12 @@ Object.freeze({
42033
43858
  addonId: null,
42034
43859
  access: "create"
42035
43860
  },
43861
+ "pipelineOrchestrator.deleteNodeBenchmarkResult": {
43862
+ capName: "pipeline-orchestrator",
43863
+ capScope: "system",
43864
+ addonId: null,
43865
+ access: "delete"
43866
+ },
42036
43867
  "pipelineOrchestrator.getAgentLoad": {
42037
43868
  capName: "pipeline-orchestrator",
42038
43869
  capScope: "system",
@@ -42141,6 +43972,24 @@ Object.freeze({
42141
43972
  addonId: null,
42142
43973
  access: "view"
42143
43974
  },
43975
+ "pipelineOrchestrator.getNodeBenchmarkCandidates": {
43976
+ capName: "pipeline-orchestrator",
43977
+ capScope: "system",
43978
+ addonId: null,
43979
+ access: "view"
43980
+ },
43981
+ "pipelineOrchestrator.getNodeBenchmarkPreflight": {
43982
+ capName: "pipeline-orchestrator",
43983
+ capScope: "system",
43984
+ addonId: null,
43985
+ access: "view"
43986
+ },
43987
+ "pipelineOrchestrator.getNodeBenchmarkStatus": {
43988
+ capName: "pipeline-orchestrator",
43989
+ capScope: "system",
43990
+ addonId: null,
43991
+ access: "view"
43992
+ },
42144
43993
  "pipelineOrchestrator.getNodeInferenceDevices": {
42145
43994
  capName: "pipeline-orchestrator",
42146
43995
  capScope: "system",
@@ -42183,6 +44032,12 @@ Object.freeze({
42183
44032
  addonId: null,
42184
44033
  access: "view"
42185
44034
  },
44035
+ "pipelineOrchestrator.listNodeBenchmarkResults": {
44036
+ capName: "pipeline-orchestrator",
44037
+ capScope: "system",
44038
+ addonId: null,
44039
+ access: "view"
44040
+ },
42186
44041
  "pipelineOrchestrator.pauseForStorageMigration": {
42187
44042
  capName: "pipeline-orchestrator",
42188
44043
  capScope: "system",
@@ -42327,6 +44182,12 @@ Object.freeze({
42327
44182
  addonId: null,
42328
44183
  access: "create"
42329
44184
  },
44185
+ "pipelineOrchestrator.startNodeBenchmark": {
44186
+ capName: "pipeline-orchestrator",
44187
+ capScope: "system",
44188
+ addonId: null,
44189
+ access: "create"
44190
+ },
42330
44191
  "pipelineOrchestrator.suggestShares": {
42331
44192
  capName: "pipeline-orchestrator",
42332
44193
  capScope: "system",
@@ -42345,6 +44206,12 @@ Object.freeze({
42345
44206
  addonId: null,
42346
44207
  access: "create"
42347
44208
  },
44209
+ "pipelineRunner.abortNodeBench": {
44210
+ capName: "pipeline-runner",
44211
+ capScope: "system",
44212
+ addonId: null,
44213
+ access: "create"
44214
+ },
42348
44215
  "pipelineRunner.attachCamera": {
42349
44216
  capName: "pipeline-runner",
42350
44217
  capScope: "system",
@@ -42393,6 +44260,12 @@ Object.freeze({
42393
44260
  addonId: null,
42394
44261
  access: "view"
42395
44262
  },
44263
+ "pipelineRunner.getNodeBenchStatus": {
44264
+ capName: "pipeline-runner",
44265
+ capScope: "system",
44266
+ addonId: null,
44267
+ access: "view"
44268
+ },
42396
44269
  "pipelineRunner.getParkedTrackFrame": {
42397
44270
  capName: "pipeline-runner",
42398
44271
  capScope: "system",
@@ -42435,6 +44308,12 @@ Object.freeze({
42435
44308
  addonId: null,
42436
44309
  access: "create"
42437
44310
  },
44311
+ "pipelineRunner.startNodeBench": {
44312
+ capName: "pipeline-runner",
44313
+ capScope: "system",
44314
+ addonId: null,
44315
+ access: "create"
44316
+ },
42438
44317
  "plateGallery.assignPlate": {
42439
44318
  capName: "plate-gallery",
42440
44319
  capScope: "system",
@@ -44151,18 +46030,36 @@ Object.freeze({
44151
46030
  addonId: null,
44152
46031
  access: "delete"
44153
46032
  },
46033
+ "userManagement.findUserByExternalIdentity": {
46034
+ capName: "user-management",
46035
+ capScope: "system",
46036
+ addonId: null,
46037
+ access: "view"
46038
+ },
44154
46039
  "userManagement.getTotpStatus": {
44155
46040
  capName: "user-management",
44156
46041
  capScope: "system",
44157
46042
  addonId: null,
44158
46043
  access: "view"
44159
46044
  },
46045
+ "userManagement.linkExternalIdentity": {
46046
+ capName: "user-management",
46047
+ capScope: "system",
46048
+ addonId: null,
46049
+ access: "create"
46050
+ },
44160
46051
  "userManagement.listApiKeys": {
44161
46052
  capName: "user-management",
44162
46053
  capScope: "system",
44163
46054
  addonId: null,
44164
46055
  access: "view"
44165
46056
  },
46057
+ "userManagement.listExternalIdentities": {
46058
+ capName: "user-management",
46059
+ capScope: "system",
46060
+ addonId: null,
46061
+ access: "view"
46062
+ },
44166
46063
  "userManagement.listOauthSessions": {
44167
46064
  capName: "user-management",
44168
46065
  capScope: "system",
@@ -44241,6 +46138,12 @@ Object.freeze({
44241
46138
  addonId: null,
44242
46139
  access: "create"
44243
46140
  },
46141
+ "userManagement.unlinkExternalIdentity": {
46142
+ capName: "user-management",
46143
+ capScope: "system",
46144
+ addonId: null,
46145
+ access: "delete"
46146
+ },
44244
46147
  "userManagement.updateUser": {
44245
46148
  capName: "user-management",
44246
46149
  capScope: "system",
@@ -47340,6 +49243,11 @@ Object.freeze({
47340
49243
  form: "single",
47341
49244
  optional: false
47342
49245
  }],
49246
+ "pipelineAnalytics.addRetrainFrameFromRecording": [{
49247
+ name: "deviceId",
49248
+ form: "single",
49249
+ optional: false
49250
+ }],
47343
49251
  "pipelineAnalytics.applyDeviceSettingsPatch": [{
47344
49252
  name: "deviceId",
47345
49253
  form: "single",
@@ -47530,6 +49438,11 @@ Object.freeze({
47530
49438
  form: "single",
47531
49439
  optional: false
47532
49440
  }],
49441
+ "pipelineAnalytics.proposeRetrainAnnotationsWithLlm": [{
49442
+ name: "deviceId",
49443
+ form: "single",
49444
+ optional: false
49445
+ }],
47533
49446
  "pipelineAnalytics.pruneEventsBefore": [{
47534
49447
  name: "deviceId",
47535
49448
  form: "single",
@@ -47580,6 +49493,11 @@ Object.freeze({
47580
49493
  form: "single",
47581
49494
  optional: false
47582
49495
  }],
49496
+ "pipelineAnalytics.setRetrainFrameComplete": [{
49497
+ name: "deviceId",
49498
+ form: "single",
49499
+ optional: false
49500
+ }],
47583
49501
  "pipelineAnalytics.setTrackFlags": [{
47584
49502
  name: "deviceId",
47585
49503
  form: "single",