omegon-extension
Safe, versioned SDK for building Omegon extensions.
Extensions run as isolated processes communicating via JSON-RPC over stdin/stdout. An extension crash never crashes the host agent.
Usage
[]
= "0.25"
omegon-extension uses normal crate SemVer for Rust releases and exposes
SDK_CONTRACT_VERSION for cross-language wire compatibility. SDK crate versions
are independent from Omegon host patch versions; the current crate line can still
expose SDK contract version 0.24 for host compatibility.
Python and TypeScript SDKs validate against the canonical contract artifact in
schema/sdk-contract.json, which is also embedded as SDK_CONTRACT_JSON.
use ;
use ;
;
async
HostActions
HostActions are the SDK contract for host-managed side effects. Extensions describe intent; Omegon validates every action, applies manifest/runtime/operator policy, and only then renders or executes it. Returning a HostAction does not make the effect run by itself.
Use declarative actions in ordinary tool results when the host should present or queue a side effect with the tool response:
use ;
use ;
let params = new
.with_args;
let action = new?;
let result = text.with_action;
let value = to_value?;
The serialized tool result contains ordinary content plus an actions array:
Extensions that need the advanced imperative path can use HostProxy from serve_v2().
execute_action() sends JSON-RPC method actions/execute with params
{"action": <HostAction>} and returns a full HostActionOutcome:
use TerminalCreateResult;
let outcome = host.execute_action.await?;
if let Some = outcome.result
The expected host response shape is:
To advertise support during initialize, set the capability flags relevant to the
extension:
terminal.create@1 is SDK/protocol foundation only. The host-side executor, policy
engine, and real terminal process creation live in Omegon core, not in this crate.
License
Licensed under either of Apache License, Version 2.0 or MIT License at your option.