Make package-runtime publication verify generated distribution

This commit is contained in:
2026-09-04 21:22:27 -07:00
parent d83f82c90f
commit 2de080c09f
10 changed files with 169 additions and 47 deletions
+10 -8
View File
@@ -96,21 +96,22 @@ export const createRuntimeContext = (camino, orch, request) => {
switch (dependency.binding.case) {
case "stateSlotId": {
const slotId = dependency.binding.value;
const dependencyObjectId = dependency.objectId || request.objectId;
const state = {
slotId,
async get() {
await recordDependency({ kind: "state", objectId: request.objectId, attachmentId: slotId });
return protoValueToJs((await camino.readState({ objectId: request.objectId, slotId })).value);
await recordDependency({ kind: "state", objectId: dependencyObjectId, attachmentId: slotId });
return protoValueToJs((await camino.readState({ objectId: dependencyObjectId, slotId })).value);
},
async live() {
await recordDependency({ kind: "state", objectId: request.objectId, attachmentId: slotId });
const value = await camino.readState({ objectId: request.objectId, slotId });
await recordDependency({ kind: "state", objectId: dependencyObjectId, attachmentId: slotId });
const value = await camino.readState({ objectId: dependencyObjectId, slotId });
if (!value.value)
throw new Error(`State ${slotId} returned no value`);
return liveValue(value.value);
},
async set(value) {
await camino.writeState({ objectId: request.objectId, slotId, value: jsToProtoValue(value) });
await camino.writeState({ objectId: dependencyObjectId, slotId, value: jsToProtoValue(value) });
},
};
ports.set(dependency.portId, state);
@@ -118,16 +119,17 @@ export const createRuntimeContext = (camino, orch, request) => {
}
case "edge": {
const { edgeTypeId, projectionId } = dependency.binding.value;
const dependencyObjectId = dependency.objectId || request.objectId;
const edge = {
edgeTypeId,
projectionId,
async resolve() {
await recordDependency({ kind: "edge", objectId: request.objectId, attachmentId: edgeTypeId, projectionId });
const result = await camino.resolveEdge({ objectId: request.objectId, edgeTypeId, projectionId });
await recordDependency({ kind: "edge", objectId: dependencyObjectId, attachmentId: edgeTypeId, projectionId });
const result = await camino.resolveEdge({ objectId: dependencyObjectId, edgeTypeId, projectionId });
return result.edges.map((entry) => targetForEdge(entry, projectionId));
},
async connect(targetObjectId) {
await camino.connectEdge({ objectId: request.objectId, edgeTypeId, projectionId, targetObjectId });
await camino.connectEdge({ objectId: dependencyObjectId, edgeTypeId, projectionId, targetObjectId });
},
};
ports.set(dependency.portId, edge);