@travisennis/acai 0.0.12 → 0.0.14
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 +5 -2
- package/dist/agent/index.d.ts.map +1 -1
- package/dist/agent/index.js +91 -5
- package/dist/commands/history/types.d.ts +3 -2
- package/dist/commands/history/types.d.ts.map +1 -1
- package/dist/commands/init-project/utils.d.ts +0 -1
- package/dist/commands/init-project/utils.d.ts.map +1 -1
- package/dist/commands/init-project/utils.js +1 -1
- package/dist/commands/manager.d.ts.map +1 -1
- package/dist/commands/manager.js +0 -18
- package/dist/commands/share/html-renderer.d.ts.map +1 -1
- package/dist/commands/share/html-renderer.js +54 -48
- package/dist/commands/tools/index.js +39 -38
- package/dist/config/index.d.ts +0 -2
- package/dist/config/index.d.ts.map +1 -1
- package/dist/config/index.js +3 -7
- package/dist/index.d.ts +14 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +94 -76
- package/dist/models/manager.d.ts +1 -10
- package/dist/models/manager.d.ts.map +1 -1
- package/dist/models/manager.js +2 -2
- package/dist/models/opencode-go-provider.d.ts +6 -4
- package/dist/models/opencode-go-provider.d.ts.map +1 -1
- package/dist/models/opencode-go-provider.js +55 -35
- package/dist/models/providers.d.ts +1 -1
- package/dist/models/providers.d.ts.map +1 -1
- package/dist/prompts/system-prompt.d.ts +0 -2
- package/dist/prompts/system-prompt.d.ts.map +1 -1
- package/dist/prompts/system-prompt.js +6 -10
- package/dist/repl/index.d.ts +27 -11
- package/dist/repl/index.d.ts.map +1 -1
- package/dist/repl/index.js +238 -254
- package/dist/sessions/manager.d.ts +41 -0
- package/dist/sessions/manager.d.ts.map +1 -1
- package/dist/sessions/manager.js +53 -0
- package/dist/sessions/summary.d.ts.map +1 -1
- package/dist/sessions/summary.js +18 -0
- package/dist/skills/index.d.ts +12 -2
- package/dist/skills/index.d.ts.map +1 -1
- package/dist/skills/index.js +123 -73
- package/dist/terminal/control.d.ts +1 -21
- package/dist/terminal/control.d.ts.map +1 -1
- package/dist/terminal/control.js +1 -32
- package/dist/terminal/formatting.d.ts +0 -33
- package/dist/terminal/formatting.d.ts.map +1 -1
- package/dist/terminal/formatting.js +0 -91
- package/dist/terminal/highlight/theme.d.ts +0 -37
- package/dist/terminal/highlight/theme.d.ts.map +1 -1
- package/dist/terminal/highlight/theme.js +1 -79
- package/dist/terminal/keys.d.ts +0 -97
- package/dist/terminal/keys.d.ts.map +1 -1
- package/dist/terminal/keys.js +0 -194
- package/dist/terminal/select-prompt.d.ts.map +1 -1
- package/dist/terminal/select-prompt.js +65 -51
- package/dist/terminal/style.d.ts +1 -1
- package/dist/terminal/style.d.ts.map +1 -1
- package/dist/terminal/supports-color.d.ts.map +1 -1
- package/dist/terminal/supports-color.js +38 -20
- package/dist/terminal/supports-hyperlinks.d.ts +3 -0
- package/dist/terminal/supports-hyperlinks.d.ts.map +1 -1
- package/dist/terminal/supports-hyperlinks.js +72 -31
- package/dist/terminal/table/layout-manager.d.ts +0 -20
- package/dist/terminal/table/layout-manager.d.ts.map +1 -1
- package/dist/terminal/table/layout-manager.js +68 -44
- package/dist/terminal/table/utils.d.ts +0 -1
- package/dist/terminal/table/utils.d.ts.map +1 -1
- package/dist/terminal/table/utils.js +2 -4
- package/dist/tools/apply-patch.d.ts +5 -3
- package/dist/tools/apply-patch.d.ts.map +1 -1
- package/dist/tools/apply-patch.js +154 -123
- package/dist/tools/bash.d.ts.map +1 -1
- package/dist/tools/bash.js +11 -8
- package/dist/tools/dynamic-tool-loader.d.ts +6 -1
- package/dist/tools/dynamic-tool-loader.d.ts.map +1 -1
- package/dist/tools/dynamic-tool-loader.js +154 -135
- package/dist/tools/index.d.ts +3 -133
- package/dist/tools/index.d.ts.map +1 -1
- package/dist/tools/index.js +0 -20
- package/dist/tools/read-file.d.ts.map +1 -1
- package/dist/tools/read-file.js +32 -13
- package/dist/tools/skill.d.ts.map +1 -1
- package/dist/tools/skill.js +20 -13
- package/dist/tools/web-fetch.d.ts +2 -6
- package/dist/tools/web-fetch.d.ts.map +1 -1
- package/dist/tools/web-fetch.js +59 -36
- package/dist/tools/web-search.d.ts +0 -4
- package/dist/tools/web-search.d.ts.map +1 -1
- package/dist/tools/web-search.js +40 -32
- package/dist/tui/autocomplete/utils.d.ts +0 -15
- package/dist/tui/autocomplete/utils.d.ts.map +1 -1
- package/dist/tui/autocomplete/utils.js +0 -85
- package/dist/tui/autocomplete.d.ts +1 -1
- package/dist/tui/autocomplete.d.ts.map +1 -1
- package/dist/tui/autocomplete.js +1 -1
- package/dist/tui/components/editor.d.ts +12 -0
- package/dist/tui/components/editor.d.ts.map +1 -1
- package/dist/tui/components/editor.js +181 -195
- package/dist/tui/components/input.d.ts +4 -0
- package/dist/tui/components/input.d.ts.map +1 -1
- package/dist/tui/components/input.js +33 -31
- package/dist/tui/components/markdown.d.ts +30 -0
- package/dist/tui/components/markdown.d.ts.map +1 -1
- package/dist/tui/components/markdown.js +274 -242
- package/dist/tui/components/modal.d.ts.map +1 -1
- package/dist/tui/components/modal.js +11 -11
- package/dist/tui/components/select-list.d.ts +5 -0
- package/dist/tui/components/select-list.d.ts.map +1 -1
- package/dist/tui/components/select-list.js +69 -98
- package/dist/tui/components/table.d.ts +6 -0
- package/dist/tui/components/table.d.ts.map +1 -1
- package/dist/tui/components/table.js +61 -52
- package/dist/tui/index.d.ts +1 -8
- package/dist/tui/index.d.ts.map +1 -1
- package/dist/tui/index.js +0 -8
- package/dist/tui/tui.d.ts +9 -0
- package/dist/tui/tui.d.ts.map +1 -1
- package/dist/tui/tui.js +78 -48
- package/dist/tui/utils.d.ts +7 -0
- package/dist/tui/utils.d.ts.map +1 -1
- package/dist/tui/utils.js +117 -53
- package/dist/utils/bash.d.ts.map +1 -1
- package/dist/utils/bash.js +156 -104
- package/dist/utils/command-protection.d.ts +3 -6
- package/dist/utils/command-protection.d.ts.map +1 -1
- package/dist/utils/command-protection.js +213 -100
- package/dist/utils/filesystem/operations.d.ts +0 -15
- package/dist/utils/filesystem/operations.d.ts.map +1 -1
- package/dist/utils/filesystem/operations.js +1 -38
- package/dist/utils/filesystem/security.d.ts.map +1 -1
- package/dist/utils/filesystem/security.js +22 -15
- package/dist/utils/filetype-detection.d.ts +0 -1
- package/dist/utils/filetype-detection.d.ts.map +1 -1
- package/dist/utils/filetype-detection.js +0 -12
- package/dist/utils/formatting.d.ts +0 -30
- package/dist/utils/formatting.d.ts.map +1 -1
- package/dist/utils/formatting.js +0 -44
- package/dist/utils/git.d.ts +4 -6
- package/dist/utils/git.d.ts.map +1 -1
- package/dist/utils/git.js +36 -46
- package/dist/utils/ignore.d.ts +1 -1
- package/dist/utils/ignore.d.ts.map +1 -1
- package/dist/utils/ignore.js +1 -1
- package/dist/utils/process.d.ts.map +1 -1
- package/dist/utils/process.js +77 -79
- package/dist/utils/yaml.d.ts +0 -1
- package/dist/utils/yaml.d.ts.map +1 -1
- package/dist/utils/yaml.js +80 -89
- package/dist/utils/zod.d.ts +0 -3
- package/dist/utils/zod.d.ts.map +1 -1
- package/dist/utils/zod.js +0 -7
- package/package.json +25 -24
- package/dist/agent/sub-agent.d.ts +0 -23
- package/dist/agent/sub-agent.d.ts.map +0 -1
- package/dist/agent/sub-agent.js +0 -109
- package/dist/commands/add-directory/index.d.ts +0 -3
- package/dist/commands/add-directory/index.d.ts.map +0 -1
- package/dist/commands/add-directory/index.js +0 -50
- package/dist/commands/add-directory/utils.d.ts +0 -3
- package/dist/commands/add-directory/utils.d.ts.map +0 -1
- package/dist/commands/add-directory/utils.js +0 -15
- package/dist/commands/clear/index.d.ts +0 -3
- package/dist/commands/clear/index.d.ts.map +0 -1
- package/dist/commands/clear/index.js +0 -13
- package/dist/commands/generate-rules/index.d.ts +0 -3
- package/dist/commands/generate-rules/index.d.ts.map +0 -1
- package/dist/commands/generate-rules/index.js +0 -206
- package/dist/commands/generate-rules/service.d.ts +0 -22
- package/dist/commands/generate-rules/service.d.ts.map +0 -1
- package/dist/commands/generate-rules/service.js +0 -103
- package/dist/commands/generate-rules/utils.d.ts +0 -5
- package/dist/commands/generate-rules/utils.d.ts.map +0 -1
- package/dist/commands/generate-rules/utils.js +0 -25
- package/dist/commands/handoff/index.d.ts +0 -3
- package/dist/commands/handoff/index.d.ts.map +0 -1
- package/dist/commands/handoff/index.js +0 -97
- package/dist/commands/handoff/utils.d.ts +0 -4
- package/dist/commands/handoff/utils.d.ts.map +0 -1
- package/dist/commands/handoff/utils.js +0 -123
- package/dist/commands/list-directories/index.d.ts +0 -3
- package/dist/commands/list-directories/index.d.ts.map +0 -1
- package/dist/commands/list-directories/index.js +0 -35
- package/dist/commands/pickup/index.d.ts +0 -3
- package/dist/commands/pickup/index.d.ts.map +0 -1
- package/dist/commands/pickup/index.js +0 -141
- package/dist/commands/pickup/types.d.ts +0 -6
- package/dist/commands/pickup/types.d.ts.map +0 -1
- package/dist/commands/pickup/types.js +0 -1
- package/dist/commands/pickup/utils.d.ts +0 -7
- package/dist/commands/pickup/utils.d.ts.map +0 -1
- package/dist/commands/pickup/utils.js +0 -56
- package/dist/commands/remove-directory/index.d.ts +0 -3
- package/dist/commands/remove-directory/index.d.ts.map +0 -1
- package/dist/commands/remove-directory/index.js +0 -55
- package/dist/commands/review/index.d.ts +0 -3
- package/dist/commands/review/index.d.ts.map +0 -1
- package/dist/commands/review/index.js +0 -12
- package/dist/commands/review/review-panel.d.ts +0 -3
- package/dist/commands/review/review-panel.d.ts.map +0 -1
- package/dist/commands/review/review-panel.js +0 -186
- package/dist/commands/review/utils.d.ts +0 -18
- package/dist/commands/review/utils.d.ts.map +0 -1
- package/dist/commands/review/utils.js +0 -146
- package/dist/commands/shell/index.d.ts +0 -3
- package/dist/commands/shell/index.d.ts.map +0 -1
- package/dist/commands/shell/index.js +0 -96
- package/dist/subagents/index.d.ts +0 -16
- package/dist/subagents/index.d.ts.map +0 -1
- package/dist/subagents/index.js +0 -231
- package/dist/terminal/index.d.ts +0 -9
- package/dist/terminal/index.d.ts.map +0 -1
- package/dist/terminal/index.js +0 -8
- package/dist/tools/agent.d.ts +0 -27
- package/dist/tools/agent.d.ts.map +0 -1
- package/dist/tools/agent.js +0 -81
- package/dist/tools/directory-tree.d.ts +0 -28
- package/dist/tools/directory-tree.d.ts.map +0 -1
- package/dist/tools/directory-tree.js +0 -154
- package/dist/tools/glob.d.ts +0 -35
- package/dist/tools/glob.d.ts.map +0 -1
- package/dist/tools/glob.js +0 -167
- package/dist/tools/grep.d.ts +0 -100
- package/dist/tools/grep.d.ts.map +0 -1
- package/dist/tools/grep.js +0 -608
- package/dist/tools/ls.d.ts +0 -26
- package/dist/tools/ls.d.ts.map +0 -1
- package/dist/tools/ls.js +0 -83
- package/dist/tui/components/header.d.ts +0 -21
- package/dist/tui/components/header.d.ts.map +0 -1
- package/dist/tui/components/header.js +0 -63
- package/dist/utils/bash/parse.d.ts +0 -19
- package/dist/utils/bash/parse.d.ts.map +0 -1
- package/dist/utils/bash/parse.js +0 -223
- package/dist/utils/bash/quote.d.ts +0 -6
- package/dist/utils/bash/quote.d.ts.map +0 -1
- package/dist/utils/bash/quote.js +0 -23
- package/dist/utils/generators.d.ts +0 -3
- package/dist/utils/generators.d.ts.map +0 -1
- package/dist/utils/generators.js +0 -25
- package/dist/utils/glob.d.ts +0 -52
- package/dist/utils/glob.d.ts.map +0 -1
- package/dist/utils/glob.js +0 -376
package/dist/subagents/index.js
DELETED
|
@@ -1,231 +0,0 @@
|
|
|
1
|
-
import { readdir, readFile, stat } from "node:fs/promises";
|
|
2
|
-
import { homedir } from "node:os";
|
|
3
|
-
import { join, resolve } from "node:path";
|
|
4
|
-
import { logger } from "../utils/logger.js";
|
|
5
|
-
import { parseFrontMatter } from "../utils/yaml.js";
|
|
6
|
-
const CONFIG_DIR_NAME = ".acai";
|
|
7
|
-
const DEFAULT_TIMEOUT = 900;
|
|
8
|
-
// Validation functions
|
|
9
|
-
function validateSubagentName(name, fileName) {
|
|
10
|
-
// Check required field
|
|
11
|
-
if (!name) {
|
|
12
|
-
return { valid: false, error: "Name field is required" };
|
|
13
|
-
}
|
|
14
|
-
// Check length (1-64 characters)
|
|
15
|
-
if (name.length < 1 || name.length > 64) {
|
|
16
|
-
return { valid: false, error: "Name must be 1-64 characters long" };
|
|
17
|
-
}
|
|
18
|
-
// Check allowed characters (lowercase letters, numbers, hyphens)
|
|
19
|
-
if (!/^[a-z0-9-]+$/.test(name)) {
|
|
20
|
-
return {
|
|
21
|
-
valid: false,
|
|
22
|
-
error: "Name can only contain lowercase letters, numbers, and hyphens",
|
|
23
|
-
};
|
|
24
|
-
}
|
|
25
|
-
// Check no leading or trailing hyphens
|
|
26
|
-
if (name.startsWith("-") || name.endsWith("-")) {
|
|
27
|
-
return { valid: false, error: "Name cannot start or end with a hyphen" };
|
|
28
|
-
}
|
|
29
|
-
// Check no consecutive hyphens
|
|
30
|
-
if (name.includes("--")) {
|
|
31
|
-
return { valid: false, error: "Name cannot contain consecutive hyphens" };
|
|
32
|
-
}
|
|
33
|
-
// Check matches filename (without .md)
|
|
34
|
-
const expectedName = fileName.replace(/\.md$/, "");
|
|
35
|
-
if (name !== expectedName) {
|
|
36
|
-
return {
|
|
37
|
-
valid: false,
|
|
38
|
-
error: `Name "${name}" must match filename "${fileName}" (without .md)`,
|
|
39
|
-
};
|
|
40
|
-
}
|
|
41
|
-
return { valid: true };
|
|
42
|
-
}
|
|
43
|
-
function validateSubagentDescription(description) {
|
|
44
|
-
// Check required field
|
|
45
|
-
if (!description) {
|
|
46
|
-
return { valid: false, error: "Description field is required" };
|
|
47
|
-
}
|
|
48
|
-
// Check length (1-1024 characters)
|
|
49
|
-
if (description.length < 1 || description.length > 1024) {
|
|
50
|
-
return {
|
|
51
|
-
valid: false,
|
|
52
|
-
error: "Description must be 1-1024 characters long",
|
|
53
|
-
};
|
|
54
|
-
}
|
|
55
|
-
return { valid: true };
|
|
56
|
-
}
|
|
57
|
-
function validateSubagentTimeout(timeout) {
|
|
58
|
-
if (timeout === undefined) {
|
|
59
|
-
return { valid: true };
|
|
60
|
-
}
|
|
61
|
-
if (typeof timeout !== "number" || timeout < 1 || timeout > 3600) {
|
|
62
|
-
return {
|
|
63
|
-
valid: false,
|
|
64
|
-
error: "Timeout must be a number between 1 and 3600 seconds",
|
|
65
|
-
};
|
|
66
|
-
}
|
|
67
|
-
return { valid: true };
|
|
68
|
-
}
|
|
69
|
-
function parseFrontmatter(content) {
|
|
70
|
-
const { data, content: body } = parseFrontMatter(content);
|
|
71
|
-
// Type cast and validate required fields
|
|
72
|
-
const name = data["name"];
|
|
73
|
-
const description = data["description"];
|
|
74
|
-
// Set default empty values for optional fields
|
|
75
|
-
const frontmatter = {
|
|
76
|
-
name: name || "",
|
|
77
|
-
description: description || "",
|
|
78
|
-
model: data["model"] || undefined,
|
|
79
|
-
tools: data["tools"] || undefined,
|
|
80
|
-
timeout: data["timeout"] || undefined,
|
|
81
|
-
};
|
|
82
|
-
return { frontmatter, body };
|
|
83
|
-
}
|
|
84
|
-
async function loadSubagentsFromDir(dir, source) {
|
|
85
|
-
const subagents = [];
|
|
86
|
-
try {
|
|
87
|
-
const entries = await readdir(dir, { withFileTypes: true });
|
|
88
|
-
for (const entry of entries) {
|
|
89
|
-
// Skip hidden files and directories
|
|
90
|
-
if (entry.name.startsWith(".")) {
|
|
91
|
-
continue;
|
|
92
|
-
}
|
|
93
|
-
// Only process .md files
|
|
94
|
-
if (!entry.isFile() || !entry.name.endsWith(".md")) {
|
|
95
|
-
continue;
|
|
96
|
-
}
|
|
97
|
-
const entryPath = join(dir, entry.name);
|
|
98
|
-
// Skip symbolic links to avoid infinite recursion
|
|
99
|
-
try {
|
|
100
|
-
const stats = await stat(entryPath);
|
|
101
|
-
if (stats.isSymbolicLink()) {
|
|
102
|
-
continue;
|
|
103
|
-
}
|
|
104
|
-
}
|
|
105
|
-
catch {
|
|
106
|
-
// If we can't stat, skip it
|
|
107
|
-
continue;
|
|
108
|
-
}
|
|
109
|
-
try {
|
|
110
|
-
const content = await readFile(entryPath, "utf8");
|
|
111
|
-
const { frontmatter, body } = parseFrontmatter(content);
|
|
112
|
-
// Validate required fields
|
|
113
|
-
const nameValidation = validateSubagentName(frontmatter.name, entry.name);
|
|
114
|
-
if (!nameValidation.valid) {
|
|
115
|
-
logger.warn(`Invalid subagent name in ${entryPath}: ${nameValidation.error}`);
|
|
116
|
-
continue;
|
|
117
|
-
}
|
|
118
|
-
const descriptionValidation = validateSubagentDescription(frontmatter.description);
|
|
119
|
-
if (!descriptionValidation.valid) {
|
|
120
|
-
logger.warn(`Invalid subagent description in ${entryPath}: ${descriptionValidation.error}`);
|
|
121
|
-
continue;
|
|
122
|
-
}
|
|
123
|
-
const timeoutValidation = validateSubagentTimeout(frontmatter.timeout);
|
|
124
|
-
if (!timeoutValidation.valid) {
|
|
125
|
-
logger.warn(`Invalid subagent timeout in ${entryPath}: ${timeoutValidation.error}`);
|
|
126
|
-
continue;
|
|
127
|
-
}
|
|
128
|
-
// Parse tools if provided
|
|
129
|
-
let tools;
|
|
130
|
-
if (frontmatter.tools) {
|
|
131
|
-
tools = frontmatter.tools
|
|
132
|
-
.split(",")
|
|
133
|
-
.map((t) => t.trim())
|
|
134
|
-
.filter((t) => t.length > 0);
|
|
135
|
-
}
|
|
136
|
-
subagents.push({
|
|
137
|
-
name: frontmatter.name,
|
|
138
|
-
description: frontmatter.description,
|
|
139
|
-
model: frontmatter.model,
|
|
140
|
-
tools,
|
|
141
|
-
timeout: frontmatter.timeout ?? DEFAULT_TIMEOUT,
|
|
142
|
-
systemPrompt: body,
|
|
143
|
-
filePath: entryPath,
|
|
144
|
-
source,
|
|
145
|
-
});
|
|
146
|
-
}
|
|
147
|
-
catch (error) {
|
|
148
|
-
logger.warn(error, `Failed to load subagent from ${entryPath}:`);
|
|
149
|
-
}
|
|
150
|
-
}
|
|
151
|
-
}
|
|
152
|
-
catch (error) {
|
|
153
|
-
// Directory doesn't exist or can't be read
|
|
154
|
-
if (error.code !== "ENOENT") {
|
|
155
|
-
logger.error(error, `Error reading subagents directory ${dir}:`);
|
|
156
|
-
}
|
|
157
|
-
}
|
|
158
|
-
return subagents;
|
|
159
|
-
}
|
|
160
|
-
export async function loadSubagents() {
|
|
161
|
-
const subagentMap = new Map();
|
|
162
|
-
// Load from user directory (~/.acai/subagents)
|
|
163
|
-
const userDir = join(homedir(), CONFIG_DIR_NAME, "subagents");
|
|
164
|
-
for (const subagent of await loadSubagentsFromDir(userDir, "user")) {
|
|
165
|
-
subagentMap.set(subagent.name, subagent);
|
|
166
|
-
}
|
|
167
|
-
// Load from project directory (.acai/subagents) - overrides user
|
|
168
|
-
const projectDir = resolve(process.cwd(), CONFIG_DIR_NAME, "subagents");
|
|
169
|
-
for (const subagent of await loadSubagentsFromDir(projectDir, "project")) {
|
|
170
|
-
subagentMap.set(subagent.name, subagent);
|
|
171
|
-
}
|
|
172
|
-
return Array.from(subagentMap.values());
|
|
173
|
-
}
|
|
174
|
-
export async function getSubagent(name) {
|
|
175
|
-
const subagents = await loadSubagents();
|
|
176
|
-
return subagents.find((s) => s.name === name);
|
|
177
|
-
}
|
|
178
|
-
export function formatSubagentsForDescription(subagents) {
|
|
179
|
-
if (subagents.length === 0) {
|
|
180
|
-
return " No subagents available";
|
|
181
|
-
}
|
|
182
|
-
const lines = subagents.map((subagent) => {
|
|
183
|
-
const toolsStr = subagent.tools
|
|
184
|
-
? ` (tools: ${subagent.tools.join(", ")})`
|
|
185
|
-
: "";
|
|
186
|
-
return ` - ${subagent.name}: ${subagent.description}${toolsStr}`;
|
|
187
|
-
});
|
|
188
|
-
return lines.join("\n");
|
|
189
|
-
}
|
|
190
|
-
export function formatSubagentsForPrompt(subagents) {
|
|
191
|
-
if (subagents.length === 0) {
|
|
192
|
-
return "";
|
|
193
|
-
}
|
|
194
|
-
const lines = [
|
|
195
|
-
"## Subagents (Agent Tool)",
|
|
196
|
-
"",
|
|
197
|
-
"Use the Agent tool to delegate complex, multi-step tasks to specialized subagents. Subagents operate autonomously and return a single result.",
|
|
198
|
-
"",
|
|
199
|
-
"**When to use subagents:**",
|
|
200
|
-
"- Deep codebase research or architecture exploration",
|
|
201
|
-
"- Complex multi-file refactoring or implementation tasks",
|
|
202
|
-
"- Writing comprehensive tests across multiple files",
|
|
203
|
-
"- Creating detailed implementation plans",
|
|
204
|
-
"- Tasks requiring investigation across many files",
|
|
205
|
-
"",
|
|
206
|
-
"<available_subagents>",
|
|
207
|
-
];
|
|
208
|
-
for (const subagent of subagents) {
|
|
209
|
-
lines.push("<subagent>");
|
|
210
|
-
lines.push("<name>");
|
|
211
|
-
lines.push(subagent.name);
|
|
212
|
-
lines.push("</name>");
|
|
213
|
-
lines.push("<description>");
|
|
214
|
-
lines.push(subagent.description);
|
|
215
|
-
lines.push("</description>");
|
|
216
|
-
if (subagent.tools && subagent.tools.length > 0) {
|
|
217
|
-
lines.push("<tools>");
|
|
218
|
-
lines.push(subagent.tools.join(", "));
|
|
219
|
-
lines.push("</tools>");
|
|
220
|
-
}
|
|
221
|
-
lines.push("</subagent>");
|
|
222
|
-
}
|
|
223
|
-
lines.push("</available_subagents>");
|
|
224
|
-
lines.push("");
|
|
225
|
-
lines.push("**Usage notes:**");
|
|
226
|
-
lines.push("- Subagents are stateless - provide all context in your prompt");
|
|
227
|
-
lines.push("- Be specific about what information you need returned");
|
|
228
|
-
lines.push("- Use longer timeouts for complex tasks (1800-3600 seconds)");
|
|
229
|
-
lines.push("- Launch multiple subagents concurrently for independent tasks");
|
|
230
|
-
return lines.join("\n");
|
|
231
|
-
}
|
package/dist/terminal/index.d.ts
DELETED
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Terminal Interface Module
|
|
3
|
-
*
|
|
4
|
-
* Provides a user interface for interacting with Claude Code in the terminal.
|
|
5
|
-
* Handles input/output, formatting, and display.
|
|
6
|
-
*/
|
|
7
|
-
export { alert, getShell, isInteractive } from "./control.ts";
|
|
8
|
-
export { emphasize, error, hr, info, success, warn } from "./formatting.ts";
|
|
9
|
-
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../source/terminal/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,KAAK,EAAE,QAAQ,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAC9D,OAAO,EAAE,SAAS,EAAE,KAAK,EAAE,EAAE,EAAE,IAAI,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,iBAAiB,CAAC"}
|
package/dist/terminal/index.js
DELETED
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Terminal Interface Module
|
|
3
|
-
*
|
|
4
|
-
* Provides a user interface for interacting with Claude Code in the terminal.
|
|
5
|
-
* Handles input/output, formatting, and display.
|
|
6
|
-
*/
|
|
7
|
-
export { alert, getShell, isInteractive } from "./control.js";
|
|
8
|
-
export { emphasize, error, hr, info, success, warn } from "./formatting.js";
|
package/dist/tools/agent.d.ts
DELETED
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
import { z } from "zod";
|
|
2
|
-
import type { WorkspaceContext } from "../index.ts";
|
|
3
|
-
import type { ToolExecutionOptions } from "./types.ts";
|
|
4
|
-
export declare const AgentTool: {
|
|
5
|
-
name: "Agent";
|
|
6
|
-
};
|
|
7
|
-
declare const inputSchema: z.ZodObject<{
|
|
8
|
-
prompt: z.ZodString;
|
|
9
|
-
type: z.ZodString;
|
|
10
|
-
timeout: z.ZodOptional<z.ZodNumber>;
|
|
11
|
-
}, z.core.$strip>;
|
|
12
|
-
export declare const createAgentTools: (options: {
|
|
13
|
-
workspace: WorkspaceContext;
|
|
14
|
-
}) => Promise<{
|
|
15
|
-
toolDef: {
|
|
16
|
-
description: string;
|
|
17
|
-
inputSchema: z.ZodObject<{
|
|
18
|
-
prompt: z.ZodString;
|
|
19
|
-
type: z.ZodString;
|
|
20
|
-
timeout: z.ZodOptional<z.ZodNumber>;
|
|
21
|
-
}, z.core.$strip>;
|
|
22
|
-
};
|
|
23
|
-
display: ({ prompt, type }: z.infer<typeof inputSchema>) => string;
|
|
24
|
-
execute: ({ prompt, type, timeout }: z.infer<typeof inputSchema>, { abortSignal }: ToolExecutionOptions) => Promise<string>;
|
|
25
|
-
}>;
|
|
26
|
-
export {};
|
|
27
|
-
//# sourceMappingURL=agent.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"agent.d.ts","sourceRoot":"","sources":["../../source/tools/agent.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAKpD,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,YAAY,CAAC;AAEvD,eAAO,MAAM,SAAS;;CAErB,CAAC;AAMF,QAAA,MAAM,WAAW;;;;iBAOf,CAAC;AAsBH,eAAO,MAAM,gBAAgB,GAAU,SAAS;IAC9C,SAAS,EAAE,gBAAgB,CAAC;CAC7B;;;;;;;;;gCAQoC,CAAC,CAAC,KAAK,CAAC,OAAO,WAAW,CAAC;yCAIjC,CAAC,CAAC,KAAK,CAAC,OAAO,WAAW,CAAC,mBACrC,oBAAoB,KACpC,OAAO,CAAC,MAAM,CAAC;EAkDnB,CAAC"}
|
package/dist/tools/agent.js
DELETED
|
@@ -1,81 +0,0 @@
|
|
|
1
|
-
import { z } from "zod";
|
|
2
|
-
import { SubAgent } from "../agent/sub-agent.js";
|
|
3
|
-
import { isSupportedModel } from "../models/providers.js";
|
|
4
|
-
import { environmentInfo } from "../prompts/system-prompt.js";
|
|
5
|
-
import { getSubagent, loadSubagents } from "../subagents/index.js";
|
|
6
|
-
import style from "../terminal/style.js";
|
|
7
|
-
export const AgentTool = {
|
|
8
|
-
name: "Agent",
|
|
9
|
-
};
|
|
10
|
-
async function getToolDescription() {
|
|
11
|
-
return "Delegate a task to a specialized subagent.";
|
|
12
|
-
}
|
|
13
|
-
const inputSchema = z.object({
|
|
14
|
-
prompt: z.string().describe("The task for the agent to perform"),
|
|
15
|
-
type: z.string().describe("The subagent type to use (matches subagent name)"),
|
|
16
|
-
timeout: z
|
|
17
|
-
.number()
|
|
18
|
-
.optional()
|
|
19
|
-
.describe("Override default timeout in seconds"),
|
|
20
|
-
});
|
|
21
|
-
async function loadSubAgentDefinition(type) {
|
|
22
|
-
const subagent = await getSubagent(type);
|
|
23
|
-
if (!subagent) {
|
|
24
|
-
const available = await loadSubagents();
|
|
25
|
-
const names = available.map((s) => s.name).join(", ");
|
|
26
|
-
throw new Error(`Unknown subagent type: "${type}". Available: ${names}`);
|
|
27
|
-
}
|
|
28
|
-
return {
|
|
29
|
-
model: subagent.model ?? "",
|
|
30
|
-
system: subagent.systemPrompt,
|
|
31
|
-
tools: subagent.tools,
|
|
32
|
-
timeout: subagent.timeout,
|
|
33
|
-
};
|
|
34
|
-
}
|
|
35
|
-
export const createAgentTools = async (options) => {
|
|
36
|
-
const description = await getToolDescription();
|
|
37
|
-
const toolDef = {
|
|
38
|
-
description,
|
|
39
|
-
inputSchema,
|
|
40
|
-
};
|
|
41
|
-
function display({ prompt, type }) {
|
|
42
|
-
return `${style.cyan(type)} - ${style.dim(prompt.substring(0, 25))}`;
|
|
43
|
-
}
|
|
44
|
-
async function execute({ prompt, type, timeout }, { abortSignal }) {
|
|
45
|
-
if (abortSignal?.aborted) {
|
|
46
|
-
throw new Error("Agent execution aborted");
|
|
47
|
-
}
|
|
48
|
-
const { model, system, tools, timeout: defaultTimeout, } = await loadSubAgentDefinition(type);
|
|
49
|
-
const systemPrompt = `${system}
|
|
50
|
-
|
|
51
|
-
${await environmentInfo(options.workspace.primaryDir, options.workspace.allowedDirs)}`;
|
|
52
|
-
const subagent = new SubAgent({ workspace: options.workspace });
|
|
53
|
-
const effectiveTimeout = timeout ?? defaultTimeout;
|
|
54
|
-
try {
|
|
55
|
-
const result = await subagent.execute({
|
|
56
|
-
model: isSupportedModel(model) ? model : "opencode:minimax-m2.5",
|
|
57
|
-
system: systemPrompt,
|
|
58
|
-
prompt,
|
|
59
|
-
abortSignal,
|
|
60
|
-
allowedTools: tools,
|
|
61
|
-
timeout: effectiveTimeout,
|
|
62
|
-
});
|
|
63
|
-
return result;
|
|
64
|
-
}
|
|
65
|
-
catch (error) {
|
|
66
|
-
const err = error;
|
|
67
|
-
const message = err.message || "Unknown error";
|
|
68
|
-
if (message.includes("timed out") ||
|
|
69
|
-
err.name === "AbortError" ||
|
|
70
|
-
err.name === "TimeoutError") {
|
|
71
|
-
return `Agent failed: ${message}. The timeout was ${effectiveTimeout} seconds. Consider increasing the timeout or breaking the task into smaller subtasks.`;
|
|
72
|
-
}
|
|
73
|
-
return `Agent failed: ${message}`;
|
|
74
|
-
}
|
|
75
|
-
}
|
|
76
|
-
return {
|
|
77
|
-
toolDef,
|
|
78
|
-
display,
|
|
79
|
-
execute,
|
|
80
|
-
};
|
|
81
|
-
};
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
import { z } from "zod";
|
|
2
|
-
import type { WorkspaceContext } from "../index.ts";
|
|
3
|
-
import type { ToolExecutionOptions } from "./types.ts";
|
|
4
|
-
export declare const DirectoryTreeTool: {
|
|
5
|
-
name: "DirectoryTree";
|
|
6
|
-
};
|
|
7
|
-
declare const inputSchema: z.ZodObject<{
|
|
8
|
-
path: z.ZodString;
|
|
9
|
-
maxResults: z.ZodDefault<z.ZodPreprocess<z.ZodNullable<z.ZodCoercedNumber<unknown>>>>;
|
|
10
|
-
maxDepth: z.ZodDefault<z.ZodPreprocess<z.ZodNullable<z.ZodCoercedNumber<unknown>>>>;
|
|
11
|
-
}, z.core.$strip>;
|
|
12
|
-
type DirectoryTreeInputSchema = z.infer<typeof inputSchema>;
|
|
13
|
-
export declare const createDirectoryTreeTool: (options: {
|
|
14
|
-
workspace: WorkspaceContext;
|
|
15
|
-
}) => Promise<{
|
|
16
|
-
toolDef: {
|
|
17
|
-
description: string;
|
|
18
|
-
inputSchema: z.ZodObject<{
|
|
19
|
-
path: z.ZodString;
|
|
20
|
-
maxResults: z.ZodDefault<z.ZodPreprocess<z.ZodNullable<z.ZodCoercedNumber<unknown>>>>;
|
|
21
|
-
maxDepth: z.ZodDefault<z.ZodPreprocess<z.ZodNullable<z.ZodCoercedNumber<unknown>>>>;
|
|
22
|
-
}, z.core.$strip>;
|
|
23
|
-
};
|
|
24
|
-
display({ path, maxDepth, maxResults }: DirectoryTreeInputSchema): string;
|
|
25
|
-
execute({ path, maxResults, maxDepth }: DirectoryTreeInputSchema, { abortSignal }: ToolExecutionOptions): Promise<string>;
|
|
26
|
-
}>;
|
|
27
|
-
export {};
|
|
28
|
-
//# sourceMappingURL=directory-tree.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"directory-tree.d.ts","sourceRoot":"","sources":["../../source/tools/directory-tree.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAMpD,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,YAAY,CAAC;AAKvD,eAAO,MAAM,iBAAiB;;CAE7B,CAAC;AAEF,QAAA,MAAM,WAAW;;;;iBAcf,CAAC;AAEH,KAAK,wBAAwB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,WAAW,CAAC,CAAC;AAE5D,eAAO,MAAM,uBAAuB,GAAU,SAAS;IACrD,SAAS,EAAE,gBAAgB,CAAC;CAC7B;;;;;;;;;4CAS2C,wBAAwB;4CAY9B,wBAAwB,mBACvC,oBAAoB,GACpC,OAAO,CAAC,MAAM,CAAC;EAyBrB,CAAC"}
|
|
@@ -1,154 +0,0 @@
|
|
|
1
|
-
import fs from "node:fs/promises";
|
|
2
|
-
import path from "node:path";
|
|
3
|
-
import { z } from "zod";
|
|
4
|
-
import style from "../terminal/style.js";
|
|
5
|
-
import { toDisplayPath } from "../utils/filesystem/path-display.js";
|
|
6
|
-
import { joinWorkingDir, validatePath } from "../utils/filesystem/security.js";
|
|
7
|
-
import ignore from "../utils/ignore.js";
|
|
8
|
-
import { convertNullString } from "../utils/zod.js";
|
|
9
|
-
const DEFAULT_ITEM_LIMIT = 500;
|
|
10
|
-
const DEFAULT_DEPTH_LIMIT = 10;
|
|
11
|
-
export const DirectoryTreeTool = {
|
|
12
|
-
name: "DirectoryTree",
|
|
13
|
-
};
|
|
14
|
-
const inputSchema = z.object({
|
|
15
|
-
path: z.string().describe("The path"),
|
|
16
|
-
maxResults: z
|
|
17
|
-
.preprocess((val) => convertNullString(val), z.coerce.number().nullable())
|
|
18
|
-
.default(null)
|
|
19
|
-
.describe(`Maximum number of items (files + directories) to return. Set to 0 for no limit. (default: ${DEFAULT_ITEM_LIMIT})`),
|
|
20
|
-
maxDepth: z
|
|
21
|
-
.preprocess((val) => convertNullString(val), z.coerce.number().nullable())
|
|
22
|
-
.default(null)
|
|
23
|
-
.describe(`Maximum recursion depth. Set to 0 for no limit. (default: ${DEFAULT_DEPTH_LIMIT})`),
|
|
24
|
-
});
|
|
25
|
-
export const createDirectoryTreeTool = async (options) => {
|
|
26
|
-
const { primaryDir, allowedDirs } = options.workspace;
|
|
27
|
-
const allowedDirectory = allowedDirs ?? [primaryDir];
|
|
28
|
-
return {
|
|
29
|
-
toolDef: {
|
|
30
|
-
description: "Show directory structure as a recursive tree. Use this to explore nested directories and understand the overall project structure. For a simple flat list of a single directory, use LS instead.",
|
|
31
|
-
inputSchema,
|
|
32
|
-
},
|
|
33
|
-
display({ path, maxDepth, maxResults }) {
|
|
34
|
-
const displayPath = toDisplayPath(path);
|
|
35
|
-
let display = `${style.cyan(displayPath)}`;
|
|
36
|
-
if (maxDepth || maxResults) {
|
|
37
|
-
const parts = [];
|
|
38
|
-
if (maxDepth)
|
|
39
|
-
parts.push(`depth: ${maxDepth}`);
|
|
40
|
-
if (maxResults)
|
|
41
|
-
parts.push(`max: ${maxResults}`);
|
|
42
|
-
display += ` (${parts.join(", ")})`;
|
|
43
|
-
}
|
|
44
|
-
return display;
|
|
45
|
-
},
|
|
46
|
-
async execute({ path, maxResults, maxDepth }, { abortSignal }) {
|
|
47
|
-
if (abortSignal?.aborted) {
|
|
48
|
-
throw new Error("Directory tree listing aborted");
|
|
49
|
-
}
|
|
50
|
-
const validPath = await validatePath(joinWorkingDir(path, primaryDir), allowedDirectory, { abortSignal });
|
|
51
|
-
if (abortSignal?.aborted) {
|
|
52
|
-
throw new Error("Directory tree listing aborted before tree generation");
|
|
53
|
-
}
|
|
54
|
-
const treeResult = await directoryTree(validPath, {
|
|
55
|
-
maxResults: maxResults ?? DEFAULT_ITEM_LIMIT,
|
|
56
|
-
maxDepth: maxDepth ?? DEFAULT_DEPTH_LIMIT,
|
|
57
|
-
});
|
|
58
|
-
return treeResult.tree;
|
|
59
|
-
},
|
|
60
|
-
};
|
|
61
|
-
};
|
|
62
|
-
/**
|
|
63
|
-
* Generates the indentation string for a given level in the directory tree.
|
|
64
|
-
* @param level - The current level in the directory tree.
|
|
65
|
-
* @param isLast - Indicates if the current item is the last in its parent directory.
|
|
66
|
-
* @returns The indentation string for the current level.
|
|
67
|
-
*/
|
|
68
|
-
function getIndent(level, isLast) {
|
|
69
|
-
const indent = "│ ".repeat(Math.max(level - 1, 0));
|
|
70
|
-
return level === 0 ? "" : `${indent}${isLast ? "└── " : "├── "}`;
|
|
71
|
-
}
|
|
72
|
-
/**
|
|
73
|
-
* Recursively generates a string representation of a directory tree.
|
|
74
|
-
* @param dirPath - The path of the directory to generate the tree for.
|
|
75
|
-
* @param ig - The ignore instance for filtering files.
|
|
76
|
-
* @param level - The current level in the directory tree (default: 0).
|
|
77
|
-
* @param options - Options for limiting results.
|
|
78
|
-
* @returns A Promise that resolves to a string representation of the directory tree with counts.
|
|
79
|
-
* @throws Will log an error if there's an issue reading the directory.
|
|
80
|
-
*/
|
|
81
|
-
async function generateDirectoryTree(dirPath, ig, level = 0, options = {}) {
|
|
82
|
-
const name = path.basename(dirPath);
|
|
83
|
-
let output = `${getIndent(level, false)}${name}\n`;
|
|
84
|
-
let fileCount = 0;
|
|
85
|
-
let directoryCount = 1; // Count the current directory
|
|
86
|
-
let totalCount = 1; // Count the current directory
|
|
87
|
-
let isTruncated = false;
|
|
88
|
-
// Check maxDepth limit - when maxDepth is reached, we should indicate truncation
|
|
89
|
-
if (options.maxDepth !== null &&
|
|
90
|
-
options.maxDepth !== undefined &&
|
|
91
|
-
options.maxDepth > 0 &&
|
|
92
|
-
level >= options.maxDepth) {
|
|
93
|
-
// When maxDepth is reached, return with truncation flag set
|
|
94
|
-
return {
|
|
95
|
-
tree: output,
|
|
96
|
-
fileCount: 0,
|
|
97
|
-
directoryCount: 1, // Count the current directory
|
|
98
|
-
totalCount: 1, // Count the current directory
|
|
99
|
-
isTruncated: true, // Set truncation flag when depth limit is reached
|
|
100
|
-
};
|
|
101
|
-
}
|
|
102
|
-
const items = await fs.readdir(dirPath);
|
|
103
|
-
const filteredItems = ig.filter(items);
|
|
104
|
-
for (let i = 0; i < filteredItems.length; i++) {
|
|
105
|
-
// Check maxResults limit BEFORE processing each item to ensure strict adherence to limits
|
|
106
|
-
if (options.maxResults !== null &&
|
|
107
|
-
options.maxResults !== undefined &&
|
|
108
|
-
options.maxResults > 0 &&
|
|
109
|
-
totalCount >= options.maxResults) {
|
|
110
|
-
isTruncated = true;
|
|
111
|
-
break;
|
|
112
|
-
}
|
|
113
|
-
const item = filteredItems[i] ?? "";
|
|
114
|
-
const itemPath = path.join(dirPath, item);
|
|
115
|
-
const isLast = i === filteredItems.length - 1;
|
|
116
|
-
const stats = await fs.stat(itemPath);
|
|
117
|
-
if (stats.isDirectory()) {
|
|
118
|
-
const subTreeResult = await generateDirectoryTree(itemPath, ig, level + 1, options);
|
|
119
|
-
output += subTreeResult.tree;
|
|
120
|
-
fileCount += subTreeResult.fileCount;
|
|
121
|
-
directoryCount += subTreeResult.directoryCount;
|
|
122
|
-
totalCount += subTreeResult.totalCount;
|
|
123
|
-
// Propagate truncation from subtree results
|
|
124
|
-
if (subTreeResult.isTruncated) {
|
|
125
|
-
isTruncated = true;
|
|
126
|
-
}
|
|
127
|
-
}
|
|
128
|
-
else {
|
|
129
|
-
output += `${getIndent(level + 1, isLast)}${item}\n`;
|
|
130
|
-
fileCount += 1;
|
|
131
|
-
totalCount += 1;
|
|
132
|
-
}
|
|
133
|
-
}
|
|
134
|
-
return { tree: output, fileCount, directoryCount, totalCount, isTruncated };
|
|
135
|
-
}
|
|
136
|
-
async function directoryTree(dirPath, options = {}) {
|
|
137
|
-
let ig;
|
|
138
|
-
try {
|
|
139
|
-
const ignoreFile = await fs.readFile(path.join(process.cwd(), ".gitignore"));
|
|
140
|
-
ig = ignore().add(ignoreFile.toString()).add(".git");
|
|
141
|
-
}
|
|
142
|
-
catch (_error) {
|
|
143
|
-
// If .gitignore doesn't exist, create basic ignore with just .git
|
|
144
|
-
ig = ignore().add(".git");
|
|
145
|
-
}
|
|
146
|
-
const result = await generateDirectoryTree(dirPath, ig, 0, options);
|
|
147
|
-
return {
|
|
148
|
-
tree: result.tree.trim(),
|
|
149
|
-
fileCount: result.fileCount,
|
|
150
|
-
directoryCount: result.directoryCount,
|
|
151
|
-
totalCount: result.totalCount,
|
|
152
|
-
isTruncated: result.isTruncated,
|
|
153
|
-
};
|
|
154
|
-
}
|
package/dist/tools/glob.d.ts
DELETED
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
import { z } from "zod";
|
|
2
|
-
import type { ToolExecutionOptions } from "./types.ts";
|
|
3
|
-
export declare const GlobTool: {
|
|
4
|
-
name: "Glob";
|
|
5
|
-
};
|
|
6
|
-
export declare const inputSchema: z.ZodObject<{
|
|
7
|
-
patterns: z.ZodDefault<z.ZodPreprocess<z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodString>]>>>;
|
|
8
|
-
path: z.ZodDefault<z.ZodPreprocess<z.ZodString>>;
|
|
9
|
-
gitignore: z.ZodDefault<z.ZodPreprocess<z.ZodNullable<z.ZodCoercedBoolean<unknown>>>>;
|
|
10
|
-
recursive: z.ZodDefault<z.ZodPreprocess<z.ZodNullable<z.ZodCoercedBoolean<unknown>>>>;
|
|
11
|
-
expandDirectories: z.ZodDefault<z.ZodPreprocess<z.ZodNullable<z.ZodCoercedBoolean<unknown>>>>;
|
|
12
|
-
ignoreFiles: z.ZodDefault<z.ZodPreprocess<z.ZodNullable<z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodString>]>>>>;
|
|
13
|
-
cwd: z.ZodDefault<z.ZodPreprocess<z.ZodNullable<z.ZodCoercedString<unknown>>>>;
|
|
14
|
-
maxResults: z.ZodDefault<z.ZodPreprocess<z.ZodNullable<z.ZodCoercedNumber<unknown>>>>;
|
|
15
|
-
}, z.core.$strip>;
|
|
16
|
-
type GlobInputSchema = z.infer<typeof inputSchema>;
|
|
17
|
-
export declare const createGlobTool: () => {
|
|
18
|
-
toolDef: {
|
|
19
|
-
description: string;
|
|
20
|
-
inputSchema: z.ZodObject<{
|
|
21
|
-
patterns: z.ZodDefault<z.ZodPreprocess<z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodString>]>>>;
|
|
22
|
-
path: z.ZodDefault<z.ZodPreprocess<z.ZodString>>;
|
|
23
|
-
gitignore: z.ZodDefault<z.ZodPreprocess<z.ZodNullable<z.ZodCoercedBoolean<unknown>>>>;
|
|
24
|
-
recursive: z.ZodDefault<z.ZodPreprocess<z.ZodNullable<z.ZodCoercedBoolean<unknown>>>>;
|
|
25
|
-
expandDirectories: z.ZodDefault<z.ZodPreprocess<z.ZodNullable<z.ZodCoercedBoolean<unknown>>>>;
|
|
26
|
-
ignoreFiles: z.ZodDefault<z.ZodPreprocess<z.ZodNullable<z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodString>]>>>>;
|
|
27
|
-
cwd: z.ZodDefault<z.ZodPreprocess<z.ZodNullable<z.ZodCoercedString<unknown>>>>;
|
|
28
|
-
maxResults: z.ZodDefault<z.ZodPreprocess<z.ZodNullable<z.ZodCoercedNumber<unknown>>>>;
|
|
29
|
-
}, z.core.$strip>;
|
|
30
|
-
};
|
|
31
|
-
display({ patterns, path }: GlobInputSchema): string;
|
|
32
|
-
execute({ patterns, path, gitignore, recursive, expandDirectories, ignoreFiles, cwd, maxResults, }: GlobInputSchema, { abortSignal }: ToolExecutionOptions): Promise<string>;
|
|
33
|
-
};
|
|
34
|
-
export {};
|
|
35
|
-
//# sourceMappingURL=glob.d.ts.map
|
package/dist/tools/glob.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"glob.d.ts","sourceRoot":"","sources":["../../source/tools/glob.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAKxB,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,YAAY,CAAC;AA6EvD,eAAO,MAAM,QAAQ;;CAEpB,CAAC;AAEF,eAAO,MAAM,WAAW;;;;;;;;;iBAkFtB,CAAC;AAEH,KAAK,eAAe,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,WAAW,CAAC,CAAC;AAEnD,eAAO,MAAM,cAAc;;;;;;;;;;;;;;gCAMK,eAAe;wGAmBtC,eAAe,mBACD,oBAAoB,GACpC,OAAO,CAAC,MAAM,CAAC;CAuCrB,CAAC"}
|