import type { VendoToolPackFilter } from "./tool-pack.js"; import { type Tool } from "@mastra/core/tools"; import type { Vendo } from "./server.js"; /** * `@vendoai/vendo/mastra` — the BYO-agent seam for Mastra agents (frozen * contract: the existing-agents contract §2, * async return amended Wave 1). The same framework-neutral tool pack as * `./ai-sdk`, in Mastra `createTool` shape for the `Agent({ tools })` map. * * A Mastra agent definition is STATIC — one definition serves every user — so * this shim takes no principal. Each call resolves its principal (and optional * session id) lazily from Mastra's request context: * * ```ts * const requestContext = new RequestContext(); * requestContext.set(VENDO_PRINCIPAL_KEY, { kind: "user", subject: userId }); * requestContext.set(VENDO_SESSION_KEY, hostSessionId); // optional * await agent.stream(messages, { requestContext }); * ``` */ export { VENDO_DELEGATE_TOOL, VENDO_MAKE_TOOL, VENDO_TOOL_PACK_PREFIX, type VendoDelegateResult, type VendoToolPackFilter, } from "./tool-pack.js"; /** Request-context key holding the caller's Vendo `Principal` (`{ kind, subject }`). * REQUIRED on every request that may reach a `vendo_*` tool — a missing or * malformed principal fails the call closed. */ export declare const VENDO_PRINCIPAL_KEY = "vendo-principal"; /** Optional request-context key carrying the host session id into Vendo's * audit trail; unset, the shim mints one per call. */ export declare const VENDO_SESSION_KEY = "vendo-session-id"; export type VendoMastraTool = Tool; /** * Build the Vendo tool pack as Mastra tools. Async (the pack enumerates the * live registry), which composes with a static agent either way: * * ```ts * // ESM top-level await: * const agent = new Agent({ tools: { ...weatherTool, ...(await vendoMastraTools(vendo)) } }); * // or Mastra's dynamic tools function: * const agent = new Agent({ tools: () => vendoMastraTools(vendo) }); * ``` * * A `vendo_*` tool returns either a versioned envelope — `vendo/app-ref@1` * (render with ``) or `vendo/approval-ref@1` (parks server-side; * render with ``) — or plain data, meaning the guarded * call executed cleanly. */ export declare function vendoMastraTools(vendo: Vendo, options?: VendoToolPackFilter): Promise>;