@camstack/addon-terminal 0.1.128 → 0.1.130
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.
- package/dist/addon.js +1631 -131
- package/dist/addon.mjs +1631 -131
- package/package.json +1 -1
package/dist/addon.js
CHANGED
|
@@ -5409,7 +5409,7 @@ var ZodIssueCode = {
|
|
|
5409
5409
|
var ZodFirstPartyTypeKind;
|
|
5410
5410
|
ZodFirstPartyTypeKind || (ZodFirstPartyTypeKind = {});
|
|
5411
5411
|
//#endregion
|
|
5412
|
-
//#region ../types/dist/sleep-
|
|
5412
|
+
//#region ../types/dist/sleep-r3RWkGVx.mjs
|
|
5413
5413
|
/**
|
|
5414
5414
|
* The audio chunk plane's byte format, and the ONE expansion from a coded
|
|
5415
5415
|
* window to float samples (D455).
|
|
@@ -5526,7 +5526,7 @@ function isKeychainStoredField(field) {
|
|
|
5526
5526
|
var SECRET_CLEAR = { $secretClear: true };
|
|
5527
5527
|
/** The `'***'` token D634 redaction writes for non-admins. */
|
|
5528
5528
|
var LEGACY_DEVICE_REDACTION = "***";
|
|
5529
|
-
function isRecord$
|
|
5529
|
+
function isRecord$2(value) {
|
|
5530
5530
|
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
5531
5531
|
}
|
|
5532
5532
|
function makeSecretMarker(ref) {
|
|
@@ -5537,12 +5537,12 @@ function makeSecretMarker(ref) {
|
|
|
5537
5537
|
}
|
|
5538
5538
|
/** A stored marker: an object whose `$secret` is a non-empty string. */
|
|
5539
5539
|
function isSecretMarker(value) {
|
|
5540
|
-
if (!isRecord$
|
|
5540
|
+
if (!isRecord$2(value)) return false;
|
|
5541
5541
|
const ref = value["$secret"];
|
|
5542
5542
|
return typeof ref === "string" && ref.length > 0;
|
|
5543
5543
|
}
|
|
5544
5544
|
function isSecretClear(value) {
|
|
5545
|
-
return isRecord$
|
|
5545
|
+
return isRecord$2(value) && value["$secretClear"] === true;
|
|
5546
5546
|
}
|
|
5547
5547
|
/**
|
|
5548
5548
|
* The UI view of a stored secret field value: a marker becomes "set", inline
|
|
@@ -6058,6 +6058,13 @@ function globalSecretScope() {
|
|
|
6058
6058
|
function encodeSegment(value) {
|
|
6059
6059
|
return encodeURIComponent(value);
|
|
6060
6060
|
}
|
|
6061
|
+
function decodeSegment(value) {
|
|
6062
|
+
try {
|
|
6063
|
+
return decodeURIComponent(value);
|
|
6064
|
+
} catch {
|
|
6065
|
+
return null;
|
|
6066
|
+
}
|
|
6067
|
+
}
|
|
6061
6068
|
/**
|
|
6062
6069
|
* The field path of a value inside an array item, addressed by the item's id:
|
|
6063
6070
|
* `arrayItemFieldPath('providers', 'authentik', 'clientSecret')` →
|
|
@@ -6066,6 +6073,75 @@ function encodeSegment(value) {
|
|
|
6066
6073
|
function arrayItemFieldPath(arrayKey, itemId, fieldKey) {
|
|
6067
6074
|
return `${arrayKey}[${encodeSegment(itemId)}].${fieldKey}`;
|
|
6068
6075
|
}
|
|
6076
|
+
function parseScope(segments) {
|
|
6077
|
+
switch (segments[0]) {
|
|
6078
|
+
case "global": return {
|
|
6079
|
+
scope: GLOBAL_SCOPE,
|
|
6080
|
+
used: 1
|
|
6081
|
+
};
|
|
6082
|
+
case "node": {
|
|
6083
|
+
const nodeId = segments[1] !== void 0 ? decodeSegment(segments[1]) : null;
|
|
6084
|
+
return nodeId === null || nodeId.length === 0 ? null : {
|
|
6085
|
+
scope: {
|
|
6086
|
+
kind: "node",
|
|
6087
|
+
nodeId
|
|
6088
|
+
},
|
|
6089
|
+
used: 2
|
|
6090
|
+
};
|
|
6091
|
+
}
|
|
6092
|
+
case "device": {
|
|
6093
|
+
const raw = segments[1];
|
|
6094
|
+
if (raw === void 0 || !/^\d+$/.test(raw)) return null;
|
|
6095
|
+
return {
|
|
6096
|
+
scope: {
|
|
6097
|
+
kind: "device",
|
|
6098
|
+
deviceId: Number(raw)
|
|
6099
|
+
},
|
|
6100
|
+
used: 2
|
|
6101
|
+
};
|
|
6102
|
+
}
|
|
6103
|
+
case "integration": {
|
|
6104
|
+
const id = segments[1] !== void 0 ? decodeSegment(segments[1]) : null;
|
|
6105
|
+
return id === null || id.length === 0 ? null : {
|
|
6106
|
+
scope: {
|
|
6107
|
+
kind: "integration",
|
|
6108
|
+
integrationId: id
|
|
6109
|
+
},
|
|
6110
|
+
used: 2
|
|
6111
|
+
};
|
|
6112
|
+
}
|
|
6113
|
+
case "row": {
|
|
6114
|
+
const collection = segments[1] !== void 0 ? decodeSegment(segments[1]) : null;
|
|
6115
|
+
const rowId = segments[2] !== void 0 ? decodeSegment(segments[2]) : null;
|
|
6116
|
+
if (collection === null || rowId === null || collection.length === 0 || rowId.length === 0) return null;
|
|
6117
|
+
return {
|
|
6118
|
+
scope: {
|
|
6119
|
+
kind: "row",
|
|
6120
|
+
collection,
|
|
6121
|
+
rowId
|
|
6122
|
+
},
|
|
6123
|
+
used: 3
|
|
6124
|
+
};
|
|
6125
|
+
}
|
|
6126
|
+
default: return null;
|
|
6127
|
+
}
|
|
6128
|
+
}
|
|
6129
|
+
/** Take a ref apart; `null` when it is not a well-formed ref. */
|
|
6130
|
+
function parseSecretRef(ref) {
|
|
6131
|
+
if (!ref.startsWith("secret://")) return null;
|
|
6132
|
+
const segments = ref.slice(9).split("/");
|
|
6133
|
+
const owner = segments[0] !== void 0 ? decodeSegment(segments[0]) : null;
|
|
6134
|
+
if (owner === null || owner.length === 0) return null;
|
|
6135
|
+
const parsed = parseScope(segments.slice(1));
|
|
6136
|
+
if (parsed === null) return null;
|
|
6137
|
+
const fieldPath = segments.slice(1 + parsed.used).join("/");
|
|
6138
|
+
if (fieldPath.length === 0) return null;
|
|
6139
|
+
return {
|
|
6140
|
+
owner,
|
|
6141
|
+
scope: parsed.scope,
|
|
6142
|
+
fieldPath
|
|
6143
|
+
};
|
|
6144
|
+
}
|
|
6069
6145
|
/** A write to a secret path could not be stored in the keychain, so it was refused. */
|
|
6070
6146
|
var KeychainWriteRefusedError = class extends Error {
|
|
6071
6147
|
fieldPath;
|
|
@@ -6076,7 +6152,7 @@ var KeychainWriteRefusedError = class extends Error {
|
|
|
6076
6152
|
}
|
|
6077
6153
|
};
|
|
6078
6154
|
var KEEP = { kind: "keep" };
|
|
6079
|
-
function isRecord(value) {
|
|
6155
|
+
function isRecord$1(value) {
|
|
6080
6156
|
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
6081
6157
|
}
|
|
6082
6158
|
function defaultMintId() {
|
|
@@ -6089,7 +6165,7 @@ function collectSecretMarkerRefs(value, out = []) {
|
|
|
6089
6165
|
return out;
|
|
6090
6166
|
}
|
|
6091
6167
|
if (Array.isArray(value)) for (const item of value) collectSecretMarkerRefs(item, out);
|
|
6092
|
-
else if (isRecord(value)) for (const child of Object.values(value)) collectSecretMarkerRefs(child, out);
|
|
6168
|
+
else if (isRecord$1(value)) for (const child of Object.values(value)) collectSecretMarkerRefs(child, out);
|
|
6093
6169
|
return out;
|
|
6094
6170
|
}
|
|
6095
6171
|
async function storedValueEquals(secrets, marker, candidate) {
|
|
@@ -6144,7 +6220,7 @@ function rowId(row, idKey) {
|
|
|
6144
6220
|
return null;
|
|
6145
6221
|
}
|
|
6146
6222
|
async function writeArray(ctx, node, incoming, stored, fieldPath) {
|
|
6147
|
-
const storedRows = Array.isArray(stored) ? stored.filter(isRecord) : [];
|
|
6223
|
+
const storedRows = Array.isArray(stored) ? stored.filter(isRecord$1) : [];
|
|
6148
6224
|
if (!Array.isArray(incoming)) {
|
|
6149
6225
|
ctx.deletes.push(...collectSecretMarkerRefs(storedRows));
|
|
6150
6226
|
return {
|
|
@@ -6160,7 +6236,7 @@ async function writeArray(ctx, node, incoming, stored, fieldPath) {
|
|
|
6160
6236
|
const kept = /* @__PURE__ */ new Set();
|
|
6161
6237
|
const rows = [];
|
|
6162
6238
|
for (const row of incoming) {
|
|
6163
|
-
if (!isRecord(row)) {
|
|
6239
|
+
if (!isRecord$1(row)) {
|
|
6164
6240
|
rows.push(row);
|
|
6165
6241
|
continue;
|
|
6166
6242
|
}
|
|
@@ -6185,7 +6261,7 @@ async function writeNode(ctx, node, incoming, stored, fieldPath) {
|
|
|
6185
6261
|
case "leaf": return writeLeaf(ctx, incoming, stored, fieldPath);
|
|
6186
6262
|
case "array": return writeArray(ctx, node, incoming, stored, fieldPath);
|
|
6187
6263
|
case "object": {
|
|
6188
|
-
if (!isRecord(incoming)) {
|
|
6264
|
+
if (!isRecord$1(incoming)) {
|
|
6189
6265
|
if (incoming === void 0) return KEEP;
|
|
6190
6266
|
ctx.deletes.push(...collectSecretMarkerRefs(stored));
|
|
6191
6267
|
return {
|
|
@@ -6193,7 +6269,7 @@ async function writeNode(ctx, node, incoming, stored, fieldPath) {
|
|
|
6193
6269
|
value: incoming
|
|
6194
6270
|
};
|
|
6195
6271
|
}
|
|
6196
|
-
const storedObj = isRecord(stored) ? stored : {};
|
|
6272
|
+
const storedObj = isRecord$1(stored) ? stored : {};
|
|
6197
6273
|
return {
|
|
6198
6274
|
kind: "value",
|
|
6199
6275
|
value: await writeMembers(ctx, node.children, incoming, storedObj, (m) => `${fieldPath}.${m}`)
|
|
@@ -6252,12 +6328,19 @@ async function transformSecretWrite(input) {
|
|
|
6252
6328
|
}
|
|
6253
6329
|
};
|
|
6254
6330
|
}
|
|
6331
|
+
/** Is `ref` one of `owner`'s refs? */
|
|
6332
|
+
function isSecretRefOwnedBy(ref, owner) {
|
|
6333
|
+
return parseSecretRef(ref)?.owner === owner;
|
|
6334
|
+
}
|
|
6255
6335
|
/**
|
|
6256
6336
|
* Replace every marker in `value` with its keychain value. Returns the SAME
|
|
6257
6337
|
* reference when there is no marker (no allocation, no keychain call).
|
|
6258
6338
|
*/
|
|
6259
|
-
async function resolveSecretMarkers(value, secrets) {
|
|
6260
|
-
const
|
|
6339
|
+
async function resolveSecretMarkers(value, secrets, options = {}) {
|
|
6340
|
+
const keepMarker = options.unresolved === "keep-marker";
|
|
6341
|
+
const owner = options.ownedBy;
|
|
6342
|
+
const inScope = (ref) => owner === void 0 || isSecretRefOwnedBy(ref, owner);
|
|
6343
|
+
const refs = collectSecretMarkerRefs(value).filter(inScope);
|
|
6261
6344
|
if (refs.length === 0) return {
|
|
6262
6345
|
value,
|
|
6263
6346
|
unresolved: []
|
|
@@ -6281,10 +6364,18 @@ async function resolveSecretMarkers(value, secrets) {
|
|
|
6281
6364
|
}
|
|
6282
6365
|
const substitute = (v) => {
|
|
6283
6366
|
if (isSecretMarker(v)) {
|
|
6367
|
+
if (!inScope(v.$secret)) return {
|
|
6368
|
+
keep: true,
|
|
6369
|
+
value: v
|
|
6370
|
+
};
|
|
6284
6371
|
const answer = answers[v.$secret];
|
|
6285
|
-
|
|
6372
|
+
if (answer?.kind === "value") return {
|
|
6286
6373
|
keep: true,
|
|
6287
6374
|
value: answer.value
|
|
6375
|
+
};
|
|
6376
|
+
return keepMarker ? {
|
|
6377
|
+
keep: true,
|
|
6378
|
+
value: v
|
|
6288
6379
|
} : {
|
|
6289
6380
|
keep: false,
|
|
6290
6381
|
value: void 0
|
|
@@ -6301,7 +6392,7 @@ async function resolveSecretMarkers(value, secrets) {
|
|
|
6301
6392
|
value: items
|
|
6302
6393
|
};
|
|
6303
6394
|
}
|
|
6304
|
-
if (isRecord(v)) {
|
|
6395
|
+
if (isRecord$1(v)) {
|
|
6305
6396
|
const out = {};
|
|
6306
6397
|
for (const [k, child] of Object.entries(v)) {
|
|
6307
6398
|
const s = substitute(child);
|
|
@@ -6322,14 +6413,152 @@ async function resolveSecretMarkers(value, secrets) {
|
|
|
6322
6413
|
unresolved
|
|
6323
6414
|
};
|
|
6324
6415
|
}
|
|
6325
|
-
|
|
6326
|
-
|
|
6327
|
-
|
|
6328
|
-
|
|
6329
|
-
|
|
6416
|
+
/** An addon tried to replace a stored secret it could not read. Nothing was written. */
|
|
6417
|
+
var SecretOverwriteRefusedError = class extends Error {
|
|
6418
|
+
ref;
|
|
6419
|
+
reason;
|
|
6420
|
+
constructor(ref, reason) {
|
|
6421
|
+
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.`);
|
|
6422
|
+
this.ref = ref;
|
|
6423
|
+
this.reason = reason;
|
|
6424
|
+
this.name = "SecretOverwriteRefusedError";
|
|
6425
|
+
}
|
|
6426
|
+
};
|
|
6427
|
+
function isRecord(value) {
|
|
6428
|
+
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
6429
|
+
}
|
|
6430
|
+
function resolvedValue(pass, marker) {
|
|
6431
|
+
const answer = pass.answers[marker.$secret];
|
|
6432
|
+
return answer?.kind === "value" ? answer.value : null;
|
|
6433
|
+
}
|
|
6434
|
+
async function atMarker(pass, incoming, stored) {
|
|
6435
|
+
if (incoming === null) return stored;
|
|
6436
|
+
if (typeof incoming !== "string") return incoming;
|
|
6437
|
+
if (incoming === resolvedValue(pass, stored)) return stored;
|
|
6438
|
+
const intent = classifySecretWrite(incoming);
|
|
6439
|
+
if (intent.kind !== "set") return stored;
|
|
6440
|
+
const ref = stored.$secret;
|
|
6441
|
+
if (!isSecretRefOwnedBy(ref, pass.secrets.owner)) return incoming;
|
|
6442
|
+
const answer = pass.answers[ref];
|
|
6443
|
+
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);
|
|
6444
|
+
try {
|
|
6445
|
+
await pass.secrets.put(ref, intent.value);
|
|
6446
|
+
} catch (err) {
|
|
6447
|
+
throw new KeychainWriteRefusedError(ref, err);
|
|
6448
|
+
}
|
|
6449
|
+
pass.changedRefs.push(ref);
|
|
6450
|
+
return stored;
|
|
6451
|
+
}
|
|
6452
|
+
function inArray(pass, incoming, stored) {
|
|
6453
|
+
return incoming.map((item, index) => {
|
|
6454
|
+
const twin = stored[index];
|
|
6455
|
+
if (isSecretMarker(twin)) return typeof item === "string" && item === resolvedValue(pass, twin) ? twin : item;
|
|
6456
|
+
if (isRecord(item) && isRecord(twin)) return inArrayRow(pass, item, twin);
|
|
6457
|
+
if (Array.isArray(item) && Array.isArray(twin)) return inArray(pass, item, twin);
|
|
6458
|
+
return item;
|
|
6459
|
+
});
|
|
6460
|
+
}
|
|
6461
|
+
function inArrayRow(pass, incoming, stored) {
|
|
6462
|
+
const out = { ...incoming };
|
|
6463
|
+
for (const [key, value] of Object.entries(incoming)) {
|
|
6464
|
+
const twin = stored[key];
|
|
6465
|
+
if (isSecretMarker(twin)) {
|
|
6466
|
+
if (typeof value === "string" && value === resolvedValue(pass, twin)) out[key] = twin;
|
|
6467
|
+
} else if (isRecord(value) && isRecord(twin)) out[key] = inArrayRow(pass, value, twin);
|
|
6468
|
+
else if (Array.isArray(value) && Array.isArray(twin)) out[key] = inArray(pass, value, twin);
|
|
6469
|
+
}
|
|
6470
|
+
return out;
|
|
6471
|
+
}
|
|
6472
|
+
async function walk(pass, incoming, stored) {
|
|
6473
|
+
if (isSecretMarker(stored)) return atMarker(pass, incoming, stored);
|
|
6474
|
+
if (Array.isArray(incoming) && Array.isArray(stored)) return inArray(pass, incoming, stored);
|
|
6475
|
+
if (!isRecord(incoming) || !isRecord(stored)) return incoming;
|
|
6476
|
+
const out = { ...incoming };
|
|
6477
|
+
for (const [key, value] of Object.entries(incoming)) out[key] = await walk(pass, value, stored[key]);
|
|
6478
|
+
return out;
|
|
6479
|
+
}
|
|
6480
|
+
/** Restore markers a write-back carries as values. See the file doc. */
|
|
6481
|
+
async function restoreUnchangedSecrets(input) {
|
|
6482
|
+
const refs = [];
|
|
6483
|
+
for (const key of Object.keys(input.patch)) collectSecretMarkerRefs(input.stored[key], refs);
|
|
6484
|
+
const owned = refs.filter((ref) => isSecretRefOwnedBy(ref, input.secrets.owner));
|
|
6485
|
+
if (owned.length === 0) return {
|
|
6486
|
+
patch: input.patch,
|
|
6487
|
+
changedRefs: []
|
|
6488
|
+
};
|
|
6489
|
+
const pass = {
|
|
6490
|
+
secrets: input.secrets,
|
|
6491
|
+
answers: await input.secrets.resolve([...new Set(owned)]),
|
|
6492
|
+
operatorWrite: input.operatorWrite,
|
|
6493
|
+
changedRefs: []
|
|
6494
|
+
};
|
|
6495
|
+
const out = {};
|
|
6496
|
+
for (const [key, value] of Object.entries(input.patch)) out[key] = await walk(pass, value, input.stored[key]);
|
|
6497
|
+
return {
|
|
6498
|
+
patch: out,
|
|
6499
|
+
changedRefs: pass.changedRefs
|
|
6500
|
+
};
|
|
6501
|
+
}
|
|
6502
|
+
/** Structural equality over JSON-shaped values (key order does not matter). */
|
|
6503
|
+
function isJsonEqual(a, b) {
|
|
6504
|
+
if (Object.is(a, b)) return true;
|
|
6505
|
+
if (Array.isArray(a)) return Array.isArray(b) && a.length === b.length && a.every((v, i) => isJsonEqual(v, b[i]));
|
|
6506
|
+
if (isRecord(a) && isRecord(b)) {
|
|
6507
|
+
const keys = Object.keys(a);
|
|
6508
|
+
if (keys.length !== Object.keys(b).length) return false;
|
|
6509
|
+
return keys.every((k) => Object.prototype.hasOwnProperty.call(b, k) && isJsonEqual(a[k], b[k]));
|
|
6330
6510
|
}
|
|
6331
6511
|
return false;
|
|
6332
6512
|
}
|
|
6513
|
+
/** The patch without the keys whose value already equals the stored one. */
|
|
6514
|
+
function dropUnchangedKeys(patch, stored) {
|
|
6515
|
+
const out = {};
|
|
6516
|
+
for (const [key, value] of Object.entries(patch)) {
|
|
6517
|
+
if (Object.prototype.hasOwnProperty.call(stored, key) && isJsonEqual(value, stored[key])) continue;
|
|
6518
|
+
out[key] = value;
|
|
6519
|
+
}
|
|
6520
|
+
return out;
|
|
6521
|
+
}
|
|
6522
|
+
/** The top-level keys of a blob that hold at least one of `owner`'s markers. */
|
|
6523
|
+
function markerKeysOf(blob, owner) {
|
|
6524
|
+
const keys = /* @__PURE__ */ new Set();
|
|
6525
|
+
for (const [key, value] of Object.entries(blob)) if (collectSecretMarkerRefs(value).some((ref) => isSecretRefOwnedBy(ref, owner))) keys.add(key);
|
|
6526
|
+
return keys;
|
|
6527
|
+
}
|
|
6528
|
+
function nodeFromStored(value, owner) {
|
|
6529
|
+
if (isSecretMarker(value)) return isSecretRefOwnedBy(value.$secret, owner) ? { kind: "leaf" } : null;
|
|
6530
|
+
if (!isRecord(value)) return null;
|
|
6531
|
+
const children = /* @__PURE__ */ new Map();
|
|
6532
|
+
for (const [key, child] of Object.entries(value)) {
|
|
6533
|
+
const node = nodeFromStored(child, owner);
|
|
6534
|
+
if (node !== null) children.set(key, node);
|
|
6535
|
+
}
|
|
6536
|
+
return children.size > 0 ? {
|
|
6537
|
+
kind: "object",
|
|
6538
|
+
children
|
|
6539
|
+
} : null;
|
|
6540
|
+
}
|
|
6541
|
+
/**
|
|
6542
|
+
* The declared secret tree, widened by every place the STORED blob holds a
|
|
6543
|
+
* marker under one of `keys` — so a marker the schema no longer declares (or
|
|
6544
|
+
* never declared: Wyze before b4906cec6) still gets the save path's
|
|
6545
|
+
* KEEP / SET / CLEAR semantics instead of being overwritten by whatever the
|
|
6546
|
+
* addon writes. Markers inside arrays are not added: a row has no id field to
|
|
6547
|
+
* match by unless the schema declares one. Only `owner`'s markers count: a
|
|
6548
|
+
* builtin that keeps another addon's marker (device-manager) never takes it
|
|
6549
|
+
* over.
|
|
6550
|
+
*/
|
|
6551
|
+
function widenTreeWithStoredMarkers(declared, stored, keys, owner) {
|
|
6552
|
+
const added = /* @__PURE__ */ new Map();
|
|
6553
|
+
for (const key of keys) {
|
|
6554
|
+
const at = key.indexOf("@");
|
|
6555
|
+
const base = at > 0 ? key.slice(0, at) : key;
|
|
6556
|
+
if (declared.has(base) || added.has(base)) continue;
|
|
6557
|
+
const node = nodeFromStored(stored[key], owner);
|
|
6558
|
+
if (node !== null) added.set(base, node);
|
|
6559
|
+
}
|
|
6560
|
+
return added.size === 0 ? declared : new Map([...declared, ...added]);
|
|
6561
|
+
}
|
|
6333
6562
|
/** The blob as stored now; a failed read REFUSES the write instead of guessing. */
|
|
6334
6563
|
async function readStoredAddonBlob(raw) {
|
|
6335
6564
|
const threeWay = raw.readAddonStoreResult;
|
|
@@ -6338,7 +6567,41 @@ async function readStoredAddonBlob(raw) {
|
|
|
6338
6567
|
if (result.kind === "failed") throw new Error(`settings write refused: the stored blob could not be read (${result.error})`);
|
|
6339
6568
|
return result.kind === "missing" ? {} : result.value;
|
|
6340
6569
|
}
|
|
6341
|
-
function
|
|
6570
|
+
function touchesTree(tree, patch) {
|
|
6571
|
+
if (tree.size === 0) return false;
|
|
6572
|
+
for (const key of Object.keys(patch)) {
|
|
6573
|
+
const at = key.indexOf("@");
|
|
6574
|
+
if (tree.has(at > 0 ? key.slice(0, at) : key)) return true;
|
|
6575
|
+
}
|
|
6576
|
+
return false;
|
|
6577
|
+
}
|
|
6578
|
+
/**
|
|
6579
|
+
* Which top-level keys of each store held markers when last seen. `undefined`
|
|
6580
|
+
* for a store not seen yet: its first write reads it, to be safe.
|
|
6581
|
+
*/
|
|
6582
|
+
var MarkerKeyIndex = class {
|
|
6583
|
+
owner;
|
|
6584
|
+
byStore = /* @__PURE__ */ new Map();
|
|
6585
|
+
constructor(owner) {
|
|
6586
|
+
this.owner = owner;
|
|
6587
|
+
}
|
|
6588
|
+
seen(store, blob) {
|
|
6589
|
+
this.byStore.set(store, markerKeysOf(blob, this.owner));
|
|
6590
|
+
}
|
|
6591
|
+
wrote(store, patch) {
|
|
6592
|
+
const keys = this.byStore.get(store);
|
|
6593
|
+
if (keys === void 0) return;
|
|
6594
|
+
const now = markerKeysOf(patch, this.owner);
|
|
6595
|
+
for (const key of Object.keys(patch)) if (now.has(key)) keys.add(key);
|
|
6596
|
+
else keys.delete(key);
|
|
6597
|
+
}
|
|
6598
|
+
mayHoldMarkers(store, patch) {
|
|
6599
|
+
const keys = this.byStore.get(store);
|
|
6600
|
+
if (keys === void 0) return true;
|
|
6601
|
+
return Object.keys(patch).some((key) => keys.has(key));
|
|
6602
|
+
}
|
|
6603
|
+
};
|
|
6604
|
+
function createHandle(raw, opts) {
|
|
6342
6605
|
const chains = /* @__PURE__ */ new Map();
|
|
6343
6606
|
const serialize = (key, fn) => {
|
|
6344
6607
|
const next = (chains.get(key) ?? Promise.resolve()).then(fn, fn);
|
|
@@ -6349,46 +6612,130 @@ function createSecretAwareSettings(raw, opts) {
|
|
|
6349
6612
|
});
|
|
6350
6613
|
return next;
|
|
6351
6614
|
};
|
|
6352
|
-
const
|
|
6353
|
-
|
|
6354
|
-
|
|
6615
|
+
const index = new MarkerKeyIndex(opts.secrets.owner);
|
|
6616
|
+
const resolveRead = async (store, blob) => {
|
|
6617
|
+
index.seen(store, blob);
|
|
6618
|
+
const { value, unresolved } = await resolveSecretMarkers(blob, opts.secrets, {
|
|
6619
|
+
unresolved: "keep-marker",
|
|
6620
|
+
ownedBy: opts.secrets.owner
|
|
6621
|
+
});
|
|
6622
|
+
if (unresolved.length > 0) opts.onUnresolved?.(unresolved);
|
|
6623
|
+
return value;
|
|
6624
|
+
};
|
|
6625
|
+
const write = async (store, declared, scope, patch, readStored, rawWrite) => {
|
|
6626
|
+
if (!touchesTree(declared, patch) && !index.mayHoldMarkers(store, patch)) {
|
|
6627
|
+
await rawWrite(patch);
|
|
6628
|
+
index.wrote(store, patch);
|
|
6629
|
+
return { changed: true };
|
|
6630
|
+
}
|
|
6631
|
+
return serialize(store, async () => {
|
|
6355
6632
|
const stored = await readStored();
|
|
6633
|
+
index.seen(store, stored);
|
|
6634
|
+
const operatorWrite = opts.isOperatorWrite?.() === true;
|
|
6635
|
+
const restored = await restoreUnchangedSecrets({
|
|
6636
|
+
patch,
|
|
6637
|
+
stored,
|
|
6638
|
+
secrets: opts.secrets,
|
|
6639
|
+
operatorWrite
|
|
6640
|
+
});
|
|
6356
6641
|
const result = await transformSecretWrite({
|
|
6357
|
-
tree,
|
|
6642
|
+
tree: widenTreeWithStoredMarkers(declared, stored, Object.keys(restored.patch), opts.secrets.owner),
|
|
6358
6643
|
secrets: opts.secrets,
|
|
6359
|
-
patch,
|
|
6644
|
+
patch: restored.patch,
|
|
6360
6645
|
stored,
|
|
6361
6646
|
...scope !== void 0 ? { scope } : {},
|
|
6362
|
-
operatorWrite
|
|
6647
|
+
operatorWrite
|
|
6363
6648
|
});
|
|
6364
|
-
|
|
6649
|
+
const effective = dropUnchangedKeys(result.patch, stored);
|
|
6650
|
+
const wroteBlob = Object.keys(effective).length > 0;
|
|
6651
|
+
if (wroteBlob) {
|
|
6652
|
+
await rawWrite(effective);
|
|
6653
|
+
index.wrote(store, effective);
|
|
6654
|
+
}
|
|
6365
6655
|
const { orphaned } = await result.afterWrite();
|
|
6366
6656
|
if (orphaned.length > 0) opts.onOrphaned(orphaned);
|
|
6657
|
+
return { changed: wroteBlob || restored.changedRefs.length > 0 };
|
|
6367
6658
|
});
|
|
6368
6659
|
};
|
|
6369
|
-
const
|
|
6370
|
-
|
|
6371
|
-
|
|
6372
|
-
|
|
6373
|
-
|
|
6374
|
-
|
|
6660
|
+
const writeAddon = (patch) => write("addon", opts.addonTree(), void 0, patch, () => readStoredAddonBlob(raw), (p) => raw.writeAddonStore(p));
|
|
6661
|
+
const readAddonStoreResult = raw.readAddonStoreResult;
|
|
6662
|
+
const readAddonStoreKeyResult = raw.readAddonStoreKeyResult;
|
|
6663
|
+
const readDeviceStoreBatch = raw.readDeviceStoreBatch;
|
|
6664
|
+
const overrides = {
|
|
6665
|
+
readAddonStore: async () => resolveRead("addon", await raw.readAddonStore()),
|
|
6666
|
+
...readAddonStoreResult !== void 0 ? { readAddonStoreResult: async () => {
|
|
6667
|
+
const result = await readAddonStoreResult.call(raw);
|
|
6668
|
+
return result.kind === "value" ? {
|
|
6669
|
+
kind: "value",
|
|
6670
|
+
value: await resolveRead("addon", result.value)
|
|
6671
|
+
} : result;
|
|
6672
|
+
} } : {},
|
|
6673
|
+
...readAddonStoreKeyResult !== void 0 ? { readAddonStoreKeyResult: async (key) => {
|
|
6674
|
+
const result = await readAddonStoreKeyResult.call(raw, key);
|
|
6675
|
+
if (result.kind !== "present") return result;
|
|
6676
|
+
const { value, unresolved } = await resolveSecretMarkers({ [key]: result.value }, opts.secrets, {
|
|
6677
|
+
unresolved: "keep-marker",
|
|
6678
|
+
ownedBy: opts.secrets.owner
|
|
6679
|
+
});
|
|
6680
|
+
if (unresolved.length > 0) opts.onUnresolved?.(unresolved);
|
|
6681
|
+
return {
|
|
6682
|
+
kind: "present",
|
|
6683
|
+
value: value[key]
|
|
6684
|
+
};
|
|
6685
|
+
} } : {},
|
|
6686
|
+
readDeviceStore: async (deviceId) => resolveRead(`device:${deviceId}`, await raw.readDeviceStore(deviceId)),
|
|
6687
|
+
...readDeviceStoreBatch !== void 0 ? { readDeviceStoreBatch: async (deviceIds) => {
|
|
6688
|
+
const rows = await readDeviceStoreBatch.call(raw, deviceIds);
|
|
6689
|
+
const out = /* @__PURE__ */ new Map();
|
|
6690
|
+
for (const [deviceId, blob] of rows) out.set(deviceId, await resolveRead(`device:${deviceId}`, blob));
|
|
6691
|
+
return out;
|
|
6692
|
+
} } : {},
|
|
6693
|
+
writeAddonStore: async (patch) => {
|
|
6694
|
+
await writeAddon(patch);
|
|
6695
|
+
},
|
|
6696
|
+
writeDeviceStore: async (deviceId, patch) => {
|
|
6697
|
+
await write(`device:${deviceId}`, opts.deviceTree(), {
|
|
6698
|
+
kind: "device",
|
|
6699
|
+
deviceId
|
|
6700
|
+
}, patch, () => raw.readDeviceStore(deviceId), (p) => raw.writeDeviceStore(deviceId, p));
|
|
6701
|
+
}
|
|
6702
|
+
};
|
|
6703
|
+
return {
|
|
6704
|
+
settings: new Proxy(raw, { get(target, prop, receiver) {
|
|
6705
|
+
if (typeof prop === "string" && Object.prototype.hasOwnProperty.call(overrides, prop)) return Reflect.get(overrides, prop);
|
|
6706
|
+
const value = Reflect.get(target, prop, receiver);
|
|
6707
|
+
return typeof value === "function" ? value.bind(target) : value;
|
|
6708
|
+
} }),
|
|
6709
|
+
raw: {
|
|
6710
|
+
readAddonStore: async () => {
|
|
6711
|
+
const blob = await raw.readAddonStore();
|
|
6712
|
+
index.seen("addon", blob);
|
|
6713
|
+
return blob;
|
|
6714
|
+
},
|
|
6715
|
+
readDeviceStore: async (deviceId) => {
|
|
6716
|
+
const blob = await raw.readDeviceStore(deviceId);
|
|
6717
|
+
index.seen(`device:${deviceId}`, blob);
|
|
6718
|
+
return blob;
|
|
6719
|
+
}
|
|
6720
|
+
},
|
|
6721
|
+
writeAddonStore: writeAddon
|
|
6375
6722
|
};
|
|
6376
|
-
return new Proxy(raw, { get(target, prop, receiver) {
|
|
6377
|
-
if (prop === "writeAddonStore") return wrapped.writeAddonStore;
|
|
6378
|
-
if (prop === "writeDeviceStore") return wrapped.writeDeviceStore;
|
|
6379
|
-
const value = Reflect.get(target, prop, receiver);
|
|
6380
|
-
return typeof value === "function" ? value.bind(target) : value;
|
|
6381
|
-
} });
|
|
6382
6723
|
}
|
|
6383
|
-
/** The context the addon sees
|
|
6384
|
-
function
|
|
6724
|
+
/** The context the addon sees, plus the private raw view and write outcome. */
|
|
6725
|
+
function createSecretAwareContext(context, opts) {
|
|
6385
6726
|
const raw = context.settings;
|
|
6386
|
-
if (raw === void 0) return
|
|
6387
|
-
|
|
6388
|
-
|
|
6389
|
-
|
|
6390
|
-
|
|
6391
|
-
|
|
6727
|
+
if (raw === void 0) return {
|
|
6728
|
+
context,
|
|
6729
|
+
handle: null
|
|
6730
|
+
};
|
|
6731
|
+
const handle = createHandle(raw, opts);
|
|
6732
|
+
return {
|
|
6733
|
+
context: new Proxy(context, { get(target, prop, receiver) {
|
|
6734
|
+
if (prop === "settings") return handle.settings;
|
|
6735
|
+
return Reflect.get(target, prop, receiver);
|
|
6736
|
+
} }),
|
|
6737
|
+
handle
|
|
6738
|
+
};
|
|
6392
6739
|
}
|
|
6393
6740
|
var LEAF = { kind: "leaf" };
|
|
6394
6741
|
var DEFAULT_ITEM_ID_KEY = "id";
|
|
@@ -6563,6 +6910,14 @@ var BaseAddon = class {
|
|
|
6563
6910
|
_secretChangeUnsub = null;
|
|
6564
6911
|
/** >0 while an OPERATOR's settings write is being applied. */
|
|
6565
6912
|
_operatorWriteDepth = 0;
|
|
6913
|
+
/**
|
|
6914
|
+
* The keychain-aware settings handle (D798). Its `raw` view is the ONLY way
|
|
6915
|
+
* to the marker-bearing blobs and stays private to this class: the form
|
|
6916
|
+
* hydrate and config resolution need markers, addon code never does.
|
|
6917
|
+
*/
|
|
6918
|
+
_secretSettings = null;
|
|
6919
|
+
/** Refs an addon-facing read could not resolve — each is logged once per process. */
|
|
6920
|
+
_loggedUnresolvedReads = /* @__PURE__ */ new Set();
|
|
6566
6921
|
constructor(defaults) {
|
|
6567
6922
|
this.defaults = defaults;
|
|
6568
6923
|
this._config = { ...defaults };
|
|
@@ -6599,13 +6954,21 @@ var BaseAddon = class {
|
|
|
6599
6954
|
}
|
|
6600
6955
|
async initialize(context) {
|
|
6601
6956
|
const secrets = context.secrets;
|
|
6602
|
-
|
|
6603
|
-
|
|
6604
|
-
|
|
6605
|
-
|
|
6606
|
-
|
|
6607
|
-
|
|
6608
|
-
|
|
6957
|
+
if (secrets !== void 0) {
|
|
6958
|
+
const { context: wrapped, handle } = createSecretAwareContext(context, {
|
|
6959
|
+
secrets,
|
|
6960
|
+
addonTree: () => this.addonSecretTree(),
|
|
6961
|
+
deviceTree: () => this.deviceSecretTree(),
|
|
6962
|
+
onOrphaned: (refs) => context.logger.warn("keychain refs dropped by a settings write could not be deleted", { meta: { refs: [...refs] } }),
|
|
6963
|
+
isOperatorWrite: () => this._operatorWriteDepth > 0,
|
|
6964
|
+
onUnresolved: (unresolved) => this.logUnresolvedRead(unresolved)
|
|
6965
|
+
});
|
|
6966
|
+
this._ctx = wrapped;
|
|
6967
|
+
this._secretSettings = handle;
|
|
6968
|
+
} else {
|
|
6969
|
+
this._ctx = context;
|
|
6970
|
+
this._secretSettings = null;
|
|
6971
|
+
}
|
|
6609
6972
|
await this.resolveConfig();
|
|
6610
6973
|
if (secrets !== void 0) this._secretChangeUnsub = secrets.onChange((ref) => {
|
|
6611
6974
|
if (this._configSecretRefs.has(ref)) this.scheduleSecretReresolve(SECRET_CHANGE_DEBOUNCE_MS);
|
|
@@ -6722,11 +7085,8 @@ var BaseAddon = class {
|
|
|
6722
7085
|
async getGlobalSettings(overlay, cap, nodeId) {
|
|
6723
7086
|
const schema = this.globalSettingsSchema(cap);
|
|
6724
7087
|
if (!schema) return { sections: [] };
|
|
6725
|
-
const projected = await this.
|
|
6726
|
-
return hydrateSchema(schema, overlay ? {
|
|
6727
|
-
...projected,
|
|
6728
|
-
...overlay
|
|
6729
|
-
} : projected, { inlineSecretsAsViews: true });
|
|
7088
|
+
const projected = await this.readRawProjectedStore(nodeId, cap);
|
|
7089
|
+
return hydrateSchema(schema, overlay ? await this.overlayKeepingMarkers(projected, overlay) : projected, { inlineSecretsAsViews: true });
|
|
6730
7090
|
}
|
|
6731
7091
|
/**
|
|
6732
7092
|
* The integration-level view of this addon's settings: exactly the sections
|
|
@@ -6771,7 +7131,7 @@ var BaseAddon = class {
|
|
|
6771
7131
|
});
|
|
6772
7132
|
}
|
|
6773
7133
|
if (sections.length === 0) return null;
|
|
6774
|
-
const projected = await this.
|
|
7134
|
+
const projected = await this.readRawProjectedStore(nodeId);
|
|
6775
7135
|
return hydrateSchema({
|
|
6776
7136
|
...schema,
|
|
6777
7137
|
sections
|
|
@@ -6788,12 +7148,50 @@ var BaseAddon = class {
|
|
|
6788
7148
|
* the store for custom option logic (option narrowing, value snapping) to
|
|
6789
7149
|
* read it per-node — never `ctx.settings.readAddonStore()` directly.
|
|
6790
7150
|
* `nodeId` omitted ⇒ the local node (node-blind injection from ctx).
|
|
7151
|
+
*
|
|
7152
|
+
* Keychain values come back RESOLVED (D798): a secret reads as its value,
|
|
7153
|
+
* never as a `{ $secret }` marker. One the keychain cannot serve right now
|
|
7154
|
+
* stays a marker — "stored, unavailable" (`isSecretMarker()` is true, and it
|
|
7155
|
+
* is listed in {@link unresolvedSecrets}) — never `''` and never absent, so
|
|
7156
|
+
* it cannot be mistaken for "nothing stored, mint a new one". Writing the
|
|
7157
|
+
* resolved blob back is a no-op for every unchanged secret.
|
|
6791
7158
|
*/
|
|
6792
7159
|
async resolveGlobalStore(nodeId, cap) {
|
|
6793
7160
|
const raw = await this._ctx?.settings?.readAddonStore() ?? {};
|
|
7161
|
+
return this.projectForNode(raw, nodeId, cap);
|
|
7162
|
+
}
|
|
7163
|
+
projectForNode(store, nodeId, cap) {
|
|
6794
7164
|
const keys = this.perNodeKeys(cap);
|
|
6795
7165
|
const node = normalizeNodeId(nodeId ?? this._ctx?.kernel?.localNodeId);
|
|
6796
|
-
return keys.size > 0 ? projectStore(
|
|
7166
|
+
return keys.size > 0 ? projectStore(store, keys, node) : store;
|
|
7167
|
+
}
|
|
7168
|
+
/** The PROJECTED store with its markers — the form hydrate only (D798). */
|
|
7169
|
+
async readRawProjectedStore(nodeId, cap) {
|
|
7170
|
+
const raw = await this.rawSettings()?.readAddonStore() ?? {};
|
|
7171
|
+
return this.projectForNode(raw, nodeId, cap);
|
|
7172
|
+
}
|
|
7173
|
+
/**
|
|
7174
|
+
* `{ ...stored, ...overlay }`, except that an overlay member equal to the
|
|
7175
|
+
* RESOLVED stored one keeps the stored (marker-bearing) member — so a form
|
|
7176
|
+
* hydrated from a resolved overlay still shows a secret as "set", never as
|
|
7177
|
+
* its value.
|
|
7178
|
+
*/
|
|
7179
|
+
async overlayKeepingMarkers(stored, overlay) {
|
|
7180
|
+
const secrets = this._ctx?.secrets;
|
|
7181
|
+
const merged = {
|
|
7182
|
+
...stored,
|
|
7183
|
+
...overlay
|
|
7184
|
+
};
|
|
7185
|
+
if (secrets === void 0 || collectSecretMarkerRefs(stored).length === 0) return merged;
|
|
7186
|
+
const { value: resolved } = await resolveSecretMarkers(stored, secrets, {
|
|
7187
|
+
unresolved: "keep-marker",
|
|
7188
|
+
ownedBy: secrets.owner
|
|
7189
|
+
});
|
|
7190
|
+
for (const key of Object.keys(overlay)) {
|
|
7191
|
+
if (collectSecretMarkerRefs(stored[key]).length === 0) continue;
|
|
7192
|
+
if (isJsonEqual(overlay[key], resolved[key])) merged[key] = stored[key];
|
|
7193
|
+
}
|
|
7194
|
+
return merged;
|
|
6797
7195
|
}
|
|
6798
7196
|
/**
|
|
6799
7197
|
* Whether ONE global key of this addon's store was written, read three-way
|
|
@@ -6858,8 +7256,12 @@ var BaseAddon = class {
|
|
|
6858
7256
|
async clearSecrets(keys, nodeId) {
|
|
6859
7257
|
const tree = this.addonSecretTree();
|
|
6860
7258
|
const keychain = this._ctx?.secrets !== void 0;
|
|
7259
|
+
const stored = keychain ? await this.readAddonStoreWithRetry() : {};
|
|
6861
7260
|
const patch = {};
|
|
6862
|
-
for (const key of keys)
|
|
7261
|
+
for (const key of keys) {
|
|
7262
|
+
const keychainStored = tree.has(key) || collectSecretMarkerRefs(stored[key]).length > 0;
|
|
7263
|
+
patch[key] = keychain && keychainStored ? SECRET_CLEAR : "";
|
|
7264
|
+
}
|
|
6863
7265
|
await this.applyGlobalPatch(patch, nodeId);
|
|
6864
7266
|
}
|
|
6865
7267
|
async applyGlobalPatch(barePatch, nodeId) {
|
|
@@ -6867,7 +7269,11 @@ var BaseAddon = class {
|
|
|
6867
7269
|
const localNode = normalizeNodeId(this._ctx?.kernel?.localNodeId);
|
|
6868
7270
|
const target = normalizeNodeId(nodeId ?? this._ctx?.kernel?.localNodeId);
|
|
6869
7271
|
const scoped = keys.size > 0 ? scopePatch(barePatch, keys, target) : barePatch;
|
|
6870
|
-
|
|
7272
|
+
const handle = this._secretSettings;
|
|
7273
|
+
if (handle !== null) {
|
|
7274
|
+
const { changed } = await handle.writeAddonStore(scoped);
|
|
7275
|
+
if (!changed) return;
|
|
7276
|
+
} else await this._ctx?.settings?.writeAddonStore(scoped);
|
|
6871
7277
|
if (target !== localNode) return;
|
|
6872
7278
|
await this.resolveConfig();
|
|
6873
7279
|
await this.onConfigChanged();
|
|
@@ -6920,7 +7326,7 @@ var BaseAddon = class {
|
|
|
6920
7326
|
async getDeviceSettings(deviceId) {
|
|
6921
7327
|
const schema = this.deviceSettingsSchema();
|
|
6922
7328
|
if (!schema) return { sections: [] };
|
|
6923
|
-
return hydrateSchema(schema, await this.
|
|
7329
|
+
return hydrateSchema(schema, await this.rawSettings()?.readDeviceStore(deviceId) ?? {}, { inlineSecretsAsViews: true });
|
|
6924
7330
|
}
|
|
6925
7331
|
async updateDeviceSettings(deviceId, patch) {
|
|
6926
7332
|
await this._ctx?.settings?.writeDeviceStore(deviceId, patch);
|
|
@@ -7092,7 +7498,7 @@ var BaseAddon = class {
|
|
|
7092
7498
|
key,
|
|
7093
7499
|
schema,
|
|
7094
7500
|
fallback,
|
|
7095
|
-
read: async () => this.resolveStoredSecrets(await this.
|
|
7501
|
+
read: async () => this.resolveStoredSecrets(await this.rawSettings()?.readDeviceStore(deviceId) ?? {}, false),
|
|
7096
7502
|
write: async (patch) => {
|
|
7097
7503
|
await this._ctx?.settings?.writeDeviceStore(deviceId, patch);
|
|
7098
7504
|
},
|
|
@@ -7154,6 +7560,23 @@ var BaseAddon = class {
|
|
|
7154
7560
|
}
|
|
7155
7561
|
return value;
|
|
7156
7562
|
}
|
|
7563
|
+
/**
|
|
7564
|
+
* The marker-bearing settings reads (D798) — private on purpose. Without a
|
|
7565
|
+
* keychain the context's own view is already raw.
|
|
7566
|
+
*/
|
|
7567
|
+
rawSettings() {
|
|
7568
|
+
return this._secretSettings?.raw ?? this._ctx?.settings;
|
|
7569
|
+
}
|
|
7570
|
+
/** An addon-facing read met markers it could not resolve: say so once per ref. */
|
|
7571
|
+
logUnresolvedRead(unresolved) {
|
|
7572
|
+
const fresh = unresolved.filter((u) => !this._loggedUnresolvedReads.has(u.ref));
|
|
7573
|
+
if (fresh.length === 0) return;
|
|
7574
|
+
for (const u of fresh) this._loggedUnresolvedReads.add(u.ref);
|
|
7575
|
+
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) => ({
|
|
7576
|
+
ref: u.ref,
|
|
7577
|
+
reason: u.reason
|
|
7578
|
+
})) } });
|
|
7579
|
+
}
|
|
7157
7580
|
/** Re-resolve the config (a keychain-only change, or a retry) and apply it. */
|
|
7158
7581
|
scheduleSecretReresolve(delayMs) {
|
|
7159
7582
|
const timerOf = delayMs === SECRET_CHANGE_DEBOUNCE_MS ? "_secretChangeTimer" : "_secretRetryTimer";
|
|
@@ -7180,7 +7603,7 @@ var BaseAddon = class {
|
|
|
7180
7603
|
* `{}` (defaults) — the addon's first successful patch will rehydrate.
|
|
7181
7604
|
*/
|
|
7182
7605
|
async readAddonStoreWithRetry() {
|
|
7183
|
-
const settings = this.
|
|
7606
|
+
const settings = this.rawSettings();
|
|
7184
7607
|
if (!settings) return {};
|
|
7185
7608
|
const delaysMs = [
|
|
7186
7609
|
150,
|
|
@@ -9574,6 +9997,278 @@ var DERIVED_CAMERA_SILENCED_CAP_NAMES = [
|
|
|
9574
9997
|
"scene-monitor"
|
|
9575
9998
|
];
|
|
9576
9999
|
/**
|
|
10000
|
+
* The trainer contract — what the hub hands the cloud trainer and what it
|
|
10001
|
+
* gets back (cloud training, D805+).
|
|
10002
|
+
*
|
|
10003
|
+
* The trainer (`hf/camstack-trainer`, published as the Hugging Face repo
|
|
10004
|
+
* `camstack/camstack-trainer`) is a separate AGPL program the hub never
|
|
10005
|
+
* imports: `job.json` goes in, files come out, and progress is `CAMSTACK_EVENT`
|
|
10006
|
+
* lines on stdout. These schemas are the hub's half of that boundary; the
|
|
10007
|
+
* trainer's pydantic models (and the JSON Schemas generated from them under
|
|
10008
|
+
* `hf/camstack-trainer/schemas/`) are the other half. A change here is a
|
|
10009
|
+
* change there, in the same piece of work.
|
|
10010
|
+
*
|
|
10011
|
+
* No `.default()` anywhere: defaults do not run on the addon cap path, so the
|
|
10012
|
+
* orchestrator fills every field of a job spec explicitly.
|
|
10013
|
+
*/
|
|
10014
|
+
var TRAINING_JOB_SCHEMA = "camstack.training/v1";
|
|
10015
|
+
var TRAINING_RESULT_SCHEMA = "camstack.training-result/v1";
|
|
10016
|
+
/** What the trainer can export. Edge TPU is a later, separate image. */
|
|
10017
|
+
var TrainingExportSchema = _enum([
|
|
10018
|
+
"onnx",
|
|
10019
|
+
"openvino-fp16",
|
|
10020
|
+
"openvino-int8",
|
|
10021
|
+
"coreml-fp16"
|
|
10022
|
+
]);
|
|
10023
|
+
var FloorsSchema = record(string(), number().min(0).max(1));
|
|
10024
|
+
object({
|
|
10025
|
+
schema: literal(TRAINING_JOB_SCHEMA),
|
|
10026
|
+
jobKey: string().uuid(),
|
|
10027
|
+
target: object({
|
|
10028
|
+
kind: literal("detector"),
|
|
10029
|
+
step: literal("object-detection")
|
|
10030
|
+
}),
|
|
10031
|
+
base: object({
|
|
10032
|
+
modelId: string().min(1),
|
|
10033
|
+
/** Ultralytics weights id, e.g. `yolov9m.pt`. */
|
|
10034
|
+
weights: string().min(1),
|
|
10035
|
+
imgsz: number().int().positive()
|
|
10036
|
+
}),
|
|
10037
|
+
baseline: object({
|
|
10038
|
+
modelId: string().min(1),
|
|
10039
|
+
/** The baseline ONNX the holdout comparison runs; public mirror URL. */
|
|
10040
|
+
onnxUrl: string().url(),
|
|
10041
|
+
imgsz: number().int().positive(),
|
|
10042
|
+
floors: FloorsSchema
|
|
10043
|
+
}),
|
|
10044
|
+
dataset: object({
|
|
10045
|
+
versionId: string().min(1),
|
|
10046
|
+
annotationHash: string(),
|
|
10047
|
+
/** sha256 of the uploaded archive; the trainer refuses a mismatch (exit 65). */
|
|
10048
|
+
sha256: string().regex(/^[0-9a-f]{64}$/)
|
|
10049
|
+
}),
|
|
10050
|
+
split: object({
|
|
10051
|
+
holdoutCameras: array(number().int()),
|
|
10052
|
+
/** When no camera is held out: the last N days of every camera. */
|
|
10053
|
+
holdoutLastDays: number().int().nonnegative(),
|
|
10054
|
+
valFraction: number().min(0).max(.5),
|
|
10055
|
+
seed: number().int()
|
|
10056
|
+
}),
|
|
10057
|
+
hyper: object({
|
|
10058
|
+
epochs: number().int().positive(),
|
|
10059
|
+
batch: number().int().positive(),
|
|
10060
|
+
lr0: number().positive(),
|
|
10061
|
+
/** Layers frozen from the start of the backbone; 0 = none. */
|
|
10062
|
+
freeze: number().int().nonnegative(),
|
|
10063
|
+
patience: number().int().nonnegative(),
|
|
10064
|
+
seed: number().int()
|
|
10065
|
+
}),
|
|
10066
|
+
replay: object({
|
|
10067
|
+
source: literal("coco2017"),
|
|
10068
|
+
count: number().int().nonnegative()
|
|
10069
|
+
}),
|
|
10070
|
+
exports: array(TrainingExportSchema).min(1),
|
|
10071
|
+
calibration: object({ maxFrames: number().int().positive() }),
|
|
10072
|
+
floors: object({
|
|
10073
|
+
minSupport: number().int().positive(),
|
|
10074
|
+
clamp: number().min(0).max(1)
|
|
10075
|
+
}),
|
|
10076
|
+
int8Gate: object({ maxMap50Drop: number().min(0).max(1) }),
|
|
10077
|
+
catalog: object({
|
|
10078
|
+
id: string().regex(/^[a-z0-9][a-z0-9-]{2,80}$/),
|
|
10079
|
+
name: string().min(1).max(160)
|
|
10080
|
+
})
|
|
10081
|
+
});
|
|
10082
|
+
/** One regular file of the bundle. An mlpackage contributes one row per member. */
|
|
10083
|
+
var TrainingResultFileSchema = object({
|
|
10084
|
+
path: string().min(1),
|
|
10085
|
+
bytes: number().int().nonnegative(),
|
|
10086
|
+
sha256: string().regex(/^[0-9a-f]{64}$/),
|
|
10087
|
+
format: _enum([
|
|
10088
|
+
"onnx",
|
|
10089
|
+
"openvino",
|
|
10090
|
+
"coreml",
|
|
10091
|
+
"pt"
|
|
10092
|
+
]),
|
|
10093
|
+
variant: _enum(["base", "int8"])
|
|
10094
|
+
});
|
|
10095
|
+
var DraftFormatSchema = object({
|
|
10096
|
+
/** RELATIVE path inside the bundle; the hub rewrites it to `camstack-local://`. */
|
|
10097
|
+
url: string().min(1),
|
|
10098
|
+
sizeMB: number().nonnegative(),
|
|
10099
|
+
isDirectory: boolean().optional(),
|
|
10100
|
+
files: array(string()).optional(),
|
|
10101
|
+
runtimes: array(literal("python")).optional(),
|
|
10102
|
+
revision: string().min(1)
|
|
10103
|
+
});
|
|
10104
|
+
/** The trainer's half of a catalog entry; the hub completes it (labels, licence, group). */
|
|
10105
|
+
var TrainingCatalogDraftSchema = object({
|
|
10106
|
+
id: string().min(1),
|
|
10107
|
+
name: string().min(1),
|
|
10108
|
+
description: string(),
|
|
10109
|
+
labels: array(unknown()),
|
|
10110
|
+
inputSize: object({
|
|
10111
|
+
width: number().int().positive(),
|
|
10112
|
+
height: number().int().positive()
|
|
10113
|
+
}),
|
|
10114
|
+
preprocessMode: literal("letterbox"),
|
|
10115
|
+
defaultClassFloors: FloorsSchema,
|
|
10116
|
+
formats: object({
|
|
10117
|
+
onnx: DraftFormatSchema.optional(),
|
|
10118
|
+
openvino: DraftFormatSchema.optional(),
|
|
10119
|
+
coreml: DraftFormatSchema.optional()
|
|
10120
|
+
})
|
|
10121
|
+
});
|
|
10122
|
+
/** One class of one model's holdout report (the eval harness's summary). */
|
|
10123
|
+
var TrainingEvalClassSchema = object({
|
|
10124
|
+
positives: number().int(),
|
|
10125
|
+
floor: number().nullable(),
|
|
10126
|
+
tp: number().int(),
|
|
10127
|
+
fp: number().int(),
|
|
10128
|
+
fn: number().int(),
|
|
10129
|
+
precision: number().nullable(),
|
|
10130
|
+
recall: number().nullable(),
|
|
10131
|
+
ap50: number().nullable(),
|
|
10132
|
+
recallByCamera: record(string(), number().nullable()).optional(),
|
|
10133
|
+
recallByLight: record(string(), number().nullable()).optional(),
|
|
10134
|
+
fpByCamera: record(string(), number()).optional(),
|
|
10135
|
+
smallFound: number().int().optional(),
|
|
10136
|
+
smallTotal: number().int().optional()
|
|
10137
|
+
}).passthrough();
|
|
10138
|
+
var TrainingEvalReportSchema = object({
|
|
10139
|
+
frames: number().int(),
|
|
10140
|
+
classes: record(string(), TrainingEvalClassSchema)
|
|
10141
|
+
}).passthrough();
|
|
10142
|
+
/**
|
|
10143
|
+
* A succeeded result carries every block; a failed one carries the error and
|
|
10144
|
+
* whatever was known by then — the other blocks are ABSENT, not null. The
|
|
10145
|
+
* orchestrator checks the blocks it needs before it trusts a success.
|
|
10146
|
+
*/
|
|
10147
|
+
var TrainingResultSchema = object({
|
|
10148
|
+
schema: literal(TRAINING_RESULT_SCHEMA),
|
|
10149
|
+
jobKey: string(),
|
|
10150
|
+
status: _enum(["succeeded", "failed"]),
|
|
10151
|
+
error: object({
|
|
10152
|
+
stage: string(),
|
|
10153
|
+
code: string(),
|
|
10154
|
+
message: string()
|
|
10155
|
+
}).nullable(),
|
|
10156
|
+
trainer: object({
|
|
10157
|
+
version: string(),
|
|
10158
|
+
revision: string()
|
|
10159
|
+
}),
|
|
10160
|
+
toolchain: record(string(), string().nullable()),
|
|
10161
|
+
dataset: object({
|
|
10162
|
+
versionId: string(),
|
|
10163
|
+
annotationHash: string(),
|
|
10164
|
+
sha256: string(),
|
|
10165
|
+
frames: object({
|
|
10166
|
+
train: number().int(),
|
|
10167
|
+
val: number().int(),
|
|
10168
|
+
holdout: number().int()
|
|
10169
|
+
}),
|
|
10170
|
+
holdoutCameras: array(number().int()),
|
|
10171
|
+
replayImages: number().int()
|
|
10172
|
+
}).optional(),
|
|
10173
|
+
training: object({
|
|
10174
|
+
epochsRun: number().int(),
|
|
10175
|
+
bestEpoch: number().int(),
|
|
10176
|
+
bestMap50: number(),
|
|
10177
|
+
bestMap50_95: number(),
|
|
10178
|
+
seconds: number()
|
|
10179
|
+
}).optional(),
|
|
10180
|
+
evaluation: object({
|
|
10181
|
+
holdoutFrames: number().int(),
|
|
10182
|
+
baseline: TrainingEvalReportSchema.nullable(),
|
|
10183
|
+
candidate: TrainingEvalReportSchema.nullable(),
|
|
10184
|
+
candidateInt8: TrainingEvalReportSchema.nullable(),
|
|
10185
|
+
recallDeltaByCamera: record(string(), record(string(), number())).nullable(),
|
|
10186
|
+
map50: record(string(), number().nullable())
|
|
10187
|
+
}).optional(),
|
|
10188
|
+
floors: object({
|
|
10189
|
+
baseline: FloorsSchema,
|
|
10190
|
+
candidate: FloorsSchema,
|
|
10191
|
+
candidateInt8: FloorsSchema.nullable(),
|
|
10192
|
+
notes: array(string())
|
|
10193
|
+
}).optional(),
|
|
10194
|
+
int8: object({
|
|
10195
|
+
kept: boolean(),
|
|
10196
|
+
map50Fp16: number().nullable(),
|
|
10197
|
+
map50Int8: number().nullable(),
|
|
10198
|
+
reason: string().nullable()
|
|
10199
|
+
}).optional(),
|
|
10200
|
+
exportsDropped: array(object({
|
|
10201
|
+
export: string(),
|
|
10202
|
+
reason: string()
|
|
10203
|
+
})).optional(),
|
|
10204
|
+
files: array(TrainingResultFileSchema).optional(),
|
|
10205
|
+
bundle: object({
|
|
10206
|
+
path: literal("bundle.tar"),
|
|
10207
|
+
bytes: number().int().nonnegative(),
|
|
10208
|
+
sha256: string().regex(/^[0-9a-f]{64}$/)
|
|
10209
|
+
}).nullable().optional(),
|
|
10210
|
+
catalogDraft: object({
|
|
10211
|
+
base: TrainingCatalogDraftSchema,
|
|
10212
|
+
int8: TrainingCatalogDraftSchema.nullable()
|
|
10213
|
+
}).nullable().optional(),
|
|
10214
|
+
licence: string()
|
|
10215
|
+
});
|
|
10216
|
+
var TrainingStageSchema = _enum([
|
|
10217
|
+
"prepare",
|
|
10218
|
+
"replay",
|
|
10219
|
+
"train",
|
|
10220
|
+
"eval",
|
|
10221
|
+
"export",
|
|
10222
|
+
"package"
|
|
10223
|
+
]);
|
|
10224
|
+
var EventBase = {
|
|
10225
|
+
v: literal(1),
|
|
10226
|
+
ts: number()
|
|
10227
|
+
};
|
|
10228
|
+
discriminatedUnion("type", [
|
|
10229
|
+
object({
|
|
10230
|
+
...EventBase,
|
|
10231
|
+
type: literal("stage"),
|
|
10232
|
+
stage: TrainingStageSchema
|
|
10233
|
+
}),
|
|
10234
|
+
object({
|
|
10235
|
+
...EventBase,
|
|
10236
|
+
type: literal("epoch"),
|
|
10237
|
+
epoch: number().int(),
|
|
10238
|
+
epochs: number().int(),
|
|
10239
|
+
boxLoss: number().nullable().optional(),
|
|
10240
|
+
map50: number().nullable().optional(),
|
|
10241
|
+
map50_95: number().nullable().optional(),
|
|
10242
|
+
etaSec: number().nullable().optional()
|
|
10243
|
+
}),
|
|
10244
|
+
object({
|
|
10245
|
+
...EventBase,
|
|
10246
|
+
type: literal("metric"),
|
|
10247
|
+
name: string(),
|
|
10248
|
+
value: number()
|
|
10249
|
+
}),
|
|
10250
|
+
object({
|
|
10251
|
+
...EventBase,
|
|
10252
|
+
type: literal("artifact"),
|
|
10253
|
+
path: string(),
|
|
10254
|
+
bytes: number(),
|
|
10255
|
+
sha256: string()
|
|
10256
|
+
}),
|
|
10257
|
+
object({
|
|
10258
|
+
...EventBase,
|
|
10259
|
+
type: literal("done"),
|
|
10260
|
+
status: _enum(["succeeded", "failed"]),
|
|
10261
|
+
resultSha256: string().nullable().optional()
|
|
10262
|
+
}),
|
|
10263
|
+
object({
|
|
10264
|
+
...EventBase,
|
|
10265
|
+
type: literal("error"),
|
|
10266
|
+
stage: string(),
|
|
10267
|
+
code: string(),
|
|
10268
|
+
message: string()
|
|
10269
|
+
})
|
|
10270
|
+
]);
|
|
10271
|
+
/**
|
|
9577
10272
|
* What the gate decided about a birth, from the CALLER's point of view.
|
|
9578
10273
|
*
|
|
9579
10274
|
* Deliberately not `ConfirmationVerdict`: `undecided` is not a birth decision
|
|
@@ -11901,7 +12596,9 @@ var AddonHttpRouteSchema = object({
|
|
|
11901
12596
|
"authenticated",
|
|
11902
12597
|
"admin"
|
|
11903
12598
|
]).optional(),
|
|
11904
|
-
description: string().optional()
|
|
12599
|
+
description: string().optional(),
|
|
12600
|
+
/** The hub limits this route per client address before the handler runs. */
|
|
12601
|
+
rateLimit: _enum(["auth"]).optional()
|
|
11905
12602
|
});
|
|
11906
12603
|
/**
|
|
11907
12604
|
* Cross-process route invocation envelope. The hub captures the
|
|
@@ -12606,6 +13303,37 @@ var BackupDestinationInfoSchema = object({
|
|
|
12606
13303
|
lastError: string().optional()
|
|
12607
13304
|
});
|
|
12608
13305
|
/**
|
|
13306
|
+
* How an archive is encrypted (operator decision 2026-10-09): to a backup
|
|
13307
|
+
* PUBLIC key the hub holds, so only the operator's secret key opens it.
|
|
13308
|
+
* Absent on a plain `.tar.gz` — every archive made before encryption, or
|
|
13309
|
+
* with it off — which restores without a key.
|
|
13310
|
+
*/
|
|
13311
|
+
var BackupArchiveEncryptionSchema = object({
|
|
13312
|
+
/** `x25519-hkdf-aes256gcm-stream-v1`. */
|
|
13313
|
+
scheme: string(),
|
|
13314
|
+
/** 16 hex — the backup key whose secret restores this archive. */
|
|
13315
|
+
keyId: string()
|
|
13316
|
+
});
|
|
13317
|
+
/**
|
|
13318
|
+
* The backup encryption setting. The hub keeps PUBLIC keys only: the active
|
|
13319
|
+
* one new archives are encrypted to, and the retired ones older archives
|
|
13320
|
+
* still need. The secret key is shown once, at `setupEncryption`.
|
|
13321
|
+
*/
|
|
13322
|
+
var BackupEncryptionStatusSchema = object({
|
|
13323
|
+
enabled: boolean(),
|
|
13324
|
+
active: object({
|
|
13325
|
+
keyId: string(),
|
|
13326
|
+
publicKey: string(),
|
|
13327
|
+
createdAt: number()
|
|
13328
|
+
}).nullable(),
|
|
13329
|
+
/** Every key ever set up, newest first. */
|
|
13330
|
+
keys: array(object({
|
|
13331
|
+
keyId: string(),
|
|
13332
|
+
createdAt: number(),
|
|
13333
|
+
retiredAt: number().nullable()
|
|
13334
|
+
})).readonly()
|
|
13335
|
+
});
|
|
13336
|
+
/**
|
|
12609
13337
|
* Per-archive entry returned by `backup.listArchives({ destinationId })`.
|
|
12610
13338
|
* Same shape the destination drill-in renders. Sourced from the per-
|
|
12611
13339
|
* location `manifests.json` (no per-archive tarball read required).
|
|
@@ -12617,7 +13345,9 @@ var BackupArchiveEntrySchema = object({
|
|
|
12617
13345
|
sizeBytes: number(),
|
|
12618
13346
|
label: string().optional(),
|
|
12619
13347
|
/** Top-level locations included in the archive (db, addons, tls, …). */
|
|
12620
|
-
locations: array(string()).readonly()
|
|
13348
|
+
locations: array(string()).readonly(),
|
|
13349
|
+
/** Present when the archive is encrypted; restore then needs that key. */
|
|
13350
|
+
encryption: BackupArchiveEncryptionSchema.optional()
|
|
12621
13351
|
});
|
|
12622
13352
|
var BackupEntrySchema = object({
|
|
12623
13353
|
id: string(),
|
|
@@ -12626,7 +13356,8 @@ var BackupEntrySchema = object({
|
|
|
12626
13356
|
label: string().optional(),
|
|
12627
13357
|
createdAt: number(),
|
|
12628
13358
|
sizeBytes: number(),
|
|
12629
|
-
locations: array(string()).optional()
|
|
13359
|
+
locations: array(string()).optional(),
|
|
13360
|
+
encryption: BackupArchiveEncryptionSchema.optional()
|
|
12630
13361
|
});
|
|
12631
13362
|
var ArchiveEntrySchema = object({
|
|
12632
13363
|
path: string(),
|
|
@@ -12815,10 +13546,40 @@ method(_void(), array(BackupDestinationInfoSchema).readonly(), { auth: "admin" }
|
|
|
12815
13546
|
* this list and skips entries whose path doesn't start with
|
|
12816
13547
|
* any of them.
|
|
12817
13548
|
*/
|
|
12818
|
-
locations: array(string()).optional()
|
|
13549
|
+
locations: array(string()).optional(),
|
|
13550
|
+
/**
|
|
13551
|
+
* The backup SECRET key, for an encrypted archive (ignored for a plain
|
|
13552
|
+
* one). The archive is decrypted into the hub's private staging
|
|
13553
|
+
* before the restart; the key is not stored. A wrong or missing key
|
|
13554
|
+
* is refused before the archive is downloaded.
|
|
13555
|
+
*/
|
|
13556
|
+
backupSecretKey: string().optional()
|
|
12819
13557
|
}), _void(), {
|
|
12820
13558
|
kind: "mutation",
|
|
12821
13559
|
auth: "admin"
|
|
13560
|
+
}), method(_void(), BackupEncryptionStatusSchema, { auth: "admin" }), method(object({}), object({
|
|
13561
|
+
keyId: string(),
|
|
13562
|
+
secretKey: string(),
|
|
13563
|
+
publicKey: string(),
|
|
13564
|
+
createdAt: number(),
|
|
13565
|
+
replacedKeyId: string().nullable()
|
|
13566
|
+
}), {
|
|
13567
|
+
kind: "mutation",
|
|
13568
|
+
auth: "admin"
|
|
13569
|
+
}), method(object({}), object({ disabledKeyId: string().nullable() }), {
|
|
13570
|
+
kind: "mutation",
|
|
13571
|
+
auth: "admin"
|
|
13572
|
+
}), method(object({ backupSecretKey: string() }), object({
|
|
13573
|
+
valid: boolean(),
|
|
13574
|
+
keyId: string().nullable(),
|
|
13575
|
+
/** The hub knows this key (active or retired). */
|
|
13576
|
+
known: boolean(),
|
|
13577
|
+
/** It is the key new archives are encrypted to. */
|
|
13578
|
+
active: boolean(),
|
|
13579
|
+
error: string().optional()
|
|
13580
|
+
}), {
|
|
13581
|
+
kind: "mutation",
|
|
13582
|
+
auth: "admin"
|
|
12822
13583
|
}), method(object({
|
|
12823
13584
|
destinationId: string(),
|
|
12824
13585
|
backupId: string()
|
|
@@ -14544,7 +15305,60 @@ var CustomModelDescriptorSchema = object({
|
|
|
14544
15305
|
stepId: string(),
|
|
14545
15306
|
entry: ModelCatalogEntrySchema
|
|
14546
15307
|
});
|
|
14547
|
-
|
|
15308
|
+
/** One regular file of an imported bundle, as the producer measured it. */
|
|
15309
|
+
var ModelBundleFileSchema = object({
|
|
15310
|
+
/** Relative path inside the bundle tar; an mlpackage member is `<x>.mlpackage/<member>`. */
|
|
15311
|
+
path: string().min(1),
|
|
15312
|
+
bytes: number().int().nonnegative(),
|
|
15313
|
+
sha256: string().regex(/^[0-9a-f]{64}$/)
|
|
15314
|
+
});
|
|
15315
|
+
var ImportModelBundleInputSchema = object({
|
|
15316
|
+
/** The registry provider that keeps the model (Model Studio). */
|
|
15317
|
+
addonId: string(),
|
|
15318
|
+
stepId: string().min(1),
|
|
15319
|
+
/**
|
|
15320
|
+
* The catalog rows to register, complete, every format URL already
|
|
15321
|
+
* `camstack-local://<modelId>/<file>` naming a file of the bundle. One
|
|
15322
|
+
* bundle may carry several rows (a base and its INT8 variant).
|
|
15323
|
+
*/
|
|
15324
|
+
entries: array(ModelCatalogEntrySchema).min(1).max(4),
|
|
15325
|
+
/** The bundle tar, offered by the producer over `ctx.peerBytes` (same host). */
|
|
15326
|
+
bundle: object({
|
|
15327
|
+
ticket: PeerBytesTicketSchema,
|
|
15328
|
+
bytes: number().int().positive(),
|
|
15329
|
+
sha256: string().regex(/^[0-9a-f]{64}$/)
|
|
15330
|
+
}),
|
|
15331
|
+
/** Every file the tar must hold; anything missing, extra or different is refused. */
|
|
15332
|
+
files: array(ModelBundleFileSchema).min(1).max(64),
|
|
15333
|
+
/** Convert missing engine formats and push the model to every agent afterwards. */
|
|
15334
|
+
distribute: boolean()
|
|
15335
|
+
});
|
|
15336
|
+
var ImportModelBundleResultSchema = discriminatedUnion("kind", [object({
|
|
15337
|
+
kind: literal("imported"),
|
|
15338
|
+
modelIds: array(string()).readonly(),
|
|
15339
|
+
distributed: array(object({
|
|
15340
|
+
modelId: string(),
|
|
15341
|
+
nodeId: string(),
|
|
15342
|
+
format: _enum(MODEL_FORMATS),
|
|
15343
|
+
ok: boolean(),
|
|
15344
|
+
error: string().optional()
|
|
15345
|
+
})).readonly()
|
|
15346
|
+
}), object({
|
|
15347
|
+
kind: literal("refused"),
|
|
15348
|
+
reason: _enum([
|
|
15349
|
+
"transfer-failed",
|
|
15350
|
+
"checksum-mismatch",
|
|
15351
|
+
"bundle-mismatch",
|
|
15352
|
+
"invalid-entry",
|
|
15353
|
+
"id-taken"
|
|
15354
|
+
]),
|
|
15355
|
+
detail: string()
|
|
15356
|
+
})]);
|
|
15357
|
+
method(_void(), array(CustomModelDescriptorSchema).readonly(), { auth: "admin" }), method(ImportModelBundleInputSchema, ImportModelBundleResultSchema, {
|
|
15358
|
+
kind: "mutation",
|
|
15359
|
+
auth: "admin",
|
|
15360
|
+
timeoutMs: 30 * 6e4
|
|
15361
|
+
});
|
|
14548
15362
|
/**
|
|
14549
15363
|
* Query filter for settings-store collections.
|
|
14550
15364
|
*/
|
|
@@ -15023,6 +15837,35 @@ var KeychainKeySourceSchema = object({
|
|
|
15023
15837
|
*/
|
|
15024
15838
|
sharesBackupWithDatabase: boolean()
|
|
15025
15839
|
});
|
|
15840
|
+
/**
|
|
15841
|
+
* One keychain reset, as the Secrets page reports it until the operator
|
|
15842
|
+
* acknowledges it. Never a value: refs, counts and table names only.
|
|
15843
|
+
*/
|
|
15844
|
+
var KeychainResetRecordSchema = object({
|
|
15845
|
+
id: string(),
|
|
15846
|
+
at: number(),
|
|
15847
|
+
/** `user:<id>` or {@link KEYCHAIN_RESET_TRIGGER_ACTOR}. */
|
|
15848
|
+
actor: string(),
|
|
15849
|
+
/** Why the keychain was locked when it was reset; `null` when it was not locked. */
|
|
15850
|
+
lockedReason: string().nullable(),
|
|
15851
|
+
/** Values moved into the archive table (ciphertext under the lost key). */
|
|
15852
|
+
archived: number().int(),
|
|
15853
|
+
/** `keychain:secrets-orphaned-<ts>`, or `null` when nothing was stored. */
|
|
15854
|
+
archivedCollection: string().nullable(),
|
|
15855
|
+
/**
|
|
15856
|
+
* `keychain:keys-orphaned-<ts>`: the wrapped data keys of the archive, kept
|
|
15857
|
+
* so the archive can still be opened if the lost master key turns up.
|
|
15858
|
+
*/
|
|
15859
|
+
archivedKeysCollection: string().nullable(),
|
|
15860
|
+
/**
|
|
15861
|
+
* `system-settings` keys whose marker the reset cleared — the cluster
|
|
15862
|
+
* secret's: a marker left pointing at an archived value would refuse every
|
|
15863
|
+
* agent forever (D797).
|
|
15864
|
+
*/
|
|
15865
|
+
clearedSettingsKeys: array(string()).readonly(),
|
|
15866
|
+
/** When an operator dismissed the notice on the Secrets page; `null` until then. */
|
|
15867
|
+
acknowledgedAt: number().nullable()
|
|
15868
|
+
});
|
|
15026
15869
|
var KeychainStatusSchema = object({
|
|
15027
15870
|
keychain: KeychainStateSchema,
|
|
15028
15871
|
/** The source of the master key in use; `null` while locked. */
|
|
@@ -15040,7 +15883,9 @@ var KeychainStatusSchema = object({
|
|
|
15040
15883
|
/** Wrapped copies of the data key under a previous master key, kept until purged. */
|
|
15041
15884
|
retiredWraps: number().int(),
|
|
15042
15885
|
recoveryKeyDownloadedAt: number().nullable(),
|
|
15043
|
-
secretCount: number().int()
|
|
15886
|
+
secretCount: number().int(),
|
|
15887
|
+
/** The most recent reset, acknowledged or not; `null` when the keychain was never reset. */
|
|
15888
|
+
lastReset: KeychainResetRecordSchema.nullable()
|
|
15044
15889
|
});
|
|
15045
15890
|
/**
|
|
15046
15891
|
* Whether a stored value is still pointed at by its owner's settings.
|
|
@@ -15062,13 +15907,14 @@ var KeychainAuditActionSchema = _enum([
|
|
|
15062
15907
|
"download-recovery-key",
|
|
15063
15908
|
"delete-orphans",
|
|
15064
15909
|
"reset",
|
|
15910
|
+
"acknowledge-reset",
|
|
15065
15911
|
"initialize"
|
|
15066
15912
|
]);
|
|
15067
15913
|
var KeychainAuditEntrySchema = object({
|
|
15068
15914
|
id: string(),
|
|
15069
15915
|
at: number(),
|
|
15070
15916
|
action: KeychainAuditActionSchema,
|
|
15071
|
-
/** `addon:<id>` | `user:<id>` | `system`. */
|
|
15917
|
+
/** `addon:<id>` | `user:<id>` | `system` | `trigger-file`. */
|
|
15072
15918
|
actor: string(),
|
|
15073
15919
|
ref: string().nullable(),
|
|
15074
15920
|
detail: string().nullable()
|
|
@@ -15134,6 +15980,13 @@ method(object({}), KeychainStatusSchema, { auth: "admin" }), method(object({}),
|
|
|
15134
15980
|
kind: "mutation",
|
|
15135
15981
|
auth: "admin",
|
|
15136
15982
|
caller: "required"
|
|
15983
|
+
}), method(object({}), object({
|
|
15984
|
+
reset: KeychainResetRecordSchema.nullable(),
|
|
15985
|
+
pendingReentry: array(KeychainSecretMetaSchema).readonly()
|
|
15986
|
+
}), { auth: "admin" }), method(object({}), object({ acknowledged: boolean() }), {
|
|
15987
|
+
kind: "mutation",
|
|
15988
|
+
auth: "admin",
|
|
15989
|
+
caller: "required"
|
|
15137
15990
|
});
|
|
15138
15991
|
method(_void(), object({
|
|
15139
15992
|
id: string(),
|
|
@@ -17886,7 +18739,7 @@ method(LogEntrySchema, _void(), { kind: "mutation" }), method(object({
|
|
|
17886
18739
|
* `login-method` — collection cap through which auth addons contribute
|
|
17887
18740
|
* their pre-auth login surfaces to the login page. This is the SINGLE,
|
|
17888
18741
|
* generic mechanism that supersedes the dead `auth.listProviders` reader:
|
|
17889
|
-
* every auth addon (OIDC,
|
|
18742
|
+
* every auth addon (OIDC, WebAuthn/passkey) registers a
|
|
17890
18743
|
* `login-method` provider and the PUBLIC `auth.listLoginMethods`
|
|
17891
18744
|
* procedure aggregates them for the unauthenticated login page.
|
|
17892
18745
|
*
|
|
@@ -17894,8 +18747,7 @@ method(LogEntrySchema, _void(), { kind: "mutation" }), method(object({
|
|
|
17894
18747
|
*
|
|
17895
18748
|
* - `redirect` — a declarative button. The login page renders a generic
|
|
17896
18749
|
* button that navigates to `startUrl` (an addon-owned HTTP route).
|
|
17897
|
-
* Covers OIDC (`/addon/auth-oidc/<id>/start`)
|
|
17898
|
-
* ZERO shell-side JS. A future SSO addon plugs in the same way — the
|
|
18750
|
+
* Covers OIDC (`/addon/auth-oidc/<id>/start`) with ZERO shell-side JS. A future SSO addon plugs in the same way — the
|
|
17899
18751
|
* login page needs NO change.
|
|
17900
18752
|
*
|
|
17901
18753
|
* - `widget` — a Module-Federation widget the login page mounts (via
|
|
@@ -17914,8 +18766,8 @@ method(LogEntrySchema, _void(), { kind: "mutation" }), method(object({
|
|
|
17914
18766
|
* decision.
|
|
17915
18767
|
*
|
|
17916
18768
|
* Every contribution carries a `stage`:
|
|
17917
|
-
* - `primary` — shown on the first credentials screen (OIDC
|
|
17918
|
-
*
|
|
18769
|
+
* - `primary` — shown on the first credentials screen (OIDC
|
|
18770
|
+
* buttons; a usernameless passkey).
|
|
17919
18771
|
* - `second-factor` — shown AFTER the password leg, gated on the
|
|
17920
18772
|
* returned `factors` (passkey-as-2FA today).
|
|
17921
18773
|
*
|
|
@@ -17942,7 +18794,7 @@ var LoginMethodContributionSchema = discriminatedUnion("kind", [
|
|
|
17942
18794
|
* The provider names an external identity a signed-in user can link to
|
|
17943
18795
|
* their own account (D782): `auth.listLinkableProviders` /
|
|
17944
18796
|
* `beginExternalLink` offer exactly the redirect methods that set this,
|
|
17945
|
-
* whatever their id. Absent / false — a login button only
|
|
18797
|
+
* whatever their id. Absent / false — a login button only.
|
|
17946
18798
|
*/
|
|
17947
18799
|
linkable: boolean().optional()
|
|
17948
18800
|
}),
|
|
@@ -21797,8 +22649,7 @@ method(object({}), object({ rules: array(NcRuleSchema) }), { auth: "admin" }), m
|
|
|
21797
22649
|
* `super_admin` — collapsed onto the single boolean because every
|
|
21798
22650
|
* non-admin caller is governed by the same scope-check rules; the
|
|
21799
22651
|
* distinction was only ever used to route role-specific procedures
|
|
21800
|
-
* which we no longer have.
|
|
21801
|
-
* `createServiceToken`; CLI / webhook integrations are `cst_*` tokens
|
|
22652
|
+
* which we no longer have. CLI / webhook integrations are `cst_*` tokens
|
|
21802
22653
|
* with `isAdmin: false` + an explicit scope list.
|
|
21803
22654
|
*/
|
|
21804
22655
|
/** Per-method access flavour. Materialised on every cap method via codegen. */
|
|
@@ -24493,6 +25344,17 @@ DeviceType.Camera, method(object({ deviceId: number() }), array(TrackSchema).rea
|
|
|
24493
25344
|
kind: "mutation",
|
|
24494
25345
|
auth: "admin",
|
|
24495
25346
|
timeoutMs: 60 * 6e4
|
|
25347
|
+
}), method(object({
|
|
25348
|
+
filter: RetrainExportFilterSchema,
|
|
25349
|
+
layout: RetrainExportLayoutSchema
|
|
25350
|
+
}), object({
|
|
25351
|
+
ticket: PeerBytesTicketSchema,
|
|
25352
|
+
frames: number().int(),
|
|
25353
|
+
annotations: number().int()
|
|
25354
|
+
}), {
|
|
25355
|
+
kind: "mutation",
|
|
25356
|
+
auth: "admin",
|
|
25357
|
+
timeoutMs: 12e4
|
|
24496
25358
|
}), method(object({
|
|
24497
25359
|
selection: RetrainDatasetSelectionSchema,
|
|
24498
25360
|
completeOnly: boolean().optional()
|
|
@@ -28101,8 +28963,8 @@ version: string().optional() }), ServerUpdateActionResultSchema, {
|
|
|
28101
28963
|
* `smtp-provider` — pluggable email delivery surface.
|
|
28102
28964
|
*
|
|
28103
28965
|
* Collection cap: a deployment may install multiple SMTP relays (e.g.
|
|
28104
|
-
* one for transactional / one for notifications). Consumers (
|
|
28105
|
-
*
|
|
28966
|
+
* one for transactional / one for notifications). Consumers (notifier
|
|
28967
|
+
* addons, …) walk the collection and pick the first
|
|
28106
28968
|
* ready provider OR target a specific addonId.
|
|
28107
28969
|
*
|
|
28108
28970
|
* The shape stays small on purpose — `sendEmail` is enough for the
|
|
@@ -28385,7 +29247,7 @@ targets: array(object({
|
|
|
28385
29247
|
};
|
|
28386
29248
|
/**
|
|
28387
29249
|
* `sso-bridge` — internal hub-only cap that lets SSO-style auth
|
|
28388
|
-
* providers (OIDC, SAML,
|
|
29250
|
+
* providers (OIDC, SAML, …) mint an HMAC-signed token
|
|
28389
29251
|
* carrying the post-callback claims before redirecting back to
|
|
28390
29252
|
* `/api/auth/sso/finish`.
|
|
28391
29253
|
*
|
|
@@ -28448,7 +29310,14 @@ var SsoBridgeClaimsSchema = object({
|
|
|
28448
29310
|
* Verified `iss` of the id_token behind an OIDC login bridge (D782). A
|
|
28449
29311
|
* subject is unique only per issuer, so a link is bound to it.
|
|
28450
29312
|
*/
|
|
28451
|
-
issuer: string().optional()
|
|
29313
|
+
issuer: string().optional(),
|
|
29314
|
+
/**
|
|
29315
|
+
* SHA-256 (hex) of the `camstack_sso_state` cookie the IdP `/start` set in
|
|
29316
|
+
* the browser that began this sign-in. `/api/auth/sso/finish` requires the
|
|
29317
|
+
* request to present the matching cookie — a login bridge is useless in
|
|
29318
|
+
* any other browser.
|
|
29319
|
+
*/
|
|
29320
|
+
browserBinding: string().optional()
|
|
28452
29321
|
});
|
|
28453
29322
|
method(object({
|
|
28454
29323
|
claims: SsoBridgeClaimsSchema,
|
|
@@ -35928,7 +36797,13 @@ var TopologyNodeSchema = object({
|
|
|
35928
36797
|
})).readonly(),
|
|
35929
36798
|
processes: array(TopologyProcessSchema).readonly(),
|
|
35930
36799
|
categories: array(TopologyCategorySchema).readonly(),
|
|
35931
|
-
rootPackage: TopologyRootPackageSchema.nullable()
|
|
36800
|
+
rootPackage: TopologyRootPackageSchema.nullable(),
|
|
36801
|
+
/**
|
|
36802
|
+
* How an online AGENT reaches the hub (mesh mTLS Release A): `tls` once it has
|
|
36803
|
+
* completed a mutual-TLS handshake, `clear` otherwise. Absent for the hub,
|
|
36804
|
+
* for offline rows and when the hub cannot tell.
|
|
36805
|
+
*/
|
|
36806
|
+
meshTransport: _enum(["tls", "clear"]).optional()
|
|
35932
36807
|
});
|
|
35933
36808
|
var CapUsageEdgeSchema = object({
|
|
35934
36809
|
callerAddonId: string(),
|
|
@@ -40751,16 +41626,6 @@ var ApiKeySummarySchema = object({
|
|
|
40751
41626
|
createdAt: number(),
|
|
40752
41627
|
lastUsedAt: number().optional()
|
|
40753
41628
|
});
|
|
40754
|
-
var CreateApiKeyInputSchema = object({
|
|
40755
|
-
label: string(),
|
|
40756
|
-
isAdmin: boolean().default(false),
|
|
40757
|
-
allowedProviders: union([array(string()), literal("*")]).optional(),
|
|
40758
|
-
allowedDevices: record(string(), union([array(string()), literal("*")])).optional()
|
|
40759
|
-
});
|
|
40760
|
-
var CreateApiKeyResultSchema = object({
|
|
40761
|
-
token: string(),
|
|
40762
|
-
record: ApiKeySummarySchema
|
|
40763
|
-
});
|
|
40764
41629
|
var ScopedTokenSummarySchema = object({
|
|
40765
41630
|
id: string(),
|
|
40766
41631
|
userId: string(),
|
|
@@ -40859,17 +41724,10 @@ method(_void(), array(UserSummarySchema), { auth: "admin" }), method(CreateUserI
|
|
|
40859
41724
|
}), UserSummarySchema.extend({ passwordHash: string() }).nullable(), {
|
|
40860
41725
|
kind: "mutation",
|
|
40861
41726
|
access: "view"
|
|
40862
|
-
}), method(_void(), array(ApiKeySummarySchema), { auth: "admin" }), method(
|
|
40863
|
-
kind: "mutation",
|
|
40864
|
-
auth: "admin",
|
|
40865
|
-
access: "create"
|
|
40866
|
-
}), method(object({ id: string() }), object({ success: literal(true) }), {
|
|
41727
|
+
}), method(_void(), array(ApiKeySummarySchema), { auth: "admin" }), method(object({ id: string() }), object({ success: literal(true) }), {
|
|
40867
41728
|
kind: "mutation",
|
|
40868
41729
|
auth: "admin",
|
|
40869
41730
|
access: "delete"
|
|
40870
|
-
}), method(object({ token: string() }), ApiKeySummarySchema.nullable(), {
|
|
40871
|
-
kind: "mutation",
|
|
40872
|
-
access: "view"
|
|
40873
41731
|
}), method(CreateScopedTokenInputSchema, CreateScopedTokenResultSchema, {
|
|
40874
41732
|
kind: "mutation",
|
|
40875
41733
|
auth: "admin",
|
|
@@ -40943,15 +41801,7 @@ method(_void(), array(UserSummarySchema), { auth: "admin" }), method(CreateUserI
|
|
|
40943
41801
|
}).nullable(), { access: "view" }), method(object({ userId: string() }), array(ExternalIdentitySchema), { auth: "admin" }), method(ExternalIdentityKeySchema, object({
|
|
40944
41802
|
userId: string(),
|
|
40945
41803
|
issuer: string()
|
|
40946
|
-
}).nullable(), { auth: "admin" }), method(ExternalIdentityKeySchema.extend({
|
|
40947
|
-
userId: string(),
|
|
40948
|
-
issuer: string().min(1),
|
|
40949
|
-
label: string().optional()
|
|
40950
|
-
}), object({ success: literal(true) }), {
|
|
40951
|
-
kind: "mutation",
|
|
40952
|
-
auth: "admin",
|
|
40953
|
-
access: "create"
|
|
40954
|
-
}), method(ExternalIdentityKeySchema.extend({ userId: string() }), object({ success: boolean() }), {
|
|
41804
|
+
}).nullable(), { auth: "admin" }), method(ExternalIdentityKeySchema.extend({ userId: string() }), object({ success: boolean() }), {
|
|
40955
41805
|
kind: "mutation",
|
|
40956
41806
|
auth: "admin",
|
|
40957
41807
|
access: "delete"
|
|
@@ -41656,6 +42506,451 @@ var zoneRulesCapability = {
|
|
|
41656
42506
|
*/
|
|
41657
42507
|
durability: "restored"
|
|
41658
42508
|
};
|
|
42509
|
+
/**
|
|
42510
|
+
* `training-provider` — ONE cloud that can run the CamStack trainer.
|
|
42511
|
+
*
|
|
42512
|
+
* A thin, mockable translation layer: it knows how to run a container with a
|
|
42513
|
+
* GPU, move a dataset in, read the job's stdout and hand artefacts back. It
|
|
42514
|
+
* knows nothing about datasets, splits, floors, cost policy or Model Studio —
|
|
42515
|
+
* those are the `training` orchestrator's (D805). Every rule written there
|
|
42516
|
+
* once is what makes a second provider (RunPod, a local NVIDIA node) a new
|
|
42517
|
+
* manifest entry and nothing else.
|
|
42518
|
+
*
|
|
42519
|
+
* Collection, routed by the `addonId` in every single-row input (the `llm` /
|
|
42520
|
+
* `notification-output` posture); `describe` concat-fans across providers.
|
|
42521
|
+
* Every method is `admin`: these spend money.
|
|
42522
|
+
*
|
|
42523
|
+
* Every cloud object a provider creates is tagged with the orchestrator's
|
|
42524
|
+
* `jobKey`, so a retried submit finds the job it already started instead of
|
|
42525
|
+
* starting a second GPU, and `listJobs` can find orphans.
|
|
42526
|
+
*
|
|
42527
|
+
* Bytes never ride a cap field: the dataset arrives as a `ctx.peerBytes`
|
|
42528
|
+
* ticket the producer (pipeline-analytics) minted, and artefacts leave as a
|
|
42529
|
+
* ticket the provider mints (D613).
|
|
42530
|
+
*/
|
|
42531
|
+
var TrainingGpuOptionSchema = object({
|
|
42532
|
+
id: string(),
|
|
42533
|
+
label: string(),
|
|
42534
|
+
/** List price, USD per GPU-hour, before any region multiplier. */
|
|
42535
|
+
usdPerHour: number().nonnegative(),
|
|
42536
|
+
vramGb: number().nonnegative()
|
|
42537
|
+
});
|
|
42538
|
+
var TrainingRegionOptionSchema = object({
|
|
42539
|
+
/** `''` = any region (the provider's choice). */
|
|
42540
|
+
id: string(),
|
|
42541
|
+
label: string(),
|
|
42542
|
+
priceMultiplier: number().positive()
|
|
42543
|
+
});
|
|
42544
|
+
/**
|
|
42545
|
+
* The provider's per-account settings, as the orchestrator reads them. They
|
|
42546
|
+
* live in the PROVIDER addon's settings (operator decision 2026-10-08: they
|
|
42547
|
+
* depend on the user's account), never hard-coded in the orchestrator.
|
|
42548
|
+
*/
|
|
42549
|
+
var TrainingProviderDefaultsSchema = object({
|
|
42550
|
+
gpuType: string(),
|
|
42551
|
+
region: string(),
|
|
42552
|
+
costCapUsd: number().nonnegative(),
|
|
42553
|
+
maxRuntimeSec: number().int().positive(),
|
|
42554
|
+
/** Hours a FAILED job's cloud dataset is kept for debugging; 0 = delete at once. */
|
|
42555
|
+
failedDatasetGraceHours: number().nonnegative()
|
|
42556
|
+
});
|
|
42557
|
+
var TrainingProviderDescriptorSchema = object({
|
|
42558
|
+
addonId: string(),
|
|
42559
|
+
/** `modal`, `runpod`, `fake`, … */
|
|
42560
|
+
kind: string(),
|
|
42561
|
+
label: string(),
|
|
42562
|
+
gpuTypes: array(TrainingGpuOptionSchema).readonly(),
|
|
42563
|
+
regions: array(TrainingRegionOptionSchema).readonly(),
|
|
42564
|
+
maxDatasetBytes: number().int().positive(),
|
|
42565
|
+
maxRuntimeSec: number().int().positive(),
|
|
42566
|
+
freeTierNote: string().optional(),
|
|
42567
|
+
/** Where the data goes, in one sentence the confirm dialog repeats. */
|
|
42568
|
+
dataResidencyNote: string(),
|
|
42569
|
+
/** Credentials are present — never the values. */
|
|
42570
|
+
configured: boolean(),
|
|
42571
|
+
defaults: TrainingProviderDefaultsSchema
|
|
42572
|
+
});
|
|
42573
|
+
var TrainingCredentialCheckSchema = object({
|
|
42574
|
+
ok: boolean(),
|
|
42575
|
+
/** Workspace / account name, when the provider says. */
|
|
42576
|
+
account: string().optional(),
|
|
42577
|
+
reason: _enum([
|
|
42578
|
+
"missing",
|
|
42579
|
+
"invalid",
|
|
42580
|
+
"forbidden",
|
|
42581
|
+
"network",
|
|
42582
|
+
"quota"
|
|
42583
|
+
]).optional(),
|
|
42584
|
+
detail: string().optional()
|
|
42585
|
+
});
|
|
42586
|
+
var ProviderJobStateSchema = _enum([
|
|
42587
|
+
"pending",
|
|
42588
|
+
"starting",
|
|
42589
|
+
"running",
|
|
42590
|
+
"succeeded",
|
|
42591
|
+
"failed",
|
|
42592
|
+
"cancelled",
|
|
42593
|
+
"lost"
|
|
42594
|
+
]);
|
|
42595
|
+
var ProviderJobStatusSchema = object({
|
|
42596
|
+
jobKey: string(),
|
|
42597
|
+
providerJobId: string().optional(),
|
|
42598
|
+
state: ProviderJobStateSchema,
|
|
42599
|
+
startedAt: number().optional(),
|
|
42600
|
+
endedAt: number().optional(),
|
|
42601
|
+
exitCode: number().int().optional(),
|
|
42602
|
+
failureReason: string().optional(),
|
|
42603
|
+
gpuType: string(),
|
|
42604
|
+
region: string().optional(),
|
|
42605
|
+
billedSeconds: number().nonnegative(),
|
|
42606
|
+
costUsd: number().nonnegative(),
|
|
42607
|
+
/** True when `costUsd` is runtime × list price, not a billing answer. */
|
|
42608
|
+
costIsEstimate: boolean(),
|
|
42609
|
+
lastFetchedAt: number()
|
|
42610
|
+
});
|
|
42611
|
+
/**
|
|
42612
|
+
* The trainer the job runs, by SOURCE revision: the provider turns it into an
|
|
42613
|
+
* image its own way (Modal builds the published Dockerfile at that revision;
|
|
42614
|
+
* a registry-pull provider maps it to a tag). Recorded on the job and echoed
|
|
42615
|
+
* in `result.json`.
|
|
42616
|
+
*/
|
|
42617
|
+
var TrainerSourceRefSchema = object({
|
|
42618
|
+
/** Hugging Face repo id, e.g. `camstack/camstack-trainer`. */
|
|
42619
|
+
repo: string().min(1),
|
|
42620
|
+
/** A commit sha (never a branch) — the job must be reproducible. */
|
|
42621
|
+
revision: string().regex(/^[0-9a-f]{7,64}$/)
|
|
42622
|
+
});
|
|
42623
|
+
var JobRef = {
|
|
42624
|
+
addonId: string(),
|
|
42625
|
+
jobKey: string().uuid()
|
|
42626
|
+
};
|
|
42627
|
+
var TrainingLogLineSchema = object({
|
|
42628
|
+
ts: number(),
|
|
42629
|
+
text: string()
|
|
42630
|
+
});
|
|
42631
|
+
method(object({}), array(TrainingProviderDescriptorSchema).readonly(), { auth: "admin" }), method(object({ addonId: string() }), TrainingCredentialCheckSchema, {
|
|
42632
|
+
kind: "mutation",
|
|
42633
|
+
auth: "admin",
|
|
42634
|
+
timeoutMs: 3e4
|
|
42635
|
+
}), method(object({
|
|
42636
|
+
addonId: string(),
|
|
42637
|
+
gpuType: string(),
|
|
42638
|
+
region: string(),
|
|
42639
|
+
datasetBytes: number().int().nonnegative(),
|
|
42640
|
+
gpuSecondsLow: number().nonnegative(),
|
|
42641
|
+
gpuSecondsHigh: number().nonnegative()
|
|
42642
|
+
}), object({
|
|
42643
|
+
usdLow: number().nonnegative(),
|
|
42644
|
+
usdHigh: number().nonnegative(),
|
|
42645
|
+
notes: array(string()).readonly()
|
|
42646
|
+
}), { auth: "admin" }), method(object({
|
|
42647
|
+
...JobRef,
|
|
42648
|
+
ticket: PeerBytesTicketSchema
|
|
42649
|
+
}), object({
|
|
42650
|
+
bytes: number().int().nonnegative(),
|
|
42651
|
+
sha256: string()
|
|
42652
|
+
}), {
|
|
42653
|
+
kind: "mutation",
|
|
42654
|
+
auth: "admin",
|
|
42655
|
+
timeoutMs: 120 * 6e4
|
|
42656
|
+
}), method(object({
|
|
42657
|
+
...JobRef,
|
|
42658
|
+
trainer: TrainerSourceRefSchema,
|
|
42659
|
+
jobSpecJson: string().min(2).max(64e3),
|
|
42660
|
+
gpuType: string(),
|
|
42661
|
+
region: string(),
|
|
42662
|
+
maxRuntimeSec: number().int().positive()
|
|
42663
|
+
}), ProviderJobStatusSchema, {
|
|
42664
|
+
kind: "mutation",
|
|
42665
|
+
auth: "admin",
|
|
42666
|
+
timeoutMs: 30 * 6e4
|
|
42667
|
+
}), method(object(JobRef), ProviderJobStatusSchema, {
|
|
42668
|
+
auth: "admin",
|
|
42669
|
+
timeoutMs: 6e4
|
|
42670
|
+
}), method(object({
|
|
42671
|
+
...JobRef,
|
|
42672
|
+
cursor: string().optional(),
|
|
42673
|
+
max: number().int().min(1).max(500)
|
|
42674
|
+
}), object({
|
|
42675
|
+
lines: array(TrainingLogLineSchema).readonly(),
|
|
42676
|
+
cursor: string()
|
|
42677
|
+
}), {
|
|
42678
|
+
auth: "admin",
|
|
42679
|
+
timeoutMs: 6e4
|
|
42680
|
+
}), method(object(JobRef), object({ ok: literal(true) }), {
|
|
42681
|
+
kind: "mutation",
|
|
42682
|
+
auth: "admin",
|
|
42683
|
+
timeoutMs: 6e4
|
|
42684
|
+
}), method(object(JobRef), object({
|
|
42685
|
+
found: boolean(),
|
|
42686
|
+
text: string().optional()
|
|
42687
|
+
}), {
|
|
42688
|
+
kind: "mutation",
|
|
42689
|
+
auth: "admin",
|
|
42690
|
+
timeoutMs: 5 * 6e4
|
|
42691
|
+
}), method(object({
|
|
42692
|
+
...JobRef,
|
|
42693
|
+
path: _enum(["bundle.tar"])
|
|
42694
|
+
}), object({ ticket: PeerBytesTicketSchema }), {
|
|
42695
|
+
kind: "mutation",
|
|
42696
|
+
auth: "admin",
|
|
42697
|
+
timeoutMs: 5 * 6e4
|
|
42698
|
+
}), method(object(JobRef), object({ deleted: array(string()).readonly() }), {
|
|
42699
|
+
kind: "mutation",
|
|
42700
|
+
auth: "admin",
|
|
42701
|
+
timeoutMs: 5 * 6e4
|
|
42702
|
+
}), method(object({ addonId: string() }), array(ProviderJobStatusSchema).readonly(), {
|
|
42703
|
+
auth: "admin",
|
|
42704
|
+
timeoutMs: 2 * 6e4
|
|
42705
|
+
});
|
|
42706
|
+
/**
|
|
42707
|
+
* `training` — the cloud-training orchestrator (D805). Hub-only singleton,
|
|
42708
|
+
* provided by `addon-training`.
|
|
42709
|
+
*
|
|
42710
|
+
* It owns what every provider must agree on, written once:
|
|
42711
|
+
*
|
|
42712
|
+
* - **Dataset versions.** Taken over from pipeline-analytics (D796): the rows
|
|
42713
|
+
* live here (D808); pipeline-analytics still CUTS a version (it owns the corpus and
|
|
42714
|
+
* the export plan) and reaches this store through the five row methods
|
|
42715
|
+
* below, so the Retrain page and the export did not change.
|
|
42716
|
+
* - **Jobs.** A persisted state machine, a reconcile loop against the
|
|
42717
|
+
* provider, a cost guard, a daily orphan sweep and the retention rules.
|
|
42718
|
+
* - **The return flow.** Verified artefacts → Model Studio
|
|
42719
|
+
* (`custom-model-registry.importModelBundle`) → canary on cameras →
|
|
42720
|
+
* rollback. Nothing is ever registered automatically.
|
|
42721
|
+
*
|
|
42722
|
+
* Every method is `admin`.
|
|
42723
|
+
*/
|
|
42724
|
+
/** A version WITH its frame list — what the export and a job read. */
|
|
42725
|
+
var TrainingDatasetVersionRowSchema = RetrainDatasetVersionSchema.omit({ frameCount: true }).extend({ frameIds: array(string()).max(2e4).readonly() });
|
|
42726
|
+
/** A base model a detector job can fine-tune, and the baseline it is judged against. */
|
|
42727
|
+
var TrainingBaseModelSchema = object({
|
|
42728
|
+
modelId: string(),
|
|
42729
|
+
label: string(),
|
|
42730
|
+
weights: string(),
|
|
42731
|
+
imgsz: number().int(),
|
|
42732
|
+
baselineOnnxUrl: string(),
|
|
42733
|
+
baselineFloors: record(string(), number()),
|
|
42734
|
+
/** The base the fleet runs most — the UI's default. */
|
|
42735
|
+
recommended: boolean()
|
|
42736
|
+
});
|
|
42737
|
+
var TrainingPresetSchema = _enum([
|
|
42738
|
+
"quick",
|
|
42739
|
+
"standard",
|
|
42740
|
+
"thorough"
|
|
42741
|
+
]);
|
|
42742
|
+
var TrainingJobRequestSchema = object({
|
|
42743
|
+
datasetVersionId: string().min(1),
|
|
42744
|
+
/** The `training-provider` addon that runs it. */
|
|
42745
|
+
addonId: string().min(1),
|
|
42746
|
+
gpuType: string().min(1),
|
|
42747
|
+
region: string(),
|
|
42748
|
+
baseModelId: string().min(1),
|
|
42749
|
+
preset: TrainingPresetSchema,
|
|
42750
|
+
/** Freeze the backbone's first N layers; `null` = the preset's choice. */
|
|
42751
|
+
freeze: number().int().nonnegative().nullable(),
|
|
42752
|
+
/** Cameras held out whole for evaluation; `null` = the orchestrator's default. */
|
|
42753
|
+
holdoutCameras: array(number().int()).nullable()
|
|
42754
|
+
});
|
|
42755
|
+
var TrainingSplitPlanSchema = object({
|
|
42756
|
+
holdoutCameras: array(number().int()).readonly(),
|
|
42757
|
+
/** Used when no camera is held out: the last N days of every camera. */
|
|
42758
|
+
holdoutLastDays: number().int().nonnegative(),
|
|
42759
|
+
/** Holdout subjects per class (camera holdout only; `null` = known only after the split). */
|
|
42760
|
+
holdoutSupport: record(string(), number().int()).nullable(),
|
|
42761
|
+
trainSubjects: number().int()
|
|
42762
|
+
});
|
|
42763
|
+
var TrainingRefusalReasonSchema = _enum([
|
|
42764
|
+
"unknown-dataset",
|
|
42765
|
+
"unknown-provider",
|
|
42766
|
+
"provider-not-configured",
|
|
42767
|
+
"unknown-base-model",
|
|
42768
|
+
"unknown-gpu",
|
|
42769
|
+
"dataset-too-large",
|
|
42770
|
+
"no-training-subjects",
|
|
42771
|
+
"job-already-running"
|
|
42772
|
+
]);
|
|
42773
|
+
var TrainingJobPlanSchema = object({
|
|
42774
|
+
refusal: object({
|
|
42775
|
+
reason: TrainingRefusalReasonSchema,
|
|
42776
|
+
detail: string()
|
|
42777
|
+
}).nullable(),
|
|
42778
|
+
warnings: array(string()).readonly(),
|
|
42779
|
+
split: TrainingSplitPlanSchema.nullable(),
|
|
42780
|
+
estimate: object({
|
|
42781
|
+
datasetBytes: number().int(),
|
|
42782
|
+
uploadMinutesAt20Mbps: number(),
|
|
42783
|
+
gpuSecondsLow: number(),
|
|
42784
|
+
gpuSecondsHigh: number(),
|
|
42785
|
+
usdLow: number(),
|
|
42786
|
+
usdHigh: number(),
|
|
42787
|
+
notes: array(string()).readonly()
|
|
42788
|
+
}).nullable(),
|
|
42789
|
+
/** Pre-filled from the provider's settings; the operator may lower or raise them. */
|
|
42790
|
+
defaults: object({
|
|
42791
|
+
maxCostUsd: number(),
|
|
42792
|
+
maxRuntimeSec: number().int()
|
|
42793
|
+
}).nullable(),
|
|
42794
|
+
/** The sentence the confirm dialog repeats: where the frames go and when they are deleted. */
|
|
42795
|
+
dataNotice: string()
|
|
42796
|
+
});
|
|
42797
|
+
/**
|
|
42798
|
+
* Orchestrator-owned states, persisted. `uploading` covers exporting the
|
|
42799
|
+
* archive (it is streamed, never staged). Terminal: `failed`, `cancelled`,
|
|
42800
|
+
* `lost`, `expired`, `discarded`. `registered` and `canary` are where a
|
|
42801
|
+
* result lives after the operator acted on it.
|
|
42802
|
+
*/
|
|
42803
|
+
var TrainingJobStateSchema = _enum([
|
|
42804
|
+
"uploading",
|
|
42805
|
+
"submitted",
|
|
42806
|
+
"starting",
|
|
42807
|
+
"running",
|
|
42808
|
+
"collecting",
|
|
42809
|
+
"ready",
|
|
42810
|
+
"registered",
|
|
42811
|
+
"canary",
|
|
42812
|
+
"failed",
|
|
42813
|
+
"cancelling",
|
|
42814
|
+
"cancelled",
|
|
42815
|
+
"lost",
|
|
42816
|
+
"expired",
|
|
42817
|
+
"discarded"
|
|
42818
|
+
]);
|
|
42819
|
+
var TrainingFailureReasonSchema = _enum([
|
|
42820
|
+
"cost-cap",
|
|
42821
|
+
"runtime-cap",
|
|
42822
|
+
"upload-failed",
|
|
42823
|
+
"submit-failed",
|
|
42824
|
+
"trainer-failed",
|
|
42825
|
+
"result-invalid",
|
|
42826
|
+
"checksum-mismatch",
|
|
42827
|
+
"fetch-failed",
|
|
42828
|
+
"provider-error",
|
|
42829
|
+
"hub-restart-during-upload"
|
|
42830
|
+
]);
|
|
42831
|
+
var TrainingProgressPointSchema = object({
|
|
42832
|
+
epoch: number().int(),
|
|
42833
|
+
map50: number().nullable(),
|
|
42834
|
+
map50_95: number().nullable()
|
|
42835
|
+
});
|
|
42836
|
+
var TrainingCanarySchema = object({
|
|
42837
|
+
deviceIds: array(number().int()).readonly(),
|
|
42838
|
+
since: number(),
|
|
42839
|
+
/** Every override the canary replaced, exactly, so rollback restores it. */
|
|
42840
|
+
previous: array(object({
|
|
42841
|
+
deviceId: number().int(),
|
|
42842
|
+
nodeId: string(),
|
|
42843
|
+
deviceKey: string(),
|
|
42844
|
+
patch: object({
|
|
42845
|
+
modelId: string().optional(),
|
|
42846
|
+
settings: record(string(), unknown()).readonly().optional()
|
|
42847
|
+
}).nullable()
|
|
42848
|
+
})).readonly()
|
|
42849
|
+
});
|
|
42850
|
+
var TrainingJobSchema = object({
|
|
42851
|
+
id: string(),
|
|
42852
|
+
idempotencyKey: string(),
|
|
42853
|
+
name: string(),
|
|
42854
|
+
createdAt: number(),
|
|
42855
|
+
updatedAt: number(),
|
|
42856
|
+
state: TrainingJobStateSchema,
|
|
42857
|
+
stage: TrainingStageSchema.nullable(),
|
|
42858
|
+
failure: object({
|
|
42859
|
+
reason: TrainingFailureReasonSchema,
|
|
42860
|
+
stage: string().nullable(),
|
|
42861
|
+
detail: string()
|
|
42862
|
+
}).nullable(),
|
|
42863
|
+
request: TrainingJobRequestSchema,
|
|
42864
|
+
maxCostUsd: number().nonnegative(),
|
|
42865
|
+
maxRuntimeSec: number().int().positive(),
|
|
42866
|
+
trainer: TrainerSourceRefSchema,
|
|
42867
|
+
datasetLayout: RetrainExportLayoutSchema,
|
|
42868
|
+
dataset: object({
|
|
42869
|
+
bytes: number().int(),
|
|
42870
|
+
sha256: string(),
|
|
42871
|
+
uploadedAt: number()
|
|
42872
|
+
}).nullable(),
|
|
42873
|
+
split: TrainingSplitPlanSchema,
|
|
42874
|
+
provider: object({
|
|
42875
|
+
state: ProviderJobStateSchema.nullable(),
|
|
42876
|
+
providerJobId: string().nullable(),
|
|
42877
|
+
startedAt: number().nullable(),
|
|
42878
|
+
endedAt: number().nullable(),
|
|
42879
|
+
billedSeconds: number(),
|
|
42880
|
+
costUsd: number(),
|
|
42881
|
+
costIsEstimate: boolean(),
|
|
42882
|
+
lastPolledAt: number().nullable()
|
|
42883
|
+
}),
|
|
42884
|
+
progress: object({
|
|
42885
|
+
epoch: number().int().nullable(),
|
|
42886
|
+
epochs: number().int().nullable(),
|
|
42887
|
+
etaSec: number().nullable(),
|
|
42888
|
+
series: array(TrainingProgressPointSchema).readonly()
|
|
42889
|
+
}),
|
|
42890
|
+
/** The last lines of the job's output (≤ 200), newest last. Never frame paths. */
|
|
42891
|
+
logTail: array(string()).readonly(),
|
|
42892
|
+
logCursor: string().nullable(),
|
|
42893
|
+
artifacts: object({
|
|
42894
|
+
bundleBytes: number().int(),
|
|
42895
|
+
bundleSha256: string(),
|
|
42896
|
+
fetchedAt: number(),
|
|
42897
|
+
/** When the staged artefacts are deleted from the hub. */
|
|
42898
|
+
expiresAt: number()
|
|
42899
|
+
}).nullable(),
|
|
42900
|
+
/** When the provider-side copy of the frames was deleted; null while it exists. */
|
|
42901
|
+
cloudDatasetDeletedAt: number().nullable(),
|
|
42902
|
+
/** A failed job's dataset is kept until then (the provider's grace), then deleted. */
|
|
42903
|
+
cloudCleanupDueAt: number().nullable(),
|
|
42904
|
+
/** Model ids registered from this job (base, and int8 when kept). */
|
|
42905
|
+
registeredModelIds: array(string()).readonly(),
|
|
42906
|
+
canary: TrainingCanarySchema.nullable()
|
|
42907
|
+
});
|
|
42908
|
+
var IdInput = object({ id: string().min(1) });
|
|
42909
|
+
method(TrainingDatasetVersionRowSchema, object({ stored: boolean() }), {
|
|
42910
|
+
kind: "mutation",
|
|
42911
|
+
auth: "admin"
|
|
42912
|
+
}), method(IdInput, TrainingDatasetVersionRowSchema.nullable(), { auth: "admin" }), method(object({}), array(RetrainDatasetVersionSchema).readonly(), { auth: "admin" }), method(object({ name: string() }), object({ id: string().nullable() }), { auth: "admin" }), method(IdInput, object({ removed: boolean() }), {
|
|
42913
|
+
kind: "mutation",
|
|
42914
|
+
auth: "admin"
|
|
42915
|
+
}), method(object({}), array(TrainingBaseModelSchema).readonly(), { auth: "admin" }), method(TrainingJobRequestSchema, TrainingJobPlanSchema, {
|
|
42916
|
+
auth: "admin",
|
|
42917
|
+
timeoutMs: 6e4
|
|
42918
|
+
}), method(TrainingJobRequestSchema.extend({
|
|
42919
|
+
name: string().min(1).max(120),
|
|
42920
|
+
maxCostUsd: number().positive(),
|
|
42921
|
+
maxRuntimeSec: number().int().positive(),
|
|
42922
|
+
idempotencyKey: string().min(8).max(80)
|
|
42923
|
+
}), discriminatedUnion("kind", [object({
|
|
42924
|
+
kind: literal("started"),
|
|
42925
|
+
job: TrainingJobSchema
|
|
42926
|
+
}), object({
|
|
42927
|
+
kind: literal("refused"),
|
|
42928
|
+
reason: TrainingRefusalReasonSchema,
|
|
42929
|
+
detail: string()
|
|
42930
|
+
})]), {
|
|
42931
|
+
kind: "mutation",
|
|
42932
|
+
auth: "admin",
|
|
42933
|
+
timeoutMs: 12e4
|
|
42934
|
+
}), method(object({}), array(TrainingJobSchema).readonly(), { auth: "admin" }), method(IdInput, TrainingJobSchema.nullable(), { auth: "admin" }), method(IdInput, TrainingJobSchema, {
|
|
42935
|
+
kind: "mutation",
|
|
42936
|
+
auth: "admin",
|
|
42937
|
+
timeoutMs: 12e4
|
|
42938
|
+
}), method(IdInput, TrainingResultSchema.nullable(), { auth: "admin" }), method(IdInput.extend({ canaryDeviceIds: array(number().int()).readonly() }), TrainingJobSchema, {
|
|
42939
|
+
kind: "mutation",
|
|
42940
|
+
auth: "admin",
|
|
42941
|
+
timeoutMs: 30 * 6e4
|
|
42942
|
+
}), method(IdInput.extend({ deviceIds: array(number().int()).min(1).readonly() }), TrainingJobSchema, {
|
|
42943
|
+
kind: "mutation",
|
|
42944
|
+
auth: "admin",
|
|
42945
|
+
timeoutMs: 12e4
|
|
42946
|
+
}), method(IdInput, TrainingJobSchema, {
|
|
42947
|
+
kind: "mutation",
|
|
42948
|
+
auth: "admin",
|
|
42949
|
+
timeoutMs: 12e4
|
|
42950
|
+
}), method(IdInput, TrainingJobSchema, {
|
|
42951
|
+
kind: "mutation",
|
|
42952
|
+
auth: "admin"
|
|
42953
|
+
});
|
|
41659
42954
|
SOURCE_CAPS.filter((cap) => cap !== "switch" && cap !== "motion");
|
|
41660
42955
|
Object.freeze({
|
|
41661
42956
|
person: .5,
|
|
@@ -43327,6 +44622,12 @@ Object.freeze({
|
|
|
43327
44622
|
addonId: null,
|
|
43328
44623
|
access: "create"
|
|
43329
44624
|
},
|
|
44625
|
+
"backup.checkBackupKey": {
|
|
44626
|
+
capName: "backup",
|
|
44627
|
+
capScope: "system",
|
|
44628
|
+
addonId: null,
|
|
44629
|
+
access: "create"
|
|
44630
|
+
},
|
|
43330
44631
|
"backup.delete": {
|
|
43331
44632
|
capName: "backup",
|
|
43332
44633
|
capScope: "system",
|
|
@@ -43339,6 +44640,18 @@ Object.freeze({
|
|
|
43339
44640
|
addonId: null,
|
|
43340
44641
|
access: "delete"
|
|
43341
44642
|
},
|
|
44643
|
+
"backup.disableEncryption": {
|
|
44644
|
+
capName: "backup",
|
|
44645
|
+
capScope: "system",
|
|
44646
|
+
addonId: null,
|
|
44647
|
+
access: "create"
|
|
44648
|
+
},
|
|
44649
|
+
"backup.getEncryption": {
|
|
44650
|
+
capName: "backup",
|
|
44651
|
+
capScope: "system",
|
|
44652
|
+
addonId: null,
|
|
44653
|
+
access: "view"
|
|
44654
|
+
},
|
|
43342
44655
|
"backup.getEntries": {
|
|
43343
44656
|
capName: "backup",
|
|
43344
44657
|
capScope: "system",
|
|
@@ -43393,6 +44706,12 @@ Object.freeze({
|
|
|
43393
44706
|
addonId: null,
|
|
43394
44707
|
access: "create"
|
|
43395
44708
|
},
|
|
44709
|
+
"backup.setupEncryption": {
|
|
44710
|
+
capName: "backup",
|
|
44711
|
+
capScope: "system",
|
|
44712
|
+
addonId: null,
|
|
44713
|
+
access: "create"
|
|
44714
|
+
},
|
|
43396
44715
|
"backup.trigger": {
|
|
43397
44716
|
capName: "backup",
|
|
43398
44717
|
capScope: "system",
|
|
@@ -43945,6 +45264,12 @@ Object.freeze({
|
|
|
43945
45264
|
addonId: null,
|
|
43946
45265
|
access: "create"
|
|
43947
45266
|
},
|
|
45267
|
+
"customModelRegistry.importModelBundle": {
|
|
45268
|
+
capName: "custom-model-registry",
|
|
45269
|
+
capScope: "system",
|
|
45270
|
+
addonId: null,
|
|
45271
|
+
access: "create"
|
|
45272
|
+
},
|
|
43948
45273
|
"customModelRegistry.listModels": {
|
|
43949
45274
|
capName: "custom-model-registry",
|
|
43950
45275
|
capScope: "system",
|
|
@@ -45385,6 +46710,12 @@ Object.freeze({
|
|
|
45385
46710
|
addonId: null,
|
|
45386
46711
|
access: "view"
|
|
45387
46712
|
},
|
|
46713
|
+
"keychainAdmin.acknowledgeReset": {
|
|
46714
|
+
capName: "keychain-admin",
|
|
46715
|
+
capScope: "system",
|
|
46716
|
+
addonId: null,
|
|
46717
|
+
access: "create"
|
|
46718
|
+
},
|
|
45388
46719
|
"keychainAdmin.deleteOrphans": {
|
|
45389
46720
|
capName: "keychain-admin",
|
|
45390
46721
|
capScope: "system",
|
|
@@ -45421,6 +46752,12 @@ Object.freeze({
|
|
|
45421
46752
|
addonId: null,
|
|
45422
46753
|
access: "delete"
|
|
45423
46754
|
},
|
|
46755
|
+
"keychainAdmin.resetReport": {
|
|
46756
|
+
capName: "keychain-admin",
|
|
46757
|
+
capScope: "system",
|
|
46758
|
+
addonId: null,
|
|
46759
|
+
access: "delete"
|
|
46760
|
+
},
|
|
45424
46761
|
"keychainAdmin.reveal": {
|
|
45425
46762
|
capName: "keychain-admin",
|
|
45426
46763
|
capScope: "system",
|
|
@@ -47167,6 +48504,12 @@ Object.freeze({
|
|
|
47167
48504
|
addonId: null,
|
|
47168
48505
|
access: "view"
|
|
47169
48506
|
},
|
|
48507
|
+
"pipelineAnalytics.offerRetrainArchive": {
|
|
48508
|
+
capName: "pipeline-analytics",
|
|
48509
|
+
capScope: "device",
|
|
48510
|
+
addonId: null,
|
|
48511
|
+
access: "create"
|
|
48512
|
+
},
|
|
47170
48513
|
"pipelineAnalytics.ownersWithMedia": {
|
|
47171
48514
|
capName: "pipeline-analytics",
|
|
47172
48515
|
capScope: "device",
|
|
@@ -49705,6 +51048,174 @@ Object.freeze({
|
|
|
49705
51048
|
addonId: null,
|
|
49706
51049
|
access: "view"
|
|
49707
51050
|
},
|
|
51051
|
+
"training.canaryResult": {
|
|
51052
|
+
capName: "training",
|
|
51053
|
+
capScope: "system",
|
|
51054
|
+
addonId: null,
|
|
51055
|
+
access: "create"
|
|
51056
|
+
},
|
|
51057
|
+
"training.cancelJob": {
|
|
51058
|
+
capName: "training",
|
|
51059
|
+
capScope: "system",
|
|
51060
|
+
addonId: null,
|
|
51061
|
+
access: "create"
|
|
51062
|
+
},
|
|
51063
|
+
"training.discardResult": {
|
|
51064
|
+
capName: "training",
|
|
51065
|
+
capScope: "system",
|
|
51066
|
+
addonId: null,
|
|
51067
|
+
access: "create"
|
|
51068
|
+
},
|
|
51069
|
+
"training.findDatasetVersionIdByName": {
|
|
51070
|
+
capName: "training",
|
|
51071
|
+
capScope: "system",
|
|
51072
|
+
addonId: null,
|
|
51073
|
+
access: "view"
|
|
51074
|
+
},
|
|
51075
|
+
"training.getDatasetVersion": {
|
|
51076
|
+
capName: "training",
|
|
51077
|
+
capScope: "system",
|
|
51078
|
+
addonId: null,
|
|
51079
|
+
access: "view"
|
|
51080
|
+
},
|
|
51081
|
+
"training.getJob": {
|
|
51082
|
+
capName: "training",
|
|
51083
|
+
capScope: "system",
|
|
51084
|
+
addonId: null,
|
|
51085
|
+
access: "view"
|
|
51086
|
+
},
|
|
51087
|
+
"training.getJobResult": {
|
|
51088
|
+
capName: "training",
|
|
51089
|
+
capScope: "system",
|
|
51090
|
+
addonId: null,
|
|
51091
|
+
access: "view"
|
|
51092
|
+
},
|
|
51093
|
+
"training.listBaseModels": {
|
|
51094
|
+
capName: "training",
|
|
51095
|
+
capScope: "system",
|
|
51096
|
+
addonId: null,
|
|
51097
|
+
access: "view"
|
|
51098
|
+
},
|
|
51099
|
+
"training.listDatasetVersions": {
|
|
51100
|
+
capName: "training",
|
|
51101
|
+
capScope: "system",
|
|
51102
|
+
addonId: null,
|
|
51103
|
+
access: "view"
|
|
51104
|
+
},
|
|
51105
|
+
"training.listJobs": {
|
|
51106
|
+
capName: "training",
|
|
51107
|
+
capScope: "system",
|
|
51108
|
+
addonId: null,
|
|
51109
|
+
access: "view"
|
|
51110
|
+
},
|
|
51111
|
+
"training.planJob": {
|
|
51112
|
+
capName: "training",
|
|
51113
|
+
capScope: "system",
|
|
51114
|
+
addonId: null,
|
|
51115
|
+
access: "view"
|
|
51116
|
+
},
|
|
51117
|
+
"training.putDatasetVersion": {
|
|
51118
|
+
capName: "training",
|
|
51119
|
+
capScope: "system",
|
|
51120
|
+
addonId: null,
|
|
51121
|
+
access: "create"
|
|
51122
|
+
},
|
|
51123
|
+
"training.registerResult": {
|
|
51124
|
+
capName: "training",
|
|
51125
|
+
capScope: "system",
|
|
51126
|
+
addonId: null,
|
|
51127
|
+
access: "create"
|
|
51128
|
+
},
|
|
51129
|
+
"training.removeDatasetVersion": {
|
|
51130
|
+
capName: "training",
|
|
51131
|
+
capScope: "system",
|
|
51132
|
+
addonId: null,
|
|
51133
|
+
access: "delete"
|
|
51134
|
+
},
|
|
51135
|
+
"training.rollbackCanary": {
|
|
51136
|
+
capName: "training",
|
|
51137
|
+
capScope: "system",
|
|
51138
|
+
addonId: null,
|
|
51139
|
+
access: "create"
|
|
51140
|
+
},
|
|
51141
|
+
"training.startJob": {
|
|
51142
|
+
capName: "training",
|
|
51143
|
+
capScope: "system",
|
|
51144
|
+
addonId: null,
|
|
51145
|
+
access: "create"
|
|
51146
|
+
},
|
|
51147
|
+
"trainingProvider.cancelJob": {
|
|
51148
|
+
capName: "training-provider",
|
|
51149
|
+
capScope: "system",
|
|
51150
|
+
addonId: null,
|
|
51151
|
+
access: "create"
|
|
51152
|
+
},
|
|
51153
|
+
"trainingProvider.cleanupJob": {
|
|
51154
|
+
capName: "training-provider",
|
|
51155
|
+
capScope: "system",
|
|
51156
|
+
addonId: null,
|
|
51157
|
+
access: "create"
|
|
51158
|
+
},
|
|
51159
|
+
"trainingProvider.describe": {
|
|
51160
|
+
capName: "training-provider",
|
|
51161
|
+
capScope: "system",
|
|
51162
|
+
addonId: null,
|
|
51163
|
+
access: "view"
|
|
51164
|
+
},
|
|
51165
|
+
"trainingProvider.estimateJob": {
|
|
51166
|
+
capName: "training-provider",
|
|
51167
|
+
capScope: "system",
|
|
51168
|
+
addonId: null,
|
|
51169
|
+
access: "view"
|
|
51170
|
+
},
|
|
51171
|
+
"trainingProvider.getJob": {
|
|
51172
|
+
capName: "training-provider",
|
|
51173
|
+
capScope: "system",
|
|
51174
|
+
addonId: null,
|
|
51175
|
+
access: "view"
|
|
51176
|
+
},
|
|
51177
|
+
"trainingProvider.listJobEvents": {
|
|
51178
|
+
capName: "training-provider",
|
|
51179
|
+
capScope: "system",
|
|
51180
|
+
addonId: null,
|
|
51181
|
+
access: "view"
|
|
51182
|
+
},
|
|
51183
|
+
"trainingProvider.listJobs": {
|
|
51184
|
+
capName: "training-provider",
|
|
51185
|
+
capScope: "system",
|
|
51186
|
+
addonId: null,
|
|
51187
|
+
access: "view"
|
|
51188
|
+
},
|
|
51189
|
+
"trainingProvider.offerArtifact": {
|
|
51190
|
+
capName: "training-provider",
|
|
51191
|
+
capScope: "system",
|
|
51192
|
+
addonId: null,
|
|
51193
|
+
access: "create"
|
|
51194
|
+
},
|
|
51195
|
+
"trainingProvider.readResult": {
|
|
51196
|
+
capName: "training-provider",
|
|
51197
|
+
capScope: "system",
|
|
51198
|
+
addonId: null,
|
|
51199
|
+
access: "create"
|
|
51200
|
+
},
|
|
51201
|
+
"trainingProvider.submitJob": {
|
|
51202
|
+
capName: "training-provider",
|
|
51203
|
+
capScope: "system",
|
|
51204
|
+
addonId: null,
|
|
51205
|
+
access: "create"
|
|
51206
|
+
},
|
|
51207
|
+
"trainingProvider.uploadDataset": {
|
|
51208
|
+
capName: "training-provider",
|
|
51209
|
+
capScope: "system",
|
|
51210
|
+
addonId: null,
|
|
51211
|
+
access: "create"
|
|
51212
|
+
},
|
|
51213
|
+
"trainingProvider.validateCredentials": {
|
|
51214
|
+
capName: "training-provider",
|
|
51215
|
+
capScope: "system",
|
|
51216
|
+
addonId: null,
|
|
51217
|
+
access: "create"
|
|
51218
|
+
},
|
|
49708
51219
|
"turnProvider.getTurnServers": {
|
|
49709
51220
|
capName: "turn-provider",
|
|
49710
51221
|
capScope: "system",
|
|
@@ -49729,12 +51240,6 @@ Object.freeze({
|
|
|
49729
51240
|
addonId: null,
|
|
49730
51241
|
access: "create"
|
|
49731
51242
|
},
|
|
49732
|
-
"userManagement.createApiKey": {
|
|
49733
|
-
capName: "user-management",
|
|
49734
|
-
capScope: "system",
|
|
49735
|
-
addonId: null,
|
|
49736
|
-
access: "create"
|
|
49737
|
-
},
|
|
49738
51243
|
"userManagement.createScopedToken": {
|
|
49739
51244
|
capName: "user-management",
|
|
49740
51245
|
capScope: "system",
|
|
@@ -49771,12 +51276,6 @@ Object.freeze({
|
|
|
49771
51276
|
addonId: null,
|
|
49772
51277
|
access: "view"
|
|
49773
51278
|
},
|
|
49774
|
-
"userManagement.linkExternalIdentity": {
|
|
49775
|
-
capName: "user-management",
|
|
49776
|
-
capScope: "system",
|
|
49777
|
-
addonId: null,
|
|
49778
|
-
access: "create"
|
|
49779
|
-
},
|
|
49780
51279
|
"userManagement.listApiKeys": {
|
|
49781
51280
|
capName: "user-management",
|
|
49782
51281
|
capScope: "system",
|
|
@@ -49879,12 +51378,6 @@ Object.freeze({
|
|
|
49879
51378
|
addonId: null,
|
|
49880
51379
|
access: "create"
|
|
49881
51380
|
},
|
|
49882
|
-
"userManagement.validateApiKey": {
|
|
49883
|
-
capName: "user-management",
|
|
49884
|
-
capScope: "system",
|
|
49885
|
-
addonId: null,
|
|
49886
|
-
access: "view"
|
|
49887
|
-
},
|
|
49888
51381
|
"userManagement.validateCredentials": {
|
|
49889
51382
|
capName: "user-management",
|
|
49890
51383
|
capScope: "system",
|
|
@@ -53998,6 +55491,11 @@ Object.freeze({
|
|
|
53998
55491
|
form: "single",
|
|
53999
55492
|
optional: false
|
|
54000
55493
|
}],
|
|
55494
|
+
"training.canaryResult": [{
|
|
55495
|
+
name: "deviceIds",
|
|
55496
|
+
form: "array",
|
|
55497
|
+
optional: false
|
|
55498
|
+
}],
|
|
54001
55499
|
"update.getStatus": [{
|
|
54002
55500
|
name: "deviceId",
|
|
54003
55501
|
form: "single",
|
|
@@ -54726,6 +56224,8 @@ var STATE_SUMMARY_VARS = [
|
|
|
54726
56224
|
[...RULE_TEXT],
|
|
54727
56225
|
[...RULE_TEXT],
|
|
54728
56226
|
[...RULE_TEXT],
|
|
56227
|
+
[...RULE_TEXT],
|
|
56228
|
+
[...RULE_TEXT],
|
|
54729
56229
|
([...RULE_TEXT], [...UPDATES]),
|
|
54730
56230
|
([...RULE_TEXT], [...PACKAGE_UPDATES]),
|
|
54731
56231
|
([...RULE_TEXT], [...PACKAGE_UPDATES]),
|