agentxchain 2.57.0 → 2.58.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.
|
@@ -68,6 +68,13 @@ function truncateId(id, len = 12) {
|
|
|
68
68
|
return id.length > len ? id.slice(0, len) + '…' : id;
|
|
69
69
|
}
|
|
70
70
|
|
|
71
|
+
function truncateHeadline(headline, len = 40) {
|
|
72
|
+
if (!headline) return '—';
|
|
73
|
+
const normalized = String(headline).replace(/\s+/g, ' ').trim();
|
|
74
|
+
if (normalized.length <= len) return normalized;
|
|
75
|
+
return normalized.slice(0, len - 1) + '…';
|
|
76
|
+
}
|
|
77
|
+
|
|
71
78
|
function isInheritable(entry) {
|
|
72
79
|
const snap = entry?.inheritance_snapshot;
|
|
73
80
|
if (!snap) return false;
|
|
@@ -105,6 +112,7 @@ function renderRow(entry, index) {
|
|
|
105
112
|
<td>${formatCost(entry.total_cost_usd)}</td>
|
|
106
113
|
<td>${formatDuration(entry.duration_ms)}</td>
|
|
107
114
|
<td>${formatDate(entry.recorded_at || entry.completed_at)}</td>
|
|
115
|
+
<td title="${esc(entry.retrospective?.headline || '')}">${esc(truncateHeadline(entry.retrospective?.headline))}</td>
|
|
108
116
|
</tr>`;
|
|
109
117
|
}
|
|
110
118
|
|
|
@@ -144,6 +152,7 @@ export function render({ runHistory }) {
|
|
|
144
152
|
<th>Cost</th>
|
|
145
153
|
<th>Duration</th>
|
|
146
154
|
<th>Date</th>
|
|
155
|
+
<th>Headline</th>
|
|
147
156
|
</tr>
|
|
148
157
|
</thead>
|
|
149
158
|
<tbody>`;
|
package/package.json
CHANGED
package/src/commands/history.js
CHANGED
|
@@ -50,8 +50,11 @@ export async function historyCommand(opts) {
|
|
|
50
50
|
const parentNote = entry.provenance?.parent_run_id
|
|
51
51
|
? ` from ${entry.provenance.parent_run_id.slice(0, 12)}`
|
|
52
52
|
: '';
|
|
53
|
+
const headline = entry.retrospective?.headline
|
|
54
|
+
? ` ${formatHeadline(entry.retrospective.headline)}`
|
|
55
|
+
: '';
|
|
53
56
|
const prefix = i === 0 ? ' ' : ' └─ ';
|
|
54
|
-
console.log(`${prefix}${runId} ${status} ${pad(phases, 20)} ${pad(turns, 10)} ${pad(cost, 8)} (${trigger}${parentNote})${ctxMarker}`);
|
|
57
|
+
console.log(`${prefix}${runId} ${status} ${pad(phases, 20)} ${pad(turns, 10)} ${pad(cost, 8)} (${trigger}${parentNote})${ctxMarker}${headline}`);
|
|
55
58
|
});
|
|
56
59
|
return;
|
|
57
60
|
}
|
|
@@ -89,6 +92,7 @@ export async function historyCommand(opts) {
|
|
|
89
92
|
pad('Cost', 10),
|
|
90
93
|
pad('Duration', 10),
|
|
91
94
|
pad('Date', 20),
|
|
95
|
+
pad('Headline', 42),
|
|
92
96
|
].join(' ');
|
|
93
97
|
|
|
94
98
|
console.log(chalk.bold(header));
|
|
@@ -111,6 +115,7 @@ export async function historyCommand(opts) {
|
|
|
111
115
|
const date = entry.recorded_at
|
|
112
116
|
? new Date(entry.recorded_at).toLocaleString()
|
|
113
117
|
: '—';
|
|
118
|
+
const headline = formatHeadline(entry.retrospective?.headline);
|
|
114
119
|
|
|
115
120
|
console.log([
|
|
116
121
|
pad(idx, 4),
|
|
@@ -123,6 +128,7 @@ export async function historyCommand(opts) {
|
|
|
123
128
|
pad(cost, 10),
|
|
124
129
|
pad(duration, 10),
|
|
125
130
|
pad(date, 20),
|
|
131
|
+
pad(headline, 42),
|
|
126
132
|
].join(' '));
|
|
127
133
|
});
|
|
128
134
|
|
|
@@ -163,3 +169,10 @@ function formatDuration(ms) {
|
|
|
163
169
|
const remainMins = mins % 60;
|
|
164
170
|
return `${hrs}h ${remainMins}m`;
|
|
165
171
|
}
|
|
172
|
+
|
|
173
|
+
function formatHeadline(headline) {
|
|
174
|
+
if (!headline) return '—';
|
|
175
|
+
const normalized = String(headline).replace(/\s+/g, ' ').trim();
|
|
176
|
+
if (normalized.length <= 40) return normalized;
|
|
177
|
+
return `${normalized.slice(0, 39)}…`;
|
|
178
|
+
}
|