@camstack/addon-post-analysis 1.2.343 → 1.2.344
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/{clip-model-registry-DZz3e781.mjs → clip-model-registry-C44gfwjm.mjs} +1992 -57
- package/dist/{clip-model-registry-Cd_y9S4U.js → clip-model-registry-Ca_IbZyD.js} +1992 -57
- package/dist/embedding-encoder/index.js +1 -1
- package/dist/embedding-encoder/index.mjs +1 -1
- package/dist/pipeline-analytics/_stub.js +2 -2
- package/dist/pipeline-analytics/{_virtual_mf-localSharedImportMap___mfe_internal__addon_pipeline_analytics_widgets-DrdO3Pxp.mjs → _virtual_mf-localSharedImportMap___mfe_internal__addon_pipeline_analytics_widgets-D73dyYqt.mjs} +2 -2
- package/dist/pipeline-analytics/_virtual_mf___mfe_internal__addon_pipeline_analytics_widgets__loadShare___mf_0_camstack_mf_1_types__loadShare__.js-C-2BbuN4.mjs +26 -0
- package/dist/pipeline-analytics/_virtual_mf___mfe_internal__addon_pipeline_analytics_widgets__loadShare___mf_0_camstack_mf_1_ui_mf_2_library__loadShare__.js-ZZJLA-YE.mjs +26 -0
- package/dist/pipeline-analytics/{hostInit-DPNnWr-m.mjs → hostInit-h_8fvfFv.mjs} +2 -2
- package/dist/pipeline-analytics/index.js +1562 -138
- package/dist/pipeline-analytics/index.mjs +1562 -138
- package/dist/pipeline-analytics/remoteEntry.js +1 -1
- package/package.json +1 -1
- package/dist/pipeline-analytics/_virtual_mf___mfe_internal__addon_pipeline_analytics_widgets__loadShare___mf_0_camstack_mf_1_types__loadShare__.js-DEq-B6oq.mjs +0 -26
- package/dist/pipeline-analytics/_virtual_mf___mfe_internal__addon_pipeline_analytics_widgets__loadShare___mf_0_camstack_mf_1_ui_mf_2_library__loadShare__.js-CiTUMvVf.mjs +0 -26
|
@@ -30,7 +30,7 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
|
30
30
|
}) : target, mod));
|
|
31
31
|
//#endregion
|
|
32
32
|
let node_crypto = require("node:crypto");
|
|
33
|
-
//#region ../types/dist/event-category-
|
|
33
|
+
//#region ../types/dist/event-category-DaIZi00R.mjs
|
|
34
34
|
var EventCategory = /* @__PURE__ */ function(EventCategory) {
|
|
35
35
|
EventCategory["SystemBoot"] = "system.boot";
|
|
36
36
|
EventCategory["SystemAddonsReady"] = "system.addons-ready";
|
|
@@ -109,6 +109,13 @@ var EventCategory = /* @__PURE__ */ function(EventCategory) {
|
|
|
109
109
|
*/
|
|
110
110
|
EventCategory["AddonLoadFailed"] = "addon.load-failed";
|
|
111
111
|
/**
|
|
112
|
+
* A keychain value was stored or removed (D787). Carries the ref, its
|
|
113
|
+
* owner and the new version — NEVER the value. A process holding the ref
|
|
114
|
+
* drops its cached copy and the owning `BaseAddon` re-resolves its config.
|
|
115
|
+
* Telemetry (D8): a process that misses it still revalidates by version.
|
|
116
|
+
*/
|
|
117
|
+
EventCategory["KeychainChanged"] = "keychain.changed";
|
|
118
|
+
/**
|
|
112
119
|
* Addon recovered from a previous failure. Emitted when an addon
|
|
113
120
|
* transitions from `failed` back to `healthy` (typically via the
|
|
114
121
|
* monitor's auto-retry loop, or after manual `addons.retryLoad`).
|
|
@@ -5473,7 +5480,7 @@ var ZodIssueCode = {
|
|
|
5473
5480
|
var ZodFirstPartyTypeKind;
|
|
5474
5481
|
ZodFirstPartyTypeKind || (ZodFirstPartyTypeKind = {});
|
|
5475
5482
|
//#endregion
|
|
5476
|
-
//#region ../types/dist/sleep-
|
|
5483
|
+
//#region ../types/dist/sleep-Cr5YOk3m.mjs
|
|
5477
5484
|
/**
|
|
5478
5485
|
* The audio chunk plane's byte format, and the ONE expansion from a coded
|
|
5479
5486
|
* window to float samples (D455).
|
|
@@ -5552,6 +5559,97 @@ function buildAlawTable() {
|
|
|
5552
5559
|
}
|
|
5553
5560
|
buildUlawTable();
|
|
5554
5561
|
buildAlawTable();
|
|
5562
|
+
/** Is this field's stored value a credential? */
|
|
5563
|
+
function isSecretConfigField(field) {
|
|
5564
|
+
if (field.type === "password") return true;
|
|
5565
|
+
return "secret" in field && field.secret === true;
|
|
5566
|
+
}
|
|
5567
|
+
/**
|
|
5568
|
+
* Is this field's value stored in the KEYCHAIN (D787)? Every secret field is,
|
|
5569
|
+
* by its TYPE, unless it opts out with `storage: 'inline'` — never by its name.
|
|
5570
|
+
*/
|
|
5571
|
+
function isKeychainStoredField(field) {
|
|
5572
|
+
if (!isSecretConfigField(field)) return false;
|
|
5573
|
+
if (field.type === "textarea" && field.isJson === true) return false;
|
|
5574
|
+
return !("storage" in field && field.storage === "inline");
|
|
5575
|
+
}
|
|
5576
|
+
/**
|
|
5577
|
+
* What a settings blob holds where a secret used to be.
|
|
5578
|
+
*
|
|
5579
|
+
* A keychain-stored field never holds its value. It holds a self-describing
|
|
5580
|
+
* MARKER, `{"$secret":"secret://…","v":1}` — an object, never a string, so no
|
|
5581
|
+
* code can mistake it for a credential and no form can send it to a camera as
|
|
5582
|
+
* a password. The empty state is `null` / absent, never `''`.
|
|
5583
|
+
*
|
|
5584
|
+
* The same shapes travel to and from the admin UI:
|
|
5585
|
+
*
|
|
5586
|
+
* - read: `hydrateSchema` hands a secret field a {@link SecretFieldView}
|
|
5587
|
+
* (`{ $secret, v, set: true }`) or `null` — the browser learns whether a
|
|
5588
|
+
* value is set, never the value.
|
|
5589
|
+
* - write: an untouched field submits the view back unchanged (KEEP); a typed
|
|
5590
|
+
* value is a plain non-empty string (CHANGE); the Clear button submits
|
|
5591
|
+
* {@link SECRET_CLEAR} (CLEAR). `''`, `null` and the legacy redaction tokens
|
|
5592
|
+
* are KEEP — an empty string is what a defaults-fallback pushes back, and
|
|
5593
|
+
* treating it as "clear" is how a save destroyed a stored credential before.
|
|
5594
|
+
*
|
|
5595
|
+
* Pure and browser-safe.
|
|
5596
|
+
*/
|
|
5597
|
+
var SECRET_CLEAR = { $secretClear: true };
|
|
5598
|
+
/** The `'***'` token D634 redaction writes for non-admins. */
|
|
5599
|
+
var LEGACY_DEVICE_REDACTION = "***";
|
|
5600
|
+
function isRecord$1(value) {
|
|
5601
|
+
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
5602
|
+
}
|
|
5603
|
+
function makeSecretMarker(ref) {
|
|
5604
|
+
return {
|
|
5605
|
+
$secret: ref,
|
|
5606
|
+
v: 1
|
|
5607
|
+
};
|
|
5608
|
+
}
|
|
5609
|
+
/** A stored marker: an object whose `$secret` is a non-empty string. */
|
|
5610
|
+
function isSecretMarker(value) {
|
|
5611
|
+
if (!isRecord$1(value)) return false;
|
|
5612
|
+
const ref = value["$secret"];
|
|
5613
|
+
return typeof ref === "string" && ref.length > 0;
|
|
5614
|
+
}
|
|
5615
|
+
function isSecretClear(value) {
|
|
5616
|
+
return isRecord$1(value) && value["$secretClear"] === true;
|
|
5617
|
+
}
|
|
5618
|
+
/**
|
|
5619
|
+
* The UI view of a stored secret field value: a marker becomes "set", inline
|
|
5620
|
+
* plaintext becomes "set (inline)", nothing becomes `null`. A value never
|
|
5621
|
+
* survives this function.
|
|
5622
|
+
*/
|
|
5623
|
+
function toSecretFieldView(stored) {
|
|
5624
|
+
if (isSecretMarker(stored)) return {
|
|
5625
|
+
$secret: stored.$secret,
|
|
5626
|
+
v: 1,
|
|
5627
|
+
set: true
|
|
5628
|
+
};
|
|
5629
|
+
if (typeof stored === "string" && stored.length > 0) return {
|
|
5630
|
+
$secret: null,
|
|
5631
|
+
v: 1,
|
|
5632
|
+
set: true,
|
|
5633
|
+
inline: true
|
|
5634
|
+
};
|
|
5635
|
+
return null;
|
|
5636
|
+
}
|
|
5637
|
+
/**
|
|
5638
|
+
* Classify an incoming value for a secret path. Only a non-empty string that is
|
|
5639
|
+
* not a redaction token sets a value; only {@link SECRET_CLEAR} clears.
|
|
5640
|
+
* Everything else — a marker (ours or anyone's), a UI view, `''`, `null`,
|
|
5641
|
+
* `undefined`, a redaction token, a non-string — keeps what is stored.
|
|
5642
|
+
*/
|
|
5643
|
+
function classifySecretWrite(incoming) {
|
|
5644
|
+
if (isSecretClear(incoming)) return { kind: "clear" };
|
|
5645
|
+
if (typeof incoming !== "string") return { kind: "keep" };
|
|
5646
|
+
if (incoming.length === 0) return { kind: "keep" };
|
|
5647
|
+
if (incoming === "__camstack_redacted__" || incoming === LEGACY_DEVICE_REDACTION) return { kind: "keep" };
|
|
5648
|
+
return {
|
|
5649
|
+
kind: "set",
|
|
5650
|
+
value: incoming
|
|
5651
|
+
};
|
|
5652
|
+
}
|
|
5555
5653
|
Object.fromEntries([
|
|
5556
5654
|
{
|
|
5557
5655
|
id: "overview",
|
|
@@ -5723,33 +5821,19 @@ Object.fromEntries([
|
|
|
5723
5821
|
function isValuelessField(field) {
|
|
5724
5822
|
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";
|
|
5725
5823
|
}
|
|
5726
|
-
|
|
5727
|
-
* Merge a `ConfigUISchema` with a raw `values` record into a
|
|
5728
|
-
* `ConfigUISchemaWithValues`. Used by every `get*Settings` backend endpoint
|
|
5729
|
-
* before returning to the admin UI. Groups are walked recursively.
|
|
5730
|
-
*
|
|
5731
|
-
* For each leaf field:
|
|
5732
|
-
* - structural fields (`separator`, `info`, `button`) pass through unchanged
|
|
5733
|
-
* - other fields get `value = values[key] ?? field.default ?? null`
|
|
5734
|
-
*
|
|
5735
|
-
* Unknown keys in `values` (keys not declared in the schema) are silently
|
|
5736
|
-
* ignored — they don't contribute to the output. Missing keys fall back to
|
|
5737
|
-
* the schema default or `null`. This mirrors the old backend behaviour where
|
|
5738
|
-
* `FormBuilder` rendered `values[key] ?? field.default`.
|
|
5739
|
-
*/
|
|
5740
|
-
function hydrateSchema(schema, values) {
|
|
5824
|
+
function hydrateSchema(schema, values, options = {}) {
|
|
5741
5825
|
return {
|
|
5742
5826
|
...schema.tabs ? { tabs: [...schema.tabs] } : {},
|
|
5743
5827
|
sections: schema.sections.map((section) => ({
|
|
5744
5828
|
...section,
|
|
5745
|
-
fields: section.fields.map((field) => hydrateField(field, values))
|
|
5829
|
+
fields: section.fields.map((field) => hydrateField(field, values, options))
|
|
5746
5830
|
}))
|
|
5747
5831
|
};
|
|
5748
5832
|
}
|
|
5749
|
-
function hydrateField(field, values) {
|
|
5833
|
+
function hydrateField(field, values, options) {
|
|
5750
5834
|
if (isValuelessField(field)) return field;
|
|
5751
5835
|
if (field.type === "group") {
|
|
5752
|
-
const hydratedChildren = field.fields.map((child) => hydrateField(child, values));
|
|
5836
|
+
const hydratedChildren = field.fields.map((child) => hydrateField(child, values, options));
|
|
5753
5837
|
return {
|
|
5754
5838
|
...field,
|
|
5755
5839
|
fields: hydratedChildren
|
|
@@ -5758,7 +5842,7 @@ function hydrateField(field, values) {
|
|
|
5758
5842
|
if (field.type === "sub-tabs") {
|
|
5759
5843
|
const hydratedTabs = field.tabs.map((tab) => ({
|
|
5760
5844
|
...tab,
|
|
5761
|
-
fields: tab.fields.map((child) => hydrateField(child, values))
|
|
5845
|
+
fields: tab.fields.map((child) => hydrateField(child, values, options))
|
|
5762
5846
|
}));
|
|
5763
5847
|
return {
|
|
5764
5848
|
...field,
|
|
@@ -5768,6 +5852,33 @@ function hydrateField(field, values) {
|
|
|
5768
5852
|
const key = field.key;
|
|
5769
5853
|
const storedValue = Object.prototype.hasOwnProperty.call(values, key) ? values[key] : void 0;
|
|
5770
5854
|
const defaultValue = field.default;
|
|
5855
|
+
const asView = (v) => isSecretMarker(v) || options.inlineSecretsAsViews === true && v !== void 0;
|
|
5856
|
+
if (isKeychainStoredField(field) && asView(storedValue)) return {
|
|
5857
|
+
...field,
|
|
5858
|
+
value: toSecretFieldView(storedValue)
|
|
5859
|
+
};
|
|
5860
|
+
if (isKeychainStoredField(field) && options.inlineSecretsAsViews === true) return {
|
|
5861
|
+
...field,
|
|
5862
|
+
value: null
|
|
5863
|
+
};
|
|
5864
|
+
if (field.type === "editable-array" && Array.isArray(storedValue)) {
|
|
5865
|
+
const secretItemKeys = field.itemFields.filter((item) => "key" in item && isKeychainStoredField(item)).map((item) => "key" in item ? item.key : "");
|
|
5866
|
+
if (secretItemKeys.length > 0) {
|
|
5867
|
+
const rows = storedValue.map((row) => {
|
|
5868
|
+
if (row === null || typeof row !== "object" || Array.isArray(row)) return row;
|
|
5869
|
+
const out = { ...row };
|
|
5870
|
+
for (const k of secretItemKeys) {
|
|
5871
|
+
const v = Reflect.get(row, k);
|
|
5872
|
+
if (asView(v)) out[k] = toSecretFieldView(v);
|
|
5873
|
+
}
|
|
5874
|
+
return out;
|
|
5875
|
+
});
|
|
5876
|
+
return {
|
|
5877
|
+
...field,
|
|
5878
|
+
value: rows
|
|
5879
|
+
};
|
|
5880
|
+
}
|
|
5881
|
+
}
|
|
5771
5882
|
if (field.multiple) {
|
|
5772
5883
|
const stored = Array.isArray(storedValue) ? storedValue : storedValue !== void 0 && storedValue !== null ? [storedValue] : [];
|
|
5773
5884
|
const itemFallback = field.multiple.itemDefault !== void 0 ? field.multiple.itemDefault : defaultValue !== void 0 ? defaultValue : typeOf(field) === "string" ? "" : null;
|
|
@@ -6010,6 +6121,431 @@ function projectStore(store, perNodeKeys, nodeId) {
|
|
|
6010
6121
|
}
|
|
6011
6122
|
return out;
|
|
6012
6123
|
}
|
|
6124
|
+
var GLOBAL_SCOPE = { kind: "global" };
|
|
6125
|
+
/** The scope every addon-wide (not per-node, not per-device) setting lives in. */
|
|
6126
|
+
function globalSecretScope() {
|
|
6127
|
+
return GLOBAL_SCOPE;
|
|
6128
|
+
}
|
|
6129
|
+
function encodeSegment(value) {
|
|
6130
|
+
return encodeURIComponent(value);
|
|
6131
|
+
}
|
|
6132
|
+
/**
|
|
6133
|
+
* The field path of a value inside an array item, addressed by the item's id:
|
|
6134
|
+
* `arrayItemFieldPath('providers', 'authentik', 'clientSecret')` →
|
|
6135
|
+
* `providers[authentik].clientSecret`.
|
|
6136
|
+
*/
|
|
6137
|
+
function arrayItemFieldPath(arrayKey, itemId, fieldKey) {
|
|
6138
|
+
return `${arrayKey}[${encodeSegment(itemId)}].${fieldKey}`;
|
|
6139
|
+
}
|
|
6140
|
+
/** A write to a secret path could not be stored in the keychain, so it was refused. */
|
|
6141
|
+
var KeychainWriteRefusedError = class extends Error {
|
|
6142
|
+
fieldPath;
|
|
6143
|
+
constructor(fieldPath, cause) {
|
|
6144
|
+
super(`secret "${fieldPath}" was not saved: the keychain could not store it (${cause instanceof Error ? cause.message : String(cause)}). Nothing was written.`);
|
|
6145
|
+
this.fieldPath = fieldPath;
|
|
6146
|
+
this.name = "KeychainWriteRefusedError";
|
|
6147
|
+
}
|
|
6148
|
+
};
|
|
6149
|
+
var KEEP = { kind: "keep" };
|
|
6150
|
+
function isRecord(value) {
|
|
6151
|
+
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
6152
|
+
}
|
|
6153
|
+
function defaultMintId() {
|
|
6154
|
+
return globalThis.crypto.randomUUID();
|
|
6155
|
+
}
|
|
6156
|
+
/** Every marker ref anywhere under `value`. */
|
|
6157
|
+
function collectSecretMarkerRefs(value, out = []) {
|
|
6158
|
+
if (isSecretMarker(value)) {
|
|
6159
|
+
out.push(value.$secret);
|
|
6160
|
+
return out;
|
|
6161
|
+
}
|
|
6162
|
+
if (Array.isArray(value)) for (const item of value) collectSecretMarkerRefs(item, out);
|
|
6163
|
+
else if (isRecord(value)) for (const child of Object.values(value)) collectSecretMarkerRefs(child, out);
|
|
6164
|
+
return out;
|
|
6165
|
+
}
|
|
6166
|
+
async function storedValueEquals(secrets, marker, candidate) {
|
|
6167
|
+
const resolved = (await secrets.resolve([marker.$secret]))[marker.$secret];
|
|
6168
|
+
return resolved?.kind === "value" && resolved.value === candidate;
|
|
6169
|
+
}
|
|
6170
|
+
async function writeLeaf(ctx, incoming, stored, fieldPath) {
|
|
6171
|
+
const intent = classifySecretWrite(incoming);
|
|
6172
|
+
const ref = ctx.secrets.ref(ctx.scope, fieldPath);
|
|
6173
|
+
const storedIsOurs = isSecretMarker(stored) && stored.$secret === ref;
|
|
6174
|
+
if (intent.kind === "keep") return KEEP;
|
|
6175
|
+
if (intent.kind === "set" && !ctx.operatorWrite && typeof stored === "string" && stored === intent.value) return KEEP;
|
|
6176
|
+
if (intent.kind === "clear") {
|
|
6177
|
+
if (storedIsOurs) ctx.deletes.push(ref);
|
|
6178
|
+
return {
|
|
6179
|
+
kind: "value",
|
|
6180
|
+
value: null
|
|
6181
|
+
};
|
|
6182
|
+
}
|
|
6183
|
+
if (storedIsOurs && await storedValueEquals(ctx.secrets, stored, intent.value)) return {
|
|
6184
|
+
kind: "value",
|
|
6185
|
+
value: stored
|
|
6186
|
+
};
|
|
6187
|
+
try {
|
|
6188
|
+
await ctx.secrets.put(ref, intent.value);
|
|
6189
|
+
} catch (err) {
|
|
6190
|
+
throw new KeychainWriteRefusedError(fieldPath, err);
|
|
6191
|
+
}
|
|
6192
|
+
return {
|
|
6193
|
+
kind: "value",
|
|
6194
|
+
value: makeSecretMarker(ref)
|
|
6195
|
+
};
|
|
6196
|
+
}
|
|
6197
|
+
/** Apply a member result onto `out`: KEEP restores the stored member, or removes it. */
|
|
6198
|
+
function applyMember(out, key, result, storedParent) {
|
|
6199
|
+
if (result.kind === "value") {
|
|
6200
|
+
out[key] = result.value;
|
|
6201
|
+
return;
|
|
6202
|
+
}
|
|
6203
|
+
if (Object.prototype.hasOwnProperty.call(storedParent, key)) out[key] = storedParent[key];
|
|
6204
|
+
else delete out[key];
|
|
6205
|
+
}
|
|
6206
|
+
async function writeMembers(ctx, children, incoming, stored, pathOf) {
|
|
6207
|
+
const out = { ...incoming };
|
|
6208
|
+
for (const [member, node] of children) applyMember(out, member, await writeNode(ctx, node, incoming[member], stored[member], pathOf(member)), stored);
|
|
6209
|
+
return out;
|
|
6210
|
+
}
|
|
6211
|
+
function rowId(row, idKey) {
|
|
6212
|
+
const raw = row[idKey];
|
|
6213
|
+
if (typeof raw === "string" && raw.length > 0) return raw;
|
|
6214
|
+
if (typeof raw === "number" && Number.isFinite(raw)) return String(raw);
|
|
6215
|
+
return null;
|
|
6216
|
+
}
|
|
6217
|
+
async function writeArray(ctx, node, incoming, stored, fieldPath) {
|
|
6218
|
+
const storedRows = Array.isArray(stored) ? stored.filter(isRecord) : [];
|
|
6219
|
+
if (!Array.isArray(incoming)) {
|
|
6220
|
+
ctx.deletes.push(...collectSecretMarkerRefs(storedRows));
|
|
6221
|
+
return {
|
|
6222
|
+
kind: "value",
|
|
6223
|
+
value: incoming
|
|
6224
|
+
};
|
|
6225
|
+
}
|
|
6226
|
+
const storedById = /* @__PURE__ */ new Map();
|
|
6227
|
+
for (const row of storedRows) {
|
|
6228
|
+
const id = rowId(row, node.idKey);
|
|
6229
|
+
if (id !== null) storedById.set(id, row);
|
|
6230
|
+
}
|
|
6231
|
+
const kept = /* @__PURE__ */ new Set();
|
|
6232
|
+
const rows = [];
|
|
6233
|
+
for (const row of incoming) {
|
|
6234
|
+
if (!isRecord(row)) {
|
|
6235
|
+
rows.push(row);
|
|
6236
|
+
continue;
|
|
6237
|
+
}
|
|
6238
|
+
const id = rowId(row, node.idKey) ?? ctx.mintId();
|
|
6239
|
+
kept.add(id);
|
|
6240
|
+
const withId = {
|
|
6241
|
+
...row,
|
|
6242
|
+
[node.idKey]: row[node.idKey] ?? id
|
|
6243
|
+
};
|
|
6244
|
+
if (rowId(withId, node.idKey) === null) withId[node.idKey] = id;
|
|
6245
|
+
const storedRow = storedById.get(id) ?? {};
|
|
6246
|
+
rows.push(await writeMembers(ctx, node.item, withId, storedRow, (member) => arrayItemFieldPath(fieldPath, id, member)));
|
|
6247
|
+
}
|
|
6248
|
+
for (const [id, row] of storedById) if (!kept.has(id)) ctx.deletes.push(...collectSecretMarkerRefs(row));
|
|
6249
|
+
return {
|
|
6250
|
+
kind: "value",
|
|
6251
|
+
value: rows
|
|
6252
|
+
};
|
|
6253
|
+
}
|
|
6254
|
+
async function writeNode(ctx, node, incoming, stored, fieldPath) {
|
|
6255
|
+
switch (node.kind) {
|
|
6256
|
+
case "leaf": return writeLeaf(ctx, incoming, stored, fieldPath);
|
|
6257
|
+
case "array": return writeArray(ctx, node, incoming, stored, fieldPath);
|
|
6258
|
+
case "object": {
|
|
6259
|
+
if (!isRecord(incoming)) {
|
|
6260
|
+
if (incoming === void 0) return KEEP;
|
|
6261
|
+
ctx.deletes.push(...collectSecretMarkerRefs(stored));
|
|
6262
|
+
return {
|
|
6263
|
+
kind: "value",
|
|
6264
|
+
value: incoming
|
|
6265
|
+
};
|
|
6266
|
+
}
|
|
6267
|
+
const storedObj = isRecord(stored) ? stored : {};
|
|
6268
|
+
return {
|
|
6269
|
+
kind: "value",
|
|
6270
|
+
value: await writeMembers(ctx, node.children, incoming, storedObj, (m) => `${fieldPath}.${m}`)
|
|
6271
|
+
};
|
|
6272
|
+
}
|
|
6273
|
+
}
|
|
6274
|
+
}
|
|
6275
|
+
/** Split a perNode-scoped key (`key@nodeId`). */
|
|
6276
|
+
function splitNodeKey(key) {
|
|
6277
|
+
const at = key.indexOf("@");
|
|
6278
|
+
return at <= 0 ? {
|
|
6279
|
+
base: key,
|
|
6280
|
+
nodeId: null
|
|
6281
|
+
} : {
|
|
6282
|
+
base: key.slice(0, at),
|
|
6283
|
+
nodeId: key.slice(at + 1)
|
|
6284
|
+
};
|
|
6285
|
+
}
|
|
6286
|
+
/** Rewrite a settings patch so no secret value reaches the blob. See the file doc. */
|
|
6287
|
+
async function transformSecretWrite(input) {
|
|
6288
|
+
const deletes = [];
|
|
6289
|
+
const base = {
|
|
6290
|
+
secrets: input.secrets,
|
|
6291
|
+
mintId: input.mintId ?? defaultMintId,
|
|
6292
|
+
deletes,
|
|
6293
|
+
operatorWrite: input.operatorWrite === true
|
|
6294
|
+
};
|
|
6295
|
+
const out = {};
|
|
6296
|
+
for (const [key, incoming] of Object.entries(input.patch)) {
|
|
6297
|
+
const { base: baseKey, nodeId } = splitNodeKey(key);
|
|
6298
|
+
const node = input.tree.get(baseKey);
|
|
6299
|
+
if (node === void 0) {
|
|
6300
|
+
out[key] = incoming;
|
|
6301
|
+
continue;
|
|
6302
|
+
}
|
|
6303
|
+
const scope = nodeId !== null && nodeId.length > 0 ? {
|
|
6304
|
+
kind: "node",
|
|
6305
|
+
nodeId
|
|
6306
|
+
} : input.scope ?? globalSecretScope();
|
|
6307
|
+
const result = await writeNode({
|
|
6308
|
+
...base,
|
|
6309
|
+
scope
|
|
6310
|
+
}, node, incoming, input.stored[key], baseKey);
|
|
6311
|
+
if (result.kind === "value") out[key] = result.value;
|
|
6312
|
+
}
|
|
6313
|
+
return {
|
|
6314
|
+
patch: out,
|
|
6315
|
+
afterWrite: async () => {
|
|
6316
|
+
if (deletes.length === 0) return { orphaned: [] };
|
|
6317
|
+
try {
|
|
6318
|
+
await input.secrets.delete([...new Set(deletes)]);
|
|
6319
|
+
return { orphaned: [] };
|
|
6320
|
+
} catch {
|
|
6321
|
+
return { orphaned: [...new Set(deletes)] };
|
|
6322
|
+
}
|
|
6323
|
+
}
|
|
6324
|
+
};
|
|
6325
|
+
}
|
|
6326
|
+
/**
|
|
6327
|
+
* Replace every marker in `value` with its keychain value. Returns the SAME
|
|
6328
|
+
* reference when there is no marker (no allocation, no keychain call).
|
|
6329
|
+
*/
|
|
6330
|
+
async function resolveSecretMarkers(value, secrets) {
|
|
6331
|
+
const refs = collectSecretMarkerRefs(value);
|
|
6332
|
+
if (refs.length === 0) return {
|
|
6333
|
+
value,
|
|
6334
|
+
unresolved: []
|
|
6335
|
+
};
|
|
6336
|
+
const answers = await secrets.resolve(refs);
|
|
6337
|
+
const unresolved = [];
|
|
6338
|
+
for (const ref of new Set(refs)) {
|
|
6339
|
+
const answer = answers[ref];
|
|
6340
|
+
if (answer === void 0) unresolved.push({
|
|
6341
|
+
ref,
|
|
6342
|
+
reason: "not-initialized"
|
|
6343
|
+
});
|
|
6344
|
+
else if (answer.kind === "unavailable") unresolved.push({
|
|
6345
|
+
ref,
|
|
6346
|
+
reason: answer.reason
|
|
6347
|
+
});
|
|
6348
|
+
else if (answer.kind === "missing" || answer.kind === "forbidden") unresolved.push({
|
|
6349
|
+
ref,
|
|
6350
|
+
reason: answer.kind
|
|
6351
|
+
});
|
|
6352
|
+
}
|
|
6353
|
+
const substitute = (v) => {
|
|
6354
|
+
if (isSecretMarker(v)) {
|
|
6355
|
+
const answer = answers[v.$secret];
|
|
6356
|
+
return answer?.kind === "value" ? {
|
|
6357
|
+
keep: true,
|
|
6358
|
+
value: answer.value
|
|
6359
|
+
} : {
|
|
6360
|
+
keep: false,
|
|
6361
|
+
value: void 0
|
|
6362
|
+
};
|
|
6363
|
+
}
|
|
6364
|
+
if (Array.isArray(v)) {
|
|
6365
|
+
const items = [];
|
|
6366
|
+
for (const item of v) {
|
|
6367
|
+
const s = substitute(item);
|
|
6368
|
+
if (s.keep) items.push(s.value);
|
|
6369
|
+
}
|
|
6370
|
+
return {
|
|
6371
|
+
keep: true,
|
|
6372
|
+
value: items
|
|
6373
|
+
};
|
|
6374
|
+
}
|
|
6375
|
+
if (isRecord(v)) {
|
|
6376
|
+
const out = {};
|
|
6377
|
+
for (const [k, child] of Object.entries(v)) {
|
|
6378
|
+
const s = substitute(child);
|
|
6379
|
+
if (s.keep) out[k] = s.value;
|
|
6380
|
+
}
|
|
6381
|
+
return {
|
|
6382
|
+
keep: true,
|
|
6383
|
+
value: out
|
|
6384
|
+
};
|
|
6385
|
+
}
|
|
6386
|
+
return {
|
|
6387
|
+
keep: true,
|
|
6388
|
+
value: v
|
|
6389
|
+
};
|
|
6390
|
+
};
|
|
6391
|
+
return {
|
|
6392
|
+
value: substitute(value).value,
|
|
6393
|
+
unresolved
|
|
6394
|
+
};
|
|
6395
|
+
}
|
|
6396
|
+
function touchesTree(tree, patch) {
|
|
6397
|
+
if (tree.size === 0) return false;
|
|
6398
|
+
for (const key of Object.keys(patch)) {
|
|
6399
|
+
const at = key.indexOf("@");
|
|
6400
|
+
if (tree.has(at > 0 ? key.slice(0, at) : key)) return true;
|
|
6401
|
+
}
|
|
6402
|
+
return false;
|
|
6403
|
+
}
|
|
6404
|
+
/** The blob as stored now; a failed read REFUSES the write instead of guessing. */
|
|
6405
|
+
async function readStoredAddonBlob(raw) {
|
|
6406
|
+
const threeWay = raw.readAddonStoreResult;
|
|
6407
|
+
if (threeWay === void 0) return raw.readAddonStore();
|
|
6408
|
+
const result = await threeWay.call(raw);
|
|
6409
|
+
if (result.kind === "failed") throw new Error(`settings write refused: the stored blob could not be read (${result.error})`);
|
|
6410
|
+
return result.kind === "missing" ? {} : result.value;
|
|
6411
|
+
}
|
|
6412
|
+
function createSecretAwareSettings(raw, opts) {
|
|
6413
|
+
const chains = /* @__PURE__ */ new Map();
|
|
6414
|
+
const serialize = (key, fn) => {
|
|
6415
|
+
const next = (chains.get(key) ?? Promise.resolve()).then(fn, fn);
|
|
6416
|
+
const tail = next.catch(() => void 0);
|
|
6417
|
+
chains.set(key, tail);
|
|
6418
|
+
tail.then(() => {
|
|
6419
|
+
if (chains.get(key) === tail) chains.delete(key);
|
|
6420
|
+
});
|
|
6421
|
+
return next;
|
|
6422
|
+
};
|
|
6423
|
+
const write = async (chainKey, tree, scope, patch, readStored, rawWrite) => {
|
|
6424
|
+
if (!touchesTree(tree, patch)) return rawWrite(patch);
|
|
6425
|
+
return serialize(chainKey, async () => {
|
|
6426
|
+
const stored = await readStored();
|
|
6427
|
+
const result = await transformSecretWrite({
|
|
6428
|
+
tree,
|
|
6429
|
+
secrets: opts.secrets,
|
|
6430
|
+
patch,
|
|
6431
|
+
stored,
|
|
6432
|
+
...scope !== void 0 ? { scope } : {},
|
|
6433
|
+
operatorWrite: opts.isOperatorWrite?.() === true
|
|
6434
|
+
});
|
|
6435
|
+
if (Object.keys(result.patch).length > 0) await rawWrite(result.patch);
|
|
6436
|
+
const { orphaned } = await result.afterWrite();
|
|
6437
|
+
if (orphaned.length > 0) opts.onOrphaned(orphaned);
|
|
6438
|
+
});
|
|
6439
|
+
};
|
|
6440
|
+
const wrapped = {
|
|
6441
|
+
writeAddonStore: (patch) => write("addon", opts.addonTree(), void 0, patch, () => readStoredAddonBlob(raw), (p) => raw.writeAddonStore(p)),
|
|
6442
|
+
writeDeviceStore: (deviceId, patch) => write(`device:${deviceId}`, opts.deviceTree(), {
|
|
6443
|
+
kind: "device",
|
|
6444
|
+
deviceId
|
|
6445
|
+
}, patch, () => raw.readDeviceStore(deviceId), (p) => raw.writeDeviceStore(deviceId, p))
|
|
6446
|
+
};
|
|
6447
|
+
return new Proxy(raw, { get(target, prop, receiver) {
|
|
6448
|
+
if (prop === "writeAddonStore") return wrapped.writeAddonStore;
|
|
6449
|
+
if (prop === "writeDeviceStore") return wrapped.writeDeviceStore;
|
|
6450
|
+
const value = Reflect.get(target, prop, receiver);
|
|
6451
|
+
return typeof value === "function" ? value.bind(target) : value;
|
|
6452
|
+
} });
|
|
6453
|
+
}
|
|
6454
|
+
/** The context the addon sees: identical, except that its settings writes are secret-aware. */
|
|
6455
|
+
function withSecretAwareSettings(context, opts) {
|
|
6456
|
+
const raw = context.settings;
|
|
6457
|
+
if (raw === void 0) return context;
|
|
6458
|
+
const settings = createSecretAwareSettings(raw, opts);
|
|
6459
|
+
return new Proxy(context, { get(target, prop, receiver) {
|
|
6460
|
+
if (prop === "settings") return settings;
|
|
6461
|
+
return Reflect.get(target, prop, receiver);
|
|
6462
|
+
} });
|
|
6463
|
+
}
|
|
6464
|
+
var LEAF = { kind: "leaf" };
|
|
6465
|
+
var DEFAULT_ITEM_ID_KEY = "id";
|
|
6466
|
+
function collectFields(fields, out) {
|
|
6467
|
+
for (const field of fields) {
|
|
6468
|
+
if (field.type === "group") {
|
|
6469
|
+
collectFields(field.fields, out);
|
|
6470
|
+
continue;
|
|
6471
|
+
}
|
|
6472
|
+
if (field.type === "sub-tabs") {
|
|
6473
|
+
for (const tab of field.tabs) collectFields(tab.fields, out);
|
|
6474
|
+
continue;
|
|
6475
|
+
}
|
|
6476
|
+
if (field.type === "editable-array") {
|
|
6477
|
+
const item = /* @__PURE__ */ new Map();
|
|
6478
|
+
for (const itemField of field.itemFields) if ("key" in itemField && isKeychainStoredField(itemField)) item.set(itemField.key, LEAF);
|
|
6479
|
+
if (item.size > 0) out.set(field.key, {
|
|
6480
|
+
kind: "array",
|
|
6481
|
+
idKey: field.itemIdKey ?? DEFAULT_ITEM_ID_KEY,
|
|
6482
|
+
item
|
|
6483
|
+
});
|
|
6484
|
+
continue;
|
|
6485
|
+
}
|
|
6486
|
+
if (!("key" in field) || typeof field.key !== "string") continue;
|
|
6487
|
+
if (isKeychainStoredField(field)) out.set(field.key, LEAF);
|
|
6488
|
+
}
|
|
6489
|
+
}
|
|
6490
|
+
/** The secret tree a settings schema declares. */
|
|
6491
|
+
function secretTreeFromSchema(schema) {
|
|
6492
|
+
const out = /* @__PURE__ */ new Map();
|
|
6493
|
+
if (schema === null) return out;
|
|
6494
|
+
for (const section of schema.sections) collectFields(section.fields, out);
|
|
6495
|
+
return out;
|
|
6496
|
+
}
|
|
6497
|
+
/** Parse `a.b[id].c` into segments; throws on a malformed path (a declaration bug). */
|
|
6498
|
+
function parseSecretStatePath(path) {
|
|
6499
|
+
const segments = [];
|
|
6500
|
+
for (const raw of path.split(".")) {
|
|
6501
|
+
const m = /^([^[\]]+)(?:\[([^[\]]+)\])?$/.exec(raw);
|
|
6502
|
+
if (m === null || m[1] === void 0) throw new Error(`secretStatePaths: malformed path "${path}"`);
|
|
6503
|
+
segments.push(m[2] !== void 0 ? {
|
|
6504
|
+
key: m[1],
|
|
6505
|
+
idKey: m[2]
|
|
6506
|
+
} : { key: m[1] });
|
|
6507
|
+
}
|
|
6508
|
+
if (segments.length === 0) throw new Error(`secretStatePaths: empty path`);
|
|
6509
|
+
if (segments[segments.length - 1]?.idKey !== void 0) throw new Error(`secretStatePaths: "${path}" ends on an array — name the member that is secret`);
|
|
6510
|
+
return segments;
|
|
6511
|
+
}
|
|
6512
|
+
function insert(into, segments) {
|
|
6513
|
+
const [head, ...rest] = segments;
|
|
6514
|
+
if (head === void 0) return;
|
|
6515
|
+
if (rest.length === 0) {
|
|
6516
|
+
into.set(head.key, LEAF);
|
|
6517
|
+
return;
|
|
6518
|
+
}
|
|
6519
|
+
const existing = into.get(head.key);
|
|
6520
|
+
if (head.idKey !== void 0) {
|
|
6521
|
+
const item = new Map(existing?.kind === "array" ? existing.item : []);
|
|
6522
|
+
insert(item, rest);
|
|
6523
|
+
into.set(head.key, {
|
|
6524
|
+
kind: "array",
|
|
6525
|
+
idKey: head.idKey,
|
|
6526
|
+
item
|
|
6527
|
+
});
|
|
6528
|
+
return;
|
|
6529
|
+
}
|
|
6530
|
+
const children = new Map(existing?.kind === "object" ? existing.children : []);
|
|
6531
|
+
insert(children, rest);
|
|
6532
|
+
into.set(head.key, {
|
|
6533
|
+
kind: "object",
|
|
6534
|
+
children
|
|
6535
|
+
});
|
|
6536
|
+
}
|
|
6537
|
+
/** Add hidden-state paths (`secretStatePaths`) to a schema-derived tree. */
|
|
6538
|
+
function mergeSecretStatePaths(tree, paths) {
|
|
6539
|
+
if (paths.length === 0) return tree;
|
|
6540
|
+
const out = new Map(tree);
|
|
6541
|
+
for (const path of paths) insert(out, parseSecretStatePath(path));
|
|
6542
|
+
return out;
|
|
6543
|
+
}
|
|
6544
|
+
/** First retry of a secret the keychain could not serve; doubles to {@link SECRET_RETRY_MAX_MS}. */
|
|
6545
|
+
var SECRET_RETRY_FIRST_MS = 5e3;
|
|
6546
|
+
var SECRET_RETRY_MAX_MS = 5 * 6e4;
|
|
6547
|
+
/** Coalesces a burst of `keychain.changed` events into one re-resolve. */
|
|
6548
|
+
var SECRET_CHANGE_DEBOUNCE_MS = 250;
|
|
6013
6549
|
/**
|
|
6014
6550
|
* Base class for CamStack addons. Eliminates settings boilerplate:
|
|
6015
6551
|
*
|
|
@@ -6079,6 +6615,25 @@ var BaseAddon = class {
|
|
|
6079
6615
|
settingsStoreReady = false;
|
|
6080
6616
|
/** Default config values. Provided via constructor. */
|
|
6081
6617
|
defaults;
|
|
6618
|
+
/**
|
|
6619
|
+
* Hidden-state paths that hold secrets (D787) — values the addon writes
|
|
6620
|
+
* itself (`updateGlobalSettings`, `state()`) that no form field declares.
|
|
6621
|
+
* Stored in the keychain exactly like a `password` field. Syntax:
|
|
6622
|
+
* `'snapshotSigningKey'`, `'identity.pincode'`, `'tokens[userId].accessToken'`
|
|
6623
|
+
* (`key[<id field>]` addresses array items by id, never by index).
|
|
6624
|
+
*/
|
|
6625
|
+
secretStatePaths = [];
|
|
6626
|
+
_addonSecretTree = null;
|
|
6627
|
+
_deviceSecretTree = null;
|
|
6628
|
+
/** Refs the last resolved config pointed at — a change to one re-resolves. */
|
|
6629
|
+
_configSecretRefs = /* @__PURE__ */ new Set();
|
|
6630
|
+
_unresolvedSecrets = [];
|
|
6631
|
+
_secretRetryTimer = null;
|
|
6632
|
+
_secretRetryDelayMs = SECRET_RETRY_FIRST_MS;
|
|
6633
|
+
_secretChangeTimer = null;
|
|
6634
|
+
_secretChangeUnsub = null;
|
|
6635
|
+
/** >0 while an OPERATOR's settings write is being applied. */
|
|
6636
|
+
_operatorWriteDepth = 0;
|
|
6082
6637
|
constructor(defaults) {
|
|
6083
6638
|
this.defaults = defaults;
|
|
6084
6639
|
this._config = { ...defaults };
|
|
@@ -6114,8 +6669,18 @@ var BaseAddon = class {
|
|
|
6114
6669
|
return this._config;
|
|
6115
6670
|
}
|
|
6116
6671
|
async initialize(context) {
|
|
6117
|
-
|
|
6672
|
+
const secrets = context.secrets;
|
|
6673
|
+
this._ctx = secrets !== void 0 ? withSecretAwareSettings(context, {
|
|
6674
|
+
secrets,
|
|
6675
|
+
addonTree: () => this.addonSecretTree(),
|
|
6676
|
+
deviceTree: () => this.deviceSecretTree(),
|
|
6677
|
+
onOrphaned: (refs) => context.logger.warn("keychain refs dropped by a settings write could not be deleted", { meta: { refs: [...refs] } }),
|
|
6678
|
+
isOperatorWrite: () => this._operatorWriteDepth > 0
|
|
6679
|
+
}) : context;
|
|
6118
6680
|
await this.resolveConfig();
|
|
6681
|
+
if (secrets !== void 0) this._secretChangeUnsub = secrets.onChange((ref) => {
|
|
6682
|
+
if (this._configSecretRefs.has(ref)) this.scheduleSecretReresolve(SECRET_CHANGE_DEBOUNCE_MS);
|
|
6683
|
+
});
|
|
6119
6684
|
const result = await this.onInitialize();
|
|
6120
6685
|
this.emitLifecycle(EventCategory.AddonStarted);
|
|
6121
6686
|
const normalized = normalizeAddonInitResult(result);
|
|
@@ -6148,6 +6713,12 @@ var BaseAddon = class {
|
|
|
6148
6713
|
*/
|
|
6149
6714
|
async onHubReachable() {}
|
|
6150
6715
|
async shutdown() {
|
|
6716
|
+
this._secretChangeUnsub?.();
|
|
6717
|
+
this._secretChangeUnsub = null;
|
|
6718
|
+
if (this._secretRetryTimer !== null) clearTimeout(this._secretRetryTimer);
|
|
6719
|
+
if (this._secretChangeTimer !== null) clearTimeout(this._secretChangeTimer);
|
|
6720
|
+
this._secretRetryTimer = null;
|
|
6721
|
+
this._secretChangeTimer = null;
|
|
6151
6722
|
this.emitLifecycle(EventCategory.AddonStopped);
|
|
6152
6723
|
if (this.autoEmitReadiness) this.emitReadinessForProviders("down");
|
|
6153
6724
|
await this.onShutdown();
|
|
@@ -6226,7 +6797,7 @@ var BaseAddon = class {
|
|
|
6226
6797
|
return hydrateSchema(schema, overlay ? {
|
|
6227
6798
|
...projected,
|
|
6228
6799
|
...overlay
|
|
6229
|
-
} : projected);
|
|
6800
|
+
} : projected, { inlineSecretsAsViews: true });
|
|
6230
6801
|
}
|
|
6231
6802
|
/**
|
|
6232
6803
|
* The integration-level view of this addon's settings: exactly the sections
|
|
@@ -6275,7 +6846,7 @@ var BaseAddon = class {
|
|
|
6275
6846
|
return hydrateSchema({
|
|
6276
6847
|
...schema,
|
|
6277
6848
|
sections
|
|
6278
|
-
}, projected);
|
|
6849
|
+
}, projected, { inlineSecretsAsViews: true });
|
|
6279
6850
|
}
|
|
6280
6851
|
/**
|
|
6281
6852
|
* The raw addon store PROJECTED onto the target node's bare per-node keys:
|
|
@@ -6329,18 +6900,50 @@ var BaseAddon = class {
|
|
|
6329
6900
|
value: result.value[key]
|
|
6330
6901
|
};
|
|
6331
6902
|
}
|
|
6903
|
+
/**
|
|
6904
|
+
* The OPERATOR's write — a settings form or an admin API call, dispatched by
|
|
6905
|
+
* the kernel. Identical to {@link updateGlobalSettings}, except that a secret
|
|
6906
|
+
* the operator sends is stored as sent even when it equals a pre-keychain
|
|
6907
|
+
* inline value: the operator re-entering a password is a change, an addon
|
|
6908
|
+
* writing back what it read is not (D787).
|
|
6909
|
+
*/
|
|
6910
|
+
async updateGlobalSettingsAsOperator(patch, nodeId) {
|
|
6911
|
+
this._operatorWriteDepth++;
|
|
6912
|
+
try {
|
|
6913
|
+
await this.applyGlobalPatch(patch, nodeId);
|
|
6914
|
+
} finally {
|
|
6915
|
+
this._operatorWriteDepth--;
|
|
6916
|
+
}
|
|
6917
|
+
}
|
|
6332
6918
|
async updateGlobalSettings(patch, nodeId) {
|
|
6919
|
+
await this.applyGlobalPatch(patch, nodeId);
|
|
6920
|
+
}
|
|
6921
|
+
/**
|
|
6922
|
+
* REMOVE stored secrets — their keychain values and their markers (D787).
|
|
6923
|
+
*
|
|
6924
|
+
* Writing `''` to a secret field KEEPS what is stored (an empty string is
|
|
6925
|
+
* what a defaults fallback writes back, and it must never destroy a
|
|
6926
|
+
* credential), so code that means "forget this token" says so here. Without
|
|
6927
|
+
* a keychain (an older kernel) it writes `''`, as such code always did.
|
|
6928
|
+
*/
|
|
6929
|
+
async clearSecrets(keys, nodeId) {
|
|
6930
|
+
const tree = this.addonSecretTree();
|
|
6931
|
+
const keychain = this._ctx?.secrets !== void 0;
|
|
6932
|
+
const patch = {};
|
|
6933
|
+
for (const key of keys) patch[key] = keychain && tree.has(key) ? SECRET_CLEAR : "";
|
|
6934
|
+
await this.applyGlobalPatch(patch, nodeId);
|
|
6935
|
+
}
|
|
6936
|
+
async applyGlobalPatch(barePatch, nodeId) {
|
|
6333
6937
|
const keys = this.perNodeKeys();
|
|
6334
6938
|
const localNode = normalizeNodeId(this._ctx?.kernel?.localNodeId);
|
|
6335
6939
|
const target = normalizeNodeId(nodeId ?? this._ctx?.kernel?.localNodeId);
|
|
6336
|
-
const barePatch = patch;
|
|
6337
6940
|
const scoped = keys.size > 0 ? scopePatch(barePatch, keys, target) : barePatch;
|
|
6338
6941
|
await this._ctx?.settings?.writeAddonStore(scoped);
|
|
6339
6942
|
if (target !== localNode) return;
|
|
6340
6943
|
await this.resolveConfig();
|
|
6341
6944
|
await this.onConfigChanged();
|
|
6342
6945
|
this.emitLifecycle(EventCategory.AddonUpdated, { level: "global" });
|
|
6343
|
-
this.maybeAutoRestart(
|
|
6946
|
+
this.maybeAutoRestart(Object.keys(barePatch), this.globalSettingsSchema());
|
|
6344
6947
|
}
|
|
6345
6948
|
/**
|
|
6346
6949
|
* The set of field keys the global settings schema declares `perNode: true`
|
|
@@ -6365,7 +6968,7 @@ var BaseAddon = class {
|
|
|
6365
6968
|
* time to return its response before the addon is torn down and
|
|
6366
6969
|
* re-initialised by `AddonRegistryService.restartAddon`.
|
|
6367
6970
|
*/
|
|
6368
|
-
maybeAutoRestart(
|
|
6971
|
+
maybeAutoRestart(patchKeys, schema) {
|
|
6369
6972
|
if (!schema) return;
|
|
6370
6973
|
const restartKeys = /* @__PURE__ */ new Set();
|
|
6371
6974
|
for (const section of schema.sections) for (const field of section.fields) {
|
|
@@ -6373,13 +6976,13 @@ var BaseAddon = class {
|
|
|
6373
6976
|
if (field.requiresRestart) restartKeys.add(field.key);
|
|
6374
6977
|
}
|
|
6375
6978
|
if (restartKeys.size === 0) return;
|
|
6376
|
-
if (!
|
|
6979
|
+
if (!patchKeys.some((k) => restartKeys.has(k))) return;
|
|
6377
6980
|
const ctx = this._ctx;
|
|
6378
6981
|
if (!ctx) return;
|
|
6379
6982
|
const addonId = ctx.id;
|
|
6380
6983
|
setImmediate(() => {
|
|
6381
6984
|
ctx.api.addons?.restartAddon?.mutate({ addonId }).then(() => {
|
|
6382
|
-
ctx.logger.info("addon auto-restart triggered by restart-required setting change", { meta: { changedFields:
|
|
6985
|
+
ctx.logger.info("addon auto-restart triggered by restart-required setting change", { meta: { changedFields: patchKeys.filter((k) => restartKeys.has(k)) } });
|
|
6383
6986
|
}).catch((err) => {
|
|
6384
6987
|
ctx.logger.error("addon auto-restart failed", { meta: { error: err instanceof Error ? err.message : String(err) } });
|
|
6385
6988
|
});
|
|
@@ -6388,7 +6991,7 @@ var BaseAddon = class {
|
|
|
6388
6991
|
async getDeviceSettings(deviceId) {
|
|
6389
6992
|
const schema = this.deviceSettingsSchema();
|
|
6390
6993
|
if (!schema) return { sections: [] };
|
|
6391
|
-
return hydrateSchema(schema, await this._ctx?.settings?.readDeviceStore(deviceId) ?? {});
|
|
6994
|
+
return hydrateSchema(schema, await this._ctx?.settings?.readDeviceStore(deviceId) ?? {}, { inlineSecretsAsViews: true });
|
|
6392
6995
|
}
|
|
6393
6996
|
async updateDeviceSettings(deviceId, patch) {
|
|
6394
6997
|
await this._ctx?.settings?.writeDeviceStore(deviceId, patch);
|
|
@@ -6518,7 +7121,7 @@ var BaseAddon = class {
|
|
|
6518
7121
|
* selection at boot (absent scoped key ⇒ the constructor default wins).
|
|
6519
7122
|
*/
|
|
6520
7123
|
async resolveConfig() {
|
|
6521
|
-
const stored = await this.readAddonStoreWithRetry();
|
|
7124
|
+
const stored = await this.resolveStoredSecrets(await this.readAddonStoreWithRetry());
|
|
6522
7125
|
const perNode = this.perNodeKeys();
|
|
6523
7126
|
const localNode = normalizeNodeId(this._ctx?.kernel?.localNodeId);
|
|
6524
7127
|
const resolved = { ...this.defaults };
|
|
@@ -6543,7 +7146,7 @@ var BaseAddon = class {
|
|
|
6543
7146
|
key,
|
|
6544
7147
|
schema,
|
|
6545
7148
|
fallback,
|
|
6546
|
-
read: () => this.readAddonStoreWithRetry(),
|
|
7149
|
+
read: async () => this.resolveStoredSecrets(await this.readAddonStoreWithRetry()),
|
|
6547
7150
|
write: async (patch) => {
|
|
6548
7151
|
await this._ctx?.settings?.writeAddonStore(patch);
|
|
6549
7152
|
},
|
|
@@ -6560,7 +7163,7 @@ var BaseAddon = class {
|
|
|
6560
7163
|
key,
|
|
6561
7164
|
schema,
|
|
6562
7165
|
fallback,
|
|
6563
|
-
read: async () => await this._ctx?.settings?.readDeviceStore(deviceId) ?? {},
|
|
7166
|
+
read: async () => this.resolveStoredSecrets(await this._ctx?.settings?.readDeviceStore(deviceId) ?? {}, false),
|
|
6564
7167
|
write: async (patch) => {
|
|
6565
7168
|
await this._ctx?.settings?.writeDeviceStore(deviceId, patch);
|
|
6566
7169
|
},
|
|
@@ -6572,6 +7175,70 @@ var BaseAddon = class {
|
|
|
6572
7175
|
} })
|
|
6573
7176
|
});
|
|
6574
7177
|
}
|
|
7178
|
+
/** The addon store's secret tree: schema fields by TYPE, plus `secretStatePaths`. */
|
|
7179
|
+
addonSecretTree() {
|
|
7180
|
+
this._addonSecretTree ??= mergeSecretStatePaths(secretTreeFromSchema(this.globalSettingsSchema()), this.secretStatePaths);
|
|
7181
|
+
return this._addonSecretTree;
|
|
7182
|
+
}
|
|
7183
|
+
deviceSecretTree() {
|
|
7184
|
+
this._deviceSecretTree ??= secretTreeFromSchema(this.deviceSettingsSchema());
|
|
7185
|
+
return this._deviceSecretTree;
|
|
7186
|
+
}
|
|
7187
|
+
/**
|
|
7188
|
+
* Secrets of this addon's stored config that could not be resolved on the
|
|
7189
|
+
* last read, with why. Non-empty means the addon is running WITHOUT them —
|
|
7190
|
+
* an addon whose function needs one should report itself degraded rather
|
|
7191
|
+
* than start on an empty credential.
|
|
7192
|
+
*/
|
|
7193
|
+
get unresolvedSecrets() {
|
|
7194
|
+
return this._unresolvedSecrets;
|
|
7195
|
+
}
|
|
7196
|
+
/**
|
|
7197
|
+
* Substitute every keychain marker in a stored blob with its value. With no
|
|
7198
|
+
* keychain (no `ctx.secrets`) or no marker, the blob comes back unchanged.
|
|
7199
|
+
* An unresolvable value is LEFT OUT (never `''`), logged by ref — never by
|
|
7200
|
+
* value — and, when the cause can pass, retried with backoff. Nothing is
|
|
7201
|
+
* ever written back from here.
|
|
7202
|
+
*/
|
|
7203
|
+
async resolveStoredSecrets(blob, trackForConfig = true) {
|
|
7204
|
+
const secrets = this._ctx?.secrets;
|
|
7205
|
+
if (secrets === void 0) return blob;
|
|
7206
|
+
const refs = collectSecretMarkerRefs(blob);
|
|
7207
|
+
if (trackForConfig) this._configSecretRefs = new Set(refs);
|
|
7208
|
+
if (refs.length === 0) {
|
|
7209
|
+
if (trackForConfig) this._unresolvedSecrets = [];
|
|
7210
|
+
return blob;
|
|
7211
|
+
}
|
|
7212
|
+
const { value, unresolved } = await resolveSecretMarkers(blob, secrets);
|
|
7213
|
+
if (trackForConfig) {
|
|
7214
|
+
this._unresolvedSecrets = unresolved;
|
|
7215
|
+
if (unresolved.length > 0) {
|
|
7216
|
+
this._ctx?.logger?.error?.("secret unavailable — running without it, will retry", { meta: { secrets: unresolved.map((u) => ({
|
|
7217
|
+
ref: u.ref,
|
|
7218
|
+
reason: u.reason
|
|
7219
|
+
})) } });
|
|
7220
|
+
if (unresolved.some((u) => u.reason !== "missing" && u.reason !== "forbidden")) {
|
|
7221
|
+
this.scheduleSecretReresolve(this._secretRetryDelayMs);
|
|
7222
|
+
this._secretRetryDelayMs = Math.min(this._secretRetryDelayMs * 2, SECRET_RETRY_MAX_MS);
|
|
7223
|
+
}
|
|
7224
|
+
} else this._secretRetryDelayMs = SECRET_RETRY_FIRST_MS;
|
|
7225
|
+
}
|
|
7226
|
+
return value;
|
|
7227
|
+
}
|
|
7228
|
+
/** Re-resolve the config (a keychain-only change, or a retry) and apply it. */
|
|
7229
|
+
scheduleSecretReresolve(delayMs) {
|
|
7230
|
+
const timerOf = delayMs === SECRET_CHANGE_DEBOUNCE_MS ? "_secretChangeTimer" : "_secretRetryTimer";
|
|
7231
|
+
if (this[timerOf] !== null) return;
|
|
7232
|
+
const timer = setTimeout(() => {
|
|
7233
|
+
this[timerOf] = null;
|
|
7234
|
+
if (this._ctx === null) return;
|
|
7235
|
+
this.resolveConfig().then(() => this.onConfigChanged()).catch((err) => {
|
|
7236
|
+
this._ctx?.logger?.error?.("re-resolving secrets failed", { meta: { error: err instanceof Error ? err.message : String(err) } });
|
|
7237
|
+
});
|
|
7238
|
+
}, delayMs);
|
|
7239
|
+
timer.unref?.();
|
|
7240
|
+
this[timerOf] = timer;
|
|
7241
|
+
}
|
|
6575
7242
|
/**
|
|
6576
7243
|
* Wrap `ctx.settings.readAddonStore()` with a short retry budget so a
|
|
6577
7244
|
* transient settings-store outage (mid-restart of sqlite-settings, tsx-watch
|
|
@@ -7336,6 +8003,69 @@ var deviceOpsCapability = {
|
|
|
7336
8003
|
getRawState: method(object({ deviceId: number() }), RawStateResultSchema.nullable(), { auth: "protected" })
|
|
7337
8004
|
}
|
|
7338
8005
|
};
|
|
8006
|
+
function defOf(schema) {
|
|
8007
|
+
return schema._zod?.def ?? {};
|
|
8008
|
+
}
|
|
8009
|
+
function declaredHere(schema) {
|
|
8010
|
+
return globalRegistry.get(schema)?.secret === true;
|
|
8011
|
+
}
|
|
8012
|
+
/** Wrapper kinds whose `innerType` is the field itself. */
|
|
8013
|
+
var WRAPPERS = new Set([
|
|
8014
|
+
"optional",
|
|
8015
|
+
"nullable",
|
|
8016
|
+
"default",
|
|
8017
|
+
"prefault",
|
|
8018
|
+
"catch",
|
|
8019
|
+
"readonly",
|
|
8020
|
+
"nonoptional"
|
|
8021
|
+
]);
|
|
8022
|
+
/**
|
|
8023
|
+
* The schema layers that make up ONE field: the schema itself and every
|
|
8024
|
+
* wrapper below it (optional / default / nullable / readonly / catch), plus
|
|
8025
|
+
* both sides of a pipe (`z.preprocess` puts the real schema on `out`,
|
|
8026
|
+
* `.transform` on `in`).
|
|
8027
|
+
*/
|
|
8028
|
+
function layersOf(schema) {
|
|
8029
|
+
const out = [];
|
|
8030
|
+
const queue = [schema];
|
|
8031
|
+
while (queue.length > 0) {
|
|
8032
|
+
const s = queue.shift();
|
|
8033
|
+
if (!s || out.includes(s)) continue;
|
|
8034
|
+
out.push(s);
|
|
8035
|
+
const def = defOf(s);
|
|
8036
|
+
if (def.type !== void 0 && WRAPPERS.has(def.type) && def.innerType) queue.push(def.innerType);
|
|
8037
|
+
if (def.type === "pipe") {
|
|
8038
|
+
if (def.in) queue.push(def.in);
|
|
8039
|
+
if (def.out) queue.push(def.out);
|
|
8040
|
+
}
|
|
8041
|
+
}
|
|
8042
|
+
return out;
|
|
8043
|
+
}
|
|
8044
|
+
/** True when any layer of this field declares `.meta({ secret: true })`. */
|
|
8045
|
+
function isZodSecret(schema) {
|
|
8046
|
+
return layersOf(schema).some(declaredHere);
|
|
8047
|
+
}
|
|
8048
|
+
/**
|
|
8049
|
+
* Every declared secret path in a config schema: dotted keys, `[]` for "each
|
|
8050
|
+
* element of this array" (`connection.password`, `rows[].token`). A declared
|
|
8051
|
+
* object or array is reported as one path and not descended into — everything
|
|
8052
|
+
* under it is secret.
|
|
8053
|
+
*/
|
|
8054
|
+
function collectZodSecretPaths(schema, prefix = "") {
|
|
8055
|
+
if (isZodSecret(schema)) return prefix.length > 0 ? [prefix] : [];
|
|
8056
|
+
const paths = [];
|
|
8057
|
+
for (const layer of layersOf(schema)) {
|
|
8058
|
+
const def = defOf(layer);
|
|
8059
|
+
if (def.type === "object" && def.shape) for (const [key, child] of Object.entries(def.shape)) paths.push(...collectZodSecretPaths(child, prefix ? `${prefix}.${key}` : key));
|
|
8060
|
+
else if (def.type === "array" && def.element) paths.push(...collectZodSecretPaths(def.element, `${prefix}[]`));
|
|
8061
|
+
else if (def.type === "union" && def.options) for (const option of def.options) paths.push(...collectZodSecretPaths(option, prefix));
|
|
8062
|
+
else if (def.type === "intersection") {
|
|
8063
|
+
if (def.left) paths.push(...collectZodSecretPaths(def.left, prefix));
|
|
8064
|
+
if (def.right) paths.push(...collectZodSecretPaths(def.right, prefix));
|
|
8065
|
+
}
|
|
8066
|
+
}
|
|
8067
|
+
return [...new Set(paths)];
|
|
8068
|
+
}
|
|
7339
8069
|
/**
|
|
7340
8070
|
* AUTO-GENERATED by scripts/generate-device-scoped-caps.ts — DO NOT EDIT.
|
|
7341
8071
|
*
|
|
@@ -16317,6 +17047,254 @@ id: union([string(), number()]) }), {
|
|
|
16317
17047
|
})
|
|
16318
17048
|
}
|
|
16319
17049
|
};
|
|
17050
|
+
/**
|
|
17051
|
+
* `keychain` — the hub's encrypted store of secret values (D787).
|
|
17052
|
+
*
|
|
17053
|
+
* Settings blobs never hold a secret: they hold a marker
|
|
17054
|
+
* `{"$secret":"secret://<owner>/<scope>/<fieldPath>","v":1}` and the value
|
|
17055
|
+
* lives here, AES-256-GCM under a data key that a master key wraps. This cap
|
|
17056
|
+
* is the OWNER's door to its own values: every method is owner-checked
|
|
17057
|
+
* against the CALLER, never against anything the caller claims.
|
|
17058
|
+
*
|
|
17059
|
+
* Who the caller is: the transport stamps `callerAddonId` into the args of a
|
|
17060
|
+
* call that crossed a process (the parent `LocalChildRegistry` from the UDS
|
|
17061
|
+
* connection, the agent from its child's connection carried in
|
|
17062
|
+
* `$hub-cap-fwd`'s envelope). A stamp always overwrites; a wire call with no
|
|
17063
|
+
* stamp has its claim stripped. Only a hub in-process caller may state its own
|
|
17064
|
+
* identity — `ctx.secrets` does that with the addon id closed over. This is
|
|
17065
|
+
* identity against BUGS and misrouting, not against a malicious addon (every
|
|
17066
|
+
* runner is the same OS user): see the threat model in
|
|
17067
|
+
* `docs/design/2026-10-08-secrets-keychain.md`.
|
|
17068
|
+
*
|
|
17069
|
+
* `callerAddonId` is deliberately NOT in any input schema: the tRPC router
|
|
17070
|
+
* parses the input, so a session can never supply it, and the internal mount
|
|
17071
|
+
* floors every method to admin anyway (D240).
|
|
17072
|
+
*
|
|
17073
|
+
* Internal: addons reach it through `ctx.secrets`, never directly.
|
|
17074
|
+
*/
|
|
17075
|
+
/** Why a value cannot be served right now. Never folded into "missing". */
|
|
17076
|
+
var KeychainUnavailableReasonSchema = _enum([
|
|
17077
|
+
"key-missing",
|
|
17078
|
+
"wrong-key",
|
|
17079
|
+
"key-file-unreadable",
|
|
17080
|
+
"store-unavailable",
|
|
17081
|
+
"not-initialized",
|
|
17082
|
+
"decrypt-failed"
|
|
17083
|
+
]);
|
|
17084
|
+
var KeychainStateSchema = discriminatedUnion("state", [object({ state: literal("ready") }), object({
|
|
17085
|
+
state: literal("locked"),
|
|
17086
|
+
reason: KeychainUnavailableReasonSchema
|
|
17087
|
+
})]);
|
|
17088
|
+
var KeychainResolveEntrySchema = discriminatedUnion("kind", [
|
|
17089
|
+
object({
|
|
17090
|
+
kind: literal("value"),
|
|
17091
|
+
value: string(),
|
|
17092
|
+
version: number().int()
|
|
17093
|
+
}),
|
|
17094
|
+
object({ kind: literal("missing") }),
|
|
17095
|
+
object({
|
|
17096
|
+
kind: literal("unavailable"),
|
|
17097
|
+
reason: KeychainUnavailableReasonSchema
|
|
17098
|
+
}),
|
|
17099
|
+
object({ kind: literal("forbidden") })
|
|
17100
|
+
]);
|
|
17101
|
+
var KeychainResolveResultSchema = record(string(), KeychainResolveEntrySchema);
|
|
17102
|
+
/** Metadata of one stored value — never the value. */
|
|
17103
|
+
var KeychainSecretMetaSchema = object({
|
|
17104
|
+
ref: string(),
|
|
17105
|
+
owner: string(),
|
|
17106
|
+
/** Formatted scope (`global`, `node/<id>`, `device/<id>`, …). */
|
|
17107
|
+
scope: string(),
|
|
17108
|
+
fieldPath: string(),
|
|
17109
|
+
version: number().int(),
|
|
17110
|
+
createdAt: number(),
|
|
17111
|
+
updatedAt: number(),
|
|
17112
|
+
/** `addon:<id>` | `user:<id>` | `system`. */
|
|
17113
|
+
updatedBy: string(),
|
|
17114
|
+
/** Coarse — written at most once an hour per ref. `null` = never read. */
|
|
17115
|
+
lastReadAt: number().nullable()
|
|
17116
|
+
});
|
|
17117
|
+
var RefListSchema = array(string().min(1)).max(512);
|
|
17118
|
+
var keychainCapability = {
|
|
17119
|
+
name: "keychain",
|
|
17120
|
+
scope: "system",
|
|
17121
|
+
mode: "singleton",
|
|
17122
|
+
internal: true,
|
|
17123
|
+
methods: {
|
|
17124
|
+
/** Store (or replace) the caller's value at `ref`. Refused while locked. */
|
|
17125
|
+
put: method(object({
|
|
17126
|
+
ref: string().min(1),
|
|
17127
|
+
value: string().min(1)
|
|
17128
|
+
}), object({
|
|
17129
|
+
ref: string(),
|
|
17130
|
+
version: number().int()
|
|
17131
|
+
}), {
|
|
17132
|
+
kind: "mutation",
|
|
17133
|
+
auth: "admin"
|
|
17134
|
+
}),
|
|
17135
|
+
/**
|
|
17136
|
+
* Resolve the caller's refs in one round-trip. A locked keychain answers
|
|
17137
|
+
* `unavailable` per ref — never `missing`, never an empty value.
|
|
17138
|
+
*/
|
|
17139
|
+
resolve: method(object({ refs: RefListSchema }), KeychainResolveResultSchema, { auth: "admin" }),
|
|
17140
|
+
/** Remove the caller's refs. Unknown refs are ignored. */
|
|
17141
|
+
delete: method(object({ refs: RefListSchema }), object({ deleted: number().int() }), {
|
|
17142
|
+
kind: "mutation",
|
|
17143
|
+
auth: "admin"
|
|
17144
|
+
}),
|
|
17145
|
+
/** The caller's own refs, metadata only. */
|
|
17146
|
+
listMeta: method(object({}), array(KeychainSecretMetaSchema).readonly(), { auth: "admin" }),
|
|
17147
|
+
/** Whether values can be served — the save path refuses a write while locked. */
|
|
17148
|
+
getState: method(object({}), KeychainStateSchema, { auth: "admin" })
|
|
17149
|
+
}
|
|
17150
|
+
};
|
|
17151
|
+
var KeychainKeySourceSchema = object({
|
|
17152
|
+
kind: _enum([
|
|
17153
|
+
"config-file",
|
|
17154
|
+
"previous-config-file",
|
|
17155
|
+
"platform",
|
|
17156
|
+
"default-file"
|
|
17157
|
+
]),
|
|
17158
|
+
/** File sources only — a path is not a secret. */
|
|
17159
|
+
path: string().optional(),
|
|
17160
|
+
/**
|
|
17161
|
+
* True when a whole-volume backup of the data directory carries this key
|
|
17162
|
+
* next to the database it protects (the default file). The page warns.
|
|
17163
|
+
*/
|
|
17164
|
+
sharesBackupWithDatabase: boolean()
|
|
17165
|
+
});
|
|
17166
|
+
var KeychainStatusSchema = object({
|
|
17167
|
+
keychain: KeychainStateSchema,
|
|
17168
|
+
/** The source of the master key in use; `null` while locked. */
|
|
17169
|
+
keySource: KeychainKeySourceSchema.nullable(),
|
|
17170
|
+
/** The source configured to be primary — differs from `keySource` while a rotation is pending. */
|
|
17171
|
+
configuredSource: KeychainKeySourceSchema,
|
|
17172
|
+
/** Short fingerprint of the master key in use (`HMAC(KEK, label)`, 16 hex). */
|
|
17173
|
+
fingerprint: string().nullable(),
|
|
17174
|
+
activeKeyId: string().nullable(),
|
|
17175
|
+
/**
|
|
17176
|
+
* The keychain unlocked with a NON-primary source: the configured primary
|
|
17177
|
+
* key is not the one that wraps the data key yet. `rotateMasterKey` moves it.
|
|
17178
|
+
*/
|
|
17179
|
+
rotationPending: boolean(),
|
|
17180
|
+
/** Wrapped copies of the data key under a previous master key, kept until purged. */
|
|
17181
|
+
retiredWraps: number().int(),
|
|
17182
|
+
recoveryKeyDownloadedAt: number().nullable(),
|
|
17183
|
+
secretCount: number().int()
|
|
17184
|
+
});
|
|
17185
|
+
/**
|
|
17186
|
+
* Whether a stored value is still pointed at by its owner's settings.
|
|
17187
|
+
* `unknown` is a first-class answer: a scope whose blob could not be read is
|
|
17188
|
+
* never reported as an orphan (and never deleted as one).
|
|
17189
|
+
*/
|
|
17190
|
+
var KeychainSecretUsageSchema = _enum([
|
|
17191
|
+
"in-use",
|
|
17192
|
+
"orphan",
|
|
17193
|
+
"unknown"
|
|
17194
|
+
]);
|
|
17195
|
+
var KeychainAdminSecretSchema = KeychainSecretMetaSchema.extend({ usage: KeychainSecretUsageSchema });
|
|
17196
|
+
var KeychainAuditActionSchema = _enum([
|
|
17197
|
+
"put",
|
|
17198
|
+
"delete",
|
|
17199
|
+
"reveal",
|
|
17200
|
+
"rotate-master-key",
|
|
17201
|
+
"purge-retired-keys",
|
|
17202
|
+
"download-recovery-key",
|
|
17203
|
+
"delete-orphans",
|
|
17204
|
+
"reset",
|
|
17205
|
+
"initialize"
|
|
17206
|
+
]);
|
|
17207
|
+
var KeychainAuditEntrySchema = object({
|
|
17208
|
+
id: string(),
|
|
17209
|
+
at: number(),
|
|
17210
|
+
action: KeychainAuditActionSchema,
|
|
17211
|
+
/** `addon:<id>` | `user:<id>` | `system`. */
|
|
17212
|
+
actor: string(),
|
|
17213
|
+
ref: string().nullable(),
|
|
17214
|
+
detail: string().nullable()
|
|
17215
|
+
});
|
|
17216
|
+
var keychainAdminCapability = {
|
|
17217
|
+
name: "keychain-admin",
|
|
17218
|
+
scope: "system",
|
|
17219
|
+
mode: "singleton",
|
|
17220
|
+
methods: {
|
|
17221
|
+
status: method(object({}), KeychainStatusSchema, { auth: "admin" }),
|
|
17222
|
+
listSecrets: method(object({}), array(KeychainAdminSecretSchema).readonly(), { auth: "admin" }),
|
|
17223
|
+
listAudit: method(object({ limit: number().int().min(1).max(500).optional() }), array(KeychainAuditEntrySchema).readonly(), { auth: "admin" }),
|
|
17224
|
+
/**
|
|
17225
|
+
* Show one value to the operator. Audited. The UI hides it again after a
|
|
17226
|
+
* few seconds; nothing caches it.
|
|
17227
|
+
*/
|
|
17228
|
+
reveal: method(object({ ref: string().min(1) }), object({
|
|
17229
|
+
value: string(),
|
|
17230
|
+
version: number().int()
|
|
17231
|
+
}), {
|
|
17232
|
+
kind: "mutation",
|
|
17233
|
+
auth: "admin",
|
|
17234
|
+
caller: "required"
|
|
17235
|
+
}),
|
|
17236
|
+
/** Delete refs no owner points at any more. Re-checked here; `unknown` is kept. */
|
|
17237
|
+
deleteOrphans: method(object({ refs: array(string().min(1)).max(1e3) }), object({
|
|
17238
|
+
deleted: array(string()).readonly(),
|
|
17239
|
+
kept: array(object({
|
|
17240
|
+
ref: string(),
|
|
17241
|
+
usage: KeychainSecretUsageSchema
|
|
17242
|
+
})).readonly()
|
|
17243
|
+
}), {
|
|
17244
|
+
kind: "mutation",
|
|
17245
|
+
auth: "admin",
|
|
17246
|
+
caller: "required"
|
|
17247
|
+
}),
|
|
17248
|
+
/**
|
|
17249
|
+
* Wrap the data key under the configured primary master key.
|
|
17250
|
+
*
|
|
17251
|
+
* Pending rotation (the keychain unlocked with a previous source): re-wrap
|
|
17252
|
+
* under the primary. Otherwise, with the default file as primary: generate
|
|
17253
|
+
* a new master key, write it there, re-wrap. A file or OS-keychain primary
|
|
17254
|
+
* that is already in use cannot be replaced from here — put the new key at
|
|
17255
|
+
* the source, keep the old one as `keychain.previousKeyFile`, restart, and
|
|
17256
|
+
* rotate. No value is re-encrypted either way; the previous wrap is kept
|
|
17257
|
+
* (retired) until purged.
|
|
17258
|
+
*/
|
|
17259
|
+
rotateMasterKey: method(object({}), object({
|
|
17260
|
+
fingerprint: string(),
|
|
17261
|
+
keySource: KeychainKeySourceSchema
|
|
17262
|
+
}), {
|
|
17263
|
+
kind: "mutation",
|
|
17264
|
+
auth: "admin",
|
|
17265
|
+
caller: "required"
|
|
17266
|
+
}),
|
|
17267
|
+
purgeRetiredKeys: method(object({}), object({ purged: number().int() }), {
|
|
17268
|
+
kind: "mutation",
|
|
17269
|
+
auth: "admin",
|
|
17270
|
+
caller: "required"
|
|
17271
|
+
}),
|
|
17272
|
+
/** The master key, base64. Audited; marks the recovery copy as taken. */
|
|
17273
|
+
downloadRecoveryKey: method(object({}), object({
|
|
17274
|
+
key: string(),
|
|
17275
|
+
fingerprint: string(),
|
|
17276
|
+
keySource: KeychainKeySourceSchema
|
|
17277
|
+
}), {
|
|
17278
|
+
kind: "mutation",
|
|
17279
|
+
auth: "admin",
|
|
17280
|
+
caller: "required"
|
|
17281
|
+
}),
|
|
17282
|
+
/**
|
|
17283
|
+
* Lost-key recovery: archive every stored value into a
|
|
17284
|
+
* `keychain:secrets-orphaned-<ts>` table and start over with a new data
|
|
17285
|
+
* key. Every secret field then reads "not set". Requires the typed
|
|
17286
|
+
* confirmation {@link KEYCHAIN_RESET_CONFIRMATION}.
|
|
17287
|
+
*/
|
|
17288
|
+
resetKeychain: method(object({ confirm: literal("RESET KEYCHAIN") }), object({
|
|
17289
|
+
archivedCollection: string().nullable(),
|
|
17290
|
+
archived: number().int()
|
|
17291
|
+
}), {
|
|
17292
|
+
kind: "mutation",
|
|
17293
|
+
auth: "admin",
|
|
17294
|
+
caller: "required"
|
|
17295
|
+
})
|
|
17296
|
+
}
|
|
17297
|
+
};
|
|
16320
17298
|
var decoderCapability = {
|
|
16321
17299
|
name: "decoder",
|
|
16322
17300
|
scope: "system",
|
|
@@ -17672,7 +18650,11 @@ var DeviceRegisterPayloadSchema = object({
|
|
|
17672
18650
|
var DeviceRemovePayloadSchema = object({ deviceId: number() });
|
|
17673
18651
|
var DevicePersistConfigPayloadSchema = object({
|
|
17674
18652
|
deviceId: number(),
|
|
17675
|
-
data: record(string(), unknown())
|
|
18653
|
+
data: record(string(), unknown()),
|
|
18654
|
+
/** The paths the device's schema declares secret (D783), when the caller
|
|
18655
|
+
* knows them — those values are kept in the keychain, not the blob (D787).
|
|
18656
|
+
* Absent: the paths the device last reported at `registerDevice` apply. */
|
|
18657
|
+
secretConfigPaths: array(string()).optional()
|
|
17676
18658
|
});
|
|
17677
18659
|
/** What a migration actually did, per switch. `unreachable` is a first-class
|
|
17678
18660
|
* answer: a camera that could not be asked is not a camera that was silenced. */
|
|
@@ -26924,8 +27906,23 @@ var RetrainMacroClassSchema = _enum([
|
|
|
26924
27906
|
]);
|
|
26925
27907
|
/** A subject to learn, or a phantom to unlearn (taught by OMISSION). */
|
|
26926
27908
|
var RetrainAnnotationKindSchema = _enum(["subject", "model_error"]);
|
|
26927
|
-
/**
|
|
26928
|
-
|
|
27909
|
+
/**
|
|
27910
|
+
* Where a box came from. A machine-sourced box is a DRAFT on the page until
|
|
27911
|
+
* the operator confirms it; once saved it keeps its source as provenance.
|
|
27912
|
+
*
|
|
27913
|
+
* - `operator` — drawn by hand.
|
|
27914
|
+
* - `assist` — proposed by a detector run on the copy (the camera's own
|
|
27915
|
+
* model, or a larger teacher model).
|
|
27916
|
+
* - `pipeline` — the box the live pipeline actually drew on that frame, read
|
|
27917
|
+
* back from the track store (never a re-run).
|
|
27918
|
+
* - `llm` — proposed by a vision-capable LLM profile.
|
|
27919
|
+
*/
|
|
27920
|
+
var RetrainAnnotationSourceSchema = _enum([
|
|
27921
|
+
"operator",
|
|
27922
|
+
"assist",
|
|
27923
|
+
"pipeline",
|
|
27924
|
+
"llm"
|
|
27925
|
+
]);
|
|
26929
27926
|
/** Normalised `[0,1]` rectangle against the FULL frame — the canonical form. */
|
|
26930
27927
|
var RetrainBboxSchema = object({
|
|
26931
27928
|
x: number(),
|
|
@@ -26943,7 +27940,8 @@ var RetrainBboxSchema = object({
|
|
|
26943
27940
|
*/
|
|
26944
27941
|
var RetrainAnnotationSchema = object({
|
|
26945
27942
|
id: string(),
|
|
26946
|
-
|
|
27943
|
+
/** The frame's track. Absent on a recording still, which has none. */
|
|
27944
|
+
trackId: string().optional(),
|
|
26947
27945
|
deviceId: number(),
|
|
26948
27946
|
/** The COPY in retrain storage — never the source track's media key. */
|
|
26949
27947
|
mediaKey: string(),
|
|
@@ -26992,13 +27990,47 @@ var RetrainFrameCandidateSchema = object({
|
|
|
26992
27990
|
* fail, whatever became of the original. */
|
|
26993
27991
|
copied: boolean()
|
|
26994
27992
|
});
|
|
27993
|
+
/**
|
|
27994
|
+
* One box the live pipeline drew on a copied frame — what a correction starts
|
|
27995
|
+
* from. Derived when the frame is listed, from the track store: the subject
|
|
27996
|
+
* box recorded on the source media row when there is one, else the track
|
|
27997
|
+
* position nearest the frame's capture time. Never stored as an annotation
|
|
27998
|
+
* until the operator confirms it.
|
|
27999
|
+
*/
|
|
28000
|
+
var RetrainPipelineBoxSchema = object({
|
|
28001
|
+
/** Normalised `[0,1]` against the full frame. */
|
|
28002
|
+
bbox: RetrainBboxSchema,
|
|
28003
|
+
macroClass: RetrainMacroClassSchema,
|
|
28004
|
+
label: string().optional(),
|
|
28005
|
+
subLabel: string().optional(),
|
|
28006
|
+
/** The detection score of the position used, when it was recorded. */
|
|
28007
|
+
score: number().optional(),
|
|
28008
|
+
/** The root model that produced the track, when it was recorded. */
|
|
28009
|
+
modelId: string().optional(),
|
|
28010
|
+
trackId: string(),
|
|
28011
|
+
/** `subject-box`: recorded on this very frame. `position`: the track's
|
|
28012
|
+
* position nearest the capture time, `deltaMs` away. */
|
|
28013
|
+
basis: _enum(["subject-box", "position"]),
|
|
28014
|
+
deltaMs: number()
|
|
28015
|
+
});
|
|
28016
|
+
/**
|
|
28017
|
+
* Where a retrain frame came from: a TRACK's stored media (copy-on-select),
|
|
28018
|
+
* or the RECORDING at an instant — the frame a model saw nothing in has no
|
|
28019
|
+
* track at all.
|
|
28020
|
+
*/
|
|
28021
|
+
var RetrainFrameOriginSchema = _enum(["track", "recording"]);
|
|
26995
28022
|
/** A frame the dataset OWNS: bytes copied at selection time. */
|
|
26996
28023
|
var RetrainFrameSchema = object({
|
|
26997
28024
|
frameId: string(),
|
|
26998
28025
|
deviceId: number(),
|
|
26999
|
-
|
|
27000
|
-
/**
|
|
27001
|
-
|
|
28026
|
+
origin: RetrainFrameOriginSchema,
|
|
28027
|
+
/** The track it was copied from. Absent on a recording still. */
|
|
28028
|
+
trackId: string().optional(),
|
|
28029
|
+
/** Provenance only. It may already point at nothing — that is expected.
|
|
28030
|
+
* Absent on a recording still. */
|
|
28031
|
+
sourceMediaId: number().int().optional(),
|
|
28032
|
+
/** A recording still: the playhead instant it was taken at. */
|
|
28033
|
+
epochMs: number().optional(),
|
|
27002
28034
|
sourceKind: MediaFileKindEnum,
|
|
27003
28035
|
sizeBytes: number().int(),
|
|
27004
28036
|
width: number().int(),
|
|
@@ -27009,7 +28041,12 @@ var RetrainFrameSchema = object({
|
|
|
27009
28041
|
/** The operator's "every subject in this frame is boxed". Detector
|
|
27010
28042
|
* evaluation keeps only complete frames: an unboxed subject would count as
|
|
27011
28043
|
* a false positive. */
|
|
27012
|
-
complete: boolean()
|
|
28044
|
+
complete: boolean(),
|
|
28045
|
+
/** The boxes the pipeline drew on this frame. Present on list answers;
|
|
28046
|
+
* empty when nothing the track store holds can be placed on it. */
|
|
28047
|
+
pipelineBoxes: array(RetrainPipelineBoxSchema).readonly().optional(),
|
|
28048
|
+
/** The named collections this frame belongs to. Present on list answers. */
|
|
28049
|
+
collectionIds: array(string()).readonly().optional()
|
|
27013
28050
|
});
|
|
27014
28051
|
/** Why a copy-on-select could not be honoured — named, never a silent skip. */
|
|
27015
28052
|
var RetrainCopyRefusalSchema = _enum([
|
|
@@ -27040,6 +28077,8 @@ var RetrainFrameListSchema = object({
|
|
|
27040
28077
|
var RetrainExportFilterSchema = object({
|
|
27041
28078
|
deviceIds: array(number()).optional(),
|
|
27042
28079
|
frameIds: array(string()).max(2e4).optional(),
|
|
28080
|
+
/** Only frames in at least one of these named collections. */
|
|
28081
|
+
collectionIds: array(string()).max(200).optional(),
|
|
27043
28082
|
batchId: string().optional(),
|
|
27044
28083
|
/** Only frames the operator marked complete (all subjects boxed). */
|
|
27045
28084
|
completeOnly: boolean().optional()
|
|
@@ -27104,6 +28143,109 @@ var RetrainAssistResultSchema = discriminatedUnion("kind", [object({
|
|
|
27104
28143
|
reason: string(),
|
|
27105
28144
|
detail: string().optional()
|
|
27106
28145
|
})]);
|
|
28146
|
+
/** A named set over the retrain corpus — membership only, it owns no pixels. */
|
|
28147
|
+
var RetrainCollectionSchema = object({
|
|
28148
|
+
id: string(),
|
|
28149
|
+
name: string(),
|
|
28150
|
+
createdAt: number(),
|
|
28151
|
+
frameCount: number().int()
|
|
28152
|
+
});
|
|
28153
|
+
var RetrainCollectionCreateResultSchema = discriminatedUnion("kind", [object({
|
|
28154
|
+
kind: literal("created"),
|
|
28155
|
+
collection: RetrainCollectionSchema
|
|
28156
|
+
}), object({
|
|
28157
|
+
kind: literal("refused"),
|
|
28158
|
+
reason: _enum(["empty-name", "duplicate-name"])
|
|
28159
|
+
})]);
|
|
28160
|
+
var RetrainCollectionRenameResultSchema = discriminatedUnion("kind", [object({
|
|
28161
|
+
kind: literal("renamed"),
|
|
28162
|
+
collection: RetrainCollectionSchema
|
|
28163
|
+
}), object({
|
|
28164
|
+
kind: literal("refused"),
|
|
28165
|
+
reason: _enum([
|
|
28166
|
+
"empty-name",
|
|
28167
|
+
"duplicate-name",
|
|
28168
|
+
"unknown-collection"
|
|
28169
|
+
])
|
|
28170
|
+
})]);
|
|
28171
|
+
/**
|
|
28172
|
+
* The outcome of adding the frame at a recording instant. Every refusal is
|
|
28173
|
+
* named: `still-unavailable` (not recording, a gap, or an undecodable frame —
|
|
28174
|
+
* `detail` says which), `still-busy` (the recorder is at its decode bound; try
|
|
28175
|
+
* again), `unreadable-image`, `write-failed`, `unknown-collection`.
|
|
28176
|
+
*/
|
|
28177
|
+
var AddRetrainFrameFromRecordingResultSchema = discriminatedUnion("kind", [object({
|
|
28178
|
+
kind: literal("added"),
|
|
28179
|
+
collectionId: string(),
|
|
28180
|
+
frame: RetrainFrameSchema,
|
|
28181
|
+
/** The moment was already in the dataset; nothing was decoded. */
|
|
28182
|
+
reused: boolean()
|
|
28183
|
+
}), object({
|
|
28184
|
+
kind: literal("refused"),
|
|
28185
|
+
reason: _enum([
|
|
28186
|
+
"unknown-collection",
|
|
28187
|
+
"still-unavailable",
|
|
28188
|
+
"still-busy",
|
|
28189
|
+
"unreadable-image",
|
|
28190
|
+
"write-failed"
|
|
28191
|
+
]),
|
|
28192
|
+
detail: string().optional()
|
|
28193
|
+
})]);
|
|
28194
|
+
/** A vision LLM profile the AI assist may use, and where it sends the frame. */
|
|
28195
|
+
var RetrainAssistProfileSchema = object({
|
|
28196
|
+
id: string(),
|
|
28197
|
+
name: string(),
|
|
28198
|
+
model: string(),
|
|
28199
|
+
kind: string(),
|
|
28200
|
+
/** `true` when the frame would leave the house (a cloud vendor, or an
|
|
28201
|
+
* endpoint that is not on the local network). The page confirms each such
|
|
28202
|
+
* run, and the provider refuses one without `allowCloud`. */
|
|
28203
|
+
leavesHouse: boolean()
|
|
28204
|
+
});
|
|
28205
|
+
/** A box the AI assist proposed: a draft, plus the model's own reason. */
|
|
28206
|
+
var RetrainLlmProposalSchema = RetrainAnnotationDraftSchema.extend({ reason: string() });
|
|
28207
|
+
/** What the AI assist said about a box that was already on the canvas. */
|
|
28208
|
+
var RetrainLlmReviewSchema = object({
|
|
28209
|
+
/** The `ref` the page sent the box under. */
|
|
28210
|
+
ref: string(),
|
|
28211
|
+
verdict: _enum([
|
|
28212
|
+
"confirmed",
|
|
28213
|
+
"wrong-class",
|
|
28214
|
+
"not-an-object",
|
|
28215
|
+
"uncertain"
|
|
28216
|
+
]),
|
|
28217
|
+
suggestedClass: RetrainMacroClassSchema.optional(),
|
|
28218
|
+
reason: string()
|
|
28219
|
+
});
|
|
28220
|
+
/**
|
|
28221
|
+
* The AI assist's answer. `proposed` carries drafts (`source: 'llm'`, the
|
|
28222
|
+
* model and its confidence) and reviews; items the model got wrong (a box off
|
|
28223
|
+
* the frame, an unasked class, an unknown ref) are dropped and counted in
|
|
28224
|
+
* `rejected`. A whole answer that is not the schema is `malformed-answer`.
|
|
28225
|
+
*/
|
|
28226
|
+
var RetrainLlmAssistResultSchema = discriminatedUnion("kind", [object({
|
|
28227
|
+
kind: literal("proposed"),
|
|
28228
|
+
profileId: string(),
|
|
28229
|
+
model: string(),
|
|
28230
|
+
/** The frame was sent outside the house for this answer. */
|
|
28231
|
+
leftHouse: boolean(),
|
|
28232
|
+
proposals: array(RetrainLlmProposalSchema).readonly(),
|
|
28233
|
+
reviews: array(RetrainLlmReviewSchema).readonly(),
|
|
28234
|
+
rejected: number().int()
|
|
28235
|
+
}), object({
|
|
28236
|
+
kind: literal("refused"),
|
|
28237
|
+
reason: _enum([
|
|
28238
|
+
"unknown-frame",
|
|
28239
|
+
"unreadable-frame",
|
|
28240
|
+
"unknown-profile",
|
|
28241
|
+
"profile-disabled",
|
|
28242
|
+
"no-vision",
|
|
28243
|
+
"cloud-not-confirmed",
|
|
28244
|
+
"llm-error",
|
|
28245
|
+
"malformed-answer"
|
|
28246
|
+
]),
|
|
28247
|
+
detail: string().optional()
|
|
28248
|
+
})]);
|
|
27107
28249
|
/** The outcome of a lifecycle move owned by the retrain page. */
|
|
27108
28250
|
var RetrainTransitionResultSchema = object({
|
|
27109
28251
|
trackId: string(),
|
|
@@ -28320,7 +29462,7 @@ var pipelineAnalyticsCapability = {
|
|
|
28320
29462
|
* a frame leaves the dataset before export. */
|
|
28321
29463
|
deselectRetrainFrame: method(object({
|
|
28322
29464
|
deviceId: number(),
|
|
28323
|
-
trackId: string(),
|
|
29465
|
+
trackId: string().optional(),
|
|
28324
29466
|
frameId: string()
|
|
28325
29467
|
}), object({
|
|
28326
29468
|
removed: boolean(),
|
|
@@ -28363,7 +29505,8 @@ var pipelineAnalyticsCapability = {
|
|
|
28363
29505
|
*/
|
|
28364
29506
|
proposeRetrainAnnotations: method(object({
|
|
28365
29507
|
deviceId: number(),
|
|
28366
|
-
|
|
29508
|
+
/** The frame's track, when it has one — checked against the frame. */
|
|
29509
|
+
trackId: string().optional(),
|
|
28367
29510
|
frameId: string(),
|
|
28368
29511
|
subject: RetrainAssistSubjectSchema,
|
|
28369
29512
|
/** Which node runs it. Absent ⇒ wherever an unowned call lands. */
|
|
@@ -28372,8 +29515,12 @@ var pipelineAnalyticsCapability = {
|
|
|
28372
29515
|
kind: "mutation",
|
|
28373
29516
|
auth: "admin"
|
|
28374
29517
|
}),
|
|
28375
|
-
/** Every annotation on a track,
|
|
28376
|
-
|
|
29518
|
+
/** Every annotation on a track, or on named frames (a recording still has
|
|
29519
|
+
* no track), oldest first. One of the two is required. */
|
|
29520
|
+
listRetrainAnnotations: method(object({
|
|
29521
|
+
trackId: string().optional(),
|
|
29522
|
+
frameIds: array(string()).max(2e3).optional()
|
|
29523
|
+
}), array(RetrainAnnotationSchema).readonly(), {
|
|
28377
29524
|
kind: "query",
|
|
28378
29525
|
auth: "admin"
|
|
28379
29526
|
}),
|
|
@@ -28392,7 +29539,8 @@ var pipelineAnalyticsCapability = {
|
|
|
28392
29539
|
*/
|
|
28393
29540
|
saveRetrainAnnotations: method(object({
|
|
28394
29541
|
deviceId: number(),
|
|
28395
|
-
|
|
29542
|
+
/** The frame's track, when it has one — checked against the frame. */
|
|
29543
|
+
trackId: string().optional(),
|
|
28396
29544
|
frameId: string(),
|
|
28397
29545
|
annotations: array(RetrainAnnotationDraftSchema)
|
|
28398
29546
|
}), array(RetrainAnnotationSchema).readonly(), {
|
|
@@ -28455,7 +29603,7 @@ var pipelineAnalyticsCapability = {
|
|
|
28455
29603
|
*/
|
|
28456
29604
|
setRetrainFrameComplete: method(object({
|
|
28457
29605
|
deviceId: number(),
|
|
28458
|
-
trackId: string(),
|
|
29606
|
+
trackId: string().optional(),
|
|
28459
29607
|
frameId: string(),
|
|
28460
29608
|
complete: boolean()
|
|
28461
29609
|
}), RetrainFrameSchema, {
|
|
@@ -28478,6 +29626,115 @@ var pipelineAnalyticsCapability = {
|
|
|
28478
29626
|
auth: "admin",
|
|
28479
29627
|
timeoutMs: 60 * 6e4
|
|
28480
29628
|
}),
|
|
29629
|
+
/** The enabled, vision-capable LLM profiles, each saying whether a frame
|
|
29630
|
+
* sent to it leaves the house. */
|
|
29631
|
+
listRetrainAssistProfiles: method(object({}), array(RetrainAssistProfileSchema).readonly(), {
|
|
29632
|
+
kind: "query",
|
|
29633
|
+
auth: "admin"
|
|
29634
|
+
}),
|
|
29635
|
+
/**
|
|
29636
|
+
* Ask a vision LLM (the `llm` capability) about ONE copied frame: list the
|
|
29637
|
+
* objects of `classes` with boxes, and review the boxes already on the
|
|
29638
|
+
* canvas (sent by `ref`). Answers drafts (`source: 'llm'`) and reviews —
|
|
29639
|
+
* nothing is stored, nothing is accepted. A profile that sends the frame
|
|
29640
|
+
* outside the house is refused unless `allowCloud` says the operator
|
|
29641
|
+
* confirmed this run.
|
|
29642
|
+
*/
|
|
29643
|
+
proposeRetrainAnnotationsWithLlm: method(object({
|
|
29644
|
+
deviceId: number(),
|
|
29645
|
+
trackId: string().optional(),
|
|
29646
|
+
frameId: string(),
|
|
29647
|
+
profileId: string(),
|
|
29648
|
+
classes: array(RetrainMacroClassSchema).min(1),
|
|
29649
|
+
boxes: array(object({
|
|
29650
|
+
ref: string(),
|
|
29651
|
+
bbox: RetrainBboxSchema,
|
|
29652
|
+
macroClass: RetrainMacroClassSchema,
|
|
29653
|
+
label: string().optional()
|
|
29654
|
+
})).max(50),
|
|
29655
|
+
allowCloud: boolean()
|
|
29656
|
+
}), RetrainLlmAssistResultSchema, {
|
|
29657
|
+
kind: "mutation",
|
|
29658
|
+
auth: "admin",
|
|
29659
|
+
timeoutMs: 18e4
|
|
29660
|
+
}),
|
|
29661
|
+
/**
|
|
29662
|
+
* Create a named collection — a set over the retrain corpus ("packages
|
|
29663
|
+
* porch night"). Names are unique case-insensitively and never empty;
|
|
29664
|
+
* both refusals are named.
|
|
29665
|
+
*/
|
|
29666
|
+
createRetrainCollection: method(object({ name: string().max(120) }), RetrainCollectionCreateResultSchema, {
|
|
29667
|
+
kind: "mutation",
|
|
29668
|
+
auth: "admin"
|
|
29669
|
+
}),
|
|
29670
|
+
/** Every collection, newest first, with its frame count. */
|
|
29671
|
+
listRetrainCollections: method(object({}), array(RetrainCollectionSchema).readonly(), {
|
|
29672
|
+
kind: "query",
|
|
29673
|
+
auth: "admin"
|
|
29674
|
+
}),
|
|
29675
|
+
renameRetrainCollection: method(object({
|
|
29676
|
+
id: string(),
|
|
29677
|
+
name: string().max(120)
|
|
29678
|
+
}), RetrainCollectionRenameResultSchema, {
|
|
29679
|
+
kind: "mutation",
|
|
29680
|
+
auth: "admin"
|
|
29681
|
+
}),
|
|
29682
|
+
/**
|
|
29683
|
+
* Delete a collection. Its recording stills that no other collection
|
|
29684
|
+
* holds are deleted with their annotations (nothing else reaches them);
|
|
29685
|
+
* frames copied from tracks always stay in the dataset.
|
|
29686
|
+
*/
|
|
29687
|
+
deleteRetrainCollection: method(object({ id: string() }), object({
|
|
29688
|
+
deleted: boolean(),
|
|
29689
|
+
removedFrames: number().int()
|
|
29690
|
+
}), {
|
|
29691
|
+
kind: "mutation",
|
|
29692
|
+
auth: "admin"
|
|
29693
|
+
}),
|
|
29694
|
+
/**
|
|
29695
|
+
* Add the frame at a recording instant to a collection — the frame the
|
|
29696
|
+
* model may have seen NOTHING in. The recorder re-decodes the native
|
|
29697
|
+
* frame at `epochMs`; the dataset copies it (trackless, durable). The same
|
|
29698
|
+
* moment twice is one copy. Every refusal is named.
|
|
29699
|
+
*/
|
|
29700
|
+
addRetrainFrameFromRecording: method(object({
|
|
29701
|
+
collectionId: string(),
|
|
29702
|
+
deviceId: number(),
|
|
29703
|
+
epochMs: number()
|
|
29704
|
+
}), AddRetrainFrameFromRecordingResultSchema, {
|
|
29705
|
+
kind: "mutation",
|
|
29706
|
+
auth: "admin",
|
|
29707
|
+
timeoutMs: 6e4
|
|
29708
|
+
}),
|
|
29709
|
+
/** Add frames already in the dataset to a collection. */
|
|
29710
|
+
addRetrainFramesToCollection: method(object({
|
|
29711
|
+
collectionId: string(),
|
|
29712
|
+
frameIds: array(string()).min(1).max(500)
|
|
29713
|
+
}), object({
|
|
29714
|
+
added: number().int(),
|
|
29715
|
+
alreadyMember: number().int(),
|
|
29716
|
+
unknownFrameIds: array(string()).readonly()
|
|
29717
|
+
}), {
|
|
29718
|
+
kind: "mutation",
|
|
29719
|
+
auth: "admin"
|
|
29720
|
+
}),
|
|
29721
|
+
/** Remove a frame from a collection. A recording still left in no
|
|
29722
|
+
* collection is deleted with its annotations (`deletedFrame`). */
|
|
29723
|
+
removeRetrainFrameFromCollection: method(object({
|
|
29724
|
+
collectionId: string(),
|
|
29725
|
+
frameId: string()
|
|
29726
|
+
}), object({
|
|
29727
|
+
removed: boolean(),
|
|
29728
|
+
deletedFrame: boolean()
|
|
29729
|
+
}), {
|
|
29730
|
+
kind: "mutation",
|
|
29731
|
+
auth: "admin"
|
|
29732
|
+
}),
|
|
29733
|
+
/** The frames of a collection, with their pipeline boxes. */
|
|
29734
|
+
listRetrainCollectionFrames: method(object({ collectionId: string() }), array(RetrainFrameSchema).readonly(), {
|
|
29735
|
+
kind: "query",
|
|
29736
|
+
auth: "admin"
|
|
29737
|
+
}),
|
|
28481
29738
|
/**
|
|
28482
29739
|
* The media an EVENT owns.
|
|
28483
29740
|
*
|
|
@@ -29417,13 +30674,31 @@ var RecommendationReasonSchema = discriminatedUnion("kind", [
|
|
|
29417
30674
|
object({
|
|
29418
30675
|
kind: literal("no-family-build"),
|
|
29419
30676
|
format: ModelFormatSchema$1
|
|
30677
|
+
}),
|
|
30678
|
+
object({
|
|
30679
|
+
kind: literal("kept-custom-pin"),
|
|
30680
|
+
modelId: string(),
|
|
30681
|
+
deviceKey: string()
|
|
29420
30682
|
})
|
|
29421
30683
|
]);
|
|
30684
|
+
/** Why a device is left exactly as it is, whatever the plan would pick (D786). */
|
|
30685
|
+
var KeptReasonSchema = _enum(["custom-pin"]);
|
|
30686
|
+
/**
|
|
30687
|
+
* Where a choice's latency came from (D791): this node's own benchmark
|
|
30688
|
+
* result, or the hardware-class table. Measured on the node beats the table.
|
|
30689
|
+
*/
|
|
30690
|
+
var LatencySourceSchema = discriminatedUnion("kind", [object({ kind: literal("table") }), object({
|
|
30691
|
+
kind: literal("node-benchmark"),
|
|
30692
|
+
resultId: string(),
|
|
30693
|
+
measuredAtMs: number()
|
|
30694
|
+
})]);
|
|
29422
30695
|
var DeviceModelChoiceSchema = object({
|
|
29423
30696
|
modelId: string(),
|
|
29424
30697
|
p50Ms: number(),
|
|
29425
30698
|
fps: number(),
|
|
29426
30699
|
measured: boolean(),
|
|
30700
|
+
/** Absent on a plan from before D791 — read as the table. */
|
|
30701
|
+
source: LatencySourceSchema.optional(),
|
|
29427
30702
|
/** Parallel sessions at the camera rate with the headroom kept free: ⌊fps × (1 − headroom) / camera fps⌋. */
|
|
29428
30703
|
capacitySessions: number(),
|
|
29429
30704
|
personRecall: number()
|
|
@@ -29434,6 +30709,8 @@ var DeviceRecommendationSchema = object({
|
|
|
29434
30709
|
enabled: boolean(),
|
|
29435
30710
|
available: boolean(),
|
|
29436
30711
|
chosen: DeviceModelChoiceSchema.nullable(),
|
|
30712
|
+
/** Present when the device is kept as is: Apply writes nothing on it. */
|
|
30713
|
+
kept: KeptReasonSchema.optional(),
|
|
29437
30714
|
reasons: array(RecommendationReasonSchema).readonly()
|
|
29438
30715
|
});
|
|
29439
30716
|
var NodeRecommendationSchema = object({
|
|
@@ -29487,6 +30764,17 @@ var AutoTuneWarningSchema = discriminatedUnion("kind", [
|
|
|
29487
30764
|
kind: literal("coral-enabled"),
|
|
29488
30765
|
nodeId: string(),
|
|
29489
30766
|
deviceKey: string()
|
|
30767
|
+
}),
|
|
30768
|
+
object({
|
|
30769
|
+
kind: literal("custom-pin-kept"),
|
|
30770
|
+
nodeId: string(),
|
|
30771
|
+
deviceKey: string().nullable(),
|
|
30772
|
+
deviceId: number().nullable(),
|
|
30773
|
+
modelId: string()
|
|
30774
|
+
}),
|
|
30775
|
+
object({
|
|
30776
|
+
kind: literal("custom-registry-unreadable"),
|
|
30777
|
+
error: string()
|
|
29490
30778
|
})
|
|
29491
30779
|
]);
|
|
29492
30780
|
var AutoTuneOptionsSchema = object({
|
|
@@ -29665,13 +30953,14 @@ var SuggestSharesResultSchema = object({
|
|
|
29665
30953
|
nodes: array(SuggestedNodeShareSchema).readonly()
|
|
29666
30954
|
});
|
|
29667
30955
|
/**
|
|
29668
|
-
* Where the node and device shares come from (D750, D755).
|
|
29669
|
-
* - `
|
|
29670
|
-
*
|
|
29671
|
-
*
|
|
29672
|
-
*
|
|
29673
|
-
*
|
|
29674
|
-
*
|
|
30956
|
+
* Where the node and device shares come from (D750, D755, D791).
|
|
30957
|
+
* - `benchmark` (default since D791) — each node's capacity as its own node
|
|
30958
|
+
* benchmark measured it; a node without fresh results is sized from
|
|
30959
|
+
* `hardware` and says so. Measured on the node beats the table.
|
|
30960
|
+
* - `hardware` — computed from each node's static capacity only (its
|
|
30961
|
+
* accelerators at their Auto tune models, from the latency table).
|
|
30962
|
+
* Both are recomputed whenever a node or device joins, leaves, is switched
|
|
30963
|
+
* on or off, changes model, or a benchmark result is written. No load input.
|
|
29675
30964
|
* - `manual` — the operator's stored sliders.
|
|
29676
30965
|
* Either way a node or device that cannot take sessions gives its share to
|
|
29677
30966
|
* the others in proportion; the stored values are never rewritten for that.
|
|
@@ -29720,6 +31009,362 @@ var EffectiveSharesSchema = object({
|
|
|
29720
31009
|
nodeWeights: record(string(), number()),
|
|
29721
31010
|
deviceWeights: record(string(), record(string(), number()))
|
|
29722
31011
|
});
|
|
31012
|
+
/**
|
|
31013
|
+
* Wire shapes of the node benchmark (D791): the operator's plan, the
|
|
31014
|
+
* preflight the confirmation shows, the run the orchestrator owns, what the
|
|
31015
|
+
* measuring runner reports, and the result rows Auto tune and the automatic
|
|
31016
|
+
* shares read.
|
|
31017
|
+
*
|
|
31018
|
+
* ONE node at a time, owned by the pipeline orchestrator. While a run is
|
|
31019
|
+
* active the cluster is in BENCHMARK MODE for that node: it is not a
|
|
31020
|
+
* detection candidate, camera pins naming it are ignored so its sessions move
|
|
31021
|
+
* elsewhere, and both come back when the mode ends — after a crash or a hub
|
|
31022
|
+
* restart too (a persisted manifest, reconciled against the registry).
|
|
31023
|
+
*
|
|
31024
|
+
* Two measurements, both on the node, driven by its own runner (frames never
|
|
31025
|
+
* cross a process at frame rate, D9):
|
|
31026
|
+
* - `device` — one accelerator × one candidate detector, root only, open
|
|
31027
|
+
* loop: how many streams at the camera rate it carries inside the frame
|
|
31028
|
+
* interval;
|
|
31029
|
+
* - `pipeline` — the chosen detector plus the operator's detail steps
|
|
31030
|
+
* (faces, plates, classifiers, CLIP…), on varied frames from the bench
|
|
31031
|
+
* clip: how many parallel sessions the node carries before latency, drops,
|
|
31032
|
+
* CPU, RAM or the event loop give out.
|
|
31033
|
+
*/
|
|
31034
|
+
/** Defaults and bounds, one place. */
|
|
31035
|
+
var NODE_BENCHMARK_DEFAULTS = {
|
|
31036
|
+
fpsPerStream: 10,
|
|
31037
|
+
budgetMinutes: 45,
|
|
31038
|
+
minBudgetMinutes: 10,
|
|
31039
|
+
maxBudgetMinutes: 120,
|
|
31040
|
+
/** A result older than this no longer beats the table. */
|
|
31041
|
+
staleAfterDays: 30,
|
|
31042
|
+
/** Warm-in per ramp step (not accounted). */
|
|
31043
|
+
settleSec: 5,
|
|
31044
|
+
/** Accounted window per ramp step. */
|
|
31045
|
+
measureSec: 20,
|
|
31046
|
+
/** Longest the drain may take before the run is refused. */
|
|
31047
|
+
drainTimeoutSec: 120,
|
|
31048
|
+
/** Candidate models per device in one run. */
|
|
31049
|
+
maxModelsPerDevice: 6
|
|
31050
|
+
};
|
|
31051
|
+
/** The two measurements a run can make. */
|
|
31052
|
+
var NodeBenchmarkPhaseSchema = _enum(["device", "pipeline"]);
|
|
31053
|
+
var NodeBenchmarkDevicePlanSchema = object({
|
|
31054
|
+
/** `<backend>:<device>` — `openvino:npu`, `coreml:all`, `cpu`. */
|
|
31055
|
+
deviceKey: string().min(1),
|
|
31056
|
+
/**
|
|
31057
|
+
* Root detector candidates for the `device` measurement, in the order
|
|
31058
|
+
* measured. The FIRST is the one the `pipeline` measurement runs.
|
|
31059
|
+
*/
|
|
31060
|
+
modelIds: array(string().min(1)).min(1).max(NODE_BENCHMARK_DEFAULTS.maxModelsPerDevice)
|
|
31061
|
+
});
|
|
31062
|
+
/** What the operator confirmed. */
|
|
31063
|
+
var NodeBenchmarkPlanSchema = object({
|
|
31064
|
+
nodeId: string().min(1),
|
|
31065
|
+
devices: array(NodeBenchmarkDevicePlanSchema).min(1),
|
|
31066
|
+
/** Which measurements run. At least one. */
|
|
31067
|
+
phases: array(NodeBenchmarkPhaseSchema).min(1).default(["device", "pipeline"]),
|
|
31068
|
+
/**
|
|
31069
|
+
* Detail steps (catalog step ids under the root: faces, plates,
|
|
31070
|
+
* classifiers, CLIP…) the `pipeline` measurement enables. The root
|
|
31071
|
+
* detector always runs.
|
|
31072
|
+
*/
|
|
31073
|
+
steps: array(string().min(1)).default([]),
|
|
31074
|
+
/** Offered rate of one stream / session. */
|
|
31075
|
+
fpsPerStream: number().int().min(1).max(30).default(NODE_BENCHMARK_DEFAULTS.fpsPerStream),
|
|
31076
|
+
/** Hard deadline: the mode ends and the cluster is restored when it passes. */
|
|
31077
|
+
budgetMinutes: number().int().min(NODE_BENCHMARK_DEFAULTS.minBudgetMinutes).max(NODE_BENCHMARK_DEFAULTS.maxBudgetMinutes).default(NODE_BENCHMARK_DEFAULTS.budgetMinutes),
|
|
31078
|
+
/** Keep the models the run downloaded (default: delete what was not installed before). */
|
|
31079
|
+
keepDownloadedModels: boolean().default(false),
|
|
31080
|
+
/** Start although the other nodes' capacity does not cover the sessions running now. */
|
|
31081
|
+
acceptInsufficientHeadroom: boolean().default(false)
|
|
31082
|
+
});
|
|
31083
|
+
var NodeBenchmarkRefusalSchema = object({
|
|
31084
|
+
kind: _enum([
|
|
31085
|
+
"benchmark-active",
|
|
31086
|
+
"node-offline",
|
|
31087
|
+
"unknown-device",
|
|
31088
|
+
"no-phase",
|
|
31089
|
+
"insufficient-headroom"
|
|
31090
|
+
]),
|
|
31091
|
+
detail: string(),
|
|
31092
|
+
overridable: boolean()
|
|
31093
|
+
});
|
|
31094
|
+
/** A camera whose detection leaves the node for the run. */
|
|
31095
|
+
var NodeBenchmarkMovingCameraSchema = object({
|
|
31096
|
+
deviceId: number(),
|
|
31097
|
+
/** Placed on the node now (a standing attach or a running session). */
|
|
31098
|
+
placedOnNode: boolean(),
|
|
31099
|
+
/** A node pin naming this node, ignored for the run. */
|
|
31100
|
+
pinnedToNode: boolean()
|
|
31101
|
+
});
|
|
31102
|
+
/** A camera that cannot leave: no other node can obtain its frames. */
|
|
31103
|
+
var NodeBenchmarkStayingCameraSchema = object({
|
|
31104
|
+
deviceId: number(),
|
|
31105
|
+
reason: literal("only-frame-source")
|
|
31106
|
+
});
|
|
31107
|
+
var NodeBenchmarkPreflightSchema = object({
|
|
31108
|
+
nodeId: string(),
|
|
31109
|
+
online: boolean(),
|
|
31110
|
+
moving: array(NodeBenchmarkMovingCameraSchema).readonly(),
|
|
31111
|
+
/** Keep running on the node during the run; the result is flagged contaminated. */
|
|
31112
|
+
staying: array(NodeBenchmarkStayingCameraSchema).readonly(),
|
|
31113
|
+
estimatedDurationMs: number(),
|
|
31114
|
+
/** The run ends and the cluster is restored at the latest after this long. */
|
|
31115
|
+
budgetMs: number(),
|
|
31116
|
+
phases: array(NodeBenchmarkPhaseSchema).readonly(),
|
|
31117
|
+
steps: array(string()).readonly(),
|
|
31118
|
+
devices: array(NodeBenchmarkDevicePlanSchema).readonly(),
|
|
31119
|
+
/** Parallel sessions the cluster runs now, and what the other nodes can carry. */
|
|
31120
|
+
headroom: object({
|
|
31121
|
+
sessionsNow: number(),
|
|
31122
|
+
otherNodesCapacitySessions: number().nullable()
|
|
31123
|
+
}),
|
|
31124
|
+
refusals: array(NodeBenchmarkRefusalSchema).readonly(),
|
|
31125
|
+
canStart: boolean()
|
|
31126
|
+
});
|
|
31127
|
+
/** Where the measuring runner is. */
|
|
31128
|
+
var NodeBenchProgressSchema = object({
|
|
31129
|
+
phase: _enum([
|
|
31130
|
+
"preparing",
|
|
31131
|
+
"device",
|
|
31132
|
+
"pipeline",
|
|
31133
|
+
"cleanup"
|
|
31134
|
+
]),
|
|
31135
|
+
deviceKey: string().nullable(),
|
|
31136
|
+
modelId: string().nullable(),
|
|
31137
|
+
/** Streams (device) or sessions (pipeline) of the step running now. */
|
|
31138
|
+
load: number().nullable(),
|
|
31139
|
+
cellsDone: number(),
|
|
31140
|
+
cellsTotal: number(),
|
|
31141
|
+
message: string()
|
|
31142
|
+
});
|
|
31143
|
+
/** What limited a ramp. `none` = the ramp ran out of steps still passing. */
|
|
31144
|
+
var NodeBenchLimitSchema = _enum([
|
|
31145
|
+
"p95",
|
|
31146
|
+
"drops",
|
|
31147
|
+
"errors",
|
|
31148
|
+
"stall",
|
|
31149
|
+
"cpu",
|
|
31150
|
+
"ram",
|
|
31151
|
+
"none"
|
|
31152
|
+
]);
|
|
31153
|
+
var NodeBenchRampStepSchema = object({
|
|
31154
|
+
load: number(),
|
|
31155
|
+
pass: boolean(),
|
|
31156
|
+
p95Ms: number(),
|
|
31157
|
+
dropRatio: number(),
|
|
31158
|
+
/** Completed frames per second over the accounted window. */
|
|
31159
|
+
fps: number(),
|
|
31160
|
+
cpuPct: number().nullable(),
|
|
31161
|
+
ramFreePct: number().nullable(),
|
|
31162
|
+
failReasons: array(string()).readonly()
|
|
31163
|
+
});
|
|
31164
|
+
var NodeBenchCellSchema = discriminatedUnion("phase", [object({
|
|
31165
|
+
phase: literal("device"),
|
|
31166
|
+
deviceKey: string(),
|
|
31167
|
+
modelId: string(),
|
|
31168
|
+
/** Single-stream latency (the K = 1 step). */
|
|
31169
|
+
p50Ms: number(),
|
|
31170
|
+
p95Ms: number(),
|
|
31171
|
+
p99Ms: number(),
|
|
31172
|
+
/** Frames per second sustained at the last passing step. */
|
|
31173
|
+
fps: number(),
|
|
31174
|
+
/** Streams at the camera rate the device carried inside the frame interval; 0 = not even one. */
|
|
31175
|
+
kMax: number(),
|
|
31176
|
+
limitedBy: NodeBenchLimitSchema,
|
|
31177
|
+
/** First call (model load + warm-up). */
|
|
31178
|
+
warmupMs: number(),
|
|
31179
|
+
ramp: array(NodeBenchRampStepSchema).readonly()
|
|
31180
|
+
}), object({
|
|
31181
|
+
phase: literal("pipeline"),
|
|
31182
|
+
deviceKey: string(),
|
|
31183
|
+
modelId: string(),
|
|
31184
|
+
steps: array(string()).readonly(),
|
|
31185
|
+
/** Parallel sessions at the camera rate the node carried; 0 = not even one. */
|
|
31186
|
+
maxSessions: number(),
|
|
31187
|
+
limitedBy: NodeBenchLimitSchema,
|
|
31188
|
+
/** Detail steps that produced at least one result on the clip — a step that never fired measured nothing. */
|
|
31189
|
+
stepsFired: array(string()).readonly(),
|
|
31190
|
+
warmupMs: number(),
|
|
31191
|
+
ramp: array(NodeBenchRampStepSchema).readonly()
|
|
31192
|
+
})]);
|
|
31193
|
+
/**
|
|
31194
|
+
* What a result was measured ON. A result whose fingerprint no longer matches
|
|
31195
|
+
* the node no longer beats the table.
|
|
31196
|
+
*/
|
|
31197
|
+
var NodeBenchFingerprintSchema = object({
|
|
31198
|
+
pipelineVersion: string().nullable(),
|
|
31199
|
+
cpuModel: string().nullable(),
|
|
31200
|
+
ramGb: number().nullable(),
|
|
31201
|
+
os: string().nullable(),
|
|
31202
|
+
/** Per device: the pool the cells ran on (runtime + tuning). */
|
|
31203
|
+
pools: record(string(), object({
|
|
31204
|
+
runtime: string(),
|
|
31205
|
+
numWorkers: number(),
|
|
31206
|
+
concurrency: number(),
|
|
31207
|
+
batchMode: string()
|
|
31208
|
+
})).default({})
|
|
31209
|
+
});
|
|
31210
|
+
/** The frames the run used. */
|
|
31211
|
+
var NodeBenchClipSchema = object({
|
|
31212
|
+
/** `camstack-bench-v1` or `reference-images` (the fallback when the clip is not reachable). */
|
|
31213
|
+
id: string(),
|
|
31214
|
+
revision: string().nullable(),
|
|
31215
|
+
frames: number(),
|
|
31216
|
+
width: number(),
|
|
31217
|
+
height: number()
|
|
31218
|
+
});
|
|
31219
|
+
var NodeBenchRunnerInputSchema = object({
|
|
31220
|
+
runId: string().min(1),
|
|
31221
|
+
devices: array(NodeBenchmarkDevicePlanSchema).min(1),
|
|
31222
|
+
phases: array(NodeBenchmarkPhaseSchema).min(1),
|
|
31223
|
+
/** The full detail step tree root for the `pipeline` measurement is built on the node from these ids. */
|
|
31224
|
+
steps: array(string()).default([]),
|
|
31225
|
+
fpsPerStream: number().int().min(1).max(30),
|
|
31226
|
+
/** The runner stops on its own past this instant, whatever the hub does. */
|
|
31227
|
+
deadlineAtMs: number(),
|
|
31228
|
+
settleSec: number().min(0).max(60).default(NODE_BENCHMARK_DEFAULTS.settleSec),
|
|
31229
|
+
measureSec: number().min(2).max(300).default(NODE_BENCHMARK_DEFAULTS.measureSec),
|
|
31230
|
+
keepDownloadedModels: boolean().default(false)
|
|
31231
|
+
});
|
|
31232
|
+
var NodeBenchRunnerStateSchema = _enum([
|
|
31233
|
+
"running",
|
|
31234
|
+
"done",
|
|
31235
|
+
"failed",
|
|
31236
|
+
"aborted"
|
|
31237
|
+
]);
|
|
31238
|
+
var NodeBenchRunnerStatusSchema = object({
|
|
31239
|
+
runId: string(),
|
|
31240
|
+
nodeId: string(),
|
|
31241
|
+
state: NodeBenchRunnerStateSchema,
|
|
31242
|
+
progress: NodeBenchProgressSchema.nullable(),
|
|
31243
|
+
/** Every finished cell so far — a run stopped half way keeps what it measured. */
|
|
31244
|
+
cells: array(NodeBenchCellSchema).readonly(),
|
|
31245
|
+
fingerprint: NodeBenchFingerprintSchema.nullable(),
|
|
31246
|
+
clip: NodeBenchClipSchema.nullable(),
|
|
31247
|
+
/** Cameras seen running on the node during the run (they share its pools). */
|
|
31248
|
+
activeCameraIds: array(number()).readonly(),
|
|
31249
|
+
/** Models the run downloaded and then deleted (not installed before). */
|
|
31250
|
+
deletedModels: array(string()).readonly(),
|
|
31251
|
+
error: string().nullable(),
|
|
31252
|
+
startedAtMs: number(),
|
|
31253
|
+
finishedAtMs: number().nullable()
|
|
31254
|
+
});
|
|
31255
|
+
var NodeBenchmarkStateSchema = _enum([
|
|
31256
|
+
"draining",
|
|
31257
|
+
"measuring",
|
|
31258
|
+
"restoring",
|
|
31259
|
+
"done",
|
|
31260
|
+
"failed",
|
|
31261
|
+
"aborted"
|
|
31262
|
+
]);
|
|
31263
|
+
/** Why a run ended. */
|
|
31264
|
+
var NodeBenchmarkEndReasonSchema = _enum([
|
|
31265
|
+
"completed",
|
|
31266
|
+
"operator-abort",
|
|
31267
|
+
"deadline",
|
|
31268
|
+
"node-lost",
|
|
31269
|
+
"runner-lost",
|
|
31270
|
+
"hub-restart",
|
|
31271
|
+
"drain-timeout",
|
|
31272
|
+
"failed"
|
|
31273
|
+
]);
|
|
31274
|
+
var NodeBenchmarkRunSchema = object({
|
|
31275
|
+
runId: string(),
|
|
31276
|
+
nodeId: string(),
|
|
31277
|
+
state: NodeBenchmarkStateSchema,
|
|
31278
|
+
plan: NodeBenchmarkPlanSchema,
|
|
31279
|
+
startedAtMs: number(),
|
|
31280
|
+
deadlineAtMs: number(),
|
|
31281
|
+
finishedAtMs: number().nullable(),
|
|
31282
|
+
endReason: NodeBenchmarkEndReasonSchema.nullable(),
|
|
31283
|
+
error: string().nullable(),
|
|
31284
|
+
/** Cameras moved off the node for the run. */
|
|
31285
|
+
moved: array(number()).readonly(),
|
|
31286
|
+
/** Cameras that stayed (their only frame source is the node). */
|
|
31287
|
+
staying: array(number()).readonly(),
|
|
31288
|
+
/** Something else ran on the node's pools during the run. */
|
|
31289
|
+
contaminated: boolean(),
|
|
31290
|
+
progress: NodeBenchProgressSchema.nullable(),
|
|
31291
|
+
resultIds: array(string()).readonly()
|
|
31292
|
+
});
|
|
31293
|
+
/** `getNodeBenchmarkStatus`: the active run (or the last one), and whether benchmark mode is on. */
|
|
31294
|
+
var NodeBenchmarkStatusSchema = object({
|
|
31295
|
+
/** The node the cluster is in benchmark mode for; null = none. */
|
|
31296
|
+
modeNodeId: string().nullable(),
|
|
31297
|
+
run: NodeBenchmarkRunSchema.nullable()
|
|
31298
|
+
});
|
|
31299
|
+
/**
|
|
31300
|
+
* One stored measurement — the only authority Auto tune and the automatic
|
|
31301
|
+
* shares read measured capacity from. Written by the orchestrator when a run
|
|
31302
|
+
* ends, never by anyone else.
|
|
31303
|
+
*/
|
|
31304
|
+
var NodeBenchmarkResultSchema = object({
|
|
31305
|
+
id: string(),
|
|
31306
|
+
runId: string(),
|
|
31307
|
+
nodeId: string(),
|
|
31308
|
+
cell: NodeBenchCellSchema,
|
|
31309
|
+
fpsPerStream: number(),
|
|
31310
|
+
fingerprint: NodeBenchFingerprintSchema.nullable(),
|
|
31311
|
+
clip: NodeBenchClipSchema.nullable(),
|
|
31312
|
+
/** Other work shared the node's pools (a camera that could not move, or the hub's own duties). */
|
|
31313
|
+
contaminated: boolean(),
|
|
31314
|
+
stayingCameras: array(number()).readonly(),
|
|
31315
|
+
/** The run ended early; the cell itself completed. */
|
|
31316
|
+
partialRun: boolean(),
|
|
31317
|
+
measuredAtMs: number()
|
|
31318
|
+
});
|
|
31319
|
+
var ListNodeBenchmarkResultsInputSchema = object({
|
|
31320
|
+
nodeId: string().optional(),
|
|
31321
|
+
deviceKey: string().optional()
|
|
31322
|
+
});
|
|
31323
|
+
/** A result with its standing today: does it still beat the table? */
|
|
31324
|
+
var NodeBenchmarkResultViewSchema = NodeBenchmarkResultSchema.extend({
|
|
31325
|
+
/** `fresh` beats the table; `stale` falls back to it; `superseded` = a newer row covers the same cell. */
|
|
31326
|
+
standing: _enum([
|
|
31327
|
+
"fresh",
|
|
31328
|
+
"stale",
|
|
31329
|
+
"superseded"
|
|
31330
|
+
]),
|
|
31331
|
+
staleWhy: _enum([
|
|
31332
|
+
"age",
|
|
31333
|
+
"runtime",
|
|
31334
|
+
"pool-tuning"
|
|
31335
|
+
]).nullable()
|
|
31336
|
+
});
|
|
31337
|
+
object({
|
|
31338
|
+
runId: string(),
|
|
31339
|
+
nodeId: string(),
|
|
31340
|
+
startedAtMs: number(),
|
|
31341
|
+
deadlineAtMs: number(),
|
|
31342
|
+
plan: NodeBenchmarkPlanSchema,
|
|
31343
|
+
moved: array(number()).readonly(),
|
|
31344
|
+
staying: array(number()).readonly()
|
|
31345
|
+
});
|
|
31346
|
+
/** Candidate detectors per device, for the plan editor. */
|
|
31347
|
+
var NodeBenchmarkCandidatesSchema = object({
|
|
31348
|
+
nodeId: string(),
|
|
31349
|
+
reachable: boolean(),
|
|
31350
|
+
devices: array(object({
|
|
31351
|
+
deviceKey: string(),
|
|
31352
|
+
enabled: boolean(),
|
|
31353
|
+
available: boolean(),
|
|
31354
|
+
/** Ordered: what Auto tune would pick first, then the rest of the family by accuracy. */
|
|
31355
|
+
suggested: array(string()).readonly(),
|
|
31356
|
+
/** Every root detector the device has a build for. */
|
|
31357
|
+
all: array(string()).readonly(),
|
|
31358
|
+
/** The model the device runs now, when pinned. */
|
|
31359
|
+
currentModelId: string().nullable()
|
|
31360
|
+
})).readonly(),
|
|
31361
|
+
/** Detail steps the node's catalog offers under the root (for the `pipeline` measurement). */
|
|
31362
|
+
steps: array(object({
|
|
31363
|
+
id: string(),
|
|
31364
|
+
name: string(),
|
|
31365
|
+
slot: string()
|
|
31366
|
+
})).readonly()
|
|
31367
|
+
});
|
|
29723
31368
|
object({
|
|
29724
31369
|
activeCameras: number(),
|
|
29725
31370
|
throttledCameras: number(),
|
|
@@ -31038,7 +32683,30 @@ var pipelineRunnerCapability = {
|
|
|
31038
32683
|
releaseParkedTrackFrames: method(object({
|
|
31039
32684
|
deviceId: number(),
|
|
31040
32685
|
trackId: string()
|
|
31041
|
-
}), object({ released: number().int().nonnegative() }), { kind: "mutation" })
|
|
32686
|
+
}), object({ released: number().int().nonnegative() }), { kind: "mutation" }),
|
|
32687
|
+
/**
|
|
32688
|
+
* Start measuring THIS node for the orchestrator's node benchmark: the
|
|
32689
|
+
* bench clip decoded once into RAM, each device × candidate detector on an
|
|
32690
|
+
* open-loop ramp (`device`), then the chosen pipeline with the requested
|
|
32691
|
+
* detail steps (`pipeline`). Everything runs in-process with the executor
|
|
32692
|
+
* — no frame crosses a node (D9) — and writes nothing: no track, event,
|
|
32693
|
+
* media or notification. Reached by `nodePin(nodeId)`. Answers at once;
|
|
32694
|
+
* one run per node; the run stops itself at `deadlineAtMs`.
|
|
32695
|
+
*/
|
|
32696
|
+
startNodeBench: method(NodeBenchRunnerInputSchema, object({
|
|
32697
|
+
accepted: literal(true),
|
|
32698
|
+
runId: string()
|
|
32699
|
+
}), {
|
|
32700
|
+
kind: "mutation",
|
|
32701
|
+
auth: "admin"
|
|
32702
|
+
}),
|
|
32703
|
+
/** The run's progress and every finished cell; null when this runner does not know `runId`. */
|
|
32704
|
+
getNodeBenchStatus: method(object({ runId: string() }), NodeBenchRunnerStatusSchema.nullable(), { auth: "admin" }),
|
|
32705
|
+
/** Stop the run; what it finished is kept. */
|
|
32706
|
+
abortNodeBench: method(object({ runId: string() }), object({ aborted: boolean() }), {
|
|
32707
|
+
kind: "mutation",
|
|
32708
|
+
auth: "admin"
|
|
32709
|
+
})
|
|
31042
32710
|
}
|
|
31043
32711
|
};
|
|
31044
32712
|
var CameraPipelineConfigSchema = object({
|
|
@@ -31966,6 +33634,51 @@ var pipelineOrchestratorCapability = {
|
|
|
31966
33634
|
kind: "mutation",
|
|
31967
33635
|
auth: "admin"
|
|
31968
33636
|
}),
|
|
33637
|
+
/**
|
|
33638
|
+
* Node benchmark — what a run of this plan would do, without doing it:
|
|
33639
|
+
* the cameras that leave the node, those that cannot (the node is their
|
|
33640
|
+
* only frame source; they stay and flag the run), the estimated duration
|
|
33641
|
+
* and every reason it may not start. The confirmation shows this.
|
|
33642
|
+
*/
|
|
33643
|
+
getNodeBenchmarkPreflight: method(NodeBenchmarkPlanSchema, NodeBenchmarkPreflightSchema, { auth: "admin" }),
|
|
33644
|
+
/**
|
|
33645
|
+
* Node benchmark — start ONE run (cluster-wide lock). The orchestrator
|
|
33646
|
+
* persists a restore manifest, enters benchmark mode for the node (out of
|
|
33647
|
+
* placement, its camera pins ignored, nothing rewritten), drains it, drives
|
|
33648
|
+
* the node's own runner, then restores — always, including after an
|
|
33649
|
+
* abort, a lost node or a hub restart. Answers at once; poll
|
|
33650
|
+
* `getNodeBenchmarkStatus`. Refused runs carry the preflight.
|
|
33651
|
+
*/
|
|
33652
|
+
startNodeBenchmark: method(NodeBenchmarkPlanSchema, discriminatedUnion("kind", [object({
|
|
33653
|
+
kind: literal("started"),
|
|
33654
|
+
runId: string()
|
|
33655
|
+
}), object({
|
|
33656
|
+
kind: literal("refused"),
|
|
33657
|
+
preflight: NodeBenchmarkPreflightSchema
|
|
33658
|
+
})]), {
|
|
33659
|
+
kind: "mutation",
|
|
33660
|
+
auth: "admin"
|
|
33661
|
+
}),
|
|
33662
|
+
/** Node benchmark — the active run (or the last one) and the node in benchmark mode. */
|
|
33663
|
+
getNodeBenchmarkStatus: method(_void(), NodeBenchmarkStatusSchema, { auth: "admin" }),
|
|
33664
|
+
/** Node benchmark — stop the active run; the cluster is restored as it was. */
|
|
33665
|
+
abortNodeBenchmark: method(object({ runId: string() }), object({ aborted: boolean() }), {
|
|
33666
|
+
kind: "mutation",
|
|
33667
|
+
auth: "admin"
|
|
33668
|
+
}),
|
|
33669
|
+
/**
|
|
33670
|
+
* Node benchmark — root detector candidates per device (what Auto tune
|
|
33671
|
+
* would pick first, then the family) and the detail steps the node's
|
|
33672
|
+
* catalog offers, for the plan editor.
|
|
33673
|
+
*/
|
|
33674
|
+
getNodeBenchmarkCandidates: method(object({ nodeId: string() }), NodeBenchmarkCandidatesSchema, { auth: "admin" }),
|
|
33675
|
+
/** Node benchmark — stored results, newest first, each with its standing today. */
|
|
33676
|
+
listNodeBenchmarkResults: method(ListNodeBenchmarkResultsInputSchema, array(NodeBenchmarkResultViewSchema).readonly(), { auth: "admin" }),
|
|
33677
|
+
/** Node benchmark — delete one result; Auto tune and the shares stop reading it. */
|
|
33678
|
+
deleteNodeBenchmarkResult: method(object({ id: string() }), object({ deleted: boolean() }), {
|
|
33679
|
+
kind: "mutation",
|
|
33680
|
+
auth: "admin"
|
|
33681
|
+
}),
|
|
31969
33682
|
/** Read one camera's settings. Null when never touched (inherits agent defaults fully). */
|
|
31970
33683
|
getCameraSettings: method(object({ deviceId: number() }), CameraPipelineSettingsSchema.nullable()),
|
|
31971
33684
|
/** Set or clear the 3-state toggle for one (camera, addonId). Pass `enabled: null` to clear and revert to agent default. */
|
|
@@ -39446,6 +41159,9 @@ var CreateIntegrationInputSchema = object({
|
|
|
39446
41159
|
enabled: boolean().optional(),
|
|
39447
41160
|
info: record(string(), unknown()).optional(),
|
|
39448
41161
|
settings: record(string(), unknown()).optional(),
|
|
41162
|
+
/** Keys of `settings` the form's schema declares secret (by type) — kept in
|
|
41163
|
+
* the keychain, not the table (D787). */
|
|
41164
|
+
secretKeys: array(string()).optional(),
|
|
39449
41165
|
skipRestart: boolean().optional()
|
|
39450
41166
|
});
|
|
39451
41167
|
var UpdateIntegrationInputSchema = object({
|
|
@@ -39481,7 +41197,9 @@ var integrationsCapability = {
|
|
|
39481
41197
|
getSettings: method(object({ id: string() }), record(string(), unknown()), { auth: "admin" }),
|
|
39482
41198
|
setSettings: method(object({
|
|
39483
41199
|
id: string(),
|
|
39484
|
-
settings: record(string(), unknown())
|
|
41200
|
+
settings: record(string(), unknown()),
|
|
41201
|
+
/** Keys the form's schema declares secret (by type) — keychain-stored (D787). */
|
|
41202
|
+
secretKeys: array(string()).optional()
|
|
39485
41203
|
}), object({ success: boolean() }), {
|
|
39486
41204
|
kind: "mutation",
|
|
39487
41205
|
auth: "admin"
|
|
@@ -48804,7 +50522,8 @@ var BaseDevice = class {
|
|
|
48804
50522
|
this.role = options.role;
|
|
48805
50523
|
this.parentDeviceId = ctx.parentDeviceId;
|
|
48806
50524
|
const seedData = ctx.persistedConfig ?? {};
|
|
48807
|
-
|
|
50525
|
+
const declaredSecretPaths = collectZodSecretPaths(schema);
|
|
50526
|
+
this.config = DeviceConfig.fromSchema(schema, (data) => ctx.persistConfig(data, { secretConfigPaths: declaredSecretPaths }), seedData, ({ droppedKeys, issues }) => {
|
|
48808
50527
|
ctx.logger.warn("Device config recovery: dropping invalid persisted fields", {
|
|
48809
50528
|
tags: {
|
|
48810
50529
|
deviceId: ctx.id,
|
|
@@ -52016,6 +53735,90 @@ Object.freeze({
|
|
|
52016
53735
|
addonId: null,
|
|
52017
53736
|
access: "create"
|
|
52018
53737
|
},
|
|
53738
|
+
"keychain.delete": {
|
|
53739
|
+
capName: "keychain",
|
|
53740
|
+
capScope: "system",
|
|
53741
|
+
addonId: null,
|
|
53742
|
+
access: "delete"
|
|
53743
|
+
},
|
|
53744
|
+
"keychain.getState": {
|
|
53745
|
+
capName: "keychain",
|
|
53746
|
+
capScope: "system",
|
|
53747
|
+
addonId: null,
|
|
53748
|
+
access: "view"
|
|
53749
|
+
},
|
|
53750
|
+
"keychain.listMeta": {
|
|
53751
|
+
capName: "keychain",
|
|
53752
|
+
capScope: "system",
|
|
53753
|
+
addonId: null,
|
|
53754
|
+
access: "view"
|
|
53755
|
+
},
|
|
53756
|
+
"keychain.put": {
|
|
53757
|
+
capName: "keychain",
|
|
53758
|
+
capScope: "system",
|
|
53759
|
+
addonId: null,
|
|
53760
|
+
access: "create"
|
|
53761
|
+
},
|
|
53762
|
+
"keychain.resolve": {
|
|
53763
|
+
capName: "keychain",
|
|
53764
|
+
capScope: "system",
|
|
53765
|
+
addonId: null,
|
|
53766
|
+
access: "view"
|
|
53767
|
+
},
|
|
53768
|
+
"keychainAdmin.deleteOrphans": {
|
|
53769
|
+
capName: "keychain-admin",
|
|
53770
|
+
capScope: "system",
|
|
53771
|
+
addonId: null,
|
|
53772
|
+
access: "delete"
|
|
53773
|
+
},
|
|
53774
|
+
"keychainAdmin.downloadRecoveryKey": {
|
|
53775
|
+
capName: "keychain-admin",
|
|
53776
|
+
capScope: "system",
|
|
53777
|
+
addonId: null,
|
|
53778
|
+
access: "create"
|
|
53779
|
+
},
|
|
53780
|
+
"keychainAdmin.listAudit": {
|
|
53781
|
+
capName: "keychain-admin",
|
|
53782
|
+
capScope: "system",
|
|
53783
|
+
addonId: null,
|
|
53784
|
+
access: "view"
|
|
53785
|
+
},
|
|
53786
|
+
"keychainAdmin.listSecrets": {
|
|
53787
|
+
capName: "keychain-admin",
|
|
53788
|
+
capScope: "system",
|
|
53789
|
+
addonId: null,
|
|
53790
|
+
access: "view"
|
|
53791
|
+
},
|
|
53792
|
+
"keychainAdmin.purgeRetiredKeys": {
|
|
53793
|
+
capName: "keychain-admin",
|
|
53794
|
+
capScope: "system",
|
|
53795
|
+
addonId: null,
|
|
53796
|
+
access: "delete"
|
|
53797
|
+
},
|
|
53798
|
+
"keychainAdmin.resetKeychain": {
|
|
53799
|
+
capName: "keychain-admin",
|
|
53800
|
+
capScope: "system",
|
|
53801
|
+
addonId: null,
|
|
53802
|
+
access: "delete"
|
|
53803
|
+
},
|
|
53804
|
+
"keychainAdmin.reveal": {
|
|
53805
|
+
capName: "keychain-admin",
|
|
53806
|
+
capScope: "system",
|
|
53807
|
+
addonId: null,
|
|
53808
|
+
access: "create"
|
|
53809
|
+
},
|
|
53810
|
+
"keychainAdmin.rotateMasterKey": {
|
|
53811
|
+
capName: "keychain-admin",
|
|
53812
|
+
capScope: "system",
|
|
53813
|
+
addonId: null,
|
|
53814
|
+
access: "create"
|
|
53815
|
+
},
|
|
53816
|
+
"keychainAdmin.status": {
|
|
53817
|
+
capName: "keychain-admin",
|
|
53818
|
+
capScope: "system",
|
|
53819
|
+
addonId: null,
|
|
53820
|
+
access: "view"
|
|
53821
|
+
},
|
|
52019
53822
|
"lawnMowerControl.dock": {
|
|
52020
53823
|
capName: "lawn-mower-control",
|
|
52021
53824
|
capScope: "device",
|
|
@@ -53390,6 +55193,18 @@ Object.freeze({
|
|
|
53390
55193
|
addonId: null,
|
|
53391
55194
|
access: "create"
|
|
53392
55195
|
},
|
|
55196
|
+
"pipelineAnalytics.addRetrainFrameFromRecording": {
|
|
55197
|
+
capName: "pipeline-analytics",
|
|
55198
|
+
capScope: "device",
|
|
55199
|
+
addonId: null,
|
|
55200
|
+
access: "create"
|
|
55201
|
+
},
|
|
55202
|
+
"pipelineAnalytics.addRetrainFramesToCollection": {
|
|
55203
|
+
capName: "pipeline-analytics",
|
|
55204
|
+
capScope: "device",
|
|
55205
|
+
addonId: null,
|
|
55206
|
+
access: "create"
|
|
55207
|
+
},
|
|
53393
55208
|
"pipelineAnalytics.applyDeviceSettingsPatch": {
|
|
53394
55209
|
capName: "pipeline-analytics",
|
|
53395
55210
|
capScope: "device",
|
|
@@ -53438,12 +55253,24 @@ Object.freeze({
|
|
|
53438
55253
|
addonId: null,
|
|
53439
55254
|
access: "view"
|
|
53440
55255
|
},
|
|
55256
|
+
"pipelineAnalytics.createRetrainCollection": {
|
|
55257
|
+
capName: "pipeline-analytics",
|
|
55258
|
+
capScope: "device",
|
|
55259
|
+
addonId: null,
|
|
55260
|
+
access: "create"
|
|
55261
|
+
},
|
|
53441
55262
|
"pipelineAnalytics.deleteDeviceEvents": {
|
|
53442
55263
|
capName: "pipeline-analytics",
|
|
53443
55264
|
capScope: "device",
|
|
53444
55265
|
addonId: null,
|
|
53445
55266
|
access: "delete"
|
|
53446
55267
|
},
|
|
55268
|
+
"pipelineAnalytics.deleteRetrainCollection": {
|
|
55269
|
+
capName: "pipeline-analytics",
|
|
55270
|
+
capScope: "device",
|
|
55271
|
+
addonId: null,
|
|
55272
|
+
access: "delete"
|
|
55273
|
+
},
|
|
53447
55274
|
"pipelineAnalytics.deleteTracks": {
|
|
53448
55275
|
capName: "pipeline-analytics",
|
|
53449
55276
|
capScope: "device",
|
|
@@ -53648,6 +55475,24 @@ Object.freeze({
|
|
|
53648
55475
|
addonId: null,
|
|
53649
55476
|
access: "view"
|
|
53650
55477
|
},
|
|
55478
|
+
"pipelineAnalytics.listRetrainAssistProfiles": {
|
|
55479
|
+
capName: "pipeline-analytics",
|
|
55480
|
+
capScope: "device",
|
|
55481
|
+
addonId: null,
|
|
55482
|
+
access: "view"
|
|
55483
|
+
},
|
|
55484
|
+
"pipelineAnalytics.listRetrainCollectionFrames": {
|
|
55485
|
+
capName: "pipeline-analytics",
|
|
55486
|
+
capScope: "device",
|
|
55487
|
+
addonId: null,
|
|
55488
|
+
access: "view"
|
|
55489
|
+
},
|
|
55490
|
+
"pipelineAnalytics.listRetrainCollections": {
|
|
55491
|
+
capName: "pipeline-analytics",
|
|
55492
|
+
capScope: "device",
|
|
55493
|
+
addonId: null,
|
|
55494
|
+
access: "view"
|
|
55495
|
+
},
|
|
53651
55496
|
"pipelineAnalytics.listRetrainFrames": {
|
|
53652
55497
|
capName: "pipeline-analytics",
|
|
53653
55498
|
capScope: "device",
|
|
@@ -53696,6 +55541,12 @@ Object.freeze({
|
|
|
53696
55541
|
addonId: null,
|
|
53697
55542
|
access: "create"
|
|
53698
55543
|
},
|
|
55544
|
+
"pipelineAnalytics.proposeRetrainAnnotationsWithLlm": {
|
|
55545
|
+
capName: "pipeline-analytics",
|
|
55546
|
+
capScope: "device",
|
|
55547
|
+
addonId: null,
|
|
55548
|
+
access: "create"
|
|
55549
|
+
},
|
|
53699
55550
|
"pipelineAnalytics.pruneEvents": {
|
|
53700
55551
|
capName: "pipeline-analytics",
|
|
53701
55552
|
capScope: "device",
|
|
@@ -53750,6 +55601,18 @@ Object.freeze({
|
|
|
53750
55601
|
addonId: null,
|
|
53751
55602
|
access: "create"
|
|
53752
55603
|
},
|
|
55604
|
+
"pipelineAnalytics.removeRetrainFrameFromCollection": {
|
|
55605
|
+
capName: "pipeline-analytics",
|
|
55606
|
+
capScope: "device",
|
|
55607
|
+
addonId: null,
|
|
55608
|
+
access: "delete"
|
|
55609
|
+
},
|
|
55610
|
+
"pipelineAnalytics.renameRetrainCollection": {
|
|
55611
|
+
capName: "pipeline-analytics",
|
|
55612
|
+
capScope: "device",
|
|
55613
|
+
addonId: null,
|
|
55614
|
+
access: "create"
|
|
55615
|
+
},
|
|
53753
55616
|
"pipelineAnalytics.restageRetrainTrack": {
|
|
53754
55617
|
capName: "pipeline-analytics",
|
|
53755
55618
|
capScope: "device",
|
|
@@ -54038,6 +55901,12 @@ Object.freeze({
|
|
|
54038
55901
|
addonId: null,
|
|
54039
55902
|
access: "view"
|
|
54040
55903
|
},
|
|
55904
|
+
"pipelineOrchestrator.abortNodeBenchmark": {
|
|
55905
|
+
capName: "pipeline-orchestrator",
|
|
55906
|
+
capScope: "system",
|
|
55907
|
+
addonId: null,
|
|
55908
|
+
access: "create"
|
|
55909
|
+
},
|
|
54041
55910
|
"pipelineOrchestrator.applyAutoTune": {
|
|
54042
55911
|
capName: "pipeline-orchestrator",
|
|
54043
55912
|
capScope: "system",
|
|
@@ -54062,6 +55931,12 @@ Object.freeze({
|
|
|
54062
55931
|
addonId: null,
|
|
54063
55932
|
access: "create"
|
|
54064
55933
|
},
|
|
55934
|
+
"pipelineOrchestrator.deleteNodeBenchmarkResult": {
|
|
55935
|
+
capName: "pipeline-orchestrator",
|
|
55936
|
+
capScope: "system",
|
|
55937
|
+
addonId: null,
|
|
55938
|
+
access: "delete"
|
|
55939
|
+
},
|
|
54065
55940
|
"pipelineOrchestrator.getAgentLoad": {
|
|
54066
55941
|
capName: "pipeline-orchestrator",
|
|
54067
55942
|
capScope: "system",
|
|
@@ -54170,6 +56045,24 @@ Object.freeze({
|
|
|
54170
56045
|
addonId: null,
|
|
54171
56046
|
access: "view"
|
|
54172
56047
|
},
|
|
56048
|
+
"pipelineOrchestrator.getNodeBenchmarkCandidates": {
|
|
56049
|
+
capName: "pipeline-orchestrator",
|
|
56050
|
+
capScope: "system",
|
|
56051
|
+
addonId: null,
|
|
56052
|
+
access: "view"
|
|
56053
|
+
},
|
|
56054
|
+
"pipelineOrchestrator.getNodeBenchmarkPreflight": {
|
|
56055
|
+
capName: "pipeline-orchestrator",
|
|
56056
|
+
capScope: "system",
|
|
56057
|
+
addonId: null,
|
|
56058
|
+
access: "view"
|
|
56059
|
+
},
|
|
56060
|
+
"pipelineOrchestrator.getNodeBenchmarkStatus": {
|
|
56061
|
+
capName: "pipeline-orchestrator",
|
|
56062
|
+
capScope: "system",
|
|
56063
|
+
addonId: null,
|
|
56064
|
+
access: "view"
|
|
56065
|
+
},
|
|
54173
56066
|
"pipelineOrchestrator.getNodeInferenceDevices": {
|
|
54174
56067
|
capName: "pipeline-orchestrator",
|
|
54175
56068
|
capScope: "system",
|
|
@@ -54212,6 +56105,12 @@ Object.freeze({
|
|
|
54212
56105
|
addonId: null,
|
|
54213
56106
|
access: "view"
|
|
54214
56107
|
},
|
|
56108
|
+
"pipelineOrchestrator.listNodeBenchmarkResults": {
|
|
56109
|
+
capName: "pipeline-orchestrator",
|
|
56110
|
+
capScope: "system",
|
|
56111
|
+
addonId: null,
|
|
56112
|
+
access: "view"
|
|
56113
|
+
},
|
|
54215
56114
|
"pipelineOrchestrator.pauseForStorageMigration": {
|
|
54216
56115
|
capName: "pipeline-orchestrator",
|
|
54217
56116
|
capScope: "system",
|
|
@@ -54356,6 +56255,12 @@ Object.freeze({
|
|
|
54356
56255
|
addonId: null,
|
|
54357
56256
|
access: "create"
|
|
54358
56257
|
},
|
|
56258
|
+
"pipelineOrchestrator.startNodeBenchmark": {
|
|
56259
|
+
capName: "pipeline-orchestrator",
|
|
56260
|
+
capScope: "system",
|
|
56261
|
+
addonId: null,
|
|
56262
|
+
access: "create"
|
|
56263
|
+
},
|
|
54359
56264
|
"pipelineOrchestrator.suggestShares": {
|
|
54360
56265
|
capName: "pipeline-orchestrator",
|
|
54361
56266
|
capScope: "system",
|
|
@@ -54374,6 +56279,12 @@ Object.freeze({
|
|
|
54374
56279
|
addonId: null,
|
|
54375
56280
|
access: "create"
|
|
54376
56281
|
},
|
|
56282
|
+
"pipelineRunner.abortNodeBench": {
|
|
56283
|
+
capName: "pipeline-runner",
|
|
56284
|
+
capScope: "system",
|
|
56285
|
+
addonId: null,
|
|
56286
|
+
access: "create"
|
|
56287
|
+
},
|
|
54377
56288
|
"pipelineRunner.attachCamera": {
|
|
54378
56289
|
capName: "pipeline-runner",
|
|
54379
56290
|
capScope: "system",
|
|
@@ -54422,6 +56333,12 @@ Object.freeze({
|
|
|
54422
56333
|
addonId: null,
|
|
54423
56334
|
access: "view"
|
|
54424
56335
|
},
|
|
56336
|
+
"pipelineRunner.getNodeBenchStatus": {
|
|
56337
|
+
capName: "pipeline-runner",
|
|
56338
|
+
capScope: "system",
|
|
56339
|
+
addonId: null,
|
|
56340
|
+
access: "view"
|
|
56341
|
+
},
|
|
54425
56342
|
"pipelineRunner.getParkedTrackFrame": {
|
|
54426
56343
|
capName: "pipeline-runner",
|
|
54427
56344
|
capScope: "system",
|
|
@@ -54464,6 +56381,12 @@ Object.freeze({
|
|
|
54464
56381
|
addonId: null,
|
|
54465
56382
|
access: "create"
|
|
54466
56383
|
},
|
|
56384
|
+
"pipelineRunner.startNodeBench": {
|
|
56385
|
+
capName: "pipeline-runner",
|
|
56386
|
+
capScope: "system",
|
|
56387
|
+
addonId: null,
|
|
56388
|
+
access: "create"
|
|
56389
|
+
},
|
|
54467
56390
|
"plateGallery.assignPlate": {
|
|
54468
56391
|
capName: "plate-gallery",
|
|
54469
56392
|
capScope: "system",
|
|
@@ -58143,6 +60066,8 @@ var ALL_CAPABILITY_DEFINITIONS = [
|
|
|
58143
60066
|
imageSettingsCapability,
|
|
58144
60067
|
integrationsCapability,
|
|
58145
60068
|
intercomCapability,
|
|
60069
|
+
keychainCapability,
|
|
60070
|
+
keychainAdminCapability,
|
|
58146
60071
|
lawnMowerControlCapability,
|
|
58147
60072
|
llmCapability,
|
|
58148
60073
|
llmRuntimeCapability,
|
|
@@ -59569,6 +61494,11 @@ Object.freeze({
|
|
|
59569
61494
|
form: "single",
|
|
59570
61495
|
optional: false
|
|
59571
61496
|
}],
|
|
61497
|
+
"pipelineAnalytics.addRetrainFrameFromRecording": [{
|
|
61498
|
+
name: "deviceId",
|
|
61499
|
+
form: "single",
|
|
61500
|
+
optional: false
|
|
61501
|
+
}],
|
|
59572
61502
|
"pipelineAnalytics.applyDeviceSettingsPatch": [{
|
|
59573
61503
|
name: "deviceId",
|
|
59574
61504
|
form: "single",
|
|
@@ -59759,6 +61689,11 @@ Object.freeze({
|
|
|
59759
61689
|
form: "single",
|
|
59760
61690
|
optional: false
|
|
59761
61691
|
}],
|
|
61692
|
+
"pipelineAnalytics.proposeRetrainAnnotationsWithLlm": [{
|
|
61693
|
+
name: "deviceId",
|
|
61694
|
+
form: "single",
|
|
61695
|
+
optional: false
|
|
61696
|
+
}],
|
|
59762
61697
|
"pipelineAnalytics.pruneEventsBefore": [{
|
|
59763
61698
|
name: "deviceId",
|
|
59764
61699
|
form: "single",
|