@wairon/cli 5.1.1-dev.30 → 5.1.1-dev.31

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/dist/cli/index.js CHANGED
@@ -65,7 +65,7 @@ var init_defaults = __esm({
65
65
  copilot: ".github/prompts",
66
66
  codex: ".codex/agents"
67
67
  };
68
- WAIRON_VERSION = "5.1.1-dev.30";
68
+ WAIRON_VERSION = "5.1.1-dev.31";
69
69
  GITHUB_REPO = "SYW-Apps/Waffle-AIron";
70
70
  SUPPORTED_ALIASES = ["wai"];
71
71
  SCAN_EXCLUDE_DIRS = /* @__PURE__ */ new Set([
@@ -12168,6 +12168,24 @@ var init_lifecycle_entrypoints = __esm({
12168
12168
  });
12169
12169
 
12170
12170
  // src/core/rules/narrative-graph-projector.ts
12171
+ function stepEdges(step, ctx, followRegisterEdges) {
12172
+ if (step.type === "call" && step.targetComponent && step.targetMethod) {
12173
+ return [{ compId: step.targetComponent, methodName: step.targetMethod }];
12174
+ }
12175
+ if (followRegisterEdges && step.type === "register" && step.targetComponent && step.targetMethod) {
12176
+ return [{ compId: step.targetComponent, methodName: step.targetMethod }];
12177
+ }
12178
+ if (step.type === "dispatch" && step.targetComponent) {
12179
+ const edges = [{ compId: step.targetComponent }];
12180
+ const portal = ctx.componentMap.get(step.targetComponent);
12181
+ const binding = portal?.dispatch?.find((b) => b.capability === step.capability);
12182
+ if (binding && ctx.componentMap.has(binding.component)) {
12183
+ edges.push({ compId: binding.component, methodName: binding.method });
12184
+ }
12185
+ return edges;
12186
+ }
12187
+ return [];
12188
+ }
12171
12189
  function walk(ctx, seeds, options = {}) {
12172
12190
  const followDispatchTables = options.followDispatchTables ?? true;
12173
12191
  const followRegisterEdges = options.followRegisterEdges ?? true;
@@ -12225,22 +12243,9 @@ function walk(ctx, seeds, options = {}) {
12225
12243
  }
12226
12244
  if (!impl || !methodImpl) continue;
12227
12245
  for (const step of methodImpl.narrative) {
12228
- if (step.type === "call" && step.targetComponent && step.targetMethod) {
12229
- reachComponent(step.targetComponent);
12230
- enqueueMethod(step.targetComponent, step.targetMethod);
12231
- }
12232
- if (followRegisterEdges && step.type === "register" && step.targetComponent && step.targetMethod) {
12233
- reachComponent(step.targetComponent);
12234
- enqueueMethod(step.targetComponent, step.targetMethod);
12235
- }
12236
- if (step.type === "dispatch" && step.targetComponent) {
12237
- reachComponent(step.targetComponent);
12238
- const portal = ctx.componentMap.get(step.targetComponent);
12239
- const binding = portal?.dispatch?.find((b) => b.capability === step.capability);
12240
- if (binding && ctx.componentMap.has(binding.component)) {
12241
- reachComponent(binding.component);
12242
- enqueueMethod(binding.component, binding.method);
12243
- }
12246
+ for (const edge of stepEdges(step, ctx, followRegisterEdges)) {
12247
+ reachComponent(edge.compId);
12248
+ if (edge.methodName) enqueueMethod(edge.compId, edge.methodName);
12244
12249
  }
12245
12250
  }
12246
12251
  if (methodImpl.narrative.length === 0) {