@leanandmean/coding-agent 0.74.1-scramjet.73 → 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.
package/README.md CHANGED
@@ -220,6 +220,10 @@ Submit messages while the agent is working:
220
220
  - **Escape** aborts and restores queued messages to editor
221
221
  - **Alt+Up** retrieves queued messages back to editor
222
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
+
223
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.
224
228
 
225
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;