@camstack/addon-terminal 0.1.128 → 0.1.129
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 +1622 -130
- package/dist/addon.mjs +1622 -130
- package/package.json +1 -1
package/dist/addon.mjs
CHANGED
|
@@ -5386,7 +5386,7 @@ var ZodIssueCode = {
|
|
|
5386
5386
|
var ZodFirstPartyTypeKind;
|
|
5387
5387
|
ZodFirstPartyTypeKind || (ZodFirstPartyTypeKind = {});
|
|
5388
5388
|
//#endregion
|
|
5389
|
-
//#region ../types/dist/sleep-
|
|
5389
|
+
//#region ../types/dist/sleep-r3RWkGVx.mjs
|
|
5390
5390
|
/**
|
|
5391
5391
|
* The audio chunk plane's byte format, and the ONE expansion from a coded
|
|
5392
5392
|
* window to float samples (D455).
|
|
@@ -5503,7 +5503,7 @@ function isKeychainStoredField(field) {
|
|
|
5503
5503
|
var SECRET_CLEAR = { $secretClear: true };
|
|
5504
5504
|
/** The `'***'` token D634 redaction writes for non-admins. */
|
|
5505
5505
|
var LEGACY_DEVICE_REDACTION = "***";
|
|
5506
|
-
function isRecord$
|
|
5506
|
+
function isRecord$2(value) {
|
|
5507
5507
|
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
5508
5508
|
}
|
|
5509
5509
|
function makeSecretMarker(ref) {
|
|
@@ -5514,12 +5514,12 @@ function makeSecretMarker(ref) {
|
|
|
5514
5514
|
}
|
|
5515
5515
|
/** A stored marker: an object whose `$secret` is a non-empty string. */
|
|
5516
5516
|
function isSecretMarker(value) {
|
|
5517
|
-
if (!isRecord$
|
|
5517
|
+
if (!isRecord$2(value)) return false;
|
|
5518
5518
|
const ref = value["$secret"];
|
|
5519
5519
|
return typeof ref === "string" && ref.length > 0;
|
|
5520
5520
|
}
|
|
5521
5521
|
function isSecretClear(value) {
|
|
5522
|
-
return isRecord$
|
|
5522
|
+
return isRecord$2(value) && value["$secretClear"] === true;
|
|
5523
5523
|
}
|
|
5524
5524
|
/**
|
|
5525
5525
|
* The UI view of a stored secret field value: a marker becomes "set", inline
|
|
@@ -6035,6 +6035,13 @@ function globalSecretScope() {
|
|
|
6035
6035
|
function encodeSegment(value) {
|
|
6036
6036
|
return encodeURIComponent(value);
|
|
6037
6037
|
}
|
|
6038
|
+
function decodeSegment(value) {
|
|
6039
|
+
try {
|
|
6040
|
+
return decodeURIComponent(value);
|
|
6041
|
+
} catch {
|
|
6042
|
+
return null;
|
|
6043
|
+
}
|
|
6044
|
+
}
|
|
6038
6045
|
/**
|
|
6039
6046
|
* The field path of a value inside an array item, addressed by the item's id:
|
|
6040
6047
|
* `arrayItemFieldPath('providers', 'authentik', 'clientSecret')` →
|
|
@@ -6043,6 +6050,75 @@ function encodeSegment(value) {
|
|
|
6043
6050
|
function arrayItemFieldPath(arrayKey, itemId, fieldKey) {
|
|
6044
6051
|
return `${arrayKey}[${encodeSegment(itemId)}].${fieldKey}`;
|
|
6045
6052
|
}
|
|
6053
|
+
function parseScope(segments) {
|
|
6054
|
+
switch (segments[0]) {
|
|
6055
|
+
case "global": return {
|
|
6056
|
+
scope: GLOBAL_SCOPE,
|
|
6057
|
+
used: 1
|
|
6058
|
+
};
|
|
6059
|
+
case "node": {
|
|
6060
|
+
const nodeId = segments[1] !== void 0 ? decodeSegment(segments[1]) : null;
|
|
6061
|
+
return nodeId === null || nodeId.length === 0 ? null : {
|
|
6062
|
+
scope: {
|
|
6063
|
+
kind: "node",
|
|
6064
|
+
nodeId
|
|
6065
|
+
},
|
|
6066
|
+
used: 2
|
|
6067
|
+
};
|
|
6068
|
+
}
|
|
6069
|
+
case "device": {
|
|
6070
|
+
const raw = segments[1];
|
|
6071
|
+
if (raw === void 0 || !/^\d+$/.test(raw)) return null;
|
|
6072
|
+
return {
|
|
6073
|
+
scope: {
|
|
6074
|
+
kind: "device",
|
|
6075
|
+
deviceId: Number(raw)
|
|
6076
|
+
},
|
|
6077
|
+
used: 2
|
|
6078
|
+
};
|
|
6079
|
+
}
|
|
6080
|
+
case "integration": {
|
|
6081
|
+
const id = segments[1] !== void 0 ? decodeSegment(segments[1]) : null;
|
|
6082
|
+
return id === null || id.length === 0 ? null : {
|
|
6083
|
+
scope: {
|
|
6084
|
+
kind: "integration",
|
|
6085
|
+
integrationId: id
|
|
6086
|
+
},
|
|
6087
|
+
used: 2
|
|
6088
|
+
};
|
|
6089
|
+
}
|
|
6090
|
+
case "row": {
|
|
6091
|
+
const collection = segments[1] !== void 0 ? decodeSegment(segments[1]) : null;
|
|
6092
|
+
const rowId = segments[2] !== void 0 ? decodeSegment(segments[2]) : null;
|
|
6093
|
+
if (collection === null || rowId === null || collection.length === 0 || rowId.length === 0) return null;
|
|
6094
|
+
return {
|
|
6095
|
+
scope: {
|
|
6096
|
+
kind: "row",
|
|
6097
|
+
collection,
|
|
6098
|
+
rowId
|
|
6099
|
+
},
|
|
6100
|
+
used: 3
|
|
6101
|
+
};
|
|
6102
|
+
}
|
|
6103
|
+
default: return null;
|
|
6104
|
+
}
|
|
6105
|
+
}
|
|
6106
|
+
/** Take a ref apart; `null` when it is not a well-formed ref. */
|
|
6107
|
+
function parseSecretRef(ref) {
|
|
6108
|
+
if (!ref.startsWith("secret://")) return null;
|
|
6109
|
+
const segments = ref.slice(9).split("/");
|
|
6110
|
+
const owner = segments[0] !== void 0 ? decodeSegment(segments[0]) : null;
|
|
6111
|
+
if (owner === null || owner.length === 0) return null;
|
|
6112
|
+
const parsed = parseScope(segments.slice(1));
|
|
6113
|
+
if (parsed === null) return null;
|
|
6114
|
+
const fieldPath = segments.slice(1 + parsed.used).join("/");
|
|
6115
|
+
if (fieldPath.length === 0) return null;
|
|
6116
|
+
return {
|
|
6117
|
+
owner,
|
|
6118
|
+
scope: parsed.scope,
|
|
6119
|
+
fieldPath
|
|
6120
|
+
};
|
|
6121
|
+
}
|
|
6046
6122
|
/** A write to a secret path could not be stored in the keychain, so it was refused. */
|
|
6047
6123
|
var KeychainWriteRefusedError = class extends Error {
|
|
6048
6124
|
fieldPath;
|
|
@@ -6053,7 +6129,7 @@ var KeychainWriteRefusedError = class extends Error {
|
|
|
6053
6129
|
}
|
|
6054
6130
|
};
|
|
6055
6131
|
var KEEP = { kind: "keep" };
|
|
6056
|
-
function isRecord(value) {
|
|
6132
|
+
function isRecord$1(value) {
|
|
6057
6133
|
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
6058
6134
|
}
|
|
6059
6135
|
function defaultMintId() {
|
|
@@ -6066,7 +6142,7 @@ function collectSecretMarkerRefs(value, out = []) {
|
|
|
6066
6142
|
return out;
|
|
6067
6143
|
}
|
|
6068
6144
|
if (Array.isArray(value)) for (const item of value) collectSecretMarkerRefs(item, out);
|
|
6069
|
-
else if (isRecord(value)) for (const child of Object.values(value)) collectSecretMarkerRefs(child, out);
|
|
6145
|
+
else if (isRecord$1(value)) for (const child of Object.values(value)) collectSecretMarkerRefs(child, out);
|
|
6070
6146
|
return out;
|
|
6071
6147
|
}
|
|
6072
6148
|
async function storedValueEquals(secrets, marker, candidate) {
|
|
@@ -6121,7 +6197,7 @@ function rowId(row, idKey) {
|
|
|
6121
6197
|
return null;
|
|
6122
6198
|
}
|
|
6123
6199
|
async function writeArray(ctx, node, incoming, stored, fieldPath) {
|
|
6124
|
-
const storedRows = Array.isArray(stored) ? stored.filter(isRecord) : [];
|
|
6200
|
+
const storedRows = Array.isArray(stored) ? stored.filter(isRecord$1) : [];
|
|
6125
6201
|
if (!Array.isArray(incoming)) {
|
|
6126
6202
|
ctx.deletes.push(...collectSecretMarkerRefs(storedRows));
|
|
6127
6203
|
return {
|
|
@@ -6137,7 +6213,7 @@ async function writeArray(ctx, node, incoming, stored, fieldPath) {
|
|
|
6137
6213
|
const kept = /* @__PURE__ */ new Set();
|
|
6138
6214
|
const rows = [];
|
|
6139
6215
|
for (const row of incoming) {
|
|
6140
|
-
if (!isRecord(row)) {
|
|
6216
|
+
if (!isRecord$1(row)) {
|
|
6141
6217
|
rows.push(row);
|
|
6142
6218
|
continue;
|
|
6143
6219
|
}
|
|
@@ -6162,7 +6238,7 @@ async function writeNode(ctx, node, incoming, stored, fieldPath) {
|
|
|
6162
6238
|
case "leaf": return writeLeaf(ctx, incoming, stored, fieldPath);
|
|
6163
6239
|
case "array": return writeArray(ctx, node, incoming, stored, fieldPath);
|
|
6164
6240
|
case "object": {
|
|
6165
|
-
if (!isRecord(incoming)) {
|
|
6241
|
+
if (!isRecord$1(incoming)) {
|
|
6166
6242
|
if (incoming === void 0) return KEEP;
|
|
6167
6243
|
ctx.deletes.push(...collectSecretMarkerRefs(stored));
|
|
6168
6244
|
return {
|
|
@@ -6170,7 +6246,7 @@ async function writeNode(ctx, node, incoming, stored, fieldPath) {
|
|
|
6170
6246
|
value: incoming
|
|
6171
6247
|
};
|
|
6172
6248
|
}
|
|
6173
|
-
const storedObj = isRecord(stored) ? stored : {};
|
|
6249
|
+
const storedObj = isRecord$1(stored) ? stored : {};
|
|
6174
6250
|
return {
|
|
6175
6251
|
kind: "value",
|
|
6176
6252
|
value: await writeMembers(ctx, node.children, incoming, storedObj, (m) => `${fieldPath}.${m}`)
|
|
@@ -6229,12 +6305,19 @@ async function transformSecretWrite(input) {
|
|
|
6229
6305
|
}
|
|
6230
6306
|
};
|
|
6231
6307
|
}
|
|
6308
|
+
/** Is `ref` one of `owner`'s refs? */
|
|
6309
|
+
function isSecretRefOwnedBy(ref, owner) {
|
|
6310
|
+
return parseSecretRef(ref)?.owner === owner;
|
|
6311
|
+
}
|
|
6232
6312
|
/**
|
|
6233
6313
|
* Replace every marker in `value` with its keychain value. Returns the SAME
|
|
6234
6314
|
* reference when there is no marker (no allocation, no keychain call).
|
|
6235
6315
|
*/
|
|
6236
|
-
async function resolveSecretMarkers(value, secrets) {
|
|
6237
|
-
const
|
|
6316
|
+
async function resolveSecretMarkers(value, secrets, options = {}) {
|
|
6317
|
+
const keepMarker = options.unresolved === "keep-marker";
|
|
6318
|
+
const owner = options.ownedBy;
|
|
6319
|
+
const inScope = (ref) => owner === void 0 || isSecretRefOwnedBy(ref, owner);
|
|
6320
|
+
const refs = collectSecretMarkerRefs(value).filter(inScope);
|
|
6238
6321
|
if (refs.length === 0) return {
|
|
6239
6322
|
value,
|
|
6240
6323
|
unresolved: []
|
|
@@ -6258,10 +6341,18 @@ async function resolveSecretMarkers(value, secrets) {
|
|
|
6258
6341
|
}
|
|
6259
6342
|
const substitute = (v) => {
|
|
6260
6343
|
if (isSecretMarker(v)) {
|
|
6344
|
+
if (!inScope(v.$secret)) return {
|
|
6345
|
+
keep: true,
|
|
6346
|
+
value: v
|
|
6347
|
+
};
|
|
6261
6348
|
const answer = answers[v.$secret];
|
|
6262
|
-
|
|
6349
|
+
if (answer?.kind === "value") return {
|
|
6263
6350
|
keep: true,
|
|
6264
6351
|
value: answer.value
|
|
6352
|
+
};
|
|
6353
|
+
return keepMarker ? {
|
|
6354
|
+
keep: true,
|
|
6355
|
+
value: v
|
|
6265
6356
|
} : {
|
|
6266
6357
|
keep: false,
|
|
6267
6358
|
value: void 0
|
|
@@ -6278,7 +6369,7 @@ async function resolveSecretMarkers(value, secrets) {
|
|
|
6278
6369
|
value: items
|
|
6279
6370
|
};
|
|
6280
6371
|
}
|
|
6281
|
-
if (isRecord(v)) {
|
|
6372
|
+
if (isRecord$1(v)) {
|
|
6282
6373
|
const out = {};
|
|
6283
6374
|
for (const [k, child] of Object.entries(v)) {
|
|
6284
6375
|
const s = substitute(child);
|
|
@@ -6299,14 +6390,152 @@ async function resolveSecretMarkers(value, secrets) {
|
|
|
6299
6390
|
unresolved
|
|
6300
6391
|
};
|
|
6301
6392
|
}
|
|
6302
|
-
|
|
6303
|
-
|
|
6304
|
-
|
|
6305
|
-
|
|
6306
|
-
|
|
6393
|
+
/** An addon tried to replace a stored secret it could not read. Nothing was written. */
|
|
6394
|
+
var SecretOverwriteRefusedError = class extends Error {
|
|
6395
|
+
ref;
|
|
6396
|
+
reason;
|
|
6397
|
+
constructor(ref, reason) {
|
|
6398
|
+
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.`);
|
|
6399
|
+
this.ref = ref;
|
|
6400
|
+
this.reason = reason;
|
|
6401
|
+
this.name = "SecretOverwriteRefusedError";
|
|
6402
|
+
}
|
|
6403
|
+
};
|
|
6404
|
+
function isRecord(value) {
|
|
6405
|
+
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
6406
|
+
}
|
|
6407
|
+
function resolvedValue(pass, marker) {
|
|
6408
|
+
const answer = pass.answers[marker.$secret];
|
|
6409
|
+
return answer?.kind === "value" ? answer.value : null;
|
|
6410
|
+
}
|
|
6411
|
+
async function atMarker(pass, incoming, stored) {
|
|
6412
|
+
if (incoming === null) return stored;
|
|
6413
|
+
if (typeof incoming !== "string") return incoming;
|
|
6414
|
+
if (incoming === resolvedValue(pass, stored)) return stored;
|
|
6415
|
+
const intent = classifySecretWrite(incoming);
|
|
6416
|
+
if (intent.kind !== "set") return stored;
|
|
6417
|
+
const ref = stored.$secret;
|
|
6418
|
+
if (!isSecretRefOwnedBy(ref, pass.secrets.owner)) return incoming;
|
|
6419
|
+
const answer = pass.answers[ref];
|
|
6420
|
+
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);
|
|
6421
|
+
try {
|
|
6422
|
+
await pass.secrets.put(ref, intent.value);
|
|
6423
|
+
} catch (err) {
|
|
6424
|
+
throw new KeychainWriteRefusedError(ref, err);
|
|
6425
|
+
}
|
|
6426
|
+
pass.changedRefs.push(ref);
|
|
6427
|
+
return stored;
|
|
6428
|
+
}
|
|
6429
|
+
function inArray(pass, incoming, stored) {
|
|
6430
|
+
return incoming.map((item, index) => {
|
|
6431
|
+
const twin = stored[index];
|
|
6432
|
+
if (isSecretMarker(twin)) return typeof item === "string" && item === resolvedValue(pass, twin) ? twin : item;
|
|
6433
|
+
if (isRecord(item) && isRecord(twin)) return inArrayRow(pass, item, twin);
|
|
6434
|
+
if (Array.isArray(item) && Array.isArray(twin)) return inArray(pass, item, twin);
|
|
6435
|
+
return item;
|
|
6436
|
+
});
|
|
6437
|
+
}
|
|
6438
|
+
function inArrayRow(pass, incoming, stored) {
|
|
6439
|
+
const out = { ...incoming };
|
|
6440
|
+
for (const [key, value] of Object.entries(incoming)) {
|
|
6441
|
+
const twin = stored[key];
|
|
6442
|
+
if (isSecretMarker(twin)) {
|
|
6443
|
+
if (typeof value === "string" && value === resolvedValue(pass, twin)) out[key] = twin;
|
|
6444
|
+
} else if (isRecord(value) && isRecord(twin)) out[key] = inArrayRow(pass, value, twin);
|
|
6445
|
+
else if (Array.isArray(value) && Array.isArray(twin)) out[key] = inArray(pass, value, twin);
|
|
6446
|
+
}
|
|
6447
|
+
return out;
|
|
6448
|
+
}
|
|
6449
|
+
async function walk(pass, incoming, stored) {
|
|
6450
|
+
if (isSecretMarker(stored)) return atMarker(pass, incoming, stored);
|
|
6451
|
+
if (Array.isArray(incoming) && Array.isArray(stored)) return inArray(pass, incoming, stored);
|
|
6452
|
+
if (!isRecord(incoming) || !isRecord(stored)) return incoming;
|
|
6453
|
+
const out = { ...incoming };
|
|
6454
|
+
for (const [key, value] of Object.entries(incoming)) out[key] = await walk(pass, value, stored[key]);
|
|
6455
|
+
return out;
|
|
6456
|
+
}
|
|
6457
|
+
/** Restore markers a write-back carries as values. See the file doc. */
|
|
6458
|
+
async function restoreUnchangedSecrets(input) {
|
|
6459
|
+
const refs = [];
|
|
6460
|
+
for (const key of Object.keys(input.patch)) collectSecretMarkerRefs(input.stored[key], refs);
|
|
6461
|
+
const owned = refs.filter((ref) => isSecretRefOwnedBy(ref, input.secrets.owner));
|
|
6462
|
+
if (owned.length === 0) return {
|
|
6463
|
+
patch: input.patch,
|
|
6464
|
+
changedRefs: []
|
|
6465
|
+
};
|
|
6466
|
+
const pass = {
|
|
6467
|
+
secrets: input.secrets,
|
|
6468
|
+
answers: await input.secrets.resolve([...new Set(owned)]),
|
|
6469
|
+
operatorWrite: input.operatorWrite,
|
|
6470
|
+
changedRefs: []
|
|
6471
|
+
};
|
|
6472
|
+
const out = {};
|
|
6473
|
+
for (const [key, value] of Object.entries(input.patch)) out[key] = await walk(pass, value, input.stored[key]);
|
|
6474
|
+
return {
|
|
6475
|
+
patch: out,
|
|
6476
|
+
changedRefs: pass.changedRefs
|
|
6477
|
+
};
|
|
6478
|
+
}
|
|
6479
|
+
/** Structural equality over JSON-shaped values (key order does not matter). */
|
|
6480
|
+
function isJsonEqual(a, b) {
|
|
6481
|
+
if (Object.is(a, b)) return true;
|
|
6482
|
+
if (Array.isArray(a)) return Array.isArray(b) && a.length === b.length && a.every((v, i) => isJsonEqual(v, b[i]));
|
|
6483
|
+
if (isRecord(a) && isRecord(b)) {
|
|
6484
|
+
const keys = Object.keys(a);
|
|
6485
|
+
if (keys.length !== Object.keys(b).length) return false;
|
|
6486
|
+
return keys.every((k) => Object.prototype.hasOwnProperty.call(b, k) && isJsonEqual(a[k], b[k]));
|
|
6307
6487
|
}
|
|
6308
6488
|
return false;
|
|
6309
6489
|
}
|
|
6490
|
+
/** The patch without the keys whose value already equals the stored one. */
|
|
6491
|
+
function dropUnchangedKeys(patch, stored) {
|
|
6492
|
+
const out = {};
|
|
6493
|
+
for (const [key, value] of Object.entries(patch)) {
|
|
6494
|
+
if (Object.prototype.hasOwnProperty.call(stored, key) && isJsonEqual(value, stored[key])) continue;
|
|
6495
|
+
out[key] = value;
|
|
6496
|
+
}
|
|
6497
|
+
return out;
|
|
6498
|
+
}
|
|
6499
|
+
/** The top-level keys of a blob that hold at least one of `owner`'s markers. */
|
|
6500
|
+
function markerKeysOf(blob, owner) {
|
|
6501
|
+
const keys = /* @__PURE__ */ new Set();
|
|
6502
|
+
for (const [key, value] of Object.entries(blob)) if (collectSecretMarkerRefs(value).some((ref) => isSecretRefOwnedBy(ref, owner))) keys.add(key);
|
|
6503
|
+
return keys;
|
|
6504
|
+
}
|
|
6505
|
+
function nodeFromStored(value, owner) {
|
|
6506
|
+
if (isSecretMarker(value)) return isSecretRefOwnedBy(value.$secret, owner) ? { kind: "leaf" } : null;
|
|
6507
|
+
if (!isRecord(value)) return null;
|
|
6508
|
+
const children = /* @__PURE__ */ new Map();
|
|
6509
|
+
for (const [key, child] of Object.entries(value)) {
|
|
6510
|
+
const node = nodeFromStored(child, owner);
|
|
6511
|
+
if (node !== null) children.set(key, node);
|
|
6512
|
+
}
|
|
6513
|
+
return children.size > 0 ? {
|
|
6514
|
+
kind: "object",
|
|
6515
|
+
children
|
|
6516
|
+
} : null;
|
|
6517
|
+
}
|
|
6518
|
+
/**
|
|
6519
|
+
* The declared secret tree, widened by every place the STORED blob holds a
|
|
6520
|
+
* marker under one of `keys` — so a marker the schema no longer declares (or
|
|
6521
|
+
* never declared: Wyze before b4906cec6) still gets the save path's
|
|
6522
|
+
* KEEP / SET / CLEAR semantics instead of being overwritten by whatever the
|
|
6523
|
+
* addon writes. Markers inside arrays are not added: a row has no id field to
|
|
6524
|
+
* match by unless the schema declares one. Only `owner`'s markers count: a
|
|
6525
|
+
* builtin that keeps another addon's marker (device-manager) never takes it
|
|
6526
|
+
* over.
|
|
6527
|
+
*/
|
|
6528
|
+
function widenTreeWithStoredMarkers(declared, stored, keys, owner) {
|
|
6529
|
+
const added = /* @__PURE__ */ new Map();
|
|
6530
|
+
for (const key of keys) {
|
|
6531
|
+
const at = key.indexOf("@");
|
|
6532
|
+
const base = at > 0 ? key.slice(0, at) : key;
|
|
6533
|
+
if (declared.has(base) || added.has(base)) continue;
|
|
6534
|
+
const node = nodeFromStored(stored[key], owner);
|
|
6535
|
+
if (node !== null) added.set(base, node);
|
|
6536
|
+
}
|
|
6537
|
+
return added.size === 0 ? declared : new Map([...declared, ...added]);
|
|
6538
|
+
}
|
|
6310
6539
|
/** The blob as stored now; a failed read REFUSES the write instead of guessing. */
|
|
6311
6540
|
async function readStoredAddonBlob(raw) {
|
|
6312
6541
|
const threeWay = raw.readAddonStoreResult;
|
|
@@ -6315,7 +6544,41 @@ async function readStoredAddonBlob(raw) {
|
|
|
6315
6544
|
if (result.kind === "failed") throw new Error(`settings write refused: the stored blob could not be read (${result.error})`);
|
|
6316
6545
|
return result.kind === "missing" ? {} : result.value;
|
|
6317
6546
|
}
|
|
6318
|
-
function
|
|
6547
|
+
function touchesTree(tree, patch) {
|
|
6548
|
+
if (tree.size === 0) return false;
|
|
6549
|
+
for (const key of Object.keys(patch)) {
|
|
6550
|
+
const at = key.indexOf("@");
|
|
6551
|
+
if (tree.has(at > 0 ? key.slice(0, at) : key)) return true;
|
|
6552
|
+
}
|
|
6553
|
+
return false;
|
|
6554
|
+
}
|
|
6555
|
+
/**
|
|
6556
|
+
* Which top-level keys of each store held markers when last seen. `undefined`
|
|
6557
|
+
* for a store not seen yet: its first write reads it, to be safe.
|
|
6558
|
+
*/
|
|
6559
|
+
var MarkerKeyIndex = class {
|
|
6560
|
+
owner;
|
|
6561
|
+
byStore = /* @__PURE__ */ new Map();
|
|
6562
|
+
constructor(owner) {
|
|
6563
|
+
this.owner = owner;
|
|
6564
|
+
}
|
|
6565
|
+
seen(store, blob) {
|
|
6566
|
+
this.byStore.set(store, markerKeysOf(blob, this.owner));
|
|
6567
|
+
}
|
|
6568
|
+
wrote(store, patch) {
|
|
6569
|
+
const keys = this.byStore.get(store);
|
|
6570
|
+
if (keys === void 0) return;
|
|
6571
|
+
const now = markerKeysOf(patch, this.owner);
|
|
6572
|
+
for (const key of Object.keys(patch)) if (now.has(key)) keys.add(key);
|
|
6573
|
+
else keys.delete(key);
|
|
6574
|
+
}
|
|
6575
|
+
mayHoldMarkers(store, patch) {
|
|
6576
|
+
const keys = this.byStore.get(store);
|
|
6577
|
+
if (keys === void 0) return true;
|
|
6578
|
+
return Object.keys(patch).some((key) => keys.has(key));
|
|
6579
|
+
}
|
|
6580
|
+
};
|
|
6581
|
+
function createHandle(raw, opts) {
|
|
6319
6582
|
const chains = /* @__PURE__ */ new Map();
|
|
6320
6583
|
const serialize = (key, fn) => {
|
|
6321
6584
|
const next = (chains.get(key) ?? Promise.resolve()).then(fn, fn);
|
|
@@ -6326,46 +6589,130 @@ function createSecretAwareSettings(raw, opts) {
|
|
|
6326
6589
|
});
|
|
6327
6590
|
return next;
|
|
6328
6591
|
};
|
|
6329
|
-
const
|
|
6330
|
-
|
|
6331
|
-
|
|
6592
|
+
const index = new MarkerKeyIndex(opts.secrets.owner);
|
|
6593
|
+
const resolveRead = async (store, blob) => {
|
|
6594
|
+
index.seen(store, blob);
|
|
6595
|
+
const { value, unresolved } = await resolveSecretMarkers(blob, opts.secrets, {
|
|
6596
|
+
unresolved: "keep-marker",
|
|
6597
|
+
ownedBy: opts.secrets.owner
|
|
6598
|
+
});
|
|
6599
|
+
if (unresolved.length > 0) opts.onUnresolved?.(unresolved);
|
|
6600
|
+
return value;
|
|
6601
|
+
};
|
|
6602
|
+
const write = async (store, declared, scope, patch, readStored, rawWrite) => {
|
|
6603
|
+
if (!touchesTree(declared, patch) && !index.mayHoldMarkers(store, patch)) {
|
|
6604
|
+
await rawWrite(patch);
|
|
6605
|
+
index.wrote(store, patch);
|
|
6606
|
+
return { changed: true };
|
|
6607
|
+
}
|
|
6608
|
+
return serialize(store, async () => {
|
|
6332
6609
|
const stored = await readStored();
|
|
6610
|
+
index.seen(store, stored);
|
|
6611
|
+
const operatorWrite = opts.isOperatorWrite?.() === true;
|
|
6612
|
+
const restored = await restoreUnchangedSecrets({
|
|
6613
|
+
patch,
|
|
6614
|
+
stored,
|
|
6615
|
+
secrets: opts.secrets,
|
|
6616
|
+
operatorWrite
|
|
6617
|
+
});
|
|
6333
6618
|
const result = await transformSecretWrite({
|
|
6334
|
-
tree,
|
|
6619
|
+
tree: widenTreeWithStoredMarkers(declared, stored, Object.keys(restored.patch), opts.secrets.owner),
|
|
6335
6620
|
secrets: opts.secrets,
|
|
6336
|
-
patch,
|
|
6621
|
+
patch: restored.patch,
|
|
6337
6622
|
stored,
|
|
6338
6623
|
...scope !== void 0 ? { scope } : {},
|
|
6339
|
-
operatorWrite
|
|
6624
|
+
operatorWrite
|
|
6340
6625
|
});
|
|
6341
|
-
|
|
6626
|
+
const effective = dropUnchangedKeys(result.patch, stored);
|
|
6627
|
+
const wroteBlob = Object.keys(effective).length > 0;
|
|
6628
|
+
if (wroteBlob) {
|
|
6629
|
+
await rawWrite(effective);
|
|
6630
|
+
index.wrote(store, effective);
|
|
6631
|
+
}
|
|
6342
6632
|
const { orphaned } = await result.afterWrite();
|
|
6343
6633
|
if (orphaned.length > 0) opts.onOrphaned(orphaned);
|
|
6634
|
+
return { changed: wroteBlob || restored.changedRefs.length > 0 };
|
|
6344
6635
|
});
|
|
6345
6636
|
};
|
|
6346
|
-
const
|
|
6347
|
-
|
|
6348
|
-
|
|
6349
|
-
|
|
6350
|
-
|
|
6351
|
-
|
|
6637
|
+
const writeAddon = (patch) => write("addon", opts.addonTree(), void 0, patch, () => readStoredAddonBlob(raw), (p) => raw.writeAddonStore(p));
|
|
6638
|
+
const readAddonStoreResult = raw.readAddonStoreResult;
|
|
6639
|
+
const readAddonStoreKeyResult = raw.readAddonStoreKeyResult;
|
|
6640
|
+
const readDeviceStoreBatch = raw.readDeviceStoreBatch;
|
|
6641
|
+
const overrides = {
|
|
6642
|
+
readAddonStore: async () => resolveRead("addon", await raw.readAddonStore()),
|
|
6643
|
+
...readAddonStoreResult !== void 0 ? { readAddonStoreResult: async () => {
|
|
6644
|
+
const result = await readAddonStoreResult.call(raw);
|
|
6645
|
+
return result.kind === "value" ? {
|
|
6646
|
+
kind: "value",
|
|
6647
|
+
value: await resolveRead("addon", result.value)
|
|
6648
|
+
} : result;
|
|
6649
|
+
} } : {},
|
|
6650
|
+
...readAddonStoreKeyResult !== void 0 ? { readAddonStoreKeyResult: async (key) => {
|
|
6651
|
+
const result = await readAddonStoreKeyResult.call(raw, key);
|
|
6652
|
+
if (result.kind !== "present") return result;
|
|
6653
|
+
const { value, unresolved } = await resolveSecretMarkers({ [key]: result.value }, opts.secrets, {
|
|
6654
|
+
unresolved: "keep-marker",
|
|
6655
|
+
ownedBy: opts.secrets.owner
|
|
6656
|
+
});
|
|
6657
|
+
if (unresolved.length > 0) opts.onUnresolved?.(unresolved);
|
|
6658
|
+
return {
|
|
6659
|
+
kind: "present",
|
|
6660
|
+
value: value[key]
|
|
6661
|
+
};
|
|
6662
|
+
} } : {},
|
|
6663
|
+
readDeviceStore: async (deviceId) => resolveRead(`device:${deviceId}`, await raw.readDeviceStore(deviceId)),
|
|
6664
|
+
...readDeviceStoreBatch !== void 0 ? { readDeviceStoreBatch: async (deviceIds) => {
|
|
6665
|
+
const rows = await readDeviceStoreBatch.call(raw, deviceIds);
|
|
6666
|
+
const out = /* @__PURE__ */ new Map();
|
|
6667
|
+
for (const [deviceId, blob] of rows) out.set(deviceId, await resolveRead(`device:${deviceId}`, blob));
|
|
6668
|
+
return out;
|
|
6669
|
+
} } : {},
|
|
6670
|
+
writeAddonStore: async (patch) => {
|
|
6671
|
+
await writeAddon(patch);
|
|
6672
|
+
},
|
|
6673
|
+
writeDeviceStore: async (deviceId, patch) => {
|
|
6674
|
+
await write(`device:${deviceId}`, opts.deviceTree(), {
|
|
6675
|
+
kind: "device",
|
|
6676
|
+
deviceId
|
|
6677
|
+
}, patch, () => raw.readDeviceStore(deviceId), (p) => raw.writeDeviceStore(deviceId, p));
|
|
6678
|
+
}
|
|
6679
|
+
};
|
|
6680
|
+
return {
|
|
6681
|
+
settings: new Proxy(raw, { get(target, prop, receiver) {
|
|
6682
|
+
if (typeof prop === "string" && Object.prototype.hasOwnProperty.call(overrides, prop)) return Reflect.get(overrides, prop);
|
|
6683
|
+
const value = Reflect.get(target, prop, receiver);
|
|
6684
|
+
return typeof value === "function" ? value.bind(target) : value;
|
|
6685
|
+
} }),
|
|
6686
|
+
raw: {
|
|
6687
|
+
readAddonStore: async () => {
|
|
6688
|
+
const blob = await raw.readAddonStore();
|
|
6689
|
+
index.seen("addon", blob);
|
|
6690
|
+
return blob;
|
|
6691
|
+
},
|
|
6692
|
+
readDeviceStore: async (deviceId) => {
|
|
6693
|
+
const blob = await raw.readDeviceStore(deviceId);
|
|
6694
|
+
index.seen(`device:${deviceId}`, blob);
|
|
6695
|
+
return blob;
|
|
6696
|
+
}
|
|
6697
|
+
},
|
|
6698
|
+
writeAddonStore: writeAddon
|
|
6352
6699
|
};
|
|
6353
|
-
return new Proxy(raw, { get(target, prop, receiver) {
|
|
6354
|
-
if (prop === "writeAddonStore") return wrapped.writeAddonStore;
|
|
6355
|
-
if (prop === "writeDeviceStore") return wrapped.writeDeviceStore;
|
|
6356
|
-
const value = Reflect.get(target, prop, receiver);
|
|
6357
|
-
return typeof value === "function" ? value.bind(target) : value;
|
|
6358
|
-
} });
|
|
6359
6700
|
}
|
|
6360
|
-
/** The context the addon sees
|
|
6361
|
-
function
|
|
6701
|
+
/** The context the addon sees, plus the private raw view and write outcome. */
|
|
6702
|
+
function createSecretAwareContext(context, opts) {
|
|
6362
6703
|
const raw = context.settings;
|
|
6363
|
-
if (raw === void 0) return
|
|
6364
|
-
|
|
6365
|
-
|
|
6366
|
-
|
|
6367
|
-
|
|
6368
|
-
|
|
6704
|
+
if (raw === void 0) return {
|
|
6705
|
+
context,
|
|
6706
|
+
handle: null
|
|
6707
|
+
};
|
|
6708
|
+
const handle = createHandle(raw, opts);
|
|
6709
|
+
return {
|
|
6710
|
+
context: new Proxy(context, { get(target, prop, receiver) {
|
|
6711
|
+
if (prop === "settings") return handle.settings;
|
|
6712
|
+
return Reflect.get(target, prop, receiver);
|
|
6713
|
+
} }),
|
|
6714
|
+
handle
|
|
6715
|
+
};
|
|
6369
6716
|
}
|
|
6370
6717
|
var LEAF = { kind: "leaf" };
|
|
6371
6718
|
var DEFAULT_ITEM_ID_KEY = "id";
|
|
@@ -6540,6 +6887,14 @@ var BaseAddon = class {
|
|
|
6540
6887
|
_secretChangeUnsub = null;
|
|
6541
6888
|
/** >0 while an OPERATOR's settings write is being applied. */
|
|
6542
6889
|
_operatorWriteDepth = 0;
|
|
6890
|
+
/**
|
|
6891
|
+
* The keychain-aware settings handle (D798). Its `raw` view is the ONLY way
|
|
6892
|
+
* to the marker-bearing blobs and stays private to this class: the form
|
|
6893
|
+
* hydrate and config resolution need markers, addon code never does.
|
|
6894
|
+
*/
|
|
6895
|
+
_secretSettings = null;
|
|
6896
|
+
/** Refs an addon-facing read could not resolve — each is logged once per process. */
|
|
6897
|
+
_loggedUnresolvedReads = /* @__PURE__ */ new Set();
|
|
6543
6898
|
constructor(defaults) {
|
|
6544
6899
|
this.defaults = defaults;
|
|
6545
6900
|
this._config = { ...defaults };
|
|
@@ -6576,13 +6931,21 @@ var BaseAddon = class {
|
|
|
6576
6931
|
}
|
|
6577
6932
|
async initialize(context) {
|
|
6578
6933
|
const secrets = context.secrets;
|
|
6579
|
-
|
|
6580
|
-
|
|
6581
|
-
|
|
6582
|
-
|
|
6583
|
-
|
|
6584
|
-
|
|
6585
|
-
|
|
6934
|
+
if (secrets !== void 0) {
|
|
6935
|
+
const { context: wrapped, handle } = createSecretAwareContext(context, {
|
|
6936
|
+
secrets,
|
|
6937
|
+
addonTree: () => this.addonSecretTree(),
|
|
6938
|
+
deviceTree: () => this.deviceSecretTree(),
|
|
6939
|
+
onOrphaned: (refs) => context.logger.warn("keychain refs dropped by a settings write could not be deleted", { meta: { refs: [...refs] } }),
|
|
6940
|
+
isOperatorWrite: () => this._operatorWriteDepth > 0,
|
|
6941
|
+
onUnresolved: (unresolved) => this.logUnresolvedRead(unresolved)
|
|
6942
|
+
});
|
|
6943
|
+
this._ctx = wrapped;
|
|
6944
|
+
this._secretSettings = handle;
|
|
6945
|
+
} else {
|
|
6946
|
+
this._ctx = context;
|
|
6947
|
+
this._secretSettings = null;
|
|
6948
|
+
}
|
|
6586
6949
|
await this.resolveConfig();
|
|
6587
6950
|
if (secrets !== void 0) this._secretChangeUnsub = secrets.onChange((ref) => {
|
|
6588
6951
|
if (this._configSecretRefs.has(ref)) this.scheduleSecretReresolve(SECRET_CHANGE_DEBOUNCE_MS);
|
|
@@ -6699,11 +7062,8 @@ var BaseAddon = class {
|
|
|
6699
7062
|
async getGlobalSettings(overlay, cap, nodeId) {
|
|
6700
7063
|
const schema = this.globalSettingsSchema(cap);
|
|
6701
7064
|
if (!schema) return { sections: [] };
|
|
6702
|
-
const projected = await this.
|
|
6703
|
-
return hydrateSchema(schema, overlay ? {
|
|
6704
|
-
...projected,
|
|
6705
|
-
...overlay
|
|
6706
|
-
} : projected, { inlineSecretsAsViews: true });
|
|
7065
|
+
const projected = await this.readRawProjectedStore(nodeId, cap);
|
|
7066
|
+
return hydrateSchema(schema, overlay ? await this.overlayKeepingMarkers(projected, overlay) : projected, { inlineSecretsAsViews: true });
|
|
6707
7067
|
}
|
|
6708
7068
|
/**
|
|
6709
7069
|
* The integration-level view of this addon's settings: exactly the sections
|
|
@@ -6748,7 +7108,7 @@ var BaseAddon = class {
|
|
|
6748
7108
|
});
|
|
6749
7109
|
}
|
|
6750
7110
|
if (sections.length === 0) return null;
|
|
6751
|
-
const projected = await this.
|
|
7111
|
+
const projected = await this.readRawProjectedStore(nodeId);
|
|
6752
7112
|
return hydrateSchema({
|
|
6753
7113
|
...schema,
|
|
6754
7114
|
sections
|
|
@@ -6765,12 +7125,50 @@ var BaseAddon = class {
|
|
|
6765
7125
|
* the store for custom option logic (option narrowing, value snapping) to
|
|
6766
7126
|
* read it per-node — never `ctx.settings.readAddonStore()` directly.
|
|
6767
7127
|
* `nodeId` omitted ⇒ the local node (node-blind injection from ctx).
|
|
7128
|
+
*
|
|
7129
|
+
* Keychain values come back RESOLVED (D798): a secret reads as its value,
|
|
7130
|
+
* never as a `{ $secret }` marker. One the keychain cannot serve right now
|
|
7131
|
+
* stays a marker — "stored, unavailable" (`isSecretMarker()` is true, and it
|
|
7132
|
+
* is listed in {@link unresolvedSecrets}) — never `''` and never absent, so
|
|
7133
|
+
* it cannot be mistaken for "nothing stored, mint a new one". Writing the
|
|
7134
|
+
* resolved blob back is a no-op for every unchanged secret.
|
|
6768
7135
|
*/
|
|
6769
7136
|
async resolveGlobalStore(nodeId, cap) {
|
|
6770
7137
|
const raw = await this._ctx?.settings?.readAddonStore() ?? {};
|
|
7138
|
+
return this.projectForNode(raw, nodeId, cap);
|
|
7139
|
+
}
|
|
7140
|
+
projectForNode(store, nodeId, cap) {
|
|
6771
7141
|
const keys = this.perNodeKeys(cap);
|
|
6772
7142
|
const node = normalizeNodeId(nodeId ?? this._ctx?.kernel?.localNodeId);
|
|
6773
|
-
return keys.size > 0 ? projectStore(
|
|
7143
|
+
return keys.size > 0 ? projectStore(store, keys, node) : store;
|
|
7144
|
+
}
|
|
7145
|
+
/** The PROJECTED store with its markers — the form hydrate only (D798). */
|
|
7146
|
+
async readRawProjectedStore(nodeId, cap) {
|
|
7147
|
+
const raw = await this.rawSettings()?.readAddonStore() ?? {};
|
|
7148
|
+
return this.projectForNode(raw, nodeId, cap);
|
|
7149
|
+
}
|
|
7150
|
+
/**
|
|
7151
|
+
* `{ ...stored, ...overlay }`, except that an overlay member equal to the
|
|
7152
|
+
* RESOLVED stored one keeps the stored (marker-bearing) member — so a form
|
|
7153
|
+
* hydrated from a resolved overlay still shows a secret as "set", never as
|
|
7154
|
+
* its value.
|
|
7155
|
+
*/
|
|
7156
|
+
async overlayKeepingMarkers(stored, overlay) {
|
|
7157
|
+
const secrets = this._ctx?.secrets;
|
|
7158
|
+
const merged = {
|
|
7159
|
+
...stored,
|
|
7160
|
+
...overlay
|
|
7161
|
+
};
|
|
7162
|
+
if (secrets === void 0 || collectSecretMarkerRefs(stored).length === 0) return merged;
|
|
7163
|
+
const { value: resolved } = await resolveSecretMarkers(stored, secrets, {
|
|
7164
|
+
unresolved: "keep-marker",
|
|
7165
|
+
ownedBy: secrets.owner
|
|
7166
|
+
});
|
|
7167
|
+
for (const key of Object.keys(overlay)) {
|
|
7168
|
+
if (collectSecretMarkerRefs(stored[key]).length === 0) continue;
|
|
7169
|
+
if (isJsonEqual(overlay[key], resolved[key])) merged[key] = stored[key];
|
|
7170
|
+
}
|
|
7171
|
+
return merged;
|
|
6774
7172
|
}
|
|
6775
7173
|
/**
|
|
6776
7174
|
* Whether ONE global key of this addon's store was written, read three-way
|
|
@@ -6835,8 +7233,12 @@ var BaseAddon = class {
|
|
|
6835
7233
|
async clearSecrets(keys, nodeId) {
|
|
6836
7234
|
const tree = this.addonSecretTree();
|
|
6837
7235
|
const keychain = this._ctx?.secrets !== void 0;
|
|
7236
|
+
const stored = keychain ? await this.readAddonStoreWithRetry() : {};
|
|
6838
7237
|
const patch = {};
|
|
6839
|
-
for (const key of keys)
|
|
7238
|
+
for (const key of keys) {
|
|
7239
|
+
const keychainStored = tree.has(key) || collectSecretMarkerRefs(stored[key]).length > 0;
|
|
7240
|
+
patch[key] = keychain && keychainStored ? SECRET_CLEAR : "";
|
|
7241
|
+
}
|
|
6840
7242
|
await this.applyGlobalPatch(patch, nodeId);
|
|
6841
7243
|
}
|
|
6842
7244
|
async applyGlobalPatch(barePatch, nodeId) {
|
|
@@ -6844,7 +7246,11 @@ var BaseAddon = class {
|
|
|
6844
7246
|
const localNode = normalizeNodeId(this._ctx?.kernel?.localNodeId);
|
|
6845
7247
|
const target = normalizeNodeId(nodeId ?? this._ctx?.kernel?.localNodeId);
|
|
6846
7248
|
const scoped = keys.size > 0 ? scopePatch(barePatch, keys, target) : barePatch;
|
|
6847
|
-
|
|
7249
|
+
const handle = this._secretSettings;
|
|
7250
|
+
if (handle !== null) {
|
|
7251
|
+
const { changed } = await handle.writeAddonStore(scoped);
|
|
7252
|
+
if (!changed) return;
|
|
7253
|
+
} else await this._ctx?.settings?.writeAddonStore(scoped);
|
|
6848
7254
|
if (target !== localNode) return;
|
|
6849
7255
|
await this.resolveConfig();
|
|
6850
7256
|
await this.onConfigChanged();
|
|
@@ -6897,7 +7303,7 @@ var BaseAddon = class {
|
|
|
6897
7303
|
async getDeviceSettings(deviceId) {
|
|
6898
7304
|
const schema = this.deviceSettingsSchema();
|
|
6899
7305
|
if (!schema) return { sections: [] };
|
|
6900
|
-
return hydrateSchema(schema, await this.
|
|
7306
|
+
return hydrateSchema(schema, await this.rawSettings()?.readDeviceStore(deviceId) ?? {}, { inlineSecretsAsViews: true });
|
|
6901
7307
|
}
|
|
6902
7308
|
async updateDeviceSettings(deviceId, patch) {
|
|
6903
7309
|
await this._ctx?.settings?.writeDeviceStore(deviceId, patch);
|
|
@@ -7069,7 +7475,7 @@ var BaseAddon = class {
|
|
|
7069
7475
|
key,
|
|
7070
7476
|
schema,
|
|
7071
7477
|
fallback,
|
|
7072
|
-
read: async () => this.resolveStoredSecrets(await this.
|
|
7478
|
+
read: async () => this.resolveStoredSecrets(await this.rawSettings()?.readDeviceStore(deviceId) ?? {}, false),
|
|
7073
7479
|
write: async (patch) => {
|
|
7074
7480
|
await this._ctx?.settings?.writeDeviceStore(deviceId, patch);
|
|
7075
7481
|
},
|
|
@@ -7131,6 +7537,23 @@ var BaseAddon = class {
|
|
|
7131
7537
|
}
|
|
7132
7538
|
return value;
|
|
7133
7539
|
}
|
|
7540
|
+
/**
|
|
7541
|
+
* The marker-bearing settings reads (D798) — private on purpose. Without a
|
|
7542
|
+
* keychain the context's own view is already raw.
|
|
7543
|
+
*/
|
|
7544
|
+
rawSettings() {
|
|
7545
|
+
return this._secretSettings?.raw ?? this._ctx?.settings;
|
|
7546
|
+
}
|
|
7547
|
+
/** An addon-facing read met markers it could not resolve: say so once per ref. */
|
|
7548
|
+
logUnresolvedRead(unresolved) {
|
|
7549
|
+
const fresh = unresolved.filter((u) => !this._loggedUnresolvedReads.has(u.ref));
|
|
7550
|
+
if (fresh.length === 0) return;
|
|
7551
|
+
for (const u of fresh) this._loggedUnresolvedReads.add(u.ref);
|
|
7552
|
+
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) => ({
|
|
7553
|
+
ref: u.ref,
|
|
7554
|
+
reason: u.reason
|
|
7555
|
+
})) } });
|
|
7556
|
+
}
|
|
7134
7557
|
/** Re-resolve the config (a keychain-only change, or a retry) and apply it. */
|
|
7135
7558
|
scheduleSecretReresolve(delayMs) {
|
|
7136
7559
|
const timerOf = delayMs === SECRET_CHANGE_DEBOUNCE_MS ? "_secretChangeTimer" : "_secretRetryTimer";
|
|
@@ -7157,7 +7580,7 @@ var BaseAddon = class {
|
|
|
7157
7580
|
* `{}` (defaults) — the addon's first successful patch will rehydrate.
|
|
7158
7581
|
*/
|
|
7159
7582
|
async readAddonStoreWithRetry() {
|
|
7160
|
-
const settings = this.
|
|
7583
|
+
const settings = this.rawSettings();
|
|
7161
7584
|
if (!settings) return {};
|
|
7162
7585
|
const delaysMs = [
|
|
7163
7586
|
150,
|
|
@@ -9551,6 +9974,278 @@ var DERIVED_CAMERA_SILENCED_CAP_NAMES = [
|
|
|
9551
9974
|
"scene-monitor"
|
|
9552
9975
|
];
|
|
9553
9976
|
/**
|
|
9977
|
+
* The trainer contract — what the hub hands the cloud trainer and what it
|
|
9978
|
+
* gets back (cloud training, D805+).
|
|
9979
|
+
*
|
|
9980
|
+
* The trainer (`hf/camstack-trainer`, published as the Hugging Face repo
|
|
9981
|
+
* `camstack/camstack-trainer`) is a separate AGPL program the hub never
|
|
9982
|
+
* imports: `job.json` goes in, files come out, and progress is `CAMSTACK_EVENT`
|
|
9983
|
+
* lines on stdout. These schemas are the hub's half of that boundary; the
|
|
9984
|
+
* trainer's pydantic models (and the JSON Schemas generated from them under
|
|
9985
|
+
* `hf/camstack-trainer/schemas/`) are the other half. A change here is a
|
|
9986
|
+
* change there, in the same piece of work.
|
|
9987
|
+
*
|
|
9988
|
+
* No `.default()` anywhere: defaults do not run on the addon cap path, so the
|
|
9989
|
+
* orchestrator fills every field of a job spec explicitly.
|
|
9990
|
+
*/
|
|
9991
|
+
var TRAINING_JOB_SCHEMA = "camstack.training/v1";
|
|
9992
|
+
var TRAINING_RESULT_SCHEMA = "camstack.training-result/v1";
|
|
9993
|
+
/** What the trainer can export. Edge TPU is a later, separate image. */
|
|
9994
|
+
var TrainingExportSchema = _enum([
|
|
9995
|
+
"onnx",
|
|
9996
|
+
"openvino-fp16",
|
|
9997
|
+
"openvino-int8",
|
|
9998
|
+
"coreml-fp16"
|
|
9999
|
+
]);
|
|
10000
|
+
var FloorsSchema = record(string(), number().min(0).max(1));
|
|
10001
|
+
object({
|
|
10002
|
+
schema: literal(TRAINING_JOB_SCHEMA),
|
|
10003
|
+
jobKey: string().uuid(),
|
|
10004
|
+
target: object({
|
|
10005
|
+
kind: literal("detector"),
|
|
10006
|
+
step: literal("object-detection")
|
|
10007
|
+
}),
|
|
10008
|
+
base: object({
|
|
10009
|
+
modelId: string().min(1),
|
|
10010
|
+
/** Ultralytics weights id, e.g. `yolov9m.pt`. */
|
|
10011
|
+
weights: string().min(1),
|
|
10012
|
+
imgsz: number().int().positive()
|
|
10013
|
+
}),
|
|
10014
|
+
baseline: object({
|
|
10015
|
+
modelId: string().min(1),
|
|
10016
|
+
/** The baseline ONNX the holdout comparison runs; public mirror URL. */
|
|
10017
|
+
onnxUrl: string().url(),
|
|
10018
|
+
imgsz: number().int().positive(),
|
|
10019
|
+
floors: FloorsSchema
|
|
10020
|
+
}),
|
|
10021
|
+
dataset: object({
|
|
10022
|
+
versionId: string().min(1),
|
|
10023
|
+
annotationHash: string(),
|
|
10024
|
+
/** sha256 of the uploaded archive; the trainer refuses a mismatch (exit 65). */
|
|
10025
|
+
sha256: string().regex(/^[0-9a-f]{64}$/)
|
|
10026
|
+
}),
|
|
10027
|
+
split: object({
|
|
10028
|
+
holdoutCameras: array(number().int()),
|
|
10029
|
+
/** When no camera is held out: the last N days of every camera. */
|
|
10030
|
+
holdoutLastDays: number().int().nonnegative(),
|
|
10031
|
+
valFraction: number().min(0).max(.5),
|
|
10032
|
+
seed: number().int()
|
|
10033
|
+
}),
|
|
10034
|
+
hyper: object({
|
|
10035
|
+
epochs: number().int().positive(),
|
|
10036
|
+
batch: number().int().positive(),
|
|
10037
|
+
lr0: number().positive(),
|
|
10038
|
+
/** Layers frozen from the start of the backbone; 0 = none. */
|
|
10039
|
+
freeze: number().int().nonnegative(),
|
|
10040
|
+
patience: number().int().nonnegative(),
|
|
10041
|
+
seed: number().int()
|
|
10042
|
+
}),
|
|
10043
|
+
replay: object({
|
|
10044
|
+
source: literal("coco2017"),
|
|
10045
|
+
count: number().int().nonnegative()
|
|
10046
|
+
}),
|
|
10047
|
+
exports: array(TrainingExportSchema).min(1),
|
|
10048
|
+
calibration: object({ maxFrames: number().int().positive() }),
|
|
10049
|
+
floors: object({
|
|
10050
|
+
minSupport: number().int().positive(),
|
|
10051
|
+
clamp: number().min(0).max(1)
|
|
10052
|
+
}),
|
|
10053
|
+
int8Gate: object({ maxMap50Drop: number().min(0).max(1) }),
|
|
10054
|
+
catalog: object({
|
|
10055
|
+
id: string().regex(/^[a-z0-9][a-z0-9-]{2,80}$/),
|
|
10056
|
+
name: string().min(1).max(160)
|
|
10057
|
+
})
|
|
10058
|
+
});
|
|
10059
|
+
/** One regular file of the bundle. An mlpackage contributes one row per member. */
|
|
10060
|
+
var TrainingResultFileSchema = object({
|
|
10061
|
+
path: string().min(1),
|
|
10062
|
+
bytes: number().int().nonnegative(),
|
|
10063
|
+
sha256: string().regex(/^[0-9a-f]{64}$/),
|
|
10064
|
+
format: _enum([
|
|
10065
|
+
"onnx",
|
|
10066
|
+
"openvino",
|
|
10067
|
+
"coreml",
|
|
10068
|
+
"pt"
|
|
10069
|
+
]),
|
|
10070
|
+
variant: _enum(["base", "int8"])
|
|
10071
|
+
});
|
|
10072
|
+
var DraftFormatSchema = object({
|
|
10073
|
+
/** RELATIVE path inside the bundle; the hub rewrites it to `camstack-local://`. */
|
|
10074
|
+
url: string().min(1),
|
|
10075
|
+
sizeMB: number().nonnegative(),
|
|
10076
|
+
isDirectory: boolean().optional(),
|
|
10077
|
+
files: array(string()).optional(),
|
|
10078
|
+
runtimes: array(literal("python")).optional(),
|
|
10079
|
+
revision: string().min(1)
|
|
10080
|
+
});
|
|
10081
|
+
/** The trainer's half of a catalog entry; the hub completes it (labels, licence, group). */
|
|
10082
|
+
var TrainingCatalogDraftSchema = object({
|
|
10083
|
+
id: string().min(1),
|
|
10084
|
+
name: string().min(1),
|
|
10085
|
+
description: string(),
|
|
10086
|
+
labels: array(unknown()),
|
|
10087
|
+
inputSize: object({
|
|
10088
|
+
width: number().int().positive(),
|
|
10089
|
+
height: number().int().positive()
|
|
10090
|
+
}),
|
|
10091
|
+
preprocessMode: literal("letterbox"),
|
|
10092
|
+
defaultClassFloors: FloorsSchema,
|
|
10093
|
+
formats: object({
|
|
10094
|
+
onnx: DraftFormatSchema.optional(),
|
|
10095
|
+
openvino: DraftFormatSchema.optional(),
|
|
10096
|
+
coreml: DraftFormatSchema.optional()
|
|
10097
|
+
})
|
|
10098
|
+
});
|
|
10099
|
+
/** One class of one model's holdout report (the eval harness's summary). */
|
|
10100
|
+
var TrainingEvalClassSchema = object({
|
|
10101
|
+
positives: number().int(),
|
|
10102
|
+
floor: number().nullable(),
|
|
10103
|
+
tp: number().int(),
|
|
10104
|
+
fp: number().int(),
|
|
10105
|
+
fn: number().int(),
|
|
10106
|
+
precision: number().nullable(),
|
|
10107
|
+
recall: number().nullable(),
|
|
10108
|
+
ap50: number().nullable(),
|
|
10109
|
+
recallByCamera: record(string(), number().nullable()).optional(),
|
|
10110
|
+
recallByLight: record(string(), number().nullable()).optional(),
|
|
10111
|
+
fpByCamera: record(string(), number()).optional(),
|
|
10112
|
+
smallFound: number().int().optional(),
|
|
10113
|
+
smallTotal: number().int().optional()
|
|
10114
|
+
}).passthrough();
|
|
10115
|
+
var TrainingEvalReportSchema = object({
|
|
10116
|
+
frames: number().int(),
|
|
10117
|
+
classes: record(string(), TrainingEvalClassSchema)
|
|
10118
|
+
}).passthrough();
|
|
10119
|
+
/**
|
|
10120
|
+
* A succeeded result carries every block; a failed one carries the error and
|
|
10121
|
+
* whatever was known by then — the other blocks are ABSENT, not null. The
|
|
10122
|
+
* orchestrator checks the blocks it needs before it trusts a success.
|
|
10123
|
+
*/
|
|
10124
|
+
var TrainingResultSchema = object({
|
|
10125
|
+
schema: literal(TRAINING_RESULT_SCHEMA),
|
|
10126
|
+
jobKey: string(),
|
|
10127
|
+
status: _enum(["succeeded", "failed"]),
|
|
10128
|
+
error: object({
|
|
10129
|
+
stage: string(),
|
|
10130
|
+
code: string(),
|
|
10131
|
+
message: string()
|
|
10132
|
+
}).nullable(),
|
|
10133
|
+
trainer: object({
|
|
10134
|
+
version: string(),
|
|
10135
|
+
revision: string()
|
|
10136
|
+
}),
|
|
10137
|
+
toolchain: record(string(), string().nullable()),
|
|
10138
|
+
dataset: object({
|
|
10139
|
+
versionId: string(),
|
|
10140
|
+
annotationHash: string(),
|
|
10141
|
+
sha256: string(),
|
|
10142
|
+
frames: object({
|
|
10143
|
+
train: number().int(),
|
|
10144
|
+
val: number().int(),
|
|
10145
|
+
holdout: number().int()
|
|
10146
|
+
}),
|
|
10147
|
+
holdoutCameras: array(number().int()),
|
|
10148
|
+
replayImages: number().int()
|
|
10149
|
+
}).optional(),
|
|
10150
|
+
training: object({
|
|
10151
|
+
epochsRun: number().int(),
|
|
10152
|
+
bestEpoch: number().int(),
|
|
10153
|
+
bestMap50: number(),
|
|
10154
|
+
bestMap50_95: number(),
|
|
10155
|
+
seconds: number()
|
|
10156
|
+
}).optional(),
|
|
10157
|
+
evaluation: object({
|
|
10158
|
+
holdoutFrames: number().int(),
|
|
10159
|
+
baseline: TrainingEvalReportSchema.nullable(),
|
|
10160
|
+
candidate: TrainingEvalReportSchema.nullable(),
|
|
10161
|
+
candidateInt8: TrainingEvalReportSchema.nullable(),
|
|
10162
|
+
recallDeltaByCamera: record(string(), record(string(), number())).nullable(),
|
|
10163
|
+
map50: record(string(), number().nullable())
|
|
10164
|
+
}).optional(),
|
|
10165
|
+
floors: object({
|
|
10166
|
+
baseline: FloorsSchema,
|
|
10167
|
+
candidate: FloorsSchema,
|
|
10168
|
+
candidateInt8: FloorsSchema.nullable(),
|
|
10169
|
+
notes: array(string())
|
|
10170
|
+
}).optional(),
|
|
10171
|
+
int8: object({
|
|
10172
|
+
kept: boolean(),
|
|
10173
|
+
map50Fp16: number().nullable(),
|
|
10174
|
+
map50Int8: number().nullable(),
|
|
10175
|
+
reason: string().nullable()
|
|
10176
|
+
}).optional(),
|
|
10177
|
+
exportsDropped: array(object({
|
|
10178
|
+
export: string(),
|
|
10179
|
+
reason: string()
|
|
10180
|
+
})).optional(),
|
|
10181
|
+
files: array(TrainingResultFileSchema).optional(),
|
|
10182
|
+
bundle: object({
|
|
10183
|
+
path: literal("bundle.tar"),
|
|
10184
|
+
bytes: number().int().nonnegative(),
|
|
10185
|
+
sha256: string().regex(/^[0-9a-f]{64}$/)
|
|
10186
|
+
}).nullable().optional(),
|
|
10187
|
+
catalogDraft: object({
|
|
10188
|
+
base: TrainingCatalogDraftSchema,
|
|
10189
|
+
int8: TrainingCatalogDraftSchema.nullable()
|
|
10190
|
+
}).nullable().optional(),
|
|
10191
|
+
licence: string()
|
|
10192
|
+
});
|
|
10193
|
+
var TrainingStageSchema = _enum([
|
|
10194
|
+
"prepare",
|
|
10195
|
+
"replay",
|
|
10196
|
+
"train",
|
|
10197
|
+
"eval",
|
|
10198
|
+
"export",
|
|
10199
|
+
"package"
|
|
10200
|
+
]);
|
|
10201
|
+
var EventBase = {
|
|
10202
|
+
v: literal(1),
|
|
10203
|
+
ts: number()
|
|
10204
|
+
};
|
|
10205
|
+
discriminatedUnion("type", [
|
|
10206
|
+
object({
|
|
10207
|
+
...EventBase,
|
|
10208
|
+
type: literal("stage"),
|
|
10209
|
+
stage: TrainingStageSchema
|
|
10210
|
+
}),
|
|
10211
|
+
object({
|
|
10212
|
+
...EventBase,
|
|
10213
|
+
type: literal("epoch"),
|
|
10214
|
+
epoch: number().int(),
|
|
10215
|
+
epochs: number().int(),
|
|
10216
|
+
boxLoss: number().nullable().optional(),
|
|
10217
|
+
map50: number().nullable().optional(),
|
|
10218
|
+
map50_95: number().nullable().optional(),
|
|
10219
|
+
etaSec: number().nullable().optional()
|
|
10220
|
+
}),
|
|
10221
|
+
object({
|
|
10222
|
+
...EventBase,
|
|
10223
|
+
type: literal("metric"),
|
|
10224
|
+
name: string(),
|
|
10225
|
+
value: number()
|
|
10226
|
+
}),
|
|
10227
|
+
object({
|
|
10228
|
+
...EventBase,
|
|
10229
|
+
type: literal("artifact"),
|
|
10230
|
+
path: string(),
|
|
10231
|
+
bytes: number(),
|
|
10232
|
+
sha256: string()
|
|
10233
|
+
}),
|
|
10234
|
+
object({
|
|
10235
|
+
...EventBase,
|
|
10236
|
+
type: literal("done"),
|
|
10237
|
+
status: _enum(["succeeded", "failed"]),
|
|
10238
|
+
resultSha256: string().nullable().optional()
|
|
10239
|
+
}),
|
|
10240
|
+
object({
|
|
10241
|
+
...EventBase,
|
|
10242
|
+
type: literal("error"),
|
|
10243
|
+
stage: string(),
|
|
10244
|
+
code: string(),
|
|
10245
|
+
message: string()
|
|
10246
|
+
})
|
|
10247
|
+
]);
|
|
10248
|
+
/**
|
|
9554
10249
|
* What the gate decided about a birth, from the CALLER's point of view.
|
|
9555
10250
|
*
|
|
9556
10251
|
* Deliberately not `ConfirmationVerdict`: `undecided` is not a birth decision
|
|
@@ -11878,7 +12573,9 @@ var AddonHttpRouteSchema = object({
|
|
|
11878
12573
|
"authenticated",
|
|
11879
12574
|
"admin"
|
|
11880
12575
|
]).optional(),
|
|
11881
|
-
description: string().optional()
|
|
12576
|
+
description: string().optional(),
|
|
12577
|
+
/** The hub limits this route per client address before the handler runs. */
|
|
12578
|
+
rateLimit: _enum(["auth"]).optional()
|
|
11882
12579
|
});
|
|
11883
12580
|
/**
|
|
11884
12581
|
* Cross-process route invocation envelope. The hub captures the
|
|
@@ -12583,6 +13280,37 @@ var BackupDestinationInfoSchema = object({
|
|
|
12583
13280
|
lastError: string().optional()
|
|
12584
13281
|
});
|
|
12585
13282
|
/**
|
|
13283
|
+
* How an archive is encrypted (operator decision 2026-10-09): to a backup
|
|
13284
|
+
* PUBLIC key the hub holds, so only the operator's secret key opens it.
|
|
13285
|
+
* Absent on a plain `.tar.gz` — every archive made before encryption, or
|
|
13286
|
+
* with it off — which restores without a key.
|
|
13287
|
+
*/
|
|
13288
|
+
var BackupArchiveEncryptionSchema = object({
|
|
13289
|
+
/** `x25519-hkdf-aes256gcm-stream-v1`. */
|
|
13290
|
+
scheme: string(),
|
|
13291
|
+
/** 16 hex — the backup key whose secret restores this archive. */
|
|
13292
|
+
keyId: string()
|
|
13293
|
+
});
|
|
13294
|
+
/**
|
|
13295
|
+
* The backup encryption setting. The hub keeps PUBLIC keys only: the active
|
|
13296
|
+
* one new archives are encrypted to, and the retired ones older archives
|
|
13297
|
+
* still need. The secret key is shown once, at `setupEncryption`.
|
|
13298
|
+
*/
|
|
13299
|
+
var BackupEncryptionStatusSchema = object({
|
|
13300
|
+
enabled: boolean(),
|
|
13301
|
+
active: object({
|
|
13302
|
+
keyId: string(),
|
|
13303
|
+
publicKey: string(),
|
|
13304
|
+
createdAt: number()
|
|
13305
|
+
}).nullable(),
|
|
13306
|
+
/** Every key ever set up, newest first. */
|
|
13307
|
+
keys: array(object({
|
|
13308
|
+
keyId: string(),
|
|
13309
|
+
createdAt: number(),
|
|
13310
|
+
retiredAt: number().nullable()
|
|
13311
|
+
})).readonly()
|
|
13312
|
+
});
|
|
13313
|
+
/**
|
|
12586
13314
|
* Per-archive entry returned by `backup.listArchives({ destinationId })`.
|
|
12587
13315
|
* Same shape the destination drill-in renders. Sourced from the per-
|
|
12588
13316
|
* location `manifests.json` (no per-archive tarball read required).
|
|
@@ -12594,7 +13322,9 @@ var BackupArchiveEntrySchema = object({
|
|
|
12594
13322
|
sizeBytes: number(),
|
|
12595
13323
|
label: string().optional(),
|
|
12596
13324
|
/** Top-level locations included in the archive (db, addons, tls, …). */
|
|
12597
|
-
locations: array(string()).readonly()
|
|
13325
|
+
locations: array(string()).readonly(),
|
|
13326
|
+
/** Present when the archive is encrypted; restore then needs that key. */
|
|
13327
|
+
encryption: BackupArchiveEncryptionSchema.optional()
|
|
12598
13328
|
});
|
|
12599
13329
|
var BackupEntrySchema = object({
|
|
12600
13330
|
id: string(),
|
|
@@ -12603,7 +13333,8 @@ var BackupEntrySchema = object({
|
|
|
12603
13333
|
label: string().optional(),
|
|
12604
13334
|
createdAt: number(),
|
|
12605
13335
|
sizeBytes: number(),
|
|
12606
|
-
locations: array(string()).optional()
|
|
13336
|
+
locations: array(string()).optional(),
|
|
13337
|
+
encryption: BackupArchiveEncryptionSchema.optional()
|
|
12607
13338
|
});
|
|
12608
13339
|
var ArchiveEntrySchema = object({
|
|
12609
13340
|
path: string(),
|
|
@@ -12792,10 +13523,40 @@ method(_void(), array(BackupDestinationInfoSchema).readonly(), { auth: "admin" }
|
|
|
12792
13523
|
* this list and skips entries whose path doesn't start with
|
|
12793
13524
|
* any of them.
|
|
12794
13525
|
*/
|
|
12795
|
-
locations: array(string()).optional()
|
|
13526
|
+
locations: array(string()).optional(),
|
|
13527
|
+
/**
|
|
13528
|
+
* The backup SECRET key, for an encrypted archive (ignored for a plain
|
|
13529
|
+
* one). The archive is decrypted into the hub's private staging
|
|
13530
|
+
* before the restart; the key is not stored. A wrong or missing key
|
|
13531
|
+
* is refused before the archive is downloaded.
|
|
13532
|
+
*/
|
|
13533
|
+
backupSecretKey: string().optional()
|
|
12796
13534
|
}), _void(), {
|
|
12797
13535
|
kind: "mutation",
|
|
12798
13536
|
auth: "admin"
|
|
13537
|
+
}), method(_void(), BackupEncryptionStatusSchema, { auth: "admin" }), method(object({}), object({
|
|
13538
|
+
keyId: string(),
|
|
13539
|
+
secretKey: string(),
|
|
13540
|
+
publicKey: string(),
|
|
13541
|
+
createdAt: number(),
|
|
13542
|
+
replacedKeyId: string().nullable()
|
|
13543
|
+
}), {
|
|
13544
|
+
kind: "mutation",
|
|
13545
|
+
auth: "admin"
|
|
13546
|
+
}), method(object({}), object({ disabledKeyId: string().nullable() }), {
|
|
13547
|
+
kind: "mutation",
|
|
13548
|
+
auth: "admin"
|
|
13549
|
+
}), method(object({ backupSecretKey: string() }), object({
|
|
13550
|
+
valid: boolean(),
|
|
13551
|
+
keyId: string().nullable(),
|
|
13552
|
+
/** The hub knows this key (active or retired). */
|
|
13553
|
+
known: boolean(),
|
|
13554
|
+
/** It is the key new archives are encrypted to. */
|
|
13555
|
+
active: boolean(),
|
|
13556
|
+
error: string().optional()
|
|
13557
|
+
}), {
|
|
13558
|
+
kind: "mutation",
|
|
13559
|
+
auth: "admin"
|
|
12799
13560
|
}), method(object({
|
|
12800
13561
|
destinationId: string(),
|
|
12801
13562
|
backupId: string()
|
|
@@ -14521,7 +15282,60 @@ var CustomModelDescriptorSchema = object({
|
|
|
14521
15282
|
stepId: string(),
|
|
14522
15283
|
entry: ModelCatalogEntrySchema
|
|
14523
15284
|
});
|
|
14524
|
-
|
|
15285
|
+
/** One regular file of an imported bundle, as the producer measured it. */
|
|
15286
|
+
var ModelBundleFileSchema = object({
|
|
15287
|
+
/** Relative path inside the bundle tar; an mlpackage member is `<x>.mlpackage/<member>`. */
|
|
15288
|
+
path: string().min(1),
|
|
15289
|
+
bytes: number().int().nonnegative(),
|
|
15290
|
+
sha256: string().regex(/^[0-9a-f]{64}$/)
|
|
15291
|
+
});
|
|
15292
|
+
var ImportModelBundleInputSchema = object({
|
|
15293
|
+
/** The registry provider that keeps the model (Model Studio). */
|
|
15294
|
+
addonId: string(),
|
|
15295
|
+
stepId: string().min(1),
|
|
15296
|
+
/**
|
|
15297
|
+
* The catalog rows to register, complete, every format URL already
|
|
15298
|
+
* `camstack-local://<modelId>/<file>` naming a file of the bundle. One
|
|
15299
|
+
* bundle may carry several rows (a base and its INT8 variant).
|
|
15300
|
+
*/
|
|
15301
|
+
entries: array(ModelCatalogEntrySchema).min(1).max(4),
|
|
15302
|
+
/** The bundle tar, offered by the producer over `ctx.peerBytes` (same host). */
|
|
15303
|
+
bundle: object({
|
|
15304
|
+
ticket: PeerBytesTicketSchema,
|
|
15305
|
+
bytes: number().int().positive(),
|
|
15306
|
+
sha256: string().regex(/^[0-9a-f]{64}$/)
|
|
15307
|
+
}),
|
|
15308
|
+
/** Every file the tar must hold; anything missing, extra or different is refused. */
|
|
15309
|
+
files: array(ModelBundleFileSchema).min(1).max(64),
|
|
15310
|
+
/** Convert missing engine formats and push the model to every agent afterwards. */
|
|
15311
|
+
distribute: boolean()
|
|
15312
|
+
});
|
|
15313
|
+
var ImportModelBundleResultSchema = discriminatedUnion("kind", [object({
|
|
15314
|
+
kind: literal("imported"),
|
|
15315
|
+
modelIds: array(string()).readonly(),
|
|
15316
|
+
distributed: array(object({
|
|
15317
|
+
modelId: string(),
|
|
15318
|
+
nodeId: string(),
|
|
15319
|
+
format: _enum(MODEL_FORMATS),
|
|
15320
|
+
ok: boolean(),
|
|
15321
|
+
error: string().optional()
|
|
15322
|
+
})).readonly()
|
|
15323
|
+
}), object({
|
|
15324
|
+
kind: literal("refused"),
|
|
15325
|
+
reason: _enum([
|
|
15326
|
+
"transfer-failed",
|
|
15327
|
+
"checksum-mismatch",
|
|
15328
|
+
"bundle-mismatch",
|
|
15329
|
+
"invalid-entry",
|
|
15330
|
+
"id-taken"
|
|
15331
|
+
]),
|
|
15332
|
+
detail: string()
|
|
15333
|
+
})]);
|
|
15334
|
+
method(_void(), array(CustomModelDescriptorSchema).readonly(), { auth: "admin" }), method(ImportModelBundleInputSchema, ImportModelBundleResultSchema, {
|
|
15335
|
+
kind: "mutation",
|
|
15336
|
+
auth: "admin",
|
|
15337
|
+
timeoutMs: 30 * 6e4
|
|
15338
|
+
});
|
|
14525
15339
|
/**
|
|
14526
15340
|
* Query filter for settings-store collections.
|
|
14527
15341
|
*/
|
|
@@ -15000,6 +15814,35 @@ var KeychainKeySourceSchema = object({
|
|
|
15000
15814
|
*/
|
|
15001
15815
|
sharesBackupWithDatabase: boolean()
|
|
15002
15816
|
});
|
|
15817
|
+
/**
|
|
15818
|
+
* One keychain reset, as the Secrets page reports it until the operator
|
|
15819
|
+
* acknowledges it. Never a value: refs, counts and table names only.
|
|
15820
|
+
*/
|
|
15821
|
+
var KeychainResetRecordSchema = object({
|
|
15822
|
+
id: string(),
|
|
15823
|
+
at: number(),
|
|
15824
|
+
/** `user:<id>` or {@link KEYCHAIN_RESET_TRIGGER_ACTOR}. */
|
|
15825
|
+
actor: string(),
|
|
15826
|
+
/** Why the keychain was locked when it was reset; `null` when it was not locked. */
|
|
15827
|
+
lockedReason: string().nullable(),
|
|
15828
|
+
/** Values moved into the archive table (ciphertext under the lost key). */
|
|
15829
|
+
archived: number().int(),
|
|
15830
|
+
/** `keychain:secrets-orphaned-<ts>`, or `null` when nothing was stored. */
|
|
15831
|
+
archivedCollection: string().nullable(),
|
|
15832
|
+
/**
|
|
15833
|
+
* `keychain:keys-orphaned-<ts>`: the wrapped data keys of the archive, kept
|
|
15834
|
+
* so the archive can still be opened if the lost master key turns up.
|
|
15835
|
+
*/
|
|
15836
|
+
archivedKeysCollection: string().nullable(),
|
|
15837
|
+
/**
|
|
15838
|
+
* `system-settings` keys whose marker the reset cleared — the cluster
|
|
15839
|
+
* secret's: a marker left pointing at an archived value would refuse every
|
|
15840
|
+
* agent forever (D797).
|
|
15841
|
+
*/
|
|
15842
|
+
clearedSettingsKeys: array(string()).readonly(),
|
|
15843
|
+
/** When an operator dismissed the notice on the Secrets page; `null` until then. */
|
|
15844
|
+
acknowledgedAt: number().nullable()
|
|
15845
|
+
});
|
|
15003
15846
|
var KeychainStatusSchema = object({
|
|
15004
15847
|
keychain: KeychainStateSchema,
|
|
15005
15848
|
/** The source of the master key in use; `null` while locked. */
|
|
@@ -15017,7 +15860,9 @@ var KeychainStatusSchema = object({
|
|
|
15017
15860
|
/** Wrapped copies of the data key under a previous master key, kept until purged. */
|
|
15018
15861
|
retiredWraps: number().int(),
|
|
15019
15862
|
recoveryKeyDownloadedAt: number().nullable(),
|
|
15020
|
-
secretCount: number().int()
|
|
15863
|
+
secretCount: number().int(),
|
|
15864
|
+
/** The most recent reset, acknowledged or not; `null` when the keychain was never reset. */
|
|
15865
|
+
lastReset: KeychainResetRecordSchema.nullable()
|
|
15021
15866
|
});
|
|
15022
15867
|
/**
|
|
15023
15868
|
* Whether a stored value is still pointed at by its owner's settings.
|
|
@@ -15039,13 +15884,14 @@ var KeychainAuditActionSchema = _enum([
|
|
|
15039
15884
|
"download-recovery-key",
|
|
15040
15885
|
"delete-orphans",
|
|
15041
15886
|
"reset",
|
|
15887
|
+
"acknowledge-reset",
|
|
15042
15888
|
"initialize"
|
|
15043
15889
|
]);
|
|
15044
15890
|
var KeychainAuditEntrySchema = object({
|
|
15045
15891
|
id: string(),
|
|
15046
15892
|
at: number(),
|
|
15047
15893
|
action: KeychainAuditActionSchema,
|
|
15048
|
-
/** `addon:<id>` | `user:<id>` | `system`. */
|
|
15894
|
+
/** `addon:<id>` | `user:<id>` | `system` | `trigger-file`. */
|
|
15049
15895
|
actor: string(),
|
|
15050
15896
|
ref: string().nullable(),
|
|
15051
15897
|
detail: string().nullable()
|
|
@@ -15111,6 +15957,13 @@ method(object({}), KeychainStatusSchema, { auth: "admin" }), method(object({}),
|
|
|
15111
15957
|
kind: "mutation",
|
|
15112
15958
|
auth: "admin",
|
|
15113
15959
|
caller: "required"
|
|
15960
|
+
}), method(object({}), object({
|
|
15961
|
+
reset: KeychainResetRecordSchema.nullable(),
|
|
15962
|
+
pendingReentry: array(KeychainSecretMetaSchema).readonly()
|
|
15963
|
+
}), { auth: "admin" }), method(object({}), object({ acknowledged: boolean() }), {
|
|
15964
|
+
kind: "mutation",
|
|
15965
|
+
auth: "admin",
|
|
15966
|
+
caller: "required"
|
|
15114
15967
|
});
|
|
15115
15968
|
method(_void(), object({
|
|
15116
15969
|
id: string(),
|
|
@@ -17863,7 +18716,7 @@ method(LogEntrySchema, _void(), { kind: "mutation" }), method(object({
|
|
|
17863
18716
|
* `login-method` — collection cap through which auth addons contribute
|
|
17864
18717
|
* their pre-auth login surfaces to the login page. This is the SINGLE,
|
|
17865
18718
|
* generic mechanism that supersedes the dead `auth.listProviders` reader:
|
|
17866
|
-
* every auth addon (OIDC,
|
|
18719
|
+
* every auth addon (OIDC, WebAuthn/passkey) registers a
|
|
17867
18720
|
* `login-method` provider and the PUBLIC `auth.listLoginMethods`
|
|
17868
18721
|
* procedure aggregates them for the unauthenticated login page.
|
|
17869
18722
|
*
|
|
@@ -17871,8 +18724,7 @@ method(LogEntrySchema, _void(), { kind: "mutation" }), method(object({
|
|
|
17871
18724
|
*
|
|
17872
18725
|
* - `redirect` — a declarative button. The login page renders a generic
|
|
17873
18726
|
* button that navigates to `startUrl` (an addon-owned HTTP route).
|
|
17874
|
-
* Covers OIDC (`/addon/auth-oidc/<id>/start`)
|
|
17875
|
-
* ZERO shell-side JS. A future SSO addon plugs in the same way — the
|
|
18727
|
+
* Covers OIDC (`/addon/auth-oidc/<id>/start`) with ZERO shell-side JS. A future SSO addon plugs in the same way — the
|
|
17876
18728
|
* login page needs NO change.
|
|
17877
18729
|
*
|
|
17878
18730
|
* - `widget` — a Module-Federation widget the login page mounts (via
|
|
@@ -17891,8 +18743,8 @@ method(LogEntrySchema, _void(), { kind: "mutation" }), method(object({
|
|
|
17891
18743
|
* decision.
|
|
17892
18744
|
*
|
|
17893
18745
|
* Every contribution carries a `stage`:
|
|
17894
|
-
* - `primary` — shown on the first credentials screen (OIDC
|
|
17895
|
-
*
|
|
18746
|
+
* - `primary` — shown on the first credentials screen (OIDC
|
|
18747
|
+
* buttons; a usernameless passkey).
|
|
17896
18748
|
* - `second-factor` — shown AFTER the password leg, gated on the
|
|
17897
18749
|
* returned `factors` (passkey-as-2FA today).
|
|
17898
18750
|
*
|
|
@@ -17919,7 +18771,7 @@ var LoginMethodContributionSchema = discriminatedUnion("kind", [
|
|
|
17919
18771
|
* The provider names an external identity a signed-in user can link to
|
|
17920
18772
|
* their own account (D782): `auth.listLinkableProviders` /
|
|
17921
18773
|
* `beginExternalLink` offer exactly the redirect methods that set this,
|
|
17922
|
-
* whatever their id. Absent / false — a login button only
|
|
18774
|
+
* whatever their id. Absent / false — a login button only.
|
|
17923
18775
|
*/
|
|
17924
18776
|
linkable: boolean().optional()
|
|
17925
18777
|
}),
|
|
@@ -21774,8 +22626,7 @@ method(object({}), object({ rules: array(NcRuleSchema) }), { auth: "admin" }), m
|
|
|
21774
22626
|
* `super_admin` — collapsed onto the single boolean because every
|
|
21775
22627
|
* non-admin caller is governed by the same scope-check rules; the
|
|
21776
22628
|
* distinction was only ever used to route role-specific procedures
|
|
21777
|
-
* which we no longer have.
|
|
21778
|
-
* `createServiceToken`; CLI / webhook integrations are `cst_*` tokens
|
|
22629
|
+
* which we no longer have. CLI / webhook integrations are `cst_*` tokens
|
|
21779
22630
|
* with `isAdmin: false` + an explicit scope list.
|
|
21780
22631
|
*/
|
|
21781
22632
|
/** Per-method access flavour. Materialised on every cap method via codegen. */
|
|
@@ -24470,6 +25321,17 @@ DeviceType.Camera, method(object({ deviceId: number() }), array(TrackSchema).rea
|
|
|
24470
25321
|
kind: "mutation",
|
|
24471
25322
|
auth: "admin",
|
|
24472
25323
|
timeoutMs: 60 * 6e4
|
|
25324
|
+
}), method(object({
|
|
25325
|
+
filter: RetrainExportFilterSchema,
|
|
25326
|
+
layout: RetrainExportLayoutSchema
|
|
25327
|
+
}), object({
|
|
25328
|
+
ticket: PeerBytesTicketSchema,
|
|
25329
|
+
frames: number().int(),
|
|
25330
|
+
annotations: number().int()
|
|
25331
|
+
}), {
|
|
25332
|
+
kind: "mutation",
|
|
25333
|
+
auth: "admin",
|
|
25334
|
+
timeoutMs: 12e4
|
|
24473
25335
|
}), method(object({
|
|
24474
25336
|
selection: RetrainDatasetSelectionSchema,
|
|
24475
25337
|
completeOnly: boolean().optional()
|
|
@@ -28078,8 +28940,8 @@ version: string().optional() }), ServerUpdateActionResultSchema, {
|
|
|
28078
28940
|
* `smtp-provider` — pluggable email delivery surface.
|
|
28079
28941
|
*
|
|
28080
28942
|
* Collection cap: a deployment may install multiple SMTP relays (e.g.
|
|
28081
|
-
* one for transactional / one for notifications). Consumers (
|
|
28082
|
-
*
|
|
28943
|
+
* one for transactional / one for notifications). Consumers (notifier
|
|
28944
|
+
* addons, …) walk the collection and pick the first
|
|
28083
28945
|
* ready provider OR target a specific addonId.
|
|
28084
28946
|
*
|
|
28085
28947
|
* The shape stays small on purpose — `sendEmail` is enough for the
|
|
@@ -28362,7 +29224,7 @@ targets: array(object({
|
|
|
28362
29224
|
};
|
|
28363
29225
|
/**
|
|
28364
29226
|
* `sso-bridge` — internal hub-only cap that lets SSO-style auth
|
|
28365
|
-
* providers (OIDC, SAML,
|
|
29227
|
+
* providers (OIDC, SAML, …) mint an HMAC-signed token
|
|
28366
29228
|
* carrying the post-callback claims before redirecting back to
|
|
28367
29229
|
* `/api/auth/sso/finish`.
|
|
28368
29230
|
*
|
|
@@ -28425,7 +29287,14 @@ var SsoBridgeClaimsSchema = object({
|
|
|
28425
29287
|
* Verified `iss` of the id_token behind an OIDC login bridge (D782). A
|
|
28426
29288
|
* subject is unique only per issuer, so a link is bound to it.
|
|
28427
29289
|
*/
|
|
28428
|
-
issuer: string().optional()
|
|
29290
|
+
issuer: string().optional(),
|
|
29291
|
+
/**
|
|
29292
|
+
* SHA-256 (hex) of the `camstack_sso_state` cookie the IdP `/start` set in
|
|
29293
|
+
* the browser that began this sign-in. `/api/auth/sso/finish` requires the
|
|
29294
|
+
* request to present the matching cookie — a login bridge is useless in
|
|
29295
|
+
* any other browser.
|
|
29296
|
+
*/
|
|
29297
|
+
browserBinding: string().optional()
|
|
28429
29298
|
});
|
|
28430
29299
|
method(object({
|
|
28431
29300
|
claims: SsoBridgeClaimsSchema,
|
|
@@ -40728,16 +41597,6 @@ var ApiKeySummarySchema = object({
|
|
|
40728
41597
|
createdAt: number(),
|
|
40729
41598
|
lastUsedAt: number().optional()
|
|
40730
41599
|
});
|
|
40731
|
-
var CreateApiKeyInputSchema = object({
|
|
40732
|
-
label: string(),
|
|
40733
|
-
isAdmin: boolean().default(false),
|
|
40734
|
-
allowedProviders: union([array(string()), literal("*")]).optional(),
|
|
40735
|
-
allowedDevices: record(string(), union([array(string()), literal("*")])).optional()
|
|
40736
|
-
});
|
|
40737
|
-
var CreateApiKeyResultSchema = object({
|
|
40738
|
-
token: string(),
|
|
40739
|
-
record: ApiKeySummarySchema
|
|
40740
|
-
});
|
|
40741
41600
|
var ScopedTokenSummarySchema = object({
|
|
40742
41601
|
id: string(),
|
|
40743
41602
|
userId: string(),
|
|
@@ -40836,17 +41695,10 @@ method(_void(), array(UserSummarySchema), { auth: "admin" }), method(CreateUserI
|
|
|
40836
41695
|
}), UserSummarySchema.extend({ passwordHash: string() }).nullable(), {
|
|
40837
41696
|
kind: "mutation",
|
|
40838
41697
|
access: "view"
|
|
40839
|
-
}), method(_void(), array(ApiKeySummarySchema), { auth: "admin" }), method(
|
|
40840
|
-
kind: "mutation",
|
|
40841
|
-
auth: "admin",
|
|
40842
|
-
access: "create"
|
|
40843
|
-
}), method(object({ id: string() }), object({ success: literal(true) }), {
|
|
41698
|
+
}), method(_void(), array(ApiKeySummarySchema), { auth: "admin" }), method(object({ id: string() }), object({ success: literal(true) }), {
|
|
40844
41699
|
kind: "mutation",
|
|
40845
41700
|
auth: "admin",
|
|
40846
41701
|
access: "delete"
|
|
40847
|
-
}), method(object({ token: string() }), ApiKeySummarySchema.nullable(), {
|
|
40848
|
-
kind: "mutation",
|
|
40849
|
-
access: "view"
|
|
40850
41702
|
}), method(CreateScopedTokenInputSchema, CreateScopedTokenResultSchema, {
|
|
40851
41703
|
kind: "mutation",
|
|
40852
41704
|
auth: "admin",
|
|
@@ -40920,15 +41772,7 @@ method(_void(), array(UserSummarySchema), { auth: "admin" }), method(CreateUserI
|
|
|
40920
41772
|
}).nullable(), { access: "view" }), method(object({ userId: string() }), array(ExternalIdentitySchema), { auth: "admin" }), method(ExternalIdentityKeySchema, object({
|
|
40921
41773
|
userId: string(),
|
|
40922
41774
|
issuer: string()
|
|
40923
|
-
}).nullable(), { auth: "admin" }), method(ExternalIdentityKeySchema.extend({
|
|
40924
|
-
userId: string(),
|
|
40925
|
-
issuer: string().min(1),
|
|
40926
|
-
label: string().optional()
|
|
40927
|
-
}), object({ success: literal(true) }), {
|
|
40928
|
-
kind: "mutation",
|
|
40929
|
-
auth: "admin",
|
|
40930
|
-
access: "create"
|
|
40931
|
-
}), method(ExternalIdentityKeySchema.extend({ userId: string() }), object({ success: boolean() }), {
|
|
41775
|
+
}).nullable(), { auth: "admin" }), method(ExternalIdentityKeySchema.extend({ userId: string() }), object({ success: boolean() }), {
|
|
40932
41776
|
kind: "mutation",
|
|
40933
41777
|
auth: "admin",
|
|
40934
41778
|
access: "delete"
|
|
@@ -41633,6 +42477,451 @@ var zoneRulesCapability = {
|
|
|
41633
42477
|
*/
|
|
41634
42478
|
durability: "restored"
|
|
41635
42479
|
};
|
|
42480
|
+
/**
|
|
42481
|
+
* `training-provider` — ONE cloud that can run the CamStack trainer.
|
|
42482
|
+
*
|
|
42483
|
+
* A thin, mockable translation layer: it knows how to run a container with a
|
|
42484
|
+
* GPU, move a dataset in, read the job's stdout and hand artefacts back. It
|
|
42485
|
+
* knows nothing about datasets, splits, floors, cost policy or Model Studio —
|
|
42486
|
+
* those are the `training` orchestrator's (D805). Every rule written there
|
|
42487
|
+
* once is what makes a second provider (RunPod, a local NVIDIA node) a new
|
|
42488
|
+
* manifest entry and nothing else.
|
|
42489
|
+
*
|
|
42490
|
+
* Collection, routed by the `addonId` in every single-row input (the `llm` /
|
|
42491
|
+
* `notification-output` posture); `describe` concat-fans across providers.
|
|
42492
|
+
* Every method is `admin`: these spend money.
|
|
42493
|
+
*
|
|
42494
|
+
* Every cloud object a provider creates is tagged with the orchestrator's
|
|
42495
|
+
* `jobKey`, so a retried submit finds the job it already started instead of
|
|
42496
|
+
* starting a second GPU, and `listJobs` can find orphans.
|
|
42497
|
+
*
|
|
42498
|
+
* Bytes never ride a cap field: the dataset arrives as a `ctx.peerBytes`
|
|
42499
|
+
* ticket the producer (pipeline-analytics) minted, and artefacts leave as a
|
|
42500
|
+
* ticket the provider mints (D613).
|
|
42501
|
+
*/
|
|
42502
|
+
var TrainingGpuOptionSchema = object({
|
|
42503
|
+
id: string(),
|
|
42504
|
+
label: string(),
|
|
42505
|
+
/** List price, USD per GPU-hour, before any region multiplier. */
|
|
42506
|
+
usdPerHour: number().nonnegative(),
|
|
42507
|
+
vramGb: number().nonnegative()
|
|
42508
|
+
});
|
|
42509
|
+
var TrainingRegionOptionSchema = object({
|
|
42510
|
+
/** `''` = any region (the provider's choice). */
|
|
42511
|
+
id: string(),
|
|
42512
|
+
label: string(),
|
|
42513
|
+
priceMultiplier: number().positive()
|
|
42514
|
+
});
|
|
42515
|
+
/**
|
|
42516
|
+
* The provider's per-account settings, as the orchestrator reads them. They
|
|
42517
|
+
* live in the PROVIDER addon's settings (operator decision 2026-10-08: they
|
|
42518
|
+
* depend on the user's account), never hard-coded in the orchestrator.
|
|
42519
|
+
*/
|
|
42520
|
+
var TrainingProviderDefaultsSchema = object({
|
|
42521
|
+
gpuType: string(),
|
|
42522
|
+
region: string(),
|
|
42523
|
+
costCapUsd: number().nonnegative(),
|
|
42524
|
+
maxRuntimeSec: number().int().positive(),
|
|
42525
|
+
/** Hours a FAILED job's cloud dataset is kept for debugging; 0 = delete at once. */
|
|
42526
|
+
failedDatasetGraceHours: number().nonnegative()
|
|
42527
|
+
});
|
|
42528
|
+
var TrainingProviderDescriptorSchema = object({
|
|
42529
|
+
addonId: string(),
|
|
42530
|
+
/** `modal`, `runpod`, `fake`, … */
|
|
42531
|
+
kind: string(),
|
|
42532
|
+
label: string(),
|
|
42533
|
+
gpuTypes: array(TrainingGpuOptionSchema).readonly(),
|
|
42534
|
+
regions: array(TrainingRegionOptionSchema).readonly(),
|
|
42535
|
+
maxDatasetBytes: number().int().positive(),
|
|
42536
|
+
maxRuntimeSec: number().int().positive(),
|
|
42537
|
+
freeTierNote: string().optional(),
|
|
42538
|
+
/** Where the data goes, in one sentence the confirm dialog repeats. */
|
|
42539
|
+
dataResidencyNote: string(),
|
|
42540
|
+
/** Credentials are present — never the values. */
|
|
42541
|
+
configured: boolean(),
|
|
42542
|
+
defaults: TrainingProviderDefaultsSchema
|
|
42543
|
+
});
|
|
42544
|
+
var TrainingCredentialCheckSchema = object({
|
|
42545
|
+
ok: boolean(),
|
|
42546
|
+
/** Workspace / account name, when the provider says. */
|
|
42547
|
+
account: string().optional(),
|
|
42548
|
+
reason: _enum([
|
|
42549
|
+
"missing",
|
|
42550
|
+
"invalid",
|
|
42551
|
+
"forbidden",
|
|
42552
|
+
"network",
|
|
42553
|
+
"quota"
|
|
42554
|
+
]).optional(),
|
|
42555
|
+
detail: string().optional()
|
|
42556
|
+
});
|
|
42557
|
+
var ProviderJobStateSchema = _enum([
|
|
42558
|
+
"pending",
|
|
42559
|
+
"starting",
|
|
42560
|
+
"running",
|
|
42561
|
+
"succeeded",
|
|
42562
|
+
"failed",
|
|
42563
|
+
"cancelled",
|
|
42564
|
+
"lost"
|
|
42565
|
+
]);
|
|
42566
|
+
var ProviderJobStatusSchema = object({
|
|
42567
|
+
jobKey: string(),
|
|
42568
|
+
providerJobId: string().optional(),
|
|
42569
|
+
state: ProviderJobStateSchema,
|
|
42570
|
+
startedAt: number().optional(),
|
|
42571
|
+
endedAt: number().optional(),
|
|
42572
|
+
exitCode: number().int().optional(),
|
|
42573
|
+
failureReason: string().optional(),
|
|
42574
|
+
gpuType: string(),
|
|
42575
|
+
region: string().optional(),
|
|
42576
|
+
billedSeconds: number().nonnegative(),
|
|
42577
|
+
costUsd: number().nonnegative(),
|
|
42578
|
+
/** True when `costUsd` is runtime × list price, not a billing answer. */
|
|
42579
|
+
costIsEstimate: boolean(),
|
|
42580
|
+
lastFetchedAt: number()
|
|
42581
|
+
});
|
|
42582
|
+
/**
|
|
42583
|
+
* The trainer the job runs, by SOURCE revision: the provider turns it into an
|
|
42584
|
+
* image its own way (Modal builds the published Dockerfile at that revision;
|
|
42585
|
+
* a registry-pull provider maps it to a tag). Recorded on the job and echoed
|
|
42586
|
+
* in `result.json`.
|
|
42587
|
+
*/
|
|
42588
|
+
var TrainerSourceRefSchema = object({
|
|
42589
|
+
/** Hugging Face repo id, e.g. `camstack/camstack-trainer`. */
|
|
42590
|
+
repo: string().min(1),
|
|
42591
|
+
/** A commit sha (never a branch) — the job must be reproducible. */
|
|
42592
|
+
revision: string().regex(/^[0-9a-f]{7,64}$/)
|
|
42593
|
+
});
|
|
42594
|
+
var JobRef = {
|
|
42595
|
+
addonId: string(),
|
|
42596
|
+
jobKey: string().uuid()
|
|
42597
|
+
};
|
|
42598
|
+
var TrainingLogLineSchema = object({
|
|
42599
|
+
ts: number(),
|
|
42600
|
+
text: string()
|
|
42601
|
+
});
|
|
42602
|
+
method(object({}), array(TrainingProviderDescriptorSchema).readonly(), { auth: "admin" }), method(object({ addonId: string() }), TrainingCredentialCheckSchema, {
|
|
42603
|
+
kind: "mutation",
|
|
42604
|
+
auth: "admin",
|
|
42605
|
+
timeoutMs: 3e4
|
|
42606
|
+
}), method(object({
|
|
42607
|
+
addonId: string(),
|
|
42608
|
+
gpuType: string(),
|
|
42609
|
+
region: string(),
|
|
42610
|
+
datasetBytes: number().int().nonnegative(),
|
|
42611
|
+
gpuSecondsLow: number().nonnegative(),
|
|
42612
|
+
gpuSecondsHigh: number().nonnegative()
|
|
42613
|
+
}), object({
|
|
42614
|
+
usdLow: number().nonnegative(),
|
|
42615
|
+
usdHigh: number().nonnegative(),
|
|
42616
|
+
notes: array(string()).readonly()
|
|
42617
|
+
}), { auth: "admin" }), method(object({
|
|
42618
|
+
...JobRef,
|
|
42619
|
+
ticket: PeerBytesTicketSchema
|
|
42620
|
+
}), object({
|
|
42621
|
+
bytes: number().int().nonnegative(),
|
|
42622
|
+
sha256: string()
|
|
42623
|
+
}), {
|
|
42624
|
+
kind: "mutation",
|
|
42625
|
+
auth: "admin",
|
|
42626
|
+
timeoutMs: 120 * 6e4
|
|
42627
|
+
}), method(object({
|
|
42628
|
+
...JobRef,
|
|
42629
|
+
trainer: TrainerSourceRefSchema,
|
|
42630
|
+
jobSpecJson: string().min(2).max(64e3),
|
|
42631
|
+
gpuType: string(),
|
|
42632
|
+
region: string(),
|
|
42633
|
+
maxRuntimeSec: number().int().positive()
|
|
42634
|
+
}), ProviderJobStatusSchema, {
|
|
42635
|
+
kind: "mutation",
|
|
42636
|
+
auth: "admin",
|
|
42637
|
+
timeoutMs: 30 * 6e4
|
|
42638
|
+
}), method(object(JobRef), ProviderJobStatusSchema, {
|
|
42639
|
+
auth: "admin",
|
|
42640
|
+
timeoutMs: 6e4
|
|
42641
|
+
}), method(object({
|
|
42642
|
+
...JobRef,
|
|
42643
|
+
cursor: string().optional(),
|
|
42644
|
+
max: number().int().min(1).max(500)
|
|
42645
|
+
}), object({
|
|
42646
|
+
lines: array(TrainingLogLineSchema).readonly(),
|
|
42647
|
+
cursor: string()
|
|
42648
|
+
}), {
|
|
42649
|
+
auth: "admin",
|
|
42650
|
+
timeoutMs: 6e4
|
|
42651
|
+
}), method(object(JobRef), object({ ok: literal(true) }), {
|
|
42652
|
+
kind: "mutation",
|
|
42653
|
+
auth: "admin",
|
|
42654
|
+
timeoutMs: 6e4
|
|
42655
|
+
}), method(object(JobRef), object({
|
|
42656
|
+
found: boolean(),
|
|
42657
|
+
text: string().optional()
|
|
42658
|
+
}), {
|
|
42659
|
+
kind: "mutation",
|
|
42660
|
+
auth: "admin",
|
|
42661
|
+
timeoutMs: 5 * 6e4
|
|
42662
|
+
}), method(object({
|
|
42663
|
+
...JobRef,
|
|
42664
|
+
path: _enum(["bundle.tar"])
|
|
42665
|
+
}), object({ ticket: PeerBytesTicketSchema }), {
|
|
42666
|
+
kind: "mutation",
|
|
42667
|
+
auth: "admin",
|
|
42668
|
+
timeoutMs: 5 * 6e4
|
|
42669
|
+
}), method(object(JobRef), object({ deleted: array(string()).readonly() }), {
|
|
42670
|
+
kind: "mutation",
|
|
42671
|
+
auth: "admin",
|
|
42672
|
+
timeoutMs: 5 * 6e4
|
|
42673
|
+
}), method(object({ addonId: string() }), array(ProviderJobStatusSchema).readonly(), {
|
|
42674
|
+
auth: "admin",
|
|
42675
|
+
timeoutMs: 2 * 6e4
|
|
42676
|
+
});
|
|
42677
|
+
/**
|
|
42678
|
+
* `training` — the cloud-training orchestrator (D805). Hub-only singleton,
|
|
42679
|
+
* provided by `addon-training`.
|
|
42680
|
+
*
|
|
42681
|
+
* It owns what every provider must agree on, written once:
|
|
42682
|
+
*
|
|
42683
|
+
* - **Dataset versions.** Taken over from pipeline-analytics (D796): the rows
|
|
42684
|
+
* live here (D808); pipeline-analytics still CUTS a version (it owns the corpus and
|
|
42685
|
+
* the export plan) and reaches this store through the five row methods
|
|
42686
|
+
* below, so the Retrain page and the export did not change.
|
|
42687
|
+
* - **Jobs.** A persisted state machine, a reconcile loop against the
|
|
42688
|
+
* provider, a cost guard, a daily orphan sweep and the retention rules.
|
|
42689
|
+
* - **The return flow.** Verified artefacts → Model Studio
|
|
42690
|
+
* (`custom-model-registry.importModelBundle`) → canary on cameras →
|
|
42691
|
+
* rollback. Nothing is ever registered automatically.
|
|
42692
|
+
*
|
|
42693
|
+
* Every method is `admin`.
|
|
42694
|
+
*/
|
|
42695
|
+
/** A version WITH its frame list — what the export and a job read. */
|
|
42696
|
+
var TrainingDatasetVersionRowSchema = RetrainDatasetVersionSchema.omit({ frameCount: true }).extend({ frameIds: array(string()).max(2e4).readonly() });
|
|
42697
|
+
/** A base model a detector job can fine-tune, and the baseline it is judged against. */
|
|
42698
|
+
var TrainingBaseModelSchema = object({
|
|
42699
|
+
modelId: string(),
|
|
42700
|
+
label: string(),
|
|
42701
|
+
weights: string(),
|
|
42702
|
+
imgsz: number().int(),
|
|
42703
|
+
baselineOnnxUrl: string(),
|
|
42704
|
+
baselineFloors: record(string(), number()),
|
|
42705
|
+
/** The base the fleet runs most — the UI's default. */
|
|
42706
|
+
recommended: boolean()
|
|
42707
|
+
});
|
|
42708
|
+
var TrainingPresetSchema = _enum([
|
|
42709
|
+
"quick",
|
|
42710
|
+
"standard",
|
|
42711
|
+
"thorough"
|
|
42712
|
+
]);
|
|
42713
|
+
var TrainingJobRequestSchema = object({
|
|
42714
|
+
datasetVersionId: string().min(1),
|
|
42715
|
+
/** The `training-provider` addon that runs it. */
|
|
42716
|
+
addonId: string().min(1),
|
|
42717
|
+
gpuType: string().min(1),
|
|
42718
|
+
region: string(),
|
|
42719
|
+
baseModelId: string().min(1),
|
|
42720
|
+
preset: TrainingPresetSchema,
|
|
42721
|
+
/** Freeze the backbone's first N layers; `null` = the preset's choice. */
|
|
42722
|
+
freeze: number().int().nonnegative().nullable(),
|
|
42723
|
+
/** Cameras held out whole for evaluation; `null` = the orchestrator's default. */
|
|
42724
|
+
holdoutCameras: array(number().int()).nullable()
|
|
42725
|
+
});
|
|
42726
|
+
var TrainingSplitPlanSchema = object({
|
|
42727
|
+
holdoutCameras: array(number().int()).readonly(),
|
|
42728
|
+
/** Used when no camera is held out: the last N days of every camera. */
|
|
42729
|
+
holdoutLastDays: number().int().nonnegative(),
|
|
42730
|
+
/** Holdout subjects per class (camera holdout only; `null` = known only after the split). */
|
|
42731
|
+
holdoutSupport: record(string(), number().int()).nullable(),
|
|
42732
|
+
trainSubjects: number().int()
|
|
42733
|
+
});
|
|
42734
|
+
var TrainingRefusalReasonSchema = _enum([
|
|
42735
|
+
"unknown-dataset",
|
|
42736
|
+
"unknown-provider",
|
|
42737
|
+
"provider-not-configured",
|
|
42738
|
+
"unknown-base-model",
|
|
42739
|
+
"unknown-gpu",
|
|
42740
|
+
"dataset-too-large",
|
|
42741
|
+
"no-training-subjects",
|
|
42742
|
+
"job-already-running"
|
|
42743
|
+
]);
|
|
42744
|
+
var TrainingJobPlanSchema = object({
|
|
42745
|
+
refusal: object({
|
|
42746
|
+
reason: TrainingRefusalReasonSchema,
|
|
42747
|
+
detail: string()
|
|
42748
|
+
}).nullable(),
|
|
42749
|
+
warnings: array(string()).readonly(),
|
|
42750
|
+
split: TrainingSplitPlanSchema.nullable(),
|
|
42751
|
+
estimate: object({
|
|
42752
|
+
datasetBytes: number().int(),
|
|
42753
|
+
uploadMinutesAt20Mbps: number(),
|
|
42754
|
+
gpuSecondsLow: number(),
|
|
42755
|
+
gpuSecondsHigh: number(),
|
|
42756
|
+
usdLow: number(),
|
|
42757
|
+
usdHigh: number(),
|
|
42758
|
+
notes: array(string()).readonly()
|
|
42759
|
+
}).nullable(),
|
|
42760
|
+
/** Pre-filled from the provider's settings; the operator may lower or raise them. */
|
|
42761
|
+
defaults: object({
|
|
42762
|
+
maxCostUsd: number(),
|
|
42763
|
+
maxRuntimeSec: number().int()
|
|
42764
|
+
}).nullable(),
|
|
42765
|
+
/** The sentence the confirm dialog repeats: where the frames go and when they are deleted. */
|
|
42766
|
+
dataNotice: string()
|
|
42767
|
+
});
|
|
42768
|
+
/**
|
|
42769
|
+
* Orchestrator-owned states, persisted. `uploading` covers exporting the
|
|
42770
|
+
* archive (it is streamed, never staged). Terminal: `failed`, `cancelled`,
|
|
42771
|
+
* `lost`, `expired`, `discarded`. `registered` and `canary` are where a
|
|
42772
|
+
* result lives after the operator acted on it.
|
|
42773
|
+
*/
|
|
42774
|
+
var TrainingJobStateSchema = _enum([
|
|
42775
|
+
"uploading",
|
|
42776
|
+
"submitted",
|
|
42777
|
+
"starting",
|
|
42778
|
+
"running",
|
|
42779
|
+
"collecting",
|
|
42780
|
+
"ready",
|
|
42781
|
+
"registered",
|
|
42782
|
+
"canary",
|
|
42783
|
+
"failed",
|
|
42784
|
+
"cancelling",
|
|
42785
|
+
"cancelled",
|
|
42786
|
+
"lost",
|
|
42787
|
+
"expired",
|
|
42788
|
+
"discarded"
|
|
42789
|
+
]);
|
|
42790
|
+
var TrainingFailureReasonSchema = _enum([
|
|
42791
|
+
"cost-cap",
|
|
42792
|
+
"runtime-cap",
|
|
42793
|
+
"upload-failed",
|
|
42794
|
+
"submit-failed",
|
|
42795
|
+
"trainer-failed",
|
|
42796
|
+
"result-invalid",
|
|
42797
|
+
"checksum-mismatch",
|
|
42798
|
+
"fetch-failed",
|
|
42799
|
+
"provider-error",
|
|
42800
|
+
"hub-restart-during-upload"
|
|
42801
|
+
]);
|
|
42802
|
+
var TrainingProgressPointSchema = object({
|
|
42803
|
+
epoch: number().int(),
|
|
42804
|
+
map50: number().nullable(),
|
|
42805
|
+
map50_95: number().nullable()
|
|
42806
|
+
});
|
|
42807
|
+
var TrainingCanarySchema = object({
|
|
42808
|
+
deviceIds: array(number().int()).readonly(),
|
|
42809
|
+
since: number(),
|
|
42810
|
+
/** Every override the canary replaced, exactly, so rollback restores it. */
|
|
42811
|
+
previous: array(object({
|
|
42812
|
+
deviceId: number().int(),
|
|
42813
|
+
nodeId: string(),
|
|
42814
|
+
deviceKey: string(),
|
|
42815
|
+
patch: object({
|
|
42816
|
+
modelId: string().optional(),
|
|
42817
|
+
settings: record(string(), unknown()).readonly().optional()
|
|
42818
|
+
}).nullable()
|
|
42819
|
+
})).readonly()
|
|
42820
|
+
});
|
|
42821
|
+
var TrainingJobSchema = object({
|
|
42822
|
+
id: string(),
|
|
42823
|
+
idempotencyKey: string(),
|
|
42824
|
+
name: string(),
|
|
42825
|
+
createdAt: number(),
|
|
42826
|
+
updatedAt: number(),
|
|
42827
|
+
state: TrainingJobStateSchema,
|
|
42828
|
+
stage: TrainingStageSchema.nullable(),
|
|
42829
|
+
failure: object({
|
|
42830
|
+
reason: TrainingFailureReasonSchema,
|
|
42831
|
+
stage: string().nullable(),
|
|
42832
|
+
detail: string()
|
|
42833
|
+
}).nullable(),
|
|
42834
|
+
request: TrainingJobRequestSchema,
|
|
42835
|
+
maxCostUsd: number().nonnegative(),
|
|
42836
|
+
maxRuntimeSec: number().int().positive(),
|
|
42837
|
+
trainer: TrainerSourceRefSchema,
|
|
42838
|
+
datasetLayout: RetrainExportLayoutSchema,
|
|
42839
|
+
dataset: object({
|
|
42840
|
+
bytes: number().int(),
|
|
42841
|
+
sha256: string(),
|
|
42842
|
+
uploadedAt: number()
|
|
42843
|
+
}).nullable(),
|
|
42844
|
+
split: TrainingSplitPlanSchema,
|
|
42845
|
+
provider: object({
|
|
42846
|
+
state: ProviderJobStateSchema.nullable(),
|
|
42847
|
+
providerJobId: string().nullable(),
|
|
42848
|
+
startedAt: number().nullable(),
|
|
42849
|
+
endedAt: number().nullable(),
|
|
42850
|
+
billedSeconds: number(),
|
|
42851
|
+
costUsd: number(),
|
|
42852
|
+
costIsEstimate: boolean(),
|
|
42853
|
+
lastPolledAt: number().nullable()
|
|
42854
|
+
}),
|
|
42855
|
+
progress: object({
|
|
42856
|
+
epoch: number().int().nullable(),
|
|
42857
|
+
epochs: number().int().nullable(),
|
|
42858
|
+
etaSec: number().nullable(),
|
|
42859
|
+
series: array(TrainingProgressPointSchema).readonly()
|
|
42860
|
+
}),
|
|
42861
|
+
/** The last lines of the job's output (≤ 200), newest last. Never frame paths. */
|
|
42862
|
+
logTail: array(string()).readonly(),
|
|
42863
|
+
logCursor: string().nullable(),
|
|
42864
|
+
artifacts: object({
|
|
42865
|
+
bundleBytes: number().int(),
|
|
42866
|
+
bundleSha256: string(),
|
|
42867
|
+
fetchedAt: number(),
|
|
42868
|
+
/** When the staged artefacts are deleted from the hub. */
|
|
42869
|
+
expiresAt: number()
|
|
42870
|
+
}).nullable(),
|
|
42871
|
+
/** When the provider-side copy of the frames was deleted; null while it exists. */
|
|
42872
|
+
cloudDatasetDeletedAt: number().nullable(),
|
|
42873
|
+
/** A failed job's dataset is kept until then (the provider's grace), then deleted. */
|
|
42874
|
+
cloudCleanupDueAt: number().nullable(),
|
|
42875
|
+
/** Model ids registered from this job (base, and int8 when kept). */
|
|
42876
|
+
registeredModelIds: array(string()).readonly(),
|
|
42877
|
+
canary: TrainingCanarySchema.nullable()
|
|
42878
|
+
});
|
|
42879
|
+
var IdInput = object({ id: string().min(1) });
|
|
42880
|
+
method(TrainingDatasetVersionRowSchema, object({ stored: boolean() }), {
|
|
42881
|
+
kind: "mutation",
|
|
42882
|
+
auth: "admin"
|
|
42883
|
+
}), 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() }), {
|
|
42884
|
+
kind: "mutation",
|
|
42885
|
+
auth: "admin"
|
|
42886
|
+
}), method(object({}), array(TrainingBaseModelSchema).readonly(), { auth: "admin" }), method(TrainingJobRequestSchema, TrainingJobPlanSchema, {
|
|
42887
|
+
auth: "admin",
|
|
42888
|
+
timeoutMs: 6e4
|
|
42889
|
+
}), method(TrainingJobRequestSchema.extend({
|
|
42890
|
+
name: string().min(1).max(120),
|
|
42891
|
+
maxCostUsd: number().positive(),
|
|
42892
|
+
maxRuntimeSec: number().int().positive(),
|
|
42893
|
+
idempotencyKey: string().min(8).max(80)
|
|
42894
|
+
}), discriminatedUnion("kind", [object({
|
|
42895
|
+
kind: literal("started"),
|
|
42896
|
+
job: TrainingJobSchema
|
|
42897
|
+
}), object({
|
|
42898
|
+
kind: literal("refused"),
|
|
42899
|
+
reason: TrainingRefusalReasonSchema,
|
|
42900
|
+
detail: string()
|
|
42901
|
+
})]), {
|
|
42902
|
+
kind: "mutation",
|
|
42903
|
+
auth: "admin",
|
|
42904
|
+
timeoutMs: 12e4
|
|
42905
|
+
}), method(object({}), array(TrainingJobSchema).readonly(), { auth: "admin" }), method(IdInput, TrainingJobSchema.nullable(), { auth: "admin" }), method(IdInput, TrainingJobSchema, {
|
|
42906
|
+
kind: "mutation",
|
|
42907
|
+
auth: "admin",
|
|
42908
|
+
timeoutMs: 12e4
|
|
42909
|
+
}), method(IdInput, TrainingResultSchema.nullable(), { auth: "admin" }), method(IdInput.extend({ canaryDeviceIds: array(number().int()).readonly() }), TrainingJobSchema, {
|
|
42910
|
+
kind: "mutation",
|
|
42911
|
+
auth: "admin",
|
|
42912
|
+
timeoutMs: 30 * 6e4
|
|
42913
|
+
}), method(IdInput.extend({ deviceIds: array(number().int()).min(1).readonly() }), TrainingJobSchema, {
|
|
42914
|
+
kind: "mutation",
|
|
42915
|
+
auth: "admin",
|
|
42916
|
+
timeoutMs: 12e4
|
|
42917
|
+
}), method(IdInput, TrainingJobSchema, {
|
|
42918
|
+
kind: "mutation",
|
|
42919
|
+
auth: "admin",
|
|
42920
|
+
timeoutMs: 12e4
|
|
42921
|
+
}), method(IdInput, TrainingJobSchema, {
|
|
42922
|
+
kind: "mutation",
|
|
42923
|
+
auth: "admin"
|
|
42924
|
+
});
|
|
41636
42925
|
SOURCE_CAPS.filter((cap) => cap !== "switch" && cap !== "motion");
|
|
41637
42926
|
Object.freeze({
|
|
41638
42927
|
person: .5,
|
|
@@ -43304,6 +44593,12 @@ Object.freeze({
|
|
|
43304
44593
|
addonId: null,
|
|
43305
44594
|
access: "create"
|
|
43306
44595
|
},
|
|
44596
|
+
"backup.checkBackupKey": {
|
|
44597
|
+
capName: "backup",
|
|
44598
|
+
capScope: "system",
|
|
44599
|
+
addonId: null,
|
|
44600
|
+
access: "create"
|
|
44601
|
+
},
|
|
43307
44602
|
"backup.delete": {
|
|
43308
44603
|
capName: "backup",
|
|
43309
44604
|
capScope: "system",
|
|
@@ -43316,6 +44611,18 @@ Object.freeze({
|
|
|
43316
44611
|
addonId: null,
|
|
43317
44612
|
access: "delete"
|
|
43318
44613
|
},
|
|
44614
|
+
"backup.disableEncryption": {
|
|
44615
|
+
capName: "backup",
|
|
44616
|
+
capScope: "system",
|
|
44617
|
+
addonId: null,
|
|
44618
|
+
access: "create"
|
|
44619
|
+
},
|
|
44620
|
+
"backup.getEncryption": {
|
|
44621
|
+
capName: "backup",
|
|
44622
|
+
capScope: "system",
|
|
44623
|
+
addonId: null,
|
|
44624
|
+
access: "view"
|
|
44625
|
+
},
|
|
43319
44626
|
"backup.getEntries": {
|
|
43320
44627
|
capName: "backup",
|
|
43321
44628
|
capScope: "system",
|
|
@@ -43370,6 +44677,12 @@ Object.freeze({
|
|
|
43370
44677
|
addonId: null,
|
|
43371
44678
|
access: "create"
|
|
43372
44679
|
},
|
|
44680
|
+
"backup.setupEncryption": {
|
|
44681
|
+
capName: "backup",
|
|
44682
|
+
capScope: "system",
|
|
44683
|
+
addonId: null,
|
|
44684
|
+
access: "create"
|
|
44685
|
+
},
|
|
43373
44686
|
"backup.trigger": {
|
|
43374
44687
|
capName: "backup",
|
|
43375
44688
|
capScope: "system",
|
|
@@ -43922,6 +45235,12 @@ Object.freeze({
|
|
|
43922
45235
|
addonId: null,
|
|
43923
45236
|
access: "create"
|
|
43924
45237
|
},
|
|
45238
|
+
"customModelRegistry.importModelBundle": {
|
|
45239
|
+
capName: "custom-model-registry",
|
|
45240
|
+
capScope: "system",
|
|
45241
|
+
addonId: null,
|
|
45242
|
+
access: "create"
|
|
45243
|
+
},
|
|
43925
45244
|
"customModelRegistry.listModels": {
|
|
43926
45245
|
capName: "custom-model-registry",
|
|
43927
45246
|
capScope: "system",
|
|
@@ -45362,6 +46681,12 @@ Object.freeze({
|
|
|
45362
46681
|
addonId: null,
|
|
45363
46682
|
access: "view"
|
|
45364
46683
|
},
|
|
46684
|
+
"keychainAdmin.acknowledgeReset": {
|
|
46685
|
+
capName: "keychain-admin",
|
|
46686
|
+
capScope: "system",
|
|
46687
|
+
addonId: null,
|
|
46688
|
+
access: "create"
|
|
46689
|
+
},
|
|
45365
46690
|
"keychainAdmin.deleteOrphans": {
|
|
45366
46691
|
capName: "keychain-admin",
|
|
45367
46692
|
capScope: "system",
|
|
@@ -45398,6 +46723,12 @@ Object.freeze({
|
|
|
45398
46723
|
addonId: null,
|
|
45399
46724
|
access: "delete"
|
|
45400
46725
|
},
|
|
46726
|
+
"keychainAdmin.resetReport": {
|
|
46727
|
+
capName: "keychain-admin",
|
|
46728
|
+
capScope: "system",
|
|
46729
|
+
addonId: null,
|
|
46730
|
+
access: "delete"
|
|
46731
|
+
},
|
|
45401
46732
|
"keychainAdmin.reveal": {
|
|
45402
46733
|
capName: "keychain-admin",
|
|
45403
46734
|
capScope: "system",
|
|
@@ -47144,6 +48475,12 @@ Object.freeze({
|
|
|
47144
48475
|
addonId: null,
|
|
47145
48476
|
access: "view"
|
|
47146
48477
|
},
|
|
48478
|
+
"pipelineAnalytics.offerRetrainArchive": {
|
|
48479
|
+
capName: "pipeline-analytics",
|
|
48480
|
+
capScope: "device",
|
|
48481
|
+
addonId: null,
|
|
48482
|
+
access: "create"
|
|
48483
|
+
},
|
|
47147
48484
|
"pipelineAnalytics.ownersWithMedia": {
|
|
47148
48485
|
capName: "pipeline-analytics",
|
|
47149
48486
|
capScope: "device",
|
|
@@ -49682,6 +51019,174 @@ Object.freeze({
|
|
|
49682
51019
|
addonId: null,
|
|
49683
51020
|
access: "view"
|
|
49684
51021
|
},
|
|
51022
|
+
"training.canaryResult": {
|
|
51023
|
+
capName: "training",
|
|
51024
|
+
capScope: "system",
|
|
51025
|
+
addonId: null,
|
|
51026
|
+
access: "create"
|
|
51027
|
+
},
|
|
51028
|
+
"training.cancelJob": {
|
|
51029
|
+
capName: "training",
|
|
51030
|
+
capScope: "system",
|
|
51031
|
+
addonId: null,
|
|
51032
|
+
access: "create"
|
|
51033
|
+
},
|
|
51034
|
+
"training.discardResult": {
|
|
51035
|
+
capName: "training",
|
|
51036
|
+
capScope: "system",
|
|
51037
|
+
addonId: null,
|
|
51038
|
+
access: "create"
|
|
51039
|
+
},
|
|
51040
|
+
"training.findDatasetVersionIdByName": {
|
|
51041
|
+
capName: "training",
|
|
51042
|
+
capScope: "system",
|
|
51043
|
+
addonId: null,
|
|
51044
|
+
access: "view"
|
|
51045
|
+
},
|
|
51046
|
+
"training.getDatasetVersion": {
|
|
51047
|
+
capName: "training",
|
|
51048
|
+
capScope: "system",
|
|
51049
|
+
addonId: null,
|
|
51050
|
+
access: "view"
|
|
51051
|
+
},
|
|
51052
|
+
"training.getJob": {
|
|
51053
|
+
capName: "training",
|
|
51054
|
+
capScope: "system",
|
|
51055
|
+
addonId: null,
|
|
51056
|
+
access: "view"
|
|
51057
|
+
},
|
|
51058
|
+
"training.getJobResult": {
|
|
51059
|
+
capName: "training",
|
|
51060
|
+
capScope: "system",
|
|
51061
|
+
addonId: null,
|
|
51062
|
+
access: "view"
|
|
51063
|
+
},
|
|
51064
|
+
"training.listBaseModels": {
|
|
51065
|
+
capName: "training",
|
|
51066
|
+
capScope: "system",
|
|
51067
|
+
addonId: null,
|
|
51068
|
+
access: "view"
|
|
51069
|
+
},
|
|
51070
|
+
"training.listDatasetVersions": {
|
|
51071
|
+
capName: "training",
|
|
51072
|
+
capScope: "system",
|
|
51073
|
+
addonId: null,
|
|
51074
|
+
access: "view"
|
|
51075
|
+
},
|
|
51076
|
+
"training.listJobs": {
|
|
51077
|
+
capName: "training",
|
|
51078
|
+
capScope: "system",
|
|
51079
|
+
addonId: null,
|
|
51080
|
+
access: "view"
|
|
51081
|
+
},
|
|
51082
|
+
"training.planJob": {
|
|
51083
|
+
capName: "training",
|
|
51084
|
+
capScope: "system",
|
|
51085
|
+
addonId: null,
|
|
51086
|
+
access: "view"
|
|
51087
|
+
},
|
|
51088
|
+
"training.putDatasetVersion": {
|
|
51089
|
+
capName: "training",
|
|
51090
|
+
capScope: "system",
|
|
51091
|
+
addonId: null,
|
|
51092
|
+
access: "create"
|
|
51093
|
+
},
|
|
51094
|
+
"training.registerResult": {
|
|
51095
|
+
capName: "training",
|
|
51096
|
+
capScope: "system",
|
|
51097
|
+
addonId: null,
|
|
51098
|
+
access: "create"
|
|
51099
|
+
},
|
|
51100
|
+
"training.removeDatasetVersion": {
|
|
51101
|
+
capName: "training",
|
|
51102
|
+
capScope: "system",
|
|
51103
|
+
addonId: null,
|
|
51104
|
+
access: "delete"
|
|
51105
|
+
},
|
|
51106
|
+
"training.rollbackCanary": {
|
|
51107
|
+
capName: "training",
|
|
51108
|
+
capScope: "system",
|
|
51109
|
+
addonId: null,
|
|
51110
|
+
access: "create"
|
|
51111
|
+
},
|
|
51112
|
+
"training.startJob": {
|
|
51113
|
+
capName: "training",
|
|
51114
|
+
capScope: "system",
|
|
51115
|
+
addonId: null,
|
|
51116
|
+
access: "create"
|
|
51117
|
+
},
|
|
51118
|
+
"trainingProvider.cancelJob": {
|
|
51119
|
+
capName: "training-provider",
|
|
51120
|
+
capScope: "system",
|
|
51121
|
+
addonId: null,
|
|
51122
|
+
access: "create"
|
|
51123
|
+
},
|
|
51124
|
+
"trainingProvider.cleanupJob": {
|
|
51125
|
+
capName: "training-provider",
|
|
51126
|
+
capScope: "system",
|
|
51127
|
+
addonId: null,
|
|
51128
|
+
access: "create"
|
|
51129
|
+
},
|
|
51130
|
+
"trainingProvider.describe": {
|
|
51131
|
+
capName: "training-provider",
|
|
51132
|
+
capScope: "system",
|
|
51133
|
+
addonId: null,
|
|
51134
|
+
access: "view"
|
|
51135
|
+
},
|
|
51136
|
+
"trainingProvider.estimateJob": {
|
|
51137
|
+
capName: "training-provider",
|
|
51138
|
+
capScope: "system",
|
|
51139
|
+
addonId: null,
|
|
51140
|
+
access: "view"
|
|
51141
|
+
},
|
|
51142
|
+
"trainingProvider.getJob": {
|
|
51143
|
+
capName: "training-provider",
|
|
51144
|
+
capScope: "system",
|
|
51145
|
+
addonId: null,
|
|
51146
|
+
access: "view"
|
|
51147
|
+
},
|
|
51148
|
+
"trainingProvider.listJobEvents": {
|
|
51149
|
+
capName: "training-provider",
|
|
51150
|
+
capScope: "system",
|
|
51151
|
+
addonId: null,
|
|
51152
|
+
access: "view"
|
|
51153
|
+
},
|
|
51154
|
+
"trainingProvider.listJobs": {
|
|
51155
|
+
capName: "training-provider",
|
|
51156
|
+
capScope: "system",
|
|
51157
|
+
addonId: null,
|
|
51158
|
+
access: "view"
|
|
51159
|
+
},
|
|
51160
|
+
"trainingProvider.offerArtifact": {
|
|
51161
|
+
capName: "training-provider",
|
|
51162
|
+
capScope: "system",
|
|
51163
|
+
addonId: null,
|
|
51164
|
+
access: "create"
|
|
51165
|
+
},
|
|
51166
|
+
"trainingProvider.readResult": {
|
|
51167
|
+
capName: "training-provider",
|
|
51168
|
+
capScope: "system",
|
|
51169
|
+
addonId: null,
|
|
51170
|
+
access: "create"
|
|
51171
|
+
},
|
|
51172
|
+
"trainingProvider.submitJob": {
|
|
51173
|
+
capName: "training-provider",
|
|
51174
|
+
capScope: "system",
|
|
51175
|
+
addonId: null,
|
|
51176
|
+
access: "create"
|
|
51177
|
+
},
|
|
51178
|
+
"trainingProvider.uploadDataset": {
|
|
51179
|
+
capName: "training-provider",
|
|
51180
|
+
capScope: "system",
|
|
51181
|
+
addonId: null,
|
|
51182
|
+
access: "create"
|
|
51183
|
+
},
|
|
51184
|
+
"trainingProvider.validateCredentials": {
|
|
51185
|
+
capName: "training-provider",
|
|
51186
|
+
capScope: "system",
|
|
51187
|
+
addonId: null,
|
|
51188
|
+
access: "create"
|
|
51189
|
+
},
|
|
49685
51190
|
"turnProvider.getTurnServers": {
|
|
49686
51191
|
capName: "turn-provider",
|
|
49687
51192
|
capScope: "system",
|
|
@@ -49706,12 +51211,6 @@ Object.freeze({
|
|
|
49706
51211
|
addonId: null,
|
|
49707
51212
|
access: "create"
|
|
49708
51213
|
},
|
|
49709
|
-
"userManagement.createApiKey": {
|
|
49710
|
-
capName: "user-management",
|
|
49711
|
-
capScope: "system",
|
|
49712
|
-
addonId: null,
|
|
49713
|
-
access: "create"
|
|
49714
|
-
},
|
|
49715
51214
|
"userManagement.createScopedToken": {
|
|
49716
51215
|
capName: "user-management",
|
|
49717
51216
|
capScope: "system",
|
|
@@ -49748,12 +51247,6 @@ Object.freeze({
|
|
|
49748
51247
|
addonId: null,
|
|
49749
51248
|
access: "view"
|
|
49750
51249
|
},
|
|
49751
|
-
"userManagement.linkExternalIdentity": {
|
|
49752
|
-
capName: "user-management",
|
|
49753
|
-
capScope: "system",
|
|
49754
|
-
addonId: null,
|
|
49755
|
-
access: "create"
|
|
49756
|
-
},
|
|
49757
51250
|
"userManagement.listApiKeys": {
|
|
49758
51251
|
capName: "user-management",
|
|
49759
51252
|
capScope: "system",
|
|
@@ -49856,12 +51349,6 @@ Object.freeze({
|
|
|
49856
51349
|
addonId: null,
|
|
49857
51350
|
access: "create"
|
|
49858
51351
|
},
|
|
49859
|
-
"userManagement.validateApiKey": {
|
|
49860
|
-
capName: "user-management",
|
|
49861
|
-
capScope: "system",
|
|
49862
|
-
addonId: null,
|
|
49863
|
-
access: "view"
|
|
49864
|
-
},
|
|
49865
51352
|
"userManagement.validateCredentials": {
|
|
49866
51353
|
capName: "user-management",
|
|
49867
51354
|
capScope: "system",
|
|
@@ -53975,6 +55462,11 @@ Object.freeze({
|
|
|
53975
55462
|
form: "single",
|
|
53976
55463
|
optional: false
|
|
53977
55464
|
}],
|
|
55465
|
+
"training.canaryResult": [{
|
|
55466
|
+
name: "deviceIds",
|
|
55467
|
+
form: "array",
|
|
55468
|
+
optional: false
|
|
55469
|
+
}],
|
|
53978
55470
|
"update.getStatus": [{
|
|
53979
55471
|
name: "deviceId",
|
|
53980
55472
|
form: "single",
|