agentfootprint-lens 0.26.1 → 0.27.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/{chunk-EDFVCK5X.js → chunk-UBBSNJXC.js} +47 -3
- package/dist/chunk-UBBSNJXC.js.map +1 -0
- package/dist/core.cjs +47 -2
- package/dist/core.cjs.map +1 -1
- package/dist/core.d.cts +2 -1
- package/dist/core.d.ts +2 -1
- package/dist/core.js +3 -1
- package/dist/{index-FD6j4b3o.d.cts → index-C4S1EYHe.d.cts} +72 -12
- package/dist/{index-FD6j4b3o.d.ts → index-C4S1EYHe.d.ts} +72 -12
- package/dist/index.cjs +431 -253
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +46 -6
- package/dist/index.d.ts +46 -6
- package/dist/index.js +365 -231
- package/dist/index.js.map +1 -1
- package/package.json +6 -5
- package/dist/chunk-EDFVCK5X.js.map +0 -1
|
@@ -2282,12 +2282,55 @@ function expandSubflowInternals(subflows) {
|
|
|
2282
2282
|
return { nodes, edges };
|
|
2283
2283
|
}
|
|
2284
2284
|
|
|
2285
|
+
// src/core/cursorProvenance.ts
|
|
2286
|
+
import { flattenCausalDAG, keysReadFromExecutionTree, sliceForKey } from "footprintjs/trace";
|
|
2287
|
+
function getSnapshotOf(runner) {
|
|
2288
|
+
const fn = runner?.getLastSnapshot;
|
|
2289
|
+
if (typeof fn !== "function") return void 0;
|
|
2290
|
+
return fn.call(runner);
|
|
2291
|
+
}
|
|
2292
|
+
function cursorProvenance(runner, cursorRuntimeStageId) {
|
|
2293
|
+
const snapshot = getSnapshotOf(runner);
|
|
2294
|
+
const log = snapshot?.commitLog;
|
|
2295
|
+
if (!log?.length || !cursorRuntimeStageId) return void 0;
|
|
2296
|
+
let lastIdx = -1;
|
|
2297
|
+
const written = /* @__PURE__ */ new Set();
|
|
2298
|
+
for (let i = 0; i < log.length; i++) {
|
|
2299
|
+
if (log[i].runtimeStageId !== cursorRuntimeStageId) continue;
|
|
2300
|
+
lastIdx = i;
|
|
2301
|
+
for (const t of log[i].trace) written.add(t.path);
|
|
2302
|
+
}
|
|
2303
|
+
if (lastIdx < 0 || written.size === 0) return void 0;
|
|
2304
|
+
const reads = keysReadFromExecutionTree(
|
|
2305
|
+
snapshot?.executionTree ?? { id: "__none__", logs: {}, errors: {}, metrics: {}, evals: {} }
|
|
2306
|
+
);
|
|
2307
|
+
const sliceFor = (key) => {
|
|
2308
|
+
const slice = sliceForKey(log, key, reads, {
|
|
2309
|
+
before: lastIdx + 1
|
|
2310
|
+
});
|
|
2311
|
+
const readsWarning = slice.readsCoverage !== void 0 && slice.readsCoverage.steps > 1 && slice.readsCoverage.stepsWithReads === 0;
|
|
2312
|
+
if (!slice.root) {
|
|
2313
|
+
return { key, frames: [], readsWarning, ...slice.missing !== void 0 && { missing: slice.missing } };
|
|
2314
|
+
}
|
|
2315
|
+
const frames = flattenCausalDAG(slice.root).map((n) => ({
|
|
2316
|
+
runtimeStageId: n.runtimeStageId,
|
|
2317
|
+
stageName: n.stageName,
|
|
2318
|
+
stageId: n.stageId,
|
|
2319
|
+
keysWritten: n.keysWritten,
|
|
2320
|
+
linkedBy: n.linkedBy,
|
|
2321
|
+
depth: n.depth
|
|
2322
|
+
}));
|
|
2323
|
+
return { key, frames, readsWarning };
|
|
2324
|
+
};
|
|
2325
|
+
return { writtenKeys: [...written], sliceFor };
|
|
2326
|
+
}
|
|
2327
|
+
|
|
2285
2328
|
// src/core/explainableShellProps.ts
|
|
2286
|
-
function explainableShellPropsFromRunner(agent, recorder
|
|
2329
|
+
function explainableShellPropsFromRunner(agent, recorder) {
|
|
2287
2330
|
return {
|
|
2288
2331
|
runtimeSnapshot: agent.getLastSnapshot() ?? null,
|
|
2289
2332
|
narrativeEntries: [...agent.getLastNarrativeEntries()],
|
|
2290
|
-
traceGraph: structureGraphFromRunner(agent, { decorate:
|
|
2333
|
+
traceGraph: structureGraphFromRunner(agent, { decorate: false }),
|
|
2291
2334
|
runtimeOverlay: recorder.runtime.getOverlay()
|
|
2292
2335
|
};
|
|
2293
2336
|
}
|
|
@@ -2524,9 +2567,10 @@ export {
|
|
|
2524
2567
|
lensGroupTranslator,
|
|
2525
2568
|
structureGraphFromRunner,
|
|
2526
2569
|
structureGraphFromSpec,
|
|
2570
|
+
cursorProvenance,
|
|
2527
2571
|
explainableShellPropsFromRunner,
|
|
2528
2572
|
toReactFlow,
|
|
2529
2573
|
defaultSize,
|
|
2530
2574
|
layoutLensGraph
|
|
2531
2575
|
};
|
|
2532
|
-
//# sourceMappingURL=chunk-
|
|
2576
|
+
//# sourceMappingURL=chunk-UBBSNJXC.js.map
|