import { type AgentServiceRoute, type AgentServiceRuntime } from "./definition.js"; import { type DetachedRunShutdownLifecycle, type DetachedRunTracker } from "./detached-run-tracker.js"; import { type AgentServiceActiveSpanAttributes, type AgentServiceDetachedCleanupInput, type AgentServiceDetachedExecutionInput, type AgentServiceRouteSet, type AgentServiceStreamExecutionInput } from "./routes.js"; import { type AgentServiceAuth, type AgentServiceAuthConfig } from "./auth.js"; import type { ParsedHostedChatRequest } from "../hosted/chat-request-parser.js"; import type { AgUiResumeValue } from "../ag-ui/tool-shared.js"; import type { RuntimeAgentMarkdownDefinition } from "../runtime/agent-definition.js"; import { type AgentServiceServer, type AgentServiceServerLifecycle, type NodeAgentServiceServer } from "./server.js"; import type { VeryfrontServiceServerLogger } from "../../server/service-server.js"; import type { HostedRuntimeSourceIdentity } from "../hosted/runtime-source-binding.js"; /** Configuration used by hosted agent service runtime. */ export type HostedAgentServiceRuntimeConfig = AgentServiceAuthConfig & { PORT: number; ALLOWED_ORIGINS: string[]; }; /** Configuration used by agent service runtime. */ export type AgentServiceRuntimeConfig = HostedAgentServiceRuntimeConfig; /** Public API contract for hosted agent service runtime logger. */ export type HostedAgentServiceRuntimeLogger = VeryfrontServiceServerLogger & { info(message: string, metadata?: Record): void; error(message: string, metadata?: Record): void; }; /** Public API contract for agent service runtime logger. */ export type AgentServiceRuntimeLogger = HostedAgentServiceRuntimeLogger; /** Public API contract for hosted agent service runtime trace. */ export type HostedAgentServiceRuntimeTrace = (operationName: string, operation: () => Promise) => Promise; /** Public API contract for agent service runtime trace. */ export type AgentServiceRuntimeTrace = HostedAgentServiceRuntimeTrace; /** Options accepted by create hosted agent service runtime. */ export type CreateHostedAgentServiceRuntimeOptions = { serviceName: string; /** Exact immutable source snapshot served by control-plane runtime invocations. */ runtimeSource?: HostedRuntimeSourceIdentity; getConfig: () => TConfig; getAgentConfig: () => RuntimeAgentMarkdownDefinition; forwardedConfigNamespace?: string; logger: HostedAgentServiceRuntimeLogger; trace?: HostedAgentServiceRuntimeTrace; setActiveSpanAttributes?: (attributes: AgentServiceActiveSpanAttributes) => void; prepareExecution: (req: ParsedHostedChatRequest) => Promise; streamExecutionToAgUiResponse: (input: AgentServiceStreamExecutionInput) => Promise | Response; startDetachedExecution: (input: AgentServiceDetachedExecutionInput) => Promise; cleanupExecution?: (input: AgentServiceDetachedCleanupInput) => Promise; tracker?: DetachedRunTracker; drainTimeoutMs?: number; }; /** Options accepted by create agent service runtime. */ export type CreateAgentServiceRuntimeOptions = CreateHostedAgentServiceRuntimeOptions; /** Public API contract for hosted agent service runtime bundle. */ export type HostedAgentServiceRuntimeBundle = { config: TConfig; tracker: DetachedRunTracker; auth: AgentServiceAuth; routeSet: AgentServiceRouteSet; routes: AgentServiceRoute[]; lifecycle: DetachedRunShutdownLifecycle; runtime: AgentServiceRuntime; }; /** Public API contract for agent service runtime bundle. */ export type AgentServiceRuntimeBundle = HostedAgentServiceRuntimeBundle; /** Options accepted by start node hosted agent service. */ export type StartNodeHostedAgentServiceOptions = CreateHostedAgentServiceRuntimeOptions & { bindAddress?: string; hardShutdownTimeoutMs?: number; signals?: readonly NodeJS.Signals[]; lifecycle?: AgentServiceServerLifecycle; }; /** Options accepted by start node agent service. */ export type StartNodeAgentServiceOptions = StartNodeHostedAgentServiceOptions; /** Options accepted by start agent service runtime. */ export type StartAgentServiceRuntimeOptions = CreateAgentServiceRuntimeOptions & { bindAddress?: string; hardShutdownTimeoutMs?: number; signals?: readonly NodeJS.Signals[]; lifecycle?: AgentServiceServerLifecycle; }; /** Result returned from start node hosted agent service. */ export type StartNodeHostedAgentServiceResult = HostedAgentServiceRuntimeBundle & { nodeServer: NodeAgentServiceServer; }; /** Result returned from start node agent service. */ export type StartNodeAgentServiceResult = StartNodeHostedAgentServiceResult; /** Result returned from start agent service runtime. */ export type StartAgentServiceRuntimeResult = AgentServiceRuntimeBundle & { server: AgentServiceServer; }; export declare function combineAgentServiceLifecycle(primary: AgentServiceServerLifecycle, secondary: AgentServiceServerLifecycle | undefined): AgentServiceServerLifecycle; /** Create agent service runtime. */ export declare function createAgentServiceRuntime(options: CreateAgentServiceRuntimeOptions): AgentServiceRuntimeBundle; /** Create hosted agent service runtime. */ export declare function createHostedAgentServiceRuntime(options: CreateHostedAgentServiceRuntimeOptions): HostedAgentServiceRuntimeBundle; /** Starts node agent service. */ export declare function startNodeAgentService(options: StartNodeAgentServiceOptions): Promise>; /** Starts node hosted agent service. */ export declare function startNodeHostedAgentService(options: StartNodeHostedAgentServiceOptions): Promise>; /** Starts agent service runtime. */ export declare function startAgentServiceRuntime(options: StartAgentServiceRuntimeOptions): Promise>; //# sourceMappingURL=runtime.d.ts.map