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.
- package/dist/commands/init.js +58 -9
- package/dist/commands/init.js.map +1 -1
- package/dist/commands/skill.d.ts +1 -0
- package/dist/commands/skill.js +172 -0
- package/dist/commands/skill.js.map +1 -0
- package/dist/hook.d.ts +1 -17
- package/dist/hook.js +19 -143
- package/dist/hook.js.map +1 -1
- package/dist/index.js +7 -0
- package/dist/index.js.map +1 -1
- package/dist/session-id.d.ts +19 -3
- package/dist/session-id.js +75 -5
- package/dist/session-id.js.map +1 -1
- package/package.json +1 -1
- package/scripts/postinstall.js +42 -25
- package/skill/{discord → commander}/SKILL.md +30 -14
- package/skill/greprag/SKILL.md +4 -2
- package/skill/templates/chip-spawn.md +1 -1
|
@@ -1,24 +1,30 @@
|
|
|
1
1
|
---
|
|
2
|
-
name:
|
|
2
|
+
name: commander
|
|
3
3
|
description: |
|
|
4
|
-
Discord DM bridge
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
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: "
|
|
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
|
package/skill/greprag/SKILL.md
CHANGED
|
@@ -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
|
|
538
|
+
## Step 5g — Commander (Discord DM bridge — talk to the user from their phone)
|
|
539
539
|
|
|
540
|
-
|
|
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
|
|