import type { AgentServiceRoute } from "./definition.js"; import type { AgUiResumeValue } from "../ag-ui/tool-shared.js"; import type { DetachedRunTracker } from "./detached-run-tracker.js"; import { type ParsedHostedAgUiRequest } from "../hosted/ag-ui-chat-request.js"; import { type ParsedHostedChatRequest } from "../hosted/chat-request-parser.js"; import { type HostedServiceAuthenticatedRequest, type HostedServiceRunEventAppendTokenVerification } from "./auth.js"; import type { AgUiRuntimeRequest } from "../runtime/ag-ui-contract.js"; import { type HostedRuntimeSourceIdentity } from "../hosted/runtime-source-binding.js"; /** Public API contract for hosted agent service routes logger. */ export type HostedAgentServiceRoutesLogger = { warn?: (message: string, metadata?: Record) => void; error(message: string, metadata?: Record): void; }; /** Public API contract for agent service routes logger. */ export type AgentServiceRoutesLogger = HostedAgentServiceRoutesLogger; /** Public API contract for hosted agent service routes trace. */ export type HostedAgentServiceRoutesTrace = (operationName: string, operation: () => Promise) => Promise; /** Public API contract for agent service routes trace. */ export type AgentServiceRoutesTrace = HostedAgentServiceRoutesTrace; /** Public API contract for hosted agent service active span attributes. */ export type HostedAgentServiceActiveSpanAttributes = Record; /** Public API contract for agent service active span attributes. */ export type AgentServiceActiveSpanAttributes = HostedAgentServiceActiveSpanAttributes; /** Input payload for hosted agent service stream execution. */ export type HostedAgentServiceStreamExecutionInput = TExecution & { requestAbortSignal: AbortSignal; agUiInput: AgUiRuntimeRequest; }; /** Input payload for agent service stream execution. */ export type AgentServiceStreamExecutionInput = HostedAgentServiceStreamExecutionInput; /** Input delivered to a hosted agent-service detached execution callback. */ export type HostedAgentServiceDetachedExecutionInput = { execution: TExecution; abortSignal: AbortSignal; /** Required application-facing request clone with internal control headers removed. */ rawRequest: Request; }; /** Input payload for agent service detached execution. */ export type AgentServiceDetachedExecutionInput = HostedAgentServiceDetachedExecutionInput; /** Input payload for hosted agent service detached cleanup. */ export type HostedAgentServiceDetachedCleanupInput = { execution: TExecution; runId: string; conversationId: string; }; /** Input payload for agent service detached cleanup. */ export type AgentServiceDetachedCleanupInput = HostedAgentServiceDetachedCleanupInput; /** Options accepted by hosted agent service route set. */ export type HostedAgentServiceRouteSetOptions = { forwardedConfigNamespace?: string; /** Exact immutable source snapshot served by control-plane runtime invocations. */ runtimeSource?: HostedRuntimeSourceIdentity; authenticateRequest: (request: Request) => Promise; verifyProjectAccess: (projectId: string, authToken: string) => Promise<{ success: true; projectSlug?: string; } | { success: false; error: { errorCode: string; message: string; statusCode: number; }; }>; verifyRunEventAppendToken?: (input: { token: string; projectId: string; runId: string; }) => Promise; tracker: DetachedRunTracker; prepareExecution: (req: ParsedHostedChatRequest) => Promise; streamExecutionToAgUiResponse: (input: HostedAgentServiceStreamExecutionInput) => Promise | Response; startDetachedExecution: (input: HostedAgentServiceDetachedExecutionInput) => Promise; cleanupExecution?: (input: HostedAgentServiceDetachedCleanupInput) => Promise; setActiveSpanAttributes?: (attributes: HostedAgentServiceActiveSpanAttributes) => void; trace?: HostedAgentServiceRoutesTrace; logger?: HostedAgentServiceRoutesLogger; }; export type AgentServiceRouteSetOptions = HostedAgentServiceRouteSetOptions; /** Public API contract for hosted agent service route set. */ export type HostedAgentServiceRouteSet = { routes: AgentServiceRoute[]; authenticateAgUiRequest: (request: Request) => Promise; createAgUiValidationErrorResponse: (response: Response) => Promise; buildParsedAgUiRequest: (input: { agUiInput: AgUiRuntimeRequest; authToken: string; userId: string; }) => Promise; handleAgUiRequest: (request: Request) => Promise; handleDurableChatRunExecuteRequest: (input: { request: Request; requestOrCtx?: unknown; }) => Promise; handleRuntimeAgentRunInvocationExecuteRequest: (input: { request: Request; requestOrCtx?: unknown; runId?: string; }) => Promise; handleDurableChatRunCancelRequest: (input: { request: Request; runId: string | undefined; }) => Promise; }; export type AgentServiceRouteSet = HostedAgentServiceRouteSet; /** Create hosted agent service route set. */ export declare function createHostedAgentServiceRouteSet(options: HostedAgentServiceRouteSetOptions): HostedAgentServiceRouteSet; export declare const createAgentServiceRouteSet: typeof createHostedAgentServiceRouteSet; //# sourceMappingURL=routes.d.ts.map