@draht/coding-agent 2026.3.2-8 → 2026.3.2-9
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/CHANGELOG.md +6 -0
- package/dist/config.d.ts.map +1 -1
- package/dist/config.js +1 -1
- package/dist/config.js.map +1 -1
- package/dist/migrations.d.ts +1 -1
- package/dist/migrations.d.ts.map +1 -1
- package/dist/migrations.js +3 -3
- package/dist/migrations.js.map +1 -1
- package/dist/modes/interactive/interactive-mode.d.ts.map +1 -1
- package/dist/modes/interactive/interactive-mode.js +1 -1
- package/dist/modes/interactive/interactive-mode.js.map +1 -1
- package/dist/modes/interactive/theme/dark.json +1 -1
- package/dist/modes/interactive/theme/light.json +1 -1
- package/docs/compaction.md +12 -12
- package/docs/custom-provider.md +6 -6
- package/docs/development.md +1 -1
- package/docs/extensions.md +8 -8
- package/docs/json.md +4 -4
- package/docs/providers.md +1 -1
- package/docs/session.md +5 -5
- package/docs/themes.md +2 -2
- package/docs/tui.md +1 -1
- package/examples/extensions/dynamic-resources/dynamic.json +1 -1
- package/package.json +5 -5
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
{
|
|
2
|
-
"$schema": "https://raw.githubusercontent.com/
|
|
2
|
+
"$schema": "https://raw.githubusercontent.com/draht-dev/draht/main/packages/coding-agent/src/modes/interactive/theme/theme-schema.json",
|
|
3
3
|
"name": "dark",
|
|
4
4
|
"vars": {
|
|
5
5
|
"cyan": "#00d7ff",
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
{
|
|
2
|
-
"$schema": "https://raw.githubusercontent.com/
|
|
2
|
+
"$schema": "https://raw.githubusercontent.com/draht-dev/draht/main/packages/coding-agent/src/modes/interactive/theme/theme-schema.json",
|
|
3
3
|
"name": "light",
|
|
4
4
|
"vars": {
|
|
5
5
|
"teal": "#5a8080",
|
package/docs/compaction.md
CHANGED
|
@@ -2,12 +2,12 @@
|
|
|
2
2
|
|
|
3
3
|
LLMs have limited context windows. When conversations grow too long, pi uses compaction to summarize older content while preserving recent work. This page covers both auto-compaction and branch summarization.
|
|
4
4
|
|
|
5
|
-
**Source files** ([pi-mono](https://github.com/
|
|
6
|
-
- [`packages/coding-agent/src/core/compaction/compaction.ts`](https://github.com/
|
|
7
|
-
- [`packages/coding-agent/src/core/compaction/branch-summarization.ts`](https://github.com/
|
|
8
|
-
- [`packages/coding-agent/src/core/compaction/utils.ts`](https://github.com/
|
|
9
|
-
- [`packages/coding-agent/src/core/session-manager.ts`](https://github.com/
|
|
10
|
-
- [`packages/coding-agent/src/core/extensions/types.ts`](https://github.com/
|
|
5
|
+
**Source files** ([pi-mono](https://github.com/draht-dev/draht)):
|
|
6
|
+
- [`packages/coding-agent/src/core/compaction/compaction.ts`](https://github.com/draht-dev/draht/blob/main/packages/coding-agent/src/core/compaction/compaction.ts) - Auto-compaction logic
|
|
7
|
+
- [`packages/coding-agent/src/core/compaction/branch-summarization.ts`](https://github.com/draht-dev/draht/blob/main/packages/coding-agent/src/core/compaction/branch-summarization.ts) - Branch summarization
|
|
8
|
+
- [`packages/coding-agent/src/core/compaction/utils.ts`](https://github.com/draht-dev/draht/blob/main/packages/coding-agent/src/core/compaction/utils.ts) - Shared utilities (file tracking, serialization)
|
|
9
|
+
- [`packages/coding-agent/src/core/session-manager.ts`](https://github.com/draht-dev/draht/blob/main/packages/coding-agent/src/core/session-manager.ts) - Entry types (`CompactionEntry`, `BranchSummaryEntry`)
|
|
10
|
+
- [`packages/coding-agent/src/core/extensions/types.ts`](https://github.com/draht-dev/draht/blob/main/packages/coding-agent/src/core/extensions/types.ts) - Extension event types
|
|
11
11
|
|
|
12
12
|
For TypeScript definitions in your project, inspect `node_modules/@draht/coding-agent/dist/`.
|
|
13
13
|
|
|
@@ -116,7 +116,7 @@ Never cut at tool results (they must stay with their tool call).
|
|
|
116
116
|
|
|
117
117
|
### CompactionEntry Structure
|
|
118
118
|
|
|
119
|
-
Defined in [`session-manager.ts`](https://github.com/
|
|
119
|
+
Defined in [`session-manager.ts`](https://github.com/draht-dev/draht/blob/main/packages/coding-agent/src/core/session-manager.ts):
|
|
120
120
|
|
|
121
121
|
```typescript
|
|
122
122
|
interface CompactionEntry<T = unknown> {
|
|
@@ -140,7 +140,7 @@ interface CompactionDetails {
|
|
|
140
140
|
|
|
141
141
|
Extensions can store any JSON-serializable data in `details`. The default compaction tracks file operations, but custom extension implementations can use their own structure.
|
|
142
142
|
|
|
143
|
-
See [`prepareCompaction()`](https://github.com/
|
|
143
|
+
See [`prepareCompaction()`](https://github.com/draht-dev/draht/blob/main/packages/coding-agent/src/core/compaction/compaction.ts) and [`compact()`](https://github.com/draht-dev/draht/blob/main/packages/coding-agent/src/core/compaction/compaction.ts) for the implementation.
|
|
144
144
|
|
|
145
145
|
## Branch Summarization
|
|
146
146
|
|
|
@@ -183,7 +183,7 @@ This means file tracking accumulates across multiple compactions or nested branc
|
|
|
183
183
|
|
|
184
184
|
### BranchSummaryEntry Structure
|
|
185
185
|
|
|
186
|
-
Defined in [`session-manager.ts`](https://github.com/
|
|
186
|
+
Defined in [`session-manager.ts`](https://github.com/draht-dev/draht/blob/main/packages/coding-agent/src/core/session-manager.ts):
|
|
187
187
|
|
|
188
188
|
```typescript
|
|
189
189
|
interface BranchSummaryEntry<T = unknown> {
|
|
@@ -206,7 +206,7 @@ interface BranchSummaryDetails {
|
|
|
206
206
|
|
|
207
207
|
Same as compaction, extensions can store custom data in `details`.
|
|
208
208
|
|
|
209
|
-
See [`collectEntriesForBranchSummary()`](https://github.com/
|
|
209
|
+
See [`collectEntriesForBranchSummary()`](https://github.com/draht-dev/draht/blob/main/packages/coding-agent/src/core/compaction/branch-summarization.ts), [`prepareBranchEntries()`](https://github.com/draht-dev/draht/blob/main/packages/coding-agent/src/core/compaction/branch-summarization.ts), and [`generateBranchSummary()`](https://github.com/draht-dev/draht/blob/main/packages/coding-agent/src/core/compaction/branch-summarization.ts) for the implementation.
|
|
210
210
|
|
|
211
211
|
## Summary Format
|
|
212
212
|
|
|
@@ -250,7 +250,7 @@ path/to/changed.ts
|
|
|
250
250
|
|
|
251
251
|
### Message Serialization
|
|
252
252
|
|
|
253
|
-
Before summarization, messages are serialized to text via [`serializeConversation()`](https://github.com/
|
|
253
|
+
Before summarization, messages are serialized to text via [`serializeConversation()`](https://github.com/draht-dev/draht/blob/main/packages/coding-agent/src/core/compaction/utils.ts):
|
|
254
254
|
|
|
255
255
|
```
|
|
256
256
|
[User]: What they said
|
|
@@ -264,7 +264,7 @@ This prevents the model from treating it as a conversation to continue.
|
|
|
264
264
|
|
|
265
265
|
## Custom Summarization via Extensions
|
|
266
266
|
|
|
267
|
-
Extensions can intercept and customize both compaction and branch summarization. See [`extensions/types.ts`](https://github.com/
|
|
267
|
+
Extensions can intercept and customize both compaction and branch summarization. See [`extensions/types.ts`](https://github.com/draht-dev/draht/blob/main/packages/coding-agent/src/core/extensions/types.ts) for event type definitions.
|
|
268
268
|
|
|
269
269
|
### session_before_compact
|
|
270
270
|
|
package/docs/custom-provider.md
CHANGED
|
@@ -293,11 +293,11 @@ interface OAuthCredentials {
|
|
|
293
293
|
For providers with non-standard APIs, implement `streamSimple`. Study the existing provider implementations before writing your own:
|
|
294
294
|
|
|
295
295
|
**Reference implementations:**
|
|
296
|
-
- [anthropic.ts](https://github.com/
|
|
297
|
-
- [openai-completions.ts](https://github.com/
|
|
298
|
-
- [openai-responses.ts](https://github.com/
|
|
299
|
-
- [google.ts](https://github.com/
|
|
300
|
-
- [amazon-bedrock.ts](https://github.com/
|
|
296
|
+
- [anthropic.ts](https://github.com/draht-dev/draht/blob/main/packages/ai/src/providers/anthropic.ts) - Anthropic Messages API
|
|
297
|
+
- [openai-completions.ts](https://github.com/draht-dev/draht/blob/main/packages/ai/src/providers/openai-completions.ts) - OpenAI Chat Completions
|
|
298
|
+
- [openai-responses.ts](https://github.com/draht-dev/draht/blob/main/packages/ai/src/providers/openai-responses.ts) - OpenAI Responses API
|
|
299
|
+
- [google.ts](https://github.com/draht-dev/draht/blob/main/packages/ai/src/providers/google.ts) - Google Generative AI
|
|
300
|
+
- [amazon-bedrock.ts](https://github.com/draht-dev/draht/blob/main/packages/ai/src/providers/amazon-bedrock.ts) - AWS Bedrock
|
|
301
301
|
|
|
302
302
|
### Stream Pattern
|
|
303
303
|
|
|
@@ -469,7 +469,7 @@ pi.registerProvider("my-provider", {
|
|
|
469
469
|
|
|
470
470
|
## Testing Your Implementation
|
|
471
471
|
|
|
472
|
-
Test your provider against the same test suites used by built-in providers. Copy and adapt these test files from [packages/ai/test/](https://github.com/
|
|
472
|
+
Test your provider against the same test suites used by built-in providers. Copy and adapt these test files from [packages/ai/test/](https://github.com/draht-dev/draht/tree/main/packages/ai/test):
|
|
473
473
|
|
|
474
474
|
| Test | Purpose |
|
|
475
475
|
|------|---------|
|
package/docs/development.md
CHANGED
package/docs/extensions.md
CHANGED
|
@@ -1346,13 +1346,13 @@ See [examples/extensions/tool-override.ts](../examples/extensions/tool-override.
|
|
|
1346
1346
|
**Your implementation must match the exact result shape**, including the `details` type. The UI and session logic depend on these shapes for rendering and state tracking.
|
|
1347
1347
|
|
|
1348
1348
|
Built-in tool implementations:
|
|
1349
|
-
- [read.ts](https://github.com/
|
|
1350
|
-
- [bash.ts](https://github.com/
|
|
1351
|
-
- [edit.ts](https://github.com/
|
|
1352
|
-
- [write.ts](https://github.com/
|
|
1353
|
-
- [grep.ts](https://github.com/
|
|
1354
|
-
- [find.ts](https://github.com/
|
|
1355
|
-
- [ls.ts](https://github.com/
|
|
1349
|
+
- [read.ts](https://github.com/draht-dev/draht/blob/main/packages/coding-agent/src/core/tools/read.ts) - `ReadToolDetails`
|
|
1350
|
+
- [bash.ts](https://github.com/draht-dev/draht/blob/main/packages/coding-agent/src/core/tools/bash.ts) - `BashToolDetails`
|
|
1351
|
+
- [edit.ts](https://github.com/draht-dev/draht/blob/main/packages/coding-agent/src/core/tools/edit.ts)
|
|
1352
|
+
- [write.ts](https://github.com/draht-dev/draht/blob/main/packages/coding-agent/src/core/tools/write.ts)
|
|
1353
|
+
- [grep.ts](https://github.com/draht-dev/draht/blob/main/packages/coding-agent/src/core/tools/grep.ts) - `GrepToolDetails`
|
|
1354
|
+
- [find.ts](https://github.com/draht-dev/draht/blob/main/packages/coding-agent/src/core/tools/find.ts) - `FindToolDetails`
|
|
1355
|
+
- [ls.ts](https://github.com/draht-dev/draht/blob/main/packages/coding-agent/src/core/tools/ls.ts) - `LsToolDetails`
|
|
1356
1356
|
|
|
1357
1357
|
### Remote Execution
|
|
1358
1358
|
|
|
@@ -1473,7 +1473,7 @@ export default function (pi: ExtensionAPI) {
|
|
|
1473
1473
|
|
|
1474
1474
|
### Custom Rendering
|
|
1475
1475
|
|
|
1476
|
-
Tools can provide `renderCall` and `renderResult` for custom TUI display. See [tui.md](tui.md) for the full component API and [tool-execution.ts](https://github.com/
|
|
1476
|
+
Tools can provide `renderCall` and `renderResult` for custom TUI display. See [tui.md](tui.md) for the full component API and [tool-execution.ts](https://github.com/draht-dev/draht/blob/main/packages/coding-agent/src/modes/interactive/components/tool-execution.ts) for how built-in tools render.
|
|
1477
1477
|
|
|
1478
1478
|
Tool output is wrapped in a `Box` that handles padding and background. Your render methods return `Component` instances (typically `Text`).
|
|
1479
1479
|
|
package/docs/json.md
CHANGED
|
@@ -8,7 +8,7 @@ Outputs all session events as JSON lines to stdout. Useful for integrating pi in
|
|
|
8
8
|
|
|
9
9
|
## Event Types
|
|
10
10
|
|
|
11
|
-
Events are defined in [`AgentSessionEvent`](https://github.com/
|
|
11
|
+
Events are defined in [`AgentSessionEvent`](https://github.com/draht-dev/draht/blob/main/packages/coding-agent/src/core/agent-session.ts#L102):
|
|
12
12
|
|
|
13
13
|
```typescript
|
|
14
14
|
type AgentSessionEvent =
|
|
@@ -19,7 +19,7 @@ type AgentSessionEvent =
|
|
|
19
19
|
| { type: "auto_retry_end"; success: boolean; attempt: number; finalError?: string };
|
|
20
20
|
```
|
|
21
21
|
|
|
22
|
-
Base events from [`AgentEvent`](https://github.com/
|
|
22
|
+
Base events from [`AgentEvent`](https://github.com/draht-dev/draht/blob/main/packages/agent/src/types.ts#L179):
|
|
23
23
|
|
|
24
24
|
```typescript
|
|
25
25
|
type AgentEvent =
|
|
@@ -41,12 +41,12 @@ type AgentEvent =
|
|
|
41
41
|
|
|
42
42
|
## Message Types
|
|
43
43
|
|
|
44
|
-
Base messages from [`packages/ai/src/types.ts`](https://github.com/
|
|
44
|
+
Base messages from [`packages/ai/src/types.ts`](https://github.com/draht-dev/draht/blob/main/packages/ai/src/types.ts#L134):
|
|
45
45
|
- `UserMessage` (line 134)
|
|
46
46
|
- `AssistantMessage` (line 140)
|
|
47
47
|
- `ToolResultMessage` (line 152)
|
|
48
48
|
|
|
49
|
-
Extended messages from [`packages/coding-agent/src/core/messages.ts`](https://github.com/
|
|
49
|
+
Extended messages from [`packages/coding-agent/src/core/messages.ts`](https://github.com/draht-dev/draht/blob/main/packages/coding-agent/src/core/messages.ts#L29):
|
|
50
50
|
- `BashExecutionMessage` (line 29)
|
|
51
51
|
- `CustomMessage` (line 46)
|
|
52
52
|
- `BranchSummaryMessage` (line 55)
|
package/docs/providers.md
CHANGED
|
@@ -70,7 +70,7 @@ pi
|
|
|
70
70
|
| MiniMax | `MINIMAX_API_KEY` | `minimax` |
|
|
71
71
|
| MiniMax (China) | `MINIMAX_CN_API_KEY` | `minimax-cn` |
|
|
72
72
|
|
|
73
|
-
Reference for environment variables and `auth.json` keys: [`const envMap`](https://github.com/
|
|
73
|
+
Reference for environment variables and `auth.json` keys: [`const envMap`](https://github.com/draht-dev/draht/blob/main/packages/ai/src/env-api-keys.ts) in [`packages/ai/src/env-api-keys.ts`](https://github.com/draht-dev/draht/blob/main/packages/ai/src/env-api-keys.ts).
|
|
74
74
|
|
|
75
75
|
#### Auth File
|
|
76
76
|
|
package/docs/session.md
CHANGED
|
@@ -28,11 +28,11 @@ Existing sessions are automatically migrated to the current version (v3) when lo
|
|
|
28
28
|
|
|
29
29
|
## Source Files
|
|
30
30
|
|
|
31
|
-
Source on GitHub ([pi-mono](https://github.com/
|
|
32
|
-
- [`packages/coding-agent/src/core/session-manager.ts`](https://github.com/
|
|
33
|
-
- [`packages/coding-agent/src/core/messages.ts`](https://github.com/
|
|
34
|
-
- [`packages/ai/src/types.ts`](https://github.com/
|
|
35
|
-
- [`packages/agent/src/types.ts`](https://github.com/
|
|
31
|
+
Source on GitHub ([pi-mono](https://github.com/draht-dev/draht)):
|
|
32
|
+
- [`packages/coding-agent/src/core/session-manager.ts`](https://github.com/draht-dev/draht/blob/main/packages/coding-agent/src/core/session-manager.ts) - Session entry types and SessionManager
|
|
33
|
+
- [`packages/coding-agent/src/core/messages.ts`](https://github.com/draht-dev/draht/blob/main/packages/coding-agent/src/core/messages.ts) - Extended message types (BashExecutionMessage, CustomMessage, etc.)
|
|
34
|
+
- [`packages/ai/src/types.ts`](https://github.com/draht-dev/draht/blob/main/packages/ai/src/types.ts) - Base message types (UserMessage, AssistantMessage, ToolResultMessage)
|
|
35
|
+
- [`packages/agent/src/types.ts`](https://github.com/draht-dev/draht/blob/main/packages/agent/src/types.ts) - AgentMessage union type
|
|
36
36
|
|
|
37
37
|
For TypeScript definitions in your project, inspect `node_modules/@draht/coding-agent/dist/` and `node_modules/@draht/ai/dist/`.
|
|
38
38
|
|
package/docs/themes.md
CHANGED
|
@@ -52,7 +52,7 @@ vim ~/.pi/agent/themes/my-theme.json
|
|
|
52
52
|
|
|
53
53
|
```json
|
|
54
54
|
{
|
|
55
|
-
"$schema": "https://raw.githubusercontent.com/
|
|
55
|
+
"$schema": "https://raw.githubusercontent.com/draht-dev/draht/main/packages/coding-agent/src/modes/interactive/theme/theme-schema.json",
|
|
56
56
|
"name": "my-theme",
|
|
57
57
|
"vars": {
|
|
58
58
|
"primary": "#00aaff",
|
|
@@ -122,7 +122,7 @@ vim ~/.pi/agent/themes/my-theme.json
|
|
|
122
122
|
|
|
123
123
|
```json
|
|
124
124
|
{
|
|
125
|
-
"$schema": "https://raw.githubusercontent.com/
|
|
125
|
+
"$schema": "https://raw.githubusercontent.com/draht-dev/draht/main/packages/coding-agent/src/modes/interactive/theme/theme-schema.json",
|
|
126
126
|
"name": "my-theme",
|
|
127
127
|
"vars": {
|
|
128
128
|
"blue": "#0066cc",
|
package/docs/tui.md
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
Extensions and custom tools can render custom TUI components for interactive user interfaces. This page covers the component system and available building blocks.
|
|
6
6
|
|
|
7
|
-
**Source:** [`@draht/tui`](https://github.com/
|
|
7
|
+
**Source:** [`@draht/tui`](https://github.com/draht-dev/draht/tree/main/packages/tui)
|
|
8
8
|
|
|
9
9
|
## Component Interface
|
|
10
10
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
{
|
|
2
|
-
"$schema": "https://raw.githubusercontent.com/
|
|
2
|
+
"$schema": "https://raw.githubusercontent.com/draht-dev/draht/main/packages/coding-agent/src/modes/interactive/theme/theme-schema.json",
|
|
3
3
|
"name": "dynamic-resources",
|
|
4
4
|
"vars": {
|
|
5
5
|
"cyan": "#00d7ff",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@draht/coding-agent",
|
|
3
|
-
"version": "2026.3.2-
|
|
3
|
+
"version": "2026.3.2-9",
|
|
4
4
|
"description": "Coding agent CLI with read, bash, edit, write tools and session management",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"drahtConfig": {
|
|
@@ -46,9 +46,9 @@
|
|
|
46
46
|
},
|
|
47
47
|
"dependencies": {
|
|
48
48
|
"@mariozechner/jiti": "^2.6.2",
|
|
49
|
-
"@draht/agent-core": "2026.3.2-
|
|
50
|
-
"@draht/ai": "2026.3.2-
|
|
51
|
-
"@draht/tui": "2026.3.2-
|
|
49
|
+
"@draht/agent-core": "2026.3.2-9",
|
|
50
|
+
"@draht/ai": "2026.3.2-9",
|
|
51
|
+
"@draht/tui": "2026.3.2-9",
|
|
52
52
|
"@silvia-odwyer/photon-node": "^0.3.4",
|
|
53
53
|
"chalk": "^5.5.0",
|
|
54
54
|
"cli-highlight": "^2.1.11",
|
|
@@ -97,7 +97,7 @@
|
|
|
97
97
|
},
|
|
98
98
|
"repository": {
|
|
99
99
|
"type": "git",
|
|
100
|
-
"url": "git+https://github.com/
|
|
100
|
+
"url": "git+https://github.com/draht-dev/draht.git",
|
|
101
101
|
"directory": "packages/coding-agent"
|
|
102
102
|
},
|
|
103
103
|
"engines": {
|