@agent-native/core 0.64.1 → 0.66.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.
Files changed (40) hide show
  1. package/dist/agent/harness/acp-adapter.d.ts +145 -0
  2. package/dist/agent/harness/acp-adapter.d.ts.map +1 -0
  3. package/dist/agent/harness/acp-adapter.js +632 -0
  4. package/dist/agent/harness/acp-adapter.js.map +1 -0
  5. package/dist/agent/harness/acp-builtin.d.ts +25 -0
  6. package/dist/agent/harness/acp-builtin.d.ts.map +1 -0
  7. package/dist/agent/harness/acp-builtin.js +57 -0
  8. package/dist/agent/harness/acp-builtin.js.map +1 -0
  9. package/dist/agent/harness/builtin.d.ts.map +1 -1
  10. package/dist/agent/harness/builtin.js +15 -0
  11. package/dist/agent/harness/builtin.js.map +1 -1
  12. package/dist/agent/harness/index.d.ts +2 -0
  13. package/dist/agent/harness/index.d.ts.map +1 -1
  14. package/dist/agent/harness/index.js +2 -0
  15. package/dist/agent/harness/index.js.map +1 -1
  16. package/dist/embedding/agent.d.ts +32 -0
  17. package/dist/embedding/agent.d.ts.map +1 -0
  18. package/dist/embedding/agent.js +110 -0
  19. package/dist/embedding/agent.js.map +1 -0
  20. package/dist/embedding/bridge.d.ts +37 -0
  21. package/dist/embedding/bridge.d.ts.map +1 -0
  22. package/dist/embedding/bridge.js +148 -0
  23. package/dist/embedding/bridge.js.map +1 -0
  24. package/dist/embedding/index.d.ts +5 -0
  25. package/dist/embedding/index.d.ts.map +1 -0
  26. package/dist/embedding/index.js +5 -0
  27. package/dist/embedding/index.js.map +1 -0
  28. package/dist/embedding/protocol.d.ts +46 -0
  29. package/dist/embedding/protocol.d.ts.map +1 -0
  30. package/dist/embedding/protocol.js +122 -0
  31. package/dist/embedding/protocol.js.map +1 -0
  32. package/dist/embedding/react.d.ts +39 -0
  33. package/dist/embedding/react.d.ts.map +1 -0
  34. package/dist/embedding/react.js +147 -0
  35. package/dist/embedding/react.js.map +1 -0
  36. package/dist/templates/workspace-core/.agents/skills/harness-agents/SKILL.md +47 -1
  37. package/docs/content/agent-surfaces.md +4 -2
  38. package/docs/content/harness-agents.md +59 -0
  39. package/package.json +6 -1
  40. package/src/templates/workspace-core/.agents/skills/harness-agents/SKILL.md +47 -1
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  name: harness-agents
3
3
  description: >-
4
- Add or use full agent harness runtimes like Claude Code, Codex, Pi, Cursor, or Mastra inside Agent Native.
4
+ Add or use full agent harness runtimes like Claude Code, Codex, Pi, Cursor, Mastra, or ACP agents inside Agent Native.
5
5
  scope: dev
6
6
  ---
7
7
 
@@ -68,6 +68,52 @@ Harness runs are projected into the shared `BackgroundAgentRun` shape with
68
68
  `createAgentHarnessBackgroundAgentController()` and are available through the
69
69
  existing run routes as `goalId=agent-harness`.
70
70
 
71
+ ## ACP Agents
72
+
73
+ Agent Native can act as an [ACP](https://agentclientprotocol.com) (Agent Client
74
+ Protocol) client and drive a local coding agent — Gemini CLI, Claude Code, or
75
+ any ACP-compliant agent — through this same substrate. This is scoped to **local
76
+ coding**: the agent is spawned as a child process speaking newline-delimited
77
+ JSON-RPC over stdio, and inherits the parent environment so it reuses the user's
78
+ local CLI login. It is not a hosted/sandboxed transport, and it is not a
79
+ chat/A2A transport.
80
+
81
+ ```ts
82
+ import {
83
+ registerBuiltinAgentHarnesses,
84
+ resolveAgentHarness,
85
+ } from "@agent-native/core/agent/harness";
86
+
87
+ registerBuiltinAgentHarnesses();
88
+
89
+ // Built-in presets (commands overridable via the resolve config):
90
+ const gemini = resolveAgentHarness("acp:gemini");
91
+ const claude = resolveAgentHarness("acp:claude-code");
92
+
93
+ // Or any ACP agent by command:
94
+ const custom = resolveAgentHarness("acp", {
95
+ command: "gemini",
96
+ args: ["--experimental-acp"],
97
+ });
98
+ ```
99
+
100
+ - The protocol transport (`@zed-industries/agent-client-protocol`) is an optional
101
+ dependency loaded lazily; `installPackage` surfaces a clear install hint.
102
+ - The agent binary (e.g. `@google/gemini-cli`, `@zed-industries/claude-code-acp`)
103
+ is a separate external CLI the user installs; presets launch it through `npx`
104
+ by default and the command/args are overridable because agent ACP entry flags
105
+ still evolve.
106
+ - `permissionMode` maps onto ACP `session/request_permission` using the reported
107
+ tool-call kind: reads always run, edits run under `allow-edits`, everything
108
+ risky prompts unless `allow-all`. Approvals surface as `approval-request`
109
+ events; answer them through the harness session's `approve()`.
110
+ - `resumeState` carries the ACP `sessionId`; resume works when the agent
111
+ advertises the `loadSession` capability and degrades to a fresh session
112
+ otherwise.
113
+ - `fs/read_text_file` and `fs/write_text_file` are served against the session
114
+ workspace and refuse paths that escape it; terminal methods are not advertised
115
+ (the agent uses its own shell).
116
+
71
117
  ## Adapter Guidance
72
118
 
73
119
  - Keep harness packages optional. Use dynamic imports in adapters and expose an
@@ -295,8 +295,10 @@ export function SupportAgentChat() {
295
295
  Ready-made runtime helpers exist for OpenAI Agents, OpenAI Responses, the Claude
296
296
  Agent SDK, the Vercel AI SDK, and AG-UI, plus the normalized HTTP runtime above
297
297
  for any other agent (Mastra, Flue, Eve, LangGraph, or a custom service). ACP is
298
- not the default end-user app chat protocol, and Agent-Native does not currently
299
- claim A2UI support.
298
+ not the end-user app chat or A2A transport, and Agent-Native does not currently
299
+ claim A2UI support. ACP is supported in one specific place — driving a local
300
+ coding agent (Gemini CLI, Claude Code, …) through the
301
+ [harness layer](/docs/harness-agents#acp), not as the chat runtime here.
300
302
 
301
303
  [Native Chat UI — BYO agent runtimes](/docs/native-chat-ui#byo-agent-runtimes)
302
304
  is the canonical home for the event shapes, the runtime helpers, and `chatUI`
@@ -62,6 +62,65 @@ app that never uses a harness does not pay for it. Each adapter carries an
62
62
  error if the packages are missing, and `isAgentHarnessPackageInstalled(entry)`
63
63
  lets you check first.
64
64
 
65
+ `registerBuiltinAgentHarnesses()` also registers the [ACP](#acp) harnesses
66
+ (`acp`, `acp:gemini`, `acp:claude-code`).
67
+
68
+ ## ACP agents {#acp}
69
+
70
+ Agent-Native can act as an [ACP](https://agentclientprotocol.com) (Agent Client
71
+ Protocol) **client** and drive a local coding agent — Gemini CLI, Claude Code,
72
+ or any ACP-compliant agent — through this same substrate. The agent runs as a
73
+ local subprocess that speaks newline-delimited JSON-RPC over stdio; ACP's editor
74
+ ↔ agent model is exactly this shape.
75
+
76
+ This adapter is scoped to **local coding**. The child process inherits the
77
+ parent environment, so the agent reuses whatever local CLI login it already has
78
+ (for example `gemini` or `claude` auth in the user's home dir). It is not a
79
+ hosted or sandboxed transport, and it is not a chat/A2A transport — for those,
80
+ see [Agent Surfaces](/docs/agent-surfaces).
81
+
82
+ | Name | Default command | Resumable\* |
83
+ | ----------------- | ---------------------------------------------- | ----------- |
84
+ | `acp` | _(supply `command`/`args` via config)_ | yes |
85
+ | `acp:gemini` | `npx -y @google/gemini-cli --experimental-acp` | yes |
86
+ | `acp:claude-code` | `npx -y @zed-industries/claude-code-acp` | yes |
87
+
88
+ \*Resume works when the agent advertises the `loadSession` capability and
89
+ degrades to a fresh session otherwise.
90
+
91
+ ```ts
92
+ import {
93
+ registerBuiltinAgentHarnesses,
94
+ resolveAgentHarness,
95
+ } from "@agent-native/core/agent/harness";
96
+
97
+ registerBuiltinAgentHarnesses();
98
+
99
+ // A built-in preset (command/args are overridable through the resolve config):
100
+ const adapter = resolveAgentHarness("acp:gemini");
101
+
102
+ // Or any ACP agent by command:
103
+ const custom = resolveAgentHarness("acp", {
104
+ command: "gemini",
105
+ args: ["--experimental-acp"],
106
+ });
107
+ ```
108
+
109
+ The protocol transport (`@zed-industries/agent-client-protocol`) is an optional
110
+ dependency loaded lazily through the `installPackage` hint, just like the AI SDK
111
+ harnesses. The agent binary itself (`@google/gemini-cli`,
112
+ `@zed-industries/claude-code-acp`, …) is a separate external CLI; the presets
113
+ launch it through `npx` and the command/args stay overridable because agent ACP
114
+ entry flags still evolve.
115
+
116
+ `permissionMode` maps onto ACP `session/request_permission` using the tool-call
117
+ kind the agent reports: reads always run, edits run under `allow-edits`, and
118
+ everything risky prompts unless `allow-all`. Approvals surface as the normal
119
+ `approval-request` events. The adapter serves `fs/read_text_file` and
120
+ `fs/write_text_file` against the session workspace (refusing paths that escape
121
+ it) and writes emit `file-change` events; terminal methods are not advertised,
122
+ so the agent uses its own shell.
123
+
65
124
  ## Codex auth: Code UI vs harness sandboxes {#codex-auth}
66
125
 
67
126
  There are two Codex surfaces, and they authenticate differently:
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@agent-native/core",
3
- "version": "0.64.1",
3
+ "version": "0.66.0",
4
4
  "type": "module",
5
5
  "engines": {
6
6
  "node": ">=22"
@@ -116,6 +116,11 @@
116
116
  "./router": "./dist/router/index.js",
117
117
  "./collab": "./dist/collab/index.js",
118
118
  "./a2a": "./dist/a2a/index.js",
119
+ "./embedding": "./dist/embedding/index.js",
120
+ "./embedding/react": "./dist/embedding/react.js",
121
+ "./embedding/bridge": "./dist/embedding/bridge.js",
122
+ "./embedding/agent": "./dist/embedding/agent.js",
123
+ "./embedding/protocol": "./dist/embedding/protocol.js",
119
124
  "./mcp": "./dist/mcp/index.js",
120
125
  "./mcp-client": "./dist/mcp-client/index.js",
121
126
  "./tracking": "./dist/tracking/index.js",
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  name: harness-agents
3
3
  description: >-
4
- Add or use full agent harness runtimes like Claude Code, Codex, Pi, Cursor, or Mastra inside Agent Native.
4
+ Add or use full agent harness runtimes like Claude Code, Codex, Pi, Cursor, Mastra, or ACP agents inside Agent Native.
5
5
  scope: dev
6
6
  ---
7
7
 
@@ -68,6 +68,52 @@ Harness runs are projected into the shared `BackgroundAgentRun` shape with
68
68
  `createAgentHarnessBackgroundAgentController()` and are available through the
69
69
  existing run routes as `goalId=agent-harness`.
70
70
 
71
+ ## ACP Agents
72
+
73
+ Agent Native can act as an [ACP](https://agentclientprotocol.com) (Agent Client
74
+ Protocol) client and drive a local coding agent — Gemini CLI, Claude Code, or
75
+ any ACP-compliant agent — through this same substrate. This is scoped to **local
76
+ coding**: the agent is spawned as a child process speaking newline-delimited
77
+ JSON-RPC over stdio, and inherits the parent environment so it reuses the user's
78
+ local CLI login. It is not a hosted/sandboxed transport, and it is not a
79
+ chat/A2A transport.
80
+
81
+ ```ts
82
+ import {
83
+ registerBuiltinAgentHarnesses,
84
+ resolveAgentHarness,
85
+ } from "@agent-native/core/agent/harness";
86
+
87
+ registerBuiltinAgentHarnesses();
88
+
89
+ // Built-in presets (commands overridable via the resolve config):
90
+ const gemini = resolveAgentHarness("acp:gemini");
91
+ const claude = resolveAgentHarness("acp:claude-code");
92
+
93
+ // Or any ACP agent by command:
94
+ const custom = resolveAgentHarness("acp", {
95
+ command: "gemini",
96
+ args: ["--experimental-acp"],
97
+ });
98
+ ```
99
+
100
+ - The protocol transport (`@zed-industries/agent-client-protocol`) is an optional
101
+ dependency loaded lazily; `installPackage` surfaces a clear install hint.
102
+ - The agent binary (e.g. `@google/gemini-cli`, `@zed-industries/claude-code-acp`)
103
+ is a separate external CLI the user installs; presets launch it through `npx`
104
+ by default and the command/args are overridable because agent ACP entry flags
105
+ still evolve.
106
+ - `permissionMode` maps onto ACP `session/request_permission` using the reported
107
+ tool-call kind: reads always run, edits run under `allow-edits`, everything
108
+ risky prompts unless `allow-all`. Approvals surface as `approval-request`
109
+ events; answer them through the harness session's `approve()`.
110
+ - `resumeState` carries the ACP `sessionId`; resume works when the agent
111
+ advertises the `loadSession` capability and degrades to a fresh session
112
+ otherwise.
113
+ - `fs/read_text_file` and `fs/write_text_file` are served against the session
114
+ workspace and refuse paths that escape it; terminal methods are not advertised
115
+ (the agent uses its own shell).
116
+
71
117
  ## Adapter Guidance
72
118
 
73
119
  - Keep harness packages optional. Use dynamic imports in adapters and expose an