- Hapus total interfaces: api (REST), ws (WebSocket), grpc, web, daemon (IPC) - Hapus infra server-only yang jadi dead code: infrastructure/ipc + seluruh stack auth (domain/auth, application/auth, persistence/iam, infrastructure/auth jwt/password/oauth_loopback) - TUI (OpenTUI) jadi interface utama: wire ke runSingleProcess() real runtime, ganti mock '(no LLM configured)' dengan turnService.runTurn asli + streaming stream_token/reasoning/tool_result/system_note/error ke transcript - Tampilkan model asli di header (mis. claude-opus-5), abort turn via Ctrl+C - CLI jadi mode headless tambahan: zesdex --headless '<prompt>' one-shot turn - Bersihkan package.json (script tui/headless), tsconfig paths, docker-compose, AGENTS.md; hapus StartOAuth/login stub - verified: tsc 0 err, 70 test pass, build dist/zesdex; headless 'pong' real; TUI interactive render + real turn 'say pong in one word' -> assistant 'pong'
2.5 KiB
AGENTS.md
This file provides guidance to AI agents (Kilo / Hermes) working in the zesdex repository.
Overview
Zesdex is an AI-native autonomous coding agent, implemented in TypeScript / Bun. It was rebuilt to be a pure CLI/TUI tool — there are no network server interfaces (REST API / WebSocket / gRPC / web / daemon were all removed). The only two entry points:
zesdex— interactive OpenTUI (primary interface, wired to the real agent).zesdex --headless "<prompt>"— one-shot non-interactive turn (headless mode).
Best Practice Conventions
-
Clean Architecture — strict
domain/application/infrastructurelayering undersrc/, with thininterfaces/for the TUI + CLI.domainhas zero I/O and zero framework dependencies.applicationdepends only ondomain(ports + turn service).infrastructureimplements domain ports (LLM client, tool executor, file repos).- DTOs/value objects cross layer boundaries, not entities.
-
Clean Code — functions under ~40 lines, one level of abstraction per function, descriptive names, no flag arguments, no commented-out dead code.
-
Documentation — every exported
function,class,interface, andtypeneeds a/** */doc comment explaining what, flow, why, and return value. -
Commit Convention — Conventional Commits in Bahasa Indonesia:
feat(scope):,fix(scope):,chore:,docs:. -
Error Handling — throw
Errorwith clear messages; the turn loop wraps LLM errors and recovers. Log withconsole.*(redirected to~/.local/share/zesdex/zesdex.log). -
Testing — Bun tests (
bun test) usingdescribe/test/expect. Tests are F.I.R.S.T. Logic-pure modules (TUI state/action/command/controller) are unit-tested. -
No Compiler Bypasses — no
@ts-ignore/anywhere a real type exists. -
Boy Scout Rule — leave every module cleaner than you found it.
Stack
- Bun 1.3.14 (packageManager pinned in
package.json). - TypeScript strict mode,
tsconfig.jsonusespathsaliases (@zesdex/*) →src/*.bun build ... --compilebundles into a singledist/zesdexbinary.
Commands
bun run check—tsc --noEmittypecheck.bun run test— run all Bun tests.bun run build— compiledist/zesdexbinary.bun run tui— run the interactive TUI.bun run headless "<prompt>"— one-shot agent turn.bun run bootstrap— seed default settings/app_config.