@codefilabs/tq 0.1.2 → 0.1.3

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/package.json +1 -1
  2. package/scripts/tq-converse +12 -15
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@codefilabs/tq",
3
- "version": "0.1.2",
3
+ "version": "0.1.3",
4
4
  "description": "A lightweight task queue runner that spawns Claude AI tasks as independent tmux sessions",
5
5
  "keywords": [
6
6
  "claude",
@@ -184,12 +184,10 @@ if [[ -n "\$SLUG" ]] && command -v tq-converse &>/dev/null; then
184
184
  tq-converse update-status "\$SLUG" stopped
185
185
  fi
186
186
 
187
- if command -v tq-message &>/dev/null; then
188
- if [[ -n "\$SLUG" ]]; then
189
- tq-message --message "[\$SLUG] Session ended."
190
- else
191
- tq-message --message "Orchestrator session ended."
192
- fi
187
+ if [[ -n "\$SLUG" ]]; then
188
+ echo "[tq-converse] session \$SLUG ended"
189
+ else
190
+ echo "[tq-converse] orchestrator session ended"
193
191
  fi
194
192
  HOOKEOF
195
193
  chmod +x "$HOOKS_DIR/on-stop.sh"
@@ -200,9 +198,7 @@ HOOKEOF
200
198
  set -euo pipefail
201
199
  export PATH="/opt/homebrew/bin:/usr/local/bin:$PATH"
202
200
  NOTIFICATION="${1:-Claude Code notification}"
203
- if command -v tq-message &>/dev/null; then
204
- tq-message --message "[notification] $NOTIFICATION"
205
- fi
201
+ echo "[tq-converse] notification: $NOTIFICATION"
206
202
  HOOKEOF
207
203
  chmod +x "$HOOKS_DIR/on-notification.sh"
208
204
 
@@ -332,8 +328,7 @@ For each incoming message:
332
328
  ```bash
333
329
  tq-converse route <slug> '<message text>'
334
330
  ```
335
- Then confirm to the user via /tq-reply:
336
- `[→ slug-name] Routed your message.`
331
+ Do NOT use /tq-reply to confirm routing — the child session will reply directly.
337
332
 
338
333
  **To spawn a new session:**
339
334
  ```bash
@@ -343,8 +338,7 @@ For each incoming message:
343
338
  ```bash
344
339
  tq-converse route <slug> '<message text>'
345
340
  ```
346
- Then tell the user via /tq-reply:
347
- `[new: slug-name] Started conversation: <description>`
341
+ Do NOT use /tq-reply to confirm spawning — the child session will reply directly.
348
342
 
349
343
  4. **Track the Telegram message ID** so reply-threading works:
350
344
  ```bash
@@ -362,7 +356,7 @@ Pick short, descriptive kebab-case slugs (2-4 words):
362
356
  ## Rules
363
357
 
364
358
  - Always route or spawn — never answer the user's question yourself
365
- - Keep /tq-reply confirmations very short (one line)
359
+ - Do NOT use /tq-reply for routing/spawning confirmations only the child session replies
366
360
  - If the user says something like "in the auth thread" or "#fix-auth-bug", route to that slug
367
361
  - If a user asks to stop a session: `tq-converse stop <slug>`
368
362
  - If a user asks for status: run `tq-converse status` and share via /tq-reply
@@ -470,7 +464,9 @@ CONVEOF
470
464
  # Register in registry
471
465
  ensure_registry
472
466
  CREATED="$(date -u +%Y-%m-%dT%H:%M:%S)"
473
- registry_op set "$SLUG" "$(python3 -c "
467
+ # NOTE: Must assign to variable first — bash brace expansion breaks
468
+ # {key: val, ...} when $(python3 -c ...) is used directly as a function argument
469
+ REG_JSON="$(python3 -c "
474
470
  import json, sys
475
471
  print(json.dumps({
476
472
  'description': sys.argv[1],
@@ -482,6 +478,7 @@ print(json.dumps({
482
478
  'status': 'active'
483
479
  }))
484
480
  " "$DESCRIPTION" "$CHILD_SESSION" "$CHILD_CWD" "$CONV_DIR" "$CREATED")"
481
+ registry_op set "$SLUG" "$REG_JSON"
485
482
 
486
483
  # Track triggering message if provided
487
484
  if [[ -n "$MSG_ID" ]]; then