@songsid/agend 2.1.1-beta.17 → 2.1.1-beta.19

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.
Files changed (43) hide show
  1. package/dist/backend/claude-code.d.ts +37 -0
  2. package/dist/backend/claude-code.js +40 -1
  3. package/dist/backend/claude-code.js.map +1 -1
  4. package/dist/backend/kiro.d.ts +20 -0
  5. package/dist/backend/kiro.js +59 -0
  6. package/dist/backend/kiro.js.map +1 -1
  7. package/dist/backend/types.d.ts +27 -0
  8. package/dist/backend/types.js.map +1 -1
  9. package/dist/channel/adapters/discord.d.ts +15 -0
  10. package/dist/channel/adapters/discord.js +81 -1
  11. package/dist/channel/adapters/discord.js.map +1 -1
  12. package/dist/channel/adapters/telegram.d.ts +21 -0
  13. package/dist/channel/adapters/telegram.js +82 -0
  14. package/dist/channel/adapters/telegram.js.map +1 -1
  15. package/dist/channel/ipc-bridge.d.ts +9 -1
  16. package/dist/channel/ipc-bridge.js +12 -3
  17. package/dist/channel/ipc-bridge.js.map +1 -1
  18. package/dist/channel/types.d.ts +29 -0
  19. package/dist/daemon.d.ts +101 -5
  20. package/dist/daemon.js +304 -50
  21. package/dist/daemon.js.map +1 -1
  22. package/dist/fleet-manager.d.ts +92 -1
  23. package/dist/fleet-manager.js +332 -21
  24. package/dist/fleet-manager.js.map +1 -1
  25. package/dist/hang-detector.d.ts +19 -13
  26. package/dist/hang-detector.js +19 -49
  27. package/dist/hang-detector.js.map +1 -1
  28. package/dist/pane-write-lock.d.ts +48 -0
  29. package/dist/pane-write-lock.js +73 -0
  30. package/dist/pane-write-lock.js.map +1 -0
  31. package/dist/sd-notify.d.ts +27 -0
  32. package/dist/sd-notify.js +33 -1
  33. package/dist/sd-notify.js.map +1 -1
  34. package/dist/tmux-control.d.ts +48 -1
  35. package/dist/tmux-control.js +79 -6
  36. package/dist/tmux-control.js.map +1 -1
  37. package/package.json +1 -1
  38. package/dist/channel/tool-tracker.d.ts +0 -13
  39. package/dist/channel/tool-tracker.js +0 -58
  40. package/dist/channel/tool-tracker.js.map +0 -1
  41. package/dist/daemon-entry.d.ts +0 -1
  42. package/dist/daemon-entry.js +0 -30
  43. package/dist/daemon-entry.js.map +0 -1
@@ -1,16 +1,22 @@
1
1
  import { EventEmitter } from "node:events";
2
+ /**
3
+ * Carries "this instance looks hung" from the daemon to the fleet manager.
4
+ *
5
+ * It is only an event bridge. Hang detection itself lives in the daemon's pane-state
6
+ * machine, which emits `hang` directly when a pane stops changing for the configured
7
+ * stuck timeout; `instance-lifecycle` subscribes to that and notifies.
8
+ *
9
+ * It used to also contain a silence-timer state machine — `start()`, `isHung()`,
10
+ * `hungEmitted`, and timestamps fed by `recordActivity` / `recordInbound` /
11
+ * `recordStatuslineUpdate`. None of it ran: `start()` was never called from
12
+ * anywhere, so `isHung()` was unreachable, the timestamps were written and never
13
+ * read, and the constructor's `timeoutMinutes` was ignored (the real stuck timeout
14
+ * is read separately by the pane monitor). Its tests exercised that dead logic —
15
+ * two had identical setup with contradictory expectations, which can only pass
16
+ * unnoticed when neither runs against anything real.
17
+ *
18
+ * Kept as a named class rather than a bare EventEmitter so the daemon → lifecycle
19
+ * wiring stays typed and greppable.
20
+ */
2
21
  export declare class HangDetector extends EventEmitter {
3
- private lastActivityTs;
4
- private lastStatuslineTs;
5
- private lastInboundTs;
6
- private hungEmitted;
7
- private checkTimer;
8
- private timeoutMs;
9
- constructor(timeoutMinutes: number);
10
- recordActivity(): void;
11
- recordInbound(): void;
12
- recordStatuslineUpdate(): void;
13
- isHung(): boolean;
14
- start(intervalMs?: number): void;
15
- stop(): void;
16
22
  }
@@ -1,53 +1,23 @@
1
1
  import { EventEmitter } from "node:events";
2
+ /**
3
+ * Carries "this instance looks hung" from the daemon to the fleet manager.
4
+ *
5
+ * It is only an event bridge. Hang detection itself lives in the daemon's pane-state
6
+ * machine, which emits `hang` directly when a pane stops changing for the configured
7
+ * stuck timeout; `instance-lifecycle` subscribes to that and notifies.
8
+ *
9
+ * It used to also contain a silence-timer state machine — `start()`, `isHung()`,
10
+ * `hungEmitted`, and timestamps fed by `recordActivity` / `recordInbound` /
11
+ * `recordStatuslineUpdate`. None of it ran: `start()` was never called from
12
+ * anywhere, so `isHung()` was unreachable, the timestamps were written and never
13
+ * read, and the constructor's `timeoutMinutes` was ignored (the real stuck timeout
14
+ * is read separately by the pane monitor). Its tests exercised that dead logic —
15
+ * two had identical setup with contradictory expectations, which can only pass
16
+ * unnoticed when neither runs against anything real.
17
+ *
18
+ * Kept as a named class rather than a bare EventEmitter so the daemon → lifecycle
19
+ * wiring stays typed and greppable.
20
+ */
2
21
  export class HangDetector extends EventEmitter {
3
- lastActivityTs = 0;
4
- lastStatuslineTs = 0;
5
- lastInboundTs = 0;
6
- hungEmitted = false;
7
- checkTimer = null;
8
- timeoutMs;
9
- constructor(timeoutMinutes) {
10
- super();
11
- this.timeoutMs = timeoutMinutes * 60 * 1000;
12
- }
13
- recordActivity() {
14
- this.lastActivityTs = Date.now();
15
- if (this.hungEmitted) {
16
- this.hungEmitted = false;
17
- }
18
- }
19
- recordInbound() {
20
- this.lastInboundTs = Date.now();
21
- }
22
- recordStatuslineUpdate() {
23
- this.lastStatuslineTs = Date.now();
24
- }
25
- isHung() {
26
- if (this.lastActivityTs === 0)
27
- return false;
28
- if (this.lastInboundTs === 0)
29
- return false;
30
- const now = Date.now();
31
- // Only flag as hung if:
32
- // 1. There's an inbound that hasn't been answered (no activity since inbound)
33
- // 2. Timeout has elapsed since that inbound
34
- const noActivitySinceInbound = this.lastActivityTs < this.lastInboundTs;
35
- const stale = now - this.lastInboundTs > this.timeoutMs;
36
- return stale && noActivitySinceInbound;
37
- }
38
- start(intervalMs = 60_000) {
39
- this.checkTimer = setInterval(() => {
40
- if (this.isHung() && !this.hungEmitted) {
41
- this.hungEmitted = true;
42
- this.emit("hang");
43
- }
44
- }, intervalMs);
45
- }
46
- stop() {
47
- if (this.checkTimer) {
48
- clearInterval(this.checkTimer);
49
- this.checkTimer = null;
50
- }
51
- }
52
22
  }
53
23
  //# sourceMappingURL=hang-detector.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"hang-detector.js","sourceRoot":"","sources":["../src/hang-detector.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAE3C,MAAM,OAAO,YAAa,SAAQ,YAAY;IACpC,cAAc,GAAG,CAAC,CAAC;IACnB,gBAAgB,GAAG,CAAC,CAAC;IACrB,aAAa,GAAG,CAAC,CAAC;IAClB,WAAW,GAAG,KAAK,CAAC;IACpB,UAAU,GAA0C,IAAI,CAAC;IACzD,SAAS,CAAS;IAE1B,YAAY,cAAsB;QAChC,KAAK,EAAE,CAAC;QACR,IAAI,CAAC,SAAS,GAAG,cAAc,GAAG,EAAE,GAAG,IAAI,CAAC;IAC9C,CAAC;IAED,cAAc;QACZ,IAAI,CAAC,cAAc,GAAG,IAAI,CAAC,GAAG,EAAE,CAAC;QACjC,IAAI,IAAI,CAAC,WAAW,EAAE,CAAC;YACrB,IAAI,CAAC,WAAW,GAAG,KAAK,CAAC;QAC3B,CAAC;IACH,CAAC;IAED,aAAa;QACX,IAAI,CAAC,aAAa,GAAG,IAAI,CAAC,GAAG,EAAE,CAAC;IAClC,CAAC;IAED,sBAAsB;QACpB,IAAI,CAAC,gBAAgB,GAAG,IAAI,CAAC,GAAG,EAAE,CAAC;IACrC,CAAC;IAED,MAAM;QACJ,IAAI,IAAI,CAAC,cAAc,KAAK,CAAC;YAAE,OAAO,KAAK,CAAC;QAC5C,IAAI,IAAI,CAAC,aAAa,KAAK,CAAC;YAAE,OAAO,KAAK,CAAC;QAC3C,MAAM,GAAG,GAAG,IAAI,CAAC,GAAG,EAAE,CAAC;QACvB,wBAAwB;QACxB,8EAA8E;QAC9E,4CAA4C;QAC5C,MAAM,sBAAsB,GAAG,IAAI,CAAC,cAAc,GAAG,IAAI,CAAC,aAAa,CAAC;QACxE,MAAM,KAAK,GAAG,GAAG,GAAG,IAAI,CAAC,aAAa,GAAG,IAAI,CAAC,SAAS,CAAC;QACxD,OAAO,KAAK,IAAI,sBAAsB,CAAC;IACzC,CAAC;IAED,KAAK,CAAC,UAAU,GAAG,MAAM;QACvB,IAAI,CAAC,UAAU,GAAG,WAAW,CAAC,GAAG,EAAE;YACjC,IAAI,IAAI,CAAC,MAAM,EAAE,IAAI,CAAC,IAAI,CAAC,WAAW,EAAE,CAAC;gBACvC,IAAI,CAAC,WAAW,GAAG,IAAI,CAAC;gBACxB,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;YACpB,CAAC;QACH,CAAC,EAAE,UAAU,CAAC,CAAC;IACjB,CAAC;IAED,IAAI;QACF,IAAI,IAAI,CAAC,UAAU,EAAE,CAAC;YACpB,aAAa,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC;YAC/B,IAAI,CAAC,UAAU,GAAG,IAAI,CAAC;QACzB,CAAC;IACH,CAAC;CACF"}
1
+ {"version":3,"file":"hang-detector.js","sourceRoot":"","sources":["../src/hang-detector.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAE3C;;;;;;;;;;;;;;;;;;GAkBG;AACH,MAAM,OAAO,YAAa,SAAQ,YAAY;CAAG"}
@@ -0,0 +1,48 @@
1
+ /**
2
+ * Mutual exclusion for writes into a CLI's tmux pane.
3
+ *
4
+ * A delivery is not one tmux call, it is a transaction:
5
+ *
6
+ * set-buffer → paste-buffer → (settle delay) → send-keys Enter → confirm
7
+ *
8
+ * Anything that writes to the same pane while that transaction is mid-flight is
9
+ * not merely interleaved, it is *destructive*: an `Escape` injected between the
10
+ * paste and the Enter discards the pasted text outright, and a stray `Enter`
11
+ * submits a half-composed message. Both look identical to a dropped message from
12
+ * the user's side — the ✅ reaction never arrives and nobody can say why.
13
+ *
14
+ * `Daemon.pasteLock` already serialises inbound channel messages against each
15
+ * other, but three other writers reach the pane without going through it (the
16
+ * post-restart instructions notice, the session-snapshot injection, and the
17
+ * runtime-dialog auto-dismisser). This lock is the single point they all share.
18
+ *
19
+ * Two acquisition modes, because the writers have genuinely different needs:
20
+ *
21
+ * - `run()` queues. Correct for one-shot writers that must eventually happen.
22
+ * - `tryRun()` skips when the lock is busy. Correct for *pollers*: the dialog
23
+ * dismisser re-checks every 5s, so skipping this cycle costs one tick, whereas
24
+ * queueing it behind a delivery that is waiting on a wedged pane could defer it
25
+ * for as long as that wait lasts. A poller that queues is a poller that can
26
+ * pile up; a poller that skips cannot.
27
+ */
28
+ export declare class PaneWriteLock {
29
+ private tail;
30
+ /** Writers queued **or** running. `run()` increments before it awaits anything,
31
+ * so a writer is visible to `tryRun()` from the moment it is admitted — not
32
+ * only once the microtask queue gets around to starting it. */
33
+ private pending;
34
+ /** True while any writer holds or is waiting for the pane. */
35
+ get isBusy(): boolean;
36
+ /**
37
+ * Run `fn` with exclusive access, queueing behind any writer already admitted.
38
+ * Rejections propagate to *this* caller only — the internal chain is always
39
+ * left resolved so one failed write cannot wedge every later one.
40
+ */
41
+ run<T>(fn: () => Promise<T>): Promise<T>;
42
+ /**
43
+ * Run `fn` only if the pane is free right now. Returns `false` without calling
44
+ * `fn` when another writer is queued or running, so periodic callers can simply
45
+ * try again on their next tick instead of accumulating a backlog.
46
+ */
47
+ tryRun(fn: () => Promise<void>): Promise<boolean>;
48
+ }
@@ -0,0 +1,73 @@
1
+ /**
2
+ * Mutual exclusion for writes into a CLI's tmux pane.
3
+ *
4
+ * A delivery is not one tmux call, it is a transaction:
5
+ *
6
+ * set-buffer → paste-buffer → (settle delay) → send-keys Enter → confirm
7
+ *
8
+ * Anything that writes to the same pane while that transaction is mid-flight is
9
+ * not merely interleaved, it is *destructive*: an `Escape` injected between the
10
+ * paste and the Enter discards the pasted text outright, and a stray `Enter`
11
+ * submits a half-composed message. Both look identical to a dropped message from
12
+ * the user's side — the ✅ reaction never arrives and nobody can say why.
13
+ *
14
+ * `Daemon.pasteLock` already serialises inbound channel messages against each
15
+ * other, but three other writers reach the pane without going through it (the
16
+ * post-restart instructions notice, the session-snapshot injection, and the
17
+ * runtime-dialog auto-dismisser). This lock is the single point they all share.
18
+ *
19
+ * Two acquisition modes, because the writers have genuinely different needs:
20
+ *
21
+ * - `run()` queues. Correct for one-shot writers that must eventually happen.
22
+ * - `tryRun()` skips when the lock is busy. Correct for *pollers*: the dialog
23
+ * dismisser re-checks every 5s, so skipping this cycle costs one tick, whereas
24
+ * queueing it behind a delivery that is waiting on a wedged pane could defer it
25
+ * for as long as that wait lasts. A poller that queues is a poller that can
26
+ * pile up; a poller that skips cannot.
27
+ */
28
+ export class PaneWriteLock {
29
+ tail = Promise.resolve();
30
+ /** Writers queued **or** running. `run()` increments before it awaits anything,
31
+ * so a writer is visible to `tryRun()` from the moment it is admitted — not
32
+ * only once the microtask queue gets around to starting it. */
33
+ pending = 0;
34
+ /** True while any writer holds or is waiting for the pane. */
35
+ get isBusy() {
36
+ return this.pending > 0;
37
+ }
38
+ /**
39
+ * Run `fn` with exclusive access, queueing behind any writer already admitted.
40
+ * Rejections propagate to *this* caller only — the internal chain is always
41
+ * left resolved so one failed write cannot wedge every later one.
42
+ */
43
+ run(fn) {
44
+ this.pending++;
45
+ // Decrement inside the writer, not on the tail chain: a caller that awaits its
46
+ // own write and then asks `isBusy` must see the pane free, rather than busy for
47
+ // one extra microtask because the bookkeeping trailed the result.
48
+ const result = this.tail.then(async () => {
49
+ try {
50
+ return await fn();
51
+ }
52
+ finally {
53
+ this.pending--;
54
+ }
55
+ });
56
+ // Settle on the chain, not on the returned promise: the caller still sees the
57
+ // rejection, but the next queued writer sees a resolved predecessor.
58
+ this.tail = result.then(() => undefined, () => undefined);
59
+ return result;
60
+ }
61
+ /**
62
+ * Run `fn` only if the pane is free right now. Returns `false` without calling
63
+ * `fn` when another writer is queued or running, so periodic callers can simply
64
+ * try again on their next tick instead of accumulating a backlog.
65
+ */
66
+ async tryRun(fn) {
67
+ if (this.isBusy)
68
+ return false;
69
+ await this.run(fn);
70
+ return true;
71
+ }
72
+ }
73
+ //# sourceMappingURL=pane-write-lock.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"pane-write-lock.js","sourceRoot":"","sources":["../src/pane-write-lock.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AACH,MAAM,OAAO,aAAa;IAChB,IAAI,GAAqB,OAAO,CAAC,OAAO,EAAE,CAAC;IACnD;;oEAEgE;IACxD,OAAO,GAAG,CAAC,CAAC;IAEpB,8DAA8D;IAC9D,IAAI,MAAM;QACR,OAAO,IAAI,CAAC,OAAO,GAAG,CAAC,CAAC;IAC1B,CAAC;IAED;;;;OAIG;IACH,GAAG,CAAI,EAAoB;QACzB,IAAI,CAAC,OAAO,EAAE,CAAC;QACf,+EAA+E;QAC/E,gFAAgF;QAChF,kEAAkE;QAClE,MAAM,MAAM,GAAG,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,KAAK,IAAI,EAAE;YACvC,IAAI,CAAC;gBACH,OAAO,MAAM,EAAE,EAAE,CAAC;YACpB,CAAC;oBAAS,CAAC;gBACT,IAAI,CAAC,OAAO,EAAE,CAAC;YACjB,CAAC;QACH,CAAC,CAAC,CAAC;QACH,8EAA8E;QAC9E,qEAAqE;QACrE,IAAI,CAAC,IAAI,GAAG,MAAM,CAAC,IAAI,CAAC,GAAG,EAAE,CAAC,SAAS,EAAE,GAAG,EAAE,CAAC,SAAS,CAAC,CAAC;QAC1D,OAAO,MAAM,CAAC;IAChB,CAAC;IAED;;;;OAIG;IACH,KAAK,CAAC,MAAM,CAAC,EAAuB;QAClC,IAAI,IAAI,CAAC,MAAM;YAAE,OAAO,KAAK,CAAC;QAC9B,MAAM,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;QACnB,OAAO,IAAI,CAAC;IACd,CAAC;CACF"}
@@ -15,5 +15,32 @@ export declare function isFleetOwner(dataDir?: string, pid?: number): boolean;
15
15
  type NotifyExecutor = (file: string, args: readonly string[], options: Parameters<typeof execFileSync>[2]) => unknown;
16
16
  /** Exported for a focused test of the exact helper environment. */
17
17
  export declare function sendSystemdNotification(state: string, socket: string, environment: NodeJS.ProcessEnv, execute?: NotifyExecutor): void;
18
+ export type AsyncNotifyExecutor = (file: string, args: readonly string[], options: {
19
+ env: NodeJS.ProcessEnv;
20
+ timeout: number;
21
+ }, callback: (error: Error | null) => void) => unknown;
22
+ /** Exported so a test can drive the async path without spawning anything. */
23
+ export declare function sendSystemdNotificationAsync(state: string, socket: string, environment: NodeJS.ProcessEnv, execute?: AsyncNotifyExecutor): void;
24
+ /**
25
+ * Send a notification without blocking the event loop.
26
+ *
27
+ * The watchdog ping exists to prove this process is still turning its event
28
+ * loop. Proving it with `execFileSync` stopped the loop for as long as the fork
29
+ * took — up to the 5s timeout — every 30 seconds, and forking is slowest exactly
30
+ * when the machine is loaded, i.e. when the ping matters. A fire-and-forget spawn
31
+ * says the same thing about liveness (the timer fired, the call was made) without
32
+ * contradicting itself.
33
+ *
34
+ * Still a subprocess: Node does not expose AF_UNIX datagram sockets, so
35
+ * systemd-notify remains the only way to reach NOTIFY_SOCKET from here.
36
+ */
18
37
  export declare function sdNotify(state: string): void;
38
+ /**
39
+ * Blocking variant, for the one case where the process is about to exit.
40
+ *
41
+ * `STOPPING=1` has to reach systemd before the event loop stops running, and an
42
+ * async spawn queued on the way out may simply never be executed. Nothing else
43
+ * should use this.
44
+ */
45
+ export declare function sdNotifyBlocking(state: string): void;
19
46
  export {};
package/dist/sd-notify.js CHANGED
@@ -1,4 +1,4 @@
1
- import { execFileSync } from "node:child_process";
1
+ import { execFile, execFileSync } from "node:child_process";
2
2
  import { readFileSync } from "node:fs";
3
3
  import { join } from "node:path";
4
4
  import { getAgendHome } from "./paths.js";
@@ -38,7 +38,39 @@ export function sendSystemdNotification(state, socket, environment, execute = ex
38
38
  timeout: 5000,
39
39
  });
40
40
  }
41
+ /** Exported so a test can drive the async path without spawning anything. */
42
+ export function sendSystemdNotificationAsync(state, socket, environment, execute = execFile) {
43
+ execute("systemd-notify", [state], { env: buildNotifyEnvironment(environment, socket), timeout: 5000 }, () => { });
44
+ }
45
+ /**
46
+ * Send a notification without blocking the event loop.
47
+ *
48
+ * The watchdog ping exists to prove this process is still turning its event
49
+ * loop. Proving it with `execFileSync` stopped the loop for as long as the fork
50
+ * took — up to the 5s timeout — every 30 seconds, and forking is slowest exactly
51
+ * when the machine is loaded, i.e. when the ping matters. A fire-and-forget spawn
52
+ * says the same thing about liveness (the timer fired, the call was made) without
53
+ * contradicting itself.
54
+ *
55
+ * Still a subprocess: Node does not expose AF_UNIX datagram sockets, so
56
+ * systemd-notify remains the only way to reach NOTIFY_SOCKET from here.
57
+ */
41
58
  export function sdNotify(state) {
59
+ if (!notifySocket || !isFleetOwner())
60
+ return;
61
+ try {
62
+ sendSystemdNotificationAsync(state, notifySocket, process.env);
63
+ }
64
+ catch { /* best effort */ }
65
+ }
66
+ /**
67
+ * Blocking variant, for the one case where the process is about to exit.
68
+ *
69
+ * `STOPPING=1` has to reach systemd before the event loop stops running, and an
70
+ * async spawn queued on the way out may simply never be executed. Nothing else
71
+ * should use this.
72
+ */
73
+ export function sdNotifyBlocking(state) {
42
74
  if (!notifySocket || !isFleetOwner())
43
75
  return;
44
76
  try {
@@ -1 +1 @@
1
- {"version":3,"file":"sd-notify.js","sourceRoot":"","sources":["../src/sd-notify.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAClD,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AACvC,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACjC,OAAO,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAE1C;;;;;;;;GAQG;AACH,MAAM,UAAU,mBAAmB,CAAC,WAA8B;IAChE,MAAM,MAAM,GAAG,WAAW,CAAC,aAAa,CAAC;IACzC,OAAO,WAAW,CAAC,aAAa,CAAC;IACjC,OAAO,MAAM,IAAI,SAAS,C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AE;QACjC,GAAG,EAAE,sBAAsB,CAAC,WAAW,EAAE,MAAM,CAAC;QAChD,KAAK,EAAE,QAAQ;QACf,OAAO,EAAE,IAAI;KACd,CAAC,CAAC;AACL,CAAC;AASD,6EAA6E;AAC7E,MAAM,UAAU,4BAA4B,CAC1C,KAAa,EACb,MAAc,EACd,WAA8B,EAC9B,UAA+B,QAA0C;IAEzE,OAAO,CACL,gBAAgB,EAChB,CAAC,KAAK,CAAC,EACP,EAAE,GAAG,EAAE,sBAAsB,CAAC,WAAW,EAAE,MAAM,CAAC,EAAE,OAAO,EAAE,IAAI,EAAE,EACnE,GAAG,EAAE,GAAyE,CAAC,CAChF,CAAC;AACJ,CAAC;AAED;;;;;;;;;;;;GAYG;AACH,MAAM,UAAU,QAAQ,CAAC,KAAa;IACpC,IAAI,CAAC,YAAY,IAAI,CAAC,YAAY,EAAE;QAAE,OAAO;IAC7C,IAAI,CAAC;QACH,4BAA4B,CAAC,KAAK,EAAE,YAAY,EAAE,OAAO,CAAC,GAAG,CAAC,CAAC;IACjE,CAAC;IAAC,MAAM,CAAC,CAAC,iBAAiB,CAAC,CAAC;AAC/B,CAAC;AAED;;;;;;GAMG;AACH,MAAM,UAAU,gBAAgB,CAAC,KAAa;IAC5C,IAAI,CAAC,YAAY,IAAI,CAAC,YAAY,EAAE;QAAE,OAAO;IAC7C,IAAI,CAAC;QACH,uBAAuB,CAAC,KAAK,EAAE,YAAY,EAAE,OAAO,CAAC,GAAG,CAAC,CAAC;IAC5D,CAAC;IAAC,MAAM,CAAC,CAAC,iBAAiB,CAAC,CAAC;AAC/B,CAAC"}
@@ -25,8 +25,12 @@ export declare class TmuxControlClient extends EventEmitter {
25
25
  private lastOutputAt;
26
26
  private paneToWindow;
27
27
  private registeredWindows;
28
+ private resolveFailures;
28
29
  private stopped;
29
30
  private reconnectTimer;
31
+ /** Epoch ms of the last observation reset. Everything before it is unobservable:
32
+ * the pane cache was dropped, so the absence of a record proves nothing. */
33
+ private observationResetAt;
30
34
  private safetySweepTimer;
31
35
  constructor(sessionName: string, silenceMs?: number, logger?: Logger | undefined);
32
36
  start(): void;
@@ -38,8 +42,51 @@ export declare class TmuxControlClient extends EventEmitter {
38
42
  registerWindow(windowId: string): Promise<void>;
39
43
  /** Unregister a window (call on killWindow) */
40
44
  unregisterWindow(windowId: string): void;
41
- /** Resolve a window's current pane id and cache the mapping. */
45
+ /**
46
+ * Resolve a window's current pane id and cache the mapping.
47
+ *
48
+ * Drops a registration that has failed to resolve `RESOLVE_FAILURES_BEFORE_DROP`
49
+ * times in a row. Every reconnect re-resolves every registered window, one tmux
50
+ * subprocess each, so a registration for a window that no longer exists is a
51
+ * permanent per-reconnect cost — and callers do forget to unregister (a crash
52
+ * respawn creates a new window id and the dead one used to stay forever).
53
+ *
54
+ * Consecutive failures rather than one: `list-panes` also fails transiently when
55
+ * tmux is busy, e.g. during a fleet-restart storm, and dropping a live window's
56
+ * registration would silence its output events.
57
+ */
42
58
  private resolvePane;
59
+ /**
60
+ * Forget everything we knew about panes, and remember that we have forgotten.
61
+ *
62
+ * Kept as one method so the grace can never be skipped: clearing the maps
63
+ * without arming it is precisely the bug this exists to prevent.
64
+ */
65
+ private resetPaneObservations;
66
+ /**
67
+ * True while a freshly (re)connected client has not had time to observe output.
68
+ *
69
+ * `connect()` drops the pane cache, so for a moment afterwards *every* pane looks
70
+ * like it has never produced output — including panes that are mid-generation.
71
+ * Reading that as "idle" is the dangerous direction: a delivery would skip its
72
+ * busy branch and paste straight into a working CLI, where Enter is a steering
73
+ * interrupt rather than a new turn.
74
+ *
75
+ * `silenceMs` is the right length because it is already this class's definition
76
+ * of idle: a pane that produces nothing for that long counts as idle anyway, so
77
+ * the grace never suppresses a state the client would otherwise have reported.
78
+ * An actively generating pane re-registers well inside it.
79
+ */
80
+ private inObservationGrace;
81
+ /**
82
+ * When this client last lost its view of every pane (0 if it never has).
83
+ *
84
+ * A caller reasoning about a *window* of time — "did the pane react in the two
85
+ * seconds after I pressed Enter?" — needs to know whether it could see for all
86
+ * of it. A reset inside that window makes a negative answer meaningless, and
87
+ * acting on it produces confident, wrong conclusions.
88
+ */
89
+ getObservationResetAt(): number;
43
90
  /** Check if a window's pane has been silent for at least silenceMs */
44
91
  isIdle(windowId: string): boolean;
45
92
  /** Timestamp of the window pane's last observed output, or undefined if unknown. */
@@ -3,6 +3,12 @@ import { EventEmitter } from "node:events";
3
3
  import { createInterface } from "node:readline";
4
4
  import { getTmuxSocketName } from "./paths.js";
5
5
  export const CONTROL_SAFETY_SWEEP_MS = 60_000;
6
+ /**
7
+ * Consecutive `list-panes` failures before a window's registration is dropped.
8
+ * More than one because tmux fails transiently under load, and unregistering a
9
+ * live window would silence the output events its daemon depends on.
10
+ */
11
+ const RESOLVE_FAILURES_BEFORE_DROP = 3;
6
12
  function tmuxArgs(args) {
7
13
  const socket = getTmuxSocketName();
8
14
  return socket ? ["-L", socket, ...args] : args;
@@ -36,8 +42,12 @@ export class TmuxControlClient extends EventEmitter {
36
42
  lastOutputAt = new Map(); // paneId → timestamp
37
43
  paneToWindow = new Map(); // paneId → windowId
38
44
  registeredWindows = new Set(); // windowIds we should re-resolve on reconnect
45
+ resolveFailures = new Map(); // windowId → consecutive resolve failures
39
46
  stopped = false;
40
47
  reconnectTimer = null;
48
+ /** Epoch ms of the last observation reset. Everything before it is unobservable:
49
+ * the pane cache was dropped, so the absence of a record proves nothing. */
50
+ observationResetAt = 0;
41
51
  safetySweepTimer = null;
42
52
  constructor(sessionName, silenceMs = 2000, logger) {
43
53
  super();
@@ -80,6 +90,7 @@ export class TmuxControlClient extends EventEmitter {
80
90
  /** Unregister a window (call on killWindow) */
81
91
  unregisterWindow(windowId) {
82
92
  this.registeredWindows.delete(windowId);
93
+ this.resolveFailures.delete(windowId);
83
94
  for (const [pane, win] of this.paneToWindow) {
84
95
  if (win === windowId) {
85
96
  this.paneToWindow.delete(pane);
@@ -88,30 +99,93 @@ export class TmuxControlClient extends EventEmitter {
88
99
  }
89
100
  }
90
101
  }
91
- /** Resolve a window's current pane id and cache the mapping. */
102
+ /**
103
+ * Resolve a window's current pane id and cache the mapping.
104
+ *
105
+ * Drops a registration that has failed to resolve `RESOLVE_FAILURES_BEFORE_DROP`
106
+ * times in a row. Every reconnect re-resolves every registered window, one tmux
107
+ * subprocess each, so a registration for a window that no longer exists is a
108
+ * permanent per-reconnect cost — and callers do forget to unregister (a crash
109
+ * respawn creates a new window id and the dead one used to stay forever).
110
+ *
111
+ * Consecutive failures rather than one: `list-panes` also fails transiently when
112
+ * tmux is busy, e.g. during a fleet-restart storm, and dropping a live window's
113
+ * registration would silence its output events.
114
+ */
92
115
  async resolvePane(windowId) {
93
116
  try {
94
117
  const paneId = await execTmux([
95
118
  "list-panes", "-t", `${this.sessionName}:${windowId}`,
96
119
  "-F", "#{pane_id}",
97
120
  ]);
121
+ this.resolveFailures.delete(windowId);
98
122
  if (paneId) {
99
123
  this.paneToWindow.set(paneId, windowId);
100
124
  this.logger?.debug({ windowId, paneId }, "Registered window→pane mapping");
101
125
  }
102
126
  }
103
127
  catch {
104
- this.logger?.debug({ windowId }, "Failed to resolve pane ID for window");
128
+ const failures = (this.resolveFailures.get(windowId) ?? 0) + 1;
129
+ this.resolveFailures.set(windowId, failures);
130
+ if (failures >= RESOLVE_FAILURES_BEFORE_DROP && this.registeredWindows.has(windowId)) {
131
+ this.logger?.debug({ windowId, failures }, "Window has not resolved for several attempts — dropping its registration");
132
+ this.unregisterWindow(windowId);
133
+ return;
134
+ }
135
+ this.logger?.debug({ windowId, failures }, "Failed to resolve pane ID for window");
105
136
  }
106
137
  }
138
+ /**
139
+ * Forget everything we knew about panes, and remember that we have forgotten.
140
+ *
141
+ * Kept as one method so the grace can never be skipped: clearing the maps
142
+ * without arming it is precisely the bug this exists to prevent.
143
+ */
144
+ resetPaneObservations() {
145
+ this.paneToWindow.clear();
146
+ this.lastOutputAt.clear();
147
+ this.observationResetAt = Date.now();
148
+ }
149
+ /**
150
+ * True while a freshly (re)connected client has not had time to observe output.
151
+ *
152
+ * `connect()` drops the pane cache, so for a moment afterwards *every* pane looks
153
+ * like it has never produced output — including panes that are mid-generation.
154
+ * Reading that as "idle" is the dangerous direction: a delivery would skip its
155
+ * busy branch and paste straight into a working CLI, where Enter is a steering
156
+ * interrupt rather than a new turn.
157
+ *
158
+ * `silenceMs` is the right length because it is already this class's definition
159
+ * of idle: a pane that produces nothing for that long counts as idle anyway, so
160
+ * the grace never suppresses a state the client would otherwise have reported.
161
+ * An actively generating pane re-registers well inside it.
162
+ */
163
+ inObservationGrace() {
164
+ return this.observationResetAt > 0 && Date.now() < this.observationResetAt + this.silenceMs;
165
+ }
166
+ /**
167
+ * When this client last lost its view of every pane (0 if it never has).
168
+ *
169
+ * A caller reasoning about a *window* of time — "did the pane react in the two
170
+ * seconds after I pressed Enter?" — needs to know whether it could see for all
171
+ * of it. A reset inside that window makes a negative answer meaningless, and
172
+ * acting on it produces confident, wrong conclusions.
173
+ */
174
+ getObservationResetAt() {
175
+ return this.observationResetAt;
176
+ }
107
177
  /** Check if a window's pane has been silent for at least silenceMs */
108
178
  isIdle(windowId) {
109
179
  const paneId = this.windowToPaneId(windowId);
180
+ // "Unknown" means unknown, not idle — but only while that ignorance is fresh.
181
+ // After the grace we fall back to the old optimistic answer, because a window
182
+ // that is genuinely untracked (never registered, or resolve failed) must not
183
+ // block delivery forever.
110
184
  if (!paneId)
111
- return true; // unknown window = assume idle
185
+ return !this.inObservationGrace();
112
186
  const last = this.lastOutputAt.get(paneId);
113
187
  if (last == null)
114
- return true;
188
+ return !this.inObservationGrace();
115
189
  return Date.now() - last >= this.silenceMs;
116
190
  }
117
191
  /** Timestamp of the window pane's last observed output, or undefined if unknown. */
@@ -217,8 +291,7 @@ export class TmuxControlClient extends EventEmitter {
217
291
  // disconnect that windows churned) can leave our cached paneId →
218
292
  // windowId mapping pointing at a stale or recycled pane. Drop the
219
293
  // cache and re-resolve every registered window from the new server.
220
- this.paneToWindow.clear();
221
- this.lastOutputAt.clear();
294
+ this.resetPaneObservations();
222
295
  // This is an observation-only client with no real terminal geometry.
223
296
  // `ignore-size` prevents tmux's `window-size=latest` policy from treating
224
297
  // its synthetic dimensions as authoritative. This flag is now load-bearing,
@@ -1 +1 @@
1
- {"version":3,"file":"tmux-control.js","sourceRoot":"","sources":["../src/tmux-control.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,QAAQ,EAAqB,MAAM,oBAAoB,CAAC;AACxE,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAC3C,OAAO,EAAE,eAAe,EAAkB,MAAM,eAAe,CAAC;AAEhE,OAAO,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAC;AAQ/C,MAAM,CAAC,MAAM,uBAAuB,GAAG,MAAM,CAAC;AAE9C,SAAS,QAAQ,CAAC,IAAc;IAC9B,MAAM,MAAM,GAAG,iBAAiB,EAAE,CAAC;IACnC,OAAO,MAAM,CAAC,CAAC,CAAC,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,IAAI,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC;AACjD,CAAC;AAED,SAAS,QAAQ,CAAC,IAAc;IAC9B,OAAO,IAAI,OAAO,CAAC,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE;QACrC,QAAQ,CAAC,MAAM,EAAE,QAAQ,CAAC,IAAI,CAAC,EAAE,CAAC,GAAG,EAAE,MAAM,EAAE,EAAE;YAC/C,IAAI,GAAG;gBAAE,MAAM,CAAC,GAAG,CAAC,CAAC;;gBAChB,OAAO,CAAC,MAAM,CAAC,IAAI,EAAE,CAAC,CAAC;QAC9B,CAAC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;AACL,CAAC;AAED;;;;;;;;;GASG;AACH,MAAM,OAAO,iBAAkB,SAAQ,YAAY;IAWvC;IACA;IACA;IAZF,IAAI,GAAwB,IAAI,CAAC;IACjC,EAAE,GAAqB,IAAI,CAAC;IAC5B,YAAY,GAAG,IAAI,GAAG,EAAkB,CAAC,CA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AAI,GAAG,IAAI,CAAC;IACnB,CAAC;CACF"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@songsid/agend",
3
- "version": "2.1.1-beta.17",
3
+ "version": "2.1.1-beta.19",
4
4
  "description": "Multi-agent fleet daemon — run any coding CLI (Claude, Gemini, Codex, OpenCode) from Telegram",
5
5
  "type": "module",
6
6
  "bin": {
@@ -1,13 +0,0 @@
1
- import type { ChannelAdapter } from "./types.js";
2
- export declare class ToolTracker {
3
- private adapter;
4
- private chatId;
5
- private threadId?;
6
- private statusMessageId;
7
- private lines;
8
- constructor(adapter: ChannelAdapter, chatId: string, threadId?: string | undefined);
9
- onToolUse(toolName: string, input: unknown): Promise<void>;
10
- onToolResult(toolName: string, _output: unknown): Promise<void>;
11
- reset(): void;
12
- private summarizeTool;
13
- }