greprag 5.10.1 → 5.11.0

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.
@@ -1,24 +1,30 @@
1
1
  ---
2
- name: discord
2
+ name: commander
3
3
  description: |
4
- Discord DM bridge for greprag. Pair your Discord account once, then DM the
5
- bot to talk to the agent in any open Claude session. Handoff temporarily
6
- pins your DMs to one specific session say "let's continue on Discord"
7
- before stepping away from the desk and your phone keeps the same thread
8
- alive.
9
-
10
- Use when: "/discord", "discord", "pair my discord", "step away", "let's
11
- continue on discord", "let's continue on phone", "DM me", "handoff to
12
- discord", "discord handoff", "discord status", "am I paired", "what's my
13
- discord state", "I'm going for a walk", "I'll be afk".
4
+ Field-commander interface over greprag's Discord DM bridge. Pair your
5
+ Discord account once, then DM the bot to put any open Claude session
6
+ under your command from your phone. `/commander handoff` pins your DMs
7
+ to one specific session say "step away" or "I'm going for a walk"
8
+ and the thread follows you off the desk. Emergency router: if you DM
9
+ the bot without a handoff active, the bot auto-links to the most
10
+ recently armed session under your tenant so you can still issue
11
+ orders ("find a commander in the midst of battle").
12
+
13
+ Use when: "/commander", "commander", "step away", "let's continue on
14
+ phone", "DM me", "handoff", "pair my discord", "commander status",
15
+ "am I paired", "what's my discord state", "I'm going for a walk",
16
+ "I'll be afk", "commander handoff", "find a session for me", "any
17
+ session to take this DM".
14
18
  metadata:
15
19
  author: travsteward
16
- version: "1.0.0"
20
+ version: "2.0.0"
17
21
  repository: https://github.com/travsteward/greprag
18
22
  license: MIT
19
23
  ---
20
24
 
21
- # Discord DM bridge
25
+ # Commander — Discord DM bridge
26
+
27
+ The operator commands an open Claude session from Discord. The Discord side is the *channel*; "commander" is the *role* the operator inhabits when the DMs land.
22
28
 
23
29
  The agent runs `greprag discord me` to learn the current state, then branches into pair / handoff / status. Everything else is one shell command per branch.
24
30
 
@@ -96,7 +102,7 @@ Tell the user (orchestrator mode): "Orchestrator pinned for 60 min. I now see in
96
102
 
97
103
  ## Step 4 — Replying to inbound DMs
98
104
 
99
- Each Monitor notification carries the full event payload: `body` is the user's message text, `references.discord.snowflake` is their Discord ID.
105
+ Each Monitor notification carries the full event payload: `body` is the user's message text, `references.discord.snowflake` is their Discord ID, and `references.discord.emergency_route` is non-null when the bot auto-routed an unassigned DM here (see Step 4b).
100
106
 
101
107
  Send your reply via the CLI:
102
108
 
@@ -106,6 +112,16 @@ greprag send --to discord:<snowflake> "your reply text"
106
112
 
107
113
  The CLI uses Node fetch (UTF-8 native) — em-dashes, curly quotes, emoji all render correctly. **Do NOT use curl from bash on Windows** for Discord sends — the local code page (Win-1252) mangles non-ASCII bytes into `?` on the user's phone.
108
114
 
115
+ ## Step 4b — Emergency-routed DMs (self-identify before answering)
116
+
117
+ If `references.discord.emergency_route` is non-null, this session was auto-linked because no handoff pin was active. The user may have meant to reach a different session. **Open your first reply by self-identifying** so the operator can redirect if needed.
118
+
119
+ Example first reply:
120
+
121
+ > Picked this up in `<project-name>` / session `<session-8hex>` (no handoff was active, so I'm the most-recent armed watcher). Auto-pin is 10 min — slides while you keep replying. Want to redirect? `/commander handoff` from another session, or just say "redirect to <project>".
122
+
123
+ The auto-pin TTL is short (10 min) and slides forward 30 min with each subsequent DM, so a real conversation keeps flowing here. If the operator goes quiet for the TTL window, the pin expires and the next DM re-runs the router (possibly landing in a different session if the topology has changed).
124
+
109
125
  For long agent turns where you're drafting >10s, refresh the typing indicator between work steps:
110
126
 
111
127
  ```bash
@@ -535,9 +535,11 @@ greprag corpus delete "<store>" --yes
535
535
 
536
536
  Odyssey is the agent's own past. Corpus is everything else.
537
537
 
538
- ## Step 5g — Discord DM bridge (talk to the user via Discord)
538
+ ## Step 5g — Commander (Discord DM bridge talk to the user from their phone)
539
539
 
540
- When the user wants to step away from the desk and continue the conversation on their phone, route the thread through the greprag Discord bot. There are two surfaces — one-time pairing (identity) and per-session handoff (active routing).
540
+ For the full operator-facing flow see `/commander` (skill at `~/.claude/skills/commander/SKILL.md`). This section is the orchestrator-side summary so a greprag session can drive the same surface without loading the commander skill explicitly.
541
+
542
+ When the user wants to step away from the desk and continue the conversation on their phone, route the thread through the greprag Discord bot. There are two surfaces — one-time pairing (identity) and per-session handoff (active routing). Plus an emergency-router fallback: if the user DMs the bot with no handoff active, the bot auto-links to the most-recently-attached session watcher under their tenant. Tag `references.discord.emergency_route` on the inbox row flags the auto-link; reply with self-identification on first response.
541
543
 
542
544
  ### Pairing (one-time per tenant)
543
545
 
@@ -6,7 +6,7 @@ The `pre-spawn-check` PreToolUse hook **validates** chip prompts at the spawn bo
6
6
 
7
7
  - `title: "Chip: <verb-phrase>"` — `Chip: ` prefix enforced.
8
8
  - `prompt:` — Block 1 + task body + Block 2 (templates below).
9
- - `cwd:` — optional, lands the chip in a different project root.
9
+ - `cwd:` — optional, lands the chip in a different project root. Repo paths: `~/.greprag/projects.json`.
10
10
 
11
11
  Add `mode: interactive` as the first line of the task body to pause the chip for human reply (default is autonomous).
12
12