@exaudeus/workrail 1.6.0 → 1.6.1

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.
@@ -1814,8 +1814,8 @@
1814
1814
  "bytes": 1069
1815
1815
  },
1816
1816
  "v2/infra/local/session-summary-provider/index.js": {
1817
- "sha256": "5dadd21632795d624d0be4be1957329242df6c105ccf507e024e397ab3e63e7f",
1818
- "bytes": 5728
1817
+ "sha256": "736989809f7a78b3b6b0584609d8cce8424fde20e4eb8e7c513d7b012d45d9d2",
1818
+ "bytes": 6463
1819
1819
  },
1820
1820
  "v2/infra/local/sha256/index.d.ts": {
1821
1821
  "sha256": "8a727b7e54a38275ca6f9f1b8730f97cfc0a212df035df1bdc58e716e6824230",
@@ -68,7 +68,7 @@ class LocalSessionSummaryProviderV2 {
68
68
  const run = bestRun.run;
69
69
  const outputsRes = (0, node_outputs_js_1.projectNodeOutputsV2)(truth.events);
70
70
  const recapSnippet = outputsRes.isOk() && run.preferredTipNodeId
71
- ? extractRecapFromOutputs(outputsRes.value, run.preferredTipNodeId)
71
+ ? extractAggregateRecap(outputsRes.value, run, run.preferredTipNodeId)
72
72
  : null;
73
73
  const observations = extractObservations(truth.events);
74
74
  const workflow = extractWorkflowIdentity(truth.events, run.runId);
@@ -88,7 +88,19 @@ class LocalSessionSummaryProviderV2 {
88
88
  }
89
89
  }
90
90
  exports.LocalSessionSummaryProviderV2 = LocalSessionSummaryProviderV2;
91
- function extractRecapFromOutputs(outputs, nodeId) {
91
+ const MAX_RECAP_ANCESTOR_DEPTH = 100;
92
+ function collectAncestorNodeIds(nodesById, nodeId, remainingDepth) {
93
+ if (remainingDepth === 0)
94
+ return [nodeId];
95
+ const node = nodesById[nodeId];
96
+ if (!node)
97
+ return [nodeId];
98
+ const parentIds = node.parentNodeId
99
+ ? collectAncestorNodeIds(nodesById, node.parentNodeId, remainingDepth - 1)
100
+ : [];
101
+ return [nodeId, ...parentIds];
102
+ }
103
+ function extractNodeRecapMarkdown(outputs, nodeId) {
92
104
  const nodeView = outputs.nodesById[nodeId];
93
105
  if (!nodeView)
94
106
  return null;
@@ -99,9 +111,15 @@ function extractRecapFromOutputs(outputs, nodeId) {
99
111
  if (latest.payload.payloadKind !== 'notes')
100
112
  return null;
101
113
  const markdown = latest.payload.notesMarkdown;
102
- if (!markdown || typeof markdown !== 'string')
114
+ return (markdown && typeof markdown === 'string') ? markdown : null;
115
+ }
116
+ function extractAggregateRecap(outputs, run, tipNodeId) {
117
+ const parts = collectAncestorNodeIds(run.nodesById, tipNodeId, MAX_RECAP_ANCESTOR_DEPTH)
118
+ .map((nodeId) => extractNodeRecapMarkdown(outputs, nodeId))
119
+ .filter((md) => md !== null);
120
+ if (parts.length === 0)
103
121
  return null;
104
- return (0, resume_ranking_js_1.asRecapSnippet)(markdown);
122
+ return (0, resume_ranking_js_1.asRecapSnippet)(parts.join('\n\n'));
105
123
  }
106
124
  function extractObservations(events) {
107
125
  let gitHeadSha = null;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@exaudeus/workrail",
3
- "version": "1.6.0",
3
+ "version": "1.6.1",
4
4
  "description": "Step-by-step workflow enforcement for AI agents via MCP",
5
5
  "license": "MIT",
6
6
  "repository": {