Package
Runtime, Services, and Plugins
Reframes the current package around AgentRuntime, session execution, services, and plugins
Runtime, Services, and Plugins
This page has one goal:
- explain the current runtime, service, and plugin layers using the objects that actually exist in the codebase today
Short Version
AgentRuntimeis the single-project runtime center- services own business workflows
- plugins extend those workflows without owning them
Current Layering
Downcity is easiest to read as four layers:
- Entry surfaces: CLI, Console UI, Chrome Extension, HTTP API
- Control plane: console
- Execution plane: agent runtime
- Business layer: sessions, services, plugins
The Runtime Center
The runtime center is now:
AgentRuntime
It owns:
configenvsystemsmodelsessionFacadeservicespluginRegistry
So the real mental model is:
console manages many agents
each agent runtime is centered on AgentRuntime
AgentRuntime then holds session, services, and pluginsStartup Order
How Services Get Runtime Access
Services do not own process orchestration.
They receive:
AgentContext
That context exposes the main runtime surface:
configenvloggersessioninvokeplugins
So a better description is:
- the runtime injects a unified execution surface through
AgentContext
Service Boundary
Services answer:
- what kind of input they own
- how their workflow moves
- when they enter
session.run - which plugin points they expose
The current built-in services are:
chattaskmemoryshell
These are per-agent instances, not global workflow singletons.
Plugin Boundary
Plugins answer:
- how to extend a workflow without taking ownership of it
Plugins currently provide:
- explicit actions
- system injection
- hooks
Hook semantics are unified as:
pipelineguardeffectresolve
The key rule is:
- services define stable point names
- plugins implement some of those points
Real Chat Plugin Points
The chat service currently defines and uses:
chat.augmentInboundchat.observePrincipalchat.authorizeIncomingchat.resolveUserRolechat.beforeEnqueuechat.afterEnqueuechat.beforeReplychat.afterReply
Real Execution Path
In One Sentence
The current package is centered on AgentRuntime, uses SessionFacade as the execution axis, lets services own workflows, and uses plugins only as extensions.