switchroom 0.8.1 → 0.10.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 +49 -57
- package/bin/timezone-hook.sh +9 -7
- package/dist/agent-scheduler/index.js +285 -45
- package/dist/auth-broker/index.js +13932 -0
- package/dist/cli/switchroom.js +15931 -12778
- package/dist/host-control/main.js +582 -43
- package/dist/vault/approvals/kernel-server.js +276 -47
- package/dist/vault/broker/server.js +333 -69
- package/examples/minimal.yaml +63 -0
- package/examples/personal-google-workspace-mcp/.env.example +34 -0
- package/examples/personal-google-workspace-mcp/README.md +194 -0
- package/examples/personal-google-workspace-mcp/compose.yaml +66 -0
- package/examples/switchroom.yaml +220 -0
- package/package.json +6 -4
- package/profiles/_base/start.sh.hbs +3 -3
- package/profiles/_shared/agent-self-service.md.hbs +126 -0
- package/profiles/default/CLAUDE.md +10 -0
- package/profiles/default/CLAUDE.md.hbs +16 -0
- package/skills/buildkite-agent-infrastructure/SKILL.md +30 -11
- package/skills/buildkite-agent-runtime/SKILL.md +44 -11
- package/skills/buildkite-api/SKILL.md +31 -8
- package/skills/buildkite-cli/SKILL.md +27 -9
- package/skills/buildkite-migration/SKILL.md +22 -9
- package/skills/buildkite-pipelines/SKILL.md +26 -9
- package/skills/buildkite-secure-delivery/SKILL.md +23 -9
- package/skills/buildkite-test-engine/SKILL.md +25 -8
- package/skills/docx/SKILL.md +1 -1
- package/skills/file-bug/SKILL.md +34 -6
- package/skills/humanizer/SKILL.md +15 -0
- package/skills/humanizer-calibrate/SKILL.md +7 -1
- package/skills/mcp-builder/SKILL.md +1 -1
- package/skills/pdf/SKILL.md +1 -1
- package/skills/pptx/SKILL.md +1 -1
- package/skills/skill-creator/SKILL.md +21 -1
- 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/skills/switchroom-cli/SKILL.md +63 -64
- package/skills/switchroom-health/SKILL.md +23 -10
- package/skills/switchroom-install/SKILL.md +3 -3
- package/skills/switchroom-manage/SKILL.md +26 -19
- package/skills/switchroom-runtime/SKILL.md +67 -15
- package/skills/switchroom-status/SKILL.md +26 -1
- package/skills/telegram-test-harness/SKILL.md +3 -0
- package/skills/webapp-testing/SKILL.md +31 -1
- package/skills/xlsx/SKILL.md +1 -1
- package/telegram-plugin/admin-commands/index.ts +7 -5
- package/telegram-plugin/dist/gateway/gateway.js +13042 -12844
- package/telegram-plugin/gateway/auth-add-flow.ts +326 -0
- package/telegram-plugin/gateway/auth-broker-client.ts +75 -0
- package/telegram-plugin/gateway/auth-command.ts +794 -0
- package/telegram-plugin/gateway/auth-line.ts +123 -0
- package/telegram-plugin/gateway/boot-card.ts +22 -36
- package/telegram-plugin/gateway/boot-probes.ts +3 -3
- package/telegram-plugin/gateway/gateway.ts +313 -798
- package/telegram-plugin/gateway/hostd-dispatch.ts +117 -0
- package/telegram-plugin/hooks/tool-label-pretool.mjs +11 -0
- package/telegram-plugin/hooks/wedge-detect-posttool.mjs +303 -0
- package/telegram-plugin/permission-title.ts +56 -0
- package/telegram-plugin/quota-check.ts +19 -41
- package/telegram-plugin/scripts/build.mjs +0 -1
- package/telegram-plugin/shared/bot-runtime.ts +5 -4
- package/telegram-plugin/tests/auth-add-flow.test.ts +559 -0
- package/telegram-plugin/tests/auth-code-redact.test.ts +8 -4
- package/telegram-plugin/tests/auth-command-vernacular.test.ts +531 -0
- package/telegram-plugin/tests/boot-probes.test.ts +11 -4
- package/telegram-plugin/tests/hostd-dispatch.test.ts +129 -0
- package/telegram-plugin/tests/permission-title.test.ts +31 -0
- package/telegram-plugin/tests/quota-check.test.ts +5 -35
- package/telegram-plugin/uat/SETUP.md +31 -1
- package/telegram-plugin/uat/runners/agent-self-sufficiency.ts +457 -0
- package/telegram-plugin/uat/runners/paraphrases.ts +231 -0
- package/telegram-plugin/uat/runners/report.ts +150 -0
- package/telegram-plugin/uat/runners/run-agent-self-sufficiency.sh +50 -0
- package/telegram-plugin/uat/runners/scorer.test.ts +196 -0
- package/telegram-plugin/uat/runners/scorer.ts +106 -0
- package/telegram-plugin/uat/runners/skill-coverage.test.ts +100 -0
- package/telegram-plugin/uat/runners/skill-coverage.ts +620 -0
- package/telegram-plugin/uat/scenarios/jtbd-interrupt-marker-dm.test.ts +7 -1
- package/telegram-plugin/uat/scenarios/jtbd-rapid-followup-dm.test.ts +7 -1
- package/telegram-plugin/auth-dashboard.ts +0 -1104
- package/telegram-plugin/auth-slot-parser.ts +0 -497
- package/telegram-plugin/dist/foreman/foreman.js +0 -31358
- package/telegram-plugin/foreman/foreman-create-flow.ts +0 -202
- package/telegram-plugin/foreman/foreman-handlers.ts +0 -493
- package/telegram-plugin/foreman/foreman.ts +0 -1165
- package/telegram-plugin/foreman/setup-flow.ts +0 -345
- package/telegram-plugin/foreman/setup-state.ts +0 -239
- package/telegram-plugin/foreman/state.ts +0 -203
- package/telegram-plugin/tests/auth-account-identity-surface.test.ts +0 -118
- package/telegram-plugin/tests/auth-dashboard-edge-cases.test.ts +0 -260
- package/telegram-plugin/tests/auth-dashboard-restart-flow.test.ts +0 -140
- package/telegram-plugin/tests/auth-dashboard-v3b.test.ts +0 -559
- package/telegram-plugin/tests/auth-dashboard.test.ts +0 -1045
- package/telegram-plugin/tests/auth-slot-commands.test.ts +0 -640
- package/telegram-plugin/tests/boot-card-account-quota.test.ts +0 -137
- package/telegram-plugin/tests/foreman-create-flow.test.ts +0 -359
- package/telegram-plugin/tests/foreman-handlers.test.ts +0 -347
- package/telegram-plugin/tests/foreman-state.test.ts +0 -164
- package/telegram-plugin/tests/foreman-write-ops.test.ts +0 -214
- package/telegram-plugin/tests/setup-flow.test.ts +0 -510
- package/telegram-plugin/tests/setup-state.test.ts +0 -146
|
@@ -1,21 +1,49 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: switchroom-runtime
|
|
3
3
|
description: |
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
audit
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
4
|
+
Use ONLY when the user is asking the AGENT ITSELF about its own
|
|
5
|
+
runtime state in a specific runtime-context — i.e. the message
|
|
6
|
+
refers to an actual crash, restart, hand-off resume, or mid-turn
|
|
7
|
+
interrupt event. Required disambiguator: the prompt must reference
|
|
8
|
+
one of these runtime-specific signals — "why did you restart",
|
|
9
|
+
"did you crash", "you went away", "stop you mid-turn", "interrupt
|
|
10
|
+
you", "are you still there after the restart", "resume the
|
|
11
|
+
interrupted turn", "wake audit", "owed reply", "clean-shutdown"
|
|
12
|
+
— OR start with the hard-prefix "For switchroom runtime hand-offs,".
|
|
13
|
+
Also invoked on boot signals: SWITCHROOM_PENDING_TURN=true
|
|
14
|
+
(interrupted-turn resume) or sentinel file
|
|
15
|
+
$TELEGRAM_STATE_DIR/.wake-audit-pending (wake audit: scan for
|
|
16
|
+
owed replies, orphan sub-agents, stale todos before answering).
|
|
17
|
+
Triggers on phrasings like "Why did you restart, please.", "you
|
|
18
|
+
went away.", "can I stop you mid-turn.", "why did you restart.",
|
|
19
|
+
"how do I interrupt you", "did you crash?", indirect signals like
|
|
20
|
+
"the switchroom-runtime thing is weird", "something is going on
|
|
21
|
+
with switchroom-runtime", and typo'd variants such as "stil there
|
|
22
|
+
after restart?". Whenever the user's message starts with the
|
|
23
|
+
phrase "For switchroom runtime hand-offs," — regardless of what
|
|
24
|
+
follows — use this skill. Surface the audit trail from
|
|
25
|
+
clean-shutdown.json + container/journal logs.
|
|
26
|
+
CRITICAL NEGATIVE GUARD — bare terse pings like "still there?",
|
|
27
|
+
"any update?", "alive?", "you there?" are NOT sufficient on their
|
|
28
|
+
own; they only route here when they appear AFTER an unexplained
|
|
29
|
+
silence the agent should have explained (a real restart / crash
|
|
30
|
+
event), not as conversational opener. When unsure, do NOT fire.
|
|
31
|
+
Do NOT use for "reprovision my agents", "reinstall my agents",
|
|
32
|
+
"manage my agents", "add a new agent", "remove an agent" — those
|
|
33
|
+
are about the fleet, use `switchroom-manage`. Do NOT use when the
|
|
34
|
+
user's message starts with "In switchroom (the CLI),", "In
|
|
35
|
+
switchroom agent management,", or any other rival hard-prefix —
|
|
36
|
+
those prefixes win over this skill. Do NOT use for "sync my
|
|
37
|
+
config", "apply my config changes", "Please sync my config.",
|
|
38
|
+
"upgrade switchroom", "Upgrade switchroom, please.", "what version
|
|
39
|
+
is running", "what version", "apply my config", "check the
|
|
40
|
+
journal", "logs", "show me the logs" — those are CLI operations,
|
|
41
|
+
use `switchroom-cli`. Do NOT use for filing a bug or reporting an
|
|
42
|
+
issue on GitHub — that's `file-bug`. Do NOT use for "what's wrong"
|
|
43
|
+
/ health-check style diagnostics — that's `switchroom-health`.
|
|
44
|
+
Do NOT use for normal Telegram conversation, formatting questions,
|
|
45
|
+
voice/sticker/Telegraph behavior, MCP tool questions, or persona /
|
|
46
|
+
voice / Execution-Bias rules — those live in your always-loaded
|
|
19
47
|
CLAUDE.md.
|
|
20
48
|
allowed-tools: Bash Read Grep
|
|
21
49
|
---
|
|
@@ -137,3 +165,27 @@ Your response should:
|
|
|
137
165
|
Pre-emptively reach for `/file-bug` only when the user clearly indicates they want it filed. Don't auto-file from a single "status?". That creates noise. The offer-then-confirm shape is the right friction.
|
|
138
166
|
|
|
139
167
|
The companion telemetry already in place (`gateway.ts` logs every `status?` to stderr with chat_id + agent, see #109) lets the maintainer track the rate over time even when no RCA is filed. Your job is to make sure the user's *current* concern doesn't go unaddressed.
|
|
168
|
+
|
|
169
|
+
---
|
|
170
|
+
|
|
171
|
+
## Bash shell wedge — KillBash, then ask for restart
|
|
172
|
+
|
|
173
|
+
**Trigger:** you receive a tool-result preamble from the framework that says `[wedge-detect] N consecutive empty-result Bash calls`, OR you notice trivial Bash calls (`echo ok`, `true`, `ls`) returning exit-1 with empty stdout/stderr two or three times in a row.
|
|
174
|
+
|
|
175
|
+
This is **the persistent-shell wedge.** Claude Code keeps a single `bash` subprocess per session for state continuity (so `cd` carries across calls). When that shell's IO state desyncs (typically after a long-running or interrupted command like `npm test` that was `!`-interrupted) every subsequent Bash call comes back exit-1-empty. Even `true` fails. The wedge is sticky for the session.
|
|
176
|
+
|
|
177
|
+
**Do not retry the same command.** The shell is dead to you; loops just burn the user's time. Two recovery steps in order:
|
|
178
|
+
|
|
179
|
+
1. **Try `KillBash`.** Claude Code exposes a `KillBash` tool that drops the wedged shell session; the next Bash call gets a fresh shell. This works in some wedge modes but not all (sentinel-parsing wedges sometimes don't release until a full session restart). Worth trying first because it's cheap.
|
|
180
|
+
|
|
181
|
+
2. **Ask the user for `switchroom agent restart <self>`.** If `KillBash` didn't recover (next Bash call is still exit-1-empty), the persistent shell needs the whole `claude` process to restart. Tell the user on Telegram with `accent: 'issue'`:
|
|
182
|
+
|
|
183
|
+
> ⚠️ Issue
|
|
184
|
+
>
|
|
185
|
+
> My Bash shell is wedged. Every command including `true` returns exit-1 with empty output. Tried `KillBash`, didn't recover. Run `switchroom agent restart <self>` on the host to bounce me. State that survives the restart: Hindsight memory, handoff briefing, Telegram history. State that doesn't: anything I was about to write that's not yet on disk.
|
|
186
|
+
|
|
187
|
+
Adapt the wording.
|
|
188
|
+
|
|
189
|
+
**Triggering causes to avoid.** The wedge most often follows: (a) a long `npm test` / `bun test` run, (b) any command that was `!`-interrupted mid-flight, (c) heredoc-style commands the shell's stdin couldn't fully consume. Prevention: dispatch heavy test suites to a worker sub-agent (so the wedge dies with the worker) rather than running them in your own session, and use `run_in_background: true` for long jobs.
|
|
190
|
+
|
|
191
|
+
A sentinel file at `$TELEGRAM_STATE_DIR/wedge-detected.json` records the most recent wedge detection. Operators can `cat` it for forensic timestamps; you don't normally need to read it yourself.
|
|
@@ -1,6 +1,31 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: switchroom-status
|
|
3
|
-
description:
|
|
3
|
+
description: >
|
|
4
|
+
List running switchroom agents with their uptime, model, and per-agent
|
|
5
|
+
state. Strictly the "what's running and for how long" snapshot — nothing
|
|
6
|
+
about install, restart, health, version, or update.
|
|
7
|
+
Triggers ONLY on natural phrasings about listing/snapshotting agents and
|
|
8
|
+
uptime, including: "Can you show me the fleet?", "Show me the fleet,
|
|
9
|
+
please.", "Let's list switchroom agents.",
|
|
10
|
+
"Let's how long has X been up.", "I need to how long has X been up.",
|
|
11
|
+
"I'd like to what's the uptime of each agent.",
|
|
12
|
+
"any way to list switchroom agents?",
|
|
13
|
+
"quick q — can i show me the fleet",
|
|
14
|
+
"pls per-agent snapshot", and typo'd variants like "per-agent snapshot",
|
|
15
|
+
"per-agents napshot", "list swtchroom agents".
|
|
16
|
+
Also fires on indirect signals like "how's the fleet doing",
|
|
17
|
+
"what's alive right now", "is anything running right now".
|
|
18
|
+
Do NOT use when the user is asking about anything OTHER than a running-
|
|
19
|
+
agent list / uptime snapshot. In particular:
|
|
20
|
+
- "fresh install / bootstrap / first-time setup" → `switchroom-install`.
|
|
21
|
+
- "start / stop / restart / crash / interrupt an agent",
|
|
22
|
+
"apply my config", "what version is running" → `switchroom-runtime`.
|
|
23
|
+
- "manage / add / remove / rename agents", "edit memory / SOUL.md /
|
|
24
|
+
CLAUDE.md", "set per-agent config" → `switchroom-manage`.
|
|
25
|
+
- "what's wrong / diagnose / health check / troubleshoot /
|
|
26
|
+
my agents are broken / something's wrong" → `switchroom-health`.
|
|
27
|
+
If the prompt is ambiguous between status and any of the above rivals,
|
|
28
|
+
do NOT fire — pick the rival.
|
|
4
29
|
---
|
|
5
30
|
|
|
6
31
|
# Agent Status
|
|
@@ -11,6 +11,9 @@ description: >
|
|
|
11
11
|
bot-api.harness, GrammyError, e2e telegram, telegram regression
|
|
12
12
|
test, or asks how to add a test for code that calls bot.api.* or
|
|
13
13
|
handles incoming Telegram updates.
|
|
14
|
+
Do NOT use for live progress-card behavior or telegram-plugin runtime
|
|
15
|
+
questions — this is strictly for writing Bun tests under
|
|
16
|
+
`telegram-plugin/tests/`.
|
|
14
17
|
---
|
|
15
18
|
|
|
16
19
|
# Telegram test harness (switchroom)
|
|
@@ -1,6 +1,36 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: webapp-testing
|
|
3
|
-
description:
|
|
3
|
+
description: >
|
|
4
|
+
Toolkit for interacting with and testing local web applications using
|
|
5
|
+
Playwright. Use when the user wants to: spin up a local server and
|
|
6
|
+
test it, run a Playwright test, view browser logs, capture a browser
|
|
7
|
+
screenshot, click through a UI, automate a dashboard, snapshot a
|
|
8
|
+
frontend, or verify any frontend behaviour end-to-end. Triggers on
|
|
9
|
+
phrasings: "Please spin up a local server and test it.", "I'd like
|
|
10
|
+
to run a Playwright test.", "Can you run a Playwright test?", "Help
|
|
11
|
+
me view browser logs.", "capture a browser screenshot", "click
|
|
12
|
+
through my UI", "test the frontend", "Help me spin up a local server
|
|
13
|
+
and test it.", "Let's spin up a local server and test it.", "any way
|
|
14
|
+
to test the frontend?", "pls capture a browser screenshot", "gonna
|
|
15
|
+
need to test a local web app", and typo'd variants like "run a
|
|
16
|
+
Playwwright test", "capture a browesr screenshot", "test a local
|
|
17
|
+
web app". Whenever the user's message starts with the phrase "For
|
|
18
|
+
browser-based webapp testing with Playwright," — regardless of what
|
|
19
|
+
follows — use this skill.
|
|
20
|
+
Triggers on natural phrasings including: "Please spin up a local server
|
|
21
|
+
and test it.", "Help me spin up a local server and test it.",
|
|
22
|
+
"Let's spin up a local server and test it.", "I'd like to run a
|
|
23
|
+
Playwright test.", "Can you run a Playwright test?", "Help me view
|
|
24
|
+
browser logs.", "any way to test the frontend?", "pls capture a browser
|
|
25
|
+
screenshot", "gonna need to test a local web app", and typo'd variants
|
|
26
|
+
like "run a Playwwright test", "capture a browesr screenshot",
|
|
27
|
+
"test a local web app".
|
|
28
|
+
Also fires when the user says "click through my UI", "automate this
|
|
29
|
+
dashboard", "snapshot the frontend", or mentions Playwright, headless
|
|
30
|
+
Chromium, browser automation, frontend e2e tests, or a `localhost:<port>`
|
|
31
|
+
webapp that needs end-to-end exercise.
|
|
32
|
+
Do NOT use for Telegram Bot-API tests (`telegram-test-harness`),
|
|
33
|
+
CLI/unit tests (vitest under `tests/`), or non-web UI testing.
|
|
4
34
|
license: Complete terms in LICENSE.txt
|
|
5
35
|
---
|
|
6
36
|
|
package/skills/xlsx/SKILL.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: xlsx
|
|
3
|
-
description: "
|
|
3
|
+
description: "Create, read, edit, or transform Excel and CSV spreadsheets (.xlsx, .xlsm, .csv, .tsv). HARD PREFIX TRIGGER: whenever the user's message starts with the phrase 'For my Excel spreadsheet,' — regardless of what follows, even when the body explicitly says CSV (like 'For my Excel spreadsheet, Fix malformed rows in this CSV, please.') — use this skill. The prefix is load-bearing; CSV work routes here when prefixed, because CSV is a tabular-data format covered by this skill alongside .xlsx/.xlsm/.tsv. Use any time a spreadsheet file is the primary input or output. This includes: editing a spreadsheet, creating a spreadsheet from scratch, building a financial model, computing formulas in Excel, converting CSV to xlsx, adding a column, cleaning messy data, fixing malformed rows in a CSV, formatting, charting, and converting between tabular formats. Triggers on phrasings: \"I'd like to edit a spreadsheet.\", 'Help me create a spreadsheet from scratch.', \"Let's build a financial model.\", 'Fix malformed rows in this CSV, please.', 'Fix malformed rows in this CSV.', 'compute formulas in Excel', 'convert CSV to xlsx', 'add a column', 'clean this messy data', 'Open this xlsx, please.', 'Compute formulas in Excel, please.', 'pls convert CSV to xlsx', 'pls add columns to a CSV', 'any way to fix malformed rows in this CSV?', and typo'd variants like 'build a finnacial model', 'fix malfored rows in this CSV', 'compute ormulas in Excel'. Also fires on indirect signals like 'this csv is a mess', 'the columns are all wrong in this sheet', 'I need to crunch some numbers in a sheet'. Trigger especially when the user references a spreadsheet file by name or path — even casually (like \"the xlsx in my downloads\") — and wants something done to it or produced from it. Also trigger for cleaning or restructuring messy tabular data files (malformed rows, misplaced headers, junk data) into proper spreadsheets. The deliverable must be a spreadsheet file. Do NOT trigger when the primary deliverable is a Word document (`docx`), presentation (`pptx`), PDF (`pdf`), HTML report, standalone Python script, database pipeline, or Google Sheets API integration, even if tabular data is involved."
|
|
4
4
|
license: Proprietary. LICENSE.txt has complete terms
|
|
5
5
|
---
|
|
6
6
|
|
|
@@ -21,11 +21,13 @@
|
|
|
21
21
|
* middleware (via `makeAdminCommandMiddleware`) BEFORE its bot.command() calls;
|
|
22
22
|
* the middleware redirects to handleInbound when admin=false.
|
|
23
23
|
*
|
|
24
|
-
* Out of scope
|
|
25
|
-
*
|
|
26
|
-
* `/create-agent`
|
|
27
|
-
*
|
|
28
|
-
* foreman
|
|
24
|
+
* Out of scope
|
|
25
|
+
* ────────────
|
|
26
|
+
* `/create-agent` is a multi-turn wizard for onboarding a new agent
|
|
27
|
+
* from Telegram. Not implemented — operators run `switchroom agent
|
|
28
|
+
* add <name>` on the host. (The standalone foreman bot used to host
|
|
29
|
+
* this wizard; it was retired since the gateway-intercept model
|
|
30
|
+
* supersedes it.)
|
|
29
31
|
*/
|
|
30
32
|
|
|
31
33
|
/**
|