@inf-monkeys-tech/monkeys 1.1.3 → 1.1.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/lib/esm/index.mjs CHANGED
@@ -23010,6 +23010,12 @@ var resolvePage = (input) => {
23010
23010
  const queryBindings = [];
23011
23011
  const actionBindings = [];
23012
23012
  const interactionBindings = [];
23013
+ const nodesById = /* @__PURE__ */ new Map();
23014
+ const indexNode = (node) => {
23015
+ nodesById.set(node.id, node);
23016
+ node.children?.forEach(indexNode);
23017
+ };
23018
+ indexNode(page.body);
23013
23019
  const visitNode = (node, parentNodeId) => {
23014
23020
  const registration = singleByStableIdentity(
23015
23021
  capabilityRegistrations,
@@ -23130,15 +23136,13 @@ var resolvePage = (input) => {
23130
23136
  ...cursorWindow,
23131
23137
  pageChangeIntentSchemaRevisionRef: (() => {
23132
23138
  const sourceInstanceId = cursorWindow.sourceCapabilityInstanceId ?? node.id;
23133
- const sourceRegistration = capabilityInstances.find(
23134
- (instance) => instance.instanceId === sourceInstanceId
23135
- );
23136
- const sourceCapability = sourceRegistration && capabilityRegistrations.find(
23137
- (candidate) => sameRevisionRef(
23138
- candidate.revisionRef,
23139
- sourceRegistration.capabilityRevisionRef
23140
- )
23141
- );
23139
+ const sourceNode = nodesById.get(sourceInstanceId);
23140
+ const sourceCapability = sourceNode ? singleByStableIdentity(
23141
+ capabilityRegistrations,
23142
+ "capability",
23143
+ sourceNode.component,
23144
+ `page.body.${sourceNode.id}.component`
23145
+ ) : void 0;
23142
23146
  const sourcePort = sourceCapability?.outputPorts.find(
23143
23147
  (candidate) => candidate.name === cursorWindow.pageChangePort
23144
23148
  );