@songsid/agend 2.2.0-beta.5 → 2.2.0-beta.6

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 (68) hide show
  1. package/dist/backend/claude-carry.d.ts +22 -0
  2. package/dist/backend/claude-carry.js +170 -0
  3. package/dist/backend/claude-carry.js.map +1 -0
  4. package/dist/backend/claude-code.d.ts +16 -0
  5. package/dist/backend/claude-code.js +92 -2
  6. package/dist/backend/claude-code.js.map +1 -1
  7. package/dist/backend/credential-profile.d.ts +7 -0
  8. package/dist/backend/credential-profile.js +7 -1
  9. package/dist/backend/credential-profile.js.map +1 -1
  10. package/dist/backend/kiro.js +5 -2
  11. package/dist/backend/kiro.js.map +1 -1
  12. package/dist/backend/muse.d.ts +41 -0
  13. package/dist/backend/muse.js +239 -44
  14. package/dist/backend/muse.js.map +1 -1
  15. package/dist/backend/types.d.ts +7 -0
  16. package/dist/backend/types.js.map +1 -1
  17. package/dist/background-work-ended.d.ts +18 -0
  18. package/dist/background-work-ended.js +30 -0
  19. package/dist/background-work-ended.js.map +1 -0
  20. package/dist/channel/adapters/telegram.d.ts +4 -5
  21. package/dist/channel/adapters/telegram.js +33 -17
  22. package/dist/channel/adapters/telegram.js.map +1 -1
  23. package/dist/channel/message-edit-errors.d.ts +5 -0
  24. package/dist/channel/message-edit-errors.js +24 -0
  25. package/dist/channel/message-edit-errors.js.map +1 -0
  26. package/dist/cli.js +25 -10
  27. package/dist/cli.js.map +1 -1
  28. package/dist/daemon.js +41 -0
  29. package/dist/daemon.js.map +1 -1
  30. package/dist/fleet-context.d.ts +4 -1
  31. package/dist/fleet-manager.d.ts +82 -5
  32. package/dist/fleet-manager.js +355 -60
  33. package/dist/fleet-manager.js.map +1 -1
  34. package/dist/general-knowledge/skills/credential-profiles/SKILL.md +44 -9
  35. package/dist/locale.js +14 -2
  36. package/dist/locale.js.map +1 -1
  37. package/dist/needs-you-hub.js +2 -0
  38. package/dist/needs-you-hub.js.map +1 -1
  39. package/dist/needs-you-live.d.ts +6 -0
  40. package/dist/needs-you-live.js +23 -3
  41. package/dist/needs-you-live.js.map +1 -1
  42. package/dist/outbound-handlers.d.ts +7 -0
  43. package/dist/outbound-handlers.js +19 -10
  44. package/dist/outbound-handlers.js.map +1 -1
  45. package/dist/restart-progress.d.ts +4 -0
  46. package/dist/restart-progress.js +7 -0
  47. package/dist/restart-progress.js.map +1 -1
  48. package/dist/service-installer.d.ts +31 -0
  49. package/dist/service-installer.js +41 -2
  50. package/dist/service-installer.js.map +1 -1
  51. package/dist/topic-commands.js +3 -1
  52. package/dist/topic-commands.js.map +1 -1
  53. package/dist/ui/shared/app-stream.js +21 -4
  54. package/dist/ui/shared/app.css +5 -2
  55. package/dist/ui/shared/usage-dialog.js +10 -1
  56. package/dist/update-install.d.ts +6 -2
  57. package/dist/update-install.js +8 -2
  58. package/dist/update-install.js.map +1 -1
  59. package/dist/update-marker.d.ts +11 -0
  60. package/dist/update-marker.js +12 -0
  61. package/dist/update-marker.js.map +1 -1
  62. package/dist/web-api.d.ts +3 -1
  63. package/dist/web-server-drain.d.ts +10 -0
  64. package/dist/web-server-drain.js +50 -0
  65. package/dist/web-server-drain.js.map +1 -0
  66. package/package.json +1 -1
  67. package/templates/launchd.plist.ejs +3 -1
  68. package/templates/systemd.service.ejs +2 -1
package/dist/daemon.js CHANGED
@@ -9,6 +9,7 @@ import { rotateLogIfNeededAsync } from "./logger.js";
9
9
  import { coredumpFilterLaunchPrefix } from "./coredump-filter.js";
10
10
  import { mcpServerState } from "./mcp-liveness.js";
11
11
  import { clearPausedMarker, writePausedMarker } from "./pause-marker.js";
12
+ import { writeBackgroundWorkEndedMarker } from "./background-work-ended.js";
12
13
  import { TmuxManager, resolveTmuxLogicalSize } from "./tmux-manager.js";
13
14
  import { TranscriptMonitor } from "./transcript-monitor.js";
14
15
  import { createTranscriptSource } from "./transcript-sources.js";
@@ -4232,6 +4233,13 @@ export class Daemon extends EventEmitter {
4232
4233
  if (!backend.quitBlockedByDialog(pane))
4233
4234
  return false;
4234
4235
  this.logger.warn({ reason }, "The CLI asked to confirm its exit (background work is running) — cancelling that prompt and stopping the process, not answering it");
4236
+ // #1716: the background work is about to be ended — record it where the
4237
+ // stop/restart reply and the instance topic notice can report it, so the
4238
+ // kill is never silent.
4239
+ try {
4240
+ writeBackgroundWorkEndedMarker(this.instanceDir, reason);
4241
+ }
4242
+ catch { /* reporting only */ }
4235
4243
  await this.tmux.sendSpecialKey("Escape").catch(() => false);
4236
4244
  return true;
4237
4245
  }
@@ -4564,6 +4572,39 @@ export class Daemon extends EventEmitter {
4564
4572
  this.pauseRequested = false;
4565
4573
  return;
4566
4574
  }
4575
+ // #1717: an idle pause is AgEnD-initiated and silent — it must not kill
4576
+ // the user's running background work the way an explicit stop may. Defer
4577
+ // this cycle while the backend reports background work; the next idle
4578
+ // tick retries once the task ends. A pane-capture failure proceeds (the
4579
+ // quit-menu handler below stays the backstop), never wedges unpaused.
4580
+ if (this.backend?.backgroundWorkRunning && this.tmux) {
4581
+ const tmux = this.tmux;
4582
+ const windowId = tmux.getWindowId?.();
4583
+ const generation = this.spawnGeneration;
4584
+ let pane = null;
4585
+ try {
4586
+ pane = await tmux.capturePane();
4587
+ }
4588
+ catch { /* capture failed — pause as before, after revalidation */ }
4589
+ // #1730 P2-2: the await yields — the pane read is only valid for the
4590
+ // world it was taken from. Revalidate owner, phase, state and queue
4591
+ // before acting on it; anything that moved defers this cycle.
4592
+ if (this.tmux !== tmux
4593
+ || this.tmux?.getWindowId?.() !== windowId
4594
+ || this.spawnGeneration !== generation
4595
+ || this.getPauseWakeState() !== "active"
4596
+ || !(this.instanceState === "idle" || (allowStuck && this.instanceState === "stuck"))
4597
+ || this.pasteQueueDepth > 0) {
4598
+ this.logger.info("Deferring auto-pause: pause preconditions changed during the pane read");
4599
+ this.pauseRequested = false;
4600
+ return;
4601
+ }
4602
+ if (pane !== null && this.backend?.backgroundWorkRunning?.(pane)) {
4603
+ this.logger.info("Deferring auto-pause: background work is still running");
4604
+ this.pauseRequested = false;
4605
+ return;
4606
+ }
4607
+ }
4567
4608
  this.pauseWakeState = "pausing";
4568
4609
  this.healthCheckPaused = true;
4569
4610
  this.freezeRuntimeMonitors();