@dmsdc-ai/aigentry-telepty 0.1.33 → 0.1.35
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/daemon.js +11 -6
- package/package.json +1 -1
package/daemon.js
CHANGED
|
@@ -429,12 +429,13 @@ function findKittyWindowId(socket, sessionId) {
|
|
|
429
429
|
for (const osw of data) {
|
|
430
430
|
for (const tab of osw.tabs) {
|
|
431
431
|
for (const w of tab.windows) {
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
432
|
+
// Only check process cmdlines for --id SESSION_ID pattern (not output text)
|
|
433
|
+
for (const p of (w.foreground_processes || [])) {
|
|
434
|
+
const cmd = (p.cmdline || []).join(' ');
|
|
435
|
+
if (cmd.includes('--id ' + sessionId) || cmd.includes('--id=' + sessionId)) {
|
|
436
|
+
return w.id;
|
|
437
|
+
}
|
|
438
|
+
}
|
|
438
439
|
}
|
|
439
440
|
}
|
|
440
441
|
}
|
|
@@ -607,6 +608,10 @@ app.post('/api/sessions/:id/inject', (req, res) => {
|
|
|
607
608
|
if (from && !prompt.startsWith('[from:')) {
|
|
608
609
|
finalPrompt = `[from: ${from}] [reply-to: ${reply_to}] ${prompt}`;
|
|
609
610
|
}
|
|
611
|
+
// Append reply guide when reply_to is set (self-contained reply instructions)
|
|
612
|
+
if (reply_to && reply_to !== id) {
|
|
613
|
+
finalPrompt += `\n\n---\n[reply-to: ${reply_to}] 위 세션에 회신이 필요합니다. 답변 시 아래 명령을 실행하세요:\ntelepty inject --from ${id} ${reply_to} "답변 내용"\n---`;
|
|
614
|
+
}
|
|
610
615
|
const inject_id = crypto.randomUUID();
|
|
611
616
|
try {
|
|
612
617
|
// Always inject text WITHOUT \r first, then send \r separately after delay
|