agent-core-sdk

Shared MoonBit process foundation for agent CLIs

agent
cli
jsonl
sdk
moonbit
moon add totto2727/agent-core-sdk@0.1.1
Download zip
Author
Version
0.1.1
License
MIT
Last updated
5 days ago
Downloads
150

Dependencies

README

#Agent Core SDK

agent-core-sdk provides shared infrastructure for MoonBit SDKs that integrate with agent runtimes.

The cli package owns the native process lifecycle for JSONL-emitting agent CLIs: stdin delivery, ordered JSONL parsing and typed decoding, stderr capture, exit status reporting, callback-requested termination, and cancellation-safe child cleanup. Provider SDKs remain responsible for building invocations, defining provider-specific event types, and aggregating turns.

The server directory is reserved for future server-side infrastructure and intentionally contains no implementation.

#Targets

The cli package uses one source and package layout for the native and wasm targets. wasm is the preferred target, and native remains supported. JavaScript, WebAssembly GC, and LLVM are not supported targets.

#Usage

struct Event {
message : String
} derive(FromJson)

async fn example() -> @cli.RunResult {
@cli.run(
@cli.Invocation::new(
command="agent",
arguments=["run", "--format", "json"],
input="Hello",
),
async fn(event : Event) {
println(event.message)
true
},
)
}

Add the package to a consumer's moon.pkg:

import { "totto2727/agent-core-sdk/cli", }

#Development

Enter the Nix development shell and run the standard MoonBit checks:

nix develop moon info moon check moon test moon build moon package --list

CI uses the shared MoonBit setup and check actions with their default Nix dev shell. The workflow does not override the target, so these actions validate the preferred wasm target while the module continues to declare both native and wasm as supported targets.

Powered by MoonBit

Site sourceReport issuePackagesBuild queueSkillsStatistics

© 2026 mooncakes.io