import type { ExtensionAPI } from './pi-ext-types.js'; /** * Build a predicate that decides whether a pseudo-tool (identified by its Claude-native label, * e.g. "ExitPlanMode") may be registered, given the agent's tool allowlist. * * `allowedToolsEnv` mirrors the agent's `tools` config in Claude-native, comma-separated form — * the PI adapter forwards it via the CORTEX_PI_ALLOWED_TOOLS env var, exactly the same allowlist * the Claude backend passes to `--tools`. When unset/empty (interactive sessions, or callers that * don't constrain tools) ALL pseudo-tools are allowed, preserving prior behavior. * * This is what stops thread-dispatched agents (coder, reviewer, …) from being handed * AskUserQuestion / EnterPlanMode / ExitPlanMode — interaction tools that deadlock a headless * thread because no human can ever answer the approval prompt. */ export declare function makeToolGate(allowedToolsEnv: string | undefined): (label: string) => boolean; export default function toolShims(pi: ExtensionAPI): void;