@dreb/coding-agent 2.71.0 → 2.73.0

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 (41) hide show
  1. package/README.md +3 -3
  2. package/dist/core/agent-session.d.ts +37 -9
  3. package/dist/core/agent-session.d.ts.map +1 -1
  4. package/dist/core/agent-session.js +226 -149
  5. package/dist/core/agent-session.js.map +1 -1
  6. package/dist/core/thinking.d.ts +2 -0
  7. package/dist/core/thinking.d.ts.map +1 -1
  8. package/dist/core/thinking.js +20 -14
  9. package/dist/core/thinking.js.map +1 -1
  10. package/dist/core/tools/index.d.ts +1 -1
  11. package/dist/core/tools/index.d.ts.map +1 -1
  12. package/dist/core/tools/index.js +1 -1
  13. package/dist/core/tools/index.js.map +1 -1
  14. package/dist/core/tools/subagent.d.ts +77 -6
  15. package/dist/core/tools/subagent.d.ts.map +1 -1
  16. package/dist/core/tools/subagent.js +312 -64
  17. package/dist/core/tools/subagent.js.map +1 -1
  18. package/dist/main.d.ts.map +1 -1
  19. package/dist/main.js +6 -8
  20. package/dist/main.js.map +1 -1
  21. package/dist/modes/interactive/interactive-mode.d.ts.map +1 -1
  22. package/dist/modes/interactive/interactive-mode.js +9 -5
  23. package/dist/modes/interactive/interactive-mode.js.map +1 -1
  24. package/dist/modes/rpc/rpc-client.d.ts +6 -0
  25. package/dist/modes/rpc/rpc-client.d.ts.map +1 -1
  26. package/dist/modes/rpc/rpc-client.js +9 -0
  27. package/dist/modes/rpc/rpc-client.js.map +1 -1
  28. package/dist/modes/rpc/rpc-mode.d.ts.map +1 -1
  29. package/dist/modes/rpc/rpc-mode.js +7 -1
  30. package/dist/modes/rpc/rpc-mode.js.map +1 -1
  31. package/dist/modes/rpc/rpc-types.d.ts +11 -2
  32. package/dist/modes/rpc/rpc-types.d.ts.map +1 -1
  33. package/dist/modes/rpc/rpc-types.js.map +1 -1
  34. package/docs/agent-models.md +2 -2
  35. package/docs/dashboard.md +46 -3
  36. package/docs/json.md +2 -2
  37. package/docs/models.md +1 -1
  38. package/docs/providers.md +26 -0
  39. package/docs/rpc.md +25 -6
  40. package/docs/settings.md +1 -1
  41. package/package.json +1 -1
package/README.md CHANGED
@@ -398,7 +398,7 @@ Task tracking is prompt-driven: the system prompt includes guidelines for when t
398
398
 
399
399
  ## Subagents
400
400
 
401
- The optional `subagent` tool runs focused, role-matched work in independent child agent processes. Each subagent runs in its own process with its own context window, and notifies the parent when complete. In the dashboard, a live child's transcript view can accept the user's own steering messages directly; repeated messages use that child's configured one-at-a-time or all-at-once steering queue. Completed and rehydrated transcripts remain read-only.
401
+ The optional `subagent` tool runs focused, role-matched work in independent child agent processes. Each subagent runs in its own process with its own context window, and notifies the parent when complete. In that notification the child's own output sits between `--- agent output ---` and `--- end of agent output ---` lines (`--- agent output (partial) ---` when the child was cancelled or failed). System lines such as execution metadata, warnings, errors, and the session log stay outside those lines. A chain delimits each step's output. In the dashboard, a live child's transcript view can accept the user's own steering messages directly; repeated messages use that child's configured one-at-a-time or all-at-once steering queue. Its ■ stop cancels just that child — the parent and other subagents keep running, and the parent gets a cancellation notice (with any partial output) without being woken. Esc in the TUI (or the parent's stop) cancels all running subagents. Stops are graceful: the child aborts its own run first, so running tools such as a hung bash command are killed rather than orphaned. Completed, cancelled, and rehydrated transcripts remain read-only.
402
402
 
403
403
  When `agent` is omitted, dreb selects the default `Explore` agent. Explore retrieves concrete, bounded evidence: files, symbols, documentation, call sites, exact snippets, tests for a named behavior, and explicitly named data flows. The primary agent must synthesize that evidence and owns root-cause diagnosis, ambiguous-requirement interpretation, architecture/design decisions, implementation recommendations, planning, and final conclusions.
404
404
 
@@ -419,7 +419,7 @@ Set `backgroundAgents.maxConcurrentSubagents` in `/settings`, dashboard Settings
419
419
 
420
420
  **Per-agent model overrides:** The model used by each agent type can be overridden via the `agentModels.models` setting (a map of agent name → ordered fallback list) without copying or editing the agent definition `.md` files. Configure it in `settings.json` or via `/settings` → **Agent Models**. Resolution order: per-invocation `model` override → `agentModels` setting → agent definition `model` → parent session model. See [docs/agent-models.md](docs/agent-models.md).
421
421
 
422
- **Single model mode:** The `singleModelMode` setting (default `false`) forces every subagent to run on the parent session's model. When enabled, per-invocation `model` overrides, `agentModels` fallback lists, agent-definition models, spawn-time probes, and the dispatch arbiter are all bypassed, and any requested model selection — even one identical to the parent's — is reported to the parent by prepending a `[WARNING: ...]` note to the child's output. If nothing requested a model, no warning appears. If the parent session has no model, the spawn fails loudly. Configure it in the TUI (`/settings`), dashboard Settings, or `settings.json`. See [docs/agent-models.md](docs/agent-models.md#single-model-mode).
422
+ **Single model mode:** The `singleModelMode` setting (default `false`) forces every subagent to run on the parent session's model. When enabled, per-invocation `model` overrides, `agentModels` fallback lists, agent-definition models, spawn-time probes, and the dispatch arbiter are all bypassed, and any requested model selection — even one identical to the parent's — is reported to the parent as a `[WARNING: ...]` note just before the child's output. If nothing requested a model, no warning appears. If the parent session has no model, the spawn fails loudly. Configure it in the TUI (`/settings`), dashboard Settings, or `settings.json`. See [docs/agent-models.md](docs/agent-models.md#single-model-mode).
423
423
 
424
424
  **Optional Dispatch Arbiter:** A global-only `subagentArbiter` setting can enable a fully headless, direct model call after the proposal above resolves but before each child process spawns. It uses the validated routing guide, live explicit model scope, and bounded title-setter-style parent activity including useful tool outputs; existing secret scrubbing applies before inference. It may change only the existing agent type, exact scoped provider/model, and supported thinking level. It has no tools, cannot rewrite the task/cwd or agent definitions, and fails closed on configuration, guide, scope, inference, output, or validation errors. It runs once per single/parallel child and after `{previous}` substitution for every chain step. Interactive `/settings` and dashboard Settings both expose enable/disable, exact model selection, thinking, guide path, and loud readiness/validation feedback. Safe typed changed/unchanged/failure records are persisted outside parent model context and relayed to the TUI, JSON/RPC, and dashboard. See [Dispatch Arbiter](docs/agent-models.md#dispatch-arbiter) and [settings](docs/settings.md#dispatch-arbiter).
425
425
 
@@ -659,7 +659,7 @@ cat README.md | dreb -p "Summarize this text"
659
659
  | `--models <patterns>` | Comma-separated patterns for model cycling |
660
660
  | `--list-models [search]` | List available models |
661
661
 
662
- `max` is a separate native effort currently supported by the GPT-5.6 family (Sol, Terra, and Luna) and the GPT-6 family (Astra and future variants); `xhigh` remains available independently. Codex `ultra` is not a provider effort: it combines `max` with client-side multi-agent orchestration, so dreb does not send `ultra` as a raw value.
662
+ `max` is a separate native effort currently supported by the GPT-5.6 family (Sol, Terra, and Luna), the GPT-6 family (Astra and future variants), and — on Anthropic, GitHub Copilot, and Bedrock — Claude Opus/Sonnet 4.6+ and Haiku 5.5; `xhigh` remains available independently. On those transports, Claude `xhigh` (Opus 4.7+, Sonnet 5+, Haiku 5.5) and `max` are sent as the native efforts of the same name; Opus/Sonnet 4.6 have `max` but no `xhigh`, so a requested `xhigh` uses `max` there. Claude Opus 5.5 cannot turn thinking off, so `off` is not offered for it and a requested `off` uses `minimal`. OpenRouter keeps its own Claude effort mapping. GitHub Copilot's model list is refreshed from your account's Copilot `/models` at login and token refresh, so models your plan doesn't offer are hidden. Codex `ultra` is not a provider effort: it combines `max` with client-side multi-agent orchestration, so dreb does not send `ultra` as a raw value.
663
663
 
664
664
  ### Session Options
665
665
 
@@ -71,7 +71,10 @@ export type AgentSessionEvent = AgentEvent | SubagentArbitrationEvent | {
71
71
  type: "background_agent_end";
72
72
  agentId: string;
73
73
  agentType: string;
74
+ /** True only for a clean, non-cancelled finish (always false when `cancelled`). */
74
75
  success: boolean;
76
+ /** True when the user stopped the agent (single-agent stop or stop-all). */
77
+ cancelled: boolean;
75
78
  model?: string;
76
79
  thinking?: ThinkingLevel;
77
80
  steps?: SubagentStepMetadata[];
@@ -199,6 +202,11 @@ export declare class AgentSession {
199
202
  private _unsubscribeAgent?;
200
203
  private _eventListeners;
201
204
  private _agentEventQueue;
205
+ /**
206
+ * Agent events queued on `_agentEventQueue` that haven't finished processing yet.
207
+ * Persistence happens there, so the session log lags agent state until this is 0.
208
+ */
209
+ private _agentEventsInFlight;
202
210
  /** Tracks pending steering messages for UI display. Removed when delivered. */
203
211
  private _steeringMessages;
204
212
  /** Tracks pending follow-up messages for UI display. Removed when delivered. */
@@ -219,6 +227,14 @@ export declare class AgentSession {
219
227
  private _retryResolve;
220
228
  private _bashAbortController;
221
229
  private _pendingBashMessages;
230
+ /**
231
+ * Background-agent cancellation notices that arrived while the parent was busy (see
232
+ * `_canDeliverCancellationNotices`). Appending them then could land a user message
233
+ * between an assistant tool call and its result, or ahead of messages not yet persisted.
234
+ * They are held until the parent is idle again, or are persisted to their session before
235
+ * it is replaced.
236
+ */
237
+ private _pendingCancellationNotices;
222
238
  private _extensionRunner;
223
239
  private _turnIndex;
224
240
  private _resourceLoader;
@@ -602,22 +618,16 @@ export declare class AgentSession {
602
618
  */
603
619
  cycleThinkingLevel(): ThinkingLevel | undefined;
604
620
  /**
605
- * Get available thinking levels for current model.
606
- * The provider will clamp to what the specific model supports internally.
621
+ * Get available thinking levels for current model, in ascending order.
622
+ * `off` is omitted for models whose thinking cannot be turned off (Claude Opus 5.5+),
623
+ * and `xhigh` / `max` are included independently per model capability.
607
624
  */
608
625
  getAvailableThinkingLevels(): ThinkingLevel[];
609
- /**
610
- * Check if current model supports xhigh thinking level.
611
- */
612
- supportsXhighThinking(): boolean;
613
- /** Check if the current model supports the native max thinking level. */
614
- supportsMaxThinking(): boolean;
615
626
  /**
616
627
  * Check if current model supports thinking/reasoning.
617
628
  */
618
629
  supportsThinking(): boolean;
619
630
  private _getThinkingLevelForModelSwitch;
620
- private _clampThinkingLevel;
621
631
  /**
622
632
  * Set steering message mode.
623
633
  * Saves to settings.
@@ -748,6 +758,24 @@ export declare class AgentSession {
748
758
  get isBashRunning(): boolean;
749
759
  /** Whether there are pending bash messages waiting to be flushed */
750
760
  get hasPendingBashMessages(): boolean;
761
+ /**
762
+ * Whether deferred cancellation notices can be appended now without landing inside
763
+ * work that is still changing the transcript. Not while the agent streams, while
764
+ * earlier agent events are still being processed or persisted (the session log would
765
+ * get the notice ahead of them), while an auto-retry is pending (its backoff or the
766
+ * retried run), or while compaction or branch summarization runs.
767
+ */
768
+ private _canDeliverCancellationNotices;
769
+ /**
770
+ * Append deferred background-agent cancellation notices to agent state and the session
771
+ * log, in arrival order, and render them, if the parent is idle (see
772
+ * `_canDeliverCancellationNotices`). Otherwise they stay queued. They are retried after
773
+ * each processed agent event (`_processAgentEvent`), before the next prompt, and after manual compaction or
774
+ * branch navigation. Never triggers a response.
775
+ */
776
+ private _flushPendingCancellationNotices;
777
+ private _appendPendingCancellationNotices;
778
+ private _persistPendingCancellationNoticesBeforeSessionChange;
751
779
  /**
752
780
  * Flush pending bash messages to agent state and session.
753
781
  * Called after agent turn completes to maintain proper message ordering.