@xiaoqiong0v0/opencode-ssh-tool 0.2.7 → 0.3.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/README.md +21 -18
- package/dist/constants.d.ts.map +1 -1
- package/dist/constants.js +1 -1
- package/dist/constants.js.map +1 -1
- package/dist/i18n.d.ts +60 -30
- package/dist/i18n.d.ts.map +1 -1
- package/dist/i18n.js +60 -30
- package/dist/i18n.js.map +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +164 -59
- package/dist/index.js.map +1 -1
- package/dist/local-session.d.ts +117 -0
- package/dist/local-session.d.ts.map +1 -0
- package/dist/local-session.js +365 -0
- package/dist/local-session.js.map +1 -0
- package/dist/server.d.ts.map +1 -1
- package/dist/server.js +73 -34
- package/dist/server.js.map +1 -1
- package/dist/session-store.d.ts +4 -0
- package/dist/session-store.d.ts.map +1 -1
- package/dist/session-store.js.map +1 -1
- package/dist/utils.d.ts +7 -0
- package/dist/utils.d.ts.map +1 -1
- package/dist/utils.js +13 -1
- package/dist/utils.js.map +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1,365 @@
|
|
|
1
|
+
// LocalSession:基于 Bun.Terminal 的本地/容器 PTY 会话(本地 shell、docker exec -it 等),
|
|
2
|
+
// 哨兵法执行逻辑与 SshSession 一致(复用 utils 工具函数),支持交互(sudo 密码/确认/中断)
|
|
3
|
+
import createLogger from "@xiaoqiong0v0/opencode-plugin-logger";
|
|
4
|
+
import { ANIMATION_WINDOW_MS, EXEC_TIMEOUT_MS, MAX_OUTPUT_LEN, PTY_COLS, PTY_ROWS, QUIET_WINDOW_MS, } from "./constants.js";
|
|
5
|
+
import { SessionHistory } from "./history.js";
|
|
6
|
+
import { cleanAnsi, collapseCarriage, genSentinel, stripEcho, stripPrompt } from "./utils.js";
|
|
7
|
+
const log = createLogger("opencode-ssh-tool");
|
|
8
|
+
/** 交互触发词(sudo 密码 / 分页器 / 确认提示),含中英文 */
|
|
9
|
+
const INTERACTIVE_RE = /(\[sudo\] password for|password for \S+:|Password:|密码:|--More--|\(END\)|\[y\/N\]|\[Y\/n\]|yes\/no|是\/否)/i;
|
|
10
|
+
/**
|
|
11
|
+
* 命令行字符串拆分为参数数组(Bun.spawn 要求数组形式;支持双/单引号分组)
|
|
12
|
+
* @param cmd 命令行字符串,如 "docker exec -it myctr bash"
|
|
13
|
+
* @returns 参数数组
|
|
14
|
+
*/
|
|
15
|
+
function splitCommand(cmd) {
|
|
16
|
+
const args = [];
|
|
17
|
+
const re = /"([^"]*)"|'([^']*)'|(\S+)/g;
|
|
18
|
+
let m;
|
|
19
|
+
while ((m = re.exec(cmd)))
|
|
20
|
+
args.push(m[1] ?? m[2] ?? m[3]);
|
|
21
|
+
return args;
|
|
22
|
+
}
|
|
23
|
+
/** buffer 最大长度(未消费输出超限时截断头部,防内存膨胀) */
|
|
24
|
+
const MAX_BUFFER_LEN = 2 * 1024 * 1024;
|
|
25
|
+
/** 后台哨兵监听最长存活时间(防泄漏) */
|
|
26
|
+
const MAX_WATCH_LEN = 10 * 60_000;
|
|
27
|
+
export class LocalSession {
|
|
28
|
+
sessionID;
|
|
29
|
+
name;
|
|
30
|
+
_term = null;
|
|
31
|
+
_proc = null;
|
|
32
|
+
_connected = false;
|
|
33
|
+
_remoteBusy = false;
|
|
34
|
+
_buffer = "";
|
|
35
|
+
_program = "";
|
|
36
|
+
_connectedAt = 0;
|
|
37
|
+
_lastActive = 0;
|
|
38
|
+
_runningStartPos = null;
|
|
39
|
+
_runningSentinel = "";
|
|
40
|
+
_runningCommand = "";
|
|
41
|
+
_watchTimer = null;
|
|
42
|
+
_closed = false;
|
|
43
|
+
_history;
|
|
44
|
+
constructor(sessionID, history, name = "default") {
|
|
45
|
+
this.sessionID = sessionID;
|
|
46
|
+
this.name = name;
|
|
47
|
+
this._history = history;
|
|
48
|
+
}
|
|
49
|
+
/**
|
|
50
|
+
* 启动本地/容器 PTY 终端(复用哨兵法执行架构)
|
|
51
|
+
* @param opts 命令(如 "pwsh" / "docker exec -it <容器> bash")与工作目录
|
|
52
|
+
* @returns 是否启动成功
|
|
53
|
+
*/
|
|
54
|
+
async connect(opts) {
|
|
55
|
+
try {
|
|
56
|
+
const term = new Bun.Terminal({
|
|
57
|
+
cols: PTY_COLS,
|
|
58
|
+
rows: PTY_ROWS,
|
|
59
|
+
name: "xterm-256color",
|
|
60
|
+
data: (_t, d) => this._appendBuffer(new TextDecoder().decode(d)),
|
|
61
|
+
exit: () => {
|
|
62
|
+
this._connected = false;
|
|
63
|
+
this._remoteBusy = false;
|
|
64
|
+
},
|
|
65
|
+
});
|
|
66
|
+
const proc = Bun.spawn(splitCommand(opts.command), { terminal: term, cwd: opts.cwd });
|
|
67
|
+
this._term = term;
|
|
68
|
+
this._proc = proc;
|
|
69
|
+
this._program = opts.command;
|
|
70
|
+
this._connected = true;
|
|
71
|
+
this._connectedAt = Date.now();
|
|
72
|
+
this._lastActive = Date.now();
|
|
73
|
+
// 等待初始 banner/提示符稳定后清空 buffer(不算业务输出)
|
|
74
|
+
await new Promise((r) => setTimeout(r, 400));
|
|
75
|
+
this._buffer = "";
|
|
76
|
+
this._runningStartPos = null;
|
|
77
|
+
this._runningSentinel = "";
|
|
78
|
+
log.info(`本地终端启动 ${opts.command} (session ${this.sessionID}, term ${this.name})`);
|
|
79
|
+
return { ok: true };
|
|
80
|
+
}
|
|
81
|
+
catch (e) {
|
|
82
|
+
const msg = e instanceof Error ? e.message : String(e);
|
|
83
|
+
log.error(`本地终端启动失败 ${opts.command}`, msg);
|
|
84
|
+
this.close();
|
|
85
|
+
return { ok: false, error: msg };
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
/**
|
|
89
|
+
* 异步提交命令:立即返回,命令后台执行,输出由后台监听收集进 history
|
|
90
|
+
* @param command 命令
|
|
91
|
+
* @returns 提交结果(立即返回,不等待命令完成)
|
|
92
|
+
*/
|
|
93
|
+
async submit(command) {
|
|
94
|
+
const startTs = Date.now();
|
|
95
|
+
if (!this._connected || !this._term)
|
|
96
|
+
return { ok: false, output: "", error: "Not connected" };
|
|
97
|
+
if (this._remoteBusy)
|
|
98
|
+
return { ok: false, output: "", error: "Previous command still running, poll with local_status first" };
|
|
99
|
+
const sentinel = genSentinel();
|
|
100
|
+
const combo = `${command}; echo ${sentinel}`;
|
|
101
|
+
const startPos = this._buffer.length;
|
|
102
|
+
this._runningStartPos = startPos;
|
|
103
|
+
this._runningSentinel = sentinel;
|
|
104
|
+
this._runningCommand = command;
|
|
105
|
+
this._remoteBusy = true;
|
|
106
|
+
this._lastActive = startTs;
|
|
107
|
+
this._term.write(combo + "\r");
|
|
108
|
+
this._startBackgroundWatch(sentinel, startPos, command);
|
|
109
|
+
return { ok: true, output: "", submitted: true, command, duration: 0 };
|
|
110
|
+
}
|
|
111
|
+
/**
|
|
112
|
+
* 在当前终端执行命令(哨兵法,同步等待),保留 cwd/环境
|
|
113
|
+
* @param command 命令
|
|
114
|
+
* @param timeout 超时毫秒,默认 30s
|
|
115
|
+
* @returns 执行结果
|
|
116
|
+
*/
|
|
117
|
+
async exec(command, timeout = EXEC_TIMEOUT_MS) {
|
|
118
|
+
const startTs = Date.now();
|
|
119
|
+
if (!this._connected || !this._term)
|
|
120
|
+
return { ok: false, output: "", error: "Not connected" };
|
|
121
|
+
if (this._remoteBusy)
|
|
122
|
+
return { ok: false, output: "", error: "Previous command still running, poll with local_status first" };
|
|
123
|
+
const sentinel = genSentinel();
|
|
124
|
+
const combo = `${command}; echo ${sentinel}`;
|
|
125
|
+
const startPos = this._buffer.length;
|
|
126
|
+
this._remoteBusy = true;
|
|
127
|
+
this._lastActive = startTs;
|
|
128
|
+
this._term.write(combo + "\r");
|
|
129
|
+
const outcome = await this._waitSentinel(sentinel, startPos, timeout, startTs);
|
|
130
|
+
switch (outcome.kind) {
|
|
131
|
+
case "done": {
|
|
132
|
+
this._remoteBusy = false;
|
|
133
|
+
const out = stripEcho(collapseCarriage(this._buffer.slice(startPos, outcome.idx)), combo);
|
|
134
|
+
this._buffer = this._buffer.slice(outcome.afterNewline);
|
|
135
|
+
this._history.append(command, out);
|
|
136
|
+
return { ok: true, output: this._truncate(cleanAnsi(out)), command, duration: Date.now() - startTs };
|
|
137
|
+
}
|
|
138
|
+
case "interactive": {
|
|
139
|
+
this._remoteBusy = false;
|
|
140
|
+
const out = collapseCarriage(this._buffer.slice(startPos));
|
|
141
|
+
this._history.append(command, out);
|
|
142
|
+
return { ok: true, output: this._truncate(cleanAnsi(out)), interactive: true, command, duration: Date.now() - startTs };
|
|
143
|
+
}
|
|
144
|
+
case "running":
|
|
145
|
+
case "timeout": {
|
|
146
|
+
this._runningStartPos = startPos;
|
|
147
|
+
this._runningSentinel = sentinel;
|
|
148
|
+
this._runningCommand = command;
|
|
149
|
+
this._remoteBusy = true;
|
|
150
|
+
this._startBackgroundWatch(sentinel, startPos, command);
|
|
151
|
+
const out = stripEcho(collapseCarriage(this._buffer.slice(startPos)), combo);
|
|
152
|
+
this._history.append(command, out);
|
|
153
|
+
return {
|
|
154
|
+
ok: true,
|
|
155
|
+
output: this._truncate(cleanAnsi(out)),
|
|
156
|
+
running: outcome.kind === "running",
|
|
157
|
+
timeout: outcome.kind === "timeout",
|
|
158
|
+
command,
|
|
159
|
+
duration: Date.now() - startTs,
|
|
160
|
+
};
|
|
161
|
+
}
|
|
162
|
+
}
|
|
163
|
+
}
|
|
164
|
+
/**
|
|
165
|
+
* 读取并清空未消费缓冲(交互/轮询场景)
|
|
166
|
+
* @returns 未消费输出
|
|
167
|
+
*/
|
|
168
|
+
async readBuffer() {
|
|
169
|
+
if (!this._connected)
|
|
170
|
+
return { ok: false, output: "", error: "Not connected" };
|
|
171
|
+
let out;
|
|
172
|
+
if (this._runningStartPos !== null) {
|
|
173
|
+
const idx = this._findSentinel(this._runningSentinel, this._runningStartPos);
|
|
174
|
+
if (idx >= 0) {
|
|
175
|
+
out = this._buffer.slice(this._runningStartPos, idx);
|
|
176
|
+
this._buffer = this._buffer.slice(idx);
|
|
177
|
+
this._clearRunningContext();
|
|
178
|
+
}
|
|
179
|
+
else {
|
|
180
|
+
out = this._buffer.slice(this._runningStartPos);
|
|
181
|
+
}
|
|
182
|
+
}
|
|
183
|
+
else {
|
|
184
|
+
out = this._buffer;
|
|
185
|
+
this._buffer = "";
|
|
186
|
+
}
|
|
187
|
+
return { ok: true, output: this._truncate(stripPrompt(cleanAnsi(collapseCarriage(out)))) };
|
|
188
|
+
}
|
|
189
|
+
/**
|
|
190
|
+
* 发送文本/按键到终端(交互场景:sudo 密码、确认、中断等)
|
|
191
|
+
* 转义序列:\r 或 \n = 回车,\x03 = Ctrl-C,\x04 = Ctrl-D,\x1a = Ctrl-Z,\x1b = ESC
|
|
192
|
+
* @param text 要发送的文本或按键序列
|
|
193
|
+
* @returns 是否发送成功
|
|
194
|
+
*/
|
|
195
|
+
send(text) {
|
|
196
|
+
if (!this._connected || !this._term)
|
|
197
|
+
return { ok: false, error: "Not connected" };
|
|
198
|
+
const payload = text
|
|
199
|
+
.replace(/\\x1b/gi, "\x1b")
|
|
200
|
+
.replace(/\\x03/gi, "\x03")
|
|
201
|
+
.replace(/\\x04/gi, "\x04")
|
|
202
|
+
.replace(/\\x1a/gi, "\x1a")
|
|
203
|
+
.replace(/\\r/g, "\r")
|
|
204
|
+
.replace(/\\n/g, "\r");
|
|
205
|
+
this._term.write(payload);
|
|
206
|
+
this._lastActive = Date.now();
|
|
207
|
+
return { ok: true };
|
|
208
|
+
}
|
|
209
|
+
/**
|
|
210
|
+
* 获取会话状态
|
|
211
|
+
* @returns 状态对象
|
|
212
|
+
*/
|
|
213
|
+
getStatus() {
|
|
214
|
+
return {
|
|
215
|
+
connected: this._connected,
|
|
216
|
+
busy: this._connected && this._remoteBusy,
|
|
217
|
+
pending: this._buffer.length,
|
|
218
|
+
name: this.name,
|
|
219
|
+
program: this._program,
|
|
220
|
+
lastActive: this._lastActive,
|
|
221
|
+
connectedAt: this._connectedAt,
|
|
222
|
+
};
|
|
223
|
+
}
|
|
224
|
+
/**
|
|
225
|
+
* 获取消息对记录(供渲染/落盘)
|
|
226
|
+
* @returns 消息对存储
|
|
227
|
+
*/
|
|
228
|
+
getHistory() {
|
|
229
|
+
return this._history;
|
|
230
|
+
}
|
|
231
|
+
/**
|
|
232
|
+
* 获取当前运行中命令的实时缓冲(合并覆盖后,不消费 buffer,保留 ANSI)
|
|
233
|
+
* @returns 运行中命令的当前进度文本;无运行命令则返回空串
|
|
234
|
+
*/
|
|
235
|
+
getRunningOutput() {
|
|
236
|
+
if (this._runningStartPos === null || !this._connected || !this._runningCommand)
|
|
237
|
+
return "";
|
|
238
|
+
const combo = `${this._runningCommand}; echo ${this._runningSentinel}`;
|
|
239
|
+
const raw = this._buffer.slice(this._runningStartPos);
|
|
240
|
+
return stripEcho(collapseCarriage(raw), combo).trim();
|
|
241
|
+
}
|
|
242
|
+
/**
|
|
243
|
+
* 关闭终端,清理会话态(幂等)
|
|
244
|
+
*/
|
|
245
|
+
close() {
|
|
246
|
+
if (this._closed)
|
|
247
|
+
return;
|
|
248
|
+
this._closed = true;
|
|
249
|
+
if (this._watchTimer)
|
|
250
|
+
clearInterval(this._watchTimer);
|
|
251
|
+
try {
|
|
252
|
+
this._term?.close();
|
|
253
|
+
}
|
|
254
|
+
catch {
|
|
255
|
+
/* 忽略 */
|
|
256
|
+
}
|
|
257
|
+
try {
|
|
258
|
+
this._proc?.kill();
|
|
259
|
+
}
|
|
260
|
+
catch {
|
|
261
|
+
/* 忽略 */
|
|
262
|
+
}
|
|
263
|
+
this._connected = false;
|
|
264
|
+
this._remoteBusy = false;
|
|
265
|
+
this._history.dispose();
|
|
266
|
+
log.hook("local_disconnect", `关闭本地终端 ${this._program}`);
|
|
267
|
+
}
|
|
268
|
+
/** 追加输出到未消费 buffer,超限时截断头部(保留尾部)并修正运行索引 */
|
|
269
|
+
_appendBuffer(text) {
|
|
270
|
+
this._buffer += text;
|
|
271
|
+
if (this._buffer.length > MAX_BUFFER_LEN) {
|
|
272
|
+
const trimmed = this._buffer.length - MAX_BUFFER_LEN;
|
|
273
|
+
this._buffer = this._buffer.slice(trimmed);
|
|
274
|
+
if (this._runningStartPos !== null) {
|
|
275
|
+
this._runningStartPos = Math.max(0, this._runningStartPos - trimmed);
|
|
276
|
+
}
|
|
277
|
+
}
|
|
278
|
+
}
|
|
279
|
+
_waitSentinel(sentinel, startPos, timeout, startTs) {
|
|
280
|
+
return new Promise((resolve) => {
|
|
281
|
+
let lastLen = this._buffer.length;
|
|
282
|
+
let lastChange = Date.now();
|
|
283
|
+
const timer = setInterval(() => {
|
|
284
|
+
const idx = this._findSentinel(sentinel, startPos);
|
|
285
|
+
if (idx >= 0) {
|
|
286
|
+
clearInterval(timer);
|
|
287
|
+
const nl = this._buffer.indexOf("\n", idx);
|
|
288
|
+
resolve({ kind: "done", idx, afterNewline: nl >= 0 ? nl + 1 : idx + sentinel.length });
|
|
289
|
+
return;
|
|
290
|
+
}
|
|
291
|
+
if (INTERACTIVE_RE.test(this._buffer.slice(startPos))) {
|
|
292
|
+
clearInterval(timer);
|
|
293
|
+
resolve({ kind: "interactive" });
|
|
294
|
+
return;
|
|
295
|
+
}
|
|
296
|
+
const now = Date.now();
|
|
297
|
+
const curLen = this._buffer.length;
|
|
298
|
+
if (curLen !== lastLen) {
|
|
299
|
+
lastLen = curLen;
|
|
300
|
+
lastChange = now;
|
|
301
|
+
}
|
|
302
|
+
if (now - lastChange < QUIET_WINDOW_MS && now - startTs >= ANIMATION_WINDOW_MS) {
|
|
303
|
+
clearInterval(timer);
|
|
304
|
+
resolve({ kind: "running" });
|
|
305
|
+
return;
|
|
306
|
+
}
|
|
307
|
+
if (now - startTs >= timeout) {
|
|
308
|
+
clearInterval(timer);
|
|
309
|
+
resolve({ kind: "timeout" });
|
|
310
|
+
return;
|
|
311
|
+
}
|
|
312
|
+
}, 50);
|
|
313
|
+
});
|
|
314
|
+
}
|
|
315
|
+
/** 后台哨兵监听:轮询到哨兵 → 收集输出进 history + busy=false */
|
|
316
|
+
_startBackgroundWatch(sentinel, startPos, command) {
|
|
317
|
+
if (this._watchTimer)
|
|
318
|
+
clearInterval(this._watchTimer);
|
|
319
|
+
const born = Date.now();
|
|
320
|
+
this._watchTimer = setInterval(() => {
|
|
321
|
+
if (!this._connected || Date.now() - born > MAX_WATCH_LEN) {
|
|
322
|
+
this._remoteBusy = false;
|
|
323
|
+
this._clearRunningContext();
|
|
324
|
+
if (this._watchTimer)
|
|
325
|
+
clearInterval(this._watchTimer);
|
|
326
|
+
return;
|
|
327
|
+
}
|
|
328
|
+
const idx = this._findSentinel(sentinel, startPos);
|
|
329
|
+
if (idx >= 0) {
|
|
330
|
+
const combo = `${command}; echo ${sentinel}`;
|
|
331
|
+
const out = stripEcho(collapseCarriage(this._buffer.slice(startPos, idx)), combo);
|
|
332
|
+
this._history.append(command, out);
|
|
333
|
+
const nl = this._buffer.indexOf("\n", idx);
|
|
334
|
+
this._buffer = this._buffer.slice(nl >= 0 ? nl + 1 : idx + sentinel.length);
|
|
335
|
+
this._remoteBusy = false;
|
|
336
|
+
this._clearRunningContext();
|
|
337
|
+
if (this._watchTimer)
|
|
338
|
+
clearInterval(this._watchTimer);
|
|
339
|
+
}
|
|
340
|
+
}, 200);
|
|
341
|
+
}
|
|
342
|
+
/** 在缓冲中定位哨兵行起始位置(哨兵串开头,容忍行前 ANSI bracketed-paste 序列) */
|
|
343
|
+
_findSentinel(sentinel, fromPos) {
|
|
344
|
+
const esc = sentinel.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
|
|
345
|
+
const re = new RegExp(`(?:^|[\\r\\n])(?:\\x1b\\[[0-9;?]*[a-zA-Z])*${esc}`, "g");
|
|
346
|
+
re.lastIndex = fromPos;
|
|
347
|
+
const m = re.exec(this._buffer);
|
|
348
|
+
if (!m)
|
|
349
|
+
return -1;
|
|
350
|
+
return m.index + m[0].length - sentinel.length;
|
|
351
|
+
}
|
|
352
|
+
/** 清理后台运行上下文 */
|
|
353
|
+
_clearRunningContext() {
|
|
354
|
+
this._runningStartPos = null;
|
|
355
|
+
this._runningSentinel = "";
|
|
356
|
+
this._runningCommand = "";
|
|
357
|
+
}
|
|
358
|
+
/** 输出截断保护 */
|
|
359
|
+
_truncate(s) {
|
|
360
|
+
if (s.length <= MAX_OUTPUT_LEN)
|
|
361
|
+
return s;
|
|
362
|
+
return `${s.slice(0, MAX_OUTPUT_LEN)}\n... [output truncated, ${s.length} chars total]`;
|
|
363
|
+
}
|
|
364
|
+
}
|
|
365
|
+
//# sourceMappingURL=local-session.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"local-session.js","sourceRoot":"","sources":["../src/local-session.ts"],"names":[],"mappings":"AAAA,0EAA0E;AAC1E,4DAA4D;AAE5D,OAAO,YAAY,MAAM,sCAAsC,CAAA;AAC/D,OAAO,EACL,mBAAmB,EACnB,eAAe,EACf,cAAc,EACd,QAAQ,EACR,QAAQ,EACR,eAAe,GAChB,MAAM,gBAAgB,CAAA;AACvB,OAAO,EAAE,cAAc,EAAE,MAAM,cAAc,CAAA;AAC7C,OAAO,EAAE,SAAS,EAAE,gBAAgB,EAAE,WAAW,EAAE,SAAS,EAAE,WAAW,EAAE,MAAM,YAAY,CAAA;AAE7F,MAAM,GAAG,GAAG,YAAY,CAAC,mBAAmB,CAAC,CAAA;AA0B7C,uCAAuC;AACvC,MAAM,cAAc,GAClB,0GAA0G,CAAA;AAE5G;;;;GAIG;AACH,SAAS,YAAY,CAAC,GAAW;IAC/B,MAAM,IAAI,GAAa,EAAE,CAAA;IACzB,MAAM,EAAE,GAAG,4BAA4B,CAAA;IACvC,IAAI,CAAyB,CAAA;IAC7B,OAAO,CAAC,CAAC,GAAG,EAAE,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;QAAE,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,CAAA;IAC1D,OAAO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M,CAAA;CACnB;AAED;;;;;;GAMG;AACH,wBAAgB,WAAW,CAAC,IAAI,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,YAAY,EAAE,EAAE,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,YAAY,CAAC,
|
|
1
|
+
{"version":3,"file":"server.d.ts","sourceRoot":"","sources":["../src/server.ts"],"names":[],"mappings":"AAEA,OAAO,EAAgB,KAAK,MAAM,EAAE,MAAM,WAAW,CAAA;AAIrD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,cAAc,CAAA;AAG9C,aAAa;AACb,MAAM,WAAW,YAAY;IAC3B,MAAM,EAAE,MAAM,CAAA;IACd,IAAI,EAAE,MAAM,CAAA;IACZ,GAAG,EAAE,MAAM,CAAA;IACX,KAAK,IAAI,IAAI,CAAA;CACd;AAED,wCAAwC;AACxC,MAAM,WAAW,YAAY;IAC3B,SAAS,EAAE,MAAM,CAAA;IACjB,IAAI,EAAE,MAAM,CAAA;IACZ,OAAO,EAAE,UAAU,CAAA;IACnB,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,SAAS,CAAC,EAAE,MAAM,CAAA;CACnB;AAED;;;;;;GAMG;AACH,wBAAgB,WAAW,CAAC,IAAI,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,YAAY,EAAE,EAAE,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,YAAY,CAAC,CAuF/G"}
|
package/dist/server.js
CHANGED
|
@@ -21,14 +21,14 @@ export function startServer(port, getSessions, dir) {
|
|
|
21
21
|
return;
|
|
22
22
|
}
|
|
23
23
|
if (path === "/api/status") {
|
|
24
|
-
// 跨进程聚合:所有 opencode
|
|
24
|
+
// 跨进程聚合:所有 opencode 进程写入的状态文件(含本进程,SSH + 本地/容器)
|
|
25
25
|
const states = listAllSessions(dir);
|
|
26
26
|
// 按 sessionID 分组(一个会话下多个终端)
|
|
27
27
|
const bySession = new Map();
|
|
28
28
|
for (const s of states) {
|
|
29
29
|
if (!bySession.has(s.sessionID))
|
|
30
30
|
bySession.set(s.sessionID, { title: s.title, directory: s.directory, terminals: [] });
|
|
31
|
-
bySession.get(s.sessionID).terminals.push({ name: s.name, host: s.host, user: s.user, port: s.port, connected: s.connected, busy: s.busy, pending: s.pending });
|
|
31
|
+
bySession.get(s.sessionID).terminals.push({ name: s.name, kind: s.kind, host: s.host, user: s.user, port: s.port, program: s.program, connected: s.connected, busy: s.busy, pending: s.pending });
|
|
32
32
|
}
|
|
33
33
|
const sessions = [...bySession.entries()].map(([sessionID, v]) => ({
|
|
34
34
|
sessionID,
|
|
@@ -44,32 +44,32 @@ export function startServer(port, getSessions, dir) {
|
|
|
44
44
|
const sid = url.searchParams.get("session") ?? "";
|
|
45
45
|
const name = url.searchParams.get("name") ?? "default";
|
|
46
46
|
const entry = getSessions().find((e) => e.sessionID === sid && e.name === name);
|
|
47
|
+
let pairs;
|
|
47
48
|
if (!entry) {
|
|
48
49
|
// 本进程无此会话句柄(其他进程的会话/复用服务)→ 从历史文件读取
|
|
49
|
-
|
|
50
|
-
|
|
50
|
+
// 本地/容器会话的历史目录带 local- 前缀,需按状态里的 kind 探测
|
|
51
|
+
const state = listAllSessions(dir).find((s) => s.sessionID === sid && s.name === name);
|
|
52
|
+
const histName = state?.kind === "local" ? `local-${name}` : name;
|
|
53
|
+
pairs = readHistoryFromFile(dir, sid, histName) ?? [];
|
|
54
|
+
if (pairs.length === 0) {
|
|
51
55
|
res.writeHead(404, { "Content-Type": "text/plain; charset=utf-8" });
|
|
52
56
|
res.end("Session not found or disconnected");
|
|
53
57
|
return;
|
|
54
58
|
}
|
|
55
|
-
res.writeHead(200, { "Content-Type": "text/plain; charset=utf-8" });
|
|
56
|
-
res.end(text);
|
|
57
|
-
return;
|
|
58
59
|
}
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
lines.push(`[ 运行中 ] ${running}`);
|
|
60
|
+
else {
|
|
61
|
+
// 命令+输出消息对(保留 ANSI 颜色,前端解析着色);运行中附加实时进度
|
|
62
|
+
pairs = [];
|
|
63
|
+
for (const pair of entry.session.getHistory().getPairs()) {
|
|
64
|
+
pairs.push({ type: "cmd", ts: pair.ts, text: pair.command });
|
|
65
|
+
pairs.push({ type: "out", text: entry.session.getHistory().readOutput(pair) });
|
|
66
|
+
}
|
|
67
|
+
const running = entry.session.getRunningOutput();
|
|
68
|
+
if (running)
|
|
69
|
+
pairs.push({ type: "run", text: running });
|
|
70
70
|
}
|
|
71
|
-
res.writeHead(200, { "Content-Type": "
|
|
72
|
-
res.end(
|
|
71
|
+
res.writeHead(200, { "Content-Type": "application/json" });
|
|
72
|
+
res.end(JSON.stringify({ pairs }));
|
|
73
73
|
return;
|
|
74
74
|
}
|
|
75
75
|
if (path === "/") {
|
|
@@ -99,8 +99,8 @@ export function startServer(port, getSessions, dir) {
|
|
|
99
99
|
* 从历史文件读取某终端记录(跨进程场景:本进程无该会话句柄时用)
|
|
100
100
|
* @param dir 插件缓存根目录
|
|
101
101
|
* @param sessionID opencode 会话 ID
|
|
102
|
-
* @param name
|
|
103
|
-
* @returns
|
|
102
|
+
* @param name 终端名(已含 local- 前缀则按本地目录)
|
|
103
|
+
* @returns 结构化消息对(保留 ANSI);目录不存在返回 null
|
|
104
104
|
*/
|
|
105
105
|
function readHistoryFromFile(dir, sessionID, name) {
|
|
106
106
|
const hdir = join(dir, sessionID, name);
|
|
@@ -112,20 +112,20 @@ function readHistoryFromFile(dir, sessionID, name) {
|
|
|
112
112
|
return null;
|
|
113
113
|
}
|
|
114
114
|
files.sort();
|
|
115
|
-
const
|
|
115
|
+
const out = [];
|
|
116
116
|
for (const f of files) {
|
|
117
117
|
try {
|
|
118
118
|
const data = JSON.parse(readFileSync(join(hdir, f), "utf8"));
|
|
119
119
|
if (typeof data.command === "string")
|
|
120
|
-
|
|
120
|
+
out.push({ type: "cmd", ts: data.ts ?? Date.now(), text: data.command });
|
|
121
121
|
if (typeof data.output === "string")
|
|
122
|
-
|
|
122
|
+
out.push({ type: "out", text: data.output });
|
|
123
123
|
}
|
|
124
124
|
catch {
|
|
125
125
|
/* 跳过损坏文件 */
|
|
126
126
|
}
|
|
127
127
|
}
|
|
128
|
-
return
|
|
128
|
+
return out;
|
|
129
129
|
}
|
|
130
130
|
/** 渲染终端记录页面(黑底绿字等宽,JS 轮询自动刷新) */
|
|
131
131
|
function renderPage() {
|
|
@@ -139,7 +139,15 @@ function renderPage() {
|
|
|
139
139
|
header { position: sticky; top: 0; display: flex; align-items: center; gap: 12px; padding: 10px 16px; background: #161b22; border-bottom: 1px solid #30363d; }
|
|
140
140
|
header h1 { margin: 0; font-size: 14px; color: #e6edf3; font-weight: 600; }
|
|
141
141
|
select { background: #21262d; color: #c9d1d9; border: 1px solid #30363d; padding: 4px 8px; border-radius: 6px; }
|
|
142
|
-
pre { margin: 0; padding: 16px; font-family: "Cascadia Code", Consolas, "Courier New", monospace; font-size: 13px; line-height: 1.5; white-space: pre; overflow: auto; height: calc(100% - 52px); box-sizing: border-box; color: #c9d1d9; }
|
|
142
|
+
pre { margin: 0; padding: 16px; font-family: "Cascadia Code", Consolas, "Courier New", monospace; font-size: 13px; line-height: 1.5; white-space: pre-wrap; overflow: auto; height: calc(100% - 52px); box-sizing: border-box; color: #c9d1d9; }
|
|
143
|
+
/* 两列布局:左侧时间列(开关控制显隐),右侧内容列(命令/输出格式不变) */
|
|
144
|
+
.row { display: flex; align-items: stretch; }
|
|
145
|
+
.row .t { box-sizing: border-box; flex: 0 0 172px; color: #8b949e; padding: 0 10px 0 6px; border-right: 1px solid #30363d; white-space: pre; }
|
|
146
|
+
.row .c { flex: 1; padding-left: 12px; white-space: pre; }
|
|
147
|
+
body:not(.show-time) .row .t { display: none; }
|
|
148
|
+
/* 命令行:明显区分(背景条 + 左侧蓝条 + 加粗);用 box-shadow 不占布局,保证时间列/分割线与输出行完全对齐 */
|
|
149
|
+
.row.cmdline { background: #161b22; box-shadow: inset 3px 0 0 #58a6ff; font-weight: 600; }
|
|
150
|
+
.tgl { font-size: 12px; color: #8b949e; display: flex; align-items: center; gap: 4px; white-space: nowrap; }
|
|
143
151
|
#meta { font-size: 12px; color: #8b949e; }
|
|
144
152
|
/* 深色细滚动条:匹配暗色主题 */
|
|
145
153
|
::-webkit-scrollbar { width: 10px; height: 10px; }
|
|
@@ -160,9 +168,10 @@ function renderPage() {
|
|
|
160
168
|
</head>
|
|
161
169
|
<body>
|
|
162
170
|
<header>
|
|
163
|
-
<h1
|
|
171
|
+
<h1>终端记录</h1>
|
|
164
172
|
<select id="session" onchange="onSessionChange(true)"></select>
|
|
165
173
|
<select id="terminal" onchange="onSessionChange(true)"></select>
|
|
174
|
+
<label class="tgl"><input type="checkbox" id="showTime" onchange="onShowTimeChange()"> 时间</label>
|
|
166
175
|
<span id="meta"></span>
|
|
167
176
|
</header>
|
|
168
177
|
<pre id="term">加载中...</pre>
|
|
@@ -265,7 +274,7 @@ function renderPage() {
|
|
|
265
274
|
for (const t of (s ? s.terminals : [])) {
|
|
266
275
|
const opt = document.createElement("option");
|
|
267
276
|
opt.value = t.name || "default";
|
|
268
|
-
opt.textContent = (t.name || "default") + " " + (t.connected ? "●" : "○") + (t.busy ? " ⏳" : "");
|
|
277
|
+
opt.textContent = (t.name || "default") + (t.kind === "local" ? " [本地]" : "") + " " + (t.connected ? "●" : "○") + (t.busy ? " ⏳" : "");
|
|
269
278
|
tsel.appendChild(opt);
|
|
270
279
|
}
|
|
271
280
|
if (prev && [...tsel.options].some(o => o.value === prev)) tsel.value = prev;
|
|
@@ -284,15 +293,28 @@ function renderPage() {
|
|
|
284
293
|
if (!sid || !name) { pre.textContent = "无会话,请先 ssh_connect"; return; }
|
|
285
294
|
// 更新前判断是否贴底:用户已向上滚动离开底部则不自动下滚,保持当前位置
|
|
286
295
|
if (pre.scrollTop + pre.clientHeight >= pre.scrollHeight - 30) stickToBottom = true;
|
|
296
|
+
const showTime = document.getElementById("showTime").checked;
|
|
297
|
+
document.body.classList.toggle("show-time", showTime);
|
|
287
298
|
const r = await fetch("/api/transcript?session=" + encodeURIComponent(sid) + "&name=" + encodeURIComponent(name));
|
|
288
|
-
const
|
|
299
|
+
const data = await r.json();
|
|
300
|
+
const pairs = data.pairs || [];
|
|
289
301
|
// 渲染前旧内容完整高度 = 新消息顶部位置(旧内容不变时高度稳定)
|
|
290
302
|
const prevHeight = pre.scrollHeight;
|
|
291
303
|
// 内容是否有新变化(有新消息才显示悬浮按钮)
|
|
292
|
-
const
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
304
|
+
const sig = JSON.stringify(pairs);
|
|
305
|
+
const changed = sig !== lastTranscript;
|
|
306
|
+
lastTranscript = sig;
|
|
307
|
+
pre.innerHTML = pairs.map((p) => {
|
|
308
|
+
if (p.type === "cmd") {
|
|
309
|
+
const t = showTime ? fmtTime(p.ts) : "";
|
|
310
|
+
return '<div class="row cmdline"><span class="t">' + t + '</span><span class="c">' + ansiToHtml(p.text) + '</span></div>';
|
|
311
|
+
}
|
|
312
|
+
// out / run:输出列,保留 ANSI 彩色,时间列留空(不改变输出格式)
|
|
313
|
+
const label = p.type === "run" ? "[运行中] " : "";
|
|
314
|
+
return '<div class="row"><span class="t"></span><span class="c">' + label + ansiToHtml(p.text) + '</span></div>';
|
|
315
|
+
}).join("");
|
|
316
|
+
const cmdCount = pairs.filter((p) => p.type === "cmd").length;
|
|
317
|
+
document.getElementById("meta").textContent = sid + "/" + name + " · " + cmdCount + " 条命令 · 每 2s 自动刷新";
|
|
296
318
|
if (stickToBottom) {
|
|
297
319
|
pre.scrollTop = pre.scrollHeight;
|
|
298
320
|
toBottomBtn.style.display = "none";
|
|
@@ -310,6 +332,23 @@ function renderPage() {
|
|
|
310
332
|
}
|
|
311
333
|
}
|
|
312
334
|
|
|
335
|
+
// 时间戳格式化 yyyy-MM-dd HH:mm:ss
|
|
336
|
+
function fmtTime(ts) {
|
|
337
|
+
const d = new Date(ts);
|
|
338
|
+
const p = (n) => String(n).padStart(2, "0");
|
|
339
|
+
return d.getFullYear() + "-" + p(d.getMonth() + 1) + "-" + p(d.getDate()) + " " + p(d.getHours()) + ":" + p(d.getMinutes()) + ":" + p(d.getSeconds());
|
|
340
|
+
}
|
|
341
|
+
|
|
342
|
+
// 时间开关:localStorage 持久化,刷新页面保持状态
|
|
343
|
+
function onShowTimeChange() {
|
|
344
|
+
const el = document.getElementById("showTime");
|
|
345
|
+
localStorage.setItem("showTime", el.checked ? "1" : "0");
|
|
346
|
+
document.body.classList.toggle("show-time", el.checked);
|
|
347
|
+
loadTranscript();
|
|
348
|
+
}
|
|
349
|
+
document.getElementById("showTime").checked = localStorage.getItem("showTime") === "1";
|
|
350
|
+
document.body.classList.toggle("show-time", document.getElementById("showTime").checked);
|
|
351
|
+
|
|
313
352
|
// 用户滚动:贴底 → 恢复跟随并隐藏按钮;离开底部 → 取消自动贴底
|
|
314
353
|
const termPre = document.getElementById("term");
|
|
315
354
|
const toBottomBtn = document.getElementById("toBottom");
|
package/dist/server.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"server.js","sourceRoot":"","sources":["../src/server.ts"],"names":[],"mappings":"AAAA,8CAA8C;AAE9C,OAAO,EAAE,YAAY,EAAe,MAAM,WAAW,CAAA;AACrD,OAAO,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,SAAS,CAAA;AACnD,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAA;AAGhC,OAAO,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAA;AAmBpD;;;;;;GAMG;AACH,MAAM,UAAU,WAAW,CAAC,IAAY,EAAE,WAAiC,EAAE,GAAW;IACtF,IAAI,UAAU,GAAG,IAAI,CAAA;IACrB,MAAM,MAAM,GAAG,YAAY,CAAC,CAAC,GAAG,EAAE,GAAG,EAAE,EAAE;QACvC,MAAM,GAAG,GAAG,IAAI,GAAG,CAAC,GAAG,C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AAC;YACH,MAAM,IAAI,GAAG,IAAI,CAAC,KAAK,CAAC,YAAY,CAAC,IAAI,CAAC,IAAI,EAAE,CAAC,CAAC,EAAE,MAAM,CAAC,CAAuD,CAAA;YAClH,IAAI,OAAO,IAAI,CAAC,OAAO,KAAK,QAAQ;gBAAE,GAAG,CAAC,IAAI,CAAC,EAAE,IAAI,EAAE,KAAK,EAAE,EAAE,EAAE,IAAI,CAAC,EAAE,IAAI,IAAI,CAAC,GAAG,EAAE,EAAE,IAAI,EAAE,IAAI,CAAC,OAAO,EAAE,CAAC,CAAA;YAC9G,IAAI,OAAO,IAAI,CAAC,MAAM,KAAK,QAAQ;gBAAE,GAAG,CAAC,IAAI,CAAC,EAAE,IAAI,EAAE,KAAK,EAAE,IAAI,EAAE,IAAI,CAAC,MAAM,EAAE,CAAC,CAAA;QACnF,CAAC;QAAC,MAAM,CAAC;YACP,YAAY;QACd,CAAC;IACH,CAAC;IACD,OAAO,GAAG,CAAA;AACZ,CAAC;AAED,iCAAiC;AACjC,SAAS,UAAU;IACjB,OAAO;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;QAoPD,CAAA;AACR,CAAC"}
|
package/dist/session-store.d.ts
CHANGED
|
@@ -2,9 +2,13 @@
|
|
|
2
2
|
export interface SessionState {
|
|
3
3
|
sessionID: string;
|
|
4
4
|
name: string;
|
|
5
|
+
/** 会话类型:ssh 远程 / local 本地·容器 */
|
|
6
|
+
kind?: "ssh" | "local";
|
|
5
7
|
host?: string;
|
|
6
8
|
user?: string;
|
|
7
9
|
port?: number;
|
|
10
|
+
/** 本地/容器会话的程序(如 pwsh、docker exec ...) */
|
|
11
|
+
program?: string;
|
|
8
12
|
connected: boolean;
|
|
9
13
|
busy: boolean;
|
|
10
14
|
pending: number;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"session-store.d.ts","sourceRoot":"","sources":["../src/session-store.ts"],"names":[],"mappings":"AAKA,yBAAyB;AACzB,MAAM,WAAW,YAAY;IAC3B,SAAS,EAAE,MAAM,CAAA;IACjB,IAAI,EAAE,MAAM,CAAA;IACZ,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,SAAS,EAAE,OAAO,CAAA;IAClB,IAAI,EAAE,OAAO,CAAA;IACb,OAAO,EAAE,MAAM,CAAA;IACf,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,SAAS,EAAE,MAAM,CAAA;CAClB;AAUD,8BAA8B;AAC9B,wBAAgB,iBAAiB,CAAC,SAAS,EAAE,MAAM,EAAE,KAAK,EAAE,YAAY,GAAG,IAAI,CAQ9E;AAED,4BAA4B;AAC5B,wBAAgB,kBAAkB,CAAC,SAAS,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,IAAI,CAM3F;AAED,oCAAoC;AACpC,wBAAgB,eAAe,CAAC,SAAS,EAAE,MAAM,GAAG,YAAY,EAAE,CAoBjE"}
|
|
1
|
+
{"version":3,"file":"session-store.d.ts","sourceRoot":"","sources":["../src/session-store.ts"],"names":[],"mappings":"AAKA,yBAAyB;AACzB,MAAM,WAAW,YAAY;IAC3B,SAAS,EAAE,MAAM,CAAA;IACjB,IAAI,EAAE,MAAM,CAAA;IACZ,gCAAgC;IAChC,IAAI,CAAC,EAAE,KAAK,G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