@camstack/system 1.2.434 → 1.2.436

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.
Files changed (103) hide show
  1. package/dist/builtins/addon-pages-aggregator/addon-pages-aggregator.addon.js +1 -1
  2. package/dist/builtins/addon-pages-aggregator/addon-pages-aggregator.addon.mjs +1 -1
  3. package/dist/builtins/addon-widgets-aggregator/addon-widgets-aggregator.addon.js +1 -1
  4. package/dist/builtins/addon-widgets-aggregator/addon-widgets-aggregator.addon.mjs +1 -1
  5. package/dist/builtins/alerts/alerts.addon.js +1 -1
  6. package/dist/builtins/alerts/alerts.addon.mjs +1 -1
  7. package/dist/builtins/autotrack/index.js +1 -1
  8. package/dist/builtins/autotrack/index.mjs +1 -1
  9. package/dist/builtins/backup-orchestrator/backup-orchestrator.addon.js +2 -2
  10. package/dist/builtins/backup-orchestrator/backup-orchestrator.addon.mjs +2 -2
  11. package/dist/builtins/calendars/calendars.addon.js +1 -1
  12. package/dist/builtins/calendars/calendars.addon.mjs +1 -1
  13. package/dist/builtins/camera-grid/index.js +1 -1
  14. package/dist/builtins/camera-grid/index.mjs +1 -1
  15. package/dist/builtins/composer/composer.addon.js +2 -2
  16. package/dist/builtins/composer/composer.addon.mjs +2 -2
  17. package/dist/builtins/console-logging/index.js +1 -1
  18. package/dist/builtins/console-logging/index.mjs +1 -1
  19. package/dist/builtins/core-blocks/core-blocks.addon.js +2 -2
  20. package/dist/builtins/core-blocks/core-blocks.addon.mjs +2 -2
  21. package/dist/builtins/device-manager/device-manager.addon.js +2 -2
  22. package/dist/builtins/device-manager/device-manager.addon.mjs +2 -2
  23. package/dist/builtins/hub-forwarder/index.js +1 -1
  24. package/dist/builtins/hub-forwarder/index.mjs +1 -1
  25. package/dist/builtins/keychain/index.js +6 -7
  26. package/dist/builtins/keychain/index.mjs +6 -7
  27. package/dist/builtins/keychain/keychain-service.d.ts +1 -2
  28. package/dist/builtins/keychain/system-held-secrets.d.ts +5 -5
  29. package/dist/builtins/liveness-monitor/liveness-monitor.addon.js +1 -1
  30. package/dist/builtins/liveness-monitor/liveness-monitor.addon.mjs +1 -1
  31. package/dist/builtins/local-auth/local-auth.addon.js +2 -2
  32. package/dist/builtins/local-auth/local-auth.addon.mjs +2 -2
  33. package/dist/builtins/local-network/local-network.addon.d.ts +4 -2
  34. package/dist/builtins/local-network/local-network.addon.js +23 -13
  35. package/dist/builtins/local-network/local-network.addon.mjs +23 -13
  36. package/dist/builtins/loki-logging/index.js +1 -1
  37. package/dist/builtins/loki-logging/index.mjs +1 -1
  38. package/dist/builtins/native-metrics/native-metrics.addon.js +1 -1
  39. package/dist/builtins/native-metrics/native-metrics.addon.mjs +1 -1
  40. package/dist/builtins/platform-probe/index.js +1 -1
  41. package/dist/builtins/platform-probe/index.mjs +1 -1
  42. package/dist/builtins/remote-access-orchestrator/remote-access-orchestrator.addon.js +1 -1
  43. package/dist/builtins/remote-access-orchestrator/remote-access-orchestrator.addon.mjs +1 -1
  44. package/dist/builtins/snapshot/index.js +1 -1
  45. package/dist/builtins/snapshot/index.mjs +1 -1
  46. package/dist/builtins/sqlite-storage/filesystem-storage.addon.js +1 -1
  47. package/dist/builtins/sqlite-storage/filesystem-storage.addon.mjs +1 -1
  48. package/dist/builtins/sqlite-storage/index.js +1 -1
  49. package/dist/builtins/sqlite-storage/index.mjs +1 -1
  50. package/dist/builtins/sqlite-storage/sqlite-settings.addon.js +3 -3
  51. package/dist/builtins/sqlite-storage/sqlite-settings.addon.mjs +3 -3
  52. package/dist/builtins/storage-orchestrator/storage-orchestrator.addon.js +1 -1
  53. package/dist/builtins/storage-orchestrator/storage-orchestrator.addon.mjs +1 -1
  54. package/dist/builtins/system-config/system-config.addon.d.ts +3 -24
  55. package/dist/builtins/system-config/system-config.addon.js +105 -1410
  56. package/dist/builtins/system-config/system-config.addon.mjs +108 -1402
  57. package/dist/builtins/winston-logging/index.js +1 -1
  58. package/dist/builtins/winston-logging/index.mjs +1 -1
  59. package/dist/{composition-sources-B7R1oQnY.js → composition-sources-BAOlCu4j.js} +1 -1
  60. package/dist/{composition-sources-CqrDyHM1.mjs → composition-sources-gN_BWUKp.mjs} +1 -1
  61. package/dist/constants-BFpowodq.mjs +20 -0
  62. package/dist/constants-GENKqk9k.js +66 -0
  63. package/dist/{device-ca-CDjGQQPd.mjs → device-ca-BNM5ai4t.mjs} +1 -1
  64. package/dist/{device-ca-D21ZP00q.js → device-ca-CuWuRW9N.js} +1 -1
  65. package/dist/{dist-CCH3XPqO.js → dist-DVe0Nsp8.js} +48 -16
  66. package/dist/{dist-CYcBqnXk.mjs → dist-DjD2M79P.mjs} +43 -5
  67. package/dist/file-host-worker.js +1 -1
  68. package/dist/file-host-worker.mjs +1 -1
  69. package/dist/index.js +132 -795
  70. package/dist/index.mjs +133 -753
  71. package/dist/kernel/index.d.ts +7 -21
  72. package/dist/kernel/moleculer/agent-ui-unlock.d.ts +7 -32
  73. package/dist/kernel/moleculer/broker-factory.d.ts +3 -9
  74. package/dist/kernel/moleculer/broker-transport-swap.d.ts +17 -0
  75. package/dist/kernel/moleculer/hub-service.d.ts +6 -16
  76. package/dist/kernel/moleculer/mesh-access-middleware.d.ts +7 -17
  77. package/dist/kernel/moleculer/mesh-identity.d.ts +57 -0
  78. package/dist/kernel/moleculer/mesh-mtls/constants.d.ts +1 -4
  79. package/dist/kernel/moleculer/mesh-mtls/index.d.ts +1 -4
  80. package/dist/kernel/moleculer/mesh-mtls/mesh-ca.d.ts +1 -1
  81. package/dist/kernel/moleculer/mesh-mtls/mesh-renewal.d.ts +1 -1
  82. package/dist/kernel/moleculer/node-registry.d.ts +0 -6
  83. package/dist/kernel/moleculer/register-node-client.d.ts +9 -7
  84. package/dist/{restore-archive-5ml7uYMf.mjs → restore-archive-BxmP1ChO.mjs} +1 -1
  85. package/dist/{restore-archive-Do0QwAik.js → restore-archive-D4h904rb.js} +1 -1
  86. package/dist/{retired-settings-keys-CyDdyjLP.mjs → retired-settings-keys-CQaknvx1.mjs} +1 -1
  87. package/dist/{retired-settings-keys-CEiCaI_j.js → retired-settings-keys-CYP5IZJ5.js} +1 -1
  88. package/dist/{wal-maintenance-LZYd8iT-.js → wal-maintenance-Br60onAQ.js} +0 -0
  89. package/dist/{wal-maintenance-DgLLPK14.mjs → wal-maintenance-CaDsrJM_.mjs} +0 -0
  90. package/package.json +1 -1
  91. package/dist/builtins/system-config/cluster-secret-keeper.d.ts +0 -63
  92. package/dist/constants-CrMPWOug.mjs +0 -102
  93. package/dist/constants-CuOfMdYe.js +0 -221
  94. package/dist/kernel/moleculer/agent-mesh-authenticator.d.ts +0 -91
  95. package/dist/kernel/moleculer/cluster-secret.d.ts +0 -46
  96. package/dist/kernel/moleculer/mesh-auth-mode.d.ts +0 -58
  97. package/dist/kernel/moleculer/mesh-authenticator.d.ts +0 -77
  98. package/dist/kernel/moleculer/mesh-auto-enforce.d.ts +0 -46
  99. package/dist/kernel/moleculer/mesh-join-client.d.ts +0 -73
  100. package/dist/kernel/moleculer/mesh-join-hold.d.ts +0 -85
  101. package/dist/kernel/moleculer/mesh-join-proof.d.ts +0 -39
  102. package/dist/kernel/moleculer/mesh-mtls/mesh-enroll.d.ts +0 -34
  103. package/dist/kernel/moleculer/mesh-mtls/mesh-join-token.d.ts +0 -56
@@ -1,85 +0,0 @@
1
- /**
2
- * What an agent does with the hub's events and calls that arrive BEFORE its
3
- * mesh join has settled (D848 §3).
4
- *
5
- * The agent's inbound gate admits the hub only once the mutual join has
6
- * proven it (`AgentMeshAuthenticator`, D802). The hub, though, starts sending
7
- * the moment it sees the agent's connection — a one-shot event broadcast at
8
- * that instant reached a gate that had not yet heard the join's answer, and
9
- * was refused: dropped, with only a rate-limited "mesh event refused" line.
10
- * An ordering fix on the hub cannot close it: the agent verifies the hub's
11
- * proof asynchronously, after the answer that carries it, so even an event
12
- * the hub sends strictly after its answer can be decoded first.
13
- *
14
- * So the agent HOLDS what the hub sends while a join is in flight, and
15
- * decides when the join decides:
16
- * - the join proves the hub → everything held is delivered, in arrival order;
17
- * - the join fails (mismatch, unverified hub, no answer) → everything held is
18
- * refused, and said so with the count;
19
- * - the bound runs out first ({@link MeshJoinHoldOptions.maxHoldMs} since the
20
- * first item was held) → refused and said so, and nothing more is held until
21
- * the next join starts;
22
- * - more than {@link MeshJoinHoldOptions.maxHeld} items → the excess is refused
23
- * on arrival and counted into the next report.
24
- *
25
- * The timer is the bound itself, never a wait for a node (D3): delivery is
26
- * driven by the join settling. Nothing held is ever dropped without a report
27
- * (D49).
28
- */
29
- import type { MeshCallVerdict } from "./mesh-authenticator.js";
30
- /** The gate cannot answer yet: the request waits for the join. */
31
- export interface MeshHeldVerdict {
32
- readonly verdict: "hold";
33
- readonly settled: Promise<MeshCallVerdict>;
34
- }
35
- /** Every verdict a mesh gate may give (`MeshCallGate`). */
36
- export type MeshGateVerdict = MeshCallVerdict | MeshHeldVerdict;
37
- export type MeshHeldKind = "call" | "event";
38
- export interface MeshJoinHoldReport {
39
- /** `delivered` when the join proved the hub, else `refused`. */
40
- readonly outcome: "delivered" | "refused";
41
- /** `authenticated`, the failed join state, or `bound` (time ran out). */
42
- readonly reason: string;
43
- readonly events: number;
44
- readonly calls: number;
45
- /** Refused on arrival because the hold was full. */
46
- readonly overflow: number;
47
- /** From the first held item to the decision. */
48
- readonly heldForMs: number;
49
- }
50
- export interface MeshJoinHoldOptions {
51
- readonly hubNodeId: string;
52
- /** Most items held at once (default 1000). */
53
- readonly maxHeld?: number;
54
- /** Longest an item is held, from the first one (default 15 s). */
55
- readonly maxHoldMs?: number;
56
- readonly now?: () => number;
57
- readonly onReport?: (report: MeshJoinHoldReport) => void;
58
- }
59
- export declare const DEFAULT_MESH_JOIN_MAX_HELD = 1e3;
60
- export declare const DEFAULT_MESH_JOIN_MAX_HOLD_MS = 15e3;
61
- export declare class MeshJoinHold {
62
- private readonly opts;
63
- private waiters;
64
- private firstHeldAt;
65
- private overflow;
66
- private timer;
67
- /** Holding is open while a join is in flight; closed after a decision or the bound. */
68
- private open;
69
- private readonly now;
70
- constructor(opts: MeshJoinHoldOptions);
71
- /** Whether a request arriving now would be held (a join is in flight). */
72
- get holding(): boolean;
73
- /** How many requests wait right now. */
74
- get size(): number;
75
- /** A join started: hold again. */
76
- reopen(): void;
77
- /** Hold one request; `null` when holding is closed (the caller refuses it). */
78
- hold(kind: MeshHeldKind): MeshHeldVerdict | null;
79
- /** The join proved the hub: deliver everything held, in order. */
80
- release(): void;
81
- /** The join failed, or the bound ran out: refuse everything held. */
82
- refuse(reason: string): void;
83
- private refusal;
84
- private settle;
85
- }
@@ -1,39 +0,0 @@
1
- /** Protocol version carried by the challenge; the agent refuses one it does not speak. */
2
- export declare const MESH_JOIN_PROTOCOL = 1;
3
- /** The hub's action that hands out a single-use nonce. */
4
- export declare const MESH_JOIN_CHALLENGE_ACTION = "$hub.joinChallenge";
5
- /** The hub's action that verifies a node's proof and answers with its own. */
6
- export declare const MESH_JOIN_AUTHENTICATE_ACTION = "$hub.authenticateNode";
7
- /** Moleculer error `type`: the sender has not authenticated and the hub enforces it. */
8
- export declare const MESH_NODE_UNAUTHENTICATED_TYPE = "MESH_NODE_UNAUTHENTICATED";
9
- /** Moleculer error `type`: the action is never callable from another node. */
10
- export declare const MESH_ACTION_FORBIDDEN_TYPE = "MESH_ACTION_FORBIDDEN";
11
- /** Moleculer error `type`: the challenge is unknown, used or expired — ask for a new one. */
12
- export declare const MESH_JOIN_CHALLENGE_INVALID_TYPE = "MESH_JOIN_CHALLENGE_INVALID";
13
- /** Answer of `$hub.joinChallenge`. */
14
- export interface MeshJoinChallenge {
15
- readonly protocol: number;
16
- readonly nonce: string;
17
- }
18
- /** Params of `$hub.authenticateNode`. */
19
- export interface MeshJoinAuthenticateParams {
20
- readonly nodeId: string;
21
- readonly nonce: string;
22
- readonly clientNonce: string;
23
- readonly proof: string;
24
- }
25
- /** Answer of `$hub.authenticateNode`. */
26
- export interface MeshJoinAuthenticateResult {
27
- readonly ok: true;
28
- readonly hubProof: string;
29
- }
30
- /** A fresh 32-byte nonce, hex. */
31
- export declare function createMeshNonce(): string;
32
- /** The node's answer to the hub's nonce. `secretHash` is `hashClusterSecret(secret)`. */
33
- export declare function computeNodeJoinProof(secretHash: string, nodeId: string, nonce: string): string;
34
- /** The hub's answer to the node's nonce — proves the hub holds the same secret. */
35
- export declare function computeHubJoinProof(secretHash: string, nodeId: string, nonce: string, clientNonce: string): string;
36
- /** Constant-time comparison of two hex proofs; any shape mismatch is `false`. */
37
- export declare function proofsEqual(expected: string, presented: unknown): boolean;
38
- /** Reads a Moleculer error's `type`, including after an RPC round-trip. */
39
- export declare function meshErrorType(err: unknown): string | null;
@@ -1,34 +0,0 @@
1
- /**
2
- * `POST /api/mesh/enroll` — verify join token, issue a 30-day leaf from CSR.
3
- */
4
- import { type MeshCaSigner } from "./mesh-ca.js";
5
- import { type JoinTokenJtiStore, type MeshJoinTokenClaims } from "./mesh-join-token.js";
6
- export interface MeshEnrollRequest {
7
- readonly token: string;
8
- readonly csr: string;
9
- }
10
- export interface MeshEnrollSuccess {
11
- readonly ok: true;
12
- readonly cert: string;
13
- readonly caCert: string;
14
- readonly nodeId: string;
15
- readonly notAfter: string;
16
- readonly serialNumber: string;
17
- }
18
- export interface MeshEnrollFailure {
19
- readonly ok: false;
20
- readonly error: string;
21
- readonly status: number;
22
- }
23
- export type MeshEnrollResult = MeshEnrollSuccess | MeshEnrollFailure;
24
- export interface EnrollMeshNodeDeps {
25
- readonly ca: MeshCaSigner;
26
- readonly jtiStore?: JoinTokenJtiStore;
27
- readonly now?: Date;
28
- /** Called with every leaf the hub issues, before the answer is returned (the registry write). */
29
- readonly onIssued?: (nodeId: string, certPem: string) => Promise<void>;
30
- /** The leaf is valid without its record; say it was not recorded (the node is observed on connect). */
31
- readonly onRecordFailed?: (nodeId: string, error: unknown) => void;
32
- }
33
- export declare function enrollMeshNode(body: MeshEnrollRequest, deps: EnrollMeshNodeDeps): Promise<MeshEnrollResult>;
34
- export type { MeshJoinTokenClaims };
@@ -1,56 +0,0 @@
1
- import { MESH_JOIN_TOKEN_VERSION } from "./constants.js";
2
- import { type MeshCaSigner } from "./mesh-ca.js";
3
- export interface MeshJoinTokenClaims {
4
- readonly v: typeof MESH_JOIN_TOKEN_VERSION;
5
- readonly hubUrl: string;
6
- readonly hubMeshAddress: string;
7
- readonly caFingerprint: string;
8
- readonly nodeId: string;
9
- readonly jti: string;
10
- readonly exp: number;
11
- }
12
- export type MeshJoinTokenVerifyResult = {
13
- readonly ok: true;
14
- readonly claims: MeshJoinTokenClaims;
15
- } | {
16
- readonly ok: false;
17
- readonly reason: string;
18
- };
19
- /** In-memory + optional persist of spent `jti` until `exp`. */
20
- export declare class JoinTokenJtiStore {
21
- private readonly spent;
22
- /** True when `jti` was already consumed (and not yet expired). */
23
- isSpent(jti: string, nowSec?: number): boolean;
24
- /** Record a jti as used until `exp`. Returns false if already spent. */
25
- consume(jti: string, exp: number, nowSec?: number): boolean;
26
- /** Test helper. */
27
- size(): number;
28
- private gc;
29
- }
30
- export declare function processJoinTokenJtiStore(): JoinTokenJtiStore;
31
- export interface MintJoinTokenInput {
32
- readonly ca: MeshCaSigner;
33
- readonly hubUrl: string;
34
- readonly hubMeshAddress: string;
35
- /** The node this token is for - mandatory. */
36
- readonly nodeId: string;
37
- /** Seconds from now; capped at {@link MESH_JOIN_TOKEN_MAX_TTL_SEC}. */
38
- readonly ttlSec?: number;
39
- readonly now?: Date;
40
- readonly jti?: string;
41
- }
42
- export declare function mintMeshJoinToken(input: MintJoinTokenInput): Promise<string>;
43
- export interface VerifyJoinTokenInput {
44
- readonly token: string;
45
- readonly ca: MeshCaSigner;
46
- readonly jtiStore?: JoinTokenJtiStore;
47
- readonly now?: Date;
48
- /** When true (enroll), consume the jti. Mint-path verify may skip. */
49
- readonly consume?: boolean;
50
- /**
51
- * Expected CA fingerprint pin. When set, must match the token's
52
- * `caFingerprint` (and therefore this CA) — a MITM with another CA fails.
53
- */
54
- readonly expectedCaFingerprint?: string;
55
- }
56
- export declare function verifyMeshJoinToken(input: VerifyJoinTokenInput): Promise<MeshJoinTokenVerifyResult>;