Skip to content

@usine/agents/codex

Spawns the Codex app-server process and exposes its JSON-RPC connection.

  • Context.ServiceClass

readonly Service: object

The service’s operations: what yield* CodexAppServer returns.

readonly open: (request) => Effect.Effect<CodexConnection, SessionOperationError, Scope.Scope>

Parameter Type
request CodexClient

Effect.Effect<CodexConnection, SessionOperationError, Scope.Scope>

One JSON-RPC connection to the app server, scoped to its process.

readonly close: Effect<void, SessionOperationError>

Closes stdin and waits for the app server to release its threads and commands.

readonly notifications: Stream<CodexNotification, SessionOperationError>

readonly notify: (operation, method, params) => Effect<void, SessionOperationError>

Parameter Type
operation "launch" | "stream" | "steer" | "interrupt"
method string
params Json

Effect<void, SessionOperationError>

readonly request: (operation, method, params) => Effect<Json, SessionOperationError>

Parameter Type
operation "launch" | "stream" | "steer" | "interrupt"
method string
params Json

Effect<Json, SessionOperationError>

const codexAppServerLive: Layer.Layer<CodexAppServer, never, ChildProcessSpawner.ChildProcessSpawner>


const codexChildBackendLayer: Layer.Layer<CodexChildBackend, never, CodexAppServer>

Provides Codex coding sessions for tasks delegated by a parent.