switchroom 0.21.7 → 0.21.9
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/bin/tmp-reaper.sh +234 -0
- package/dist/agent-scheduler/index.js +1 -1
- package/dist/auth-broker/index.js +2 -2
- package/dist/cli/notion-write-pretool.mjs +1 -1
- package/dist/cli/switchroom.js +3520 -2782
- package/dist/host-control/main.js +177 -13
- package/dist/vault/approvals/kernel-server.js +2 -2
- package/dist/vault/broker/server.js +2 -2
- package/package.json +6 -5
- package/profiles/_base/start.sh.hbs +115 -0
- package/profiles/_shared/local-time.md.hbs +6 -0
- package/profiles/default/CLAUDE.md.hbs +0 -12
- package/skills/switchroom-architecture/telegram.md +12 -10
- package/skills/switchroom-cli/SKILL.md +1 -1
- package/telegram-plugin/README.md +3 -1
- package/telegram-plugin/dist/gateway/gateway.js +1164 -547
- package/telegram-plugin/format.ts +12 -4
- package/telegram-plugin/gateway/agent-process-liveness.ts +558 -0
- package/telegram-plugin/gateway/approval-hold.ts +32 -1
- package/telegram-plugin/gateway/approval-outcome-sources.ts +274 -0
- package/telegram-plugin/gateway/bridge-dead-watchdog.ts +21 -9
- package/telegram-plugin/gateway/callback-query-handlers.ts +87 -15
- package/telegram-plugin/gateway/eval-case-proposal-inbound-builders.ts +197 -0
- package/telegram-plugin/gateway/gateway.ts +12 -10
- package/telegram-plugin/gateway/pending-inbound-buffer.ts +167 -11
- package/telegram-plugin/gateway/self-improve-proposal-wiring.test.ts +333 -0
- package/telegram-plugin/gateway/self-improve-proposal-wiring.ts +152 -3
- package/telegram-plugin/gateway/subagent-handback-marker.ts +19 -0
- package/telegram-plugin/package.json +1 -1
- package/telegram-plugin/render/code-segments.ts +38 -4
- package/telegram-plugin/render/dollar-math-guard.ts +16 -1
- package/telegram-plugin/render/ir.ts +53 -3
- package/telegram-plugin/render/parse.ts +73 -14
- package/telegram-plugin/render/render.ts +53 -15
- package/telegram-plugin/render/unsupported-token-guard.ts +45 -80
- package/telegram-plugin/rich-send.ts +22 -7
- package/telegram-plugin/shared/bot-runtime.ts +3 -2
- package/telegram-plugin/telegraph.ts +6 -4
- package/telegram-plugin/tests/agent-process-liveness.test.ts +406 -0
- package/telegram-plugin/tests/approval-hold-record.test.ts +21 -8
- package/telegram-plugin/tests/boot-resume-gateway-only-respawn.test.ts +752 -0
- package/telegram-plugin/tests/boot-resume-guard-wiring.test.ts +203 -0
- package/telegram-plugin/tests/callback-query-handlers.test.ts +143 -1
- package/telegram-plugin/tests/eval-case-proposal-inbound-builders.test.ts +144 -0
- package/telegram-plugin/tests/grammy-rich-message-types.test.ts +199 -0
- package/telegram-plugin/tests/hermes-messages-paging.test.ts +149 -0
- package/telegram-plugin/tests/hermes-session-search.test.ts +146 -0
- package/telegram-plugin/tests/pending-inbound-buffer.test.ts +443 -2
- package/telegram-plugin/tests/render/dollar-math-guard.test.ts +43 -0
- package/telegram-plugin/tests/render/guard-composition.test.ts +102 -0
- package/telegram-plugin/tests/render/parse.test.ts +30 -5
- package/telegram-plugin/tests/render/render.test.ts +9 -4
- package/telegram-plugin/tests/render/rich-render.test.ts +46 -5
- package/telegram-plugin/tests/render/tg-entity.test.ts +242 -0
- package/telegram-plugin/tests/render/unsupported-token-guard.test.ts +66 -66
- package/telegram-plugin/tests/sent-text-capture.test.ts +3 -3
- package/telegram-plugin/tests/subagent-handback-marker.test.ts +14 -0
- package/telegram-plugin/tests/telegraph.test.ts +1 -1
- package/telegram-plugin/uat/scenarios/jtbd-rich-formatting-render-dm.test.ts +17 -8
|
@@ -128,17 +128,30 @@ describe('blocked-approval record — the off-Telegram surface', () => {
|
|
|
128
128
|
// meant the whole feature was a silent no-op in production.
|
|
129
129
|
it('falls back to the agent\'s own state dir when the shared dir is not writable', () => {
|
|
130
130
|
// Simulate the production failure: Docker auto-created the bind source as
|
|
131
|
-
// root:root, so this agent's uid
|
|
132
|
-
//
|
|
133
|
-
//
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
131
|
+
// root:root, so this agent's uid cannot write inside it.
|
|
132
|
+
//
|
|
133
|
+
// This used to be modelled as a read-only PARENT (`chmod 0555`). uid 0
|
|
134
|
+
// IGNORES file modes, so under root the shared write SUCCEEDED, the fallback
|
|
135
|
+
// branch was never taken, and this test went red for the wrong reason (the
|
|
136
|
+
// suite runs as root in the fleet's debug container). Inject the EACCES
|
|
137
|
+
// instead — deterministic for every uid, and every branch of the real
|
|
138
|
+
// `write()` still runs.
|
|
139
|
+
const unwritable = join(root, 'root-owned', 'blocked-approvals')
|
|
138
140
|
const ownDir = join(root, 'agent-state')
|
|
139
141
|
mkdirSync(ownDir, { recursive: true })
|
|
140
142
|
|
|
141
|
-
const store = createBlockedApprovalStore(unwritable, 'overlord', ownDir
|
|
143
|
+
const store = createBlockedApprovalStore(unwritable, 'overlord', ownDir, {
|
|
144
|
+
writeFileSync: ((file, data, opts) => {
|
|
145
|
+
if (String(file).startsWith(unwritable)) {
|
|
146
|
+
const e: NodeJS.ErrnoException = new Error(
|
|
147
|
+
`EACCES: permission denied, open '${String(file)}'`,
|
|
148
|
+
)
|
|
149
|
+
e.code = 'EACCES'
|
|
150
|
+
throw e
|
|
151
|
+
}
|
|
152
|
+
return writeFileSync(file, data, opts)
|
|
153
|
+
}) as typeof writeFileSync,
|
|
154
|
+
})
|
|
142
155
|
store.write(REC)
|
|
143
156
|
|
|
144
157
|
// The record MUST exist somewhere — never silently lost.
|