@dmsdc-ai/aigentry-telepty 0.1.48 → 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.
Files changed (2) hide show
  1. package/daemon.js +10 -3
  2. package/package.json +1 -1
package/daemon.js CHANGED
@@ -1248,11 +1248,18 @@ busWss.on('connection', (ws, req) => {
1248
1248
  });
1249
1249
 
1250
1250
  // Auto-router: turn_request → inject to target session PTY
1251
- if (msg.type === 'turn_request' && msg.target_session_id) {
1252
- const targetId = resolveSessionAlias(msg.target_session_id);
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);
1254
+ if (isRoutable) {
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}`);
1258
+ const targetId = resolveSessionAlias(rawTarget);
1253
1259
  const targetSession = targetId ? sessions[targetId] : null;
1254
1260
  if (targetSession) {
1255
- const prompt = msg.content || msg.prompt || JSON.stringify(msg);
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);
1256
1263
  const inject_id = crypto.randomUUID();
1257
1264
 
1258
1265
  // Write to session (kitty primary, WS fallback)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dmsdc-ai/aigentry-telepty",
3
- "version": "0.1.48",
3
+ "version": "0.1.50",
4
4
  "main": "daemon.js",
5
5
  "bin": {
6
6
  "aigentry-telepty": "install.js",