refactor: rombak arsitektur file ke modular clean-arch (vertikal per-feature)

Organisasi ulang layer-first (domain/application/infrastructure) menjadi
vertikal per-feature, behavior tidak berubah:

- src/shared/domain/  -> fondasi bersama (ex-domain/core): message, provider,
  tool_call, tool_result, store, error, usage, conversation
- src/features/agent/ -> LLM turn loop: domain (TurnEvent, AgentTurnParams) +
  application (turn_service, ports) + infrastructure (llm LlmClient + tools)
- src/features/cms/   -> settings/conversation/memory persistence: domain +
  application (services) + infrastructure (persistence repos)
- src/features/subagent/ -> orchestration: domain (AccessTier) + infrastructure
  (engine runner, context, provider, delegate, spawn_tools)
- src/features/workflow/ -> multi-phase + hive-mind: domain + infrastructure
- src/interfaces/     -> cli + tui (outer ring) tetap

Subagent-runner (engine.ts runAgent, division.ts toolsFor) dipindah ke
features/subagent (bukan agent tools) utk memutus coupling agent<->subagent.

Alias tsconfig: @zesdex/domain -> shared/domain, + @zesdex/agent,
@zesdex/agent-infra, @zesdex/cms, @zesdex/subagent, @zesdex/workflow, @zesdex/shared.
Bersihkan dead: application/ports PasswordService/TokenService/AuthService.
compose.ts (composition root) & bootstrap repoint ke barrel feature.

Gates: tsc --noEmit 0 error, bun test 70 pass/0 fail, bun build 147 modules,
./dist/zesdex --headless -> real turn OK.
This commit is contained in:
asepharyana
2026-09-03 02:30:12 +07:00
parent 7e6ed34f0d
commit b5ebd07fa8
126 changed files with 157 additions and 166 deletions
+7 -3
View File
@@ -22,9 +22,13 @@
"jsx": "react-jsx",
"jsxImportSource": "@opentui/react",
"paths": {
"@zesdex/domain": ["./src/domain/index.ts"],
"@zesdex/application": ["./src/application/index.ts"],
"@zesdex/infrastructure": ["./src/infrastructure/index.ts"],
"@zesdex/domain": ["./src/shared/domain/index.ts"],
"@zesdex/shared": ["./src/shared/index.ts"],
"@zesdex/agent": ["./src/features/agent/index.ts"],
"@zesdex/agent-infra": ["./src/features/agent/infrastructure/index.ts"],
"@zesdex/cms": ["./src/features/cms/index.ts"],
"@zesdex/subagent": ["./src/features/subagent/index.ts"],
"@zesdex/workflow": ["./src/features/workflow/index.ts"],
"@zesdex/tui": ["./src/interfaces/tui/index.ts"]
}
},