agentool 0.0.1 → 1.1.0
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 +738 -52
- package/dist/ask-user/index.cjs +8 -0
- package/dist/ask-user/index.d.cts +68 -0
- package/dist/ask-user/index.d.ts +68 -0
- package/dist/ask-user/index.js +8 -0
- package/dist/bash/index.cjs +8 -0
- package/dist/bash/index.d.cts +63 -0
- package/dist/bash/index.d.ts +63 -0
- package/dist/bash/index.js +8 -0
- package/dist/chunk-3EPGFWZV.cjs +30 -0
- package/dist/chunk-3VO6NETR.cjs +79 -0
- package/dist/chunk-44AFQ2B7.js +30 -0
- package/dist/chunk-4HIATLKI.js +112 -0
- package/dist/chunk-4HXAKPQH.cjs +36 -0
- package/dist/chunk-4YI2H55A.js +142 -0
- package/dist/chunk-56CL4JCW.cjs +53 -0
- package/dist/chunk-5NW4OGRI.cjs +99 -0
- package/dist/chunk-5O55DKOB.cjs +112 -0
- package/dist/chunk-5TDZF4IM.cjs +197 -0
- package/dist/chunk-6DJSWTWQ.cjs +40 -0
- package/dist/chunk-6PQLFDGT.js +117 -0
- package/dist/chunk-ACGW44YT.js +47 -0
- package/dist/chunk-CAEVLIQB.cjs +117 -0
- package/dist/chunk-CGTPF6IS.js +90 -0
- package/dist/chunk-E6NBEYZD.js +51 -0
- package/dist/chunk-EA3YV7ZG.js +79 -0
- package/dist/chunk-ECYT46FP.js +40 -0
- package/dist/chunk-FV2R5FFQ.cjs +102 -0
- package/dist/chunk-FW3UJ622.cjs +59 -0
- package/dist/chunk-G3ITTPGX.js +99 -0
- package/dist/chunk-HDKXSKMO.js +30 -0
- package/dist/chunk-HNP7JDQC.cjs +159 -0
- package/dist/chunk-HNUL2CID.cjs +34 -0
- package/dist/chunk-HZAQRHBT.js +99 -0
- package/dist/chunk-I3ONDY7P.js +46 -0
- package/dist/chunk-I6KFFQPV.cjs +58 -0
- package/dist/chunk-IEX4NOVN.cjs +48 -0
- package/dist/chunk-IRRNYFI5.js +48 -0
- package/dist/chunk-K77GC2QI.js +59 -0
- package/dist/chunk-L5JH4I77.cjs +51 -0
- package/dist/chunk-LK6SQH2G.cjs +30 -0
- package/dist/chunk-LPV5CN2K.js +58 -0
- package/dist/chunk-LTE5NG4D.js +53 -0
- package/dist/chunk-MF7CJVIZ.js +40 -0
- package/dist/chunk-MIYA7TNR.cjs +123 -0
- package/dist/chunk-MJCAXASI.js +123 -0
- package/dist/chunk-OM2UFTGS.cjs +47 -0
- package/dist/chunk-ONBH74ZV.cjs +90 -0
- package/dist/chunk-OXLQ7QVL.cjs +40 -0
- package/dist/chunk-P6Z5XFDS.js +73 -0
- package/dist/chunk-QZ5GS6HW.cjs +46 -0
- package/dist/chunk-S7IVHOA6.js +75 -0
- package/dist/chunk-SUSAPI5W.cjs +142 -0
- package/dist/chunk-TMW3XKKJ.js +34 -0
- package/dist/chunk-UDIG7332.js +159 -0
- package/dist/chunk-VLNDEVKS.js +102 -0
- package/dist/chunk-VXZ4RKJI.js +36 -0
- package/dist/chunk-XAQGZ374.js +197 -0
- package/dist/chunk-YPPPGGLA.cjs +99 -0
- package/dist/chunk-ZBLQV6UO.cjs +73 -0
- package/dist/chunk-ZFQZWXOI.cjs +75 -0
- package/dist/context-compaction/index.cjs +8 -0
- package/dist/context-compaction/index.d.cts +77 -0
- package/dist/context-compaction/index.d.ts +77 -0
- package/dist/context-compaction/index.js +8 -0
- package/dist/diff/index.cjs +9 -0
- package/dist/diff/index.d.cts +72 -0
- package/dist/diff/index.d.ts +72 -0
- package/dist/diff/index.js +9 -0
- package/dist/edit/index.cjs +10 -0
- package/dist/edit/index.d.cts +53 -0
- package/dist/edit/index.d.ts +53 -0
- package/dist/edit/index.js +10 -0
- package/dist/glob/index.cjs +10 -0
- package/dist/glob/index.d.cts +47 -0
- package/dist/glob/index.d.ts +47 -0
- package/dist/glob/index.js +10 -0
- package/dist/grep/index.cjs +10 -0
- package/dist/grep/index.d.cts +50 -0
- package/dist/grep/index.d.ts +50 -0
- package/dist/grep/index.js +10 -0
- package/dist/http-request/index.cjs +8 -0
- package/dist/http-request/index.d.cts +60 -0
- package/dist/http-request/index.d.ts +60 -0
- package/dist/http-request/index.js +8 -0
- package/dist/index.cjs +133 -0
- package/dist/index.d.cts +23 -0
- package/dist/index.d.ts +23 -0
- package/dist/index.js +133 -0
- package/dist/lsp/index.cjs +10 -0
- package/dist/lsp/index.d.cts +35 -0
- package/dist/lsp/index.d.ts +35 -0
- package/dist/lsp/index.js +10 -0
- package/dist/memory/index.cjs +9 -0
- package/dist/memory/index.d.cts +63 -0
- package/dist/memory/index.d.ts +63 -0
- package/dist/memory/index.js +9 -0
- package/dist/multi-edit/index.cjs +11 -0
- package/dist/multi-edit/index.d.cts +72 -0
- package/dist/multi-edit/index.d.ts +72 -0
- package/dist/multi-edit/index.js +11 -0
- package/dist/read/index.cjs +10 -0
- package/dist/read/index.d.cts +67 -0
- package/dist/read/index.d.ts +67 -0
- package/dist/read/index.js +10 -0
- package/dist/sleep/index.cjs +8 -0
- package/dist/sleep/index.d.cts +60 -0
- package/dist/sleep/index.d.ts +60 -0
- package/dist/sleep/index.js +8 -0
- package/dist/task-create/index.cjs +9 -0
- package/dist/task-create/index.d.cts +19 -0
- package/dist/task-create/index.d.ts +19 -0
- package/dist/task-create/index.js +9 -0
- package/dist/task-get/index.cjs +9 -0
- package/dist/task-get/index.d.cts +15 -0
- package/dist/task-get/index.d.ts +15 -0
- package/dist/task-get/index.js +9 -0
- package/dist/task-list/index.cjs +9 -0
- package/dist/task-list/index.d.cts +11 -0
- package/dist/task-list/index.d.ts +11 -0
- package/dist/task-list/index.js +9 -0
- package/dist/task-update/index.cjs +9 -0
- package/dist/task-update/index.d.cts +31 -0
- package/dist/task-update/index.d.ts +31 -0
- package/dist/task-update/index.js +9 -0
- package/dist/tool-search/index.cjs +8 -0
- package/dist/tool-search/index.d.cts +18 -0
- package/dist/tool-search/index.d.ts +18 -0
- package/dist/tool-search/index.js +8 -0
- package/dist/types-3QPDuCXN.d.cts +45 -0
- package/dist/types-3QPDuCXN.d.ts +45 -0
- package/dist/web-fetch/index.cjs +8 -0
- package/dist/web-fetch/index.d.cts +54 -0
- package/dist/web-fetch/index.d.ts +54 -0
- package/dist/web-fetch/index.js +8 -0
- package/dist/web-search/index.cjs +8 -0
- package/dist/web-search/index.d.cts +21 -0
- package/dist/web-search/index.d.ts +21 -0
- package/dist/web-search/index.js +8 -0
- package/dist/write/index.cjs +10 -0
- package/dist/write/index.d.cts +47 -0
- package/dist/write/index.d.ts +47 -0
- package/dist/write/index.js +10 -0
- package/package.json +170 -20
- package/dist/core/index.d.ts +0 -20
- package/dist/core/index.js +0 -1
- package/dist/core/index.js.map +0 -1
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import * as ai from 'ai';
|
|
2
|
+
import { B as BaseToolConfig } from '../types-3QPDuCXN.js';
|
|
3
|
+
|
|
4
|
+
interface TaskUpdateConfig extends BaseToolConfig {
|
|
5
|
+
/** Path to the tasks JSON file. Defaults to `<cwd>/.agentool/tasks.json`. */
|
|
6
|
+
tasksFile?: string;
|
|
7
|
+
}
|
|
8
|
+
declare function createTaskUpdate(config?: TaskUpdateConfig): ai.Tool<{
|
|
9
|
+
taskId: string;
|
|
10
|
+
status?: "pending" | "in_progress" | "completed" | "deleted" | undefined;
|
|
11
|
+
description?: string | undefined;
|
|
12
|
+
subject?: string | undefined;
|
|
13
|
+
metadata?: Record<string, unknown> | undefined;
|
|
14
|
+
owner?: string | undefined;
|
|
15
|
+
activeForm?: string | undefined;
|
|
16
|
+
addBlocks?: string[] | undefined;
|
|
17
|
+
addBlockedBy?: string[] | undefined;
|
|
18
|
+
}, string>;
|
|
19
|
+
declare const taskUpdate: ai.Tool<{
|
|
20
|
+
taskId: string;
|
|
21
|
+
status?: "pending" | "in_progress" | "completed" | "deleted" | undefined;
|
|
22
|
+
description?: string | undefined;
|
|
23
|
+
subject?: string | undefined;
|
|
24
|
+
metadata?: Record<string, unknown> | undefined;
|
|
25
|
+
owner?: string | undefined;
|
|
26
|
+
activeForm?: string | undefined;
|
|
27
|
+
addBlocks?: string[] | undefined;
|
|
28
|
+
addBlockedBy?: string[] | undefined;
|
|
29
|
+
}, string>;
|
|
30
|
+
|
|
31
|
+
export { type TaskUpdateConfig, createTaskUpdate, taskUpdate };
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import * as ai from 'ai';
|
|
2
|
+
|
|
3
|
+
interface ToolSearchConfig {
|
|
4
|
+
/** Registry of available tools to search through. */
|
|
5
|
+
tools?: Record<string, {
|
|
6
|
+
description: string;
|
|
7
|
+
}>;
|
|
8
|
+
}
|
|
9
|
+
declare function createToolSearch(config?: ToolSearchConfig): ai.Tool<{
|
|
10
|
+
query: string;
|
|
11
|
+
max_results: number;
|
|
12
|
+
}, string>;
|
|
13
|
+
declare const toolSearch: ai.Tool<{
|
|
14
|
+
query: string;
|
|
15
|
+
max_results: number;
|
|
16
|
+
}, string>;
|
|
17
|
+
|
|
18
|
+
export { type ToolSearchConfig, createToolSearch, toolSearch };
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import * as ai from 'ai';
|
|
2
|
+
|
|
3
|
+
interface ToolSearchConfig {
|
|
4
|
+
/** Registry of available tools to search through. */
|
|
5
|
+
tools?: Record<string, {
|
|
6
|
+
description: string;
|
|
7
|
+
}>;
|
|
8
|
+
}
|
|
9
|
+
declare function createToolSearch(config?: ToolSearchConfig): ai.Tool<{
|
|
10
|
+
query: string;
|
|
11
|
+
max_results: number;
|
|
12
|
+
}, string>;
|
|
13
|
+
declare const toolSearch: ai.Tool<{
|
|
14
|
+
query: string;
|
|
15
|
+
max_results: number;
|
|
16
|
+
}, string>;
|
|
17
|
+
|
|
18
|
+
export { type ToolSearchConfig, createToolSearch, toolSearch };
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Base configuration shared by all agentool tools.
|
|
3
|
+
* Every tool's factory function accepts a config extending this type.
|
|
4
|
+
*
|
|
5
|
+
* @example
|
|
6
|
+
* ```typescript
|
|
7
|
+
* import type { BaseToolConfig } from 'agentool';
|
|
8
|
+
* const config: BaseToolConfig = { cwd: '/my/project' };
|
|
9
|
+
* ```
|
|
10
|
+
*/
|
|
11
|
+
interface BaseToolConfig {
|
|
12
|
+
/**
|
|
13
|
+
* Working directory for file operations.
|
|
14
|
+
* Defaults to process.cwd() when not specified.
|
|
15
|
+
*/
|
|
16
|
+
cwd?: string;
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* Result returned by tool execute functions.
|
|
20
|
+
* Tools always return strings -- never throw.
|
|
21
|
+
* Error results include operation, error type, and remediation.
|
|
22
|
+
*
|
|
23
|
+
* @example
|
|
24
|
+
* ```typescript
|
|
25
|
+
* import type { ToolResult } from 'agentool';
|
|
26
|
+
* const result: ToolResult = 'Found 3 matches in src/index.ts';
|
|
27
|
+
* ```
|
|
28
|
+
*/
|
|
29
|
+
type ToolResult = string;
|
|
30
|
+
/**
|
|
31
|
+
* Configuration for tools that support timeouts.
|
|
32
|
+
* Extends {@link BaseToolConfig} with an optional timeout duration.
|
|
33
|
+
*
|
|
34
|
+
* @example
|
|
35
|
+
* ```typescript
|
|
36
|
+
* import type { TimeoutConfig } from 'agentool';
|
|
37
|
+
* const config: TimeoutConfig = { cwd: '/project', timeout: 30000 };
|
|
38
|
+
* ```
|
|
39
|
+
*/
|
|
40
|
+
interface TimeoutConfig extends BaseToolConfig {
|
|
41
|
+
/** Timeout in milliseconds. Defaults vary by tool. */
|
|
42
|
+
timeout?: number;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
export type { BaseToolConfig as B, TimeoutConfig as T, ToolResult as a };
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Base configuration shared by all agentool tools.
|
|
3
|
+
* Every tool's factory function accepts a config extending this type.
|
|
4
|
+
*
|
|
5
|
+
* @example
|
|
6
|
+
* ```typescript
|
|
7
|
+
* import type { BaseToolConfig } from 'agentool';
|
|
8
|
+
* const config: BaseToolConfig = { cwd: '/my/project' };
|
|
9
|
+
* ```
|
|
10
|
+
*/
|
|
11
|
+
interface BaseToolConfig {
|
|
12
|
+
/**
|
|
13
|
+
* Working directory for file operations.
|
|
14
|
+
* Defaults to process.cwd() when not specified.
|
|
15
|
+
*/
|
|
16
|
+
cwd?: string;
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* Result returned by tool execute functions.
|
|
20
|
+
* Tools always return strings -- never throw.
|
|
21
|
+
* Error results include operation, error type, and remediation.
|
|
22
|
+
*
|
|
23
|
+
* @example
|
|
24
|
+
* ```typescript
|
|
25
|
+
* import type { ToolResult } from 'agentool';
|
|
26
|
+
* const result: ToolResult = 'Found 3 matches in src/index.ts';
|
|
27
|
+
* ```
|
|
28
|
+
*/
|
|
29
|
+
type ToolResult = string;
|
|
30
|
+
/**
|
|
31
|
+
* Configuration for tools that support timeouts.
|
|
32
|
+
* Extends {@link BaseToolConfig} with an optional timeout duration.
|
|
33
|
+
*
|
|
34
|
+
* @example
|
|
35
|
+
* ```typescript
|
|
36
|
+
* import type { TimeoutConfig } from 'agentool';
|
|
37
|
+
* const config: TimeoutConfig = { cwd: '/project', timeout: 30000 };
|
|
38
|
+
* ```
|
|
39
|
+
*/
|
|
40
|
+
interface TimeoutConfig extends BaseToolConfig {
|
|
41
|
+
/** Timeout in milliseconds. Defaults vary by tool. */
|
|
42
|
+
timeout?: number;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
export type { BaseToolConfig as B, TimeoutConfig as T, ToolResult as a };
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import * as ai from 'ai';
|
|
2
|
+
import { T as TimeoutConfig } from '../types-3QPDuCXN.cjs';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Configuration for the web-fetch tool.
|
|
6
|
+
* Extends {@link TimeoutConfig} with optional content-length cap and user-agent.
|
|
7
|
+
*
|
|
8
|
+
* @example
|
|
9
|
+
* ```typescript
|
|
10
|
+
* const config: WebFetchConfig = {
|
|
11
|
+
* timeout: 10000,
|
|
12
|
+
* maxContentLength: 5 * 1024 * 1024,
|
|
13
|
+
* userAgent: 'my-agent/1.0',
|
|
14
|
+
* };
|
|
15
|
+
* ```
|
|
16
|
+
*/
|
|
17
|
+
interface WebFetchConfig extends TimeoutConfig {
|
|
18
|
+
/** Maximum response body size in bytes. Passed to {@link fetchUrl}. */
|
|
19
|
+
maxContentLength?: number;
|
|
20
|
+
/** Custom User-Agent header sent with every request. */
|
|
21
|
+
userAgent?: string;
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* Factory that creates a web-fetch tool with the given configuration.
|
|
25
|
+
* The returned tool fetches a URL, automatically converts HTML to markdown
|
|
26
|
+
* via turndown, and truncates content at 100 000 characters.
|
|
27
|
+
*
|
|
28
|
+
* @param config - Optional configuration (timeout, max content length, user agent).
|
|
29
|
+
* @returns An AI SDK tool instance for fetching web pages.
|
|
30
|
+
*
|
|
31
|
+
* @example
|
|
32
|
+
* ```typescript
|
|
33
|
+
* import { createWebFetch } from 'agentool/web-fetch';
|
|
34
|
+
* const myTool = createWebFetch({ timeout: 5000 });
|
|
35
|
+
* ```
|
|
36
|
+
*/
|
|
37
|
+
declare function createWebFetch(config?: WebFetchConfig): ai.Tool<{
|
|
38
|
+
url: string;
|
|
39
|
+
}, string>;
|
|
40
|
+
/**
|
|
41
|
+
* Pre-configured web-fetch tool with default settings.
|
|
42
|
+
* Uses a 30 000 ms timeout, no content-length cap override, and no custom user-agent.
|
|
43
|
+
*
|
|
44
|
+
* @example
|
|
45
|
+
* ```typescript
|
|
46
|
+
* import { webFetch } from 'agentool/web-fetch';
|
|
47
|
+
* // Register directly with your AI SDK agent
|
|
48
|
+
* ```
|
|
49
|
+
*/
|
|
50
|
+
declare const webFetch: ai.Tool<{
|
|
51
|
+
url: string;
|
|
52
|
+
}, string>;
|
|
53
|
+
|
|
54
|
+
export { type WebFetchConfig, createWebFetch, webFetch };
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import * as ai from 'ai';
|
|
2
|
+
import { T as TimeoutConfig } from '../types-3QPDuCXN.js';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Configuration for the web-fetch tool.
|
|
6
|
+
* Extends {@link TimeoutConfig} with optional content-length cap and user-agent.
|
|
7
|
+
*
|
|
8
|
+
* @example
|
|
9
|
+
* ```typescript
|
|
10
|
+
* const config: WebFetchConfig = {
|
|
11
|
+
* timeout: 10000,
|
|
12
|
+
* maxContentLength: 5 * 1024 * 1024,
|
|
13
|
+
* userAgent: 'my-agent/1.0',
|
|
14
|
+
* };
|
|
15
|
+
* ```
|
|
16
|
+
*/
|
|
17
|
+
interface WebFetchConfig extends TimeoutConfig {
|
|
18
|
+
/** Maximum response body size in bytes. Passed to {@link fetchUrl}. */
|
|
19
|
+
maxContentLength?: number;
|
|
20
|
+
/** Custom User-Agent header sent with every request. */
|
|
21
|
+
userAgent?: string;
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* Factory that creates a web-fetch tool with the given configuration.
|
|
25
|
+
* The returned tool fetches a URL, automatically converts HTML to markdown
|
|
26
|
+
* via turndown, and truncates content at 100 000 characters.
|
|
27
|
+
*
|
|
28
|
+
* @param config - Optional configuration (timeout, max content length, user agent).
|
|
29
|
+
* @returns An AI SDK tool instance for fetching web pages.
|
|
30
|
+
*
|
|
31
|
+
* @example
|
|
32
|
+
* ```typescript
|
|
33
|
+
* import { createWebFetch } from 'agentool/web-fetch';
|
|
34
|
+
* const myTool = createWebFetch({ timeout: 5000 });
|
|
35
|
+
* ```
|
|
36
|
+
*/
|
|
37
|
+
declare function createWebFetch(config?: WebFetchConfig): ai.Tool<{
|
|
38
|
+
url: string;
|
|
39
|
+
}, string>;
|
|
40
|
+
/**
|
|
41
|
+
* Pre-configured web-fetch tool with default settings.
|
|
42
|
+
* Uses a 30 000 ms timeout, no content-length cap override, and no custom user-agent.
|
|
43
|
+
*
|
|
44
|
+
* @example
|
|
45
|
+
* ```typescript
|
|
46
|
+
* import { webFetch } from 'agentool/web-fetch';
|
|
47
|
+
* // Register directly with your AI SDK agent
|
|
48
|
+
* ```
|
|
49
|
+
*/
|
|
50
|
+
declare const webFetch: ai.Tool<{
|
|
51
|
+
url: string;
|
|
52
|
+
}, string>;
|
|
53
|
+
|
|
54
|
+
export { type WebFetchConfig, createWebFetch, webFetch };
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import * as ai from 'ai';
|
|
2
|
+
|
|
3
|
+
interface WebSearchConfig {
|
|
4
|
+
/** Callback to perform the actual search. Users provide their own implementation. */
|
|
5
|
+
onSearch?: (query: string, opts: {
|
|
6
|
+
allowed_domains?: string[];
|
|
7
|
+
blocked_domains?: string[];
|
|
8
|
+
}) => Promise<string>;
|
|
9
|
+
}
|
|
10
|
+
declare function createWebSearch(config?: WebSearchConfig): ai.Tool<{
|
|
11
|
+
query: string;
|
|
12
|
+
allowed_domains?: string[] | undefined;
|
|
13
|
+
blocked_domains?: string[] | undefined;
|
|
14
|
+
}, string>;
|
|
15
|
+
declare const webSearch: ai.Tool<{
|
|
16
|
+
query: string;
|
|
17
|
+
allowed_domains?: string[] | undefined;
|
|
18
|
+
blocked_domains?: string[] | undefined;
|
|
19
|
+
}, string>;
|
|
20
|
+
|
|
21
|
+
export { type WebSearchConfig, createWebSearch, webSearch };
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import * as ai from 'ai';
|
|
2
|
+
|
|
3
|
+
interface WebSearchConfig {
|
|
4
|
+
/** Callback to perform the actual search. Users provide their own implementation. */
|
|
5
|
+
onSearch?: (query: string, opts: {
|
|
6
|
+
allowed_domains?: string[];
|
|
7
|
+
blocked_domains?: string[];
|
|
8
|
+
}) => Promise<string>;
|
|
9
|
+
}
|
|
10
|
+
declare function createWebSearch(config?: WebSearchConfig): ai.Tool<{
|
|
11
|
+
query: string;
|
|
12
|
+
allowed_domains?: string[] | undefined;
|
|
13
|
+
blocked_domains?: string[] | undefined;
|
|
14
|
+
}, string>;
|
|
15
|
+
declare const webSearch: ai.Tool<{
|
|
16
|
+
query: string;
|
|
17
|
+
allowed_domains?: string[] | undefined;
|
|
18
|
+
blocked_domains?: string[] | undefined;
|
|
19
|
+
}, string>;
|
|
20
|
+
|
|
21
|
+
export { type WebSearchConfig, createWebSearch, webSearch };
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
var _chunk6DJSWTWQcjs = require('../chunk-6DJSWTWQ.cjs');
|
|
5
|
+
require('../chunk-CAEVLIQB.cjs');
|
|
6
|
+
require('../chunk-QZ5GS6HW.cjs');
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
exports.createWrite = _chunk6DJSWTWQcjs.createWrite; exports.write = _chunk6DJSWTWQcjs.write;
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import * as ai from 'ai';
|
|
2
|
+
import { B as BaseToolConfig } from '../types-3QPDuCXN.cjs';
|
|
3
|
+
|
|
4
|
+
type WriteConfig = BaseToolConfig;
|
|
5
|
+
/**
|
|
6
|
+
* Creates a write tool that writes text content to a file.
|
|
7
|
+
*
|
|
8
|
+
* The tool creates parent directories as needed (mkdir -p behavior).
|
|
9
|
+
* If the file already exists it is overwritten, not appended.
|
|
10
|
+
* Execute never throws; errors are returned as descriptive strings.
|
|
11
|
+
*
|
|
12
|
+
* @param config - Optional configuration with a custom working directory.
|
|
13
|
+
* @returns A Vercel AI SDK tool with `description`, `parameters`, and `execute`.
|
|
14
|
+
*
|
|
15
|
+
* @example
|
|
16
|
+
* ```typescript
|
|
17
|
+
* import { createWrite } from 'agentool/write';
|
|
18
|
+
*
|
|
19
|
+
* const writeTool = createWrite({ cwd: '/my/project' });
|
|
20
|
+
* const result = await writeTool.execute(
|
|
21
|
+
* { file_path: 'src/index.ts', content: 'export {}' },
|
|
22
|
+
* { toolCallId: 'id', messages: [] },
|
|
23
|
+
* );
|
|
24
|
+
* ```
|
|
25
|
+
*/
|
|
26
|
+
declare function createWrite(config?: BaseToolConfig): ai.Tool<{
|
|
27
|
+
content: string;
|
|
28
|
+
file_path: string;
|
|
29
|
+
}, string>;
|
|
30
|
+
/**
|
|
31
|
+
* Default write tool instance using the current working directory.
|
|
32
|
+
*
|
|
33
|
+
* @example
|
|
34
|
+
* ```typescript
|
|
35
|
+
* import { write } from 'agentool/write';
|
|
36
|
+
* const result = await write.execute(
|
|
37
|
+
* { file_path: '/tmp/hello.txt', content: 'hello' },
|
|
38
|
+
* { toolCallId: 'id', messages: [] },
|
|
39
|
+
* );
|
|
40
|
+
* ```
|
|
41
|
+
*/
|
|
42
|
+
declare const write: ai.Tool<{
|
|
43
|
+
content: string;
|
|
44
|
+
file_path: string;
|
|
45
|
+
}, string>;
|
|
46
|
+
|
|
47
|
+
export { type WriteConfig, createWrite, write };
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import * as ai from 'ai';
|
|
2
|
+
import { B as BaseToolConfig } from '../types-3QPDuCXN.js';
|
|
3
|
+
|
|
4
|
+
type WriteConfig = BaseToolConfig;
|
|
5
|
+
/**
|
|
6
|
+
* Creates a write tool that writes text content to a file.
|
|
7
|
+
*
|
|
8
|
+
* The tool creates parent directories as needed (mkdir -p behavior).
|
|
9
|
+
* If the file already exists it is overwritten, not appended.
|
|
10
|
+
* Execute never throws; errors are returned as descriptive strings.
|
|
11
|
+
*
|
|
12
|
+
* @param config - Optional configuration with a custom working directory.
|
|
13
|
+
* @returns A Vercel AI SDK tool with `description`, `parameters`, and `execute`.
|
|
14
|
+
*
|
|
15
|
+
* @example
|
|
16
|
+
* ```typescript
|
|
17
|
+
* import { createWrite } from 'agentool/write';
|
|
18
|
+
*
|
|
19
|
+
* const writeTool = createWrite({ cwd: '/my/project' });
|
|
20
|
+
* const result = await writeTool.execute(
|
|
21
|
+
* { file_path: 'src/index.ts', content: 'export {}' },
|
|
22
|
+
* { toolCallId: 'id', messages: [] },
|
|
23
|
+
* );
|
|
24
|
+
* ```
|
|
25
|
+
*/
|
|
26
|
+
declare function createWrite(config?: BaseToolConfig): ai.Tool<{
|
|
27
|
+
content: string;
|
|
28
|
+
file_path: string;
|
|
29
|
+
}, string>;
|
|
30
|
+
/**
|
|
31
|
+
* Default write tool instance using the current working directory.
|
|
32
|
+
*
|
|
33
|
+
* @example
|
|
34
|
+
* ```typescript
|
|
35
|
+
* import { write } from 'agentool/write';
|
|
36
|
+
* const result = await write.execute(
|
|
37
|
+
* { file_path: '/tmp/hello.txt', content: 'hello' },
|
|
38
|
+
* { toolCallId: 'id', messages: [] },
|
|
39
|
+
* );
|
|
40
|
+
* ```
|
|
41
|
+
*/
|
|
42
|
+
declare const write: ai.Tool<{
|
|
43
|
+
content: string;
|
|
44
|
+
file_path: string;
|
|
45
|
+
}, string>;
|
|
46
|
+
|
|
47
|
+
export { type WriteConfig, createWrite, write };
|