@dmsdc-ai/aigentry-telepty 0.1.72 → 0.1.73
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 +20 -1
- package/package.json +1 -1
package/daemon.js
CHANGED
|
@@ -1035,6 +1035,7 @@ app.post('/api/sessions/:id/inject', (req, res) => {
|
|
|
1035
1035
|
|
|
1036
1036
|
console.log(`[INJECT] Wrote to session ${id} (inject_id: ${inject_id})`);
|
|
1037
1037
|
|
|
1038
|
+
const injectTimestamp = new Date().toISOString();
|
|
1038
1039
|
const busMsg = JSON.stringify({
|
|
1039
1040
|
type: 'inject_written',
|
|
1040
1041
|
inject_id,
|
|
@@ -1045,12 +1046,30 @@ app.post('/api/sessions/:id/inject', (req, res) => {
|
|
|
1045
1046
|
reply_to: reply_to || null,
|
|
1046
1047
|
thread_id: thread_id || null,
|
|
1047
1048
|
reply_expected: !!reply_expected,
|
|
1048
|
-
timestamp:
|
|
1049
|
+
timestamp: injectTimestamp
|
|
1049
1050
|
});
|
|
1050
1051
|
busClients.forEach(client => {
|
|
1051
1052
|
if (client.readyState === 1) client.send(busMsg);
|
|
1052
1053
|
});
|
|
1053
1054
|
|
|
1055
|
+
// Notify all attached viewers (telepty attach clients) about the inject
|
|
1056
|
+
// This enables aterm and other viewers to show inject events in real-time
|
|
1057
|
+
if (session.clients && session.clients.size > 0) {
|
|
1058
|
+
const viewerMsg = JSON.stringify({
|
|
1059
|
+
type: 'inject_notification',
|
|
1060
|
+
inject_id,
|
|
1061
|
+
session_id: id,
|
|
1062
|
+
from: from || null,
|
|
1063
|
+
content: prompt,
|
|
1064
|
+
timestamp: injectTimestamp
|
|
1065
|
+
});
|
|
1066
|
+
session.clients.forEach(client => {
|
|
1067
|
+
if (client !== session.ownerWs && client.readyState === 1) {
|
|
1068
|
+
client.send(viewerMsg);
|
|
1069
|
+
}
|
|
1070
|
+
});
|
|
1071
|
+
}
|
|
1072
|
+
|
|
1054
1073
|
if (requestedId !== resolvedId) {
|
|
1055
1074
|
console.log(`[ALIAS] Resolved '${requestedId}' → '${resolvedId}'`);
|
|
1056
1075
|
}
|