workgraph-codex-cli

Codex CLI integration for workgraph

agent
codex
graph
moonbit
moon add totto2727/workgraph-codex-cli@0.2.0
Download zip
Author
Version
0.2.0
License
MIT
Last updated
21 hours ago
Downloads
2
README

#workgraph-codex-cli

workgraph-codex-cli implements the Workgraph coding-agent contract through totto2727/agent-sdk/cli/codex. Its public CodexAgentOptions and codex_agent constructor remain the composition root for Codex-native option types from totto2727/codex-sdk/cli.

codex_agent returns a configured agent-sdk Cli through CodingAgent.open; the shared node owns session acquisition, prompt serialization, agent-bound continuation selection, response decoding, and relative context-file resolution against the Workgraph workspace. Absolute Path values and caller order are retained. Provider errors and prompt cancellation propagate unchanged, with provider cleanup owned by the cancellable CliSession.prompt call. There is no Workgraph session wrapper, logical close, or post-close error.

#Package

import {
"totto2727/workgraph-codex-cli"
}

Version 0.2.0 prefers Wasm/WASI and supports Wasm/WASI and native from the same production source; JavaScript is not supported. It resolves totto2727/agent-sdk@0.2.0 and totto2727/codex-sdk@0.4.0 from the MoonBit registry. The shared CI check follows the Wasm/WASI preferred target and loads the Codex CLI from the repository's ci Nix dev shell. Fake CLI process tests run only on native.

#Example

The src/examples/basic example can use local Codex CLI authentication and runs a read-only prompt in the current workspace. It is an optional credentialed smoke, not a required test gate.

moon run --target native package/workgraph-codex-cli/src/examples/basic

#
CodexAgentOptions

pub struct CodexAgentOptions {
codex_path_override :
Path
?
base_url : String?
api_key : String?
config : Map[String, Json]?
resume_thread_id : String?
model : String?
sandbox :
SandboxMode
?
skip_git : Bool?
reasoning :
ModelReasoningEffort
?
web_search :
WebSearchMode
?
}

Configuration shared by every Codex session opened by this adapter.

#
CodexAgentOptions::CodexAgentOptions

fn CodexAgentOptions::CodexAgentOptions(codex_path_override? :
Path
, base_url? : String, api_key? : String, config? : Map[String, Json], resume_thread_id? : String, model? : String, sandbox? :
SandboxMode
, skip_git? : Bool, reasoning? :
ModelReasoningEffort
, web_search? :
WebSearchMode
) -> CodexAgentOptions

Creates Codex adapter options with the SDK's defaults.

#
codex_agent

Creates a coding agent backed by the pinned Codex SDK.

Source Files

Powered by MoonBit

Site sourceReport issuePackagesBuild queueSkillsStatistics

© 2026 mooncakes.io