/** * LangChain Adapter — primitive mappings between LangChain tool calls and APS delegations. * * Pure mapping + receipt-builder layer. Stateful runtime (pending-intent tracking, * audit trail, gateway reporting) lives in the gateway — callers that need those * behaviours supply them via the `onReceipt` / `onDenied` hooks. */ import type { Delegation, ActionReceipt, SignedPassport } from '../types/passport.js'; export interface LangChainToolCall { name: string; args: Record; id?: string; } export interface GovernedToolResult { output: unknown; receipt: ActionReceipt; } export interface DeniedToolResult { denied: true; reason: string; receipt: ActionReceipt; } export interface LangChainGovernanceConfig { passport: SignedPassport; delegation: Delegation; privateKey: string; scopeMapping?: Record; onReceipt?: (r: ActionReceipt) => void; onDenied?: (info: { tool: string; reason: string; }) => void; } /** Map LangChain tool name to APS scope */ export declare function langchainToolToScope(toolName: string, scopeMapping?: Record): string; /** Govern a single LangChain tool call */ export declare function governLangChainTool(call: LangChainToolCall, execute: (args: Record) => Promise, config: LangChainGovernanceConfig): Promise; /** Create a governance middleware for LangGraph */ export declare function createLangGraphGovernance(config: LangChainGovernanceConfig): (call: LangChainToolCall, execute: (args: Record) => Promise) => Promise; //# sourceMappingURL=langchain.d.ts.map