@agntk/core 0.3.3 → 1.0.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/dist/advanced/index.d.ts +13 -22
- package/dist/advanced/index.d.ts.map +1 -1
- package/dist/advanced/index.js +10 -55
- package/dist/advanced/index.js.map +1 -1
- package/dist/agent.d.ts +2 -35
- package/dist/agent.d.ts.map +1 -1
- package/dist/agent.js +113 -111
- package/dist/agent.js.map +1 -1
- package/dist/config/defaults.d.ts +1 -5
- package/dist/config/defaults.d.ts.map +1 -1
- package/dist/config/defaults.js +1 -11
- package/dist/config/defaults.js.map +1 -1
- package/dist/config/index.d.ts +5 -1
- package/dist/config/index.d.ts.map +1 -1
- package/dist/config/index.js +7 -7
- package/dist/config/index.js.map +1 -1
- package/dist/config/loader.d.ts +0 -40
- package/dist/config/loader.d.ts.map +1 -1
- package/dist/config/loader.js +3 -80
- package/dist/config/loader.js.map +1 -1
- package/dist/config/schema.d.ts +117 -788
- package/dist/config/schema.d.ts.map +1 -1
- package/dist/config/schema.js +52 -63
- package/dist/config/schema.js.map +1 -1
- package/dist/constants.d.ts +0 -11
- package/dist/constants.d.ts.map +1 -1
- package/dist/constants.js +0 -17
- package/dist/constants.js.map +1 -1
- package/dist/evals/assertions.d.ts +0 -35
- package/dist/evals/assertions.d.ts.map +1 -1
- package/dist/evals/assertions.js +0 -51
- package/dist/evals/assertions.js.map +1 -1
- package/dist/evals/index.d.ts +0 -5
- package/dist/evals/index.d.ts.map +1 -1
- package/dist/evals/index.js +0 -5
- package/dist/evals/index.js.map +1 -1
- package/dist/evals/runner.d.ts +0 -27
- package/dist/evals/runner.d.ts.map +1 -1
- package/dist/evals/runner.js +3 -45
- package/dist/evals/runner.js.map +1 -1
- package/dist/evals/types.d.ts +0 -14
- package/dist/evals/types.d.ts.map +1 -1
- package/dist/evals/types.js +0 -3
- package/dist/evals/types.js.map +1 -1
- package/dist/guardrails/built-ins.d.ts +0 -28
- package/dist/guardrails/built-ins.d.ts.map +1 -1
- package/dist/guardrails/built-ins.js +21 -47
- package/dist/guardrails/built-ins.js.map +1 -1
- package/dist/guardrails/index.d.ts +1 -4
- package/dist/guardrails/index.d.ts.map +1 -1
- package/dist/guardrails/index.js +1 -4
- package/dist/guardrails/index.js.map +1 -1
- package/dist/guardrails/runner.d.ts +0 -30
- package/dist/guardrails/runner.d.ts.map +1 -1
- package/dist/guardrails/runner.js +1 -46
- package/dist/guardrails/runner.js.map +1 -1
- package/dist/guardrails/types.d.ts +0 -35
- package/dist/guardrails/types.d.ts.map +1 -1
- package/dist/guardrails/types.js +4 -7
- package/dist/guardrails/types.js.map +1 -1
- package/dist/index.d.ts +4 -12
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -31
- package/dist/index.js.map +1 -1
- package/dist/memory/loader.d.ts +0 -17
- package/dist/memory/loader.d.ts.map +1 -1
- package/dist/memory/loader.js +5 -27
- package/dist/memory/loader.js.map +1 -1
- package/dist/memory/store.d.ts +8 -16
- package/dist/memory/store.d.ts.map +1 -1
- package/dist/memory/store.js +101 -32
- package/dist/memory/store.js.map +1 -1
- package/dist/memory/types.d.ts +10 -30
- package/dist/memory/types.d.ts.map +1 -1
- package/dist/memory/types.js +0 -6
- package/dist/memory/types.js.map +1 -1
- package/dist/models.d.ts +9 -32
- package/dist/models.d.ts.map +1 -1
- package/dist/models.js +25 -68
- package/dist/models.js.map +1 -1
- package/dist/observability/index.d.ts +0 -3
- package/dist/observability/index.d.ts.map +1 -1
- package/dist/observability/index.js +0 -3
- package/dist/observability/index.js.map +1 -1
- package/dist/observability/langfuse.d.ts +0 -38
- package/dist/observability/langfuse.d.ts.map +1 -1
- package/dist/observability/langfuse.js +6 -55
- package/dist/observability/langfuse.js.map +1 -1
- package/dist/observability/types.d.ts +0 -21
- package/dist/observability/types.d.ts.map +1 -1
- package/dist/observability/types.js +0 -3
- package/dist/observability/types.js.map +1 -1
- package/dist/presets/tool-preset-registry.d.ts +0 -21
- package/dist/presets/tool-preset-registry.d.ts.map +1 -1
- package/dist/presets/tool-preset-registry.js +15 -34
- package/dist/presets/tool-preset-registry.js.map +1 -1
- package/dist/presets/tools.d.ts +41 -39
- package/dist/presets/tools.d.ts.map +1 -1
- package/dist/presets/tools.js +46 -40
- package/dist/presets/tools.js.map +1 -1
- package/dist/prompts/context.d.ts +0 -4
- package/dist/prompts/context.d.ts.map +1 -1
- package/dist/prompts/context.js +21 -33
- package/dist/prompts/context.js.map +1 -1
- package/dist/prompts/template.d.ts +0 -11
- package/dist/prompts/template.d.ts.map +1 -1
- package/dist/prompts/template.js +4 -14
- package/dist/prompts/template.js.map +1 -1
- package/dist/provider-resolver.d.ts +0 -29
- package/dist/provider-resolver.d.ts.map +1 -1
- package/dist/provider-resolver.js +17 -61
- package/dist/provider-resolver.js.map +1 -1
- package/dist/reflection.d.ts +0 -34
- package/dist/reflection.d.ts.map +1 -1
- package/dist/reflection.js +0 -40
- package/dist/reflection.js.map +1 -1
- package/dist/skills/index.d.ts +0 -3
- package/dist/skills/index.d.ts.map +1 -1
- package/dist/skills/index.js +0 -3
- package/dist/skills/index.js.map +1 -1
- package/dist/skills/loader.d.ts +0 -69
- package/dist/skills/loader.d.ts.map +1 -1
- package/dist/skills/loader.js +38 -130
- package/dist/skills/loader.js.map +1 -1
- package/dist/skills/types.d.ts +0 -36
- package/dist/skills/types.d.ts.map +1 -1
- package/dist/skills/types.js +0 -4
- package/dist/skills/types.js.map +1 -1
- package/dist/system-detect.d.ts +0 -57
- package/dist/system-detect.d.ts.map +1 -1
- package/dist/system-detect.js +9 -114
- package/dist/system-detect.js.map +1 -1
- package/dist/tools/approval.d.ts +0 -47
- package/dist/tools/approval.d.ts.map +1 -1
- package/dist/tools/approval.js +0 -46
- package/dist/tools/approval.js.map +1 -1
- package/dist/tools/ast-grep/cli.d.ts.map +1 -1
- package/dist/tools/ast-grep/cli.js +10 -4
- package/dist/tools/ast-grep/cli.js.map +1 -1
- package/dist/tools/ast-grep/constants.d.ts.map +1 -1
- package/dist/tools/ast-grep/constants.js +7 -14
- package/dist/tools/ast-grep/constants.js.map +1 -1
- package/dist/tools/ast-grep/downloader.d.ts.map +1 -1
- package/dist/tools/ast-grep/downloader.js +1 -4
- package/dist/tools/ast-grep/downloader.js.map +1 -1
- package/dist/tools/ast-grep/index.d.ts +2 -2
- package/dist/tools/ast-grep/index.d.ts.map +1 -1
- package/dist/tools/ast-grep/index.js +1 -1
- package/dist/tools/ast-grep/index.js.map +1 -1
- package/dist/tools/ast-grep/tools.d.ts +4 -4
- package/dist/tools/ast-grep/tools.d.ts.map +1 -1
- package/dist/tools/ast-grep/tools.js +2 -8
- package/dist/tools/ast-grep/tools.js.map +1 -1
- package/dist/tools/browser/index.d.ts +4 -4
- package/dist/tools/browser/index.d.ts.map +1 -1
- package/dist/tools/browser/index.js +2 -3
- package/dist/tools/browser/index.js.map +1 -1
- package/dist/tools/browser/stream.d.ts +0 -32
- package/dist/tools/browser/stream.d.ts.map +1 -1
- package/dist/tools/browser/stream.js +0 -53
- package/dist/tools/browser/stream.js.map +1 -1
- package/dist/tools/browser/tool.d.ts +10 -15
- package/dist/tools/browser/tool.d.ts.map +1 -1
- package/dist/tools/browser/tool.js +2 -26
- package/dist/tools/browser/tool.js.map +1 -1
- package/dist/tools/browser/types.d.ts +31 -156
- package/dist/tools/browser/types.d.ts.map +1 -1
- package/dist/tools/browser/types.js +22 -17
- package/dist/tools/browser/types.js.map +1 -1
- package/dist/tools/deep-reasoning/constants.d.ts +0 -6
- package/dist/tools/deep-reasoning/constants.d.ts.map +1 -1
- package/dist/tools/deep-reasoning/constants.js +0 -6
- package/dist/tools/deep-reasoning/constants.js.map +1 -1
- package/dist/tools/deep-reasoning/engine.d.ts.map +1 -1
- package/dist/tools/deep-reasoning/engine.js +0 -1
- package/dist/tools/deep-reasoning/engine.js.map +1 -1
- package/dist/tools/deep-reasoning/index.d.ts +4 -0
- package/dist/tools/deep-reasoning/index.d.ts.map +1 -1
- package/dist/tools/deep-reasoning/index.js +4 -3
- package/dist/tools/deep-reasoning/index.js.map +1 -1
- package/dist/tools/deep-reasoning/tools.d.ts.map +1 -1
- package/dist/tools/deep-reasoning/tools.js +8 -1
- package/dist/tools/deep-reasoning/tools.js.map +1 -1
- package/dist/tools/deep-reasoning/types.d.ts +5 -30
- package/dist/tools/deep-reasoning/types.d.ts.map +1 -1
- package/dist/tools/deep-reasoning/types.js +10 -1
- package/dist/tools/deep-reasoning/types.js.map +1 -1
- package/dist/tools/file/index.d.ts +3 -5
- package/dist/tools/file/index.d.ts.map +1 -1
- package/dist/tools/file/index.js +2 -4
- package/dist/tools/file/index.js.map +1 -1
- package/dist/tools/file/tools.d.ts +8 -11
- package/dist/tools/file/tools.d.ts.map +1 -1
- package/dist/tools/file/tools.js +45 -59
- package/dist/tools/file/tools.js.map +1 -1
- package/dist/tools/glob/cli.d.ts.map +1 -1
- package/dist/tools/glob/cli.js +8 -6
- package/dist/tools/glob/cli.js.map +1 -1
- package/dist/tools/glob/tools.d.ts.map +1 -1
- package/dist/tools/glob/tools.js +7 -10
- package/dist/tools/glob/tools.js.map +1 -1
- package/dist/tools/grep/cli.d.ts.map +1 -1
- package/dist/tools/grep/cli.js +0 -2
- package/dist/tools/grep/cli.js.map +1 -1
- package/dist/tools/grep/constants.d.ts.map +1 -1
- package/dist/tools/grep/constants.js +3 -5
- package/dist/tools/grep/constants.js.map +1 -1
- package/dist/tools/grep/downloader.d.ts.map +1 -1
- package/dist/tools/grep/downloader.js +3 -3
- package/dist/tools/grep/downloader.js.map +1 -1
- package/dist/tools/grep/tools.d.ts +2 -2
- package/dist/tools/grep/tools.d.ts.map +1 -1
- package/dist/tools/grep/tools.js +8 -14
- package/dist/tools/grep/tools.js.map +1 -1
- package/dist/tools/index.d.ts +10 -11
- package/dist/tools/index.d.ts.map +1 -1
- package/dist/tools/index.js +9 -22
- package/dist/tools/index.js.map +1 -1
- package/dist/tools/model-retry.d.ts +0 -40
- package/dist/tools/model-retry.d.ts.map +1 -1
- package/dist/tools/model-retry.js +1 -49
- package/dist/tools/model-retry.js.map +1 -1
- package/dist/tools/plan/constants.d.ts +0 -6
- package/dist/tools/plan/constants.d.ts.map +1 -1
- package/dist/tools/plan/constants.js +9 -6
- package/dist/tools/plan/constants.js.map +1 -1
- package/dist/tools/plan/index.d.ts +1 -1
- package/dist/tools/plan/index.d.ts.map +1 -1
- package/dist/tools/plan/index.js +1 -4
- package/dist/tools/plan/index.js.map +1 -1
- package/dist/tools/plan/tools.d.ts +2 -2
- package/dist/tools/plan/tools.d.ts.map +1 -1
- package/dist/tools/plan/tools.js +10 -11
- package/dist/tools/plan/tools.js.map +1 -1
- package/dist/tools/plan/types.d.ts +22 -32
- package/dist/tools/plan/types.d.ts.map +1 -1
- package/dist/tools/plan/types.js +11 -3
- package/dist/tools/plan/types.js.map +1 -1
- package/dist/tools/progress/index.d.ts +3 -22
- package/dist/tools/progress/index.d.ts.map +1 -1
- package/dist/tools/progress/index.js +19 -34
- package/dist/tools/progress/index.js.map +1 -1
- package/dist/tools/search-skills.d.ts +0 -23
- package/dist/tools/search-skills.d.ts.map +1 -1
- package/dist/tools/search-skills.js +3 -32
- package/dist/tools/search-skills.js.map +1 -1
- package/dist/tools/shell/background.d.ts +2 -18
- package/dist/tools/shell/background.d.ts.map +1 -1
- package/dist/tools/shell/background.js +45 -48
- package/dist/tools/shell/background.js.map +1 -1
- package/dist/tools/shell/constants.d.ts +0 -3
- package/dist/tools/shell/constants.d.ts.map +1 -1
- package/dist/tools/shell/constants.js +16 -6
- package/dist/tools/shell/constants.js.map +1 -1
- package/dist/tools/shell/index.d.ts +1 -1
- package/dist/tools/shell/index.d.ts.map +1 -1
- package/dist/tools/shell/index.js +1 -1
- package/dist/tools/shell/index.js.map +1 -1
- package/dist/tools/shell/tools.d.ts +3 -3
- package/dist/tools/shell/tools.d.ts.map +1 -1
- package/dist/tools/shell/tools.js +0 -2
- package/dist/tools/shell/tools.js.map +1 -1
- package/dist/tools/shell/types.d.ts +5 -13
- package/dist/tools/shell/types.d.ts.map +1 -1
- package/dist/tools/shell/types.js +10 -1
- package/dist/tools/shell/types.js.map +1 -1
- package/dist/tools/spawn-agent/check-agent.d.ts +45 -0
- package/dist/tools/spawn-agent/check-agent.d.ts.map +1 -0
- package/dist/tools/spawn-agent/check-agent.js +84 -0
- package/dist/tools/spawn-agent/check-agent.js.map +1 -0
- package/dist/tools/spawn-agent/index.d.ts +44 -51
- package/dist/tools/spawn-agent/index.d.ts.map +1 -1
- package/dist/tools/spawn-agent/index.js +196 -84
- package/dist/tools/spawn-agent/index.js.map +1 -1
- package/dist/tools/spawn-agent/registry.d.ts +36 -0
- package/dist/tools/spawn-agent/registry.d.ts.map +1 -0
- package/dist/tools/spawn-agent/registry.js +88 -0
- package/dist/tools/spawn-agent/registry.js.map +1 -0
- package/dist/tools/utils/errors.d.ts +2 -1
- package/dist/tools/utils/errors.d.ts.map +1 -1
- package/dist/tools/utils/errors.js +2 -1
- package/dist/tools/utils/errors.js.map +1 -1
- package/dist/tools/utils/shell.d.ts +0 -11
- package/dist/tools/utils/shell.d.ts.map +1 -1
- package/dist/tools/utils/shell.js +10 -78
- package/dist/tools/utils/shell.js.map +1 -1
- package/dist/tools/utils/tool-result.d.ts +0 -3
- package/dist/tools/utils/tool-result.d.ts.map +1 -1
- package/dist/tools/utils/tool-result.js +4 -4
- package/dist/tools/utils/tool-result.js.map +1 -1
- package/dist/tools/web-search/index.d.ts +4 -0
- package/dist/tools/web-search/index.d.ts.map +1 -0
- package/dist/tools/web-search/index.js +3 -0
- package/dist/tools/web-search/index.js.map +1 -0
- package/dist/tools/web-search/tools.d.ts +17 -0
- package/dist/tools/web-search/tools.d.ts.map +1 -0
- package/dist/tools/web-search/tools.js +81 -0
- package/dist/tools/web-search/tools.js.map +1 -0
- package/dist/tools/web-search/types.d.ts +16 -0
- package/dist/tools/web-search/types.d.ts.map +1 -0
- package/dist/tools/web-search/types.js +29 -0
- package/dist/tools/web-search/types.js.map +1 -0
- package/dist/tools/workspace-middleware.d.ts +14 -0
- package/dist/tools/workspace-middleware.d.ts.map +1 -0
- package/dist/tools/workspace-middleware.js +97 -0
- package/dist/tools/workspace-middleware.js.map +1 -0
- package/dist/types/agent.d.ts +1 -66
- package/dist/types/agent.d.ts.map +1 -1
- package/dist/types/agent.js +0 -6
- package/dist/types/agent.js.map +1 -1
- package/dist/types/index.d.ts +4 -3
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types/index.js +3 -3
- package/dist/types/index.js.map +1 -1
- package/dist/types/lifecycle.d.ts +0 -141
- package/dist/types/lifecycle.d.ts.map +1 -1
- package/dist/types/lifecycle.js +4 -54
- package/dist/types/lifecycle.js.map +1 -1
- package/dist/types/streaming.d.ts +0 -4
- package/dist/types/streaming.d.ts.map +1 -1
- package/dist/types/streaming.js +0 -4
- package/dist/types/streaming.js.map +1 -1
- package/dist/usage-limits.d.ts +0 -37
- package/dist/usage-limits.d.ts.map +1 -1
- package/dist/usage-limits.js +1 -40
- package/dist/usage-limits.js.map +1 -1
- package/dist/workflow/durable-tool.d.ts +0 -84
- package/dist/workflow/durable-tool.d.ts.map +1 -1
- package/dist/workflow/durable-tool.js +2 -104
- package/dist/workflow/durable-tool.js.map +1 -1
- package/dist/workflow/hooks.d.ts +0 -215
- package/dist/workflow/hooks.d.ts.map +1 -1
- package/dist/workflow/hooks.js +15 -221
- package/dist/workflow/hooks.js.map +1 -1
- package/dist/workflow/index.d.ts +0 -9
- package/dist/workflow/index.d.ts.map +1 -1
- package/dist/workflow/index.js +0 -12
- package/dist/workflow/index.js.map +1 -1
- package/dist/workflow/utils.d.ts +0 -24
- package/dist/workflow/utils.d.ts.map +1 -1
- package/dist/workflow/utils.js +1 -32
- package/dist/workflow/utils.js.map +1 -1
- package/dist/wrappers/best-of-n.d.ts +0 -35
- package/dist/wrappers/best-of-n.d.ts.map +1 -1
- package/dist/wrappers/best-of-n.js +4 -53
- package/dist/wrappers/best-of-n.js.map +1 -1
- package/dist/wrappers/refine-loop.d.ts +36 -0
- package/dist/wrappers/refine-loop.d.ts.map +1 -0
- package/dist/wrappers/refine-loop.js +135 -0
- package/dist/wrappers/refine-loop.js.map +1 -0
- package/package.json +14 -8
|
@@ -1,17 +1,13 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @fileoverview Tool
|
|
2
|
+
* @fileoverview Tool preset registry for the SDK.
|
|
3
|
+
* Manages built-in and custom tool presets, allowing for flexible tool selection
|
|
4
|
+
* based on predefined configurations like 'minimal', 'standard', or 'full'.
|
|
3
5
|
*/
|
|
4
6
|
import { createLogger } from '@agntk/logger';
|
|
5
7
|
import { getConfig } from '../config/index.js';
|
|
6
8
|
const log = createLogger('@agntk/core:presets');
|
|
7
|
-
// ============================================================================
|
|
8
|
-
// Registry State
|
|
9
|
-
// ============================================================================
|
|
10
9
|
const presetRegistry = new Map();
|
|
11
10
|
let configPresetsLoaded = false;
|
|
12
|
-
// ============================================================================
|
|
13
|
-
// Built-in Presets
|
|
14
|
-
// ============================================================================
|
|
15
11
|
const BUILT_IN_PRESETS = {
|
|
16
12
|
none: {
|
|
17
13
|
include: [],
|
|
@@ -22,11 +18,20 @@ const BUILT_IN_PRESETS = {
|
|
|
22
18
|
description: 'Glob for file search only',
|
|
23
19
|
},
|
|
24
20
|
standard: {
|
|
25
|
-
include: ['glob', 'grep', 'shell', 'plan', 'deep_reasoning'],
|
|
26
|
-
description: 'Glob, grep, shell, plan, deep_reasoning',
|
|
21
|
+
include: ['glob', 'grep', 'shell', 'web_search', 'plan', 'deep_reasoning'],
|
|
22
|
+
description: 'Glob, grep, shell, web_search, plan, deep_reasoning',
|
|
27
23
|
},
|
|
28
24
|
full: {
|
|
29
|
-
include: [
|
|
25
|
+
include: [
|
|
26
|
+
'glob',
|
|
27
|
+
'grep',
|
|
28
|
+
'shell',
|
|
29
|
+
'web_search',
|
|
30
|
+
'plan',
|
|
31
|
+
'deep_reasoning',
|
|
32
|
+
'ast_grep_search',
|
|
33
|
+
'ast_grep_replace',
|
|
34
|
+
],
|
|
30
35
|
description: 'All standard tools plus AST-grep',
|
|
31
36
|
},
|
|
32
37
|
readonly: {
|
|
@@ -35,52 +40,31 @@ const BUILT_IN_PRESETS = {
|
|
|
35
40
|
description: 'Read-only tools without shell access',
|
|
36
41
|
},
|
|
37
42
|
};
|
|
38
|
-
// ============================================================================
|
|
39
|
-
// Registry Functions
|
|
40
|
-
// ============================================================================
|
|
41
|
-
/**
|
|
42
|
-
* Register a preset in the registry.
|
|
43
|
-
*/
|
|
44
43
|
export function registerPreset(name, definition) {
|
|
45
44
|
log.debug('Registering preset', { name, include: definition.include?.length ?? 0 });
|
|
46
45
|
presetRegistry.set(name, definition);
|
|
47
46
|
}
|
|
48
|
-
/**
|
|
49
|
-
* Get a preset from the registry.
|
|
50
|
-
*/
|
|
51
47
|
export function getPreset(name) {
|
|
52
48
|
loadConfigPresets();
|
|
53
|
-
// Check registry first
|
|
54
49
|
if (presetRegistry.has(name)) {
|
|
55
50
|
return presetRegistry.get(name);
|
|
56
51
|
}
|
|
57
|
-
// Fall back to built-in
|
|
58
52
|
if (name in BUILT_IN_PRESETS) {
|
|
59
53
|
return BUILT_IN_PRESETS[name];
|
|
60
54
|
}
|
|
61
|
-
// Default to standard
|
|
62
55
|
log.warn('Unknown preset, using standard', { preset: name });
|
|
63
56
|
return BUILT_IN_PRESETS.standard;
|
|
64
57
|
}
|
|
65
|
-
/**
|
|
66
|
-
* Get all registered preset names.
|
|
67
|
-
*/
|
|
68
58
|
export function getAllPresetNames() {
|
|
69
59
|
loadConfigPresets();
|
|
70
60
|
const builtIn = Object.keys(BUILT_IN_PRESETS);
|
|
71
61
|
const custom = Array.from(presetRegistry.keys());
|
|
72
62
|
return [...new Set([...builtIn, ...custom])];
|
|
73
63
|
}
|
|
74
|
-
/**
|
|
75
|
-
* Check if a preset exists.
|
|
76
|
-
*/
|
|
77
64
|
export function hasPreset(name) {
|
|
78
65
|
loadConfigPresets();
|
|
79
66
|
return presetRegistry.has(name) || name in BUILT_IN_PRESETS;
|
|
80
67
|
}
|
|
81
|
-
// ============================================================================
|
|
82
|
-
// Config Loading
|
|
83
|
-
// ============================================================================
|
|
84
68
|
function loadConfigPresets() {
|
|
85
69
|
if (configPresetsLoaded)
|
|
86
70
|
return;
|
|
@@ -96,9 +80,6 @@ function loadConfigPresets() {
|
|
|
96
80
|
registerPreset(name, presetConfig);
|
|
97
81
|
}
|
|
98
82
|
}
|
|
99
|
-
/**
|
|
100
|
-
* Reset the registry (for testing).
|
|
101
|
-
*/
|
|
102
83
|
export function resetPresetRegistry() {
|
|
103
84
|
presetRegistry.clear();
|
|
104
85
|
configPresetsLoaded = false;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tool-preset-registry.js","sourceRoot":"","sources":["../../src/presets/tool-preset-registry.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"tool-preset-registry.js","sourceRoot":"","sources":["../../src/presets/tool-preset-registry.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,OAAO,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AAC7C,OAAO,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;AAEtC,MAAM,GAAG,GAAG,YAAY,CAAC,qBAAqB,CAAC,CAAC;AAUhD,MAAM,cAAc,GAAG,IAAI,GAAG,EAAgC,CAAC;AAC/D,IAAI,mBAAmB,GAAG,KAAK,CAAC;AAEhC,MAAM,gBAAgB,GAAyC;IAC7D,IAAI,EAAE;QACJ,OAAO,EAAE,EAAE;QACX,WAAW,EAAE,UAAU;KACxB;IACD,OAAO,EAAE;QACP,OAAO,EAAE,CAAC,MAAM,CAAC;QACjB,WAAW,EAAE,2BAA2B;KACzC;IACD,QAAQ,EAAE;QACR,OAAO,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,YAAY,EAAE,MAAM,EAAE,gBAAgB,CAAC;QAC1E,WAAW,EAAE,qDAAqD;KACnE;IACD,IAAI,EAAE;QACJ,OAAO,EAAE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CAAC,GAAG,OAAO,EAAE,GAAG,MAAM,CAAC,CAAC,CAAC,CAAC;AAC/C,CAAC;AAED,MAAM,UAAU,SAAS,CAAC,IAAY;IACpC,iBAAiB,EAAE,CAAC;IACpB,OAAO,cAAc,CAAC,GAAG,CAAC,IAAI,CAAC,IAAI,IAAI,IAAI,gBAAgB,CAAC;AAC9D,CAAC;AAED,SAAS,iBAAiB;IACxB,IAAI,mBAAmB;QAAE,OAAO;IAChC,mBAAmB,GAAG,IAAI,CAAC;IAE3B,MAAM,MAAM,GAAG,SAAS,EAAE,CAAC;IAC3B,MAAM,OAAO,GAAI,MAAkC,CAAC,WAEvC,CAAC;IAEd,IAAI,CAAC,OAAO;QAAE,OAAO;IAErB,KAAK,MAAM,CAAC,IAAI,EAAE,YAAY,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,OAAO,CAAC,EAAE,CAAC;QAC3D,IAAI,CAAC,YAAY;YAAE,SAAS;QAE5B,GAAG,CAAC,IAAI,CAAC,4BAA4B,EAAE,EAAE,IAAI,EAAE,CAAC,CAAC;QACjD,cAAc,CAAC,IAAI,EAAE,YAAY,CAAC,CAAC;IACrC,CAAC;AACH,CAAC;AAED,MAAM,UAAU,mBAAmB;IACjC,cAAc,CAAC,KAAK,EAAE,CAAC;IACvB,mBAAmB,GAAG,KAAK,CAAC;AAC9B,CAAC;AAED,OAAO,EAAE,gBAAgB,EAAE,CAAC"}
|
package/dist/presets/tools.d.ts
CHANGED
|
@@ -1,20 +1,12 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @fileoverview Tool presets for different agent configurations.
|
|
3
|
-
* Provides none, minimal, standard, and full tool sets.
|
|
4
|
-
*/
|
|
5
1
|
import { type PlanToolConfig } from '../tools/plan/index.js';
|
|
2
|
+
import { type FileToolOptions } from '../tools/file/index.js';
|
|
6
3
|
export type ToolPresetLevel = 'none' | 'minimal' | 'standard' | 'full';
|
|
7
4
|
export interface ToolPresetOptions {
|
|
8
|
-
/** Override default workspace root */
|
|
9
5
|
workspaceRoot?: string;
|
|
10
|
-
/** Plan tool config */
|
|
11
6
|
planConfig?: PlanToolConfig;
|
|
12
|
-
/** Additional custom tools to include */
|
|
13
7
|
customTools?: Record<string, unknown>;
|
|
8
|
+
fileOptions?: FileToolOptions;
|
|
14
9
|
}
|
|
15
|
-
/**
|
|
16
|
-
* Create tool presets based on the selected level.
|
|
17
|
-
*/
|
|
18
10
|
export declare function createToolPreset(preset: ToolPresetLevel, options?: ToolPresetOptions): {
|
|
19
11
|
[x: string]: unknown;
|
|
20
12
|
} | {
|
|
@@ -27,25 +19,25 @@ export declare function createToolPreset(preset: ToolPresetLevel, options?: Tool
|
|
|
27
19
|
} | {
|
|
28
20
|
shell: import("ai").Tool<{
|
|
29
21
|
command: string;
|
|
30
|
-
timeout?: number | undefined;
|
|
31
22
|
cwd?: string | undefined;
|
|
23
|
+
timeout?: number | undefined;
|
|
32
24
|
allow?: boolean | undefined;
|
|
33
25
|
stream?: boolean | undefined;
|
|
34
26
|
}, string>;
|
|
35
27
|
background: import("ai").Tool<{
|
|
36
28
|
operation: "status" | "output" | "start" | "stop" | "list";
|
|
37
|
-
cwd?: string | undefined;
|
|
38
|
-
env?: Record<string, string> | undefined;
|
|
39
29
|
command?: string | undefined;
|
|
40
30
|
sessionId?: string | undefined;
|
|
31
|
+
cwd?: string | undefined;
|
|
32
|
+
env?: Record<string, string> | undefined;
|
|
41
33
|
}, string>;
|
|
42
34
|
plan: import("ai").Tool<{
|
|
43
35
|
action: "create" | "decide" | "update_status" | "add_note" | "add_step" | "view";
|
|
44
|
-
steps?: string[] | undefined;
|
|
45
36
|
title?: string | undefined;
|
|
46
|
-
|
|
37
|
+
steps?: string[] | undefined;
|
|
47
38
|
decision?: "delegate" | "proceed" | undefined;
|
|
48
39
|
stepName?: string | undefined;
|
|
40
|
+
status?: "blocked" | "completed" | "pending" | "in_progress" | undefined;
|
|
49
41
|
note?: string | undefined;
|
|
50
42
|
}, string>;
|
|
51
43
|
deep_reasoning: import("ai").Tool<{
|
|
@@ -59,6 +51,13 @@ export declare function createToolPreset(preset: ToolPresetLevel, options?: Tool
|
|
|
59
51
|
branchId?: string | undefined;
|
|
60
52
|
needsMoreThoughts?: boolean | undefined;
|
|
61
53
|
}, string>;
|
|
54
|
+
web_search: import("ai").Tool<{
|
|
55
|
+
query: string;
|
|
56
|
+
maxResults?: number | undefined;
|
|
57
|
+
timeRange?: "day" | "week" | "month" | "year" | undefined;
|
|
58
|
+
extractContent?: boolean | undefined;
|
|
59
|
+
extractTop?: number | undefined;
|
|
60
|
+
}, string>;
|
|
62
61
|
search_skills: import("ai").Tool<{
|
|
63
62
|
query: string;
|
|
64
63
|
limit?: number | undefined;
|
|
@@ -83,8 +82,8 @@ export declare function createToolPreset(preset: ToolPresetLevel, options?: Tool
|
|
|
83
82
|
}, string>;
|
|
84
83
|
grep: import("ai").Tool<{
|
|
85
84
|
pattern: string;
|
|
86
|
-
path?: string | undefined;
|
|
87
85
|
include?: string | undefined;
|
|
86
|
+
path?: string | undefined;
|
|
88
87
|
context?: number | undefined;
|
|
89
88
|
caseSensitive?: boolean | undefined;
|
|
90
89
|
wholeWord?: boolean | undefined;
|
|
@@ -109,17 +108,17 @@ export declare function createToolPreset(preset: ToolPresetLevel, options?: Tool
|
|
|
109
108
|
action: "dblclick";
|
|
110
109
|
selector: string;
|
|
111
110
|
} | {
|
|
112
|
-
text: string;
|
|
113
111
|
action: "fill";
|
|
114
112
|
selector: string;
|
|
115
|
-
} | {
|
|
116
113
|
text: string;
|
|
114
|
+
} | {
|
|
117
115
|
action: "type";
|
|
118
116
|
selector: string;
|
|
117
|
+
text: string;
|
|
119
118
|
} | {
|
|
120
|
-
value: string;
|
|
121
119
|
action: "select";
|
|
122
120
|
selector: string;
|
|
121
|
+
value: string;
|
|
123
122
|
} | {
|
|
124
123
|
action: "press";
|
|
125
124
|
key: string;
|
|
@@ -143,10 +142,10 @@ export declare function createToolPreset(preset: ToolPresetLevel, options?: Tool
|
|
|
143
142
|
action: "getTitle";
|
|
144
143
|
} | {
|
|
145
144
|
action: "wait";
|
|
146
|
-
text?: string | undefined;
|
|
147
|
-
url?: string | undefined;
|
|
148
145
|
selector?: string | undefined;
|
|
149
146
|
ms?: number | undefined;
|
|
147
|
+
text?: string | undefined;
|
|
148
|
+
url?: string | undefined;
|
|
150
149
|
load?: "load" | "domcontentloaded" | "networkidle" | undefined;
|
|
151
150
|
} | {
|
|
152
151
|
action: "eval";
|
|
@@ -160,52 +159,52 @@ export declare function createToolPreset(preset: ToolPresetLevel, options?: Tool
|
|
|
160
159
|
} | {
|
|
161
160
|
action: "close";
|
|
162
161
|
}, string>;
|
|
163
|
-
progress_read: import("ai").Tool<
|
|
162
|
+
progress_read: import("ai").Tool<Record<string, never>, string>;
|
|
164
163
|
progress_update: import("ai").Tool<{
|
|
165
|
-
action?: string | undefined;
|
|
166
|
-
sessionId?: string | undefined;
|
|
167
164
|
featureId?: string | undefined;
|
|
168
165
|
featureName?: string | undefined;
|
|
169
166
|
featureStatus?: "blocked" | "completed" | "pending" | "in_progress" | undefined;
|
|
170
167
|
featureDescription?: string | undefined;
|
|
171
168
|
featureNotes?: string | undefined;
|
|
169
|
+
sessionId?: string | undefined;
|
|
170
|
+
action?: string | undefined;
|
|
172
171
|
}, string>;
|
|
173
172
|
ast_grep_search: import("ai").Tool<{
|
|
174
173
|
pattern: string;
|
|
175
174
|
lang: string;
|
|
176
|
-
context?: number | undefined;
|
|
177
175
|
paths?: string[] | undefined;
|
|
178
176
|
globs?: string[] | undefined;
|
|
177
|
+
context?: number | undefined;
|
|
179
178
|
}, string>;
|
|
180
179
|
ast_grep_replace: import("ai").Tool<{
|
|
181
180
|
pattern: string;
|
|
182
|
-
lang: string;
|
|
183
181
|
rewrite: string;
|
|
182
|
+
lang: string;
|
|
184
183
|
dryRun: boolean;
|
|
185
184
|
paths?: string[] | undefined;
|
|
186
185
|
globs?: string[] | undefined;
|
|
187
186
|
}, string>;
|
|
188
187
|
shell: import("ai").Tool<{
|
|
189
188
|
command: string;
|
|
190
|
-
timeout?: number | undefined;
|
|
191
189
|
cwd?: string | undefined;
|
|
190
|
+
timeout?: number | undefined;
|
|
192
191
|
allow?: boolean | undefined;
|
|
193
192
|
stream?: boolean | undefined;
|
|
194
193
|
}, string>;
|
|
195
194
|
background: import("ai").Tool<{
|
|
196
195
|
operation: "status" | "output" | "start" | "stop" | "list";
|
|
197
|
-
cwd?: string | undefined;
|
|
198
|
-
env?: Record<string, string> | undefined;
|
|
199
196
|
command?: string | undefined;
|
|
200
197
|
sessionId?: string | undefined;
|
|
198
|
+
cwd?: string | undefined;
|
|
199
|
+
env?: Record<string, string> | undefined;
|
|
201
200
|
}, string>;
|
|
202
201
|
plan: import("ai").Tool<{
|
|
203
202
|
action: "create" | "decide" | "update_status" | "add_note" | "add_step" | "view";
|
|
204
|
-
steps?: string[] | undefined;
|
|
205
203
|
title?: string | undefined;
|
|
206
|
-
|
|
204
|
+
steps?: string[] | undefined;
|
|
207
205
|
decision?: "delegate" | "proceed" | undefined;
|
|
208
206
|
stepName?: string | undefined;
|
|
207
|
+
status?: "blocked" | "completed" | "pending" | "in_progress" | undefined;
|
|
209
208
|
note?: string | undefined;
|
|
210
209
|
}, string>;
|
|
211
210
|
deep_reasoning: import("ai").Tool<{
|
|
@@ -219,6 +218,13 @@ export declare function createToolPreset(preset: ToolPresetLevel, options?: Tool
|
|
|
219
218
|
branchId?: string | undefined;
|
|
220
219
|
needsMoreThoughts?: boolean | undefined;
|
|
221
220
|
}, string>;
|
|
221
|
+
web_search: import("ai").Tool<{
|
|
222
|
+
query: string;
|
|
223
|
+
maxResults?: number | undefined;
|
|
224
|
+
timeRange?: "day" | "week" | "month" | "year" | undefined;
|
|
225
|
+
extractContent?: boolean | undefined;
|
|
226
|
+
extractTop?: number | undefined;
|
|
227
|
+
}, string>;
|
|
222
228
|
search_skills: import("ai").Tool<{
|
|
223
229
|
query: string;
|
|
224
230
|
limit?: number | undefined;
|
|
@@ -243,8 +249,8 @@ export declare function createToolPreset(preset: ToolPresetLevel, options?: Tool
|
|
|
243
249
|
}, string>;
|
|
244
250
|
grep: import("ai").Tool<{
|
|
245
251
|
pattern: string;
|
|
246
|
-
path?: string | undefined;
|
|
247
252
|
include?: string | undefined;
|
|
253
|
+
path?: string | undefined;
|
|
248
254
|
context?: number | undefined;
|
|
249
255
|
caseSensitive?: boolean | undefined;
|
|
250
256
|
wholeWord?: boolean | undefined;
|
|
@@ -256,10 +262,6 @@ export declare function createToolPreset(preset: ToolPresetLevel, options?: Tool
|
|
|
256
262
|
hidden?: boolean | undefined;
|
|
257
263
|
}, string>;
|
|
258
264
|
};
|
|
259
|
-
/**
|
|
260
|
-
* Static preset definitions for reference.
|
|
261
|
-
* Use createToolPreset() for actual tool creation.
|
|
262
|
-
*/
|
|
263
265
|
export declare const toolPresets: {
|
|
264
266
|
readonly none: Record<string, never>;
|
|
265
267
|
readonly minimal: {
|
|
@@ -267,12 +269,12 @@ export declare const toolPresets: {
|
|
|
267
269
|
readonly tools: readonly ["glob"];
|
|
268
270
|
};
|
|
269
271
|
readonly standard: {
|
|
270
|
-
readonly description: "Glob, grep, shell, background, file tools, search_skills, plan, deep_reasoning";
|
|
271
|
-
readonly tools: readonly ["glob", "grep", "shell", "background", "file_read", "file_write", "file_edit", "file_create", "search_skills", "plan", "deep_reasoning"];
|
|
272
|
+
readonly description: "Glob, grep, shell, background, file tools, search_skills, web_search, plan, deep_reasoning";
|
|
273
|
+
readonly tools: readonly ["glob", "grep", "shell", "background", "file_read", "file_write", "file_edit", "file_create", "search_skills", "web_search", "plan", "deep_reasoning"];
|
|
272
274
|
};
|
|
273
275
|
readonly full: {
|
|
274
276
|
readonly description: "All standard tools plus AST-grep, progress tracking, and browser automation";
|
|
275
|
-
readonly tools: readonly ["glob", "grep", "shell", "background", "file_read", "file_write", "file_edit", "file_create", "progress_read", "progress_update", "search_skills", "plan", "deep_reasoning", "ast_grep_search", "ast_grep_replace", "browser"];
|
|
277
|
+
readonly tools: readonly ["glob", "grep", "shell", "background", "file_read", "file_write", "file_edit", "file_create", "progress_read", "progress_update", "search_skills", "web_search", "plan", "deep_reasoning", "ast_grep_search", "ast_grep_replace", "browser"];
|
|
276
278
|
};
|
|
277
279
|
};
|
|
278
280
|
//# sourceMappingURL=tools.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tools.d.ts","sourceRoot":"","sources":["../../src/presets/tools.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"tools.d.ts","sourceRoot":"","sources":["../../src/presets/tools.ts"],"names":[],"mappings":"AASA,OAAO,EAAkB,KAAK,cAAc,EAAE,MAAM,eAAe,CAAC;AAGpE,OAAO,EAAmB,KAAK,eAAe,EAAE,MAAM,eAAe,CAAC;AAKtE,MAAM,MAAM,eAAe,GAAG,MAAM,GAAG,SAAS,GAAG,UAAU,GAAG,MAAM,CAAC;AAEvE,MAAM,WAAW,iBAAiB;IAChC,aAAa,CAAC,EAAE,MAAM,CAAC;IAEvB,UAAU,CAAC,EAAE,cAAc,CAAC;IAE5B,WAAW,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAEtC,WAAW,CAAC,EAAE,eAAe,CAAC;CAC/B;AAED,wBAAgB,gBAAgB,CAAC,MAAM,EAAE,eAAe,EAAE,OAAO,GAAE,iBAAsB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA4BxF;AAyCD,eAAO,MAAM,WAAW;mBACV,MAAM,CAAC,MAAM,EAAE,KAAK,CAAC;;;;;;;;;;;;;CAgDzB,CAAC"}
|
package/dist/presets/tools.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @fileoverview Tool
|
|
3
|
-
* Provides
|
|
2
|
+
* @fileoverview Tool preset definitions for the SDK.
|
|
3
|
+
* Provides factories and configurations for grouping tools into functional sets
|
|
4
|
+
* such as 'minimal', 'standard', and 'full'.
|
|
4
5
|
*/
|
|
5
6
|
import { createGlobTool } from '../tools/glob/index.js';
|
|
6
7
|
import { createGrepTool } from '../tools/grep/index.js';
|
|
@@ -12,14 +13,9 @@ import { createBrowserTool } from '../tools/browser/index.js';
|
|
|
12
13
|
import { createFileTools } from '../tools/file/index.js';
|
|
13
14
|
import { createProgressTools } from '../tools/progress/index.js';
|
|
14
15
|
import { createSearchSkillsTool } from '../tools/search-skills.js';
|
|
15
|
-
|
|
16
|
-
// Preset Definitions
|
|
17
|
-
// ═══════════════════════════════════════════════════════════════════════════════
|
|
18
|
-
/**
|
|
19
|
-
* Create tool presets based on the selected level.
|
|
20
|
-
*/
|
|
16
|
+
import { createWebSearchTool } from '../tools/web-search/index.js';
|
|
21
17
|
export function createToolPreset(preset, options = {}) {
|
|
22
|
-
const { workspaceRoot = process.cwd(), planConfig, customTools = {}, } = options;
|
|
18
|
+
const { workspaceRoot = process.cwd(), planConfig, customTools = {}, fileOptions } = options;
|
|
23
19
|
switch (preset) {
|
|
24
20
|
case 'none':
|
|
25
21
|
return { ...customTools };
|
|
@@ -30,66 +26,45 @@ export function createToolPreset(preset, options = {}) {
|
|
|
30
26
|
};
|
|
31
27
|
case 'standard':
|
|
32
28
|
return {
|
|
33
|
-
...createStandardPreset(workspaceRoot, planConfig),
|
|
29
|
+
...createStandardPreset(workspaceRoot, planConfig, fileOptions),
|
|
34
30
|
...customTools,
|
|
35
31
|
};
|
|
36
32
|
case 'full':
|
|
37
33
|
return {
|
|
38
|
-
...createFullPreset(workspaceRoot, planConfig),
|
|
34
|
+
...createFullPreset(workspaceRoot, planConfig, fileOptions),
|
|
39
35
|
...customTools,
|
|
40
36
|
};
|
|
41
37
|
default:
|
|
42
38
|
throw new Error(`Unknown tool preset: ${preset}`);
|
|
43
39
|
}
|
|
44
40
|
}
|
|
45
|
-
// ═══════════════════════════════════════════════════════════════════════════════
|
|
46
|
-
// Preset Implementations
|
|
47
|
-
// ═══════════════════════════════════════════════════════════════════════════════
|
|
48
|
-
/**
|
|
49
|
-
* Minimal preset: Glob for file search.
|
|
50
|
-
* Good for pure analysis tasks without mutations.
|
|
51
|
-
*/
|
|
52
41
|
function createMinimalPreset() {
|
|
53
42
|
return createGlobTool();
|
|
54
43
|
}
|
|
55
|
-
|
|
56
|
-
* Standard preset: Glob, grep, shell, plan, deep_reasoning.
|
|
57
|
-
* Good for most development tasks.
|
|
58
|
-
*/
|
|
59
|
-
function createStandardPreset(workspaceRoot, planConfig) {
|
|
44
|
+
function createStandardPreset(workspaceRoot, planConfig, fileOptions) {
|
|
60
45
|
const shell = createShellTool(workspaceRoot);
|
|
61
46
|
const plan = createPlanTool(planConfig ?? {});
|
|
62
47
|
const deep_reasoning = createDeepReasoningTool();
|
|
63
48
|
return {
|
|
64
49
|
...createGlobTool(),
|
|
65
50
|
...createGrepTool(),
|
|
66
|
-
...createFileTools(workspaceRoot),
|
|
51
|
+
...createFileTools(workspaceRoot, fileOptions),
|
|
67
52
|
...createSearchSkillsTool(),
|
|
53
|
+
...createWebSearchTool(),
|
|
68
54
|
shell,
|
|
69
55
|
background: createBackgroundTool(),
|
|
70
56
|
plan,
|
|
71
57
|
deep_reasoning,
|
|
72
58
|
};
|
|
73
59
|
}
|
|
74
|
-
|
|
75
|
-
* Full preset: All standard tools + AST-grep, progress tracking, and browser.
|
|
76
|
-
* Good for complex, multi-agent tasks.
|
|
77
|
-
*/
|
|
78
|
-
function createFullPreset(workspaceRoot, planConfig) {
|
|
60
|
+
function createFullPreset(workspaceRoot, planConfig, fileOptions) {
|
|
79
61
|
return {
|
|
80
|
-
...createStandardPreset(workspaceRoot, planConfig),
|
|
62
|
+
...createStandardPreset(workspaceRoot, planConfig, fileOptions),
|
|
81
63
|
...createAstGrepTools(),
|
|
82
64
|
...createProgressTools(workspaceRoot),
|
|
83
65
|
browser: createBrowserTool(),
|
|
84
66
|
};
|
|
85
67
|
}
|
|
86
|
-
// ═══════════════════════════════════════════════════════════════════════════════
|
|
87
|
-
// Static Presets (for quick reference)
|
|
88
|
-
// ═══════════════════════════════════════════════════════════════════════════════
|
|
89
|
-
/**
|
|
90
|
-
* Static preset definitions for reference.
|
|
91
|
-
* Use createToolPreset() for actual tool creation.
|
|
92
|
-
*/
|
|
93
68
|
export const toolPresets = {
|
|
94
69
|
none: {},
|
|
95
70
|
minimal: {
|
|
@@ -97,12 +72,43 @@ export const toolPresets = {
|
|
|
97
72
|
tools: ['glob'],
|
|
98
73
|
},
|
|
99
74
|
standard: {
|
|
100
|
-
description: 'Glob, grep, shell, background, file tools, search_skills, plan, deep_reasoning',
|
|
101
|
-
tools: [
|
|
75
|
+
description: 'Glob, grep, shell, background, file tools, search_skills, web_search, plan, deep_reasoning',
|
|
76
|
+
tools: [
|
|
77
|
+
'glob',
|
|
78
|
+
'grep',
|
|
79
|
+
'shell',
|
|
80
|
+
'background',
|
|
81
|
+
'file_read',
|
|
82
|
+
'file_write',
|
|
83
|
+
'file_edit',
|
|
84
|
+
'file_create',
|
|
85
|
+
'search_skills',
|
|
86
|
+
'web_search',
|
|
87
|
+
'plan',
|
|
88
|
+
'deep_reasoning',
|
|
89
|
+
],
|
|
102
90
|
},
|
|
103
91
|
full: {
|
|
104
92
|
description: 'All standard tools plus AST-grep, progress tracking, and browser automation',
|
|
105
|
-
tools: [
|
|
93
|
+
tools: [
|
|
94
|
+
'glob',
|
|
95
|
+
'grep',
|
|
96
|
+
'shell',
|
|
97
|
+
'background',
|
|
98
|
+
'file_read',
|
|
99
|
+
'file_write',
|
|
100
|
+
'file_edit',
|
|
101
|
+
'file_create',
|
|
102
|
+
'progress_read',
|
|
103
|
+
'progress_update',
|
|
104
|
+
'search_skills',
|
|
105
|
+
'web_search',
|
|
106
|
+
'plan',
|
|
107
|
+
'deep_reasoning',
|
|
108
|
+
'ast_grep_search',
|
|
109
|
+
'ast_grep_replace',
|
|
110
|
+
'browser',
|
|
111
|
+
],
|
|
106
112
|
},
|
|
107
113
|
};
|
|
108
114
|
//# sourceMappingURL=tools.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tools.js","sourceRoot":"","sources":["../../src/presets/tools.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"tools.js","sourceRoot":"","sources":["../../src/presets/tools.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,OAAO,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AAC/C,OAAO,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AAC/C,OAAO,EAAE,kBAAkB,EAAE,MAAM,mBAAmB,CAAC;AACvD,OAAO,EAAE,eAAe,EAAE,oBAAoB,EAAE,MAAM,gBAAgB,CAAC;AACvE,OAAO,EAAE,cAAc,EAAuB,MAAM,eAAe,CAAC;AACpE,OAAO,EAAE,uBAAuB,EAAE,MAAM,yBAAyB,CAAC;AAClE,OAAO,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AACrD,OAAO,EAAE,eAAe,EAAwB,MAAM,eAAe,CAAC;AACtE,OAAO,EAAE,mBAAmB,EAAE,MAAM,mBAAmB,CAAC;AACxD,OAAO,EAAE,sBAAsB,EAAE,MAAM,wBAAwB,CAAC;AAChE,OAAO,EAAE,mBAAmB,EAAE,MAAM,qBAAqB,CAAC;AAc1D,MAAM,UAAU,gBAAgB,CAAC,MAAuB,EAAE,UAA6B,EAAE;IACvF,MAAM,EAAE,aAAa,GAAG,OAAO,CAAC,GAAG,EAAE,EAAE,UAAU,EAAE,WAAW,GAAG,EAAE,EAAE,WAAW,EAAE,GAAG,OAAO,CAAC;IAE7F,QAAQ,MAAM,EAAE,CAAC;Q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QACrC,OAAO,EAAE,iBAAiB,EAAE;KAC7B,CAAC;AACJ,CAAC;AAED,MAAM,CAAC,MAAM,WAAW,GAAG;IACzB,IAAI,EAAE,EAA2B;IAEjC,OAAO,EAAE;QACP,WAAW,EAAE,uBAAuB;QACpC,KAAK,EAAE,CAAC,MAAM,CAAC;KAChB;IAED,QAAQ,EAAE;QACR,WAAW,EACT,4FAA4F;QAC9F,KAAK,EAAE;YACL,MAAM;YACN,MAAM;YACN,OAAO;YACP,YAAY;YACZ,WAAW;YACX,YAAY;YACZ,WAAW;YACX,aAAa;YACb,eAAe;YACf,YAAY;YACZ,MAAM;YACN,gBAAgB;SACjB;KACF;IAED,IAAI,EAAE;QACJ,WAAW,EAAE,6EAA6E;QAC1F,KAAK,EAAE;YACL,MAAM;YACN,MAAM;YACN,OAAO;YACP,YAAY;YACZ,WAAW;YACX,YAAY;YACZ,WAAW;YACX,aAAa;YACb,eAAe;YACf,iBAAiB;YACjB,eAAe;YACf,YAAY;YACZ,MAAM;YACN,gBAAgB;YAChB,iBAAiB;YACjB,kBAAkB;YAClB,SAAS;SACV;KACF;CACO,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"context.d.ts","sourceRoot":"","sources":["../../src/prompts/context.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"context.d.ts","sourceRoot":"","sources":["../../src/prompts/context.ts"],"names":[],"mappings":"AAOA,MAAM,WAAW,YAAY;IAC3B,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAED,MAAM,WAAW,eAAe;IAC9B,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,kBAAkB,CAAC,EAAE,SAAS,GAAG,UAAU,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