v1 web interface: dispatch-mode quiz/ask, Fastify+WS server, React frontend, deterministic test suite
- extensions/core/question-core.ts: pure quiz/ask logic (normalize/shuffle/resolve/grade/format) shared by both interfaces - extensions/core/bridge.ts: in-process server<->extension bridge (answer/dismiss/re-arm) - extensions/quiz-web.ts + ask-web.ts: web dispatch mode — tool returns immediately, graded answer arrives as next user message; sessions resumable mid-question via lh_question/lh_question_answered custom entries (never in LLM context) - extensions/quiz.ts: refactored onto shared core (terminal blocking mode unchanged) - src/server/index.ts: Fastify + WebSocket; REST (list/create/resume), entry sync (diff-based, all message kinds), streaming deltas, pending-question push - web/: Vite + React — home view (graph placeholder, session list, new-session input), session view (markdown+KaTeX+mermaid transcript, quiz cards, streaming) - src/testing/scripted-model.ts: deterministic fake LLM (scripted model runtime injected via factory overrides) - tests/: 48 deterministic tests (unit: question-core + bridge; integration: full pi loop with scripted model incl. resume re-arm) - scripts/e2e.ts: live smoke test (manual, real LLM, never a gate) - teacher/system-prompt.md: end-your-turn rule for question tools
This commit is contained in:
+28
-3
@@ -7,16 +7,41 @@
|
||||
"scripts": {
|
||||
"teach": "tsx src/cli.ts teach",
|
||||
"doctor": "tsx src/cli.ts doctor",
|
||||
"doctor:web": "tsx src/cli.ts doctor --web",
|
||||
"test": "tsx --test tests/*.test.ts",
|
||||
"test:unit": "tsx --test tests/question-core.test.ts tests/bridge.test.ts",
|
||||
"e2e:live": "tsx scripts/e2e.ts",
|
||||
"serve": "tsx src/server/index.ts",
|
||||
"web": "vite",
|
||||
"dev": "concurrently -n server,web -c blue,green \"npm:serve\" \"npm:web\"",
|
||||
"build": "vite build",
|
||||
"start": "npm run build && npm run serve",
|
||||
"ingest": "tsx src/cli.ts ingest",
|
||||
"graph": "tsx src/cli.ts graph",
|
||||
"what-next": "tsx src/cli.ts what-next"
|
||||
"what-next": "tsx src/cli.ts what-next",
|
||||
"typecheck": "tsc --noEmit && tsc --noEmit -p web/tsconfig.json"
|
||||
},
|
||||
"dependencies": {
|
||||
"@earendil-works/pi-coding-agent": "0.84.2"
|
||||
"@earendil-works/pi-coding-agent": "0.84.2",
|
||||
"@fastify/static": "^8.0.0",
|
||||
"@fastify/websocket": "^11.0.0",
|
||||
"fastify": "^5.0.0",
|
||||
"katex": "^0.16.11",
|
||||
"mermaid": "^11.4.0",
|
||||
"react": "^18.3.1",
|
||||
"react-dom": "^18.3.1",
|
||||
"react-markdown": "^9.0.1",
|
||||
"rehype-katex": "^7.0.1",
|
||||
"remark-math": "^6.0.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/node": "^24.0.0",
|
||||
"@types/react": "^18.3.5",
|
||||
"@types/react-dom": "^18.3.0",
|
||||
"@vitejs/plugin-react": "^4.3.1",
|
||||
"concurrently": "^9.0.0",
|
||||
"tsx": "^4.19.0",
|
||||
"typescript": "^5.6.0"
|
||||
"typescript": "^5.6.0",
|
||||
"vite": "^6.0.0"
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user