@dreb/coding-agent 2.70.1 → 2.72.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 (47) hide show
  1. package/README.md +4 -1
  2. package/dist/cli/args.d.ts +6 -0
  3. package/dist/cli/args.d.ts.map +1 -1
  4. package/dist/cli/args.js +17 -0
  5. package/dist/cli/args.js.map +1 -1
  6. package/dist/core/agent-session.d.ts +3 -9
  7. package/dist/core/agent-session.d.ts.map +1 -1
  8. package/dist/core/agent-session.js +19 -51
  9. package/dist/core/agent-session.js.map +1 -1
  10. package/dist/core/output-guard.d.ts +6 -0
  11. package/dist/core/output-guard.d.ts.map +1 -1
  12. package/dist/core/output-guard.js +86 -13
  13. package/dist/core/output-guard.js.map +1 -1
  14. package/dist/core/thinking.d.ts +2 -0
  15. package/dist/core/thinking.d.ts.map +1 -1
  16. package/dist/core/thinking.js +20 -14
  17. package/dist/core/thinking.js.map +1 -1
  18. package/dist/core/tools/subagent.d.ts +1 -0
  19. package/dist/core/tools/subagent.d.ts.map +1 -1
  20. package/dist/core/tools/subagent.js +13 -0
  21. package/dist/core/tools/subagent.js.map +1 -1
  22. package/dist/main.d.ts.map +1 -1
  23. package/dist/main.js +13 -10
  24. package/dist/main.js.map +1 -1
  25. package/dist/modes/interactive/interactive-mode.d.ts.map +1 -1
  26. package/dist/modes/interactive/interactive-mode.js +9 -5
  27. package/dist/modes/interactive/interactive-mode.js.map +1 -1
  28. package/dist/modes/rpc/index.d.ts +2 -2
  29. package/dist/modes/rpc/index.d.ts.map +1 -1
  30. package/dist/modes/rpc/index.js +1 -1
  31. package/dist/modes/rpc/index.js.map +1 -1
  32. package/dist/modes/rpc/rpc-event-projection.d.ts +14 -9
  33. package/dist/modes/rpc/rpc-event-projection.d.ts.map +1 -1
  34. package/dist/modes/rpc/rpc-event-projection.js +16 -11
  35. package/dist/modes/rpc/rpc-event-projection.js.map +1 -1
  36. package/dist/modes/rpc/rpc-mode.d.ts +10 -1
  37. package/dist/modes/rpc/rpc-mode.d.ts.map +1 -1
  38. package/dist/modes/rpc/rpc-mode.js +29 -15
  39. package/dist/modes/rpc/rpc-mode.js.map +1 -1
  40. package/dist/modes/rpc/rpc-types.d.ts +28 -2
  41. package/dist/modes/rpc/rpc-types.d.ts.map +1 -1
  42. package/dist/modes/rpc/rpc-types.js.map +1 -1
  43. package/docs/agent-models.md +1 -1
  44. package/docs/models.md +1 -1
  45. package/docs/providers.md +26 -0
  46. package/docs/rpc.md +25 -13
  47. package/package.json +1 -1
package/docs/rpc.md CHANGED
@@ -33,7 +33,7 @@ historical field as a safe process-spawn path.
33
33
 
34
34
  ### Process exit and pipe errors
35
35
 
36
- `RpcClient.onExit(listener)` receives an `RpcExitInfo` when the child dies: `{ code, signal }` from a process `exit`, or `{ error }` from a spawn/runtime `error`. Process exits also carry `stderrTail` — the last **2000 characters** of the child's captured stderr — so a host that only watches for exit codes can still surface the child's own diagnostic (for example the stdout backpressure guard's abort message) instead of an opaque exit code. In-flight requests are rejected with the exit reason.
36
+ `RpcClient.onExit(listener)` receives an `RpcExitInfo` when the child dies: `{ code, signal }` from a process `exit`, or `{ error }` from a spawn/runtime `error`. Process exits also carry `stderrTail` — the last **2000 characters** of the child's captured stderr — so a host that only watches for exit codes can still surface the child's own diagnostic (for example the stdout backpressure guard's abort message, or the `Fatal: stdout write failed (EPIPE|ENOBUFS|...)` diagnostic the child writes before exiting 1 when a stdout pipe write fails) instead of an opaque exit code. In-flight requests are rejected with the exit reason.
37
37
 
38
38
  Child stdio pipe failures (e.g. an `EPIPE` when writing a large prompt to a dying child) are handled the same way: each pipe's `error` event fails in-flight requests with the pipe error and the captured stderr tail instead of crashing the host process.
39
39
 
@@ -514,7 +514,7 @@ Set the reasoning/thinking level for models that support it.
514
514
 
515
515
  Levels: `"off"`, `"minimal"`, `"low"`, `"medium"`, `"high"`, `"xhigh"`, `"max"`
516
516
 
517
- Note: `"xhigh"` is supported by GPT-5.2 through GPT-5.6 model families, the GPT-6 family (Astra and future variants), Claude Opus 4.6–4.x and Claude 5 families (where it maps to adaptive effort `"max"`), and Kimi Code K3. The separate normalized `"max"` tier is model-aware and currently supported by GPT-5.6 aliases and Sol/Terra/Luna variants, plus the GPT-6 family.
517
+ Note: `"xhigh"` is supported by GPT-5.2 through GPT-5.6 model families, the GPT-6 family (Astra and future variants), Claude Opus 4.7+, Sonnet 5+ and Haiku 5.5 on Anthropic, GitHub Copilot and Bedrock (sent as native effort `"xhigh"`), Claude Opus 4.6+ and Sonnet 5+ on OpenRouter, Kimi Code K3, and Qwen 3.8+. The separate normalized `"max"` tier is model-aware and currently supported by GPT-5.6 aliases and Sol/Terra/Luna variants, the GPT-6 family, and Claude Opus/Sonnet 4.6+ and Haiku 5.5 on Anthropic, GitHub Copilot and Bedrock. Unsupported levels are clamped (`xhigh` → `max` on Claude Opus/Sonnet 4.6, otherwise `high`; `max` → `xhigh` → `high`). `availableThinkingLevels` in `get_state` lists only the levels the current model supports and may omit `"off"`: Claude Opus 5.5 cannot turn thinking off, so its list starts at `"minimal"` and `set_thinking_level` with `"off"` lands on `"minimal"` (the saved default is left unchanged).
518
518
 
519
519
  Response:
520
520
  ```json
@@ -1854,17 +1854,15 @@ Emitted when a message begins and completes. The `message` field contains an `Ag
1854
1854
 
1855
1855
  ### message_update (Streaming)
1856
1856
 
1857
- Emitted during streaming of assistant messages. Contains both the partial message and a streaming delta event.
1857
+ Emitted during streaming of assistant messages. Carries a streaming delta event. By default, frames are **bounded**: they contain only the delta fields, never the cumulative message.
1858
1858
 
1859
1859
  ```json
1860
1860
  {
1861
1861
  "type": "message_update",
1862
- "message": {...},
1863
1862
  "assistantMessageEvent": {
1864
1863
  "type": "text_delta",
1865
1864
  "contentIndex": 0,
1866
- "delta": "Hello ",
1867
- "partial": {...}
1865
+ "delta": "Hello "
1868
1866
  }
1869
1867
  }
1870
1868
  ```
@@ -1888,19 +1886,33 @@ The `assistantMessageEvent` field contains one of these delta types:
1888
1886
 
1889
1887
  Example streaming a text response:
1890
1888
  ```json
1891
- {"type":"message_update","message":{...},"assistantMessageEvent":{"type":"text_start","contentIndex":0,"partial":{...}}}
1889
+ {"type":"message_update","assistantMessageEvent":{"type":"text_start","contentIndex":0}}
1890
+ {"type":"message_update","assistantMessageEvent":{"type":"text_delta","contentIndex":0,"delta":"Hello"}}
1891
+ {"type":"message_update","assistantMessageEvent":{"type":"text_delta","contentIndex":0,"delta":" world"}}
1892
+ {"type":"message_update","assistantMessageEvent":{"type":"text_end","contentIndex":0,"content":"Hello world"}}
1893
+ ```
1894
+
1895
+ #### Bounded wire projection (default)
1896
+
1897
+ Every RPC server projects `message_update` events **before serialization**: the cumulative top-level `message` field and the nested `assistantMessageEvent.partial` field are omitted from every frame. Both fields grow with the response, so carrying them on every delta makes the JSONL stream quadratic in response length — long turns (especially large tool calls streamed as `toolcall_delta`) could flood the stdout pipe. The delta fields (`type`, `contentIndex`, `delta`, `content`, `toolCall`) are preserved unchanged, so total stdout volume stays proportional to response length.
1898
+
1899
+ The projection applies recursively to `message_update` events nested inside `background_agent_event` payloads. It does **not** apply to command responses — `get_messages` and `get_dashboard_snapshot` still return complete messages — and `message_end` always carries the full final message as the authoritative transcript record.
1900
+
1901
+ **Legacy full frames (opt-in).** Clients that still read `message` or `assistantMessageEvent.partial` from `message_update` can launch the server with `--rpc-full-message-updates` to restore the unprojected frames:
1902
+
1903
+ ```json
1892
1904
  {"type":"message_update","message":{...},"assistantMessageEvent":{"type":"text_delta","contentIndex":0,"delta":"Hello","partial":{...}}}
1893
- {"type":"message_update","message":{...},"assistantMessageEvent":{"type":"text_delta","contentIndex":0,"delta":" world","partial":{...}}}
1894
- {"type":"message_update","message":{...},"assistantMessageEvent":{"type":"text_end","contentIndex":0,"content":"Hello world","partial":{...}}}
1895
1905
  ```
1896
1906
 
1897
- #### Dashboard-mode wire projection (`--ui dashboard`)
1907
+ The flag requires `--mode rpc` and is rejected with `--ui dashboard` (dashboard runtimes are always projected). A server started with the flag forwards it to the RPC-controlled subagent children it spawns, so nested `message_update` events relayed in `background_agent_event` payloads are full frames too. Prefer accumulating deltas or reading `message_end` instead.
1908
+
1909
+ **TypeScript types.** `RpcEvent` (exported from the package and used by `RpcClient.onEvent`) types `message_update` as `RpcMessageUpdateEvent`: `message` and `assistantMessageEvent.partial` are optional, because they are absent unless the server runs with `--rpc-full-message-updates`.
1898
1910
 
1899
- When the RPC server is launched with `--ui dashboard`, `message_update` events are projected **before serialization**: the cumulative top-level `message` field and the nested `assistantMessageEvent.partial` field are omitted from every frame. Both fields grow with the response, so carrying them on every delta makes the JSONL stream quadratic in response length; the dashboard reducer consumes only the delta fields (`type`, `contentIndex`, `delta`, `content`, `toolCall`), which are preserved unchanged.
1911
+ **Stdout write failures.** If a stdout write fails (`EPIPE` when the consumer has gone, `ENOBUFS`, ...), the server writes a `Fatal: stdout write failed (<code>: ...)` diagnostic to stderr and exits 1. A stdin close that arrives at the same time (a dying consumer usually closes both pipes) does not override this with a clean exit.
1900
1912
 
1901
- The projection applies recursively to `message_update` events nested inside `background_agent_event` payloads. It does **not** apply to command responses — `get_dashboard_snapshot` still returns complete messages — and `message_end` always carries the full final message as the authoritative transcript record. RPC servers launched without `--ui dashboard` emit the full unprojected protocol shown above.
1913
+ #### Dashboard-mode image dedupe (`--ui dashboard`)
1902
1914
 
1903
- The same dashboard-mode projection also dedupes images across the wire. Inline `image` blocks (PNG, JPEG, GIF, WebP) are content-identified by `sha256(mimeType + 0x00 + decodedBytes)`; the first occurrence of each unique image is sent inline, and every later occurrence anywhere in the event stream is replaced with
1915
+ Dashboard runtimes also dedupe images across the wire. Inline `image` blocks (PNG, JPEG, GIF, WebP) are content-identified by `sha256(mimeType + 0x00 + decodedBytes)`; the first occurrence of each unique image is sent inline, and every later occurrence anywhere in the event stream is replaced with
1904
1916
 
1905
1917
  ```json
1906
1918
  {"type": "image_reference", "id": "<64 hex chars>", "mimeType": "image/png", "size": 12345}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dreb/coding-agent",
3
- "version": "2.70.1",
3
+ "version": "2.72.0",
4
4
  "description": "Coding agent CLI with read, bash, edit, write tools and session management",
5
5
  "type": "module",
6
6
  "drebConfig": {