theway-core
English | 中文
theway-core is the reusable agent runtime composed by theway-daemon. It owns the single-agent loop, AgentHarness, typed runtime sessions, skills and prompt assembly, compaction, lifecycle-hook interfaces, permission hooks, the RuntimeExtensionPort, ToolExecutor, and RuntimeObserver interfaces, and multiagent DAG/goal orchestration.
Core does not own concrete tools, filesystem or process implementations, persistence backends, telemetry exporters, or protocol servers. The workspace layering check permits theway-daemon as its only direct runtime consumer.
Public entry points
AgentandAgentOptionsrun the provider-neutral message and tool loop.AgentHarnesscomposes an agent with a typedSession, skills, compaction, cost tracking, and the cross-turn lifecycle hook interfaces.PersistentSessionStorageadapts typed session entries to the rawSessionReaderandSessionStorerecords fromtheway-contract.RuntimeExtensionPortsplits engine-independent lifecycle dispatch into session, run, request, message, tool, and compaction domains; core consumes normalized replacements and follow-ups after the embedding host has validated and committed durable actions, and the default implementation is a no-op.NormalizedModelRequestDraftis the provider-independent, request-local system/message/tool/generation snapshot transformed before provider serialization.ToolExecutordefines filesystem and process effects supplied by an embedding runtime.RuntimeObserverreceives transport-neutral operation start and finish records.multiagentprovides nested agent runs, live subagent-job state, DAG scheduling, and goal evaluation when theharnessfeature is enabled.
Features
The default build enables harness and default-providers. harness includes sessions, skills, compaction, permissions, lifecycle-hook interfaces, and multiagent orchestration; default-providers enables the Anthropic and faux provider implementations in theway-llm-provider.
# Bare Agent loop
# Harness without concrete providers
Documentation
Validation