Implement query execution, scoped RPC enrichment, live collections, and scaffold integration
This commit is contained in:
@@ -132,6 +132,21 @@ export const runtimeContracts = (workspace: WorkspaceRevision): RuntimeContract[
|
||||
})),
|
||||
});
|
||||
const dependency = (parent: GraphNode, binding: DependencyBinding, atomId: string, reviews?: Set<string>) => {
|
||||
if (binding.kind === "query") {
|
||||
const pkg = workspace.packageImports.find((pkg) => pkg.revisionId === binding.packageRevisionId);
|
||||
const query = pkg?.checkedQueries?.find((query) => query.declaration.id === binding.queryId);
|
||||
if (!query) throw new Error(`Missing checked query contract ${binding.packageRevisionId}:${binding.queryId}`);
|
||||
const key = `query:${binding.packageRevisionId}:${binding.queryId}`;
|
||||
const queryNode = nodes.get(key) ?? node(key, query);
|
||||
parent.dependencies.add(key);
|
||||
for (const effect of query.effects) {
|
||||
queryNode.dependencies.add(`interface:${effect.interfaceRevisionId}`);
|
||||
for (const conformance of workspace.conformances.filter(
|
||||
(entry) => entry.interfaceRevisionId === effect.interfaceRevisionId,
|
||||
))
|
||||
queryNode.dependencies.add(conformanceKey(conformance.atomId, conformance.interfaceRevisionId));
|
||||
}
|
||||
}
|
||||
if (binding.kind === "state") parent.dependencies.add(`attachment:${binding.slotId}`);
|
||||
if (binding.kind === "edge") parent.dependencies.add(`attachment:${binding.edgeTypeId}`);
|
||||
if (binding.kind === "constructor") {
|
||||
|
||||
Reference in New Issue
Block a user