@actiondock/cli 2.4.1 → 2.5.1

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.
@@ -1,12 +1,27 @@
1
1
  import { createActionDockTarget, findProjectRoot, resolvePackageRoot, resolveTarget, } from "@actiondock/core";
2
2
  import { createNodePlatform } from "@actiondock/runtime-node";
3
+ /**
4
+ * 统一为 Commander 命令节点挂载目标环境解析相关选项(单一事实源)。
5
+ * 包括:-p/--profile, -s/--server, -t/--token, -k/--insecure, --allow-insecure-http。
6
+ *
7
+ * @param command 目标 Commander 命令节点
8
+ * @returns 挂载选项后的命令节点
9
+ */
10
+ export function applyTargetOptions(command) {
11
+ return command
12
+ .option("-p, --profile <name>", "Query or execute against a specific profile")
13
+ .option("-s, --server <url>", "Remote server URL")
14
+ .option("-t, --token <token>", "Auth token for remote server")
15
+ .option("-k, --insecure", "Allow insecure server connections (skip TLS certificate validation)")
16
+ .option("--allow-insecure-http", "Allow sending auth token over unencrypted HTTP to non-loopback hosts");
17
+ }
3
18
  /**
4
19
  * 高阶目标执行辅助:统一封装「目标解析 → Target 创建 → 业务回调 → try/finally close」样板。
5
20
  *
6
21
  * 回调获得创建好的 target 与解析后的目标拓扑信息;无论回调成功或抛出,
7
22
  * 都保证 target 资源被正确释放,业务异常原样透传。
8
23
  *
9
- * @param options 命令选项视图(profile/server/token/package/dataDir)
24
+ * @param options 命令选项视图(profile/server/token/package/dataDir/insecure/allowInsecureHttp)
10
25
  * @param context CLI 上下文
11
26
  * @param fn 业务回调(target 为已创建的门面实例,resolved 为拓扑解析结果)
12
27
  * @param localOptions 本地分支附加选项(如 scanLinkedPackages)与 localRoot 回退策略
@@ -16,6 +31,8 @@ export async function withTarget(options, context, fn, localOptions) {
16
31
  profile: options.profile,
17
32
  server: options.server,
18
33
  token: options.token,
34
+ insecure: options.insecure,
35
+ allowInsecureHttp: options.allowInsecureHttp,
19
36
  }, context?.customHome);
20
37
  // localRoot 仅在 local 分支求值,避免远端模式下触发包寻址副作用
21
38
  const localRoot = resolved.type === "local"
@@ -28,6 +45,8 @@ export async function withTarget(options, context, fn, localOptions) {
28
45
  type: "remote",
29
46
  serverUrl: resolved.serverUrl,
30
47
  token: resolved.token,
48
+ insecure: resolved.insecure,
49
+ allowInsecureHttp: resolved.allowInsecureHttp ?? options.allowInsecureHttp,
31
50
  }
32
51
  : {
33
52
  type: "local",
@@ -59,11 +78,15 @@ export async function withRemoteTarget(options, context, fn) {
59
78
  profile: options.profile,
60
79
  server: options.server,
61
80
  token: options.token,
81
+ insecure: options.insecure,
82
+ allowInsecureHttp: options.allowInsecureHttp,
62
83
  }, context?.customHome);
63
84
  const target = await createActionDockTarget({
64
85
  type: "remote",
65
86
  serverUrl: resolved.serverUrl,
66
87
  token: resolved.token,
88
+ insecure: resolved.insecure,
89
+ allowInsecureHttp: resolved.allowInsecureHttp ?? options.allowInsecureHttp,
67
90
  });
68
91
  try {
69
92
  await fn(target, resolved);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@actiondock/cli",
3
- "version": "2.4.1",
3
+ "version": "2.5.1",
4
4
  "description": "ActionDock CLI facade for developing, testing, building, and exporting standalone Agent Actions and Skills",
5
5
  "type": "module",
6
6
  "bin": {
@@ -34,12 +34,13 @@
34
34
  "test": "node ../../scripts/run-tests.ts"
35
35
  },
36
36
  "dependencies": {
37
- "@actiondock/builder": "^2.4.1",
38
- "@actiondock/core": "^2.4.1",
39
- "@actiondock/mcp": "^2.4.1",
40
- "@actiondock/runtime-node": "^2.4.1",
41
- "@actiondock/sdk": "^2.4.1",
42
- "commander": "^13.1.0"
37
+ "@actiondock/builder": "^2.5.1",
38
+ "@actiondock/core": "^2.5.1",
39
+ "@actiondock/mcp": "^2.5.1",
40
+ "@actiondock/runtime-node": "^2.5.1",
41
+ "@actiondock/sdk": "^2.5.1",
42
+ "commander": "^13.1.0",
43
+ "selfsigned": "^5.5.0"
43
44
  },
44
45
  "devDependencies": {
45
46
  "typescript": "^5.7.0"