@camstack/types 1.2.375 → 1.2.377
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/base-addon.d.ts +21 -7
- package/dist/addon.js +14 -2
- package/dist/addon.mjs +14 -2
- package/dist/capabilities/climate-control.cap.d.ts +9 -0
- package/dist/capabilities/index.d.ts +3 -1
- package/dist/capabilities/keychain-admin.cap.d.ts +16 -0
- package/dist/capabilities/storage-admin.cap.d.ts +76 -0
- package/dist/client.js +1 -0
- package/dist/client.mjs +1 -0
- package/dist/{composition-DIp0uE_b.js → composition-CUAOHZ38.js} +1 -1
- package/dist/{composition-EQ9Ok0Ee.mjs → composition-DOwQB_Ua.mjs} +1 -1
- package/dist/device/device-type.d.ts +3 -0
- package/dist/{err-msg-DLerKiVO.mjs → err-msg--2RrYiLO.mjs} +3 -0
- package/dist/{err-msg-Ls8Q6dHO.js → err-msg-Bb-s4Xuj.js} +3 -0
- package/dist/generated/addon-api.d.ts +29 -0
- package/dist/generated/addon-cap-facts.d.ts +1 -1
- package/dist/generated/capability-router-map.d.ts +5 -2
- package/dist/generated/method-access-map.d.ts +1 -1
- package/dist/generated/system-proxy.d.ts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +144 -3
- package/dist/index.mjs +140 -4
- package/dist/interfaces/addon.d.ts +7 -11
- package/dist/node.js +2 -2
- package/dist/node.mjs +2 -2
- package/dist/{sleep-rqlHXgwb.js → sleep-Dq0Uyeh0.js} +121 -23
- package/dist/{sleep-DRqxtc0C.mjs → sleep-bwsTj221.mjs} +116 -24
- package/package.json +1 -1
|
@@ -1530,7 +1530,6 @@ function createHandle(raw, opts) {
|
|
|
1530
1530
|
const writeAddon = (patch) => write("addon", opts.addonTree(), void 0, patch, () => readStoredAddonBlob(raw), (p) => raw.writeAddonStore(p));
|
|
1531
1531
|
const readAddonStoreResult = raw.readAddonStoreResult;
|
|
1532
1532
|
const readAddonStoreKeyResult = raw.readAddonStoreKeyResult;
|
|
1533
|
-
const readDeviceStoreBatch = raw.readDeviceStoreBatch;
|
|
1534
1533
|
const overrides = {
|
|
1535
1534
|
readAddonStore: async () => resolveRead("addon", await raw.readAddonStore()),
|
|
1536
1535
|
...readAddonStoreResult !== void 0 ? { readAddonStoreResult: async () => {
|
|
@@ -1554,12 +1553,12 @@ function createHandle(raw, opts) {
|
|
|
1554
1553
|
};
|
|
1555
1554
|
} } : {},
|
|
1556
1555
|
readDeviceStore: async (deviceId) => resolveRead(`device:${deviceId}`, await raw.readDeviceStore(deviceId)),
|
|
1557
|
-
|
|
1558
|
-
const rows = await readDeviceStoreBatch
|
|
1556
|
+
readDeviceStoreBatch: async (deviceIds) => {
|
|
1557
|
+
const rows = await raw.readDeviceStoreBatch(deviceIds);
|
|
1559
1558
|
const out = /* @__PURE__ */ new Map();
|
|
1560
1559
|
for (const [deviceId, blob] of rows) out.set(deviceId, await resolveRead(`device:${deviceId}`, blob));
|
|
1561
1560
|
return out;
|
|
1562
|
-
}
|
|
1561
|
+
},
|
|
1563
1562
|
writeAddonStore: async (patch) => {
|
|
1564
1563
|
await writeAddon(patch);
|
|
1565
1564
|
},
|
|
@@ -2403,7 +2402,7 @@ var BaseAddon = class {
|
|
|
2403
2402
|
return this._addonSecretTree;
|
|
2404
2403
|
}
|
|
2405
2404
|
deviceSecretTree() {
|
|
2406
|
-
this._deviceSecretTree ??= secretTreeFromSchema(this.deviceSettingsSchema());
|
|
2405
|
+
this._deviceSecretTree ??= mergeSecretStatePaths(secretTreeFromSchema(this.deviceSettingsSchema()), this.secretStatePaths);
|
|
2407
2406
|
return this._deviceSecretTree;
|
|
2408
2407
|
}
|
|
2409
2408
|
/**
|
|
@@ -2479,42 +2478,135 @@ var BaseAddon = class {
|
|
|
2479
2478
|
this[timerOf] = timer;
|
|
2480
2479
|
}
|
|
2481
2480
|
/**
|
|
2482
|
-
* Wrap `ctx.settings.readAddonStore()` with a
|
|
2483
|
-
*
|
|
2484
|
-
* swap, or any race where the SqliteSettingsBackend is between shutdown and
|
|
2485
|
-
* re-initialize) doesn't propagate up into `initialize()` and leave the
|
|
2481
|
+
* Wrap `ctx.settings.readAddonStore()` with a retry budget so a transient
|
|
2482
|
+
* settings-store outage doesn't propagate up into `initialize()` and leave the
|
|
2486
2483
|
* addon permanently broken.
|
|
2487
2484
|
*
|
|
2488
|
-
*
|
|
2489
|
-
*
|
|
2490
|
-
* `
|
|
2485
|
+
* Two kinds of outage, two budgets:
|
|
2486
|
+
* - the store's own restart fingerprints (`SqliteSettingsBackend not
|
|
2487
|
+
* initialized`, `provider not available`): a short budget, then the addon
|
|
2488
|
+
* falls back to `{}` (defaults) - its first successful patch rehydrates;
|
|
2489
|
+
* - a TRANSPORT failure (the hub is restarting while this runner boots:
|
|
2490
|
+
* `discovery deadline exceeded`, `parent could not route`, a refused or
|
|
2491
|
+
* timed-out connection). Since D870 a runner's settings read THROWS instead
|
|
2492
|
+
* of answering `{}`, so without a budget a hub restart ends in a respawn
|
|
2493
|
+
* loop. A long, bounded budget; only after it the error propagates - the
|
|
2494
|
+
* addon never runs on defaults for a store it could not ask.
|
|
2495
|
+
* Anything else propagates immediately so real bugs surface.
|
|
2491
2496
|
*/
|
|
2492
2497
|
async readAddonStoreWithRetry() {
|
|
2493
2498
|
const settings = this.rawSettings();
|
|
2494
2499
|
if (!settings) return {};
|
|
2495
|
-
const delaysMs = [
|
|
2496
|
-
150,
|
|
2497
|
-
350,
|
|
2498
|
-
600,
|
|
2499
|
-
900
|
|
2500
|
-
];
|
|
2501
2500
|
let lastErr;
|
|
2502
|
-
for (let attempt = 0
|
|
2501
|
+
for (let attempt = 0;; attempt++) try {
|
|
2503
2502
|
const stored = await settings.readAddonStore() ?? {};
|
|
2504
2503
|
this.settingsStoreReady = true;
|
|
2505
2504
|
return stored;
|
|
2506
2505
|
} catch (err) {
|
|
2507
2506
|
lastErr = err;
|
|
2508
|
-
const
|
|
2509
|
-
if (
|
|
2510
|
-
|
|
2511
|
-
|
|
2507
|
+
const kind = classifyStoreError(err);
|
|
2508
|
+
if (kind === "permanent") throw err;
|
|
2509
|
+
const delay = (kind === "transport" ? TRANSPORT_RETRY_DELAYS_MS : RESTART_RETRY_DELAYS_MS)[attempt];
|
|
2510
|
+
if (delay === void 0) {
|
|
2511
|
+
if (kind === "transport") throw err;
|
|
2512
|
+
break;
|
|
2513
|
+
}
|
|
2514
|
+
await new Promise((r) => setTimeout(r, delay));
|
|
2512
2515
|
}
|
|
2513
2516
|
this.settingsStoreReady = false;
|
|
2514
2517
|
this._ctx?.logger?.warn?.("readAddonStore: settings-store unavailable after retries — using defaults", { meta: { error: lastErr instanceof Error ? lastErr.message : String(lastErr) } });
|
|
2515
2518
|
return {};
|
|
2516
2519
|
}
|
|
2517
2520
|
};
|
|
2521
|
+
/** The settings store's own restart fingerprints. */
|
|
2522
|
+
var RESTART_RETRY_DELAYS_MS = [
|
|
2523
|
+
150,
|
|
2524
|
+
350,
|
|
2525
|
+
600,
|
|
2526
|
+
900
|
|
2527
|
+
];
|
|
2528
|
+
/** A hub restarting under a booting runner: ~100 s in total. */
|
|
2529
|
+
var TRANSPORT_RETRY_DELAYS_MS = [
|
|
2530
|
+
150,
|
|
2531
|
+
350,
|
|
2532
|
+
600,
|
|
2533
|
+
900,
|
|
2534
|
+
2e3,
|
|
2535
|
+
5e3,
|
|
2536
|
+
1e4,
|
|
2537
|
+
2e4,
|
|
2538
|
+
3e4,
|
|
2539
|
+
3e4
|
|
2540
|
+
];
|
|
2541
|
+
var RESTART_FINGERPRINTS = ["SqliteSettingsBackend not initialized", "provider not available"];
|
|
2542
|
+
/** Node / socket error codes of a connection that did not happen or broke. */
|
|
2543
|
+
var TRANSPORT_CODES = new Set([
|
|
2544
|
+
"ECONNREFUSED",
|
|
2545
|
+
"ECONNRESET",
|
|
2546
|
+
"ETIMEDOUT",
|
|
2547
|
+
"EPIPE",
|
|
2548
|
+
"EHOSTUNREACH",
|
|
2549
|
+
"ENETUNREACH"
|
|
2550
|
+
]);
|
|
2551
|
+
/** tRPC error codes that mean "the other side is not answering now", not "your call is wrong". */
|
|
2552
|
+
var UNAVAILABLE_TRPC_CODES = new Set([
|
|
2553
|
+
"TIMEOUT",
|
|
2554
|
+
"SERVICE_UNAVAILABLE",
|
|
2555
|
+
"BAD_GATEWAY",
|
|
2556
|
+
"GATEWAY_TIMEOUT"
|
|
2557
|
+
]);
|
|
2558
|
+
/** The exact phrases OUR transport raises when it cannot reach the hub. */
|
|
2559
|
+
var TRANSPORT_PHRASES = [
|
|
2560
|
+
"discovery deadline exceeded",
|
|
2561
|
+
"parent could not route child unowned cap call",
|
|
2562
|
+
"UDS request timed out after",
|
|
2563
|
+
"channel closed"
|
|
2564
|
+
];
|
|
2565
|
+
/** Moleculer error `type`s of a call that could not be served right now. */
|
|
2566
|
+
var MOLECULER_TRANSIENT_TYPES = new Set([
|
|
2567
|
+
"REQUEST_TIMEOUT",
|
|
2568
|
+
"SERVICE_NOT_FOUND",
|
|
2569
|
+
"SERVICE_NOT_AVAILABLE",
|
|
2570
|
+
"REQUEST_REJECTED",
|
|
2571
|
+
"BROKER_DISCONNECTED"
|
|
2572
|
+
]);
|
|
2573
|
+
function stringProp(value, key) {
|
|
2574
|
+
if (typeof value !== "object" || value === null) return void 0;
|
|
2575
|
+
const found = Reflect.get(value, key);
|
|
2576
|
+
return typeof found === "string" ? found : void 0;
|
|
2577
|
+
}
|
|
2578
|
+
/** The code an error carries: its own, its cause's, or a tRPC `data.code`. */
|
|
2579
|
+
function errorCode(err) {
|
|
2580
|
+
const out = {};
|
|
2581
|
+
const cause = typeof err === "object" && err !== null ? Reflect.get(err, "cause") : void 0;
|
|
2582
|
+
const data = typeof err === "object" && err !== null ? Reflect.get(err, "data") : void 0;
|
|
2583
|
+
const node = stringProp(err, "code") ?? stringProp(cause, "code");
|
|
2584
|
+
if (node !== void 0) out.node = node;
|
|
2585
|
+
const trpc = stringProp(data, "code");
|
|
2586
|
+
if (trpc !== void 0) out.trpc = trpc;
|
|
2587
|
+
return out;
|
|
2588
|
+
}
|
|
2589
|
+
/**
|
|
2590
|
+
* Is a settings read failure worth retrying, and with which budget? Only
|
|
2591
|
+
* EXPLICIT signals count: a socket error code, a tRPC "unavailable" code, or
|
|
2592
|
+
* one of the exact phrases our own transport raises. A message that merely
|
|
2593
|
+
* contains "timed out" or "unreachable" is not evidence of anything, and
|
|
2594
|
+
* `settings store not wired` is a wiring bug that retrying cannot fix.
|
|
2595
|
+
*/
|
|
2596
|
+
function classifyStoreError(err) {
|
|
2597
|
+
const message = err instanceof Error ? err.message : String(err);
|
|
2598
|
+
if (RESTART_FINGERPRINTS.some((f) => message.includes(f))) return "restart";
|
|
2599
|
+
const code = errorCode(err);
|
|
2600
|
+
if (code.node !== void 0 && TRANSPORT_CODES.has(code.node)) return "transport";
|
|
2601
|
+
if (code.trpc !== void 0 && UNAVAILABLE_TRPC_CODES.has(code.trpc)) return "transport";
|
|
2602
|
+
if (typeof err === "object" && err !== null) {
|
|
2603
|
+
if (Reflect.get(err, "retryable") === true) return "transport";
|
|
2604
|
+
const type = stringProp(err, "type");
|
|
2605
|
+
if (type !== void 0 && MOLECULER_TRANSIENT_TYPES.has(type)) return "transport";
|
|
2606
|
+
}
|
|
2607
|
+
if (TRANSPORT_PHRASES.some((f) => message.includes(f))) return "transport";
|
|
2608
|
+
return "permanent";
|
|
2609
|
+
}
|
|
2518
2610
|
/**
|
|
2519
2611
|
* Collect the keys of every field marked `perNode: true`, recursing into
|
|
2520
2612
|
* layout containers (`group` fields and `sub-tabs` tabs) the same way
|
|
@@ -6503,6 +6595,12 @@ Object.defineProperty(exports, "classifySecretWrite", {
|
|
|
6503
6595
|
return classifySecretWrite;
|
|
6504
6596
|
}
|
|
6505
6597
|
});
|
|
6598
|
+
Object.defineProperty(exports, "classifyStoreError", {
|
|
6599
|
+
enumerable: true,
|
|
6600
|
+
get: function() {
|
|
6601
|
+
return classifyStoreError;
|
|
6602
|
+
}
|
|
6603
|
+
});
|
|
6506
6604
|
Object.defineProperty(exports, "clearKnownSecrets", {
|
|
6507
6605
|
enumerable: true,
|
|
6508
6606
|
get: function() {
|
|
@@ -1530,7 +1530,6 @@ function createHandle(raw, opts) {
|
|
|
1530
1530
|
const writeAddon = (patch) => write("addon", opts.addonTree(), void 0, patch, () => readStoredAddonBlob(raw), (p) => raw.writeAddonStore(p));
|
|
1531
1531
|
const readAddonStoreResult = raw.readAddonStoreResult;
|
|
1532
1532
|
const readAddonStoreKeyResult = raw.readAddonStoreKeyResult;
|
|
1533
|
-
const readDeviceStoreBatch = raw.readDeviceStoreBatch;
|
|
1534
1533
|
const overrides = {
|
|
1535
1534
|
readAddonStore: async () => resolveRead("addon", await raw.readAddonStore()),
|
|
1536
1535
|
...readAddonStoreResult !== void 0 ? { readAddonStoreResult: async () => {
|
|
@@ -1554,12 +1553,12 @@ function createHandle(raw, opts) {
|
|
|
1554
1553
|
};
|
|
1555
1554
|
} } : {},
|
|
1556
1555
|
readDeviceStore: async (deviceId) => resolveRead(`device:${deviceId}`, await raw.readDeviceStore(deviceId)),
|
|
1557
|
-
|
|
1558
|
-
const rows = await readDeviceStoreBatch
|
|
1556
|
+
readDeviceStoreBatch: async (deviceIds) => {
|
|
1557
|
+
const rows = await raw.readDeviceStoreBatch(deviceIds);
|
|
1559
1558
|
const out = /* @__PURE__ */ new Map();
|
|
1560
1559
|
for (const [deviceId, blob] of rows) out.set(deviceId, await resolveRead(`device:${deviceId}`, blob));
|
|
1561
1560
|
return out;
|
|
1562
|
-
}
|
|
1561
|
+
},
|
|
1563
1562
|
writeAddonStore: async (patch) => {
|
|
1564
1563
|
await writeAddon(patch);
|
|
1565
1564
|
},
|
|
@@ -2403,7 +2402,7 @@ var BaseAddon = class {
|
|
|
2403
2402
|
return this._addonSecretTree;
|
|
2404
2403
|
}
|
|
2405
2404
|
deviceSecretTree() {
|
|
2406
|
-
this._deviceSecretTree ??= secretTreeFromSchema(this.deviceSettingsSchema());
|
|
2405
|
+
this._deviceSecretTree ??= mergeSecretStatePaths(secretTreeFromSchema(this.deviceSettingsSchema()), this.secretStatePaths);
|
|
2407
2406
|
return this._deviceSecretTree;
|
|
2408
2407
|
}
|
|
2409
2408
|
/**
|
|
@@ -2479,42 +2478,135 @@ var BaseAddon = class {
|
|
|
2479
2478
|
this[timerOf] = timer;
|
|
2480
2479
|
}
|
|
2481
2480
|
/**
|
|
2482
|
-
* Wrap `ctx.settings.readAddonStore()` with a
|
|
2483
|
-
*
|
|
2484
|
-
* swap, or any race where the SqliteSettingsBackend is between shutdown and
|
|
2485
|
-
* re-initialize) doesn't propagate up into `initialize()` and leave the
|
|
2481
|
+
* Wrap `ctx.settings.readAddonStore()` with a retry budget so a transient
|
|
2482
|
+
* settings-store outage doesn't propagate up into `initialize()` and leave the
|
|
2486
2483
|
* addon permanently broken.
|
|
2487
2484
|
*
|
|
2488
|
-
*
|
|
2489
|
-
*
|
|
2490
|
-
* `
|
|
2485
|
+
* Two kinds of outage, two budgets:
|
|
2486
|
+
* - the store's own restart fingerprints (`SqliteSettingsBackend not
|
|
2487
|
+
* initialized`, `provider not available`): a short budget, then the addon
|
|
2488
|
+
* falls back to `{}` (defaults) - its first successful patch rehydrates;
|
|
2489
|
+
* - a TRANSPORT failure (the hub is restarting while this runner boots:
|
|
2490
|
+
* `discovery deadline exceeded`, `parent could not route`, a refused or
|
|
2491
|
+
* timed-out connection). Since D870 a runner's settings read THROWS instead
|
|
2492
|
+
* of answering `{}`, so without a budget a hub restart ends in a respawn
|
|
2493
|
+
* loop. A long, bounded budget; only after it the error propagates - the
|
|
2494
|
+
* addon never runs on defaults for a store it could not ask.
|
|
2495
|
+
* Anything else propagates immediately so real bugs surface.
|
|
2491
2496
|
*/
|
|
2492
2497
|
async readAddonStoreWithRetry() {
|
|
2493
2498
|
const settings = this.rawSettings();
|
|
2494
2499
|
if (!settings) return {};
|
|
2495
|
-
const delaysMs = [
|
|
2496
|
-
150,
|
|
2497
|
-
350,
|
|
2498
|
-
600,
|
|
2499
|
-
900
|
|
2500
|
-
];
|
|
2501
2500
|
let lastErr;
|
|
2502
|
-
for (let attempt = 0
|
|
2501
|
+
for (let attempt = 0;; attempt++) try {
|
|
2503
2502
|
const stored = await settings.readAddonStore() ?? {};
|
|
2504
2503
|
this.settingsStoreReady = true;
|
|
2505
2504
|
return stored;
|
|
2506
2505
|
} catch (err) {
|
|
2507
2506
|
lastErr = err;
|
|
2508
|
-
const
|
|
2509
|
-
if (
|
|
2510
|
-
|
|
2511
|
-
|
|
2507
|
+
const kind = classifyStoreError(err);
|
|
2508
|
+
if (kind === "permanent") throw err;
|
|
2509
|
+
const delay = (kind === "transport" ? TRANSPORT_RETRY_DELAYS_MS : RESTART_RETRY_DELAYS_MS)[attempt];
|
|
2510
|
+
if (delay === void 0) {
|
|
2511
|
+
if (kind === "transport") throw err;
|
|
2512
|
+
break;
|
|
2513
|
+
}
|
|
2514
|
+
await new Promise((r) => setTimeout(r, delay));
|
|
2512
2515
|
}
|
|
2513
2516
|
this.settingsStoreReady = false;
|
|
2514
2517
|
this._ctx?.logger?.warn?.("readAddonStore: settings-store unavailable after retries — using defaults", { meta: { error: lastErr instanceof Error ? lastErr.message : String(lastErr) } });
|
|
2515
2518
|
return {};
|
|
2516
2519
|
}
|
|
2517
2520
|
};
|
|
2521
|
+
/** The settings store's own restart fingerprints. */
|
|
2522
|
+
var RESTART_RETRY_DELAYS_MS = [
|
|
2523
|
+
150,
|
|
2524
|
+
350,
|
|
2525
|
+
600,
|
|
2526
|
+
900
|
|
2527
|
+
];
|
|
2528
|
+
/** A hub restarting under a booting runner: ~100 s in total. */
|
|
2529
|
+
var TRANSPORT_RETRY_DELAYS_MS = [
|
|
2530
|
+
150,
|
|
2531
|
+
350,
|
|
2532
|
+
600,
|
|
2533
|
+
900,
|
|
2534
|
+
2e3,
|
|
2535
|
+
5e3,
|
|
2536
|
+
1e4,
|
|
2537
|
+
2e4,
|
|
2538
|
+
3e4,
|
|
2539
|
+
3e4
|
|
2540
|
+
];
|
|
2541
|
+
var RESTART_FINGERPRINTS = ["SqliteSettingsBackend not initialized", "provider not available"];
|
|
2542
|
+
/** Node / socket error codes of a connection that did not happen or broke. */
|
|
2543
|
+
var TRANSPORT_CODES = new Set([
|
|
2544
|
+
"ECONNREFUSED",
|
|
2545
|
+
"ECONNRESET",
|
|
2546
|
+
"ETIMEDOUT",
|
|
2547
|
+
"EPIPE",
|
|
2548
|
+
"EHOSTUNREACH",
|
|
2549
|
+
"ENETUNREACH"
|
|
2550
|
+
]);
|
|
2551
|
+
/** tRPC error codes that mean "the other side is not answering now", not "your call is wrong". */
|
|
2552
|
+
var UNAVAILABLE_TRPC_CODES = new Set([
|
|
2553
|
+
"TIMEOUT",
|
|
2554
|
+
"SERVICE_UNAVAILABLE",
|
|
2555
|
+
"BAD_GATEWAY",
|
|
2556
|
+
"GATEWAY_TIMEOUT"
|
|
2557
|
+
]);
|
|
2558
|
+
/** The exact phrases OUR transport raises when it cannot reach the hub. */
|
|
2559
|
+
var TRANSPORT_PHRASES = [
|
|
2560
|
+
"discovery deadline exceeded",
|
|
2561
|
+
"parent could not route child unowned cap call",
|
|
2562
|
+
"UDS request timed out after",
|
|
2563
|
+
"channel closed"
|
|
2564
|
+
];
|
|
2565
|
+
/** Moleculer error `type`s of a call that could not be served right now. */
|
|
2566
|
+
var MOLECULER_TRANSIENT_TYPES = new Set([
|
|
2567
|
+
"REQUEST_TIMEOUT",
|
|
2568
|
+
"SERVICE_NOT_FOUND",
|
|
2569
|
+
"SERVICE_NOT_AVAILABLE",
|
|
2570
|
+
"REQUEST_REJECTED",
|
|
2571
|
+
"BROKER_DISCONNECTED"
|
|
2572
|
+
]);
|
|
2573
|
+
function stringProp(value, key) {
|
|
2574
|
+
if (typeof value !== "object" || value === null) return void 0;
|
|
2575
|
+
const found = Reflect.get(value, key);
|
|
2576
|
+
return typeof found === "string" ? found : void 0;
|
|
2577
|
+
}
|
|
2578
|
+
/** The code an error carries: its own, its cause's, or a tRPC `data.code`. */
|
|
2579
|
+
function errorCode(err) {
|
|
2580
|
+
const out = {};
|
|
2581
|
+
const cause = typeof err === "object" && err !== null ? Reflect.get(err, "cause") : void 0;
|
|
2582
|
+
const data = typeof err === "object" && err !== null ? Reflect.get(err, "data") : void 0;
|
|
2583
|
+
const node = stringProp(err, "code") ?? stringProp(cause, "code");
|
|
2584
|
+
if (node !== void 0) out.node = node;
|
|
2585
|
+
const trpc = stringProp(data, "code");
|
|
2586
|
+
if (trpc !== void 0) out.trpc = trpc;
|
|
2587
|
+
return out;
|
|
2588
|
+
}
|
|
2589
|
+
/**
|
|
2590
|
+
* Is a settings read failure worth retrying, and with which budget? Only
|
|
2591
|
+
* EXPLICIT signals count: a socket error code, a tRPC "unavailable" code, or
|
|
2592
|
+
* one of the exact phrases our own transport raises. A message that merely
|
|
2593
|
+
* contains "timed out" or "unreachable" is not evidence of anything, and
|
|
2594
|
+
* `settings store not wired` is a wiring bug that retrying cannot fix.
|
|
2595
|
+
*/
|
|
2596
|
+
function classifyStoreError(err) {
|
|
2597
|
+
const message = err instanceof Error ? err.message : String(err);
|
|
2598
|
+
if (RESTART_FINGERPRINTS.some((f) => message.includes(f))) return "restart";
|
|
2599
|
+
const code = errorCode(err);
|
|
2600
|
+
if (code.node !== void 0 && TRANSPORT_CODES.has(code.node)) return "transport";
|
|
2601
|
+
if (code.trpc !== void 0 && UNAVAILABLE_TRPC_CODES.has(code.trpc)) return "transport";
|
|
2602
|
+
if (typeof err === "object" && err !== null) {
|
|
2603
|
+
if (Reflect.get(err, "retryable") === true) return "transport";
|
|
2604
|
+
const type = stringProp(err, "type");
|
|
2605
|
+
if (type !== void 0 && MOLECULER_TRANSIENT_TYPES.has(type)) return "transport";
|
|
2606
|
+
}
|
|
2607
|
+
if (TRANSPORT_PHRASES.some((f) => message.includes(f))) return "transport";
|
|
2608
|
+
return "permanent";
|
|
2609
|
+
}
|
|
2518
2610
|
/**
|
|
2519
2611
|
* Collect the keys of every field marked `perNode: true`, recursing into
|
|
2520
2612
|
* layout containers (`group` fields and `sub-tabs` tabs) the same way
|
|
@@ -6095,4 +6187,4 @@ function sleepCancellable(ms, signal) {
|
|
|
6095
6187
|
});
|
|
6096
6188
|
}
|
|
6097
6189
|
//#endregion
|
|
6098
|
-
export { resolveCapMount as $,
|
|
6190
|
+
export { resolveCapMount as $, normalizeAddonInitResult as $t, HF_BASE_URL as A, isSecretFieldView as An, makeSourceBrokerId as At, deviceCustomAction as B, schemaDeclaresAnyField as Bn, registerKnownSecret as Bt, createLazyTrpcSource as C, collectHydratedFieldEntries as Cn, ProfileSlotSchema as Ct, collectZodSecretPaths as D, SECRET_CLEAR as Dn, SubscribeAudioChunksInputSchema as Dt, SECRET_META as E, resolveHydratedFieldValue as En, StreamSourceSchema as Et, viewerUiCapability as F, REDACTED_SECRET as Fn, createSecretsAccess as Ft, HISTORY_DEFAULT_MIN_INTERVAL_MS as G, PEER_BYTES_STALL_MS as Gt, DEFAULT_RUNTIME_STATE_DURABILITY as H, audioChunkBytesPerSample as Hn, shortSecretRefHash as Ht, DEVICE_CHILDREN_BATCH_MAX as I, collectKeychainStoredKeys as In, MIN_SCRUBBED_LENGTH as It, event as J, DATAPLANE_SECRET_HEADER as Jt, HISTORY_UNIT_LABELS as K, PEER_BYTES_TICKET_TTL_MS as Kt, customAction as L, collectSecretConfigKeys as Ln, clearKnownSecrets as Lt, RUNTIME_DEFAULTS as M, isSecretMarkerLike as Mn, selectAssignedProfileSlots as Mt, RawStateResultSchema as N, makeSecretMarker as Nn, resolveSecretViewsIn as Nt, isZodSecret as O, classifySecretWrite as On, SubscribeAudioChunksResultSchema as Ot, deviceOpsCapability as P, toSecretFieldView as Pn, REVALIDATE_AFTER_MS as Pt, optionalMethod as Q, classifyStoreError as Qt, defineCustomActions as R, isKeychainStoredField as Rn, forgetKnownSecret as Rt, createEventBusSliceSource as S, WELL_KNOWN_TAB_MAP as Sn, ProfileRtspEntrySchema as St, createSliceHandle as T, hydrateSchema as Tn, StreamSourceEntrySchema$1 as Tt, DEVICE_SETTINGS_CONTRIBUTION_METHODS as U, expandAudioChunkToF32le as Un, PEER_BYTES_CHUNK_BYTES as Ut, adminUiCapability as V, AUDIO_CHUNK_FORMATS as Vn, scrubKnownSecrets as Vt, DEVICE_STATUS_METHOD as W, isAudioChunkFormat as Wn, PEER_BYTES_MAX_OUTSTANDING as Wt, isDeviceConfigCap as X, DisposerChain as Xt, expandCapMethods as Y, SHARE_VIEW_KINDS as Yt, method as Z, BaseAddon as Zt, readErrorI18n as _, createDurableState as _n, CamStreamKindSchema as _t, asJsonArray as a, collectSecretMarkerRefs as an, MODEL_FORMATS as at, isDeviceScopedCap as b, isEvent as bn, DecodedAudioChunkSchema as bt, asString as c, SECRET_REF_SCHEME as cn, emitDownForOwnedCaps as ct, parseJsonUnknown as d, formatSecretScope as dn, AudioChunkFormatSchema as dt, mergeSecretStatePaths as en, systemMethod as et, hfModelUrl as f, globalSecretScope as fn, AudioStreamPickSchema as ft, ErrorI18nPayloadSchema as g, normalizeNodeId as gn, CamProfileSchema as gt, ErrorCodeSchema as h, parseSecretRef as hn, CAM_PROFILE_ORDER as ht, asBoolean as i, KeychainWriteRefusedError as in, toNodeId as it, HF_REPO as j, isSecretMarker as jn, parseProfileBrokerId as jt, DEFAULT_TOKEN_EXPIRY as k, isSecretClear as kn, makeProfileBrokerId as kt, parseJsonArray as l, arrayItemFieldPath as ln, readinessKey as lt, CamstackError as m, normalizeSecretOwner as mn, BrokerStatusSchema as mt, sleepCancellable as n, secretTreeFromPaths as nn, nodePin as nt, asJsonObject as o, resolveSecretMarkers as on, ReadinessRegistry as ot, BOOT_RECOVERY_BACKOFF_MS as p, isSecretRef as pn, BrokerStatsSchema as pt, PROVIDER_PIN_FIELD as q, PeerBytesTicketSchema as qt, maskUrlCredentials as r, secretTreeFromSchema as rn, readNodePin as rt, asNumber as s, transformSecretWrite as sn, ReadinessTimeoutError as st, sleep as t, parseSecretStatePath as tn, CAP_NODE_PIN_CONTEXT_KEY as tt, parseJsonObject as u, buildSecretRef as un, scopeKey as ut, userError as v, createEvent as vn, CamStreamResolutionSchema as vt, createMirrorSource as w, collectHydratedFieldValues as wn, ProfileSlotStatusSchema as wt, createDeviceProxy as x, WELL_KNOWN_TABS as xn, FrameHandleSchema as xt, DEVICE_SCOPED_CAPS as y, emitReadiness as yn, CameraStreamSchema as yt, describeCustomActions as z, isSecretConfigField as zn, knownSecretCount as zt };
|