agentfootprint-lens 0.27.0 → 0.28.0

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/index.cjs CHANGED
@@ -3035,6 +3035,7 @@ var LensFlow = ({
3035
3035
  showBackground = true,
3036
3036
  traceRuntimeOverlay,
3037
3037
  coActiveStageIds,
3038
+ sliceCone,
3038
3039
  colors
3039
3040
  }) => {
3040
3041
  const scrubIndex = (0, import_react2.useMemo)(() => {
@@ -3064,6 +3065,7 @@ var LensFlow = ({
3064
3065
  ...scrubIndex !== void 0 && { scrubIndex },
3065
3066
  ...onNodeClick && { onNodeClick },
3066
3067
  ...coActiveStageIds && coActiveStageIds.size > 0 && { coActiveStageIds },
3068
+ ...sliceCone && sliceCone.size > 0 && { sliceCone },
3067
3069
  ...mergedNodeTypes && { nodeTypes: mergedNodeTypes },
3068
3070
  ...colors && { colors },
3069
3071
  children: [
@@ -5116,16 +5118,30 @@ var MISSING_TEXT = {
5116
5118
  "never-written": "never written in this run \u2014 the value came from initial state, frozen run input (args), or a closure; the commit log cannot see those.",
5117
5119
  "empty-log": "the commit log is empty \u2014 nothing executed."
5118
5120
  };
5119
- function WhereFrom({ runner, cursorRuntimeStageId, onJumpTo }) {
5121
+ function WhereFrom({ runner, cursorRuntimeStageId, onJumpTo, onSliceChange }) {
5120
5122
  const provenance = (0, import_react12.useMemo)(
5121
5123
  () => cursorProvenance(runner, cursorRuntimeStageId),
5122
5124
  [runner, cursorRuntimeStageId]
5123
5125
  );
5124
5126
  const [pickedKey, setPickedKey] = (0, import_react12.useState)(void 0);
5125
- if (!provenance) return null;
5126
- const activeKey = pickedKey !== void 0 && provenance.writtenKeys.includes(pickedKey) ? pickedKey : provenance.writtenKeys[0];
5127
- if (activeKey === void 0) return null;
5128
- const slice = provenance.sliceFor(activeKey);
5127
+ const activeKey = provenance && pickedKey !== void 0 && provenance.writtenKeys.includes(pickedKey) ? pickedKey : provenance?.writtenKeys[0];
5128
+ const slice = provenance && activeKey !== void 0 ? provenance.sliceFor(activeKey) : void 0;
5129
+ (0, import_react12.useEffect)(() => {
5130
+ if (!onSliceChange) return;
5131
+ if (!slice || slice.frames.length < 2) {
5132
+ onSliceChange(void 0);
5133
+ return () => onSliceChange(void 0);
5134
+ }
5135
+ const cone = /* @__PURE__ */ new Map();
5136
+ for (const f of slice.frames) {
5137
+ const stagePart = f.runtimeStageId.split("#")[0];
5138
+ const prev = cone.get(stagePart);
5139
+ if (prev === void 0 || f.depth < prev) cone.set(stagePart, f.depth);
5140
+ }
5141
+ onSliceChange(cone);
5142
+ return () => onSliceChange(void 0);
5143
+ }, [onSliceChange, cursorRuntimeStageId, activeKey, slice?.frames.length]);
5144
+ if (!provenance || activeKey === void 0 || slice === void 0) return null;
5129
5145
  return /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("div", { style: { marginTop: 10, borderTop: `1px solid ${T.border}`, paddingTop: 8 }, children: [
5130
5146
  /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
5131
5147
  "div",
@@ -5597,6 +5613,7 @@ var EngineerView = ({
5597
5613
  (n) => n.kind === "subflow" && (n.primitiveKind === "Agent" || n.primitiveKind === "LLMCall")
5598
5614
  );
5599
5615
  }, [stepGraph]);
5616
+ const [sliceCone, setSliceCone] = (0, import_react13.useState)(void 0);
5600
5617
  const jumpToRuntimeStageId = (0, import_react13.useCallback)(
5601
5618
  (runtimeStageId) => {
5602
5619
  const exact = cursorPositions.findIndex((p) => p.runtimeStageId === runtimeStageId);
@@ -5767,6 +5784,7 @@ var EngineerView = ({
5767
5784
  LensFlow,
5768
5785
  {
5769
5786
  chart,
5787
+ ...sliceCone && { sliceCone },
5770
5788
  ...theme ? { colors: {
5771
5789
  default: theme.ground ?? (theme.mode === "dark" ? "#94a3b8" : "#64748b"),
5772
5790
  ...theme.visited !== void 0 && { done: theme.visited },
@@ -5850,7 +5868,8 @@ var EngineerView = ({
5850
5868
  {
5851
5869
  runner,
5852
5870
  cursorRuntimeStageId,
5853
- onJumpTo: jumpToRuntimeStageId
5871
+ onJumpTo: jumpToRuntimeStageId,
5872
+ onSliceChange: setSliceCone
5854
5873
  }
5855
5874
  )
5856
5875
  ] })