@camstack/system 1.2.441 → 1.2.443
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/addon-runner.js +72 -2
- package/dist/addon-runner.mjs +72 -2
- package/dist/addon-utils.js +1 -1
- package/dist/addon-utils.mjs +1 -1
- package/dist/auth/totp-manager.d.ts +46 -1
- package/dist/builtins/addon-pages-aggregator/addon-pages-aggregator.addon.js +1 -1
- package/dist/builtins/addon-pages-aggregator/addon-pages-aggregator.addon.mjs +1 -1
- package/dist/builtins/addon-widgets-aggregator/addon-widgets-aggregator.addon.js +1 -1
- package/dist/builtins/addon-widgets-aggregator/addon-widgets-aggregator.addon.mjs +1 -1
- package/dist/builtins/alerts/alerts.addon.d.ts +41 -1
- package/dist/builtins/alerts/alerts.addon.js +638 -26
- package/dist/builtins/alerts/alerts.addon.mjs +638 -26
- package/dist/builtins/alerts/critical-push.d.ts +86 -0
- package/dist/builtins/alerts/runner-alert.d.ts +71 -0
- package/dist/builtins/autotrack/index.js +1 -1
- package/dist/builtins/autotrack/index.mjs +1 -1
- package/dist/builtins/backup-orchestrator/backup-orchestrator.addon.js +2 -2
- package/dist/builtins/backup-orchestrator/backup-orchestrator.addon.mjs +2 -2
- package/dist/builtins/calendars/calendars.addon.js +1 -1
- package/dist/builtins/calendars/calendars.addon.mjs +1 -1
- package/dist/builtins/camera-grid/index.js +1 -1
- package/dist/builtins/camera-grid/index.mjs +1 -1
- package/dist/builtins/composer/composer.addon.js +2 -2
- package/dist/builtins/composer/composer.addon.mjs +2 -2
- package/dist/builtins/console-logging/index.js +1 -1
- package/dist/builtins/console-logging/index.mjs +1 -1
- package/dist/builtins/core-blocks/block-package.d.ts +4 -2
- package/dist/builtins/core-blocks/block-settings-store.d.ts +65 -19
- package/dist/builtins/core-blocks/core-blocks.addon.js +365 -38
- package/dist/builtins/core-blocks/core-blocks.addon.mjs +365 -38
- package/dist/builtins/device-manager/device-manager.addon.js +1 -1
- package/dist/builtins/device-manager/device-manager.addon.mjs +1 -1
- package/dist/builtins/hub-forwarder/index.js +1 -1
- package/dist/builtins/hub-forwarder/index.mjs +1 -1
- package/dist/builtins/keychain/index.js +3 -3
- package/dist/builtins/keychain/index.mjs +3 -3
- package/dist/builtins/liveness-monitor/liveness-monitor.addon.js +1 -1
- package/dist/builtins/liveness-monitor/liveness-monitor.addon.mjs +1 -1
- package/dist/builtins/local-auth/auth-schema.d.ts +1 -1
- package/dist/builtins/local-auth/local-auth.addon.js +226 -17
- package/dist/builtins/local-auth/local-auth.addon.mjs +226 -17
- package/dist/builtins/local-network/local-network.addon.js +2 -2
- package/dist/builtins/local-network/local-network.addon.mjs +2 -2
- package/dist/builtins/loki-logging/index.js +1 -1
- package/dist/builtins/loki-logging/index.mjs +1 -1
- package/dist/builtins/native-metrics/native-metrics.addon.js +2 -2
- package/dist/builtins/native-metrics/native-metrics.addon.mjs +2 -2
- package/dist/builtins/platform-probe/index.js +2 -2
- package/dist/builtins/platform-probe/index.mjs +2 -2
- package/dist/builtins/remote-access-orchestrator/remote-access-orchestrator.addon.js +1 -1
- package/dist/builtins/remote-access-orchestrator/remote-access-orchestrator.addon.mjs +1 -1
- package/dist/builtins/snapshot/index.js +1 -1
- package/dist/builtins/snapshot/index.mjs +1 -1
- package/dist/builtins/sqlite-storage/filesystem-storage.addon.js +1 -1
- package/dist/builtins/sqlite-storage/filesystem-storage.addon.mjs +1 -1
- package/dist/builtins/sqlite-storage/index.js +1 -1
- package/dist/builtins/sqlite-storage/index.mjs +1 -1
- package/dist/builtins/sqlite-storage/sqlite-settings.addon.js +2 -2
- package/dist/builtins/sqlite-storage/sqlite-settings.addon.mjs +2 -2
- package/dist/builtins/storage-orchestrator/storage-orchestrator.addon.js +1 -1
- package/dist/builtins/storage-orchestrator/storage-orchestrator.addon.mjs +1 -1
- package/dist/builtins/system-config/system-config.addon.js +2 -2
- package/dist/builtins/system-config/system-config.addon.mjs +2 -2
- package/dist/builtins/winston-logging/index.js +1 -1
- package/dist/builtins/winston-logging/index.mjs +1 -1
- package/dist/{composition-sources-BG-W2U0d.js → composition-sources-BUXX1e8j.js} +1 -1
- package/dist/{composition-sources-ByNISOnW.mjs → composition-sources-C8tUG2uL.mjs} +1 -1
- package/dist/{constants-DJILnUSb.mjs → constants-CGwVaAV3.mjs} +1 -1
- package/dist/{constants-UojhAJcm.js → constants-DWmm7_of.js} +1 -1
- package/dist/{device-ca-D8Ri9TVz.mjs → device-ca-DBfiJ_SB.mjs} +1 -1
- package/dist/{device-ca-196DAEZT.js → device-ca-DGayRmC0.js} +1 -1
- package/dist/{dist-BWvkuc31.mjs → dist-Bxt_S-9a.mjs} +180 -13
- package/dist/{dist-BiTCcaf-.js → dist-D9qT3jHr.js} +203 -12
- package/dist/file-host-worker.js +1 -1
- package/dist/file-host-worker.mjs +1 -1
- package/dist/{hub-mdns-ciao-DOBTq8qr.js → hub-mdns-ciao-B-wk9nzx.js} +1 -1
- package/dist/{hub-mdns-ciao-Cnd0bTB9.mjs → hub-mdns-ciao-DpPcQDg-.mjs} +1 -1
- package/dist/index.js +145 -16
- package/dist/index.mjs +140 -17
- package/dist/kernel/addon-refused-error.d.ts +30 -0
- package/dist/kernel/index.d.ts +3 -0
- package/dist/kernel/legacy-blob-guard.d.ts +6 -1
- package/dist/kernel/moleculer/process-service.d.ts +16 -1
- package/dist/kernel/moleculer/runner-refusal.d.ts +27 -0
- package/dist/{restore-archive-4ziluTU3.mjs → restore-archive-9CGgeBzD.mjs} +1 -1
- package/dist/{restore-archive-CfSSjKnA.js → restore-archive-BMNXwWWD.js} +1 -1
- package/dist/{wal-maintenance-CgZTNWAz.js → wal-maintenance-cRHR4rUY.js} +0 -0
- package/dist/{wal-maintenance-B57SAp4a.mjs → wal-maintenance-sIB32ONp.mjs} +0 -0
- package/package.json +1 -1
- package/dist/{custom-action-registry-BKmoaqG0.js → custom-action-registry-COyb49zm.js} +1 -1
- package/dist/{custom-action-registry-CyUuhATc.mjs → custom-action-registry-stpC3Zy-.mjs} +1 -1
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Critical system alerts reach the operator without depending on the addons
|
|
3
|
+
* that just failed (D877).
|
|
4
|
+
*
|
|
5
|
+
* On 2026-10-17 the hub-main alert centre recorded the crash loops, but the
|
|
6
|
+
* only PUSH path ran through notification-center, which was itself one of the
|
|
7
|
+
* refused runners: nothing arrived for four hours. hub-main is now the SOLE
|
|
8
|
+
* pusher of runner failures (`addon.runner-failed`, `addon.runner-refused`) and
|
|
9
|
+
* of a degraded boot check, straight through `notification-output` (the
|
|
10
|
+
* notifiers). There is no presence heuristic and no second sender:
|
|
11
|
+
* notification-center keeps the state-summary row of `addon-crash-loop` and
|
|
12
|
+
* pushes nothing for it.
|
|
13
|
+
*
|
|
14
|
+
* - A burst is ONE digest per target: 28 runners refusing in the same boot are
|
|
15
|
+
* one message listing them, not 28.
|
|
16
|
+
* - The message names the addon, the state and the remedy line - never raw
|
|
17
|
+
* internal error text.
|
|
18
|
+
* - Delivery is a durable fact on each alert (`metadata.push`), tracked PER
|
|
19
|
+
* TARGET: a retry sends only to the targets that did not get it, and a state
|
|
20
|
+
* already delivered to every target is never sent again. A push that could not
|
|
21
|
+
* be sent stays `pending` and is retried when the notifiers (or
|
|
22
|
+
* notification-center) start - event plus reconcile (D11). If the notifiers
|
|
23
|
+
* are down, the alert and the boot-check status remain the record.
|
|
24
|
+
*/
|
|
25
|
+
export interface PushState {
|
|
26
|
+
readonly state: "pending" | "delivered" | "disabled";
|
|
27
|
+
/** What was pushed: the finding's episode + cause. A new key is a new push. */
|
|
28
|
+
readonly key: string;
|
|
29
|
+
readonly at?: number;
|
|
30
|
+
readonly attempts: number;
|
|
31
|
+
readonly lastError?: string;
|
|
32
|
+
/** Targets that already got this key's message. */
|
|
33
|
+
readonly sentTo?: readonly string[];
|
|
34
|
+
}
|
|
35
|
+
/** The slice of a notifier target the policy reads. */
|
|
36
|
+
export interface PushTarget {
|
|
37
|
+
readonly id: string;
|
|
38
|
+
readonly addonId: string;
|
|
39
|
+
readonly enabled: boolean;
|
|
40
|
+
/** A personal target carries its owner; an operator-level one does not. */
|
|
41
|
+
readonly ownerUserId?: string;
|
|
42
|
+
}
|
|
43
|
+
export interface PushMessage {
|
|
44
|
+
readonly title: string;
|
|
45
|
+
readonly body: string;
|
|
46
|
+
}
|
|
47
|
+
export interface CriticalPushPorts {
|
|
48
|
+
/** Throws when the notifiers cannot be asked. */
|
|
49
|
+
readonly listTargets: () => Promise<readonly PushTarget[]>;
|
|
50
|
+
readonly send: (target: PushTarget, message: PushMessage) => Promise<{
|
|
51
|
+
readonly success: boolean;
|
|
52
|
+
readonly error?: string;
|
|
53
|
+
}>;
|
|
54
|
+
}
|
|
55
|
+
export interface PushPolicy {
|
|
56
|
+
readonly enabled: boolean;
|
|
57
|
+
/** Explicit target ids; empty = every enabled operator-level (not personal) target. */
|
|
58
|
+
readonly targetIds: readonly string[];
|
|
59
|
+
}
|
|
60
|
+
/** Alert categories that are critical system findings. */
|
|
61
|
+
export declare const CRITICAL_CATEGORIES: ReadonlySet<string>;
|
|
62
|
+
export declare function isPushState(value: unknown): value is PushState;
|
|
63
|
+
export declare function selectPushTargets(targets: readonly PushTarget[], policy: PushPolicy): readonly PushTarget[];
|
|
64
|
+
/** One critical finding waiting for its push. */
|
|
65
|
+
export interface CriticalItem {
|
|
66
|
+
readonly alertId: string;
|
|
67
|
+
readonly key: string;
|
|
68
|
+
readonly title: string;
|
|
69
|
+
/** ONE line: addon id, state, remedy. Never raw internal error text. */
|
|
70
|
+
readonly line: string;
|
|
71
|
+
readonly previous: PushState | null;
|
|
72
|
+
}
|
|
73
|
+
/** The one message a target gets for a set of findings. */
|
|
74
|
+
export declare function composeDigest(items: readonly CriticalItem[]): PushMessage;
|
|
75
|
+
export interface DeliverDigestInput {
|
|
76
|
+
readonly items: readonly CriticalItem[];
|
|
77
|
+
readonly policy: PushPolicy;
|
|
78
|
+
readonly ports: CriticalPushPorts;
|
|
79
|
+
readonly now: number;
|
|
80
|
+
}
|
|
81
|
+
/**
|
|
82
|
+
* Push every item that still needs it, as ONE message per target. Returns the new
|
|
83
|
+
* state of each item whose state changed (an item already delivered/disabled for
|
|
84
|
+
* its key is absent from the result).
|
|
85
|
+
*/
|
|
86
|
+
export declare function deliverDigest(input: DeliverDigestInput): Promise<ReadonlyMap<string, PushState>>;
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* ONE alert per runner (D877).
|
|
3
|
+
*
|
|
4
|
+
* A runner that dies produces a burst: `process.crashed` per exit,
|
|
5
|
+
* `addon.crashed` per hosted addon, then `addon.runner-failed` when the D6
|
|
6
|
+
* breaker gives up (or `addon.runner-refused` for a typed Init refusal). On
|
|
7
|
+
* 2026-10-17 28 runners made 28 "Addon crash loop" + 140 "Process crashed" +
|
|
8
|
+
* 34 "Addon crashed" alerts in one minute - the alerts ring (500) was a third
|
|
9
|
+
* full and the one alert that mattered was 1 of 202.
|
|
10
|
+
*
|
|
11
|
+
* Here the burst folds into ONE record per `(node, runner)` that updates its
|
|
12
|
+
* count and state. `refused` and `failed` are TERMINAL markers: a later plain
|
|
13
|
+
* crash bumps the count but never downgrades them. A dismissed record starts
|
|
14
|
+
* a fresh one.
|
|
15
|
+
*/
|
|
16
|
+
import type { AlertSeverity } from "@camstack/types";
|
|
17
|
+
export type RunnerAlertState = "crashed" | "failed" | "refused";
|
|
18
|
+
export interface RunnerAlertRecord {
|
|
19
|
+
readonly nodeId: string;
|
|
20
|
+
readonly runnerId: string;
|
|
21
|
+
readonly state: RunnerAlertState;
|
|
22
|
+
/** When this EPISODE began (ms). A runner that recovered and fails again opens a new one. */
|
|
23
|
+
readonly since: number;
|
|
24
|
+
/** Events folded into this record. */
|
|
25
|
+
readonly count: number;
|
|
26
|
+
readonly addonIds: readonly string[];
|
|
27
|
+
/** Last error text a plain crash carried. */
|
|
28
|
+
readonly lastError?: string;
|
|
29
|
+
/** Refusal: the addon's own words, and what the operator does. */
|
|
30
|
+
readonly reason?: string;
|
|
31
|
+
readonly remedy?: string;
|
|
32
|
+
/** Breaker: crashes inside the window. */
|
|
33
|
+
readonly crashesInWindow?: number;
|
|
34
|
+
}
|
|
35
|
+
export type RunnerAlertCategory = "process.crashed" | "addon.crashed" | "addon.runner-failed" | "addon.runner-refused";
|
|
36
|
+
export declare const RUNNER_ALERT_CATEGORIES: readonly RunnerAlertCategory[];
|
|
37
|
+
export declare function isRunnerAlertCategory(category: string): category is RunnerAlertCategory;
|
|
38
|
+
/** Stable alert id of a runner on a node. */
|
|
39
|
+
export declare function runnerAlertId(nodeId: string, runnerId: string): string;
|
|
40
|
+
/** Which runner an event is about; `null` when it names none. */
|
|
41
|
+
export declare function runnerKeyOf(category: RunnerAlertCategory, data: Record<string, unknown>, source: {
|
|
42
|
+
readonly id?: string;
|
|
43
|
+
readonly nodeId?: string;
|
|
44
|
+
} | undefined): {
|
|
45
|
+
readonly nodeId: string;
|
|
46
|
+
readonly runnerId: string;
|
|
47
|
+
} | null;
|
|
48
|
+
/** Fold one event into the runner's record. */
|
|
49
|
+
export declare function foldRunnerEvent(previous: RunnerAlertRecord | null, category: RunnerAlertCategory, data: Record<string, unknown>, key: {
|
|
50
|
+
readonly nodeId: string;
|
|
51
|
+
readonly runnerId: string;
|
|
52
|
+
}, now: number): RunnerAlertRecord;
|
|
53
|
+
export interface RenderedRunnerAlert {
|
|
54
|
+
readonly severity: AlertSeverity;
|
|
55
|
+
readonly title: string;
|
|
56
|
+
readonly message: string;
|
|
57
|
+
}
|
|
58
|
+
export declare function renderRunnerAlert(record: RunnerAlertRecord): RenderedRunnerAlert;
|
|
59
|
+
/** Is the record in a state an operator must act on (terminal)? */
|
|
60
|
+
export declare function isTerminalRunnerState(state: RunnerAlertState): boolean;
|
|
61
|
+
/**
|
|
62
|
+
* The push key of a record: its episode and its cause. The same refusal of the
|
|
63
|
+
* same episode is never pushed twice; a refusal with another reason, a breaker
|
|
64
|
+
* trip, or any failure after a recovery (a new episode) is a new push.
|
|
65
|
+
*/
|
|
66
|
+
export declare function runnerPushKey(record: RunnerAlertRecord): string;
|
|
67
|
+
/**
|
|
68
|
+
* The one line a push carries: runner, state and the remedy. Deliberately NOT
|
|
69
|
+
* the raw reason or error text - those stay on the alert.
|
|
70
|
+
*/
|
|
71
|
+
export declare function runnerPushLine(record: RunnerAlertRecord): string;
|
|
@@ -3,7 +3,7 @@ Object.defineProperties(exports, {
|
|
|
3
3
|
[Symbol.toStringTag]: { value: "Module" }
|
|
4
4
|
});
|
|
5
5
|
require("../../chunk-Cek0wNdY.js");
|
|
6
|
-
const require_dist = require("../../dist-
|
|
6
|
+
const require_dist = require("../../dist-D9qT3jHr.js");
|
|
7
7
|
//#region src/builtins/autotrack/autotrack-config.ts
|
|
8
8
|
var DEFAULT_AUTOTRACK_LOOP_CONFIG = {
|
|
9
9
|
deadZoneFraction: .5,
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Ar as errMsg,
|
|
1
|
+
import { Ar as errMsg, Ei as EventCategory, M as FIRST_LEVEL_MACRO_CLASSES, Pn as ptzAutotrackCapability, jr as BaseAddon, ri as isEvent, ut as bareAddonId } from "../../dist-Bxt_S-9a.mjs";
|
|
2
2
|
//#region src/builtins/autotrack/autotrack-config.ts
|
|
3
3
|
var DEFAULT_AUTOTRACK_LOOP_CONFIG = {
|
|
4
4
|
deadZoneFraction: .5,
|
|
@@ -3,8 +3,8 @@ Object.defineProperties(exports, {
|
|
|
3
3
|
[Symbol.toStringTag]: { value: "Module" }
|
|
4
4
|
});
|
|
5
5
|
const require_chunk = require("../../chunk-Cek0wNdY.js");
|
|
6
|
-
const require_dist = require("../../dist-
|
|
7
|
-
const require_restore_archive = require("../../restore-archive-
|
|
6
|
+
const require_dist = require("../../dist-D9qT3jHr.js");
|
|
7
|
+
const require_restore_archive = require("../../restore-archive-BMNXwWWD.js");
|
|
8
8
|
let node_crypto = require("node:crypto");
|
|
9
9
|
let node_fs_promises = require("node:fs/promises");
|
|
10
10
|
node_fs_promises = require_chunk.__toESM(node_fs_promises);
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { a as BackupSnapshotRefusedError, d as ENCRYPTED_BACKUP_SUFFIX, f as generateBackupKeyPair, i as BackupCancelledError, l as BackupKeyFormatError, m as parseBackupSecretKey, n as precheckRestoreKey, o as DEFAULT_BACKUP_DATABASES, p as parseBackupPublicKey, r as prepareRestoreArchive, s as SystemBackupService } from "../../restore-archive-
|
|
1
|
+
import { Ei as EventCategory, Si as toNodeId, bn as mayWriteToLocation, jr as BaseAddon, lt as backupCapability, rr as storageOccupancyCapability, ui as nodePin } from "../../dist-Bxt_S-9a.mjs";
|
|
2
|
+
import { a as BackupSnapshotRefusedError, d as ENCRYPTED_BACKUP_SUFFIX, f as generateBackupKeyPair, i as BackupCancelledError, l as BackupKeyFormatError, m as parseBackupSecretKey, n as precheckRestoreKey, o as DEFAULT_BACKUP_DATABASES, p as parseBackupPublicKey, r as prepareRestoreArchive, s as SystemBackupService } from "../../restore-archive-9CGgeBzD.mjs";
|
|
3
3
|
import { randomUUID } from "node:crypto";
|
|
4
4
|
import * as fsp from "node:fs/promises";
|
|
5
5
|
import * as path$1 from "node:path";
|
|
@@ -3,7 +3,7 @@ Object.defineProperties(exports, {
|
|
|
3
3
|
[Symbol.toStringTag]: { value: "Module" }
|
|
4
4
|
});
|
|
5
5
|
require("../../chunk-Cek0wNdY.js");
|
|
6
|
-
const require_dist = require("../../dist-
|
|
6
|
+
const require_dist = require("../../dist-D9qT3jHr.js");
|
|
7
7
|
const require_settle_sources = require("../../settle-sources-Bhsy57y-.js");
|
|
8
8
|
let zod = require("zod");
|
|
9
9
|
//#region src/builtins/calendars/calendar-color.ts
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { g as CalendarPreferencesSchema, gt as calendarsCapability, jr as BaseAddon } from "../../dist-
|
|
1
|
+
import { g as CalendarPreferencesSchema, gt as calendarsCapability, jr as BaseAddon } from "../../dist-Bxt_S-9a.mjs";
|
|
2
2
|
import { t as settleSourcesWithTimeout } from "../../settle-sources-CDtNC8ub.mjs";
|
|
3
3
|
import { z } from "zod";
|
|
4
4
|
//#region src/builtins/calendars/calendar-color.ts
|
|
@@ -3,7 +3,7 @@ Object.defineProperties(exports, {
|
|
|
3
3
|
[Symbol.toStringTag]: { value: "Module" }
|
|
4
4
|
});
|
|
5
5
|
require("../../chunk-Cek0wNdY.js");
|
|
6
|
-
const require_dist = require("../../dist-
|
|
6
|
+
const require_dist = require("../../dist-D9qT3jHr.js");
|
|
7
7
|
let zod = require("zod");
|
|
8
8
|
let _camstack_types_node = require("@camstack/types/node");
|
|
9
9
|
let node_path = require("node:path");
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { A as DeclaredDevices, Ar as errMsg, Dr as DeviceFeature, H as MOTION_CLOSE_AFTER_MS,
|
|
1
|
+
import { A as DeclaredDevices, Ar as errMsg, Dr as DeviceFeature, Ei as EventCategory, H as MOTION_CLOSE_AFTER_MS, Jr as createEvent, Qn as snapshotCapability, _t as cameraGridLayoutCapability, ar as streamCatalogCapability, gr as buildFfmpegArgs, jr as BaseAddon, jt as declarationOwnerNodeId, kr as DeviceType, o as BaseDevice, ti as hydrateSchema, w as DERIVED_CAMERA_SILENCED_CAP_NAMES, wn as motionCapability, xn as memoizePinnedFfmpeg } from "../../dist-Bxt_S-9a.mjs";
|
|
2
2
|
import { z } from "zod";
|
|
3
3
|
import { FfmpegProcess } from "@camstack/types/node";
|
|
4
4
|
import { join } from "node:path";
|
|
@@ -3,8 +3,8 @@ Object.defineProperties(exports, {
|
|
|
3
3
|
[Symbol.toStringTag]: { value: "Module" }
|
|
4
4
|
});
|
|
5
5
|
require("../../chunk-Cek0wNdY.js");
|
|
6
|
-
const require_dist = require("../../dist-
|
|
7
|
-
const require_composition_sources = require("../../composition-sources-
|
|
6
|
+
const require_dist = require("../../dist-D9qT3jHr.js");
|
|
7
|
+
const require_composition_sources = require("../../composition-sources-BUXX1e8j.js");
|
|
8
8
|
let zod = require("zod");
|
|
9
9
|
//#region src/builtins/shared/device-state-changed.ts
|
|
10
10
|
/** Structural narrowing helper for untrusted bus payloads. */
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { A as DeclaredDevices, Ar as errMsg, Cr as compositionSourceKey, Er as toExpressionValue,
|
|
2
|
-
import { n as normalizedNativeOwner } from "../../composition-sources-
|
|
1
|
+
import { A as DeclaredDevices, Ar as errMsg, Cr as compositionSourceKey, Ei as EventCategory, Er as toExpressionValue, Jr as createEvent, Sr as compositionSliceKey, Tr as disarmRoseMemory, Wt as evaluateCompositionField, _r as cloneStatefulExpressionMemory, br as compositionFeatureEnabled, bt as composerCapability, f as COMPOSED_ITEM_FIXED_FIELDS, ft as buildCapabilityLookup, hr as COMPOSER_ADDON_ID, jn as planComposition, jr as BaseAddon, kr as DeviceType, o as BaseDevice, qt as expressionContainsBuiltinCall, r as ALL_CAPABILITY_DEFINITIONS, vr as composedDeviceRef, wr as createStatefulExpressionMemory, xr as compositionItemFieldPath, xt as compositionFieldKey, yr as composedDeviceStableId } from "../../dist-Bxt_S-9a.mjs";
|
|
2
|
+
import { n as normalizedNativeOwner } from "../../composition-sources-C8tUG2uL.mjs";
|
|
3
3
|
import { z } from "zod";
|
|
4
4
|
//#region src/builtins/shared/device-state-changed.ts
|
|
5
5
|
/** Structural narrowing helper for untrusted bus payloads. */
|
|
@@ -3,7 +3,7 @@ Object.defineProperties(exports, {
|
|
|
3
3
|
[Symbol.toStringTag]: { value: "Module" }
|
|
4
4
|
});
|
|
5
5
|
require("../../chunk-Cek0wNdY.js");
|
|
6
|
-
const require_dist = require("../../dist-
|
|
6
|
+
const require_dist = require("../../dist-D9qT3jHr.js");
|
|
7
7
|
const require_formatter = require("../../formatter-DqAKDlvN.js");
|
|
8
8
|
//#region src/builtins/console-logging/console-destination.ts
|
|
9
9
|
var LEVEL_RANK = {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { gn as logDestinationCapability, jr as BaseAddon } from "../../dist-
|
|
1
|
+
import { gn as logDestinationCapability, jr as BaseAddon } from "../../dist-Bxt_S-9a.mjs";
|
|
2
2
|
import { t as formatLogLine } from "../../formatter-B7qW8bPJ.mjs";
|
|
3
3
|
//#region src/builtins/console-logging/console-destination.ts
|
|
4
4
|
var LEVEL_RANK = {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { coreBlockAddonId, coreBlockIdFromAddonId } from "@camstack/types";
|
|
1
|
+
import { type ConfigUISchema, coreBlockAddonId, coreBlockIdFromAddonId } from "@camstack/types";
|
|
2
2
|
/**
|
|
3
3
|
* The runner id lives on the CAPABILITY, not here.
|
|
4
4
|
*
|
|
@@ -24,6 +24,8 @@ export interface MaterializeBlockInput {
|
|
|
24
24
|
* loads. Absent for a legacy single-file materialize.
|
|
25
25
|
*/
|
|
26
26
|
readonly files?: Readonly<Record<string, string>>;
|
|
27
|
+
/** The block's settings form: its secret fields are keychain-backed at runtime (D880). */
|
|
28
|
+
readonly settingsSchema?: ConfigUISchema | undefined;
|
|
27
29
|
}
|
|
28
30
|
export interface MaterializedBlock {
|
|
29
31
|
/** What `$process.spawnRunner` gets as `addonDir` — the package root. */
|
|
@@ -32,7 +34,7 @@ export interface MaterializedBlock {
|
|
|
32
34
|
}
|
|
33
35
|
/** Build the wrapper for one block. Exported for the test that asserts the
|
|
34
36
|
* generated source actually carries the block's identity. */
|
|
35
|
-
export declare function renderBlockWrapper(blockId: string, blockName: string): string;
|
|
37
|
+
export declare function renderBlockWrapper(blockId: string, blockName: string, settingsSchema?: ConfigUISchema | undefined): string;
|
|
36
38
|
/** The package manifest the addon runner reads to find the entry point. */
|
|
37
39
|
export declare function renderBlockManifest(blockId: string, blockName: string): string;
|
|
38
40
|
/**
|
|
@@ -1,21 +1,8 @@
|
|
|
1
|
-
|
|
2
|
-
* Preference values for core blocks.
|
|
3
|
-
*
|
|
4
|
-
* Schema lives on the block record (`settingsSchema`, extracted from the
|
|
5
|
-
* compiled entry's named export or set by the editor). Values live HERE —
|
|
6
|
-
* one JSON blob per blockId — so a settings patch never rewrites the
|
|
7
|
-
* operator's source, and so a block that has not yet declared a schema still
|
|
8
|
-
* keeps any values the UI already wrote.
|
|
9
|
-
*
|
|
10
|
-
* On every patch the same values are mirrored into the block addon's
|
|
11
|
-
* `addon-settings` rows so a running script reads them the same way any
|
|
12
|
-
* addon does: `ctx.settings.readAddonStore()`.
|
|
13
|
-
*/
|
|
14
|
-
import type { SettingsStoreClient } from "@camstack/types";
|
|
1
|
+
import { type ConfigUISchema, type RawSecretMigrationReport, type SecretsAccess, type SettingsStoreClient } from "@camstack/types";
|
|
15
2
|
/**
|
|
16
3
|
* @durable class=config owner=core-blocks
|
|
17
|
-
* write="
|
|
18
|
-
* retention="
|
|
4
|
+
* write="NOTHING since D880 - the values live in the block addon's `addon-settings` rows. Only the one-shot `migrateRawSecrets` reads it, then deletes each row."
|
|
5
|
+
* retention="legacy: every row is deleted by the verified operator migration; the declaration goes with it once every hub ran it."
|
|
19
6
|
*/
|
|
20
7
|
export declare const CORE_BLOCK_SETTINGS_COLLECTION = "core-blocks:settings";
|
|
21
8
|
export declare const CORE_BLOCK_SETTINGS_COLUMNS: readonly [{
|
|
@@ -29,15 +16,74 @@ export declare const CORE_BLOCK_SETTINGS_COLUMNS: readonly [{
|
|
|
29
16
|
readonly notNull: true;
|
|
30
17
|
readonly defaultValue: "{}";
|
|
31
18
|
}];
|
|
19
|
+
/** The keychain door for a given owner, or null when this process has none. */
|
|
20
|
+
export type SecretsForOwner = (owner: string) => SecretsAccess | null;
|
|
32
21
|
export interface BlockSettingsStoreDeps {
|
|
33
22
|
readonly store: SettingsStoreClient;
|
|
23
|
+
readonly keychainFor: SecretsForOwner;
|
|
24
|
+
/** Told about keychain refs a write dropped but could not delete (they are now orphans). */
|
|
25
|
+
readonly onOrphaned?: (blockId: string, refs: readonly string[]) => void;
|
|
26
|
+
}
|
|
27
|
+
/** The block declares a secret, but this process has no keychain door to put it in. */
|
|
28
|
+
export declare class BlockSecretsUnavailableError extends Error {
|
|
29
|
+
readonly blockId: string;
|
|
30
|
+
constructor(blockId: string);
|
|
31
|
+
}
|
|
32
|
+
/** The block addon's settings rows could not be read: never answered as "empty". */
|
|
33
|
+
export declare class BlockSettingsUnreadableError extends Error {
|
|
34
|
+
readonly blockId: string;
|
|
35
|
+
constructor(blockId: string, reason: string);
|
|
36
|
+
}
|
|
37
|
+
/** One block as the migration sees it. */
|
|
38
|
+
export interface BlockSecretsSubject {
|
|
39
|
+
readonly id: string;
|
|
40
|
+
readonly settingsSchema?: ConfigUISchema | undefined;
|
|
34
41
|
}
|
|
35
42
|
export declare class BlockSettingsStore {
|
|
36
43
|
private readonly store;
|
|
44
|
+
private readonly keychainFor;
|
|
45
|
+
private readonly onOrphaned;
|
|
37
46
|
constructor(deps: BlockSettingsStoreDeps);
|
|
47
|
+
/** Declares the LEGACY collection, so the migration can read it. */
|
|
38
48
|
static declare(store: SettingsStoreClient): Promise<void>;
|
|
39
|
-
|
|
40
|
-
|
|
49
|
+
private rows;
|
|
50
|
+
/**
|
|
51
|
+
* The block's stored values - markers, NOT resolved. For the admin form
|
|
52
|
+
* (`hydrateSchema` turns a marker into a "set" view) and as the `stored`
|
|
53
|
+
* side of a write. Absent answers `{}`; an unreadable store THROWS.
|
|
54
|
+
*/
|
|
55
|
+
readStored(blockId: string): Promise<Record<string, unknown>>;
|
|
56
|
+
/**
|
|
57
|
+
* Patch the block's values. Secret fields (by the schema TYPE) go to the
|
|
58
|
+
* keychain first and the row gets the marker; a keychain that cannot take
|
|
59
|
+
* them refuses the whole patch.
|
|
60
|
+
*/
|
|
61
|
+
mergeValues(blockId: string, schema: ConfigUISchema | undefined, patch: Record<string, unknown>): Promise<void>;
|
|
62
|
+
/** The block is gone: its rows, its keychain values and the legacy blob go with it. */
|
|
41
63
|
delete(blockId: string): Promise<void>;
|
|
42
|
-
|
|
64
|
+
/**
|
|
65
|
+
* D880: move every plaintext secret a block's `settingsSchema` declares into
|
|
66
|
+
* the keychain, and delete the legacy `core-blocks:settings` blob.
|
|
67
|
+
*
|
|
68
|
+
* Per block: gather the values (the addon-settings rows win; a key only the
|
|
69
|
+
* blob holds is carried over), put each secret, READ IT BACK and compare,
|
|
70
|
+
* and only then write the marker. The legacy row is deleted only after the
|
|
71
|
+
* block's rows hold every key it had and every secret resolves. A block that
|
|
72
|
+
* fails stays exactly as it was. Dry run unless `apply`; idempotent; counts
|
|
73
|
+
* only - never a value, a ref or a block id.
|
|
74
|
+
*/
|
|
75
|
+
migrateRawSecrets(blocks: readonly BlockSecretsSubject[], apply: boolean): Promise<RawSecretMigrationReport>;
|
|
76
|
+
/**
|
|
77
|
+
* The keys of the legacy blob that may be copied into the block's rows: not in
|
|
78
|
+
* the rows already, not a secret the tree moves, not a credential-named value no
|
|
79
|
+
* schema declares (flagged instead), and not a marker that points at another
|
|
80
|
+
* owner's secret (counted as `foreign`, never copied).
|
|
81
|
+
*/
|
|
82
|
+
private carryable;
|
|
83
|
+
private dropLegacy;
|
|
84
|
+
/** put -> read back -> compare -> only then the marker rows. */
|
|
85
|
+
private moveBlock;
|
|
86
|
+
/** Remove the values a failed move put, never one the row already pointed at. */
|
|
87
|
+
private discard;
|
|
88
|
+
private report;
|
|
43
89
|
}
|