@agentclientprotocol/claude-agent-acp 0.85.2-preview.22 → 0.85.2-preview.24
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/v2/agent.d.ts +2 -0
- package/dist/v2/agent.d.ts.map +1 -1
- package/dist/v2/agent.js +5 -0
- package/dist/v2/initialize.d.ts +2 -2
- package/dist/v2/initialize.d.ts.map +1 -1
- package/dist/v2/initialize.js +13 -3
- package/package.json +1 -1
package/dist/v2/agent.d.ts
CHANGED
|
@@ -6,6 +6,8 @@ import { ClaudeAcpAgent, type Logger } from "../acp-agent.js";
|
|
|
6
6
|
* As in `v1AgentApp`, the agent of the connection is created when the
|
|
7
7
|
* connection opens, before the connection processes any inbound message.
|
|
8
8
|
* `onAgent` receives it for the owner of the process (shutdown).
|
|
9
|
+
*
|
|
10
|
+
* The provider methods pass through: their types are the same in v1 and v2.
|
|
9
11
|
*/
|
|
10
12
|
export declare function v2AgentApp(logger: Logger | undefined, onAgent: (agent: ClaudeAcpAgent) => void): v2.AgentApp;
|
|
11
13
|
//# sourceMappingURL=agent.d.ts.map
|
package/dist/v2/agent.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"agent.d.ts","sourceRoot":"","sources":["../../src/v2/agent.ts"],"names":[],"mappings":"AAeA,OAAO,KAAK,EAAE,MAAM,0CAA0C,CAAC;AAC/D,OAAO,EAAE,cAAc,EAAkB,KAAK,MAAM,EAAE,MAAM,iBAAiB,CAAC;AAiB9E
|
|
1
|
+
{"version":3,"file":"agent.d.ts","sourceRoot":"","sources":["../../src/v2/agent.ts"],"names":[],"mappings":"AAeA,OAAO,KAAK,EAAE,MAAM,0CAA0C,CAAC;AAC/D,OAAO,EAAE,cAAc,EAAkB,KAAK,MAAM,EAAE,MAAM,iBAAiB,CAAC;AAiB9E;;;;;;;;GAQG;AACH,wBAAgB,UAAU,CACxB,MAAM,EAAE,MAAM,GAAG,SAAS,EAC1B,OAAO,EAAE,CAAC,KAAK,EAAE,cAAc,KAAK,IAAI,GACvC,EAAE,CAAC,QAAQ,CAoDb"}
|
package/dist/v2/agent.js
CHANGED
|
@@ -12,6 +12,8 @@ import { V2Terminals } from "./terminal.js";
|
|
|
12
12
|
* As in `v1AgentApp`, the agent of the connection is created when the
|
|
13
13
|
* connection opens, before the connection processes any inbound message.
|
|
14
14
|
* `onAgent` receives it for the owner of the process (shutdown).
|
|
15
|
+
*
|
|
16
|
+
* The provider methods pass through: their types are the same in v1 and v2.
|
|
15
17
|
*/
|
|
16
18
|
export function v2AgentApp(logger, onAgent) {
|
|
17
19
|
let agent;
|
|
@@ -26,6 +28,9 @@ export function v2AgentApp(logger, onAgent) {
|
|
|
26
28
|
.onRequest(v2.methods.agent.initialize, async ({ params }) => v2InitializeResponse(await agent.initialize(v1InitializeRequest(params))))
|
|
27
29
|
.onRequest(v2.methods.agent.auth.login, ({ params }) => agent.authenticate(params))
|
|
28
30
|
.onRequest(v2.methods.agent.auth.logout, ({ params }) => agent.logout(params))
|
|
31
|
+
.onRequest(v2.methods.agent.providers.list, ({ params }) => agent.unstable_listProviders(params))
|
|
32
|
+
.onRequest(v2.methods.agent.providers.set, ({ params }) => agent.unstable_setProvider(params))
|
|
33
|
+
.onRequest(v2.methods.agent.providers.disable, ({ params }) => agent.unstable_disableProvider(params))
|
|
29
34
|
.onRequest(v2.methods.agent.session.new, async ({ params }) => v2NewSessionResponse(await agent.newSession(v1NewSessionRequest(params))))
|
|
30
35
|
.onRequest(v2.methods.agent.session.list, ({ params }) => agent.listSessions(params))
|
|
31
36
|
.onRequest(v2.methods.agent.session.resume, async ({ params }) => {
|
package/dist/v2/initialize.d.ts
CHANGED
|
@@ -14,8 +14,8 @@ export declare function v1InitializeRequest(request: v2.InitializeRequest): Init
|
|
|
14
14
|
/**
|
|
15
15
|
* The v2 `initialize` response for the v1 response of the agent.
|
|
16
16
|
*
|
|
17
|
-
* It does not advertise the
|
|
18
|
-
*
|
|
17
|
+
* It does not advertise what the v2 surface does not serve yet: the
|
|
18
|
+
* extensions of {@link UNSERVED_EXTENSION_KEYS}.
|
|
19
19
|
*/
|
|
20
20
|
export declare function v2InitializeResponse(response: InitializeResponse): v2.InitializeResponse;
|
|
21
21
|
//# sourceMappingURL=initialize.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"initialize.d.ts","sourceRoot":"","sources":["../../src/v2/initialize.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AACH,OAAO,EAGL,KAAK,iBAAiB,EACtB,KAAK,kBAAkB,EACxB,MAAM,0BAA0B,CAAC;AAClC,OAAO,KAAK,EAAE,MAAM,0CAA0C,CAAC;AAE/D,0DAA0D;AAC1D,wBAAgB,mBAAmB,CAAC,OAAO,EAAE,EAAE,CAAC,iBAAiB,GAAG,iBAAiB,CA0BpF;
|
|
1
|
+
{"version":3,"file":"initialize.d.ts","sourceRoot":"","sources":["../../src/v2/initialize.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AACH,OAAO,EAGL,KAAK,iBAAiB,EACtB,KAAK,kBAAkB,EACxB,MAAM,0BAA0B,CAAC;AAClC,OAAO,KAAK,EAAE,MAAM,0CAA0C,CAAC;AAE/D,0DAA0D;AAC1D,wBAAgB,mBAAmB,CAAC,OAAO,EAAE,EAAE,CAAC,iBAAiB,GAAG,iBAAiB,CA0BpF;AASD;;;;;GAKG;AACH,wBAAgB,oBAAoB,CAAC,QAAQ,EAAE,kBAAkB,GAAG,EAAE,CAAC,kBAAkB,CAuBxF"}
|
package/dist/v2/initialize.js
CHANGED
|
@@ -37,17 +37,24 @@ export function v1InitializeRequest(request) {
|
|
|
37
37
|
...(request._meta != null ? { _meta: request._meta } : {}),
|
|
38
38
|
};
|
|
39
39
|
}
|
|
40
|
+
/**
|
|
41
|
+
* The top-level `_meta` keys of the agent's v1 `initialize` response that
|
|
42
|
+
* advertise an extension the v2 surface does not serve yet: `steering`, for
|
|
43
|
+
* `_session/steering`.
|
|
44
|
+
*/
|
|
45
|
+
const UNSERVED_EXTENSION_KEYS = ["steering"];
|
|
40
46
|
/**
|
|
41
47
|
* The v2 `initialize` response for the v1 response of the agent.
|
|
42
48
|
*
|
|
43
|
-
* It does not advertise the
|
|
44
|
-
*
|
|
49
|
+
* It does not advertise what the v2 surface does not serve yet: the
|
|
50
|
+
* extensions of {@link UNSERVED_EXTENSION_KEYS}.
|
|
45
51
|
*/
|
|
46
52
|
export function v2InitializeResponse(response) {
|
|
47
53
|
if (!response.agentInfo) {
|
|
48
54
|
throw new Error("ACP v2 requires agentInfo, and the agent reported none");
|
|
49
55
|
}
|
|
50
56
|
const meta = response.agentCapabilities?._meta;
|
|
57
|
+
const topMeta = Object.fromEntries(Object.entries(response._meta ?? {}).filter(([key]) => !UNSERVED_EXTENSION_KEYS.includes(key)));
|
|
51
58
|
return {
|
|
52
59
|
protocolVersion: v2.PROTOCOL_VERSION,
|
|
53
60
|
info: response.agentInfo,
|
|
@@ -55,10 +62,13 @@ export function v2InitializeResponse(response) {
|
|
|
55
62
|
// methods must serve `auth/logout`.
|
|
56
63
|
capabilities: {
|
|
57
64
|
session: V2_SESSION_CAPABILITIES,
|
|
65
|
+
// `providers/list`, `set`, and `disable`, which the agent serves for
|
|
66
|
+
// every client.
|
|
67
|
+
providers: {},
|
|
58
68
|
...(meta != null ? { _meta: meta } : {}),
|
|
59
69
|
},
|
|
60
70
|
authMethods: (response.authMethods ?? []).map(v2AuthMethod),
|
|
61
|
-
...(
|
|
71
|
+
...(Object.keys(topMeta).length > 0 ? { _meta: topMeta } : {}),
|
|
62
72
|
};
|
|
63
73
|
}
|
|
64
74
|
/**
|
package/package.json
CHANGED