@agenticprimitives/acp 0.0.0-alpha.23 → 0.0.0-alpha.25
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/README.md +13 -3
- package/bin/acp-stub-agent.mjs +21 -9
- package/dist/host.d.ts +36 -8
- package/dist/host.d.ts.map +1 -1
- package/dist/host.js +40 -16
- package/dist/host.js.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/protocol.d.ts +2 -0
- package/dist/protocol.d.ts.map +1 -1
- package/dist/protocol.js.map +1 -1
- package/package.json +2 -2
- package/spec.md +1 -1
package/README.md
CHANGED
|
@@ -20,10 +20,20 @@ await host.stop();
|
|
|
20
20
|
```
|
|
21
21
|
|
|
22
22
|
What the host does: speaks ACP to the agent it spawned; streams the agent's updates; answers the agent's
|
|
23
|
-
`session/request_permission` by **policy** — a workspace tool (the `workspace` MCP server's) is
|
|
23
|
+
`session/request_permission` by **policy** — a workspace tool (the `workspace` MCP server's) is allowed once because
|
|
24
24
|
the workspace decides when the call arrives as `harness.ask`; a local tool (the agent's own shell or files) is refused
|
|
25
|
-
unless your policy says otherwise. What it never does: offer the agent your files or terminal,
|
|
26
|
-
act itself.
|
|
25
|
+
unless your policy says otherwise. What it never does: offer the agent your files or terminal, decide a workspace
|
|
26
|
+
act itself, or pick an "always allow" option.
|
|
27
|
+
|
|
28
|
+
**Which calls are workspace calls is yours to say.** Everything in a permission request is written by the agent, and
|
|
29
|
+
ACP carries no server identity on a tool call, so the host never infers it from a title or arguments. Pass `classify`
|
|
30
|
+
— a predicate keyed on something the model cannot author for the agent binary you run — or every request is treated
|
|
31
|
+
as local and refused:
|
|
32
|
+
|
|
33
|
+
```ts
|
|
34
|
+
new AcpHost({ command: 'my-agent', classify: (req, { workspaceServerName }) =>
|
|
35
|
+
req.toolCall._meta?.myAdapter === workspaceServerName ? 'workspace' : 'local' }); // a field YOUR adapter sets
|
|
36
|
+
```
|
|
27
37
|
|
|
28
38
|
The rest of W1 — the workspace MCP server (`ap runtime mcp`), pairing (`ap runtime join`), the loop (`ap runtime run`)
|
|
29
39
|
— lives in the devkit and the runtime app (spec 400 §5.2). `bin/acp-stub-agent.mjs` is a fixed-behaviour ACP agent
|
package/bin/acp-stub-agent.mjs
CHANGED
|
@@ -3,9 +3,17 @@
|
|
|
3
3
|
// intelligence: it exists so the host binding can be tested end to end in CI without goose, and so the live gate has
|
|
4
4
|
// a runtime whose behaviour is fixed. On each prompt it (1) streams a plan and a thought, (2) asks permission for a
|
|
5
5
|
// LOCAL tool (its own shell — the host must refuse by default), (3) asks permission for a WORKSPACE tool (the host
|
|
6
|
-
// allows — the workspace decides), (4) answers with a
|
|
6
|
+
// allows once when the embedding application's classifier attributes it — the workspace decides), (4) answers with a
|
|
7
|
+
// message that echoes the prompt and says what it was allowed. Both requests offer `allow_always` FIRST, the way real
|
|
8
|
+
// agents do: the default policy must never take it (spec 445 §3.7).
|
|
9
|
+
//
|
|
10
|
+
// The workspace call carries `_meta.mcp.server` — this stub's ADAPTER-set mark, standing in for whatever structured
|
|
11
|
+
// field a vetted agent binary sets outside its model's reach. The host reads it only through a classifier the
|
|
12
|
+
// embedding application supplies; the host itself trusts no field of a request.
|
|
7
13
|
//
|
|
8
14
|
// node bin/acp-stub-agent.mjs (ACP_STUB_VERSION=2 answers protocolVersion 2 — the refusal twin)
|
|
15
|
+
// ACP_STUB_LOCAL_MENTIONS_WORKSPACE=1 the LOCAL shell call's title and rawInput name the workspace server — the
|
|
16
|
+
// H-13 negative twin: mentioning the word must not make a shell a workspace tool
|
|
9
17
|
import { createInterface } from 'node:readline';
|
|
10
18
|
|
|
11
19
|
const VERSION = Number(process.env.ACP_STUB_VERSION ?? 1);
|
|
@@ -15,6 +23,7 @@ let nextId = 1000;
|
|
|
15
23
|
const pending = new Map();
|
|
16
24
|
const request = (method, params) => new Promise((resolve) => { const id = nextId++; pending.set(id, resolve); write({ jsonrpc: '2.0', id, method, params }); });
|
|
17
25
|
const sessions = new Map();
|
|
26
|
+
const OPTIONS = [{ optionId: 'always', name: 'Always allow', kind: 'allow_always' }, { optionId: 'allow', name: 'Allow', kind: 'allow_once' }, { optionId: 'reject', name: 'Reject', kind: 'reject_once' }];
|
|
18
27
|
|
|
19
28
|
const rl = createInterface({ input: process.stdin });
|
|
20
29
|
rl.on('line', (line) => {
|
|
@@ -48,16 +57,19 @@ async function handle(msg) {
|
|
|
48
57
|
notify('session/update', { sessionId: params.sessionId, update: { sessionUpdate: 'plan', entries: [{ content: 'read the workspace', priority: 'high', status: 'pending' }, { content: 'answer', priority: 'high', status: 'pending' }] } });
|
|
49
58
|
notify('session/update', { sessionId: params.sessionId, update: { sessionUpdate: 'agent_thought_chunk', content: { type: 'text', text: 'I will try my shell first, then the workspace.' } } });
|
|
50
59
|
// (2) a LOCAL tool — the host should refuse this by default
|
|
51
|
-
notify('session/update', { sessionId: params.sessionId, update: { sessionUpdate: 'tool_call', toolCallId: 'call_local_1', title: 'Run `rm -rf build`', kind: 'execute', status: 'pending', rawInput: { command: 'rm -rf build' } } });
|
|
52
|
-
const local = await request('session/request_permission', { sessionId: params.sessionId, toolCall: { toolCallId: 'call_local_1', title: 'Run `rm -rf build`', kind: 'execute', status: 'pending', rawInput: { command: 'rm -rf build' } }, options: [{ optionId: 'allow', name: 'Allow', kind: 'allow_once' }, { optionId: 'reject', name: 'Reject', kind: 'reject_once' }] });
|
|
53
|
-
const localAllowed = local?.outcome?.outcome === 'selected' && local.outcome.optionId === 'allow';
|
|
54
|
-
notify('session/update', { sessionId: params.sessionId, update: { sessionUpdate: 'tool_call_update', toolCallId: 'call_local_1', status: localAllowed ? 'completed' : 'failed' } });
|
|
55
|
-
// (3) a WORKSPACE tool — the workspace's MCP server; the host allows, the workspace decides
|
|
56
60
|
const server = s.mcpServers[0]?.name ?? 'workspace';
|
|
57
|
-
const
|
|
61
|
+
const localCall = process.env.ACP_STUB_LOCAL_MENTIONS_WORKSPACE
|
|
62
|
+
? { toolCallId: 'call_local_1', title: `${server}.cleanup (${server}): rm -rf build`, kind: 'execute', status: 'pending', rawInput: { command: 'rm -rf build', description: server, server, tool: 'workspace_ask' } }
|
|
63
|
+
: { toolCallId: 'call_local_1', title: 'Run `rm -rf build`', kind: 'execute', status: 'pending', rawInput: { command: 'rm -rf build' } };
|
|
64
|
+
notify('session/update', { sessionId: params.sessionId, update: { sessionUpdate: 'tool_call', ...localCall } });
|
|
65
|
+
const local = await request('session/request_permission', { sessionId: params.sessionId, toolCall: localCall, options: OPTIONS });
|
|
66
|
+
const localAllowed = local?.outcome?.outcome === 'selected' && (local.outcome.optionId === 'allow' || local.outcome.optionId === 'always');
|
|
67
|
+
notify('session/update', { sessionId: params.sessionId, update: { sessionUpdate: 'tool_call_update', toolCallId: 'call_local_1', status: localAllowed ? 'completed' : 'failed' } });
|
|
68
|
+
// (3) a WORKSPACE tool — the workspace's MCP server; the host allows once when classified, the workspace decides
|
|
69
|
+
const wsCall = { toolCallId: 'call_ws_1', title: `${server}.workspace_ask`, kind: 'fetch', status: 'pending', rawInput: { server, tool: 'workspace_ask', message: text.split('\n').pop() }, _meta: { mcp: { server } } };
|
|
58
70
|
notify('session/update', { sessionId: params.sessionId, update: { sessionUpdate: 'tool_call', ...wsCall } });
|
|
59
|
-
const ws = await request('session/request_permission', { sessionId: params.sessionId, toolCall: wsCall, options:
|
|
60
|
-
const wsAllowed = ws?.outcome?.outcome === 'selected' && ws.outcome.optionId === 'allow';
|
|
71
|
+
const ws = await request('session/request_permission', { sessionId: params.sessionId, toolCall: wsCall, options: OPTIONS });
|
|
72
|
+
const wsAllowed = ws?.outcome?.outcome === 'selected' && (ws.outcome.optionId === 'allow' || ws.outcome.optionId === 'always');
|
|
61
73
|
notify('session/update', { sessionId: params.sessionId, update: { sessionUpdate: 'tool_call_update', toolCallId: 'call_ws_1', status: wsAllowed ? 'completed' : 'failed' } });
|
|
62
74
|
// (4) the answer
|
|
63
75
|
const answer = `stub: heard "${text.split('\n').pop()}" · local tool ${localAllowed ? 'ALLOWED' : 'refused'} · workspace tool ${wsAllowed ? 'allowed' : 'REFUSED'}${s.loaded ? ' · session loaded' : ''} · turn ${s.turns}`;
|
package/dist/host.d.ts
CHANGED
|
@@ -1,8 +1,23 @@
|
|
|
1
1
|
import { EventEmitter } from 'node:events';
|
|
2
2
|
import { type AgentCapabilities, type ContentBlock, type InitializeResponse, type McpServerStdio, type NewSessionResponse, type PromptResponse, type RequestPermissionRequest, type RequestPermissionResponse, type SessionNotification } from './protocol.js';
|
|
3
|
-
/**
|
|
4
|
-
*
|
|
5
|
-
export type
|
|
3
|
+
/** What a permission request is about. `workspace` — a tool of the workspace MCP server (the workspace decides the
|
|
4
|
+
* act on chain); `local` — the agent's own file/shell/other tool, and ALSO anything that could not be classified. */
|
|
5
|
+
export type ToolClass = 'workspace' | 'local';
|
|
6
|
+
/** What the HOST knows about the session a request came from — the only facts in a classification the agent did not
|
|
7
|
+
* write: the MCP servers this host passed in `session/new` / `session/load`, and which name is the workspace's. */
|
|
8
|
+
export interface ToolClassifierContext {
|
|
9
|
+
mcpServers: readonly McpServerStdio[];
|
|
10
|
+
workspaceServerName: string;
|
|
11
|
+
}
|
|
12
|
+
/** The classification port (spec 445 §3.7). Supplied by the embedding application, which is the only party that can
|
|
13
|
+
* know something the agent did not author — e.g. it runs the agent binary it vetted and trusts ONE adapter-set
|
|
14
|
+
* structured field of that binary, or it correlates with its own workspace MCP server. The rule for an implementer:
|
|
15
|
+
* never decide from text the MODEL writes (`title`, `rawInput`, descriptions); a tool's arguments mention whatever
|
|
16
|
+
* a prompt injection asks them to. Returning anything but the string `'workspace'`, or throwing, means `local`. */
|
|
17
|
+
export type ToolClassifier = (req: RequestPermissionRequest, ctx: ToolClassifierContext) => ToolClass | undefined;
|
|
18
|
+
/** How a permission request is answered, given the class the host arrived at. A policy that selects an
|
|
19
|
+
* `allow_always` option is the operator's explicit choice — the default never does. */
|
|
20
|
+
export type PermissionPolicy = (req: RequestPermissionRequest, classified: ToolClass) => Promise<RequestPermissionResponse> | RequestPermissionResponse;
|
|
6
21
|
export interface AcpHostOptions {
|
|
7
22
|
/** The agent's command and arguments, e.g. `['goose', 'acp']`, `['claude-code-acp']`, `['codex-acp']`. */
|
|
8
23
|
command: string;
|
|
@@ -13,8 +28,13 @@ export interface AcpHostOptions {
|
|
|
13
28
|
name: string;
|
|
14
29
|
version?: string;
|
|
15
30
|
};
|
|
16
|
-
/** The name of the MCP server whose tools are the workspace's
|
|
31
|
+
/** The name of the MCP server whose tools are the workspace's (default `workspace`). It classifies NOTHING by
|
|
32
|
+
* itself — a tool call that mentions it is not thereby a workspace call (spec 445 §3.7). It is handed to `classify`,
|
|
33
|
+
* and a `workspace` verdict is honoured only for a session this host opened with a server of that name. */
|
|
17
34
|
workspaceServerName?: string;
|
|
35
|
+
/** Says which permission requests target the workspace MCP server. Absent ⇒ every request is `local` (fail closed):
|
|
36
|
+
* the protocol gives the host no field the agent did not author. See `ToolClassifier`. */
|
|
37
|
+
classify?: ToolClassifier;
|
|
18
38
|
permission?: PermissionPolicy;
|
|
19
39
|
/** Per-request timeout for the agent's answers to the host's requests (initialize, session/new). A prompt turn has none. */
|
|
20
40
|
requestTimeoutMs?: number;
|
|
@@ -31,8 +51,11 @@ export interface AcpHostEvents {
|
|
|
31
51
|
/** A line on stdout that was not JSON — an agent printing prose where the protocol is. Reported, never parsed. */
|
|
32
52
|
noise: [string];
|
|
33
53
|
}
|
|
34
|
-
/** The default policy: the workspace's tools are the workspace's to judge (allow); a local tool is REFUSED unless
|
|
35
|
-
* operator policy says otherwise — a host that quietly allowed an agent's shell would be the click-model bug.
|
|
54
|
+
/** The default policy: the workspace's tools are the workspace's to judge (allow ONCE); a local tool is REFUSED unless
|
|
55
|
+
* an operator policy says otherwise — a host that quietly allowed an agent's shell would be the click-model bug.
|
|
56
|
+
* It NEVER selects an `allow_always`-kind option, for either class (spec 445 §3.7): a persistent approval outlives the
|
|
57
|
+
* request that was classified and is remembered by the agent, under the agent's own notion of "the same tool". When
|
|
58
|
+
* the agent offers no one-time allow the answer is `cancelled`. A host that wants persistence supplies its own policy. */
|
|
36
59
|
export declare const refuseLocalTools: PermissionPolicy;
|
|
37
60
|
export declare class AcpHost extends EventEmitter<AcpHostEvents> {
|
|
38
61
|
private readonly opts;
|
|
@@ -44,6 +67,8 @@ export declare class AcpHost extends EventEmitter<AcpHostEvents> {
|
|
|
44
67
|
private agentInfo;
|
|
45
68
|
private readonly workspaceServerName;
|
|
46
69
|
private readonly permission;
|
|
70
|
+
/** The MCP servers THIS HOST configured, by session — the host's own record, never the agent's echo of it. */
|
|
71
|
+
private readonly sessionServers;
|
|
47
72
|
constructor(opts: AcpHostOptions);
|
|
48
73
|
/** Spawn the agent and negotiate the protocol. Refuses an agent on another major version. */
|
|
49
74
|
start(): Promise<InitializeResponse>;
|
|
@@ -64,8 +89,11 @@ export declare class AcpHost extends EventEmitter<AcpHostEvents> {
|
|
|
64
89
|
private dispatch;
|
|
65
90
|
/** The agent's callbacks. Permission by policy; the host machine's files and shell are not offered (§5.1). */
|
|
66
91
|
private answer;
|
|
67
|
-
/**
|
|
68
|
-
*
|
|
92
|
+
/** `workspace` only when ALL of: the embedding application supplied a classifier; this host opened the request's
|
|
93
|
+
* session with an MCP server named `workspaceServerName` (a session with no workspace server has no workspace
|
|
94
|
+
* tools); and the classifier answered exactly `'workspace'`. Anything else — no classifier, an unknown session, a
|
|
95
|
+
* throw, any other return — is `local`. No field of the request is read here (spec 445 §3.7): the old rule matched
|
|
96
|
+
* the server name in `title` and in stringified `rawInput`, so a shell command that mentioned the word was allowed. */
|
|
69
97
|
private classify;
|
|
70
98
|
}
|
|
71
99
|
/** A convenience for tests and CLIs: collect the text of a turn as it streams. */
|
package/dist/host.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"host.d.ts","sourceRoot":"","sources":["../src/host.ts"],"names":[],"mappings":"
|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IAC9F,UAAU,CAAC,GAAG,EAAE,MAAM,EAAE,UAAU,EAAE,cAAc,EAAE,GAAG,OAAO,CAAC,kBAAkB,CAAC;IAMxF,6HAA6H;IACvH,WAAW,CAAC,SAAS,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,EAAE,UAAU,EAAE,cAAc,EAAE,GAAG,OAAO,CAAC,OAAO,CAAC;IAOjG,mHAAmH;IAC7G,MAAM,CAAC,SAAS,EAAE,MAAM,EAAE,MAAM,EAAE,YAAY,EAAE,GAAG,OAAO,CAAC,cAAc,CAAC;IAIhF,MAAM,CAAC,SAAS,EAAE,MAAM,GAAG,IAAI;IAEzB,IAAI,IAAI,OAAO,CAAC,IAAI,CAAC;IAc3B,OAAO,CAAC,OAAO;IAWf,OAAO,CAAC,MAAM;IAEd,OAAO,CAAC,IAAI;IAKZ,OAAO,CAAC,MAAM;YAcA,QAAQ;IAyBtB,8GAA8G;YAChG,MAAM;IAapB;;;;4HAIwH;IACxH,OAAO,CAAC,QAAQ;CAWjB;AAED,kFAAkF;AAClF,wBAAgB,WAAW,CAAC,IAAI,EAAE,OAAO,EAAE,SAAS,EAAE,MAAM,GAAG;IAAE,IAAI,EAAE,MAAM,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,IAAI,CAAA;CAAE,CAStG"}
|
package/dist/host.js
CHANGED
|
@@ -3,20 +3,30 @@
|
|
|
3
3
|
// The host is deliberately small and deliberately dumb about authority: it negotiates the protocol, opens sessions,
|
|
4
4
|
// sends prompts, streams the agent's updates to whoever listens, and answers the agent's callbacks by POLICY ports.
|
|
5
5
|
// It offers the agent none of the host machine (`clientCapabilities.fs` / `.terminal` are false — the agent's files
|
|
6
|
-
// and shell are the agent's own) and it decides no workspace question: a
|
|
7
|
-
// because the WORKSPACE decides it, on chain, when the call arrives
|
|
8
|
-
//
|
|
6
|
+
// and shell are the agent's own) and it decides no workspace question: a call the EMBEDDING APPLICATION attributes to
|
|
7
|
+
// the workspace MCP server may be allowed once here because the WORKSPACE decides it, on chain, when the call arrives
|
|
8
|
+
// as `harness.ask` (spec 400 §5.1). Everything else is the agent's LOCAL tool, outside the substrate's authority
|
|
9
|
+
// model by construction, and refused unless an operator policy says otherwise.
|
|
10
|
+
//
|
|
11
|
+
// THE AGENT DOES NOT CLASSIFY ITS OWN TOOL (spec 445 §3.7, audit H-13 / NAME-1). Every field of a
|
|
12
|
+
// `session/request_permission` is written by the agent: ACP v1 carries no server identity on a tool call, and the
|
|
13
|
+
// workspace MCP server is spawned by the agent, not by this host, so the host observes none of its traffic. This file
|
|
14
|
+
// therefore reads NO field of the request to classify it — not `title`, not `rawInput`, not `kind`, not `_meta`, not an
|
|
15
|
+
// earlier `tool_call` update (also the agent's). Without a `classify` port every call is `local`.
|
|
9
16
|
//
|
|
10
17
|
// Transport: newline-delimited JSON on stdout/stdin — what every ACP agent ships today. A future framed transport is a
|
|
11
18
|
// second `Transport` implementation, not a change to this file's protocol handling.
|
|
12
19
|
import { spawn } from 'node:child_process';
|
|
13
20
|
import { EventEmitter } from 'node:events';
|
|
14
21
|
import { ACP_ERRORS, ACP_METHODS, ACP_PROTOCOL_VERSION, isNotification, isRequest, isResponse, } from './protocol.js';
|
|
15
|
-
/** The default policy: the workspace's tools are the workspace's to judge (allow); a local tool is REFUSED unless
|
|
16
|
-
* operator policy says otherwise — a host that quietly allowed an agent's shell would be the click-model bug.
|
|
22
|
+
/** The default policy: the workspace's tools are the workspace's to judge (allow ONCE); a local tool is REFUSED unless
|
|
23
|
+
* an operator policy says otherwise — a host that quietly allowed an agent's shell would be the click-model bug.
|
|
24
|
+
* It NEVER selects an `allow_always`-kind option, for either class (spec 445 §3.7): a persistent approval outlives the
|
|
25
|
+
* request that was classified and is remembered by the agent, under the agent's own notion of "the same tool". When
|
|
26
|
+
* the agent offers no one-time allow the answer is `cancelled`. A host that wants persistence supplies its own policy. */
|
|
17
27
|
export const refuseLocalTools = (req, classified) => {
|
|
18
28
|
const pick = (kinds) => req.options.find((o) => kinds.includes(o.kind));
|
|
19
|
-
const choice = classified === 'workspace' ? pick(['allow_once'
|
|
29
|
+
const choice = classified === 'workspace' ? pick(['allow_once']) : pick(['reject_once', 'reject_always']);
|
|
20
30
|
return choice ? { outcome: { outcome: 'selected', optionId: choice.optionId } } : { outcome: { outcome: 'cancelled' } };
|
|
21
31
|
};
|
|
22
32
|
export class AcpHost extends EventEmitter {
|
|
@@ -29,6 +39,8 @@ export class AcpHost extends EventEmitter {
|
|
|
29
39
|
agentInfo;
|
|
30
40
|
workspaceServerName;
|
|
31
41
|
permission;
|
|
42
|
+
/** The MCP servers THIS HOST configured, by session — the host's own record, never the agent's echo of it. */
|
|
43
|
+
sessionServers = new Map();
|
|
32
44
|
constructor(opts) {
|
|
33
45
|
super();
|
|
34
46
|
this.opts = opts;
|
|
@@ -70,13 +82,17 @@ export class AcpHost extends EventEmitter {
|
|
|
70
82
|
get agent() { return this.agentInfo; }
|
|
71
83
|
/** Open a session. The workspace reaches the agent as the MCP server named here (spec 400 §5.2). */
|
|
72
84
|
async newSession(cwd, mcpServers) {
|
|
73
|
-
|
|
85
|
+
const res = (await this.request(ACP_METHODS.newSession, { cwd, mcpServers }));
|
|
86
|
+
if (typeof res?.sessionId === 'string')
|
|
87
|
+
this.sessionServers.set(res.sessionId, [...mcpServers]);
|
|
88
|
+
return res;
|
|
74
89
|
}
|
|
75
90
|
/** Resume a session the agent remembers — only when it said it can (`loadSession`); otherwise the caller opens a new one. */
|
|
76
91
|
async loadSession(sessionId, cwd, mcpServers) {
|
|
77
92
|
if (!this.agentCapabilities.loadSession)
|
|
78
93
|
return false;
|
|
79
94
|
await this.request(ACP_METHODS.loadSession, { sessionId, cwd, mcpServers });
|
|
95
|
+
this.sessionServers.set(sessionId, [...mcpServers]);
|
|
80
96
|
return true;
|
|
81
97
|
}
|
|
82
98
|
/** One prompt turn. Resolves when the agent ends the turn; updates stream through the `update` event meanwhile. */
|
|
@@ -181,16 +197,24 @@ export class AcpHost extends EventEmitter {
|
|
|
181
197
|
e.code = ACP_ERRORS.methodNotFound;
|
|
182
198
|
throw e;
|
|
183
199
|
}
|
|
184
|
-
/**
|
|
185
|
-
*
|
|
200
|
+
/** `workspace` only when ALL of: the embedding application supplied a classifier; this host opened the request's
|
|
201
|
+
* session with an MCP server named `workspaceServerName` (a session with no workspace server has no workspace
|
|
202
|
+
* tools); and the classifier answered exactly `'workspace'`. Anything else — no classifier, an unknown session, a
|
|
203
|
+
* throw, any other return — is `local`. No field of the request is read here (spec 445 §3.7): the old rule matched
|
|
204
|
+
* the server name in `title` and in stringified `rawInput`, so a shell command that mentioned the word was allowed. */
|
|
186
205
|
classify(r) {
|
|
187
|
-
const
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
const
|
|
191
|
-
if (
|
|
192
|
-
return '
|
|
193
|
-
|
|
206
|
+
const classify = this.opts.classify;
|
|
207
|
+
if (!classify)
|
|
208
|
+
return 'local';
|
|
209
|
+
const mcpServers = this.sessionServers.get(r?.sessionId);
|
|
210
|
+
if (!mcpServers || !mcpServers.some((s) => s.name === this.workspaceServerName))
|
|
211
|
+
return 'local';
|
|
212
|
+
try {
|
|
213
|
+
return classify(r, { mcpServers, workspaceServerName: this.workspaceServerName }) === 'workspace' ? 'workspace' : 'local';
|
|
214
|
+
}
|
|
215
|
+
catch {
|
|
216
|
+
return 'local';
|
|
217
|
+
}
|
|
194
218
|
}
|
|
195
219
|
}
|
|
196
220
|
/** A convenience for tests and CLIs: collect the text of a turn as it streams. */
|
package/dist/host.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"host.js","sourceRoot":"","sources":["../src/host.ts"],"names":[],"mappings":"AAAA,8GAA8G;AAC9G,EAAE;AACF,oHAAoH;AACpH,oHAAoH;AACpH,oHAAoH;AACpH,
|
|
1
|
+
{"version":3,"file":"host.js","sourceRoot":"","sources":["../src/host.ts"],"names":[],"mappings":"AAAA,8GAA8G;AAC9G,EAAE;AACF,oHAAoH;AACpH,oHAAoH;AACpH,oHA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CAAC;IACF,IAAI,CAAC,EAAE,CAAC,QAAQ,EAAE,EAAE,CAAC,CAAC;IACtB,OAAO,EAAE,IAAI,EAAE,GAAG,EAAE,CAAC,GAAG,EAAE,IAAI,EAAE,GAAG,EAAE,GAAG,IAAI,CAAC,GAAG,CAAC,QAAQ,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;AACtE,CAAC"}
|
package/dist/index.d.ts
CHANGED
|
@@ -4,5 +4,5 @@ export declare const SPEC_REF: "specs/400-closing-the-workspace-gap-buzz-and-tea
|
|
|
4
4
|
export { ACP_PROTOCOL_VERSION, ACP_METHODS, ACP_ERRORS, isRequest, isNotification, isResponse, } from './protocol.js';
|
|
5
5
|
export type { JsonRpcId, JsonRpcRequest, JsonRpcNotification, JsonRpcError, JsonRpcResponse, JsonRpcMessage, Implementation, ClientCapabilities, AgentCapabilities, InitializeRequest, InitializeResponse, McpServerStdio, NewSessionRequest, NewSessionResponse, LoadSessionRequest, ContentBlock, PromptRequest, StopReason, PromptResponse, CancelNotification, ToolKind, ToolCallStatus, ToolCallContent, ToolCall, PlanEntry, SessionUpdate, SessionNotification, PermissionOptionKind, PermissionOption, RequestPermissionRequest, RequestPermissionOutcome, RequestPermissionResponse, } from './protocol.js';
|
|
6
6
|
export { AcpHost, refuseLocalTools, collectText } from './host.js';
|
|
7
|
-
export type { AcpHostOptions, AcpHostEvents, PermissionPolicy } from './host.js';
|
|
7
|
+
export type { AcpHostOptions, AcpHostEvents, PermissionPolicy, ToolClass, ToolClassifier, ToolClassifierContext } from './host.js';
|
|
8
8
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAUA,eAAO,MAAM,YAAY,EAAG,wBAAiC,CAAC;AAC9D,eAAO,MAAM,cAAc,EAAG,SAAkB,CAAC;AACjD,eAAO,MAAM,QA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Ac,EAAE,iBAAiB,EAAE,kBAAkB,EAAE,kBAAkB,EAAE,YAAY,EAAE,aAAa,EAAE,UAAU,EAClH,cAAc,EAAE,kBAAkB,EAAE,QAAQ,EAAE,cAAc,EAAE,eAAe,EAAE,QAAQ,EAAE,SAAS,EAAE,aAAa,EACjH,mBAAmB,EAAE,oBAAoB,EAAE,gBAAgB,EAAE,wBAAwB,EAAE,wBAAwB,EAC/G,yBAAyB,GAC1B,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,OAAO,EAAE,gBAAgB,EAAE,WAAW,EAAE,MAAM,WAAW,CAAC;AACnE,YAAY,EAAE,cAAc,EAAE,aAAa,EAAE,gBAAgB,EAAE,SAAS,EAAE,cAAc,EAAE,qBAAqB,EAAE,MAAM,WAAW,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
// the MCP server the host hands it, whose every tool is one wire-signed A2A request as the runtime itself. ACP sits
|
|
8
8
|
// behind A2A — it is a transport binding (ADR-0057), never a second authority model: a read answers against the
|
|
9
9
|
// runtime's standing; a write parks for the steward's mandate; `session/request_permission` is answered by policy,
|
|
10
|
-
// never by a click that grants anything.
|
|
10
|
+
// never by a click that grants anything, and the agent never classifies its own tool (spec 445 §3.7).
|
|
11
11
|
export const PACKAGE_NAME = '@agenticprimitives/acp';
|
|
12
12
|
export const PACKAGE_STATUS = 'w1-host';
|
|
13
13
|
export const SPEC_REF = 'specs/400-closing-the-workspace-gap-buzz-and-team-agent-platforms.md';
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,iFAAiF;AACjF,EAAE;AACF,sHAAsH;AACtH,6HAA6H;AAC7H,8GAA8G;AAC9G,uHAAuH;AACvH,oHAAoH;AACpH,gHAAgH;AAChH,mHAAmH;AACnH,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,iFAAiF;AACjF,EAAE;AACF,sHAAsH;AACtH,6HAA6H;AAC7H,8GAA8G;AAC9G,uHAAuH;AACvH,oHAAoH;AACpH,gHAAgH;AAChH,mHAAmH;AACnH,sGAAsG;AACtG,MAAM,CAAC,MAAM,YAAY,GAAG,wBAAiC,CAAC;AAC9D,MAAM,CAAC,MAAM,cAAc,GAAG,SAAkB,CAAC;AACjD,MAAM,CAAC,MAAM,QAAQ,GAAG,sEAA+E,CAAC;AAExG,OAAO,EACL,oBAAoB,EAAE,WAAW,EAAE,UAAU,EAAE,SAAS,EAAE,cAAc,EAAE,UAAU,GACrF,MAAM,eAAe,CAAC;AASvB,OAAO,EAAE,OAAO,EAAE,gBAAgB,EAAE,WAAW,EAAE,MAAM,WAAW,CAAC"}
|
package/dist/protocol.d.ts
CHANGED
|
@@ -163,6 +163,8 @@ export interface ToolCall {
|
|
|
163
163
|
}>;
|
|
164
164
|
rawInput?: unknown;
|
|
165
165
|
rawOutput?: unknown;
|
|
166
|
+
/** The protocol's extension point. Like every other field here it is written by the AGENT (spec 445 §3.7). */
|
|
167
|
+
_meta?: Record<string, unknown>;
|
|
166
168
|
}
|
|
167
169
|
export interface PlanEntry {
|
|
168
170
|
content: string;
|
package/dist/protocol.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"protocol.d.ts","sourceRoot":"","sources":["../src/protocol.ts"],"names":[],"mappings":"AASA,4GAA4G;AAC5G,eAAO,MAAM,oBAAoB,EAAG,CAAU,CAAC;AAI/C,MAAM,MAAM,SAAS,GAAG,MAAM,GAAG,MAAM,CAAC;AACxC,MAAM,WAAW,cAAc;IAAG,OAAO,EAAE,KAAK,CAAC;IAAC,EAAE,EAAE,SAAS,CAAC;IAAC,MAAM,EAAE,MAAM,CAAC;IAAC,MAAM,CAAC,EAAE,OAAO,CAAA;CAAE;AACnG,MAAM,WAAW,mBAAmB;IAAG,OAAO,EAAE,KAAK,CA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,IAAI,IAAI,CAAC,CAAC;AA8ErG,iCAAiC;AACjC,MAAM,CAAC,MAAM,WAAW,GAAG;IACzB,UAAU,EAAE,YAAY;IACxB,UAAU,EAAE,aAAa;IACzB,WAAW,EAAE,cAAc;IAC3B,MAAM,EAAE,gBAAgB;IACxB,MAAM,EAAE,gBAAgB;IACxB,MAAM,EAAE,gBAAgB;IACxB,iBAAiB,EAAE,4BAA4B;IAC/C,MAAM,EAAE,mBAAmB;IAC3B,OAAO,EAAE,oBAAoB;CACrB,CAAC;AAEX,uFAAuF;AACvF,MAAM,CAAC,MAAM,UAAU,GAAG;IACxB,cAAc,EAAE,CAAC,KAAK;IACtB,aAAa,EAAE,CAAC,KAAK;IACrB,QAAQ,EAAE,CAAC,KAAK;CACR,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@agenticprimitives/acp",
|
|
3
|
-
"version": "0.0.0-alpha.
|
|
3
|
+
"version": "0.0.0-alpha.25",
|
|
4
4
|
"description": "Agent Client Protocol (ACP) host binding: ADMIT an existing general-purpose runtime that speaks ACP (Claude Code, goose, Codex) as a workspace MEMBER, without a rewrite — whose every act in the workspace goes through the standard A2A surface as itself, under a revocable session wire (spec 400 W1 / spec 372 S3). ACP sits behind A2A; it is never a second authority model.",
|
|
5
5
|
"homepage": "https://agenticprimitives.dev",
|
|
6
6
|
"bugs": {
|
|
@@ -25,7 +25,7 @@
|
|
|
25
25
|
"bin"
|
|
26
26
|
],
|
|
27
27
|
"dependencies": {
|
|
28
|
-
"@agenticprimitives/types": "1.0.0-alpha.
|
|
28
|
+
"@agenticprimitives/types": "1.0.0-alpha.48"
|
|
29
29
|
},
|
|
30
30
|
"devDependencies": {
|
|
31
31
|
"vitest": "^4.1.11"
|
package/spec.md
CHANGED
|
@@ -6,7 +6,7 @@ Spec of record: [specs/400-closing-the-workspace-gap-buzz-and-team-agent-platfor
|
|
|
6
6
|
|
|
7
7
|
Owns the ACP v1 protocol types and the host that runs an ACP agent as a child process: handshake (another major
|
|
8
8
|
version refused), sessions (`session/new`, `session/load` when the agent can), prompt turns with the streamed
|
|
9
|
-
`session/update`s, `session/request_permission` answered by a policy port (workspace tools
|
|
9
|
+
`session/update`s, `session/request_permission` answered by a policy port (workspace tools — attributed by the embedder's `classify` port, never by the agent's own text (spec 445 §3.7) — allowed once: the workspace
|
|
10
10
|
decides on chain; local tools refused by default), no host-machine capabilities offered. Does not own the workspace
|
|
11
11
|
MCP server, pairing, the inbound-work poll, the CLI, or any authority artifact. An optional transport binding
|
|
12
12
|
(ADR-0057): depends inward only.
|