lody

    1:1 MoonBit mirror of the LodyAI acp-extension-core contract (tool vocabulary, _meta.lody DTOs, _lody/ methods, capabilities)

    lody
    acp
    agent
    json
    sdk
    Download zip
    Author
    Version
    0.1.0
    License
    MIT
    Last updated
    13 days ago
    Downloads
    165

    #colmugx/lody-extension

    1:1 MoonBit mirror of the LodyAI/acp-extension-core contract — the lody host vocabulary for ACP extensions: canonical tool identities, _meta.lody feature DTOs, _lody/ method names and their request/response DTOs, capability advertisement, elicitation and usage/rate-limit payloads.

    Pure functions only: typed structs plus JSON to_json/from_json codecs. No IO, no async, no runtime, no posoco dependency.

    #Upstream tracking

    Mirrored upstreamLodyAI/acp-extension-core (default branch main)
    Upstream commit23c792b910a903b74601e346473827106f991715 (merge of PR #1, 2026-08-21)
    Upstream package versionacp-extension-core@0.1.0 → this module versions 0.1.0
    Local spec translationdocs/acp/lody-contracts.md (authoritative for every field)

    #Upgrade strategy

    Lody upstream does not ship a MoonBit SDK; this module maintains the mirror:

    1. Diff upstream src/*.ts against the previously mirrored commit.
    2. Port every change 1:1: type names, wire field names, and wire string vocabulary are mirrored verbatim — no invention, no renaming.
    3. Bump this module's version to the upstream package.json version.
    4. Re-run the test suite; snapshots lock the wire shapes.

    #Conventions

    • TS camelCase wire keys stay camelCase on the wire; MoonBit struct fields use the snake_case transliteration (e.g. taskIdtask_id).
    • Upstream string-literal unions become MoonBit enums with to_wire / of_wire : String -> Result[T, String].
    • Optional contract fields decode leniently: absent key and explicit JSON null both yield None; required fields error when missing; mistyped fields always error with the contract scope and wire field name; unknown fields are ignored.
    • Capability JSON keys are emitted in camelCase exactly as the TS keys. The upstream repo gives no wire-serialization evidence, so this is an inference — marked "awaiting on-wire verification" at capabilities.mbt.
    • Contract items the upstream repo leaves undefined (steer prompt element shape, history/read response body, canonical tool parameter schemas) are annotated "awaiting on-wire verification" where they surface.

    LodyActivityKind

    pub(all) enum LodyActivityKind {
    ContextCompaction
    Retry
    } derive(Eq,
    Debug
    )

    Wire vocabulary of LodyActivityMeta.kind (src/session.ts).

    LodyActivityKind::of_wire

    fn LodyActivityKind::of_wire(wire : String) -> Result[LodyActivityKind, String]

    LodyActivityKind::to_wire

    fn LodyActivityKind::to_wire(self : LodyActivityKind) -> String

    LodyActivityMeta

    pub(all) struct LodyActivityMeta {
    version : Int
    kind : LodyActivityKind
    automatic : Bool?
    used_tokens_before : Int?
    used_tokens_after : Int?
    duration_ms : Int64?
    failure_reason : String?
    } derive(Eq,
    Debug
    )

    LodyActivityMeta — compaction/retry lifecycle on tool_call envelopes.

    LodyActivityMeta::from_json

    fn LodyActivityMeta::from_json(raw : Json) -> Result[LodyActivityMeta, String]

    LodyActivityMeta::to_json

    fn LodyActivityMeta::to_json(self : LodyActivityMeta) -> Json

    LodyElicitationAnswer

    pub(all) enum LodyElicitationAnswer {
    Single(String)
    Multi(Array[String])
    } derive(Eq,
    Debug
    )

    LodyElicitationAnswerstring | string[]: a single choice or a multi-select choice set.

    LodyElicitationAnswer::from_json

    fn LodyElicitationAnswer::from_json(raw : Json) -> Result[LodyElicitationAnswer, String]

    LodyElicitationAnswer::to_json

    LodyElicitationMeta

    pub(all) struct LodyElicitationMeta {
    version : Int
    auto_resolve_after_seconds : Int64?
    auto_resolve_at_epoch_seconds : Int64?
    custom_answer_for : String?
    secret : Bool?
    preview : String?
    questions : Array[LodyElicitationQuestion]?
    answers : Map[String, LodyElicitationAnswer]?
    } derive(Eq,
    Debug
    )

    LodyElicitationMeta — the _meta.lody.elicitation value. Mounts at request, property, and enum-option scope alike.

    LodyElicitationMeta::from_json

    fn LodyElicitationMeta::from_json(raw : Json) -> Result[LodyElicitationMeta, String]

    LodyElicitationMeta::to_json

    LodyElicitationOption

    pub(all) struct LodyElicitationOption {
    label : String
    description : String?
    preview : String?
    } derive(Eq,
    Debug
    )

    LodyElicitationOption — one enum option (label required).

    LodyElicitationOption::from_json

    fn LodyElicitationOption::from_json(raw : Json) -> Result[LodyElicitationOption, String]

    LodyElicitationOption::to_json

    LodyElicitationQuestion

    pub(all) struct LodyElicitationQuestion {
    id : String?
    question : String
    header : String
    options : Array[LodyElicitationOption]
    multi_select : Bool
    allow_custom_answer : Bool?
    is_secret : Bool?
    } derive(Eq,
    Debug
    )

    LodyElicitationQuestion — one question with its option set.

    LodyElicitationQuestion::from_json

    fn LodyElicitationQuestion::from_json(raw : Json) -> Result[LodyElicitationQuestion, String]

    LodyElicitationQuestion::to_json

    LodyExtensionCapabilities

    pub(all) struct LodyExtensionCapabilities {
    usage : LodyVersionOneCapability?
    rate_limits : LodyRateLimitsCapability?
    fork_at_turn : LodyVersionOneCapability?
    steering : LodySteeringCapability?
    tasks : LodyTaskCapability?
    subagents : LodySubagentCapability?
    goal : LodyGoalCapability?
    compaction : LodyVersionOneCapability?
    session_history : LodyVersionOneCapability?
    } derive(Eq,
    Debug
    )

    LodyExtensionCapabilities — the _meta.lody value under agentCapabilities. Absent features are simply not advertised; to_json emits only the present feature keys, in upstream declaration order.

    LodyExtensionCapabilities::empty

    LodyExtensionCapabilities::from_json

    fn LodyExtensionCapabilities::from_json(raw : Json) -> Result[LodyExtensionCapabilities, String]

    LodyExtensionCapabilities::to_json

    LodyForkAtTurn

    pub(all) struct LodyForkAtTurn {
    version : Int
    turn_id : String?
    } derive(Eq,
    Debug
    )

    LodyForkAtTurn — source-turn pointer carried by session/fork.

    LodyForkAtTurn::from_json

    fn LodyForkAtTurn::from_json(raw : Json) -> Result[LodyForkAtTurn, String]

    LodyForkAtTurn::to_json

    fn LodyForkAtTurn::to_json(self : LodyForkAtTurn) -> Json

    LodyGoalAction

    pub(all) enum LodyGoalAction {
    Set
    Pause
    Resume
    Clear
    } derive(Eq,
    Debug
    )

    Wire vocabulary of LodyGoalCapability.actions (goal control verbs).

    LodyGoalAction::of_wire

    fn LodyGoalAction::of_wire(wire : String) -> Result[LodyGoalAction, String]

    LodyGoalAction::to_wire

    fn LodyGoalAction::to_wire(self : LodyGoalAction) -> String

    LodyGoalCapability

    pub(all) struct LodyGoalCapability {
    version : Int
    actions : Array[LodyGoalAction]
    } derive(Eq,
    Debug
    )

    LodyGoalCapability — supports goal management and _lody/session/goal; actions declares the supported verb set.

    LodyGoalCapability::from_json

    fn LodyGoalCapability::from_json(raw : Json) -> Result[LodyGoalCapability, String]

    LodyGoalCapability::to_json

    LodyGoalControlRequest

    pub(all) enum LodyGoalControlRequest {
    Set(session_id~ : String, objective~ : String)
    Pause(session_id~ : String)
    Resume(session_id~ : String)
    Clear(session_id~ : String)
    } derive(Eq,
    Debug
    )

    LodyGoalControlRequest_lody/session/goal params, discriminated on action: set carries an objective; pause/resume/clear do not.

    LodyGoalControlRequest::from_json

    fn LodyGoalControlRequest::from_json(raw : Json) -> Result[LodyGoalControlRequest, String]

    LodyGoalControlRequest::to_json

    LodyGoalControlResponse

    pub(all) struct LodyGoalControlResponse {
    goal : LodyGoalSnapshot?
    } derive(Eq,
    Debug
    )

    LodyGoalControlResponse_lody/session/goal result; goal is a required key that is nullable upstream: null when no goal is currently set (a missing key is a decode error).

    LodyGoalControlResponse::from_json

    fn LodyGoalControlResponse::from_json(raw : Json) -> Result[LodyGoalControlResponse, String]

    LodyGoalControlResponse::to_json

    LodyGoalPresence

    pub(all) enum LodyGoalPresence {
    GoalAbsent
    GoalCleared
    GoalSet(LodyGoalSnapshot)
    } derive(Eq,
    Debug
    )

    Tri-state for LodySessionMeta.goal (LodyGoalSnapshot | null, or the field absent): absent means "no goal information", explicit null means "the goal was cleared".

    LodyGoalPresence::from_json

    fn LodyGoalPresence::from_json(raw : Json?) -> Result[LodyGoalPresence, String]

    LodyGoalPresence::to_json

    fn LodyGoalPresence::to_json(self : LodyGoalPresence) -> (String, Json)?

    LodyGoalSnapshot

    pub(all) struct LodyGoalSnapshot {
    objective : String
    status : LodyGoalStatus
    iterations : Int?
    last_reason : String?
    created_at_epoch_seconds : Int64?
    updated_at_epoch_seconds : Int64?
    token_budget : Int?
    tokens_used : Int?
    time_used_seconds : Int64?
    } derive(Eq,
    Debug
    )

    LodyGoalSnapshot — one goal-management snapshot on session updates. lastReason / tokenBudget are string | null / number | null upstream without a distinct absent meaning, so both null and absent decode to None.

    LodyGoalSnapshot::from_json

    fn LodyGoalSnapshot::from_json(raw : Json) -> Result[LodyGoalSnapshot, String]

    LodyGoalSnapshot::to_json

    fn LodyGoalSnapshot::to_json(self : LodyGoalSnapshot) -> Json

    LodyGoalStatus

    pub(all) enum LodyGoalStatus {
    Active
    Paused
    Blocked
    Limited
    Complete
    } derive(Eq,
    Debug
    )

    Wire vocabulary of LodyGoalSnapshot.status.

    LodyGoalStatus::of_wire

    fn LodyGoalStatus::of_wire(wire : String) -> Result[LodyGoalStatus, String]

    LodyGoalStatus::to_wire

    fn LodyGoalStatus::to_wire(self : LodyGoalStatus) -> String

    LodyMessagePhase

    pub(all) enum LodyMessagePhase {
    Commentary
    FinalAnswer
    } derive(Eq,
    Debug
    )

    Wire vocabulary of LodySessionMeta.messagePhase (commentary vs final answer).

    LodyMessagePhase::of_wire

    fn LodyMessagePhase::of_wire(wire : String) -> Result[LodyMessagePhase, String]

    LodyMessagePhase::to_wire

    fn LodyMessagePhase::to_wire(self : LodyMessagePhase) -> String

    LodyNotice

    pub(all) struct LodyNotice {
    level : LodyNoticeLevel
    message : String
    source : String?
    } derive(Eq,
    Debug
    )

    LodyNotice — one notification on session updates.

    LodyNotice::from_json

    fn LodyNotice::from_json(raw : Json) -> Result[LodyNotice, String]

    LodyNotice::to_json

    fn LodyNotice::to_json(self : LodyNotice) -> Json

    LodyNoticeLevel

    pub(all) enum LodyNoticeLevel {
    Info
    Warning
    Error
    } derive(Eq,
    Debug
    )

    Wire vocabulary of LodyNotice.level.

    LodyNoticeLevel::of_wire

    fn LodyNoticeLevel::of_wire(wire : String) -> Result[LodyNoticeLevel, String]

    LodyNoticeLevel::to_wire

    fn LodyNoticeLevel::to_wire(self : LodyNoticeLevel) -> String

    LodyRateLimitsCapability

    pub(all) struct LodyRateLimitsCapability {
    version : Int
    query : Bool?
    } derive(Eq,
    Debug
    )

    LodyRateLimitsCapability — supports rate-limit notifications; query: true additionally advertises that _lody/rate_limits/get is answerable.

    LodyRateLimitsCapability::from_json

    fn LodyRateLimitsCapability::from_json(raw : Json) -> Result[LodyRateLimitsCapability, String]

    LodyRateLimitsCapability::to_json

    LodySessionHistoryReadRequest

    pub(all) struct LodySessionHistoryReadRequest {
    session_id : String
    } derive(Eq,
    Debug
    )

    LodySessionHistoryReadRequest_lody/session/history/read params.

    LodySessionHistoryReadRequest::from_json

    fn LodySessionHistoryReadRequest::from_json(raw : Json) -> Result[LodySessionHistoryReadRequest, String]

    LodySessionHistoryReadRequest::to_json

    LodySessionHistoryReadResponse

    pub(all) struct LodySessionHistoryReadResponse {
    } derive(Eq,
    Debug
    )

    LodySessionHistoryReadResponse — an empty object upstream. How the actual history content is carried is missing from the contract (likely a placeholder) — awaiting on-wire verification. Decoding tolerates and ignores any extra fields.

    LodySessionHistoryReadResponse::from_json

    LodySessionHistoryReadResponse::to_json

    LodySessionMeta

    pub(all) struct LodySessionMeta {
    turn_id : String?
    fork_at_turn : LodyForkAtTurn?
    steer : LodySteerPromptMeta?
    tool_name : String?
    activity : LodyActivityMeta?
    task : LodyTaskMeta?
    goal : LodyGoalPresence
    notice : LodyNotice?
    title_source : LodyTitleSource?
    message_phase : LodyMessagePhase?
    } derive(Eq,
    Debug
    )

    LodySessionMeta — the full _meta.lody envelope value on standard ACP session updates and tool_call/tool_call_update messages. No version field: versions live inside forkAtTurn / activity / task.

    LodySessionMeta::from_json

    fn LodySessionMeta::from_json(raw : Json) -> Result[LodySessionMeta, String]

    LodySessionMeta::to_json

    fn LodySessionMeta::to_json(self : LodySessionMeta) -> Json

    LodySteerApplied

    pub(all) struct LodySteerApplied {
    session_id : String
    steer_id : String
    } derive(Eq,
    Debug
    )

    LodySteerApplied_lody/session/steer_applied notification payload.

    LodySteerApplied::from_json

    fn LodySteerApplied::from_json(raw : Json) -> Result[LodySteerApplied, String]

    LodySteerApplied::to_json

    fn LodySteerApplied::to_json(self : LodySteerApplied) -> Json

    LodySteerOutcome

    pub(all) enum LodySteerOutcome {
    Injected
    Failed
    } derive(Eq,
    Debug
    )

    Wire vocabulary of LodySteerResponse.outcome.

    LodySteerOutcome::of_wire

    fn LodySteerOutcome::of_wire(wire : String) -> Result[LodySteerOutcome, String]

    LodySteerOutcome::to_wire

    fn LodySteerOutcome::to_wire(self : LodySteerOutcome) -> String

    LodySteerPromptMeta

    pub(all) struct LodySteerPromptMeta {
    id : String
    } derive(Eq,
    Debug
    )

    LodySteerPromptMeta{ id: string }, no version. Associates a message chunk with the _lody/session/steer request that produced it.

    LodySteerPromptMeta::from_json

    fn LodySteerPromptMeta::from_json(raw : Json) -> Result[LodySteerPromptMeta, String]

    LodySteerPromptMeta::to_json

    LodySteerRequest

    pub(all) struct LodySteerRequest {
    session_id : String
    prompt : Array[Json]
    steer_id : String
    } derive(
    Debug
    )

    LodySteerRequest_lody/session/steer params. The prompt element content shape is unconstrained upstream (generic TPrompt); it passes through as opaque JSON — awaiting on-wire verification.

    LodySteerRequest::from_json

    fn LodySteerRequest::from_json(raw : Json) -> Result[LodySteerRequest, String]

    LodySteerRequest::to_json

    fn LodySteerRequest::to_json(self : LodySteerRequest) -> Json

    LodySteerResponse

    pub(all) struct LodySteerResponse {
    outcome : LodySteerOutcome
    } derive(Eq,
    Debug
    )

    LodySteerResponse_lody/session/steer result.

    LodySteerResponse::from_json

    fn LodySteerResponse::from_json(raw : Json) -> Result[LodySteerResponse, String]

    LodySteerResponse::to_json

    LodySteeringCapability

    pub(all) struct LodySteeringCapability {
    version : Int
    transport : LodySteeringTransport
    upstream_turn : LodySteeringUpstreamTurn
    config_policy : LodySteeringConfigPolicy
    } derive(Eq,
    Debug
    )

    LodySteeringCapability — supports _lody/session/steer; declares the transport, upstream-turn policy, and config-effectiveness policy.

    LodySteeringCapability::from_json

    fn LodySteeringCapability::from_json(raw : Json) -> Result[LodySteeringCapability, String]

    LodySteeringCapability::to_json

    LodySteeringConfigPolicy

    pub(all) enum LodySteeringConfigPolicy {
    Active
    Apply
    } derive(Eq,
    Debug
    )

    Wire vocabulary of LodySteeringCapability.configPolicy.

    LodySteeringConfigPolicy::of_wire

    fn LodySteeringConfigPolicy::of_wire(wire : String) -> Result[LodySteeringConfigPolicy, String]

    LodySteeringConfigPolicy::to_wire

    LodySteeringTransport

    pub(all) enum LodySteeringTransport {
    Request
    Prompt
    } derive(Eq,
    Debug
    )

    Wire vocabulary of LodySteeringCapability.transport.

    LodySteeringTransport::of_wire

    fn LodySteeringTransport::of_wire(wire : String) -> Result[LodySteeringTransport, String]

    LodySteeringTransport::to_wire

    fn LodySteeringTransport::to_wire(self : LodySteeringTransport) -> String

    LodySteeringUpstreamTurn

    pub(all) enum LodySteeringUpstreamTurn {
    Same
    Handoff
    } derive(Eq,
    Debug
    )

    Wire vocabulary of LodySteeringCapability.upstreamTurn.

    LodySteeringUpstreamTurn::of_wire

    fn LodySteeringUpstreamTurn::of_wire(wire : String) -> Result[LodySteeringUpstreamTurn, String]

    LodySteeringUpstreamTurn::to_wire

    LodySubagentCancelRequest

    pub(all) struct LodySubagentCancelRequest {
    session_id : String
    task_id : String
    reason : String?
    } derive(Eq,
    Debug
    )

    LodySubagentCancelRequest_lody/subagents/cancel params.

    LodySubagentCancelRequest::from_json

    fn LodySubagentCancelRequest::from_json(raw : Json) -> Result[LodySubagentCancelRequest, String]

    LodySubagentCancelRequest::to_json

    LodySubagentCancelResponse

    pub(all) struct LodySubagentCancelResponse {
    } derive(Eq,
    Debug
    )

    LodySubagentCancelResponse — an empty object upstream. Decoding tolerates and ignores any extra fields.

    LodySubagentCancelResponse::from_json

    fn LodySubagentCancelResponse::from_json(raw : Json) -> Result[LodySubagentCancelResponse, String]

    LodySubagentCancelResponse::to_json

    LodySubagentCapability

    pub(all) struct LodySubagentCapability {
    version : Int
    lifecycle : Bool
    list : Bool?
    cancel : Bool?
    output : Bool?
    } derive(Eq,
    Debug
    )

    LodySubagentCapability — supports subagent lifecycle (lifecycle is required); list / cancel / output declare the three query methods.

    LodySubagentCapability::from_json

    fn LodySubagentCapability::from_json(raw : Json) -> Result[LodySubagentCapability, String]

    LodySubagentCapability::to_json

    LodySubagentOutputRequest

    pub(all) struct LodySubagentOutputRequest {
    session_id : String
    task_id : String
    tail : Int?
    } derive(Eq,
    Debug
    )

    LodySubagentOutputRequest_lody/subagents/output params.

    LodySubagentOutputRequest::from_json

    fn LodySubagentOutputRequest::from_json(raw : Json) -> Result[LodySubagentOutputRequest, String]

    LodySubagentOutputRequest::to_json

    LodySubagentOutputResponse

    pub(all) struct LodySubagentOutputResponse {
    output : String
    } derive(Eq,
    Debug
    )

    LodySubagentOutputResponse_lody/subagents/output result.

    LodySubagentOutputResponse::from_json

    fn LodySubagentOutputResponse::from_json(raw : Json) -> Result[LodySubagentOutputResponse, String]

    LodySubagentOutputResponse::to_json

    LodySubagentStatus

    pub(all) enum LodySubagentStatus {
    Running
    Completed
    Failed
    TimedOut
    Killed
    Lost
    } derive(Eq,
    Debug
    )

    Wire vocabulary of LodySubagentTask.status (_lody/subagents/list track: running / completed / failed / timed_out / killed / lost). Deliberately NOT shared with LodyTaskStatus — upstream keeps the two status vocabularies disjoint.

    LodySubagentStatus::of_wire

    fn LodySubagentStatus::of_wire(wire : String) -> Result[LodySubagentStatus, String]

    LodySubagentStatus::to_wire

    fn LodySubagentStatus::to_wire(self : LodySubagentStatus) -> String

    LodySubagentTask

    pub(all) struct LodySubagentTask {
    task_id : String
    description : String
    status : LodySubagentStatus
    agent_id : String?
    subagent_type : String?
    model_id : String?
    thinking_effort : String?
    started_at_epoch_seconds : Int64
    ended_at_epoch_seconds : Int64?
    stop_reason : String?
    } derive(Eq,
    Debug
    )

    LodySubagentTask — one row of _lody/subagents/list. Status vocabulary (running/completed/failed/timed_out/killed/lost) is disjoint from LodyTaskStatus. endedAtEpochSeconds is required but nullable upstream, so to_json always emits the key (null until the task ends).

    LodySubagentTask::from_json

    fn LodySubagentTask::from_json(raw : Json) -> Result[LodySubagentTask, String]

    LodySubagentTask::to_json

    fn LodySubagentTask::to_json(self : LodySubagentTask) -> Json

    LodySubagentsListRequest

    pub(all) struct LodySubagentsListRequest {
    session_id : String
    active_only : Bool?
    } derive(Eq,
    Debug
    )

    LodySubagentsListRequest_lody/subagents/list params.

    LodySubagentsListRequest::from_json

    fn LodySubagentsListRequest::from_json(raw : Json) -> Result[LodySubagentsListRequest, String]

    LodySubagentsListRequest::to_json

    LodySubagentsListResponse

    pub(all) struct LodySubagentsListResponse {
    tasks : Array[LodySubagentTask]
    } derive(Eq,
    Debug
    )

    LodySubagentsListResponse_lody/subagents/list result.

    LodySubagentsListResponse::from_json

    fn LodySubagentsListResponse::from_json(raw : Json) -> Result[LodySubagentsListResponse, String]

    LodySubagentsListResponse::to_json

    LodyTaskCapability

    pub(all) struct LodyTaskCapability {
    version : Int
    background : Bool?
    scheduled : Bool?
    } derive(Eq,
    Debug
    )

    LodyTaskCapability — tool_call envelopes may carry _meta.lody.task; background / scheduled declare the supported task subclasses.

    LodyTaskCapability::from_json

    fn LodyTaskCapability::from_json(raw : Json) -> Result[LodyTaskCapability, String]

    LodyTaskCapability::to_json

    LodyTaskKind

    pub(all) enum LodyTaskKind {
    Subagent
    Background
    Scheduled
    } derive(Eq,
    Debug
    )

    Wire vocabulary of LodyTaskMeta.kind (subagent / background / scheduled task lifecycles).

    LodyTaskKind::of_wire

    fn LodyTaskKind::of_wire(wire : String) -> Result[LodyTaskKind, String]

    LodyTaskKind::to_wire

    fn LodyTaskKind::to_wire(self : LodyTaskKind) -> String

    LodyTaskMeta

    pub(all) struct LodyTaskMeta {
    version : Int
    task_id : String
    kind : LodyTaskKind
    status : LodyTaskStatus
    description : String?
    actor : String?
    parent_task_id : String?
    parent_tool_call_id : String?
    model_id : String?
    started_at_epoch_seconds : Int64?
    ended_at_epoch_seconds : Int64?
    summary : String?
    error : String?
    last_tool_name : String?
    usage : LodyTaskUsage?
    skip_transcript : Bool?
    } derive(Eq,
    Debug
    )

    LodyTaskMeta — subagent / background / scheduled task lifecycle on tool_call envelopes. The task track: status vocabulary is pending/in_progress/completed/failed (disjoint from the subagent-list vocabulary; see LodySubagentStatus).

    LodyTaskMeta::from_json

    fn LodyTaskMeta::from_json(raw : Json) -> Result[LodyTaskMeta, String]

    LodyTaskMeta::to_json

    fn LodyTaskMeta::to_json(self : LodyTaskMeta) -> Json

    LodyTaskStatus

    pub(all) enum LodyTaskStatus {
    Pending
    InProgress
    Completed
    Failed
    } derive(Eq,
    Debug
    )

    Wire vocabulary of LodyTaskMeta.status (task track: pending / in_progress / completed / failed). Deliberately NOT shared with the subagent-list status vocabulary — upstream keeps the two disjoint.

    LodyTaskStatus::of_wire

    fn LodyTaskStatus::of_wire(wire : String) -> Result[LodyTaskStatus, String]

    LodyTaskStatus::to_wire

    fn LodyTaskStatus::to_wire(self : LodyTaskStatus) -> String

    LodyTaskUsage

    pub(all) struct LodyTaskUsage {
    total_tokens : Int?
    tool_uses : Int?
    duration_ms : Int64?
    } derive(Eq,
    Debug
    )

    LodyTaskMeta.usage — totals for one delegated task.

    LodyTaskUsage::from_json

    fn LodyTaskUsage::from_json(raw : Json) -> Result[LodyTaskUsage, String]

    LodyTaskUsage::to_json

    fn LodyTaskUsage::to_json(self : LodyTaskUsage) -> Json

    LodyTitleSource

    pub(all) enum LodyTitleSource {
    Explicit
    Generated
    Fallback
    Unset
    } derive(Eq,
    Debug
    )

    Wire vocabulary of LodySessionMeta.titleSource.

    LodyTitleSource::of_wire

    fn LodyTitleSource::of_wire(wire : String) -> Result[LodyTitleSource, String]

    LodyTitleSource::to_wire

    fn LodyTitleSource::to_wire(self : LodyTitleSource) -> String

    LodyVersionOneCapability

    pub(all) struct LodyVersionOneCapability {
    version : Int
    } derive(Eq,
    Debug
    )

    LodyVersionOneCapability — the { version: 1 } base shared by every feature key.

    LodyVersionOneCapability::from_json

    fn LodyVersionOneCapability::from_json(raw : Json) -> Result[LodyVersionOneCapability, String]

    LodyVersionOneCapability::to_json

    LodyVersionOneCapability::version_one

    ModelUsage

    pub(all) struct ModelUsage {
    input_tokens : Int
    output_tokens : Int
    cache_read_input_tokens : Int
    cache_creation_input_tokens : Int?
    reasoning_output_tokens : Int?
    web_search_requests : Int?
    cost_usd : Double?
    context_window : Int64?
    } derive(Eq,
    Debug
    )

    ModelUsage — token/cost totals for one model bucket.

    ModelUsage::from_json

    fn ModelUsage::from_json(raw : Json) -> Result[ModelUsage, String]

    ModelUsage::to_json

    fn ModelUsage::to_json(self : ModelUsage) -> Json

    RateLimit

    pub(all) struct RateLimit {
    limit_id : String
    scope : RateLimitScope
    limit_name : String?
    plan_name : String?
    windows : Array[RateLimitWindow]
    wallet : RateLimitWallet?
    } derive(Eq,
    Debug
    )

    RateLimit — one limit with its windows and optional wallet. limitName, planName, and wallet are nullable-but-optional upstream without a distinct absent meaning, so null and absent both decode to None.

    RateLimit::from_json

    fn RateLimit::from_json(raw : Json) -> Result[RateLimit, String]

    RateLimit::to_json

    fn RateLimit::to_json(self : RateLimit) -> Json

    RateLimitScope

    pub(all) struct RateLimitScope {
    provider_id : String
    account_id : String?
    model_id : String?
    } derive(Eq,
    Debug
    )

    RateLimitScope — which provider/account/model a limit applies to.

    RateLimitScope::from_json

    fn RateLimitScope::from_json(raw : Json) -> Result[RateLimitScope, String]

    RateLimitScope::to_json

    fn RateLimitScope::to_json(self : RateLimitScope) -> Json

    RateLimitWallet

    pub(all) struct RateLimitWallet {
    balance_cents : Int64
    total_cents : Int64
    monthly_charge_limit_enabled : Bool
    monthly_charge_limit_cents : Int64
    monthly_used_cents : Int64
    currency : String
    } derive(Eq,
    Debug
    )

    RateLimitWallet — credit-balance state; money in cents, ISO currency string (upstream constrains the format no further).

    RateLimitWallet::from_json

    fn RateLimitWallet::from_json(raw : Json) -> Result[RateLimitWallet, String]

    RateLimitWallet::to_json

    fn RateLimitWallet::to_json(self : RateLimitWallet) -> Json

    RateLimitWindow

    pub(all) struct RateLimitWindow {
    used_percent : Double
    window_duration_seconds : Int64?
    resets_at_epoch_seconds : Int64?
    } derive(Eq,
    Debug
    )

    RateLimitWindow — one usage window; usedPercent is 0..100 inclusive.

    RateLimitWindow::from_json

    fn RateLimitWindow::from_json(raw : Json) -> Result[RateLimitWindow, String]

    RateLimitWindow::to_json

    fn RateLimitWindow::to_json(self : RateLimitWindow) -> Json

    RateLimitsGetRequest

    pub(all) struct RateLimitsGetRequest {
    session_id : String?
    account_id : String?
    model_id : String?
    } derive(Eq,
    Debug
    )

    RateLimitsGetRequest_lody/rate_limits/get params. Not session bound: every field is an optional filter.

    RateLimitsGetRequest::from_json

    fn RateLimitsGetRequest::from_json(raw : Json) -> Result[RateLimitsGetRequest, String]

    RateLimitsGetRequest::to_json

    RateLimitsSnapshot

    pub(all) struct RateLimitsSnapshot {
    rate_limits : Array[RateLimit]
    fetched_at_epoch_seconds : Int64?
    } derive(Eq,
    Debug
    )

    RateLimitsSnapshot — the shape of _lody/rate_limits/get's result and of the _lody/rate_limits/update notification payload.

    RateLimitsSnapshot::from_json

    fn RateLimitsSnapshot::from_json(raw : Json) -> Result[RateLimitsSnapshot, String]

    RateLimitsSnapshot::to_json

    SessionUsageUpdate

    pub(all) struct SessionUsageUpdate {
    session_id : String
    usage : ModelUsage
    model_usage : Map[String, ModelUsage]?
    } derive(Eq,
    Debug
    )

    SessionUsageUpdate_lody/session/usage_update notification payload: whole-session usage plus optional per-model buckets.

    SessionUsageUpdate::from_json

    fn SessionUsageUpdate::from_json(raw : Json) -> Result[SessionUsageUpdate, String]

    SessionUsageUpdate::to_json

    LODY_RATE_LIMITS_GET

    let LODY_RATE_LIMITS_GET : String

    LODY_RATE_LIMITS_UPDATE

    let LODY_RATE_LIMITS_UPDATE : String

    LODY_SESSION_GOAL

    let LODY_SESSION_GOAL : String

    LODY_SESSION_HISTORY_READ

    let LODY_SESSION_HISTORY_READ : String

    LODY_SESSION_STEER

    let LODY_SESSION_STEER : String

    LODY_SESSION_STEER_APPLIED

    let LODY_SESSION_STEER_APPLIED : String

    LODY_SESSION_USAGE_UPDATE

    let LODY_SESSION_USAGE_UPDATE : String

    LODY_SUBAGENTS_CANCEL

    let LODY_SUBAGENTS_CANCEL : String

    LODY_SUBAGENTS_LIST

    let LODY_SUBAGENTS_LIST : String

    LODY_SUBAGENTS_OUTPUT

    let LODY_SUBAGENTS_OUTPUT : String

    LODY_TOOL_CRON_CREATE

    let LODY_TOOL_CRON_CREATE : String

    Canonical wire identity of the cron-task creation tool flow.

    LODY_TOOL_CRON_DELETE

    let LODY_TOOL_CRON_DELETE : String

    Canonical wire identity of the cron-task deletion tool flow.

    LODY_TOOL_CRON_LIST

    let LODY_TOOL_CRON_LIST : String

    Canonical wire identity of the cron-task listing tool flow.

    LODY_TOOL_IMAGE_GENERATION

    let LODY_TOOL_IMAGE_GENERATION : String

    Canonical wire identity of the image generation tool flow.

    LODY_TOOL_SCHEDULE_WAKEUP

    let LODY_TOOL_SCHEDULE_WAKEUP : String

    Canonical wire identity of the wakeup scheduling tool flow.

    is_lody_tool_name

    fn is_lody_tool_name(name : String) -> Bool

    True when name is one of the five canonical lody tool identities.

    lody_extension_methods

    fn lody_extension_methods() -> Array[String]

    All ten LODY_EXTENSION_METHODS wire names, upstream declaration order (7 requests then 3 notifications).

    lody_tool_names

    fn lody_tool_names() -> Array[String]

    All five canonical lody tool wire names, upstream declaration order.

    normalize_lody_extension_method

    fn normalize_lody_extension_method(method_name : String) -> String

    normalizeLodyExtensionMethod: prepend the _ namespace prefix when the method does not already start with one.