@agentconnect/sdk 0.2.7 → 0.2.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.ts CHANGED
@@ -18,6 +18,7 @@ export type ProviderInfo = {
18
18
  updateCommand?: string;
19
19
  updateMessage?: string;
20
20
  updateInProgress?: boolean;
21
+ supportsMcpServers?: boolean;
21
22
  };
22
23
  export type ReasoningEffortOption = {
23
24
  id: string;
@@ -52,6 +53,13 @@ export type ProviderDetail = {
52
53
  data?: Record<string, unknown>;
53
54
  raw?: unknown;
54
55
  };
56
+ export type McpServerConfig = {
57
+ command: string;
58
+ args?: string[];
59
+ env?: Record<string, string>;
60
+ cwd?: string;
61
+ enabled?: boolean;
62
+ };
55
63
  export type SessionEvent = {
56
64
  type: 'delta';
57
65
  text: string;
@@ -162,6 +170,7 @@ export type SessionCreateOptions = {
162
170
  topP?: number;
163
171
  providerDetailLevel?: ProviderDetailLevel;
164
172
  summary?: SummaryOptions;
173
+ mcpServers?: Record<string, McpServerConfig> | null;
165
174
  };
166
175
  export type SessionSendOptions = {
167
176
  metadata?: Record<string, unknown>;
@@ -169,6 +178,7 @@ export type SessionSendOptions = {
169
178
  repoRoot?: string;
170
179
  providerDetailLevel?: ProviderDetailLevel;
171
180
  summary?: SummaryOptions;
181
+ mcpServers?: Record<string, McpServerConfig> | null;
172
182
  };
173
183
  export type SessionResumeOptions = {
174
184
  model?: string;
@@ -179,6 +189,7 @@ export type SessionResumeOptions = {
179
189
  repoRoot?: string;
180
190
  providerDetailLevel?: ProviderDetailLevel;
181
191
  summary?: SummaryOptions;
192
+ mcpServers?: Record<string, McpServerConfig> | null;
182
193
  };
183
194
  export interface AgentConnectSession {
184
195
  id: string;
package/dist/index.js CHANGED
@@ -155,14 +155,24 @@ class AgentConnectSessionImpl {
155
155
  }
156
156
  async send(message, options) {
157
157
  const normalized = this.normalizeSendOptions(options);
158
- await this.client.request('acp.sessions.send', {
158
+ const payload = {
159
159
  sessionId: this.id,
160
160
  message: { role: 'user', content: message },
161
- metadata: normalized.metadata,
162
- cwd: normalized.cwd,
163
- repoRoot: normalized.repoRoot,
164
- providerDetailLevel: normalized.providerDetailLevel,
165
- });
161
+ };
162
+ if (normalized.metadata !== undefined)
163
+ payload.metadata = normalized.metadata;
164
+ if (normalized.cwd !== undefined)
165
+ payload.cwd = normalized.cwd;
166
+ if (normalized.repoRoot !== undefined)
167
+ payload.repoRoot = normalized.repoRoot;
168
+ if (normalized.providerDetailLevel !== undefined) {
169
+ payload.providerDetailLevel = normalized.providerDetailLevel;
170
+ }
171
+ if (normalized.summary !== undefined)
172
+ payload.summary = normalized.summary;
173
+ if (normalized.mcpServers !== undefined)
174
+ payload.mcpServers = normalized.mcpServers;
175
+ await this.client.request('acp.sessions.send', payload);
166
176
  }
167
177
  async cancel() {
168
178
  await this.client.request('acp.sessions.cancel', { sessionId: this.id });
@@ -202,7 +212,8 @@ class AgentConnectSessionImpl {
202
212
  'cwd' in candidate ||
203
213
  'repoRoot' in candidate ||
204
214
  'providerDetailLevel' in candidate ||
205
- 'summary' in candidate) {
215
+ 'summary' in candidate ||
216
+ 'mcpServers' in candidate) {
206
217
  return candidate;
207
218
  }
208
219
  return { metadata: options };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@agentconnect/sdk",
3
- "version": "0.2.7",
3
+ "version": "0.2.9",
4
4
  "license": "MIT",
5
5
  "type": "module",
6
6
  "homepage": "https://github.com/rayzhudev/agent-connect",