feat(rewrite): bootstrap monorepo Bun + port domain layer ke TypeScript

Mulai migrasi Zesdex dari Rust ke TypeScript/Bun.

- Root workspace package.json, tsconfig strict, bun.lock, gitignore fix
- Paket @zesdex/domain (apps/packages/domain):
  - core: ChatMessage/Conversation/ToolCall/SseParser/repairJson/
    sanitizeToolArguments/UsageStats/Store/DomainError
  - auth: Session/SessionId/SessionLock/OAuth + repository & service interfaces
  - cms: AppConfig/Settings/SettingsPatch/Memory/EditLog + repository &
    service interfaces
  - agent: TurnEvent/SessionRuntime/AgentTurnParams/AgentProgress/prompt
  - subagent & workflow models
- Wire-shape JSON disamakan dengan Rust (serde rename/flatten/skip_if)
- 27 unit test Bun port dari test Rust (SseParser, repair_json, resolve_effective_model, session id)

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This commit is contained in:
asepharyana
2026-09-02 22:50:38 +07:00
co-authored by Claude Opus 5
parent 9d1544d799
commit 07e84e43b3
45 changed files with 2315 additions and 1 deletions
+37
View File
@@ -0,0 +1,37 @@
/** Workflow and Hive-mind domain models. Mirrors `workflow/mod.rs`. */
/** A single phase in a parsed workflow script. */
export interface WorkflowPhase {
name: string;
directive: string;
}
/** A parsed workflow script with named phases. */
export interface WorkflowScript {
name: string;
phases: WorkflowPhase[];
}
/** A directive for a single processing node in the hive mind. */
export interface NodeDirective {
directive: string;
access_tier: string;
}
/** A cognitive cycle plan — ordered cycles of parallel node directives. */
export interface CognitiveCyclePlan {
cycles: NodeDirective[][];
}
/** A single cycle in a cognitive cycle plan. */
export interface CognitiveCycle {
index: number;
directives: NodeDirective[];
}
/** Output from a single hive-mind node after a cycle completes. */
export interface NodeOutput {
id: string;
directive: string;
output: string;
}