leduo-patrol 2.2.1 → 2.2.3
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 +11 -2
- package/dist/server/__tests__/acp-session.test.js +92 -0
- package/dist/server/__tests__/activity-monitor.test.js +13 -1
- package/dist/server/__tests__/session-manager.test.js +215 -1
- package/dist/server/acp-session.js +476 -0
- package/dist/server/activity-monitor.js +22 -7
- package/dist/server/index.js +54 -1
- package/dist/server/session-manager.js +1117 -121
- package/dist/web/assets/index-B-YXVUoQ.css +1 -0
- package/dist/web/assets/index-Bu0K7QgY.js +21 -0
- package/dist/web/index.html +2 -2
- package/package.json +3 -1
- package/vendor/claude-code-acp/node_modules/@agentclientprotocol/sdk/LICENSE +191 -0
- package/vendor/claude-code-acp/node_modules/@agentclientprotocol/sdk/README.md +53 -0
- package/vendor/claude-code-acp/node_modules/@agentclientprotocol/sdk/dist/acp.d.ts +823 -0
- package/vendor/claude-code-acp/node_modules/@agentclientprotocol/sdk/dist/acp.js +965 -0
- package/vendor/claude-code-acp/node_modules/@agentclientprotocol/sdk/dist/acp.js.map +1 -0
- package/vendor/claude-code-acp/node_modules/@agentclientprotocol/sdk/dist/acp.test.d.ts +1 -0
- package/vendor/claude-code-acp/node_modules/@agentclientprotocol/sdk/dist/acp.test.js +839 -0
- package/vendor/claude-code-acp/node_modules/@agentclientprotocol/sdk/dist/acp.test.js.map +1 -0
- package/vendor/claude-code-acp/node_modules/@agentclientprotocol/sdk/dist/examples/agent.d.ts +2 -0
- package/vendor/claude-code-acp/node_modules/@agentclientprotocol/sdk/dist/examples/agent.js +225 -0
- package/vendor/claude-code-acp/node_modules/@agentclientprotocol/sdk/dist/examples/agent.js.map +1 -0
- package/vendor/claude-code-acp/node_modules/@agentclientprotocol/sdk/dist/examples/client.d.ts +2 -0
- package/vendor/claude-code-acp/node_modules/@agentclientprotocol/sdk/dist/examples/client.js +130 -0
- package/vendor/claude-code-acp/node_modules/@agentclientprotocol/sdk/dist/examples/client.js.map +1 -0
- package/vendor/claude-code-acp/node_modules/@agentclientprotocol/sdk/dist/jsonrpc.d.ts +35 -0
- package/vendor/claude-code-acp/node_modules/@agentclientprotocol/sdk/dist/jsonrpc.js +5 -0
- package/vendor/claude-code-acp/node_modules/@agentclientprotocol/sdk/dist/jsonrpc.js.map +1 -0
- package/vendor/claude-code-acp/node_modules/@agentclientprotocol/sdk/dist/schema/index.d.ts +27 -0
- package/vendor/claude-code-acp/node_modules/@agentclientprotocol/sdk/dist/schema/index.js +28 -0
- package/vendor/claude-code-acp/node_modules/@agentclientprotocol/sdk/dist/schema/index.js.map +1 -0
- package/vendor/claude-code-acp/node_modules/@agentclientprotocol/sdk/dist/schema/types.gen.d.ts +2870 -0
- package/vendor/claude-code-acp/node_modules/@agentclientprotocol/sdk/dist/schema/types.gen.js +3 -0
- package/vendor/claude-code-acp/node_modules/@agentclientprotocol/sdk/dist/schema/types.gen.js.map +1 -0
- package/vendor/claude-code-acp/node_modules/@agentclientprotocol/sdk/dist/schema/zod.gen.d.ts +5333 -0
- package/vendor/claude-code-acp/node_modules/@agentclientprotocol/sdk/dist/schema/zod.gen.js +1554 -0
- package/vendor/claude-code-acp/node_modules/@agentclientprotocol/sdk/dist/schema/zod.gen.js.map +1 -0
- package/vendor/claude-code-acp/node_modules/@agentclientprotocol/sdk/dist/stream.d.ts +24 -0
- package/vendor/claude-code-acp/node_modules/@agentclientprotocol/sdk/dist/stream.js +64 -0
- package/vendor/claude-code-acp/node_modules/@agentclientprotocol/sdk/dist/stream.js.map +1 -0
- package/vendor/claude-code-acp/node_modules/@agentclientprotocol/sdk/package.json +66 -0
- package/vendor/claude-code-acp/node_modules/@agentclientprotocol/sdk/schema/schema.json +4125 -0
- package/vendor/claude-code-acp/node_modules/@types/node/LICENSE +21 -0
- package/vendor/claude-code-acp/node_modules/@types/node/README.md +15 -0
- package/vendor/claude-code-acp/node_modules/@types/node/assert/strict.d.ts +105 -0
- package/vendor/claude-code-acp/node_modules/@types/node/assert.d.ts +955 -0
- package/vendor/claude-code-acp/node_modules/@types/node/async_hooks.d.ts +623 -0
- package/vendor/claude-code-acp/node_modules/@types/node/buffer.buffer.d.ts +466 -0
- package/vendor/claude-code-acp/node_modules/@types/node/buffer.d.ts +1810 -0
- package/vendor/claude-code-acp/node_modules/@types/node/child_process.d.ts +1428 -0
- package/vendor/claude-code-acp/node_modules/@types/node/cluster.d.ts +486 -0
- package/vendor/claude-code-acp/node_modules/@types/node/compatibility/iterators.d.ts +21 -0
- package/vendor/claude-code-acp/node_modules/@types/node/console.d.ts +151 -0
- package/vendor/claude-code-acp/node_modules/@types/node/constants.d.ts +20 -0
- package/vendor/claude-code-acp/node_modules/@types/node/crypto.d.ts +4065 -0
- package/vendor/claude-code-acp/node_modules/@types/node/dgram.d.ts +564 -0
- package/vendor/claude-code-acp/node_modules/@types/node/diagnostics_channel.d.ts +576 -0
- package/vendor/claude-code-acp/node_modules/@types/node/dns/promises.d.ts +503 -0
- package/vendor/claude-code-acp/node_modules/@types/node/dns.d.ts +922 -0
- package/vendor/claude-code-acp/node_modules/@types/node/domain.d.ts +166 -0
- package/vendor/claude-code-acp/node_modules/@types/node/events.d.ts +1054 -0
- package/vendor/claude-code-acp/node_modules/@types/node/fs/promises.d.ts +1329 -0
- package/vendor/claude-code-acp/node_modules/@types/node/fs.d.ts +4676 -0
- package/vendor/claude-code-acp/node_modules/@types/node/globals.d.ts +150 -0
- package/vendor/claude-code-acp/node_modules/@types/node/globals.typedarray.d.ts +101 -0
- package/vendor/claude-code-acp/node_modules/@types/node/http.d.ts +2167 -0
- package/vendor/claude-code-acp/node_modules/@types/node/http2.d.ts +2480 -0
- package/vendor/claude-code-acp/node_modules/@types/node/https.d.ts +405 -0
- package/vendor/claude-code-acp/node_modules/@types/node/index.d.ts +115 -0
- package/vendor/claude-code-acp/node_modules/@types/node/inspector/promises.d.ts +41 -0
- package/vendor/claude-code-acp/node_modules/@types/node/inspector.d.ts +224 -0
- package/vendor/claude-code-acp/node_modules/@types/node/inspector.generated.d.ts +4226 -0
- package/vendor/claude-code-acp/node_modules/@types/node/module.d.ts +819 -0
- package/vendor/claude-code-acp/node_modules/@types/node/net.d.ts +933 -0
- package/vendor/claude-code-acp/node_modules/@types/node/os.d.ts +507 -0
- package/vendor/claude-code-acp/node_modules/@types/node/package.json +155 -0
- package/vendor/claude-code-acp/node_modules/@types/node/path/posix.d.ts +8 -0
- package/vendor/claude-code-acp/node_modules/@types/node/path/win32.d.ts +8 -0
- package/vendor/claude-code-acp/node_modules/@types/node/path.d.ts +187 -0
- package/vendor/claude-code-acp/node_modules/@types/node/perf_hooks.d.ts +643 -0
- package/vendor/claude-code-acp/node_modules/@types/node/process.d.ts +2161 -0
- package/vendor/claude-code-acp/node_modules/@types/node/punycode.d.ts +117 -0
- package/vendor/claude-code-acp/node_modules/@types/node/querystring.d.ts +152 -0
- package/vendor/claude-code-acp/node_modules/@types/node/quic.d.ts +910 -0
- package/vendor/claude-code-acp/node_modules/@types/node/readline/promises.d.ts +161 -0
- package/vendor/claude-code-acp/node_modules/@types/node/readline.d.ts +541 -0
- package/vendor/claude-code-acp/node_modules/@types/node/repl.d.ts +415 -0
- package/vendor/claude-code-acp/node_modules/@types/node/sea.d.ts +162 -0
- package/vendor/claude-code-acp/node_modules/@types/node/sqlite.d.ts +955 -0
- package/vendor/claude-code-acp/node_modules/@types/node/stream/consumers.d.ts +38 -0
- package/vendor/claude-code-acp/node_modules/@types/node/stream/promises.d.ts +211 -0
- package/vendor/claude-code-acp/node_modules/@types/node/stream/web.d.ts +296 -0
- package/vendor/claude-code-acp/node_modules/@types/node/stream.d.ts +1760 -0
- package/vendor/claude-code-acp/node_modules/@types/node/string_decoder.d.ts +67 -0
- package/vendor/claude-code-acp/node_modules/@types/node/test/reporters.d.ts +96 -0
- package/vendor/claude-code-acp/node_modules/@types/node/test.d.ts +2240 -0
- package/vendor/claude-code-acp/node_modules/@types/node/timers/promises.d.ts +108 -0
- package/vendor/claude-code-acp/node_modules/@types/node/timers.d.ts +159 -0
- package/vendor/claude-code-acp/node_modules/@types/node/tls.d.ts +1198 -0
- package/vendor/claude-code-acp/node_modules/@types/node/trace_events.d.ts +197 -0
- package/vendor/claude-code-acp/node_modules/@types/node/ts5.6/buffer.buffer.d.ts +462 -0
- package/vendor/claude-code-acp/node_modules/@types/node/ts5.6/compatibility/float16array.d.ts +71 -0
- package/vendor/claude-code-acp/node_modules/@types/node/ts5.6/globals.typedarray.d.ts +36 -0
- package/vendor/claude-code-acp/node_modules/@types/node/ts5.6/index.d.ts +117 -0
- package/vendor/claude-code-acp/node_modules/@types/node/ts5.7/compatibility/float16array.d.ts +72 -0
- package/vendor/claude-code-acp/node_modules/@types/node/ts5.7/index.d.ts +117 -0
- package/vendor/claude-code-acp/node_modules/@types/node/tty.d.ts +250 -0
- package/vendor/claude-code-acp/node_modules/@types/node/url.d.ts +519 -0
- package/vendor/claude-code-acp/node_modules/@types/node/util/types.d.ts +558 -0
- package/vendor/claude-code-acp/node_modules/@types/node/util.d.ts +1662 -0
- package/vendor/claude-code-acp/node_modules/@types/node/v8.d.ts +983 -0
- package/vendor/claude-code-acp/node_modules/@types/node/vm.d.ts +1208 -0
- package/vendor/claude-code-acp/node_modules/@types/node/wasi.d.ts +202 -0
- package/vendor/claude-code-acp/node_modules/@types/node/web-globals/abortcontroller.d.ts +59 -0
- package/vendor/claude-code-acp/node_modules/@types/node/web-globals/blob.d.ts +23 -0
- package/vendor/claude-code-acp/node_modules/@types/node/web-globals/console.d.ts +9 -0
- package/vendor/claude-code-acp/node_modules/@types/node/web-globals/crypto.d.ts +39 -0
- package/vendor/claude-code-acp/node_modules/@types/node/web-globals/domexception.d.ts +68 -0
- package/vendor/claude-code-acp/node_modules/@types/node/web-globals/encoding.d.ts +11 -0
- package/vendor/claude-code-acp/node_modules/@types/node/web-globals/events.d.ts +106 -0
- package/vendor/claude-code-acp/node_modules/@types/node/web-globals/fetch.d.ts +69 -0
- package/vendor/claude-code-acp/node_modules/@types/node/web-globals/importmeta.d.ts +13 -0
- package/vendor/claude-code-acp/node_modules/@types/node/web-globals/messaging.d.ts +23 -0
- package/vendor/claude-code-acp/node_modules/@types/node/web-globals/navigator.d.ts +25 -0
- package/vendor/claude-code-acp/node_modules/@types/node/web-globals/performance.d.ts +45 -0
- package/vendor/claude-code-acp/node_modules/@types/node/web-globals/storage.d.ts +24 -0
- package/vendor/claude-code-acp/node_modules/@types/node/web-globals/streams.d.ts +115 -0
- package/vendor/claude-code-acp/node_modules/@types/node/web-globals/timers.d.ts +44 -0
- package/vendor/claude-code-acp/node_modules/@types/node/web-globals/url.d.ts +24 -0
- package/vendor/claude-code-acp/node_modules/@types/node/worker_threads.d.ts +717 -0
- package/vendor/claude-code-acp/node_modules/@types/node/zlib.d.ts +618 -0
- package/vendor/claude-code-acp/node_modules/undici-types/LICENSE +21 -0
- package/vendor/claude-code-acp/node_modules/undici-types/README.md +6 -0
- package/vendor/claude-code-acp/node_modules/undici-types/agent.d.ts +32 -0
- package/vendor/claude-code-acp/node_modules/undici-types/api.d.ts +43 -0
- package/vendor/claude-code-acp/node_modules/undici-types/balanced-pool.d.ts +29 -0
- package/vendor/claude-code-acp/node_modules/undici-types/cache-interceptor.d.ts +172 -0
- package/vendor/claude-code-acp/node_modules/undici-types/cache.d.ts +36 -0
- package/vendor/claude-code-acp/node_modules/undici-types/client-stats.d.ts +15 -0
- package/vendor/claude-code-acp/node_modules/undici-types/client.d.ts +108 -0
- package/vendor/claude-code-acp/node_modules/undici-types/connector.d.ts +34 -0
- package/vendor/claude-code-acp/node_modules/undici-types/content-type.d.ts +21 -0
- package/vendor/claude-code-acp/node_modules/undici-types/cookies.d.ts +30 -0
- package/vendor/claude-code-acp/node_modules/undici-types/diagnostics-channel.d.ts +74 -0
- package/vendor/claude-code-acp/node_modules/undici-types/dispatcher.d.ts +276 -0
- package/vendor/claude-code-acp/node_modules/undici-types/env-http-proxy-agent.d.ts +22 -0
- package/vendor/claude-code-acp/node_modules/undici-types/errors.d.ts +161 -0
- package/vendor/claude-code-acp/node_modules/undici-types/eventsource.d.ts +66 -0
- package/vendor/claude-code-acp/node_modules/undici-types/fetch.d.ts +211 -0
- package/vendor/claude-code-acp/node_modules/undici-types/formdata.d.ts +108 -0
- package/vendor/claude-code-acp/node_modules/undici-types/global-dispatcher.d.ts +9 -0
- package/vendor/claude-code-acp/node_modules/undici-types/global-origin.d.ts +7 -0
- package/vendor/claude-code-acp/node_modules/undici-types/h2c-client.d.ts +73 -0
- package/vendor/claude-code-acp/node_modules/undici-types/handlers.d.ts +15 -0
- package/vendor/claude-code-acp/node_modules/undici-types/header.d.ts +160 -0
- package/vendor/claude-code-acp/node_modules/undici-types/index.d.ts +80 -0
- package/vendor/claude-code-acp/node_modules/undici-types/interceptors.d.ts +39 -0
- package/vendor/claude-code-acp/node_modules/undici-types/mock-agent.d.ts +68 -0
- package/vendor/claude-code-acp/node_modules/undici-types/mock-call-history.d.ts +111 -0
- package/vendor/claude-code-acp/node_modules/undici-types/mock-client.d.ts +27 -0
- package/vendor/claude-code-acp/node_modules/undici-types/mock-errors.d.ts +12 -0
- package/vendor/claude-code-acp/node_modules/undici-types/mock-interceptor.d.ts +94 -0
- package/vendor/claude-code-acp/node_modules/undici-types/mock-pool.d.ts +27 -0
- package/vendor/claude-code-acp/node_modules/undici-types/package.json +55 -0
- package/vendor/claude-code-acp/node_modules/undici-types/patch.d.ts +29 -0
- package/vendor/claude-code-acp/node_modules/undici-types/pool-stats.d.ts +19 -0
- package/vendor/claude-code-acp/node_modules/undici-types/pool.d.ts +41 -0
- package/vendor/claude-code-acp/node_modules/undici-types/proxy-agent.d.ts +29 -0
- package/vendor/claude-code-acp/node_modules/undici-types/readable.d.ts +68 -0
- package/vendor/claude-code-acp/node_modules/undici-types/retry-agent.d.ts +8 -0
- package/vendor/claude-code-acp/node_modules/undici-types/retry-handler.d.ts +125 -0
- package/vendor/claude-code-acp/node_modules/undici-types/snapshot-agent.d.ts +109 -0
- package/vendor/claude-code-acp/node_modules/undici-types/util.d.ts +18 -0
- package/vendor/claude-code-acp/node_modules/undici-types/utility.d.ts +7 -0
- package/vendor/claude-code-acp/node_modules/undici-types/webidl.d.ts +341 -0
- package/vendor/claude-code-acp/node_modules/undici-types/websocket.d.ts +186 -0
- package/dist/web/assets/index-B5Dh2E8j.css +0 -1
- package/dist/web/assets/index-xPPPaEde.js +0 -13
package/vendor/claude-code-acp/node_modules/@agentclientprotocol/sdk/dist/schema/types.gen.d.ts
ADDED
|
@@ -0,0 +1,2870 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Capabilities supported by the agent.
|
|
3
|
+
*
|
|
4
|
+
* Advertised during initialization to inform the client about
|
|
5
|
+
* available features and content types.
|
|
6
|
+
*
|
|
7
|
+
* See protocol docs: [Agent Capabilities](https://agentclientprotocol.com/protocol/initialization#agent-capabilities)
|
|
8
|
+
*/
|
|
9
|
+
export type AgentCapabilities = {
|
|
10
|
+
/**
|
|
11
|
+
* The _meta property is reserved by ACP to allow clients and agents to attach additional
|
|
12
|
+
* metadata to their interactions. Implementations MUST NOT make assumptions about values at
|
|
13
|
+
* these keys.
|
|
14
|
+
*
|
|
15
|
+
* See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)
|
|
16
|
+
*/
|
|
17
|
+
_meta?: {
|
|
18
|
+
[key: string]: unknown;
|
|
19
|
+
} | null;
|
|
20
|
+
/**
|
|
21
|
+
* Whether the agent supports `session/load`.
|
|
22
|
+
*/
|
|
23
|
+
loadSession?: boolean;
|
|
24
|
+
/**
|
|
25
|
+
* MCP capabilities supported by the agent.
|
|
26
|
+
*/
|
|
27
|
+
mcpCapabilities?: McpCapabilities;
|
|
28
|
+
/**
|
|
29
|
+
* Prompt capabilities supported by the agent.
|
|
30
|
+
*/
|
|
31
|
+
promptCapabilities?: PromptCapabilities;
|
|
32
|
+
sessionCapabilities?: SessionCapabilities;
|
|
33
|
+
};
|
|
34
|
+
export type AgentNotification = {
|
|
35
|
+
method: string;
|
|
36
|
+
params?: SessionNotification | ExtNotification | null;
|
|
37
|
+
};
|
|
38
|
+
export type AgentRequest = {
|
|
39
|
+
id: RequestId;
|
|
40
|
+
method: string;
|
|
41
|
+
params?: WriteTextFileRequest | ReadTextFileRequest | RequestPermissionRequest | CreateTerminalRequest | TerminalOutputRequest | ReleaseTerminalRequest | WaitForTerminalExitRequest | KillTerminalCommandRequest | ExtRequest | null;
|
|
42
|
+
};
|
|
43
|
+
export type AgentResponse = {
|
|
44
|
+
id: RequestId;
|
|
45
|
+
/**
|
|
46
|
+
* All possible responses that an agent can send to a client.
|
|
47
|
+
*
|
|
48
|
+
* This enum is used internally for routing RPC responses. You typically won't need
|
|
49
|
+
* to use this directly - the responses are handled automatically by the connection.
|
|
50
|
+
*
|
|
51
|
+
* These are responses to the corresponding `ClientRequest` variants.
|
|
52
|
+
*/
|
|
53
|
+
result: InitializeResponse | AuthenticateResponse | NewSessionResponse | LoadSessionResponse | ListSessionsResponse | ForkSessionResponse | ResumeSessionResponse | SetSessionModeResponse | SetSessionConfigOptionResponse | PromptResponse | SetSessionModelResponse | ExtResponse;
|
|
54
|
+
} | {
|
|
55
|
+
error: Error;
|
|
56
|
+
id: RequestId;
|
|
57
|
+
};
|
|
58
|
+
/**
|
|
59
|
+
* Optional annotations for the client. The client can use annotations to inform how objects are used or displayed
|
|
60
|
+
*/
|
|
61
|
+
export type Annotations = {
|
|
62
|
+
/**
|
|
63
|
+
* The _meta property is reserved by ACP to allow clients and agents to attach additional
|
|
64
|
+
* metadata to their interactions. Implementations MUST NOT make assumptions about values at
|
|
65
|
+
* these keys.
|
|
66
|
+
*
|
|
67
|
+
* See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)
|
|
68
|
+
*/
|
|
69
|
+
_meta?: {
|
|
70
|
+
[key: string]: unknown;
|
|
71
|
+
} | null;
|
|
72
|
+
audience?: Array<Role> | null;
|
|
73
|
+
lastModified?: string | null;
|
|
74
|
+
priority?: number | null;
|
|
75
|
+
};
|
|
76
|
+
/**
|
|
77
|
+
* Audio provided to or from an LLM.
|
|
78
|
+
*/
|
|
79
|
+
export type AudioContent = {
|
|
80
|
+
/**
|
|
81
|
+
* The _meta property is reserved by ACP to allow clients and agents to attach additional
|
|
82
|
+
* metadata to their interactions. Implementations MUST NOT make assumptions about values at
|
|
83
|
+
* these keys.
|
|
84
|
+
*
|
|
85
|
+
* See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)
|
|
86
|
+
*/
|
|
87
|
+
_meta?: {
|
|
88
|
+
[key: string]: unknown;
|
|
89
|
+
} | null;
|
|
90
|
+
annotations?: Annotations | null;
|
|
91
|
+
data: string;
|
|
92
|
+
mimeType: string;
|
|
93
|
+
};
|
|
94
|
+
/**
|
|
95
|
+
* Describes an available authentication method.
|
|
96
|
+
*/
|
|
97
|
+
export type AuthMethod = {
|
|
98
|
+
/**
|
|
99
|
+
* The _meta property is reserved by ACP to allow clients and agents to attach additional
|
|
100
|
+
* metadata to their interactions. Implementations MUST NOT make assumptions about values at
|
|
101
|
+
* these keys.
|
|
102
|
+
*
|
|
103
|
+
* See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)
|
|
104
|
+
*/
|
|
105
|
+
_meta?: {
|
|
106
|
+
[key: string]: unknown;
|
|
107
|
+
} | null;
|
|
108
|
+
/**
|
|
109
|
+
* Optional description providing more details about this authentication method.
|
|
110
|
+
*/
|
|
111
|
+
description?: string | null;
|
|
112
|
+
/**
|
|
113
|
+
* Unique identifier for this authentication method.
|
|
114
|
+
*/
|
|
115
|
+
id: string;
|
|
116
|
+
/**
|
|
117
|
+
* Human-readable name of the authentication method.
|
|
118
|
+
*/
|
|
119
|
+
name: string;
|
|
120
|
+
};
|
|
121
|
+
/**
|
|
122
|
+
* Request parameters for the authenticate method.
|
|
123
|
+
*
|
|
124
|
+
* Specifies which authentication method to use.
|
|
125
|
+
*/
|
|
126
|
+
export type AuthenticateRequest = {
|
|
127
|
+
/**
|
|
128
|
+
* The _meta property is reserved by ACP to allow clients and agents to attach additional
|
|
129
|
+
* metadata to their interactions. Implementations MUST NOT make assumptions about values at
|
|
130
|
+
* these keys.
|
|
131
|
+
*
|
|
132
|
+
* See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)
|
|
133
|
+
*/
|
|
134
|
+
_meta?: {
|
|
135
|
+
[key: string]: unknown;
|
|
136
|
+
} | null;
|
|
137
|
+
/**
|
|
138
|
+
* The ID of the authentication method to use.
|
|
139
|
+
* Must be one of the methods advertised in the initialize response.
|
|
140
|
+
*/
|
|
141
|
+
methodId: string;
|
|
142
|
+
};
|
|
143
|
+
/**
|
|
144
|
+
* Response to the `authenticate` method.
|
|
145
|
+
*/
|
|
146
|
+
export type AuthenticateResponse = {
|
|
147
|
+
/**
|
|
148
|
+
* The _meta property is reserved by ACP to allow clients and agents to attach additional
|
|
149
|
+
* metadata to their interactions. Implementations MUST NOT make assumptions about values at
|
|
150
|
+
* these keys.
|
|
151
|
+
*
|
|
152
|
+
* See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)
|
|
153
|
+
*/
|
|
154
|
+
_meta?: {
|
|
155
|
+
[key: string]: unknown;
|
|
156
|
+
} | null;
|
|
157
|
+
};
|
|
158
|
+
/**
|
|
159
|
+
* Information about a command.
|
|
160
|
+
*/
|
|
161
|
+
export type AvailableCommand = {
|
|
162
|
+
/**
|
|
163
|
+
* The _meta property is reserved by ACP to allow clients and agents to attach additional
|
|
164
|
+
* metadata to their interactions. Implementations MUST NOT make assumptions about values at
|
|
165
|
+
* these keys.
|
|
166
|
+
*
|
|
167
|
+
* See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)
|
|
168
|
+
*/
|
|
169
|
+
_meta?: {
|
|
170
|
+
[key: string]: unknown;
|
|
171
|
+
} | null;
|
|
172
|
+
/**
|
|
173
|
+
* Human-readable description of what the command does.
|
|
174
|
+
*/
|
|
175
|
+
description: string;
|
|
176
|
+
/**
|
|
177
|
+
* Input for the command if required
|
|
178
|
+
*/
|
|
179
|
+
input?: AvailableCommandInput | null;
|
|
180
|
+
/**
|
|
181
|
+
* Command name (e.g., `create_plan`, `research_codebase`).
|
|
182
|
+
*/
|
|
183
|
+
name: string;
|
|
184
|
+
};
|
|
185
|
+
/**
|
|
186
|
+
* unstructured
|
|
187
|
+
*
|
|
188
|
+
* All text that was typed after the command name is provided as input.
|
|
189
|
+
*/
|
|
190
|
+
export type AvailableCommandInput = UnstructuredCommandInput;
|
|
191
|
+
/**
|
|
192
|
+
* Available commands are ready or have changed
|
|
193
|
+
*/
|
|
194
|
+
export type AvailableCommandsUpdate = {
|
|
195
|
+
/**
|
|
196
|
+
* The _meta property is reserved by ACP to allow clients and agents to attach additional
|
|
197
|
+
* metadata to their interactions. Implementations MUST NOT make assumptions about values at
|
|
198
|
+
* these keys.
|
|
199
|
+
*
|
|
200
|
+
* See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)
|
|
201
|
+
*/
|
|
202
|
+
_meta?: {
|
|
203
|
+
[key: string]: unknown;
|
|
204
|
+
} | null;
|
|
205
|
+
/**
|
|
206
|
+
* Commands the agent can execute
|
|
207
|
+
*/
|
|
208
|
+
availableCommands: Array<AvailableCommand>;
|
|
209
|
+
};
|
|
210
|
+
/**
|
|
211
|
+
* Binary resource contents.
|
|
212
|
+
*/
|
|
213
|
+
export type BlobResourceContents = {
|
|
214
|
+
/**
|
|
215
|
+
* The _meta property is reserved by ACP to allow clients and agents to attach additional
|
|
216
|
+
* metadata to their interactions. Implementations MUST NOT make assumptions about values at
|
|
217
|
+
* these keys.
|
|
218
|
+
*
|
|
219
|
+
* See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)
|
|
220
|
+
*/
|
|
221
|
+
_meta?: {
|
|
222
|
+
[key: string]: unknown;
|
|
223
|
+
} | null;
|
|
224
|
+
blob: string;
|
|
225
|
+
mimeType?: string | null;
|
|
226
|
+
uri: string;
|
|
227
|
+
};
|
|
228
|
+
/**
|
|
229
|
+
* Notification to cancel ongoing operations for a session.
|
|
230
|
+
*
|
|
231
|
+
* See protocol docs: [Cancellation](https://agentclientprotocol.com/protocol/prompt-turn#cancellation)
|
|
232
|
+
*/
|
|
233
|
+
export type CancelNotification = {
|
|
234
|
+
/**
|
|
235
|
+
* The _meta property is reserved by ACP to allow clients and agents to attach additional
|
|
236
|
+
* metadata to their interactions. Implementations MUST NOT make assumptions about values at
|
|
237
|
+
* these keys.
|
|
238
|
+
*
|
|
239
|
+
* See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)
|
|
240
|
+
*/
|
|
241
|
+
_meta?: {
|
|
242
|
+
[key: string]: unknown;
|
|
243
|
+
} | null;
|
|
244
|
+
/**
|
|
245
|
+
* The ID of the session to cancel operations for.
|
|
246
|
+
*/
|
|
247
|
+
sessionId: SessionId;
|
|
248
|
+
};
|
|
249
|
+
/**
|
|
250
|
+
* **UNSTABLE**
|
|
251
|
+
*
|
|
252
|
+
* This capability is not part of the spec yet, and may be removed or changed at any point.
|
|
253
|
+
*
|
|
254
|
+
* Notification to cancel an ongoing request.
|
|
255
|
+
*
|
|
256
|
+
* See protocol docs: [Cancellation](https://agentclientprotocol.com/protocol/cancellation)
|
|
257
|
+
*
|
|
258
|
+
* @experimental
|
|
259
|
+
*/
|
|
260
|
+
export type CancelRequestNotification = {
|
|
261
|
+
/**
|
|
262
|
+
* The _meta property is reserved by ACP to allow clients and agents to attach additional
|
|
263
|
+
* metadata to their interactions. Implementations MUST NOT make assumptions about values at
|
|
264
|
+
* these keys.
|
|
265
|
+
*
|
|
266
|
+
* See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)
|
|
267
|
+
*/
|
|
268
|
+
_meta?: {
|
|
269
|
+
[key: string]: unknown;
|
|
270
|
+
} | null;
|
|
271
|
+
/**
|
|
272
|
+
* The ID of the request to cancel.
|
|
273
|
+
*/
|
|
274
|
+
requestId: RequestId;
|
|
275
|
+
};
|
|
276
|
+
/**
|
|
277
|
+
* Capabilities supported by the client.
|
|
278
|
+
*
|
|
279
|
+
* Advertised during initialization to inform the agent about
|
|
280
|
+
* available features and methods.
|
|
281
|
+
*
|
|
282
|
+
* See protocol docs: [Client Capabilities](https://agentclientprotocol.com/protocol/initialization#client-capabilities)
|
|
283
|
+
*/
|
|
284
|
+
export type ClientCapabilities = {
|
|
285
|
+
/**
|
|
286
|
+
* The _meta property is reserved by ACP to allow clients and agents to attach additional
|
|
287
|
+
* metadata to their interactions. Implementations MUST NOT make assumptions about values at
|
|
288
|
+
* these keys.
|
|
289
|
+
*
|
|
290
|
+
* See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)
|
|
291
|
+
*/
|
|
292
|
+
_meta?: {
|
|
293
|
+
[key: string]: unknown;
|
|
294
|
+
} | null;
|
|
295
|
+
/**
|
|
296
|
+
* File system capabilities supported by the client.
|
|
297
|
+
* Determines which file operations the agent can request.
|
|
298
|
+
*/
|
|
299
|
+
fs?: FileSystemCapability;
|
|
300
|
+
/**
|
|
301
|
+
* Whether the Client support all `terminal*` methods.
|
|
302
|
+
*/
|
|
303
|
+
terminal?: boolean;
|
|
304
|
+
};
|
|
305
|
+
export type ClientNotification = {
|
|
306
|
+
method: string;
|
|
307
|
+
params?: CancelNotification | ExtNotification | null;
|
|
308
|
+
};
|
|
309
|
+
export type ClientRequest = {
|
|
310
|
+
id: RequestId;
|
|
311
|
+
method: string;
|
|
312
|
+
params?: InitializeRequest | AuthenticateRequest | NewSessionRequest | LoadSessionRequest | ListSessionsRequest | ForkSessionRequest | ResumeSessionRequest | SetSessionModeRequest | SetSessionConfigOptionRequest | PromptRequest | SetSessionModelRequest | ExtRequest | null;
|
|
313
|
+
};
|
|
314
|
+
export type ClientResponse = {
|
|
315
|
+
id: RequestId;
|
|
316
|
+
/**
|
|
317
|
+
* All possible responses that a client can send to an agent.
|
|
318
|
+
*
|
|
319
|
+
* This enum is used internally for routing RPC responses. You typically won't need
|
|
320
|
+
* to use this directly - the responses are handled automatically by the connection.
|
|
321
|
+
*
|
|
322
|
+
* These are responses to the corresponding `AgentRequest` variants.
|
|
323
|
+
*/
|
|
324
|
+
result: WriteTextFileResponse | ReadTextFileResponse | RequestPermissionResponse | CreateTerminalResponse | TerminalOutputResponse | ReleaseTerminalResponse | WaitForTerminalExitResponse | KillTerminalCommandResponse | ExtResponse;
|
|
325
|
+
} | {
|
|
326
|
+
error: Error;
|
|
327
|
+
id: RequestId;
|
|
328
|
+
};
|
|
329
|
+
/**
|
|
330
|
+
* Session configuration options have been updated.
|
|
331
|
+
*/
|
|
332
|
+
export type ConfigOptionUpdate = {
|
|
333
|
+
/**
|
|
334
|
+
* The _meta property is reserved by ACP to allow clients and agents to attach additional
|
|
335
|
+
* metadata to their interactions. Implementations MUST NOT make assumptions about values at
|
|
336
|
+
* these keys.
|
|
337
|
+
*
|
|
338
|
+
* See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)
|
|
339
|
+
*/
|
|
340
|
+
_meta?: {
|
|
341
|
+
[key: string]: unknown;
|
|
342
|
+
} | null;
|
|
343
|
+
/**
|
|
344
|
+
* The full set of configuration options and their current values.
|
|
345
|
+
*/
|
|
346
|
+
configOptions: Array<SessionConfigOption>;
|
|
347
|
+
};
|
|
348
|
+
/**
|
|
349
|
+
* Standard content block (text, images, resources).
|
|
350
|
+
*/
|
|
351
|
+
export type Content = {
|
|
352
|
+
/**
|
|
353
|
+
* The _meta property is reserved by ACP to allow clients and agents to attach additional
|
|
354
|
+
* metadata to their interactions. Implementations MUST NOT make assumptions about values at
|
|
355
|
+
* these keys.
|
|
356
|
+
*
|
|
357
|
+
* See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)
|
|
358
|
+
*/
|
|
359
|
+
_meta?: {
|
|
360
|
+
[key: string]: unknown;
|
|
361
|
+
} | null;
|
|
362
|
+
/**
|
|
363
|
+
* The actual content block.
|
|
364
|
+
*/
|
|
365
|
+
content: ContentBlock;
|
|
366
|
+
};
|
|
367
|
+
/**
|
|
368
|
+
* Content blocks represent displayable information in the Agent Client Protocol.
|
|
369
|
+
*
|
|
370
|
+
* They provide a structured way to handle various types of user-facing content—whether
|
|
371
|
+
* it's text from language models, images for analysis, or embedded resources for context.
|
|
372
|
+
*
|
|
373
|
+
* Content blocks appear in:
|
|
374
|
+
* - User prompts sent via `session/prompt`
|
|
375
|
+
* - Language model output streamed through `session/update` notifications
|
|
376
|
+
* - Progress updates and results from tool calls
|
|
377
|
+
*
|
|
378
|
+
* This structure is compatible with the Model Context Protocol (MCP), enabling
|
|
379
|
+
* agents to seamlessly forward content from MCP tool outputs without transformation.
|
|
380
|
+
*
|
|
381
|
+
* See protocol docs: [Content](https://agentclientprotocol.com/protocol/content)
|
|
382
|
+
*/
|
|
383
|
+
export type ContentBlock = (TextContent & {
|
|
384
|
+
type: "text";
|
|
385
|
+
}) | (ImageContent & {
|
|
386
|
+
type: "image";
|
|
387
|
+
}) | (AudioContent & {
|
|
388
|
+
type: "audio";
|
|
389
|
+
}) | (ResourceLink & {
|
|
390
|
+
type: "resource_link";
|
|
391
|
+
}) | (EmbeddedResource & {
|
|
392
|
+
type: "resource";
|
|
393
|
+
});
|
|
394
|
+
/**
|
|
395
|
+
* A streamed item of content
|
|
396
|
+
*/
|
|
397
|
+
export type ContentChunk = {
|
|
398
|
+
/**
|
|
399
|
+
* The _meta property is reserved by ACP to allow clients and agents to attach additional
|
|
400
|
+
* metadata to their interactions. Implementations MUST NOT make assumptions about values at
|
|
401
|
+
* these keys.
|
|
402
|
+
*
|
|
403
|
+
* See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)
|
|
404
|
+
*/
|
|
405
|
+
_meta?: {
|
|
406
|
+
[key: string]: unknown;
|
|
407
|
+
} | null;
|
|
408
|
+
/**
|
|
409
|
+
* A single item of content
|
|
410
|
+
*/
|
|
411
|
+
content: ContentBlock;
|
|
412
|
+
};
|
|
413
|
+
/**
|
|
414
|
+
* **UNSTABLE**
|
|
415
|
+
*
|
|
416
|
+
* This capability is not part of the spec yet, and may be removed or changed at any point.
|
|
417
|
+
*
|
|
418
|
+
* Cost information for a session.
|
|
419
|
+
*
|
|
420
|
+
* @experimental
|
|
421
|
+
*/
|
|
422
|
+
export type Cost = {
|
|
423
|
+
/**
|
|
424
|
+
* Total cumulative cost for session.
|
|
425
|
+
*/
|
|
426
|
+
amount: number;
|
|
427
|
+
/**
|
|
428
|
+
* ISO 4217 currency code (e.g., "USD", "EUR").
|
|
429
|
+
*/
|
|
430
|
+
currency: string;
|
|
431
|
+
};
|
|
432
|
+
/**
|
|
433
|
+
* Request to create a new terminal and execute a command.
|
|
434
|
+
*/
|
|
435
|
+
export type CreateTerminalRequest = {
|
|
436
|
+
/**
|
|
437
|
+
* The _meta property is reserved by ACP to allow clients and agents to attach additional
|
|
438
|
+
* metadata to their interactions. Implementations MUST NOT make assumptions about values at
|
|
439
|
+
* these keys.
|
|
440
|
+
*
|
|
441
|
+
* See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)
|
|
442
|
+
*/
|
|
443
|
+
_meta?: {
|
|
444
|
+
[key: string]: unknown;
|
|
445
|
+
} | null;
|
|
446
|
+
/**
|
|
447
|
+
* Array of command arguments.
|
|
448
|
+
*/
|
|
449
|
+
args?: Array<string>;
|
|
450
|
+
/**
|
|
451
|
+
* The command to execute.
|
|
452
|
+
*/
|
|
453
|
+
command: string;
|
|
454
|
+
/**
|
|
455
|
+
* Working directory for the command (absolute path).
|
|
456
|
+
*/
|
|
457
|
+
cwd?: string | null;
|
|
458
|
+
/**
|
|
459
|
+
* Environment variables for the command.
|
|
460
|
+
*/
|
|
461
|
+
env?: Array<EnvVariable>;
|
|
462
|
+
/**
|
|
463
|
+
* Maximum number of output bytes to retain.
|
|
464
|
+
*
|
|
465
|
+
* When the limit is exceeded, the Client truncates from the beginning of the output
|
|
466
|
+
* to stay within the limit.
|
|
467
|
+
*
|
|
468
|
+
* The Client MUST ensure truncation happens at a character boundary to maintain valid
|
|
469
|
+
* string output, even if this means the retained output is slightly less than the
|
|
470
|
+
* specified limit.
|
|
471
|
+
*/
|
|
472
|
+
outputByteLimit?: number | null;
|
|
473
|
+
/**
|
|
474
|
+
* The session ID for this request.
|
|
475
|
+
*/
|
|
476
|
+
sessionId: SessionId;
|
|
477
|
+
};
|
|
478
|
+
/**
|
|
479
|
+
* Response containing the ID of the created terminal.
|
|
480
|
+
*/
|
|
481
|
+
export type CreateTerminalResponse = {
|
|
482
|
+
/**
|
|
483
|
+
* The _meta property is reserved by ACP to allow clients and agents to attach additional
|
|
484
|
+
* metadata to their interactions. Implementations MUST NOT make assumptions about values at
|
|
485
|
+
* these keys.
|
|
486
|
+
*
|
|
487
|
+
* See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)
|
|
488
|
+
*/
|
|
489
|
+
_meta?: {
|
|
490
|
+
[key: string]: unknown;
|
|
491
|
+
} | null;
|
|
492
|
+
/**
|
|
493
|
+
* The unique identifier for the created terminal.
|
|
494
|
+
*/
|
|
495
|
+
terminalId: string;
|
|
496
|
+
};
|
|
497
|
+
/**
|
|
498
|
+
* The current mode of the session has changed
|
|
499
|
+
*
|
|
500
|
+
* See protocol docs: [Session Modes](https://agentclientprotocol.com/protocol/session-modes)
|
|
501
|
+
*/
|
|
502
|
+
export type CurrentModeUpdate = {
|
|
503
|
+
/**
|
|
504
|
+
* The _meta property is reserved by ACP to allow clients and agents to attach additional
|
|
505
|
+
* metadata to their interactions. Implementations MUST NOT make assumptions about values at
|
|
506
|
+
* these keys.
|
|
507
|
+
*
|
|
508
|
+
* See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)
|
|
509
|
+
*/
|
|
510
|
+
_meta?: {
|
|
511
|
+
[key: string]: unknown;
|
|
512
|
+
} | null;
|
|
513
|
+
/**
|
|
514
|
+
* The ID of the current mode
|
|
515
|
+
*/
|
|
516
|
+
currentModeId: SessionModeId;
|
|
517
|
+
};
|
|
518
|
+
/**
|
|
519
|
+
* A diff representing file modifications.
|
|
520
|
+
*
|
|
521
|
+
* Shows changes to files in a format suitable for display in the client UI.
|
|
522
|
+
*
|
|
523
|
+
* See protocol docs: [Content](https://agentclientprotocol.com/protocol/tool-calls#content)
|
|
524
|
+
*/
|
|
525
|
+
export type Diff = {
|
|
526
|
+
/**
|
|
527
|
+
* The _meta property is reserved by ACP to allow clients and agents to attach additional
|
|
528
|
+
* metadata to their interactions. Implementations MUST NOT make assumptions about values at
|
|
529
|
+
* these keys.
|
|
530
|
+
*
|
|
531
|
+
* See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)
|
|
532
|
+
*/
|
|
533
|
+
_meta?: {
|
|
534
|
+
[key: string]: unknown;
|
|
535
|
+
} | null;
|
|
536
|
+
/**
|
|
537
|
+
* The new content after modification.
|
|
538
|
+
*/
|
|
539
|
+
newText: string;
|
|
540
|
+
/**
|
|
541
|
+
* The original content (None for new files).
|
|
542
|
+
*/
|
|
543
|
+
oldText?: string | null;
|
|
544
|
+
/**
|
|
545
|
+
* The file path being modified.
|
|
546
|
+
*/
|
|
547
|
+
path: string;
|
|
548
|
+
};
|
|
549
|
+
/**
|
|
550
|
+
* The contents of a resource, embedded into a prompt or tool call result.
|
|
551
|
+
*/
|
|
552
|
+
export type EmbeddedResource = {
|
|
553
|
+
/**
|
|
554
|
+
* The _meta property is reserved by ACP to allow clients and agents to attach additional
|
|
555
|
+
* metadata to their interactions. Implementations MUST NOT make assumptions about values at
|
|
556
|
+
* these keys.
|
|
557
|
+
*
|
|
558
|
+
* See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)
|
|
559
|
+
*/
|
|
560
|
+
_meta?: {
|
|
561
|
+
[key: string]: unknown;
|
|
562
|
+
} | null;
|
|
563
|
+
annotations?: Annotations | null;
|
|
564
|
+
resource: EmbeddedResourceResource;
|
|
565
|
+
};
|
|
566
|
+
/**
|
|
567
|
+
* Resource content that can be embedded in a message.
|
|
568
|
+
*/
|
|
569
|
+
export type EmbeddedResourceResource = TextResourceContents | BlobResourceContents;
|
|
570
|
+
/**
|
|
571
|
+
* An environment variable to set when launching an MCP server.
|
|
572
|
+
*/
|
|
573
|
+
export type EnvVariable = {
|
|
574
|
+
/**
|
|
575
|
+
* The _meta property is reserved by ACP to allow clients and agents to attach additional
|
|
576
|
+
* metadata to their interactions. Implementations MUST NOT make assumptions about values at
|
|
577
|
+
* these keys.
|
|
578
|
+
*
|
|
579
|
+
* See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)
|
|
580
|
+
*/
|
|
581
|
+
_meta?: {
|
|
582
|
+
[key: string]: unknown;
|
|
583
|
+
} | null;
|
|
584
|
+
/**
|
|
585
|
+
* The name of the environment variable.
|
|
586
|
+
*/
|
|
587
|
+
name: string;
|
|
588
|
+
/**
|
|
589
|
+
* The value to set for the environment variable.
|
|
590
|
+
*/
|
|
591
|
+
value: string;
|
|
592
|
+
};
|
|
593
|
+
/**
|
|
594
|
+
* JSON-RPC error object.
|
|
595
|
+
*
|
|
596
|
+
* Represents an error that occurred during method execution, following the
|
|
597
|
+
* JSON-RPC 2.0 error object specification with optional additional data.
|
|
598
|
+
*
|
|
599
|
+
* See protocol docs: [JSON-RPC Error Object](https://www.jsonrpc.org/specification#error_object)
|
|
600
|
+
*/
|
|
601
|
+
export type Error = {
|
|
602
|
+
/**
|
|
603
|
+
* A number indicating the error type that occurred.
|
|
604
|
+
* This must be an integer as defined in the JSON-RPC specification.
|
|
605
|
+
*/
|
|
606
|
+
code: ErrorCode;
|
|
607
|
+
/**
|
|
608
|
+
* Optional primitive or structured value that contains additional information about the error.
|
|
609
|
+
* This may include debugging information or context-specific details.
|
|
610
|
+
*/
|
|
611
|
+
data?: unknown;
|
|
612
|
+
/**
|
|
613
|
+
* A string providing a short description of the error.
|
|
614
|
+
* The message should be limited to a concise single sentence.
|
|
615
|
+
*/
|
|
616
|
+
message: string;
|
|
617
|
+
};
|
|
618
|
+
/**
|
|
619
|
+
* Predefined error codes for common JSON-RPC and ACP-specific errors.
|
|
620
|
+
*
|
|
621
|
+
* These codes follow the JSON-RPC 2.0 specification for standard errors
|
|
622
|
+
* and use the reserved range (-32000 to -32099) for protocol-specific errors.
|
|
623
|
+
*/
|
|
624
|
+
export type ErrorCode = -32700 | -32600 | -32601 | -32602 | -32603 | -32800 | -32000 | -32002 | number;
|
|
625
|
+
/**
|
|
626
|
+
* Allows the Agent to send an arbitrary notification that is not part of the ACP spec.
|
|
627
|
+
* Extension notifications provide a way to send one-way messages for custom functionality
|
|
628
|
+
* while maintaining protocol compatibility.
|
|
629
|
+
*
|
|
630
|
+
* See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)
|
|
631
|
+
*/
|
|
632
|
+
export type ExtNotification = unknown;
|
|
633
|
+
/**
|
|
634
|
+
* Allows for sending an arbitrary request that is not part of the ACP spec.
|
|
635
|
+
* Extension methods provide a way to add custom functionality while maintaining
|
|
636
|
+
* protocol compatibility.
|
|
637
|
+
*
|
|
638
|
+
* See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)
|
|
639
|
+
*/
|
|
640
|
+
export type ExtRequest = unknown;
|
|
641
|
+
/**
|
|
642
|
+
* Allows for sending an arbitrary response to an [`ExtRequest`] that is not part of the ACP spec.
|
|
643
|
+
* Extension methods provide a way to add custom functionality while maintaining
|
|
644
|
+
* protocol compatibility.
|
|
645
|
+
*
|
|
646
|
+
* See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)
|
|
647
|
+
*/
|
|
648
|
+
export type ExtResponse = unknown;
|
|
649
|
+
/**
|
|
650
|
+
* Filesystem capabilities supported by the client.
|
|
651
|
+
* File system capabilities that a client may support.
|
|
652
|
+
*
|
|
653
|
+
* See protocol docs: [FileSystem](https://agentclientprotocol.com/protocol/initialization#filesystem)
|
|
654
|
+
*/
|
|
655
|
+
export type FileSystemCapability = {
|
|
656
|
+
/**
|
|
657
|
+
* The _meta property is reserved by ACP to allow clients and agents to attach additional
|
|
658
|
+
* metadata to their interactions. Implementations MUST NOT make assumptions about values at
|
|
659
|
+
* these keys.
|
|
660
|
+
*
|
|
661
|
+
* See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)
|
|
662
|
+
*/
|
|
663
|
+
_meta?: {
|
|
664
|
+
[key: string]: unknown;
|
|
665
|
+
} | null;
|
|
666
|
+
/**
|
|
667
|
+
* Whether the Client supports `fs/read_text_file` requests.
|
|
668
|
+
*/
|
|
669
|
+
readTextFile?: boolean;
|
|
670
|
+
/**
|
|
671
|
+
* Whether the Client supports `fs/write_text_file` requests.
|
|
672
|
+
*/
|
|
673
|
+
writeTextFile?: boolean;
|
|
674
|
+
};
|
|
675
|
+
/**
|
|
676
|
+
* **UNSTABLE**
|
|
677
|
+
*
|
|
678
|
+
* This capability is not part of the spec yet, and may be removed or changed at any point.
|
|
679
|
+
*
|
|
680
|
+
* Request parameters for forking an existing session.
|
|
681
|
+
*
|
|
682
|
+
* Creates a new session based on the context of an existing one, allowing
|
|
683
|
+
* operations like generating summaries without affecting the original session's history.
|
|
684
|
+
*
|
|
685
|
+
* Only available if the Agent supports the `session.fork` capability.
|
|
686
|
+
*
|
|
687
|
+
* @experimental
|
|
688
|
+
*/
|
|
689
|
+
export type ForkSessionRequest = {
|
|
690
|
+
/**
|
|
691
|
+
* The _meta property is reserved by ACP to allow clients and agents to attach additional
|
|
692
|
+
* metadata to their interactions. Implementations MUST NOT make assumptions about values at
|
|
693
|
+
* these keys.
|
|
694
|
+
*
|
|
695
|
+
* See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)
|
|
696
|
+
*/
|
|
697
|
+
_meta?: {
|
|
698
|
+
[key: string]: unknown;
|
|
699
|
+
} | null;
|
|
700
|
+
/**
|
|
701
|
+
* The working directory for this session.
|
|
702
|
+
*/
|
|
703
|
+
cwd: string;
|
|
704
|
+
/**
|
|
705
|
+
* List of MCP servers to connect to for this session.
|
|
706
|
+
*/
|
|
707
|
+
mcpServers?: Array<McpServer>;
|
|
708
|
+
/**
|
|
709
|
+
* The ID of the session to fork.
|
|
710
|
+
*/
|
|
711
|
+
sessionId: SessionId;
|
|
712
|
+
};
|
|
713
|
+
/**
|
|
714
|
+
* **UNSTABLE**
|
|
715
|
+
*
|
|
716
|
+
* This capability is not part of the spec yet, and may be removed or changed at any point.
|
|
717
|
+
*
|
|
718
|
+
* Response from forking an existing session.
|
|
719
|
+
*
|
|
720
|
+
* @experimental
|
|
721
|
+
*/
|
|
722
|
+
export type ForkSessionResponse = {
|
|
723
|
+
/**
|
|
724
|
+
* The _meta property is reserved by ACP to allow clients and agents to attach additional
|
|
725
|
+
* metadata to their interactions. Implementations MUST NOT make assumptions about values at
|
|
726
|
+
* these keys.
|
|
727
|
+
*
|
|
728
|
+
* See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)
|
|
729
|
+
*/
|
|
730
|
+
_meta?: {
|
|
731
|
+
[key: string]: unknown;
|
|
732
|
+
} | null;
|
|
733
|
+
/**
|
|
734
|
+
* Initial session configuration options if supported by the Agent.
|
|
735
|
+
*/
|
|
736
|
+
configOptions?: Array<SessionConfigOption> | null;
|
|
737
|
+
/**
|
|
738
|
+
* **UNSTABLE**
|
|
739
|
+
*
|
|
740
|
+
* This capability is not part of the spec yet, and may be removed or changed at any point.
|
|
741
|
+
*
|
|
742
|
+
* Initial model state if supported by the Agent
|
|
743
|
+
*
|
|
744
|
+
* @experimental
|
|
745
|
+
*/
|
|
746
|
+
models?: SessionModelState | null;
|
|
747
|
+
/**
|
|
748
|
+
* Initial mode state if supported by the Agent
|
|
749
|
+
*
|
|
750
|
+
* See protocol docs: [Session Modes](https://agentclientprotocol.com/protocol/session-modes)
|
|
751
|
+
*/
|
|
752
|
+
modes?: SessionModeState | null;
|
|
753
|
+
/**
|
|
754
|
+
* Unique identifier for the newly created forked session.
|
|
755
|
+
*/
|
|
756
|
+
sessionId: SessionId;
|
|
757
|
+
};
|
|
758
|
+
/**
|
|
759
|
+
* An HTTP header to set when making requests to the MCP server.
|
|
760
|
+
*/
|
|
761
|
+
export type HttpHeader = {
|
|
762
|
+
/**
|
|
763
|
+
* The _meta property is reserved by ACP to allow clients and agents to attach additional
|
|
764
|
+
* metadata to their interactions. Implementations MUST NOT make assumptions about values at
|
|
765
|
+
* these keys.
|
|
766
|
+
*
|
|
767
|
+
* See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)
|
|
768
|
+
*/
|
|
769
|
+
_meta?: {
|
|
770
|
+
[key: string]: unknown;
|
|
771
|
+
} | null;
|
|
772
|
+
/**
|
|
773
|
+
* The name of the HTTP header.
|
|
774
|
+
*/
|
|
775
|
+
name: string;
|
|
776
|
+
/**
|
|
777
|
+
* The value to set for the HTTP header.
|
|
778
|
+
*/
|
|
779
|
+
value: string;
|
|
780
|
+
};
|
|
781
|
+
/**
|
|
782
|
+
* An image provided to or from an LLM.
|
|
783
|
+
*/
|
|
784
|
+
export type ImageContent = {
|
|
785
|
+
/**
|
|
786
|
+
* The _meta property is reserved by ACP to allow clients and agents to attach additional
|
|
787
|
+
* metadata to their interactions. Implementations MUST NOT make assumptions about values at
|
|
788
|
+
* these keys.
|
|
789
|
+
*
|
|
790
|
+
* See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)
|
|
791
|
+
*/
|
|
792
|
+
_meta?: {
|
|
793
|
+
[key: string]: unknown;
|
|
794
|
+
} | null;
|
|
795
|
+
annotations?: Annotations | null;
|
|
796
|
+
data: string;
|
|
797
|
+
mimeType: string;
|
|
798
|
+
uri?: string | null;
|
|
799
|
+
};
|
|
800
|
+
/**
|
|
801
|
+
* Metadata about the implementation of the client or agent.
|
|
802
|
+
* Describes the name and version of an MCP implementation, with an optional
|
|
803
|
+
* title for UI representation.
|
|
804
|
+
*/
|
|
805
|
+
export type Implementation = {
|
|
806
|
+
/**
|
|
807
|
+
* The _meta property is reserved by ACP to allow clients and agents to attach additional
|
|
808
|
+
* metadata to their interactions. Implementations MUST NOT make assumptions about values at
|
|
809
|
+
* these keys.
|
|
810
|
+
*
|
|
811
|
+
* See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)
|
|
812
|
+
*/
|
|
813
|
+
_meta?: {
|
|
814
|
+
[key: string]: unknown;
|
|
815
|
+
} | null;
|
|
816
|
+
/**
|
|
817
|
+
* Intended for programmatic or logical use, but can be used as a display
|
|
818
|
+
* name fallback if title isn’t present.
|
|
819
|
+
*/
|
|
820
|
+
name: string;
|
|
821
|
+
/**
|
|
822
|
+
* Intended for UI and end-user contexts — optimized to be human-readable
|
|
823
|
+
* and easily understood.
|
|
824
|
+
*
|
|
825
|
+
* If not provided, the name should be used for display.
|
|
826
|
+
*/
|
|
827
|
+
title?: string | null;
|
|
828
|
+
/**
|
|
829
|
+
* Version of the implementation. Can be displayed to the user or used
|
|
830
|
+
* for debugging or metrics purposes. (e.g. "1.0.0").
|
|
831
|
+
*/
|
|
832
|
+
version: string;
|
|
833
|
+
};
|
|
834
|
+
/**
|
|
835
|
+
* Request parameters for the initialize method.
|
|
836
|
+
*
|
|
837
|
+
* Sent by the client to establish connection and negotiate capabilities.
|
|
838
|
+
*
|
|
839
|
+
* See protocol docs: [Initialization](https://agentclientprotocol.com/protocol/initialization)
|
|
840
|
+
*/
|
|
841
|
+
export type InitializeRequest = {
|
|
842
|
+
/**
|
|
843
|
+
* The _meta property is reserved by ACP to allow clients and agents to attach additional
|
|
844
|
+
* metadata to their interactions. Implementations MUST NOT make assumptions about values at
|
|
845
|
+
* these keys.
|
|
846
|
+
*
|
|
847
|
+
* See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)
|
|
848
|
+
*/
|
|
849
|
+
_meta?: {
|
|
850
|
+
[key: string]: unknown;
|
|
851
|
+
} | null;
|
|
852
|
+
/**
|
|
853
|
+
* Capabilities supported by the client.
|
|
854
|
+
*/
|
|
855
|
+
clientCapabilities?: ClientCapabilities;
|
|
856
|
+
/**
|
|
857
|
+
* Information about the Client name and version sent to the Agent.
|
|
858
|
+
*
|
|
859
|
+
* Note: in future versions of the protocol, this will be required.
|
|
860
|
+
*/
|
|
861
|
+
clientInfo?: Implementation | null;
|
|
862
|
+
/**
|
|
863
|
+
* The latest protocol version supported by the client.
|
|
864
|
+
*/
|
|
865
|
+
protocolVersion: ProtocolVersion;
|
|
866
|
+
};
|
|
867
|
+
/**
|
|
868
|
+
* Response to the `initialize` method.
|
|
869
|
+
*
|
|
870
|
+
* Contains the negotiated protocol version and agent capabilities.
|
|
871
|
+
*
|
|
872
|
+
* See protocol docs: [Initialization](https://agentclientprotocol.com/protocol/initialization)
|
|
873
|
+
*/
|
|
874
|
+
export type InitializeResponse = {
|
|
875
|
+
/**
|
|
876
|
+
* The _meta property is reserved by ACP to allow clients and agents to attach additional
|
|
877
|
+
* metadata to their interactions. Implementations MUST NOT make assumptions about values at
|
|
878
|
+
* these keys.
|
|
879
|
+
*
|
|
880
|
+
* See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)
|
|
881
|
+
*/
|
|
882
|
+
_meta?: {
|
|
883
|
+
[key: string]: unknown;
|
|
884
|
+
} | null;
|
|
885
|
+
/**
|
|
886
|
+
* Capabilities supported by the agent.
|
|
887
|
+
*/
|
|
888
|
+
agentCapabilities?: AgentCapabilities;
|
|
889
|
+
/**
|
|
890
|
+
* Information about the Agent name and version sent to the Client.
|
|
891
|
+
*
|
|
892
|
+
* Note: in future versions of the protocol, this will be required.
|
|
893
|
+
*/
|
|
894
|
+
agentInfo?: Implementation | null;
|
|
895
|
+
/**
|
|
896
|
+
* Authentication methods supported by the agent.
|
|
897
|
+
*/
|
|
898
|
+
authMethods?: Array<AuthMethod>;
|
|
899
|
+
/**
|
|
900
|
+
* The protocol version the client specified if supported by the agent,
|
|
901
|
+
* or the latest protocol version supported by the agent.
|
|
902
|
+
*
|
|
903
|
+
* The client should disconnect, if it doesn't support this version.
|
|
904
|
+
*/
|
|
905
|
+
protocolVersion: ProtocolVersion;
|
|
906
|
+
};
|
|
907
|
+
/**
|
|
908
|
+
* Request to kill a terminal command without releasing the terminal.
|
|
909
|
+
*/
|
|
910
|
+
export type KillTerminalCommandRequest = {
|
|
911
|
+
/**
|
|
912
|
+
* The _meta property is reserved by ACP to allow clients and agents to attach additional
|
|
913
|
+
* metadata to their interactions. Implementations MUST NOT make assumptions about values at
|
|
914
|
+
* these keys.
|
|
915
|
+
*
|
|
916
|
+
* See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)
|
|
917
|
+
*/
|
|
918
|
+
_meta?: {
|
|
919
|
+
[key: string]: unknown;
|
|
920
|
+
} | null;
|
|
921
|
+
/**
|
|
922
|
+
* The session ID for this request.
|
|
923
|
+
*/
|
|
924
|
+
sessionId: SessionId;
|
|
925
|
+
/**
|
|
926
|
+
* The ID of the terminal to kill.
|
|
927
|
+
*/
|
|
928
|
+
terminalId: string;
|
|
929
|
+
};
|
|
930
|
+
/**
|
|
931
|
+
* Response to terminal/kill command method
|
|
932
|
+
*/
|
|
933
|
+
export type KillTerminalCommandResponse = {
|
|
934
|
+
/**
|
|
935
|
+
* The _meta property is reserved by ACP to allow clients and agents to attach additional
|
|
936
|
+
* metadata to their interactions. Implementations MUST NOT make assumptions about values at
|
|
937
|
+
* these keys.
|
|
938
|
+
*
|
|
939
|
+
* See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)
|
|
940
|
+
*/
|
|
941
|
+
_meta?: {
|
|
942
|
+
[key: string]: unknown;
|
|
943
|
+
} | null;
|
|
944
|
+
};
|
|
945
|
+
/**
|
|
946
|
+
* **UNSTABLE**
|
|
947
|
+
*
|
|
948
|
+
* This capability is not part of the spec yet, and may be removed or changed at any point.
|
|
949
|
+
*
|
|
950
|
+
* Request parameters for listing existing sessions.
|
|
951
|
+
*
|
|
952
|
+
* Only available if the Agent supports the `listSessions` capability.
|
|
953
|
+
*
|
|
954
|
+
* @experimental
|
|
955
|
+
*/
|
|
956
|
+
export type ListSessionsRequest = {
|
|
957
|
+
/**
|
|
958
|
+
* The _meta property is reserved by ACP to allow clients and agents to attach additional
|
|
959
|
+
* metadata to their interactions. Implementations MUST NOT make assumptions about values at
|
|
960
|
+
* these keys.
|
|
961
|
+
*
|
|
962
|
+
* See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)
|
|
963
|
+
*/
|
|
964
|
+
_meta?: {
|
|
965
|
+
[key: string]: unknown;
|
|
966
|
+
} | null;
|
|
967
|
+
/**
|
|
968
|
+
* Opaque cursor token from a previous response's nextCursor field for cursor-based pagination
|
|
969
|
+
*/
|
|
970
|
+
cursor?: string | null;
|
|
971
|
+
/**
|
|
972
|
+
* Filter sessions by working directory. Must be an absolute path.
|
|
973
|
+
*/
|
|
974
|
+
cwd?: string | null;
|
|
975
|
+
};
|
|
976
|
+
/**
|
|
977
|
+
* **UNSTABLE**
|
|
978
|
+
*
|
|
979
|
+
* This capability is not part of the spec yet, and may be removed or changed at any point.
|
|
980
|
+
*
|
|
981
|
+
* Response from listing sessions.
|
|
982
|
+
*
|
|
983
|
+
* @experimental
|
|
984
|
+
*/
|
|
985
|
+
export type ListSessionsResponse = {
|
|
986
|
+
/**
|
|
987
|
+
* The _meta property is reserved by ACP to allow clients and agents to attach additional
|
|
988
|
+
* metadata to their interactions. Implementations MUST NOT make assumptions about values at
|
|
989
|
+
* these keys.
|
|
990
|
+
*
|
|
991
|
+
* See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)
|
|
992
|
+
*/
|
|
993
|
+
_meta?: {
|
|
994
|
+
[key: string]: unknown;
|
|
995
|
+
} | null;
|
|
996
|
+
/**
|
|
997
|
+
* Opaque cursor token. If present, pass this in the next request's cursor parameter
|
|
998
|
+
* to fetch the next page. If absent, there are no more results.
|
|
999
|
+
*/
|
|
1000
|
+
nextCursor?: string | null;
|
|
1001
|
+
/**
|
|
1002
|
+
* Array of session information objects
|
|
1003
|
+
*/
|
|
1004
|
+
sessions: Array<SessionInfo>;
|
|
1005
|
+
};
|
|
1006
|
+
/**
|
|
1007
|
+
* Request parameters for loading an existing session.
|
|
1008
|
+
*
|
|
1009
|
+
* Only available if the Agent supports the `loadSession` capability.
|
|
1010
|
+
*
|
|
1011
|
+
* See protocol docs: [Loading Sessions](https://agentclientprotocol.com/protocol/session-setup#loading-sessions)
|
|
1012
|
+
*/
|
|
1013
|
+
export type LoadSessionRequest = {
|
|
1014
|
+
/**
|
|
1015
|
+
* The _meta property is reserved by ACP to allow clients and agents to attach additional
|
|
1016
|
+
* metadata to their interactions. Implementations MUST NOT make assumptions about values at
|
|
1017
|
+
* these keys.
|
|
1018
|
+
*
|
|
1019
|
+
* See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)
|
|
1020
|
+
*/
|
|
1021
|
+
_meta?: {
|
|
1022
|
+
[key: string]: unknown;
|
|
1023
|
+
} | null;
|
|
1024
|
+
/**
|
|
1025
|
+
* The working directory for this session.
|
|
1026
|
+
*/
|
|
1027
|
+
cwd: string;
|
|
1028
|
+
/**
|
|
1029
|
+
* List of MCP servers to connect to for this session.
|
|
1030
|
+
*/
|
|
1031
|
+
mcpServers: Array<McpServer>;
|
|
1032
|
+
/**
|
|
1033
|
+
* The ID of the session to load.
|
|
1034
|
+
*/
|
|
1035
|
+
sessionId: SessionId;
|
|
1036
|
+
};
|
|
1037
|
+
/**
|
|
1038
|
+
* Response from loading an existing session.
|
|
1039
|
+
*/
|
|
1040
|
+
export type LoadSessionResponse = {
|
|
1041
|
+
/**
|
|
1042
|
+
* The _meta property is reserved by ACP to allow clients and agents to attach additional
|
|
1043
|
+
* metadata to their interactions. Implementations MUST NOT make assumptions about values at
|
|
1044
|
+
* these keys.
|
|
1045
|
+
*
|
|
1046
|
+
* See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)
|
|
1047
|
+
*/
|
|
1048
|
+
_meta?: {
|
|
1049
|
+
[key: string]: unknown;
|
|
1050
|
+
} | null;
|
|
1051
|
+
/**
|
|
1052
|
+
* Initial session configuration options if supported by the Agent.
|
|
1053
|
+
*/
|
|
1054
|
+
configOptions?: Array<SessionConfigOption> | null;
|
|
1055
|
+
/**
|
|
1056
|
+
* **UNSTABLE**
|
|
1057
|
+
*
|
|
1058
|
+
* This capability is not part of the spec yet, and may be removed or changed at any point.
|
|
1059
|
+
*
|
|
1060
|
+
* Initial model state if supported by the Agent
|
|
1061
|
+
*
|
|
1062
|
+
* @experimental
|
|
1063
|
+
*/
|
|
1064
|
+
models?: SessionModelState | null;
|
|
1065
|
+
/**
|
|
1066
|
+
* Initial mode state if supported by the Agent
|
|
1067
|
+
*
|
|
1068
|
+
* See protocol docs: [Session Modes](https://agentclientprotocol.com/protocol/session-modes)
|
|
1069
|
+
*/
|
|
1070
|
+
modes?: SessionModeState | null;
|
|
1071
|
+
};
|
|
1072
|
+
/**
|
|
1073
|
+
* MCP capabilities supported by the agent
|
|
1074
|
+
*/
|
|
1075
|
+
export type McpCapabilities = {
|
|
1076
|
+
/**
|
|
1077
|
+
* The _meta property is reserved by ACP to allow clients and agents to attach additional
|
|
1078
|
+
* metadata to their interactions. Implementations MUST NOT make assumptions about values at
|
|
1079
|
+
* these keys.
|
|
1080
|
+
*
|
|
1081
|
+
* See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)
|
|
1082
|
+
*/
|
|
1083
|
+
_meta?: {
|
|
1084
|
+
[key: string]: unknown;
|
|
1085
|
+
} | null;
|
|
1086
|
+
/**
|
|
1087
|
+
* Agent supports [`McpServer::Http`].
|
|
1088
|
+
*/
|
|
1089
|
+
http?: boolean;
|
|
1090
|
+
/**
|
|
1091
|
+
* Agent supports [`McpServer::Sse`].
|
|
1092
|
+
*/
|
|
1093
|
+
sse?: boolean;
|
|
1094
|
+
};
|
|
1095
|
+
/**
|
|
1096
|
+
* Configuration for connecting to an MCP (Model Context Protocol) server.
|
|
1097
|
+
*
|
|
1098
|
+
* MCP servers provide tools and context that the agent can use when
|
|
1099
|
+
* processing prompts.
|
|
1100
|
+
*
|
|
1101
|
+
* See protocol docs: [MCP Servers](https://agentclientprotocol.com/protocol/session-setup#mcp-servers)
|
|
1102
|
+
*/
|
|
1103
|
+
export type McpServer = (McpServerHttp & {
|
|
1104
|
+
type: "http";
|
|
1105
|
+
}) | (McpServerSse & {
|
|
1106
|
+
type: "sse";
|
|
1107
|
+
}) | McpServerStdio;
|
|
1108
|
+
/**
|
|
1109
|
+
* HTTP transport configuration for MCP.
|
|
1110
|
+
*/
|
|
1111
|
+
export type McpServerHttp = {
|
|
1112
|
+
/**
|
|
1113
|
+
* The _meta property is reserved by ACP to allow clients and agents to attach additional
|
|
1114
|
+
* metadata to their interactions. Implementations MUST NOT make assumptions about values at
|
|
1115
|
+
* these keys.
|
|
1116
|
+
*
|
|
1117
|
+
* See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)
|
|
1118
|
+
*/
|
|
1119
|
+
_meta?: {
|
|
1120
|
+
[key: string]: unknown;
|
|
1121
|
+
} | null;
|
|
1122
|
+
/**
|
|
1123
|
+
* HTTP headers to set when making requests to the MCP server.
|
|
1124
|
+
*/
|
|
1125
|
+
headers: Array<HttpHeader>;
|
|
1126
|
+
/**
|
|
1127
|
+
* Human-readable name identifying this MCP server.
|
|
1128
|
+
*/
|
|
1129
|
+
name: string;
|
|
1130
|
+
/**
|
|
1131
|
+
* URL to the MCP server.
|
|
1132
|
+
*/
|
|
1133
|
+
url: string;
|
|
1134
|
+
};
|
|
1135
|
+
/**
|
|
1136
|
+
* SSE transport configuration for MCP.
|
|
1137
|
+
*/
|
|
1138
|
+
export type McpServerSse = {
|
|
1139
|
+
/**
|
|
1140
|
+
* The _meta property is reserved by ACP to allow clients and agents to attach additional
|
|
1141
|
+
* metadata to their interactions. Implementations MUST NOT make assumptions about values at
|
|
1142
|
+
* these keys.
|
|
1143
|
+
*
|
|
1144
|
+
* See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)
|
|
1145
|
+
*/
|
|
1146
|
+
_meta?: {
|
|
1147
|
+
[key: string]: unknown;
|
|
1148
|
+
} | null;
|
|
1149
|
+
/**
|
|
1150
|
+
* HTTP headers to set when making requests to the MCP server.
|
|
1151
|
+
*/
|
|
1152
|
+
headers: Array<HttpHeader>;
|
|
1153
|
+
/**
|
|
1154
|
+
* Human-readable name identifying this MCP server.
|
|
1155
|
+
*/
|
|
1156
|
+
name: string;
|
|
1157
|
+
/**
|
|
1158
|
+
* URL to the MCP server.
|
|
1159
|
+
*/
|
|
1160
|
+
url: string;
|
|
1161
|
+
};
|
|
1162
|
+
/**
|
|
1163
|
+
* Stdio transport configuration for MCP.
|
|
1164
|
+
*/
|
|
1165
|
+
export type McpServerStdio = {
|
|
1166
|
+
/**
|
|
1167
|
+
* The _meta property is reserved by ACP to allow clients and agents to attach additional
|
|
1168
|
+
* metadata to their interactions. Implementations MUST NOT make assumptions about values at
|
|
1169
|
+
* these keys.
|
|
1170
|
+
*
|
|
1171
|
+
* See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)
|
|
1172
|
+
*/
|
|
1173
|
+
_meta?: {
|
|
1174
|
+
[key: string]: unknown;
|
|
1175
|
+
} | null;
|
|
1176
|
+
/**
|
|
1177
|
+
* Command-line arguments to pass to the MCP server.
|
|
1178
|
+
*/
|
|
1179
|
+
args: Array<string>;
|
|
1180
|
+
/**
|
|
1181
|
+
* Path to the MCP server executable.
|
|
1182
|
+
*/
|
|
1183
|
+
command: string;
|
|
1184
|
+
/**
|
|
1185
|
+
* Environment variables to set when launching the MCP server.
|
|
1186
|
+
*/
|
|
1187
|
+
env: Array<EnvVariable>;
|
|
1188
|
+
/**
|
|
1189
|
+
* Human-readable name identifying this MCP server.
|
|
1190
|
+
*/
|
|
1191
|
+
name: string;
|
|
1192
|
+
};
|
|
1193
|
+
/**
|
|
1194
|
+
* **UNSTABLE**
|
|
1195
|
+
*
|
|
1196
|
+
* This capability is not part of the spec yet, and may be removed or changed at any point.
|
|
1197
|
+
*
|
|
1198
|
+
* A unique identifier for a model.
|
|
1199
|
+
*
|
|
1200
|
+
* @experimental
|
|
1201
|
+
*/
|
|
1202
|
+
export type ModelId = string;
|
|
1203
|
+
/**
|
|
1204
|
+
* **UNSTABLE**
|
|
1205
|
+
*
|
|
1206
|
+
* This capability is not part of the spec yet, and may be removed or changed at any point.
|
|
1207
|
+
*
|
|
1208
|
+
* Information about a selectable model.
|
|
1209
|
+
*
|
|
1210
|
+
* @experimental
|
|
1211
|
+
*/
|
|
1212
|
+
export type ModelInfo = {
|
|
1213
|
+
/**
|
|
1214
|
+
* The _meta property is reserved by ACP to allow clients and agents to attach additional
|
|
1215
|
+
* metadata to their interactions. Implementations MUST NOT make assumptions about values at
|
|
1216
|
+
* these keys.
|
|
1217
|
+
*
|
|
1218
|
+
* See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)
|
|
1219
|
+
*/
|
|
1220
|
+
_meta?: {
|
|
1221
|
+
[key: string]: unknown;
|
|
1222
|
+
} | null;
|
|
1223
|
+
/**
|
|
1224
|
+
* Optional description of the model.
|
|
1225
|
+
*/
|
|
1226
|
+
description?: string | null;
|
|
1227
|
+
/**
|
|
1228
|
+
* Unique identifier for the model.
|
|
1229
|
+
*/
|
|
1230
|
+
modelId: ModelId;
|
|
1231
|
+
/**
|
|
1232
|
+
* Human-readable name of the model.
|
|
1233
|
+
*/
|
|
1234
|
+
name: string;
|
|
1235
|
+
};
|
|
1236
|
+
/**
|
|
1237
|
+
* Request parameters for creating a new session.
|
|
1238
|
+
*
|
|
1239
|
+
* See protocol docs: [Creating a Session](https://agentclientprotocol.com/protocol/session-setup#creating-a-session)
|
|
1240
|
+
*/
|
|
1241
|
+
export type NewSessionRequest = {
|
|
1242
|
+
/**
|
|
1243
|
+
* The _meta property is reserved by ACP to allow clients and agents to attach additional
|
|
1244
|
+
* metadata to their interactions. Implementations MUST NOT make assumptions about values at
|
|
1245
|
+
* these keys.
|
|
1246
|
+
*
|
|
1247
|
+
* See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)
|
|
1248
|
+
*/
|
|
1249
|
+
_meta?: {
|
|
1250
|
+
[key: string]: unknown;
|
|
1251
|
+
} | null;
|
|
1252
|
+
/**
|
|
1253
|
+
* The working directory for this session. Must be an absolute path.
|
|
1254
|
+
*/
|
|
1255
|
+
cwd: string;
|
|
1256
|
+
/**
|
|
1257
|
+
* List of MCP (Model Context Protocol) servers the agent should connect to.
|
|
1258
|
+
*/
|
|
1259
|
+
mcpServers: Array<McpServer>;
|
|
1260
|
+
};
|
|
1261
|
+
/**
|
|
1262
|
+
* Response from creating a new session.
|
|
1263
|
+
*
|
|
1264
|
+
* See protocol docs: [Creating a Session](https://agentclientprotocol.com/protocol/session-setup#creating-a-session)
|
|
1265
|
+
*/
|
|
1266
|
+
export type NewSessionResponse = {
|
|
1267
|
+
/**
|
|
1268
|
+
* The _meta property is reserved by ACP to allow clients and agents to attach additional
|
|
1269
|
+
* metadata to their interactions. Implementations MUST NOT make assumptions about values at
|
|
1270
|
+
* these keys.
|
|
1271
|
+
*
|
|
1272
|
+
* See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)
|
|
1273
|
+
*/
|
|
1274
|
+
_meta?: {
|
|
1275
|
+
[key: string]: unknown;
|
|
1276
|
+
} | null;
|
|
1277
|
+
/**
|
|
1278
|
+
* Initial session configuration options if supported by the Agent.
|
|
1279
|
+
*/
|
|
1280
|
+
configOptions?: Array<SessionConfigOption> | null;
|
|
1281
|
+
/**
|
|
1282
|
+
* **UNSTABLE**
|
|
1283
|
+
*
|
|
1284
|
+
* This capability is not part of the spec yet, and may be removed or changed at any point.
|
|
1285
|
+
*
|
|
1286
|
+
* Initial model state if supported by the Agent
|
|
1287
|
+
*
|
|
1288
|
+
* @experimental
|
|
1289
|
+
*/
|
|
1290
|
+
models?: SessionModelState | null;
|
|
1291
|
+
/**
|
|
1292
|
+
* Initial mode state if supported by the Agent
|
|
1293
|
+
*
|
|
1294
|
+
* See protocol docs: [Session Modes](https://agentclientprotocol.com/protocol/session-modes)
|
|
1295
|
+
*/
|
|
1296
|
+
modes?: SessionModeState | null;
|
|
1297
|
+
/**
|
|
1298
|
+
* Unique identifier for the created session.
|
|
1299
|
+
*
|
|
1300
|
+
* Used in all subsequent requests for this conversation.
|
|
1301
|
+
*/
|
|
1302
|
+
sessionId: SessionId;
|
|
1303
|
+
};
|
|
1304
|
+
/**
|
|
1305
|
+
* An option presented to the user when requesting permission.
|
|
1306
|
+
*/
|
|
1307
|
+
export type PermissionOption = {
|
|
1308
|
+
/**
|
|
1309
|
+
* The _meta property is reserved by ACP to allow clients and agents to attach additional
|
|
1310
|
+
* metadata to their interactions. Implementations MUST NOT make assumptions about values at
|
|
1311
|
+
* these keys.
|
|
1312
|
+
*
|
|
1313
|
+
* See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)
|
|
1314
|
+
*/
|
|
1315
|
+
_meta?: {
|
|
1316
|
+
[key: string]: unknown;
|
|
1317
|
+
} | null;
|
|
1318
|
+
/**
|
|
1319
|
+
* Hint about the nature of this permission option.
|
|
1320
|
+
*/
|
|
1321
|
+
kind: PermissionOptionKind;
|
|
1322
|
+
/**
|
|
1323
|
+
* Human-readable label to display to the user.
|
|
1324
|
+
*/
|
|
1325
|
+
name: string;
|
|
1326
|
+
/**
|
|
1327
|
+
* Unique identifier for this permission option.
|
|
1328
|
+
*/
|
|
1329
|
+
optionId: PermissionOptionId;
|
|
1330
|
+
};
|
|
1331
|
+
/**
|
|
1332
|
+
* Unique identifier for a permission option.
|
|
1333
|
+
*/
|
|
1334
|
+
export type PermissionOptionId = string;
|
|
1335
|
+
/**
|
|
1336
|
+
* The type of permission option being presented to the user.
|
|
1337
|
+
*
|
|
1338
|
+
* Helps clients choose appropriate icons and UI treatment.
|
|
1339
|
+
*/
|
|
1340
|
+
export type PermissionOptionKind = "allow_once" | "allow_always" | "reject_once" | "reject_always";
|
|
1341
|
+
/**
|
|
1342
|
+
* An execution plan for accomplishing complex tasks.
|
|
1343
|
+
*
|
|
1344
|
+
* Plans consist of multiple entries representing individual tasks or goals.
|
|
1345
|
+
* Agents report plans to clients to provide visibility into their execution strategy.
|
|
1346
|
+
* Plans can evolve during execution as the agent discovers new requirements or completes tasks.
|
|
1347
|
+
*
|
|
1348
|
+
* See protocol docs: [Agent Plan](https://agentclientprotocol.com/protocol/agent-plan)
|
|
1349
|
+
*/
|
|
1350
|
+
export type Plan = {
|
|
1351
|
+
/**
|
|
1352
|
+
* The _meta property is reserved by ACP to allow clients and agents to attach additional
|
|
1353
|
+
* metadata to their interactions. Implementations MUST NOT make assumptions about values at
|
|
1354
|
+
* these keys.
|
|
1355
|
+
*
|
|
1356
|
+
* See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)
|
|
1357
|
+
*/
|
|
1358
|
+
_meta?: {
|
|
1359
|
+
[key: string]: unknown;
|
|
1360
|
+
} | null;
|
|
1361
|
+
/**
|
|
1362
|
+
* The list of tasks to be accomplished.
|
|
1363
|
+
*
|
|
1364
|
+
* When updating a plan, the agent must send a complete list of all entries
|
|
1365
|
+
* with their current status. The client replaces the entire plan with each update.
|
|
1366
|
+
*/
|
|
1367
|
+
entries: Array<PlanEntry>;
|
|
1368
|
+
};
|
|
1369
|
+
/**
|
|
1370
|
+
* A single entry in the execution plan.
|
|
1371
|
+
*
|
|
1372
|
+
* Represents a task or goal that the assistant intends to accomplish
|
|
1373
|
+
* as part of fulfilling the user's request.
|
|
1374
|
+
* See protocol docs: [Plan Entries](https://agentclientprotocol.com/protocol/agent-plan#plan-entries)
|
|
1375
|
+
*/
|
|
1376
|
+
export type PlanEntry = {
|
|
1377
|
+
/**
|
|
1378
|
+
* The _meta property is reserved by ACP to allow clients and agents to attach additional
|
|
1379
|
+
* metadata to their interactions. Implementations MUST NOT make assumptions about values at
|
|
1380
|
+
* these keys.
|
|
1381
|
+
*
|
|
1382
|
+
* See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)
|
|
1383
|
+
*/
|
|
1384
|
+
_meta?: {
|
|
1385
|
+
[key: string]: unknown;
|
|
1386
|
+
} | null;
|
|
1387
|
+
/**
|
|
1388
|
+
* Human-readable description of what this task aims to accomplish.
|
|
1389
|
+
*/
|
|
1390
|
+
content: string;
|
|
1391
|
+
/**
|
|
1392
|
+
* The relative importance of this task.
|
|
1393
|
+
* Used to indicate which tasks are most critical to the overall goal.
|
|
1394
|
+
*/
|
|
1395
|
+
priority: PlanEntryPriority;
|
|
1396
|
+
/**
|
|
1397
|
+
* Current execution status of this task.
|
|
1398
|
+
*/
|
|
1399
|
+
status: PlanEntryStatus;
|
|
1400
|
+
};
|
|
1401
|
+
/**
|
|
1402
|
+
* Priority levels for plan entries.
|
|
1403
|
+
*
|
|
1404
|
+
* Used to indicate the relative importance or urgency of different
|
|
1405
|
+
* tasks in the execution plan.
|
|
1406
|
+
* See protocol docs: [Plan Entries](https://agentclientprotocol.com/protocol/agent-plan#plan-entries)
|
|
1407
|
+
*/
|
|
1408
|
+
export type PlanEntryPriority = "high" | "medium" | "low";
|
|
1409
|
+
/**
|
|
1410
|
+
* Status of a plan entry in the execution flow.
|
|
1411
|
+
*
|
|
1412
|
+
* Tracks the lifecycle of each task from planning through completion.
|
|
1413
|
+
* See protocol docs: [Plan Entries](https://agentclientprotocol.com/protocol/agent-plan#plan-entries)
|
|
1414
|
+
*/
|
|
1415
|
+
export type PlanEntryStatus = "pending" | "in_progress" | "completed";
|
|
1416
|
+
/**
|
|
1417
|
+
* Prompt capabilities supported by the agent in `session/prompt` requests.
|
|
1418
|
+
*
|
|
1419
|
+
* Baseline agent functionality requires support for [`ContentBlock::Text`]
|
|
1420
|
+
* and [`ContentBlock::ResourceLink`] in prompt requests.
|
|
1421
|
+
*
|
|
1422
|
+
* Other variants must be explicitly opted in to.
|
|
1423
|
+
* Capabilities for different types of content in prompt requests.
|
|
1424
|
+
*
|
|
1425
|
+
* Indicates which content types beyond the baseline (text and resource links)
|
|
1426
|
+
* the agent can process.
|
|
1427
|
+
*
|
|
1428
|
+
* See protocol docs: [Prompt Capabilities](https://agentclientprotocol.com/protocol/initialization#prompt-capabilities)
|
|
1429
|
+
*/
|
|
1430
|
+
export type PromptCapabilities = {
|
|
1431
|
+
/**
|
|
1432
|
+
* The _meta property is reserved by ACP to allow clients and agents to attach additional
|
|
1433
|
+
* metadata to their interactions. Implementations MUST NOT make assumptions about values at
|
|
1434
|
+
* these keys.
|
|
1435
|
+
*
|
|
1436
|
+
* See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)
|
|
1437
|
+
*/
|
|
1438
|
+
_meta?: {
|
|
1439
|
+
[key: string]: unknown;
|
|
1440
|
+
} | null;
|
|
1441
|
+
/**
|
|
1442
|
+
* Agent supports [`ContentBlock::Audio`].
|
|
1443
|
+
*/
|
|
1444
|
+
audio?: boolean;
|
|
1445
|
+
/**
|
|
1446
|
+
* Agent supports embedded context in `session/prompt` requests.
|
|
1447
|
+
*
|
|
1448
|
+
* When enabled, the Client is allowed to include [`ContentBlock::Resource`]
|
|
1449
|
+
* in prompt requests for pieces of context that are referenced in the message.
|
|
1450
|
+
*/
|
|
1451
|
+
embeddedContext?: boolean;
|
|
1452
|
+
/**
|
|
1453
|
+
* Agent supports [`ContentBlock::Image`].
|
|
1454
|
+
*/
|
|
1455
|
+
image?: boolean;
|
|
1456
|
+
};
|
|
1457
|
+
/**
|
|
1458
|
+
* Request parameters for sending a user prompt to the agent.
|
|
1459
|
+
*
|
|
1460
|
+
* Contains the user's message and any additional context.
|
|
1461
|
+
*
|
|
1462
|
+
* See protocol docs: [User Message](https://agentclientprotocol.com/protocol/prompt-turn#1-user-message)
|
|
1463
|
+
*/
|
|
1464
|
+
export type PromptRequest = {
|
|
1465
|
+
/**
|
|
1466
|
+
* The _meta property is reserved by ACP to allow clients and agents to attach additional
|
|
1467
|
+
* metadata to their interactions. Implementations MUST NOT make assumptions about values at
|
|
1468
|
+
* these keys.
|
|
1469
|
+
*
|
|
1470
|
+
* See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)
|
|
1471
|
+
*/
|
|
1472
|
+
_meta?: {
|
|
1473
|
+
[key: string]: unknown;
|
|
1474
|
+
} | null;
|
|
1475
|
+
/**
|
|
1476
|
+
* The blocks of content that compose the user's message.
|
|
1477
|
+
*
|
|
1478
|
+
* As a baseline, the Agent MUST support [`ContentBlock::Text`] and [`ContentBlock::ResourceLink`],
|
|
1479
|
+
* while other variants are optionally enabled via [`PromptCapabilities`].
|
|
1480
|
+
*
|
|
1481
|
+
* The Client MUST adapt its interface according to [`PromptCapabilities`].
|
|
1482
|
+
*
|
|
1483
|
+
* The client MAY include referenced pieces of context as either
|
|
1484
|
+
* [`ContentBlock::Resource`] or [`ContentBlock::ResourceLink`].
|
|
1485
|
+
*
|
|
1486
|
+
* When available, [`ContentBlock::Resource`] is preferred
|
|
1487
|
+
* as it avoids extra round-trips and allows the message to include
|
|
1488
|
+
* pieces of context from sources the agent may not have access to.
|
|
1489
|
+
*/
|
|
1490
|
+
prompt: Array<ContentBlock>;
|
|
1491
|
+
/**
|
|
1492
|
+
* The ID of the session to send this user message to
|
|
1493
|
+
*/
|
|
1494
|
+
sessionId: SessionId;
|
|
1495
|
+
};
|
|
1496
|
+
/**
|
|
1497
|
+
* Response from processing a user prompt.
|
|
1498
|
+
*
|
|
1499
|
+
* See protocol docs: [Check for Completion](https://agentclientprotocol.com/protocol/prompt-turn#4-check-for-completion)
|
|
1500
|
+
*/
|
|
1501
|
+
export type PromptResponse = {
|
|
1502
|
+
/**
|
|
1503
|
+
* The _meta property is reserved by ACP to allow clients and agents to attach additional
|
|
1504
|
+
* metadata to their interactions. Implementations MUST NOT make assumptions about values at
|
|
1505
|
+
* these keys.
|
|
1506
|
+
*
|
|
1507
|
+
* See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)
|
|
1508
|
+
*/
|
|
1509
|
+
_meta?: {
|
|
1510
|
+
[key: string]: unknown;
|
|
1511
|
+
} | null;
|
|
1512
|
+
/**
|
|
1513
|
+
* Indicates why the agent stopped processing the turn.
|
|
1514
|
+
*/
|
|
1515
|
+
stopReason: StopReason;
|
|
1516
|
+
/**
|
|
1517
|
+
* **UNSTABLE**
|
|
1518
|
+
*
|
|
1519
|
+
* This capability is not part of the spec yet, and may be removed or changed at any point.
|
|
1520
|
+
*
|
|
1521
|
+
* Token usage for this turn (optional).
|
|
1522
|
+
*
|
|
1523
|
+
* @experimental
|
|
1524
|
+
*/
|
|
1525
|
+
usage?: Usage | null;
|
|
1526
|
+
};
|
|
1527
|
+
/**
|
|
1528
|
+
* Protocol version identifier.
|
|
1529
|
+
*
|
|
1530
|
+
* This version is only bumped for breaking changes.
|
|
1531
|
+
* Non-breaking changes should be introduced via capabilities.
|
|
1532
|
+
*/
|
|
1533
|
+
export type ProtocolVersion = number;
|
|
1534
|
+
/**
|
|
1535
|
+
* Request to read content from a text file.
|
|
1536
|
+
*
|
|
1537
|
+
* Only available if the client supports the `fs.readTextFile` capability.
|
|
1538
|
+
*/
|
|
1539
|
+
export type ReadTextFileRequest = {
|
|
1540
|
+
/**
|
|
1541
|
+
* The _meta property is reserved by ACP to allow clients and agents to attach additional
|
|
1542
|
+
* metadata to their interactions. Implementations MUST NOT make assumptions about values at
|
|
1543
|
+
* these keys.
|
|
1544
|
+
*
|
|
1545
|
+
* See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)
|
|
1546
|
+
*/
|
|
1547
|
+
_meta?: {
|
|
1548
|
+
[key: string]: unknown;
|
|
1549
|
+
} | null;
|
|
1550
|
+
/**
|
|
1551
|
+
* Maximum number of lines to read.
|
|
1552
|
+
*/
|
|
1553
|
+
limit?: number | null;
|
|
1554
|
+
/**
|
|
1555
|
+
* Line number to start reading from (1-based).
|
|
1556
|
+
*/
|
|
1557
|
+
line?: number | null;
|
|
1558
|
+
/**
|
|
1559
|
+
* Absolute path to the file to read.
|
|
1560
|
+
*/
|
|
1561
|
+
path: string;
|
|
1562
|
+
/**
|
|
1563
|
+
* The session ID for this request.
|
|
1564
|
+
*/
|
|
1565
|
+
sessionId: SessionId;
|
|
1566
|
+
};
|
|
1567
|
+
/**
|
|
1568
|
+
* Response containing the contents of a text file.
|
|
1569
|
+
*/
|
|
1570
|
+
export type ReadTextFileResponse = {
|
|
1571
|
+
/**
|
|
1572
|
+
* The _meta property is reserved by ACP to allow clients and agents to attach additional
|
|
1573
|
+
* metadata to their interactions. Implementations MUST NOT make assumptions about values at
|
|
1574
|
+
* these keys.
|
|
1575
|
+
*
|
|
1576
|
+
* See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)
|
|
1577
|
+
*/
|
|
1578
|
+
_meta?: {
|
|
1579
|
+
[key: string]: unknown;
|
|
1580
|
+
} | null;
|
|
1581
|
+
content: string;
|
|
1582
|
+
};
|
|
1583
|
+
/**
|
|
1584
|
+
* Request to release a terminal and free its resources.
|
|
1585
|
+
*/
|
|
1586
|
+
export type ReleaseTerminalRequest = {
|
|
1587
|
+
/**
|
|
1588
|
+
* The _meta property is reserved by ACP to allow clients and agents to attach additional
|
|
1589
|
+
* metadata to their interactions. Implementations MUST NOT make assumptions about values at
|
|
1590
|
+
* these keys.
|
|
1591
|
+
*
|
|
1592
|
+
* See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)
|
|
1593
|
+
*/
|
|
1594
|
+
_meta?: {
|
|
1595
|
+
[key: string]: unknown;
|
|
1596
|
+
} | null;
|
|
1597
|
+
/**
|
|
1598
|
+
* The session ID for this request.
|
|
1599
|
+
*/
|
|
1600
|
+
sessionId: SessionId;
|
|
1601
|
+
/**
|
|
1602
|
+
* The ID of the terminal to release.
|
|
1603
|
+
*/
|
|
1604
|
+
terminalId: string;
|
|
1605
|
+
};
|
|
1606
|
+
/**
|
|
1607
|
+
* Response to terminal/release method
|
|
1608
|
+
*/
|
|
1609
|
+
export type ReleaseTerminalResponse = {
|
|
1610
|
+
/**
|
|
1611
|
+
* The _meta property is reserved by ACP to allow clients and agents to attach additional
|
|
1612
|
+
* metadata to their interactions. Implementations MUST NOT make assumptions about values at
|
|
1613
|
+
* these keys.
|
|
1614
|
+
*
|
|
1615
|
+
* See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)
|
|
1616
|
+
*/
|
|
1617
|
+
_meta?: {
|
|
1618
|
+
[key: string]: unknown;
|
|
1619
|
+
} | null;
|
|
1620
|
+
};
|
|
1621
|
+
/**
|
|
1622
|
+
* JSON RPC Request Id
|
|
1623
|
+
*
|
|
1624
|
+
* An identifier established by the Client that MUST contain a String, Number, or NULL value if included. If it is not included it is assumed to be a notification. The value SHOULD normally not be Null [1] and Numbers SHOULD NOT contain fractional parts [2]
|
|
1625
|
+
*
|
|
1626
|
+
* The Server MUST reply with the same value in the Response object if included. This member is used to correlate the context between the two objects.
|
|
1627
|
+
*
|
|
1628
|
+
* [1] The use of Null as a value for the id member in a Request object is discouraged, because this specification uses a value of Null for Responses with an unknown id. Also, because JSON-RPC 1.0 uses an id value of Null for Notifications this could cause confusion in handling.
|
|
1629
|
+
*
|
|
1630
|
+
* [2] Fractional parts may be problematic, since many decimal fractions cannot be represented exactly as binary fractions.
|
|
1631
|
+
*/
|
|
1632
|
+
export type RequestId = null | number | string;
|
|
1633
|
+
/**
|
|
1634
|
+
* The outcome of a permission request.
|
|
1635
|
+
*/
|
|
1636
|
+
export type RequestPermissionOutcome = {
|
|
1637
|
+
outcome: "cancelled";
|
|
1638
|
+
} | (SelectedPermissionOutcome & {
|
|
1639
|
+
outcome: "selected";
|
|
1640
|
+
});
|
|
1641
|
+
/**
|
|
1642
|
+
* Request for user permission to execute a tool call.
|
|
1643
|
+
*
|
|
1644
|
+
* Sent when the agent needs authorization before performing a sensitive operation.
|
|
1645
|
+
*
|
|
1646
|
+
* See protocol docs: [Requesting Permission](https://agentclientprotocol.com/protocol/tool-calls#requesting-permission)
|
|
1647
|
+
*/
|
|
1648
|
+
export type RequestPermissionRequest = {
|
|
1649
|
+
/**
|
|
1650
|
+
* The _meta property is reserved by ACP to allow clients and agents to attach additional
|
|
1651
|
+
* metadata to their interactions. Implementations MUST NOT make assumptions about values at
|
|
1652
|
+
* these keys.
|
|
1653
|
+
*
|
|
1654
|
+
* See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)
|
|
1655
|
+
*/
|
|
1656
|
+
_meta?: {
|
|
1657
|
+
[key: string]: unknown;
|
|
1658
|
+
} | null;
|
|
1659
|
+
/**
|
|
1660
|
+
* Available permission options for the user to choose from.
|
|
1661
|
+
*/
|
|
1662
|
+
options: Array<PermissionOption>;
|
|
1663
|
+
/**
|
|
1664
|
+
* The session ID for this request.
|
|
1665
|
+
*/
|
|
1666
|
+
sessionId: SessionId;
|
|
1667
|
+
/**
|
|
1668
|
+
* Details about the tool call requiring permission.
|
|
1669
|
+
*/
|
|
1670
|
+
toolCall: ToolCallUpdate;
|
|
1671
|
+
};
|
|
1672
|
+
/**
|
|
1673
|
+
* Response to a permission request.
|
|
1674
|
+
*/
|
|
1675
|
+
export type RequestPermissionResponse = {
|
|
1676
|
+
/**
|
|
1677
|
+
* The _meta property is reserved by ACP to allow clients and agents to attach additional
|
|
1678
|
+
* metadata to their interactions. Implementations MUST NOT make assumptions about values at
|
|
1679
|
+
* these keys.
|
|
1680
|
+
*
|
|
1681
|
+
* See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)
|
|
1682
|
+
*/
|
|
1683
|
+
_meta?: {
|
|
1684
|
+
[key: string]: unknown;
|
|
1685
|
+
} | null;
|
|
1686
|
+
/**
|
|
1687
|
+
* The user's decision on the permission request.
|
|
1688
|
+
*/
|
|
1689
|
+
outcome: RequestPermissionOutcome;
|
|
1690
|
+
};
|
|
1691
|
+
/**
|
|
1692
|
+
* A resource that the server is capable of reading, included in a prompt or tool call result.
|
|
1693
|
+
*/
|
|
1694
|
+
export type ResourceLink = {
|
|
1695
|
+
/**
|
|
1696
|
+
* The _meta property is reserved by ACP to allow clients and agents to attach additional
|
|
1697
|
+
* metadata to their interactions. Implementations MUST NOT make assumptions about values at
|
|
1698
|
+
* these keys.
|
|
1699
|
+
*
|
|
1700
|
+
* See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)
|
|
1701
|
+
*/
|
|
1702
|
+
_meta?: {
|
|
1703
|
+
[key: string]: unknown;
|
|
1704
|
+
} | null;
|
|
1705
|
+
annotations?: Annotations | null;
|
|
1706
|
+
description?: string | null;
|
|
1707
|
+
mimeType?: string | null;
|
|
1708
|
+
name: string;
|
|
1709
|
+
size?: number | null;
|
|
1710
|
+
title?: string | null;
|
|
1711
|
+
uri: string;
|
|
1712
|
+
};
|
|
1713
|
+
/**
|
|
1714
|
+
* **UNSTABLE**
|
|
1715
|
+
*
|
|
1716
|
+
* This capability is not part of the spec yet, and may be removed or changed at any point.
|
|
1717
|
+
*
|
|
1718
|
+
* Request parameters for resuming an existing session.
|
|
1719
|
+
*
|
|
1720
|
+
* Resumes an existing session without returning previous messages (unlike `session/load`).
|
|
1721
|
+
* This is useful for agents that can resume sessions but don't implement full session loading.
|
|
1722
|
+
*
|
|
1723
|
+
* Only available if the Agent supports the `session.resume` capability.
|
|
1724
|
+
*
|
|
1725
|
+
* @experimental
|
|
1726
|
+
*/
|
|
1727
|
+
export type ResumeSessionRequest = {
|
|
1728
|
+
/**
|
|
1729
|
+
* The _meta property is reserved by ACP to allow clients and agents to attach additional
|
|
1730
|
+
* metadata to their interactions. Implementations MUST NOT make assumptions about values at
|
|
1731
|
+
* these keys.
|
|
1732
|
+
*
|
|
1733
|
+
* See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)
|
|
1734
|
+
*/
|
|
1735
|
+
_meta?: {
|
|
1736
|
+
[key: string]: unknown;
|
|
1737
|
+
} | null;
|
|
1738
|
+
/**
|
|
1739
|
+
* The working directory for this session.
|
|
1740
|
+
*/
|
|
1741
|
+
cwd: string;
|
|
1742
|
+
/**
|
|
1743
|
+
* List of MCP servers to connect to for this session.
|
|
1744
|
+
*/
|
|
1745
|
+
mcpServers?: Array<McpServer>;
|
|
1746
|
+
/**
|
|
1747
|
+
* The ID of the session to resume.
|
|
1748
|
+
*/
|
|
1749
|
+
sessionId: SessionId;
|
|
1750
|
+
};
|
|
1751
|
+
/**
|
|
1752
|
+
* **UNSTABLE**
|
|
1753
|
+
*
|
|
1754
|
+
* This capability is not part of the spec yet, and may be removed or changed at any point.
|
|
1755
|
+
*
|
|
1756
|
+
* Response from resuming an existing session.
|
|
1757
|
+
*
|
|
1758
|
+
* @experimental
|
|
1759
|
+
*/
|
|
1760
|
+
export type ResumeSessionResponse = {
|
|
1761
|
+
/**
|
|
1762
|
+
* The _meta property is reserved by ACP to allow clients and agents to attach additional
|
|
1763
|
+
* metadata to their interactions. Implementations MUST NOT make assumptions about values at
|
|
1764
|
+
* these keys.
|
|
1765
|
+
*
|
|
1766
|
+
* See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)
|
|
1767
|
+
*/
|
|
1768
|
+
_meta?: {
|
|
1769
|
+
[key: string]: unknown;
|
|
1770
|
+
} | null;
|
|
1771
|
+
/**
|
|
1772
|
+
* Initial session configuration options if supported by the Agent.
|
|
1773
|
+
*/
|
|
1774
|
+
configOptions?: Array<SessionConfigOption> | null;
|
|
1775
|
+
/**
|
|
1776
|
+
* **UNSTABLE**
|
|
1777
|
+
*
|
|
1778
|
+
* This capability is not part of the spec yet, and may be removed or changed at any point.
|
|
1779
|
+
*
|
|
1780
|
+
* Initial model state if supported by the Agent
|
|
1781
|
+
*
|
|
1782
|
+
* @experimental
|
|
1783
|
+
*/
|
|
1784
|
+
models?: SessionModelState | null;
|
|
1785
|
+
/**
|
|
1786
|
+
* Initial mode state if supported by the Agent
|
|
1787
|
+
*
|
|
1788
|
+
* See protocol docs: [Session Modes](https://agentclientprotocol.com/protocol/session-modes)
|
|
1789
|
+
*/
|
|
1790
|
+
modes?: SessionModeState | null;
|
|
1791
|
+
};
|
|
1792
|
+
/**
|
|
1793
|
+
* The sender or recipient of messages and data in a conversation.
|
|
1794
|
+
*/
|
|
1795
|
+
export type Role = "assistant" | "user";
|
|
1796
|
+
/**
|
|
1797
|
+
* The user selected one of the provided options.
|
|
1798
|
+
*/
|
|
1799
|
+
export type SelectedPermissionOutcome = {
|
|
1800
|
+
/**
|
|
1801
|
+
* The _meta property is reserved by ACP to allow clients and agents to attach additional
|
|
1802
|
+
* metadata to their interactions. Implementations MUST NOT make assumptions about values at
|
|
1803
|
+
* these keys.
|
|
1804
|
+
*
|
|
1805
|
+
* See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)
|
|
1806
|
+
*/
|
|
1807
|
+
_meta?: {
|
|
1808
|
+
[key: string]: unknown;
|
|
1809
|
+
} | null;
|
|
1810
|
+
/**
|
|
1811
|
+
* The ID of the option the user selected.
|
|
1812
|
+
*/
|
|
1813
|
+
optionId: PermissionOptionId;
|
|
1814
|
+
};
|
|
1815
|
+
/**
|
|
1816
|
+
* Session capabilities supported by the agent.
|
|
1817
|
+
*
|
|
1818
|
+
* As a baseline, all Agents **MUST** support `session/new`, `session/prompt`, `session/cancel`, and `session/update`.
|
|
1819
|
+
*
|
|
1820
|
+
* Optionally, they **MAY** support other session methods and notifications by specifying additional capabilities.
|
|
1821
|
+
*
|
|
1822
|
+
* Note: `session/load` is still handled by the top-level `load_session` capability. This will be unified in future versions of the protocol.
|
|
1823
|
+
*
|
|
1824
|
+
* See protocol docs: [Session Capabilities](https://agentclientprotocol.com/protocol/initialization#session-capabilities)
|
|
1825
|
+
*/
|
|
1826
|
+
export type SessionCapabilities = {
|
|
1827
|
+
/**
|
|
1828
|
+
* The _meta property is reserved by ACP to allow clients and agents to attach additional
|
|
1829
|
+
* metadata to their interactions. Implementations MUST NOT make assumptions about values at
|
|
1830
|
+
* these keys.
|
|
1831
|
+
*
|
|
1832
|
+
* See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)
|
|
1833
|
+
*/
|
|
1834
|
+
_meta?: {
|
|
1835
|
+
[key: string]: unknown;
|
|
1836
|
+
} | null;
|
|
1837
|
+
/**
|
|
1838
|
+
* **UNSTABLE**
|
|
1839
|
+
*
|
|
1840
|
+
* This capability is not part of the spec yet, and may be removed or changed at any point.
|
|
1841
|
+
*
|
|
1842
|
+
* Whether the agent supports `session/fork`.
|
|
1843
|
+
*
|
|
1844
|
+
* @experimental
|
|
1845
|
+
*/
|
|
1846
|
+
fork?: SessionForkCapabilities | null;
|
|
1847
|
+
/**
|
|
1848
|
+
* **UNSTABLE**
|
|
1849
|
+
*
|
|
1850
|
+
* This capability is not part of the spec yet, and may be removed or changed at any point.
|
|
1851
|
+
*
|
|
1852
|
+
* Whether the agent supports `session/list`.
|
|
1853
|
+
*
|
|
1854
|
+
* @experimental
|
|
1855
|
+
*/
|
|
1856
|
+
list?: SessionListCapabilities | null;
|
|
1857
|
+
/**
|
|
1858
|
+
* **UNSTABLE**
|
|
1859
|
+
*
|
|
1860
|
+
* This capability is not part of the spec yet, and may be removed or changed at any point.
|
|
1861
|
+
*
|
|
1862
|
+
* Whether the agent supports `session/resume`.
|
|
1863
|
+
*
|
|
1864
|
+
* @experimental
|
|
1865
|
+
*/
|
|
1866
|
+
resume?: SessionResumeCapabilities | null;
|
|
1867
|
+
};
|
|
1868
|
+
/**
|
|
1869
|
+
* Unique identifier for a session configuration option value group.
|
|
1870
|
+
*/
|
|
1871
|
+
export type SessionConfigGroupId = string;
|
|
1872
|
+
/**
|
|
1873
|
+
* Unique identifier for a session configuration option.
|
|
1874
|
+
*/
|
|
1875
|
+
export type SessionConfigId = string;
|
|
1876
|
+
export type SessionConfigOption = SessionConfigSelect & {
|
|
1877
|
+
type: "select";
|
|
1878
|
+
} & {
|
|
1879
|
+
/**
|
|
1880
|
+
* The _meta property is reserved by ACP to allow clients and agents to attach additional
|
|
1881
|
+
* metadata to their interactions. Implementations MUST NOT make assumptions about values at
|
|
1882
|
+
* these keys.
|
|
1883
|
+
*
|
|
1884
|
+
* See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)
|
|
1885
|
+
*/
|
|
1886
|
+
_meta?: {
|
|
1887
|
+
[key: string]: unknown;
|
|
1888
|
+
} | null;
|
|
1889
|
+
/**
|
|
1890
|
+
* Optional semantic category for this option (UX only).
|
|
1891
|
+
*/
|
|
1892
|
+
category?: SessionConfigOptionCategory | null;
|
|
1893
|
+
/**
|
|
1894
|
+
* Optional description for the Client to display to the user.
|
|
1895
|
+
*/
|
|
1896
|
+
description?: string | null;
|
|
1897
|
+
/**
|
|
1898
|
+
* Unique identifier for the configuration option.
|
|
1899
|
+
*/
|
|
1900
|
+
id: SessionConfigId;
|
|
1901
|
+
/**
|
|
1902
|
+
* Human-readable label for the option.
|
|
1903
|
+
*/
|
|
1904
|
+
name: string;
|
|
1905
|
+
};
|
|
1906
|
+
/**
|
|
1907
|
+
* Semantic category for a session configuration option.
|
|
1908
|
+
*
|
|
1909
|
+
* This is intended to help Clients distinguish broadly common selectors (e.g. model selector vs
|
|
1910
|
+
* session mode selector vs thought/reasoning level) for UX purposes (keyboard shortcuts, icons,
|
|
1911
|
+
* placement). It MUST NOT be required for correctness. Clients MUST handle missing or unknown
|
|
1912
|
+
* categories gracefully.
|
|
1913
|
+
*
|
|
1914
|
+
* Category names beginning with `_` are free for custom use, like other ACP extension methods.
|
|
1915
|
+
* Category names that do not begin with `_` are reserved for the ACP spec.
|
|
1916
|
+
*/
|
|
1917
|
+
export type SessionConfigOptionCategory = "mode" | "model" | "thought_level" | string;
|
|
1918
|
+
/**
|
|
1919
|
+
* A single-value selector (dropdown) session configuration option payload.
|
|
1920
|
+
*/
|
|
1921
|
+
export type SessionConfigSelect = {
|
|
1922
|
+
/**
|
|
1923
|
+
* The currently selected value.
|
|
1924
|
+
*/
|
|
1925
|
+
currentValue: SessionConfigValueId;
|
|
1926
|
+
/**
|
|
1927
|
+
* The set of selectable options.
|
|
1928
|
+
*/
|
|
1929
|
+
options: SessionConfigSelectOptions;
|
|
1930
|
+
};
|
|
1931
|
+
/**
|
|
1932
|
+
* A group of possible values for a session configuration option.
|
|
1933
|
+
*/
|
|
1934
|
+
export type SessionConfigSelectGroup = {
|
|
1935
|
+
/**
|
|
1936
|
+
* The _meta property is reserved by ACP to allow clients and agents to attach additional
|
|
1937
|
+
* metadata to their interactions. Implementations MUST NOT make assumptions about values at
|
|
1938
|
+
* these keys.
|
|
1939
|
+
*
|
|
1940
|
+
* See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)
|
|
1941
|
+
*/
|
|
1942
|
+
_meta?: {
|
|
1943
|
+
[key: string]: unknown;
|
|
1944
|
+
} | null;
|
|
1945
|
+
/**
|
|
1946
|
+
* Unique identifier for this group.
|
|
1947
|
+
*/
|
|
1948
|
+
group: SessionConfigGroupId;
|
|
1949
|
+
/**
|
|
1950
|
+
* Human-readable label for this group.
|
|
1951
|
+
*/
|
|
1952
|
+
name: string;
|
|
1953
|
+
/**
|
|
1954
|
+
* The set of option values in this group.
|
|
1955
|
+
*/
|
|
1956
|
+
options: Array<SessionConfigSelectOption>;
|
|
1957
|
+
};
|
|
1958
|
+
/**
|
|
1959
|
+
* A possible value for a session configuration option.
|
|
1960
|
+
*/
|
|
1961
|
+
export type SessionConfigSelectOption = {
|
|
1962
|
+
/**
|
|
1963
|
+
* The _meta property is reserved by ACP to allow clients and agents to attach additional
|
|
1964
|
+
* metadata to their interactions. Implementations MUST NOT make assumptions about values at
|
|
1965
|
+
* these keys.
|
|
1966
|
+
*
|
|
1967
|
+
* See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)
|
|
1968
|
+
*/
|
|
1969
|
+
_meta?: {
|
|
1970
|
+
[key: string]: unknown;
|
|
1971
|
+
} | null;
|
|
1972
|
+
/**
|
|
1973
|
+
* Optional description for this option value.
|
|
1974
|
+
*/
|
|
1975
|
+
description?: string | null;
|
|
1976
|
+
/**
|
|
1977
|
+
* Human-readable label for this option value.
|
|
1978
|
+
*/
|
|
1979
|
+
name: string;
|
|
1980
|
+
/**
|
|
1981
|
+
* Unique identifier for this option value.
|
|
1982
|
+
*/
|
|
1983
|
+
value: SessionConfigValueId;
|
|
1984
|
+
};
|
|
1985
|
+
/**
|
|
1986
|
+
* Possible values for a session configuration option.
|
|
1987
|
+
*/
|
|
1988
|
+
export type SessionConfigSelectOptions = Array<SessionConfigSelectOption> | Array<SessionConfigSelectGroup>;
|
|
1989
|
+
/**
|
|
1990
|
+
* Unique identifier for a session configuration option value.
|
|
1991
|
+
*/
|
|
1992
|
+
export type SessionConfigValueId = string;
|
|
1993
|
+
/**
|
|
1994
|
+
* **UNSTABLE**
|
|
1995
|
+
*
|
|
1996
|
+
* This capability is not part of the spec yet, and may be removed or changed at any point.
|
|
1997
|
+
*
|
|
1998
|
+
* Capabilities for the `session/fork` method.
|
|
1999
|
+
*
|
|
2000
|
+
* By supplying `{}` it means that the agent supports forking of sessions.
|
|
2001
|
+
*
|
|
2002
|
+
* @experimental
|
|
2003
|
+
*/
|
|
2004
|
+
export type SessionForkCapabilities = {
|
|
2005
|
+
/**
|
|
2006
|
+
* The _meta property is reserved by ACP to allow clients and agents to attach additional
|
|
2007
|
+
* metadata to their interactions. Implementations MUST NOT make assumptions about values at
|
|
2008
|
+
* these keys.
|
|
2009
|
+
*
|
|
2010
|
+
* See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)
|
|
2011
|
+
*/
|
|
2012
|
+
_meta?: {
|
|
2013
|
+
[key: string]: unknown;
|
|
2014
|
+
} | null;
|
|
2015
|
+
};
|
|
2016
|
+
/**
|
|
2017
|
+
* A unique identifier for a conversation session between a client and agent.
|
|
2018
|
+
*
|
|
2019
|
+
* Sessions maintain their own context, conversation history, and state,
|
|
2020
|
+
* allowing multiple independent interactions with the same agent.
|
|
2021
|
+
*
|
|
2022
|
+
* See protocol docs: [Session ID](https://agentclientprotocol.com/protocol/session-setup#session-id)
|
|
2023
|
+
*/
|
|
2024
|
+
export type SessionId = string;
|
|
2025
|
+
/**
|
|
2026
|
+
* **UNSTABLE**
|
|
2027
|
+
*
|
|
2028
|
+
* This capability is not part of the spec yet, and may be removed or changed at any point.
|
|
2029
|
+
*
|
|
2030
|
+
* Information about a session returned by session/list
|
|
2031
|
+
*
|
|
2032
|
+
* @experimental
|
|
2033
|
+
*/
|
|
2034
|
+
export type SessionInfo = {
|
|
2035
|
+
/**
|
|
2036
|
+
* The _meta property is reserved by ACP to allow clients and agents to attach additional
|
|
2037
|
+
* metadata to their interactions. Implementations MUST NOT make assumptions about values at
|
|
2038
|
+
* these keys.
|
|
2039
|
+
*
|
|
2040
|
+
* See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)
|
|
2041
|
+
*/
|
|
2042
|
+
_meta?: {
|
|
2043
|
+
[key: string]: unknown;
|
|
2044
|
+
} | null;
|
|
2045
|
+
/**
|
|
2046
|
+
* The working directory for this session. Must be an absolute path.
|
|
2047
|
+
*/
|
|
2048
|
+
cwd: string;
|
|
2049
|
+
/**
|
|
2050
|
+
* Unique identifier for the session
|
|
2051
|
+
*/
|
|
2052
|
+
sessionId: SessionId;
|
|
2053
|
+
/**
|
|
2054
|
+
* Human-readable title for the session
|
|
2055
|
+
*/
|
|
2056
|
+
title?: string | null;
|
|
2057
|
+
/**
|
|
2058
|
+
* ISO 8601 timestamp of last activity
|
|
2059
|
+
*/
|
|
2060
|
+
updatedAt?: string | null;
|
|
2061
|
+
};
|
|
2062
|
+
/**
|
|
2063
|
+
* Update to session metadata. All fields are optional to support partial updates.
|
|
2064
|
+
*
|
|
2065
|
+
* Agents send this notification to update session information like title or custom metadata.
|
|
2066
|
+
* This allows clients to display dynamic session names and track session state changes.
|
|
2067
|
+
*/
|
|
2068
|
+
export type SessionInfoUpdate = {
|
|
2069
|
+
/**
|
|
2070
|
+
* The _meta property is reserved by ACP to allow clients and agents to attach additional
|
|
2071
|
+
* metadata to their interactions. Implementations MUST NOT make assumptions about values at
|
|
2072
|
+
* these keys.
|
|
2073
|
+
*
|
|
2074
|
+
* See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)
|
|
2075
|
+
*/
|
|
2076
|
+
_meta?: {
|
|
2077
|
+
[key: string]: unknown;
|
|
2078
|
+
} | null;
|
|
2079
|
+
/**
|
|
2080
|
+
* Human-readable title for the session. Set to null to clear.
|
|
2081
|
+
*/
|
|
2082
|
+
title?: string | null;
|
|
2083
|
+
/**
|
|
2084
|
+
* ISO 8601 timestamp of last activity. Set to null to clear.
|
|
2085
|
+
*/
|
|
2086
|
+
updatedAt?: string | null;
|
|
2087
|
+
};
|
|
2088
|
+
/**
|
|
2089
|
+
* Capabilities for the `session/list` method.
|
|
2090
|
+
*
|
|
2091
|
+
* By supplying `{}` it means that the agent supports listing of sessions.
|
|
2092
|
+
*
|
|
2093
|
+
* Further capabilities can be added in the future for other means of filtering or searching the list.
|
|
2094
|
+
*/
|
|
2095
|
+
export type SessionListCapabilities = {
|
|
2096
|
+
/**
|
|
2097
|
+
* The _meta property is reserved by ACP to allow clients and agents to attach additional
|
|
2098
|
+
* metadata to their interactions. Implementations MUST NOT make assumptions about values at
|
|
2099
|
+
* these keys.
|
|
2100
|
+
*
|
|
2101
|
+
* See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)
|
|
2102
|
+
*/
|
|
2103
|
+
_meta?: {
|
|
2104
|
+
[key: string]: unknown;
|
|
2105
|
+
} | null;
|
|
2106
|
+
};
|
|
2107
|
+
/**
|
|
2108
|
+
* A mode the agent can operate in.
|
|
2109
|
+
*
|
|
2110
|
+
* See protocol docs: [Session Modes](https://agentclientprotocol.com/protocol/session-modes)
|
|
2111
|
+
*/
|
|
2112
|
+
export type SessionMode = {
|
|
2113
|
+
/**
|
|
2114
|
+
* The _meta property is reserved by ACP to allow clients and agents to attach additional
|
|
2115
|
+
* metadata to their interactions. Implementations MUST NOT make assumptions about values at
|
|
2116
|
+
* these keys.
|
|
2117
|
+
*
|
|
2118
|
+
* See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)
|
|
2119
|
+
*/
|
|
2120
|
+
_meta?: {
|
|
2121
|
+
[key: string]: unknown;
|
|
2122
|
+
} | null;
|
|
2123
|
+
description?: string | null;
|
|
2124
|
+
id: SessionModeId;
|
|
2125
|
+
name: string;
|
|
2126
|
+
};
|
|
2127
|
+
/**
|
|
2128
|
+
* Unique identifier for a Session Mode.
|
|
2129
|
+
*/
|
|
2130
|
+
export type SessionModeId = string;
|
|
2131
|
+
/**
|
|
2132
|
+
* The set of modes and the one currently active.
|
|
2133
|
+
*/
|
|
2134
|
+
export type SessionModeState = {
|
|
2135
|
+
/**
|
|
2136
|
+
* The _meta property is reserved by ACP to allow clients and agents to attach additional
|
|
2137
|
+
* metadata to their interactions. Implementations MUST NOT make assumptions about values at
|
|
2138
|
+
* these keys.
|
|
2139
|
+
*
|
|
2140
|
+
* See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)
|
|
2141
|
+
*/
|
|
2142
|
+
_meta?: {
|
|
2143
|
+
[key: string]: unknown;
|
|
2144
|
+
} | null;
|
|
2145
|
+
/**
|
|
2146
|
+
* The set of modes that the Agent can operate in
|
|
2147
|
+
*/
|
|
2148
|
+
availableModes: Array<SessionMode>;
|
|
2149
|
+
/**
|
|
2150
|
+
* The current mode the Agent is in.
|
|
2151
|
+
*/
|
|
2152
|
+
currentModeId: SessionModeId;
|
|
2153
|
+
};
|
|
2154
|
+
/**
|
|
2155
|
+
* **UNSTABLE**
|
|
2156
|
+
*
|
|
2157
|
+
* This capability is not part of the spec yet, and may be removed or changed at any point.
|
|
2158
|
+
*
|
|
2159
|
+
* The set of models and the one currently active.
|
|
2160
|
+
*
|
|
2161
|
+
* @experimental
|
|
2162
|
+
*/
|
|
2163
|
+
export type SessionModelState = {
|
|
2164
|
+
/**
|
|
2165
|
+
* The _meta property is reserved by ACP to allow clients and agents to attach additional
|
|
2166
|
+
* metadata to their interactions. Implementations MUST NOT make assumptions about values at
|
|
2167
|
+
* these keys.
|
|
2168
|
+
*
|
|
2169
|
+
* See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)
|
|
2170
|
+
*/
|
|
2171
|
+
_meta?: {
|
|
2172
|
+
[key: string]: unknown;
|
|
2173
|
+
} | null;
|
|
2174
|
+
/**
|
|
2175
|
+
* The set of models that the Agent can use
|
|
2176
|
+
*/
|
|
2177
|
+
availableModels: Array<ModelInfo>;
|
|
2178
|
+
/**
|
|
2179
|
+
* The current model the Agent is in.
|
|
2180
|
+
*/
|
|
2181
|
+
currentModelId: ModelId;
|
|
2182
|
+
};
|
|
2183
|
+
/**
|
|
2184
|
+
* Notification containing a session update from the agent.
|
|
2185
|
+
*
|
|
2186
|
+
* Used to stream real-time progress and results during prompt processing.
|
|
2187
|
+
*
|
|
2188
|
+
* See protocol docs: [Agent Reports Output](https://agentclientprotocol.com/protocol/prompt-turn#3-agent-reports-output)
|
|
2189
|
+
*/
|
|
2190
|
+
export type SessionNotification = {
|
|
2191
|
+
/**
|
|
2192
|
+
* The _meta property is reserved by ACP to allow clients and agents to attach additional
|
|
2193
|
+
* metadata to their interactions. Implementations MUST NOT make assumptions about values at
|
|
2194
|
+
* these keys.
|
|
2195
|
+
*
|
|
2196
|
+
* See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)
|
|
2197
|
+
*/
|
|
2198
|
+
_meta?: {
|
|
2199
|
+
[key: string]: unknown;
|
|
2200
|
+
} | null;
|
|
2201
|
+
/**
|
|
2202
|
+
* The ID of the session this update pertains to.
|
|
2203
|
+
*/
|
|
2204
|
+
sessionId: SessionId;
|
|
2205
|
+
/**
|
|
2206
|
+
* The actual update content.
|
|
2207
|
+
*/
|
|
2208
|
+
update: SessionUpdate;
|
|
2209
|
+
};
|
|
2210
|
+
/**
|
|
2211
|
+
* **UNSTABLE**
|
|
2212
|
+
*
|
|
2213
|
+
* This capability is not part of the spec yet, and may be removed or changed at any point.
|
|
2214
|
+
*
|
|
2215
|
+
* Capabilities for the `session/resume` method.
|
|
2216
|
+
*
|
|
2217
|
+
* By supplying `{}` it means that the agent supports resuming of sessions.
|
|
2218
|
+
*
|
|
2219
|
+
* @experimental
|
|
2220
|
+
*/
|
|
2221
|
+
export type SessionResumeCapabilities = {
|
|
2222
|
+
/**
|
|
2223
|
+
* The _meta property is reserved by ACP to allow clients and agents to attach additional
|
|
2224
|
+
* metadata to their interactions. Implementations MUST NOT make assumptions about values at
|
|
2225
|
+
* these keys.
|
|
2226
|
+
*
|
|
2227
|
+
* See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)
|
|
2228
|
+
*/
|
|
2229
|
+
_meta?: {
|
|
2230
|
+
[key: string]: unknown;
|
|
2231
|
+
} | null;
|
|
2232
|
+
};
|
|
2233
|
+
/**
|
|
2234
|
+
* Different types of updates that can be sent during session processing.
|
|
2235
|
+
*
|
|
2236
|
+
* These updates provide real-time feedback about the agent's progress.
|
|
2237
|
+
*
|
|
2238
|
+
* See protocol docs: [Agent Reports Output](https://agentclientprotocol.com/protocol/prompt-turn#3-agent-reports-output)
|
|
2239
|
+
*/
|
|
2240
|
+
export type SessionUpdate = (ContentChunk & {
|
|
2241
|
+
sessionUpdate: "user_message_chunk";
|
|
2242
|
+
}) | (ContentChunk & {
|
|
2243
|
+
sessionUpdate: "agent_message_chunk";
|
|
2244
|
+
}) | (ContentChunk & {
|
|
2245
|
+
sessionUpdate: "agent_thought_chunk";
|
|
2246
|
+
}) | (ToolCall & {
|
|
2247
|
+
sessionUpdate: "tool_call";
|
|
2248
|
+
}) | (ToolCallUpdate & {
|
|
2249
|
+
sessionUpdate: "tool_call_update";
|
|
2250
|
+
}) | (Plan & {
|
|
2251
|
+
sessionUpdate: "plan";
|
|
2252
|
+
}) | (AvailableCommandsUpdate & {
|
|
2253
|
+
sessionUpdate: "available_commands_update";
|
|
2254
|
+
}) | (CurrentModeUpdate & {
|
|
2255
|
+
sessionUpdate: "current_mode_update";
|
|
2256
|
+
}) | (ConfigOptionUpdate & {
|
|
2257
|
+
sessionUpdate: "config_option_update";
|
|
2258
|
+
}) | (SessionInfoUpdate & {
|
|
2259
|
+
sessionUpdate: "session_info_update";
|
|
2260
|
+
}) | (UsageUpdate & {
|
|
2261
|
+
sessionUpdate: "usage_update";
|
|
2262
|
+
});
|
|
2263
|
+
/**
|
|
2264
|
+
* Request parameters for setting a session configuration option.
|
|
2265
|
+
*/
|
|
2266
|
+
export type SetSessionConfigOptionRequest = {
|
|
2267
|
+
/**
|
|
2268
|
+
* The _meta property is reserved by ACP to allow clients and agents to attach additional
|
|
2269
|
+
* metadata to their interactions. Implementations MUST NOT make assumptions about values at
|
|
2270
|
+
* these keys.
|
|
2271
|
+
*
|
|
2272
|
+
* See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)
|
|
2273
|
+
*/
|
|
2274
|
+
_meta?: {
|
|
2275
|
+
[key: string]: unknown;
|
|
2276
|
+
} | null;
|
|
2277
|
+
/**
|
|
2278
|
+
* The ID of the configuration option to set.
|
|
2279
|
+
*/
|
|
2280
|
+
configId: SessionConfigId;
|
|
2281
|
+
/**
|
|
2282
|
+
* The ID of the session to set the configuration option for.
|
|
2283
|
+
*/
|
|
2284
|
+
sessionId: SessionId;
|
|
2285
|
+
/**
|
|
2286
|
+
* The ID of the configuration option value to set.
|
|
2287
|
+
*/
|
|
2288
|
+
value: SessionConfigValueId;
|
|
2289
|
+
};
|
|
2290
|
+
/**
|
|
2291
|
+
* Response to `session/set_config_option` method.
|
|
2292
|
+
*/
|
|
2293
|
+
export type SetSessionConfigOptionResponse = {
|
|
2294
|
+
/**
|
|
2295
|
+
* The _meta property is reserved by ACP to allow clients and agents to attach additional
|
|
2296
|
+
* metadata to their interactions. Implementations MUST NOT make assumptions about values at
|
|
2297
|
+
* these keys.
|
|
2298
|
+
*
|
|
2299
|
+
* See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)
|
|
2300
|
+
*/
|
|
2301
|
+
_meta?: {
|
|
2302
|
+
[key: string]: unknown;
|
|
2303
|
+
} | null;
|
|
2304
|
+
/**
|
|
2305
|
+
* The full set of configuration options and their current values.
|
|
2306
|
+
*/
|
|
2307
|
+
configOptions: Array<SessionConfigOption>;
|
|
2308
|
+
};
|
|
2309
|
+
/**
|
|
2310
|
+
* Request parameters for setting a session mode.
|
|
2311
|
+
*/
|
|
2312
|
+
export type SetSessionModeRequest = {
|
|
2313
|
+
/**
|
|
2314
|
+
* The _meta property is reserved by ACP to allow clients and agents to attach additional
|
|
2315
|
+
* metadata to their interactions. Implementations MUST NOT make assumptions about values at
|
|
2316
|
+
* these keys.
|
|
2317
|
+
*
|
|
2318
|
+
* See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)
|
|
2319
|
+
*/
|
|
2320
|
+
_meta?: {
|
|
2321
|
+
[key: string]: unknown;
|
|
2322
|
+
} | null;
|
|
2323
|
+
/**
|
|
2324
|
+
* The ID of the mode to set.
|
|
2325
|
+
*/
|
|
2326
|
+
modeId: SessionModeId;
|
|
2327
|
+
/**
|
|
2328
|
+
* The ID of the session to set the mode for.
|
|
2329
|
+
*/
|
|
2330
|
+
sessionId: SessionId;
|
|
2331
|
+
};
|
|
2332
|
+
/**
|
|
2333
|
+
* Response to `session/set_mode` method.
|
|
2334
|
+
*/
|
|
2335
|
+
export type SetSessionModeResponse = {
|
|
2336
|
+
_meta?: {
|
|
2337
|
+
[key: string]: unknown;
|
|
2338
|
+
} | null;
|
|
2339
|
+
};
|
|
2340
|
+
/**
|
|
2341
|
+
* **UNSTABLE**
|
|
2342
|
+
*
|
|
2343
|
+
* This capability is not part of the spec yet, and may be removed or changed at any point.
|
|
2344
|
+
*
|
|
2345
|
+
* Request parameters for setting a session model.
|
|
2346
|
+
*
|
|
2347
|
+
* @experimental
|
|
2348
|
+
*/
|
|
2349
|
+
export type SetSessionModelRequest = {
|
|
2350
|
+
/**
|
|
2351
|
+
* The _meta property is reserved by ACP to allow clients and agents to attach additional
|
|
2352
|
+
* metadata to their interactions. Implementations MUST NOT make assumptions about values at
|
|
2353
|
+
* these keys.
|
|
2354
|
+
*
|
|
2355
|
+
* See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)
|
|
2356
|
+
*/
|
|
2357
|
+
_meta?: {
|
|
2358
|
+
[key: string]: unknown;
|
|
2359
|
+
} | null;
|
|
2360
|
+
/**
|
|
2361
|
+
* The ID of the model to set.
|
|
2362
|
+
*/
|
|
2363
|
+
modelId: ModelId;
|
|
2364
|
+
/**
|
|
2365
|
+
* The ID of the session to set the model for.
|
|
2366
|
+
*/
|
|
2367
|
+
sessionId: SessionId;
|
|
2368
|
+
};
|
|
2369
|
+
/**
|
|
2370
|
+
* **UNSTABLE**
|
|
2371
|
+
*
|
|
2372
|
+
* This capability is not part of the spec yet, and may be removed or changed at any point.
|
|
2373
|
+
*
|
|
2374
|
+
* Response to `session/set_model` method.
|
|
2375
|
+
*
|
|
2376
|
+
* @experimental
|
|
2377
|
+
*/
|
|
2378
|
+
export type SetSessionModelResponse = {
|
|
2379
|
+
/**
|
|
2380
|
+
* The _meta property is reserved by ACP to allow clients and agents to attach additional
|
|
2381
|
+
* metadata to their interactions. Implementations MUST NOT make assumptions about values at
|
|
2382
|
+
* these keys.
|
|
2383
|
+
*
|
|
2384
|
+
* See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)
|
|
2385
|
+
*/
|
|
2386
|
+
_meta?: {
|
|
2387
|
+
[key: string]: unknown;
|
|
2388
|
+
} | null;
|
|
2389
|
+
};
|
|
2390
|
+
/**
|
|
2391
|
+
* Reasons why an agent stops processing a prompt turn.
|
|
2392
|
+
*
|
|
2393
|
+
* See protocol docs: [Stop Reasons](https://agentclientprotocol.com/protocol/prompt-turn#stop-reasons)
|
|
2394
|
+
*/
|
|
2395
|
+
export type StopReason = "end_turn" | "max_tokens" | "max_turn_requests" | "refusal" | "cancelled";
|
|
2396
|
+
/**
|
|
2397
|
+
* Embed a terminal created with `terminal/create` by its id.
|
|
2398
|
+
*
|
|
2399
|
+
* The terminal must be added before calling `terminal/release`.
|
|
2400
|
+
*
|
|
2401
|
+
* See protocol docs: [Terminal](https://agentclientprotocol.com/protocol/terminals)
|
|
2402
|
+
*/
|
|
2403
|
+
export type Terminal = {
|
|
2404
|
+
/**
|
|
2405
|
+
* The _meta property is reserved by ACP to allow clients and agents to attach additional
|
|
2406
|
+
* metadata to their interactions. Implementations MUST NOT make assumptions about values at
|
|
2407
|
+
* these keys.
|
|
2408
|
+
*
|
|
2409
|
+
* See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)
|
|
2410
|
+
*/
|
|
2411
|
+
_meta?: {
|
|
2412
|
+
[key: string]: unknown;
|
|
2413
|
+
} | null;
|
|
2414
|
+
terminalId: string;
|
|
2415
|
+
};
|
|
2416
|
+
/**
|
|
2417
|
+
* Exit status of a terminal command.
|
|
2418
|
+
*/
|
|
2419
|
+
export type TerminalExitStatus = {
|
|
2420
|
+
/**
|
|
2421
|
+
* The _meta property is reserved by ACP to allow clients and agents to attach additional
|
|
2422
|
+
* metadata to their interactions. Implementations MUST NOT make assumptions about values at
|
|
2423
|
+
* these keys.
|
|
2424
|
+
*
|
|
2425
|
+
* See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)
|
|
2426
|
+
*/
|
|
2427
|
+
_meta?: {
|
|
2428
|
+
[key: string]: unknown;
|
|
2429
|
+
} | null;
|
|
2430
|
+
/**
|
|
2431
|
+
* The process exit code (may be null if terminated by signal).
|
|
2432
|
+
*/
|
|
2433
|
+
exitCode?: number | null;
|
|
2434
|
+
/**
|
|
2435
|
+
* The signal that terminated the process (may be null if exited normally).
|
|
2436
|
+
*/
|
|
2437
|
+
signal?: string | null;
|
|
2438
|
+
};
|
|
2439
|
+
/**
|
|
2440
|
+
* Request to get the current output and status of a terminal.
|
|
2441
|
+
*/
|
|
2442
|
+
export type TerminalOutputRequest = {
|
|
2443
|
+
/**
|
|
2444
|
+
* The _meta property is reserved by ACP to allow clients and agents to attach additional
|
|
2445
|
+
* metadata to their interactions. Implementations MUST NOT make assumptions about values at
|
|
2446
|
+
* these keys.
|
|
2447
|
+
*
|
|
2448
|
+
* See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)
|
|
2449
|
+
*/
|
|
2450
|
+
_meta?: {
|
|
2451
|
+
[key: string]: unknown;
|
|
2452
|
+
} | null;
|
|
2453
|
+
/**
|
|
2454
|
+
* The session ID for this request.
|
|
2455
|
+
*/
|
|
2456
|
+
sessionId: SessionId;
|
|
2457
|
+
/**
|
|
2458
|
+
* The ID of the terminal to get output from.
|
|
2459
|
+
*/
|
|
2460
|
+
terminalId: string;
|
|
2461
|
+
};
|
|
2462
|
+
/**
|
|
2463
|
+
* Response containing the terminal output and exit status.
|
|
2464
|
+
*/
|
|
2465
|
+
export type TerminalOutputResponse = {
|
|
2466
|
+
/**
|
|
2467
|
+
* The _meta property is reserved by ACP to allow clients and agents to attach additional
|
|
2468
|
+
* metadata to their interactions. Implementations MUST NOT make assumptions about values at
|
|
2469
|
+
* these keys.
|
|
2470
|
+
*
|
|
2471
|
+
* See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)
|
|
2472
|
+
*/
|
|
2473
|
+
_meta?: {
|
|
2474
|
+
[key: string]: unknown;
|
|
2475
|
+
} | null;
|
|
2476
|
+
/**
|
|
2477
|
+
* Exit status if the command has completed.
|
|
2478
|
+
*/
|
|
2479
|
+
exitStatus?: TerminalExitStatus | null;
|
|
2480
|
+
/**
|
|
2481
|
+
* The terminal output captured so far.
|
|
2482
|
+
*/
|
|
2483
|
+
output: string;
|
|
2484
|
+
/**
|
|
2485
|
+
* Whether the output was truncated due to byte limits.
|
|
2486
|
+
*/
|
|
2487
|
+
truncated: boolean;
|
|
2488
|
+
};
|
|
2489
|
+
/**
|
|
2490
|
+
* Text provided to or from an LLM.
|
|
2491
|
+
*/
|
|
2492
|
+
export type TextContent = {
|
|
2493
|
+
/**
|
|
2494
|
+
* The _meta property is reserved by ACP to allow clients and agents to attach additional
|
|
2495
|
+
* metadata to their interactions. Implementations MUST NOT make assumptions about values at
|
|
2496
|
+
* these keys.
|
|
2497
|
+
*
|
|
2498
|
+
* See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)
|
|
2499
|
+
*/
|
|
2500
|
+
_meta?: {
|
|
2501
|
+
[key: string]: unknown;
|
|
2502
|
+
} | null;
|
|
2503
|
+
annotations?: Annotations | null;
|
|
2504
|
+
text: string;
|
|
2505
|
+
};
|
|
2506
|
+
/**
|
|
2507
|
+
* Text-based resource contents.
|
|
2508
|
+
*/
|
|
2509
|
+
export type TextResourceContents = {
|
|
2510
|
+
/**
|
|
2511
|
+
* The _meta property is reserved by ACP to allow clients and agents to attach additional
|
|
2512
|
+
* metadata to their interactions. Implementations MUST NOT make assumptions about values at
|
|
2513
|
+
* these keys.
|
|
2514
|
+
*
|
|
2515
|
+
* See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)
|
|
2516
|
+
*/
|
|
2517
|
+
_meta?: {
|
|
2518
|
+
[key: string]: unknown;
|
|
2519
|
+
} | null;
|
|
2520
|
+
mimeType?: string | null;
|
|
2521
|
+
text: string;
|
|
2522
|
+
uri: string;
|
|
2523
|
+
};
|
|
2524
|
+
/**
|
|
2525
|
+
* Represents a tool call that the language model has requested.
|
|
2526
|
+
*
|
|
2527
|
+
* Tool calls are actions that the agent executes on behalf of the language model,
|
|
2528
|
+
* such as reading files, executing code, or fetching data from external sources.
|
|
2529
|
+
*
|
|
2530
|
+
* See protocol docs: [Tool Calls](https://agentclientprotocol.com/protocol/tool-calls)
|
|
2531
|
+
*/
|
|
2532
|
+
export type ToolCall = {
|
|
2533
|
+
/**
|
|
2534
|
+
* The _meta property is reserved by ACP to allow clients and agents to attach additional
|
|
2535
|
+
* metadata to their interactions. Implementations MUST NOT make assumptions about values at
|
|
2536
|
+
* these keys.
|
|
2537
|
+
*
|
|
2538
|
+
* See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)
|
|
2539
|
+
*/
|
|
2540
|
+
_meta?: {
|
|
2541
|
+
[key: string]: unknown;
|
|
2542
|
+
} | null;
|
|
2543
|
+
/**
|
|
2544
|
+
* Content produced by the tool call.
|
|
2545
|
+
*/
|
|
2546
|
+
content?: Array<ToolCallContent>;
|
|
2547
|
+
/**
|
|
2548
|
+
* The category of tool being invoked.
|
|
2549
|
+
* Helps clients choose appropriate icons and UI treatment.
|
|
2550
|
+
*/
|
|
2551
|
+
kind?: ToolKind;
|
|
2552
|
+
/**
|
|
2553
|
+
* File locations affected by this tool call.
|
|
2554
|
+
* Enables "follow-along" features in clients.
|
|
2555
|
+
*/
|
|
2556
|
+
locations?: Array<ToolCallLocation>;
|
|
2557
|
+
/**
|
|
2558
|
+
* Raw input parameters sent to the tool.
|
|
2559
|
+
*/
|
|
2560
|
+
rawInput?: unknown;
|
|
2561
|
+
/**
|
|
2562
|
+
* Raw output returned by the tool.
|
|
2563
|
+
*/
|
|
2564
|
+
rawOutput?: unknown;
|
|
2565
|
+
/**
|
|
2566
|
+
* Current execution status of the tool call.
|
|
2567
|
+
*/
|
|
2568
|
+
status?: ToolCallStatus;
|
|
2569
|
+
/**
|
|
2570
|
+
* Human-readable title describing what the tool is doing.
|
|
2571
|
+
*/
|
|
2572
|
+
title: string;
|
|
2573
|
+
/**
|
|
2574
|
+
* Unique identifier for this tool call within the session.
|
|
2575
|
+
*/
|
|
2576
|
+
toolCallId: ToolCallId;
|
|
2577
|
+
};
|
|
2578
|
+
/**
|
|
2579
|
+
* Content produced by a tool call.
|
|
2580
|
+
*
|
|
2581
|
+
* Tool calls can produce different types of content including
|
|
2582
|
+
* standard content blocks (text, images) or file diffs.
|
|
2583
|
+
*
|
|
2584
|
+
* See protocol docs: [Content](https://agentclientprotocol.com/protocol/tool-calls#content)
|
|
2585
|
+
*/
|
|
2586
|
+
export type ToolCallContent = (Content & {
|
|
2587
|
+
type: "content";
|
|
2588
|
+
}) | (Diff & {
|
|
2589
|
+
type: "diff";
|
|
2590
|
+
}) | (Terminal & {
|
|
2591
|
+
type: "terminal";
|
|
2592
|
+
});
|
|
2593
|
+
/**
|
|
2594
|
+
* Unique identifier for a tool call within a session.
|
|
2595
|
+
*/
|
|
2596
|
+
export type ToolCallId = string;
|
|
2597
|
+
/**
|
|
2598
|
+
* A file location being accessed or modified by a tool.
|
|
2599
|
+
*
|
|
2600
|
+
* Enables clients to implement "follow-along" features that track
|
|
2601
|
+
* which files the agent is working with in real-time.
|
|
2602
|
+
*
|
|
2603
|
+
* See protocol docs: [Following the Agent](https://agentclientprotocol.com/protocol/tool-calls#following-the-agent)
|
|
2604
|
+
*/
|
|
2605
|
+
export type ToolCallLocation = {
|
|
2606
|
+
/**
|
|
2607
|
+
* The _meta property is reserved by ACP to allow clients and agents to attach additional
|
|
2608
|
+
* metadata to their interactions. Implementations MUST NOT make assumptions about values at
|
|
2609
|
+
* these keys.
|
|
2610
|
+
*
|
|
2611
|
+
* See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)
|
|
2612
|
+
*/
|
|
2613
|
+
_meta?: {
|
|
2614
|
+
[key: string]: unknown;
|
|
2615
|
+
} | null;
|
|
2616
|
+
/**
|
|
2617
|
+
* Optional line number within the file.
|
|
2618
|
+
*/
|
|
2619
|
+
line?: number | null;
|
|
2620
|
+
/**
|
|
2621
|
+
* The file path being accessed or modified.
|
|
2622
|
+
*/
|
|
2623
|
+
path: string;
|
|
2624
|
+
};
|
|
2625
|
+
/**
|
|
2626
|
+
* Execution status of a tool call.
|
|
2627
|
+
*
|
|
2628
|
+
* Tool calls progress through different statuses during their lifecycle.
|
|
2629
|
+
*
|
|
2630
|
+
* See protocol docs: [Status](https://agentclientprotocol.com/protocol/tool-calls#status)
|
|
2631
|
+
*/
|
|
2632
|
+
export type ToolCallStatus = "pending" | "in_progress" | "completed" | "failed";
|
|
2633
|
+
/**
|
|
2634
|
+
* An update to an existing tool call.
|
|
2635
|
+
*
|
|
2636
|
+
* Used to report progress and results as tools execute. All fields except
|
|
2637
|
+
* the tool call ID are optional - only changed fields need to be included.
|
|
2638
|
+
*
|
|
2639
|
+
* See protocol docs: [Updating](https://agentclientprotocol.com/protocol/tool-calls#updating)
|
|
2640
|
+
*/
|
|
2641
|
+
export type ToolCallUpdate = {
|
|
2642
|
+
/**
|
|
2643
|
+
* The _meta property is reserved by ACP to allow clients and agents to attach additional
|
|
2644
|
+
* metadata to their interactions. Implementations MUST NOT make assumptions about values at
|
|
2645
|
+
* these keys.
|
|
2646
|
+
*
|
|
2647
|
+
* See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)
|
|
2648
|
+
*/
|
|
2649
|
+
_meta?: {
|
|
2650
|
+
[key: string]: unknown;
|
|
2651
|
+
} | null;
|
|
2652
|
+
/**
|
|
2653
|
+
* Replace the content collection.
|
|
2654
|
+
*/
|
|
2655
|
+
content?: Array<ToolCallContent> | null;
|
|
2656
|
+
/**
|
|
2657
|
+
* Update the tool kind.
|
|
2658
|
+
*/
|
|
2659
|
+
kind?: ToolKind | null;
|
|
2660
|
+
/**
|
|
2661
|
+
* Replace the locations collection.
|
|
2662
|
+
*/
|
|
2663
|
+
locations?: Array<ToolCallLocation> | null;
|
|
2664
|
+
/**
|
|
2665
|
+
* Update the raw input.
|
|
2666
|
+
*/
|
|
2667
|
+
rawInput?: unknown;
|
|
2668
|
+
/**
|
|
2669
|
+
* Update the raw output.
|
|
2670
|
+
*/
|
|
2671
|
+
rawOutput?: unknown;
|
|
2672
|
+
/**
|
|
2673
|
+
* Update the execution status.
|
|
2674
|
+
*/
|
|
2675
|
+
status?: ToolCallStatus | null;
|
|
2676
|
+
/**
|
|
2677
|
+
* Update the human-readable title.
|
|
2678
|
+
*/
|
|
2679
|
+
title?: string | null;
|
|
2680
|
+
/**
|
|
2681
|
+
* The ID of the tool call being updated.
|
|
2682
|
+
*/
|
|
2683
|
+
toolCallId: ToolCallId;
|
|
2684
|
+
};
|
|
2685
|
+
/**
|
|
2686
|
+
* Categories of tools that can be invoked.
|
|
2687
|
+
*
|
|
2688
|
+
* Tool kinds help clients choose appropriate icons and optimize how they
|
|
2689
|
+
* display tool execution progress.
|
|
2690
|
+
*
|
|
2691
|
+
* See protocol docs: [Creating](https://agentclientprotocol.com/protocol/tool-calls#creating)
|
|
2692
|
+
*/
|
|
2693
|
+
export type ToolKind = "read" | "edit" | "delete" | "move" | "search" | "execute" | "think" | "fetch" | "switch_mode" | "other";
|
|
2694
|
+
/**
|
|
2695
|
+
* All text that was typed after the command name is provided as input.
|
|
2696
|
+
*/
|
|
2697
|
+
export type UnstructuredCommandInput = {
|
|
2698
|
+
/**
|
|
2699
|
+
* The _meta property is reserved by ACP to allow clients and agents to attach additional
|
|
2700
|
+
* metadata to their interactions. Implementations MUST NOT make assumptions about values at
|
|
2701
|
+
* these keys.
|
|
2702
|
+
*
|
|
2703
|
+
* See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)
|
|
2704
|
+
*/
|
|
2705
|
+
_meta?: {
|
|
2706
|
+
[key: string]: unknown;
|
|
2707
|
+
} | null;
|
|
2708
|
+
/**
|
|
2709
|
+
* A hint to display when the input hasn't been provided yet
|
|
2710
|
+
*/
|
|
2711
|
+
hint: string;
|
|
2712
|
+
};
|
|
2713
|
+
/**
|
|
2714
|
+
* **UNSTABLE**
|
|
2715
|
+
*
|
|
2716
|
+
* This capability is not part of the spec yet, and may be removed or changed at any point.
|
|
2717
|
+
*
|
|
2718
|
+
* Token usage information for a prompt turn.
|
|
2719
|
+
*
|
|
2720
|
+
* @experimental
|
|
2721
|
+
*/
|
|
2722
|
+
export type Usage = {
|
|
2723
|
+
/**
|
|
2724
|
+
* Total cache read tokens.
|
|
2725
|
+
*/
|
|
2726
|
+
cachedReadTokens?: number | null;
|
|
2727
|
+
/**
|
|
2728
|
+
* Total cache write tokens.
|
|
2729
|
+
*/
|
|
2730
|
+
cachedWriteTokens?: number | null;
|
|
2731
|
+
/**
|
|
2732
|
+
* Total input tokens across all turns.
|
|
2733
|
+
*/
|
|
2734
|
+
inputTokens: number;
|
|
2735
|
+
/**
|
|
2736
|
+
* Total output tokens across all turns.
|
|
2737
|
+
*/
|
|
2738
|
+
outputTokens: number;
|
|
2739
|
+
/**
|
|
2740
|
+
* Total thought/reasoning tokens
|
|
2741
|
+
*/
|
|
2742
|
+
thoughtTokens?: number | null;
|
|
2743
|
+
/**
|
|
2744
|
+
* Sum of all token types across session.
|
|
2745
|
+
*/
|
|
2746
|
+
totalTokens: number;
|
|
2747
|
+
};
|
|
2748
|
+
/**
|
|
2749
|
+
* **UNSTABLE**
|
|
2750
|
+
*
|
|
2751
|
+
* This capability is not part of the spec yet, and may be removed or changed at any point.
|
|
2752
|
+
*
|
|
2753
|
+
* Context window and cost update for a session.
|
|
2754
|
+
*
|
|
2755
|
+
* @experimental
|
|
2756
|
+
*/
|
|
2757
|
+
export type UsageUpdate = {
|
|
2758
|
+
/**
|
|
2759
|
+
* The _meta property is reserved by ACP to allow clients and agents to attach additional
|
|
2760
|
+
* metadata to their interactions. Implementations MUST NOT make assumptions about values at
|
|
2761
|
+
* these keys.
|
|
2762
|
+
*
|
|
2763
|
+
* See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)
|
|
2764
|
+
*/
|
|
2765
|
+
_meta?: {
|
|
2766
|
+
[key: string]: unknown;
|
|
2767
|
+
} | null;
|
|
2768
|
+
/**
|
|
2769
|
+
* Cumulative session cost (optional).
|
|
2770
|
+
*/
|
|
2771
|
+
cost?: Cost | null;
|
|
2772
|
+
/**
|
|
2773
|
+
* Total context window size in tokens.
|
|
2774
|
+
*/
|
|
2775
|
+
size: number;
|
|
2776
|
+
/**
|
|
2777
|
+
* Tokens currently in context.
|
|
2778
|
+
*/
|
|
2779
|
+
used: number;
|
|
2780
|
+
};
|
|
2781
|
+
/**
|
|
2782
|
+
* Request to wait for a terminal command to exit.
|
|
2783
|
+
*/
|
|
2784
|
+
export type WaitForTerminalExitRequest = {
|
|
2785
|
+
/**
|
|
2786
|
+
* The _meta property is reserved by ACP to allow clients and agents to attach additional
|
|
2787
|
+
* metadata to their interactions. Implementations MUST NOT make assumptions about values at
|
|
2788
|
+
* these keys.
|
|
2789
|
+
*
|
|
2790
|
+
* See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)
|
|
2791
|
+
*/
|
|
2792
|
+
_meta?: {
|
|
2793
|
+
[key: string]: unknown;
|
|
2794
|
+
} | null;
|
|
2795
|
+
/**
|
|
2796
|
+
* The session ID for this request.
|
|
2797
|
+
*/
|
|
2798
|
+
sessionId: SessionId;
|
|
2799
|
+
/**
|
|
2800
|
+
* The ID of the terminal to wait for.
|
|
2801
|
+
*/
|
|
2802
|
+
terminalId: string;
|
|
2803
|
+
};
|
|
2804
|
+
/**
|
|
2805
|
+
* Response containing the exit status of a terminal command.
|
|
2806
|
+
*/
|
|
2807
|
+
export type WaitForTerminalExitResponse = {
|
|
2808
|
+
/**
|
|
2809
|
+
* The _meta property is reserved by ACP to allow clients and agents to attach additional
|
|
2810
|
+
* metadata to their interactions. Implementations MUST NOT make assumptions about values at
|
|
2811
|
+
* these keys.
|
|
2812
|
+
*
|
|
2813
|
+
* See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)
|
|
2814
|
+
*/
|
|
2815
|
+
_meta?: {
|
|
2816
|
+
[key: string]: unknown;
|
|
2817
|
+
} | null;
|
|
2818
|
+
/**
|
|
2819
|
+
* The process exit code (may be null if terminated by signal).
|
|
2820
|
+
*/
|
|
2821
|
+
exitCode?: number | null;
|
|
2822
|
+
/**
|
|
2823
|
+
* The signal that terminated the process (may be null if exited normally).
|
|
2824
|
+
*/
|
|
2825
|
+
signal?: string | null;
|
|
2826
|
+
};
|
|
2827
|
+
/**
|
|
2828
|
+
* Request to write content to a text file.
|
|
2829
|
+
*
|
|
2830
|
+
* Only available if the client supports the `fs.writeTextFile` capability.
|
|
2831
|
+
*/
|
|
2832
|
+
export type WriteTextFileRequest = {
|
|
2833
|
+
/**
|
|
2834
|
+
* The _meta property is reserved by ACP to allow clients and agents to attach additional
|
|
2835
|
+
* metadata to their interactions. Implementations MUST NOT make assumptions about values at
|
|
2836
|
+
* these keys.
|
|
2837
|
+
*
|
|
2838
|
+
* See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)
|
|
2839
|
+
*/
|
|
2840
|
+
_meta?: {
|
|
2841
|
+
[key: string]: unknown;
|
|
2842
|
+
} | null;
|
|
2843
|
+
/**
|
|
2844
|
+
* The text content to write to the file.
|
|
2845
|
+
*/
|
|
2846
|
+
content: string;
|
|
2847
|
+
/**
|
|
2848
|
+
* Absolute path to the file to write.
|
|
2849
|
+
*/
|
|
2850
|
+
path: string;
|
|
2851
|
+
/**
|
|
2852
|
+
* The session ID for this request.
|
|
2853
|
+
*/
|
|
2854
|
+
sessionId: SessionId;
|
|
2855
|
+
};
|
|
2856
|
+
/**
|
|
2857
|
+
* Response to `fs/write_text_file`
|
|
2858
|
+
*/
|
|
2859
|
+
export type WriteTextFileResponse = {
|
|
2860
|
+
/**
|
|
2861
|
+
* The _meta property is reserved by ACP to allow clients and agents to attach additional
|
|
2862
|
+
* metadata to their interactions. Implementations MUST NOT make assumptions about values at
|
|
2863
|
+
* these keys.
|
|
2864
|
+
*
|
|
2865
|
+
* See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)
|
|
2866
|
+
*/
|
|
2867
|
+
_meta?: {
|
|
2868
|
+
[key: string]: unknown;
|
|
2869
|
+
} | null;
|
|
2870
|
+
};
|