@camstack/server 1.2.789 → 1.2.791
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/CHANGELOG.md +15 -0
- package/dist/agent/agent-child-manifest.js +39 -0
- package/dist/agent/agent-hub-registration.js +11 -1
- package/dist/agent/forward-to-hub.js +43 -0
- package/dist/agent/main.js +31 -81
- package/dist/agent/stale-addon-gate.js +70 -34
- package/dist/api/trpc/device-config-secret-redaction.js +14 -1
- package/dist/api/trpc/generated-cap-mounts.js +1 -6
- package/dist/api/trpc/generated-cap-routers.js +1245 -1417
- package/dist/api/trpc/localized-schema-paths.js +1 -0
- package/dist/core/addon/addon-registry.service.js +25 -33
- package/dist/core/addon/addon-settings-provider.js +57 -0
- package/dist/core/addon/boot-health-snapshot.js +0 -28
- package/dist/core/addon/{hub-spawn-gate.js → hub-addon-support.js} +12 -35
- package/dist/core/moleculer/moleculer.service.js +2 -13
- package/dist/core/moleculer/runner-hosted-on-node.js +23 -0
- package/dist/core/updates/required-addon-update.js +1 -1
- package/package.json +20 -11
- package/system/dist/addon-runner.js +22 -0
- package/system/dist/addon-runner.mjs +22 -0
- package/system/dist/{agent-https-szf2FU49.mjs → agent-https-BmVaVskH.mjs} +1 -1
- package/system/dist/{agent-https-jJDe-XNl.js → agent-https-DOs15BCJ.js} +1 -1
- package/system/dist/builtins/addon-pages-aggregator/addon-pages-aggregator.addon.js +1 -1
- package/system/dist/builtins/addon-pages-aggregator/addon-pages-aggregator.addon.mjs +1 -1
- package/system/dist/builtins/addon-widgets-aggregator/addon-widgets-aggregator.addon.js +1 -1
- package/system/dist/builtins/addon-widgets-aggregator/addon-widgets-aggregator.addon.mjs +1 -1
- package/system/dist/builtins/alerts/alerts.addon.d.ts +8 -0
- package/system/dist/builtins/alerts/alerts.addon.js +72 -1
- package/system/dist/builtins/alerts/alerts.addon.mjs +72 -1
- package/system/dist/builtins/autotrack/autotrack.addon.d.ts +7 -7
- package/system/dist/builtins/autotrack/index.js +15 -8
- package/system/dist/builtins/autotrack/index.mjs +15 -8
- package/system/dist/builtins/backup-orchestrator/backup-orchestrator.addon.js +2 -2
- package/system/dist/builtins/backup-orchestrator/backup-orchestrator.addon.mjs +2 -2
- package/system/dist/builtins/calendars/calendars.addon.js +1 -1
- package/system/dist/builtins/calendars/calendars.addon.mjs +1 -1
- package/system/dist/builtins/camera-grid/index.js +1 -1
- package/system/dist/builtins/camera-grid/index.mjs +1 -1
- package/system/dist/builtins/composer/composer.addon.js +3 -3
- package/system/dist/builtins/composer/composer.addon.mjs +3 -3
- package/system/dist/builtins/console-logging/index.js +1 -1
- package/system/dist/builtins/console-logging/index.mjs +1 -1
- package/system/dist/builtins/core-blocks/core-blocks.addon.js +11 -5
- package/system/dist/builtins/core-blocks/core-blocks.addon.mjs +11 -5
- package/system/dist/builtins/device-history/device-history.addon.js +2 -2
- package/system/dist/builtins/device-history/device-history.addon.mjs +2 -2
- package/system/dist/builtins/device-manager/device-manager.addon.js +1 -1
- package/system/dist/builtins/device-manager/device-manager.addon.mjs +1 -1
- package/system/dist/builtins/hub-forwarder/index.js +1 -1
- package/system/dist/builtins/hub-forwarder/index.mjs +1 -1
- package/system/dist/builtins/keychain/index.js +4 -4
- package/system/dist/builtins/keychain/index.mjs +4 -4
- package/system/dist/builtins/liveness-monitor/liveness-monitor.addon.js +1 -1
- package/system/dist/builtins/liveness-monitor/liveness-monitor.addon.mjs +1 -1
- package/system/dist/builtins/local-auth/local-auth.addon.js +2 -2
- package/system/dist/builtins/local-auth/local-auth.addon.mjs +2 -2
- package/system/dist/builtins/local-network/local-network.addon.js +2 -2
- package/system/dist/builtins/local-network/local-network.addon.mjs +2 -2
- package/system/dist/builtins/loki-logging/index.js +1 -1
- package/system/dist/builtins/loki-logging/index.mjs +1 -1
- package/system/dist/builtins/native-metrics/native-metrics.addon.js +1 -1
- package/system/dist/builtins/native-metrics/native-metrics.addon.mjs +1 -1
- package/system/dist/builtins/platform-probe/index.js +1 -1
- package/system/dist/builtins/platform-probe/index.mjs +1 -1
- package/system/dist/builtins/record-entries/index.js +1 -1
- package/system/dist/builtins/record-entries/index.mjs +1 -1
- package/system/dist/builtins/remote-access-orchestrator/remote-access-orchestrator.addon.d.ts +4 -10
- package/system/dist/builtins/remote-access-orchestrator/remote-access-orchestrator.addon.js +16 -9
- package/system/dist/builtins/remote-access-orchestrator/remote-access-orchestrator.addon.mjs +16 -9
- package/system/dist/builtins/snapshot/index.js +1 -1
- package/system/dist/builtins/snapshot/index.mjs +1 -1
- package/system/dist/builtins/sqlite-storage/filesystem-storage.addon.js +1 -1
- package/system/dist/builtins/sqlite-storage/filesystem-storage.addon.mjs +1 -1
- package/system/dist/builtins/sqlite-storage/index.js +1 -1
- package/system/dist/builtins/sqlite-storage/index.mjs +1 -1
- package/system/dist/builtins/sqlite-storage/sqlite-settings.addon.js +3 -3
- package/system/dist/builtins/sqlite-storage/sqlite-settings.addon.mjs +3 -3
- package/system/dist/builtins/storage-orchestrator/access-guards.d.ts +1 -1
- package/system/dist/builtins/storage-orchestrator/custom-actions.d.ts +11 -0
- package/system/dist/builtins/storage-orchestrator/index.d.ts +1 -0
- package/system/dist/builtins/storage-orchestrator/index.js +2 -0
- package/system/dist/builtins/storage-orchestrator/index.mjs +2 -2
- package/system/dist/builtins/storage-orchestrator/location-instances.d.ts +72 -0
- package/system/dist/builtins/storage-orchestrator/location-repoint-move.d.ts +1 -1
- package/system/dist/builtins/storage-orchestrator/location-secret-refs.d.ts +26 -0
- package/system/dist/builtins/storage-orchestrator/location-store.d.ts +28 -2
- package/system/dist/builtins/storage-orchestrator/migrations/index.d.ts +9 -2
- package/system/dist/builtins/storage-orchestrator/migrations/legacy-location-secret-refs.d.ts +13 -0
- package/system/dist/builtins/storage-orchestrator/migrations/location-secret-ports.d.ts +15 -0
- package/system/dist/builtins/storage-orchestrator/migrations/location-secrets-to-record.d.ts +57 -0
- package/system/dist/builtins/storage-orchestrator/provider-discovery.d.ts +10 -13
- package/system/dist/builtins/storage-orchestrator/record-kinds.d.ts +6 -0
- package/system/dist/builtins/storage-orchestrator/storage-orchestrator.addon.d.ts +39 -8
- package/system/dist/builtins/storage-orchestrator/storage-orchestrator.addon.js +954 -131
- package/system/dist/builtins/storage-orchestrator/storage-orchestrator.addon.mjs +954 -132
- package/system/dist/builtins/storage-orchestrator/storage-orchestrator.service.d.ts +8 -0
- package/system/dist/builtins/system-config/system-config.addon.js +3 -3
- package/system/dist/builtins/system-config/system-config.addon.mjs +284 -284
- package/system/dist/builtins/winston-logging/index.js +112 -3
- package/system/dist/builtins/winston-logging/index.mjs +112 -3
- package/system/dist/builtins/winston-logging/migrations/index.d.ts +8 -0
- package/system/dist/builtins/winston-logging/migrations/node-fields.d.ts +43 -0
- package/system/dist/builtins/winston-logging/winston-logging.addon.d.ts +10 -2
- package/system/dist/{capture-engine-DNHgjQot.js → capture-engine-BVpkq9Mv.js} +1 -1
- package/system/dist/{capture-engine-BsKY_3xa.mjs → capture-engine-D-oUDtX5.mjs} +1 -1
- package/system/dist/{composition-sources-BRdGsbVT.mjs → composition-sources-Br7JhpbD.mjs} +1 -1
- package/system/dist/{composition-sources-BgO0GQYW.js → composition-sources-DKCbVA67.js} +1 -1
- package/system/dist/{constants-CQeMrR4f.mjs → constants-Bl0Qxbek.mjs} +1 -1
- package/system/dist/{constants-C3jGKQSQ.js → constants-CJVY-mUq.js} +1 -1
- package/system/dist/{device-ca-ByVi5eUC.mjs → device-ca-BeDGy8NK.mjs} +1 -1
- package/system/dist/{device-ca-D3y6wGmn.js → device-ca-i8EbKp3q.js} +1 -1
- package/system/dist/{dist-BsQA6-0i.mjs → dist-CPUbgRkb.mjs} +395 -425
- package/system/dist/{dist-BRI-Mwx0.js → dist-Ddkk4Dqq.js} +412 -424
- package/system/dist/file-host-worker.js +1 -1
- package/system/dist/file-host-worker.mjs +1 -1
- package/system/dist/{hub-mdns-ciao-8dJTW2LI.mjs → hub-mdns-ciao-DgF4SifE.mjs} +2 -2
- package/system/dist/{hub-mdns-ciao-Ry_Jpljx.js → hub-mdns-ciao-lHRHbXqV.js} +2 -2
- package/system/dist/index.js +151 -53
- package/system/dist/index.mjs +151 -55
- package/system/dist/kernel/addon-health-monitor.d.ts +0 -21
- package/system/dist/kernel/index.d.ts +2 -0
- package/system/dist/kernel/transport/child-cap-protocol.d.ts +1 -1
- package/system/dist/kernel/transport/runner-of-addon.d.ts +2 -0
- package/system/dist/kernel/unsupported-addon-tracker.d.ts +74 -0
- package/system/dist/{legacy-integration-rows-door-CjXTbmvH.mjs → legacy-integration-rows-door-9JSt493H.mjs} +1 -1
- package/system/dist/{legacy-integration-rows-door-D5BdSNla.js → legacy-integration-rows-door-n9GIUxgq.js} +1 -1
- package/system/dist/{restore-archive-GoWJMdHy.js → restore-archive-BDvLSZtj.js} +1 -1
- package/system/dist/{restore-archive-vn4co_kf.mjs → restore-archive-Dh3XnCR1.mjs} +82 -82
- package/system/dist/{wal-maintenance-CadfiGWy.mjs → wal-maintenance-BQJAmAwS.mjs} +0 -0
- package/system/dist/{wal-maintenance-sSlXJm4k.js → wal-maintenance-CWlz_qRq.js} +0 -0
- package/system/package.json +4 -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-78tcBemo.mjs
|
|
4
4
|
var EventCategory = /* @__PURE__ */ function(EventCategory) {
|
|
5
5
|
EventCategory["SystemBoot"] = "system.boot";
|
|
6
6
|
EventCategory["SystemAddonsReady"] = "system.addons-ready";
|
|
@@ -121,6 +121,23 @@ var EventCategory = /* @__PURE__ */ function(EventCategory) {
|
|
|
121
121
|
*/
|
|
122
122
|
EventCategory["AddonLoadRecovered"] = "addon.load-recovered";
|
|
123
123
|
/**
|
|
124
|
+
* An addon is RUNNING although its installed package is below what the
|
|
125
|
+
* running server requires (`camstack.requires.addons` of the server, or the
|
|
126
|
+
* addon's own `requires.server`). Raised once per streak by the unsupported-
|
|
127
|
+
* addon tracker, on the hub and on agents; AlertCenter turns it into one
|
|
128
|
+
* operator alert per node and package. The addon is never held back for it.
|
|
129
|
+
*
|
|
130
|
+
* Payload: `{ packageName, addonId, nodeId, installedVersion, requiredMinimum, serverVersion, unmet }`.
|
|
131
|
+
*/
|
|
132
|
+
EventCategory["AddonUnsupportedVersion"] = "addon.unsupported-version";
|
|
133
|
+
/**
|
|
134
|
+
* The package of an {@link AddonUnsupportedVersion} alert reached a supported
|
|
135
|
+
* version, or is no longer installed on the node. AlertCenter dismisses the matching alert.
|
|
136
|
+
*
|
|
137
|
+
* Payload: `{ packageName, addonId, nodeId }`.
|
|
138
|
+
*/
|
|
139
|
+
EventCategory["AddonUnsupportedResolved"] = "addon.unsupported-resolved";
|
|
140
|
+
/**
|
|
124
141
|
* Monitor scheduled the next retry for a failed addon. Transient —
|
|
125
142
|
* surfaced to the UI for live-updating the "next retry in Ns"
|
|
126
143
|
* countdown on the Addons page row, NOT persisted as an alert.
|
|
@@ -231,7 +248,7 @@ var EventCategory = /* @__PURE__ */ function(EventCategory) {
|
|
|
231
248
|
EventCategory["ProcessRestarted"] = "process.restarted";
|
|
232
249
|
/**
|
|
233
250
|
* The SET of storage locations changed — one was created, edited, enabled,
|
|
234
|
-
* disabled or deleted through
|
|
251
|
+
* disabled or deleted through the location instances or the forced-delete action.
|
|
235
252
|
*
|
|
236
253
|
* Telemetry, not a transaction (D8/D11): every consumer that re-resolves on
|
|
237
254
|
* it must also converge on its own periodic path, because a dropped event
|
|
@@ -1171,7 +1188,7 @@ var DeviceRole = /* @__PURE__ */ function(DeviceRole) {
|
|
|
1171
1188
|
return DeviceRole;
|
|
1172
1189
|
}({});
|
|
1173
1190
|
//#endregion
|
|
1174
|
-
//#region ../types/dist/sleep-
|
|
1191
|
+
//#region ../types/dist/sleep-CQP-REJp.mjs
|
|
1175
1192
|
/**
|
|
1176
1193
|
* The audio chunk plane's byte format, and the ONE expansion from a coded
|
|
1177
1194
|
* window to float samples (D455).
|
|
@@ -1269,7 +1286,7 @@ var AddonMigrationsBlockedError = class extends Error {
|
|
|
1269
1286
|
/**
|
|
1270
1287
|
* The value a redacted secret is replaced with on every read surface.
|
|
1271
1288
|
*
|
|
1272
|
-
* It is also the WRITE-BACK token:
|
|
1289
|
+
* It is also the WRITE-BACK token: a save that sends this value
|
|
1273
1290
|
* back for a key means "keep what is stored", which is what lets an operator
|
|
1274
1291
|
* rename a location without retyping its password. A literal an operator could
|
|
1275
1292
|
* plausibly choose as a real password would turn that convenience into a way
|
|
@@ -1583,6 +1600,59 @@ var WELL_KNOWN_TAB_MAP = Object.fromEntries([
|
|
|
1583
1600
|
function isValuelessField(field) {
|
|
1584
1601
|
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" || field.type === "account-sign-in" || field.type === "secret-presence";
|
|
1585
1602
|
}
|
|
1603
|
+
/**
|
|
1604
|
+
* Base collector: flatten a hydrated `ConfigUISchemaWithValues` into
|
|
1605
|
+
* `key → { value, default }`, recursing through `group` and `sub-tabs`
|
|
1606
|
+
* layout fields. Keeping `value` and `default` SEPARATE (rather than
|
|
1607
|
+
* pre-resolving) lets callers both read the effective value AND detect
|
|
1608
|
+
* overrides (`value` differs from `default`). Structural over `unknown`;
|
|
1609
|
+
* malformed input yields an empty map, never throws.
|
|
1610
|
+
*/
|
|
1611
|
+
function collectHydratedFieldEntries(schema) {
|
|
1612
|
+
const out = /* @__PURE__ */ new Map();
|
|
1613
|
+
if (typeof schema !== "object" || schema === null) return out;
|
|
1614
|
+
const sections = schema.sections;
|
|
1615
|
+
if (!Array.isArray(sections)) return out;
|
|
1616
|
+
for (const section of sections) if (typeof section === "object" && section !== null) collectFieldEntriesInto(section.fields, out);
|
|
1617
|
+
return out;
|
|
1618
|
+
}
|
|
1619
|
+
/** Recursive field walker for {@link collectHydratedFieldEntries}. */
|
|
1620
|
+
function collectFieldEntriesInto(fields, into) {
|
|
1621
|
+
if (!Array.isArray(fields)) return;
|
|
1622
|
+
for (const field of fields) {
|
|
1623
|
+
if (typeof field !== "object" || field === null) continue;
|
|
1624
|
+
const type = field.type;
|
|
1625
|
+
if (type === "group") {
|
|
1626
|
+
collectFieldEntriesInto(field.fields, into);
|
|
1627
|
+
continue;
|
|
1628
|
+
}
|
|
1629
|
+
if (type === "sub-tabs") {
|
|
1630
|
+
const tabs = field.tabs;
|
|
1631
|
+
if (Array.isArray(tabs)) {
|
|
1632
|
+
for (const tab of tabs) if (typeof tab === "object" && tab !== null) collectFieldEntriesInto(tab.fields, into);
|
|
1633
|
+
}
|
|
1634
|
+
continue;
|
|
1635
|
+
}
|
|
1636
|
+
const key = field.key;
|
|
1637
|
+
if (typeof key !== "string" || key.length === 0) continue;
|
|
1638
|
+
if (!("value" in field)) continue;
|
|
1639
|
+
into.set(key, {
|
|
1640
|
+
value: field.value,
|
|
1641
|
+
default: field.default
|
|
1642
|
+
});
|
|
1643
|
+
}
|
|
1644
|
+
}
|
|
1645
|
+
/**
|
|
1646
|
+
* Flatten a hydrated settings payload into `key → EFFECTIVE value`
|
|
1647
|
+
* (`value ?? default`). The read-side inverse of `hydrateSchema` for the
|
|
1648
|
+
* common "just give me the resolved values" case. Built on
|
|
1649
|
+
* {@link collectHydratedFieldEntries}.
|
|
1650
|
+
*/
|
|
1651
|
+
function collectHydratedFieldValues(schema) {
|
|
1652
|
+
const out = /* @__PURE__ */ new Map();
|
|
1653
|
+
for (const [key, entry] of collectHydratedFieldEntries(schema)) out.set(key, entry.value ?? entry.default);
|
|
1654
|
+
return out;
|
|
1655
|
+
}
|
|
1586
1656
|
function hydrateSchema(schema, values, options = {}) {
|
|
1587
1657
|
return {
|
|
1588
1658
|
...schema.tabs ? { tabs: [...schema.tabs] } : {},
|
|
@@ -2586,17 +2656,35 @@ var RecordIntegrationInstances = class {
|
|
|
2586
2656
|
...kind !== void 0 ? { kind } : {}
|
|
2587
2657
|
});
|
|
2588
2658
|
if (minted === void 0) throw new Error("createInstance needs an id: this provider does not mint one");
|
|
2659
|
+
const initial = this.hooks.initialBody(name, kind);
|
|
2660
|
+
const patch = this.patchOf(values ?? {});
|
|
2661
|
+
if (Object.keys(patch).length > 0) Object.assign(patch, await this.hooks.validateWrite?.({
|
|
2662
|
+
kind,
|
|
2663
|
+
body: {
|
|
2664
|
+
...initial,
|
|
2665
|
+
...patch
|
|
2666
|
+
}
|
|
2667
|
+
}));
|
|
2589
2668
|
await this.handle.put({
|
|
2590
2669
|
id: minted,
|
|
2591
|
-
data:
|
|
2670
|
+
data: initial
|
|
2592
2671
|
}, { ifRev: 0 });
|
|
2593
|
-
const patch = this.patchOf(values ?? {});
|
|
2594
2672
|
if (Object.keys(patch).length > 0) await this.handle.patch(minted, patch);
|
|
2595
2673
|
await this.hooks.onChanged?.(minted, "created");
|
|
2596
2674
|
return { id: minted };
|
|
2597
2675
|
};
|
|
2598
2676
|
updateInstance = async ({ id, name, values }) => {
|
|
2599
2677
|
const patch = this.patchOf(values);
|
|
2678
|
+
if (this.hooks.validateWrite !== void 0 && Object.keys(patch).length > 0) {
|
|
2679
|
+
const stored = await this.handle.get(id);
|
|
2680
|
+
if (stored !== null) Object.assign(patch, await this.hooks.validateWrite({
|
|
2681
|
+
kind: void 0,
|
|
2682
|
+
body: {
|
|
2683
|
+
...stored.data,
|
|
2684
|
+
...patch
|
|
2685
|
+
}
|
|
2686
|
+
}));
|
|
2687
|
+
}
|
|
2600
2688
|
if (name !== void 0) patch[this.nameField] = name;
|
|
2601
2689
|
await this.handle.patch(id, patch);
|
|
2602
2690
|
await this.hooks.onChanged?.(id, "updated");
|
|
@@ -2918,6 +3006,21 @@ function nodeIdOfScopedKey(key) {
|
|
|
2918
3006
|
const nodeId = key.slice(at + 1);
|
|
2919
3007
|
return nodeId === "" ? null : nodeId;
|
|
2920
3008
|
}
|
|
3009
|
+
/** The one refusal of a key a scope did not declare. */
|
|
3010
|
+
function assertDeclaredKeys(keys, declared) {
|
|
3011
|
+
const undeclared = keys.filter((key) => !declared.has(key));
|
|
3012
|
+
if (undeclared.length > 0) throw new Error(`scoped settings: [${undeclared.join(", ")}] not declared for this scope (declared: [${[...declared].join(", ")}])`);
|
|
3013
|
+
}
|
|
3014
|
+
/** Build the handle over an addon's scoped read, write and unset. */
|
|
3015
|
+
function createScopedSettings(deps) {
|
|
3016
|
+
return {
|
|
3017
|
+
async get() {
|
|
3018
|
+
return deps.schema.parse(await deps.read());
|
|
3019
|
+
},
|
|
3020
|
+
patch: (patch) => deps.write(Object.fromEntries(Object.entries(patch))),
|
|
3021
|
+
unset: (keys) => deps.unset(keys)
|
|
3022
|
+
};
|
|
3023
|
+
}
|
|
2921
3024
|
/** A write to a secret path could not be stored in the keychain, so it was refused. */
|
|
2922
3025
|
var KeychainWriteRefusedError = class extends Error {
|
|
2923
3026
|
fieldPath;
|
|
@@ -3493,7 +3596,16 @@ function createHandle(raw, opts) {
|
|
|
3493
3596
|
return blob;
|
|
3494
3597
|
}
|
|
3495
3598
|
},
|
|
3496
|
-
writeAddonStore: writeAddon
|
|
3599
|
+
writeAddonStore: writeAddon,
|
|
3600
|
+
removeClearedKeys: (keys) => serialize("addon", async () => {
|
|
3601
|
+
const stored = await readStoredAddonBlob(raw);
|
|
3602
|
+
index.seen("addon", stored);
|
|
3603
|
+
const removable = keys.filter((key) => collectSecretMarkerRefs(stored[key]).length === 0);
|
|
3604
|
+
if (removable.length === 0) return;
|
|
3605
|
+
const patch = Object.fromEntries(removable.map((key) => [key, void 0]));
|
|
3606
|
+
await raw.writeAddonStore(patch);
|
|
3607
|
+
index.wrote("addon", patch);
|
|
3608
|
+
})
|
|
3497
3609
|
};
|
|
3498
3610
|
}
|
|
3499
3611
|
/** The context the addon sees, plus the private raw view and write outcome. */
|
|
@@ -4051,6 +4163,151 @@ var BaseAddon = class {
|
|
|
4051
4163
|
}
|
|
4052
4164
|
}
|
|
4053
4165
|
/**
|
|
4166
|
+
* Hook: values layered over the stored ones when the FORM of one scope is served
|
|
4167
|
+
* ({@link getScopedSettings}) — a preview that derives dependent options without writing.
|
|
4168
|
+
* Never applied to {@link ScopedSettings.get} or to a write. `null` ⇒ no overlay.
|
|
4169
|
+
*/
|
|
4170
|
+
async scopedSettingsOverlay(_scope, _cap, _nodeId) {
|
|
4171
|
+
return null;
|
|
4172
|
+
}
|
|
4173
|
+
/**
|
|
4174
|
+
* Hook: a write of one scope changed stored values (not called when the store reports no change,
|
|
4175
|
+
* e.g. the write-back of a stored secret). `keys` are the bare field keys of the write, node keys included.
|
|
4176
|
+
*/
|
|
4177
|
+
async onScopedSettingsChanged(_scope, _cap, _keys) {}
|
|
4178
|
+
/** Typed handle over the CLUSTER settings `cap` declares (`clusterSettingsSchema`). */
|
|
4179
|
+
clusterSettings(cap, schema) {
|
|
4180
|
+
return this.scopedHandle("cluster", cap, schema);
|
|
4181
|
+
}
|
|
4182
|
+
/** Typed handle over the fleet defaults of the per-device settings `cap` declares. */
|
|
4183
|
+
deviceDefaults(cap, schema) {
|
|
4184
|
+
return this.scopedHandle("device-defaults", cap, schema);
|
|
4185
|
+
}
|
|
4186
|
+
/**
|
|
4187
|
+
* Typed handle over the settings `cap` owns PER NODE. `nodeId` omitted ⇒ the local node. A node
|
|
4188
|
+
* with no row yields the schema defaults — never a bare-key fallback.
|
|
4189
|
+
*/
|
|
4190
|
+
nodeSettings(cap, schema, nodeId) {
|
|
4191
|
+
return this.scopedHandle("node", cap, schema, nodeId);
|
|
4192
|
+
}
|
|
4193
|
+
/**
|
|
4194
|
+
* {@link state} for a value that is kept per node: stored under `<key>@<nodeId>`, and the
|
|
4195
|
+
* settings store carries `nodeId` in the row data (D986 §1), so a forgotten node's rows go in one
|
|
4196
|
+
* central delete. `nodeId` omitted ⇒ the local node.
|
|
4197
|
+
*/
|
|
4198
|
+
nodeState(key, schema, fallback, nodeId) {
|
|
4199
|
+
this._declaredStateKeys.add(key);
|
|
4200
|
+
return createDurableState({
|
|
4201
|
+
key: nodeScopedKey(key, nodeId ?? this._ctx?.kernel?.localNodeId ?? ""),
|
|
4202
|
+
schema,
|
|
4203
|
+
fallback,
|
|
4204
|
+
read: async () => this.resolveStoredSecrets(await this.readAddonStoreWithRetry()),
|
|
4205
|
+
write: async (patch) => {
|
|
4206
|
+
await this._ctx?.settings?.writeAddonStore(patch);
|
|
4207
|
+
},
|
|
4208
|
+
onParseError: (k, e) => this._ctx?.logger?.warn?.(`durable-state: stored "${k}" failed validation — using fallback`, { meta: {
|
|
4209
|
+
addonId: this._ctx?.id,
|
|
4210
|
+
key: k,
|
|
4211
|
+
error: String(e)
|
|
4212
|
+
} })
|
|
4213
|
+
});
|
|
4214
|
+
}
|
|
4215
|
+
/** The loaded schema `cap` declares for `scope`, or `null`. */
|
|
4216
|
+
async declaredScopedSchema(scope, cap) {
|
|
4217
|
+
await this.loadScopedSchemas(cap);
|
|
4218
|
+
return this.loadedScopedSchemas(cap).find((entry) => entry.scope === scope)?.schema ?? null;
|
|
4219
|
+
}
|
|
4220
|
+
async requireScopedSchema(scope, cap) {
|
|
4221
|
+
const schema = await this.declaredScopedSchema(scope, cap);
|
|
4222
|
+
if (schema === null) throw new Error(`${this.constructor.name}: cap "${cap}" declares no ${scope} settings`);
|
|
4223
|
+
return schema;
|
|
4224
|
+
}
|
|
4225
|
+
scopedKeys(schema) {
|
|
4226
|
+
return new Set(schema.sections.flatMap((section) => collectValueFieldKeys(section.fields)));
|
|
4227
|
+
}
|
|
4228
|
+
/** `store` narrowed to the keys `schema` declares. */
|
|
4229
|
+
narrowToScope(store, schema) {
|
|
4230
|
+
const keys = this.scopedKeys(schema);
|
|
4231
|
+
return Object.fromEntries(Object.entries(store).filter(([key]) => keys.has(key)));
|
|
4232
|
+
}
|
|
4233
|
+
scopedHandle(scope, cap, schema, nodeId) {
|
|
4234
|
+
return createScopedSettings({
|
|
4235
|
+
schema,
|
|
4236
|
+
read: async () => {
|
|
4237
|
+
const declared = await this.requireScopedSchema(scope, cap);
|
|
4238
|
+
const stored = this.narrowToScope(await this.resolveGlobalStore(nodeId, cap), declared);
|
|
4239
|
+
const effective = collectHydratedFieldValues(hydrateSchema(declared, stored));
|
|
4240
|
+
return {
|
|
4241
|
+
...Object.fromEntries([...effective].filter(([, value]) => value !== void 0)),
|
|
4242
|
+
...stored
|
|
4243
|
+
};
|
|
4244
|
+
},
|
|
4245
|
+
write: (patch) => this.writeScoped(scope, cap, patch, nodeId),
|
|
4246
|
+
unset: (keys) => this.unsetScoped(scope, cap, keys, nodeId)
|
|
4247
|
+
});
|
|
4248
|
+
}
|
|
4249
|
+
/** The one write path of the scoped API: declared keys only, then the global patch. */
|
|
4250
|
+
async writeScoped(scope, cap, patch, nodeId) {
|
|
4251
|
+
assertDeclaredKeys(Object.keys(patch), this.scopedKeys(await this.requireScopedSchema(scope, cap)));
|
|
4252
|
+
if (await this.applyGlobalPatch(patch, scope === "node" ? nodeId : void 0, cap)) await this.onScopedSettingsChanged(scope, cap, Object.keys(patch));
|
|
4253
|
+
}
|
|
4254
|
+
/**
|
|
4255
|
+
* Remove declared keys of one scope. A secret goes through {@link clearSecrets} — its keychain
|
|
4256
|
+
* value is released exactly as there — and the emptied row is then removed; every other key is
|
|
4257
|
+
* removed by an `undefined` patch (which a secret transform would read as "keep").
|
|
4258
|
+
*/
|
|
4259
|
+
async unsetScoped(scope, cap, keys, nodeId) {
|
|
4260
|
+
assertDeclaredKeys(keys, this.scopedKeys(await this.requireScopedSchema(scope, cap)));
|
|
4261
|
+
const target = scope === "node" ? nodeId : void 0;
|
|
4262
|
+
const tree = this.addonSecretTree();
|
|
4263
|
+
const secretKeys = keys.filter((key) => tree.has(key));
|
|
4264
|
+
const plainKeys = keys.filter((key) => !tree.has(key));
|
|
4265
|
+
let changed = false;
|
|
4266
|
+
if (plainKeys.length > 0) {
|
|
4267
|
+
const patch = Object.fromEntries(plainKeys.map((key) => [key, void 0]));
|
|
4268
|
+
changed = await this.applyGlobalPatch(patch, target, cap) || changed;
|
|
4269
|
+
}
|
|
4270
|
+
if (secretKeys.length > 0) {
|
|
4271
|
+
await this.clearSecretKeys(secretKeys, target, cap);
|
|
4272
|
+
const node = normalizeNodeId(target ?? this._ctx?.kernel?.localNodeId);
|
|
4273
|
+
const rows = secretKeys.map((key) => scope === "node" ? nodeScopedKey(key, node) : key);
|
|
4274
|
+
if (this._secretSettings !== null) await this._secretSettings.removeClearedKeys(rows);
|
|
4275
|
+
else await this._ctx?.settings?.writeAddonStore(Object.fromEntries(rows.map((row) => [row, void 0])));
|
|
4276
|
+
changed = true;
|
|
4277
|
+
}
|
|
4278
|
+
if (changed) await this.onScopedSettingsChanged(scope, cap, [...keys]);
|
|
4279
|
+
}
|
|
4280
|
+
/**
|
|
4281
|
+
* The hydrated form of one scope of one capability's settings (any
|
|
4282
|
+
* {@link scopedSettingsOverlay} applied), or `null` when the capability declares nothing there.
|
|
4283
|
+
*/
|
|
4284
|
+
async getScopedSettings(scope, cap, nodeId) {
|
|
4285
|
+
const schema = await this.declaredScopedSchema(scope, cap);
|
|
4286
|
+
if (schema === null) return null;
|
|
4287
|
+
const stored = this.narrowToScope(await this.readRawProjectedStore(nodeId, cap), schema);
|
|
4288
|
+
const overlay = await this.scopedSettingsOverlay(scope, cap, nodeId);
|
|
4289
|
+
return hydrateSchema(schema, overlay ? await this.overlayKeepingMarkers(stored, overlay) : stored, { inlineSecretsAsViews: true });
|
|
4290
|
+
}
|
|
4291
|
+
/** The OPERATOR's write of declared keys of one scope (D787 secret semantics). */
|
|
4292
|
+
async updateScopedSettings(scope, cap, patch, nodeId) {
|
|
4293
|
+
this._operatorWriteDepth++;
|
|
4294
|
+
try {
|
|
4295
|
+
await this.writeScoped(scope, cap, patch, nodeId);
|
|
4296
|
+
} finally {
|
|
4297
|
+
this._operatorWriteDepth--;
|
|
4298
|
+
}
|
|
4299
|
+
}
|
|
4300
|
+
/**
|
|
4301
|
+
* The effective values (`stored ?? default`) of one scope, a secret as its `set` view — never
|
|
4302
|
+
* its value. `null` when the capability declares nothing for the scope.
|
|
4303
|
+
*/
|
|
4304
|
+
async readScopedValues(scope, cap, nodeId) {
|
|
4305
|
+
const schema = await this.declaredScopedSchema(scope, cap);
|
|
4306
|
+
if (schema === null) return null;
|
|
4307
|
+
const form = hydrateSchema(schema, this.narrowToScope(await this.readRawProjectedStore(nodeId, cap), schema), { inlineSecretsAsViews: true });
|
|
4308
|
+
return Object.fromEntries([...collectHydratedFieldValues(form)].filter(([, value]) => value !== void 0));
|
|
4309
|
+
}
|
|
4310
|
+
/**
|
|
4054
4311
|
* What the create wizard and the integration edit page render for one instance: the addon's
|
|
4055
4312
|
* per-instance schema when it declares one, else its global schema (what they always showed).
|
|
4056
4313
|
*/
|
|
@@ -4202,6 +4459,9 @@ var BaseAddon = class {
|
|
|
4202
4459
|
* a keychain (an older kernel) it writes `''`, as such code always did.
|
|
4203
4460
|
*/
|
|
4204
4461
|
async clearSecrets(keys, nodeId) {
|
|
4462
|
+
await this.clearSecretKeys(keys, nodeId);
|
|
4463
|
+
}
|
|
4464
|
+
async clearSecretKeys(keys, nodeId, cap) {
|
|
4205
4465
|
const tree = this.addonSecretTree();
|
|
4206
4466
|
const keychain = this._ctx?.secrets !== void 0;
|
|
4207
4467
|
const stored = keychain ? await this.readAddonStoreWithRetry() : {};
|
|
@@ -4214,25 +4474,27 @@ var BaseAddon = class {
|
|
|
4214
4474
|
const keychainStored = tree.has(key) || collectSecretMarkerRefs(stored[key]).length > 0;
|
|
4215
4475
|
patch[key] = keychain && keychainStored ? SECRET_CLEAR : "";
|
|
4216
4476
|
}
|
|
4217
|
-
await this.applyGlobalPatch(patch, nodeId);
|
|
4477
|
+
await this.applyGlobalPatch(patch, nodeId, cap);
|
|
4218
4478
|
}
|
|
4219
|
-
|
|
4220
|
-
|
|
4221
|
-
|
|
4479
|
+
/** Resolves `true` when the write changed stored values. */
|
|
4480
|
+
async applyGlobalPatch(barePatch, nodeId, cap) {
|
|
4481
|
+
await this.loadScopedSchemas(cap);
|
|
4482
|
+
const keys = this.perNodeKeys(cap);
|
|
4222
4483
|
const localNode = normalizeNodeId(this._ctx?.kernel?.localNodeId);
|
|
4223
4484
|
const target = normalizeNodeId(nodeId ?? this._ctx?.kernel?.localNodeId);
|
|
4224
4485
|
const scoped = keys.size > 0 ? scopePatch(barePatch, keys, target) : barePatch;
|
|
4225
4486
|
const handle = this._secretSettings;
|
|
4226
4487
|
if (handle !== null) {
|
|
4227
4488
|
const { changed } = await handle.writeAddonStore(scoped);
|
|
4228
|
-
if (!changed) return;
|
|
4489
|
+
if (!changed) return false;
|
|
4229
4490
|
} else await this._ctx?.settings?.writeAddonStore(scoped);
|
|
4230
|
-
if (target !== localNode) return;
|
|
4491
|
+
if (target !== localNode) return true;
|
|
4231
4492
|
await this.resolveConfig();
|
|
4232
4493
|
await this.onConfigChanged();
|
|
4233
4494
|
this.emitLifecycle(EventCategory.AddonUpdated, { level: "global" });
|
|
4234
4495
|
const legacy = this.globalSettingsSchema();
|
|
4235
4496
|
this.maybeAutoRestart(Object.keys(barePatch), [...legacy === null ? [] : [legacy], ...this.loadedScopedSchemas().map((entry) => entry.schema)]);
|
|
4497
|
+
return true;
|
|
4236
4498
|
}
|
|
4237
4499
|
/**
|
|
4238
4500
|
* The set of field keys the global settings schema declares `perNode: true`
|
|
@@ -6798,7 +7060,6 @@ var CAP_NAMES = Object.freeze([
|
|
|
6798
7060
|
"notifier",
|
|
6799
7061
|
"numeric-sensor",
|
|
6800
7062
|
"oauth-integration",
|
|
6801
|
-
"oidc-connections",
|
|
6802
7063
|
"osd",
|
|
6803
7064
|
"osd-manager",
|
|
6804
7065
|
"pet-feeder",
|
|
@@ -8690,8 +8951,7 @@ Object.freeze({
|
|
|
8690
8951
|
"device-provider": { "reloadDevice": 18e4 },
|
|
8691
8952
|
"llm": {
|
|
8692
8953
|
"generate": 6e5,
|
|
8693
|
-
"generateVision": 6e5
|
|
8694
|
-
"testProfile": 6e5
|
|
8954
|
+
"generateVision": 6e5
|
|
8695
8955
|
},
|
|
8696
8956
|
"llm-runtime": {
|
|
8697
8957
|
"complete": 6e5,
|
|
@@ -11827,17 +12087,18 @@ var IntegrationInstanceRefSchema = zod.z.object({
|
|
|
11827
12087
|
* message to what the kind supports — callers never special-case a service.
|
|
11828
12088
|
*
|
|
11829
12089
|
* DESIGN DECISIONS (locked):
|
|
11830
|
-
* -
|
|
11831
|
-
*
|
|
11832
|
-
*
|
|
11833
|
-
*
|
|
11834
|
-
*
|
|
11835
|
-
*
|
|
11836
|
-
*
|
|
11837
|
-
*
|
|
11838
|
-
*
|
|
11839
|
-
* routable. `send` / `testTarget` /
|
|
11840
|
-
* `
|
|
12090
|
+
* - A target is an INSTANCE of this function cap (epic #440, step 6): the
|
|
12091
|
+
* providers serve their targets as `integration-instances` records, one
|
|
12092
|
+
* record kind per target kind, and the admin lists, adds, edits, switches
|
|
12093
|
+
* and deletes them through that cap. This cap keeps what an instance cannot
|
|
12094
|
+
* say: the kind catalogue (`listTargetKinds`: capabilities, delivery
|
|
12095
|
+
* parameters, brand icon), dispatch (`send`, `testTarget`) and the form
|
|
12096
|
+
* helpers (`discoverTargets`, `probeTargetConfig`).
|
|
12097
|
+
* - `listTargetKinds` / `discoverTargets` return arrays → the generated
|
|
12098
|
+
* cap-mount auto-`concatCollection`-fans them across every registered
|
|
12099
|
+
* provider so one catalog is routable. `send` / `testTarget` /
|
|
12100
|
+
* `probeTargetConfig` route to ONE provider by the `addonId` the generated
|
|
12101
|
+
* collection router extracts from the call input.
|
|
11841
12102
|
* - `Attachment.bytes` is `Uint8Array`. Transport-safe: superjson (the tRPC
|
|
11842
12103
|
* transformer) + UDS MsgPack both round-trip typed arrays — already used by
|
|
11843
12104
|
* `storage` / `storage-provider` / `recording` caps over the same path. No
|
|
@@ -12084,7 +12345,7 @@ var TargetKindCapsSchema = zod.z.object({
|
|
|
12084
12345
|
* the union is large and not meant for runtime validation here; the exported
|
|
12085
12346
|
* `TargetKind` type re-tightens `configSchema` to `ConfigUISchema`.
|
|
12086
12347
|
*/
|
|
12087
|
-
var ConfigSchemaPassthrough$
|
|
12348
|
+
var ConfigSchemaPassthrough$3 = zod.z.unknown();
|
|
12088
12349
|
var TargetKindSchema = zod.z.object({
|
|
12089
12350
|
kind: zod.z.string(),
|
|
12090
12351
|
label: zod.z.string(),
|
|
@@ -12121,7 +12382,7 @@ var TargetKindSchema = zod.z.object({
|
|
|
12121
12382
|
* its raster path, which is the safe default for an unknown image.
|
|
12122
12383
|
*/
|
|
12123
12384
|
iconMediaType: zod.z.string().optional(),
|
|
12124
|
-
configSchema: ConfigSchemaPassthrough$
|
|
12385
|
+
configSchema: ConfigSchemaPassthrough$3,
|
|
12125
12386
|
/**
|
|
12126
12387
|
* The config keys that decide WHERE this kind's secrets are sent (server,
|
|
12127
12388
|
* base URL, instance, chat, recipient). A save that changes any of them
|
|
@@ -12143,9 +12404,11 @@ var TargetKindSchema = zod.z.object({
|
|
|
12143
12404
|
caps: TargetKindCapsSchema
|
|
12144
12405
|
});
|
|
12145
12406
|
/**
|
|
12146
|
-
* A
|
|
12147
|
-
*
|
|
12148
|
-
*
|
|
12407
|
+
* A target as a provider's own code sees it (the notification-center bridge, the
|
|
12408
|
+
* send path): the flat record body split into the name, the switch and the
|
|
12409
|
+
* kind's fields. `config` holds secrets; a reader that serves it to a client
|
|
12410
|
+
* REDACTS secret fields (a presence marker only) — never round-trip a stored
|
|
12411
|
+
* secret to the UI.
|
|
12149
12412
|
*/
|
|
12150
12413
|
var TargetSchema = zod.z.object({
|
|
12151
12414
|
id: zod.z.string(),
|
|
@@ -12194,21 +12457,13 @@ var notificationOutputCapability = {
|
|
|
12194
12457
|
mode: "collection",
|
|
12195
12458
|
methods: {
|
|
12196
12459
|
listTargetKinds: method(zod.z.object({}), zod.z.array(TargetKindSchema)),
|
|
12197
|
-
listTargets: method(zod.z.object({}), zod.z.array(TargetSchema), { auth: "admin" }),
|
|
12198
|
-
/**
|
|
12199
|
-
* One target WITH secrets — admin edit / duplicate hydration only.
|
|
12200
|
-
* `listTargets` stays redacted; the editor loads this so password fields
|
|
12201
|
-
* are filled (masked in the input) and a save can round-trip the token
|
|
12202
|
-
* when a destination changes (Duplicate with a new chatId, etc.).
|
|
12203
|
-
*/
|
|
12204
|
-
getTarget: method(zod.z.object({ targetId: zod.z.string() }), TargetSchema, { auth: "admin" }),
|
|
12205
12460
|
discoverTargets: method(zod.z.object({
|
|
12206
12461
|
kind: zod.z.string(),
|
|
12207
12462
|
config: zod.z.record(zod.z.string(), zod.z.unknown()).optional(),
|
|
12208
12463
|
/**
|
|
12209
12464
|
* When editing / duplicating, the blank password field never round-trips
|
|
12210
12465
|
* the stored token. Pass the source target id so the provider can restore
|
|
12211
|
-
* secrets server-side before dialling
|
|
12466
|
+
* secrets server-side before dialling.
|
|
12212
12467
|
*/
|
|
12213
12468
|
targetId: zod.z.string().optional()
|
|
12214
12469
|
}), zod.z.array(DiscoveredTargetSchema), { auth: "admin" }),
|
|
@@ -12234,30 +12489,6 @@ var notificationOutputCapability = {
|
|
|
12234
12489
|
}), TestResultSchema, {
|
|
12235
12490
|
kind: "mutation",
|
|
12236
12491
|
auth: "admin"
|
|
12237
|
-
}),
|
|
12238
|
-
upsertTarget: method(zod.z.object({
|
|
12239
|
-
target: TargetSchema,
|
|
12240
|
-
/**
|
|
12241
|
-
* Duplicate flow: create a NEW target id while copying secrets from an
|
|
12242
|
-
* existing row. The UI never holds the stored token; blank / redacted
|
|
12243
|
-
* password fields are restored from this source (D634 still applies if
|
|
12244
|
-
* destinations diverge without a re-typed secret).
|
|
12245
|
-
*/
|
|
12246
|
-
cloneSecretsFrom: zod.z.string().optional()
|
|
12247
|
-
}), TargetSchema, {
|
|
12248
|
-
kind: "mutation",
|
|
12249
|
-
auth: "admin"
|
|
12250
|
-
}),
|
|
12251
|
-
deleteTarget: method(zod.z.object({ targetId: zod.z.string() }), zod.z.void(), {
|
|
12252
|
-
kind: "mutation",
|
|
12253
|
-
auth: "admin"
|
|
12254
|
-
}),
|
|
12255
|
-
setTargetEnabled: method(zod.z.object({
|
|
12256
|
-
targetId: zod.z.string(),
|
|
12257
|
-
enabled: zod.z.boolean()
|
|
12258
|
-
}), zod.z.void(), {
|
|
12259
|
-
kind: "mutation",
|
|
12260
|
-
auth: "admin"
|
|
12261
12492
|
})
|
|
12262
12493
|
}
|
|
12263
12494
|
};
|
|
@@ -15437,6 +15668,36 @@ function withLocationMode(location, mode) {
|
|
|
15437
15668
|
config: strippedOfLegacyReadOnly(location.config)
|
|
15438
15669
|
};
|
|
15439
15670
|
}
|
|
15671
|
+
/** Is the row switch of a location ON? Only a location that is written to reads as on. */
|
|
15672
|
+
function switchStateOfMode(mode) {
|
|
15673
|
+
return modeMayWrite(mode);
|
|
15674
|
+
}
|
|
15675
|
+
/**
|
|
15676
|
+
* The move a row switch makes. The switch is a two-state view of a four-state mode, so it only
|
|
15677
|
+
* crosses the active/not-active line and never cancels a retirement:
|
|
15678
|
+
*
|
|
15679
|
+
* - on: `readonly` and `disabled` become `active`; `active` stays; a `drain` is REFUSED
|
|
15680
|
+
* (turning it on would silently cancel the drain; the mode select ends it on purpose).
|
|
15681
|
+
* - off: `active` becomes `readonly`; `readonly`, `disabled` and `drain` already are not
|
|
15682
|
+
* written to and stay as they are.
|
|
15683
|
+
*/
|
|
15684
|
+
function modeForSwitch(on, current) {
|
|
15685
|
+
if (on) {
|
|
15686
|
+
if (current === "active") return { kind: "keep" };
|
|
15687
|
+
if (current === "drain") return {
|
|
15688
|
+
kind: "refuse",
|
|
15689
|
+
reason: "the location is draining; end the drain by changing its mode, not with the switch"
|
|
15690
|
+
};
|
|
15691
|
+
return {
|
|
15692
|
+
kind: "set",
|
|
15693
|
+
mode: "active"
|
|
15694
|
+
};
|
|
15695
|
+
}
|
|
15696
|
+
return current === "active" ? {
|
|
15697
|
+
kind: "set",
|
|
15698
|
+
mode: "readonly"
|
|
15699
|
+
} : { kind: "keep" };
|
|
15700
|
+
}
|
|
15440
15701
|
/**
|
|
15441
15702
|
* `StorageLocationType` — an addon-declared id that identifies the *kind* of
|
|
15442
15703
|
* storage a location serves. Defined here (not in `capabilities/storage.cap.ts`)
|
|
@@ -21342,7 +21603,6 @@ var SYSTEM_CAP_VOCABULARY = {
|
|
|
21342
21603
|
"notification-output": system("notification delivery — reached through notifier devices and rules"),
|
|
21343
21604
|
"notification-rules": system("notification rules — authored on their own page"),
|
|
21344
21605
|
"oauth-integration": system(IDENTITY),
|
|
21345
|
-
"oidc-connections": system(IDENTITY),
|
|
21346
21606
|
"osd-manager": system(PIPELINE),
|
|
21347
21607
|
"pipeline-executor": system(PIPELINE),
|
|
21348
21608
|
"pipeline-orchestrator": system(PIPELINE),
|
|
@@ -45442,6 +45702,8 @@ var SettingsSchemaWithValuesSchema = zod.z.object({
|
|
|
45442
45702
|
});
|
|
45443
45703
|
/** Patch object — keys are field names, values are the new field values. */
|
|
45444
45704
|
var SettingsPatchSchema = zod.z.record(zod.z.string(), zod.z.unknown());
|
|
45705
|
+
/** The scope of a scoped-settings call (D986): where the capability declared the values. */
|
|
45706
|
+
var ScopedSettingsScopeSchema = zod.z.enum(SCOPED_SETTINGS_SCOPES);
|
|
45445
45707
|
/** Standard success response for update operations. */
|
|
45446
45708
|
var SettingsUpdateResultSchema = zod.z.object({ success: zod.z.literal(true) });
|
|
45447
45709
|
/**
|
|
@@ -45490,6 +45752,28 @@ var addonSettingsCapability = {
|
|
|
45490
45752
|
kind: "mutation",
|
|
45491
45753
|
auth: "admin"
|
|
45492
45754
|
}),
|
|
45755
|
+
getScopedSettings: method(zod.z.object({
|
|
45756
|
+
addonId: zod.z.string(),
|
|
45757
|
+
cap: zod.z.string(),
|
|
45758
|
+
scope: ScopedSettingsScopeSchema,
|
|
45759
|
+
nodeId: zod.z.string().optional()
|
|
45760
|
+
}), SettingsSchemaWithValuesSchema.nullable()),
|
|
45761
|
+
updateScopedSettings: method(zod.z.object({
|
|
45762
|
+
addonId: zod.z.string(),
|
|
45763
|
+
cap: zod.z.string(),
|
|
45764
|
+
scope: ScopedSettingsScopeSchema,
|
|
45765
|
+
nodeId: zod.z.string().optional(),
|
|
45766
|
+
patch: SettingsPatchSchema
|
|
45767
|
+
}), SettingsUpdateResultSchema, {
|
|
45768
|
+
kind: "mutation",
|
|
45769
|
+
auth: "admin"
|
|
45770
|
+
}),
|
|
45771
|
+
readScopedValues: method(zod.z.object({
|
|
45772
|
+
addonId: zod.z.string(),
|
|
45773
|
+
cap: zod.z.string(),
|
|
45774
|
+
scope: ScopedSettingsScopeSchema,
|
|
45775
|
+
nodeId: zod.z.string().optional()
|
|
45776
|
+
}), zod.z.record(zod.z.string(), zod.z.unknown()).nullable()),
|
|
45493
45777
|
getIntegrationSettings: method(zod.z.object({
|
|
45494
45778
|
addonId: zod.z.string(),
|
|
45495
45779
|
nodeId: zod.z.string().optional()
|
|
@@ -62576,7 +62860,7 @@ var integrationsCapability = {
|
|
|
62576
62860
|
* or the redaction token KEEPS the stored secret; `{ $secretClear: true }`
|
|
62577
62861
|
* clears it.
|
|
62578
62862
|
*/
|
|
62579
|
-
var ConfigSchemaPassthrough$
|
|
62863
|
+
var ConfigSchemaPassthrough$2 = zod.z.custom();
|
|
62580
62864
|
var IntegrationInstanceIdSchema = zod.z.string().min(1);
|
|
62581
62865
|
var IntegrationInstanceModeSchema = zod.z.enum(["single", "multiple"]);
|
|
62582
62866
|
/**
|
|
@@ -62622,7 +62906,16 @@ var IntegrationInstanceKindSchema = zod.z.object({
|
|
|
62622
62906
|
/** Relative hub path to start an interactive account link of an instance of this kind. */
|
|
62623
62907
|
connectPath: zod.z.string().min(1).optional(),
|
|
62624
62908
|
/** Relative hub path to disconnect that account. */
|
|
62625
|
-
disconnectPath: zod.z.string().min(1).optional()
|
|
62909
|
+
disconnectPath: zod.z.string().min(1).optional(),
|
|
62910
|
+
/**
|
|
62911
|
+
* Parts of the edit dialog the flat form cannot draw (a node picker, a model source), named by a
|
|
62912
|
+
* GENERIC widget id the client maps to a component; a client that knows none of them shows none.
|
|
62913
|
+
* `connection` widgets write connection values, `model` widgets own the model choice.
|
|
62914
|
+
*/
|
|
62915
|
+
widgets: zod.z.array(zod.z.object({
|
|
62916
|
+
id: zod.z.string().min(1),
|
|
62917
|
+
placement: zod.z.enum(["connection", "model"])
|
|
62918
|
+
})).optional()
|
|
62626
62919
|
});
|
|
62627
62920
|
/**
|
|
62628
62921
|
* How devices of an instance are found. `none`: the operator adds them by hand; `lan`: the addon
|
|
@@ -62727,7 +63020,7 @@ var integrationInstancesCapability = {
|
|
|
62727
63020
|
id: IntegrationInstanceIdSchema.nullable(),
|
|
62728
63021
|
/** The kind of the create form (`id: null`) of a provider with several. */
|
|
62729
63022
|
kind: zod.z.string().min(1).optional()
|
|
62730
|
-
}), ConfigSchemaPassthrough$
|
|
63023
|
+
}), ConfigSchemaPassthrough$2, { auth: "admin" }),
|
|
62731
63024
|
listInstances: method(zod.z.void(), zod.z.array(IntegrationInstanceSchema).readonly(), { auth: "admin" }),
|
|
62732
63025
|
getInstance: method(zod.z.object({ id: IntegrationInstanceIdSchema }), IntegrationInstanceSchema.nullable(), { auth: "admin" }),
|
|
62733
63026
|
/**
|
|
@@ -64013,12 +64306,12 @@ var LlmModelInfoSchema = zod.z.object({
|
|
|
64013
64306
|
});
|
|
64014
64307
|
/**
|
|
64015
64308
|
* The provider-specific part of a profile, validated by the provider that owns
|
|
64016
|
-
* the kind (
|
|
64309
|
+
* the kind (saving an instance refuses what it does not accept). A field its
|
|
64017
64310
|
* `connectionSchema` declares `type: 'password'` is a secret: it is held in the
|
|
64018
64311
|
* keychain, never in the row, and reads back as the redaction marker.
|
|
64019
64312
|
*/
|
|
64020
64313
|
var LlmProviderConfigSchema = zod.z.record(zod.z.string(), zod.z.unknown());
|
|
64021
|
-
|
|
64314
|
+
zod.z.object({
|
|
64022
64315
|
id: zod.z.string(),
|
|
64023
64316
|
name: zod.z.string(),
|
|
64024
64317
|
/** The provider-declared kind (`LlmProfileKindDescriptor.kind`). */
|
|
@@ -64112,8 +64405,8 @@ var LlmProviderWidgetSchema = zod.z.object({
|
|
|
64112
64405
|
/** ConfigUISchema tree passed through untyped on the wire (the
|
|
64113
64406
|
* notification-output `ConfigSchemaPassthrough` precedent at
|
|
64114
64407
|
* notification-output.cap.ts:151); the exported TS type re-tightens it. */
|
|
64115
|
-
var ConfigSchemaPassthrough$
|
|
64116
|
-
|
|
64408
|
+
var ConfigSchemaPassthrough$1 = zod.z.unknown();
|
|
64409
|
+
zod.z.object({
|
|
64117
64410
|
kind: LlmProfileKindSchema,
|
|
64118
64411
|
label: zod.z.string(),
|
|
64119
64412
|
/** A generic icon name (`cloud`, `plug`, `cpu`) — never a glyph or a logo. */
|
|
@@ -64121,9 +64414,9 @@ var LlmProfileKindDescriptorSchema = zod.z.object({
|
|
|
64121
64414
|
/** Stamped by each provider so the concat-fanned catalog stays routable. */
|
|
64122
64415
|
addonId: zod.z.string(),
|
|
64123
64416
|
/** The provider's own fields (`providerConfig`); `password` fields are keychain-held. */
|
|
64124
|
-
connectionSchema: ConfigSchemaPassthrough$
|
|
64417
|
+
connectionSchema: ConfigSchemaPassthrough$1,
|
|
64125
64418
|
/** Provider fields that belong under "Advanced" (extra headers, runtime tuning). */
|
|
64126
|
-
advancedSchema: ConfigSchemaPassthrough$
|
|
64419
|
+
advancedSchema: ConfigSchemaPassthrough$1.optional(),
|
|
64127
64420
|
/** The kind's defaults; a model from `listModels` may override any of them. */
|
|
64128
64421
|
features: LlmModelFeaturesSchema,
|
|
64129
64422
|
/** `false` = the provider stamps `supportsVision` itself (from what a node reports). */
|
|
@@ -64271,31 +64564,6 @@ var llmCapability = {
|
|
|
64271
64564
|
addonId: zod.z.string().optional(),
|
|
64272
64565
|
requestId: zod.z.string()
|
|
64273
64566
|
}), zod.z.void(), { kind: "mutation" }),
|
|
64274
|
-
listProfileKinds: method(zod.z.object({}), zod.z.array(LlmProfileKindDescriptorSchema)),
|
|
64275
|
-
listProfiles: method(zod.z.object({}), zod.z.array(LlmProfileSchema)),
|
|
64276
|
-
upsertProfile: method(zod.z.object({ profile: LlmProfileSchema }), LlmProfileSchema, {
|
|
64277
|
-
kind: "mutation",
|
|
64278
|
-
auth: "admin"
|
|
64279
|
-
}),
|
|
64280
|
-
/**
|
|
64281
|
-
* D878: move every profile's plaintext `apiKey` into the keychain (owner
|
|
64282
|
-
* `ai`), leaving a marker in the row. Dry run unless `apply`; idempotent;
|
|
64283
|
-
* counts only. The plaintext is cleared only after the keychain read-back
|
|
64284
|
-
* matched.
|
|
64285
|
-
*/
|
|
64286
|
-
migrateRawSecrets: method(RawSecretMigrationInputSchema, RawSecretMigrationReportSchema, {
|
|
64287
|
-
kind: "mutation",
|
|
64288
|
-
auth: "admin"
|
|
64289
|
-
}),
|
|
64290
|
-
deleteProfile: method(ProfileRefInputSchema, zod.z.void(), {
|
|
64291
|
-
kind: "mutation",
|
|
64292
|
-
auth: "admin"
|
|
64293
|
-
}),
|
|
64294
|
-
testProfile: method(ProfileRefInputSchema, LlmGenerateResultSchema, {
|
|
64295
|
-
kind: "mutation",
|
|
64296
|
-
auth: "admin",
|
|
64297
|
-
timeoutMs: AI_CAP_TRANSPORT_TIMEOUT_MS
|
|
64298
|
-
}),
|
|
64299
64567
|
/**
|
|
64300
64568
|
* The models a kind offers, for a SAVED profile or an unsaved draft
|
|
64301
64569
|
* (`connection`). A mutation, not a query: a draft may carry a key, and a
|
|
@@ -66047,31 +66315,7 @@ loginUrl: zod.z.string() }), { kind: "mutation" }),
|
|
|
66047
66315
|
*/
|
|
66048
66316
|
logout: method(zod.z.void(), zod.z.object({ loggedOut: zod.z.literal(true) }), { kind: "mutation" }),
|
|
66049
66317
|
/** Enumerate every peer the daemon currently knows about. */
|
|
66050
|
-
listPeers: method(zod.z.void(), zod.z.object({ peers: zod.z.array(MeshPeerSchema).readonly() }))
|
|
66051
|
-
/**
|
|
66052
|
-
* Probe the mesh daemon / API for a sanity check WITHOUT joining.
|
|
66053
|
-
* Operator-facing "test connection" button: validates the auth key
|
|
66054
|
-
* + reaches the control plane and reports back what would happen
|
|
66055
|
-
* on join.
|
|
66056
|
-
*
|
|
66057
|
-
* Tailscale: dry-runs `tailscale up --auth-key=… --reset` against
|
|
66058
|
-
* an idempotency probe; for an already-joined node it just returns
|
|
66059
|
-
* the current status.
|
|
66060
|
-
*/
|
|
66061
|
-
testConnection: method(zod.z.object({
|
|
66062
|
-
/** Optional auth key — when provided, probes the key validity
|
|
66063
|
-
* against the provider's API. Omit when already joined to
|
|
66064
|
-
* just ping the daemon. */
|
|
66065
|
-
authKey: zod.z.string().optional() }), zod.z.object({
|
|
66066
|
-
ok: zod.z.boolean(),
|
|
66067
|
-
/** Provider-side identifier resolved by the probe (tailnet
|
|
66068
|
-
* name for Tailscale, network id for ZeroTier, etc.). */
|
|
66069
|
-
tenant: zod.z.string().optional(),
|
|
66070
|
-
/** Daemon binary version, when reachable. */
|
|
66071
|
-
daemonVersion: zod.z.string().optional(),
|
|
66072
|
-
/** Human-readable error when `ok: false`. */
|
|
66073
|
-
error: zod.z.string().optional()
|
|
66074
|
-
}), { kind: "mutation" })
|
|
66318
|
+
listPeers: method(zod.z.void(), zod.z.object({ peers: zod.z.array(MeshPeerSchema).readonly() }))
|
|
66075
66319
|
}
|
|
66076
66320
|
};
|
|
66077
66321
|
/**
|
|
@@ -78253,77 +78497,6 @@ var oauthIntegrationCapability = {
|
|
|
78253
78497
|
getDescriptor: method(zod.z.void(), OauthIntegrationDescriptorSchema, { auth: "admin" }) }
|
|
78254
78498
|
};
|
|
78255
78499
|
/**
|
|
78256
|
-
* `oidc-connections` — CRUD for IdP rows under `auth-oidc` (D828 sibling).
|
|
78257
|
-
*
|
|
78258
|
-
* One hub-only singleton (`auth-oidc`). The Settings UI is a DataTable +
|
|
78259
|
-
* ItemFormDialog; there is no `editable-array` in `globalSettingsSchema`.
|
|
78260
|
-
* Operator-chosen `id` is the URL slug (`/addon/auth-oidc/<id>/…`) and is
|
|
78261
|
-
* immutable after create.
|
|
78262
|
-
*/
|
|
78263
|
-
var ConfigSchemaPassthrough$1 = zod.z.unknown();
|
|
78264
|
-
var OidcConnectionSchema = zod.z.object({
|
|
78265
|
-
id: zod.z.string().min(1),
|
|
78266
|
-
displayName: zod.z.string(),
|
|
78267
|
-
icon: zod.z.string(),
|
|
78268
|
-
issuerUrl: zod.z.string(),
|
|
78269
|
-
clientId: zod.z.string(),
|
|
78270
|
-
/** Client id + secret present — never the secret value. */
|
|
78271
|
-
configured: zod.z.boolean(),
|
|
78272
|
-
/**
|
|
78273
|
-
* Values for the connection form schema. `clientSecret` is a keychain
|
|
78274
|
-
* {@link SecretFieldView} or `null` / `''`, never plaintext (D789).
|
|
78275
|
-
*/
|
|
78276
|
-
formValues: zod.z.record(zod.z.string(), zod.z.unknown()).optional()
|
|
78277
|
-
});
|
|
78278
|
-
/**
|
|
78279
|
-
* Patch one connection. Omitted or empty `clientSecret` keeps the stored
|
|
78280
|
-
* secret (D787). `{ $secretClear: true }` clears it. `id` is never renamed.
|
|
78281
|
-
*/
|
|
78282
|
-
var OidcConnectionUpdateInputSchema = zod.z.object({
|
|
78283
|
-
id: zod.z.string().min(1),
|
|
78284
|
-
displayName: zod.z.string().min(1),
|
|
78285
|
-
icon: zod.z.string().optional(),
|
|
78286
|
-
issuerUrl: zod.z.string().optional(),
|
|
78287
|
-
clientId: zod.z.string().optional(),
|
|
78288
|
-
clientSecret: zod.z.union([zod.z.string(), zod.z.object({ $secretClear: zod.z.literal(true) })]).optional(),
|
|
78289
|
-
redirectUri: zod.z.string().optional(),
|
|
78290
|
-
scopes: zod.z.string().optional(),
|
|
78291
|
-
usernameClaim: zod.z.enum([
|
|
78292
|
-
"preferred_username",
|
|
78293
|
-
"email",
|
|
78294
|
-
"sub"
|
|
78295
|
-
]).optional()
|
|
78296
|
-
});
|
|
78297
|
-
var oidcConnectionsCapability = {
|
|
78298
|
-
name: "oidc-connections",
|
|
78299
|
-
scope: "system",
|
|
78300
|
-
mode: "singleton",
|
|
78301
|
-
methods: {
|
|
78302
|
-
/** Form fields for Add/Edit (ConfigFormBuilder). */
|
|
78303
|
-
connectionFormSchema: method(zod.z.object({}), ConfigSchemaPassthrough$1, { auth: "admin" }),
|
|
78304
|
-
listConnections: method(zod.z.object({}), zod.z.array(OidcConnectionSchema).readonly(), { auth: "admin" }),
|
|
78305
|
-
/**
|
|
78306
|
-
* Create a row with the operator-chosen URL slug. Credentials follow via
|
|
78307
|
-
* `updateConnection` (same Save path as Training Providers).
|
|
78308
|
-
*/
|
|
78309
|
-
createConnection: method(zod.z.object({
|
|
78310
|
-
id: zod.z.string().min(1).regex(/^[a-z0-9][a-z0-9-]{0,63}$/, "id must be a lowercase slug"),
|
|
78311
|
-
displayName: zod.z.string().min(1)
|
|
78312
|
-
}), zod.z.object({ id: zod.z.string() }), {
|
|
78313
|
-
kind: "mutation",
|
|
78314
|
-
auth: "admin"
|
|
78315
|
-
}),
|
|
78316
|
-
updateConnection: method(OidcConnectionUpdateInputSchema, zod.z.object({ ok: zod.z.literal(true) }), {
|
|
78317
|
-
kind: "mutation",
|
|
78318
|
-
auth: "admin"
|
|
78319
|
-
}),
|
|
78320
|
-
deleteConnection: method(zod.z.object({ id: zod.z.string().min(1) }), zod.z.object({ ok: zod.z.literal(true) }), {
|
|
78321
|
-
kind: "mutation",
|
|
78322
|
-
auth: "admin"
|
|
78323
|
-
})
|
|
78324
|
-
}
|
|
78325
|
-
};
|
|
78326
|
-
/**
|
|
78327
78500
|
* Generic on-screen-display (video overlay) cap. Each camera exposes
|
|
78328
78501
|
* a firmware-defined list of overlays (channel name, timestamp,
|
|
78329
78502
|
* watermark, logo, …); the cap models them as a homogeneous array of
|
|
@@ -87150,21 +87323,6 @@ var ssoBridgeCapability = {
|
|
|
87150
87323
|
verifyBridgeToken: method(zod.z.object({ token: zod.z.string() }), SsoBridgeClaimsSchema.nullable(), { auth: "admin" })
|
|
87151
87324
|
}
|
|
87152
87325
|
};
|
|
87153
|
-
var ProviderListEntrySchema = zod.z.discriminatedUnion("shouldSaveDiskSpace", [zod.z.object({
|
|
87154
|
-
providerId: zod.z.string().min(1),
|
|
87155
|
-
displayName: zod.z.string().min(1),
|
|
87156
|
-
configSchema: zod.z.unknown(),
|
|
87157
|
-
nodeLocal: zod.z.boolean(),
|
|
87158
|
-
shouldSaveDiskSpace: zod.z.literal(true),
|
|
87159
|
-
minFreePercent: zod.z.number().min(0).max(100)
|
|
87160
|
-
}), zod.z.object({
|
|
87161
|
-
providerId: zod.z.string().min(1),
|
|
87162
|
-
displayName: zod.z.string().min(1),
|
|
87163
|
-
configSchema: zod.z.unknown(),
|
|
87164
|
-
nodeLocal: zod.z.boolean(),
|
|
87165
|
-
shouldSaveDiskSpace: zod.z.literal(false),
|
|
87166
|
-
minFreePercent: zod.z.literal(null)
|
|
87167
|
-
})]);
|
|
87168
87326
|
/**
|
|
87169
87327
|
* `storage` — singleton consumer-facing capability owned by the
|
|
87170
87328
|
* `storage-orchestrator` builtin (Task 4 of the storage-unification
|
|
@@ -87265,66 +87423,12 @@ var storageCapability = {
|
|
|
87265
87423
|
}),
|
|
87266
87424
|
listLocations: method(zod.z.object({ type: StorageLocationTypeSchema.optional() }), zod.z.array(StorageLocationSchema).readonly()),
|
|
87267
87425
|
listLocationDeclarations: method(zod.z.void(), zod.z.array(StorageLocationDeclarationSchema).readonly()),
|
|
87268
|
-
upsertLocation: method(StorageLocationSchema.omit({
|
|
87269
|
-
createdAt: true,
|
|
87270
|
-
updatedAt: true
|
|
87271
|
-
}), StorageLocationSchema, {
|
|
87272
|
-
kind: "mutation",
|
|
87273
|
-
auth: "admin"
|
|
87274
|
-
}),
|
|
87275
|
-
/**
|
|
87276
|
-
* Remove a location record. REFUSES a location that still holds data —
|
|
87277
|
-
* deleting a drained location whose durable rows still name it is how this
|
|
87278
|
-
* hub acquired 2 131 ghost `recordings:high` segments, and playback does
|
|
87279
|
-
* not stat, so the operator sees a silent black window rather than an
|
|
87280
|
-
* error.
|
|
87281
|
-
*
|
|
87282
|
-
* `force` exists because the occupancy check is BEST-EFFORT and refuses on
|
|
87283
|
-
* "unknown" as well as on "occupied" (a read that fails must not authorise
|
|
87284
|
-
* a destruction — D49). A location on a removed disk, on another node, or
|
|
87285
|
-
* behind a remote provider answers "unknown" forever, and a refusal an
|
|
87286
|
-
* operator cannot override is its own failure mode. `force: true` is
|
|
87287
|
-
* logged, loudly, with what the check saw.
|
|
87288
|
-
*/
|
|
87289
|
-
deleteLocation: method(zod.z.object({
|
|
87290
|
-
id: zod.z.string(),
|
|
87291
|
-
force: zod.z.boolean().optional()
|
|
87292
|
-
}), zod.z.void(), {
|
|
87293
|
-
kind: "mutation",
|
|
87294
|
-
auth: "admin"
|
|
87295
|
-
}),
|
|
87296
87426
|
/**
|
|
87297
87427
|
* How far each draining location has got (D386). A pure READ of what the
|
|
87298
87428
|
* last pressure sweep computed — it starts no work, and a location that is
|
|
87299
87429
|
* not draining simply does not appear.
|
|
87300
87430
|
*/
|
|
87301
|
-
listDrainProgress: method(zod.z.void(), zod.z.array(StorageDrainProgressSchema).readonly())
|
|
87302
|
-
testLocation: method(zod.z.object({ id: zod.z.string() }), zod.z.object({
|
|
87303
|
-
ok: zod.z.boolean(),
|
|
87304
|
-
error: zod.z.string().optional()
|
|
87305
|
-
}), { auth: "admin" }),
|
|
87306
|
-
listProviders: method(zod.z.void(), zod.z.array(ProviderListEntrySchema).readonly()),
|
|
87307
|
-
testConfig: method(zod.z.object({
|
|
87308
|
-
providerId: zod.z.string(),
|
|
87309
|
-
/**
|
|
87310
|
-
* The location this config is an UNSAVED edit of, when there is one.
|
|
87311
|
-
*
|
|
87312
|
-
* `listLocations` replaces every declared secret with the redaction
|
|
87313
|
-
* sentinel, so the edit modal's form state holds the sentinel for any
|
|
87314
|
-
* credential the operator did not retype — and posting that here
|
|
87315
|
-
* without a way to resolve it makes the provider try to authenticate
|
|
87316
|
-
* as `__camstack_redacted__` and report the operator's own working
|
|
87317
|
-
* password as wrong. Given this id, the orchestrator restores each
|
|
87318
|
-
* sentinel from the stored config (same rule as `upsertLocation`)
|
|
87319
|
-
* before dispatching. Omitted by the "Add location" wizard, where
|
|
87320
|
-
* every value was typed just now and nothing is stored yet.
|
|
87321
|
-
*/
|
|
87322
|
-
locationId: zod.z.string().optional(),
|
|
87323
|
-
config: zod.z.record(zod.z.string(), zod.z.unknown())
|
|
87324
|
-
}), zod.z.object({
|
|
87325
|
-
ok: zod.z.boolean(),
|
|
87326
|
-
error: zod.z.string().optional()
|
|
87327
|
-
}), { auth: "admin" })
|
|
87431
|
+
listDrainProgress: method(zod.z.void(), zod.z.array(StorageDrainProgressSchema).readonly())
|
|
87328
87432
|
}
|
|
87329
87433
|
};
|
|
87330
87434
|
/** One table of the settings database. */
|
|
@@ -92423,7 +92527,6 @@ var ALL_CAPABILITY_DEFINITIONS = [
|
|
|
92423
92527
|
notifierCapability,
|
|
92424
92528
|
numericSensorCapability,
|
|
92425
92529
|
oauthIntegrationCapability,
|
|
92426
|
-
oidcConnectionsCapability,
|
|
92427
92530
|
osdCapability,
|
|
92428
92531
|
osdManagerCapability,
|
|
92429
92532
|
petFeederCapability,
|
|
@@ -92528,7 +92631,7 @@ function isArrayOutputSchema(schema) {
|
|
|
92528
92631
|
/**
|
|
92529
92632
|
* True when `method` on cap `def` is a COLLECTION cap's array-returning
|
|
92530
92633
|
* (non-subscription) method — the methods whose contract is "union the result
|
|
92531
|
-
* across every registered provider" (`
|
|
92634
|
+
* across every registered provider" (`listTargetKinds`,
|
|
92532
92635
|
* `discoverTargets`, `listEndpoints`, …).
|
|
92533
92636
|
*
|
|
92534
92637
|
* Such a method is aggregated at the hub via `concatCollection` / the runtime
|
|
@@ -92592,12 +92695,12 @@ function extractNestedAddonId(input) {
|
|
|
92592
92695
|
* True when an OBJECT input schema declares a top-level `addonId` field.
|
|
92593
92696
|
*
|
|
92594
92697
|
* Such a cap method routes explicitly via the top-level `{ addonId }` selector
|
|
92595
|
-
* (the `llm.generate` / `
|
|
92698
|
+
* (the `llm.generate` / `deleteModel` posture). The runtime router therefore
|
|
92596
92699
|
* MUST NOT also fall back to {@link extractNestedAddonId} for it — that would
|
|
92597
92700
|
* let an incidental nested `addonId` (e.g. a key inside a free-form `jsonSchema`
|
|
92598
92701
|
* record) hijack routing. Nested recovery is reserved for methods whose input
|
|
92599
92702
|
* carries NO top-level selector but embeds the owning `addonId` inside a domain
|
|
92600
|
-
* entity (`upsertTarget({ target: { addonId } })
|
|
92703
|
+
* entity (`upsertTarget({ target: { addonId } })`).
|
|
92601
92704
|
*
|
|
92602
92705
|
* Accepts both Zod 4 (`.shape` / `_def.shape`) and legacy shapes; returns false
|
|
92603
92706
|
* for non-object schemas.
|
|
@@ -96315,6 +96418,20 @@ var METHOD_ACCESS_MAP = Object.freeze({
|
|
|
96315
96418
|
access: "view",
|
|
96316
96419
|
role: "admin"
|
|
96317
96420
|
},
|
|
96421
|
+
"addonSettings.getScopedSettings": {
|
|
96422
|
+
capName: "addon-settings",
|
|
96423
|
+
capScope: "system",
|
|
96424
|
+
addonId: null,
|
|
96425
|
+
access: "view",
|
|
96426
|
+
role: "admin"
|
|
96427
|
+
},
|
|
96428
|
+
"addonSettings.readScopedValues": {
|
|
96429
|
+
capName: "addon-settings",
|
|
96430
|
+
capScope: "system",
|
|
96431
|
+
addonId: null,
|
|
96432
|
+
access: "view",
|
|
96433
|
+
role: "admin"
|
|
96434
|
+
},
|
|
96318
96435
|
"addonSettings.unsetStoredSettingsKeys": {
|
|
96319
96436
|
capName: "addon-settings",
|
|
96320
96437
|
capScope: "system",
|
|
@@ -96336,6 +96453,13 @@ var METHOD_ACCESS_MAP = Object.freeze({
|
|
|
96336
96453
|
access: "create",
|
|
96337
96454
|
role: "admin"
|
|
96338
96455
|
},
|
|
96456
|
+
"addonSettings.updateScopedSettings": {
|
|
96457
|
+
capName: "addon-settings",
|
|
96458
|
+
capScope: "system",
|
|
96459
|
+
addonId: null,
|
|
96460
|
+
access: "create",
|
|
96461
|
+
role: "admin"
|
|
96462
|
+
},
|
|
96339
96463
|
"addonWidgets.listWidgets": {
|
|
96340
96464
|
capName: "addon-widgets",
|
|
96341
96465
|
capScope: "system",
|
|
@@ -99787,13 +99911,6 @@ var METHOD_ACCESS_MAP = Object.freeze({
|
|
|
99787
99911
|
access: "delete",
|
|
99788
99912
|
role: "admin"
|
|
99789
99913
|
},
|
|
99790
|
-
"llm.deleteProfile": {
|
|
99791
|
-
capName: "llm",
|
|
99792
|
-
capScope: "system",
|
|
99793
|
-
addonId: null,
|
|
99794
|
-
access: "delete",
|
|
99795
|
-
role: "admin"
|
|
99796
|
-
},
|
|
99797
99914
|
"llm.generate": {
|
|
99798
99915
|
capName: "llm",
|
|
99799
99916
|
capScope: "system",
|
|
@@ -99857,20 +99974,6 @@ var METHOD_ACCESS_MAP = Object.freeze({
|
|
|
99857
99974
|
access: "view",
|
|
99858
99975
|
role: "admin"
|
|
99859
99976
|
},
|
|
99860
|
-
"llm.listProfileKinds": {
|
|
99861
|
-
capName: "llm",
|
|
99862
|
-
capScope: "system",
|
|
99863
|
-
addonId: null,
|
|
99864
|
-
access: "view",
|
|
99865
|
-
role: "admin"
|
|
99866
|
-
},
|
|
99867
|
-
"llm.listProfiles": {
|
|
99868
|
-
capName: "llm",
|
|
99869
|
-
capScope: "system",
|
|
99870
|
-
addonId: null,
|
|
99871
|
-
access: "view",
|
|
99872
|
-
role: "admin"
|
|
99873
|
-
},
|
|
99874
99977
|
"llm.listRuntimeNodes": {
|
|
99875
99978
|
capName: "llm",
|
|
99876
99979
|
capScope: "system",
|
|
@@ -99878,13 +99981,6 @@ var METHOD_ACCESS_MAP = Object.freeze({
|
|
|
99878
99981
|
access: "view",
|
|
99879
99982
|
role: "admin"
|
|
99880
99983
|
},
|
|
99881
|
-
"llm.migrateRawSecrets": {
|
|
99882
|
-
capName: "llm",
|
|
99883
|
-
capScope: "system",
|
|
99884
|
-
addonId: null,
|
|
99885
|
-
access: "create",
|
|
99886
|
-
role: "admin"
|
|
99887
|
-
},
|
|
99888
99984
|
"llm.resolveModelRef": {
|
|
99889
99985
|
capName: "llm",
|
|
99890
99986
|
capScope: "system",
|
|
@@ -99913,20 +100009,6 @@ var METHOD_ACCESS_MAP = Object.freeze({
|
|
|
99913
100009
|
access: "create",
|
|
99914
100010
|
role: "admin"
|
|
99915
100011
|
},
|
|
99916
|
-
"llm.testProfile": {
|
|
99917
|
-
capName: "llm",
|
|
99918
|
-
capScope: "system",
|
|
99919
|
-
addonId: null,
|
|
99920
|
-
access: "create",
|
|
99921
|
-
role: "admin"
|
|
99922
|
-
},
|
|
99923
|
-
"llm.upsertProfile": {
|
|
99924
|
-
capName: "llm",
|
|
99925
|
-
capScope: "system",
|
|
99926
|
-
addonId: null,
|
|
99927
|
-
access: "create",
|
|
99928
|
-
role: "admin"
|
|
99929
|
-
},
|
|
99930
100012
|
"llmRuntime.appleAvailability": {
|
|
99931
100013
|
capName: "llm-runtime",
|
|
99932
100014
|
capScope: "system",
|
|
@@ -100431,13 +100513,6 @@ var METHOD_ACCESS_MAP = Object.freeze({
|
|
|
100431
100513
|
access: "create",
|
|
100432
100514
|
role: "admin"
|
|
100433
100515
|
},
|
|
100434
|
-
"meshNetwork.testConnection": {
|
|
100435
|
-
capName: "mesh-network",
|
|
100436
|
-
capScope: "system",
|
|
100437
|
-
addonId: null,
|
|
100438
|
-
access: "create",
|
|
100439
|
-
role: "admin"
|
|
100440
|
-
},
|
|
100441
100516
|
"meter.getStatus": {
|
|
100442
100517
|
capName: "meter",
|
|
100443
100518
|
capScope: "device",
|
|
@@ -101096,13 +101171,6 @@ var METHOD_ACCESS_MAP = Object.freeze({
|
|
|
101096
101171
|
access: "create",
|
|
101097
101172
|
role: "admin"
|
|
101098
101173
|
},
|
|
101099
|
-
"notificationOutput.deleteTarget": {
|
|
101100
|
-
capName: "notification-output",
|
|
101101
|
-
capScope: "system",
|
|
101102
|
-
addonId: null,
|
|
101103
|
-
access: "delete",
|
|
101104
|
-
role: "admin"
|
|
101105
|
-
},
|
|
101106
101174
|
"notificationOutput.discoverTargets": {
|
|
101107
101175
|
capName: "notification-output",
|
|
101108
101176
|
capScope: "system",
|
|
@@ -101110,13 +101178,6 @@ var METHOD_ACCESS_MAP = Object.freeze({
|
|
|
101110
101178
|
access: "view",
|
|
101111
101179
|
role: "admin"
|
|
101112
101180
|
},
|
|
101113
|
-
"notificationOutput.getTarget": {
|
|
101114
|
-
capName: "notification-output",
|
|
101115
|
-
capScope: "system",
|
|
101116
|
-
addonId: null,
|
|
101117
|
-
access: "view",
|
|
101118
|
-
role: "admin"
|
|
101119
|
-
},
|
|
101120
101181
|
"notificationOutput.listTargetKinds": {
|
|
101121
101182
|
capName: "notification-output",
|
|
101122
101183
|
capScope: "system",
|
|
@@ -101124,13 +101185,6 @@ var METHOD_ACCESS_MAP = Object.freeze({
|
|
|
101124
101185
|
access: "view",
|
|
101125
101186
|
role: "admin"
|
|
101126
101187
|
},
|
|
101127
|
-
"notificationOutput.listTargets": {
|
|
101128
|
-
capName: "notification-output",
|
|
101129
|
-
capScope: "system",
|
|
101130
|
-
addonId: null,
|
|
101131
|
-
access: "view",
|
|
101132
|
-
role: "admin"
|
|
101133
|
-
},
|
|
101134
101188
|
"notificationOutput.probeTargetConfig": {
|
|
101135
101189
|
capName: "notification-output",
|
|
101136
101190
|
capScope: "system",
|
|
@@ -101145,13 +101199,6 @@ var METHOD_ACCESS_MAP = Object.freeze({
|
|
|
101145
101199
|
access: "create",
|
|
101146
101200
|
role: "admin"
|
|
101147
101201
|
},
|
|
101148
|
-
"notificationOutput.setTargetEnabled": {
|
|
101149
|
-
capName: "notification-output",
|
|
101150
|
-
capScope: "system",
|
|
101151
|
-
addonId: null,
|
|
101152
|
-
access: "create",
|
|
101153
|
-
role: "admin"
|
|
101154
|
-
},
|
|
101155
101202
|
"notificationOutput.testTarget": {
|
|
101156
101203
|
capName: "notification-output",
|
|
101157
101204
|
capScope: "system",
|
|
@@ -101159,13 +101206,6 @@ var METHOD_ACCESS_MAP = Object.freeze({
|
|
|
101159
101206
|
access: "create",
|
|
101160
101207
|
role: "admin"
|
|
101161
101208
|
},
|
|
101162
|
-
"notificationOutput.upsertTarget": {
|
|
101163
|
-
capName: "notification-output",
|
|
101164
|
-
capScope: "system",
|
|
101165
|
-
addonId: null,
|
|
101166
|
-
access: "create",
|
|
101167
|
-
role: "admin"
|
|
101168
|
-
},
|
|
101169
101209
|
"notificationRules.activateAlarmProfile": {
|
|
101170
101210
|
capName: "notification-rules",
|
|
101171
101211
|
capScope: "system",
|
|
@@ -101425,41 +101465,6 @@ var METHOD_ACCESS_MAP = Object.freeze({
|
|
|
101425
101465
|
access: "view",
|
|
101426
101466
|
role: "admin"
|
|
101427
101467
|
},
|
|
101428
|
-
"oidcConnections.connectionFormSchema": {
|
|
101429
|
-
capName: "oidc-connections",
|
|
101430
|
-
capScope: "system",
|
|
101431
|
-
addonId: null,
|
|
101432
|
-
access: "view",
|
|
101433
|
-
role: "admin"
|
|
101434
|
-
},
|
|
101435
|
-
"oidcConnections.createConnection": {
|
|
101436
|
-
capName: "oidc-connections",
|
|
101437
|
-
capScope: "system",
|
|
101438
|
-
addonId: null,
|
|
101439
|
-
access: "create",
|
|
101440
|
-
role: "admin"
|
|
101441
|
-
},
|
|
101442
|
-
"oidcConnections.deleteConnection": {
|
|
101443
|
-
capName: "oidc-connections",
|
|
101444
|
-
capScope: "system",
|
|
101445
|
-
addonId: null,
|
|
101446
|
-
access: "delete",
|
|
101447
|
-
role: "admin"
|
|
101448
|
-
},
|
|
101449
|
-
"oidcConnections.listConnections": {
|
|
101450
|
-
capName: "oidc-connections",
|
|
101451
|
-
capScope: "system",
|
|
101452
|
-
addonId: null,
|
|
101453
|
-
access: "view",
|
|
101454
|
-
role: "admin"
|
|
101455
|
-
},
|
|
101456
|
-
"oidcConnections.updateConnection": {
|
|
101457
|
-
capName: "oidc-connections",
|
|
101458
|
-
capScope: "system",
|
|
101459
|
-
addonId: null,
|
|
101460
|
-
access: "create",
|
|
101461
|
-
role: "admin"
|
|
101462
|
-
},
|
|
101463
101468
|
"osd.getStatus": {
|
|
101464
101469
|
capName: "osd",
|
|
101465
101470
|
capScope: "device",
|
|
@@ -104491,13 +104496,6 @@ var METHOD_ACCESS_MAP = Object.freeze({
|
|
|
104491
104496
|
access: "delete",
|
|
104492
104497
|
role: "admin"
|
|
104493
104498
|
},
|
|
104494
|
-
"storage.deleteLocation": {
|
|
104495
|
-
capName: "storage",
|
|
104496
|
-
capScope: "system",
|
|
104497
|
-
addonId: null,
|
|
104498
|
-
access: "delete",
|
|
104499
|
-
role: "admin"
|
|
104500
|
-
},
|
|
104501
104499
|
"storage.endDownload": {
|
|
104502
104500
|
capName: "storage",
|
|
104503
104501
|
capScope: "system",
|
|
@@ -104554,13 +104552,6 @@ var METHOD_ACCESS_MAP = Object.freeze({
|
|
|
104554
104552
|
access: "view",
|
|
104555
104553
|
role: "admin"
|
|
104556
104554
|
},
|
|
104557
|
-
"storage.listProviders": {
|
|
104558
|
-
capName: "storage",
|
|
104559
|
-
capScope: "system",
|
|
104560
|
-
addonId: null,
|
|
104561
|
-
access: "view",
|
|
104562
|
-
role: "admin"
|
|
104563
|
-
},
|
|
104564
104555
|
"storage.read": {
|
|
104565
104556
|
capName: "storage",
|
|
104566
104557
|
capScope: "system",
|
|
@@ -104582,27 +104573,6 @@ var METHOD_ACCESS_MAP = Object.freeze({
|
|
|
104582
104573
|
access: "view",
|
|
104583
104574
|
role: "admin"
|
|
104584
104575
|
},
|
|
104585
|
-
"storage.testConfig": {
|
|
104586
|
-
capName: "storage",
|
|
104587
|
-
capScope: "system",
|
|
104588
|
-
addonId: null,
|
|
104589
|
-
access: "view",
|
|
104590
|
-
role: "admin"
|
|
104591
|
-
},
|
|
104592
|
-
"storage.testLocation": {
|
|
104593
|
-
capName: "storage",
|
|
104594
|
-
capScope: "system",
|
|
104595
|
-
addonId: null,
|
|
104596
|
-
access: "view",
|
|
104597
|
-
role: "admin"
|
|
104598
|
-
},
|
|
104599
|
-
"storage.upsertLocation": {
|
|
104600
|
-
capName: "storage",
|
|
104601
|
-
capScope: "system",
|
|
104602
|
-
addonId: null,
|
|
104603
|
-
access: "create",
|
|
104604
|
-
role: "admin"
|
|
104605
|
-
},
|
|
104606
104576
|
"storage.write": {
|
|
104607
104577
|
capName: "storage",
|
|
104608
104578
|
capScope: "system",
|
|
@@ -112527,6 +112497,12 @@ Object.defineProperty(exports, "STORAGE_ACCESS_FALLBACK", {
|
|
|
112527
112497
|
return STORAGE_ACCESS_FALLBACK;
|
|
112528
112498
|
}
|
|
112529
112499
|
});
|
|
112500
|
+
Object.defineProperty(exports, "STORAGE_LOCATION_MODES", {
|
|
112501
|
+
enumerable: true,
|
|
112502
|
+
get: function() {
|
|
112503
|
+
return STORAGE_LOCATION_MODES;
|
|
112504
|
+
}
|
|
112505
|
+
});
|
|
112530
112506
|
Object.defineProperty(exports, "STREAM_PROFILE_META", {
|
|
112531
112507
|
enumerable: true,
|
|
112532
112508
|
get: function() {
|
|
@@ -113709,6 +113685,12 @@ Object.defineProperty(exports, "migrationsCapability", {
|
|
|
113709
113685
|
return migrationsCapability;
|
|
113710
113686
|
}
|
|
113711
113687
|
});
|
|
113688
|
+
Object.defineProperty(exports, "modeForSwitch", {
|
|
113689
|
+
enumerable: true,
|
|
113690
|
+
get: function() {
|
|
113691
|
+
return modeForSwitch;
|
|
113692
|
+
}
|
|
113693
|
+
});
|
|
113712
113694
|
Object.defineProperty(exports, "modeMayWrite", {
|
|
113713
113695
|
enumerable: true,
|
|
113714
113696
|
get: function() {
|
|
@@ -114267,6 +114249,12 @@ Object.defineProperty(exports, "switchCapability", {
|
|
|
114267
114249
|
return switchCapability;
|
|
114268
114250
|
}
|
|
114269
114251
|
});
|
|
114252
|
+
Object.defineProperty(exports, "switchStateOfMode", {
|
|
114253
|
+
enumerable: true,
|
|
114254
|
+
get: function() {
|
|
114255
|
+
return switchStateOfMode;
|
|
114256
|
+
}
|
|
114257
|
+
});
|
|
114270
114258
|
Object.defineProperty(exports, "templateCapability", {
|
|
114271
114259
|
enumerable: true,
|
|
114272
114260
|
get: function() {
|