@agentproto/adapter-claude-code-cloud 0.0.0-stage → 0.1.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/dist/index.mjs ADDED
@@ -0,0 +1,114 @@
1
+ export { CLAUDE_CODE_GATEWAY_ENV_UNSET, ClaudeCloudAcpAgent, POLL_INITIAL_MS, POLL_MAX_MS, SessionsApi, cloudChildEnv, defaultCloudCliRunner, defaultGitRunner, envCredentialSource, keychainCredentialSource, normalizeSessionId, parseAuthStatus, parseCloudStartOutput, preflightAuth, resultEventUpdates, resultStopReason, runAcpOverStdio, sendPrompt, startCloudSession, toCliSessionId, validateRepoSource } from './chunk-KA4G4O2X.mjs';
2
+ import { fileURLToPath } from 'url';
3
+ import { defineAgentCli, createAgentCliRuntime } from '@agentproto/driver-agent-cli';
4
+
5
+ /**
6
+ * @agentproto/adapter-claude-code-cloud v0.1.0
7
+ * AIP-66 managed cloud agent adapter: Claude Code cloud sessions behind ACP.
8
+ */
9
+ var acpBin = fileURLToPath(
10
+ new URL("../bin/claude-code-cloud-acp.mjs", import.meta.url)
11
+ );
12
+ var CLOUD_REFUSED_SPAWN_FIELDS = [
13
+ "sandbox",
14
+ "worktree",
15
+ "commandSandbox",
16
+ "mcpServers",
17
+ "daemonMount",
18
+ "bundles",
19
+ "browser",
20
+ "appServe",
21
+ "inference"
22
+ ];
23
+ var claudeCodeCloud = defineAgentCli({
24
+ name: "claude-code-cloud",
25
+ id: "claude-code-cloud",
26
+ description: "AIP-66 managed cloud agent adapter for Anthropic Claude Code cloud sessions. The vendor owns the machine and the harness: starts via `claude --cloud` (TTY), prompts via `claude -p --cloud <id>`, observes via the Claude Code sessions API, projected onto stdio ACP. Refuses the AIP-66 \xA74 spawn fields (sandbox, worktree, commandSandbox, mcpServers, daemonMount, bundles, browser, appServe, inference) \u2014 the vendor can never apply them. Requires a claude.ai sign-in (API-key auth is refused) and a clean, pushed git checkout.",
27
+ version: "0.1.0",
28
+ bin: "node",
29
+ bin_args: [acpBin],
30
+ install: [
31
+ {
32
+ method: "npm",
33
+ package: "@agentproto/adapter-claude-code-cloud",
34
+ global: true
35
+ }
36
+ ],
37
+ // Presence probe against the vendor client this adapter relays to — the
38
+ // pinned floor is the oldest CLI observed to support `--cloud` / the
39
+ // sessions API (AIP-66 Appendix A: 2.1.296–2.1.299).
40
+ version_check: {
41
+ cmd: "claude --version",
42
+ parse: "(\\d+\\.\\d+\\.\\d+)",
43
+ range: ">=2.1.296",
44
+ timeout_ms: 15e3
45
+ },
46
+ // Auth is the user's OWN claude.ai login inside the claude CLI (keychain
47
+ // on macOS) — never an injected env credential (AIP-66 §8). No `state.env`
48
+ // because an API-key env would be scrubbed, not consumed; the preflight
49
+ // refuses an api_key-authenticated CLI outright.
50
+ auth: {
51
+ ref: "./CLAUDE-CODE-CLOUD.md",
52
+ login: {
53
+ cmd: "claude auth login",
54
+ interactive: true
55
+ }
56
+ },
57
+ // The machine is the vendor's; there is no host-side sandbox to describe.
58
+ sandbox: "Managed cloud (AIP-66): the vendor boots the machine and runs Claude Code on it. No agentproto daemon runs inside; the session URL is surfaced so the user can inspect what ran.",
59
+ protocol: "acp",
60
+ acp: "./CLAUDE-CODE-CLOUD.md",
61
+ session: {
62
+ // One agentproto session = one vendor cloud session (AIP-66 §5);
63
+ // follow-up turns send to the same vendor session.
64
+ mode: "persistent",
65
+ idle_timeout_ms: 18e5,
66
+ context_carryover: true
67
+ },
68
+ // NO `models` menu: the vendor picks and bills the model inside its own
69
+ // harness; the host has no model to select or route (AIP-66 §4 — `model`
70
+ // is only meaningful when the vendor client accepts it, and this CLI's
71
+ // cloud path exposes no model flag).
72
+ capabilities: {
73
+ // Turns stream back as ACP updates while the vendor runs them.
74
+ streaming: true,
75
+ // The vendor harness's own tools (Read/Edit/Bash/…) surface as ACP
76
+ // tool_call / tool_call_update updates from the session's events.
77
+ tool_calls: true,
78
+ sub_agents: false,
79
+ file_io: true,
80
+ multimodal: false,
81
+ // Re-attach is via the persisted vendor session id (AIP-66 §5), not an
82
+ // ACP session/load replay.
83
+ resumable: true,
84
+ // Send-only prompting: the CLI never returns the reply on the prompt
85
+ // path; the reply is observed via the sessions API.
86
+ bidirectional: false
87
+ },
88
+ tags: [
89
+ "claude-code",
90
+ "anthropic",
91
+ "cloud",
92
+ "aip-66",
93
+ "acp",
94
+ "agent-runtime",
95
+ "coding"
96
+ ],
97
+ metadata: {
98
+ aip: 66,
99
+ // The harness the vendor runs (AIP-66 §2 CloudVendor.harnesses).
100
+ harness: "claude-code",
101
+ cloud: {
102
+ vendor: "anthropic"
103
+ },
104
+ // AIP-66 §4 refused spawn fields, machine-readable for the host gate.
105
+ refusedSpawnFields: [...CLOUD_REFUSED_SPAWN_FIELDS]
106
+ }
107
+ });
108
+ function claudeCodeCloudRuntime() {
109
+ return createAgentCliRuntime(claudeCodeCloud);
110
+ }
111
+
112
+ export { CLOUD_REFUSED_SPAWN_FIELDS, claudeCodeCloud, claudeCodeCloudRuntime };
113
+ //# sourceMappingURL=index.mjs.map
114
+ //# sourceMappingURL=index.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;AA4BA,IAAM,MAAA,GAAS,aAAA;AAAA,EACb,IAAI,GAAA,CAAI,kCAAA,EAAoC,MAAA,CAAA,IAAA,CAAY,GAAG;AAC7D,CAAA;AAMO,IAAM,0BAAA,GAA6B;AAAA,EACxC,SAAA;AAAA,EACA,UAAA;AAAA,EACA,gBAAA;AAAA,EACA,YAAA;AAAA,EACA,aAAA;AAAA,EACA,SAAA;AAAA,EACA,SAAA;AAAA,EACA,UAAA;AAAA,EACA;AACF;AAEO,IAAM,kBAAkC,cAAA,CAAe;AAAA,EAC5D,IAAA,EAAM,mBAAA;AAAA,EACN,EAAA,EAAI,mBAAA;AAAA,EACJ,WAAA,EACE,ohBAAA;AAAA,EAQF,OAAA,EAAS,OAAA;AAAA,EACT,GAAA,EAAK,MAAA;AAAA,E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K,EAAA;AAAA;AAAA,IAEL,OAAA,EAAS,aAAA;AAAA,IACT,KAAA,EAAO;AAAA,MACL,MAAA,EAAQ;AAAA,KACV;AAAA;AAAA,IAEA,kBAAA,EAAoB,CAAC,GAAG,0BAA0B;AAAA;AAEtD,CAAC;AAEM,SAAS,sBAAA,GAA0C;AACxD,EAAA,OAAO,sBAAsB,eAAe,CAAA;AAC9C","file":"index.mjs","sourcesContent":["/**\n * @agentproto/adapter-claude-code-cloud — AIP-66 managed cloud agent adapter\n * for Anthropic Claude Code cloud sessions.\n *\n * Unlike `@agentproto/adapter-claude-code` (local harness, host machine),\n * this adapter relays a session the VENDOR hosts end to end: the vendor\n * boots the machine, runs Claude Code in it, and exposes the session\n * through `claude --cloud` / `claude -p --cloud` plus the undocumented\n * Claude Code sessions API. No agentproto daemon runs inside; the host\n * controls neither the machine nor the harness — so this manifest is\n * deliberately smaller and refuses the spawn fields that could never take\n * effect (AIP-66 §4).\n *\n * import { claudeCodeCloud } from \"@agentproto/adapter-claude-code-cloud\"\n */\n\nimport { fileURLToPath } from \"node:url\"\nimport {\n createAgentCliRuntime,\n defineAgentCli,\n type AgentCliHandle,\n type AgentCliRuntime,\n} from \"@agentproto/driver-agent-cli\"\n\n// Self-locating: the built handle spawns `node <this-pkg>/bin/…\n// claude-code-cloud-acp.mjs`. From dist/index.mjs the bin sits one level up,\n// so the same build works whether the daemon resolves this package from\n// node_modules or a user runs the published bin directly.\nconst acpBin = fileURLToPath(\n new URL(\"../bin/claude-code-cloud-acp.mjs\", import.meta.url),\n)\n\n// AIP-66 §4 refused spawn fields — no meaning for a vendor-owned harness, so\n// the host MUST refuse a cloud spawn that sets any of them rather than\n// ignore them. Documented here (and in CLAUDE-CODE-CLOUD.md) so the runtime\n// gate and users share one list.\nexport const CLOUD_REFUSED_SPAWN_FIELDS = [\n \"sandbox\",\n \"worktree\",\n \"commandSandbox\",\n \"mcpServers\",\n \"daemonMount\",\n \"bundles\",\n \"browser\",\n \"appServe\",\n \"inference\",\n] as const\n\nexport const claudeCodeCloud: AgentCliHandle = defineAgentCli({\n name: \"claude-code-cloud\",\n id: \"claude-code-cloud\",\n description:\n \"AIP-66 managed cloud agent adapter for Anthropic Claude Code cloud \" +\n \"sessions. The vendor owns the machine and the harness: starts via \" +\n \"`claude --cloud` (TTY), prompts via `claude -p --cloud <id>`, observes \" +\n \"via the Claude Code sessions API, projected onto stdio ACP. Refuses \" +\n \"the AIP-66 §4 spawn fields (sandbox, worktree, commandSandbox, \" +\n \"mcpServers, daemonMount, bundles, browser, appServe, inference) — the \" +\n \"vendor can never apply them. Requires a claude.ai sign-in (API-key \" +\n \"auth is refused) and a clean, pushed git checkout.\",\n version: \"0.1.0\",\n bin: \"node\",\n bin_args: [acpBin],\n install: [\n {\n method: \"npm\",\n package: \"@agentproto/adapter-claude-code-cloud\",\n global: true,\n },\n ],\n // Presence probe against the vendor client this adapter relays to — the\n // pinned floor is the oldest CLI observed to support `--cloud` / the\n // sessions API (AIP-66 Appendix A: 2.1.296–2.1.299).\n version_check: {\n cmd: \"claude --version\",\n parse: \"(\\\\d+\\\\.\\\\d+\\\\.\\\\d+)\",\n range: \">=2.1.296\",\n timeout_ms: 15_000,\n },\n // Auth is the user's OWN claude.ai login inside the claude CLI (keychain\n // on macOS) — never an injected env credential (AIP-66 §8). No `state.env`\n // because an API-key env would be scrubbed, not consumed; the preflight\n // refuses an api_key-authenticated CLI outright.\n auth: {\n ref: \"./CLAUDE-CODE-CLOUD.md\",\n login: {\n cmd: \"claude auth login\",\n interactive: true,\n },\n },\n // The machine is the vendor's; there is no host-side sandbox to describe.\n sandbox:\n \"Managed cloud (AIP-66): the vendor boots the machine and runs Claude \" +\n \"Code on it. No agentproto daemon runs inside; the session URL is \" +\n \"surfaced so the user can inspect what ran.\",\n protocol: \"acp\",\n acp: \"./CLAUDE-CODE-CLOUD.md\",\n session: {\n // One agentproto session = one vendor cloud session (AIP-66 §5);\n // follow-up turns send to the same vendor session.\n mode: \"persistent\",\n idle_timeout_ms: 1_800_000,\n context_carryover: true,\n },\n // NO `models` menu: the vendor picks and bills the model inside its own\n // harness; the host has no model to select or route (AIP-66 §4 — `model`\n // is only meaningful when the vendor client accepts it, and this CLI's\n // cloud path exposes no model flag).\n capabilities: {\n // Turns stream back as ACP updates while the vendor runs them.\n streaming: true,\n // The vendor harness's own tools (Read/Edit/Bash/…) surface as ACP\n // tool_call / tool_call_update updates from the session's events.\n tool_calls: true,\n sub_agents: false,\n file_io: true,\n multimodal: false,\n // Re-attach is via the persisted vendor session id (AIP-66 §5), not an\n // ACP session/load replay.\n resumable: true,\n // Send-only prompting: the CLI never returns the reply on the prompt\n // path; the reply is observed via the sessions API.\n bidirectional: false,\n },\n tags: [\n \"claude-code\",\n \"anthropic\",\n \"cloud\",\n \"aip-66\",\n \"acp\",\n \"agent-runtime\",\n \"coding\",\n ],\n metadata: {\n aip: 66,\n // The harness the vendor runs (AIP-66 §2 CloudVendor.harnesses).\n harness: \"claude-code\",\n cloud: {\n vendor: \"anthropic\",\n },\n // AIP-66 §4 refused spawn fields, machine-readable for the host gate.\n refusedSpawnFields: [...CLOUD_REFUSED_SPAWN_FIELDS],\n },\n})\n\nexport function claudeCodeCloudRuntime(): AgentCliRuntime {\n return createAgentCliRuntime(claudeCodeCloud)\n}\n\nexport {\n ClaudeCloudAcpAgent,\n runAcpOverStdio,\n resultEventUpdates,\n resultStopReason,\n POLL_INITIAL_MS,\n POLL_MAX_MS,\n type ClaudeCloudAcpDeps,\n type CloudCliDeps,\n type CloudEventsClient,\n} from \"./acp-server.js\"\nexport {\n cloudChildEnv,\n defaultCloudCliRunner,\n parseAuthStatus,\n parseCloudStartOutput,\n preflightAuth,\n sendPrompt,\n startCloudSession,\n CLAUDE_CODE_GATEWAY_ENV_UNSET,\n type AuthStatus,\n type CloudCliRunner,\n type RunOpts,\n type RunResult,\n type StartedCloudSession,\n} from \"./cli.js\"\nexport {\n SessionsApi,\n envCredentialSource,\n keychainCredentialSource,\n normalizeSessionId,\n toCliSessionId,\n type CloudCredential,\n type CloudEventsPage,\n type CloudGetSessionResponse,\n type CloudSessionEvent,\n type CloudSessionState,\n type CloudSessionSummary,\n type CredentialSource,\n type SessionsApiOptions,\n} from \"./sessions-api.js\"\nexport {\n validateRepoSource,\n defaultGitRunner,\n type GitRunner,\n} from \"./repo-source.js\"\nexport type { AgentCliHandle, AgentCliRuntime }\n"]}
package/package.json CHANGED
@@ -1,6 +1,74 @@
1
1
  {
2
2
  "name": "@agentproto/adapter-claude-code-cloud",
3
- "version": "0.0.0-stage",
4
- "stub": true,
5
- "description": "Temporary package placeholder for staged publishing"
3
+ "version": "0.1.0",
4
+ "description": "@agentproto/adapter-claude-code-cloud — AIP-66 managed-cloud-agent adapter for Anthropic Claude Code cloud sessions. Relays `claude --cloud` / `claude -p --cloud` and the undocumented Claude Code sessions API behind an AIP-44 ACP server; the vendor owns the machine and the harness, no agentproto daemon runs inside.",
5
+ "keywords": [
6
+ "agentproto",
7
+ "aip-44",
8
+ "aip-45",
9
+ "aip-66",
10
+ "claude-code",
11
+ "anthropic",
12
+ "cloud",
13
+ "acp",
14
+ "agent-cli",
15
+ "adapter"
16
+ ],
17
+ "homepage": "https://agentproto.sh/docs/aip-45",
18
+ "repository": {
19
+ "type": "git",
20
+ "url": "https://github.com/agentproto/ts",
21
+ "directory": "adapters/claude-code-cloud"
22
+ },
23
+ "license": "Apache-2.0",
24
+ "type": "module",
25
+ "main": "dist/index.mjs",
26
+ "module": "dist/index.mjs",
27
+ "types": "dist/index.d.ts",
28
+ "bin": {
29
+ "agentproto-claude-code-cloud-acp": "./bin/claude-code-cloud-acp.mjs"
30
+ },
31
+ "exports": {
32
+ ".": {
33
+ "types": "./dist/index.d.ts",
34
+ "import": "./dist/index.mjs",
35
+ "default": "./dist/index.mjs"
36
+ },
37
+ "./CLAUDE-CODE-CLOUD.md": "./CLAUDE-CODE-CLOUD.md",
38
+ "./package.json": "./package.json"
39
+ },
40
+ "files": [
41
+ "dist",
42
+ "bin",
43
+ "CLAUDE-CODE-CLOUD.md",
44
+ "README.md",
45
+ "LICENSE"
46
+ ],
47
+ "publishConfig": {
48
+ "access": "public"
49
+ },
50
+ "dependencies": {
51
+ "@agentclientprotocol/sdk": "^0.21.1",
52
+ "@agentproto/adapter-claude-sdk": "0.7.24",
53
+ "@agentproto/driver-agent-cli": "2.13.0",
54
+ "@agentproto/provider-presets": "0.7.0"
55
+ },
56
+ "optionalDependencies": {
57
+ "node-pty": "^1.1.0"
58
+ },
59
+ "devDependencies": {
60
+ "@types/node": "^25.9.5",
61
+ "tsup": "^8.5.1",
62
+ "typescript": "^5.9.3",
63
+ "vitest": "^3.2.7",
64
+ "@agentproto/tooling": "0.1.0"
65
+ },
66
+ "scripts": {
67
+ "dev": "tsup --watch",
68
+ "build": "tsup",
69
+ "clean": "rm -rf dist",
70
+ "check-types": "tsc --noEmit",
71
+ "test": "vitest run --passWithNoTests",
72
+ "test:watch": "vitest"
73
+ }
6
74
  }