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,11 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
var _chunk3VO6NETRcjs = require('../chunk-3VO6NETR.cjs');
|
|
5
|
+
require('../chunk-5NW4OGRI.cjs');
|
|
6
|
+
require('../chunk-CAEVLIQB.cjs');
|
|
7
|
+
require('../chunk-QZ5GS6HW.cjs');
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
exports.createMultiEdit = _chunk3VO6NETRcjs.createMultiEdit; exports.multiEdit = _chunk3VO6NETRcjs.multiEdit;
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
import * as ai from 'ai';
|
|
2
|
+
import { B as BaseToolConfig } from '../types-3QPDuCXN.cjs';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Configuration for the multi-edit tool.
|
|
6
|
+
*
|
|
7
|
+
* @example
|
|
8
|
+
* ```typescript
|
|
9
|
+
* import type { MultiEditConfig } from 'agentool/multi-edit';
|
|
10
|
+
* const config: MultiEditConfig = { cwd: '/my/project' };
|
|
11
|
+
* ```
|
|
12
|
+
*/
|
|
13
|
+
type MultiEditConfig = BaseToolConfig;
|
|
14
|
+
/**
|
|
15
|
+
* Creates a multi-edit tool that atomically applies multiple string
|
|
16
|
+
* replacements to a single file.
|
|
17
|
+
*
|
|
18
|
+
* All edits are validated and applied in memory first. The file is only
|
|
19
|
+
* written when every edit succeeds. If any edit fails (not found or
|
|
20
|
+
* non-unique), the file is left unchanged and an error is returned.
|
|
21
|
+
*
|
|
22
|
+
* @param config - Optional configuration for the working directory.
|
|
23
|
+
* @returns A Vercel AI SDK tool with `description`, `parameters`, and `execute`.
|
|
24
|
+
*
|
|
25
|
+
* @example
|
|
26
|
+
* ```typescript
|
|
27
|
+
* import { createMultiEdit } from 'agentool/multi-edit';
|
|
28
|
+
*
|
|
29
|
+
* const multiEditTool = createMultiEdit({ cwd: '/my/project' });
|
|
30
|
+
* const result = await multiEditTool.execute(
|
|
31
|
+
* {
|
|
32
|
+
* file_path: 'src/index.ts',
|
|
33
|
+
* edits: [
|
|
34
|
+
* { old_string: 'foo', new_string: 'bar' },
|
|
35
|
+
* { old_string: 'baz', new_string: 'qux' },
|
|
36
|
+
* ],
|
|
37
|
+
* },
|
|
38
|
+
* { toolCallId: 'id', messages: [] },
|
|
39
|
+
* );
|
|
40
|
+
* ```
|
|
41
|
+
*/
|
|
42
|
+
declare function createMultiEdit(config?: MultiEditConfig): ai.Tool<{
|
|
43
|
+
file_path: string;
|
|
44
|
+
edits: {
|
|
45
|
+
old_string: string;
|
|
46
|
+
new_string: string;
|
|
47
|
+
}[];
|
|
48
|
+
}, string>;
|
|
49
|
+
/**
|
|
50
|
+
* Default multi-edit tool instance using the current working directory.
|
|
51
|
+
*
|
|
52
|
+
* @example
|
|
53
|
+
* ```typescript
|
|
54
|
+
* import { multiEdit } from 'agentool/multi-edit';
|
|
55
|
+
* const result = await multiEdit.execute(
|
|
56
|
+
* {
|
|
57
|
+
* file_path: 'file.txt',
|
|
58
|
+
* edits: [{ old_string: 'a', new_string: 'b' }],
|
|
59
|
+
* },
|
|
60
|
+
* { toolCallId: 'id', messages: [] },
|
|
61
|
+
* );
|
|
62
|
+
* ```
|
|
63
|
+
*/
|
|
64
|
+
declare const multiEdit: ai.Tool<{
|
|
65
|
+
file_path: string;
|
|
66
|
+
edits: {
|
|
67
|
+
old_string: string;
|
|
68
|
+
new_string: string;
|
|
69
|
+
}[];
|
|
70
|
+
}, string>;
|
|
71
|
+
|
|
72
|
+
export { type MultiEditConfig, createMultiEdit, multiEdit };
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
import * as ai from 'ai';
|
|
2
|
+
import { B as BaseToolConfig } from '../types-3QPDuCXN.js';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Configuration for the multi-edit tool.
|
|
6
|
+
*
|
|
7
|
+
* @example
|
|
8
|
+
* ```typescript
|
|
9
|
+
* import type { MultiEditConfig } from 'agentool/multi-edit';
|
|
10
|
+
* const config: MultiEditConfig = { cwd: '/my/project' };
|
|
11
|
+
* ```
|
|
12
|
+
*/
|
|
13
|
+
type MultiEditConfig = BaseToolConfig;
|
|
14
|
+
/**
|
|
15
|
+
* Creates a multi-edit tool that atomically applies multiple string
|
|
16
|
+
* replacements to a single file.
|
|
17
|
+
*
|
|
18
|
+
* All edits are validated and applied in memory first. The file is only
|
|
19
|
+
* written when every edit succeeds. If any edit fails (not found or
|
|
20
|
+
* non-unique), the file is left unchanged and an error is returned.
|
|
21
|
+
*
|
|
22
|
+
* @param config - Optional configuration for the working directory.
|
|
23
|
+
* @returns A Vercel AI SDK tool with `description`, `parameters`, and `execute`.
|
|
24
|
+
*
|
|
25
|
+
* @example
|
|
26
|
+
* ```typescript
|
|
27
|
+
* import { createMultiEdit } from 'agentool/multi-edit';
|
|
28
|
+
*
|
|
29
|
+
* const multiEditTool = createMultiEdit({ cwd: '/my/project' });
|
|
30
|
+
* const result = await multiEditTool.execute(
|
|
31
|
+
* {
|
|
32
|
+
* file_path: 'src/index.ts',
|
|
33
|
+
* edits: [
|
|
34
|
+
* { old_string: 'foo', new_string: 'bar' },
|
|
35
|
+
* { old_string: 'baz', new_string: 'qux' },
|
|
36
|
+
* ],
|
|
37
|
+
* },
|
|
38
|
+
* { toolCallId: 'id', messages: [] },
|
|
39
|
+
* );
|
|
40
|
+
* ```
|
|
41
|
+
*/
|
|
42
|
+
declare function createMultiEdit(config?: MultiEditConfig): ai.Tool<{
|
|
43
|
+
file_path: string;
|
|
44
|
+
edits: {
|
|
45
|
+
old_string: string;
|
|
46
|
+
new_string: string;
|
|
47
|
+
}[];
|
|
48
|
+
}, string>;
|
|
49
|
+
/**
|
|
50
|
+
* Default multi-edit tool instance using the current working directory.
|
|
51
|
+
*
|
|
52
|
+
* @example
|
|
53
|
+
* ```typescript
|
|
54
|
+
* import { multiEdit } from 'agentool/multi-edit';
|
|
55
|
+
* const result = await multiEdit.execute(
|
|
56
|
+
* {
|
|
57
|
+
* file_path: 'file.txt',
|
|
58
|
+
* edits: [{ old_string: 'a', new_string: 'b' }],
|
|
59
|
+
* },
|
|
60
|
+
* { toolCallId: 'id', messages: [] },
|
|
61
|
+
* );
|
|
62
|
+
* ```
|
|
63
|
+
*/
|
|
64
|
+
declare const multiEdit: ai.Tool<{
|
|
65
|
+
file_path: string;
|
|
66
|
+
edits: {
|
|
67
|
+
old_string: string;
|
|
68
|
+
new_string: string;
|
|
69
|
+
}[];
|
|
70
|
+
}, string>;
|
|
71
|
+
|
|
72
|
+
export { type MultiEditConfig, createMultiEdit, multiEdit };
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
var _chunkOM2UFTGScjs = require('../chunk-OM2UFTGS.cjs');
|
|
5
|
+
require('../chunk-CAEVLIQB.cjs');
|
|
6
|
+
require('../chunk-QZ5GS6HW.cjs');
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
exports.createRead = _chunkOM2UFTGScjs.createRead; exports.read = _chunkOM2UFTGScjs.read;
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import * as ai from 'ai';
|
|
2
|
+
import { B as BaseToolConfig } from '../types-3QPDuCXN.cjs';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Configuration for the read tool.
|
|
6
|
+
* Extends {@link BaseToolConfig} with an optional maximum line count.
|
|
7
|
+
*
|
|
8
|
+
* @example
|
|
9
|
+
* ```typescript
|
|
10
|
+
* import type { ReadConfig } from 'agentool/read';
|
|
11
|
+
* const config: ReadConfig = { cwd: '/my/project', maxLines: 500 };
|
|
12
|
+
* ```
|
|
13
|
+
*/
|
|
14
|
+
interface ReadConfig extends BaseToolConfig {
|
|
15
|
+
/**
|
|
16
|
+
* Maximum number of lines to return when no explicit limit is given.
|
|
17
|
+
* @default 2000
|
|
18
|
+
*/
|
|
19
|
+
maxLines?: number;
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* Creates a read tool that reads file contents with line numbers.
|
|
23
|
+
*
|
|
24
|
+
* The tool resolves the given path (supporting `~` and relative paths),
|
|
25
|
+
* reads the requested range of lines, and returns the content with
|
|
26
|
+
* `cat -n` style line numbers. It never throws; errors are returned as
|
|
27
|
+
* descriptive strings.
|
|
28
|
+
*
|
|
29
|
+
* @param config - Optional configuration for cwd and max lines.
|
|
30
|
+
* @returns A Vercel AI SDK tool with `description`, `parameters`, and `execute`.
|
|
31
|
+
*
|
|
32
|
+
* @example
|
|
33
|
+
* ```typescript
|
|
34
|
+
* import { createRead } from 'agentool/read';
|
|
35
|
+
*
|
|
36
|
+
* const readTool = createRead({ cwd: '/my/project' });
|
|
37
|
+
* const result = await readTool.execute(
|
|
38
|
+
* { file_path: 'src/index.ts' },
|
|
39
|
+
* { toolCallId: 'id', messages: [] },
|
|
40
|
+
* );
|
|
41
|
+
* ```
|
|
42
|
+
*/
|
|
43
|
+
declare function createRead(config?: ReadConfig): ai.Tool<{
|
|
44
|
+
file_path: string;
|
|
45
|
+
offset?: number | undefined;
|
|
46
|
+
limit?: number | undefined;
|
|
47
|
+
}, string>;
|
|
48
|
+
/**
|
|
49
|
+
* Default read tool instance using the current working directory
|
|
50
|
+
* and a 2000-line default limit.
|
|
51
|
+
*
|
|
52
|
+
* @example
|
|
53
|
+
* ```typescript
|
|
54
|
+
* import { read } from 'agentool/read';
|
|
55
|
+
* const result = await read.execute(
|
|
56
|
+
* { file_path: '/tmp/file.txt' },
|
|
57
|
+
* { toolCallId: 'id', messages: [] },
|
|
58
|
+
* );
|
|
59
|
+
* ```
|
|
60
|
+
*/
|
|
61
|
+
declare const read: ai.Tool<{
|
|
62
|
+
file_path: string;
|
|
63
|
+
offset?: number | undefined;
|
|
64
|
+
limit?: number | undefined;
|
|
65
|
+
}, string>;
|
|
66
|
+
|
|
67
|
+
export { type ReadConfig, createRead, read };
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import * as ai from 'ai';
|
|
2
|
+
import { B as BaseToolConfig } from '../types-3QPDuCXN.js';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Configuration for the read tool.
|
|
6
|
+
* Extends {@link BaseToolConfig} with an optional maximum line count.
|
|
7
|
+
*
|
|
8
|
+
* @example
|
|
9
|
+
* ```typescript
|
|
10
|
+
* import type { ReadConfig } from 'agentool/read';
|
|
11
|
+
* const config: ReadConfig = { cwd: '/my/project', maxLines: 500 };
|
|
12
|
+
* ```
|
|
13
|
+
*/
|
|
14
|
+
interface ReadConfig extends BaseToolConfig {
|
|
15
|
+
/**
|
|
16
|
+
* Maximum number of lines to return when no explicit limit is given.
|
|
17
|
+
* @default 2000
|
|
18
|
+
*/
|
|
19
|
+
maxLines?: number;
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* Creates a read tool that reads file contents with line numbers.
|
|
23
|
+
*
|
|
24
|
+
* The tool resolves the given path (supporting `~` and relative paths),
|
|
25
|
+
* reads the requested range of lines, and returns the content with
|
|
26
|
+
* `cat -n` style line numbers. It never throws; errors are returned as
|
|
27
|
+
* descriptive strings.
|
|
28
|
+
*
|
|
29
|
+
* @param config - Optional configuration for cwd and max lines.
|
|
30
|
+
* @returns A Vercel AI SDK tool with `description`, `parameters`, and `execute`.
|
|
31
|
+
*
|
|
32
|
+
* @example
|
|
33
|
+
* ```typescript
|
|
34
|
+
* import { createRead } from 'agentool/read';
|
|
35
|
+
*
|
|
36
|
+
* const readTool = createRead({ cwd: '/my/project' });
|
|
37
|
+
* const result = await readTool.execute(
|
|
38
|
+
* { file_path: 'src/index.ts' },
|
|
39
|
+
* { toolCallId: 'id', messages: [] },
|
|
40
|
+
* );
|
|
41
|
+
* ```
|
|
42
|
+
*/
|
|
43
|
+
declare function createRead(config?: ReadConfig): ai.Tool<{
|
|
44
|
+
file_path: string;
|
|
45
|
+
offset?: number | undefined;
|
|
46
|
+
limit?: number | undefined;
|
|
47
|
+
}, string>;
|
|
48
|
+
/**
|
|
49
|
+
* Default read tool instance using the current working directory
|
|
50
|
+
* and a 2000-line default limit.
|
|
51
|
+
*
|
|
52
|
+
* @example
|
|
53
|
+
* ```typescript
|
|
54
|
+
* import { read } from 'agentool/read';
|
|
55
|
+
* const result = await read.execute(
|
|
56
|
+
* { file_path: '/tmp/file.txt' },
|
|
57
|
+
* { toolCallId: 'id', messages: [] },
|
|
58
|
+
* );
|
|
59
|
+
* ```
|
|
60
|
+
*/
|
|
61
|
+
declare const read: ai.Tool<{
|
|
62
|
+
file_path: string;
|
|
63
|
+
offset?: number | undefined;
|
|
64
|
+
limit?: number | undefined;
|
|
65
|
+
}, string>;
|
|
66
|
+
|
|
67
|
+
export { type ReadConfig, createRead, read };
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import * as ai from 'ai';
|
|
2
|
+
import { B as BaseToolConfig } from '../types-3QPDuCXN.cjs';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Configuration for the sleep tool.
|
|
6
|
+
* Extends {@link BaseToolConfig} with an optional maximum duration cap.
|
|
7
|
+
*
|
|
8
|
+
* @example
|
|
9
|
+
* ```typescript
|
|
10
|
+
* import type { SleepConfig } from 'agentool/sleep';
|
|
11
|
+
* const config: SleepConfig = { maxDuration: 60000 };
|
|
12
|
+
* ```
|
|
13
|
+
*/
|
|
14
|
+
interface SleepConfig extends BaseToolConfig {
|
|
15
|
+
/**
|
|
16
|
+
* Maximum allowed sleep duration in milliseconds.
|
|
17
|
+
* Requested durations exceeding this value are clamped.
|
|
18
|
+
* @default 300000 (5 minutes)
|
|
19
|
+
*/
|
|
20
|
+
maxDuration?: number;
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* Creates a sleep tool that pauses execution for a specified duration.
|
|
24
|
+
*
|
|
25
|
+
* The tool clamps the requested duration to `[0, maxDuration]` and reports
|
|
26
|
+
* the actual elapsed time. It never throws; errors are returned as strings.
|
|
27
|
+
*
|
|
28
|
+
* @param config - Optional configuration with a custom max duration.
|
|
29
|
+
* @returns A Vercel AI SDK tool with `description`, `parameters`, and `execute`.
|
|
30
|
+
*
|
|
31
|
+
* @example
|
|
32
|
+
* ```typescript
|
|
33
|
+
* import { createSleep } from 'agentool/sleep';
|
|
34
|
+
*
|
|
35
|
+
* // Default max of 300 000 ms
|
|
36
|
+
* const sleepTool = createSleep();
|
|
37
|
+
*
|
|
38
|
+
* // Custom max of 10 seconds
|
|
39
|
+
* const shortSleep = createSleep({ maxDuration: 10000 });
|
|
40
|
+
* ```
|
|
41
|
+
*/
|
|
42
|
+
declare function createSleep(config?: SleepConfig): ai.Tool<{
|
|
43
|
+
durationMs: number;
|
|
44
|
+
reason?: string | undefined;
|
|
45
|
+
}, string>;
|
|
46
|
+
/**
|
|
47
|
+
* Default sleep tool instance with a 300 000 ms (5-minute) maximum duration.
|
|
48
|
+
*
|
|
49
|
+
* @example
|
|
50
|
+
* ```typescript
|
|
51
|
+
* import { sleep } from 'agentool/sleep';
|
|
52
|
+
* const result = await sleep.execute({ durationMs: 1000, reason: 'rate limit' });
|
|
53
|
+
* ```
|
|
54
|
+
*/
|
|
55
|
+
declare const sleep: ai.Tool<{
|
|
56
|
+
durationMs: number;
|
|
57
|
+
reason?: string | undefined;
|
|
58
|
+
}, string>;
|
|
59
|
+
|
|
60
|
+
export { type SleepConfig, createSleep, sleep };
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import * as ai from 'ai';
|
|
2
|
+
import { B as BaseToolConfig } from '../types-3QPDuCXN.js';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Configuration for the sleep tool.
|
|
6
|
+
* Extends {@link BaseToolConfig} with an optional maximum duration cap.
|
|
7
|
+
*
|
|
8
|
+
* @example
|
|
9
|
+
* ```typescript
|
|
10
|
+
* import type { SleepConfig } from 'agentool/sleep';
|
|
11
|
+
* const config: SleepConfig = { maxDuration: 60000 };
|
|
12
|
+
* ```
|
|
13
|
+
*/
|
|
14
|
+
interface SleepConfig extends BaseToolConfig {
|
|
15
|
+
/**
|
|
16
|
+
* Maximum allowed sleep duration in milliseconds.
|
|
17
|
+
* Requested durations exceeding this value are clamped.
|
|
18
|
+
* @default 300000 (5 minutes)
|
|
19
|
+
*/
|
|
20
|
+
maxDuration?: number;
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* Creates a sleep tool that pauses execution for a specified duration.
|
|
24
|
+
*
|
|
25
|
+
* The tool clamps the requested duration to `[0, maxDuration]` and reports
|
|
26
|
+
* the actual elapsed time. It never throws; errors are returned as strings.
|
|
27
|
+
*
|
|
28
|
+
* @param config - Optional configuration with a custom max duration.
|
|
29
|
+
* @returns A Vercel AI SDK tool with `description`, `parameters`, and `execute`.
|
|
30
|
+
*
|
|
31
|
+
* @example
|
|
32
|
+
* ```typescript
|
|
33
|
+
* import { createSleep } from 'agentool/sleep';
|
|
34
|
+
*
|
|
35
|
+
* // Default max of 300 000 ms
|
|
36
|
+
* const sleepTool = createSleep();
|
|
37
|
+
*
|
|
38
|
+
* // Custom max of 10 seconds
|
|
39
|
+
* const shortSleep = createSleep({ maxDuration: 10000 });
|
|
40
|
+
* ```
|
|
41
|
+
*/
|
|
42
|
+
declare function createSleep(config?: SleepConfig): ai.Tool<{
|
|
43
|
+
durationMs: number;
|
|
44
|
+
reason?: string | undefined;
|
|
45
|
+
}, string>;
|
|
46
|
+
/**
|
|
47
|
+
* Default sleep tool instance with a 300 000 ms (5-minute) maximum duration.
|
|
48
|
+
*
|
|
49
|
+
* @example
|
|
50
|
+
* ```typescript
|
|
51
|
+
* import { sleep } from 'agentool/sleep';
|
|
52
|
+
* const result = await sleep.execute({ durationMs: 1000, reason: 'rate limit' });
|
|
53
|
+
* ```
|
|
54
|
+
*/
|
|
55
|
+
declare const sleep: ai.Tool<{
|
|
56
|
+
durationMs: number;
|
|
57
|
+
reason?: string | undefined;
|
|
58
|
+
}, string>;
|
|
59
|
+
|
|
60
|
+
export { type SleepConfig, createSleep, sleep };
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
var _chunk56CL4JCWcjs = require('../chunk-56CL4JCW.cjs');
|
|
5
|
+
require('../chunk-L5JH4I77.cjs');
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
exports.createTaskCreate = _chunk56CL4JCWcjs.createTaskCreate; exports.taskCreate = _chunk56CL4JCWcjs.taskCreate;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import * as ai from 'ai';
|
|
2
|
+
import { B as BaseToolConfig } from '../types-3QPDuCXN.cjs';
|
|
3
|
+
|
|
4
|
+
interface TaskCreateConfig extends BaseToolConfig {
|
|
5
|
+
/** Path to the tasks JSON file. Defaults to `<cwd>/.agentool/tasks.json`. */
|
|
6
|
+
tasksFile?: string;
|
|
7
|
+
}
|
|
8
|
+
declare function createTaskCreate(config?: TaskCreateConfig): ai.Tool<{
|
|
9
|
+
description: string;
|
|
10
|
+
subject: string;
|
|
11
|
+
metadata?: Record<string, unknown> | undefined;
|
|
12
|
+
}, string>;
|
|
13
|
+
declare const taskCreate: ai.Tool<{
|
|
14
|
+
description: string;
|
|
15
|
+
subject: string;
|
|
16
|
+
metadata?: Record<string, unknown> | undefined;
|
|
17
|
+
}, string>;
|
|
18
|
+
|
|
19
|
+
export { type TaskCreateConfig, createTaskCreate, taskCreate };
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import * as ai from 'ai';
|
|
2
|
+
import { B as BaseToolConfig } from '../types-3QPDuCXN.js';
|
|
3
|
+
|
|
4
|
+
interface TaskCreateConfig extends BaseToolConfig {
|
|
5
|
+
/** Path to the tasks JSON file. Defaults to `<cwd>/.agentool/tasks.json`. */
|
|
6
|
+
tasksFile?: string;
|
|
7
|
+
}
|
|
8
|
+
declare function createTaskCreate(config?: TaskCreateConfig): ai.Tool<{
|
|
9
|
+
description: string;
|
|
10
|
+
subject: string;
|
|
11
|
+
metadata?: Record<string, unknown> | undefined;
|
|
12
|
+
}, string>;
|
|
13
|
+
declare const taskCreate: ai.Tool<{
|
|
14
|
+
description: string;
|
|
15
|
+
subject: string;
|
|
16
|
+
metadata?: Record<string, unknown> | undefined;
|
|
17
|
+
}, string>;
|
|
18
|
+
|
|
19
|
+
export { type TaskCreateConfig, createTaskCreate, taskCreate };
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
var _chunk4HXAKPQHcjs = require('../chunk-4HXAKPQH.cjs');
|
|
5
|
+
require('../chunk-L5JH4I77.cjs');
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
exports.createTaskGet = _chunk4HXAKPQHcjs.createTaskGet; exports.taskGet = _chunk4HXAKPQHcjs.taskGet;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import * as ai from 'ai';
|
|
2
|
+
import { B as BaseToolConfig } from '../types-3QPDuCXN.cjs';
|
|
3
|
+
|
|
4
|
+
interface TaskGetConfig extends BaseToolConfig {
|
|
5
|
+
/** Path to the tasks JSON file. Defaults to `<cwd>/.agentool/tasks.json`. */
|
|
6
|
+
tasksFile?: string;
|
|
7
|
+
}
|
|
8
|
+
declare function createTaskGet(config?: TaskGetConfig): ai.Tool<{
|
|
9
|
+
taskId: string;
|
|
10
|
+
}, string>;
|
|
11
|
+
declare const taskGet: ai.Tool<{
|
|
12
|
+
taskId: string;
|
|
13
|
+
}, string>;
|
|
14
|
+
|
|
15
|
+
export { type TaskGetConfig, createTaskGet, taskGet };
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import * as ai from 'ai';
|
|
2
|
+
import { B as BaseToolConfig } from '../types-3QPDuCXN.js';
|
|
3
|
+
|
|
4
|
+
interface TaskGetConfig extends BaseToolConfig {
|
|
5
|
+
/** Path to the tasks JSON file. Defaults to `<cwd>/.agentool/tasks.json`. */
|
|
6
|
+
tasksFile?: string;
|
|
7
|
+
}
|
|
8
|
+
declare function createTaskGet(config?: TaskGetConfig): ai.Tool<{
|
|
9
|
+
taskId: string;
|
|
10
|
+
}, string>;
|
|
11
|
+
declare const taskGet: ai.Tool<{
|
|
12
|
+
taskId: string;
|
|
13
|
+
}, string>;
|
|
14
|
+
|
|
15
|
+
export { type TaskGetConfig, createTaskGet, taskGet };
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
var _chunkHNUL2CIDcjs = require('../chunk-HNUL2CID.cjs');
|
|
5
|
+
require('../chunk-L5JH4I77.cjs');
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
exports.createTaskList = _chunkHNUL2CIDcjs.createTaskList; exports.taskList = _chunkHNUL2CIDcjs.taskList;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import * as ai from 'ai';
|
|
2
|
+
import { B as BaseToolConfig } from '../types-3QPDuCXN.cjs';
|
|
3
|
+
|
|
4
|
+
interface TaskListConfig extends BaseToolConfig {
|
|
5
|
+
/** Path to the tasks JSON file. Defaults to `<cwd>/.agentool/tasks.json`. */
|
|
6
|
+
tasksFile?: string;
|
|
7
|
+
}
|
|
8
|
+
declare function createTaskList(config?: TaskListConfig): ai.Tool<{}, string>;
|
|
9
|
+
declare const taskList: ai.Tool<{}, string>;
|
|
10
|
+
|
|
11
|
+
export { type TaskListConfig, createTaskList, taskList };
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import * as ai from 'ai';
|
|
2
|
+
import { B as BaseToolConfig } from '../types-3QPDuCXN.js';
|
|
3
|
+
|
|
4
|
+
interface TaskListConfig extends BaseToolConfig {
|
|
5
|
+
/** Path to the tasks JSON file. Defaults to `<cwd>/.agentool/tasks.json`. */
|
|
6
|
+
tasksFile?: string;
|
|
7
|
+
}
|
|
8
|
+
declare function createTaskList(config?: TaskListConfig): ai.Tool<{}, string>;
|
|
9
|
+
declare const taskList: ai.Tool<{}, string>;
|
|
10
|
+
|
|
11
|
+
export { type TaskListConfig, createTaskList, taskList };
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
var _chunkZFQZWXOIcjs = require('../chunk-ZFQZWXOI.cjs');
|
|
5
|
+
require('../chunk-L5JH4I77.cjs');
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
exports.createTaskUpdate = _chunkZFQZWXOIcjs.createTaskUpdate; exports.taskUpdate = _chunkZFQZWXOIcjs.taskUpdate;
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import * as ai from 'ai';
|
|
2
|
+
import { B as BaseToolConfig } from '../types-3QPDuCXN.cjs';
|
|
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 };
|