Skip to main content

Module middleware

Module middleware 

Source
Expand description

Ordered middleware and capability registration.

Modules§

artifacts
Agent-published session files and their frontend presentation.
attachments
User uploads exposed to the owning workspace.
compaction
Context compaction policy and provider routing.
context_offloading
Durable masking of stale tool output in active model context.
cron
Conversational recurring-task setup.
extensions
Standalone skills and activated Agent Plugin packages.
instructions
Bounded workspace instruction discovery.
manifest
Core-owned middleware configuration manifests.
scratchpad
Durable session and global notes for agent self-improvement.
session_files
Protected, session-bound storage shared by uploads and agent artifacts.
sessions
Chat catalog and durable forking middleware.
steering
Queued turn steering middleware.
subagents
Durable asynchronous child-agent middleware.
tasks
Optional durable todo planning.
tools
Tool registry, dispatch, and minimal filesystem tools.

Structs§

ActiveCommandContext
Mutable turn state exposed to a capability command that can run immediately.
ActiveSubmissionContext
Mutable turn state exposed to the middleware owning an active operation.
CompactContext
State exposed immediately before or after context compaction.
FrontendExtensions
Read-only middleware UI surface consumed by a frontend shell.
MiddlewareCommandContext
State available to a middleware-owned frontend command.
MiddlewareCommandOutput
Result of a middleware-owned frontend command.
MiddlewareStack
A validated, declaration-ordered middleware pipeline.
ModelContext
Mutable state exposed immediately before a model request.
ModelRequestContext
Request-only model input exposed after every durable PreModel hook.
PermissionRequestContext
Mutable policy boundary for a sandbox approval request.
PostToolUseContext
Mutable model-visible result exposed after an executed tool call.
PreToolUseContext
Mutable policy boundary for one normalized model-requested tool call.
PromptSection
One middleware-owned section of the assembled system prompt.
QueuedInputQueue
Mutable scoped view of active input retained until the next model boundary.
QueuedInputSnapshot
Read-only startup snapshot containing only one middleware’s queued input.
QueuedInputValue
One queued input removed by its owning middleware.
QueuedInputView
Read-only queued input owned by the middleware receiving it.
RuntimeContext
Durable runtime identity exposed while middleware starts a session.
SessionStartContext
Mutable state shared by the declaration-ordered SessionStart hooks.
StopContext
Mutable policy boundary immediately before normal turn completion.
TurnEndContext
State exposed when the loop finishes or aborts a turn.
TurnIdentity
Stable facts shared by hooks that run within one active turn.
UserPromptSubmitContext
Mutable state exposed before a submitted user prompt enters durable context.

Enums§

ActiveSubmissionResult
Result of a middleware-owned active operation.
SessionStartSource
Why Middleware::session_start is running.

Traits§

Middleware
A capability contribution to the single ordered agent pipeline.

Type Aliases§

FrontendEventSink
Sends middleware-owned UI updates without depending on a concrete frontend.