@camstack/addon-provider-dreame 0.2.130 → 0.2.132

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (3) hide show
  1. package/dist/addon.js +2071 -148
  2. package/dist/addon.mjs +2071 -148
  3. package/package.json +1 -1
package/dist/addon.mjs CHANGED
@@ -46205,13 +46205,13 @@ var AI_FEATURE_JSON_KEY = {
46205
46205
  furnitureDetection: "furniture_detect_switch",
46206
46206
  fluidDetection: "fluid_detect_switch"
46207
46207
  };
46208
- function isRecord$2(v) {
46208
+ function isRecord$3(v) {
46209
46209
  return v !== null && typeof v === "object" && !Array.isArray(v);
46210
46210
  }
46211
46211
  function parseJsonPayload(raw) {
46212
46212
  try {
46213
46213
  const parsed = JSON.parse(raw);
46214
- return isRecord$2(parsed) ? parsed : null;
46214
+ return isRecord$3(parsed) ? parsed : null;
46215
46215
  } catch {
46216
46216
  return null;
46217
46217
  }
@@ -58277,7 +58277,7 @@ var ZodIssueCode = {
58277
58277
  var ZodFirstPartyTypeKind;
58278
58278
  ZodFirstPartyTypeKind || (ZodFirstPartyTypeKind = {});
58279
58279
  //#endregion
58280
- //#region ../types/dist/sleep-Cr5YOk3m.mjs
58280
+ //#region ../types/dist/sleep-DwAQ9sqX.mjs
58281
58281
  /**
58282
58282
  * The audio chunk plane's byte format, and the ONE expansion from a coded
58283
58283
  * window to float samples (D455).
@@ -58394,7 +58394,7 @@ function isKeychainStoredField(field) {
58394
58394
  var SECRET_CLEAR = { $secretClear: true };
58395
58395
  /** The `'***'` token D634 redaction writes for non-admins. */
58396
58396
  var LEGACY_DEVICE_REDACTION = "***";
58397
- function isRecord$1(value) {
58397
+ function isRecord$2(value) {
58398
58398
  return typeof value === "object" && value !== null && !Array.isArray(value);
58399
58399
  }
58400
58400
  function makeSecretMarker(ref) {
@@ -58405,12 +58405,12 @@ function makeSecretMarker(ref) {
58405
58405
  }
58406
58406
  /** A stored marker: an object whose `$secret` is a non-empty string. */
58407
58407
  function isSecretMarker(value) {
58408
- if (!isRecord$1(value)) return false;
58408
+ if (!isRecord$2(value)) return false;
58409
58409
  const ref = value["$secret"];
58410
58410
  return typeof ref === "string" && ref.length > 0;
58411
58411
  }
58412
58412
  function isSecretClear(value) {
58413
- return isRecord$1(value) && value["$secretClear"] === true;
58413
+ return isRecord$2(value) && value["$secretClear"] === true;
58414
58414
  }
58415
58415
  /**
58416
58416
  * The UI view of a stored secret field value: a marker becomes "set", inline
@@ -58926,6 +58926,13 @@ function globalSecretScope() {
58926
58926
  function encodeSegment(value) {
58927
58927
  return encodeURIComponent(value);
58928
58928
  }
58929
+ function decodeSegment(value) {
58930
+ try {
58931
+ return decodeURIComponent(value);
58932
+ } catch {
58933
+ return null;
58934
+ }
58935
+ }
58929
58936
  /**
58930
58937
  * The field path of a value inside an array item, addressed by the item's id:
58931
58938
  * `arrayItemFieldPath('providers', 'authentik', 'clientSecret')` →
@@ -58934,6 +58941,75 @@ function encodeSegment(value) {
58934
58941
  function arrayItemFieldPath(arrayKey, itemId, fieldKey) {
58935
58942
  return `${arrayKey}[${encodeSegment(itemId)}].${fieldKey}`;
58936
58943
  }
58944
+ function parseScope(segments) {
58945
+ switch (segments[0]) {
58946
+ case "global": return {
58947
+ scope: GLOBAL_SCOPE,
58948
+ used: 1
58949
+ };
58950
+ case "node": {
58951
+ const nodeId = segments[1] !== void 0 ? decodeSegment(segments[1]) : null;
58952
+ return nodeId === null || nodeId.length === 0 ? null : {
58953
+ scope: {
58954
+ kind: "node",
58955
+ nodeId
58956
+ },
58957
+ used: 2
58958
+ };
58959
+ }
58960
+ case "device": {
58961
+ const raw = segments[1];
58962
+ if (raw === void 0 || !/^\d+$/.test(raw)) return null;
58963
+ return {
58964
+ scope: {
58965
+ kind: "device",
58966
+ deviceId: Number(raw)
58967
+ },
58968
+ used: 2
58969
+ };
58970
+ }
58971
+ case "integration": {
58972
+ const id = segments[1] !== void 0 ? decodeSegment(segments[1]) : null;
58973
+ return id === null || id.length === 0 ? null : {
58974
+ scope: {
58975
+ kind: "integration",
58976
+ integrationId: id
58977
+ },
58978
+ used: 2
58979
+ };
58980
+ }
58981
+ case "row": {
58982
+ const collection = segments[1] !== void 0 ? decodeSegment(segments[1]) : null;
58983
+ const rowId = segments[2] !== void 0 ? decodeSegment(segments[2]) : null;
58984
+ if (collection === null || rowId === null || collection.length === 0 || rowId.length === 0) return null;
58985
+ return {
58986
+ scope: {
58987
+ kind: "row",
58988
+ collection,
58989
+ rowId
58990
+ },
58991
+ used: 3
58992
+ };
58993
+ }
58994
+ default: return null;
58995
+ }
58996
+ }
58997
+ /** Take a ref apart; `null` when it is not a well-formed ref. */
58998
+ function parseSecretRef(ref) {
58999
+ if (!ref.startsWith("secret://")) return null;
59000
+ const segments = ref.slice(9).split("/");
59001
+ const owner = segments[0] !== void 0 ? decodeSegment(segments[0]) : null;
59002
+ if (owner === null || owner.length === 0) return null;
59003
+ const parsed = parseScope(segments.slice(1));
59004
+ if (parsed === null) return null;
59005
+ const fieldPath = segments.slice(1 + parsed.used).join("/");
59006
+ if (fieldPath.length === 0) return null;
59007
+ return {
59008
+ owner,
59009
+ scope: parsed.scope,
59010
+ fieldPath
59011
+ };
59012
+ }
58937
59013
  /** A write to a secret path could not be stored in the keychain, so it was refused. */
58938
59014
  var KeychainWriteRefusedError = class extends Error {
58939
59015
  fieldPath;
@@ -58944,7 +59020,7 @@ var KeychainWriteRefusedError = class extends Error {
58944
59020
  }
58945
59021
  };
58946
59022
  var KEEP = { kind: "keep" };
58947
- function isRecord(value) {
59023
+ function isRecord$1(value) {
58948
59024
  return typeof value === "object" && value !== null && !Array.isArray(value);
58949
59025
  }
58950
59026
  function defaultMintId() {
@@ -58957,7 +59033,7 @@ function collectSecretMarkerRefs(value, out = []) {
58957
59033
  return out;
58958
59034
  }
58959
59035
  if (Array.isArray(value)) for (const item of value) collectSecretMarkerRefs(item, out);
58960
- else if (isRecord(value)) for (const child of Object.values(value)) collectSecretMarkerRefs(child, out);
59036
+ else if (isRecord$1(value)) for (const child of Object.values(value)) collectSecretMarkerRefs(child, out);
58961
59037
  return out;
58962
59038
  }
58963
59039
  async function storedValueEquals(secrets, marker, candidate) {
@@ -59012,7 +59088,7 @@ function rowId(row, idKey) {
59012
59088
  return null;
59013
59089
  }
59014
59090
  async function writeArray(ctx, node, incoming, stored, fieldPath) {
59015
- const storedRows = Array.isArray(stored) ? stored.filter(isRecord) : [];
59091
+ const storedRows = Array.isArray(stored) ? stored.filter(isRecord$1) : [];
59016
59092
  if (!Array.isArray(incoming)) {
59017
59093
  ctx.deletes.push(...collectSecretMarkerRefs(storedRows));
59018
59094
  return {
@@ -59028,7 +59104,7 @@ async function writeArray(ctx, node, incoming, stored, fieldPath) {
59028
59104
  const kept = /* @__PURE__ */ new Set();
59029
59105
  const rows = [];
59030
59106
  for (const row of incoming) {
59031
- if (!isRecord(row)) {
59107
+ if (!isRecord$1(row)) {
59032
59108
  rows.push(row);
59033
59109
  continue;
59034
59110
  }
@@ -59053,7 +59129,7 @@ async function writeNode(ctx, node, incoming, stored, fieldPath) {
59053
59129
  case "leaf": return writeLeaf(ctx, incoming, stored, fieldPath);
59054
59130
  case "array": return writeArray(ctx, node, incoming, stored, fieldPath);
59055
59131
  case "object": {
59056
- if (!isRecord(incoming)) {
59132
+ if (!isRecord$1(incoming)) {
59057
59133
  if (incoming === void 0) return KEEP;
59058
59134
  ctx.deletes.push(...collectSecretMarkerRefs(stored));
59059
59135
  return {
@@ -59061,7 +59137,7 @@ async function writeNode(ctx, node, incoming, stored, fieldPath) {
59061
59137
  value: incoming
59062
59138
  };
59063
59139
  }
59064
- const storedObj = isRecord(stored) ? stored : {};
59140
+ const storedObj = isRecord$1(stored) ? stored : {};
59065
59141
  return {
59066
59142
  kind: "value",
59067
59143
  value: await writeMembers(ctx, node.children, incoming, storedObj, (m) => `${fieldPath}.${m}`)
@@ -59120,12 +59196,19 @@ async function transformSecretWrite(input) {
59120
59196
  }
59121
59197
  };
59122
59198
  }
59199
+ /** Is `ref` one of `owner`'s refs? */
59200
+ function isSecretRefOwnedBy(ref, owner) {
59201
+ return parseSecretRef(ref)?.owner === owner;
59202
+ }
59123
59203
  /**
59124
59204
  * Replace every marker in `value` with its keychain value. Returns the SAME
59125
59205
  * reference when there is no marker (no allocation, no keychain call).
59126
59206
  */
59127
- async function resolveSecretMarkers(value, secrets) {
59128
- const refs = collectSecretMarkerRefs(value);
59207
+ async function resolveSecretMarkers(value, secrets, options = {}) {
59208
+ const keepMarker = options.unresolved === "keep-marker";
59209
+ const owner = options.ownedBy;
59210
+ const inScope = (ref) => owner === void 0 || isSecretRefOwnedBy(ref, owner);
59211
+ const refs = collectSecretMarkerRefs(value).filter(inScope);
59129
59212
  if (refs.length === 0) return {
59130
59213
  value,
59131
59214
  unresolved: []
@@ -59149,10 +59232,18 @@ async function resolveSecretMarkers(value, secrets) {
59149
59232
  }
59150
59233
  const substitute = (v) => {
59151
59234
  if (isSecretMarker(v)) {
59235
+ if (!inScope(v.$secret)) return {
59236
+ keep: true,
59237
+ value: v
59238
+ };
59152
59239
  const answer = answers[v.$secret];
59153
- return answer?.kind === "value" ? {
59240
+ if (answer?.kind === "value") return {
59154
59241
  keep: true,
59155
59242
  value: answer.value
59243
+ };
59244
+ return keepMarker ? {
59245
+ keep: true,
59246
+ value: v
59156
59247
  } : {
59157
59248
  keep: false,
59158
59249
  value: void 0
@@ -59169,7 +59260,7 @@ async function resolveSecretMarkers(value, secrets) {
59169
59260
  value: items
59170
59261
  };
59171
59262
  }
59172
- if (isRecord(v)) {
59263
+ if (isRecord$1(v)) {
59173
59264
  const out = {};
59174
59265
  for (const [k, child] of Object.entries(v)) {
59175
59266
  const s = substitute(child);
@@ -59190,14 +59281,152 @@ async function resolveSecretMarkers(value, secrets) {
59190
59281
  unresolved
59191
59282
  };
59192
59283
  }
59193
- function touchesTree(tree, patch) {
59194
- if (tree.size === 0) return false;
59195
- for (const key of Object.keys(patch)) {
59196
- const at = key.indexOf("@");
59197
- if (tree.has(at > 0 ? key.slice(0, at) : key)) return true;
59284
+ /** An addon tried to replace a stored secret it could not read. Nothing was written. */
59285
+ var SecretOverwriteRefusedError = class extends Error {
59286
+ ref;
59287
+ reason;
59288
+ constructor(ref, reason) {
59289
+ super(`secret ${ref} was not replaced: its stored value cannot be read right now (${reason}), and an addon may not overwrite a secret it cannot see. Nothing was written.`);
59290
+ this.ref = ref;
59291
+ this.reason = reason;
59292
+ this.name = "SecretOverwriteRefusedError";
59293
+ }
59294
+ };
59295
+ function isRecord(value) {
59296
+ return typeof value === "object" && value !== null && !Array.isArray(value);
59297
+ }
59298
+ function resolvedValue(pass, marker) {
59299
+ const answer = pass.answers[marker.$secret];
59300
+ return answer?.kind === "value" ? answer.value : null;
59301
+ }
59302
+ async function atMarker(pass, incoming, stored) {
59303
+ if (incoming === null) return stored;
59304
+ if (typeof incoming !== "string") return incoming;
59305
+ if (incoming === resolvedValue(pass, stored)) return stored;
59306
+ const intent = classifySecretWrite(incoming);
59307
+ if (intent.kind !== "set") return stored;
59308
+ const ref = stored.$secret;
59309
+ if (!isSecretRefOwnedBy(ref, pass.secrets.owner)) return incoming;
59310
+ const answer = pass.answers[ref];
59311
+ if ((answer === void 0 || answer.kind === "unavailable" || answer.kind === "forbidden") && !pass.operatorWrite) throw new SecretOverwriteRefusedError(ref, answer === void 0 ? "not-initialized" : answer.kind === "unavailable" ? answer.reason : answer.kind);
59312
+ try {
59313
+ await pass.secrets.put(ref, intent.value);
59314
+ } catch (err) {
59315
+ throw new KeychainWriteRefusedError(ref, err);
59316
+ }
59317
+ pass.changedRefs.push(ref);
59318
+ return stored;
59319
+ }
59320
+ function inArray(pass, incoming, stored) {
59321
+ return incoming.map((item, index) => {
59322
+ const twin = stored[index];
59323
+ if (isSecretMarker(twin)) return typeof item === "string" && item === resolvedValue(pass, twin) ? twin : item;
59324
+ if (isRecord(item) && isRecord(twin)) return inArrayRow(pass, item, twin);
59325
+ if (Array.isArray(item) && Array.isArray(twin)) return inArray(pass, item, twin);
59326
+ return item;
59327
+ });
59328
+ }
59329
+ function inArrayRow(pass, incoming, stored) {
59330
+ const out = { ...incoming };
59331
+ for (const [key, value] of Object.entries(incoming)) {
59332
+ const twin = stored[key];
59333
+ if (isSecretMarker(twin)) {
59334
+ if (typeof value === "string" && value === resolvedValue(pass, twin)) out[key] = twin;
59335
+ } else if (isRecord(value) && isRecord(twin)) out[key] = inArrayRow(pass, value, twin);
59336
+ else if (Array.isArray(value) && Array.isArray(twin)) out[key] = inArray(pass, value, twin);
59337
+ }
59338
+ return out;
59339
+ }
59340
+ async function walk(pass, incoming, stored) {
59341
+ if (isSecretMarker(stored)) return atMarker(pass, incoming, stored);
59342
+ if (Array.isArray(incoming) && Array.isArray(stored)) return inArray(pass, incoming, stored);
59343
+ if (!isRecord(incoming) || !isRecord(stored)) return incoming;
59344
+ const out = { ...incoming };
59345
+ for (const [key, value] of Object.entries(incoming)) out[key] = await walk(pass, value, stored[key]);
59346
+ return out;
59347
+ }
59348
+ /** Restore markers a write-back carries as values. See the file doc. */
59349
+ async function restoreUnchangedSecrets(input) {
59350
+ const refs = [];
59351
+ for (const key of Object.keys(input.patch)) collectSecretMarkerRefs(input.stored[key], refs);
59352
+ const owned = refs.filter((ref) => isSecretRefOwnedBy(ref, input.secrets.owner));
59353
+ if (owned.length === 0) return {
59354
+ patch: input.patch,
59355
+ changedRefs: []
59356
+ };
59357
+ const pass = {
59358
+ secrets: input.secrets,
59359
+ answers: await input.secrets.resolve([...new Set(owned)]),
59360
+ operatorWrite: input.operatorWrite,
59361
+ changedRefs: []
59362
+ };
59363
+ const out = {};
59364
+ for (const [key, value] of Object.entries(input.patch)) out[key] = await walk(pass, value, input.stored[key]);
59365
+ return {
59366
+ patch: out,
59367
+ changedRefs: pass.changedRefs
59368
+ };
59369
+ }
59370
+ /** Structural equality over JSON-shaped values (key order does not matter). */
59371
+ function isJsonEqual(a, b) {
59372
+ if (Object.is(a, b)) return true;
59373
+ if (Array.isArray(a)) return Array.isArray(b) && a.length === b.length && a.every((v, i) => isJsonEqual(v, b[i]));
59374
+ if (isRecord(a) && isRecord(b)) {
59375
+ const keys = Object.keys(a);
59376
+ if (keys.length !== Object.keys(b).length) return false;
59377
+ return keys.every((k) => Object.prototype.hasOwnProperty.call(b, k) && isJsonEqual(a[k], b[k]));
59198
59378
  }
59199
59379
  return false;
59200
59380
  }
59381
+ /** The patch without the keys whose value already equals the stored one. */
59382
+ function dropUnchangedKeys(patch, stored) {
59383
+ const out = {};
59384
+ for (const [key, value] of Object.entries(patch)) {
59385
+ if (Object.prototype.hasOwnProperty.call(stored, key) && isJsonEqual(value, stored[key])) continue;
59386
+ out[key] = value;
59387
+ }
59388
+ return out;
59389
+ }
59390
+ /** The top-level keys of a blob that hold at least one of `owner`'s markers. */
59391
+ function markerKeysOf(blob, owner) {
59392
+ const keys = /* @__PURE__ */ new Set();
59393
+ for (const [key, value] of Object.entries(blob)) if (collectSecretMarkerRefs(value).some((ref) => isSecretRefOwnedBy(ref, owner))) keys.add(key);
59394
+ return keys;
59395
+ }
59396
+ function nodeFromStored(value, owner) {
59397
+ if (isSecretMarker(value)) return isSecretRefOwnedBy(value.$secret, owner) ? { kind: "leaf" } : null;
59398
+ if (!isRecord(value)) return null;
59399
+ const children = /* @__PURE__ */ new Map();
59400
+ for (const [key, child] of Object.entries(value)) {
59401
+ const node = nodeFromStored(child, owner);
59402
+ if (node !== null) children.set(key, node);
59403
+ }
59404
+ return children.size > 0 ? {
59405
+ kind: "object",
59406
+ children
59407
+ } : null;
59408
+ }
59409
+ /**
59410
+ * The declared secret tree, widened by every place the STORED blob holds a
59411
+ * marker under one of `keys` — so a marker the schema no longer declares (or
59412
+ * never declared: Wyze before b4906cec6) still gets the save path's
59413
+ * KEEP / SET / CLEAR semantics instead of being overwritten by whatever the
59414
+ * addon writes. Markers inside arrays are not added: a row has no id field to
59415
+ * match by unless the schema declares one. Only `owner`'s markers count: a
59416
+ * builtin that keeps another addon's marker (device-manager) never takes it
59417
+ * over.
59418
+ */
59419
+ function widenTreeWithStoredMarkers(declared, stored, keys, owner) {
59420
+ const added = /* @__PURE__ */ new Map();
59421
+ for (const key of keys) {
59422
+ const at = key.indexOf("@");
59423
+ const base = at > 0 ? key.slice(0, at) : key;
59424
+ if (declared.has(base) || added.has(base)) continue;
59425
+ const node = nodeFromStored(stored[key], owner);
59426
+ if (node !== null) added.set(base, node);
59427
+ }
59428
+ return added.size === 0 ? declared : new Map([...declared, ...added]);
59429
+ }
59201
59430
  /** The blob as stored now; a failed read REFUSES the write instead of guessing. */
59202
59431
  async function readStoredAddonBlob(raw) {
59203
59432
  const threeWay = raw.readAddonStoreResult;
@@ -59206,7 +59435,41 @@ async function readStoredAddonBlob(raw) {
59206
59435
  if (result.kind === "failed") throw new Error(`settings write refused: the stored blob could not be read (${result.error})`);
59207
59436
  return result.kind === "missing" ? {} : result.value;
59208
59437
  }
59209
- function createSecretAwareSettings(raw, opts) {
59438
+ function touchesTree(tree, patch) {
59439
+ if (tree.size === 0) return false;
59440
+ for (const key of Object.keys(patch)) {
59441
+ const at = key.indexOf("@");
59442
+ if (tree.has(at > 0 ? key.slice(0, at) : key)) return true;
59443
+ }
59444
+ return false;
59445
+ }
59446
+ /**
59447
+ * Which top-level keys of each store held markers when last seen. `undefined`
59448
+ * for a store not seen yet: its first write reads it, to be safe.
59449
+ */
59450
+ var MarkerKeyIndex = class {
59451
+ owner;
59452
+ byStore = /* @__PURE__ */ new Map();
59453
+ constructor(owner) {
59454
+ this.owner = owner;
59455
+ }
59456
+ seen(store, blob) {
59457
+ this.byStore.set(store, markerKeysOf(blob, this.owner));
59458
+ }
59459
+ wrote(store, patch) {
59460
+ const keys = this.byStore.get(store);
59461
+ if (keys === void 0) return;
59462
+ const now = markerKeysOf(patch, this.owner);
59463
+ for (const key of Object.keys(patch)) if (now.has(key)) keys.add(key);
59464
+ else keys.delete(key);
59465
+ }
59466
+ mayHoldMarkers(store, patch) {
59467
+ const keys = this.byStore.get(store);
59468
+ if (keys === void 0) return true;
59469
+ return Object.keys(patch).some((key) => keys.has(key));
59470
+ }
59471
+ };
59472
+ function createHandle(raw, opts) {
59210
59473
  const chains = /* @__PURE__ */ new Map();
59211
59474
  const serialize = (key, fn) => {
59212
59475
  const next = (chains.get(key) ?? Promise.resolve()).then(fn, fn);
@@ -59217,46 +59480,130 @@ function createSecretAwareSettings(raw, opts) {
59217
59480
  });
59218
59481
  return next;
59219
59482
  };
59220
- const write = async (chainKey, tree, scope, patch, readStored, rawWrite) => {
59221
- if (!touchesTree(tree, patch)) return rawWrite(patch);
59222
- return serialize(chainKey, async () => {
59483
+ const index = new MarkerKeyIndex(opts.secrets.owner);
59484
+ const resolveRead = async (store, blob) => {
59485
+ index.seen(store, blob);
59486
+ const { value, unresolved } = await resolveSecretMarkers(blob, opts.secrets, {
59487
+ unresolved: "keep-marker",
59488
+ ownedBy: opts.secrets.owner
59489
+ });
59490
+ if (unresolved.length > 0) opts.onUnresolved?.(unresolved);
59491
+ return value;
59492
+ };
59493
+ const write = async (store, declared, scope, patch, readStored, rawWrite) => {
59494
+ if (!touchesTree(declared, patch) && !index.mayHoldMarkers(store, patch)) {
59495
+ await rawWrite(patch);
59496
+ index.wrote(store, patch);
59497
+ return { changed: true };
59498
+ }
59499
+ return serialize(store, async () => {
59223
59500
  const stored = await readStored();
59501
+ index.seen(store, stored);
59502
+ const operatorWrite = opts.isOperatorWrite?.() === true;
59503
+ const restored = await restoreUnchangedSecrets({
59504
+ patch,
59505
+ stored,
59506
+ secrets: opts.secrets,
59507
+ operatorWrite
59508
+ });
59224
59509
  const result = await transformSecretWrite({
59225
- tree,
59510
+ tree: widenTreeWithStoredMarkers(declared, stored, Object.keys(restored.patch), opts.secrets.owner),
59226
59511
  secrets: opts.secrets,
59227
- patch,
59512
+ patch: restored.patch,
59228
59513
  stored,
59229
59514
  ...scope !== void 0 ? { scope } : {},
59230
- operatorWrite: opts.isOperatorWrite?.() === true
59515
+ operatorWrite
59231
59516
  });
59232
- if (Object.keys(result.patch).length > 0) await rawWrite(result.patch);
59517
+ const effective = dropUnchangedKeys(result.patch, stored);
59518
+ const wroteBlob = Object.keys(effective).length > 0;
59519
+ if (wroteBlob) {
59520
+ await rawWrite(effective);
59521
+ index.wrote(store, effective);
59522
+ }
59233
59523
  const { orphaned } = await result.afterWrite();
59234
59524
  if (orphaned.length > 0) opts.onOrphaned(orphaned);
59235
- });
59525
+ return { changed: wroteBlob || restored.changedRefs.length > 0 };
59526
+ });
59527
+ };
59528
+ const writeAddon = (patch) => write("addon", opts.addonTree(), void 0, patch, () => readStoredAddonBlob(raw), (p) => raw.writeAddonStore(p));
59529
+ const readAddonStoreResult = raw.readAddonStoreResult;
59530
+ const readAddonStoreKeyResult = raw.readAddonStoreKeyResult;
59531
+ const readDeviceStoreBatch = raw.readDeviceStoreBatch;
59532
+ const overrides = {
59533
+ readAddonStore: async () => resolveRead("addon", await raw.readAddonStore()),
59534
+ ...readAddonStoreResult !== void 0 ? { readAddonStoreResult: async () => {
59535
+ const result = await readAddonStoreResult.call(raw);
59536
+ return result.kind === "value" ? {
59537
+ kind: "value",
59538
+ value: await resolveRead("addon", result.value)
59539
+ } : result;
59540
+ } } : {},
59541
+ ...readAddonStoreKeyResult !== void 0 ? { readAddonStoreKeyResult: async (key) => {
59542
+ const result = await readAddonStoreKeyResult.call(raw, key);
59543
+ if (result.kind !== "present") return result;
59544
+ const { value, unresolved } = await resolveSecretMarkers({ [key]: result.value }, opts.secrets, {
59545
+ unresolved: "keep-marker",
59546
+ ownedBy: opts.secrets.owner
59547
+ });
59548
+ if (unresolved.length > 0) opts.onUnresolved?.(unresolved);
59549
+ return {
59550
+ kind: "present",
59551
+ value: value[key]
59552
+ };
59553
+ } } : {},
59554
+ readDeviceStore: async (deviceId) => resolveRead(`device:${deviceId}`, await raw.readDeviceStore(deviceId)),
59555
+ ...readDeviceStoreBatch !== void 0 ? { readDeviceStoreBatch: async (deviceIds) => {
59556
+ const rows = await readDeviceStoreBatch.call(raw, deviceIds);
59557
+ const out = /* @__PURE__ */ new Map();
59558
+ for (const [deviceId, blob] of rows) out.set(deviceId, await resolveRead(`device:${deviceId}`, blob));
59559
+ return out;
59560
+ } } : {},
59561
+ writeAddonStore: async (patch) => {
59562
+ await writeAddon(patch);
59563
+ },
59564
+ writeDeviceStore: async (deviceId, patch) => {
59565
+ await write(`device:${deviceId}`, opts.deviceTree(), {
59566
+ kind: "device",
59567
+ deviceId
59568
+ }, patch, () => raw.readDeviceStore(deviceId), (p) => raw.writeDeviceStore(deviceId, p));
59569
+ }
59236
59570
  };
59237
- const wrapped = {
59238
- writeAddonStore: (patch) => write("addon", opts.addonTree(), void 0, patch, () => readStoredAddonBlob(raw), (p) => raw.writeAddonStore(p)),
59239
- writeDeviceStore: (deviceId, patch) => write(`device:${deviceId}`, opts.deviceTree(), {
59240
- kind: "device",
59241
- deviceId
59242
- }, patch, () => raw.readDeviceStore(deviceId), (p) => raw.writeDeviceStore(deviceId, p))
59571
+ return {
59572
+ settings: new Proxy(raw, { get(target, prop, receiver) {
59573
+ if (typeof prop === "string" && Object.prototype.hasOwnProperty.call(overrides, prop)) return Reflect.get(overrides, prop);
59574
+ const value = Reflect.get(target, prop, receiver);
59575
+ return typeof value === "function" ? value.bind(target) : value;
59576
+ } }),
59577
+ raw: {
59578
+ readAddonStore: async () => {
59579
+ const blob = await raw.readAddonStore();
59580
+ index.seen("addon", blob);
59581
+ return blob;
59582
+ },
59583
+ readDeviceStore: async (deviceId) => {
59584
+ const blob = await raw.readDeviceStore(deviceId);
59585
+ index.seen(`device:${deviceId}`, blob);
59586
+ return blob;
59587
+ }
59588
+ },
59589
+ writeAddonStore: writeAddon
59243
59590
  };
59244
- return new Proxy(raw, { get(target, prop, receiver) {
59245
- if (prop === "writeAddonStore") return wrapped.writeAddonStore;
59246
- if (prop === "writeDeviceStore") return wrapped.writeDeviceStore;
59247
- const value = Reflect.get(target, prop, receiver);
59248
- return typeof value === "function" ? value.bind(target) : value;
59249
- } });
59250
59591
  }
59251
- /** The context the addon sees: identical, except that its settings writes are secret-aware. */
59252
- function withSecretAwareSettings(context, opts) {
59592
+ /** The context the addon sees, plus the private raw view and write outcome. */
59593
+ function createSecretAwareContext(context, opts) {
59253
59594
  const raw = context.settings;
59254
- if (raw === void 0) return context;
59255
- const settings = createSecretAwareSettings(raw, opts);
59256
- return new Proxy(context, { get(target, prop, receiver) {
59257
- if (prop === "settings") return settings;
59258
- return Reflect.get(target, prop, receiver);
59259
- } });
59595
+ if (raw === void 0) return {
59596
+ context,
59597
+ handle: null
59598
+ };
59599
+ const handle = createHandle(raw, opts);
59600
+ return {
59601
+ context: new Proxy(context, { get(target, prop, receiver) {
59602
+ if (prop === "settings") return handle.settings;
59603
+ return Reflect.get(target, prop, receiver);
59604
+ } }),
59605
+ handle
59606
+ };
59260
59607
  }
59261
59608
  var LEAF = { kind: "leaf" };
59262
59609
  var DEFAULT_ITEM_ID_KEY = "id";
@@ -59431,6 +59778,14 @@ var BaseAddon = class {
59431
59778
  _secretChangeUnsub = null;
59432
59779
  /** >0 while an OPERATOR's settings write is being applied. */
59433
59780
  _operatorWriteDepth = 0;
59781
+ /**
59782
+ * The keychain-aware settings handle (D798). Its `raw` view is the ONLY way
59783
+ * to the marker-bearing blobs and stays private to this class: the form
59784
+ * hydrate and config resolution need markers, addon code never does.
59785
+ */
59786
+ _secretSettings = null;
59787
+ /** Refs an addon-facing read could not resolve — each is logged once per process. */
59788
+ _loggedUnresolvedReads = /* @__PURE__ */ new Set();
59434
59789
  constructor(defaults) {
59435
59790
  this.defaults = defaults;
59436
59791
  this._config = { ...defaults };
@@ -59467,13 +59822,21 @@ var BaseAddon = class {
59467
59822
  }
59468
59823
  async initialize(context) {
59469
59824
  const secrets = context.secrets;
59470
- this._ctx = secrets !== void 0 ? withSecretAwareSettings(context, {
59471
- secrets,
59472
- addonTree: () => this.addonSecretTree(),
59473
- deviceTree: () => this.deviceSecretTree(),
59474
- onOrphaned: (refs) => context.logger.warn("keychain refs dropped by a settings write could not be deleted", { meta: { refs: [...refs] } }),
59475
- isOperatorWrite: () => this._operatorWriteDepth > 0
59476
- }) : context;
59825
+ if (secrets !== void 0) {
59826
+ const { context: wrapped, handle } = createSecretAwareContext(context, {
59827
+ secrets,
59828
+ addonTree: () => this.addonSecretTree(),
59829
+ deviceTree: () => this.deviceSecretTree(),
59830
+ onOrphaned: (refs) => context.logger.warn("keychain refs dropped by a settings write could not be deleted", { meta: { refs: [...refs] } }),
59831
+ isOperatorWrite: () => this._operatorWriteDepth > 0,
59832
+ onUnresolved: (unresolved) => this.logUnresolvedRead(unresolved)
59833
+ });
59834
+ this._ctx = wrapped;
59835
+ this._secretSettings = handle;
59836
+ } else {
59837
+ this._ctx = context;
59838
+ this._secretSettings = null;
59839
+ }
59477
59840
  await this.resolveConfig();
59478
59841
  if (secrets !== void 0) this._secretChangeUnsub = secrets.onChange((ref) => {
59479
59842
  if (this._configSecretRefs.has(ref)) this.scheduleSecretReresolve(SECRET_CHANGE_DEBOUNCE_MS);
@@ -59590,11 +59953,8 @@ var BaseAddon = class {
59590
59953
  async getGlobalSettings(overlay, cap, nodeId) {
59591
59954
  const schema = this.globalSettingsSchema(cap);
59592
59955
  if (!schema) return { sections: [] };
59593
- const projected = await this.resolveGlobalStore(nodeId, cap);
59594
- return hydrateSchema(schema, overlay ? {
59595
- ...projected,
59596
- ...overlay
59597
- } : projected, { inlineSecretsAsViews: true });
59956
+ const projected = await this.readRawProjectedStore(nodeId, cap);
59957
+ return hydrateSchema(schema, overlay ? await this.overlayKeepingMarkers(projected, overlay) : projected, { inlineSecretsAsViews: true });
59598
59958
  }
59599
59959
  /**
59600
59960
  * The integration-level view of this addon's settings: exactly the sections
@@ -59639,7 +59999,7 @@ var BaseAddon = class {
59639
59999
  });
59640
60000
  }
59641
60001
  if (sections.length === 0) return null;
59642
- const projected = await this.resolveGlobalStore(nodeId);
60002
+ const projected = await this.readRawProjectedStore(nodeId);
59643
60003
  return hydrateSchema({
59644
60004
  ...schema,
59645
60005
  sections
@@ -59656,12 +60016,50 @@ var BaseAddon = class {
59656
60016
  * the store for custom option logic (option narrowing, value snapping) to
59657
60017
  * read it per-node — never `ctx.settings.readAddonStore()` directly.
59658
60018
  * `nodeId` omitted ⇒ the local node (node-blind injection from ctx).
60019
+ *
60020
+ * Keychain values come back RESOLVED (D798): a secret reads as its value,
60021
+ * never as a `{ $secret }` marker. One the keychain cannot serve right now
60022
+ * stays a marker — "stored, unavailable" (`isSecretMarker()` is true, and it
60023
+ * is listed in {@link unresolvedSecrets}) — never `''` and never absent, so
60024
+ * it cannot be mistaken for "nothing stored, mint a new one". Writing the
60025
+ * resolved blob back is a no-op for every unchanged secret.
59659
60026
  */
59660
60027
  async resolveGlobalStore(nodeId, cap) {
59661
60028
  const raw = await this._ctx?.settings?.readAddonStore() ?? {};
60029
+ return this.projectForNode(raw, nodeId, cap);
60030
+ }
60031
+ projectForNode(store, nodeId, cap) {
59662
60032
  const keys = this.perNodeKeys(cap);
59663
60033
  const node = normalizeNodeId(nodeId ?? this._ctx?.kernel?.localNodeId);
59664
- return keys.size > 0 ? projectStore(raw, keys, node) : raw;
60034
+ return keys.size > 0 ? projectStore(store, keys, node) : store;
60035
+ }
60036
+ /** The PROJECTED store with its markers — the form hydrate only (D798). */
60037
+ async readRawProjectedStore(nodeId, cap) {
60038
+ const raw = await this.rawSettings()?.readAddonStore() ?? {};
60039
+ return this.projectForNode(raw, nodeId, cap);
60040
+ }
60041
+ /**
60042
+ * `{ ...stored, ...overlay }`, except that an overlay member equal to the
60043
+ * RESOLVED stored one keeps the stored (marker-bearing) member — so a form
60044
+ * hydrated from a resolved overlay still shows a secret as "set", never as
60045
+ * its value.
60046
+ */
60047
+ async overlayKeepingMarkers(stored, overlay) {
60048
+ const secrets = this._ctx?.secrets;
60049
+ const merged = {
60050
+ ...stored,
60051
+ ...overlay
60052
+ };
60053
+ if (secrets === void 0 || collectSecretMarkerRefs(stored).length === 0) return merged;
60054
+ const { value: resolved } = await resolveSecretMarkers(stored, secrets, {
60055
+ unresolved: "keep-marker",
60056
+ ownedBy: secrets.owner
60057
+ });
60058
+ for (const key of Object.keys(overlay)) {
60059
+ if (collectSecretMarkerRefs(stored[key]).length === 0) continue;
60060
+ if (isJsonEqual(overlay[key], resolved[key])) merged[key] = stored[key];
60061
+ }
60062
+ return merged;
59665
60063
  }
59666
60064
  /**
59667
60065
  * Whether ONE global key of this addon's store was written, read three-way
@@ -59726,8 +60124,12 @@ var BaseAddon = class {
59726
60124
  async clearSecrets(keys, nodeId) {
59727
60125
  const tree = this.addonSecretTree();
59728
60126
  const keychain = this._ctx?.secrets !== void 0;
60127
+ const stored = keychain ? await this.readAddonStoreWithRetry() : {};
59729
60128
  const patch = {};
59730
- for (const key of keys) patch[key] = keychain && tree.has(key) ? SECRET_CLEAR : "";
60129
+ for (const key of keys) {
60130
+ const keychainStored = tree.has(key) || collectSecretMarkerRefs(stored[key]).length > 0;
60131
+ patch[key] = keychain && keychainStored ? SECRET_CLEAR : "";
60132
+ }
59731
60133
  await this.applyGlobalPatch(patch, nodeId);
59732
60134
  }
59733
60135
  async applyGlobalPatch(barePatch, nodeId) {
@@ -59735,7 +60137,11 @@ var BaseAddon = class {
59735
60137
  const localNode = normalizeNodeId(this._ctx?.kernel?.localNodeId);
59736
60138
  const target = normalizeNodeId(nodeId ?? this._ctx?.kernel?.localNodeId);
59737
60139
  const scoped = keys.size > 0 ? scopePatch(barePatch, keys, target) : barePatch;
59738
- await this._ctx?.settings?.writeAddonStore(scoped);
60140
+ const handle = this._secretSettings;
60141
+ if (handle !== null) {
60142
+ const { changed } = await handle.writeAddonStore(scoped);
60143
+ if (!changed) return;
60144
+ } else await this._ctx?.settings?.writeAddonStore(scoped);
59739
60145
  if (target !== localNode) return;
59740
60146
  await this.resolveConfig();
59741
60147
  await this.onConfigChanged();
@@ -59788,7 +60194,7 @@ var BaseAddon = class {
59788
60194
  async getDeviceSettings(deviceId) {
59789
60195
  const schema = this.deviceSettingsSchema();
59790
60196
  if (!schema) return { sections: [] };
59791
- return hydrateSchema(schema, await this._ctx?.settings?.readDeviceStore(deviceId) ?? {}, { inlineSecretsAsViews: true });
60197
+ return hydrateSchema(schema, await this.rawSettings()?.readDeviceStore(deviceId) ?? {}, { inlineSecretsAsViews: true });
59792
60198
  }
59793
60199
  async updateDeviceSettings(deviceId, patch) {
59794
60200
  await this._ctx?.settings?.writeDeviceStore(deviceId, patch);
@@ -59960,7 +60366,7 @@ var BaseAddon = class {
59960
60366
  key,
59961
60367
  schema,
59962
60368
  fallback,
59963
- read: async () => this.resolveStoredSecrets(await this._ctx?.settings?.readDeviceStore(deviceId) ?? {}, false),
60369
+ read: async () => this.resolveStoredSecrets(await this.rawSettings()?.readDeviceStore(deviceId) ?? {}, false),
59964
60370
  write: async (patch) => {
59965
60371
  await this._ctx?.settings?.writeDeviceStore(deviceId, patch);
59966
60372
  },
@@ -60022,6 +60428,23 @@ var BaseAddon = class {
60022
60428
  }
60023
60429
  return value;
60024
60430
  }
60431
+ /**
60432
+ * The marker-bearing settings reads (D798) — private on purpose. Without a
60433
+ * keychain the context's own view is already raw.
60434
+ */
60435
+ rawSettings() {
60436
+ return this._secretSettings?.raw ?? this._ctx?.settings;
60437
+ }
60438
+ /** An addon-facing read met markers it could not resolve: say so once per ref. */
60439
+ logUnresolvedRead(unresolved) {
60440
+ const fresh = unresolved.filter((u) => !this._loggedUnresolvedReads.has(u.ref));
60441
+ if (fresh.length === 0) return;
60442
+ for (const u of fresh) this._loggedUnresolvedReads.add(u.ref);
60443
+ this._ctx?.logger?.warn?.("settings read: a stored secret is unavailable — it reads as its marker, not as a value", { meta: { secrets: fresh.map((u) => ({
60444
+ ref: u.ref,
60445
+ reason: u.reason
60446
+ })) } });
60447
+ }
60025
60448
  /** Re-resolve the config (a keychain-only change, or a retry) and apply it. */
60026
60449
  scheduleSecretReresolve(delayMs) {
60027
60450
  const timerOf = delayMs === SECRET_CHANGE_DEBOUNCE_MS ? "_secretChangeTimer" : "_secretRetryTimer";
@@ -60048,7 +60471,7 @@ var BaseAddon = class {
60048
60471
  * `{}` (defaults) — the addon's first successful patch will rehydrate.
60049
60472
  */
60050
60473
  async readAddonStoreWithRetry() {
60051
- const settings = this._ctx?.settings;
60474
+ const settings = this.rawSettings();
60052
60475
  if (!settings) return {};
60053
60476
  const delaysMs = [
60054
60477
  150,
@@ -61860,6 +62283,16 @@ var CompositionSchema = object({
61860
62283
  seen.add(feature.cap);
61861
62284
  });
61862
62285
  });
62286
+ var NodeColorIdSchema = _enum([
62287
+ "node-a",
62288
+ "node-b",
62289
+ "node-c",
62290
+ "node-d",
62291
+ "node-e",
62292
+ "node-f",
62293
+ "node-g",
62294
+ "node-h"
62295
+ ]);
61863
62296
  new Set([
61864
62297
  "track",
61865
62298
  "face",
@@ -62351,6 +62784,278 @@ var CameraSwitchGroupSchema = object({
62351
62784
  fetchedAt: number()
62352
62785
  });
62353
62786
  /**
62787
+ * The trainer contract — what the hub hands the cloud trainer and what it
62788
+ * gets back (cloud training, D805+).
62789
+ *
62790
+ * The trainer (`hf/camstack-trainer`, published as the Hugging Face repo
62791
+ * `camstack/camstack-trainer`) is a separate AGPL program the hub never
62792
+ * imports: `job.json` goes in, files come out, and progress is `CAMSTACK_EVENT`
62793
+ * lines on stdout. These schemas are the hub's half of that boundary; the
62794
+ * trainer's pydantic models (and the JSON Schemas generated from them under
62795
+ * `hf/camstack-trainer/schemas/`) are the other half. A change here is a
62796
+ * change there, in the same piece of work.
62797
+ *
62798
+ * No `.default()` anywhere: defaults do not run on the addon cap path, so the
62799
+ * orchestrator fills every field of a job spec explicitly.
62800
+ */
62801
+ var TRAINING_JOB_SCHEMA = "camstack.training/v1";
62802
+ var TRAINING_RESULT_SCHEMA = "camstack.training-result/v1";
62803
+ /** What the trainer can export. Edge TPU is a later, separate image. */
62804
+ var TrainingExportSchema = _enum([
62805
+ "onnx",
62806
+ "openvino-fp16",
62807
+ "openvino-int8",
62808
+ "coreml-fp16"
62809
+ ]);
62810
+ var FloorsSchema = record(string(), number().min(0).max(1));
62811
+ object({
62812
+ schema: literal(TRAINING_JOB_SCHEMA),
62813
+ jobKey: string().uuid(),
62814
+ target: object({
62815
+ kind: literal("detector"),
62816
+ step: literal("object-detection")
62817
+ }),
62818
+ base: object({
62819
+ modelId: string().min(1),
62820
+ /** Ultralytics weights id, e.g. `yolov9m.pt`. */
62821
+ weights: string().min(1),
62822
+ imgsz: number().int().positive()
62823
+ }),
62824
+ baseline: object({
62825
+ modelId: string().min(1),
62826
+ /** The baseline ONNX the holdout comparison runs; public mirror URL. */
62827
+ onnxUrl: string().url(),
62828
+ imgsz: number().int().positive(),
62829
+ floors: FloorsSchema
62830
+ }),
62831
+ dataset: object({
62832
+ versionId: string().min(1),
62833
+ annotationHash: string(),
62834
+ /** sha256 of the uploaded archive; the trainer refuses a mismatch (exit 65). */
62835
+ sha256: string().regex(/^[0-9a-f]{64}$/)
62836
+ }),
62837
+ split: object({
62838
+ holdoutCameras: array(number().int()),
62839
+ /** When no camera is held out: the last N days of every camera. */
62840
+ holdoutLastDays: number().int().nonnegative(),
62841
+ valFraction: number().min(0).max(.5),
62842
+ seed: number().int()
62843
+ }),
62844
+ hyper: object({
62845
+ epochs: number().int().positive(),
62846
+ batch: number().int().positive(),
62847
+ lr0: number().positive(),
62848
+ /** Layers frozen from the start of the backbone; 0 = none. */
62849
+ freeze: number().int().nonnegative(),
62850
+ patience: number().int().nonnegative(),
62851
+ seed: number().int()
62852
+ }),
62853
+ replay: object({
62854
+ source: literal("coco2017"),
62855
+ count: number().int().nonnegative()
62856
+ }),
62857
+ exports: array(TrainingExportSchema).min(1),
62858
+ calibration: object({ maxFrames: number().int().positive() }),
62859
+ floors: object({
62860
+ minSupport: number().int().positive(),
62861
+ clamp: number().min(0).max(1)
62862
+ }),
62863
+ int8Gate: object({ maxMap50Drop: number().min(0).max(1) }),
62864
+ catalog: object({
62865
+ id: string().regex(/^[a-z0-9][a-z0-9-]{2,80}$/),
62866
+ name: string().min(1).max(160)
62867
+ })
62868
+ });
62869
+ /** One regular file of the bundle. An mlpackage contributes one row per member. */
62870
+ var TrainingResultFileSchema = object({
62871
+ path: string().min(1),
62872
+ bytes: number().int().nonnegative(),
62873
+ sha256: string().regex(/^[0-9a-f]{64}$/),
62874
+ format: _enum([
62875
+ "onnx",
62876
+ "openvino",
62877
+ "coreml",
62878
+ "pt"
62879
+ ]),
62880
+ variant: _enum(["base", "int8"])
62881
+ });
62882
+ var DraftFormatSchema = object({
62883
+ /** RELATIVE path inside the bundle; the hub rewrites it to `camstack-local://`. */
62884
+ url: string().min(1),
62885
+ sizeMB: number().nonnegative(),
62886
+ isDirectory: boolean().optional(),
62887
+ files: array(string()).optional(),
62888
+ runtimes: array(literal("python")).optional(),
62889
+ revision: string().min(1)
62890
+ });
62891
+ /** The trainer's half of a catalog entry; the hub completes it (labels, licence, group). */
62892
+ var TrainingCatalogDraftSchema = object({
62893
+ id: string().min(1),
62894
+ name: string().min(1),
62895
+ description: string(),
62896
+ labels: array(unknown()),
62897
+ inputSize: object({
62898
+ width: number().int().positive(),
62899
+ height: number().int().positive()
62900
+ }),
62901
+ preprocessMode: literal("letterbox"),
62902
+ defaultClassFloors: FloorsSchema,
62903
+ formats: object({
62904
+ onnx: DraftFormatSchema.optional(),
62905
+ openvino: DraftFormatSchema.optional(),
62906
+ coreml: DraftFormatSchema.optional()
62907
+ })
62908
+ });
62909
+ /** One class of one model's holdout report (the eval harness's summary). */
62910
+ var TrainingEvalClassSchema = object({
62911
+ positives: number().int(),
62912
+ floor: number().nullable(),
62913
+ tp: number().int(),
62914
+ fp: number().int(),
62915
+ fn: number().int(),
62916
+ precision: number().nullable(),
62917
+ recall: number().nullable(),
62918
+ ap50: number().nullable(),
62919
+ recallByCamera: record(string(), number().nullable()).optional(),
62920
+ recallByLight: record(string(), number().nullable()).optional(),
62921
+ fpByCamera: record(string(), number()).optional(),
62922
+ smallFound: number().int().optional(),
62923
+ smallTotal: number().int().optional()
62924
+ }).passthrough();
62925
+ var TrainingEvalReportSchema = object({
62926
+ frames: number().int(),
62927
+ classes: record(string(), TrainingEvalClassSchema)
62928
+ }).passthrough();
62929
+ /**
62930
+ * A succeeded result carries every block; a failed one carries the error and
62931
+ * whatever was known by then — the other blocks are ABSENT, not null. The
62932
+ * orchestrator checks the blocks it needs before it trusts a success.
62933
+ */
62934
+ var TrainingResultSchema = object({
62935
+ schema: literal(TRAINING_RESULT_SCHEMA),
62936
+ jobKey: string(),
62937
+ status: _enum(["succeeded", "failed"]),
62938
+ error: object({
62939
+ stage: string(),
62940
+ code: string(),
62941
+ message: string()
62942
+ }).nullable(),
62943
+ trainer: object({
62944
+ version: string(),
62945
+ revision: string()
62946
+ }),
62947
+ toolchain: record(string(), string().nullable()),
62948
+ dataset: object({
62949
+ versionId: string(),
62950
+ annotationHash: string(),
62951
+ sha256: string(),
62952
+ frames: object({
62953
+ train: number().int(),
62954
+ val: number().int(),
62955
+ holdout: number().int()
62956
+ }),
62957
+ holdoutCameras: array(number().int()),
62958
+ replayImages: number().int()
62959
+ }).optional(),
62960
+ training: object({
62961
+ epochsRun: number().int(),
62962
+ bestEpoch: number().int(),
62963
+ bestMap50: number(),
62964
+ bestMap50_95: number(),
62965
+ seconds: number()
62966
+ }).optional(),
62967
+ evaluation: object({
62968
+ holdoutFrames: number().int(),
62969
+ baseline: TrainingEvalReportSchema.nullable(),
62970
+ candidate: TrainingEvalReportSchema.nullable(),
62971
+ candidateInt8: TrainingEvalReportSchema.nullable(),
62972
+ recallDeltaByCamera: record(string(), record(string(), number())).nullable(),
62973
+ map50: record(string(), number().nullable())
62974
+ }).optional(),
62975
+ floors: object({
62976
+ baseline: FloorsSchema,
62977
+ candidate: FloorsSchema,
62978
+ candidateInt8: FloorsSchema.nullable(),
62979
+ notes: array(string())
62980
+ }).optional(),
62981
+ int8: object({
62982
+ kept: boolean(),
62983
+ map50Fp16: number().nullable(),
62984
+ map50Int8: number().nullable(),
62985
+ reason: string().nullable()
62986
+ }).optional(),
62987
+ exportsDropped: array(object({
62988
+ export: string(),
62989
+ reason: string()
62990
+ })).optional(),
62991
+ files: array(TrainingResultFileSchema).optional(),
62992
+ bundle: object({
62993
+ path: literal("bundle.tar"),
62994
+ bytes: number().int().nonnegative(),
62995
+ sha256: string().regex(/^[0-9a-f]{64}$/)
62996
+ }).nullable().optional(),
62997
+ catalogDraft: object({
62998
+ base: TrainingCatalogDraftSchema,
62999
+ int8: TrainingCatalogDraftSchema.nullable()
63000
+ }).nullable().optional(),
63001
+ licence: string()
63002
+ });
63003
+ var TrainingStageSchema = _enum([
63004
+ "prepare",
63005
+ "replay",
63006
+ "train",
63007
+ "eval",
63008
+ "export",
63009
+ "package"
63010
+ ]);
63011
+ var EventBase = {
63012
+ v: literal(1),
63013
+ ts: number()
63014
+ };
63015
+ discriminatedUnion("type", [
63016
+ object({
63017
+ ...EventBase,
63018
+ type: literal("stage"),
63019
+ stage: TrainingStageSchema
63020
+ }),
63021
+ object({
63022
+ ...EventBase,
63023
+ type: literal("epoch"),
63024
+ epoch: number().int(),
63025
+ epochs: number().int(),
63026
+ boxLoss: number().nullable().optional(),
63027
+ map50: number().nullable().optional(),
63028
+ map50_95: number().nullable().optional(),
63029
+ etaSec: number().nullable().optional()
63030
+ }),
63031
+ object({
63032
+ ...EventBase,
63033
+ type: literal("metric"),
63034
+ name: string(),
63035
+ value: number()
63036
+ }),
63037
+ object({
63038
+ ...EventBase,
63039
+ type: literal("artifact"),
63040
+ path: string(),
63041
+ bytes: number(),
63042
+ sha256: string()
63043
+ }),
63044
+ object({
63045
+ ...EventBase,
63046
+ type: literal("done"),
63047
+ status: _enum(["succeeded", "failed"]),
63048
+ resultSha256: string().nullable().optional()
63049
+ }),
63050
+ object({
63051
+ ...EventBase,
63052
+ type: literal("error"),
63053
+ stage: string(),
63054
+ code: string(),
63055
+ message: string()
63056
+ })
63057
+ ]);
63058
+ /**
62354
63059
  * What the gate decided about a birth, from the CALLER's point of view.
62355
63060
  *
62356
63061
  * Deliberately not `ConfirmationVerdict`: `undecided` is not a birth decision
@@ -64678,7 +65383,9 @@ var AddonHttpRouteSchema = object({
64678
65383
  "authenticated",
64679
65384
  "admin"
64680
65385
  ]).optional(),
64681
- description: string().optional()
65386
+ description: string().optional(),
65387
+ /** The hub limits this route per client address before the handler runs. */
65388
+ rateLimit: _enum(["auth"]).optional()
64682
65389
  });
64683
65390
  /**
64684
65391
  * Cross-process route invocation envelope. The hub captures the
@@ -65383,6 +66090,37 @@ var BackupDestinationInfoSchema = object({
65383
66090
  lastError: string().optional()
65384
66091
  });
65385
66092
  /**
66093
+ * How an archive is encrypted (operator decision 2026-10-09): to a backup
66094
+ * PUBLIC key the hub holds, so only the operator's secret key opens it.
66095
+ * Absent on a plain `.tar.gz` — every archive made before encryption, or
66096
+ * with it off — which restores without a key.
66097
+ */
66098
+ var BackupArchiveEncryptionSchema = object({
66099
+ /** `x25519-hkdf-aes256gcm-stream-v1`. */
66100
+ scheme: string(),
66101
+ /** 16 hex — the backup key whose secret restores this archive. */
66102
+ keyId: string()
66103
+ });
66104
+ /**
66105
+ * The backup encryption setting. The hub keeps PUBLIC keys only: the active
66106
+ * one new archives are encrypted to, and the retired ones older archives
66107
+ * still need. The secret key is shown once, at `setupEncryption`.
66108
+ */
66109
+ var BackupEncryptionStatusSchema = object({
66110
+ enabled: boolean(),
66111
+ active: object({
66112
+ keyId: string(),
66113
+ publicKey: string(),
66114
+ createdAt: number()
66115
+ }).nullable(),
66116
+ /** Every key ever set up, newest first. */
66117
+ keys: array(object({
66118
+ keyId: string(),
66119
+ createdAt: number(),
66120
+ retiredAt: number().nullable()
66121
+ })).readonly()
66122
+ });
66123
+ /**
65386
66124
  * Per-archive entry returned by `backup.listArchives({ destinationId })`.
65387
66125
  * Same shape the destination drill-in renders. Sourced from the per-
65388
66126
  * location `manifests.json` (no per-archive tarball read required).
@@ -65394,7 +66132,9 @@ var BackupArchiveEntrySchema = object({
65394
66132
  sizeBytes: number(),
65395
66133
  label: string().optional(),
65396
66134
  /** Top-level locations included in the archive (db, addons, tls, …). */
65397
- locations: array(string()).readonly()
66135
+ locations: array(string()).readonly(),
66136
+ /** Present when the archive is encrypted; restore then needs that key. */
66137
+ encryption: BackupArchiveEncryptionSchema.optional()
65398
66138
  });
65399
66139
  var BackupEntrySchema = object({
65400
66140
  id: string(),
@@ -65403,7 +66143,8 @@ var BackupEntrySchema = object({
65403
66143
  label: string().optional(),
65404
66144
  createdAt: number(),
65405
66145
  sizeBytes: number(),
65406
- locations: array(string()).optional()
66146
+ locations: array(string()).optional(),
66147
+ encryption: BackupArchiveEncryptionSchema.optional()
65407
66148
  });
65408
66149
  var ArchiveEntrySchema = object({
65409
66150
  path: string(),
@@ -65592,10 +66333,40 @@ method(_void(), array(BackupDestinationInfoSchema).readonly(), { auth: "admin" }
65592
66333
  * this list and skips entries whose path doesn't start with
65593
66334
  * any of them.
65594
66335
  */
65595
- locations: array(string()).optional()
66336
+ locations: array(string()).optional(),
66337
+ /**
66338
+ * The backup SECRET key, for an encrypted archive (ignored for a plain
66339
+ * one). The archive is decrypted into the hub's private staging
66340
+ * before the restart; the key is not stored. A wrong or missing key
66341
+ * is refused before the archive is downloaded.
66342
+ */
66343
+ backupSecretKey: string().optional()
65596
66344
  }), _void(), {
65597
66345
  kind: "mutation",
65598
66346
  auth: "admin"
66347
+ }), method(_void(), BackupEncryptionStatusSchema, { auth: "admin" }), method(object({}), object({
66348
+ keyId: string(),
66349
+ secretKey: string(),
66350
+ publicKey: string(),
66351
+ createdAt: number(),
66352
+ replacedKeyId: string().nullable()
66353
+ }), {
66354
+ kind: "mutation",
66355
+ auth: "admin"
66356
+ }), method(object({}), object({ disabledKeyId: string().nullable() }), {
66357
+ kind: "mutation",
66358
+ auth: "admin"
66359
+ }), method(object({ backupSecretKey: string() }), object({
66360
+ valid: boolean(),
66361
+ keyId: string().nullable(),
66362
+ /** The hub knows this key (active or retired). */
66363
+ known: boolean(),
66364
+ /** It is the key new archives are encrypted to. */
66365
+ active: boolean(),
66366
+ error: string().optional()
66367
+ }), {
66368
+ kind: "mutation",
66369
+ auth: "admin"
65599
66370
  }), method(object({
65600
66371
  destinationId: string(),
65601
66372
  backupId: string()
@@ -67321,7 +68092,60 @@ var CustomModelDescriptorSchema = object({
67321
68092
  stepId: string(),
67322
68093
  entry: ModelCatalogEntrySchema
67323
68094
  });
67324
- method(_void(), array(CustomModelDescriptorSchema).readonly(), { auth: "admin" });
68095
+ /** One regular file of an imported bundle, as the producer measured it. */
68096
+ var ModelBundleFileSchema = object({
68097
+ /** Relative path inside the bundle tar; an mlpackage member is `<x>.mlpackage/<member>`. */
68098
+ path: string().min(1),
68099
+ bytes: number().int().nonnegative(),
68100
+ sha256: string().regex(/^[0-9a-f]{64}$/)
68101
+ });
68102
+ var ImportModelBundleInputSchema = object({
68103
+ /** The registry provider that keeps the model (Model Studio). */
68104
+ addonId: string(),
68105
+ stepId: string().min(1),
68106
+ /**
68107
+ * The catalog rows to register, complete, every format URL already
68108
+ * `camstack-local://<modelId>/<file>` naming a file of the bundle. One
68109
+ * bundle may carry several rows (a base and its INT8 variant).
68110
+ */
68111
+ entries: array(ModelCatalogEntrySchema).min(1).max(4),
68112
+ /** The bundle tar, offered by the producer over `ctx.peerBytes` (same host). */
68113
+ bundle: object({
68114
+ ticket: PeerBytesTicketSchema,
68115
+ bytes: number().int().positive(),
68116
+ sha256: string().regex(/^[0-9a-f]{64}$/)
68117
+ }),
68118
+ /** Every file the tar must hold; anything missing, extra or different is refused. */
68119
+ files: array(ModelBundleFileSchema).min(1).max(64),
68120
+ /** Convert missing engine formats and push the model to every agent afterwards. */
68121
+ distribute: boolean()
68122
+ });
68123
+ var ImportModelBundleResultSchema = discriminatedUnion("kind", [object({
68124
+ kind: literal("imported"),
68125
+ modelIds: array(string()).readonly(),
68126
+ distributed: array(object({
68127
+ modelId: string(),
68128
+ nodeId: string(),
68129
+ format: _enum(MODEL_FORMATS),
68130
+ ok: boolean(),
68131
+ error: string().optional()
68132
+ })).readonly()
68133
+ }), object({
68134
+ kind: literal("refused"),
68135
+ reason: _enum([
68136
+ "transfer-failed",
68137
+ "checksum-mismatch",
68138
+ "bundle-mismatch",
68139
+ "invalid-entry",
68140
+ "id-taken"
68141
+ ]),
68142
+ detail: string()
68143
+ })]);
68144
+ method(_void(), array(CustomModelDescriptorSchema).readonly(), { auth: "admin" }), method(ImportModelBundleInputSchema, ImportModelBundleResultSchema, {
68145
+ kind: "mutation",
68146
+ auth: "admin",
68147
+ timeoutMs: 30 * 6e4
68148
+ });
67325
68149
  /**
67326
68150
  * Query filter for settings-store collections.
67327
68151
  */
@@ -67800,6 +68624,35 @@ var KeychainKeySourceSchema = object({
67800
68624
  */
67801
68625
  sharesBackupWithDatabase: boolean()
67802
68626
  });
68627
+ /**
68628
+ * One keychain reset, as the Secrets page reports it until the operator
68629
+ * acknowledges it. Never a value: refs, counts and table names only.
68630
+ */
68631
+ var KeychainResetRecordSchema = object({
68632
+ id: string(),
68633
+ at: number(),
68634
+ /** `user:<id>` or {@link KEYCHAIN_RESET_TRIGGER_ACTOR}. */
68635
+ actor: string(),
68636
+ /** Why the keychain was locked when it was reset; `null` when it was not locked. */
68637
+ lockedReason: string().nullable(),
68638
+ /** Values moved into the archive table (ciphertext under the lost key). */
68639
+ archived: number().int(),
68640
+ /** `keychain:secrets-orphaned-<ts>`, or `null` when nothing was stored. */
68641
+ archivedCollection: string().nullable(),
68642
+ /**
68643
+ * `keychain:keys-orphaned-<ts>`: the wrapped data keys of the archive, kept
68644
+ * so the archive can still be opened if the lost master key turns up.
68645
+ */
68646
+ archivedKeysCollection: string().nullable(),
68647
+ /**
68648
+ * `system-settings` keys whose marker the reset cleared — the cluster
68649
+ * secret's: a marker left pointing at an archived value would refuse every
68650
+ * agent forever (D797).
68651
+ */
68652
+ clearedSettingsKeys: array(string()).readonly(),
68653
+ /** When an operator dismissed the notice on the Secrets page; `null` until then. */
68654
+ acknowledgedAt: number().nullable()
68655
+ });
67803
68656
  var KeychainStatusSchema = object({
67804
68657
  keychain: KeychainStateSchema,
67805
68658
  /** The source of the master key in use; `null` while locked. */
@@ -67817,7 +68670,9 @@ var KeychainStatusSchema = object({
67817
68670
  /** Wrapped copies of the data key under a previous master key, kept until purged. */
67818
68671
  retiredWraps: number().int(),
67819
68672
  recoveryKeyDownloadedAt: number().nullable(),
67820
- secretCount: number().int()
68673
+ secretCount: number().int(),
68674
+ /** The most recent reset, acknowledged or not; `null` when the keychain was never reset. */
68675
+ lastReset: KeychainResetRecordSchema.nullable()
67821
68676
  });
67822
68677
  /**
67823
68678
  * Whether a stored value is still pointed at by its owner's settings.
@@ -67839,17 +68694,26 @@ var KeychainAuditActionSchema = _enum([
67839
68694
  "download-recovery-key",
67840
68695
  "delete-orphans",
67841
68696
  "reset",
68697
+ "acknowledge-reset",
67842
68698
  "initialize"
67843
68699
  ]);
67844
68700
  var KeychainAuditEntrySchema = object({
67845
68701
  id: string(),
67846
68702
  at: number(),
67847
68703
  action: KeychainAuditActionSchema,
67848
- /** `addon:<id>` | `user:<id>` | `system`. */
68704
+ /** `addon:<id>` | `user:<id>` | `system` | `trigger-file`. */
67849
68705
  actor: string(),
67850
68706
  ref: string().nullable(),
67851
68707
  detail: string().nullable()
67852
68708
  });
68709
+ var KEYCHAIN_RESET_CONFIRMATION = "RESET KEYCHAIN";
68710
+ /**
68711
+ * Secrets the HUB itself holds (owner `system`) that no settings form shows:
68712
+ * `jwt-signing-key` — the session signing key (D797). It is always "in use",
68713
+ * never an orphan; it is generated on a fresh hub and replaced only through
68714
+ * {@link keychainAdminCapability.methods.setSystemSecret}.
68715
+ */
68716
+ var SystemHeldSecretNameSchema = _enum(["jwt-signing-key"]);
67853
68717
  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({
67854
68718
  value: string(),
67855
68719
  version: number().int()
@@ -67857,6 +68721,16 @@ method(object({}), KeychainStatusSchema, { auth: "admin" }), method(object({}),
67857
68721
  kind: "mutation",
67858
68722
  auth: "admin",
67859
68723
  caller: "required"
68724
+ }), method(object({
68725
+ name: SystemHeldSecretNameSchema,
68726
+ value: string().min(16)
68727
+ }), object({
68728
+ ref: string(),
68729
+ version: number().int()
68730
+ }), {
68731
+ kind: "mutation",
68732
+ auth: "admin",
68733
+ caller: "required"
67860
68734
  }), method(object({ refs: array(string().min(1)).max(1e3) }), object({
67861
68735
  deleted: array(string()).readonly(),
67862
68736
  kept: array(object({
@@ -67886,13 +68760,20 @@ method(object({}), KeychainStatusSchema, { auth: "admin" }), method(object({}),
67886
68760
  kind: "mutation",
67887
68761
  auth: "admin",
67888
68762
  caller: "required"
67889
- }), method(object({ confirm: literal("RESET KEYCHAIN") }), object({
68763
+ }), method(object({ confirm: literal(KEYCHAIN_RESET_CONFIRMATION) }), object({
67890
68764
  archivedCollection: string().nullable(),
67891
68765
  archived: number().int()
67892
68766
  }), {
67893
68767
  kind: "mutation",
67894
68768
  auth: "admin",
67895
68769
  caller: "required"
68770
+ }), method(object({}), object({
68771
+ reset: KeychainResetRecordSchema.nullable(),
68772
+ pendingReentry: array(KeychainSecretMetaSchema).readonly()
68773
+ }), { auth: "admin" }), method(object({}), object({ acknowledged: boolean() }), {
68774
+ kind: "mutation",
68775
+ auth: "admin",
68776
+ caller: "required"
67896
68777
  });
67897
68778
  method(_void(), object({
67898
68779
  id: string(),
@@ -70470,14 +71351,14 @@ var LlmProfileSchema = object({
70470
71351
  /** ConfigUISchema tree passed through untyped on the wire (the
70471
71352
  * notification-output `ConfigSchemaPassthrough` precedent at
70472
71353
  * notification-output.cap.ts:151); the exported TS type re-tightens it. */
70473
- var ConfigSchemaPassthrough$1 = unknown();
71354
+ var ConfigSchemaPassthrough$3 = unknown();
70474
71355
  var LlmProfileKindDescriptorSchema = object({
70475
71356
  kind: LlmProfileKindSchema,
70476
71357
  label: string(),
70477
71358
  icon: string(),
70478
71359
  /** Stamped by each provider so the concat-fanned catalog stays routable. */
70479
71360
  addonId: string(),
70480
- configSchema: ConfigSchemaPassthrough$1
71361
+ configSchema: ConfigSchemaPassthrough$3
70481
71362
  });
70482
71363
  var LlmDefaultSelectorSchema = union([object({ consumer: string() }), object({ purpose: _enum(["text", "vision"]) })]);
70483
71364
  var LlmDefaultSchema = object({
@@ -70755,7 +71636,7 @@ method(LogEntrySchema, _void(), { kind: "mutation" }), method(object({
70755
71636
  * `login-method` — collection cap through which auth addons contribute
70756
71637
  * their pre-auth login surfaces to the login page. This is the SINGLE,
70757
71638
  * generic mechanism that supersedes the dead `auth.listProviders` reader:
70758
- * every auth addon (OIDC, magic-link, WebAuthn/passkey) registers a
71639
+ * every auth addon (OIDC, WebAuthn/passkey) registers a
70759
71640
  * `login-method` provider and the PUBLIC `auth.listLoginMethods`
70760
71641
  * procedure aggregates them for the unauthenticated login page.
70761
71642
  *
@@ -70763,8 +71644,7 @@ method(LogEntrySchema, _void(), { kind: "mutation" }), method(object({
70763
71644
  *
70764
71645
  * - `redirect` — a declarative button. The login page renders a generic
70765
71646
  * button that navigates to `startUrl` (an addon-owned HTTP route).
70766
- * Covers OIDC (`/addon/auth-oidc/<id>/start`) and magic-link with
70767
- * ZERO shell-side JS. A future SSO addon plugs in the same way — the
71647
+ * Covers OIDC (`/addon/auth-oidc/<id>/start`) with ZERO shell-side JS. A future SSO addon plugs in the same way — the
70768
71648
  * login page needs NO change.
70769
71649
  *
70770
71650
  * - `widget` — a Module-Federation widget the login page mounts (via
@@ -70783,8 +71663,8 @@ method(LogEntrySchema, _void(), { kind: "mutation" }), method(object({
70783
71663
  * decision.
70784
71664
  *
70785
71665
  * Every contribution carries a `stage`:
70786
- * - `primary` — shown on the first credentials screen (OIDC /
70787
- * magic-link buttons; a future usernameless passkey).
71666
+ * - `primary` — shown on the first credentials screen (OIDC
71667
+ * buttons; a usernameless passkey).
70788
71668
  * - `second-factor` — shown AFTER the password leg, gated on the
70789
71669
  * returned `factors` (passkey-as-2FA today).
70790
71670
  *
@@ -70811,7 +71691,7 @@ var LoginMethodContributionSchema = discriminatedUnion("kind", [
70811
71691
  * The provider names an external identity a signed-in user can link to
70812
71692
  * their own account (D782): `auth.listLinkableProviders` /
70813
71693
  * `beginExternalLink` offer exactly the redirect methods that set this,
70814
- * whatever their id. Absent / false — a login button only (magic-link).
71694
+ * whatever their id. Absent / false — a login button only.
70815
71695
  */
70816
71696
  linkable: boolean().optional()
70817
71697
  }),
@@ -71599,7 +72479,7 @@ var TargetKindCapsSchema = object({
71599
72479
  * the union is large and not meant for runtime validation here; the exported
71600
72480
  * `TargetKind` type re-tightens `configSchema` to `ConfigUISchema`.
71601
72481
  */
71602
- var ConfigSchemaPassthrough = unknown();
72482
+ var ConfigSchemaPassthrough$2 = unknown();
71603
72483
  var TargetKindSchema = object({
71604
72484
  kind: string(),
71605
72485
  label: string(),
@@ -71636,7 +72516,7 @@ var TargetKindSchema = object({
71636
72516
  * its raster path, which is the safe default for an unknown image.
71637
72517
  */
71638
72518
  iconMediaType: string().optional(),
71639
- configSchema: ConfigSchemaPassthrough,
72519
+ configSchema: ConfigSchemaPassthrough$2,
71640
72520
  /**
71641
72521
  * The config keys that decide WHERE this kind's secrets are sent (server,
71642
72522
  * base URL, instance, chat, recipient). A save that changes any of them
@@ -74666,8 +75546,7 @@ method(object({}), object({ rules: array(NcRuleSchema) }), { auth: "admin" }), m
74666
75546
  * `super_admin` — collapsed onto the single boolean because every
74667
75547
  * non-admin caller is governed by the same scope-check rules; the
74668
75548
  * distinction was only ever used to route role-specific procedures
74669
- * which we no longer have. Agents are admin sessions issued via
74670
- * `createServiceToken`; CLI / webhook integrations are `cst_*` tokens
75549
+ * which we no longer have. CLI / webhook integrations are `cst_*` tokens
74671
75550
  * with `isAdmin: false` + an explicit scope list.
74672
75551
  */
74673
75552
  /** Per-method access flavour. Materialised on every cap method via codegen. */
@@ -74974,6 +75853,61 @@ var OauthIntegrationDescriptorSchema = object({
74974
75853
  });
74975
75854
  method(_void(), OauthIntegrationDescriptorSchema, { auth: "admin" });
74976
75855
  /**
75856
+ * `oidc-connections` — CRUD for IdP rows under `auth-oidc` (D828 sibling).
75857
+ *
75858
+ * One hub-only singleton (`auth-oidc`). The Settings UI is a DataTable +
75859
+ * ItemFormDialog; there is no `editable-array` in `globalSettingsSchema`.
75860
+ * Operator-chosen `id` is the URL slug (`/addon/auth-oidc/<id>/…`) and is
75861
+ * immutable after create.
75862
+ */
75863
+ var ConfigSchemaPassthrough$1 = unknown();
75864
+ var OidcConnectionSchema = object({
75865
+ id: string().min(1),
75866
+ displayName: string(),
75867
+ icon: string(),
75868
+ issuerUrl: string(),
75869
+ clientId: string(),
75870
+ /** Client id + secret present — never the secret value. */
75871
+ configured: boolean(),
75872
+ /**
75873
+ * Values for the connection form schema. `clientSecret` is a keychain
75874
+ * {@link SecretFieldView} or `null` / `''`, never plaintext (D789).
75875
+ */
75876
+ formValues: record(string(), unknown()).optional()
75877
+ });
75878
+ /**
75879
+ * Patch one connection. Omitted or empty `clientSecret` keeps the stored
75880
+ * secret (D787). `{ $secretClear: true }` clears it. `id` is never renamed.
75881
+ */
75882
+ var OidcConnectionUpdateInputSchema = object({
75883
+ id: string().min(1),
75884
+ displayName: string().min(1),
75885
+ icon: string().optional(),
75886
+ issuerUrl: string().optional(),
75887
+ clientId: string().optional(),
75888
+ clientSecret: union([string(), object({ $secretClear: literal(true) })]).optional(),
75889
+ redirectUri: string().optional(),
75890
+ scopes: string().optional(),
75891
+ usernameClaim: _enum([
75892
+ "preferred_username",
75893
+ "email",
75894
+ "sub"
75895
+ ]).optional()
75896
+ });
75897
+ method(object({}), ConfigSchemaPassthrough$1, { auth: "admin" }), method(object({}), array(OidcConnectionSchema).readonly(), { auth: "admin" }), method(object({
75898
+ id: string().min(1).regex(/^[a-z0-9][a-z0-9-]{0,63}$/, "id must be a lowercase slug"),
75899
+ displayName: string().min(1)
75900
+ }), object({ id: string() }), {
75901
+ kind: "mutation",
75902
+ auth: "admin"
75903
+ }), method(OidcConnectionUpdateInputSchema, object({ ok: literal(true) }), {
75904
+ kind: "mutation",
75905
+ auth: "admin"
75906
+ }), method(object({ id: string().min(1) }), object({ ok: literal(true) }), {
75907
+ kind: "mutation",
75908
+ auth: "admin"
75909
+ });
75910
+ /**
74977
75911
  * What started a camera's onboard motion (D672). `camera` is the camera's own
74978
75912
  * firmware; `sensor` is a device the operator ATTACHED to it. Absent on the
74979
75913
  * wire means the camera: only the camera-sensors bridge ever says `sensor`.
@@ -76330,21 +77264,69 @@ var RetrainFrameListSchema = object({
76330
77264
  /** What the page pre-selects — the native key frame when one survives. */
76331
77265
  autoPickMediaId: number().int().optional()
76332
77266
  });
77267
+ /** Exclusive partition of a corpus copy's annotation progress (design §4.2). */
77268
+ var RetrainFrameWorkStateSchema = _enum([
77269
+ "unannotated",
77270
+ "annotated",
77271
+ "complete"
77272
+ ]);
77273
+ /**
77274
+ * Filters for paginated corpus list, KPI, and matching export (design §4.4).
77275
+ * Every narrowing field is ANDed; omitted fields impose no constraint.
77276
+ */
77277
+ var RetrainCorpusFilterSchema = object({
77278
+ workState: RetrainFrameWorkStateSchema.optional(),
77279
+ deviceIds: array(number()).max(500).optional(),
77280
+ /** When set, only frames in this named collection. */
77281
+ collectionId: string().optional(),
77282
+ /** Frames that carry at least one saved annotation in one of these classes. */
77283
+ classes: array(RetrainMacroClassSchema).optional(),
77284
+ page: number().int().positive().default(1),
77285
+ pageSize: number().int().positive().max(100).default(50)
77286
+ });
77287
+ var RetrainCorpusPageSchema = object({
77288
+ frames: array(RetrainFrameSchema.extend({ workState: RetrainFrameWorkStateSchema })).readonly(),
77289
+ total: number().int().nonnegative(),
77290
+ page: number().int().positive(),
77291
+ pageSize: number().int().positive()
77292
+ });
77293
+ var RetrainCorpusKpiCameraRowSchema = object({
77294
+ deviceId: number(),
77295
+ unannotated: number().int().nonnegative(),
77296
+ annotated: number().int().nonnegative(),
77297
+ complete: number().int().nonnegative(),
77298
+ /** This camera's `complete` count divided by corpus `total`, in `[0,1]`.
77299
+ * `null` when the corpus is empty (no ratio). */
77300
+ pctOfCorpus: number().min(0).max(1).nullable()
77301
+ });
77302
+ var RetrainCorpusKpiSchema = object({
77303
+ total: number().int().nonnegative(),
77304
+ unannotated: number().int().nonnegative(),
77305
+ annotated: number().int().nonnegative(),
77306
+ complete: number().int().nonnegative(),
77307
+ cameras: array(RetrainCorpusKpiCameraRowSchema).readonly()
77308
+ });
76333
77309
  /**
76334
77310
  * Which frames an annotated export carries. Every field narrows; an empty
76335
- * filter is every annotated copy. A dataset VERSION is a frozen `frameIds`
76336
- * list owned by whoever trains (the training orchestrator), so `frameIds` is
76337
- * the primitive a version export uses; `batchId` re-selects what an earlier
76338
- * export carried (`exportedInBatch`).
77311
+ * filter is every annotated copy. `frameIds` is the primitive a job or
77312
+ * download uses; `batchId` re-selects what an earlier export carried
77313
+ * (`exportedInBatch`). Frozen dataset versions were removed — live selection
77314
+ * resolves to `frameIds` at plan/start.
76339
77315
  */
76340
77316
  var RetrainExportFilterSchema = object({
76341
77317
  deviceIds: array(number()).optional(),
76342
77318
  frameIds: array(string()).max(2e4).optional(),
76343
77319
  /** Only frames in at least one of these named collections. */
76344
77320
  collectionIds: array(string()).max(200).optional(),
77321
+ /** Single collection (Frames filter bar). ANDed with `collectionIds` when both set. */
77322
+ collectionId: string().optional(),
76345
77323
  batchId: string().optional(),
76346
77324
  /** Only frames the operator marked complete (all subjects boxed). */
76347
- completeOnly: boolean().optional()
77325
+ completeOnly: boolean().optional(),
77326
+ /** Exclusive work-state partition (`workStateOf`); same as the corpus list. */
77327
+ workState: RetrainFrameWorkStateSchema.optional(),
77328
+ /** Frames with at least one saved annotation in one of these classes. */
77329
+ classes: array(RetrainMacroClassSchema).optional()
76348
77330
  });
76349
77331
  /**
76350
77332
  * `frames`: the full frame copies, boxes in `annotations.json`.
@@ -76509,6 +77491,77 @@ var RetrainLlmAssistResultSchema = discriminatedUnion("kind", [object({
76509
77491
  ]),
76510
77492
  detail: string().optional()
76511
77493
  })]);
77494
+ /** What a dataset version is cut from. Every field narrows. */
77495
+ var RetrainDatasetSelectionSchema = object({
77496
+ deviceIds: array(number()).readonly().optional(),
77497
+ collectionIds: array(string()).max(200).readonly().optional(),
77498
+ frameIds: array(string()).max(2e4).readonly().optional()
77499
+ });
77500
+ /** The counts a dataset is judged by. */
77501
+ var RetrainDatasetStatsSchema = object({
77502
+ frames: number().int(),
77503
+ completeFrames: number().int(),
77504
+ /** `completeFrames / frames`, 0..1. */
77505
+ completeness: number(),
77506
+ /** Boxes to learn (model errors excluded). */
77507
+ subjects: number().int(),
77508
+ modelErrors: number().int(),
77509
+ /** Complete frames with no subject. */
77510
+ hardNegatives: number().int(),
77511
+ /** Subjects per class × camera × day/night. */
77512
+ cells: array(object({
77513
+ macroClass: string(),
77514
+ deviceId: number(),
77515
+ lighting: _enum([
77516
+ "day",
77517
+ "night",
77518
+ "unknown"
77519
+ ]),
77520
+ subjects: number().int(),
77521
+ frames: number().int()
77522
+ })).readonly(),
77523
+ cameras: array(object({
77524
+ deviceId: number(),
77525
+ frames: number().int(),
77526
+ completeFrames: number().int()
77527
+ })).readonly()
77528
+ });
77529
+ object({
77530
+ id: string(),
77531
+ name: string(),
77532
+ createdAt: number(),
77533
+ selection: RetrainDatasetSelectionSchema,
77534
+ layout: RetrainExportLayoutSchema,
77535
+ completeOnly: boolean(),
77536
+ frameCount: number().int(),
77537
+ annotationHash: string(),
77538
+ manifestSchema: string(),
77539
+ stats: RetrainDatasetStatsSchema
77540
+ });
77541
+ /**
77542
+ * Live training corpus criteria — same shape as `TrainingCorpusSelection` on
77543
+ * the training cap. Resolved here so plan/start and the annotated export share
77544
+ * one definition of "the frames" (`buildRetrainExportPlan`).
77545
+ */
77546
+ var RetrainTrainingCorpusSelectionSchema = object({
77547
+ collectionIds: array(string()).min(1),
77548
+ workState: _enum([
77549
+ "complete",
77550
+ "annotated_or_complete",
77551
+ "any_annotated"
77552
+ ]).default("complete")
77553
+ });
77554
+ var RetrainTrainingCorpusResolveResultSchema = discriminatedUnion("kind", [object({
77555
+ kind: literal("resolved"),
77556
+ frameIds: array(string()).max(2e4).readonly(),
77557
+ stats: RetrainDatasetStatsSchema,
77558
+ annotationHash: string(),
77559
+ layout: RetrainExportLayoutSchema
77560
+ }), object({
77561
+ kind: literal("refused"),
77562
+ reason: _enum(["unknown-collection", "no-frames"]),
77563
+ detail: string()
77564
+ })]);
76512
77565
  /** The outcome of a lifecycle move owned by the retrain page. */
76513
77566
  var RetrainTransitionResultSchema = object({
76514
77567
  trackId: string(),
@@ -77214,6 +78267,12 @@ DeviceType.Camera, method(object({ deviceId: number() }), array(TrackSchema).rea
77214
78267
  }), array(RetrainTrackSchema).readonly(), {
77215
78268
  kind: "query",
77216
78269
  auth: "admin"
78270
+ }), method(RetrainCorpusFilterSchema, RetrainCorpusPageSchema, {
78271
+ kind: "query",
78272
+ auth: "admin"
78273
+ }), method(object({}), RetrainCorpusKpiSchema, {
78274
+ kind: "query",
78275
+ auth: "admin"
77217
78276
  }), method(object({ trackId: string() }), RetrainFrameListSchema, {
77218
78277
  kind: "query",
77219
78278
  auth: "admin"
@@ -77298,6 +78357,17 @@ DeviceType.Camera, method(object({ deviceId: number() }), array(TrackSchema).rea
77298
78357
  kind: "mutation",
77299
78358
  auth: "admin",
77300
78359
  timeoutMs: 60 * 6e4
78360
+ }), method(object({
78361
+ filter: RetrainExportFilterSchema,
78362
+ layout: RetrainExportLayoutSchema
78363
+ }), object({
78364
+ ticket: PeerBytesTicketSchema,
78365
+ frames: number().int(),
78366
+ annotations: number().int()
78367
+ }), {
78368
+ kind: "mutation",
78369
+ auth: "admin",
78370
+ timeoutMs: 12e4
77301
78371
  }), method(object({}), array(RetrainAssistProfileSchema).readonly(), {
77302
78372
  kind: "query",
77303
78373
  auth: "admin"
@@ -77324,6 +78394,10 @@ DeviceType.Camera, method(object({ deviceId: number() }), array(TrackSchema).rea
77324
78394
  }), method(object({}), array(RetrainCollectionSchema).readonly(), {
77325
78395
  kind: "query",
77326
78396
  auth: "admin"
78397
+ }), method(RetrainTrainingCorpusSelectionSchema, RetrainTrainingCorpusResolveResultSchema, {
78398
+ kind: "query",
78399
+ auth: "admin",
78400
+ timeoutMs: 6e4
77327
78401
  }), method(object({
77328
78402
  id: string(),
77329
78403
  name: string().max(120)
@@ -77940,11 +79014,14 @@ var HardwareClassIdSchema = _enum([
77940
79014
  "intel-n-series",
77941
79015
  "apple-m-base",
77942
79016
  "apple-m-pro",
79017
+ "amd-phoenix",
77943
79018
  "unknown"
77944
79019
  ]);
77945
79020
  var AcceleratorKindSchema = _enum([
77946
79021
  "intel-npu",
77947
79022
  "intel-igpu",
79023
+ "amd-igpu",
79024
+ "amd-npu",
77948
79025
  "x86-cpu",
77949
79026
  "arm-cpu",
77950
79027
  "apple-ane",
@@ -79874,6 +80951,8 @@ var AgentPipelineSettingsSchema = object({
79874
80951
  * address is wrong (multi-homed host, NAT, custom interface).
79875
80952
  */
79876
80953
  reachableHost: string().optional(),
80954
+ /** Hub-persisted UI colour (`--color-node-*` theme tokens). */
80955
+ color: NodeColorIdSchema.optional(),
79877
80956
  /**
79878
80957
  * Multi-device inference opt-in (Phase 4). Per-node map deviceKey → {enabled,
79879
80958
  * weight, steps}. Absent / all-disabled ⇒ the node's single default
@@ -80423,8 +81502,9 @@ method(object({
80423
81502
  auth: "admin"
80424
81503
  }), method(object({
80425
81504
  agentNodeId: string(),
80426
- reachableHost: string().nullable()
80427
- }), object({ success: literal(true) }), {
81505
+ reachableHost: string().nullable().optional(),
81506
+ color: NodeColorIdSchema.nullable().optional()
81507
+ }).refine((v) => v.reachableHost !== void 0 || v.color !== void 0, { message: "reachableHost or color required" }), object({ success: literal(true) }), {
80428
81508
  kind: "mutation",
80429
81509
  auth: "admin"
80430
81510
  }), method(object({
@@ -80876,8 +81956,8 @@ version: string().optional() }), ServerUpdateActionResultSchema, {
80876
81956
  * `smtp-provider` — pluggable email delivery surface.
80877
81957
  *
80878
81958
  * Collection cap: a deployment may install multiple SMTP relays (e.g.
80879
- * one for transactional / one for notifications). Consumers (magic-link,
80880
- * notifier addons, …) walk the collection and pick the first
81959
+ * one for transactional / one for notifications). Consumers (notifier
81960
+ * addons, …) walk the collection and pick the first
80881
81961
  * ready provider OR target a specific addonId.
80882
81962
  *
80883
81963
  * The shape stays small on purpose — `sendEmail` is enough for the
@@ -81056,7 +82136,7 @@ targets: array(object({
81056
82136
  })));
81057
82137
  /**
81058
82138
  * `sso-bridge` — internal hub-only cap that lets SSO-style auth
81059
- * providers (OIDC, SAML, magic-link, …) mint an HMAC-signed token
82139
+ * providers (OIDC, SAML, …) mint an HMAC-signed token
81060
82140
  * carrying the post-callback claims before redirecting back to
81061
82141
  * `/api/auth/sso/finish`.
81062
82142
  *
@@ -81119,7 +82199,14 @@ var SsoBridgeClaimsSchema = object({
81119
82199
  * Verified `iss` of the id_token behind an OIDC login bridge (D782). A
81120
82200
  * subject is unique only per issuer, so a link is bound to it.
81121
82201
  */
81122
- issuer: string().optional()
82202
+ issuer: string().optional(),
82203
+ /**
82204
+ * SHA-256 (hex) of the `camstack_sso_state` cookie the IdP `/start` set in
82205
+ * the browser that began this sign-in. `/api/auth/sso/finish` requires the
82206
+ * request to present the matching cookie — a login bridge is useless in
82207
+ * any other browser.
82208
+ */
82209
+ browserBinding: string().optional()
81123
82210
  });
81124
82211
  method(object({
81125
82212
  claims: SsoBridgeClaimsSchema,
@@ -83493,7 +84580,7 @@ var CustomActionInputSchema = object({
83493
84580
  action: string().min(1),
83494
84581
  input: unknown()
83495
84582
  });
83496
- method(_void(), array(AddonListItemSchema).readonly()), method(object({
84583
+ method(object({ nodeId: string().optional() }).optional(), array(AddonListItemSchema).readonly()), method(object({
83497
84584
  addonId: string(),
83498
84585
  limit: number().min(1).max(500).default(100),
83499
84586
  level: LogLevelSchema$2.optional()
@@ -88728,7 +89815,13 @@ var TopologyNodeSchema = object({
88728
89815
  })).readonly(),
88729
89816
  processes: array(TopologyProcessSchema).readonly(),
88730
89817
  categories: array(TopologyCategorySchema).readonly(),
88731
- rootPackage: TopologyRootPackageSchema.nullable()
89818
+ rootPackage: TopologyRootPackageSchema.nullable(),
89819
+ /**
89820
+ * How an online AGENT reaches the hub (mesh mTLS Release A): `tls` once it has
89821
+ * completed a mutual-TLS handshake, `clear` otherwise. Absent for the hub,
89822
+ * for offline rows and when the hub cannot tell.
89823
+ */
89824
+ meshTransport: _enum(["tls", "clear"]).optional()
88732
89825
  });
88733
89826
  var CapUsageEdgeSchema = object({
88734
89827
  callerAddonId: string(),
@@ -89141,6 +90234,7 @@ var OsdNamedTemplateSchema = object({
89141
90234
  });
89142
90235
  /** Where a slot's value comes from. */
89143
90236
  var OsdSourceSchema = discriminatedUnion("kind", [
90237
+ object({ kind: literal("none") }),
89144
90238
  object({
89145
90239
  kind: literal("static"),
89146
90240
  text: string().max(64)
@@ -89267,6 +90361,13 @@ method(object({ deviceId: number().int() }), object({
89267
90361
  }), object({ success: literal(true) }), {
89268
90362
  kind: "mutation",
89269
90363
  auth: "admin"
90364
+ }), method(object({
90365
+ deviceId: number().int(),
90366
+ slotId: string().min(1),
90367
+ enabled: boolean()
90368
+ }), object({ success: literal(true) }), {
90369
+ kind: "mutation",
90370
+ auth: "admin"
89270
90371
  }), method(object({
89271
90372
  sourceDeviceId: number().int(),
89272
90373
  targetDeviceId: number().int()
@@ -89698,7 +90799,15 @@ var GpuInfoSchema = object({
89698
90799
  name: string(),
89699
90800
  memoryMB: number().optional()
89700
90801
  });
89701
- var NpuInfoSchema = object({ type: _enum(["apple-ane", "intel-npu"]) });
90802
+ var NpuInfoSchema = object({
90803
+ type: _enum([
90804
+ "apple-ane",
90805
+ "intel-npu",
90806
+ "amd-xdna"
90807
+ ]),
90808
+ name: string().optional(),
90809
+ generation: _enum(["xdna1", "xdna2"]).optional()
90810
+ });
89702
90811
  var CoralInfoSchema = object({
89703
90812
  type: literal("coral-edgetpu"),
89704
90813
  bus: string().optional()
@@ -93551,16 +94660,6 @@ var ApiKeySummarySchema = object({
93551
94660
  createdAt: number(),
93552
94661
  lastUsedAt: number().optional()
93553
94662
  });
93554
- var CreateApiKeyInputSchema = object({
93555
- label: string(),
93556
- isAdmin: boolean().default(false),
93557
- allowedProviders: union([array(string()), literal("*")]).optional(),
93558
- allowedDevices: record(string(), union([array(string()), literal("*")])).optional()
93559
- });
93560
- var CreateApiKeyResultSchema = object({
93561
- token: string(),
93562
- record: ApiKeySummarySchema
93563
- });
93564
94663
  var ScopedTokenSummarySchema = object({
93565
94664
  id: string(),
93566
94665
  userId: string(),
@@ -93659,17 +94758,10 @@ method(_void(), array(UserSummarySchema), { auth: "admin" }), method(CreateUserI
93659
94758
  }), UserSummarySchema.extend({ passwordHash: string() }).nullable(), {
93660
94759
  kind: "mutation",
93661
94760
  access: "view"
93662
- }), method(_void(), array(ApiKeySummarySchema), { auth: "admin" }), method(CreateApiKeyInputSchema, CreateApiKeyResultSchema, {
93663
- kind: "mutation",
93664
- auth: "admin",
93665
- access: "create"
93666
- }), method(object({ id: string() }), object({ success: literal(true) }), {
94761
+ }), method(_void(), array(ApiKeySummarySchema), { auth: "admin" }), method(object({ id: string() }), object({ success: literal(true) }), {
93667
94762
  kind: "mutation",
93668
94763
  auth: "admin",
93669
94764
  access: "delete"
93670
- }), method(object({ token: string() }), ApiKeySummarySchema.nullable(), {
93671
- kind: "mutation",
93672
- access: "view"
93673
94765
  }), method(CreateScopedTokenInputSchema, CreateScopedTokenResultSchema, {
93674
94766
  kind: "mutation",
93675
94767
  auth: "admin",
@@ -93743,15 +94835,7 @@ method(_void(), array(UserSummarySchema), { auth: "admin" }), method(CreateUserI
93743
94835
  }).nullable(), { access: "view" }), method(object({ userId: string() }), array(ExternalIdentitySchema), { auth: "admin" }), method(ExternalIdentityKeySchema, object({
93744
94836
  userId: string(),
93745
94837
  issuer: string()
93746
- }).nullable(), { auth: "admin" }), method(ExternalIdentityKeySchema.extend({
93747
- userId: string(),
93748
- issuer: string().min(1),
93749
- label: string().optional()
93750
- }), object({ success: literal(true) }), {
93751
- kind: "mutation",
93752
- auth: "admin",
93753
- access: "create"
93754
- }), method(ExternalIdentityKeySchema.extend({ userId: string() }), object({ success: boolean() }), {
94838
+ }).nullable(), { auth: "admin" }), method(ExternalIdentityKeySchema.extend({ userId: string() }), object({ success: boolean() }), {
93755
94839
  kind: "mutation",
93756
94840
  auth: "admin",
93757
94841
  access: "delete"
@@ -94456,6 +95540,563 @@ var zoneRulesCapability = {
94456
95540
  */
94457
95541
  durability: "restored"
94458
95542
  };
95543
+ /**
95544
+ * `training-provider` — ONE cloud that can run the CamStack trainer.
95545
+ *
95546
+ * A thin, mockable translation layer: it knows how to run a container with a
95547
+ * GPU, move a dataset in, read the job's stdout and hand artefacts back. It
95548
+ * knows nothing about datasets, splits, floors, cost policy or Model Studio —
95549
+ * those are the `training` orchestrator's (D805). Every rule written there
95550
+ * once is what makes a second provider (RunPod, a local NVIDIA node) a new
95551
+ * manifest entry and nothing else.
95552
+ *
95553
+ * Collection of provider **types** (addons). Each addon owns zero or more
95554
+ * **entries** (credentials + defaults). Concat-fans: `describe`,
95555
+ * `describeTypes`, `listEntries`, `listJobs`. Single-row work is keyed by
95556
+ * `entryId`; callers also pass the owning `addonId` as the collection
95557
+ * selector (broker posture). Every method is `admin`: these spend money.
95558
+ *
95559
+ * Every cloud object a provider creates is tagged with the orchestrator's
95560
+ * `jobKey`, so a retried submit finds the job it already started instead of
95561
+ * starting a second GPU, and `listJobs` can find orphans.
95562
+ *
95563
+ * Bytes never ride a cap field: the dataset arrives as a `ctx.peerBytes`
95564
+ * ticket the producer (pipeline-analytics) minted, and artefacts leave as a
95565
+ * ticket the provider mints (D613).
95566
+ */
95567
+ var TrainingGpuOptionSchema = object({
95568
+ id: string(),
95569
+ label: string(),
95570
+ /** List price, USD per GPU-hour, before any region multiplier. */
95571
+ usdPerHour: number().nonnegative(),
95572
+ vramGb: number().nonnegative()
95573
+ });
95574
+ var TrainingRegionOptionSchema = object({
95575
+ /** `''` = any region (the provider's choice). */
95576
+ id: string(),
95577
+ label: string(),
95578
+ priceMultiplier: number().positive()
95579
+ });
95580
+ /**
95581
+ * The provider's per-entry settings, as the orchestrator reads them. They
95582
+ * live on the PROVIDER addon's entry (operator decision 2026-10-08: they
95583
+ * depend on the user's account), never hard-coded in the orchestrator.
95584
+ */
95585
+ var TrainingProviderDefaultsSchema = object({
95586
+ gpuType: string(),
95587
+ region: string(),
95588
+ costCapUsd: number().nonnegative(),
95589
+ maxRuntimeSec: number().int().positive(),
95590
+ /** Hours a FAILED job's cloud dataset is kept for debugging; 0 = delete at once. */
95591
+ failedDatasetGraceHours: number().nonnegative()
95592
+ });
95593
+ /**
95594
+ * Entry form schema for a provider type — same seam as notification
95595
+ * `TargetKind.configSchema` (`z.unknown()` at the wire; callers tighten to
95596
+ * {@link ConfigUISchema}). Drives `ConfigFormBuilder` on Training → Providers.
95597
+ */
95598
+ var ConfigSchemaPassthrough = unknown();
95599
+ /** One creatable provider type, for the Add-entry dialog. */
95600
+ var TrainingProviderTypeSchema = object({
95601
+ typeId: string(),
95602
+ label: string(),
95603
+ /** Path under the addon package (e.g. `assets/training-modal/icon.svg`). */
95604
+ iconAsset: string(),
95605
+ /** Owning `training-provider` addon — collection selector for createEntry. */
95606
+ addonId: string(),
95607
+ /**
95608
+ * Fields for one entry of this type (credentials + defaults). Absent on a
95609
+ * type that only needs a name. Password fields are keychain-backed on the
95610
+ * provider addon (`secretStatePaths`), not D634 plaintext.
95611
+ */
95612
+ configSchema: ConfigSchemaPassthrough.optional()
95613
+ });
95614
+ /** One configured account / workspace under a provider type. */
95615
+ var TrainingProviderEntrySchema = object({
95616
+ entryId: string(),
95617
+ typeId: string(),
95618
+ name: string(),
95619
+ addonId: string(),
95620
+ /** Credentials are present — never the values. */
95621
+ configured: boolean()
95622
+ });
95623
+ var TrainingProviderDescriptorSchema = object({
95624
+ addonId: string(),
95625
+ entryId: string(),
95626
+ typeId: string(),
95627
+ /** Operator-chosen entry name. */
95628
+ name: string(),
95629
+ iconAsset: string(),
95630
+ /** `modal`, `runpod`, `fake`, … — same as typeId for current providers. */
95631
+ kind: string(),
95632
+ label: string(),
95633
+ gpuTypes: array(TrainingGpuOptionSchema).readonly(),
95634
+ regions: array(TrainingRegionOptionSchema).readonly(),
95635
+ maxDatasetBytes: number().int().positive(),
95636
+ maxRuntimeSec: number().int().positive(),
95637
+ freeTierNote: string().optional(),
95638
+ /** Where the data goes, in one sentence the confirm dialog repeats. */
95639
+ dataResidencyNote: string(),
95640
+ /** Credentials are present — never the values. */
95641
+ configured: boolean(),
95642
+ defaults: TrainingProviderDefaultsSchema,
95643
+ /**
95644
+ * Values for {@link TrainingProviderTypeSchema}'s `configSchema` — password
95645
+ * fields are keychain {@link SecretFieldView} or `null` / `''` (create),
95646
+ * never plaintext. Same hydrate contract as settings forms (D789).
95647
+ */
95648
+ formValues: record(string(), unknown()).optional()
95649
+ });
95650
+ /**
95651
+ * Patch one entry's name, credentials and defaults. Pin with owning `{ addonId }`.
95652
+ * An omitted or empty `tokenSecret` means KEEP the stored secret (D787).
95653
+ * `{ $secretClear: true }` clears it.
95654
+ */
95655
+ var TrainingProviderUpdateEntryInputSchema = object({
95656
+ entryId: string().min(1),
95657
+ name: string().min(1),
95658
+ tokenId: string().optional(),
95659
+ tokenSecret: union([string(), object({ $secretClear: literal(true) })]).optional(),
95660
+ environment: string().optional(),
95661
+ gpuType: string().optional(),
95662
+ region: string().optional(),
95663
+ costCapUsd: number().nonnegative().optional(),
95664
+ maxRuntimeSec: number().int().positive().optional(),
95665
+ failedDatasetGraceHours: number().nonnegative().optional()
95666
+ });
95667
+ var TrainingCredentialCheckSchema = object({
95668
+ ok: boolean(),
95669
+ /** Workspace / account name, when the provider says. */
95670
+ account: string().optional(),
95671
+ reason: _enum([
95672
+ "missing",
95673
+ "invalid",
95674
+ "forbidden",
95675
+ "network",
95676
+ "quota"
95677
+ ]).optional(),
95678
+ detail: string().optional()
95679
+ });
95680
+ var ProviderJobStateSchema = _enum([
95681
+ "pending",
95682
+ "starting",
95683
+ "running",
95684
+ "succeeded",
95685
+ "failed",
95686
+ "cancelled",
95687
+ "lost"
95688
+ ]);
95689
+ var ProviderJobStatusSchema = object({
95690
+ jobKey: string(),
95691
+ providerJobId: string().optional(),
95692
+ state: ProviderJobStateSchema,
95693
+ startedAt: number().optional(),
95694
+ endedAt: number().optional(),
95695
+ exitCode: number().int().optional(),
95696
+ failureReason: string().optional(),
95697
+ gpuType: string(),
95698
+ region: string().optional(),
95699
+ billedSeconds: number().nonnegative(),
95700
+ costUsd: number().nonnegative(),
95701
+ /** True when `costUsd` is runtime × list price, not a billing answer. */
95702
+ costIsEstimate: boolean(),
95703
+ lastFetchedAt: number()
95704
+ });
95705
+ /**
95706
+ * The trainer the job runs, by SOURCE revision: the provider turns it into an
95707
+ * image its own way (Modal builds the published Dockerfile at that revision;
95708
+ * a registry-pull provider maps it to a tag). Recorded on the job and echoed
95709
+ * in `result.json`.
95710
+ */
95711
+ var TrainerSourceRefSchema = object({
95712
+ /** Hugging Face repo id, e.g. `camstack/camstack-trainer`. */
95713
+ repo: string().min(1),
95714
+ /** A commit sha (never a branch) — the job must be reproducible. */
95715
+ revision: string().regex(/^[0-9a-f]{7,64}$/)
95716
+ });
95717
+ /** Cloud job identity — route with the owning addon's `addonId` selector. */
95718
+ var JobRef = {
95719
+ entryId: string().min(1),
95720
+ jobKey: string().uuid()
95721
+ };
95722
+ var TrainingLogLineSchema = object({
95723
+ ts: number(),
95724
+ text: string()
95725
+ });
95726
+ method(object({}), array(TrainingProviderDescriptorSchema).readonly(), { auth: "admin" }), method(object({}), array(TrainingProviderTypeSchema).readonly(), { auth: "admin" }), method(object({}), array(TrainingProviderEntrySchema).readonly(), { auth: "admin" }), method(object({
95727
+ typeId: string().min(1),
95728
+ name: string().min(1)
95729
+ }), object({ entryId: string() }), {
95730
+ kind: "mutation",
95731
+ auth: "admin"
95732
+ }), method(object({ entryId: string().min(1) }), object({ ok: literal(true) }), {
95733
+ kind: "mutation",
95734
+ auth: "admin"
95735
+ }), method(TrainingProviderUpdateEntryInputSchema, object({ ok: literal(true) }), {
95736
+ kind: "mutation",
95737
+ auth: "admin"
95738
+ }), method(object({ entryId: string().min(1) }), TrainingCredentialCheckSchema, {
95739
+ kind: "mutation",
95740
+ auth: "admin",
95741
+ timeoutMs: 3e4
95742
+ }), method(object({
95743
+ entryId: string().min(1),
95744
+ gpuType: string(),
95745
+ region: string(),
95746
+ datasetBytes: number().int().nonnegative(),
95747
+ gpuSecondsLow: number().nonnegative(),
95748
+ gpuSecondsHigh: number().nonnegative()
95749
+ }), object({
95750
+ usdLow: number().nonnegative(),
95751
+ usdHigh: number().nonnegative(),
95752
+ notes: array(string()).readonly()
95753
+ }), { auth: "admin" }), method(object({
95754
+ ...JobRef,
95755
+ ticket: PeerBytesTicketSchema
95756
+ }), object({
95757
+ bytes: number().int().nonnegative(),
95758
+ sha256: string()
95759
+ }), {
95760
+ kind: "mutation",
95761
+ auth: "admin",
95762
+ timeoutMs: 120 * 6e4
95763
+ }), method(object({
95764
+ ...JobRef,
95765
+ trainer: TrainerSourceRefSchema,
95766
+ jobSpecJson: string().min(2).max(64e3),
95767
+ gpuType: string(),
95768
+ region: string(),
95769
+ maxRuntimeSec: number().int().positive()
95770
+ }), ProviderJobStatusSchema, {
95771
+ kind: "mutation",
95772
+ auth: "admin",
95773
+ timeoutMs: 30 * 6e4
95774
+ }), method(object(JobRef), ProviderJobStatusSchema, {
95775
+ auth: "admin",
95776
+ timeoutMs: 6e4
95777
+ }), method(object({
95778
+ ...JobRef,
95779
+ cursor: string().optional(),
95780
+ max: number().int().min(1).max(500)
95781
+ }), object({
95782
+ lines: array(TrainingLogLineSchema).readonly(),
95783
+ cursor: string()
95784
+ }), {
95785
+ auth: "admin",
95786
+ timeoutMs: 6e4
95787
+ }), method(object(JobRef), object({ ok: literal(true) }), {
95788
+ kind: "mutation",
95789
+ auth: "admin",
95790
+ timeoutMs: 6e4
95791
+ }), method(object(JobRef), object({
95792
+ found: boolean(),
95793
+ text: string().optional()
95794
+ }), {
95795
+ kind: "mutation",
95796
+ auth: "admin",
95797
+ timeoutMs: 5 * 6e4
95798
+ }), method(object({
95799
+ ...JobRef,
95800
+ path: _enum(["bundle.tar"])
95801
+ }), object({ ticket: PeerBytesTicketSchema }), {
95802
+ kind: "mutation",
95803
+ auth: "admin",
95804
+ timeoutMs: 5 * 6e4
95805
+ }), method(object(JobRef), object({ deleted: array(string()).readonly() }), {
95806
+ kind: "mutation",
95807
+ auth: "admin",
95808
+ timeoutMs: 5 * 6e4
95809
+ }), method(object({ entryId: string().min(1).optional() }), array(ProviderJobStatusSchema).readonly(), {
95810
+ auth: "admin",
95811
+ timeoutMs: 2 * 6e4
95812
+ });
95813
+ /**
95814
+ * `training` — the cloud-training orchestrator (D805). Hub-only singleton,
95815
+ * provided by `addon-training`.
95816
+ *
95817
+ * It owns what every provider must agree on, written once:
95818
+ *
95819
+ * - **Jobs.** A persisted state machine, a reconcile loop against the
95820
+ * provider, a cost guard, a daily orphan sweep and the retention rules.
95821
+ * - **The return flow.** Verified artefacts → Model Studio
95822
+ * (`custom-model-registry.importModelBundle`) → canary on cameras →
95823
+ * rollback. Nothing is ever registered automatically.
95824
+ *
95825
+ * Plan/start takes a live {@link TrainingCorpusSelection} (collections +
95826
+ * work-state rule); frame ids are resolved via pipeline-analytics at that
95827
+ * moment and snapshotted on the job. No frozen dataset version.
95828
+ *
95829
+ * Every method is `admin`.
95830
+ */
95831
+ /**
95832
+ * Live corpus criteria for plan/start (design §5.2). Default is complete-only.
95833
+ * Frame ids are resolved at plan/start — never a frozen version id.
95834
+ */
95835
+ var TrainingCorpusSelectionSchema = object({
95836
+ collectionIds: array(string()).min(1),
95837
+ /** Default complete-only for v1 */
95838
+ workState: _enum([
95839
+ "complete",
95840
+ "annotated_or_complete",
95841
+ "any_annotated"
95842
+ ]).default("complete")
95843
+ });
95844
+ /** A base model a detector job can fine-tune, and the baseline it is judged against. */
95845
+ var TrainingBaseModelSchema = object({
95846
+ modelId: string(),
95847
+ label: string(),
95848
+ weights: string(),
95849
+ imgsz: number().int(),
95850
+ baselineOnnxUrl: string(),
95851
+ baselineFloors: record(string(), number()),
95852
+ /** The base the fleet runs most — the UI's default. */
95853
+ recommended: boolean()
95854
+ });
95855
+ var TrainingPresetSchema = _enum([
95856
+ "quick",
95857
+ "standard",
95858
+ "thorough"
95859
+ ]);
95860
+ var TrainingJobRequestSchema = object({
95861
+ /** Live collection + work-state criteria; resolved at plan/start. */
95862
+ selection: TrainingCorpusSelectionSchema,
95863
+ /**
95864
+ * The provider **entry** that runs it (credentials + defaults).
95865
+ * Resolve to an owning addon via `training-provider.describe` / `listEntries`.
95866
+ */
95867
+ entryId: string().min(1),
95868
+ gpuType: string().min(1),
95869
+ region: string(),
95870
+ baseModelId: string().min(1),
95871
+ preset: TrainingPresetSchema,
95872
+ /** Freeze the backbone's first N layers; `null` = the preset's choice. */
95873
+ freeze: number().int().nonnegative().nullable(),
95874
+ /** Cameras held out whole for evaluation; `null` = the orchestrator's default. */
95875
+ holdoutCameras: array(number().int()).nullable()
95876
+ });
95877
+ var TrainingSplitPlanSchema = object({
95878
+ holdoutCameras: array(number().int()).readonly(),
95879
+ /** Used when no camera is held out: the last N days of every camera. */
95880
+ holdoutLastDays: number().int().nonnegative(),
95881
+ /** Holdout subjects per class (camera holdout only; `null` = known only after the split). */
95882
+ holdoutSupport: record(string(), number().int()).nullable(),
95883
+ trainSubjects: number().int()
95884
+ });
95885
+ var TrainingRefusalReasonSchema = _enum([
95886
+ "unknown-dataset",
95887
+ "unknown-provider",
95888
+ "provider-not-configured",
95889
+ "unknown-base-model",
95890
+ "unknown-gpu",
95891
+ "dataset-too-large",
95892
+ "no-training-subjects",
95893
+ "job-already-running"
95894
+ ]);
95895
+ var TrainingJobPlanSchema = object({
95896
+ refusal: object({
95897
+ reason: TrainingRefusalReasonSchema,
95898
+ detail: string()
95899
+ }).nullable(),
95900
+ warnings: array(string()).readonly(),
95901
+ split: TrainingSplitPlanSchema.nullable(),
95902
+ estimate: object({
95903
+ datasetBytes: number().int(),
95904
+ uploadMinutesAt20Mbps: number(),
95905
+ gpuSecondsLow: number(),
95906
+ gpuSecondsHigh: number(),
95907
+ usdLow: number(),
95908
+ usdHigh: number(),
95909
+ notes: array(string()).readonly()
95910
+ }).nullable(),
95911
+ /** Pre-filled from the provider's settings; the operator may lower or raise them. */
95912
+ defaults: object({
95913
+ maxCostUsd: number(),
95914
+ maxRuntimeSec: number().int()
95915
+ }).nullable(),
95916
+ /** The sentence the confirm dialog repeats: where the frames go and when they are deleted. */
95917
+ dataNotice: string()
95918
+ });
95919
+ /**
95920
+ * Orchestrator-owned states, persisted. `uploading` covers exporting the
95921
+ * archive (it is streamed, never staged). Terminal: `failed`, `cancelled`,
95922
+ * `lost`, `expired`, `discarded`. `registered` and `canary` are where a
95923
+ * result lives after the operator acted on it.
95924
+ */
95925
+ var TrainingJobStateSchema = _enum([
95926
+ "queued",
95927
+ "uploading",
95928
+ "submitted",
95929
+ "starting",
95930
+ "running",
95931
+ "collecting",
95932
+ "ready",
95933
+ "registered",
95934
+ "canary",
95935
+ "failed",
95936
+ "cancelling",
95937
+ "cancelled",
95938
+ "lost",
95939
+ "expired",
95940
+ "discarded"
95941
+ ]);
95942
+ var TrainingFailureReasonSchema = _enum([
95943
+ "cost-cap",
95944
+ "runtime-cap",
95945
+ "upload-failed",
95946
+ "submit-failed",
95947
+ "trainer-failed",
95948
+ "result-invalid",
95949
+ "checksum-mismatch",
95950
+ "fetch-failed",
95951
+ "provider-error",
95952
+ "hub-restart-during-upload"
95953
+ ]);
95954
+ var TrainingProgressPointSchema = object({
95955
+ epoch: number().int(),
95956
+ map50: number().nullable(),
95957
+ map50_95: number().nullable()
95958
+ });
95959
+ var TrainingCanarySchema = object({
95960
+ deviceIds: array(number().int()).readonly(),
95961
+ since: number(),
95962
+ /** Every override the canary replaced, exactly, so rollback restores it. */
95963
+ previous: array(object({
95964
+ deviceId: number().int(),
95965
+ nodeId: string(),
95966
+ deviceKey: string(),
95967
+ patch: object({
95968
+ modelId: string().optional(),
95969
+ settings: record(string(), unknown()).readonly().optional()
95970
+ }).nullable()
95971
+ })).readonly()
95972
+ });
95973
+ var TrainingJobSchema = object({
95974
+ id: string(),
95975
+ idempotencyKey: string(),
95976
+ name: string(),
95977
+ createdAt: number(),
95978
+ updatedAt: number(),
95979
+ state: TrainingJobStateSchema,
95980
+ /**
95981
+ * Shared by every job enqueued together via `startJobBatch`.
95982
+ * `null` for a lone `startJob`. The engine advances queued siblings by this id.
95983
+ */
95984
+ batchId: string().nullable().default(null),
95985
+ stage: TrainingStageSchema.nullable(),
95986
+ failure: object({
95987
+ reason: TrainingFailureReasonSchema,
95988
+ stage: string().nullable(),
95989
+ detail: string()
95990
+ }).nullable(),
95991
+ request: TrainingJobRequestSchema,
95992
+ maxCostUsd: number().nonnegative(),
95993
+ maxRuntimeSec: number().int().positive(),
95994
+ trainer: TrainerSourceRefSchema,
95995
+ datasetLayout: RetrainExportLayoutSchema,
95996
+ /** Frame count snapshotted when the job started (audit; equals `frameIds.length`). */
95997
+ frameCount: number().int().nonnegative(),
95998
+ /** Resolved frame ids at start — the archive ships exactly these. */
95999
+ frameIds: array(string()).max(2e4).readonly(),
96000
+ /** Hash of what those frames taught at start (trainer `dataset.annotationHash`). */
96001
+ annotationHash: string(),
96002
+ dataset: object({
96003
+ bytes: number().int(),
96004
+ sha256: string(),
96005
+ uploadedAt: number()
96006
+ }).nullable(),
96007
+ split: TrainingSplitPlanSchema,
96008
+ provider: object({
96009
+ state: ProviderJobStateSchema.nullable(),
96010
+ providerJobId: string().nullable(),
96011
+ startedAt: number().nullable(),
96012
+ endedAt: number().nullable(),
96013
+ billedSeconds: number(),
96014
+ costUsd: number(),
96015
+ costIsEstimate: boolean(),
96016
+ lastPolledAt: number().nullable()
96017
+ }),
96018
+ progress: object({
96019
+ epoch: number().int().nullable(),
96020
+ epochs: number().int().nullable(),
96021
+ etaSec: number().nullable(),
96022
+ series: array(TrainingProgressPointSchema).readonly()
96023
+ }),
96024
+ /** The last lines of the job's output (≤ 200), newest last. Never frame paths. */
96025
+ logTail: array(string()).readonly(),
96026
+ logCursor: string().nullable(),
96027
+ artifacts: object({
96028
+ bundleBytes: number().int(),
96029
+ bundleSha256: string(),
96030
+ fetchedAt: number(),
96031
+ /** When the staged artefacts are deleted from the hub. */
96032
+ expiresAt: number()
96033
+ }).nullable(),
96034
+ /** When the provider-side copy of the frames was deleted; null while it exists. */
96035
+ cloudDatasetDeletedAt: number().nullable(),
96036
+ /** A failed job's dataset is kept until then (the provider's grace), then deleted. */
96037
+ cloudCleanupDueAt: number().nullable(),
96038
+ /** Model ids registered from this job (base, and int8 when kept). */
96039
+ registeredModelIds: array(string()).readonly(),
96040
+ canary: TrainingCanarySchema.nullable()
96041
+ });
96042
+ var IdInput = object({ id: string().min(1) });
96043
+ method(object({}), array(TrainingBaseModelSchema).readonly(), { auth: "admin" }), method(TrainingJobRequestSchema, TrainingJobPlanSchema, {
96044
+ auth: "admin",
96045
+ timeoutMs: 6e4
96046
+ }), method(TrainingJobRequestSchema.extend({
96047
+ name: string().min(1).max(120),
96048
+ maxCostUsd: number().positive(),
96049
+ maxRuntimeSec: number().int().positive(),
96050
+ idempotencyKey: string().min(8).max(80)
96051
+ }), discriminatedUnion("kind", [object({
96052
+ kind: literal("started"),
96053
+ job: TrainingJobSchema
96054
+ }), object({
96055
+ kind: literal("refused"),
96056
+ reason: TrainingRefusalReasonSchema,
96057
+ detail: string()
96058
+ })]), {
96059
+ kind: "mutation",
96060
+ auth: "admin",
96061
+ timeoutMs: 12e4
96062
+ }), method(TrainingJobRequestSchema.omit({ baseModelId: true }).extend({
96063
+ baseModelIds: array(string().min(1)).min(1),
96064
+ name: string().min(1).max(120),
96065
+ maxCostUsd: number().positive(),
96066
+ maxRuntimeSec: number().int().positive(),
96067
+ idempotencyKey: string().min(8).max(80)
96068
+ }), discriminatedUnion("kind", [object({
96069
+ kind: literal("started"),
96070
+ batchId: string(),
96071
+ jobs: array(TrainingJobSchema).min(1).readonly()
96072
+ }), object({
96073
+ kind: literal("refused"),
96074
+ reason: TrainingRefusalReasonSchema,
96075
+ detail: string()
96076
+ })]), {
96077
+ kind: "mutation",
96078
+ auth: "admin",
96079
+ timeoutMs: 12e4
96080
+ }), method(object({}), array(TrainingJobSchema).readonly(), { auth: "admin" }), method(IdInput, TrainingJobSchema.nullable(), { auth: "admin" }), method(IdInput, TrainingJobSchema, {
96081
+ kind: "mutation",
96082
+ auth: "admin",
96083
+ timeoutMs: 12e4
96084
+ }), method(IdInput, TrainingResultSchema.nullable(), { auth: "admin" }), method(IdInput.extend({ canaryDeviceIds: array(number().int()).readonly() }), TrainingJobSchema, {
96085
+ kind: "mutation",
96086
+ auth: "admin",
96087
+ timeoutMs: 30 * 6e4
96088
+ }), method(IdInput.extend({ deviceIds: array(number().int()).min(1).readonly() }), TrainingJobSchema, {
96089
+ kind: "mutation",
96090
+ auth: "admin",
96091
+ timeoutMs: 12e4
96092
+ }), method(IdInput, TrainingJobSchema, {
96093
+ kind: "mutation",
96094
+ auth: "admin",
96095
+ timeoutMs: 12e4
96096
+ }), method(IdInput, TrainingJobSchema, {
96097
+ kind: "mutation",
96098
+ auth: "admin"
96099
+ });
94459
96100
  SOURCE_CAPS.filter((cap) => cap !== "switch" && cap !== "motion");
94460
96101
  Object.freeze({
94461
96102
  person: .5,
@@ -96604,6 +98245,12 @@ Object.freeze({
96604
98245
  addonId: null,
96605
98246
  access: "create"
96606
98247
  },
98248
+ "backup.checkBackupKey": {
98249
+ capName: "backup",
98250
+ capScope: "system",
98251
+ addonId: null,
98252
+ access: "create"
98253
+ },
96607
98254
  "backup.delete": {
96608
98255
  capName: "backup",
96609
98256
  capScope: "system",
@@ -96616,6 +98263,18 @@ Object.freeze({
96616
98263
  addonId: null,
96617
98264
  access: "delete"
96618
98265
  },
98266
+ "backup.disableEncryption": {
98267
+ capName: "backup",
98268
+ capScope: "system",
98269
+ addonId: null,
98270
+ access: "create"
98271
+ },
98272
+ "backup.getEncryption": {
98273
+ capName: "backup",
98274
+ capScope: "system",
98275
+ addonId: null,
98276
+ access: "view"
98277
+ },
96619
98278
  "backup.getEntries": {
96620
98279
  capName: "backup",
96621
98280
  capScope: "system",
@@ -96670,6 +98329,12 @@ Object.freeze({
96670
98329
  addonId: null,
96671
98330
  access: "create"
96672
98331
  },
98332
+ "backup.setupEncryption": {
98333
+ capName: "backup",
98334
+ capScope: "system",
98335
+ addonId: null,
98336
+ access: "create"
98337
+ },
96673
98338
  "backup.trigger": {
96674
98339
  capName: "backup",
96675
98340
  capScope: "system",
@@ -97222,6 +98887,12 @@ Object.freeze({
97222
98887
  addonId: null,
97223
98888
  access: "create"
97224
98889
  },
98890
+ "customModelRegistry.importModelBundle": {
98891
+ capName: "custom-model-registry",
98892
+ capScope: "system",
98893
+ addonId: null,
98894
+ access: "create"
98895
+ },
97225
98896
  "customModelRegistry.listModels": {
97226
98897
  capName: "custom-model-registry",
97227
98898
  capScope: "system",
@@ -98662,6 +100333,12 @@ Object.freeze({
98662
100333
  addonId: null,
98663
100334
  access: "view"
98664
100335
  },
100336
+ "keychainAdmin.acknowledgeReset": {
100337
+ capName: "keychain-admin",
100338
+ capScope: "system",
100339
+ addonId: null,
100340
+ access: "create"
100341
+ },
98665
100342
  "keychainAdmin.deleteOrphans": {
98666
100343
  capName: "keychain-admin",
98667
100344
  capScope: "system",
@@ -98698,6 +100375,12 @@ Object.freeze({
98698
100375
  addonId: null,
98699
100376
  access: "delete"
98700
100377
  },
100378
+ "keychainAdmin.resetReport": {
100379
+ capName: "keychain-admin",
100380
+ capScope: "system",
100381
+ addonId: null,
100382
+ access: "delete"
100383
+ },
98701
100384
  "keychainAdmin.reveal": {
98702
100385
  capName: "keychain-admin",
98703
100386
  capScope: "system",
@@ -98710,6 +100393,12 @@ Object.freeze({
98710
100393
  addonId: null,
98711
100394
  access: "create"
98712
100395
  },
100396
+ "keychainAdmin.setSystemSecret": {
100397
+ capName: "keychain-admin",
100398
+ capScope: "system",
100399
+ addonId: null,
100400
+ access: "create"
100401
+ },
98713
100402
  "keychainAdmin.status": {
98714
100403
  capName: "keychain-admin",
98715
100404
  capScope: "system",
@@ -99946,6 +101635,36 @@ Object.freeze({
99946
101635
  addonId: null,
99947
101636
  access: "view"
99948
101637
  },
101638
+ "oidcConnections.connectionFormSchema": {
101639
+ capName: "oidc-connections",
101640
+ capScope: "system",
101641
+ addonId: null,
101642
+ access: "view"
101643
+ },
101644
+ "oidcConnections.createConnection": {
101645
+ capName: "oidc-connections",
101646
+ capScope: "system",
101647
+ addonId: null,
101648
+ access: "create"
101649
+ },
101650
+ "oidcConnections.deleteConnection": {
101651
+ capName: "oidc-connections",
101652
+ capScope: "system",
101653
+ addonId: null,
101654
+ access: "delete"
101655
+ },
101656
+ "oidcConnections.listConnections": {
101657
+ capName: "oidc-connections",
101658
+ capScope: "system",
101659
+ addonId: null,
101660
+ access: "view"
101661
+ },
101662
+ "oidcConnections.updateConnection": {
101663
+ capName: "oidc-connections",
101664
+ capScope: "system",
101665
+ addonId: null,
101666
+ access: "create"
101667
+ },
99949
101668
  "osd.getStatus": {
99950
101669
  capName: "osd",
99951
101670
  capScope: "device",
@@ -100018,6 +101737,12 @@ Object.freeze({
100018
101737
  addonId: null,
100019
101738
  access: "create"
100020
101739
  },
101740
+ "osdManager.setSlotCameraEnabled": {
101741
+ capName: "osd-manager",
101742
+ capScope: "system",
101743
+ addonId: null,
101744
+ access: "create"
101745
+ },
100021
101746
  "osdManager.upsertTemplate": {
100022
101747
  capName: "osd-manager",
100023
101748
  capScope: "system",
@@ -100270,6 +101995,12 @@ Object.freeze({
100270
101995
  addonId: null,
100271
101996
  access: "view"
100272
101997
  },
101998
+ "pipelineAnalytics.getRetrainCorpusKpi": {
101999
+ capName: "pipeline-analytics",
102000
+ capScope: "device",
102001
+ addonId: null,
102002
+ access: "view"
102003
+ },
100273
102004
  "pipelineAnalytics.getRetrainExportUrl": {
100274
102005
  capName: "pipeline-analytics",
100275
102006
  capScope: "device",
@@ -100390,6 +102121,12 @@ Object.freeze({
100390
102121
  addonId: null,
100391
102122
  access: "view"
100392
102123
  },
102124
+ "pipelineAnalytics.listRetrainCorpusPage": {
102125
+ capName: "pipeline-analytics",
102126
+ capScope: "device",
102127
+ addonId: null,
102128
+ access: "view"
102129
+ },
100393
102130
  "pipelineAnalytics.listRetrainFrames": {
100394
102131
  capName: "pipeline-analytics",
100395
102132
  capScope: "device",
@@ -100420,6 +102157,12 @@ Object.freeze({
100420
102157
  addonId: null,
100421
102158
  access: "view"
100422
102159
  },
102160
+ "pipelineAnalytics.offerRetrainArchive": {
102161
+ capName: "pipeline-analytics",
102162
+ capScope: "device",
102163
+ addonId: null,
102164
+ access: "create"
102165
+ },
100423
102166
  "pipelineAnalytics.ownersWithMedia": {
100424
102167
  capName: "pipeline-analytics",
100425
102168
  capScope: "device",
@@ -100510,6 +102253,12 @@ Object.freeze({
100510
102253
  addonId: null,
100511
102254
  access: "create"
100512
102255
  },
102256
+ "pipelineAnalytics.resolveRetrainTrainingCorpus": {
102257
+ capName: "pipeline-analytics",
102258
+ capScope: "device",
102259
+ addonId: null,
102260
+ access: "view"
102261
+ },
100513
102262
  "pipelineAnalytics.restageRetrainTrack": {
100514
102263
  capName: "pipeline-analytics",
100515
102264
  capScope: "device",
@@ -102946,6 +104695,180 @@ Object.freeze({
102946
104695
  addonId: null,
102947
104696
  access: "view"
102948
104697
  },
104698
+ "training.canaryResult": {
104699
+ capName: "training",
104700
+ capScope: "system",
104701
+ addonId: null,
104702
+ access: "create"
104703
+ },
104704
+ "training.cancelJob": {
104705
+ capName: "training",
104706
+ capScope: "system",
104707
+ addonId: null,
104708
+ access: "create"
104709
+ },
104710
+ "training.discardResult": {
104711
+ capName: "training",
104712
+ capScope: "system",
104713
+ addonId: null,
104714
+ access: "create"
104715
+ },
104716
+ "training.getJob": {
104717
+ capName: "training",
104718
+ capScope: "system",
104719
+ addonId: null,
104720
+ access: "view"
104721
+ },
104722
+ "training.getJobResult": {
104723
+ capName: "training",
104724
+ capScope: "system",
104725
+ addonId: null,
104726
+ access: "view"
104727
+ },
104728
+ "training.listBaseModels": {
104729
+ capName: "training",
104730
+ capScope: "system",
104731
+ addonId: null,
104732
+ access: "view"
104733
+ },
104734
+ "training.listJobs": {
104735
+ capName: "training",
104736
+ capScope: "system",
104737
+ addonId: null,
104738
+ access: "view"
104739
+ },
104740
+ "training.planJob": {
104741
+ capName: "training",
104742
+ capScope: "system",
104743
+ addonId: null,
104744
+ access: "view"
104745
+ },
104746
+ "training.registerResult": {
104747
+ capName: "training",
104748
+ capScope: "system",
104749
+ addonId: null,
104750
+ access: "create"
104751
+ },
104752
+ "training.rollbackCanary": {
104753
+ capName: "training",
104754
+ capScope: "system",
104755
+ addonId: null,
104756
+ access: "create"
104757
+ },
104758
+ "training.startJob": {
104759
+ capName: "training",
104760
+ capScope: "system",
104761
+ addonId: null,
104762
+ access: "create"
104763
+ },
104764
+ "training.startJobBatch": {
104765
+ capName: "training",
104766
+ capScope: "system",
104767
+ addonId: null,
104768
+ access: "create"
104769
+ },
104770
+ "trainingProvider.cancelJob": {
104771
+ capName: "training-provider",
104772
+ capScope: "system",
104773
+ addonId: null,
104774
+ access: "create"
104775
+ },
104776
+ "trainingProvider.cleanupJob": {
104777
+ capName: "training-provider",
104778
+ capScope: "system",
104779
+ addonId: null,
104780
+ access: "create"
104781
+ },
104782
+ "trainingProvider.createEntry": {
104783
+ capName: "training-provider",
104784
+ capScope: "system",
104785
+ addonId: null,
104786
+ access: "create"
104787
+ },
104788
+ "trainingProvider.deleteEntry": {
104789
+ capName: "training-provider",
104790
+ capScope: "system",
104791
+ addonId: null,
104792
+ access: "delete"
104793
+ },
104794
+ "trainingProvider.describe": {
104795
+ capName: "training-provider",
104796
+ capScope: "system",
104797
+ addonId: null,
104798
+ access: "view"
104799
+ },
104800
+ "trainingProvider.describeTypes": {
104801
+ capName: "training-provider",
104802
+ capScope: "system",
104803
+ addonId: null,
104804
+ access: "view"
104805
+ },
104806
+ "trainingProvider.estimateJob": {
104807
+ capName: "training-provider",
104808
+ capScope: "system",
104809
+ addonId: null,
104810
+ access: "view"
104811
+ },
104812
+ "trainingProvider.getJob": {
104813
+ capName: "training-provider",
104814
+ capScope: "system",
104815
+ addonId: null,
104816
+ access: "view"
104817
+ },
104818
+ "trainingProvider.listEntries": {
104819
+ capName: "training-provider",
104820
+ capScope: "system",
104821
+ addonId: null,
104822
+ access: "view"
104823
+ },
104824
+ "trainingProvider.listJobEvents": {
104825
+ capName: "training-provider",
104826
+ capScope: "system",
104827
+ addonId: null,
104828
+ access: "view"
104829
+ },
104830
+ "trainingProvider.listJobs": {
104831
+ capName: "training-provider",
104832
+ capScope: "system",
104833
+ addonId: null,
104834
+ access: "view"
104835
+ },
104836
+ "trainingProvider.offerArtifact": {
104837
+ capName: "training-provider",
104838
+ capScope: "system",
104839
+ addonId: null,
104840
+ access: "create"
104841
+ },
104842
+ "trainingProvider.readResult": {
104843
+ capName: "training-provider",
104844
+ capScope: "system",
104845
+ addonId: null,
104846
+ access: "create"
104847
+ },
104848
+ "trainingProvider.submitJob": {
104849
+ capName: "training-provider",
104850
+ capScope: "system",
104851
+ addonId: null,
104852
+ access: "create"
104853
+ },
104854
+ "trainingProvider.updateEntry": {
104855
+ capName: "training-provider",
104856
+ capScope: "system",
104857
+ addonId: null,
104858
+ access: "create"
104859
+ },
104860
+ "trainingProvider.uploadDataset": {
104861
+ capName: "training-provider",
104862
+ capScope: "system",
104863
+ addonId: null,
104864
+ access: "create"
104865
+ },
104866
+ "trainingProvider.validateCredentials": {
104867
+ capName: "training-provider",
104868
+ capScope: "system",
104869
+ addonId: null,
104870
+ access: "create"
104871
+ },
102949
104872
  "turnProvider.getTurnServers": {
102950
104873
  capName: "turn-provider",
102951
104874
  capScope: "system",
@@ -102970,12 +104893,6 @@ Object.freeze({
102970
104893
  addonId: null,
102971
104894
  access: "create"
102972
104895
  },
102973
- "userManagement.createApiKey": {
102974
- capName: "user-management",
102975
- capScope: "system",
102976
- addonId: null,
102977
- access: "create"
102978
- },
102979
104896
  "userManagement.createScopedToken": {
102980
104897
  capName: "user-management",
102981
104898
  capScope: "system",
@@ -103012,12 +104929,6 @@ Object.freeze({
103012
104929
  addonId: null,
103013
104930
  access: "view"
103014
104931
  },
103015
- "userManagement.linkExternalIdentity": {
103016
- capName: "user-management",
103017
- capScope: "system",
103018
- addonId: null,
103019
- access: "create"
103020
- },
103021
104932
  "userManagement.listApiKeys": {
103022
104933
  capName: "user-management",
103023
104934
  capScope: "system",
@@ -103120,12 +105031,6 @@ Object.freeze({
103120
105031
  addonId: null,
103121
105032
  access: "create"
103122
105033
  },
103123
- "userManagement.validateApiKey": {
103124
- capName: "user-management",
103125
- capScope: "system",
103126
- addonId: null,
103127
- access: "view"
103128
- },
103129
105034
  "userManagement.validateCredentials": {
103130
105035
  capName: "user-management",
103131
105036
  capScope: "system",
@@ -106158,6 +108063,11 @@ Object.freeze({
106158
108063
  form: "single",
106159
108064
  optional: false
106160
108065
  }],
108066
+ "osdManager.setSlotCameraEnabled": [{
108067
+ name: "deviceId",
108068
+ form: "single",
108069
+ optional: false
108070
+ }],
106161
108071
  "petFeeder.callPet": [{
106162
108072
  name: "deviceId",
106163
108073
  form: "single",
@@ -106378,6 +108288,11 @@ Object.freeze({
106378
108288
  form: "array",
106379
108289
  optional: false
106380
108290
  }],
108291
+ "pipelineAnalytics.listRetrainCorpusPage": [{
108292
+ name: "deviceIds",
108293
+ form: "array",
108294
+ optional: true
108295
+ }],
106381
108296
  "pipelineAnalytics.listRetrainStaging": [{
106382
108297
  name: "deviceIds",
106383
108298
  form: "array",
@@ -107239,6 +109154,11 @@ Object.freeze({
107239
109154
  form: "single",
107240
109155
  optional: false
107241
109156
  }],
109157
+ "training.canaryResult": [{
109158
+ name: "deviceIds",
109159
+ form: "array",
109160
+ optional: false
109161
+ }],
107242
109162
  "update.getStatus": [{
107243
109163
  name: "deviceId",
107244
109164
  form: "single",
@@ -107482,6 +109402,7 @@ Object.freeze({
107482
109402
  });
107483
109403
  Object.freeze({
107484
109404
  "broker": "broker",
109405
+ "calendar-source": "calendar",
107485
109406
  "device-export": "device-export",
107486
109407
  "llm": "ai",
107487
109408
  "mesh-network": "mesh",
@@ -107967,6 +109888,8 @@ var STATE_SUMMARY_VARS = [
107967
109888
  [...RULE_TEXT],
107968
109889
  [...RULE_TEXT],
107969
109890
  [...RULE_TEXT],
109891
+ [...RULE_TEXT],
109892
+ [...RULE_TEXT],
107970
109893
  ([...RULE_TEXT], [...UPDATES]),
107971
109894
  ([...RULE_TEXT], [...PACKAGE_UPDATES]),
107972
109895
  ([...RULE_TEXT], [...PACKAGE_UPDATES]),