import { type VoyantGraphActionBindings, type VoyantGraphConfigDeclaration, type VoyantGraphEventCatalog, type VoyantGraphJob, type VoyantGraphJsonObject, type VoyantGraphProviderDeclaration, type VoyantGraphResourceDeclaration, type VoyantGraphRouteBundle, type VoyantGraphRuntimeFactoryContext, type VoyantGraphRuntimeReference, type VoyantGraphSecretDeclaration, type VoyantGraphUnitKind } from "@voyant-travel/core/project"; import type { ToolRegistry } from "@voyant-travel/tools"; import type { AccessCatalog } from "@voyant-travel/types/api-keys"; import type { ResolvedVoyantGraphActionDeclaration, VoyantGraphWebhookPlan } from "./deployment-graph.js"; export type VoyantGraphRuntimeReferenceFacet = "runtime" | "api" | "config.validator" | "secrets.validator" | "providers.runtime" | "admin.copy.runtime" | "admin.routes.runtime" | "admin.contributions.runtime" | "reporting.datasets.runtime" | "runtimePorts.conformance" | "tools.runtime" | "jobs.runtime" | "subscribers.runtime"; export interface VoyantGraphRuntimeReferenceDefinition { /** Stable graph-scoped identifier used by generic runtime consumers. */ id: string; unitId: string; facet: VoyantGraphRuntimeReferenceFacet; entityId: string; runtime: VoyantGraphRuntimeReference; /** Package import specifier after owner-relative references have been lowered. */ importEntry: string; } export declare const VOYANT_GRAPH_RUNTIME_LOAD_ERROR_CODES: { readonly VOYANT_GRAPH_RUNTIME_REFERENCE_UNKNOWN: "A runtime reference is not present in the admitted generated graph."; readonly VOYANT_GRAPH_RUNTIME_IMPORT_FAILED: "A lowered graph runtime package entry could not be imported."; readonly VOYANT_GRAPH_RUNTIME_EXPORT_MISSING: "A lowered graph runtime package entry does not contain the declared export."; readonly VOYANT_GRAPH_RUNTIME_EXPORT_INVALID: "A lowered graph runtime package export is not a runtime object or factory."; }; export type VoyantGraphRuntimeLoadErrorCode = keyof typeof VOYANT_GRAPH_RUNTIME_LOAD_ERROR_CODES; export interface VoyantGraphRuntimeLoadErrorContext { referenceId: string; unitId?: string; facet?: VoyantGraphRuntimeReferenceFacet; entityId?: string; routeId?: string; entry?: string; exportName?: string; } export declare class VoyantGraphRuntimeLoadError extends Error { readonly code: VoyantGraphRuntimeLoadErrorCode; readonly context: VoyantGraphRuntimeLoadErrorContext; readonly cause?: unknown; constructor(code: VoyantGraphRuntimeLoadErrorCode, context: VoyantGraphRuntimeLoadErrorContext, detail: string, cause?: unknown); } export interface VoyantGraphRuntimeRouteDefinition { route: VoyantGraphRouteBundle; /** Package import specifier after owner-relative references have been lowered. */ importEntry: string; referenceId: string; } export interface VoyantGraphRuntimeToolDefinition { id: string; unitId: string; name: string; referenceId: string; requiredScopes: readonly string[]; context?: readonly string[]; risk?: "low" | "medium" | "high" | "critical"; } /** Fixed callable operation exposed to the deployment job host without run payloads. */ export type VoyantGraphRuntimeJobHandler = (context: VoyantGraphRuntimeFactoryContext) => Promise | void; export interface VoyantGraphRuntimeJobDefinition { unitId: string; declaration: VoyantGraphJob; referenceId: string; } export interface VoyantGraphRuntimeConfigDefinition { unitId: string; declaration: VoyantGraphConfigDeclaration; validatorReferenceId?: string; } export interface VoyantGraphRuntimeSecretDefinition { unitId: string; declaration: VoyantGraphSecretDeclaration; validatorReferenceId?: string; } export interface VoyantGraphRuntimeResourceDefinition { unitId: string; declaration: VoyantGraphResourceDeclaration; } export interface VoyantGraphRuntimeProviderDefinition { unitId: string; declaration: VoyantGraphProviderDeclaration; referenceId: string; } export interface VoyantGraphRuntimePortConformanceDefinition { portId: string; referenceId: string; } export interface VoyantGraphRuntimePortConformanceLoader extends VoyantGraphRuntimePortConformanceDefinition { load(): Promise; } export interface VoyantGraphRuntimeSelectedIds { routes: readonly string[]; tools: readonly string[]; events: readonly string[]; webhooks: readonly string[]; } export interface VoyantGraphRuntimeActionDefinition extends Omit { unitId: string; requiredScopes: readonly string[]; from: Required; } export interface VoyantGraphRuntimeUnitDefinition { id: string; localId?: string; kind: VoyantGraphUnitKind; packageName: string; order: number; projectConfig?: VoyantGraphJsonObject; runtimeReferenceId?: string; references?: readonly VoyantGraphRuntimeReferenceDefinition[]; config?: readonly VoyantGraphRuntimeConfigDefinition[]; secrets?: readonly VoyantGraphRuntimeSecretDefinition[]; resources?: readonly VoyantGraphRuntimeResourceDefinition[]; providers?: readonly VoyantGraphRuntimeProviderDefinition[]; requiredPorts?: readonly string[]; runtimePorts?: readonly string[]; runtimePortConformance?: readonly VoyantGraphRuntimePortConformanceDefinition[]; customFieldTargets?: readonly import("@voyant-travel/core/project").VoyantGraphCustomFieldTarget[]; manyRuntimePorts?: readonly string[]; requiredRuntimePorts?: readonly string[]; accessScopes?: readonly string[]; tools?: readonly VoyantGraphRuntimeToolDefinition[]; /** Framework-private candidates omitted from the provisional runtime view. */ provisionalTools?: readonly VoyantGraphRuntimeToolDefinition[]; /** Framework-private Tool references omitted from the provisional runtime view. */ provisionalReferences?: readonly VoyantGraphRuntimeReferenceDefinition[]; jobs?: readonly VoyantGraphRuntimeJobDefinition[]; actions?: readonly VoyantGraphRuntimeActionDefinition[]; setupSteps?: readonly { id: string; skippable: boolean; }[]; selectedIds: VoyantGraphRuntimeSelectedIds; routes: readonly VoyantGraphRuntimeRouteDefinition[]; } export interface VoyantGraphRuntimeRouteLoader extends VoyantGraphRuntimeRouteDefinition { load: () => Promise; } export interface VoyantGraphRuntimeReferenceLoader extends VoyantGraphRuntimeReferenceDefinition { load: () => Promise; /** Load the admitted module namespace that owns this reference. */ loadModule: = Record>() => Promise; } export interface VoyantGraphRuntimeToolLoader extends VoyantGraphRuntimeToolDefinition { load: () => Promise; } export interface VoyantGraphRuntimeJobLoader extends VoyantGraphRuntimeJobDefinition { load: () => Promise; } export interface VoyantGraphRuntimeConfigLoader extends VoyantGraphRuntimeConfigDefinition { loadValidator?: () => Promise; } export interface VoyantGraphRuntimeSecretLoader extends VoyantGraphRuntimeSecretDefinition { loadValidator?: () => Promise; } export interface VoyantGraphRuntimeProviderLoader extends VoyantGraphRuntimeProviderDefinition { load: () => Promise; } export interface VoyantGraphRuntimeUnitLoader extends Omit { readonly projectConfig: Readonly; references: readonly VoyantGraphRuntimeReferenceLoader[]; config: readonly VoyantGraphRuntimeConfigLoader[]; secrets: readonly VoyantGraphRuntimeSecretLoader[]; resources: readonly VoyantGraphRuntimeResourceDefinition[]; providers: readonly VoyantGraphRuntimeProviderLoader[]; requiredPorts: readonly string[]; runtimePorts: readonly string[]; runtimePortConformance?: readonly VoyantGraphRuntimePortConformanceLoader[]; manyRuntimePorts: readonly string[]; requiredRuntimePorts: readonly string[]; accessScopes: readonly string[]; tools: readonly VoyantGraphRuntimeToolLoader[]; jobs: readonly VoyantGraphRuntimeJobLoader[]; actions: readonly VoyantGraphRuntimeActionDefinition[]; selectedIds: VoyantGraphRuntimeSelectedIds; routes: readonly VoyantGraphRuntimeRouteLoader[]; /** Load the unit runtime, or each distinct route runtime for legacy units. */ load: () => Promise; } export interface VoyantGraphRuntimeWebhookPlan extends VoyantGraphWebhookPlan { inboundApiIds: readonly string[]; outboundEventTypes: readonly string[]; isInboundApi: (apiId: string) => boolean; isOutboundEventEligible: (eventType: string) => boolean; } export interface VoyantGraphRuntime { graphHash: string; providerSelections: Readonly>; customFieldTargets: readonly import("@voyant-travel/core/project").VoyantGraphCustomFieldTarget[]; modules: readonly VoyantGraphRuntimeUnitLoader[]; extensions: readonly VoyantGraphRuntimeUnitLoader[]; plugins: readonly VoyantGraphRuntimeUnitLoader[]; adapters?: readonly VoyantGraphRuntimeUnitLoader[]; providerUnits?: readonly VoyantGraphRuntimeUnitLoader[]; references: readonly VoyantGraphRuntimeReferenceLoader[]; config: readonly VoyantGraphRuntimeConfigLoader[]; secrets: readonly VoyantGraphRuntimeSecretLoader[]; resources: readonly VoyantGraphRuntimeResourceDefinition[]; providers: readonly VoyantGraphRuntimeProviderLoader[]; requiredPorts: readonly string[]; accessCatalog: AccessCatalog; eventCatalog: VoyantGraphEventCatalog; reportingCatalog: import("@voyant-travel/core/project").VoyantGraphReportingCatalog; accessScopes: readonly string[]; tools: readonly VoyantGraphRuntimeToolLoader[]; jobs: readonly VoyantGraphRuntimeJobLoader[]; actions: readonly VoyantGraphRuntimeActionDefinition[]; setupSteps: readonly { id: string; skippable: boolean; }[]; selectedIds: VoyantGraphRuntimeSelectedIds; webhooks: VoyantGraphRuntimeWebhookPlan; loadReference: (referenceId: string) => Promise; } /** Framework-created post-preflight runtime view. Runtime checks enforce this brand. */ export interface VoyantGraphActivatedRuntime extends VoyantGraphRuntime { readonly __voyantGraphActivatedRuntime?: never; } export interface CreateVoyantGraphRuntimeInput { graphHash: string; accessCatalog?: AccessCatalog; eventCatalog?: VoyantGraphEventCatalog; reportingCatalog?: import("@voyant-travel/core/project").VoyantGraphReportingCatalog; providerSelections?: Readonly>; entries: Readonly Promise>>; modules: readonly VoyantGraphRuntimeUnitDefinition[]; extensions?: readonly VoyantGraphRuntimeUnitDefinition[]; plugins: readonly VoyantGraphRuntimeUnitDefinition[]; adapters?: readonly VoyantGraphRuntimeUnitDefinition[]; providerUnits?: readonly VoyantGraphRuntimeUnitDefinition[]; webhookPlan?: VoyantGraphWebhookPlan; } /** * Turn generated graph metadata and static import closures into lazy runtime * loaders. Target adapters decide how to invoke the loaded package exports. */ export declare function createVoyantGraphRuntime(input: CreateVoyantGraphRuntimeInput): VoyantGraphRuntime; /** Load and register exactly the tool definitions selected by the admitted graph. */ export declare function registerVoyantGraphTools(runtime: VoyantGraphRuntime, registry: ToolRegistry): Promise;