import http from "node:http"; import { type QxObjectRef } from "./references.js"; export * from "./bindings.js"; export { relationshipMap, relationshipList, relationshipSet } from "./relationships.js"; export { createMigrationContext, migrationObjectId, serveMigration, type MigrationContext, type MigrationInput, type MigrationOutput, type MigrationEdge } from "./migration.js"; import { type Client, type ConnectRouter } from "@connectrpc/connect"; import { CaminoService, type Value } from "./camino/api_pb.js"; import { OrchestratorRuntime } from "./quixos/orch_pb.js"; export type CaminoClient = Client; export type OrchClient = Client; export type RuntimeDependency = { kind: "state"; objectId: string; attachmentId: string; } | { kind: "edge"; objectId: string; attachmentId: string; projectionId: string; }; export declare const objectRef: (reference: QxObjectRef) => QxObjectRef; export declare const liveValue: (value: Value) => { $quixosValue: Value; }; export declare const jsToProtoValue: (value: unknown) => Value; export declare const protoValueToJs: (value: Value | undefined) => unknown; export declare const protoFieldsToJs: (fields: Record) => { [k: string]: unknown; }; export type StatePort = { slotId: string; get(): Promise; live(): Promise>; set(value: T): Promise; }; export type EdgePort = { edgeTypeId: string; projectionId: string; resolve(): Promise; connect(target: QxObjectRef): Promise; disconnect(target: QxObjectRef): Promise; collection(): Promise; replace(entries: RelationshipEntry[], expectedRevision: bigint): Promise; }; export type RelationshipEntry = { edgeId?: string; target: T; key?: string | boolean | bigint; }; export type RelationshipCollection = { revision: bigint; entries: RelationshipEntry[]; }; export type InterfacePort = { objectId: QxObjectRef; interfaceRevisionId: string; invoke(operationId: string, input?: Record): Promise; live(operationId: string, input?: Record): Promise>; }; export type ConstructorPort = { atomId: string; construct(input?: Record): Promise; }; export type RuntimePort = StatePort | EdgePort | InterfacePort | ConstructorPort; export type RuntimeContext = { /** Cooperative cancellation. Completion is acknowledged only after the handler returns. */ signal?: AbortSignal; openSession?: () => Promise; objectId: QxObjectRef; input: Record; inputProto: Record; ports: ReadonlyMap; state(portId: string): StatePort; edge(portId: string): EdgePort; interface(portId: string): InterfacePort; constructor(portId: string): ConstructorPort; }; export type RuntimeSession = { id: string; run(work: (context: RuntimeContext) => Promise): Promise; /** Close the external resource first, then close its host retention/session. */ close(): Promise; }; export declare class RuntimeAuthorityError extends Error { readonly retryable: boolean; constructor(message: string); } export declare const createRuntimeContext: (camino: CaminoClient, orch: OrchClient, request: RuntimeRequest) => RuntimeContext; export type RuntimeHandler = (context: RuntimeContext) => unknown | Promise; export type DerivedHandler = { kind: "derived"; get: RuntimeHandler; }; export declare const derived: (get: RuntimeHandler) => DerivedHandler; export declare const createPackageRuntimeRoutes: (config: { packageRevisionId: string; exports: Record; caminoUrl?: string; orchUrl?: string; }) => (router: ConnectRouter) => ConnectRouter; export declare const servePackageRuntime: (config: { packageRevisionId: string; exports: Record; }) => http.Server; type RuntimeRequest = { objectId: string; input: Record; dependencies: import("./quixos/refs_pb.js").InjectedDependency[]; }; //# sourceMappingURL=index.d.ts.map