@agentproto/adapter-claude-code 0.1.0-alpha.0
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/CLAUDE-CODE.md +120 -0
- package/LICENSE +21 -0
- package/dist/index.d.ts +12 -0
- package/dist/index.mjs +126 -0
- package/dist/index.mjs.map +1 -0
- package/package.json +61 -0
package/CLAUDE-CODE.md
ADDED
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: claude-code
|
|
3
|
+
id: claude-code
|
|
4
|
+
description: Anthropic's Claude Code wrapped as an ACP agent via @agentclientprotocol/claude-agent-acp. Spawns the wrapper as `npx @agentclientprotocol/claude-agent-acp` and drives Claude Code over stdio JSON-RPC. Use when an operator should run inside Claude Code's agent loop instead of in-process.
|
|
5
|
+
version: 0.1.0
|
|
6
|
+
bin: npx
|
|
7
|
+
bin_args: ["-y", "@agentclientprotocol/claude-agent-acp"]
|
|
8
|
+
install:
|
|
9
|
+
- method: npm
|
|
10
|
+
package: "@agentclientprotocol/claude-agent-acp"
|
|
11
|
+
global: true
|
|
12
|
+
version_check:
|
|
13
|
+
cmd: npm view @agentclientprotocol/claude-agent-acp version
|
|
14
|
+
parse: "(\\d+\\.\\d+\\.\\d+)"
|
|
15
|
+
range: ">=0.30.0"
|
|
16
|
+
timeout_ms: 15000
|
|
17
|
+
auth:
|
|
18
|
+
ref: ./SECRETS.md
|
|
19
|
+
state:
|
|
20
|
+
env: [ANTHROPIC_API_KEY]
|
|
21
|
+
sandbox: ./SANDBOX.md
|
|
22
|
+
protocol: acp
|
|
23
|
+
acp: ./claude-code-acp.ACP.md
|
|
24
|
+
session:
|
|
25
|
+
mode: persistent
|
|
26
|
+
idle_timeout_ms: 1800000
|
|
27
|
+
context_carryover: true
|
|
28
|
+
models:
|
|
29
|
+
default: claude-sonnet-4-6
|
|
30
|
+
allowed:
|
|
31
|
+
- claude-sonnet-4-6
|
|
32
|
+
- claude-opus-4-7
|
|
33
|
+
- claude-haiku-4-5
|
|
34
|
+
env:
|
|
35
|
+
anthropic: ANTHROPIC_API_KEY
|
|
36
|
+
capabilities:
|
|
37
|
+
streaming: true
|
|
38
|
+
tool_calls: true
|
|
39
|
+
sub_agents: false
|
|
40
|
+
file_io: true
|
|
41
|
+
# Claude Code's ACP wrapper announces `promptCapabilities.image: true`
|
|
42
|
+
# — image content blocks in the user prompt flow through to the
|
|
43
|
+
# underlying Anthropic Messages API as native vision content. See
|
|
44
|
+
# `@agentclientprotocol/claude-agent-acp` v0.30+. Hosts that take
|
|
45
|
+
# advantage of this should send `{type: "image", data, mimeType}`
|
|
46
|
+
# blocks alongside the text in `session.send`.
|
|
47
|
+
multimodal: true
|
|
48
|
+
# The wrapper (@agentclientprotocol/claude-agent-acp >= 0.30) advertises
|
|
49
|
+
# `loadSession: true` over ACP — newSession/loadSession/resumeSession
|
|
50
|
+
# are all wired. The host pairs this with the `native-resume`
|
|
51
|
+
# continuation strategy below to reattach to an existing session
|
|
52
|
+
# across cold starts (API restart, sandbox reap, multi-machine).
|
|
53
|
+
resumable: true
|
|
54
|
+
bidirectional: true
|
|
55
|
+
modes:
|
|
56
|
+
- id: default
|
|
57
|
+
description: Standard interactive mode with per-tool permission prompts.
|
|
58
|
+
- id: plan
|
|
59
|
+
description: Plan-only mode — Claude Code reasons and proposes but does not edit or run commands.
|
|
60
|
+
bin_args_append: ["--permission-mode", "plan"]
|
|
61
|
+
- id: accept-edits
|
|
62
|
+
description: Auto-accept file edits; commands still prompt.
|
|
63
|
+
bin_args_append: ["--permission-mode", "acceptEdits"]
|
|
64
|
+
- id: bypass-permissions
|
|
65
|
+
description: Skip all permission prompts. Use only in trusted automation contexts.
|
|
66
|
+
bin_args_append: ["--permission-mode", "bypassPermissions"]
|
|
67
|
+
options:
|
|
68
|
+
- id: model
|
|
69
|
+
type: enum
|
|
70
|
+
enum: [claude-sonnet-4-6, claude-opus-4-7, claude-haiku-4-5]
|
|
71
|
+
description: Override the default model for this operator binding.
|
|
72
|
+
bin_args_template: ["--model", "{value}"]
|
|
73
|
+
- id: max_turns
|
|
74
|
+
type: integer
|
|
75
|
+
min: 1
|
|
76
|
+
max: 200
|
|
77
|
+
description: Hard cap on tool-use turns within a single send. Claude Code stops after this many cycles.
|
|
78
|
+
bin_args_template: ["--max-turns", "{value}"]
|
|
79
|
+
continuation:
|
|
80
|
+
# `native-resume` is the right default now that the wrapper supports
|
|
81
|
+
# `loadSession`: each turn cold-spawns claude with no overhead, then
|
|
82
|
+
# reattaches to the saved session id via ACP loadSession. Survives
|
|
83
|
+
# API restarts, sandbox reaps, and machine swaps because the session
|
|
84
|
+
# state lives in claude's own JSONL store at the agent's chosen
|
|
85
|
+
# storage location (CLAUDE_CONFIG_DIR-controlled).
|
|
86
|
+
#
|
|
87
|
+
# `pinned-session` is kept as a supported fallback for hosts that
|
|
88
|
+
# haven't wired the native-resume hooks yet — same warm-process
|
|
89
|
+
# behaviour as before, lost on process restart.
|
|
90
|
+
default: native-resume
|
|
91
|
+
supported: [native-resume, pinned-session, transcript, none]
|
|
92
|
+
pinned_session:
|
|
93
|
+
idle_timeout_ms: 1800000
|
|
94
|
+
key_scope: [conversation, operator]
|
|
95
|
+
tags: [claude-code, anthropic, acp, agent-runtime, coding]
|
|
96
|
+
---
|
|
97
|
+
|
|
98
|
+
# Claude Code
|
|
99
|
+
|
|
100
|
+
Anthropic's coding agent driven over ACP via the
|
|
101
|
+
[`@agentclientprotocol/claude-agent-acp`](https://www.npmjs.com/package/@agentclientprotocol/claude-agent-acp)
|
|
102
|
+
wrapper.
|
|
103
|
+
|
|
104
|
+
## When to use this manifest
|
|
105
|
+
|
|
106
|
+
Bind an AIP-9 operator to Claude Code when the operator should run as
|
|
107
|
+
Anthropic's coding agent (file ops, command execution, planning) under
|
|
108
|
+
operator governance. Common cases: dev-tooling operators, code-review
|
|
109
|
+
operators, refactor-on-demand operators.
|
|
110
|
+
|
|
111
|
+
## Install
|
|
112
|
+
|
|
113
|
+
The wrapper is an npm package — `npm install -g @agentclientprotocol/claude-agent-acp`,
|
|
114
|
+
then it's reachable on PATH. The manifest invokes it via `npx -y` so a
|
|
115
|
+
fresh install isn't strictly required if `npx` is available.
|
|
116
|
+
|
|
117
|
+
## Auth
|
|
118
|
+
|
|
119
|
+
Claude Code reads `ANTHROPIC_API_KEY` at boot. The runner forwards it
|
|
120
|
+
via `sandbox.env.set` (never argv).
|
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 agentproto contributors
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { AgentCliHandle, AgentCliRuntime } from '@agentproto/driver-agent-cli';
|
|
2
|
+
export { AgentCliHandle, AgentCliRuntime } from '@agentproto/driver-agent-cli';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* @agentproto/adapter-claude-code — AIP-45 adapter for Anthropic's
|
|
6
|
+
* Claude Code via the @agentclientprotocol/claude-agent-acp wrapper.
|
|
7
|
+
*/
|
|
8
|
+
|
|
9
|
+
declare const claudeCode: AgentCliHandle;
|
|
10
|
+
declare function claudeCodeRuntime(): AgentCliRuntime;
|
|
11
|
+
|
|
12
|
+
export { claudeCode, claudeCodeRuntime };
|
package/dist/index.mjs
ADDED
|
@@ -0,0 +1,126 @@
|
|
|
1
|
+
import { defineAgentCli, createAgentCliRuntime } from '@agentproto/driver-agent-cli';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* @agentproto/adapter-claude-code v0.1.0-alpha
|
|
5
|
+
* AIP-45 adapter for Anthropic's Claude Code via @agentclientprotocol/claude-agent-acp.
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
var claudeCode = defineAgentCli({
|
|
9
|
+
name: "claude-code",
|
|
10
|
+
id: "claude-code",
|
|
11
|
+
description: "Anthropic's Claude Code wrapped as an ACP agent via @agentclientprotocol/claude-agent-acp. Spawned via `npx -y @agentclientprotocol/claude-agent-acp` and driven over stdio JSON-RPC.",
|
|
12
|
+
version: "0.1.0",
|
|
13
|
+
bin: "npx",
|
|
14
|
+
bin_args: ["-y", "@agentclientprotocol/claude-agent-acp"],
|
|
15
|
+
install: [
|
|
16
|
+
{
|
|
17
|
+
method: "npm",
|
|
18
|
+
package: "@agentclientprotocol/claude-agent-acp",
|
|
19
|
+
global: true
|
|
20
|
+
}
|
|
21
|
+
],
|
|
22
|
+
version_check: {
|
|
23
|
+
cmd: "npm view @agentclientprotocol/claude-agent-acp version",
|
|
24
|
+
parse: "(\\d+\\.\\d+\\.\\d+)",
|
|
25
|
+
range: ">=0.30.0",
|
|
26
|
+
timeout_ms: 15e3
|
|
27
|
+
},
|
|
28
|
+
auth: {
|
|
29
|
+
ref: "./SECRETS.md",
|
|
30
|
+
state: { env: ["ANTHROPIC_API_KEY"] }
|
|
31
|
+
},
|
|
32
|
+
sandbox: "./SANDBOX.md",
|
|
33
|
+
protocol: "acp",
|
|
34
|
+
acp: "./claude-code-acp.ACP.md",
|
|
35
|
+
session: {
|
|
36
|
+
mode: "persistent",
|
|
37
|
+
idle_timeout_ms: 18e5,
|
|
38
|
+
context_carryover: true
|
|
39
|
+
},
|
|
40
|
+
models: {
|
|
41
|
+
default: "claude-sonnet-4-6",
|
|
42
|
+
allowed: ["claude-sonnet-4-6", "claude-opus-4-7", "claude-haiku-4-5"],
|
|
43
|
+
env: { anthropic: "ANTHROPIC_API_KEY" }
|
|
44
|
+
},
|
|
45
|
+
capabilities: {
|
|
46
|
+
streaming: true,
|
|
47
|
+
tool_calls: true,
|
|
48
|
+
sub_agents: false,
|
|
49
|
+
file_io: true,
|
|
50
|
+
// ACP wrapper forwards `image` content blocks in user prompts
|
|
51
|
+
// straight to Anthropic Messages API. Hosts SHOULD send images
|
|
52
|
+
// inline (see CLAUDE-CODE.md) instead of passing paths and
|
|
53
|
+
// hoping the model uses Read.
|
|
54
|
+
multimodal: true,
|
|
55
|
+
// The wrapper (@agentclientprotocol/claude-agent-acp >= 0.30)
|
|
56
|
+
// advertises `loadSession: true` and exposes the full session
|
|
57
|
+
// lifecycle (newSession / loadSession / resumeSession / forkSession)
|
|
58
|
+
// over JSON-RPC. Pairs with `continuation.default: native-resume`
|
|
59
|
+
// below — the host persists the sessionId and reattaches to the
|
|
60
|
+
// existing session across cold starts (api restart, sandbox reap,
|
|
61
|
+
// multi-machine).
|
|
62
|
+
resumable: true,
|
|
63
|
+
bidirectional: true
|
|
64
|
+
},
|
|
65
|
+
modes: [
|
|
66
|
+
{ id: "default", description: "Standard interactive mode." },
|
|
67
|
+
{
|
|
68
|
+
id: "plan",
|
|
69
|
+
description: "Plan-only mode \u2014 Claude Code reasons and proposes but does not edit or run commands.",
|
|
70
|
+
bin_args_append: ["--permission-mode", "plan"]
|
|
71
|
+
},
|
|
72
|
+
{
|
|
73
|
+
id: "accept-edits",
|
|
74
|
+
description: "Auto-accept file edits; commands still prompt.",
|
|
75
|
+
bin_args_append: ["--permission-mode", "acceptEdits"]
|
|
76
|
+
},
|
|
77
|
+
{
|
|
78
|
+
id: "bypass-permissions",
|
|
79
|
+
description: "Skip all permission prompts. Use only in trusted automation contexts.",
|
|
80
|
+
bin_args_append: ["--permission-mode", "bypassPermissions"]
|
|
81
|
+
}
|
|
82
|
+
],
|
|
83
|
+
options: [
|
|
84
|
+
{
|
|
85
|
+
id: "model",
|
|
86
|
+
type: "enum",
|
|
87
|
+
enum: ["claude-sonnet-4-6", "claude-opus-4-7", "claude-haiku-4-5"],
|
|
88
|
+
description: "Override the default model for this operator binding.",
|
|
89
|
+
bin_args_template: ["--model", "{value}"]
|
|
90
|
+
},
|
|
91
|
+
{
|
|
92
|
+
id: "max_turns",
|
|
93
|
+
type: "integer",
|
|
94
|
+
min: 1,
|
|
95
|
+
max: 200,
|
|
96
|
+
description: "Hard cap on tool-use turns within a single send. Claude Code stops after this many cycles.",
|
|
97
|
+
bin_args_template: ["--max-turns", "{value}"]
|
|
98
|
+
}
|
|
99
|
+
],
|
|
100
|
+
continuation: {
|
|
101
|
+
// native-resume: each turn cold-spawns claude, then ACP `loadSession`
|
|
102
|
+
// reattaches to the saved sessionId. Survives api restarts, sandbox
|
|
103
|
+
// reaps, multi-machine — claude reads its own JSONL session store.
|
|
104
|
+
// Requires the host to register `configureNativeResume({load, save})`
|
|
105
|
+
// hooks; without them the strategy degrades to per-spawn behaviour
|
|
106
|
+
// (no continuity).
|
|
107
|
+
//
|
|
108
|
+
// pinned-session is still supported as a fallback for hosts that
|
|
109
|
+
// haven't wired the resume hooks yet — same warm-process semantics
|
|
110
|
+
// as pre-AIP-45-extension behaviour.
|
|
111
|
+
default: "native-resume",
|
|
112
|
+
supported: ["native-resume", "pinned-session", "transcript", "none"],
|
|
113
|
+
pinned_session: {
|
|
114
|
+
idle_timeout_ms: 18e5,
|
|
115
|
+
key_scope: ["conversation", "operator"]
|
|
116
|
+
}
|
|
117
|
+
},
|
|
118
|
+
tags: ["claude-code", "anthropic", "acp", "agent-runtime", "coding"]
|
|
119
|
+
});
|
|
120
|
+
function claudeCodeRuntime() {
|
|
121
|
+
return createAgentCliRuntime(claudeCode);
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
export { claudeCode, claudeCodeRuntime };
|
|
125
|
+
//# sourceMappingURL=index.mjs.map
|
|
126
|
+
//# sourceMappingURL=index.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/index.ts"],"names":[],"mappings":"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","file":"index.mjs","sourcesContent":["/**\n * @agentproto/adapter-claude-code — AIP-45 adapter for Anthropic's\n * Claude Code via the @agentclientprotocol/claude-agent-acp wrapper.\n */\n\nimport {\n createAgentCliRuntime,\n defineAgentCli,\n type AgentCliHandle,\n type AgentCliRuntime,\n} from \"@agentproto/driver-agent-cli\"\n\nexport const claudeCode: AgentCliHandle = defineAgentCli({\n name: \"claude-code\",\n id: \"claude-code\",\n description:\n \"Anthropic's Claude Code wrapped as an ACP agent via @agentclientprotocol/claude-agent-acp. Spawned via `npx -y @agentclientprotocol/claude-agent-acp` and driven over stdio JSON-RPC.\",\n version: \"0.1.0\",\n bin: \"npx\",\n bin_args: [\"-y\", \"@agentclientprotocol/claude-agent-acp\"],\n install: [\n {\n method: \"npm\",\n package: \"@agentclientprotocol/claude-agent-acp\",\n global: true,\n },\n ],\n version_check: {\n cmd: \"npm view @agentclientprotocol/claude-agent-acp version\",\n parse: \"(\\\\d+\\\\.\\\\d+\\\\.\\\\d+)\",\n range: \">=0.30.0\",\n timeout_ms: 15_000,\n },\n auth: {\n ref: \"./SECRETS.md\",\n state: { env: [\"ANTHROPIC_API_KEY\"] },\n },\n sandbox: \"./SANDBOX.md\",\n protocol: \"acp\",\n acp: \"./claude-code-acp.ACP.md\",\n session: {\n mode: \"persistent\",\n idle_timeout_ms: 1_800_000,\n context_carryover: true,\n },\n models: {\n default: \"claude-sonnet-4-6\",\n allowed: [\"claude-sonnet-4-6\", \"claude-opus-4-7\", \"claude-haiku-4-5\"],\n env: { anthropic: \"ANTHROPIC_API_KEY\" },\n },\n capabilities: {\n streaming: true,\n tool_calls: true,\n sub_agents: false,\n file_io: true,\n // ACP wrapper forwards `image` content blocks in user prompts\n // straight to Anthropic Messages API. Hosts SHOULD send images\n // inline (see CLAUDE-CODE.md) instead of passing paths and\n // hoping the model uses Read.\n multimodal: true,\n // The wrapper (@agentclientprotocol/claude-agent-acp >= 0.30)\n // advertises `loadSession: true` and exposes the full session\n // lifecycle (newSession / loadSession / resumeSession / forkSession)\n // over JSON-RPC. Pairs with `continuation.default: native-resume`\n // below — the host persists the sessionId and reattaches to the\n // existing session across cold starts (api restart, sandbox reap,\n // multi-machine).\n resumable: true,\n bidirectional: true,\n },\n modes: [\n { id: \"default\", description: \"Standard interactive mode.\" },\n {\n id: \"plan\",\n description:\n \"Plan-only mode — Claude Code reasons and proposes but does not edit or run commands.\",\n bin_args_append: [\"--permission-mode\", \"plan\"],\n },\n {\n id: \"accept-edits\",\n description: \"Auto-accept file edits; commands still prompt.\",\n bin_args_append: [\"--permission-mode\", \"acceptEdits\"],\n },\n {\n id: \"bypass-permissions\",\n description:\n \"Skip all permission prompts. Use only in trusted automation contexts.\",\n bin_args_append: [\"--permission-mode\", \"bypassPermissions\"],\n },\n ],\n options: [\n {\n id: \"model\",\n type: \"enum\",\n enum: [\"claude-sonnet-4-6\", \"claude-opus-4-7\", \"claude-haiku-4-5\"],\n description: \"Override the default model for this operator binding.\",\n bin_args_template: [\"--model\", \"{value}\"],\n },\n {\n id: \"max_turns\",\n type: \"integer\",\n min: 1,\n max: 200,\n description:\n \"Hard cap on tool-use turns within a single send. Claude Code stops after this many cycles.\",\n bin_args_template: [\"--max-turns\", \"{value}\"],\n },\n ],\n continuation: {\n // native-resume: each turn cold-spawns claude, then ACP `loadSession`\n // reattaches to the saved sessionId. Survives api restarts, sandbox\n // reaps, multi-machine — claude reads its own JSONL session store.\n // Requires the host to register `configureNativeResume({load, save})`\n // hooks; without them the strategy degrades to per-spawn behaviour\n // (no continuity).\n //\n // pinned-session is still supported as a fallback for hosts that\n // haven't wired the resume hooks yet — same warm-process semantics\n // as pre-AIP-45-extension behaviour.\n default: \"native-resume\",\n supported: [\"native-resume\", \"pinned-session\", \"transcript\", \"none\"],\n pinned_session: {\n idle_timeout_ms: 1_800_000,\n key_scope: [\"conversation\", \"operator\"],\n },\n },\n tags: [\"claude-code\", \"anthropic\", \"acp\", \"agent-runtime\", \"coding\"],\n})\n\nexport function claudeCodeRuntime(): AgentCliRuntime {\n return createAgentCliRuntime(claudeCode)\n}\n\nexport type { AgentCliHandle, AgentCliRuntime }\n"]}
|
package/package.json
ADDED
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@agentproto/adapter-claude-code",
|
|
3
|
+
"version": "0.1.0-alpha.0",
|
|
4
|
+
"description": "@agentproto/adapter-claude-code — AIP-45 AGENT-CLI adapter for Anthropic's Claude Code via @agentclientprotocol/claude-agent-acp. Spawns the ACP wrapper and drives Claude Code as an agentproto agent CLI.",
|
|
5
|
+
"keywords": [
|
|
6
|
+
"agentproto",
|
|
7
|
+
"aip-45",
|
|
8
|
+
"claude-code",
|
|
9
|
+
"anthropic",
|
|
10
|
+
"acp",
|
|
11
|
+
"agent-cli",
|
|
12
|
+
"adapter"
|
|
13
|
+
],
|
|
14
|
+
"homepage": "https://agentproto.sh/docs/aip-45",
|
|
15
|
+
"repository": {
|
|
16
|
+
"type": "git",
|
|
17
|
+
"url": "https://github.com/agentproto/ts",
|
|
18
|
+
"directory": "adapters/claude-code"
|
|
19
|
+
},
|
|
20
|
+
"license": "MIT",
|
|
21
|
+
"type": "module",
|
|
22
|
+
"main": "dist/index.mjs",
|
|
23
|
+
"module": "dist/index.mjs",
|
|
24
|
+
"types": "dist/index.d.ts",
|
|
25
|
+
"exports": {
|
|
26
|
+
".": {
|
|
27
|
+
"types": "./dist/index.d.ts",
|
|
28
|
+
"import": "./dist/index.mjs",
|
|
29
|
+
"default": "./dist/index.mjs"
|
|
30
|
+
},
|
|
31
|
+
"./CLAUDE-CODE.md": "./CLAUDE-CODE.md",
|
|
32
|
+
"./package.json": "./package.json"
|
|
33
|
+
},
|
|
34
|
+
"files": [
|
|
35
|
+
"dist",
|
|
36
|
+
"CLAUDE-CODE.md",
|
|
37
|
+
"README.md",
|
|
38
|
+
"LICENSE"
|
|
39
|
+
],
|
|
40
|
+
"publishConfig": {
|
|
41
|
+
"access": "public"
|
|
42
|
+
},
|
|
43
|
+
"dependencies": {
|
|
44
|
+
"@agentproto/driver-agent-cli": "0.1.0-alpha.0"
|
|
45
|
+
},
|
|
46
|
+
"devDependencies": {
|
|
47
|
+
"@types/node": "^25.1.0",
|
|
48
|
+
"tsup": "^8.5.1",
|
|
49
|
+
"typescript": "^5.9.3",
|
|
50
|
+
"vitest": "^3.2.4",
|
|
51
|
+
"@agentproto/tooling": "0.1.0-alpha.0"
|
|
52
|
+
},
|
|
53
|
+
"scripts": {
|
|
54
|
+
"dev": "tsup --watch",
|
|
55
|
+
"build": "tsup",
|
|
56
|
+
"clean": "rm -rf dist",
|
|
57
|
+
"check-types": "tsc --noEmit",
|
|
58
|
+
"test": "vitest run --passWithNoTests",
|
|
59
|
+
"test:watch": "vitest"
|
|
60
|
+
}
|
|
61
|
+
}
|