@tomflow/proflow-dev-tunnel 0.1.17 → 0.1.18
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 +6 -0
- package/DOCS.md +1 -1
- package/SETUP.md +3 -3
- package/dist/deployment/adapter.js +6 -11
- package/dist/src/resource-adapter.js +30 -23
- package/package.json +3 -3
- package/proflow.module.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,11 @@
|
|
|
1
1
|
# @tomflow/proflow-dev-tunnel
|
|
2
2
|
|
|
3
|
+
## 0.1.18
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- Harden Deployment Closeout: fail closed on partial installs and package-manager conflicts, normalize Git workspace isolation, make Dev Tunnel status fast and resumable without fabricating login failures, and align Browser Extension setup/conformance behavior.
|
|
8
|
+
|
|
3
9
|
## 0.1.17
|
|
4
10
|
|
|
5
11
|
### Patch Changes
|
package/DOCS.md
CHANGED
package/SETUP.md
CHANGED
|
@@ -4,9 +4,9 @@
|
|
|
4
4
|
|
|
5
5
|
Responsible: AI
|
|
6
6
|
|
|
7
|
-
Interactive executable: `platform setup
|
|
7
|
+
Interactive executable: `platform setup`
|
|
8
8
|
|
|
9
|
-
Non-interactive executable: `
|
|
9
|
+
Non-interactive executable: `platform setup --workspace <path>`
|
|
10
10
|
|
|
11
11
|
Required inputs: none
|
|
12
12
|
|
|
@@ -25,6 +25,6 @@ Automatic flow:
|
|
|
25
25
|
→ 持久化并发布 tunnelId/publicBaseUrl
|
|
26
26
|
```
|
|
27
27
|
|
|
28
|
-
Verify: `
|
|
28
|
+
Verify: `platform status`
|
|
29
29
|
|
|
30
30
|
Success condition: `dev-tunnel.setupStatus=READY`.
|
|
@@ -150,7 +150,7 @@ const baseBehaviorAdapter = {
|
|
|
150
150
|
code: "TUNNEL_SETUP_REQUIRED",
|
|
151
151
|
message: "尚未完成持久 Tunnel 自动配置",
|
|
152
152
|
relatedModuleRefs: [],
|
|
153
|
-
nextCommand: "platform setup
|
|
153
|
+
nextCommand: "platform setup",
|
|
154
154
|
},
|
|
155
155
|
],
|
|
156
156
|
},
|
|
@@ -159,11 +159,8 @@ const baseBehaviorAdapter = {
|
|
|
159
159
|
};
|
|
160
160
|
}
|
|
161
161
|
const rt = runtime(context, state);
|
|
162
|
-
const login = await rt.loginStatus();
|
|
163
162
|
const observed = await rt.status();
|
|
164
|
-
const configured = state
|
|
165
|
-
typeof state.publicBaseUrl === "string" &&
|
|
166
|
-
login === "LOGGED_IN";
|
|
163
|
+
const configured = state.phase === "READY" && typeof state.publicBaseUrl === "string";
|
|
167
164
|
const runtimeStatus = observed.state === "RUNNING"
|
|
168
165
|
? "RUNNING"
|
|
169
166
|
: observed.state === "STOPPED"
|
|
@@ -186,12 +183,10 @@ const baseBehaviorAdapter = {
|
|
|
186
183
|
? [
|
|
187
184
|
{
|
|
188
185
|
scope: "SETUP",
|
|
189
|
-
code: "
|
|
190
|
-
message:
|
|
191
|
-
? `远程连接配置已保存,当前阶段 ${state.phase};重新运行 Platform setup 将从此处恢复`
|
|
192
|
-
: "Dev Tunnel CLI 尚未登录或配置未保存",
|
|
186
|
+
code: "TUNNEL_SETUP_INCOMPLETE",
|
|
187
|
+
message: `远程连接配置已保存,当前阶段 ${state.phase};重新运行 Platform setup 将从此处恢复`,
|
|
193
188
|
relatedModuleRefs: [],
|
|
194
|
-
nextCommand: "platform setup
|
|
189
|
+
nextCommand: "platform setup",
|
|
195
190
|
},
|
|
196
191
|
]
|
|
197
192
|
: []),
|
|
@@ -202,7 +197,7 @@ const baseBehaviorAdapter = {
|
|
|
202
197
|
code: "TUNNEL_RUNTIME_FAILED",
|
|
203
198
|
message: "Tunnel 运行状态检查失败",
|
|
204
199
|
relatedModuleRefs: [],
|
|
205
|
-
nextCommand: "
|
|
200
|
+
nextCommand: "platform status",
|
|
206
201
|
},
|
|
207
202
|
]
|
|
208
203
|
: []),
|
|
@@ -10,7 +10,17 @@ const START_CONFIRM_MS = 500;
|
|
|
10
10
|
function defaultCommandRunner(command, args, options) {
|
|
11
11
|
if (options?.interactive) {
|
|
12
12
|
return new Promise((resolve) => {
|
|
13
|
-
const child = spawn(command, args, {
|
|
13
|
+
const child = spawn(command, args, {
|
|
14
|
+
stdio: ["ignore", "pipe", "pipe"],
|
|
15
|
+
});
|
|
16
|
+
let stdout = "";
|
|
17
|
+
let stderr = "";
|
|
18
|
+
child.stdout?.on("data", (chunk) => {
|
|
19
|
+
stdout += chunk.toString();
|
|
20
|
+
});
|
|
21
|
+
child.stderr?.on("data", (chunk) => {
|
|
22
|
+
stderr += chunk.toString();
|
|
23
|
+
});
|
|
14
24
|
let timedOut = false;
|
|
15
25
|
const timer = setTimeout(() => {
|
|
16
26
|
timedOut = true;
|
|
@@ -18,14 +28,14 @@ function defaultCommandRunner(command, args, options) {
|
|
|
18
28
|
}, options.timeoutMs ?? 600_000);
|
|
19
29
|
child.once("error", (error) => {
|
|
20
30
|
clearTimeout(timer);
|
|
21
|
-
resolve({ exitCode: null, stdout
|
|
31
|
+
resolve({ exitCode: null, stdout, stderr: error.message });
|
|
22
32
|
});
|
|
23
33
|
child.once("exit", (code) => {
|
|
24
34
|
clearTimeout(timer);
|
|
25
35
|
resolve({
|
|
26
36
|
exitCode: timedOut ? null : code,
|
|
27
|
-
stdout
|
|
28
|
-
stderr: timedOut ? "command timed out" :
|
|
37
|
+
stdout,
|
|
38
|
+
stderr: timedOut ? "command timed out" : stderr,
|
|
29
39
|
});
|
|
30
40
|
});
|
|
31
41
|
});
|
|
@@ -394,14 +404,11 @@ export function createDevTunnelRuntime(input) {
|
|
|
394
404
|
return "UNKNOWN";
|
|
395
405
|
}
|
|
396
406
|
};
|
|
397
|
-
const
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
...(publicBaseUrl === undefined ? {} : { publicBaseUrl }),
|
|
403
|
-
};
|
|
404
|
-
};
|
|
407
|
+
const observation = (state, login = "UNKNOWN") => ({
|
|
408
|
+
state,
|
|
409
|
+
login,
|
|
410
|
+
...(publicBaseUrl === undefined ? {} : { publicBaseUrl }),
|
|
411
|
+
});
|
|
405
412
|
const ownedPersistedPid = async () => {
|
|
406
413
|
if (!processStateFile || !tunnelId)
|
|
407
414
|
return undefined;
|
|
@@ -417,24 +424,24 @@ export function createDevTunnelRuntime(input) {
|
|
|
417
424
|
command,
|
|
418
425
|
async status() {
|
|
419
426
|
if (await ownedPersistedPid())
|
|
420
|
-
return
|
|
427
|
+
return observation("RUNNING");
|
|
421
428
|
if (child?.pid && processAlive(child.pid))
|
|
422
|
-
return
|
|
423
|
-
return
|
|
429
|
+
return observation("RUNNING");
|
|
430
|
+
return observation("UNKNOWN");
|
|
424
431
|
},
|
|
425
432
|
loginStatus: () => observeLogin(),
|
|
426
433
|
publicBaseUrl: () => publicBaseUrl,
|
|
427
434
|
async start() {
|
|
428
435
|
const login = await observeLogin();
|
|
429
436
|
if (login !== "LOGGED_IN")
|
|
430
|
-
return
|
|
437
|
+
return observation("UNKNOWN", login);
|
|
431
438
|
if (tunnelId === undefined) {
|
|
432
439
|
throw new TypeError("tunnelId is required to host the configured persistent tunnel");
|
|
433
440
|
}
|
|
434
441
|
if (await ownedPersistedPid())
|
|
435
|
-
return
|
|
442
|
+
return observation("RUNNING", login);
|
|
436
443
|
if (child?.pid && processAlive(child.pid))
|
|
437
|
-
return
|
|
444
|
+
return observation("RUNNING", login);
|
|
438
445
|
const spawned = spawn(command, ["host", tunnelId], {
|
|
439
446
|
stdio: "ignore",
|
|
440
447
|
detached: true,
|
|
@@ -483,7 +490,7 @@ export function createDevTunnelRuntime(input) {
|
|
|
483
490
|
}
|
|
484
491
|
}
|
|
485
492
|
spawned.unref();
|
|
486
|
-
return
|
|
493
|
+
return observation("RUNNING", login);
|
|
487
494
|
},
|
|
488
495
|
async stop() {
|
|
489
496
|
const persistedPid = await ownedPersistedPid();
|
|
@@ -492,20 +499,20 @@ export function createDevTunnelRuntime(input) {
|
|
|
492
499
|
if (processStateFile)
|
|
493
500
|
await rm(processStateFile, { force: true });
|
|
494
501
|
child = undefined;
|
|
495
|
-
return
|
|
502
|
+
return observation("STOPPED");
|
|
496
503
|
}
|
|
497
504
|
try {
|
|
498
505
|
process.kill(pid, "SIGTERM");
|
|
499
506
|
}
|
|
500
507
|
catch {
|
|
501
|
-
return
|
|
508
|
+
return observation("UNKNOWN");
|
|
502
509
|
}
|
|
503
510
|
if (!(await waitForProcessExit(pid)))
|
|
504
|
-
return
|
|
511
|
+
return observation("UNKNOWN");
|
|
505
512
|
if (processStateFile)
|
|
506
513
|
await rm(processStateFile, { force: true });
|
|
507
514
|
child = undefined;
|
|
508
|
-
return
|
|
515
|
+
return observation("STOPPED");
|
|
509
516
|
},
|
|
510
517
|
async restart() {
|
|
511
518
|
const stopped = await this.stop();
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tomflow/proflow-dev-tunnel",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.18",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public"
|
|
@@ -23,8 +23,8 @@
|
|
|
23
23
|
],
|
|
24
24
|
"dependencies": {
|
|
25
25
|
"zod": "4.1.12",
|
|
26
|
-
"@tomflow/proflow-
|
|
27
|
-
"@tomflow/proflow-
|
|
26
|
+
"@tomflow/proflow-devtunnel-cli": "^0.1.0",
|
|
27
|
+
"@tomflow/proflow-module-contract": "^0.1.13"
|
|
28
28
|
},
|
|
29
29
|
"devDependencies": {
|
|
30
30
|
"@tomflow/proflow-deployment-conformance": "^0.1.13"
|
package/proflow.module.json
CHANGED
|
@@ -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.
|
|
6
|
+
"moduleVersion": "0.1.18",
|
|
7
7
|
"kind": "external-resource",
|
|
8
8
|
"templateVersion": "1.0.0",
|
|
9
9
|
"platformCompatibility": ">=1.0.0 <2.0.0",
|