Skip to main content

Crate lash_core

Crate lash_core 

Source

Re-exports§

pub use attachments::AttachmentStore;
pub use attachments::AttachmentStoreError;
pub use attachments::AttachmentStorePersistence;
pub use attachments::InMemoryAttachmentStore;
pub use attachments::SessionScopedAttachmentStore;
pub use attachments::StoredAttachment;
pub use chronological::BorrowedChronologicalEntry;
pub use chronological::BorrowedChronologicalMessage;
pub use chronological::BorrowedChronologicalPayload;
pub use chronological::ChronologicalEntry;
pub use chronological::ChronologicalPayload;
pub use chronological::ChronologicalProjection;
pub use chronological::visit_turn_view;
pub use direct::DirectJsonSchema;
pub use direct::DirectLlmClient;
pub use direct::DirectLlmError;
pub use direct::DirectMessage;
pub use direct::DirectOutputSpec;
pub use direct::DirectPart;
pub use direct::DirectRequest;
pub use direct::DirectRole;
pub use host_events::HostEvent;
pub use host_events::HostEventCatalog;
pub use host_events::HostEventEmitReport;
pub use host_events::HostEventKey;
pub use host_events::HostEventOccurrenceRecord;
pub use host_events::HostEventOccurrenceRequest;
pub use host_events::HostEventRouter;
pub use host_events::HostEventStore;
pub use host_events::InMemoryHostEventStore;
pub use host_events::TriggerDeliveryReservation;
pub use host_events::TriggerRegistration;
pub use host_events::TriggerSourceType;
pub use host_events::TriggerSubscriptionDraft;
pub use host_events::TriggerSubscriptionFilter;
pub use host_events::TriggerSubscriptionRecord;
pub use host_events::TriggerTargetSummary;
pub use host_events::default_host_event_source_key;
pub use host_events::deterministic_delivery_process_id;
pub use host_events::deterministic_occurrence_id;
pub use host_events::empty_host_event_source_key;
pub use host_events::host_event_occurrence_request_hash;
pub use host_events::host_event_source_type;
pub use host_events::validate_host_event_occurrence_request;
pub use tool_registry::ReconfigureError;
pub use tool_registry::ToolRegistry;
pub use tool_registry::ToolSourceHandle;
pub use tool_registry::ToolState;
pub use tool_registry::ToolStateEntry;
pub use llm::transport::LlmTransportError;
pub use llm::transport::ProviderFailure;
pub use llm::transport::ProviderFailureKind;
pub use plugin::AgentFrameAssignment;
pub use plugin::AgentFrameId;
pub use plugin::AgentFrameReason;
pub use plugin::AgentFrameRecord;
pub use plugin::AgentFrameStatus;
pub use plugin::AppendSessionNodesRequest;
pub use plugin::AppendSessionNodesResult;
pub use plugin::AssistantResponseHookContext;
pub use plugin::AssistantResponseTransform;
pub use plugin::AssistantStreamHookContext;
pub use plugin::AssistantStreamTransform;
pub use plugin::CheckpointHookContext;
pub use plugin::DirectCompletion;
pub use plugin::DirectLlmCompletion;
pub use plugin::HistoryError;
pub use plugin::HistoryRegistrations;
pub use plugin::HistoryRewriteMetadata;
pub use plugin::HistoryRewriter;
pub use plugin::HistoryState;
pub use plugin::HostEventRegistrations;
pub use plugin::PersistentRuntimeServices;
pub use plugin::PluginAction;
pub use plugin::PluginActionContext;
pub use plugin::PluginActionDef;
pub use plugin::PluginActionFailure;
pub use plugin::PluginActionInvokeError;
pub use plugin::PluginActionKind;
pub use plugin::PluginDirective;
pub use plugin::PluginError;
pub use plugin::PluginFactory;
pub use plugin::PluginHost;
pub use plugin::PluginLifecycleEvent;
pub use plugin::PluginLifecycleEventHook;
pub use plugin::PluginOptions;
pub use plugin::PluginOwned;
pub use plugin::PluginRegistrar;
pub use plugin::PluginSession;
pub use plugin::PluginSessionContext;
pub use plugin::PluginSessionSnapshot;
pub use plugin::PluginSnapshotArtifact;
pub use plugin::PluginSnapshotEntry;
pub use plugin::PluginSnapshotMeta;
pub use plugin::PluginSpec;
pub use plugin::PluginSpecFactory;
pub use plugin::PromptHookContext;
pub use plugin::ProtocolBeforeLlmCallContext;
pub use plugin::ProtocolLlmCallAction;
pub use plugin::RewriteContext;
pub use plugin::RewriteTrigger;
pub use plugin::RuntimeServices;
pub use plugin::SessionAppendNode;
pub use plugin::SessionConfigChangedContext;
pub use plugin::SessionContextSurface;
pub use plugin::SessionCreateRequest;
pub use plugin::SessionGraphService;
pub use plugin::SessionHandle;
pub use plugin::SessionLifecycleService;
pub use plugin::SessionParam;
pub use plugin::SessionPlugin;
pub use plugin::SessionPluginSource;
pub use plugin::SessionReadView;
pub use plugin::SessionRelation;
pub use plugin::SessionSnapshot;
pub use plugin::SessionStartPoint;
pub use plugin::SessionStateChangedContext;
pub use plugin::SessionStateService;
pub use plugin::SessionToolAccess;
pub use plugin::SessionTurnInput;
pub use plugin::SessionTurnRequest;
pub use plugin::SnapshotReader;
pub use plugin::SnapshotWriter;
pub use plugin::SubagentSessionContext;
pub use plugin::ToolDiscoveryContext;
pub use plugin::ToolDiscoveryContribution;
pub use plugin::ToolDiscoveryContributor;
pub use plugin::ToolDiscoveryToolContribution;
pub use plugin::ToolResultProjectionContext;
pub use plugin::ToolResultProjector;
pub use plugin::TurnContextTransform;
pub use plugin::TurnHookContext;
pub use plugin::TurnResultHookContext;
pub use plugin::TurnResultSummary;
pub use plugin::TurnTransformContext;
pub use plugin::plugin_action_def;
pub use provider::CacheRetention;
pub use provider::EmptyProviderResolver;
pub use provider::LlmTimeouts;
pub use provider::MapProviderResolver;
pub use provider::Provider;
pub use provider::ProviderBinding;
pub use provider::ProviderComponents;
pub use provider::ProviderFactory;
pub use provider::ProviderHandle;
pub use provider::ProviderModelPolicy;
pub use provider::ProviderOptions;
pub use provider::ProviderResolutionError;
pub use provider::ProviderSpec;
pub use provider::ProviderThinkingPolicy;
pub use provider::RequestTimeout;
pub use provider::RuntimeProviderResolver;
pub use provider::SingleProviderResolver;
pub use provider::StaticModelPolicy;
pub use runtime::AgentFrameRun;
pub use runtime::AssembledTurn;
pub use runtime::AssistantOutput;
pub use runtime::CodeOutputRecord;
pub use runtime::DefaultProcessCancelAbility;
pub use runtime::DeliveryPolicy;
pub use runtime::DirectCompletionClient;
pub use runtime::DurableProcessWorker;
pub use runtime::DurableProcessWorkerConfig;
pub use runtime::DurableStoreFacet;
pub use runtime::EffectHost;
pub use runtime::EffectScope;
pub use runtime::EmbeddedRuntimeBuilder;
pub use runtime::EmbeddedRuntimeHost;
pub use runtime::EventSink;
pub use runtime::ExecutionSummary;
pub use runtime::InMemorySessionStore;
pub use runtime::InMemorySessionStoreFactory;
pub use runtime::InlineEffectHost;
pub use runtime::InlineProcessRunHandle;
pub use runtime::InlineRuntimeEffectController;
pub use runtime::InputItem;
pub use runtime::LashRuntime;
pub use runtime::MergeKey;
pub use runtime::NoopEventSink;
pub use runtime::NoopTurnActivitySink;
pub use runtime::ObservedProcess;
pub use runtime::ObservedProcessEvent;
pub use runtime::ObservedWorkItem;
pub use runtime::OutputState;
pub use runtime::PROCESS_LEASE_SCHEMA_VERSION;
pub use runtime::ParkedSession;
pub use runtime::ProcessAwaitOutput;
pub use runtime::ProcessCancelAbility;
pub use runtime::ProcessCancelAllRequest;
pub use runtime::ProcessCancelRequest;
pub use runtime::ProcessCancelSource;
pub use runtime::ProcessCancelSummary;
pub use runtime::ProcessDefinitionSelector;
pub use runtime::ProcessDefinitionSummary;
pub use runtime::ProcessEvent;
pub use runtime::ProcessEventAppendRequest;
pub use runtime::ProcessEventAppendResult;
pub use runtime::ProcessEventType;
pub use runtime::ProcessExecutionContext;
pub use runtime::ProcessExternalRef;
pub use runtime::ProcessHandleDescriptor;
pub use runtime::ProcessHandleGrant;
pub use runtime::ProcessHandleSummary;
pub use runtime::ProcessId;
pub use runtime::ProcessInput;
pub use runtime::ProcessLease;
pub use runtime::ProcessLeaseCompletion;
pub use runtime::ProcessLifecycleStatus;
pub use runtime::ProcessListFilter;
pub use runtime::ProcessListMode;
pub use runtime::ProcessOpScope;
pub use runtime::ProcessProvenance;
pub use runtime::ProcessRecord;
pub use runtime::ProcessRegistration;
pub use runtime::ProcessRegistry;
pub use runtime::ProcessRunHandle;
pub use runtime::ProcessRuntimeHost;
pub use runtime::ProcessScope;
pub use runtime::ProcessScopeId;
pub use runtime::ProcessService;
pub use runtime::ProcessSessionDeleteReport;
pub use runtime::ProcessStartGrant;
pub use runtime::ProcessStartOptions;
pub use runtime::ProcessStartRequest;
pub use runtime::ProcessStatus;
pub use runtime::ProcessStatusFilter;
pub use runtime::ProcessTerminalSemantics;
pub use runtime::ProcessTerminalSpec;
pub use runtime::ProcessTerminalState;
pub use runtime::ProcessValueSelector;
pub use runtime::ProcessWake;
pub use runtime::ProcessWakeDedupeKey;
pub use runtime::ProcessWakeDelivery;
pub use runtime::ProcessWakeSpec;
pub use runtime::ProcessWorkDriver;
pub use runtime::ProcessWorkObserver;
pub use runtime::ProcessWorkPoke;
pub use runtime::ProcessWorkRunner;
pub use runtime::ProcessWorkSnapshot;
pub use runtime::ProtocolSessionExtension;
pub use runtime::ProtocolSessionExtensionHandle;
pub use runtime::ProtocolTurnExtension;
pub use runtime::ProtocolTurnExtensionHandle;
pub use runtime::QueuedWorkPoke;
pub use runtime::QueuedWorkRunHandle;
pub use runtime::QueuedWorkRunOutcome;
pub use runtime::QueuedWorkRunRequest;
pub use runtime::QueuedWorkRunner;
pub use runtime::Residency;
pub use runtime::RuntimeEnvironment;
pub use runtime::RuntimeEnvironmentBuilder;
pub use runtime::RuntimeError;
pub use runtime::RuntimeErrorCode;
pub use runtime::RuntimeHandle;
pub use runtime::RuntimeHostConfig;
pub use runtime::RuntimeObservation;
pub use runtime::ScopedEffectController;
pub use runtime::SessionCommand;
pub use runtime::SessionCommandReceipt;
pub use runtime::SessionStoreCreateRequest;
pub use runtime::SessionStoreFactory;
pub use runtime::SessionUsageReport;
pub use runtime::SlotPolicy;
pub use runtime::TerminationPolicy;
pub use runtime::TokenLedgerEntry;
pub use runtime::TurnActivity;
pub use runtime::TurnActivityId;
pub use runtime::TurnActivitySink;
pub use runtime::TurnContext;
pub use runtime::TurnEvent;
pub use runtime::TurnInput;
pub use runtime::TurnIssue;
pub use runtime::TurnOptions;
pub use runtime::UnavailableProcessService;
pub use runtime::UsageReportRow;
pub use runtime::UsageTotals;
pub use runtime::current_epoch_ms;
pub use runtime::diff_token_ledger;
pub use runtime::diff_usage_reports;
pub use runtime::ensure_durable_effect_input;
pub use runtime::epoch_ms_from_system_time;
pub use runtime::lashlang_process_event_types;
pub use runtime::system_time_from_epoch_ms;
pub use runtime::LlmRequestSpec;
pub use runtime::ProcessCommand;
pub use runtime::ProcessEffectOutcome;
pub use runtime::ProcessEventSemanticsSpec;
pub use runtime::RuntimeEffectCommand;
pub use runtime::RuntimeEffectController;
pub use runtime::RuntimeEffectControllerError;
pub use runtime::RuntimeEffectEnvelope;
pub use runtime::RuntimeEffectKind;
pub use runtime::RuntimeEffectLocalExecutor;
pub use runtime::RuntimeEffectOutcome;
pub use runtime::RuntimeInvocation;
pub use runtime::RuntimeSessionState;
pub use session::ExecRequest;
pub use session::InjectedTurnInput;
pub use session::RuntimeExecutionContext;
pub use session::Session;
pub use session::SessionError;
pub use session::ToolInvocation;
pub use session::ToolInvocationReply;
pub use session_graph::PersistedSessionConfig;
pub use session_graph::PersistedTurnState;
pub use session_graph::SessionGraph;
pub use session_graph::SessionMessageTreeNode;
pub use session_graph::SessionNodePayload;
pub use session_graph::SessionNodeRecord;
pub use session_model::context::PreparedContext;
pub use session_model::ProtocolEvent;
pub use session_model::SessionEventRecord;
pub use session_model::RuntimeSessionPolicy;
pub use session_model::SessionPolicy;
pub use session_model::SessionSpec;
pub use store::AttachmentIntent;
pub use store::AttachmentManifest;
pub use store::AttachmentManifestEntry;
pub use store::BlobRef;
pub use store::GcReport;
pub use store::RuntimePersistence;
pub use store::SessionMeta;
pub use store::SessionPickerInfo;
pub use store::SessionReadScope;
pub use store::StoreError;
pub use store::VacuumReport;
pub use store::HydratedSessionCheckpoint;
pub use store::RuntimeCommit;
pub use store::RuntimeTurnCommitStamp;
pub use store::SessionHead;
pub use store::refresh_persisted_session_state;

Modules§

attachments
chronological
direct
host_events
lashlang_bridge
llm
plugin
provider
Provider components for pluggable LLM backends.
runtime
sansio
Sans-IO state machine for session turns.
search
session
session_graph
session_model
store
tool_dispatch
tool_registry

Macros§

impl_noop_attachment_manifest
Mixin macro for RuntimePersistence implementors that have no attachment-write story (mock backends, in-memory test stores, runtime-perf harnesses). Pastes no-op impls of every AttachmentManifest method.
impl_unsupported_queued_work_methods

Structs§

AcceptedInjectedTurnInput
AttachmentCreateMeta
AttachmentId
AttachmentMeta
AttachmentRef
CheckpointDelivery
CompactToolContract
ConversationRecord
EffectId
Opaque identifier linking an effect to its response.
ErrorEnvelope
ExecImage
ExecResponse
GenerationOptions
HostTurnProtocol
InMemoryLashlangArtifactStore
JsonlTraceSink
LashSchema
LlmCallError
Error details from a failed LLM call.
LlmRequest
LlmResponse
Message
A structured message with typed parts for context management.
MessageSequence
ModelLimits
ModelSpec
ModelToolReturn
Part
PluginMessage
PluginStack
PreparedPrompt
PreparedToolCall
Runtime-prepared executable tool call.
PromptBuildInput
PromptContext
PromptContribution
PromptContributionGate
PromptContributionSet
PromptFingerprint
Process-local cache identity for prompt inputs.
PromptLayer
PromptSlotLayer
PromptTemplate
PromptTemplateSection
PromptUsage
Exact prompt-usage snapshot from the most recent completed LLM call.
ProtocolBuildInput
ProtocolDriverState
ProtocolTurnOptions
RenderedPrompt
ResolvedPromptLayer
SandboxMessage
A message sent from the sandbox to the host during execution.
SchemaProjectionOverride
TextProjectionMetadata
TokenUsage
Token usage statistics from an LLM call.
ToolAgentExecutableSurface
ToolAgentSurface
ToolAvailabilityConfig
ToolCall
Per-call inputs handed to ToolProvider::execute.
ToolCallOutput
ToolCallRecord
ToolCancellation
ToolContext
Per-call environment for ToolProvider::execute. Fields are sealed so the runtime can add capabilities without breaking tool authors.
ToolContract
Heavy tool contract resolved only when a prompt or call needs schemas/docs.
ToolDefinition
Static authoring helper for tools.
ToolFailure
ToolHostEventControl
ToolId
ToolLashlangExecutionCallSite
ToolManifest
Tool metadata exposed to prompts, catalogs, UI, and availability checks. The optional compact contract is the catalog-facing projection of the resolved contract; full schemas stay in ToolContract.
ToolPrepareCall
Inputs handed to ToolProvider::prepare_tool_call.
ToolPrepareContext
ToolResult
ToolSessionControl
ToolSessionModel
ToolSurface
ToolSurfaceBuildInput
ToolSurfaceContribution
ToolSurfaceEntry
ToolSurfaceOverride
TraceAttachment
TraceContext
TraceError
TraceLabelMetadata
TraceLashlangChildExecution
TraceLashlangExecutionIdentity
TraceLashlangGraph
Trace-derived Lashlang execution graph snapshot for hosts and debugging tools.
TraceLashlangGraphChildLink
Link from an observed parent Lashlang node to a child execution graph.
TraceLashlangGraphEdge
Trace-derived Lashlang graph edge.
TraceLashlangGraphNode
Trace-derived Lashlang graph node.
TraceLashlangGraphStore
In-memory store that reduces Lashlang execution trace records into graph snapshots.
TraceLashlangMap
TraceLashlangMapEdge
TraceLashlangMapNode
TraceLlmMessage
TraceLlmRequest
TraceLlmResponse
TracePromptComponent
TraceProviderStreamEvent
TraceRecord
TraceRuntimeScope
TraceRuntimeStreamEvent
TraceTokenUsage
TraceToolSpec
TurnCause

Enums§

CausalRef
Stable semantic reference to the runtime fact that caused another fact.
CheckpointKind
DurabilityTier
Durability tier of an execution path’s wired store or effect host.
ImageMediaType
LlmOutputPart
LlmTerminalReason
MediaType
MessageOrigin
MessageRole
ModelToolReturnPart
PartKind
PluginRuntimeEvent
PromptBuiltin
PromptSlot
PromptTemplateEntry
PruneState
Response
A response to a previously emitted effect.
SessionEvent
ToolActivation
ToolArgumentProjectionPolicy
ToolAvailability
ToolCallOutcome
ToolCallStatus
ToolControl
ToolFailureClass
ToolFailureSource
ToolOutputContract
ToolRetryDisposition
ToolRetryPolicy
Automatic retry policy for a tool’s execution.
ToolScheduling
How a tool’s invocations should be scheduled relative to other tools in the same batch of model-produced tool calls.
ToolValue
TraceBranchSelection
TraceContentBlock
TraceEvent
TraceLashlangEdgeSelection
Observed branch-edge selection state.
TraceLashlangExecutionEvent
TraceLashlangNodeStatus
Observed Lashlang graph node state.
TraceLashlangStatus
TraceLevel
TraceRuntimeSubject
TraceSinkError
TurnFinish
TurnOutcome
TurnStop

Constants§

SANSIO_VERSION
VERSION

Traits§

JsonSchema
A type which can be described as a JSON Schema document.
LashlangArtifactStore
ToolProvider
Trait for providing tools to the sandbox. Implement this per-project.
TraceSink

Functions§

append_assistant_text_part
Append a streamed text part to the running assistant text, inserting the right number of blank lines so consecutive parts don’t glue together.
build_prompt
build_tool_surface
build_turn
default_prompt_template
head_tail_truncate
messages_are_prompt_resume_safe
normalized_response_parts
Convert a raw LlmResponse into a stream of LlmOutputParts that downstream code can iterate. When the response only carries full_text (provider didn’t populate parts), synthesize a single Text part.
prompt_template_fingerprint
prompt_text_fingerprint
prompt_tool_names_fingerprint
reasoning_part
Build a Reasoning Part from a reasoning item. meta is Some when the item carries provider replay metadata; None for display-only summaries.
render_turn_causes_prompt
resolve_prompt_layers
shared_parts
Wrap a Vec<Part> for the Message::parts field. Use this in struct literals and tests (parts: shared_parts(vec![Part { ... }])) so the call sites stay short and uniform.
validate_tool_input

Type Aliases§

BaseRenderCache
Memoized render of a MessageSequence’s base. Shared across the per-iteration MessageSequence instances that wrap the same base (typically the SessionGraphCache’s projected messages) so the chat projector’s render_prompt walk happens once per turn instead of once per LLM iteration.
DriverAction
DriverContextView
Effect
PreparedTurnMachine
ProgressSender
Sender for streaming progress messages from tools (e.g. live bash output).
ProjectorContext
SansIoTurnInput
TurnDriverConfig
TurnDriverPreamble
TurnLimitFinalMessage
TurnMachine
TurnMachineConfig

Derive Macros§

JsonSchema