@camstack/system 1.1.36 → 1.1.37
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 +1 -1
- package/dist/addon-runner.mjs +1 -1
- package/dist/builtins/addon-pages-aggregator/addon-pages-aggregator.addon.d.ts +8 -4
- package/dist/builtins/addon-pages-aggregator/addon-pages-aggregator.addon.js +22 -10
- package/dist/builtins/addon-pages-aggregator/addon-pages-aggregator.addon.mjs +23 -11
- package/dist/builtins/addon-widgets-aggregator/addon-widgets-aggregator.addon.d.ts +4 -0
- package/dist/builtins/addon-widgets-aggregator/addon-widgets-aggregator.addon.js +23 -9
- package/dist/builtins/addon-widgets-aggregator/addon-widgets-aggregator.addon.mjs +24 -10
- package/dist/builtins/alerts/alerts.addon.js +1 -1
- package/dist/builtins/alerts/alerts.addon.mjs +1 -1
- package/dist/builtins/backup-orchestrator/backup-orchestrator.addon.js +1 -1
- package/dist/builtins/backup-orchestrator/backup-orchestrator.addon.mjs +1 -1
- package/dist/builtins/console-logging/index.js +1 -1
- package/dist/builtins/console-logging/index.mjs +1 -1
- 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/local-auth/local-auth.addon.js +1 -1
- package/dist/builtins/local-auth/local-auth.addon.mjs +1 -1
- package/dist/builtins/local-network/local-network.addon.js +1 -1
- package/dist/builtins/local-network/local-network.addon.mjs +1 -1
- package/dist/builtins/native-metrics/native-metrics.addon.js +1 -1
- package/dist/builtins/native-metrics/native-metrics.addon.mjs +1 -1
- package/dist/builtins/platform-probe/index.js +1 -1
- package/dist/builtins/platform-probe/index.mjs +1 -1
- 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/sqlite-settings.addon.js +1 -1
- package/dist/builtins/sqlite-storage/sqlite-settings.addon.mjs +1 -1
- 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 +1 -1
- package/dist/builtins/system-config/system-config.addon.mjs +1 -1
- package/dist/builtins/winston-logging/index.js +1 -1
- package/dist/builtins/winston-logging/index.mjs +1 -1
- package/dist/{dist-C7oOY4iL.mjs → dist-CU3lb_Ys.mjs} +322 -8
- package/dist/{dist-COIhbSao.js → dist-fRVWwrkF.js} +322 -8
- package/dist/index.js +26 -7
- package/dist/index.mjs +26 -7
- package/dist/kernel/index.d.ts +1 -1
- package/dist/kernel/moleculer/node-registry.d.ts +22 -1
- package/dist/kernel/moleculer/register-node-client.d.ts +8 -5
- package/dist/{manifest-python-deps-BYIV8-rc.mjs → manifest-python-deps-4QvOLiBn.mjs} +1 -1
- package/dist/{manifest-python-deps-CZFqI4wp.js → manifest-python-deps-B6ahe90k.js} +1 -1
- package/package.json +1 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
let zod = require("zod");
|
|
2
|
-
//#region ../types/dist/sleep-
|
|
2
|
+
//#region ../types/dist/sleep-DJaTV2D7.mjs
|
|
3
3
|
var EventCategory = /* @__PURE__ */ function(EventCategory) {
|
|
4
4
|
EventCategory["SystemBoot"] = "system.boot";
|
|
5
5
|
EventCategory["SystemAddonsReady"] = "system.addons-ready";
|
|
@@ -721,10 +721,6 @@ function hydrateField(field, values) {
|
|
|
721
721
|
};
|
|
722
722
|
}
|
|
723
723
|
const rawValue = storedValue !== void 0 ? storedValue : defaultValue !== void 0 ? defaultValue : null;
|
|
724
|
-
if (field.type === "password") return {
|
|
725
|
-
...field,
|
|
726
|
-
value: ""
|
|
727
|
-
};
|
|
728
724
|
const value = field.type === "textarea" && field.isJson && rawValue !== null && typeof rawValue === "object" ? JSON.stringify(rawValue, null, 2) : rawValue;
|
|
729
725
|
return {
|
|
730
726
|
...field,
|
|
@@ -2606,13 +2602,32 @@ function event(data) {
|
|
|
2606
2602
|
function isDeviceConfigCap(def) {
|
|
2607
2603
|
return def?.deviceConfig !== void 0;
|
|
2608
2604
|
}
|
|
2609
|
-
var StaticDirOutputSchema = zod.z.object({ staticDir: zod.z.string() });
|
|
2610
|
-
var VersionOutputSchema = zod.z.object({ version: zod.z.string() });
|
|
2605
|
+
var StaticDirOutputSchema$1 = zod.z.object({ staticDir: zod.z.string() });
|
|
2606
|
+
var VersionOutputSchema$1 = zod.z.object({ version: zod.z.string() });
|
|
2611
2607
|
var adminUiCapability = {
|
|
2612
2608
|
name: "admin-ui",
|
|
2613
2609
|
scope: "system",
|
|
2614
2610
|
mode: "singleton",
|
|
2615
2611
|
internal: true,
|
|
2612
|
+
methods: {
|
|
2613
|
+
getStaticDir: method(zod.z.void(), StaticDirOutputSchema$1),
|
|
2614
|
+
getVersion: method(zod.z.void(), VersionOutputSchema$1)
|
|
2615
|
+
}
|
|
2616
|
+
};
|
|
2617
|
+
var StaticDirOutputSchema = zod.z.object({ staticDir: zod.z.string() });
|
|
2618
|
+
var VersionOutputSchema = zod.z.object({ version: zod.z.string() });
|
|
2619
|
+
/**
|
|
2620
|
+
* viewer-ui — serves the CamStack VIEWER web build (the Expo/React-Native
|
|
2621
|
+
* universal client's PWA export) from the hub, alongside admin-ui. Mirrors
|
|
2622
|
+
* `admin-ui` exactly: a singleton, server-internal cap exposing the static
|
|
2623
|
+
* dist directory + build version so `main.ts` can mount the SPA under a
|
|
2624
|
+
* dedicated prefix.
|
|
2625
|
+
*/
|
|
2626
|
+
var viewerUiCapability = {
|
|
2627
|
+
name: "viewer-ui",
|
|
2628
|
+
scope: "system",
|
|
2629
|
+
mode: "singleton",
|
|
2630
|
+
internal: true,
|
|
2616
2631
|
methods: {
|
|
2617
2632
|
getStaticDir: method(zod.z.void(), StaticDirOutputSchema),
|
|
2618
2633
|
getVersion: method(zod.z.void(), VersionOutputSchema)
|
|
@@ -11367,6 +11382,17 @@ var WidgetMetadataSchema = zod.z.object({
|
|
|
11367
11382
|
deviceContext: zod.z.boolean().default(false),
|
|
11368
11383
|
integrationContext: zod.z.boolean().default(false)
|
|
11369
11384
|
}),
|
|
11385
|
+
/**
|
|
11386
|
+
* Loadable BEFORE authentication. The normal widget registry listing
|
|
11387
|
+
* (`addon-widgets.listWidgets`) is auth-gated, so a pre-auth surface
|
|
11388
|
+
* (the login page) cannot discover a widget through it. A widget that
|
|
11389
|
+
* declares `preAuth: true` marks itself as safe to mount on a pre-auth
|
|
11390
|
+
* screen — it is surfaced through the PUBLIC `auth.listLoginMethods`
|
|
11391
|
+
* login-method contribution channel (see `login-method.cap.ts`) rather
|
|
11392
|
+
* than the authenticated registry, and its bundle is served by the
|
|
11393
|
+
* public `/api/addon-widgets/:addonId/*` static route. Defaults false.
|
|
11394
|
+
*/
|
|
11395
|
+
preAuth: zod.z.boolean().optional().default(false),
|
|
11370
11396
|
/** Dashboard placement HINTS (operator can override per instance). */
|
|
11371
11397
|
defaultSize: WidgetSizeEnum.default("md"),
|
|
11372
11398
|
allowedSizes: zod.z.array(WidgetSizeEnum).readonly().default([
|
|
@@ -11805,6 +11831,87 @@ var authProviderCapability = {
|
|
|
11805
11831
|
mount: { kind: "skip" }
|
|
11806
11832
|
};
|
|
11807
11833
|
/**
|
|
11834
|
+
* `login-method` — collection cap through which auth addons contribute
|
|
11835
|
+
* their pre-auth login surfaces to the login page. This is the SINGLE,
|
|
11836
|
+
* generic mechanism that supersedes the dead `auth.listProviders` reader:
|
|
11837
|
+
* every auth addon (OIDC, magic-link, WebAuthn/passkey) registers a
|
|
11838
|
+
* `login-method` provider and the PUBLIC `auth.listLoginMethods`
|
|
11839
|
+
* procedure aggregates them for the unauthenticated login page.
|
|
11840
|
+
*
|
|
11841
|
+
* A contribution is a discriminated union on `kind`:
|
|
11842
|
+
*
|
|
11843
|
+
* - `redirect` — a declarative button. The login page renders a generic
|
|
11844
|
+
* button that navigates to `startUrl` (an addon-owned HTTP route).
|
|
11845
|
+
* Covers OIDC (`/addon/auth-oidc/<id>/start`) and magic-link with
|
|
11846
|
+
* ZERO shell-side JS. A future SSO addon plugs in the same way — the
|
|
11847
|
+
* login page needs NO change.
|
|
11848
|
+
*
|
|
11849
|
+
* - `widget` — a Module-Federation widget the login page mounts (via
|
|
11850
|
+
* `loadRemoteBundle`) for an in-page ceremony. Covers the passkey
|
|
11851
|
+
* login ceremony, which must run `@simplewebauthn/browser` INSIDE the
|
|
11852
|
+
* addon bundle. The referenced widget also declares `preAuth: true` in
|
|
11853
|
+
* its `addon-widgets-source` catalog entry. `auth.listLoginMethods`
|
|
11854
|
+
* stamps a public `bundleUrl` from `addonId` + `bundle`.
|
|
11855
|
+
*
|
|
11856
|
+
* Every contribution carries a `stage`:
|
|
11857
|
+
* - `primary` — shown on the first credentials screen (OIDC /
|
|
11858
|
+
* magic-link buttons; a future usernameless passkey).
|
|
11859
|
+
* - `second-factor` — shown AFTER the password leg, gated on the
|
|
11860
|
+
* returned `factors` (passkey-as-2FA today).
|
|
11861
|
+
*
|
|
11862
|
+
* `mount: skip` — the cap is read server-side by the core auth router
|
|
11863
|
+
* (`registry.getCollection('login-method')`), never mounted as its own
|
|
11864
|
+
* tRPC router.
|
|
11865
|
+
*/
|
|
11866
|
+
/** When a login method renders in the two-phase login flow. */
|
|
11867
|
+
var LoginStageEnum = zod.z.enum(["primary", "second-factor"]);
|
|
11868
|
+
/**
|
|
11869
|
+
* A declarative redirect button — the login page navigates to `startUrl`.
|
|
11870
|
+
* OIDC and magic-link contribute this; a future SSO addon does too.
|
|
11871
|
+
*/
|
|
11872
|
+
var RedirectLoginMethodSchema = zod.z.object({
|
|
11873
|
+
kind: zod.z.literal("redirect"),
|
|
11874
|
+
/** Stable id within the login-method set (e.g. `auth-oidc/google`). */
|
|
11875
|
+
id: zod.z.string(),
|
|
11876
|
+
/** Operator-facing button label. */
|
|
11877
|
+
label: zod.z.string(),
|
|
11878
|
+
/** lucide-react icon name. */
|
|
11879
|
+
icon: zod.z.string().optional(),
|
|
11880
|
+
/** Addon-owned HTTP route the button navigates to (GET). */
|
|
11881
|
+
startUrl: zod.z.string(),
|
|
11882
|
+
stage: LoginStageEnum
|
|
11883
|
+
});
|
|
11884
|
+
/**
|
|
11885
|
+
* A Module-Federation widget the login page mounts for an in-page
|
|
11886
|
+
* ceremony. `bundle` + `addonId` let `auth.listLoginMethods` stamp a
|
|
11887
|
+
* public `bundleUrl`; `remote` is the MF descriptor `loadRemoteBundle`
|
|
11888
|
+
* consumes. No `bundleUrl` here — it is server-stamped on the public
|
|
11889
|
+
* output so the addon never encodes the static-route scheme.
|
|
11890
|
+
*/
|
|
11891
|
+
var WidgetLoginMethodSchema = zod.z.object({
|
|
11892
|
+
kind: zod.z.literal("widget"),
|
|
11893
|
+
/** Stable id within the login-method set (e.g. `auth-webauthn/passkey-login`). */
|
|
11894
|
+
id: zod.z.string(),
|
|
11895
|
+
/** Owning addon id — drives the public bundle URL + the MF namespace. */
|
|
11896
|
+
addonId: zod.z.string(),
|
|
11897
|
+
/** Bundle filename inside the addon's dist dir (`remoteEntry.js`). */
|
|
11898
|
+
bundle: zod.z.string(),
|
|
11899
|
+
/** MF remote descriptor — `{ remoteName, exposedModule, componentKey }`. */
|
|
11900
|
+
remote: WidgetRemoteSchema,
|
|
11901
|
+
stage: LoginStageEnum
|
|
11902
|
+
});
|
|
11903
|
+
/** One login-method contribution — redirect button OR pre-auth widget. */
|
|
11904
|
+
var LoginMethodContributionSchema = zod.z.discriminatedUnion("kind", [RedirectLoginMethodSchema, WidgetLoginMethodSchema]);
|
|
11905
|
+
var loginMethodCapability = {
|
|
11906
|
+
name: "login-method",
|
|
11907
|
+
scope: "system",
|
|
11908
|
+
mode: "collection",
|
|
11909
|
+
internal: true,
|
|
11910
|
+
methods: { getLoginMethods: method(zod.z.void(), zod.z.array(LoginMethodContributionSchema).readonly()) },
|
|
11911
|
+
/** BIG PLAN 2: declarative mount hint — read by `@camstack/system` `buildCapRouters`. */
|
|
11912
|
+
mount: { kind: "skip" }
|
|
11913
|
+
};
|
|
11914
|
+
/**
|
|
11808
11915
|
* Orchestrator-side destination metadata. The orchestrator computes
|
|
11809
11916
|
* `id = <addonId>:<subId>` from its provider lookup so consumers
|
|
11810
11917
|
* (admin UI, restore flow) see one canonical key.
|
|
@@ -15640,6 +15747,151 @@ var pipelineOrchestratorCapability = {
|
|
|
15640
15747
|
}
|
|
15641
15748
|
};
|
|
15642
15749
|
/**
|
|
15750
|
+
* server-management — per-NODE singleton capability for a node's ROOT
|
|
15751
|
+
* package lifecycle (runtime-updatable node packages, phase 2: hub + docker
|
|
15752
|
+
* agents).
|
|
15753
|
+
*
|
|
15754
|
+
* Each node's root package (`@camstack/server` on the hub, `@camstack/agent`
|
|
15755
|
+
* on agents) carries the whole software stack in its npm dep tree, so ONE
|
|
15756
|
+
* version describes the node. Updates install into
|
|
15757
|
+
* `<dataDir>/server-root/versions/<v>/` and apply on restart via the baked
|
|
15758
|
+
* starter (probation boot + auto-rollback to N-1).
|
|
15759
|
+
*
|
|
15760
|
+
* Providers:
|
|
15761
|
+
* - HUB: `ServerUpdateService` behind the `server-provided` mount
|
|
15762
|
+
* (`buildServerProviders` in trpc.router.ts) — the default target for
|
|
15763
|
+
* unpinned calls.
|
|
15764
|
+
* - AGENT: `AgentUpdateService` registered by the agent bootstrap under
|
|
15765
|
+
* the synthetic `agent-runtime` addonId and declared in the agent's
|
|
15766
|
+
* `$hub.registerNode` manifest.
|
|
15767
|
+
*
|
|
15768
|
+
* Node routing: singleton caps get the codegen/runtime-builder `nodeId`
|
|
15769
|
+
* injection on every method — `input.nodeId` (or `nodePin(nodeId)` from the
|
|
15770
|
+
* SDK) routes the call to that node's provider via the standard remote
|
|
15771
|
+
* proxy (`createCapabilityProxy` → `$agent-cap-fwd` → the agent's
|
|
15772
|
+
* in-process provider lookup). No `nodeId` → the hub's own provider.
|
|
15773
|
+
*
|
|
15774
|
+
* Spec: docs/superpowers/specs/2026-07-12-runtime-updatable-node-packages-design.md
|
|
15775
|
+
*/
|
|
15776
|
+
/**
|
|
15777
|
+
* Where the running hub's code was loaded from:
|
|
15778
|
+
* - `workspace` — dev checkout (tsx / workspace dist); the starter defers to
|
|
15779
|
+
* plain resolution and runtime updates are refused.
|
|
15780
|
+
* - `baked` — the immutable image seed closure (no data-dir root active).
|
|
15781
|
+
* - `data-root` — the runtime-updatable `<dataDir>/server-root` closure.
|
|
15782
|
+
*/
|
|
15783
|
+
var ServerBootModeSchema = zod.z.enum([
|
|
15784
|
+
"workspace",
|
|
15785
|
+
"baked",
|
|
15786
|
+
"data-root"
|
|
15787
|
+
]);
|
|
15788
|
+
/**
|
|
15789
|
+
* Update lifecycle state:
|
|
15790
|
+
* - `idle` / `checking` / `staging` — steady / in-flight registry work.
|
|
15791
|
+
* - `pending-restart` — a version is staged and the node has NOT yet
|
|
15792
|
+
* restarted onto it (still running the OLD version).
|
|
15793
|
+
* - `awaiting-confirmation` — the node HAS restarted onto the staged version
|
|
15794
|
+
* (it is the active probation boot) and is waiting to confirm boot-health.
|
|
15795
|
+
* Apply/rollback are refused in this state and the node must NOT be
|
|
15796
|
+
* manually restarted, or the probation boot auto-rolls-back.
|
|
15797
|
+
*/
|
|
15798
|
+
var ServerUpdateStateSchema = zod.z.enum([
|
|
15799
|
+
"idle",
|
|
15800
|
+
"checking",
|
|
15801
|
+
"staging",
|
|
15802
|
+
"pending-restart",
|
|
15803
|
+
"awaiting-confirmation"
|
|
15804
|
+
]);
|
|
15805
|
+
var ServerRollbackInfoSchema = zod.z.object({
|
|
15806
|
+
/** The version that failed (or was manually rolled back). */
|
|
15807
|
+
fromVersion: zod.z.string(),
|
|
15808
|
+
/** The version rolled back to; null = the baked seed. */
|
|
15809
|
+
toVersion: zod.z.string().nullable(),
|
|
15810
|
+
atMs: zod.z.number(),
|
|
15811
|
+
reason: zod.z.string()
|
|
15812
|
+
});
|
|
15813
|
+
var ServerPackageStatusSchema = zod.z.object({
|
|
15814
|
+
/** Root package name (`@camstack/server` on the hub). */
|
|
15815
|
+
packageName: zod.z.string(),
|
|
15816
|
+
/** Version of the code the running process ACTUALLY loaded. */
|
|
15817
|
+
runningVersion: zod.z.string().nullable(),
|
|
15818
|
+
/** Node.js runtime version the node's process runs on (`process.versions.node`). */
|
|
15819
|
+
nodeRuntimeVersion: zod.z.string().nullable(),
|
|
15820
|
+
/** Active data-dir root version; null when booted from seed/workspace. */
|
|
15821
|
+
activeVersion: zod.z.string().nullable(),
|
|
15822
|
+
/** N-1 version kept for rollback; null when no previous version exists. */
|
|
15823
|
+
previousVersion: zod.z.string().nullable(),
|
|
15824
|
+
/** Version of the immutable baked seed closure (image fallback). */
|
|
15825
|
+
seedVersion: zod.z.string().nullable(),
|
|
15826
|
+
/** Latest registry version from the most recent check (null = never checked). */
|
|
15827
|
+
latestVersion: zod.z.string().nullable(),
|
|
15828
|
+
updateAvailable: zod.z.boolean(),
|
|
15829
|
+
bootMode: ServerBootModeSchema,
|
|
15830
|
+
updateState: ServerUpdateStateSchema,
|
|
15831
|
+
/** Version staged + awaiting its probation boot, when one is pending. */
|
|
15832
|
+
pendingVersion: zod.z.string().nullable(),
|
|
15833
|
+
/** Set when the last freshly-activated version failed its boot health-check. */
|
|
15834
|
+
rolledBack: ServerRollbackInfoSchema.nullable(),
|
|
15835
|
+
/**
|
|
15836
|
+
* True when `server-root/state.json` EXISTS but is unreadable/corrupt — the
|
|
15837
|
+
* hub is running from the baked seed (or workspace) while installed data-dir
|
|
15838
|
+
* versions are being IGNORED. Surfaced as a warning in the UI.
|
|
15839
|
+
*/
|
|
15840
|
+
stateFileCorrupt: zod.z.boolean(),
|
|
15841
|
+
lastCheckedAtMs: zod.z.number().nullable()
|
|
15842
|
+
});
|
|
15843
|
+
var ServerUpdateCheckResultSchema = zod.z.object({
|
|
15844
|
+
packageName: zod.z.string(),
|
|
15845
|
+
runningVersion: zod.z.string().nullable(),
|
|
15846
|
+
latestVersion: zod.z.string().nullable(),
|
|
15847
|
+
updateAvailable: zod.z.boolean(),
|
|
15848
|
+
checkedAtMs: zod.z.number(),
|
|
15849
|
+
/** Non-null when the registry lookup failed (offline, bad registry, …). */
|
|
15850
|
+
error: zod.z.string().nullable()
|
|
15851
|
+
});
|
|
15852
|
+
var ServerUpdateActionResultSchema = zod.z.object({
|
|
15853
|
+
accepted: zod.z.boolean(),
|
|
15854
|
+
targetVersion: zod.z.string().nullable(),
|
|
15855
|
+
/** True when a graceful restart was scheduled to apply the change. */
|
|
15856
|
+
restarting: zod.z.boolean(),
|
|
15857
|
+
message: zod.z.string()
|
|
15858
|
+
});
|
|
15859
|
+
var serverManagementCapability = {
|
|
15860
|
+
name: "server-management",
|
|
15861
|
+
scope: "system",
|
|
15862
|
+
mode: "singleton",
|
|
15863
|
+
methods: {
|
|
15864
|
+
getServerPackageStatus: method(zod.z.void(), ServerPackageStatusSchema, { auth: "admin" }),
|
|
15865
|
+
checkServerUpdate: method(zod.z.void(), ServerUpdateCheckResultSchema, {
|
|
15866
|
+
kind: "mutation",
|
|
15867
|
+
auth: "admin"
|
|
15868
|
+
}),
|
|
15869
|
+
applyServerUpdate: method(zod.z.object({
|
|
15870
|
+
/** Explicit target version; omitted = latest from the registry. */
|
|
15871
|
+
version: zod.z.string().optional() }), ServerUpdateActionResultSchema, {
|
|
15872
|
+
kind: "mutation",
|
|
15873
|
+
auth: "admin"
|
|
15874
|
+
}),
|
|
15875
|
+
rollbackServerUpdate: method(zod.z.void(), ServerUpdateActionResultSchema, {
|
|
15876
|
+
kind: "mutation",
|
|
15877
|
+
auth: "admin"
|
|
15878
|
+
}),
|
|
15879
|
+
/**
|
|
15880
|
+
* Plain process restart of the node's root process — no version change.
|
|
15881
|
+
* The supervisor (docker restart policy / launchd / Electron main)
|
|
15882
|
+
* relaunches and the starter loads the SAME active version. Refused while
|
|
15883
|
+
* a stage is in flight or a version is already staged awaiting restart
|
|
15884
|
+
* (use apply/rollback instead, so the pending version is not skipped).
|
|
15885
|
+
*/
|
|
15886
|
+
restartServer: method(zod.z.void(), ServerUpdateActionResultSchema, {
|
|
15887
|
+
kind: "mutation",
|
|
15888
|
+
auth: "admin"
|
|
15889
|
+
})
|
|
15890
|
+
},
|
|
15891
|
+
/** BIG PLAN 2: declarative mount hint — read by `@camstack/system` `buildCapRouters`. */
|
|
15892
|
+
mount: { kind: "server-provided" }
|
|
15893
|
+
};
|
|
15894
|
+
/**
|
|
15643
15895
|
* Query filter for settings-store collections.
|
|
15644
15896
|
*/
|
|
15645
15897
|
var QueryFilterSchema = zod.z.object({
|
|
@@ -18505,6 +18757,16 @@ var TopologyCategorySchema = zod.z.object({
|
|
|
18505
18757
|
healthy: zod.z.number(),
|
|
18506
18758
|
addons: zod.z.array(TopologyCategoryAddonSchema).readonly()
|
|
18507
18759
|
});
|
|
18760
|
+
/**
|
|
18761
|
+
* The node's runtime-updatable ROOT package (`@camstack/server` on the hub,
|
|
18762
|
+
* `@camstack/agent` on agents) as reported by its `registerNode` manifest —
|
|
18763
|
+
* version visibility for the Server management surface. Nullable: offline
|
|
18764
|
+
* rows and pre-phase-2 nodes report none.
|
|
18765
|
+
*/
|
|
18766
|
+
var TopologyRootPackageSchema = zod.z.object({
|
|
18767
|
+
name: zod.z.string(),
|
|
18768
|
+
version: zod.z.string()
|
|
18769
|
+
});
|
|
18508
18770
|
var TopologyNodeSchema = zod.z.object({
|
|
18509
18771
|
id: zod.z.string(),
|
|
18510
18772
|
name: zod.z.string(),
|
|
@@ -18528,7 +18790,8 @@ var TopologyNodeSchema = zod.z.object({
|
|
|
18528
18790
|
status: zod.z.string()
|
|
18529
18791
|
})).readonly(),
|
|
18530
18792
|
processes: zod.z.array(TopologyProcessSchema).readonly(),
|
|
18531
|
-
categories: zod.z.array(TopologyCategorySchema).readonly()
|
|
18793
|
+
categories: zod.z.array(TopologyCategorySchema).readonly(),
|
|
18794
|
+
rootPackage: TopologyRootPackageSchema.nullable()
|
|
18532
18795
|
});
|
|
18533
18796
|
var CapUsageEdgeSchema = zod.z.object({
|
|
18534
18797
|
callerAddonId: zod.z.string(),
|
|
@@ -19991,6 +20254,7 @@ var ALL_CAPABILITY_DEFINITIONS = [
|
|
|
19991
20254
|
localNetworkCapability,
|
|
19992
20255
|
lockControlCapability,
|
|
19993
20256
|
logDestinationCapability,
|
|
20257
|
+
loginMethodCapability,
|
|
19994
20258
|
mediaPlayerCapability,
|
|
19995
20259
|
meshNetworkCapability,
|
|
19996
20260
|
metricsProviderCapability,
|
|
@@ -20026,6 +20290,7 @@ var ALL_CAPABILITY_DEFINITIONS = [
|
|
|
20026
20290
|
rebootCapability,
|
|
20027
20291
|
recordingCapability,
|
|
20028
20292
|
scriptRunnerCapability,
|
|
20293
|
+
serverManagementCapability,
|
|
20029
20294
|
settingsStoreCapability,
|
|
20030
20295
|
smokeCapability,
|
|
20031
20296
|
smtpProviderCapability,
|
|
@@ -20050,6 +20315,7 @@ var ALL_CAPABILITY_DEFINITIONS = [
|
|
|
20050
20315
|
valveCapability,
|
|
20051
20316
|
vibrationCapability,
|
|
20052
20317
|
videoclipsCapability,
|
|
20318
|
+
viewerUiCapability,
|
|
20053
20319
|
waterHeaterCapability,
|
|
20054
20320
|
weatherCapability,
|
|
20055
20321
|
webrtcSessionCapability,
|
|
@@ -22106,6 +22372,12 @@ var METHOD_ACCESS_MAP = Object.freeze({
|
|
|
22106
22372
|
addonId: null,
|
|
22107
22373
|
access: "create"
|
|
22108
22374
|
},
|
|
22375
|
+
"loginMethod.getLoginMethods": {
|
|
22376
|
+
capName: "login-method",
|
|
22377
|
+
capScope: "system",
|
|
22378
|
+
addonId: null,
|
|
22379
|
+
access: "view"
|
|
22380
|
+
},
|
|
22109
22381
|
"mediaPlayer.next": {
|
|
22110
22382
|
capName: "media-player",
|
|
22111
22383
|
capScope: "device",
|
|
@@ -23468,6 +23740,36 @@ var METHOD_ACCESS_MAP = Object.freeze({
|
|
|
23468
23740
|
addonId: null,
|
|
23469
23741
|
access: "create"
|
|
23470
23742
|
},
|
|
23743
|
+
"serverManagement.applyServerUpdate": {
|
|
23744
|
+
capName: "server-management",
|
|
23745
|
+
capScope: "system",
|
|
23746
|
+
addonId: null,
|
|
23747
|
+
access: "create"
|
|
23748
|
+
},
|
|
23749
|
+
"serverManagement.checkServerUpdate": {
|
|
23750
|
+
capName: "server-management",
|
|
23751
|
+
capScope: "system",
|
|
23752
|
+
addonId: null,
|
|
23753
|
+
access: "create"
|
|
23754
|
+
},
|
|
23755
|
+
"serverManagement.getServerPackageStatus": {
|
|
23756
|
+
capName: "server-management",
|
|
23757
|
+
capScope: "system",
|
|
23758
|
+
addonId: null,
|
|
23759
|
+
access: "view"
|
|
23760
|
+
},
|
|
23761
|
+
"serverManagement.restartServer": {
|
|
23762
|
+
capName: "server-management",
|
|
23763
|
+
capScope: "system",
|
|
23764
|
+
addonId: null,
|
|
23765
|
+
access: "create"
|
|
23766
|
+
},
|
|
23767
|
+
"serverManagement.rollbackServerUpdate": {
|
|
23768
|
+
capName: "server-management",
|
|
23769
|
+
capScope: "system",
|
|
23770
|
+
addonId: null,
|
|
23771
|
+
access: "create"
|
|
23772
|
+
},
|
|
23471
23773
|
"settingsStore.count": {
|
|
23472
23774
|
capName: "settings-store",
|
|
23473
23775
|
capScope: "system",
|
|
@@ -24332,6 +24634,18 @@ var METHOD_ACCESS_MAP = Object.freeze({
|
|
|
24332
24634
|
addonId: null,
|
|
24333
24635
|
access: "view"
|
|
24334
24636
|
},
|
|
24637
|
+
"viewerUi.getStaticDir": {
|
|
24638
|
+
capName: "viewer-ui",
|
|
24639
|
+
capScope: "system",
|
|
24640
|
+
addonId: null,
|
|
24641
|
+
access: "view"
|
|
24642
|
+
},
|
|
24643
|
+
"viewerUi.getVersion": {
|
|
24644
|
+
capName: "viewer-ui",
|
|
24645
|
+
capScope: "system",
|
|
24646
|
+
addonId: null,
|
|
24647
|
+
access: "view"
|
|
24648
|
+
},
|
|
24335
24649
|
"waterHeater.setAway": {
|
|
24336
24650
|
capName: "water-heater",
|
|
24337
24651
|
capScope: "device",
|
package/dist/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
2
|
const require_chunk = require("./chunk-Cek0wNdY.js");
|
|
3
|
-
const require_dist = require("./dist-
|
|
3
|
+
const require_dist = require("./dist-fRVWwrkF.js");
|
|
4
4
|
const require_model_download_service = require("./model-download-service-D-Umz4-L.js");
|
|
5
5
|
const require_resource_monitor = require("./resource-monitor-DNNomR-i.js");
|
|
6
6
|
const require_builtins_sqlite_storage_filesystem_storage_addon = require("./builtins/sqlite-storage/filesystem-storage.addon.js");
|
|
@@ -21,7 +21,7 @@ const require_builtins_local_auth_local_auth_addon = require("./builtins/local-a
|
|
|
21
21
|
require("./builtins/local-auth/index.js");
|
|
22
22
|
const require_builtins_device_manager_device_manager_addon = require("./builtins/device-manager/device-manager.addon.js");
|
|
23
23
|
require("./builtins/device-manager/index.js");
|
|
24
|
-
const require_manifest_python_deps = require("./manifest-python-deps-
|
|
24
|
+
const require_manifest_python_deps = require("./manifest-python-deps-B6ahe90k.js");
|
|
25
25
|
const require_custom_action_registry = require("./custom-action-registry-vLYEFTtv.js");
|
|
26
26
|
let _camstack_types_node = require("@camstack/types/node");
|
|
27
27
|
let zod = require("zod");
|
|
@@ -91751,6 +91751,8 @@ var HubNodeRegistry = class {
|
|
|
91751
91751
|
nodes = /* @__PURE__ */ new Map();
|
|
91752
91752
|
/** nodeId → its device-scoped native caps (last `registerNode` wins). */
|
|
91753
91753
|
nativeCaps = /* @__PURE__ */ new Map();
|
|
91754
|
+
/** nodeId → its root-package identity (last `registerNode` wins). */
|
|
91755
|
+
rootPackages = /* @__PURE__ */ new Map();
|
|
91754
91756
|
/**
|
|
91755
91757
|
* deviceId → flat native-cap entries for THAT device, across all nodes.
|
|
91756
91758
|
* Maintained incrementally on every `registerNode`/`removeNode` so a
|
|
@@ -91798,6 +91800,11 @@ var HubNodeRegistry = class {
|
|
|
91798
91800
|
deviceIds: [...n.deviceIds]
|
|
91799
91801
|
}));
|
|
91800
91802
|
this.nativeCaps.set(params.nodeId, caps);
|
|
91803
|
+
if (params.rootPackage !== void 0) this.rootPackages.set(params.nodeId, {
|
|
91804
|
+
name: params.rootPackage.name,
|
|
91805
|
+
version: params.rootPackage.version
|
|
91806
|
+
});
|
|
91807
|
+
else this.rootPackages.delete(params.nodeId);
|
|
91801
91808
|
for (const cap of caps) for (const deviceId of cap.deviceIds) {
|
|
91802
91809
|
const entry = {
|
|
91803
91810
|
nodeId: params.nodeId,
|
|
@@ -91815,6 +91822,11 @@ var HubNodeRegistry = class {
|
|
|
91815
91822
|
this.dropNodeFromDeviceIndex(nodeId);
|
|
91816
91823
|
this.nodes.delete(nodeId);
|
|
91817
91824
|
this.nativeCaps.delete(nodeId);
|
|
91825
|
+
this.rootPackages.delete(nodeId);
|
|
91826
|
+
}
|
|
91827
|
+
/** The node's root-package identity, or null when it never reported one. */
|
|
91828
|
+
getNodeRootPackage(nodeId) {
|
|
91829
|
+
return this.rootPackages.get(nodeId) ?? null;
|
|
91818
91830
|
}
|
|
91819
91831
|
/** The node's manifest, or undefined when the node never registered. */
|
|
91820
91832
|
getNodeManifest(nodeId) {
|
|
@@ -91868,11 +91880,14 @@ var HubNodeRegistry = class {
|
|
|
91868
91880
|
//#region src/kernel/moleculer/register-node-client.ts
|
|
91869
91881
|
/**
|
|
91870
91882
|
* Build a `RegisterNodeParams` from a node id, its per-addon manifests,
|
|
91871
|
-
* optionally its device-scoped native caps,
|
|
91872
|
-
* of the cluster secret
|
|
91873
|
-
*
|
|
91883
|
+
* optionally its device-scoped native caps, optionally the SHA-256 hash
|
|
91884
|
+
* of the cluster secret, and optionally the node's root-package identity
|
|
91885
|
+
* (runtime-updatable node packages: version visibility). `nativeCaps` is
|
|
91886
|
+
* omitted entirely on the first handshake; `clusterSecretHash` is omitted
|
|
91887
|
+
* when no secret is configured; `rootPackage` is omitted by nodes that do
|
|
91888
|
+
* not run the root-package model (UDS children).
|
|
91874
91889
|
*/
|
|
91875
|
-
function buildNodeManifest(nodeId, addons, nativeCaps, clusterSecretHash) {
|
|
91890
|
+
function buildNodeManifest(nodeId, addons, nativeCaps, clusterSecretHash, rootPackage) {
|
|
91876
91891
|
return {
|
|
91877
91892
|
nodeId,
|
|
91878
91893
|
addons: addons.map((a) => ({
|
|
@@ -91884,7 +91899,11 @@ function buildNodeManifest(nodeId, addons, nativeCaps, clusterSecretHash) {
|
|
|
91884
91899
|
addonId: n.addonId,
|
|
91885
91900
|
deviceIds: [...n.deviceIds]
|
|
91886
91901
|
})) },
|
|
91887
|
-
...clusterSecretHash === void 0 ? {} : { clusterSecretHash }
|
|
91902
|
+
...clusterSecretHash === void 0 ? {} : { clusterSecretHash },
|
|
91903
|
+
...rootPackage === void 0 ? {} : { rootPackage: {
|
|
91904
|
+
name: rootPackage.name,
|
|
91905
|
+
version: rootPackage.version
|
|
91906
|
+
} }
|
|
91888
91907
|
};
|
|
91889
91908
|
}
|
|
91890
91909
|
function delay(ms, signal) {
|
package/dist/index.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { $ as errMsg$1, A as isVoidInput, Ct as resolveCapMount, F as looseSchema, M as lifecycleJobSchema, O as isArrayOutputSchema, St as readinessKey, V as procedureAuthKey, _t as expandCapMethods, bt as parseJsonObject, ct as ReadinessRegistry, dt as asJsonObject$1, ft as asNumber, ht as emitDownForOwnedCaps, j as kebabToCamel, k as isObjectInput, lt as ReadinessTimeoutError, mt as createEvent, nt as DEVICE_SETTINGS_CONTRIBUTION_METHODS, o as METHOD_ACCESS_MAP, p as addonSettingsCapability, pt as asString$1, rt as DEVICE_STATUS_METHOD, s as RUNTIME_DEFAULTS, st as EventCategory$1, t as ALL_CAPABILITY_DEFINITIONS, tt as DATAPLANE_SECRET_HEADER$1, wt as scopeKey, xt as parseJsonUnknown$1 } from "./dist-
|
|
1
|
+
import { $ as errMsg$1, A as isVoidInput, Ct as resolveCapMount, F as looseSchema, M as lifecycleJobSchema, O as isArrayOutputSchema, St as readinessKey, V as procedureAuthKey, _t as expandCapMethods, bt as parseJsonObject, ct as ReadinessRegistry, dt as asJsonObject$1, ft as asNumber, ht as emitDownForOwnedCaps, j as kebabToCamel, k as isObjectInput, lt as ReadinessTimeoutError, mt as createEvent, nt as DEVICE_SETTINGS_CONTRIBUTION_METHODS, o as METHOD_ACCESS_MAP, p as addonSettingsCapability, pt as asString$1, rt as DEVICE_STATUS_METHOD, s as RUNTIME_DEFAULTS, st as EventCategory$1, t as ALL_CAPABILITY_DEFINITIONS, tt as DATAPLANE_SECRET_HEADER$1, wt as scopeKey, xt as parseJsonUnknown$1 } from "./dist-CU3lb_Ys.mjs";
|
|
2
2
|
import { a as downloadModel, c as getModelFilePath, d as contentTypeFor, f as createAuthenticatedFileServer, h as resolveFilePath, i as downloadFile, l as isModelDownloaded, m as parseTokenizedUrl, n as collectModelFiles, o as ensureModel, p as parseRangeHeader, r as deleteModelFromDisk, s as fetchJson, t as ModelDownloadService, u as createFileDataPlaneHandler } from "./model-download-service-C-IHWnXx.mjs";
|
|
3
3
|
import { n as getSinglePidStats, t as getPidStats } from "./resource-monitor-Le3l0qS2.mjs";
|
|
4
4
|
import { FilesystemStorageAddon, t as FilesystemStorageProvider } from "./builtins/sqlite-storage/filesystem-storage.addon.mjs";
|
|
@@ -19,7 +19,7 @@ import { LocalAuthAddon, a as require_ms, c as __esmMin, d as __toCommonJS, f as
|
|
|
19
19
|
import "./builtins/local-auth/index.mjs";
|
|
20
20
|
import { DeviceManagerAddon } from "./builtins/device-manager/device-manager.addon.mjs";
|
|
21
21
|
import "./builtins/device-manager/index.mjs";
|
|
22
|
-
import { $ as buildUdsNativeCapProxy, A as createParentUnownedCallHandler, B as AGENT_CAP_FWD_SERVICE, C as buildLinkChain, D as HUB_CAP_FWD_ACTION, E as localProviderLink, F as createUdsLoggerWithControl, G as createLocalTransport, H as CapRouteError, I as LocalChildClient, J as SocketChannel, K as UdsLocalTransportClient, L as LocalChildRegistry, M as createUdsEventBus, N as udsChildLogToWorkerEntry, O as HUB_CAP_FWD_SERVICE, P as createUdsLogger, Q as buildNativeCapProxy, R as UDS_NO_ROUTE_PREFIX, S as brokerTransportLink, T as ipcParentLink, U as classifyCapRoute, V as CapRouteResolver, W as callWithServiceDiscovery, X as FrameDecoder, Y as localEndpointPath, Z as encodeFrame, _ as resolveHwAccel, _t as CapabilityUnavailableError, a as getWorkerDeviceRegistry, at as createAddonService, b as getCapUsageRegistry, c as setHubConnected, ct as capActionName, d as getMoleculerEventStats, dt as capServiceName, et as createBrokerDeviceManagerApi, f as registerEventBusService, ft as parseCapAction, g as createKernelHwAccel, gt as CapabilityHandle, h as AddonDepsManager, ht as DeviceRegistry, i as createUdsAddonContext, j as createUdsEventBridge, k as createHubCapForwardService, l as EVENT_TOPIC_PREFIX, lt as capActionSuffix, m as subscribePassthrough, mt as serializeTypedArrays, n as adaptBrokerToCluster, o as getOrInitReadinessRegistry, ot as validateProviderRegistrations, p as setNodeEventInterest, pt as deserializeTypedArrays, q as UdsLocalTransportServer, r as createAddonContext, rt as mountNativeCapService, s as getOrInitReadinessRegistryForClient, st as NATIVE_PROVIDER_SERVICE_INFIX, t as installManifestPythonDeps, u as getBrokerEventBus, ut as capBareAction, v as CapUsageRegistry, vt as installManifestNativeDeps, w as ipcChildLink, x as brokerCallForCap, y as __resetCapUsageRegistryForTests, yt as resolveAddonClass, z as AGENT_CAP_FWD_ACTION } from "./manifest-python-deps-
|
|
22
|
+
import { $ as buildUdsNativeCapProxy, A as createParentUnownedCallHandler, B as AGENT_CAP_FWD_SERVICE, C as buildLinkChain, D as HUB_CAP_FWD_ACTION, E as localProviderLink, F as createUdsLoggerWithControl, G as createLocalTransport, H as CapRouteError, I as LocalChildClient, J as SocketChannel, K as UdsLocalTransportClient, L as LocalChildRegistry, M as createUdsEventBus, N as udsChildLogToWorkerEntry, O as HUB_CAP_FWD_SERVICE, P as createUdsLogger, Q as buildNativeCapProxy, R as UDS_NO_ROUTE_PREFIX, S as brokerTransportLink, T as ipcParentLink, U as classifyCapRoute, V as CapRouteResolver, W as callWithServiceDiscovery, X as FrameDecoder, Y as localEndpointPath, Z as encodeFrame, _ as resolveHwAccel, _t as CapabilityUnavailableError, a as getWorkerDeviceRegistry, at as createAddonService, b as getCapUsageRegistry, c as setHubConnected, ct as capActionName, d as getMoleculerEventStats, dt as capServiceName, et as createBrokerDeviceManagerApi, f as registerEventBusService, ft as parseCapAction, g as createKernelHwAccel, gt as CapabilityHandle, h as AddonDepsManager, ht as DeviceRegistry, i as createUdsAddonContext, j as createUdsEventBridge, k as createHubCapForwardService, l as EVENT_TOPIC_PREFIX, lt as capActionSuffix, m as subscribePassthrough, mt as serializeTypedArrays, n as adaptBrokerToCluster, o as getOrInitReadinessRegistry, ot as validateProviderRegistrations, p as setNodeEventInterest, pt as deserializeTypedArrays, q as UdsLocalTransportServer, r as createAddonContext, rt as mountNativeCapService, s as getOrInitReadinessRegistryForClient, st as NATIVE_PROVIDER_SERVICE_INFIX, t as installManifestPythonDeps, u as getBrokerEventBus, ut as capBareAction, v as CapUsageRegistry, vt as installManifestNativeDeps, w as ipcChildLink, x as brokerCallForCap, y as __resetCapUsageRegistryForTests, yt as resolveAddonClass, z as AGENT_CAP_FWD_ACTION } from "./manifest-python-deps-4QvOLiBn.mjs";
|
|
23
23
|
import { t as CustomActionRegistry } from "./custom-action-registry-BEXwC-oo.mjs";
|
|
24
24
|
import { PYTHON_VERSION, buildBinaryPath, downloadBinary, ensureBinary, ensureFfmpeg, ensurePython, findInPath, getFfmpegDownloadUrl, getPlatformInfo, getPythonDownloadUrl, installPythonPackages, installPythonRequirements } from "@camstack/types/node";
|
|
25
25
|
import { z } from "zod";
|
|
@@ -91743,6 +91743,8 @@ var HubNodeRegistry = class {
|
|
|
91743
91743
|
nodes = /* @__PURE__ */ new Map();
|
|
91744
91744
|
/** nodeId → its device-scoped native caps (last `registerNode` wins). */
|
|
91745
91745
|
nativeCaps = /* @__PURE__ */ new Map();
|
|
91746
|
+
/** nodeId → its root-package identity (last `registerNode` wins). */
|
|
91747
|
+
rootPackages = /* @__PURE__ */ new Map();
|
|
91746
91748
|
/**
|
|
91747
91749
|
* deviceId → flat native-cap entries for THAT device, across all nodes.
|
|
91748
91750
|
* Maintained incrementally on every `registerNode`/`removeNode` so a
|
|
@@ -91790,6 +91792,11 @@ var HubNodeRegistry = class {
|
|
|
91790
91792
|
deviceIds: [...n.deviceIds]
|
|
91791
91793
|
}));
|
|
91792
91794
|
this.nativeCaps.set(params.nodeId, caps);
|
|
91795
|
+
if (params.rootPackage !== void 0) this.rootPackages.set(params.nodeId, {
|
|
91796
|
+
name: params.rootPackage.name,
|
|
91797
|
+
version: params.rootPackage.version
|
|
91798
|
+
});
|
|
91799
|
+
else this.rootPackages.delete(params.nodeId);
|
|
91793
91800
|
for (const cap of caps) for (const deviceId of cap.deviceIds) {
|
|
91794
91801
|
const entry = {
|
|
91795
91802
|
nodeId: params.nodeId,
|
|
@@ -91807,6 +91814,11 @@ var HubNodeRegistry = class {
|
|
|
91807
91814
|
this.dropNodeFromDeviceIndex(nodeId);
|
|
91808
91815
|
this.nodes.delete(nodeId);
|
|
91809
91816
|
this.nativeCaps.delete(nodeId);
|
|
91817
|
+
this.rootPackages.delete(nodeId);
|
|
91818
|
+
}
|
|
91819
|
+
/** The node's root-package identity, or null when it never reported one. */
|
|
91820
|
+
getNodeRootPackage(nodeId) {
|
|
91821
|
+
return this.rootPackages.get(nodeId) ?? null;
|
|
91810
91822
|
}
|
|
91811
91823
|
/** The node's manifest, or undefined when the node never registered. */
|
|
91812
91824
|
getNodeManifest(nodeId) {
|
|
@@ -91860,11 +91872,14 @@ var HubNodeRegistry = class {
|
|
|
91860
91872
|
//#region src/kernel/moleculer/register-node-client.ts
|
|
91861
91873
|
/**
|
|
91862
91874
|
* Build a `RegisterNodeParams` from a node id, its per-addon manifests,
|
|
91863
|
-
* optionally its device-scoped native caps,
|
|
91864
|
-
* of the cluster secret
|
|
91865
|
-
*
|
|
91875
|
+
* optionally its device-scoped native caps, optionally the SHA-256 hash
|
|
91876
|
+
* of the cluster secret, and optionally the node's root-package identity
|
|
91877
|
+
* (runtime-updatable node packages: version visibility). `nativeCaps` is
|
|
91878
|
+
* omitted entirely on the first handshake; `clusterSecretHash` is omitted
|
|
91879
|
+
* when no secret is configured; `rootPackage` is omitted by nodes that do
|
|
91880
|
+
* not run the root-package model (UDS children).
|
|
91866
91881
|
*/
|
|
91867
|
-
function buildNodeManifest(nodeId, addons, nativeCaps, clusterSecretHash) {
|
|
91882
|
+
function buildNodeManifest(nodeId, addons, nativeCaps, clusterSecretHash, rootPackage) {
|
|
91868
91883
|
return {
|
|
91869
91884
|
nodeId,
|
|
91870
91885
|
addons: addons.map((a) => ({
|
|
@@ -91876,7 +91891,11 @@ function buildNodeManifest(nodeId, addons, nativeCaps, clusterSecretHash) {
|
|
|
91876
91891
|
addonId: n.addonId,
|
|
91877
91892
|
deviceIds: [...n.deviceIds]
|
|
91878
91893
|
})) },
|
|
91879
|
-
...clusterSecretHash === void 0 ? {} : { clusterSecretHash }
|
|
91894
|
+
...clusterSecretHash === void 0 ? {} : { clusterSecretHash },
|
|
91895
|
+
...rootPackage === void 0 ? {} : { rootPackage: {
|
|
91896
|
+
name: rootPackage.name,
|
|
91897
|
+
version: rootPackage.version
|
|
91898
|
+
} }
|
|
91880
91899
|
};
|
|
91881
91900
|
}
|
|
91882
91901
|
function delay(ms, signal) {
|
package/dist/kernel/index.d.ts
CHANGED
|
@@ -39,7 +39,7 @@ export { HubLogForwarder } from './moleculer/hub-log-forwarder.js';
|
|
|
39
39
|
export type { AddonContextOptions } from './moleculer/addon-context-factory.js';
|
|
40
40
|
export { createHubService } from './moleculer/hub-service.js';
|
|
41
41
|
export { HubNodeRegistry } from './moleculer/node-registry.js';
|
|
42
|
-
export type { CallFn, RegisteredAddonManifest, RegisteredNativeCap, RegisterNodeParams, RegisterNodeResult, NodeCapEntry, NodeNativeCapEntry, } from './moleculer/node-registry.js';
|
|
42
|
+
export type { CallFn, NodeRootPackageInfo, RegisteredAddonManifest, RegisteredNativeCap, RegisterNodeParams, RegisterNodeResult, NodeCapEntry, NodeNativeCapEntry, } from './moleculer/node-registry.js';
|
|
43
43
|
export { callRegisterNodeWithRetry, buildNodeManifest } from './moleculer/register-node-client.js';
|
|
44
44
|
export type { RegisterNodeBroker, CallRegisterNodeOptions, } from './moleculer/register-node-client.js';
|
|
45
45
|
export { hashClusterSecret, clusterSecretMatches, isClusterSecretMismatchError, CLUSTER_SECRET_MISMATCH_TYPE, CLUSTER_SECRET_REJECTED_EXIT_CODE, } from './moleculer/cluster-secret.js';
|
|
@@ -32,6 +32,17 @@ interface RegisteredNativeCap {
|
|
|
32
32
|
readonly addonId: string;
|
|
33
33
|
readonly deviceIds: readonly number[];
|
|
34
34
|
}
|
|
35
|
+
/**
|
|
36
|
+
* A node's runtime-updatable ROOT package identity (`@camstack/server` on
|
|
37
|
+
* the hub, `@camstack/agent` on agents) — carried in the `registerNode`
|
|
38
|
+
* manifest so the hub knows every node's exact software version (design:
|
|
39
|
+
* runtime-updatable node packages, "visibility"). Version skew is SEEN in
|
|
40
|
+
* the UI instead of discovered via a black-hole.
|
|
41
|
+
*/
|
|
42
|
+
interface NodeRootPackageInfo {
|
|
43
|
+
readonly name: string;
|
|
44
|
+
readonly version: string;
|
|
45
|
+
}
|
|
35
46
|
/** Payload of the `$hub.registerNode` RPC — a node's COMPLETE manifest. */
|
|
36
47
|
interface RegisterNodeParams {
|
|
37
48
|
readonly nodeId: string;
|
|
@@ -50,6 +61,12 @@ interface RegisterNodeParams {
|
|
|
50
61
|
* receiver; never carries the raw secret. (Cluster-secret registration gate.)
|
|
51
62
|
*/
|
|
52
63
|
readonly clusterSecretHash?: string;
|
|
64
|
+
/**
|
|
65
|
+
* The node's root-package identity. Optional — absent from UDS child
|
|
66
|
+
* manifests and pre-phase-2 agents; present on agents running the
|
|
67
|
+
* runtime-updatable root model.
|
|
68
|
+
*/
|
|
69
|
+
readonly rootPackage?: NodeRootPackageInfo;
|
|
53
70
|
}
|
|
54
71
|
/** Ack returned by `$hub.registerNode` — presence of `ok` is the signal. */
|
|
55
72
|
interface RegisterNodeResult {
|
|
@@ -73,6 +90,8 @@ declare class HubNodeRegistry {
|
|
|
73
90
|
private readonly nodes;
|
|
74
91
|
/** nodeId → its device-scoped native caps (last `registerNode` wins). */
|
|
75
92
|
private readonly nativeCaps;
|
|
93
|
+
/** nodeId → its root-package identity (last `registerNode` wins). */
|
|
94
|
+
private readonly rootPackages;
|
|
76
95
|
/**
|
|
77
96
|
* deviceId → flat native-cap entries for THAT device, across all nodes.
|
|
78
97
|
* Maintained incrementally on every `registerNode`/`removeNode` so a
|
|
@@ -99,6 +118,8 @@ declare class HubNodeRegistry {
|
|
|
99
118
|
registerNode(params: RegisterNodeParams): void;
|
|
100
119
|
/** Drop a node entirely — caps AND native caps — on `$node.disconnected`. */
|
|
101
120
|
removeNode(nodeId: string): void;
|
|
121
|
+
/** The node's root-package identity, or null when it never reported one. */
|
|
122
|
+
getNodeRootPackage(nodeId: string): NodeRootPackageInfo | null;
|
|
102
123
|
/** The node's manifest, or undefined when the node never registered. */
|
|
103
124
|
getNodeManifest(nodeId: string): readonly RegisteredAddonManifest[] | undefined;
|
|
104
125
|
/**
|
|
@@ -123,4 +144,4 @@ declare class HubNodeRegistry {
|
|
|
123
144
|
listNodeIds(): readonly string[];
|
|
124
145
|
}
|
|
125
146
|
export { HubNodeRegistry };
|
|
126
|
-
export type { CallFn, RegisteredAddonManifest, RegisteredNativeCap, RegisterNodeParams, RegisterNodeResult, NodeCapEntry, NodeNativeCapEntry, };
|
|
147
|
+
export type { CallFn, NodeRootPackageInfo, RegisteredAddonManifest, RegisteredNativeCap, RegisterNodeParams, RegisterNodeResult, NodeCapEntry, NodeNativeCapEntry, };
|