@camstack/server 1.2.788 → 1.2.790
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +14 -0
- package/dist/agent/agent-child-manifest.js +39 -0
- package/dist/agent/agent-hub-registration.js +11 -1
- package/dist/agent/forward-to-hub.js +43 -0
- package/dist/agent/main.js +31 -81
- package/dist/agent/stale-addon-gate.js +70 -34
- package/dist/api/trpc/generated-cap-mounts.js +1 -6
- package/dist/api/trpc/generated-cap-routers.js +1221 -1417
- package/dist/core/addon/addon-registry.service.js +25 -33
- package/dist/core/addon/boot-health-snapshot.js +0 -28
- package/dist/core/addon/{hub-spawn-gate.js → hub-addon-support.js} +12 -35
- package/dist/core/moleculer/moleculer.service.js +2 -13
- package/dist/core/moleculer/runner-hosted-on-node.js +23 -0
- package/dist/core/updates/required-addon-update.js +1 -1
- package/package.json +23 -58
- package/system/dist/addon-utils.mjs +1 -1
- package/system/dist/{agent-https-jJDe-XNl.js → agent-https-BmXXKQAA.js} +1 -1
- package/system/dist/{agent-https-szf2FU49.mjs → agent-https-ByceQLwr.mjs} +1 -1
- package/system/dist/builtins/addon-pages-aggregator/addon-pages-aggregator.addon.js +1 -1
- package/system/dist/builtins/addon-pages-aggregator/addon-pages-aggregator.addon.mjs +4 -4
- package/system/dist/builtins/addon-widgets-aggregator/addon-widgets-aggregator.addon.js +1 -1
- package/system/dist/builtins/addon-widgets-aggregator/addon-widgets-aggregator.addon.mjs +5 -5
- package/system/dist/builtins/alerts/alerts.addon.d.ts +8 -0
- package/system/dist/builtins/alerts/alerts.addon.js +72 -1
- package/system/dist/builtins/alerts/alerts.addon.mjs +74 -3
- package/system/dist/builtins/autotrack/index.js +1 -1
- package/system/dist/builtins/autotrack/index.mjs +1 -1
- package/system/dist/builtins/backup-orchestrator/backup-orchestrator.addon.js +2 -2
- package/system/dist/builtins/backup-orchestrator/backup-orchestrator.addon.mjs +5 -5
- package/system/dist/builtins/calendars/calendars.addon.js +1 -1
- package/system/dist/builtins/calendars/calendars.addon.mjs +1 -1
- package/system/dist/builtins/camera-grid/index.js +1 -1
- package/system/dist/builtins/camera-grid/index.mjs +1 -1
- package/system/dist/builtins/composer/composer.addon.js +3 -3
- package/system/dist/builtins/composer/composer.addon.mjs +3 -3
- package/system/dist/builtins/console-logging/index.js +1 -1
- package/system/dist/builtins/console-logging/index.mjs +1 -1
- package/system/dist/builtins/core-blocks/core-blocks.addon.js +11 -5
- package/system/dist/builtins/core-blocks/core-blocks.addon.mjs +11 -5
- package/system/dist/builtins/device-history/device-history.addon.js +2 -2
- package/system/dist/builtins/device-history/device-history.addon.mjs +2 -2
- package/system/dist/builtins/device-manager/device-manager.addon.js +1 -1
- package/system/dist/builtins/device-manager/device-manager.addon.mjs +1 -1
- package/system/dist/builtins/hub-forwarder/index.js +1 -1
- package/system/dist/builtins/hub-forwarder/index.mjs +1 -1
- package/system/dist/builtins/keychain/index.js +4 -4
- package/system/dist/builtins/keychain/index.mjs +4 -4
- package/system/dist/builtins/liveness-monitor/liveness-monitor.addon.js +1 -1
- package/system/dist/builtins/liveness-monitor/liveness-monitor.addon.mjs +1 -1
- package/system/dist/builtins/local-auth/local-auth.addon.js +2 -2
- package/system/dist/builtins/local-auth/local-auth.addon.mjs +5 -5
- package/system/dist/builtins/local-network/local-network.addon.js +2 -2
- package/system/dist/builtins/local-network/local-network.addon.mjs +2 -2
- package/system/dist/builtins/loki-logging/index.js +1 -1
- package/system/dist/builtins/loki-logging/index.mjs +1 -1
- package/system/dist/builtins/native-metrics/native-metrics.addon.js +1 -1
- package/system/dist/builtins/native-metrics/native-metrics.addon.mjs +10 -10
- package/system/dist/builtins/platform-probe/index.js +1 -1
- package/system/dist/builtins/platform-probe/index.mjs +10 -10
- package/system/dist/builtins/record-entries/index.js +1 -1
- package/system/dist/builtins/record-entries/index.mjs +1 -1
- package/system/dist/builtins/remote-access-orchestrator/remote-access-orchestrator.addon.js +1 -1
- package/system/dist/builtins/remote-access-orchestrator/remote-access-orchestrator.addon.mjs +1 -1
- package/system/dist/builtins/snapshot/index.js +1 -1
- package/system/dist/builtins/snapshot/index.mjs +1 -1
- package/system/dist/builtins/sqlite-storage/filesystem-storage.addon.js +1 -1
- package/system/dist/builtins/sqlite-storage/filesystem-storage.addon.mjs +20 -20
- package/system/dist/builtins/sqlite-storage/index.js +1 -1
- package/system/dist/builtins/sqlite-storage/index.mjs +1 -1
- package/system/dist/builtins/sqlite-storage/sqlite-settings.addon.js +3 -3
- package/system/dist/builtins/sqlite-storage/sqlite-settings.addon.mjs +3 -3
- package/system/dist/builtins/storage-orchestrator/access-guards.d.ts +1 -1
- package/system/dist/builtins/storage-orchestrator/custom-actions.d.ts +11 -0
- package/system/dist/builtins/storage-orchestrator/index.d.ts +1 -0
- package/system/dist/builtins/storage-orchestrator/index.js +2 -0
- package/system/dist/builtins/storage-orchestrator/index.mjs +2 -2
- package/system/dist/builtins/storage-orchestrator/location-instances.d.ts +72 -0
- package/system/dist/builtins/storage-orchestrator/location-repoint-move.d.ts +1 -1
- package/system/dist/builtins/storage-orchestrator/location-secret-refs.d.ts +26 -0
- package/system/dist/builtins/storage-orchestrator/location-store.d.ts +28 -2
- package/system/dist/builtins/storage-orchestrator/migrations/index.d.ts +9 -2
- package/system/dist/builtins/storage-orchestrator/migrations/legacy-location-secret-refs.d.ts +13 -0
- package/system/dist/builtins/storage-orchestrator/migrations/location-secret-ports.d.ts +15 -0
- package/system/dist/builtins/storage-orchestrator/migrations/location-secrets-to-record.d.ts +57 -0
- package/system/dist/builtins/storage-orchestrator/provider-discovery.d.ts +10 -13
- package/system/dist/builtins/storage-orchestrator/record-kinds.d.ts +6 -0
- package/system/dist/builtins/storage-orchestrator/storage-orchestrator.addon.d.ts +39 -8
- package/system/dist/builtins/storage-orchestrator/storage-orchestrator.addon.js +954 -131
- package/system/dist/builtins/storage-orchestrator/storage-orchestrator.addon.mjs +954 -132
- package/system/dist/builtins/storage-orchestrator/storage-orchestrator.service.d.ts +8 -0
- package/system/dist/builtins/system-config/system-config.addon.js +3 -3
- package/system/dist/builtins/system-config/system-config.addon.mjs +115 -115
- package/system/dist/builtins/winston-logging/index.js +112 -3
- package/system/dist/builtins/winston-logging/index.mjs +112 -3
- package/system/dist/builtins/winston-logging/migrations/index.d.ts +8 -0
- package/system/dist/builtins/winston-logging/migrations/node-fields.d.ts +43 -0
- package/system/dist/builtins/winston-logging/winston-logging.addon.d.ts +10 -2
- package/system/dist/{capture-engine-DNHgjQot.js → capture-engine-BHj1fNYC.js} +1 -1
- package/system/dist/{capture-engine-BsKY_3xa.mjs → capture-engine-D9n4KDaN.mjs} +1 -1
- package/system/dist/{composition-sources-BgO0GQYW.js → composition-sources-BGgIuuvd.js} +1 -1
- package/system/dist/{composition-sources-BRdGsbVT.mjs → composition-sources-wI4qWTz2.mjs} +1 -1
- package/system/dist/{constants-CQeMrR4f.mjs → constants-DHqkxbYk.mjs} +1 -1
- package/system/dist/{constants-C3jGKQSQ.js → constants-DNdriMRD.js} +1 -1
- package/system/dist/{coral-accelerators-BW3OcrLD.mjs → coral-accelerators-DBlgWB8k.mjs} +6 -6
- package/system/dist/{custom-action-registry-N7flBDwT.mjs → custom-action-registry-B9zFBNVa.mjs} +37 -37
- package/system/dist/{device-ca-D3y6wGmn.js → device-ca-C2RzT1VT.js} +1 -1
- package/system/dist/{device-ca-ByVi5eUC.mjs → device-ca-gr5eE3h5.mjs} +1 -1
- package/system/dist/{dist-BsQA6-0i.mjs → dist-BUoL5bbr.mjs} +116 -418
- package/system/dist/{dist-BRI-Mwx0.js → dist-DV0V3JiE.js} +133 -417
- package/system/dist/file-host-worker.js +1 -1
- package/system/dist/file-host-worker.mjs +1 -1
- package/system/dist/{hub-mdns-ciao-Ry_Jpljx.js → hub-mdns-ciao-Be5PGXW6.js} +2 -2
- package/system/dist/{hub-mdns-ciao-8dJTW2LI.mjs → hub-mdns-ciao-DoSb8dwB.mjs} +2 -2
- package/system/dist/index.js +151 -53
- package/system/dist/index.mjs +362 -266
- package/system/dist/kernel/addon-health-monitor.d.ts +0 -21
- package/system/dist/kernel/index.d.ts +2 -0
- package/system/dist/kernel/transport/runner-of-addon.d.ts +2 -0
- package/system/dist/kernel/unsupported-addon-tracker.d.ts +74 -0
- package/system/dist/{legacy-integration-rows-door-D5BdSNla.js → legacy-integration-rows-door-D5s8oM7e.js} +1 -1
- package/system/dist/{legacy-integration-rows-door-CjXTbmvH.mjs → legacy-integration-rows-door-DRC0xn6k.mjs} +1 -1
- package/system/dist/migrations/hub/2026-11-06-addon-settings-bare-rows.d.ts +3 -0
- package/system/dist/{restore-archive-Co2lk3OU.mjs → restore-archive-DH3P9j-V.mjs} +94 -94
- package/system/dist/{restore-archive-GoWJMdHy.js → restore-archive-Dh4gfCRY.js} +1 -1
- package/system/dist/{wal-maintenance-DRnV6QYu.mjs → wal-maintenance-BWfH3Lov.mjs} +0 -0
- package/system/dist/{wal-maintenance-C1Haue74.js → wal-maintenance-DgN_WD5T.js} +0 -0
- package/system/package.json +4 -1
|
@@ -63,12 +63,6 @@ export interface AddonHealthState {
|
|
|
63
63
|
alertEmitted: boolean;
|
|
64
64
|
/** True if a retry attempt is currently in flight. */
|
|
65
65
|
retrying: boolean;
|
|
66
|
-
/**
|
|
67
|
-
* True while the hub spawn gate holds the addon back (its package is below what
|
|
68
|
-
* the running server requires). Retried on the same backoff, but never a
|
|
69
|
-
* failure: no alert, no failure event.
|
|
70
|
-
*/
|
|
71
|
-
heldBack: boolean;
|
|
72
66
|
}
|
|
73
67
|
export interface AddonHealthSnapshot {
|
|
74
68
|
readonly packageName: string;
|
|
@@ -84,7 +78,6 @@ export interface AddonHealthSnapshot {
|
|
|
84
78
|
readonly nextRetryAt: number | null;
|
|
85
79
|
readonly alertEmitted: boolean;
|
|
86
80
|
readonly retrying: boolean;
|
|
87
|
-
readonly heldBack: boolean;
|
|
88
81
|
/** Whether the boot grace window is still open (suppresses alerts). */
|
|
89
82
|
readonly inGracePeriod: boolean;
|
|
90
83
|
}
|
|
@@ -98,11 +91,6 @@ export interface AddonHealthMonitorOptions {
|
|
|
98
91
|
* success; throws on failure (the monitor records the new error).
|
|
99
92
|
*/
|
|
100
93
|
readonly retryFn: (packageName: string) => Promise<void>;
|
|
101
|
-
/**
|
|
102
|
-
* Whether the spawn gate currently holds this addon back. A failure recorded for
|
|
103
|
-
* a held-back addon (a retry the gate refused) stays a quiet retry, not an alert.
|
|
104
|
-
*/
|
|
105
|
-
readonly isHeldBack?: (addonId: string) => boolean;
|
|
106
94
|
/** Override for tests. Defaults to `HEALTH_MONITOR_TICK_MS`. */
|
|
107
95
|
readonly tickIntervalMs?: number;
|
|
108
96
|
/** Override for tests. Defaults to `HEALTH_MONITOR_GRACE_PERIOD_MS`. */
|
|
@@ -122,7 +110,6 @@ export declare class AddonHealthMonitor {
|
|
|
122
110
|
private readonly logger;
|
|
123
111
|
private readonly retryFn;
|
|
124
112
|
private readonly now;
|
|
125
|
-
private readonly isHeldBack;
|
|
126
113
|
private timer;
|
|
127
114
|
private graceEmittedFor;
|
|
128
115
|
constructor(opts: AddonHealthMonitorOptions);
|
|
@@ -141,14 +128,6 @@ export declare class AddonHealthMonitor {
|
|
|
141
128
|
*/
|
|
142
129
|
recordFailure(packageName: string, err: unknown, addonId?: string): void;
|
|
143
130
|
/**
|
|
144
|
-
* The spawn gate holds this addon back (its package is not yet at the version the
|
|
145
|
-
* server requires). Not a failure: the same retry backoff is armed, so the addon
|
|
146
|
-
* is reloaded once its package is current, but no failure is logged as a warning
|
|
147
|
-
* and no `AddonLoadFailed` / `AddonRetryScheduled` event is emitted. A retry that
|
|
148
|
-
* finds the gate open records success the normal way.
|
|
149
|
-
*/
|
|
150
|
-
recordHeldBack(packageName: string, reason: string, addonId?: string): void;
|
|
151
|
-
/**
|
|
152
131
|
* Force an immediate retry attempt for a package, resetting the
|
|
153
132
|
* counter back to 0 (next failure goes to the 60s interval again).
|
|
154
133
|
* Used by the user-facing `addons.retryLoad` tRPC procedure and by
|
|
@@ -93,6 +93,8 @@ export type { InstallManifestSystemDepsOptions, SystemPackageManager } from "./d
|
|
|
93
93
|
export { installManifestNativeDeps } from "./deps/manifest-native-deps.js";
|
|
94
94
|
export { AddonHealthMonitor, HEALTH_MONITOR_TICK_MS, HEALTH_MONITOR_GRACE_PERIOD_MS, HEALTH_MONITOR_RETRY_INTERVALS_MS } from "./addon-health-monitor.js";
|
|
95
95
|
export type { AddonHealthPhase, AddonHealthState, AddonHealthSnapshot, AddonHealthMonitorOptions } from "./addon-health-monitor.js";
|
|
96
|
+
export { UnsupportedAddonTracker, UNSUPPORTED_ADDON_SETTLE_MS } from "./unsupported-addon-tracker.js";
|
|
97
|
+
export type { UnsupportedAddonFacts, UnsupportedAddonTrackerOptions } from "./unsupported-addon-tracker.js";
|
|
96
98
|
export type { HubServiceDeps } from "./moleculer/hub-service.js";
|
|
97
99
|
export { createBrokerDeviceManagerApi, buildNativeCapProxy, mountNativeCapService, NATIVE_PROVIDER_SERVICE_INFIX } from "./moleculer/device-cap-proxy.js";
|
|
98
100
|
export type { WorkerDeviceManagerOptions } from "./moleculer/device-cap-proxy.js";
|
|
@@ -7,5 +7,7 @@ export declare class RunnerOfAddon {
|
|
|
7
7
|
private readonly byAddon;
|
|
8
8
|
/** Remember the plan and hand the runner id back, so the call site stays one expression. */
|
|
9
9
|
record(addonId: string, runnerId: string): string;
|
|
10
|
+
/** The addons the spawn plan put in `runnerId` (a solo runner records itself: `[addonId]`; an addon never planned here is not listed). */
|
|
11
|
+
addonsOf(runnerId: string): readonly string[];
|
|
10
12
|
resolve: (addonId: string) => string;
|
|
11
13
|
}
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
import type { SystemEvent } from "@camstack/types";
|
|
2
|
+
/**
|
|
3
|
+
* The operator alert for an addon that RUNS below the version the server needs.
|
|
4
|
+
*
|
|
5
|
+
* An addon whose installed package is under the running server's minimum
|
|
6
|
+
* (`camstack.requires.addons`, or its own `requires.server`) is always started:
|
|
7
|
+
* a held-back addon is invisible and silently loses its function, and the
|
|
8
|
+
* `CrashSupervisor` (D6) already bounds a crash loop. What the operator needs is
|
|
9
|
+
* to SEE it, so this tracker turns the gate's verdict into one alert pair on the
|
|
10
|
+
* usual AlertCenter path, the way `AddonHealthMonitor` does for a load failure:
|
|
11
|
+
*
|
|
12
|
+
* - `AddonUnsupportedVersion` once per streak (same package, same installed
|
|
13
|
+
* version, same unmet facts), after a short settle window so the alert
|
|
14
|
+
* centre is subscribed even when the verdict comes from the first boot plan;
|
|
15
|
+
* - `AddonUnsupportedResolved` when a later judgement finds the package
|
|
16
|
+
* supported, or the node's installed set no longer holds it, which dismisses
|
|
17
|
+
* the alert.
|
|
18
|
+
*
|
|
19
|
+
* One tracker per process; the verdict is re-judged on every spawn path, and
|
|
20
|
+
* `observe` is idempotent; given the node's full installed set, a streak whose
|
|
21
|
+
* package is no longer installed is resolved too. State is in memory: a restart raises a still-
|
|
22
|
+
* unsupported addon once more, and AlertCenter upserts it under the same id.
|
|
23
|
+
*/
|
|
24
|
+
export declare const UNSUPPORTED_ADDON_SETTLE_MS = 6e4;
|
|
25
|
+
/** What the gate knows about one addon that runs below its minimum. */
|
|
26
|
+
export interface UnsupportedAddonFacts {
|
|
27
|
+
readonly packageName: string;
|
|
28
|
+
readonly addonId: string;
|
|
29
|
+
readonly installedVersion: string;
|
|
30
|
+
/** The running server version, `null` when unreadable. */
|
|
31
|
+
readonly serverVersion: string | null;
|
|
32
|
+
/** The minimum the server requires of this package; `null` when only the addon's own `requires.server` is unmet. */
|
|
33
|
+
readonly requiredMinimum: string | null;
|
|
34
|
+
/** One line per unmet requirement, versions included. */
|
|
35
|
+
readonly unmet: readonly string[];
|
|
36
|
+
}
|
|
37
|
+
export interface UnsupportedAddonTrackerOptions {
|
|
38
|
+
readonly eventBus: {
|
|
39
|
+
emit(event: SystemEvent): void;
|
|
40
|
+
};
|
|
41
|
+
/** The node this tracker runs on (`hub` or the agent's node id). */
|
|
42
|
+
readonly nodeId: string;
|
|
43
|
+
readonly log: (line: string) => void;
|
|
44
|
+
/** Override for tests. Defaults to {@link UNSUPPORTED_ADDON_SETTLE_MS}. */
|
|
45
|
+
readonly settleMs?: number;
|
|
46
|
+
readonly now?: () => number;
|
|
47
|
+
}
|
|
48
|
+
export declare class UnsupportedAddonTracker {
|
|
49
|
+
private readonly options;
|
|
50
|
+
private readonly streaks;
|
|
51
|
+
private readonly settleMs;
|
|
52
|
+
private readonly now;
|
|
53
|
+
private readonly startedAt;
|
|
54
|
+
private timer;
|
|
55
|
+
private readonly logged;
|
|
56
|
+
constructor(options: UnsupportedAddonTrackerOptions);
|
|
57
|
+
/**
|
|
58
|
+
* One gate run. `judged` is every package the run looked at, `unsupported` the
|
|
59
|
+
* subset below its minimum. A judged package with a streak that is not in
|
|
60
|
+
* `unsupported` any more is resolved; a package this run did not judge is left alone.
|
|
61
|
+
* `installed`, when the run saw the node's FULL package set, also resolves every
|
|
62
|
+
* streak whose package is not in it (uninstalled).
|
|
63
|
+
*/
|
|
64
|
+
observe(judged: readonly string[], unsupported: readonly UnsupportedAddonFacts[], installed?: readonly string[]): void;
|
|
65
|
+
/** Log a line the first time only (an unjudged addon is reported once, not on every judgement). */
|
|
66
|
+
logOnce(line: string): void;
|
|
67
|
+
/** Stop the settle timer (shutdown). */
|
|
68
|
+
stop(): void;
|
|
69
|
+
private raise;
|
|
70
|
+
private resolve;
|
|
71
|
+
/** Emit every pending streak once the settle window is over; otherwise arm one timer for its end. */
|
|
72
|
+
private flush;
|
|
73
|
+
private emit;
|
|
74
|
+
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { ks as collectSecretMarkerRefs } from "./dist-BUoL5bbr.mjs";
|
|
2
2
|
//#region src/builtins/sqlite-storage/migrations/legacy-integration-rows-door.ts
|
|
3
3
|
/**
|
|
4
4
|
* Migration-only door for the leftover integration rows (planning#416).
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import type { HubPlanMigration } from "../../builtins/sqlite-storage/migrations/migration-types.js";
|
|
2
|
+
export declare const ADDON_SETTINGS_BARE_ROWS_MIGRATION_ID = "hub/2026-11-06-addon-settings-bare-rows";
|
|
3
|
+
export declare const ADDON_SETTINGS_BARE_ROWS_MIGRATION: HubPlanMigration;
|