Files
loki/tsconfig.json
T
g-butandClaude Opus 4.7 aeeaa466f7 feat(home): M2 — local Brain skeleton (tail event log → project state → /api/state)
Second milestone of the greenfield rewrite. A standalone Node HTTP server
in home/ that boots, tails ~/.<APP_SLUG>/events.jsonl, projects each event
into per-project state, and serves a minimal status UI at localhost:3001.
No external deps beyond node:* and the existing zod via @/lib/events.

  home/state.ts   pure applyEvent(state, event) → state — testable in
                  isolation; project view stays minimal (currentRun,
                  lastHandoff, recentOutcomes ≤ 5) for M2
  home/log.ts     tail one JSONL file via fs.watch + position tracking;
                  replays existing content on boot, recovers from file
                  truncation, returns parse errors via onError instead of
                  throwing (so a garbled line doesn't kill the daemon)
  home/server.ts  HTTP server with /control HTML view + /api/state +
                  /api/health + /api/events (manual append for testing).
                  Vanilla JS in the HTML, no React yet — that lands when
                  the brain replaces the existing /control surface.

End-to-end verification (against ~/.cockpit/events.jsonl):
  - worker.started     → project appears with running pill
  - worker.finished    → pill clears, outcome glyph ✓ in streak,
                         handoff text shown

tsconfig.json includes home/**/*.ts so the existing tsc + eslint gates
cover the new code. Runs separately from the Next.js app — no port
collision, no Vercel involvement, no DB needed.

What this commit deliberately does NOT do:
  - emit events (M4 — replace the agent stop-hook to append to the log)
  - decide (M5 — pure decide() function over state)
  - dispatch (M6 — wire bridge.dispatch back to a worker)
  - persist beyond the log (state rebuilds from log replay on boot)

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-20 01:23:03 +02:00

45 lines
759 B
JSON

{
"compilerOptions": {
"target": "ES2017",
"lib": [
"dom",
"dom.iterable",
"esnext"
],
"allowJs": true,
"skipLibCheck": true,
"strict": true,
"noEmit": true,
"esModuleInterop": true,
"module": "esnext",
"moduleResolution": "bundler",
"resolveJsonModule": true,
"isolatedModules": true,
"jsx": "react-jsx",
"incremental": true,
"plugins": [
{
"name": "next"
}
],
"paths": {
"@/*": [
"./src/*"
]
}
},
"include": [
"next-env.d.ts",
"src/**/*.ts",
"src/**/*.tsx",
"home/**/*.ts",
"**/*.mts",
".next/types/**/*.ts",
".next/dev/types/**/*.ts"
],
"exclude": [
"node_modules",
".next"
]
}