switchroom 0.11.0 → 0.12.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/README.md +7 -6
- package/dist/agent-scheduler/index.js +218 -99
- package/dist/auth-broker/index.js +300 -99
- package/dist/cli/drive-write-pretool.mjs +45 -12
- package/dist/cli/switchroom.js +44972 -42457
- package/dist/cli/ui/index.html +1281 -0
- package/dist/host-control/main.js +3630 -311
- package/dist/vault/approvals/kernel-server.js +209 -100
- package/dist/vault/broker/server.js +220 -99
- package/examples/personal-google-workspace-mcp/README.md +8 -3
- package/examples/switchroom.yaml +91 -42
- package/package.json +2 -2
- package/profiles/_base/start.sh.hbs +76 -36
- package/profiles/default/CLAUDE.md.hbs +4 -2
- package/skills/file-bug/SKILL.md +6 -4
- package/skills/switchroom-cli/SKILL.md +20 -4
- package/skills/switchroom-install/SKILL.md +3 -3
- package/telegram-plugin/auth-snapshot-format.ts +4 -4
- package/telegram-plugin/auto-fallback-fleet.ts +4 -4
- package/telegram-plugin/card-format.ts +3 -3
- package/telegram-plugin/dist/bridge/bridge.js +112 -112
- package/telegram-plugin/dist/gateway/gateway.js +1029 -628
- package/telegram-plugin/dist/server.js +162 -161
- package/telegram-plugin/format.ts +71 -0
- package/telegram-plugin/gateway/approval-card.test.ts +18 -18
- package/telegram-plugin/gateway/approval-card.ts +1 -1
- package/telegram-plugin/gateway/auth-broker-client.ts +2 -0
- package/telegram-plugin/gateway/auth-command.ts +12 -2
- package/telegram-plugin/gateway/boot-card.ts +40 -3
- package/telegram-plugin/gateway/boot-probes.ts +71 -27
- package/telegram-plugin/gateway/diff-preview-card.test.ts +15 -15
- package/telegram-plugin/gateway/diff-preview-card.ts +1 -1
- package/telegram-plugin/gateway/drive-write-approval.test.ts +2 -2
- package/telegram-plugin/gateway/gateway.ts +244 -46
- package/telegram-plugin/gateway/hostd-dispatch.ts +10 -2
- package/telegram-plugin/gateway/update-announce.ts +167 -0
- package/telegram-plugin/quota-check.ts +0 -195
- package/telegram-plugin/retry-api-call.ts +24 -0
- package/telegram-plugin/server.ts +8 -5
- package/telegram-plugin/tests/auth-add-flow.test.ts +31 -2
- package/telegram-plugin/tests/boot-probes.test.ts +53 -0
- package/telegram-plugin/tests/bot-runtime.test.ts +23 -1
- package/telegram-plugin/tests/quota-check.test.ts +0 -409
- package/telegram-plugin/tests/retry-api-call.test.ts +76 -0
- package/telegram-plugin/tests/telegram-format.test.ts +84 -1
- package/telegram-plugin/tests/update-announce.test.ts +154 -0
- package/telegram-plugin/welcome-text.ts +1 -8
- package/profiles/default/CLAUDE.md +0 -192
- package/skills/docx/scripts/office/validators/__pycache__/__init__.cpython-313.pyc +0 -0
- package/skills/docx/scripts/office/validators/__pycache__/base.cpython-313.pyc +0 -0
- package/skills/skill-creator/scripts/__pycache__/__init__.cpython-313.pyc +0 -0
- package/skills/skill-creator/scripts/__pycache__/generate_report.cpython-313.pyc +0 -0
- package/skills/skill-creator/scripts/__pycache__/improve_description.cpython-313.pyc +0 -0
- package/skills/skill-creator/scripts/__pycache__/run_eval.cpython-313.pyc +0 -0
- package/skills/skill-creator/scripts/__pycache__/run_loop.cpython-313.pyc +0 -0
- package/skills/skill-creator/scripts/__pycache__/utils.cpython-313.pyc +0 -0
- package/telegram-plugin/first-paint.ts +0 -225
- package/telegram-plugin/node_modules/.vite/vitest/da39a3ee5e6b4b0d3255bfef95601890afd80709/results.json +0 -1
- package/telegram-plugin/server.js +0 -41795
- package/telegram-plugin/tests/html-balanced.ts +0 -63
- package/telegram-plugin/tests/snapshot-serializer.ts +0 -79
- package/telegram-plugin/tool-error-filter.ts +0 -89
package/README.md
CHANGED
|
@@ -22,7 +22,7 @@ Every time an agent starts work, a **progress card** pins into its Telegram topi
|
|
|
22
22
|
|
|
23
23
|
No silent gaps. No ghosts. No squinting into a black box.
|
|
24
24
|
|
|
25
|
-
<p align="center"><img src="docs/diagrams/progress-card-anatomy.
|
|
25
|
+
<p align="center"><img src="docs/diagrams/progress-card-anatomy.svg" width="700" alt="Annotated progress card: pin badge, user quote, last 5 steps, collapsed older, in-flight pulse, elapsed timer, sub-agent indent"></p>
|
|
26
26
|
|
|
27
27
|
```
|
|
28
28
|
⚙️ Working… · ⏱ 12s
|
|
@@ -98,7 +98,7 @@ See [`docs/architecture.md`](docs/architecture.md) for the process model, IPC la
|
|
|
98
98
|
|
|
99
99
|
Tools that touch the world — Bash, Edit, Write, anything not on an agent's pre-approved allowlist — pause for explicit approval. Switchroom's **approval kernel** (shipped in v0.5.1) routes every gated tool call through an inline Telegram card with the actual diff or command shown. Tap Allow and the tool resumes. Tap Deny and the agent gets a clean refusal it can recover from.
|
|
100
100
|
|
|
101
|
-
<p align="center"><img src="docs/diagrams/approval-grant-flow.
|
|
101
|
+
<p align="center"><img src="docs/diagrams/approval-grant-flow.svg" width="700" alt="Approval grant flow: agent tool call pauses at the kernel, broker writes pending grant to sqlite, user taps Allow on the Telegram card, broker releases the gate, tool resumes"></p>
|
|
102
102
|
|
|
103
103
|
- **Inline cards.** Allow / Deny / Allow once / Allow for 1h. No leaving Telegram.
|
|
104
104
|
- **TTL'd grants.** "Allow Bash for 1h" expires automatically. No silent permanent escalation.
|
|
@@ -115,7 +115,7 @@ Switchroom never intercepts auth, never proxies inference, never patches the CLI
|
|
|
115
115
|
|
|
116
116
|
Each agent is a long-running service. They survive reboots, network drops, and your laptop closing. But "always on" isn't enough on its own. Things still die. The product has to handle that gracefully or the illusion breaks.
|
|
117
117
|
|
|
118
|
-
<p align="center"><img src="docs/diagrams/wake-audit-lifecycle.
|
|
118
|
+
<p align="center"><img src="docs/diagrams/wake-audit-lifecycle.svg" width="700" alt="Wake-audit lifecycle: kill, crash-pane snapshot, auto-restart, agent boots with SWITCHROOM_PENDING_TURN, acks with three options"></p>
|
|
119
119
|
|
|
120
120
|
- **Auto-restart.** Agent containers come up with `restart: unless-stopped`, and each service has a healthcheck — a crashed or wedged agent is brought back automatically. No silent dropped work.
|
|
121
121
|
- **Resume protocol.** When an agent reboots mid-turn, `start.sh` exports `SWITCHROOM_PENDING_TURN=true` plus the original chat / message ids. The agent's first action on boot is to acknowledge the gap and ask the user how to proceed (start over, summarise and continue, or drop it).
|
|
@@ -157,7 +157,7 @@ Then log out and back in so the docker group takes effect, and:
|
|
|
157
157
|
|
|
158
158
|
```bash
|
|
159
159
|
switchroom setup # interactive: Telegram + vault + first agent
|
|
160
|
-
switchroom auth add me --
|
|
160
|
+
switchroom auth add me --via-claude # OAuth into your Claude Pro/Max account, broader scope (first-time setup)
|
|
161
161
|
switchroom apply # write ~/.switchroom/compose/docker-compose.yml
|
|
162
162
|
docker compose -p switchroom -f ~/.switchroom/compose/docker-compose.yml up -d
|
|
163
163
|
```
|
|
@@ -329,10 +329,11 @@ Model aliases: the bare names `opus`, `sonnet`, `haiku` are accepted alongside t
|
|
|
329
329
|
The **Anthropic account is the unit of authentication.** One OAuth flow per account, then every agent in the fleet inherits the fleet-wide active account. The `switchroom-auth-broker` daemon owns the refresh loop and is the sole writer of every `credentials.json`. Per-account quota state fans out across the fleet in seconds. See [`docs/auth.md`](docs/auth.md) for the full operator guide.
|
|
330
330
|
|
|
331
331
|
```bash
|
|
332
|
-
switchroom auth add <label> --
|
|
332
|
+
switchroom auth add <label> --via-claude # New account, broader scope — recommended for first-time
|
|
333
|
+
switchroom auth add <label> --from-oauth # Narrow scope=user:inference (rejected by agents in server: mode)
|
|
333
334
|
switchroom auth add <label> --from-agent <name> # Seed from an existing agent's creds
|
|
334
335
|
switchroom auth add <label> --from-credentials <path> # Import a credentials.json
|
|
335
|
-
switchroom auth add <label> --
|
|
336
|
+
switchroom auth add <label> --via-claude --replace # Re-auth an existing label (drift recovery)
|
|
336
337
|
|
|
337
338
|
switchroom auth list # Accounts + health + which one is fleet-active
|
|
338
339
|
switchroom auth show [agent] # Full snapshot (fleet + agents + consumers), or one agent
|