@agent-harness-experimental/adapter-claude-code 0.0.0 → 0.0.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/LICENSE +1 -0
- package/README.md +102 -2
- package/dist/adapter.d.ts +29 -0
- package/dist/adapter.d.ts.map +1 -0
- package/dist/adapter.js +215 -0
- package/dist/adapter.js.map +1 -0
- package/dist/bridge-continuation.mts +1 -0
- package/dist/bridge-delegation.mts +1 -0
- package/dist/bridge-helpers.mts +122 -0
- package/dist/bridge-tool-policy.mts +1 -0
- package/dist/bridge-ws-server.mts +1 -0
- package/dist/bridge.mts +745 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +3 -0
- package/dist/index.js.map +1 -0
- package/dist/pnpm-lock.yaml +1038 -0
- package/dist/setup.d.ts +6 -0
- package/dist/setup.d.ts.map +1 -0
- package/dist/setup.js +61 -0
- package/dist/setup.js.map +1 -0
- package/package.json +56 -3
package/dist/setup.d.ts
ADDED
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { AdapterSandboxFileContext, AdapterSandboxSetup, AdapterSupportMatrixRow } from 'agent-harness-experimental';
|
|
2
|
+
export declare const CLAUDE_CODE_SANDBOX_SETUP: import("@agent-harness-experimental/bridge").DefinedBridgeSandboxSetup<AdapterSandboxFileContext>;
|
|
3
|
+
export declare const CLAUDE_CODE_DEFAULT_CONTEXT_WINDOW = 200000;
|
|
4
|
+
export declare const CLAUDE_CODE_SUPPORT_MATRIX_ROW: AdapterSupportMatrixRow;
|
|
5
|
+
export declare function getClaudeCodeSandboxSetup(): AdapterSandboxSetup;
|
|
6
|
+
//# sourceMappingURL=setup.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"setup.d.ts","sourceRoot":"","sources":["../src/setup.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,yBAAyB,EAAE,mBAAmB,EAAE,uBAAuB,EAAE,MAAM,4BAA4B,CAAC;AAO1H,eAAO,MAAM,yBAAyB,mGAoBN,CAAC;AAEjC,eAAO,MAAM,kCAAkC,SAAU,CAAC;AAE1D,eAAO,MAAM,8BAA8B,EAAE,uBA8B5C,CAAC;AAEF,wBAAgB,yBAAyB,IAAI,mBAAmB,CAE/D"}
|
package/dist/setup.js
ADDED
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import { defineBridgeSandboxSetup } from '@agent-harness-experimental/bridge';
|
|
2
|
+
function withFrontmatter(name, description, content) {
|
|
3
|
+
return `---\nname: ${name}\ndescription: ${description}\n---\n\n${content}`;
|
|
4
|
+
}
|
|
5
|
+
export const CLAUDE_CODE_SANDBOX_SETUP = defineBridgeSandboxSetup(import.meta.url, {
|
|
6
|
+
deps: ['@anthropic-ai/claude-code', '@anthropic-ai/claude-agent-sdk', '@anthropic-ai/sdk', '@modelcontextprotocol/sdk', 'zod', 'ws'],
|
|
7
|
+
lockfile: 'pnpm-lock.yaml',
|
|
8
|
+
bridge: 'bridge.mts',
|
|
9
|
+
localBridgeFiles: ['bridge-helpers.mts'],
|
|
10
|
+
postInstallCommands: [
|
|
11
|
+
{
|
|
12
|
+
cmd: 'bash',
|
|
13
|
+
args: [
|
|
14
|
+
'-lc',
|
|
15
|
+
'cd /tmp && if [ -f node_modules/@anthropic-ai/claude-code/install.cjs ]; then node node_modules/@anthropic-ai/claude-code/install.cjs; fi && ./node_modules/.bin/claude --version',
|
|
16
|
+
],
|
|
17
|
+
},
|
|
18
|
+
],
|
|
19
|
+
getSandboxFiles({ workDir, skills }) {
|
|
20
|
+
return (skills ?? []).map((skill) => ({
|
|
21
|
+
path: `${workDir}/.claude/skills/${skill.name}.md`,
|
|
22
|
+
content: withFrontmatter(skill.name, skill.description, skill.content),
|
|
23
|
+
}));
|
|
24
|
+
},
|
|
25
|
+
});
|
|
26
|
+
export const CLAUDE_CODE_DEFAULT_CONTEXT_WINDOW = 200_000;
|
|
27
|
+
export const CLAUDE_CODE_SUPPORT_MATRIX_ROW = {
|
|
28
|
+
key: 'claude-code',
|
|
29
|
+
readmeName: 'Claude Code',
|
|
30
|
+
skills: '`.claude/skills/{name}.md`',
|
|
31
|
+
subagents: 'Bridge-local `delegate_task` tool with nested Claude Code runs; prompt, model, tools, and maxTurns',
|
|
32
|
+
prepareStep: '`continuation`',
|
|
33
|
+
mcp: 'AI SDK tools via `@ai-sdk/mcp`',
|
|
34
|
+
capabilities: {
|
|
35
|
+
customTools: { status: 'supported' },
|
|
36
|
+
toolFiltering: { status: 'supported' },
|
|
37
|
+
postToolUseHooks: { status: 'supported' },
|
|
38
|
+
toolInterception: { status: 'supported' },
|
|
39
|
+
usage: { status: 'supported' },
|
|
40
|
+
cost: { status: 'supported' },
|
|
41
|
+
httpMocking: { status: 'supported' },
|
|
42
|
+
prepareStep: { status: 'partial', normalized: true, note: 'Normalized at continuation boundaries.' },
|
|
43
|
+
subagents: { status: 'supported', normalized: true, note: 'Bridge-local subagents emit normalized start/finish events.' },
|
|
44
|
+
toolApprovals: { status: 'supported', normalized: true },
|
|
45
|
+
streamingApprovals: { status: 'unsupported', note: 'Approval continuation is not normalized for stream mode yet.' },
|
|
46
|
+
sameAgentResume: { status: 'supported' },
|
|
47
|
+
conversationResume: {
|
|
48
|
+
status: 'partial',
|
|
49
|
+
note: 'Same-agent resume preserves conversation context; core-history import/export is not a separate contract yet.',
|
|
50
|
+
},
|
|
51
|
+
hostNetworkApproval: { status: 'supported', normalized: true },
|
|
52
|
+
persistence: { status: 'supported' },
|
|
53
|
+
streaming: { status: 'supported' },
|
|
54
|
+
tokenStreaming: { status: 'supported' },
|
|
55
|
+
interactiveTerminal: { status: 'partial', note: 'Shell execution is bridged; long-running PTY workflows are adapter-dependent.' },
|
|
56
|
+
},
|
|
57
|
+
};
|
|
58
|
+
export function getClaudeCodeSandboxSetup() {
|
|
59
|
+
return CLAUDE_CODE_SANDBOX_SETUP;
|
|
60
|
+
}
|
|
61
|
+
//# sourceMappingURL=setup.js.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B;IACvC,OAAO,yBAAyB,CAAC;AACnC,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,5 +1,58 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@agent-harness-experimental/adapter-claude-code",
|
|
3
|
-
"version": "0.0.
|
|
4
|
-
"
|
|
5
|
-
|
|
3
|
+
"version": "0.0.1",
|
|
4
|
+
"description": "Experimental Claude Code adapter for agent-harness-experimental.",
|
|
5
|
+
"license": "UNLICENSED",
|
|
6
|
+
"repository": {
|
|
7
|
+
"type": "git",
|
|
8
|
+
"url": "git+https://github.com/vercel-labs/agent-harness-sdk.git",
|
|
9
|
+
"directory": "packages/adapter-claude-code"
|
|
10
|
+
},
|
|
11
|
+
"bugs": {
|
|
12
|
+
"url": "https://github.com/vercel-labs/agent-harness-sdk/issues"
|
|
13
|
+
},
|
|
14
|
+
"homepage": "https://github.com/vercel-labs/agent-harness-sdk#readme",
|
|
15
|
+
"keywords": [
|
|
16
|
+
"agent",
|
|
17
|
+
"harness",
|
|
18
|
+
"experimental",
|
|
19
|
+
"ai-sdk",
|
|
20
|
+
"sandbox"
|
|
21
|
+
],
|
|
22
|
+
"publishConfig": {
|
|
23
|
+
"access": "public"
|
|
24
|
+
},
|
|
25
|
+
"type": "module",
|
|
26
|
+
"exports": {
|
|
27
|
+
".": {
|
|
28
|
+
"types": "./dist/index.d.ts",
|
|
29
|
+
"default": "./dist/index.js"
|
|
30
|
+
}
|
|
31
|
+
},
|
|
32
|
+
"dependencies": {
|
|
33
|
+
"agent-harness-experimental": "0.0.1",
|
|
34
|
+
"@agent-harness-experimental/bridge": "0.0.1",
|
|
35
|
+
"@agent-harness-experimental/sandbox-vercel": "0.0.1",
|
|
36
|
+
"@agent-harness-experimental/protocol": "0.0.1"
|
|
37
|
+
},
|
|
38
|
+
"devDependencies": {
|
|
39
|
+
"@anthropic-ai/claude-agent-sdk": "^0.3.143",
|
|
40
|
+
"@modelcontextprotocol/sdk": "^1.29.0",
|
|
41
|
+
"ai": "7.0.0-canary.126",
|
|
42
|
+
"typescript": "^5.8.3",
|
|
43
|
+
"zod": "^4.3.6",
|
|
44
|
+
"@agent-harness-experimental/test-utils": "0.0.1"
|
|
45
|
+
},
|
|
46
|
+
"main": "./dist/index.js",
|
|
47
|
+
"types": "./dist/index.d.ts",
|
|
48
|
+
"sideEffects": false,
|
|
49
|
+
"files": [
|
|
50
|
+
"dist"
|
|
51
|
+
],
|
|
52
|
+
"scripts": {
|
|
53
|
+
"lint": "biome check src package.json tsconfig.json tsconfig.build.json",
|
|
54
|
+
"typecheck": "tsc --noEmit -p tsconfig.json",
|
|
55
|
+
"test": "vitest run --config ../../vitest.package.config.ts src/adapter.test.ts src/integration.test.ts",
|
|
56
|
+
"build": "tsc -p tsconfig.build.json && tsx ../../scripts/copy-package-assets.ts packages/adapter-claude-code"
|
|
57
|
+
}
|
|
58
|
+
}
|