zcode-app-cli 3.9.1-16 → 3.9.2-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/bin/zcode.js +17 -0
- package/config.example.json +14 -0
- package/package.json +1 -1
- package/vendor/extraction.json +4 -4
- package/vendor/node_modules/@zcode/tui/dist/index.js +17 -0
- package/vendor/packages/browser-use-plugin/.zcode-plugin/plugin.json +1 -1
- package/vendor/packages/browser-use-plugin/dist/mcp/server.js +232 -256
- package/vendor/packages/browser-use-plugin/docs/api.json +5 -0
- package/vendor/packages/browser-use-plugin/docs/overview.md +3 -0
- package/vendor/packages/browser-use-plugin/package.json +1 -1
- package/vendor/packages/browser-use-plugin/scripts/browser-client.mjs +63 -7
- package/vendor/packages/browser-use-plugin/skills/control-browser/SKILL.md +4 -1
- package/vendor/packages/document-skills-plugin/package.json +1 -1
- package/vendor/packages/document-skills-plugin/skills/pptx/SKILL.md +5 -3
- package/vendor/packages/zcode-cua-plugin/.zcode-plugin/plugin.json +2 -2
- package/vendor/packages/zcode-cua-plugin/dist/mcp/server.js +573 -1023
- package/vendor/packages/zcode-cua-plugin/package.json +1 -1
- package/vendor/packages/zcode-cua-plugin/skills/zcode-computer-use/SKILL.md +55 -12
- package/vendor/zcode.cjs +697 -698
- package/zcode-runtime.lock.json +3 -3
|
@@ -99,6 +99,11 @@
|
|
|
99
99
|
"name": "getForUrl",
|
|
100
100
|
"kind": "method",
|
|
101
101
|
"signature": "getForUrl(url: string): Promise<Browser>"
|
|
102
|
+
},
|
|
103
|
+
{
|
|
104
|
+
"name": "open",
|
|
105
|
+
"kind": "method",
|
|
106
|
+
"signature": "open(url?: string, options?: { reuseTab?: boolean }): Promise<Tab>"
|
|
102
107
|
}
|
|
103
108
|
]
|
|
104
109
|
},
|
|
@@ -43,6 +43,9 @@ High-level methods return their payload directly. Actions return `undefined` on
|
|
|
43
43
|
After inspecting it, use the next fresh JS call to match the intended id/url/title and call `tabs.get(id)`; no old
|
|
44
44
|
Browser or Tab JavaScript binding exists across calls. Continuous actions in the same JS cell may reuse the
|
|
45
45
|
just-validated Tab.
|
|
46
|
+
- For URL navigation, prefer `await agent.browsers.open(url)`: it reuses an existing same-site controlled tab (same
|
|
47
|
+
hostname), activates it so the user sees it, and navigates in place instead of stacking new tabs. Pass
|
|
48
|
+
`{ reuseTab: false }` or use `browser.tabs.new()` only when a parallel independent tab is genuinely needed.
|
|
46
49
|
- App-provided in-app-browser context is ambient UI state, not a browser-selection instruction. When it identifies a
|
|
47
50
|
visible page, recover it from controlled tabs first, then user tabs; do not create a duplicate page before checking both.
|
|
48
51
|
- Base every interaction on visible page state, not DOM source order. After an action, collect the cheapest observation
|
|
@@ -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.
|
|
4
|
+
"version": "0.4.0",
|
|
5
5
|
"private": true,
|
|
6
6
|
"description": "作为官方 ZCode 内置插件发布的 Browser Use skill、client runtime 与无状态 node_repl MCP server。",
|
|
7
7
|
"license": "MIT",
|
|
@@ -33,11 +33,20 @@ var FALLBACK_MANIFEST = {
|
|
|
33
33
|
members: [{ name: "get", kind: "method", signature: "get(name: string): Promise<string>" }]
|
|
34
34
|
},
|
|
35
35
|
Browsers: {
|
|
36
|
-
members: [
|
|
37
|
-
name
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
36
|
+
members: [
|
|
37
|
+
...["list", "get", "getDefault", "getForUrl"].map((name) => ({
|
|
38
|
+
name,
|
|
39
|
+
kind: "method",
|
|
40
|
+
signature: `${name}(...)`
|
|
41
|
+
})),
|
|
42
|
+
// open() 是默认导航入口(同站复用 + 激活 + 原地跳转);不声明会被 hideUnknown
|
|
43
|
+
// 代理隐藏,REPL 里 agent.browsers.open 变 undefined(与插件 docs/api.json 同步维护)。
|
|
44
|
+
{
|
|
45
|
+
name: "open",
|
|
46
|
+
kind: "method",
|
|
47
|
+
signature: "open(url?: string, options?: { reuseTab?: boolean }): Promise<Tab>"
|
|
48
|
+
}
|
|
49
|
+
]
|
|
41
50
|
},
|
|
42
51
|
Browser: {
|
|
43
52
|
members: [
|
|
@@ -571,6 +580,9 @@ var FALLBACK_DOCUMENTATION = [
|
|
|
571
580
|
"Backend types are `iab | extension | cdp`; Playwright is a tab API surface, not a backend. Never assume an unlisted backend is available.",
|
|
572
581
|
"High-level methods return payloads directly and throw `BrowserCommandError` on failure.",
|
|
573
582
|
"Before each logical tab-operation batch, return the complete `browser.tabs.list()` result in a dedicated observation cell. Each `TabInfo` includes `viewport: BrowserViewportSize`. After the model inspects the list, match by stable id or verified URL/title and call `tabs.get(id)` in the next cell; if no controlled tab matches, inspect and claim `browser.user.openTabs()` before creating a new tab.",
|
|
583
|
+
// 修复原因:模型每次对同站 URL 都走 tabs.new(),任务结束后 IAB 堆满标签页(用户工单反馈)。
|
|
584
|
+
// open() 现在内置同站复用(激活 + 原地跳转),文档必须把 open() 教成默认导航入口。
|
|
585
|
+
"`agent.browsers.open(url)` is the default navigation entry: it reuses an existing same-site controlled tab (same hostname), activates it so the user sees it, and navigates in place instead of stacking new tabs. Only pass `{ reuseTab: false }` (or use `browser.tabs.new()`) when the task genuinely needs a parallel independent tab.",
|
|
574
586
|
// 修复原因:Codex 的模型轨迹会在新 URL 的 goto 后显式确认 DOMContentLoaded;fallback 也必须保留同一顺序。
|
|
575
587
|
'For a genuinely new URL with no intended existing page, use `const tab = await browser.tabs.new()`, run `await tab.goto(url)`, then run `await tab.playwright.waitForLoadState({ state: "domcontentloaded" })` before returning the first title, URL, or DOM observation.',
|
|
576
588
|
'After every successful `tab.goto(url)`, explicitly call `await tab.playwright.waitForLoadState({ state: "domcontentloaded" })` before the first title, URL, or DOM observation. Keep this confirmation in the model-visible trajectory even when goto() has already settled the backend navigation. Do not replace it with networkidle or a fixed sleep; routine URL/load-state waits remain capped at 3000ms.',
|
|
@@ -765,6 +777,27 @@ function urlMatchRank(target, candidate) {
|
|
|
765
777
|
return 3;
|
|
766
778
|
return void 0;
|
|
767
779
|
}
|
|
780
|
+
function selectTabForUrl(targetValue, tabs) {
|
|
781
|
+
const target = parseUrl(targetValue);
|
|
782
|
+
let best;
|
|
783
|
+
for (const tab of tabs) {
|
|
784
|
+
if (!tab.url)
|
|
785
|
+
continue;
|
|
786
|
+
let rank;
|
|
787
|
+
try {
|
|
788
|
+
rank = urlMatchRank(target, parseUrl(tab.url));
|
|
789
|
+
} catch {
|
|
790
|
+
continue;
|
|
791
|
+
}
|
|
792
|
+
if (rank === void 0 || rank > 2)
|
|
793
|
+
continue;
|
|
794
|
+
if (best === void 0 || rank < best.rank || // 同 rank:active 优先;都不 active 时列表靠后(更新)的胜出。
|
|
795
|
+
rank === best.rank && (tab.active === true || best.tab.active !== true)) {
|
|
796
|
+
best = { tab, rank };
|
|
797
|
+
}
|
|
798
|
+
}
|
|
799
|
+
return best?.tab;
|
|
800
|
+
}
|
|
768
801
|
function selectBrowserForUrl(infos, targetValue, tabsByBrowserId) {
|
|
769
802
|
if (infos.length === 0) {
|
|
770
803
|
throw new Error("No browser backend is available");
|
|
@@ -1901,6 +1934,21 @@ var BrowserTabs = class {
|
|
|
1901
1934
|
const summary = expectPayload(command, result, result.tab, "tab");
|
|
1902
1935
|
return this.tab(summary);
|
|
1903
1936
|
}
|
|
1937
|
+
/**
|
|
1938
|
+
* open(url) 的复用入口:按 URL 匹配已有 agent-owned tab,命中则激活(activateTab,
|
|
1939
|
+
* 用户立即看到该 tab)并返回,未命中返回 undefined。list/activate 的失败向调用方抛出,
|
|
1940
|
+
* 由 open() 统一降级为 newTab,复用链路绝不阻断任务。
|
|
1941
|
+
*/
|
|
1942
|
+
async reuse(url) {
|
|
1943
|
+
const summaries = await this.summaries();
|
|
1944
|
+
const matched = selectTabForUrl(url, summaries);
|
|
1945
|
+
if (!matched)
|
|
1946
|
+
return void 0;
|
|
1947
|
+
const command = { method: "activateTab", tabId: matched.tabId };
|
|
1948
|
+
const result = await this.execute(command);
|
|
1949
|
+
const activated = expectPayload(command, result, result.tab, "tab");
|
|
1950
|
+
return this.tab(activated);
|
|
1951
|
+
}
|
|
1904
1952
|
async finalize(options = {}) {
|
|
1905
1953
|
const keep = (options.keep ?? []).map(({ tab, status }) => ({
|
|
1906
1954
|
tabId: typeof tab === "string" ? tab : tab.id,
|
|
@@ -2094,8 +2142,16 @@ var BrowsersFacade = class {
|
|
|
2094
2142
|
}));
|
|
2095
2143
|
return this.browserFor(selectBrowserForUrl(infos, url, tabsByBrowserId));
|
|
2096
2144
|
}
|
|
2097
|
-
async open(url) {
|
|
2098
|
-
const
|
|
2145
|
+
async open(url, options = {}) {
|
|
2146
|
+
const browser = await this.getDefault();
|
|
2147
|
+
if (url && options.reuseTab !== false) {
|
|
2148
|
+
const reusable = await browser.tabs.reuse(url).catch(() => void 0);
|
|
2149
|
+
if (reusable) {
|
|
2150
|
+
await reusable.goto(url);
|
|
2151
|
+
return reusable;
|
|
2152
|
+
}
|
|
2153
|
+
}
|
|
2154
|
+
const tab = await browser.tabs.new();
|
|
2099
2155
|
if (url) {
|
|
2100
2156
|
await tab.goto(url);
|
|
2101
2157
|
}
|
|
@@ -95,7 +95,10 @@ Do not slice, truncate, or summarize it. Only if the tool output itself reports
|
|
|
95
95
|
If no controlled tab matches, inspect `browser.user.openTabs()` and claim the matching returned object. Create a new
|
|
96
96
|
tab only after both lists fail to identify the page. This is the pre-action target-selection protocol; it is distinct
|
|
97
97
|
from the combined post-action observation in step 7.
|
|
98
|
-
4. If the task names a new URL,
|
|
98
|
+
4. If the task names a new URL, prefer the reuse-aware entry: `await agent.browsers.open(url)` reuses an existing
|
|
99
|
+
same-site controlled tab (same hostname), activates it so the user sees it, and navigates in place, instead of
|
|
100
|
+
stacking a new tab on every navigation. Only when the task genuinely needs a parallel independent tab, create one
|
|
101
|
+
explicitly and preserve the Codex navigation sequence:
|
|
99
102
|
|
|
100
103
|
```js
|
|
101
104
|
const tab = await browser.tabs.new();
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"$schema": "https://json.schemastore.org/package.json",
|
|
3
3
|
"name": "@zcode/document-skills-plugin",
|
|
4
|
-
"version": "0.1.
|
|
4
|
+
"version": "0.1.2",
|
|
5
5
|
"private": true,
|
|
6
6
|
"license": "SEE LICENSE IN skills/docx/LICENSE.txt",
|
|
7
7
|
"description": "Built-in DOCX and PDF document production skills published as an official ZCode plugin."
|
|
@@ -3,7 +3,7 @@ name: pptx
|
|
|
3
3
|
metadata:
|
|
4
4
|
author: Z.AI
|
|
5
5
|
version: "1.1"
|
|
6
|
-
description: "
|
|
6
|
+
description: "create and edit pptx file via pptxgenjs/python-pptx"
|
|
7
7
|
license: Proprietary. LICENSE.txt has complete terms
|
|
8
8
|
---
|
|
9
9
|
# Part 1 · Slide Design Best Practices
|
|
@@ -97,6 +97,7 @@ Build the palette on the **BACKGROUND → PRIMARY → ACCENT** model, and reuse
|
|
|
97
97
|
3. Then add text on top of the overlay
|
|
98
98
|
- **Alternative (preferred):** instead of full-bleed images, place the image in a bounded region (e.g. the right half) and keep text in the other region on a solid background.
|
|
99
99
|
- If an image is decorative, keep it small and positioned where it won't collide with text.
|
|
100
|
+
- **Never stretch an image to fit** — when its aspect ratio doesn't match the target box, crop it (`sizing: { type: 'cover' }` or an explicit `crop`), never distort it by setting a `w`/`h` that breaks the ratio. This matters most on covers and full-bleed backgrounds, where a stretched photo is the most visible defect on the deck.
|
|
100
101
|
- Test mentally: *"if I printed this slide in grayscale, could I still read every word?"*
|
|
101
102
|
|
|
102
103
|
## 6. Typography
|
|
@@ -119,6 +120,7 @@ Build the palette on the **BACKGROUND → PRIMARY → ACCENT** model, and reuse
|
|
|
119
120
|
- Leave breathing room — don't fill every inch
|
|
120
121
|
|
|
121
122
|
## 8. CJK fonts
|
|
123
|
+
|
|
122
124
|
- **Name a face the viewer's PowerPoint actually ships**: 微软雅黑 / 等线 (Windows), 苹方 PingFang SC (macOS). A face that only exists on the build machine (Noto Sans SC, 思源黑体, LXGW 文楷 …) silently substitutes on the user's machine — use it only as the fallback, not the only name.
|
|
123
125
|
- **Sans for the deck, serif for editorial weight**: 微软雅黑 / 苹方 for corporate, tech and data decks; 思源宋体 / 宋体 only for cultural, academic or heritage topics, and mainly on titles. **Never** use 楷体 / 行楷 / 隶书 / 艺术字体 for body text.
|
|
124
126
|
- **Avoid Light/Thin CJK weights** — Chinese glyphs have far more strokes than Latin, so hairline weights turn to mud on a projector. Regular for body, Bold/Semibold for titles; build hierarchy with size and weight, not with a third face.
|
|
@@ -148,7 +150,7 @@ Build the palette on the **BACKGROUND → PRIMARY → ACCENT** model, and reuse
|
|
|
148
150
|
|
|
149
151
|
**Code QA:** run a short `python-pptx` script over the finished deck to flag text overflow (estimated text height/width vs. the shape box, plus boxes outside the slide) and overlap (bounding-box intersection between two text-bearing shapes), then fix the real hits and re-run.
|
|
150
152
|
|
|
151
|
-
Do not call external vlm to check slides for visual QA
|
|
153
|
+
**Visual QA** use pdftoppm to convert pptx2image and use judge subagent(if not exist,check it yourself) to check when neccesary. Do not call external vlm to check slides for visual QA
|
|
152
154
|
|
|
153
155
|
---
|
|
154
156
|
|
|
@@ -179,7 +181,6 @@ slide.addText("Hello World!", { x: M, y: M, w: W - 2 * M, fontSize: 36, color: "
|
|
|
179
181
|
pres.writeFile({ fileName: "Presentation.pptx" }).then(() => console.log("done"));
|
|
180
182
|
```
|
|
181
183
|
|
|
182
|
-
|
|
183
184
|
## Layout dimensions
|
|
184
185
|
|
|
185
186
|
|
|
@@ -339,6 +340,7 @@ slide.addImage({ path: "image.png", x: centerX, y: 1.2, w: calcW, h: maxH });
|
|
|
339
340
|
Supports PNG / JPG / GIF / SVG (SVG works in modern PowerPoint / Microsoft 365).
|
|
340
341
|
|
|
341
342
|
## No `outEnd` labels on stacked bar charts
|
|
343
|
+
|
|
342
344
|
OOXML restricts `c:dLblPos` by grouping: **stacked / percentStacked only allow
|
|
343
345
|
`ctr` / `inBase` / `inEnd`** — `outEnd` is valid only for `clustered` (line: ctr/l/r/t/b;
|
|
344
346
|
pie/doughnut: bestFit/ctr/inEnd/outEnd).
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "zcode-cua",
|
|
3
|
-
"version": "0.5.
|
|
4
|
-
"description": "
|
|
3
|
+
"version": "0.5.12",
|
|
4
|
+
"description": "Computer Use: automate desktop apps with mouse, keyboard, and UI element control.",
|
|
5
5
|
"author": {
|
|
6
6
|
"name": "Z.ai"
|
|
7
7
|
},
|