@songsid/agend 2.4.0-beta.4 → 2.4.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 (115) hide show
  1. package/dist/auth-api.js +2 -0
  2. package/dist/auth-api.js.map +1 -1
  3. package/dist/backend/cli-runtime-switch.d.ts +21 -2
  4. package/dist/backend/cli-runtime-switch.js +124 -2
  5. package/dist/backend/cli-runtime-switch.js.map +1 -1
  6. package/dist/backend/codex-footer-hints.d.ts +1 -0
  7. package/dist/backend/codex-footer-hints.js +15 -0
  8. package/dist/backend/codex-footer-hints.js.map +1 -1
  9. package/dist/backend/codex.d.ts +6 -4
  10. package/dist/backend/codex.js +26 -9
  11. package/dist/backend/codex.js.map +1 -1
  12. package/dist/backend/kiro.js +3 -3
  13. package/dist/backend/kiro.js.map +1 -1
  14. package/dist/backend/native-pane.js +1 -1
  15. package/dist/backend/native-pane.js.map +1 -1
  16. package/dist/backend/types.d.ts +2 -0
  17. package/dist/backend/types.js.map +1 -1
  18. package/dist/build-provenance.json +1 -1
  19. package/dist/daemon.d.ts +3 -0
  20. package/dist/daemon.js +28 -9
  21. package/dist/daemon.js.map +1 -1
  22. package/dist/fleet-manager.d.ts +5 -0
  23. package/dist/fleet-manager.js +15 -3
  24. package/dist/fleet-manager.js.map +1 -1
  25. package/dist/general-knowledge/skills/hub/SKILL.md +27 -18
  26. package/dist/hub/compose/server.js +4 -3
  27. package/dist/hub/compose/server.js.map +1 -1
  28. package/dist/hub/group-policy/admin-api.js +9 -0
  29. package/dist/hub/group-policy/admin-api.js.map +1 -1
  30. package/dist/hub/group-policy/admin-control.d.ts +1 -0
  31. package/dist/hub/group-policy/admin-control.js +13 -4
  32. package/dist/hub/group-policy/admin-control.js.map +1 -1
  33. package/dist/hub/group-policy/admin-dto.d.ts +37 -0
  34. package/dist/hub/group-policy/admin-dto.js.map +1 -1
  35. package/dist/hub/group-policy/admin-facts.d.ts +4 -2
  36. package/dist/hub/group-policy/admin-facts.js +17 -2
  37. package/dist/hub/group-policy/admin-facts.js.map +1 -1
  38. package/dist/hub/group-policy/admin-impact.d.ts +4 -3
  39. package/dist/hub/group-policy/admin-impact.js +8 -6
  40. package/dist/hub/group-policy/admin-impact.js.map +1 -1
  41. package/dist/hub/group-policy/admin-search.d.ts +2 -1
  42. package/dist/hub/group-policy/admin-search.js +56 -7
  43. package/dist/hub/group-policy/admin-search.js.map +1 -1
  44. package/dist/hub/group-policy/impact-inventory.d.ts +4 -1
  45. package/dist/hub/group-policy/impact-inventory.js +23 -2
  46. package/dist/hub/group-policy/impact-inventory.js.map +1 -1
  47. package/dist/hub/group-policy/model.d.ts +29 -1
  48. package/dist/hub/group-policy/model.js +20 -7
  49. package/dist/hub/group-policy/model.js.map +1 -1
  50. package/dist/hub/group-policy/store.js +22 -3
  51. package/dist/hub/group-policy/store.js.map +1 -1
  52. package/dist/hub/group-policy/team-subjects.d.ts +16 -0
  53. package/dist/hub/group-policy/team-subjects.js +32 -0
  54. package/dist/hub/group-policy/team-subjects.js.map +1 -0
  55. package/dist/hub/http/compose.js +15 -1
  56. package/dist/hub/http/compose.js.map +1 -1
  57. package/dist/hub/join/client.js +75 -42
  58. package/dist/hub/join/client.js.map +1 -1
  59. package/dist/hub/runtime.js +4 -3
  60. package/dist/hub/runtime.js.map +1 -1
  61. package/dist/hub/socket.d.ts +1 -0
  62. package/dist/hub/socket.js +39 -2
  63. package/dist/hub/socket.js.map +1 -1
  64. package/dist/hub/teams/index.d.ts +8 -3
  65. package/dist/hub/teams/index.js +106 -31
  66. package/dist/hub/teams/index.js.map +1 -1
  67. package/dist/hub/teams/store.d.ts +5 -1
  68. package/dist/hub/teams/store.js +25 -2
  69. package/dist/hub/teams/store.js.map +1 -1
  70. package/dist/hub/teams/types.d.ts +19 -2
  71. package/dist/native-mcp.js +1 -2
  72. package/dist/native-mcp.js.map +1 -1
  73. package/dist/native-pane-lifecycle.js +3 -2
  74. package/dist/native-pane-lifecycle.js.map +1 -1
  75. package/dist/office-share-page.js +1 -1
  76. package/dist/office-share-page.js.map +1 -1
  77. package/dist/runtime-pane-native.js +3 -1
  78. package/dist/runtime-pane-native.js.map +1 -1
  79. package/dist/ui/chat-store.js +2 -1
  80. package/dist/ui/fleet-canvas.js +5 -1
  81. package/dist/ui/fleet-office-carousel.d.ts +14 -0
  82. package/dist/ui/fleet-office-carousel.js +95 -0
  83. package/dist/ui/fleet-office-store.js +14 -2
  84. package/dist/ui/fleet-office.js +125 -13
  85. package/dist/ui/hub-admin-rooms.js +1 -1
  86. package/dist/ui/hub-chat-strings.js +7 -0
  87. package/dist/ui/hub-client.js +3 -0
  88. package/dist/ui/hub-grant-picker.js +3 -37
  89. package/dist/ui/hub-group-policy.js +22 -10
  90. package/dist/ui/hub-group-strings.js +26 -17
  91. package/dist/ui/hub-join-steps.js +27 -15
  92. package/dist/ui/hub-policy-subjects.js +35 -0
  93. package/dist/ui/hub-subject-picker.js +58 -0
  94. package/dist/ui/hub-teams-strings.js +10 -6
  95. package/dist/ui/hub-teams.js +56 -28
  96. package/dist/ui/hub-welcome.js +122 -75
  97. package/dist/ui/panel-chat.js +179 -11
  98. package/dist/ui/panel-details.js +3 -1
  99. package/dist/ui/panel-fleet.js +25 -3
  100. package/dist/ui/panel-hub.js +101 -57
  101. package/dist/ui/panel-log.js +3 -1
  102. package/dist/ui/shared/agent-sheet.js +115 -0
  103. package/dist/ui/shared/app-shell.js +56 -17
  104. package/dist/ui/shared/app.css +61 -1
  105. package/dist/ui/shared/chat-composer.js +23 -2
  106. package/dist/ui/shared/chat-strings.js +4 -2
  107. package/dist/ui/shared/chat-work-bar.css +63 -1
  108. package/dist/ui/shared/hub-chat.css +33 -0
  109. package/dist/ui/shared/hub-groups.css +18 -14
  110. package/dist/ui/shared/hub-owner.css +11 -0
  111. package/dist/ui/shared/hub-rooms-u2.css +4 -0
  112. package/dist/ui/shared/model-picker.css +27 -0
  113. package/dist/ui/shared/panel-view.js +7 -1
  114. package/dist/ui/shared/ui-toast.js +1 -1
  115. package/package.json +1 -1
package/dist/daemon.js CHANGED
@@ -5333,7 +5333,7 @@ export class Daemon extends EventEmitter {
5333
5333
  if (!cliSwitchAllowed(entry, step, version))
5334
5334
  return { blocked: "version", version };
5335
5335
  const pane = await tmux.capturePaneWithHistory(CODEX_SWITCH_HISTORY_LINES).catch(() => "");
5336
- const record = entry.checkpoint ? await entry.checkpoint(pane, this.config.working_directory || process.cwd()).catch(() => undefined) : undefined;
5336
+ const record = entry.checkpoint ? await entry.checkpoint(pane, this.config.working_directory || process.cwd(), pid).catch(() => undefined) : undefined;
5337
5337
  return { pane, ...(record !== undefined ? { record } : {}) };
5338
5338
  }
5339
5339
  /** M-3180: the entry's verdict on the scrollback after the step, against the one before it; nothing in time is not confirmed. */
@@ -6299,7 +6299,7 @@ export class Daemon extends EventEmitter {
6299
6299
  this.pauseRequested = false;
6300
6300
  return false;
6301
6301
  }
6302
- if (!ready() || admission && !admission.accepts(text) || this.backend?.backgroundWorkRunning?.(text)
6302
+ if (!ready() || admission && !admission.accepts(text) || this.backend?.isDraftIdlePane?.(text) === true || this.backend?.backgroundWorkRunning?.(text)
6303
6303
  || !allowStuck && !this.paneAuthoritativelyIdle(text)) {
6304
6304
  this.pauseRequested = false;
6305
6305
  return false;
@@ -7639,7 +7639,7 @@ export class Daemon extends EventEmitter {
7639
7639
  // work cannot hide behind this: it changes the layout, the next
7640
7640
  // output arms another probe, and the debounce capture still fires.
7641
7641
  // #1641: never while the transcript shows a turn running — that idle-looking screen is mid-turn.
7642
- if (this.instanceState === "idle" && this.backend?.isPeriodicRedrawIdlePane?.(pane) === true
7642
+ if (this.instanceState === "idle" && this.executionIdleProof()?.(pane) === true
7643
7643
  && this.transcriptTurnState() !== "open")
7644
7644
  return;
7645
7645
  // A second burst overtook the probe. Do not bless its stale capture as
@@ -7676,7 +7676,7 @@ export class Daemon extends EventEmitter {
7676
7676
  // observe twice, which silently disabled the "content moved" branch.
7677
7677
  if (this.backend?.periodicRedrawFrom)
7678
7678
  this.periodicRedrawLayout = this.backend.periodicRedrawFrom(pane);
7679
- const structuredPeriodicIdle = this.periodicIdleProof();
7679
+ const structuredPeriodicIdle = this.executionIdleProof();
7680
7680
  // #1641: the transcript outranks the pane: while it shows the turn running, no reading of this pane is idle (codex
7681
7681
  // hides its status row while streaming, leaving the idle composer and footer in view mid-turn).
7682
7682
  const transcriptTurn = this.transcriptTurnState();
@@ -7906,6 +7906,13 @@ export class Daemon extends EventEmitter {
7906
7906
  return undefined;
7907
7907
  return proof;
7908
7908
  }
7909
+ /** Draft text can be execution-idle, but must not become empty-composer proof for delivery, pause or nudges. */
7910
+ executionIdleProof() {
7911
+ const empty = this.periodicIdleProof(), draft = this.backend?.isDraftIdlePane;
7912
+ if (!empty && !draft)
7913
+ return undefined;
7914
+ return pane => empty?.call(this.backend, pane) === true || draft?.call(this.backend, pane) === true;
7915
+ }
7909
7916
  bindInstanceStateOutputListener(windowId) {
7910
7917
  if (!this.controlClient || !this.instanceStateMonitorActive)
7911
7918
  return;
@@ -10616,8 +10623,12 @@ export class Daemon extends EventEmitter {
10616
10623
  return "busy";
10617
10624
  if (!this.deliveryInputReadyPane(pane))
10618
10625
  return "busy";
10619
- if (strandedAgendMessageInInput(pane, prompt))
10626
+ if (strandedAgendMessageInInput(pane, prompt)) {
10627
+ // A cancelled human turn can restore its text here. Idle observation must not let a later delivery submit it.
10628
+ if (this.backend?.binaryName === "codex" && /\[user:/.test(inputAreaText(pane, prompt) ?? ""))
10629
+ return "busy";
10620
10630
  return "stranded";
10631
+ }
10621
10632
  // Kiro uses the bottom row; Codex's positive prompt/footer check above
10622
10633
  // rules out a historical transcript echo or a transition/modal screen.
10623
10634
  return !requireBottomReady || bottomRowIsReady(pane, prompt) ? "clear" : "busy";
@@ -11174,6 +11185,8 @@ export class Daemon extends EventEmitter {
11174
11185
  catch {
11175
11186
  return hold("check_failed");
11176
11187
  }
11188
+ if (this.codexInputOccupied(screen))
11189
+ return hold("input_occupied");
11177
11190
  if (!current())
11178
11191
  return false;
11179
11192
  if (performance.now() >= deadline)
@@ -11273,6 +11286,8 @@ export class Daemon extends EventEmitter {
11273
11286
  verdict.fenced = !verdict.durableBeginCommitted;
11274
11287
  return false;
11275
11288
  }
11289
+ if (pasteBaseline?.unsubmittedAgendInput)
11290
+ return this.failDelivery(verdict, status, "input-residue", "occupied-codex-composer");
11276
11291
  // M-2267: the pane went into a tmux mode after the readiness wait. Nothing begun or written: the caller waits for
11277
11292
  // readiness (which holds while it lasts) and tries again — as for a dialog that appeared before the write.
11278
11293
  if (!verdict.durableBeginCommitted && await this.paneInTmuxMode("paste"))
@@ -12352,6 +12367,11 @@ export class Daemon extends EventEmitter {
12352
12367
  * paste and once after, so confirmSubmitted can require a NEW marker or a NEW
12353
12368
  * echo rather than accepting whatever was already there.
12354
12369
  */
12370
+ codexInputOccupied(pane) {
12371
+ const backend = this.backend, prompt = backend?.getBottomReadyPattern?.();
12372
+ return backend?.binaryName === "codex" && backend.ownsComposerRows?.(pane) === true && !!prompt
12373
+ && strandedAgendMessageInInput(pane, prompt);
12374
+ }
12355
12375
  async capturePaneEvidence(signature) {
12356
12376
  if (!this.tmux)
12357
12377
  return null;
@@ -12362,6 +12382,8 @@ export class Daemon extends EventEmitter {
12362
12382
  try {
12363
12383
  const pane = await this.tmux.capturePane();
12364
12384
  const evidence = this.paneEvidence(pane, signature);
12385
+ if (this.codexInputOccupied(pane))
12386
+ evidence.unsubmittedAgendInput = true;
12365
12387
  if (owner === this.tmux && window === owner.getWindowId?.() && spawn === this.spawnGeneration && fence === this.launchFenceEpoch && launch === this.launchAttempt) {
12366
12388
  const counts = this.paneQuotaPatterns().map(ep => ({ key: Daemon.errorPatternKey(ep), count: Daemon.countOccurrences(ep.pattern, pane) }));
12367
12389
  if (counts.length)
@@ -12369,10 +12391,7 @@ export class Daemon extends EventEmitter {
12369
12391
  }
12370
12392
  const input = this.inputRegion(pane);
12371
12393
  if (input && agendMessageInInput(input.text)) {
12372
- // Whatever we paste now lands after it, and one Enter submits both as
12373
- // a single message. Nothing here can undo that; saying so beats
12374
- // letting two messages silently merge.
12375
- this.logger.warn("An unsubmitted message is already in the input row — this delivery will be appended to it");
12394
+ this.logger.warn("An unsubmitted message is already in the input row");
12376
12395
  }
12377
12396
  return evidence;
12378
12397
  }