@dmsdc-ai/aigentry-telepty 0.1.49 → 0.1.50
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 +9 -5
- package/package.json +1 -1
package/daemon.js
CHANGED
|
@@ -1247,15 +1247,19 @@ busWss.on('connection', (ws, req) => {
|
|
|
1247
1247
|
}
|
|
1248
1248
|
});
|
|
1249
1249
|
|
|
1250
|
-
// Auto-router: turn_request
|
|
1251
|
-
|
|
1250
|
+
// Auto-router: turn_request → inject to target session PTY
|
|
1251
|
+
// Matches both msg.type and msg.kind (deliberation uses 'kind')
|
|
1252
|
+
const eventType = msg.type || msg.kind;
|
|
1253
|
+
const isRoutable = (eventType === 'turn_request' || eventType === 'deliberation_route_turn') && (msg.target || msg.target_session_id);
|
|
1252
1254
|
if (isRoutable) {
|
|
1253
|
-
|
|
1254
|
-
const rawTarget = msg.
|
|
1255
|
+
// Parse target: may include @host suffix (e.g. "session-001@100.x.y.z")
|
|
1256
|
+
const rawTarget = (msg.target || msg.target_session_id).split('@')[0];
|
|
1257
|
+
console.log(`[BUS-ROUTE] Received ${eventType}: target=${rawTarget}`);
|
|
1255
1258
|
const targetId = resolveSessionAlias(rawTarget);
|
|
1256
1259
|
const targetSession = targetId ? sessions[targetId] : null;
|
|
1257
1260
|
if (targetSession) {
|
|
1258
|
-
|
|
1261
|
+
// Extract prompt from payload.prompt (deliberation schema) or fallbacks
|
|
1262
|
+
const prompt = (msg.payload && msg.payload.prompt) || msg.content || msg.prompt || JSON.stringify(msg);
|
|
1259
1263
|
const inject_id = crypto.randomUUID();
|
|
1260
1264
|
|
|
1261
1265
|
// Write to session (kitty primary, WS fallback)
|