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