pi-agent-flow 1.2.5 → 1.2.6

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.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/src/index.ts +1 -1
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pi-agent-flow",
3
- "version": "1.2.5",
3
+ "version": "1.2.6",
4
4
  "description": "Flow-state delegation extension for Pi coding agent.",
5
5
  "type": "module",
6
6
  "main": "src/index.ts",
package/src/index.ts CHANGED
@@ -1072,7 +1072,7 @@ flow [type] accomplished
1072
1072
  sessionManager: ctx.sessionManager,
1073
1073
  hasUI: ctx.hasUI,
1074
1074
  uiConfirm: (title, body) => ctx.ui.confirm(title, body),
1075
- onFlowMetrics: (metrics) => pi.emit("pi-agent-flow:complete", metrics),
1075
+ onFlowMetrics: (metrics) => { if (typeof pi.emit === "function") pi.emit("pi-agent-flow:complete", metrics); },
1076
1076
  confirmProjectFlows: params.confirmProjectFlows,
1077
1077
  },
1078
1078
  params.flow.map((f: any) => ({ type: f.type, intent: f.intent, aim: f.aim, cwd: f.cwd })),