import type { ActionEntry } from "../agent/production-agent.js"; import { type AgentRunOwnerContext } from "./agent-run-context.js"; export declare function parseActionSearchParams(searchParams: URLSearchParams): Record; /** * Declarative auth adapter for the HTTP action route. Its `resolveCaller` runs * BEFORE the framework's `getOwnerFromEvent` / `getSession` chain, letting an * app accept caller identities `getSession` doesn't understand (e.g. an A2A * JWT) without reaching into request context from a Nitro `request` hook. * * Scoped to `/_agent-native/actions/*` only — it does not affect other routes. */ export type ActionRouteResolvedCaller = AgentRunOwnerContext & { /** * Org to scope the request to, verified from the same credential as the * caller identity (e.g. the A2A token's org claim). When omitted, the org * is derived from the verified owner email via the framework's owner→org * membership lookup. The ambient session/org state on the request is never * consulted for adapter-resolved callers: a request can carry both a valid * A2A bearer and an unrelated browser cookie, and the cookie user's org * must not leak into the token caller's request context. */ orgId?: string; /** Verified A2A correlation and issuer metadata for the audit row. */ delegationJti?: string; delegationIssuer?: string; }; export interface ActionRouteAuthAdapter { /** * Resolve a caller from the raw event before the cookie/bearer chain. * * - Return the resolved caller to run the action scoped to that identity. * Org scoping comes exclusively from the caller: the returned `orgId` if * set, otherwise the owner-email membership lookup — never from the * request's session cookie or org context. * - Return `null` when the credential isn't yours to judge — the request * defers to `getOwnerFromEvent` / `getSession`. * - THROW to hard-reject: the credential is present but invalid (e.g. an * expired or forged A2A bearer). The action route responds 401 and does * NOT fall through to the cookie/session chain, so a valid same-origin * session cookie can't be used to execute the request as the logged-in * user. Do not throw merely to signal "not mine" — return `null` for that. */ resolveCaller?: (event: any) => ActionRouteResolvedCaller | null | Promise; } export interface MountActionRoutesOptions { /** Resolve owner email from the H3 event (for data scoping). */ getOwnerFromEvent?: (event: any) => string | Promise; /** Resolve display name from the H3 event, when available. */ getUserNameFromEvent?: (event: any) => string | undefined | Promise; /** Resolve org ID from the H3 event (for org scoping). */ resolveOrgId?: (event: any) => string | null | Promise; /** * Optional caller resolver that runs before the `getOwnerFromEvent` / * `getSession` chain. Lets apps accept A2A JWTs (or other bearer schemes) on * the action route declaratively. See {@link ActionRouteAuthAdapter}. */ actionRouteAuth?: ActionRouteAuthAdapter; } /** * Mount discovered actions as HTTP endpoints. * * Only actions from `autoDiscoverActions` (template actions) are mounted. * Built-in actions (resource-*, chat-*, shell, etc.) are NOT passed here. */ export declare function mountActionRoutes(nitroApp: any, actions: Record, options?: MountActionRoutesOptions): void; //# sourceMappingURL=action-routes.d.ts.map