@draht/coding-agent 2026.7.7 → 2026.7.11
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 +27 -0
- package/README.md +2 -2
- package/agents/advisor.md +44 -0
- package/bin/draht-tools.cjs +1808 -988
- package/dist/agents/advisor.md +44 -0
- package/dist/cli/args.d.ts.map +1 -1
- package/dist/cli/args.js +1 -1
- package/dist/cli/args.js.map +1 -1
- package/dist/core/agent-session.d.ts +16 -3
- package/dist/core/agent-session.d.ts.map +1 -1
- package/dist/core/agent-session.js +76 -18
- package/dist/core/agent-session.js.map +1 -1
- package/dist/core/cache-stats.d.ts +49 -0
- package/dist/core/cache-stats.d.ts.map +1 -0
- package/dist/core/cache-stats.js +101 -0
- package/dist/core/cache-stats.js.map +1 -0
- package/dist/core/compaction/compaction.d.ts +1 -2
- package/dist/core/compaction/compaction.d.ts.map +1 -1
- package/dist/core/compaction/compaction.js +51 -73
- package/dist/core/compaction/compaction.js.map +1 -1
- package/dist/core/extensions/index.d.ts +1 -1
- package/dist/core/extensions/index.d.ts.map +1 -1
- package/dist/core/extensions/index.js.map +1 -1
- package/dist/core/extensions/loader.d.ts.map +1 -1
- package/dist/core/extensions/loader.js +23 -4
- package/dist/core/extensions/loader.js.map +1 -1
- package/dist/core/extensions/runner.d.ts.map +1 -1
- package/dist/core/extensions/runner.js +1 -24
- package/dist/core/extensions/runner.js.map +1 -1
- package/dist/core/extensions/types.d.ts +9 -9
- package/dist/core/extensions/types.d.ts.map +1 -1
- package/dist/core/extensions/types.js.map +1 -1
- package/dist/core/index.d.ts +1 -1
- package/dist/core/index.d.ts.map +1 -1
- package/dist/core/index.js.map +1 -1
- package/dist/core/model-registry.d.ts +4 -6
- package/dist/core/model-registry.d.ts.map +1 -1
- package/dist/core/model-registry.js +34 -8
- package/dist/core/model-registry.js.map +1 -1
- package/dist/core/resource-loader.d.ts.map +1 -1
- package/dist/core/resource-loader.js +2 -5
- package/dist/core/resource-loader.js.map +1 -1
- package/dist/core/settings-manager.d.ts +7 -3
- package/dist/core/settings-manager.d.ts.map +1 -1
- package/dist/core/settings-manager.js +10 -1
- package/dist/core/settings-manager.js.map +1 -1
- package/dist/core/slash-commands.d.ts +1 -0
- package/dist/core/slash-commands.d.ts.map +1 -1
- package/dist/core/slash-commands.js +3 -3
- package/dist/core/slash-commands.js.map +1 -1
- package/dist/gsd/hook-utils.d.ts.map +1 -1
- package/dist/gsd/hook-utils.js +3 -1
- package/dist/gsd/hook-utils.js.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js.map +1 -1
- package/dist/main.d.ts.map +1 -1
- package/dist/main.js +1 -0
- package/dist/main.js.map +1 -1
- package/dist/modes/interactive/components/footer.d.ts +4 -0
- package/dist/modes/interactive/components/footer.d.ts.map +1 -1
- package/dist/modes/interactive/components/footer.js +1 -1
- package/dist/modes/interactive/components/footer.js.map +1 -1
- package/dist/modes/interactive/components/oauth-selector.d.ts +3 -1
- package/dist/modes/interactive/components/oauth-selector.d.ts.map +1 -1
- package/dist/modes/interactive/components/oauth-selector.js +17 -6
- package/dist/modes/interactive/components/oauth-selector.js.map +1 -1
- package/dist/modes/interactive/components/settings-selector.d.ts +2 -0
- package/dist/modes/interactive/components/settings-selector.d.ts.map +1 -1
- package/dist/modes/interactive/components/settings-selector.js +10 -0
- package/dist/modes/interactive/components/settings-selector.js.map +1 -1
- package/dist/modes/interactive/interactive-mode.d.ts +10 -0
- package/dist/modes/interactive/interactive-mode.d.ts.map +1 -1
- package/dist/modes/interactive/interactive-mode.js +247 -47
- package/dist/modes/interactive/interactive-mode.js.map +1 -1
- package/dist/modes/interactive/theme/theme-schema.json +3 -4
- package/dist/modes/interactive/theme/theme.d.ts +2 -1
- package/dist/modes/interactive/theme/theme.d.ts.map +1 -1
- package/dist/modes/interactive/theme/theme.js +8 -4
- package/dist/modes/interactive/theme/theme.js.map +1 -1
- package/dist/modes/print-mode.d.ts.map +1 -1
- package/dist/modes/print-mode.js +1 -1
- package/dist/modes/print-mode.js.map +1 -1
- package/dist/modes/rpc/rpc-client.d.ts +6 -6
- package/dist/modes/rpc/rpc-client.d.ts.map +1 -1
- package/dist/modes/rpc/rpc-client.js +3 -3
- package/dist/modes/rpc/rpc-client.js.map +1 -1
- package/dist/modes/rpc/rpc-mode.d.ts.map +1 -1
- package/dist/modes/rpc/rpc-mode.js +4 -1
- package/dist/modes/rpc/rpc-mode.js.map +1 -1
- package/dist/prompts/agents/build.md +38 -0
- package/dist/prompts/agents/plan.md +36 -0
- package/dist/prompts/agents/verify.md +36 -4
- package/dist/prompts/commands/brainstorm.md +16 -2
- package/dist/prompts/commands/discuss-phase.md +1 -1
- package/dist/prompts/commands/execute-phase.md +6 -3
- package/dist/prompts/commands/fix.md +13 -1
- package/dist/prompts/commands/init-project.md +1 -0
- package/dist/prompts/commands/map-codebase.md +9 -9
- package/dist/prompts/commands/new-project.md +1 -0
- package/dist/prompts/commands/next-milestone.md +3 -0
- package/dist/prompts/commands/orchestrate-loop.md +99 -0
- package/dist/prompts/commands/orchestrate.md +29 -6
- package/dist/prompts/commands/pause-work.md +2 -1
- package/dist/prompts/commands/plan-phase.md +6 -0
- package/dist/prompts/commands/quick.md +6 -2
- package/dist/prompts/commands/review.md +4 -1
- package/dist/prompts/commands/verify-work.md +10 -8
- package/dist/utils/clipboard-image.d.ts.map +1 -1
- package/dist/utils/clipboard-image.js +1 -1
- package/dist/utils/clipboard-image.js.map +1 -1
- package/docs/custom-provider.md +4 -3
- package/docs/extensions.md +15 -10
- package/docs/models.md +49 -8
- package/docs/rpc.md +15 -5
- package/docs/sdk.md +1 -1
- package/docs/settings.md +3 -2
- package/docs/themes.md +5 -3
- package/docs/tui.md +1 -1
- package/docs/usage.md +2 -2
- package/examples/extensions/custom-provider-anthropic/package-lock.json +2 -2
- package/examples/extensions/custom-provider-anthropic/package.json +1 -1
- package/examples/extensions/custom-provider-gitlab-duo/package.json +1 -1
- package/examples/extensions/preset.ts +2 -2
- package/examples/extensions/reload-runtime.ts +2 -2
- package/examples/extensions/sandbox/package-lock.json +2 -2
- package/examples/extensions/sandbox/package.json +1 -1
- package/examples/extensions/with-deps/package-lock.json +2 -2
- package/examples/extensions/with-deps/package.json +1 -1
- package/examples/sdk/README.md +1 -1
- package/package.json +5 -5
- package/prompts/agents/build.md +38 -0
- package/prompts/agents/plan.md +36 -0
- package/prompts/agents/verify.md +36 -4
- package/prompts/commands/brainstorm.md +16 -2
- package/prompts/commands/discuss-phase.md +1 -1
- package/prompts/commands/execute-phase.md +6 -3
- package/prompts/commands/fix.md +13 -1
- package/prompts/commands/init-project.md +1 -0
- package/prompts/commands/map-codebase.md +9 -9
- package/prompts/commands/new-project.md +1 -0
- package/prompts/commands/next-milestone.md +3 -0
- package/prompts/commands/orchestrate-loop.md +99 -0
- package/prompts/commands/orchestrate.md +29 -6
- package/prompts/commands/pause-work.md +2 -1
- package/prompts/commands/plan-phase.md +6 -0
- package/prompts/commands/quick.md +6 -2
- package/prompts/commands/review.md +4 -1
- package/prompts/commands/verify-work.md +10 -8
package/docs/models.md
CHANGED
|
@@ -139,7 +139,7 @@ Set `api` at provider level (default for all models) or model level (override pe
|
|
|
139
139
|
| `headers` | Custom headers (see value resolution below) |
|
|
140
140
|
| `authHeader` | Set `true` to add `Authorization: Bearer <apiKey>` automatically |
|
|
141
141
|
| `models` | Array of model configurations |
|
|
142
|
-
| `modelOverrides` | Per-model overrides for built-in models on this provider |
|
|
142
|
+
| `modelOverrides` | Per-model overrides for built-in or extension-registered models on this provider |
|
|
143
143
|
|
|
144
144
|
### Value Resolution
|
|
145
145
|
|
|
@@ -205,22 +205,44 @@ If your command is slow, expensive, rate-limited, or should keep using a previou
|
|
|
205
205
|
| `input` | No | `["text"]` | Input types: `["text"]` or `["text", "image"]` |
|
|
206
206
|
| `contextWindow` | No | `128000` | Context window size in tokens |
|
|
207
207
|
| `maxTokens` | No | `16384` | Maximum output tokens |
|
|
208
|
-
| `cost` | No | all zeros |
|
|
208
|
+
| `cost` | No | all zeros | Per-million-token rates with optional request-wide input pricing tiers |
|
|
209
209
|
| `compat` | No | provider `compat` | Provider compatibility overrides. Merged with provider-level `compat` when both are set. |
|
|
210
210
|
|
|
211
|
+
A cost tier supplies a complete alternate rate set and applies to the full request when total input usage (`input + cacheRead + cacheWrite`) exceeds `inputTokensAbove`. When multiple tiers match, the highest threshold wins.
|
|
212
|
+
|
|
213
|
+
```json
|
|
214
|
+
{
|
|
215
|
+
"cost": {
|
|
216
|
+
"input": 5,
|
|
217
|
+
"output": 30,
|
|
218
|
+
"cacheRead": 0.5,
|
|
219
|
+
"cacheWrite": 6.25,
|
|
220
|
+
"tiers": [
|
|
221
|
+
{
|
|
222
|
+
"inputTokensAbove": 272000,
|
|
223
|
+
"input": 10,
|
|
224
|
+
"output": 45,
|
|
225
|
+
"cacheRead": 1,
|
|
226
|
+
"cacheWrite": 12.5
|
|
227
|
+
}
|
|
228
|
+
]
|
|
229
|
+
}
|
|
230
|
+
}
|
|
231
|
+
```
|
|
232
|
+
|
|
211
233
|
Current behavior:
|
|
212
234
|
- `/model`, `--list-models`, and the interactive footer display entries by model `id`.
|
|
213
235
|
- The configured `name` is used for model matching and secondary model detail text. It does not replace the footer/status-bar model id.
|
|
214
236
|
|
|
215
237
|
### Thinking Level Map
|
|
216
238
|
|
|
217
|
-
Use `thinkingLevelMap` on a model to describe model-specific thinking controls. Keys are pi thinking levels: `off`, `minimal`, `low`, `medium`, `high`, `xhigh`.
|
|
239
|
+
Use `thinkingLevelMap` on a model to describe model-specific thinking controls. Keys are pi thinking levels: `off`, `minimal`, `low`, `medium`, `high`, `xhigh`, `max`. Maps may contain holes; for example, a model can expose `high` and `max` without exposing `xhigh`.
|
|
218
240
|
|
|
219
241
|
Values are tristate:
|
|
220
242
|
|
|
221
243
|
| Value | Meaning |
|
|
222
244
|
|-------|---------|
|
|
223
|
-
| omitted |
|
|
245
|
+
| omitted | Standard levels through `high` use the provider's default mapping; extended `xhigh` and `max` levels are unsupported |
|
|
224
246
|
| string | Level is supported and this value is sent to the provider |
|
|
225
247
|
| `null` | Level is unsupported and hidden/skipped/clamped away |
|
|
226
248
|
|
|
@@ -235,7 +257,8 @@ Example for a model that only supports off, high, and max reasoning:
|
|
|
235
257
|
"low": null,
|
|
236
258
|
"medium": null,
|
|
237
259
|
"high": "high",
|
|
238
|
-
"xhigh":
|
|
260
|
+
"xhigh": null,
|
|
261
|
+
"max": "max"
|
|
239
262
|
}
|
|
240
263
|
}
|
|
241
264
|
```
|
|
@@ -293,7 +316,7 @@ Merge semantics:
|
|
|
293
316
|
|
|
294
317
|
## Per-model Overrides
|
|
295
318
|
|
|
296
|
-
Use `modelOverrides` to customize
|
|
319
|
+
Use `modelOverrides` to customize built-in models and matching extension-registered models without replacing the provider's full model list.
|
|
297
320
|
|
|
298
321
|
```json
|
|
299
322
|
{
|
|
@@ -314,10 +337,28 @@ Use `modelOverrides` to customize specific built-in models without replacing the
|
|
|
314
337
|
}
|
|
315
338
|
```
|
|
316
339
|
|
|
317
|
-
`modelOverrides` supports these fields per model: `name`, `reasoning`, `input`, `cost` (partial), `contextWindow`, `maxTokens`, `headers`, `compat`.
|
|
340
|
+
`modelOverrides` supports these fields per model: `name`, `reasoning`, `thinkingLevelMap`, `input`, `cost` (partial), `contextWindow`, `maxTokens`, `headers`, `compat`.
|
|
341
|
+
|
|
342
|
+
Direct OpenAI GPT-5.6 Sol, Terra, and Luna default to a `272000` context window so requests remain within OpenAI's short-context pricing tier. To opt into OpenAI's 1.05M context window, increase it for each model you use:
|
|
343
|
+
|
|
344
|
+
```json
|
|
345
|
+
{
|
|
346
|
+
"providers": {
|
|
347
|
+
"openai": {
|
|
348
|
+
"modelOverrides": {
|
|
349
|
+
"gpt-5.6-sol": {
|
|
350
|
+
"contextWindow": 1050000
|
|
351
|
+
}
|
|
352
|
+
}
|
|
353
|
+
}
|
|
354
|
+
}
|
|
355
|
+
}
|
|
356
|
+
```
|
|
357
|
+
|
|
358
|
+
The override preserves the built-in pricing metadata. Requests with more than 272K total input tokens use GPT-5.6's long-context rates for the entire request. Apply the same override to `gpt-5.6-terra` or `gpt-5.6-luna` when needed.
|
|
318
359
|
|
|
319
360
|
Behavior notes:
|
|
320
|
-
- `modelOverrides` are applied to built-in provider models.
|
|
361
|
+
- `modelOverrides` are applied to built-in provider models and matching extension-registered provider models.
|
|
321
362
|
- Unknown model IDs are ignored.
|
|
322
363
|
- You can combine provider-level `baseUrl`/`headers` with `modelOverrides`.
|
|
323
364
|
- Overriding `name` changes model matching and secondary detail text only; the footer and primary model lists continue to show the model `id`.
|
package/docs/rpc.md
CHANGED
|
@@ -286,9 +286,9 @@ Set the reasoning/thinking level for models that support it.
|
|
|
286
286
|
{"type": "set_thinking_level", "level": "high"}
|
|
287
287
|
```
|
|
288
288
|
|
|
289
|
-
Levels: `"off"`, `"minimal"`, `"low"`, `"medium"`, `"high"`, `"xhigh"`
|
|
289
|
+
Levels: `"off"`, `"minimal"`, `"low"`, `"medium"`, `"high"`, `"xhigh"`, `"max"`
|
|
290
290
|
|
|
291
|
-
|
|
291
|
+
`"xhigh"` and `"max"` are exposed only when supported by the selected model. Some models, including GPT-5.6, expose both.
|
|
292
292
|
|
|
293
293
|
Response:
|
|
294
294
|
```json
|
|
@@ -805,7 +805,8 @@ Events are streamed to stdout as JSON lines during agent operation. Events do NO
|
|
|
805
805
|
| Event | Description |
|
|
806
806
|
|-------|-------------|
|
|
807
807
|
| `agent_start` | Agent begins processing |
|
|
808
|
-
| `agent_end` |
|
|
808
|
+
| `agent_end` | One low-level agent run completes (may still be followed by retry, compaction, or queued continuations) |
|
|
809
|
+
| `agent_settled` | Agent run is fully settled; no automatic retry, compaction retry, or queued continuation remains |
|
|
809
810
|
| `turn_start` | New turn begins |
|
|
810
811
|
| `turn_end` | Turn completes (includes assistant message and tool results) |
|
|
811
812
|
| `message_start` | Message begins |
|
|
@@ -831,15 +832,24 @@ Emitted when the agent begins processing a prompt.
|
|
|
831
832
|
|
|
832
833
|
### agent_end
|
|
833
834
|
|
|
834
|
-
Emitted when
|
|
835
|
+
Emitted when one low-level agent run completes. Contains all messages generated during this run. If `willRetry` is true, an automatic retry will follow.
|
|
835
836
|
|
|
836
837
|
```json
|
|
837
838
|
{
|
|
838
839
|
"type": "agent_end",
|
|
839
|
-
"messages": [...]
|
|
840
|
+
"messages": [...],
|
|
841
|
+
"willRetry": false
|
|
840
842
|
}
|
|
841
843
|
```
|
|
842
844
|
|
|
845
|
+
### agent_settled
|
|
846
|
+
|
|
847
|
+
Emitted after the full session-level run settles. At this point Pi will not continue automatically through retry, compaction retry, or queued follow-up messages.
|
|
848
|
+
|
|
849
|
+
```json
|
|
850
|
+
{"type": "agent_settled"}
|
|
851
|
+
```
|
|
852
|
+
|
|
843
853
|
### turn_start / turn_end
|
|
844
854
|
|
|
845
855
|
A turn consists of one assistant response plus any resulting tool calls and results.
|
package/docs/sdk.md
CHANGED
|
@@ -387,7 +387,7 @@ const available = await modelRegistry.getAvailable();
|
|
|
387
387
|
|
|
388
388
|
const { session } = await createAgentSession({
|
|
389
389
|
model: opus,
|
|
390
|
-
thinkingLevel: "medium", // off, minimal, low, medium, high, xhigh
|
|
390
|
+
thinkingLevel: "medium", // off, minimal, low, medium, high, xhigh, max
|
|
391
391
|
|
|
392
392
|
// Models for cycling (Ctrl+P in interactive mode)
|
|
393
393
|
scopedModels: [
|
package/docs/settings.md
CHANGED
|
@@ -29,8 +29,9 @@ Use `/trust` in interactive mode to save a project trust decision for future ses
|
|
|
29
29
|
|---------|------|---------|-------------|
|
|
30
30
|
| `defaultProvider` | string | - | Default provider (e.g., `"anthropic"`, `"openai"`) |
|
|
31
31
|
| `defaultModel` | string | - | Default model ID |
|
|
32
|
-
| `defaultThinkingLevel` | string | - | `"off"`, `"minimal"`, `"low"`, `"medium"`, `"high"`, `"xhigh"` |
|
|
32
|
+
| `defaultThinkingLevel` | string | - | `"off"`, `"minimal"`, `"low"`, `"medium"`, `"high"`, `"xhigh"`, `"max"` |
|
|
33
33
|
| `hideThinkingBlock` | boolean | `false` | Hide thinking blocks in output |
|
|
34
|
+
| `showCacheMissNotices` | boolean | `false` | Show transcript notices for significant prompt-cache misses |
|
|
34
35
|
| `thinkingBudgets` | object | - | Custom token budgets per thinking level |
|
|
35
36
|
|
|
36
37
|
#### thinkingBudgets
|
|
@@ -172,7 +173,7 @@ Keep `retry.provider.maxRetries` at `0` unless provider-level retries are explic
|
|
|
172
173
|
|
|
173
174
|
| Setting | Type | Default | Description |
|
|
174
175
|
|---------|------|---------|-------------|
|
|
175
|
-
| `shellPath` | string | - | Custom shell path (e.g., for Cygwin on Windows) |
|
|
176
|
+
| `shellPath` | string | - | Custom shell path (e.g., for Cygwin on Windows); supports a leading `~` for the home directory |
|
|
176
177
|
| `shellCommandPrefix` | string | - | Prefix for every bash command (e.g., `"shopt -s expand_aliases"`) |
|
|
177
178
|
| `npmCommand` | string[] | - | Command argv used for npm package lookup/install operations (e.g., `["mise", "exec", "node@20", "--", "npm"]`) |
|
|
178
179
|
|
package/docs/themes.md
CHANGED
|
@@ -109,6 +109,7 @@ vim ~/.pi/agent/themes/my-theme.json
|
|
|
109
109
|
"thinkingMedium": "#00ffff",
|
|
110
110
|
"thinkingHigh": "#ff00ff",
|
|
111
111
|
"thinkingXhigh": "#ff0000",
|
|
112
|
+
"thinkingMax": "#ff0088",
|
|
112
113
|
"bashMode": "#ffaa00"
|
|
113
114
|
}
|
|
114
115
|
}
|
|
@@ -139,13 +140,13 @@ vim ~/.pi/agent/themes/my-theme.json
|
|
|
139
140
|
|
|
140
141
|
- `name` is required and must be unique.
|
|
141
142
|
- `vars` is optional. Define reusable colors here, then reference them in `colors`.
|
|
142
|
-
- `colors` must define all 51 required tokens.
|
|
143
|
+
- `colors` must define all 51 required tokens. `thinkingMax` is optional and falls back to `thinkingXhigh`.
|
|
143
144
|
|
|
144
145
|
The `$schema` field enables editor auto-completion and validation.
|
|
145
146
|
|
|
146
147
|
## Color Tokens
|
|
147
148
|
|
|
148
|
-
Every theme must define all 51 color tokens.
|
|
149
|
+
Every theme must define all 51 required color tokens. `thinkingMax` is optional for compatibility with existing themes; when omitted, it uses `thinkingXhigh`.
|
|
149
150
|
|
|
150
151
|
### Core UI (11 colors)
|
|
151
152
|
|
|
@@ -216,7 +217,7 @@ Every theme must define all 51 color tokens. There are no optional colors.
|
|
|
216
217
|
| `syntaxOperator` | Operators |
|
|
217
218
|
| `syntaxPunctuation` | Punctuation |
|
|
218
219
|
|
|
219
|
-
### Thinking Level Borders (6
|
|
220
|
+
### Thinking Level Borders (6 required, 1 optional)
|
|
220
221
|
|
|
221
222
|
Editor border colors indicating thinking level (visual hierarchy from subtle to prominent):
|
|
222
223
|
|
|
@@ -228,6 +229,7 @@ Editor border colors indicating thinking level (visual hierarchy from subtle to
|
|
|
228
229
|
| `thinkingMedium` | Medium thinking |
|
|
229
230
|
| `thinkingHigh` | High thinking |
|
|
230
231
|
| `thinkingXhigh` | Extra high thinking |
|
|
232
|
+
| `thinkingMax` | Maximum thinking; optional, falls back to `thinkingXhigh` |
|
|
231
233
|
|
|
232
234
|
### Bash Mode (1 color)
|
|
233
235
|
|
package/docs/tui.md
CHANGED
|
@@ -424,7 +424,7 @@ renderResult(result, options, theme, context) {
|
|
|
424
424
|
| Diffs | `toolDiffAdded`, `toolDiffRemoved`, `toolDiffContext` |
|
|
425
425
|
| Markdown | `mdHeading`, `mdLink`, `mdLinkUrl`, `mdCode`, `mdCodeBlock`, `mdCodeBlockBorder`, `mdQuote`, `mdQuoteBorder`, `mdHr`, `mdListBullet` |
|
|
426
426
|
| Syntax | `syntaxComment`, `syntaxKeyword`, `syntaxFunction`, `syntaxVariable`, `syntaxString`, `syntaxNumber`, `syntaxType`, `syntaxOperator`, `syntaxPunctuation` |
|
|
427
|
-
| Thinking | `thinkingOff`, `thinkingMinimal`, `thinkingLow`, `thinkingMedium`, `thinkingHigh`, `thinkingXhigh` |
|
|
427
|
+
| Thinking | `thinkingOff`, `thinkingMinimal`, `thinkingLow`, `thinkingMedium`, `thinkingHigh`, `thinkingXhigh`, `thinkingMax` |
|
|
428
428
|
| Modes | `bashMode` |
|
|
429
429
|
|
|
430
430
|
**Background colors** (`theme.bg(color, text)`):
|
package/docs/usage.md
CHANGED
|
@@ -50,7 +50,7 @@ Type `/` in the editor to open command completion. Extensions can register custo
|
|
|
50
50
|
| `/copy` | Copy last assistant message to clipboard |
|
|
51
51
|
| `/export [file]` | Export session to HTML |
|
|
52
52
|
| `/share` | Upload as private GitHub gist with shareable HTML link |
|
|
53
|
-
| `/reload` | Reload keybindings, extensions, skills, prompts, and context files |
|
|
53
|
+
| `/reload` | Reload keybindings, extensions, skills, prompts, themes, and context files |
|
|
54
54
|
| `/hotkeys` | Show all keyboard shortcuts |
|
|
55
55
|
| `/changelog` | Display version history |
|
|
56
56
|
| `/quit` | Quit pi |
|
|
@@ -180,7 +180,7 @@ cat README.md | pi -p "Summarize this text"
|
|
|
180
180
|
| `--provider <name>` | Provider, such as `anthropic`, `openai`, or `google` |
|
|
181
181
|
| `--model <pattern>` | Model pattern or ID; supports `provider/id` and optional `:<thinking>` |
|
|
182
182
|
| `--api-key <key>` | API key, overriding environment variables |
|
|
183
|
-
| `--thinking <level>` | `off`, `minimal`, `low`, `medium`, `high`, `xhigh` |
|
|
183
|
+
| `--thinking <level>` | `off`, `minimal`, `low`, `medium`, `high`, `xhigh`, `max` |
|
|
184
184
|
| `--models <patterns>` | Comma-separated patterns for Ctrl+P cycling |
|
|
185
185
|
| `--list-models [search]` | List available models |
|
|
186
186
|
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "pi-extension-custom-provider",
|
|
3
|
-
"version": "0.80.
|
|
3
|
+
"version": "0.80.6",
|
|
4
4
|
"lockfileVersion": 3,
|
|
5
5
|
"requires": true,
|
|
6
6
|
"packages": {
|
|
7
7
|
"": {
|
|
8
8
|
"name": "pi-extension-custom-provider",
|
|
9
|
-
"version": "0.80.
|
|
9
|
+
"version": "0.80.6",
|
|
10
10
|
"dependencies": {
|
|
11
11
|
"@anthropic-ai/sdk": "^0.52.0"
|
|
12
12
|
}
|
|
@@ -52,7 +52,7 @@ interface Preset {
|
|
|
52
52
|
/** Model ID (e.g., "claude-sonnet-4-5") */
|
|
53
53
|
model?: string;
|
|
54
54
|
/** Thinking level */
|
|
55
|
-
thinkingLevel?: "off" | "minimal" | "low" | "medium" | "high" | "xhigh";
|
|
55
|
+
thinkingLevel?: "off" | "minimal" | "low" | "medium" | "high" | "xhigh" | "max";
|
|
56
56
|
/** Tools to enable (replaces default set) */
|
|
57
57
|
tools?: string[];
|
|
58
58
|
/** Instructions to append to system prompt */
|
|
@@ -100,7 +100,7 @@ function loadPresets(cwd: string): PresetsConfig {
|
|
|
100
100
|
|
|
101
101
|
interface OriginalState {
|
|
102
102
|
model: Model<Api> | undefined;
|
|
103
|
-
thinkingLevel: "off" | "minimal" | "low" | "medium" | "high" | "xhigh";
|
|
103
|
+
thinkingLevel: "off" | "minimal" | "low" | "medium" | "high" | "xhigh" | "max";
|
|
104
104
|
tools: string[];
|
|
105
105
|
}
|
|
106
106
|
|
|
@@ -12,7 +12,7 @@ export default function (pi: ExtensionAPI) {
|
|
|
12
12
|
// Command entrypoint for reload.
|
|
13
13
|
// Treat reload as terminal for this handler.
|
|
14
14
|
pi.registerCommand("reload-runtime", {
|
|
15
|
-
description: "Reload extensions, skills, prompts, and
|
|
15
|
+
description: "Reload extensions, skills, prompts, themes, and context files",
|
|
16
16
|
handler: async (_args, ctx) => {
|
|
17
17
|
await ctx.reload();
|
|
18
18
|
return;
|
|
@@ -24,7 +24,7 @@ export default function (pi: ExtensionAPI) {
|
|
|
24
24
|
pi.registerTool({
|
|
25
25
|
name: "reload_runtime",
|
|
26
26
|
label: "Reload Runtime",
|
|
27
|
-
description: "Reload extensions, skills, prompts, and
|
|
27
|
+
description: "Reload extensions, skills, prompts, themes, and context files",
|
|
28
28
|
parameters: Type.Object({}),
|
|
29
29
|
async execute() {
|
|
30
30
|
pi.sendUserMessage("/reload-runtime", { deliverAs: "followUp" });
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "pi-extension-sandbox",
|
|
3
|
-
"version": "1.10.
|
|
3
|
+
"version": "1.10.6",
|
|
4
4
|
"lockfileVersion": 3,
|
|
5
5
|
"requires": true,
|
|
6
6
|
"packages": {
|
|
7
7
|
"": {
|
|
8
8
|
"name": "pi-extension-sandbox",
|
|
9
|
-
"version": "1.10.
|
|
9
|
+
"version": "1.10.6",
|
|
10
10
|
"dependencies": {
|
|
11
11
|
"@anthropic-ai/sandbox-runtime": "^0.0.26"
|
|
12
12
|
}
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "pi-extension-with-deps",
|
|
3
|
-
"version": "0.80.
|
|
3
|
+
"version": "0.80.6",
|
|
4
4
|
"lockfileVersion": 3,
|
|
5
5
|
"requires": true,
|
|
6
6
|
"packages": {
|
|
7
7
|
"": {
|
|
8
8
|
"name": "pi-extension-with-deps",
|
|
9
|
-
"version": "0.80.
|
|
9
|
+
"version": "0.80.6",
|
|
10
10
|
"dependencies": {
|
|
11
11
|
"ms": "^2.1.3"
|
|
12
12
|
},
|
package/examples/sdk/README.md
CHANGED
|
@@ -119,7 +119,7 @@ await session.prompt("Hello");
|
|
|
119
119
|
| `thinkingLevel` | From settings/"off" | off, low, medium, high |
|
|
120
120
|
| `tools` | `codingTools` | Built-in tools |
|
|
121
121
|
| `customTools` | `[]` | Additional tool definitions |
|
|
122
|
-
| `resourceLoader` | DefaultResourceLoader | Resource loader for extensions, skills, prompts, themes |
|
|
122
|
+
| `resourceLoader` | DefaultResourceLoader | Resource loader for extensions, skills, prompts, themes, and context files |
|
|
123
123
|
| `sessionManager` | `SessionManager.create(cwd)` | Persistence |
|
|
124
124
|
| `settingsManager` | `SettingsManager.create(cwd, agentDir)` | Settings overrides |
|
|
125
125
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@draht/coding-agent",
|
|
3
|
-
"version": "2026.7.
|
|
3
|
+
"version": "2026.7.11",
|
|
4
4
|
"description": "Coding agent CLI with read, bash, edit, write tools and session management",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"drahtConfig": {
|
|
@@ -46,10 +46,10 @@
|
|
|
46
46
|
},
|
|
47
47
|
"dependencies": {
|
|
48
48
|
"@mariozechner/jiti": "^2.6.2",
|
|
49
|
-
"@draht/agent-core": "2026.7.
|
|
50
|
-
"@draht/ai": "2026.7.
|
|
51
|
-
"@draht/tools": "2026.7.
|
|
52
|
-
"@draht/tui": "2026.7.
|
|
49
|
+
"@draht/agent-core": "2026.7.11",
|
|
50
|
+
"@draht/ai": "2026.7.11",
|
|
51
|
+
"@draht/tools": "2026.7.11",
|
|
52
|
+
"@draht/tui": "2026.7.11",
|
|
53
53
|
"@silvia-odwyer/photon-node": "^0.3.4",
|
|
54
54
|
"@sinclair/typebox": "^0.34.41",
|
|
55
55
|
"chalk": "^5.6.2",
|
package/prompts/agents/build.md
CHANGED
|
@@ -13,6 +13,33 @@ You are an execution agent. Your job is to implement plans precisely.
|
|
|
13
13
|
4. Commit after each task: `draht commit-task N P T "description"`
|
|
14
14
|
5. If verification fails, fix it before continuing
|
|
15
15
|
6. Never skip a verify step — that's how quality dies
|
|
16
|
+
7. If a plan instruction contradicts what you find in the code, STOP and report `NEEDS_CONTEXT` — do not silently obey either side
|
|
17
|
+
|
|
18
|
+
## Evidence, Not Plausibility
|
|
19
|
+
|
|
20
|
+
A step is done when you have watched it be done.
|
|
21
|
+
|
|
22
|
+
**Procedure:**
|
|
23
|
+
1. "Verified" means you ran the command and read the output in this session — not that the code looks right.
|
|
24
|
+
2. Quote the decisive line of output in your summary: test counts, exit codes, the actual error text.
|
|
25
|
+
3. If you did not run it, write "not verified" — never let a plausible claim wear a verified claim's clothes.
|
|
26
|
+
|
|
27
|
+
**Example:** after implementing a parser, "bun test parser: 14 pass, 0 fail" is evidence; "the parser now handles all cases" is a guess in a suit.
|
|
28
|
+
|
|
29
|
+
**Prevents:** reporting a green build nobody ever ran.
|
|
30
|
+
|
|
31
|
+
## Competence Mimics
|
|
32
|
+
|
|
33
|
+
These feel like progress and are not:
|
|
34
|
+
|
|
35
|
+
| Looks like competence | Is actually |
|
|
36
|
+
|---|---|
|
|
37
|
+
| A test that passes on first run | Probably asserts nothing — break the code, watch it fail (red first) |
|
|
38
|
+
| A large diff | Unreviewable risk; the plan asked for the minimal green change |
|
|
39
|
+
| "Refactored while I was in there" | Scope drift that hides which change broke what |
|
|
40
|
+
| A confident summary of a file you skimmed | A guess — read it or say you didn't |
|
|
41
|
+
| Silencing a failing check to keep moving | Deleting the only warning you'll get |
|
|
42
|
+
| Obeying the plan where it contradicts the code | The code is reality — report the conflict |
|
|
16
43
|
|
|
17
44
|
## Tools Available
|
|
18
45
|
- `draht read-plan N P` — read the plan to execute
|
|
@@ -35,6 +62,9 @@ You are an execution agent. Your job is to implement plans precisely.
|
|
|
35
62
|
4. Fill in the summary with actual commits, files changed, notes
|
|
36
63
|
5. After all plans in phase: `draht verify-phase N`
|
|
37
64
|
|
|
65
|
+
## Summary Format
|
|
66
|
+
Verdict first (what state is the plan in), then evidence (quoted verify output per task), then remaining risk (what you did not verify, labeled as such). Never bury a failed task under completed ones.
|
|
67
|
+
|
|
38
68
|
## Checkpoint Handling
|
|
39
69
|
- `type="auto"` → execute silently
|
|
40
70
|
- `type="checkpoint:human-verify"` → STOP, show what was built, ask for confirmation
|
|
@@ -46,3 +76,11 @@ If a task fails 3 times:
|
|
|
46
76
|
2. Mark task as failed
|
|
47
77
|
3. Continue to next task (unless it depends on the failed one)
|
|
48
78
|
4. Note the failure for fix planning
|
|
79
|
+
|
|
80
|
+
## Send Gate — run before finishing
|
|
81
|
+
|
|
82
|
+
1. **Asked** — did you build what the plan's <done> describes, not just what its literal steps said?
|
|
83
|
+
2. **Evidence** — does every "done" claim quote the output that proves it, with unrun checks labeled "not verified"?
|
|
84
|
+
3. **Attacked** — did each test fail before the implementation made it pass?
|
|
85
|
+
4. **Ordered** — verdict first, evidence second, remaining risk last?
|
|
86
|
+
5. **Wrongness** — if this work is broken, where is it most likely — and did you run that path?
|
package/prompts/agents/plan.md
CHANGED
|
@@ -12,6 +12,34 @@ You are a planning agent. Your job is to create atomic, executable plans.
|
|
|
12
12
|
3. Maximum 5 tasks per plan
|
|
13
13
|
4. Goal-backward: start from "what must be TRUE" not "what should we build"
|
|
14
14
|
5. Every task needs <verify> and <done> — no ambiguity
|
|
15
|
+
6. A task is atomic only if its <verify> can fail while every other task passes — if two tasks can only be checked together, they are one task
|
|
16
|
+
7. Every assumption a plan rests on gets an explicit `Assumes:` line (with how to confirm it) in the plan header — unwritten assumptions become the executor's bugs
|
|
17
|
+
|
|
18
|
+
## Read the Goal Beneath the Goal
|
|
19
|
+
|
|
20
|
+
The phase description says what to build; the plan must capture what must become true.
|
|
21
|
+
|
|
22
|
+
**Procedure:**
|
|
23
|
+
1. Restate the phase goal as the change in the user's world: "after this phase, a user can X."
|
|
24
|
+
2. If the goal names a mechanism ("add Redis caching"), find the outcome behind it ("p95 under 200ms") and plan toward the outcome — the mechanism is a candidate, not a requirement.
|
|
25
|
+
3. If you cannot state the outcome, the phase is not plannable yet — report `NEEDS_CONTEXT` instead of planning the mechanism.
|
|
26
|
+
|
|
27
|
+
**Example:** "add retry logic to the sync job" → the outcome is "syncs recover from transient failures without human help." That truth may need idempotency more than retries; a plan built on the literal words ships retries that double-write.
|
|
28
|
+
|
|
29
|
+
**Prevents:** precisely executing the wrong plan.
|
|
30
|
+
|
|
31
|
+
## Risk-First Ordering
|
|
32
|
+
|
|
33
|
+
Not all tasks deserve equal effort or the same position in the sequence.
|
|
34
|
+
|
|
35
|
+
**Procedure:**
|
|
36
|
+
1. For each observable truth, score uncertainty (has this codebase done it before?) and blast radius (how much of the plan is invalid if it's wrong?).
|
|
37
|
+
2. Order plans and tasks so the highest uncertainty × blast-radius truth is proven first.
|
|
38
|
+
3. Boilerplate goes last — it never invalidates a plan; the risky part regularly does.
|
|
39
|
+
|
|
40
|
+
**Example:** a phase needs a third-party webhook plus a settings UI. The webhook contract is the risk: plan 1 proves an end-to-end webhook round-trip; the UI waits.
|
|
41
|
+
|
|
42
|
+
**Prevents:** discovering in task 9 that the foundation under tasks 1–8 cannot work.
|
|
15
43
|
|
|
16
44
|
## Tools Available
|
|
17
45
|
- `draht load-phase-context N` — gather all context for a phase
|
|
@@ -41,3 +69,11 @@ You are a planning agent. Your job is to create atomic, executable plans.
|
|
|
41
69
|
```
|
|
42
70
|
|
|
43
71
|
Task types: auto, checkpoint:human-verify, checkpoint:decision
|
|
72
|
+
|
|
73
|
+
## Send Gate — run before finishing
|
|
74
|
+
|
|
75
|
+
1. **Asked** — do the plans produce the outcome behind the request, not just its literal words?
|
|
76
|
+
2. **Evidence** — is every claim about the codebase something you read, with assumptions written as `Assumes:` lines?
|
|
77
|
+
3. **Attacked** — did you try to break your own decomposition (a truth with no task, a task with no independent check)?
|
|
78
|
+
4. **Ordered** — does the riskiest truth get proven first?
|
|
79
|
+
5. **Wrongness** — if these plans fail, where is it most likely — and does a task check exactly there?
|
package/prompts/agents/verify.md
CHANGED
|
@@ -12,6 +12,28 @@ You are a verification agent. Your job is to test completed work against accepta
|
|
|
12
12
|
3. Be honest — if something doesn't work, say so
|
|
13
13
|
4. Create fix plans for failures, don't just report them
|
|
14
14
|
|
|
15
|
+
## Re-Derive, Don't Trust
|
|
16
|
+
|
|
17
|
+
A claim is verified when you have reproduced it, not when it sounds right.
|
|
18
|
+
|
|
19
|
+
**Procedure:**
|
|
20
|
+
1. Never accept a summary's claim ("tests pass", "endpoint works") — re-run the command yourself and read the output.
|
|
21
|
+
2. Every pass verdict cites its observed evidence: the command you ran and the decisive output line.
|
|
22
|
+
3. For each pass, attempt one break: an input, sequence, or state the implementer probably didn't try. A pass you haven't tried to break is only "not yet failed".
|
|
23
|
+
|
|
24
|
+
**Example:** the summary says "auth middleware verified." You re-run the suite — it passes. Then you request a route with an expired token: 500 instead of 401. The claim was true and the work was still broken.
|
|
25
|
+
|
|
26
|
+
**Prevents:** rubber-stamp verification — trust laundered into evidence.
|
|
27
|
+
|
|
28
|
+
## Known vs Guessed
|
|
29
|
+
|
|
30
|
+
Label every statement in your report:
|
|
31
|
+
- **observed** — you ran it and saw it
|
|
32
|
+
- **derived** — follows necessarily from something observed
|
|
33
|
+
- **assumed** — believed but unchecked, with what would check it
|
|
34
|
+
|
|
35
|
+
A verdict inherits the weakest label it rests on: an "assumed pass" is not a pass — test it or mark the deliverable partial.
|
|
36
|
+
|
|
15
37
|
## Tools Available
|
|
16
38
|
- `draht extract-deliverables N` — list testable items
|
|
17
39
|
- `draht create-fix-plan N P "issue"` — create fix plan for failures
|
|
@@ -31,7 +53,17 @@ You are a verification agent. Your job is to test completed work against accepta
|
|
|
31
53
|
5. Update state: `draht update-state`
|
|
32
54
|
|
|
33
55
|
## Output
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
56
|
+
Answer first, reasoning second, risk last:
|
|
57
|
+
1. **Verdict** — X/Y passed, phase pass/fail, in the first line
|
|
58
|
+
2. **Evidence** — per deliverable: what you ran, what you observed, its label (observed/derived/assumed)
|
|
59
|
+
3. **Risk** — what was NOT tested and how it could bite; fix plans created; recommended next action
|
|
60
|
+
|
|
61
|
+
Never bury a failure under a list of passes.
|
|
62
|
+
|
|
63
|
+
## Send Gate — run before finishing
|
|
64
|
+
|
|
65
|
+
1. **Asked** — did you test what the user needs to be true, not just what the developer built?
|
|
66
|
+
2. **Evidence** — is every pass backed by output you personally observed this session?
|
|
67
|
+
3. **Attacked** — did you try to break each pass at least once?
|
|
68
|
+
4. **Ordered** — verdict first, evidence second, risk last?
|
|
69
|
+
5. **Wrongness** — if this UAT is wrong, which verdict is most likely the false one — and did you re-check it?
|
|
@@ -27,6 +27,19 @@ Before asking anything, decompose the idea into atomic reasoning units:
|
|
|
27
27
|
- Surface 2–3 approaches with trade-offs before committing
|
|
28
28
|
- Record decisions (not proposals) in a spec file
|
|
29
29
|
|
|
30
|
+
## Hear the Problem Beneath the Ask
|
|
31
|
+
|
|
32
|
+
The user's words describe an artifact; the design must serve a need. They are rarely the same thing.
|
|
33
|
+
|
|
34
|
+
**Procedure:**
|
|
35
|
+
1. Separate the stated artifact ("a dashboard") from the underlying need — what decision, pain, or moment does it serve?
|
|
36
|
+
2. When the user names a solution, ask what it solves before refining it. Solutions stay candidates until the need is confirmed.
|
|
37
|
+
3. State the need back in one sentence ("so the real problem is X — right?") and get an explicit yes before proposing any approach.
|
|
38
|
+
|
|
39
|
+
**Example:** "I want an admin dashboard" → questioning reveals they check one number, once a week → a scheduled email beats the dashboard by a month of build time.
|
|
40
|
+
|
|
41
|
+
**Prevents:** a polished spec for the wrong artifact.
|
|
42
|
+
|
|
30
43
|
## The Hard Gate
|
|
31
44
|
|
|
32
45
|
> Do NOT invoke any planning command, write any code, scaffold any project, or take any implementation action until you have:
|
|
@@ -102,13 +115,14 @@ The file should include:
|
|
|
102
115
|
|
|
103
116
|
### 6. Self-Review the Written Spec
|
|
104
117
|
|
|
105
|
-
Before handing off,
|
|
118
|
+
Before handing off, attack the spec as if you were paid to kill it:
|
|
106
119
|
- Contradictions between sections (the goal says X, the architecture implies not-X)
|
|
107
120
|
- Gaps (a user story with no architectural support)
|
|
108
121
|
- Premature commitments (specific tech choices made before they were needed)
|
|
109
122
|
- Domain language drift (different names for the same thing)
|
|
123
|
+
- The strongest case the whole design is wrong — wrong scope, wrong user, or already exists as a simpler tool. Write that case and why the design survives it into the spec's Open Questions.
|
|
110
124
|
|
|
111
|
-
Report any findings to the user and update before proceeding.
|
|
125
|
+
Report any findings to the user and update before proceeding. A spec that was never attacked has never been tested.
|
|
112
126
|
|
|
113
127
|
### 7. Hand Off
|
|
114
128
|
|
|
@@ -33,7 +33,7 @@ Before questioning, decompose this phase scope into atomic reasoning units:
|
|
|
33
33
|
2. Identify gray areas based on what's being built
|
|
34
34
|
3. Present 1-2 questions at a time about preferences
|
|
35
35
|
4. If `.planning/DOMAIN.md` exists, load it and validate discovered terms against the glossary. Add any new domain terms found during discussion.
|
|
36
|
-
5. Record decisions with `draht-tools save-context $1`
|
|
36
|
+
5. Record decisions with `draht-tools save-context $1` — label each entry **decided** (the user explicitly chose) or **assumed** (you inferred from context). Assumed entries are flagged for confirmation; a plan built on an unlabeled assumption fails silently later.
|
|
37
37
|
6. Commit: `draht-tools commit-docs "capture phase $1 context"`
|
|
38
38
|
|
|
39
39
|
## Workflow
|