switchroom 0.11.1 → 0.12.1

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.
Files changed (77) hide show
  1. package/README.md +32 -16
  2. package/dist/agent-scheduler/index.js +216 -97
  3. package/dist/auth-broker/index.js +176 -97
  4. package/dist/cli/drive-write-pretool.mjs +26 -11
  5. package/dist/cli/skill-validate-pretool.mjs +7209 -0
  6. package/dist/cli/switchroom.js +45571 -42642
  7. package/dist/cli/ui/index.html +1281 -0
  8. package/dist/host-control/main.js +3628 -309
  9. package/dist/vault/approvals/kernel-server.js +207 -98
  10. package/dist/vault/broker/server.js +249 -119
  11. package/examples/personal-google-workspace-mcp/README.md +8 -3
  12. package/examples/switchroom.yaml +91 -42
  13. package/package.json +4 -3
  14. package/profiles/_base/start.sh.hbs +76 -36
  15. package/profiles/_shared/agent-self-service.md.hbs +1 -1
  16. package/profiles/default/CLAUDE.md.hbs +4 -2
  17. package/skills/file-bug/SKILL.md +6 -4
  18. package/skills/skill-creator/SKILL.md +52 -0
  19. package/skills/switchroom-cli/SKILL.md +20 -4
  20. package/skills/switchroom-install/SKILL.md +3 -3
  21. package/telegram-plugin/auth-snapshot-format.ts +9 -9
  22. package/telegram-plugin/card-format.ts +3 -3
  23. package/telegram-plugin/dist/bridge/bridge.js +112 -112
  24. package/telegram-plugin/dist/gateway/gateway.js +853 -414
  25. package/telegram-plugin/dist/server.js +162 -161
  26. package/telegram-plugin/format.ts +71 -0
  27. package/telegram-plugin/gateway/access-validator.test.ts +8 -8
  28. package/telegram-plugin/gateway/access-validator.ts +1 -1
  29. package/telegram-plugin/gateway/approval-card.test.ts +18 -18
  30. package/telegram-plugin/gateway/approval-card.ts +1 -1
  31. package/telegram-plugin/gateway/auth-command.ts +2 -2
  32. package/telegram-plugin/gateway/boot-card.ts +40 -3
  33. package/telegram-plugin/gateway/boot-probes.ts +114 -30
  34. package/telegram-plugin/gateway/diff-preview-card.test.ts +15 -15
  35. package/telegram-plugin/gateway/diff-preview-card.ts +1 -1
  36. package/telegram-plugin/gateway/drive-write-approval.test.ts +2 -2
  37. package/telegram-plugin/gateway/gateway.ts +265 -22
  38. package/telegram-plugin/gateway/update-announce.ts +167 -0
  39. package/telegram-plugin/quota-check.ts +0 -195
  40. package/telegram-plugin/recent-outbound-dedup.ts +1 -1
  41. package/telegram-plugin/registry/turns-schema.ts +1 -1
  42. package/telegram-plugin/retry-api-call.ts +24 -0
  43. package/telegram-plugin/server.ts +8 -5
  44. package/telegram-plugin/tests/auth-add-flow.test.ts +32 -3
  45. package/telegram-plugin/tests/auth-command-format2.test.ts +4 -4
  46. package/telegram-plugin/tests/auth-snapshot-format.test.ts +17 -17
  47. package/telegram-plugin/tests/auto-fallback-fleet.test.ts +10 -10
  48. package/telegram-plugin/tests/boot-probes.test.ts +90 -2
  49. package/telegram-plugin/tests/bot-runtime.test.ts +23 -1
  50. package/telegram-plugin/tests/fixtures/service-log-current-claude-code.bin +1 -1
  51. package/telegram-plugin/tests/fleet-state.test.ts +3 -2
  52. package/telegram-plugin/tests/quota-check.test.ts +0 -409
  53. package/telegram-plugin/tests/retry-api-call.test.ts +76 -0
  54. package/telegram-plugin/tests/secret-detect-audit.test.ts +1 -1
  55. package/telegram-plugin/tests/secret-detect-pipeline.test.ts +7 -6
  56. package/telegram-plugin/tests/secret-detect-suppressor-no-silent-allow.test.ts +6 -5
  57. package/telegram-plugin/tests/secret-detect.test.ts +8 -8
  58. package/telegram-plugin/tests/telegram-format.test.ts +84 -1
  59. package/telegram-plugin/tests/update-announce.test.ts +154 -0
  60. package/telegram-plugin/tests/vault-grant-inbound-builders.test.ts +8 -8
  61. package/telegram-plugin/tests/vault-request-access-tool.test.ts +51 -0
  62. package/telegram-plugin/welcome-text.ts +1 -8
  63. package/profiles/default/CLAUDE.md +0 -192
  64. package/skills/docx/scripts/office/validators/__pycache__/__init__.cpython-313.pyc +0 -0
  65. package/skills/docx/scripts/office/validators/__pycache__/base.cpython-313.pyc +0 -0
  66. package/skills/skill-creator/scripts/__pycache__/__init__.cpython-313.pyc +0 -0
  67. package/skills/skill-creator/scripts/__pycache__/generate_report.cpython-313.pyc +0 -0
  68. package/skills/skill-creator/scripts/__pycache__/improve_description.cpython-313.pyc +0 -0
  69. package/skills/skill-creator/scripts/__pycache__/run_eval.cpython-313.pyc +0 -0
  70. package/skills/skill-creator/scripts/__pycache__/run_loop.cpython-313.pyc +0 -0
  71. package/skills/skill-creator/scripts/__pycache__/utils.cpython-313.pyc +0 -0
  72. package/telegram-plugin/first-paint.ts +0 -225
  73. package/telegram-plugin/node_modules/.vite/vitest/da39a3ee5e6b4b0d3255bfef95601890afd80709/results.json +0 -1
  74. package/telegram-plugin/server.js +0 -41795
  75. package/telegram-plugin/tests/html-balanced.ts +0 -63
  76. package/telegram-plugin/tests/snapshot-serializer.ts +0 -79
  77. package/telegram-plugin/tool-error-filter.ts +0 -89
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * Format 2 — health-grouped /auth snapshot + causal auto-fallback
3
3
  * announcement. Pure functions; the gateway handles the live-API probe
4
- * (via `fetchAccountQuota({force: true})`) and the broker `listState`,
4
+ * (via the broker `probe-quota` op, #1336) and the broker `listState`,
5
5
  * then hands shaped data to these formatters.
6
6
  *
7
7
  * JTBD this module serves:
@@ -178,7 +178,7 @@ const HEALTH_TITLE: Record<AccountHealth, string> = {
178
178
  /**
179
179
  * One-line per-account summary inside its health group.
180
180
  *
181
- * pixsoul@gmail.com ● 8% / 20%
181
+ * you@example.com ● 8% / 20%
182
182
  * 5h refills 11:00 AM (in 6m) · 7d resets Sun 11:00 AM
183
183
  *
184
184
  * Two lines actually: the label/percent line and a sub-line with the
@@ -389,13 +389,13 @@ export interface FallbackAnnouncementInput {
389
389
  /**
390
390
  * Render the causal-shape fallback announcement.
391
391
  *
392
- * ✓ Switched fleet · 5-hour limit on ken
392
+ * ✓ Switched fleet · 5-hour limit on alice
393
393
  *
394
- * ken.thompson@outlookpixsoul@gmail.com
394
+ * alice@exampleyou@example.com
395
395
  * Triggered by: agent carrie
396
396
  *
397
- * ken recovers Fri 3:50 PM (in 4h 56m)
398
- * pixsoul now: 8% of 5h · 20% of 7d (plenty of headroom)
397
+ * alice recovers Fri 3:50 PM (in 4h 56m)
398
+ * you now: 8% of 5h · 20% of 7d (plenty of headroom)
399
399
  *
400
400
  * Falls back to a different shape when no eligible target was found
401
401
  * (`newLabel === null`) — see "all-blocked" branch.
@@ -588,9 +588,9 @@ function escapeHtml(s: string): string {
588
588
  * results (same length, same order), return the AccountSnapshot[] the
589
589
  * formatters need.
590
590
  *
591
- * The gateway calls this after running `Promise.all(accounts.map(a =>
592
- * fetchAccountQuota(a.label, {force: true})))` — both arrays are
593
- * caller-provided, this is just a zip + classify.
591
+ * The gateway calls this after probing quota via the broker
592
+ * `probe-quota` op (#1336) — both arrays are caller-provided, this
593
+ * is just a zip + classify.
594
594
  */
595
595
  export function buildSnapshotsFromState(
596
596
  state: ListStateData,
@@ -1,9 +1,9 @@
1
1
  /**
2
2
  * Shared formatters for Telegram status cards.
3
3
  *
4
- * Both the main progress card (`progress-card.ts`) and the pinned worker
5
- * card (`subagent-watcher.ts`) emit HTML to Telegram; before issue #94
6
- * each module had its own private copies of these helpers with subtly
4
+ * Both the main progress card (rendered via `stream-reply-handler.ts`)
5
+ * and the pinned worker card (`subagent-watcher.ts`) emit HTML to
6
+ * Telegram; before issue #94 each had its own private copies with subtly
7
7
  * different conventions:
8
8
  *
9
9
  * - `formatDuration(500)` → progress-card returned `500ms`, watcher