import type { EventEnvelope, VoyantRuntimeHostPrimitives } from "@voyant-travel/core"; import { type VoyantGraphCustomFieldTarget, type VoyantPort } from "@voyant-travel/core/project"; import type { ApiExtension, ApiModule } from "@voyant-travel/hono/module"; import type { VoyantGraphRuntime, VoyantGraphRuntimeUnitLoader } from "./runtime-lowering.js"; export interface VoyantGraphRuntimeBindingContext { capabilities: TCapabilities; unit: VoyantGraphRuntimeUnitLoader; runtimeExports: readonly unknown[]; } export type VoyantGraphRuntimeBinding = (context: VoyantGraphRuntimeBindingContext) => ApiModule | readonly ApiModule[] | ApiExtension | readonly ApiExtension[] | undefined | Promise; export type VoyantGraphRuntimeBindings = Readonly>>; export type VoyantGraphRuntimePorts = Readonly>; /** Typed access to the shared record populated by statically selected contributors. */ export interface VoyantGraphRuntimePortResolver { hasRuntimePort?(port: Pick, "id">): boolean; getRuntimePort(port: Pick, "id">): T | Promise; getRuntimePorts?(port: Pick, "id">): readonly T[] | Promise; } /** Stable host surface available to every statically selected runtime contributor. */ export interface VoyantGraphRuntimeContributorHost extends VoyantGraphRuntimePortResolver { primitives: VoyantRuntimeHostPrimitives; /** Immutable custom-field target authority lowered from the selected graph. */ customFieldTargets: readonly VoyantGraphCustomFieldTarget[]; } /** Build-time selected package hook that maps host resources to graph runtime ports. */ export type VoyantGraphRuntimeContributor = (host: VoyantGraphRuntimeContributorHost) => VoyantGraphRuntimePorts; /** Conforming, fail-on-use port shapes for graph inspection and boot probes. */ export declare function createVoyantGraphRuntimePortStubs(runtime: VoyantGraphRuntime): VoyantGraphRuntimePorts; export interface ComposeVoyantGraphRuntimeInput { runtime: VoyantGraphRuntime; capabilities: TCapabilities; /** * Deployment-owned option wiring and local units, keyed by stable graph unit * id. A binding only runs when its unit is selected by the generated graph. */ bindings?: VoyantGraphRuntimeBindings; /** Deployment implementations keyed by package-declared port id. */ ports?: VoyantGraphRuntimePorts; /** Node-owned durable boundary for graph-selected outbound webhook events. */ outboundWebhooks?: { enqueue: (event: EventEnvelope, bindings: unknown) => Promise; }; /** Installed-app durable intake for every selected external event contract. */ appWebhooks?: { enqueue: (event: EventEnvelope, bindings: unknown) => Promise; }; } export interface VoyantGraphRuntimeComposition { modules: ApiModule[]; extensions: ApiExtension[]; accessResources: { path: string; resource: string; authorization?: "coarse" | "route"; }[]; routePosture: VoyantGraphRuntimeRoutePosture; } /** Absolute path posture derived only from selected graph API bundles. */ export interface VoyantGraphRuntimeRoutePosture { publicPaths: string[]; transactionalPaths: string[]; } /** * Invoke one fixed job from the admitted graph without accepting a run payload. * Scheduling, retries, leases, and health remain deployment-host concerns. */ export declare function invokeVoyantGraphJob(runtime: VoyantGraphRuntime, jobId: string, ports?: VoyantGraphRuntimePorts, bindings?: unknown): Promise; /** Load graph-owned subscriber metadata without composing API routes. */ export declare function composeVoyantGraphRuntimeFacetModules(runtime: VoyantGraphRuntime, ports?: VoyantGraphRuntimePorts): Promise; /** * Resolve selected graph runtime exports into the arrays consumed by mountApp. * Duplicate API facets are collapsed by the lowered unit loader before a * factory or deployment binding is invoked. */ export declare function composeVoyantGraphRuntime(input: ComposeVoyantGraphRuntimeInput): Promise; export declare function resolveVoyantGraphRouteMountPath(unit: Pick, route: VoyantGraphRuntimeUnitLoader["routes"][number]["route"]): string;