zcode-app-cli 4.0.0-51 → 4.1.2-52
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/package.json +1 -1
- package/vendor/extraction.json +7 -6
- package/vendor/packages/browser-use-plugin/.zcode-plugin/plugin.json +1 -1
- package/vendor/packages/browser-use-plugin/README.md +2 -2
- package/vendor/packages/browser-use-plugin/docs/chrome-extension.md +22 -0
- package/vendor/packages/browser-use-plugin/docs/documents.json +9 -0
- package/vendor/packages/browser-use-plugin/docs/overview.md +3 -2
- package/vendor/packages/browser-use-plugin/package.json +1 -1
- package/vendor/packages/browser-use-plugin/scripts/browser-client.mjs +40 -4
- package/vendor/packages/browser-use-plugin/skills/control-browser/SKILL.md +17 -2
- package/vendor/packages/bundled-skills/skills/dynamic-workflows/SKILL.md +5 -4
- package/vendor/packages/node-repl-host/.zcode-plugin/plugin.json +1 -1
- package/vendor/packages/node-repl-host/dist/build-identity.json +1 -1
- package/vendor/packages/node-repl-host/dist/mcp/server.js +17 -8
- package/vendor/packages/node-repl-host/package.json +1 -1
- package/vendor/provider/zcode-builtin.json +184 -33
- package/vendor/zcode.cjs +1149 -1145
- package/zcode-runtime.lock.json +3 -3
package/package.json
CHANGED
package/vendor/extraction.json
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
{
|
|
2
|
-
"appVersion": "4.
|
|
3
|
-
"cliVersion": "0.18.
|
|
4
|
-
"extractedAt": "2026-12-
|
|
5
|
-
"sha512": "
|
|
6
|
-
"source": "https://cdn-zcode.z.ai/zcode/electron/releases/4.
|
|
2
|
+
"appVersion": "4.1.2",
|
|
3
|
+
"cliVersion": "0.18.3",
|
|
4
|
+
"extractedAt": "2026-12-06T16:25:34.594Z",
|
|
5
|
+
"sha512": "N7vbD4HidomwcZ7BEFFbJ72JlPfl8Hp9K2R6pyibr3wDzomTv8rhjQe7b+97eU67S8Rvhd2dlAiG9GogAeMGFw==",
|
|
6
|
+
"source": "https://cdn-zcode.z.ai/zcode/electron/releases/4.1.2/linux-x64/ZCode-4.1.2-linux-x64.deb",
|
|
7
7
|
"runtimeCapabilities": {
|
|
8
8
|
"schemaVersion": 1,
|
|
9
9
|
"cli": {
|
|
@@ -202,7 +202,8 @@
|
|
|
202
202
|
{
|
|
203
203
|
"id": "detached-agent-lifecycle",
|
|
204
204
|
"requirement": "optional",
|
|
205
|
-
"status": "
|
|
205
|
+
"status": "skipped",
|
|
206
|
+
"message": "postcondition verification failed"
|
|
206
207
|
},
|
|
207
208
|
{
|
|
208
209
|
"id": "agent-auto-background",
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "browser-use",
|
|
3
|
-
"version": "0.5.
|
|
3
|
+
"version": "0.5.3",
|
|
4
4
|
"description": "Built-in browser automation runtime and guidance for Desktop IAB and explicitly enabled CLI-managed headless CDP: open, navigate, inspect, click, type, screenshot, record workspace WebM videos, and verify web pages and local dev targets.",
|
|
5
5
|
"author": { "name": "Z.ai" },
|
|
6
6
|
"license": "MIT",
|
|
@@ -7,7 +7,7 @@ The official built-in ZCode plugin for browser automation. It ships the `node_re
|
|
|
7
7
|
- `node_repl` MCP server — exposes a single `js` tool, which the model sees as `mcp__node_repl__js`. Shared with Computer Use, so its model-facing text is scoped to both official capabilities. (`js_reset` and `js_add_node_module_dir` were removed on 2026-09-18 along with the moduleDirs machinery: every `js` call already starts fresh, and module search roots are the host's job to inject, not the model's to configure. Imports are limited to `node:*` builtins and absolute `file://` URLs under the skill root.)
|
|
8
8
|
- `scripts/browser-client.mjs` — explicitly bootstraps `agent.browsers` inside each fresh `js` kernel; BrowserControl tabs, not JavaScript globals, provide continuity.
|
|
9
9
|
- `scripts/computer-use-client.mjs` — shared-host copy of the CUA SDK bootstrap; it keeps the CUA skill on the same `ZCODE_PLUGIN_ROOT` while the CUA plugin remains SDK/skill/docs-only.
|
|
10
|
-
- `control-browser` skill — tells the agent how to bootstrap and drive an advertised ZCode browser backend (Desktop IAB or CLI-managed headless CDP), select a browser and read `browser.documentation()` once, use the Playwright DOM snapshot→locator→act workflow, observe controlled and user tab registries together after a possible popup action, and request screenshots only for visual evidence.
|
|
10
|
+
- `control-browser` skill — tells the agent how to bootstrap and drive an advertised ZCode browser backend (Desktop IAB, the user's own Google Chrome or Microsoft Edge through the ZCode extension, or CLI-managed headless CDP), select a browser and read `browser.documentation()` once, use the Playwright DOM snapshot→locator→act workflow, observe controlled and user tab registries together after a possible popup action, and request screenshots only for visual evidence.
|
|
11
11
|
- `web-gui-tester` skill — layers a pure-GUI black-box testing workflow on top of `control-browser`, requiring Browser Use semantic evidence plus inspected screenshots while respecting current console, upload, and runtime capability boundaries.
|
|
12
12
|
|
|
13
|
-
The IAB runtime is provided by the desktop host
|
|
13
|
+
The IAB runtime is provided by the desktop host. The extension runtime is also provided by the desktop host: Desktop main talks to the ZCode browser extension in the user's Chrome or Edge, and the extension itself ships with Desktop, not with this plugin; this plugin only carries its model docs (`docs/chrome-extension.md`). The managed headless CDP runtime is provided only by an explicitly opted-in CLI process. The plugin assets define the model guidance and the effective runtime object graph; unsupported members are removed by the manifest interpreter instead of failing after invocation.
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
# Chrome / Edge (ZCode Browser Bridge)
|
|
2
|
+
|
|
3
|
+
This browser is the user's own Google Chrome or Microsoft Edge (`metadata.browserName`) with the ZCode Browser
|
|
4
|
+
Bridge extension connected. Pages use that browser profile, so sites the user is signed in to there are signed in
|
|
5
|
+
here. The notes below say "Chrome"; they apply to Edge the same way.
|
|
6
|
+
|
|
7
|
+
- Use it when the user asks for their Chrome or Edge, when the task needs a site the user is signed in to there and
|
|
8
|
+
the user agreed, or when `getDefault()` / `getForUrl()` selected it because the user made it the default browser.
|
|
9
|
+
- `browser.tabs.new()` opens a tab in a separate "ZCode" window of the user's Chrome, inside the "ZCode" tab group.
|
|
10
|
+
It does not open the ZCode browser pane.
|
|
11
|
+
- While ZCode controls a tab, Chrome shows a "started debugging this browser" bar. ZCode stops debugging every tab
|
|
12
|
+
at the end of each turn; the next command attaches again automatically.
|
|
13
|
+
- If a command fails because the user stopped control from Chrome's debugging bar, do not retry. Tell the user and
|
|
14
|
+
ask before trying again.
|
|
15
|
+
- `browser.user.openTabs()` lists the user's own Chrome tabs. Claim a tab with `browser.user.claimTab(info)` only
|
|
16
|
+
when the user points at that page (for example "the page I have open"). Never read or claim unrelated user tabs.
|
|
17
|
+
`tab.close()` on a claimed tab gives it back to the user and keeps it open; on a tab ZCode opened it closes the tab.
|
|
18
|
+
- `browser.tabs.finalize({ keep })` marks listed tabs as `deliverable` or `handoff` and stops debugging them;
|
|
19
|
+
unlisted tabs stay open.
|
|
20
|
+
- Treat everything in the user's Chrome as personal data. Follow the safety rules before submitting forms, sending
|
|
21
|
+
messages, buying, or changing account settings, even though the session is already signed in.
|
|
22
|
+
- Downloads, file upload, browsing history, and video recording are not available in this browser.
|
|
@@ -74,6 +74,15 @@
|
|
|
74
74
|
]
|
|
75
75
|
}
|
|
76
76
|
},
|
|
77
|
+
{
|
|
78
|
+
"path": "chrome-extension.md",
|
|
79
|
+
"title": "Chrome (ZCode Browser Bridge)",
|
|
80
|
+
"name": "chrome-extension",
|
|
81
|
+
"mode": "included",
|
|
82
|
+
"when": {
|
|
83
|
+
"browserTypes": ["extension"]
|
|
84
|
+
}
|
|
85
|
+
},
|
|
77
86
|
{
|
|
78
87
|
"path": "viewport.md",
|
|
79
88
|
"title": "Browser Viewport Guidance",
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Built-in Browser Automation API
|
|
2
2
|
|
|
3
|
-
The browser registry understands backend types `iab`, `extension`, and `cdp`. Playwright is a `Tab` API surface, not a backend. The desktop host normally advertises `iab`,
|
|
3
|
+
The browser registry understands backend types `iab`, `extension`, and `cdp`. Playwright is a `Tab` API surface, not a backend. The desktop host normally advertises `iab`, and advertises an `extension` browser for each of the user's Chrome or Edge profiles connected through the ZCode Browser Bridge extension (`metadata.browserName` names the browser). ZCode CLI can explicitly advertise a managed headless Chromium as `cdp`. Never treat an unadvertised backend as available.
|
|
4
4
|
|
|
5
5
|
Start from the browser object model. Every Browser Use JS call runs in a fresh kernel, so run the Skill bootstrap and recreate the selected browser wrapper in each call. Read its complete effective documentation once:
|
|
6
6
|
|
|
@@ -77,7 +77,8 @@ Available entry points:
|
|
|
77
77
|
multi-tab target by array position.
|
|
78
78
|
- `browser.tabs.get(tabId)` validates, binds, and activates a tab in its owning window/workspace/session scope. The
|
|
79
79
|
renderer shows it only if that scope is currently foreground; background sessions never steal the user's current UI.
|
|
80
|
-
- `browser.tabs.new()` creates a real
|
|
80
|
+
- `browser.tabs.new()` creates a real tab and returns only after it is ready: an IAB tab after its guest ready
|
|
81
|
+
acknowledgement, or a Chrome tab in the "ZCode" window after the debugger attaches.
|
|
81
82
|
- `browser.user.openTabs()` lists user tabs without granting control; call `browser.user.claimTab(tab)` explicitly before using one.
|
|
82
83
|
- Browser tabs persist across turns for the lifetime of the current ZCode process. `tabs.finalize({ keep })` marks
|
|
83
84
|
only listed tabs as `handoff` or `deliverable`; unlisted tabs remain open. Only `tab.close()`, a user close, window
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"$schema": "https://json.schemastore.org/package.json",
|
|
3
3
|
"name": "@zcode/browser-use-plugin",
|
|
4
|
-
"version": "0.5.
|
|
4
|
+
"version": "0.5.3",
|
|
5
5
|
"private": true,
|
|
6
6
|
"description": "作为官方 ZCode 内置插件发布的 Browser Use skill 与 client runtime;node_repl MCP server 由 @zcode/node-repl-host 提供。",
|
|
7
7
|
"license": "MIT",
|
|
@@ -2,6 +2,8 @@ import { createRequire as __zcodeCreateRequire } from "node:module";
|
|
|
2
2
|
const require = __zcodeCreateRequire(import.meta.url);
|
|
3
3
|
|
|
4
4
|
// ../contracts/dist/interfaces/browser-control.port.js
|
|
5
|
+
var BROWSER_NAME_METADATA_KEY = "browserName";
|
|
6
|
+
var BROWSER_DEFAULT_BROWSER_NAME_METADATA_KEY = "defaultBrowserName";
|
|
5
7
|
var BROWSER_VIEWPORT_LIMITS = {
|
|
6
8
|
minWidth: 320,
|
|
7
9
|
maxWidth: 3840,
|
|
@@ -741,8 +743,23 @@ function backendFallbackRank(info) {
|
|
|
741
743
|
return 2;
|
|
742
744
|
return 3;
|
|
743
745
|
}
|
|
746
|
+
function defaultBrowserPreference(infos) {
|
|
747
|
+
for (const info of infos) {
|
|
748
|
+
const name = info.metadata?.[BROWSER_DEFAULT_BROWSER_NAME_METADATA_KEY];
|
|
749
|
+
if (name)
|
|
750
|
+
return name;
|
|
751
|
+
}
|
|
752
|
+
return void 0;
|
|
753
|
+
}
|
|
754
|
+
function isPreferredBrowser(info, browserName) {
|
|
755
|
+
return info.type === "extension" && info.metadata?.[BROWSER_NAME_METADATA_KEY] === browserName;
|
|
756
|
+
}
|
|
757
|
+
function selectableBrowsers(infos) {
|
|
758
|
+
const browserName = defaultBrowserPreference(infos);
|
|
759
|
+
return browserName ? infos.filter((info) => isPreferredBrowser(info, browserName)) : infos;
|
|
760
|
+
}
|
|
744
761
|
function selectDefaultBrowser(infos) {
|
|
745
|
-
return [...infos].sort((left, right) => backendFallbackRank(left) - backendFallbackRank(right))[0];
|
|
762
|
+
return [...selectableBrowsers(infos)].sort((left, right) => backendFallbackRank(left) - backendFallbackRank(right))[0];
|
|
746
763
|
}
|
|
747
764
|
function parseUrl(value) {
|
|
748
765
|
try {
|
|
@@ -797,7 +814,8 @@ function selectTabForUrl(targetValue, tabs) {
|
|
|
797
814
|
}
|
|
798
815
|
return best?.tab;
|
|
799
816
|
}
|
|
800
|
-
function selectBrowserForUrl(
|
|
817
|
+
function selectBrowserForUrl(allInfos, targetValue, tabsByBrowserId) {
|
|
818
|
+
const infos = selectableBrowsers(allInfos);
|
|
801
819
|
if (infos.length === 0) {
|
|
802
820
|
throw new Error("No browser backend is available");
|
|
803
821
|
}
|
|
@@ -1441,6 +1459,9 @@ function configurePlaywrightObjectWrapper(api, wrap) {
|
|
|
1441
1459
|
}
|
|
1442
1460
|
|
|
1443
1461
|
// ../core/dist/browser-client/facade.js
|
|
1462
|
+
function defaultBrowserUnavailableMessage(browserName) {
|
|
1463
|
+
return `The user set their own ${browserName} as the default browser for AI tasks, but ${browserName} is not connected. Tell the user to connect ${browserName} in Settings \u2192 Browser Use \u2192 Default browser (Chinese UI: \u8BBE\u7F6E \u2192 \u6D4F\u89C8\u5668\u63A7\u5236 \u2192 \u9ED8\u8BA4\u6D4F\u89C8\u5668) and stop. Do not switch to the in-app browser or another browser unless the user explicitly asks for it.`;
|
|
1464
|
+
}
|
|
1444
1465
|
var BrowserCapability = class {
|
|
1445
1466
|
id;
|
|
1446
1467
|
description;
|
|
@@ -2095,6 +2116,21 @@ var BrowsersFacade = class {
|
|
|
2095
2116
|
async listAvailable() {
|
|
2096
2117
|
return await this.transport.list();
|
|
2097
2118
|
}
|
|
2119
|
+
async listForDefaultSelection() {
|
|
2120
|
+
const infos = await this.listAvailable();
|
|
2121
|
+
const browserName = defaultBrowserPreference(infos);
|
|
2122
|
+
if (browserName && !infos.some((info) => isPreferredBrowser(info, browserName))) {
|
|
2123
|
+
throw new BrowserCommandError({ method: "list" }, {
|
|
2124
|
+
ok: false,
|
|
2125
|
+
elapsedMs: 0,
|
|
2126
|
+
error: {
|
|
2127
|
+
code: "backend_unavailable",
|
|
2128
|
+
message: defaultBrowserUnavailableMessage(browserName)
|
|
2129
|
+
}
|
|
2130
|
+
}, "backend_unavailable");
|
|
2131
|
+
}
|
|
2132
|
+
return infos;
|
|
2133
|
+
}
|
|
2098
2134
|
async list() {
|
|
2099
2135
|
return (await this.listAvailable()).map(({ generation: _generation, ...descriptor }) => descriptor);
|
|
2100
2136
|
}
|
|
@@ -2115,14 +2151,14 @@ var BrowsersFacade = class {
|
|
|
2115
2151
|
return this.browserFor(info);
|
|
2116
2152
|
}
|
|
2117
2153
|
async getDefault() {
|
|
2118
|
-
const info = selectDefaultBrowser(await this.
|
|
2154
|
+
const info = selectDefaultBrowser(await this.listForDefaultSelection());
|
|
2119
2155
|
if (!info) {
|
|
2120
2156
|
return this.get("__no_browser_backend__");
|
|
2121
2157
|
}
|
|
2122
2158
|
return this.browserFor(info);
|
|
2123
2159
|
}
|
|
2124
2160
|
async getForUrl(url) {
|
|
2125
|
-
const infos = await this.
|
|
2161
|
+
const infos = await this.listForDefaultSelection();
|
|
2126
2162
|
if (infos.length === 0) {
|
|
2127
2163
|
return this.get("__no_browser_backend__");
|
|
2128
2164
|
}
|
|
@@ -36,7 +36,7 @@ await setupBrowserRuntime({ globals: globalThis });
|
|
|
36
36
|
|
|
37
37
|
Run setup and all later browser calls through `mcp__node_repl__js`, passing JavaScript as the `code` argument. The tool has no `command` parameter.
|
|
38
38
|
|
|
39
|
-
Backend types are `iab`, `extension`, and `cdp`; Playwright is a tab API surface, not a backend. Always use `await agent.browsers.list()` as the availability source. Desktop normally reports IAB;
|
|
39
|
+
Backend types are `iab`, `extension`, and `cdp`; Playwright is a tab API surface, not a backend. Always use `await agent.browsers.list()` as the availability source. Desktop normally reports IAB, and also reports one `extension` browser for each of the user's own Chrome or Edge profiles connected through the ZCode Browser Bridge extension; its `metadata.browserName` (`Google Chrome`, `Microsoft Edge`) says which browser it is, and it uses that browser's profile and sign-ins. A CLI explicitly started with `--browser-use=headless` reports managed Chromium as `cdp`. Headless is a CDP launch mode, not a backend type. Never claim Chrome extension or CDP support when that descriptor is absent, and never silently substitute IAB after the user explicitly selected another backend.
|
|
40
40
|
|
|
41
41
|
User-facing progress should stay non-technical: describe it as "opening the browser" / "checking the page", not "Node REPL", "CDP", or "webview".
|
|
42
42
|
|
|
@@ -56,6 +56,19 @@ const browser = await agent.browsers.get("iab");
|
|
|
56
56
|
nodeRepl.write(await browser.documentation());
|
|
57
57
|
```
|
|
58
58
|
|
|
59
|
+
If the user explicitly asks to use their own Chrome or Edge (or a task needs a site they are signed in to there and they agreed) and discovery advertises a matching `extension` browser, select it by browser name (`Google Chrome` or `Microsoft Edge`):
|
|
60
|
+
|
|
61
|
+
```js
|
|
62
|
+
const infos = await agent.browsers.list();
|
|
63
|
+
const target = infos.find(
|
|
64
|
+
(info) => info.type === "extension" && info.metadata?.browserName === "Google Chrome",
|
|
65
|
+
);
|
|
66
|
+
const browser = await agent.browsers.get(target.id);
|
|
67
|
+
nodeRepl.write(await browser.documentation());
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
If the user asks for their Chrome or Edge but discovery has no matching `extension` browser, say that it is not connected and point them to Settings → Browser Use → Default browser (Chinese UI: 设置 → 浏览器控制 → 默认浏览器). Do not open the in-app browser or the other browser instead.
|
|
71
|
+
|
|
59
72
|
If the user explicitly asks for the CLI-managed headless browser and discovery advertises `cdp`:
|
|
60
73
|
|
|
61
74
|
```js
|
|
@@ -79,9 +92,11 @@ nodeRepl.write(await browser.documentation());
|
|
|
79
92
|
|
|
80
93
|
Do not slice, truncate, or summarize it. Only if the tool output itself reports truncation may you read it in smaller chunks. It documents every default method, the Playwright DOM snapshot→locator workflow, the ref/cua/dom_cua compatibility paths, and safety rules. Screenshot instructions are intentionally lookup-only and must not be loaded unless the visual branch below applies.
|
|
81
94
|
|
|
95
|
+
`getForUrl()` and `getDefault()` follow the user's "Default browser" setting. When it is Chrome or Edge, they select only that browser's `extension` (local URLs too), and throw `backend_unavailable` if it is not connected. Then tell the user to connect it as described above and stop; do not switch to the in-app browser or the other browser unless the user explicitly asks for it.
|
|
96
|
+
|
|
82
97
|
## Core workflow
|
|
83
98
|
|
|
84
|
-
1. Start every browser `js` call with the bootstrap, then assign the selected backend to a local `browser` binding. If the user explicitly asks for ZCode's in-app browser, use `const browser = await agent.browsers.get("iab")`. If they explicitly ask for Chrome, use `await agent.browsers.get(
|
|
99
|
+
1. Start every browser `js` call with the bootstrap, then assign the selected backend to a local `browser` binding. If the user explicitly asks for ZCode's in-app browser, use `const browser = await agent.browsers.get("iab")`. If they explicitly ask for Chrome or Edge, use `await agent.browsers.get(id)` with the matching `extension` browser's id only when the runtime advertises it. For an unspecified target URL use `await agent.browsers.getForUrl(url)`; with no URL/backend preference use `await agent.browsers.getDefault()`.
|
|
85
100
|
2. `browser.tabs.new()` automatically opens and activates the IAB pane so the user can see browser use. Use the advertised visibility capability only when the task explicitly needs to hide the pane or show it again.
|
|
86
101
|
3. At the start of every logical tab operation batch, make a dedicated JS call whose result is the complete
|
|
87
102
|
`await browser.tabs.list()` array, so the model sees all current ids, URLs, titles, and the active marker. Only in
|
|
@@ -773,9 +773,10 @@ reported item. Do other work, unless the user asked you to wait.
|
|
|
773
773
|
|
|
774
774
|
When you genuinely need to look at a run:
|
|
775
775
|
|
|
776
|
-
-
|
|
777
|
-
|
|
778
|
-
|
|
776
|
+
- To wait for a run *this session started*, end your turn: its completion notification wakes
|
|
777
|
+
you.
|
|
778
|
+
- `GetWorkflowRun` is an instant snapshot; it never waits, and it also reads a run another
|
|
779
|
+
session owns, whose notification never comes here.
|
|
779
780
|
- `ListWorkflowRuns` enumerates the project's runs, including other sessions'.
|
|
780
781
|
|
|
781
782
|
Read the terminal state precisely. A run ends in exactly one of three states:
|
|
@@ -1540,7 +1541,7 @@ first, and so does an amendment that would put subagents on a provider neither t
|
|
|
1540
1541
|
nor the run used (a model you name under another provider, in `subagent_model` or in the
|
|
1541
1542
|
script): that choice is the user's, and the window is where they make it. Another session's run that is still running cannot be amended or filled from here: the call is refused, and only that session can act on it. The result names the run that was superseded (if one was stopped) and the new run's
|
|
1542
1543
|
id. The superseded run sends no notification of its own; the new run notifies when it
|
|
1543
|
-
settles. Do not wait for it or poll it
|
|
1544
|
+
settles. Do not wait for it or poll it.
|
|
1544
1545
|
|
|
1545
1546
|
### 16.5 `SaveWorkflow`
|
|
1546
1547
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "node-repl-host",
|
|
3
|
-
"version": "0.7.
|
|
3
|
+
"version": "0.7.2",
|
|
4
4
|
"description": "Shared node_repl runtime host for ZCode official capabilities. Not user-facing: it carries no skill and appears in no marketplace listing; Browser Use and Computer Use enable it and contribute their own skills, docs and runtime assets.",
|
|
5
5
|
"author": {
|
|
6
6
|
"name": "Z.ai"
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"cuaHelperBuildId":"pipeline-
|
|
1
|
+
{"cuaHelperBuildId":"pipeline-356087-1452eca4"}
|
|
@@ -74399,7 +74399,7 @@ var ZCODE_CUA_HELPER_BUILD_ID;
|
|
|
74399
74399
|
var init_cua_version = __esm({
|
|
74400
74400
|
"src/broker/shared/cua-version.ts"() {
|
|
74401
74401
|
"use strict";
|
|
74402
|
-
ZCODE_CUA_HELPER_BUILD_ID = true ? "pipeline-
|
|
74402
|
+
ZCODE_CUA_HELPER_BUILD_ID = true ? "pipeline-356087-1452eca4" : "";
|
|
74403
74403
|
}
|
|
74404
74404
|
});
|
|
74405
74405
|
var init_shared = __esm({
|
|
@@ -122603,6 +122603,7 @@ var browserCommandSchema = external_exports.discriminatedUnion("method", [
|
|
|
122603
122603
|
|
|
122604
122604
|
// ../../../../packages/shared/src/browser-use/backend.ts
|
|
122605
122605
|
var browserBackendTypeSchema = external_exports.enum(["iab", "extension", "cdp"]);
|
|
122606
|
+
var browserUseDefaultBrowserSchema = external_exports.enum(["iab", "chrome", "edge"]);
|
|
122606
122607
|
var browserCapabilityDescriptorSchema = external_exports.object({
|
|
122607
122608
|
id: external_exports.string().trim().min(1),
|
|
122608
122609
|
description: external_exports.string().trim().min(1)
|
|
@@ -123586,6 +123587,14 @@ function isRecord3(value) {
|
|
|
123586
123587
|
// ../../../../packages/zcode-cua/dist/frame-contract/model-content.js
|
|
123587
123588
|
var OFFICIAL_CUA_FRAME_MAX_BASE64_BYTES = 200 * 1024;
|
|
123588
123589
|
|
|
123590
|
+
// src/tool-contract.ts
|
|
123591
|
+
var NODE_REPL_DEFAULT_TIMEOUT_MS = 6e4;
|
|
123592
|
+
var NODE_REPL_SERVER_VERSION = "0.7.2";
|
|
123593
|
+
var BARE_REFERENCE_REMINDER = "[REMINDER before your next js call] Nothing carries over between `js` calls: `agent` and any tab or app handle exist only after the bootstrap of the same call. Start the next call with the official skill's bootstrap, then get the handle again as that skill describes.";
|
|
123594
|
+
var NODE_REPL_CAPABILITY_AND_ROUTING = "The code runs unsandboxed with the ZCode agent's privileges and skips Bash's dangerous-command approval, so never use it for shell, file, package inspection, or data processing work; use the dedicated tools. ";
|
|
123595
|
+
var NODE_REPL_SERVER_INSTRUCTIONS = "Browser Use and Computer Use only. Use `js` to run JavaScript in a fresh Node.js kernel when the corresponding official skill instructs you to control a browser or computer. " + NODE_REPL_CAPABILITY_AND_ROUTING + `Calls default to a ${NODE_REPL_DEFAULT_TIMEOUT_MS} ms timeout. Always provide \`title\` as a short user-facing description in the user's language. Every \`js\` call starts fresh.`;
|
|
123596
|
+
var JS_TOOL_DESCRIPTION = "Browser Use and Computer Use only. Run JavaScript in a fresh Node.js kernel with top-level await as instructed by the corresponding official skill to control a browser or computer. " + NODE_REPL_CAPABILITY_AND_ROUTING + `Always provide the required \`title\` as a short user-facing description in the user's language without implementation terms. If \`timeout_ms\` is omitted, execution times out after ${NODE_REPL_DEFAULT_TIMEOUT_MS} ms. If the code may take more than 30000 ms including all awaited operations, you MUST set \`timeout_ms\` to at least the estimated total runtime plus 15000 ms; split the work into multiple calls if that exceeds the 120000 ms maximum. Use \`nodeRepl.write(value)\` for text and \`await nodeRepl.emitImage(imageLike)\` for images. Bootstrap the requested official capability in every call. Bindings do not carry over between \`js\` calls: \`agent\` and the tab or app handles exist only after the bootstrap of the same call, so a bare reference throws.`;
|
|
123597
|
+
|
|
123589
123598
|
// src/result.ts
|
|
123590
123599
|
function parseEmbeddedMcpResult(value) {
|
|
123591
123600
|
const trimmed = value.trim();
|
|
@@ -123645,6 +123654,12 @@ var NO_CALL_FACTS = {
|
|
|
123645
123654
|
browserUse: false,
|
|
123646
123655
|
computerUse: false
|
|
123647
123656
|
};
|
|
123657
|
+
var BARE_HANDLE_NAMES = /* @__PURE__ */ new Set(["agent", "tab", "browser", "app"]);
|
|
123658
|
+
function isBareHandleReference(error64) {
|
|
123659
|
+
if (error64.name !== "ReferenceError") return false;
|
|
123660
|
+
const identifier = /^(.*) is not defined$/.exec(error64.message)?.[1]?.trim();
|
|
123661
|
+
return identifier !== void 0 && BARE_HANDLE_NAMES.has(identifier);
|
|
123662
|
+
}
|
|
123648
123663
|
function toMcpRunResult(run, facts = NO_CALL_FACTS) {
|
|
123649
123664
|
const textParts = [];
|
|
123650
123665
|
const structuredResults = run.structuredResults ?? [];
|
|
@@ -123673,6 +123688,7 @@ function toMcpRunResult(run, facts = NO_CALL_FACTS) {
|
|
|
123673
123688
|
const structuredIsError = structuredResults.some((structured) => structured.isError === true);
|
|
123674
123689
|
if (run.error) {
|
|
123675
123690
|
textParts.push(run.error.message);
|
|
123691
|
+
if (isBareHandleReference(run.error)) textParts.push(BARE_REFERENCE_REMINDER);
|
|
123676
123692
|
} else {
|
|
123677
123693
|
if (run.logs) textParts.push(run.logs);
|
|
123678
123694
|
if (structuredResults.length === 0 && run.result !== void 0 && !embedded) {
|
|
@@ -123735,13 +123751,6 @@ function toMcpRunResult(run, facts = NO_CALL_FACTS) {
|
|
|
123735
123751
|
};
|
|
123736
123752
|
}
|
|
123737
123753
|
|
|
123738
|
-
// src/tool-contract.ts
|
|
123739
|
-
var NODE_REPL_DEFAULT_TIMEOUT_MS = 6e4;
|
|
123740
|
-
var NODE_REPL_SERVER_VERSION = "0.7.1";
|
|
123741
|
-
var NODE_REPL_CAPABILITY_AND_ROUTING = "The code runs unsandboxed with the ZCode agent's privileges and skips Bash's dangerous-command approval, so never use it for shell, file, package inspection, or data processing work; use the dedicated tools. ";
|
|
123742
|
-
var NODE_REPL_SERVER_INSTRUCTIONS = "Browser Use and Computer Use only. Use `js` to run JavaScript in a fresh Node.js kernel when the corresponding official skill instructs you to control a browser or computer. " + NODE_REPL_CAPABILITY_AND_ROUTING + `Calls default to a ${NODE_REPL_DEFAULT_TIMEOUT_MS} ms timeout. Always provide \`title\` as a short user-facing description in the user's language. Every \`js\` call starts fresh.`;
|
|
123743
|
-
var JS_TOOL_DESCRIPTION = "Browser Use and Computer Use only. Run JavaScript in a fresh Node.js kernel with top-level await as instructed by the corresponding official skill to control a browser or computer. " + NODE_REPL_CAPABILITY_AND_ROUTING + `Always provide the required \`title\` as a short user-facing description in the user's language without implementation terms. If \`timeout_ms\` is omitted, execution times out after ${NODE_REPL_DEFAULT_TIMEOUT_MS} ms. If the code may take more than 30000 ms including all awaited operations, you MUST set \`timeout_ms\` to at least the estimated total runtime plus 15000 ms; split the work into multiple calls if that exceeds the 120000 ms maximum. Use \`nodeRepl.write(value)\` for text and \`await nodeRepl.emitImage(imageLike)\` for images. Bootstrap the requested official capability in every call.`;
|
|
123744
|
-
|
|
123745
123754
|
// src/server.ts
|
|
123746
123755
|
var MAX_SYNC_TIMEOUT_MS = 12e4;
|
|
123747
123756
|
var UNTRUSTED_SESSION_KEY = "__unscoped__";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@zcode/node-repl-host",
|
|
3
3
|
"private": true,
|
|
4
|
-
"version": "0.7.
|
|
4
|
+
"version": "0.7.2",
|
|
5
5
|
"description": "Shared node_repl MCP host. Owns the JS execution surface and the domain bridges (Browser Use, Computer Use) that ride on it; the official plugins contribute only their own skills, docs and runtime assets.",
|
|
6
6
|
"type": "module",
|
|
7
7
|
"exports": {
|