Generate typed QX bindings and add source editing tools

This commit is contained in:
Timothy J. Aveni
2026-09-08 14:27:24 -07:00
parent fa9e77e75c
commit 549c4539d5
9 changed files with 363 additions and 2 deletions
+8
View File
@@ -1,4 +1,5 @@
import http from "node:http";
export * from "./bindings.js";
import { AsyncLocalStorage } from "node:async_hooks";
import { randomUUID } from "node:crypto";
import { create, equals } from "@bufbuild/protobuf";
@@ -137,6 +138,7 @@ export type EdgePort = {
projectionId: string;
resolve(): Promise<string[]>;
connect(targetObjectId: string): Promise<void>;
disconnect(targetObjectId: string): Promise<void>;
};
export type InterfacePort = {
objectId: string;
@@ -210,6 +212,12 @@ export const createRuntimeContext = (
async connect(targetObjectId) {
await camino.connectEdge({ objectId: dependencyObjectId, edgeTypeId, projectionId, targetObjectId });
},
async disconnect(targetObjectId) {
const result = await camino.resolveEdge({ objectId: dependencyObjectId, edgeTypeId, projectionId });
for (const entry of result.edges) {
if (targetForEdge(entry, projectionId) === targetObjectId) await camino.disconnectEdge({ edgeId: entry.id });
}
},
};
ports.set(dependency.portId, edge);
break;