@dreb/coding-agent 2.16.0 → 2.17.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.
- package/README.md +4 -3
- package/dist/core/agent-session.d.ts +3 -0
- package/dist/core/agent-session.d.ts.map +1 -1
- package/dist/core/agent-session.js +11 -0
- package/dist/core/agent-session.js.map +1 -1
- package/dist/core/sdk.d.ts.map +1 -1
- package/dist/core/sdk.js +1 -1
- package/dist/core/sdk.js.map +1 -1
- package/dist/core/tools/index.d.ts +5 -0
- package/dist/core/tools/index.d.ts.map +1 -1
- package/dist/core/tools/index.js +8 -0
- package/dist/core/tools/index.js.map +1 -1
- package/dist/core/tools/suggest-next.d.ts +19 -0
- package/dist/core/tools/suggest-next.d.ts.map +1 -0
- package/dist/core/tools/suggest-next.js +72 -0
- package/dist/core/tools/suggest-next.js.map +1 -0
- package/dist/core/tools/tmp-read.d.ts.map +1 -1
- package/dist/core/tools/tmp-read.js +14 -1
- package/dist/core/tools/tmp-read.js.map +1 -1
- package/dist/modes/interactive/interactive-mode.d.ts.map +1 -1
- package/dist/modes/interactive/interactive-mode.js +13 -0
- package/dist/modes/interactive/interactive-mode.js.map +1 -1
- package/docs/extensions.md +2 -2
- package/docs/json.md +2 -1
- package/docs/rpc.md +30 -0
- package/docs/session.md +24 -0
- package/docs/tui.md +8 -0
- package/package.json +1 -1
package/docs/extensions.md
CHANGED
|
@@ -569,7 +569,7 @@ In the default parallel tool execution mode, sibling tool calls from the same as
|
|
|
569
569
|
import { isToolCallEventType } from "@dreb/coding-agent";
|
|
570
570
|
|
|
571
571
|
dreb.on("tool_call", async (event, ctx) => {
|
|
572
|
-
// event.toolName - "bash", "read", "write", "edit", "grep", "find", "ls", "web_search", "web_fetch", "subagent", "search", "skill", "tasks_update", or custom tool names
|
|
572
|
+
// event.toolName - "bash", "read", "write", "edit", "grep", "find", "ls", "web_search", "web_fetch", "subagent", "search", "skill", "tasks_update", "suggest_next", or custom tool names
|
|
573
573
|
// event.toolCallId
|
|
574
574
|
// event.input - tool parameters
|
|
575
575
|
|
|
@@ -1474,7 +1474,7 @@ async execute(toolCallId, params) {
|
|
|
1474
1474
|
|
|
1475
1475
|
### Overriding Built-in Tools
|
|
1476
1476
|
|
|
1477
|
-
Extensions can override built-in tools (`read`, `bash`, `edit`, `write`, `grep`, `find`, `ls`, `web_search`, `web_fetch`, `subagent`, `search`) by registering a tool with the same name. Interactive mode displays a warning when this happens. The factory-only tools (`skill`, `tasks_update`) can also be overridden.
|
|
1477
|
+
Extensions can override built-in tools (`read`, `bash`, `edit`, `write`, `grep`, `find`, `ls`, `web_search`, `web_fetch`, `subagent`, `search`) by registering a tool with the same name. Interactive mode displays a warning when this happens. The factory-only tools (`skill`, `tasks_update`, `suggest_next`) can also be overridden.
|
|
1478
1478
|
|
|
1479
1479
|
```bash
|
|
1480
1480
|
# Extension's read tool replaces built-in read
|
package/docs/json.md
CHANGED
|
@@ -19,7 +19,8 @@ type AgentSessionEvent =
|
|
|
19
19
|
| { type: "auto_retry_end"; success: boolean; attempt: number; finalError?: string }
|
|
20
20
|
| { type: "background_agent_start"; agentId: string; agentType: string; taskSummary: string }
|
|
21
21
|
| { type: "background_agent_end"; agentId: string; agentType: string; success: boolean }
|
|
22
|
-
| { type: "tasks_update"; tasks: readonly SessionTask[] }
|
|
22
|
+
| { type: "tasks_update"; tasks: readonly SessionTask[] }
|
|
23
|
+
| { type: "suggest_next"; command: string };
|
|
23
24
|
|
|
24
25
|
// SessionTask shape:
|
|
25
26
|
interface SessionTask {
|
package/docs/rpc.md
CHANGED
|
@@ -535,6 +535,36 @@ Response:
|
|
|
535
535
|
|
|
536
536
|
`contextUsage` is omitted when no model or context window is available. `contextUsage.tokens` and `contextUsage.percent` are `null` immediately after compaction until a fresh post-compaction assistant response provides valid usage data.
|
|
537
537
|
|
|
538
|
+
#### get_performance_stats
|
|
539
|
+
|
|
540
|
+
Get rolling performance statistics (tokens-per-second) for all models with recorded data.
|
|
541
|
+
|
|
542
|
+
```json
|
|
543
|
+
{"type": "get_performance_stats"}
|
|
544
|
+
```
|
|
545
|
+
|
|
546
|
+
Response:
|
|
547
|
+
```json
|
|
548
|
+
{
|
|
549
|
+
"type": "response",
|
|
550
|
+
"command": "get_performance_stats",
|
|
551
|
+
"success": true,
|
|
552
|
+
"data": {
|
|
553
|
+
"models": [
|
|
554
|
+
{
|
|
555
|
+
"provider": "anthropic",
|
|
556
|
+
"modelId": "claude-sonnet-4",
|
|
557
|
+
"median": 31,
|
|
558
|
+
"mean": 32,
|
|
559
|
+
"count": 100
|
|
560
|
+
}
|
|
561
|
+
]
|
|
562
|
+
}
|
|
563
|
+
}
|
|
564
|
+
```
|
|
565
|
+
|
|
566
|
+
`models` contains per-model rolling averages computed from the agent's performance log. Each entry includes the median TPS, mean TPS, and number of recorded turns for that model. Returns an empty `models` array when no performance data has been recorded.
|
|
567
|
+
|
|
538
568
|
#### export_html
|
|
539
569
|
|
|
540
570
|
Export session to an HTML file.
|
package/docs/session.md
CHANGED
|
@@ -416,3 +416,27 @@ Key methods for working with sessions programmatically.
|
|
|
416
416
|
- `getSessionId()` - Session UUID
|
|
417
417
|
- `getSessionFile()` - Session file path (undefined for in-memory)
|
|
418
418
|
- `isPersisted()` - Whether session is saved to disk
|
|
419
|
+
|
|
420
|
+
---
|
|
421
|
+
|
|
422
|
+
## Performance Log
|
|
423
|
+
|
|
424
|
+
Assistant response performance is recorded to a JSONL file for rolling TPS statistics:
|
|
425
|
+
|
|
426
|
+
```
|
|
427
|
+
~/.dreb/agent/performance.jsonl
|
|
428
|
+
```
|
|
429
|
+
|
|
430
|
+
Each line is a JSON object with the following fields:
|
|
431
|
+
|
|
432
|
+
| Field | Type | Description |
|
|
433
|
+
|-------|------|-------------|
|
|
434
|
+
| `timestamp` | ISO string | When the response completed |
|
|
435
|
+
| `sessionId` | string | Session that produced the response |
|
|
436
|
+
| `provider` | string | Model provider (e.g. `anthropic`) |
|
|
437
|
+
| `modelId` | string | Model identifier (e.g. `claude-sonnet-4`) |
|
|
438
|
+
| `outputTokens` | number | Output tokens from the response |
|
|
439
|
+
| `durationMs` | number | Response duration in milliseconds |
|
|
440
|
+
| `tps` | number | Computed tokens per second (`outputTokens * 1000 / durationMs`) |
|
|
441
|
+
|
|
442
|
+
Entries are written atomically with file locking for safe concurrent access. The log is pruned daily, removing entries older than 30 days. Responses with `stopReason` of `error` or `aborted`, zero output tokens, or durations under 10ms are not recorded.
|
package/docs/tui.md
CHANGED
|
@@ -765,6 +765,14 @@ ctx.ui.setWidget("my-widget", undefined);
|
|
|
765
765
|
|
|
766
766
|
**Examples:** [plan-mode.ts](../examples/extensions/plan-mode.ts)
|
|
767
767
|
|
|
768
|
+
### Built-in Footer
|
|
769
|
+
|
|
770
|
+
The default footer shows three lines (when space allows):
|
|
771
|
+
|
|
772
|
+
1. **Path** — Current working directory (with `~` for home), git branch in parentheses, and session name if set. Dimmed.
|
|
773
|
+
2. **Stats** — Cumulative token usage (↑input ↓output Rread Wwrite), cost (with daily total when cross-session), and context-window percentage (colored red above 90%, yellow above 70%). When a model is selected and enough turns have been recorded, a rolling TPS suffix appears: `~31 tok/s [100] · 10% ↑ median [10000]`. The recent median (last 10 turns) is compared against the long-term baseline (last 10,000 turns). Dimmed.
|
|
774
|
+
3. **Extension statuses** — Alphabetical list of persistent status texts set by extensions via `ctx.ui.setStatus()`.
|
|
775
|
+
|
|
768
776
|
### Pattern 6: Custom Footer
|
|
769
777
|
|
|
770
778
|
Replace the footer. `footerData` exposes data not otherwise accessible to extensions.
|