@camstack/addon-model-studio 1.1.217 → 1.1.219
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{MotionZonesSettings-B4T-Lq49.mjs → MotionZonesSettings-iznKgqTW.mjs} +2 -2
- package/dist/{PrivacyMaskSettings-RuT2sLzN.mjs → PrivacyMaskSettings-C6wGkgut.mjs} +4 -4
- package/dist/{SceneMonitorEditor-BnWT3tyK.mjs → SceneMonitorEditor-DJAIMI8W.mjs} +3 -3
- package/dist/_stub.js +4770 -4773
- package/dist/{_virtual_mf-localSharedImportMap___mfe_internal__addon_model_studio_page-BPVoz67A.mjs → _virtual_mf-localSharedImportMap___mfe_internal__addon_model_studio_page-gHc6KKdS.mjs} +3 -3
- package/dist/_virtual_mf___mfe_internal__addon_model_studio_page__loadShare___mf_0_camstack_mf_1_types__loadShare__.js-ClV5IShH.mjs +26 -0
- package/dist/addon-model-studio.css +1 -1
- package/dist/{hostInit-zqvyamS8.mjs → hostInit-8-vvEvUj.mjs} +2 -2
- package/dist/model-studio.addon.js +1978 -60
- package/dist/model-studio.addon.mjs +1978 -60
- package/dist/{player-overlays-BU4aAx02.mjs → player-overlays-DDqfVhHf.mjs} +1 -1
- package/dist/remoteEntry.js +1 -1
- package/dist/{responsive-CU7BiLwa.mjs → responsive-sVlbSBci.mjs} +1 -1
- package/dist/{scene-monitor-copy-BX9UvcxQ.mjs → scene-monitor-copy-D_xseg_c.mjs} +1 -1
- package/dist/{square-DhCedQoj.mjs → square-VW_5OacX.mjs} +1 -1
- package/dist/{trash-2-BCjCExeI.mjs → trash-2-C1-_5_yP.mjs} +1 -1
- package/dist/{virtual_mf-REMOTE_ENTRY_ID___mfe_internal__addon_model_studio_page__remoteEntry_js-XvoS0Enz.mjs → virtual_mf-REMOTE_ENTRY_ID___mfe_internal__addon_model_studio_page__remoteEntry_js-BgyWayNh.mjs} +1 -1
- package/package.json +1 -1
- package/python/__tests__/test_calibration.py +56 -0
- package/python/convert_lib.py +45 -16
- package/dist/_virtual_mf___mfe_internal__addon_model_studio_page__loadShare___mf_0_camstack_mf_1_types__loadShare__.js-DgQsf8Wc.mjs +0 -26
|
@@ -367,7 +367,7 @@ function buildScryptedRegistryDescriptor(entry) {
|
|
|
367
367
|
};
|
|
368
368
|
}
|
|
369
369
|
//#endregion
|
|
370
|
-
//#region ../types/dist/event-category-
|
|
370
|
+
//#region ../types/dist/event-category-DaIZi00R.mjs
|
|
371
371
|
var EventCategory = /* @__PURE__ */ function(EventCategory) {
|
|
372
372
|
EventCategory["SystemBoot"] = "system.boot";
|
|
373
373
|
EventCategory["SystemAddonsReady"] = "system.addons-ready";
|
|
@@ -446,6 +446,13 @@ var EventCategory = /* @__PURE__ */ function(EventCategory) {
|
|
|
446
446
|
*/
|
|
447
447
|
EventCategory["AddonLoadFailed"] = "addon.load-failed";
|
|
448
448
|
/**
|
|
449
|
+
* A keychain value was stored or removed (D787). Carries the ref, its
|
|
450
|
+
* owner and the new version — NEVER the value. A process holding the ref
|
|
451
|
+
* drops its cached copy and the owning `BaseAddon` re-resolves its config.
|
|
452
|
+
* Telemetry (D8): a process that misses it still revalidates by version.
|
|
453
|
+
*/
|
|
454
|
+
EventCategory["KeychainChanged"] = "keychain.changed";
|
|
455
|
+
/**
|
|
449
456
|
* Addon recovered from a previous failure. Emitted when an addon
|
|
450
457
|
* transitions from `failed` back to `healthy` (typically via the
|
|
451
458
|
* monitor's auto-retry loop, or after manual `addons.retryLoad`).
|
|
@@ -5738,7 +5745,7 @@ var ZodIssueCode = {
|
|
|
5738
5745
|
var ZodFirstPartyTypeKind;
|
|
5739
5746
|
ZodFirstPartyTypeKind || (ZodFirstPartyTypeKind = {});
|
|
5740
5747
|
//#endregion
|
|
5741
|
-
//#region ../types/dist/sleep-
|
|
5748
|
+
//#region ../types/dist/sleep-Cr5YOk3m.mjs
|
|
5742
5749
|
/**
|
|
5743
5750
|
* The audio chunk plane's byte format, and the ONE expansion from a coded
|
|
5744
5751
|
* window to float samples (D455).
|
|
@@ -5817,6 +5824,97 @@ function buildAlawTable() {
|
|
|
5817
5824
|
}
|
|
5818
5825
|
buildUlawTable();
|
|
5819
5826
|
buildAlawTable();
|
|
5827
|
+
/** Is this field's stored value a credential? */
|
|
5828
|
+
function isSecretConfigField(field) {
|
|
5829
|
+
if (field.type === "password") return true;
|
|
5830
|
+
return "secret" in field && field.secret === true;
|
|
5831
|
+
}
|
|
5832
|
+
/**
|
|
5833
|
+
* Is this field's value stored in the KEYCHAIN (D787)? Every secret field is,
|
|
5834
|
+
* by its TYPE, unless it opts out with `storage: 'inline'` — never by its name.
|
|
5835
|
+
*/
|
|
5836
|
+
function isKeychainStoredField(field) {
|
|
5837
|
+
if (!isSecretConfigField(field)) return false;
|
|
5838
|
+
if (field.type === "textarea" && field.isJson === true) return false;
|
|
5839
|
+
return !("storage" in field && field.storage === "inline");
|
|
5840
|
+
}
|
|
5841
|
+
/**
|
|
5842
|
+
* What a settings blob holds where a secret used to be.
|
|
5843
|
+
*
|
|
5844
|
+
* A keychain-stored field never holds its value. It holds a self-describing
|
|
5845
|
+
* MARKER, `{"$secret":"secret://…","v":1}` — an object, never a string, so no
|
|
5846
|
+
* code can mistake it for a credential and no form can send it to a camera as
|
|
5847
|
+
* a password. The empty state is `null` / absent, never `''`.
|
|
5848
|
+
*
|
|
5849
|
+
* The same shapes travel to and from the admin UI:
|
|
5850
|
+
*
|
|
5851
|
+
* - read: `hydrateSchema` hands a secret field a {@link SecretFieldView}
|
|
5852
|
+
* (`{ $secret, v, set: true }`) or `null` — the browser learns whether a
|
|
5853
|
+
* value is set, never the value.
|
|
5854
|
+
* - write: an untouched field submits the view back unchanged (KEEP); a typed
|
|
5855
|
+
* value is a plain non-empty string (CHANGE); the Clear button submits
|
|
5856
|
+
* {@link SECRET_CLEAR} (CLEAR). `''`, `null` and the legacy redaction tokens
|
|
5857
|
+
* are KEEP — an empty string is what a defaults-fallback pushes back, and
|
|
5858
|
+
* treating it as "clear" is how a save destroyed a stored credential before.
|
|
5859
|
+
*
|
|
5860
|
+
* Pure and browser-safe.
|
|
5861
|
+
*/
|
|
5862
|
+
var SECRET_CLEAR = { $secretClear: true };
|
|
5863
|
+
/** The `'***'` token D634 redaction writes for non-admins. */
|
|
5864
|
+
var LEGACY_DEVICE_REDACTION = "***";
|
|
5865
|
+
function isRecord$1(value) {
|
|
5866
|
+
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
5867
|
+
}
|
|
5868
|
+
function makeSecretMarker(ref) {
|
|
5869
|
+
return {
|
|
5870
|
+
$secret: ref,
|
|
5871
|
+
v: 1
|
|
5872
|
+
};
|
|
5873
|
+
}
|
|
5874
|
+
/** A stored marker: an object whose `$secret` is a non-empty string. */
|
|
5875
|
+
function isSecretMarker(value) {
|
|
5876
|
+
if (!isRecord$1(value)) return false;
|
|
5877
|
+
const ref = value["$secret"];
|
|
5878
|
+
return typeof ref === "string" && ref.length > 0;
|
|
5879
|
+
}
|
|
5880
|
+
function isSecretClear(value) {
|
|
5881
|
+
return isRecord$1(value) && value["$secretClear"] === true;
|
|
5882
|
+
}
|
|
5883
|
+
/**
|
|
5884
|
+
* The UI view of a stored secret field value: a marker becomes "set", inline
|
|
5885
|
+
* plaintext becomes "set (inline)", nothing becomes `null`. A value never
|
|
5886
|
+
* survives this function.
|
|
5887
|
+
*/
|
|
5888
|
+
function toSecretFieldView(stored) {
|
|
5889
|
+
if (isSecretMarker(stored)) return {
|
|
5890
|
+
$secret: stored.$secret,
|
|
5891
|
+
v: 1,
|
|
5892
|
+
set: true
|
|
5893
|
+
};
|
|
5894
|
+
if (typeof stored === "string" && stored.length > 0) return {
|
|
5895
|
+
$secret: null,
|
|
5896
|
+
v: 1,
|
|
5897
|
+
set: true,
|
|
5898
|
+
inline: true
|
|
5899
|
+
};
|
|
5900
|
+
return null;
|
|
5901
|
+
}
|
|
5902
|
+
/**
|
|
5903
|
+
* Classify an incoming value for a secret path. Only a non-empty string that is
|
|
5904
|
+
* not a redaction token sets a value; only {@link SECRET_CLEAR} clears.
|
|
5905
|
+
* Everything else — a marker (ours or anyone's), a UI view, `''`, `null`,
|
|
5906
|
+
* `undefined`, a redaction token, a non-string — keeps what is stored.
|
|
5907
|
+
*/
|
|
5908
|
+
function classifySecretWrite(incoming) {
|
|
5909
|
+
if (isSecretClear(incoming)) return { kind: "clear" };
|
|
5910
|
+
if (typeof incoming !== "string") return { kind: "keep" };
|
|
5911
|
+
if (incoming.length === 0) return { kind: "keep" };
|
|
5912
|
+
if (incoming === "__camstack_redacted__" || incoming === LEGACY_DEVICE_REDACTION) return { kind: "keep" };
|
|
5913
|
+
return {
|
|
5914
|
+
kind: "set",
|
|
5915
|
+
value: incoming
|
|
5916
|
+
};
|
|
5917
|
+
}
|
|
5820
5918
|
Object.fromEntries([
|
|
5821
5919
|
{
|
|
5822
5920
|
id: "overview",
|
|
@@ -5988,33 +6086,19 @@ Object.fromEntries([
|
|
|
5988
6086
|
function isValuelessField(field) {
|
|
5989
6087
|
return field.type === "separator" || field.type === "info" || field.type === "qr-code" || field.type === "button" || field.type === "object-array" || field.type === "widget" || field.type === "addon-action-button" || field.type === "device-action-button";
|
|
5990
6088
|
}
|
|
5991
|
-
|
|
5992
|
-
* Merge a `ConfigUISchema` with a raw `values` record into a
|
|
5993
|
-
* `ConfigUISchemaWithValues`. Used by every `get*Settings` backend endpoint
|
|
5994
|
-
* before returning to the admin UI. Groups are walked recursively.
|
|
5995
|
-
*
|
|
5996
|
-
* For each leaf field:
|
|
5997
|
-
* - structural fields (`separator`, `info`, `button`) pass through unchanged
|
|
5998
|
-
* - other fields get `value = values[key] ?? field.default ?? null`
|
|
5999
|
-
*
|
|
6000
|
-
* Unknown keys in `values` (keys not declared in the schema) are silently
|
|
6001
|
-
* ignored — they don't contribute to the output. Missing keys fall back to
|
|
6002
|
-
* the schema default or `null`. This mirrors the old backend behaviour where
|
|
6003
|
-
* `FormBuilder` rendered `values[key] ?? field.default`.
|
|
6004
|
-
*/
|
|
6005
|
-
function hydrateSchema(schema, values) {
|
|
6089
|
+
function hydrateSchema(schema, values, options = {}) {
|
|
6006
6090
|
return {
|
|
6007
6091
|
...schema.tabs ? { tabs: [...schema.tabs] } : {},
|
|
6008
6092
|
sections: schema.sections.map((section) => ({
|
|
6009
6093
|
...section,
|
|
6010
|
-
fields: section.fields.map((field) => hydrateField(field, values))
|
|
6094
|
+
fields: section.fields.map((field) => hydrateField(field, values, options))
|
|
6011
6095
|
}))
|
|
6012
6096
|
};
|
|
6013
6097
|
}
|
|
6014
|
-
function hydrateField(field, values) {
|
|
6098
|
+
function hydrateField(field, values, options) {
|
|
6015
6099
|
if (isValuelessField(field)) return field;
|
|
6016
6100
|
if (field.type === "group") {
|
|
6017
|
-
const hydratedChildren = field.fields.map((child) => hydrateField(child, values));
|
|
6101
|
+
const hydratedChildren = field.fields.map((child) => hydrateField(child, values, options));
|
|
6018
6102
|
return {
|
|
6019
6103
|
...field,
|
|
6020
6104
|
fields: hydratedChildren
|
|
@@ -6023,7 +6107,7 @@ function hydrateField(field, values) {
|
|
|
6023
6107
|
if (field.type === "sub-tabs") {
|
|
6024
6108
|
const hydratedTabs = field.tabs.map((tab) => ({
|
|
6025
6109
|
...tab,
|
|
6026
|
-
fields: tab.fields.map((child) => hydrateField(child, values))
|
|
6110
|
+
fields: tab.fields.map((child) => hydrateField(child, values, options))
|
|
6027
6111
|
}));
|
|
6028
6112
|
return {
|
|
6029
6113
|
...field,
|
|
@@ -6033,6 +6117,33 @@ function hydrateField(field, values) {
|
|
|
6033
6117
|
const key = field.key;
|
|
6034
6118
|
const storedValue = Object.prototype.hasOwnProperty.call(values, key) ? values[key] : void 0;
|
|
6035
6119
|
const defaultValue = field.default;
|
|
6120
|
+
const asView = (v) => isSecretMarker(v) || options.inlineSecretsAsViews === true && v !== void 0;
|
|
6121
|
+
if (isKeychainStoredField(field) && asView(storedValue)) return {
|
|
6122
|
+
...field,
|
|
6123
|
+
value: toSecretFieldView(storedValue)
|
|
6124
|
+
};
|
|
6125
|
+
if (isKeychainStoredField(field) && options.inlineSecretsAsViews === true) return {
|
|
6126
|
+
...field,
|
|
6127
|
+
value: null
|
|
6128
|
+
};
|
|
6129
|
+
if (field.type === "editable-array" && Array.isArray(storedValue)) {
|
|
6130
|
+
const secretItemKeys = field.itemFields.filter((item) => "key" in item && isKeychainStoredField(item)).map((item) => "key" in item ? item.key : "");
|
|
6131
|
+
if (secretItemKeys.length > 0) {
|
|
6132
|
+
const rows = storedValue.map((row) => {
|
|
6133
|
+
if (row === null || typeof row !== "object" || Array.isArray(row)) return row;
|
|
6134
|
+
const out = { ...row };
|
|
6135
|
+
for (const k of secretItemKeys) {
|
|
6136
|
+
const v = Reflect.get(row, k);
|
|
6137
|
+
if (asView(v)) out[k] = toSecretFieldView(v);
|
|
6138
|
+
}
|
|
6139
|
+
return out;
|
|
6140
|
+
});
|
|
6141
|
+
return {
|
|
6142
|
+
...field,
|
|
6143
|
+
value: rows
|
|
6144
|
+
};
|
|
6145
|
+
}
|
|
6146
|
+
}
|
|
6036
6147
|
if (field.multiple) {
|
|
6037
6148
|
const stored = Array.isArray(storedValue) ? storedValue : storedValue !== void 0 && storedValue !== null ? [storedValue] : [];
|
|
6038
6149
|
const itemFallback = field.multiple.itemDefault !== void 0 ? field.multiple.itemDefault : defaultValue !== void 0 ? defaultValue : typeOf(field) === "string" ? "" : null;
|
|
@@ -6275,6 +6386,431 @@ function projectStore(store, perNodeKeys, nodeId) {
|
|
|
6275
6386
|
}
|
|
6276
6387
|
return out;
|
|
6277
6388
|
}
|
|
6389
|
+
var GLOBAL_SCOPE = { kind: "global" };
|
|
6390
|
+
/** The scope every addon-wide (not per-node, not per-device) setting lives in. */
|
|
6391
|
+
function globalSecretScope() {
|
|
6392
|
+
return GLOBAL_SCOPE;
|
|
6393
|
+
}
|
|
6394
|
+
function encodeSegment(value) {
|
|
6395
|
+
return encodeURIComponent(value);
|
|
6396
|
+
}
|
|
6397
|
+
/**
|
|
6398
|
+
* The field path of a value inside an array item, addressed by the item's id:
|
|
6399
|
+
* `arrayItemFieldPath('providers', 'authentik', 'clientSecret')` →
|
|
6400
|
+
* `providers[authentik].clientSecret`.
|
|
6401
|
+
*/
|
|
6402
|
+
function arrayItemFieldPath(arrayKey, itemId, fieldKey) {
|
|
6403
|
+
return `${arrayKey}[${encodeSegment(itemId)}].${fieldKey}`;
|
|
6404
|
+
}
|
|
6405
|
+
/** A write to a secret path could not be stored in the keychain, so it was refused. */
|
|
6406
|
+
var KeychainWriteRefusedError = class extends Error {
|
|
6407
|
+
fieldPath;
|
|
6408
|
+
constructor(fieldPath, cause) {
|
|
6409
|
+
super(`secret "${fieldPath}" was not saved: the keychain could not store it (${cause instanceof Error ? cause.message : String(cause)}). Nothing was written.`);
|
|
6410
|
+
this.fieldPath = fieldPath;
|
|
6411
|
+
this.name = "KeychainWriteRefusedError";
|
|
6412
|
+
}
|
|
6413
|
+
};
|
|
6414
|
+
var KEEP = { kind: "keep" };
|
|
6415
|
+
function isRecord$2(value) {
|
|
6416
|
+
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
6417
|
+
}
|
|
6418
|
+
function defaultMintId() {
|
|
6419
|
+
return globalThis.crypto.randomUUID();
|
|
6420
|
+
}
|
|
6421
|
+
/** Every marker ref anywhere under `value`. */
|
|
6422
|
+
function collectSecretMarkerRefs(value, out = []) {
|
|
6423
|
+
if (isSecretMarker(value)) {
|
|
6424
|
+
out.push(value.$secret);
|
|
6425
|
+
return out;
|
|
6426
|
+
}
|
|
6427
|
+
if (Array.isArray(value)) for (const item of value) collectSecretMarkerRefs(item, out);
|
|
6428
|
+
else if (isRecord$2(value)) for (const child of Object.values(value)) collectSecretMarkerRefs(child, out);
|
|
6429
|
+
return out;
|
|
6430
|
+
}
|
|
6431
|
+
async function storedValueEquals(secrets, marker, candidate) {
|
|
6432
|
+
const resolved = (await secrets.resolve([marker.$secret]))[marker.$secret];
|
|
6433
|
+
return resolved?.kind === "value" && resolved.value === candidate;
|
|
6434
|
+
}
|
|
6435
|
+
async function writeLeaf(ctx, incoming, stored, fieldPath) {
|
|
6436
|
+
const intent = classifySecretWrite(incoming);
|
|
6437
|
+
const ref = ctx.secrets.ref(ctx.scope, fieldPath);
|
|
6438
|
+
const storedIsOurs = isSecretMarker(stored) && stored.$secret === ref;
|
|
6439
|
+
if (intent.kind === "keep") return KEEP;
|
|
6440
|
+
if (intent.kind === "set" && !ctx.operatorWrite && typeof stored === "string" && stored === intent.value) return KEEP;
|
|
6441
|
+
if (intent.kind === "clear") {
|
|
6442
|
+
if (storedIsOurs) ctx.deletes.push(ref);
|
|
6443
|
+
return {
|
|
6444
|
+
kind: "value",
|
|
6445
|
+
value: null
|
|
6446
|
+
};
|
|
6447
|
+
}
|
|
6448
|
+
if (storedIsOurs && await storedValueEquals(ctx.secrets, stored, intent.value)) return {
|
|
6449
|
+
kind: "value",
|
|
6450
|
+
value: stored
|
|
6451
|
+
};
|
|
6452
|
+
try {
|
|
6453
|
+
await ctx.secrets.put(ref, intent.value);
|
|
6454
|
+
} catch (err) {
|
|
6455
|
+
throw new KeychainWriteRefusedError(fieldPath, err);
|
|
6456
|
+
}
|
|
6457
|
+
return {
|
|
6458
|
+
kind: "value",
|
|
6459
|
+
value: makeSecretMarker(ref)
|
|
6460
|
+
};
|
|
6461
|
+
}
|
|
6462
|
+
/** Apply a member result onto `out`: KEEP restores the stored member, or removes it. */
|
|
6463
|
+
function applyMember(out, key, result, storedParent) {
|
|
6464
|
+
if (result.kind === "value") {
|
|
6465
|
+
out[key] = result.value;
|
|
6466
|
+
return;
|
|
6467
|
+
}
|
|
6468
|
+
if (Object.prototype.hasOwnProperty.call(storedParent, key)) out[key] = storedParent[key];
|
|
6469
|
+
else delete out[key];
|
|
6470
|
+
}
|
|
6471
|
+
async function writeMembers(ctx, children, incoming, stored, pathOf) {
|
|
6472
|
+
const out = { ...incoming };
|
|
6473
|
+
for (const [member, node] of children) applyMember(out, member, await writeNode(ctx, node, incoming[member], stored[member], pathOf(member)), stored);
|
|
6474
|
+
return out;
|
|
6475
|
+
}
|
|
6476
|
+
function rowId(row, idKey) {
|
|
6477
|
+
const raw = row[idKey];
|
|
6478
|
+
if (typeof raw === "string" && raw.length > 0) return raw;
|
|
6479
|
+
if (typeof raw === "number" && Number.isFinite(raw)) return String(raw);
|
|
6480
|
+
return null;
|
|
6481
|
+
}
|
|
6482
|
+
async function writeArray(ctx, node, incoming, stored, fieldPath) {
|
|
6483
|
+
const storedRows = Array.isArray(stored) ? stored.filter(isRecord$2) : [];
|
|
6484
|
+
if (!Array.isArray(incoming)) {
|
|
6485
|
+
ctx.deletes.push(...collectSecretMarkerRefs(storedRows));
|
|
6486
|
+
return {
|
|
6487
|
+
kind: "value",
|
|
6488
|
+
value: incoming
|
|
6489
|
+
};
|
|
6490
|
+
}
|
|
6491
|
+
const storedById = /* @__PURE__ */ new Map();
|
|
6492
|
+
for (const row of storedRows) {
|
|
6493
|
+
const id = rowId(row, node.idKey);
|
|
6494
|
+
if (id !== null) storedById.set(id, row);
|
|
6495
|
+
}
|
|
6496
|
+
const kept = /* @__PURE__ */ new Set();
|
|
6497
|
+
const rows = [];
|
|
6498
|
+
for (const row of incoming) {
|
|
6499
|
+
if (!isRecord$2(row)) {
|
|
6500
|
+
rows.push(row);
|
|
6501
|
+
continue;
|
|
6502
|
+
}
|
|
6503
|
+
const id = rowId(row, node.idKey) ?? ctx.mintId();
|
|
6504
|
+
kept.add(id);
|
|
6505
|
+
const withId = {
|
|
6506
|
+
...row,
|
|
6507
|
+
[node.idKey]: row[node.idKey] ?? id
|
|
6508
|
+
};
|
|
6509
|
+
if (rowId(withId, node.idKey) === null) withId[node.idKey] = id;
|
|
6510
|
+
const storedRow = storedById.get(id) ?? {};
|
|
6511
|
+
rows.push(await writeMembers(ctx, node.item, withId, storedRow, (member) => arrayItemFieldPath(fieldPath, id, member)));
|
|
6512
|
+
}
|
|
6513
|
+
for (const [id, row] of storedById) if (!kept.has(id)) ctx.deletes.push(...collectSecretMarkerRefs(row));
|
|
6514
|
+
return {
|
|
6515
|
+
kind: "value",
|
|
6516
|
+
value: rows
|
|
6517
|
+
};
|
|
6518
|
+
}
|
|
6519
|
+
async function writeNode(ctx, node, incoming, stored, fieldPath) {
|
|
6520
|
+
switch (node.kind) {
|
|
6521
|
+
case "leaf": return writeLeaf(ctx, incoming, stored, fieldPath);
|
|
6522
|
+
case "array": return writeArray(ctx, node, incoming, stored, fieldPath);
|
|
6523
|
+
case "object": {
|
|
6524
|
+
if (!isRecord$2(incoming)) {
|
|
6525
|
+
if (incoming === void 0) return KEEP;
|
|
6526
|
+
ctx.deletes.push(...collectSecretMarkerRefs(stored));
|
|
6527
|
+
return {
|
|
6528
|
+
kind: "value",
|
|
6529
|
+
value: incoming
|
|
6530
|
+
};
|
|
6531
|
+
}
|
|
6532
|
+
const storedObj = isRecord$2(stored) ? stored : {};
|
|
6533
|
+
return {
|
|
6534
|
+
kind: "value",
|
|
6535
|
+
value: await writeMembers(ctx, node.children, incoming, storedObj, (m) => `${fieldPath}.${m}`)
|
|
6536
|
+
};
|
|
6537
|
+
}
|
|
6538
|
+
}
|
|
6539
|
+
}
|
|
6540
|
+
/** Split a perNode-scoped key (`key@nodeId`). */
|
|
6541
|
+
function splitNodeKey(key) {
|
|
6542
|
+
const at = key.indexOf("@");
|
|
6543
|
+
return at <= 0 ? {
|
|
6544
|
+
base: key,
|
|
6545
|
+
nodeId: null
|
|
6546
|
+
} : {
|
|
6547
|
+
base: key.slice(0, at),
|
|
6548
|
+
nodeId: key.slice(at + 1)
|
|
6549
|
+
};
|
|
6550
|
+
}
|
|
6551
|
+
/** Rewrite a settings patch so no secret value reaches the blob. See the file doc. */
|
|
6552
|
+
async function transformSecretWrite(input) {
|
|
6553
|
+
const deletes = [];
|
|
6554
|
+
const base = {
|
|
6555
|
+
secrets: input.secrets,
|
|
6556
|
+
mintId: input.mintId ?? defaultMintId,
|
|
6557
|
+
deletes,
|
|
6558
|
+
operatorWrite: input.operatorWrite === true
|
|
6559
|
+
};
|
|
6560
|
+
const out = {};
|
|
6561
|
+
for (const [key, incoming] of Object.entries(input.patch)) {
|
|
6562
|
+
const { base: baseKey, nodeId } = splitNodeKey(key);
|
|
6563
|
+
const node = input.tree.get(baseKey);
|
|
6564
|
+
if (node === void 0) {
|
|
6565
|
+
out[key] = incoming;
|
|
6566
|
+
continue;
|
|
6567
|
+
}
|
|
6568
|
+
const scope = nodeId !== null && nodeId.length > 0 ? {
|
|
6569
|
+
kind: "node",
|
|
6570
|
+
nodeId
|
|
6571
|
+
} : input.scope ?? globalSecretScope();
|
|
6572
|
+
const result = await writeNode({
|
|
6573
|
+
...base,
|
|
6574
|
+
scope
|
|
6575
|
+
}, node, incoming, input.stored[key], baseKey);
|
|
6576
|
+
if (result.kind === "value") out[key] = result.value;
|
|
6577
|
+
}
|
|
6578
|
+
return {
|
|
6579
|
+
patch: out,
|
|
6580
|
+
afterWrite: async () => {
|
|
6581
|
+
if (deletes.length === 0) return { orphaned: [] };
|
|
6582
|
+
try {
|
|
6583
|
+
await input.secrets.delete([...new Set(deletes)]);
|
|
6584
|
+
return { orphaned: [] };
|
|
6585
|
+
} catch {
|
|
6586
|
+
return { orphaned: [...new Set(deletes)] };
|
|
6587
|
+
}
|
|
6588
|
+
}
|
|
6589
|
+
};
|
|
6590
|
+
}
|
|
6591
|
+
/**
|
|
6592
|
+
* Replace every marker in `value` with its keychain value. Returns the SAME
|
|
6593
|
+
* reference when there is no marker (no allocation, no keychain call).
|
|
6594
|
+
*/
|
|
6595
|
+
async function resolveSecretMarkers(value, secrets) {
|
|
6596
|
+
const refs = collectSecretMarkerRefs(value);
|
|
6597
|
+
if (refs.length === 0) return {
|
|
6598
|
+
value,
|
|
6599
|
+
unresolved: []
|
|
6600
|
+
};
|
|
6601
|
+
const answers = await secrets.resolve(refs);
|
|
6602
|
+
const unresolved = [];
|
|
6603
|
+
for (const ref of new Set(refs)) {
|
|
6604
|
+
const answer = answers[ref];
|
|
6605
|
+
if (answer === void 0) unresolved.push({
|
|
6606
|
+
ref,
|
|
6607
|
+
reason: "not-initialized"
|
|
6608
|
+
});
|
|
6609
|
+
else if (answer.kind === "unavailable") unresolved.push({
|
|
6610
|
+
ref,
|
|
6611
|
+
reason: answer.reason
|
|
6612
|
+
});
|
|
6613
|
+
else if (answer.kind === "missing" || answer.kind === "forbidden") unresolved.push({
|
|
6614
|
+
ref,
|
|
6615
|
+
reason: answer.kind
|
|
6616
|
+
});
|
|
6617
|
+
}
|
|
6618
|
+
const substitute = (v) => {
|
|
6619
|
+
if (isSecretMarker(v)) {
|
|
6620
|
+
const answer = answers[v.$secret];
|
|
6621
|
+
return answer?.kind === "value" ? {
|
|
6622
|
+
keep: true,
|
|
6623
|
+
value: answer.value
|
|
6624
|
+
} : {
|
|
6625
|
+
keep: false,
|
|
6626
|
+
value: void 0
|
|
6627
|
+
};
|
|
6628
|
+
}
|
|
6629
|
+
if (Array.isArray(v)) {
|
|
6630
|
+
const items = [];
|
|
6631
|
+
for (const item of v) {
|
|
6632
|
+
const s = substitute(item);
|
|
6633
|
+
if (s.keep) items.push(s.value);
|
|
6634
|
+
}
|
|
6635
|
+
return {
|
|
6636
|
+
keep: true,
|
|
6637
|
+
value: items
|
|
6638
|
+
};
|
|
6639
|
+
}
|
|
6640
|
+
if (isRecord$2(v)) {
|
|
6641
|
+
const out = {};
|
|
6642
|
+
for (const [k, child] of Object.entries(v)) {
|
|
6643
|
+
const s = substitute(child);
|
|
6644
|
+
if (s.keep) out[k] = s.value;
|
|
6645
|
+
}
|
|
6646
|
+
return {
|
|
6647
|
+
keep: true,
|
|
6648
|
+
value: out
|
|
6649
|
+
};
|
|
6650
|
+
}
|
|
6651
|
+
return {
|
|
6652
|
+
keep: true,
|
|
6653
|
+
value: v
|
|
6654
|
+
};
|
|
6655
|
+
};
|
|
6656
|
+
return {
|
|
6657
|
+
value: substitute(value).value,
|
|
6658
|
+
unresolved
|
|
6659
|
+
};
|
|
6660
|
+
}
|
|
6661
|
+
function touchesTree(tree, patch) {
|
|
6662
|
+
if (tree.size === 0) return false;
|
|
6663
|
+
for (const key of Object.keys(patch)) {
|
|
6664
|
+
const at = key.indexOf("@");
|
|
6665
|
+
if (tree.has(at > 0 ? key.slice(0, at) : key)) return true;
|
|
6666
|
+
}
|
|
6667
|
+
return false;
|
|
6668
|
+
}
|
|
6669
|
+
/** The blob as stored now; a failed read REFUSES the write instead of guessing. */
|
|
6670
|
+
async function readStoredAddonBlob(raw) {
|
|
6671
|
+
const threeWay = raw.readAddonStoreResult;
|
|
6672
|
+
if (threeWay === void 0) return raw.readAddonStore();
|
|
6673
|
+
const result = await threeWay.call(raw);
|
|
6674
|
+
if (result.kind === "failed") throw new Error(`settings write refused: the stored blob could not be read (${result.error})`);
|
|
6675
|
+
return result.kind === "missing" ? {} : result.value;
|
|
6676
|
+
}
|
|
6677
|
+
function createSecretAwareSettings(raw, opts) {
|
|
6678
|
+
const chains = /* @__PURE__ */ new Map();
|
|
6679
|
+
const serialize = (key, fn) => {
|
|
6680
|
+
const next = (chains.get(key) ?? Promise.resolve()).then(fn, fn);
|
|
6681
|
+
const tail = next.catch(() => void 0);
|
|
6682
|
+
chains.set(key, tail);
|
|
6683
|
+
tail.then(() => {
|
|
6684
|
+
if (chains.get(key) === tail) chains.delete(key);
|
|
6685
|
+
});
|
|
6686
|
+
return next;
|
|
6687
|
+
};
|
|
6688
|
+
const write = async (chainKey, tree, scope, patch, readStored, rawWrite) => {
|
|
6689
|
+
if (!touchesTree(tree, patch)) return rawWrite(patch);
|
|
6690
|
+
return serialize(chainKey, async () => {
|
|
6691
|
+
const stored = await readStored();
|
|
6692
|
+
const result = await transformSecretWrite({
|
|
6693
|
+
tree,
|
|
6694
|
+
secrets: opts.secrets,
|
|
6695
|
+
patch,
|
|
6696
|
+
stored,
|
|
6697
|
+
...scope !== void 0 ? { scope } : {},
|
|
6698
|
+
operatorWrite: opts.isOperatorWrite?.() === true
|
|
6699
|
+
});
|
|
6700
|
+
if (Object.keys(result.patch).length > 0) await rawWrite(result.patch);
|
|
6701
|
+
const { orphaned } = await result.afterWrite();
|
|
6702
|
+
if (orphaned.length > 0) opts.onOrphaned(orphaned);
|
|
6703
|
+
});
|
|
6704
|
+
};
|
|
6705
|
+
const wrapped = {
|
|
6706
|
+
writeAddonStore: (patch) => write("addon", opts.addonTree(), void 0, patch, () => readStoredAddonBlob(raw), (p) => raw.writeAddonStore(p)),
|
|
6707
|
+
writeDeviceStore: (deviceId, patch) => write(`device:${deviceId}`, opts.deviceTree(), {
|
|
6708
|
+
kind: "device",
|
|
6709
|
+
deviceId
|
|
6710
|
+
}, patch, () => raw.readDeviceStore(deviceId), (p) => raw.writeDeviceStore(deviceId, p))
|
|
6711
|
+
};
|
|
6712
|
+
return new Proxy(raw, { get(target, prop, receiver) {
|
|
6713
|
+
if (prop === "writeAddonStore") return wrapped.writeAddonStore;
|
|
6714
|
+
if (prop === "writeDeviceStore") return wrapped.writeDeviceStore;
|
|
6715
|
+
const value = Reflect.get(target, prop, receiver);
|
|
6716
|
+
return typeof value === "function" ? value.bind(target) : value;
|
|
6717
|
+
} });
|
|
6718
|
+
}
|
|
6719
|
+
/** The context the addon sees: identical, except that its settings writes are secret-aware. */
|
|
6720
|
+
function withSecretAwareSettings(context, opts) {
|
|
6721
|
+
const raw = context.settings;
|
|
6722
|
+
if (raw === void 0) return context;
|
|
6723
|
+
const settings = createSecretAwareSettings(raw, opts);
|
|
6724
|
+
return new Proxy(context, { get(target, prop, receiver) {
|
|
6725
|
+
if (prop === "settings") return settings;
|
|
6726
|
+
return Reflect.get(target, prop, receiver);
|
|
6727
|
+
} });
|
|
6728
|
+
}
|
|
6729
|
+
var LEAF = { kind: "leaf" };
|
|
6730
|
+
var DEFAULT_ITEM_ID_KEY = "id";
|
|
6731
|
+
function collectFields(fields, out) {
|
|
6732
|
+
for (const field of fields) {
|
|
6733
|
+
if (field.type === "group") {
|
|
6734
|
+
collectFields(field.fields, out);
|
|
6735
|
+
continue;
|
|
6736
|
+
}
|
|
6737
|
+
if (field.type === "sub-tabs") {
|
|
6738
|
+
for (const tab of field.tabs) collectFields(tab.fields, out);
|
|
6739
|
+
continue;
|
|
6740
|
+
}
|
|
6741
|
+
if (field.type === "editable-array") {
|
|
6742
|
+
const item = /* @__PURE__ */ new Map();
|
|
6743
|
+
for (const itemField of field.itemFields) if ("key" in itemField && isKeychainStoredField(itemField)) item.set(itemField.key, LEAF);
|
|
6744
|
+
if (item.size > 0) out.set(field.key, {
|
|
6745
|
+
kind: "array",
|
|
6746
|
+
idKey: field.itemIdKey ?? DEFAULT_ITEM_ID_KEY,
|
|
6747
|
+
item
|
|
6748
|
+
});
|
|
6749
|
+
continue;
|
|
6750
|
+
}
|
|
6751
|
+
if (!("key" in field) || typeof field.key !== "string") continue;
|
|
6752
|
+
if (isKeychainStoredField(field)) out.set(field.key, LEAF);
|
|
6753
|
+
}
|
|
6754
|
+
}
|
|
6755
|
+
/** The secret tree a settings schema declares. */
|
|
6756
|
+
function secretTreeFromSchema(schema) {
|
|
6757
|
+
const out = /* @__PURE__ */ new Map();
|
|
6758
|
+
if (schema === null) return out;
|
|
6759
|
+
for (const section of schema.sections) collectFields(section.fields, out);
|
|
6760
|
+
return out;
|
|
6761
|
+
}
|
|
6762
|
+
/** Parse `a.b[id].c` into segments; throws on a malformed path (a declaration bug). */
|
|
6763
|
+
function parseSecretStatePath(path) {
|
|
6764
|
+
const segments = [];
|
|
6765
|
+
for (const raw of path.split(".")) {
|
|
6766
|
+
const m = /^([^[\]]+)(?:\[([^[\]]+)\])?$/.exec(raw);
|
|
6767
|
+
if (m === null || m[1] === void 0) throw new Error(`secretStatePaths: malformed path "${path}"`);
|
|
6768
|
+
segments.push(m[2] !== void 0 ? {
|
|
6769
|
+
key: m[1],
|
|
6770
|
+
idKey: m[2]
|
|
6771
|
+
} : { key: m[1] });
|
|
6772
|
+
}
|
|
6773
|
+
if (segments.length === 0) throw new Error(`secretStatePaths: empty path`);
|
|
6774
|
+
if (segments[segments.length - 1]?.idKey !== void 0) throw new Error(`secretStatePaths: "${path}" ends on an array — name the member that is secret`);
|
|
6775
|
+
return segments;
|
|
6776
|
+
}
|
|
6777
|
+
function insert(into, segments) {
|
|
6778
|
+
const [head, ...rest] = segments;
|
|
6779
|
+
if (head === void 0) return;
|
|
6780
|
+
if (rest.length === 0) {
|
|
6781
|
+
into.set(head.key, LEAF);
|
|
6782
|
+
return;
|
|
6783
|
+
}
|
|
6784
|
+
const existing = into.get(head.key);
|
|
6785
|
+
if (head.idKey !== void 0) {
|
|
6786
|
+
const item = new Map(existing?.kind === "array" ? existing.item : []);
|
|
6787
|
+
insert(item, rest);
|
|
6788
|
+
into.set(head.key, {
|
|
6789
|
+
kind: "array",
|
|
6790
|
+
idKey: head.idKey,
|
|
6791
|
+
item
|
|
6792
|
+
});
|
|
6793
|
+
return;
|
|
6794
|
+
}
|
|
6795
|
+
const children = new Map(existing?.kind === "object" ? existing.children : []);
|
|
6796
|
+
insert(children, rest);
|
|
6797
|
+
into.set(head.key, {
|
|
6798
|
+
kind: "object",
|
|
6799
|
+
children
|
|
6800
|
+
});
|
|
6801
|
+
}
|
|
6802
|
+
/** Add hidden-state paths (`secretStatePaths`) to a schema-derived tree. */
|
|
6803
|
+
function mergeSecretStatePaths(tree, paths) {
|
|
6804
|
+
if (paths.length === 0) return tree;
|
|
6805
|
+
const out = new Map(tree);
|
|
6806
|
+
for (const path of paths) insert(out, parseSecretStatePath(path));
|
|
6807
|
+
return out;
|
|
6808
|
+
}
|
|
6809
|
+
/** First retry of a secret the keychain could not serve; doubles to {@link SECRET_RETRY_MAX_MS}. */
|
|
6810
|
+
var SECRET_RETRY_FIRST_MS = 5e3;
|
|
6811
|
+
var SECRET_RETRY_MAX_MS = 5 * 6e4;
|
|
6812
|
+
/** Coalesces a burst of `keychain.changed` events into one re-resolve. */
|
|
6813
|
+
var SECRET_CHANGE_DEBOUNCE_MS = 250;
|
|
6278
6814
|
/**
|
|
6279
6815
|
* Base class for CamStack addons. Eliminates settings boilerplate:
|
|
6280
6816
|
*
|
|
@@ -6344,6 +6880,25 @@ var BaseAddon = class {
|
|
|
6344
6880
|
settingsStoreReady = false;
|
|
6345
6881
|
/** Default config values. Provided via constructor. */
|
|
6346
6882
|
defaults;
|
|
6883
|
+
/**
|
|
6884
|
+
* Hidden-state paths that hold secrets (D787) — values the addon writes
|
|
6885
|
+
* itself (`updateGlobalSettings`, `state()`) that no form field declares.
|
|
6886
|
+
* Stored in the keychain exactly like a `password` field. Syntax:
|
|
6887
|
+
* `'snapshotSigningKey'`, `'identity.pincode'`, `'tokens[userId].accessToken'`
|
|
6888
|
+
* (`key[<id field>]` addresses array items by id, never by index).
|
|
6889
|
+
*/
|
|
6890
|
+
secretStatePaths = [];
|
|
6891
|
+
_addonSecretTree = null;
|
|
6892
|
+
_deviceSecretTree = null;
|
|
6893
|
+
/** Refs the last resolved config pointed at — a change to one re-resolves. */
|
|
6894
|
+
_configSecretRefs = /* @__PURE__ */ new Set();
|
|
6895
|
+
_unresolvedSecrets = [];
|
|
6896
|
+
_secretRetryTimer = null;
|
|
6897
|
+
_secretRetryDelayMs = SECRET_RETRY_FIRST_MS;
|
|
6898
|
+
_secretChangeTimer = null;
|
|
6899
|
+
_secretChangeUnsub = null;
|
|
6900
|
+
/** >0 while an OPERATOR's settings write is being applied. */
|
|
6901
|
+
_operatorWriteDepth = 0;
|
|
6347
6902
|
constructor(defaults) {
|
|
6348
6903
|
this.defaults = defaults;
|
|
6349
6904
|
this._config = { ...defaults };
|
|
@@ -6379,8 +6934,18 @@ var BaseAddon = class {
|
|
|
6379
6934
|
return this._config;
|
|
6380
6935
|
}
|
|
6381
6936
|
async initialize(context) {
|
|
6382
|
-
|
|
6937
|
+
const secrets = context.secrets;
|
|
6938
|
+
this._ctx = secrets !== void 0 ? withSecretAwareSettings(context, {
|
|
6939
|
+
secrets,
|
|
6940
|
+
addonTree: () => this.addonSecretTree(),
|
|
6941
|
+
deviceTree: () => this.deviceSecretTree(),
|
|
6942
|
+
onOrphaned: (refs) => context.logger.warn("keychain refs dropped by a settings write could not be deleted", { meta: { refs: [...refs] } }),
|
|
6943
|
+
isOperatorWrite: () => this._operatorWriteDepth > 0
|
|
6944
|
+
}) : context;
|
|
6383
6945
|
await this.resolveConfig();
|
|
6946
|
+
if (secrets !== void 0) this._secretChangeUnsub = secrets.onChange((ref) => {
|
|
6947
|
+
if (this._configSecretRefs.has(ref)) this.scheduleSecretReresolve(SECRET_CHANGE_DEBOUNCE_MS);
|
|
6948
|
+
});
|
|
6384
6949
|
const result = await this.onInitialize();
|
|
6385
6950
|
this.emitLifecycle(EventCategory.AddonStarted);
|
|
6386
6951
|
const normalized = normalizeAddonInitResult(result);
|
|
@@ -6413,6 +6978,12 @@ var BaseAddon = class {
|
|
|
6413
6978
|
*/
|
|
6414
6979
|
async onHubReachable() {}
|
|
6415
6980
|
async shutdown() {
|
|
6981
|
+
this._secretChangeUnsub?.();
|
|
6982
|
+
this._secretChangeUnsub = null;
|
|
6983
|
+
if (this._secretRetryTimer !== null) clearTimeout(this._secretRetryTimer);
|
|
6984
|
+
if (this._secretChangeTimer !== null) clearTimeout(this._secretChangeTimer);
|
|
6985
|
+
this._secretRetryTimer = null;
|
|
6986
|
+
this._secretChangeTimer = null;
|
|
6416
6987
|
this.emitLifecycle(EventCategory.AddonStopped);
|
|
6417
6988
|
if (this.autoEmitReadiness) this.emitReadinessForProviders("down");
|
|
6418
6989
|
await this.onShutdown();
|
|
@@ -6491,7 +7062,7 @@ var BaseAddon = class {
|
|
|
6491
7062
|
return hydrateSchema(schema, overlay ? {
|
|
6492
7063
|
...projected,
|
|
6493
7064
|
...overlay
|
|
6494
|
-
} : projected);
|
|
7065
|
+
} : projected, { inlineSecretsAsViews: true });
|
|
6495
7066
|
}
|
|
6496
7067
|
/**
|
|
6497
7068
|
* The integration-level view of this addon's settings: exactly the sections
|
|
@@ -6540,7 +7111,7 @@ var BaseAddon = class {
|
|
|
6540
7111
|
return hydrateSchema({
|
|
6541
7112
|
...schema,
|
|
6542
7113
|
sections
|
|
6543
|
-
}, projected);
|
|
7114
|
+
}, projected, { inlineSecretsAsViews: true });
|
|
6544
7115
|
}
|
|
6545
7116
|
/**
|
|
6546
7117
|
* The raw addon store PROJECTED onto the target node's bare per-node keys:
|
|
@@ -6594,18 +7165,50 @@ var BaseAddon = class {
|
|
|
6594
7165
|
value: result.value[key]
|
|
6595
7166
|
};
|
|
6596
7167
|
}
|
|
7168
|
+
/**
|
|
7169
|
+
* The OPERATOR's write — a settings form or an admin API call, dispatched by
|
|
7170
|
+
* the kernel. Identical to {@link updateGlobalSettings}, except that a secret
|
|
7171
|
+
* the operator sends is stored as sent even when it equals a pre-keychain
|
|
7172
|
+
* inline value: the operator re-entering a password is a change, an addon
|
|
7173
|
+
* writing back what it read is not (D787).
|
|
7174
|
+
*/
|
|
7175
|
+
async updateGlobalSettingsAsOperator(patch, nodeId) {
|
|
7176
|
+
this._operatorWriteDepth++;
|
|
7177
|
+
try {
|
|
7178
|
+
await this.applyGlobalPatch(patch, nodeId);
|
|
7179
|
+
} finally {
|
|
7180
|
+
this._operatorWriteDepth--;
|
|
7181
|
+
}
|
|
7182
|
+
}
|
|
6597
7183
|
async updateGlobalSettings(patch, nodeId) {
|
|
7184
|
+
await this.applyGlobalPatch(patch, nodeId);
|
|
7185
|
+
}
|
|
7186
|
+
/**
|
|
7187
|
+
* REMOVE stored secrets — their keychain values and their markers (D787).
|
|
7188
|
+
*
|
|
7189
|
+
* Writing `''` to a secret field KEEPS what is stored (an empty string is
|
|
7190
|
+
* what a defaults fallback writes back, and it must never destroy a
|
|
7191
|
+
* credential), so code that means "forget this token" says so here. Without
|
|
7192
|
+
* a keychain (an older kernel) it writes `''`, as such code always did.
|
|
7193
|
+
*/
|
|
7194
|
+
async clearSecrets(keys, nodeId) {
|
|
7195
|
+
const tree = this.addonSecretTree();
|
|
7196
|
+
const keychain = this._ctx?.secrets !== void 0;
|
|
7197
|
+
const patch = {};
|
|
7198
|
+
for (const key of keys) patch[key] = keychain && tree.has(key) ? SECRET_CLEAR : "";
|
|
7199
|
+
await this.applyGlobalPatch(patch, nodeId);
|
|
7200
|
+
}
|
|
7201
|
+
async applyGlobalPatch(barePatch, nodeId) {
|
|
6598
7202
|
const keys = this.perNodeKeys();
|
|
6599
7203
|
const localNode = normalizeNodeId(this._ctx?.kernel?.localNodeId);
|
|
6600
7204
|
const target = normalizeNodeId(nodeId ?? this._ctx?.kernel?.localNodeId);
|
|
6601
|
-
const barePatch = patch;
|
|
6602
7205
|
const scoped = keys.size > 0 ? scopePatch(barePatch, keys, target) : barePatch;
|
|
6603
7206
|
await this._ctx?.settings?.writeAddonStore(scoped);
|
|
6604
7207
|
if (target !== localNode) return;
|
|
6605
7208
|
await this.resolveConfig();
|
|
6606
7209
|
await this.onConfigChanged();
|
|
6607
7210
|
this.emitLifecycle(EventCategory.AddonUpdated, { level: "global" });
|
|
6608
|
-
this.maybeAutoRestart(
|
|
7211
|
+
this.maybeAutoRestart(Object.keys(barePatch), this.globalSettingsSchema());
|
|
6609
7212
|
}
|
|
6610
7213
|
/**
|
|
6611
7214
|
* The set of field keys the global settings schema declares `perNode: true`
|
|
@@ -6630,7 +7233,7 @@ var BaseAddon = class {
|
|
|
6630
7233
|
* time to return its response before the addon is torn down and
|
|
6631
7234
|
* re-initialised by `AddonRegistryService.restartAddon`.
|
|
6632
7235
|
*/
|
|
6633
|
-
maybeAutoRestart(
|
|
7236
|
+
maybeAutoRestart(patchKeys, schema) {
|
|
6634
7237
|
if (!schema) return;
|
|
6635
7238
|
const restartKeys = /* @__PURE__ */ new Set();
|
|
6636
7239
|
for (const section of schema.sections) for (const field of section.fields) {
|
|
@@ -6638,13 +7241,13 @@ var BaseAddon = class {
|
|
|
6638
7241
|
if (field.requiresRestart) restartKeys.add(field.key);
|
|
6639
7242
|
}
|
|
6640
7243
|
if (restartKeys.size === 0) return;
|
|
6641
|
-
if (!
|
|
7244
|
+
if (!patchKeys.some((k) => restartKeys.has(k))) return;
|
|
6642
7245
|
const ctx = this._ctx;
|
|
6643
7246
|
if (!ctx) return;
|
|
6644
7247
|
const addonId = ctx.id;
|
|
6645
7248
|
setImmediate(() => {
|
|
6646
7249
|
ctx.api.addons?.restartAddon?.mutate({ addonId }).then(() => {
|
|
6647
|
-
ctx.logger.info("addon auto-restart triggered by restart-required setting change", { meta: { changedFields:
|
|
7250
|
+
ctx.logger.info("addon auto-restart triggered by restart-required setting change", { meta: { changedFields: patchKeys.filter((k) => restartKeys.has(k)) } });
|
|
6648
7251
|
}).catch((err) => {
|
|
6649
7252
|
ctx.logger.error("addon auto-restart failed", { meta: { error: err instanceof Error ? err.message : String(err) } });
|
|
6650
7253
|
});
|
|
@@ -6653,7 +7256,7 @@ var BaseAddon = class {
|
|
|
6653
7256
|
async getDeviceSettings(deviceId) {
|
|
6654
7257
|
const schema = this.deviceSettingsSchema();
|
|
6655
7258
|
if (!schema) return { sections: [] };
|
|
6656
|
-
return hydrateSchema(schema, await this._ctx?.settings?.readDeviceStore(deviceId) ?? {});
|
|
7259
|
+
return hydrateSchema(schema, await this._ctx?.settings?.readDeviceStore(deviceId) ?? {}, { inlineSecretsAsViews: true });
|
|
6657
7260
|
}
|
|
6658
7261
|
async updateDeviceSettings(deviceId, patch) {
|
|
6659
7262
|
await this._ctx?.settings?.writeDeviceStore(deviceId, patch);
|
|
@@ -6783,7 +7386,7 @@ var BaseAddon = class {
|
|
|
6783
7386
|
* selection at boot (absent scoped key ⇒ the constructor default wins).
|
|
6784
7387
|
*/
|
|
6785
7388
|
async resolveConfig() {
|
|
6786
|
-
const stored = await this.readAddonStoreWithRetry();
|
|
7389
|
+
const stored = await this.resolveStoredSecrets(await this.readAddonStoreWithRetry());
|
|
6787
7390
|
const perNode = this.perNodeKeys();
|
|
6788
7391
|
const localNode = normalizeNodeId(this._ctx?.kernel?.localNodeId);
|
|
6789
7392
|
const resolved = { ...this.defaults };
|
|
@@ -6808,7 +7411,7 @@ var BaseAddon = class {
|
|
|
6808
7411
|
key,
|
|
6809
7412
|
schema,
|
|
6810
7413
|
fallback,
|
|
6811
|
-
read: () => this.readAddonStoreWithRetry(),
|
|
7414
|
+
read: async () => this.resolveStoredSecrets(await this.readAddonStoreWithRetry()),
|
|
6812
7415
|
write: async (patch) => {
|
|
6813
7416
|
await this._ctx?.settings?.writeAddonStore(patch);
|
|
6814
7417
|
},
|
|
@@ -6825,7 +7428,7 @@ var BaseAddon = class {
|
|
|
6825
7428
|
key,
|
|
6826
7429
|
schema,
|
|
6827
7430
|
fallback,
|
|
6828
|
-
read: async () => await this._ctx?.settings?.readDeviceStore(deviceId) ?? {},
|
|
7431
|
+
read: async () => this.resolveStoredSecrets(await this._ctx?.settings?.readDeviceStore(deviceId) ?? {}, false),
|
|
6829
7432
|
write: async (patch) => {
|
|
6830
7433
|
await this._ctx?.settings?.writeDeviceStore(deviceId, patch);
|
|
6831
7434
|
},
|
|
@@ -6837,6 +7440,70 @@ var BaseAddon = class {
|
|
|
6837
7440
|
} })
|
|
6838
7441
|
});
|
|
6839
7442
|
}
|
|
7443
|
+
/** The addon store's secret tree: schema fields by TYPE, plus `secretStatePaths`. */
|
|
7444
|
+
addonSecretTree() {
|
|
7445
|
+
this._addonSecretTree ??= mergeSecretStatePaths(secretTreeFromSchema(this.globalSettingsSchema()), this.secretStatePaths);
|
|
7446
|
+
return this._addonSecretTree;
|
|
7447
|
+
}
|
|
7448
|
+
deviceSecretTree() {
|
|
7449
|
+
this._deviceSecretTree ??= secretTreeFromSchema(this.deviceSettingsSchema());
|
|
7450
|
+
return this._deviceSecretTree;
|
|
7451
|
+
}
|
|
7452
|
+
/**
|
|
7453
|
+
* Secrets of this addon's stored config that could not be resolved on the
|
|
7454
|
+
* last read, with why. Non-empty means the addon is running WITHOUT them —
|
|
7455
|
+
* an addon whose function needs one should report itself degraded rather
|
|
7456
|
+
* than start on an empty credential.
|
|
7457
|
+
*/
|
|
7458
|
+
get unresolvedSecrets() {
|
|
7459
|
+
return this._unresolvedSecrets;
|
|
7460
|
+
}
|
|
7461
|
+
/**
|
|
7462
|
+
* Substitute every keychain marker in a stored blob with its value. With no
|
|
7463
|
+
* keychain (no `ctx.secrets`) or no marker, the blob comes back unchanged.
|
|
7464
|
+
* An unresolvable value is LEFT OUT (never `''`), logged by ref — never by
|
|
7465
|
+
* value — and, when the cause can pass, retried with backoff. Nothing is
|
|
7466
|
+
* ever written back from here.
|
|
7467
|
+
*/
|
|
7468
|
+
async resolveStoredSecrets(blob, trackForConfig = true) {
|
|
7469
|
+
const secrets = this._ctx?.secrets;
|
|
7470
|
+
if (secrets === void 0) return blob;
|
|
7471
|
+
const refs = collectSecretMarkerRefs(blob);
|
|
7472
|
+
if (trackForConfig) this._configSecretRefs = new Set(refs);
|
|
7473
|
+
if (refs.length === 0) {
|
|
7474
|
+
if (trackForConfig) this._unresolvedSecrets = [];
|
|
7475
|
+
return blob;
|
|
7476
|
+
}
|
|
7477
|
+
const { value, unresolved } = await resolveSecretMarkers(blob, secrets);
|
|
7478
|
+
if (trackForConfig) {
|
|
7479
|
+
this._unresolvedSecrets = unresolved;
|
|
7480
|
+
if (unresolved.length > 0) {
|
|
7481
|
+
this._ctx?.logger?.error?.("secret unavailable — running without it, will retry", { meta: { secrets: unresolved.map((u) => ({
|
|
7482
|
+
ref: u.ref,
|
|
7483
|
+
reason: u.reason
|
|
7484
|
+
})) } });
|
|
7485
|
+
if (unresolved.some((u) => u.reason !== "missing" && u.reason !== "forbidden")) {
|
|
7486
|
+
this.scheduleSecretReresolve(this._secretRetryDelayMs);
|
|
7487
|
+
this._secretRetryDelayMs = Math.min(this._secretRetryDelayMs * 2, SECRET_RETRY_MAX_MS);
|
|
7488
|
+
}
|
|
7489
|
+
} else this._secretRetryDelayMs = SECRET_RETRY_FIRST_MS;
|
|
7490
|
+
}
|
|
7491
|
+
return value;
|
|
7492
|
+
}
|
|
7493
|
+
/** Re-resolve the config (a keychain-only change, or a retry) and apply it. */
|
|
7494
|
+
scheduleSecretReresolve(delayMs) {
|
|
7495
|
+
const timerOf = delayMs === SECRET_CHANGE_DEBOUNCE_MS ? "_secretChangeTimer" : "_secretRetryTimer";
|
|
7496
|
+
if (this[timerOf] !== null) return;
|
|
7497
|
+
const timer = setTimeout(() => {
|
|
7498
|
+
this[timerOf] = null;
|
|
7499
|
+
if (this._ctx === null) return;
|
|
7500
|
+
this.resolveConfig().then(() => this.onConfigChanged()).catch((err) => {
|
|
7501
|
+
this._ctx?.logger?.error?.("re-resolving secrets failed", { meta: { error: err instanceof Error ? err.message : String(err) } });
|
|
7502
|
+
});
|
|
7503
|
+
}, delayMs);
|
|
7504
|
+
timer.unref?.();
|
|
7505
|
+
this[timerOf] = timer;
|
|
7506
|
+
}
|
|
6840
7507
|
/**
|
|
6841
7508
|
* Wrap `ctx.settings.readAddonStore()` with a short retry budget so a
|
|
6842
7509
|
* transient settings-store outage (mid-restart of sqlite-settings, tsx-watch
|
|
@@ -14579,6 +15246,196 @@ id: union([string(), number()]) }), {
|
|
|
14579
15246
|
kind: "mutation",
|
|
14580
15247
|
auth: "admin"
|
|
14581
15248
|
});
|
|
15249
|
+
/**
|
|
15250
|
+
* `keychain` — the hub's encrypted store of secret values (D787).
|
|
15251
|
+
*
|
|
15252
|
+
* Settings blobs never hold a secret: they hold a marker
|
|
15253
|
+
* `{"$secret":"secret://<owner>/<scope>/<fieldPath>","v":1}` and the value
|
|
15254
|
+
* lives here, AES-256-GCM under a data key that a master key wraps. This cap
|
|
15255
|
+
* is the OWNER's door to its own values: every method is owner-checked
|
|
15256
|
+
* against the CALLER, never against anything the caller claims.
|
|
15257
|
+
*
|
|
15258
|
+
* Who the caller is: the transport stamps `callerAddonId` into the args of a
|
|
15259
|
+
* call that crossed a process (the parent `LocalChildRegistry` from the UDS
|
|
15260
|
+
* connection, the agent from its child's connection carried in
|
|
15261
|
+
* `$hub-cap-fwd`'s envelope). A stamp always overwrites; a wire call with no
|
|
15262
|
+
* stamp has its claim stripped. Only a hub in-process caller may state its own
|
|
15263
|
+
* identity — `ctx.secrets` does that with the addon id closed over. This is
|
|
15264
|
+
* identity against BUGS and misrouting, not against a malicious addon (every
|
|
15265
|
+
* runner is the same OS user): see the threat model in
|
|
15266
|
+
* `docs/design/2026-10-08-secrets-keychain.md`.
|
|
15267
|
+
*
|
|
15268
|
+
* `callerAddonId` is deliberately NOT in any input schema: the tRPC router
|
|
15269
|
+
* parses the input, so a session can never supply it, and the internal mount
|
|
15270
|
+
* floors every method to admin anyway (D240).
|
|
15271
|
+
*
|
|
15272
|
+
* Internal: addons reach it through `ctx.secrets`, never directly.
|
|
15273
|
+
*/
|
|
15274
|
+
/** Why a value cannot be served right now. Never folded into "missing". */
|
|
15275
|
+
var KeychainUnavailableReasonSchema = _enum([
|
|
15276
|
+
"key-missing",
|
|
15277
|
+
"wrong-key",
|
|
15278
|
+
"key-file-unreadable",
|
|
15279
|
+
"store-unavailable",
|
|
15280
|
+
"not-initialized",
|
|
15281
|
+
"decrypt-failed"
|
|
15282
|
+
]);
|
|
15283
|
+
var KeychainStateSchema = discriminatedUnion("state", [object({ state: literal("ready") }), object({
|
|
15284
|
+
state: literal("locked"),
|
|
15285
|
+
reason: KeychainUnavailableReasonSchema
|
|
15286
|
+
})]);
|
|
15287
|
+
var KeychainResolveEntrySchema = discriminatedUnion("kind", [
|
|
15288
|
+
object({
|
|
15289
|
+
kind: literal("value"),
|
|
15290
|
+
value: string(),
|
|
15291
|
+
version: number().int()
|
|
15292
|
+
}),
|
|
15293
|
+
object({ kind: literal("missing") }),
|
|
15294
|
+
object({
|
|
15295
|
+
kind: literal("unavailable"),
|
|
15296
|
+
reason: KeychainUnavailableReasonSchema
|
|
15297
|
+
}),
|
|
15298
|
+
object({ kind: literal("forbidden") })
|
|
15299
|
+
]);
|
|
15300
|
+
var KeychainResolveResultSchema = record(string(), KeychainResolveEntrySchema);
|
|
15301
|
+
/** Metadata of one stored value — never the value. */
|
|
15302
|
+
var KeychainSecretMetaSchema = object({
|
|
15303
|
+
ref: string(),
|
|
15304
|
+
owner: string(),
|
|
15305
|
+
/** Formatted scope (`global`, `node/<id>`, `device/<id>`, …). */
|
|
15306
|
+
scope: string(),
|
|
15307
|
+
fieldPath: string(),
|
|
15308
|
+
version: number().int(),
|
|
15309
|
+
createdAt: number(),
|
|
15310
|
+
updatedAt: number(),
|
|
15311
|
+
/** `addon:<id>` | `user:<id>` | `system`. */
|
|
15312
|
+
updatedBy: string(),
|
|
15313
|
+
/** Coarse — written at most once an hour per ref. `null` = never read. */
|
|
15314
|
+
lastReadAt: number().nullable()
|
|
15315
|
+
});
|
|
15316
|
+
var RefListSchema = array(string().min(1)).max(512);
|
|
15317
|
+
method(object({
|
|
15318
|
+
ref: string().min(1),
|
|
15319
|
+
value: string().min(1)
|
|
15320
|
+
}), object({
|
|
15321
|
+
ref: string(),
|
|
15322
|
+
version: number().int()
|
|
15323
|
+
}), {
|
|
15324
|
+
kind: "mutation",
|
|
15325
|
+
auth: "admin"
|
|
15326
|
+
}), method(object({ refs: RefListSchema }), KeychainResolveResultSchema, { auth: "admin" }), method(object({ refs: RefListSchema }), object({ deleted: number().int() }), {
|
|
15327
|
+
kind: "mutation",
|
|
15328
|
+
auth: "admin"
|
|
15329
|
+
}), method(object({}), array(KeychainSecretMetaSchema).readonly(), { auth: "admin" }), method(object({}), KeychainStateSchema, { auth: "admin" });
|
|
15330
|
+
var KeychainKeySourceSchema = object({
|
|
15331
|
+
kind: _enum([
|
|
15332
|
+
"config-file",
|
|
15333
|
+
"previous-config-file",
|
|
15334
|
+
"platform",
|
|
15335
|
+
"default-file"
|
|
15336
|
+
]),
|
|
15337
|
+
/** File sources only — a path is not a secret. */
|
|
15338
|
+
path: string().optional(),
|
|
15339
|
+
/**
|
|
15340
|
+
* True when a whole-volume backup of the data directory carries this key
|
|
15341
|
+
* next to the database it protects (the default file). The page warns.
|
|
15342
|
+
*/
|
|
15343
|
+
sharesBackupWithDatabase: boolean()
|
|
15344
|
+
});
|
|
15345
|
+
var KeychainStatusSchema = object({
|
|
15346
|
+
keychain: KeychainStateSchema,
|
|
15347
|
+
/** The source of the master key in use; `null` while locked. */
|
|
15348
|
+
keySource: KeychainKeySourceSchema.nullable(),
|
|
15349
|
+
/** The source configured to be primary — differs from `keySource` while a rotation is pending. */
|
|
15350
|
+
configuredSource: KeychainKeySourceSchema,
|
|
15351
|
+
/** Short fingerprint of the master key in use (`HMAC(KEK, label)`, 16 hex). */
|
|
15352
|
+
fingerprint: string().nullable(),
|
|
15353
|
+
activeKeyId: string().nullable(),
|
|
15354
|
+
/**
|
|
15355
|
+
* The keychain unlocked with a NON-primary source: the configured primary
|
|
15356
|
+
* key is not the one that wraps the data key yet. `rotateMasterKey` moves it.
|
|
15357
|
+
*/
|
|
15358
|
+
rotationPending: boolean(),
|
|
15359
|
+
/** Wrapped copies of the data key under a previous master key, kept until purged. */
|
|
15360
|
+
retiredWraps: number().int(),
|
|
15361
|
+
recoveryKeyDownloadedAt: number().nullable(),
|
|
15362
|
+
secretCount: number().int()
|
|
15363
|
+
});
|
|
15364
|
+
/**
|
|
15365
|
+
* Whether a stored value is still pointed at by its owner's settings.
|
|
15366
|
+
* `unknown` is a first-class answer: a scope whose blob could not be read is
|
|
15367
|
+
* never reported as an orphan (and never deleted as one).
|
|
15368
|
+
*/
|
|
15369
|
+
var KeychainSecretUsageSchema = _enum([
|
|
15370
|
+
"in-use",
|
|
15371
|
+
"orphan",
|
|
15372
|
+
"unknown"
|
|
15373
|
+
]);
|
|
15374
|
+
var KeychainAdminSecretSchema = KeychainSecretMetaSchema.extend({ usage: KeychainSecretUsageSchema });
|
|
15375
|
+
var KeychainAuditActionSchema = _enum([
|
|
15376
|
+
"put",
|
|
15377
|
+
"delete",
|
|
15378
|
+
"reveal",
|
|
15379
|
+
"rotate-master-key",
|
|
15380
|
+
"purge-retired-keys",
|
|
15381
|
+
"download-recovery-key",
|
|
15382
|
+
"delete-orphans",
|
|
15383
|
+
"reset",
|
|
15384
|
+
"initialize"
|
|
15385
|
+
]);
|
|
15386
|
+
var KeychainAuditEntrySchema = object({
|
|
15387
|
+
id: string(),
|
|
15388
|
+
at: number(),
|
|
15389
|
+
action: KeychainAuditActionSchema,
|
|
15390
|
+
/** `addon:<id>` | `user:<id>` | `system`. */
|
|
15391
|
+
actor: string(),
|
|
15392
|
+
ref: string().nullable(),
|
|
15393
|
+
detail: string().nullable()
|
|
15394
|
+
});
|
|
15395
|
+
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({
|
|
15396
|
+
value: string(),
|
|
15397
|
+
version: number().int()
|
|
15398
|
+
}), {
|
|
15399
|
+
kind: "mutation",
|
|
15400
|
+
auth: "admin",
|
|
15401
|
+
caller: "required"
|
|
15402
|
+
}), method(object({ refs: array(string().min(1)).max(1e3) }), object({
|
|
15403
|
+
deleted: array(string()).readonly(),
|
|
15404
|
+
kept: array(object({
|
|
15405
|
+
ref: string(),
|
|
15406
|
+
usage: KeychainSecretUsageSchema
|
|
15407
|
+
})).readonly()
|
|
15408
|
+
}), {
|
|
15409
|
+
kind: "mutation",
|
|
15410
|
+
auth: "admin",
|
|
15411
|
+
caller: "required"
|
|
15412
|
+
}), method(object({}), object({
|
|
15413
|
+
fingerprint: string(),
|
|
15414
|
+
keySource: KeychainKeySourceSchema
|
|
15415
|
+
}), {
|
|
15416
|
+
kind: "mutation",
|
|
15417
|
+
auth: "admin",
|
|
15418
|
+
caller: "required"
|
|
15419
|
+
}), method(object({}), object({ purged: number().int() }), {
|
|
15420
|
+
kind: "mutation",
|
|
15421
|
+
auth: "admin",
|
|
15422
|
+
caller: "required"
|
|
15423
|
+
}), method(object({}), object({
|
|
15424
|
+
key: string(),
|
|
15425
|
+
fingerprint: string(),
|
|
15426
|
+
keySource: KeychainKeySourceSchema
|
|
15427
|
+
}), {
|
|
15428
|
+
kind: "mutation",
|
|
15429
|
+
auth: "admin",
|
|
15430
|
+
caller: "required"
|
|
15431
|
+
}), method(object({ confirm: literal("RESET KEYCHAIN") }), object({
|
|
15432
|
+
archivedCollection: string().nullable(),
|
|
15433
|
+
archived: number().int()
|
|
15434
|
+
}), {
|
|
15435
|
+
kind: "mutation",
|
|
15436
|
+
auth: "admin",
|
|
15437
|
+
caller: "required"
|
|
15438
|
+
});
|
|
14582
15439
|
method(_void(), object({
|
|
14583
15440
|
id: string(),
|
|
14584
15441
|
name: string(),
|
|
@@ -15396,6 +16253,10 @@ var DeviceInfoSchema = object({
|
|
|
15396
16253
|
isCamera: boolean(),
|
|
15397
16254
|
/** Current config values — serializable snapshot */
|
|
15398
16255
|
config: record(string(), unknown()),
|
|
16256
|
+
/** Paths inside `config` the device's schema declares secret (D783) —
|
|
16257
|
+
* what the non-admin redaction withholds. Paths, never values. Absent
|
|
16258
|
+
* when the owning runner has not reported them. */
|
|
16259
|
+
secretConfigPaths: array(string()).optional(),
|
|
15399
16260
|
/** Hardware + identity blob (manufacturer / model / firmware / sn /
|
|
15400
16261
|
* uid / mac / …). Populated by drivers; editable via setMetadata. */
|
|
15401
16262
|
metadata: record(string(), unknown()).nullable().optional(),
|
|
@@ -15601,12 +16462,22 @@ var DeviceRegisterPayloadSchema = object({
|
|
|
15601
16462
|
* call (workers re-register on init), so probe-driven updates
|
|
15602
16463
|
* (e.g. PTZ flag flipping after the abilities probe) propagate. */
|
|
15603
16464
|
features: array(string()).optional(),
|
|
15604
|
-
config: record(string(), unknown())
|
|
16465
|
+
config: record(string(), unknown()),
|
|
16466
|
+
/** Config paths the device's own schema DECLARES secret
|
|
16467
|
+
* (`.meta({ secret: true })` — dotted, `[]` for array items, e.g.
|
|
16468
|
+
* `connection.password`). Re-published on every register; the non-admin
|
|
16469
|
+
* redaction withholds them at any depth (D783). Optional: an older runner
|
|
16470
|
+
* omits it and the keyword backstop applies. */
|
|
16471
|
+
secretConfigPaths: array(string()).optional()
|
|
15605
16472
|
});
|
|
15606
16473
|
var DeviceRemovePayloadSchema = object({ deviceId: number() });
|
|
15607
16474
|
var DevicePersistConfigPayloadSchema = object({
|
|
15608
16475
|
deviceId: number(),
|
|
15609
|
-
data: record(string(), unknown())
|
|
16476
|
+
data: record(string(), unknown()),
|
|
16477
|
+
/** The paths the device's schema declares secret (D783), when the caller
|
|
16478
|
+
* knows them — those values are kept in the keychain, not the blob (D787).
|
|
16479
|
+
* Absent: the paths the device last reported at `registerDevice` apply. */
|
|
16480
|
+
secretConfigPaths: array(string()).optional()
|
|
15610
16481
|
});
|
|
15611
16482
|
/** What a migration actually did, per switch. `unreachable` is a first-class
|
|
15612
16483
|
* answer: a camera that could not be asked is not a camera that was silenced. */
|
|
@@ -17260,7 +18131,14 @@ var LoginMethodContributionSchema = discriminatedUnion("kind", [
|
|
|
17260
18131
|
icon: string().optional(),
|
|
17261
18132
|
/** Addon-owned HTTP route the button navigates to (GET). */
|
|
17262
18133
|
startUrl: string(),
|
|
17263
|
-
stage: LoginStageEnum
|
|
18134
|
+
stage: LoginStageEnum,
|
|
18135
|
+
/**
|
|
18136
|
+
* The provider names an external identity a signed-in user can link to
|
|
18137
|
+
* their own account (D782): `auth.listLinkableProviders` /
|
|
18138
|
+
* `beginExternalLink` offer exactly the redirect methods that set this,
|
|
18139
|
+
* whatever their id. Absent / false — a login button only (magic-link).
|
|
18140
|
+
*/
|
|
18141
|
+
linkable: boolean().optional()
|
|
17264
18142
|
}),
|
|
17265
18143
|
object({
|
|
17266
18144
|
kind: literal("widget"),
|
|
@@ -22584,8 +23462,23 @@ var RetrainMacroClassSchema = _enum([
|
|
|
22584
23462
|
]);
|
|
22585
23463
|
/** A subject to learn, or a phantom to unlearn (taught by OMISSION). */
|
|
22586
23464
|
var RetrainAnnotationKindSchema = _enum(["subject", "model_error"]);
|
|
22587
|
-
/**
|
|
22588
|
-
|
|
23465
|
+
/**
|
|
23466
|
+
* Where a box came from. A machine-sourced box is a DRAFT on the page until
|
|
23467
|
+
* the operator confirms it; once saved it keeps its source as provenance.
|
|
23468
|
+
*
|
|
23469
|
+
* - `operator` — drawn by hand.
|
|
23470
|
+
* - `assist` — proposed by a detector run on the copy (the camera's own
|
|
23471
|
+
* model, or a larger teacher model).
|
|
23472
|
+
* - `pipeline` — the box the live pipeline actually drew on that frame, read
|
|
23473
|
+
* back from the track store (never a re-run).
|
|
23474
|
+
* - `llm` — proposed by a vision-capable LLM profile.
|
|
23475
|
+
*/
|
|
23476
|
+
var RetrainAnnotationSourceSchema = _enum([
|
|
23477
|
+
"operator",
|
|
23478
|
+
"assist",
|
|
23479
|
+
"pipeline",
|
|
23480
|
+
"llm"
|
|
23481
|
+
]);
|
|
22589
23482
|
/** Normalised `[0,1]` rectangle against the FULL frame — the canonical form. */
|
|
22590
23483
|
var RetrainBboxSchema = object({
|
|
22591
23484
|
x: number(),
|
|
@@ -22603,7 +23496,8 @@ var RetrainBboxSchema = object({
|
|
|
22603
23496
|
*/
|
|
22604
23497
|
var RetrainAnnotationSchema = object({
|
|
22605
23498
|
id: string(),
|
|
22606
|
-
|
|
23499
|
+
/** The frame's track. Absent on a recording still, which has none. */
|
|
23500
|
+
trackId: string().optional(),
|
|
22607
23501
|
deviceId: number(),
|
|
22608
23502
|
/** The COPY in retrain storage — never the source track's media key. */
|
|
22609
23503
|
mediaKey: string(),
|
|
@@ -22652,18 +23546,63 @@ var RetrainFrameCandidateSchema = object({
|
|
|
22652
23546
|
* fail, whatever became of the original. */
|
|
22653
23547
|
copied: boolean()
|
|
22654
23548
|
});
|
|
23549
|
+
/**
|
|
23550
|
+
* One box the live pipeline drew on a copied frame — what a correction starts
|
|
23551
|
+
* from. Derived when the frame is listed, from the track store: the subject
|
|
23552
|
+
* box recorded on the source media row when there is one, else the track
|
|
23553
|
+
* position nearest the frame's capture time. Never stored as an annotation
|
|
23554
|
+
* until the operator confirms it.
|
|
23555
|
+
*/
|
|
23556
|
+
var RetrainPipelineBoxSchema = object({
|
|
23557
|
+
/** Normalised `[0,1]` against the full frame. */
|
|
23558
|
+
bbox: RetrainBboxSchema,
|
|
23559
|
+
macroClass: RetrainMacroClassSchema,
|
|
23560
|
+
label: string().optional(),
|
|
23561
|
+
subLabel: string().optional(),
|
|
23562
|
+
/** The detection score of the position used, when it was recorded. */
|
|
23563
|
+
score: number().optional(),
|
|
23564
|
+
/** The root model that produced the track, when it was recorded. */
|
|
23565
|
+
modelId: string().optional(),
|
|
23566
|
+
trackId: string(),
|
|
23567
|
+
/** `subject-box`: recorded on this very frame. `position`: the track's
|
|
23568
|
+
* position nearest the capture time, `deltaMs` away. */
|
|
23569
|
+
basis: _enum(["subject-box", "position"]),
|
|
23570
|
+
deltaMs: number()
|
|
23571
|
+
});
|
|
23572
|
+
/**
|
|
23573
|
+
* Where a retrain frame came from: a TRACK's stored media (copy-on-select),
|
|
23574
|
+
* or the RECORDING at an instant — the frame a model saw nothing in has no
|
|
23575
|
+
* track at all.
|
|
23576
|
+
*/
|
|
23577
|
+
var RetrainFrameOriginSchema = _enum(["track", "recording"]);
|
|
22655
23578
|
/** A frame the dataset OWNS: bytes copied at selection time. */
|
|
22656
23579
|
var RetrainFrameSchema = object({
|
|
22657
23580
|
frameId: string(),
|
|
22658
23581
|
deviceId: number(),
|
|
22659
|
-
|
|
22660
|
-
/**
|
|
22661
|
-
|
|
23582
|
+
origin: RetrainFrameOriginSchema,
|
|
23583
|
+
/** The track it was copied from. Absent on a recording still. */
|
|
23584
|
+
trackId: string().optional(),
|
|
23585
|
+
/** Provenance only. It may already point at nothing — that is expected.
|
|
23586
|
+
* Absent on a recording still. */
|
|
23587
|
+
sourceMediaId: number().int().optional(),
|
|
23588
|
+
/** A recording still: the playhead instant it was taken at. */
|
|
23589
|
+
epochMs: number().optional(),
|
|
22662
23590
|
sourceKind: MediaFileKindEnum,
|
|
22663
23591
|
sizeBytes: number().int(),
|
|
22664
23592
|
width: number().int(),
|
|
22665
23593
|
height: number().int(),
|
|
22666
|
-
copiedAt: number()
|
|
23594
|
+
copiedAt: number(),
|
|
23595
|
+
/** When the CAMERA captured the frame. Absent on a copy taken before D785. */
|
|
23596
|
+
capturedAt: number().optional(),
|
|
23597
|
+
/** The operator's "every subject in this frame is boxed". Detector
|
|
23598
|
+
* evaluation keeps only complete frames: an unboxed subject would count as
|
|
23599
|
+
* a false positive. */
|
|
23600
|
+
complete: boolean(),
|
|
23601
|
+
/** The boxes the pipeline drew on this frame. Present on list answers;
|
|
23602
|
+
* empty when nothing the track store holds can be placed on it. */
|
|
23603
|
+
pipelineBoxes: array(RetrainPipelineBoxSchema).readonly().optional(),
|
|
23604
|
+
/** The named collections this frame belongs to. Present on list answers. */
|
|
23605
|
+
collectionIds: array(string()).readonly().optional()
|
|
22667
23606
|
});
|
|
22668
23607
|
/** Why a copy-on-select could not be honoured — named, never a silent skip. */
|
|
22669
23608
|
var RetrainCopyRefusalSchema = _enum([
|
|
@@ -22684,6 +23623,53 @@ var RetrainFrameListSchema = object({
|
|
|
22684
23623
|
/** What the page pre-selects — the native key frame when one survives. */
|
|
22685
23624
|
autoPickMediaId: number().int().optional()
|
|
22686
23625
|
});
|
|
23626
|
+
/**
|
|
23627
|
+
* Which frames an annotated export carries. Every field narrows; an empty
|
|
23628
|
+
* filter is every annotated copy. A dataset VERSION is a frozen `frameIds`
|
|
23629
|
+
* list owned by whoever trains (the training orchestrator), so `frameIds` is
|
|
23630
|
+
* the primitive a version export uses; `batchId` re-selects what an earlier
|
|
23631
|
+
* export carried (`exportedInBatch`).
|
|
23632
|
+
*/
|
|
23633
|
+
var RetrainExportFilterSchema = object({
|
|
23634
|
+
deviceIds: array(number()).optional(),
|
|
23635
|
+
frameIds: array(string()).max(2e4).optional(),
|
|
23636
|
+
/** Only frames in at least one of these named collections. */
|
|
23637
|
+
collectionIds: array(string()).max(200).optional(),
|
|
23638
|
+
batchId: string().optional(),
|
|
23639
|
+
/** Only frames the operator marked complete (all subjects boxed). */
|
|
23640
|
+
completeOnly: boolean().optional()
|
|
23641
|
+
});
|
|
23642
|
+
/**
|
|
23643
|
+
* `frames`: the full frame copies, boxes in `annotations.json`.
|
|
23644
|
+
* `crops`: additionally one JPEG per subject, cut with the runtime detail-crop
|
|
23645
|
+
* convention — the classifier layout.
|
|
23646
|
+
*/
|
|
23647
|
+
var RetrainExportLayoutSchema = _enum(["frames", "crops"]);
|
|
23648
|
+
/**
|
|
23649
|
+
* Where `writeRetrainArchive` streams the tar: one HTTP request whose body is
|
|
23650
|
+
* the archive, sent chunk by chunk. Covers a presigned PUT and a provider
|
|
23651
|
+
* addon's data-plane upload route alike. Headers are sent verbatim and never
|
|
23652
|
+
* logged.
|
|
23653
|
+
*/
|
|
23654
|
+
var RetrainArchiveTargetSchema = object({
|
|
23655
|
+
kind: literal("http"),
|
|
23656
|
+
method: _enum(["PUT", "POST"]),
|
|
23657
|
+
url: string().url(),
|
|
23658
|
+
headers: record(string(), string()).optional()
|
|
23659
|
+
});
|
|
23660
|
+
var RetrainArchiveResultSchema = object({
|
|
23661
|
+
batchId: string(),
|
|
23662
|
+
frames: number().int(),
|
|
23663
|
+
crops: number().int(),
|
|
23664
|
+
annotations: number().int(),
|
|
23665
|
+
/** Frames planned but not shipped (unreadable copy, path too long). */
|
|
23666
|
+
missing: number().int(),
|
|
23667
|
+
bytes: number().int(),
|
|
23668
|
+
/** sha256 of the exact bytes sent. */
|
|
23669
|
+
sha256: string(),
|
|
23670
|
+
/** The target's HTTP status. */
|
|
23671
|
+
status: number().int()
|
|
23672
|
+
});
|
|
22687
23673
|
/** What the operator asked the assist to look for. */
|
|
22688
23674
|
var RetrainAssistSubjectSchema = discriminatedUnion("kind", [object({
|
|
22689
23675
|
kind: literal("package"),
|
|
@@ -22713,6 +23699,109 @@ var RetrainAssistResultSchema = discriminatedUnion("kind", [object({
|
|
|
22713
23699
|
reason: string(),
|
|
22714
23700
|
detail: string().optional()
|
|
22715
23701
|
})]);
|
|
23702
|
+
/** A named set over the retrain corpus — membership only, it owns no pixels. */
|
|
23703
|
+
var RetrainCollectionSchema = object({
|
|
23704
|
+
id: string(),
|
|
23705
|
+
name: string(),
|
|
23706
|
+
createdAt: number(),
|
|
23707
|
+
frameCount: number().int()
|
|
23708
|
+
});
|
|
23709
|
+
var RetrainCollectionCreateResultSchema = discriminatedUnion("kind", [object({
|
|
23710
|
+
kind: literal("created"),
|
|
23711
|
+
collection: RetrainCollectionSchema
|
|
23712
|
+
}), object({
|
|
23713
|
+
kind: literal("refused"),
|
|
23714
|
+
reason: _enum(["empty-name", "duplicate-name"])
|
|
23715
|
+
})]);
|
|
23716
|
+
var RetrainCollectionRenameResultSchema = discriminatedUnion("kind", [object({
|
|
23717
|
+
kind: literal("renamed"),
|
|
23718
|
+
collection: RetrainCollectionSchema
|
|
23719
|
+
}), object({
|
|
23720
|
+
kind: literal("refused"),
|
|
23721
|
+
reason: _enum([
|
|
23722
|
+
"empty-name",
|
|
23723
|
+
"duplicate-name",
|
|
23724
|
+
"unknown-collection"
|
|
23725
|
+
])
|
|
23726
|
+
})]);
|
|
23727
|
+
/**
|
|
23728
|
+
* The outcome of adding the frame at a recording instant. Every refusal is
|
|
23729
|
+
* named: `still-unavailable` (not recording, a gap, or an undecodable frame —
|
|
23730
|
+
* `detail` says which), `still-busy` (the recorder is at its decode bound; try
|
|
23731
|
+
* again), `unreadable-image`, `write-failed`, `unknown-collection`.
|
|
23732
|
+
*/
|
|
23733
|
+
var AddRetrainFrameFromRecordingResultSchema = discriminatedUnion("kind", [object({
|
|
23734
|
+
kind: literal("added"),
|
|
23735
|
+
collectionId: string(),
|
|
23736
|
+
frame: RetrainFrameSchema,
|
|
23737
|
+
/** The moment was already in the dataset; nothing was decoded. */
|
|
23738
|
+
reused: boolean()
|
|
23739
|
+
}), object({
|
|
23740
|
+
kind: literal("refused"),
|
|
23741
|
+
reason: _enum([
|
|
23742
|
+
"unknown-collection",
|
|
23743
|
+
"still-unavailable",
|
|
23744
|
+
"still-busy",
|
|
23745
|
+
"unreadable-image",
|
|
23746
|
+
"write-failed"
|
|
23747
|
+
]),
|
|
23748
|
+
detail: string().optional()
|
|
23749
|
+
})]);
|
|
23750
|
+
/** A vision LLM profile the AI assist may use, and where it sends the frame. */
|
|
23751
|
+
var RetrainAssistProfileSchema = object({
|
|
23752
|
+
id: string(),
|
|
23753
|
+
name: string(),
|
|
23754
|
+
model: string(),
|
|
23755
|
+
kind: string(),
|
|
23756
|
+
/** `true` when the frame would leave the house (a cloud vendor, or an
|
|
23757
|
+
* endpoint that is not on the local network). The page confirms each such
|
|
23758
|
+
* run, and the provider refuses one without `allowCloud`. */
|
|
23759
|
+
leavesHouse: boolean()
|
|
23760
|
+
});
|
|
23761
|
+
/** A box the AI assist proposed: a draft, plus the model's own reason. */
|
|
23762
|
+
var RetrainLlmProposalSchema = RetrainAnnotationDraftSchema.extend({ reason: string() });
|
|
23763
|
+
/** What the AI assist said about a box that was already on the canvas. */
|
|
23764
|
+
var RetrainLlmReviewSchema = object({
|
|
23765
|
+
/** The `ref` the page sent the box under. */
|
|
23766
|
+
ref: string(),
|
|
23767
|
+
verdict: _enum([
|
|
23768
|
+
"confirmed",
|
|
23769
|
+
"wrong-class",
|
|
23770
|
+
"not-an-object",
|
|
23771
|
+
"uncertain"
|
|
23772
|
+
]),
|
|
23773
|
+
suggestedClass: RetrainMacroClassSchema.optional(),
|
|
23774
|
+
reason: string()
|
|
23775
|
+
});
|
|
23776
|
+
/**
|
|
23777
|
+
* The AI assist's answer. `proposed` carries drafts (`source: 'llm'`, the
|
|
23778
|
+
* model and its confidence) and reviews; items the model got wrong (a box off
|
|
23779
|
+
* the frame, an unasked class, an unknown ref) are dropped and counted in
|
|
23780
|
+
* `rejected`. A whole answer that is not the schema is `malformed-answer`.
|
|
23781
|
+
*/
|
|
23782
|
+
var RetrainLlmAssistResultSchema = discriminatedUnion("kind", [object({
|
|
23783
|
+
kind: literal("proposed"),
|
|
23784
|
+
profileId: string(),
|
|
23785
|
+
model: string(),
|
|
23786
|
+
/** The frame was sent outside the house for this answer. */
|
|
23787
|
+
leftHouse: boolean(),
|
|
23788
|
+
proposals: array(RetrainLlmProposalSchema).readonly(),
|
|
23789
|
+
reviews: array(RetrainLlmReviewSchema).readonly(),
|
|
23790
|
+
rejected: number().int()
|
|
23791
|
+
}), object({
|
|
23792
|
+
kind: literal("refused"),
|
|
23793
|
+
reason: _enum([
|
|
23794
|
+
"unknown-frame",
|
|
23795
|
+
"unreadable-frame",
|
|
23796
|
+
"unknown-profile",
|
|
23797
|
+
"profile-disabled",
|
|
23798
|
+
"no-vision",
|
|
23799
|
+
"cloud-not-confirmed",
|
|
23800
|
+
"llm-error",
|
|
23801
|
+
"malformed-answer"
|
|
23802
|
+
]),
|
|
23803
|
+
detail: string().optional()
|
|
23804
|
+
})]);
|
|
22716
23805
|
/** The outcome of a lifecycle move owned by the retrain page. */
|
|
22717
23806
|
var RetrainTransitionResultSchema = object({
|
|
22718
23807
|
trackId: string(),
|
|
@@ -23430,7 +24519,7 @@ DeviceType.Camera, method(object({ deviceId: number() }), array(TrackSchema).rea
|
|
|
23430
24519
|
auth: "admin"
|
|
23431
24520
|
}), method(object({
|
|
23432
24521
|
deviceId: number(),
|
|
23433
|
-
trackId: string(),
|
|
24522
|
+
trackId: string().optional(),
|
|
23434
24523
|
frameId: string()
|
|
23435
24524
|
}), object({
|
|
23436
24525
|
removed: boolean(),
|
|
@@ -23447,7 +24536,8 @@ DeviceType.Camera, method(object({ deviceId: number() }), array(TrackSchema).rea
|
|
|
23447
24536
|
auth: "admin"
|
|
23448
24537
|
}), method(object({
|
|
23449
24538
|
deviceId: number(),
|
|
23450
|
-
|
|
24539
|
+
/** The frame's track, when it has one — checked against the frame. */
|
|
24540
|
+
trackId: string().optional(),
|
|
23451
24541
|
frameId: string(),
|
|
23452
24542
|
subject: RetrainAssistSubjectSchema,
|
|
23453
24543
|
/** Which node runs it. Absent ⇒ wherever an unowned call lands. */
|
|
@@ -23455,12 +24545,16 @@ DeviceType.Camera, method(object({ deviceId: number() }), array(TrackSchema).rea
|
|
|
23455
24545
|
}), RetrainAssistResultSchema, {
|
|
23456
24546
|
kind: "mutation",
|
|
23457
24547
|
auth: "admin"
|
|
23458
|
-
}), method(object({
|
|
24548
|
+
}), method(object({
|
|
24549
|
+
trackId: string().optional(),
|
|
24550
|
+
frameIds: array(string()).max(2e3).optional()
|
|
24551
|
+
}), array(RetrainAnnotationSchema).readonly(), {
|
|
23459
24552
|
kind: "query",
|
|
23460
24553
|
auth: "admin"
|
|
23461
24554
|
}), method(object({
|
|
23462
24555
|
deviceId: number(),
|
|
23463
|
-
|
|
24556
|
+
/** The frame's track, when it has one — checked against the frame. */
|
|
24557
|
+
trackId: string().optional(),
|
|
23464
24558
|
frameId: string(),
|
|
23465
24559
|
annotations: array(RetrainAnnotationDraftSchema)
|
|
23466
24560
|
}), array(RetrainAnnotationSchema).readonly(), {
|
|
@@ -23478,7 +24572,91 @@ DeviceType.Camera, method(object({ deviceId: number() }), array(TrackSchema).rea
|
|
|
23478
24572
|
}), RetrainTransitionResultSchema, {
|
|
23479
24573
|
kind: "mutation",
|
|
23480
24574
|
auth: "admin"
|
|
23481
|
-
}), method(
|
|
24575
|
+
}), method(RetrainExportFilterSchema.extend({ layout: RetrainExportLayoutSchema.optional() }), object({ url: string() }), {
|
|
24576
|
+
kind: "query",
|
|
24577
|
+
auth: "admin"
|
|
24578
|
+
}), method(object({
|
|
24579
|
+
deviceId: number(),
|
|
24580
|
+
trackId: string().optional(),
|
|
24581
|
+
frameId: string(),
|
|
24582
|
+
complete: boolean()
|
|
24583
|
+
}), RetrainFrameSchema, {
|
|
24584
|
+
kind: "mutation",
|
|
24585
|
+
auth: "admin"
|
|
24586
|
+
}), method(object({
|
|
24587
|
+
filter: RetrainExportFilterSchema,
|
|
24588
|
+
layout: RetrainExportLayoutSchema,
|
|
24589
|
+
target: RetrainArchiveTargetSchema
|
|
24590
|
+
}), RetrainArchiveResultSchema, {
|
|
24591
|
+
kind: "mutation",
|
|
24592
|
+
auth: "admin",
|
|
24593
|
+
timeoutMs: 60 * 6e4
|
|
24594
|
+
}), method(object({}), array(RetrainAssistProfileSchema).readonly(), {
|
|
24595
|
+
kind: "query",
|
|
24596
|
+
auth: "admin"
|
|
24597
|
+
}), method(object({
|
|
24598
|
+
deviceId: number(),
|
|
24599
|
+
trackId: string().optional(),
|
|
24600
|
+
frameId: string(),
|
|
24601
|
+
profileId: string(),
|
|
24602
|
+
classes: array(RetrainMacroClassSchema).min(1),
|
|
24603
|
+
boxes: array(object({
|
|
24604
|
+
ref: string(),
|
|
24605
|
+
bbox: RetrainBboxSchema,
|
|
24606
|
+
macroClass: RetrainMacroClassSchema,
|
|
24607
|
+
label: string().optional()
|
|
24608
|
+
})).max(50),
|
|
24609
|
+
allowCloud: boolean()
|
|
24610
|
+
}), RetrainLlmAssistResultSchema, {
|
|
24611
|
+
kind: "mutation",
|
|
24612
|
+
auth: "admin",
|
|
24613
|
+
timeoutMs: 18e4
|
|
24614
|
+
}), method(object({ name: string().max(120) }), RetrainCollectionCreateResultSchema, {
|
|
24615
|
+
kind: "mutation",
|
|
24616
|
+
auth: "admin"
|
|
24617
|
+
}), method(object({}), array(RetrainCollectionSchema).readonly(), {
|
|
24618
|
+
kind: "query",
|
|
24619
|
+
auth: "admin"
|
|
24620
|
+
}), method(object({
|
|
24621
|
+
id: string(),
|
|
24622
|
+
name: string().max(120)
|
|
24623
|
+
}), RetrainCollectionRenameResultSchema, {
|
|
24624
|
+
kind: "mutation",
|
|
24625
|
+
auth: "admin"
|
|
24626
|
+
}), method(object({ id: string() }), object({
|
|
24627
|
+
deleted: boolean(),
|
|
24628
|
+
removedFrames: number().int()
|
|
24629
|
+
}), {
|
|
24630
|
+
kind: "mutation",
|
|
24631
|
+
auth: "admin"
|
|
24632
|
+
}), method(object({
|
|
24633
|
+
collectionId: string(),
|
|
24634
|
+
deviceId: number(),
|
|
24635
|
+
epochMs: number()
|
|
24636
|
+
}), AddRetrainFrameFromRecordingResultSchema, {
|
|
24637
|
+
kind: "mutation",
|
|
24638
|
+
auth: "admin",
|
|
24639
|
+
timeoutMs: 6e4
|
|
24640
|
+
}), method(object({
|
|
24641
|
+
collectionId: string(),
|
|
24642
|
+
frameIds: array(string()).min(1).max(500)
|
|
24643
|
+
}), object({
|
|
24644
|
+
added: number().int(),
|
|
24645
|
+
alreadyMember: number().int(),
|
|
24646
|
+
unknownFrameIds: array(string()).readonly()
|
|
24647
|
+
}), {
|
|
24648
|
+
kind: "mutation",
|
|
24649
|
+
auth: "admin"
|
|
24650
|
+
}), method(object({
|
|
24651
|
+
collectionId: string(),
|
|
24652
|
+
frameId: string()
|
|
24653
|
+
}), object({
|
|
24654
|
+
removed: boolean(),
|
|
24655
|
+
deletedFrame: boolean()
|
|
24656
|
+
}), {
|
|
24657
|
+
kind: "mutation",
|
|
24658
|
+
auth: "admin"
|
|
24659
|
+
}), method(object({ collectionId: string() }), array(RetrainFrameSchema).readonly(), {
|
|
23482
24660
|
kind: "query",
|
|
23483
24661
|
auth: "admin"
|
|
23484
24662
|
}), method(object({
|
|
@@ -24104,13 +25282,31 @@ var RecommendationReasonSchema = discriminatedUnion("kind", [
|
|
|
24104
25282
|
object({
|
|
24105
25283
|
kind: literal("no-family-build"),
|
|
24106
25284
|
format: ModelFormatSchema$1
|
|
25285
|
+
}),
|
|
25286
|
+
object({
|
|
25287
|
+
kind: literal("kept-custom-pin"),
|
|
25288
|
+
modelId: string(),
|
|
25289
|
+
deviceKey: string()
|
|
24107
25290
|
})
|
|
24108
25291
|
]);
|
|
25292
|
+
/** Why a device is left exactly as it is, whatever the plan would pick (D786). */
|
|
25293
|
+
var KeptReasonSchema = _enum(["custom-pin"]);
|
|
25294
|
+
/**
|
|
25295
|
+
* Where a choice's latency came from (D791): this node's own benchmark
|
|
25296
|
+
* result, or the hardware-class table. Measured on the node beats the table.
|
|
25297
|
+
*/
|
|
25298
|
+
var LatencySourceSchema = discriminatedUnion("kind", [object({ kind: literal("table") }), object({
|
|
25299
|
+
kind: literal("node-benchmark"),
|
|
25300
|
+
resultId: string(),
|
|
25301
|
+
measuredAtMs: number()
|
|
25302
|
+
})]);
|
|
24109
25303
|
var DeviceModelChoiceSchema = object({
|
|
24110
25304
|
modelId: string(),
|
|
24111
25305
|
p50Ms: number(),
|
|
24112
25306
|
fps: number(),
|
|
24113
25307
|
measured: boolean(),
|
|
25308
|
+
/** Absent on a plan from before D791 — read as the table. */
|
|
25309
|
+
source: LatencySourceSchema.optional(),
|
|
24114
25310
|
/** Parallel sessions at the camera rate with the headroom kept free: ⌊fps × (1 − headroom) / camera fps⌋. */
|
|
24115
25311
|
capacitySessions: number(),
|
|
24116
25312
|
personRecall: number()
|
|
@@ -24121,6 +25317,8 @@ var DeviceRecommendationSchema = object({
|
|
|
24121
25317
|
enabled: boolean(),
|
|
24122
25318
|
available: boolean(),
|
|
24123
25319
|
chosen: DeviceModelChoiceSchema.nullable(),
|
|
25320
|
+
/** Present when the device is kept as is: Apply writes nothing on it. */
|
|
25321
|
+
kept: KeptReasonSchema.optional(),
|
|
24124
25322
|
reasons: array(RecommendationReasonSchema).readonly()
|
|
24125
25323
|
});
|
|
24126
25324
|
var NodeRecommendationSchema = object({
|
|
@@ -24174,6 +25372,17 @@ var AutoTuneWarningSchema = discriminatedUnion("kind", [
|
|
|
24174
25372
|
kind: literal("coral-enabled"),
|
|
24175
25373
|
nodeId: string(),
|
|
24176
25374
|
deviceKey: string()
|
|
25375
|
+
}),
|
|
25376
|
+
object({
|
|
25377
|
+
kind: literal("custom-pin-kept"),
|
|
25378
|
+
nodeId: string(),
|
|
25379
|
+
deviceKey: string().nullable(),
|
|
25380
|
+
deviceId: number().nullable(),
|
|
25381
|
+
modelId: string()
|
|
25382
|
+
}),
|
|
25383
|
+
object({
|
|
25384
|
+
kind: literal("custom-registry-unreadable"),
|
|
25385
|
+
error: string()
|
|
24177
25386
|
})
|
|
24178
25387
|
]);
|
|
24179
25388
|
var AutoTuneOptionsSchema = object({
|
|
@@ -24352,13 +25561,14 @@ var SuggestSharesResultSchema = object({
|
|
|
24352
25561
|
nodes: array(SuggestedNodeShareSchema).readonly()
|
|
24353
25562
|
});
|
|
24354
25563
|
/**
|
|
24355
|
-
* Where the node and device shares come from (D750, D755).
|
|
24356
|
-
* - `
|
|
24357
|
-
*
|
|
24358
|
-
*
|
|
24359
|
-
*
|
|
24360
|
-
*
|
|
24361
|
-
*
|
|
25564
|
+
* Where the node and device shares come from (D750, D755, D791).
|
|
25565
|
+
* - `benchmark` (default since D791) — each node's capacity as its own node
|
|
25566
|
+
* benchmark measured it; a node without fresh results is sized from
|
|
25567
|
+
* `hardware` and says so. Measured on the node beats the table.
|
|
25568
|
+
* - `hardware` — computed from each node's static capacity only (its
|
|
25569
|
+
* accelerators at their Auto tune models, from the latency table).
|
|
25570
|
+
* Both are recomputed whenever a node or device joins, leaves, is switched
|
|
25571
|
+
* on or off, changes model, or a benchmark result is written. No load input.
|
|
24362
25572
|
* - `manual` — the operator's stored sliders.
|
|
24363
25573
|
* Either way a node or device that cannot take sessions gives its share to
|
|
24364
25574
|
* the others in proportion; the stored values are never rewritten for that.
|
|
@@ -24407,6 +25617,362 @@ var EffectiveSharesSchema = object({
|
|
|
24407
25617
|
nodeWeights: record(string(), number()),
|
|
24408
25618
|
deviceWeights: record(string(), record(string(), number()))
|
|
24409
25619
|
});
|
|
25620
|
+
/**
|
|
25621
|
+
* Wire shapes of the node benchmark (D791): the operator's plan, the
|
|
25622
|
+
* preflight the confirmation shows, the run the orchestrator owns, what the
|
|
25623
|
+
* measuring runner reports, and the result rows Auto tune and the automatic
|
|
25624
|
+
* shares read.
|
|
25625
|
+
*
|
|
25626
|
+
* ONE node at a time, owned by the pipeline orchestrator. While a run is
|
|
25627
|
+
* active the cluster is in BENCHMARK MODE for that node: it is not a
|
|
25628
|
+
* detection candidate, camera pins naming it are ignored so its sessions move
|
|
25629
|
+
* elsewhere, and both come back when the mode ends — after a crash or a hub
|
|
25630
|
+
* restart too (a persisted manifest, reconciled against the registry).
|
|
25631
|
+
*
|
|
25632
|
+
* Two measurements, both on the node, driven by its own runner (frames never
|
|
25633
|
+
* cross a process at frame rate, D9):
|
|
25634
|
+
* - `device` — one accelerator × one candidate detector, root only, open
|
|
25635
|
+
* loop: how many streams at the camera rate it carries inside the frame
|
|
25636
|
+
* interval;
|
|
25637
|
+
* - `pipeline` — the chosen detector plus the operator's detail steps
|
|
25638
|
+
* (faces, plates, classifiers, CLIP…), on varied frames from the bench
|
|
25639
|
+
* clip: how many parallel sessions the node carries before latency, drops,
|
|
25640
|
+
* CPU, RAM or the event loop give out.
|
|
25641
|
+
*/
|
|
25642
|
+
/** Defaults and bounds, one place. */
|
|
25643
|
+
var NODE_BENCHMARK_DEFAULTS = {
|
|
25644
|
+
fpsPerStream: 10,
|
|
25645
|
+
budgetMinutes: 45,
|
|
25646
|
+
minBudgetMinutes: 10,
|
|
25647
|
+
maxBudgetMinutes: 120,
|
|
25648
|
+
/** A result older than this no longer beats the table. */
|
|
25649
|
+
staleAfterDays: 30,
|
|
25650
|
+
/** Warm-in per ramp step (not accounted). */
|
|
25651
|
+
settleSec: 5,
|
|
25652
|
+
/** Accounted window per ramp step. */
|
|
25653
|
+
measureSec: 20,
|
|
25654
|
+
/** Longest the drain may take before the run is refused. */
|
|
25655
|
+
drainTimeoutSec: 120,
|
|
25656
|
+
/** Candidate models per device in one run. */
|
|
25657
|
+
maxModelsPerDevice: 6
|
|
25658
|
+
};
|
|
25659
|
+
/** The two measurements a run can make. */
|
|
25660
|
+
var NodeBenchmarkPhaseSchema = _enum(["device", "pipeline"]);
|
|
25661
|
+
var NodeBenchmarkDevicePlanSchema = object({
|
|
25662
|
+
/** `<backend>:<device>` — `openvino:npu`, `coreml:all`, `cpu`. */
|
|
25663
|
+
deviceKey: string().min(1),
|
|
25664
|
+
/**
|
|
25665
|
+
* Root detector candidates for the `device` measurement, in the order
|
|
25666
|
+
* measured. The FIRST is the one the `pipeline` measurement runs.
|
|
25667
|
+
*/
|
|
25668
|
+
modelIds: array(string().min(1)).min(1).max(NODE_BENCHMARK_DEFAULTS.maxModelsPerDevice)
|
|
25669
|
+
});
|
|
25670
|
+
/** What the operator confirmed. */
|
|
25671
|
+
var NodeBenchmarkPlanSchema = object({
|
|
25672
|
+
nodeId: string().min(1),
|
|
25673
|
+
devices: array(NodeBenchmarkDevicePlanSchema).min(1),
|
|
25674
|
+
/** Which measurements run. At least one. */
|
|
25675
|
+
phases: array(NodeBenchmarkPhaseSchema).min(1).default(["device", "pipeline"]),
|
|
25676
|
+
/**
|
|
25677
|
+
* Detail steps (catalog step ids under the root: faces, plates,
|
|
25678
|
+
* classifiers, CLIP…) the `pipeline` measurement enables. The root
|
|
25679
|
+
* detector always runs.
|
|
25680
|
+
*/
|
|
25681
|
+
steps: array(string().min(1)).default([]),
|
|
25682
|
+
/** Offered rate of one stream / session. */
|
|
25683
|
+
fpsPerStream: number().int().min(1).max(30).default(NODE_BENCHMARK_DEFAULTS.fpsPerStream),
|
|
25684
|
+
/** Hard deadline: the mode ends and the cluster is restored when it passes. */
|
|
25685
|
+
budgetMinutes: number().int().min(NODE_BENCHMARK_DEFAULTS.minBudgetMinutes).max(NODE_BENCHMARK_DEFAULTS.maxBudgetMinutes).default(NODE_BENCHMARK_DEFAULTS.budgetMinutes),
|
|
25686
|
+
/** Keep the models the run downloaded (default: delete what was not installed before). */
|
|
25687
|
+
keepDownloadedModels: boolean().default(false),
|
|
25688
|
+
/** Start although the other nodes' capacity does not cover the sessions running now. */
|
|
25689
|
+
acceptInsufficientHeadroom: boolean().default(false)
|
|
25690
|
+
});
|
|
25691
|
+
var NodeBenchmarkRefusalSchema = object({
|
|
25692
|
+
kind: _enum([
|
|
25693
|
+
"benchmark-active",
|
|
25694
|
+
"node-offline",
|
|
25695
|
+
"unknown-device",
|
|
25696
|
+
"no-phase",
|
|
25697
|
+
"insufficient-headroom"
|
|
25698
|
+
]),
|
|
25699
|
+
detail: string(),
|
|
25700
|
+
overridable: boolean()
|
|
25701
|
+
});
|
|
25702
|
+
/** A camera whose detection leaves the node for the run. */
|
|
25703
|
+
var NodeBenchmarkMovingCameraSchema = object({
|
|
25704
|
+
deviceId: number(),
|
|
25705
|
+
/** Placed on the node now (a standing attach or a running session). */
|
|
25706
|
+
placedOnNode: boolean(),
|
|
25707
|
+
/** A node pin naming this node, ignored for the run. */
|
|
25708
|
+
pinnedToNode: boolean()
|
|
25709
|
+
});
|
|
25710
|
+
/** A camera that cannot leave: no other node can obtain its frames. */
|
|
25711
|
+
var NodeBenchmarkStayingCameraSchema = object({
|
|
25712
|
+
deviceId: number(),
|
|
25713
|
+
reason: literal("only-frame-source")
|
|
25714
|
+
});
|
|
25715
|
+
var NodeBenchmarkPreflightSchema = object({
|
|
25716
|
+
nodeId: string(),
|
|
25717
|
+
online: boolean(),
|
|
25718
|
+
moving: array(NodeBenchmarkMovingCameraSchema).readonly(),
|
|
25719
|
+
/** Keep running on the node during the run; the result is flagged contaminated. */
|
|
25720
|
+
staying: array(NodeBenchmarkStayingCameraSchema).readonly(),
|
|
25721
|
+
estimatedDurationMs: number(),
|
|
25722
|
+
/** The run ends and the cluster is restored at the latest after this long. */
|
|
25723
|
+
budgetMs: number(),
|
|
25724
|
+
phases: array(NodeBenchmarkPhaseSchema).readonly(),
|
|
25725
|
+
steps: array(string()).readonly(),
|
|
25726
|
+
devices: array(NodeBenchmarkDevicePlanSchema).readonly(),
|
|
25727
|
+
/** Parallel sessions the cluster runs now, and what the other nodes can carry. */
|
|
25728
|
+
headroom: object({
|
|
25729
|
+
sessionsNow: number(),
|
|
25730
|
+
otherNodesCapacitySessions: number().nullable()
|
|
25731
|
+
}),
|
|
25732
|
+
refusals: array(NodeBenchmarkRefusalSchema).readonly(),
|
|
25733
|
+
canStart: boolean()
|
|
25734
|
+
});
|
|
25735
|
+
/** Where the measuring runner is. */
|
|
25736
|
+
var NodeBenchProgressSchema = object({
|
|
25737
|
+
phase: _enum([
|
|
25738
|
+
"preparing",
|
|
25739
|
+
"device",
|
|
25740
|
+
"pipeline",
|
|
25741
|
+
"cleanup"
|
|
25742
|
+
]),
|
|
25743
|
+
deviceKey: string().nullable(),
|
|
25744
|
+
modelId: string().nullable(),
|
|
25745
|
+
/** Streams (device) or sessions (pipeline) of the step running now. */
|
|
25746
|
+
load: number().nullable(),
|
|
25747
|
+
cellsDone: number(),
|
|
25748
|
+
cellsTotal: number(),
|
|
25749
|
+
message: string()
|
|
25750
|
+
});
|
|
25751
|
+
/** What limited a ramp. `none` = the ramp ran out of steps still passing. */
|
|
25752
|
+
var NodeBenchLimitSchema = _enum([
|
|
25753
|
+
"p95",
|
|
25754
|
+
"drops",
|
|
25755
|
+
"errors",
|
|
25756
|
+
"stall",
|
|
25757
|
+
"cpu",
|
|
25758
|
+
"ram",
|
|
25759
|
+
"none"
|
|
25760
|
+
]);
|
|
25761
|
+
var NodeBenchRampStepSchema = object({
|
|
25762
|
+
load: number(),
|
|
25763
|
+
pass: boolean(),
|
|
25764
|
+
p95Ms: number(),
|
|
25765
|
+
dropRatio: number(),
|
|
25766
|
+
/** Completed frames per second over the accounted window. */
|
|
25767
|
+
fps: number(),
|
|
25768
|
+
cpuPct: number().nullable(),
|
|
25769
|
+
ramFreePct: number().nullable(),
|
|
25770
|
+
failReasons: array(string()).readonly()
|
|
25771
|
+
});
|
|
25772
|
+
var NodeBenchCellSchema = discriminatedUnion("phase", [object({
|
|
25773
|
+
phase: literal("device"),
|
|
25774
|
+
deviceKey: string(),
|
|
25775
|
+
modelId: string(),
|
|
25776
|
+
/** Single-stream latency (the K = 1 step). */
|
|
25777
|
+
p50Ms: number(),
|
|
25778
|
+
p95Ms: number(),
|
|
25779
|
+
p99Ms: number(),
|
|
25780
|
+
/** Frames per second sustained at the last passing step. */
|
|
25781
|
+
fps: number(),
|
|
25782
|
+
/** Streams at the camera rate the device carried inside the frame interval; 0 = not even one. */
|
|
25783
|
+
kMax: number(),
|
|
25784
|
+
limitedBy: NodeBenchLimitSchema,
|
|
25785
|
+
/** First call (model load + warm-up). */
|
|
25786
|
+
warmupMs: number(),
|
|
25787
|
+
ramp: array(NodeBenchRampStepSchema).readonly()
|
|
25788
|
+
}), object({
|
|
25789
|
+
phase: literal("pipeline"),
|
|
25790
|
+
deviceKey: string(),
|
|
25791
|
+
modelId: string(),
|
|
25792
|
+
steps: array(string()).readonly(),
|
|
25793
|
+
/** Parallel sessions at the camera rate the node carried; 0 = not even one. */
|
|
25794
|
+
maxSessions: number(),
|
|
25795
|
+
limitedBy: NodeBenchLimitSchema,
|
|
25796
|
+
/** Detail steps that produced at least one result on the clip — a step that never fired measured nothing. */
|
|
25797
|
+
stepsFired: array(string()).readonly(),
|
|
25798
|
+
warmupMs: number(),
|
|
25799
|
+
ramp: array(NodeBenchRampStepSchema).readonly()
|
|
25800
|
+
})]);
|
|
25801
|
+
/**
|
|
25802
|
+
* What a result was measured ON. A result whose fingerprint no longer matches
|
|
25803
|
+
* the node no longer beats the table.
|
|
25804
|
+
*/
|
|
25805
|
+
var NodeBenchFingerprintSchema = object({
|
|
25806
|
+
pipelineVersion: string().nullable(),
|
|
25807
|
+
cpuModel: string().nullable(),
|
|
25808
|
+
ramGb: number().nullable(),
|
|
25809
|
+
os: string().nullable(),
|
|
25810
|
+
/** Per device: the pool the cells ran on (runtime + tuning). */
|
|
25811
|
+
pools: record(string(), object({
|
|
25812
|
+
runtime: string(),
|
|
25813
|
+
numWorkers: number(),
|
|
25814
|
+
concurrency: number(),
|
|
25815
|
+
batchMode: string()
|
|
25816
|
+
})).default({})
|
|
25817
|
+
});
|
|
25818
|
+
/** The frames the run used. */
|
|
25819
|
+
var NodeBenchClipSchema = object({
|
|
25820
|
+
/** `camstack-bench-v1` or `reference-images` (the fallback when the clip is not reachable). */
|
|
25821
|
+
id: string(),
|
|
25822
|
+
revision: string().nullable(),
|
|
25823
|
+
frames: number(),
|
|
25824
|
+
width: number(),
|
|
25825
|
+
height: number()
|
|
25826
|
+
});
|
|
25827
|
+
var NodeBenchRunnerInputSchema = object({
|
|
25828
|
+
runId: string().min(1),
|
|
25829
|
+
devices: array(NodeBenchmarkDevicePlanSchema).min(1),
|
|
25830
|
+
phases: array(NodeBenchmarkPhaseSchema).min(1),
|
|
25831
|
+
/** The full detail step tree root for the `pipeline` measurement is built on the node from these ids. */
|
|
25832
|
+
steps: array(string()).default([]),
|
|
25833
|
+
fpsPerStream: number().int().min(1).max(30),
|
|
25834
|
+
/** The runner stops on its own past this instant, whatever the hub does. */
|
|
25835
|
+
deadlineAtMs: number(),
|
|
25836
|
+
settleSec: number().min(0).max(60).default(NODE_BENCHMARK_DEFAULTS.settleSec),
|
|
25837
|
+
measureSec: number().min(2).max(300).default(NODE_BENCHMARK_DEFAULTS.measureSec),
|
|
25838
|
+
keepDownloadedModels: boolean().default(false)
|
|
25839
|
+
});
|
|
25840
|
+
var NodeBenchRunnerStateSchema = _enum([
|
|
25841
|
+
"running",
|
|
25842
|
+
"done",
|
|
25843
|
+
"failed",
|
|
25844
|
+
"aborted"
|
|
25845
|
+
]);
|
|
25846
|
+
var NodeBenchRunnerStatusSchema = object({
|
|
25847
|
+
runId: string(),
|
|
25848
|
+
nodeId: string(),
|
|
25849
|
+
state: NodeBenchRunnerStateSchema,
|
|
25850
|
+
progress: NodeBenchProgressSchema.nullable(),
|
|
25851
|
+
/** Every finished cell so far — a run stopped half way keeps what it measured. */
|
|
25852
|
+
cells: array(NodeBenchCellSchema).readonly(),
|
|
25853
|
+
fingerprint: NodeBenchFingerprintSchema.nullable(),
|
|
25854
|
+
clip: NodeBenchClipSchema.nullable(),
|
|
25855
|
+
/** Cameras seen running on the node during the run (they share its pools). */
|
|
25856
|
+
activeCameraIds: array(number()).readonly(),
|
|
25857
|
+
/** Models the run downloaded and then deleted (not installed before). */
|
|
25858
|
+
deletedModels: array(string()).readonly(),
|
|
25859
|
+
error: string().nullable(),
|
|
25860
|
+
startedAtMs: number(),
|
|
25861
|
+
finishedAtMs: number().nullable()
|
|
25862
|
+
});
|
|
25863
|
+
var NodeBenchmarkStateSchema = _enum([
|
|
25864
|
+
"draining",
|
|
25865
|
+
"measuring",
|
|
25866
|
+
"restoring",
|
|
25867
|
+
"done",
|
|
25868
|
+
"failed",
|
|
25869
|
+
"aborted"
|
|
25870
|
+
]);
|
|
25871
|
+
/** Why a run ended. */
|
|
25872
|
+
var NodeBenchmarkEndReasonSchema = _enum([
|
|
25873
|
+
"completed",
|
|
25874
|
+
"operator-abort",
|
|
25875
|
+
"deadline",
|
|
25876
|
+
"node-lost",
|
|
25877
|
+
"runner-lost",
|
|
25878
|
+
"hub-restart",
|
|
25879
|
+
"drain-timeout",
|
|
25880
|
+
"failed"
|
|
25881
|
+
]);
|
|
25882
|
+
var NodeBenchmarkRunSchema = object({
|
|
25883
|
+
runId: string(),
|
|
25884
|
+
nodeId: string(),
|
|
25885
|
+
state: NodeBenchmarkStateSchema,
|
|
25886
|
+
plan: NodeBenchmarkPlanSchema,
|
|
25887
|
+
startedAtMs: number(),
|
|
25888
|
+
deadlineAtMs: number(),
|
|
25889
|
+
finishedAtMs: number().nullable(),
|
|
25890
|
+
endReason: NodeBenchmarkEndReasonSchema.nullable(),
|
|
25891
|
+
error: string().nullable(),
|
|
25892
|
+
/** Cameras moved off the node for the run. */
|
|
25893
|
+
moved: array(number()).readonly(),
|
|
25894
|
+
/** Cameras that stayed (their only frame source is the node). */
|
|
25895
|
+
staying: array(number()).readonly(),
|
|
25896
|
+
/** Something else ran on the node's pools during the run. */
|
|
25897
|
+
contaminated: boolean(),
|
|
25898
|
+
progress: NodeBenchProgressSchema.nullable(),
|
|
25899
|
+
resultIds: array(string()).readonly()
|
|
25900
|
+
});
|
|
25901
|
+
/** `getNodeBenchmarkStatus`: the active run (or the last one), and whether benchmark mode is on. */
|
|
25902
|
+
var NodeBenchmarkStatusSchema = object({
|
|
25903
|
+
/** The node the cluster is in benchmark mode for; null = none. */
|
|
25904
|
+
modeNodeId: string().nullable(),
|
|
25905
|
+
run: NodeBenchmarkRunSchema.nullable()
|
|
25906
|
+
});
|
|
25907
|
+
/**
|
|
25908
|
+
* One stored measurement — the only authority Auto tune and the automatic
|
|
25909
|
+
* shares read measured capacity from. Written by the orchestrator when a run
|
|
25910
|
+
* ends, never by anyone else.
|
|
25911
|
+
*/
|
|
25912
|
+
var NodeBenchmarkResultSchema = object({
|
|
25913
|
+
id: string(),
|
|
25914
|
+
runId: string(),
|
|
25915
|
+
nodeId: string(),
|
|
25916
|
+
cell: NodeBenchCellSchema,
|
|
25917
|
+
fpsPerStream: number(),
|
|
25918
|
+
fingerprint: NodeBenchFingerprintSchema.nullable(),
|
|
25919
|
+
clip: NodeBenchClipSchema.nullable(),
|
|
25920
|
+
/** Other work shared the node's pools (a camera that could not move, or the hub's own duties). */
|
|
25921
|
+
contaminated: boolean(),
|
|
25922
|
+
stayingCameras: array(number()).readonly(),
|
|
25923
|
+
/** The run ended early; the cell itself completed. */
|
|
25924
|
+
partialRun: boolean(),
|
|
25925
|
+
measuredAtMs: number()
|
|
25926
|
+
});
|
|
25927
|
+
var ListNodeBenchmarkResultsInputSchema = object({
|
|
25928
|
+
nodeId: string().optional(),
|
|
25929
|
+
deviceKey: string().optional()
|
|
25930
|
+
});
|
|
25931
|
+
/** A result with its standing today: does it still beat the table? */
|
|
25932
|
+
var NodeBenchmarkResultViewSchema = NodeBenchmarkResultSchema.extend({
|
|
25933
|
+
/** `fresh` beats the table; `stale` falls back to it; `superseded` = a newer row covers the same cell. */
|
|
25934
|
+
standing: _enum([
|
|
25935
|
+
"fresh",
|
|
25936
|
+
"stale",
|
|
25937
|
+
"superseded"
|
|
25938
|
+
]),
|
|
25939
|
+
staleWhy: _enum([
|
|
25940
|
+
"age",
|
|
25941
|
+
"runtime",
|
|
25942
|
+
"pool-tuning"
|
|
25943
|
+
]).nullable()
|
|
25944
|
+
});
|
|
25945
|
+
object({
|
|
25946
|
+
runId: string(),
|
|
25947
|
+
nodeId: string(),
|
|
25948
|
+
startedAtMs: number(),
|
|
25949
|
+
deadlineAtMs: number(),
|
|
25950
|
+
plan: NodeBenchmarkPlanSchema,
|
|
25951
|
+
moved: array(number()).readonly(),
|
|
25952
|
+
staying: array(number()).readonly()
|
|
25953
|
+
});
|
|
25954
|
+
/** Candidate detectors per device, for the plan editor. */
|
|
25955
|
+
var NodeBenchmarkCandidatesSchema = object({
|
|
25956
|
+
nodeId: string(),
|
|
25957
|
+
reachable: boolean(),
|
|
25958
|
+
devices: array(object({
|
|
25959
|
+
deviceKey: string(),
|
|
25960
|
+
enabled: boolean(),
|
|
25961
|
+
available: boolean(),
|
|
25962
|
+
/** Ordered: what Auto tune would pick first, then the rest of the family by accuracy. */
|
|
25963
|
+
suggested: array(string()).readonly(),
|
|
25964
|
+
/** Every root detector the device has a build for. */
|
|
25965
|
+
all: array(string()).readonly(),
|
|
25966
|
+
/** The model the device runs now, when pinned. */
|
|
25967
|
+
currentModelId: string().nullable()
|
|
25968
|
+
})).readonly(),
|
|
25969
|
+
/** Detail steps the node's catalog offers under the root (for the `pipeline` measurement). */
|
|
25970
|
+
steps: array(object({
|
|
25971
|
+
id: string(),
|
|
25972
|
+
name: string(),
|
|
25973
|
+
slot: string()
|
|
25974
|
+
})).readonly()
|
|
25975
|
+
});
|
|
24410
25976
|
object({
|
|
24411
25977
|
activeCameras: number(),
|
|
24412
25978
|
throttledCameras: number(),
|
|
@@ -25495,7 +27061,16 @@ method(RunnerCameraConfigSchema, object({ success: literal(true) }), { kind: "mu
|
|
|
25495
27061
|
}), ParkedTrackFrameSchema.nullable()), method(object({
|
|
25496
27062
|
deviceId: number(),
|
|
25497
27063
|
trackId: string()
|
|
25498
|
-
}), object({ released: number().int().nonnegative() }), { kind: "mutation" })
|
|
27064
|
+
}), object({ released: number().int().nonnegative() }), { kind: "mutation" }), method(NodeBenchRunnerInputSchema, object({
|
|
27065
|
+
accepted: literal(true),
|
|
27066
|
+
runId: string()
|
|
27067
|
+
}), {
|
|
27068
|
+
kind: "mutation",
|
|
27069
|
+
auth: "admin"
|
|
27070
|
+
}), method(object({ runId: string() }), NodeBenchRunnerStatusSchema.nullable(), { auth: "admin" }), method(object({ runId: string() }), object({ aborted: boolean() }), {
|
|
27071
|
+
kind: "mutation",
|
|
27072
|
+
auth: "admin"
|
|
27073
|
+
});
|
|
25499
27074
|
var CameraPipelineConfigSchema = object({
|
|
25500
27075
|
engine: PipelineEngineChoiceSchema.optional(),
|
|
25501
27076
|
steps: array(PipelineStepInputSchema).readonly(),
|
|
@@ -26134,6 +27709,21 @@ method(object({
|
|
|
26134
27709
|
}), method(PlacementStatsInputSchema, PlacementStatsSchema, { auth: "admin" }), method(SuggestSharesInputSchema, SuggestSharesResultSchema, { auth: "admin" }), method(_void(), EffectiveSharesSchema, { auth: "admin" }), method(SetShareSourceInputSchema, object({ success: literal(true) }), {
|
|
26135
27710
|
kind: "mutation",
|
|
26136
27711
|
auth: "admin"
|
|
27712
|
+
}), method(NodeBenchmarkPlanSchema, NodeBenchmarkPreflightSchema, { auth: "admin" }), method(NodeBenchmarkPlanSchema, discriminatedUnion("kind", [object({
|
|
27713
|
+
kind: literal("started"),
|
|
27714
|
+
runId: string()
|
|
27715
|
+
}), object({
|
|
27716
|
+
kind: literal("refused"),
|
|
27717
|
+
preflight: NodeBenchmarkPreflightSchema
|
|
27718
|
+
})]), {
|
|
27719
|
+
kind: "mutation",
|
|
27720
|
+
auth: "admin"
|
|
27721
|
+
}), method(_void(), NodeBenchmarkStatusSchema, { auth: "admin" }), method(object({ runId: string() }), object({ aborted: boolean() }), {
|
|
27722
|
+
kind: "mutation",
|
|
27723
|
+
auth: "admin"
|
|
27724
|
+
}), method(object({ nodeId: string() }), NodeBenchmarkCandidatesSchema, { auth: "admin" }), method(ListNodeBenchmarkResultsInputSchema, array(NodeBenchmarkResultViewSchema).readonly(), { auth: "admin" }), method(object({ id: string() }), object({ deleted: boolean() }), {
|
|
27725
|
+
kind: "mutation",
|
|
27726
|
+
auth: "admin"
|
|
26137
27727
|
}), method(object({ deviceId: number() }), CameraPipelineSettingsSchema.nullable()), method(object({
|
|
26138
27728
|
deviceId: number(),
|
|
26139
27729
|
addonId: string(),
|
|
@@ -26770,7 +28360,19 @@ var SsoBridgeClaimsSchema = object({
|
|
|
26770
28360
|
* editing a descriptor must not retroactively extend or shorten a link the
|
|
26771
28361
|
* operator already consented to.
|
|
26772
28362
|
*/
|
|
26773
|
-
refreshTtl: union([number().int().positive(), literal("never")]).optional()
|
|
28363
|
+
refreshTtl: union([number().int().positive(), literal("never")]).optional(),
|
|
28364
|
+
/**
|
|
28365
|
+
* Opaque handle of a hub-side LINK intent (D782). Set by an OIDC callback
|
|
28366
|
+
* that was started from a signed-in user's "Link" button: the finish then
|
|
28367
|
+
* links this identity to the intent's user instead of signing anyone in.
|
|
28368
|
+
* The handle carries no user id — the hub resolves it, single-use.
|
|
28369
|
+
*/
|
|
28370
|
+
linkIntent: string().optional(),
|
|
28371
|
+
/**
|
|
28372
|
+
* Verified `iss` of the id_token behind an OIDC login bridge (D782). A
|
|
28373
|
+
* subject is unique only per issuer, so a link is bound to it.
|
|
28374
|
+
*/
|
|
28375
|
+
issuer: string().optional()
|
|
26774
28376
|
});
|
|
26775
28377
|
method(object({
|
|
26776
28378
|
claims: SsoBridgeClaimsSchema,
|
|
@@ -28676,7 +30278,22 @@ DeviceType.Camera, method(object({ deviceId: number().int().nonnegative() }), ar
|
|
|
28676
30278
|
* field their hints were silently stripped by the schema and the
|
|
28677
30279
|
* adaptive ladder started blind on the client's display size.
|
|
28678
30280
|
*/
|
|
28679
|
-
hints: webrtcClientHintsSchema.optional()
|
|
30281
|
+
hints: webrtcClientHintsSchema.optional(),
|
|
30282
|
+
/**
|
|
30283
|
+
* Talk-back (D771): relay the PEER's audio to the device's speaker
|
|
30284
|
+
* through the `intercom` cap's push-talk triple. When `true` and the
|
|
30285
|
+
* offer lets the peer send audio, the answer's audio is `sendrecv`
|
|
30286
|
+
* and every inbound frame goes to `intercom.pushTalkAudio` for this
|
|
30287
|
+
* `deviceId`; absent/false answers `sendonly`, as for every viewer.
|
|
30288
|
+
*
|
|
30289
|
+
* TRUSTED-CALLER ONLY. Set by the Alexa export for an Echo on a camera
|
|
30290
|
+
* with `intercom`, when the linked user may control that camera. The
|
|
30291
|
+
* hub STRIPS it from every request-bound call (a browser), exactly as
|
|
30292
|
+
* it overwrites `relayOnly` — a viewer's talk permission is the
|
|
30293
|
+
* intercom cap's own surface (share tokens gate it there), and this
|
|
30294
|
+
* flag must not become a second door to the camera's speaker.
|
|
30295
|
+
*/
|
|
30296
|
+
talkback: boolean().optional()
|
|
28680
30297
|
}), object({
|
|
28681
30298
|
sessionId: string(),
|
|
28682
30299
|
sdpAnswer: string()
|
|
@@ -31188,6 +32805,9 @@ var CreateIntegrationInputSchema = object({
|
|
|
31188
32805
|
enabled: boolean().optional(),
|
|
31189
32806
|
info: record(string(), unknown()).optional(),
|
|
31190
32807
|
settings: record(string(), unknown()).optional(),
|
|
32808
|
+
/** Keys of `settings` the form's schema declares secret (by type) — kept in
|
|
32809
|
+
* the keychain, not the table (D787). */
|
|
32810
|
+
secretKeys: array(string()).optional(),
|
|
31191
32811
|
skipRestart: boolean().optional()
|
|
31192
32812
|
});
|
|
31193
32813
|
var UpdateIntegrationInputSchema = object({
|
|
@@ -31211,7 +32831,9 @@ method(_void(), array(IntegrationWithStateSchema)), method(object({ id: string()
|
|
|
31211
32831
|
auth: "admin"
|
|
31212
32832
|
}), method(object({ id: string() }), record(string(), unknown()), { auth: "admin" }), method(object({
|
|
31213
32833
|
id: string(),
|
|
31214
|
-
settings: record(string(), unknown())
|
|
32834
|
+
settings: record(string(), unknown()),
|
|
32835
|
+
/** Keys the form's schema declares secret (by type) — keychain-stored (D787). */
|
|
32836
|
+
secretKeys: array(string()).optional()
|
|
31215
32837
|
}), object({ success: boolean() }), {
|
|
31216
32838
|
kind: "mutation",
|
|
31217
32839
|
auth: "admin"
|
|
@@ -36720,6 +38342,32 @@ var TotpStatusSchema = object({
|
|
|
36720
38342
|
/** Null when no row exists OR the row is still pending confirmation. */
|
|
36721
38343
|
confirmedAt: number().nullable()
|
|
36722
38344
|
});
|
|
38345
|
+
/**
|
|
38346
|
+
* user-management — singleton capability for user accounts, API keys,
|
|
38347
|
+
* and scoped tokens.
|
|
38348
|
+
*
|
|
38349
|
+
* v2 model: every method gated by `auth: 'admin'`. Admin-only delegation
|
|
38350
|
+
* — the subset check on `setUserScopes` / `createScopedToken` is moot
|
|
38351
|
+
* because non-admins never reach these. If/when we open non-admin
|
|
38352
|
+
* delegation, structural caller-scope subset check goes inside the
|
|
38353
|
+
* provider.
|
|
38354
|
+
*/
|
|
38355
|
+
var ExternalIdentitySchema = object({
|
|
38356
|
+
/** Login-method id of the provider instance, e.g. `auth-oidc/authentik`. */
|
|
38357
|
+
provider: string(),
|
|
38358
|
+
/** The IdP's stable subject (`sub`) for this account. */
|
|
38359
|
+
subject: string(),
|
|
38360
|
+
/** The verified `iss` of the IdP the identity was linked under — `sub` is unique only per issuer. */
|
|
38361
|
+
issuer: string(),
|
|
38362
|
+
userId: string(),
|
|
38363
|
+
/** What the IdP called the account at link time (username / email) — display only. */
|
|
38364
|
+
label: string().optional(),
|
|
38365
|
+
linkedAt: number()
|
|
38366
|
+
});
|
|
38367
|
+
var ExternalIdentityKeySchema = object({
|
|
38368
|
+
provider: string().min(1),
|
|
38369
|
+
subject: string().min(1)
|
|
38370
|
+
});
|
|
36723
38371
|
method(_void(), array(UserSummarySchema), { auth: "admin" }), method(CreateUserInputSchema, UserSummarySchema, {
|
|
36724
38372
|
kind: "mutation",
|
|
36725
38373
|
auth: "admin",
|
|
@@ -36833,7 +38481,22 @@ method(_void(), array(UserSummarySchema), { auth: "admin" }), method(CreateUserI
|
|
|
36833
38481
|
userId: string(),
|
|
36834
38482
|
username: string(),
|
|
36835
38483
|
scopes: array(TokenScopeSchema)
|
|
36836
|
-
}).nullable(), { access: "view" }), method(
|
|
38484
|
+
}).nullable(), { access: "view" }), method(object({ userId: string() }), array(ExternalIdentitySchema), { auth: "admin" }), method(ExternalIdentityKeySchema, object({
|
|
38485
|
+
userId: string(),
|
|
38486
|
+
issuer: string()
|
|
38487
|
+
}).nullable(), { auth: "admin" }), method(ExternalIdentityKeySchema.extend({
|
|
38488
|
+
userId: string(),
|
|
38489
|
+
issuer: string().min(1),
|
|
38490
|
+
label: string().optional()
|
|
38491
|
+
}), object({ success: literal(true) }), {
|
|
38492
|
+
kind: "mutation",
|
|
38493
|
+
auth: "admin",
|
|
38494
|
+
access: "create"
|
|
38495
|
+
}), method(ExternalIdentityKeySchema.extend({ userId: string() }), object({ success: boolean() }), {
|
|
38496
|
+
kind: "mutation",
|
|
38497
|
+
auth: "admin",
|
|
38498
|
+
access: "delete"
|
|
38499
|
+
}), method(_void(), array(OauthSessionSummarySchema), { auth: "admin" }), method(object({ id: string() }), object({ success: boolean() }), {
|
|
36837
38500
|
kind: "mutation",
|
|
36838
38501
|
auth: "admin",
|
|
36839
38502
|
access: "delete"
|
|
@@ -39973,6 +41636,90 @@ Object.freeze({
|
|
|
39973
41636
|
addonId: null,
|
|
39974
41637
|
access: "create"
|
|
39975
41638
|
},
|
|
41639
|
+
"keychain.delete": {
|
|
41640
|
+
capName: "keychain",
|
|
41641
|
+
capScope: "system",
|
|
41642
|
+
addonId: null,
|
|
41643
|
+
access: "delete"
|
|
41644
|
+
},
|
|
41645
|
+
"keychain.getState": {
|
|
41646
|
+
capName: "keychain",
|
|
41647
|
+
capScope: "system",
|
|
41648
|
+
addonId: null,
|
|
41649
|
+
access: "view"
|
|
41650
|
+
},
|
|
41651
|
+
"keychain.listMeta": {
|
|
41652
|
+
capName: "keychain",
|
|
41653
|
+
capScope: "system",
|
|
41654
|
+
addonId: null,
|
|
41655
|
+
access: "view"
|
|
41656
|
+
},
|
|
41657
|
+
"keychain.put": {
|
|
41658
|
+
capName: "keychain",
|
|
41659
|
+
capScope: "system",
|
|
41660
|
+
addonId: null,
|
|
41661
|
+
access: "create"
|
|
41662
|
+
},
|
|
41663
|
+
"keychain.resolve": {
|
|
41664
|
+
capName: "keychain",
|
|
41665
|
+
capScope: "system",
|
|
41666
|
+
addonId: null,
|
|
41667
|
+
access: "view"
|
|
41668
|
+
},
|
|
41669
|
+
"keychainAdmin.deleteOrphans": {
|
|
41670
|
+
capName: "keychain-admin",
|
|
41671
|
+
capScope: "system",
|
|
41672
|
+
addonId: null,
|
|
41673
|
+
access: "delete"
|
|
41674
|
+
},
|
|
41675
|
+
"keychainAdmin.downloadRecoveryKey": {
|
|
41676
|
+
capName: "keychain-admin",
|
|
41677
|
+
capScope: "system",
|
|
41678
|
+
addonId: null,
|
|
41679
|
+
access: "create"
|
|
41680
|
+
},
|
|
41681
|
+
"keychainAdmin.listAudit": {
|
|
41682
|
+
capName: "keychain-admin",
|
|
41683
|
+
capScope: "system",
|
|
41684
|
+
addonId: null,
|
|
41685
|
+
access: "view"
|
|
41686
|
+
},
|
|
41687
|
+
"keychainAdmin.listSecrets": {
|
|
41688
|
+
capName: "keychain-admin",
|
|
41689
|
+
capScope: "system",
|
|
41690
|
+
addonId: null,
|
|
41691
|
+
access: "view"
|
|
41692
|
+
},
|
|
41693
|
+
"keychainAdmin.purgeRetiredKeys": {
|
|
41694
|
+
capName: "keychain-admin",
|
|
41695
|
+
capScope: "system",
|
|
41696
|
+
addonId: null,
|
|
41697
|
+
access: "delete"
|
|
41698
|
+
},
|
|
41699
|
+
"keychainAdmin.resetKeychain": {
|
|
41700
|
+
capName: "keychain-admin",
|
|
41701
|
+
capScope: "system",
|
|
41702
|
+
addonId: null,
|
|
41703
|
+
access: "delete"
|
|
41704
|
+
},
|
|
41705
|
+
"keychainAdmin.reveal": {
|
|
41706
|
+
capName: "keychain-admin",
|
|
41707
|
+
capScope: "system",
|
|
41708
|
+
addonId: null,
|
|
41709
|
+
access: "create"
|
|
41710
|
+
},
|
|
41711
|
+
"keychainAdmin.rotateMasterKey": {
|
|
41712
|
+
capName: "keychain-admin",
|
|
41713
|
+
capScope: "system",
|
|
41714
|
+
addonId: null,
|
|
41715
|
+
access: "create"
|
|
41716
|
+
},
|
|
41717
|
+
"keychainAdmin.status": {
|
|
41718
|
+
capName: "keychain-admin",
|
|
41719
|
+
capScope: "system",
|
|
41720
|
+
addonId: null,
|
|
41721
|
+
access: "view"
|
|
41722
|
+
},
|
|
39976
41723
|
"lawnMowerControl.dock": {
|
|
39977
41724
|
capName: "lawn-mower-control",
|
|
39978
41725
|
capScope: "device",
|
|
@@ -41347,6 +43094,18 @@ Object.freeze({
|
|
|
41347
43094
|
addonId: null,
|
|
41348
43095
|
access: "create"
|
|
41349
43096
|
},
|
|
43097
|
+
"pipelineAnalytics.addRetrainFrameFromRecording": {
|
|
43098
|
+
capName: "pipeline-analytics",
|
|
43099
|
+
capScope: "device",
|
|
43100
|
+
addonId: null,
|
|
43101
|
+
access: "create"
|
|
43102
|
+
},
|
|
43103
|
+
"pipelineAnalytics.addRetrainFramesToCollection": {
|
|
43104
|
+
capName: "pipeline-analytics",
|
|
43105
|
+
capScope: "device",
|
|
43106
|
+
addonId: null,
|
|
43107
|
+
access: "create"
|
|
43108
|
+
},
|
|
41350
43109
|
"pipelineAnalytics.applyDeviceSettingsPatch": {
|
|
41351
43110
|
capName: "pipeline-analytics",
|
|
41352
43111
|
capScope: "device",
|
|
@@ -41395,12 +43154,24 @@ Object.freeze({
|
|
|
41395
43154
|
addonId: null,
|
|
41396
43155
|
access: "view"
|
|
41397
43156
|
},
|
|
43157
|
+
"pipelineAnalytics.createRetrainCollection": {
|
|
43158
|
+
capName: "pipeline-analytics",
|
|
43159
|
+
capScope: "device",
|
|
43160
|
+
addonId: null,
|
|
43161
|
+
access: "create"
|
|
43162
|
+
},
|
|
41398
43163
|
"pipelineAnalytics.deleteDeviceEvents": {
|
|
41399
43164
|
capName: "pipeline-analytics",
|
|
41400
43165
|
capScope: "device",
|
|
41401
43166
|
addonId: null,
|
|
41402
43167
|
access: "delete"
|
|
41403
43168
|
},
|
|
43169
|
+
"pipelineAnalytics.deleteRetrainCollection": {
|
|
43170
|
+
capName: "pipeline-analytics",
|
|
43171
|
+
capScope: "device",
|
|
43172
|
+
addonId: null,
|
|
43173
|
+
access: "delete"
|
|
43174
|
+
},
|
|
41404
43175
|
"pipelineAnalytics.deleteTracks": {
|
|
41405
43176
|
capName: "pipeline-analytics",
|
|
41406
43177
|
capScope: "device",
|
|
@@ -41605,6 +43376,24 @@ Object.freeze({
|
|
|
41605
43376
|
addonId: null,
|
|
41606
43377
|
access: "view"
|
|
41607
43378
|
},
|
|
43379
|
+
"pipelineAnalytics.listRetrainAssistProfiles": {
|
|
43380
|
+
capName: "pipeline-analytics",
|
|
43381
|
+
capScope: "device",
|
|
43382
|
+
addonId: null,
|
|
43383
|
+
access: "view"
|
|
43384
|
+
},
|
|
43385
|
+
"pipelineAnalytics.listRetrainCollectionFrames": {
|
|
43386
|
+
capName: "pipeline-analytics",
|
|
43387
|
+
capScope: "device",
|
|
43388
|
+
addonId: null,
|
|
43389
|
+
access: "view"
|
|
43390
|
+
},
|
|
43391
|
+
"pipelineAnalytics.listRetrainCollections": {
|
|
43392
|
+
capName: "pipeline-analytics",
|
|
43393
|
+
capScope: "device",
|
|
43394
|
+
addonId: null,
|
|
43395
|
+
access: "view"
|
|
43396
|
+
},
|
|
41608
43397
|
"pipelineAnalytics.listRetrainFrames": {
|
|
41609
43398
|
capName: "pipeline-analytics",
|
|
41610
43399
|
capScope: "device",
|
|
@@ -41653,6 +43442,12 @@ Object.freeze({
|
|
|
41653
43442
|
addonId: null,
|
|
41654
43443
|
access: "create"
|
|
41655
43444
|
},
|
|
43445
|
+
"pipelineAnalytics.proposeRetrainAnnotationsWithLlm": {
|
|
43446
|
+
capName: "pipeline-analytics",
|
|
43447
|
+
capScope: "device",
|
|
43448
|
+
addonId: null,
|
|
43449
|
+
access: "create"
|
|
43450
|
+
},
|
|
41656
43451
|
"pipelineAnalytics.pruneEvents": {
|
|
41657
43452
|
capName: "pipeline-analytics",
|
|
41658
43453
|
capScope: "device",
|
|
@@ -41707,6 +43502,18 @@ Object.freeze({
|
|
|
41707
43502
|
addonId: null,
|
|
41708
43503
|
access: "create"
|
|
41709
43504
|
},
|
|
43505
|
+
"pipelineAnalytics.removeRetrainFrameFromCollection": {
|
|
43506
|
+
capName: "pipeline-analytics",
|
|
43507
|
+
capScope: "device",
|
|
43508
|
+
addonId: null,
|
|
43509
|
+
access: "delete"
|
|
43510
|
+
},
|
|
43511
|
+
"pipelineAnalytics.renameRetrainCollection": {
|
|
43512
|
+
capName: "pipeline-analytics",
|
|
43513
|
+
capScope: "device",
|
|
43514
|
+
addonId: null,
|
|
43515
|
+
access: "create"
|
|
43516
|
+
},
|
|
41710
43517
|
"pipelineAnalytics.restageRetrainTrack": {
|
|
41711
43518
|
capName: "pipeline-analytics",
|
|
41712
43519
|
capScope: "device",
|
|
@@ -41737,6 +43544,12 @@ Object.freeze({
|
|
|
41737
43544
|
addonId: null,
|
|
41738
43545
|
access: "create"
|
|
41739
43546
|
},
|
|
43547
|
+
"pipelineAnalytics.setRetrainFrameComplete": {
|
|
43548
|
+
capName: "pipeline-analytics",
|
|
43549
|
+
capScope: "device",
|
|
43550
|
+
addonId: null,
|
|
43551
|
+
access: "create"
|
|
43552
|
+
},
|
|
41740
43553
|
"pipelineAnalytics.setTrackFlags": {
|
|
41741
43554
|
capName: "pipeline-analytics",
|
|
41742
43555
|
capScope: "device",
|
|
@@ -41773,6 +43586,12 @@ Object.freeze({
|
|
|
41773
43586
|
addonId: null,
|
|
41774
43587
|
access: "delete"
|
|
41775
43588
|
},
|
|
43589
|
+
"pipelineAnalytics.writeRetrainArchive": {
|
|
43590
|
+
capName: "pipeline-analytics",
|
|
43591
|
+
capScope: "device",
|
|
43592
|
+
addonId: null,
|
|
43593
|
+
access: "create"
|
|
43594
|
+
},
|
|
41776
43595
|
"pipelineExecutor.cacheFrameInPool": {
|
|
41777
43596
|
capName: "pipeline-executor",
|
|
41778
43597
|
capScope: "system",
|
|
@@ -41983,6 +43802,12 @@ Object.freeze({
|
|
|
41983
43802
|
addonId: null,
|
|
41984
43803
|
access: "view"
|
|
41985
43804
|
},
|
|
43805
|
+
"pipelineOrchestrator.abortNodeBenchmark": {
|
|
43806
|
+
capName: "pipeline-orchestrator",
|
|
43807
|
+
capScope: "system",
|
|
43808
|
+
addonId: null,
|
|
43809
|
+
access: "create"
|
|
43810
|
+
},
|
|
41986
43811
|
"pipelineOrchestrator.applyAutoTune": {
|
|
41987
43812
|
capName: "pipeline-orchestrator",
|
|
41988
43813
|
capScope: "system",
|
|
@@ -42007,6 +43832,12 @@ Object.freeze({
|
|
|
42007
43832
|
addonId: null,
|
|
42008
43833
|
access: "create"
|
|
42009
43834
|
},
|
|
43835
|
+
"pipelineOrchestrator.deleteNodeBenchmarkResult": {
|
|
43836
|
+
capName: "pipeline-orchestrator",
|
|
43837
|
+
capScope: "system",
|
|
43838
|
+
addonId: null,
|
|
43839
|
+
access: "delete"
|
|
43840
|
+
},
|
|
42010
43841
|
"pipelineOrchestrator.getAgentLoad": {
|
|
42011
43842
|
capName: "pipeline-orchestrator",
|
|
42012
43843
|
capScope: "system",
|
|
@@ -42115,6 +43946,24 @@ Object.freeze({
|
|
|
42115
43946
|
addonId: null,
|
|
42116
43947
|
access: "view"
|
|
42117
43948
|
},
|
|
43949
|
+
"pipelineOrchestrator.getNodeBenchmarkCandidates": {
|
|
43950
|
+
capName: "pipeline-orchestrator",
|
|
43951
|
+
capScope: "system",
|
|
43952
|
+
addonId: null,
|
|
43953
|
+
access: "view"
|
|
43954
|
+
},
|
|
43955
|
+
"pipelineOrchestrator.getNodeBenchmarkPreflight": {
|
|
43956
|
+
capName: "pipeline-orchestrator",
|
|
43957
|
+
capScope: "system",
|
|
43958
|
+
addonId: null,
|
|
43959
|
+
access: "view"
|
|
43960
|
+
},
|
|
43961
|
+
"pipelineOrchestrator.getNodeBenchmarkStatus": {
|
|
43962
|
+
capName: "pipeline-orchestrator",
|
|
43963
|
+
capScope: "system",
|
|
43964
|
+
addonId: null,
|
|
43965
|
+
access: "view"
|
|
43966
|
+
},
|
|
42118
43967
|
"pipelineOrchestrator.getNodeInferenceDevices": {
|
|
42119
43968
|
capName: "pipeline-orchestrator",
|
|
42120
43969
|
capScope: "system",
|
|
@@ -42157,6 +44006,12 @@ Object.freeze({
|
|
|
42157
44006
|
addonId: null,
|
|
42158
44007
|
access: "view"
|
|
42159
44008
|
},
|
|
44009
|
+
"pipelineOrchestrator.listNodeBenchmarkResults": {
|
|
44010
|
+
capName: "pipeline-orchestrator",
|
|
44011
|
+
capScope: "system",
|
|
44012
|
+
addonId: null,
|
|
44013
|
+
access: "view"
|
|
44014
|
+
},
|
|
42160
44015
|
"pipelineOrchestrator.pauseForStorageMigration": {
|
|
42161
44016
|
capName: "pipeline-orchestrator",
|
|
42162
44017
|
capScope: "system",
|
|
@@ -42301,6 +44156,12 @@ Object.freeze({
|
|
|
42301
44156
|
addonId: null,
|
|
42302
44157
|
access: "create"
|
|
42303
44158
|
},
|
|
44159
|
+
"pipelineOrchestrator.startNodeBenchmark": {
|
|
44160
|
+
capName: "pipeline-orchestrator",
|
|
44161
|
+
capScope: "system",
|
|
44162
|
+
addonId: null,
|
|
44163
|
+
access: "create"
|
|
44164
|
+
},
|
|
42304
44165
|
"pipelineOrchestrator.suggestShares": {
|
|
42305
44166
|
capName: "pipeline-orchestrator",
|
|
42306
44167
|
capScope: "system",
|
|
@@ -42319,6 +44180,12 @@ Object.freeze({
|
|
|
42319
44180
|
addonId: null,
|
|
42320
44181
|
access: "create"
|
|
42321
44182
|
},
|
|
44183
|
+
"pipelineRunner.abortNodeBench": {
|
|
44184
|
+
capName: "pipeline-runner",
|
|
44185
|
+
capScope: "system",
|
|
44186
|
+
addonId: null,
|
|
44187
|
+
access: "create"
|
|
44188
|
+
},
|
|
42322
44189
|
"pipelineRunner.attachCamera": {
|
|
42323
44190
|
capName: "pipeline-runner",
|
|
42324
44191
|
capScope: "system",
|
|
@@ -42367,6 +44234,12 @@ Object.freeze({
|
|
|
42367
44234
|
addonId: null,
|
|
42368
44235
|
access: "view"
|
|
42369
44236
|
},
|
|
44237
|
+
"pipelineRunner.getNodeBenchStatus": {
|
|
44238
|
+
capName: "pipeline-runner",
|
|
44239
|
+
capScope: "system",
|
|
44240
|
+
addonId: null,
|
|
44241
|
+
access: "view"
|
|
44242
|
+
},
|
|
42370
44243
|
"pipelineRunner.getParkedTrackFrame": {
|
|
42371
44244
|
capName: "pipeline-runner",
|
|
42372
44245
|
capScope: "system",
|
|
@@ -42409,6 +44282,12 @@ Object.freeze({
|
|
|
42409
44282
|
addonId: null,
|
|
42410
44283
|
access: "create"
|
|
42411
44284
|
},
|
|
44285
|
+
"pipelineRunner.startNodeBench": {
|
|
44286
|
+
capName: "pipeline-runner",
|
|
44287
|
+
capScope: "system",
|
|
44288
|
+
addonId: null,
|
|
44289
|
+
access: "create"
|
|
44290
|
+
},
|
|
42412
44291
|
"plateGallery.assignPlate": {
|
|
42413
44292
|
capName: "plate-gallery",
|
|
42414
44293
|
capScope: "system",
|
|
@@ -44125,18 +46004,36 @@ Object.freeze({
|
|
|
44125
46004
|
addonId: null,
|
|
44126
46005
|
access: "delete"
|
|
44127
46006
|
},
|
|
46007
|
+
"userManagement.findUserByExternalIdentity": {
|
|
46008
|
+
capName: "user-management",
|
|
46009
|
+
capScope: "system",
|
|
46010
|
+
addonId: null,
|
|
46011
|
+
access: "view"
|
|
46012
|
+
},
|
|
44128
46013
|
"userManagement.getTotpStatus": {
|
|
44129
46014
|
capName: "user-management",
|
|
44130
46015
|
capScope: "system",
|
|
44131
46016
|
addonId: null,
|
|
44132
46017
|
access: "view"
|
|
44133
46018
|
},
|
|
46019
|
+
"userManagement.linkExternalIdentity": {
|
|
46020
|
+
capName: "user-management",
|
|
46021
|
+
capScope: "system",
|
|
46022
|
+
addonId: null,
|
|
46023
|
+
access: "create"
|
|
46024
|
+
},
|
|
44134
46025
|
"userManagement.listApiKeys": {
|
|
44135
46026
|
capName: "user-management",
|
|
44136
46027
|
capScope: "system",
|
|
44137
46028
|
addonId: null,
|
|
44138
46029
|
access: "view"
|
|
44139
46030
|
},
|
|
46031
|
+
"userManagement.listExternalIdentities": {
|
|
46032
|
+
capName: "user-management",
|
|
46033
|
+
capScope: "system",
|
|
46034
|
+
addonId: null,
|
|
46035
|
+
access: "view"
|
|
46036
|
+
},
|
|
44140
46037
|
"userManagement.listOauthSessions": {
|
|
44141
46038
|
capName: "user-management",
|
|
44142
46039
|
capScope: "system",
|
|
@@ -44215,6 +46112,12 @@ Object.freeze({
|
|
|
44215
46112
|
addonId: null,
|
|
44216
46113
|
access: "create"
|
|
44217
46114
|
},
|
|
46115
|
+
"userManagement.unlinkExternalIdentity": {
|
|
46116
|
+
capName: "user-management",
|
|
46117
|
+
capScope: "system",
|
|
46118
|
+
addonId: null,
|
|
46119
|
+
access: "delete"
|
|
46120
|
+
},
|
|
44218
46121
|
"userManagement.updateUser": {
|
|
44219
46122
|
capName: "user-management",
|
|
44220
46123
|
capScope: "system",
|
|
@@ -47314,6 +49217,11 @@ Object.freeze({
|
|
|
47314
49217
|
form: "single",
|
|
47315
49218
|
optional: false
|
|
47316
49219
|
}],
|
|
49220
|
+
"pipelineAnalytics.addRetrainFrameFromRecording": [{
|
|
49221
|
+
name: "deviceId",
|
|
49222
|
+
form: "single",
|
|
49223
|
+
optional: false
|
|
49224
|
+
}],
|
|
47317
49225
|
"pipelineAnalytics.applyDeviceSettingsPatch": [{
|
|
47318
49226
|
name: "deviceId",
|
|
47319
49227
|
form: "single",
|
|
@@ -47504,6 +49412,11 @@ Object.freeze({
|
|
|
47504
49412
|
form: "single",
|
|
47505
49413
|
optional: false
|
|
47506
49414
|
}],
|
|
49415
|
+
"pipelineAnalytics.proposeRetrainAnnotationsWithLlm": [{
|
|
49416
|
+
name: "deviceId",
|
|
49417
|
+
form: "single",
|
|
49418
|
+
optional: false
|
|
49419
|
+
}],
|
|
47507
49420
|
"pipelineAnalytics.pruneEventsBefore": [{
|
|
47508
49421
|
name: "deviceId",
|
|
47509
49422
|
form: "single",
|
|
@@ -47554,6 +49467,11 @@ Object.freeze({
|
|
|
47554
49467
|
form: "single",
|
|
47555
49468
|
optional: false
|
|
47556
49469
|
}],
|
|
49470
|
+
"pipelineAnalytics.setRetrainFrameComplete": [{
|
|
49471
|
+
name: "deviceId",
|
|
49472
|
+
form: "single",
|
|
49473
|
+
optional: false
|
|
49474
|
+
}],
|
|
47557
49475
|
"pipelineAnalytics.setTrackFlags": [{
|
|
47558
49476
|
name: "deviceId",
|
|
47559
49477
|
form: "single",
|