2 Commits

Author SHA1 Message Date
Mika Kuns
f4539eb2c9 chore(release): 1.5.1
All checks were successful
Release / release (push) Successful in 8s
Release (Node) / release (push) Successful in 10s
2026-05-20 14:09:19 +02:00
Mika Kuns
4b93641cf4 fix(server): register onClose hook before app.listen
Fastify forbids addHook after the instance is listening, so the
sweep-timer cleanup hook from 1.5.0 threw on every `serve` startup
and crashed the daemon. Register the hook first, then start
listening, and assign the timer through a ref.
2026-05-20 14:09:11 +02:00
4 changed files with 9 additions and 8 deletions

View File

@@ -1,12 +1,12 @@
{ {
"name": "@kuns/claude-mailbox", "name": "@kuns/claude-mailbox",
"version": "1.5.0", "version": "1.5.1",
"lockfileVersion": 3, "lockfileVersion": 3,
"requires": true, "requires": true,
"packages": { "packages": {
"": { "": {
"name": "@kuns/claude-mailbox", "name": "@kuns/claude-mailbox",
"version": "1.5.0", "version": "1.5.1",
"license": "MIT", "license": "MIT",
"dependencies": { "dependencies": {
"@modelcontextprotocol/sdk": "^1.29.0", "@modelcontextprotocol/sdk": "^1.29.0",

View File

@@ -1,6 +1,6 @@
{ {
"name": "@kuns/claude-mailbox", "name": "@kuns/claude-mailbox",
"version": "1.5.0", "version": "1.5.1",
"description": "Standalone MCP mail server that lets parallel Claude sessions coordinate with each other.", "description": "Standalone MCP mail server that lets parallel Claude sessions coordinate with each other.",
"type": "module", "type": "module",
"bin": { "bin": {

View File

@@ -156,10 +156,11 @@ export async function startServer(
): Promise<{ app: FastifyInstance; store: MailboxStore; sweepTimer: NodeJS.Timeout | null }> { ): Promise<{ app: FastifyInstance; store: MailboxStore; sweepTimer: NodeJS.Timeout | null }> {
const store = new MailboxStore(cfg.dbPath); const store = new MailboxStore(cfg.dbPath);
const app = await buildServer(cfg, store); const app = await buildServer(cfg, store);
await app.listen({ host: cfg.bind, port: cfg.port }); const timerRef: { current: NodeJS.Timeout | null } = { current: null };
const sweepTimer = startSweep(store, cfg, app.log);
app.addHook("onClose", async () => { app.addHook("onClose", async () => {
if (sweepTimer) clearInterval(sweepTimer); if (timerRef.current) clearInterval(timerRef.current);
}); });
return { app, store, sweepTimer }; await app.listen({ host: cfg.bind, port: cfg.port });
timerRef.current = startSweep(store, cfg, app.log);
return { app, store, sweepTimer: timerRef.current };
} }

View File

@@ -1,6 +1,6 @@
{ {
"name": "claude-mailbox", "name": "claude-mailbox",
"version": "1.5.0", "version": "1.5.1",
"description": "Auto-checks the local Claude-Mailbox daemon before every prompt and after each subagent run, and injects pending messages into the conversation context.", "description": "Auto-checks the local Claude-Mailbox daemon before every prompt and after each subagent run, and injects pending messages into the conversation context.",
"author": { "author": {
"name": "Mika Kuns" "name": "Mika Kuns"