squadrant 0.9.2 → 0.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/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "squadrant",
3
3
  "packageManager": "pnpm@10.30.3",
4
- "version": "0.9.2",
4
+ "version": "0.11.0",
5
5
  "description": "Multi-project orchestration for your coding agents (Claude, Codex, opencode, Gemini)",
6
6
  "type": "module",
7
7
  "bin": {
@@ -41,12 +41,13 @@
41
41
  "jsonc-parser": "^3.3.1"
42
42
  },
43
43
  "devDependencies": {
44
+ "@grammyjs/types": "3.28.0",
45
+ "@squadrant/agents": "workspace:*",
44
46
  "@squadrant/cli": "workspace:*",
45
47
  "@squadrant/core": "workspace:*",
46
- "@squadrant/agents": "workspace:*",
47
48
  "@squadrant/shared": "workspace:*",
48
- "@squadrant/workspaces": "workspace:*",
49
49
  "@squadrant/web": "workspace:*",
50
+ "@squadrant/workspaces": "workspace:*",
50
51
  "@types/node": "^22.0.0",
51
52
  "tsup": "^8.5.1",
52
53
  "typescript": "^5.7.0",
@@ -241,6 +241,75 @@ After a crew task completes:
241
241
 
242
242
  Status writes (`write-status.sh`) are opt-in; you don't need to write status after every event.
243
243
 
244
+ ## Status Board (show after substantive turns)
245
+
246
+ After a **substantive turn** — shipped a release, opened or merged a PR, filed an issue, spawned or closed crews, or moved multiple threads at once — end your reply with a tight scannable board. Skip it after trivial answers; the board is signal, not noise.
247
+
248
+ ### When to show
249
+
250
+ | Show | Skip |
251
+ |------|------|
252
+ | Opened / merged / closed a PR | Answered a quick question |
253
+ | Tagged a release or published to npm | Read a file or ran a status check |
254
+ | Filed a GitHub issue | Forwarded a one-line follow-up to an existing crew |
255
+ | Spawned or closed crew(s) | Repeated state the user just asked for |
256
+ | Multiple threads moved in one turn | |
257
+
258
+ ### Pull state fresh before writing
259
+
260
+ No memory, no approximation — run these first:
261
+
262
+ ```bash
263
+ gh pr list --state open --json number,title,headRefName,isDraft # open PRs
264
+ squadrant crew list <project> # live crews
265
+ gh release list --limit 3 # recent tags
266
+ npm view squadrant version 2>/dev/null # published version
267
+ ```
268
+
269
+ ### Board format
270
+
271
+ ```
272
+ Right now → <one sentence: what just happened and what it unblocks>
273
+
274
+ ✅ Done <completed item — note what it unblocks>
275
+ ✅ Done <another if multiple>
276
+
277
+ ⏳ In progress <crew-name> — <task + current state: idle|working|blocked>
278
+ ⏳ In progress <another crew if running>
279
+
280
+ ▶️ Next <immediate next action — specific, actionable>
281
+ ▶️ Next <secondary if clear>
282
+
283
+ 👀 Watch PR #N — <title> (draft | ready | needs review)
284
+ 👀 Watch <release or deploy or issue to monitor>
285
+ ```
286
+
287
+ ### Rules
288
+
289
+ - **Live data only.** Run the commands above; do not recall from memory. A stale board is worse than no board.
290
+ - **~20–35 lines total.** Omit rows with nothing to say — an empty ⏳ section is just noise.
291
+ - **One punchline.** The `Right now →` line is one sentence capturing the net state change.
292
+ - **Portable.** Uses `gh` and `squadrant` CLI — works for claude, codex, opencode, and gemini crews alike.
293
+
294
+ ### Replying to Telegram-originated tasks
295
+
296
+ When a task arrived from Telegram (captain pane received a message prefixed `[from Telegram]` / a `captain.message` inbound), push your answer back to that project's topic after acting:
297
+
298
+ ```bash
299
+ squadrant telegram send <project> "<answer + brief board>"
300
+ ```
301
+
302
+ **When to push:** At meaningful moments — your answer, a key decision, done/blocked. Not every line; keep it concise to avoid flooding the phone.
303
+
304
+ **What to include:** One sentence of answer or status, then a condensed board (3–5 lines: what happened, what's next, any blocker). Example:
305
+
306
+ ```
307
+ Shipped fix for #42 — merged to develop.
308
+ ✅ crew/fix-42 done ▶️ next: bump version
309
+ ```
310
+
311
+ **Portable:** uses the CLI only — works from any agent session (claude, codex, opencode, gemini).
312
+
244
313
  ## Session Shutdown (Opt-In Writes)
245
314
 
246
315
  End-of-session writes are **opt-in**, not on a schedule. Only write what is meaningful:
@@ -0,0 +1,94 @@
1
+ ---
2
+ name: telegram
3
+ description: Set up and manage the squadrant↔Telegram integration — bot setup, remote control, command-menu registration, and per-project notification tuning (mute, crew tiers, cap). Use when the user asks about Telegram setup, "why don't commands work", registering the /command menu, or muting/tuning notifications.
4
+ ---
5
+
6
+ # squadrant:telegram — Telegram Integration
7
+
8
+ Squadrant pushes crew lifecycle events to Telegram forum topics and accepts commands back from your phone.
9
+
10
+ ## Setup
11
+
12
+ Run the wizard once (re-run at any time to reconfigure):
13
+
14
+ ```bash
15
+ squadrant telegram setup
16
+ ```
17
+
18
+ The wizard will:
19
+ 1. Detect an existing bot token and reuse it (or prompt for a new one).
20
+ 2. Wait for a message in your forum supergroup to detect the group id and your user-id.
21
+ 3. Ask whether to enable **remote control** — say **yes** to capture your user-id and enable Gate 2 (command execution).
22
+
23
+ After setup, the bot's `/command` menu is registered automatically.
24
+
25
+ **Re-run setup if** `remoteControl` ended up OFF (you said no, or it was skipped). Use `--reset-token` to rotate the bot token.
26
+
27
+ ## Two Gates
28
+
29
+ | Gate | What it checks | Controls |
30
+ |------|----------------|----------|
31
+ | Gate 1 — chats allowlist | `telegram.chats` contains the chat id | Inbound messages are processed |
32
+ | Gate 2 — remoteControl + user-id | `remoteControl: true` AND sender is in `telegram.users` | Commands execute |
33
+
34
+ "⛔ not authorized" means Gate 2 is closed — re-run setup and say yes to remote control.
35
+
36
+ Reference: [`docs/diagrams/2026-06-23-telegram-daemon-architecture.html`](../docs/diagrams/2026-06-23-telegram-daemon-architecture.html)
37
+
38
+ ## Register the `/` Command Menu
39
+
40
+ Setup registers the menu automatically. To re-register on demand:
41
+
42
+ ```bash
43
+ squadrant telegram register-commands
44
+ ```
45
+
46
+ If the `/` autocomplete shows no commands in Telegram, run this command.
47
+
48
+ ## Notifications
49
+
50
+ **Live toggle (ephemeral — resets on restart):**
51
+
52
+ ```bash
53
+ squadrant telegram notify <project> on
54
+ squadrant telegram notify <project> off
55
+ ```
56
+
57
+ **Persistent preferences (written to per-project config):**
58
+
59
+ ```bash
60
+ squadrant telegram notify <project> crew <all|alert_only|done_only|none>
61
+ squadrant telegram notify <project> cap <on|off>
62
+ squadrant telegram notify --status
63
+ ```
64
+
65
+ Crew notification tiers (cumulative — each includes all below):
66
+
67
+ | Tier | What fires |
68
+ |------|-----------|
69
+ | `all` | Every crew event (started, blocked, done, failed) |
70
+ | `alert_only` | Blocked + done + failed (default) |
71
+ | `done_only` | Done + failed only |
72
+ | `none` | No crew notifications |
73
+
74
+ `cap=off` silences captain push messages (`squadrant telegram send`) for the project.
75
+
76
+ **From Telegram** (Gate 2 required):
77
+
78
+ ```
79
+ /notify crew done_only
80
+ /mute
81
+ /unmute
82
+ ```
83
+
84
+ A mute confirmation is posted to the topic when you quiet a project.
85
+
86
+ ## Troubleshooting
87
+
88
+ | Symptom | Fix |
89
+ |---------|-----|
90
+ | "⛔ not authorized" | `remoteControl` is OFF or wrong user-id — re-run `squadrant telegram setup` and say yes |
91
+ | No `/` autocomplete menu | Run `squadrant telegram register-commands` |
92
+ | Topic went silent | `squadrant telegram notify --status`; check crew tier |
93
+ | Mute not reflected | Re-run `squadrant telegram notify <project> on` |
94
+ | `createForumTopic` 400 errors | Topic already exists in state — `squadrant telegram status` to inspect links |