mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-15 15:10:50 +00:00
* 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
46 lines
1.4 KiB
TypeScript
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[];
|
|
};
|