@camstack/system 1.2.376 → 1.2.378
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/addon-runner.js +9 -4
- package/dist/addon-runner.mjs +10 -5
- package/dist/addon-utils.js +1 -1
- package/dist/addon-utils.mjs +1 -1
- package/dist/builtins/addon-pages-aggregator/addon-pages-aggregator.addon.js +1 -1
- package/dist/builtins/addon-pages-aggregator/addon-pages-aggregator.addon.mjs +1 -1
- package/dist/builtins/addon-widgets-aggregator/addon-widgets-aggregator.addon.js +1 -1
- package/dist/builtins/addon-widgets-aggregator/addon-widgets-aggregator.addon.mjs +1 -1
- package/dist/builtins/alerts/alerts.addon.js +1 -1
- package/dist/builtins/alerts/alerts.addon.mjs +1 -1
- package/dist/builtins/autotrack/index.js +1 -1
- package/dist/builtins/autotrack/index.mjs +1 -1
- package/dist/builtins/backup-orchestrator/backup-orchestrator.addon.js +1 -1
- package/dist/builtins/backup-orchestrator/backup-orchestrator.addon.mjs +1 -1
- package/dist/builtins/calendars/calendars.addon.js +1 -1
- package/dist/builtins/calendars/calendars.addon.mjs +1 -1
- package/dist/builtins/camera-grid/index.js +1 -1
- package/dist/builtins/camera-grid/index.mjs +1 -1
- package/dist/builtins/composer/composer.addon.js +2 -2
- package/dist/builtins/composer/composer.addon.mjs +2 -2
- package/dist/builtins/console-logging/index.js +1 -1
- package/dist/builtins/console-logging/index.mjs +1 -1
- package/dist/builtins/core-blocks/core-blocks.addon.js +2 -2
- package/dist/builtins/core-blocks/core-blocks.addon.mjs +2 -2
- package/dist/builtins/device-manager/device-config-secrets.d.ts +21 -0
- package/dist/builtins/device-manager/device-manager.addon.js +85 -6
- package/dist/builtins/device-manager/device-manager.addon.mjs +85 -6
- package/dist/builtins/hub-forwarder/index.js +1 -1
- package/dist/builtins/hub-forwarder/index.mjs +1 -1
- package/dist/builtins/keychain/index.d.ts +1 -0
- package/dist/builtins/keychain/index.js +1442 -0
- package/dist/builtins/keychain/index.mjs +1435 -0
- package/dist/builtins/keychain/key-sources.d.ts +37 -0
- package/dist/builtins/keychain/keychain-crypto.d.ts +28 -0
- package/dist/builtins/keychain/keychain-service.d.ts +103 -0
- package/dist/builtins/keychain/keychain-store.d.ts +82 -0
- package/dist/builtins/keychain/keychain-usage.d.ts +6 -0
- package/dist/builtins/keychain/keychain.addon.d.ts +11 -0
- package/dist/builtins/keychain/platform-key-source.d.ts +24 -0
- package/dist/builtins/liveness-monitor/liveness-monitor.addon.js +1 -1
- package/dist/builtins/liveness-monitor/liveness-monitor.addon.mjs +1 -1
- package/dist/builtins/local-auth/local-auth.addon.js +19 -2
- package/dist/builtins/local-auth/local-auth.addon.mjs +19 -2
- package/dist/builtins/local-network/local-network.addon.js +1 -1
- package/dist/builtins/local-network/local-network.addon.mjs +1 -1
- package/dist/builtins/loki-logging/index.js +1 -1
- package/dist/builtins/loki-logging/index.mjs +1 -1
- package/dist/builtins/native-metrics/native-metrics.addon.js +1 -1
- package/dist/builtins/native-metrics/native-metrics.addon.mjs +1 -1
- package/dist/builtins/platform-probe/index.js +1 -1
- package/dist/builtins/platform-probe/index.mjs +1 -1
- package/dist/builtins/remote-access-orchestrator/remote-access-orchestrator.addon.js +1 -1
- package/dist/builtins/remote-access-orchestrator/remote-access-orchestrator.addon.mjs +1 -1
- package/dist/builtins/snapshot/index.js +1 -1
- package/dist/builtins/snapshot/index.mjs +1 -1
- package/dist/builtins/sqlite-storage/filesystem-storage.addon.js +1 -1
- package/dist/builtins/sqlite-storage/filesystem-storage.addon.mjs +1 -1
- package/dist/builtins/sqlite-storage/sqlite-settings.addon.js +0 -0
- package/dist/builtins/sqlite-storage/sqlite-settings.addon.mjs +0 -0
- package/dist/builtins/storage-orchestrator/location-store.d.ts +6 -0
- package/dist/builtins/storage-orchestrator/storage-orchestrator.addon.d.ts +15 -0
- package/dist/builtins/storage-orchestrator/storage-orchestrator.addon.js +74 -14
- package/dist/builtins/storage-orchestrator/storage-orchestrator.addon.mjs +74 -14
- package/dist/builtins/system-config/system-config.addon.js +1 -1
- package/dist/builtins/system-config/system-config.addon.mjs +1 -1
- package/dist/builtins/winston-logging/index.js +1 -1
- package/dist/builtins/winston-logging/index.mjs +1 -1
- package/dist/{child-cap-dispatch-BWtaSmWf.js → child-cap-dispatch-C9lmrWFT.js} +198 -25
- package/dist/{child-cap-dispatch-8qMgog1O.mjs → child-cap-dispatch-DpHovtQd.mjs} +170 -27
- package/dist/{composition-sources-zxQPPtP_.mjs → composition-sources-BLBd338N.mjs} +1 -1
- package/dist/{composition-sources-DW7CgMsg.js → composition-sources-CxhGdtdh.js} +1 -1
- package/dist/{dist-D732NygW.mjs → dist-Bvl5JgNt.mjs} +2336 -105
- package/dist/{dist-BcUWQGr9.js → dist-KxsOMQik.js} +2401 -104
- package/dist/{event-loop-stall-monitor-QX4RjNe7.js → event-loop-stall-monitor-CbSmCWkp.js} +8 -7
- package/dist/{event-loop-stall-monitor-8W4yWNVW.mjs → event-loop-stall-monitor-D8rqSWfW.mjs} +8 -7
- package/dist/{hub-cap-forward-BdT320dq.mjs → hub-cap-forward-CH6_VWVO.mjs} +13 -4
- package/dist/{hub-cap-forward-DmHNjbB0.js → hub-cap-forward-COCmYaup.js} +13 -4
- package/dist/index.d.ts +2 -0
- package/dist/index.js +20 -6
- package/dist/index.mjs +13 -7
- package/dist/kernel/config-schema.d.ts +4 -0
- package/dist/kernel/moleculer/child-addon-call-dispatch.d.ts +6 -0
- package/dist/kernel/transport/cap-route-resolver.d.ts +19 -0
- package/dist/kernel/transport/hub-cap-forward.d.ts +22 -1
- package/dist/kernel/transport/index.d.ts +2 -2
- package/dist/kernel/transport/local-child-registry.d.ts +4 -3
- package/dist/logging/log-redactor.d.ts +9 -0
- package/dist/platform-key-source-BWlq0jjn.mjs +23 -0
- package/dist/platform-key-source-Di7HrlGR.js +40 -0
- package/dist/{retired-settings-keys-CxPOg7BF.mjs → retired-settings-keys-BAcfvFtm.mjs} +1 -1
- package/dist/{retired-settings-keys-MaESpO18.js → retired-settings-keys-gTsZfpmP.js} +1 -1
- package/package.json +17 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
let zod = require("zod");
|
|
2
2
|
require("node:crypto");
|
|
3
|
-
//#region ../types/dist/event-category-
|
|
3
|
+
//#region ../types/dist/event-category-DaIZi00R.mjs
|
|
4
4
|
var EventCategory = /* @__PURE__ */ function(EventCategory) {
|
|
5
5
|
EventCategory["SystemBoot"] = "system.boot";
|
|
6
6
|
EventCategory["SystemAddonsReady"] = "system.addons-ready";
|
|
@@ -79,6 +79,13 @@ var EventCategory = /* @__PURE__ */ function(EventCategory) {
|
|
|
79
79
|
*/
|
|
80
80
|
EventCategory["AddonLoadFailed"] = "addon.load-failed";
|
|
81
81
|
/**
|
|
82
|
+
* A keychain value was stored or removed (D787). Carries the ref, its
|
|
83
|
+
* owner and the new version — NEVER the value. A process holding the ref
|
|
84
|
+
* drops its cached copy and the owning `BaseAddon` re-resolves its config.
|
|
85
|
+
* Telemetry (D8): a process that misses it still revalidates by version.
|
|
86
|
+
*/
|
|
87
|
+
EventCategory["KeychainChanged"] = "keychain.changed";
|
|
88
|
+
/**
|
|
82
89
|
* Addon recovered from a previous failure. Emitted when an addon
|
|
83
90
|
* transitions from `failed` back to `healthy` (typically via the
|
|
84
91
|
* monitor's auto-retry loop, or after manual `addons.retryLoad`).
|
|
@@ -701,7 +708,7 @@ var EventCategory = /* @__PURE__ */ function(EventCategory) {
|
|
|
701
708
|
return EventCategory;
|
|
702
709
|
}({});
|
|
703
710
|
//#endregion
|
|
704
|
-
//#region ../types/dist/sleep-
|
|
711
|
+
//#region ../types/dist/sleep-DujUvOcb.mjs
|
|
705
712
|
/**
|
|
706
713
|
* The audio chunk plane's byte format, and the ONE expansion from a coded
|
|
707
714
|
* window to float samples (D455).
|
|
@@ -780,6 +787,144 @@ function buildAlawTable() {
|
|
|
780
787
|
}
|
|
781
788
|
buildUlawTable();
|
|
782
789
|
buildAlawTable();
|
|
790
|
+
/**
|
|
791
|
+
* The value a redacted secret is replaced with on every read surface.
|
|
792
|
+
*
|
|
793
|
+
* It is also the WRITE-BACK token: an `upsertLocation` that sends this value
|
|
794
|
+
* back for a key means "keep what is stored", which is what lets an operator
|
|
795
|
+
* rename a location without retyping its password. A literal an operator could
|
|
796
|
+
* plausibly choose as a real password would turn that convenience into a way
|
|
797
|
+
* to lock yourself out, hence the sentinel shape.
|
|
798
|
+
*/
|
|
799
|
+
var REDACTED_SECRET = "__camstack_redacted__";
|
|
800
|
+
/** Is this field's stored value a credential? */
|
|
801
|
+
function isSecretConfigField(field) {
|
|
802
|
+
if (field.type === "password") return true;
|
|
803
|
+
return "secret" in field && field.secret === true;
|
|
804
|
+
}
|
|
805
|
+
/**
|
|
806
|
+
* Is this field's value stored in the KEYCHAIN (D787)? Every secret field is,
|
|
807
|
+
* by its TYPE, unless it opts out with `storage: 'inline'` — never by its name.
|
|
808
|
+
*/
|
|
809
|
+
function isKeychainStoredField(field) {
|
|
810
|
+
if (!isSecretConfigField(field)) return false;
|
|
811
|
+
if (field.type === "textarea" && field.isJson === true) return false;
|
|
812
|
+
return !("storage" in field && field.storage === "inline");
|
|
813
|
+
}
|
|
814
|
+
/**
|
|
815
|
+
* Every config key in `schema` whose value is a secret, including keys nested
|
|
816
|
+
* inside `group` / `sub-tabs` containers.
|
|
817
|
+
*/
|
|
818
|
+
function collectSecretConfigKeys(schema) {
|
|
819
|
+
const keys = /* @__PURE__ */ new Set();
|
|
820
|
+
for (const section of sectionsOf(schema)) for (const field of fieldsOf(section)) walkField(field, keys);
|
|
821
|
+
return keys;
|
|
822
|
+
}
|
|
823
|
+
function isRecord$2(value) {
|
|
824
|
+
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
825
|
+
}
|
|
826
|
+
function sectionsOf(schema) {
|
|
827
|
+
if (!isRecord$2(schema)) return [];
|
|
828
|
+
const sections = schema["sections"];
|
|
829
|
+
return Array.isArray(sections) ? sections : [];
|
|
830
|
+
}
|
|
831
|
+
function fieldsOf(node) {
|
|
832
|
+
if (!isRecord$2(node)) return [];
|
|
833
|
+
const fields = node["fields"];
|
|
834
|
+
return Array.isArray(fields) ? fields : [];
|
|
835
|
+
}
|
|
836
|
+
function walkField(field, out) {
|
|
837
|
+
if (!isRecord$2(field)) return;
|
|
838
|
+
const type = field["type"];
|
|
839
|
+
const key = field["key"];
|
|
840
|
+
if ((type === "password" || field["secret"] === true) && typeof key === "string" && key.length > 0) out.add(key);
|
|
841
|
+
if (type === "group") {
|
|
842
|
+
for (const child of fieldsOf(field)) walkField(child, out);
|
|
843
|
+
return;
|
|
844
|
+
}
|
|
845
|
+
if (type === "sub-tabs") {
|
|
846
|
+
const tabs = field["tabs"];
|
|
847
|
+
if (!Array.isArray(tabs)) return;
|
|
848
|
+
for (const tab of tabs) for (const child of fieldsOf(tab)) walkField(child, out);
|
|
849
|
+
}
|
|
850
|
+
}
|
|
851
|
+
/**
|
|
852
|
+
* What a settings blob holds where a secret used to be.
|
|
853
|
+
*
|
|
854
|
+
* A keychain-stored field never holds its value. It holds a self-describing
|
|
855
|
+
* MARKER, `{"$secret":"secret://…","v":1}` — an object, never a string, so no
|
|
856
|
+
* code can mistake it for a credential and no form can send it to a camera as
|
|
857
|
+
* a password. The empty state is `null` / absent, never `''`.
|
|
858
|
+
*
|
|
859
|
+
* The same shapes travel to and from the admin UI:
|
|
860
|
+
*
|
|
861
|
+
* - read: `hydrateSchema` hands a secret field a {@link SecretFieldView}
|
|
862
|
+
* (`{ $secret, v, set: true }`) or `null` — the browser learns whether a
|
|
863
|
+
* value is set, never the value.
|
|
864
|
+
* - write: an untouched field submits the view back unchanged (KEEP); a typed
|
|
865
|
+
* value is a plain non-empty string (CHANGE); the Clear button submits
|
|
866
|
+
* {@link SECRET_CLEAR} (CLEAR). `''`, `null` and the legacy redaction tokens
|
|
867
|
+
* are KEEP — an empty string is what a defaults-fallback pushes back, and
|
|
868
|
+
* treating it as "clear" is how a save destroyed a stored credential before.
|
|
869
|
+
*
|
|
870
|
+
* Pure and browser-safe.
|
|
871
|
+
*/
|
|
872
|
+
var SECRET_CLEAR = { $secretClear: true };
|
|
873
|
+
/** The `'***'` token D634 redaction writes for non-admins. */
|
|
874
|
+
var LEGACY_DEVICE_REDACTION = "***";
|
|
875
|
+
function isRecord$1(value) {
|
|
876
|
+
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
877
|
+
}
|
|
878
|
+
function makeSecretMarker(ref) {
|
|
879
|
+
return {
|
|
880
|
+
$secret: ref,
|
|
881
|
+
v: 1
|
|
882
|
+
};
|
|
883
|
+
}
|
|
884
|
+
/** A stored marker: an object whose `$secret` is a non-empty string. */
|
|
885
|
+
function isSecretMarker(value) {
|
|
886
|
+
if (!isRecord$1(value)) return false;
|
|
887
|
+
const ref = value["$secret"];
|
|
888
|
+
return typeof ref === "string" && ref.length > 0;
|
|
889
|
+
}
|
|
890
|
+
function isSecretClear(value) {
|
|
891
|
+
return isRecord$1(value) && value["$secretClear"] === true;
|
|
892
|
+
}
|
|
893
|
+
/**
|
|
894
|
+
* The UI view of a stored secret field value: a marker becomes "set", inline
|
|
895
|
+
* plaintext becomes "set (inline)", nothing becomes `null`. A value never
|
|
896
|
+
* survives this function.
|
|
897
|
+
*/
|
|
898
|
+
function toSecretFieldView(stored) {
|
|
899
|
+
if (isSecretMarker(stored)) return {
|
|
900
|
+
$secret: stored.$secret,
|
|
901
|
+
v: 1,
|
|
902
|
+
set: true
|
|
903
|
+
};
|
|
904
|
+
if (typeof stored === "string" && stored.length > 0) return {
|
|
905
|
+
$secret: null,
|
|
906
|
+
v: 1,
|
|
907
|
+
set: true,
|
|
908
|
+
inline: true
|
|
909
|
+
};
|
|
910
|
+
return null;
|
|
911
|
+
}
|
|
912
|
+
/**
|
|
913
|
+
* Classify an incoming value for a secret path. Only a non-empty string that is
|
|
914
|
+
* not a redaction token sets a value; only {@link SECRET_CLEAR} clears.
|
|
915
|
+
* Everything else — a marker (ours or anyone's), a UI view, `''`, `null`,
|
|
916
|
+
* `undefined`, a redaction token, a non-string — keeps what is stored.
|
|
917
|
+
*/
|
|
918
|
+
function classifySecretWrite(incoming) {
|
|
919
|
+
if (isSecretClear(incoming)) return { kind: "clear" };
|
|
920
|
+
if (typeof incoming !== "string") return { kind: "keep" };
|
|
921
|
+
if (incoming.length === 0) return { kind: "keep" };
|
|
922
|
+
if (incoming === "__camstack_redacted__" || incoming === LEGACY_DEVICE_REDACTION) return { kind: "keep" };
|
|
923
|
+
return {
|
|
924
|
+
kind: "set",
|
|
925
|
+
value: incoming
|
|
926
|
+
};
|
|
927
|
+
}
|
|
783
928
|
/** Lookup map for well-known tabs by ID. */
|
|
784
929
|
var WELL_KNOWN_TAB_MAP = Object.fromEntries([
|
|
785
930
|
{
|
|
@@ -952,33 +1097,19 @@ var WELL_KNOWN_TAB_MAP = Object.fromEntries([
|
|
|
952
1097
|
function isValuelessField(field) {
|
|
953
1098
|
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";
|
|
954
1099
|
}
|
|
955
|
-
|
|
956
|
-
* Merge a `ConfigUISchema` with a raw `values` record into a
|
|
957
|
-
* `ConfigUISchemaWithValues`. Used by every `get*Settings` backend endpoint
|
|
958
|
-
* before returning to the admin UI. Groups are walked recursively.
|
|
959
|
-
*
|
|
960
|
-
* For each leaf field:
|
|
961
|
-
* - structural fields (`separator`, `info`, `button`) pass through unchanged
|
|
962
|
-
* - other fields get `value = values[key] ?? field.default ?? null`
|
|
963
|
-
*
|
|
964
|
-
* Unknown keys in `values` (keys not declared in the schema) are silently
|
|
965
|
-
* ignored — they don't contribute to the output. Missing keys fall back to
|
|
966
|
-
* the schema default or `null`. This mirrors the old backend behaviour where
|
|
967
|
-
* `FormBuilder` rendered `values[key] ?? field.default`.
|
|
968
|
-
*/
|
|
969
|
-
function hydrateSchema(schema, values) {
|
|
1100
|
+
function hydrateSchema(schema, values, options = {}) {
|
|
970
1101
|
return {
|
|
971
1102
|
...schema.tabs ? { tabs: [...schema.tabs] } : {},
|
|
972
1103
|
sections: schema.sections.map((section) => ({
|
|
973
1104
|
...section,
|
|
974
|
-
fields: section.fields.map((field) => hydrateField(field, values))
|
|
1105
|
+
fields: section.fields.map((field) => hydrateField(field, values, options))
|
|
975
1106
|
}))
|
|
976
1107
|
};
|
|
977
1108
|
}
|
|
978
|
-
function hydrateField(field, values) {
|
|
1109
|
+
function hydrateField(field, values, options) {
|
|
979
1110
|
if (isValuelessField(field)) return field;
|
|
980
1111
|
if (field.type === "group") {
|
|
981
|
-
const hydratedChildren = field.fields.map((child) => hydrateField(child, values));
|
|
1112
|
+
const hydratedChildren = field.fields.map((child) => hydrateField(child, values, options));
|
|
982
1113
|
return {
|
|
983
1114
|
...field,
|
|
984
1115
|
fields: hydratedChildren
|
|
@@ -987,7 +1118,7 @@ function hydrateField(field, values) {
|
|
|
987
1118
|
if (field.type === "sub-tabs") {
|
|
988
1119
|
const hydratedTabs = field.tabs.map((tab) => ({
|
|
989
1120
|
...tab,
|
|
990
|
-
fields: tab.fields.map((child) => hydrateField(child, values))
|
|
1121
|
+
fields: tab.fields.map((child) => hydrateField(child, values, options))
|
|
991
1122
|
}));
|
|
992
1123
|
return {
|
|
993
1124
|
...field,
|
|
@@ -997,6 +1128,33 @@ function hydrateField(field, values) {
|
|
|
997
1128
|
const key = field.key;
|
|
998
1129
|
const storedValue = Object.prototype.hasOwnProperty.call(values, key) ? values[key] : void 0;
|
|
999
1130
|
const defaultValue = field.default;
|
|
1131
|
+
const asView = (v) => isSecretMarker(v) || options.inlineSecretsAsViews === true && v !== void 0;
|
|
1132
|
+
if (isKeychainStoredField(field) && asView(storedValue)) return {
|
|
1133
|
+
...field,
|
|
1134
|
+
value: toSecretFieldView(storedValue)
|
|
1135
|
+
};
|
|
1136
|
+
if (isKeychainStoredField(field) && options.inlineSecretsAsViews === true) return {
|
|
1137
|
+
...field,
|
|
1138
|
+
value: null
|
|
1139
|
+
};
|
|
1140
|
+
if (field.type === "editable-array" && Array.isArray(storedValue)) {
|
|
1141
|
+
const secretItemKeys = field.itemFields.filter((item) => "key" in item && isKeychainStoredField(item)).map((item) => "key" in item ? item.key : "");
|
|
1142
|
+
if (secretItemKeys.length > 0) {
|
|
1143
|
+
const rows = storedValue.map((row) => {
|
|
1144
|
+
if (row === null || typeof row !== "object" || Array.isArray(row)) return row;
|
|
1145
|
+
const out = { ...row };
|
|
1146
|
+
for (const k of secretItemKeys) {
|
|
1147
|
+
const v = Reflect.get(row, k);
|
|
1148
|
+
if (asView(v)) out[k] = toSecretFieldView(v);
|
|
1149
|
+
}
|
|
1150
|
+
return out;
|
|
1151
|
+
});
|
|
1152
|
+
return {
|
|
1153
|
+
...field,
|
|
1154
|
+
value: rows
|
|
1155
|
+
};
|
|
1156
|
+
}
|
|
1157
|
+
}
|
|
1000
1158
|
if (field.multiple) {
|
|
1001
1159
|
const stored = Array.isArray(storedValue) ? storedValue : storedValue !== void 0 && storedValue !== null ? [storedValue] : [];
|
|
1002
1160
|
const itemFallback = field.multiple.itemDefault !== void 0 ? field.multiple.itemDefault : defaultValue !== void 0 ? defaultValue : typeOf(field) === "string" ? "" : null;
|
|
@@ -1255,6 +1413,538 @@ function projectStore(store, perNodeKeys, nodeId) {
|
|
|
1255
1413
|
}
|
|
1256
1414
|
return out;
|
|
1257
1415
|
}
|
|
1416
|
+
var GLOBAL_SCOPE = { kind: "global" };
|
|
1417
|
+
/** The scope every addon-wide (not per-node, not per-device) setting lives in. */
|
|
1418
|
+
function globalSecretScope() {
|
|
1419
|
+
return GLOBAL_SCOPE;
|
|
1420
|
+
}
|
|
1421
|
+
/**
|
|
1422
|
+
* An addon id as a ref owner. A hub in-process builtin's context id is
|
|
1423
|
+
* `addon:<id>`; the owner of its secrets is `<id>`, exactly as for the same
|
|
1424
|
+
* addon running forked.
|
|
1425
|
+
*/
|
|
1426
|
+
function normalizeSecretOwner(addonId) {
|
|
1427
|
+
return addonId.startsWith("addon:") ? addonId.slice(6) : addonId;
|
|
1428
|
+
}
|
|
1429
|
+
function encodeSegment(value) {
|
|
1430
|
+
return encodeURIComponent(value);
|
|
1431
|
+
}
|
|
1432
|
+
function decodeSegment(value) {
|
|
1433
|
+
try {
|
|
1434
|
+
return decodeURIComponent(value);
|
|
1435
|
+
} catch {
|
|
1436
|
+
return null;
|
|
1437
|
+
}
|
|
1438
|
+
}
|
|
1439
|
+
/** The scope as it appears inside a ref (`global`, `node/<id>`, …). */
|
|
1440
|
+
function formatSecretScope(scope) {
|
|
1441
|
+
switch (scope.kind) {
|
|
1442
|
+
case "global": return "global";
|
|
1443
|
+
case "node": return `node/${encodeSegment(scope.nodeId)}`;
|
|
1444
|
+
case "device": return `device/${scope.deviceId}`;
|
|
1445
|
+
case "integration": return `integration/${encodeSegment(scope.integrationId)}`;
|
|
1446
|
+
case "row": return `row/${encodeSegment(scope.collection)}/${encodeSegment(scope.rowId)}`;
|
|
1447
|
+
}
|
|
1448
|
+
}
|
|
1449
|
+
/**
|
|
1450
|
+
* The field path of a value inside an array item, addressed by the item's id:
|
|
1451
|
+
* `arrayItemFieldPath('providers', 'authentik', 'clientSecret')` →
|
|
1452
|
+
* `providers[authentik].clientSecret`.
|
|
1453
|
+
*/
|
|
1454
|
+
function arrayItemFieldPath(arrayKey, itemId, fieldKey) {
|
|
1455
|
+
return `${arrayKey}[${encodeSegment(itemId)}].${fieldKey}`;
|
|
1456
|
+
}
|
|
1457
|
+
function parseScope(segments) {
|
|
1458
|
+
switch (segments[0]) {
|
|
1459
|
+
case "global": return {
|
|
1460
|
+
scope: GLOBAL_SCOPE,
|
|
1461
|
+
used: 1
|
|
1462
|
+
};
|
|
1463
|
+
case "node": {
|
|
1464
|
+
const nodeId = segments[1] !== void 0 ? decodeSegment(segments[1]) : null;
|
|
1465
|
+
return nodeId === null || nodeId.length === 0 ? null : {
|
|
1466
|
+
scope: {
|
|
1467
|
+
kind: "node",
|
|
1468
|
+
nodeId
|
|
1469
|
+
},
|
|
1470
|
+
used: 2
|
|
1471
|
+
};
|
|
1472
|
+
}
|
|
1473
|
+
case "device": {
|
|
1474
|
+
const raw = segments[1];
|
|
1475
|
+
if (raw === void 0 || !/^\d+$/.test(raw)) return null;
|
|
1476
|
+
return {
|
|
1477
|
+
scope: {
|
|
1478
|
+
kind: "device",
|
|
1479
|
+
deviceId: Number(raw)
|
|
1480
|
+
},
|
|
1481
|
+
used: 2
|
|
1482
|
+
};
|
|
1483
|
+
}
|
|
1484
|
+
case "integration": {
|
|
1485
|
+
const id = segments[1] !== void 0 ? decodeSegment(segments[1]) : null;
|
|
1486
|
+
return id === null || id.length === 0 ? null : {
|
|
1487
|
+
scope: {
|
|
1488
|
+
kind: "integration",
|
|
1489
|
+
integrationId: id
|
|
1490
|
+
},
|
|
1491
|
+
used: 2
|
|
1492
|
+
};
|
|
1493
|
+
}
|
|
1494
|
+
case "row": {
|
|
1495
|
+
const collection = segments[1] !== void 0 ? decodeSegment(segments[1]) : null;
|
|
1496
|
+
const rowId = segments[2] !== void 0 ? decodeSegment(segments[2]) : null;
|
|
1497
|
+
if (collection === null || rowId === null || collection.length === 0 || rowId.length === 0) return null;
|
|
1498
|
+
return {
|
|
1499
|
+
scope: {
|
|
1500
|
+
kind: "row",
|
|
1501
|
+
collection,
|
|
1502
|
+
rowId
|
|
1503
|
+
},
|
|
1504
|
+
used: 3
|
|
1505
|
+
};
|
|
1506
|
+
}
|
|
1507
|
+
default: return null;
|
|
1508
|
+
}
|
|
1509
|
+
}
|
|
1510
|
+
/** Take a ref apart; `null` when it is not a well-formed ref. */
|
|
1511
|
+
function parseSecretRef(ref) {
|
|
1512
|
+
if (!ref.startsWith("secret://")) return null;
|
|
1513
|
+
const segments = ref.slice(9).split("/");
|
|
1514
|
+
const owner = segments[0] !== void 0 ? decodeSegment(segments[0]) : null;
|
|
1515
|
+
if (owner === null || owner.length === 0) return null;
|
|
1516
|
+
const parsed = parseScope(segments.slice(1));
|
|
1517
|
+
if (parsed === null) return null;
|
|
1518
|
+
const fieldPath = segments.slice(1 + parsed.used).join("/");
|
|
1519
|
+
if (fieldPath.length === 0) return null;
|
|
1520
|
+
return {
|
|
1521
|
+
owner,
|
|
1522
|
+
scope: parsed.scope,
|
|
1523
|
+
fieldPath
|
|
1524
|
+
};
|
|
1525
|
+
}
|
|
1526
|
+
/** A write to a secret path could not be stored in the keychain, so it was refused. */
|
|
1527
|
+
var KeychainWriteRefusedError = class extends Error {
|
|
1528
|
+
fieldPath;
|
|
1529
|
+
constructor(fieldPath, cause) {
|
|
1530
|
+
super(`secret "${fieldPath}" was not saved: the keychain could not store it (${cause instanceof Error ? cause.message : String(cause)}). Nothing was written.`);
|
|
1531
|
+
this.fieldPath = fieldPath;
|
|
1532
|
+
this.name = "KeychainWriteRefusedError";
|
|
1533
|
+
}
|
|
1534
|
+
};
|
|
1535
|
+
var KEEP = { kind: "keep" };
|
|
1536
|
+
function isRecord(value) {
|
|
1537
|
+
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
1538
|
+
}
|
|
1539
|
+
function defaultMintId() {
|
|
1540
|
+
return globalThis.crypto.randomUUID();
|
|
1541
|
+
}
|
|
1542
|
+
/** Every marker ref anywhere under `value`. */
|
|
1543
|
+
function collectSecretMarkerRefs(value, out = []) {
|
|
1544
|
+
if (isSecretMarker(value)) {
|
|
1545
|
+
out.push(value.$secret);
|
|
1546
|
+
return out;
|
|
1547
|
+
}
|
|
1548
|
+
if (Array.isArray(value)) for (const item of value) collectSecretMarkerRefs(item, out);
|
|
1549
|
+
else if (isRecord(value)) for (const child of Object.values(value)) collectSecretMarkerRefs(child, out);
|
|
1550
|
+
return out;
|
|
1551
|
+
}
|
|
1552
|
+
async function storedValueEquals(secrets, marker, candidate) {
|
|
1553
|
+
const resolved = (await secrets.resolve([marker.$secret]))[marker.$secret];
|
|
1554
|
+
return resolved?.kind === "value" && resolved.value === candidate;
|
|
1555
|
+
}
|
|
1556
|
+
async function writeLeaf(ctx, incoming, stored, fieldPath) {
|
|
1557
|
+
const intent = classifySecretWrite(incoming);
|
|
1558
|
+
const ref = ctx.secrets.ref(ctx.scope, fieldPath);
|
|
1559
|
+
const storedIsOurs = isSecretMarker(stored) && stored.$secret === ref;
|
|
1560
|
+
if (intent.kind === "keep") return KEEP;
|
|
1561
|
+
if (intent.kind === "set" && !ctx.operatorWrite && typeof stored === "string" && stored === intent.value) return KEEP;
|
|
1562
|
+
if (intent.kind === "clear") {
|
|
1563
|
+
if (storedIsOurs) ctx.deletes.push(ref);
|
|
1564
|
+
return {
|
|
1565
|
+
kind: "value",
|
|
1566
|
+
value: null
|
|
1567
|
+
};
|
|
1568
|
+
}
|
|
1569
|
+
if (storedIsOurs && await storedValueEquals(ctx.secrets, stored, intent.value)) return {
|
|
1570
|
+
kind: "value",
|
|
1571
|
+
value: stored
|
|
1572
|
+
};
|
|
1573
|
+
try {
|
|
1574
|
+
await ctx.secrets.put(ref, intent.value);
|
|
1575
|
+
} catch (err) {
|
|
1576
|
+
throw new KeychainWriteRefusedError(fieldPath, err);
|
|
1577
|
+
}
|
|
1578
|
+
return {
|
|
1579
|
+
kind: "value",
|
|
1580
|
+
value: makeSecretMarker(ref)
|
|
1581
|
+
};
|
|
1582
|
+
}
|
|
1583
|
+
/** Apply a member result onto `out`: KEEP restores the stored member, or removes it. */
|
|
1584
|
+
function applyMember(out, key, result, storedParent) {
|
|
1585
|
+
if (result.kind === "value") {
|
|
1586
|
+
out[key] = result.value;
|
|
1587
|
+
return;
|
|
1588
|
+
}
|
|
1589
|
+
if (Object.prototype.hasOwnProperty.call(storedParent, key)) out[key] = storedParent[key];
|
|
1590
|
+
else delete out[key];
|
|
1591
|
+
}
|
|
1592
|
+
async function writeMembers(ctx, children, incoming, stored, pathOf) {
|
|
1593
|
+
const out = { ...incoming };
|
|
1594
|
+
for (const [member, node] of children) applyMember(out, member, await writeNode(ctx, node, incoming[member], stored[member], pathOf(member)), stored);
|
|
1595
|
+
return out;
|
|
1596
|
+
}
|
|
1597
|
+
function rowId(row, idKey) {
|
|
1598
|
+
const raw = row[idKey];
|
|
1599
|
+
if (typeof raw === "string" && raw.length > 0) return raw;
|
|
1600
|
+
if (typeof raw === "number" && Number.isFinite(raw)) return String(raw);
|
|
1601
|
+
return null;
|
|
1602
|
+
}
|
|
1603
|
+
async function writeArray(ctx, node, incoming, stored, fieldPath) {
|
|
1604
|
+
const storedRows = Array.isArray(stored) ? stored.filter(isRecord) : [];
|
|
1605
|
+
if (!Array.isArray(incoming)) {
|
|
1606
|
+
ctx.deletes.push(...collectSecretMarkerRefs(storedRows));
|
|
1607
|
+
return {
|
|
1608
|
+
kind: "value",
|
|
1609
|
+
value: incoming
|
|
1610
|
+
};
|
|
1611
|
+
}
|
|
1612
|
+
const storedById = /* @__PURE__ */ new Map();
|
|
1613
|
+
for (const row of storedRows) {
|
|
1614
|
+
const id = rowId(row, node.idKey);
|
|
1615
|
+
if (id !== null) storedById.set(id, row);
|
|
1616
|
+
}
|
|
1617
|
+
const kept = /* @__PURE__ */ new Set();
|
|
1618
|
+
const rows = [];
|
|
1619
|
+
for (const row of incoming) {
|
|
1620
|
+
if (!isRecord(row)) {
|
|
1621
|
+
rows.push(row);
|
|
1622
|
+
continue;
|
|
1623
|
+
}
|
|
1624
|
+
const id = rowId(row, node.idKey) ?? ctx.mintId();
|
|
1625
|
+
kept.add(id);
|
|
1626
|
+
const withId = {
|
|
1627
|
+
...row,
|
|
1628
|
+
[node.idKey]: row[node.idKey] ?? id
|
|
1629
|
+
};
|
|
1630
|
+
if (rowId(withId, node.idKey) === null) withId[node.idKey] = id;
|
|
1631
|
+
const storedRow = storedById.get(id) ?? {};
|
|
1632
|
+
rows.push(await writeMembers(ctx, node.item, withId, storedRow, (member) => arrayItemFieldPath(fieldPath, id, member)));
|
|
1633
|
+
}
|
|
1634
|
+
for (const [id, row] of storedById) if (!kept.has(id)) ctx.deletes.push(...collectSecretMarkerRefs(row));
|
|
1635
|
+
return {
|
|
1636
|
+
kind: "value",
|
|
1637
|
+
value: rows
|
|
1638
|
+
};
|
|
1639
|
+
}
|
|
1640
|
+
async function writeNode(ctx, node, incoming, stored, fieldPath) {
|
|
1641
|
+
switch (node.kind) {
|
|
1642
|
+
case "leaf": return writeLeaf(ctx, incoming, stored, fieldPath);
|
|
1643
|
+
case "array": return writeArray(ctx, node, incoming, stored, fieldPath);
|
|
1644
|
+
case "object": {
|
|
1645
|
+
if (!isRecord(incoming)) {
|
|
1646
|
+
if (incoming === void 0) return KEEP;
|
|
1647
|
+
ctx.deletes.push(...collectSecretMarkerRefs(stored));
|
|
1648
|
+
return {
|
|
1649
|
+
kind: "value",
|
|
1650
|
+
value: incoming
|
|
1651
|
+
};
|
|
1652
|
+
}
|
|
1653
|
+
const storedObj = isRecord(stored) ? stored : {};
|
|
1654
|
+
return {
|
|
1655
|
+
kind: "value",
|
|
1656
|
+
value: await writeMembers(ctx, node.children, incoming, storedObj, (m) => `${fieldPath}.${m}`)
|
|
1657
|
+
};
|
|
1658
|
+
}
|
|
1659
|
+
}
|
|
1660
|
+
}
|
|
1661
|
+
/** Split a perNode-scoped key (`key@nodeId`). */
|
|
1662
|
+
function splitNodeKey(key) {
|
|
1663
|
+
const at = key.indexOf("@");
|
|
1664
|
+
return at <= 0 ? {
|
|
1665
|
+
base: key,
|
|
1666
|
+
nodeId: null
|
|
1667
|
+
} : {
|
|
1668
|
+
base: key.slice(0, at),
|
|
1669
|
+
nodeId: key.slice(at + 1)
|
|
1670
|
+
};
|
|
1671
|
+
}
|
|
1672
|
+
/** Rewrite a settings patch so no secret value reaches the blob. See the file doc. */
|
|
1673
|
+
async function transformSecretWrite(input) {
|
|
1674
|
+
const deletes = [];
|
|
1675
|
+
const base = {
|
|
1676
|
+
secrets: input.secrets,
|
|
1677
|
+
mintId: input.mintId ?? defaultMintId,
|
|
1678
|
+
deletes,
|
|
1679
|
+
operatorWrite: input.operatorWrite === true
|
|
1680
|
+
};
|
|
1681
|
+
const out = {};
|
|
1682
|
+
for (const [key, incoming] of Object.entries(input.patch)) {
|
|
1683
|
+
const { base: baseKey, nodeId } = splitNodeKey(key);
|
|
1684
|
+
const node = input.tree.get(baseKey);
|
|
1685
|
+
if (node === void 0) {
|
|
1686
|
+
out[key] = incoming;
|
|
1687
|
+
continue;
|
|
1688
|
+
}
|
|
1689
|
+
const scope = nodeId !== null && nodeId.length > 0 ? {
|
|
1690
|
+
kind: "node",
|
|
1691
|
+
nodeId
|
|
1692
|
+
} : input.scope ?? globalSecretScope();
|
|
1693
|
+
const result = await writeNode({
|
|
1694
|
+
...base,
|
|
1695
|
+
scope
|
|
1696
|
+
}, node, incoming, input.stored[key], baseKey);
|
|
1697
|
+
if (result.kind === "value") out[key] = result.value;
|
|
1698
|
+
}
|
|
1699
|
+
return {
|
|
1700
|
+
patch: out,
|
|
1701
|
+
afterWrite: async () => {
|
|
1702
|
+
if (deletes.length === 0) return { orphaned: [] };
|
|
1703
|
+
try {
|
|
1704
|
+
await input.secrets.delete([...new Set(deletes)]);
|
|
1705
|
+
return { orphaned: [] };
|
|
1706
|
+
} catch {
|
|
1707
|
+
return { orphaned: [...new Set(deletes)] };
|
|
1708
|
+
}
|
|
1709
|
+
}
|
|
1710
|
+
};
|
|
1711
|
+
}
|
|
1712
|
+
/**
|
|
1713
|
+
* Replace every marker in `value` with its keychain value. Returns the SAME
|
|
1714
|
+
* reference when there is no marker (no allocation, no keychain call).
|
|
1715
|
+
*/
|
|
1716
|
+
async function resolveSecretMarkers(value, secrets) {
|
|
1717
|
+
const refs = collectSecretMarkerRefs(value);
|
|
1718
|
+
if (refs.length === 0) return {
|
|
1719
|
+
value,
|
|
1720
|
+
unresolved: []
|
|
1721
|
+
};
|
|
1722
|
+
const answers = await secrets.resolve(refs);
|
|
1723
|
+
const unresolved = [];
|
|
1724
|
+
for (const ref of new Set(refs)) {
|
|
1725
|
+
const answer = answers[ref];
|
|
1726
|
+
if (answer === void 0) unresolved.push({
|
|
1727
|
+
ref,
|
|
1728
|
+
reason: "not-initialized"
|
|
1729
|
+
});
|
|
1730
|
+
else if (answer.kind === "unavailable") unresolved.push({
|
|
1731
|
+
ref,
|
|
1732
|
+
reason: answer.reason
|
|
1733
|
+
});
|
|
1734
|
+
else if (answer.kind === "missing" || answer.kind === "forbidden") unresolved.push({
|
|
1735
|
+
ref,
|
|
1736
|
+
reason: answer.kind
|
|
1737
|
+
});
|
|
1738
|
+
}
|
|
1739
|
+
const substitute = (v) => {
|
|
1740
|
+
if (isSecretMarker(v)) {
|
|
1741
|
+
const answer = answers[v.$secret];
|
|
1742
|
+
return answer?.kind === "value" ? {
|
|
1743
|
+
keep: true,
|
|
1744
|
+
value: answer.value
|
|
1745
|
+
} : {
|
|
1746
|
+
keep: false,
|
|
1747
|
+
value: void 0
|
|
1748
|
+
};
|
|
1749
|
+
}
|
|
1750
|
+
if (Array.isArray(v)) {
|
|
1751
|
+
const items = [];
|
|
1752
|
+
for (const item of v) {
|
|
1753
|
+
const s = substitute(item);
|
|
1754
|
+
if (s.keep) items.push(s.value);
|
|
1755
|
+
}
|
|
1756
|
+
return {
|
|
1757
|
+
keep: true,
|
|
1758
|
+
value: items
|
|
1759
|
+
};
|
|
1760
|
+
}
|
|
1761
|
+
if (isRecord(v)) {
|
|
1762
|
+
const out = {};
|
|
1763
|
+
for (const [k, child] of Object.entries(v)) {
|
|
1764
|
+
const s = substitute(child);
|
|
1765
|
+
if (s.keep) out[k] = s.value;
|
|
1766
|
+
}
|
|
1767
|
+
return {
|
|
1768
|
+
keep: true,
|
|
1769
|
+
value: out
|
|
1770
|
+
};
|
|
1771
|
+
}
|
|
1772
|
+
return {
|
|
1773
|
+
keep: true,
|
|
1774
|
+
value: v
|
|
1775
|
+
};
|
|
1776
|
+
};
|
|
1777
|
+
return {
|
|
1778
|
+
value: substitute(value).value,
|
|
1779
|
+
unresolved
|
|
1780
|
+
};
|
|
1781
|
+
}
|
|
1782
|
+
function touchesTree(tree, patch) {
|
|
1783
|
+
if (tree.size === 0) return false;
|
|
1784
|
+
for (const key of Object.keys(patch)) {
|
|
1785
|
+
const at = key.indexOf("@");
|
|
1786
|
+
if (tree.has(at > 0 ? key.slice(0, at) : key)) return true;
|
|
1787
|
+
}
|
|
1788
|
+
return false;
|
|
1789
|
+
}
|
|
1790
|
+
/** The blob as stored now; a failed read REFUSES the write instead of guessing. */
|
|
1791
|
+
async function readStoredAddonBlob(raw) {
|
|
1792
|
+
const threeWay = raw.readAddonStoreResult;
|
|
1793
|
+
if (threeWay === void 0) return raw.readAddonStore();
|
|
1794
|
+
const result = await threeWay.call(raw);
|
|
1795
|
+
if (result.kind === "failed") throw new Error(`settings write refused: the stored blob could not be read (${result.error})`);
|
|
1796
|
+
return result.kind === "missing" ? {} : result.value;
|
|
1797
|
+
}
|
|
1798
|
+
function createSecretAwareSettings(raw, opts) {
|
|
1799
|
+
const chains = /* @__PURE__ */ new Map();
|
|
1800
|
+
const serialize = (key, fn) => {
|
|
1801
|
+
const next = (chains.get(key) ?? Promise.resolve()).then(fn, fn);
|
|
1802
|
+
const tail = next.catch(() => void 0);
|
|
1803
|
+
chains.set(key, tail);
|
|
1804
|
+
tail.then(() => {
|
|
1805
|
+
if (chains.get(key) === tail) chains.delete(key);
|
|
1806
|
+
});
|
|
1807
|
+
return next;
|
|
1808
|
+
};
|
|
1809
|
+
const write = async (chainKey, tree, scope, patch, readStored, rawWrite) => {
|
|
1810
|
+
if (!touchesTree(tree, patch)) return rawWrite(patch);
|
|
1811
|
+
return serialize(chainKey, async () => {
|
|
1812
|
+
const stored = await readStored();
|
|
1813
|
+
const result = await transformSecretWrite({
|
|
1814
|
+
tree,
|
|
1815
|
+
secrets: opts.secrets,
|
|
1816
|
+
patch,
|
|
1817
|
+
stored,
|
|
1818
|
+
...scope !== void 0 ? { scope } : {},
|
|
1819
|
+
operatorWrite: opts.isOperatorWrite?.() === true
|
|
1820
|
+
});
|
|
1821
|
+
if (Object.keys(result.patch).length > 0) await rawWrite(result.patch);
|
|
1822
|
+
const { orphaned } = await result.afterWrite();
|
|
1823
|
+
if (orphaned.length > 0) opts.onOrphaned(orphaned);
|
|
1824
|
+
});
|
|
1825
|
+
};
|
|
1826
|
+
const wrapped = {
|
|
1827
|
+
writeAddonStore: (patch) => write("addon", opts.addonTree(), void 0, patch, () => readStoredAddonBlob(raw), (p) => raw.writeAddonStore(p)),
|
|
1828
|
+
writeDeviceStore: (deviceId, patch) => write(`device:${deviceId}`, opts.deviceTree(), {
|
|
1829
|
+
kind: "device",
|
|
1830
|
+
deviceId
|
|
1831
|
+
}, patch, () => raw.readDeviceStore(deviceId), (p) => raw.writeDeviceStore(deviceId, p))
|
|
1832
|
+
};
|
|
1833
|
+
return new Proxy(raw, { get(target, prop, receiver) {
|
|
1834
|
+
if (prop === "writeAddonStore") return wrapped.writeAddonStore;
|
|
1835
|
+
if (prop === "writeDeviceStore") return wrapped.writeDeviceStore;
|
|
1836
|
+
const value = Reflect.get(target, prop, receiver);
|
|
1837
|
+
return typeof value === "function" ? value.bind(target) : value;
|
|
1838
|
+
} });
|
|
1839
|
+
}
|
|
1840
|
+
/** The context the addon sees: identical, except that its settings writes are secret-aware. */
|
|
1841
|
+
function withSecretAwareSettings(context, opts) {
|
|
1842
|
+
const raw = context.settings;
|
|
1843
|
+
if (raw === void 0) return context;
|
|
1844
|
+
const settings = createSecretAwareSettings(raw, opts);
|
|
1845
|
+
return new Proxy(context, { get(target, prop, receiver) {
|
|
1846
|
+
if (prop === "settings") return settings;
|
|
1847
|
+
return Reflect.get(target, prop, receiver);
|
|
1848
|
+
} });
|
|
1849
|
+
}
|
|
1850
|
+
var LEAF = { kind: "leaf" };
|
|
1851
|
+
var DEFAULT_ITEM_ID_KEY = "id";
|
|
1852
|
+
function collectFields(fields, out) {
|
|
1853
|
+
for (const field of fields) {
|
|
1854
|
+
if (field.type === "group") {
|
|
1855
|
+
collectFields(field.fields, out);
|
|
1856
|
+
continue;
|
|
1857
|
+
}
|
|
1858
|
+
if (field.type === "sub-tabs") {
|
|
1859
|
+
for (const tab of field.tabs) collectFields(tab.fields, out);
|
|
1860
|
+
continue;
|
|
1861
|
+
}
|
|
1862
|
+
if (field.type === "editable-array") {
|
|
1863
|
+
const item = /* @__PURE__ */ new Map();
|
|
1864
|
+
for (const itemField of field.itemFields) if ("key" in itemField && isKeychainStoredField(itemField)) item.set(itemField.key, LEAF);
|
|
1865
|
+
if (item.size > 0) out.set(field.key, {
|
|
1866
|
+
kind: "array",
|
|
1867
|
+
idKey: field.itemIdKey ?? DEFAULT_ITEM_ID_KEY,
|
|
1868
|
+
item
|
|
1869
|
+
});
|
|
1870
|
+
continue;
|
|
1871
|
+
}
|
|
1872
|
+
if (!("key" in field) || typeof field.key !== "string") continue;
|
|
1873
|
+
if (isKeychainStoredField(field)) out.set(field.key, LEAF);
|
|
1874
|
+
}
|
|
1875
|
+
}
|
|
1876
|
+
/** The secret tree a settings schema declares. */
|
|
1877
|
+
function secretTreeFromSchema(schema) {
|
|
1878
|
+
const out = /* @__PURE__ */ new Map();
|
|
1879
|
+
if (schema === null) return out;
|
|
1880
|
+
for (const section of schema.sections) collectFields(section.fields, out);
|
|
1881
|
+
return out;
|
|
1882
|
+
}
|
|
1883
|
+
/** Parse `a.b[id].c` into segments; throws on a malformed path (a declaration bug). */
|
|
1884
|
+
function parseSecretStatePath(path) {
|
|
1885
|
+
const segments = [];
|
|
1886
|
+
for (const raw of path.split(".")) {
|
|
1887
|
+
const m = /^([^[\]]+)(?:\[([^[\]]+)\])?$/.exec(raw);
|
|
1888
|
+
if (m === null || m[1] === void 0) throw new Error(`secretStatePaths: malformed path "${path}"`);
|
|
1889
|
+
segments.push(m[2] !== void 0 ? {
|
|
1890
|
+
key: m[1],
|
|
1891
|
+
idKey: m[2]
|
|
1892
|
+
} : { key: m[1] });
|
|
1893
|
+
}
|
|
1894
|
+
if (segments.length === 0) throw new Error(`secretStatePaths: empty path`);
|
|
1895
|
+
if (segments[segments.length - 1]?.idKey !== void 0) throw new Error(`secretStatePaths: "${path}" ends on an array — name the member that is secret`);
|
|
1896
|
+
return segments;
|
|
1897
|
+
}
|
|
1898
|
+
function insert(into, segments) {
|
|
1899
|
+
const [head, ...rest] = segments;
|
|
1900
|
+
if (head === void 0) return;
|
|
1901
|
+
if (rest.length === 0) {
|
|
1902
|
+
into.set(head.key, LEAF);
|
|
1903
|
+
return;
|
|
1904
|
+
}
|
|
1905
|
+
const existing = into.get(head.key);
|
|
1906
|
+
if (head.idKey !== void 0) {
|
|
1907
|
+
const item = new Map(existing?.kind === "array" ? existing.item : []);
|
|
1908
|
+
insert(item, rest);
|
|
1909
|
+
into.set(head.key, {
|
|
1910
|
+
kind: "array",
|
|
1911
|
+
idKey: head.idKey,
|
|
1912
|
+
item
|
|
1913
|
+
});
|
|
1914
|
+
return;
|
|
1915
|
+
}
|
|
1916
|
+
const children = new Map(existing?.kind === "object" ? existing.children : []);
|
|
1917
|
+
insert(children, rest);
|
|
1918
|
+
into.set(head.key, {
|
|
1919
|
+
kind: "object",
|
|
1920
|
+
children
|
|
1921
|
+
});
|
|
1922
|
+
}
|
|
1923
|
+
/** Add hidden-state paths (`secretStatePaths`) to a schema-derived tree. */
|
|
1924
|
+
function mergeSecretStatePaths(tree, paths) {
|
|
1925
|
+
if (paths.length === 0) return tree;
|
|
1926
|
+
const out = new Map(tree);
|
|
1927
|
+
for (const path of paths) insert(out, parseSecretStatePath(path));
|
|
1928
|
+
return out;
|
|
1929
|
+
}
|
|
1930
|
+
/**
|
|
1931
|
+
* The tree of a DECLARED path list — a device's `secretConfigPaths`
|
|
1932
|
+
* (`collectZodSecretPaths`: dotted, `[]` for array items). An array segment
|
|
1933
|
+
* without a named id field is addressed by the item's `id`.
|
|
1934
|
+
*/
|
|
1935
|
+
function secretTreeFromPaths(paths) {
|
|
1936
|
+
const out = /* @__PURE__ */ new Map();
|
|
1937
|
+
for (const path of paths) {
|
|
1938
|
+
if (path.length === 0) continue;
|
|
1939
|
+
insert(out, parseSecretStatePath(path.replace(/\[\]/g, `[${DEFAULT_ITEM_ID_KEY}]`)));
|
|
1940
|
+
}
|
|
1941
|
+
return out;
|
|
1942
|
+
}
|
|
1943
|
+
/** First retry of a secret the keychain could not serve; doubles to {@link SECRET_RETRY_MAX_MS}. */
|
|
1944
|
+
var SECRET_RETRY_FIRST_MS = 5e3;
|
|
1945
|
+
var SECRET_RETRY_MAX_MS = 5 * 6e4;
|
|
1946
|
+
/** Coalesces a burst of `keychain.changed` events into one re-resolve. */
|
|
1947
|
+
var SECRET_CHANGE_DEBOUNCE_MS = 250;
|
|
1258
1948
|
/**
|
|
1259
1949
|
* Base class for CamStack addons. Eliminates settings boilerplate:
|
|
1260
1950
|
*
|
|
@@ -1324,6 +2014,25 @@ var BaseAddon = class {
|
|
|
1324
2014
|
settingsStoreReady = false;
|
|
1325
2015
|
/** Default config values. Provided via constructor. */
|
|
1326
2016
|
defaults;
|
|
2017
|
+
/**
|
|
2018
|
+
* Hidden-state paths that hold secrets (D787) — values the addon writes
|
|
2019
|
+
* itself (`updateGlobalSettings`, `state()`) that no form field declares.
|
|
2020
|
+
* Stored in the keychain exactly like a `password` field. Syntax:
|
|
2021
|
+
* `'snapshotSigningKey'`, `'identity.pincode'`, `'tokens[userId].accessToken'`
|
|
2022
|
+
* (`key[<id field>]` addresses array items by id, never by index).
|
|
2023
|
+
*/
|
|
2024
|
+
secretStatePaths = [];
|
|
2025
|
+
_addonSecretTree = null;
|
|
2026
|
+
_deviceSecretTree = null;
|
|
2027
|
+
/** Refs the last resolved config pointed at — a change to one re-resolves. */
|
|
2028
|
+
_configSecretRefs = /* @__PURE__ */ new Set();
|
|
2029
|
+
_unresolvedSecrets = [];
|
|
2030
|
+
_secretRetryTimer = null;
|
|
2031
|
+
_secretRetryDelayMs = SECRET_RETRY_FIRST_MS;
|
|
2032
|
+
_secretChangeTimer = null;
|
|
2033
|
+
_secretChangeUnsub = null;
|
|
2034
|
+
/** >0 while an OPERATOR's settings write is being applied. */
|
|
2035
|
+
_operatorWriteDepth = 0;
|
|
1327
2036
|
constructor(defaults) {
|
|
1328
2037
|
this.defaults = defaults;
|
|
1329
2038
|
this._config = { ...defaults };
|
|
@@ -1359,8 +2068,18 @@ var BaseAddon = class {
|
|
|
1359
2068
|
return this._config;
|
|
1360
2069
|
}
|
|
1361
2070
|
async initialize(context) {
|
|
1362
|
-
|
|
2071
|
+
const secrets = context.secrets;
|
|
2072
|
+
this._ctx = secrets !== void 0 ? withSecretAwareSettings(context, {
|
|
2073
|
+
secrets,
|
|
2074
|
+
addonTree: () => this.addonSecretTree(),
|
|
2075
|
+
deviceTree: () => this.deviceSecretTree(),
|
|
2076
|
+
onOrphaned: (refs) => context.logger.warn("keychain refs dropped by a settings write could not be deleted", { meta: { refs: [...refs] } }),
|
|
2077
|
+
isOperatorWrite: () => this._operatorWriteDepth > 0
|
|
2078
|
+
}) : context;
|
|
1363
2079
|
await this.resolveConfig();
|
|
2080
|
+
if (secrets !== void 0) this._secretChangeUnsub = secrets.onChange((ref) => {
|
|
2081
|
+
if (this._configSecretRefs.has(ref)) this.scheduleSecretReresolve(SECRET_CHANGE_DEBOUNCE_MS);
|
|
2082
|
+
});
|
|
1364
2083
|
const result = await this.onInitialize();
|
|
1365
2084
|
this.emitLifecycle(EventCategory.AddonStarted);
|
|
1366
2085
|
const normalized = normalizeAddonInitResult(result);
|
|
@@ -1393,6 +2112,12 @@ var BaseAddon = class {
|
|
|
1393
2112
|
*/
|
|
1394
2113
|
async onHubReachable() {}
|
|
1395
2114
|
async shutdown() {
|
|
2115
|
+
this._secretChangeUnsub?.();
|
|
2116
|
+
this._secretChangeUnsub = null;
|
|
2117
|
+
if (this._secretRetryTimer !== null) clearTimeout(this._secretRetryTimer);
|
|
2118
|
+
if (this._secretChangeTimer !== null) clearTimeout(this._secretChangeTimer);
|
|
2119
|
+
this._secretRetryTimer = null;
|
|
2120
|
+
this._secretChangeTimer = null;
|
|
1396
2121
|
this.emitLifecycle(EventCategory.AddonStopped);
|
|
1397
2122
|
if (this.autoEmitReadiness) this.emitReadinessForProviders("down");
|
|
1398
2123
|
await this.onShutdown();
|
|
@@ -1471,7 +2196,7 @@ var BaseAddon = class {
|
|
|
1471
2196
|
return hydrateSchema(schema, overlay ? {
|
|
1472
2197
|
...projected,
|
|
1473
2198
|
...overlay
|
|
1474
|
-
} : projected);
|
|
2199
|
+
} : projected, { inlineSecretsAsViews: true });
|
|
1475
2200
|
}
|
|
1476
2201
|
/**
|
|
1477
2202
|
* The integration-level view of this addon's settings: exactly the sections
|
|
@@ -1520,7 +2245,7 @@ var BaseAddon = class {
|
|
|
1520
2245
|
return hydrateSchema({
|
|
1521
2246
|
...schema,
|
|
1522
2247
|
sections
|
|
1523
|
-
}, projected);
|
|
2248
|
+
}, projected, { inlineSecretsAsViews: true });
|
|
1524
2249
|
}
|
|
1525
2250
|
/**
|
|
1526
2251
|
* The raw addon store PROJECTED onto the target node's bare per-node keys:
|
|
@@ -1574,18 +2299,50 @@ var BaseAddon = class {
|
|
|
1574
2299
|
value: result.value[key]
|
|
1575
2300
|
};
|
|
1576
2301
|
}
|
|
2302
|
+
/**
|
|
2303
|
+
* The OPERATOR's write — a settings form or an admin API call, dispatched by
|
|
2304
|
+
* the kernel. Identical to {@link updateGlobalSettings}, except that a secret
|
|
2305
|
+
* the operator sends is stored as sent even when it equals a pre-keychain
|
|
2306
|
+
* inline value: the operator re-entering a password is a change, an addon
|
|
2307
|
+
* writing back what it read is not (D787).
|
|
2308
|
+
*/
|
|
2309
|
+
async updateGlobalSettingsAsOperator(patch, nodeId) {
|
|
2310
|
+
this._operatorWriteDepth++;
|
|
2311
|
+
try {
|
|
2312
|
+
await this.applyGlobalPatch(patch, nodeId);
|
|
2313
|
+
} finally {
|
|
2314
|
+
this._operatorWriteDepth--;
|
|
2315
|
+
}
|
|
2316
|
+
}
|
|
1577
2317
|
async updateGlobalSettings(patch, nodeId) {
|
|
2318
|
+
await this.applyGlobalPatch(patch, nodeId);
|
|
2319
|
+
}
|
|
2320
|
+
/**
|
|
2321
|
+
* REMOVE stored secrets — their keychain values and their markers (D787).
|
|
2322
|
+
*
|
|
2323
|
+
* Writing `''` to a secret field KEEPS what is stored (an empty string is
|
|
2324
|
+
* what a defaults fallback writes back, and it must never destroy a
|
|
2325
|
+
* credential), so code that means "forget this token" says so here. Without
|
|
2326
|
+
* a keychain (an older kernel) it writes `''`, as such code always did.
|
|
2327
|
+
*/
|
|
2328
|
+
async clearSecrets(keys, nodeId) {
|
|
2329
|
+
const tree = this.addonSecretTree();
|
|
2330
|
+
const keychain = this._ctx?.secrets !== void 0;
|
|
2331
|
+
const patch = {};
|
|
2332
|
+
for (const key of keys) patch[key] = keychain && tree.has(key) ? SECRET_CLEAR : "";
|
|
2333
|
+
await this.applyGlobalPatch(patch, nodeId);
|
|
2334
|
+
}
|
|
2335
|
+
async applyGlobalPatch(barePatch, nodeId) {
|
|
1578
2336
|
const keys = this.perNodeKeys();
|
|
1579
2337
|
const localNode = normalizeNodeId(this._ctx?.kernel?.localNodeId);
|
|
1580
2338
|
const target = normalizeNodeId(nodeId ?? this._ctx?.kernel?.localNodeId);
|
|
1581
|
-
const barePatch = patch;
|
|
1582
2339
|
const scoped = keys.size > 0 ? scopePatch(barePatch, keys, target) : barePatch;
|
|
1583
2340
|
await this._ctx?.settings?.writeAddonStore(scoped);
|
|
1584
2341
|
if (target !== localNode) return;
|
|
1585
2342
|
await this.resolveConfig();
|
|
1586
2343
|
await this.onConfigChanged();
|
|
1587
2344
|
this.emitLifecycle(EventCategory.AddonUpdated, { level: "global" });
|
|
1588
|
-
this.maybeAutoRestart(
|
|
2345
|
+
this.maybeAutoRestart(Object.keys(barePatch), this.globalSettingsSchema());
|
|
1589
2346
|
}
|
|
1590
2347
|
/**
|
|
1591
2348
|
* The set of field keys the global settings schema declares `perNode: true`
|
|
@@ -1610,7 +2367,7 @@ var BaseAddon = class {
|
|
|
1610
2367
|
* time to return its response before the addon is torn down and
|
|
1611
2368
|
* re-initialised by `AddonRegistryService.restartAddon`.
|
|
1612
2369
|
*/
|
|
1613
|
-
maybeAutoRestart(
|
|
2370
|
+
maybeAutoRestart(patchKeys, schema) {
|
|
1614
2371
|
if (!schema) return;
|
|
1615
2372
|
const restartKeys = /* @__PURE__ */ new Set();
|
|
1616
2373
|
for (const section of schema.sections) for (const field of section.fields) {
|
|
@@ -1618,13 +2375,13 @@ var BaseAddon = class {
|
|
|
1618
2375
|
if (field.requiresRestart) restartKeys.add(field.key);
|
|
1619
2376
|
}
|
|
1620
2377
|
if (restartKeys.size === 0) return;
|
|
1621
|
-
if (!
|
|
2378
|
+
if (!patchKeys.some((k) => restartKeys.has(k))) return;
|
|
1622
2379
|
const ctx = this._ctx;
|
|
1623
2380
|
if (!ctx) return;
|
|
1624
2381
|
const addonId = ctx.id;
|
|
1625
2382
|
setImmediate(() => {
|
|
1626
2383
|
ctx.api.addons?.restartAddon?.mutate({ addonId }).then(() => {
|
|
1627
|
-
ctx.logger.info("addon auto-restart triggered by restart-required setting change", { meta: { changedFields:
|
|
2384
|
+
ctx.logger.info("addon auto-restart triggered by restart-required setting change", { meta: { changedFields: patchKeys.filter((k) => restartKeys.has(k)) } });
|
|
1628
2385
|
}).catch((err) => {
|
|
1629
2386
|
ctx.logger.error("addon auto-restart failed", { meta: { error: err instanceof Error ? err.message : String(err) } });
|
|
1630
2387
|
});
|
|
@@ -1633,7 +2390,7 @@ var BaseAddon = class {
|
|
|
1633
2390
|
async getDeviceSettings(deviceId) {
|
|
1634
2391
|
const schema = this.deviceSettingsSchema();
|
|
1635
2392
|
if (!schema) return { sections: [] };
|
|
1636
|
-
return hydrateSchema(schema, await this._ctx?.settings?.readDeviceStore(deviceId) ?? {});
|
|
2393
|
+
return hydrateSchema(schema, await this._ctx?.settings?.readDeviceStore(deviceId) ?? {}, { inlineSecretsAsViews: true });
|
|
1637
2394
|
}
|
|
1638
2395
|
async updateDeviceSettings(deviceId, patch) {
|
|
1639
2396
|
await this._ctx?.settings?.writeDeviceStore(deviceId, patch);
|
|
@@ -1763,7 +2520,7 @@ var BaseAddon = class {
|
|
|
1763
2520
|
* selection at boot (absent scoped key ⇒ the constructor default wins).
|
|
1764
2521
|
*/
|
|
1765
2522
|
async resolveConfig() {
|
|
1766
|
-
const stored = await this.readAddonStoreWithRetry();
|
|
2523
|
+
const stored = await this.resolveStoredSecrets(await this.readAddonStoreWithRetry());
|
|
1767
2524
|
const perNode = this.perNodeKeys();
|
|
1768
2525
|
const localNode = normalizeNodeId(this._ctx?.kernel?.localNodeId);
|
|
1769
2526
|
const resolved = { ...this.defaults };
|
|
@@ -1788,7 +2545,7 @@ var BaseAddon = class {
|
|
|
1788
2545
|
key,
|
|
1789
2546
|
schema,
|
|
1790
2547
|
fallback,
|
|
1791
|
-
read: () => this.readAddonStoreWithRetry(),
|
|
2548
|
+
read: async () => this.resolveStoredSecrets(await this.readAddonStoreWithRetry()),
|
|
1792
2549
|
write: async (patch) => {
|
|
1793
2550
|
await this._ctx?.settings?.writeAddonStore(patch);
|
|
1794
2551
|
},
|
|
@@ -1805,7 +2562,7 @@ var BaseAddon = class {
|
|
|
1805
2562
|
key,
|
|
1806
2563
|
schema,
|
|
1807
2564
|
fallback,
|
|
1808
|
-
read: async () => await this._ctx?.settings?.readDeviceStore(deviceId) ?? {},
|
|
2565
|
+
read: async () => this.resolveStoredSecrets(await this._ctx?.settings?.readDeviceStore(deviceId) ?? {}, false),
|
|
1809
2566
|
write: async (patch) => {
|
|
1810
2567
|
await this._ctx?.settings?.writeDeviceStore(deviceId, patch);
|
|
1811
2568
|
},
|
|
@@ -1817,6 +2574,70 @@ var BaseAddon = class {
|
|
|
1817
2574
|
} })
|
|
1818
2575
|
});
|
|
1819
2576
|
}
|
|
2577
|
+
/** The addon store's secret tree: schema fields by TYPE, plus `secretStatePaths`. */
|
|
2578
|
+
addonSecretTree() {
|
|
2579
|
+
this._addonSecretTree ??= mergeSecretStatePaths(secretTreeFromSchema(this.globalSettingsSchema()), this.secretStatePaths);
|
|
2580
|
+
return this._addonSecretTree;
|
|
2581
|
+
}
|
|
2582
|
+
deviceSecretTree() {
|
|
2583
|
+
this._deviceSecretTree ??= secretTreeFromSchema(this.deviceSettingsSchema());
|
|
2584
|
+
return this._deviceSecretTree;
|
|
2585
|
+
}
|
|
2586
|
+
/**
|
|
2587
|
+
* Secrets of this addon's stored config that could not be resolved on the
|
|
2588
|
+
* last read, with why. Non-empty means the addon is running WITHOUT them —
|
|
2589
|
+
* an addon whose function needs one should report itself degraded rather
|
|
2590
|
+
* than start on an empty credential.
|
|
2591
|
+
*/
|
|
2592
|
+
get unresolvedSecrets() {
|
|
2593
|
+
return this._unresolvedSecrets;
|
|
2594
|
+
}
|
|
2595
|
+
/**
|
|
2596
|
+
* Substitute every keychain marker in a stored blob with its value. With no
|
|
2597
|
+
* keychain (no `ctx.secrets`) or no marker, the blob comes back unchanged.
|
|
2598
|
+
* An unresolvable value is LEFT OUT (never `''`), logged by ref — never by
|
|
2599
|
+
* value — and, when the cause can pass, retried with backoff. Nothing is
|
|
2600
|
+
* ever written back from here.
|
|
2601
|
+
*/
|
|
2602
|
+
async resolveStoredSecrets(blob, trackForConfig = true) {
|
|
2603
|
+
const secrets = this._ctx?.secrets;
|
|
2604
|
+
if (secrets === void 0) return blob;
|
|
2605
|
+
const refs = collectSecretMarkerRefs(blob);
|
|
2606
|
+
if (trackForConfig) this._configSecretRefs = new Set(refs);
|
|
2607
|
+
if (refs.length === 0) {
|
|
2608
|
+
if (trackForConfig) this._unresolvedSecrets = [];
|
|
2609
|
+
return blob;
|
|
2610
|
+
}
|
|
2611
|
+
const { value, unresolved } = await resolveSecretMarkers(blob, secrets);
|
|
2612
|
+
if (trackForConfig) {
|
|
2613
|
+
this._unresolvedSecrets = unresolved;
|
|
2614
|
+
if (unresolved.length > 0) {
|
|
2615
|
+
this._ctx?.logger?.error?.("secret unavailable — running without it, will retry", { meta: { secrets: unresolved.map((u) => ({
|
|
2616
|
+
ref: u.ref,
|
|
2617
|
+
reason: u.reason
|
|
2618
|
+
})) } });
|
|
2619
|
+
if (unresolved.some((u) => u.reason !== "missing" && u.reason !== "forbidden")) {
|
|
2620
|
+
this.scheduleSecretReresolve(this._secretRetryDelayMs);
|
|
2621
|
+
this._secretRetryDelayMs = Math.min(this._secretRetryDelayMs * 2, SECRET_RETRY_MAX_MS);
|
|
2622
|
+
}
|
|
2623
|
+
} else this._secretRetryDelayMs = SECRET_RETRY_FIRST_MS;
|
|
2624
|
+
}
|
|
2625
|
+
return value;
|
|
2626
|
+
}
|
|
2627
|
+
/** Re-resolve the config (a keychain-only change, or a retry) and apply it. */
|
|
2628
|
+
scheduleSecretReresolve(delayMs) {
|
|
2629
|
+
const timerOf = delayMs === SECRET_CHANGE_DEBOUNCE_MS ? "_secretChangeTimer" : "_secretRetryTimer";
|
|
2630
|
+
if (this[timerOf] !== null) return;
|
|
2631
|
+
const timer = setTimeout(() => {
|
|
2632
|
+
this[timerOf] = null;
|
|
2633
|
+
if (this._ctx === null) return;
|
|
2634
|
+
this.resolveConfig().then(() => this.onConfigChanged()).catch((err) => {
|
|
2635
|
+
this._ctx?.logger?.error?.("re-resolving secrets failed", { meta: { error: err instanceof Error ? err.message : String(err) } });
|
|
2636
|
+
});
|
|
2637
|
+
}, delayMs);
|
|
2638
|
+
timer.unref?.();
|
|
2639
|
+
this[timerOf] = timer;
|
|
2640
|
+
}
|
|
1820
2641
|
/**
|
|
1821
2642
|
* Wrap `ctx.settings.readAddonStore()` with a short retry budget so a
|
|
1822
2643
|
* transient settings-store outage (mid-restart of sqlite-settings, tsx-watch
|
|
@@ -1950,6 +2771,31 @@ var PeerBytesTicketSchema = zod.z.object({
|
|
|
1950
2771
|
*/
|
|
1951
2772
|
declaredBytes: zod.z.number().int().nonnegative().nullable()
|
|
1952
2773
|
});
|
|
2774
|
+
/**
|
|
2775
|
+
* One store per PROCESS, even when two copies of this module are loaded (an
|
|
2776
|
+
* addon bundle next to the framework's): keyed on a registered symbol.
|
|
2777
|
+
*/
|
|
2778
|
+
var STORE_KEY = Symbol.for("camstack.keychain.known-secrets");
|
|
2779
|
+
function store() {
|
|
2780
|
+
const existing = Reflect.get(globalThis, STORE_KEY);
|
|
2781
|
+
if (existing !== void 0 && existing !== null) return existing;
|
|
2782
|
+
const created = {
|
|
2783
|
+
values: /* @__PURE__ */ new Map(),
|
|
2784
|
+
compiled: null
|
|
2785
|
+
};
|
|
2786
|
+
Reflect.set(globalThis, STORE_KEY, created);
|
|
2787
|
+
return created;
|
|
2788
|
+
}
|
|
2789
|
+
/** Replace every registered value inside `text` with its label. */
|
|
2790
|
+
function scrubKnownSecrets(text) {
|
|
2791
|
+
const s = store();
|
|
2792
|
+
const re = s.compiled;
|
|
2793
|
+
if (re === null || text.length < 8) return text;
|
|
2794
|
+
re.lastIndex = 0;
|
|
2795
|
+
if (!re.test(text)) return text;
|
|
2796
|
+
re.lastIndex = 0;
|
|
2797
|
+
return text.replace(re, (match) => s.values.get(match) ?? "‹secret›");
|
|
2798
|
+
}
|
|
1953
2799
|
/** Shared Zod schemas used across streaming capabilities. */
|
|
1954
2800
|
var CamProfileSchema = zod.z.enum([
|
|
1955
2801
|
"high",
|
|
@@ -5778,53 +6624,6 @@ var DERIVED_CAMERA_SILENCED_CAP_NAMES = [
|
|
|
5778
6624
|
"scene-monitor"
|
|
5779
6625
|
];
|
|
5780
6626
|
/**
|
|
5781
|
-
* The value a redacted secret is replaced with on every read surface.
|
|
5782
|
-
*
|
|
5783
|
-
* It is also the WRITE-BACK token: an `upsertLocation` that sends this value
|
|
5784
|
-
* back for a key means "keep what is stored", which is what lets an operator
|
|
5785
|
-
* rename a location without retyping its password. A literal an operator could
|
|
5786
|
-
* plausibly choose as a real password would turn that convenience into a way
|
|
5787
|
-
* to lock yourself out, hence the sentinel shape.
|
|
5788
|
-
*/
|
|
5789
|
-
var REDACTED_SECRET = "__camstack_redacted__";
|
|
5790
|
-
/**
|
|
5791
|
-
* Every config key in `schema` whose value is a secret, including keys nested
|
|
5792
|
-
* inside `group` / `sub-tabs` containers.
|
|
5793
|
-
*/
|
|
5794
|
-
function collectSecretConfigKeys(schema) {
|
|
5795
|
-
const keys = /* @__PURE__ */ new Set();
|
|
5796
|
-
for (const section of sectionsOf(schema)) for (const field of fieldsOf(section)) walkField(field, keys);
|
|
5797
|
-
return keys;
|
|
5798
|
-
}
|
|
5799
|
-
function isRecord$3(value) {
|
|
5800
|
-
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
5801
|
-
}
|
|
5802
|
-
function sectionsOf(schema) {
|
|
5803
|
-
if (!isRecord$3(schema)) return [];
|
|
5804
|
-
const sections = schema["sections"];
|
|
5805
|
-
return Array.isArray(sections) ? sections : [];
|
|
5806
|
-
}
|
|
5807
|
-
function fieldsOf(node) {
|
|
5808
|
-
if (!isRecord$3(node)) return [];
|
|
5809
|
-
const fields = node["fields"];
|
|
5810
|
-
return Array.isArray(fields) ? fields : [];
|
|
5811
|
-
}
|
|
5812
|
-
function walkField(field, out) {
|
|
5813
|
-
if (!isRecord$3(field)) return;
|
|
5814
|
-
const type = field["type"];
|
|
5815
|
-
const key = field["key"];
|
|
5816
|
-
if ((type === "password" || field["secret"] === true) && typeof key === "string" && key.length > 0) out.add(key);
|
|
5817
|
-
if (type === "group") {
|
|
5818
|
-
for (const child of fieldsOf(field)) walkField(child, out);
|
|
5819
|
-
return;
|
|
5820
|
-
}
|
|
5821
|
-
if (type === "sub-tabs") {
|
|
5822
|
-
const tabs = field["tabs"];
|
|
5823
|
-
if (!Array.isArray(tabs)) return;
|
|
5824
|
-
for (const tab of tabs) for (const child of fieldsOf(tab)) walkField(child, out);
|
|
5825
|
-
}
|
|
5826
|
-
}
|
|
5827
|
-
/**
|
|
5828
6627
|
* What the gate decided about a birth, from the CALLER's point of view.
|
|
5829
6628
|
*
|
|
5830
6629
|
* Deliberately not `ConfirmationVerdict`: `undecided` is not a birth decision
|
|
@@ -14025,6 +14824,270 @@ id: zod.z.union([zod.z.string(), zod.z.number()]) }), {
|
|
|
14025
14824
|
})
|
|
14026
14825
|
}
|
|
14027
14826
|
};
|
|
14827
|
+
/**
|
|
14828
|
+
* `keychain` — the hub's encrypted store of secret values (D787).
|
|
14829
|
+
*
|
|
14830
|
+
* Settings blobs never hold a secret: they hold a marker
|
|
14831
|
+
* `{"$secret":"secret://<owner>/<scope>/<fieldPath>","v":1}` and the value
|
|
14832
|
+
* lives here, AES-256-GCM under a data key that a master key wraps. This cap
|
|
14833
|
+
* is the OWNER's door to its own values: every method is owner-checked
|
|
14834
|
+
* against the CALLER, never against anything the caller claims.
|
|
14835
|
+
*
|
|
14836
|
+
* Who the caller is: the transport stamps `callerAddonId` into the args of a
|
|
14837
|
+
* call that crossed a process (the parent `LocalChildRegistry` from the UDS
|
|
14838
|
+
* connection, the agent from its child's connection carried in
|
|
14839
|
+
* `$hub-cap-fwd`'s envelope). A stamp always overwrites; a wire call with no
|
|
14840
|
+
* stamp has its claim stripped. Only a hub in-process caller may state its own
|
|
14841
|
+
* identity — `ctx.secrets` does that with the addon id closed over. This is
|
|
14842
|
+
* identity against BUGS and misrouting, not against a malicious addon (every
|
|
14843
|
+
* runner is the same OS user): see the threat model in
|
|
14844
|
+
* `docs/design/2026-10-08-secrets-keychain.md`.
|
|
14845
|
+
*
|
|
14846
|
+
* `callerAddonId` is deliberately NOT in any input schema: the tRPC router
|
|
14847
|
+
* parses the input, so a session can never supply it, and the internal mount
|
|
14848
|
+
* floors every method to admin anyway (D240).
|
|
14849
|
+
*
|
|
14850
|
+
* Internal: addons reach it through `ctx.secrets`, never directly.
|
|
14851
|
+
*/
|
|
14852
|
+
/** Why a value cannot be served right now. Never folded into "missing". */
|
|
14853
|
+
var KeychainUnavailableReasonSchema = zod.z.enum([
|
|
14854
|
+
"key-missing",
|
|
14855
|
+
"wrong-key",
|
|
14856
|
+
"key-file-unreadable",
|
|
14857
|
+
"store-unavailable",
|
|
14858
|
+
"not-initialized",
|
|
14859
|
+
"decrypt-failed"
|
|
14860
|
+
]);
|
|
14861
|
+
var KeychainStateSchema = zod.z.discriminatedUnion("state", [zod.z.object({ state: zod.z.literal("ready") }), zod.z.object({
|
|
14862
|
+
state: zod.z.literal("locked"),
|
|
14863
|
+
reason: KeychainUnavailableReasonSchema
|
|
14864
|
+
})]);
|
|
14865
|
+
var KeychainResolveEntrySchema = zod.z.discriminatedUnion("kind", [
|
|
14866
|
+
zod.z.object({
|
|
14867
|
+
kind: zod.z.literal("value"),
|
|
14868
|
+
value: zod.z.string(),
|
|
14869
|
+
version: zod.z.number().int()
|
|
14870
|
+
}),
|
|
14871
|
+
zod.z.object({ kind: zod.z.literal("missing") }),
|
|
14872
|
+
zod.z.object({
|
|
14873
|
+
kind: zod.z.literal("unavailable"),
|
|
14874
|
+
reason: KeychainUnavailableReasonSchema
|
|
14875
|
+
}),
|
|
14876
|
+
zod.z.object({ kind: zod.z.literal("forbidden") })
|
|
14877
|
+
]);
|
|
14878
|
+
var KeychainResolveResultSchema = zod.z.record(zod.z.string(), KeychainResolveEntrySchema);
|
|
14879
|
+
/** Metadata of one stored value — never the value. */
|
|
14880
|
+
var KeychainSecretMetaSchema = zod.z.object({
|
|
14881
|
+
ref: zod.z.string(),
|
|
14882
|
+
owner: zod.z.string(),
|
|
14883
|
+
/** Formatted scope (`global`, `node/<id>`, `device/<id>`, …). */
|
|
14884
|
+
scope: zod.z.string(),
|
|
14885
|
+
fieldPath: zod.z.string(),
|
|
14886
|
+
version: zod.z.number().int(),
|
|
14887
|
+
createdAt: zod.z.number(),
|
|
14888
|
+
updatedAt: zod.z.number(),
|
|
14889
|
+
/** `addon:<id>` | `user:<id>` | `system`. */
|
|
14890
|
+
updatedBy: zod.z.string(),
|
|
14891
|
+
/** Coarse — written at most once an hour per ref. `null` = never read. */
|
|
14892
|
+
lastReadAt: zod.z.number().nullable()
|
|
14893
|
+
});
|
|
14894
|
+
var RefListSchema = zod.z.array(zod.z.string().min(1)).max(512);
|
|
14895
|
+
var keychainCapability = {
|
|
14896
|
+
name: "keychain",
|
|
14897
|
+
scope: "system",
|
|
14898
|
+
mode: "singleton",
|
|
14899
|
+
internal: true,
|
|
14900
|
+
methods: {
|
|
14901
|
+
/** Store (or replace) the caller's value at `ref`. Refused while locked. */
|
|
14902
|
+
put: method(zod.z.object({
|
|
14903
|
+
ref: zod.z.string().min(1),
|
|
14904
|
+
value: zod.z.string().min(1)
|
|
14905
|
+
}), zod.z.object({
|
|
14906
|
+
ref: zod.z.string(),
|
|
14907
|
+
version: zod.z.number().int()
|
|
14908
|
+
}), {
|
|
14909
|
+
kind: "mutation",
|
|
14910
|
+
auth: "admin"
|
|
14911
|
+
}),
|
|
14912
|
+
/**
|
|
14913
|
+
* Resolve the caller's refs in one round-trip. A locked keychain answers
|
|
14914
|
+
* `unavailable` per ref — never `missing`, never an empty value.
|
|
14915
|
+
*/
|
|
14916
|
+
resolve: method(zod.z.object({ refs: RefListSchema }), KeychainResolveResultSchema, { auth: "admin" }),
|
|
14917
|
+
/** Remove the caller's refs. Unknown refs are ignored. */
|
|
14918
|
+
delete: method(zod.z.object({ refs: RefListSchema }), zod.z.object({ deleted: zod.z.number().int() }), {
|
|
14919
|
+
kind: "mutation",
|
|
14920
|
+
auth: "admin"
|
|
14921
|
+
}),
|
|
14922
|
+
/** The caller's own refs, metadata only. */
|
|
14923
|
+
listMeta: method(zod.z.object({}), zod.z.array(KeychainSecretMetaSchema).readonly(), { auth: "admin" }),
|
|
14924
|
+
/** Whether values can be served — the save path refuses a write while locked. */
|
|
14925
|
+
getState: method(zod.z.object({}), KeychainStateSchema, { auth: "admin" })
|
|
14926
|
+
}
|
|
14927
|
+
};
|
|
14928
|
+
/**
|
|
14929
|
+
* `keychain-admin` — the operator's view of the keychain (System → Secrets).
|
|
14930
|
+
*
|
|
14931
|
+
* Every method is `admin`. Two methods hand out material, each audited and
|
|
14932
|
+
* each named for exactly that: {@link keychainAdminCapability.methods.reveal}
|
|
14933
|
+
* (one value, shown briefly by the UI) and `downloadRecoveryKey` (the master
|
|
14934
|
+
* key itself, so the operator can keep a copy off the hub). Nothing else
|
|
14935
|
+
* returns a value.
|
|
14936
|
+
*
|
|
14937
|
+
* The master key's LOCATION is configuration, never an env var (D788):
|
|
14938
|
+
* `keychain.keyFile` in `config.yaml`, the OS keychain on a desktop hub, else
|
|
14939
|
+
* `<dataDir>/.keychain/master.key` — which sits beside the database in every
|
|
14940
|
+
* whole-volume backup, and the status says so.
|
|
14941
|
+
*/
|
|
14942
|
+
/** Where the master key in use came from. */
|
|
14943
|
+
var KeychainKeySourceKindSchema = zod.z.enum([
|
|
14944
|
+
"config-file",
|
|
14945
|
+
"previous-config-file",
|
|
14946
|
+
"platform",
|
|
14947
|
+
"default-file"
|
|
14948
|
+
]);
|
|
14949
|
+
var KeychainKeySourceSchema = zod.z.object({
|
|
14950
|
+
kind: KeychainKeySourceKindSchema,
|
|
14951
|
+
/** File sources only — a path is not a secret. */
|
|
14952
|
+
path: zod.z.string().optional(),
|
|
14953
|
+
/**
|
|
14954
|
+
* True when a whole-volume backup of the data directory carries this key
|
|
14955
|
+
* next to the database it protects (the default file). The page warns.
|
|
14956
|
+
*/
|
|
14957
|
+
sharesBackupWithDatabase: zod.z.boolean()
|
|
14958
|
+
});
|
|
14959
|
+
var KeychainStatusSchema = zod.z.object({
|
|
14960
|
+
keychain: KeychainStateSchema,
|
|
14961
|
+
/** The source of the master key in use; `null` while locked. */
|
|
14962
|
+
keySource: KeychainKeySourceSchema.nullable(),
|
|
14963
|
+
/** The source configured to be primary — differs from `keySource` while a rotation is pending. */
|
|
14964
|
+
configuredSource: KeychainKeySourceSchema,
|
|
14965
|
+
/** Short fingerprint of the master key in use (`HMAC(KEK, label)`, 16 hex). */
|
|
14966
|
+
fingerprint: zod.z.string().nullable(),
|
|
14967
|
+
activeKeyId: zod.z.string().nullable(),
|
|
14968
|
+
/**
|
|
14969
|
+
* The keychain unlocked with a NON-primary source: the configured primary
|
|
14970
|
+
* key is not the one that wraps the data key yet. `rotateMasterKey` moves it.
|
|
14971
|
+
*/
|
|
14972
|
+
rotationPending: zod.z.boolean(),
|
|
14973
|
+
/** Wrapped copies of the data key under a previous master key, kept until purged. */
|
|
14974
|
+
retiredWraps: zod.z.number().int(),
|
|
14975
|
+
recoveryKeyDownloadedAt: zod.z.number().nullable(),
|
|
14976
|
+
secretCount: zod.z.number().int()
|
|
14977
|
+
});
|
|
14978
|
+
/**
|
|
14979
|
+
* Whether a stored value is still pointed at by its owner's settings.
|
|
14980
|
+
* `unknown` is a first-class answer: a scope whose blob could not be read is
|
|
14981
|
+
* never reported as an orphan (and never deleted as one).
|
|
14982
|
+
*/
|
|
14983
|
+
var KeychainSecretUsageSchema = zod.z.enum([
|
|
14984
|
+
"in-use",
|
|
14985
|
+
"orphan",
|
|
14986
|
+
"unknown"
|
|
14987
|
+
]);
|
|
14988
|
+
var KeychainAdminSecretSchema = KeychainSecretMetaSchema.extend({ usage: KeychainSecretUsageSchema });
|
|
14989
|
+
var KeychainAuditActionSchema = zod.z.enum([
|
|
14990
|
+
"put",
|
|
14991
|
+
"delete",
|
|
14992
|
+
"reveal",
|
|
14993
|
+
"rotate-master-key",
|
|
14994
|
+
"purge-retired-keys",
|
|
14995
|
+
"download-recovery-key",
|
|
14996
|
+
"delete-orphans",
|
|
14997
|
+
"reset",
|
|
14998
|
+
"initialize"
|
|
14999
|
+
]);
|
|
15000
|
+
var KeychainAuditEntrySchema = zod.z.object({
|
|
15001
|
+
id: zod.z.string(),
|
|
15002
|
+
at: zod.z.number(),
|
|
15003
|
+
action: KeychainAuditActionSchema,
|
|
15004
|
+
/** `addon:<id>` | `user:<id>` | `system`. */
|
|
15005
|
+
actor: zod.z.string(),
|
|
15006
|
+
ref: zod.z.string().nullable(),
|
|
15007
|
+
detail: zod.z.string().nullable()
|
|
15008
|
+
});
|
|
15009
|
+
var keychainAdminCapability = {
|
|
15010
|
+
name: "keychain-admin",
|
|
15011
|
+
scope: "system",
|
|
15012
|
+
mode: "singleton",
|
|
15013
|
+
methods: {
|
|
15014
|
+
status: method(zod.z.object({}), KeychainStatusSchema, { auth: "admin" }),
|
|
15015
|
+
listSecrets: method(zod.z.object({}), zod.z.array(KeychainAdminSecretSchema).readonly(), { auth: "admin" }),
|
|
15016
|
+
listAudit: method(zod.z.object({ limit: zod.z.number().int().min(1).max(500).optional() }), zod.z.array(KeychainAuditEntrySchema).readonly(), { auth: "admin" }),
|
|
15017
|
+
/**
|
|
15018
|
+
* Show one value to the operator. Audited. The UI hides it again after a
|
|
15019
|
+
* few seconds; nothing caches it.
|
|
15020
|
+
*/
|
|
15021
|
+
reveal: method(zod.z.object({ ref: zod.z.string().min(1) }), zod.z.object({
|
|
15022
|
+
value: zod.z.string(),
|
|
15023
|
+
version: zod.z.number().int()
|
|
15024
|
+
}), {
|
|
15025
|
+
kind: "mutation",
|
|
15026
|
+
auth: "admin",
|
|
15027
|
+
caller: "required"
|
|
15028
|
+
}),
|
|
15029
|
+
/** Delete refs no owner points at any more. Re-checked here; `unknown` is kept. */
|
|
15030
|
+
deleteOrphans: method(zod.z.object({ refs: zod.z.array(zod.z.string().min(1)).max(1e3) }), zod.z.object({
|
|
15031
|
+
deleted: zod.z.array(zod.z.string()).readonly(),
|
|
15032
|
+
kept: zod.z.array(zod.z.object({
|
|
15033
|
+
ref: zod.z.string(),
|
|
15034
|
+
usage: KeychainSecretUsageSchema
|
|
15035
|
+
})).readonly()
|
|
15036
|
+
}), {
|
|
15037
|
+
kind: "mutation",
|
|
15038
|
+
auth: "admin",
|
|
15039
|
+
caller: "required"
|
|
15040
|
+
}),
|
|
15041
|
+
/**
|
|
15042
|
+
* Wrap the data key under the configured primary master key.
|
|
15043
|
+
*
|
|
15044
|
+
* Pending rotation (the keychain unlocked with a previous source): re-wrap
|
|
15045
|
+
* under the primary. Otherwise, with the default file as primary: generate
|
|
15046
|
+
* a new master key, write it there, re-wrap. A file or OS-keychain primary
|
|
15047
|
+
* that is already in use cannot be replaced from here — put the new key at
|
|
15048
|
+
* the source, keep the old one as `keychain.previousKeyFile`, restart, and
|
|
15049
|
+
* rotate. No value is re-encrypted either way; the previous wrap is kept
|
|
15050
|
+
* (retired) until purged.
|
|
15051
|
+
*/
|
|
15052
|
+
rotateMasterKey: method(zod.z.object({}), zod.z.object({
|
|
15053
|
+
fingerprint: zod.z.string(),
|
|
15054
|
+
keySource: KeychainKeySourceSchema
|
|
15055
|
+
}), {
|
|
15056
|
+
kind: "mutation",
|
|
15057
|
+
auth: "admin",
|
|
15058
|
+
caller: "required"
|
|
15059
|
+
}),
|
|
15060
|
+
purgeRetiredKeys: method(zod.z.object({}), zod.z.object({ purged: zod.z.number().int() }), {
|
|
15061
|
+
kind: "mutation",
|
|
15062
|
+
auth: "admin",
|
|
15063
|
+
caller: "required"
|
|
15064
|
+
}),
|
|
15065
|
+
/** The master key, base64. Audited; marks the recovery copy as taken. */
|
|
15066
|
+
downloadRecoveryKey: method(zod.z.object({}), zod.z.object({
|
|
15067
|
+
key: zod.z.string(),
|
|
15068
|
+
fingerprint: zod.z.string(),
|
|
15069
|
+
keySource: KeychainKeySourceSchema
|
|
15070
|
+
}), {
|
|
15071
|
+
kind: "mutation",
|
|
15072
|
+
auth: "admin",
|
|
15073
|
+
caller: "required"
|
|
15074
|
+
}),
|
|
15075
|
+
/**
|
|
15076
|
+
* Lost-key recovery: archive every stored value into a
|
|
15077
|
+
* `keychain:secrets-orphaned-<ts>` table and start over with a new data
|
|
15078
|
+
* key. Every secret field then reads "not set". Requires the typed
|
|
15079
|
+
* confirmation {@link KEYCHAIN_RESET_CONFIRMATION}.
|
|
15080
|
+
*/
|
|
15081
|
+
resetKeychain: method(zod.z.object({ confirm: zod.z.literal("RESET KEYCHAIN") }), zod.z.object({
|
|
15082
|
+
archivedCollection: zod.z.string().nullable(),
|
|
15083
|
+
archived: zod.z.number().int()
|
|
15084
|
+
}), {
|
|
15085
|
+
kind: "mutation",
|
|
15086
|
+
auth: "admin",
|
|
15087
|
+
caller: "required"
|
|
15088
|
+
})
|
|
15089
|
+
}
|
|
15090
|
+
};
|
|
14028
15091
|
var decoderCapability = {
|
|
14029
15092
|
name: "decoder",
|
|
14030
15093
|
scope: "system",
|
|
@@ -15444,7 +16507,11 @@ var DeviceRegisterPayloadSchema = zod.z.object({
|
|
|
15444
16507
|
var DeviceRemovePayloadSchema = zod.z.object({ deviceId: zod.z.number() });
|
|
15445
16508
|
var DevicePersistConfigPayloadSchema = zod.z.object({
|
|
15446
16509
|
deviceId: zod.z.number(),
|
|
15447
|
-
data: zod.z.record(zod.z.string(), zod.z.unknown())
|
|
16510
|
+
data: zod.z.record(zod.z.string(), zod.z.unknown()),
|
|
16511
|
+
/** The paths the device's schema declares secret (D783), when the caller
|
|
16512
|
+
* knows them — those values are kept in the keychain, not the blob (D787).
|
|
16513
|
+
* Absent: the paths the device last reported at `registerDevice` apply. */
|
|
16514
|
+
secretConfigPaths: zod.z.array(zod.z.string()).optional()
|
|
15448
16515
|
});
|
|
15449
16516
|
/** What a migration actually did, per switch. `unreachable` is a first-class
|
|
15450
16517
|
* answer: a camera that could not be asked is not a camera that was silenced. */
|
|
@@ -24162,8 +25229,23 @@ var RetrainMacroClassSchema = zod.z.enum([
|
|
|
24162
25229
|
]);
|
|
24163
25230
|
/** A subject to learn, or a phantom to unlearn (taught by OMISSION). */
|
|
24164
25231
|
var RetrainAnnotationKindSchema = zod.z.enum(["subject", "model_error"]);
|
|
24165
|
-
/**
|
|
24166
|
-
|
|
25232
|
+
/**
|
|
25233
|
+
* Where a box came from. A machine-sourced box is a DRAFT on the page until
|
|
25234
|
+
* the operator confirms it; once saved it keeps its source as provenance.
|
|
25235
|
+
*
|
|
25236
|
+
* - `operator` — drawn by hand.
|
|
25237
|
+
* - `assist` — proposed by a detector run on the copy (the camera's own
|
|
25238
|
+
* model, or a larger teacher model).
|
|
25239
|
+
* - `pipeline` — the box the live pipeline actually drew on that frame, read
|
|
25240
|
+
* back from the track store (never a re-run).
|
|
25241
|
+
* - `llm` — proposed by a vision-capable LLM profile.
|
|
25242
|
+
*/
|
|
25243
|
+
var RetrainAnnotationSourceSchema = zod.z.enum([
|
|
25244
|
+
"operator",
|
|
25245
|
+
"assist",
|
|
25246
|
+
"pipeline",
|
|
25247
|
+
"llm"
|
|
25248
|
+
]);
|
|
24167
25249
|
/** Normalised `[0,1]` rectangle against the FULL frame — the canonical form. */
|
|
24168
25250
|
var RetrainBboxSchema = zod.z.object({
|
|
24169
25251
|
x: zod.z.number(),
|
|
@@ -24181,7 +25263,8 @@ var RetrainBboxSchema = zod.z.object({
|
|
|
24181
25263
|
*/
|
|
24182
25264
|
var RetrainAnnotationSchema = zod.z.object({
|
|
24183
25265
|
id: zod.z.string(),
|
|
24184
|
-
|
|
25266
|
+
/** The frame's track. Absent on a recording still, which has none. */
|
|
25267
|
+
trackId: zod.z.string().optional(),
|
|
24185
25268
|
deviceId: zod.z.number(),
|
|
24186
25269
|
/** The COPY in retrain storage — never the source track's media key. */
|
|
24187
25270
|
mediaKey: zod.z.string(),
|
|
@@ -24230,13 +25313,47 @@ var RetrainFrameCandidateSchema = zod.z.object({
|
|
|
24230
25313
|
* fail, whatever became of the original. */
|
|
24231
25314
|
copied: zod.z.boolean()
|
|
24232
25315
|
});
|
|
25316
|
+
/**
|
|
25317
|
+
* One box the live pipeline drew on a copied frame — what a correction starts
|
|
25318
|
+
* from. Derived when the frame is listed, from the track store: the subject
|
|
25319
|
+
* box recorded on the source media row when there is one, else the track
|
|
25320
|
+
* position nearest the frame's capture time. Never stored as an annotation
|
|
25321
|
+
* until the operator confirms it.
|
|
25322
|
+
*/
|
|
25323
|
+
var RetrainPipelineBoxSchema = zod.z.object({
|
|
25324
|
+
/** Normalised `[0,1]` against the full frame. */
|
|
25325
|
+
bbox: RetrainBboxSchema,
|
|
25326
|
+
macroClass: RetrainMacroClassSchema,
|
|
25327
|
+
label: zod.z.string().optional(),
|
|
25328
|
+
subLabel: zod.z.string().optional(),
|
|
25329
|
+
/** The detection score of the position used, when it was recorded. */
|
|
25330
|
+
score: zod.z.number().optional(),
|
|
25331
|
+
/** The root model that produced the track, when it was recorded. */
|
|
25332
|
+
modelId: zod.z.string().optional(),
|
|
25333
|
+
trackId: zod.z.string(),
|
|
25334
|
+
/** `subject-box`: recorded on this very frame. `position`: the track's
|
|
25335
|
+
* position nearest the capture time, `deltaMs` away. */
|
|
25336
|
+
basis: zod.z.enum(["subject-box", "position"]),
|
|
25337
|
+
deltaMs: zod.z.number()
|
|
25338
|
+
});
|
|
25339
|
+
/**
|
|
25340
|
+
* Where a retrain frame came from: a TRACK's stored media (copy-on-select),
|
|
25341
|
+
* or the RECORDING at an instant — the frame a model saw nothing in has no
|
|
25342
|
+
* track at all.
|
|
25343
|
+
*/
|
|
25344
|
+
var RetrainFrameOriginSchema = zod.z.enum(["track", "recording"]);
|
|
24233
25345
|
/** A frame the dataset OWNS: bytes copied at selection time. */
|
|
24234
25346
|
var RetrainFrameSchema = zod.z.object({
|
|
24235
25347
|
frameId: zod.z.string(),
|
|
24236
25348
|
deviceId: zod.z.number(),
|
|
24237
|
-
|
|
24238
|
-
/**
|
|
24239
|
-
|
|
25349
|
+
origin: RetrainFrameOriginSchema,
|
|
25350
|
+
/** The track it was copied from. Absent on a recording still. */
|
|
25351
|
+
trackId: zod.z.string().optional(),
|
|
25352
|
+
/** Provenance only. It may already point at nothing — that is expected.
|
|
25353
|
+
* Absent on a recording still. */
|
|
25354
|
+
sourceMediaId: zod.z.number().int().optional(),
|
|
25355
|
+
/** A recording still: the playhead instant it was taken at. */
|
|
25356
|
+
epochMs: zod.z.number().optional(),
|
|
24240
25357
|
sourceKind: MediaFileKindEnum,
|
|
24241
25358
|
sizeBytes: zod.z.number().int(),
|
|
24242
25359
|
width: zod.z.number().int(),
|
|
@@ -24247,7 +25364,12 @@ var RetrainFrameSchema = zod.z.object({
|
|
|
24247
25364
|
/** The operator's "every subject in this frame is boxed". Detector
|
|
24248
25365
|
* evaluation keeps only complete frames: an unboxed subject would count as
|
|
24249
25366
|
* a false positive. */
|
|
24250
|
-
complete: zod.z.boolean()
|
|
25367
|
+
complete: zod.z.boolean(),
|
|
25368
|
+
/** The boxes the pipeline drew on this frame. Present on list answers;
|
|
25369
|
+
* empty when nothing the track store holds can be placed on it. */
|
|
25370
|
+
pipelineBoxes: zod.z.array(RetrainPipelineBoxSchema).readonly().optional(),
|
|
25371
|
+
/** The named collections this frame belongs to. Present on list answers. */
|
|
25372
|
+
collectionIds: zod.z.array(zod.z.string()).readonly().optional()
|
|
24251
25373
|
});
|
|
24252
25374
|
/** Why a copy-on-select could not be honoured — named, never a silent skip. */
|
|
24253
25375
|
var RetrainCopyRefusalSchema = zod.z.enum([
|
|
@@ -24278,6 +25400,11 @@ var RetrainFrameListSchema = zod.z.object({
|
|
|
24278
25400
|
var RetrainExportFilterSchema = zod.z.object({
|
|
24279
25401
|
deviceIds: zod.z.array(zod.z.number()).optional(),
|
|
24280
25402
|
frameIds: zod.z.array(zod.z.string()).max(2e4).optional(),
|
|
25403
|
+
/** Only frames in at least one of these named collections. */
|
|
25404
|
+
collectionIds: zod.z.array(zod.z.string()).max(200).optional(),
|
|
25405
|
+
/** Exactly the frames of this dataset version (and its completeOnly). An
|
|
25406
|
+
* unknown id selects nothing. */
|
|
25407
|
+
datasetVersionId: zod.z.string().optional(),
|
|
24281
25408
|
batchId: zod.z.string().optional(),
|
|
24282
25409
|
/** Only frames the operator marked complete (all subjects boxed). */
|
|
24283
25410
|
completeOnly: zod.z.boolean().optional()
|
|
@@ -24342,6 +25469,170 @@ var RetrainAssistResultSchema = zod.z.discriminatedUnion("kind", [zod.z.object({
|
|
|
24342
25469
|
reason: zod.z.string(),
|
|
24343
25470
|
detail: zod.z.string().optional()
|
|
24344
25471
|
})]);
|
|
25472
|
+
/** A named set over the retrain corpus — membership only, it owns no pixels. */
|
|
25473
|
+
var RetrainCollectionSchema = zod.z.object({
|
|
25474
|
+
id: zod.z.string(),
|
|
25475
|
+
name: zod.z.string(),
|
|
25476
|
+
createdAt: zod.z.number(),
|
|
25477
|
+
frameCount: zod.z.number().int()
|
|
25478
|
+
});
|
|
25479
|
+
var RetrainCollectionCreateResultSchema = zod.z.discriminatedUnion("kind", [zod.z.object({
|
|
25480
|
+
kind: zod.z.literal("created"),
|
|
25481
|
+
collection: RetrainCollectionSchema
|
|
25482
|
+
}), zod.z.object({
|
|
25483
|
+
kind: zod.z.literal("refused"),
|
|
25484
|
+
reason: zod.z.enum(["empty-name", "duplicate-name"])
|
|
25485
|
+
})]);
|
|
25486
|
+
var RetrainCollectionRenameResultSchema = zod.z.discriminatedUnion("kind", [zod.z.object({
|
|
25487
|
+
kind: zod.z.literal("renamed"),
|
|
25488
|
+
collection: RetrainCollectionSchema
|
|
25489
|
+
}), zod.z.object({
|
|
25490
|
+
kind: zod.z.literal("refused"),
|
|
25491
|
+
reason: zod.z.enum([
|
|
25492
|
+
"empty-name",
|
|
25493
|
+
"duplicate-name",
|
|
25494
|
+
"unknown-collection"
|
|
25495
|
+
])
|
|
25496
|
+
})]);
|
|
25497
|
+
/**
|
|
25498
|
+
* The outcome of adding the frame at a recording instant. Every refusal is
|
|
25499
|
+
* named: `still-unavailable` (not recording, a gap, or an undecodable frame —
|
|
25500
|
+
* `detail` says which), `still-busy` (the recorder is at its decode bound; try
|
|
25501
|
+
* again), `unreadable-image`, `write-failed`, `unknown-collection`.
|
|
25502
|
+
*/
|
|
25503
|
+
var AddRetrainFrameFromRecordingResultSchema = zod.z.discriminatedUnion("kind", [zod.z.object({
|
|
25504
|
+
kind: zod.z.literal("added"),
|
|
25505
|
+
collectionId: zod.z.string(),
|
|
25506
|
+
frame: RetrainFrameSchema,
|
|
25507
|
+
/** The moment was already in the dataset; nothing was decoded. */
|
|
25508
|
+
reused: zod.z.boolean()
|
|
25509
|
+
}), zod.z.object({
|
|
25510
|
+
kind: zod.z.literal("refused"),
|
|
25511
|
+
reason: zod.z.enum([
|
|
25512
|
+
"unknown-collection",
|
|
25513
|
+
"still-unavailable",
|
|
25514
|
+
"still-busy",
|
|
25515
|
+
"unreadable-image",
|
|
25516
|
+
"write-failed"
|
|
25517
|
+
]),
|
|
25518
|
+
detail: zod.z.string().optional()
|
|
25519
|
+
})]);
|
|
25520
|
+
/** A vision LLM profile the AI assist may use, and where it sends the frame. */
|
|
25521
|
+
var RetrainAssistProfileSchema = zod.z.object({
|
|
25522
|
+
id: zod.z.string(),
|
|
25523
|
+
name: zod.z.string(),
|
|
25524
|
+
model: zod.z.string(),
|
|
25525
|
+
kind: zod.z.string(),
|
|
25526
|
+
/** `true` when the frame would leave the house (a cloud vendor, or an
|
|
25527
|
+
* endpoint that is not on the local network). The page confirms each such
|
|
25528
|
+
* run, and the provider refuses one without `allowCloud`. */
|
|
25529
|
+
leavesHouse: zod.z.boolean()
|
|
25530
|
+
});
|
|
25531
|
+
/** A box the AI assist proposed: a draft, plus the model's own reason. */
|
|
25532
|
+
var RetrainLlmProposalSchema = RetrainAnnotationDraftSchema.extend({ reason: zod.z.string() });
|
|
25533
|
+
/** What the AI assist said about a box that was already on the canvas. */
|
|
25534
|
+
var RetrainLlmReviewSchema = zod.z.object({
|
|
25535
|
+
/** The `ref` the page sent the box under. */
|
|
25536
|
+
ref: zod.z.string(),
|
|
25537
|
+
verdict: zod.z.enum([
|
|
25538
|
+
"confirmed",
|
|
25539
|
+
"wrong-class",
|
|
25540
|
+
"not-an-object",
|
|
25541
|
+
"uncertain"
|
|
25542
|
+
]),
|
|
25543
|
+
suggestedClass: RetrainMacroClassSchema.optional(),
|
|
25544
|
+
reason: zod.z.string()
|
|
25545
|
+
});
|
|
25546
|
+
/**
|
|
25547
|
+
* The AI assist's answer. `proposed` carries drafts (`source: 'llm'`, the
|
|
25548
|
+
* model and its confidence) and reviews; items the model got wrong (a box off
|
|
25549
|
+
* the frame, an unasked class, an unknown ref) are dropped and counted in
|
|
25550
|
+
* `rejected`. A whole answer that is not the schema is `malformed-answer`.
|
|
25551
|
+
*/
|
|
25552
|
+
var RetrainLlmAssistResultSchema = zod.z.discriminatedUnion("kind", [zod.z.object({
|
|
25553
|
+
kind: zod.z.literal("proposed"),
|
|
25554
|
+
profileId: zod.z.string(),
|
|
25555
|
+
model: zod.z.string(),
|
|
25556
|
+
/** The frame was sent outside the house for this answer. */
|
|
25557
|
+
leftHouse: zod.z.boolean(),
|
|
25558
|
+
proposals: zod.z.array(RetrainLlmProposalSchema).readonly(),
|
|
25559
|
+
reviews: zod.z.array(RetrainLlmReviewSchema).readonly(),
|
|
25560
|
+
rejected: zod.z.number().int()
|
|
25561
|
+
}), zod.z.object({
|
|
25562
|
+
kind: zod.z.literal("refused"),
|
|
25563
|
+
reason: zod.z.enum([
|
|
25564
|
+
"unknown-frame",
|
|
25565
|
+
"unreadable-frame",
|
|
25566
|
+
"unknown-profile",
|
|
25567
|
+
"profile-disabled",
|
|
25568
|
+
"no-vision",
|
|
25569
|
+
"cloud-not-confirmed",
|
|
25570
|
+
"llm-error",
|
|
25571
|
+
"malformed-answer"
|
|
25572
|
+
]),
|
|
25573
|
+
detail: zod.z.string().optional()
|
|
25574
|
+
})]);
|
|
25575
|
+
/** What a dataset version is cut from. Every field narrows. */
|
|
25576
|
+
var RetrainDatasetSelectionSchema = zod.z.object({
|
|
25577
|
+
deviceIds: zod.z.array(zod.z.number()).readonly().optional(),
|
|
25578
|
+
collectionIds: zod.z.array(zod.z.string()).max(200).readonly().optional(),
|
|
25579
|
+
frameIds: zod.z.array(zod.z.string()).max(2e4).readonly().optional()
|
|
25580
|
+
});
|
|
25581
|
+
/** The counts a dataset is judged by. */
|
|
25582
|
+
var RetrainDatasetStatsSchema = zod.z.object({
|
|
25583
|
+
frames: zod.z.number().int(),
|
|
25584
|
+
completeFrames: zod.z.number().int(),
|
|
25585
|
+
/** `completeFrames / frames`, 0..1. */
|
|
25586
|
+
completeness: zod.z.number(),
|
|
25587
|
+
/** Boxes to learn (model errors excluded). */
|
|
25588
|
+
subjects: zod.z.number().int(),
|
|
25589
|
+
modelErrors: zod.z.number().int(),
|
|
25590
|
+
/** Complete frames with no subject. */
|
|
25591
|
+
hardNegatives: zod.z.number().int(),
|
|
25592
|
+
/** Subjects per class × camera × day/night. */
|
|
25593
|
+
cells: zod.z.array(zod.z.object({
|
|
25594
|
+
macroClass: zod.z.string(),
|
|
25595
|
+
deviceId: zod.z.number(),
|
|
25596
|
+
lighting: zod.z.enum([
|
|
25597
|
+
"day",
|
|
25598
|
+
"night",
|
|
25599
|
+
"unknown"
|
|
25600
|
+
]),
|
|
25601
|
+
subjects: zod.z.number().int(),
|
|
25602
|
+
frames: zod.z.number().int()
|
|
25603
|
+
})).readonly(),
|
|
25604
|
+
cameras: zod.z.array(zod.z.object({
|
|
25605
|
+
deviceId: zod.z.number(),
|
|
25606
|
+
frames: zod.z.number().int(),
|
|
25607
|
+
completeFrames: zod.z.number().int()
|
|
25608
|
+
})).readonly()
|
|
25609
|
+
});
|
|
25610
|
+
/** An immutable dataset version, without its frame list. */
|
|
25611
|
+
var RetrainDatasetVersionSchema = zod.z.object({
|
|
25612
|
+
id: zod.z.string(),
|
|
25613
|
+
name: zod.z.string(),
|
|
25614
|
+
createdAt: zod.z.number(),
|
|
25615
|
+
selection: RetrainDatasetSelectionSchema,
|
|
25616
|
+
layout: RetrainExportLayoutSchema,
|
|
25617
|
+
completeOnly: zod.z.boolean(),
|
|
25618
|
+
frameCount: zod.z.number().int(),
|
|
25619
|
+
/** sha256 of what the frames taught when the version was frozen. */
|
|
25620
|
+
annotationHash: zod.z.string(),
|
|
25621
|
+
/** The export manifest schema the version was cut under. */
|
|
25622
|
+
manifestSchema: zod.z.string(),
|
|
25623
|
+
stats: RetrainDatasetStatsSchema
|
|
25624
|
+
});
|
|
25625
|
+
var CreateRetrainDatasetVersionResultSchema = zod.z.discriminatedUnion("kind", [zod.z.object({
|
|
25626
|
+
kind: zod.z.literal("created"),
|
|
25627
|
+
version: RetrainDatasetVersionSchema
|
|
25628
|
+
}), zod.z.object({
|
|
25629
|
+
kind: zod.z.literal("refused"),
|
|
25630
|
+
reason: zod.z.enum([
|
|
25631
|
+
"empty-name",
|
|
25632
|
+
"duplicate-name",
|
|
25633
|
+
"no-frames"
|
|
25634
|
+
])
|
|
25635
|
+
})]);
|
|
24345
25636
|
/** The outcome of a lifecycle move owned by the retrain page. */
|
|
24346
25637
|
var RetrainTransitionResultSchema = zod.z.object({
|
|
24347
25638
|
trackId: zod.z.string(),
|
|
@@ -25528,7 +26819,7 @@ var pipelineAnalyticsCapability = {
|
|
|
25528
26819
|
* a frame leaves the dataset before export. */
|
|
25529
26820
|
deselectRetrainFrame: method(zod.z.object({
|
|
25530
26821
|
deviceId: zod.z.number(),
|
|
25531
|
-
trackId: zod.z.string(),
|
|
26822
|
+
trackId: zod.z.string().optional(),
|
|
25532
26823
|
frameId: zod.z.string()
|
|
25533
26824
|
}), zod.z.object({
|
|
25534
26825
|
removed: zod.z.boolean(),
|
|
@@ -25571,7 +26862,8 @@ var pipelineAnalyticsCapability = {
|
|
|
25571
26862
|
*/
|
|
25572
26863
|
proposeRetrainAnnotations: method(zod.z.object({
|
|
25573
26864
|
deviceId: zod.z.number(),
|
|
25574
|
-
|
|
26865
|
+
/** The frame's track, when it has one — checked against the frame. */
|
|
26866
|
+
trackId: zod.z.string().optional(),
|
|
25575
26867
|
frameId: zod.z.string(),
|
|
25576
26868
|
subject: RetrainAssistSubjectSchema,
|
|
25577
26869
|
/** Which node runs it. Absent ⇒ wherever an unowned call lands. */
|
|
@@ -25580,8 +26872,12 @@ var pipelineAnalyticsCapability = {
|
|
|
25580
26872
|
kind: "mutation",
|
|
25581
26873
|
auth: "admin"
|
|
25582
26874
|
}),
|
|
25583
|
-
/** Every annotation on a track,
|
|
25584
|
-
|
|
26875
|
+
/** Every annotation on a track, or on named frames (a recording still has
|
|
26876
|
+
* no track), oldest first. One of the two is required. */
|
|
26877
|
+
listRetrainAnnotations: method(zod.z.object({
|
|
26878
|
+
trackId: zod.z.string().optional(),
|
|
26879
|
+
frameIds: zod.z.array(zod.z.string()).max(2e3).optional()
|
|
26880
|
+
}), zod.z.array(RetrainAnnotationSchema).readonly(), {
|
|
25585
26881
|
kind: "query",
|
|
25586
26882
|
auth: "admin"
|
|
25587
26883
|
}),
|
|
@@ -25600,7 +26896,8 @@ var pipelineAnalyticsCapability = {
|
|
|
25600
26896
|
*/
|
|
25601
26897
|
saveRetrainAnnotations: method(zod.z.object({
|
|
25602
26898
|
deviceId: zod.z.number(),
|
|
25603
|
-
|
|
26899
|
+
/** The frame's track, when it has one — checked against the frame. */
|
|
26900
|
+
trackId: zod.z.string().optional(),
|
|
25604
26901
|
frameId: zod.z.string(),
|
|
25605
26902
|
annotations: zod.z.array(RetrainAnnotationDraftSchema)
|
|
25606
26903
|
}), zod.z.array(RetrainAnnotationSchema).readonly(), {
|
|
@@ -25663,7 +26960,7 @@ var pipelineAnalyticsCapability = {
|
|
|
25663
26960
|
*/
|
|
25664
26961
|
setRetrainFrameComplete: method(zod.z.object({
|
|
25665
26962
|
deviceId: zod.z.number(),
|
|
25666
|
-
trackId: zod.z.string(),
|
|
26963
|
+
trackId: zod.z.string().optional(),
|
|
25667
26964
|
frameId: zod.z.string(),
|
|
25668
26965
|
complete: zod.z.boolean()
|
|
25669
26966
|
}), RetrainFrameSchema, {
|
|
@@ -25686,6 +26983,162 @@ var pipelineAnalyticsCapability = {
|
|
|
25686
26983
|
auth: "admin",
|
|
25687
26984
|
timeoutMs: 60 * 6e4
|
|
25688
26985
|
}),
|
|
26986
|
+
/** The counts a selection would freeze — class × camera × day/night,
|
|
26987
|
+
* completeness — without freezing anything. Index reads only. */
|
|
26988
|
+
previewRetrainDataset: method(zod.z.object({
|
|
26989
|
+
selection: RetrainDatasetSelectionSchema,
|
|
26990
|
+
completeOnly: zod.z.boolean().optional()
|
|
26991
|
+
}), RetrainDatasetStatsSchema, {
|
|
26992
|
+
kind: "query",
|
|
26993
|
+
auth: "admin"
|
|
26994
|
+
}),
|
|
26995
|
+
/**
|
|
26996
|
+
* Freeze a dataset version: the frames the selection yields (the same plan
|
|
26997
|
+
* the annotated export builds), the hash of what they teach, the export
|
|
26998
|
+
* parameters and the counts. Immutable — a different selection is a new
|
|
26999
|
+
* version. Export it with `getRetrainExportUrl({ datasetVersionId })`.
|
|
27000
|
+
*/
|
|
27001
|
+
createRetrainDatasetVersion: method(zod.z.object({
|
|
27002
|
+
name: zod.z.string().max(120),
|
|
27003
|
+
selection: RetrainDatasetSelectionSchema,
|
|
27004
|
+
layout: RetrainExportLayoutSchema,
|
|
27005
|
+
completeOnly: zod.z.boolean()
|
|
27006
|
+
}), CreateRetrainDatasetVersionResultSchema, {
|
|
27007
|
+
kind: "mutation",
|
|
27008
|
+
auth: "admin",
|
|
27009
|
+
timeoutMs: 12e4
|
|
27010
|
+
}),
|
|
27011
|
+
/** Every dataset version, newest first. */
|
|
27012
|
+
listRetrainDatasetVersions: method(zod.z.object({}), zod.z.array(RetrainDatasetVersionSchema).readonly(), {
|
|
27013
|
+
kind: "query",
|
|
27014
|
+
auth: "admin"
|
|
27015
|
+
}),
|
|
27016
|
+
/** Delete a version. Its frames stay in the dataset. */
|
|
27017
|
+
deleteRetrainDatasetVersion: method(zod.z.object({ id: zod.z.string() }), zod.z.object({ deleted: zod.z.boolean() }), {
|
|
27018
|
+
kind: "mutation",
|
|
27019
|
+
auth: "admin"
|
|
27020
|
+
}),
|
|
27021
|
+
/** Does the corpus still teach what the version froze? `missingFrames`
|
|
27022
|
+
* counts frames that left the dataset (or lost every box and tick). */
|
|
27023
|
+
verifyRetrainDatasetVersion: method(zod.z.object({ id: zod.z.string() }), zod.z.object({
|
|
27024
|
+
found: zod.z.boolean(),
|
|
27025
|
+
annotationHash: zod.z.string(),
|
|
27026
|
+
matches: zod.z.boolean(),
|
|
27027
|
+
missingFrames: zod.z.number().int()
|
|
27028
|
+
}), {
|
|
27029
|
+
kind: "query",
|
|
27030
|
+
auth: "admin",
|
|
27031
|
+
timeoutMs: 12e4
|
|
27032
|
+
}),
|
|
27033
|
+
/** The enabled, vision-capable LLM profiles, each saying whether a frame
|
|
27034
|
+
* sent to it leaves the house. */
|
|
27035
|
+
listRetrainAssistProfiles: method(zod.z.object({}), zod.z.array(RetrainAssistProfileSchema).readonly(), {
|
|
27036
|
+
kind: "query",
|
|
27037
|
+
auth: "admin"
|
|
27038
|
+
}),
|
|
27039
|
+
/**
|
|
27040
|
+
* Ask a vision LLM (the `llm` capability) about ONE copied frame: list the
|
|
27041
|
+
* objects of `classes` with boxes, and review the boxes already on the
|
|
27042
|
+
* canvas (sent by `ref`). Answers drafts (`source: 'llm'`) and reviews —
|
|
27043
|
+
* nothing is stored, nothing is accepted. A profile that sends the frame
|
|
27044
|
+
* outside the house is refused unless `allowCloud` says the operator
|
|
27045
|
+
* confirmed this run.
|
|
27046
|
+
*/
|
|
27047
|
+
proposeRetrainAnnotationsWithLlm: method(zod.z.object({
|
|
27048
|
+
deviceId: zod.z.number(),
|
|
27049
|
+
trackId: zod.z.string().optional(),
|
|
27050
|
+
frameId: zod.z.string(),
|
|
27051
|
+
profileId: zod.z.string(),
|
|
27052
|
+
classes: zod.z.array(RetrainMacroClassSchema).min(1),
|
|
27053
|
+
boxes: zod.z.array(zod.z.object({
|
|
27054
|
+
ref: zod.z.string(),
|
|
27055
|
+
bbox: RetrainBboxSchema,
|
|
27056
|
+
macroClass: RetrainMacroClassSchema,
|
|
27057
|
+
label: zod.z.string().optional()
|
|
27058
|
+
})).max(50),
|
|
27059
|
+
allowCloud: zod.z.boolean()
|
|
27060
|
+
}), RetrainLlmAssistResultSchema, {
|
|
27061
|
+
kind: "mutation",
|
|
27062
|
+
auth: "admin",
|
|
27063
|
+
timeoutMs: 18e4
|
|
27064
|
+
}),
|
|
27065
|
+
/**
|
|
27066
|
+
* Create a named collection — a set over the retrain corpus ("packages
|
|
27067
|
+
* porch night"). Names are unique case-insensitively and never empty;
|
|
27068
|
+
* both refusals are named.
|
|
27069
|
+
*/
|
|
27070
|
+
createRetrainCollection: method(zod.z.object({ name: zod.z.string().max(120) }), RetrainCollectionCreateResultSchema, {
|
|
27071
|
+
kind: "mutation",
|
|
27072
|
+
auth: "admin"
|
|
27073
|
+
}),
|
|
27074
|
+
/** Every collection, newest first, with its frame count. */
|
|
27075
|
+
listRetrainCollections: method(zod.z.object({}), zod.z.array(RetrainCollectionSchema).readonly(), {
|
|
27076
|
+
kind: "query",
|
|
27077
|
+
auth: "admin"
|
|
27078
|
+
}),
|
|
27079
|
+
renameRetrainCollection: method(zod.z.object({
|
|
27080
|
+
id: zod.z.string(),
|
|
27081
|
+
name: zod.z.string().max(120)
|
|
27082
|
+
}), RetrainCollectionRenameResultSchema, {
|
|
27083
|
+
kind: "mutation",
|
|
27084
|
+
auth: "admin"
|
|
27085
|
+
}),
|
|
27086
|
+
/**
|
|
27087
|
+
* Delete a collection. Its recording stills that no other collection
|
|
27088
|
+
* holds are deleted with their annotations (nothing else reaches them);
|
|
27089
|
+
* frames copied from tracks always stay in the dataset.
|
|
27090
|
+
*/
|
|
27091
|
+
deleteRetrainCollection: method(zod.z.object({ id: zod.z.string() }), zod.z.object({
|
|
27092
|
+
deleted: zod.z.boolean(),
|
|
27093
|
+
removedFrames: zod.z.number().int()
|
|
27094
|
+
}), {
|
|
27095
|
+
kind: "mutation",
|
|
27096
|
+
auth: "admin"
|
|
27097
|
+
}),
|
|
27098
|
+
/**
|
|
27099
|
+
* Add the frame at a recording instant to a collection — the frame the
|
|
27100
|
+
* model may have seen NOTHING in. The recorder re-decodes the native
|
|
27101
|
+
* frame at `epochMs`; the dataset copies it (trackless, durable). The same
|
|
27102
|
+
* moment twice is one copy. Every refusal is named.
|
|
27103
|
+
*/
|
|
27104
|
+
addRetrainFrameFromRecording: method(zod.z.object({
|
|
27105
|
+
collectionId: zod.z.string(),
|
|
27106
|
+
deviceId: zod.z.number(),
|
|
27107
|
+
epochMs: zod.z.number()
|
|
27108
|
+
}), AddRetrainFrameFromRecordingResultSchema, {
|
|
27109
|
+
kind: "mutation",
|
|
27110
|
+
auth: "admin",
|
|
27111
|
+
timeoutMs: 6e4
|
|
27112
|
+
}),
|
|
27113
|
+
/** Add frames already in the dataset to a collection. */
|
|
27114
|
+
addRetrainFramesToCollection: method(zod.z.object({
|
|
27115
|
+
collectionId: zod.z.string(),
|
|
27116
|
+
frameIds: zod.z.array(zod.z.string()).min(1).max(500)
|
|
27117
|
+
}), zod.z.object({
|
|
27118
|
+
added: zod.z.number().int(),
|
|
27119
|
+
alreadyMember: zod.z.number().int(),
|
|
27120
|
+
unknownFrameIds: zod.z.array(zod.z.string()).readonly()
|
|
27121
|
+
}), {
|
|
27122
|
+
kind: "mutation",
|
|
27123
|
+
auth: "admin"
|
|
27124
|
+
}),
|
|
27125
|
+
/** Remove a frame from a collection. A recording still left in no
|
|
27126
|
+
* collection is deleted with its annotations (`deletedFrame`). */
|
|
27127
|
+
removeRetrainFrameFromCollection: method(zod.z.object({
|
|
27128
|
+
collectionId: zod.z.string(),
|
|
27129
|
+
frameId: zod.z.string()
|
|
27130
|
+
}), zod.z.object({
|
|
27131
|
+
removed: zod.z.boolean(),
|
|
27132
|
+
deletedFrame: zod.z.boolean()
|
|
27133
|
+
}), {
|
|
27134
|
+
kind: "mutation",
|
|
27135
|
+
auth: "admin"
|
|
27136
|
+
}),
|
|
27137
|
+
/** The frames of a collection, with their pipeline boxes. */
|
|
27138
|
+
listRetrainCollectionFrames: method(zod.z.object({ collectionId: zod.z.string() }), zod.z.array(RetrainFrameSchema).readonly(), {
|
|
27139
|
+
kind: "query",
|
|
27140
|
+
auth: "admin"
|
|
27141
|
+
}),
|
|
25689
27142
|
/**
|
|
25690
27143
|
* The media an EVENT owns.
|
|
25691
27144
|
*
|
|
@@ -26626,13 +28079,31 @@ var RecommendationReasonSchema = zod.z.discriminatedUnion("kind", [
|
|
|
26626
28079
|
zod.z.object({
|
|
26627
28080
|
kind: zod.z.literal("no-family-build"),
|
|
26628
28081
|
format: ModelFormatSchema$1
|
|
28082
|
+
}),
|
|
28083
|
+
zod.z.object({
|
|
28084
|
+
kind: zod.z.literal("kept-custom-pin"),
|
|
28085
|
+
modelId: zod.z.string(),
|
|
28086
|
+
deviceKey: zod.z.string()
|
|
26629
28087
|
})
|
|
26630
28088
|
]);
|
|
28089
|
+
/** Why a device is left exactly as it is, whatever the plan would pick (D786). */
|
|
28090
|
+
var KeptReasonSchema = zod.z.enum(["custom-pin"]);
|
|
28091
|
+
/**
|
|
28092
|
+
* Where a choice's latency came from (D791): this node's own benchmark
|
|
28093
|
+
* result, or the hardware-class table. Measured on the node beats the table.
|
|
28094
|
+
*/
|
|
28095
|
+
var LatencySourceSchema = zod.z.discriminatedUnion("kind", [zod.z.object({ kind: zod.z.literal("table") }), zod.z.object({
|
|
28096
|
+
kind: zod.z.literal("node-benchmark"),
|
|
28097
|
+
resultId: zod.z.string(),
|
|
28098
|
+
measuredAtMs: zod.z.number()
|
|
28099
|
+
})]);
|
|
26631
28100
|
var DeviceModelChoiceSchema = zod.z.object({
|
|
26632
28101
|
modelId: zod.z.string(),
|
|
26633
28102
|
p50Ms: zod.z.number(),
|
|
26634
28103
|
fps: zod.z.number(),
|
|
26635
28104
|
measured: zod.z.boolean(),
|
|
28105
|
+
/** Absent on a plan from before D791 — read as the table. */
|
|
28106
|
+
source: LatencySourceSchema.optional(),
|
|
26636
28107
|
/** Parallel sessions at the camera rate with the headroom kept free: ⌊fps × (1 − headroom) / camera fps⌋. */
|
|
26637
28108
|
capacitySessions: zod.z.number(),
|
|
26638
28109
|
personRecall: zod.z.number()
|
|
@@ -26643,6 +28114,8 @@ var DeviceRecommendationSchema = zod.z.object({
|
|
|
26643
28114
|
enabled: zod.z.boolean(),
|
|
26644
28115
|
available: zod.z.boolean(),
|
|
26645
28116
|
chosen: DeviceModelChoiceSchema.nullable(),
|
|
28117
|
+
/** Present when the device is kept as is: Apply writes nothing on it. */
|
|
28118
|
+
kept: KeptReasonSchema.optional(),
|
|
26646
28119
|
reasons: zod.z.array(RecommendationReasonSchema).readonly()
|
|
26647
28120
|
});
|
|
26648
28121
|
var NodeRecommendationSchema = zod.z.object({
|
|
@@ -26696,6 +28169,17 @@ var AutoTuneWarningSchema = zod.z.discriminatedUnion("kind", [
|
|
|
26696
28169
|
kind: zod.z.literal("coral-enabled"),
|
|
26697
28170
|
nodeId: zod.z.string(),
|
|
26698
28171
|
deviceKey: zod.z.string()
|
|
28172
|
+
}),
|
|
28173
|
+
zod.z.object({
|
|
28174
|
+
kind: zod.z.literal("custom-pin-kept"),
|
|
28175
|
+
nodeId: zod.z.string(),
|
|
28176
|
+
deviceKey: zod.z.string().nullable(),
|
|
28177
|
+
deviceId: zod.z.number().nullable(),
|
|
28178
|
+
modelId: zod.z.string()
|
|
28179
|
+
}),
|
|
28180
|
+
zod.z.object({
|
|
28181
|
+
kind: zod.z.literal("custom-registry-unreadable"),
|
|
28182
|
+
error: zod.z.string()
|
|
26699
28183
|
})
|
|
26700
28184
|
]);
|
|
26701
28185
|
var AutoTuneOptionsSchema = zod.z.object({
|
|
@@ -26874,13 +28358,14 @@ var SuggestSharesResultSchema = zod.z.object({
|
|
|
26874
28358
|
nodes: zod.z.array(SuggestedNodeShareSchema).readonly()
|
|
26875
28359
|
});
|
|
26876
28360
|
/**
|
|
26877
|
-
* Where the node and device shares come from (D750, D755).
|
|
26878
|
-
* - `
|
|
26879
|
-
*
|
|
26880
|
-
*
|
|
26881
|
-
*
|
|
26882
|
-
*
|
|
26883
|
-
*
|
|
28361
|
+
* Where the node and device shares come from (D750, D755, D791).
|
|
28362
|
+
* - `benchmark` (default since D791) — each node's capacity as its own node
|
|
28363
|
+
* benchmark measured it; a node without fresh results is sized from
|
|
28364
|
+
* `hardware` and says so. Measured on the node beats the table.
|
|
28365
|
+
* - `hardware` — computed from each node's static capacity only (its
|
|
28366
|
+
* accelerators at their Auto tune models, from the latency table).
|
|
28367
|
+
* Both are recomputed whenever a node or device joins, leaves, is switched
|
|
28368
|
+
* on or off, changes model, or a benchmark result is written. No load input.
|
|
26884
28369
|
* - `manual` — the operator's stored sliders.
|
|
26885
28370
|
* Either way a node or device that cannot take sessions gives its share to
|
|
26886
28371
|
* the others in proportion; the stored values are never rewritten for that.
|
|
@@ -26929,6 +28414,368 @@ var EffectiveSharesSchema = zod.z.object({
|
|
|
26929
28414
|
nodeWeights: zod.z.record(zod.z.string(), zod.z.number()),
|
|
26930
28415
|
deviceWeights: zod.z.record(zod.z.string(), zod.z.record(zod.z.string(), zod.z.number()))
|
|
26931
28416
|
});
|
|
28417
|
+
/**
|
|
28418
|
+
* Wire shapes of the node benchmark (D791): the operator's plan, the
|
|
28419
|
+
* preflight the confirmation shows, the run the orchestrator owns, what the
|
|
28420
|
+
* measuring runner reports, and the result rows Auto tune and the automatic
|
|
28421
|
+
* shares read.
|
|
28422
|
+
*
|
|
28423
|
+
* ONE node at a time, owned by the pipeline orchestrator. While a run is
|
|
28424
|
+
* active the cluster is in BENCHMARK MODE for that node: it is not a
|
|
28425
|
+
* detection candidate, camera pins naming it are ignored so its sessions move
|
|
28426
|
+
* elsewhere, and both come back when the mode ends — after a crash or a hub
|
|
28427
|
+
* restart too (a persisted manifest, reconciled against the registry).
|
|
28428
|
+
*
|
|
28429
|
+
* Two measurements, both on the node, driven by its own runner (frames never
|
|
28430
|
+
* cross a process at frame rate, D9):
|
|
28431
|
+
* - `device` — one accelerator × one candidate detector, root only, open
|
|
28432
|
+
* loop: how many streams at the camera rate it carries inside the frame
|
|
28433
|
+
* interval;
|
|
28434
|
+
* - `pipeline` — the chosen detector plus the operator's detail steps
|
|
28435
|
+
* (faces, plates, classifiers, CLIP…), on varied frames from the bench
|
|
28436
|
+
* clip: how many parallel sessions the node carries before latency, drops,
|
|
28437
|
+
* CPU, RAM or the event loop give out.
|
|
28438
|
+
*/
|
|
28439
|
+
/** Defaults and bounds, one place. */
|
|
28440
|
+
var NODE_BENCHMARK_DEFAULTS = {
|
|
28441
|
+
fpsPerStream: 10,
|
|
28442
|
+
budgetMinutes: 45,
|
|
28443
|
+
minBudgetMinutes: 10,
|
|
28444
|
+
maxBudgetMinutes: 120,
|
|
28445
|
+
/** A result older than this no longer beats the table. */
|
|
28446
|
+
staleAfterDays: 30,
|
|
28447
|
+
/** Warm-in per ramp step (not accounted). */
|
|
28448
|
+
settleSec: 5,
|
|
28449
|
+
/** Accounted window per ramp step. */
|
|
28450
|
+
measureSec: 20,
|
|
28451
|
+
/** Longest the drain may take before the run is refused. */
|
|
28452
|
+
drainTimeoutSec: 120,
|
|
28453
|
+
/** Candidate models per device in one run. */
|
|
28454
|
+
maxModelsPerDevice: 6
|
|
28455
|
+
};
|
|
28456
|
+
/** The two measurements a run can make. */
|
|
28457
|
+
var NodeBenchmarkPhaseSchema = zod.z.enum(["device", "pipeline"]);
|
|
28458
|
+
var NodeBenchmarkDevicePlanSchema = zod.z.object({
|
|
28459
|
+
/** `<backend>:<device>` — `openvino:npu`, `coreml:all`, `cpu`. */
|
|
28460
|
+
deviceKey: zod.z.string().min(1),
|
|
28461
|
+
/**
|
|
28462
|
+
* Root detector candidates for the `device` measurement, in the order
|
|
28463
|
+
* measured. The FIRST is the one the `pipeline` measurement runs.
|
|
28464
|
+
*/
|
|
28465
|
+
modelIds: zod.z.array(zod.z.string().min(1)).min(1).max(NODE_BENCHMARK_DEFAULTS.maxModelsPerDevice)
|
|
28466
|
+
});
|
|
28467
|
+
/** What the operator confirmed. */
|
|
28468
|
+
var NodeBenchmarkPlanSchema = zod.z.object({
|
|
28469
|
+
nodeId: zod.z.string().min(1),
|
|
28470
|
+
devices: zod.z.array(NodeBenchmarkDevicePlanSchema).min(1),
|
|
28471
|
+
/** Which measurements run. At least one. */
|
|
28472
|
+
phases: zod.z.array(NodeBenchmarkPhaseSchema).min(1).default(["device", "pipeline"]),
|
|
28473
|
+
/**
|
|
28474
|
+
* Detail steps (catalog step ids under the root: faces, plates,
|
|
28475
|
+
* classifiers, CLIP…) the `pipeline` measurement enables. The root
|
|
28476
|
+
* detector always runs.
|
|
28477
|
+
*/
|
|
28478
|
+
steps: zod.z.array(zod.z.string().min(1)).default([]),
|
|
28479
|
+
/** Offered rate of one stream / session. */
|
|
28480
|
+
fpsPerStream: zod.z.number().int().min(1).max(30).default(NODE_BENCHMARK_DEFAULTS.fpsPerStream),
|
|
28481
|
+
/** Hard deadline: the mode ends and the cluster is restored when it passes. */
|
|
28482
|
+
budgetMinutes: zod.z.number().int().min(NODE_BENCHMARK_DEFAULTS.minBudgetMinutes).max(NODE_BENCHMARK_DEFAULTS.maxBudgetMinutes).default(NODE_BENCHMARK_DEFAULTS.budgetMinutes),
|
|
28483
|
+
/** Keep the models the run downloaded (default: delete what was not installed before). */
|
|
28484
|
+
keepDownloadedModels: zod.z.boolean().default(false),
|
|
28485
|
+
/** Start although the other nodes' capacity does not cover the sessions running now. */
|
|
28486
|
+
acceptInsufficientHeadroom: zod.z.boolean().default(false)
|
|
28487
|
+
});
|
|
28488
|
+
/** Why a run cannot start. `overridable` ones are lifted by a plan flag. */
|
|
28489
|
+
var NodeBenchmarkRefusalKindSchema = zod.z.enum([
|
|
28490
|
+
"benchmark-active",
|
|
28491
|
+
"node-offline",
|
|
28492
|
+
"unknown-device",
|
|
28493
|
+
"no-phase",
|
|
28494
|
+
"insufficient-headroom"
|
|
28495
|
+
]);
|
|
28496
|
+
var NodeBenchmarkRefusalSchema = zod.z.object({
|
|
28497
|
+
kind: NodeBenchmarkRefusalKindSchema,
|
|
28498
|
+
detail: zod.z.string(),
|
|
28499
|
+
overridable: zod.z.boolean()
|
|
28500
|
+
});
|
|
28501
|
+
/** A camera whose detection leaves the node for the run. */
|
|
28502
|
+
var NodeBenchmarkMovingCameraSchema = zod.z.object({
|
|
28503
|
+
deviceId: zod.z.number(),
|
|
28504
|
+
/** Placed on the node now (a standing attach or a running session). */
|
|
28505
|
+
placedOnNode: zod.z.boolean(),
|
|
28506
|
+
/** A node pin naming this node, ignored for the run. */
|
|
28507
|
+
pinnedToNode: zod.z.boolean()
|
|
28508
|
+
});
|
|
28509
|
+
/** A camera that cannot leave: no other node can obtain its frames. */
|
|
28510
|
+
var NodeBenchmarkStayingCameraSchema = zod.z.object({
|
|
28511
|
+
deviceId: zod.z.number(),
|
|
28512
|
+
reason: zod.z.literal("only-frame-source")
|
|
28513
|
+
});
|
|
28514
|
+
var NodeBenchmarkPreflightSchema = zod.z.object({
|
|
28515
|
+
nodeId: zod.z.string(),
|
|
28516
|
+
online: zod.z.boolean(),
|
|
28517
|
+
moving: zod.z.array(NodeBenchmarkMovingCameraSchema).readonly(),
|
|
28518
|
+
/** Keep running on the node during the run; the result is flagged contaminated. */
|
|
28519
|
+
staying: zod.z.array(NodeBenchmarkStayingCameraSchema).readonly(),
|
|
28520
|
+
estimatedDurationMs: zod.z.number(),
|
|
28521
|
+
/** The run ends and the cluster is restored at the latest after this long. */
|
|
28522
|
+
budgetMs: zod.z.number(),
|
|
28523
|
+
phases: zod.z.array(NodeBenchmarkPhaseSchema).readonly(),
|
|
28524
|
+
steps: zod.z.array(zod.z.string()).readonly(),
|
|
28525
|
+
devices: zod.z.array(NodeBenchmarkDevicePlanSchema).readonly(),
|
|
28526
|
+
/** Parallel sessions the cluster runs now, and what the other nodes can carry. */
|
|
28527
|
+
headroom: zod.z.object({
|
|
28528
|
+
sessionsNow: zod.z.number(),
|
|
28529
|
+
otherNodesCapacitySessions: zod.z.number().nullable()
|
|
28530
|
+
}),
|
|
28531
|
+
refusals: zod.z.array(NodeBenchmarkRefusalSchema).readonly(),
|
|
28532
|
+
canStart: zod.z.boolean()
|
|
28533
|
+
});
|
|
28534
|
+
/** Where the measuring runner is. */
|
|
28535
|
+
var NodeBenchProgressSchema = zod.z.object({
|
|
28536
|
+
phase: zod.z.enum([
|
|
28537
|
+
"preparing",
|
|
28538
|
+
"device",
|
|
28539
|
+
"pipeline",
|
|
28540
|
+
"cleanup"
|
|
28541
|
+
]),
|
|
28542
|
+
deviceKey: zod.z.string().nullable(),
|
|
28543
|
+
modelId: zod.z.string().nullable(),
|
|
28544
|
+
/** Streams (device) or sessions (pipeline) of the step running now. */
|
|
28545
|
+
load: zod.z.number().nullable(),
|
|
28546
|
+
cellsDone: zod.z.number(),
|
|
28547
|
+
cellsTotal: zod.z.number(),
|
|
28548
|
+
message: zod.z.string()
|
|
28549
|
+
});
|
|
28550
|
+
/** What limited a ramp. `none` = the ramp ran out of steps still passing. */
|
|
28551
|
+
var NodeBenchLimitSchema = zod.z.enum([
|
|
28552
|
+
"p95",
|
|
28553
|
+
"drops",
|
|
28554
|
+
"errors",
|
|
28555
|
+
"stall",
|
|
28556
|
+
"cpu",
|
|
28557
|
+
"ram",
|
|
28558
|
+
"none"
|
|
28559
|
+
]);
|
|
28560
|
+
var NodeBenchRampStepSchema = zod.z.object({
|
|
28561
|
+
load: zod.z.number(),
|
|
28562
|
+
pass: zod.z.boolean(),
|
|
28563
|
+
p95Ms: zod.z.number(),
|
|
28564
|
+
dropRatio: zod.z.number(),
|
|
28565
|
+
/** Completed frames per second over the accounted window. */
|
|
28566
|
+
fps: zod.z.number(),
|
|
28567
|
+
cpuPct: zod.z.number().nullable(),
|
|
28568
|
+
ramFreePct: zod.z.number().nullable(),
|
|
28569
|
+
failReasons: zod.z.array(zod.z.string()).readonly()
|
|
28570
|
+
});
|
|
28571
|
+
/** One measured device × detector (the `device` measurement). */
|
|
28572
|
+
var NodeBenchDeviceCellSchema = zod.z.object({
|
|
28573
|
+
phase: zod.z.literal("device"),
|
|
28574
|
+
deviceKey: zod.z.string(),
|
|
28575
|
+
modelId: zod.z.string(),
|
|
28576
|
+
/** Single-stream latency (the K = 1 step). */
|
|
28577
|
+
p50Ms: zod.z.number(),
|
|
28578
|
+
p95Ms: zod.z.number(),
|
|
28579
|
+
p99Ms: zod.z.number(),
|
|
28580
|
+
/** Frames per second sustained at the last passing step. */
|
|
28581
|
+
fps: zod.z.number(),
|
|
28582
|
+
/** Streams at the camera rate the device carried inside the frame interval; 0 = not even one. */
|
|
28583
|
+
kMax: zod.z.number(),
|
|
28584
|
+
limitedBy: NodeBenchLimitSchema,
|
|
28585
|
+
/** First call (model load + warm-up). */
|
|
28586
|
+
warmupMs: zod.z.number(),
|
|
28587
|
+
ramp: zod.z.array(NodeBenchRampStepSchema).readonly()
|
|
28588
|
+
});
|
|
28589
|
+
/** One measured pipeline (the `pipeline` measurement) on a device. */
|
|
28590
|
+
var NodeBenchPipelineCellSchema = zod.z.object({
|
|
28591
|
+
phase: zod.z.literal("pipeline"),
|
|
28592
|
+
deviceKey: zod.z.string(),
|
|
28593
|
+
modelId: zod.z.string(),
|
|
28594
|
+
steps: zod.z.array(zod.z.string()).readonly(),
|
|
28595
|
+
/** Parallel sessions at the camera rate the node carried; 0 = not even one. */
|
|
28596
|
+
maxSessions: zod.z.number(),
|
|
28597
|
+
limitedBy: NodeBenchLimitSchema,
|
|
28598
|
+
/** Detail steps that produced at least one result on the clip — a step that never fired measured nothing. */
|
|
28599
|
+
stepsFired: zod.z.array(zod.z.string()).readonly(),
|
|
28600
|
+
warmupMs: zod.z.number(),
|
|
28601
|
+
ramp: zod.z.array(NodeBenchRampStepSchema).readonly()
|
|
28602
|
+
});
|
|
28603
|
+
var NodeBenchCellSchema = zod.z.discriminatedUnion("phase", [NodeBenchDeviceCellSchema, NodeBenchPipelineCellSchema]);
|
|
28604
|
+
/**
|
|
28605
|
+
* What a result was measured ON. A result whose fingerprint no longer matches
|
|
28606
|
+
* the node no longer beats the table.
|
|
28607
|
+
*/
|
|
28608
|
+
var NodeBenchFingerprintSchema = zod.z.object({
|
|
28609
|
+
pipelineVersion: zod.z.string().nullable(),
|
|
28610
|
+
cpuModel: zod.z.string().nullable(),
|
|
28611
|
+
ramGb: zod.z.number().nullable(),
|
|
28612
|
+
os: zod.z.string().nullable(),
|
|
28613
|
+
/** Per device: the pool the cells ran on (runtime + tuning). */
|
|
28614
|
+
pools: zod.z.record(zod.z.string(), zod.z.object({
|
|
28615
|
+
runtime: zod.z.string(),
|
|
28616
|
+
numWorkers: zod.z.number(),
|
|
28617
|
+
concurrency: zod.z.number(),
|
|
28618
|
+
batchMode: zod.z.string()
|
|
28619
|
+
})).default({})
|
|
28620
|
+
});
|
|
28621
|
+
/** The frames the run used. */
|
|
28622
|
+
var NodeBenchClipSchema = zod.z.object({
|
|
28623
|
+
/** `camstack-bench-v1` or `reference-images` (the fallback when the clip is not reachable). */
|
|
28624
|
+
id: zod.z.string(),
|
|
28625
|
+
revision: zod.z.string().nullable(),
|
|
28626
|
+
frames: zod.z.number(),
|
|
28627
|
+
width: zod.z.number(),
|
|
28628
|
+
height: zod.z.number()
|
|
28629
|
+
});
|
|
28630
|
+
var NodeBenchRunnerInputSchema = zod.z.object({
|
|
28631
|
+
runId: zod.z.string().min(1),
|
|
28632
|
+
devices: zod.z.array(NodeBenchmarkDevicePlanSchema).min(1),
|
|
28633
|
+
phases: zod.z.array(NodeBenchmarkPhaseSchema).min(1),
|
|
28634
|
+
/** The full detail step tree root for the `pipeline` measurement is built on the node from these ids. */
|
|
28635
|
+
steps: zod.z.array(zod.z.string()).default([]),
|
|
28636
|
+
fpsPerStream: zod.z.number().int().min(1).max(30),
|
|
28637
|
+
/** The runner stops on its own past this instant, whatever the hub does. */
|
|
28638
|
+
deadlineAtMs: zod.z.number(),
|
|
28639
|
+
settleSec: zod.z.number().min(0).max(60).default(NODE_BENCHMARK_DEFAULTS.settleSec),
|
|
28640
|
+
measureSec: zod.z.number().min(2).max(300).default(NODE_BENCHMARK_DEFAULTS.measureSec),
|
|
28641
|
+
keepDownloadedModels: zod.z.boolean().default(false)
|
|
28642
|
+
});
|
|
28643
|
+
var NodeBenchRunnerStateSchema = zod.z.enum([
|
|
28644
|
+
"running",
|
|
28645
|
+
"done",
|
|
28646
|
+
"failed",
|
|
28647
|
+
"aborted"
|
|
28648
|
+
]);
|
|
28649
|
+
var NodeBenchRunnerStatusSchema = zod.z.object({
|
|
28650
|
+
runId: zod.z.string(),
|
|
28651
|
+
nodeId: zod.z.string(),
|
|
28652
|
+
state: NodeBenchRunnerStateSchema,
|
|
28653
|
+
progress: NodeBenchProgressSchema.nullable(),
|
|
28654
|
+
/** Every finished cell so far — a run stopped half way keeps what it measured. */
|
|
28655
|
+
cells: zod.z.array(NodeBenchCellSchema).readonly(),
|
|
28656
|
+
fingerprint: NodeBenchFingerprintSchema.nullable(),
|
|
28657
|
+
clip: NodeBenchClipSchema.nullable(),
|
|
28658
|
+
/** Cameras seen running on the node during the run (they share its pools). */
|
|
28659
|
+
activeCameraIds: zod.z.array(zod.z.number()).readonly(),
|
|
28660
|
+
/** Models the run downloaded and then deleted (not installed before). */
|
|
28661
|
+
deletedModels: zod.z.array(zod.z.string()).readonly(),
|
|
28662
|
+
error: zod.z.string().nullable(),
|
|
28663
|
+
startedAtMs: zod.z.number(),
|
|
28664
|
+
finishedAtMs: zod.z.number().nullable()
|
|
28665
|
+
});
|
|
28666
|
+
var NodeBenchmarkStateSchema = zod.z.enum([
|
|
28667
|
+
"draining",
|
|
28668
|
+
"measuring",
|
|
28669
|
+
"restoring",
|
|
28670
|
+
"done",
|
|
28671
|
+
"failed",
|
|
28672
|
+
"aborted"
|
|
28673
|
+
]);
|
|
28674
|
+
/** Why a run ended. */
|
|
28675
|
+
var NodeBenchmarkEndReasonSchema = zod.z.enum([
|
|
28676
|
+
"completed",
|
|
28677
|
+
"operator-abort",
|
|
28678
|
+
"deadline",
|
|
28679
|
+
"node-lost",
|
|
28680
|
+
"runner-lost",
|
|
28681
|
+
"hub-restart",
|
|
28682
|
+
"drain-timeout",
|
|
28683
|
+
"failed"
|
|
28684
|
+
]);
|
|
28685
|
+
var NodeBenchmarkRunSchema = zod.z.object({
|
|
28686
|
+
runId: zod.z.string(),
|
|
28687
|
+
nodeId: zod.z.string(),
|
|
28688
|
+
state: NodeBenchmarkStateSchema,
|
|
28689
|
+
plan: NodeBenchmarkPlanSchema,
|
|
28690
|
+
startedAtMs: zod.z.number(),
|
|
28691
|
+
deadlineAtMs: zod.z.number(),
|
|
28692
|
+
finishedAtMs: zod.z.number().nullable(),
|
|
28693
|
+
endReason: NodeBenchmarkEndReasonSchema.nullable(),
|
|
28694
|
+
error: zod.z.string().nullable(),
|
|
28695
|
+
/** Cameras moved off the node for the run. */
|
|
28696
|
+
moved: zod.z.array(zod.z.number()).readonly(),
|
|
28697
|
+
/** Cameras that stayed (their only frame source is the node). */
|
|
28698
|
+
staying: zod.z.array(zod.z.number()).readonly(),
|
|
28699
|
+
/** Something else ran on the node's pools during the run. */
|
|
28700
|
+
contaminated: zod.z.boolean(),
|
|
28701
|
+
progress: NodeBenchProgressSchema.nullable(),
|
|
28702
|
+
resultIds: zod.z.array(zod.z.string()).readonly()
|
|
28703
|
+
});
|
|
28704
|
+
/** `getNodeBenchmarkStatus`: the active run (or the last one), and whether benchmark mode is on. */
|
|
28705
|
+
var NodeBenchmarkStatusSchema = zod.z.object({
|
|
28706
|
+
/** The node the cluster is in benchmark mode for; null = none. */
|
|
28707
|
+
modeNodeId: zod.z.string().nullable(),
|
|
28708
|
+
run: NodeBenchmarkRunSchema.nullable()
|
|
28709
|
+
});
|
|
28710
|
+
/**
|
|
28711
|
+
* One stored measurement — the only authority Auto tune and the automatic
|
|
28712
|
+
* shares read measured capacity from. Written by the orchestrator when a run
|
|
28713
|
+
* ends, never by anyone else.
|
|
28714
|
+
*/
|
|
28715
|
+
var NodeBenchmarkResultSchema = zod.z.object({
|
|
28716
|
+
id: zod.z.string(),
|
|
28717
|
+
runId: zod.z.string(),
|
|
28718
|
+
nodeId: zod.z.string(),
|
|
28719
|
+
cell: NodeBenchCellSchema,
|
|
28720
|
+
fpsPerStream: zod.z.number(),
|
|
28721
|
+
fingerprint: NodeBenchFingerprintSchema.nullable(),
|
|
28722
|
+
clip: NodeBenchClipSchema.nullable(),
|
|
28723
|
+
/** Other work shared the node's pools (a camera that could not move, or the hub's own duties). */
|
|
28724
|
+
contaminated: zod.z.boolean(),
|
|
28725
|
+
stayingCameras: zod.z.array(zod.z.number()).readonly(),
|
|
28726
|
+
/** The run ended early; the cell itself completed. */
|
|
28727
|
+
partialRun: zod.z.boolean(),
|
|
28728
|
+
measuredAtMs: zod.z.number()
|
|
28729
|
+
});
|
|
28730
|
+
var ListNodeBenchmarkResultsInputSchema = zod.z.object({
|
|
28731
|
+
nodeId: zod.z.string().optional(),
|
|
28732
|
+
deviceKey: zod.z.string().optional()
|
|
28733
|
+
});
|
|
28734
|
+
/** A result with its standing today: does it still beat the table? */
|
|
28735
|
+
var NodeBenchmarkResultViewSchema = NodeBenchmarkResultSchema.extend({
|
|
28736
|
+
/** `fresh` beats the table; `stale` falls back to it; `superseded` = a newer row covers the same cell. */
|
|
28737
|
+
standing: zod.z.enum([
|
|
28738
|
+
"fresh",
|
|
28739
|
+
"stale",
|
|
28740
|
+
"superseded"
|
|
28741
|
+
]),
|
|
28742
|
+
staleWhy: zod.z.enum([
|
|
28743
|
+
"age",
|
|
28744
|
+
"runtime",
|
|
28745
|
+
"pool-tuning"
|
|
28746
|
+
]).nullable()
|
|
28747
|
+
});
|
|
28748
|
+
zod.z.object({
|
|
28749
|
+
runId: zod.z.string(),
|
|
28750
|
+
nodeId: zod.z.string(),
|
|
28751
|
+
startedAtMs: zod.z.number(),
|
|
28752
|
+
deadlineAtMs: zod.z.number(),
|
|
28753
|
+
plan: NodeBenchmarkPlanSchema,
|
|
28754
|
+
moved: zod.z.array(zod.z.number()).readonly(),
|
|
28755
|
+
staying: zod.z.array(zod.z.number()).readonly()
|
|
28756
|
+
});
|
|
28757
|
+
/** Candidate detectors per device, for the plan editor. */
|
|
28758
|
+
var NodeBenchmarkCandidatesSchema = zod.z.object({
|
|
28759
|
+
nodeId: zod.z.string(),
|
|
28760
|
+
reachable: zod.z.boolean(),
|
|
28761
|
+
devices: zod.z.array(zod.z.object({
|
|
28762
|
+
deviceKey: zod.z.string(),
|
|
28763
|
+
enabled: zod.z.boolean(),
|
|
28764
|
+
available: zod.z.boolean(),
|
|
28765
|
+
/** Ordered: what Auto tune would pick first, then the rest of the family by accuracy. */
|
|
28766
|
+
suggested: zod.z.array(zod.z.string()).readonly(),
|
|
28767
|
+
/** Every root detector the device has a build for. */
|
|
28768
|
+
all: zod.z.array(zod.z.string()).readonly(),
|
|
28769
|
+
/** The model the device runs now, when pinned. */
|
|
28770
|
+
currentModelId: zod.z.string().nullable()
|
|
28771
|
+
})).readonly(),
|
|
28772
|
+
/** Detail steps the node's catalog offers under the root (for the `pipeline` measurement). */
|
|
28773
|
+
steps: zod.z.array(zod.z.object({
|
|
28774
|
+
id: zod.z.string(),
|
|
28775
|
+
name: zod.z.string(),
|
|
28776
|
+
slot: zod.z.string()
|
|
28777
|
+
})).readonly()
|
|
28778
|
+
});
|
|
26932
28779
|
zod.z.object({
|
|
26933
28780
|
activeCameras: zod.z.number(),
|
|
26934
28781
|
throttledCameras: zod.z.number(),
|
|
@@ -28247,7 +30094,30 @@ var pipelineRunnerCapability = {
|
|
|
28247
30094
|
releaseParkedTrackFrames: method(zod.z.object({
|
|
28248
30095
|
deviceId: zod.z.number(),
|
|
28249
30096
|
trackId: zod.z.string()
|
|
28250
|
-
}), zod.z.object({ released: zod.z.number().int().nonnegative() }), { kind: "mutation" })
|
|
30097
|
+
}), zod.z.object({ released: zod.z.number().int().nonnegative() }), { kind: "mutation" }),
|
|
30098
|
+
/**
|
|
30099
|
+
* Start measuring THIS node for the orchestrator's node benchmark: the
|
|
30100
|
+
* bench clip decoded once into RAM, each device × candidate detector on an
|
|
30101
|
+
* open-loop ramp (`device`), then the chosen pipeline with the requested
|
|
30102
|
+
* detail steps (`pipeline`). Everything runs in-process with the executor
|
|
30103
|
+
* — no frame crosses a node (D9) — and writes nothing: no track, event,
|
|
30104
|
+
* media or notification. Reached by `nodePin(nodeId)`. Answers at once;
|
|
30105
|
+
* one run per node; the run stops itself at `deadlineAtMs`.
|
|
30106
|
+
*/
|
|
30107
|
+
startNodeBench: method(NodeBenchRunnerInputSchema, zod.z.object({
|
|
30108
|
+
accepted: zod.z.literal(true),
|
|
30109
|
+
runId: zod.z.string()
|
|
30110
|
+
}), {
|
|
30111
|
+
kind: "mutation",
|
|
30112
|
+
auth: "admin"
|
|
30113
|
+
}),
|
|
30114
|
+
/** The run's progress and every finished cell; null when this runner does not know `runId`. */
|
|
30115
|
+
getNodeBenchStatus: method(zod.z.object({ runId: zod.z.string() }), NodeBenchRunnerStatusSchema.nullable(), { auth: "admin" }),
|
|
30116
|
+
/** Stop the run; what it finished is kept. */
|
|
30117
|
+
abortNodeBench: method(zod.z.object({ runId: zod.z.string() }), zod.z.object({ aborted: zod.z.boolean() }), {
|
|
30118
|
+
kind: "mutation",
|
|
30119
|
+
auth: "admin"
|
|
30120
|
+
})
|
|
28251
30121
|
}
|
|
28252
30122
|
};
|
|
28253
30123
|
var CameraPipelineConfigSchema = zod.z.object({
|
|
@@ -29205,6 +31075,51 @@ var pipelineOrchestratorCapability = {
|
|
|
29205
31075
|
kind: "mutation",
|
|
29206
31076
|
auth: "admin"
|
|
29207
31077
|
}),
|
|
31078
|
+
/**
|
|
31079
|
+
* Node benchmark — what a run of this plan would do, without doing it:
|
|
31080
|
+
* the cameras that leave the node, those that cannot (the node is their
|
|
31081
|
+
* only frame source; they stay and flag the run), the estimated duration
|
|
31082
|
+
* and every reason it may not start. The confirmation shows this.
|
|
31083
|
+
*/
|
|
31084
|
+
getNodeBenchmarkPreflight: method(NodeBenchmarkPlanSchema, NodeBenchmarkPreflightSchema, { auth: "admin" }),
|
|
31085
|
+
/**
|
|
31086
|
+
* Node benchmark — start ONE run (cluster-wide lock). The orchestrator
|
|
31087
|
+
* persists a restore manifest, enters benchmark mode for the node (out of
|
|
31088
|
+
* placement, its camera pins ignored, nothing rewritten), drains it, drives
|
|
31089
|
+
* the node's own runner, then restores — always, including after an
|
|
31090
|
+
* abort, a lost node or a hub restart. Answers at once; poll
|
|
31091
|
+
* `getNodeBenchmarkStatus`. Refused runs carry the preflight.
|
|
31092
|
+
*/
|
|
31093
|
+
startNodeBenchmark: method(NodeBenchmarkPlanSchema, zod.z.discriminatedUnion("kind", [zod.z.object({
|
|
31094
|
+
kind: zod.z.literal("started"),
|
|
31095
|
+
runId: zod.z.string()
|
|
31096
|
+
}), zod.z.object({
|
|
31097
|
+
kind: zod.z.literal("refused"),
|
|
31098
|
+
preflight: NodeBenchmarkPreflightSchema
|
|
31099
|
+
})]), {
|
|
31100
|
+
kind: "mutation",
|
|
31101
|
+
auth: "admin"
|
|
31102
|
+
}),
|
|
31103
|
+
/** Node benchmark — the active run (or the last one) and the node in benchmark mode. */
|
|
31104
|
+
getNodeBenchmarkStatus: method(zod.z.void(), NodeBenchmarkStatusSchema, { auth: "admin" }),
|
|
31105
|
+
/** Node benchmark — stop the active run; the cluster is restored as it was. */
|
|
31106
|
+
abortNodeBenchmark: method(zod.z.object({ runId: zod.z.string() }), zod.z.object({ aborted: zod.z.boolean() }), {
|
|
31107
|
+
kind: "mutation",
|
|
31108
|
+
auth: "admin"
|
|
31109
|
+
}),
|
|
31110
|
+
/**
|
|
31111
|
+
* Node benchmark — root detector candidates per device (what Auto tune
|
|
31112
|
+
* would pick first, then the family) and the detail steps the node's
|
|
31113
|
+
* catalog offers, for the plan editor.
|
|
31114
|
+
*/
|
|
31115
|
+
getNodeBenchmarkCandidates: method(zod.z.object({ nodeId: zod.z.string() }), NodeBenchmarkCandidatesSchema, { auth: "admin" }),
|
|
31116
|
+
/** Node benchmark — stored results, newest first, each with its standing today. */
|
|
31117
|
+
listNodeBenchmarkResults: method(ListNodeBenchmarkResultsInputSchema, zod.z.array(NodeBenchmarkResultViewSchema).readonly(), { auth: "admin" }),
|
|
31118
|
+
/** Node benchmark — delete one result; Auto tune and the shares stop reading it. */
|
|
31119
|
+
deleteNodeBenchmarkResult: method(zod.z.object({ id: zod.z.string() }), zod.z.object({ deleted: zod.z.boolean() }), {
|
|
31120
|
+
kind: "mutation",
|
|
31121
|
+
auth: "admin"
|
|
31122
|
+
}),
|
|
29208
31123
|
/** Read one camera's settings. Null when never touched (inherits agent defaults fully). */
|
|
29209
31124
|
getCameraSettings: method(zod.z.object({ deviceId: zod.z.number() }), CameraPipelineSettingsSchema.nullable()),
|
|
29210
31125
|
/** Set or clear the 3-state toggle for one (camera, addonId). Pass `enabled: null` to clear and revert to agent default. */
|
|
@@ -36764,6 +38679,9 @@ var CreateIntegrationInputSchema = zod.z.object({
|
|
|
36764
38679
|
enabled: zod.z.boolean().optional(),
|
|
36765
38680
|
info: zod.z.record(zod.z.string(), zod.z.unknown()).optional(),
|
|
36766
38681
|
settings: zod.z.record(zod.z.string(), zod.z.unknown()).optional(),
|
|
38682
|
+
/** Keys of `settings` the form's schema declares secret (by type) — kept in
|
|
38683
|
+
* the keychain, not the table (D787). */
|
|
38684
|
+
secretKeys: zod.z.array(zod.z.string()).optional(),
|
|
36767
38685
|
skipRestart: zod.z.boolean().optional()
|
|
36768
38686
|
});
|
|
36769
38687
|
var UpdateIntegrationInputSchema = zod.z.object({
|
|
@@ -36799,7 +38717,9 @@ var integrationsCapability = {
|
|
|
36799
38717
|
getSettings: method(zod.z.object({ id: zod.z.string() }), zod.z.record(zod.z.string(), zod.z.unknown()), { auth: "admin" }),
|
|
36800
38718
|
setSettings: method(zod.z.object({
|
|
36801
38719
|
id: zod.z.string(),
|
|
36802
|
-
settings: zod.z.record(zod.z.string(), zod.z.unknown())
|
|
38720
|
+
settings: zod.z.record(zod.z.string(), zod.z.unknown()),
|
|
38721
|
+
/** Keys the form's schema declares secret (by type) — keychain-stored (D787). */
|
|
38722
|
+
secretKeys: zod.z.array(zod.z.string()).optional()
|
|
36803
38723
|
}), zod.z.object({ success: zod.z.boolean() }), {
|
|
36804
38724
|
kind: "mutation",
|
|
36805
38725
|
auth: "admin"
|
|
@@ -46952,7 +48872,8 @@ var BaseDevice = class {
|
|
|
46952
48872
|
this.role = options.role;
|
|
46953
48873
|
this.parentDeviceId = ctx.parentDeviceId;
|
|
46954
48874
|
const seedData = ctx.persistedConfig ?? {};
|
|
46955
|
-
|
|
48875
|
+
const declaredSecretPaths = collectZodSecretPaths(schema);
|
|
48876
|
+
this.config = DeviceConfig.fromSchema(schema, (data) => ctx.persistConfig(data, { secretConfigPaths: declaredSecretPaths }), seedData, ({ droppedKeys, issues }) => {
|
|
46956
48877
|
ctx.logger.warn("Device config recovery: dropping invalid persisted fields", {
|
|
46957
48878
|
tags: {
|
|
46958
48879
|
deviceId: ctx.id,
|
|
@@ -50424,6 +52345,90 @@ var METHOD_ACCESS_MAP = Object.freeze({
|
|
|
50424
52345
|
addonId: null,
|
|
50425
52346
|
access: "create"
|
|
50426
52347
|
},
|
|
52348
|
+
"keychain.delete": {
|
|
52349
|
+
capName: "keychain",
|
|
52350
|
+
capScope: "system",
|
|
52351
|
+
addonId: null,
|
|
52352
|
+
access: "delete"
|
|
52353
|
+
},
|
|
52354
|
+
"keychain.getState": {
|
|
52355
|
+
capName: "keychain",
|
|
52356
|
+
capScope: "system",
|
|
52357
|
+
addonId: null,
|
|
52358
|
+
access: "view"
|
|
52359
|
+
},
|
|
52360
|
+
"keychain.listMeta": {
|
|
52361
|
+
capName: "keychain",
|
|
52362
|
+
capScope: "system",
|
|
52363
|
+
addonId: null,
|
|
52364
|
+
access: "view"
|
|
52365
|
+
},
|
|
52366
|
+
"keychain.put": {
|
|
52367
|
+
capName: "keychain",
|
|
52368
|
+
capScope: "system",
|
|
52369
|
+
addonId: null,
|
|
52370
|
+
access: "create"
|
|
52371
|
+
},
|
|
52372
|
+
"keychain.resolve": {
|
|
52373
|
+
capName: "keychain",
|
|
52374
|
+
capScope: "system",
|
|
52375
|
+
addonId: null,
|
|
52376
|
+
access: "view"
|
|
52377
|
+
},
|
|
52378
|
+
"keychainAdmin.deleteOrphans": {
|
|
52379
|
+
capName: "keychain-admin",
|
|
52380
|
+
capScope: "system",
|
|
52381
|
+
addonId: null,
|
|
52382
|
+
access: "delete"
|
|
52383
|
+
},
|
|
52384
|
+
"keychainAdmin.downloadRecoveryKey": {
|
|
52385
|
+
capName: "keychain-admin",
|
|
52386
|
+
capScope: "system",
|
|
52387
|
+
addonId: null,
|
|
52388
|
+
access: "create"
|
|
52389
|
+
},
|
|
52390
|
+
"keychainAdmin.listAudit": {
|
|
52391
|
+
capName: "keychain-admin",
|
|
52392
|
+
capScope: "system",
|
|
52393
|
+
addonId: null,
|
|
52394
|
+
access: "view"
|
|
52395
|
+
},
|
|
52396
|
+
"keychainAdmin.listSecrets": {
|
|
52397
|
+
capName: "keychain-admin",
|
|
52398
|
+
capScope: "system",
|
|
52399
|
+
addonId: null,
|
|
52400
|
+
access: "view"
|
|
52401
|
+
},
|
|
52402
|
+
"keychainAdmin.purgeRetiredKeys": {
|
|
52403
|
+
capName: "keychain-admin",
|
|
52404
|
+
capScope: "system",
|
|
52405
|
+
addonId: null,
|
|
52406
|
+
access: "delete"
|
|
52407
|
+
},
|
|
52408
|
+
"keychainAdmin.resetKeychain": {
|
|
52409
|
+
capName: "keychain-admin",
|
|
52410
|
+
capScope: "system",
|
|
52411
|
+
addonId: null,
|
|
52412
|
+
access: "delete"
|
|
52413
|
+
},
|
|
52414
|
+
"keychainAdmin.reveal": {
|
|
52415
|
+
capName: "keychain-admin",
|
|
52416
|
+
capScope: "system",
|
|
52417
|
+
addonId: null,
|
|
52418
|
+
access: "create"
|
|
52419
|
+
},
|
|
52420
|
+
"keychainAdmin.rotateMasterKey": {
|
|
52421
|
+
capName: "keychain-admin",
|
|
52422
|
+
capScope: "system",
|
|
52423
|
+
addonId: null,
|
|
52424
|
+
access: "create"
|
|
52425
|
+
},
|
|
52426
|
+
"keychainAdmin.status": {
|
|
52427
|
+
capName: "keychain-admin",
|
|
52428
|
+
capScope: "system",
|
|
52429
|
+
addonId: null,
|
|
52430
|
+
access: "view"
|
|
52431
|
+
},
|
|
50427
52432
|
"lawnMowerControl.dock": {
|
|
50428
52433
|
capName: "lawn-mower-control",
|
|
50429
52434
|
capScope: "device",
|
|
@@ -51798,6 +53803,18 @@ var METHOD_ACCESS_MAP = Object.freeze({
|
|
|
51798
53803
|
addonId: null,
|
|
51799
53804
|
access: "create"
|
|
51800
53805
|
},
|
|
53806
|
+
"pipelineAnalytics.addRetrainFrameFromRecording": {
|
|
53807
|
+
capName: "pipeline-analytics",
|
|
53808
|
+
capScope: "device",
|
|
53809
|
+
addonId: null,
|
|
53810
|
+
access: "create"
|
|
53811
|
+
},
|
|
53812
|
+
"pipelineAnalytics.addRetrainFramesToCollection": {
|
|
53813
|
+
capName: "pipeline-analytics",
|
|
53814
|
+
capScope: "device",
|
|
53815
|
+
addonId: null,
|
|
53816
|
+
access: "create"
|
|
53817
|
+
},
|
|
51801
53818
|
"pipelineAnalytics.applyDeviceSettingsPatch": {
|
|
51802
53819
|
capName: "pipeline-analytics",
|
|
51803
53820
|
capScope: "device",
|
|
@@ -51846,12 +53863,36 @@ var METHOD_ACCESS_MAP = Object.freeze({
|
|
|
51846
53863
|
addonId: null,
|
|
51847
53864
|
access: "view"
|
|
51848
53865
|
},
|
|
53866
|
+
"pipelineAnalytics.createRetrainCollection": {
|
|
53867
|
+
capName: "pipeline-analytics",
|
|
53868
|
+
capScope: "device",
|
|
53869
|
+
addonId: null,
|
|
53870
|
+
access: "create"
|
|
53871
|
+
},
|
|
53872
|
+
"pipelineAnalytics.createRetrainDatasetVersion": {
|
|
53873
|
+
capName: "pipeline-analytics",
|
|
53874
|
+
capScope: "device",
|
|
53875
|
+
addonId: null,
|
|
53876
|
+
access: "create"
|
|
53877
|
+
},
|
|
51849
53878
|
"pipelineAnalytics.deleteDeviceEvents": {
|
|
51850
53879
|
capName: "pipeline-analytics",
|
|
51851
53880
|
capScope: "device",
|
|
51852
53881
|
addonId: null,
|
|
51853
53882
|
access: "delete"
|
|
51854
53883
|
},
|
|
53884
|
+
"pipelineAnalytics.deleteRetrainCollection": {
|
|
53885
|
+
capName: "pipeline-analytics",
|
|
53886
|
+
capScope: "device",
|
|
53887
|
+
addonId: null,
|
|
53888
|
+
access: "delete"
|
|
53889
|
+
},
|
|
53890
|
+
"pipelineAnalytics.deleteRetrainDatasetVersion": {
|
|
53891
|
+
capName: "pipeline-analytics",
|
|
53892
|
+
capScope: "device",
|
|
53893
|
+
addonId: null,
|
|
53894
|
+
access: "delete"
|
|
53895
|
+
},
|
|
51855
53896
|
"pipelineAnalytics.deleteTracks": {
|
|
51856
53897
|
capName: "pipeline-analytics",
|
|
51857
53898
|
capScope: "device",
|
|
@@ -52056,6 +54097,30 @@ var METHOD_ACCESS_MAP = Object.freeze({
|
|
|
52056
54097
|
addonId: null,
|
|
52057
54098
|
access: "view"
|
|
52058
54099
|
},
|
|
54100
|
+
"pipelineAnalytics.listRetrainAssistProfiles": {
|
|
54101
|
+
capName: "pipeline-analytics",
|
|
54102
|
+
capScope: "device",
|
|
54103
|
+
addonId: null,
|
|
54104
|
+
access: "view"
|
|
54105
|
+
},
|
|
54106
|
+
"pipelineAnalytics.listRetrainCollectionFrames": {
|
|
54107
|
+
capName: "pipeline-analytics",
|
|
54108
|
+
capScope: "device",
|
|
54109
|
+
addonId: null,
|
|
54110
|
+
access: "view"
|
|
54111
|
+
},
|
|
54112
|
+
"pipelineAnalytics.listRetrainCollections": {
|
|
54113
|
+
capName: "pipeline-analytics",
|
|
54114
|
+
capScope: "device",
|
|
54115
|
+
addonId: null,
|
|
54116
|
+
access: "view"
|
|
54117
|
+
},
|
|
54118
|
+
"pipelineAnalytics.listRetrainDatasetVersions": {
|
|
54119
|
+
capName: "pipeline-analytics",
|
|
54120
|
+
capScope: "device",
|
|
54121
|
+
addonId: null,
|
|
54122
|
+
access: "view"
|
|
54123
|
+
},
|
|
52059
54124
|
"pipelineAnalytics.listRetrainFrames": {
|
|
52060
54125
|
capName: "pipeline-analytics",
|
|
52061
54126
|
capScope: "device",
|
|
@@ -52098,12 +54163,24 @@ var METHOD_ACCESS_MAP = Object.freeze({
|
|
|
52098
54163
|
addonId: null,
|
|
52099
54164
|
access: "create"
|
|
52100
54165
|
},
|
|
54166
|
+
"pipelineAnalytics.previewRetrainDataset": {
|
|
54167
|
+
capName: "pipeline-analytics",
|
|
54168
|
+
capScope: "device",
|
|
54169
|
+
addonId: null,
|
|
54170
|
+
access: "view"
|
|
54171
|
+
},
|
|
52101
54172
|
"pipelineAnalytics.proposeRetrainAnnotations": {
|
|
52102
54173
|
capName: "pipeline-analytics",
|
|
52103
54174
|
capScope: "device",
|
|
52104
54175
|
addonId: null,
|
|
52105
54176
|
access: "create"
|
|
52106
54177
|
},
|
|
54178
|
+
"pipelineAnalytics.proposeRetrainAnnotationsWithLlm": {
|
|
54179
|
+
capName: "pipeline-analytics",
|
|
54180
|
+
capScope: "device",
|
|
54181
|
+
addonId: null,
|
|
54182
|
+
access: "create"
|
|
54183
|
+
},
|
|
52107
54184
|
"pipelineAnalytics.pruneEvents": {
|
|
52108
54185
|
capName: "pipeline-analytics",
|
|
52109
54186
|
capScope: "device",
|
|
@@ -52158,6 +54235,18 @@ var METHOD_ACCESS_MAP = Object.freeze({
|
|
|
52158
54235
|
addonId: null,
|
|
52159
54236
|
access: "create"
|
|
52160
54237
|
},
|
|
54238
|
+
"pipelineAnalytics.removeRetrainFrameFromCollection": {
|
|
54239
|
+
capName: "pipeline-analytics",
|
|
54240
|
+
capScope: "device",
|
|
54241
|
+
addonId: null,
|
|
54242
|
+
access: "delete"
|
|
54243
|
+
},
|
|
54244
|
+
"pipelineAnalytics.renameRetrainCollection": {
|
|
54245
|
+
capName: "pipeline-analytics",
|
|
54246
|
+
capScope: "device",
|
|
54247
|
+
addonId: null,
|
|
54248
|
+
access: "create"
|
|
54249
|
+
},
|
|
52161
54250
|
"pipelineAnalytics.restageRetrainTrack": {
|
|
52162
54251
|
capName: "pipeline-analytics",
|
|
52163
54252
|
capScope: "device",
|
|
@@ -52218,6 +54307,12 @@ var METHOD_ACCESS_MAP = Object.freeze({
|
|
|
52218
54307
|
addonId: null,
|
|
52219
54308
|
access: "create"
|
|
52220
54309
|
},
|
|
54310
|
+
"pipelineAnalytics.verifyRetrainDatasetVersion": {
|
|
54311
|
+
capName: "pipeline-analytics",
|
|
54312
|
+
capScope: "device",
|
|
54313
|
+
addonId: null,
|
|
54314
|
+
access: "view"
|
|
54315
|
+
},
|
|
52221
54316
|
"pipelineAnalytics.wipeAllAnalytics": {
|
|
52222
54317
|
capName: "pipeline-analytics",
|
|
52223
54318
|
capScope: "device",
|
|
@@ -52446,6 +54541,12 @@ var METHOD_ACCESS_MAP = Object.freeze({
|
|
|
52446
54541
|
addonId: null,
|
|
52447
54542
|
access: "view"
|
|
52448
54543
|
},
|
|
54544
|
+
"pipelineOrchestrator.abortNodeBenchmark": {
|
|
54545
|
+
capName: "pipeline-orchestrator",
|
|
54546
|
+
capScope: "system",
|
|
54547
|
+
addonId: null,
|
|
54548
|
+
access: "create"
|
|
54549
|
+
},
|
|
52449
54550
|
"pipelineOrchestrator.applyAutoTune": {
|
|
52450
54551
|
capName: "pipeline-orchestrator",
|
|
52451
54552
|
capScope: "system",
|
|
@@ -52470,6 +54571,12 @@ var METHOD_ACCESS_MAP = Object.freeze({
|
|
|
52470
54571
|
addonId: null,
|
|
52471
54572
|
access: "create"
|
|
52472
54573
|
},
|
|
54574
|
+
"pipelineOrchestrator.deleteNodeBenchmarkResult": {
|
|
54575
|
+
capName: "pipeline-orchestrator",
|
|
54576
|
+
capScope: "system",
|
|
54577
|
+
addonId: null,
|
|
54578
|
+
access: "delete"
|
|
54579
|
+
},
|
|
52473
54580
|
"pipelineOrchestrator.getAgentLoad": {
|
|
52474
54581
|
capName: "pipeline-orchestrator",
|
|
52475
54582
|
capScope: "system",
|
|
@@ -52578,6 +54685,24 @@ var METHOD_ACCESS_MAP = Object.freeze({
|
|
|
52578
54685
|
addonId: null,
|
|
52579
54686
|
access: "view"
|
|
52580
54687
|
},
|
|
54688
|
+
"pipelineOrchestrator.getNodeBenchmarkCandidates": {
|
|
54689
|
+
capName: "pipeline-orchestrator",
|
|
54690
|
+
capScope: "system",
|
|
54691
|
+
addonId: null,
|
|
54692
|
+
access: "view"
|
|
54693
|
+
},
|
|
54694
|
+
"pipelineOrchestrator.getNodeBenchmarkPreflight": {
|
|
54695
|
+
capName: "pipeline-orchestrator",
|
|
54696
|
+
capScope: "system",
|
|
54697
|
+
addonId: null,
|
|
54698
|
+
access: "view"
|
|
54699
|
+
},
|
|
54700
|
+
"pipelineOrchestrator.getNodeBenchmarkStatus": {
|
|
54701
|
+
capName: "pipeline-orchestrator",
|
|
54702
|
+
capScope: "system",
|
|
54703
|
+
addonId: null,
|
|
54704
|
+
access: "view"
|
|
54705
|
+
},
|
|
52581
54706
|
"pipelineOrchestrator.getNodeInferenceDevices": {
|
|
52582
54707
|
capName: "pipeline-orchestrator",
|
|
52583
54708
|
capScope: "system",
|
|
@@ -52620,6 +54745,12 @@ var METHOD_ACCESS_MAP = Object.freeze({
|
|
|
52620
54745
|
addonId: null,
|
|
52621
54746
|
access: "view"
|
|
52622
54747
|
},
|
|
54748
|
+
"pipelineOrchestrator.listNodeBenchmarkResults": {
|
|
54749
|
+
capName: "pipeline-orchestrator",
|
|
54750
|
+
capScope: "system",
|
|
54751
|
+
addonId: null,
|
|
54752
|
+
access: "view"
|
|
54753
|
+
},
|
|
52623
54754
|
"pipelineOrchestrator.pauseForStorageMigration": {
|
|
52624
54755
|
capName: "pipeline-orchestrator",
|
|
52625
54756
|
capScope: "system",
|
|
@@ -52764,6 +54895,12 @@ var METHOD_ACCESS_MAP = Object.freeze({
|
|
|
52764
54895
|
addonId: null,
|
|
52765
54896
|
access: "create"
|
|
52766
54897
|
},
|
|
54898
|
+
"pipelineOrchestrator.startNodeBenchmark": {
|
|
54899
|
+
capName: "pipeline-orchestrator",
|
|
54900
|
+
capScope: "system",
|
|
54901
|
+
addonId: null,
|
|
54902
|
+
access: "create"
|
|
54903
|
+
},
|
|
52767
54904
|
"pipelineOrchestrator.suggestShares": {
|
|
52768
54905
|
capName: "pipeline-orchestrator",
|
|
52769
54906
|
capScope: "system",
|
|
@@ -52782,6 +54919,12 @@ var METHOD_ACCESS_MAP = Object.freeze({
|
|
|
52782
54919
|
addonId: null,
|
|
52783
54920
|
access: "create"
|
|
52784
54921
|
},
|
|
54922
|
+
"pipelineRunner.abortNodeBench": {
|
|
54923
|
+
capName: "pipeline-runner",
|
|
54924
|
+
capScope: "system",
|
|
54925
|
+
addonId: null,
|
|
54926
|
+
access: "create"
|
|
54927
|
+
},
|
|
52785
54928
|
"pipelineRunner.attachCamera": {
|
|
52786
54929
|
capName: "pipeline-runner",
|
|
52787
54930
|
capScope: "system",
|
|
@@ -52830,6 +54973,12 @@ var METHOD_ACCESS_MAP = Object.freeze({
|
|
|
52830
54973
|
addonId: null,
|
|
52831
54974
|
access: "view"
|
|
52832
54975
|
},
|
|
54976
|
+
"pipelineRunner.getNodeBenchStatus": {
|
|
54977
|
+
capName: "pipeline-runner",
|
|
54978
|
+
capScope: "system",
|
|
54979
|
+
addonId: null,
|
|
54980
|
+
access: "view"
|
|
54981
|
+
},
|
|
52833
54982
|
"pipelineRunner.getParkedTrackFrame": {
|
|
52834
54983
|
capName: "pipeline-runner",
|
|
52835
54984
|
capScope: "system",
|
|
@@ -52872,6 +55021,12 @@ var METHOD_ACCESS_MAP = Object.freeze({
|
|
|
52872
55021
|
addonId: null,
|
|
52873
55022
|
access: "create"
|
|
52874
55023
|
},
|
|
55024
|
+
"pipelineRunner.startNodeBench": {
|
|
55025
|
+
capName: "pipeline-runner",
|
|
55026
|
+
capScope: "system",
|
|
55027
|
+
addonId: null,
|
|
55028
|
+
access: "create"
|
|
55029
|
+
},
|
|
52875
55030
|
"plateGallery.assignPlate": {
|
|
52876
55031
|
capName: "plate-gallery",
|
|
52877
55032
|
capScope: "system",
|
|
@@ -56630,6 +58785,8 @@ var ALL_CAPABILITY_DEFINITIONS = [
|
|
|
56630
58785
|
imageSettingsCapability,
|
|
56631
58786
|
integrationsCapability,
|
|
56632
58787
|
intercomCapability,
|
|
58788
|
+
keychainCapability,
|
|
58789
|
+
keychainAdminCapability,
|
|
56633
58790
|
lawnMowerControlCapability,
|
|
56634
58791
|
llmCapability,
|
|
56635
58792
|
llmRuntimeCapability,
|
|
@@ -58056,6 +60213,11 @@ Object.freeze({
|
|
|
58056
60213
|
form: "single",
|
|
58057
60214
|
optional: false
|
|
58058
60215
|
}],
|
|
60216
|
+
"pipelineAnalytics.addRetrainFrameFromRecording": [{
|
|
60217
|
+
name: "deviceId",
|
|
60218
|
+
form: "single",
|
|
60219
|
+
optional: false
|
|
60220
|
+
}],
|
|
58059
60221
|
"pipelineAnalytics.applyDeviceSettingsPatch": [{
|
|
58060
60222
|
name: "deviceId",
|
|
58061
60223
|
form: "single",
|
|
@@ -58246,6 +60408,11 @@ Object.freeze({
|
|
|
58246
60408
|
form: "single",
|
|
58247
60409
|
optional: false
|
|
58248
60410
|
}],
|
|
60411
|
+
"pipelineAnalytics.proposeRetrainAnnotationsWithLlm": [{
|
|
60412
|
+
name: "deviceId",
|
|
60413
|
+
form: "single",
|
|
60414
|
+
optional: false
|
|
60415
|
+
}],
|
|
58249
60416
|
"pipelineAnalytics.pruneEventsBefore": [{
|
|
58250
60417
|
name: "deviceId",
|
|
58251
60418
|
form: "single",
|
|
@@ -60684,6 +62851,70 @@ function bareAddonId(id) {
|
|
|
60684
62851
|
function hfModelUrl(repo, path) {
|
|
60685
62852
|
return `https://huggingface.co/${repo}/resolve/main/${path}`;
|
|
60686
62853
|
}
|
|
62854
|
+
/**
|
|
62855
|
+
* Names that, when used as URL query parameters, almost certainly carry
|
|
62856
|
+
* a secret. Matching is case-insensitive and anchored to the full param
|
|
62857
|
+
* name to avoid false positives like `user_id` (an entity reference, not
|
|
62858
|
+
* a credential) or `topic=password-reset` (a value happens to contain
|
|
62859
|
+
* the substring "password" but the param name is unrelated).
|
|
62860
|
+
*
|
|
62861
|
+
* Add new patterns here as we encounter cameras/APIs that leak through
|
|
62862
|
+
* the existing list.
|
|
62863
|
+
*/
|
|
62864
|
+
var CREDENTIAL_PARAM_PATTERNS = [
|
|
62865
|
+
/^user$/i,
|
|
62866
|
+
/^usr$/i,
|
|
62867
|
+
/^username$/i,
|
|
62868
|
+
/^password$/i,
|
|
62869
|
+
/^pwd$/i,
|
|
62870
|
+
/^pass$/i,
|
|
62871
|
+
/^passwd$/i,
|
|
62872
|
+
/^secret$/i,
|
|
62873
|
+
/^token$/i,
|
|
62874
|
+
/^auth$/i,
|
|
62875
|
+
/^auth[_-]?token$/i,
|
|
62876
|
+
/^bearer$/i,
|
|
62877
|
+
/^api[_-]?key$/i,
|
|
62878
|
+
/^access[_-]?token$/i,
|
|
62879
|
+
/^refresh[_-]?token$/i
|
|
62880
|
+
];
|
|
62881
|
+
function isCredentialParam(name) {
|
|
62882
|
+
return CREDENTIAL_PARAM_PATTERNS.some((re) => re.test(name));
|
|
62883
|
+
}
|
|
62884
|
+
/**
|
|
62885
|
+
* Redact secrets we may surface in logs or telemetry:
|
|
62886
|
+
* 1. `userinfo` (`user:password@host`) — the classic RTSP shape.
|
|
62887
|
+
* 2. Query-string credential params (`?user=...&password=...`) — the
|
|
62888
|
+
* Reolink RTMP shape and several HTTP-pushed-stream APIs.
|
|
62889
|
+
*
|
|
62890
|
+
* Returns the original string verbatim when the input is not a parseable
|
|
62891
|
+
* URL — a log helper must never throw. Param values are replaced with
|
|
62892
|
+
* `***` so an operator reading logs still sees WHICH credential was
|
|
62893
|
+
* present (useful for debugging "wrong password" issues) without
|
|
62894
|
+
* exposing the value.
|
|
62895
|
+
*
|
|
62896
|
+
* The credential-name match is case-insensitive but anchored to the
|
|
62897
|
+
* whole param name; values like `user_id=42` or `topic=password-reset`
|
|
62898
|
+
* are NOT masked (those are entity references, not credentials).
|
|
62899
|
+
*/
|
|
62900
|
+
function maskUrlCredentials(rawUrl) {
|
|
62901
|
+
try {
|
|
62902
|
+
const u = new URL(rawUrl);
|
|
62903
|
+
let touched = false;
|
|
62904
|
+
if (u.username || u.password) {
|
|
62905
|
+
u.username = "";
|
|
62906
|
+
u.password = "";
|
|
62907
|
+
touched = true;
|
|
62908
|
+
}
|
|
62909
|
+
for (const key of Array.from(u.searchParams.keys())) if (isCredentialParam(key)) {
|
|
62910
|
+
u.searchParams.set(key, "***");
|
|
62911
|
+
touched = true;
|
|
62912
|
+
}
|
|
62913
|
+
return touched ? u.toString() : rawUrl;
|
|
62914
|
+
} catch {
|
|
62915
|
+
return rawUrl;
|
|
62916
|
+
}
|
|
62917
|
+
}
|
|
60687
62918
|
var MB = 1024 * 1024;
|
|
60688
62919
|
1024 * MB, 3072 * MB;
|
|
60689
62920
|
/**
|
|
@@ -61538,6 +63769,12 @@ Object.defineProperty(exports, "formatMinutes", {
|
|
|
61538
63769
|
return formatMinutes;
|
|
61539
63770
|
}
|
|
61540
63771
|
});
|
|
63772
|
+
Object.defineProperty(exports, "formatSecretScope", {
|
|
63773
|
+
enumerable: true,
|
|
63774
|
+
get: function() {
|
|
63775
|
+
return formatSecretScope;
|
|
63776
|
+
}
|
|
63777
|
+
});
|
|
61541
63778
|
Object.defineProperty(exports, "gbToBytes", {
|
|
61542
63779
|
enumerable: true,
|
|
61543
63780
|
get: function() {
|
|
@@ -61604,6 +63841,12 @@ Object.defineProperty(exports, "isObjectInput", {
|
|
|
61604
63841
|
return isObjectInput;
|
|
61605
63842
|
}
|
|
61606
63843
|
});
|
|
63844
|
+
Object.defineProperty(exports, "isSecretMarker", {
|
|
63845
|
+
enumerable: true,
|
|
63846
|
+
get: function() {
|
|
63847
|
+
return isSecretMarker;
|
|
63848
|
+
}
|
|
63849
|
+
});
|
|
61607
63850
|
Object.defineProperty(exports, "isVoidInput", {
|
|
61608
63851
|
enumerable: true,
|
|
61609
63852
|
get: function() {
|
|
@@ -61616,6 +63859,18 @@ Object.defineProperty(exports, "kebabToCamel", {
|
|
|
61616
63859
|
return kebabToCamel;
|
|
61617
63860
|
}
|
|
61618
63861
|
});
|
|
63862
|
+
Object.defineProperty(exports, "keychainAdminCapability", {
|
|
63863
|
+
enumerable: true,
|
|
63864
|
+
get: function() {
|
|
63865
|
+
return keychainAdminCapability;
|
|
63866
|
+
}
|
|
63867
|
+
});
|
|
63868
|
+
Object.defineProperty(exports, "keychainCapability", {
|
|
63869
|
+
enumerable: true,
|
|
63870
|
+
get: function() {
|
|
63871
|
+
return keychainCapability;
|
|
63872
|
+
}
|
|
63873
|
+
});
|
|
61619
63874
|
Object.defineProperty(exports, "legacyAutoLinkIds", {
|
|
61620
63875
|
enumerable: true,
|
|
61621
63876
|
get: function() {
|
|
@@ -61664,6 +63919,12 @@ Object.defineProperty(exports, "looseSchema", {
|
|
|
61664
63919
|
return looseSchema;
|
|
61665
63920
|
}
|
|
61666
63921
|
});
|
|
63922
|
+
Object.defineProperty(exports, "maskUrlCredentials", {
|
|
63923
|
+
enumerable: true,
|
|
63924
|
+
get: function() {
|
|
63925
|
+
return maskUrlCredentials;
|
|
63926
|
+
}
|
|
63927
|
+
});
|
|
61667
63928
|
Object.defineProperty(exports, "mayReadLocation", {
|
|
61668
63929
|
enumerable: true,
|
|
61669
63930
|
get: function() {
|
|
@@ -61712,6 +63973,12 @@ Object.defineProperty(exports, "normalizeCoreBlockWrite", {
|
|
|
61712
63973
|
return normalizeCoreBlockWrite;
|
|
61713
63974
|
}
|
|
61714
63975
|
});
|
|
63976
|
+
Object.defineProperty(exports, "normalizeSecretOwner", {
|
|
63977
|
+
enumerable: true,
|
|
63978
|
+
get: function() {
|
|
63979
|
+
return normalizeSecretOwner;
|
|
63980
|
+
}
|
|
63981
|
+
});
|
|
61715
63982
|
Object.defineProperty(exports, "normalizeUnit", {
|
|
61716
63983
|
enumerable: true,
|
|
61717
63984
|
get: function() {
|
|
@@ -61742,6 +64009,12 @@ Object.defineProperty(exports, "parseJsonUnknown", {
|
|
|
61742
64009
|
return parseJsonUnknown;
|
|
61743
64010
|
}
|
|
61744
64011
|
});
|
|
64012
|
+
Object.defineProperty(exports, "parseSecretRef", {
|
|
64013
|
+
enumerable: true,
|
|
64014
|
+
get: function() {
|
|
64015
|
+
return parseSecretRef;
|
|
64016
|
+
}
|
|
64017
|
+
});
|
|
61745
64018
|
Object.defineProperty(exports, "parseStreamParamsFormPatch", {
|
|
61746
64019
|
enumerable: true,
|
|
61747
64020
|
get: function() {
|
|
@@ -61850,6 +64123,12 @@ Object.defineProperty(exports, "resolveNotificationTapAddress", {
|
|
|
61850
64123
|
return resolveNotificationTapAddress;
|
|
61851
64124
|
}
|
|
61852
64125
|
});
|
|
64126
|
+
Object.defineProperty(exports, "resolveSecretMarkers", {
|
|
64127
|
+
enumerable: true,
|
|
64128
|
+
get: function() {
|
|
64129
|
+
return resolveSecretMarkers;
|
|
64130
|
+
}
|
|
64131
|
+
});
|
|
61853
64132
|
Object.defineProperty(exports, "runtimeStatePolicyFor", {
|
|
61854
64133
|
enumerable: true,
|
|
61855
64134
|
get: function() {
|
|
@@ -61880,6 +64159,18 @@ Object.defineProperty(exports, "scoreRuntimes", {
|
|
|
61880
64159
|
return scoreRuntimes;
|
|
61881
64160
|
}
|
|
61882
64161
|
});
|
|
64162
|
+
Object.defineProperty(exports, "scrubKnownSecrets", {
|
|
64163
|
+
enumerable: true,
|
|
64164
|
+
get: function() {
|
|
64165
|
+
return scrubKnownSecrets;
|
|
64166
|
+
}
|
|
64167
|
+
});
|
|
64168
|
+
Object.defineProperty(exports, "secretTreeFromPaths", {
|
|
64169
|
+
enumerable: true,
|
|
64170
|
+
get: function() {
|
|
64171
|
+
return secretTreeFromPaths;
|
|
64172
|
+
}
|
|
64173
|
+
});
|
|
61883
64174
|
Object.defineProperty(exports, "settingsStoreCapability", {
|
|
61884
64175
|
enumerable: true,
|
|
61885
64176
|
get: function() {
|
|
@@ -61952,6 +64243,12 @@ Object.defineProperty(exports, "toNodeId", {
|
|
|
61952
64243
|
return toNodeId;
|
|
61953
64244
|
}
|
|
61954
64245
|
});
|
|
64246
|
+
Object.defineProperty(exports, "transformSecretWrite", {
|
|
64247
|
+
enumerable: true,
|
|
64248
|
+
get: function() {
|
|
64249
|
+
return transformSecretWrite;
|
|
64250
|
+
}
|
|
64251
|
+
});
|
|
61955
64252
|
Object.defineProperty(exports, "userManagementCapability", {
|
|
61956
64253
|
enumerable: true,
|
|
61957
64254
|
get: function() {
|