@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 +1 -1
- package/scripts/tq-telegram-poll +14 -3
package/package.json
CHANGED
package/scripts/tq-telegram-poll
CHANGED
|
@@ -291,10 +291,21 @@ ${MSG}"
|
|
|
291
291
|
ROUTED=1
|
|
292
292
|
fi
|
|
293
293
|
|
|
294
|
-
# Fallback:
|
|
294
|
+
# Fallback: auto-start orchestrator and route through it
|
|
295
295
|
if [[ "$ROUTED" == "0" ]]; then
|
|
296
|
-
|
|
297
|
-
|
|
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
|