@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.
Files changed (2) hide show
  1. package/daemon.js +9 -5
  2. 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 / deliberation_route_turn → inject to target session PTY
1251
- const isRoutable = (msg.type === 'turn_request' || msg.type === 'deliberation_route_turn' || msg.type === 'deliberation_turn_request') && (msg.target_session_id || msg.target || msg.session_id);
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
- console.log(`[BUS-ROUTE] Received routable event: type=${msg.type} target=${msg.target_session_id || msg.target || msg.session_id}`);
1254
- const rawTarget = msg.target_session_id || msg.target || msg.session_id;
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
- 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);
1259
1263
  const inject_id = crypto.randomUUID();
1260
1264
 
1261
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.49",
3
+ "version": "0.1.50",
4
4
  "main": "daemon.js",
5
5
  "bin": {
6
6
  "aigentry-telepty": "install.js",