@fairyhunter13/ai-anthropic 3.0.75-fork.4 → 3.0.75-fork.6
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 +61 -9
- package/dist/index.js +38 -2
- package/dist/index.js.map +1 -1
- package/dist/internal/index.d.ts +61 -9
- package/dist/internal/index.js +38 -2
- package/dist/internal/index.js.map +1 -1
- package/docs/05-anthropic.mdx +25 -5
- package/package.json +3 -3
- package/src/tool/bash_20241022.ts +77 -12
- package/src/tool/bash_20250124.ts +77 -12
package/dist/index.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { JSONObject, ProviderV4, LanguageModelV4, FilesV4, SkillsV4 } from '@ai-sdk/provider';
|
|
2
2
|
import { z } from 'zod/v4';
|
|
3
3
|
import * as _ai_sdk_provider_utils from '@ai-sdk/provider-utils';
|
|
4
|
-
import { FetchFunction } from '@ai-sdk/provider-utils';
|
|
4
|
+
import { ToolExecuteFunction, Tool, Sandbox, ProviderDefinedTool, FetchFunction } from '@ai-sdk/provider-utils';
|
|
5
5
|
|
|
6
6
|
/**
|
|
7
7
|
* Represents a single iteration in the usage breakdown.
|
|
@@ -250,6 +250,64 @@ interface AnthropicToolOptions {
|
|
|
250
250
|
eagerInputStreaming?: boolean;
|
|
251
251
|
}
|
|
252
252
|
|
|
253
|
+
type Bash20241022Input = {
|
|
254
|
+
/**
|
|
255
|
+
* The bash command to run. Required unless the tool is being restarted.
|
|
256
|
+
*/
|
|
257
|
+
command: string;
|
|
258
|
+
/**
|
|
259
|
+
* Specifying true will restart this tool. Otherwise, leave this unspecified.
|
|
260
|
+
*/
|
|
261
|
+
restart?: boolean;
|
|
262
|
+
};
|
|
263
|
+
type Bash20241022Options<OUTPUT> = {
|
|
264
|
+
execute?: ToolExecuteFunction<Bash20241022Input, OUTPUT, {}>;
|
|
265
|
+
needsApproval?: Tool<Bash20241022Input, OUTPUT, {}>['needsApproval'];
|
|
266
|
+
toModelOutput?: Tool<Bash20241022Input, OUTPUT, {}>['toModelOutput'];
|
|
267
|
+
onInputStart?: Tool<Bash20241022Input, OUTPUT, {}>['onInputStart'];
|
|
268
|
+
onInputDelta?: Tool<Bash20241022Input, OUTPUT, {}>['onInputDelta'];
|
|
269
|
+
onInputAvailable?: Tool<Bash20241022Input, OUTPUT, {}>['onInputAvailable'];
|
|
270
|
+
};
|
|
271
|
+
type Bash20241022DefaultOutput = Awaited<ReturnType<Sandbox['executeCommand']>>;
|
|
272
|
+
declare function bash_20241022(options?: Omit<Bash20241022Options<Bash20241022DefaultOutput>, 'execute'> & {
|
|
273
|
+
execute?: undefined;
|
|
274
|
+
}): ProviderDefinedTool<Bash20241022Input, Bash20241022DefaultOutput, {}>;
|
|
275
|
+
declare function bash_20241022<OUTPUT = never>(options: Omit<Bash20241022Options<OUTPUT>, 'execute'> & {
|
|
276
|
+
execute: null;
|
|
277
|
+
}): ProviderDefinedTool<Bash20241022Input, OUTPUT, {}>;
|
|
278
|
+
declare function bash_20241022<OUTPUT>(options: Omit<Bash20241022Options<OUTPUT>, 'execute'> & {
|
|
279
|
+
execute: Bash20241022Options<OUTPUT>['execute'];
|
|
280
|
+
}): ProviderDefinedTool<Bash20241022Input, OUTPUT, {}>;
|
|
281
|
+
|
|
282
|
+
type Bash20250124Input = {
|
|
283
|
+
/**
|
|
284
|
+
* The bash command to run. Required unless the tool is being restarted.
|
|
285
|
+
*/
|
|
286
|
+
command: string;
|
|
287
|
+
/**
|
|
288
|
+
* Specifying true will restart this tool. Otherwise, leave this unspecified.
|
|
289
|
+
*/
|
|
290
|
+
restart?: boolean;
|
|
291
|
+
};
|
|
292
|
+
type Bash20250124Options<OUTPUT> = {
|
|
293
|
+
execute?: ToolExecuteFunction<Bash20250124Input, OUTPUT, {}>;
|
|
294
|
+
needsApproval?: Tool<Bash20250124Input, OUTPUT, {}>['needsApproval'];
|
|
295
|
+
toModelOutput?: Tool<Bash20250124Input, OUTPUT, {}>['toModelOutput'];
|
|
296
|
+
onInputStart?: Tool<Bash20250124Input, OUTPUT, {}>['onInputStart'];
|
|
297
|
+
onInputDelta?: Tool<Bash20250124Input, OUTPUT, {}>['onInputDelta'];
|
|
298
|
+
onInputAvailable?: Tool<Bash20250124Input, OUTPUT, {}>['onInputAvailable'];
|
|
299
|
+
};
|
|
300
|
+
type Bash20250124DefaultOutput = Awaited<ReturnType<Sandbox['executeCommand']>>;
|
|
301
|
+
declare function bash_20250124(options?: Omit<Bash20250124Options<Bash20250124DefaultOutput>, 'execute'> & {
|
|
302
|
+
execute?: undefined;
|
|
303
|
+
}): ProviderDefinedTool<Bash20250124Input, Bash20250124DefaultOutput, {}>;
|
|
304
|
+
declare function bash_20250124<OUTPUT = never>(options: Omit<Bash20250124Options<OUTPUT>, 'execute'> & {
|
|
305
|
+
execute: null;
|
|
306
|
+
}): ProviderDefinedTool<Bash20250124Input, OUTPUT, {}>;
|
|
307
|
+
declare function bash_20250124<OUTPUT>(options: Omit<Bash20250124Options<OUTPUT>, 'execute'> & {
|
|
308
|
+
execute: Bash20250124Options<OUTPUT>['execute'];
|
|
309
|
+
}): ProviderDefinedTool<Bash20250124Input, OUTPUT, {}>;
|
|
310
|
+
|
|
253
311
|
declare const anthropicTools: {
|
|
254
312
|
/**
|
|
255
313
|
* The bash tool enables Claude to execute shell commands in a persistent bash session,
|
|
@@ -257,20 +315,14 @@ declare const anthropicTools: {
|
|
|
257
315
|
*
|
|
258
316
|
* Image results are supported.
|
|
259
317
|
*/
|
|
260
|
-
bash_20241022:
|
|
261
|
-
command: string;
|
|
262
|
-
restart?: boolean;
|
|
263
|
-
}, {}, {}>;
|
|
318
|
+
bash_20241022: typeof bash_20241022;
|
|
264
319
|
/**
|
|
265
320
|
* The bash tool enables Claude to execute shell commands in a persistent bash session,
|
|
266
321
|
* allowing system operations, script execution, and command-line automation.
|
|
267
322
|
*
|
|
268
323
|
* Image results are supported.
|
|
269
324
|
*/
|
|
270
|
-
bash_20250124:
|
|
271
|
-
command: string;
|
|
272
|
-
restart?: boolean;
|
|
273
|
-
}, {}, {}>;
|
|
325
|
+
bash_20250124: typeof bash_20250124;
|
|
274
326
|
/**
|
|
275
327
|
* Claude can analyze data, create visualizations, perform complex calculations,
|
|
276
328
|
* run system commands, create and edit files, and process uploaded files directly within
|
package/dist/index.js
CHANGED
|
@@ -5276,10 +5276,28 @@ var bash_20241022InputSchema = lazySchema14(
|
|
|
5276
5276
|
})
|
|
5277
5277
|
)
|
|
5278
5278
|
);
|
|
5279
|
-
var
|
|
5279
|
+
var bash_20241022_internal = createProviderDefinedToolFactory2({
|
|
5280
5280
|
id: "anthropic.bash_20241022",
|
|
5281
5281
|
inputSchema: bash_20241022InputSchema
|
|
5282
5282
|
});
|
|
5283
|
+
function bash_20241022(options = {}) {
|
|
5284
|
+
const { execute, ...rest } = options;
|
|
5285
|
+
if (execute === void 0) {
|
|
5286
|
+
return bash_20241022_internal({
|
|
5287
|
+
...rest,
|
|
5288
|
+
execute: async ({ command }, { sandbox }) => {
|
|
5289
|
+
if (!sandbox) {
|
|
5290
|
+
throw new Error("Sandbox is not available");
|
|
5291
|
+
}
|
|
5292
|
+
return await sandbox.executeCommand({ command });
|
|
5293
|
+
}
|
|
5294
|
+
});
|
|
5295
|
+
}
|
|
5296
|
+
return bash_20241022_internal({
|
|
5297
|
+
...rest,
|
|
5298
|
+
...execute === null ? {} : { execute }
|
|
5299
|
+
});
|
|
5300
|
+
}
|
|
5283
5301
|
|
|
5284
5302
|
// src/tool/bash_20250124.ts
|
|
5285
5303
|
import {
|
|
@@ -5296,10 +5314,28 @@ var bash_20250124InputSchema = lazySchema15(
|
|
|
5296
5314
|
})
|
|
5297
5315
|
)
|
|
5298
5316
|
);
|
|
5299
|
-
var
|
|
5317
|
+
var bash_20250124_internal = createProviderDefinedToolFactory3({
|
|
5300
5318
|
id: "anthropic.bash_20250124",
|
|
5301
5319
|
inputSchema: bash_20250124InputSchema
|
|
5302
5320
|
});
|
|
5321
|
+
function bash_20250124(options = {}) {
|
|
5322
|
+
const { execute, ...rest } = options;
|
|
5323
|
+
if (execute === void 0) {
|
|
5324
|
+
return bash_20250124_internal({
|
|
5325
|
+
...rest,
|
|
5326
|
+
execute: async ({ command }, { sandbox }) => {
|
|
5327
|
+
if (!sandbox) {
|
|
5328
|
+
throw new Error("Sandbox is not available");
|
|
5329
|
+
}
|
|
5330
|
+
return await sandbox.executeCommand({ command });
|
|
5331
|
+
}
|
|
5332
|
+
});
|
|
5333
|
+
}
|
|
5334
|
+
return bash_20250124_internal({
|
|
5335
|
+
...rest,
|
|
5336
|
+
...execute === null ? {} : { execute }
|
|
5337
|
+
});
|
|
5338
|
+
}
|
|
5303
5339
|
|
|
5304
5340
|
// src/tool/computer_20241022.ts
|
|
5305
5341
|
import {
|