Expand description
SIM’s server library: a loadable lib that serves eval and agents over a transport. It exposes sites (local, coroutine, pipeline, loop, fabric), frame routing, REPL drivers, connections, and transports so callers can request evaluation, stream replies, and run agent loops across the runtime.
Transports are in-process by default: the default feature set enables no
network surface. The network/HTTP transport is the non-default
server-net-http feature and must be opted into explicitly; the various
trigger-* features add their respective inbound triggers the same way.
Structs§
- Buffered
Stream Sink StreamSinkthat buffers received chunks into aStreamHandle.- Connection
- Live client handle to a server endpoint, evaluating expressions over a transport
EvalSite. - Cookbook
WebResponse - Minimal HTTP response model for cookbook route adapters.
- Cookbook
WebState - Cookbook state exposed by the WebUI route and JSON API.
- Coroutine
- Live, resumable coroutine bound to a server address and handler value.
- Coroutine
Eval Site - An eval site that resumes a
Coroutinewith each request’s expression. - Fabric
Eval Site - An eval site that delegates requests to a distributed
EvalFabric. - Frame
Envelope - Out-of-band metadata attached to a
ServerFramealongside its payload. - Frame
Router - Allocates message ids and queues inbound server frames for a connection.
- Isolation
Policy - Per-axis
ShareModeselection controlling how an evaluation is isolated from its caller. - Local
Eval Site - An eval site that evaluates requests directly in the local runtime.
- Local
Transport - In-process transport that routes frames directly to a local eval site.
- Loop
Eval Site - An eval site that repeatedly runs its pipeline steps – up to
max_iterationstimes – until theuntilpredicate fires on a reply. - Loopback
Transport Endpoint - RAII guard for a registered loopback endpoint.
- Pipeline
Eval Site - An eval site that threads each request through an ordered chain of connection steps, feeding each step’s reply into the next.
- Repl
Options - Configuration for a single
run_replinvocation. - Resolved
Address - Outcome of resolving a
ServerAddressto a concrete eval site and codec set. - Server
- Live server handle: an address bound to an
EvalSite, its codec and threading configuration, lifecycle status, triggers, and optionalServerRuntime. - Server
Address Descriptor - Citizen descriptor for a
server/Address, wrapping a validated addressExpr. - Server
Frame - A wire frame carrying a codec-encoded payload plus protocol metadata.
- Server
Frame Descriptor - Citizen descriptor for a
server/Frame, capturing the wire metadata of one transport frame. - Server
Lib - The server
Libimplementation, registering the server functions and CLI surface when loaded into a runtime. - Server
Runtime - Server-side runtime: owns the transport, tracks live sessions and worker threads, and records connection and message counters.
- Session
- State of a single server connection session.
- Stream
Handle - Buffering, cancellable handle over a server stream’s chunk queue.
- TcpServer
Transport - TCP listener transport for server-frame connections.
- Trigger
Handle - Live handle to a running trigger that delivers source events into a server.
Enums§
- Coroutine
Status - Lifecycle state of a
Coroutine. - Frame
Kind - Discriminates the role a
ServerFrameplays in the wire protocol. - Lifecycle
Command - Command carried by a
FrameKind::Lifecycleframe. - Repl
Driver Spec - Declarative description of a REPL line driver, resolved into a concrete
LineDriverbyDriverSpec::create_driver. - Repl
Output - Where a REPL run sends its rendered result.
- Server
Address - Location of a SIM server endpoint, parsed from an address expression.
- Server
Status - Lifecycle status of a running server.
- Share
Mode - How one isolation axis (env, libs, factory, registry, capabilities) is derived for an evaluation.
- Site
Kind - Identifies the variety of an eval
Site. - Thread
Mode - Threading strategy a server uses to service connections.
Traits§
- Connection
Transport - One open connection over which server frames are sent and received.
- Eval
Site - A request-answering eval endpoint: it accepts server frames and produces
reply frames, optionally streaming or exposing an
EvalFabric. - Line
Driver - Source of REPL input lines and sink for rendered output.
- Server
Transport - Listening side of a transport: binds an address and accepts connections.
- Site
- An
EvalSitethat is also a stream endpoint and can realize placed dataflow fragments. - Stream
Sink - Receiver for streamed server frames produced by
EvalSite::stream.
Functions§
- connect_
transport_ site - Connects to
addressand returns the eval site plus negotiated codec. - connect_
transport_ site_ with_ loopback - Connects to
address, returning the eval site plus negotiated codec. - decode_
frame_ payload - Decodes a frame payload back into an expression using
codec. - decode_
transport_ frame - Decodes a length-prefixed transport frame from
bytes. - encode_
frame_ payload - Encodes an expression with
codecand returns the frame payload bytes. - encode_
transport_ frame - Encodes a frame into its length-prefixed transport byte form.
- eval_
reply_ from_ frame - Decodes a response
ServerFrameback into anEvalReply. - eval_
request_ from_ frame - Decodes a request
ServerFrameback into anEvalRequest. - install_
server_ lib - Installs the server lib into
cxexactly once, registering its functions and CLI exports. - parse_
duration - Parses a
Durationfrom a duration string or an integer millisecond count. - realize_
site_ fragment - Realizes a placed fragment on
site, returning the resulting stream envelopes for its output edges. - realize_
stream_ events - Realizes
fragmentonsiteand returns its stream events; an alias forrealizenamed for the streaming call site. - register_
address_ resolver - Registers an
AddressResolverunder an addresskindin the global resolver registry. - register_
line_ driver - Registers a
LineDriverFactoryundernamein the global line-driver registry. - register_
loopback_ transport_ endpoint - Registers
siteas the loopback endpoint foraddress. - register_
wasm_ region - Registers a wasm guest module under
regionusing the default runtime. - run_
repl - Runs a REPL against
options.connection: either evaluates a single supplied input and returns its rendered result, or loops over driver-supplied lines, decoding, evaluating, and writing each result until input is exhausted. - server_
address_ class_ symbol - Returns the class symbol
server/Addressfor the address descriptor citizen. - server_
frame_ class_ symbol - Returns the class symbol
server/Framefor the frame descriptor citizen. - server_
frame_ from_ reply - Encodes an
EvalReplyinto a responseServerFrameundercodec. - server_
frame_ from_ request - Encodes an
EvalRequestinto a requestServerFrameundercodec. - stream_
chunk_ frame_ from_ expr - Builds the standard
StreamChunkframe for one expression payload. - stream_
end_ frame - Builds the standard
StreamEndframe for a stream envelope. - stream_
frame_ from_ expr - Builds a stream boundary or chunk frame from an expression payload.
- stream_
frame_ to_ expr - Converts a stream frame into the expression it carries, if any.
- stream_
frame_ to_ value - Converts a stream frame into the value it carries, if any.
Type Aliases§
- Address
Resolver - Function that resolves a
ServerAddress(with offered codecs) to aResolvedAddress. - Line
Driver Factory - Function that builds a
LineDriverfrom a configuration expression.