@camstack/addon-provider-reolink 1.2.186 → 1.2.187
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.js +1034 -119
- package/dist/addon.mjs +1034 -119
- package/package.json +1 -1
package/dist/addon.mjs
CHANGED
|
@@ -28,7 +28,7 @@ import { URL as URL$1 } from "url";
|
|
|
28
28
|
import { spawn as spawn$1 } from "node:child_process";
|
|
29
29
|
import os, { tmpdir } from "node:os";
|
|
30
30
|
import { createReadStream } from "node:fs";
|
|
31
|
-
//#region ../types/dist/event-category-
|
|
31
|
+
//#region ../types/dist/event-category-BvOFi6PY.mjs
|
|
32
32
|
var EventCategory = /* @__PURE__ */ function(EventCategory) {
|
|
33
33
|
EventCategory["SystemBoot"] = "system.boot";
|
|
34
34
|
EventCategory["SystemAddonsReady"] = "system.addons-ready";
|
|
@@ -92,6 +92,24 @@ var EventCategory = /* @__PURE__ */ function(EventCategory) {
|
|
|
92
92
|
* consumes this category and maps it to the `addon-crash-loop` kind.
|
|
93
93
|
*/
|
|
94
94
|
EventCategory["AddonRunnerFailed"] = "addon.runner-failed";
|
|
95
|
+
/**
|
|
96
|
+
* A runner whose addon refused to start with a typed reason (D877) - parked
|
|
97
|
+
* in `refused`, never counted by the crash breaker, retried on operator
|
|
98
|
+
* action. One event per refusal.
|
|
99
|
+
*/
|
|
100
|
+
EventCategory["AddonRunnerRefused"] = "addon.runner-refused";
|
|
101
|
+
/**
|
|
102
|
+
* A runner settled on a state (D877): `running` (READY), `crashed`, `failed` or
|
|
103
|
+
* `refused`. In-process telemetry for the boot check (re-evaluate while any
|
|
104
|
+
* runner is still pending) and the alert centre (close a recovered runner).
|
|
105
|
+
*/
|
|
106
|
+
EventCategory["ProcessStateChanged"] = "process.state-changed";
|
|
107
|
+
/**
|
|
108
|
+
* The node's one-shot runner boot check (D877): planned runners against the
|
|
109
|
+
* process service, `degraded` when any is failed, refused or missing. The
|
|
110
|
+
* alert centre turns it into one alert and a direct critical push.
|
|
111
|
+
*/
|
|
112
|
+
EventCategory["SystemRunnerCheck"] = "system.runner-check";
|
|
95
113
|
EventCategory["AddonError"] = "addon.error";
|
|
96
114
|
EventCategory["AddonPageReady"] = "addon.page-ready";
|
|
97
115
|
EventCategory["AddonWidgetReady"] = "addon.widget-ready";
|
|
@@ -5416,7 +5434,7 @@ var ZodIssueCode = {
|
|
|
5416
5434
|
var ZodFirstPartyTypeKind;
|
|
5417
5435
|
ZodFirstPartyTypeKind || (ZodFirstPartyTypeKind = {});
|
|
5418
5436
|
//#endregion
|
|
5419
|
-
//#region ../types/dist/sleep-
|
|
5437
|
+
//#region ../types/dist/sleep-bZIhUvjd.mjs
|
|
5420
5438
|
/**
|
|
5421
5439
|
* The audio chunk plane's byte format, and the ONE expansion from a coded
|
|
5422
5440
|
* window to float samples (D455).
|
|
@@ -5533,7 +5551,7 @@ function isKeychainStoredField(field) {
|
|
|
5533
5551
|
var SECRET_CLEAR = { $secretClear: true };
|
|
5534
5552
|
/** The `'***'` token D634 redaction writes for non-admins. */
|
|
5535
5553
|
var LEGACY_DEVICE_REDACTION = "***";
|
|
5536
|
-
function isRecord$
|
|
5554
|
+
function isRecord$5(value) {
|
|
5537
5555
|
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
5538
5556
|
}
|
|
5539
5557
|
function makeSecretMarker(ref) {
|
|
@@ -5544,16 +5562,16 @@ function makeSecretMarker(ref) {
|
|
|
5544
5562
|
}
|
|
5545
5563
|
/** A stored marker: an object whose `$secret` is a non-empty string. */
|
|
5546
5564
|
function isSecretMarker(value) {
|
|
5547
|
-
if (!isRecord$
|
|
5565
|
+
if (!isRecord$5(value)) return false;
|
|
5548
5566
|
const ref = value["$secret"];
|
|
5549
5567
|
return typeof ref === "string" && ref.length > 0;
|
|
5550
5568
|
}
|
|
5551
5569
|
/** Anything carrying a `$secret` key — a stored marker or a UI view of one. */
|
|
5552
5570
|
function isSecretMarkerLike(value) {
|
|
5553
|
-
return isRecord$
|
|
5571
|
+
return isRecord$5(value) && Object.prototype.hasOwnProperty.call(value, "$secret");
|
|
5554
5572
|
}
|
|
5555
5573
|
function isSecretClear(value) {
|
|
5556
|
-
return isRecord$
|
|
5574
|
+
return isRecord$5(value) && value["$secretClear"] === true;
|
|
5557
5575
|
}
|
|
5558
5576
|
/**
|
|
5559
5577
|
* The UI view of a stored secret field value: a marker becomes "set", inline
|
|
@@ -6163,7 +6181,7 @@ var KeychainWriteRefusedError = class extends Error {
|
|
|
6163
6181
|
}
|
|
6164
6182
|
};
|
|
6165
6183
|
var KEEP = { kind: "keep" };
|
|
6166
|
-
function isRecord$
|
|
6184
|
+
function isRecord$4(value) {
|
|
6167
6185
|
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
6168
6186
|
}
|
|
6169
6187
|
function defaultMintId() {
|
|
@@ -6176,7 +6194,7 @@ function collectSecretMarkerRefs(value, out = []) {
|
|
|
6176
6194
|
return out;
|
|
6177
6195
|
}
|
|
6178
6196
|
if (Array.isArray(value)) for (const item of value) collectSecretMarkerRefs(item, out);
|
|
6179
|
-
else if (isRecord$
|
|
6197
|
+
else if (isRecord$4(value)) for (const child of Object.values(value)) collectSecretMarkerRefs(child, out);
|
|
6180
6198
|
return out;
|
|
6181
6199
|
}
|
|
6182
6200
|
async function storedValueEquals(secrets, marker, candidate) {
|
|
@@ -6231,7 +6249,7 @@ function rowId(row, idKey) {
|
|
|
6231
6249
|
return null;
|
|
6232
6250
|
}
|
|
6233
6251
|
async function writeArray(ctx, node, incoming, stored, fieldPath) {
|
|
6234
|
-
const storedRows = Array.isArray(stored) ? stored.filter(isRecord$
|
|
6252
|
+
const storedRows = Array.isArray(stored) ? stored.filter(isRecord$4) : [];
|
|
6235
6253
|
if (!Array.isArray(incoming)) {
|
|
6236
6254
|
ctx.deletes.push(...collectSecretMarkerRefs(storedRows));
|
|
6237
6255
|
return {
|
|
@@ -6247,7 +6265,7 @@ async function writeArray(ctx, node, incoming, stored, fieldPath) {
|
|
|
6247
6265
|
const kept = /* @__PURE__ */ new Set();
|
|
6248
6266
|
const rows = [];
|
|
6249
6267
|
for (const row of incoming) {
|
|
6250
|
-
if (!isRecord$
|
|
6268
|
+
if (!isRecord$4(row)) {
|
|
6251
6269
|
rows.push(row);
|
|
6252
6270
|
continue;
|
|
6253
6271
|
}
|
|
@@ -6272,7 +6290,7 @@ async function writeNode(ctx, node, incoming, stored, fieldPath) {
|
|
|
6272
6290
|
case "leaf": return writeLeaf(ctx, incoming, stored, fieldPath);
|
|
6273
6291
|
case "array": return writeArray(ctx, node, incoming, stored, fieldPath);
|
|
6274
6292
|
case "object": {
|
|
6275
|
-
if (!isRecord$
|
|
6293
|
+
if (!isRecord$4(incoming)) {
|
|
6276
6294
|
if (incoming === void 0) return KEEP;
|
|
6277
6295
|
ctx.deletes.push(...collectSecretMarkerRefs(stored));
|
|
6278
6296
|
return {
|
|
@@ -6280,7 +6298,7 @@ async function writeNode(ctx, node, incoming, stored, fieldPath) {
|
|
|
6280
6298
|
value: incoming
|
|
6281
6299
|
};
|
|
6282
6300
|
}
|
|
6283
|
-
const storedObj = isRecord$
|
|
6301
|
+
const storedObj = isRecord$4(stored) ? stored : {};
|
|
6284
6302
|
return {
|
|
6285
6303
|
kind: "value",
|
|
6286
6304
|
value: await writeMembers(ctx, node.children, incoming, storedObj, (m) => `${fieldPath}.${m}`)
|
|
@@ -6403,7 +6421,7 @@ async function resolveSecretMarkers(value, secrets, options = {}) {
|
|
|
6403
6421
|
value: items
|
|
6404
6422
|
};
|
|
6405
6423
|
}
|
|
6406
|
-
if (isRecord$
|
|
6424
|
+
if (isRecord$4(v)) {
|
|
6407
6425
|
const out = {};
|
|
6408
6426
|
for (const [k, child] of Object.entries(v)) {
|
|
6409
6427
|
const s = substitute(child);
|
|
@@ -6671,7 +6689,6 @@ function createHandle(raw, opts) {
|
|
|
6671
6689
|
const writeAddon = (patch) => write("addon", opts.addonTree(), void 0, patch, () => readStoredAddonBlob(raw), (p) => raw.writeAddonStore(p));
|
|
6672
6690
|
const readAddonStoreResult = raw.readAddonStoreResult;
|
|
6673
6691
|
const readAddonStoreKeyResult = raw.readAddonStoreKeyResult;
|
|
6674
|
-
const readDeviceStoreBatch = raw.readDeviceStoreBatch;
|
|
6675
6692
|
const overrides = {
|
|
6676
6693
|
readAddonStore: async () => resolveRead("addon", await raw.readAddonStore()),
|
|
6677
6694
|
...readAddonStoreResult !== void 0 ? { readAddonStoreResult: async () => {
|
|
@@ -6695,12 +6712,12 @@ function createHandle(raw, opts) {
|
|
|
6695
6712
|
};
|
|
6696
6713
|
} } : {},
|
|
6697
6714
|
readDeviceStore: async (deviceId) => resolveRead(`device:${deviceId}`, await raw.readDeviceStore(deviceId)),
|
|
6698
|
-
|
|
6699
|
-
const rows = await readDeviceStoreBatch
|
|
6715
|
+
readDeviceStoreBatch: async (deviceIds) => {
|
|
6716
|
+
const rows = await raw.readDeviceStoreBatch(deviceIds);
|
|
6700
6717
|
const out = /* @__PURE__ */ new Map();
|
|
6701
6718
|
for (const [deviceId, blob] of rows) out.set(deviceId, await resolveRead(`device:${deviceId}`, blob));
|
|
6702
6719
|
return out;
|
|
6703
|
-
}
|
|
6720
|
+
},
|
|
6704
6721
|
writeAddonStore: async (patch) => {
|
|
6705
6722
|
await writeAddon(patch);
|
|
6706
6723
|
},
|
|
@@ -7327,7 +7344,7 @@ var BaseAddon = class {
|
|
|
7327
7344
|
if (!ctx) return;
|
|
7328
7345
|
const addonId = ctx.id;
|
|
7329
7346
|
setImmediate(() => {
|
|
7330
|
-
ctx.api.addons
|
|
7347
|
+
ctx.api.addons.restartAddon.mutate({ addonId }).then(() => {
|
|
7331
7348
|
ctx.logger.info("addon auto-restart triggered by restart-required setting change", { meta: { changedFields: patchKeys.filter((k) => restartKeys.has(k)) } });
|
|
7332
7349
|
}).catch((err) => {
|
|
7333
7350
|
ctx.logger.error("addon auto-restart failed", { meta: { error: err instanceof Error ? err.message : String(err) } });
|
|
@@ -7527,7 +7544,7 @@ var BaseAddon = class {
|
|
|
7527
7544
|
return this._addonSecretTree;
|
|
7528
7545
|
}
|
|
7529
7546
|
deviceSecretTree() {
|
|
7530
|
-
this._deviceSecretTree ??= secretTreeFromSchema(this.deviceSettingsSchema());
|
|
7547
|
+
this._deviceSecretTree ??= mergeSecretStatePaths(secretTreeFromSchema(this.deviceSettingsSchema()), this.secretStatePaths);
|
|
7531
7548
|
return this._deviceSecretTree;
|
|
7532
7549
|
}
|
|
7533
7550
|
/**
|
|
@@ -7603,42 +7620,135 @@ var BaseAddon = class {
|
|
|
7603
7620
|
this[timerOf] = timer;
|
|
7604
7621
|
}
|
|
7605
7622
|
/**
|
|
7606
|
-
* Wrap `ctx.settings.readAddonStore()` with a
|
|
7607
|
-
*
|
|
7608
|
-
* swap, or any race where the SqliteSettingsBackend is between shutdown and
|
|
7609
|
-
* re-initialize) doesn't propagate up into `initialize()` and leave the
|
|
7623
|
+
* Wrap `ctx.settings.readAddonStore()` with a retry budget so a transient
|
|
7624
|
+
* settings-store outage doesn't propagate up into `initialize()` and leave the
|
|
7610
7625
|
* addon permanently broken.
|
|
7611
7626
|
*
|
|
7612
|
-
*
|
|
7613
|
-
*
|
|
7614
|
-
* `
|
|
7627
|
+
* Two kinds of outage, two budgets:
|
|
7628
|
+
* - the store's own restart fingerprints (`SqliteSettingsBackend not
|
|
7629
|
+
* initialized`, `provider not available`): a short budget, then the addon
|
|
7630
|
+
* falls back to `{}` (defaults) - its first successful patch rehydrates;
|
|
7631
|
+
* - a TRANSPORT failure (the hub is restarting while this runner boots:
|
|
7632
|
+
* `discovery deadline exceeded`, `parent could not route`, a refused or
|
|
7633
|
+
* timed-out connection). Since D870 a runner's settings read THROWS instead
|
|
7634
|
+
* of answering `{}`, so without a budget a hub restart ends in a respawn
|
|
7635
|
+
* loop. A long, bounded budget; only after it the error propagates - the
|
|
7636
|
+
* addon never runs on defaults for a store it could not ask.
|
|
7637
|
+
* Anything else propagates immediately so real bugs surface.
|
|
7615
7638
|
*/
|
|
7616
7639
|
async readAddonStoreWithRetry() {
|
|
7617
7640
|
const settings = this.rawSettings();
|
|
7618
7641
|
if (!settings) return {};
|
|
7619
|
-
const delaysMs = [
|
|
7620
|
-
150,
|
|
7621
|
-
350,
|
|
7622
|
-
600,
|
|
7623
|
-
900
|
|
7624
|
-
];
|
|
7625
7642
|
let lastErr;
|
|
7626
|
-
for (let attempt = 0
|
|
7643
|
+
for (let attempt = 0;; attempt++) try {
|
|
7627
7644
|
const stored = await settings.readAddonStore() ?? {};
|
|
7628
7645
|
this.settingsStoreReady = true;
|
|
7629
7646
|
return stored;
|
|
7630
7647
|
} catch (err) {
|
|
7631
7648
|
lastErr = err;
|
|
7632
|
-
const
|
|
7633
|
-
if (
|
|
7634
|
-
|
|
7635
|
-
|
|
7649
|
+
const kind = classifyStoreError(err);
|
|
7650
|
+
if (kind === "permanent") throw err;
|
|
7651
|
+
const delay = (kind === "transport" ? TRANSPORT_RETRY_DELAYS_MS : RESTART_RETRY_DELAYS_MS)[attempt];
|
|
7652
|
+
if (delay === void 0) {
|
|
7653
|
+
if (kind === "transport") throw err;
|
|
7654
|
+
break;
|
|
7655
|
+
}
|
|
7656
|
+
await new Promise((r) => setTimeout(r, delay));
|
|
7636
7657
|
}
|
|
7637
7658
|
this.settingsStoreReady = false;
|
|
7638
7659
|
this._ctx?.logger?.warn?.("readAddonStore: settings-store unavailable after retries — using defaults", { meta: { error: lastErr instanceof Error ? lastErr.message : String(lastErr) } });
|
|
7639
7660
|
return {};
|
|
7640
7661
|
}
|
|
7641
7662
|
};
|
|
7663
|
+
/** The settings store's own restart fingerprints. */
|
|
7664
|
+
var RESTART_RETRY_DELAYS_MS = [
|
|
7665
|
+
150,
|
|
7666
|
+
350,
|
|
7667
|
+
600,
|
|
7668
|
+
900
|
|
7669
|
+
];
|
|
7670
|
+
/** A hub restarting under a booting runner: ~100 s in total. */
|
|
7671
|
+
var TRANSPORT_RETRY_DELAYS_MS = [
|
|
7672
|
+
150,
|
|
7673
|
+
350,
|
|
7674
|
+
600,
|
|
7675
|
+
900,
|
|
7676
|
+
2e3,
|
|
7677
|
+
5e3,
|
|
7678
|
+
1e4,
|
|
7679
|
+
2e4,
|
|
7680
|
+
3e4,
|
|
7681
|
+
3e4
|
|
7682
|
+
];
|
|
7683
|
+
var RESTART_FINGERPRINTS = ["SqliteSettingsBackend not initialized", "provider not available"];
|
|
7684
|
+
/** Node / socket error codes of a connection that did not happen or broke. */
|
|
7685
|
+
var TRANSPORT_CODES = new Set([
|
|
7686
|
+
"ECONNREFUSED",
|
|
7687
|
+
"ECONNRESET",
|
|
7688
|
+
"ETIMEDOUT",
|
|
7689
|
+
"EPIPE",
|
|
7690
|
+
"EHOSTUNREACH",
|
|
7691
|
+
"ENETUNREACH"
|
|
7692
|
+
]);
|
|
7693
|
+
/** tRPC error codes that mean "the other side is not answering now", not "your call is wrong". */
|
|
7694
|
+
var UNAVAILABLE_TRPC_CODES = new Set([
|
|
7695
|
+
"TIMEOUT",
|
|
7696
|
+
"SERVICE_UNAVAILABLE",
|
|
7697
|
+
"BAD_GATEWAY",
|
|
7698
|
+
"GATEWAY_TIMEOUT"
|
|
7699
|
+
]);
|
|
7700
|
+
/** The exact phrases OUR transport raises when it cannot reach the hub. */
|
|
7701
|
+
var TRANSPORT_PHRASES = [
|
|
7702
|
+
"discovery deadline exceeded",
|
|
7703
|
+
"parent could not route child unowned cap call",
|
|
7704
|
+
"UDS request timed out after",
|
|
7705
|
+
"channel closed"
|
|
7706
|
+
];
|
|
7707
|
+
/** Moleculer error `type`s of a call that could not be served right now. */
|
|
7708
|
+
var MOLECULER_TRANSIENT_TYPES = new Set([
|
|
7709
|
+
"REQUEST_TIMEOUT",
|
|
7710
|
+
"SERVICE_NOT_FOUND",
|
|
7711
|
+
"SERVICE_NOT_AVAILABLE",
|
|
7712
|
+
"REQUEST_REJECTED",
|
|
7713
|
+
"BROKER_DISCONNECTED"
|
|
7714
|
+
]);
|
|
7715
|
+
function stringProp(value, key) {
|
|
7716
|
+
if (typeof value !== "object" || value === null) return void 0;
|
|
7717
|
+
const found = Reflect.get(value, key);
|
|
7718
|
+
return typeof found === "string" ? found : void 0;
|
|
7719
|
+
}
|
|
7720
|
+
/** The code an error carries: its own, its cause's, or a tRPC `data.code`. */
|
|
7721
|
+
function errorCode(err) {
|
|
7722
|
+
const out = {};
|
|
7723
|
+
const cause = typeof err === "object" && err !== null ? Reflect.get(err, "cause") : void 0;
|
|
7724
|
+
const data = typeof err === "object" && err !== null ? Reflect.get(err, "data") : void 0;
|
|
7725
|
+
const node = stringProp(err, "code") ?? stringProp(cause, "code");
|
|
7726
|
+
if (node !== void 0) out.node = node;
|
|
7727
|
+
const trpc = stringProp(data, "code");
|
|
7728
|
+
if (trpc !== void 0) out.trpc = trpc;
|
|
7729
|
+
return out;
|
|
7730
|
+
}
|
|
7731
|
+
/**
|
|
7732
|
+
* Is a settings read failure worth retrying, and with which budget? Only
|
|
7733
|
+
* EXPLICIT signals count: a socket error code, a tRPC "unavailable" code, or
|
|
7734
|
+
* one of the exact phrases our own transport raises. A message that merely
|
|
7735
|
+
* contains "timed out" or "unreachable" is not evidence of anything, and
|
|
7736
|
+
* `settings store not wired` is a wiring bug that retrying cannot fix.
|
|
7737
|
+
*/
|
|
7738
|
+
function classifyStoreError(err) {
|
|
7739
|
+
const message = err instanceof Error ? err.message : String(err);
|
|
7740
|
+
if (RESTART_FINGERPRINTS.some((f) => message.includes(f))) return "restart";
|
|
7741
|
+
const code = errorCode(err);
|
|
7742
|
+
if (code.node !== void 0 && TRANSPORT_CODES.has(code.node)) return "transport";
|
|
7743
|
+
if (code.trpc !== void 0 && UNAVAILABLE_TRPC_CODES.has(code.trpc)) return "transport";
|
|
7744
|
+
if (typeof err === "object" && err !== null) {
|
|
7745
|
+
if (Reflect.get(err, "retryable") === true) return "transport";
|
|
7746
|
+
const type = stringProp(err, "type");
|
|
7747
|
+
if (type !== void 0 && MOLECULER_TRANSIENT_TYPES.has(type)) return "transport";
|
|
7748
|
+
}
|
|
7749
|
+
if (TRANSPORT_PHRASES.some((f) => message.includes(f))) return "transport";
|
|
7750
|
+
return "permanent";
|
|
7751
|
+
}
|
|
7642
7752
|
/**
|
|
7643
7753
|
* Collect the keys of every field marked `perNode: true`, recursing into
|
|
7644
7754
|
* layout containers (`group` fields and `sub-tabs` tabs) the same way
|
|
@@ -7728,6 +7838,156 @@ var PeerBytesTicketSchema = object({
|
|
|
7728
7838
|
*/
|
|
7729
7839
|
declaredBytes: number().int().nonnegative().nullable()
|
|
7730
7840
|
});
|
|
7841
|
+
/** Limits and names of `ctx.records` (D881). One authority; the engine and the facade read it. */
|
|
7842
|
+
/** The files a kind may live in. `history` is device-history's (D850), never records. */
|
|
7843
|
+
var RECORD_DATABASES = ["settings", "events"];
|
|
7844
|
+
/** The classes of a kind: the `@durable` vocabulary, one authority (replaces the annotation). */
|
|
7845
|
+
var RECORD_CLASSES = [
|
|
7846
|
+
"config",
|
|
7847
|
+
"ledger",
|
|
7848
|
+
"audit",
|
|
7849
|
+
"mirror",
|
|
7850
|
+
"ephemeral"
|
|
7851
|
+
];
|
|
7852
|
+
var RECORD_DEFAULT_MAX_DATA_BYTES = 64 * 1024;
|
|
7853
|
+
var RECORD_MAX_DATA_BYTES = 1024 * 1024;
|
|
7854
|
+
var RECORD_BATCH_MAX = 1e3;
|
|
7855
|
+
var RECORD_QUERY_MAX = 1e3;
|
|
7856
|
+
function defOf(schema) {
|
|
7857
|
+
const zodBag = Reflect.get(schema, "_zod");
|
|
7858
|
+
if (typeof zodBag !== "object" || zodBag === null) return {};
|
|
7859
|
+
const def = Reflect.get(zodBag, "def");
|
|
7860
|
+
if (typeof def !== "object" || def === null) return {};
|
|
7861
|
+
return def;
|
|
7862
|
+
}
|
|
7863
|
+
function declaredHere(schema) {
|
|
7864
|
+
return globalRegistry.get(schema)?.secret === true;
|
|
7865
|
+
}
|
|
7866
|
+
/** Wrapper kinds whose `innerType` is the field itself. */
|
|
7867
|
+
var WRAPPERS = new Set([
|
|
7868
|
+
"optional",
|
|
7869
|
+
"nullable",
|
|
7870
|
+
"default",
|
|
7871
|
+
"prefault",
|
|
7872
|
+
"catch",
|
|
7873
|
+
"readonly",
|
|
7874
|
+
"nonoptional"
|
|
7875
|
+
]);
|
|
7876
|
+
/**
|
|
7877
|
+
* The schema layers that make up ONE field: the schema itself and every
|
|
7878
|
+
* wrapper below it (optional / default / nullable / readonly / catch), plus
|
|
7879
|
+
* both sides of a pipe (`z.preprocess` puts the real schema on `out`,
|
|
7880
|
+
* `.transform` on `in`).
|
|
7881
|
+
*/
|
|
7882
|
+
function layersOf(schema) {
|
|
7883
|
+
const out = [];
|
|
7884
|
+
const queue = [schema];
|
|
7885
|
+
while (queue.length > 0) {
|
|
7886
|
+
const s = queue.shift();
|
|
7887
|
+
if (!s || out.includes(s)) continue;
|
|
7888
|
+
out.push(s);
|
|
7889
|
+
const def = defOf(s);
|
|
7890
|
+
if (def.type !== void 0 && WRAPPERS.has(def.type) && def.innerType) queue.push(def.innerType);
|
|
7891
|
+
if (def.type === "pipe") {
|
|
7892
|
+
if (def.in) queue.push(def.in);
|
|
7893
|
+
if (def.out) queue.push(def.out);
|
|
7894
|
+
}
|
|
7895
|
+
}
|
|
7896
|
+
return out;
|
|
7897
|
+
}
|
|
7898
|
+
/** True when any layer of this field declares `.meta({ secret: true })`. */
|
|
7899
|
+
function isZodSecret(schema) {
|
|
7900
|
+
return layersOf(schema).some(declaredHere);
|
|
7901
|
+
}
|
|
7902
|
+
/**
|
|
7903
|
+
* Every declared secret path in a config schema: dotted keys, `[]` for "each
|
|
7904
|
+
* element of this array" (`connection.password`, `rows[].token`). A declared
|
|
7905
|
+
* object or array is reported as one path and not descended into — everything
|
|
7906
|
+
* under it is secret.
|
|
7907
|
+
*/
|
|
7908
|
+
function collectZodSecretPaths(schema, prefix = "") {
|
|
7909
|
+
if (isZodSecret(schema)) return prefix.length > 0 ? [prefix] : [];
|
|
7910
|
+
const paths = [];
|
|
7911
|
+
for (const layer of layersOf(schema)) {
|
|
7912
|
+
const def = defOf(layer);
|
|
7913
|
+
if (def.type === "object" && def.shape) for (const [key, child] of Object.entries(def.shape)) paths.push(...collectZodSecretPaths(child, prefix ? `${prefix}.${key}` : key));
|
|
7914
|
+
else if (def.type === "array" && def.element) paths.push(...collectZodSecretPaths(def.element, `${prefix}[]`));
|
|
7915
|
+
else if (def.type === "union" && def.options) for (const option of def.options) paths.push(...collectZodSecretPaths(option, prefix));
|
|
7916
|
+
else if (def.type === "intersection") {
|
|
7917
|
+
if (def.left) paths.push(...collectZodSecretPaths(def.left, prefix));
|
|
7918
|
+
if (def.right) paths.push(...collectZodSecretPaths(def.right, prefix));
|
|
7919
|
+
}
|
|
7920
|
+
}
|
|
7921
|
+
return [...new Set(paths)];
|
|
7922
|
+
}
|
|
7923
|
+
/**
|
|
7924
|
+
* Record kinds (D881): the declaration an addon makes of one kind of fact, the
|
|
7925
|
+
* Zod row schema that describes it, and the helper that turns the two into the
|
|
7926
|
+
* JSON the engine stores.
|
|
7927
|
+
*
|
|
7928
|
+
* A kind is declared ONCE, next to the code that owns it, and the engine's
|
|
7929
|
+
* reconciler creates its indexes - nothing creates DDL at runtime from a write.
|
|
7930
|
+
* Everything the generic machinery needs (secret fields, the entry descriptor)
|
|
7931
|
+
* is DERIVED from the Zod schema: `.meta({ secret: true })` marks a credential,
|
|
7932
|
+
* never a field name (D879).
|
|
7933
|
+
*/
|
|
7934
|
+
/** A JSON field path: `trackId`, `auth.accessToken`. Charset-restricted: it is rendered into DDL. */
|
|
7935
|
+
var RecordFieldPathSchema = string().regex(/^[A-Za-z_][A-Za-z0-9_]{0,63}(\.[A-Za-z_][A-Za-z0-9_]{0,63}){0,3}$/);
|
|
7936
|
+
var RecordIndexSchema = object({
|
|
7937
|
+
name: string().regex(/^[a-z][a-z0-9_]{0,31}$/),
|
|
7938
|
+
fields: array(RecordFieldPathSchema).min(1).max(4),
|
|
7939
|
+
unique: boolean().optional()
|
|
7940
|
+
}).strict();
|
|
7941
|
+
var RecordRetentionSchema = union([
|
|
7942
|
+
object({
|
|
7943
|
+
ttlMs: number().int().positive(),
|
|
7944
|
+
from: _enum(["at", "write"])
|
|
7945
|
+
}).strict(),
|
|
7946
|
+
object({
|
|
7947
|
+
maxRows: number().int().positive().optional(),
|
|
7948
|
+
maxRowsPerDevice: number().int().positive().optional()
|
|
7949
|
+
}).strict().refine((r) => r.maxRows !== void 0 || r.maxRowsPerDevice !== void 0, { message: "name maxRows, maxRowsPerDevice or both" }),
|
|
7950
|
+
object({
|
|
7951
|
+
owner: string().min(1),
|
|
7952
|
+
reason: string().min(1)
|
|
7953
|
+
}).strict(),
|
|
7954
|
+
object({ none: string().min(1) }).strict()
|
|
7955
|
+
]);
|
|
7956
|
+
/** The descriptor a generic entries UI reads (D881 "generic entries"). */
|
|
7957
|
+
var EntryDescriptorSchema = object({
|
|
7958
|
+
title: string().min(1),
|
|
7959
|
+
/** The record body field shown as the entry's name. */
|
|
7960
|
+
nameField: string().min(1),
|
|
7961
|
+
/** JSON Schema of the entry body; `secret: true` marks a password field. */
|
|
7962
|
+
fields: record(string(), unknown())
|
|
7963
|
+
}).strict();
|
|
7964
|
+
/** What crosses the wire and sits in the engine's catalog: JSON only, no Zod. */
|
|
7965
|
+
var RecordKindDeclarationSchema = object({
|
|
7966
|
+
database: _enum(RECORD_DATABASES).default("settings"),
|
|
7967
|
+
class: _enum(RECORD_CLASSES),
|
|
7968
|
+
writeTrigger: string().min(1),
|
|
7969
|
+
device: _enum([
|
|
7970
|
+
"required",
|
|
7971
|
+
"optional",
|
|
7972
|
+
"none"
|
|
7973
|
+
]).default("none"),
|
|
7974
|
+
at: _enum(["required", "none"]).default("none"),
|
|
7975
|
+
indexes: array(RecordIndexSchema).max(8).default([]),
|
|
7976
|
+
retention: RecordRetentionSchema,
|
|
7977
|
+
deviceRemoval: _enum(["delete", "none"]).default("none"),
|
|
7978
|
+
maxDataBytes: number().int().positive().max(RECORD_MAX_DATA_BYTES).default(RECORD_DEFAULT_MAX_DATA_BYTES),
|
|
7979
|
+
/** Derived from the Zod schema; never written by hand. */
|
|
7980
|
+
secretPaths: array(string().min(1)).default([]),
|
|
7981
|
+
/** The id key of each array that carries a secret (`{ headers: 'name' }`). */
|
|
7982
|
+
secretArrayKeys: record(string(), string()).default({}),
|
|
7983
|
+
/** The legacy table this kind adopts from; the boot guard reads it (D853: no migration code). */
|
|
7984
|
+
adoptsFrom: string().min(1).optional(),
|
|
7985
|
+
/** Kinds that must agree through `transact` sit in one file under one family name. */
|
|
7986
|
+
transactFamily: string().min(1).optional(),
|
|
7987
|
+
entry: EntryDescriptorSchema.optional()
|
|
7988
|
+
}).strict();
|
|
7989
|
+
/** The kind names: lower-case, dash separated, short enough for an index name. */
|
|
7990
|
+
var RecordKindNameSchema = string().regex(/^[a-z][a-z0-9-]{0,47}$/);
|
|
7731
7991
|
/** Shared Zod schemas used across streaming capabilities. */
|
|
7732
7992
|
var CamProfileSchema = _enum([
|
|
7733
7993
|
"high",
|
|
@@ -8226,69 +8486,6 @@ method(object({ deviceId: number() }), array(StreamSourceEntrySchema)), method(o
|
|
|
8226
8486
|
kind: "mutation",
|
|
8227
8487
|
auth: "admin"
|
|
8228
8488
|
}), method(object({ deviceId: number() }), unknown().nullable()), method(object({ deviceId: number() }), RawStateResultSchema.nullable(), { auth: "protected" });
|
|
8229
|
-
function defOf(schema) {
|
|
8230
|
-
return schema._zod?.def ?? {};
|
|
8231
|
-
}
|
|
8232
|
-
function declaredHere(schema) {
|
|
8233
|
-
return globalRegistry.get(schema)?.secret === true;
|
|
8234
|
-
}
|
|
8235
|
-
/** Wrapper kinds whose `innerType` is the field itself. */
|
|
8236
|
-
var WRAPPERS = new Set([
|
|
8237
|
-
"optional",
|
|
8238
|
-
"nullable",
|
|
8239
|
-
"default",
|
|
8240
|
-
"prefault",
|
|
8241
|
-
"catch",
|
|
8242
|
-
"readonly",
|
|
8243
|
-
"nonoptional"
|
|
8244
|
-
]);
|
|
8245
|
-
/**
|
|
8246
|
-
* The schema layers that make up ONE field: the schema itself and every
|
|
8247
|
-
* wrapper below it (optional / default / nullable / readonly / catch), plus
|
|
8248
|
-
* both sides of a pipe (`z.preprocess` puts the real schema on `out`,
|
|
8249
|
-
* `.transform` on `in`).
|
|
8250
|
-
*/
|
|
8251
|
-
function layersOf(schema) {
|
|
8252
|
-
const out = [];
|
|
8253
|
-
const queue = [schema];
|
|
8254
|
-
while (queue.length > 0) {
|
|
8255
|
-
const s = queue.shift();
|
|
8256
|
-
if (!s || out.includes(s)) continue;
|
|
8257
|
-
out.push(s);
|
|
8258
|
-
const def = defOf(s);
|
|
8259
|
-
if (def.type !== void 0 && WRAPPERS.has(def.type) && def.innerType) queue.push(def.innerType);
|
|
8260
|
-
if (def.type === "pipe") {
|
|
8261
|
-
if (def.in) queue.push(def.in);
|
|
8262
|
-
if (def.out) queue.push(def.out);
|
|
8263
|
-
}
|
|
8264
|
-
}
|
|
8265
|
-
return out;
|
|
8266
|
-
}
|
|
8267
|
-
/** True when any layer of this field declares `.meta({ secret: true })`. */
|
|
8268
|
-
function isZodSecret(schema) {
|
|
8269
|
-
return layersOf(schema).some(declaredHere);
|
|
8270
|
-
}
|
|
8271
|
-
/**
|
|
8272
|
-
* Every declared secret path in a config schema: dotted keys, `[]` for "each
|
|
8273
|
-
* element of this array" (`connection.password`, `rows[].token`). A declared
|
|
8274
|
-
* object or array is reported as one path and not descended into — everything
|
|
8275
|
-
* under it is secret.
|
|
8276
|
-
*/
|
|
8277
|
-
function collectZodSecretPaths(schema, prefix = "") {
|
|
8278
|
-
if (isZodSecret(schema)) return prefix.length > 0 ? [prefix] : [];
|
|
8279
|
-
const paths = [];
|
|
8280
|
-
for (const layer of layersOf(schema)) {
|
|
8281
|
-
const def = defOf(layer);
|
|
8282
|
-
if (def.type === "object" && def.shape) for (const [key, child] of Object.entries(def.shape)) paths.push(...collectZodSecretPaths(child, prefix ? `${prefix}.${key}` : key));
|
|
8283
|
-
else if (def.type === "array" && def.element) paths.push(...collectZodSecretPaths(def.element, `${prefix}[]`));
|
|
8284
|
-
else if (def.type === "union" && def.options) for (const option of def.options) paths.push(...collectZodSecretPaths(option, prefix));
|
|
8285
|
-
else if (def.type === "intersection") {
|
|
8286
|
-
if (def.left) paths.push(...collectZodSecretPaths(def.left, prefix));
|
|
8287
|
-
if (def.right) paths.push(...collectZodSecretPaths(def.right, prefix));
|
|
8288
|
-
}
|
|
8289
|
-
}
|
|
8290
|
-
return [...new Set(paths)];
|
|
8291
|
-
}
|
|
8292
8489
|
object({
|
|
8293
8490
|
code: string().regex(/^[a-z][a-z0-9-]*(\.[a-z0-9-]+)+$/),
|
|
8294
8491
|
params: record(string(), union([string(), number()])).optional()
|
|
@@ -8332,7 +8529,7 @@ function sleep$2(ms) {
|
|
|
8332
8529
|
return new Promise((resolve) => setTimeout(resolve, Math.max(0, ms)));
|
|
8333
8530
|
}
|
|
8334
8531
|
//#endregion
|
|
8335
|
-
//#region ../types/dist/err-msg
|
|
8532
|
+
//#region ../types/dist/err-msg--2RrYiLO.mjs
|
|
8336
8533
|
var DeviceType = /* @__PURE__ */ function(DeviceType) {
|
|
8337
8534
|
DeviceType["Camera"] = "camera";
|
|
8338
8535
|
DeviceType["Hub"] = "hub";
|
|
@@ -8601,6 +8798,9 @@ var DeviceRole = /* @__PURE__ */ function(DeviceRole) {
|
|
|
8601
8798
|
/** Virtual HA toggle (input_boolean.*) — distinguishable from a
|
|
8602
8799
|
* real Switch device for UI rendering / export adapters. */
|
|
8603
8800
|
DeviceRole["BinaryHelper"] = "binary-helper";
|
|
8801
|
+
/** A smart plug: a `switch` whose source says it is an outlet (HA
|
|
8802
|
+
* `device_class: outlet`). The Alexa export shows it as a SMARTPLUG. */
|
|
8803
|
+
DeviceRole["Outlet"] = "outlet";
|
|
8604
8804
|
/** Generic motion / occupancy / moving event source. Distinct from
|
|
8605
8805
|
* the camera accessory PirSensor role: that one is a camera child;
|
|
8606
8806
|
* this is a standalone HA / 3rd-party motion sensor. */
|
|
@@ -8668,7 +8868,7 @@ var DeviceRole = /* @__PURE__ */ function(DeviceRole) {
|
|
|
8668
8868
|
return DeviceRole;
|
|
8669
8869
|
}({});
|
|
8670
8870
|
//#endregion
|
|
8671
|
-
//#region ../types/dist/composition-
|
|
8871
|
+
//#region ../types/dist/composition-DOwQB_Ua.mjs
|
|
8672
8872
|
/**
|
|
8673
8873
|
* The ffmpeg build every CamStack node downloads, per platform and arch.
|
|
8674
8874
|
*
|
|
@@ -12424,11 +12624,10 @@ var ClipModelMetaSchema = object({
|
|
|
12424
12624
|
/**
|
|
12425
12625
|
* The `vector-store` index this model's vectors live in. ONE feature space
|
|
12426
12626
|
* per index: two models share an index only when their vectors are ranked
|
|
12427
|
-
* against each other, which for CLIP means never across families.
|
|
12428
|
-
*
|
|
12429
|
-
* `modelId`); any other model gets its own.
|
|
12627
|
+
* against each other, which for CLIP means never across families. Every
|
|
12628
|
+
* model gets its own.
|
|
12430
12629
|
*/
|
|
12431
|
-
vectorIndex: string().regex(/^object-clip
|
|
12630
|
+
vectorIndex: string().regex(/^object-clip-[a-z0-9][a-z0-9-]*$/),
|
|
12432
12631
|
/**
|
|
12433
12632
|
* The text encoder's tokenizer, a declared SIBLING file of its onnx. The name
|
|
12434
12633
|
* must be unique per tokenizer: every model's siblings land in ONE flat
|
|
@@ -16161,6 +16360,41 @@ var ComposableCapabilitiesSchema = object({ caps: array(object({
|
|
|
16161
16360
|
keyField: string()
|
|
16162
16361
|
}).optional()
|
|
16163
16362
|
})) });
|
|
16363
|
+
/**
|
|
16364
|
+
* The report of a one-shot "move this owner's plaintext secrets into the
|
|
16365
|
+
* keychain" run (D878). COUNTS only - never a value, never a ref.
|
|
16366
|
+
*
|
|
16367
|
+
* The owner runs it on its own rows, through its own write path; an operator
|
|
16368
|
+
* script (`scripts/hub/migrate-raw-secrets.ts`) calls the owner's cap method.
|
|
16369
|
+
* Dry run (`apply: false`) reports what WOULD move and changes nothing.
|
|
16370
|
+
*/
|
|
16371
|
+
var RawSecretMigrationInputSchema = object({
|
|
16372
|
+
/** `false` (the default of the script) = report only. */
|
|
16373
|
+
apply: boolean() });
|
|
16374
|
+
var RawSecretMigrationReportSchema = object({
|
|
16375
|
+
apply: boolean(),
|
|
16376
|
+
/** Rows that can carry a secret (a profile, an enrolment). */
|
|
16377
|
+
rows: number().int(),
|
|
16378
|
+
/** Rows whose secret was plaintext when the run started. */
|
|
16379
|
+
raw: number().int(),
|
|
16380
|
+
/** Rows that already held a keychain marker when the run started. */
|
|
16381
|
+
markers: number().int(),
|
|
16382
|
+
/** Plaintext rows moved by THIS run (always 0 on a dry run). */
|
|
16383
|
+
migrated: number().int(),
|
|
16384
|
+
/** Plaintext rows left in place because the move or its read-back failed. */
|
|
16385
|
+
failed: number().int(),
|
|
16386
|
+
/** After the run: rows still holding plaintext. */
|
|
16387
|
+
remainingRaw: number().int(),
|
|
16388
|
+
/** After the run: markers the keychain could not resolve right now. */
|
|
16389
|
+
unresolvedMarkers: number().int(),
|
|
16390
|
+
/**
|
|
16391
|
+
* A second, redundant copy of the secrets' rows that the run found (and, on
|
|
16392
|
+
* `apply`, deleted after verifying the first). Owners with a single copy omit it.
|
|
16393
|
+
*/
|
|
16394
|
+
redundantCopies: number().int().optional(),
|
|
16395
|
+
/** True when nothing is raw and every marker resolves. */
|
|
16396
|
+
verified: boolean()
|
|
16397
|
+
});
|
|
16164
16398
|
/** Where a block runs. The operator chooses — a block driving a device on an
|
|
16165
16399
|
* agent is the reason placement is not fixed to the hub. */
|
|
16166
16400
|
var CoreBlockPlacementSchema = union([literal("hub"), string().min(1)]);
|
|
@@ -16387,6 +16621,9 @@ method(object({}), object({ blocks: array(CoreBlockSchema) }), { auth: "admin" }
|
|
|
16387
16621
|
}), SettingsUpdateResultSchema, {
|
|
16388
16622
|
kind: "mutation",
|
|
16389
16623
|
auth: "admin"
|
|
16624
|
+
}), method(RawSecretMigrationInputSchema, RawSecretMigrationReportSchema, {
|
|
16625
|
+
kind: "mutation",
|
|
16626
|
+
auth: "admin"
|
|
16390
16627
|
}), method(object({}), object({ libs: array(object({
|
|
16391
16628
|
filePath: string(),
|
|
16392
16629
|
content: string()
|
|
@@ -16650,6 +16887,347 @@ id: union([string(), number()]) }), {
|
|
|
16650
16887
|
auth: "admin"
|
|
16651
16888
|
});
|
|
16652
16889
|
/**
|
|
16890
|
+
* records - an addon's own facts and documents (D881): ledgers, audit rows,
|
|
16891
|
+
* config documents, mirrors. The third storage API next to `ctx.settings`
|
|
16892
|
+
* (operator intent, D870) and device-history (numbers over time, D850).
|
|
16893
|
+
*
|
|
16894
|
+
* Who the OWNER is: `callerAddonId`, stamped by the transport on a call that
|
|
16895
|
+
* crossed a process and stated by a hub in-process caller (`ctx.records` does
|
|
16896
|
+
* that with the addon id closed over). It is deliberately NOT in any input
|
|
16897
|
+
* schema, so a session can never supply it, and a call with no stamp is refused
|
|
16898
|
+
* `records/no-caller`. A kind is readable and writable only by its owner; other
|
|
16899
|
+
* addons go through the owner's capability.
|
|
16900
|
+
*
|
|
16901
|
+
* Every read is three-way: a row, `null`, or the call THROWS. A failed read is
|
|
16902
|
+
* never `[]`. Secret fields are never on the wire: a read shows the
|
|
16903
|
+
* redaction token, `secretRefs` hands the owner's `ctx.secrets` the refs it
|
|
16904
|
+
* resolves itself, and a write may carry only a keychain marker bound to the
|
|
16905
|
+
* row's own ref.
|
|
16906
|
+
*
|
|
16907
|
+
* Internal: addons reach it through `ctx.records`, never directly.
|
|
16908
|
+
*/
|
|
16909
|
+
var RecordIdSchema = string().min(1).max(256);
|
|
16910
|
+
/** A JSON object body. Size is the engine's check (`maxDataBytes`), not a schema's. */
|
|
16911
|
+
var RecordBodySchema = record(string(), unknown());
|
|
16912
|
+
var RecordInputSchema = object({
|
|
16913
|
+
id: RecordIdSchema,
|
|
16914
|
+
/** The device this row belongs to (D865 removal, per-device reads). */
|
|
16915
|
+
deviceId: number().int().optional(),
|
|
16916
|
+
/** The domain clock, ms: observed / created / opened. */
|
|
16917
|
+
at: number().int().optional(),
|
|
16918
|
+
/** Producer-set expiry, ms. Refused on a kind whose retention is an engine TTL. */
|
|
16919
|
+
expiresAt: number().int().optional(),
|
|
16920
|
+
data: RecordBodySchema
|
|
16921
|
+
});
|
|
16922
|
+
var RecordViewSchema = object({
|
|
16923
|
+
id: string(),
|
|
16924
|
+
deviceId: number().int().nullable(),
|
|
16925
|
+
at: number().nullable(),
|
|
16926
|
+
expiresAt: number().nullable(),
|
|
16927
|
+
rev: number().int(),
|
|
16928
|
+
updatedAt: number(),
|
|
16929
|
+
data: RecordBodySchema
|
|
16930
|
+
});
|
|
16931
|
+
/** Declared index fields only. Anything else does not compile, by design. */
|
|
16932
|
+
var RecordWhereSchema = record(RecordFieldPathSchema, union([
|
|
16933
|
+
string(),
|
|
16934
|
+
number(),
|
|
16935
|
+
boolean(),
|
|
16936
|
+
object({ in: array(union([
|
|
16937
|
+
string(),
|
|
16938
|
+
number(),
|
|
16939
|
+
boolean()
|
|
16940
|
+
])).min(1).max(RECORD_BATCH_MAX) }),
|
|
16941
|
+
object({
|
|
16942
|
+
gt: union([string(), number()]).optional(),
|
|
16943
|
+
gte: union([string(), number()]).optional(),
|
|
16944
|
+
lt: union([string(), number()]).optional(),
|
|
16945
|
+
lte: union([string(), number()]).optional()
|
|
16946
|
+
}).refine((r) => Object.keys(r).length > 0, { message: "name at least one bound" })
|
|
16947
|
+
]));
|
|
16948
|
+
var KindShape = { kind: RecordKindNameSchema };
|
|
16949
|
+
var TimeWindowShape = {
|
|
16950
|
+
deviceId: number().int().optional(),
|
|
16951
|
+
atFrom: number().optional(),
|
|
16952
|
+
atTo: number().optional()
|
|
16953
|
+
};
|
|
16954
|
+
var RecordQueryInputSchema = object({
|
|
16955
|
+
...KindShape,
|
|
16956
|
+
...TimeWindowShape,
|
|
16957
|
+
where: RecordWhereSchema.optional(),
|
|
16958
|
+
/** Without `where`: `at` (default for a kind with a clock) or `id`. With `where` the order is the index's. */
|
|
16959
|
+
order: _enum(["at", "id"]).optional(),
|
|
16960
|
+
desc: boolean().optional(),
|
|
16961
|
+
limit: number().int().min(1).max(RECORD_QUERY_MAX).default(100),
|
|
16962
|
+
/** Opaque keyset cursor from a previous answer. There is no offset. */
|
|
16963
|
+
cursor: string().min(1).optional()
|
|
16964
|
+
});
|
|
16965
|
+
var RecordQueryResultSchema = object({
|
|
16966
|
+
records: array(RecordViewSchema),
|
|
16967
|
+
nextCursor: string().nullable()
|
|
16968
|
+
});
|
|
16969
|
+
var RecordKindStateSchema = _enum([
|
|
16970
|
+
"created",
|
|
16971
|
+
"unchanged",
|
|
16972
|
+
"updated"
|
|
16973
|
+
]);
|
|
16974
|
+
var DeclareKindResultSchema = object({
|
|
16975
|
+
kindId: number().int(),
|
|
16976
|
+
state: RecordKindStateSchema,
|
|
16977
|
+
createdIndexes: array(string()),
|
|
16978
|
+
/** The boot guard: the kind is empty while its legacy table still holds rows. */
|
|
16979
|
+
adoptionPending: object({
|
|
16980
|
+
legacyTable: string(),
|
|
16981
|
+
legacyRows: number().int()
|
|
16982
|
+
}).nullable()
|
|
16983
|
+
});
|
|
16984
|
+
/** Keychain refs a write released (the old marker is gone from the row): the owner deletes the values. */
|
|
16985
|
+
var SecretRefsList = array(string());
|
|
16986
|
+
var RecordSecretRefsSchema = record(string(), record(string(), string()));
|
|
16987
|
+
method(object({ kinds: record(RecordKindNameSchema, RecordKindDeclarationSchema) }), object({ kinds: record(string(), DeclareKindResultSchema) }), {
|
|
16988
|
+
kind: "mutation",
|
|
16989
|
+
auth: "admin"
|
|
16990
|
+
}), method(object({
|
|
16991
|
+
...KindShape,
|
|
16992
|
+
id: RecordIdSchema
|
|
16993
|
+
}), RecordViewSchema.nullable(), { auth: "admin" }), method(object({
|
|
16994
|
+
...KindShape,
|
|
16995
|
+
ids: array(RecordIdSchema).min(1).max(RECORD_BATCH_MAX)
|
|
16996
|
+
}), array(RecordViewSchema), { auth: "admin" }), method(object({
|
|
16997
|
+
...KindShape,
|
|
16998
|
+
ids: array(RecordIdSchema).min(1).max(RECORD_BATCH_MAX)
|
|
16999
|
+
}), RecordSecretRefsSchema, { auth: "admin" }), method(object({
|
|
17000
|
+
...KindShape,
|
|
17001
|
+
record: RecordInputSchema,
|
|
17002
|
+
/** Compare-and-set. `0` means "the row must not exist". */
|
|
17003
|
+
ifRev: number().int().min(0).optional()
|
|
17004
|
+
}), object({
|
|
17005
|
+
rev: number().int(),
|
|
17006
|
+
releasedRefs: SecretRefsList
|
|
17007
|
+
}), {
|
|
17008
|
+
kind: "mutation",
|
|
17009
|
+
auth: "admin"
|
|
17010
|
+
}), method(object({
|
|
17011
|
+
...KindShape,
|
|
17012
|
+
records: array(RecordInputSchema).min(1).max(RECORD_BATCH_MAX)
|
|
17013
|
+
}), object({
|
|
17014
|
+
count: number().int(),
|
|
17015
|
+
releasedRefs: SecretRefsList
|
|
17016
|
+
}), {
|
|
17017
|
+
kind: "mutation",
|
|
17018
|
+
auth: "admin"
|
|
17019
|
+
}), method(object({
|
|
17020
|
+
...KindShape,
|
|
17021
|
+
id: RecordIdSchema,
|
|
17022
|
+
data: RecordBodySchema,
|
|
17023
|
+
at: number().int().nullable().optional(),
|
|
17024
|
+
expiresAt: number().int().nullable().optional(),
|
|
17025
|
+
ifRev: number().int().min(1).optional()
|
|
17026
|
+
}), object({
|
|
17027
|
+
rev: number().int(),
|
|
17028
|
+
releasedRefs: SecretRefsList
|
|
17029
|
+
}), {
|
|
17030
|
+
kind: "mutation",
|
|
17031
|
+
auth: "admin"
|
|
17032
|
+
}), method(object({
|
|
17033
|
+
...KindShape,
|
|
17034
|
+
id: RecordIdSchema
|
|
17035
|
+
}), object({
|
|
17036
|
+
deleted: boolean(),
|
|
17037
|
+
secretRefs: SecretRefsList
|
|
17038
|
+
}), {
|
|
17039
|
+
kind: "mutation",
|
|
17040
|
+
auth: "admin"
|
|
17041
|
+
}), method(object({
|
|
17042
|
+
...KindShape,
|
|
17043
|
+
ids: array(RecordIdSchema).min(1).max(RECORD_BATCH_MAX)
|
|
17044
|
+
}), object({
|
|
17045
|
+
deleted: number().int(),
|
|
17046
|
+
secretRefs: SecretRefsList
|
|
17047
|
+
}), {
|
|
17048
|
+
kind: "mutation",
|
|
17049
|
+
auth: "admin"
|
|
17050
|
+
}), method(RecordQueryInputSchema, RecordQueryResultSchema, { auth: "admin" }), method(object({
|
|
17051
|
+
...KindShape,
|
|
17052
|
+
...TimeWindowShape,
|
|
17053
|
+
where: RecordWhereSchema.optional()
|
|
17054
|
+
}), object({ count: number().int() }), { auth: "admin" }), method(object({
|
|
17055
|
+
...KindShape,
|
|
17056
|
+
deviceId: number().int().optional(),
|
|
17057
|
+
from: number(),
|
|
17058
|
+
to: number(),
|
|
17059
|
+
bucketMs: number().int().positive()
|
|
17060
|
+
}), object({ buckets: array(object({
|
|
17061
|
+
bucketStart: number(),
|
|
17062
|
+
count: number().int()
|
|
17063
|
+
})) }), { auth: "admin" }), method(object({
|
|
17064
|
+
...KindShape,
|
|
17065
|
+
op: _enum([
|
|
17066
|
+
"sum",
|
|
17067
|
+
"min",
|
|
17068
|
+
"max",
|
|
17069
|
+
"count"
|
|
17070
|
+
]),
|
|
17071
|
+
field: RecordFieldPathSchema.optional(),
|
|
17072
|
+
groupBy: RecordFieldPathSchema.optional(),
|
|
17073
|
+
where: RecordWhereSchema.optional()
|
|
17074
|
+
}), object({ rows: array(object({
|
|
17075
|
+
group: union([
|
|
17076
|
+
string(),
|
|
17077
|
+
number(),
|
|
17078
|
+
_null()
|
|
17079
|
+
]),
|
|
17080
|
+
value: number().nullable()
|
|
17081
|
+
})) }), { auth: "admin" }), method(object({
|
|
17082
|
+
...KindShape,
|
|
17083
|
+
deviceId: number().int().optional(),
|
|
17084
|
+
atBefore: number().optional(),
|
|
17085
|
+
where: RecordWhereSchema.optional()
|
|
17086
|
+
}), object({
|
|
17087
|
+
deleted: number().int(),
|
|
17088
|
+
secretRefs: SecretRefsList
|
|
17089
|
+
}), {
|
|
17090
|
+
kind: "mutation",
|
|
17091
|
+
auth: "admin"
|
|
17092
|
+
}), method(object({
|
|
17093
|
+
deviceId: number().int(),
|
|
17094
|
+
kinds: array(RecordKindNameSchema).optional()
|
|
17095
|
+
}), object({
|
|
17096
|
+
deleted: record(string(), number().int()),
|
|
17097
|
+
secretRefs: SecretRefsList
|
|
17098
|
+
}), {
|
|
17099
|
+
kind: "mutation",
|
|
17100
|
+
auth: "admin"
|
|
17101
|
+
}), method(object(KindShape), object({ id: number().int() }), {
|
|
17102
|
+
kind: "mutation",
|
|
17103
|
+
auth: "admin"
|
|
17104
|
+
});
|
|
17105
|
+
/** One table of the settings database. */
|
|
17106
|
+
var StorageTableSchema = object({
|
|
17107
|
+
/** The table's full name, e.g. `recorder:addon-settings` or `addon-device-settings`. */
|
|
17108
|
+
name: string(),
|
|
17109
|
+
/** The owner prefix of a scoped name (`recorder` for `recorder:addon-settings`), else null. */
|
|
17110
|
+
owner: string().nullable(),
|
|
17111
|
+
rows: number().int().nonnegative(),
|
|
17112
|
+
/** Bytes the table's pages occupy (`dbstat`); null when the engine cannot measure. */
|
|
17113
|
+
bytes: number().int().nonnegative().nullable(),
|
|
17114
|
+
/** Declared by an addon since this engine process started (a running addon claims it). */
|
|
17115
|
+
declaredThisBoot: boolean()
|
|
17116
|
+
});
|
|
17117
|
+
/** One declared record kind (D881) as System -> Data shows it. */
|
|
17118
|
+
var StorageKindSchema = object({
|
|
17119
|
+
owner: string(),
|
|
17120
|
+
kind: string(),
|
|
17121
|
+
database: _enum(["settings", "events"]),
|
|
17122
|
+
class: string(),
|
|
17123
|
+
state: _enum([
|
|
17124
|
+
"declared",
|
|
17125
|
+
"orphaned",
|
|
17126
|
+
"dropped"
|
|
17127
|
+
]),
|
|
17128
|
+
/** `null` when the caller asked for no counts (`counts: false`). */
|
|
17129
|
+
rows: number().int().nonnegative().nullable(),
|
|
17130
|
+
/** Rows x the average size of a sample; null for an empty kind. */
|
|
17131
|
+
bytesEstimate: number().int().nonnegative().nullable(),
|
|
17132
|
+
writeTrigger: string(),
|
|
17133
|
+
retention: RecordRetentionSchema,
|
|
17134
|
+
/** `true` when the kind is an entry kind (the generic entries UI lists it). */
|
|
17135
|
+
entry: boolean(),
|
|
17136
|
+
/** The whole declaration, secret paths and entry descriptor included (the entries service builds its handle from it). */
|
|
17137
|
+
declaration: RecordKindDeclarationSchema
|
|
17138
|
+
});
|
|
17139
|
+
method(object({ ownerPrefix: string().min(1).optional() }), object({ tables: array(StorageTableSchema) }), { auth: "admin" }), method(object({
|
|
17140
|
+
collection: string().min(1),
|
|
17141
|
+
expectRows: number().int().nonnegative()
|
|
17142
|
+
}), object({
|
|
17143
|
+
dropped: literal(true),
|
|
17144
|
+
rows: number().int().nonnegative()
|
|
17145
|
+
}), {
|
|
17146
|
+
kind: "mutation",
|
|
17147
|
+
auth: "admin"
|
|
17148
|
+
}), method(object({
|
|
17149
|
+
owner: string().min(1).optional(),
|
|
17150
|
+
/** `false` skips the per-kind row count (a catalog read only). Default true. */
|
|
17151
|
+
counts: boolean().optional()
|
|
17152
|
+
}), object({ kinds: array(StorageKindSchema) }), { auth: "admin" }), method(RecordQueryInputSchema.extend({
|
|
17153
|
+
owner: string().min(1),
|
|
17154
|
+
kind: RecordKindNameSchema
|
|
17155
|
+
}), RecordQueryResultSchema, { auth: "admin" }), method(object({
|
|
17156
|
+
owner: string().min(1),
|
|
17157
|
+
kind: RecordKindNameSchema,
|
|
17158
|
+
records: array(RecordInputSchema).max(RECORD_BATCH_MAX),
|
|
17159
|
+
/** The LAST batch: the copy is complete, the boot guard stops asking. */
|
|
17160
|
+
complete: boolean().optional()
|
|
17161
|
+
}).refine((input) => input.records.length > 0 || input.complete === true, { message: "records must be non-empty unless complete is true" }), object({ adopted: number().int() }), {
|
|
17162
|
+
kind: "mutation",
|
|
17163
|
+
auth: "admin"
|
|
17164
|
+
}), method(object({
|
|
17165
|
+
collection: string().min(1),
|
|
17166
|
+
cursor: string().optional(),
|
|
17167
|
+
limit: number().int().min(1).max(1e3).optional()
|
|
17168
|
+
}), object({
|
|
17169
|
+
rows: array(object({
|
|
17170
|
+
id: string(),
|
|
17171
|
+
data: record(string(), unknown())
|
|
17172
|
+
})),
|
|
17173
|
+
nextCursor: string().nullable()
|
|
17174
|
+
}), { auth: "admin" }), method(object({ collection: string().min(1) }), object({ adopted: boolean() }), { auth: "admin" });
|
|
17175
|
+
/**
|
|
17176
|
+
* record-entries - the ONE admin surface for every list of user-created entries
|
|
17177
|
+
* (D881): notification targets, brokers, LLM profiles, anything an addon
|
|
17178
|
+
* declares as an ENTRY kind (`entry: { title }` in `defineRecordKinds`).
|
|
17179
|
+
*
|
|
17180
|
+
* The UI is generic. `listEntryKinds` hands it, per kind, the JSON Schema of
|
|
17181
|
+
* the entry body with `secret: true` on every credential field, so a password
|
|
17182
|
+
* field is derived from the schema and never from a name. `putEntry` takes the
|
|
17183
|
+
* redaction token for an untouched secret (the stored value is kept), a string
|
|
17184
|
+
* for a new one, and the clear instruction to remove one. A read never carries
|
|
17185
|
+
* a secret value, and a locked keychain refuses the write with
|
|
17186
|
+
* `records/secret-unavailable` instead of storing plaintext.
|
|
17187
|
+
*
|
|
17188
|
+
* Hub-only, served in-process (it acts for each entry's owner on the keychain).
|
|
17189
|
+
*/
|
|
17190
|
+
var EntryKindInfoSchema = object({
|
|
17191
|
+
owner: string(),
|
|
17192
|
+
kind: RecordKindNameSchema,
|
|
17193
|
+
title: string(),
|
|
17194
|
+
nameField: string(),
|
|
17195
|
+
/** JSON Schema of the body; `secret: true` marks a password field. */
|
|
17196
|
+
fields: record(string(), unknown()),
|
|
17197
|
+
secretPaths: array(string()),
|
|
17198
|
+
rows: number().int().nonnegative()
|
|
17199
|
+
});
|
|
17200
|
+
var EntryViewSchema = object({
|
|
17201
|
+
id: RecordIdSchema,
|
|
17202
|
+
name: string(),
|
|
17203
|
+
rev: number().int(),
|
|
17204
|
+
updatedAt: number(),
|
|
17205
|
+
/** Secret fields hold the redaction token. */
|
|
17206
|
+
data: RecordBodySchema
|
|
17207
|
+
});
|
|
17208
|
+
var EntryAddress = {
|
|
17209
|
+
owner: string().min(1),
|
|
17210
|
+
kind: RecordKindNameSchema
|
|
17211
|
+
};
|
|
17212
|
+
method(object({}), object({ kinds: array(EntryKindInfoSchema) }), { auth: "admin" }), method(object({ ...EntryAddress }), object({ entries: array(EntryViewSchema) }), { auth: "admin" }), method(object({
|
|
17213
|
+
...EntryAddress,
|
|
17214
|
+
id: RecordIdSchema.optional(),
|
|
17215
|
+
data: RecordBodySchema,
|
|
17216
|
+
ifRev: number().int().min(1).optional()
|
|
17217
|
+
}), object({
|
|
17218
|
+
id: string(),
|
|
17219
|
+
rev: number().int()
|
|
17220
|
+
}), {
|
|
17221
|
+
kind: "mutation",
|
|
17222
|
+
auth: "admin"
|
|
17223
|
+
}), method(object({
|
|
17224
|
+
...EntryAddress,
|
|
17225
|
+
id: RecordIdSchema
|
|
17226
|
+
}), object({ deleted: boolean() }), {
|
|
17227
|
+
kind: "mutation",
|
|
17228
|
+
auth: "admin"
|
|
17229
|
+
});
|
|
17230
|
+
/**
|
|
16653
17231
|
* `keychain` — the hub's encrypted store of secret values (D787).
|
|
16654
17232
|
*
|
|
16655
17233
|
* Settings blobs never hold a secret: they hold a marker
|
|
@@ -17190,6 +17768,16 @@ method(object({}), KeychainStatusSchema, { auth: "admin" }), method(object({}),
|
|
|
17190
17768
|
kind: "mutation",
|
|
17191
17769
|
auth: "admin",
|
|
17192
17770
|
caller: "required"
|
|
17771
|
+
}), method(object({
|
|
17772
|
+
ref: string().min(1),
|
|
17773
|
+
value: string().min(1)
|
|
17774
|
+
}), object({
|
|
17775
|
+
ref: string(),
|
|
17776
|
+
version: number().int()
|
|
17777
|
+
}), {
|
|
17778
|
+
kind: "mutation",
|
|
17779
|
+
auth: "admin",
|
|
17780
|
+
caller: "required"
|
|
17193
17781
|
}), method(object({ refs: array(string().min(1)).max(1e3) }), object({
|
|
17194
17782
|
deleted: array(string()).readonly(),
|
|
17195
17783
|
kept: array(object({
|
|
@@ -39983,6 +40571,9 @@ method(LlmGenerateBaseInputSchema, LlmGenerateResultSchema, {
|
|
|
39983
40571
|
}), _void(), { kind: "mutation" }), method(object({}), array(LlmProfileKindDescriptorSchema)), method(object({}), array(LlmProfileSchema)), method(object({ profile: LlmProfileSchema }), LlmProfileSchema, {
|
|
39984
40572
|
kind: "mutation",
|
|
39985
40573
|
auth: "admin"
|
|
40574
|
+
}), method(RawSecretMigrationInputSchema, RawSecretMigrationReportSchema, {
|
|
40575
|
+
kind: "mutation",
|
|
40576
|
+
auth: "admin"
|
|
39986
40577
|
}), method(ProfileRefInputSchema, _void(), {
|
|
39987
40578
|
kind: "mutation",
|
|
39988
40579
|
auth: "admin"
|
|
@@ -50513,6 +51104,41 @@ var ServerRollbackInfoSchema = object({
|
|
|
50513
51104
|
atMs: number(),
|
|
50514
51105
|
reason: string()
|
|
50515
51106
|
});
|
|
51107
|
+
/**
|
|
51108
|
+
* The runner boot check (D877): the runners this node PLANNED (hub: one per
|
|
51109
|
+
* `resolveRunnerId` over its forked addons; agent: the runners its process
|
|
51110
|
+
* service holds, because only the hub plans) against the states the process
|
|
51111
|
+
* service reports. Kept in memory, recomputed by the same one-shot check after
|
|
51112
|
+
* every boot, served on `getServerPackageStatus`.
|
|
51113
|
+
*
|
|
51114
|
+
* `failed` is the D6 breaker's terminal state, `refused` a deterministic Init
|
|
51115
|
+
* refusal (an addon that said "I will not start, and here is why"), `missing` a
|
|
51116
|
+
* planned runner the process service has no entry for.
|
|
51117
|
+
*/
|
|
51118
|
+
var RunnerRefusalSchema = object({
|
|
51119
|
+
runnerId: string(),
|
|
51120
|
+
addonIds: array(string()),
|
|
51121
|
+
reason: string()
|
|
51122
|
+
});
|
|
51123
|
+
var RunnerBootCheckSchema = object({
|
|
51124
|
+
checkedAtMs: number(),
|
|
51125
|
+
/** Runners planned for this node. */
|
|
51126
|
+
expected: number(),
|
|
51127
|
+
/** Planned runners whose process is `running`. */
|
|
51128
|
+
running: number(),
|
|
51129
|
+
failed: array(string()),
|
|
51130
|
+
refused: array(RunnerRefusalSchema),
|
|
51131
|
+
missing: array(string()),
|
|
51132
|
+
/**
|
|
51133
|
+
* Runners still on their way: `starting`, or `crashed` waiting on a backoff
|
|
51134
|
+
* respawn. The check is FINAL only when this is empty; until then nothing is
|
|
51135
|
+
* pushed and the verdict is re-evaluated on the next runner state change.
|
|
51136
|
+
* Optional for version skew (absent = settled).
|
|
51137
|
+
*/
|
|
51138
|
+
pending: array(string()).optional(),
|
|
51139
|
+
/** True when the plan is the hub's (`missing` is then meaningful); false on an agent. */
|
|
51140
|
+
planKnown: boolean()
|
|
51141
|
+
});
|
|
50516
51142
|
var ServerPackageStatusSchema = object({
|
|
50517
51143
|
/** Root package name (`@camstack/server` on the hub). */
|
|
50518
51144
|
packageName: string(),
|
|
@@ -50575,7 +51201,14 @@ var ServerPackageStatusSchema = object({
|
|
|
50575
51201
|
* for version skew: an older provider's payload simply omits it, and an
|
|
50576
51202
|
* absent wrapper is unknown — never `native`.
|
|
50577
51203
|
*/
|
|
50578
|
-
wrapper: WrapperIdentitySchema.optional()
|
|
51204
|
+
wrapper: WrapperIdentitySchema.optional(),
|
|
51205
|
+
/**
|
|
51206
|
+
* What this node PLANNED to run against what its process service reports
|
|
51207
|
+
* (D877). Absent until the one-shot boot check has run (~60 s after boot) and
|
|
51208
|
+
* on a provider that predates it. Absent is "not checked yet", never "all
|
|
51209
|
+
* well": a consumer that needs the answer treats it as pending.
|
|
51210
|
+
*/
|
|
51211
|
+
runners: RunnerBootCheckSchema.optional()
|
|
50579
51212
|
});
|
|
50580
51213
|
var ServerUpdateCheckResultSchema = object({
|
|
50581
51214
|
packageName: string(),
|
|
@@ -50626,6 +51259,13 @@ var ServerUpdateOutcomeSchema = _enum([
|
|
|
50626
51259
|
"refused",
|
|
50627
51260
|
"failed"
|
|
50628
51261
|
]);
|
|
51262
|
+
/** One addon the pre-flight found the target version would refuse (D877). */
|
|
51263
|
+
var UpdateBlockerSchema = object({
|
|
51264
|
+
addonId: string(),
|
|
51265
|
+
reason: string(),
|
|
51266
|
+
/** What the operator does about it. */
|
|
51267
|
+
remedy: string()
|
|
51268
|
+
});
|
|
50629
51269
|
var ServerUpdateActionResultSchema = object({
|
|
50630
51270
|
accepted: boolean(),
|
|
50631
51271
|
targetVersion: string().nullable(),
|
|
@@ -50643,14 +51283,27 @@ var ServerUpdateActionResultSchema = object({
|
|
|
50643
51283
|
* The failure itself, verbatim enough to act on (the npm output for a
|
|
50644
51284
|
* staging install). Non-null only for `failed`.
|
|
50645
51285
|
*/
|
|
50646
|
-
error: string().nullable().optional()
|
|
51286
|
+
error: string().nullable().optional(),
|
|
51287
|
+
/**
|
|
51288
|
+
* The addons the target version would refuse to start on this node's live
|
|
51289
|
+
* store (D877), present when the pre-flight refused the update
|
|
51290
|
+
* (`reason: 'addon-would-refuse'`). Optional for version skew.
|
|
51291
|
+
*/
|
|
51292
|
+
blockers: array(UpdateBlockerSchema).optional()
|
|
50647
51293
|
});
|
|
50648
51294
|
method(_void(), ServerPackageStatusSchema, { auth: "admin" }), method(_void(), ServerUpdateCheckResultSchema, {
|
|
50649
51295
|
kind: "mutation",
|
|
50650
51296
|
auth: "admin"
|
|
50651
|
-
}), method(object({
|
|
50652
|
-
/** Explicit target version; omitted = latest from the registry. */
|
|
50653
|
-
version: string().optional()
|
|
51297
|
+
}), method(object({
|
|
51298
|
+
/** Explicit target version; omitted = latest from the registry. */
|
|
51299
|
+
version: string().optional(),
|
|
51300
|
+
/**
|
|
51301
|
+
* Apply even though the pre-flight (D877) found addons the target would
|
|
51302
|
+
* refuse to start. Off by default: those addons stay down until the
|
|
51303
|
+
* remedy is run, which is the incident this gate exists to prevent.
|
|
51304
|
+
*/
|
|
51305
|
+
acknowledgeRefusals: boolean().optional()
|
|
51306
|
+
}), ServerUpdateActionResultSchema, {
|
|
50654
51307
|
kind: "mutation",
|
|
50655
51308
|
auth: "admin",
|
|
50656
51309
|
timeoutMs: 16 * 6e4
|
|
@@ -53618,7 +54271,9 @@ var ManifestShapeSchema = object({
|
|
|
53618
54271
|
var AddonProcessSchema = object({
|
|
53619
54272
|
pid: number().optional(),
|
|
53620
54273
|
mode: string(),
|
|
53621
|
-
state: string()
|
|
54274
|
+
state: string(),
|
|
54275
|
+
/** Why the runner is `refused` (an addon's own words), when it is (D877). */
|
|
54276
|
+
reason: string().optional()
|
|
53622
54277
|
});
|
|
53623
54278
|
/**
|
|
53624
54279
|
* Per-addon health snapshot from the kernel's AddonHealthMonitor.
|
|
@@ -55007,6 +55662,12 @@ var ClimateControlStatusSchema = object({
|
|
|
55007
55662
|
/** Horizontal louver swing on/off. Null when the device has no
|
|
55008
55663
|
* horizontal swing surface (gate with `DeviceFeature.ClimateSwingHorizontal`). */
|
|
55009
55664
|
swingHorizontal: boolean().nullable(),
|
|
55665
|
+
/** Lowest setpoint the device accepts, Celsius. Absent / null = not reported. */
|
|
55666
|
+
minTemp: number().nullable().optional(),
|
|
55667
|
+
/** Highest setpoint the device accepts, Celsius. Absent / null = not reported. */
|
|
55668
|
+
maxTemp: number().nullable().optional(),
|
|
55669
|
+
/** Setpoint granularity, Celsius (0.5, 1). Absent / null = not reported. */
|
|
55670
|
+
tempStep: number().positive().nullable().optional(),
|
|
55010
55671
|
/** Ms epoch when the slice was last updated (push or command). */
|
|
55011
55672
|
lastFetchedAt: number()
|
|
55012
55673
|
});
|
|
@@ -57787,7 +58448,19 @@ var TlsStatusSchema = object({
|
|
|
57787
58448
|
sans: array(string()),
|
|
57788
58449
|
caCertPem: string().nullable(),
|
|
57789
58450
|
reissueError: string().nullable(),
|
|
57790
|
-
restartRequired: boolean()
|
|
58451
|
+
restartRequired: boolean(),
|
|
58452
|
+
/** An uploaded certificate is served but no CA is kept for it and it is not publicly signed (D873). */
|
|
58453
|
+
caMissing: boolean(),
|
|
58454
|
+
/** Does the hub's own generated CA carry a critical name constraint? `null` while it has none. */
|
|
58455
|
+
localCaConstrained: boolean().nullable(),
|
|
58456
|
+
/** ISO time the generated CA was replaced by a constrained one; devices must re-download it. */
|
|
58457
|
+
caReplacedAt: string().nullable(),
|
|
58458
|
+
/** The uploaded certificate kept on disk, selectable again after "Revert to generated". */
|
|
58459
|
+
storedUpload: object({
|
|
58460
|
+
leafFingerprintSha256: string(),
|
|
58461
|
+
validTo: string(),
|
|
58462
|
+
hasCa: boolean()
|
|
58463
|
+
}).nullable()
|
|
57791
58464
|
});
|
|
57792
58465
|
method(_void(), ListResultSchema), method(_void(), PreferredSchema), method(object({
|
|
57793
58466
|
/**
|
|
@@ -57843,6 +58516,9 @@ method(_void(), ListResultSchema), method(_void(), PreferredSchema), method(obje
|
|
|
57843
58516
|
}), method(_void(), object({ pem: string() })), method(_void(), TlsStatusSchema, {
|
|
57844
58517
|
kind: "mutation",
|
|
57845
58518
|
auth: "admin"
|
|
58519
|
+
}), method(_void(), TlsStatusSchema, {
|
|
58520
|
+
kind: "mutation",
|
|
58521
|
+
auth: "admin"
|
|
57846
58522
|
});
|
|
57847
58523
|
var LockControlStatusSchema = object({
|
|
57848
58524
|
/** Lifecycle state of the lock. `jammed` means the motor reported
|
|
@@ -64906,7 +65582,11 @@ method(_void(), array(UserSummarySchema), { auth: "admin" }), method(CreateUserI
|
|
|
64906
65582
|
kind: "mutation",
|
|
64907
65583
|
auth: "admin",
|
|
64908
65584
|
access: "delete"
|
|
64909
|
-
}), method(object({ userId: string() }), TotpStatusSchema, { auth: "admin" }), method(
|
|
65585
|
+
}), method(object({ userId: string() }), TotpStatusSchema, { auth: "admin" }), method(RawSecretMigrationInputSchema, RawSecretMigrationReportSchema, {
|
|
65586
|
+
kind: "mutation",
|
|
65587
|
+
auth: "admin",
|
|
65588
|
+
access: "create"
|
|
65589
|
+
}), method(object({
|
|
64910
65590
|
userId: string(),
|
|
64911
65591
|
code: string()
|
|
64912
65592
|
}), object({ valid: boolean() }), {
|
|
@@ -66733,13 +67413,14 @@ var BaseDevice = class {
|
|
|
66733
67413
|
get state() {
|
|
66734
67414
|
if (!this._stateProxyCache) {
|
|
66735
67415
|
const cache = {};
|
|
66736
|
-
const handler = { get: (
|
|
67416
|
+
const handler = { get: (target, key) => {
|
|
66737
67417
|
const k = key;
|
|
66738
|
-
|
|
67418
|
+
const existing = Reflect.get(target, k);
|
|
67419
|
+
if (existing !== void 0) return existing;
|
|
66739
67420
|
const cap = DEVICE_LOCAL_STATE_CAPS[k];
|
|
66740
67421
|
if (!cap) return void 0;
|
|
66741
67422
|
const proxy = this.sliceProxy(cap);
|
|
66742
|
-
|
|
67423
|
+
Reflect.set(target, k, proxy);
|
|
66743
67424
|
return proxy;
|
|
66744
67425
|
} };
|
|
66745
67426
|
this._stateProxyCache = new Proxy(cache, handler);
|
|
@@ -66938,7 +67619,7 @@ var BaseDevice = class {
|
|
|
66938
67619
|
async updateSourceInfo(patch) {
|
|
66939
67620
|
const next = mergeSourceInfo(this.sourceInfo, patch);
|
|
66940
67621
|
this._sourceInfoCache = Object.freeze({ ...next });
|
|
66941
|
-
const action = this.ctx.api
|
|
67622
|
+
const action = this.ctx.api.deviceManager?.setMetadata;
|
|
66942
67623
|
if (action) try {
|
|
66943
67624
|
await action.mutate({
|
|
66944
67625
|
deviceId: this.id,
|
|
@@ -66973,7 +67654,7 @@ var BaseDevice = class {
|
|
|
66973
67654
|
* device boot on a meta refresh.
|
|
66974
67655
|
*/
|
|
66975
67656
|
async refreshFeatures() {
|
|
66976
|
-
const action = this.ctx.api
|
|
67657
|
+
const action = this.ctx.api.deviceManager?.registerDevice;
|
|
66977
67658
|
if (!action) return;
|
|
66978
67659
|
try {
|
|
66979
67660
|
await action.mutate({
|
|
@@ -69047,6 +69728,12 @@ Object.freeze({
|
|
|
69047
69728
|
addonId: null,
|
|
69048
69729
|
access: "view"
|
|
69049
69730
|
},
|
|
69731
|
+
"coreBlocks.migrateRawSecrets": {
|
|
69732
|
+
capName: "core-blocks",
|
|
69733
|
+
capScope: "system",
|
|
69734
|
+
addonId: null,
|
|
69735
|
+
access: "create"
|
|
69736
|
+
},
|
|
69050
69737
|
"coreBlocks.restart": {
|
|
69051
69738
|
capName: "core-blocks",
|
|
69052
69739
|
capScope: "system",
|
|
@@ -70733,6 +71420,12 @@ Object.freeze({
|
|
|
70733
71420
|
addonId: null,
|
|
70734
71421
|
access: "create"
|
|
70735
71422
|
},
|
|
71423
|
+
"keychainAdmin.importSecret": {
|
|
71424
|
+
capName: "keychain-admin",
|
|
71425
|
+
capScope: "system",
|
|
71426
|
+
addonId: null,
|
|
71427
|
+
access: "create"
|
|
71428
|
+
},
|
|
70736
71429
|
"keychainAdmin.listAudit": {
|
|
70737
71430
|
capName: "keychain-admin",
|
|
70738
71431
|
capScope: "system",
|
|
@@ -70901,6 +71594,12 @@ Object.freeze({
|
|
|
70901
71594
|
addonId: null,
|
|
70902
71595
|
access: "view"
|
|
70903
71596
|
},
|
|
71597
|
+
"llm.migrateRawSecrets": {
|
|
71598
|
+
capName: "llm",
|
|
71599
|
+
capScope: "system",
|
|
71600
|
+
addonId: null,
|
|
71601
|
+
access: "create"
|
|
71602
|
+
},
|
|
70904
71603
|
"llm.resolveModelRef": {
|
|
70905
71604
|
capName: "llm",
|
|
70906
71605
|
capScope: "system",
|
|
@@ -71129,6 +71828,12 @@ Object.freeze({
|
|
|
71129
71828
|
addonId: null,
|
|
71130
71829
|
access: "create"
|
|
71131
71830
|
},
|
|
71831
|
+
"localNetwork.useStoredUploadedCertificate": {
|
|
71832
|
+
capName: "local-network",
|
|
71833
|
+
capScope: "system",
|
|
71834
|
+
addonId: null,
|
|
71835
|
+
access: "create"
|
|
71836
|
+
},
|
|
71132
71837
|
"lockControl.getStatus": {
|
|
71133
71838
|
capName: "lock-control",
|
|
71134
71839
|
capScope: "device",
|
|
@@ -73781,6 +74486,30 @@ Object.freeze({
|
|
|
73781
74486
|
addonId: null,
|
|
73782
74487
|
access: "create"
|
|
73783
74488
|
},
|
|
74489
|
+
"recordEntries.deleteEntry": {
|
|
74490
|
+
capName: "record-entries",
|
|
74491
|
+
capScope: "system",
|
|
74492
|
+
addonId: null,
|
|
74493
|
+
access: "delete"
|
|
74494
|
+
},
|
|
74495
|
+
"recordEntries.listEntries": {
|
|
74496
|
+
capName: "record-entries",
|
|
74497
|
+
capScope: "system",
|
|
74498
|
+
addonId: null,
|
|
74499
|
+
access: "view"
|
|
74500
|
+
},
|
|
74501
|
+
"recordEntries.listEntryKinds": {
|
|
74502
|
+
capName: "record-entries",
|
|
74503
|
+
capScope: "system",
|
|
74504
|
+
addonId: null,
|
|
74505
|
+
access: "view"
|
|
74506
|
+
},
|
|
74507
|
+
"recordEntries.putEntry": {
|
|
74508
|
+
capName: "record-entries",
|
|
74509
|
+
capScope: "system",
|
|
74510
|
+
addonId: null,
|
|
74511
|
+
access: "create"
|
|
74512
|
+
},
|
|
73784
74513
|
"recording.getAvailability": {
|
|
73785
74514
|
capName: "recording",
|
|
73786
74515
|
capScope: "device",
|
|
@@ -74081,6 +74810,102 @@ Object.freeze({
|
|
|
74081
74810
|
addonId: null,
|
|
74082
74811
|
access: "view"
|
|
74083
74812
|
},
|
|
74813
|
+
"records.aggregate": {
|
|
74814
|
+
capName: "records",
|
|
74815
|
+
capScope: "system",
|
|
74816
|
+
addonId: null,
|
|
74817
|
+
access: "view"
|
|
74818
|
+
},
|
|
74819
|
+
"records.allocateId": {
|
|
74820
|
+
capName: "records",
|
|
74821
|
+
capScope: "system",
|
|
74822
|
+
addonId: null,
|
|
74823
|
+
access: "create"
|
|
74824
|
+
},
|
|
74825
|
+
"records.count": {
|
|
74826
|
+
capName: "records",
|
|
74827
|
+
capScope: "system",
|
|
74828
|
+
addonId: null,
|
|
74829
|
+
access: "view"
|
|
74830
|
+
},
|
|
74831
|
+
"records.declareKinds": {
|
|
74832
|
+
capName: "records",
|
|
74833
|
+
capScope: "system",
|
|
74834
|
+
addonId: null,
|
|
74835
|
+
access: "create"
|
|
74836
|
+
},
|
|
74837
|
+
"records.delete": {
|
|
74838
|
+
capName: "records",
|
|
74839
|
+
capScope: "system",
|
|
74840
|
+
addonId: null,
|
|
74841
|
+
access: "delete"
|
|
74842
|
+
},
|
|
74843
|
+
"records.deleteDevice": {
|
|
74844
|
+
capName: "records",
|
|
74845
|
+
capScope: "system",
|
|
74846
|
+
addonId: null,
|
|
74847
|
+
access: "delete"
|
|
74848
|
+
},
|
|
74849
|
+
"records.deleteMany": {
|
|
74850
|
+
capName: "records",
|
|
74851
|
+
capScope: "system",
|
|
74852
|
+
addonId: null,
|
|
74853
|
+
access: "delete"
|
|
74854
|
+
},
|
|
74855
|
+
"records.deleteWhere": {
|
|
74856
|
+
capName: "records",
|
|
74857
|
+
capScope: "system",
|
|
74858
|
+
addonId: null,
|
|
74859
|
+
access: "delete"
|
|
74860
|
+
},
|
|
74861
|
+
"records.get": {
|
|
74862
|
+
capName: "records",
|
|
74863
|
+
capScope: "system",
|
|
74864
|
+
addonId: null,
|
|
74865
|
+
access: "view"
|
|
74866
|
+
},
|
|
74867
|
+
"records.getMany": {
|
|
74868
|
+
capName: "records",
|
|
74869
|
+
capScope: "system",
|
|
74870
|
+
addonId: null,
|
|
74871
|
+
access: "view"
|
|
74872
|
+
},
|
|
74873
|
+
"records.histogram": {
|
|
74874
|
+
capName: "records",
|
|
74875
|
+
capScope: "system",
|
|
74876
|
+
addonId: null,
|
|
74877
|
+
access: "view"
|
|
74878
|
+
},
|
|
74879
|
+
"records.patch": {
|
|
74880
|
+
capName: "records",
|
|
74881
|
+
capScope: "system",
|
|
74882
|
+
addonId: null,
|
|
74883
|
+
access: "create"
|
|
74884
|
+
},
|
|
74885
|
+
"records.put": {
|
|
74886
|
+
capName: "records",
|
|
74887
|
+
capScope: "system",
|
|
74888
|
+
addonId: null,
|
|
74889
|
+
access: "create"
|
|
74890
|
+
},
|
|
74891
|
+
"records.putMany": {
|
|
74892
|
+
capName: "records",
|
|
74893
|
+
capScope: "system",
|
|
74894
|
+
addonId: null,
|
|
74895
|
+
access: "create"
|
|
74896
|
+
},
|
|
74897
|
+
"records.query": {
|
|
74898
|
+
capName: "records",
|
|
74899
|
+
capScope: "system",
|
|
74900
|
+
addonId: null,
|
|
74901
|
+
access: "view"
|
|
74902
|
+
},
|
|
74903
|
+
"records.secretRefs": {
|
|
74904
|
+
capName: "records",
|
|
74905
|
+
capScope: "system",
|
|
74906
|
+
addonId: null,
|
|
74907
|
+
access: "view"
|
|
74908
|
+
},
|
|
74084
74909
|
"sceneMonitor.captureReference": {
|
|
74085
74910
|
capName: "scene-monitor",
|
|
74086
74911
|
capScope: "device",
|
|
@@ -74513,6 +75338,48 @@ Object.freeze({
|
|
|
74513
75338
|
addonId: null,
|
|
74514
75339
|
access: "create"
|
|
74515
75340
|
},
|
|
75341
|
+
"storageAdmin.adoptRecords": {
|
|
75342
|
+
capName: "storage-admin",
|
|
75343
|
+
capScope: "system",
|
|
75344
|
+
addonId: null,
|
|
75345
|
+
access: "create"
|
|
75346
|
+
},
|
|
75347
|
+
"storageAdmin.dropCollection": {
|
|
75348
|
+
capName: "storage-admin",
|
|
75349
|
+
capScope: "system",
|
|
75350
|
+
addonId: null,
|
|
75351
|
+
access: "delete"
|
|
75352
|
+
},
|
|
75353
|
+
"storageAdmin.isAdoptedLegacyTable": {
|
|
75354
|
+
capName: "storage-admin",
|
|
75355
|
+
capScope: "system",
|
|
75356
|
+
addonId: null,
|
|
75357
|
+
access: "view"
|
|
75358
|
+
},
|
|
75359
|
+
"storageAdmin.listKinds": {
|
|
75360
|
+
capName: "storage-admin",
|
|
75361
|
+
capScope: "system",
|
|
75362
|
+
addonId: null,
|
|
75363
|
+
access: "view"
|
|
75364
|
+
},
|
|
75365
|
+
"storageAdmin.listTables": {
|
|
75366
|
+
capName: "storage-admin",
|
|
75367
|
+
capScope: "system",
|
|
75368
|
+
addonId: null,
|
|
75369
|
+
access: "view"
|
|
75370
|
+
},
|
|
75371
|
+
"storageAdmin.readLegacyCollection": {
|
|
75372
|
+
capName: "storage-admin",
|
|
75373
|
+
capScope: "system",
|
|
75374
|
+
addonId: null,
|
|
75375
|
+
access: "view"
|
|
75376
|
+
},
|
|
75377
|
+
"storageAdmin.readRecords": {
|
|
75378
|
+
capName: "storage-admin",
|
|
75379
|
+
capScope: "system",
|
|
75380
|
+
addonId: null,
|
|
75381
|
+
access: "view"
|
|
75382
|
+
},
|
|
74516
75383
|
"storageEvictable.evict": {
|
|
74517
75384
|
capName: "storage-evictable",
|
|
74518
75385
|
capScope: "system",
|
|
@@ -75425,6 +76292,12 @@ Object.freeze({
|
|
|
75425
76292
|
addonId: null,
|
|
75426
76293
|
access: "view"
|
|
75427
76294
|
},
|
|
76295
|
+
"userManagement.migrateRawSecrets": {
|
|
76296
|
+
capName: "user-management",
|
|
76297
|
+
capScope: "system",
|
|
76298
|
+
addonId: null,
|
|
76299
|
+
access: "create"
|
|
76300
|
+
},
|
|
75428
76301
|
"userManagement.oauthExchangeCode": {
|
|
75429
76302
|
capName: "user-management",
|
|
75430
76303
|
capScope: "system",
|
|
@@ -78253,6 +79126,37 @@ Object.freeze({
|
|
|
78253
79126
|
form: "single",
|
|
78254
79127
|
optional: false
|
|
78255
79128
|
}],
|
|
79129
|
+
"records.count": [{
|
|
79130
|
+
name: "deviceId",
|
|
79131
|
+
form: "single",
|
|
79132
|
+
optional: true
|
|
79133
|
+
}],
|
|
79134
|
+
"records.deleteDevice": [{
|
|
79135
|
+
name: "deviceId",
|
|
79136
|
+
form: "single",
|
|
79137
|
+
optional: false
|
|
79138
|
+
}],
|
|
79139
|
+
"records.deleteWhere": [{
|
|
79140
|
+
name: "deviceId",
|
|
79141
|
+
form: "single",
|
|
79142
|
+
optional: true
|
|
79143
|
+
}],
|
|
79144
|
+
"records.histogram": [{
|
|
79145
|
+
name: "deviceId",
|
|
79146
|
+
form: "single",
|
|
79147
|
+
optional: true
|
|
79148
|
+
}],
|
|
79149
|
+
"records.putMany": [{
|
|
79150
|
+
name: "records",
|
|
79151
|
+
form: "object-array",
|
|
79152
|
+
optional: false,
|
|
79153
|
+
itemField: "deviceId"
|
|
79154
|
+
}],
|
|
79155
|
+
"records.query": [{
|
|
79156
|
+
name: "deviceId",
|
|
79157
|
+
form: "single",
|
|
79158
|
+
optional: true
|
|
79159
|
+
}],
|
|
78256
79160
|
"sceneMonitor.captureReference": [{
|
|
78257
79161
|
name: "deviceId",
|
|
78258
79162
|
form: "single",
|
|
@@ -78369,6 +79273,17 @@ Object.freeze({
|
|
|
78369
79273
|
form: "single",
|
|
78370
79274
|
optional: false
|
|
78371
79275
|
}],
|
|
79276
|
+
"storageAdmin.adoptRecords": [{
|
|
79277
|
+
name: "records",
|
|
79278
|
+
form: "object-array",
|
|
79279
|
+
optional: false,
|
|
79280
|
+
itemField: "deviceId"
|
|
79281
|
+
}],
|
|
79282
|
+
"storageAdmin.readRecords": [{
|
|
79283
|
+
name: "deviceId",
|
|
79284
|
+
form: "single",
|
|
79285
|
+
optional: true
|
|
79286
|
+
}],
|
|
78372
79287
|
"streamBroker.acquireEgressTranscode": [{
|
|
78373
79288
|
name: "deviceId",
|
|
78374
79289
|
form: "single",
|