feat(rewrite): tambah infrastructure — LLM client + full file persistence

Sub-fase 3a & 3e infrastructure TypeScript (@zesdex/infrastructure):
- llm/provider.ts: LlmClient (OpenAI/Anthropic-compatible fetch + SSE,
  retry 10x exponential backoff + jitter, abort on 401/402/403,
  stream quota-aware tool-call delta accumulation)
- resolveApiKey: settings.api_keys → app_config.env_var → inline default
- utils: writeJsonAtomic (tmp+rename+fsync), slugify, writeOsc52,
  truncateChars, buildWorkspaceTree, runCommand
- persistence/cms: JsonSettingsRepository, JsonAppConfigRepository
  (Claude credential auto-detection dari ~/.claude/settings.json + env),
  JsonConversationRepository, JsonlEditLogRepository (append NDJSON),
  MarkdownMemoryRepository (YAML-ish frontmatter), FileRewindBlobRepository
- persistence/iam: FileSystemSessionRepository, FileSystemSessionLockRepository,
  FileSystemOAuthRepository
- Workspace @zesdex/infrastructure tsc clean, semua test domain+application
  tetap hijau (38 pass)

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This commit is contained in:
asepharyanaandClaude Opus 5 committed 2026-09-02 22:50:38 +07:00
1 parent 03538a455a
commit a2c7e5d44c
17 files changed
+1072

No files matched your search

@@ -0,0 +1,7 @@
/**
* Zesdex Infrastructure Layer — concrete adapters implementing domain/application
* ports. Mirrors the Rust `zesdex-infrastructure` crate.
*/
export * from "./utils.ts";
export * from "./llm/index.ts";
export * from "./persistence/index.ts";