Implement Studio root and placement capabilities on the replica graph (WI-10)
This commit is contained in:
@@ -1,3 +1,4 @@
|
||||
import { portableReflectionType, portableReflectionValue } from "./reflection.js";
|
||||
import type {
|
||||
ValueType,
|
||||
InitializationField,
|
||||
@@ -119,6 +120,20 @@ export function compileKernelProgram(plan: ExecutionPlan): unknown {
|
||||
const requirement = entry.dependencyPorts.find((p) => p.id === dependency.portId)!.requirement;
|
||||
const bound = dependency.binding;
|
||||
const common = { id: dependency.portId, ...via(bound) };
|
||||
if (bound.kind === "reflection" && requirement.kind === "reflection")
|
||||
return {
|
||||
...common,
|
||||
kind: "reflection",
|
||||
values: Object.fromEntries(
|
||||
bound.selectors.map((selector) => [
|
||||
selector,
|
||||
{
|
||||
schema: portableValueSchema(portableReflectionType(selector)),
|
||||
value: portableReflectionValue(workspace, selector),
|
||||
},
|
||||
]),
|
||||
),
|
||||
};
|
||||
if (bound.kind === "state" && requirement.kind === "state")
|
||||
return {
|
||||
...common,
|
||||
|
||||
Reference in New Issue
Block a user