@aragon-agent/cli 0.6.1 → 0.6.3
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.
- package/CHANGELOG.md +216 -0
- package/README.md +241 -18
- package/dist/agent/agent-mode.d.ts +39 -0
- package/dist/agent/agent-mode.js +36 -0
- package/dist/agent/controller.d.ts +74 -1
- package/dist/agent/controller.js +200 -1
- package/dist/agent/headless.d.ts +8 -0
- package/dist/agent/headless.js +47 -0
- package/dist/agent/reducer.d.ts +120 -0
- package/dist/agent/reducer.js +201 -2
- package/dist/cli.js +297 -6
- package/dist/commands/builtins.js +73 -23
- package/dist/commands/registry.d.ts +27 -0
- package/dist/compaction/archive.d.ts +175 -0
- package/dist/compaction/archive.js +267 -0
- package/dist/compaction/child.d.ts +97 -0
- package/dist/compaction/child.js +113 -0
- package/dist/compaction/command.d.ts +41 -0
- package/dist/compaction/command.js +342 -0
- package/dist/compaction/compactor.d.ts +268 -0
- package/dist/compaction/compactor.js +689 -0
- package/dist/compaction/digest.d.ts +62 -0
- package/dist/compaction/digest.js +164 -0
- package/dist/compaction/limits.d.ts +165 -0
- package/dist/compaction/limits.js +172 -0
- package/dist/compaction/pressure.d.ts +135 -0
- package/dist/compaction/pressure.js +167 -0
- package/dist/compaction/summarize-call.d.ts +70 -0
- package/dist/compaction/summarize-call.js +86 -0
- package/dist/compaction/summary-prompt.d.ts +85 -0
- package/dist/compaction/summary-prompt.js +197 -0
- package/dist/compaction/tail-budget.d.ts +52 -0
- package/dist/compaction/tail-budget.js +67 -0
- package/dist/compaction/types.d.ts +179 -0
- package/dist/compaction/types.js +22 -0
- package/dist/compaction/wiring.d.ts +255 -0
- package/dist/compaction/wiring.js +556 -0
- package/dist/config/app-paths.d.ts +14 -0
- package/dist/config/app-paths.js +16 -0
- package/dist/config/cli-commands.d.ts +41 -0
- package/dist/config/cli-commands.js +77 -1
- package/dist/config/env.d.ts +4 -1
- package/dist/config/env.js +92 -2
- package/dist/config/load.d.ts +31 -0
- package/dist/config/load.js +63 -1
- package/dist/config/schema.d.ts +159 -0
- package/dist/config/schema.js +137 -0
- package/dist/config/store.js +17 -1
- package/dist/config/ui-state.d.ts +44 -6
- package/dist/config/ui-state.js +21 -12
- package/dist/diagnostics/doctor.js +41 -1
- package/dist/exec/events.d.ts +50 -1
- package/dist/exec/index.js +8 -4
- package/dist/exec/runner.js +44 -2
- package/dist/input/mouse-events.d.ts +31 -5
- package/dist/input/mouse-events.js +86 -27
- package/dist/input/stdin-mouse-filter.d.ts +8 -3
- package/dist/logging/install.d.ts +51 -1
- package/dist/logging/install.js +28 -0
- package/dist/logging/logger.d.ts +1 -1
- package/dist/session/cli-commands.js +23 -1
- package/dist/session/persist.js +19 -0
- package/dist/session/store.d.ts +18 -0
- package/dist/session/store.js +59 -2
- package/dist/team/report.js +7 -1
- package/dist/team/runtime.d.ts +10 -0
- package/dist/team/runtime.js +7 -0
- package/dist/team/subagent.d.ts +31 -1
- package/dist/team/subagent.js +42 -15
- package/dist/team/types.d.ts +8 -0
- package/dist/ui/ActivityLine.d.ts +19 -1
- package/dist/ui/ActivityLine.js +10 -2
- package/dist/ui/App.d.ts +48 -1
- package/dist/ui/App.js +317 -17
- package/dist/ui/Composer.d.ts +26 -1
- package/dist/ui/Composer.js +6 -6
- package/dist/ui/PromptInput.d.ts +34 -1
- package/dist/ui/PromptInput.js +54 -3
- package/dist/ui/StatusBar.d.ts +40 -0
- package/dist/ui/StatusBar.js +13 -4
- package/dist/ui/TeamPanel.js +7 -1
- package/dist/ui/Transcript.d.ts +21 -1
- package/dist/ui/Transcript.js +32 -2
- package/dist/ui/clipboard.d.ts +52 -0
- package/dist/ui/clipboard.js +91 -0
- package/dist/ui/entries/CompactionCard.d.ts +75 -0
- package/dist/ui/entries/CompactionCard.js +158 -0
- package/dist/ui/frame-differ.d.ts +46 -0
- package/dist/ui/frame-differ.js +94 -10
- package/dist/ui/gauge.d.ts +16 -1
- package/dist/ui/gauge.js +25 -6
- package/dist/ui/glyphs.d.ts +11 -0
- package/dist/ui/glyphs.js +2 -0
- package/dist/ui/layout/ScrollViewport.d.ts +43 -6
- package/dist/ui/layout/ScrollViewport.js +128 -21
- package/dist/ui/layout/budget.d.ts +10 -3
- package/dist/ui/layout/budget.js +10 -3
- package/dist/ui/layout/follow-state.d.ts +137 -0
- package/dist/ui/layout/follow-state.js +150 -0
- package/dist/ui/layout/virtual-window.d.ts +11 -0
- package/dist/ui/layout/virtual-window.js +34 -0
- package/dist/ui/overlays/HelpOverlay.js +18 -2
- package/dist/ui/overlays/SettingsScreen.d.ts +47 -1
- package/dist/ui/overlays/SettingsScreen.js +60 -1
- package/dist/ui/palettes.d.ts +16 -0
- package/dist/ui/palettes.js +6 -0
- package/dist/ui/screen.d.ts +22 -0
- package/dist/ui/screen.js +70 -8
- package/dist/ui/selection/highlight.d.ts +39 -0
- package/dist/ui/selection/highlight.js +64 -0
- package/dist/ui/selection/screen-mirror.d.ts +24 -0
- package/dist/ui/selection/screen-mirror.js +35 -0
- package/dist/ui/selection/selection-controller.d.ts +88 -0
- package/dist/ui/selection/selection-controller.js +282 -0
- package/dist/ui/selection/selection.d.ts +90 -0
- package/dist/ui/selection/selection.js +223 -0
- package/dist/ui/stdout-frame-writer.d.ts +33 -0
- package/dist/ui/stdout-frame-writer.js +15 -0
- package/dist/ui/theme.d.ts +11 -0
- package/dist/ui/theme.js +2 -0
- package/dist/ui/transcript-text.js +23 -0
- package/dist/ui/use-startup-notices.d.ts +62 -5
- package/dist/ui/use-startup-notices.js +81 -17
- package/dist/ui/use-wheel-routing.js +8 -0
- package/dist/ui/win-vt-force.d.ts +136 -0
- package/dist/ui/win-vt-force.js +237 -0
- package/package.json +4 -2
package/dist/team/types.d.ts
CHANGED
|
@@ -78,6 +78,14 @@ export interface SubagentRun {
|
|
|
78
78
|
error?: string;
|
|
79
79
|
/** Hit `team.maxTurnsPerSubagent` and was stopped mid-work. */
|
|
80
80
|
truncated?: boolean;
|
|
81
|
+
/**
|
|
82
|
+
* Compactions this child performed on its OWN history
|
|
83
|
+
* (context-auto-compaction-hardening §3.4.4 / W3).
|
|
84
|
+
*
|
|
85
|
+
* OPTIONAL, so every existing construction site and fixture compiles
|
|
86
|
+
* unchanged. Absent and `0` mean the same thing to every reader.
|
|
87
|
+
*/
|
|
88
|
+
compactions?: number;
|
|
81
89
|
/**
|
|
82
90
|
* Prose the child is writing right now, sanitized and clamped to
|
|
83
91
|
* `TEAM_LIMITS.activityChars`. Set only between tool calls; cleared on
|
|
@@ -74,7 +74,25 @@ export interface ActivityLineProps {
|
|
|
74
74
|
* not calm, it is wrong.
|
|
75
75
|
*/
|
|
76
76
|
runningTool?: string;
|
|
77
|
+
/**
|
|
78
|
+
* A context compaction is in flight (context-auto-compaction §6.1).
|
|
79
|
+
*
|
|
80
|
+
* HIGHEST PRECEDENCE IN THE LABEL LADDER, above `runningTool` and above the
|
|
81
|
+
* rotating phrase. Compaction happens BEFORE `turn_start`, i.e. at a moment
|
|
82
|
+
* when `status` is `'running'` but no tool is in flight — precisely the window
|
|
83
|
+
* in which the phrase rotation would say something false, and it can last
|
|
84
|
+
* tens of seconds. `runningTool` already established the principle one step
|
|
85
|
+
* back: a UI that says "Pondering" while `npm test` runs is not calm, it is
|
|
86
|
+
* wrong, and one that says it while a 30 k-token summarization runs is the same
|
|
87
|
+
* error.
|
|
88
|
+
*
|
|
89
|
+
* STILL NO SECOND SPINNER. `single-spinner-while-running`'s D-1 stands: this
|
|
90
|
+
* row owns the only animation while it is mounted, and the compaction card
|
|
91
|
+
* follows `FastCard` in taking a `reducedMotion` that `App` has already
|
|
92
|
+
* widened.
|
|
93
|
+
*/
|
|
94
|
+
compacting?: boolean;
|
|
77
95
|
theme: Theme;
|
|
78
96
|
caps: TermCapabilities;
|
|
79
97
|
}
|
|
80
|
-
export declare function ActivityLine({ startedAt, elapsedMs, reducedMotion, runningTool, theme, caps, }: ActivityLineProps): React.ReactElement;
|
|
98
|
+
export declare function ActivityLine({ startedAt, elapsedMs, reducedMotion, runningTool, compacting, theme, caps, }: ActivityLineProps): React.ReactElement;
|
package/dist/ui/ActivityLine.js
CHANGED
|
@@ -21,7 +21,7 @@ import { pickActivityPhrase } from './activity-phrases.js';
|
|
|
21
21
|
export function liveSpinner(reducedMotion, caps) {
|
|
22
22
|
return caps.unicode && !reducedMotion ? _jsx(Spinner, { type: "dots" }) : null;
|
|
23
23
|
}
|
|
24
|
-
export function ActivityLine({ startedAt, elapsedMs, reducedMotion, runningTool, theme, caps, }) {
|
|
24
|
+
export function ActivityLine({ startedAt, elapsedMs, reducedMotion, runningTool, compacting, theme, caps, }) {
|
|
25
25
|
const glyphs = pickGlyphs(caps);
|
|
26
26
|
// PURE AND DERIVED FROM `(startedAt, now)`, so the sequence does not need to
|
|
27
27
|
// keep rotating underneath the tool label: when the tool settles the phrase
|
|
@@ -31,7 +31,15 @@ export function ActivityLine({ startedAt, elapsedMs, reducedMotion, runningTool,
|
|
|
31
31
|
// SECOND registry of tool names, and `toolGlyph` is already the one place that
|
|
32
32
|
// knows them. Everything round 1 legislated for this row survives — one row,
|
|
33
33
|
// no digits, no `esc abort`, no width ladder, ASCII only.
|
|
34
|
-
|
|
34
|
+
// THREE RUNGS, MOST SPECIFIC FIRST. `Compacting context` outranks a tool name
|
|
35
|
+
// because compaction can be the only thing happening, and it outranks the
|
|
36
|
+
// phrase for the reason `runningTool` does. ASCII only, and the ellipsis comes
|
|
37
|
+
// from `pickGlyphs` like every other one on this row.
|
|
38
|
+
const label = compacting
|
|
39
|
+
? `Compacting context${glyphs.ellipsis}`
|
|
40
|
+
: runningTool
|
|
41
|
+
? `Running ${runningTool}`
|
|
42
|
+
: `${phrase}${glyphs.ellipsis}`;
|
|
35
43
|
// The IDENTICAL branch `Transcript.tsx` uses for the assistant role marker, and
|
|
36
44
|
// it must stay identical: braille dots are both an animation AND a Unicode-only
|
|
37
45
|
// glyph, so reduced motion and an ASCII terminal fall back to the same marker.
|
package/dist/ui/App.d.ts
CHANGED
|
@@ -11,6 +11,7 @@ import { type Overlay, type ToastLevel } from '../agent/reducer.js';
|
|
|
11
11
|
import type { UpdateBridge } from '../update/types.js';
|
|
12
12
|
import { type RenderMode } from './layout/frame.js';
|
|
13
13
|
import type { MouseSource } from '../input/stdin-mouse-filter.js';
|
|
14
|
+
import type { SelectionBridge } from './selection/selection-controller.js';
|
|
14
15
|
import type { HumanInputBridge } from '../tools/human-input.js';
|
|
15
16
|
export interface ConfirmBridge {
|
|
16
17
|
handler: ((req: ConfirmRequest) => Promise<boolean>) | null;
|
|
@@ -72,5 +73,51 @@ export interface AppProps {
|
|
|
72
73
|
* 'off'`, on a non-TTY, in CI, and in every test that does not exercise it.
|
|
73
74
|
*/
|
|
74
75
|
updateBridge?: UpdateBridge;
|
|
76
|
+
/**
|
|
77
|
+
* The terminal-facing services `cli.tsx` owns and this component cannot build
|
|
78
|
+
* (tui-selection-and-scroll-follow §4.4).
|
|
79
|
+
*
|
|
80
|
+
* ONE PROP RATHER THAN FOUR, and every FIELD of it is independently optional,
|
|
81
|
+
* so `--no-mouse`, `--no-diff-render` and inline mode each drop exactly the
|
|
82
|
+
* services they do not have. Absent altogether on a non-TTY and in every test
|
|
83
|
+
* that does not exercise selection, which is what keeps those trees
|
|
84
|
+
* byte-identical.
|
|
85
|
+
*/
|
|
86
|
+
terminal?: TerminalBridge;
|
|
87
|
+
}
|
|
88
|
+
/**
|
|
89
|
+
* Terminal-level services, almost all of which exist only in a full-screen TTY
|
|
90
|
+
* session — `writeForeign` is the exception, because `/copy` is available in
|
|
91
|
+
* inline mode too and OSC 52 is what makes it work over SSH (§4.4.5).
|
|
92
|
+
*
|
|
93
|
+
* `selection` is a LATE-BOUND BRIDGE for the reason `updateBridge` above is one:
|
|
94
|
+
* the controller is constructed before `render()` and must not hold React state,
|
|
95
|
+
* while the toast sink and the redraw nonce only exist once this component has
|
|
96
|
+
* mounted. The effect below assigns both and clears them on unmount.
|
|
97
|
+
*/
|
|
98
|
+
export interface TerminalBridge {
|
|
99
|
+
/** Whether drag-select is on for this session (`mouseSelect` + a filter). */
|
|
100
|
+
mouseSelect: boolean;
|
|
101
|
+
/** Release the mouse to the terminal, or take it back (`/mouse`, G3). */
|
|
102
|
+
setMouseCapture?: (on: boolean) => void;
|
|
103
|
+
/** Whether the mouse is captured right now — read at command time. */
|
|
104
|
+
isMouseCaptured?: () => boolean;
|
|
105
|
+
/**
|
|
106
|
+
* Write bytes that are ours but are not a frame (OSC 52).
|
|
107
|
+
*
|
|
108
|
+
* IT MUST NOT BE `stdout.write` WITH THE DIFFER IN FRONT OF STDOUT (P1-6):
|
|
109
|
+
* that goes through the frame-writer proxy, which does not recognise an OSC 52
|
|
110
|
+
* chunk, counts it as a foreign write and prints `FRAME_FALLBACK_NOTICE` at
|
|
111
|
+
* the user the first time they copy anything. Without a differ — inline mode,
|
|
112
|
+
* `--no-diff-render` — stdout IS the real stream and `cli.tsx` supplies a
|
|
113
|
+
* direct write instead.
|
|
114
|
+
*
|
|
115
|
+
* Absent only when there is no terminal to accept it at all. It is never a
|
|
116
|
+
* function that writes nowhere: `copyText` reports `'osc52'` whenever its door
|
|
117
|
+
* took the text, so a no-op door would make the toast name a mechanism that
|
|
118
|
+
* was never attempted.
|
|
119
|
+
*/
|
|
120
|
+
writeForeign?: (text: string) => void;
|
|
121
|
+
selection?: SelectionBridge;
|
|
75
122
|
}
|
|
76
|
-
export declare function App({ controller, version, mode, initialOverlay, initialPrompt, confirmBridge, humanInputBridge, mouseSource, vtInputWarning, updateBridge, }: AppProps): React.ReactElement;
|
|
123
|
+
export declare function App({ controller, version, mode, initialOverlay, initialPrompt, confirmBridge, humanInputBridge, mouseSource, vtInputWarning, updateBridge, terminal, }: AppProps): React.ReactElement;
|