@ai-sdk/harness-acp 1.0.59 → 1.0.61
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 +21 -0
- package/dist/bridge/host-tool-mcp.mjs +1 -1
- package/dist/bridge/index.mjs +1 -4
- package/dist/bridge/index.mjs.map +1 -1
- package/dist/index.js +22 -35
- package/dist/index.js.map +1 -1
- package/package.json +3 -3
- package/src/v1/acp-v1-harness.ts +11 -15
- package/src/v1/acp-v1-skills.ts +7 -14
- package/src/v1/bridge/acp-diagnostics.ts +0 -2
- package/src/v1/bridge/host-tool-correlation.ts +0 -1
- package/src/v1/implementation.ts +4 -6
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ai-sdk/harness-acp",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.61",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"sideEffects": false,
|
|
@@ -26,8 +26,8 @@
|
|
|
26
26
|
}
|
|
27
27
|
},
|
|
28
28
|
"dependencies": {
|
|
29
|
-
"@ai-sdk/harness": "1.0.
|
|
30
|
-
"@ai-sdk/provider-utils": "5.0.
|
|
29
|
+
"@ai-sdk/harness": "1.0.123",
|
|
30
|
+
"@ai-sdk/provider-utils": "5.0.47",
|
|
31
31
|
"ws": "^8.21.0"
|
|
32
32
|
},
|
|
33
33
|
"peerDependencies": {
|
package/src/v1/acp-v1-harness.ts
CHANGED
|
@@ -12,6 +12,7 @@ import {
|
|
|
12
12
|
type HarnessV1Skill,
|
|
13
13
|
type HarnessV1StreamPart,
|
|
14
14
|
type HarnessV1ToolSpec,
|
|
15
|
+
harnessStateDirectoryPath,
|
|
15
16
|
} from '@ai-sdk/harness';
|
|
16
17
|
import { HarnessBridgeCapabilityUnsupportedError } from '@ai-sdk/harness/bridge';
|
|
17
18
|
import {
|
|
@@ -25,7 +26,6 @@ import {
|
|
|
25
26
|
forwardBridgeProcessStream,
|
|
26
27
|
getRestrictedSandboxSession,
|
|
27
28
|
markBridgeStarting,
|
|
28
|
-
resolveSandboxDefaultWorkingDirectory,
|
|
29
29
|
resolveSandboxHomeDir,
|
|
30
30
|
SandboxChannel,
|
|
31
31
|
shellQuote,
|
|
@@ -256,11 +256,6 @@ export function createACPV1<TBuiltinTools extends ToolSet = {}>({
|
|
|
256
256
|
message: `The ${settings.harnessId} ACP harness cannot use \`mintBridgeToken\` with a sandbox session that does not expose an id.`,
|
|
257
257
|
});
|
|
258
258
|
}
|
|
259
|
-
const defaultWorkingDirectory =
|
|
260
|
-
await resolveSandboxDefaultWorkingDirectory({
|
|
261
|
-
sandboxSession,
|
|
262
|
-
abortSignal: startOptions.abortSignal,
|
|
263
|
-
});
|
|
264
259
|
const continueFrom =
|
|
265
260
|
startOptions.continueFrom ?? startOptions.resumeFrom?.continueFrom;
|
|
266
261
|
const lifecycleState = continueFrom ?? startOptions.resumeFrom;
|
|
@@ -376,19 +371,21 @@ export function createACPV1<TBuiltinTools extends ToolSet = {}>({
|
|
|
376
371
|
),
|
|
377
372
|
);
|
|
378
373
|
}
|
|
374
|
+
// Harness SDK state always lives under the sandbox's own HOME, never
|
|
375
|
+
// the working directory, so it stays out of a user-owned workspace.
|
|
376
|
+
const sandboxHomeDir = await resolveSandboxHomeDir({
|
|
377
|
+
sandbox: toolSafeSandboxSession,
|
|
378
|
+
abortSignal: startOptions.abortSignal,
|
|
379
|
+
});
|
|
380
|
+
const stateDirectory = harnessStateDirectoryPath({ sandboxHomeDir });
|
|
379
381
|
const resolvedBridgeDir = posix.resolve(
|
|
380
|
-
|
|
382
|
+
stateDirectory,
|
|
381
383
|
bootstrap.bootstrapDir,
|
|
382
384
|
);
|
|
383
385
|
const resolvedImplementationDir = `${resolvedBridgeDir}/implementation`;
|
|
384
386
|
const workDir = startOptions.sessionWorkDir;
|
|
385
|
-
const sandboxHomeDir = await resolveSandboxHomeDir({
|
|
386
|
-
sandbox: toolSafeSandboxSession,
|
|
387
|
-
abortSignal: startOptions.abortSignal,
|
|
388
|
-
});
|
|
389
387
|
const privateSessionDir = resolveACPPrivateSessionDirectory({
|
|
390
|
-
|
|
391
|
-
harnessId: settings.harnessId,
|
|
388
|
+
stateDirectory,
|
|
392
389
|
sessionId: startOptions.sessionId,
|
|
393
390
|
});
|
|
394
391
|
const implementationHomeDir =
|
|
@@ -2013,7 +2010,7 @@ function withNativeQuestionRequest({
|
|
|
2013
2010
|
providerMetadata: {
|
|
2014
2011
|
...toolCall.providerMetadata,
|
|
2015
2012
|
[harnessId]: {
|
|
2016
|
-
...
|
|
2013
|
+
...harnessMetadata,
|
|
2017
2014
|
nativeRequest,
|
|
2018
2015
|
} as NonNullable<
|
|
2019
2016
|
Extract<HarnessV1StreamPart, { type: 'tool-call' }>['providerMetadata']
|
|
@@ -2067,7 +2064,6 @@ function takeBufferedQuestionResult({
|
|
|
2067
2064
|
return buffered;
|
|
2068
2065
|
}
|
|
2069
2066
|
}
|
|
2070
|
-
return undefined;
|
|
2071
2067
|
}
|
|
2072
2068
|
|
|
2073
2069
|
function isPermissionModeMappingValue({
|
package/src/v1/acp-v1-skills.ts
CHANGED
|
@@ -1,27 +1,20 @@
|
|
|
1
|
-
import { createHash } from 'node:crypto';
|
|
2
1
|
import path from 'node:path';
|
|
3
|
-
import
|
|
2
|
+
import {
|
|
3
|
+
harnessSessionDataDirectoryPath,
|
|
4
|
+
type HarnessV1Skill,
|
|
5
|
+
} from '@ai-sdk/harness';
|
|
4
6
|
|
|
5
7
|
export const ACP_SKILL_NAME_PATTERN = /^[a-z0-9]+(?:-[a-z0-9]+)*$/;
|
|
6
8
|
export const DEFAULT_ACP_SKILLS_DIRECTORY = '.agents/skills';
|
|
7
9
|
|
|
8
10
|
export function resolveACPPrivateSessionDirectory({
|
|
9
|
-
|
|
10
|
-
harnessId,
|
|
11
|
+
stateDirectory,
|
|
11
12
|
sessionId,
|
|
12
13
|
}: {
|
|
13
|
-
|
|
14
|
-
harnessId: string;
|
|
14
|
+
stateDirectory: string;
|
|
15
15
|
sessionId: string;
|
|
16
16
|
}): string {
|
|
17
|
-
|
|
18
|
-
return path.posix.join(
|
|
19
|
-
sandboxHomeDir,
|
|
20
|
-
'.ai-sdk',
|
|
21
|
-
'harness-acp',
|
|
22
|
-
harnessId,
|
|
23
|
-
sessionKey,
|
|
24
|
-
);
|
|
17
|
+
return harnessSessionDataDirectoryPath({ stateDirectory, sessionId });
|
|
25
18
|
}
|
|
26
19
|
|
|
27
20
|
export function resolveACPSkillsDirectory({
|
package/src/v1/implementation.ts
CHANGED
|
@@ -79,8 +79,8 @@ export function validateACPV1Implementation(
|
|
|
79
79
|
validateForwardEnvironment({ forwardEnv: implementation.forwardEnv });
|
|
80
80
|
validateForwardEnvironment({ forwardEnv: implementation.credentialEnv });
|
|
81
81
|
validateEnvironment({ env: implementation.env });
|
|
82
|
-
const forwardedKeys = new Set(implementation.forwardEnv
|
|
83
|
-
const credentialKeys = new Set(implementation.credentialEnv
|
|
82
|
+
const forwardedKeys = new Set(implementation.forwardEnv);
|
|
83
|
+
const credentialKeys = new Set(implementation.credentialEnv);
|
|
84
84
|
for (const key of credentialKeys) {
|
|
85
85
|
if (forwardedKeys.has(key)) {
|
|
86
86
|
throw new Error(
|
|
@@ -209,11 +209,9 @@ export function createImplementationIdentity({
|
|
|
209
209
|
type: source.type,
|
|
210
210
|
command: source.command,
|
|
211
211
|
};
|
|
212
|
-
const forwardedEnvironment = [
|
|
213
|
-
...new Set(implementation.forwardEnv ?? []),
|
|
214
|
-
].sort();
|
|
212
|
+
const forwardedEnvironment = [...new Set(implementation.forwardEnv)].sort();
|
|
215
213
|
const credentialEnvironment = [
|
|
216
|
-
...new Set(implementation.credentialEnv
|
|
214
|
+
...new Set(implementation.credentialEnv),
|
|
217
215
|
].sort();
|
|
218
216
|
const literalEnvironment = Object.fromEntries(
|
|
219
217
|
Object.entries(implementation.env ?? {})
|