@camstack/types 1.1.34 → 1.1.36

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 (32) hide show
  1. package/dist/addon.d.ts +2 -0
  2. package/dist/addon.js +2 -1
  3. package/dist/addon.mjs +2 -2
  4. package/dist/capabilities/addon-pages-source.cap.d.ts +4 -0
  5. package/dist/capabilities/addon-pages.cap.d.ts +4 -0
  6. package/dist/capabilities/addon-widgets-source.cap.d.ts +2 -0
  7. package/dist/capabilities/addon-widgets.cap.d.ts +2 -0
  8. package/dist/capabilities/index.d.ts +11 -3
  9. package/dist/capabilities/login-method.cap.d.ts +146 -0
  10. package/dist/capabilities/nodes.cap.d.ts +19 -1
  11. package/dist/capabilities/pipeline-executor.cap.d.ts +15 -61
  12. package/dist/capabilities/pipeline-orchestrator.cap.d.ts +31 -69
  13. package/dist/capabilities/server-management.cap.d.ts +194 -0
  14. package/dist/capabilities/viewer-ui.cap.d.ts +24 -0
  15. package/dist/generated/addon-api.d.ts +516 -170
  16. package/dist/generated/capability-router-map.d.ts +13 -4
  17. package/dist/generated/device-proxy.d.ts +1 -1
  18. package/dist/generated/method-access-map.d.ts +1 -1
  19. package/dist/generated/system-proxy.d.ts +4 -2
  20. package/dist/index.d.ts +2 -1
  21. package/dist/index.js +430 -124
  22. package/dist/index.mjs +415 -123
  23. package/dist/interfaces/addon.d.ts +12 -2
  24. package/dist/interfaces/capability.d.ts +3 -0
  25. package/dist/interfaces/config-ui.d.ts +40 -0
  26. package/dist/interfaces/event-bus.d.ts +11 -0
  27. package/dist/interfaces/pipeline-executor-capability.d.ts +2 -8
  28. package/dist/interfaces/pipeline-orchestrator-capability.d.ts +0 -14
  29. package/dist/{sleep-DmP-uxoe.js → sleep-BtS3xMHv.js} +109 -9
  30. package/dist/{sleep-Cc14_yxc.mjs → sleep-DJaTV2D7.mjs} +86 -10
  31. package/dist/types/agent-pipeline-settings.d.ts +8 -0
  32. package/package.json +1 -1
@@ -0,0 +1,194 @@
1
+ import { z } from 'zod';
2
+ import { type InferProvider } from './capability-definition.js';
3
+ /**
4
+ * server-management — per-NODE singleton capability for a node's ROOT
5
+ * package lifecycle (runtime-updatable node packages, phase 2: hub + docker
6
+ * agents).
7
+ *
8
+ * Each node's root package (`@camstack/server` on the hub, `@camstack/agent`
9
+ * on agents) carries the whole software stack in its npm dep tree, so ONE
10
+ * version describes the node. Updates install into
11
+ * `<dataDir>/server-root/versions/<v>/` and apply on restart via the baked
12
+ * starter (probation boot + auto-rollback to N-1).
13
+ *
14
+ * Providers:
15
+ * - HUB: `ServerUpdateService` behind the `server-provided` mount
16
+ * (`buildServerProviders` in trpc.router.ts) — the default target for
17
+ * unpinned calls.
18
+ * - AGENT: `AgentUpdateService` registered by the agent bootstrap under
19
+ * the synthetic `agent-runtime` addonId and declared in the agent's
20
+ * `$hub.registerNode` manifest.
21
+ *
22
+ * Node routing: singleton caps get the codegen/runtime-builder `nodeId`
23
+ * injection on every method — `input.nodeId` (or `nodePin(nodeId)` from the
24
+ * SDK) routes the call to that node's provider via the standard remote
25
+ * proxy (`createCapabilityProxy` → `$agent-cap-fwd` → the agent's
26
+ * in-process provider lookup). No `nodeId` → the hub's own provider.
27
+ *
28
+ * Spec: docs/superpowers/specs/2026-07-12-runtime-updatable-node-packages-design.md
29
+ */
30
+ /**
31
+ * Where the running hub's code was loaded from:
32
+ * - `workspace` — dev checkout (tsx / workspace dist); the starter defers to
33
+ * plain resolution and runtime updates are refused.
34
+ * - `baked` — the immutable image seed closure (no data-dir root active).
35
+ * - `data-root` — the runtime-updatable `<dataDir>/server-root` closure.
36
+ */
37
+ declare const ServerBootModeSchema: z.ZodEnum<{
38
+ workspace: "workspace";
39
+ baked: "baked";
40
+ "data-root": "data-root";
41
+ }>;
42
+ /**
43
+ * Update lifecycle state:
44
+ * - `idle` / `checking` / `staging` — steady / in-flight registry work.
45
+ * - `pending-restart` — a version is staged and the node has NOT yet
46
+ * restarted onto it (still running the OLD version).
47
+ * - `awaiting-confirmation` — the node HAS restarted onto the staged version
48
+ * (it is the active probation boot) and is waiting to confirm boot-health.
49
+ * Apply/rollback are refused in this state and the node must NOT be
50
+ * manually restarted, or the probation boot auto-rolls-back.
51
+ */
52
+ declare const ServerUpdateStateSchema: z.ZodEnum<{
53
+ idle: "idle";
54
+ checking: "checking";
55
+ staging: "staging";
56
+ "pending-restart": "pending-restart";
57
+ "awaiting-confirmation": "awaiting-confirmation";
58
+ }>;
59
+ declare const ServerRollbackInfoSchema: z.ZodObject<{
60
+ fromVersion: z.ZodString;
61
+ toVersion: z.ZodNullable<z.ZodString>;
62
+ atMs: z.ZodNumber;
63
+ reason: z.ZodString;
64
+ }, z.core.$strip>;
65
+ declare const ServerPackageStatusSchema: z.ZodObject<{
66
+ packageName: z.ZodString;
67
+ runningVersion: z.ZodNullable<z.ZodString>;
68
+ nodeRuntimeVersion: z.ZodNullable<z.ZodString>;
69
+ activeVersion: z.ZodNullable<z.ZodString>;
70
+ previousVersion: z.ZodNullable<z.ZodString>;
71
+ seedVersion: z.ZodNullable<z.ZodString>;
72
+ latestVersion: z.ZodNullable<z.ZodString>;
73
+ updateAvailable: z.ZodBoolean;
74
+ bootMode: z.ZodEnum<{
75
+ workspace: "workspace";
76
+ baked: "baked";
77
+ "data-root": "data-root";
78
+ }>;
79
+ updateState: z.ZodEnum<{
80
+ idle: "idle";
81
+ checking: "checking";
82
+ staging: "staging";
83
+ "pending-restart": "pending-restart";
84
+ "awaiting-confirmation": "awaiting-confirmation";
85
+ }>;
86
+ pendingVersion: z.ZodNullable<z.ZodString>;
87
+ rolledBack: z.ZodNullable<z.ZodObject<{
88
+ fromVersion: z.ZodString;
89
+ toVersion: z.ZodNullable<z.ZodString>;
90
+ atMs: z.ZodNumber;
91
+ reason: z.ZodString;
92
+ }, z.core.$strip>>;
93
+ stateFileCorrupt: z.ZodBoolean;
94
+ lastCheckedAtMs: z.ZodNullable<z.ZodNumber>;
95
+ }, z.core.$strip>;
96
+ declare const ServerUpdateCheckResultSchema: z.ZodObject<{
97
+ packageName: z.ZodString;
98
+ runningVersion: z.ZodNullable<z.ZodString>;
99
+ latestVersion: z.ZodNullable<z.ZodString>;
100
+ updateAvailable: z.ZodBoolean;
101
+ checkedAtMs: z.ZodNumber;
102
+ error: z.ZodNullable<z.ZodString>;
103
+ }, z.core.$strip>;
104
+ declare const ServerUpdateActionResultSchema: z.ZodObject<{
105
+ accepted: z.ZodBoolean;
106
+ targetVersion: z.ZodNullable<z.ZodString>;
107
+ restarting: z.ZodBoolean;
108
+ message: z.ZodString;
109
+ }, z.core.$strip>;
110
+ export declare const serverManagementCapability: {
111
+ readonly name: "server-management";
112
+ readonly scope: "system";
113
+ readonly mode: "singleton";
114
+ readonly methods: {
115
+ readonly getServerPackageStatus: import("./capability-definition.js").CapabilityMethodSchema<z.ZodVoid, z.ZodObject<{
116
+ packageName: z.ZodString;
117
+ runningVersion: z.ZodNullable<z.ZodString>;
118
+ nodeRuntimeVersion: z.ZodNullable<z.ZodString>;
119
+ activeVersion: z.ZodNullable<z.ZodString>;
120
+ previousVersion: z.ZodNullable<z.ZodString>;
121
+ seedVersion: z.ZodNullable<z.ZodString>;
122
+ latestVersion: z.ZodNullable<z.ZodString>;
123
+ updateAvailable: z.ZodBoolean;
124
+ bootMode: z.ZodEnum<{
125
+ workspace: "workspace";
126
+ baked: "baked";
127
+ "data-root": "data-root";
128
+ }>;
129
+ updateState: z.ZodEnum<{
130
+ idle: "idle";
131
+ checking: "checking";
132
+ staging: "staging";
133
+ "pending-restart": "pending-restart";
134
+ "awaiting-confirmation": "awaiting-confirmation";
135
+ }>;
136
+ pendingVersion: z.ZodNullable<z.ZodString>;
137
+ rolledBack: z.ZodNullable<z.ZodObject<{
138
+ fromVersion: z.ZodString;
139
+ toVersion: z.ZodNullable<z.ZodString>;
140
+ atMs: z.ZodNumber;
141
+ reason: z.ZodString;
142
+ }, z.core.$strip>>;
143
+ stateFileCorrupt: z.ZodBoolean;
144
+ lastCheckedAtMs: z.ZodNullable<z.ZodNumber>;
145
+ }, z.core.$strip>, import("./capability-definition.js").CapabilityMethodKind>;
146
+ readonly checkServerUpdate: import("./capability-definition.js").CapabilityMethodSchema<z.ZodVoid, z.ZodObject<{
147
+ packageName: z.ZodString;
148
+ runningVersion: z.ZodNullable<z.ZodString>;
149
+ latestVersion: z.ZodNullable<z.ZodString>;
150
+ updateAvailable: z.ZodBoolean;
151
+ checkedAtMs: z.ZodNumber;
152
+ error: z.ZodNullable<z.ZodString>;
153
+ }, z.core.$strip>, "mutation">;
154
+ readonly applyServerUpdate: import("./capability-definition.js").CapabilityMethodSchema<z.ZodObject<{
155
+ version: z.ZodOptional<z.ZodString>;
156
+ }, z.core.$strip>, z.ZodObject<{
157
+ accepted: z.ZodBoolean;
158
+ targetVersion: z.ZodNullable<z.ZodString>;
159
+ restarting: z.ZodBoolean;
160
+ message: z.ZodString;
161
+ }, z.core.$strip>, "mutation">;
162
+ readonly rollbackServerUpdate: import("./capability-definition.js").CapabilityMethodSchema<z.ZodVoid, z.ZodObject<{
163
+ accepted: z.ZodBoolean;
164
+ targetVersion: z.ZodNullable<z.ZodString>;
165
+ restarting: z.ZodBoolean;
166
+ message: z.ZodString;
167
+ }, z.core.$strip>, "mutation">;
168
+ /**
169
+ * Plain process restart of the node's root process — no version change.
170
+ * The supervisor (docker restart policy / launchd / Electron main)
171
+ * relaunches and the starter loads the SAME active version. Refused while
172
+ * a stage is in flight or a version is already staged awaiting restart
173
+ * (use apply/rollback instead, so the pending version is not skipped).
174
+ */
175
+ readonly restartServer: import("./capability-definition.js").CapabilityMethodSchema<z.ZodVoid, z.ZodObject<{
176
+ accepted: z.ZodBoolean;
177
+ targetVersion: z.ZodNullable<z.ZodString>;
178
+ restarting: z.ZodBoolean;
179
+ message: z.ZodString;
180
+ }, z.core.$strip>, "mutation">;
181
+ };
182
+ /** BIG PLAN 2: declarative mount hint — read by `@camstack/system` `buildCapRouters`. */
183
+ readonly mount: {
184
+ readonly kind: "server-provided";
185
+ };
186
+ };
187
+ export type IServerManagementProvider = InferProvider<typeof serverManagementCapability>;
188
+ export type ServerBootMode = z.infer<typeof ServerBootModeSchema>;
189
+ export type ServerUpdateState = z.infer<typeof ServerUpdateStateSchema>;
190
+ export type ServerRollbackInfo = z.infer<typeof ServerRollbackInfoSchema>;
191
+ export type ServerPackageStatus = z.infer<typeof ServerPackageStatusSchema>;
192
+ export type ServerUpdateCheckResult = z.infer<typeof ServerUpdateCheckResultSchema>;
193
+ export type ServerUpdateActionResult = z.infer<typeof ServerUpdateActionResultSchema>;
194
+ export { ServerBootModeSchema, ServerUpdateStateSchema, ServerRollbackInfoSchema, ServerPackageStatusSchema, ServerUpdateCheckResultSchema, ServerUpdateActionResultSchema, };
@@ -0,0 +1,24 @@
1
+ import { z } from 'zod';
2
+ import { type InferProvider } from './capability-definition.js';
3
+ /**
4
+ * viewer-ui — serves the CamStack VIEWER web build (the Expo/React-Native
5
+ * universal client's PWA export) from the hub, alongside admin-ui. Mirrors
6
+ * `admin-ui` exactly: a singleton, server-internal cap exposing the static
7
+ * dist directory + build version so `main.ts` can mount the SPA under a
8
+ * dedicated prefix.
9
+ */
10
+ export declare const viewerUiCapability: {
11
+ readonly name: "viewer-ui";
12
+ readonly scope: "system";
13
+ readonly mode: "singleton";
14
+ readonly internal: true;
15
+ readonly methods: {
16
+ readonly getStaticDir: import("./capability-definition.js").CapabilityMethodSchema<z.ZodVoid, z.ZodObject<{
17
+ staticDir: z.ZodString;
18
+ }, z.core.$strip>, import("./capability-definition.js").CapabilityMethodKind>;
19
+ readonly getVersion: import("./capability-definition.js").CapabilityMethodSchema<z.ZodVoid, z.ZodObject<{
20
+ version: z.ZodString;
21
+ }, z.core.$strip>, import("./capability-definition.js").CapabilityMethodKind>;
22
+ };
23
+ };
24
+ export type IViewerUiProvider = InferProvider<typeof viewerUiCapability>;