@deepagents/toolbox 6.1.2 → 7.0.1
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/lib/ast-grep-cli.js +1 -0
- package/dist/lib/ast-grep-cli.js.map +7 -0
- package/dist/lib/ast-grep.js +1 -0
- package/dist/lib/ast-grep.js.map +7 -0
- package/dist/lib/container.js +43 -0
- package/dist/lib/container.js.map +7 -0
- package/dist/lib/ddg-search.js +91 -0
- package/dist/lib/ddg-search.js.map +7 -0
- package/dist/lib/ddg-stocks.js +52 -0
- package/dist/lib/ddg-stocks.js.map +7 -0
- package/dist/lib/filesystem.js +196 -0
- package/dist/lib/filesystem.js.map +7 -0
- package/dist/lib/hackernews-search.js +744 -0
- package/dist/lib/hackernews-search.js.map +7 -0
- package/dist/lib/scratchbad.js +44 -0
- package/dist/lib/scratchbad.js.map +7 -0
- package/dist/lib/state.js +8 -0
- package/dist/lib/state.js.map +7 -0
- package/dist/lib/user-story-formatter.js +77 -0
- package/dist/lib/user-story-formatter.js.map +7 -0
- package/dist/lib/weather.js +142 -0
- package/dist/lib/weather.js.map +7 -0
- package/dist/lib/web-fetch.js +1 -0
- package/dist/lib/web-fetch.js.map +7 -0
- package/dist/lib/web-search.js +92 -0
- package/dist/lib/web-search.js.map +7 -0
- package/package.json +5 -3
|
@@ -0,0 +1 @@
|
|
|
1
|
+
//# sourceMappingURL=ast-grep-cli.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
//# sourceMappingURL=ast-grep.js.map
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
// packages/toolbox/src/lib/container.ts
|
|
2
|
+
import { tool } from "ai";
|
|
3
|
+
import spawn from "nano-spawn";
|
|
4
|
+
import { z } from "zod";
|
|
5
|
+
var execute_os_command = tool({
|
|
6
|
+
description: "Tool to execute Linux commands in an isolated Docker container with Node.js runtime. Use when you need OS operations like file management, package installation, network requests, or system commands.",
|
|
7
|
+
inputSchema: z.object({
|
|
8
|
+
command: z.array(z.string().min(1, "Command parts cannot be empty")).min(1, "At least one command part is required").max(20, "Command cannot exceed 20 parts for security").describe(
|
|
9
|
+
'Command and arguments as array. Examples: ["ls", "-la"], ["npm", "install", "lodash"], ["curl", "-s", "https://api.github.com"], ["node", "--version"]'
|
|
10
|
+
),
|
|
11
|
+
working_directory: z.string().regex(/^\/[a-zA-Z0-9_/.,-]*$/, "Must be a valid absolute Linux path").optional().describe(
|
|
12
|
+
'Absolute working directory path. Examples: "/tmp", "/workspace", "/app". Defaults to container root.'
|
|
13
|
+
),
|
|
14
|
+
environment_vars: z.record(
|
|
15
|
+
z.string().min(1, "Environment variable values cannot be empty"),
|
|
16
|
+
z.string()
|
|
17
|
+
).optional().describe(
|
|
18
|
+
'Environment variables as key-value pairs. Examples: {"NODE_ENV": "development", "API_KEY": "secret123"}'
|
|
19
|
+
)
|
|
20
|
+
}),
|
|
21
|
+
execute: ({ command, working_directory, environment_vars }) => {
|
|
22
|
+
return exec(command, working_directory, environment_vars);
|
|
23
|
+
}
|
|
24
|
+
});
|
|
25
|
+
function exec(command, working_directory, environment_vars) {
|
|
26
|
+
const args = ["exec", "-i"];
|
|
27
|
+
if (working_directory) {
|
|
28
|
+
args.push("-w", working_directory);
|
|
29
|
+
}
|
|
30
|
+
if (environment_vars) {
|
|
31
|
+
Object.entries(environment_vars).forEach(([key, value]) => {
|
|
32
|
+
args.push("-e", `${key}=${value}`);
|
|
33
|
+
});
|
|
34
|
+
}
|
|
35
|
+
args.push("toolos", ...command);
|
|
36
|
+
return spawn("docker", args, {
|
|
37
|
+
stdio: "pipe"
|
|
38
|
+
});
|
|
39
|
+
}
|
|
40
|
+
export {
|
|
41
|
+
execute_os_command
|
|
42
|
+
};
|
|
43
|
+
//# sourceMappingURL=container.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../src/lib/container.ts"],
|
|
4
|
+
"sourcesContent": ["import { tool } from 'ai';\nimport spawn from 'nano-spawn';\nimport { z } from 'zod';\n\nexport const execute_os_command = tool({\n description:\n 'Tool to execute Linux commands in an isolated Docker container with Node.js runtime. Use when you need OS operations like file management, package installation, network requests, or system commands.',\n inputSchema: z.object({\n command: z\n .array(z.string().min(1, 'Command parts cannot be empty'))\n .min(1, 'At least one command part is required')\n .max(20, 'Command cannot exceed 20 parts for security')\n .describe(\n 'Command and arguments as array. Examples: [\"ls\", \"-la\"], [\"npm\", \"install\", \"lodash\"], [\"curl\", \"-s\", \"https://api.github.com\"], [\"node\", \"--version\"]',\n ),\n working_directory: z\n .string()\n .regex(/^\\/[a-zA-Z0-9_/.,-]*$/, 'Must be a valid absolute Linux path')\n .optional()\n .describe(\n 'Absolute working directory path. Examples: \"/tmp\", \"/workspace\", \"/app\". Defaults to container root.',\n ),\n environment_vars: z\n .record(\n z.string().min(1, 'Environment variable values cannot be empty'),\n z.string(),\n )\n .optional()\n .describe(\n 'Environment variables as key-value pairs. Examples: {\"NODE_ENV\": \"development\", \"API_KEY\": \"secret123\"}',\n ),\n }),\n execute: ({ command, working_directory, environment_vars }) => {\n return exec(command, working_directory, environment_vars);\n },\n});\n\nfunction exec(\n command: string[],\n working_directory?: string,\n environment_vars?: Record<string, string>,\n) {\n const args = ['exec', '-i'];\n\n if (working_directory) {\n args.push('-w', working_directory);\n }\n\n if (environment_vars) {\n Object.entries(environment_vars).forEach(([key, value]) => {\n args.push('-e', `${key}=${value}`);\n });\n }\n\n args.push('toolos', ...command);\n\n return spawn('docker', args, {\n stdio: 'pipe',\n });\n}\n"],
|
|
5
|
+
"mappings": ";AAAA,SAAS,YAAY;AACrB,OAAO,WAAW;AAClB,SAAS,SAAS;AAEX,IAAM,qBAAqB,KAAK;AAAA,EACrC,aACE;AAAA,EACF,aAAa,EAAE,OAAO;AAAA,IACpB,SAAS,EACN,MAAM,EAAE,OAAO,EAAE,IAAI,GAAG,+BAA+B,CAAC,EACxD,IAAI,GAAG,uCAAuC,EAC9C,IAAI,IAAI,6CAA6C,EACrD;AAAA,MACC;AAAA,IACF;AAAA,IACF,mBAAmB,EAChB,OAAO,EACP,MAAM,yBAAyB,qCAAqC,EACpE,SAAS,EACT;AAAA,MACC;AAAA,IACF;AAAA,IACF,kBAAkB,EACf;AAAA,MACC,EAAE,OAAO,EAAE,IAAI,GAAG,6CAA6C;AAAA,MAC/D,EAAE,OAAO;AAAA,IACX,EACC,SAAS,EACT;AAAA,MACC;AAAA,IACF;AAAA,EACJ,CAAC;AAAA,EACD,SAAS,CAAC,EAAE,SAAS,mBAAmB,iBAAiB,MAAM;AAC7D,WAAO,KAAK,SAAS,mBAAmB,gBAAgB;AAAA,EAC1D;AACF,CAAC;AAED,SAAS,KACP,SACA,mBACA,kBACA;AACA,QAAM,OAAO,CAAC,QAAQ,IAAI;AAE1B,MAAI,mBAAmB;AACrB,SAAK,KAAK,MAAM,iBAAiB;AAAA,EACnC;AAEA,MAAI,kBAAkB;AACpB,WAAO,QAAQ,gBAAgB,EAAE,QAAQ,CAAC,CAAC,KAAK,KAAK,MAAM;AACzD,WAAK,KAAK,MAAM,GAAG,GAAG,IAAI,KAAK,EAAE;AAAA,IACnC,CAAC;AAAA,EACH;AAEA,OAAK,KAAK,UAAU,GAAG,OAAO;AAE9B,SAAO,MAAM,UAAU,MAAM;AAAA,IAC3B,OAAO;AAAA,EACT,CAAC;AACH;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
// packages/toolbox/src/lib/ddg-search.ts
|
|
2
|
+
import { tool } from "ai";
|
|
3
|
+
import * as ddg from "duck-duck-scrape";
|
|
4
|
+
import { uniqBy } from "lodash-es";
|
|
5
|
+
import { z } from "zod";
|
|
6
|
+
async function serp({
|
|
7
|
+
query,
|
|
8
|
+
source,
|
|
9
|
+
locale = "en-us",
|
|
10
|
+
maxResults = 50,
|
|
11
|
+
...input
|
|
12
|
+
}) {
|
|
13
|
+
const safeSearch = ddg.SafeSearchType[
|
|
14
|
+
"STRICT"
|
|
15
|
+
// input.safesearch.toUpperCase() as keyof typeof ddg.SafeSearchType
|
|
16
|
+
];
|
|
17
|
+
const time = ddg.SearchTimeType[(input.time || "y")?.toUpperCase()];
|
|
18
|
+
if (source === "text") {
|
|
19
|
+
const res2 = await ddg.search(
|
|
20
|
+
query,
|
|
21
|
+
{
|
|
22
|
+
region: "wt-wt",
|
|
23
|
+
safeSearch,
|
|
24
|
+
time,
|
|
25
|
+
locale
|
|
26
|
+
},
|
|
27
|
+
{
|
|
28
|
+
uri_modifier: (rawUrl) => {
|
|
29
|
+
const url = new URL(rawUrl);
|
|
30
|
+
url.searchParams.delete("ss_mkt");
|
|
31
|
+
return url.toString();
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
);
|
|
35
|
+
const items2 = res2.results.slice(0, maxResults).map((r) => ({
|
|
36
|
+
snippet: r.description,
|
|
37
|
+
title: r.title,
|
|
38
|
+
link: r.url,
|
|
39
|
+
hostname: r.hostname
|
|
40
|
+
}));
|
|
41
|
+
return { items: items2, total: res2.results.length, vqd: res2.vqd };
|
|
42
|
+
}
|
|
43
|
+
if (source === "news") {
|
|
44
|
+
const res2 = await ddg.searchNews(query, {
|
|
45
|
+
safeSearch,
|
|
46
|
+
time
|
|
47
|
+
});
|
|
48
|
+
const items2 = res2.results.slice(0, maxResults).map((r) => ({
|
|
49
|
+
snippet: r.excerpt,
|
|
50
|
+
title: r.title,
|
|
51
|
+
link: r.url,
|
|
52
|
+
date: r.date,
|
|
53
|
+
// epoch ms
|
|
54
|
+
source: r.syndicate,
|
|
55
|
+
image: r.image,
|
|
56
|
+
relativeTime: r.relativeTime
|
|
57
|
+
}));
|
|
58
|
+
return { items: items2, total: res2.results.length, vqd: res2.vqd };
|
|
59
|
+
}
|
|
60
|
+
const res = await ddg.searchImages(query, { safeSearch });
|
|
61
|
+
const items = res.results.slice(0, maxResults).map((r) => ({
|
|
62
|
+
title: r.title,
|
|
63
|
+
thumbnail: r.thumbnail,
|
|
64
|
+
image: r.image,
|
|
65
|
+
link: r.url,
|
|
66
|
+
height: r.height,
|
|
67
|
+
width: r.width,
|
|
68
|
+
source: r.source
|
|
69
|
+
}));
|
|
70
|
+
return { items, total: res.results.length, vqd: res.vqd };
|
|
71
|
+
}
|
|
72
|
+
var ddgSearchSchema = z.object({
|
|
73
|
+
query: z.string().min(1),
|
|
74
|
+
source: z.enum(["text", "news", "images"]).default("text"),
|
|
75
|
+
locale: z.string().optional().default("en-us"),
|
|
76
|
+
// region: z.string().default('wt-wt'),
|
|
77
|
+
// safesearch: z.enum(['strict', 'moderate', 'off']).default('moderate'),
|
|
78
|
+
time: z.enum(["d", "w", "m", "y"]).optional().default("y"),
|
|
79
|
+
maxResults: z.number().int().positive().max(50).default(5)
|
|
80
|
+
});
|
|
81
|
+
var duckDuckGoSearch = tool({
|
|
82
|
+
description: "A tool for searching the web. Useful for when you need to find information about current events or topics that are not covered in your training data.",
|
|
83
|
+
inputSchema: ddgSearchSchema,
|
|
84
|
+
execute: serp
|
|
85
|
+
});
|
|
86
|
+
export {
|
|
87
|
+
ddgSearchSchema,
|
|
88
|
+
duckDuckGoSearch,
|
|
89
|
+
serp
|
|
90
|
+
};
|
|
91
|
+
//# sourceMappingURL=ddg-search.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../src/lib/ddg-search.ts"],
|
|
4
|
+
"sourcesContent": ["import { tool } from 'ai';\nimport * as ddg from 'duck-duck-scrape';\nimport { uniqBy } from 'lodash-es';\nimport { z } from 'zod';\n\nexport type Source = 'text' | 'news' | 'images';\n\nexport async function serp({\n query,\n source,\n locale = 'en-us',\n maxResults = 50,\n ...input\n}: z.input<typeof ddgSearchSchema>) {\n const safeSearch =\n ddg.SafeSearchType[\n 'STRICT'\n // input.safesearch.toUpperCase() as keyof typeof ddg.SafeSearchType\n ];\n const time =\n ddg.SearchTimeType[\n (input.time || 'y')?.toUpperCase() as keyof typeof ddg.SearchTimeType\n ];\n\n if (source === 'text') {\n const res = await ddg.search(\n query,\n {\n region: 'wt-wt',\n safeSearch,\n time,\n locale,\n },\n {\n uri_modifier: (rawUrl: string) => {\n const url = new URL(rawUrl);\n url.searchParams.delete('ss_mkt');\n return url.toString();\n },\n },\n );\n const items = res.results.slice(0, maxResults).map((r) => ({\n snippet: r.description,\n title: r.title,\n link: r.url,\n hostname: r.hostname,\n }));\n return { items, total: res.results.length, vqd: res.vqd } as const;\n }\n\n if (source === 'news') {\n const res = await ddg.searchNews(query, {\n safeSearch,\n time,\n });\n const items = res.results.slice(0, maxResults).map((r) => ({\n snippet: r.excerpt,\n title: r.title,\n link: r.url,\n date: r.date, // epoch ms\n source: r.syndicate,\n image: r.image,\n relativeTime: r.relativeTime,\n }));\n return { items, total: res.results.length, vqd: res.vqd } as const;\n }\n\n const res = await ddg.searchImages(query, { safeSearch });\n const items = res.results.slice(0, maxResults).map((r) => ({\n title: r.title,\n thumbnail: r.thumbnail,\n image: r.image,\n link: r.url,\n height: r.height,\n width: r.width,\n source: r.source,\n }));\n return { items, total: res.results.length, vqd: res.vqd } as const;\n}\n\nasync function performSearch(query: string) {\n const results = await serp({\n source: 'news',\n query: query,\n });\n const result = uniqBy(results.items as { link: string }[], (it) => it.link);\n return result as typeof results.items;\n}\n\nexport const ddgSearchSchema = z.object({\n query: z.string().min(1),\n source: z.enum(['text', 'news', 'images']).default('text'),\n locale: z.string().optional().default('en-us'),\n // region: z.string().default('wt-wt'),\n // safesearch: z.enum(['strict', 'moderate', 'off']).default('moderate'),\n time: z.enum(['d', 'w', 'm', 'y']).optional().default('y'),\n maxResults: z.number().int().positive().max(50).default(5),\n});\nexport const duckDuckGoSearch = tool({\n description:\n 'A tool for searching the web. Useful for when you need to find information about current events or topics that are not covered in your training data.',\n inputSchema: ddgSearchSchema,\n execute: serp,\n});\n"],
|
|
5
|
+
"mappings": ";AAAA,SAAS,YAAY;AACrB,YAAY,SAAS;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,QAAQ,KAAKA,KAAI,IAAI;AAAA,EAC1D;AAEA,QAAM,MAAM,MAAU,iBAAa,OAAO,EAAE,WAAW,CAAC;AACxD,QAAM,QAAQ,IAAI,QAAQ,MAAM,GAAG,UAAU,EAAE,IAAI,CAAC,OAAO;AAAA,IACzD,OAAO,EAAE;AAAA,IACT,WAAW,EAAE;AAAA,IACb,OAAO,EAAE;AAAA,IACT,MAAM,EAAE;AAAA,IACR,QAAQ,EAAE;AAAA,IACV,OAAO,EAAE;AAAA,IACT,QAAQ,EAAE;AAAA,EACZ,EAAE;AACF,SAAO,EAAE,OAAO,OAAO,IAAI,QAAQ,QAAQ,KAAK,IAAI,IAAI;AAC1D;AAWO,IAAM,kBAAkB,EAAE,OAAO;AAAA,EACtC,OAAO,EAAE,OAAO,EAAE,IAAI,CAAC;AAAA,EACvB,QAAQ,EAAE,KAAK,CAAC,QAAQ,QAAQ,QAAQ,CAAC,EAAE,QAAQ,MAAM;AAAA,EACzD,QAAQ,EAAE,OAAO,EAAE,SAAS,EAAE,QAAQ,OAAO;AAAA;AAAA;AAAA,EAG7C,MAAM,EAAE,KAAK,CAAC,KAAK,KAAK,KAAK,GAAG,CAAC,EAAE,SAAS,EAAE,QAAQ,GAAG;AAAA,EACzD,YAAY,EAAE,OAAO,EAAE,IAAI,EAAE,SAAS,EAAE,IAAI,EAAE,EAAE,QAAQ,CAAC;AAC3D,CAAC;AACM,IAAM,mBAAmB,KAAK;AAAA,EACnC,aACE;AAAA,EACF,aAAa;AAAA,EACb,SAAS;AACX,CAAC;",
|
|
6
|
+
"names": ["res", "items"]
|
|
7
|
+
}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
// packages/toolbox/src/lib/ddg-stocks.ts
|
|
2
|
+
import { tool } from "ai";
|
|
3
|
+
import { stocks as ddgStocks } from "duck-duck-scrape";
|
|
4
|
+
import { z } from "zod";
|
|
5
|
+
var toQuote = (r) => ({
|
|
6
|
+
symbol: r?.Security?.Symbol ?? null,
|
|
7
|
+
name: r?.Security?.Name ?? null,
|
|
8
|
+
exchange: r?.Security?.Market ?? null,
|
|
9
|
+
currency: r?.Currency ?? null,
|
|
10
|
+
last: r?.Last ?? null,
|
|
11
|
+
change: r?.ChangeFromPreviousClose ?? null,
|
|
12
|
+
percentChange: r?.PercentChangeFromPreviousClose ?? null,
|
|
13
|
+
open: r?.Open ?? null,
|
|
14
|
+
high: r?.High ?? null,
|
|
15
|
+
low: r?.Low ?? null,
|
|
16
|
+
prevClose: r?.PreviousClose ?? null,
|
|
17
|
+
volume: r?.Volume ?? null,
|
|
18
|
+
date: r?.Date ?? null,
|
|
19
|
+
time: r?.Time ?? null,
|
|
20
|
+
halted: r?.TradingHalted ?? null,
|
|
21
|
+
source: "DuckDuckGo/Xignite",
|
|
22
|
+
raw: r
|
|
23
|
+
});
|
|
24
|
+
var duckStocks = tool({
|
|
25
|
+
description: "A tool for fetching stock market quotes. Useful for when you need to get the latest stock price and related information for one or more stock symbols.",
|
|
26
|
+
inputSchema: z.object({
|
|
27
|
+
symbols: z.union([z.string().min(1), z.array(z.string().min(1)).min(1)]).transform((s) => Array.isArray(s) ? s : [s]),
|
|
28
|
+
includeRaw: z.boolean().default(false)
|
|
29
|
+
}),
|
|
30
|
+
execute: async ({ symbols, includeRaw }) => {
|
|
31
|
+
const tasks = symbols.map(async (s) => {
|
|
32
|
+
const sym = s.trim().toUpperCase();
|
|
33
|
+
try {
|
|
34
|
+
const r = await ddgStocks(sym);
|
|
35
|
+
if (!r || r.Outcome && r.Outcome !== "Success") {
|
|
36
|
+
return { symbol: sym, error: r?.Message || "No quote" };
|
|
37
|
+
}
|
|
38
|
+
const q = toQuote(r);
|
|
39
|
+
if (!includeRaw) delete q.raw;
|
|
40
|
+
return q;
|
|
41
|
+
} catch (e) {
|
|
42
|
+
return { symbol: sym, error: e?.message || "fetch_failed" };
|
|
43
|
+
}
|
|
44
|
+
});
|
|
45
|
+
const results = await Promise.all(tasks);
|
|
46
|
+
return { results };
|
|
47
|
+
}
|
|
48
|
+
});
|
|
49
|
+
export {
|
|
50
|
+
duckStocks
|
|
51
|
+
};
|
|
52
|
+
//# sourceMappingURL=ddg-stocks.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../src/lib/ddg-stocks.ts"],
|
|
4
|
+
"sourcesContent": ["import { tool } from 'ai';\nimport { stocks as ddgStocks } from 'duck-duck-scrape';\nimport { z } from 'zod';\n\ntype Quote = {\n symbol: string;\n name: string | null;\n exchange: string | null;\n currency: string | null;\n last: number | null;\n change: number | null;\n percentChange: number | null;\n open: number | null;\n high: number | null;\n low: number | null;\n prevClose: number | null;\n volume: number | null;\n date: string | null; // ET\n time: string | null; // ET\n halted: boolean | null;\n source: 'DuckDuckGo/Xignite';\n raw?: unknown; // optional raw for debugging\n};\n\nconst toQuote = (r: any): Quote => ({\n symbol: r?.Security?.Symbol ?? null,\n name: r?.Security?.Name ?? null,\n exchange: r?.Security?.Market ?? null,\n currency: r?.Currency ?? null,\n last: r?.Last ?? null,\n change: r?.ChangeFromPreviousClose ?? null,\n percentChange: r?.PercentChangeFromPreviousClose ?? null,\n open: r?.Open ?? null,\n high: r?.High ?? null,\n low: r?.Low ?? null,\n prevClose: r?.PreviousClose ?? null,\n volume: r?.Volume ?? null,\n date: r?.Date ?? null,\n time: r?.Time ?? null,\n halted: r?.TradingHalted ?? null,\n source: 'DuckDuckGo/Xignite',\n raw: r,\n});\n\nexport const duckStocks = tool({\n description: 'A tool for fetching stock market quotes. Useful for when you need to get the latest stock price and related information for one or more stock symbols.',\n inputSchema: z.object({\n symbols: z\n .union([z.string().min(1), z.array(z.string().min(1)).min(1)])\n .transform((s) => (Array.isArray(s) ? s : [s])),\n includeRaw: z.boolean().default(false),\n }),\n execute: async ({ symbols, includeRaw }) => {\n const tasks = symbols.map(async (s) => {\n const sym = s.trim().toUpperCase();\n try {\n const r = await ddgStocks(sym);\n if (!r || (r.Outcome && r.Outcome !== 'Success')) {\n return { symbol: sym, error: r?.Message || 'No quote' };\n }\n const q = toQuote(r);\n if (!includeRaw) delete q.raw;\n return q;\n } catch (e: any) {\n return { symbol: sym, error: e?.message || 'fetch_failed' };\n }\n });\n const results = await Promise.all(tasks);\n return { results };\n },\n});\n"],
|
|
5
|
+
"mappings": ";AAAA,SAAS,YAAY;AACrB,SAAS,UAAU,iBAAiB;AACpC,SAAS,SAAS;AAsBlB,IAAM,UAAU,CAAC,OAAmB;AAAA,EAClC,QAAQ,GAAG,UAAU,UAAU;AAAA,EAC/B,MAAM,GAAG,UAAU,QAAQ;AAAA,EAC3B,UAAU,GAAG,UAAU,UAAU;AAAA,EACjC,UAAU,GAAG,YAAY;AAAA,EACzB,MAAM,GAAG,QAAQ;AAAA,EACjB,QAAQ,GAAG,2BAA2B;AAAA,EACtC,eAAe,GAAG,kCAAkC;AAAA,EACpD,MAAM,GAAG,QAAQ;AAAA,EACjB,MAAM,GAAG,QAAQ;AAAA,EACjB,KAAK,GAAG,OAAO;AAAA,EACf,WAAW,GAAG,iBAAiB;AAAA,EAC/B,QAAQ,GAAG,UAAU;AAAA,EACrB,MAAM,GAAG,QAAQ;AAAA,EACjB,MAAM,GAAG,QAAQ;AAAA,EACjB,QAAQ,GAAG,iBAAiB;AAAA,EAC5B,QAAQ;AAAA,EACR,KAAK;AACP;AAEO,IAAM,aAAa,KAAK;AAAA,EAC7B,aAAa;AAAA,EACb,aAAa,EAAE,OAAO;AAAA,IACpB,SAAS,EACN,MAAM,CAAC,EAAE,OAAO,EAAE,IAAI,CAAC,GAAG,EAAE,MAAM,EAAE,OAAO,EAAE,IAAI,CAAC,CAAC,EAAE,IAAI,CAAC,CAAC,CAAC,EAC5D,UAAU,CAAC,MAAO,MAAM,QAAQ,CAAC,IAAI,IAAI,CAAC,CAAC,CAAE;AAAA,IAChD,YAAY,EAAE,QAAQ,EAAE,QAAQ,KAAK;AAAA,EACvC,CAAC;AAAA,EACD,SAAS,OAAO,EAAE,SAAS,WAAW,MAAM;AAC1C,UAAM,QAAQ,QAAQ,IAAI,OAAO,MAAM;AACrC,YAAM,MAAM,EAAE,KAAK,EAAE,YAAY;AACjC,UAAI;AACF,cAAM,IAAI,MAAM,UAAU,GAAG;AAC7B,YAAI,CAAC,KAAM,EAAE,WAAW,EAAE,YAAY,WAAY;AAChD,iBAAO,EAAE,QAAQ,KAAK,OAAO,GAAG,WAAW,WAAW;AAAA,QACxD;AACA,cAAM,IAAI,QAAQ,CAAC;AACnB,YAAI,CAAC,WAAY,QAAO,EAAE;AAC1B,eAAO;AAAA,MACT,SAAS,GAAQ;AACf,eAAO,EAAE,QAAQ,KAAK,OAAO,GAAG,WAAW,eAAe;AAAA,MAC5D;AAAA,IACF,CAAC;AACD,UAAM,UAAU,MAAM,QAAQ,IAAI,KAAK;AACvC,WAAO,EAAE,QAAQ;AAAA,EACnB;AACF,CAAC;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,196 @@
|
|
|
1
|
+
// packages/toolbox/src/lib/filesystem.ts
|
|
2
|
+
import { dynamicTool, jsonSchema, tool } from "ai";
|
|
3
|
+
import FastGlob from "fast-glob";
|
|
4
|
+
import spawn from "nano-spawn";
|
|
5
|
+
import { readFile, readdir, stat } from "node:fs/promises";
|
|
6
|
+
import { basename, join, relative } from "node:path";
|
|
7
|
+
import z from "zod";
|
|
8
|
+
import { fastembed, nodeSQLite, similaritySearch } from "@deepagents/retrieval";
|
|
9
|
+
import * as connectors from "@deepagents/retrieval/connectors";
|
|
10
|
+
import { ignorePatterns } from "@deepagents/retrieval/connectors";
|
|
11
|
+
|
|
12
|
+
// packages/toolbox/src/lib/state.ts
|
|
13
|
+
function toState(options) {
|
|
14
|
+
return options.context;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
// packages/toolbox/src/lib/filesystem.ts
|
|
18
|
+
var read_file_tool = tool({
|
|
19
|
+
description: `Use this tool to read a file from the filesystem. Supports reading entire files or specific line ranges.`,
|
|
20
|
+
inputSchema: z.object({
|
|
21
|
+
filePath: z.string().min(1),
|
|
22
|
+
lineStart: z.coerce.number().int().positive().optional().describe(
|
|
23
|
+
"Starting line number (1-indexed). If omitted, reads from the beginning."
|
|
24
|
+
),
|
|
25
|
+
lineEnd: z.coerce.number().int().positive().optional().describe(
|
|
26
|
+
"Ending line number (1-indexed). If omitted, reads to the end. Maximum 200 lines can be read at once."
|
|
27
|
+
)
|
|
28
|
+
}),
|
|
29
|
+
execute: async ({ filePath, lineStart, lineEnd }, options) => {
|
|
30
|
+
const context = toState(options);
|
|
31
|
+
const fullPath = join(context.repo_path, filePath);
|
|
32
|
+
const stats = await stat(fullPath);
|
|
33
|
+
const maxSize = 100 * 1024;
|
|
34
|
+
if (stats.size > maxSize) {
|
|
35
|
+
return `File too large to read (size: ${stats.size} bytes, max: ${maxSize} bytes)`;
|
|
36
|
+
}
|
|
37
|
+
try {
|
|
38
|
+
const content = await readFile(fullPath, "utf-8");
|
|
39
|
+
if (!lineStart && !lineEnd) {
|
|
40
|
+
return content;
|
|
41
|
+
}
|
|
42
|
+
const lines = content.split("\n");
|
|
43
|
+
const start = (lineStart ?? 1) - 1;
|
|
44
|
+
const end = lineEnd ?? lines.length;
|
|
45
|
+
if (start < 0 || start >= lines.length) {
|
|
46
|
+
return `Invalid lineStart: ${lineStart}. File has ${lines.length} lines.`;
|
|
47
|
+
}
|
|
48
|
+
if (end < start) {
|
|
49
|
+
return `Invalid range: lineEnd (${lineEnd}) must be >= lineStart (${lineStart})`;
|
|
50
|
+
}
|
|
51
|
+
const maxLines = 200;
|
|
52
|
+
const requestedLines = end - start;
|
|
53
|
+
if (requestedLines > maxLines) {
|
|
54
|
+
return `Too many lines requested (${requestedLines}). Maximum is ${maxLines} lines.`;
|
|
55
|
+
}
|
|
56
|
+
return lines.slice(start, end).join("\n");
|
|
57
|
+
} catch (error) {
|
|
58
|
+
console.error("Error reading file:", error);
|
|
59
|
+
return `Error reading file: ${JSON.stringify(error)}`;
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
});
|
|
63
|
+
var read_dir_tool = tool({
|
|
64
|
+
description: "Use this tool to list files in a directory.",
|
|
65
|
+
inputSchema: z.object({
|
|
66
|
+
dir_path: z.string().min(1).optional().default("./").describe('Relative path to the directory. Defaults to "./"')
|
|
67
|
+
}),
|
|
68
|
+
execute: async ({ dir_path }, options) => {
|
|
69
|
+
const context = toState(options);
|
|
70
|
+
return readdir(join(context.repo_path, dir_path), "utf-8");
|
|
71
|
+
}
|
|
72
|
+
});
|
|
73
|
+
var glob_tool = tool({
|
|
74
|
+
description: `Use this tool to list files in a directory.
|
|
75
|
+
This tool returns only direct files and directories that match the provided glob pattern.
|
|
76
|
+
Make sure not to look for framework generated files, such as ios/android folders in a react native project or .next in a nextjs project and so on.
|
|
77
|
+
`,
|
|
78
|
+
inputSchema: z.object({
|
|
79
|
+
pattern: z.string().min(1).describe("A glob pattern to match files. ")
|
|
80
|
+
}),
|
|
81
|
+
execute: async ({ pattern }, options) => {
|
|
82
|
+
const context = toState(options);
|
|
83
|
+
const files = await FastGlob(pattern, {
|
|
84
|
+
dot: true,
|
|
85
|
+
cwd: context.repo_path,
|
|
86
|
+
unique: true,
|
|
87
|
+
deep: 1,
|
|
88
|
+
followSymbolicLinks: false,
|
|
89
|
+
ignore: await ignorePatterns(context.repo_path)
|
|
90
|
+
});
|
|
91
|
+
return files;
|
|
92
|
+
}
|
|
93
|
+
});
|
|
94
|
+
var search_files_tool = tool({
|
|
95
|
+
description: "Search for files in the repository by name or extension. Returns relative file paths. Avoids framework-generated and ignored paths.",
|
|
96
|
+
inputSchema: z.object({
|
|
97
|
+
pattern: z.string().min(1).describe("A glob pattern to match files."),
|
|
98
|
+
max_results: z.number().int().positive().max(500).optional().default(100),
|
|
99
|
+
depth: z.number().int().describe("Max directory depth to search. defaults to 31.")
|
|
100
|
+
}),
|
|
101
|
+
execute: async ({ pattern, max_results = 100, depth }, options) => {
|
|
102
|
+
const context = toState(options);
|
|
103
|
+
const ignore = await ignorePatterns(context.repo_path);
|
|
104
|
+
const files = await FastGlob(pattern, {
|
|
105
|
+
dot: false,
|
|
106
|
+
cwd: context.repo_path,
|
|
107
|
+
unique: true,
|
|
108
|
+
deep: depth,
|
|
109
|
+
followSymbolicLinks: false,
|
|
110
|
+
ignore
|
|
111
|
+
});
|
|
112
|
+
return files.slice(0, max_results);
|
|
113
|
+
}
|
|
114
|
+
});
|
|
115
|
+
var file_exists_tool = tool({
|
|
116
|
+
description: "Check if a file exists in the repository.",
|
|
117
|
+
inputSchema: z.object({ filePath: z.string().min(1) }),
|
|
118
|
+
execute: async ({ filePath }, options) => {
|
|
119
|
+
const context = toState(options);
|
|
120
|
+
return stat(join(context.repo_path, filePath)).then(() => true).catch(() => false);
|
|
121
|
+
}
|
|
122
|
+
});
|
|
123
|
+
var search_content_tool = dynamicTool({
|
|
124
|
+
description: `Use this tool to search the content of files in the repository. this tool is backed by a vector database and uses semantic search to find the most relevant snippets of content.`,
|
|
125
|
+
// inputSchema: z.object({
|
|
126
|
+
// query: z.string().min(1).describe('The search query.'),
|
|
127
|
+
// }),
|
|
128
|
+
inputSchema: jsonSchema({
|
|
129
|
+
additionalProperties: true,
|
|
130
|
+
type: "object",
|
|
131
|
+
properties: {
|
|
132
|
+
query: {
|
|
133
|
+
type: "string",
|
|
134
|
+
description: "The search query."
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
}),
|
|
138
|
+
async execute(input, options) {
|
|
139
|
+
const keys = Object.keys(input).filter((k) => k !== "query");
|
|
140
|
+
if (keys.length > 0) {
|
|
141
|
+
return `Invalid input: only "query" is supported. Found extra keys: ${keys.join(", ")}`;
|
|
142
|
+
}
|
|
143
|
+
if (typeof input.query !== "string" || input.query.trim().length === 0) {
|
|
144
|
+
return 'Invalid input: "query" must be a non-empty string.';
|
|
145
|
+
}
|
|
146
|
+
try {
|
|
147
|
+
const context = toState(options);
|
|
148
|
+
const results = await similaritySearch(input.query, {
|
|
149
|
+
connector: connectors.repo(
|
|
150
|
+
context.repo_path,
|
|
151
|
+
[".ts", ".tsx", ".md", ".prisma"],
|
|
152
|
+
"never"
|
|
153
|
+
),
|
|
154
|
+
store: nodeSQLite("deepsearch.sqlite", 384),
|
|
155
|
+
embedder: fastembed()
|
|
156
|
+
});
|
|
157
|
+
const contents = results.map((it) => {
|
|
158
|
+
const source = relative(context.repo_path, it.document_id);
|
|
159
|
+
const filename = basename(source);
|
|
160
|
+
return {
|
|
161
|
+
source,
|
|
162
|
+
snippet: it.content,
|
|
163
|
+
citation: `[${filename}](./${source})`
|
|
164
|
+
};
|
|
165
|
+
});
|
|
166
|
+
return contents.map(
|
|
167
|
+
(it) => [
|
|
168
|
+
`File: ${it.source}`,
|
|
169
|
+
`Citation: ${it.citation}`,
|
|
170
|
+
"```",
|
|
171
|
+
it.snippet,
|
|
172
|
+
"```"
|
|
173
|
+
].join("\n")
|
|
174
|
+
).join("\n\n------\n\n");
|
|
175
|
+
} catch (error) {
|
|
176
|
+
console.error("Error in search_content_tool:", error);
|
|
177
|
+
return `Error during content search: ${JSON.stringify(error)}`;
|
|
178
|
+
}
|
|
179
|
+
}
|
|
180
|
+
});
|
|
181
|
+
async function repoTree(dir_path) {
|
|
182
|
+
const result = await spawn("git", ["ls-tree", "-r", "HEAD", "--name-only"], {
|
|
183
|
+
cwd: dir_path
|
|
184
|
+
}).pipe("tree", ["--fromfile"]);
|
|
185
|
+
return result.output;
|
|
186
|
+
}
|
|
187
|
+
export {
|
|
188
|
+
file_exists_tool,
|
|
189
|
+
glob_tool,
|
|
190
|
+
read_dir_tool,
|
|
191
|
+
read_file_tool,
|
|
192
|
+
repoTree,
|
|
193
|
+
search_content_tool,
|
|
194
|
+
search_files_tool
|
|
195
|
+
};
|
|
196
|
+
//# sourceMappingURL=filesystem.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../src/lib/filesystem.ts", "../../src/lib/state.ts"],
|
|
4
|
+
"sourcesContent": ["import { dynamicTool, jsonSchema, tool } from 'ai';\nimport FastGlob from 'fast-glob';\nimport spawn from 'nano-spawn';\nimport { readFile, readdir, stat } from 'node:fs/promises';\nimport { basename, join, relative } from 'node:path';\nimport z from 'zod';\n\nimport { fastembed, nodeSQLite, similaritySearch } from '@deepagents/retrieval';\nimport * as connectors from '@deepagents/retrieval/connectors';\nimport { ignorePatterns } from '@deepagents/retrieval/connectors';\n\nimport { toState } from './state.ts';\n\nexport const read_file_tool = tool({\n description: `Use this tool to read a file from the filesystem. Supports reading entire files or specific line ranges.`,\n inputSchema: z.object({\n filePath: z.string().min(1),\n lineStart: z.coerce\n .number()\n .int()\n .positive()\n .optional()\n .describe(\n 'Starting line number (1-indexed). If omitted, reads from the beginning.',\n ),\n lineEnd: z.coerce\n .number()\n .int()\n .positive()\n .optional()\n .describe(\n 'Ending line number (1-indexed). If omitted, reads to the end. Maximum 200 lines can be read at once.',\n ),\n }),\n execute: async ({ filePath, lineStart, lineEnd }, options) => {\n const context = toState<{ repo_path: string }>(options);\n const fullPath = join(context.repo_path, filePath);\n\n const stats = await stat(fullPath);\n const maxSize = 100 * 1024; // 100 KB\n\n if (stats.size > maxSize) {\n return `File too large to read (size: ${stats.size} bytes, max: ${maxSize} bytes)`;\n }\n\n try {\n const content = await readFile(fullPath, 'utf-8');\n\n // If no line parameters specified, return entire file\n if (!lineStart && !lineEnd) {\n return content;\n }\n\n const lines = content.split('\\n');\n const start = (lineStart ?? 1) - 1; // Convert to 0-indexed\n const end = lineEnd ?? lines.length; // Default to end of file\n\n // Validate line range\n if (start < 0 || start >= lines.length) {\n return `Invalid lineStart: ${lineStart}. File has ${lines.length} lines.`;\n }\n\n if (end < start) {\n return `Invalid range: lineEnd (${lineEnd}) must be >= lineStart (${lineStart})`;\n }\n\n const maxLines = 200;\n const requestedLines = end - start;\n if (requestedLines > maxLines) {\n return `Too many lines requested (${requestedLines}). Maximum is ${maxLines} lines.`;\n }\n\n return lines.slice(start, end).join('\\n');\n } catch (error) {\n console.error('Error reading file:', error);\n return `Error reading file: ${JSON.stringify(error)}`;\n }\n },\n});\n\nexport const read_dir_tool = tool({\n description: 'Use this tool to list files in a directory.',\n inputSchema: z.object({\n dir_path: z\n .string()\n .min(1)\n .optional()\n .default('./')\n .describe('Relative path to the directory. Defaults to \"./\"'),\n }),\n execute: async ({ dir_path }, options) => {\n const context = toState<{ repo_path: string }>(options);\n return readdir(join(context.repo_path, dir_path), 'utf-8');\n },\n});\n\nexport const glob_tool = tool({\n description: `Use this tool to list files in a directory.\n\t\t\tThis tool returns only direct files and directories that match the provided glob pattern.\n\t\t\tMake sure not to look for framework generated files, such as ios/android folders in a react native project or .next in a nextjs project and so on.\n\t\t\t`,\n inputSchema: z.object({\n pattern: z.string().min(1).describe('A glob pattern to match files. '),\n }),\n execute: async ({ pattern }, options) => {\n const context = toState<{ repo_path: string }>(options);\n const files = await FastGlob(pattern, {\n dot: true,\n cwd: context.repo_path,\n unique: true,\n deep: 1,\n followSymbolicLinks: false,\n ignore: await ignorePatterns(context.repo_path),\n });\n return files;\n },\n});\n\nexport const search_files_tool = tool({\n description:\n 'Search for files in the repository by name or extension. Returns relative file paths. Avoids framework-generated and ignored paths.',\n inputSchema: z.object({\n pattern: z.string().min(1).describe('A glob pattern to match files.'),\n max_results: z.number().int().positive().max(500).optional().default(100),\n depth: z\n .number()\n .int()\n .describe('Max directory depth to search. defaults to 31.'),\n }),\n execute: async ({ pattern, max_results = 100, depth }, options) => {\n const context = toState<{ repo_path: string }>(options);\n const ignore = await ignorePatterns(context.repo_path);\n const files = await FastGlob(pattern, {\n dot: false,\n cwd: context.repo_path,\n unique: true,\n deep: depth,\n followSymbolicLinks: false,\n ignore,\n });\n return files.slice(0, max_results);\n },\n});\n\nexport const file_exists_tool = tool({\n description: 'Check if a file exists in the repository.',\n inputSchema: z.object({ filePath: z.string().min(1) }),\n execute: async ({ filePath }, options) => {\n const context = toState<{ repo_path: string }>(options);\n return stat(join(context.repo_path, filePath))\n .then(() => true)\n .catch(() => false);\n },\n});\n\nexport const search_content_tool = dynamicTool({\n description: `Use this tool to search the content of files in the repository. this tool is backed by a vector database and uses semantic search to find the most relevant snippets of content.`,\n // inputSchema: z.object({\n // query: z.string().min(1).describe('The search query.'),\n // }),\n inputSchema: jsonSchema({\n additionalProperties: true,\n type: 'object',\n properties: {\n query: {\n type: 'string',\n description: 'The search query.',\n },\n },\n }),\n async execute(input: any, options) {\n const keys = Object.keys(input).filter((k) => k !== 'query');\n if (keys.length > 0) {\n return `Invalid input: only \"query\" is supported. Found extra keys: ${keys.join(', ')}`;\n }\n if (typeof input.query !== 'string' || input.query.trim().length === 0) {\n return 'Invalid input: \"query\" must be a non-empty string.';\n }\n try {\n const context = toState<{ repo_path: string }>(options);\n const results = await similaritySearch(input.query, {\n connector: connectors.repo(\n context.repo_path,\n ['.ts', '.tsx', '.md', '.prisma'],\n 'never',\n ),\n\n store: nodeSQLite('deepsearch.sqlite', 384),\n embedder: fastembed(),\n });\n const contents = results.map((it) => {\n const source = relative(context.repo_path, it.document_id);\n const filename = basename(source);\n return {\n source: source,\n snippet: it.content,\n citation: `[${filename}](./${source})`,\n };\n });\n return contents\n .map((it) =>\n [\n `File: ${it.source}`,\n `Citation: ${it.citation}`,\n '```',\n it.snippet,\n '```',\n ].join('\\n'),\n )\n .join('\\n\\n------\\n\\n');\n } catch (error) {\n console.error('Error in search_content_tool:', error);\n return `Error during content search: ${JSON.stringify(error)}`;\n }\n },\n});\n\nexport async function repoTree(dir_path: string) {\n const result = await spawn('git', ['ls-tree', '-r', 'HEAD', '--name-only'], {\n cwd: dir_path,\n }).pipe('tree', ['--fromfile']);\n return result.output;\n}\n", "import type { ToolExecutionOptions } from 'ai';\n\nexport function toState<C>(options: ToolExecutionOptions<any>): C {\n return options.context as C;\n}\n"],
|
|
5
|
+
"mappings": ";AAAA,SAAS,aAAa,YAAY,YAAY;AAC9C,OAAO,cAAc;AACrB,OAAO,WAAW;AAClB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