@aragon-agent/cli 0.6.4 → 0.6.8

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 (119) hide show
  1. package/CHANGELOG.md +37 -0
  2. package/README.md +163 -37
  3. package/dist/agent/controller.d.ts +49 -8
  4. package/dist/agent/controller.js +160 -48
  5. package/dist/agent/headless.d.ts +2 -1
  6. package/dist/agent/prompt-options.d.ts +15 -0
  7. package/dist/agent/prompt-options.js +1 -0
  8. package/dist/agent/reducer.d.ts +33 -19
  9. package/dist/agent/reducer.js +62 -71
  10. package/dist/agent/usage.d.ts +34 -0
  11. package/dist/agent/usage.js +43 -0
  12. package/dist/cli.js +131 -54
  13. package/dist/commands/builtins.js +12 -1
  14. package/dist/commands/registry.d.ts +2 -3
  15. package/dist/compaction/compactor.d.ts +60 -24
  16. package/dist/compaction/compactor.js +89 -61
  17. package/dist/compaction/context-command.d.ts +33 -0
  18. package/dist/compaction/context-command.js +166 -0
  19. package/dist/compaction/meter.d.ts +251 -0
  20. package/dist/compaction/meter.js +428 -0
  21. package/dist/compaction/pressure.d.ts +6 -0
  22. package/dist/compaction/pressure.js +4 -0
  23. package/dist/compaction/types.d.ts +41 -0
  24. package/dist/compaction/wiring.d.ts +47 -0
  25. package/dist/compaction/wiring.js +88 -27
  26. package/dist/config/cli-commands.js +5 -0
  27. package/dist/config/env.js +15 -1
  28. package/dist/config/load.d.ts +17 -0
  29. package/dist/config/load.js +45 -1
  30. package/dist/config/schema.d.ts +44 -0
  31. package/dist/config/schema.js +36 -0
  32. package/dist/config/store.js +27 -1
  33. package/dist/exec/events.d.ts +138 -1
  34. package/dist/exec/events.js +42 -0
  35. package/dist/exec/index.js +43 -6
  36. package/dist/exec/progress-reporter.d.ts +23 -0
  37. package/dist/exec/progress-reporter.js +88 -0
  38. package/dist/exec/runner.d.ts +34 -0
  39. package/dist/exec/runner.js +137 -25
  40. package/dist/fast/reviewer.d.ts +19 -1
  41. package/dist/fast/reviewer.js +22 -0
  42. package/dist/fast/types.d.ts +15 -0
  43. package/dist/fast/wiring.d.ts +10 -1
  44. package/dist/fast/wiring.js +18 -1
  45. package/dist/input/interrupt-gesture.d.ts +18 -0
  46. package/dist/input/interrupt-gesture.js +19 -0
  47. package/dist/input/pointer-router.d.ts +11 -0
  48. package/dist/input/pointer-router.js +14 -0
  49. package/dist/todo/limits.d.ts +4 -17
  50. package/dist/todo/limits.js +4 -17
  51. package/dist/todo/panel-rows.d.ts +8 -6
  52. package/dist/todo/panel-rows.js +19 -6
  53. package/dist/todo/store.d.ts +8 -13
  54. package/dist/todo/store.js +13 -14
  55. package/dist/todo/types.d.ts +2 -1
  56. package/dist/ui/App.d.ts +2 -0
  57. package/dist/ui/App.js +233 -183
  58. package/dist/ui/AutocompletePopup.d.ts +3 -1
  59. package/dist/ui/AutocompletePopup.js +9 -11
  60. package/dist/ui/BottomStatusRow.d.ts +1 -1
  61. package/dist/ui/Composer.d.ts +13 -5
  62. package/dist/ui/Composer.js +7 -11
  63. package/dist/ui/PromptCaret.d.ts +11 -0
  64. package/dist/ui/PromptCaret.js +31 -0
  65. package/dist/ui/PromptInput.d.ts +12 -6
  66. package/dist/ui/PromptInput.js +50 -16
  67. package/dist/ui/StatusBar.d.ts +22 -15
  68. package/dist/ui/StatusBar.js +61 -16
  69. package/dist/ui/TeamPanel.d.ts +3 -1
  70. package/dist/ui/TeamPanel.js +13 -9
  71. package/dist/ui/TodoPanel.d.ts +5 -5
  72. package/dist/ui/TodoPanel.js +56 -24
  73. package/dist/ui/Transcript.js +1 -0
  74. package/dist/ui/UpdateLine.d.ts +1 -1
  75. package/dist/ui/capabilities.js +5 -5
  76. package/dist/ui/composer-rows.js +50 -9
  77. package/dist/ui/exit-snapshot.d.ts +9 -0
  78. package/dist/ui/frame-differ.js +2 -19
  79. package/dist/ui/frame-observer.d.ts +17 -0
  80. package/dist/ui/frame-observer.js +81 -0
  81. package/dist/ui/frame-parser.d.ts +7 -0
  82. package/dist/ui/frame-parser.js +18 -0
  83. package/dist/ui/layout/AppShell.d.ts +7 -52
  84. package/dist/ui/layout/AppShell.js +2 -2
  85. package/dist/ui/layout/ScrollIndicator.d.ts +4 -3
  86. package/dist/ui/layout/ScrollIndicator.js +4 -4
  87. package/dist/ui/layout/ScrollViewport.d.ts +13 -66
  88. package/dist/ui/layout/ScrollViewport.js +183 -185
  89. package/dist/ui/layout/autocomplete.d.ts +18 -0
  90. package/dist/ui/layout/autocomplete.js +26 -0
  91. package/dist/ui/layout/budget.d.ts +3 -51
  92. package/dist/ui/layout/budget.js +4 -53
  93. package/dist/ui/layout/document-layout.d.ts +13 -0
  94. package/dist/ui/layout/document-layout.js +11 -0
  95. package/dist/ui/layout/follow-state.d.ts +1 -0
  96. package/dist/ui/layout/follow-state.js +1 -3
  97. package/dist/ui/layout/rail.d.ts +4 -53
  98. package/dist/ui/layout/rail.js +10 -62
  99. package/dist/ui/layout/scroll-indicator.d.ts +1 -1
  100. package/dist/ui/layout/scroll-indicator.js +3 -2
  101. package/dist/ui/layout/scrollbar-geometry.d.ts +17 -0
  102. package/dist/ui/layout/scrollbar-geometry.js +13 -0
  103. package/dist/ui/layout/team-panel.d.ts +18 -0
  104. package/dist/ui/layout/team-panel.js +22 -0
  105. package/dist/ui/layout/todo-layout.d.ts +25 -0
  106. package/dist/ui/layout/todo-layout.js +28 -0
  107. package/dist/ui/layout/viewport-geometry.d.ts +1 -0
  108. package/dist/ui/layout/viewport-geometry.js +1 -0
  109. package/dist/ui/layout/virtual-window.d.ts +1 -0
  110. package/dist/ui/layout/virtual-window.js +1 -1
  111. package/dist/ui/overlays/HelpOverlay.js +5 -2
  112. package/dist/ui/screen.d.ts +1 -1
  113. package/dist/ui/screen.js +4 -6
  114. package/dist/ui/scrollbar-controller.d.ts +30 -0
  115. package/dist/ui/scrollbar-controller.js +124 -0
  116. package/dist/ui/transcript-text.js +6 -2
  117. package/dist/ui/use-wheel-routing.d.ts +2 -0
  118. package/dist/ui/use-wheel-routing.js +6 -0
  119. package/package.json +2 -2
@@ -9,15 +9,9 @@
9
9
  * is why `AgentController` can own this object as unconditionally as it owns
10
10
  * `TeamRuntime`.
11
11
  *
12
- * INVARIANT I-2 — the list is a PROJECTION OF WHAT THE MODEL BELIEVES, and
13
- * nothing that does not tell the model may change it — EXCEPT AN EXPLICIT USER
14
- * INSTRUCTION, which is the rule's standing exception and is marked
15
- * `TodoClearReason = 'user'`. Two commands come through that door: `/todo clear`
16
- * and `/clear`. Neither tells the model anything, and that is fine, because what
17
- * they leave behind is "panel absent, model still remembers" - the direction I-9
18
- * below calls safe, and one the model's next full-replacement write heals on its
19
- * own. `/reset` (reason `'reset'`) remains the only clear caused by the belief
20
- * itself being destroyed, because it clears `messages`.
12
+ * The list projects the current plan. Explicit clear/reset and a new TUI task
13
+ * may remove that projection while the model still remembers the old plan.
14
+ * Continuations preserve it; legacy callers retain completion/staleness rules.
21
15
  *
22
16
  * Every write is a FULL REPLACEMENT and every clear is a FULL REMOVAL - there is
23
17
  * no partial update anywhere, which is what makes I-9 ("the panel is never a
@@ -73,11 +67,12 @@ export declare class TodoStore {
73
67
  * asymmetry for free, which is the behaviour you want: a steer must not age
74
68
  * out the plan it is steering.
75
69
  *
76
- * A FULLY-COMPLETED LIST IS DROPPED HERE rather than at `agent_end`. Ending
77
- * the run is exactly when the user wants to see `7/7 done`; wiping it there
78
- * would replace a moment of feedback with a blank column (D-6).
70
+ * A new TUI task drops the old plan here, while a continuation preserves it.
71
+ * With no policy, legacy callers retain completed/stale-plan expiration.
72
+ * Clearing at `agent_end` would erase the final progress before the user can
73
+ * inspect it and remove the plan that automatic continuation still needs.
79
74
  */
80
- beginUserTurn(): void;
75
+ beginUserTurn(policy?: 'new-task' | 'continue'): void;
81
76
  /**
82
77
  * Report a refusal that never reached `write()` (§3.3 steps 1 and 2).
83
78
  *
@@ -9,15 +9,9 @@
9
9
  * is why `AgentController` can own this object as unconditionally as it owns
10
10
  * `TeamRuntime`.
11
11
  *
12
- * INVARIANT I-2 — the list is a PROJECTION OF WHAT THE MODEL BELIEVES, and
13
- * nothing that does not tell the model may change it — EXCEPT AN EXPLICIT USER
14
- * INSTRUCTION, which is the rule's standing exception and is marked
15
- * `TodoClearReason = 'user'`. Two commands come through that door: `/todo clear`
16
- * and `/clear`. Neither tells the model anything, and that is fine, because what
17
- * they leave behind is "panel absent, model still remembers" - the direction I-9
18
- * below calls safe, and one the model's next full-replacement write heals on its
19
- * own. `/reset` (reason `'reset'`) remains the only clear caused by the belief
20
- * itself being destroyed, because it clears `messages`.
12
+ * The list projects the current plan. Explicit clear/reset and a new TUI task
13
+ * may remove that projection while the model still remembers the old plan.
14
+ * Continuations preserve it; legacy callers retain completion/staleness rules.
21
15
  *
22
16
  * Every write is a FULL REPLACEMENT and every clear is a FULL REMOVAL - there is
23
17
  * no partial update anywhere, which is what makes I-9 ("the panel is never a
@@ -137,13 +131,18 @@ export class TodoStore {
137
131
  * asymmetry for free, which is the behaviour you want: a steer must not age
138
132
  * out the plan it is steering.
139
133
  *
140
- * A FULLY-COMPLETED LIST IS DROPPED HERE rather than at `agent_end`. Ending
141
- * the run is exactly when the user wants to see `7/7 done`; wiping it there
142
- * would replace a moment of feedback with a blank column (D-6).
134
+ * A new TUI task drops the old plan here, while a continuation preserves it.
135
+ * With no policy, legacy callers retain completed/stale-plan expiration.
136
+ * Clearing at `agent_end` would erase the final progress before the user can
137
+ * inspect it and remove the plan that automatic continuation still needs.
143
138
  */
144
- beginUserTurn() {
145
- if (this.items.length === 0)
139
+ beginUserTurn(policy) {
140
+ if (this.items.length === 0 || policy === 'continue')
141
+ return;
142
+ if (policy === 'new-task') {
143
+ this.clear('turn');
146
144
  return;
145
+ }
147
146
  if (this.items.every((item) => item.status === 'completed')) {
148
147
  this.clear('turn');
149
148
  return;
@@ -45,7 +45,8 @@ export interface TodoSnapshot {
45
45
  * `user` - `/todo clear`, or `/clear`. Both are an explicit user instruction,
46
46
  * which is I-2's standing exception; neither touches `messages`.
47
47
  * `reset` - `/reset`, or a `/resume` whose file carried no list (§3.13).
48
- * `turn` - every item was completed when the next user turn started.
48
+ * `turn` - a new TUI task started, or a legacy caller began a turn after
49
+ * every item was completed.
49
50
  * `stale` - unfinished, and unwritten for more than `TODO_LIMITS.staleTurns`
50
51
  * consecutive turns (§3.2 / P1-7).
51
52
  */
package/dist/ui/App.d.ts CHANGED
@@ -5,6 +5,7 @@
5
5
  * input / toast stack / status bar / overlays.
6
6
  */
7
7
  import React from 'react';
8
+ import type { ScrollbarBridge } from './scrollbar-controller.js';
8
9
  import type { AgentController } from '../agent/controller.js';
9
10
  import type { ConfirmRequest } from '../tools/index.js';
10
11
  import { type Overlay, type ToastLevel } from '../agent/reducer.js';
@@ -109,6 +110,7 @@ export interface AppProps {
109
110
  * mounted. The effect below assigns both and clears them on unmount.
110
111
  */
111
112
  export interface TerminalBridge {
113
+ scrollbar?: ScrollbarBridge;
112
114
  /** Whether drag-select is on for this session (`mouseSelect` + a filter). */
113
115
  mouseSelect: boolean;
114
116
  /** Release the mouse to the terminal, or take it back (`/mouse`, G3). */