@xiaoqiong0v0/opencode-browser-tool 1.11.0 → 1.12.0

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/dist/i18n/en.js CHANGED
@@ -1,20 +1,45 @@
1
1
  const en = {
2
2
  tool: {
3
- "tool.cli.desc": "Browser automation via a CLI-style dispatcher: pass a single command string, e.g. \"navigate --url https://...\" or \"help\". Omit to list all commands. screenshot with --selector scrolls the element into view first. The browser process is managed automatically by this tool — do not run the bt-shell executable directly (it causes multiple instances and file-lock conflicts).",
3
+ "tool.cli.desc": "Browser automation via a CLI-style dispatcher: pass a single command string, e.g. \"navigate --url https://...\" or \"help\". Omit to list all commands. screenshot with --selector scrolls the element into view first. The browser process is managed automatically by this tool. Task sub-agent sessions share the root session's browser instance by default; add --private-session for an isolated instance (sticky for that sub-session).",
4
4
  "tool.cli.arg.args": "Command line string: \"<command> [--flag value ...]\", e.g. \"navigate --url https://...\" (\"help\" lists all)",
5
5
  "cli.header": "bt_cli — browser automation CLI",
6
6
  "cli.usage": "Usage: bt_cli({ args })\n args single command line string: \"<command> [--flag value ...]\"",
7
+ "cli.usage.flags": "Global flag:\n --private-session use the caller's own session instance (default: share the root session's instance and data dir; once used by a sub-session it stays private)",
7
8
  "cli.commands": "Commands:",
8
9
  "cli.examples": "Examples:",
9
10
  "cli.example.1": "bt_cli({ args: \"help\" })",
10
11
  "cli.example.2": "bt_cli({ args: \"navigate --url https://example.com\" })",
11
12
  "cli.example.3": "bt_cli({ args: \"click --selector #submit\" })",
12
13
  "cli.example.4": "bt_cli({ args: \"fill --selector #q --value \\\"hello world\\\"\" })",
14
+ "cli.example.5": "bt_cli({ args: \"evaluate \\\"1+1\\\" @file:scripts/hook.js\" })",
13
15
  "cli.unknown": "Unknown command: {cmd}",
14
16
  "cli.invalid_args": "Invalid args for {cmd}: {msg}",
17
+ "cli.err.flag_not_number": "Flag --{flag} needs a number, got: {v}",
15
18
  "cli.err.timeout_invalid": "--timeout must be a positive integer in ms (100-60000), got: {v}",
16
19
  "cli.err.profile_invalid_name": "Invalid profile name: {name}. Use 1-64 chars, no / \\ : or < > \" | ? *, must not start with a dot, and must not be a Windows reserved name (CON/PRN/AUX/NUL/COM1-9/LPT1-9).",
17
20
  "cli.err.file_outside_tmp": "Refusing to read @file outside the plugin temp directory: {path}",
21
+ "cli.err.eval_script_conflict": "evaluate: --script cannot be combined with positional items (use one or the other; positional order defines execution order)",
22
+ "cli.err.eval_no_items": "evaluate: no script given. Pass inline JS text or @file:<path> items (or --script \"...\" for a single script)",
23
+ "cli.err.eval_file_outside": "evaluate: refusing to read @file outside the workspace / plugin temp directories: {path}",
24
+ "cli.err.eval_file_too_large": "evaluate: @file exceeds the per-file limit of {kb} KiB: {path}",
25
+ "cli.err.eval_total_too_large": "evaluate: @file scripts exceed the total limit of {kb} KiB: {path}",
26
+ "cli.err.eval_not_a_file": "not a regular file",
27
+ "cli.err.inject_match_required": "inject add: --match is required (glob with * wildcards, e.g. \"*example.com*\", or \"re:<regex>\")",
28
+ "cli.err.inject_no_items": "inject add: no content given. Pass at least one --file <path> or --text <code>",
29
+ "cli.err.inject_file_outside": "inject add: refusing to read --file outside the workspace / plugin temp directories: {path}",
30
+ "cli.err.inject_file_too_large": "inject add: --file exceeds the per-file limit of {kb} KiB: {path}",
31
+ "cli.err.inject_rule_too_large": "inject add: this rule's items exceed the limit of {kb} KiB: {path}",
32
+ "cli.err.inject_items_too_large": "inject add: this rule's items exceed the limit of {kb} KiB (split the code across several rules)",
33
+ "cli.err.inject_read_failed": "inject add: cannot read --file: {path}: {msg}",
34
+ "cli.err.inject_id_required": "inject: --id is required for remove / enable / disable",
35
+ "cli.err.inject_url_required": "inject test: --url is required",
36
+ "cli.err.inject_unknown_action": "inject: unknown action \"{action}\". Use add / list / remove / clear / enable / disable / test",
37
+ "cli.err.type_text_required": "type: --text is required and must be non-empty (pass inline text or @file:<path>)",
38
+ "cli.err.type_text_too_large": "type: text exceeds the limit of {kb} KiB (split it into several type calls)",
39
+ "cli.err.type_file_outside": "type: refusing to read @file outside the workspace / plugin temp directories: {path}",
40
+ "cli.err.type_file_too_large": "type: @file exceeds the per-file limit of {kb} KiB: {path}",
41
+ "cli.err.type_file_total_too_large": "type: @file exceeds the total limit of {kb} KiB: {path}",
42
+ "cli.err.type_read_failed": "type: cannot read @file: {path}: {msg}",
18
43
  "cli.failed": "Command {cmd} failed: {msg}",
19
44
  "cli.cmd.navigate": "Navigate browser to a URL",
20
45
  "cli.cmd.click": "Click an element; optional --timeout ms (100-60000) caps this call's wait budget, timeout errors explicitly",
@@ -24,12 +49,15 @@ const en = {
24
49
  "cli.cmd.hover": "Hover over an element; optional --timeout ms (100-60000) caps this call's wait budget, timeout errors explicitly",
25
50
  "cli.cmd.drag": "Drag element to a target; optional --timeout ms (100-60000) caps this call's wait budget, timeout errors explicitly",
26
51
  "cli.cmd.press_key": "Press a keyboard key; optional --timeout ms (100-60000) caps this call's wait budget, timeout errors explicitly",
52
+ "cli.cmd.type": "Insert text at the current focus WITHOUT clearing existing content (use this for xterm/terminal/contenteditable; use fill for form replacement). --selector focuses that element first; --enter presses Enter after inserting; --text accepts @file:<path> (workspace dir or plugin tmp only, content never enters the model context); optional --timeout ms (100-60000) caps this call's wait budget",
27
53
  "cli.cmd.upload_file": "Upload a file to an input; optional --timeout ms (100-60000) caps this call's wait budget, timeout errors explicitly",
28
54
  "cli.cmd.screenshot": "Take a screenshot (returns image attachment; with --selector it scrolls the element into view first); optional --timeout ms (100-60000) caps this call's wait budget, timeout errors explicitly",
29
- "cli.cmd.evaluate": "Execute JS in the page, return result; optional --timeout ms (100-60000) caps this call's wait budget, timeout errors explicitly",
55
+ "cli.cmd.evaluate": "Execute JS in the page and return the result. Items run in order, one at a time: @file:<path> reads a script file (workspace dir or plugin tmp only), anything else is inline JS; stops at the first failure unless --continue-on-error. --script \"...\" runs a single script and cannot be combined with positional items; optional --timeout ms (100-60000) caps each script's wait budget",
56
+ "cli.cmd.inject": "Persistent inject rules: JS that runs when a document finishes loading and the tab URL matches. Sub-actions: add --match <glob|re:...> [--file <path>]... [--text <code>]... [--order N] [--disabled] (files from the workspace dir or plugin tmp, ≤256 KiB each; converted to text so Rust never sees paths); list; remove|enable|disable --id <id>; clear; test --url <url> (match only, executes nothing). Rules live in the session data dir (sessions/<profile>/<sid>/inject/rules.json), at most 20 rules / 256 KiB per rule, executed in ascending --order; a rule auto-disables after 3 consecutive failures",
30
57
  "cli.cmd.get_visible_text": "Get visible page text",
31
58
  "cli.cmd.get_visible_html": "Get page HTML structure",
32
- "cli.cmd.console_logs": "Get browser console logs",
59
+ "cli.cmd.console_logs": "Get buffered console logs (--type, --group burst|none, --phase, --search, --limit, --tab, --include-internal, --clear; --no-dedupe = --group=none; --tab N = the 0-based index printed by list_tabs, so --tab 0 is the first tab); entries show (xN)/phase/source, exceptions include the stack's first line; browser-internal logs (violation/deprecation, e.g. [DOM] Password field) are hidden unless --include-internal",
60
+ "cli.cmd.network_logs": "Get buffered network requests (--type, --status 2xx|3xx|4xx|5xx|N, --failed, --search, --group burst|key|none, --phase load|interactive|action:<cmd>, --limit, --tab (0-based), --include-headers, --reveal-secrets, --clear; --no-dedupe = --group=none; --tab N = the 0-based index printed by list_tabs, so --tab 0 is the first tab)",
33
61
  "cli.cmd.go_back": "Go back in history",
34
62
  "cli.cmd.go_forward": "Go forward in history",
35
63
  "cli.cmd.resize": "Resize the page content area (viewport, not the OS window; window height = content + 72px toolbar; min 360x360, smaller values are clamped)",
@@ -81,6 +109,9 @@ const en = {
81
109
  "cli.out.hover": "Hovered",
82
110
  "cli.out.drag": "Dragged",
83
111
  "cli.out.press_key": "Pressed: {key}",
112
+ "cli.out.type": "typed {n} char(s) into {target}",
113
+ "cli.out.type.focused": "focused element",
114
+ "cli.out.type.enter": " + Enter",
84
115
  "cli.out.upload_file": "Uploaded",
85
116
  "cli.out.screenshot": "Screenshot taken{where}",
86
117
  "cli.out.screenshot.element": " (element: {sel})",
@@ -88,7 +119,17 @@ const en = {
88
119
  "cli.out.no_visible_text": "(no visible text)",
89
120
  "cli.out.no_visible_html": "(no visible html)",
90
121
  "cli.out.html_truncated": "…(truncated at maxLength={n})",
91
- "cli.out.no_logs": "(no logs)",
122
+ "cli.out.console_empty": "(no console logs — the page may have produced none, may have navigated (logs are per tab and kept across navigation), or the logs may be in another tab; try --tab or list_tabs)",
123
+ "cli.out.network_empty": "(no network requests — the page may have made none, may have navigated, or the requests may be in another tab (also check whether --clear just emptied the stream); try --tab or list_tabs)",
124
+ // ---- Log stream formatting fragments (technical tokens stay identical across languages) ----
125
+ "cli.out.inject_empty": "No inject rules yet. Add one with: inject add --match \"*host*\" --file hook.js",
126
+ "cli.out.inject_removed": "inject: removed {id} ({n} rule(s) left)",
127
+ "cli.out.inject_enabled": "inject: enabled {id} ({n} rule(s) total)",
128
+ "cli.out.inject_disabled": "inject: disabled {id} ({n} rule(s) total)",
129
+ "cli.out.inject_cleared": "inject: all rules cleared (add new ones with `inject add`)",
130
+ "cli.log.failed": "failed: {reason}",
131
+ "cli.log.failed_unknown": "request failed",
132
+ "cli.log.dropped": "({n} dropped by buffer limit)",
92
133
  "cli.out.go_back": "Went back, current URL: {url}",
93
134
  "cli.out.go_forward": "Went forward, current URL: {url}",
94
135
  "cli.out.resize": "Resized content to {w}x{h}",
@@ -159,14 +200,14 @@ const en = {
159
200
  "bin.not_ready": "bt-shell is not ready yet, retry later",
160
201
  "bin.release_not_found": "No Release asset found for this version (tag={tag}); for a plugin-only change make sure the binary is still attached to the x.Y.0 Release, and for Rust changes bump the minor version and create/update that Release first",
161
202
  // ---- client-layer errors surfaced to the model ----
162
- "client.service_timeout": "Browser service not ready (timed out). bt-shell is managed automatically by the plugin — do not run the executable directly. Retry via bt_cli later (e.g. open_window).",
203
+ "client.service_timeout": "Browser service not ready (timed out). bt-shell is managed automatically by the plugin. Retry via bt_cli later (e.g. open_window).",
163
204
  "client.attach_timeout": "External bt-shell at {url} is not ready (timed out). Check BT_SHELL_URL/BT_SHELL_PORT and that the shell is running.",
164
205
  "client.not_configured": "Service not configured",
165
206
  "client.service_error": "Service error",
166
207
  "client.auth_rejected": "Local browser API rejected authentication (HTTP 401/403). Call open_window to reopen the browser.",
167
208
  "client.bad_response": "Malformed response from the browser service (invalid JSON). The instance was not treated as closed; retry the call.",
168
209
  "client.bt_shell_path_missing": "BT_SHELL_PATH points to a binary that does not exist (path is in the environment variable)",
169
- "client.spawn_failed": "Failed to start the bt-shell process (retry via bt_cli later; do not run the executable directly)",
210
+ "client.spawn_failed": "Failed to start the bt-shell process (retry via bt_cli later)",
170
211
  "client.session_closed_during_start": "A close request was received while the browser was starting; that instance was terminated. Call open_window if you need it again.",
171
212
  "client.attach_gone": "Attached external bt-shell at {url} is gone (attach mode does not own that process; restart the shell yourself).",
172
213
  "client.attach_need_token": "Attach mode requires an auth token: set BT_SHELL_TOKEN and start the external bt-shell with the same token (--token <token>, or the same environment variable).",
package/dist/i18n/zh.js CHANGED
@@ -1,20 +1,45 @@
1
1
  const zh = {
2
2
  tool: {
3
- "tool.cli.desc": "CLI 风格的浏览器自动化控制:单个字符串命令行,如 \"navigate --url https://...\" 或 \"help\"。省略列出全部命令。screenshot 带 --selector 会先自动滚动到元素再截取。浏览器进程由本工具自动管理;请勿直接执行 bt-shell 可执行文件(会造成多实例与文件锁冲突)。",
3
+ "tool.cli.desc": "CLI 风格的浏览器自动化控制:单个字符串命令行,如 \"navigate --url https://...\" 或 \"help\"。省略列出全部命令。screenshot 带 --selector 会先自动滚动到元素再截取。浏览器进程由本工具自动管理。task 子代理会话默认与主会话共用同一浏览器实例;需要独立窗口/登录态时加 --private-session(对该子会话粘住)。",
4
4
  "tool.cli.arg.args": "命令行字符串:\"<command> [--flag 值 ...]\",如 \"navigate --url https://...\"(\"help\" 列出全部)",
5
5
  "cli.header": "bt_cli — 浏览器自动化 CLI",
6
6
  "cli.usage": "用法: bt_cli({ args })\n args 单个命令行字符串: \"<command> [--flag 值 ...]\"",
7
+ "cli.usage.flags": "全局 flag:\n --private-session 使用调用者自己的会话实例(默认与根会话共用同一实例与数据目录;同一子会话首次使用后会保持私有)",
7
8
  "cli.commands": "子命令:",
8
9
  "cli.examples": "示例:",
9
10
  "cli.example.1": "bt_cli({ args: \"help\" })",
10
11
  "cli.example.2": "bt_cli({ args: \"navigate --url https://example.com\" })",
11
12
  "cli.example.3": "bt_cli({ args: \"click --selector #submit\" })",
12
13
  "cli.example.4": "bt_cli({ args: \"fill --selector #q --value \\\"hello world\\\"\" })",
14
+ "cli.example.5": "bt_cli({ args: \"evaluate \\\"1+1\\\" @file:scripts/hook.js\" })",
13
15
  "cli.unknown": "未知命令: {cmd}",
14
16
  "cli.invalid_args": "参数无效 {cmd}: {msg}",
17
+ "cli.err.flag_not_number": "参数 --{flag} 需要数字,收到:{v}",
15
18
  "cli.err.timeout_invalid": "--timeout 须为正整数(毫秒,100~60000),收到:{v}",
16
19
  "cli.err.profile_invalid_name": "配置名无效:{name}。要求 1~64 个字符,不含 / \\ : 及 < > \" | ? *,不以点开头,且不是 Windows 保留名(CON/PRN/AUX/NUL/COM1-9/LPT1-9)。",
17
20
  "cli.err.file_outside_tmp": "拒绝读取插件临时目录之外的 @file: {path}",
21
+ "cli.err.eval_script_conflict": "evaluate: --script 不能与位置参数项同时使用(二选一;只给 --script 即单个脚本,多个项由位置参数顺序决定执行顺序)",
22
+ "cli.err.eval_no_items": "evaluate: 缺少脚本。请传内联 JS 文本或 @file:<路径> 项(单个脚本也可以用 --script \"...\")",
23
+ "cli.err.eval_file_outside": "evaluate: 拒绝读取工作区 / 插件临时目录之外的 @file: {path}",
24
+ "cli.err.eval_file_too_large": "evaluate: @file 超过单文件上限 {kb} KiB: {path}",
25
+ "cli.err.eval_total_too_large": "evaluate: @file 脚本合计超过上限 {kb} KiB: {path}",
26
+ "cli.err.eval_not_a_file": "不是普通文件",
27
+ "cli.err.inject_match_required": "inject add: 必须给 --match(glob 用 * 通配,如 \"*example.com*\";或用 \"re:<正则>\")",
28
+ "cli.err.inject_no_items": "inject add: 没有内容。至少给一个 --file <路径> 或 --text <代码>",
29
+ "cli.err.inject_file_outside": "inject add: 拒绝读取工作区 / 插件临时目录之外的 --file: {path}",
30
+ "cli.err.inject_file_too_large": "inject add: --file 超过单文件上限 {kb} KiB: {path}",
31
+ "cli.err.inject_rule_too_large": "inject add: 该规则的 items 合计超过上限 {kb} KiB: {path}",
32
+ "cli.err.inject_items_too_large": "inject add: 该规则的 items 合计超过上限 {kb} KiB(请拆成多条规则)",
33
+ "cli.err.inject_read_failed": "inject add: 读取 --file 失败: {path}: {msg}",
34
+ "cli.err.inject_id_required": "inject: remove / enable / disable 必须给 --id",
35
+ "cli.err.inject_url_required": "inject test: 必须给 --url",
36
+ "cli.err.inject_unknown_action": "inject: 未知子动作 \"{action}\"。可用 add / list / remove / clear / enable / disable / test",
37
+ "cli.err.type_text_required": "type: 必须提供非空的 --text(可直接给文本,或用 @file:<路径>)",
38
+ "cli.err.type_text_too_large": "type: 文本超过上限 {kb} KiB(请拆成多次 type 调用)",
39
+ "cli.err.type_file_outside": "type: 拒绝读取工作区 / 插件临时目录之外的 @file: {path}",
40
+ "cli.err.type_file_too_large": "type: @file 超过单文件上限 {kb} KiB: {path}",
41
+ "cli.err.type_file_total_too_large": "type: @file 合计超过上限 {kb} KiB: {path}",
42
+ "cli.err.type_read_failed": "type: 无法读取 @file: {path}: {msg}",
18
43
  "cli.failed": "命令 {cmd} 失败: {msg}",
19
44
  "cli.cmd.navigate": "导航浏览器到 URL",
20
45
  "cli.cmd.click": "点击页面元素;可选 --timeout ms(100~60000)限定本次等待上限,超时明确报错",
@@ -24,12 +49,15 @@ const zh = {
24
49
  "cli.cmd.hover": "悬停到元素;可选 --timeout ms(100~60000)限定本次等待上限,超时明确报错",
25
50
  "cli.cmd.drag": "拖拽元素到目标;可选 --timeout ms(100~60000)限定本次等待上限,超时明确报错",
26
51
  "cli.cmd.press_key": "按下键盘按键;可选 --timeout ms(100~60000)限定本次等待上限,超时明确报错",
52
+ "cli.cmd.type": "向当前焦点插入文本(不清空已有内容;xterm/终端/contenteditable 用这个,表单替换用 fill)。--selector 先聚焦该元素;--enter 插入后再回车;--text 支持 @file:<路径>(仅限工作区目录或插件临时目录,内容不进模型上下文);可选 --timeout ms(100~60000)限定本次等待上限",
27
53
  "cli.cmd.upload_file": "上传文件到输入框;可选 --timeout ms(100~60000)限定本次等待上限,超时明确报错",
28
54
  "cli.cmd.screenshot": "截取页面/元素截图(返回图片;--selector 会先滚动到元素再截取);可选 --timeout ms(100~60000)限定本次等待上限,超时明确报错",
29
- "cli.cmd.evaluate": "在页面执行 JS,返回结果;可选 --timeout ms(100~60000)限定本次等待上限,超时明确报错",
55
+ "cli.cmd.evaluate": "在页面执行 JS 并返回结果。按顺序逐项执行:@file:<路径> 读取脚本文件(仅限工作区目录或插件临时目录),其余为内联 JS;默认遇错即停,--continue-on-error 继续执行后续项。--script \"...\" 为单个脚本,不能与位置参数项同时使用;可选 --timeout ms(100~60000)限定每个脚本的等待上限",
56
+ "cli.cmd.inject": "持久注入规则:文档加载完成且当前标签 URL 命中时执行指定 JS。子动作:add --match <glob|re:...> [--file <路径>]... [--text <代码>]... [--order N] [--disabled](文件只允许工作区目录或插件临时目录,单条 ≤256 KiB;内容转成 text 发送,Rust 不接触路径);list;remove|enable|disable --id <id>;clear;test --url <url>(只算命中、不执行)。规则存于会话数据目录(sessions/<profile>/<sid>/inject/rules.json),最多 20 条、单条 ≤256 KiB,按 --order 升序执行;连续失败 3 次自动禁用",
30
57
  "cli.cmd.get_visible_text": "获取页面可见文本",
31
58
  "cli.cmd.get_visible_html": "获取页面 HTML 结构",
32
- "cli.cmd.console_logs": "获取浏览器控制台日志",
59
+ "cli.cmd.console_logs": "获取缓冲的控制台日志(--type、--group burst|none、--phase、--search、--limit、--tab、--include-internal、--clear;--no-dedupe 等价 --group=none;--tab N 取 list_tabs 打印的 0 基索引,即 --tab 0 是第一个标签);条目带 (xN)/phase/source,异常附 stack 首行;浏览器内部日志(violation/deprecation,如 [DOM] Password field)默认不显示,加 --include-internal 才显示",
60
+ "cli.cmd.network_logs": "获取缓冲的网络请求(--type、--status 2xx|3xx|4xx|5xx|N、--failed、--search、--group burst|key|none、--phase load|interactive|action:<cmd>、--limit、--tab(0 基索引)、--include-headers、--reveal-secrets、--clear;--no-dedupe 等价 --group=none;--tab N 取 list_tabs 打印的 0 基索引,即 --tab 0 是第一个标签)",
33
61
  "cli.cmd.go_back": "浏览器后退",
34
62
  "cli.cmd.go_forward": "浏览器前进",
35
63
  "cli.cmd.resize": "调整页面内容区尺寸(视口,非 OS 窗口;自动折算窗口高+工具栏 72px;下限 360×360,低于下限会被钳制)",
@@ -81,6 +109,9 @@ const zh = {
81
109
  "cli.out.hover": "已悬停",
82
110
  "cli.out.drag": "已拖拽",
83
111
  "cli.out.press_key": "已按键: {key}",
112
+ "cli.out.type": "已输入 {n} 个字符到 {target}",
113
+ "cli.out.type.focused": "当前焦点元素",
114
+ "cli.out.type.enter": " + Enter",
84
115
  "cli.out.upload_file": "已上传",
85
116
  "cli.out.screenshot": "截图完成{where}",
86
117
  "cli.out.screenshot.element": "(元素: {sel})",
@@ -88,7 +119,17 @@ const zh = {
88
119
  "cli.out.no_visible_text": "(无可见文本)",
89
120
  "cli.out.no_visible_html": "(无可见 HTML)",
90
121
  "cli.out.html_truncated": "…(已在 maxLength={n} 处截断)",
91
- "cli.out.no_logs": "(无日志)",
122
+ "cli.out.console_empty": "(无控制台日志——可能页面没有产生日志、页面已导航(日志按标签保留、跨导航不清空)、或日志在其它标签;可试 --tab 或 list_tabs)",
123
+ "cli.out.network_empty": "(无网络请求——可能页面没有发起请求、页面已导航、或请求在其它标签(也请确认是否刚用 --clear 清空);可试 --tab 或 list_tabs)",
124
+ // ---- 日志流格式化片段(技术标记两种语言保持一致) ----
125
+ "cli.out.inject_empty": "尚无注入规则。添加示例: inject add --match \"*host*\" --file hook.js",
126
+ "cli.out.inject_removed": "inject: 已删除 {id}(剩余 {n} 条)",
127
+ "cli.out.inject_enabled": "inject: 已启用 {id}(共 {n} 条)",
128
+ "cli.out.inject_disabled": "inject: 已禁用 {id}(共 {n} 条)",
129
+ "cli.out.inject_cleared": "inject: 已清空全部规则(用 `inject add` 新增)",
130
+ "cli.log.failed": "失败: {reason}",
131
+ "cli.log.failed_unknown": "请求失败",
132
+ "cli.log.dropped": "(缓冲上限丢弃 {n} 条)",
92
133
  "cli.out.go_back": "已后退,当前 URL: {url}",
93
134
  "cli.out.go_forward": "已前进,当前 URL: {url}",
94
135
  "cli.out.resize": "内容区已调整为 {w}x{h}",
@@ -159,14 +200,14 @@ const zh = {
159
200
  "bin.not_ready": "bt-shell 尚未就绪,请稍后重试",
160
201
  "bin.release_not_found": "未找到该版本对应的 Release 资产(tag={tag});若这是纯插件改动请确认二进制产物仍在 x.Y.0 的 Release 中,若动了 Rust 需先升中间版本号并新开/更新对应 Release",
161
202
  // ---- client 层抛给模型的错误 ----
162
- "client.service_timeout": "浏览器服务未就绪(超时)。bt-shell 由插件自动管理,请勿直接执行二进制文件;请稍后经 bt_cli 重试(如 open_window)。",
203
+ "client.service_timeout": "浏览器服务未就绪(超时)。bt-shell 由插件自动管理;请稍后经 bt_cli 重试(如 open_window)。",
163
204
  "client.attach_timeout": "外部 bt-shell 在 {url} 未就绪(超时)。请检查 BT_SHELL_URL/BT_SHELL_PORT,且 shell 正在运行。",
164
205
  "client.not_configured": "服务未配置",
165
206
  "client.service_error": "服务错误",
166
207
  "client.auth_rejected": "本地浏览器 API 拒绝鉴权(HTTP 401/403)。请调用 open_window 重新打开浏览器。",
167
208
  "client.bad_response": "浏览器服务返回了无法解析的响应(非 JSON)。未判定为已关闭,请重试该调用。",
168
209
  "client.bt_shell_path_missing": "BT_SHELL_PATH 指向的二进制不存在(路径见环境变量配置)",
169
- "client.spawn_failed": "bt-shell 进程启动失败(请稍后经 bt_cli 重试;勿直接执行二进制文件)",
210
+ "client.spawn_failed": "bt-shell 进程启动失败(请稍后经 bt_cli 重试)",
170
211
  "client.session_closed_during_start": "启动期间已收到关闭指令,该浏览器实例已终止。如需使用请调用 open_window。",
171
212
  "client.attach_gone": "附着的外部 bt-shell 在 {url} 已断开(附着模式不接管进程,请自行重启该 shell)。",
172
213
  "client.attach_need_token": "附着模式需要鉴权令牌:请设置环境变量 BT_SHELL_TOKEN,并让外部 bt-shell 用同一令牌启动(启动参数 --token <token>,或设置同值的 BT_SHELL_TOKEN)。",