@songsid/agend 2.1.2-beta.29 → 2.1.2-beta.30
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/backend/claude-code.d.ts +20 -0
- package/dist/backend/claude-code.js +21 -1
- package/dist/backend/claude-code.js.map +1 -1
- package/dist/daemon.d.ts +21 -1
- package/dist/daemon.js +36 -5
- package/dist/daemon.js.map +1 -1
- package/dist/fleet-manager.d.ts +18 -0
- package/dist/fleet-manager.js +54 -21
- package/dist/fleet-manager.js.map +1 -1
- package/dist/locale.js +2 -0
- package/dist/locale.js.map +1 -1
- package/dist/usage/statusline-usage.js +17 -5
- package/dist/usage/statusline-usage.js.map +1 -1
- package/package.json +1 -1
|
@@ -32,6 +32,26 @@ export declare class ClaudeCodeBackend implements CliBackend {
|
|
|
32
32
|
* a parenthesised live elapsed counter; the completed line is past tense with no
|
|
33
33
|
* `…` and no counter. The verb and the glyph both rotate, so neither is matched.
|
|
34
34
|
*
|
|
35
|
+
* The leading class is "any non-ASCII symbol, or an asterisk". It used to be
|
|
36
|
+
* `[^\x00-\x7F\p{L}\p{N}\s]` alone, requiring a non-ASCII glyph — but the
|
|
37
|
+
* animation cycles through six frames and one of them is a plain ASCII
|
|
38
|
+
* asterisk. Sampling a continuously working pane 50 times at 250ms:
|
|
39
|
+
*
|
|
40
|
+
* ✻ 11/11 ✽ 10/10 ✢ 10/10 · 9/9 ✶ 4/4 * 0/6 ← U+002A never matched
|
|
41
|
+
*
|
|
42
|
+
* Since `❯` is always on screen (claude keeps its input box rendered), the ready
|
|
43
|
+
* pattern is permanently true and this pattern is the only discriminator: one
|
|
44
|
+
* asterisk frame meant "idle" while the CLI was generating, which is what
|
|
45
|
+
* retired cancel buttons mid-turn. 12% of frames, so it hit some turns and not
|
|
46
|
+
* others.
|
|
47
|
+
*
|
|
48
|
+
* `*` is spelled out rather than opening the class to all ASCII punctuation:
|
|
49
|
+
* `> quoted… (2s)` in agent output would otherwise read as a spinner, and a
|
|
50
|
+
* false positive on a *stable* pane pins the instance in `working` forever.
|
|
51
|
+
* If a future release adds another ASCII frame this pattern misses it again —
|
|
52
|
+
* but a missed frame can no longer flip the state on its own, because the
|
|
53
|
+
* state machine only decides on patterns once output has settled.
|
|
54
|
+
*
|
|
35
55
|
* Deliberately narrow, because the cost is asymmetric. Missing the spinner just
|
|
36
56
|
* restores today's behaviour; matching prose that happens to sit on a *stable*
|
|
37
57
|
* pane would hold the instance in `working` forever — no auto-pause, no cancel
|
|
@@ -91,6 +91,26 @@ export class ClaudeCodeBackend {
|
|
|
91
91
|
* a parenthesised live elapsed counter; the completed line is past tense with no
|
|
92
92
|
* `…` and no counter. The verb and the glyph both rotate, so neither is matched.
|
|
93
93
|
*
|
|
94
|
+
* The leading class is "any non-ASCII symbol, or an asterisk". It used to be
|
|
95
|
+
* `[^\x00-\x7F\p{L}\p{N}\s]` alone, requiring a non-ASCII glyph — but the
|
|
96
|
+
* animation cycles through six frames and one of them is a plain ASCII
|
|
97
|
+
* asterisk. Sampling a continuously working pane 50 times at 250ms:
|
|
98
|
+
*
|
|
99
|
+
* ✻ 11/11 ✽ 10/10 ✢ 10/10 · 9/9 ✶ 4/4 * 0/6 ← U+002A never matched
|
|
100
|
+
*
|
|
101
|
+
* Since `❯` is always on screen (claude keeps its input box rendered), the ready
|
|
102
|
+
* pattern is permanently true and this pattern is the only discriminator: one
|
|
103
|
+
* asterisk frame meant "idle" while the CLI was generating, which is what
|
|
104
|
+
* retired cancel buttons mid-turn. 12% of frames, so it hit some turns and not
|
|
105
|
+
* others.
|
|
106
|
+
*
|
|
107
|
+
* `*` is spelled out rather than opening the class to all ASCII punctuation:
|
|
108
|
+
* `> quoted… (2s)` in agent output would otherwise read as a spinner, and a
|
|
109
|
+
* false positive on a *stable* pane pins the instance in `working` forever.
|
|
110
|
+
* If a future release adds another ASCII frame this pattern misses it again —
|
|
111
|
+
* but a missed frame can no longer flip the state on its own, because the
|
|
112
|
+
* state machine only decides on patterns once output has settled.
|
|
113
|
+
*
|
|
94
114
|
* Deliberately narrow, because the cost is asymmetric. Missing the spinner just
|
|
95
115
|
* restores today's behaviour; matching prose that happens to sit on a *stable*
|
|
96
116
|
* pane would hold the instance in `working` forever — no auto-pause, no cancel
|
|
@@ -104,7 +124,7 @@ export class ClaudeCodeBackend {
|
|
|
104
124
|
* an in-progress spinner — which is exactly the hang this is meant to surface.
|
|
105
125
|
*/
|
|
106
126
|
getBusyPattern() {
|
|
107
|
-
return /^[ \t]*[^\x00-\x7F\p{L}\p{N}\s]\s+\p{L}+…\s*\(\d+[hms]\b/mu;
|
|
127
|
+
return /^[ \t]*(?:[^\x00-\x7F\p{L}\p{N}\s]|\*)\s+\p{L}+…\s*\(\d+[hms]\b/mu;
|
|
108
128
|
}
|
|
109
129
|
getContextUsage() {
|
|
110
130
|
try {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"claude-code.js","sourceRoot":"","sources":["../../src/backend/claude-code.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACjC,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAClE,OAAO,EAAE,OAAO,EAAE,MAAM,SAAS,CAAC;AAClC,OAAO,EAAqG,aAAa,EAAE,UAAU,EAAE,aAAa,EAAE,mBAAmB,EAAE,MAAM,YAAY,CAAC;AAG9L,MAAM,OAAO,iBAAiB;IAKR;IAJX,UAAU,GAAG,QAAQ,CAAC;IACtB,4BAA4B,GAAG,IAAI,CAAC;IACrC,UAAU,CAAS;IAE3B,YAAoB,WAAmB;QAAnB,gBAAW,GAAX,WAAW,CAAQ;QACrC,IAAI,CAAC,UAAU,GAAG,aAAa,CAAC,QAAQ,CAAC,CAAC;IAC5C,CAAC;IAED,YAAY,CAAC,MAAwB;QACnC,MAAM,YAAY,GAAG,IAAI,CAAC,IAAI,CAAC,WAAW,EAAE,sBAAsB,CAAC,CAA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E;IAC1D,eAAe;QACrB,IAAI,CAAC;YACH,MAAM,GAAG,GAAG,IAAI,CAAC,KAAK,CAAC,YAAY,CAAC,IAAI,CAAC,OAAO,EAAE,EAAE,cAAc,CAAC,EAAE,OAAO,CAAC,CAAC,CAAC;YAC/E,OAAO,CAAC,CAAC,GAAG,CAAC,YAAY,EAAE,WAAW,CAAC;QACzC,CAAC;QAAC,MAAM,CAAC;YACP,OAAO,KAAK,CAAC;QACf,CAAC;IACH,CAAC;IAEO,qBAAqB;QAC3B,MAAM,UAAU,GAAG,IAAI,CAAC,IAAI,CAAC,WAAW,EAAE,iBAAiB,CAAC,CAAC;QAC7D,oFAAoF;QACpF,MAAM,MAAM,GAAG;YACb,qBAAqB;YACrB,2BAA2B;YAC3B,iBAAiB;YACjB,4CAA4C;YAC5C,oDAAoD,IAAI,CAAC,SAAS,CAAC,UAAU,CAAC,kCAAkC;SACjH,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QACb,MAAM,UAAU,GAAG,IAAI,CAAC,IAAI,CAAC,WAAW,EAAE,eAAe,CAAC,CAAC;QAC3D,aAAa,CAAC,UAAU,EAAE,MAAM,EAAE,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC,CAAC;QACnD,OAAO,UAAU,CAAC;IACpB,CAAC;CACF"}
|
package/dist/daemon.d.ts
CHANGED
|
@@ -106,7 +106,27 @@ export declare class PaneStateMachine {
|
|
|
106
106
|
constructor(readyPattern: RegExp, stuckTimeoutMs?: number, now?: number, busyPattern?: RegExp | null);
|
|
107
107
|
/** Ready, unless the backend can positively see that it is still generating. */
|
|
108
108
|
private isReady;
|
|
109
|
-
|
|
109
|
+
/**
|
|
110
|
+
* @param now when this observation is being evaluated — drives the idle and
|
|
111
|
+
* stuck decisions.
|
|
112
|
+
* @param opts.changeAt when the content is believed to have changed, if that
|
|
113
|
+
* is earlier than `now` (the tmux output timestamp). Only the elapsed-time
|
|
114
|
+
* clock uses it; defaults to `now`.
|
|
115
|
+
* @param opts.settled the caller knows no output has arrived for the debounce
|
|
116
|
+
* window, so "the content differs from the last capture" says nothing about
|
|
117
|
+
* whether the CLI is still generating — decide on the patterns instead.
|
|
118
|
+
*
|
|
119
|
+
* Captures are event-driven, not periodic: the one taken 2s after output
|
|
120
|
+
* stops is compared against a capture that may be a minute old, so it
|
|
121
|
+
* *always* differs. Without this flag that difference reads as "still
|
|
122
|
+
* working" and a finished turn would not be seen as idle until the next 60s
|
|
123
|
+
* safety sweep. Output timestamps are the honest liveness signal here, and
|
|
124
|
+
* the caller has them.
|
|
125
|
+
*/
|
|
126
|
+
observe(pane: string, now?: number, opts?: {
|
|
127
|
+
settled?: boolean;
|
|
128
|
+
changeAt?: number;
|
|
129
|
+
}): InstanceStateSnapshot;
|
|
110
130
|
/** Record pane motion from tmux control mode without capturing pane content. */
|
|
111
131
|
recordOutput(now?: number): InstanceStateSnapshot;
|
|
112
132
|
snapshot(now?: number): InstanceStateSnapshot;
|
package/dist/daemon.js
CHANGED
|
@@ -227,19 +227,37 @@ export class PaneStateMachine {
|
|
|
227
227
|
return false;
|
|
228
228
|
return this.readyPattern.test(pane);
|
|
229
229
|
}
|
|
230
|
-
|
|
230
|
+
/**
|
|
231
|
+
* @param now when this observation is being evaluated — drives the idle and
|
|
232
|
+
* stuck decisions.
|
|
233
|
+
* @param opts.changeAt when the content is believed to have changed, if that
|
|
234
|
+
* is earlier than `now` (the tmux output timestamp). Only the elapsed-time
|
|
235
|
+
* clock uses it; defaults to `now`.
|
|
236
|
+
* @param opts.settled the caller knows no output has arrived for the debounce
|
|
237
|
+
* window, so "the content differs from the last capture" says nothing about
|
|
238
|
+
* whether the CLI is still generating — decide on the patterns instead.
|
|
239
|
+
*
|
|
240
|
+
* Captures are event-driven, not periodic: the one taken 2s after output
|
|
241
|
+
* stops is compared against a capture that may be a minute old, so it
|
|
242
|
+
* *always* differs. Without this flag that difference reads as "still
|
|
243
|
+
* working" and a finished turn would not be seen as idle until the next 60s
|
|
244
|
+
* safety sweep. Output timestamps are the honest liveness signal here, and
|
|
245
|
+
* the caller has them.
|
|
246
|
+
*/
|
|
247
|
+
observe(pane, now = Date.now(), opts = {}) {
|
|
248
|
+
const { settled = false, changeAt = now } = opts;
|
|
231
249
|
const paneHash = createHash("sha256").update(pane).digest("hex");
|
|
232
250
|
const firstObservation = this.lastPaneHash === null;
|
|
233
251
|
const paneChanged = this.lastPaneHash !== paneHash;
|
|
234
252
|
if (paneChanged) {
|
|
235
253
|
this.lastPaneHash = paneHash;
|
|
236
|
-
this.lastPaneChangeAt =
|
|
254
|
+
this.lastPaneChangeAt = changeAt;
|
|
237
255
|
}
|
|
238
256
|
this.lastObservedAt = now;
|
|
239
257
|
const ready = this.isReady(pane);
|
|
240
258
|
const nextState = firstObservation
|
|
241
259
|
? ready ? "idle" : "working"
|
|
242
|
-
: paneChanged
|
|
260
|
+
: paneChanged && !settled
|
|
243
261
|
? "working"
|
|
244
262
|
: ready
|
|
245
263
|
? "idle"
|
|
@@ -1758,8 +1776,21 @@ export class Daemon extends EventEmitter {
|
|
|
1758
1776
|
|| (this.instanceStateLastOutputAt > 0 && this.instanceStateLastOutputAt >= captureStartedAt))
|
|
1759
1777
|
return;
|
|
1760
1778
|
const observedChangeAt = expectedOutputAt || captureStartedAt;
|
|
1761
|
-
|
|
1762
|
-
|
|
1779
|
+
// One observation per capture. This used to call observe() twice with the
|
|
1780
|
+
// same pane: the second call always saw an unchanged pane, so the
|
|
1781
|
+
// "content moved → still working" branch could never fire and the state
|
|
1782
|
+
// came down to the busy/ready patterns alone. That is why a single
|
|
1783
|
+
// mismatched spinner frame was enough to report idle mid-turn.
|
|
1784
|
+
const settled = this.instanceStateLastOutputAt === 0
|
|
1785
|
+
|| captureStartedAt - this.instanceStateLastOutputAt >= this.instanceStateIdleDebounceMs;
|
|
1786
|
+
// The two times are genuinely different and both matter: the content
|
|
1787
|
+
// changed when tmux reported output (observedChangeAt), but idle/stuck are
|
|
1788
|
+
// decisions about *now*. The old double-observe expressed that by calling
|
|
1789
|
+
// observe twice, which silently disabled the "content moved" branch.
|
|
1790
|
+
const snapshot = this.instanceStateMachine.observe(pane, Date.now(), {
|
|
1791
|
+
settled,
|
|
1792
|
+
changeAt: observedChangeAt,
|
|
1793
|
+
});
|
|
1763
1794
|
this.applyInstanceStateSnapshot(snapshot, pane);
|
|
1764
1795
|
// Backends without a transcript feed can still say what they are doing, if
|
|
1765
1796
|
// their TUI names it. Free-riding on a capture that already happened: no
|