@hagicode/hagiscript 0.1.6 → 0.1.7
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/README.md +68 -0
- package/README_cn.md +55 -0
- package/bin/runtime +16 -0
- package/dist/cli.js +4 -0
- package/dist/cli.js.map +1 -1
- package/dist/commands/pm2-commands.d.ts +2 -0
- package/dist/commands/pm2-commands.js +54 -0
- package/dist/commands/pm2-commands.js.map +1 -0
- package/dist/commands/runtime-commands.d.ts +2 -0
- package/dist/commands/runtime-commands.js +136 -0
- package/dist/commands/runtime-commands.js.map +1 -0
- package/dist/index.d.ts +6 -0
- package/dist/index.js +6 -0
- package/dist/index.js.map +1 -1
- package/dist/runtime/command-launch.js +1 -0
- package/dist/runtime/command-launch.js.map +1 -1
- package/dist/runtime/pm2-manager.d.ts +54 -0
- package/dist/runtime/pm2-manager.js +260 -0
- package/dist/runtime/pm2-manager.js.map +1 -0
- package/dist/runtime/runtime-executor.d.ts +45 -0
- package/dist/runtime/runtime-executor.js +135 -0
- package/dist/runtime/runtime-executor.js.map +1 -0
- package/dist/runtime/runtime-manager.d.ts +79 -0
- package/dist/runtime/runtime-manager.js +651 -0
- package/dist/runtime/runtime-manager.js.map +1 -0
- package/dist/runtime/runtime-manifest.d.ts +77 -0
- package/dist/runtime/runtime-manifest.js +277 -0
- package/dist/runtime/runtime-manifest.js.map +1 -0
- package/dist/runtime/runtime-paths.d.ts +31 -0
- package/dist/runtime/runtime-paths.js +77 -0
- package/dist/runtime/runtime-paths.js.map +1 -0
- package/dist/runtime/runtime-state.d.ts +45 -0
- package/dist/runtime/runtime-state.js +82 -0
- package/dist/runtime/runtime-state.js.map +1 -0
- package/package.json +8 -3
- package/runtime/lib/runtime-script-lib.mjs +142 -0
- package/runtime/manifest.yaml +136 -0
- package/runtime/scripts/configure-code-server.mjs +14 -0
- package/runtime/scripts/configure-omniroute.mjs +16 -0
- package/runtime/scripts/install-code-server.mjs +35 -0
- package/runtime/scripts/install-dotnet.mjs +24 -0
- package/runtime/scripts/install-node.mjs +4 -0
- package/runtime/scripts/install-npm-packages.mjs +4 -0
- package/runtime/scripts/install-omniroute.mjs +37 -0
- package/runtime/scripts/remove-npm-packages.mjs +4 -0
- package/runtime/scripts/update-npm-packages.mjs +4 -0
- package/runtime/scripts/verify-dotnet.mjs +10 -0
- package/runtime/scripts/verify-node.mjs +4 -0
- package/runtime/templates/code-server-config.yaml +5 -0
- package/runtime/templates/omniroute-config.yaml +4 -0
package/README.md
CHANGED
|
@@ -215,6 +215,74 @@ Synced: @openspec/cli (sync)
|
|
|
215
215
|
|
|
216
216
|
When fallback is triggered, HagiScript logs `Fallback used: ...` during execution and records `Fallback detail: ...` in the final summary so CI or desktop automation can see which mirror failed, which official registry retry was used, and whether that retry succeeded.
|
|
217
217
|
|
|
218
|
+
### Runtime Package Management
|
|
219
|
+
|
|
220
|
+
`hagiscript runtime` adds a manifest-driven package manager for the broader `hagicode-runtime` contract. By default it loads `runtime/manifest.yaml` from the installed package, resolves the managed runtime root to `~/.hagicode/runtime`, then splits that managed runtime into a program home and a mutable runtime-data home unless `--runtime-root <path>` overrides the base location for a specific install, deployment mode, or automation run.
|
|
221
|
+
|
|
222
|
+
```bash
|
|
223
|
+
hagiscript runtime install
|
|
224
|
+
hagiscript runtime install --components node,npm-packages --dry-run
|
|
225
|
+
hagiscript runtime update --runtime-root /opt/hagicode/runtime --check-only
|
|
226
|
+
hagiscript runtime remove --components code-server --purge
|
|
227
|
+
hagiscript runtime state --json
|
|
228
|
+
```
|
|
229
|
+
|
|
230
|
+
The packaged runtime manifest aligns its default component boundaries with HagiCode Desktop:
|
|
231
|
+
|
|
232
|
+
- Node is governed as a Desktop-aligned Node 22 toolchain component.
|
|
233
|
+
- `.NET` is modeled as a Desktop-aligned 10.0 runtime component.
|
|
234
|
+
- Mutable npm packages, including the managed `pm2` binary, are installed into a managed prefix under the runtime program home instead of the immutable Node payload or host-global npm locations.
|
|
235
|
+
- `code-server` and `omniroute` stay grouped as vendored bundled-runtime components rather than npm-managed packages.
|
|
236
|
+
|
|
237
|
+
The runtime layout is explicit and stable for downstream consumers:
|
|
238
|
+
|
|
239
|
+
```text
|
|
240
|
+
<runtime-root>/
|
|
241
|
+
program/
|
|
242
|
+
bin/
|
|
243
|
+
npm/
|
|
244
|
+
components/
|
|
245
|
+
runtime-data/
|
|
246
|
+
config/
|
|
247
|
+
logs/
|
|
248
|
+
data/
|
|
249
|
+
components/
|
|
250
|
+
state.json
|
|
251
|
+
```
|
|
252
|
+
|
|
253
|
+
`hagiscript runtime state --json` is the canonical contract for install, update, remove, and downstream inspection. It reports the resolved runtime home, runtime data root, per-component runtime data homes, and derived PM2 homes so Desktop, local bootstrap flows, or automation does not need to probe files directly.
|
|
254
|
+
|
|
255
|
+
Runtime lifecycle scripts and managed PM2 services receive the same public runtime environment contract:
|
|
256
|
+
|
|
257
|
+
- `HAGICODE_RUNTIME_HOME` points to the runtime program home.
|
|
258
|
+
- `HAGICODE_RUNTIME_DATA_HOME` points to the current component's writable runtime data home.
|
|
259
|
+
- `PM2_HOME` defaults to a child directory beneath `HAGICODE_RUNTIME_DATA_HOME`.
|
|
260
|
+
- `PATH` is rebuilt so the managed Node runtime, managed npm prefix, and managed wrappers take precedence over the ambient shell environment.
|
|
261
|
+
|
|
262
|
+
### Managed PM2 Service Commands
|
|
263
|
+
|
|
264
|
+
`hagiscript pm2` manages the runtime-scoped `omniroute` and `code-server` services through the PM2 binary installed by `hagiscript runtime install`.
|
|
265
|
+
|
|
266
|
+
```bash
|
|
267
|
+
hagiscript pm2 omniroute start
|
|
268
|
+
hagiscript pm2 omniroute status
|
|
269
|
+
hagiscript pm2 code-server stop
|
|
270
|
+
```
|
|
271
|
+
|
|
272
|
+
Each PM2 command resolves the runtime manifest first, loads the canonical runtime homes, derives a component-scoped `PM2_HOME`, and executes the managed PM2 binary from `<runtime-home>/npm`. It does not rely on a system PM2 or a system Node on the ambient shell `PATH`.
|
|
273
|
+
|
|
274
|
+
The packaged `runtime/manifest.yaml` can override:
|
|
275
|
+
|
|
276
|
+
- runtime-level `paths.runtimeHome`, `paths.runtimeDataRoot`, `paths.componentDataRoot`, and `paths.defaultPm2Home`
|
|
277
|
+
- component-level `runtimeDataDir`
|
|
278
|
+
- service-level `pm2.appName`, `pm2.cwd`, `pm2.script`, `pm2.args`, `pm2.env`, and `pm2.pm2Home`
|
|
279
|
+
|
|
280
|
+
The package also ships a thin `hagicode-runtime` wrapper binary that delegates to `hagiscript runtime ...` for automation that prefers a runtime-oriented entrypoint:
|
|
281
|
+
|
|
282
|
+
```bash
|
|
283
|
+
hagicode-runtime install --runtime-root /srv/hagicode/runtime
|
|
284
|
+
```
|
|
285
|
+
|
|
218
286
|
Use the library API from ESM consumers:
|
|
219
287
|
|
|
220
288
|
```ts
|
package/README_cn.md
CHANGED
|
@@ -197,6 +197,61 @@ Changed: 1
|
|
|
197
197
|
|
|
198
198
|
如果触发了回退,Hagiscript 会在执行期间输出 `Fallback used: ...`,并在最终摘要中记录 `Fallback detail: ...`,这样 CI 或桌面端自动化就能明确知道哪个镜像失败了、是否切到了官方源,以及官方源重试是否成功。
|
|
199
199
|
|
|
200
|
+
### Runtime 包管理
|
|
201
|
+
|
|
202
|
+
`hagiscript runtime` 提供了面向 `hagicode-runtime` 的 manifest 驱动包管理能力。默认情况下,它会加载安装包内置的 `runtime/manifest.yaml`,把托管运行时根目录解析为 `~/.hagicode/runtime`,然后在该根目录下拆分出只读程序目录和可写运行时数据目录;如果某次部署或自动化需要独立路径,可通过 `--runtime-root <path>` 覆盖基础位置。
|
|
203
|
+
|
|
204
|
+
```bash
|
|
205
|
+
hagiscript runtime install
|
|
206
|
+
hagiscript runtime install --components node,npm-packages --dry-run
|
|
207
|
+
hagiscript runtime update --runtime-root /opt/hagicode/runtime --check-only
|
|
208
|
+
hagiscript runtime remove --components code-server --purge
|
|
209
|
+
hagiscript runtime state --json
|
|
210
|
+
```
|
|
211
|
+
|
|
212
|
+
默认运行时布局如下:
|
|
213
|
+
|
|
214
|
+
```text
|
|
215
|
+
<runtime-root>/
|
|
216
|
+
program/
|
|
217
|
+
bin/
|
|
218
|
+
npm/
|
|
219
|
+
components/
|
|
220
|
+
runtime-data/
|
|
221
|
+
config/
|
|
222
|
+
logs/
|
|
223
|
+
data/
|
|
224
|
+
components/
|
|
225
|
+
state.json
|
|
226
|
+
```
|
|
227
|
+
|
|
228
|
+
`hagiscript runtime state --json` 是安装、更新、删除与下游诊断的标准状态接口。它会输出解析后的运行时程序目录、运行时数据根目录、组件级 `HAGICODE_RUNTIME_DATA_HOME`,以及派生出的 `PM2_HOME`,下游工具不需要再自己探测文件系统。
|
|
229
|
+
|
|
230
|
+
运行时脚本和 PM2 托管服务会共享同一套公开环境变量约定:
|
|
231
|
+
|
|
232
|
+
- `HAGICODE_RUNTIME_HOME`:运行时程序目录
|
|
233
|
+
- `HAGICODE_RUNTIME_DATA_HOME`:当前组件的可写运行时数据目录
|
|
234
|
+
- `PM2_HOME`:默认位于 `HAGICODE_RUNTIME_DATA_HOME` 下的独立子目录
|
|
235
|
+
- `PATH`:优先注入托管 Node 运行时、托管 npm 前缀和托管 wrapper,再继承当前 shell 的 PATH
|
|
236
|
+
|
|
237
|
+
### PM2 托管服务命令
|
|
238
|
+
|
|
239
|
+
`hagiscript pm2` 用于管理运行时作用域内的 `omniroute` 和 `code-server` 服务,底层始终调用 `hagiscript runtime install` 安装到托管 npm 前缀中的 PM2。
|
|
240
|
+
|
|
241
|
+
```bash
|
|
242
|
+
hagiscript pm2 omniroute start
|
|
243
|
+
hagiscript pm2 omniroute status
|
|
244
|
+
hagiscript pm2 code-server stop
|
|
245
|
+
```
|
|
246
|
+
|
|
247
|
+
每次 PM2 命令都会先解析运行时 manifest,计算规范化的运行时目录和组件数据目录,再以组件级 `PM2_HOME` 和托管 Node-first PATH 调用 `<runtime-home>/npm` 下的 PM2;它不会依赖系统预装的 PM2 或系统 Node。
|
|
248
|
+
|
|
249
|
+
`runtime/manifest.yaml` 现在支持以下覆盖项:
|
|
250
|
+
|
|
251
|
+
- 运行时级别:`paths.runtimeHome`、`paths.runtimeDataRoot`、`paths.componentDataRoot`、`paths.defaultPm2Home`
|
|
252
|
+
- 组件级别:`runtimeDataDir`
|
|
253
|
+
- 服务级别:`pm2.appName`、`pm2.cwd`、`pm2.script`、`pm2.args`、`pm2.env`、`pm2.pm2Home`
|
|
254
|
+
|
|
200
255
|
在 ESM 项目中使用库 API:
|
|
201
256
|
|
|
202
257
|
```ts
|
package/bin/runtime
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
import { runCli } from "../dist/cli.js"
|
|
4
|
+
|
|
5
|
+
const argv = [
|
|
6
|
+
process.argv[0] ?? process.execPath,
|
|
7
|
+
"hagicode-runtime",
|
|
8
|
+
"runtime",
|
|
9
|
+
...process.argv.slice(2)
|
|
10
|
+
]
|
|
11
|
+
|
|
12
|
+
runCli(argv).catch((error) => {
|
|
13
|
+
const message = error instanceof Error ? error.message : String(error)
|
|
14
|
+
process.stderr.write(`${message}\n`)
|
|
15
|
+
process.exitCode = 1
|
|
16
|
+
})
|
package/dist/cli.js
CHANGED
|
@@ -5,6 +5,8 @@ import { Command } from "commander";
|
|
|
5
5
|
import { createRuntimeInfo, packageVersion } from "./index.js";
|
|
6
6
|
import { registerNpmSyncCommand } from "./commands/npm-sync-commands.js";
|
|
7
7
|
import { registerNodeRuntimeCommands } from "./commands/node-runtime-commands.js";
|
|
8
|
+
import { registerPm2Commands } from "./commands/pm2-commands.js";
|
|
9
|
+
import { registerRuntimeCommands } from "./commands/runtime-commands.js";
|
|
8
10
|
export function createCli() {
|
|
9
11
|
const program = new Command();
|
|
10
12
|
program
|
|
@@ -20,6 +22,8 @@ export function createCli() {
|
|
|
20
22
|
});
|
|
21
23
|
registerNodeRuntimeCommands(program);
|
|
22
24
|
registerNpmSyncCommand(program);
|
|
25
|
+
registerPm2Commands(program);
|
|
26
|
+
registerRuntimeCommands(program);
|
|
23
27
|
program.action(() => {
|
|
24
28
|
program.outputHelp();
|
|
25
29
|
});
|
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;
|
|
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;AAEzE,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,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AE;QAChC,MAAM,OAAO,GAAG,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;QACvE,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,GAAG,OAAO,IAAI,CAAC,CAAC;QACrC,OAAO,CAAC,QAAQ,GAAG,CAAC,CAAC;IACvB,CAAC,CAAC,CAAC;AACL,CAAC"}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import { InvalidArgumentError } from "commander";
|
|
2
|
+
import { renderManagedPm2StatusText, runManagedPm2Command, supportedPm2Services } from "../runtime/pm2-manager.js";
|
|
3
|
+
export function registerPm2Commands(program) {
|
|
4
|
+
program
|
|
5
|
+
.command("pm2")
|
|
6
|
+
.description("manage PM2-backed hagicode-runtime services")
|
|
7
|
+
.argument("<service>", "managed service name", parseManagedPm2Service)
|
|
8
|
+
.argument("<action>", "pm2 action", parseManagedPm2Action)
|
|
9
|
+
.option("--from-manifest <path>", "override the default runtime manifest")
|
|
10
|
+
.option("--runtime-root <path>", "managed runtime root override")
|
|
11
|
+
.action(async (service, action, options, command) => {
|
|
12
|
+
try {
|
|
13
|
+
const result = await runManagedPm2Command({
|
|
14
|
+
manifestPath: validatePathOption(options.fromManifest, "--from-manifest"),
|
|
15
|
+
runtimeRoot: validatePathOption(options.runtimeRoot, "--runtime-root"),
|
|
16
|
+
service,
|
|
17
|
+
action
|
|
18
|
+
});
|
|
19
|
+
process.stdout.write(`${renderManagedPm2StatusText(result)}\n`);
|
|
20
|
+
}
|
|
21
|
+
catch (error) {
|
|
22
|
+
command.error(formatPm2Error(error), { exitCode: 1 });
|
|
23
|
+
}
|
|
24
|
+
});
|
|
25
|
+
}
|
|
26
|
+
function parseManagedPm2Service(value) {
|
|
27
|
+
if (supportedPm2Services.includes(value)) {
|
|
28
|
+
return value;
|
|
29
|
+
}
|
|
30
|
+
throw new InvalidArgumentError(`Unsupported managed PM2 service "${value}". Supported services: ${supportedPm2Services.join(", ")}.`);
|
|
31
|
+
}
|
|
32
|
+
function parseManagedPm2Action(value) {
|
|
33
|
+
if (value === "start" || value === "stop" || value === "status") {
|
|
34
|
+
return value;
|
|
35
|
+
}
|
|
36
|
+
throw new InvalidArgumentError(`Unsupported PM2 action "${value}". Supported actions: start, stop, status.`);
|
|
37
|
+
}
|
|
38
|
+
function validatePathOption(value, optionName) {
|
|
39
|
+
if (value === undefined) {
|
|
40
|
+
return undefined;
|
|
41
|
+
}
|
|
42
|
+
const normalized = value.trim();
|
|
43
|
+
if (!normalized) {
|
|
44
|
+
throw new InvalidArgumentError(`${optionName} must be a non-empty path.`);
|
|
45
|
+
}
|
|
46
|
+
if (normalized.includes("\0")) {
|
|
47
|
+
throw new InvalidArgumentError(`${optionName} contains an invalid null byte.`);
|
|
48
|
+
}
|
|
49
|
+
return normalized;
|
|
50
|
+
}
|
|
51
|
+
function formatPm2Error(error) {
|
|
52
|
+
return error instanceof Error ? error.message : String(error);
|
|
53
|
+
}
|
|
54
|
+
//# sourceMappingURL=pm2-commands.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pm2-commands.js","sourceRoot":"","sources":["../../src/commands/pm2-commands.ts"],"names":[],"mappings":"AAAA,OAAO,EAAW,oBAAoB,EAAE,MAAM,WAAW,CAAA;AACzD,OAAO,EACL,0BAA0B,EAC1B,oBAAoB,EACpB,oBAAoB,EAGrB,MAAM,2BAA2B,CAAA;AAOlC,MAAM,UAAU,mBAAmB,CAAC,OAAgB;IAClD,OAAO;SACJ,OAAO,CAAC,KAAK,CAAC;SACd,WAAW,CAAC,6CAA6C,CAAC;SAC1D,QAAQ,CAAC,WAAW,EAAE,sBAAsB,EAAE,sBAAsB,CAAC;SACrE,QAAQ,CAAC,UAAU,EAAE,YAAY,EAAE,qBAAqB,CAAC;SACzD,MAAM,CAAC,wBAAwB,EAAE,uCAAuC,CAAC;SACzE,MAAM,CAAC,uBAAuB,EAAE,+BA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A;IAClB,CAAC;IAED,MAAM,UAAU,GAAG,KAAK,CAAC,IAAI,EAAE,CAAA;IAC/B,IAAI,CAAC,UAAU,EAAE,CAAC;QAChB,MAAM,IAAI,oBAAoB,CAAC,GAAG,UAAU,4BAA4B,CAAC,CAAA;IAC3E,CAAC;IAED,IAAI,UAAU,CAAC,QAAQ,CAAC,IAAI,CAAC,EAAE,CAAC;QAC9B,MAAM,IAAI,oBAAoB,CAAC,GAAG,UAAU,iCAAiC,CAAC,CAAA;IAChF,CAAC;IAED,OAAO,UAAU,CAAA;AACnB,CAAC;AAED,SAAS,cAAc,CAAC,KAAc;IACpC,OAAO,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAA;AAC/D,CAAC"}
|
|
@@ -0,0 +1,136 @@
|
|
|
1
|
+
import { InvalidArgumentError } from "commander";
|
|
2
|
+
import { installRuntime, queryRuntimeState, removeRuntime, renderRuntimeStateText, updateRuntime } from "../runtime/runtime-manager.js";
|
|
3
|
+
export function registerRuntimeCommands(program) {
|
|
4
|
+
const runtime = program
|
|
5
|
+
.command("runtime")
|
|
6
|
+
.description("manage manifest-driven hagicode-runtime components");
|
|
7
|
+
runtime
|
|
8
|
+
.command("install")
|
|
9
|
+
.description("install runtime components into a managed runtime root")
|
|
10
|
+
.option("--from-manifest <path>", "override the default runtime manifest")
|
|
11
|
+
.option("--runtime-root <path>", "managed runtime root override")
|
|
12
|
+
.option("--components <list>", "comma-separated runtime component names to install", parseComponentList)
|
|
13
|
+
.option("--dry-run", "print the install plan without mutating managed files")
|
|
14
|
+
.option("--force", "force reinstall of mutable managed components")
|
|
15
|
+
.option("--verbose", "print detailed lifecycle output")
|
|
16
|
+
.action(async (options, command) => {
|
|
17
|
+
await runLifecycleCommand("install", options, command);
|
|
18
|
+
});
|
|
19
|
+
runtime
|
|
20
|
+
.command("remove")
|
|
21
|
+
.description("remove runtime components from the managed runtime root")
|
|
22
|
+
.option("--from-manifest <path>", "override the default runtime manifest")
|
|
23
|
+
.option("--runtime-root <path>", "managed runtime root override")
|
|
24
|
+
.option("--components <list>", "comma-separated runtime component names to remove", parseComponentList)
|
|
25
|
+
.option("--dry-run", "print the removal plan without mutating managed files")
|
|
26
|
+
.option("--force", "reserved compatibility flag for scripted removals")
|
|
27
|
+
.option("--purge", "remove retained managed config and data where supported")
|
|
28
|
+
.option("--verbose", "print detailed lifecycle output")
|
|
29
|
+
.action(async (options, command) => {
|
|
30
|
+
await runLifecycleCommand("remove", options, command);
|
|
31
|
+
});
|
|
32
|
+
runtime
|
|
33
|
+
.command("update")
|
|
34
|
+
.description("update installed runtime components")
|
|
35
|
+
.option("--from-manifest <path>", "override the default runtime manifest")
|
|
36
|
+
.option("--runtime-root <path>", "managed runtime root override")
|
|
37
|
+
.option("--components <list>", "comma-separated runtime component names to update", parseComponentList)
|
|
38
|
+
.option("--dry-run", "print the update plan without mutating managed files")
|
|
39
|
+
.option("--check-only", "report components that would be updated")
|
|
40
|
+
.option("--force", "force update execution for mutable managed components")
|
|
41
|
+
.option("--verbose", "print detailed lifecycle output")
|
|
42
|
+
.action(async (options, command) => {
|
|
43
|
+
await runLifecycleCommand("update", options, command);
|
|
44
|
+
});
|
|
45
|
+
runtime
|
|
46
|
+
.command("state")
|
|
47
|
+
.description("query the canonical managed runtime state")
|
|
48
|
+
.option("--from-manifest <path>", "override the default runtime manifest")
|
|
49
|
+
.option("--runtime-root <path>", "managed runtime root override")
|
|
50
|
+
.option("--json", "emit machine-readable JSON output")
|
|
51
|
+
.action(async (options, command) => {
|
|
52
|
+
try {
|
|
53
|
+
const report = await queryRuntimeState({
|
|
54
|
+
manifestPath: validatePathOption(options.fromManifest, "--from-manifest"),
|
|
55
|
+
runtimeRoot: validatePathOption(options.runtimeRoot, "--runtime-root")
|
|
56
|
+
});
|
|
57
|
+
process.stdout.write(options.json
|
|
58
|
+
? `${JSON.stringify(report, null, 2)}\n`
|
|
59
|
+
: `${renderRuntimeStateText(report)}\n`);
|
|
60
|
+
}
|
|
61
|
+
catch (error) {
|
|
62
|
+
command.error(formatRuntimeError(error), { exitCode: 1 });
|
|
63
|
+
}
|
|
64
|
+
});
|
|
65
|
+
}
|
|
66
|
+
async function runLifecycleCommand(phase, options, command) {
|
|
67
|
+
const runtimeOptions = {
|
|
68
|
+
manifestPath: validatePathOption(options.fromManifest, "--from-manifest"),
|
|
69
|
+
runtimeRoot: validatePathOption(options.runtimeRoot, "--runtime-root"),
|
|
70
|
+
components: options.components ?? [],
|
|
71
|
+
dryRun: options.dryRun ?? false,
|
|
72
|
+
force: options.force ?? false,
|
|
73
|
+
purge: "purge" in options ? options.purge ?? false : false,
|
|
74
|
+
checkOnly: "checkOnly" in options ? options.checkOnly ?? false : false,
|
|
75
|
+
verbose: options.verbose ?? false,
|
|
76
|
+
logger: (message) => process.stdout.write(`${message}\n`)
|
|
77
|
+
};
|
|
78
|
+
try {
|
|
79
|
+
const result = phase === "install"
|
|
80
|
+
? await installRuntime(runtimeOptions)
|
|
81
|
+
: phase === "remove"
|
|
82
|
+
? await removeRuntime(runtimeOptions)
|
|
83
|
+
: await updateRuntime(runtimeOptions);
|
|
84
|
+
printLifecycleSummary(phase, runtimeOptions, result);
|
|
85
|
+
}
|
|
86
|
+
catch (error) {
|
|
87
|
+
command.error(formatRuntimeError(error), { exitCode: 1 });
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
function parseComponentList(value) {
|
|
91
|
+
const components = value
|
|
92
|
+
.split(",")
|
|
93
|
+
.map((item) => item.trim())
|
|
94
|
+
.filter(Boolean);
|
|
95
|
+
if (components.length === 0) {
|
|
96
|
+
throw new InvalidArgumentError("--components must include at least one component name.");
|
|
97
|
+
}
|
|
98
|
+
return Array.from(new Set(components));
|
|
99
|
+
}
|
|
100
|
+
function validatePathOption(value, optionName) {
|
|
101
|
+
if (value === undefined) {
|
|
102
|
+
return undefined;
|
|
103
|
+
}
|
|
104
|
+
const normalized = value.trim();
|
|
105
|
+
if (!normalized) {
|
|
106
|
+
throw new InvalidArgumentError(`${optionName} must be a non-empty path.`);
|
|
107
|
+
}
|
|
108
|
+
if (normalized.includes("\0")) {
|
|
109
|
+
throw new InvalidArgumentError(`${optionName} contains an invalid null byte.`);
|
|
110
|
+
}
|
|
111
|
+
return normalized;
|
|
112
|
+
}
|
|
113
|
+
function printLifecycleSummary(phase, options, result) {
|
|
114
|
+
const modeSuffix = options.dryRun || (phase === "update" && options.checkOnly)
|
|
115
|
+
? options.checkOnly
|
|
116
|
+
? " (check-only)"
|
|
117
|
+
: " (dry-run)"
|
|
118
|
+
: "";
|
|
119
|
+
process.stdout.write(`Runtime ${phase} complete${modeSuffix}.\n`);
|
|
120
|
+
process.stdout.write(`Manifest: ${result.manifest.manifestPath}\n`);
|
|
121
|
+
process.stdout.write(`Managed root: ${result.paths.root}\n`);
|
|
122
|
+
process.stdout.write(`Planned components: ${result.plan.length}\n`);
|
|
123
|
+
process.stdout.write(`Changed components: ${result.changedComponents.length}\n`);
|
|
124
|
+
if (result.skipped.length > 0) {
|
|
125
|
+
for (const skipped of result.skipped) {
|
|
126
|
+
process.stdout.write(`Skipped: ${skipped.componentName} (${skipped.reason})\n`);
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
if (result.logFilePath) {
|
|
130
|
+
process.stdout.write(`Log: ${result.logFilePath}\n`);
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
function formatRuntimeError(error) {
|
|
134
|
+
return error instanceof Error ? error.message : String(error);
|
|
135
|
+
}
|
|
136
|
+
//# sourceMappingURL=runtime-commands.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"runtime-commands.js","sourceRoot":"","sources":["../../src/commands/runtime-commands.ts"],"names":[],"mappings":"AAAA,OAAO,EAAW,oBAAoB,EAAE,MAAM,WAAW,CAAA;AACzD,OAAO,EACL,cAAc,EACd,iBAAiB,EACjB,aAAa,EACb,sBAAsB,EACtB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AAM,CAAC,KAAK,CAAC,CAAA;AAC/D,CAAC"}
|
package/dist/index.d.ts
CHANGED
|
@@ -9,3 +9,9 @@ export { getDefaultManagedNodeRuntimeDirectory, installNodeRuntime, resolveManag
|
|
|
9
9
|
export { verifyNodeRuntime, type NodeRuntimeVerificationResult } from "./runtime/node-verify.js";
|
|
10
10
|
export { createNpmSyncPlan, loadNpmSyncManifest, normalizeGlobalInventory, syncNpmGlobals, validateNpmSyncManifest, type InstalledGlobalPackages, type NpmSyncActionKind, type NpmSyncActionResult, type NpmSyncCommandKind, type NpmSyncFallbackEvent, type NpmSyncFallbackPolicy, type NpmSyncManifest, type NpmSyncManifestEntry, type NpmSyncPlannedAction, type NpmSyncRuntimeMetadata, type NpmSyncSummary } from "./runtime/npm-sync.js";
|
|
11
11
|
export { buildToolSyncPackageSet, builtInToolSyncCatalog, normalizeToolSyncEntry, validateToolSyncCatalog, type CustomAgentCliToolInput, type ToolSyncCatalogEntry, type ToolSyncGroupId, type ToolSyncPackageConstraint, type ToolSyncRequirement, type ToolSyncSelection } from "./runtime/tool-sync-catalog.js";
|
|
12
|
+
export { getDefaultRuntimeManifestPath, loadRuntimeManifest, type LoadedRuntimeManifest, type RuntimeComponentDefinition, type RuntimeLifecyclePhase, type RuntimeManifestPaths } from "./runtime/runtime-manifest.js";
|
|
13
|
+
export { defaultRuntimeRoot, getComponentConfigDirectory, getComponentLogsDirectory, getComponentManagedRoot, getComponentPm2Home, getComponentRuntimeDataHome, resolveRuntimePaths, type ResolvedRuntimePaths } from "./runtime/runtime-paths.js";
|
|
14
|
+
export { createInitialRuntimeState, mergeRuntimeState, readRuntimeState, writeRuntimeState, type RuntimeComponentState, type RuntimeOperationState, type RuntimeState } from "./runtime/runtime-state.js";
|
|
15
|
+
export { renderManagedPm2StatusText, resolveManagedPm2ServiceDefinition, runManagedPm2Command, supportedPm2Services, type ManagedPm2Action, type ManagedPm2CommandResult, type ManagedPm2CommandOptions, type ManagedPm2ServiceName, type ManagedPm2Status, type ResolvedManagedPm2ServiceDefinition } from "./runtime/pm2-manager.js";
|
|
16
|
+
export { buildManagedRuntimeEnvironment, getManagedNpmBinDirectory, getManagedRuntimePathEntries, prependPathEntries } from "./runtime/runtime-executor.js";
|
|
17
|
+
export { installRuntime, planRuntimeLifecycle, queryRuntimeState, removeRuntime, renderRuntimeStateText, runRuntimeLifecycle, updateRuntime, type RuntimeLifecycleOptions, type RuntimeLifecycleResult, type RuntimePlannedAction, type RuntimeStateReport } from "./runtime/runtime-manager.js";
|
package/dist/index.js
CHANGED
|
@@ -11,4 +11,10 @@ export { getDefaultManagedNodeRuntimeDirectory, installNodeRuntime, resolveManag
|
|
|
11
11
|
export { verifyNodeRuntime } from "./runtime/node-verify.js";
|
|
12
12
|
export { createNpmSyncPlan, loadNpmSyncManifest, normalizeGlobalInventory, syncNpmGlobals, validateNpmSyncManifest } from "./runtime/npm-sync.js";
|
|
13
13
|
export { buildToolSyncPackageSet, builtInToolSyncCatalog, normalizeToolSyncEntry, validateToolSyncCatalog } from "./runtime/tool-sync-catalog.js";
|
|
14
|
+
export { getDefaultRuntimeManifestPath, loadRuntimeManifest } from "./runtime/runtime-manifest.js";
|
|
15
|
+
export { defaultRuntimeRoot, getComponentConfigDirectory, getComponentLogsDirectory, getComponentManagedRoot, getComponentPm2Home, getComponentRuntimeDataHome, resolveRuntimePaths } from "./runtime/runtime-paths.js";
|
|
16
|
+
export { createInitialRuntimeState, mergeRuntimeState, readRuntimeState, writeRuntimeState } from "./runtime/runtime-state.js";
|
|
17
|
+
export { renderManagedPm2StatusText, resolveManagedPm2ServiceDefinition, runManagedPm2Command, supportedPm2Services } from "./runtime/pm2-manager.js";
|
|
18
|
+
export { buildManagedRuntimeEnvironment, getManagedNpmBinDirectory, getManagedRuntimePathEntries, prependPathEntries } from "./runtime/runtime-executor.js";
|
|
19
|
+
export { installRuntime, planRuntimeLifecycle, queryRuntimeState, removeRuntime, renderRuntimeStateText, runRuntimeLifecycle, updateRuntime } from "./runtime/runtime-manager.js";
|
|
14
20
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AAE3D,OAAO,EACL,kBAAkB,EAClB,WAAW,EACX,cAAc,EAEf,MAAM,cAAc,CAAC;AAQtB,MAAM,UAAU,iBAAiB;IAC/B,OAAO;QACL,WAAW;QACX,OAAO,EAAE,cAAc;QACvB,MAAM,EAAE,YAAY;KACrB,CAAC;AACJ,CAAC;AAED,OAAO,EACL,qCAAqC,EACrC,kBAAkB,EAClB,yBAAyB,EAG1B,MAAM,6BAA6B,CAAC;AACrC,OAAO,EACL,iBAAiB,EAElB,MAAM,0BAA0B,CAAC;AAClC,OAAO,EACL,iBAAiB,EACjB,mBAAmB,EACnB,wBAAwB,EACxB,cAAc,EACd,uBAAuB,EAYxB,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EACL,uBAAuB,EACvB,sBAAsB,EACtB,sBAAsB,EACtB,uBAAuB,EAOxB,MAAM,gCAAgC,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AAE3D,OAAO,EACL,kBAAkB,EAClB,WAAW,EACX,cAAc,EAEf,MAAM,cAAc,CAAC;AAQtB,MAAM,UAAU,iBAAiB;IAC/B,OAAO;QACL,WAAW;QACX,OAAO,EAAE,cAAc;QACvB,MAAM,EAAE,YAAY;KACrB,CAAC;AACJ,CAAC;AAED,OAAO,EACL,qCAAqC,EACrC,kBAAkB,EAClB,yBAAyB,EAG1B,MAAM,6BAA6B,CAAC;AACrC,OAAO,EACL,iBAAiB,EAElB,MAAM,0BAA0B,CAAC;AAClC,OAAO,EACL,iBAAiB,EACjB,mBAAmB,EACnB,wBAAwB,EACxB,cAAc,EACd,uBAAuB,EAYxB,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EACL,uBAAuB,EACvB,sBAAsB,EACtB,sBAAsB,EACtB,uBAAuB,EAOxB,MAAM,gCAAgC,CAAC;AACxC,OAAO,EACL,6BAA6B,EAC7B,mBAAmB,EAKpB,MAAM,+BAA+B,CAAC;AACvC,OAAO,EACL,kBAAkB,EAClB,2BAA2B,EAC3B,yBAAyB,EACzB,uBAAuB,EACvB,mBAAmB,EACnB,2BAA2B,EAC3B,mBAAmB,EAEpB,MAAM,4BAA4B,CAAC;AACpC,OAAO,EACL,yBAAyB,EACzB,iBAAiB,EACjB,gBAAgB,EAChB,iBAAiB,EAIlB,MAAM,4BAA4B,CAAC;AACpC,OAAO,EACL,0BAA0B,EAC1B,kCAAkC,EAClC,oBAAoB,EACpB,oBAAoB,EAOrB,MAAM,0BAA0B,CAAC;AAClC,OAAO,EACL,8BAA8B,EAC9B,yBAAyB,EACzB,4BAA4B,EAC5B,kBAAkB,EACnB,MAAM,+BAA+B,CAAC;AACvC,OAAO,EACL,cAAc,EACd,oBAAoB,EACpB,iBAAiB,EACjB,aAAa,EACb,sBAAsB,EACtB,mBAAmB,EACnB,aAAa,EAKd,MAAM,8BAA8B,CAAC"}
|
|
@@ -19,6 +19,7 @@ export function normalizeCommandPath(commandPath) {
|
|
|
19
19
|
return trimmed;
|
|
20
20
|
}
|
|
21
21
|
export function requiresShellLaunch(_commandPath, _platform = process.platform) {
|
|
22
|
+
void _platform;
|
|
22
23
|
// Execa already handles Windows command shims without a shell wrapper.
|
|
23
24
|
// Keeping direct execution preserves argv boundaries for paths with spaces.
|
|
24
25
|
return false;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"command-launch.js","sourceRoot":"","sources":["../../src/runtime/command-launch.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,OAAO,CAAC;AA4C9B,MAAM,OA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CAAC,UAAU,CAAC,QAAQ,CAAC,CAAC,CAAC,SAAS,CAAC;IAC3F,MAAM,MAAM,GAAG,OAAO,UAAU,CAAC,MAAM,KAAK,QAAQ,CAAC,CAAC,CAAC,UAAU,CAAC,MAAM,CAAC,CAAC,CAAC,SAAS,CAAC;IACrF,MAAM,MAAM,GAAG,UAAU,CAAC,MAAM,KAAK,KAAK,CAAC;IAE3C,OAAO,IAAI,qBAAqB,CAC9B,YAAY,IAAI,mBAAmB,OAAO,IAAI,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE,EAC9D;QACE,OAAO;QACP,IAAI;QACJ,MAAM;QACN,MAAM;QACN,GAAG,EAAE,OAAO,UAAU,CAAC,GAAG,KAAK,QAAQ,CAAC,CAAC,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC,CAAC,OAAO,CAAC,GAAG;QACtE,QAAQ;QACR,MAAM;QACN,QAAQ;QACR,MAAM;QACN,YAAY;KACb,EACD,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,KAAK,EAAE,CAAC,CAAC,CAAC,SAAS,CACtD,CAAC;AACJ,CAAC;AAED,SAAS,eAAe,CAAC,MAAe;IACtC,IAAI,OAAO,MAAM,KAAK,QAAQ,EAAE,CAAC;QAC/B,OAAO,MAAM,CAAC;IAChB,CAAC;IAED,IAAI,MAAM,CAAC,QAAQ,CAAC,MAAM,CAAC,EAAE,CAAC;QAC5B,OAAO,MAAM,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC;IACjC,CAAC;IAED,OAAO,EAAE,CAAC;AACZ,CAAC"}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import type { CommandRunner } from "./command-launch.js";
|
|
2
|
+
import { type LoadedRuntimeManifest, type RuntimeComponentDefinition } from "./runtime-manifest.js";
|
|
3
|
+
import { type ResolvedRuntimePaths } from "./runtime-paths.js";
|
|
4
|
+
export declare const supportedPm2Services: readonly ["omniroute", "code-server"];
|
|
5
|
+
export type ManagedPm2ServiceName = (typeof supportedPm2Services)[number];
|
|
6
|
+
export type ManagedPm2Action = "start" | "stop" | "status";
|
|
7
|
+
export type ManagedPm2Status = "online" | "stopped" | "errored" | "missing" | "unknown";
|
|
8
|
+
export interface ManagedPm2CommandOptions {
|
|
9
|
+
manifestPath?: string;
|
|
10
|
+
runtimeRoot?: string;
|
|
11
|
+
service: ManagedPm2ServiceName;
|
|
12
|
+
action: ManagedPm2Action;
|
|
13
|
+
runner?: CommandRunner;
|
|
14
|
+
}
|
|
15
|
+
export interface ResolvedManagedPm2ServiceDefinition {
|
|
16
|
+
service: ManagedPm2ServiceName;
|
|
17
|
+
component: RuntimeComponentDefinition;
|
|
18
|
+
manifestDir: string;
|
|
19
|
+
paths: ResolvedRuntimePaths;
|
|
20
|
+
appName: string;
|
|
21
|
+
cwd: string;
|
|
22
|
+
script: string;
|
|
23
|
+
args: string[];
|
|
24
|
+
env: Record<string, string>;
|
|
25
|
+
runtimeHome: string;
|
|
26
|
+
runtimeDataHome: string;
|
|
27
|
+
componentRoot: string;
|
|
28
|
+
componentConfigDir: string;
|
|
29
|
+
pm2Home: string;
|
|
30
|
+
pm2Binary: string;
|
|
31
|
+
nodePath: string;
|
|
32
|
+
}
|
|
33
|
+
export interface ManagedPm2CommandResult {
|
|
34
|
+
service: ManagedPm2ServiceName;
|
|
35
|
+
action: ManagedPm2Action;
|
|
36
|
+
appName: string;
|
|
37
|
+
cwd: string;
|
|
38
|
+
script: string;
|
|
39
|
+
runtimeHome: string;
|
|
40
|
+
runtimeDataHome: string;
|
|
41
|
+
pm2Home: string;
|
|
42
|
+
pm2Binary: string;
|
|
43
|
+
exists: boolean;
|
|
44
|
+
status: ManagedPm2Status;
|
|
45
|
+
pid: number | null;
|
|
46
|
+
stdout: string;
|
|
47
|
+
stderr: string;
|
|
48
|
+
}
|
|
49
|
+
export declare class ManagedPm2Error extends Error {
|
|
50
|
+
constructor(message: string, options?: ErrorOptions);
|
|
51
|
+
}
|
|
52
|
+
export declare function runManagedPm2Command(options: ManagedPm2CommandOptions): Promise<ManagedPm2CommandResult>;
|
|
53
|
+
export declare function resolveManagedPm2ServiceDefinition(manifest: LoadedRuntimeManifest, paths: ResolvedRuntimePaths, service: ManagedPm2ServiceName): Promise<ResolvedManagedPm2ServiceDefinition>;
|
|
54
|
+
export declare function renderManagedPm2StatusText(result: ManagedPm2CommandResult): string;
|