@leanandmean/coding-agent 0.74.1-scramjet.72 → 0.74.1-scramjet.74

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 (35) hide show
  1. package/README.md +8 -1
  2. package/dist/core/agent-session.d.ts +19 -1
  3. package/dist/core/agent-session.d.ts.map +1 -1
  4. package/dist/core/agent-session.js +293 -68
  5. package/dist/core/agent-session.js.map +1 -1
  6. package/dist/core/extensions/runner.d.ts +5 -3
  7. package/dist/core/extensions/runner.d.ts.map +1 -1
  8. package/dist/core/extensions/runner.js +18 -5
  9. package/dist/core/extensions/runner.js.map +1 -1
  10. package/dist/core/extensions/types.d.ts +9 -0
  11. package/dist/core/extensions/types.d.ts.map +1 -1
  12. package/dist/core/extensions/types.js.map +1 -1
  13. package/dist/index.d.ts +1 -1
  14. package/dist/index.d.ts.map +1 -1
  15. package/dist/index.js.map +1 -1
  16. package/dist/modes/interactive/components/extension-editor.d.ts.map +1 -1
  17. package/dist/modes/interactive/components/extension-editor.js +7 -3
  18. package/dist/modes/interactive/components/extension-editor.js.map +1 -1
  19. package/dist/modes/interactive/interactive-mode.d.ts +4 -0
  20. package/dist/modes/interactive/interactive-mode.d.ts.map +1 -1
  21. package/dist/modes/interactive/interactive-mode.js +155 -34
  22. package/dist/modes/interactive/interactive-mode.js.map +1 -1
  23. package/dist/modes/print-mode.d.ts.map +1 -1
  24. package/dist/modes/print-mode.js +35 -16
  25. package/dist/modes/print-mode.js.map +1 -1
  26. package/docs/compaction.md +6 -0
  27. package/docs/custom-provider.md +3 -1
  28. package/docs/extensions.md +13 -1
  29. package/docs/keybindings.md +1 -1
  30. package/docs/sdk.md +27 -0
  31. package/docs/settings.md +2 -0
  32. package/docs/terminal-setup.md +8 -4
  33. package/docs/terminal-verification.md +48 -0
  34. package/docs/tui.md +8 -0
  35. package/package.json +4 -4
package/README.md CHANGED
@@ -146,7 +146,7 @@ Interactive mode retains the current transcript in an application-managed viewpo
146
146
 
147
147
  While content remains below the viewport, the existing gap above the dock shows `Session: N lines below · Ctrl+End: latest`; the row stays blank at the tail. This counts rendered session rows, not unread messages or hidden draft text, and does not add another editor border. Narrow terminals shorten the hint and finally show `Session ↓…` if the labelled exact count cannot fit. The indicator is decorative and excluded from application copying.
148
148
 
149
- Drag without modifiers to select displayed text, including across scrolling; double-click selects a word and triple-click selects one displayed line. Right-click the selection or press Ctrl+C to copy it; built-in text rendering omits known layout padding and rejoins soft wraps while preserving genuine indentation and hard breaks. Selection stays live as output changes, and Copy captures the last displayed highlight immediately. Dragging can cross between transcript and editor; a downward transcript drag reaches the transcript bottom before entering the dock. Editor copying also rejoins soft wraps. Without selection, Ctrl+C retains its normal editor/quit behavior, and right-clicking the transcript, blank space, or editor pastes local clipboard text into the visible, focused editor without submitting it. Selectors and overlays do not paste. Terminal-native Copy menus cannot see application selection.
149
+ Drag without modifiers to select displayed text, including across scrolling; double-click selects a word and triple-click selects one displayed line. Right-click the selection or press Ctrl+C to copy it; built-in text rendering omits known layout padding and rejoins soft wraps while preserving genuine indentation and hard breaks. Selection stays live as output changes, and Copy captures the last displayed highlight immediately. Dragging can cross between transcript and editor; a downward transcript drag reaches the transcript bottom before entering the dock. Editor copying also rejoins soft wraps. Without selection, Ctrl+C retains its normal editor/quit behavior, and right-clicking the transcript, blank space, or editor pastes local clipboard text into the visible, focused editor without submitting it. Selectors and overlays do not paste. Command+V uses ordinary terminal paste into the editor without submission. Command+C and terminal-native Copy menus remain terminal-owned and cannot copy Scramjet’s application selection. iTerm2 requires explicitly enabling `ReportRightClick=true` for right-click Copy/Paste; this affects other mouse-reporting applications too, and Scramjet never changes it automatically. See [configuration requirements and evidence limits](docs/terminal-setup.md#transcript-browsing-and-copying).
150
150
 
151
151
  Home/End always retain editor line-start/end behavior. Ctrl+Home/Ctrl+End navigate to the transcript beginning/bottom, with Ctrl+End resuming following. Submitting nonempty editor input resumes following immediately, including `!`/`!!` commands, slash commands and queued messages. A new user message appearing in the transcript also resumes following. While scrolled away, PageUp/PageDown browse and Escape returns to the live tail; Alt+PageUp/Alt+PageDown enter browsing from the tail. Docked editing and presentation toggles preserve the reading position; undocked editing reveals its cursor. At the tail, ordinary editor/list bindings apply. Hidden approval controls must first be revealed before a subsequent activation can approve.
152
152
 
@@ -198,6 +198,9 @@ See `/hotkeys` for the full list. Customize via `~/.scramjet/agent/keybindings.j
198
198
 
199
199
  | Key | Action |
200
200
  |-----|--------|
201
+ | Right-click | Copy application selection; without selection, paste into the eligible focused editor |
202
+ | Command+C (macOS) | Terminal-owned Copy, not Scramjet application-selection Copy |
203
+ | Command+V (macOS) | Paste text at the editor caret without submitting |
201
204
  | Ctrl+C | Copy transcript selection; otherwise clear editor |
202
205
  | Ctrl+C twice | Quit |
203
206
  | Escape | Return from transcript browsing; otherwise cancel/abort |
@@ -217,6 +220,10 @@ Submit messages while the agent is working:
217
220
  - **Escape** aborts and restores queued messages to editor
218
221
  - **Alt+Up** retrieves queued messages back to editor
219
222
 
223
+ Failed requests are displayed as **attempts**, not final outcomes. Automatic recovery stays within the configured [retry limits](docs/settings.md#retry), including applicable automatic compaction. During non-streaming recovery/settlement, Enter and Alt+Enter retain your text with a wait/cancel explanation rather than silently dropping or replaying it. Escape cancels the originating execution and restores explicitly queued messages. A rejected submission restores its text only if no newer draft was typed. Cancellation and final failure give a safe next action; recovered execution does not mean the entire task completed.
224
+
225
+ Text print mode (`--print`) uses the final prompt invocation's captured provider result, not earlier answers or later harness artifacts. Failed/cancelled execution reports to stderr and exits nonzero; a handled command that starts no immediate run prints no borrowed answer. JSON and RPC event framing remain unchanged.
226
+
220
227
  On Windows Terminal, `Alt+Enter` is fullscreen by default. Remap it in [docs/terminal-setup.md](docs/terminal-setup.md) so scramjet can receive the follow-up shortcut.
221
228
 
222
229
  Configure delivery in [settings](docs/settings.md): `steeringMode` defaults to `"all"` (delivers all queued at once), while `followUpMode` defaults to `"one-at-a-time"` (waits for a response). Both settings accept either value. `transport` selects provider transport preference (`"sse"`, `"websocket"`, or `"auto"`) for providers that support multiple transports.
@@ -13,7 +13,7 @@
13
13
  * Modes use this class and add their own I/O layer on top.
14
14
  */
15
15
  import type { Agent, AgentEvent, AgentMessage, AgentState, AgentTool, ThinkingLevel } from "@leanandmean/agent";
16
- import type { ImageContent, Model, TextContent } from "@leanandmean/ai";
16
+ import type { AssistantMessage, ImageContent, Model, TextContent } from "@leanandmean/ai";
17
17
  import { type BashResult } from "./bash-executor.js";
18
18
  import { type CompactionResult } from "./compaction/index.js";
19
19
  import { type ContextUsage, type DeliverAs, type DispatchUserInputOptions, type ExtensionCommandContextActions, type ExtensionErrorListener, ExtensionRunner, type ExtensionUIContext, type InputSource, type InvokeHarnessToolOptions, type ReplacedSessionContext, type SendMessageDeliverAs, type SessionStartEvent, type ShutdownHandler, type ToolDefinition, type ToolInfo } from "./extensions/index.js";
@@ -115,6 +115,17 @@ export interface ExtensionBindings {
115
115
  shutdownHandler?: ShutdownHandler;
116
116
  onError?: ExtensionErrorListener;
117
117
  }
118
+ export type RunSettlement = {
119
+ status: "completed";
120
+ assistantMessage?: AssistantMessage;
121
+ } | {
122
+ status: "failed";
123
+ assistantMessage?: AssistantMessage;
124
+ errorMessage: string;
125
+ } | {
126
+ status: "cancelled";
127
+ assistantMessage?: AssistantMessage;
128
+ };
118
129
  /** Options for AgentSession.prompt() */
119
130
  export interface PromptOptions {
120
131
  /** Whether to expand file-based prompt templates (default: true) */
@@ -133,6 +144,8 @@ export interface PromptOptions {
133
144
  source?: InputSource;
134
145
  /** Internal hook used by RPC mode to observe prompt preflight acceptance or rejection. */
135
146
  preflightResult?: (success: boolean) => void;
147
+ /** Synchronous capture after immediate-run reservation, before launch; never await from a gating hook. */
148
+ onRunSettlement?: (settlement: Promise<RunSettlement>) => void;
136
149
  }
137
150
  /** Result from cycleModel() */
138
151
  export interface ModelCycleResult {
@@ -249,6 +262,7 @@ export declare class AgentSession {
249
262
  private _captureAgentRunSettlement;
250
263
  private _settleAgentRun;
251
264
  private _settleRetryChain;
265
+ private _trySettleRetryChain;
252
266
  private _completeAgentRun;
253
267
  private _reserveAgentRunStart;
254
268
  private _rejectAgentRunStart;
@@ -544,6 +558,7 @@ export declare class AgentSession {
544
558
  abortBranchSummary(): void;
545
559
  private _checkCompaction;
546
560
  private _runAutoCompaction;
561
+ private _scheduleCompactionContinuation;
547
562
  /**
548
563
  * Toggle auto-compaction setting.
549
564
  */
@@ -574,6 +589,7 @@ export declare class AgentSession {
574
589
  private _releaseRetryForFailedRun;
575
590
  private _reportRetryFailure;
576
591
  private _handleRetryableError;
592
+ private _resumeRetry;
577
593
  private _finishCancelledRetry;
578
594
  /**
579
595
  * Cancel in-progress retry.
@@ -582,6 +598,8 @@ export declare class AgentSession {
582
598
  /** Agent's own `activeRun` guard is false during backoff; the retry phase owns the idle Agent then. */
583
599
  private _assertRetryNotOwningIdleAgent;
584
600
  private _runAgentPrompt;
601
+ private _continueAgentRun;
602
+ private _cancelRunSettlements;
585
603
  private waitForRetry;
586
604
  /** Whether auto-retry is currently in progress */
587
605
  get isRetrying(): boolean;