2026-01-14 01:08:15 +00:00
|
|
|
import type { AgentTool } from "@mariozechner/pi-agent-core";
|
|
|
|
|
|
|
|
|
|
import { toToolDefinitions } from "../pi-tool-definition-adapter.js";
|
|
|
|
|
|
|
|
|
|
// We always pass tools via `customTools` so our policy filtering, sandbox integration,
|
|
|
|
|
// and extended toolset remain consistent across providers.
|
|
|
|
|
type AnyAgentTool = AgentTool;
|
|
|
|
|
|
2026-01-14 14:31:43 +00:00
|
|
|
export function splitSdkTools(options: { tools: AnyAgentTool[]; sandboxEnabled: boolean }): {
|
2026-01-14 01:08:15 +00:00
|
|
|
builtInTools: AnyAgentTool[];
|
|
|
|
|
customTools: ReturnType<typeof toToolDefinitions>;
|
|
|
|
|
} {
|
|
|
|
|
const { tools } = options;
|
|
|
|
|
return {
|
|
|
|
|
builtInTools: [],
|
|
|
|
|
customTools: toToolDefinitions(tools),
|
|
|
|
|
};
|
|
|
|
|
}
|