@f5-sales-demo/xcsh 21.12.2 → 21.13.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/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"type": "module",
|
|
3
3
|
"name": "@f5-sales-demo/xcsh",
|
|
4
|
-
"version": "21.
|
|
4
|
+
"version": "21.13.0",
|
|
5
5
|
"description": "Coding agent CLI with read, bash, edit, write tools and session management",
|
|
6
6
|
"homepage": "https://github.com/f5-sales-demo/xcsh",
|
|
7
7
|
"author": "Can Boluk",
|
|
@@ -61,13 +61,13 @@
|
|
|
61
61
|
},
|
|
62
62
|
"dependencies": {
|
|
63
63
|
"@agentclientprotocol/sdk": "1.3.0",
|
|
64
|
-
"@f5-sales-demo/pi-agent-core": "21.
|
|
65
|
-
"@f5-sales-demo/pi-ai": "21.
|
|
66
|
-
"@f5-sales-demo/pi-natives": "21.
|
|
67
|
-
"@f5-sales-demo/pi-resource-management": "21.
|
|
68
|
-
"@f5-sales-demo/pi-tui": "21.
|
|
69
|
-
"@f5-sales-demo/pi-utils": "21.
|
|
70
|
-
"@f5-sales-demo/xcsh-stats": "21.
|
|
64
|
+
"@f5-sales-demo/pi-agent-core": "21.13.0",
|
|
65
|
+
"@f5-sales-demo/pi-ai": "21.13.0",
|
|
66
|
+
"@f5-sales-demo/pi-natives": "21.13.0",
|
|
67
|
+
"@f5-sales-demo/pi-resource-management": "21.13.0",
|
|
68
|
+
"@f5-sales-demo/pi-tui": "21.13.0",
|
|
69
|
+
"@f5-sales-demo/pi-utils": "21.13.0",
|
|
70
|
+
"@f5-sales-demo/xcsh-stats": "21.13.0",
|
|
71
71
|
"@mozilla/readability": "^0.6",
|
|
72
72
|
"@sinclair/typebox": "^0.34",
|
|
73
73
|
"@xterm/headless": "^6.0",
|
|
@@ -60,8 +60,10 @@ const PHASE_SOURCE = "xcsh:phase";
|
|
|
60
60
|
const REPORT_METHOD = "pane.report_agent";
|
|
61
61
|
const METADATA_METHOD = "pane.report_metadata";
|
|
62
62
|
const SESSION_METHOD = "pane.report_agent_session";
|
|
63
|
+
const HEARTBEAT_METHOD = "pane.report_agent_heartbeat";
|
|
63
64
|
const RELEASE_METHOD = "pane.release_agent";
|
|
64
65
|
const SOCKET_TIMEOUT_MS = 2000;
|
|
66
|
+
const HEARTBEAT_INTERVAL_MS = 10_000;
|
|
65
67
|
const PHASE_LABEL_TTL_MS = 60_000;
|
|
66
68
|
const SETTLED_TURN_RECONCILE_DELAY_MS = 25;
|
|
67
69
|
const PROMPT_BLOCKED_REASONS = {
|
|
@@ -160,6 +162,12 @@ export default function herdrReporter(pi: ExtensionAPI): void {
|
|
|
160
162
|
// before their agent-end extension callback has drained. The check consults
|
|
161
163
|
// XCSH's own streaming state, so a tool boundary cannot be mistaken for idle.
|
|
162
164
|
let settledTurnReconcileTimer: ReturnType<typeof setTimeout> | undefined;
|
|
165
|
+
// Heartbeats are session-scoped liveness signals. They have no lifecycle state
|
|
166
|
+
// or metadata payload, so Herdr can refresh the authoritative reporter without
|
|
167
|
+
// changing the pane's lifecycle state, state_change_seq, phase labels, or
|
|
168
|
+
// session anchor.
|
|
169
|
+
let heartbeatTimer: ReturnType<typeof setInterval> | undefined;
|
|
170
|
+
let heartbeatActive = false;
|
|
163
171
|
// Serializes frames: herdr compares `seq` across all methods for this source,
|
|
164
172
|
// so frames must reach it in the order they were generated.
|
|
165
173
|
let queue: Promise<void> = Promise.resolve();
|
|
@@ -202,6 +210,44 @@ export default function herdrReporter(pi: ExtensionAPI): void {
|
|
|
202
210
|
seq: seq++,
|
|
203
211
|
});
|
|
204
212
|
|
|
213
|
+
// Heartbeat is deliberately socket-only. Older Herdr CLIs do not expose this
|
|
214
|
+
// new typed frame, while an unavailable socket remains nonfatal just like the
|
|
215
|
+
// lifecycle socket reports above.
|
|
216
|
+
const reportHeartbeat = (): Promise<void> => {
|
|
217
|
+
const socketPath = process.env.HERDR_SOCKET_PATH;
|
|
218
|
+
if (!socketPath) return Promise.resolve();
|
|
219
|
+
// Allocate before enqueueing: another lifecycle callback can run before this
|
|
220
|
+
// task reaches the queue head, but must still receive a later sequence.
|
|
221
|
+
const frame = {
|
|
222
|
+
pane_id: paneId,
|
|
223
|
+
source: HERDR_SOURCE,
|
|
224
|
+
agent: HERDR_AGENT_LABEL,
|
|
225
|
+
seq: seq++,
|
|
226
|
+
};
|
|
227
|
+
return enqueue(() => sendToHerdrSocket(socketPath, HEARTBEAT_METHOD, frame, onError));
|
|
228
|
+
};
|
|
229
|
+
|
|
230
|
+
const startHeartbeat = (): void => {
|
|
231
|
+
if (heartbeatActive) return;
|
|
232
|
+
heartbeatActive = true;
|
|
233
|
+
heartbeatTimer = setInterval(() => {
|
|
234
|
+
// A callback already queued when shutdown starts must not report after
|
|
235
|
+
// the release frame has relinquished this authority.
|
|
236
|
+
if (heartbeatActive) void reportHeartbeat();
|
|
237
|
+
}, HEARTBEAT_INTERVAL_MS);
|
|
238
|
+
// Do not keep an otherwise completed process alive if its host skips an
|
|
239
|
+
// orderly session_shutdown callback.
|
|
240
|
+
(heartbeatTimer as { unref?: () => void }).unref?.();
|
|
241
|
+
};
|
|
242
|
+
|
|
243
|
+
const stopHeartbeat = (): void => {
|
|
244
|
+
heartbeatActive = false;
|
|
245
|
+
if (heartbeatTimer !== undefined) {
|
|
246
|
+
clearInterval(heartbeatTimer);
|
|
247
|
+
heartbeatTimer = undefined;
|
|
248
|
+
}
|
|
249
|
+
};
|
|
250
|
+
|
|
205
251
|
const reportMetadata = (params: Record<string, unknown>): Promise<void> => {
|
|
206
252
|
const socketPath = process.env.HERDR_SOCKET_PATH;
|
|
207
253
|
if (!socketPath) {
|
|
@@ -298,6 +344,7 @@ export default function herdrReporter(pi: ExtensionAPI): void {
|
|
|
298
344
|
|
|
299
345
|
// Announce presence and session identity as soon as the session is initialized.
|
|
300
346
|
pi.on("session_start", async (_event, ctx) => {
|
|
347
|
+
startHeartbeat();
|
|
301
348
|
await report("idle");
|
|
302
349
|
await reportSession(ctx);
|
|
303
350
|
});
|
|
@@ -376,6 +423,7 @@ export default function herdrReporter(pi: ExtensionAPI): void {
|
|
|
376
423
|
|
|
377
424
|
// Relinquish pane authority so herdr stops showing xcsh once we exit.
|
|
378
425
|
pi.on("session_shutdown", () => {
|
|
426
|
+
stopHeartbeat();
|
|
379
427
|
void send(RELEASE_METHOD, {
|
|
380
428
|
pane_id: paneId,
|
|
381
429
|
source: HERDR_SOURCE,
|
|
@@ -17,17 +17,17 @@ export interface BuildInfo {
|
|
|
17
17
|
}
|
|
18
18
|
|
|
19
19
|
export const BUILD_INFO: BuildInfo = {
|
|
20
|
-
"version": "21.
|
|
21
|
-
"commit": "
|
|
22
|
-
"shortCommit": "
|
|
20
|
+
"version": "21.13.0",
|
|
21
|
+
"commit": "f145dca692ca83c8fc510f963b41b2dabe7e3a3c",
|
|
22
|
+
"shortCommit": "f145dca",
|
|
23
23
|
"branch": "main",
|
|
24
|
-
"tag": "v21.
|
|
25
|
-
"commitDate": "2026-09-
|
|
26
|
-
"buildDate": "2026-09-
|
|
24
|
+
"tag": "v21.13.0",
|
|
25
|
+
"commitDate": "2026-09-06T05:26:13+00:00",
|
|
26
|
+
"buildDate": "2026-09-06T06:14:49.211Z",
|
|
27
27
|
"dirty": true,
|
|
28
28
|
"prNumber": "",
|
|
29
29
|
"repoUrl": "https://github.com/f5-sales-demo/xcsh",
|
|
30
30
|
"repoSlug": "f5-sales-demo/xcsh",
|
|
31
|
-
"commitUrl": "https://github.com/f5-sales-demo/xcsh/commit/
|
|
32
|
-
"releaseUrl": "https://github.com/f5-sales-demo/xcsh/releases/tag/v21.
|
|
31
|
+
"commitUrl": "https://github.com/f5-sales-demo/xcsh/commit/f145dca692ca83c8fc510f963b41b2dabe7e3a3c",
|
|
32
|
+
"releaseUrl": "https://github.com/f5-sales-demo/xcsh/releases/tag/v21.13.0"
|
|
33
33
|
};
|