@ai-sdk/harness-acp 1.0.0 → 1.0.2

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
@@ -1,6 +1,104 @@
1
1
  import { HarnessV1PermissionMode, HarnessV1 } from '@ai-sdk/harness';
2
2
  import { ToolSet } from '@ai-sdk/provider-utils';
3
3
 
4
+ type ACPMetadata = Record<string, unknown>;
5
+ type ACPRole = 'assistant' | 'user';
6
+ type ACPAnnotations = {
7
+ audience?: Array<ACPRole> | null;
8
+ lastModified?: string | null;
9
+ priority?: number | null;
10
+ _meta?: ACPMetadata | null;
11
+ };
12
+ type ACPTextContent = {
13
+ annotations?: ACPAnnotations | null;
14
+ text: string;
15
+ _meta?: ACPMetadata | null;
16
+ };
17
+ type ACPImageContent = {
18
+ annotations?: ACPAnnotations | null;
19
+ data: string;
20
+ mimeType: string;
21
+ uri?: string | null;
22
+ _meta?: ACPMetadata | null;
23
+ };
24
+ type ACPAudioContent = {
25
+ annotations?: ACPAnnotations | null;
26
+ data: string;
27
+ mimeType: string;
28
+ _meta?: ACPMetadata | null;
29
+ };
30
+ type ACPResourceLink = {
31
+ annotations?: ACPAnnotations | null;
32
+ description?: string | null;
33
+ mimeType?: string | null;
34
+ name: string;
35
+ size?: number | null;
36
+ title?: string | null;
37
+ uri: string;
38
+ _meta?: ACPMetadata | null;
39
+ };
40
+ type ACPTextResourceContents = {
41
+ mimeType?: string | null;
42
+ text: string;
43
+ uri: string;
44
+ _meta?: ACPMetadata | null;
45
+ };
46
+ type ACPBlobResourceContents = {
47
+ blob: string;
48
+ mimeType?: string | null;
49
+ uri: string;
50
+ _meta?: ACPMetadata | null;
51
+ };
52
+ type ACPEmbeddedResource = {
53
+ annotations?: ACPAnnotations | null;
54
+ resource: ACPTextResourceContents | ACPBlobResourceContents;
55
+ _meta?: ACPMetadata | null;
56
+ };
57
+ type ACPContentBlock = (ACPTextContent & {
58
+ type: 'text';
59
+ }) | (ACPImageContent & {
60
+ type: 'image';
61
+ }) | (ACPAudioContent & {
62
+ type: 'audio';
63
+ }) | (ACPResourceLink & {
64
+ type: 'resource_link';
65
+ }) | (ACPEmbeddedResource & {
66
+ type: 'resource';
67
+ });
68
+ type ACPToolCallContent = {
69
+ type: 'content';
70
+ content: ACPContentBlock;
71
+ _meta?: ACPMetadata | null;
72
+ } | {
73
+ type: 'diff';
74
+ path: string;
75
+ oldText?: string | null;
76
+ newText: string;
77
+ _meta?: ACPMetadata | null;
78
+ } | {
79
+ type: 'terminal';
80
+ terminalId: string;
81
+ _meta?: ACPMetadata | null;
82
+ };
83
+ type ACPToolKind = 'read' | 'edit' | 'delete' | 'move' | 'search' | 'execute' | 'think' | 'fetch' | 'switch_mode' | 'other';
84
+ type ACPToolCallStatus = 'pending' | 'in_progress' | 'completed' | 'failed';
85
+ type ACPToolCallLocation = {
86
+ path: string;
87
+ line?: number | null;
88
+ _meta?: ACPMetadata | null;
89
+ };
90
+ type ACPToolCall = {
91
+ toolCallId: string;
92
+ title: string;
93
+ kind?: ACPToolKind;
94
+ status?: ACPToolCallStatus;
95
+ content?: Array<ACPToolCallContent>;
96
+ locations?: Array<ACPToolCallLocation>;
97
+ rawInput?: unknown;
98
+ rawOutput?: unknown;
99
+ _meta?: ACPMetadata | null;
100
+ };
101
+
4
102
  type ACPSerializablePrimitive = string | number | boolean | null;
5
103
  type ACPSerializableValue = ACPSerializablePrimitive | ReadonlyArray<ACPSerializableValue> | {
6
104
  readonly [key: string]: ACPSerializableValue;
@@ -14,28 +112,22 @@ type ACPValueSource = {
14
112
  type ACPProfileValue = ACPSerializablePrimitive | ACPValueSource | ReadonlyArray<ACPProfileValue> | {
15
113
  readonly [key: string]: ACPProfileValue;
16
114
  };
17
- type ACPNpmLaunchSettings = {
18
- readonly type: 'npm';
19
- readonly executable: string;
20
- readonly args?: ReadonlyArray<string>;
21
- readonly forwardEnv?: ReadonlyArray<string>;
115
+ type ACPNpmSimpleSource = {
116
+ readonly type: 'npm-simple';
117
+ readonly packageName: string;
22
118
  /**
23
- * Runtime environment values that are safe to persist in bootstrap and
24
- * lifecycle compatibility identity.
119
+ * Exact version to install. When omitted, the package's `latest` dist-tag is
120
+ * installed and no version takes part in the implementation identity, so a
121
+ * new upstream release does not invalidate existing lifecycle state.
25
122
  */
26
- readonly env?: Readonly<Record<string, string>>;
123
+ readonly packageVersion?: string;
27
124
  };
28
- type ACPSimpleNpmImplementation = ACPNpmLaunchSettings & {
29
- readonly mode: 'simple';
30
- readonly packageName: string;
31
- readonly version: string;
32
- };
33
- type ACPLockedNpmImplementation = ACPNpmLaunchSettings & {
34
- readonly mode: 'locked';
125
+ type ACPNpmLockedSource = {
126
+ readonly type: 'npm-locked';
35
127
  readonly packageJson: string;
36
128
  readonly pnpmLockYaml: string;
37
129
  };
38
- type ACPNpmImplementation = ACPSimpleNpmImplementation | ACPLockedNpmImplementation;
130
+ type ACPSource = ACPNpmSimpleSource | ACPNpmLockedSource;
39
131
  type ACPAuthentication = {
40
132
  readonly methodId: string;
41
133
  readonly meta?: Readonly<Record<string, ACPSerializableValue>>;
@@ -59,8 +151,18 @@ type ACPPermissionModeMapping = Readonly<Record<HarnessV1PermissionMode, ACPPerm
59
151
  type ACPV1Settings = {
60
152
  readonly version?: 'v1';
61
153
  readonly harnessId: string;
154
+ readonly mcpServers?: Record<string, unknown>;
155
+ readonly isMcpToolCall?: (toolCall: ACPToolCall) => boolean;
62
156
  readonly auth?: ACPProviderAuthenticationMode;
63
- readonly implementation: ACPNpmImplementation;
157
+ readonly source: ACPSource;
158
+ readonly executable: string;
159
+ readonly args?: ReadonlyArray<string>;
160
+ readonly forwardEnv?: ReadonlyArray<string>;
161
+ /**
162
+ * Runtime environment values that are safe to persist in bootstrap and
163
+ * lifecycle compatibility identity.
164
+ */
165
+ readonly env?: Readonly<Record<string, string>>;
64
166
  readonly authentication?: ACPAuthentication;
65
167
  readonly providerAuthentication?: ACPProviderAuthentication;
66
168
  readonly modelId?: string;
@@ -68,6 +170,11 @@ type ACPV1Settings = {
68
170
  readonly session?: {
69
171
  readonly meta?: Readonly<Record<string, ACPSerializableValue>>;
70
172
  };
173
+ /**
174
+ * Creates the authentication token used by the sandbox bridge. Defaults to
175
+ * a random 32-byte hexadecimal token.
176
+ */
177
+ readonly mintBridgeToken?: (sandboxId: string) => string;
71
178
  };
72
179
 
73
180
  type ACPAuthOptions = ACPProviderAuthenticationMode;
@@ -78,21 +185,32 @@ type ACPClientApp = {
78
185
 
79
186
  type ACPHarnessSettings<TBuiltinTools extends ToolSet = {}> = {
80
187
  readonly builtinTools?: TBuiltinTools;
188
+ /**
189
+ * MCP server definitions keyed by server name. Each definition uses the
190
+ * underlying runtime's native MCP server configuration format.
191
+ */
192
+ readonly mcpServers?: Record<string, unknown>;
193
+ readonly isMcpToolCall?: (toolCall: ACPToolCall) => boolean;
81
194
  readonly port?: number;
82
195
  readonly startupTimeoutMs?: number;
83
196
  readonly clientApp?: ACPClientApp;
84
197
  readonly version?: ACPV1Settings['version'];
85
198
  readonly harnessId: ACPV1Settings['harnessId'];
86
199
  readonly auth?: ACPV1Settings['auth'];
87
- readonly implementation: ACPV1Settings['implementation'];
200
+ readonly source: ACPV1Settings['source'];
201
+ readonly executable: ACPV1Settings['executable'];
202
+ readonly args?: ACPV1Settings['args'];
203
+ readonly forwardEnv?: ACPV1Settings['forwardEnv'];
204
+ readonly env?: ACPV1Settings['env'];
88
205
  readonly authentication?: ACPV1Settings['authentication'];
89
206
  readonly providerAuthentication?: ACPV1Settings['providerAuthentication'];
90
207
  readonly modelId?: ACPV1Settings['modelId'];
91
208
  readonly permissionModeMapping?: ACPV1Settings['permissionModeMapping'];
92
209
  readonly session?: ACPV1Settings['session'];
210
+ readonly mintBridgeToken?: ACPV1Settings['mintBridgeToken'];
93
211
  };
94
212
  declare function createACP<TBuiltinTools extends ToolSet = {}>(settings: ACPHarnessSettings<TBuiltinTools>): HarnessV1<TBuiltinTools>;
95
213
 
96
214
  declare const VERSION: string;
97
215
 
98
- export { type ACPAuthOptions, type ACPAuthentication, type ACPClientApp, type ACPHarnessSettings, type ACPLockedNpmImplementation, type ACPNpmImplementation, type ACPPermissionModeMapping, type ACPPermissionModeTarget, type ACPProfileValue, type ACPProviderAuthentication, type ACPProviderAuthenticationMode, type ACPSerializablePrimitive, type ACPSerializableValue, type ACPSimpleNpmImplementation, type ACPV1Settings, type ACPValueSource, VERSION, createACP };
216
+ export { type ACPAnnotations, type ACPAudioContent, type ACPAuthOptions, type ACPAuthentication, type ACPBlobResourceContents, type ACPClientApp, type ACPContentBlock, type ACPEmbeddedResource, type ACPHarnessSettings, type ACPImageContent, type ACPMetadata, type ACPNpmLockedSource, type ACPNpmSimpleSource, type ACPPermissionModeMapping, type ACPPermissionModeTarget, type ACPProfileValue, type ACPProviderAuthentication, type ACPProviderAuthenticationMode, type ACPResourceLink, type ACPRole, type ACPSerializablePrimitive, type ACPSerializableValue, type ACPSource, type ACPTextContent, type ACPTextResourceContents, type ACPToolCall, type ACPToolCallContent, type ACPToolCallLocation, type ACPToolCallStatus, type ACPToolKind, type ACPV1Settings, type ACPValueSource, VERSION, createACP };