Files
openclaw/src/plugins/agent-tool-result-middleware-types.ts
Vincent Koc aa27e27f36 fix(models): normalize provider runtime selection (#71259)
* fix(models): normalize provider runtime selection

* fix(models): reverse codex-only runtime migration

* fix(models): default runtime selection to pi

* fix(status): label model runtime clearly

* fix(status): align pi runtime label

* fix(plugins): align tool result middleware runtime naming

* fix(models): validate runtime overrides
2026-04-24 16:56:49 -07:00

46 lines
1.4 KiB
TypeScript

import type { AgentToolResult as PiAgentToolResult } from "@mariozechner/pi-agent-core";
export type OpenClawAgentToolResult<TResult = unknown> = PiAgentToolResult<TResult>;
export type AgentToolResultMiddlewareRuntime = "pi" | "codex";
/** @deprecated Use AgentToolResultMiddlewareRuntime. */
export type AgentToolResultMiddlewareHarness =
| AgentToolResultMiddlewareRuntime
| "codex-app-server";
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;
/** @deprecated Use runtime. */
harness?: 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 = {
runtimes?: AgentToolResultMiddlewareRuntime[];
/** @deprecated Use runtimes. */
harnesses?: AgentToolResultMiddlewareHarness[];
};