@dmsdc-ai/aigentry-telepty 0.1.38 → 0.1.40
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/cli.js +5 -5
- package/daemon.js +8 -1
- package/package.json +1 -1
package/cli.js
CHANGED
|
@@ -744,7 +744,7 @@ async function main() {
|
|
|
744
744
|
daemonWs.on('open', () => {
|
|
745
745
|
wsReady = true;
|
|
746
746
|
if (reconnectAttempts > 0) {
|
|
747
|
-
console
|
|
747
|
+
// Silent reconnect — no console output to avoid breaking TUI rendering
|
|
748
748
|
// Force CLI redraw by triggering SIGWINCH (resize +1/-1)
|
|
749
749
|
const origCols = child.cols || process.stdout.columns || 80;
|
|
750
750
|
const origRows = child.rows || process.stdout.rows || 30;
|
|
@@ -791,7 +791,7 @@ async function main() {
|
|
|
791
791
|
reconnectAttempts++;
|
|
792
792
|
const delay = Math.min(1000 * Math.pow(2, reconnectAttempts - 1), MAX_RECONNECT_DELAY);
|
|
793
793
|
if (reconnectAttempts === 1) {
|
|
794
|
-
console
|
|
794
|
+
// Silent — no console output to avoid breaking TUI rendering
|
|
795
795
|
}
|
|
796
796
|
reconnectTimer = setTimeout(() => {
|
|
797
797
|
reconnectTimer = null;
|
|
@@ -818,9 +818,9 @@ async function main() {
|
|
|
818
818
|
// Intercept terminal title escape sequences and prefix with session ID
|
|
819
819
|
const titlePrefix = `\u26A1 ${sessionId}`;
|
|
820
820
|
function rewriteTitleSequences(output) {
|
|
821
|
-
// Match OSC title sequences
|
|
822
|
-
return output.replace(/\x1b\]([02]);([^\x07]
|
|
823
|
-
return `\x1b]${code};${titlePrefix} | ${title}
|
|
821
|
+
// Match OSC title sequences with BEL (\x07) or ST (\x1b\\) terminator
|
|
822
|
+
return output.replace(/\x1b\]([02]);([^\x07\x1b]*?)(\x07|\x1b\\)/g, (match, code, title, term) => {
|
|
823
|
+
return `\x1b]${code};${titlePrefix} | ${title}${term}`;
|
|
824
824
|
});
|
|
825
825
|
}
|
|
826
826
|
|
package/daemon.js
CHANGED
|
@@ -193,7 +193,14 @@ app.post('/api/sessions/spawn', (req, res) => {
|
|
|
193
193
|
app.post('/api/sessions/register', (req, res) => {
|
|
194
194
|
const { session_id, command, cwd = process.cwd() } = req.body;
|
|
195
195
|
if (!session_id) return res.status(400).json({ error: 'session_id is required' });
|
|
196
|
-
|
|
196
|
+
// Idempotent: allow re-registration (update command/cwd, keep clients)
|
|
197
|
+
if (sessions[session_id]) {
|
|
198
|
+
const existing = sessions[session_id];
|
|
199
|
+
if (command) existing.command = command;
|
|
200
|
+
if (cwd) existing.cwd = cwd;
|
|
201
|
+
console.log(`[REGISTER] Re-registered session ${session_id} (updated metadata)`);
|
|
202
|
+
return res.status(200).json({ session_id, type: 'wrapped', command: existing.command, cwd: existing.cwd, reregistered: true });
|
|
203
|
+
}
|
|
197
204
|
|
|
198
205
|
const sessionRecord = {
|
|
199
206
|
id: session_id,
|