import type { ExtensionAPI } from "../pi.js"; import type { NativeCombinerConnection } from "./combiner-connection.js"; import type { ServerFilter } from "../client/config-ladder.js"; export type NativeToolSurfaceOptions = { /** The resolved combiner connection (owns elicitation, filters, caches). */ connection: NativeCombinerConnection; /** The per-project server filter (same object index.ts passes to applyFilter); * applied defensively here too so a filter race never widens surface exposure. * A GETTER resolves per call — worktrees/project switches re-resolve session * config, and a load-time snapshot would apply the wrong allow/deny set. */ serverFilter?: ServerFilter | (() => ServerFilter | undefined); /** The combiner block's directTools spec, as resolved from the ladder: a glob * allowlist → "direct" exposure for matches; "search" → everything codemode. * A getter resolves per call (same reason as serverFilter). */ directSpec?: string[] | "search" | (() => string[] | "search" | undefined); /** Cross-pass registration state (see activateNativeTools). A fresh object on * first call; the SAME object on every pass so the diffing + hidden-removal * work. native/index.ts owns one per activation. */ state?: NativeToolSurfaceState; /** Warn when the direct-exposure set grows large (every declared schema rides in * every request). Settings kill-switch: warnLargeDirectExposure (default true). */ warnLargeDirectExposure?: boolean; log: (level: "info" | "warn" | "error", message: string) => void; }; /** Registration memory across passes: currently-declared names + each tool's schema * signature, so a changed schema re-registers and an unchanged one doesn't (pi's * re-register = replace-with-warning; skipping unchanged declarations avoids the * warning churn and keeps pi's tool identity stable). */ export type NativeToolSurfaceState = { names: Set; signatures: Map; }; /** Register the combiner's tools natively, DIFFING against `state` (which the caller * reuses across passes): unchanged declarations are skipped (pi.registerTool * replaces-by-name with a warning — churn on every list_changed would spam), changed * schemas re-register, and removed tools are re-registered hidden. Returns the names * currently active (for status/panel surfaces). */ export declare function activateNativeTools(pi: ExtensionAPI, opts: NativeToolSurfaceOptions): Promise; //# sourceMappingURL=tool-surface.d.ts.map