@ai-sdk/harness-claude-code 1.0.172 → 1.0.174
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 +19 -0
- package/dist/bridge/index.mjs +19 -0
- package/dist/bridge/index.mjs.map +1 -1
- package/dist/index.d.ts +5 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +13 -2
- package/dist/index.js.map +1 -1
- package/package.json +4 -4
- package/src/bridge/index.ts +26 -0
- package/src/claude-code-bridge-protocol.ts +6 -0
- package/src/claude-code-harness.ts +13 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,24 @@
|
|
|
1
1
|
# @ai-sdk/harness-claude-code
|
|
2
2
|
|
|
3
|
+
## 1.0.174
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- 31d83e2: feat(harness-claude-code): support `skillOverrides` adapter setting for selective skill overrides
|
|
8
|
+
- @ai-sdk/harness@1.0.170
|
|
9
|
+
|
|
10
|
+
## 1.0.173
|
|
11
|
+
|
|
12
|
+
### Patch Changes
|
|
13
|
+
|
|
14
|
+
- edd4d4f: fix(harness-claude-code): correctly map dotted AI Gateway model IDs to the ID shapes Claude Code expects
|
|
15
|
+
- Updated dependencies [7716e18]
|
|
16
|
+
- Updated dependencies [5c247e9]
|
|
17
|
+
- Updated dependencies [dcd2f8d]
|
|
18
|
+
- @ai-sdk/provider-utils@5.0.72
|
|
19
|
+
- @ai-sdk/provider@4.0.35
|
|
20
|
+
- @ai-sdk/harness@1.0.169
|
|
21
|
+
|
|
3
22
|
## 1.0.172
|
|
4
23
|
|
|
5
24
|
### Patch Changes
|
package/dist/bridge/index.mjs
CHANGED
|
@@ -1603,6 +1603,18 @@ function createPermissionSettings(input) {
|
|
|
1603
1603
|
sandbox: { autoAllowBashIfSandboxed: false }
|
|
1604
1604
|
};
|
|
1605
1605
|
}
|
|
1606
|
+
/**
|
|
1607
|
+
* Claude Code picks a model's output limit, system prompt and default effort
|
|
1608
|
+
* from its own reading of the model id, and misreads AI Gateway ids with a
|
|
1609
|
+
* dotted version such as `anthropic/claude-opus-5.5`. `modelOverrides` maps
|
|
1610
|
+
* the id Claude Code expects (`claude-opus-5-5`) to the gateway id, which
|
|
1611
|
+
* stays the id sent to the gateway.
|
|
1612
|
+
*/
|
|
1613
|
+
function createGatewayModelOverrides(model) {
|
|
1614
|
+
if (!model?.startsWith("anthropic/")) return void 0;
|
|
1615
|
+
const id = model.slice(10).replace(/\[[^\]]*\]$/, "");
|
|
1616
|
+
return id.includes(".") ? { [id.replace(/\./g, "-")]: model } : void 0;
|
|
1617
|
+
}
|
|
1606
1618
|
function needsHostApproval(input) {
|
|
1607
1619
|
if (input.toolName.startsWith("mcp__harness-tools__")) return false;
|
|
1608
1620
|
return input.inactiveNativeTools.has(input.toolName) || nativeToolRequiresApproval({
|
|
@@ -1775,6 +1787,7 @@ async function runTurn(start, turn) {
|
|
|
1775
1787
|
approvalRequestedToolUseIds: streamEventState.approvalRequestedToolUseIds,
|
|
1776
1788
|
emittedToolCallIds: streamEventState.emittedToolCallIds
|
|
1777
1789
|
});
|
|
1790
|
+
const modelOverrides = createGatewayModelOverrides(start.model);
|
|
1778
1791
|
const deferredToolUseIds = /* @__PURE__ */ new Set();
|
|
1779
1792
|
const approvalPreToolUseHook = createApprovalPreToolUseHook({
|
|
1780
1793
|
permissionMode,
|
|
@@ -1783,6 +1796,11 @@ async function runTurn(start, turn) {
|
|
|
1783
1796
|
deferredToolUseIds,
|
|
1784
1797
|
nativeToolCallNames: streamEventState.nativeToolCallNames
|
|
1785
1798
|
});
|
|
1799
|
+
const settings = {
|
|
1800
|
+
...permissionOptions.settings,
|
|
1801
|
+
...start.skillOverrides !== void 0 ? { skillOverrides: start.skillOverrides } : {},
|
|
1802
|
+
...modelOverrides ? { modelOverrides } : {}
|
|
1803
|
+
};
|
|
1786
1804
|
const questionPreToolUseHook = createQuestionPreToolUseHook({
|
|
1787
1805
|
turn,
|
|
1788
1806
|
emit,
|
|
@@ -1834,6 +1852,7 @@ async function runTurn(start, turn) {
|
|
|
1834
1852
|
},
|
|
1835
1853
|
...start.resumeSessionId ?? lastClaudeSessionId ? { resume: start.resumeSessionId ?? lastClaudeSessionId } : start.continue === true || !turn.firstTurn ? { continue: true } : {},
|
|
1836
1854
|
...permissionOptions,
|
|
1855
|
+
...Object.keys(settings).length > 0 ? { settings } : {},
|
|
1837
1856
|
mcpServers,
|
|
1838
1857
|
cwd: workdir,
|
|
1839
1858
|
abortSignal: abortCtl.signal
|