@0xmaxma/claude-gateway 1.3.4 → 1.3.6
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 +1 -1
- package/config.template.json +9 -7
- package/dist/agent/runner.d.ts +20 -0
- package/dist/agent/runner.d.ts.map +1 -1
- package/dist/agent/runner.js +94 -1
- package/dist/agent/runner.js.map +1 -1
- package/dist/api/gateway-router.d.ts +14 -0
- package/dist/api/gateway-router.d.ts.map +1 -1
- package/dist/api/gateway-router.js +279 -7
- package/dist/api/gateway-router.js.map +1 -1
- package/dist/discord/receiver.d.ts +1 -0
- package/dist/discord/receiver.d.ts.map +1 -1
- package/dist/discord/receiver.js +7 -1
- package/dist/discord/receiver.js.map +1 -1
- package/dist/session/process.d.ts +8 -0
- package/dist/session/process.d.ts.map +1 -1
- package/dist/session/process.js +34 -0
- package/dist/session/process.js.map +1 -1
- package/dist/shell/claude-pty-shell.js +211 -4
- package/dist/shell/claude-pty-shell.js.map +1 -1
- package/dist/shell/emitter.d.ts +13 -0
- package/dist/shell/emitter.d.ts.map +1 -1
- package/dist/shell/emitter.js +16 -0
- package/dist/shell/emitter.js.map +1 -1
- package/dist/shell/menu-cancel.d.ts +50 -0
- package/dist/shell/menu-cancel.d.ts.map +1 -0
- package/dist/shell/menu-cancel.js +62 -0
- package/dist/shell/menu-cancel.js.map +1 -0
- package/dist/shell/pty-serialize.d.ts +23 -0
- package/dist/shell/pty-serialize.d.ts.map +1 -0
- package/dist/shell/pty-serialize.js +131 -0
- package/dist/shell/pty-serialize.js.map +1 -0
- package/dist/shell/pty-stream-registry.d.ts +59 -0
- package/dist/shell/pty-stream-registry.d.ts.map +1 -0
- package/dist/shell/pty-stream-registry.js +279 -0
- package/dist/shell/pty-stream-registry.js.map +1 -0
- package/dist/shell/screen.d.ts +43 -0
- package/dist/shell/screen.d.ts.map +1 -1
- package/dist/shell/screen.js +91 -1
- package/dist/shell/screen.js.map +1 -1
- package/dist/telegram/receiver.d.ts +1 -0
- package/dist/telegram/receiver.d.ts.map +1 -1
- package/dist/telegram/receiver.js +7 -1
- package/dist/telegram/receiver.js.map +1 -1
- package/dist/ui/web-ui.d.ts +2 -2
- package/dist/ui/web-ui.d.ts.map +1 -1
- package/dist/ui/web-ui.js +682 -114
- package/dist/ui/web-ui.js.map +1 -1
- package/mcp/tools/discord/module.ts +88 -1
- package/mcp/tools/discord/outbound.ts +36 -0
- package/mcp/tools/discord/types.ts +2 -0
- package/mcp/tools/telegram/menu-parser.ts +37 -0
- package/mcp/tools/telegram/receiver-server.ts +83 -0
- package/mcp/tools/telegram/typing.ts +7 -1
- package/package.json +4 -2
|
@@ -0,0 +1,279 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
35
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
+
exports.ptyStreamRegistry = exports.PtyStreamRegistry = void 0;
|
|
37
|
+
const net = __importStar(require("net"));
|
|
38
|
+
const fs = __importStar(require("fs"));
|
|
39
|
+
const os = __importStar(require("os"));
|
|
40
|
+
const path = __importStar(require("path"));
|
|
41
|
+
const ws_1 = require("ws");
|
|
42
|
+
const headless_1 = require("@xterm/headless");
|
|
43
|
+
const pty_serialize_1 = require("./pty-serialize");
|
|
44
|
+
/** Server PTY geometry — the headless mirror must match so the screen reconstructs faithfully. */
|
|
45
|
+
const PTY_COLS = 200;
|
|
46
|
+
const PTY_ROWS = 50;
|
|
47
|
+
/**
|
|
48
|
+
* Tracks live PTY output streams so the dashboard can mirror a running shell.
|
|
49
|
+
*
|
|
50
|
+
* Everything is keyed by `streamKey` — the per-session id, NOT the agent id. A
|
|
51
|
+
* single agent can run several concurrent sessions (e.g. a Telegram session and
|
|
52
|
+
* an API/cron session), each its own PTY with its own screen. Keying by agent
|
|
53
|
+
* id would merge them: both sessions would feed one shared mirror (interleaved,
|
|
54
|
+
* unreadable output) and the viewer could not target a specific session. Keying
|
|
55
|
+
* by session id keeps each stream isolated.
|
|
56
|
+
*/
|
|
57
|
+
class PtyStreamRegistry {
|
|
58
|
+
constructor() {
|
|
59
|
+
this.clients = new Map();
|
|
60
|
+
this.servers = new Map();
|
|
61
|
+
this.streamSockets = new Map();
|
|
62
|
+
/**
|
|
63
|
+
* Headless terminal mirror per stream. Fed every PTY byte so it always holds
|
|
64
|
+
* the session's current screen grid; on subscribe we serialize this into one
|
|
65
|
+
* complete frame instead of replaying a (lossy, truncatable) raw-byte tail.
|
|
66
|
+
*/
|
|
67
|
+
this.screens = new Map();
|
|
68
|
+
}
|
|
69
|
+
/** Per-session unix socket path. Derived from the session id so each session gets its own stream. */
|
|
70
|
+
socketPath(streamKey) {
|
|
71
|
+
// 48 chars comfortably fits a full UUID without truncation — two sessions
|
|
72
|
+
// must never collide onto the same socket (that would cross-wire output).
|
|
73
|
+
const safe = streamKey.replace(/[^a-z0-9_-]/gi, '').slice(0, 48);
|
|
74
|
+
return path.join(os.tmpdir(), `gw-pty-${safe}.sock`);
|
|
75
|
+
}
|
|
76
|
+
listen(streamKey, socketPath) {
|
|
77
|
+
try {
|
|
78
|
+
fs.unlinkSync(socketPath);
|
|
79
|
+
}
|
|
80
|
+
catch { /* stale or absent */ }
|
|
81
|
+
const server = net.createServer((conn) => {
|
|
82
|
+
// Use latin1 to preserve raw byte sequences from the PTY without UTF-8 re-encoding
|
|
83
|
+
conn.setEncoding('latin1');
|
|
84
|
+
conn.on('data', (chunk) => this.broadcast(streamKey, chunk));
|
|
85
|
+
conn.on('error', () => { });
|
|
86
|
+
});
|
|
87
|
+
server.on('error', () => { });
|
|
88
|
+
server.listen(socketPath);
|
|
89
|
+
this.servers.set(socketPath, server);
|
|
90
|
+
if (!this.streamSockets.has(streamKey))
|
|
91
|
+
this.streamSockets.set(streamKey, new Set());
|
|
92
|
+
// First socket for this stream → a fresh session is starting, so reset the
|
|
93
|
+
// screen mirror to show output from this session's start, not a prior one.
|
|
94
|
+
if (this.streamSockets.get(streamKey).size === 0)
|
|
95
|
+
this.resetScreen(streamKey);
|
|
96
|
+
this.streamSockets.get(streamKey).add(socketPath);
|
|
97
|
+
}
|
|
98
|
+
close(socketPath) {
|
|
99
|
+
const server = this.servers.get(socketPath);
|
|
100
|
+
if (!server)
|
|
101
|
+
return;
|
|
102
|
+
server.close();
|
|
103
|
+
this.servers.delete(socketPath);
|
|
104
|
+
try {
|
|
105
|
+
fs.unlinkSync(socketPath);
|
|
106
|
+
}
|
|
107
|
+
catch { /* already gone */ }
|
|
108
|
+
for (const [streamKey, paths] of this.streamSockets) {
|
|
109
|
+
paths.delete(socketPath);
|
|
110
|
+
if (!paths.size) {
|
|
111
|
+
this.streamSockets.delete(streamKey);
|
|
112
|
+
this.disposeScreen(streamKey);
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
/** Returns true if at least one active PTY socket server is registered for this stream/session. */
|
|
117
|
+
hasSockets(streamKey) {
|
|
118
|
+
return (this.streamSockets.get(streamKey)?.size ?? 0) > 0;
|
|
119
|
+
}
|
|
120
|
+
/**
|
|
121
|
+
* Return the current visible screen as plain text — ANSI escape codes stripped,
|
|
122
|
+
* trailing blank lines removed. Each screen row becomes one line in the output.
|
|
123
|
+
* Returns null if no headless mirror exists for the given stream key (session
|
|
124
|
+
* not running in PTY mode, or not yet started).
|
|
125
|
+
*
|
|
126
|
+
* Intended for agents that need to observe what is currently displayed in the
|
|
127
|
+
* PTY shell (e.g. to detect hang states, unexpected prompts, or tool output)
|
|
128
|
+
* without having to parse ANSI/VT100 sequences.
|
|
129
|
+
*
|
|
130
|
+
* Async: flushes the terminal's write queue (same as subscribe does for the
|
|
131
|
+
* serialized frame) so the snapshot reflects every byte received so far.
|
|
132
|
+
*/
|
|
133
|
+
async screenText(streamKey) {
|
|
134
|
+
const term = this.screens.get(streamKey);
|
|
135
|
+
if (!term)
|
|
136
|
+
return null;
|
|
137
|
+
// Flush write queue so the buffer reflects all bytes received so far.
|
|
138
|
+
await new Promise((resolve) => term.write('', resolve));
|
|
139
|
+
const buf = term.buffer.active;
|
|
140
|
+
const cols = term.cols;
|
|
141
|
+
const rows = term.rows;
|
|
142
|
+
const lines = [];
|
|
143
|
+
let cell;
|
|
144
|
+
for (let y = 0; y < rows; y++) {
|
|
145
|
+
const line = buf.getLine(buf.viewportY + y);
|
|
146
|
+
if (!line) {
|
|
147
|
+
lines.push('');
|
|
148
|
+
continue;
|
|
149
|
+
}
|
|
150
|
+
// Collect characters up to the last non-blank cell on this row.
|
|
151
|
+
let rowStr = '';
|
|
152
|
+
let lastNonBlank = -1;
|
|
153
|
+
// First pass: find last non-blank column.
|
|
154
|
+
for (let x = cols - 1; x >= 0; x--) {
|
|
155
|
+
cell = line.getCell(x, cell);
|
|
156
|
+
if (cell) {
|
|
157
|
+
const ch = cell.getChars();
|
|
158
|
+
if (ch !== '' && ch !== ' ') {
|
|
159
|
+
lastNonBlank = x;
|
|
160
|
+
break;
|
|
161
|
+
}
|
|
162
|
+
}
|
|
163
|
+
}
|
|
164
|
+
if (lastNonBlank < 0) {
|
|
165
|
+
lines.push('');
|
|
166
|
+
continue;
|
|
167
|
+
}
|
|
168
|
+
// Second pass: build the string up to lastNonBlank.
|
|
169
|
+
for (let x = 0; x <= lastNonBlank; x++) {
|
|
170
|
+
cell = line.getCell(x, cell);
|
|
171
|
+
if (!cell) {
|
|
172
|
+
rowStr += ' ';
|
|
173
|
+
continue;
|
|
174
|
+
}
|
|
175
|
+
if (cell.getWidth() === 0)
|
|
176
|
+
continue; // spacer for wide glyph
|
|
177
|
+
const ch = cell.getChars();
|
|
178
|
+
rowStr += ch === '' ? ' ' : ch;
|
|
179
|
+
}
|
|
180
|
+
lines.push(rowStr);
|
|
181
|
+
}
|
|
182
|
+
// Strip trailing blank lines so the agent sees a compact snapshot.
|
|
183
|
+
while (lines.length > 0 && lines[lines.length - 1] === '')
|
|
184
|
+
lines.pop();
|
|
185
|
+
return {
|
|
186
|
+
text: lines.join('\n'),
|
|
187
|
+
cursorRow: buf.cursorY,
|
|
188
|
+
cursorCol: buf.cursorX,
|
|
189
|
+
cols,
|
|
190
|
+
rows,
|
|
191
|
+
};
|
|
192
|
+
}
|
|
193
|
+
subscribe(streamKey, ws) {
|
|
194
|
+
if (!this.clients.has(streamKey))
|
|
195
|
+
this.clients.set(streamKey, new Set());
|
|
196
|
+
// Register the client BEFORE sending the frame so no live byte produced in
|
|
197
|
+
// the meantime is dropped (a gap there is exactly the old replay bug). The
|
|
198
|
+
// frame is a full repaint, so any byte that races ahead of it is harmlessly
|
|
199
|
+
// re-applied by Claude's next redraw.
|
|
200
|
+
this.clients.get(streamKey).add(ws);
|
|
201
|
+
const term = this.screens.get(streamKey);
|
|
202
|
+
if (!term || ws.readyState !== ws_1.WebSocket.OPEN)
|
|
203
|
+
return;
|
|
204
|
+
// Flush the terminal's write queue first so the serialized frame reflects
|
|
205
|
+
// every byte received so far, then send one complete screen snapshot.
|
|
206
|
+
term.write('', () => {
|
|
207
|
+
if (ws.readyState !== ws_1.WebSocket.OPEN)
|
|
208
|
+
return;
|
|
209
|
+
try {
|
|
210
|
+
// UTF-8 (not latin1): serialized cell chars are decoded Unicode.
|
|
211
|
+
ws.send(Buffer.from((0, pty_serialize_1.serializeScreen)(term), 'utf8'));
|
|
212
|
+
}
|
|
213
|
+
catch { /* client gone */ }
|
|
214
|
+
});
|
|
215
|
+
}
|
|
216
|
+
unsubscribe(streamKey, ws) {
|
|
217
|
+
const set = this.clients.get(streamKey);
|
|
218
|
+
if (!set)
|
|
219
|
+
return;
|
|
220
|
+
set.delete(ws);
|
|
221
|
+
if (!set.size)
|
|
222
|
+
this.clients.delete(streamKey);
|
|
223
|
+
}
|
|
224
|
+
broadcast(streamKey, data) {
|
|
225
|
+
this.feedScreen(streamKey, data);
|
|
226
|
+
const set = this.clients.get(streamKey);
|
|
227
|
+
if (!set?.size)
|
|
228
|
+
return;
|
|
229
|
+
for (const ws of set) {
|
|
230
|
+
if (ws.readyState === ws_1.WebSocket.OPEN) {
|
|
231
|
+
// Send as binary to preserve latin1 bytes faithfully; xterm.js accepts both
|
|
232
|
+
try {
|
|
233
|
+
ws.send(Buffer.from(data, 'latin1'));
|
|
234
|
+
}
|
|
235
|
+
catch { /* client gone */ }
|
|
236
|
+
}
|
|
237
|
+
}
|
|
238
|
+
}
|
|
239
|
+
/** Feed raw PTY bytes into the stream's headless mirror, creating it on first use. */
|
|
240
|
+
feedScreen(streamKey, data) {
|
|
241
|
+
if (!data)
|
|
242
|
+
return;
|
|
243
|
+
let term = this.screens.get(streamKey);
|
|
244
|
+
if (!term) {
|
|
245
|
+
term = this.createTerm();
|
|
246
|
+
this.screens.set(streamKey, term);
|
|
247
|
+
}
|
|
248
|
+
// `data` is a latin1-decoded byte string (the socket reads with
|
|
249
|
+
// setEncoding('latin1')). Reconstruct the raw bytes and hand xterm a
|
|
250
|
+
// Uint8Array, NOT a string: xterm.write(string) treats each code unit as a
|
|
251
|
+
// final codepoint and does NOT UTF-8-decode, so multi-byte glyphs (Thai,
|
|
252
|
+
// emoji) would be stored as individual latin1 chars and serialize back as
|
|
253
|
+
// mojibake. xterm.write(Uint8Array) runs them through its UTF-8 decoder.
|
|
254
|
+
term.write(Buffer.from(data, 'latin1'));
|
|
255
|
+
}
|
|
256
|
+
/** Start a clean mirror for a fresh session, disposing any prior one. */
|
|
257
|
+
resetScreen(streamKey) {
|
|
258
|
+
this.disposeScreen(streamKey);
|
|
259
|
+
this.screens.set(streamKey, this.createTerm());
|
|
260
|
+
}
|
|
261
|
+
disposeScreen(streamKey) {
|
|
262
|
+
const term = this.screens.get(streamKey);
|
|
263
|
+
if (term) {
|
|
264
|
+
try {
|
|
265
|
+
term.dispose();
|
|
266
|
+
}
|
|
267
|
+
catch { /* already disposed */ }
|
|
268
|
+
}
|
|
269
|
+
this.screens.delete(streamKey);
|
|
270
|
+
}
|
|
271
|
+
createTerm() {
|
|
272
|
+
// scrollback: 0 — we only ever serialize the visible screen (the alt-screen
|
|
273
|
+
// TUI has no scrollback by design), so retaining none bounds memory.
|
|
274
|
+
return new headless_1.Terminal({ cols: PTY_COLS, rows: PTY_ROWS, scrollback: 0, allowProposedApi: true });
|
|
275
|
+
}
|
|
276
|
+
}
|
|
277
|
+
exports.PtyStreamRegistry = PtyStreamRegistry;
|
|
278
|
+
exports.ptyStreamRegistry = new PtyStreamRegistry();
|
|
279
|
+
//# sourceMappingURL=pty-stream-registry.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pty-stream-registry.js","sourceRoot":"","sources":["../../src/shell/pty-stream-registry.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,yCAA2B;AAC3B,uCAAyB;AACzB,uCAAyB;AACzB,2CAA6B;AAC7B,2BAA+B;AAC/B,8CAA2C;AAE3C,mDAAkD;AAElD,kGAAkG;AAClG,MAAM,QAAQ,GAAG,GAAG,CAAC;AACrB,MAAM,QAAQ,GAAG,EAAE,CAAC;AAEpB;;;;;;;;;GASG;AACH,MAAa,iBAAiB;IAA9B;QACmB,YAAO,GAAG,IAAI,GAAG,EAA0B,CAAC;QAC5C,YAAO,GAAG,IAAI,GAAG,EAAsB,CAAC;QACxC,kBAAa,GAAG,IAAI,GAAG,EAAuB,CAAC;QAChE;;;;WAIG;QACc,YAAO,GAAG,IAAI,GAAG,EAAoB,CAAC;IA0LzD,CAAC;IAxLC,qGAAqG;IACrG,UAAU,CAAC,SAAiB;QAC1B,0EAA0E;QAC1E,0EAA0E;QAC1E,MAAM,IAAI,GAAG,SAAS,CAAC,OAAO,CAAC,eAAe,EAAE,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC;QACjE,OAAO,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,MAAM,EAAE,EAAE,UAAU,IAAI,OAAO,CAAC,CAAC;IACvD,CAAC;IAED,MAAM,CAAC,SAAiB,EAAE,UAAkB;QAC1C,IAAI,CAAC;YAAC,EAAE,CAAC,UAAU,CAAC,UAAU,CAAC,CAAC;QAAC,CAAC;QAAC,MAAM,CAAC,CAAC,qBAAqB,CAAC,CAAC;QAElE,MAAM,MAAM,GAAG,GAAG,CAAC,YAAY,CAAC,CAAC,IAAI,EAAE,EAAE;YACvC,mFAAmF;YACnF,IAAI,CAAC,WAAW,CAAC,QAAQ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,CAAC,SAAS,EAAE,IAAI,CAAC,CAAC;QAAC,CAAC;QAC3E,gEAAgE;QAChE,qEAAqE;QACrE,2EAA2E;QAC3E,yEAAyE;QACzE,0EAA0E;QAC1E,yEAAyE;QACzE,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,IAAI,CAAC,IAAI,EAAE,QAAQ,CAAC,CAAC,CAAC;IAC1C,CAAC;IAED,yEAAyE;IACjE,WAAW,CAAC,SAAiB;QACnC,IAAI,CAAC,aAAa,CAAC,SAAS,CAAC,CAAC;QAC9B,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,SAAS,EAAE,IAAI,CAAC,UAAU,EAAE,CAAC,CAAC;IACjD,CAAC;IAEO,aAAa,CAAC,SAAiB;QACrC,MAAM,IAAI,GAAG,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,SAAS,CAAC,CAAC;QACzC,IAAI,IAAI,EAAE,CAAC;YAAC,IAAI,CAAC;gBAAC,IAAI,CAAC,OAAO,EAAE,CAAC;YAAC,CAAC;YAAC,MAAM,CAAC,CAAC,sBAAsB,CAAC,CAAC;QAAC,CAAC;QACtE,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC;IACjC,CAAC;IAEO,UAAU;QAChB,4EAA4E;QAC5E,qEAAqE;QACrE,OAAO,IAAI,mBAAQ,CAAC,EAAE,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAE,QAAQ,EAAE,UAAU,EAAE,CAAC,EAAE,gBAAgB,EAAE,IAAI,EAAE,CAAC,CAAC;IACjG,CAAC;CACF;AAnMD,8CAmMC;AAEY,QAAA,iBAAiB,GAAG,IAAI,iBAAiB,EAAE,CAAC"}
|
package/dist/shell/screen.d.ts
CHANGED
|
@@ -1,4 +1,11 @@
|
|
|
1
1
|
export type DialogKind = 'bypass-permissions';
|
|
2
|
+
/** One selectable row in an interactive TUI menu (AskUserQuestion / plan approval). */
|
|
3
|
+
export interface MenuOption {
|
|
4
|
+
/** 1-based number as shown in the TUI. */
|
|
5
|
+
index: number;
|
|
6
|
+
/** Human-readable label (first line only; sub-descriptions are ignored). */
|
|
7
|
+
label: string;
|
|
8
|
+
}
|
|
2
9
|
/**
|
|
3
10
|
* TUI string constants — verified against Claude Code v2.1.x.
|
|
4
11
|
* When upgrading Claude Code, re-check each constant against the new TUI output.
|
|
@@ -11,6 +18,31 @@ export type DialogKind = 'bypass-permissions';
|
|
|
11
18
|
export declare const TUI_BUSY_MARKER = "esc to interrupt";
|
|
12
19
|
export declare const TUI_PROMPT_RE: RegExp;
|
|
13
20
|
export declare const TUI_BYPASS_PERMS: readonly ["Bypass Permissions mode", "Yes, I accept"];
|
|
21
|
+
/**
|
|
22
|
+
* Interactive select-menu footer markers (e.g. AskUserQuestion). The footer reads
|
|
23
|
+
* "Enter to select · ↑/↓ to navigate · Esc to cancel"; we match on the two stable
|
|
24
|
+
* fragments so spacing/middle-dot variations across TUI versions don't break it.
|
|
25
|
+
*/
|
|
26
|
+
export declare const TUI_MENU_FOOTER: readonly ["to navigate", "to cancel"];
|
|
27
|
+
/** A numbered option row, with an optional leading ❯/> highlight marker. */
|
|
28
|
+
export declare const TUI_MENU_OPTION_RE: RegExp;
|
|
29
|
+
/**
|
|
30
|
+
* Parse a user's menu reply (typed number or a button's choice payload) into a
|
|
31
|
+
* 1-based option index. Returns null for anything that isn't a leading integer
|
|
32
|
+
* within [1, count] — never trust chat input to be a valid selection.
|
|
33
|
+
*/
|
|
34
|
+
export declare function parseMenuChoice(text: string, count: number): number | null;
|
|
35
|
+
/**
|
|
36
|
+
* Channel turns reach the wrapper wrapped in a <channel …>…</channel> envelope
|
|
37
|
+
* (see AgentRunner.buildChannelXml) — even a one-character menu reply like "1"
|
|
38
|
+
* arrives as `<channel source="telegram" …>1</channel>`. To interpret a menu
|
|
39
|
+
* selection we need the user's actual text, not the envelope, so pull out the
|
|
40
|
+
* inner content and drop any nested <replied> block. Returns the input
|
|
41
|
+
* unchanged when it is not a channel envelope (e.g. a raw API/typed reply).
|
|
42
|
+
*/
|
|
43
|
+
export declare function extractChannelContent(text: string): string;
|
|
44
|
+
/** Build the chat-facing menu prompt (also the API/number fallback text). */
|
|
45
|
+
export declare function formatMenuPrompt(options: MenuOption[]): string;
|
|
14
46
|
/**
|
|
15
47
|
* Virtual terminal fed with raw PTY bytes. Used ONLY for liveness signals
|
|
16
48
|
* (busy / idle / dialog detection) — assistant text is never parsed from
|
|
@@ -35,5 +67,16 @@ export declare class ScreenModel {
|
|
|
35
67
|
/** Idle input prompt is on screen. */
|
|
36
68
|
hasPrompt(): boolean;
|
|
37
69
|
detectDialog(): DialogKind | null;
|
|
70
|
+
/**
|
|
71
|
+
* Detect an interactive select menu blocking on keyboard input (e.g. the
|
|
72
|
+
* AskUserQuestion / plan-approval prompt) and parse its numbered options.
|
|
73
|
+
* Returns the options in display order, or null when no menu is on screen.
|
|
74
|
+
*
|
|
75
|
+
* Requires the select-menu footer AND at least two numbered rows — ordinary
|
|
76
|
+
* numbered lists in assistant output never carry the footer, so this won't
|
|
77
|
+
* false-positive on them. The bypass-permissions dialog also matches the
|
|
78
|
+
* footer; callers must check detectDialog() first and let it auto-accept.
|
|
79
|
+
*/
|
|
80
|
+
detectMenu(): MenuOption[] | null;
|
|
38
81
|
}
|
|
39
82
|
//# sourceMappingURL=screen.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"screen.d.ts","sourceRoot":"","sources":["../../src/shell/screen.ts"],"names":[],"mappings":"AAEA,MAAM,MAAM,UAAU,GAAG,oBAAoB,CAAC;
|
|
1
|
+
{"version":3,"file":"screen.d.ts","sourceRoot":"","sources":["../../src/shell/screen.ts"],"names":[],"mappings":"AAEA,MAAM,MAAM,UAAU,GAAG,oBAAoB,CAAC;AAE9C,uFAAuF;AACvF,MAAM,WAAW,UAAU;IACzB,0CAA0C;IAC1C,KAAK,EAAE,MAAM,CAAC;IACd,4EAA4E;IAC5E,KAAK,EAAE,MAAM,CAAC;CACf;AAOD;;;;;;;;GAQG;AACH,eAAO,MAAM,eAAe,qBAAqB,CAAC;AAClD,eAAO,MAAM,aAAa,QAAS,CAAC;AACpC,eAAO,MAAM,gBAAgB,uDAAwD,CAAC;AAEtF;;;;GAIG;AACH,eAAO,MAAM,eAAe,uCAAwC,CAAC;AACrE,4EAA4E;AAC5E,eAAO,MAAM,kBAAkB,QAAoC,CAAC;AAEpE;;;;GAIG;AACH,wBAAgB,eAAe,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAK1E;AAED;;;;;;;GAOG;AACH,wBAAgB,qBAAqB,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAI1D;AAED,6EAA6E;AAC7E,wBAAgB,gBAAgB,CAAC,OAAO,EAAE,UAAU,EAAE,GAAG,MAAM,CAG9D;AAED;;;;GAIG;AACH,qBAAa,WAAW;aAMM,IAAI;aAAwB,IAAI;IAL5D,OAAO,CAAC,IAAI,CAAW;IACvB,OAAO,CAAC,UAAU,CAAc;IAChC,kGAAkG;IAClG,OAAO,CAAC,aAAa,CAAS;gBAEF,IAAI,SAAM,EAAkB,IAAI,SAAK;IAIjE,KAAK,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI;IAMzB,uDAAuD;IACvD,OAAO,IAAI,MAAM;IAIjB,IAAI,IAAI,MAAM;IAUd,2EAA2E;IAC3E,MAAM,IAAI,OAAO;IAIjB,qFAAqF;IACrF,eAAe,IAAI,OAAO;IAM1B,sCAAsC;IACtC,SAAS,IAAI,OAAO;IAIpB,YAAY,IAAI,UAAU,GAAG,IAAI;IAQjC;;;;;;;;;OASG;IACH,UAAU,IAAI,UAAU,EAAE,GAAG,IAAI;CAmClC"}
|
package/dist/shell/screen.js
CHANGED
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.ScreenModel = exports.TUI_BYPASS_PERMS = exports.TUI_PROMPT_RE = exports.TUI_BUSY_MARKER = void 0;
|
|
3
|
+
exports.ScreenModel = exports.TUI_MENU_OPTION_RE = exports.TUI_MENU_FOOTER = exports.TUI_BYPASS_PERMS = exports.TUI_PROMPT_RE = exports.TUI_BUSY_MARKER = void 0;
|
|
4
|
+
exports.parseMenuChoice = parseMenuChoice;
|
|
5
|
+
exports.extractChannelContent = extractChannelContent;
|
|
6
|
+
exports.formatMenuPrompt = formatMenuPrompt;
|
|
4
7
|
const headless_1 = require("@xterm/headless");
|
|
5
8
|
/** The TUI renders spaces as U+00A0 (non-breaking) — normalize before matching. */
|
|
6
9
|
function normalize(text) {
|
|
@@ -18,6 +21,45 @@ function normalize(text) {
|
|
|
18
21
|
exports.TUI_BUSY_MARKER = 'esc to interrupt';
|
|
19
22
|
exports.TUI_PROMPT_RE = /^❯ /m;
|
|
20
23
|
exports.TUI_BYPASS_PERMS = ['Bypass Permissions mode', 'Yes, I accept'];
|
|
24
|
+
/**
|
|
25
|
+
* Interactive select-menu footer markers (e.g. AskUserQuestion). The footer reads
|
|
26
|
+
* "Enter to select · ↑/↓ to navigate · Esc to cancel"; we match on the two stable
|
|
27
|
+
* fragments so spacing/middle-dot variations across TUI versions don't break it.
|
|
28
|
+
*/
|
|
29
|
+
exports.TUI_MENU_FOOTER = ['to navigate', 'to cancel'];
|
|
30
|
+
/** A numbered option row, with an optional leading ❯/> highlight marker. */
|
|
31
|
+
exports.TUI_MENU_OPTION_RE = /^\s*[❯>]?\s*(\d+)\.\s+(.+?)\s*$/;
|
|
32
|
+
/**
|
|
33
|
+
* Parse a user's menu reply (typed number or a button's choice payload) into a
|
|
34
|
+
* 1-based option index. Returns null for anything that isn't a leading integer
|
|
35
|
+
* within [1, count] — never trust chat input to be a valid selection.
|
|
36
|
+
*/
|
|
37
|
+
function parseMenuChoice(text, count) {
|
|
38
|
+
const m = /^\s*(\d+)/.exec(text);
|
|
39
|
+
if (!m)
|
|
40
|
+
return null;
|
|
41
|
+
const n = Number(m[1]);
|
|
42
|
+
return Number.isInteger(n) && n >= 1 && n <= count ? n : null;
|
|
43
|
+
}
|
|
44
|
+
/**
|
|
45
|
+
* Channel turns reach the wrapper wrapped in a <channel …>…</channel> envelope
|
|
46
|
+
* (see AgentRunner.buildChannelXml) — even a one-character menu reply like "1"
|
|
47
|
+
* arrives as `<channel source="telegram" …>1</channel>`. To interpret a menu
|
|
48
|
+
* selection we need the user's actual text, not the envelope, so pull out the
|
|
49
|
+
* inner content and drop any nested <replied> block. Returns the input
|
|
50
|
+
* unchanged when it is not a channel envelope (e.g. a raw API/typed reply).
|
|
51
|
+
*/
|
|
52
|
+
function extractChannelContent(text) {
|
|
53
|
+
const m = /<channel\b[^>]*>([\s\S]*)<\/channel>/.exec(text);
|
|
54
|
+
if (!m)
|
|
55
|
+
return text;
|
|
56
|
+
return m[1].replace(/<replied\b[^>]*>[\s\S]*?<\/replied>/g, '').trim();
|
|
57
|
+
}
|
|
58
|
+
/** Build the chat-facing menu prompt (also the API/number fallback text). */
|
|
59
|
+
function formatMenuPrompt(options) {
|
|
60
|
+
const lines = options.map((o, i) => `${i + 1}. ${o.label}`).join('\n');
|
|
61
|
+
return `🔢 Choose an option — tap a button below, or reply with the number:\n\n${lines}`;
|
|
62
|
+
}
|
|
21
63
|
/**
|
|
22
64
|
* Virtual terminal fed with raw PTY bytes. Used ONLY for liveness signals
|
|
23
65
|
* (busy / idle / dialog detection) — assistant text is never parsed from
|
|
@@ -72,6 +114,54 @@ class ScreenModel {
|
|
|
72
114
|
}
|
|
73
115
|
return null;
|
|
74
116
|
}
|
|
117
|
+
/**
|
|
118
|
+
* Detect an interactive select menu blocking on keyboard input (e.g. the
|
|
119
|
+
* AskUserQuestion / plan-approval prompt) and parse its numbered options.
|
|
120
|
+
* Returns the options in display order, or null when no menu is on screen.
|
|
121
|
+
*
|
|
122
|
+
* Requires the select-menu footer AND at least two numbered rows — ordinary
|
|
123
|
+
* numbered lists in assistant output never carry the footer, so this won't
|
|
124
|
+
* false-positive on them. The bypass-permissions dialog also matches the
|
|
125
|
+
* footer; callers must check detectDialog() first and let it auto-accept.
|
|
126
|
+
*/
|
|
127
|
+
detectMenu() {
|
|
128
|
+
const text = this.text();
|
|
129
|
+
if (!exports.TUI_MENU_FOOTER.every((s) => text.includes(s)))
|
|
130
|
+
return null;
|
|
131
|
+
// Scan only the region ABOVE the footer — the live menu's options always
|
|
132
|
+
// sit between the question and the "to navigate · to cancel" footer.
|
|
133
|
+
const lines = text.split('\n');
|
|
134
|
+
const footerIdx = lines.findIndex((l) => exports.TUI_MENU_FOOTER.some((s) => l.includes(s)));
|
|
135
|
+
const region = footerIdx >= 0 ? lines.slice(0, footerIdx) : lines;
|
|
136
|
+
const matches = [];
|
|
137
|
+
for (const line of region) {
|
|
138
|
+
const m = exports.TUI_MENU_OPTION_RE.exec(line);
|
|
139
|
+
if (m)
|
|
140
|
+
matches.push({ index: Number(m[1]), label: m[2].trim() });
|
|
141
|
+
}
|
|
142
|
+
if (matches.length < 2)
|
|
143
|
+
return null;
|
|
144
|
+
// Scrollback above the menu can contain stale numbered lines (e.g. a prior
|
|
145
|
+
// chat message rendered as "1. … 2. …"). The real select menu always numbers
|
|
146
|
+
// its options 1..N in order, so take the LAST run that starts at "1." and
|
|
147
|
+
// increments by one — that is the live menu nearest the footer, not history.
|
|
148
|
+
// This run's position is what selectMenuOption() types into the TUI, so it
|
|
149
|
+
// MUST mirror the on-screen numbering exactly.
|
|
150
|
+
let start = -1;
|
|
151
|
+
for (let i = 0; i < matches.length; i++) {
|
|
152
|
+
if (matches[i].index === 1)
|
|
153
|
+
start = i;
|
|
154
|
+
}
|
|
155
|
+
if (start === -1)
|
|
156
|
+
return null;
|
|
157
|
+
const run = [];
|
|
158
|
+
let expected = 1;
|
|
159
|
+
for (let i = start; i < matches.length && matches[i].index === expected; i++) {
|
|
160
|
+
run.push(matches[i]);
|
|
161
|
+
expected++;
|
|
162
|
+
}
|
|
163
|
+
return run.length >= 2 ? run : null;
|
|
164
|
+
}
|
|
75
165
|
}
|
|
76
166
|
exports.ScreenModel = ScreenModel;
|
|
77
167
|
//# sourceMappingURL=screen.js.map
|
package/dist/shell/screen.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"screen.js","sourceRoot":"","sources":["../../src/shell/screen.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"screen.js","sourceRoot":"","sources":["../../src/shell/screen.ts"],"names":[],"mappings":";;;AA4CA,0CAKC;AAUD,sDAIC;AAGD,4CAGC;AArED,8CAA2C;AAY3C,mFAAmF;AACnF,SAAS,SAAS,CAAC,IAAY;IAC7B,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,EAAE,GAAG,CAAC,CAAC;AACjC,CAAC;AAED;;;;;;;;GAQG;AACU,QAAA,eAAe,GAAG,kBAAkB,CAAC;AACrC,QAAA,aAAa,GAAG,MAAM,CAAC;AACvB,QAAA,gBAAgB,GAAG,CAAC,yBAAyB,EAAE,eAAe,CAAU,CAAC;AAEtF;;;;GAIG;AACU,QAAA,eAAe,GAAG,CAAC,aAAa,EAAE,WAAW,CAAU,CAAC;AACrE,4EAA4E;AAC/D,QAAA,kBAAkB,GAAG,iCAAiC,CAAC;AAEpE;;;;GAIG;AACH,SAAgB,eAAe,CAAC,IAAY,EAAE,KAAa;IACzD,MAAM,CAAC,GAAG,WAAW,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IACjC,IAAI,CAAC,CAAC;QAAE,OAAO,IAAI,CAAC;IACpB,MAAM,CAAC,GAAG,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;IACvB,OAAO,MAAM,CAAC,SAAS,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC;AAChE,CAAC;AAED;;;;;;;GAOG;AACH,SAAgB,qBAAqB,CAAC,IAAY;IAChD,MAAM,CAA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C,MAAM,EAAE,CAAC,EAAE,EAAE,CAAC;YACxC,IAAI,OAAO,CAAC,CAAC,CAAC,CAAC,KAAK,KAAK,CAAC;gBAAE,KAAK,GAAG,CAAC,CAAC;QACxC,CAAC;QACD,IAAI,KAAK,KAAK,CAAC,CAAC;YAAE,OAAO,IAAI,CAAC;QAC9B,MAAM,GAAG,GAAiB,EAAE,CAAC;QAC7B,IAAI,QAAQ,GAAG,CAAC,CAAC;QACjB,KAAK,IAAI,CAAC,GAAG,KAAK,EAAE,CAAC,GAAG,OAAO,CAAC,MAAM,IAAI,OAAO,CAAC,CAAC,CAAC,CAAC,KAAK,KAAK,QAAQ,EAAE,CAAC,EAAE,EAAE,CAAC;YAC7E,GAAG,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC;YACrB,QAAQ,EAAE,CAAC;QACb,CAAC;QACD,OAAO,GAAG,CAAC,MAAM,IAAI,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,IAAI,CAAC;IACtC,CAAC;CACF;AArGD,kCAqGC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"receiver.d.ts","sourceRoot":"","sources":["../../src/telegram/receiver.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,EAAE,MAAM,UAAU,CAAC;AAMvC,qBAAa,gBAAgB;
|
|
1
|
+
{"version":3,"file":"receiver.d.ts","sourceRoot":"","sources":["../../src/telegram/receiver.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,EAAE,MAAM,UAAU,CAAC;AAMvC,qBAAa,gBAAgB;IAQzB,OAAO,CAAC,QAAQ,CAAC,WAAW;IAC5B,OAAO,CAAC,QAAQ,CAAC,YAAY;IAC7B,OAAO,CAAC,QAAQ,CAAC,MAAM;IATzB,OAAO,CAAC,OAAO,CAA6B;IAC5C,OAAO,CAAC,QAAQ,CAAS;IACzB,OAAO,CAAC,YAAY,CAAK;IACzB,OAAO,CAAC,YAAY,CAA8C;IAClE,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAkC;gBAGtC,WAAW,EAAE,WAAW,EACxB,YAAY,EAAE,MAAM,EACpB,MAAM,EAAE,MAAM;IAKjC,KAAK,IAAI,IAAI;IAMb,OAAO,CAAC,YAAY;IAgCpB,OAAO,CAAC,eAAe;IAevB,IAAI,IAAI,IAAI;IASZ,SAAS,IAAI,OAAO;CAGrB"}
|
|
@@ -47,6 +47,7 @@ class TelegramReceiver {
|
|
|
47
47
|
this.process = null;
|
|
48
48
|
this.stopping = false;
|
|
49
49
|
this.restartCount = 0;
|
|
50
|
+
this.restartTimer = null;
|
|
50
51
|
this.logger = (0, logger_1.createLogger)(`${agentConfig.id}:receiver`, logDir);
|
|
51
52
|
}
|
|
52
53
|
start() {
|
|
@@ -87,13 +88,18 @@ class TelegramReceiver {
|
|
|
87
88
|
this.logger.warn(`Restarting TelegramReceiver in ${AUTO_RESTART_DELAY_MS}ms`, {
|
|
88
89
|
attempt: this.restartCount,
|
|
89
90
|
});
|
|
90
|
-
setTimeout(() => {
|
|
91
|
+
this.restartTimer = setTimeout(() => {
|
|
92
|
+
this.restartTimer = null;
|
|
91
93
|
if (!this.stopping)
|
|
92
94
|
this.spawnProcess();
|
|
93
95
|
}, AUTO_RESTART_DELAY_MS);
|
|
94
96
|
}
|
|
95
97
|
stop() {
|
|
96
98
|
this.stopping = true;
|
|
99
|
+
if (this.restartTimer) {
|
|
100
|
+
clearTimeout(this.restartTimer);
|
|
101
|
+
this.restartTimer = null;
|
|
102
|
+
}
|
|
97
103
|
this.process?.kill('SIGTERM');
|
|
98
104
|
}
|
|
99
105
|
isRunning() {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"receiver.js","sourceRoot":"","sources":["../../src/telegram/receiver.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,iDAAoD;AACpD,2CAA6B;AAE7B,sCAAyC;AAEzC,MAAM,qBAAqB,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* No external dependencies except xterm.js CDN for PTY viewer.
|
|
4
4
|
*/
|
|
5
|
-
export declare function generateDashboardHtml(): string;
|
|
5
|
+
export declare function generateDashboardHtml(dashToken?: string): string;
|
|
6
6
|
//# sourceMappingURL=web-ui.d.ts.map
|
package/dist/ui/web-ui.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"web-ui.d.ts","sourceRoot":"","sources":["../../src/ui/web-ui.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,wBAAgB,qBAAqB,
|
|
1
|
+
{"version":3,"file":"web-ui.d.ts","sourceRoot":"","sources":["../../src/ui/web-ui.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,wBAAgB,qBAAqB,CAAC,SAAS,SAAK,GAAG,MAAM,CAkxB5D"}
|