@draht/coding-agent 2026.4.23 → 2026.4.25-1
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 +14 -0
- package/README.md +91 -91
- package/dist/cli/args.d.ts.map +1 -1
- package/dist/cli/args.js +2 -2
- package/dist/cli/args.js.map +1 -1
- package/dist/core/agent-session.d.ts +4 -0
- package/dist/core/agent-session.d.ts.map +1 -1
- package/dist/core/agent-session.js +14 -4
- package/dist/core/agent-session.js.map +1 -1
- package/dist/core/model-registry.d.ts.map +1 -1
- package/dist/core/model-registry.js +1 -0
- package/dist/core/model-registry.js.map +1 -1
- package/dist/core/prompt-templates.d.ts.map +1 -1
- package/dist/core/prompt-templates.js +23 -1
- package/dist/core/prompt-templates.js.map +1 -1
- package/dist/core/settings-manager.d.ts +3 -3
- package/dist/core/settings-manager.d.ts.map +1 -1
- package/dist/core/settings-manager.js.map +1 -1
- package/dist/index.d.ts +2 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -0
- package/dist/index.js.map +1 -1
- package/dist/main.d.ts.map +1 -1
- package/dist/main.js +4 -1
- package/dist/main.js.map +1 -1
- package/dist/modes/interactive/components/settings-selector.d.ts.map +1 -1
- package/dist/modes/interactive/components/settings-selector.js +1 -0
- package/dist/modes/interactive/components/settings-selector.js.map +1 -1
- package/dist/modes/interactive/components/thinking-selector.d.ts.map +1 -1
- package/dist/modes/interactive/components/thinking-selector.js +1 -0
- package/dist/modes/interactive/components/thinking-selector.js.map +1 -1
- package/dist/modes/interactive/interactive-mode.d.ts.map +1 -1
- package/dist/modes/interactive/interactive-mode.js +17 -1
- package/dist/modes/interactive/interactive-mode.js.map +1 -1
- package/dist/modes/interactive/theme/dark.json +8 -5
- package/dist/modes/interactive/theme/light.json +8 -5
- package/dist/modes/interactive/theme/theme-schema.json +6 -1
- package/dist/modes/interactive/theme/theme.d.ts +2 -2
- package/dist/modes/interactive/theme/theme.d.ts.map +1 -1
- package/dist/modes/interactive/theme/theme.js +4 -1
- package/dist/modes/interactive/theme/theme.js.map +1 -1
- package/dist/prompts/commands/orchestrate.md +57 -0
- package/package.json +4 -4
- package/prompts/commands/orchestrate.md +57 -0
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
*/
|
|
15
15
|
import { existsSync, mkdirSync, readFileSync, writeFileSync } from "node:fs";
|
|
16
16
|
import { basename, dirname, join, resolve } from "node:path";
|
|
17
|
-
import { isContextOverflow, modelsAreEqual, resetApiProviders, supportsXhigh } from "@draht/ai";
|
|
17
|
+
import { isContextOverflow, modelsAreEqual, resetApiProviders, supportsMax, supportsXhigh } from "@draht/ai";
|
|
18
18
|
import { getDocsPath } from "../config.js";
|
|
19
19
|
import { theme } from "../modes/interactive/theme/theme.js";
|
|
20
20
|
import { stripFrontmatter } from "../utils/frontmatter.js";
|
|
@@ -54,6 +54,8 @@ export function parseSkillBlock(text) {
|
|
|
54
54
|
const THINKING_LEVELS = ["off", "minimal", "low", "medium", "high"];
|
|
55
55
|
/** Thinking levels including xhigh (for supported models) */
|
|
56
56
|
const THINKING_LEVELS_WITH_XHIGH = ["off", "minimal", "low", "medium", "high", "xhigh"];
|
|
57
|
+
/** Thinking levels including xhigh and max (Anthropic Opus only) */
|
|
58
|
+
const THINKING_LEVELS_WITH_MAX = ["off", "minimal", "low", "medium", "high", "xhigh", "max"];
|
|
57
59
|
// ============================================================================
|
|
58
60
|
// AgentSession Class
|
|
59
61
|
// ============================================================================
|
|
@@ -1161,6 +1163,8 @@ export class AgentSession {
|
|
|
1161
1163
|
getAvailableThinkingLevels() {
|
|
1162
1164
|
if (!this.supportsThinking())
|
|
1163
1165
|
return ["off"];
|
|
1166
|
+
if (this.supportsMaxThinking())
|
|
1167
|
+
return THINKING_LEVELS_WITH_MAX;
|
|
1164
1168
|
return this.supportsXhighThinking() ? THINKING_LEVELS_WITH_XHIGH : THINKING_LEVELS;
|
|
1165
1169
|
}
|
|
1166
1170
|
/**
|
|
@@ -1169,6 +1173,12 @@ export class AgentSession {
|
|
|
1169
1173
|
supportsXhighThinking() {
|
|
1170
1174
|
return this.model ? supportsXhigh(this.model) : false;
|
|
1171
1175
|
}
|
|
1176
|
+
/**
|
|
1177
|
+
* Check if current model supports the `max` thinking level (Anthropic Opus 4.6/4.7 only).
|
|
1178
|
+
*/
|
|
1179
|
+
supportsMaxThinking() {
|
|
1180
|
+
return this.model ? supportsMax(this.model) : false;
|
|
1181
|
+
}
|
|
1172
1182
|
/**
|
|
1173
1183
|
* Check if current model supports thinking/reasoning.
|
|
1174
1184
|
*/
|
|
@@ -1185,7 +1195,7 @@ export class AgentSession {
|
|
|
1185
1195
|
return this.thinkingLevel;
|
|
1186
1196
|
}
|
|
1187
1197
|
_clampThinkingLevel(level, availableLevels) {
|
|
1188
|
-
const ordered =
|
|
1198
|
+
const ordered = THINKING_LEVELS_WITH_MAX;
|
|
1189
1199
|
const available = new Set(availableLevels);
|
|
1190
1200
|
const requestedIndex = ordered.indexOf(level);
|
|
1191
1201
|
if (requestedIndex === -1) {
|
|
@@ -1912,8 +1922,8 @@ export class AgentSession {
|
|
|
1912
1922
|
if (isContextOverflow(message, contextWindow))
|
|
1913
1923
|
return false;
|
|
1914
1924
|
const err = message.errorMessage;
|
|
1915
|
-
// Match: overloaded_error, provider returned error, rate limit, 429, 500, 502, 503, 504, service unavailable, network/connection errors, fetch failed, request ended without sending chunks, terminated, retry delay exceeded
|
|
1916
|
-
return /overloaded|provider.?returned.?error|rate.?limit|too many requests|429|500|502|503|504|service.?unavailable|server.?error|internal.?error|network.?error|connection.?error|connection.?refused|other side closed|fetch failed|upstream.?connect|reset before headers|socket hang up|ended without|timed? out|timeout|terminated|retry delay/i.test(err);
|
|
1925
|
+
// Match: overloaded_error, provider returned error, rate limit, 429, 500, 502, 503, 504, service unavailable, network/connection errors, fetch failed, request ended without sending chunks, terminated, retry delay exceeded, peer-closed/incomplete-chunked stream truncations
|
|
1926
|
+
return /overloaded|provider.?returned.?error|rate.?limit|too many requests|429|500|502|503|504|service.?unavailable|server.?error|internal.?error|network.?error|connection.?error|connection.?refused|connection.?reset|peer closed|other side closed|fetch failed|upstream.?connect|reset before headers|socket hang up|ended without|incomplete.?chunked.?read|chunked.?read|premature.?close|timed? out|timeout|terminated|retry delay/i.test(err);
|
|
1917
1927
|
}
|
|
1918
1928
|
/**
|
|
1919
1929
|
* Handle retryable errors with exponential backoff.
|