workgraph-agent-cli

    Coding-agent nodes for workgraph

    agent
    coding-agent
    graph
    moonbit
    Download zip
    Author
    Version
    0.3.0
    License
    MIT
    Last updated
    3 hours ago
    Downloads
    105

    #workgraph-agent-cli

    workgraph-agent-cli owns the provider-neutral extension contract for coding-agent adapters: CodingAgent, workspace and policy types, opaque continuations, CodingAgentNodeSpec, and coding_agent_node. For shared installation and graph construction, see the root Setup and Usage.

    #Usage

    Implement this interface when adding a coding-agent provider: open an agent-sdk session, map graph state to Prompt, and decode FinalResponse into NodeOutput. These concrete package Usage sections show the complete adapter-owned prompt-to-result flow:

    #API

    Version 0.2.1 prefers the Wasm/WASI target and supports Wasm/WASI and native. JavaScript is not supported. The module resolves totto2727/agent-sdk@0.2.1 from the MoonBit registry. Wasm GC is excluded because moonbitlang/async does not support it.

    This README was generated from the share-artifact skill and README template.

    CodingAgentContinuationError

    pub suberror CodingAgentContinuationError {
    AgentMismatch(expected~ : CodingAgentId, actual~ : CodingAgentId)
    } derive(
    Debug
    )

    Raised when a continuation is supplied to a different coding agent.

    IdError

    pub suberror IdError {
    EmptyId(kind~ : String)
    } derive(
    Debug
    )

    IdError::to_repr

    ApprovalPolicy

    pub(all) enum ApprovalPolicy {
    Never
    OnRequest
    OnFailure
    Untrusted
    } derive(Eq,
    Debug
    )

    ApprovalPolicy::equal

    ApprovalPolicy::not_equal

    fn ApprovalPolicy::not_equal(x : ApprovalPolicy, y : ApprovalPolicy) -> Bool

    CodingAgent

    pub struct CodingAgent {
    id : CodingAgentId
    open : async (CodingAgentOpenContext) ->
    Cli

    }

    CodingAgent::CodingAgent

    Creates a coding-agent adapter.

    CodingAgentContinuation

    pub struct CodingAgentContinuation {
    // private fields
    }

    In-process continuation bound to the coding agent that produced it.

    Only a coding-agent node can create this value from a successful response.

    CodingAgentId

    pub struct CodingAgentId {
    value : String
    } derive(Eq, Hash,
    Debug
    )

    CodingAgentId::CodingAgentId

    fn CodingAgentId::CodingAgentId(value : String) -> CodingAgentId raise IdError

    CodingAgentId::equal

    CodingAgentId::hash

    fn CodingAgentId::hash(self : CodingAgentId) -> Int

    CodingAgentId::hash_combine

    fn CodingAgentId::hash_combine(CodingAgentId, Hasher) -> Unit

    CodingAgentId::not_equal

    fn CodingAgentId::not_equal(x : CodingAgentId, y : CodingAgentId) -> Bool

    CodingAgentId::to_string

    fn CodingAgentId::to_string(self : CodingAgentId) -> String

    CodingAgentNodeSpec

    CodingAgentNodeSpec::CodingAgentNodeSpec

    Creates the callbacks and resource policy used by a coding-agent node.

    CodingAgentOpenContext

    pub struct CodingAgentOpenContext {
    run_id :
    RunId

    task_group :
    TaskGroup
    [Unit]
    workspace : WorkspaceRef
    approval : ApprovalPolicy
    network : NetworkPolicy
    environment :
    HashMap
    [String, String]
    events :
    EventSink

    }

    CodingAgentOpenContext::CodingAgentOpenContext

    Creates the runtime context used to open a coding-agent session.

    NetworkPolicy

    pub(all) enum NetworkPolicy {
    Disabled
    Enabled
    } derive(Eq,
    Debug
    )

    NetworkPolicy::equal

    NetworkPolicy::not_equal

    fn NetworkPolicy::not_equal(x : NetworkPolicy, y : NetworkPolicy) -> Bool

    WorkspaceRef

    pub struct WorkspaceRef {
    root :
    Path

    additional_writable_roots : ReadOnlyArray[
    Path
    ]
    } derive(Eq,
    Debug
    )

    WorkspaceRef::WorkspaceRef

    fn WorkspaceRef::WorkspaceRef(root :
    Path
    , additional_writable_roots : ReadOnlyArray[
    Path
    ]) -> WorkspaceRef

    Creates a writable workspace description for a coding agent.

    WorkspaceRef::equal

    WorkspaceRef::not_equal

    fn WorkspaceRef::not_equal(x : WorkspaceRef, y : WorkspaceRef) -> Bool

    coding_agent_node

    Create a graph node that acquires an agent SDK session, serializes a prompt, and decodes its final response.