squadrant 0.10.0 → 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.10.0",
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": {
@@ -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 |