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.
28 lines
938 B
TypeScript
28 lines
938 B
TypeScript
/** Shared default constants. Mirrors `agent/defaults.rs`. */
|
|
|
|
/** Default LLM provider API base URL. */
|
|
export const DEFAULT_API_BASE = "https://opencode.ai/zen/v1";
|
|
|
|
/** Default LLM model identifier. */
|
|
export const DEFAULT_MODEL = "deepseek-v4-flash-free";
|
|
|
|
/** Fallback JWT secret used only when `JWT_SECRET` env var is unset. */
|
|
export const FALLBACK_JWT_SECRET = "dev-secret";
|
|
|
|
/** Default context window size (256k tokens). */
|
|
export const DEFAULT_CONTEXT_WINDOW = 256_000;
|
|
|
|
/** Maximum tool-call iterations per agent turn. */
|
|
export const MAX_TOOL_ITERATIONS = 50;
|
|
|
|
/** Maximum subagent tool-call iterations. */
|
|
export const MAX_SUBAGENT_ITERATIONS = 25;
|
|
|
|
/** Default LLM request max tokens. */
|
|
export const DEFAULT_MAX_TOKENS = 4096;
|
|
|
|
/** Default temperature for the main agent. */
|
|
export const DEFAULT_TEMPERATURE = 0.7;
|
|
|
|
/** Default temperature for compaction / summary calls. */
|
|
export const DEFAULT_COMPACT_TEMPERATURE = 0.3; |