@camstack/addon-osd-manager 0.1.189 → 0.1.191
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-8xm5pG3y.mjs → MotionZonesSettings-Rqhykjd-.mjs} +2 -2
- package/dist/{PrivacyMaskSettings-CtawWTNs.mjs → PrivacyMaskSettings-BN2blAoR.mjs} +4 -4
- package/dist/{SceneMonitorEditor-DQ-eU1J-.mjs → SceneMonitorEditor-BFhN1u8x.mjs} +3 -3
- package/dist/_stub.js +4755 -4755
- package/dist/{_virtual_mf-localSharedImportMap___mfe_internal__addon_osd_manager_page-Ee0XGOd5.mjs → _virtual_mf-localSharedImportMap___mfe_internal__addon_osd_manager_page-CumeuzAd.mjs} +3 -3
- package/dist/_virtual_mf___mfe_internal__addon_osd_manager_page__loadShare___mf_0_camstack_mf_1_types__loadShare__.js-CLbOsdyJ.mjs +26 -0
- package/dist/addon-osd-manager.css +1 -1
- package/dist/{hostInit-DRmpuSdp.mjs → hostInit-D7RGkDcr.mjs} +2 -2
- package/dist/index.js +2068 -56
- package/dist/index.mjs +2068 -56
- package/dist/{player-overlays-00L4bzaL.mjs → player-overlays-g9eZki2x.mjs} +1 -1
- package/dist/remoteEntry.js +1 -1
- package/dist/{responsive-BazUqbVY.mjs → responsive-BBqy78Qy.mjs} +1 -1
- package/dist/{scene-monitor-copy-BMxLX_wC.mjs → scene-monitor-copy-D5DzgrKC.mjs} +1 -1
- package/dist/{square-C-PPPKSF.mjs → square-CenwrjWY.mjs} +1 -1
- package/dist/{trash-2-DD0_NJPI.mjs → trash-2-CLXJ-udw.mjs} +1 -1
- package/dist/{virtual_mf-REMOTE_ENTRY_ID___mfe_internal__addon_osd_manager_page__remoteEntry_js-BD4P2kRn.mjs → virtual_mf-REMOTE_ENTRY_ID___mfe_internal__addon_osd_manager_page__remoteEntry_js-CoJrTruj.mjs} +1 -1
- package/package.json +1 -1
- package/dist/_virtual_mf___mfe_internal__addon_osd_manager_page__loadShare___mf_0_camstack_mf_1_types__loadShare__.js-ClWLIzft.mjs +0 -26
package/dist/index.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
//#region ../types/dist/event-category-
|
|
1
|
+
//#region ../types/dist/event-category-DaIZi00R.mjs
|
|
2
2
|
var EventCategory = /* @__PURE__ */ function(EventCategory) {
|
|
3
3
|
EventCategory["SystemBoot"] = "system.boot";
|
|
4
4
|
EventCategory["SystemAddonsReady"] = "system.addons-ready";
|
|
@@ -77,6 +77,13 @@ var EventCategory = /* @__PURE__ */ function(EventCategory) {
|
|
|
77
77
|
*/
|
|
78
78
|
EventCategory["AddonLoadFailed"] = "addon.load-failed";
|
|
79
79
|
/**
|
|
80
|
+
* A keychain value was stored or removed (D787). Carries the ref, its
|
|
81
|
+
* owner and the new version — NEVER the value. A process holding the ref
|
|
82
|
+
* drops its cached copy and the owning `BaseAddon` re-resolves its config.
|
|
83
|
+
* Telemetry (D8): a process that misses it still revalidates by version.
|
|
84
|
+
*/
|
|
85
|
+
EventCategory["KeychainChanged"] = "keychain.changed";
|
|
86
|
+
/**
|
|
80
87
|
* Addon recovered from a previous failure. Emitted when an addon
|
|
81
88
|
* transitions from `failed` back to `healthy` (typically via the
|
|
82
89
|
* monitor's auto-retry loop, or after manual `addons.retryLoad`).
|
|
@@ -5369,7 +5376,7 @@ var ZodIssueCode = {
|
|
|
5369
5376
|
var ZodFirstPartyTypeKind;
|
|
5370
5377
|
ZodFirstPartyTypeKind || (ZodFirstPartyTypeKind = {});
|
|
5371
5378
|
//#endregion
|
|
5372
|
-
//#region ../types/dist/sleep-
|
|
5379
|
+
//#region ../types/dist/sleep-DujUvOcb.mjs
|
|
5373
5380
|
/**
|
|
5374
5381
|
* The audio chunk plane's byte format, and the ONE expansion from a coded
|
|
5375
5382
|
* window to float samples (D455).
|
|
@@ -5448,6 +5455,97 @@ function buildAlawTable() {
|
|
|
5448
5455
|
}
|
|
5449
5456
|
buildUlawTable();
|
|
5450
5457
|
buildAlawTable();
|
|
5458
|
+
/** Is this field's stored value a credential? */
|
|
5459
|
+
function isSecretConfigField(field) {
|
|
5460
|
+
if (field.type === "password") return true;
|
|
5461
|
+
return "secret" in field && field.secret === true;
|
|
5462
|
+
}
|
|
5463
|
+
/**
|
|
5464
|
+
* Is this field's value stored in the KEYCHAIN (D787)? Every secret field is,
|
|
5465
|
+
* by its TYPE, unless it opts out with `storage: 'inline'` — never by its name.
|
|
5466
|
+
*/
|
|
5467
|
+
function isKeychainStoredField(field) {
|
|
5468
|
+
if (!isSecretConfigField(field)) return false;
|
|
5469
|
+
if (field.type === "textarea" && field.isJson === true) return false;
|
|
5470
|
+
return !("storage" in field && field.storage === "inline");
|
|
5471
|
+
}
|
|
5472
|
+
/**
|
|
5473
|
+
* What a settings blob holds where a secret used to be.
|
|
5474
|
+
*
|
|
5475
|
+
* A keychain-stored field never holds its value. It holds a self-describing
|
|
5476
|
+
* MARKER, `{"$secret":"secret://…","v":1}` — an object, never a string, so no
|
|
5477
|
+
* code can mistake it for a credential and no form can send it to a camera as
|
|
5478
|
+
* a password. The empty state is `null` / absent, never `''`.
|
|
5479
|
+
*
|
|
5480
|
+
* The same shapes travel to and from the admin UI:
|
|
5481
|
+
*
|
|
5482
|
+
* - read: `hydrateSchema` hands a secret field a {@link SecretFieldView}
|
|
5483
|
+
* (`{ $secret, v, set: true }`) or `null` — the browser learns whether a
|
|
5484
|
+
* value is set, never the value.
|
|
5485
|
+
* - write: an untouched field submits the view back unchanged (KEEP); a typed
|
|
5486
|
+
* value is a plain non-empty string (CHANGE); the Clear button submits
|
|
5487
|
+
* {@link SECRET_CLEAR} (CLEAR). `''`, `null` and the legacy redaction tokens
|
|
5488
|
+
* are KEEP — an empty string is what a defaults-fallback pushes back, and
|
|
5489
|
+
* treating it as "clear" is how a save destroyed a stored credential before.
|
|
5490
|
+
*
|
|
5491
|
+
* Pure and browser-safe.
|
|
5492
|
+
*/
|
|
5493
|
+
var SECRET_CLEAR = { $secretClear: true };
|
|
5494
|
+
/** The `'***'` token D634 redaction writes for non-admins. */
|
|
5495
|
+
var LEGACY_DEVICE_REDACTION = "***";
|
|
5496
|
+
function isRecord$1(value) {
|
|
5497
|
+
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
5498
|
+
}
|
|
5499
|
+
function makeSecretMarker(ref) {
|
|
5500
|
+
return {
|
|
5501
|
+
$secret: ref,
|
|
5502
|
+
v: 1
|
|
5503
|
+
};
|
|
5504
|
+
}
|
|
5505
|
+
/** A stored marker: an object whose `$secret` is a non-empty string. */
|
|
5506
|
+
function isSecretMarker(value) {
|
|
5507
|
+
if (!isRecord$1(value)) return false;
|
|
5508
|
+
const ref = value["$secret"];
|
|
5509
|
+
return typeof ref === "string" && ref.length > 0;
|
|
5510
|
+
}
|
|
5511
|
+
function isSecretClear(value) {
|
|
5512
|
+
return isRecord$1(value) && value["$secretClear"] === true;
|
|
5513
|
+
}
|
|
5514
|
+
/**
|
|
5515
|
+
* The UI view of a stored secret field value: a marker becomes "set", inline
|
|
5516
|
+
* plaintext becomes "set (inline)", nothing becomes `null`. A value never
|
|
5517
|
+
* survives this function.
|
|
5518
|
+
*/
|
|
5519
|
+
function toSecretFieldView(stored) {
|
|
5520
|
+
if (isSecretMarker(stored)) return {
|
|
5521
|
+
$secret: stored.$secret,
|
|
5522
|
+
v: 1,
|
|
5523
|
+
set: true
|
|
5524
|
+
};
|
|
5525
|
+
if (typeof stored === "string" && stored.length > 0) return {
|
|
5526
|
+
$secret: null,
|
|
5527
|
+
v: 1,
|
|
5528
|
+
set: true,
|
|
5529
|
+
inline: true
|
|
5530
|
+
};
|
|
5531
|
+
return null;
|
|
5532
|
+
}
|
|
5533
|
+
/**
|
|
5534
|
+
* Classify an incoming value for a secret path. Only a non-empty string that is
|
|
5535
|
+
* not a redaction token sets a value; only {@link SECRET_CLEAR} clears.
|
|
5536
|
+
* Everything else — a marker (ours or anyone's), a UI view, `''`, `null`,
|
|
5537
|
+
* `undefined`, a redaction token, a non-string — keeps what is stored.
|
|
5538
|
+
*/
|
|
5539
|
+
function classifySecretWrite(incoming) {
|
|
5540
|
+
if (isSecretClear(incoming)) return { kind: "clear" };
|
|
5541
|
+
if (typeof incoming !== "string") return { kind: "keep" };
|
|
5542
|
+
if (incoming.length === 0) return { kind: "keep" };
|
|
5543
|
+
if (incoming === "__camstack_redacted__" || incoming === LEGACY_DEVICE_REDACTION) return { kind: "keep" };
|
|
5544
|
+
return {
|
|
5545
|
+
kind: "set",
|
|
5546
|
+
value: incoming
|
|
5547
|
+
};
|
|
5548
|
+
}
|
|
5451
5549
|
Object.fromEntries([
|
|
5452
5550
|
{
|
|
5453
5551
|
id: "overview",
|
|
@@ -5619,33 +5717,19 @@ Object.fromEntries([
|
|
|
5619
5717
|
function isValuelessField(field) {
|
|
5620
5718
|
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";
|
|
5621
5719
|
}
|
|
5622
|
-
|
|
5623
|
-
* Merge a `ConfigUISchema` with a raw `values` record into a
|
|
5624
|
-
* `ConfigUISchemaWithValues`. Used by every `get*Settings` backend endpoint
|
|
5625
|
-
* before returning to the admin UI. Groups are walked recursively.
|
|
5626
|
-
*
|
|
5627
|
-
* For each leaf field:
|
|
5628
|
-
* - structural fields (`separator`, `info`, `button`) pass through unchanged
|
|
5629
|
-
* - other fields get `value = values[key] ?? field.default ?? null`
|
|
5630
|
-
*
|
|
5631
|
-
* Unknown keys in `values` (keys not declared in the schema) are silently
|
|
5632
|
-
* ignored — they don't contribute to the output. Missing keys fall back to
|
|
5633
|
-
* the schema default or `null`. This mirrors the old backend behaviour where
|
|
5634
|
-
* `FormBuilder` rendered `values[key] ?? field.default`.
|
|
5635
|
-
*/
|
|
5636
|
-
function hydrateSchema(schema, values) {
|
|
5720
|
+
function hydrateSchema(schema, values, options = {}) {
|
|
5637
5721
|
return {
|
|
5638
5722
|
...schema.tabs ? { tabs: [...schema.tabs] } : {},
|
|
5639
5723
|
sections: schema.sections.map((section) => ({
|
|
5640
5724
|
...section,
|
|
5641
|
-
fields: section.fields.map((field) => hydrateField(field, values))
|
|
5725
|
+
fields: section.fields.map((field) => hydrateField(field, values, options))
|
|
5642
5726
|
}))
|
|
5643
5727
|
};
|
|
5644
5728
|
}
|
|
5645
|
-
function hydrateField(field, values) {
|
|
5729
|
+
function hydrateField(field, values, options) {
|
|
5646
5730
|
if (isValuelessField(field)) return field;
|
|
5647
5731
|
if (field.type === "group") {
|
|
5648
|
-
const hydratedChildren = field.fields.map((child) => hydrateField(child, values));
|
|
5732
|
+
const hydratedChildren = field.fields.map((child) => hydrateField(child, values, options));
|
|
5649
5733
|
return {
|
|
5650
5734
|
...field,
|
|
5651
5735
|
fields: hydratedChildren
|
|
@@ -5654,7 +5738,7 @@ function hydrateField(field, values) {
|
|
|
5654
5738
|
if (field.type === "sub-tabs") {
|
|
5655
5739
|
const hydratedTabs = field.tabs.map((tab) => ({
|
|
5656
5740
|
...tab,
|
|
5657
|
-
fields: tab.fields.map((child) => hydrateField(child, values))
|
|
5741
|
+
fields: tab.fields.map((child) => hydrateField(child, values, options))
|
|
5658
5742
|
}));
|
|
5659
5743
|
return {
|
|
5660
5744
|
...field,
|
|
@@ -5664,6 +5748,33 @@ function hydrateField(field, values) {
|
|
|
5664
5748
|
const key = field.key;
|
|
5665
5749
|
const storedValue = Object.prototype.hasOwnProperty.call(values, key) ? values[key] : void 0;
|
|
5666
5750
|
const defaultValue = field.default;
|
|
5751
|
+
const asView = (v) => isSecretMarker(v) || options.inlineSecretsAsViews === true && v !== void 0;
|
|
5752
|
+
if (isKeychainStoredField(field) && asView(storedValue)) return {
|
|
5753
|
+
...field,
|
|
5754
|
+
value: toSecretFieldView(storedValue)
|
|
5755
|
+
};
|
|
5756
|
+
if (isKeychainStoredField(field) && options.inlineSecretsAsViews === true) return {
|
|
5757
|
+
...field,
|
|
5758
|
+
value: null
|
|
5759
|
+
};
|
|
5760
|
+
if (field.type === "editable-array" && Array.isArray(storedValue)) {
|
|
5761
|
+
const secretItemKeys = field.itemFields.filter((item) => "key" in item && isKeychainStoredField(item)).map((item) => "key" in item ? item.key : "");
|
|
5762
|
+
if (secretItemKeys.length > 0) {
|
|
5763
|
+
const rows = storedValue.map((row) => {
|
|
5764
|
+
if (row === null || typeof row !== "object" || Array.isArray(row)) return row;
|
|
5765
|
+
const out = { ...row };
|
|
5766
|
+
for (const k of secretItemKeys) {
|
|
5767
|
+
const v = Reflect.get(row, k);
|
|
5768
|
+
if (asView(v)) out[k] = toSecretFieldView(v);
|
|
5769
|
+
}
|
|
5770
|
+
return out;
|
|
5771
|
+
});
|
|
5772
|
+
return {
|
|
5773
|
+
...field,
|
|
5774
|
+
value: rows
|
|
5775
|
+
};
|
|
5776
|
+
}
|
|
5777
|
+
}
|
|
5667
5778
|
if (field.multiple) {
|
|
5668
5779
|
const stored = Array.isArray(storedValue) ? storedValue : storedValue !== void 0 && storedValue !== null ? [storedValue] : [];
|
|
5669
5780
|
const itemFallback = field.multiple.itemDefault !== void 0 ? field.multiple.itemDefault : defaultValue !== void 0 ? defaultValue : typeOf(field) === "string" ? "" : null;
|
|
@@ -5906,6 +6017,431 @@ function projectStore(store, perNodeKeys, nodeId) {
|
|
|
5906
6017
|
}
|
|
5907
6018
|
return out;
|
|
5908
6019
|
}
|
|
6020
|
+
var GLOBAL_SCOPE = { kind: "global" };
|
|
6021
|
+
/** The scope every addon-wide (not per-node, not per-device) setting lives in. */
|
|
6022
|
+
function globalSecretScope() {
|
|
6023
|
+
return GLOBAL_SCOPE;
|
|
6024
|
+
}
|
|
6025
|
+
function encodeSegment(value) {
|
|
6026
|
+
return encodeURIComponent(value);
|
|
6027
|
+
}
|
|
6028
|
+
/**
|
|
6029
|
+
* The field path of a value inside an array item, addressed by the item's id:
|
|
6030
|
+
* `arrayItemFieldPath('providers', 'authentik', 'clientSecret')` →
|
|
6031
|
+
* `providers[authentik].clientSecret`.
|
|
6032
|
+
*/
|
|
6033
|
+
function arrayItemFieldPath(arrayKey, itemId, fieldKey) {
|
|
6034
|
+
return `${arrayKey}[${encodeSegment(itemId)}].${fieldKey}`;
|
|
6035
|
+
}
|
|
6036
|
+
/** A write to a secret path could not be stored in the keychain, so it was refused. */
|
|
6037
|
+
var KeychainWriteRefusedError = class extends Error {
|
|
6038
|
+
fieldPath;
|
|
6039
|
+
constructor(fieldPath, cause) {
|
|
6040
|
+
super(`secret "${fieldPath}" was not saved: the keychain could not store it (${cause instanceof Error ? cause.message : String(cause)}). Nothing was written.`);
|
|
6041
|
+
this.fieldPath = fieldPath;
|
|
6042
|
+
this.name = "KeychainWriteRefusedError";
|
|
6043
|
+
}
|
|
6044
|
+
};
|
|
6045
|
+
var KEEP = { kind: "keep" };
|
|
6046
|
+
function isRecord(value) {
|
|
6047
|
+
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
6048
|
+
}
|
|
6049
|
+
function defaultMintId() {
|
|
6050
|
+
return globalThis.crypto.randomUUID();
|
|
6051
|
+
}
|
|
6052
|
+
/** Every marker ref anywhere under `value`. */
|
|
6053
|
+
function collectSecretMarkerRefs(value, out = []) {
|
|
6054
|
+
if (isSecretMarker(value)) {
|
|
6055
|
+
out.push(value.$secret);
|
|
6056
|
+
return out;
|
|
6057
|
+
}
|
|
6058
|
+
if (Array.isArray(value)) for (const item of value) collectSecretMarkerRefs(item, out);
|
|
6059
|
+
else if (isRecord(value)) for (const child of Object.values(value)) collectSecretMarkerRefs(child, out);
|
|
6060
|
+
return out;
|
|
6061
|
+
}
|
|
6062
|
+
async function storedValueEquals(secrets, marker, candidate) {
|
|
6063
|
+
const resolved = (await secrets.resolve([marker.$secret]))[marker.$secret];
|
|
6064
|
+
return resolved?.kind === "value" && resolved.value === candidate;
|
|
6065
|
+
}
|
|
6066
|
+
async function writeLeaf(ctx, incoming, stored, fieldPath) {
|
|
6067
|
+
const intent = classifySecretWrite(incoming);
|
|
6068
|
+
const ref = ctx.secrets.ref(ctx.scope, fieldPath);
|
|
6069
|
+
const storedIsOurs = isSecretMarker(stored) && stored.$secret === ref;
|
|
6070
|
+
if (intent.kind === "keep") return KEEP;
|
|
6071
|
+
if (intent.kind === "set" && !ctx.operatorWrite && typeof stored === "string" && stored === intent.value) return KEEP;
|
|
6072
|
+
if (intent.kind === "clear") {
|
|
6073
|
+
if (storedIsOurs) ctx.deletes.push(ref);
|
|
6074
|
+
return {
|
|
6075
|
+
kind: "value",
|
|
6076
|
+
value: null
|
|
6077
|
+
};
|
|
6078
|
+
}
|
|
6079
|
+
if (storedIsOurs && await storedValueEquals(ctx.secrets, stored, intent.value)) return {
|
|
6080
|
+
kind: "value",
|
|
6081
|
+
value: stored
|
|
6082
|
+
};
|
|
6083
|
+
try {
|
|
6084
|
+
await ctx.secrets.put(ref, intent.value);
|
|
6085
|
+
} catch (err) {
|
|
6086
|
+
throw new KeychainWriteRefusedError(fieldPath, err);
|
|
6087
|
+
}
|
|
6088
|
+
return {
|
|
6089
|
+
kind: "value",
|
|
6090
|
+
value: makeSecretMarker(ref)
|
|
6091
|
+
};
|
|
6092
|
+
}
|
|
6093
|
+
/** Apply a member result onto `out`: KEEP restores the stored member, or removes it. */
|
|
6094
|
+
function applyMember(out, key, result, storedParent) {
|
|
6095
|
+
if (result.kind === "value") {
|
|
6096
|
+
out[key] = result.value;
|
|
6097
|
+
return;
|
|
6098
|
+
}
|
|
6099
|
+
if (Object.prototype.hasOwnProperty.call(storedParent, key)) out[key] = storedParent[key];
|
|
6100
|
+
else delete out[key];
|
|
6101
|
+
}
|
|
6102
|
+
async function writeMembers(ctx, children, incoming, stored, pathOf) {
|
|
6103
|
+
const out = { ...incoming };
|
|
6104
|
+
for (const [member, node] of children) applyMember(out, member, await writeNode(ctx, node, incoming[member], stored[member], pathOf(member)), stored);
|
|
6105
|
+
return out;
|
|
6106
|
+
}
|
|
6107
|
+
function rowId(row, idKey) {
|
|
6108
|
+
const raw = row[idKey];
|
|
6109
|
+
if (typeof raw === "string" && raw.length > 0) return raw;
|
|
6110
|
+
if (typeof raw === "number" && Number.isFinite(raw)) return String(raw);
|
|
6111
|
+
return null;
|
|
6112
|
+
}
|
|
6113
|
+
async function writeArray(ctx, node, incoming, stored, fieldPath) {
|
|
6114
|
+
const storedRows = Array.isArray(stored) ? stored.filter(isRecord) : [];
|
|
6115
|
+
if (!Array.isArray(incoming)) {
|
|
6116
|
+
ctx.deletes.push(...collectSecretMarkerRefs(storedRows));
|
|
6117
|
+
return {
|
|
6118
|
+
kind: "value",
|
|
6119
|
+
value: incoming
|
|
6120
|
+
};
|
|
6121
|
+
}
|
|
6122
|
+
const storedById = /* @__PURE__ */ new Map();
|
|
6123
|
+
for (const row of storedRows) {
|
|
6124
|
+
const id = rowId(row, node.idKey);
|
|
6125
|
+
if (id !== null) storedById.set(id, row);
|
|
6126
|
+
}
|
|
6127
|
+
const kept = /* @__PURE__ */ new Set();
|
|
6128
|
+
const rows = [];
|
|
6129
|
+
for (const row of incoming) {
|
|
6130
|
+
if (!isRecord(row)) {
|
|
6131
|
+
rows.push(row);
|
|
6132
|
+
continue;
|
|
6133
|
+
}
|
|
6134
|
+
const id = rowId(row, node.idKey) ?? ctx.mintId();
|
|
6135
|
+
kept.add(id);
|
|
6136
|
+
const withId = {
|
|
6137
|
+
...row,
|
|
6138
|
+
[node.idKey]: row[node.idKey] ?? id
|
|
6139
|
+
};
|
|
6140
|
+
if (rowId(withId, node.idKey) === null) withId[node.idKey] = id;
|
|
6141
|
+
const storedRow = storedById.get(id) ?? {};
|
|
6142
|
+
rows.push(await writeMembers(ctx, node.item, withId, storedRow, (member) => arrayItemFieldPath(fieldPath, id, member)));
|
|
6143
|
+
}
|
|
6144
|
+
for (const [id, row] of storedById) if (!kept.has(id)) ctx.deletes.push(...collectSecretMarkerRefs(row));
|
|
6145
|
+
return {
|
|
6146
|
+
kind: "value",
|
|
6147
|
+
value: rows
|
|
6148
|
+
};
|
|
6149
|
+
}
|
|
6150
|
+
async function writeNode(ctx, node, incoming, stored, fieldPath) {
|
|
6151
|
+
switch (node.kind) {
|
|
6152
|
+
case "leaf": return writeLeaf(ctx, incoming, stored, fieldPath);
|
|
6153
|
+
case "array": return writeArray(ctx, node, incoming, stored, fieldPath);
|
|
6154
|
+
case "object": {
|
|
6155
|
+
if (!isRecord(incoming)) {
|
|
6156
|
+
if (incoming === void 0) return KEEP;
|
|
6157
|
+
ctx.deletes.push(...collectSecretMarkerRefs(stored));
|
|
6158
|
+
return {
|
|
6159
|
+
kind: "value",
|
|
6160
|
+
value: incoming
|
|
6161
|
+
};
|
|
6162
|
+
}
|
|
6163
|
+
const storedObj = isRecord(stored) ? stored : {};
|
|
6164
|
+
return {
|
|
6165
|
+
kind: "value",
|
|
6166
|
+
value: await writeMembers(ctx, node.children, incoming, storedObj, (m) => `${fieldPath}.${m}`)
|
|
6167
|
+
};
|
|
6168
|
+
}
|
|
6169
|
+
}
|
|
6170
|
+
}
|
|
6171
|
+
/** Split a perNode-scoped key (`key@nodeId`). */
|
|
6172
|
+
function splitNodeKey(key) {
|
|
6173
|
+
const at = key.indexOf("@");
|
|
6174
|
+
return at <= 0 ? {
|
|
6175
|
+
base: key,
|
|
6176
|
+
nodeId: null
|
|
6177
|
+
} : {
|
|
6178
|
+
base: key.slice(0, at),
|
|
6179
|
+
nodeId: key.slice(at + 1)
|
|
6180
|
+
};
|
|
6181
|
+
}
|
|
6182
|
+
/** Rewrite a settings patch so no secret value reaches the blob. See the file doc. */
|
|
6183
|
+
async function transformSecretWrite(input) {
|
|
6184
|
+
const deletes = [];
|
|
6185
|
+
const base = {
|
|
6186
|
+
secrets: input.secrets,
|
|
6187
|
+
mintId: input.mintId ?? defaultMintId,
|
|
6188
|
+
deletes,
|
|
6189
|
+
operatorWrite: input.operatorWrite === true
|
|
6190
|
+
};
|
|
6191
|
+
const out = {};
|
|
6192
|
+
for (const [key, incoming] of Object.entries(input.patch)) {
|
|
6193
|
+
const { base: baseKey, nodeId } = splitNodeKey(key);
|
|
6194
|
+
const node = input.tree.get(baseKey);
|
|
6195
|
+
if (node === void 0) {
|
|
6196
|
+
out[key] = incoming;
|
|
6197
|
+
continue;
|
|
6198
|
+
}
|
|
6199
|
+
const scope = nodeId !== null && nodeId.length > 0 ? {
|
|
6200
|
+
kind: "node",
|
|
6201
|
+
nodeId
|
|
6202
|
+
} : input.scope ?? globalSecretScope();
|
|
6203
|
+
const result = await writeNode({
|
|
6204
|
+
...base,
|
|
6205
|
+
scope
|
|
6206
|
+
}, node, incoming, input.stored[key], baseKey);
|
|
6207
|
+
if (result.kind === "value") out[key] = result.value;
|
|
6208
|
+
}
|
|
6209
|
+
return {
|
|
6210
|
+
patch: out,
|
|
6211
|
+
afterWrite: async () => {
|
|
6212
|
+
if (deletes.length === 0) return { orphaned: [] };
|
|
6213
|
+
try {
|
|
6214
|
+
await input.secrets.delete([...new Set(deletes)]);
|
|
6215
|
+
return { orphaned: [] };
|
|
6216
|
+
} catch {
|
|
6217
|
+
return { orphaned: [...new Set(deletes)] };
|
|
6218
|
+
}
|
|
6219
|
+
}
|
|
6220
|
+
};
|
|
6221
|
+
}
|
|
6222
|
+
/**
|
|
6223
|
+
* Replace every marker in `value` with its keychain value. Returns the SAME
|
|
6224
|
+
* reference when there is no marker (no allocation, no keychain call).
|
|
6225
|
+
*/
|
|
6226
|
+
async function resolveSecretMarkers(value, secrets) {
|
|
6227
|
+
const refs = collectSecretMarkerRefs(value);
|
|
6228
|
+
if (refs.length === 0) return {
|
|
6229
|
+
value,
|
|
6230
|
+
unresolved: []
|
|
6231
|
+
};
|
|
6232
|
+
const answers = await secrets.resolve(refs);
|
|
6233
|
+
const unresolved = [];
|
|
6234
|
+
for (const ref of new Set(refs)) {
|
|
6235
|
+
const answer = answers[ref];
|
|
6236
|
+
if (answer === void 0) unresolved.push({
|
|
6237
|
+
ref,
|
|
6238
|
+
reason: "not-initialized"
|
|
6239
|
+
});
|
|
6240
|
+
else if (answer.kind === "unavailable") unresolved.push({
|
|
6241
|
+
ref,
|
|
6242
|
+
reason: answer.reason
|
|
6243
|
+
});
|
|
6244
|
+
else if (answer.kind === "missing" || answer.kind === "forbidden") unresolved.push({
|
|
6245
|
+
ref,
|
|
6246
|
+
reason: answer.kind
|
|
6247
|
+
});
|
|
6248
|
+
}
|
|
6249
|
+
const substitute = (v) => {
|
|
6250
|
+
if (isSecretMarker(v)) {
|
|
6251
|
+
const answer = answers[v.$secret];
|
|
6252
|
+
return answer?.kind === "value" ? {
|
|
6253
|
+
keep: true,
|
|
6254
|
+
value: answer.value
|
|
6255
|
+
} : {
|
|
6256
|
+
keep: false,
|
|
6257
|
+
value: void 0
|
|
6258
|
+
};
|
|
6259
|
+
}
|
|
6260
|
+
if (Array.isArray(v)) {
|
|
6261
|
+
const items = [];
|
|
6262
|
+
for (const item of v) {
|
|
6263
|
+
const s = substitute(item);
|
|
6264
|
+
if (s.keep) items.push(s.value);
|
|
6265
|
+
}
|
|
6266
|
+
return {
|
|
6267
|
+
keep: true,
|
|
6268
|
+
value: items
|
|
6269
|
+
};
|
|
6270
|
+
}
|
|
6271
|
+
if (isRecord(v)) {
|
|
6272
|
+
const out = {};
|
|
6273
|
+
for (const [k, child] of Object.entries(v)) {
|
|
6274
|
+
const s = substitute(child);
|
|
6275
|
+
if (s.keep) out[k] = s.value;
|
|
6276
|
+
}
|
|
6277
|
+
return {
|
|
6278
|
+
keep: true,
|
|
6279
|
+
value: out
|
|
6280
|
+
};
|
|
6281
|
+
}
|
|
6282
|
+
return {
|
|
6283
|
+
keep: true,
|
|
6284
|
+
value: v
|
|
6285
|
+
};
|
|
6286
|
+
};
|
|
6287
|
+
return {
|
|
6288
|
+
value: substitute(value).value,
|
|
6289
|
+
unresolved
|
|
6290
|
+
};
|
|
6291
|
+
}
|
|
6292
|
+
function touchesTree(tree, patch) {
|
|
6293
|
+
if (tree.size === 0) return false;
|
|
6294
|
+
for (const key of Object.keys(patch)) {
|
|
6295
|
+
const at = key.indexOf("@");
|
|
6296
|
+
if (tree.has(at > 0 ? key.slice(0, at) : key)) return true;
|
|
6297
|
+
}
|
|
6298
|
+
return false;
|
|
6299
|
+
}
|
|
6300
|
+
/** The blob as stored now; a failed read REFUSES the write instead of guessing. */
|
|
6301
|
+
async function readStoredAddonBlob(raw) {
|
|
6302
|
+
const threeWay = raw.readAddonStoreResult;
|
|
6303
|
+
if (threeWay === void 0) return raw.readAddonStore();
|
|
6304
|
+
const result = await threeWay.call(raw);
|
|
6305
|
+
if (result.kind === "failed") throw new Error(`settings write refused: the stored blob could not be read (${result.error})`);
|
|
6306
|
+
return result.kind === "missing" ? {} : result.value;
|
|
6307
|
+
}
|
|
6308
|
+
function createSecretAwareSettings(raw, opts) {
|
|
6309
|
+
const chains = /* @__PURE__ */ new Map();
|
|
6310
|
+
const serialize = (key, fn) => {
|
|
6311
|
+
const next = (chains.get(key) ?? Promise.resolve()).then(fn, fn);
|
|
6312
|
+
const tail = next.catch(() => void 0);
|
|
6313
|
+
chains.set(key, tail);
|
|
6314
|
+
tail.then(() => {
|
|
6315
|
+
if (chains.get(key) === tail) chains.delete(key);
|
|
6316
|
+
});
|
|
6317
|
+
return next;
|
|
6318
|
+
};
|
|
6319
|
+
const write = async (chainKey, tree, scope, patch, readStored, rawWrite) => {
|
|
6320
|
+
if (!touchesTree(tree, patch)) return rawWrite(patch);
|
|
6321
|
+
return serialize(chainKey, async () => {
|
|
6322
|
+
const stored = await readStored();
|
|
6323
|
+
const result = await transformSecretWrite({
|
|
6324
|
+
tree,
|
|
6325
|
+
secrets: opts.secrets,
|
|
6326
|
+
patch,
|
|
6327
|
+
stored,
|
|
6328
|
+
...scope !== void 0 ? { scope } : {},
|
|
6329
|
+
operatorWrite: opts.isOperatorWrite?.() === true
|
|
6330
|
+
});
|
|
6331
|
+
if (Object.keys(result.patch).length > 0) await rawWrite(result.patch);
|
|
6332
|
+
const { orphaned } = await result.afterWrite();
|
|
6333
|
+
if (orphaned.length > 0) opts.onOrphaned(orphaned);
|
|
6334
|
+
});
|
|
6335
|
+
};
|
|
6336
|
+
const wrapped = {
|
|
6337
|
+
writeAddonStore: (patch) => write("addon", opts.addonTree(), void 0, patch, () => readStoredAddonBlob(raw), (p) => raw.writeAddonStore(p)),
|
|
6338
|
+
writeDeviceStore: (deviceId, patch) => write(`device:${deviceId}`, opts.deviceTree(), {
|
|
6339
|
+
kind: "device",
|
|
6340
|
+
deviceId
|
|
6341
|
+
}, patch, () => raw.readDeviceStore(deviceId), (p) => raw.writeDeviceStore(deviceId, p))
|
|
6342
|
+
};
|
|
6343
|
+
return new Proxy(raw, { get(target, prop, receiver) {
|
|
6344
|
+
if (prop === "writeAddonStore") return wrapped.writeAddonStore;
|
|
6345
|
+
if (prop === "writeDeviceStore") return wrapped.writeDeviceStore;
|
|
6346
|
+
const value = Reflect.get(target, prop, receiver);
|
|
6347
|
+
return typeof value === "function" ? value.bind(target) : value;
|
|
6348
|
+
} });
|
|
6349
|
+
}
|
|
6350
|
+
/** The context the addon sees: identical, except that its settings writes are secret-aware. */
|
|
6351
|
+
function withSecretAwareSettings(context, opts) {
|
|
6352
|
+
const raw = context.settings;
|
|
6353
|
+
if (raw === void 0) return context;
|
|
6354
|
+
const settings = createSecretAwareSettings(raw, opts);
|
|
6355
|
+
return new Proxy(context, { get(target, prop, receiver) {
|
|
6356
|
+
if (prop === "settings") return settings;
|
|
6357
|
+
return Reflect.get(target, prop, receiver);
|
|
6358
|
+
} });
|
|
6359
|
+
}
|
|
6360
|
+
var LEAF = { kind: "leaf" };
|
|
6361
|
+
var DEFAULT_ITEM_ID_KEY = "id";
|
|
6362
|
+
function collectFields(fields, out) {
|
|
6363
|
+
for (const field of fields) {
|
|
6364
|
+
if (field.type === "group") {
|
|
6365
|
+
collectFields(field.fields, out);
|
|
6366
|
+
continue;
|
|
6367
|
+
}
|
|
6368
|
+
if (field.type === "sub-tabs") {
|
|
6369
|
+
for (const tab of field.tabs) collectFields(tab.fields, out);
|
|
6370
|
+
continue;
|
|
6371
|
+
}
|
|
6372
|
+
if (field.type === "editable-array") {
|
|
6373
|
+
const item = /* @__PURE__ */ new Map();
|
|
6374
|
+
for (const itemField of field.itemFields) if ("key" in itemField && isKeychainStoredField(itemField)) item.set(itemField.key, LEAF);
|
|
6375
|
+
if (item.size > 0) out.set(field.key, {
|
|
6376
|
+
kind: "array",
|
|
6377
|
+
idKey: field.itemIdKey ?? DEFAULT_ITEM_ID_KEY,
|
|
6378
|
+
item
|
|
6379
|
+
});
|
|
6380
|
+
continue;
|
|
6381
|
+
}
|
|
6382
|
+
if (!("key" in field) || typeof field.key !== "string") continue;
|
|
6383
|
+
if (isKeychainStoredField(field)) out.set(field.key, LEAF);
|
|
6384
|
+
}
|
|
6385
|
+
}
|
|
6386
|
+
/** The secret tree a settings schema declares. */
|
|
6387
|
+
function secretTreeFromSchema(schema) {
|
|
6388
|
+
const out = /* @__PURE__ */ new Map();
|
|
6389
|
+
if (schema === null) return out;
|
|
6390
|
+
for (const section of schema.sections) collectFields(section.fields, out);
|
|
6391
|
+
return out;
|
|
6392
|
+
}
|
|
6393
|
+
/** Parse `a.b[id].c` into segments; throws on a malformed path (a declaration bug). */
|
|
6394
|
+
function parseSecretStatePath(path) {
|
|
6395
|
+
const segments = [];
|
|
6396
|
+
for (const raw of path.split(".")) {
|
|
6397
|
+
const m = /^([^[\]]+)(?:\[([^[\]]+)\])?$/.exec(raw);
|
|
6398
|
+
if (m === null || m[1] === void 0) throw new Error(`secretStatePaths: malformed path "${path}"`);
|
|
6399
|
+
segments.push(m[2] !== void 0 ? {
|
|
6400
|
+
key: m[1],
|
|
6401
|
+
idKey: m[2]
|
|
6402
|
+
} : { key: m[1] });
|
|
6403
|
+
}
|
|
6404
|
+
if (segments.length === 0) throw new Error(`secretStatePaths: empty path`);
|
|
6405
|
+
if (segments[segments.length - 1]?.idKey !== void 0) throw new Error(`secretStatePaths: "${path}" ends on an array — name the member that is secret`);
|
|
6406
|
+
return segments;
|
|
6407
|
+
}
|
|
6408
|
+
function insert(into, segments) {
|
|
6409
|
+
const [head, ...rest] = segments;
|
|
6410
|
+
if (head === void 0) return;
|
|
6411
|
+
if (rest.length === 0) {
|
|
6412
|
+
into.set(head.key, LEAF);
|
|
6413
|
+
return;
|
|
6414
|
+
}
|
|
6415
|
+
const existing = into.get(head.key);
|
|
6416
|
+
if (head.idKey !== void 0) {
|
|
6417
|
+
const item = new Map(existing?.kind === "array" ? existing.item : []);
|
|
6418
|
+
insert(item, rest);
|
|
6419
|
+
into.set(head.key, {
|
|
6420
|
+
kind: "array",
|
|
6421
|
+
idKey: head.idKey,
|
|
6422
|
+
item
|
|
6423
|
+
});
|
|
6424
|
+
return;
|
|
6425
|
+
}
|
|
6426
|
+
const children = new Map(existing?.kind === "object" ? existing.children : []);
|
|
6427
|
+
insert(children, rest);
|
|
6428
|
+
into.set(head.key, {
|
|
6429
|
+
kind: "object",
|
|
6430
|
+
children
|
|
6431
|
+
});
|
|
6432
|
+
}
|
|
6433
|
+
/** Add hidden-state paths (`secretStatePaths`) to a schema-derived tree. */
|
|
6434
|
+
function mergeSecretStatePaths(tree, paths) {
|
|
6435
|
+
if (paths.length === 0) return tree;
|
|
6436
|
+
const out = new Map(tree);
|
|
6437
|
+
for (const path of paths) insert(out, parseSecretStatePath(path));
|
|
6438
|
+
return out;
|
|
6439
|
+
}
|
|
6440
|
+
/** First retry of a secret the keychain could not serve; doubles to {@link SECRET_RETRY_MAX_MS}. */
|
|
6441
|
+
var SECRET_RETRY_FIRST_MS = 5e3;
|
|
6442
|
+
var SECRET_RETRY_MAX_MS = 5 * 6e4;
|
|
6443
|
+
/** Coalesces a burst of `keychain.changed` events into one re-resolve. */
|
|
6444
|
+
var SECRET_CHANGE_DEBOUNCE_MS = 250;
|
|
5909
6445
|
/**
|
|
5910
6446
|
* Base class for CamStack addons. Eliminates settings boilerplate:
|
|
5911
6447
|
*
|
|
@@ -5975,6 +6511,25 @@ var BaseAddon = class {
|
|
|
5975
6511
|
settingsStoreReady = false;
|
|
5976
6512
|
/** Default config values. Provided via constructor. */
|
|
5977
6513
|
defaults;
|
|
6514
|
+
/**
|
|
6515
|
+
* Hidden-state paths that hold secrets (D787) — values the addon writes
|
|
6516
|
+
* itself (`updateGlobalSettings`, `state()`) that no form field declares.
|
|
6517
|
+
* Stored in the keychain exactly like a `password` field. Syntax:
|
|
6518
|
+
* `'snapshotSigningKey'`, `'identity.pincode'`, `'tokens[userId].accessToken'`
|
|
6519
|
+
* (`key[<id field>]` addresses array items by id, never by index).
|
|
6520
|
+
*/
|
|
6521
|
+
secretStatePaths = [];
|
|
6522
|
+
_addonSecretTree = null;
|
|
6523
|
+
_deviceSecretTree = null;
|
|
6524
|
+
/** Refs the last resolved config pointed at — a change to one re-resolves. */
|
|
6525
|
+
_configSecretRefs = /* @__PURE__ */ new Set();
|
|
6526
|
+
_unresolvedSecrets = [];
|
|
6527
|
+
_secretRetryTimer = null;
|
|
6528
|
+
_secretRetryDelayMs = SECRET_RETRY_FIRST_MS;
|
|
6529
|
+
_secretChangeTimer = null;
|
|
6530
|
+
_secretChangeUnsub = null;
|
|
6531
|
+
/** >0 while an OPERATOR's settings write is being applied. */
|
|
6532
|
+
_operatorWriteDepth = 0;
|
|
5978
6533
|
constructor(defaults) {
|
|
5979
6534
|
this.defaults = defaults;
|
|
5980
6535
|
this._config = { ...defaults };
|
|
@@ -6010,8 +6565,18 @@ var BaseAddon = class {
|
|
|
6010
6565
|
return this._config;
|
|
6011
6566
|
}
|
|
6012
6567
|
async initialize(context) {
|
|
6013
|
-
|
|
6568
|
+
const secrets = context.secrets;
|
|
6569
|
+
this._ctx = secrets !== void 0 ? withSecretAwareSettings(context, {
|
|
6570
|
+
secrets,
|
|
6571
|
+
addonTree: () => this.addonSecretTree(),
|
|
6572
|
+
deviceTree: () => this.deviceSecretTree(),
|
|
6573
|
+
onOrphaned: (refs) => context.logger.warn("keychain refs dropped by a settings write could not be deleted", { meta: { refs: [...refs] } }),
|
|
6574
|
+
isOperatorWrite: () => this._operatorWriteDepth > 0
|
|
6575
|
+
}) : context;
|
|
6014
6576
|
await this.resolveConfig();
|
|
6577
|
+
if (secrets !== void 0) this._secretChangeUnsub = secrets.onChange((ref) => {
|
|
6578
|
+
if (this._configSecretRefs.has(ref)) this.scheduleSecretReresolve(SECRET_CHANGE_DEBOUNCE_MS);
|
|
6579
|
+
});
|
|
6015
6580
|
const result = await this.onInitialize();
|
|
6016
6581
|
this.emitLifecycle(EventCategory.AddonStarted);
|
|
6017
6582
|
const normalized = normalizeAddonInitResult(result);
|
|
@@ -6044,6 +6609,12 @@ var BaseAddon = class {
|
|
|
6044
6609
|
*/
|
|
6045
6610
|
async onHubReachable() {}
|
|
6046
6611
|
async shutdown() {
|
|
6612
|
+
this._secretChangeUnsub?.();
|
|
6613
|
+
this._secretChangeUnsub = null;
|
|
6614
|
+
if (this._secretRetryTimer !== null) clearTimeout(this._secretRetryTimer);
|
|
6615
|
+
if (this._secretChangeTimer !== null) clearTimeout(this._secretChangeTimer);
|
|
6616
|
+
this._secretRetryTimer = null;
|
|
6617
|
+
this._secretChangeTimer = null;
|
|
6047
6618
|
this.emitLifecycle(EventCategory.AddonStopped);
|
|
6048
6619
|
if (this.autoEmitReadiness) this.emitReadinessForProviders("down");
|
|
6049
6620
|
await this.onShutdown();
|
|
@@ -6122,7 +6693,7 @@ var BaseAddon = class {
|
|
|
6122
6693
|
return hydrateSchema(schema, overlay ? {
|
|
6123
6694
|
...projected,
|
|
6124
6695
|
...overlay
|
|
6125
|
-
} : projected);
|
|
6696
|
+
} : projected, { inlineSecretsAsViews: true });
|
|
6126
6697
|
}
|
|
6127
6698
|
/**
|
|
6128
6699
|
* The integration-level view of this addon's settings: exactly the sections
|
|
@@ -6171,7 +6742,7 @@ var BaseAddon = class {
|
|
|
6171
6742
|
return hydrateSchema({
|
|
6172
6743
|
...schema,
|
|
6173
6744
|
sections
|
|
6174
|
-
}, projected);
|
|
6745
|
+
}, projected, { inlineSecretsAsViews: true });
|
|
6175
6746
|
}
|
|
6176
6747
|
/**
|
|
6177
6748
|
* The raw addon store PROJECTED onto the target node's bare per-node keys:
|
|
@@ -6225,18 +6796,50 @@ var BaseAddon = class {
|
|
|
6225
6796
|
value: result.value[key]
|
|
6226
6797
|
};
|
|
6227
6798
|
}
|
|
6799
|
+
/**
|
|
6800
|
+
* The OPERATOR's write — a settings form or an admin API call, dispatched by
|
|
6801
|
+
* the kernel. Identical to {@link updateGlobalSettings}, except that a secret
|
|
6802
|
+
* the operator sends is stored as sent even when it equals a pre-keychain
|
|
6803
|
+
* inline value: the operator re-entering a password is a change, an addon
|
|
6804
|
+
* writing back what it read is not (D787).
|
|
6805
|
+
*/
|
|
6806
|
+
async updateGlobalSettingsAsOperator(patch, nodeId) {
|
|
6807
|
+
this._operatorWriteDepth++;
|
|
6808
|
+
try {
|
|
6809
|
+
await this.applyGlobalPatch(patch, nodeId);
|
|
6810
|
+
} finally {
|
|
6811
|
+
this._operatorWriteDepth--;
|
|
6812
|
+
}
|
|
6813
|
+
}
|
|
6228
6814
|
async updateGlobalSettings(patch, nodeId) {
|
|
6815
|
+
await this.applyGlobalPatch(patch, nodeId);
|
|
6816
|
+
}
|
|
6817
|
+
/**
|
|
6818
|
+
* REMOVE stored secrets — their keychain values and their markers (D787).
|
|
6819
|
+
*
|
|
6820
|
+
* Writing `''` to a secret field KEEPS what is stored (an empty string is
|
|
6821
|
+
* what a defaults fallback writes back, and it must never destroy a
|
|
6822
|
+
* credential), so code that means "forget this token" says so here. Without
|
|
6823
|
+
* a keychain (an older kernel) it writes `''`, as such code always did.
|
|
6824
|
+
*/
|
|
6825
|
+
async clearSecrets(keys, nodeId) {
|
|
6826
|
+
const tree = this.addonSecretTree();
|
|
6827
|
+
const keychain = this._ctx?.secrets !== void 0;
|
|
6828
|
+
const patch = {};
|
|
6829
|
+
for (const key of keys) patch[key] = keychain && tree.has(key) ? SECRET_CLEAR : "";
|
|
6830
|
+
await this.applyGlobalPatch(patch, nodeId);
|
|
6831
|
+
}
|
|
6832
|
+
async applyGlobalPatch(barePatch, nodeId) {
|
|
6229
6833
|
const keys = this.perNodeKeys();
|
|
6230
6834
|
const localNode = normalizeNodeId(this._ctx?.kernel?.localNodeId);
|
|
6231
6835
|
const target = normalizeNodeId(nodeId ?? this._ctx?.kernel?.localNodeId);
|
|
6232
|
-
const barePatch = patch;
|
|
6233
6836
|
const scoped = keys.size > 0 ? scopePatch(barePatch, keys, target) : barePatch;
|
|
6234
6837
|
await this._ctx?.settings?.writeAddonStore(scoped);
|
|
6235
6838
|
if (target !== localNode) return;
|
|
6236
6839
|
await this.resolveConfig();
|
|
6237
6840
|
await this.onConfigChanged();
|
|
6238
6841
|
this.emitLifecycle(EventCategory.AddonUpdated, { level: "global" });
|
|
6239
|
-
this.maybeAutoRestart(
|
|
6842
|
+
this.maybeAutoRestart(Object.keys(barePatch), this.globalSettingsSchema());
|
|
6240
6843
|
}
|
|
6241
6844
|
/**
|
|
6242
6845
|
* The set of field keys the global settings schema declares `perNode: true`
|
|
@@ -6261,7 +6864,7 @@ var BaseAddon = class {
|
|
|
6261
6864
|
* time to return its response before the addon is torn down and
|
|
6262
6865
|
* re-initialised by `AddonRegistryService.restartAddon`.
|
|
6263
6866
|
*/
|
|
6264
|
-
maybeAutoRestart(
|
|
6867
|
+
maybeAutoRestart(patchKeys, schema) {
|
|
6265
6868
|
if (!schema) return;
|
|
6266
6869
|
const restartKeys = /* @__PURE__ */ new Set();
|
|
6267
6870
|
for (const section of schema.sections) for (const field of section.fields) {
|
|
@@ -6269,13 +6872,13 @@ var BaseAddon = class {
|
|
|
6269
6872
|
if (field.requiresRestart) restartKeys.add(field.key);
|
|
6270
6873
|
}
|
|
6271
6874
|
if (restartKeys.size === 0) return;
|
|
6272
|
-
if (!
|
|
6875
|
+
if (!patchKeys.some((k) => restartKeys.has(k))) return;
|
|
6273
6876
|
const ctx = this._ctx;
|
|
6274
6877
|
if (!ctx) return;
|
|
6275
6878
|
const addonId = ctx.id;
|
|
6276
6879
|
setImmediate(() => {
|
|
6277
6880
|
ctx.api.addons?.restartAddon?.mutate({ addonId }).then(() => {
|
|
6278
|
-
ctx.logger.info("addon auto-restart triggered by restart-required setting change", { meta: { changedFields:
|
|
6881
|
+
ctx.logger.info("addon auto-restart triggered by restart-required setting change", { meta: { changedFields: patchKeys.filter((k) => restartKeys.has(k)) } });
|
|
6279
6882
|
}).catch((err) => {
|
|
6280
6883
|
ctx.logger.error("addon auto-restart failed", { meta: { error: err instanceof Error ? err.message : String(err) } });
|
|
6281
6884
|
});
|
|
@@ -6284,7 +6887,7 @@ var BaseAddon = class {
|
|
|
6284
6887
|
async getDeviceSettings(deviceId) {
|
|
6285
6888
|
const schema = this.deviceSettingsSchema();
|
|
6286
6889
|
if (!schema) return { sections: [] };
|
|
6287
|
-
return hydrateSchema(schema, await this._ctx?.settings?.readDeviceStore(deviceId) ?? {});
|
|
6890
|
+
return hydrateSchema(schema, await this._ctx?.settings?.readDeviceStore(deviceId) ?? {}, { inlineSecretsAsViews: true });
|
|
6288
6891
|
}
|
|
6289
6892
|
async updateDeviceSettings(deviceId, patch) {
|
|
6290
6893
|
await this._ctx?.settings?.writeDeviceStore(deviceId, patch);
|
|
@@ -6414,7 +7017,7 @@ var BaseAddon = class {
|
|
|
6414
7017
|
* selection at boot (absent scoped key ⇒ the constructor default wins).
|
|
6415
7018
|
*/
|
|
6416
7019
|
async resolveConfig() {
|
|
6417
|
-
const stored = await this.readAddonStoreWithRetry();
|
|
7020
|
+
const stored = await this.resolveStoredSecrets(await this.readAddonStoreWithRetry());
|
|
6418
7021
|
const perNode = this.perNodeKeys();
|
|
6419
7022
|
const localNode = normalizeNodeId(this._ctx?.kernel?.localNodeId);
|
|
6420
7023
|
const resolved = { ...this.defaults };
|
|
@@ -6439,7 +7042,7 @@ var BaseAddon = class {
|
|
|
6439
7042
|
key,
|
|
6440
7043
|
schema,
|
|
6441
7044
|
fallback,
|
|
6442
|
-
read: () => this.readAddonStoreWithRetry(),
|
|
7045
|
+
read: async () => this.resolveStoredSecrets(await this.readAddonStoreWithRetry()),
|
|
6443
7046
|
write: async (patch) => {
|
|
6444
7047
|
await this._ctx?.settings?.writeAddonStore(patch);
|
|
6445
7048
|
},
|
|
@@ -6456,7 +7059,7 @@ var BaseAddon = class {
|
|
|
6456
7059
|
key,
|
|
6457
7060
|
schema,
|
|
6458
7061
|
fallback,
|
|
6459
|
-
read: async () => await this._ctx?.settings?.readDeviceStore(deviceId) ?? {},
|
|
7062
|
+
read: async () => this.resolveStoredSecrets(await this._ctx?.settings?.readDeviceStore(deviceId) ?? {}, false),
|
|
6460
7063
|
write: async (patch) => {
|
|
6461
7064
|
await this._ctx?.settings?.writeDeviceStore(deviceId, patch);
|
|
6462
7065
|
},
|
|
@@ -6468,6 +7071,70 @@ var BaseAddon = class {
|
|
|
6468
7071
|
} })
|
|
6469
7072
|
});
|
|
6470
7073
|
}
|
|
7074
|
+
/** The addon store's secret tree: schema fields by TYPE, plus `secretStatePaths`. */
|
|
7075
|
+
addonSecretTree() {
|
|
7076
|
+
this._addonSecretTree ??= mergeSecretStatePaths(secretTreeFromSchema(this.globalSettingsSchema()), this.secretStatePaths);
|
|
7077
|
+
return this._addonSecretTree;
|
|
7078
|
+
}
|
|
7079
|
+
deviceSecretTree() {
|
|
7080
|
+
this._deviceSecretTree ??= secretTreeFromSchema(this.deviceSettingsSchema());
|
|
7081
|
+
return this._deviceSecretTree;
|
|
7082
|
+
}
|
|
7083
|
+
/**
|
|
7084
|
+
* Secrets of this addon's stored config that could not be resolved on the
|
|
7085
|
+
* last read, with why. Non-empty means the addon is running WITHOUT them —
|
|
7086
|
+
* an addon whose function needs one should report itself degraded rather
|
|
7087
|
+
* than start on an empty credential.
|
|
7088
|
+
*/
|
|
7089
|
+
get unresolvedSecrets() {
|
|
7090
|
+
return this._unresolvedSecrets;
|
|
7091
|
+
}
|
|
7092
|
+
/**
|
|
7093
|
+
* Substitute every keychain marker in a stored blob with its value. With no
|
|
7094
|
+
* keychain (no `ctx.secrets`) or no marker, the blob comes back unchanged.
|
|
7095
|
+
* An unresolvable value is LEFT OUT (never `''`), logged by ref — never by
|
|
7096
|
+
* value — and, when the cause can pass, retried with backoff. Nothing is
|
|
7097
|
+
* ever written back from here.
|
|
7098
|
+
*/
|
|
7099
|
+
async resolveStoredSecrets(blob, trackForConfig = true) {
|
|
7100
|
+
const secrets = this._ctx?.secrets;
|
|
7101
|
+
if (secrets === void 0) return blob;
|
|
7102
|
+
const refs = collectSecretMarkerRefs(blob);
|
|
7103
|
+
if (trackForConfig) this._configSecretRefs = new Set(refs);
|
|
7104
|
+
if (refs.length === 0) {
|
|
7105
|
+
if (trackForConfig) this._unresolvedSecrets = [];
|
|
7106
|
+
return blob;
|
|
7107
|
+
}
|
|
7108
|
+
const { value, unresolved } = await resolveSecretMarkers(blob, secrets);
|
|
7109
|
+
if (trackForConfig) {
|
|
7110
|
+
this._unresolvedSecrets = unresolved;
|
|
7111
|
+
if (unresolved.length > 0) {
|
|
7112
|
+
this._ctx?.logger?.error?.("secret unavailable — running without it, will retry", { meta: { secrets: unresolved.map((u) => ({
|
|
7113
|
+
ref: u.ref,
|
|
7114
|
+
reason: u.reason
|
|
7115
|
+
})) } });
|
|
7116
|
+
if (unresolved.some((u) => u.reason !== "missing" && u.reason !== "forbidden")) {
|
|
7117
|
+
this.scheduleSecretReresolve(this._secretRetryDelayMs);
|
|
7118
|
+
this._secretRetryDelayMs = Math.min(this._secretRetryDelayMs * 2, SECRET_RETRY_MAX_MS);
|
|
7119
|
+
}
|
|
7120
|
+
} else this._secretRetryDelayMs = SECRET_RETRY_FIRST_MS;
|
|
7121
|
+
}
|
|
7122
|
+
return value;
|
|
7123
|
+
}
|
|
7124
|
+
/** Re-resolve the config (a keychain-only change, or a retry) and apply it. */
|
|
7125
|
+
scheduleSecretReresolve(delayMs) {
|
|
7126
|
+
const timerOf = delayMs === SECRET_CHANGE_DEBOUNCE_MS ? "_secretChangeTimer" : "_secretRetryTimer";
|
|
7127
|
+
if (this[timerOf] !== null) return;
|
|
7128
|
+
const timer = setTimeout(() => {
|
|
7129
|
+
this[timerOf] = null;
|
|
7130
|
+
if (this._ctx === null) return;
|
|
7131
|
+
this.resolveConfig().then(() => this.onConfigChanged()).catch((err) => {
|
|
7132
|
+
this._ctx?.logger?.error?.("re-resolving secrets failed", { meta: { error: err instanceof Error ? err.message : String(err) } });
|
|
7133
|
+
});
|
|
7134
|
+
}, delayMs);
|
|
7135
|
+
timer.unref?.();
|
|
7136
|
+
this[timerOf] = timer;
|
|
7137
|
+
}
|
|
6471
7138
|
/**
|
|
6472
7139
|
* Wrap `ctx.settings.readAddonStore()` with a short retry budget so a
|
|
6473
7140
|
* transient settings-store outage (mid-restart of sqlite-settings, tsx-watch
|
|
@@ -15271,6 +15938,254 @@ id: union([string(), number()]) }), {
|
|
|
15271
15938
|
})
|
|
15272
15939
|
}
|
|
15273
15940
|
};
|
|
15941
|
+
/**
|
|
15942
|
+
* `keychain` — the hub's encrypted store of secret values (D787).
|
|
15943
|
+
*
|
|
15944
|
+
* Settings blobs never hold a secret: they hold a marker
|
|
15945
|
+
* `{"$secret":"secret://<owner>/<scope>/<fieldPath>","v":1}` and the value
|
|
15946
|
+
* lives here, AES-256-GCM under a data key that a master key wraps. This cap
|
|
15947
|
+
* is the OWNER's door to its own values: every method is owner-checked
|
|
15948
|
+
* against the CALLER, never against anything the caller claims.
|
|
15949
|
+
*
|
|
15950
|
+
* Who the caller is: the transport stamps `callerAddonId` into the args of a
|
|
15951
|
+
* call that crossed a process (the parent `LocalChildRegistry` from the UDS
|
|
15952
|
+
* connection, the agent from its child's connection carried in
|
|
15953
|
+
* `$hub-cap-fwd`'s envelope). A stamp always overwrites; a wire call with no
|
|
15954
|
+
* stamp has its claim stripped. Only a hub in-process caller may state its own
|
|
15955
|
+
* identity — `ctx.secrets` does that with the addon id closed over. This is
|
|
15956
|
+
* identity against BUGS and misrouting, not against a malicious addon (every
|
|
15957
|
+
* runner is the same OS user): see the threat model in
|
|
15958
|
+
* `docs/design/2026-10-08-secrets-keychain.md`.
|
|
15959
|
+
*
|
|
15960
|
+
* `callerAddonId` is deliberately NOT in any input schema: the tRPC router
|
|
15961
|
+
* parses the input, so a session can never supply it, and the internal mount
|
|
15962
|
+
* floors every method to admin anyway (D240).
|
|
15963
|
+
*
|
|
15964
|
+
* Internal: addons reach it through `ctx.secrets`, never directly.
|
|
15965
|
+
*/
|
|
15966
|
+
/** Why a value cannot be served right now. Never folded into "missing". */
|
|
15967
|
+
var KeychainUnavailableReasonSchema = _enum([
|
|
15968
|
+
"key-missing",
|
|
15969
|
+
"wrong-key",
|
|
15970
|
+
"key-file-unreadable",
|
|
15971
|
+
"store-unavailable",
|
|
15972
|
+
"not-initialized",
|
|
15973
|
+
"decrypt-failed"
|
|
15974
|
+
]);
|
|
15975
|
+
var KeychainStateSchema = discriminatedUnion("state", [object({ state: literal("ready") }), object({
|
|
15976
|
+
state: literal("locked"),
|
|
15977
|
+
reason: KeychainUnavailableReasonSchema
|
|
15978
|
+
})]);
|
|
15979
|
+
var KeychainResolveEntrySchema = discriminatedUnion("kind", [
|
|
15980
|
+
object({
|
|
15981
|
+
kind: literal("value"),
|
|
15982
|
+
value: string(),
|
|
15983
|
+
version: number().int()
|
|
15984
|
+
}),
|
|
15985
|
+
object({ kind: literal("missing") }),
|
|
15986
|
+
object({
|
|
15987
|
+
kind: literal("unavailable"),
|
|
15988
|
+
reason: KeychainUnavailableReasonSchema
|
|
15989
|
+
}),
|
|
15990
|
+
object({ kind: literal("forbidden") })
|
|
15991
|
+
]);
|
|
15992
|
+
var KeychainResolveResultSchema = record(string(), KeychainResolveEntrySchema);
|
|
15993
|
+
/** Metadata of one stored value — never the value. */
|
|
15994
|
+
var KeychainSecretMetaSchema = object({
|
|
15995
|
+
ref: string(),
|
|
15996
|
+
owner: string(),
|
|
15997
|
+
/** Formatted scope (`global`, `node/<id>`, `device/<id>`, …). */
|
|
15998
|
+
scope: string(),
|
|
15999
|
+
fieldPath: string(),
|
|
16000
|
+
version: number().int(),
|
|
16001
|
+
createdAt: number(),
|
|
16002
|
+
updatedAt: number(),
|
|
16003
|
+
/** `addon:<id>` | `user:<id>` | `system`. */
|
|
16004
|
+
updatedBy: string(),
|
|
16005
|
+
/** Coarse — written at most once an hour per ref. `null` = never read. */
|
|
16006
|
+
lastReadAt: number().nullable()
|
|
16007
|
+
});
|
|
16008
|
+
var RefListSchema = array(string().min(1)).max(512);
|
|
16009
|
+
var keychainCapability = {
|
|
16010
|
+
name: "keychain",
|
|
16011
|
+
scope: "system",
|
|
16012
|
+
mode: "singleton",
|
|
16013
|
+
internal: true,
|
|
16014
|
+
methods: {
|
|
16015
|
+
/** Store (or replace) the caller's value at `ref`. Refused while locked. */
|
|
16016
|
+
put: method(object({
|
|
16017
|
+
ref: string().min(1),
|
|
16018
|
+
value: string().min(1)
|
|
16019
|
+
}), object({
|
|
16020
|
+
ref: string(),
|
|
16021
|
+
version: number().int()
|
|
16022
|
+
}), {
|
|
16023
|
+
kind: "mutation",
|
|
16024
|
+
auth: "admin"
|
|
16025
|
+
}),
|
|
16026
|
+
/**
|
|
16027
|
+
* Resolve the caller's refs in one round-trip. A locked keychain answers
|
|
16028
|
+
* `unavailable` per ref — never `missing`, never an empty value.
|
|
16029
|
+
*/
|
|
16030
|
+
resolve: method(object({ refs: RefListSchema }), KeychainResolveResultSchema, { auth: "admin" }),
|
|
16031
|
+
/** Remove the caller's refs. Unknown refs are ignored. */
|
|
16032
|
+
delete: method(object({ refs: RefListSchema }), object({ deleted: number().int() }), {
|
|
16033
|
+
kind: "mutation",
|
|
16034
|
+
auth: "admin"
|
|
16035
|
+
}),
|
|
16036
|
+
/** The caller's own refs, metadata only. */
|
|
16037
|
+
listMeta: method(object({}), array(KeychainSecretMetaSchema).readonly(), { auth: "admin" }),
|
|
16038
|
+
/** Whether values can be served — the save path refuses a write while locked. */
|
|
16039
|
+
getState: method(object({}), KeychainStateSchema, { auth: "admin" })
|
|
16040
|
+
}
|
|
16041
|
+
};
|
|
16042
|
+
var KeychainKeySourceSchema = object({
|
|
16043
|
+
kind: _enum([
|
|
16044
|
+
"config-file",
|
|
16045
|
+
"previous-config-file",
|
|
16046
|
+
"platform",
|
|
16047
|
+
"default-file"
|
|
16048
|
+
]),
|
|
16049
|
+
/** File sources only — a path is not a secret. */
|
|
16050
|
+
path: string().optional(),
|
|
16051
|
+
/**
|
|
16052
|
+
* True when a whole-volume backup of the data directory carries this key
|
|
16053
|
+
* next to the database it protects (the default file). The page warns.
|
|
16054
|
+
*/
|
|
16055
|
+
sharesBackupWithDatabase: boolean()
|
|
16056
|
+
});
|
|
16057
|
+
var KeychainStatusSchema = object({
|
|
16058
|
+
keychain: KeychainStateSchema,
|
|
16059
|
+
/** The source of the master key in use; `null` while locked. */
|
|
16060
|
+
keySource: KeychainKeySourceSchema.nullable(),
|
|
16061
|
+
/** The source configured to be primary — differs from `keySource` while a rotation is pending. */
|
|
16062
|
+
configuredSource: KeychainKeySourceSchema,
|
|
16063
|
+
/** Short fingerprint of the master key in use (`HMAC(KEK, label)`, 16 hex). */
|
|
16064
|
+
fingerprint: string().nullable(),
|
|
16065
|
+
activeKeyId: string().nullable(),
|
|
16066
|
+
/**
|
|
16067
|
+
* The keychain unlocked with a NON-primary source: the configured primary
|
|
16068
|
+
* key is not the one that wraps the data key yet. `rotateMasterKey` moves it.
|
|
16069
|
+
*/
|
|
16070
|
+
rotationPending: boolean(),
|
|
16071
|
+
/** Wrapped copies of the data key under a previous master key, kept until purged. */
|
|
16072
|
+
retiredWraps: number().int(),
|
|
16073
|
+
recoveryKeyDownloadedAt: number().nullable(),
|
|
16074
|
+
secretCount: number().int()
|
|
16075
|
+
});
|
|
16076
|
+
/**
|
|
16077
|
+
* Whether a stored value is still pointed at by its owner's settings.
|
|
16078
|
+
* `unknown` is a first-class answer: a scope whose blob could not be read is
|
|
16079
|
+
* never reported as an orphan (and never deleted as one).
|
|
16080
|
+
*/
|
|
16081
|
+
var KeychainSecretUsageSchema = _enum([
|
|
16082
|
+
"in-use",
|
|
16083
|
+
"orphan",
|
|
16084
|
+
"unknown"
|
|
16085
|
+
]);
|
|
16086
|
+
var KeychainAdminSecretSchema = KeychainSecretMetaSchema.extend({ usage: KeychainSecretUsageSchema });
|
|
16087
|
+
var KeychainAuditActionSchema = _enum([
|
|
16088
|
+
"put",
|
|
16089
|
+
"delete",
|
|
16090
|
+
"reveal",
|
|
16091
|
+
"rotate-master-key",
|
|
16092
|
+
"purge-retired-keys",
|
|
16093
|
+
"download-recovery-key",
|
|
16094
|
+
"delete-orphans",
|
|
16095
|
+
"reset",
|
|
16096
|
+
"initialize"
|
|
16097
|
+
]);
|
|
16098
|
+
var KeychainAuditEntrySchema = object({
|
|
16099
|
+
id: string(),
|
|
16100
|
+
at: number(),
|
|
16101
|
+
action: KeychainAuditActionSchema,
|
|
16102
|
+
/** `addon:<id>` | `user:<id>` | `system`. */
|
|
16103
|
+
actor: string(),
|
|
16104
|
+
ref: string().nullable(),
|
|
16105
|
+
detail: string().nullable()
|
|
16106
|
+
});
|
|
16107
|
+
var keychainAdminCapability = {
|
|
16108
|
+
name: "keychain-admin",
|
|
16109
|
+
scope: "system",
|
|
16110
|
+
mode: "singleton",
|
|
16111
|
+
methods: {
|
|
16112
|
+
status: method(object({}), KeychainStatusSchema, { auth: "admin" }),
|
|
16113
|
+
listSecrets: method(object({}), array(KeychainAdminSecretSchema).readonly(), { auth: "admin" }),
|
|
16114
|
+
listAudit: method(object({ limit: number().int().min(1).max(500).optional() }), array(KeychainAuditEntrySchema).readonly(), { auth: "admin" }),
|
|
16115
|
+
/**
|
|
16116
|
+
* Show one value to the operator. Audited. The UI hides it again after a
|
|
16117
|
+
* few seconds; nothing caches it.
|
|
16118
|
+
*/
|
|
16119
|
+
reveal: method(object({ ref: string().min(1) }), object({
|
|
16120
|
+
value: string(),
|
|
16121
|
+
version: number().int()
|
|
16122
|
+
}), {
|
|
16123
|
+
kind: "mutation",
|
|
16124
|
+
auth: "admin",
|
|
16125
|
+
caller: "required"
|
|
16126
|
+
}),
|
|
16127
|
+
/** Delete refs no owner points at any more. Re-checked here; `unknown` is kept. */
|
|
16128
|
+
deleteOrphans: method(object({ refs: array(string().min(1)).max(1e3) }), object({
|
|
16129
|
+
deleted: array(string()).readonly(),
|
|
16130
|
+
kept: array(object({
|
|
16131
|
+
ref: string(),
|
|
16132
|
+
usage: KeychainSecretUsageSchema
|
|
16133
|
+
})).readonly()
|
|
16134
|
+
}), {
|
|
16135
|
+
kind: "mutation",
|
|
16136
|
+
auth: "admin",
|
|
16137
|
+
caller: "required"
|
|
16138
|
+
}),
|
|
16139
|
+
/**
|
|
16140
|
+
* Wrap the data key under the configured primary master key.
|
|
16141
|
+
*
|
|
16142
|
+
* Pending rotation (the keychain unlocked with a previous source): re-wrap
|
|
16143
|
+
* under the primary. Otherwise, with the default file as primary: generate
|
|
16144
|
+
* a new master key, write it there, re-wrap. A file or OS-keychain primary
|
|
16145
|
+
* that is already in use cannot be replaced from here — put the new key at
|
|
16146
|
+
* the source, keep the old one as `keychain.previousKeyFile`, restart, and
|
|
16147
|
+
* rotate. No value is re-encrypted either way; the previous wrap is kept
|
|
16148
|
+
* (retired) until purged.
|
|
16149
|
+
*/
|
|
16150
|
+
rotateMasterKey: method(object({}), object({
|
|
16151
|
+
fingerprint: string(),
|
|
16152
|
+
keySource: KeychainKeySourceSchema
|
|
16153
|
+
}), {
|
|
16154
|
+
kind: "mutation",
|
|
16155
|
+
auth: "admin",
|
|
16156
|
+
caller: "required"
|
|
16157
|
+
}),
|
|
16158
|
+
purgeRetiredKeys: method(object({}), object({ purged: number().int() }), {
|
|
16159
|
+
kind: "mutation",
|
|
16160
|
+
auth: "admin",
|
|
16161
|
+
caller: "required"
|
|
16162
|
+
}),
|
|
16163
|
+
/** The master key, base64. Audited; marks the recovery copy as taken. */
|
|
16164
|
+
downloadRecoveryKey: method(object({}), object({
|
|
16165
|
+
key: string(),
|
|
16166
|
+
fingerprint: string(),
|
|
16167
|
+
keySource: KeychainKeySourceSchema
|
|
16168
|
+
}), {
|
|
16169
|
+
kind: "mutation",
|
|
16170
|
+
auth: "admin",
|
|
16171
|
+
caller: "required"
|
|
16172
|
+
}),
|
|
16173
|
+
/**
|
|
16174
|
+
* Lost-key recovery: archive every stored value into a
|
|
16175
|
+
* `keychain:secrets-orphaned-<ts>` table and start over with a new data
|
|
16176
|
+
* key. Every secret field then reads "not set". Requires the typed
|
|
16177
|
+
* confirmation {@link KEYCHAIN_RESET_CONFIRMATION}.
|
|
16178
|
+
*/
|
|
16179
|
+
resetKeychain: method(object({ confirm: literal("RESET KEYCHAIN") }), object({
|
|
16180
|
+
archivedCollection: string().nullable(),
|
|
16181
|
+
archived: number().int()
|
|
16182
|
+
}), {
|
|
16183
|
+
kind: "mutation",
|
|
16184
|
+
auth: "admin",
|
|
16185
|
+
caller: "required"
|
|
16186
|
+
})
|
|
16187
|
+
}
|
|
16188
|
+
};
|
|
15274
16189
|
var decoderCapability = {
|
|
15275
16190
|
name: "decoder",
|
|
15276
16191
|
scope: "system",
|
|
@@ -16611,7 +17526,11 @@ var DeviceRegisterPayloadSchema = object({
|
|
|
16611
17526
|
var DeviceRemovePayloadSchema = object({ deviceId: number() });
|
|
16612
17527
|
var DevicePersistConfigPayloadSchema = object({
|
|
16613
17528
|
deviceId: number(),
|
|
16614
|
-
data: record(string(), unknown())
|
|
17529
|
+
data: record(string(), unknown()),
|
|
17530
|
+
/** The paths the device's schema declares secret (D783), when the caller
|
|
17531
|
+
* knows them — those values are kept in the keychain, not the blob (D787).
|
|
17532
|
+
* Absent: the paths the device last reported at `registerDevice` apply. */
|
|
17533
|
+
secretConfigPaths: array(string()).optional()
|
|
16615
17534
|
});
|
|
16616
17535
|
/** What a migration actually did, per switch. `unreachable` is a first-class
|
|
16617
17536
|
* answer: a camera that could not be asked is not a camera that was silenced. */
|
|
@@ -25515,8 +26434,23 @@ var RetrainMacroClassSchema = _enum([
|
|
|
25515
26434
|
]);
|
|
25516
26435
|
/** A subject to learn, or a phantom to unlearn (taught by OMISSION). */
|
|
25517
26436
|
var RetrainAnnotationKindSchema = _enum(["subject", "model_error"]);
|
|
25518
|
-
/**
|
|
25519
|
-
|
|
26437
|
+
/**
|
|
26438
|
+
* Where a box came from. A machine-sourced box is a DRAFT on the page until
|
|
26439
|
+
* the operator confirms it; once saved it keeps its source as provenance.
|
|
26440
|
+
*
|
|
26441
|
+
* - `operator` — drawn by hand.
|
|
26442
|
+
* - `assist` — proposed by a detector run on the copy (the camera's own
|
|
26443
|
+
* model, or a larger teacher model).
|
|
26444
|
+
* - `pipeline` — the box the live pipeline actually drew on that frame, read
|
|
26445
|
+
* back from the track store (never a re-run).
|
|
26446
|
+
* - `llm` — proposed by a vision-capable LLM profile.
|
|
26447
|
+
*/
|
|
26448
|
+
var RetrainAnnotationSourceSchema = _enum([
|
|
26449
|
+
"operator",
|
|
26450
|
+
"assist",
|
|
26451
|
+
"pipeline",
|
|
26452
|
+
"llm"
|
|
26453
|
+
]);
|
|
25520
26454
|
/** Normalised `[0,1]` rectangle against the FULL frame — the canonical form. */
|
|
25521
26455
|
var RetrainBboxSchema = object({
|
|
25522
26456
|
x: number(),
|
|
@@ -25534,7 +26468,8 @@ var RetrainBboxSchema = object({
|
|
|
25534
26468
|
*/
|
|
25535
26469
|
var RetrainAnnotationSchema = object({
|
|
25536
26470
|
id: string(),
|
|
25537
|
-
|
|
26471
|
+
/** The frame's track. Absent on a recording still, which has none. */
|
|
26472
|
+
trackId: string().optional(),
|
|
25538
26473
|
deviceId: number(),
|
|
25539
26474
|
/** The COPY in retrain storage — never the source track's media key. */
|
|
25540
26475
|
mediaKey: string(),
|
|
@@ -25583,13 +26518,47 @@ var RetrainFrameCandidateSchema = object({
|
|
|
25583
26518
|
* fail, whatever became of the original. */
|
|
25584
26519
|
copied: boolean()
|
|
25585
26520
|
});
|
|
26521
|
+
/**
|
|
26522
|
+
* One box the live pipeline drew on a copied frame — what a correction starts
|
|
26523
|
+
* from. Derived when the frame is listed, from the track store: the subject
|
|
26524
|
+
* box recorded on the source media row when there is one, else the track
|
|
26525
|
+
* position nearest the frame's capture time. Never stored as an annotation
|
|
26526
|
+
* until the operator confirms it.
|
|
26527
|
+
*/
|
|
26528
|
+
var RetrainPipelineBoxSchema = object({
|
|
26529
|
+
/** Normalised `[0,1]` against the full frame. */
|
|
26530
|
+
bbox: RetrainBboxSchema,
|
|
26531
|
+
macroClass: RetrainMacroClassSchema,
|
|
26532
|
+
label: string().optional(),
|
|
26533
|
+
subLabel: string().optional(),
|
|
26534
|
+
/** The detection score of the position used, when it was recorded. */
|
|
26535
|
+
score: number().optional(),
|
|
26536
|
+
/** The root model that produced the track, when it was recorded. */
|
|
26537
|
+
modelId: string().optional(),
|
|
26538
|
+
trackId: string(),
|
|
26539
|
+
/** `subject-box`: recorded on this very frame. `position`: the track's
|
|
26540
|
+
* position nearest the capture time, `deltaMs` away. */
|
|
26541
|
+
basis: _enum(["subject-box", "position"]),
|
|
26542
|
+
deltaMs: number()
|
|
26543
|
+
});
|
|
26544
|
+
/**
|
|
26545
|
+
* Where a retrain frame came from: a TRACK's stored media (copy-on-select),
|
|
26546
|
+
* or the RECORDING at an instant — the frame a model saw nothing in has no
|
|
26547
|
+
* track at all.
|
|
26548
|
+
*/
|
|
26549
|
+
var RetrainFrameOriginSchema = _enum(["track", "recording"]);
|
|
25586
26550
|
/** A frame the dataset OWNS: bytes copied at selection time. */
|
|
25587
26551
|
var RetrainFrameSchema = object({
|
|
25588
26552
|
frameId: string(),
|
|
25589
26553
|
deviceId: number(),
|
|
25590
|
-
|
|
25591
|
-
/**
|
|
25592
|
-
|
|
26554
|
+
origin: RetrainFrameOriginSchema,
|
|
26555
|
+
/** The track it was copied from. Absent on a recording still. */
|
|
26556
|
+
trackId: string().optional(),
|
|
26557
|
+
/** Provenance only. It may already point at nothing — that is expected.
|
|
26558
|
+
* Absent on a recording still. */
|
|
26559
|
+
sourceMediaId: number().int().optional(),
|
|
26560
|
+
/** A recording still: the playhead instant it was taken at. */
|
|
26561
|
+
epochMs: number().optional(),
|
|
25593
26562
|
sourceKind: MediaFileKindEnum,
|
|
25594
26563
|
sizeBytes: number().int(),
|
|
25595
26564
|
width: number().int(),
|
|
@@ -25600,7 +26569,12 @@ var RetrainFrameSchema = object({
|
|
|
25600
26569
|
/** The operator's "every subject in this frame is boxed". Detector
|
|
25601
26570
|
* evaluation keeps only complete frames: an unboxed subject would count as
|
|
25602
26571
|
* a false positive. */
|
|
25603
|
-
complete: boolean()
|
|
26572
|
+
complete: boolean(),
|
|
26573
|
+
/** The boxes the pipeline drew on this frame. Present on list answers;
|
|
26574
|
+
* empty when nothing the track store holds can be placed on it. */
|
|
26575
|
+
pipelineBoxes: array(RetrainPipelineBoxSchema).readonly().optional(),
|
|
26576
|
+
/** The named collections this frame belongs to. Present on list answers. */
|
|
26577
|
+
collectionIds: array(string()).readonly().optional()
|
|
25604
26578
|
});
|
|
25605
26579
|
/** Why a copy-on-select could not be honoured — named, never a silent skip. */
|
|
25606
26580
|
var RetrainCopyRefusalSchema = _enum([
|
|
@@ -25631,6 +26605,11 @@ var RetrainFrameListSchema = object({
|
|
|
25631
26605
|
var RetrainExportFilterSchema = object({
|
|
25632
26606
|
deviceIds: array(number()).optional(),
|
|
25633
26607
|
frameIds: array(string()).max(2e4).optional(),
|
|
26608
|
+
/** Only frames in at least one of these named collections. */
|
|
26609
|
+
collectionIds: array(string()).max(200).optional(),
|
|
26610
|
+
/** Exactly the frames of this dataset version (and its completeOnly). An
|
|
26611
|
+
* unknown id selects nothing. */
|
|
26612
|
+
datasetVersionId: string().optional(),
|
|
25634
26613
|
batchId: string().optional(),
|
|
25635
26614
|
/** Only frames the operator marked complete (all subjects boxed). */
|
|
25636
26615
|
completeOnly: boolean().optional()
|
|
@@ -25695,6 +26674,170 @@ var RetrainAssistResultSchema = discriminatedUnion("kind", [object({
|
|
|
25695
26674
|
reason: string(),
|
|
25696
26675
|
detail: string().optional()
|
|
25697
26676
|
})]);
|
|
26677
|
+
/** A named set over the retrain corpus — membership only, it owns no pixels. */
|
|
26678
|
+
var RetrainCollectionSchema = object({
|
|
26679
|
+
id: string(),
|
|
26680
|
+
name: string(),
|
|
26681
|
+
createdAt: number(),
|
|
26682
|
+
frameCount: number().int()
|
|
26683
|
+
});
|
|
26684
|
+
var RetrainCollectionCreateResultSchema = discriminatedUnion("kind", [object({
|
|
26685
|
+
kind: literal("created"),
|
|
26686
|
+
collection: RetrainCollectionSchema
|
|
26687
|
+
}), object({
|
|
26688
|
+
kind: literal("refused"),
|
|
26689
|
+
reason: _enum(["empty-name", "duplicate-name"])
|
|
26690
|
+
})]);
|
|
26691
|
+
var RetrainCollectionRenameResultSchema = discriminatedUnion("kind", [object({
|
|
26692
|
+
kind: literal("renamed"),
|
|
26693
|
+
collection: RetrainCollectionSchema
|
|
26694
|
+
}), object({
|
|
26695
|
+
kind: literal("refused"),
|
|
26696
|
+
reason: _enum([
|
|
26697
|
+
"empty-name",
|
|
26698
|
+
"duplicate-name",
|
|
26699
|
+
"unknown-collection"
|
|
26700
|
+
])
|
|
26701
|
+
})]);
|
|
26702
|
+
/**
|
|
26703
|
+
* The outcome of adding the frame at a recording instant. Every refusal is
|
|
26704
|
+
* named: `still-unavailable` (not recording, a gap, or an undecodable frame —
|
|
26705
|
+
* `detail` says which), `still-busy` (the recorder is at its decode bound; try
|
|
26706
|
+
* again), `unreadable-image`, `write-failed`, `unknown-collection`.
|
|
26707
|
+
*/
|
|
26708
|
+
var AddRetrainFrameFromRecordingResultSchema = discriminatedUnion("kind", [object({
|
|
26709
|
+
kind: literal("added"),
|
|
26710
|
+
collectionId: string(),
|
|
26711
|
+
frame: RetrainFrameSchema,
|
|
26712
|
+
/** The moment was already in the dataset; nothing was decoded. */
|
|
26713
|
+
reused: boolean()
|
|
26714
|
+
}), object({
|
|
26715
|
+
kind: literal("refused"),
|
|
26716
|
+
reason: _enum([
|
|
26717
|
+
"unknown-collection",
|
|
26718
|
+
"still-unavailable",
|
|
26719
|
+
"still-busy",
|
|
26720
|
+
"unreadable-image",
|
|
26721
|
+
"write-failed"
|
|
26722
|
+
]),
|
|
26723
|
+
detail: string().optional()
|
|
26724
|
+
})]);
|
|
26725
|
+
/** A vision LLM profile the AI assist may use, and where it sends the frame. */
|
|
26726
|
+
var RetrainAssistProfileSchema = object({
|
|
26727
|
+
id: string(),
|
|
26728
|
+
name: string(),
|
|
26729
|
+
model: string(),
|
|
26730
|
+
kind: string(),
|
|
26731
|
+
/** `true` when the frame would leave the house (a cloud vendor, or an
|
|
26732
|
+
* endpoint that is not on the local network). The page confirms each such
|
|
26733
|
+
* run, and the provider refuses one without `allowCloud`. */
|
|
26734
|
+
leavesHouse: boolean()
|
|
26735
|
+
});
|
|
26736
|
+
/** A box the AI assist proposed: a draft, plus the model's own reason. */
|
|
26737
|
+
var RetrainLlmProposalSchema = RetrainAnnotationDraftSchema.extend({ reason: string() });
|
|
26738
|
+
/** What the AI assist said about a box that was already on the canvas. */
|
|
26739
|
+
var RetrainLlmReviewSchema = object({
|
|
26740
|
+
/** The `ref` the page sent the box under. */
|
|
26741
|
+
ref: string(),
|
|
26742
|
+
verdict: _enum([
|
|
26743
|
+
"confirmed",
|
|
26744
|
+
"wrong-class",
|
|
26745
|
+
"not-an-object",
|
|
26746
|
+
"uncertain"
|
|
26747
|
+
]),
|
|
26748
|
+
suggestedClass: RetrainMacroClassSchema.optional(),
|
|
26749
|
+
reason: string()
|
|
26750
|
+
});
|
|
26751
|
+
/**
|
|
26752
|
+
* The AI assist's answer. `proposed` carries drafts (`source: 'llm'`, the
|
|
26753
|
+
* model and its confidence) and reviews; items the model got wrong (a box off
|
|
26754
|
+
* the frame, an unasked class, an unknown ref) are dropped and counted in
|
|
26755
|
+
* `rejected`. A whole answer that is not the schema is `malformed-answer`.
|
|
26756
|
+
*/
|
|
26757
|
+
var RetrainLlmAssistResultSchema = discriminatedUnion("kind", [object({
|
|
26758
|
+
kind: literal("proposed"),
|
|
26759
|
+
profileId: string(),
|
|
26760
|
+
model: string(),
|
|
26761
|
+
/** The frame was sent outside the house for this answer. */
|
|
26762
|
+
leftHouse: boolean(),
|
|
26763
|
+
proposals: array(RetrainLlmProposalSchema).readonly(),
|
|
26764
|
+
reviews: array(RetrainLlmReviewSchema).readonly(),
|
|
26765
|
+
rejected: number().int()
|
|
26766
|
+
}), object({
|
|
26767
|
+
kind: literal("refused"),
|
|
26768
|
+
reason: _enum([
|
|
26769
|
+
"unknown-frame",
|
|
26770
|
+
"unreadable-frame",
|
|
26771
|
+
"unknown-profile",
|
|
26772
|
+
"profile-disabled",
|
|
26773
|
+
"no-vision",
|
|
26774
|
+
"cloud-not-confirmed",
|
|
26775
|
+
"llm-error",
|
|
26776
|
+
"malformed-answer"
|
|
26777
|
+
]),
|
|
26778
|
+
detail: string().optional()
|
|
26779
|
+
})]);
|
|
26780
|
+
/** What a dataset version is cut from. Every field narrows. */
|
|
26781
|
+
var RetrainDatasetSelectionSchema = object({
|
|
26782
|
+
deviceIds: array(number()).readonly().optional(),
|
|
26783
|
+
collectionIds: array(string()).max(200).readonly().optional(),
|
|
26784
|
+
frameIds: array(string()).max(2e4).readonly().optional()
|
|
26785
|
+
});
|
|
26786
|
+
/** The counts a dataset is judged by. */
|
|
26787
|
+
var RetrainDatasetStatsSchema = object({
|
|
26788
|
+
frames: number().int(),
|
|
26789
|
+
completeFrames: number().int(),
|
|
26790
|
+
/** `completeFrames / frames`, 0..1. */
|
|
26791
|
+
completeness: number(),
|
|
26792
|
+
/** Boxes to learn (model errors excluded). */
|
|
26793
|
+
subjects: number().int(),
|
|
26794
|
+
modelErrors: number().int(),
|
|
26795
|
+
/** Complete frames with no subject. */
|
|
26796
|
+
hardNegatives: number().int(),
|
|
26797
|
+
/** Subjects per class × camera × day/night. */
|
|
26798
|
+
cells: array(object({
|
|
26799
|
+
macroClass: string(),
|
|
26800
|
+
deviceId: number(),
|
|
26801
|
+
lighting: _enum([
|
|
26802
|
+
"day",
|
|
26803
|
+
"night",
|
|
26804
|
+
"unknown"
|
|
26805
|
+
]),
|
|
26806
|
+
subjects: number().int(),
|
|
26807
|
+
frames: number().int()
|
|
26808
|
+
})).readonly(),
|
|
26809
|
+
cameras: array(object({
|
|
26810
|
+
deviceId: number(),
|
|
26811
|
+
frames: number().int(),
|
|
26812
|
+
completeFrames: number().int()
|
|
26813
|
+
})).readonly()
|
|
26814
|
+
});
|
|
26815
|
+
/** An immutable dataset version, without its frame list. */
|
|
26816
|
+
var RetrainDatasetVersionSchema = object({
|
|
26817
|
+
id: string(),
|
|
26818
|
+
name: string(),
|
|
26819
|
+
createdAt: number(),
|
|
26820
|
+
selection: RetrainDatasetSelectionSchema,
|
|
26821
|
+
layout: RetrainExportLayoutSchema,
|
|
26822
|
+
completeOnly: boolean(),
|
|
26823
|
+
frameCount: number().int(),
|
|
26824
|
+
/** sha256 of what the frames taught when the version was frozen. */
|
|
26825
|
+
annotationHash: string(),
|
|
26826
|
+
/** The export manifest schema the version was cut under. */
|
|
26827
|
+
manifestSchema: string(),
|
|
26828
|
+
stats: RetrainDatasetStatsSchema
|
|
26829
|
+
});
|
|
26830
|
+
var CreateRetrainDatasetVersionResultSchema = discriminatedUnion("kind", [object({
|
|
26831
|
+
kind: literal("created"),
|
|
26832
|
+
version: RetrainDatasetVersionSchema
|
|
26833
|
+
}), object({
|
|
26834
|
+
kind: literal("refused"),
|
|
26835
|
+
reason: _enum([
|
|
26836
|
+
"empty-name",
|
|
26837
|
+
"duplicate-name",
|
|
26838
|
+
"no-frames"
|
|
26839
|
+
])
|
|
26840
|
+
})]);
|
|
25698
26841
|
/** The outcome of a lifecycle move owned by the retrain page. */
|
|
25699
26842
|
var RetrainTransitionResultSchema = object({
|
|
25700
26843
|
trackId: string(),
|
|
@@ -26881,7 +28024,7 @@ var pipelineAnalyticsCapability = {
|
|
|
26881
28024
|
* a frame leaves the dataset before export. */
|
|
26882
28025
|
deselectRetrainFrame: method(object({
|
|
26883
28026
|
deviceId: number(),
|
|
26884
|
-
trackId: string(),
|
|
28027
|
+
trackId: string().optional(),
|
|
26885
28028
|
frameId: string()
|
|
26886
28029
|
}), object({
|
|
26887
28030
|
removed: boolean(),
|
|
@@ -26924,7 +28067,8 @@ var pipelineAnalyticsCapability = {
|
|
|
26924
28067
|
*/
|
|
26925
28068
|
proposeRetrainAnnotations: method(object({
|
|
26926
28069
|
deviceId: number(),
|
|
26927
|
-
|
|
28070
|
+
/** The frame's track, when it has one — checked against the frame. */
|
|
28071
|
+
trackId: string().optional(),
|
|
26928
28072
|
frameId: string(),
|
|
26929
28073
|
subject: RetrainAssistSubjectSchema,
|
|
26930
28074
|
/** Which node runs it. Absent ⇒ wherever an unowned call lands. */
|
|
@@ -26933,8 +28077,12 @@ var pipelineAnalyticsCapability = {
|
|
|
26933
28077
|
kind: "mutation",
|
|
26934
28078
|
auth: "admin"
|
|
26935
28079
|
}),
|
|
26936
|
-
/** Every annotation on a track,
|
|
26937
|
-
|
|
28080
|
+
/** Every annotation on a track, or on named frames (a recording still has
|
|
28081
|
+
* no track), oldest first. One of the two is required. */
|
|
28082
|
+
listRetrainAnnotations: method(object({
|
|
28083
|
+
trackId: string().optional(),
|
|
28084
|
+
frameIds: array(string()).max(2e3).optional()
|
|
28085
|
+
}), array(RetrainAnnotationSchema).readonly(), {
|
|
26938
28086
|
kind: "query",
|
|
26939
28087
|
auth: "admin"
|
|
26940
28088
|
}),
|
|
@@ -26953,7 +28101,8 @@ var pipelineAnalyticsCapability = {
|
|
|
26953
28101
|
*/
|
|
26954
28102
|
saveRetrainAnnotations: method(object({
|
|
26955
28103
|
deviceId: number(),
|
|
26956
|
-
|
|
28104
|
+
/** The frame's track, when it has one — checked against the frame. */
|
|
28105
|
+
trackId: string().optional(),
|
|
26957
28106
|
frameId: string(),
|
|
26958
28107
|
annotations: array(RetrainAnnotationDraftSchema)
|
|
26959
28108
|
}), array(RetrainAnnotationSchema).readonly(), {
|
|
@@ -27016,7 +28165,7 @@ var pipelineAnalyticsCapability = {
|
|
|
27016
28165
|
*/
|
|
27017
28166
|
setRetrainFrameComplete: method(object({
|
|
27018
28167
|
deviceId: number(),
|
|
27019
|
-
trackId: string(),
|
|
28168
|
+
trackId: string().optional(),
|
|
27020
28169
|
frameId: string(),
|
|
27021
28170
|
complete: boolean()
|
|
27022
28171
|
}), RetrainFrameSchema, {
|
|
@@ -27039,6 +28188,162 @@ var pipelineAnalyticsCapability = {
|
|
|
27039
28188
|
auth: "admin",
|
|
27040
28189
|
timeoutMs: 60 * 6e4
|
|
27041
28190
|
}),
|
|
28191
|
+
/** The counts a selection would freeze — class × camera × day/night,
|
|
28192
|
+
* completeness — without freezing anything. Index reads only. */
|
|
28193
|
+
previewRetrainDataset: method(object({
|
|
28194
|
+
selection: RetrainDatasetSelectionSchema,
|
|
28195
|
+
completeOnly: boolean().optional()
|
|
28196
|
+
}), RetrainDatasetStatsSchema, {
|
|
28197
|
+
kind: "query",
|
|
28198
|
+
auth: "admin"
|
|
28199
|
+
}),
|
|
28200
|
+
/**
|
|
28201
|
+
* Freeze a dataset version: the frames the selection yields (the same plan
|
|
28202
|
+
* the annotated export builds), the hash of what they teach, the export
|
|
28203
|
+
* parameters and the counts. Immutable — a different selection is a new
|
|
28204
|
+
* version. Export it with `getRetrainExportUrl({ datasetVersionId })`.
|
|
28205
|
+
*/
|
|
28206
|
+
createRetrainDatasetVersion: method(object({
|
|
28207
|
+
name: string().max(120),
|
|
28208
|
+
selection: RetrainDatasetSelectionSchema,
|
|
28209
|
+
layout: RetrainExportLayoutSchema,
|
|
28210
|
+
completeOnly: boolean()
|
|
28211
|
+
}), CreateRetrainDatasetVersionResultSchema, {
|
|
28212
|
+
kind: "mutation",
|
|
28213
|
+
auth: "admin",
|
|
28214
|
+
timeoutMs: 12e4
|
|
28215
|
+
}),
|
|
28216
|
+
/** Every dataset version, newest first. */
|
|
28217
|
+
listRetrainDatasetVersions: method(object({}), array(RetrainDatasetVersionSchema).readonly(), {
|
|
28218
|
+
kind: "query",
|
|
28219
|
+
auth: "admin"
|
|
28220
|
+
}),
|
|
28221
|
+
/** Delete a version. Its frames stay in the dataset. */
|
|
28222
|
+
deleteRetrainDatasetVersion: method(object({ id: string() }), object({ deleted: boolean() }), {
|
|
28223
|
+
kind: "mutation",
|
|
28224
|
+
auth: "admin"
|
|
28225
|
+
}),
|
|
28226
|
+
/** Does the corpus still teach what the version froze? `missingFrames`
|
|
28227
|
+
* counts frames that left the dataset (or lost every box and tick). */
|
|
28228
|
+
verifyRetrainDatasetVersion: method(object({ id: string() }), object({
|
|
28229
|
+
found: boolean(),
|
|
28230
|
+
annotationHash: string(),
|
|
28231
|
+
matches: boolean(),
|
|
28232
|
+
missingFrames: number().int()
|
|
28233
|
+
}), {
|
|
28234
|
+
kind: "query",
|
|
28235
|
+
auth: "admin",
|
|
28236
|
+
timeoutMs: 12e4
|
|
28237
|
+
}),
|
|
28238
|
+
/** The enabled, vision-capable LLM profiles, each saying whether a frame
|
|
28239
|
+
* sent to it leaves the house. */
|
|
28240
|
+
listRetrainAssistProfiles: method(object({}), array(RetrainAssistProfileSchema).readonly(), {
|
|
28241
|
+
kind: "query",
|
|
28242
|
+
auth: "admin"
|
|
28243
|
+
}),
|
|
28244
|
+
/**
|
|
28245
|
+
* Ask a vision LLM (the `llm` capability) about ONE copied frame: list the
|
|
28246
|
+
* objects of `classes` with boxes, and review the boxes already on the
|
|
28247
|
+
* canvas (sent by `ref`). Answers drafts (`source: 'llm'`) and reviews —
|
|
28248
|
+
* nothing is stored, nothing is accepted. A profile that sends the frame
|
|
28249
|
+
* outside the house is refused unless `allowCloud` says the operator
|
|
28250
|
+
* confirmed this run.
|
|
28251
|
+
*/
|
|
28252
|
+
proposeRetrainAnnotationsWithLlm: method(object({
|
|
28253
|
+
deviceId: number(),
|
|
28254
|
+
trackId: string().optional(),
|
|
28255
|
+
frameId: string(),
|
|
28256
|
+
profileId: string(),
|
|
28257
|
+
classes: array(RetrainMacroClassSchema).min(1),
|
|
28258
|
+
boxes: array(object({
|
|
28259
|
+
ref: string(),
|
|
28260
|
+
bbox: RetrainBboxSchema,
|
|
28261
|
+
macroClass: RetrainMacroClassSchema,
|
|
28262
|
+
label: string().optional()
|
|
28263
|
+
})).max(50),
|
|
28264
|
+
allowCloud: boolean()
|
|
28265
|
+
}), RetrainLlmAssistResultSchema, {
|
|
28266
|
+
kind: "mutation",
|
|
28267
|
+
auth: "admin",
|
|
28268
|
+
timeoutMs: 18e4
|
|
28269
|
+
}),
|
|
28270
|
+
/**
|
|
28271
|
+
* Create a named collection — a set over the retrain corpus ("packages
|
|
28272
|
+
* porch night"). Names are unique case-insensitively and never empty;
|
|
28273
|
+
* both refusals are named.
|
|
28274
|
+
*/
|
|
28275
|
+
createRetrainCollection: method(object({ name: string().max(120) }), RetrainCollectionCreateResultSchema, {
|
|
28276
|
+
kind: "mutation",
|
|
28277
|
+
auth: "admin"
|
|
28278
|
+
}),
|
|
28279
|
+
/** Every collection, newest first, with its frame count. */
|
|
28280
|
+
listRetrainCollections: method(object({}), array(RetrainCollectionSchema).readonly(), {
|
|
28281
|
+
kind: "query",
|
|
28282
|
+
auth: "admin"
|
|
28283
|
+
}),
|
|
28284
|
+
renameRetrainCollection: method(object({
|
|
28285
|
+
id: string(),
|
|
28286
|
+
name: string().max(120)
|
|
28287
|
+
}), RetrainCollectionRenameResultSchema, {
|
|
28288
|
+
kind: "mutation",
|
|
28289
|
+
auth: "admin"
|
|
28290
|
+
}),
|
|
28291
|
+
/**
|
|
28292
|
+
* Delete a collection. Its recording stills that no other collection
|
|
28293
|
+
* holds are deleted with their annotations (nothing else reaches them);
|
|
28294
|
+
* frames copied from tracks always stay in the dataset.
|
|
28295
|
+
*/
|
|
28296
|
+
deleteRetrainCollection: method(object({ id: string() }), object({
|
|
28297
|
+
deleted: boolean(),
|
|
28298
|
+
removedFrames: number().int()
|
|
28299
|
+
}), {
|
|
28300
|
+
kind: "mutation",
|
|
28301
|
+
auth: "admin"
|
|
28302
|
+
}),
|
|
28303
|
+
/**
|
|
28304
|
+
* Add the frame at a recording instant to a collection — the frame the
|
|
28305
|
+
* model may have seen NOTHING in. The recorder re-decodes the native
|
|
28306
|
+
* frame at `epochMs`; the dataset copies it (trackless, durable). The same
|
|
28307
|
+
* moment twice is one copy. Every refusal is named.
|
|
28308
|
+
*/
|
|
28309
|
+
addRetrainFrameFromRecording: method(object({
|
|
28310
|
+
collectionId: string(),
|
|
28311
|
+
deviceId: number(),
|
|
28312
|
+
epochMs: number()
|
|
28313
|
+
}), AddRetrainFrameFromRecordingResultSchema, {
|
|
28314
|
+
kind: "mutation",
|
|
28315
|
+
auth: "admin",
|
|
28316
|
+
timeoutMs: 6e4
|
|
28317
|
+
}),
|
|
28318
|
+
/** Add frames already in the dataset to a collection. */
|
|
28319
|
+
addRetrainFramesToCollection: method(object({
|
|
28320
|
+
collectionId: string(),
|
|
28321
|
+
frameIds: array(string()).min(1).max(500)
|
|
28322
|
+
}), object({
|
|
28323
|
+
added: number().int(),
|
|
28324
|
+
alreadyMember: number().int(),
|
|
28325
|
+
unknownFrameIds: array(string()).readonly()
|
|
28326
|
+
}), {
|
|
28327
|
+
kind: "mutation",
|
|
28328
|
+
auth: "admin"
|
|
28329
|
+
}),
|
|
28330
|
+
/** Remove a frame from a collection. A recording still left in no
|
|
28331
|
+
* collection is deleted with its annotations (`deletedFrame`). */
|
|
28332
|
+
removeRetrainFrameFromCollection: method(object({
|
|
28333
|
+
collectionId: string(),
|
|
28334
|
+
frameId: string()
|
|
28335
|
+
}), object({
|
|
28336
|
+
removed: boolean(),
|
|
28337
|
+
deletedFrame: boolean()
|
|
28338
|
+
}), {
|
|
28339
|
+
kind: "mutation",
|
|
28340
|
+
auth: "admin"
|
|
28341
|
+
}),
|
|
28342
|
+
/** The frames of a collection, with their pipeline boxes. */
|
|
28343
|
+
listRetrainCollectionFrames: method(object({ collectionId: string() }), array(RetrainFrameSchema).readonly(), {
|
|
28344
|
+
kind: "query",
|
|
28345
|
+
auth: "admin"
|
|
28346
|
+
}),
|
|
27042
28347
|
/**
|
|
27043
28348
|
* The media an EVENT owns.
|
|
27044
28349
|
*
|
|
@@ -27978,13 +29283,31 @@ var RecommendationReasonSchema = discriminatedUnion("kind", [
|
|
|
27978
29283
|
object({
|
|
27979
29284
|
kind: literal("no-family-build"),
|
|
27980
29285
|
format: ModelFormatSchema$1
|
|
29286
|
+
}),
|
|
29287
|
+
object({
|
|
29288
|
+
kind: literal("kept-custom-pin"),
|
|
29289
|
+
modelId: string(),
|
|
29290
|
+
deviceKey: string()
|
|
27981
29291
|
})
|
|
27982
29292
|
]);
|
|
29293
|
+
/** Why a device is left exactly as it is, whatever the plan would pick (D786). */
|
|
29294
|
+
var KeptReasonSchema = _enum(["custom-pin"]);
|
|
29295
|
+
/**
|
|
29296
|
+
* Where a choice's latency came from (D791): this node's own benchmark
|
|
29297
|
+
* result, or the hardware-class table. Measured on the node beats the table.
|
|
29298
|
+
*/
|
|
29299
|
+
var LatencySourceSchema = discriminatedUnion("kind", [object({ kind: literal("table") }), object({
|
|
29300
|
+
kind: literal("node-benchmark"),
|
|
29301
|
+
resultId: string(),
|
|
29302
|
+
measuredAtMs: number()
|
|
29303
|
+
})]);
|
|
27983
29304
|
var DeviceModelChoiceSchema = object({
|
|
27984
29305
|
modelId: string(),
|
|
27985
29306
|
p50Ms: number(),
|
|
27986
29307
|
fps: number(),
|
|
27987
29308
|
measured: boolean(),
|
|
29309
|
+
/** Absent on a plan from before D791 — read as the table. */
|
|
29310
|
+
source: LatencySourceSchema.optional(),
|
|
27988
29311
|
/** Parallel sessions at the camera rate with the headroom kept free: ⌊fps × (1 − headroom) / camera fps⌋. */
|
|
27989
29312
|
capacitySessions: number(),
|
|
27990
29313
|
personRecall: number()
|
|
@@ -27995,6 +29318,8 @@ var DeviceRecommendationSchema = object({
|
|
|
27995
29318
|
enabled: boolean(),
|
|
27996
29319
|
available: boolean(),
|
|
27997
29320
|
chosen: DeviceModelChoiceSchema.nullable(),
|
|
29321
|
+
/** Present when the device is kept as is: Apply writes nothing on it. */
|
|
29322
|
+
kept: KeptReasonSchema.optional(),
|
|
27998
29323
|
reasons: array(RecommendationReasonSchema).readonly()
|
|
27999
29324
|
});
|
|
28000
29325
|
var NodeRecommendationSchema = object({
|
|
@@ -28048,6 +29373,17 @@ var AutoTuneWarningSchema = discriminatedUnion("kind", [
|
|
|
28048
29373
|
kind: literal("coral-enabled"),
|
|
28049
29374
|
nodeId: string(),
|
|
28050
29375
|
deviceKey: string()
|
|
29376
|
+
}),
|
|
29377
|
+
object({
|
|
29378
|
+
kind: literal("custom-pin-kept"),
|
|
29379
|
+
nodeId: string(),
|
|
29380
|
+
deviceKey: string().nullable(),
|
|
29381
|
+
deviceId: number().nullable(),
|
|
29382
|
+
modelId: string()
|
|
29383
|
+
}),
|
|
29384
|
+
object({
|
|
29385
|
+
kind: literal("custom-registry-unreadable"),
|
|
29386
|
+
error: string()
|
|
28051
29387
|
})
|
|
28052
29388
|
]);
|
|
28053
29389
|
var AutoTuneOptionsSchema = object({
|
|
@@ -28226,13 +29562,14 @@ var SuggestSharesResultSchema = object({
|
|
|
28226
29562
|
nodes: array(SuggestedNodeShareSchema).readonly()
|
|
28227
29563
|
});
|
|
28228
29564
|
/**
|
|
28229
|
-
* Where the node and device shares come from (D750, D755).
|
|
28230
|
-
* - `
|
|
28231
|
-
*
|
|
28232
|
-
*
|
|
28233
|
-
*
|
|
28234
|
-
*
|
|
28235
|
-
*
|
|
29565
|
+
* Where the node and device shares come from (D750, D755, D791).
|
|
29566
|
+
* - `benchmark` (default since D791) — each node's capacity as its own node
|
|
29567
|
+
* benchmark measured it; a node without fresh results is sized from
|
|
29568
|
+
* `hardware` and says so. Measured on the node beats the table.
|
|
29569
|
+
* - `hardware` — computed from each node's static capacity only (its
|
|
29570
|
+
* accelerators at their Auto tune models, from the latency table).
|
|
29571
|
+
* Both are recomputed whenever a node or device joins, leaves, is switched
|
|
29572
|
+
* on or off, changes model, or a benchmark result is written. No load input.
|
|
28236
29573
|
* - `manual` — the operator's stored sliders.
|
|
28237
29574
|
* Either way a node or device that cannot take sessions gives its share to
|
|
28238
29575
|
* the others in proportion; the stored values are never rewritten for that.
|
|
@@ -28281,6 +29618,362 @@ var EffectiveSharesSchema = object({
|
|
|
28281
29618
|
nodeWeights: record(string(), number()),
|
|
28282
29619
|
deviceWeights: record(string(), record(string(), number()))
|
|
28283
29620
|
});
|
|
29621
|
+
/**
|
|
29622
|
+
* Wire shapes of the node benchmark (D791): the operator's plan, the
|
|
29623
|
+
* preflight the confirmation shows, the run the orchestrator owns, what the
|
|
29624
|
+
* measuring runner reports, and the result rows Auto tune and the automatic
|
|
29625
|
+
* shares read.
|
|
29626
|
+
*
|
|
29627
|
+
* ONE node at a time, owned by the pipeline orchestrator. While a run is
|
|
29628
|
+
* active the cluster is in BENCHMARK MODE for that node: it is not a
|
|
29629
|
+
* detection candidate, camera pins naming it are ignored so its sessions move
|
|
29630
|
+
* elsewhere, and both come back when the mode ends — after a crash or a hub
|
|
29631
|
+
* restart too (a persisted manifest, reconciled against the registry).
|
|
29632
|
+
*
|
|
29633
|
+
* Two measurements, both on the node, driven by its own runner (frames never
|
|
29634
|
+
* cross a process at frame rate, D9):
|
|
29635
|
+
* - `device` — one accelerator × one candidate detector, root only, open
|
|
29636
|
+
* loop: how many streams at the camera rate it carries inside the frame
|
|
29637
|
+
* interval;
|
|
29638
|
+
* - `pipeline` — the chosen detector plus the operator's detail steps
|
|
29639
|
+
* (faces, plates, classifiers, CLIP…), on varied frames from the bench
|
|
29640
|
+
* clip: how many parallel sessions the node carries before latency, drops,
|
|
29641
|
+
* CPU, RAM or the event loop give out.
|
|
29642
|
+
*/
|
|
29643
|
+
/** Defaults and bounds, one place. */
|
|
29644
|
+
var NODE_BENCHMARK_DEFAULTS = {
|
|
29645
|
+
fpsPerStream: 10,
|
|
29646
|
+
budgetMinutes: 45,
|
|
29647
|
+
minBudgetMinutes: 10,
|
|
29648
|
+
maxBudgetMinutes: 120,
|
|
29649
|
+
/** A result older than this no longer beats the table. */
|
|
29650
|
+
staleAfterDays: 30,
|
|
29651
|
+
/** Warm-in per ramp step (not accounted). */
|
|
29652
|
+
settleSec: 5,
|
|
29653
|
+
/** Accounted window per ramp step. */
|
|
29654
|
+
measureSec: 20,
|
|
29655
|
+
/** Longest the drain may take before the run is refused. */
|
|
29656
|
+
drainTimeoutSec: 120,
|
|
29657
|
+
/** Candidate models per device in one run. */
|
|
29658
|
+
maxModelsPerDevice: 6
|
|
29659
|
+
};
|
|
29660
|
+
/** The two measurements a run can make. */
|
|
29661
|
+
var NodeBenchmarkPhaseSchema = _enum(["device", "pipeline"]);
|
|
29662
|
+
var NodeBenchmarkDevicePlanSchema = object({
|
|
29663
|
+
/** `<backend>:<device>` — `openvino:npu`, `coreml:all`, `cpu`. */
|
|
29664
|
+
deviceKey: string().min(1),
|
|
29665
|
+
/**
|
|
29666
|
+
* Root detector candidates for the `device` measurement, in the order
|
|
29667
|
+
* measured. The FIRST is the one the `pipeline` measurement runs.
|
|
29668
|
+
*/
|
|
29669
|
+
modelIds: array(string().min(1)).min(1).max(NODE_BENCHMARK_DEFAULTS.maxModelsPerDevice)
|
|
29670
|
+
});
|
|
29671
|
+
/** What the operator confirmed. */
|
|
29672
|
+
var NodeBenchmarkPlanSchema = object({
|
|
29673
|
+
nodeId: string().min(1),
|
|
29674
|
+
devices: array(NodeBenchmarkDevicePlanSchema).min(1),
|
|
29675
|
+
/** Which measurements run. At least one. */
|
|
29676
|
+
phases: array(NodeBenchmarkPhaseSchema).min(1).default(["device", "pipeline"]),
|
|
29677
|
+
/**
|
|
29678
|
+
* Detail steps (catalog step ids under the root: faces, plates,
|
|
29679
|
+
* classifiers, CLIP…) the `pipeline` measurement enables. The root
|
|
29680
|
+
* detector always runs.
|
|
29681
|
+
*/
|
|
29682
|
+
steps: array(string().min(1)).default([]),
|
|
29683
|
+
/** Offered rate of one stream / session. */
|
|
29684
|
+
fpsPerStream: number().int().min(1).max(30).default(NODE_BENCHMARK_DEFAULTS.fpsPerStream),
|
|
29685
|
+
/** Hard deadline: the mode ends and the cluster is restored when it passes. */
|
|
29686
|
+
budgetMinutes: number().int().min(NODE_BENCHMARK_DEFAULTS.minBudgetMinutes).max(NODE_BENCHMARK_DEFAULTS.maxBudgetMinutes).default(NODE_BENCHMARK_DEFAULTS.budgetMinutes),
|
|
29687
|
+
/** Keep the models the run downloaded (default: delete what was not installed before). */
|
|
29688
|
+
keepDownloadedModels: boolean().default(false),
|
|
29689
|
+
/** Start although the other nodes' capacity does not cover the sessions running now. */
|
|
29690
|
+
acceptInsufficientHeadroom: boolean().default(false)
|
|
29691
|
+
});
|
|
29692
|
+
var NodeBenchmarkRefusalSchema = object({
|
|
29693
|
+
kind: _enum([
|
|
29694
|
+
"benchmark-active",
|
|
29695
|
+
"node-offline",
|
|
29696
|
+
"unknown-device",
|
|
29697
|
+
"no-phase",
|
|
29698
|
+
"insufficient-headroom"
|
|
29699
|
+
]),
|
|
29700
|
+
detail: string(),
|
|
29701
|
+
overridable: boolean()
|
|
29702
|
+
});
|
|
29703
|
+
/** A camera whose detection leaves the node for the run. */
|
|
29704
|
+
var NodeBenchmarkMovingCameraSchema = object({
|
|
29705
|
+
deviceId: number(),
|
|
29706
|
+
/** Placed on the node now (a standing attach or a running session). */
|
|
29707
|
+
placedOnNode: boolean(),
|
|
29708
|
+
/** A node pin naming this node, ignored for the run. */
|
|
29709
|
+
pinnedToNode: boolean()
|
|
29710
|
+
});
|
|
29711
|
+
/** A camera that cannot leave: no other node can obtain its frames. */
|
|
29712
|
+
var NodeBenchmarkStayingCameraSchema = object({
|
|
29713
|
+
deviceId: number(),
|
|
29714
|
+
reason: literal("only-frame-source")
|
|
29715
|
+
});
|
|
29716
|
+
var NodeBenchmarkPreflightSchema = object({
|
|
29717
|
+
nodeId: string(),
|
|
29718
|
+
online: boolean(),
|
|
29719
|
+
moving: array(NodeBenchmarkMovingCameraSchema).readonly(),
|
|
29720
|
+
/** Keep running on the node during the run; the result is flagged contaminated. */
|
|
29721
|
+
staying: array(NodeBenchmarkStayingCameraSchema).readonly(),
|
|
29722
|
+
estimatedDurationMs: number(),
|
|
29723
|
+
/** The run ends and the cluster is restored at the latest after this long. */
|
|
29724
|
+
budgetMs: number(),
|
|
29725
|
+
phases: array(NodeBenchmarkPhaseSchema).readonly(),
|
|
29726
|
+
steps: array(string()).readonly(),
|
|
29727
|
+
devices: array(NodeBenchmarkDevicePlanSchema).readonly(),
|
|
29728
|
+
/** Parallel sessions the cluster runs now, and what the other nodes can carry. */
|
|
29729
|
+
headroom: object({
|
|
29730
|
+
sessionsNow: number(),
|
|
29731
|
+
otherNodesCapacitySessions: number().nullable()
|
|
29732
|
+
}),
|
|
29733
|
+
refusals: array(NodeBenchmarkRefusalSchema).readonly(),
|
|
29734
|
+
canStart: boolean()
|
|
29735
|
+
});
|
|
29736
|
+
/** Where the measuring runner is. */
|
|
29737
|
+
var NodeBenchProgressSchema = object({
|
|
29738
|
+
phase: _enum([
|
|
29739
|
+
"preparing",
|
|
29740
|
+
"device",
|
|
29741
|
+
"pipeline",
|
|
29742
|
+
"cleanup"
|
|
29743
|
+
]),
|
|
29744
|
+
deviceKey: string().nullable(),
|
|
29745
|
+
modelId: string().nullable(),
|
|
29746
|
+
/** Streams (device) or sessions (pipeline) of the step running now. */
|
|
29747
|
+
load: number().nullable(),
|
|
29748
|
+
cellsDone: number(),
|
|
29749
|
+
cellsTotal: number(),
|
|
29750
|
+
message: string()
|
|
29751
|
+
});
|
|
29752
|
+
/** What limited a ramp. `none` = the ramp ran out of steps still passing. */
|
|
29753
|
+
var NodeBenchLimitSchema = _enum([
|
|
29754
|
+
"p95",
|
|
29755
|
+
"drops",
|
|
29756
|
+
"errors",
|
|
29757
|
+
"stall",
|
|
29758
|
+
"cpu",
|
|
29759
|
+
"ram",
|
|
29760
|
+
"none"
|
|
29761
|
+
]);
|
|
29762
|
+
var NodeBenchRampStepSchema = object({
|
|
29763
|
+
load: number(),
|
|
29764
|
+
pass: boolean(),
|
|
29765
|
+
p95Ms: number(),
|
|
29766
|
+
dropRatio: number(),
|
|
29767
|
+
/** Completed frames per second over the accounted window. */
|
|
29768
|
+
fps: number(),
|
|
29769
|
+
cpuPct: number().nullable(),
|
|
29770
|
+
ramFreePct: number().nullable(),
|
|
29771
|
+
failReasons: array(string()).readonly()
|
|
29772
|
+
});
|
|
29773
|
+
var NodeBenchCellSchema = discriminatedUnion("phase", [object({
|
|
29774
|
+
phase: literal("device"),
|
|
29775
|
+
deviceKey: string(),
|
|
29776
|
+
modelId: string(),
|
|
29777
|
+
/** Single-stream latency (the K = 1 step). */
|
|
29778
|
+
p50Ms: number(),
|
|
29779
|
+
p95Ms: number(),
|
|
29780
|
+
p99Ms: number(),
|
|
29781
|
+
/** Frames per second sustained at the last passing step. */
|
|
29782
|
+
fps: number(),
|
|
29783
|
+
/** Streams at the camera rate the device carried inside the frame interval; 0 = not even one. */
|
|
29784
|
+
kMax: number(),
|
|
29785
|
+
limitedBy: NodeBenchLimitSchema,
|
|
29786
|
+
/** First call (model load + warm-up). */
|
|
29787
|
+
warmupMs: number(),
|
|
29788
|
+
ramp: array(NodeBenchRampStepSchema).readonly()
|
|
29789
|
+
}), object({
|
|
29790
|
+
phase: literal("pipeline"),
|
|
29791
|
+
deviceKey: string(),
|
|
29792
|
+
modelId: string(),
|
|
29793
|
+
steps: array(string()).readonly(),
|
|
29794
|
+
/** Parallel sessions at the camera rate the node carried; 0 = not even one. */
|
|
29795
|
+
maxSessions: number(),
|
|
29796
|
+
limitedBy: NodeBenchLimitSchema,
|
|
29797
|
+
/** Detail steps that produced at least one result on the clip — a step that never fired measured nothing. */
|
|
29798
|
+
stepsFired: array(string()).readonly(),
|
|
29799
|
+
warmupMs: number(),
|
|
29800
|
+
ramp: array(NodeBenchRampStepSchema).readonly()
|
|
29801
|
+
})]);
|
|
29802
|
+
/**
|
|
29803
|
+
* What a result was measured ON. A result whose fingerprint no longer matches
|
|
29804
|
+
* the node no longer beats the table.
|
|
29805
|
+
*/
|
|
29806
|
+
var NodeBenchFingerprintSchema = object({
|
|
29807
|
+
pipelineVersion: string().nullable(),
|
|
29808
|
+
cpuModel: string().nullable(),
|
|
29809
|
+
ramGb: number().nullable(),
|
|
29810
|
+
os: string().nullable(),
|
|
29811
|
+
/** Per device: the pool the cells ran on (runtime + tuning). */
|
|
29812
|
+
pools: record(string(), object({
|
|
29813
|
+
runtime: string(),
|
|
29814
|
+
numWorkers: number(),
|
|
29815
|
+
concurrency: number(),
|
|
29816
|
+
batchMode: string()
|
|
29817
|
+
})).default({})
|
|
29818
|
+
});
|
|
29819
|
+
/** The frames the run used. */
|
|
29820
|
+
var NodeBenchClipSchema = object({
|
|
29821
|
+
/** `camstack-bench-v1` or `reference-images` (the fallback when the clip is not reachable). */
|
|
29822
|
+
id: string(),
|
|
29823
|
+
revision: string().nullable(),
|
|
29824
|
+
frames: number(),
|
|
29825
|
+
width: number(),
|
|
29826
|
+
height: number()
|
|
29827
|
+
});
|
|
29828
|
+
var NodeBenchRunnerInputSchema = object({
|
|
29829
|
+
runId: string().min(1),
|
|
29830
|
+
devices: array(NodeBenchmarkDevicePlanSchema).min(1),
|
|
29831
|
+
phases: array(NodeBenchmarkPhaseSchema).min(1),
|
|
29832
|
+
/** The full detail step tree root for the `pipeline` measurement is built on the node from these ids. */
|
|
29833
|
+
steps: array(string()).default([]),
|
|
29834
|
+
fpsPerStream: number().int().min(1).max(30),
|
|
29835
|
+
/** The runner stops on its own past this instant, whatever the hub does. */
|
|
29836
|
+
deadlineAtMs: number(),
|
|
29837
|
+
settleSec: number().min(0).max(60).default(NODE_BENCHMARK_DEFAULTS.settleSec),
|
|
29838
|
+
measureSec: number().min(2).max(300).default(NODE_BENCHMARK_DEFAULTS.measureSec),
|
|
29839
|
+
keepDownloadedModels: boolean().default(false)
|
|
29840
|
+
});
|
|
29841
|
+
var NodeBenchRunnerStateSchema = _enum([
|
|
29842
|
+
"running",
|
|
29843
|
+
"done",
|
|
29844
|
+
"failed",
|
|
29845
|
+
"aborted"
|
|
29846
|
+
]);
|
|
29847
|
+
var NodeBenchRunnerStatusSchema = object({
|
|
29848
|
+
runId: string(),
|
|
29849
|
+
nodeId: string(),
|
|
29850
|
+
state: NodeBenchRunnerStateSchema,
|
|
29851
|
+
progress: NodeBenchProgressSchema.nullable(),
|
|
29852
|
+
/** Every finished cell so far — a run stopped half way keeps what it measured. */
|
|
29853
|
+
cells: array(NodeBenchCellSchema).readonly(),
|
|
29854
|
+
fingerprint: NodeBenchFingerprintSchema.nullable(),
|
|
29855
|
+
clip: NodeBenchClipSchema.nullable(),
|
|
29856
|
+
/** Cameras seen running on the node during the run (they share its pools). */
|
|
29857
|
+
activeCameraIds: array(number()).readonly(),
|
|
29858
|
+
/** Models the run downloaded and then deleted (not installed before). */
|
|
29859
|
+
deletedModels: array(string()).readonly(),
|
|
29860
|
+
error: string().nullable(),
|
|
29861
|
+
startedAtMs: number(),
|
|
29862
|
+
finishedAtMs: number().nullable()
|
|
29863
|
+
});
|
|
29864
|
+
var NodeBenchmarkStateSchema = _enum([
|
|
29865
|
+
"draining",
|
|
29866
|
+
"measuring",
|
|
29867
|
+
"restoring",
|
|
29868
|
+
"done",
|
|
29869
|
+
"failed",
|
|
29870
|
+
"aborted"
|
|
29871
|
+
]);
|
|
29872
|
+
/** Why a run ended. */
|
|
29873
|
+
var NodeBenchmarkEndReasonSchema = _enum([
|
|
29874
|
+
"completed",
|
|
29875
|
+
"operator-abort",
|
|
29876
|
+
"deadline",
|
|
29877
|
+
"node-lost",
|
|
29878
|
+
"runner-lost",
|
|
29879
|
+
"hub-restart",
|
|
29880
|
+
"drain-timeout",
|
|
29881
|
+
"failed"
|
|
29882
|
+
]);
|
|
29883
|
+
var NodeBenchmarkRunSchema = object({
|
|
29884
|
+
runId: string(),
|
|
29885
|
+
nodeId: string(),
|
|
29886
|
+
state: NodeBenchmarkStateSchema,
|
|
29887
|
+
plan: NodeBenchmarkPlanSchema,
|
|
29888
|
+
startedAtMs: number(),
|
|
29889
|
+
deadlineAtMs: number(),
|
|
29890
|
+
finishedAtMs: number().nullable(),
|
|
29891
|
+
endReason: NodeBenchmarkEndReasonSchema.nullable(),
|
|
29892
|
+
error: string().nullable(),
|
|
29893
|
+
/** Cameras moved off the node for the run. */
|
|
29894
|
+
moved: array(number()).readonly(),
|
|
29895
|
+
/** Cameras that stayed (their only frame source is the node). */
|
|
29896
|
+
staying: array(number()).readonly(),
|
|
29897
|
+
/** Something else ran on the node's pools during the run. */
|
|
29898
|
+
contaminated: boolean(),
|
|
29899
|
+
progress: NodeBenchProgressSchema.nullable(),
|
|
29900
|
+
resultIds: array(string()).readonly()
|
|
29901
|
+
});
|
|
29902
|
+
/** `getNodeBenchmarkStatus`: the active run (or the last one), and whether benchmark mode is on. */
|
|
29903
|
+
var NodeBenchmarkStatusSchema = object({
|
|
29904
|
+
/** The node the cluster is in benchmark mode for; null = none. */
|
|
29905
|
+
modeNodeId: string().nullable(),
|
|
29906
|
+
run: NodeBenchmarkRunSchema.nullable()
|
|
29907
|
+
});
|
|
29908
|
+
/**
|
|
29909
|
+
* One stored measurement — the only authority Auto tune and the automatic
|
|
29910
|
+
* shares read measured capacity from. Written by the orchestrator when a run
|
|
29911
|
+
* ends, never by anyone else.
|
|
29912
|
+
*/
|
|
29913
|
+
var NodeBenchmarkResultSchema = object({
|
|
29914
|
+
id: string(),
|
|
29915
|
+
runId: string(),
|
|
29916
|
+
nodeId: string(),
|
|
29917
|
+
cell: NodeBenchCellSchema,
|
|
29918
|
+
fpsPerStream: number(),
|
|
29919
|
+
fingerprint: NodeBenchFingerprintSchema.nullable(),
|
|
29920
|
+
clip: NodeBenchClipSchema.nullable(),
|
|
29921
|
+
/** Other work shared the node's pools (a camera that could not move, or the hub's own duties). */
|
|
29922
|
+
contaminated: boolean(),
|
|
29923
|
+
stayingCameras: array(number()).readonly(),
|
|
29924
|
+
/** The run ended early; the cell itself completed. */
|
|
29925
|
+
partialRun: boolean(),
|
|
29926
|
+
measuredAtMs: number()
|
|
29927
|
+
});
|
|
29928
|
+
var ListNodeBenchmarkResultsInputSchema = object({
|
|
29929
|
+
nodeId: string().optional(),
|
|
29930
|
+
deviceKey: string().optional()
|
|
29931
|
+
});
|
|
29932
|
+
/** A result with its standing today: does it still beat the table? */
|
|
29933
|
+
var NodeBenchmarkResultViewSchema = NodeBenchmarkResultSchema.extend({
|
|
29934
|
+
/** `fresh` beats the table; `stale` falls back to it; `superseded` = a newer row covers the same cell. */
|
|
29935
|
+
standing: _enum([
|
|
29936
|
+
"fresh",
|
|
29937
|
+
"stale",
|
|
29938
|
+
"superseded"
|
|
29939
|
+
]),
|
|
29940
|
+
staleWhy: _enum([
|
|
29941
|
+
"age",
|
|
29942
|
+
"runtime",
|
|
29943
|
+
"pool-tuning"
|
|
29944
|
+
]).nullable()
|
|
29945
|
+
});
|
|
29946
|
+
object({
|
|
29947
|
+
runId: string(),
|
|
29948
|
+
nodeId: string(),
|
|
29949
|
+
startedAtMs: number(),
|
|
29950
|
+
deadlineAtMs: number(),
|
|
29951
|
+
plan: NodeBenchmarkPlanSchema,
|
|
29952
|
+
moved: array(number()).readonly(),
|
|
29953
|
+
staying: array(number()).readonly()
|
|
29954
|
+
});
|
|
29955
|
+
/** Candidate detectors per device, for the plan editor. */
|
|
29956
|
+
var NodeBenchmarkCandidatesSchema = object({
|
|
29957
|
+
nodeId: string(),
|
|
29958
|
+
reachable: boolean(),
|
|
29959
|
+
devices: array(object({
|
|
29960
|
+
deviceKey: string(),
|
|
29961
|
+
enabled: boolean(),
|
|
29962
|
+
available: boolean(),
|
|
29963
|
+
/** Ordered: what Auto tune would pick first, then the rest of the family by accuracy. */
|
|
29964
|
+
suggested: array(string()).readonly(),
|
|
29965
|
+
/** Every root detector the device has a build for. */
|
|
29966
|
+
all: array(string()).readonly(),
|
|
29967
|
+
/** The model the device runs now, when pinned. */
|
|
29968
|
+
currentModelId: string().nullable()
|
|
29969
|
+
})).readonly(),
|
|
29970
|
+
/** Detail steps the node's catalog offers under the root (for the `pipeline` measurement). */
|
|
29971
|
+
steps: array(object({
|
|
29972
|
+
id: string(),
|
|
29973
|
+
name: string(),
|
|
29974
|
+
slot: string()
|
|
29975
|
+
})).readonly()
|
|
29976
|
+
});
|
|
28284
29977
|
object({
|
|
28285
29978
|
activeCameras: number(),
|
|
28286
29979
|
throttledCameras: number(),
|
|
@@ -29599,7 +31292,30 @@ var pipelineRunnerCapability = {
|
|
|
29599
31292
|
releaseParkedTrackFrames: method(object({
|
|
29600
31293
|
deviceId: number(),
|
|
29601
31294
|
trackId: string()
|
|
29602
|
-
}), object({ released: number().int().nonnegative() }), { kind: "mutation" })
|
|
31295
|
+
}), object({ released: number().int().nonnegative() }), { kind: "mutation" }),
|
|
31296
|
+
/**
|
|
31297
|
+
* Start measuring THIS node for the orchestrator's node benchmark: the
|
|
31298
|
+
* bench clip decoded once into RAM, each device × candidate detector on an
|
|
31299
|
+
* open-loop ramp (`device`), then the chosen pipeline with the requested
|
|
31300
|
+
* detail steps (`pipeline`). Everything runs in-process with the executor
|
|
31301
|
+
* — no frame crosses a node (D9) — and writes nothing: no track, event,
|
|
31302
|
+
* media or notification. Reached by `nodePin(nodeId)`. Answers at once;
|
|
31303
|
+
* one run per node; the run stops itself at `deadlineAtMs`.
|
|
31304
|
+
*/
|
|
31305
|
+
startNodeBench: method(NodeBenchRunnerInputSchema, object({
|
|
31306
|
+
accepted: literal(true),
|
|
31307
|
+
runId: string()
|
|
31308
|
+
}), {
|
|
31309
|
+
kind: "mutation",
|
|
31310
|
+
auth: "admin"
|
|
31311
|
+
}),
|
|
31312
|
+
/** The run's progress and every finished cell; null when this runner does not know `runId`. */
|
|
31313
|
+
getNodeBenchStatus: method(object({ runId: string() }), NodeBenchRunnerStatusSchema.nullable(), { auth: "admin" }),
|
|
31314
|
+
/** Stop the run; what it finished is kept. */
|
|
31315
|
+
abortNodeBench: method(object({ runId: string() }), object({ aborted: boolean() }), {
|
|
31316
|
+
kind: "mutation",
|
|
31317
|
+
auth: "admin"
|
|
31318
|
+
})
|
|
29603
31319
|
}
|
|
29604
31320
|
};
|
|
29605
31321
|
var CameraPipelineConfigSchema = object({
|
|
@@ -30527,6 +32243,51 @@ var pipelineOrchestratorCapability = {
|
|
|
30527
32243
|
kind: "mutation",
|
|
30528
32244
|
auth: "admin"
|
|
30529
32245
|
}),
|
|
32246
|
+
/**
|
|
32247
|
+
* Node benchmark — what a run of this plan would do, without doing it:
|
|
32248
|
+
* the cameras that leave the node, those that cannot (the node is their
|
|
32249
|
+
* only frame source; they stay and flag the run), the estimated duration
|
|
32250
|
+
* and every reason it may not start. The confirmation shows this.
|
|
32251
|
+
*/
|
|
32252
|
+
getNodeBenchmarkPreflight: method(NodeBenchmarkPlanSchema, NodeBenchmarkPreflightSchema, { auth: "admin" }),
|
|
32253
|
+
/**
|
|
32254
|
+
* Node benchmark — start ONE run (cluster-wide lock). The orchestrator
|
|
32255
|
+
* persists a restore manifest, enters benchmark mode for the node (out of
|
|
32256
|
+
* placement, its camera pins ignored, nothing rewritten), drains it, drives
|
|
32257
|
+
* the node's own runner, then restores — always, including after an
|
|
32258
|
+
* abort, a lost node or a hub restart. Answers at once; poll
|
|
32259
|
+
* `getNodeBenchmarkStatus`. Refused runs carry the preflight.
|
|
32260
|
+
*/
|
|
32261
|
+
startNodeBenchmark: method(NodeBenchmarkPlanSchema, discriminatedUnion("kind", [object({
|
|
32262
|
+
kind: literal("started"),
|
|
32263
|
+
runId: string()
|
|
32264
|
+
}), object({
|
|
32265
|
+
kind: literal("refused"),
|
|
32266
|
+
preflight: NodeBenchmarkPreflightSchema
|
|
32267
|
+
})]), {
|
|
32268
|
+
kind: "mutation",
|
|
32269
|
+
auth: "admin"
|
|
32270
|
+
}),
|
|
32271
|
+
/** Node benchmark — the active run (or the last one) and the node in benchmark mode. */
|
|
32272
|
+
getNodeBenchmarkStatus: method(_void(), NodeBenchmarkStatusSchema, { auth: "admin" }),
|
|
32273
|
+
/** Node benchmark — stop the active run; the cluster is restored as it was. */
|
|
32274
|
+
abortNodeBenchmark: method(object({ runId: string() }), object({ aborted: boolean() }), {
|
|
32275
|
+
kind: "mutation",
|
|
32276
|
+
auth: "admin"
|
|
32277
|
+
}),
|
|
32278
|
+
/**
|
|
32279
|
+
* Node benchmark — root detector candidates per device (what Auto tune
|
|
32280
|
+
* would pick first, then the family) and the detail steps the node's
|
|
32281
|
+
* catalog offers, for the plan editor.
|
|
32282
|
+
*/
|
|
32283
|
+
getNodeBenchmarkCandidates: method(object({ nodeId: string() }), NodeBenchmarkCandidatesSchema, { auth: "admin" }),
|
|
32284
|
+
/** Node benchmark — stored results, newest first, each with its standing today. */
|
|
32285
|
+
listNodeBenchmarkResults: method(ListNodeBenchmarkResultsInputSchema, array(NodeBenchmarkResultViewSchema).readonly(), { auth: "admin" }),
|
|
32286
|
+
/** Node benchmark — delete one result; Auto tune and the shares stop reading it. */
|
|
32287
|
+
deleteNodeBenchmarkResult: method(object({ id: string() }), object({ deleted: boolean() }), {
|
|
32288
|
+
kind: "mutation",
|
|
32289
|
+
auth: "admin"
|
|
32290
|
+
}),
|
|
30530
32291
|
/** Read one camera's settings. Null when never touched (inherits agent defaults fully). */
|
|
30531
32292
|
getCameraSettings: method(object({ deviceId: number() }), CameraPipelineSettingsSchema.nullable()),
|
|
30532
32293
|
/** Set or clear the 3-state toggle for one (camera, addonId). Pass `enabled: null` to clear and revert to agent default. */
|
|
@@ -37943,6 +39704,9 @@ var CreateIntegrationInputSchema = object({
|
|
|
37943
39704
|
enabled: boolean().optional(),
|
|
37944
39705
|
info: record(string(), unknown()).optional(),
|
|
37945
39706
|
settings: record(string(), unknown()).optional(),
|
|
39707
|
+
/** Keys of `settings` the form's schema declares secret (by type) — kept in
|
|
39708
|
+
* the keychain, not the table (D787). */
|
|
39709
|
+
secretKeys: array(string()).optional(),
|
|
37946
39710
|
skipRestart: boolean().optional()
|
|
37947
39711
|
});
|
|
37948
39712
|
var UpdateIntegrationInputSchema = object({
|
|
@@ -37978,7 +39742,9 @@ var integrationsCapability = {
|
|
|
37978
39742
|
getSettings: method(object({ id: string() }), record(string(), unknown()), { auth: "admin" }),
|
|
37979
39743
|
setSettings: method(object({
|
|
37980
39744
|
id: string(),
|
|
37981
|
-
settings: record(string(), unknown())
|
|
39745
|
+
settings: record(string(), unknown()),
|
|
39746
|
+
/** Keys the form's schema declares secret (by type) — keychain-stored (D787). */
|
|
39747
|
+
secretKeys: array(string()).optional()
|
|
37982
39748
|
}), object({ success: boolean() }), {
|
|
37983
39749
|
kind: "mutation",
|
|
37984
39750
|
auth: "admin"
|
|
@@ -49633,6 +51399,90 @@ Object.freeze({
|
|
|
49633
51399
|
addonId: null,
|
|
49634
51400
|
access: "create"
|
|
49635
51401
|
},
|
|
51402
|
+
"keychain.delete": {
|
|
51403
|
+
capName: "keychain",
|
|
51404
|
+
capScope: "system",
|
|
51405
|
+
addonId: null,
|
|
51406
|
+
access: "delete"
|
|
51407
|
+
},
|
|
51408
|
+
"keychain.getState": {
|
|
51409
|
+
capName: "keychain",
|
|
51410
|
+
capScope: "system",
|
|
51411
|
+
addonId: null,
|
|
51412
|
+
access: "view"
|
|
51413
|
+
},
|
|
51414
|
+
"keychain.listMeta": {
|
|
51415
|
+
capName: "keychain",
|
|
51416
|
+
capScope: "system",
|
|
51417
|
+
addonId: null,
|
|
51418
|
+
access: "view"
|
|
51419
|
+
},
|
|
51420
|
+
"keychain.put": {
|
|
51421
|
+
capName: "keychain",
|
|
51422
|
+
capScope: "system",
|
|
51423
|
+
addonId: null,
|
|
51424
|
+
access: "create"
|
|
51425
|
+
},
|
|
51426
|
+
"keychain.resolve": {
|
|
51427
|
+
capName: "keychain",
|
|
51428
|
+
capScope: "system",
|
|
51429
|
+
addonId: null,
|
|
51430
|
+
access: "view"
|
|
51431
|
+
},
|
|
51432
|
+
"keychainAdmin.deleteOrphans": {
|
|
51433
|
+
capName: "keychain-admin",
|
|
51434
|
+
capScope: "system",
|
|
51435
|
+
addonId: null,
|
|
51436
|
+
access: "delete"
|
|
51437
|
+
},
|
|
51438
|
+
"keychainAdmin.downloadRecoveryKey": {
|
|
51439
|
+
capName: "keychain-admin",
|
|
51440
|
+
capScope: "system",
|
|
51441
|
+
addonId: null,
|
|
51442
|
+
access: "create"
|
|
51443
|
+
},
|
|
51444
|
+
"keychainAdmin.listAudit": {
|
|
51445
|
+
capName: "keychain-admin",
|
|
51446
|
+
capScope: "system",
|
|
51447
|
+
addonId: null,
|
|
51448
|
+
access: "view"
|
|
51449
|
+
},
|
|
51450
|
+
"keychainAdmin.listSecrets": {
|
|
51451
|
+
capName: "keychain-admin",
|
|
51452
|
+
capScope: "system",
|
|
51453
|
+
addonId: null,
|
|
51454
|
+
access: "view"
|
|
51455
|
+
},
|
|
51456
|
+
"keychainAdmin.purgeRetiredKeys": {
|
|
51457
|
+
capName: "keychain-admin",
|
|
51458
|
+
capScope: "system",
|
|
51459
|
+
addonId: null,
|
|
51460
|
+
access: "delete"
|
|
51461
|
+
},
|
|
51462
|
+
"keychainAdmin.resetKeychain": {
|
|
51463
|
+
capName: "keychain-admin",
|
|
51464
|
+
capScope: "system",
|
|
51465
|
+
addonId: null,
|
|
51466
|
+
access: "delete"
|
|
51467
|
+
},
|
|
51468
|
+
"keychainAdmin.reveal": {
|
|
51469
|
+
capName: "keychain-admin",
|
|
51470
|
+
capScope: "system",
|
|
51471
|
+
addonId: null,
|
|
51472
|
+
access: "create"
|
|
51473
|
+
},
|
|
51474
|
+
"keychainAdmin.rotateMasterKey": {
|
|
51475
|
+
capName: "keychain-admin",
|
|
51476
|
+
capScope: "system",
|
|
51477
|
+
addonId: null,
|
|
51478
|
+
access: "create"
|
|
51479
|
+
},
|
|
51480
|
+
"keychainAdmin.status": {
|
|
51481
|
+
capName: "keychain-admin",
|
|
51482
|
+
capScope: "system",
|
|
51483
|
+
addonId: null,
|
|
51484
|
+
access: "view"
|
|
51485
|
+
},
|
|
49636
51486
|
"lawnMowerControl.dock": {
|
|
49637
51487
|
capName: "lawn-mower-control",
|
|
49638
51488
|
capScope: "device",
|
|
@@ -51007,6 +52857,18 @@ Object.freeze({
|
|
|
51007
52857
|
addonId: null,
|
|
51008
52858
|
access: "create"
|
|
51009
52859
|
},
|
|
52860
|
+
"pipelineAnalytics.addRetrainFrameFromRecording": {
|
|
52861
|
+
capName: "pipeline-analytics",
|
|
52862
|
+
capScope: "device",
|
|
52863
|
+
addonId: null,
|
|
52864
|
+
access: "create"
|
|
52865
|
+
},
|
|
52866
|
+
"pipelineAnalytics.addRetrainFramesToCollection": {
|
|
52867
|
+
capName: "pipeline-analytics",
|
|
52868
|
+
capScope: "device",
|
|
52869
|
+
addonId: null,
|
|
52870
|
+
access: "create"
|
|
52871
|
+
},
|
|
51010
52872
|
"pipelineAnalytics.applyDeviceSettingsPatch": {
|
|
51011
52873
|
capName: "pipeline-analytics",
|
|
51012
52874
|
capScope: "device",
|
|
@@ -51055,12 +52917,36 @@ Object.freeze({
|
|
|
51055
52917
|
addonId: null,
|
|
51056
52918
|
access: "view"
|
|
51057
52919
|
},
|
|
52920
|
+
"pipelineAnalytics.createRetrainCollection": {
|
|
52921
|
+
capName: "pipeline-analytics",
|
|
52922
|
+
capScope: "device",
|
|
52923
|
+
addonId: null,
|
|
52924
|
+
access: "create"
|
|
52925
|
+
},
|
|
52926
|
+
"pipelineAnalytics.createRetrainDatasetVersion": {
|
|
52927
|
+
capName: "pipeline-analytics",
|
|
52928
|
+
capScope: "device",
|
|
52929
|
+
addonId: null,
|
|
52930
|
+
access: "create"
|
|
52931
|
+
},
|
|
51058
52932
|
"pipelineAnalytics.deleteDeviceEvents": {
|
|
51059
52933
|
capName: "pipeline-analytics",
|
|
51060
52934
|
capScope: "device",
|
|
51061
52935
|
addonId: null,
|
|
51062
52936
|
access: "delete"
|
|
51063
52937
|
},
|
|
52938
|
+
"pipelineAnalytics.deleteRetrainCollection": {
|
|
52939
|
+
capName: "pipeline-analytics",
|
|
52940
|
+
capScope: "device",
|
|
52941
|
+
addonId: null,
|
|
52942
|
+
access: "delete"
|
|
52943
|
+
},
|
|
52944
|
+
"pipelineAnalytics.deleteRetrainDatasetVersion": {
|
|
52945
|
+
capName: "pipeline-analytics",
|
|
52946
|
+
capScope: "device",
|
|
52947
|
+
addonId: null,
|
|
52948
|
+
access: "delete"
|
|
52949
|
+
},
|
|
51064
52950
|
"pipelineAnalytics.deleteTracks": {
|
|
51065
52951
|
capName: "pipeline-analytics",
|
|
51066
52952
|
capScope: "device",
|
|
@@ -51265,6 +53151,30 @@ Object.freeze({
|
|
|
51265
53151
|
addonId: null,
|
|
51266
53152
|
access: "view"
|
|
51267
53153
|
},
|
|
53154
|
+
"pipelineAnalytics.listRetrainAssistProfiles": {
|
|
53155
|
+
capName: "pipeline-analytics",
|
|
53156
|
+
capScope: "device",
|
|
53157
|
+
addonId: null,
|
|
53158
|
+
access: "view"
|
|
53159
|
+
},
|
|
53160
|
+
"pipelineAnalytics.listRetrainCollectionFrames": {
|
|
53161
|
+
capName: "pipeline-analytics",
|
|
53162
|
+
capScope: "device",
|
|
53163
|
+
addonId: null,
|
|
53164
|
+
access: "view"
|
|
53165
|
+
},
|
|
53166
|
+
"pipelineAnalytics.listRetrainCollections": {
|
|
53167
|
+
capName: "pipeline-analytics",
|
|
53168
|
+
capScope: "device",
|
|
53169
|
+
addonId: null,
|
|
53170
|
+
access: "view"
|
|
53171
|
+
},
|
|
53172
|
+
"pipelineAnalytics.listRetrainDatasetVersions": {
|
|
53173
|
+
capName: "pipeline-analytics",
|
|
53174
|
+
capScope: "device",
|
|
53175
|
+
addonId: null,
|
|
53176
|
+
access: "view"
|
|
53177
|
+
},
|
|
51268
53178
|
"pipelineAnalytics.listRetrainFrames": {
|
|
51269
53179
|
capName: "pipeline-analytics",
|
|
51270
53180
|
capScope: "device",
|
|
@@ -51307,12 +53217,24 @@ Object.freeze({
|
|
|
51307
53217
|
addonId: null,
|
|
51308
53218
|
access: "create"
|
|
51309
53219
|
},
|
|
53220
|
+
"pipelineAnalytics.previewRetrainDataset": {
|
|
53221
|
+
capName: "pipeline-analytics",
|
|
53222
|
+
capScope: "device",
|
|
53223
|
+
addonId: null,
|
|
53224
|
+
access: "view"
|
|
53225
|
+
},
|
|
51310
53226
|
"pipelineAnalytics.proposeRetrainAnnotations": {
|
|
51311
53227
|
capName: "pipeline-analytics",
|
|
51312
53228
|
capScope: "device",
|
|
51313
53229
|
addonId: null,
|
|
51314
53230
|
access: "create"
|
|
51315
53231
|
},
|
|
53232
|
+
"pipelineAnalytics.proposeRetrainAnnotationsWithLlm": {
|
|
53233
|
+
capName: "pipeline-analytics",
|
|
53234
|
+
capScope: "device",
|
|
53235
|
+
addonId: null,
|
|
53236
|
+
access: "create"
|
|
53237
|
+
},
|
|
51316
53238
|
"pipelineAnalytics.pruneEvents": {
|
|
51317
53239
|
capName: "pipeline-analytics",
|
|
51318
53240
|
capScope: "device",
|
|
@@ -51367,6 +53289,18 @@ Object.freeze({
|
|
|
51367
53289
|
addonId: null,
|
|
51368
53290
|
access: "create"
|
|
51369
53291
|
},
|
|
53292
|
+
"pipelineAnalytics.removeRetrainFrameFromCollection": {
|
|
53293
|
+
capName: "pipeline-analytics",
|
|
53294
|
+
capScope: "device",
|
|
53295
|
+
addonId: null,
|
|
53296
|
+
access: "delete"
|
|
53297
|
+
},
|
|
53298
|
+
"pipelineAnalytics.renameRetrainCollection": {
|
|
53299
|
+
capName: "pipeline-analytics",
|
|
53300
|
+
capScope: "device",
|
|
53301
|
+
addonId: null,
|
|
53302
|
+
access: "create"
|
|
53303
|
+
},
|
|
51370
53304
|
"pipelineAnalytics.restageRetrainTrack": {
|
|
51371
53305
|
capName: "pipeline-analytics",
|
|
51372
53306
|
capScope: "device",
|
|
@@ -51427,6 +53361,12 @@ Object.freeze({
|
|
|
51427
53361
|
addonId: null,
|
|
51428
53362
|
access: "create"
|
|
51429
53363
|
},
|
|
53364
|
+
"pipelineAnalytics.verifyRetrainDatasetVersion": {
|
|
53365
|
+
capName: "pipeline-analytics",
|
|
53366
|
+
capScope: "device",
|
|
53367
|
+
addonId: null,
|
|
53368
|
+
access: "view"
|
|
53369
|
+
},
|
|
51430
53370
|
"pipelineAnalytics.wipeAllAnalytics": {
|
|
51431
53371
|
capName: "pipeline-analytics",
|
|
51432
53372
|
capScope: "device",
|
|
@@ -51655,6 +53595,12 @@ Object.freeze({
|
|
|
51655
53595
|
addonId: null,
|
|
51656
53596
|
access: "view"
|
|
51657
53597
|
},
|
|
53598
|
+
"pipelineOrchestrator.abortNodeBenchmark": {
|
|
53599
|
+
capName: "pipeline-orchestrator",
|
|
53600
|
+
capScope: "system",
|
|
53601
|
+
addonId: null,
|
|
53602
|
+
access: "create"
|
|
53603
|
+
},
|
|
51658
53604
|
"pipelineOrchestrator.applyAutoTune": {
|
|
51659
53605
|
capName: "pipeline-orchestrator",
|
|
51660
53606
|
capScope: "system",
|
|
@@ -51679,6 +53625,12 @@ Object.freeze({
|
|
|
51679
53625
|
addonId: null,
|
|
51680
53626
|
access: "create"
|
|
51681
53627
|
},
|
|
53628
|
+
"pipelineOrchestrator.deleteNodeBenchmarkResult": {
|
|
53629
|
+
capName: "pipeline-orchestrator",
|
|
53630
|
+
capScope: "system",
|
|
53631
|
+
addonId: null,
|
|
53632
|
+
access: "delete"
|
|
53633
|
+
},
|
|
51682
53634
|
"pipelineOrchestrator.getAgentLoad": {
|
|
51683
53635
|
capName: "pipeline-orchestrator",
|
|
51684
53636
|
capScope: "system",
|
|
@@ -51787,6 +53739,24 @@ Object.freeze({
|
|
|
51787
53739
|
addonId: null,
|
|
51788
53740
|
access: "view"
|
|
51789
53741
|
},
|
|
53742
|
+
"pipelineOrchestrator.getNodeBenchmarkCandidates": {
|
|
53743
|
+
capName: "pipeline-orchestrator",
|
|
53744
|
+
capScope: "system",
|
|
53745
|
+
addonId: null,
|
|
53746
|
+
access: "view"
|
|
53747
|
+
},
|
|
53748
|
+
"pipelineOrchestrator.getNodeBenchmarkPreflight": {
|
|
53749
|
+
capName: "pipeline-orchestrator",
|
|
53750
|
+
capScope: "system",
|
|
53751
|
+
addonId: null,
|
|
53752
|
+
access: "view"
|
|
53753
|
+
},
|
|
53754
|
+
"pipelineOrchestrator.getNodeBenchmarkStatus": {
|
|
53755
|
+
capName: "pipeline-orchestrator",
|
|
53756
|
+
capScope: "system",
|
|
53757
|
+
addonId: null,
|
|
53758
|
+
access: "view"
|
|
53759
|
+
},
|
|
51790
53760
|
"pipelineOrchestrator.getNodeInferenceDevices": {
|
|
51791
53761
|
capName: "pipeline-orchestrator",
|
|
51792
53762
|
capScope: "system",
|
|
@@ -51829,6 +53799,12 @@ Object.freeze({
|
|
|
51829
53799
|
addonId: null,
|
|
51830
53800
|
access: "view"
|
|
51831
53801
|
},
|
|
53802
|
+
"pipelineOrchestrator.listNodeBenchmarkResults": {
|
|
53803
|
+
capName: "pipeline-orchestrator",
|
|
53804
|
+
capScope: "system",
|
|
53805
|
+
addonId: null,
|
|
53806
|
+
access: "view"
|
|
53807
|
+
},
|
|
51832
53808
|
"pipelineOrchestrator.pauseForStorageMigration": {
|
|
51833
53809
|
capName: "pipeline-orchestrator",
|
|
51834
53810
|
capScope: "system",
|
|
@@ -51973,6 +53949,12 @@ Object.freeze({
|
|
|
51973
53949
|
addonId: null,
|
|
51974
53950
|
access: "create"
|
|
51975
53951
|
},
|
|
53952
|
+
"pipelineOrchestrator.startNodeBenchmark": {
|
|
53953
|
+
capName: "pipeline-orchestrator",
|
|
53954
|
+
capScope: "system",
|
|
53955
|
+
addonId: null,
|
|
53956
|
+
access: "create"
|
|
53957
|
+
},
|
|
51976
53958
|
"pipelineOrchestrator.suggestShares": {
|
|
51977
53959
|
capName: "pipeline-orchestrator",
|
|
51978
53960
|
capScope: "system",
|
|
@@ -51991,6 +53973,12 @@ Object.freeze({
|
|
|
51991
53973
|
addonId: null,
|
|
51992
53974
|
access: "create"
|
|
51993
53975
|
},
|
|
53976
|
+
"pipelineRunner.abortNodeBench": {
|
|
53977
|
+
capName: "pipeline-runner",
|
|
53978
|
+
capScope: "system",
|
|
53979
|
+
addonId: null,
|
|
53980
|
+
access: "create"
|
|
53981
|
+
},
|
|
51994
53982
|
"pipelineRunner.attachCamera": {
|
|
51995
53983
|
capName: "pipeline-runner",
|
|
51996
53984
|
capScope: "system",
|
|
@@ -52039,6 +54027,12 @@ Object.freeze({
|
|
|
52039
54027
|
addonId: null,
|
|
52040
54028
|
access: "view"
|
|
52041
54029
|
},
|
|
54030
|
+
"pipelineRunner.getNodeBenchStatus": {
|
|
54031
|
+
capName: "pipeline-runner",
|
|
54032
|
+
capScope: "system",
|
|
54033
|
+
addonId: null,
|
|
54034
|
+
access: "view"
|
|
54035
|
+
},
|
|
52042
54036
|
"pipelineRunner.getParkedTrackFrame": {
|
|
52043
54037
|
capName: "pipeline-runner",
|
|
52044
54038
|
capScope: "system",
|
|
@@ -52081,6 +54075,12 @@ Object.freeze({
|
|
|
52081
54075
|
addonId: null,
|
|
52082
54076
|
access: "create"
|
|
52083
54077
|
},
|
|
54078
|
+
"pipelineRunner.startNodeBench": {
|
|
54079
|
+
capName: "pipeline-runner",
|
|
54080
|
+
capScope: "system",
|
|
54081
|
+
addonId: null,
|
|
54082
|
+
access: "create"
|
|
54083
|
+
},
|
|
52084
54084
|
"plateGallery.assignPlate": {
|
|
52085
54085
|
capName: "plate-gallery",
|
|
52086
54086
|
capScope: "system",
|
|
@@ -55760,6 +57760,8 @@ var ALL_CAPABILITY_DEFINITIONS = [
|
|
|
55760
57760
|
imageSettingsCapability,
|
|
55761
57761
|
integrationsCapability,
|
|
55762
57762
|
intercomCapability,
|
|
57763
|
+
keychainCapability,
|
|
57764
|
+
keychainAdminCapability,
|
|
55763
57765
|
lawnMowerControlCapability,
|
|
55764
57766
|
llmCapability,
|
|
55765
57767
|
llmRuntimeCapability,
|
|
@@ -57186,6 +59188,11 @@ Object.freeze({
|
|
|
57186
59188
|
form: "single",
|
|
57187
59189
|
optional: false
|
|
57188
59190
|
}],
|
|
59191
|
+
"pipelineAnalytics.addRetrainFrameFromRecording": [{
|
|
59192
|
+
name: "deviceId",
|
|
59193
|
+
form: "single",
|
|
59194
|
+
optional: false
|
|
59195
|
+
}],
|
|
57189
59196
|
"pipelineAnalytics.applyDeviceSettingsPatch": [{
|
|
57190
59197
|
name: "deviceId",
|
|
57191
59198
|
form: "single",
|
|
@@ -57376,6 +59383,11 @@ Object.freeze({
|
|
|
57376
59383
|
form: "single",
|
|
57377
59384
|
optional: false
|
|
57378
59385
|
}],
|
|
59386
|
+
"pipelineAnalytics.proposeRetrainAnnotationsWithLlm": [{
|
|
59387
|
+
name: "deviceId",
|
|
59388
|
+
form: "single",
|
|
59389
|
+
optional: false
|
|
59390
|
+
}],
|
|
57379
59391
|
"pipelineAnalytics.pruneEventsBefore": [{
|
|
57380
59392
|
name: "deviceId",
|
|
57381
59393
|
form: "single",
|