@hagicode/hagiscript 0.1.15-dev.91.1.7ddec89 → 0.1.15-dev.95.1.042739d

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 (57) hide show
  1. package/README.md +237 -175
  2. package/dist/cli.js +2 -0
  3. package/dist/cli.js.map +1 -1
  4. package/dist/commands/manifest-commands.d.ts +2 -0
  5. package/dist/commands/manifest-commands.js +136 -0
  6. package/dist/commands/manifest-commands.js.map +1 -0
  7. package/dist/commands/npm-sync-commands.js +63 -6
  8. package/dist/commands/npm-sync-commands.js.map +1 -1
  9. package/dist/commands/server-commands.js +181 -7
  10. package/dist/commands/server-commands.js.map +1 -1
  11. package/dist/index.d.ts +7 -4
  12. package/dist/index.js +7 -4
  13. package/dist/index.js.map +1 -1
  14. package/dist/runtime/manifest-manager.d.ts +57 -0
  15. package/dist/runtime/manifest-manager.js +213 -0
  16. package/dist/runtime/manifest-manager.js.map +1 -0
  17. package/dist/runtime/npm-sync.d.ts +3 -1
  18. package/dist/runtime/npm-sync.js +31 -3
  19. package/dist/runtime/npm-sync.js.map +1 -1
  20. package/dist/runtime/pm2-manager.d.ts +4 -2
  21. package/dist/runtime/pm2-manager.js +181 -53
  22. package/dist/runtime/pm2-manager.js.map +1 -1
  23. package/dist/runtime/runtime-executor.d.ts +6 -0
  24. package/dist/runtime/runtime-executor.js +55 -0
  25. package/dist/runtime/runtime-executor.js.map +1 -1
  26. package/dist/runtime/runtime-manager.d.ts +9 -0
  27. package/dist/runtime/runtime-manager.js +146 -16
  28. package/dist/runtime/runtime-manager.js.map +1 -1
  29. package/dist/runtime/runtime-manifest.d.ts +5 -1
  30. package/dist/runtime/runtime-manifest.js +23 -8
  31. package/dist/runtime/runtime-manifest.js.map +1 -1
  32. package/dist/runtime/runtime-paths.d.ts +11 -1
  33. package/dist/runtime/runtime-paths.js +41 -5
  34. package/dist/runtime/runtime-paths.js.map +1 -1
  35. package/dist/runtime/server-config.d.ts +21 -0
  36. package/dist/runtime/server-config.js +169 -0
  37. package/dist/runtime/server-config.js.map +1 -0
  38. package/dist/runtime/server-manager.d.ts +48 -4
  39. package/dist/runtime/server-manager.js +499 -66
  40. package/dist/runtime/server-manager.js.map +1 -1
  41. package/dist/runtime/server-version-state.d.ts +43 -0
  42. package/dist/runtime/server-version-state.js +156 -0
  43. package/dist/runtime/server-version-state.js.map +1 -0
  44. package/dist/runtime/tool-sync-catalog.config.json +0 -18
  45. package/dist/runtime/tool-sync-catalog.js +1 -1
  46. package/dist/runtime/tool-sync-catalog.js.map +1 -1
  47. package/package.json +23 -2
  48. package/runtime/lib/runtime-script-lib.mjs +128 -69
  49. package/runtime/manifest.yaml +96 -81
  50. package/runtime/scripts/configure-code-server.mjs +14 -3
  51. package/runtime/scripts/configure-omniroute.mjs +15 -5
  52. package/runtime/scripts/install-code-server.mjs +20 -23
  53. package/runtime/scripts/install-omniroute.mjs +19 -22
  54. package/runtime/scripts/install-pm2.mjs +39 -0
  55. package/runtime/scripts/remove-pm2.mjs +25 -0
  56. package/runtime/templates/code-server-config.yaml +2 -2
  57. package/runtime/templates/omniroute-config.yaml +1 -1
package/README.md CHANGED
@@ -4,317 +4,379 @@
4
4
  [![npm downloads](https://img.shields.io/npm/dm/%40hagicode%2Fhagiscript?logo=npm&color=2d8cf0)](https://www.npmjs.com/package/@hagicode/hagiscript)
5
5
  [![license](https://img.shields.io/badge/license-MIT-ffd43b)](./LICENSE)
6
6
 
7
- `@hagicode/hagiscript` is the runtime management CLI behind the `hagicode-runtime` contract. Use it to install, inspect, update, remove, and operate a managed HagiCode runtime without depending on system Node.js, system PM2, or host-global npm packages.
7
+ `@hagicode/hagiscript` is the CLI used to install and operate a managed HagiCode runtime. It manages the runtime layout, bundled services, managed npm tools, and the released backend server from a manifest-driven workflow.
8
8
 
9
- ## Install
9
+ ## Install The CLI
10
10
 
11
11
  ```bash
12
12
  npm install -g @hagicode/hagiscript
13
13
  ```
14
14
 
15
- Primary entrypoints:
15
+ Check the installed version:
16
16
 
17
- - `hagiscript`
18
- - `hagicode-runtime` (`hagiscript runtime ...` wrapper)
17
+ ```bash
18
+ hagiscript --version
19
+ ```
20
+
21
+ ## Quick Start
22
+
23
+ For a first-time setup, run these commands in order:
24
+
25
+ ```bash
26
+ npm install -g @hagicode/hagiscript
27
+ hagiscript runtime install
28
+ hagiscript server install
29
+ hagiscript server start
30
+ hagiscript server status
31
+ ```
32
+
33
+ If you also want the npm tools declared in your runtime manifest:
19
34
 
20
- Node.js 20 or newer is required to run the package itself.
35
+ ```bash
36
+ hagiscript npm-sync --runtime-root ~/.hagicode/runtime
37
+ ```
38
+
39
+ If you are working with a custom manifest or runtime root, use the same flow with explicit paths:
21
40
 
22
- ## Runtime Model
41
+ ```bash
42
+ hagiscript runtime install \
43
+ --from-manifest ./runtime/manifest.yaml \
44
+ --runtime-root ~/.hagicode/runtime
23
45
 
24
- By default, Hagiscript loads `runtime/manifest.yaml` and manages the runtime under `~/.hagicode/runtime`.
46
+ hagiscript server install \
47
+ --from-manifest ./runtime/manifest.yaml \
48
+ --runtime-root ~/.hagicode/runtime
25
49
 
26
- ```text
27
- <runtime-root>/
28
- program/
29
- bin/
30
- npm/
31
- components/
32
- runtime-data/
33
- config/
34
- logs/
35
- data/
36
- components/
37
- state.json
50
+ hagiscript server start \
51
+ --from-manifest ./runtime/manifest.yaml \
52
+ --runtime-root ~/.hagicode/runtime
38
53
  ```
39
54
 
40
- The split is intentional:
55
+ ## What Hagiscript Manages
56
+
57
+ The packaged runtime manifest defines these default components:
41
58
 
42
- - `program/` holds managed executables, vendored payloads, wrappers, and the managed npm prefix.
43
- - `runtime-data/` holds mutable config, logs, state, PM2 data, and component-specific writable files.
59
+ - `node`: managed Node.js runtime
60
+ - `dotnet`: managed .NET runtime
61
+ - `omniroute`: bundled PM2-managed service
62
+ - `code-server`: bundled PM2-managed service
63
+ - `server`: released backend service package
44
64
 
45
- The packaged manifest currently manages:
65
+ The managed runtime layout separates immutable program files from mutable data:
46
66
 
47
- - `node` - managed Node.js runtime
48
- - `dotnet` - managed .NET and ASP.NET Core runtime
49
- - `server` - released backend package metadata and PM2 launch assets for `lib/PCode.Web.dll`
50
- - `omniroute` - vendored bundled runtime
51
- - `code-server` - vendored bundled runtime
67
+ - `program/`: installed runtime payloads, wrappers, bundled executables
68
+ - `runtime-data/`: mutable config, logs, PM2 state, managed npm packages
69
+ - `server/`: installed released server versions
70
+ - `server-data/`: server config, logs, PM2 runtime files, version state
52
71
 
53
- The runtime layout still reserves `program/npm/` as the managed npm prefix, but package inventory inside that prefix is not part of the runtime component manifest. Tool installation there is handled separately through `hagiscript npm-sync` or external provisioning.
72
+ By default, the packaged manifest installs into `~/.hagicode/runtime`, but you can override that with `--runtime-root`.
54
73
 
55
- ## Core Runtime Commands
74
+ ## Runtime Basics
56
75
 
57
- Install the full runtime:
76
+ Create a standalone editable manifest from Hagiscript's packaged default:
58
77
 
59
78
  ```bash
60
- hagiscript runtime install
79
+ hagiscript manifest init ./hagiscript.manifest.yaml
61
80
  ```
62
81
 
63
- Runtime installs reuse a shared download cache by default. Disable it with `--no-download-cache`, or relocate it with `--download-cache-dir <path>`.
82
+ Generate a manifest and set the managed layout at the same time:
64
83
 
65
- Install selected components only:
84
+ ```bash
85
+ hagiscript manifest init ./hagiscript.manifest.yaml \
86
+ --runtime-home program \
87
+ --runtime-data-root runtime-data \
88
+ --server-program-root server \
89
+ --server-data-root server-data
90
+ ```
91
+
92
+ Update an existing manifest after initialization:
66
93
 
67
94
  ```bash
68
- hagiscript runtime install --components node,omniroute
95
+ hagiscript manifest set ./hagiscript.manifest.yaml \
96
+ --npm-package-version pm2=7.0.2 \
97
+ --npm-package-version @openai/codex=0.126.0 \
98
+ --server-active-version 0.1.0-beta.60
69
99
  ```
70
100
 
71
- Preview planned changes without mutating files:
101
+ Print the current manifest summary in a friendlier format:
72
102
 
73
103
  ```bash
74
- hagiscript runtime install --dry-run
75
- hagiscript runtime update --check-only
104
+ hagiscript manifest get ./hagiscript.manifest.yaml
105
+ ```
106
+
107
+ Install the default runtime:
108
+
109
+ ```bash
110
+ hagiscript runtime install
111
+ ```
112
+
113
+ Install from an explicit manifest into a specific root:
114
+
115
+ ```bash
116
+ hagiscript runtime install \
117
+ --from-manifest ./runtime/manifest.yaml \
118
+ --runtime-root ~/.hagicode/runtime
76
119
  ```
77
120
 
78
- Inspect the canonical runtime state:
121
+ Show the current runtime state:
79
122
 
80
123
  ```bash
81
124
  hagiscript runtime state
125
+ ```
126
+
127
+ Show machine-readable state:
128
+
129
+ ```bash
82
130
  hagiscript runtime state --json
83
131
  ```
84
132
 
85
- Update or remove managed components:
133
+ Preview what would be installed without changing files:
86
134
 
87
135
  ```bash
88
- hagiscript runtime update
89
- hagiscript runtime remove --components code-server --purge
136
+ hagiscript runtime install --dry-run
90
137
  ```
91
138
 
92
- Override the runtime root or manifest when needed:
139
+ Update installed components:
93
140
 
94
141
  ```bash
95
- hagiscript runtime install --runtime-root /srv/hagicode/runtime
96
- hagiscript runtime state --from-manifest /path/to/runtime-manifest.yaml --json
142
+ hagiscript runtime update
97
143
  ```
98
144
 
99
- If you prefer the runtime-oriented wrapper:
145
+ Only check whether updates are needed:
100
146
 
101
147
  ```bash
102
- hagicode-runtime install --runtime-root /srv/hagicode/runtime
148
+ hagiscript runtime update --check-only
103
149
  ```
104
150
 
105
- ## Runtime State and Maintenance
151
+ Remove the runtime but keep retained data where supported:
152
+
153
+ ```bash
154
+ hagiscript runtime remove
155
+ ```
106
156
 
107
- `hagiscript runtime state --json` is the canonical inspection surface for automation. It reports:
157
+ Purge runtime data as well:
108
158
 
109
- - resolved runtime root
110
- - `program/` and `runtime-data/` locations
111
- - per-component install status
112
- - per-component runtime data homes
113
- - derived PM2 homes for managed services
114
- - program/data path separation
159
+ ```bash
160
+ hagiscript runtime remove --purge
161
+ ```
115
162
 
116
- Use it before and after maintenance work to confirm the expected component set and writable paths.
163
+ Operate on selected components only:
117
164
 
118
- Typical maintenance flow:
165
+ ```bash
166
+ hagiscript runtime install --components node,dotnet
167
+ hagiscript runtime update --components code-server,omniroute
168
+ hagiscript runtime remove --components code-server --purge
169
+ ```
119
170
 
120
- 1. Check current state: `hagiscript runtime state --json`
121
- 2. Apply changes: `hagiscript runtime install`, `update`, or `remove`
122
- 3. Re-check state to confirm the final layout
123
- 4. Operate services through `hagiscript pm2 ...`
171
+ ## Runtime Install Workflow
124
172
 
125
- Lifecycle commands print the resolved manifest, managed root, changed component count, skipped entries, and log file path when a log is generated.
173
+ The typical runtime flow is:
126
174
 
127
- ## Managed PM2 Services
175
+ ```bash
176
+ hagiscript runtime install
177
+ hagiscript runtime state
178
+ hagiscript runtime update
179
+ ```
128
180
 
129
- Hagiscript manages runtime-scoped PM2 services for:
181
+ If you want a clean rebuild:
130
182
 
131
- - `server`
132
- - `omniroute`
133
- - `code-server`
183
+ ```bash
184
+ hagiscript runtime remove --purge
185
+ hagiscript runtime install
186
+ ```
134
187
 
135
- Supported actions:
188
+ ## Server Install And Management
136
189
 
137
- - `start`
138
- - `restart`
139
- - `stop`
140
- - `status`
141
- - `env`
190
+ The managed server is installed separately from the core runtime. `hagiscript server install` ensures runtime dependencies are available, resolves a released server package, and makes that version active.
142
191
 
143
- Examples:
192
+ Install the server from the default source:
144
193
 
145
194
  ```bash
146
- hagiscript pm2 server start
147
- hagiscript pm2 server restart
148
- hagiscript pm2 server status
149
- hagiscript pm2 server env
150
- hagiscript pm2 server env --json
151
- hagiscript pm2 omniroute status
152
- hagiscript pm2 omniroute start
153
- hagiscript pm2 code-server stop
195
+ hagiscript server install
154
196
  ```
155
197
 
156
- The PM2 flow is runtime-scoped:
198
+ Install the server against an explicit runtime manifest and root:
157
199
 
158
- - PM2 is resolved from the managed npm prefix, not the host environment.
159
- - Hagiscript resolves the runtime manifest before every PM2 action.
160
- - PM2 runs with the managed Node runtime and managed PATH ordering.
161
- - `PM2_HOME` is derived from the managed runtime layout, so service state stays inside the runtime data boundary.
200
+ ```bash
201
+ hagiscript server install \
202
+ --from-manifest ./runtime/manifest.yaml \
203
+ --runtime-root ~/.hagicode/runtime
204
+ ```
162
205
 
163
- This means maintenance scripts should call `hagiscript pm2 ...` instead of a system `pm2` binary, and should ensure `pm2` has been installed into the managed npm prefix beforehand.
206
+ Install from a local archive:
164
207
 
165
- ### Released backend `server` contract
208
+ ```bash
209
+ hagiscript server install --archive ./hagicode-server.zip
210
+ ```
166
211
 
167
- The packaged runtime manifest treats `server` as a `released-service` component. The managed runtime expects a published backend package staged under:
212
+ Install from a specific index version:
168
213
 
169
- ```text
170
- <runtime-root>/program/components/server/current/
171
- lib/PCode.Web.dll
172
- lib/PCode.Web.deps.json
173
- lib/PCode.Web.runtimeconfig.json
174
- start.sh (or the platform equivalent from the release package)
214
+ ```bash
215
+ hagiscript server install --index-version 0.1.0-beta.60
175
216
  ```
176
217
 
177
- Hagiscript keeps mutable launch state for that service under:
218
+ List installed server versions and the active version:
178
219
 
179
- ```text
180
- <runtime-root>/runtime-data/components/services/server/
181
- .pm2/
182
- pm2-runtime/
220
+ ```bash
221
+ hagiscript server list
183
222
  ```
184
223
 
185
- `hagiscript runtime install --components server` prepares the runtime-owned launch assets and reports whether the published payload is already staged. `hagiscript pm2 server start` then generates the final PM2 ecosystem/env files under `pm2-runtime/` and launches the released backend through the managed `dotnet` runtime. Use `hagiscript pm2 server env` to print the exact resolved working directory, PATH ordering, and environment variables that HagiScript will use for that startup flow.
224
+ Switch the active version:
186
225
 
187
- ## Managed Server Commands
226
+ ```bash
227
+ hagiscript server use 0.1.0-beta.60
228
+ ```
188
229
 
189
- Hagiscript can now stage a released backend package and prepare all startup prerequisites from a single command surface:
230
+ Remove an installed version:
190
231
 
191
232
  ```bash
192
- hagiscript server install
193
- hagiscript server install --package-dir /srv/hagicode/packages
194
- hagiscript server install --archive ./hagicode-1.2.3-linux-x64-nort.zip
195
- hagiscript server install --url https://example.com/hagicode-1.2.3-linux-x64-nort.zip
196
- hagiscript server install --github-repo HagiCode-org/releases --tag v1.2.3
233
+ hagiscript server remove 0.1.0-beta.60
197
234
  ```
198
235
 
199
- By default, `server install`:
200
-
201
- - selects or downloads a server archive
202
- - extracts and stages it into `program/components/server/current/`
203
- - runs `hagiscript runtime install --components server`
204
- - ensures `pm2` exists in the managed npm prefix
236
+ ## Server Lifecycle
205
237
 
206
- Once installed, use the higher-level lifecycle wrappers:
238
+ Start the managed server:
207
239
 
208
240
  ```bash
209
241
  hagiscript server start
210
- hagiscript server restart --instance demo
211
- hagiscript server stop --instance demo
212
- hagiscript server status --json
213
- hagiscript server env --instance demo
214
242
  ```
215
243
 
216
- `--instance <name>` maps to the PM2 name identifier and defaults to `hagicode`, so one host can run multiple managed runtime roots without colliding app names.
244
+ Stop it:
245
+
246
+ ```bash
247
+ hagiscript server stop
248
+ ```
249
+
250
+ Restart it:
217
251
 
218
- ## Runtime Environment Contract
252
+ ```bash
253
+ hagiscript server restart
254
+ ```
219
255
 
220
- Runtime lifecycle scripts and managed services receive a stable environment contract:
256
+ Check status:
221
257
 
222
- - `HAGICODE_RUNTIME_HOME` - runtime program home
223
- - `HAGICODE_RUNTIME_DATA_HOME` - writable runtime data home for the current component
224
- - `PM2_HOME` - PM2 state directory for the current managed service
225
- - `PATH` - rebuilt so managed Node, managed npm, and managed wrappers come first
258
+ ```bash
259
+ hagiscript server status
260
+ ```
226
261
 
227
- This contract is what keeps installs, updates, wrappers, and PM2-managed services aligned to the same runtime root.
262
+ Show the startup environment:
228
263
 
229
- ## Manifest Customization
264
+ ```bash
265
+ hagiscript server env
266
+ ```
230
267
 
231
- `runtime/manifest.yaml` controls the runtime shape. Common override points:
268
+ Emit JSON for status or environment:
232
269
 
233
- - `paths.runtimeRoot`
234
- - `paths.runtimeHome`
235
- - `paths.runtimeDataRoot`
236
- - `paths.componentDataRoot`
237
- - `paths.defaultPm2Home`
238
- - component `runtimeDataDir`
239
- - service `pm2.appName`
240
- - service `pm2.cwd`
241
- - service `pm2.script`
242
- - service `pm2.args`
243
- - service `pm2.env`
244
- - service `pm2.pm2Home`
270
+ ```bash
271
+ hagiscript server status --json
272
+ hagiscript server env --json
273
+ ```
245
274
 
246
- For deployment-specific behavior, keep the packaged manifest as the baseline and pass `--from-manifest` with an override manifest rather than mutating the installed package in place.
275
+ Override the PM2 instance name used for namespaced app names:
247
276
 
248
- ## Related Runtime Tooling
277
+ ```bash
278
+ hagiscript server start --instance myruntime
279
+ ```
249
280
 
250
- ### Managed Node Runtime
281
+ ## Server Configuration
251
282
 
252
- Install a standalone managed Node.js runtime:
283
+ Read the effective managed server config:
253
284
 
254
285
  ```bash
255
- hagiscript install-node --target /opt/hagiscript/node
256
- hagiscript install-node --target /opt/hagiscript/node22 --version 22
286
+ hagiscript server config get
257
287
  ```
258
288
 
259
- Standalone Node installs also reuse the shared download cache by default. Pass `--no-download-cache` to force a fresh download, or `--download-cache-dir <path>` to share a custom cache location across installs.
289
+ Update host and port:
260
290
 
261
- Validate an existing managed Node.js runtime:
291
+ ```bash
292
+ hagiscript server config set --host 127.0.0.1 --port 39150
293
+ ```
294
+
295
+ Read the config as JSON:
262
296
 
263
297
  ```bash
264
- hagiscript check-node --target /opt/hagiscript/node
298
+ hagiscript server config get --json
265
299
  ```
266
300
 
267
- ### Managed npm Package Sync
301
+ ## Managed NPM Tool Sync
268
302
 
269
- Sync npm global packages into the managed npm prefix instead of the host environment:
303
+ The runtime manifest can also declare managed npm packages under `npmSync`. These packages are installed into the managed npm prefix under `runtime-data/npm`, not into `program/`.
304
+
305
+ If the managed runtime has already been installed, `npm-sync` can read `runtime-data/state.json` under the selected runtime and automatically reuse the recorded `manifestPath` and managed npm prefix. In that case you do not need to pass `--from-manifest`.
306
+
307
+ Sync npm packages by pointing at the runtime root:
270
308
 
271
309
  ```bash
272
- hagiscript npm-sync --manifest ./manifest.json
273
- hagiscript npm-sync --runtime /opt/hagiscript/node --manifest ./manifest.json
274
- hagiscript npm-sync --managed-runtime ~/.hagicode/runtime/program/components/node/runtime --prefix ~/.hagicode/runtime/program/npm --manifest ./manifest.json
310
+ hagiscript npm-sync --runtime-root ~/.hagicode/runtime
275
311
  ```
276
312
 
277
- When `npm-sync` has to provision a managed Node runtime first, it uses the same shared download cache by default.
313
+ Sync npm packages declared in a runtime manifest:
278
314
 
279
- This is the path for installing `pm2` and any other scenario-specific global tools. The package list is data, not a built-in runtime component.
315
+ ```bash
316
+ hagiscript npm-sync --from-manifest ./runtime/manifest.yaml
317
+ ```
280
318
 
281
- ## Development
319
+ `npm-sync` does not define its own program/data/server root layout. It reads the runtime manifest associated with the selected runtime root and follows that manifest's `npmSync` definition.
282
320
 
283
- Run from `repos/hagiscript/`:
321
+ If you want to change the npm tool versions captured in a manifest, update the manifest first:
284
322
 
285
323
  ```bash
286
- npm install
287
- npm test
288
- npm run build
289
- npm run pack:check
324
+ hagiscript manifest set ./hagiscript.manifest.yaml \
325
+ --npm-package-version pm2=7.0.2 \
326
+ --npm-package-version @openai/codex=0.126.0
290
327
  ```
291
328
 
292
- Useful runtime-focused checks:
329
+ Use an explicit managed Node runtime and prefix:
293
330
 
294
331
  ```bash
295
- npm run integration:runtime-management
296
- npm run integration:runtime-key-path
297
- npm run integration:installed-runtime
332
+ hagiscript npm-sync \
333
+ --from-manifest ./runtime/manifest.yaml \
334
+ --managed-runtime ~/.hagicode/runtime/program/components/node/runtime \
335
+ --prefix ~/.hagicode/runtime/runtime-data/npm
298
336
  ```
299
337
 
300
- The dedicated runtime key-path flow validates the critical production sequence with real network downloads: runtime install for fixed components, npm-sync for scenario-specific tools in the managed npm prefix, and PM2 lifecycle commands resolved from that managed prefix. Run the base flow with:
338
+ Force re-sync even if installed versions already satisfy the requested target:
301
339
 
302
340
  ```bash
303
- npm run integration:runtime-key-path
341
+ hagiscript npm-sync --from-manifest ./runtime/manifest.yaml --force
304
342
  ```
305
343
 
306
- The release-oriented key-path mode additionally stages the latest public backend package from GitHub Releases and validates the same managed PM2 contract for `server`:
344
+ ## Common End-To-End Flow
345
+
346
+ For a fresh machine or a new runtime root, this is the usual sequence:
307
347
 
308
348
  ```bash
309
- HAGISCRIPT_ENABLE_RELEASED_SERVER_TEST=1 npm run integration:runtime-key-path
349
+ hagiscript runtime install
350
+ hagiscript server install
351
+ hagiscript server start
352
+ hagiscript server status
310
353
  ```
311
354
 
312
- The broader runtime-management integration path remains available for the existing end-to-end runtime assertions, including the corresponding released-server mode:
355
+ If you also want the manifest-declared npm tools:
313
356
 
314
357
  ```bash
315
- HAGISCRIPT_ENABLE_RELEASED_SERVER_TEST=1 npm run integration:runtime-management
358
+ hagiscript npm-sync --runtime-root ~/.hagicode/runtime
316
359
  ```
317
360
 
361
+ ## Useful Flags
362
+
363
+ - `manifest init [path]`: generate an editable manifest from the packaged default
364
+ - `manifest get [path]`: print a readable summary of the current manifest
365
+ - `manifest set <path>`: update manifest paths, npmSync package versions, or server defaults
366
+ - `--from-manifest <path>`: use a specific runtime manifest YAML
367
+ - `--runtime-root <path>`: change the managed runtime root
368
+ - `--runtime-home <path>`: set the manifest's program root
369
+ - `--runtime-data-root <path>`: set the manifest's runtime-data root
370
+ - `--server-program-root <path>`: set the manifest's server program root
371
+ - `--server-data-root <path>`: set the manifest's server data root
372
+ - `--npm-package-version <package=version>`: update a manifest npmSync package entry
373
+ - `--server-active-version <version>`: set the manifest's preferred managed server version
374
+ - `--components <list>`: target specific runtime components
375
+ - `--dry-run`: print the plan without mutating files
376
+ - `--force`: force reinstall or update where supported
377
+ - `--purge`: remove retained mutable data during runtime removal
378
+ - `--json`: emit machine-readable output for `manifest get`, state, status, env, and config commands
379
+
318
380
  ## License
319
381
 
320
382
  MIT. See [LICENSE](./LICENSE).
package/dist/cli.js CHANGED
@@ -3,6 +3,7 @@ import { realpathSync } from "node:fs";
3
3
  import { fileURLToPath } from "node:url";
4
4
  import { Command } from "commander";
5
5
  import { createRuntimeInfo, packageVersion } from "./index.js";
6
+ import { registerManifestCommands } from "./commands/manifest-commands.js";
6
7
  import { registerNpmSyncCommand } from "./commands/npm-sync-commands.js";
7
8
  import { registerNodeRuntimeCommands } from "./commands/node-runtime-commands.js";
8
9
  import { registerPm2Commands } from "./commands/pm2-commands.js";
@@ -22,6 +23,7 @@ export function createCli() {
22
23
  process.stdout.write(`${JSON.stringify(info, null, 2)}\n`);
23
24
  });
24
25
  registerNodeRuntimeCommands(program);
26
+ registerManifestCommands(program);
25
27
  registerNpmSyncCommand(program);
26
28
  registerPm2Commands(program);
27
29
  registerRuntimeCommands(program);
package/dist/cli.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"cli.js","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":";AAEA,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AACvC,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AACzC,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,iBAAiB,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AAC/D,OAAO,EAAE,sBAAsB,EAAE,MAAM,iCAAiC,CAAC;AACzE,OAAO,EAAE,2BAA2B,EAAE,MAAM,qCAAqC,CAAC;AAClF,OAAO,EAAE,mBAAmB,EAAE,MAAM,4BAA4B,CAAC;AACjE,OAAO,EAAE,uBAAuB,EAAE,MAAM,gCAAgC,CAAC;AACzE,OAAO,EAAE,sBAAsB,EAAE,MAAM,+BAA+B,CAAC;AAEvE,MAAM,UAAU,SAAS;IACvB,MAAM,OAAO,GAAG,IAAI,OAAO,EAAE,CAAC;IAE9B,OAAO;SACJ,IAAI,CAAC,YAAY,CAAC;SAClB,WAAW,CAAC,6CAA6C,CAAC;SAC1D,OAAO,CAAC,cAAc,EAAE,eAAe,EAAE,8BAA8B,CAAC,CAAC;IAE5E,OAAO;SACJ,OAAO,CAAC,MAAM,CAAC;SACf,WAAW,CAAC,mCAAmC,CAAC;SAChD,MAAM,CAAC,GAAG,EAAE;QACX,MAAM,IAAI,GAAG,iBAAiB,EAAE,CAAC;QACjC,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,GA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