@tomflow/proflow-dev-tunnel 0.1.10 → 0.1.11

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/CHANGELOG.md CHANGED
@@ -1,5 +1,11 @@
1
1
  # @tomflow/proflow-dev-tunnel
2
2
 
3
+ ## 0.1.11
4
+
5
+ ### Patch Changes
6
+
7
+ - Improve terminal progress and localized status output, publish readable Chinese module docs, and add guided setup assistants for external resources.
8
+
3
9
  ## 0.1.10
4
10
 
5
11
  ### Patch Changes
package/DOCS.md CHANGED
@@ -1,27 +1,13 @@
1
- # @tomflow/proflow-dev-tunnel — Module Docs
1
+ # dev-tunnel
2
2
 
3
- Module ref: `dev-tunnel`
4
- Domain: `deployment-governance`
5
- Kind: `external-resource`
3
+ Dev Tunnel(开发隧道)把本机 Agent Gateway 安全地映射为公开 HTTPS 地址,供 Custom GPT Actions 调用。
6
4
 
7
- Governs the Microsoft Dev Tunnel public HTTPS ingress resource and its managed local host process.
5
+ ## 什么时候需要
8
6
 
9
- ## Standard management surface
7
+ ProFlow 在本机运行,而 Custom GPT 需要从互联网访问本机网关时使用。
10
8
 
11
- `install / uninstall / status / setup / docs / start / stop`
9
+ ## 如何配置
12
10
 
13
- ## Provides
11
+ 运行 `proflow-dev-tunnel setup`。向导会检查 `devtunnel` 工具和登录状态,列出现有 Tunnel(隧道),协助选择或创建持久隧道,然后保存并验证公开地址。
14
12
 
15
- - None.
16
-
17
- ## Requires
18
-
19
- - None.
20
-
21
- ## Public setup inputs
22
-
23
- - None. Deterministic/private values and cross-Module shared facts are not public configuration.
24
-
25
- ## Ownership boundary
26
-
27
- Module business APIs and any module-specific extra commands remain package-owned. Platform does not proxy or interpret them. Current human/external preparation is documented in `SETUP.md`.
13
+ 公开地址会被外部服务访问,请只暴露 ProFlow 网关需要的端口。
@@ -6,7 +6,7 @@ export declare const behaviorAdapter: {
6
6
  readonly ok: true;
7
7
  readonly status: "SUCCEEDED";
8
8
  readonly moduleRef: "dev-tunnel";
9
- readonly moduleVersion: "0.1.10";
9
+ readonly moduleVersion: "0.1.11";
10
10
  };
11
11
  observedEffects: never[];
12
12
  }>;
@@ -16,14 +16,14 @@ export declare const behaviorAdapter: {
16
16
  readonly ok: true;
17
17
  readonly status: "SUCCEEDED";
18
18
  readonly moduleRef: "dev-tunnel";
19
- readonly moduleVersion: "0.1.10";
19
+ readonly moduleVersion: "0.1.11";
20
20
  };
21
21
  observedEffects: string[];
22
22
  } | {
23
23
  result: {
24
24
  contract: "deployment.result.v1";
25
25
  moduleRef: "dev-tunnel";
26
- moduleVersion: "0.1.10";
26
+ moduleVersion: "0.1.11";
27
27
  ok: false;
28
28
  status: "FAILED";
29
29
  error: {
@@ -40,7 +40,7 @@ export declare const behaviorAdapter: {
40
40
  ok: true;
41
41
  status: "SUCCEEDED";
42
42
  moduleRef: "dev-tunnel";
43
- moduleVersion: "0.1.10";
43
+ moduleVersion: "0.1.11";
44
44
  data: {
45
45
  setupStatus: "ACTION_REQUIRED" | "READY";
46
46
  runtimeStatus: "FAILED" | "RUNNING" | "STOPPED";
@@ -52,7 +52,7 @@ export declare const behaviorAdapter: {
52
52
  result: {
53
53
  contract: "deployment.result.v1";
54
54
  moduleRef: "dev-tunnel";
55
- moduleVersion: "0.1.10";
55
+ moduleVersion: "0.1.11";
56
56
  ok: false;
57
57
  status: "ACTION_REQUIRED";
58
58
  data: {
@@ -90,7 +90,7 @@ export declare const behaviorAdapter: {
90
90
  readonly ok: true;
91
91
  readonly status: "SUCCEEDED";
92
92
  readonly moduleRef: "dev-tunnel";
93
- readonly moduleVersion: "0.1.10";
93
+ readonly moduleVersion: "0.1.11";
94
94
  };
95
95
  observedEffects: never[];
96
96
  }>;
@@ -100,7 +100,7 @@ export declare const behaviorAdapter: {
100
100
  ok: true;
101
101
  status: "SUCCEEDED";
102
102
  moduleRef: "dev-tunnel";
103
- moduleVersion: "0.1.10";
103
+ moduleVersion: "0.1.11";
104
104
  data: {
105
105
  docs: string;
106
106
  };
@@ -111,7 +111,7 @@ export declare const behaviorAdapter: {
111
111
  result: {
112
112
  contract: "deployment.result.v1";
113
113
  moduleRef: "dev-tunnel";
114
- moduleVersion: "0.1.10";
114
+ moduleVersion: "0.1.11";
115
115
  ok: false;
116
116
  status: "FAILED";
117
117
  error: {
@@ -127,7 +127,7 @@ export declare const behaviorAdapter: {
127
127
  ok: true;
128
128
  status: "SUCCEEDED";
129
129
  moduleRef: "dev-tunnel";
130
- moduleVersion: "0.1.10";
130
+ moduleVersion: "0.1.11";
131
131
  data: import("../src/resource-adapter.ts").DevTunnelObservation;
132
132
  };
133
133
  observedEffects: string[];
@@ -138,14 +138,14 @@ export declare const behaviorAdapter: {
138
138
  readonly ok: true;
139
139
  readonly status: "SUCCEEDED";
140
140
  readonly moduleRef: "dev-tunnel";
141
- readonly moduleVersion: "0.1.10";
141
+ readonly moduleVersion: "0.1.11";
142
142
  };
143
143
  observedEffects: string[];
144
144
  } | {
145
145
  result: {
146
146
  contract: "deployment.result.v1";
147
147
  moduleRef: "dev-tunnel";
148
- moduleVersion: "0.1.10";
148
+ moduleVersion: "0.1.11";
149
149
  ok: false;
150
150
  status: "FAILED";
151
151
  error: {
@@ -3,7 +3,7 @@ export declare const descriptor: {
3
3
  readonly contractVersion: "1.0.0";
4
4
  readonly moduleRef: "dev-tunnel";
5
5
  readonly packageName: "@tomflow/proflow-dev-tunnel";
6
- readonly moduleVersion: "0.1.10";
6
+ readonly moduleVersion: "0.1.11";
7
7
  readonly kind: "external-resource";
8
8
  readonly templateVersion: "1.0.0";
9
9
  readonly platformCompatibility: ">=1.0.0 <2.0.0";
@@ -3,7 +3,7 @@ export const descriptor = {
3
3
  contractVersion: "1.0.0",
4
4
  moduleRef: "dev-tunnel",
5
5
  packageName: "@tomflow/proflow-dev-tunnel",
6
- moduleVersion: "0.1.10",
6
+ moduleVersion: "0.1.11",
7
7
  kind: "external-resource",
8
8
  templateVersion: "1.0.0",
9
9
  platformCompatibility: ">=1.0.0 <2.0.0",
package/dist/src/cli.js CHANGED
@@ -1,4 +1,5 @@
1
1
  #!/usr/bin/env node
2
+ import { spawnSync } from "node:child_process";
2
3
  import { createInterface } from "node:readline/promises";
3
4
  import { behaviorAdapter } from "../deployment/adapter.js";
4
5
  function option(args, name) {
@@ -15,8 +16,41 @@ async function inputs(args) {
15
16
  output: process.stdout,
16
17
  });
17
18
  try {
18
- tunnelId ||= await prompt.question("Tunnel ID:");
19
- publicBaseUrl ||= await prompt.question("公开 HTTPS URL:");
19
+ process.stdout.write("\nDev Tunnel 配置\n\n 脚本将检查 CLI、完成 Microsoft 登录,并协助选择或创建持久 Tunnel(隧道)。\n\n");
20
+ const version = spawnSync("devtunnel", ["--version"], {
21
+ stdio: "ignore",
22
+ });
23
+ if (version.error || version.status !== 0)
24
+ throw new Error("未找到 devtunnel CLI。请先按 Microsoft Dev Tunnels 文档安装,然后重新运行本命令");
25
+ process.stdout.write("✓ 已找到 devtunnel CLI\n");
26
+ let login = spawnSync("devtunnel", ["user", "show"], { stdio: "ignore" });
27
+ if (login.status !== 0) {
28
+ process.stdout.write("◆ 需要登录 Microsoft 账号,正在启动登录流程…\n");
29
+ login = spawnSync("devtunnel", ["user", "login"], { stdio: "inherit" });
30
+ if (login.status !== 0)
31
+ throw new Error("Microsoft 登录未完成");
32
+ }
33
+ process.stdout.write("✓ Microsoft 登录已就绪\n\n现有持久 Tunnel:\n");
34
+ spawnSync("devtunnel", ["list"], { stdio: "inherit" });
35
+ tunnelId ||= await prompt.question("\n◆ 输入要使用的 Tunnel ID(不存在时可创建)\n> ");
36
+ const existing = spawnSync("devtunnel", ["show", tunnelId], {
37
+ stdio: "ignore",
38
+ });
39
+ if (existing.status !== 0) {
40
+ const answer = await prompt.question(`未找到 ${tunnelId},现在创建持久 Tunnel?[Y/n] `);
41
+ if (answer.trim() && !/^y(es)?$/i.test(answer.trim()))
42
+ throw new Error("尚未选择可用的持久 Tunnel");
43
+ const created = spawnSync("devtunnel", ["create", tunnelId], {
44
+ stdio: "inherit",
45
+ });
46
+ if (created.status !== 0)
47
+ throw new Error("创建持久 Tunnel 失败");
48
+ process.stdout.write("✓ 持久 Tunnel 已创建\n");
49
+ }
50
+ else
51
+ process.stdout.write("✓ 已选择现有持久 Tunnel\n");
52
+ process.stdout.write("\n请为 Platform Host 的本地端口建立映射并启动 Tunnel;devtunnel 会显示公开 HTTPS 地址。\n");
53
+ publicBaseUrl ||= await prompt.question("◆ 粘贴公开 HTTPS URL\n> ");
20
54
  }
21
55
  finally {
22
56
  prompt.close();
@@ -33,8 +67,8 @@ if (command === "setup") {
33
67
  input: await inputs(args),
34
68
  });
35
69
  process.stdout.write(result.result.status === "SUCCEEDED"
36
- ? "Tunnel 配置已保存。\n"
37
- : `Tunnel 尚未就绪:${result.result.actionRequired.description}\n`);
70
+ ? "\n✓ Tunnel 配置已保存\n✓ 登录与公开地址验证通过\n"
71
+ : `\n✕ Tunnel 尚未就绪\n ${result.result.actionRequired.description}\n`);
38
72
  }
39
73
  else if (command === "verify") {
40
74
  const result = await behaviorAdapter.status({ workspaceRoot });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tomflow/proflow-dev-tunnel",
3
- "version": "0.1.10",
3
+ "version": "0.1.11",
4
4
  "type": "module",
5
5
  "publishConfig": {
6
6
  "access": "public"
@@ -22,10 +22,10 @@
22
22
  "SETUP.md"
23
23
  ],
24
24
  "dependencies": {
25
- "@tomflow/proflow-module-contract": "^0.1.9"
25
+ "@tomflow/proflow-module-contract": "^0.1.10"
26
26
  },
27
27
  "devDependencies": {
28
- "@tomflow/proflow-deployment-conformance": "^0.1.7"
28
+ "@tomflow/proflow-deployment-conformance": "^0.1.8"
29
29
  },
30
30
  "description": "Governs the Microsoft Dev Tunnel public HTTPS ingress resource and its managed local host process.",
31
31
  "keywords": [
@@ -3,7 +3,7 @@
3
3
  "contractVersion": "1.0.0",
4
4
  "moduleRef": "dev-tunnel",
5
5
  "packageName": "@tomflow/proflow-dev-tunnel",
6
- "moduleVersion": "0.1.10",
6
+ "moduleVersion": "0.1.11",
7
7
  "kind": "external-resource",
8
8
  "templateVersion": "1.0.0",
9
9
  "platformCompatibility": ">=1.0.0 <2.0.0",