Download src/plugins/agent-tool-result-middleware-types.ts from SaylorTwift/openclaw: direct link, hf CLI and curl.
- Browser
- Download file 1.34 kB
-
https://huggingface.co/SaylorTwift/openclaw/resolve/main/src/plugins/agent-tool-result-middleware-types.ts
- Command line
-
hf download hf://SaylorTwift/openclaw/src/plugins/agent-tool-result-middleware-types.ts
-
curl -L -o agent-tool-result-middleware-types.ts https://huggingface.co/SaylorTwift/openclaw/resolve/main/src/plugins/agent-tool-result-middleware-types.ts
1.34 kB
| // Defines plugin middleware contracts for agent tool results. | |
| import type { AgentToolResult } from "../../packages/agent-core/src/types.js"; | |
| import type { PluginToolMatcher } from "./hook-types.js"; | |
| export type OpenClawAgentToolResult<TResult = unknown> = AgentToolResult<TResult>; | |
| export type AgentToolResultMiddlewareRuntime = "openclaw" | "codex"; | |
| export type AgentToolResultMiddlewareEvent = { | |
| threadId?: string; | |
| turnId?: string; | |
| toolCallId: string; | |
| toolName: string; | |
| args: Record<string, unknown>; | |
| cwd?: string; | |
| isError?: boolean; | |
| result: OpenClawAgentToolResult; | |
| }; | |
| export type AgentToolResultMiddlewareContext = { | |
| runtime: AgentToolResultMiddlewareRuntime; | |
| agentId?: string; | |
| sessionId?: string; | |
| sessionKey?: string; | |
| runId?: string; | |
| }; | |
| export type AgentToolResultMiddlewareResult = { | |
| result: OpenClawAgentToolResult; | |
| }; | |
| export type AgentToolResultMiddleware = ( | |
| event: AgentToolResultMiddlewareEvent, | |
| ctx: AgentToolResultMiddlewareContext, | |
| ) => Promise<AgentToolResultMiddlewareResult | void> | AgentToolResultMiddlewareResult | void; | |
| export type AgentToolResultMiddlewareOptions = { | |
| matcher?: PluginToolMatcher; | |
| runtimes?: AgentToolResultMiddlewareRuntime[]; | |
| }; | |
| export type AgentToolResultMiddlewareScope = { | |
| matcher?: PluginToolMatcher; | |
| runtimes: AgentToolResultMiddlewareRuntime[]; | |
| }; | |