@codefilabs/tq 0.1.1 → 0.1.2

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@codefilabs/tq",
3
- "version": "0.1.1",
3
+ "version": "0.1.2",
4
4
  "description": "A lightweight task queue runner that spawns Claude AI tasks as independent tmux sessions",
5
5
  "keywords": [
6
6
  "claude",
@@ -291,10 +291,21 @@ ${MSG}"
291
291
  ROUTED=1
292
292
  fi
293
293
 
294
- # Fallback: no orchestrator spawn one-off task (legacy behavior)
294
+ # Fallback: auto-start orchestrator and route through it
295
295
  if [[ "$ROUTED" == "0" ]]; then
296
- echo "[tq-telegram-poll] no orchestrator — spawning one-off task"
297
- tq --no-chrome --prompt "$MSG"
296
+ if command -v tq-converse &>/dev/null; then
297
+ echo "[tq-telegram-poll] auto-starting orchestrator"
298
+ tq-converse start 2>&1 || true
299
+ ORCHESTRATOR_ACTIVE=1
300
+ sleep 1
301
+ # Route through orchestrator
302
+ FORMATTED_MSG="[tq-msg msg_id=${MSG_ID} chat_id=${CHAT_ID}]
303
+ ${MSG}"
304
+ tq-converse send "$FORMATTED_MSG"
305
+ else
306
+ echo "[tq-telegram-poll] tq-converse not found — spawning one-off task"
307
+ tq --no-chrome --prompt "$MSG"
308
+ fi
298
309
  fi
299
310
 
300
311
  done <<< "$MESSAGES" || true