import { type CompanionRuntimePolicy } from '../companions/runtime-policy.js'; import type { PartnerStore } from '../store.js'; import type { Agent } from '@deepseek-ai/dsh-agent'; import type { ToolRuntime } from '@deepseek-ai/dsh-tools'; import type { SessionEvent } from '@deepseek-ai/dsh-session'; import type { PartnerState } from '../domain.js'; export interface ToolAccessDecision { /** Whether this channel may use partner-owned tools; external tools keep host policy. */ sendTools: boolean; /** Optional allowlist for partner-owned tools only. */ allowedTools?: readonly string[]; denialReason?: string; } export interface ToolAccessContext { agent: Pick; state: Pick; /** Host-admitted input during prompt preparation only; dispatch uses persisted events. */ events?: readonly SessionEvent[]; } export interface ToolAccessAdapter { resolve(context: ToolAccessContext): ToolAccessDecision | undefined; } /** Channel adapters narrow partner capabilities only; they never grant host capabilities. */ export declare const defaultToolAccessAdapter: ToolAccessAdapter; export declare function resolveToolAccess(context: ToolAccessContext): ToolAccessDecision; /** Apply the channel decision only to tools registered by this plugin. */ export declare function channelToolAllowed(store: object, owner: string, name: string, access: ToolAccessDecision): boolean; /** Stale and nested partner calls still receive the same live channel check. */ interface LiveToolAccessIndex { runtimePolicy?(owner: string): CompanionRuntimePolicy | undefined; routesForSession(sessionId: string): readonly { companionId: string; }[]; toolAccess(agent: Pick): ToolAccessDecision; } export declare function installToolAccessGuard(tools: ToolRuntime, store: Pick, index?: LiveToolAccessIndex): () => void; export {}; //# sourceMappingURL=tool-access-adapter.d.ts.map