feat: add unit tests, Docker polish, and workbench UX improvements

Unit tests: Consumer class (7), recursive-splitter (10), parseJsonResponse (11) — 28 total.
Docker: add 5 commented LLM provider services, dev compose override, .env.example.
Workbench: chat persistence, error boundary, disconnect banner, prompts error handling.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
elpresidank 2026-04-07 03:51:29 -05:00
parent c7eefee607
commit 72870a7e2e
17 changed files with 718 additions and 33 deletions

View file

@ -261,7 +261,7 @@ function literalTerm(value: string): Term {
* Parse JSON from LLM output, handling markdown code fences and malformed output.
* Uses progressive fallback: direct parse, array extraction, truncated array repair, single object wrap.
*/
function parseJsonResponse<T>(raw: string): T | null {
export function parseJsonResponse<T>(raw: string): T | null {
// Attempt 1: direct parse after stripping fences
let cleaned = raw.trim();
const fenceMatch = cleaned.match(/^```(?:json)?\s*\n?([\s\S]*?)\n?```$/);