/** * Fetch tool — outbound HTTP for automations and agent use. * * NOTE: this is an *agent* tool (LLM function call), not an *extension* (the * sandboxed Alpine.js mini-app primitive). It lives in this directory because * it shares SSRF-safe URL/proxy helpers with the extension iframe proxy. * * Supports ${keys.NAME} reference substitution in URL, headers, and body. * Values are resolved server-side AFTER the model emits the tool call — * the raw secret never enters the model's context. */ import type { ActionEntry } from "../agent/production-agent.js"; import type { ResolvedKeyReference } from "../secrets/substitution.js"; export interface FetchToolOptions { /** Resolve ${keys.NAME} references. Injected by the plugin at setup time. */ resolveKeys?: (text: string) => Promise<{ resolved: string; usedKeys: string[]; secretValues?: string[]; /** * Optional: which scope (user/org/workspace) each used key actually * resolved at. Populated by resolvers like * `resolveKeyReferencesWithRequestScopes` so `validateUrl` can look up * the allowlist at the scope the value came from rather than assuming * user scope. Backwards compatible — callers that omit this (or a * resolver that doesn't report it) are unaffected. */ resolvedKeys?: ResolvedKeyReference[]; }>; /** Validate URL against per-key allowlists. */ validateUrl?: (url: string, usedKeys: string[], /** Accumulated `resolvedKeys` from every `resolveKeys` call this request made, when the resolver reported them. */ resolvedKeys?: ResolvedKeyReference[]) => Promise; } /** * Create the fetch tool entry for the agent tool registry. */ export declare function createFetchToolEntry(opts?: FetchToolOptions): Record; //# sourceMappingURL=fetch-tool.d.ts.map