@camstack/addon-pipeline 1.2.346 → 1.2.348
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/audio-analyzer/index.js +3 -3
- package/dist/audio-analyzer/index.mjs +3 -3
- package/dist/{custom-model-catalog-C4LhTrew.mjs → custom-model-catalog-B9iY9L4J.mjs} +2 -2
- package/dist/{custom-model-catalog-B0QdF7dJ.js → custom-model-catalog-ae8UGV5D.js} +2 -2
- package/dist/detection-pipeline/index.js +4 -4
- package/dist/detection-pipeline/index.mjs +4 -4
- package/dist/{dist-qBCVRsyf.js → dist-BrHqpGoN.js} +1790 -133
- package/dist/{dist-Dj26w1od.mjs → dist-Cr4QsawE.mjs} +1790 -133
- package/dist/{model-catalogs-C6tbm7vF.js → model-catalogs-BHBzN67T.js} +15 -4
- package/dist/{model-catalogs-CsxkEiiz.mjs → model-catalogs-Bj9lxXcI.mjs} +15 -4
- package/dist/motion-wasm/index.js +1 -1
- package/dist/motion-wasm/index.mjs +1 -1
- package/dist/{node-DmCpPH58.js → node-CJ1zilVO.js} +1 -1
- package/dist/{node-Cc9bQ8ZM.mjs → node-Dym0f_3g.mjs} +1 -1
- package/dist/pipeline-runner/index.js +4 -4
- package/dist/pipeline-runner/index.mjs +4 -4
- package/dist/{process-memory-BxIflT01.js → process-memory-CAMKwMJs.js} +1 -1
- package/dist/{process-memory-BrI4evjl.mjs → process-memory-CwDymrXT.mjs} +1 -1
- package/dist/recorder/index.js +4 -6
- package/dist/recorder/index.mjs +4 -6
- package/dist/{segment-demux-js-DCLzkQTf.js → segment-demux-js-BEaJw3G9.js} +1 -1
- package/dist/{segment-demux-js-CmuAuckE.mjs → segment-demux-js-CjTXPNsG.mjs} +1 -1
- package/dist/stream-broker/_stub.js +2 -2
- package/dist/stream-broker/{_virtual_mf-localSharedImportMap___mfe_internal__addon_stream_broker_widgets-BX73joE9.mjs → _virtual_mf-localSharedImportMap___mfe_internal__addon_stream_broker_widgets-Db59r-U9.mjs} +3 -3
- package/dist/stream-broker/_virtual_mf___mfe_internal__addon_stream_broker_widgets__loadShare___mf_0_camstack_mf_1_types__loadShare__.js-CNhTe1NS.mjs +26 -0
- package/dist/stream-broker/_virtual_mf___mfe_internal__addon_stream_broker_widgets__loadShare___mf_0_camstack_mf_1_ui_mf_2_library__loadShare__.js-BjeGYopB.mjs +26 -0
- package/dist/stream-broker/demux-worker-child.js +1 -1
- package/dist/stream-broker/demux-worker-child.mjs +1 -1
- package/dist/stream-broker/{hostInit-DKWabjpO.mjs → hostInit-CsgP9_0g.mjs} +3 -3
- package/dist/stream-broker/index.js +3 -3
- package/dist/stream-broker/index.mjs +3 -3
- package/dist/stream-broker/remoteEntry.js +1 -1
- package/package.json +1 -1
- package/dist/stream-broker/_virtual_mf___mfe_internal__addon_stream_broker_widgets__loadShare___mf_0_camstack_mf_1_types__loadShare__.js-B38GLERV.mjs +0 -26
- package/dist/stream-broker/_virtual_mf___mfe_internal__addon_stream_broker_widgets__loadShare___mf_0_camstack_mf_1_ui_mf_2_library__loadShare__.js-pieGo_tC.mjs +0 -26
|
@@ -5377,7 +5377,7 @@ var ZodIssueCode = {
|
|
|
5377
5377
|
var ZodFirstPartyTypeKind;
|
|
5378
5378
|
ZodFirstPartyTypeKind || (ZodFirstPartyTypeKind = {});
|
|
5379
5379
|
//#endregion
|
|
5380
|
-
//#region ../types/dist/sleep-
|
|
5380
|
+
//#region ../types/dist/sleep-r3RWkGVx.mjs
|
|
5381
5381
|
/**
|
|
5382
5382
|
* The audio chunk plane's byte format, and the ONE expansion from a coded
|
|
5383
5383
|
* window to float samples (D455).
|
|
@@ -5526,7 +5526,7 @@ function isKeychainStoredField(field) {
|
|
|
5526
5526
|
var SECRET_CLEAR = { $secretClear: true };
|
|
5527
5527
|
/** The `'***'` token D634 redaction writes for non-admins. */
|
|
5528
5528
|
var LEGACY_DEVICE_REDACTION = "***";
|
|
5529
|
-
function isRecord$
|
|
5529
|
+
function isRecord$2(value) {
|
|
5530
5530
|
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
5531
5531
|
}
|
|
5532
5532
|
function makeSecretMarker(ref) {
|
|
@@ -5537,12 +5537,12 @@ function makeSecretMarker(ref) {
|
|
|
5537
5537
|
}
|
|
5538
5538
|
/** A stored marker: an object whose `$secret` is a non-empty string. */
|
|
5539
5539
|
function isSecretMarker(value) {
|
|
5540
|
-
if (!isRecord$
|
|
5540
|
+
if (!isRecord$2(value)) return false;
|
|
5541
5541
|
const ref = value["$secret"];
|
|
5542
5542
|
return typeof ref === "string" && ref.length > 0;
|
|
5543
5543
|
}
|
|
5544
5544
|
function isSecretClear(value) {
|
|
5545
|
-
return isRecord$
|
|
5545
|
+
return isRecord$2(value) && value["$secretClear"] === true;
|
|
5546
5546
|
}
|
|
5547
5547
|
/**
|
|
5548
5548
|
* The UI view of a stored secret field value: a marker becomes "set", inline
|
|
@@ -6074,6 +6074,13 @@ function globalSecretScope() {
|
|
|
6074
6074
|
function encodeSegment(value) {
|
|
6075
6075
|
return encodeURIComponent(value);
|
|
6076
6076
|
}
|
|
6077
|
+
function decodeSegment(value) {
|
|
6078
|
+
try {
|
|
6079
|
+
return decodeURIComponent(value);
|
|
6080
|
+
} catch {
|
|
6081
|
+
return null;
|
|
6082
|
+
}
|
|
6083
|
+
}
|
|
6077
6084
|
/**
|
|
6078
6085
|
* The field path of a value inside an array item, addressed by the item's id:
|
|
6079
6086
|
* `arrayItemFieldPath('providers', 'authentik', 'clientSecret')` →
|
|
@@ -6082,6 +6089,75 @@ function encodeSegment(value) {
|
|
|
6082
6089
|
function arrayItemFieldPath(arrayKey, itemId, fieldKey) {
|
|
6083
6090
|
return `${arrayKey}[${encodeSegment(itemId)}].${fieldKey}`;
|
|
6084
6091
|
}
|
|
6092
|
+
function parseScope(segments) {
|
|
6093
|
+
switch (segments[0]) {
|
|
6094
|
+
case "global": return {
|
|
6095
|
+
scope: GLOBAL_SCOPE,
|
|
6096
|
+
used: 1
|
|
6097
|
+
};
|
|
6098
|
+
case "node": {
|
|
6099
|
+
const nodeId = segments[1] !== void 0 ? decodeSegment(segments[1]) : null;
|
|
6100
|
+
return nodeId === null || nodeId.length === 0 ? null : {
|
|
6101
|
+
scope: {
|
|
6102
|
+
kind: "node",
|
|
6103
|
+
nodeId
|
|
6104
|
+
},
|
|
6105
|
+
used: 2
|
|
6106
|
+
};
|
|
6107
|
+
}
|
|
6108
|
+
case "device": {
|
|
6109
|
+
const raw = segments[1];
|
|
6110
|
+
if (raw === void 0 || !/^\d+$/.test(raw)) return null;
|
|
6111
|
+
return {
|
|
6112
|
+
scope: {
|
|
6113
|
+
kind: "device",
|
|
6114
|
+
deviceId: Number(raw)
|
|
6115
|
+
},
|
|
6116
|
+
used: 2
|
|
6117
|
+
};
|
|
6118
|
+
}
|
|
6119
|
+
case "integration": {
|
|
6120
|
+
const id = segments[1] !== void 0 ? decodeSegment(segments[1]) : null;
|
|
6121
|
+
return id === null || id.length === 0 ? null : {
|
|
6122
|
+
scope: {
|
|
6123
|
+
kind: "integration",
|
|
6124
|
+
integrationId: id
|
|
6125
|
+
},
|
|
6126
|
+
used: 2
|
|
6127
|
+
};
|
|
6128
|
+
}
|
|
6129
|
+
case "row": {
|
|
6130
|
+
const collection = segments[1] !== void 0 ? decodeSegment(segments[1]) : null;
|
|
6131
|
+
const rowId = segments[2] !== void 0 ? decodeSegment(segments[2]) : null;
|
|
6132
|
+
if (collection === null || rowId === null || collection.length === 0 || rowId.length === 0) return null;
|
|
6133
|
+
return {
|
|
6134
|
+
scope: {
|
|
6135
|
+
kind: "row",
|
|
6136
|
+
collection,
|
|
6137
|
+
rowId
|
|
6138
|
+
},
|
|
6139
|
+
used: 3
|
|
6140
|
+
};
|
|
6141
|
+
}
|
|
6142
|
+
default: return null;
|
|
6143
|
+
}
|
|
6144
|
+
}
|
|
6145
|
+
/** Take a ref apart; `null` when it is not a well-formed ref. */
|
|
6146
|
+
function parseSecretRef(ref) {
|
|
6147
|
+
if (!ref.startsWith("secret://")) return null;
|
|
6148
|
+
const segments = ref.slice(9).split("/");
|
|
6149
|
+
const owner = segments[0] !== void 0 ? decodeSegment(segments[0]) : null;
|
|
6150
|
+
if (owner === null || owner.length === 0) return null;
|
|
6151
|
+
const parsed = parseScope(segments.slice(1));
|
|
6152
|
+
if (parsed === null) return null;
|
|
6153
|
+
const fieldPath = segments.slice(1 + parsed.used).join("/");
|
|
6154
|
+
if (fieldPath.length === 0) return null;
|
|
6155
|
+
return {
|
|
6156
|
+
owner,
|
|
6157
|
+
scope: parsed.scope,
|
|
6158
|
+
fieldPath
|
|
6159
|
+
};
|
|
6160
|
+
}
|
|
6085
6161
|
/** A write to a secret path could not be stored in the keychain, so it was refused. */
|
|
6086
6162
|
var KeychainWriteRefusedError = class extends Error {
|
|
6087
6163
|
fieldPath;
|
|
@@ -6092,7 +6168,7 @@ var KeychainWriteRefusedError = class extends Error {
|
|
|
6092
6168
|
}
|
|
6093
6169
|
};
|
|
6094
6170
|
var KEEP = { kind: "keep" };
|
|
6095
|
-
function isRecord(value) {
|
|
6171
|
+
function isRecord$1$1(value) {
|
|
6096
6172
|
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
6097
6173
|
}
|
|
6098
6174
|
function defaultMintId() {
|
|
@@ -6105,7 +6181,7 @@ function collectSecretMarkerRefs(value, out = []) {
|
|
|
6105
6181
|
return out;
|
|
6106
6182
|
}
|
|
6107
6183
|
if (Array.isArray(value)) for (const item of value) collectSecretMarkerRefs(item, out);
|
|
6108
|
-
else if (isRecord(value)) for (const child of Object.values(value)) collectSecretMarkerRefs(child, out);
|
|
6184
|
+
else if (isRecord$1$1(value)) for (const child of Object.values(value)) collectSecretMarkerRefs(child, out);
|
|
6109
6185
|
return out;
|
|
6110
6186
|
}
|
|
6111
6187
|
async function storedValueEquals(secrets, marker, candidate) {
|
|
@@ -6160,7 +6236,7 @@ function rowId(row, idKey) {
|
|
|
6160
6236
|
return null;
|
|
6161
6237
|
}
|
|
6162
6238
|
async function writeArray(ctx, node, incoming, stored, fieldPath) {
|
|
6163
|
-
const storedRows = Array.isArray(stored) ? stored.filter(isRecord) : [];
|
|
6239
|
+
const storedRows = Array.isArray(stored) ? stored.filter(isRecord$1$1) : [];
|
|
6164
6240
|
if (!Array.isArray(incoming)) {
|
|
6165
6241
|
ctx.deletes.push(...collectSecretMarkerRefs(storedRows));
|
|
6166
6242
|
return {
|
|
@@ -6176,7 +6252,7 @@ async function writeArray(ctx, node, incoming, stored, fieldPath) {
|
|
|
6176
6252
|
const kept = /* @__PURE__ */ new Set();
|
|
6177
6253
|
const rows = [];
|
|
6178
6254
|
for (const row of incoming) {
|
|
6179
|
-
if (!isRecord(row)) {
|
|
6255
|
+
if (!isRecord$1$1(row)) {
|
|
6180
6256
|
rows.push(row);
|
|
6181
6257
|
continue;
|
|
6182
6258
|
}
|
|
@@ -6201,7 +6277,7 @@ async function writeNode(ctx, node, incoming, stored, fieldPath) {
|
|
|
6201
6277
|
case "leaf": return writeLeaf(ctx, incoming, stored, fieldPath);
|
|
6202
6278
|
case "array": return writeArray(ctx, node, incoming, stored, fieldPath);
|
|
6203
6279
|
case "object": {
|
|
6204
|
-
if (!isRecord(incoming)) {
|
|
6280
|
+
if (!isRecord$1$1(incoming)) {
|
|
6205
6281
|
if (incoming === void 0) return KEEP;
|
|
6206
6282
|
ctx.deletes.push(...collectSecretMarkerRefs(stored));
|
|
6207
6283
|
return {
|
|
@@ -6209,7 +6285,7 @@ async function writeNode(ctx, node, incoming, stored, fieldPath) {
|
|
|
6209
6285
|
value: incoming
|
|
6210
6286
|
};
|
|
6211
6287
|
}
|
|
6212
|
-
const storedObj = isRecord(stored) ? stored : {};
|
|
6288
|
+
const storedObj = isRecord$1$1(stored) ? stored : {};
|
|
6213
6289
|
return {
|
|
6214
6290
|
kind: "value",
|
|
6215
6291
|
value: await writeMembers(ctx, node.children, incoming, storedObj, (m) => `${fieldPath}.${m}`)
|
|
@@ -6268,12 +6344,19 @@ async function transformSecretWrite(input) {
|
|
|
6268
6344
|
}
|
|
6269
6345
|
};
|
|
6270
6346
|
}
|
|
6347
|
+
/** Is `ref` one of `owner`'s refs? */
|
|
6348
|
+
function isSecretRefOwnedBy(ref, owner) {
|
|
6349
|
+
return parseSecretRef(ref)?.owner === owner;
|
|
6350
|
+
}
|
|
6271
6351
|
/**
|
|
6272
6352
|
* Replace every marker in `value` with its keychain value. Returns the SAME
|
|
6273
6353
|
* reference when there is no marker (no allocation, no keychain call).
|
|
6274
6354
|
*/
|
|
6275
|
-
async function resolveSecretMarkers(value, secrets) {
|
|
6276
|
-
const
|
|
6355
|
+
async function resolveSecretMarkers(value, secrets, options = {}) {
|
|
6356
|
+
const keepMarker = options.unresolved === "keep-marker";
|
|
6357
|
+
const owner = options.ownedBy;
|
|
6358
|
+
const inScope = (ref) => owner === void 0 || isSecretRefOwnedBy(ref, owner);
|
|
6359
|
+
const refs = collectSecretMarkerRefs(value).filter(inScope);
|
|
6277
6360
|
if (refs.length === 0) return {
|
|
6278
6361
|
value,
|
|
6279
6362
|
unresolved: []
|
|
@@ -6297,10 +6380,18 @@ async function resolveSecretMarkers(value, secrets) {
|
|
|
6297
6380
|
}
|
|
6298
6381
|
const substitute = (v) => {
|
|
6299
6382
|
if (isSecretMarker(v)) {
|
|
6383
|
+
if (!inScope(v.$secret)) return {
|
|
6384
|
+
keep: true,
|
|
6385
|
+
value: v
|
|
6386
|
+
};
|
|
6300
6387
|
const answer = answers[v.$secret];
|
|
6301
|
-
|
|
6388
|
+
if (answer?.kind === "value") return {
|
|
6302
6389
|
keep: true,
|
|
6303
6390
|
value: answer.value
|
|
6391
|
+
};
|
|
6392
|
+
return keepMarker ? {
|
|
6393
|
+
keep: true,
|
|
6394
|
+
value: v
|
|
6304
6395
|
} : {
|
|
6305
6396
|
keep: false,
|
|
6306
6397
|
value: void 0
|
|
@@ -6317,7 +6408,7 @@ async function resolveSecretMarkers(value, secrets) {
|
|
|
6317
6408
|
value: items
|
|
6318
6409
|
};
|
|
6319
6410
|
}
|
|
6320
|
-
if (isRecord(v)) {
|
|
6411
|
+
if (isRecord$1$1(v)) {
|
|
6321
6412
|
const out = {};
|
|
6322
6413
|
for (const [k, child] of Object.entries(v)) {
|
|
6323
6414
|
const s = substitute(child);
|
|
@@ -6338,14 +6429,152 @@ async function resolveSecretMarkers(value, secrets) {
|
|
|
6338
6429
|
unresolved
|
|
6339
6430
|
};
|
|
6340
6431
|
}
|
|
6341
|
-
|
|
6342
|
-
|
|
6343
|
-
|
|
6344
|
-
|
|
6345
|
-
|
|
6432
|
+
/** An addon tried to replace a stored secret it could not read. Nothing was written. */
|
|
6433
|
+
var SecretOverwriteRefusedError = class extends Error {
|
|
6434
|
+
ref;
|
|
6435
|
+
reason;
|
|
6436
|
+
constructor(ref, reason) {
|
|
6437
|
+
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.`);
|
|
6438
|
+
this.ref = ref;
|
|
6439
|
+
this.reason = reason;
|
|
6440
|
+
this.name = "SecretOverwriteRefusedError";
|
|
6441
|
+
}
|
|
6442
|
+
};
|
|
6443
|
+
function isRecord(value) {
|
|
6444
|
+
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
6445
|
+
}
|
|
6446
|
+
function resolvedValue(pass, marker) {
|
|
6447
|
+
const answer = pass.answers[marker.$secret];
|
|
6448
|
+
return answer?.kind === "value" ? answer.value : null;
|
|
6449
|
+
}
|
|
6450
|
+
async function atMarker(pass, incoming, stored) {
|
|
6451
|
+
if (incoming === null) return stored;
|
|
6452
|
+
if (typeof incoming !== "string") return incoming;
|
|
6453
|
+
if (incoming === resolvedValue(pass, stored)) return stored;
|
|
6454
|
+
const intent = classifySecretWrite(incoming);
|
|
6455
|
+
if (intent.kind !== "set") return stored;
|
|
6456
|
+
const ref = stored.$secret;
|
|
6457
|
+
if (!isSecretRefOwnedBy(ref, pass.secrets.owner)) return incoming;
|
|
6458
|
+
const answer = pass.answers[ref];
|
|
6459
|
+
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);
|
|
6460
|
+
try {
|
|
6461
|
+
await pass.secrets.put(ref, intent.value);
|
|
6462
|
+
} catch (err) {
|
|
6463
|
+
throw new KeychainWriteRefusedError(ref, err);
|
|
6464
|
+
}
|
|
6465
|
+
pass.changedRefs.push(ref);
|
|
6466
|
+
return stored;
|
|
6467
|
+
}
|
|
6468
|
+
function inArray(pass, incoming, stored) {
|
|
6469
|
+
return incoming.map((item, index) => {
|
|
6470
|
+
const twin = stored[index];
|
|
6471
|
+
if (isSecretMarker(twin)) return typeof item === "string" && item === resolvedValue(pass, twin) ? twin : item;
|
|
6472
|
+
if (isRecord(item) && isRecord(twin)) return inArrayRow(pass, item, twin);
|
|
6473
|
+
if (Array.isArray(item) && Array.isArray(twin)) return inArray(pass, item, twin);
|
|
6474
|
+
return item;
|
|
6475
|
+
});
|
|
6476
|
+
}
|
|
6477
|
+
function inArrayRow(pass, incoming, stored) {
|
|
6478
|
+
const out = { ...incoming };
|
|
6479
|
+
for (const [key, value] of Object.entries(incoming)) {
|
|
6480
|
+
const twin = stored[key];
|
|
6481
|
+
if (isSecretMarker(twin)) {
|
|
6482
|
+
if (typeof value === "string" && value === resolvedValue(pass, twin)) out[key] = twin;
|
|
6483
|
+
} else if (isRecord(value) && isRecord(twin)) out[key] = inArrayRow(pass, value, twin);
|
|
6484
|
+
else if (Array.isArray(value) && Array.isArray(twin)) out[key] = inArray(pass, value, twin);
|
|
6485
|
+
}
|
|
6486
|
+
return out;
|
|
6487
|
+
}
|
|
6488
|
+
async function walk(pass, incoming, stored) {
|
|
6489
|
+
if (isSecretMarker(stored)) return atMarker(pass, incoming, stored);
|
|
6490
|
+
if (Array.isArray(incoming) && Array.isArray(stored)) return inArray(pass, incoming, stored);
|
|
6491
|
+
if (!isRecord(incoming) || !isRecord(stored)) return incoming;
|
|
6492
|
+
const out = { ...incoming };
|
|
6493
|
+
for (const [key, value] of Object.entries(incoming)) out[key] = await walk(pass, value, stored[key]);
|
|
6494
|
+
return out;
|
|
6495
|
+
}
|
|
6496
|
+
/** Restore markers a write-back carries as values. See the file doc. */
|
|
6497
|
+
async function restoreUnchangedSecrets(input) {
|
|
6498
|
+
const refs = [];
|
|
6499
|
+
for (const key of Object.keys(input.patch)) collectSecretMarkerRefs(input.stored[key], refs);
|
|
6500
|
+
const owned = refs.filter((ref) => isSecretRefOwnedBy(ref, input.secrets.owner));
|
|
6501
|
+
if (owned.length === 0) return {
|
|
6502
|
+
patch: input.patch,
|
|
6503
|
+
changedRefs: []
|
|
6504
|
+
};
|
|
6505
|
+
const pass = {
|
|
6506
|
+
secrets: input.secrets,
|
|
6507
|
+
answers: await input.secrets.resolve([...new Set(owned)]),
|
|
6508
|
+
operatorWrite: input.operatorWrite,
|
|
6509
|
+
changedRefs: []
|
|
6510
|
+
};
|
|
6511
|
+
const out = {};
|
|
6512
|
+
for (const [key, value] of Object.entries(input.patch)) out[key] = await walk(pass, value, input.stored[key]);
|
|
6513
|
+
return {
|
|
6514
|
+
patch: out,
|
|
6515
|
+
changedRefs: pass.changedRefs
|
|
6516
|
+
};
|
|
6517
|
+
}
|
|
6518
|
+
/** Structural equality over JSON-shaped values (key order does not matter). */
|
|
6519
|
+
function isJsonEqual(a, b) {
|
|
6520
|
+
if (Object.is(a, b)) return true;
|
|
6521
|
+
if (Array.isArray(a)) return Array.isArray(b) && a.length === b.length && a.every((v, i) => isJsonEqual(v, b[i]));
|
|
6522
|
+
if (isRecord(a) && isRecord(b)) {
|
|
6523
|
+
const keys = Object.keys(a);
|
|
6524
|
+
if (keys.length !== Object.keys(b).length) return false;
|
|
6525
|
+
return keys.every((k) => Object.prototype.hasOwnProperty.call(b, k) && isJsonEqual(a[k], b[k]));
|
|
6346
6526
|
}
|
|
6347
6527
|
return false;
|
|
6348
6528
|
}
|
|
6529
|
+
/** The patch without the keys whose value already equals the stored one. */
|
|
6530
|
+
function dropUnchangedKeys(patch, stored) {
|
|
6531
|
+
const out = {};
|
|
6532
|
+
for (const [key, value] of Object.entries(patch)) {
|
|
6533
|
+
if (Object.prototype.hasOwnProperty.call(stored, key) && isJsonEqual(value, stored[key])) continue;
|
|
6534
|
+
out[key] = value;
|
|
6535
|
+
}
|
|
6536
|
+
return out;
|
|
6537
|
+
}
|
|
6538
|
+
/** The top-level keys of a blob that hold at least one of `owner`'s markers. */
|
|
6539
|
+
function markerKeysOf(blob, owner) {
|
|
6540
|
+
const keys = /* @__PURE__ */ new Set();
|
|
6541
|
+
for (const [key, value] of Object.entries(blob)) if (collectSecretMarkerRefs(value).some((ref) => isSecretRefOwnedBy(ref, owner))) keys.add(key);
|
|
6542
|
+
return keys;
|
|
6543
|
+
}
|
|
6544
|
+
function nodeFromStored(value, owner) {
|
|
6545
|
+
if (isSecretMarker(value)) return isSecretRefOwnedBy(value.$secret, owner) ? { kind: "leaf" } : null;
|
|
6546
|
+
if (!isRecord(value)) return null;
|
|
6547
|
+
const children = /* @__PURE__ */ new Map();
|
|
6548
|
+
for (const [key, child] of Object.entries(value)) {
|
|
6549
|
+
const node = nodeFromStored(child, owner);
|
|
6550
|
+
if (node !== null) children.set(key, node);
|
|
6551
|
+
}
|
|
6552
|
+
return children.size > 0 ? {
|
|
6553
|
+
kind: "object",
|
|
6554
|
+
children
|
|
6555
|
+
} : null;
|
|
6556
|
+
}
|
|
6557
|
+
/**
|
|
6558
|
+
* The declared secret tree, widened by every place the STORED blob holds a
|
|
6559
|
+
* marker under one of `keys` — so a marker the schema no longer declares (or
|
|
6560
|
+
* never declared: Wyze before b4906cec6) still gets the save path's
|
|
6561
|
+
* KEEP / SET / CLEAR semantics instead of being overwritten by whatever the
|
|
6562
|
+
* addon writes. Markers inside arrays are not added: a row has no id field to
|
|
6563
|
+
* match by unless the schema declares one. Only `owner`'s markers count: a
|
|
6564
|
+
* builtin that keeps another addon's marker (device-manager) never takes it
|
|
6565
|
+
* over.
|
|
6566
|
+
*/
|
|
6567
|
+
function widenTreeWithStoredMarkers(declared, stored, keys, owner) {
|
|
6568
|
+
const added = /* @__PURE__ */ new Map();
|
|
6569
|
+
for (const key of keys) {
|
|
6570
|
+
const at = key.indexOf("@");
|
|
6571
|
+
const base = at > 0 ? key.slice(0, at) : key;
|
|
6572
|
+
if (declared.has(base) || added.has(base)) continue;
|
|
6573
|
+
const node = nodeFromStored(stored[key], owner);
|
|
6574
|
+
if (node !== null) added.set(base, node);
|
|
6575
|
+
}
|
|
6576
|
+
return added.size === 0 ? declared : new Map([...declared, ...added]);
|
|
6577
|
+
}
|
|
6349
6578
|
/** The blob as stored now; a failed read REFUSES the write instead of guessing. */
|
|
6350
6579
|
async function readStoredAddonBlob(raw) {
|
|
6351
6580
|
const threeWay = raw.readAddonStoreResult;
|
|
@@ -6354,7 +6583,41 @@ async function readStoredAddonBlob(raw) {
|
|
|
6354
6583
|
if (result.kind === "failed") throw new Error(`settings write refused: the stored blob could not be read (${result.error})`);
|
|
6355
6584
|
return result.kind === "missing" ? {} : result.value;
|
|
6356
6585
|
}
|
|
6357
|
-
function
|
|
6586
|
+
function touchesTree(tree, patch) {
|
|
6587
|
+
if (tree.size === 0) return false;
|
|
6588
|
+
for (const key of Object.keys(patch)) {
|
|
6589
|
+
const at = key.indexOf("@");
|
|
6590
|
+
if (tree.has(at > 0 ? key.slice(0, at) : key)) return true;
|
|
6591
|
+
}
|
|
6592
|
+
return false;
|
|
6593
|
+
}
|
|
6594
|
+
/**
|
|
6595
|
+
* Which top-level keys of each store held markers when last seen. `undefined`
|
|
6596
|
+
* for a store not seen yet: its first write reads it, to be safe.
|
|
6597
|
+
*/
|
|
6598
|
+
var MarkerKeyIndex = class {
|
|
6599
|
+
owner;
|
|
6600
|
+
byStore = /* @__PURE__ */ new Map();
|
|
6601
|
+
constructor(owner) {
|
|
6602
|
+
this.owner = owner;
|
|
6603
|
+
}
|
|
6604
|
+
seen(store, blob) {
|
|
6605
|
+
this.byStore.set(store, markerKeysOf(blob, this.owner));
|
|
6606
|
+
}
|
|
6607
|
+
wrote(store, patch) {
|
|
6608
|
+
const keys = this.byStore.get(store);
|
|
6609
|
+
if (keys === void 0) return;
|
|
6610
|
+
const now = markerKeysOf(patch, this.owner);
|
|
6611
|
+
for (const key of Object.keys(patch)) if (now.has(key)) keys.add(key);
|
|
6612
|
+
else keys.delete(key);
|
|
6613
|
+
}
|
|
6614
|
+
mayHoldMarkers(store, patch) {
|
|
6615
|
+
const keys = this.byStore.get(store);
|
|
6616
|
+
if (keys === void 0) return true;
|
|
6617
|
+
return Object.keys(patch).some((key) => keys.has(key));
|
|
6618
|
+
}
|
|
6619
|
+
};
|
|
6620
|
+
function createHandle(raw, opts) {
|
|
6358
6621
|
const chains = /* @__PURE__ */ new Map();
|
|
6359
6622
|
const serialize = (key, fn) => {
|
|
6360
6623
|
const next = (chains.get(key) ?? Promise.resolve()).then(fn, fn);
|
|
@@ -6365,46 +6628,130 @@ function createSecretAwareSettings(raw, opts) {
|
|
|
6365
6628
|
});
|
|
6366
6629
|
return next;
|
|
6367
6630
|
};
|
|
6368
|
-
const
|
|
6369
|
-
|
|
6370
|
-
|
|
6631
|
+
const index = new MarkerKeyIndex(opts.secrets.owner);
|
|
6632
|
+
const resolveRead = async (store, blob) => {
|
|
6633
|
+
index.seen(store, blob);
|
|
6634
|
+
const { value, unresolved } = await resolveSecretMarkers(blob, opts.secrets, {
|
|
6635
|
+
unresolved: "keep-marker",
|
|
6636
|
+
ownedBy: opts.secrets.owner
|
|
6637
|
+
});
|
|
6638
|
+
if (unresolved.length > 0) opts.onUnresolved?.(unresolved);
|
|
6639
|
+
return value;
|
|
6640
|
+
};
|
|
6641
|
+
const write = async (store, declared, scope, patch, readStored, rawWrite) => {
|
|
6642
|
+
if (!touchesTree(declared, patch) && !index.mayHoldMarkers(store, patch)) {
|
|
6643
|
+
await rawWrite(patch);
|
|
6644
|
+
index.wrote(store, patch);
|
|
6645
|
+
return { changed: true };
|
|
6646
|
+
}
|
|
6647
|
+
return serialize(store, async () => {
|
|
6371
6648
|
const stored = await readStored();
|
|
6649
|
+
index.seen(store, stored);
|
|
6650
|
+
const operatorWrite = opts.isOperatorWrite?.() === true;
|
|
6651
|
+
const restored = await restoreUnchangedSecrets({
|
|
6652
|
+
patch,
|
|
6653
|
+
stored,
|
|
6654
|
+
secrets: opts.secrets,
|
|
6655
|
+
operatorWrite
|
|
6656
|
+
});
|
|
6372
6657
|
const result = await transformSecretWrite({
|
|
6373
|
-
tree,
|
|
6658
|
+
tree: widenTreeWithStoredMarkers(declared, stored, Object.keys(restored.patch), opts.secrets.owner),
|
|
6374
6659
|
secrets: opts.secrets,
|
|
6375
|
-
patch,
|
|
6660
|
+
patch: restored.patch,
|
|
6376
6661
|
stored,
|
|
6377
6662
|
...scope !== void 0 ? { scope } : {},
|
|
6378
|
-
operatorWrite
|
|
6663
|
+
operatorWrite
|
|
6379
6664
|
});
|
|
6380
|
-
|
|
6665
|
+
const effective = dropUnchangedKeys(result.patch, stored);
|
|
6666
|
+
const wroteBlob = Object.keys(effective).length > 0;
|
|
6667
|
+
if (wroteBlob) {
|
|
6668
|
+
await rawWrite(effective);
|
|
6669
|
+
index.wrote(store, effective);
|
|
6670
|
+
}
|
|
6381
6671
|
const { orphaned } = await result.afterWrite();
|
|
6382
6672
|
if (orphaned.length > 0) opts.onOrphaned(orphaned);
|
|
6673
|
+
return { changed: wroteBlob || restored.changedRefs.length > 0 };
|
|
6383
6674
|
});
|
|
6384
6675
|
};
|
|
6385
|
-
const
|
|
6386
|
-
|
|
6387
|
-
|
|
6388
|
-
|
|
6389
|
-
|
|
6390
|
-
|
|
6676
|
+
const writeAddon = (patch) => write("addon", opts.addonTree(), void 0, patch, () => readStoredAddonBlob(raw), (p) => raw.writeAddonStore(p));
|
|
6677
|
+
const readAddonStoreResult = raw.readAddonStoreResult;
|
|
6678
|
+
const readAddonStoreKeyResult = raw.readAddonStoreKeyResult;
|
|
6679
|
+
const readDeviceStoreBatch = raw.readDeviceStoreBatch;
|
|
6680
|
+
const overrides = {
|
|
6681
|
+
readAddonStore: async () => resolveRead("addon", await raw.readAddonStore()),
|
|
6682
|
+
...readAddonStoreResult !== void 0 ? { readAddonStoreResult: async () => {
|
|
6683
|
+
const result = await readAddonStoreResult.call(raw);
|
|
6684
|
+
return result.kind === "value" ? {
|
|
6685
|
+
kind: "value",
|
|
6686
|
+
value: await resolveRead("addon", result.value)
|
|
6687
|
+
} : result;
|
|
6688
|
+
} } : {},
|
|
6689
|
+
...readAddonStoreKeyResult !== void 0 ? { readAddonStoreKeyResult: async (key) => {
|
|
6690
|
+
const result = await readAddonStoreKeyResult.call(raw, key);
|
|
6691
|
+
if (result.kind !== "present") return result;
|
|
6692
|
+
const { value, unresolved } = await resolveSecretMarkers({ [key]: result.value }, opts.secrets, {
|
|
6693
|
+
unresolved: "keep-marker",
|
|
6694
|
+
ownedBy: opts.secrets.owner
|
|
6695
|
+
});
|
|
6696
|
+
if (unresolved.length > 0) opts.onUnresolved?.(unresolved);
|
|
6697
|
+
return {
|
|
6698
|
+
kind: "present",
|
|
6699
|
+
value: value[key]
|
|
6700
|
+
};
|
|
6701
|
+
} } : {},
|
|
6702
|
+
readDeviceStore: async (deviceId) => resolveRead(`device:${deviceId}`, await raw.readDeviceStore(deviceId)),
|
|
6703
|
+
...readDeviceStoreBatch !== void 0 ? { readDeviceStoreBatch: async (deviceIds) => {
|
|
6704
|
+
const rows = await readDeviceStoreBatch.call(raw, deviceIds);
|
|
6705
|
+
const out = /* @__PURE__ */ new Map();
|
|
6706
|
+
for (const [deviceId, blob] of rows) out.set(deviceId, await resolveRead(`device:${deviceId}`, blob));
|
|
6707
|
+
return out;
|
|
6708
|
+
} } : {},
|
|
6709
|
+
writeAddonStore: async (patch) => {
|
|
6710
|
+
await writeAddon(patch);
|
|
6711
|
+
},
|
|
6712
|
+
writeDeviceStore: async (deviceId, patch) => {
|
|
6713
|
+
await write(`device:${deviceId}`, opts.deviceTree(), {
|
|
6714
|
+
kind: "device",
|
|
6715
|
+
deviceId
|
|
6716
|
+
}, patch, () => raw.readDeviceStore(deviceId), (p) => raw.writeDeviceStore(deviceId, p));
|
|
6717
|
+
}
|
|
6718
|
+
};
|
|
6719
|
+
return {
|
|
6720
|
+
settings: new Proxy(raw, { get(target, prop, receiver) {
|
|
6721
|
+
if (typeof prop === "string" && Object.prototype.hasOwnProperty.call(overrides, prop)) return Reflect.get(overrides, prop);
|
|
6722
|
+
const value = Reflect.get(target, prop, receiver);
|
|
6723
|
+
return typeof value === "function" ? value.bind(target) : value;
|
|
6724
|
+
} }),
|
|
6725
|
+
raw: {
|
|
6726
|
+
readAddonStore: async () => {
|
|
6727
|
+
const blob = await raw.readAddonStore();
|
|
6728
|
+
index.seen("addon", blob);
|
|
6729
|
+
return blob;
|
|
6730
|
+
},
|
|
6731
|
+
readDeviceStore: async (deviceId) => {
|
|
6732
|
+
const blob = await raw.readDeviceStore(deviceId);
|
|
6733
|
+
index.seen(`device:${deviceId}`, blob);
|
|
6734
|
+
return blob;
|
|
6735
|
+
}
|
|
6736
|
+
},
|
|
6737
|
+
writeAddonStore: writeAddon
|
|
6391
6738
|
};
|
|
6392
|
-
return new Proxy(raw, { get(target, prop, receiver) {
|
|
6393
|
-
if (prop === "writeAddonStore") return wrapped.writeAddonStore;
|
|
6394
|
-
if (prop === "writeDeviceStore") return wrapped.writeDeviceStore;
|
|
6395
|
-
const value = Reflect.get(target, prop, receiver);
|
|
6396
|
-
return typeof value === "function" ? value.bind(target) : value;
|
|
6397
|
-
} });
|
|
6398
6739
|
}
|
|
6399
|
-
/** The context the addon sees
|
|
6400
|
-
function
|
|
6740
|
+
/** The context the addon sees, plus the private raw view and write outcome. */
|
|
6741
|
+
function createSecretAwareContext(context, opts) {
|
|
6401
6742
|
const raw = context.settings;
|
|
6402
|
-
if (raw === void 0) return
|
|
6403
|
-
|
|
6404
|
-
|
|
6405
|
-
|
|
6406
|
-
|
|
6407
|
-
|
|
6743
|
+
if (raw === void 0) return {
|
|
6744
|
+
context,
|
|
6745
|
+
handle: null
|
|
6746
|
+
};
|
|
6747
|
+
const handle = createHandle(raw, opts);
|
|
6748
|
+
return {
|
|
6749
|
+
context: new Proxy(context, { get(target, prop, receiver) {
|
|
6750
|
+
if (prop === "settings") return handle.settings;
|
|
6751
|
+
return Reflect.get(target, prop, receiver);
|
|
6752
|
+
} }),
|
|
6753
|
+
handle
|
|
6754
|
+
};
|
|
6408
6755
|
}
|
|
6409
6756
|
var LEAF = { kind: "leaf" };
|
|
6410
6757
|
var DEFAULT_ITEM_ID_KEY = "id";
|
|
@@ -6579,6 +6926,14 @@ var BaseAddon = class {
|
|
|
6579
6926
|
_secretChangeUnsub = null;
|
|
6580
6927
|
/** >0 while an OPERATOR's settings write is being applied. */
|
|
6581
6928
|
_operatorWriteDepth = 0;
|
|
6929
|
+
/**
|
|
6930
|
+
* The keychain-aware settings handle (D798). Its `raw` view is the ONLY way
|
|
6931
|
+
* to the marker-bearing blobs and stays private to this class: the form
|
|
6932
|
+
* hydrate and config resolution need markers, addon code never does.
|
|
6933
|
+
*/
|
|
6934
|
+
_secretSettings = null;
|
|
6935
|
+
/** Refs an addon-facing read could not resolve — each is logged once per process. */
|
|
6936
|
+
_loggedUnresolvedReads = /* @__PURE__ */ new Set();
|
|
6582
6937
|
constructor(defaults) {
|
|
6583
6938
|
this.defaults = defaults;
|
|
6584
6939
|
this._config = { ...defaults };
|
|
@@ -6615,13 +6970,21 @@ var BaseAddon = class {
|
|
|
6615
6970
|
}
|
|
6616
6971
|
async initialize(context) {
|
|
6617
6972
|
const secrets = context.secrets;
|
|
6618
|
-
|
|
6619
|
-
|
|
6620
|
-
|
|
6621
|
-
|
|
6622
|
-
|
|
6623
|
-
|
|
6624
|
-
|
|
6973
|
+
if (secrets !== void 0) {
|
|
6974
|
+
const { context: wrapped, handle } = createSecretAwareContext(context, {
|
|
6975
|
+
secrets,
|
|
6976
|
+
addonTree: () => this.addonSecretTree(),
|
|
6977
|
+
deviceTree: () => this.deviceSecretTree(),
|
|
6978
|
+
onOrphaned: (refs) => context.logger.warn("keychain refs dropped by a settings write could not be deleted", { meta: { refs: [...refs] } }),
|
|
6979
|
+
isOperatorWrite: () => this._operatorWriteDepth > 0,
|
|
6980
|
+
onUnresolved: (unresolved) => this.logUnresolvedRead(unresolved)
|
|
6981
|
+
});
|
|
6982
|
+
this._ctx = wrapped;
|
|
6983
|
+
this._secretSettings = handle;
|
|
6984
|
+
} else {
|
|
6985
|
+
this._ctx = context;
|
|
6986
|
+
this._secretSettings = null;
|
|
6987
|
+
}
|
|
6625
6988
|
await this.resolveConfig();
|
|
6626
6989
|
if (secrets !== void 0) this._secretChangeUnsub = secrets.onChange((ref) => {
|
|
6627
6990
|
if (this._configSecretRefs.has(ref)) this.scheduleSecretReresolve(SECRET_CHANGE_DEBOUNCE_MS);
|
|
@@ -6738,11 +7101,8 @@ var BaseAddon = class {
|
|
|
6738
7101
|
async getGlobalSettings(overlay, cap, nodeId) {
|
|
6739
7102
|
const schema = this.globalSettingsSchema(cap);
|
|
6740
7103
|
if (!schema) return { sections: [] };
|
|
6741
|
-
const projected = await this.
|
|
6742
|
-
return hydrateSchema(schema, overlay ? {
|
|
6743
|
-
...projected,
|
|
6744
|
-
...overlay
|
|
6745
|
-
} : projected, { inlineSecretsAsViews: true });
|
|
7104
|
+
const projected = await this.readRawProjectedStore(nodeId, cap);
|
|
7105
|
+
return hydrateSchema(schema, overlay ? await this.overlayKeepingMarkers(projected, overlay) : projected, { inlineSecretsAsViews: true });
|
|
6746
7106
|
}
|
|
6747
7107
|
/**
|
|
6748
7108
|
* The integration-level view of this addon's settings: exactly the sections
|
|
@@ -6787,7 +7147,7 @@ var BaseAddon = class {
|
|
|
6787
7147
|
});
|
|
6788
7148
|
}
|
|
6789
7149
|
if (sections.length === 0) return null;
|
|
6790
|
-
const projected = await this.
|
|
7150
|
+
const projected = await this.readRawProjectedStore(nodeId);
|
|
6791
7151
|
return hydrateSchema({
|
|
6792
7152
|
...schema,
|
|
6793
7153
|
sections
|
|
@@ -6804,12 +7164,50 @@ var BaseAddon = class {
|
|
|
6804
7164
|
* the store for custom option logic (option narrowing, value snapping) to
|
|
6805
7165
|
* read it per-node — never `ctx.settings.readAddonStore()` directly.
|
|
6806
7166
|
* `nodeId` omitted ⇒ the local node (node-blind injection from ctx).
|
|
7167
|
+
*
|
|
7168
|
+
* Keychain values come back RESOLVED (D798): a secret reads as its value,
|
|
7169
|
+
* never as a `{ $secret }` marker. One the keychain cannot serve right now
|
|
7170
|
+
* stays a marker — "stored, unavailable" (`isSecretMarker()` is true, and it
|
|
7171
|
+
* is listed in {@link unresolvedSecrets}) — never `''` and never absent, so
|
|
7172
|
+
* it cannot be mistaken for "nothing stored, mint a new one". Writing the
|
|
7173
|
+
* resolved blob back is a no-op for every unchanged secret.
|
|
6807
7174
|
*/
|
|
6808
7175
|
async resolveGlobalStore(nodeId, cap) {
|
|
6809
7176
|
const raw = await this._ctx?.settings?.readAddonStore() ?? {};
|
|
7177
|
+
return this.projectForNode(raw, nodeId, cap);
|
|
7178
|
+
}
|
|
7179
|
+
projectForNode(store, nodeId, cap) {
|
|
6810
7180
|
const keys = this.perNodeKeys(cap);
|
|
6811
7181
|
const node = normalizeNodeId(nodeId ?? this._ctx?.kernel?.localNodeId);
|
|
6812
|
-
return keys.size > 0 ? projectStore(
|
|
7182
|
+
return keys.size > 0 ? projectStore(store, keys, node) : store;
|
|
7183
|
+
}
|
|
7184
|
+
/** The PROJECTED store with its markers — the form hydrate only (D798). */
|
|
7185
|
+
async readRawProjectedStore(nodeId, cap) {
|
|
7186
|
+
const raw = await this.rawSettings()?.readAddonStore() ?? {};
|
|
7187
|
+
return this.projectForNode(raw, nodeId, cap);
|
|
7188
|
+
}
|
|
7189
|
+
/**
|
|
7190
|
+
* `{ ...stored, ...overlay }`, except that an overlay member equal to the
|
|
7191
|
+
* RESOLVED stored one keeps the stored (marker-bearing) member — so a form
|
|
7192
|
+
* hydrated from a resolved overlay still shows a secret as "set", never as
|
|
7193
|
+
* its value.
|
|
7194
|
+
*/
|
|
7195
|
+
async overlayKeepingMarkers(stored, overlay) {
|
|
7196
|
+
const secrets = this._ctx?.secrets;
|
|
7197
|
+
const merged = {
|
|
7198
|
+
...stored,
|
|
7199
|
+
...overlay
|
|
7200
|
+
};
|
|
7201
|
+
if (secrets === void 0 || collectSecretMarkerRefs(stored).length === 0) return merged;
|
|
7202
|
+
const { value: resolved } = await resolveSecretMarkers(stored, secrets, {
|
|
7203
|
+
unresolved: "keep-marker",
|
|
7204
|
+
ownedBy: secrets.owner
|
|
7205
|
+
});
|
|
7206
|
+
for (const key of Object.keys(overlay)) {
|
|
7207
|
+
if (collectSecretMarkerRefs(stored[key]).length === 0) continue;
|
|
7208
|
+
if (isJsonEqual(overlay[key], resolved[key])) merged[key] = stored[key];
|
|
7209
|
+
}
|
|
7210
|
+
return merged;
|
|
6813
7211
|
}
|
|
6814
7212
|
/**
|
|
6815
7213
|
* Whether ONE global key of this addon's store was written, read three-way
|
|
@@ -6874,8 +7272,12 @@ var BaseAddon = class {
|
|
|
6874
7272
|
async clearSecrets(keys, nodeId) {
|
|
6875
7273
|
const tree = this.addonSecretTree();
|
|
6876
7274
|
const keychain = this._ctx?.secrets !== void 0;
|
|
7275
|
+
const stored = keychain ? await this.readAddonStoreWithRetry() : {};
|
|
6877
7276
|
const patch = {};
|
|
6878
|
-
for (const key of keys)
|
|
7277
|
+
for (const key of keys) {
|
|
7278
|
+
const keychainStored = tree.has(key) || collectSecretMarkerRefs(stored[key]).length > 0;
|
|
7279
|
+
patch[key] = keychain && keychainStored ? SECRET_CLEAR : "";
|
|
7280
|
+
}
|
|
6879
7281
|
await this.applyGlobalPatch(patch, nodeId);
|
|
6880
7282
|
}
|
|
6881
7283
|
async applyGlobalPatch(barePatch, nodeId) {
|
|
@@ -6883,7 +7285,11 @@ var BaseAddon = class {
|
|
|
6883
7285
|
const localNode = normalizeNodeId(this._ctx?.kernel?.localNodeId);
|
|
6884
7286
|
const target = normalizeNodeId(nodeId ?? this._ctx?.kernel?.localNodeId);
|
|
6885
7287
|
const scoped = keys.size > 0 ? scopePatch(barePatch, keys, target) : barePatch;
|
|
6886
|
-
|
|
7288
|
+
const handle = this._secretSettings;
|
|
7289
|
+
if (handle !== null) {
|
|
7290
|
+
const { changed } = await handle.writeAddonStore(scoped);
|
|
7291
|
+
if (!changed) return;
|
|
7292
|
+
} else await this._ctx?.settings?.writeAddonStore(scoped);
|
|
6887
7293
|
if (target !== localNode) return;
|
|
6888
7294
|
await this.resolveConfig();
|
|
6889
7295
|
await this.onConfigChanged();
|
|
@@ -6936,7 +7342,7 @@ var BaseAddon = class {
|
|
|
6936
7342
|
async getDeviceSettings(deviceId) {
|
|
6937
7343
|
const schema = this.deviceSettingsSchema();
|
|
6938
7344
|
if (!schema) return { sections: [] };
|
|
6939
|
-
return hydrateSchema(schema, await this.
|
|
7345
|
+
return hydrateSchema(schema, await this.rawSettings()?.readDeviceStore(deviceId) ?? {}, { inlineSecretsAsViews: true });
|
|
6940
7346
|
}
|
|
6941
7347
|
async updateDeviceSettings(deviceId, patch) {
|
|
6942
7348
|
await this._ctx?.settings?.writeDeviceStore(deviceId, patch);
|
|
@@ -7108,7 +7514,7 @@ var BaseAddon = class {
|
|
|
7108
7514
|
key,
|
|
7109
7515
|
schema,
|
|
7110
7516
|
fallback,
|
|
7111
|
-
read: async () => this.resolveStoredSecrets(await this.
|
|
7517
|
+
read: async () => this.resolveStoredSecrets(await this.rawSettings()?.readDeviceStore(deviceId) ?? {}, false),
|
|
7112
7518
|
write: async (patch) => {
|
|
7113
7519
|
await this._ctx?.settings?.writeDeviceStore(deviceId, patch);
|
|
7114
7520
|
},
|
|
@@ -7170,6 +7576,23 @@ var BaseAddon = class {
|
|
|
7170
7576
|
}
|
|
7171
7577
|
return value;
|
|
7172
7578
|
}
|
|
7579
|
+
/**
|
|
7580
|
+
* The marker-bearing settings reads (D798) — private on purpose. Without a
|
|
7581
|
+
* keychain the context's own view is already raw.
|
|
7582
|
+
*/
|
|
7583
|
+
rawSettings() {
|
|
7584
|
+
return this._secretSettings?.raw ?? this._ctx?.settings;
|
|
7585
|
+
}
|
|
7586
|
+
/** An addon-facing read met markers it could not resolve: say so once per ref. */
|
|
7587
|
+
logUnresolvedRead(unresolved) {
|
|
7588
|
+
const fresh = unresolved.filter((u) => !this._loggedUnresolvedReads.has(u.ref));
|
|
7589
|
+
if (fresh.length === 0) return;
|
|
7590
|
+
for (const u of fresh) this._loggedUnresolvedReads.add(u.ref);
|
|
7591
|
+
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) => ({
|
|
7592
|
+
ref: u.ref,
|
|
7593
|
+
reason: u.reason
|
|
7594
|
+
})) } });
|
|
7595
|
+
}
|
|
7173
7596
|
/** Re-resolve the config (a keychain-only change, or a retry) and apply it. */
|
|
7174
7597
|
scheduleSecretReresolve(delayMs) {
|
|
7175
7598
|
const timerOf = delayMs === SECRET_CHANGE_DEBOUNCE_MS ? "_secretChangeTimer" : "_secretRetryTimer";
|
|
@@ -7196,7 +7619,7 @@ var BaseAddon = class {
|
|
|
7196
7619
|
* `{}` (defaults) — the addon's first successful patch will rehydrate.
|
|
7197
7620
|
*/
|
|
7198
7621
|
async readAddonStoreWithRetry() {
|
|
7199
|
-
const settings = this.
|
|
7622
|
+
const settings = this.rawSettings();
|
|
7200
7623
|
if (!settings) return {};
|
|
7201
7624
|
const delaysMs = [
|
|
7202
7625
|
150,
|
|
@@ -10809,6 +11232,278 @@ var CameraSwitchGroupSchema = object({
|
|
|
10809
11232
|
fetchedAt: number()
|
|
10810
11233
|
});
|
|
10811
11234
|
/**
|
|
11235
|
+
* The trainer contract — what the hub hands the cloud trainer and what it
|
|
11236
|
+
* gets back (cloud training, D805+).
|
|
11237
|
+
*
|
|
11238
|
+
* The trainer (`hf/camstack-trainer`, published as the Hugging Face repo
|
|
11239
|
+
* `camstack/camstack-trainer`) is a separate AGPL program the hub never
|
|
11240
|
+
* imports: `job.json` goes in, files come out, and progress is `CAMSTACK_EVENT`
|
|
11241
|
+
* lines on stdout. These schemas are the hub's half of that boundary; the
|
|
11242
|
+
* trainer's pydantic models (and the JSON Schemas generated from them under
|
|
11243
|
+
* `hf/camstack-trainer/schemas/`) are the other half. A change here is a
|
|
11244
|
+
* change there, in the same piece of work.
|
|
11245
|
+
*
|
|
11246
|
+
* No `.default()` anywhere: defaults do not run on the addon cap path, so the
|
|
11247
|
+
* orchestrator fills every field of a job spec explicitly.
|
|
11248
|
+
*/
|
|
11249
|
+
var TRAINING_JOB_SCHEMA = "camstack.training/v1";
|
|
11250
|
+
var TRAINING_RESULT_SCHEMA = "camstack.training-result/v1";
|
|
11251
|
+
/** What the trainer can export. Edge TPU is a later, separate image. */
|
|
11252
|
+
var TrainingExportSchema = _enum([
|
|
11253
|
+
"onnx",
|
|
11254
|
+
"openvino-fp16",
|
|
11255
|
+
"openvino-int8",
|
|
11256
|
+
"coreml-fp16"
|
|
11257
|
+
]);
|
|
11258
|
+
var FloorsSchema = record(string(), number().min(0).max(1));
|
|
11259
|
+
object({
|
|
11260
|
+
schema: literal(TRAINING_JOB_SCHEMA),
|
|
11261
|
+
jobKey: string().uuid(),
|
|
11262
|
+
target: object({
|
|
11263
|
+
kind: literal("detector"),
|
|
11264
|
+
step: literal("object-detection")
|
|
11265
|
+
}),
|
|
11266
|
+
base: object({
|
|
11267
|
+
modelId: string().min(1),
|
|
11268
|
+
/** Ultralytics weights id, e.g. `yolov9m.pt`. */
|
|
11269
|
+
weights: string().min(1),
|
|
11270
|
+
imgsz: number().int().positive()
|
|
11271
|
+
}),
|
|
11272
|
+
baseline: object({
|
|
11273
|
+
modelId: string().min(1),
|
|
11274
|
+
/** The baseline ONNX the holdout comparison runs; public mirror URL. */
|
|
11275
|
+
onnxUrl: string().url(),
|
|
11276
|
+
imgsz: number().int().positive(),
|
|
11277
|
+
floors: FloorsSchema
|
|
11278
|
+
}),
|
|
11279
|
+
dataset: object({
|
|
11280
|
+
versionId: string().min(1),
|
|
11281
|
+
annotationHash: string(),
|
|
11282
|
+
/** sha256 of the uploaded archive; the trainer refuses a mismatch (exit 65). */
|
|
11283
|
+
sha256: string().regex(/^[0-9a-f]{64}$/)
|
|
11284
|
+
}),
|
|
11285
|
+
split: object({
|
|
11286
|
+
holdoutCameras: array(number().int()),
|
|
11287
|
+
/** When no camera is held out: the last N days of every camera. */
|
|
11288
|
+
holdoutLastDays: number().int().nonnegative(),
|
|
11289
|
+
valFraction: number().min(0).max(.5),
|
|
11290
|
+
seed: number().int()
|
|
11291
|
+
}),
|
|
11292
|
+
hyper: object({
|
|
11293
|
+
epochs: number().int().positive(),
|
|
11294
|
+
batch: number().int().positive(),
|
|
11295
|
+
lr0: number().positive(),
|
|
11296
|
+
/** Layers frozen from the start of the backbone; 0 = none. */
|
|
11297
|
+
freeze: number().int().nonnegative(),
|
|
11298
|
+
patience: number().int().nonnegative(),
|
|
11299
|
+
seed: number().int()
|
|
11300
|
+
}),
|
|
11301
|
+
replay: object({
|
|
11302
|
+
source: literal("coco2017"),
|
|
11303
|
+
count: number().int().nonnegative()
|
|
11304
|
+
}),
|
|
11305
|
+
exports: array(TrainingExportSchema).min(1),
|
|
11306
|
+
calibration: object({ maxFrames: number().int().positive() }),
|
|
11307
|
+
floors: object({
|
|
11308
|
+
minSupport: number().int().positive(),
|
|
11309
|
+
clamp: number().min(0).max(1)
|
|
11310
|
+
}),
|
|
11311
|
+
int8Gate: object({ maxMap50Drop: number().min(0).max(1) }),
|
|
11312
|
+
catalog: object({
|
|
11313
|
+
id: string().regex(/^[a-z0-9][a-z0-9-]{2,80}$/),
|
|
11314
|
+
name: string().min(1).max(160)
|
|
11315
|
+
})
|
|
11316
|
+
});
|
|
11317
|
+
/** One regular file of the bundle. An mlpackage contributes one row per member. */
|
|
11318
|
+
var TrainingResultFileSchema = object({
|
|
11319
|
+
path: string().min(1),
|
|
11320
|
+
bytes: number().int().nonnegative(),
|
|
11321
|
+
sha256: string().regex(/^[0-9a-f]{64}$/),
|
|
11322
|
+
format: _enum([
|
|
11323
|
+
"onnx",
|
|
11324
|
+
"openvino",
|
|
11325
|
+
"coreml",
|
|
11326
|
+
"pt"
|
|
11327
|
+
]),
|
|
11328
|
+
variant: _enum(["base", "int8"])
|
|
11329
|
+
});
|
|
11330
|
+
var DraftFormatSchema = object({
|
|
11331
|
+
/** RELATIVE path inside the bundle; the hub rewrites it to `camstack-local://`. */
|
|
11332
|
+
url: string().min(1),
|
|
11333
|
+
sizeMB: number().nonnegative(),
|
|
11334
|
+
isDirectory: boolean().optional(),
|
|
11335
|
+
files: array(string()).optional(),
|
|
11336
|
+
runtimes: array(literal("python")).optional(),
|
|
11337
|
+
revision: string().min(1)
|
|
11338
|
+
});
|
|
11339
|
+
/** The trainer's half of a catalog entry; the hub completes it (labels, licence, group). */
|
|
11340
|
+
var TrainingCatalogDraftSchema = object({
|
|
11341
|
+
id: string().min(1),
|
|
11342
|
+
name: string().min(1),
|
|
11343
|
+
description: string(),
|
|
11344
|
+
labels: array(unknown()),
|
|
11345
|
+
inputSize: object({
|
|
11346
|
+
width: number().int().positive(),
|
|
11347
|
+
height: number().int().positive()
|
|
11348
|
+
}),
|
|
11349
|
+
preprocessMode: literal("letterbox"),
|
|
11350
|
+
defaultClassFloors: FloorsSchema,
|
|
11351
|
+
formats: object({
|
|
11352
|
+
onnx: DraftFormatSchema.optional(),
|
|
11353
|
+
openvino: DraftFormatSchema.optional(),
|
|
11354
|
+
coreml: DraftFormatSchema.optional()
|
|
11355
|
+
})
|
|
11356
|
+
});
|
|
11357
|
+
/** One class of one model's holdout report (the eval harness's summary). */
|
|
11358
|
+
var TrainingEvalClassSchema = object({
|
|
11359
|
+
positives: number().int(),
|
|
11360
|
+
floor: number().nullable(),
|
|
11361
|
+
tp: number().int(),
|
|
11362
|
+
fp: number().int(),
|
|
11363
|
+
fn: number().int(),
|
|
11364
|
+
precision: number().nullable(),
|
|
11365
|
+
recall: number().nullable(),
|
|
11366
|
+
ap50: number().nullable(),
|
|
11367
|
+
recallByCamera: record(string(), number().nullable()).optional(),
|
|
11368
|
+
recallByLight: record(string(), number().nullable()).optional(),
|
|
11369
|
+
fpByCamera: record(string(), number()).optional(),
|
|
11370
|
+
smallFound: number().int().optional(),
|
|
11371
|
+
smallTotal: number().int().optional()
|
|
11372
|
+
}).passthrough();
|
|
11373
|
+
var TrainingEvalReportSchema = object({
|
|
11374
|
+
frames: number().int(),
|
|
11375
|
+
classes: record(string(), TrainingEvalClassSchema)
|
|
11376
|
+
}).passthrough();
|
|
11377
|
+
/**
|
|
11378
|
+
* A succeeded result carries every block; a failed one carries the error and
|
|
11379
|
+
* whatever was known by then — the other blocks are ABSENT, not null. The
|
|
11380
|
+
* orchestrator checks the blocks it needs before it trusts a success.
|
|
11381
|
+
*/
|
|
11382
|
+
var TrainingResultSchema = object({
|
|
11383
|
+
schema: literal(TRAINING_RESULT_SCHEMA),
|
|
11384
|
+
jobKey: string(),
|
|
11385
|
+
status: _enum(["succeeded", "failed"]),
|
|
11386
|
+
error: object({
|
|
11387
|
+
stage: string(),
|
|
11388
|
+
code: string(),
|
|
11389
|
+
message: string()
|
|
11390
|
+
}).nullable(),
|
|
11391
|
+
trainer: object({
|
|
11392
|
+
version: string(),
|
|
11393
|
+
revision: string()
|
|
11394
|
+
}),
|
|
11395
|
+
toolchain: record(string(), string().nullable()),
|
|
11396
|
+
dataset: object({
|
|
11397
|
+
versionId: string(),
|
|
11398
|
+
annotationHash: string(),
|
|
11399
|
+
sha256: string(),
|
|
11400
|
+
frames: object({
|
|
11401
|
+
train: number().int(),
|
|
11402
|
+
val: number().int(),
|
|
11403
|
+
holdout: number().int()
|
|
11404
|
+
}),
|
|
11405
|
+
holdoutCameras: array(number().int()),
|
|
11406
|
+
replayImages: number().int()
|
|
11407
|
+
}).optional(),
|
|
11408
|
+
training: object({
|
|
11409
|
+
epochsRun: number().int(),
|
|
11410
|
+
bestEpoch: number().int(),
|
|
11411
|
+
bestMap50: number(),
|
|
11412
|
+
bestMap50_95: number(),
|
|
11413
|
+
seconds: number()
|
|
11414
|
+
}).optional(),
|
|
11415
|
+
evaluation: object({
|
|
11416
|
+
holdoutFrames: number().int(),
|
|
11417
|
+
baseline: TrainingEvalReportSchema.nullable(),
|
|
11418
|
+
candidate: TrainingEvalReportSchema.nullable(),
|
|
11419
|
+
candidateInt8: TrainingEvalReportSchema.nullable(),
|
|
11420
|
+
recallDeltaByCamera: record(string(), record(string(), number())).nullable(),
|
|
11421
|
+
map50: record(string(), number().nullable())
|
|
11422
|
+
}).optional(),
|
|
11423
|
+
floors: object({
|
|
11424
|
+
baseline: FloorsSchema,
|
|
11425
|
+
candidate: FloorsSchema,
|
|
11426
|
+
candidateInt8: FloorsSchema.nullable(),
|
|
11427
|
+
notes: array(string())
|
|
11428
|
+
}).optional(),
|
|
11429
|
+
int8: object({
|
|
11430
|
+
kept: boolean(),
|
|
11431
|
+
map50Fp16: number().nullable(),
|
|
11432
|
+
map50Int8: number().nullable(),
|
|
11433
|
+
reason: string().nullable()
|
|
11434
|
+
}).optional(),
|
|
11435
|
+
exportsDropped: array(object({
|
|
11436
|
+
export: string(),
|
|
11437
|
+
reason: string()
|
|
11438
|
+
})).optional(),
|
|
11439
|
+
files: array(TrainingResultFileSchema).optional(),
|
|
11440
|
+
bundle: object({
|
|
11441
|
+
path: literal("bundle.tar"),
|
|
11442
|
+
bytes: number().int().nonnegative(),
|
|
11443
|
+
sha256: string().regex(/^[0-9a-f]{64}$/)
|
|
11444
|
+
}).nullable().optional(),
|
|
11445
|
+
catalogDraft: object({
|
|
11446
|
+
base: TrainingCatalogDraftSchema,
|
|
11447
|
+
int8: TrainingCatalogDraftSchema.nullable()
|
|
11448
|
+
}).nullable().optional(),
|
|
11449
|
+
licence: string()
|
|
11450
|
+
});
|
|
11451
|
+
var TrainingStageSchema = _enum([
|
|
11452
|
+
"prepare",
|
|
11453
|
+
"replay",
|
|
11454
|
+
"train",
|
|
11455
|
+
"eval",
|
|
11456
|
+
"export",
|
|
11457
|
+
"package"
|
|
11458
|
+
]);
|
|
11459
|
+
var EventBase = {
|
|
11460
|
+
v: literal(1),
|
|
11461
|
+
ts: number()
|
|
11462
|
+
};
|
|
11463
|
+
discriminatedUnion("type", [
|
|
11464
|
+
object({
|
|
11465
|
+
...EventBase,
|
|
11466
|
+
type: literal("stage"),
|
|
11467
|
+
stage: TrainingStageSchema
|
|
11468
|
+
}),
|
|
11469
|
+
object({
|
|
11470
|
+
...EventBase,
|
|
11471
|
+
type: literal("epoch"),
|
|
11472
|
+
epoch: number().int(),
|
|
11473
|
+
epochs: number().int(),
|
|
11474
|
+
boxLoss: number().nullable().optional(),
|
|
11475
|
+
map50: number().nullable().optional(),
|
|
11476
|
+
map50_95: number().nullable().optional(),
|
|
11477
|
+
etaSec: number().nullable().optional()
|
|
11478
|
+
}),
|
|
11479
|
+
object({
|
|
11480
|
+
...EventBase,
|
|
11481
|
+
type: literal("metric"),
|
|
11482
|
+
name: string(),
|
|
11483
|
+
value: number()
|
|
11484
|
+
}),
|
|
11485
|
+
object({
|
|
11486
|
+
...EventBase,
|
|
11487
|
+
type: literal("artifact"),
|
|
11488
|
+
path: string(),
|
|
11489
|
+
bytes: number(),
|
|
11490
|
+
sha256: string()
|
|
11491
|
+
}),
|
|
11492
|
+
object({
|
|
11493
|
+
...EventBase,
|
|
11494
|
+
type: literal("done"),
|
|
11495
|
+
status: _enum(["succeeded", "failed"]),
|
|
11496
|
+
resultSha256: string().nullable().optional()
|
|
11497
|
+
}),
|
|
11498
|
+
object({
|
|
11499
|
+
...EventBase,
|
|
11500
|
+
type: literal("error"),
|
|
11501
|
+
stage: string(),
|
|
11502
|
+
code: string(),
|
|
11503
|
+
message: string()
|
|
11504
|
+
})
|
|
11505
|
+
]);
|
|
11506
|
+
/**
|
|
10812
11507
|
* What the gate decided about a birth, from the CALLER's point of view.
|
|
10813
11508
|
*
|
|
10814
11509
|
* Deliberately not `ConfirmationVerdict`: `undecided` is not a birth decision
|
|
@@ -14123,7 +14818,9 @@ var AddonHttpRouteSchema = object({
|
|
|
14123
14818
|
"authenticated",
|
|
14124
14819
|
"admin"
|
|
14125
14820
|
]).optional(),
|
|
14126
|
-
description: string().optional()
|
|
14821
|
+
description: string().optional(),
|
|
14822
|
+
/** The hub limits this route per client address before the handler runs. */
|
|
14823
|
+
rateLimit: _enum(["auth"]).optional()
|
|
14127
14824
|
});
|
|
14128
14825
|
/**
|
|
14129
14826
|
* Cross-process route invocation envelope. The hub captures the
|
|
@@ -14946,6 +15643,37 @@ var BackupDestinationInfoSchema = object({
|
|
|
14946
15643
|
lastError: string().optional()
|
|
14947
15644
|
});
|
|
14948
15645
|
/**
|
|
15646
|
+
* How an archive is encrypted (operator decision 2026-10-09): to a backup
|
|
15647
|
+
* PUBLIC key the hub holds, so only the operator's secret key opens it.
|
|
15648
|
+
* Absent on a plain `.tar.gz` — every archive made before encryption, or
|
|
15649
|
+
* with it off — which restores without a key.
|
|
15650
|
+
*/
|
|
15651
|
+
var BackupArchiveEncryptionSchema = object({
|
|
15652
|
+
/** `x25519-hkdf-aes256gcm-stream-v1`. */
|
|
15653
|
+
scheme: string(),
|
|
15654
|
+
/** 16 hex — the backup key whose secret restores this archive. */
|
|
15655
|
+
keyId: string()
|
|
15656
|
+
});
|
|
15657
|
+
/**
|
|
15658
|
+
* The backup encryption setting. The hub keeps PUBLIC keys only: the active
|
|
15659
|
+
* one new archives are encrypted to, and the retired ones older archives
|
|
15660
|
+
* still need. The secret key is shown once, at `setupEncryption`.
|
|
15661
|
+
*/
|
|
15662
|
+
var BackupEncryptionStatusSchema = object({
|
|
15663
|
+
enabled: boolean(),
|
|
15664
|
+
active: object({
|
|
15665
|
+
keyId: string(),
|
|
15666
|
+
publicKey: string(),
|
|
15667
|
+
createdAt: number()
|
|
15668
|
+
}).nullable(),
|
|
15669
|
+
/** Every key ever set up, newest first. */
|
|
15670
|
+
keys: array(object({
|
|
15671
|
+
keyId: string(),
|
|
15672
|
+
createdAt: number(),
|
|
15673
|
+
retiredAt: number().nullable()
|
|
15674
|
+
})).readonly()
|
|
15675
|
+
});
|
|
15676
|
+
/**
|
|
14949
15677
|
* Per-archive entry returned by `backup.listArchives({ destinationId })`.
|
|
14950
15678
|
* Same shape the destination drill-in renders. Sourced from the per-
|
|
14951
15679
|
* location `manifests.json` (no per-archive tarball read required).
|
|
@@ -14957,7 +15685,9 @@ var BackupArchiveEntrySchema = object({
|
|
|
14957
15685
|
sizeBytes: number(),
|
|
14958
15686
|
label: string().optional(),
|
|
14959
15687
|
/** Top-level locations included in the archive (db, addons, tls, …). */
|
|
14960
|
-
locations: array(string()).readonly()
|
|
15688
|
+
locations: array(string()).readonly(),
|
|
15689
|
+
/** Present when the archive is encrypted; restore then needs that key. */
|
|
15690
|
+
encryption: BackupArchiveEncryptionSchema.optional()
|
|
14961
15691
|
});
|
|
14962
15692
|
var BackupEntrySchema = object({
|
|
14963
15693
|
id: string(),
|
|
@@ -14966,7 +15696,8 @@ var BackupEntrySchema = object({
|
|
|
14966
15696
|
label: string().optional(),
|
|
14967
15697
|
createdAt: number(),
|
|
14968
15698
|
sizeBytes: number(),
|
|
14969
|
-
locations: array(string()).optional()
|
|
15699
|
+
locations: array(string()).optional(),
|
|
15700
|
+
encryption: BackupArchiveEncryptionSchema.optional()
|
|
14970
15701
|
});
|
|
14971
15702
|
var ArchiveEntrySchema = object({
|
|
14972
15703
|
path: string(),
|
|
@@ -15155,10 +15886,40 @@ method(_void(), array(BackupDestinationInfoSchema).readonly(), { auth: "admin" }
|
|
|
15155
15886
|
* this list and skips entries whose path doesn't start with
|
|
15156
15887
|
* any of them.
|
|
15157
15888
|
*/
|
|
15158
|
-
locations: array(string()).optional()
|
|
15889
|
+
locations: array(string()).optional(),
|
|
15890
|
+
/**
|
|
15891
|
+
* The backup SECRET key, for an encrypted archive (ignored for a plain
|
|
15892
|
+
* one). The archive is decrypted into the hub's private staging
|
|
15893
|
+
* before the restart; the key is not stored. A wrong or missing key
|
|
15894
|
+
* is refused before the archive is downloaded.
|
|
15895
|
+
*/
|
|
15896
|
+
backupSecretKey: string().optional()
|
|
15159
15897
|
}), _void(), {
|
|
15160
15898
|
kind: "mutation",
|
|
15161
15899
|
auth: "admin"
|
|
15900
|
+
}), method(_void(), BackupEncryptionStatusSchema, { auth: "admin" }), method(object({}), object({
|
|
15901
|
+
keyId: string(),
|
|
15902
|
+
secretKey: string(),
|
|
15903
|
+
publicKey: string(),
|
|
15904
|
+
createdAt: number(),
|
|
15905
|
+
replacedKeyId: string().nullable()
|
|
15906
|
+
}), {
|
|
15907
|
+
kind: "mutation",
|
|
15908
|
+
auth: "admin"
|
|
15909
|
+
}), method(object({}), object({ disabledKeyId: string().nullable() }), {
|
|
15910
|
+
kind: "mutation",
|
|
15911
|
+
auth: "admin"
|
|
15912
|
+
}), method(object({ backupSecretKey: string() }), object({
|
|
15913
|
+
valid: boolean(),
|
|
15914
|
+
keyId: string().nullable(),
|
|
15915
|
+
/** The hub knows this key (active or retired). */
|
|
15916
|
+
known: boolean(),
|
|
15917
|
+
/** It is the key new archives are encrypted to. */
|
|
15918
|
+
active: boolean(),
|
|
15919
|
+
error: string().optional()
|
|
15920
|
+
}), {
|
|
15921
|
+
kind: "mutation",
|
|
15922
|
+
auth: "admin"
|
|
15162
15923
|
}), method(object({
|
|
15163
15924
|
destinationId: string(),
|
|
15164
15925
|
backupId: string()
|
|
@@ -17114,7 +17875,60 @@ var CustomModelDescriptorSchema = object({
|
|
|
17114
17875
|
stepId: string(),
|
|
17115
17876
|
entry: ModelCatalogEntrySchema
|
|
17116
17877
|
});
|
|
17117
|
-
|
|
17878
|
+
/** One regular file of an imported bundle, as the producer measured it. */
|
|
17879
|
+
var ModelBundleFileSchema = object({
|
|
17880
|
+
/** Relative path inside the bundle tar; an mlpackage member is `<x>.mlpackage/<member>`. */
|
|
17881
|
+
path: string().min(1),
|
|
17882
|
+
bytes: number().int().nonnegative(),
|
|
17883
|
+
sha256: string().regex(/^[0-9a-f]{64}$/)
|
|
17884
|
+
});
|
|
17885
|
+
var ImportModelBundleInputSchema = object({
|
|
17886
|
+
/** The registry provider that keeps the model (Model Studio). */
|
|
17887
|
+
addonId: string(),
|
|
17888
|
+
stepId: string().min(1),
|
|
17889
|
+
/**
|
|
17890
|
+
* The catalog rows to register, complete, every format URL already
|
|
17891
|
+
* `camstack-local://<modelId>/<file>` naming a file of the bundle. One
|
|
17892
|
+
* bundle may carry several rows (a base and its INT8 variant).
|
|
17893
|
+
*/
|
|
17894
|
+
entries: array(ModelCatalogEntrySchema).min(1).max(4),
|
|
17895
|
+
/** The bundle tar, offered by the producer over `ctx.peerBytes` (same host). */
|
|
17896
|
+
bundle: object({
|
|
17897
|
+
ticket: PeerBytesTicketSchema,
|
|
17898
|
+
bytes: number().int().positive(),
|
|
17899
|
+
sha256: string().regex(/^[0-9a-f]{64}$/)
|
|
17900
|
+
}),
|
|
17901
|
+
/** Every file the tar must hold; anything missing, extra or different is refused. */
|
|
17902
|
+
files: array(ModelBundleFileSchema).min(1).max(64),
|
|
17903
|
+
/** Convert missing engine formats and push the model to every agent afterwards. */
|
|
17904
|
+
distribute: boolean()
|
|
17905
|
+
});
|
|
17906
|
+
var ImportModelBundleResultSchema = discriminatedUnion("kind", [object({
|
|
17907
|
+
kind: literal("imported"),
|
|
17908
|
+
modelIds: array(string()).readonly(),
|
|
17909
|
+
distributed: array(object({
|
|
17910
|
+
modelId: string(),
|
|
17911
|
+
nodeId: string(),
|
|
17912
|
+
format: _enum(MODEL_FORMATS),
|
|
17913
|
+
ok: boolean(),
|
|
17914
|
+
error: string().optional()
|
|
17915
|
+
})).readonly()
|
|
17916
|
+
}), object({
|
|
17917
|
+
kind: literal("refused"),
|
|
17918
|
+
reason: _enum([
|
|
17919
|
+
"transfer-failed",
|
|
17920
|
+
"checksum-mismatch",
|
|
17921
|
+
"bundle-mismatch",
|
|
17922
|
+
"invalid-entry",
|
|
17923
|
+
"id-taken"
|
|
17924
|
+
]),
|
|
17925
|
+
detail: string()
|
|
17926
|
+
})]);
|
|
17927
|
+
method(_void(), array(CustomModelDescriptorSchema).readonly(), { auth: "admin" }), method(ImportModelBundleInputSchema, ImportModelBundleResultSchema, {
|
|
17928
|
+
kind: "mutation",
|
|
17929
|
+
auth: "admin",
|
|
17930
|
+
timeoutMs: 30 * 6e4
|
|
17931
|
+
});
|
|
17118
17932
|
/**
|
|
17119
17933
|
* Query filter for settings-store collections.
|
|
17120
17934
|
*/
|
|
@@ -17593,6 +18407,35 @@ var KeychainKeySourceSchema = object({
|
|
|
17593
18407
|
*/
|
|
17594
18408
|
sharesBackupWithDatabase: boolean()
|
|
17595
18409
|
});
|
|
18410
|
+
/**
|
|
18411
|
+
* One keychain reset, as the Secrets page reports it until the operator
|
|
18412
|
+
* acknowledges it. Never a value: refs, counts and table names only.
|
|
18413
|
+
*/
|
|
18414
|
+
var KeychainResetRecordSchema = object({
|
|
18415
|
+
id: string(),
|
|
18416
|
+
at: number(),
|
|
18417
|
+
/** `user:<id>` or {@link KEYCHAIN_RESET_TRIGGER_ACTOR}. */
|
|
18418
|
+
actor: string(),
|
|
18419
|
+
/** Why the keychain was locked when it was reset; `null` when it was not locked. */
|
|
18420
|
+
lockedReason: string().nullable(),
|
|
18421
|
+
/** Values moved into the archive table (ciphertext under the lost key). */
|
|
18422
|
+
archived: number().int(),
|
|
18423
|
+
/** `keychain:secrets-orphaned-<ts>`, or `null` when nothing was stored. */
|
|
18424
|
+
archivedCollection: string().nullable(),
|
|
18425
|
+
/**
|
|
18426
|
+
* `keychain:keys-orphaned-<ts>`: the wrapped data keys of the archive, kept
|
|
18427
|
+
* so the archive can still be opened if the lost master key turns up.
|
|
18428
|
+
*/
|
|
18429
|
+
archivedKeysCollection: string().nullable(),
|
|
18430
|
+
/**
|
|
18431
|
+
* `system-settings` keys whose marker the reset cleared — the cluster
|
|
18432
|
+
* secret's: a marker left pointing at an archived value would refuse every
|
|
18433
|
+
* agent forever (D797).
|
|
18434
|
+
*/
|
|
18435
|
+
clearedSettingsKeys: array(string()).readonly(),
|
|
18436
|
+
/** When an operator dismissed the notice on the Secrets page; `null` until then. */
|
|
18437
|
+
acknowledgedAt: number().nullable()
|
|
18438
|
+
});
|
|
17596
18439
|
var KeychainStatusSchema = object({
|
|
17597
18440
|
keychain: KeychainStateSchema,
|
|
17598
18441
|
/** The source of the master key in use; `null` while locked. */
|
|
@@ -17610,7 +18453,9 @@ var KeychainStatusSchema = object({
|
|
|
17610
18453
|
/** Wrapped copies of the data key under a previous master key, kept until purged. */
|
|
17611
18454
|
retiredWraps: number().int(),
|
|
17612
18455
|
recoveryKeyDownloadedAt: number().nullable(),
|
|
17613
|
-
secretCount: number().int()
|
|
18456
|
+
secretCount: number().int(),
|
|
18457
|
+
/** The most recent reset, acknowledged or not; `null` when the keychain was never reset. */
|
|
18458
|
+
lastReset: KeychainResetRecordSchema.nullable()
|
|
17614
18459
|
});
|
|
17615
18460
|
/**
|
|
17616
18461
|
* Whether a stored value is still pointed at by its owner's settings.
|
|
@@ -17632,17 +18477,26 @@ var KeychainAuditActionSchema = _enum([
|
|
|
17632
18477
|
"download-recovery-key",
|
|
17633
18478
|
"delete-orphans",
|
|
17634
18479
|
"reset",
|
|
18480
|
+
"acknowledge-reset",
|
|
17635
18481
|
"initialize"
|
|
17636
18482
|
]);
|
|
17637
18483
|
var KeychainAuditEntrySchema = object({
|
|
17638
18484
|
id: string(),
|
|
17639
18485
|
at: number(),
|
|
17640
18486
|
action: KeychainAuditActionSchema,
|
|
17641
|
-
/** `addon:<id>` | `user:<id>` | `system`. */
|
|
18487
|
+
/** `addon:<id>` | `user:<id>` | `system` | `trigger-file`. */
|
|
17642
18488
|
actor: string(),
|
|
17643
18489
|
ref: string().nullable(),
|
|
17644
18490
|
detail: string().nullable()
|
|
17645
18491
|
});
|
|
18492
|
+
var KEYCHAIN_RESET_CONFIRMATION = "RESET KEYCHAIN";
|
|
18493
|
+
/**
|
|
18494
|
+
* Secrets the HUB itself holds (owner `system`) that no settings form shows:
|
|
18495
|
+
* `jwt-signing-key` — the session signing key (D797). It is always "in use",
|
|
18496
|
+
* never an orphan; it is generated on a fresh hub and replaced only through
|
|
18497
|
+
* {@link keychainAdminCapability.methods.setSystemSecret}.
|
|
18498
|
+
*/
|
|
18499
|
+
var SystemHeldSecretNameSchema = _enum(["jwt-signing-key"]);
|
|
17646
18500
|
method(object({}), KeychainStatusSchema, { auth: "admin" }), method(object({}), array(KeychainAdminSecretSchema).readonly(), { auth: "admin" }), method(object({ limit: number().int().min(1).max(500).optional() }), array(KeychainAuditEntrySchema).readonly(), { auth: "admin" }), method(object({ ref: string().min(1) }), object({
|
|
17647
18501
|
value: string(),
|
|
17648
18502
|
version: number().int()
|
|
@@ -17650,6 +18504,16 @@ method(object({}), KeychainStatusSchema, { auth: "admin" }), method(object({}),
|
|
|
17650
18504
|
kind: "mutation",
|
|
17651
18505
|
auth: "admin",
|
|
17652
18506
|
caller: "required"
|
|
18507
|
+
}), method(object({
|
|
18508
|
+
name: SystemHeldSecretNameSchema,
|
|
18509
|
+
value: string().min(16)
|
|
18510
|
+
}), object({
|
|
18511
|
+
ref: string(),
|
|
18512
|
+
version: number().int()
|
|
18513
|
+
}), {
|
|
18514
|
+
kind: "mutation",
|
|
18515
|
+
auth: "admin",
|
|
18516
|
+
caller: "required"
|
|
17653
18517
|
}), method(object({ refs: array(string().min(1)).max(1e3) }), object({
|
|
17654
18518
|
deleted: array(string()).readonly(),
|
|
17655
18519
|
kept: array(object({
|
|
@@ -17679,13 +18543,20 @@ method(object({}), KeychainStatusSchema, { auth: "admin" }), method(object({}),
|
|
|
17679
18543
|
kind: "mutation",
|
|
17680
18544
|
auth: "admin",
|
|
17681
18545
|
caller: "required"
|
|
17682
|
-
}), method(object({ confirm: literal(
|
|
18546
|
+
}), method(object({ confirm: literal(KEYCHAIN_RESET_CONFIRMATION) }), object({
|
|
17683
18547
|
archivedCollection: string().nullable(),
|
|
17684
18548
|
archived: number().int()
|
|
17685
18549
|
}), {
|
|
17686
18550
|
kind: "mutation",
|
|
17687
18551
|
auth: "admin",
|
|
17688
18552
|
caller: "required"
|
|
18553
|
+
}), method(object({}), object({
|
|
18554
|
+
reset: KeychainResetRecordSchema.nullable(),
|
|
18555
|
+
pendingReentry: array(KeychainSecretMetaSchema).readonly()
|
|
18556
|
+
}), { auth: "admin" }), method(object({}), object({ acknowledged: boolean() }), {
|
|
18557
|
+
kind: "mutation",
|
|
18558
|
+
auth: "admin",
|
|
18559
|
+
caller: "required"
|
|
17689
18560
|
});
|
|
17690
18561
|
method(_void(), object({
|
|
17691
18562
|
id: string(),
|
|
@@ -20416,7 +21287,7 @@ method(LogEntrySchema, _void(), { kind: "mutation" }), method(object({
|
|
|
20416
21287
|
* `login-method` — collection cap through which auth addons contribute
|
|
20417
21288
|
* their pre-auth login surfaces to the login page. This is the SINGLE,
|
|
20418
21289
|
* generic mechanism that supersedes the dead `auth.listProviders` reader:
|
|
20419
|
-
* every auth addon (OIDC,
|
|
21290
|
+
* every auth addon (OIDC, WebAuthn/passkey) registers a
|
|
20420
21291
|
* `login-method` provider and the PUBLIC `auth.listLoginMethods`
|
|
20421
21292
|
* procedure aggregates them for the unauthenticated login page.
|
|
20422
21293
|
*
|
|
@@ -20424,8 +21295,7 @@ method(LogEntrySchema, _void(), { kind: "mutation" }), method(object({
|
|
|
20424
21295
|
*
|
|
20425
21296
|
* - `redirect` — a declarative button. The login page renders a generic
|
|
20426
21297
|
* button that navigates to `startUrl` (an addon-owned HTTP route).
|
|
20427
|
-
* Covers OIDC (`/addon/auth-oidc/<id>/start`)
|
|
20428
|
-
* ZERO shell-side JS. A future SSO addon plugs in the same way — the
|
|
21298
|
+
* Covers OIDC (`/addon/auth-oidc/<id>/start`) with ZERO shell-side JS. A future SSO addon plugs in the same way — the
|
|
20429
21299
|
* login page needs NO change.
|
|
20430
21300
|
*
|
|
20431
21301
|
* - `widget` — a Module-Federation widget the login page mounts (via
|
|
@@ -20444,8 +21314,8 @@ method(LogEntrySchema, _void(), { kind: "mutation" }), method(object({
|
|
|
20444
21314
|
* decision.
|
|
20445
21315
|
*
|
|
20446
21316
|
* Every contribution carries a `stage`:
|
|
20447
|
-
* - `primary` — shown on the first credentials screen (OIDC
|
|
20448
|
-
*
|
|
21317
|
+
* - `primary` — shown on the first credentials screen (OIDC
|
|
21318
|
+
* buttons; a usernameless passkey).
|
|
20449
21319
|
* - `second-factor` — shown AFTER the password leg, gated on the
|
|
20450
21320
|
* returned `factors` (passkey-as-2FA today).
|
|
20451
21321
|
*
|
|
@@ -20472,7 +21342,7 @@ var LoginMethodContributionSchema = discriminatedUnion("kind", [
|
|
|
20472
21342
|
* The provider names an external identity a signed-in user can link to
|
|
20473
21343
|
* their own account (D782): `auth.listLinkableProviders` /
|
|
20474
21344
|
* `beginExternalLink` offer exactly the redirect methods that set this,
|
|
20475
|
-
* whatever their id. Absent / false — a login button only
|
|
21345
|
+
* whatever their id. Absent / false — a login button only.
|
|
20476
21346
|
*/
|
|
20477
21347
|
linkable: boolean().optional()
|
|
20478
21348
|
}),
|
|
@@ -24632,8 +25502,7 @@ method(object({}), object({ rules: array(NcRuleSchema) }), { auth: "admin" }), m
|
|
|
24632
25502
|
* `super_admin` — collapsed onto the single boolean because every
|
|
24633
25503
|
* non-admin caller is governed by the same scope-check rules; the
|
|
24634
25504
|
* distinction was only ever used to route role-specific procedures
|
|
24635
|
-
* which we no longer have.
|
|
24636
|
-
* `createServiceToken`; CLI / webhook integrations are `cst_*` tokens
|
|
25505
|
+
* which we no longer have. CLI / webhook integrations are `cst_*` tokens
|
|
24637
25506
|
* with `isAdmin: false` + an explicit scope list.
|
|
24638
25507
|
*/
|
|
24639
25508
|
/** Per-method access flavour. Materialised on every cap method via codegen. */
|
|
@@ -26355,6 +27224,9 @@ var RetrainExportFilterSchema = object({
|
|
|
26355
27224
|
frameIds: array(string()).max(2e4).optional(),
|
|
26356
27225
|
/** Only frames in at least one of these named collections. */
|
|
26357
27226
|
collectionIds: array(string()).max(200).optional(),
|
|
27227
|
+
/** Exactly the frames of this dataset version (and its completeOnly). An
|
|
27228
|
+
* unknown id selects nothing. */
|
|
27229
|
+
datasetVersionId: string().optional(),
|
|
26358
27230
|
batchId: string().optional(),
|
|
26359
27231
|
/** Only frames the operator marked complete (all subjects boxed). */
|
|
26360
27232
|
completeOnly: boolean().optional()
|
|
@@ -26522,6 +27394,67 @@ var RetrainLlmAssistResultSchema = discriminatedUnion("kind", [object({
|
|
|
26522
27394
|
]),
|
|
26523
27395
|
detail: string().optional()
|
|
26524
27396
|
})]);
|
|
27397
|
+
/** What a dataset version is cut from. Every field narrows. */
|
|
27398
|
+
var RetrainDatasetSelectionSchema = object({
|
|
27399
|
+
deviceIds: array(number()).readonly().optional(),
|
|
27400
|
+
collectionIds: array(string()).max(200).readonly().optional(),
|
|
27401
|
+
frameIds: array(string()).max(2e4).readonly().optional()
|
|
27402
|
+
});
|
|
27403
|
+
/** The counts a dataset is judged by. */
|
|
27404
|
+
var RetrainDatasetStatsSchema = object({
|
|
27405
|
+
frames: number().int(),
|
|
27406
|
+
completeFrames: number().int(),
|
|
27407
|
+
/** `completeFrames / frames`, 0..1. */
|
|
27408
|
+
completeness: number(),
|
|
27409
|
+
/** Boxes to learn (model errors excluded). */
|
|
27410
|
+
subjects: number().int(),
|
|
27411
|
+
modelErrors: number().int(),
|
|
27412
|
+
/** Complete frames with no subject. */
|
|
27413
|
+
hardNegatives: number().int(),
|
|
27414
|
+
/** Subjects per class × camera × day/night. */
|
|
27415
|
+
cells: array(object({
|
|
27416
|
+
macroClass: string(),
|
|
27417
|
+
deviceId: number(),
|
|
27418
|
+
lighting: _enum([
|
|
27419
|
+
"day",
|
|
27420
|
+
"night",
|
|
27421
|
+
"unknown"
|
|
27422
|
+
]),
|
|
27423
|
+
subjects: number().int(),
|
|
27424
|
+
frames: number().int()
|
|
27425
|
+
})).readonly(),
|
|
27426
|
+
cameras: array(object({
|
|
27427
|
+
deviceId: number(),
|
|
27428
|
+
frames: number().int(),
|
|
27429
|
+
completeFrames: number().int()
|
|
27430
|
+
})).readonly()
|
|
27431
|
+
});
|
|
27432
|
+
/** An immutable dataset version, without its frame list. */
|
|
27433
|
+
var RetrainDatasetVersionSchema = object({
|
|
27434
|
+
id: string(),
|
|
27435
|
+
name: string(),
|
|
27436
|
+
createdAt: number(),
|
|
27437
|
+
selection: RetrainDatasetSelectionSchema,
|
|
27438
|
+
layout: RetrainExportLayoutSchema,
|
|
27439
|
+
completeOnly: boolean(),
|
|
27440
|
+
frameCount: number().int(),
|
|
27441
|
+
/** sha256 of what the frames taught when the version was frozen. */
|
|
27442
|
+
annotationHash: string(),
|
|
27443
|
+
/** The export manifest schema the version was cut under. */
|
|
27444
|
+
manifestSchema: string(),
|
|
27445
|
+
stats: RetrainDatasetStatsSchema
|
|
27446
|
+
});
|
|
27447
|
+
var CreateRetrainDatasetVersionResultSchema = discriminatedUnion("kind", [object({
|
|
27448
|
+
kind: literal("created"),
|
|
27449
|
+
version: RetrainDatasetVersionSchema
|
|
27450
|
+
}), object({
|
|
27451
|
+
kind: literal("refused"),
|
|
27452
|
+
reason: _enum([
|
|
27453
|
+
"empty-name",
|
|
27454
|
+
"duplicate-name",
|
|
27455
|
+
"no-frames"
|
|
27456
|
+
])
|
|
27457
|
+
})]);
|
|
26525
27458
|
/** The outcome of a lifecycle move owned by the retrain page. */
|
|
26526
27459
|
var RetrainTransitionResultSchema = object({
|
|
26527
27460
|
trackId: string(),
|
|
@@ -27311,6 +28244,47 @@ DeviceType.Camera, method(object({ deviceId: number() }), array(TrackSchema).rea
|
|
|
27311
28244
|
kind: "mutation",
|
|
27312
28245
|
auth: "admin",
|
|
27313
28246
|
timeoutMs: 60 * 6e4
|
|
28247
|
+
}), method(object({
|
|
28248
|
+
filter: RetrainExportFilterSchema,
|
|
28249
|
+
layout: RetrainExportLayoutSchema
|
|
28250
|
+
}), object({
|
|
28251
|
+
ticket: PeerBytesTicketSchema,
|
|
28252
|
+
frames: number().int(),
|
|
28253
|
+
annotations: number().int()
|
|
28254
|
+
}), {
|
|
28255
|
+
kind: "mutation",
|
|
28256
|
+
auth: "admin",
|
|
28257
|
+
timeoutMs: 12e4
|
|
28258
|
+
}), method(object({
|
|
28259
|
+
selection: RetrainDatasetSelectionSchema,
|
|
28260
|
+
completeOnly: boolean().optional()
|
|
28261
|
+
}), RetrainDatasetStatsSchema, {
|
|
28262
|
+
kind: "query",
|
|
28263
|
+
auth: "admin"
|
|
28264
|
+
}), method(object({
|
|
28265
|
+
name: string().max(120),
|
|
28266
|
+
selection: RetrainDatasetSelectionSchema,
|
|
28267
|
+
layout: RetrainExportLayoutSchema,
|
|
28268
|
+
completeOnly: boolean()
|
|
28269
|
+
}), CreateRetrainDatasetVersionResultSchema, {
|
|
28270
|
+
kind: "mutation",
|
|
28271
|
+
auth: "admin",
|
|
28272
|
+
timeoutMs: 12e4
|
|
28273
|
+
}), method(object({}), array(RetrainDatasetVersionSchema).readonly(), {
|
|
28274
|
+
kind: "query",
|
|
28275
|
+
auth: "admin"
|
|
28276
|
+
}), method(object({ id: string() }), object({ deleted: boolean() }), {
|
|
28277
|
+
kind: "mutation",
|
|
28278
|
+
auth: "admin"
|
|
28279
|
+
}), method(object({ id: string() }), object({
|
|
28280
|
+
found: boolean(),
|
|
28281
|
+
annotationHash: string(),
|
|
28282
|
+
matches: boolean(),
|
|
28283
|
+
missingFrames: number().int()
|
|
28284
|
+
}), {
|
|
28285
|
+
kind: "query",
|
|
28286
|
+
auth: "admin",
|
|
28287
|
+
timeoutMs: 12e4
|
|
27314
28288
|
}), method(object({}), array(RetrainAssistProfileSchema).readonly(), {
|
|
27315
28289
|
kind: "query",
|
|
27316
28290
|
auth: "admin"
|
|
@@ -31257,8 +32231,8 @@ version: string().optional() }), ServerUpdateActionResultSchema, {
|
|
|
31257
32231
|
* `smtp-provider` — pluggable email delivery surface.
|
|
31258
32232
|
*
|
|
31259
32233
|
* Collection cap: a deployment may install multiple SMTP relays (e.g.
|
|
31260
|
-
* one for transactional / one for notifications). Consumers (
|
|
31261
|
-
*
|
|
32234
|
+
* one for transactional / one for notifications). Consumers (notifier
|
|
32235
|
+
* addons, …) walk the collection and pick the first
|
|
31262
32236
|
* ready provider OR target a specific addonId.
|
|
31263
32237
|
*
|
|
31264
32238
|
* The shape stays small on purpose — `sendEmail` is enough for the
|
|
@@ -31437,7 +32411,7 @@ targets: array(object({
|
|
|
31437
32411
|
})));
|
|
31438
32412
|
/**
|
|
31439
32413
|
* `sso-bridge` — internal hub-only cap that lets SSO-style auth
|
|
31440
|
-
* providers (OIDC, SAML,
|
|
32414
|
+
* providers (OIDC, SAML, …) mint an HMAC-signed token
|
|
31441
32415
|
* carrying the post-callback claims before redirecting back to
|
|
31442
32416
|
* `/api/auth/sso/finish`.
|
|
31443
32417
|
*
|
|
@@ -31500,7 +32474,14 @@ var SsoBridgeClaimsSchema = object({
|
|
|
31500
32474
|
* Verified `iss` of the id_token behind an OIDC login bridge (D782). A
|
|
31501
32475
|
* subject is unique only per issuer, so a link is bound to it.
|
|
31502
32476
|
*/
|
|
31503
|
-
issuer: string().optional()
|
|
32477
|
+
issuer: string().optional(),
|
|
32478
|
+
/**
|
|
32479
|
+
* SHA-256 (hex) of the `camstack_sso_state` cookie the IdP `/start` set in
|
|
32480
|
+
* the browser that began this sign-in. `/api/auth/sso/finish` requires the
|
|
32481
|
+
* request to present the matching cookie — a login bridge is useless in
|
|
32482
|
+
* any other browser.
|
|
32483
|
+
*/
|
|
32484
|
+
browserBinding: string().optional()
|
|
31504
32485
|
});
|
|
31505
32486
|
method(object({
|
|
31506
32487
|
claims: SsoBridgeClaimsSchema,
|
|
@@ -37888,7 +38869,13 @@ var TopologyNodeSchema = object({
|
|
|
37888
38869
|
})).readonly(),
|
|
37889
38870
|
processes: array(TopologyProcessSchema).readonly(),
|
|
37890
38871
|
categories: array(TopologyCategorySchema).readonly(),
|
|
37891
|
-
rootPackage: TopologyRootPackageSchema.nullable()
|
|
38872
|
+
rootPackage: TopologyRootPackageSchema.nullable(),
|
|
38873
|
+
/**
|
|
38874
|
+
* How an online AGENT reaches the hub (mesh mTLS Release A): `tls` once it has
|
|
38875
|
+
* completed a mutual-TLS handshake, `clear` otherwise. Absent for the hub,
|
|
38876
|
+
* for offline rows and when the hub cannot tell.
|
|
38877
|
+
*/
|
|
38878
|
+
meshTransport: _enum(["tls", "clear"]).optional()
|
|
37892
38879
|
});
|
|
37893
38880
|
var CapUsageEdgeSchema = object({
|
|
37894
38881
|
callerAddonId: string(),
|
|
@@ -42436,16 +43423,6 @@ var ApiKeySummarySchema = object({
|
|
|
42436
43423
|
createdAt: number(),
|
|
42437
43424
|
lastUsedAt: number().optional()
|
|
42438
43425
|
});
|
|
42439
|
-
var CreateApiKeyInputSchema = object({
|
|
42440
|
-
label: string(),
|
|
42441
|
-
isAdmin: boolean().default(false),
|
|
42442
|
-
allowedProviders: union([array(string()), literal("*")]).optional(),
|
|
42443
|
-
allowedDevices: record(string(), union([array(string()), literal("*")])).optional()
|
|
42444
|
-
});
|
|
42445
|
-
var CreateApiKeyResultSchema = object({
|
|
42446
|
-
token: string(),
|
|
42447
|
-
record: ApiKeySummarySchema
|
|
42448
|
-
});
|
|
42449
43426
|
var ScopedTokenSummarySchema = object({
|
|
42450
43427
|
id: string(),
|
|
42451
43428
|
userId: string(),
|
|
@@ -42544,17 +43521,10 @@ method(_void(), array(UserSummarySchema), { auth: "admin" }), method(CreateUserI
|
|
|
42544
43521
|
}), UserSummarySchema.extend({ passwordHash: string() }).nullable(), {
|
|
42545
43522
|
kind: "mutation",
|
|
42546
43523
|
access: "view"
|
|
42547
|
-
}), method(_void(), array(ApiKeySummarySchema), { auth: "admin" }), method(
|
|
42548
|
-
kind: "mutation",
|
|
42549
|
-
auth: "admin",
|
|
42550
|
-
access: "create"
|
|
42551
|
-
}), method(object({ id: string() }), object({ success: literal(true) }), {
|
|
43524
|
+
}), method(_void(), array(ApiKeySummarySchema), { auth: "admin" }), method(object({ id: string() }), object({ success: literal(true) }), {
|
|
42552
43525
|
kind: "mutation",
|
|
42553
43526
|
auth: "admin",
|
|
42554
43527
|
access: "delete"
|
|
42555
|
-
}), method(object({ token: string() }), ApiKeySummarySchema.nullable(), {
|
|
42556
|
-
kind: "mutation",
|
|
42557
|
-
access: "view"
|
|
42558
43528
|
}), method(CreateScopedTokenInputSchema, CreateScopedTokenResultSchema, {
|
|
42559
43529
|
kind: "mutation",
|
|
42560
43530
|
auth: "admin",
|
|
@@ -42628,15 +43598,7 @@ method(_void(), array(UserSummarySchema), { auth: "admin" }), method(CreateUserI
|
|
|
42628
43598
|
}).nullable(), { access: "view" }), method(object({ userId: string() }), array(ExternalIdentitySchema), { auth: "admin" }), method(ExternalIdentityKeySchema, object({
|
|
42629
43599
|
userId: string(),
|
|
42630
43600
|
issuer: string()
|
|
42631
|
-
}).nullable(), { auth: "admin" }), method(ExternalIdentityKeySchema.extend({
|
|
42632
|
-
userId: string(),
|
|
42633
|
-
issuer: string().min(1),
|
|
42634
|
-
label: string().optional()
|
|
42635
|
-
}), object({ success: literal(true) }), {
|
|
42636
|
-
kind: "mutation",
|
|
42637
|
-
auth: "admin",
|
|
42638
|
-
access: "create"
|
|
42639
|
-
}), method(ExternalIdentityKeySchema.extend({ userId: string() }), object({ success: boolean() }), {
|
|
43601
|
+
}).nullable(), { auth: "admin" }), method(ExternalIdentityKeySchema.extend({ userId: string() }), object({ success: boolean() }), {
|
|
42640
43602
|
kind: "mutation",
|
|
42641
43603
|
auth: "admin",
|
|
42642
43604
|
access: "delete"
|
|
@@ -43031,6 +43993,451 @@ DeviceType.Camera, method(object({
|
|
|
43031
43993
|
detection: array(ZoneRuleSchema).readonly(),
|
|
43032
43994
|
package: array(ZoneRuleSchema).readonly()
|
|
43033
43995
|
});
|
|
43996
|
+
/**
|
|
43997
|
+
* `training-provider` — ONE cloud that can run the CamStack trainer.
|
|
43998
|
+
*
|
|
43999
|
+
* A thin, mockable translation layer: it knows how to run a container with a
|
|
44000
|
+
* GPU, move a dataset in, read the job's stdout and hand artefacts back. It
|
|
44001
|
+
* knows nothing about datasets, splits, floors, cost policy or Model Studio —
|
|
44002
|
+
* those are the `training` orchestrator's (D805). Every rule written there
|
|
44003
|
+
* once is what makes a second provider (RunPod, a local NVIDIA node) a new
|
|
44004
|
+
* manifest entry and nothing else.
|
|
44005
|
+
*
|
|
44006
|
+
* Collection, routed by the `addonId` in every single-row input (the `llm` /
|
|
44007
|
+
* `notification-output` posture); `describe` concat-fans across providers.
|
|
44008
|
+
* Every method is `admin`: these spend money.
|
|
44009
|
+
*
|
|
44010
|
+
* Every cloud object a provider creates is tagged with the orchestrator's
|
|
44011
|
+
* `jobKey`, so a retried submit finds the job it already started instead of
|
|
44012
|
+
* starting a second GPU, and `listJobs` can find orphans.
|
|
44013
|
+
*
|
|
44014
|
+
* Bytes never ride a cap field: the dataset arrives as a `ctx.peerBytes`
|
|
44015
|
+
* ticket the producer (pipeline-analytics) minted, and artefacts leave as a
|
|
44016
|
+
* ticket the provider mints (D613).
|
|
44017
|
+
*/
|
|
44018
|
+
var TrainingGpuOptionSchema = object({
|
|
44019
|
+
id: string(),
|
|
44020
|
+
label: string(),
|
|
44021
|
+
/** List price, USD per GPU-hour, before any region multiplier. */
|
|
44022
|
+
usdPerHour: number().nonnegative(),
|
|
44023
|
+
vramGb: number().nonnegative()
|
|
44024
|
+
});
|
|
44025
|
+
var TrainingRegionOptionSchema = object({
|
|
44026
|
+
/** `''` = any region (the provider's choice). */
|
|
44027
|
+
id: string(),
|
|
44028
|
+
label: string(),
|
|
44029
|
+
priceMultiplier: number().positive()
|
|
44030
|
+
});
|
|
44031
|
+
/**
|
|
44032
|
+
* The provider's per-account settings, as the orchestrator reads them. They
|
|
44033
|
+
* live in the PROVIDER addon's settings (operator decision 2026-10-08: they
|
|
44034
|
+
* depend on the user's account), never hard-coded in the orchestrator.
|
|
44035
|
+
*/
|
|
44036
|
+
var TrainingProviderDefaultsSchema = object({
|
|
44037
|
+
gpuType: string(),
|
|
44038
|
+
region: string(),
|
|
44039
|
+
costCapUsd: number().nonnegative(),
|
|
44040
|
+
maxRuntimeSec: number().int().positive(),
|
|
44041
|
+
/** Hours a FAILED job's cloud dataset is kept for debugging; 0 = delete at once. */
|
|
44042
|
+
failedDatasetGraceHours: number().nonnegative()
|
|
44043
|
+
});
|
|
44044
|
+
var TrainingProviderDescriptorSchema = object({
|
|
44045
|
+
addonId: string(),
|
|
44046
|
+
/** `modal`, `runpod`, `fake`, … */
|
|
44047
|
+
kind: string(),
|
|
44048
|
+
label: string(),
|
|
44049
|
+
gpuTypes: array(TrainingGpuOptionSchema).readonly(),
|
|
44050
|
+
regions: array(TrainingRegionOptionSchema).readonly(),
|
|
44051
|
+
maxDatasetBytes: number().int().positive(),
|
|
44052
|
+
maxRuntimeSec: number().int().positive(),
|
|
44053
|
+
freeTierNote: string().optional(),
|
|
44054
|
+
/** Where the data goes, in one sentence the confirm dialog repeats. */
|
|
44055
|
+
dataResidencyNote: string(),
|
|
44056
|
+
/** Credentials are present — never the values. */
|
|
44057
|
+
configured: boolean(),
|
|
44058
|
+
defaults: TrainingProviderDefaultsSchema
|
|
44059
|
+
});
|
|
44060
|
+
var TrainingCredentialCheckSchema = object({
|
|
44061
|
+
ok: boolean(),
|
|
44062
|
+
/** Workspace / account name, when the provider says. */
|
|
44063
|
+
account: string().optional(),
|
|
44064
|
+
reason: _enum([
|
|
44065
|
+
"missing",
|
|
44066
|
+
"invalid",
|
|
44067
|
+
"forbidden",
|
|
44068
|
+
"network",
|
|
44069
|
+
"quota"
|
|
44070
|
+
]).optional(),
|
|
44071
|
+
detail: string().optional()
|
|
44072
|
+
});
|
|
44073
|
+
var ProviderJobStateSchema = _enum([
|
|
44074
|
+
"pending",
|
|
44075
|
+
"starting",
|
|
44076
|
+
"running",
|
|
44077
|
+
"succeeded",
|
|
44078
|
+
"failed",
|
|
44079
|
+
"cancelled",
|
|
44080
|
+
"lost"
|
|
44081
|
+
]);
|
|
44082
|
+
var ProviderJobStatusSchema = object({
|
|
44083
|
+
jobKey: string(),
|
|
44084
|
+
providerJobId: string().optional(),
|
|
44085
|
+
state: ProviderJobStateSchema,
|
|
44086
|
+
startedAt: number().optional(),
|
|
44087
|
+
endedAt: number().optional(),
|
|
44088
|
+
exitCode: number().int().optional(),
|
|
44089
|
+
failureReason: string().optional(),
|
|
44090
|
+
gpuType: string(),
|
|
44091
|
+
region: string().optional(),
|
|
44092
|
+
billedSeconds: number().nonnegative(),
|
|
44093
|
+
costUsd: number().nonnegative(),
|
|
44094
|
+
/** True when `costUsd` is runtime × list price, not a billing answer. */
|
|
44095
|
+
costIsEstimate: boolean(),
|
|
44096
|
+
lastFetchedAt: number()
|
|
44097
|
+
});
|
|
44098
|
+
/**
|
|
44099
|
+
* The trainer the job runs, by SOURCE revision: the provider turns it into an
|
|
44100
|
+
* image its own way (Modal builds the published Dockerfile at that revision;
|
|
44101
|
+
* a registry-pull provider maps it to a tag). Recorded on the job and echoed
|
|
44102
|
+
* in `result.json`.
|
|
44103
|
+
*/
|
|
44104
|
+
var TrainerSourceRefSchema = object({
|
|
44105
|
+
/** Hugging Face repo id, e.g. `camstack/camstack-trainer`. */
|
|
44106
|
+
repo: string().min(1),
|
|
44107
|
+
/** A commit sha (never a branch) — the job must be reproducible. */
|
|
44108
|
+
revision: string().regex(/^[0-9a-f]{7,64}$/)
|
|
44109
|
+
});
|
|
44110
|
+
var JobRef = {
|
|
44111
|
+
addonId: string(),
|
|
44112
|
+
jobKey: string().uuid()
|
|
44113
|
+
};
|
|
44114
|
+
var TrainingLogLineSchema = object({
|
|
44115
|
+
ts: number(),
|
|
44116
|
+
text: string()
|
|
44117
|
+
});
|
|
44118
|
+
method(object({}), array(TrainingProviderDescriptorSchema).readonly(), { auth: "admin" }), method(object({ addonId: string() }), TrainingCredentialCheckSchema, {
|
|
44119
|
+
kind: "mutation",
|
|
44120
|
+
auth: "admin",
|
|
44121
|
+
timeoutMs: 3e4
|
|
44122
|
+
}), method(object({
|
|
44123
|
+
addonId: string(),
|
|
44124
|
+
gpuType: string(),
|
|
44125
|
+
region: string(),
|
|
44126
|
+
datasetBytes: number().int().nonnegative(),
|
|
44127
|
+
gpuSecondsLow: number().nonnegative(),
|
|
44128
|
+
gpuSecondsHigh: number().nonnegative()
|
|
44129
|
+
}), object({
|
|
44130
|
+
usdLow: number().nonnegative(),
|
|
44131
|
+
usdHigh: number().nonnegative(),
|
|
44132
|
+
notes: array(string()).readonly()
|
|
44133
|
+
}), { auth: "admin" }), method(object({
|
|
44134
|
+
...JobRef,
|
|
44135
|
+
ticket: PeerBytesTicketSchema
|
|
44136
|
+
}), object({
|
|
44137
|
+
bytes: number().int().nonnegative(),
|
|
44138
|
+
sha256: string()
|
|
44139
|
+
}), {
|
|
44140
|
+
kind: "mutation",
|
|
44141
|
+
auth: "admin",
|
|
44142
|
+
timeoutMs: 120 * 6e4
|
|
44143
|
+
}), method(object({
|
|
44144
|
+
...JobRef,
|
|
44145
|
+
trainer: TrainerSourceRefSchema,
|
|
44146
|
+
jobSpecJson: string().min(2).max(64e3),
|
|
44147
|
+
gpuType: string(),
|
|
44148
|
+
region: string(),
|
|
44149
|
+
maxRuntimeSec: number().int().positive()
|
|
44150
|
+
}), ProviderJobStatusSchema, {
|
|
44151
|
+
kind: "mutation",
|
|
44152
|
+
auth: "admin",
|
|
44153
|
+
timeoutMs: 30 * 6e4
|
|
44154
|
+
}), method(object(JobRef), ProviderJobStatusSchema, {
|
|
44155
|
+
auth: "admin",
|
|
44156
|
+
timeoutMs: 6e4
|
|
44157
|
+
}), method(object({
|
|
44158
|
+
...JobRef,
|
|
44159
|
+
cursor: string().optional(),
|
|
44160
|
+
max: number().int().min(1).max(500)
|
|
44161
|
+
}), object({
|
|
44162
|
+
lines: array(TrainingLogLineSchema).readonly(),
|
|
44163
|
+
cursor: string()
|
|
44164
|
+
}), {
|
|
44165
|
+
auth: "admin",
|
|
44166
|
+
timeoutMs: 6e4
|
|
44167
|
+
}), method(object(JobRef), object({ ok: literal(true) }), {
|
|
44168
|
+
kind: "mutation",
|
|
44169
|
+
auth: "admin",
|
|
44170
|
+
timeoutMs: 6e4
|
|
44171
|
+
}), method(object(JobRef), object({
|
|
44172
|
+
found: boolean(),
|
|
44173
|
+
text: string().optional()
|
|
44174
|
+
}), {
|
|
44175
|
+
kind: "mutation",
|
|
44176
|
+
auth: "admin",
|
|
44177
|
+
timeoutMs: 5 * 6e4
|
|
44178
|
+
}), method(object({
|
|
44179
|
+
...JobRef,
|
|
44180
|
+
path: _enum(["bundle.tar"])
|
|
44181
|
+
}), object({ ticket: PeerBytesTicketSchema }), {
|
|
44182
|
+
kind: "mutation",
|
|
44183
|
+
auth: "admin",
|
|
44184
|
+
timeoutMs: 5 * 6e4
|
|
44185
|
+
}), method(object(JobRef), object({ deleted: array(string()).readonly() }), {
|
|
44186
|
+
kind: "mutation",
|
|
44187
|
+
auth: "admin",
|
|
44188
|
+
timeoutMs: 5 * 6e4
|
|
44189
|
+
}), method(object({ addonId: string() }), array(ProviderJobStatusSchema).readonly(), {
|
|
44190
|
+
auth: "admin",
|
|
44191
|
+
timeoutMs: 2 * 6e4
|
|
44192
|
+
});
|
|
44193
|
+
/**
|
|
44194
|
+
* `training` — the cloud-training orchestrator (D805). Hub-only singleton,
|
|
44195
|
+
* provided by `addon-training`.
|
|
44196
|
+
*
|
|
44197
|
+
* It owns what every provider must agree on, written once:
|
|
44198
|
+
*
|
|
44199
|
+
* - **Dataset versions.** Taken over from pipeline-analytics (D796): the rows
|
|
44200
|
+
* live here (D808); pipeline-analytics still CUTS a version (it owns the corpus and
|
|
44201
|
+
* the export plan) and reaches this store through the five row methods
|
|
44202
|
+
* below, so the Retrain page and the export did not change.
|
|
44203
|
+
* - **Jobs.** A persisted state machine, a reconcile loop against the
|
|
44204
|
+
* provider, a cost guard, a daily orphan sweep and the retention rules.
|
|
44205
|
+
* - **The return flow.** Verified artefacts → Model Studio
|
|
44206
|
+
* (`custom-model-registry.importModelBundle`) → canary on cameras →
|
|
44207
|
+
* rollback. Nothing is ever registered automatically.
|
|
44208
|
+
*
|
|
44209
|
+
* Every method is `admin`.
|
|
44210
|
+
*/
|
|
44211
|
+
/** A version WITH its frame list — what the export and a job read. */
|
|
44212
|
+
var TrainingDatasetVersionRowSchema = RetrainDatasetVersionSchema.omit({ frameCount: true }).extend({ frameIds: array(string()).max(2e4).readonly() });
|
|
44213
|
+
/** A base model a detector job can fine-tune, and the baseline it is judged against. */
|
|
44214
|
+
var TrainingBaseModelSchema = object({
|
|
44215
|
+
modelId: string(),
|
|
44216
|
+
label: string(),
|
|
44217
|
+
weights: string(),
|
|
44218
|
+
imgsz: number().int(),
|
|
44219
|
+
baselineOnnxUrl: string(),
|
|
44220
|
+
baselineFloors: record(string(), number()),
|
|
44221
|
+
/** The base the fleet runs most — the UI's default. */
|
|
44222
|
+
recommended: boolean()
|
|
44223
|
+
});
|
|
44224
|
+
var TrainingPresetSchema = _enum([
|
|
44225
|
+
"quick",
|
|
44226
|
+
"standard",
|
|
44227
|
+
"thorough"
|
|
44228
|
+
]);
|
|
44229
|
+
var TrainingJobRequestSchema = object({
|
|
44230
|
+
datasetVersionId: string().min(1),
|
|
44231
|
+
/** The `training-provider` addon that runs it. */
|
|
44232
|
+
addonId: string().min(1),
|
|
44233
|
+
gpuType: string().min(1),
|
|
44234
|
+
region: string(),
|
|
44235
|
+
baseModelId: string().min(1),
|
|
44236
|
+
preset: TrainingPresetSchema,
|
|
44237
|
+
/** Freeze the backbone's first N layers; `null` = the preset's choice. */
|
|
44238
|
+
freeze: number().int().nonnegative().nullable(),
|
|
44239
|
+
/** Cameras held out whole for evaluation; `null` = the orchestrator's default. */
|
|
44240
|
+
holdoutCameras: array(number().int()).nullable()
|
|
44241
|
+
});
|
|
44242
|
+
var TrainingSplitPlanSchema = object({
|
|
44243
|
+
holdoutCameras: array(number().int()).readonly(),
|
|
44244
|
+
/** Used when no camera is held out: the last N days of every camera. */
|
|
44245
|
+
holdoutLastDays: number().int().nonnegative(),
|
|
44246
|
+
/** Holdout subjects per class (camera holdout only; `null` = known only after the split). */
|
|
44247
|
+
holdoutSupport: record(string(), number().int()).nullable(),
|
|
44248
|
+
trainSubjects: number().int()
|
|
44249
|
+
});
|
|
44250
|
+
var TrainingRefusalReasonSchema = _enum([
|
|
44251
|
+
"unknown-dataset",
|
|
44252
|
+
"unknown-provider",
|
|
44253
|
+
"provider-not-configured",
|
|
44254
|
+
"unknown-base-model",
|
|
44255
|
+
"unknown-gpu",
|
|
44256
|
+
"dataset-too-large",
|
|
44257
|
+
"no-training-subjects",
|
|
44258
|
+
"job-already-running"
|
|
44259
|
+
]);
|
|
44260
|
+
var TrainingJobPlanSchema = object({
|
|
44261
|
+
refusal: object({
|
|
44262
|
+
reason: TrainingRefusalReasonSchema,
|
|
44263
|
+
detail: string()
|
|
44264
|
+
}).nullable(),
|
|
44265
|
+
warnings: array(string()).readonly(),
|
|
44266
|
+
split: TrainingSplitPlanSchema.nullable(),
|
|
44267
|
+
estimate: object({
|
|
44268
|
+
datasetBytes: number().int(),
|
|
44269
|
+
uploadMinutesAt20Mbps: number(),
|
|
44270
|
+
gpuSecondsLow: number(),
|
|
44271
|
+
gpuSecondsHigh: number(),
|
|
44272
|
+
usdLow: number(),
|
|
44273
|
+
usdHigh: number(),
|
|
44274
|
+
notes: array(string()).readonly()
|
|
44275
|
+
}).nullable(),
|
|
44276
|
+
/** Pre-filled from the provider's settings; the operator may lower or raise them. */
|
|
44277
|
+
defaults: object({
|
|
44278
|
+
maxCostUsd: number(),
|
|
44279
|
+
maxRuntimeSec: number().int()
|
|
44280
|
+
}).nullable(),
|
|
44281
|
+
/** The sentence the confirm dialog repeats: where the frames go and when they are deleted. */
|
|
44282
|
+
dataNotice: string()
|
|
44283
|
+
});
|
|
44284
|
+
/**
|
|
44285
|
+
* Orchestrator-owned states, persisted. `uploading` covers exporting the
|
|
44286
|
+
* archive (it is streamed, never staged). Terminal: `failed`, `cancelled`,
|
|
44287
|
+
* `lost`, `expired`, `discarded`. `registered` and `canary` are where a
|
|
44288
|
+
* result lives after the operator acted on it.
|
|
44289
|
+
*/
|
|
44290
|
+
var TrainingJobStateSchema = _enum([
|
|
44291
|
+
"uploading",
|
|
44292
|
+
"submitted",
|
|
44293
|
+
"starting",
|
|
44294
|
+
"running",
|
|
44295
|
+
"collecting",
|
|
44296
|
+
"ready",
|
|
44297
|
+
"registered",
|
|
44298
|
+
"canary",
|
|
44299
|
+
"failed",
|
|
44300
|
+
"cancelling",
|
|
44301
|
+
"cancelled",
|
|
44302
|
+
"lost",
|
|
44303
|
+
"expired",
|
|
44304
|
+
"discarded"
|
|
44305
|
+
]);
|
|
44306
|
+
var TrainingFailureReasonSchema = _enum([
|
|
44307
|
+
"cost-cap",
|
|
44308
|
+
"runtime-cap",
|
|
44309
|
+
"upload-failed",
|
|
44310
|
+
"submit-failed",
|
|
44311
|
+
"trainer-failed",
|
|
44312
|
+
"result-invalid",
|
|
44313
|
+
"checksum-mismatch",
|
|
44314
|
+
"fetch-failed",
|
|
44315
|
+
"provider-error",
|
|
44316
|
+
"hub-restart-during-upload"
|
|
44317
|
+
]);
|
|
44318
|
+
var TrainingProgressPointSchema = object({
|
|
44319
|
+
epoch: number().int(),
|
|
44320
|
+
map50: number().nullable(),
|
|
44321
|
+
map50_95: number().nullable()
|
|
44322
|
+
});
|
|
44323
|
+
var TrainingCanarySchema = object({
|
|
44324
|
+
deviceIds: array(number().int()).readonly(),
|
|
44325
|
+
since: number(),
|
|
44326
|
+
/** Every override the canary replaced, exactly, so rollback restores it. */
|
|
44327
|
+
previous: array(object({
|
|
44328
|
+
deviceId: number().int(),
|
|
44329
|
+
nodeId: string(),
|
|
44330
|
+
deviceKey: string(),
|
|
44331
|
+
patch: object({
|
|
44332
|
+
modelId: string().optional(),
|
|
44333
|
+
settings: record(string(), unknown()).readonly().optional()
|
|
44334
|
+
}).nullable()
|
|
44335
|
+
})).readonly()
|
|
44336
|
+
});
|
|
44337
|
+
var TrainingJobSchema = object({
|
|
44338
|
+
id: string(),
|
|
44339
|
+
idempotencyKey: string(),
|
|
44340
|
+
name: string(),
|
|
44341
|
+
createdAt: number(),
|
|
44342
|
+
updatedAt: number(),
|
|
44343
|
+
state: TrainingJobStateSchema,
|
|
44344
|
+
stage: TrainingStageSchema.nullable(),
|
|
44345
|
+
failure: object({
|
|
44346
|
+
reason: TrainingFailureReasonSchema,
|
|
44347
|
+
stage: string().nullable(),
|
|
44348
|
+
detail: string()
|
|
44349
|
+
}).nullable(),
|
|
44350
|
+
request: TrainingJobRequestSchema,
|
|
44351
|
+
maxCostUsd: number().nonnegative(),
|
|
44352
|
+
maxRuntimeSec: number().int().positive(),
|
|
44353
|
+
trainer: TrainerSourceRefSchema,
|
|
44354
|
+
datasetLayout: RetrainExportLayoutSchema,
|
|
44355
|
+
dataset: object({
|
|
44356
|
+
bytes: number().int(),
|
|
44357
|
+
sha256: string(),
|
|
44358
|
+
uploadedAt: number()
|
|
44359
|
+
}).nullable(),
|
|
44360
|
+
split: TrainingSplitPlanSchema,
|
|
44361
|
+
provider: object({
|
|
44362
|
+
state: ProviderJobStateSchema.nullable(),
|
|
44363
|
+
providerJobId: string().nullable(),
|
|
44364
|
+
startedAt: number().nullable(),
|
|
44365
|
+
endedAt: number().nullable(),
|
|
44366
|
+
billedSeconds: number(),
|
|
44367
|
+
costUsd: number(),
|
|
44368
|
+
costIsEstimate: boolean(),
|
|
44369
|
+
lastPolledAt: number().nullable()
|
|
44370
|
+
}),
|
|
44371
|
+
progress: object({
|
|
44372
|
+
epoch: number().int().nullable(),
|
|
44373
|
+
epochs: number().int().nullable(),
|
|
44374
|
+
etaSec: number().nullable(),
|
|
44375
|
+
series: array(TrainingProgressPointSchema).readonly()
|
|
44376
|
+
}),
|
|
44377
|
+
/** The last lines of the job's output (≤ 200), newest last. Never frame paths. */
|
|
44378
|
+
logTail: array(string()).readonly(),
|
|
44379
|
+
logCursor: string().nullable(),
|
|
44380
|
+
artifacts: object({
|
|
44381
|
+
bundleBytes: number().int(),
|
|
44382
|
+
bundleSha256: string(),
|
|
44383
|
+
fetchedAt: number(),
|
|
44384
|
+
/** When the staged artefacts are deleted from the hub. */
|
|
44385
|
+
expiresAt: number()
|
|
44386
|
+
}).nullable(),
|
|
44387
|
+
/** When the provider-side copy of the frames was deleted; null while it exists. */
|
|
44388
|
+
cloudDatasetDeletedAt: number().nullable(),
|
|
44389
|
+
/** A failed job's dataset is kept until then (the provider's grace), then deleted. */
|
|
44390
|
+
cloudCleanupDueAt: number().nullable(),
|
|
44391
|
+
/** Model ids registered from this job (base, and int8 when kept). */
|
|
44392
|
+
registeredModelIds: array(string()).readonly(),
|
|
44393
|
+
canary: TrainingCanarySchema.nullable()
|
|
44394
|
+
});
|
|
44395
|
+
var IdInput = object({ id: string().min(1) });
|
|
44396
|
+
method(TrainingDatasetVersionRowSchema, object({ stored: boolean() }), {
|
|
44397
|
+
kind: "mutation",
|
|
44398
|
+
auth: "admin"
|
|
44399
|
+
}), 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() }), {
|
|
44400
|
+
kind: "mutation",
|
|
44401
|
+
auth: "admin"
|
|
44402
|
+
}), method(object({}), array(TrainingBaseModelSchema).readonly(), { auth: "admin" }), method(TrainingJobRequestSchema, TrainingJobPlanSchema, {
|
|
44403
|
+
auth: "admin",
|
|
44404
|
+
timeoutMs: 6e4
|
|
44405
|
+
}), method(TrainingJobRequestSchema.extend({
|
|
44406
|
+
name: string().min(1).max(120),
|
|
44407
|
+
maxCostUsd: number().positive(),
|
|
44408
|
+
maxRuntimeSec: number().int().positive(),
|
|
44409
|
+
idempotencyKey: string().min(8).max(80)
|
|
44410
|
+
}), discriminatedUnion("kind", [object({
|
|
44411
|
+
kind: literal("started"),
|
|
44412
|
+
job: TrainingJobSchema
|
|
44413
|
+
}), object({
|
|
44414
|
+
kind: literal("refused"),
|
|
44415
|
+
reason: TrainingRefusalReasonSchema,
|
|
44416
|
+
detail: string()
|
|
44417
|
+
})]), {
|
|
44418
|
+
kind: "mutation",
|
|
44419
|
+
auth: "admin",
|
|
44420
|
+
timeoutMs: 12e4
|
|
44421
|
+
}), method(object({}), array(TrainingJobSchema).readonly(), { auth: "admin" }), method(IdInput, TrainingJobSchema.nullable(), { auth: "admin" }), method(IdInput, TrainingJobSchema, {
|
|
44422
|
+
kind: "mutation",
|
|
44423
|
+
auth: "admin",
|
|
44424
|
+
timeoutMs: 12e4
|
|
44425
|
+
}), method(IdInput, TrainingResultSchema.nullable(), { auth: "admin" }), method(IdInput.extend({ canaryDeviceIds: array(number().int()).readonly() }), TrainingJobSchema, {
|
|
44426
|
+
kind: "mutation",
|
|
44427
|
+
auth: "admin",
|
|
44428
|
+
timeoutMs: 30 * 6e4
|
|
44429
|
+
}), method(IdInput.extend({ deviceIds: array(number().int()).min(1).readonly() }), TrainingJobSchema, {
|
|
44430
|
+
kind: "mutation",
|
|
44431
|
+
auth: "admin",
|
|
44432
|
+
timeoutMs: 12e4
|
|
44433
|
+
}), method(IdInput, TrainingJobSchema, {
|
|
44434
|
+
kind: "mutation",
|
|
44435
|
+
auth: "admin",
|
|
44436
|
+
timeoutMs: 12e4
|
|
44437
|
+
}), method(IdInput, TrainingJobSchema, {
|
|
44438
|
+
kind: "mutation",
|
|
44439
|
+
auth: "admin"
|
|
44440
|
+
});
|
|
43034
44441
|
SOURCE_CAPS.filter((cap) => cap !== "switch" && cap !== "motion");
|
|
43035
44442
|
Object.freeze({
|
|
43036
44443
|
person: .5,
|
|
@@ -43674,6 +45081,12 @@ Object.freeze({
|
|
|
43674
45081
|
addonId: null,
|
|
43675
45082
|
access: "create"
|
|
43676
45083
|
},
|
|
45084
|
+
"backup.checkBackupKey": {
|
|
45085
|
+
capName: "backup",
|
|
45086
|
+
capScope: "system",
|
|
45087
|
+
addonId: null,
|
|
45088
|
+
access: "create"
|
|
45089
|
+
},
|
|
43677
45090
|
"backup.delete": {
|
|
43678
45091
|
capName: "backup",
|
|
43679
45092
|
capScope: "system",
|
|
@@ -43686,6 +45099,18 @@ Object.freeze({
|
|
|
43686
45099
|
addonId: null,
|
|
43687
45100
|
access: "delete"
|
|
43688
45101
|
},
|
|
45102
|
+
"backup.disableEncryption": {
|
|
45103
|
+
capName: "backup",
|
|
45104
|
+
capScope: "system",
|
|
45105
|
+
addonId: null,
|
|
45106
|
+
access: "create"
|
|
45107
|
+
},
|
|
45108
|
+
"backup.getEncryption": {
|
|
45109
|
+
capName: "backup",
|
|
45110
|
+
capScope: "system",
|
|
45111
|
+
addonId: null,
|
|
45112
|
+
access: "view"
|
|
45113
|
+
},
|
|
43689
45114
|
"backup.getEntries": {
|
|
43690
45115
|
capName: "backup",
|
|
43691
45116
|
capScope: "system",
|
|
@@ -43740,6 +45165,12 @@ Object.freeze({
|
|
|
43740
45165
|
addonId: null,
|
|
43741
45166
|
access: "create"
|
|
43742
45167
|
},
|
|
45168
|
+
"backup.setupEncryption": {
|
|
45169
|
+
capName: "backup",
|
|
45170
|
+
capScope: "system",
|
|
45171
|
+
addonId: null,
|
|
45172
|
+
access: "create"
|
|
45173
|
+
},
|
|
43743
45174
|
"backup.trigger": {
|
|
43744
45175
|
capName: "backup",
|
|
43745
45176
|
capScope: "system",
|
|
@@ -44292,6 +45723,12 @@ Object.freeze({
|
|
|
44292
45723
|
addonId: null,
|
|
44293
45724
|
access: "create"
|
|
44294
45725
|
},
|
|
45726
|
+
"customModelRegistry.importModelBundle": {
|
|
45727
|
+
capName: "custom-model-registry",
|
|
45728
|
+
capScope: "system",
|
|
45729
|
+
addonId: null,
|
|
45730
|
+
access: "create"
|
|
45731
|
+
},
|
|
44295
45732
|
"customModelRegistry.listModels": {
|
|
44296
45733
|
capName: "custom-model-registry",
|
|
44297
45734
|
capScope: "system",
|
|
@@ -45732,6 +47169,12 @@ Object.freeze({
|
|
|
45732
47169
|
addonId: null,
|
|
45733
47170
|
access: "view"
|
|
45734
47171
|
},
|
|
47172
|
+
"keychainAdmin.acknowledgeReset": {
|
|
47173
|
+
capName: "keychain-admin",
|
|
47174
|
+
capScope: "system",
|
|
47175
|
+
addonId: null,
|
|
47176
|
+
access: "create"
|
|
47177
|
+
},
|
|
45735
47178
|
"keychainAdmin.deleteOrphans": {
|
|
45736
47179
|
capName: "keychain-admin",
|
|
45737
47180
|
capScope: "system",
|
|
@@ -45768,6 +47211,12 @@ Object.freeze({
|
|
|
45768
47211
|
addonId: null,
|
|
45769
47212
|
access: "delete"
|
|
45770
47213
|
},
|
|
47214
|
+
"keychainAdmin.resetReport": {
|
|
47215
|
+
capName: "keychain-admin",
|
|
47216
|
+
capScope: "system",
|
|
47217
|
+
addonId: null,
|
|
47218
|
+
access: "delete"
|
|
47219
|
+
},
|
|
45771
47220
|
"keychainAdmin.reveal": {
|
|
45772
47221
|
capName: "keychain-admin",
|
|
45773
47222
|
capScope: "system",
|
|
@@ -45780,6 +47229,12 @@ Object.freeze({
|
|
|
45780
47229
|
addonId: null,
|
|
45781
47230
|
access: "create"
|
|
45782
47231
|
},
|
|
47232
|
+
"keychainAdmin.setSystemSecret": {
|
|
47233
|
+
capName: "keychain-admin",
|
|
47234
|
+
capScope: "system",
|
|
47235
|
+
addonId: null,
|
|
47236
|
+
access: "create"
|
|
47237
|
+
},
|
|
45783
47238
|
"keychainAdmin.status": {
|
|
45784
47239
|
capName: "keychain-admin",
|
|
45785
47240
|
capScope: "system",
|
|
@@ -47226,6 +48681,12 @@ Object.freeze({
|
|
|
47226
48681
|
addonId: null,
|
|
47227
48682
|
access: "create"
|
|
47228
48683
|
},
|
|
48684
|
+
"pipelineAnalytics.createRetrainDatasetVersion": {
|
|
48685
|
+
capName: "pipeline-analytics",
|
|
48686
|
+
capScope: "device",
|
|
48687
|
+
addonId: null,
|
|
48688
|
+
access: "create"
|
|
48689
|
+
},
|
|
47229
48690
|
"pipelineAnalytics.deleteDeviceEvents": {
|
|
47230
48691
|
capName: "pipeline-analytics",
|
|
47231
48692
|
capScope: "device",
|
|
@@ -47238,6 +48699,12 @@ Object.freeze({
|
|
|
47238
48699
|
addonId: null,
|
|
47239
48700
|
access: "delete"
|
|
47240
48701
|
},
|
|
48702
|
+
"pipelineAnalytics.deleteRetrainDatasetVersion": {
|
|
48703
|
+
capName: "pipeline-analytics",
|
|
48704
|
+
capScope: "device",
|
|
48705
|
+
addonId: null,
|
|
48706
|
+
access: "delete"
|
|
48707
|
+
},
|
|
47241
48708
|
"pipelineAnalytics.deleteTracks": {
|
|
47242
48709
|
capName: "pipeline-analytics",
|
|
47243
48710
|
capScope: "device",
|
|
@@ -47460,6 +48927,12 @@ Object.freeze({
|
|
|
47460
48927
|
addonId: null,
|
|
47461
48928
|
access: "view"
|
|
47462
48929
|
},
|
|
48930
|
+
"pipelineAnalytics.listRetrainDatasetVersions": {
|
|
48931
|
+
capName: "pipeline-analytics",
|
|
48932
|
+
capScope: "device",
|
|
48933
|
+
addonId: null,
|
|
48934
|
+
access: "view"
|
|
48935
|
+
},
|
|
47463
48936
|
"pipelineAnalytics.listRetrainFrames": {
|
|
47464
48937
|
capName: "pipeline-analytics",
|
|
47465
48938
|
capScope: "device",
|
|
@@ -47490,6 +48963,12 @@ Object.freeze({
|
|
|
47490
48963
|
addonId: null,
|
|
47491
48964
|
access: "view"
|
|
47492
48965
|
},
|
|
48966
|
+
"pipelineAnalytics.offerRetrainArchive": {
|
|
48967
|
+
capName: "pipeline-analytics",
|
|
48968
|
+
capScope: "device",
|
|
48969
|
+
addonId: null,
|
|
48970
|
+
access: "create"
|
|
48971
|
+
},
|
|
47493
48972
|
"pipelineAnalytics.ownersWithMedia": {
|
|
47494
48973
|
capName: "pipeline-analytics",
|
|
47495
48974
|
capScope: "device",
|
|
@@ -47502,6 +48981,12 @@ Object.freeze({
|
|
|
47502
48981
|
addonId: null,
|
|
47503
48982
|
access: "create"
|
|
47504
48983
|
},
|
|
48984
|
+
"pipelineAnalytics.previewRetrainDataset": {
|
|
48985
|
+
capName: "pipeline-analytics",
|
|
48986
|
+
capScope: "device",
|
|
48987
|
+
addonId: null,
|
|
48988
|
+
access: "view"
|
|
48989
|
+
},
|
|
47505
48990
|
"pipelineAnalytics.proposeRetrainAnnotations": {
|
|
47506
48991
|
capName: "pipeline-analytics",
|
|
47507
48992
|
capScope: "device",
|
|
@@ -47640,6 +49125,12 @@ Object.freeze({
|
|
|
47640
49125
|
addonId: null,
|
|
47641
49126
|
access: "create"
|
|
47642
49127
|
},
|
|
49128
|
+
"pipelineAnalytics.verifyRetrainDatasetVersion": {
|
|
49129
|
+
capName: "pipeline-analytics",
|
|
49130
|
+
capScope: "device",
|
|
49131
|
+
addonId: null,
|
|
49132
|
+
access: "view"
|
|
49133
|
+
},
|
|
47643
49134
|
"pipelineAnalytics.wipeAllAnalytics": {
|
|
47644
49135
|
capName: "pipeline-analytics",
|
|
47645
49136
|
capScope: "device",
|
|
@@ -50016,6 +51507,174 @@ Object.freeze({
|
|
|
50016
51507
|
addonId: null,
|
|
50017
51508
|
access: "view"
|
|
50018
51509
|
},
|
|
51510
|
+
"training.canaryResult": {
|
|
51511
|
+
capName: "training",
|
|
51512
|
+
capScope: "system",
|
|
51513
|
+
addonId: null,
|
|
51514
|
+
access: "create"
|
|
51515
|
+
},
|
|
51516
|
+
"training.cancelJob": {
|
|
51517
|
+
capName: "training",
|
|
51518
|
+
capScope: "system",
|
|
51519
|
+
addonId: null,
|
|
51520
|
+
access: "create"
|
|
51521
|
+
},
|
|
51522
|
+
"training.discardResult": {
|
|
51523
|
+
capName: "training",
|
|
51524
|
+
capScope: "system",
|
|
51525
|
+
addonId: null,
|
|
51526
|
+
access: "create"
|
|
51527
|
+
},
|
|
51528
|
+
"training.findDatasetVersionIdByName": {
|
|
51529
|
+
capName: "training",
|
|
51530
|
+
capScope: "system",
|
|
51531
|
+
addonId: null,
|
|
51532
|
+
access: "view"
|
|
51533
|
+
},
|
|
51534
|
+
"training.getDatasetVersion": {
|
|
51535
|
+
capName: "training",
|
|
51536
|
+
capScope: "system",
|
|
51537
|
+
addonId: null,
|
|
51538
|
+
access: "view"
|
|
51539
|
+
},
|
|
51540
|
+
"training.getJob": {
|
|
51541
|
+
capName: "training",
|
|
51542
|
+
capScope: "system",
|
|
51543
|
+
addonId: null,
|
|
51544
|
+
access: "view"
|
|
51545
|
+
},
|
|
51546
|
+
"training.getJobResult": {
|
|
51547
|
+
capName: "training",
|
|
51548
|
+
capScope: "system",
|
|
51549
|
+
addonId: null,
|
|
51550
|
+
access: "view"
|
|
51551
|
+
},
|
|
51552
|
+
"training.listBaseModels": {
|
|
51553
|
+
capName: "training",
|
|
51554
|
+
capScope: "system",
|
|
51555
|
+
addonId: null,
|
|
51556
|
+
access: "view"
|
|
51557
|
+
},
|
|
51558
|
+
"training.listDatasetVersions": {
|
|
51559
|
+
capName: "training",
|
|
51560
|
+
capScope: "system",
|
|
51561
|
+
addonId: null,
|
|
51562
|
+
access: "view"
|
|
51563
|
+
},
|
|
51564
|
+
"training.listJobs": {
|
|
51565
|
+
capName: "training",
|
|
51566
|
+
capScope: "system",
|
|
51567
|
+
addonId: null,
|
|
51568
|
+
access: "view"
|
|
51569
|
+
},
|
|
51570
|
+
"training.planJob": {
|
|
51571
|
+
capName: "training",
|
|
51572
|
+
capScope: "system",
|
|
51573
|
+
addonId: null,
|
|
51574
|
+
access: "view"
|
|
51575
|
+
},
|
|
51576
|
+
"training.putDatasetVersion": {
|
|
51577
|
+
capName: "training",
|
|
51578
|
+
capScope: "system",
|
|
51579
|
+
addonId: null,
|
|
51580
|
+
access: "create"
|
|
51581
|
+
},
|
|
51582
|
+
"training.registerResult": {
|
|
51583
|
+
capName: "training",
|
|
51584
|
+
capScope: "system",
|
|
51585
|
+
addonId: null,
|
|
51586
|
+
access: "create"
|
|
51587
|
+
},
|
|
51588
|
+
"training.removeDatasetVersion": {
|
|
51589
|
+
capName: "training",
|
|
51590
|
+
capScope: "system",
|
|
51591
|
+
addonId: null,
|
|
51592
|
+
access: "delete"
|
|
51593
|
+
},
|
|
51594
|
+
"training.rollbackCanary": {
|
|
51595
|
+
capName: "training",
|
|
51596
|
+
capScope: "system",
|
|
51597
|
+
addonId: null,
|
|
51598
|
+
access: "create"
|
|
51599
|
+
},
|
|
51600
|
+
"training.startJob": {
|
|
51601
|
+
capName: "training",
|
|
51602
|
+
capScope: "system",
|
|
51603
|
+
addonId: null,
|
|
51604
|
+
access: "create"
|
|
51605
|
+
},
|
|
51606
|
+
"trainingProvider.cancelJob": {
|
|
51607
|
+
capName: "training-provider",
|
|
51608
|
+
capScope: "system",
|
|
51609
|
+
addonId: null,
|
|
51610
|
+
access: "create"
|
|
51611
|
+
},
|
|
51612
|
+
"trainingProvider.cleanupJob": {
|
|
51613
|
+
capName: "training-provider",
|
|
51614
|
+
capScope: "system",
|
|
51615
|
+
addonId: null,
|
|
51616
|
+
access: "create"
|
|
51617
|
+
},
|
|
51618
|
+
"trainingProvider.describe": {
|
|
51619
|
+
capName: "training-provider",
|
|
51620
|
+
capScope: "system",
|
|
51621
|
+
addonId: null,
|
|
51622
|
+
access: "view"
|
|
51623
|
+
},
|
|
51624
|
+
"trainingProvider.estimateJob": {
|
|
51625
|
+
capName: "training-provider",
|
|
51626
|
+
capScope: "system",
|
|
51627
|
+
addonId: null,
|
|
51628
|
+
access: "view"
|
|
51629
|
+
},
|
|
51630
|
+
"trainingProvider.getJob": {
|
|
51631
|
+
capName: "training-provider",
|
|
51632
|
+
capScope: "system",
|
|
51633
|
+
addonId: null,
|
|
51634
|
+
access: "view"
|
|
51635
|
+
},
|
|
51636
|
+
"trainingProvider.listJobEvents": {
|
|
51637
|
+
capName: "training-provider",
|
|
51638
|
+
capScope: "system",
|
|
51639
|
+
addonId: null,
|
|
51640
|
+
access: "view"
|
|
51641
|
+
},
|
|
51642
|
+
"trainingProvider.listJobs": {
|
|
51643
|
+
capName: "training-provider",
|
|
51644
|
+
capScope: "system",
|
|
51645
|
+
addonId: null,
|
|
51646
|
+
access: "view"
|
|
51647
|
+
},
|
|
51648
|
+
"trainingProvider.offerArtifact": {
|
|
51649
|
+
capName: "training-provider",
|
|
51650
|
+
capScope: "system",
|
|
51651
|
+
addonId: null,
|
|
51652
|
+
access: "create"
|
|
51653
|
+
},
|
|
51654
|
+
"trainingProvider.readResult": {
|
|
51655
|
+
capName: "training-provider",
|
|
51656
|
+
capScope: "system",
|
|
51657
|
+
addonId: null,
|
|
51658
|
+
access: "create"
|
|
51659
|
+
},
|
|
51660
|
+
"trainingProvider.submitJob": {
|
|
51661
|
+
capName: "training-provider",
|
|
51662
|
+
capScope: "system",
|
|
51663
|
+
addonId: null,
|
|
51664
|
+
access: "create"
|
|
51665
|
+
},
|
|
51666
|
+
"trainingProvider.uploadDataset": {
|
|
51667
|
+
capName: "training-provider",
|
|
51668
|
+
capScope: "system",
|
|
51669
|
+
addonId: null,
|
|
51670
|
+
access: "create"
|
|
51671
|
+
},
|
|
51672
|
+
"trainingProvider.validateCredentials": {
|
|
51673
|
+
capName: "training-provider",
|
|
51674
|
+
capScope: "system",
|
|
51675
|
+
addonId: null,
|
|
51676
|
+
access: "create"
|
|
51677
|
+
},
|
|
50019
51678
|
"turnProvider.getTurnServers": {
|
|
50020
51679
|
capName: "turn-provider",
|
|
50021
51680
|
capScope: "system",
|
|
@@ -50040,12 +51699,6 @@ Object.freeze({
|
|
|
50040
51699
|
addonId: null,
|
|
50041
51700
|
access: "create"
|
|
50042
51701
|
},
|
|
50043
|
-
"userManagement.createApiKey": {
|
|
50044
|
-
capName: "user-management",
|
|
50045
|
-
capScope: "system",
|
|
50046
|
-
addonId: null,
|
|
50047
|
-
access: "create"
|
|
50048
|
-
},
|
|
50049
51702
|
"userManagement.createScopedToken": {
|
|
50050
51703
|
capName: "user-management",
|
|
50051
51704
|
capScope: "system",
|
|
@@ -50082,12 +51735,6 @@ Object.freeze({
|
|
|
50082
51735
|
addonId: null,
|
|
50083
51736
|
access: "view"
|
|
50084
51737
|
},
|
|
50085
|
-
"userManagement.linkExternalIdentity": {
|
|
50086
|
-
capName: "user-management",
|
|
50087
|
-
capScope: "system",
|
|
50088
|
-
addonId: null,
|
|
50089
|
-
access: "create"
|
|
50090
|
-
},
|
|
50091
51738
|
"userManagement.listApiKeys": {
|
|
50092
51739
|
capName: "user-management",
|
|
50093
51740
|
capScope: "system",
|
|
@@ -50190,12 +51837,6 @@ Object.freeze({
|
|
|
50190
51837
|
addonId: null,
|
|
50191
51838
|
access: "create"
|
|
50192
51839
|
},
|
|
50193
|
-
"userManagement.validateApiKey": {
|
|
50194
|
-
capName: "user-management",
|
|
50195
|
-
capScope: "system",
|
|
50196
|
-
addonId: null,
|
|
50197
|
-
access: "view"
|
|
50198
|
-
},
|
|
50199
51840
|
"userManagement.validateCredentials": {
|
|
50200
51841
|
capName: "user-management",
|
|
50201
51842
|
capScope: "system",
|
|
@@ -54309,6 +55950,11 @@ Object.freeze({
|
|
|
54309
55950
|
form: "single",
|
|
54310
55951
|
optional: false
|
|
54311
55952
|
}],
|
|
55953
|
+
"training.canaryResult": [{
|
|
55954
|
+
name: "deviceIds",
|
|
55955
|
+
form: "array",
|
|
55956
|
+
optional: false
|
|
55957
|
+
}],
|
|
54312
55958
|
"update.getStatus": [{
|
|
54313
55959
|
name: "deviceId",
|
|
54314
55960
|
form: "single",
|
|
@@ -55087,6 +56733,8 @@ var STATE_SUMMARY_VARS = [
|
|
|
55087
56733
|
[...RULE_TEXT],
|
|
55088
56734
|
[...RULE_TEXT],
|
|
55089
56735
|
[...RULE_TEXT],
|
|
56736
|
+
[...RULE_TEXT],
|
|
56737
|
+
[...RULE_TEXT],
|
|
55090
56738
|
([...RULE_TEXT], [...UPDATES]),
|
|
55091
56739
|
([...RULE_TEXT], [...PACKAGE_UPDATES]),
|
|
55092
56740
|
([...RULE_TEXT], [...PACKAGE_UPDATES]),
|
|
@@ -56156,7 +57804,12 @@ var CREDENTIAL_PARAM_PATTERNS = [
|
|
|
56156
57804
|
/^bearer$/i,
|
|
56157
57805
|
/^api[_-]?key$/i,
|
|
56158
57806
|
/^access[_-]?token$/i,
|
|
56159
|
-
/^refresh[_-]?token$/i
|
|
57807
|
+
/^refresh[_-]?token$/i,
|
|
57808
|
+
/^bridge$/i,
|
|
57809
|
+
/^code$/i,
|
|
57810
|
+
/^state$/i,
|
|
57811
|
+
/^challenge$/i,
|
|
57812
|
+
/^link$/i
|
|
56160
57813
|
];
|
|
56161
57814
|
function isCredentialParam(name) {
|
|
56162
57815
|
return CREDENTIAL_PARAM_PATTERNS.some((re) => re.test(name));
|
|
@@ -56178,6 +57831,10 @@ function isCredentialParam(name) {
|
|
|
56178
57831
|
* are NOT masked (those are entity references, not credentials).
|
|
56179
57832
|
*/
|
|
56180
57833
|
function maskUrlCredentials(rawUrl) {
|
|
57834
|
+
if (rawUrl.startsWith("/") && !rawUrl.startsWith("//")) {
|
|
57835
|
+
const masked = maskUrlCredentials(`http://relative.invalid${rawUrl}`);
|
|
57836
|
+
return masked.startsWith("http://relative.invalid") ? masked.slice(23) : rawUrl;
|
|
57837
|
+
}
|
|
56181
57838
|
try {
|
|
56182
57839
|
const u = new URL(rawUrl);
|
|
56183
57840
|
let touched = false;
|