import { type CapabilityMissEvent, type RiskLabel, type ToolDescriptor } from "./core/index.js"; import { type TelemetryConfig } from "#telemetry"; export interface CapabilitySurfaceSnapshot { hash: string; tools: Array<{ name: string; risk: RiskLabel; }>; } interface AppendOptions { dataDir?: string; } type AppendMiss = (event: CapabilityMissEvent) => Promise; interface CaptureOptions { dataDir?: string; /** Telemetry-config + opt-out inputs ONLY (loadConfig/envOptOut); this * module never reads VENDO_API_KEY or VENDO_CONSOLE_URL from it. */ env?: Record; telemetryHome?: string; telemetryConfig?: Pick; /** ADAPTER RULE, miss-upload slot: filled by the composition seam * (createVendo passes cloudKeyOptions() — see server.ts). Unset means * local capture only; the module itself never reads the environment for * the key or the console base URL. */ cloud?: { apiKey: string; baseUrl?: string; }; /** #557 — a LAZY, memoized factory rather than an eager promise: resolving the * surface calls the actions registry's `descriptors()` → `loadHost`, which now * awaits the cloud overrides fetch. Deferring it keeps that fetch out of * Workers global scope (the composition seam memoizes the factory so * descriptors runs at most once). Awaited only when a miss is actually * uploaded. */ surface: () => Promise; append?: AppendMiss; fetchImpl?: typeof fetch; batchSize?: number; queueLimit?: number; batchDelayMs?: number; requestTimeoutMs?: number; retryDelaysMs?: readonly number[]; } export interface CapabilityMissCapture { /** Stable host-installation identity, shared with telemetry by contract. */ hostId: string; record(event: CapabilityMissEvent): void; /** Drain hook for tests and orderly host shutdown; agent turns never await it. */ flush(): Promise; } export declare function appendCapabilityMiss(event: CapabilityMissEvent, options?: AppendOptions): Promise; export declare function capabilitySurfaceSnapshot(descriptors: ToolDescriptor[]): CapabilitySurfaceSnapshot; export declare function createCapabilityMissCapture(options: CaptureOptions): CapabilityMissCapture; export {};