@tomflow/proflow-dev-tunnel 0.1.14 → 0.1.16

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,17 @@
1
1
  # @tomflow/proflow-dev-tunnel
2
2
 
3
+ ## 0.1.16
4
+
5
+ ### Patch Changes
6
+
7
+ - Retire the obsolete Carrier package and Browser standalone management CLI, make Platform setup/status preserve owner and dependency semantics, and enforce read-only status observation across the final Real-3 deployment closeout.
8
+
9
+ ## 0.1.15
10
+
11
+ ### Patch Changes
12
+
13
+ - Ship the Phase 3 browser, tunnel, model automation, platform readiness, and documentation closure as one verifiable platform snapshot.
14
+
3
15
  ## 0.1.14
4
16
 
5
17
  ### Patch Changes
package/DOCS.md CHANGED
@@ -6,9 +6,10 @@
6
6
 
7
7
  ## 主要能力
8
8
 
9
- - 检查 `devtunnel` CLI Microsoft 登录状态。
10
- - 列出、选择或创建持久 Tunnel,并管理端口映射和运行进程。
11
- - 观察公开 HTTPS URL,将其发布为共享事实。
9
+ - 检查 `devtunnel` CLI 与登录状态;缺失时启动 GitHub browser auth。
10
+ - workspace state 复用或自动创建持久 Tunnel,并自动管理端口映射和运行进程。
11
+ - `agent-gateway` producer-owned shared facts 获得本地端口。
12
+ - 按当前端口自动发现公开 HTTPS URL,将其发布为共享事实。
12
13
 
13
14
  ## 提供的 API 与 Public Contract
14
15
 
@@ -17,8 +18,8 @@
17
18
 
18
19
  ## 依赖的 Module、Contract 和外部资源
19
20
 
20
- - 依赖 Microsoft `devtunnel` CLI、账号登录、网络和本地 Platform Host 端口。
21
- - 无上游 Module Contract 依赖。
21
+ - 依赖 Microsoft `devtunnel` CLI、账号登录、网络和 `agent-gateway` 发布的 `localBaseUrl` shared fact。
22
+ - 不建立对 `agent-gateway` 的运行时或包依赖;只消费 Platform Host 中由该 Module 持久化的 producer-owned fact。
22
23
 
23
24
  ## 运行形态与生命周期
24
25
 
@@ -26,7 +27,7 @@
26
27
 
27
28
  ## 使用方式
28
29
 
29
- 运行 `pnpm exec -- proflow-dev-tunnel setup`,向导会完成登录检查、Tunnel 选择/创建、端口映射和 URL 验证。
30
+ 运行 `platform setup --module dev-tunnel`;除登录失效时的 GitHub 浏览器授权外,不需要输入 Tunnel ID、端口或 URL
30
31
 
31
32
  ## 职责边界与限制
32
33
 
package/README.md CHANGED
@@ -23,5 +23,6 @@ Deployment Governance
23
23
 
24
24
  ## Purpose
25
25
 
26
- Manages the Microsoft Dev Tunnel (`devtunnel`) public HTTPS ingress. Login is a
27
- user external-account fact and is never faked.
26
+ Manages the Microsoft Dev Tunnel (`devtunnel`) public HTTPS ingress. Existing
27
+ login is reused; when login is unavailable, the only human action is GitHub
28
+ browser authorization initiated by the provider CLI. Account state is never faked.
package/SETUP.md CHANGED
@@ -1,33 +1,30 @@
1
1
  # dev-tunnel Setup
2
2
 
3
- ## STEP-DEV-TUNNEL-01 — 检查 Dev Tunnel CLI 与登录
4
- Responsible: USER
5
- Interactive executable: `pnpm exec -- proflow-dev-tunnel setup 01`
6
- Non-interactive executable: `pnpm exec -- proflow-dev-tunnel setup 01`
7
- Required inputs: Microsoft 登录
8
- Verify: `devtunnel user show`
9
- Success condition: Microsoft 登录状态可被 CLI 观察。
10
-
11
- ## STEP-DEV-TUNNEL-02 — 选择或创建持久 Tunnel
12
- Responsible: USER
13
- Interactive executable: `pnpm exec -- proflow-dev-tunnel setup 02`
14
- Non-interactive executable: `pnpm exec -- proflow-dev-tunnel setup 02 --tunnel-id <id>`
15
- Required inputs: Tunnel ID
16
- Verify: `devtunnel show <id>`
17
- Success condition: 持久 Tunnel 可以被 devtunnel show 观察。
18
-
19
- ## STEP-DEV-TUNNEL-03 — 配置入口并保存公开 URL
20
- Responsible: USER
21
- Interactive executable: `pnpm exec -- proflow-dev-tunnel setup 03`
22
- Non-interactive executable: `pnpm exec -- proflow-dev-tunnel setup 03 --tunnel-id <id> --public-base-url <url>`
23
- Required inputs: Tunnel ID、公开 HTTPS URL
24
- Verify: `pnpm exec -- proflow-dev-tunnel verify`
25
- Success condition: 公开 HTTPS URL 已保存并可验证。
3
+ ## STEP-DEV-TUNNEL-01 — 自动准备 Microsoft Dev Tunnel
26
4
 
27
- ## STEP-DEV-TUNNEL-04 — 验证 Dev Tunnel
28
5
  Responsible: AI
29
- Interactive executable: `pnpm exec -- proflow-dev-tunnel setup 04`
30
- Non-interactive executable: `pnpm exec -- proflow-dev-tunnel verify`
6
+
7
+ Interactive executable: `platform setup --module dev-tunnel`
8
+
9
+ Non-interactive executable: `pnpm exec -- proflow-dev-tunnel setup --workspace <path>`
10
+
31
11
  Required inputs: none
12
+
13
+ Human action: 仅当现有登录无效时,在 `devtunnel user login --github --use-browser-auth` 打开的浏览器页面完成 GitHub 授权。
14
+
15
+ Automatic flow:
16
+
17
+ ```text
18
+ 检查 CLI 和登录
19
+ → 必要时完成 GitHub browser auth 并复核登录
20
+ → 复用 workspace-owned Tunnel 或自动创建
21
+ → 从 agent-gateway shared facts 读取本地端口
22
+ → 自动对齐 port mapping
23
+ → 启动或复用 host
24
+ → 自动发现当前端口的 HTTPS URL
25
+ → 持久化并发布 tunnelId/publicBaseUrl
26
+ ```
27
+
32
28
  Verify: `pnpm exec -- proflow-dev-tunnel verify`
29
+
33
30
  Success condition: `dev-tunnel.setupStatus=READY`.
@@ -1,12 +1,28 @@
1
1
  import { type ModuleCommandContext } from "@tomflow/proflow-module-contract";
2
- export declare const behaviorAdapter: {
2
+ import { type DevTunnelAutomation, type DevTunnelRuntime } from "../src/resource-adapter.ts";
3
+ type SetupState = {
4
+ contract: "proflow.dev-tunnel-setup.v1";
5
+ tunnelId: string;
6
+ publicBaseUrl: string;
7
+ };
8
+ type RuntimeFactory = (input: {
9
+ command?: string;
10
+ tunnelId?: string;
11
+ publicBaseUrl?: string;
12
+ processStateFile?: string;
13
+ }) => DevTunnelRuntime;
14
+ export declare function createDevTunnelBehaviorAdapter(dependencies?: {
15
+ automation?: DevTunnelAutomation;
16
+ createRuntime?: RuntimeFactory;
17
+ verifyPublicBaseUrl?: (publicBaseUrl: string) => Promise<void>;
18
+ }): {
3
19
  readonly install: (context: ModuleCommandContext) => Promise<{
4
20
  result: {
5
21
  readonly contract: "deployment.result.v1";
6
22
  readonly ok: true;
7
23
  readonly status: "SUCCEEDED";
8
24
  readonly moduleRef: "dev-tunnel";
9
- readonly moduleVersion: "0.1.14";
25
+ readonly moduleVersion: "0.1.16";
10
26
  };
11
27
  observedEffects: never[];
12
28
  }>;
@@ -16,14 +32,14 @@ export declare const behaviorAdapter: {
16
32
  readonly ok: true;
17
33
  readonly status: "SUCCEEDED";
18
34
  readonly moduleRef: "dev-tunnel";
19
- readonly moduleVersion: "0.1.14";
35
+ readonly moduleVersion: "0.1.16";
20
36
  };
21
37
  observedEffects: string[];
22
38
  } | {
23
39
  result: {
24
40
  contract: "deployment.result.v1";
25
41
  moduleRef: "dev-tunnel";
26
- moduleVersion: "0.1.14";
42
+ moduleVersion: "0.1.16";
27
43
  ok: false;
28
44
  status: "FAILED";
29
45
  error: {
@@ -40,7 +56,7 @@ export declare const behaviorAdapter: {
40
56
  ok: true;
41
57
  status: "SUCCEEDED";
42
58
  moduleRef: "dev-tunnel";
43
- moduleVersion: "0.1.14";
59
+ moduleVersion: "0.1.16";
44
60
  data: {
45
61
  setupStatus: "ACTION_REQUIRED" | "READY";
46
62
  runtimeStatus: "FAILED" | "RUNNING" | "STOPPED";
@@ -61,95 +77,153 @@ export declare const behaviorAdapter: {
61
77
  };
62
78
  observedEffects: never[];
63
79
  }>;
64
- readonly setup: (context: ModuleCommandContext) => Promise<{
80
+ readonly docs: (_context: ModuleCommandContext) => Promise<{
65
81
  result: {
66
82
  contract: "deployment.result.v1";
83
+ ok: true;
84
+ status: "SUCCEEDED";
67
85
  moduleRef: "dev-tunnel";
68
- moduleVersion: "0.1.14";
69
- ok: false;
70
- status: "ACTION_REQUIRED";
86
+ moduleVersion: "0.1.16";
71
87
  data: {
72
- readonly steps: readonly [{
73
- readonly id: "STEP-DEV-TUNNEL-01";
74
- readonly title: "检查 Dev Tunnel CLI 与登录";
75
- readonly description: "确认 CLI 可用,必要时启动 Microsoft 登录。";
76
- readonly state: "TODO";
77
- readonly responsible: "USER";
78
- readonly execution: {
79
- readonly interactive: "pnpm exec -- proflow-dev-tunnel setup 01";
80
- readonly nonInteractive: "pnpm exec -- proflow-dev-tunnel setup 01";
81
- };
82
- readonly requiredInputs: readonly [];
83
- readonly verify: "devtunnel user show";
84
- readonly successCondition: "Microsoft 登录状态可被 CLI 观察";
85
- readonly humanAction: "若浏览器打开 Microsoft 登录页,完成账号登录。";
86
- }, {
87
- readonly id: "STEP-DEV-TUNNEL-02";
88
- readonly title: "选择或创建持久 Tunnel";
89
- readonly description: "列出现有 Tunnel;不存在时由脚本创建。";
90
- readonly state: "TODO";
91
- readonly responsible: "USER";
92
- readonly execution: {
93
- readonly interactive: "pnpm exec -- proflow-dev-tunnel setup 02";
94
- readonly nonInteractive: "pnpm exec -- proflow-dev-tunnel setup 02 --tunnel-id <id>";
95
- };
96
- readonly requiredInputs: readonly [{
97
- readonly name: "tunnelId";
98
- readonly description: "Tunnel ID";
99
- readonly sensitive: false;
100
- }];
101
- readonly verify: "devtunnel show <id>";
102
- readonly successCondition: "持久 Tunnel 可以被 devtunnel show 观察";
103
- }, {
104
- readonly id: "STEP-DEV-TUNNEL-03";
105
- readonly title: "配置入口并保存公开 URL";
106
- readonly description: "为 Platform Host 建立映射,保存公开 HTTPS URL。";
107
- readonly state: "TODO";
108
- readonly responsible: "USER";
109
- readonly execution: {
110
- readonly interactive: "pnpm exec -- proflow-dev-tunnel setup 03";
111
- readonly nonInteractive: "pnpm exec -- proflow-dev-tunnel setup 03 --tunnel-id <id> --public-base-url <url>";
112
- };
113
- readonly requiredInputs: readonly [{
114
- readonly name: "tunnelId";
115
- readonly description: "Tunnel ID";
116
- readonly sensitive: false;
117
- }, {
118
- readonly name: "publicBaseUrl";
119
- readonly description: "公开 HTTPS URL";
120
- readonly sensitive: false;
121
- }];
122
- readonly verify: "pnpm exec -- proflow-dev-tunnel verify";
123
- readonly successCondition: "公开 HTTPS URL 已保存并可验证";
124
- readonly humanAction: "确认 Dev Tunnel 门户或 CLI 显示的公开 HTTPS URL。";
125
- }, {
126
- readonly id: "STEP-DEV-TUNNEL-04";
127
- readonly title: "验证 Dev Tunnel";
128
- readonly description: "检查登录、配置和公开入口。";
129
- readonly state: "TODO";
130
- readonly responsible: "AI";
131
- readonly execution: {
132
- readonly interactive: "pnpm exec -- proflow-dev-tunnel setup 04";
133
- readonly nonInteractive: "pnpm exec -- proflow-dev-tunnel verify";
134
- };
135
- readonly requiredInputs: readonly [];
136
- readonly verify: "pnpm exec -- proflow-dev-tunnel verify";
137
- readonly successCondition: "dev-tunnel.setupStatus=READY";
138
- }];
88
+ docs: string;
139
89
  };
140
- actionRequired: {
141
- action: string;
142
- description: string;
90
+ };
91
+ observedEffects: never[];
92
+ }>;
93
+ readonly start: (context: ModuleCommandContext) => Promise<{
94
+ result: {
95
+ contract: "deployment.result.v1";
96
+ moduleRef: "dev-tunnel";
97
+ moduleVersion: "0.1.16";
98
+ ok: false;
99
+ status: "FAILED";
100
+ error: {
101
+ code: "START_FAILED";
102
+ message: string;
103
+ retryable: boolean;
143
104
  };
144
105
  };
145
106
  observedEffects: never[];
146
107
  } | {
108
+ result: {
109
+ contract: "deployment.result.v1";
110
+ ok: true;
111
+ status: "SUCCEEDED";
112
+ moduleRef: "dev-tunnel";
113
+ moduleVersion: "0.1.16";
114
+ data: import("../src/resource-adapter.ts").DevTunnelObservation;
115
+ };
116
+ observedEffects: string[];
117
+ }>;
118
+ readonly stop: (context: ModuleCommandContext) => Promise<{
147
119
  result: {
148
120
  readonly contract: "deployment.result.v1";
149
121
  readonly ok: true;
150
122
  readonly status: "SUCCEEDED";
151
123
  readonly moduleRef: "dev-tunnel";
152
- readonly moduleVersion: "0.1.14";
124
+ readonly moduleVersion: "0.1.16";
125
+ };
126
+ observedEffects: string[];
127
+ } | {
128
+ result: {
129
+ contract: "deployment.result.v1";
130
+ moduleRef: "dev-tunnel";
131
+ moduleVersion: "0.1.16";
132
+ ok: false;
133
+ status: "FAILED";
134
+ error: {
135
+ code: "STOP_FAILED";
136
+ message: string;
137
+ retryable: boolean;
138
+ };
139
+ };
140
+ observedEffects: never[];
141
+ }>;
142
+ readonly setup: (context: ModuleCommandContext) => Promise<{
143
+ result: {
144
+ contract: "deployment.result.v1";
145
+ moduleRef: "dev-tunnel";
146
+ moduleVersion: "0.1.16";
147
+ ok: false;
148
+ status: "FAILED";
149
+ error: {
150
+ code: "SETUP_FAILED";
151
+ message: string;
152
+ retryable: boolean;
153
+ };
154
+ };
155
+ observedEffects: never[];
156
+ } | {
157
+ result: {
158
+ contract: "deployment.result.v1";
159
+ ok: true;
160
+ status: "SUCCEEDED";
161
+ moduleRef: "dev-tunnel";
162
+ moduleVersion: "0.1.16";
163
+ data: SetupState;
164
+ };
165
+ observedEffects: string[];
166
+ }>;
167
+ };
168
+ export declare const behaviorAdapter: {
169
+ readonly install: (context: ModuleCommandContext) => Promise<{
170
+ result: {
171
+ readonly contract: "deployment.result.v1";
172
+ readonly ok: true;
173
+ readonly status: "SUCCEEDED";
174
+ readonly moduleRef: "dev-tunnel";
175
+ readonly moduleVersion: "0.1.16";
176
+ };
177
+ observedEffects: never[];
178
+ }>;
179
+ readonly uninstall: (context: ModuleCommandContext) => Promise<{
180
+ result: {
181
+ readonly contract: "deployment.result.v1";
182
+ readonly ok: true;
183
+ readonly status: "SUCCEEDED";
184
+ readonly moduleRef: "dev-tunnel";
185
+ readonly moduleVersion: "0.1.16";
186
+ };
187
+ observedEffects: string[];
188
+ } | {
189
+ result: {
190
+ contract: "deployment.result.v1";
191
+ moduleRef: "dev-tunnel";
192
+ moduleVersion: "0.1.16";
193
+ ok: false;
194
+ status: "FAILED";
195
+ error: {
196
+ code: "UNINSTALL_FAILED";
197
+ message: string;
198
+ retryable: boolean;
199
+ };
200
+ };
201
+ observedEffects: never[];
202
+ }>;
203
+ readonly status: (context: ModuleCommandContext) => Promise<{
204
+ result: {
205
+ contract: "deployment.result.v1";
206
+ ok: true;
207
+ status: "SUCCEEDED";
208
+ moduleRef: "dev-tunnel";
209
+ moduleVersion: "0.1.16";
210
+ data: {
211
+ setupStatus: "ACTION_REQUIRED" | "READY";
212
+ runtimeStatus: "FAILED" | "RUNNING" | "STOPPED";
213
+ issues?: ({
214
+ scope: "SETUP";
215
+ code: string;
216
+ message: string;
217
+ relatedModuleRefs: never[];
218
+ nextCommand: string;
219
+ } | {
220
+ scope: "RUNTIME";
221
+ code: string;
222
+ message: string;
223
+ relatedModuleRefs: never[];
224
+ nextCommand: string;
225
+ })[];
226
+ };
153
227
  };
154
228
  observedEffects: never[];
155
229
  }>;
@@ -159,7 +233,7 @@ export declare const behaviorAdapter: {
159
233
  ok: true;
160
234
  status: "SUCCEEDED";
161
235
  moduleRef: "dev-tunnel";
162
- moduleVersion: "0.1.14";
236
+ moduleVersion: "0.1.16";
163
237
  data: {
164
238
  docs: string;
165
239
  };
@@ -170,7 +244,7 @@ export declare const behaviorAdapter: {
170
244
  result: {
171
245
  contract: "deployment.result.v1";
172
246
  moduleRef: "dev-tunnel";
173
- moduleVersion: "0.1.14";
247
+ moduleVersion: "0.1.16";
174
248
  ok: false;
175
249
  status: "FAILED";
176
250
  error: {
@@ -186,7 +260,7 @@ export declare const behaviorAdapter: {
186
260
  ok: true;
187
261
  status: "SUCCEEDED";
188
262
  moduleRef: "dev-tunnel";
189
- moduleVersion: "0.1.14";
263
+ moduleVersion: "0.1.16";
190
264
  data: import("../src/resource-adapter.ts").DevTunnelObservation;
191
265
  };
192
266
  observedEffects: string[];
@@ -197,14 +271,14 @@ export declare const behaviorAdapter: {
197
271
  readonly ok: true;
198
272
  readonly status: "SUCCEEDED";
199
273
  readonly moduleRef: "dev-tunnel";
200
- readonly moduleVersion: "0.1.14";
274
+ readonly moduleVersion: "0.1.16";
201
275
  };
202
276
  observedEffects: string[];
203
277
  } | {
204
278
  result: {
205
279
  contract: "deployment.result.v1";
206
280
  moduleRef: "dev-tunnel";
207
- moduleVersion: "0.1.14";
281
+ moduleVersion: "0.1.16";
208
282
  ok: false;
209
283
  status: "FAILED";
210
284
  error: {
@@ -215,4 +289,30 @@ export declare const behaviorAdapter: {
215
289
  };
216
290
  observedEffects: never[];
217
291
  }>;
292
+ readonly setup: (context: ModuleCommandContext) => Promise<{
293
+ result: {
294
+ contract: "deployment.result.v1";
295
+ moduleRef: "dev-tunnel";
296
+ moduleVersion: "0.1.16";
297
+ ok: false;
298
+ status: "FAILED";
299
+ error: {
300
+ code: "SETUP_FAILED";
301
+ message: string;
302
+ retryable: boolean;
303
+ };
304
+ };
305
+ observedEffects: never[];
306
+ } | {
307
+ result: {
308
+ contract: "deployment.result.v1";
309
+ ok: true;
310
+ status: "SUCCEEDED";
311
+ moduleRef: "dev-tunnel";
312
+ moduleVersion: "0.1.16";
313
+ data: SetupState;
314
+ };
315
+ observedEffects: string[];
316
+ }>;
218
317
  };
318
+ export {};