AS AgentScopeAPI 手册 / API Reference
包package io.agentscope.harness.agent.middleware

io.agentscope.harness.agent.middleware

package io.agentscope.harness.agent.middleware

io.agentscope.harness.agent.middleware 属于运行时与部署,服务化、调度、控制面与 Web 应用。 该包共收录 20 个公开类型。

io.agentscope.harness.agent.middleware belongs to the Runtime & deployment layer and contains 20 public types.

所属构件Artifacts agentscope-harness

接口Interfaces

类型Type种类Kind说明Description
HarnessRuntimeMiddleware接口interface
定义 Harness 运行时中间件契约的接口。
Marker for middleware installed by harness runtime wiring.

类Classes

类型Type种类Kind说明Description
AgentTraceMiddleware类class
智能体追踪中间件,在智能体执行流程中提供横切扩展。
Observability middleware that logs the reasoning and execution trace of an agent.
AsyncToolMiddleware类class
异步工具中间件,在智能体执行流程中提供横切扩展。
Middleware that offloads long-running tool calls to background execution.
AtPathExpansionMiddleware类class
At 路径 Expansion 中间件,在智能体执行流程中提供横切扩展。
Expands `@path` references in user messages by reading the referenced files through the active `AbstractFilesystem` and appending an `<attached_file>` block at the end of the message.
CompactionMiddleware类class
压缩中间件,在智能体执行流程中提供横切扩展。
Middleware that performs conversation compaction before each LLM reasoning call.
DynamicSubagentsMiddleware类class
Dynamic Subagents 中间件,在智能体执行流程中提供横切扩展。
Dynamic counterpart to `SubagentsMiddleware` that re-resolves the registered subagent set on every reasoning step, supporting per-user isolation through the workspace `AbstractFilesystem` (e.g.
HarnessSkillMiddleware类class
Harness 技能中间件,在智能体执行流程中提供横切扩展。
Harness-native skill middleware.
InboxMiddleware类class
收件箱中间件,在智能体执行流程中提供横切扩展。
Middleware that drains the message bus inbox before each reasoning step and injects the messages as `HintBlock`s into the agent's context.
MemoryFlushMiddleware类class
记忆刷新中间件,在智能体执行流程中提供横切扩展。
Middleware that triggers memory flush and message offload at the end of each agent call.
MemoryMaintenanceMiddleware类class
记忆维护中间件,在智能体执行流程中提供横切扩展。
Middleware that performs periodic memory maintenance after each agent call.
PlanModeMiddleware类class
计划模式中间件,在智能体执行流程中提供横切扩展。
Enforces plan mode: while `AgentState.planModeContext.planActive` is `true`, mutating tool calls are denied so the agent can only read / investigate and draft a plan.
SandboxLifecycleMiddleware类class
沙箱生命周期中间件,在智能体执行流程中提供横切扩展。
Middleware that manages the sandbox session lifecycle around each agent call.
SkillCuratorMiddleware类class
技能 Curator 中间件,在智能体执行流程中提供横切扩展。
Schedules `SkillCurator` runs after the main `call()` completes.
SkillUsageMiddleware类class
技能用量中间件,在智能体执行流程中提供横切扩展。
Bumps `SkillUsageStore` counters whenever the agent invokes a SkillBox-registered skill loader (e.g.
SubagentsMiddleware类class
Subagents 中间件,在智能体执行流程中提供横切扩展。
Middleware that provides the managed subagent mechanism.
TeamsMiddleware类class
Teams 中间件,在智能体执行流程中提供横切扩展。
Injects AgentTeams context into the system prompt and exposes a role-clipped `TeamTool`.
ToolResultEvictionMiddleware类class
工具结果淘汰中间件,在智能体执行流程中提供横切扩展。
Middleware that evicts oversized tool results to the `AbstractFilesystem` before downstream reasoning sees the bloated message list.
TranscriptMiddleware类class
Transcript 中间件,在智能体执行流程中提供横切扩展。
Persists the conversation transcript at the end of every agent call.
WorkspaceContextMiddleware类class
工作区上下文中间件,在智能体执行流程中提供横切扩展。
Appends workspace context (session info, AGENTS.md, MEMORY.md, knowledge) to the system prompt via `#onSystemPrompt(Agent, RuntimeContext, String)`.

记录Records

类型Type种类Kind说明Description
SubagentEntry记录record
承载子智能体条目数据的记录类型。
Descriptor for a subagent identified by agent id, with its description, `SubagentFactory`, and optional `SubagentDeclaration` (for remote URL and headers).
基于官方固定版本源码静态生成Generated from pinned official sources · Python 2.0.11 · Java 2.0.4
签名与文档为静态抽取;如有疑问请以源码为准。Signatures and docs are extracted statically; verify against the source when in doubt.