@songsid/agend 2.4.0-beta.17 → 2.4.0-beta.18

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 (112) hide show
  1. package/dist/backend/claude-code.js +6 -2
  2. package/dist/backend/claude-code.js.map +1 -1
  3. package/dist/backend/claude-transcript-errors.d.ts +4 -0
  4. package/dist/backend/claude-transcript-errors.js +5 -1
  5. package/dist/backend/claude-transcript-errors.js.map +1 -1
  6. package/dist/build-provenance.json +1 -1
  7. package/dist/cli-audited.js +6 -5
  8. package/dist/cli-audited.js.map +1 -1
  9. package/dist/daemon.d.ts +8 -0
  10. package/dist/daemon.js +62 -13
  11. package/dist/daemon.js.map +1 -1
  12. package/dist/fleet-context.d.ts +1 -0
  13. package/dist/fleet-manager.d.ts +15 -1
  14. package/dist/fleet-manager.js +96 -9
  15. package/dist/fleet-manager.js.map +1 -1
  16. package/dist/fleet-windows-runtime.d.ts +1 -1
  17. package/dist/fleet-windows-runtime.js +1 -1
  18. package/dist/fleet-windows-runtime.js.map +1 -1
  19. package/dist/fleet-yaml-stringify.d.ts +3 -0
  20. package/dist/fleet-yaml-stringify.js +79 -0
  21. package/dist/fleet-yaml-stringify.js.map +1 -0
  22. package/dist/general-knowledge/skills/web-dashboard/SKILL.md +10 -2
  23. package/dist/host-monitoring-alert-policy.d.ts +71 -0
  24. package/dist/host-monitoring-alert-policy.js +150 -0
  25. package/dist/host-monitoring-alert-policy.js.map +1 -0
  26. package/dist/host-monitoring-alert-resources.d.ts +11 -0
  27. package/dist/host-monitoring-alert-resources.js +16 -0
  28. package/dist/host-monitoring-alert-resources.js.map +1 -0
  29. package/dist/host-monitoring-alert-settings.d.ts +14 -0
  30. package/dist/host-monitoring-alert-settings.js +63 -0
  31. package/dist/host-monitoring-alert-settings.js.map +1 -0
  32. package/dist/host-monitoring-alert-store.d.ts +49 -0
  33. package/dist/host-monitoring-alert-store.js +228 -0
  34. package/dist/host-monitoring-alert-store.js.map +1 -0
  35. package/dist/host-monitoring-alert-text.d.ts +7 -0
  36. package/dist/host-monitoring-alert-text.js +10 -0
  37. package/dist/host-monitoring-alert-text.js.map +1 -0
  38. package/dist/host-monitoring-alerts.d.ts +76 -0
  39. package/dist/host-monitoring-alerts.js +261 -0
  40. package/dist/host-monitoring-alerts.js.map +1 -0
  41. package/dist/host-monitoring-footprint-policy.d.ts +45 -0
  42. package/dist/host-monitoring-footprint-policy.js +150 -0
  43. package/dist/host-monitoring-footprint-policy.js.map +1 -0
  44. package/dist/host-monitoring-footprint.d.ts +42 -0
  45. package/dist/host-monitoring-footprint.js +169 -0
  46. package/dist/host-monitoring-footprint.js.map +1 -0
  47. package/dist/host-monitoring-history-policy.d.ts +2 -0
  48. package/dist/host-monitoring-history-policy.js +16 -2
  49. package/dist/host-monitoring-history-policy.js.map +1 -1
  50. package/dist/host-monitoring-history-store.js +8 -6
  51. package/dist/host-monitoring-history-store.js.map +1 -1
  52. package/dist/host-monitoring-history-worker.js +19 -3
  53. package/dist/host-monitoring-history-worker.js.map +1 -1
  54. package/dist/host-monitoring-history.d.ts +9 -0
  55. package/dist/host-monitoring-history.js +45 -9
  56. package/dist/host-monitoring-history.js.map +1 -1
  57. package/dist/host-monitoring-process-identity.d.ts +8 -0
  58. package/dist/host-monitoring-process-identity.js +81 -0
  59. package/dist/host-monitoring-process-identity.js.map +1 -0
  60. package/dist/host-monitoring-runtime.d.ts +8 -0
  61. package/dist/host-monitoring-runtime.js +18 -3
  62. package/dist/host-monitoring-runtime.js.map +1 -1
  63. package/dist/host-monitoring.d.ts +2 -0
  64. package/dist/host-monitoring.js.map +1 -1
  65. package/dist/instance-lifecycle.js +2 -2
  66. package/dist/instance-lifecycle.js.map +1 -1
  67. package/dist/needs-you-hub.d.ts +1 -0
  68. package/dist/needs-you-hub.js +1 -0
  69. package/dist/needs-you-hub.js.map +1 -1
  70. package/dist/needs-you.d.ts +3 -2
  71. package/dist/needs-you.js +1 -0
  72. package/dist/needs-you.js.map +1 -1
  73. package/dist/public-web-gateway.js +7 -1
  74. package/dist/public-web-gateway.js.map +1 -1
  75. package/dist/runtime-cli-install.js +9 -9
  76. package/dist/runtime-cli-install.js.map +1 -1
  77. package/dist/settings-api.d.ts +2 -0
  78. package/dist/settings-api.js +56 -0
  79. package/dist/settings-api.js.map +1 -1
  80. package/dist/settings-baseline.js +5 -4
  81. package/dist/settings-baseline.js.map +1 -1
  82. package/dist/settings-effect.d.ts +2 -0
  83. package/dist/settings-effect.js +20 -1
  84. package/dist/settings-effect.js.map +1 -1
  85. package/dist/topic-commands.js +4 -0
  86. package/dist/topic-commands.js.map +1 -1
  87. package/dist/ui/chat-store.js +21 -4
  88. package/dist/ui/host-alerts.js +23 -0
  89. package/dist/ui/host-footprint.js +17 -0
  90. package/dist/ui/host-health.js +17 -12
  91. package/dist/ui/host-time.js +5 -0
  92. package/dist/ui/panel-chat.js +2 -0
  93. package/dist/ui/panel-needs.js +27 -16
  94. package/dist/ui/panel-settings.js +1 -0
  95. package/dist/ui/settings-host-alerts.js +22 -0
  96. package/dist/ui/settings-host-monitoring.js +8 -7
  97. package/dist/ui/shared/app-i18n.js +2 -2
  98. package/dist/ui/shared/app.css +50 -9
  99. package/dist/ui/shared/chat-render.js +24 -9
  100. package/dist/ui/shared/chat-strings.js +2 -2
  101. package/dist/ui/shared/chat-thread.js +3 -1
  102. package/dist/web-api.d.ts +2 -1
  103. package/dist/web-api.js +197 -6
  104. package/dist/web-api.js.map +1 -1
  105. package/dist/web-chat-history.d.ts +40 -1
  106. package/dist/web-chat-history.js +131 -9
  107. package/dist/web-chat-history.js.map +1 -1
  108. package/dist/web-guest-access.js +4 -4
  109. package/dist/web-guest-access.js.map +1 -1
  110. package/dist/web-upload.d.ts +1 -1
  111. package/dist/web-upload.js.map +1 -1
  112. package/package.json +1 -1
package/dist/daemon.js CHANGED
@@ -679,7 +679,7 @@ const INPUT_TRANSIENT_STALL_MS = 30_000;
679
679
  */
680
680
  const INPUT_TRANSIENT_WAIT_MS = 10 * 60_000;
681
681
  const INPUT_TRANSIENT_POLL_MS = 250;
682
- /** Max "stranded text → submit → wait for prompt → re-check" rounds per delivery; each may send one recovery Enter. */
682
+ /** Max actual stranded-text recovery Enters per delivery; a busy observation spends none. */
683
683
  const STRANDED_INPUT_MAX_ROUNDS = 3;
684
684
  /** The Claude phrasing every backend was judged by before #1217; still the default for a backend that names none. */
685
685
  const LEGACY_NO_CONVERSATION = /no conversation found|no conversation to (continue|resume)|no previous (session|conversation)/i;
@@ -3965,9 +3965,12 @@ export class Daemon extends EventEmitter {
3965
3965
  return;
3966
3966
  }
3967
3967
  const native = this.nativePaneLifecycle, pane = this.tmux;
3968
+ const footprintObservedAt = this.footprintEnabled ? Date.now() : 0, footprintOwner = this.footprintEnabled ? JSON.stringify(this.interactionOwner()) : null;
3968
3969
  const status = await pane?.getPaneStatus();
3969
3970
  if (this.runtimeMonitorsFrozen || native !== this.nativePaneLifecycle || pane !== this.tmux)
3970
3971
  return;
3972
+ if (this.footprintEnabled && status?.alive && status.pid && footprintOwner === JSON.stringify(this.interactionOwner()))
3973
+ this.footprintPane = { pid: status.pid, owner: footprintOwner, observedAt: footprintObservedAt, pane };
3971
3974
  const snapshot = native.snapshot?.();
3972
3975
  if (status?.alive === false && snapshot?.state === "exited") {
3973
3976
  this.healthCheckPaused = true;
@@ -4008,12 +4011,15 @@ export class Daemon extends EventEmitter {
4008
4011
  scheduleNext();
4009
4012
  return true;
4010
4013
  };
4014
+ const footprintObservedAt = this.footprintEnabled ? Date.now() : 0;
4011
4015
  let paneStatus = await healthTmux.getPaneStatus();
4012
4016
  // Auto-pause intentionally exits the pane process. A health tick that
4013
4017
  // began just before pause must not classify that exit as a crash.
4014
4018
  if (discardStaleHealth())
4015
4019
  return;
4016
4020
  if (paneStatus?.alive) {
4021
+ if (this.footprintEnabled && footprintObservedAt > 0 && paneStatus.pid)
4022
+ this.footprintPane = { pid: paneStatus.pid, owner: JSON.stringify(healthOwner), observedAt: footprintObservedAt, pane: healthTmux };
4017
4023
  // A CLI shutdown also closes its MCP children. Revive tools only for
4018
4024
  // a positively live pane, never while its exit is being classified.
4019
4025
  measureSyncWork("daemon.healthCheck", () => this.checkMcpServerAlive());
@@ -6051,6 +6057,16 @@ export class Daemon extends EventEmitter {
6051
6057
  }
6052
6058
  return { ...snapshot, interaction: this.getInteractionSnapshot() };
6053
6059
  }
6060
+ footprintEnabled = false;
6061
+ footprintPane = null;
6062
+ setHostFootprintEnabled(enabled) { this.footprintEnabled = enabled; if (!enabled)
6063
+ this.footprintPane = null; }
6064
+ hostFootprintRoot() {
6065
+ const cached = this.footprintPane;
6066
+ if (!this.footprintEnabled || !cached || cached.pane !== this.tmux || cached.owner !== JSON.stringify(this.interactionOwner()) || this.isPaused || this.spawning || this.healthCheckPaused || this.runtimeMonitorsFrozen || Date.now() - cached.observedAt > 120000)
6067
+ return null;
6068
+ return { pid: cached.pid, owner: cached.owner, observedAt: cached.observedAt };
6069
+ }
6054
6070
  interactionOwner() {
6055
6071
  return { bootId: this.bootId, spawnGeneration: this.spawnGeneration,
6056
6072
  launchAttempt: this.launchAttempt, launchFenceEpoch: this.launchFenceEpoch };
@@ -8719,7 +8735,7 @@ export class Daemon extends EventEmitter {
8719
8735
  // terminal state is announced by the outbox only after its retry/TTL policy
8720
8736
  // is exhausted; emitting ❌ here would expose a transient gate timeout.
8721
8737
  if (status && !verdict.durableAttempt)
8722
- this.emit("message_failed", status); // ❌
8738
+ this.emit("message_failed", { ...status, phase, proof }); // ❌
8723
8739
  return false;
8724
8740
  }
8725
8741
  /** Tell the fleet when an already-accepted cross-instance pane write failed. */
@@ -9222,29 +9238,50 @@ export class Daemon extends EventEmitter {
9222
9238
  // must come back AND the check runs again — the stranded text may still
9223
9239
  // be there. "failed" (the Enter could not be sent) fails the delivery:
9224
9240
  // pasting now would submit both messages as one.
9225
- for (let round = 0;; round++) {
9226
- // Budget check BEFORE the next mutating call: each round may send one
9227
- // recovery Enter, so exactly STRANDED_INPUT_MAX_ROUNDS of them go out.
9228
- if (round >= STRANDED_INPUT_MAX_ROUNDS) {
9229
- this.logger.error({ round }, "Input row still not clear after the stranded-text recovery budget — reporting delivery failure");
9230
- return this.failDelivery(verdict, status, "stranded-input", "retry-budget-exhausted");
9241
+ const inputDeadline = Date.now() + 30 * 60_000;
9242
+ let submissions = 0;
9243
+ let unavailableProbes = 0;
9244
+ for (;;) {
9245
+ if (cancelled())
9246
+ return false;
9247
+ if (Date.now() >= inputDeadline) {
9248
+ this.logger.error("Input row stayed unavailable until the delivery deadline");
9249
+ return this.failDelivery(verdict, status, "stranded-input", "input-not-clear-timeout");
9231
9250
  }
9232
- const stranded = await this.submitStrandedInputIfAny(windowId);
9251
+ // Only actual recovery Enters spend the submission budget. A live pane's
9252
+ // unreadable/changing composer may need time, not three synchronous probes.
9253
+ const stranded = await this.submitStrandedInputIfAny(windowId, submissions < STRANDED_INPUT_MAX_ROUNDS);
9233
9254
  if (cancelled())
9234
9255
  return false;
9235
9256
  if (stranded === "idle")
9236
9257
  break;
9258
+ if (stranded === "exhausted") {
9259
+ this.logger.error({ submissions }, "Input row still not clear after the stranded-text recovery budget — reporting delivery failure");
9260
+ return this.failDelivery(verdict, status, "stranded-input", "retry-budget-exhausted");
9261
+ }
9237
9262
  if (stranded === "failed") {
9238
- this.logger.error({ round }, "Could not submit the stranded text — reporting delivery failure");
9263
+ this.logger.error({ submissions }, "Could not submit the stranded text — reporting delivery failure");
9239
9264
  return this.failDelivery(verdict, status, "stranded-input", "enter-failed");
9240
9265
  }
9241
- const readyAgain = await this.waitForPaneReadyForDelivery(windowId);
9266
+ if (stranded === "submitted")
9267
+ submissions++;
9268
+ // Only the proven empty unknown-footer candidate needs the timed
9269
+ // fallback. Preserve the existing bounded refusal for other unsafe
9270
+ // input (including a stranded draft whose footer cannot be proved).
9271
+ if (stranded === "busy" && this.footerFallbackPaneKey === null && ++unavailableProbes >= STRANDED_INPUT_MAX_ROUNDS) {
9272
+ return this.failDelivery(verdict, status, "stranded-input", "input-not-clear");
9273
+ }
9274
+ const readyAgain = await this.waitForPaneReadyForDelivery(windowId, inputDeadline - Date.now());
9242
9275
  if (cancelled())
9243
9276
  return false;
9244
9277
  if (!readyAgain) {
9245
- this.logger.error("Pane never returned to its prompt after submitting stranded input — reporting delivery failure");
9278
+ this.logger.error("Pane never returned to its prompt after checking stranded input — reporting delivery failure");
9246
9279
  return this.failDelivery(verdict, status, "stranded-input", "prompt-timeout");
9247
9280
  }
9281
+ // After startup, the general idle gate can pass while the stricter input
9282
+ // proof is still collecting a stable composer. Yield before re-reading it.
9283
+ if (stranded === "busy")
9284
+ await new Promise(resolve => setTimeout(resolve, BOTTOM_READY_POLL_MS));
9248
9285
  }
9249
9286
  }
9250
9287
  // Everything above is *waiting*; everything below owns the write lock.
@@ -10809,7 +10846,7 @@ export class Daemon extends EventEmitter {
10809
10846
  this.logger.error({ rows: rows.length }, "The input box did not empty — not writing this delivery onto it");
10810
10847
  return "not-cleared";
10811
10848
  }
10812
- async submitStrandedInputIfAny(windowId) {
10849
+ async submitStrandedInputIfAny(windowId, allowSubmit = true) {
10813
10850
  if (!this.tmux || !this.backend)
10814
10851
  return "idle";
10815
10852
  const prompt = this.backend.getBottomReadyPattern?.();
@@ -10840,6 +10877,8 @@ export class Daemon extends EventEmitter {
10840
10877
  return "idle";
10841
10878
  if (state !== "stranded")
10842
10879
  return "busy"; // busy, or unreadable: no evidence the prompt is free
10880
+ if (!allowSubmit)
10881
+ return "exhausted"; // a final clear check is allowed, a fourth recovery Enter is not
10843
10882
  const sent = await this.sendDeliveryEnter("stranded-input-submit");
10844
10883
  return sent ? "submitted" : "failed";
10845
10884
  });
@@ -10862,6 +10901,16 @@ export class Daemon extends EventEmitter {
10862
10901
  return "busy";
10863
10902
  if (this.backend?.getBusyPattern?.()?.test(pane))
10864
10903
  return "busy";
10904
+ // The timed footer fallback is valid only in a live raw TUI, even
10905
+ // after the startup guard has retired. Historical shell scrollback is not
10906
+ // evidence that a composer still owns the terminal.
10907
+ const known = this.backend?.isDeliveryInputReadyPane?.(pane);
10908
+ if (known === false && this.backend?.isStableUnknownLayoutIdlePane?.(pane)) {
10909
+ if (this.nativePaneLifecycle || await this.tmux?.getPaneInputMode?.() !== "raw") {
10910
+ this.resetFooterFallback();
10911
+ return "busy";
10912
+ }
10913
+ }
10865
10914
  if (!this.deliveryInputReadyPane(pane))
10866
10915
  return "busy";
10867
10916
  if (strandedAgendMessageInInput(pane, prompt)) {