0xfzz|Faiz Nurdiana
HomeProjectsExperiencesBlogContact

© 2026 0xfzz. Built with luvv.

Mulai aja dulu.•
f:56ae727/c:65107d7
•Components

Back to Projects
TypeScript
Node.js
React
Tailwind CSS
SSE

Dirijen

A unified coding-agent harness protocol and web UI that translates Claude Code, Codex, OpenCode, and Antigravity into one contract, event stream, and session model.

Core Actions

Source Code

Dirijen (Indonesian/Malay: orchestra conductor) is an open-source protocol and web-based control center for coding-agent harnesses. Instead of treating Claude Code, Codex, OpenCode, and Antigravity (agy) as completely separate terminal tools with incompatible outputs and flags, Dirijen translates all of them into one contract, one event stream, one session model, and one transcript.


Why I Built Dirijen

I started this project because of two real frustrations in my daily workflow:

  1. Juggling multiple subscriptions in local terminals: I rely on several AI coding subscriptions. Whenever one subscription hits its 5-hour usage limit, I have to open a new terminal tab or split panes just to spawn a different harness and continue working. Switching contexts manually across terminals gets frustrating very quickly.
  2. Harnesses are trapped on my laptop: Because every CLI harness runs locally inside a laptop terminal, I cannot monitor progress, answer permission prompts, or steer a session from my phone.

I took inspiration from tools like t3code, orca, and openbot—even though I had never actually used them yet! Rather than just adopting an existing tool, I wanted to design my own unifying protocol from scratch so that any coding-agent harness can live behind one web UI today, and eventually be controlled remotely from a web or mobile client anywhere.


From Initial Concept to Architecture

Before writing the codebase, I sketched out the core idea: put a dedicated Wrapper in front of each harness (Claude, Codex, Opencode, or any custom harness where "custom wrapper should figure themselves out"), normalize them into a single Dirijen Protocol, and let clients consume that protocol to orchestrate or program the harnesses uniformly.

Initial Dirijen Concept Diagram

System Architecture

In the implementation, @dirijen/core strictly knows no specific harness. Each harness lives in its own adapter package, while @dirijen/web and @dirijen/cli consume the exact same core API (Interface B) that any future mobile app or orchestrator would use:


How the Protocol Unifies Everything

Each coding-agent CLI reinvents the same primitives—session IDs, event streams, permission prompts, resume flags, and model selection—just with different vocabularies. @dirijen/core solves this through four unifications:

  1. One Contract (AgentAdapter): Core never imports any adapter or mentions any harness name. Supporting a new harness means building an isolated wrapper package—either via @dirijen/acp (for ACP-speaking agents), @dirijen/exec's defineExecAdapter (for stdio/NDJSON CLIs), or a hand-written defineAdapter implementation.
  2. One Event Stream: Every harness interaction is normalized into a single ordered, replayable AsyncIterable spanning 28 frozen AgentEvent types.
  3. One Session Model: Every running agent shares an 8-state finite state machine (starting, idle, working, blocked, cancelled, exited, errored, unknown) and a unified AttentionRequest mechanism for human-in-the-loop approvals and questions.
  4. One Transcript: messages() folds the persisted event log into a clean chat thread projection, allowing any client UI to reopen sessions without re-running the underlying CLI.

Monorepo Packages

The repository is structured as a TypeScript monorepo running on Node.js (>=22.18) with strict boundary tests between the protocol core and its adapters:

PackageRole
@dirijen/coreThe protocol library: adapter contract, lifecycle FSM, transcript projection, and persistence—with no HTTP server or UI.
@dirijen/execWrapper-side toolkit (defineExecAdapter) for stdio/NDJSON-based CLI harnesses.
@dirijen/acpWrapper-side toolkit for harnesses that speak ACP (Agent Client Protocol).
@dirijen/adapter-claudeAdapter wrapping Claude Code.
@dirijen/adapter-codexAdapter wrapping Codex (codex app-server and codex exec).
@dirijen/adapter-opencodeAdapter wrapping OpenCode (opencode acp and opencode run).
@dirijen/adapter-agyAdapter wrapping Antigravity over ACP.
@dirijen/adapter-exampleMinimal reference adapter using defineAdapter for custom wrappers.
@dirijen/webWeb chat UI (dirijen-web) built with node:http + SSE, React 19, and Tailwind CSS v4.
@dirijen/cliCLI client (dirijen), runOnce helper, and contract conformance runner.
@dirijen/sample-web-clientMinimal vanilla-JS UI and node:http reference client over @dirijen/core.

Current Status & What's Next

Dirijen is currently an active prototype (v0.1.0). The @dirijen/web server already enforces bearer-token authentication (--token / DIRIJEN_WEB_TOKEN) whenever bound to a non-loopback host (0.0.0.0), laying the groundwork for secure remote access.

Moving forward, the goal is to turn this unified foundation into a true remote-first workspace—making it effortless to switch harnesses when a subscription hits its limit, monitor long-running coding tasks from a phone, and build programmable multi-agent orchestration on top of one clean protocol.

Technologies Leveraged

TypeScript
Node.js
React
Tailwind CSS
SSE