import type { ToolDefinition } from "@opencode-ai/plugin"; import type { AftConfig } from "./config.js"; import { type V2Location, type V2ProviderTool, type V2ToolConsumers } from "./tools/definitions/v2.js"; import type { PluginContext } from "./types.js"; export interface V2ToolEditor { add(definition: V2ProviderTool): void; remove(name: string): void; } export interface V2ToolRegistrationContext { tool: { transform(register: (editor: V2ToolEditor) => void): unknown; }; } /** Returns true when bare `edit` remains available after surface, hoisting, and disable filters. */ export declare function openCodeEditSlotSurvives(config: AftConfig): boolean; /** * Returns true when bare `read` remains available after surface, hoisting, and * disable filters. * * Only a tagged AFT read mints the `[path#TAG]` snapshots a hashline patch * addresses. With the AFT read registration removed, OpenCode keeps serving its * own untagged `read`, so the agent can inspect a file and still have no tag to * patch with. */ export declare function openCodeReadSlotSurvives(config: AftConfig): boolean; /** Select the hashline schema only when both the edit and tagged-read slots survive. */ export declare function openCodeHashlineEffective(config: AftConfig): boolean; /** Return the process-state flag Rust uses to select the same edit schema arm. */ export declare function openCodeHashlineEditRegistered(config: AftConfig, registeredTools: ReadonlySet): boolean; /** One `hashline_downgraded` warning describing why the hashline arm was refused. */ export interface HashlineDowngradeWarning { code: "hashline_downgraded"; reason: "edit_not_registered" | "tagged_read_unavailable"; } /** * Classify a requested-but-refused hashline surface for the warning channel. * * The read slot is reported first because it is the harder failure to diagnose: * a session can keep a working `edit` tool beside the host's own untagged read, * and the resulting "I never got a hashline" symptom points at the edit tool, * which is not the missing piece. Mirrors `RegistrationRequest::downgrade_warning`. */ export declare function openCodeHashlineDowngrade(config: AftConfig, registeredTools: ReadonlySet): HashlineDowngradeWarning | null; /** * Build the exact OpenCode registration map without starting a bridge. * * Production calls this after startup has prepared the transport context. Keeping * the selection in one function makes the checked profile tests exercise the same * registration path rather than a second test-only inventory implementation. */ export declare function buildAftToolDefinitions(ctx: PluginContext, config: AftConfig, onUnknownDisabled?: (name: string, available: readonly string[]) => void): Record; /** Backward-compatible V1 name for the shared definition inventory. */ export declare function buildOpenCodeToolMap(ctx: PluginContext, config: AftConfig, onUnknownDisabled?: (name: string, available: readonly string[]) => void): Record; /** * Register the shared definition inventory on V2 as direct provider tools. * * The transform removes only the host tools AFT replaces, does not mutate the * shared V1 definitions, and never calls `update`. Provider and model data are * deliberately not inputs, so the same definitions produce the same registered * projection on every turn. */ export declare function registerAftTools(context: V2ToolRegistrationContext, location: V2Location, definitions: Readonly>, consumers?: V2ToolConsumers): unknown; //# sourceMappingURL=tool-registration.d.ts.map