@ai-sdk/harness-claude-code 1.0.123 → 1.0.125
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 +15 -0
- package/dist/bridge/index.mjs +17 -2
- package/dist/bridge/index.mjs.map +1 -1
- package/dist/index.js +8 -2
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
- package/src/bridge/index.ts +18 -1
- package/src/claude-code-bootstrap.ts +11 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ai-sdk/harness-claude-code",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.125",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"sideEffects": false,
|
|
@@ -26,7 +26,7 @@
|
|
|
26
26
|
}
|
|
27
27
|
},
|
|
28
28
|
"dependencies": {
|
|
29
|
-
"@ai-sdk/harness": "1.0.
|
|
29
|
+
"@ai-sdk/harness": "1.0.121",
|
|
30
30
|
"@ai-sdk/provider-utils": "5.0.45",
|
|
31
31
|
"ws": "^8.21.0"
|
|
32
32
|
},
|
package/src/bridge/index.ts
CHANGED
|
@@ -174,7 +174,7 @@ function createPermissionOptions(input: {
|
|
|
174
174
|
inactiveNativeTools,
|
|
175
175
|
});
|
|
176
176
|
|
|
177
|
-
|
|
177
|
+
const baseOptions = {
|
|
178
178
|
permissionMode:
|
|
179
179
|
permissionMode === 'allow-all'
|
|
180
180
|
? 'bypassPermissions'
|
|
@@ -183,6 +183,23 @@ function createPermissionOptions(input: {
|
|
|
183
183
|
: 'default',
|
|
184
184
|
allowDangerouslySkipPermissions: permissionMode === 'allow-all',
|
|
185
185
|
...(permissionSettings ? { settings: permissionSettings } : {}),
|
|
186
|
+
};
|
|
187
|
+
|
|
188
|
+
if (permissionMode === 'allow-all') {
|
|
189
|
+
return {
|
|
190
|
+
...baseOptions,
|
|
191
|
+
/*
|
|
192
|
+
* Claude Code exposes AskUserQuestion in headless SDK sessions only
|
|
193
|
+
* when a permission prompt tool is configured. The stdio prompt tool
|
|
194
|
+
* preserves that tool surface without supplying the canUseTool callback
|
|
195
|
+
* that bypassPermissions guarantees it will never invoke.
|
|
196
|
+
*/
|
|
197
|
+
permissionPromptToolName: 'stdio',
|
|
198
|
+
};
|
|
199
|
+
}
|
|
200
|
+
|
|
201
|
+
return {
|
|
202
|
+
...baseOptions,
|
|
186
203
|
canUseTool: async (
|
|
187
204
|
toolName: string,
|
|
188
205
|
toolInput: Record<string, unknown>,
|
|
@@ -1,8 +1,18 @@
|
|
|
1
1
|
import type { HarnessV1Bootstrap } from '@ai-sdk/harness';
|
|
2
2
|
import { createReadBridgeAsset } from '@ai-sdk/harness/utils';
|
|
3
3
|
|
|
4
|
+
/*
|
|
5
|
+
* Keep every asset URL literal so bundlers can emit each file separately.
|
|
6
|
+
* Dynamic new URL() paths can collapse multiple assets into one resolution.
|
|
7
|
+
*/
|
|
4
8
|
const readBridgeAsset = createReadBridgeAsset({
|
|
5
|
-
|
|
9
|
+
'package.json': new URL('./bridge/package.json', import.meta.url),
|
|
10
|
+
'pnpm-lock.yaml': new URL('./bridge/pnpm-lock.yaml', import.meta.url),
|
|
11
|
+
'pnpm-workspace.yaml': new URL(
|
|
12
|
+
'./bridge/pnpm-workspace.yaml',
|
|
13
|
+
import.meta.url,
|
|
14
|
+
),
|
|
15
|
+
'index.mjs': new URL('./bridge/index.mjs', import.meta.url),
|
|
6
16
|
});
|
|
7
17
|
|
|
8
18
|
/*
|