@xiaoqiong0v0/opencode-ssh-tool 0.7.1 → 0.7.4
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/README.md +16 -12
- package/dist/agent.d.ts +4 -1
- package/dist/agent.d.ts.map +1 -1
- package/dist/agent.js.map +1 -1
- package/dist/base-session.d.ts +18 -2
- package/dist/base-session.d.ts.map +1 -1
- package/dist/base-session.js +20 -2
- package/dist/base-session.js.map +1 -1
- package/dist/constants.d.ts +14 -0
- package/dist/constants.d.ts.map +1 -1
- package/dist/constants.js +14 -0
- package/dist/constants.js.map +1 -1
- package/dist/i18n.d.ts +31 -19
- package/dist/i18n.d.ts.map +1 -1
- package/dist/i18n.js +31 -19
- package/dist/i18n.js.map +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +22 -7
- package/dist/index.js.map +1 -1
- package/dist/parse-check.d.ts +32 -0
- package/dist/parse-check.d.ts.map +1 -1
- package/dist/parse-check.js +45 -13
- package/dist/parse-check.js.map +1 -1
- package/dist/precheck.d.ts +22 -6
- package/dist/precheck.d.ts.map +1 -1
- package/dist/precheck.js +81 -6
- package/dist/precheck.js.map +1 -1
- package/dist/read-output.d.ts +12 -0
- package/dist/read-output.d.ts.map +1 -0
- package/dist/read-output.js +21 -0
- package/dist/read-output.js.map +1 -0
- package/dist/read-status.d.ts +16 -0
- package/dist/read-status.d.ts.map +1 -0
- package/dist/read-status.js +15 -0
- package/dist/read-status.js.map +1 -0
- package/dist/session.d.ts +50 -0
- package/dist/session.d.ts.map +1 -1
- package/dist/session.js +325 -1
- package/dist/session.js.map +1 -1
- package/dist/shell-adapter.d.ts.map +1 -1
- package/dist/shell-adapter.js +4 -2
- package/dist/shell-adapter.js.map +1 -1
- package/package.json +2 -2
package/dist/i18n.d.ts
CHANGED
|
@@ -46,8 +46,8 @@ export declare const T: {
|
|
|
46
46
|
readonly zh: "service 的 PATH 找不到可执行文件:{cmd}。请改用不含空格的全路径,或 \"powershell\"。";
|
|
47
47
|
};
|
|
48
48
|
readonly term_cli: {
|
|
49
|
-
readonly en: "Unified terminal CLI: SSH
|
|
50
|
-
readonly zh: "
|
|
49
|
+
readonly en: "Unified terminal CLI: SSH / local shell (wsl, pwsh, bash) / container (docker exec); use 'local' for local terminals instead of bash. Subcommands: connect / local / exec / read / send / upload / download / status / disconnect / help; use 'help' for usage. Long-running, stdin-reading or interactive commands: use the default submit, then status/read; never add -w. upload/download use SFTP and require an SSH session. Terminal sessions are scoped to this opencode session: restarting/ending opencode closes them; reconnect after restart. connect/local default to name 'default'; reusing a name closes the old terminal first (running command lost; failed connect does not restore it). Use exec on an existing terminal; use distinct -n names to keep terminals separate.";
|
|
50
|
+
readonly zh: "统一终端 CLI:SSH / 本地 shell(wsl、pwsh、bash)/ 容器(docker exec);本地终端用 'local',不要用 bash 直接跑。子命令:connect / local / exec / read / send / upload / download / status / disconnect / help;用 'help' 查看用法。长命令、需 stdin 或交互的命令:用默认提交后 status/read;禁止 -w。upload/download 走 SFTP,仅支持 SSH 会话。终端会话仅属于当前 opencode 会话,重启或退出 opencode 会关闭,需重新连接。connect/local 未传 -n 时名为 default;同名会先关闭旧终端(运行中命令丢失,新连接失败也不恢复)。已有终端用 exec;并行保留用不同 -n。";
|
|
51
51
|
};
|
|
52
52
|
readonly term_cli_args: {
|
|
53
53
|
readonly en: "Full command line string, e.g. 'local \"wsl bash\"' / 'exec \"ls -la\"' / 'connect user@host' / 'upload ./a.txt ~/a.txt'; defaults to 'help' when empty.";
|
|
@@ -56,6 +56,8 @@ export declare const T: {
|
|
|
56
56
|
readonly term_cli_help: {
|
|
57
57
|
readonly en: `term_cli unified CLI tool: manage SSH / local (wsl, pwsh, bash) / container (docker exec) terminal sessions.
|
|
58
58
|
Use 'local' for any terminal started on this machine (WSL, Docker containers, local shells).
|
|
59
|
+
Terminal sessions belong to the current opencode session; restarting or ending opencode closes them. Reconnect with connect/local; this is expected, not a crash.
|
|
60
|
+
-n defaults to "default". connect/local with an existing name closes that terminal before attempting the new connection; its running command is lost, and a failed new connection does not restore it. Use exec for more commands in an existing terminal; use distinct -n values to keep terminals separate.
|
|
59
61
|
|
|
60
62
|
Usage: term_cli <subcommand> [args]
|
|
61
63
|
|
|
@@ -68,11 +70,11 @@ Subcommands:
|
|
|
68
70
|
exec "<command>" [--base64 | --file <path>] [-n name] [-w]
|
|
69
71
|
run a command in the terminal (default: submit and return immediately without waiting for the result; -w waits until the command actually finishes — use it only for commands expected to finish quickly; NEVER use -w for long-running / stdin-reading / interactive / server / watch / tail -f / build / install / scan / REPL commands, because -w keeps waiting as long as the command runs and can hang indefinitely; use the default and poll with status/read)
|
|
70
72
|
read [-n name] [-s buffer|history] [-l limit] [--head] [--includeCommand]
|
|
71
|
-
read terminal output:
|
|
73
|
+
read terminal output: with no -s, a running command returns a current buffer snapshot (may be partial) and an idle terminal returns history; -s buffer reads the live buffer; -s history reads completed history. read never waits for completion: use status to wait, then read the final result
|
|
72
74
|
send "<text>" [--base64 | --file <path>] [-n name]
|
|
73
75
|
send text/keystrokes (\\xHH any hex byte, \\t Tab, \\r/\\n Enter, \\x03 Ctrl-C, \\x04 Ctrl-D, \\x1a Ctrl-Z, \\x1b Esc)
|
|
74
76
|
upload <local> <remote> [-n name] [--overwrite] [--mkdir]
|
|
75
|
-
upload a regular file from this machine
|
|
77
|
+
upload a regular file from this machine to the SSH session over SFTP
|
|
76
78
|
local supports ~; remote supports absolute or home-relative paths and ~/ (expanded by SFTP, no shell; ~user unsupported); Windows drive paths must use forward slashes (C:/dir/file)
|
|
77
79
|
fails if the target exists unless --overwrite; parents are not created unless --mkdir
|
|
78
80
|
SSH sessions only; directories and symlinks are rejected; max 256 MiB
|
|
@@ -86,8 +88,8 @@ Subcommands:
|
|
|
86
88
|
show this help
|
|
87
89
|
|
|
88
90
|
Payload input (exec / send):
|
|
89
|
-
--base64 decode base64 (whitespace ignored) to strict UTF-8 text; send sends it raw (no \\n / \\xHH decoding), exec
|
|
90
|
-
--file <path> read a LOCAL UTF-8 file on
|
|
91
|
+
--base64 decode base64 (whitespace ignored) to strict UTF-8 text; send sends it raw (no \\n / \\xHH decoding), exec executes it as a command
|
|
92
|
+
--file <path> read a LOCAL UTF-8 file on this machine (not remote); send sends it raw, exec executes it as a command; strips BOM, rejects NUL; ~ is expanded
|
|
91
93
|
-- end option parsing: exec -- "-x" / send -- "-n" (payload starting with "-")
|
|
92
94
|
For complex quotes or shell-specific escaping, prefer --base64 / --file over guessing outer quotes.
|
|
93
95
|
|
|
@@ -109,6 +111,8 @@ Examples:
|
|
|
109
111
|
`;
|
|
110
112
|
readonly zh: `term_cli 统一命令行工具:管理 SSH / 本地(wsl、pwsh、bash)/ 容器(docker exec)终端会话。
|
|
111
113
|
本机可启动的终端(WSL、Docker 容器、本地 shell)一律用 'local' 子命令。
|
|
114
|
+
终端会话绑定当前 opencode 会话;重启或退出 opencode 后旧终端会关闭,需重新 connect/local;这是正常生命周期,不是崩溃。
|
|
115
|
+
-n 默认 default;connect/local 遇到同名终端会先关闭旧终端再尝试新连接,其中正在运行的命令会丢失,新连接失败也不会恢复旧终端。已有终端继续执行命令请用 exec;需要并行保留请用不同的 -n。
|
|
112
116
|
|
|
113
117
|
用法: term_cli <子命令> [参数]
|
|
114
118
|
|
|
@@ -121,11 +125,11 @@ Examples:
|
|
|
121
125
|
exec "<command>" [--base64 | --file <path>] [-n name] [-w]
|
|
122
126
|
在指定终端执行命令(默认:提交后立即返回、不等结果;-w 等到命令真正结束 —— 只适用于预期很快结束的命令;**禁止**对长时间运行 / 需要 stdin / 交互 / server / watch / tail -f / 构建 / 安装 / 扫描 / REPL 命令加 -w:只要命令没结束 -w 就会一直等,可能永久阻塞;这些命令请用默认模式,再用 status/read 轮询)
|
|
123
127
|
read [-n name] [-s buffer|history] [-l limit] [--head] [--includeCommand]
|
|
124
|
-
|
|
128
|
+
读终端输出:不传 -s 时,命令运行中返回当前 buffer 快照(可能不完整),空闲时返回 history;-s buffer 读实时 buffer;-s history 读已完成历史。read 不等待命令完成:先用 status 等完成,再读最终结果
|
|
125
129
|
send "<text>" [--base64 | --file <path>] [-n name]
|
|
126
130
|
发送文本/按键(\\xHH 任意十六进制字节、\\t Tab、\\r/\\n 回车、\\x03 Ctrl-C、\\x04 Ctrl-D、\\x1a Ctrl-Z、\\x1b Esc)
|
|
127
131
|
upload <local> <remote> [-n name] [--overwrite] [--mkdir]
|
|
128
|
-
通过 SFTP
|
|
132
|
+
通过 SFTP 把本机普通文件上传到 SSH 会话
|
|
129
133
|
local 支持 ~;remote 支持绝对路径、相对 home 路径与 ~/(由 SFTP 展开,不经过 shell;不支持 ~user);Windows 盘符路径必须用正斜杠(C:/dir/file)
|
|
130
134
|
目标已存在默认失败,需加 --overwrite;默认不建父目录,需加 --mkdir
|
|
131
135
|
仅支持 SSH 会话;目录与符号链接会被拒绝;单文件上限 256 MiB
|
|
@@ -139,8 +143,8 @@ Examples:
|
|
|
139
143
|
显示本帮助
|
|
140
144
|
|
|
141
145
|
载荷输入(exec / send):
|
|
142
|
-
--base64 解码 base64(忽略空白)为严格 UTF-8 文本;send 原样发送(不再解释 \\n / \\xHH 等转义),exec
|
|
143
|
-
--file <path>
|
|
146
|
+
--base64 解码 base64(忽略空白)为严格 UTF-8 文本;send 原样发送(不再解释 \\n / \\xHH 等转义),exec 作为命令执行
|
|
147
|
+
--file <path> 读取本机的 UTF-8 文件(不是远程文件);send 原样发送,exec 作为命令执行;剥 BOM、拒绝 NUL;支持 ~ 展开
|
|
144
148
|
-- 终止选项解析:exec -- "-x" / send -- "-n"(载荷以 "-" 开头时)
|
|
145
149
|
复杂引号或目标 shell 专属转义,优先用 --base64 / --file,不要在外层引号里猜转义。
|
|
146
150
|
|
|
@@ -274,8 +278,8 @@ Examples:
|
|
|
274
278
|
readonly zh: "该 SSH 会话的 SFTP 不可用。请用 term_cli connect 重新连接后重试。";
|
|
275
279
|
};
|
|
276
280
|
readonly transfer_err_timeout: {
|
|
277
|
-
readonly en: "Transfer timed out ({seconds}s). The
|
|
278
|
-
readonly zh: "传输超时({seconds}s
|
|
281
|
+
readonly en: "Transfer timed out ({seconds}s). The transfer was aborted; the target file or a temporary file may be partially written.";
|
|
282
|
+
readonly zh: "传输超时({seconds}s)。传输已中止;目标文件或临时文件可能残留部分内容。";
|
|
279
283
|
};
|
|
280
284
|
readonly transfer_err_io: {
|
|
281
285
|
readonly en: "Transfer failed: {reason}";
|
|
@@ -323,7 +327,7 @@ Examples:
|
|
|
323
327
|
};
|
|
324
328
|
readonly st_pending: {
|
|
325
329
|
readonly en: "pending";
|
|
326
|
-
readonly zh: "
|
|
330
|
+
readonly zh: "待读";
|
|
327
331
|
};
|
|
328
332
|
readonly st_bytes: {
|
|
329
333
|
readonly en: "bytes";
|
|
@@ -366,8 +370,8 @@ Examples:
|
|
|
366
370
|
readonly zh: "危险命令,已拒绝执行。";
|
|
367
371
|
};
|
|
368
372
|
readonly not_connected: {
|
|
369
|
-
readonly en: "No active terminal.
|
|
370
|
-
readonly zh: "
|
|
373
|
+
readonly en: "No active terminal. Terminal sessions are tied to the current opencode session; after an opencode restart, reconnect with term_cli connect (SSH) or term_cli local.";
|
|
374
|
+
readonly zh: "无活动终端。终端会话绑定当前 opencode 会话;重启 opencode 后请重新用 term_cli connect(SSH)或 term_cli local 建立。";
|
|
371
375
|
};
|
|
372
376
|
readonly rejected_connect: {
|
|
373
377
|
readonly en: "Connection rejected.";
|
|
@@ -378,8 +382,8 @@ Examples:
|
|
|
378
382
|
readonly zh: "终端名非法。仅允许字母、数字、下划线、中划线、点(最多 64 字符),不得含路径分隔符。";
|
|
379
383
|
};
|
|
380
384
|
readonly no_sessions: {
|
|
381
|
-
readonly en: "No active terminals.";
|
|
382
|
-
readonly zh: "
|
|
385
|
+
readonly en: "No active terminals. Terminal sessions are tied to the current opencode session; after an opencode restart, reconnect with connect/local.";
|
|
386
|
+
readonly zh: "当前没有活动的终端会话。终端会话绑定当前 opencode 会话;重启 opencode 后请重新 connect/local。";
|
|
383
387
|
};
|
|
384
388
|
readonly connect_ok: {
|
|
385
389
|
readonly en: "Connected: {user}@{host}:{port} (session {sid}, terminal {name})";
|
|
@@ -429,6 +433,14 @@ Examples:
|
|
|
429
433
|
readonly en: "Terminal history (first {n} / total {total})";
|
|
430
434
|
readonly zh: "终端历史(前 {n} 条 / 共 {total} 条)";
|
|
431
435
|
};
|
|
436
|
+
readonly read_busy_buffer_notice: {
|
|
437
|
+
readonly en: "[read source=buffer busy=true]\nWarning: this is a partial buffer snapshot, not the final result; run status and wait for completion before reading the final result.";
|
|
438
|
+
readonly zh: "[read source=buffer busy=true]\n警告:这是 buffer 部分快照,不是最终结果;请先用 status 等待命令完成后再读取最终结果。";
|
|
439
|
+
};
|
|
440
|
+
readonly read_busy_history_notice: {
|
|
441
|
+
readonly en: "[read source=history busy=true]\nWarning: history only contains completed commands; it does not include the current result.";
|
|
442
|
+
readonly zh: "[read source=history busy=true]\n警告:history 只含已完成命令,不含当前结果。";
|
|
443
|
+
};
|
|
432
444
|
readonly web_title: {
|
|
433
445
|
readonly en: "Terminal Records";
|
|
434
446
|
readonly zh: "终端记录";
|
|
@@ -506,8 +518,8 @@ Examples:
|
|
|
506
518
|
readonly zh: "未删除:该终端仍在活动(状态文件尚未陈旧),可能属于其他正在运行的 opencode 实例。";
|
|
507
519
|
};
|
|
508
520
|
readonly web_delete_refused_active: {
|
|
509
|
-
readonly en: "Not deleted: terminal is
|
|
510
|
-
readonly zh: "
|
|
521
|
+
readonly en: "Not deleted: this terminal is still in use by another online instance.";
|
|
522
|
+
readonly zh: "未删除:该终端仍被其他在线实例占用。";
|
|
511
523
|
};
|
|
512
524
|
readonly web_delete_blocked: {
|
|
513
525
|
readonly en: "Cannot delete this terminal (still active or owned by another instance).";
|
package/dist/i18n.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"i18n.d.ts","sourceRoot":"","sources":["../src/i18n.ts"],"names":[],"mappings":"AAKA,MAAM,MAAM,IAAI,GAA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E,EAAE,EAAE,kCAAkC;;CAEhC,CAAA;AAEV,iBAAiB;AACjB,wBAAgB,EAAE,CAAC,GAAG,EAAE,OAAO,EAAE,IAAI,EAAE,IAAI,GAAG,MAAM,CAEnD"}
|
package/dist/i18n.js
CHANGED
|
@@ -59,8 +59,8 @@ export const T = {
|
|
|
59
59
|
zh: "service 的 PATH 找不到可执行文件:{cmd}。请改用不含空格的全路径,或 \"powershell\"。",
|
|
60
60
|
},
|
|
61
61
|
term_cli: {
|
|
62
|
-
en: "Unified terminal CLI: SSH
|
|
63
|
-
zh: "
|
|
62
|
+
en: "Unified terminal CLI: SSH / local shell (wsl, pwsh, bash) / container (docker exec); use 'local' for local terminals instead of bash. Subcommands: connect / local / exec / read / send / upload / download / status / disconnect / help; use 'help' for usage. Long-running, stdin-reading or interactive commands: use the default submit, then status/read; never add -w. upload/download use SFTP and require an SSH session. Terminal sessions are scoped to this opencode session: restarting/ending opencode closes them; reconnect after restart. connect/local default to name 'default'; reusing a name closes the old terminal first (running command lost; failed connect does not restore it). Use exec on an existing terminal; use distinct -n names to keep terminals separate.",
|
|
63
|
+
zh: "统一终端 CLI:SSH / 本地 shell(wsl、pwsh、bash)/ 容器(docker exec);本地终端用 'local',不要用 bash 直接跑。子命令:connect / local / exec / read / send / upload / download / status / disconnect / help;用 'help' 查看用法。长命令、需 stdin 或交互的命令:用默认提交后 status/read;禁止 -w。upload/download 走 SFTP,仅支持 SSH 会话。终端会话仅属于当前 opencode 会话,重启或退出 opencode 会关闭,需重新连接。connect/local 未传 -n 时名为 default;同名会先关闭旧终端(运行中命令丢失,新连接失败也不恢复)。已有终端用 exec;并行保留用不同 -n。",
|
|
64
64
|
},
|
|
65
65
|
term_cli_args: {
|
|
66
66
|
en: "Full command line string, e.g. 'local \"wsl bash\"' / 'exec \"ls -la\"' / 'connect user@host' / 'upload ./a.txt ~/a.txt'; defaults to 'help' when empty.",
|
|
@@ -69,6 +69,8 @@ export const T = {
|
|
|
69
69
|
term_cli_help: {
|
|
70
70
|
en: `term_cli unified CLI tool: manage SSH / local (wsl, pwsh, bash) / container (docker exec) terminal sessions.
|
|
71
71
|
Use 'local' for any terminal started on this machine (WSL, Docker containers, local shells).
|
|
72
|
+
Terminal sessions belong to the current opencode session; restarting or ending opencode closes them. Reconnect with connect/local; this is expected, not a crash.
|
|
73
|
+
-n defaults to "default". connect/local with an existing name closes that terminal before attempting the new connection; its running command is lost, and a failed new connection does not restore it. Use exec for more commands in an existing terminal; use distinct -n values to keep terminals separate.
|
|
72
74
|
|
|
73
75
|
Usage: term_cli <subcommand> [args]
|
|
74
76
|
|
|
@@ -81,11 +83,11 @@ Subcommands:
|
|
|
81
83
|
exec "<command>" [--base64 | --file <path>] [-n name] [-w]
|
|
82
84
|
run a command in the terminal (default: submit and return immediately without waiting for the result; -w waits until the command actually finishes — use it only for commands expected to finish quickly; NEVER use -w for long-running / stdin-reading / interactive / server / watch / tail -f / build / install / scan / REPL commands, because -w keeps waiting as long as the command runs and can hang indefinitely; use the default and poll with status/read)
|
|
83
85
|
read [-n name] [-s buffer|history] [-l limit] [--head] [--includeCommand]
|
|
84
|
-
read terminal output:
|
|
86
|
+
read terminal output: with no -s, a running command returns a current buffer snapshot (may be partial) and an idle terminal returns history; -s buffer reads the live buffer; -s history reads completed history. read never waits for completion: use status to wait, then read the final result
|
|
85
87
|
send "<text>" [--base64 | --file <path>] [-n name]
|
|
86
88
|
send text/keystrokes (\\xHH any hex byte, \\t Tab, \\r/\\n Enter, \\x03 Ctrl-C, \\x04 Ctrl-D, \\x1a Ctrl-Z, \\x1b Esc)
|
|
87
89
|
upload <local> <remote> [-n name] [--overwrite] [--mkdir]
|
|
88
|
-
upload a regular file from this machine
|
|
90
|
+
upload a regular file from this machine to the SSH session over SFTP
|
|
89
91
|
local supports ~; remote supports absolute or home-relative paths and ~/ (expanded by SFTP, no shell; ~user unsupported); Windows drive paths must use forward slashes (C:/dir/file)
|
|
90
92
|
fails if the target exists unless --overwrite; parents are not created unless --mkdir
|
|
91
93
|
SSH sessions only; directories and symlinks are rejected; max 256 MiB
|
|
@@ -99,8 +101,8 @@ Subcommands:
|
|
|
99
101
|
show this help
|
|
100
102
|
|
|
101
103
|
Payload input (exec / send):
|
|
102
|
-
--base64 decode base64 (whitespace ignored) to strict UTF-8 text; send sends it raw (no \\n / \\xHH decoding), exec
|
|
103
|
-
--file <path> read a LOCAL UTF-8 file on
|
|
104
|
+
--base64 decode base64 (whitespace ignored) to strict UTF-8 text; send sends it raw (no \\n / \\xHH decoding), exec executes it as a command
|
|
105
|
+
--file <path> read a LOCAL UTF-8 file on this machine (not remote); send sends it raw, exec executes it as a command; strips BOM, rejects NUL; ~ is expanded
|
|
104
106
|
-- end option parsing: exec -- "-x" / send -- "-n" (payload starting with "-")
|
|
105
107
|
For complex quotes or shell-specific escaping, prefer --base64 / --file over guessing outer quotes.
|
|
106
108
|
|
|
@@ -122,6 +124,8 @@ Examples:
|
|
|
122
124
|
`,
|
|
123
125
|
zh: `term_cli 统一命令行工具:管理 SSH / 本地(wsl、pwsh、bash)/ 容器(docker exec)终端会话。
|
|
124
126
|
本机可启动的终端(WSL、Docker 容器、本地 shell)一律用 'local' 子命令。
|
|
127
|
+
终端会话绑定当前 opencode 会话;重启或退出 opencode 后旧终端会关闭,需重新 connect/local;这是正常生命周期,不是崩溃。
|
|
128
|
+
-n 默认 default;connect/local 遇到同名终端会先关闭旧终端再尝试新连接,其中正在运行的命令会丢失,新连接失败也不会恢复旧终端。已有终端继续执行命令请用 exec;需要并行保留请用不同的 -n。
|
|
125
129
|
|
|
126
130
|
用法: term_cli <子命令> [参数]
|
|
127
131
|
|
|
@@ -134,11 +138,11 @@ Examples:
|
|
|
134
138
|
exec "<command>" [--base64 | --file <path>] [-n name] [-w]
|
|
135
139
|
在指定终端执行命令(默认:提交后立即返回、不等结果;-w 等到命令真正结束 —— 只适用于预期很快结束的命令;**禁止**对长时间运行 / 需要 stdin / 交互 / server / watch / tail -f / 构建 / 安装 / 扫描 / REPL 命令加 -w:只要命令没结束 -w 就会一直等,可能永久阻塞;这些命令请用默认模式,再用 status/read 轮询)
|
|
136
140
|
read [-n name] [-s buffer|history] [-l limit] [--head] [--includeCommand]
|
|
137
|
-
|
|
141
|
+
读终端输出:不传 -s 时,命令运行中返回当前 buffer 快照(可能不完整),空闲时返回 history;-s buffer 读实时 buffer;-s history 读已完成历史。read 不等待命令完成:先用 status 等完成,再读最终结果
|
|
138
142
|
send "<text>" [--base64 | --file <path>] [-n name]
|
|
139
143
|
发送文本/按键(\\xHH 任意十六进制字节、\\t Tab、\\r/\\n 回车、\\x03 Ctrl-C、\\x04 Ctrl-D、\\x1a Ctrl-Z、\\x1b Esc)
|
|
140
144
|
upload <local> <remote> [-n name] [--overwrite] [--mkdir]
|
|
141
|
-
通过 SFTP
|
|
145
|
+
通过 SFTP 把本机普通文件上传到 SSH 会话
|
|
142
146
|
local 支持 ~;remote 支持绝对路径、相对 home 路径与 ~/(由 SFTP 展开,不经过 shell;不支持 ~user);Windows 盘符路径必须用正斜杠(C:/dir/file)
|
|
143
147
|
目标已存在默认失败,需加 --overwrite;默认不建父目录,需加 --mkdir
|
|
144
148
|
仅支持 SSH 会话;目录与符号链接会被拒绝;单文件上限 256 MiB
|
|
@@ -152,8 +156,8 @@ Examples:
|
|
|
152
156
|
显示本帮助
|
|
153
157
|
|
|
154
158
|
载荷输入(exec / send):
|
|
155
|
-
--base64 解码 base64(忽略空白)为严格 UTF-8 文本;send 原样发送(不再解释 \\n / \\xHH 等转义),exec
|
|
156
|
-
--file <path>
|
|
159
|
+
--base64 解码 base64(忽略空白)为严格 UTF-8 文本;send 原样发送(不再解释 \\n / \\xHH 等转义),exec 作为命令执行
|
|
160
|
+
--file <path> 读取本机的 UTF-8 文件(不是远程文件);send 原样发送,exec 作为命令执行;剥 BOM、拒绝 NUL;支持 ~ 展开
|
|
157
161
|
-- 终止选项解析:exec -- "-x" / send -- "-n"(载荷以 "-" 开头时)
|
|
158
162
|
复杂引号或目标 shell 专属转义,优先用 --base64 / --file,不要在外层引号里猜转义。
|
|
159
163
|
|
|
@@ -287,8 +291,8 @@ Examples:
|
|
|
287
291
|
zh: "该 SSH 会话的 SFTP 不可用。请用 term_cli connect 重新连接后重试。",
|
|
288
292
|
},
|
|
289
293
|
transfer_err_timeout: {
|
|
290
|
-
en: "Transfer timed out ({seconds}s). The
|
|
291
|
-
zh: "传输超时({seconds}s
|
|
294
|
+
en: "Transfer timed out ({seconds}s). The transfer was aborted; the target file or a temporary file may be partially written.",
|
|
295
|
+
zh: "传输超时({seconds}s)。传输已中止;目标文件或临时文件可能残留部分内容。",
|
|
292
296
|
},
|
|
293
297
|
transfer_err_io: {
|
|
294
298
|
en: "Transfer failed: {reason}",
|
|
@@ -322,7 +326,7 @@ Examples:
|
|
|
322
326
|
st_type: { en: "type", zh: "类型" },
|
|
323
327
|
st_connected: { en: "connected", zh: "已连接" },
|
|
324
328
|
st_busy: { en: "busy", zh: "忙碌" },
|
|
325
|
-
st_pending: { en: "pending", zh: "
|
|
329
|
+
st_pending: { en: "pending", zh: "待读" },
|
|
326
330
|
st_bytes: { en: "bytes", zh: "字节" },
|
|
327
331
|
st_host: { en: "host", zh: "主机" },
|
|
328
332
|
st_program: { en: "program", zh: "程序" },
|
|
@@ -337,8 +341,8 @@ Examples:
|
|
|
337
341
|
zh: "危险命令,已拒绝执行。",
|
|
338
342
|
},
|
|
339
343
|
not_connected: {
|
|
340
|
-
en: "No active terminal.
|
|
341
|
-
zh: "
|
|
344
|
+
en: "No active terminal. Terminal sessions are tied to the current opencode session; after an opencode restart, reconnect with term_cli connect (SSH) or term_cli local.",
|
|
345
|
+
zh: "无活动终端。终端会话绑定当前 opencode 会话;重启 opencode 后请重新用 term_cli connect(SSH)或 term_cli local 建立。",
|
|
342
346
|
},
|
|
343
347
|
rejected_connect: {
|
|
344
348
|
en: "Connection rejected.",
|
|
@@ -349,8 +353,8 @@ Examples:
|
|
|
349
353
|
zh: "终端名非法。仅允许字母、数字、下划线、中划线、点(最多 64 字符),不得含路径分隔符。",
|
|
350
354
|
},
|
|
351
355
|
no_sessions: {
|
|
352
|
-
en: "No active terminals.",
|
|
353
|
-
zh: "
|
|
356
|
+
en: "No active terminals. Terminal sessions are tied to the current opencode session; after an opencode restart, reconnect with connect/local.",
|
|
357
|
+
zh: "当前没有活动的终端会话。终端会话绑定当前 opencode 会话;重启 opencode 后请重新 connect/local。",
|
|
354
358
|
},
|
|
355
359
|
connect_ok: {
|
|
356
360
|
en: "Connected: {user}@{host}:{port} (session {sid}, terminal {name})",
|
|
@@ -400,6 +404,14 @@ Examples:
|
|
|
400
404
|
en: "Terminal history (first {n} / total {total})",
|
|
401
405
|
zh: "终端历史(前 {n} 条 / 共 {total} 条)",
|
|
402
406
|
},
|
|
407
|
+
read_busy_buffer_notice: {
|
|
408
|
+
en: "[read source=buffer busy=true]\nWarning: this is a partial buffer snapshot, not the final result; run status and wait for completion before reading the final result.",
|
|
409
|
+
zh: "[read source=buffer busy=true]\n警告:这是 buffer 部分快照,不是最终结果;请先用 status 等待命令完成后再读取最终结果。",
|
|
410
|
+
},
|
|
411
|
+
read_busy_history_notice: {
|
|
412
|
+
en: "[read source=history busy=true]\nWarning: history only contains completed commands; it does not include the current result.",
|
|
413
|
+
zh: "[read source=history busy=true]\n警告:history 只含已完成命令,不含当前结果。",
|
|
414
|
+
},
|
|
403
415
|
web_title: { en: "Terminal Records", zh: "终端记录" },
|
|
404
416
|
web_close: { en: "Close", zh: "关闭" },
|
|
405
417
|
web_loading: { en: "Loading...", zh: "加载中..." },
|
|
@@ -423,8 +435,8 @@ Examples:
|
|
|
423
435
|
zh: "未删除:该终端仍在活动(状态文件尚未陈旧),可能属于其他正在运行的 opencode 实例。",
|
|
424
436
|
},
|
|
425
437
|
web_delete_refused_active: {
|
|
426
|
-
en: "Not deleted: terminal is
|
|
427
|
-
zh: "
|
|
438
|
+
en: "Not deleted: this terminal is still in use by another online instance.",
|
|
439
|
+
zh: "未删除:该终端仍被其他在线实例占用。",
|
|
428
440
|
},
|
|
429
441
|
web_delete_blocked: {
|
|
430
442
|
en: "Cannot delete this terminal (still active or owned by another instance).",
|
package/dist/i18n.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"i18n.js","sourceRoot":"","sources":["../src/i18n.ts"],"names":[],"mappings":"AAAA,+BAA+B;AAC/B,6DAA6D;AAE7D,OAAO,EAAE,QAAQ,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAA;AAOvD;;;;;GAKG;AACH,SAAS,QAAQ,CAAC,GAAuB,EAAE,UAAgB;IACzD,IAAI,GAAG,KAAK,IAAI,IAAI,GAAG,KAAK,IAAI;QAAE,OAAO,GAAG,CAAA;IAC5C,OAAO,UAAU,CAAA;AACnB,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,WAAW,CAAC,UAAU,GAAS,IAAI;IACjD,OAAO,QAAQ,CAAC,OAAO,CAAC,GAAG,CAAC,QAAQ,CAAC,EAAE,UAAU,CAAC,CAAA;AACpD,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,UAAU,CAAC,UAAU,GAAS,IAAI;IAChD,OAAO,QAAQ,CAAC,OAAO,CAAC,GAAG,CAAC,YAAY,CAAC,EAAE,UAAU,CAAC,CAAA;AACxD,CAAC;AAED,kBAAkB;AAClB,MAAM,CAAC,MAAM,CAAC,GAAG;IACf,SAAS,EAAE;QACT,EAAE,EAAE,0LAA0L;QAC9L,EAAE,EAAE,6EAA6E;KAClF;IACD,OAAO,EAAE;QACP,EAAE,EAAE,cAAc;QAClB,EAAE,EAAE,YAAY;KACjB;IACD,cAAc,EAAE;QACd,EAAE,EAAE,iDAAiD;QACrD,EAAE,EAAE,iCAAiC;KACtC;IACD,gBAAgB,EAAE;QAChB,EAAE,EAAE,kCAAkC;QACtC,EAAE,EAAE,sBAAsB;KAC3B;IACD,wBAAwB,EAAE;QACxB,EAAE,EAAE,6BAA6B;QACjC,EAAE,EAAE,UAAU;KACf;IACD,iBAAiB,EAA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AAW;KAChB;IACD,cAAc,EAAE;QACd,EAAE,EAAE,gEAAgE;QACpE,EAAE,EAAE,kDAAkD;KACvD;IACD,aAAa,EAAE;QACb,EAAE,EAAE,eAAe;QACnB,EAAE,EAAE,YAAY;KACjB;IACD,mBAAmB,EAAE;QACnB,EAAE,EAAE,wEAAwE;QAC5E,EAAE,EAAE,kCAAkC;KACvC;CACO,CAAA;AAEV,iBAAiB;AACjB,MAAM,UAAU,EAAE,CAAC,GAAY,EAAE,IAAU;IACzC,OAAO,CAAC,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,CAAA;AACrB,CAAC"}
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAEA,OAAO,EAAQ,KAAK,MAAM,EAAE,MAAM,qBAAqB,CAAA;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAEA,OAAO,EAAQ,KAAK,MAAM,EAAE,MAAM,qBAAqB,CAAA;AAyRvD,eAAO,MAAM,eAAe,EAAE,MA2oB7B,CAAA;eAGc,eAAe"}
|
package/dist/index.js
CHANGED
|
@@ -22,6 +22,7 @@ import { ensureServer } from "./server-manager.js";
|
|
|
22
22
|
import { startAgent } from "./agent.js";
|
|
23
23
|
import { writeSessionState, removeSessionState, removeAllSessionStates, writeSessionMeta } from "./session-store.js";
|
|
24
24
|
import { precheckBeforeExec } from "./precheck.js";
|
|
25
|
+
import { readBusyNotice } from "./read-output.js";
|
|
25
26
|
/** 默认终端名(不传 name 时用) */
|
|
26
27
|
const DEFAULT_NAME = "default";
|
|
27
28
|
/** 终端名合法字符(字母/数字/下划线/中划线/点),防止路径穿越 */
|
|
@@ -470,8 +471,8 @@ export const OpenCodeSshTool = async () => {
|
|
|
470
471
|
const session = resolveSession(ctx.sessionID, values.name);
|
|
471
472
|
if (!session)
|
|
472
473
|
return tr("not_connected", toolLang);
|
|
473
|
-
//
|
|
474
|
-
//
|
|
474
|
+
// 发送前语法预检:本地走 parse-check,SSH 远程走独立 exec channel;命中语法错误即拦下
|
|
475
|
+
// (不写终端、不进权限询问);不支持的 shell / 通道异常 / 超时 → 内部一律放行(fail-open)
|
|
475
476
|
const rejection = await precheckBeforeExec(session, command, undefined, toolLang);
|
|
476
477
|
if (rejection) {
|
|
477
478
|
log.tool("term_exec_precheck_rejected", {
|
|
@@ -515,17 +516,31 @@ export const OpenCodeSshTool = async () => {
|
|
|
515
516
|
return tr("submitted", toolLang);
|
|
516
517
|
return result.ok ? result.output : result.error ?? tr("exec_failed", toolLang);
|
|
517
518
|
}
|
|
518
|
-
/** read
|
|
519
|
+
/** read:读取终端输出(未显式 -s 时,运行中读只读快照、空闲读 history) */
|
|
519
520
|
async function doRead(args, ctx) {
|
|
520
521
|
const { values } = parseArgs({ args, options: { name: { type: "string", short: "n" }, source: { type: "string", short: "s" }, limit: { type: "string", short: "l" }, head: { type: "boolean" }, includeCommand: { type: "boolean" } }, allowPositionals: true });
|
|
521
522
|
const session = resolveSession(ctx.sessionID, values.name);
|
|
522
523
|
if (!session)
|
|
523
524
|
return tr("not_connected", toolLang);
|
|
524
|
-
|
|
525
|
+
// 显式 -s 非 buffer 的值仍按旧的 history 分支处理(不因 busy 改走快照)
|
|
526
|
+
const explicitSource = values.source === undefined ? undefined : values.source === "buffer" ? "buffer" : "history";
|
|
527
|
+
const busy = session.getStatus().busy === true;
|
|
528
|
+
// 未显式指定来源:运行中给 buffer 只读快照(不消费、不代表最终结果),空闲保持旧的 history 默认
|
|
529
|
+
const source = explicitSource ?? (busy ? "buffer" : "history");
|
|
525
530
|
if (source === "buffer") {
|
|
526
|
-
|
|
527
|
-
|
|
531
|
+
if (explicitSource === "buffer") {
|
|
532
|
+
// 显式 -s buffer 保持旧语义:readBuffer 会消费缓冲,命中完成标记时完成命令(写 history/done/busy)
|
|
533
|
+
const r = await session.readBuffer();
|
|
534
|
+
// 完成标记已收尾时不再提示"部分快照";仍在运行才提示(读取前后都可能变化,按调用后状态为准)
|
|
535
|
+
return readBusyNotice("buffer", session.getStatus().busy === true, toolLang) + r.output;
|
|
536
|
+
}
|
|
537
|
+
// 未显式指定:只读快照,绝不消费;绝不调用 _completeRunning
|
|
538
|
+
const r = await session.peekBuffer();
|
|
539
|
+
if (!r.ok)
|
|
540
|
+
return r.error ?? "";
|
|
541
|
+
return readBusyNotice("buffer", busy, toolLang) + r.output;
|
|
528
542
|
}
|
|
543
|
+
const notice = readBusyNotice("history", busy, toolLang);
|
|
529
544
|
const history = session.getHistory();
|
|
530
545
|
const all = history.getPairs();
|
|
531
546
|
const limit = Math.max(1, parseInt(values.limit ?? "10", 10) || 10);
|
|
@@ -539,7 +554,7 @@ export const OpenCodeSshTool = async () => {
|
|
|
539
554
|
const text = parts.join("\n");
|
|
540
555
|
const url = await resolveHttpUrl();
|
|
541
556
|
const browserLine = url ? tr("browser_full_record", toolLang).replace("{url}", url) : tr(httpUnavailableKey(), toolLang);
|
|
542
|
-
return `${tr(direction === "tail" ? "history_title" : "history_title_head", toolLang).replace("{n}", String(selected.length)).replace("{total}", String(all.length))}\n${text}${browserLine}`;
|
|
557
|
+
return `${notice}${tr(direction === "tail" ? "history_title" : "history_title_head", toolLang).replace("{n}", String(selected.length)).replace("{total}", String(all.length))}\n${text}${browserLine}`;
|
|
543
558
|
}
|
|
544
559
|
/** send:发送文本/按键到终端 */
|
|
545
560
|
async function doSend(args, ctx) {
|