vibeview 0.8.0 → 0.8.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.
|
@@ -866,6 +866,11 @@ async function startDevSession(cfg, onEvent = () => {
|
|
|
866
866
|
tunnel.start();
|
|
867
867
|
if (cfg.open !== false) await openBrowser(pageUrl).catch(() => {
|
|
868
868
|
});
|
|
869
|
+
const active = await pollUntilActive(api, sessionId, 18e4);
|
|
870
|
+
const seen = new Set(ready.warnings ?? []);
|
|
871
|
+
for (const w of active.warnings ?? []) {
|
|
872
|
+
if (!seen.has(w)) onEvent({ event: "warning", message: w });
|
|
873
|
+
}
|
|
869
874
|
return { sessionId, pageUrl, stop: () => stopSession(0) };
|
|
870
875
|
} catch (err) {
|
|
871
876
|
await stopSession(1);
|
|
@@ -890,6 +895,22 @@ async function pollUntilTunnelReady(api, sessionId, timeoutMs, intervalMs = 2e3)
|
|
|
890
895
|
await new Promise((r) => setTimeout(r, intervalMs));
|
|
891
896
|
}
|
|
892
897
|
}
|
|
898
|
+
async function pollUntilActive(api, sessionId, timeoutMs, intervalMs = 2e3) {
|
|
899
|
+
const deadline = Date.now() + timeoutMs;
|
|
900
|
+
for (; ; ) {
|
|
901
|
+
const info = await api.getSession(sessionId);
|
|
902
|
+
const blocking = findBlockingWarning(info);
|
|
903
|
+
if (blocking) throw new Error(blocking);
|
|
904
|
+
if (info.status === "active") return info;
|
|
905
|
+
if (info.status === "stopped" || info.status === "failed") {
|
|
906
|
+
throw new Error(`session ${info.status} before it became active`);
|
|
907
|
+
}
|
|
908
|
+
if (Date.now() > deadline) {
|
|
909
|
+
throw new Error("timed out waiting for the session to become active");
|
|
910
|
+
}
|
|
911
|
+
await new Promise((r) => setTimeout(r, intervalMs));
|
|
912
|
+
}
|
|
913
|
+
}
|
|
893
914
|
var PLATFORM_DEVICE = {
|
|
894
915
|
ios: { deviceType: "ios", tv: false },
|
|
895
916
|
android: { deviceType: "android", tv: false },
|
package/dist/cli.js
CHANGED
|
@@ -8,7 +8,7 @@ import {
|
|
|
8
8
|
readDevState,
|
|
9
9
|
readMetroState,
|
|
10
10
|
runAgentVerb
|
|
11
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-WG2XR45H.js";
|
|
12
12
|
import {
|
|
13
13
|
ApiClient,
|
|
14
14
|
EXIT_INFRA_ERROR,
|
|
@@ -1350,7 +1350,7 @@ program.command("dev-stop").description("Stop a `vibeview dev --detach` session
|
|
|
1350
1350
|
program.command("mcp").description(
|
|
1351
1351
|
"Run an MCP stdio server exposing the agent verbs (tap, swipe, type, ...) plus dev_start/dev_stop as tools"
|
|
1352
1352
|
).option("--token <token>", "API token (or set VIBEVIEW_API_TOKEN)").action(async (opts) => {
|
|
1353
|
-
const { runMcpServer } = await import("./server-
|
|
1353
|
+
const { runMcpServer } = await import("./server-S3D724K3.js");
|
|
1354
1354
|
await runMcpServer(opts);
|
|
1355
1355
|
});
|
|
1356
1356
|
for (const cmd of AGENT_COMMANDS) {
|
|
@@ -10,7 +10,7 @@ import {
|
|
|
10
10
|
readDevState,
|
|
11
11
|
renderEnvelope,
|
|
12
12
|
startDevSession
|
|
13
|
-
} from "./chunk-
|
|
13
|
+
} from "./chunk-WG2XR45H.js";
|
|
14
14
|
import {
|
|
15
15
|
ApiClient,
|
|
16
16
|
resolveAuth
|
|
@@ -55,7 +55,7 @@ function toolDefFromCommand(cmd) {
|
|
|
55
55
|
}
|
|
56
56
|
var DEV_START_DEF = {
|
|
57
57
|
name: "dev_start",
|
|
58
|
-
description: "Start a VibeView dev-loop session (device + tunnel) held in-process by this MCP server, and use it as the default session for every other tool call until dev_stop.",
|
|
58
|
+
description: "Start a VibeView dev-loop session (device + tunnel) held in-process by this MCP server, and use it as the default session for every other tool call until dev_stop. Returns once the session accepts commands (device up, app installed) \u2014 call ui_tree right away, no readiness polling needed.",
|
|
59
59
|
mutating: true,
|
|
60
60
|
properties: {
|
|
61
61
|
session_id: SESSION_ID_PROPERTY,
|
package/package.json
CHANGED
|
@@ -46,9 +46,10 @@ https://vibeview.io/docs/preparing-your-build.
|
|
|
46
46
|
```json
|
|
47
47
|
{"event":"session_ready","session_id":"...","url":"...","pid":1234}
|
|
48
48
|
```
|
|
49
|
-
Use `session_id` as `--session <id>` on every verb below.
|
|
50
|
-
|
|
51
|
-
|
|
49
|
+
Use `session_id` as `--session <id>` on every verb below. The event
|
|
50
|
+
fires once the session accepts commands (device up, app installed) —
|
|
51
|
+
no need to poll `dev-status` first. If the app ships no native changes
|
|
52
|
+
since the last run, skip step 1 and just do steps 2–4.
|
|
52
53
|
|
|
53
54
|
Running `dev` writes two things into the project root: a `.vibeview/`
|
|
54
55
|
directory (live session state — local machine state, never commit) and a
|
|
@@ -64,6 +65,10 @@ it rather than letting it appear unexplained in their `git status`.
|
|
|
64
65
|
```bash
|
|
65
66
|
vibeview ui-tree --session <id>
|
|
66
67
|
```
|
|
68
|
+
An empty or near-empty first tree usually means the app is still booting
|
|
69
|
+
(splash screen, fetching remote config) — NOT a broken session. Take a
|
|
70
|
+
screenshot to confirm, `wait`, and fetch the tree again before concluding
|
|
71
|
+
anything is wrong.
|
|
67
72
|
- Act on the screen using refs from the tree:
|
|
68
73
|
```bash
|
|
69
74
|
vibeview tap @e5 --session <id>
|