Host workspace repositories on Central Gitea

This commit is contained in:
2026-09-03 15:46:52 -07:00
parent 5d3bd68a63
commit 9771b0803e
49 changed files with 3704 additions and 7807 deletions
+67 -95
View File
@@ -1,110 +1,82 @@
import { type Client } from "@connectrpc/connect";
import { type CaminoAutomergeDoc } from "@quixos/camino-datatypes/crdt-automerge";
import http from "node:http";
import { type Client, type ConnectRouter } from "@connectrpc/connect";
import { CaminoService, type Value } from "./camino/api_pb.js";
import { type InvokeRequest } from "./quixos/runtime_pb.js";
declare const objectRefBrand: unique symbol;
export type ObjectRef<ClassId extends string> = string & {
readonly [objectRefBrand]: ClassId;
};
import { OrchestratorRuntime } from "./quixos/orch_pb.js";
export type CaminoClient = Client<typeof CaminoService>;
export type { InvokeRequest, Value };
export type DerivedDependency = {
kind: "object";
export type OrchClient = Client<typeof OrchestratorRuntime>;
export type RuntimeDependency = {
kind: "state";
objectId: string;
attachmentId: string;
} | {
kind: "field";
kind: "edge";
objectId: string;
fieldName: string;
} | {
kind: "edges";
objectId: string;
sourceField?: string;
attachmentId: string;
projectionId: string;
};
export declare const recordDerivedDependency: (dependency: DerivedDependency) => void;
export declare const getActiveDerivedDependencies: () => DerivedDependency[];
export declare const runWithDerivedDependencyTracking: <T>(fn: () => Promise<T> | T) => Promise<{
value: T;
dependencies: DerivedDependency[];
}>;
export type Field<T> = {
get(): Promise<T | undefined>;
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 CrdtField<T> = Field<CaminoAutomergeDoc<T>> & {
change(fn: (doc: {
value: T;
}) => void): Promise<CaminoAutomergeDoc<T>>;
replaceFromJson(value: T): Promise<void>;
export type EdgePort = {
edgeTypeId: string;
projectionId: string;
resolve(): Promise<string[]>;
connect(targetObjectId: string): Promise<void>;
};
export type LiveFieldValue<T> = {
$caminoValue: T;
$caminoSource: {
field: {
objectId: string;
fieldName: string;
fieldType?: string;
fieldStorage?: string;
conflictStrategy?: string;
revision?: number | string | bigint;
};
};
export type InterfacePort = {
interfaceRevisionId: string;
invoke(operationId: string, input?: Record<string, unknown>): Promise<unknown>;
};
export declare const liveFieldValue: <T>(params: {
value: T;
export type ConstructorPort = {
atomId: string;
construct(input?: Record<string, unknown>): Promise<string>;
};
export type RuntimePort = StatePort | EdgePort | InterfacePort | ConstructorPort;
export type RuntimeContext = {
objectId: string;
fieldName: string;
fieldType?: string;
fieldStorage?: string;
conflictStrategy?: string;
revision?: number | string | bigint;
}) => LiveFieldValue<T>;
export type RuntimeHandler<Context> = (context: Context) => Promise<unknown> | unknown;
export type FieldOperation<Context> = {
get?: RuntimeHandler<Context>;
set?: RuntimeHandler<Context>;
watchStart?: RuntimeHandler<Context>;
watchStop?: RuntimeHandler<Context>;
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 fieldOps: <Context>(operation: FieldOperation<Context>) => FieldOperation<Context>;
export declare const derivedWithDeps: <Context>(operation: {
get: RuntimeHandler<Context>;
}) => FieldOperation<Context>;
export type RuntimeFunctionSpec<ExportName extends string = string> = {
exportName: ExportName;
symbol: string;
operation?: string;
field?: {
name: string;
type?: string;
storage?: string;
conflict?: string;
};
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;
};
type FieldCodec = {
fieldType?: string;
conflictStrategy?: string;
};
export declare const jsToProtoValue: (value: unknown, codec?: FieldCodec) => Value;
export declare const protoValueToJs: (value: Value | undefined) => unknown;
export declare const jsObjectToProtoFields: (value: Record<string, unknown>) => {
[k: string]: Value;
};
export declare const protoFieldsToJs: (fields: Record<string, Value> | undefined) => Record<string, unknown>;
export declare const canonicalFieldParams: (params: Record<string, Value> | undefined) => string;
export declare const fieldOperationKey: (params: {
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;
fieldName: string;
input?: Record<string, Value>;
}) => string;
export declare const objectRef: <ClassId extends string>(objectId: string) => ObjectRef<ClassId>;
export declare const createField: <T>(camino: CaminoClient, objectId: string, fieldName: string, codec?: FieldCodec) => Field<T>;
export declare const createCrdtField: <T>(camino: CaminoClient, objectId: string, fieldName: string, fieldType: string) => CrdtField<T>;
export declare const serveQuixosPackageRuntime: <Context, Spec extends readonly RuntimeFunctionSpec[]>(params: {
packageNamespace: string;
packageName: string;
runtimeProtocolVersion: string;
functions: Spec;
implementation: { [Name in Spec[number]["exportName"]]: RuntimeHandler<Context> | FieldOperation<Context>; };
createContext: (camino: CaminoClient, request: InvokeRequest) => Context;
}) => void;
input: Record<string, Value>;
dependencies: import("./quixos/refs_pb.js").InjectedDependency[];
};
export {};
//# sourceMappingURL=index.d.ts.map