16b344c0ad
- define and validate the capability and resource-lock languages - provision workspace source repositories through Central Gitea - build package runtimes from pinned standalone sources - replace legacy schema compilation with workspace persistence plans - add stable optimistic registers and Automerge CRDT documents - modernize TypeScript/Nix package builds and runtime activation readiness
82 lines
3.0 KiB
TypeScript
82 lines
3.0 KiB
TypeScript
import http from "node:http";
|
|
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<typeof CaminoService>;
|
|
export type OrchClient = Client<typeof OrchestratorRuntime>;
|
|
export type RuntimeDependency = {
|
|
kind: "state";
|
|
objectId: string;
|
|
attachmentId: string;
|
|
} | {
|
|
kind: "edge";
|
|
objectId: string;
|
|
attachmentId: string;
|
|
projectionId: string;
|
|
};
|
|
export declare const objectRef: (objectId: string) => {
|
|
$quixosRef: string;
|
|
};
|
|
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<string, Value>) => {
|
|
[k: string]: unknown;
|
|
};
|
|
export type StatePort<T = unknown> = {
|
|
slotId: string;
|
|
get(): Promise<T>;
|
|
live(): Promise<ReturnType<typeof liveValue>>;
|
|
set(value: T): Promise<void>;
|
|
};
|
|
export type EdgePort = {
|
|
edgeTypeId: string;
|
|
projectionId: string;
|
|
resolve(): Promise<string[]>;
|
|
connect(targetObjectId: string): Promise<void>;
|
|
};
|
|
export type InterfacePort = {
|
|
interfaceRevisionId: string;
|
|
invoke(operationId: string, input?: Record<string, unknown>): Promise<unknown>;
|
|
};
|
|
export type ConstructorPort = {
|
|
atomId: string;
|
|
construct(input?: Record<string, unknown>): Promise<string>;
|
|
};
|
|
export type RuntimePort = StatePort | EdgePort | InterfacePort | ConstructorPort;
|
|
export type RuntimeContext = {
|
|
objectId: string;
|
|
input: Record<string, unknown>;
|
|
inputProto: Record<string, Value>;
|
|
ports: ReadonlyMap<string, RuntimePort>;
|
|
state<T = unknown>(portId: string): StatePort<T>;
|
|
edge(portId: string): EdgePort;
|
|
interface(portId: string): InterfacePort;
|
|
constructor(portId: string): ConstructorPort;
|
|
};
|
|
export declare const createRuntimeContext: (camino: CaminoClient, orch: OrchClient, request: RuntimeRequest) => RuntimeContext;
|
|
export type RuntimeHandler = (context: RuntimeContext) => unknown | Promise<unknown>;
|
|
export type DerivedHandler = {
|
|
kind: "derived";
|
|
get: RuntimeHandler;
|
|
};
|
|
export declare const derived: (get: RuntimeHandler) => DerivedHandler;
|
|
export declare const createPackageRuntimeRoutes: (config: {
|
|
packageRevisionId: string;
|
|
exports: Record<string, RuntimeHandler | DerivedHandler>;
|
|
caminoUrl?: string;
|
|
orchUrl?: string;
|
|
}) => (router: ConnectRouter) => ConnectRouter;
|
|
export declare const servePackageRuntime: (config: {
|
|
packageRevisionId: string;
|
|
exports: Record<string, RuntimeHandler | DerivedHandler>;
|
|
}) => http.Server<typeof http.IncomingMessage, typeof http.ServerResponse>;
|
|
type RuntimeRequest = {
|
|
objectId: string;
|
|
input: Record<string, Value>;
|
|
dependencies: import("./quixos/refs_pb.js").InjectedDependency[];
|
|
};
|
|
export {};
|
|
//# sourceMappingURL=index.d.ts.map
|