@ai-sdk/harness-acp 1.0.30 → 1.0.32

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.
@@ -1,39 +1,12 @@
1
1
  import { createHash } from 'node:crypto';
2
2
  import path from 'node:path';
3
3
  import type { HarnessV1Skill } from '@ai-sdk/harness';
4
- import { writeSkills } from '@ai-sdk/harness/utils';
4
+ import { writeSkills, type WriteSkillsResult } from '@ai-sdk/harness/utils';
5
5
  import type { Experimental_SandboxSession } from '@ai-sdk/provider-utils';
6
6
 
7
7
  const ACP_SKILL_NAME_PATTERN = /^[a-z0-9]+(?:-[a-z0-9]+)*$/;
8
8
  export const DEFAULT_ACP_SKILLS_DIRECTORY = '.agents/skills';
9
9
 
10
- export function createACPSkillsFingerprint({
11
- skills,
12
- }: {
13
- skills: ReadonlyArray<HarnessV1Skill>;
14
- }): string {
15
- const canonicalSkills = skills
16
- .map(skill => ({
17
- name: skill.name,
18
- description: skill.description,
19
- content: skill.content,
20
- files: [...(skill.files ?? [])]
21
- .map(file => ({
22
- path: path.posix.normalize(file.path),
23
- content: file.content,
24
- }))
25
- .sort((left, right) =>
26
- compareCanonicalStrings({ left: left.path, right: right.path }),
27
- ),
28
- }))
29
- .sort((left, right) =>
30
- compareCanonicalStrings({ left: left.name, right: right.name }),
31
- );
32
- return createHash('sha256')
33
- .update(JSON.stringify(canonicalSkills))
34
- .digest('hex');
35
- }
36
-
37
10
  export function resolveACPPrivateSessionDirectory({
38
11
  sandboxHomeDir,
39
12
  sessionWorkDir,
@@ -62,34 +35,30 @@ export async function materializeACPSkills({
62
35
  rootDir,
63
36
  sessionWorkDir,
64
37
  skills,
65
- shouldMaterialize,
66
38
  abortSignal,
67
39
  }: {
68
40
  sandbox: Experimental_SandboxSession;
69
41
  rootDir: string;
70
42
  sessionWorkDir: string;
71
43
  skills: ReadonlyArray<HarnessV1Skill>;
72
- shouldMaterialize: boolean;
73
44
  abortSignal?: AbortSignal;
74
- }): Promise<void> {
45
+ }): Promise<WriteSkillsResult> {
75
46
  validateACPSkills({ skills });
76
47
  assertOutsideSessionWorkDir({ rootDir, sessionWorkDir });
77
48
 
78
- if (shouldMaterialize) {
79
- await writeSkills({
80
- sandbox,
81
- rootDir,
82
- skills,
83
- abortSignal,
84
- skillNamePattern: ACP_SKILL_NAME_PATTERN,
85
- invalidSkillNameMessage: ({ name }) =>
86
- `Invalid ACP skill name ${JSON.stringify(name)}: expected a kebab-case slug.`,
87
- invalidSkillFilePathMessage: ({ skillName, filePath }) =>
88
- `Invalid ACP skill file path ${JSON.stringify(filePath)} for skill ${JSON.stringify(
89
- skillName,
90
- )}: expected a relative POSIX path without traversal.`,
91
- });
92
- }
49
+ return writeSkills({
50
+ sandbox,
51
+ rootDir,
52
+ skills,
53
+ abortSignal,
54
+ skillNamePattern: ACP_SKILL_NAME_PATTERN,
55
+ invalidSkillNameMessage: ({ name }) =>
56
+ `Invalid ACP skill name ${JSON.stringify(name)}: expected a kebab-case slug.`,
57
+ invalidSkillFilePathMessage: ({ skillName, filePath }) =>
58
+ `Invalid ACP skill file path ${JSON.stringify(filePath)} for skill ${JSON.stringify(
59
+ skillName,
60
+ )}: expected a relative POSIX path without traversal.`,
61
+ });
93
62
  }
94
63
 
95
64
  export function resolveACPSkillsDirectory({
@@ -225,13 +194,3 @@ function assertOutsideSessionWorkDir({
225
194
  );
226
195
  }
227
196
  }
228
-
229
- function compareCanonicalStrings({
230
- left,
231
- right,
232
- }: {
233
- left: string;
234
- right: string;
235
- }): number {
236
- return left < right ? -1 : left > right ? 1 : 0;
237
- }
@@ -11,6 +11,7 @@ import {
11
11
  import type { ACPTextContentBlock } from './acp-v1-prompt';
12
12
  import type {
13
13
  ACPInstructionMapping,
14
+ ACPModelMapping,
14
15
  ACPOutputSchemaMapping,
15
16
  ACPPermissionModeMapping,
16
17
  ACPSerializableValue,
@@ -29,6 +30,8 @@ export function createACPTurnStartConfig({
29
30
  instructionMapping,
30
31
  responseFormat,
31
32
  outputSchemaMapping,
33
+ model,
34
+ modelMapping,
32
35
  }: {
33
36
  prompt: ReadonlyArray<ACPTextContentBlock>;
34
37
  tools: ReadonlyArray<HarnessV1ToolSpec>;
@@ -42,6 +45,8 @@ export function createACPTurnStartConfig({
42
45
  instructionMapping: ACPInstructionMapping | undefined;
43
46
  responseFormat: StartMessage['responseFormat'];
44
47
  outputSchemaMapping: ACPOutputSchemaMapping | undefined;
48
+ model: string | undefined;
49
+ modelMapping: ACPModelMapping;
45
50
  }): ACPTurnStartConfig {
46
51
  return {
47
52
  version: 1,
@@ -52,6 +57,7 @@ export function createACPTurnStartConfig({
52
57
  sessionMeta: sessionMeta ?? null,
53
58
  ...(instructionMapping == null ? {} : { instructionMapping }),
54
59
  ...(outputSchemaMapping == null ? {} : { outputSchemaMapping }),
60
+ modelMapping,
55
61
  builtinTools,
56
62
  permissionModeMapping: permissionModeMapping ?? null,
57
63
  mcpServers: mcpServers ?? null,
@@ -62,6 +68,7 @@ export function createACPTurnStartConfig({
62
68
  tools: tools.map(tool => acpSerializableToolSpecSchema.parse(tool)),
63
69
  builtinTools: [...builtinTools],
64
70
  permissionMode,
71
+ ...(model == null ? {} : { model, modelMapping }),
65
72
  ...(responseFormat == null ? {} : { responseFormat }),
66
73
  ...(outputSchemaMapping == null
67
74
  ? {}
@@ -78,10 +85,8 @@ export function createACPTurnStartConfig({
78
85
 
79
86
  export function createACPColdSessionState({
80
87
  turnStartConfig,
81
- modelId,
82
88
  }: {
83
89
  turnStartConfig: ACPTurnStartConfig;
84
- modelId: string | undefined;
85
90
  }): ACPColdSessionState {
86
91
  return {
87
92
  version: turnStartConfig.version,
@@ -98,7 +103,6 @@ export function createACPColdSessionState({
98
103
  ...(turnStartConfig.permissionModeMapping == null
99
104
  ? {}
100
105
  : { permissionModeMapping: turnStartConfig.permissionModeMapping }),
101
- ...(modelId == null ? {} : { modelId }),
102
106
  };
103
107
  }
104
108
 
@@ -59,6 +59,7 @@ export type ACPBridgeConfiguration = {
59
59
  readonly providerAuthentication?: ACPResolvedProviderAuthentication;
60
60
  readonly providerEnvironment?: Readonly<Record<string, string>>;
61
61
  readonly sessionMeta?: Readonly<Record<string, ACPSerializableValue>>;
62
+ readonly clientCapabilities?: Readonly<Record<string, ACPSerializableValue>>;
62
63
  };
63
64
 
64
65
  const bridgeConfigurationSchema: z.ZodType<ACPBridgeConfiguration> = z.object({
@@ -66,6 +67,7 @@ const bridgeConfigurationSchema: z.ZodType<ACPBridgeConfiguration> = z.object({
66
67
  providerAuthentication: providerAuthenticationSchema.optional(),
67
68
  providerEnvironment: z.record(z.string(), z.string()).optional(),
68
69
  sessionMeta: serializableRecordSchema.optional(),
70
+ clientCapabilities: serializableRecordSchema.optional(),
69
71
  });
70
72
 
71
73
  export function createACPBridgeEnvironment({
@@ -73,6 +75,7 @@ export function createACPBridgeEnvironment({
73
75
  providerAuthentication,
74
76
  providerEnvironment,
75
77
  sessionMeta,
78
+ clientCapabilities,
76
79
  }: ACPBridgeConfiguration): Record<string, string> {
77
80
  return {
78
81
  [ACP_BRIDGE_CONFIGURATION_ENV]: JSON.stringify({
@@ -80,6 +83,7 @@ export function createACPBridgeEnvironment({
80
83
  ...(providerAuthentication == null ? {} : { providerAuthentication }),
81
84
  ...(providerEnvironment == null ? {} : { providerEnvironment }),
82
85
  ...(sessionMeta == null ? {} : { sessionMeta }),
86
+ ...(clientCapabilities == null ? {} : { clientCapabilities }),
83
87
  }),
84
88
  };
85
89
  }
@@ -44,6 +44,7 @@ import {
44
44
  } from './refresh-host-tool-catalog';
45
45
  import { createACPPermissionController } from './permission-controller';
46
46
  import { configureACPPermissionMode } from './permission-mode';
47
+ import { configureACPModel } from './model-mapping';
47
48
  import {
48
49
  assertACPResumeCapability,
49
50
  createACPRecoveredSession,
@@ -214,6 +215,13 @@ async function runTurn(start: StartMessage, turn: BridgeTurn): Promise<void> {
214
215
  return;
215
216
  }
216
217
 
218
+ await configureACPModel({
219
+ agent: connection!.agent,
220
+ sessionId: activeSession.sessionId,
221
+ model: start.model,
222
+ mapping: start.modelMapping,
223
+ });
224
+
217
225
  let rejectCancellationFailure!: (error: unknown) => void;
218
226
  const cancellationFailure = new Promise<never>((_, reject) => {
219
227
  rejectCancellationFailure = reject;
@@ -413,11 +421,13 @@ async function ensureSession({
413
421
  instructions: start.instructions,
414
422
  instructionMapping: start.instructionMapping,
415
423
  sessionMeta: bridgeConfiguration.sessionMeta,
416
- environment: createChildEnvironment({
417
- launchEnv,
418
- implementationDir,
419
- privateHome: implementation.privateHome,
420
- }),
424
+ environment: {
425
+ ...createChildEnvironment({
426
+ launchEnv,
427
+ implementationDir,
428
+ privateHome: implementation.privateHome,
429
+ }),
430
+ },
421
431
  });
422
432
  child = spawn(
423
433
  `${implementationDir}/${implementation.executablePath}`,
@@ -472,6 +482,7 @@ async function ensureSession({
472
482
  protocolVersion: acp.PROTOCOL_VERSION,
473
483
  clientApp,
474
484
  authentication,
485
+ clientCapabilities: bridgeConfiguration.clientCapabilities,
475
486
  supportsBooleanSessionConfigOptions: Object.values(
476
487
  start.permissionModeMapping ?? {},
477
488
  ).some(
@@ -0,0 +1,35 @@
1
+ import * as acp from '@agentclientprotocol/sdk';
2
+ import type { ACPModelMapping } from '../acp-v1-settings';
3
+
4
+ export async function configureACPModel({
5
+ agent,
6
+ sessionId,
7
+ model,
8
+ mapping,
9
+ }: {
10
+ agent: acp.ClientContext;
11
+ sessionId: string;
12
+ model: string | undefined;
13
+ mapping: ACPModelMapping | undefined;
14
+ }): Promise<void> {
15
+ if (model == null) return;
16
+ if (mapping == null) {
17
+ throw new Error('ACP model mapping is required when a model is set.');
18
+ }
19
+ /*
20
+ * Some ACP harnesses, including Grok Build, use the non-standard
21
+ * `session/set_model` convention.
22
+ */
23
+ if (mapping.type === 'session-model') {
24
+ await agent.request('session/set_model', {
25
+ sessionId,
26
+ [mapping.path]: model,
27
+ });
28
+ return;
29
+ }
30
+ await agent.request(acp.methods.agent.session.setConfigOption, {
31
+ sessionId,
32
+ configId: mapping.path,
33
+ value: model,
34
+ });
35
+ }
@@ -4,8 +4,8 @@
4
4
  "private": true,
5
5
  "type": "module",
6
6
  "dependencies": {
7
- "@agentclientprotocol/sdk": "1.2.1",
8
- "@modelcontextprotocol/sdk": "1.29.0",
7
+ "@agentclientprotocol/sdk": "1.4.0",
8
+ "@modelcontextprotocol/sdk": "1.30.0",
9
9
  "ws": "8.21.0",
10
10
  "zod": "4.4.3"
11
11
  }
@@ -9,11 +9,11 @@ importers:
9
9
  .:
10
10
  dependencies:
11
11
  '@agentclientprotocol/sdk':
12
- specifier: 1.2.1
13
- version: 1.2.1(zod@4.4.3)
12
+ specifier: 1.4.0
13
+ version: 1.4.0(zod@4.4.3)
14
14
  '@modelcontextprotocol/sdk':
15
- specifier: 1.29.0
16
- version: 1.29.0(zod@4.4.3)
15
+ specifier: 1.30.0
16
+ version: 1.30.0(zod@4.4.3)
17
17
  ws:
18
18
  specifier: 8.21.0
19
19
  version: 8.21.0
@@ -23,19 +23,19 @@ importers:
23
23
 
24
24
  packages:
25
25
 
26
- '@agentclientprotocol/sdk@1.2.1':
27
- resolution: {integrity: sha512-jwYUdOQR7tc+Zfch53VL4JJyUNK/46q03uUTYb+PjECsmnNl94XFXOfYLJ8RBpMNidXd1rpOAVgb0vqD98xImA==}
26
+ '@agentclientprotocol/sdk@1.4.0':
27
+ resolution: {integrity: sha512-/eufudw+aFY1LKLolT6yFE6UMmYRl7fMJ/DEONSIyR6wI3slHWITBsANRGqXEY8FRzqUxwh7QEaGiZHcJPVThg==}
28
28
  peerDependencies:
29
29
  zod: ^3.25.0 || ^4.0.0
30
30
 
31
- '@hono/node-server@1.19.14':
32
- resolution: {integrity: sha512-GwtvgtXxnWsucXvbQXkRgqksiH2Qed37H9xHZocE5sA3N8O8O8/8FA3uclQXxXVzc9XBZuEOMK7+r02FmSpHtw==}
33
- engines: {node: '>=18.14.1'}
31
+ '@hono/node-server@2.1.1':
32
+ resolution: {integrity: sha512-ELuehkj5VCBdgEw9zs+ivkKwyzzUCSQuE96YmiPvn1ECBoZCczbFXJLeEGMTYjphP6gydh4pHMqEYPVMYUVgQg==}
33
+ engines: {node: '>=20'}
34
34
  peerDependencies:
35
35
  hono: ^4
36
36
 
37
- '@modelcontextprotocol/sdk@1.29.0':
38
- resolution: {integrity: sha512-zo37mZA9hJWpULgkRpowewez1y6ML5GsXJPY8FI0tBBCd77HEvza4jDqRKOXgHNn867PVGCyTdzqpz0izu5ZjQ==}
37
+ '@modelcontextprotocol/sdk@1.30.0':
38
+ resolution: {integrity: sha512-xKd8OIzlqNzcqcNumGAa6g+PW2kjD5vrpcKOnfldAUPP3j7lnqMPwlTXQm8gF+UwH72z0lqaRbjr9hqGz0eITA==}
39
39
  engines: {node: '>=18'}
40
40
  peerDependencies:
41
41
  '@cfworker/json-schema': ^4.1.1
@@ -83,8 +83,8 @@ packages:
83
83
  resolution: {integrity: sha512-nTjqfcBFEipKdXCv4YDQWCfmcLZKm81ldF0pAopTvyrFGVbcR6P/VAAd5G7N+0tTr8QqiU0tFadD6FK4NtJwOA==}
84
84
  engines: {node: '>= 0.6'}
85
85
 
86
- content-type@2.0.0:
87
- resolution: {integrity: sha512-j/O/d7GcZCyNl7/hwZAb606rzqkyvaDctLmckbxLzHvFBzTJHuGEdodATcP3yIRoDrLHkIATJuvzbFlp/ki2cQ==}
86
+ content-type@2.1.0:
87
+ resolution: {integrity: sha512-mj7UPXE0jaqaOsukNZRUEfEi2AcL7C/vwmwcHV0O97eO1E1pxBZuyjlZrx5seTaNBg1U6+o35wpa35Qfcc+7ag==}
88
88
  engines: {node: '>=18'}
89
89
 
90
90
  cookie-signature@1.2.2:
@@ -146,16 +146,16 @@ packages:
146
146
  resolution: {integrity: sha512-aIL5Fx7mawVa300al2BnEE4iNvo1qETxLrPI/o05L7z6go7fCw1J6EQmbK4FmJ2AS7kgVF/KEZWufBfdClMcPg==}
147
147
  engines: {node: '>= 0.6'}
148
148
 
149
- eventsource-parser@3.1.0:
150
- resolution: {integrity: sha512-kJezFj9YFAMLeORyi7aCLxLbD5/qWMQnoMVlVPyHIll7lgRJCc3JVln9Vgl9nwQi0YkMnhdGTMNn7CkRRAptMg==}
149
+ eventsource-parser@3.1.1:
150
+ resolution: {integrity: sha512-EKN1vKAMcZ8MlYMpaNuxN6R9yakzH6uajHcHVTqWJzvu5pWw9DyhbP35HH8MVBQ+dZjAfDxk+A8NiR9KWaXiyQ==}
151
151
  engines: {node: '>=18.0.0'}
152
152
 
153
153
  eventsource@3.0.7:
154
154
  resolution: {integrity: sha512-CRT1WTyuQoD771GW56XEZFQ/ZoSfWid1alKGDYMmkt2yl8UXrVR4pspqWNEcqKvVIzg6PAltWjxcSSPrboA4iA==}
155
155
  engines: {node: '>=18.0.0'}
156
156
 
157
- express-rate-limit@8.6.0:
158
- resolution: {integrity: sha512-XKJXDsASUOo0LLtFwW5hCcQGH0N4WQc/Rn8/Pvoia+TJFOkkFPvrtW9lZOeeNcxQJspvOIERMwiRLsVFlhHEkA==}
157
+ express-rate-limit@8.6.2:
158
+ resolution: {integrity: sha512-YH4ru+eOJxQABscKFfRCy9R7x9QFGdezclVMwwgFFndzS2Xnm0uo6B0ABZsLhcpeptGv2qvuJVWlQr9gQZoC3A==}
159
159
  engines: {node: '>= 16'}
160
160
  peerDependencies:
161
161
  express: '>= 4.11'
@@ -167,8 +167,8 @@ packages:
167
167
  fast-deep-equal@3.1.3:
168
168
  resolution: {integrity: sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==}
169
169
 
170
- fast-uri@3.1.4:
171
- resolution: {integrity: sha512-8JnbkQ4juDyvYs4mgFGQqg4yCYtFDtUtmp2QIQq11ZZe5CFQ5wcqm1rqDgAh/QdMySuBnPzMUiJUNZG5N/AiQw==}
170
+ fast-uri@3.1.6:
171
+ resolution: {integrity: sha512-7Ical1vFEMr0onbVzEDIreM22I4khW+fzyQPwvAFWBp1iwdshSZRsL4jjRvPG9JP1uiqMHRto+YU6R2/CzDz5Q==}
172
172
 
173
173
  finalhandler@2.1.1:
174
174
  resolution: {integrity: sha512-S8KoZgRZN+a5rNwqTxlZZePjT/4cnm0ROV70LedRHZ0p8u9fRID0hJUZQpkKLzro8LfmC8sx23bY6tVNxv8pQA==}
@@ -205,8 +205,8 @@ packages:
205
205
  resolution: {integrity: sha512-T2UbfbBEF32wiepXIsMlTW9+dDYC6wMh/t/vYA4tuOMKqWz/n3vr1NFSxQiyP+zk2mXsoMA/i/7qV6LKut1t1A==}
206
206
  engines: {node: '>= 0.4'}
207
207
 
208
- hono@4.12.31:
209
- resolution: {integrity: sha512-zJIHFrl6bq3RDd2YusFNCDlM8qUprxKswyi/OPzPyzKDdyBXDqWx8bZlZ7R+saTdSTatUmb3O7K4SspGPaEOQg==}
208
+ hono@4.13.4:
209
+ resolution: {integrity: sha512-AGEwKIyRMHRv1t8Wjwa3LHxQ61X5CqrdFT+4BRNTpqS5aJNnpl5WLjADb7vFlJzI/8uK7T5QLVApCMQKNa3LgQ==}
210
210
  engines: {node: '>=16.9.0'}
211
211
 
212
212
  http-errors@2.0.1:
@@ -220,8 +220,8 @@ packages:
220
220
  inherits@2.0.4:
221
221
  resolution: {integrity: sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==}
222
222
 
223
- ip-address@10.2.0:
224
- resolution: {integrity: sha512-/+S6j4E9AHvW9SWMSEY9Xfy66O5PWvVEJ08O0y5JGyEKQpojb0K0GKpz/v5HJ/G0vi3D2sjGK78119oXZeE0qA==}
223
+ ip-address@10.5.0:
224
+ resolution: {integrity: sha512-R5SnVLJmgYYvf2F2ZgwSBnelz5G4q5AxIC277GDfUaNbrZKNANcBC7RHqYYePlszf4kBolVkJauG0ZjHHFh55g==}
225
225
  engines: {node: '>= 12'}
226
226
 
227
227
  ipaddr.js@1.9.1:
@@ -234,8 +234,8 @@ packages:
234
234
  isexe@2.0.0:
235
235
  resolution: {integrity: sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==}
236
236
 
237
- jose@6.2.4:
238
- resolution: {integrity: sha512-N8acGzVsQy6M/fjFcxtysNc4Q379TcM5dM/qKkNtsHFji88yANnXTr7BLeP75iPnFwBfQzM/jg2BZ9+HZrHCZA==}
237
+ jose@6.2.10:
238
+ resolution: {integrity: sha512-iiW7J9qRFlGxvCOIBDBDxFePQSn7ZMAnrYGhrrOo6siO/MIqwfyilLR27pkfDgUk+raLuzADS8A3S/KLBisc0g==}
239
239
 
240
240
  json-schema-traverse@1.0.0:
241
241
  resolution: {integrity: sha512-NM8/P9n3XjXhIZn1lLhkFaACTOURQXjWhV4BA/RnOv8xvgqtqpAX9IO4mRQxSx1Rlo4tqzeqb0sOlruaOy3dug==}
@@ -247,8 +247,8 @@ packages:
247
247
  resolution: {integrity: sha512-/IXtbwEk5HTPyEwyKX6hGkYXxM9nbj64B+ilVJnC/R6B0pH5G4V3b0pVbL7DBj4tkhBAppbQUlf6F6Xl9LHu1g==}
248
248
  engines: {node: '>= 0.4'}
249
249
 
250
- media-typer@1.1.0:
251
- resolution: {integrity: sha512-aisnrDP4GNe06UcKFnV5bfMNPBUw4jsLGaWwWfnH3v02GnBuXX2MCVn5RbrWo0j3pczUilYblq7fQ7Nw2t5XKw==}
250
+ media-typer@1.1.1:
251
+ resolution: {integrity: sha512-yz3xRaG20c6/BOzvYoDaGtPmGscs7YivItZEEqe6GbwNfHuxu9YNmvnEkMzKldAGY4/80pRcQRZSEnhquk9XuQ==}
252
252
  engines: {node: '>= 0.8'}
253
253
 
254
254
  merge-descriptors@2.0.0:
@@ -266,9 +266,9 @@ packages:
266
266
  ms@2.1.3:
267
267
  resolution: {integrity: sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==}
268
268
 
269
- negotiator@1.0.0:
270
- resolution: {integrity: sha512-8Ofs/AUQh8MaEcrlq5xOX0CQ9ypTF5dl78mjlMNfOK08fzpgTHQRQPBxcPlEtIw0yRpws+Zo/3r+5WRby7u3Gg==}
271
- engines: {node: '>= 0.6'}
269
+ negotiator@1.1.0:
270
+ resolution: {integrity: sha512-NMPBRMJgiQHjbd8phG3Vebdx4kZ1H121rbl5IkMqeOsahptB9BKo/d7oJ3zTXqTgagn2bWlNSXkh0QUGM31RYg==}
271
+ engines: {node: '>=18'}
272
272
 
273
273
  object-assign@4.1.1:
274
274
  resolution: {integrity: sha512-rJgTQnkUnH1sFw8yT6VSU3zD3sWmu6sZhIseY8VX+GRu3P6F7Fu+JNDoXfklElbLJSnc3FUQHVe4cU5hj+BcUg==}
@@ -412,28 +412,28 @@ packages:
412
412
 
413
413
  snapshots:
414
414
 
415
- '@agentclientprotocol/sdk@1.2.1(zod@4.4.3)':
415
+ '@agentclientprotocol/sdk@1.4.0(zod@4.4.3)':
416
416
  dependencies:
417
417
  zod: 4.4.3
418
418
 
419
- '@hono/node-server@1.19.14(hono@4.12.31)':
419
+ '@hono/node-server@2.1.1(hono@4.13.4)':
420
420
  dependencies:
421
- hono: 4.12.31
421
+ hono: 4.13.4
422
422
 
423
- '@modelcontextprotocol/sdk@1.29.0(zod@4.4.3)':
423
+ '@modelcontextprotocol/sdk@1.30.0(zod@4.4.3)':
424
424
  dependencies:
425
- '@hono/node-server': 1.19.14(hono@4.12.31)
425
+ '@hono/node-server': 2.1.1(hono@4.13.4)
426
426
  ajv: 8.20.0
427
427
  ajv-formats: 3.0.1(ajv@8.20.0)
428
428
  content-type: 1.0.5
429
429
  cors: 2.8.6
430
430
  cross-spawn: 7.0.6
431
431
  eventsource: 3.0.7
432
- eventsource-parser: 3.1.0
432
+ eventsource-parser: 3.1.1
433
433
  express: 5.2.1
434
- express-rate-limit: 8.6.0(express@5.2.1)
435
- hono: 4.12.31
436
- jose: 6.2.4
434
+ express-rate-limit: 8.6.2(express@5.2.1)
435
+ hono: 4.13.4
436
+ jose: 6.2.10
437
437
  json-schema-typed: 8.0.2
438
438
  pkce-challenge: 5.0.1
439
439
  raw-body: 3.0.2
@@ -445,7 +445,7 @@ snapshots:
445
445
  accepts@2.0.0:
446
446
  dependencies:
447
447
  mime-types: 3.0.2
448
- negotiator: 1.0.0
448
+ negotiator: 1.1.0
449
449
 
450
450
  ajv-formats@3.0.1(ajv@8.20.0):
451
451
  optionalDependencies:
@@ -454,14 +454,14 @@ snapshots:
454
454
  ajv@8.20.0:
455
455
  dependencies:
456
456
  fast-deep-equal: 3.1.3
457
- fast-uri: 3.1.4
457
+ fast-uri: 3.1.6
458
458
  json-schema-traverse: 1.0.0
459
459
  require-from-string: 2.0.2
460
460
 
461
461
  body-parser@2.3.0:
462
462
  dependencies:
463
463
  bytes: 3.1.2
464
- content-type: 2.0.0
464
+ content-type: 2.1.0
465
465
  debug: 4.4.3
466
466
  http-errors: 2.0.1
467
467
  iconv-lite: 0.7.3
@@ -488,7 +488,7 @@ snapshots:
488
488
 
489
489
  content-type@1.0.5: {}
490
490
 
491
- content-type@2.0.0: {}
491
+ content-type@2.1.0: {}
492
492
 
493
493
  cookie-signature@1.2.2: {}
494
494
 
@@ -533,17 +533,17 @@ snapshots:
533
533
 
534
534
  etag@1.8.1: {}
535
535
 
536
- eventsource-parser@3.1.0: {}
536
+ eventsource-parser@3.1.1: {}
537
537
 
538
538
  eventsource@3.0.7:
539
539
  dependencies:
540
- eventsource-parser: 3.1.0
540
+ eventsource-parser: 3.1.1
541
541
 
542
- express-rate-limit@8.6.0(express@5.2.1):
542
+ express-rate-limit@8.6.2(express@5.2.1):
543
543
  dependencies:
544
544
  debug: 4.4.3
545
545
  express: 5.2.1
546
- ip-address: 10.2.0
546
+ ip-address: 10.5.0
547
547
  transitivePeerDependencies:
548
548
  - supports-color
549
549
 
@@ -582,7 +582,7 @@ snapshots:
582
582
 
583
583
  fast-deep-equal@3.1.3: {}
584
584
 
585
- fast-uri@3.1.4: {}
585
+ fast-uri@3.1.6: {}
586
586
 
587
587
  finalhandler@2.1.1:
588
588
  dependencies:
@@ -627,7 +627,7 @@ snapshots:
627
627
  dependencies:
628
628
  function-bind: 1.1.2
629
629
 
630
- hono@4.12.31: {}
630
+ hono@4.13.4: {}
631
631
 
632
632
  http-errors@2.0.1:
633
633
  dependencies:
@@ -643,7 +643,7 @@ snapshots:
643
643
 
644
644
  inherits@2.0.4: {}
645
645
 
646
- ip-address@10.2.0: {}
646
+ ip-address@10.5.0: {}
647
647
 
648
648
  ipaddr.js@1.9.1: {}
649
649
 
@@ -651,7 +651,7 @@ snapshots:
651
651
 
652
652
  isexe@2.0.0: {}
653
653
 
654
- jose@6.2.4: {}
654
+ jose@6.2.10: {}
655
655
 
656
656
  json-schema-traverse@1.0.0: {}
657
657
 
@@ -659,7 +659,7 @@ snapshots:
659
659
 
660
660
  math-intrinsics@1.1.0: {}
661
661
 
662
- media-typer@1.1.0: {}
662
+ media-typer@1.1.1: {}
663
663
 
664
664
  merge-descriptors@2.0.0: {}
665
665
 
@@ -671,7 +671,9 @@ snapshots:
671
671
 
672
672
  ms@2.1.3: {}
673
673
 
674
- negotiator@1.0.0: {}
674
+ negotiator@1.1.0:
675
+ dependencies:
676
+ content-type: 2.1.0
675
677
 
676
678
  object-assign@4.1.1: {}
677
679
 
@@ -793,8 +795,8 @@ snapshots:
793
795
 
794
796
  type-is@2.1.0:
795
797
  dependencies:
796
- content-type: 2.0.0
797
- media-typer: 1.1.0
798
+ content-type: 2.1.0
799
+ media-typer: 1.1.1
798
800
  mime-types: 3.0.2
799
801
 
800
802
  unpipe@1.0.0: {}
@@ -16,11 +16,13 @@ export function createACPInitializeRequest({
16
16
  protocolVersion,
17
17
  clientApp,
18
18
  authentication,
19
+ clientCapabilities: configuredClientCapabilities,
19
20
  supportsBooleanSessionConfigOptions = false,
20
21
  }: {
21
22
  protocolVersion: number;
22
23
  clientApp: ACPClientApp;
23
24
  authentication: ACPAuthentication | undefined;
25
+ clientCapabilities?: Readonly<Record<string, unknown>>;
24
26
  supportsBooleanSessionConfigOptions?: boolean;
25
27
  }): {
26
28
  readonly protocolVersion: number;
@@ -30,8 +32,10 @@ export function createACPInitializeRequest({
30
32
  };
31
33
  readonly clientCapabilities: Readonly<Record<string, unknown>>;
32
34
  } {
33
- let clientCapabilities: Readonly<Record<string, unknown>> =
34
- authentication?.clientCapabilities ?? {};
35
+ let clientCapabilities = mergeRecords({
36
+ left: authentication?.clientCapabilities ?? {},
37
+ right: configuredClientCapabilities ?? {},
38
+ });
35
39
  if (supportsBooleanSessionConfigOptions) {
36
40
  clientCapabilities = mergeRecords({
37
41
  left: clientCapabilities,
@@ -4,8 +4,10 @@ import type {
4
4
  ACPProviderAuthenticationCompatibility,
5
5
  } from '../acp-auth';
6
6
  import type {
7
+ ACPModelMapping,
7
8
  ACPNpmSimpleSource,
8
9
  ACPPermissionModeMapping,
10
+ ACPSerializableValue,
9
11
  ACPSource,
10
12
  ACPV1Settings,
11
13
  } from './acp-v1-settings';
@@ -172,6 +174,8 @@ export function createImplementationIdentity({
172
174
  acpVersion,
173
175
  implementation,
174
176
  clientApp,
177
+ clientCapabilities,
178
+ modelMapping,
175
179
  providerAuthentication,
176
180
  permissionModeMapping,
177
181
  }: {
@@ -179,6 +183,8 @@ export function createImplementationIdentity({
179
183
  acpVersion: 'v1';
180
184
  implementation: ACPImplementation;
181
185
  clientApp: ACPClientApp;
186
+ clientCapabilities?: Readonly<Record<string, ACPSerializableValue>>;
187
+ modelMapping: ACPModelMapping;
182
188
  providerAuthentication: ACPProviderAuthenticationCompatibility | undefined;
183
189
  permissionModeMapping?: ACPPermissionModeMapping;
184
190
  }): string {
@@ -221,6 +227,8 @@ export function createImplementationIdentity({
221
227
  executable: implementation.executable,
222
228
  args: implementation.args ?? [],
223
229
  clientApp,
230
+ clientCapabilities: clientCapabilities ?? null,
231
+ modelMapping,
224
232
  environment: {
225
233
  forwarded: forwardedEnvironment,
226
234
  credential: credentialEnvironment,
package/src/v1/index.ts CHANGED
@@ -5,6 +5,7 @@ export type {
5
5
  ACPAuthenticationMode,
6
6
  ACPInstallCommandSource,
7
7
  ACPInstructionMapping,
8
+ ACPModelMapping,
8
9
  ACPNpmLockedSource,
9
10
  ACPNpmSimpleSource,
10
11
  ACPOutputSchemaMapping,