@actiondock/cli 2.0.11 → 2.0.12

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 (54) hide show
  1. package/README.md +15 -2
  2. package/bin/ad.js +13 -2
  3. package/dist/commands/action/create.d.ts +2 -0
  4. package/dist/commands/action/index.d.ts +16 -0
  5. package/dist/commands/action/list.d.ts +5 -0
  6. package/dist/commands/action/run.d.ts +4 -0
  7. package/dist/commands/action/show.d.ts +5 -0
  8. package/dist/commands/action/sync.d.ts +2 -0
  9. package/dist/commands/action/validate.d.ts +5 -0
  10. package/dist/commands/build.d.ts +2 -0
  11. package/dist/commands/config.d.ts +2 -0
  12. package/dist/commands/doctor.d.ts +2 -0
  13. package/dist/commands/export.d.ts +2 -0
  14. package/dist/commands/index.d.ts +2 -0
  15. package/dist/commands/info.d.ts +2 -0
  16. package/dist/commands/init.d.ts +2 -0
  17. package/dist/commands/link.d.ts +2 -0
  18. package/dist/commands/mcp.d.ts +2 -0
  19. package/dist/commands/playbook.d.ts +6 -0
  20. package/dist/commands/profile.d.ts +2 -0
  21. package/dist/commands/runs.d.ts +2 -0
  22. package/dist/commands/serve.d.ts +2 -0
  23. package/dist/commands/state.d.ts +2 -0
  24. package/dist/commands/test.d.ts +2 -0
  25. package/dist/index.d.ts +8 -0
  26. package/dist/index.js +745 -65708
  27. package/{src/utils/bytes.ts → dist/utils/bytes.d.ts} +0 -1
  28. package/{src/utils/filter.ts → dist/utils/filter.d.ts} +0 -1
  29. package/package.json +20 -15
  30. package/src/commands/action/create.ts +0 -129
  31. package/src/commands/action/index.ts +0 -27
  32. package/src/commands/action/list.ts +0 -247
  33. package/src/commands/action/run.ts +0 -197
  34. package/src/commands/action/show.ts +0 -128
  35. package/src/commands/action/sync.ts +0 -76
  36. package/src/commands/action/validate.ts +0 -102
  37. package/src/commands/build.ts +0 -56
  38. package/src/commands/config.ts +0 -583
  39. package/src/commands/doctor.ts +0 -84
  40. package/src/commands/export.ts +0 -196
  41. package/src/commands/index.ts +0 -75
  42. package/src/commands/info.ts +0 -537
  43. package/src/commands/init.ts +0 -24
  44. package/src/commands/link.ts +0 -73
  45. package/src/commands/mcp.ts +0 -195
  46. package/src/commands/playbook.ts +0 -566
  47. package/src/commands/profile.ts +0 -296
  48. package/src/commands/runs.ts +0 -452
  49. package/src/commands/serve.ts +0 -132
  50. package/src/commands/state.ts +0 -590
  51. package/src/commands/test.ts +0 -48
  52. package/src/index.ts +0 -58
  53. /package/{src/commands/action.ts → dist/commands/action.d.ts} +0 -0
  54. /package/{src/utils/duration.ts → dist/utils/duration.d.ts} +0 -0
package/README.md CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  ActionDock 2.0 官方命令行门面工具链。
4
4
 
5
- [![Node.js](https://img.shields.io/badge/Node.js-%3E%3D22.12.0-green?logo=node.js)](https://nodejs.org/)
5
+ [![Node.js](https://img.shields.io/badge/Node.js-%3E%3D22.13.0-green?logo=node.js)](https://nodejs.org/)
6
6
  [![TypeScript](https://img.shields.io/badge/TypeScript-5.0+-blue?logo=typescript)](https://www.typescriptlang.org/)
7
7
  [![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://opensource.org/licenses/Apache-2.0)
8
8
 
@@ -12,7 +12,7 @@ ActionDock 2.0 官方命令行门面工具链。
12
12
 
13
13
  ## 运行环境
14
14
 
15
- - 原生基于 Node.js 22.12.0 或更高版本运行。
15
+ - 原生基于 Node.js 22.13.0 或更高版本运行。
16
16
  - 支持 npm、pnpm 与 yarn 进行全局安装或项目级管理。
17
17
  - 日常开发、调试、测试、MCP 服务启动与 HTTP 部署完全基于 Node.js,无需安装 Bun。
18
18
  - 仅在使用 `ad build` 编译单文件独立二进制产物时,需要系统安装外部 Bun 编译器。
@@ -33,6 +33,19 @@ npm install -g @actiondock/cli
33
33
  npx ad --help
34
34
  ```
35
35
 
36
+ ### 从源码安装本地开发版
37
+
38
+ 若需从仓库源码调试最新开发版本:
39
+
40
+ ```bash
41
+ git clone https://github.com/team4u/actiondock.git
42
+ cd actiondock
43
+ bun install
44
+ bun run build
45
+ cd packages/cli
46
+ npm link
47
+ ```
48
+
36
49
  ---
37
50
 
38
51
  ## 快速上手流程
package/bin/ad.js CHANGED
@@ -29,9 +29,15 @@ if (!isBun && !hasTsx) {
29
29
  }
30
30
  }
31
31
 
32
+ const extraArgs = [];
33
+ const [major, minor] = (process.versions.node || "").split(".").map(Number);
34
+ if (major === 22 && minor < 13) {
35
+ extraArgs.push("--experimental-sqlite");
36
+ }
37
+
32
38
  const res = spawnSync(
33
39
  process.execPath,
34
- ["--import", tsxSpecifier, fileURLToPath(import.meta.url), ...process.argv.slice(2)],
40
+ ["--import", tsxSpecifier, ...extraArgs, fileURLToPath(import.meta.url), ...process.argv.slice(2)],
35
41
  {
36
42
  stdio: "inherit",
37
43
  }
@@ -39,6 +45,11 @@ if (!isBun && !hasTsx) {
39
45
  process.exit(res.status ?? (res.signal ? 1 : 0));
40
46
  }
41
47
 
42
- const { main } = await import("../src/index.ts");
48
+ let main;
49
+ try {
50
+ ({ main } = await import("../dist/index.js"));
51
+ } catch {
52
+ ({ main } = await import("../src/index.ts"));
53
+ }
43
54
  await main(process.argv);
44
55
 
@@ -0,0 +1,2 @@
1
+ import type { Command } from "commander";
2
+ export declare function registerActionCreateCommand(actionCmd: Command): void;
@@ -0,0 +1,16 @@
1
+ import type { Command } from "commander";
2
+ import { executeAction } from "@actiondock/runtime-cli";
3
+ export { executeAction };
4
+ export { registerActionCreateCommand } from "./create";
5
+ export { registerActionSyncCommand } from "./sync";
6
+ export { registerActionListCommand } from "./list";
7
+ export { registerActionShowCommand } from "./show";
8
+ export { registerActionValidateCommand } from "./validate";
9
+ export { registerActionRunCommand } from "./run";
10
+ /**
11
+ * 注册 Action 相关的 CLI 命令集合。
12
+ * 委托 list, show, validate, run 至 @actiondock/runtime-cli,保留开发者专用的 create 与 sync 命令。
13
+ *
14
+ * @param program Commander 根程序对象
15
+ */
16
+ export declare function registerActionCommands(program: Command): void;
@@ -0,0 +1,5 @@
1
+ import type { Command } from "commander";
2
+ /**
3
+ * @deprecated 核心逻辑已统一下沉至 @actiondock/runtime-cli
4
+ */
5
+ export declare function registerActionListCommand(actionCmd: Command): void;
@@ -0,0 +1,4 @@
1
+ import { executeAction } from "@actiondock/runtime-cli";
2
+ import type { Command } from "commander";
3
+ export { executeAction };
4
+ export declare function registerActionRunCommand(actionCmd: Command, program: Command): void;
@@ -0,0 +1,5 @@
1
+ import type { Command } from "commander";
2
+ /**
3
+ * @deprecated 核心逻辑已统一下沉至 @actiondock/runtime-cli
4
+ */
5
+ export declare function registerActionShowCommand(actionCmd: Command): void;
@@ -0,0 +1,2 @@
1
+ import type { Command } from "commander";
2
+ export declare function registerActionSyncCommand(actionCmd: Command): void;
@@ -0,0 +1,5 @@
1
+ import type { Command } from "commander";
2
+ /**
3
+ * @deprecated 核心逻辑已统一下沉至 @actiondock/runtime-cli
4
+ */
5
+ export declare function registerActionValidateCommand(actionCmd: Command): void;
@@ -0,0 +1,2 @@
1
+ import { Command } from "commander";
2
+ export declare function registerBuildCommand(program: Command): void;
@@ -0,0 +1,2 @@
1
+ import type { Command } from "commander";
2
+ export declare function registerConfigCommands(program: Command): void;
@@ -0,0 +1,2 @@
1
+ import { Command } from "commander";
2
+ export declare function registerDoctorCommand(program: Command): void;
@@ -0,0 +1,2 @@
1
+ import { Command } from "commander";
2
+ export declare function registerExportCommand(program: Command): void;
@@ -0,0 +1,2 @@
1
+ import { Command } from "commander";
2
+ export declare function createCliProgram(): Command;
@@ -0,0 +1,2 @@
1
+ import type { Command } from "commander";
2
+ export declare function registerInfoCommand(program: Command): void;
@@ -0,0 +1,2 @@
1
+ import { Command } from "commander";
2
+ export declare function registerInitCommand(program: Command): void;
@@ -0,0 +1,2 @@
1
+ import { Command } from "commander";
2
+ export declare function registerLinkCommands(program: Command): void;
@@ -0,0 +1,2 @@
1
+ import type { Command } from "commander";
2
+ export declare function registerMcpCommands(program: Command): void;
@@ -0,0 +1,6 @@
1
+ import { Command } from "commander";
2
+ /**
3
+ * 注册 Playbook 命令集合。
4
+ * 委托 list, show, validate 至 @actiondock/runtime-cli,保留开发者专用的 create 命令。
5
+ */
6
+ export declare function registerPlaybookCommands(program: Command): void;
@@ -0,0 +1,2 @@
1
+ import { Command } from "commander";
2
+ export declare function registerProfileCommands(program: Command): void;
@@ -0,0 +1,2 @@
1
+ import type { Command } from "commander";
2
+ export declare function registerRunsCommands(program: Command): void;
@@ -0,0 +1,2 @@
1
+ import type { Command } from "commander";
2
+ export declare function registerServeCommand(program: Command): void;
@@ -0,0 +1,2 @@
1
+ import type { Command } from "commander";
2
+ export declare function registerStateCommands(program: Command): void;
@@ -0,0 +1,2 @@
1
+ import { Command } from "commander";
2
+ export declare function registerTestCommand(program: Command): void;
@@ -0,0 +1,8 @@
1
+ export * from "./commands";
2
+ /**
3
+ * ActionDock CLI 主执行入口函数。
4
+ *
5
+ * @param argv 命令行参数数组(默认使用 process.argv)
6
+ * @returns 进程退出码
7
+ */
8
+ export declare function main(argv?: string[]): Promise<number>;