@wrongstack/tools 0.2.0 → 0.3.2
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 +1 -1
- package/dist/audit.js +1 -0
- package/dist/audit.js.map +1 -1
- package/dist/bash.js +1 -0
- package/dist/bash.js.map +1 -1
- package/dist/batch-tool-use.js +1 -0
- package/dist/batch-tool-use.js.map +1 -1
- package/dist/builtin.js +58 -8
- package/dist/builtin.js.map +1 -1
- package/dist/diff.js +1 -0
- package/dist/diff.js.map +1 -1
- package/dist/document.js +1 -0
- package/dist/document.js.map +1 -1
- package/dist/edit.js +1 -0
- package/dist/edit.js.map +1 -1
- package/dist/exec.js +5 -4
- package/dist/exec.js.map +1 -1
- package/dist/fetch.js +5 -1
- package/dist/fetch.js.map +1 -1
- package/dist/format.js +1 -0
- package/dist/format.js.map +1 -1
- package/dist/git.js +3 -2
- package/dist/git.js.map +1 -1
- package/dist/glob.js +1 -0
- package/dist/glob.js.map +1 -1
- package/dist/grep.js +18 -1
- package/dist/grep.js.map +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.js +69 -9
- package/dist/index.js.map +1 -1
- package/dist/install.js +1 -0
- package/dist/install.js.map +1 -1
- package/dist/json.js +1 -0
- package/dist/json.js.map +1 -1
- package/dist/lint.js +1 -0
- package/dist/lint.js.map +1 -1
- package/dist/logs.js +1 -0
- package/dist/logs.js.map +1 -1
- package/dist/memory.js +2 -0
- package/dist/memory.js.map +1 -1
- package/dist/mode.js +1 -0
- package/dist/mode.js.map +1 -1
- package/dist/outdated.js +1 -0
- package/dist/outdated.js.map +1 -1
- package/dist/pack.d.ts +9 -0
- package/dist/pack.js +4219 -0
- package/dist/pack.js.map +1 -0
- package/dist/patch.js +1 -0
- package/dist/patch.js.map +1 -1
- package/dist/read.js +1 -0
- package/dist/read.js.map +1 -1
- package/dist/replace.js +1 -0
- package/dist/replace.js.map +1 -1
- package/dist/scaffold.js +1 -0
- package/dist/scaffold.js.map +1 -1
- package/dist/search.js +1 -0
- package/dist/search.js.map +1 -1
- package/dist/test.js +1 -0
- package/dist/test.js.map +1 -1
- package/dist/todo.js +1 -0
- package/dist/todo.js.map +1 -1
- package/dist/tool-help.js +1 -0
- package/dist/tool-help.js.map +1 -1
- package/dist/tool-search.js +1 -0
- package/dist/tool-search.js.map +1 -1
- package/dist/tool-use.js +1 -0
- package/dist/tool-use.js.map +1 -1
- package/dist/tree.js +1 -0
- package/dist/tree.js.map +1 -1
- package/dist/typecheck.js +1 -0
- package/dist/typecheck.js.map +1 -1
- package/dist/write.js +1 -0
- package/dist/write.js.map +1 -1
- package/package.json +6 -2
package/dist/index.js
CHANGED
|
@@ -48,6 +48,7 @@ function isBinaryBuffer(buf) {
|
|
|
48
48
|
var MAX_BYTES = 5 * 1024 * 1024;
|
|
49
49
|
var readTool = {
|
|
50
50
|
name: "read",
|
|
51
|
+
category: "Filesystem",
|
|
51
52
|
description: "Read the contents of a file. Lines are 1-indexed and prefixed with line numbers.",
|
|
52
53
|
usageHint: "Read a file before editing it. Returns lines numbered like ` 1\u2192content`. Use `offset` and `limit` for large files (default reads up to 2000 lines).",
|
|
53
54
|
permission: "auto",
|
|
@@ -99,6 +100,7 @@ var readTool = {
|
|
|
99
100
|
};
|
|
100
101
|
var writeTool = {
|
|
101
102
|
name: "write",
|
|
103
|
+
category: "Filesystem",
|
|
102
104
|
description: "Write or overwrite a file. For existing files, prefer `edit` over `write`.",
|
|
103
105
|
usageHint: "Use `write` for new files or full replacements. For partial edits use `edit`. Existing files must have been `read` first in this session.",
|
|
104
106
|
permission: "confirm",
|
|
@@ -149,6 +151,7 @@ var writeTool = {
|
|
|
149
151
|
};
|
|
150
152
|
var editTool = {
|
|
151
153
|
name: "edit",
|
|
154
|
+
category: "Filesystem",
|
|
152
155
|
description: "Make a surgical edit by replacing exact text. Fails if `old_string` is not unique unless `replace_all` is true.",
|
|
153
156
|
usageHint: "Always `read` the file first. `old_string` must be an EXACT match (whitespace included). If multiple matches exist, either narrow `old_string` with more context or set `replace_all: true`.",
|
|
154
157
|
permission: "confirm",
|
|
@@ -302,6 +305,7 @@ function capSubject(line) {
|
|
|
302
305
|
var DEFAULT_IGNORE = ["node_modules", ".git", "dist", "build", ".next", "coverage"];
|
|
303
306
|
var replaceTool = {
|
|
304
307
|
name: "replace",
|
|
308
|
+
category: "Transform",
|
|
305
309
|
description: "Batch replace a pattern across multiple files matched by glob. Returns diff for each modified file.",
|
|
306
310
|
usageHint: 'Use `glob` for broad patterns (e.g. "**/*.ts"). Set `dry_run: true` to preview without modifying. `files` can be a single path, comma-separated list, or glob pattern.',
|
|
307
311
|
permission: "confirm",
|
|
@@ -491,6 +495,7 @@ async function globNative(pattern, base, extraGlob) {
|
|
|
491
495
|
var DEFAULT_IGNORE2 = ["node_modules", ".git", "dist", "build", ".next", "coverage", ".turbo"];
|
|
492
496
|
var globTool = {
|
|
493
497
|
name: "glob",
|
|
498
|
+
category: "Filesystem",
|
|
494
499
|
description: "Find files matching a glob pattern. Returns paths sorted by mtime (newest first).",
|
|
495
500
|
usageHint: "Examples: `**/*.ts`, `src/**/*.test.ts`, `*.json`. Common dirs (node_modules, .git, dist) are ignored by default. Returns up to 1000 paths.",
|
|
496
501
|
permission: "auto",
|
|
@@ -565,6 +570,7 @@ async function readGitignore(dir) {
|
|
|
565
570
|
var DEFAULT_IGNORE3 = ["node_modules", ".git", "dist", "build", ".next", "coverage"];
|
|
566
571
|
var grepTool = {
|
|
567
572
|
name: "grep",
|
|
573
|
+
category: "Search",
|
|
568
574
|
description: "Search file contents with a regex. Uses ripgrep when available.",
|
|
569
575
|
usageHint: 'Pattern is regex. Use `output_mode: "content"` for matched lines, `"files_with_matches"` for paths, `"count"` for tallies. `glob` filters files (e.g. `*.ts`).',
|
|
570
576
|
permission: "auto",
|
|
@@ -597,6 +603,10 @@ var grepTool = {
|
|
|
597
603
|
const base = input.path ? safeResolve(input.path, ctx) : ctx.cwd;
|
|
598
604
|
const mode = input.output_mode ?? "content";
|
|
599
605
|
const limit = Math.max(1, Math.min(input.limit ?? 200, 2e3));
|
|
606
|
+
const validation = compileUserRegex(input.pattern, input.case_insensitive ? "i" : "");
|
|
607
|
+
if (!validation.ok) {
|
|
608
|
+
throw new Error(`grep: ${validation.reason}`);
|
|
609
|
+
}
|
|
600
610
|
const rgAvailable = await detectRg(opts.signal);
|
|
601
611
|
if (rgAvailable) {
|
|
602
612
|
try {
|
|
@@ -630,11 +640,15 @@ async function* runRgStream(input, base, mode, limit, signal) {
|
|
|
630
640
|
args.push("-n");
|
|
631
641
|
if (input.context_lines) args.push("-C", String(input.context_lines));
|
|
632
642
|
}
|
|
643
|
+
for (const ignored of DEFAULT_IGNORE3) {
|
|
644
|
+
args.push("--glob", `!${ignored}/**`, "--glob", `!**/${ignored}/**`);
|
|
645
|
+
}
|
|
633
646
|
if (input.glob) args.push("--glob", input.glob);
|
|
634
647
|
args.push("--", input.pattern, base);
|
|
635
648
|
const matches = [];
|
|
636
649
|
let buf = "";
|
|
637
650
|
let totalLines = 0;
|
|
651
|
+
let totalCount = 0;
|
|
638
652
|
let batchSinceFlush = 0;
|
|
639
653
|
const FLUSH_AT = 16;
|
|
640
654
|
const MAX_BUF_BYTES = 1e6;
|
|
@@ -691,6 +705,7 @@ async function* runRgStream(input, base, mode, limit, signal) {
|
|
|
691
705
|
for (const line of ready.split("\n")) {
|
|
692
706
|
if (!line) continue;
|
|
693
707
|
totalLines++;
|
|
708
|
+
if (mode === "count") totalCount += parseRgCountLine(line);
|
|
694
709
|
if (matches.length < limit) {
|
|
695
710
|
matches.push(line);
|
|
696
711
|
pendingBatch.push(line);
|
|
@@ -711,6 +726,7 @@ async function* runRgStream(input, base, mode, limit, signal) {
|
|
|
711
726
|
for (const line of buf.split("\n")) {
|
|
712
727
|
if (!line) continue;
|
|
713
728
|
totalLines++;
|
|
729
|
+
if (mode === "count") totalCount += parseRgCountLine(line);
|
|
714
730
|
if (matches.length < limit) {
|
|
715
731
|
matches.push(line);
|
|
716
732
|
pendingBatch.push(line);
|
|
@@ -729,12 +745,18 @@ async function* runRgStream(input, base, mode, limit, signal) {
|
|
|
729
745
|
type: "final",
|
|
730
746
|
output: {
|
|
731
747
|
matches,
|
|
732
|
-
count: totalLines,
|
|
748
|
+
count: mode === "count" ? totalCount : totalLines,
|
|
733
749
|
truncated: totalLines > limit || bufOverflow,
|
|
734
750
|
used: "rg"
|
|
735
751
|
}
|
|
736
752
|
};
|
|
737
753
|
}
|
|
754
|
+
function parseRgCountLine(line) {
|
|
755
|
+
const idx = line.lastIndexOf(":");
|
|
756
|
+
if (idx === -1) return 0;
|
|
757
|
+
const n = Number.parseInt(line.slice(idx + 1), 10);
|
|
758
|
+
return Number.isFinite(n) ? n : 0;
|
|
759
|
+
}
|
|
738
760
|
async function runNative(input, base, mode, limit, signal) {
|
|
739
761
|
const flags = input.case_insensitive ? "i" : "";
|
|
740
762
|
const compiled = compileUserRegex(input.pattern, flags);
|
|
@@ -815,6 +837,7 @@ var STREAM_FLUSH_INTERVAL_MS = 200;
|
|
|
815
837
|
var STREAM_FLUSH_BYTES = 4 * 1024;
|
|
816
838
|
var bashTool = {
|
|
817
839
|
name: "bash",
|
|
840
|
+
category: "Shell",
|
|
818
841
|
description: "Run a shell command. stdout and stderr are merged.",
|
|
819
842
|
usageHint: "Runs via `bash -c` (or `cmd /c` on Windows). Cwd is the project root. Default timeout 30s. Output truncated from the middle if oversized. Use for git, npm, builds, tests.",
|
|
820
843
|
permission: "confirm",
|
|
@@ -991,9 +1014,9 @@ var bashTool = {
|
|
|
991
1014
|
}
|
|
992
1015
|
};
|
|
993
1016
|
var ALLOWED_COMMANDS = {
|
|
994
|
-
node: ["--version", "-
|
|
995
|
-
npm: ["--version", "init", "install", "test", "
|
|
996
|
-
pnpm: ["--version", "init", "install", "add", "remove", "
|
|
1017
|
+
node: ["--version", "-r", "--input-type=module"],
|
|
1018
|
+
npm: ["--version", "init", "install", "test", "list", "pkg", "doctor"],
|
|
1019
|
+
pnpm: ["--version", "init", "install", "add", "remove", "list"],
|
|
997
1020
|
npx: ["--version"],
|
|
998
1021
|
git: [
|
|
999
1022
|
"--version",
|
|
@@ -1021,7 +1044,7 @@ var ALLOWED_COMMANDS = {
|
|
|
1021
1044
|
mv: [],
|
|
1022
1045
|
rm: ["-rf"],
|
|
1023
1046
|
touch: [],
|
|
1024
|
-
bun: ["--version", "
|
|
1047
|
+
bun: ["--version", "add", "init"],
|
|
1025
1048
|
tsc: ["--version", "--noEmit", "--project"],
|
|
1026
1049
|
vitest: ["--version", "run", "--coverage"],
|
|
1027
1050
|
biome: ["--version", "lint", "format", "check"],
|
|
@@ -1038,6 +1061,7 @@ var MAX_OUTPUT2 = 2e5;
|
|
|
1038
1061
|
var TIMEOUT_MS = 3e4;
|
|
1039
1062
|
var execTool = {
|
|
1040
1063
|
name: "exec",
|
|
1064
|
+
category: "Shell",
|
|
1041
1065
|
description: "Restricted shell that only runs pre-approved commands with constrained arguments. Safer alternative to `bash`.",
|
|
1042
1066
|
usageHint: "Set `command` (must be in allowlist). `args` passed through. For arbitrary shell access use the `bash` tool instead.",
|
|
1043
1067
|
permission: "confirm",
|
|
@@ -1183,6 +1207,7 @@ async function fetchWithRedirectLimit(url, maxRedirects, signal) {
|
|
|
1183
1207
|
}
|
|
1184
1208
|
var fetchTool = {
|
|
1185
1209
|
name: "fetch",
|
|
1210
|
+
category: "Network",
|
|
1186
1211
|
description: "Fetch the contents of a URL. HTML is converted to markdown by default.",
|
|
1187
1212
|
usageHint: "HTTPS only by default. Localhost and RFC1918 ranges blocked unless WRONGSTACK_FETCH_ALLOW_PRIVATE=1. Max 5 redirects, 20s timeout, 128KB cap.",
|
|
1188
1213
|
permission: "confirm",
|
|
@@ -1414,7 +1439,10 @@ function htmlToMarkdown(html) {
|
|
|
1414
1439
|
});
|
|
1415
1440
|
s = s.replace(/<(strong|b)[^>]*>([\s\S]*?)<\/\1>/gi, "**$2**");
|
|
1416
1441
|
s = s.replace(/<(em|i)[^>]*>([\s\S]*?)<\/\1>/gi, "*$2*");
|
|
1417
|
-
s = s.replace(/<a [^>]*href="([^"]+)"[^>]*>([\s\S]*?)<\/a>/gi,
|
|
1442
|
+
s = s.replace(/<a [^>]*href="([^"]+)"[^>]*>([\s\S]*?)<\/a>/gi, (_m, href, text) => {
|
|
1443
|
+
const safe = /^(https?|ftps?):\/\//i.test(href);
|
|
1444
|
+
return safe ? `[${text}](${href})` : text;
|
|
1445
|
+
});
|
|
1418
1446
|
s = s.replace(/<pre[^>]*>([\s\S]*?)<\/pre>/gi, (_m, c) => "\n```\n" + stripTags(c) + "\n```\n");
|
|
1419
1447
|
s = s.replace(/<code[^>]*>([\s\S]*?)<\/code>/gi, "`$1`");
|
|
1420
1448
|
s = s.replace(/<li[^>]*>([\s\S]*?)<\/li>/gi, "- $1\n");
|
|
@@ -1434,6 +1462,7 @@ var MAX_RESULTS = 50;
|
|
|
1434
1462
|
var TIMEOUT_MS3 = 15e3;
|
|
1435
1463
|
var searchTool = {
|
|
1436
1464
|
name: "search",
|
|
1465
|
+
category: "Search",
|
|
1437
1466
|
description: "Search the web for information. Returns title, URL, and snippet for each result.",
|
|
1438
1467
|
usageHint: "Set `num_results` (1-50, default 10). Use `source` to pick engine: duckduckgo (default), google, bing.",
|
|
1439
1468
|
permission: "confirm",
|
|
@@ -1644,6 +1673,7 @@ function stripTags2(html) {
|
|
|
1644
1673
|
// src/todo.ts
|
|
1645
1674
|
var todoTool = {
|
|
1646
1675
|
name: "todo",
|
|
1676
|
+
category: "Session",
|
|
1647
1677
|
description: "Replace the current todo list with a new set of items.",
|
|
1648
1678
|
usageHint: "Use for multi-step tasks. Replace the full list on each call. At most ONE task may be in_progress at a time. Items have id, content, status (pending|in_progress|completed), and optional activeForm.",
|
|
1649
1679
|
permission: "auto",
|
|
@@ -1692,6 +1722,7 @@ var todoTool = {
|
|
|
1692
1722
|
};
|
|
1693
1723
|
var planTool = {
|
|
1694
1724
|
name: "plan",
|
|
1725
|
+
category: "Session",
|
|
1695
1726
|
description: "Inspect or edit the strategic plan board for this session. Plans persist across resume (unlike todos). Use this to lay out the multi-step approach before diving in, then mark steps in_progress/done as the work proceeds.",
|
|
1696
1727
|
usageHint: "Set action to one of: show | add | start | done | remove | clear. Pass `title` for add. Pass `target` (item id, 1-based index, or title substring) for start/done/remove. Always returns the formatted plan plus open/total counts.",
|
|
1697
1728
|
permission: "auto",
|
|
@@ -1791,6 +1822,7 @@ var TIMEOUT_MS4 = 3e4;
|
|
|
1791
1822
|
var MAX_OUTPUT3 = 1e5;
|
|
1792
1823
|
var gitTool = {
|
|
1793
1824
|
name: "git",
|
|
1825
|
+
category: "Git",
|
|
1794
1826
|
description: "Run git commands. Wraps common operations: status, log, diff, commit, branch, checkout, stash, push, pull, fetch, reset.",
|
|
1795
1827
|
usageHint: "Prefer built-in subcommands over raw args. `command` is required. `message` for commits. `branch` for checkout/branch. `files` for status/diff. `format` for log.",
|
|
1796
1828
|
permission: "confirm",
|
|
@@ -1892,11 +1924,11 @@ function buildArgs(input) {
|
|
|
1892
1924
|
...files.length ? ["--", ...files] : []
|
|
1893
1925
|
];
|
|
1894
1926
|
case "branch":
|
|
1895
|
-
return input.branch ? ["branch", input.branch] : ["branch"];
|
|
1927
|
+
return input.branch ? ["branch", ...input.branch.startsWith("-") ? [] : [input.branch]] : ["branch"];
|
|
1896
1928
|
case "checkout":
|
|
1897
1929
|
return [
|
|
1898
1930
|
"checkout",
|
|
1899
|
-
...input.branch ? [input.branch] : [],
|
|
1931
|
+
...input.branch ? ["--", input.branch] : [],
|
|
1900
1932
|
...files.length ? ["--", ...files] : []
|
|
1901
1933
|
];
|
|
1902
1934
|
case "stash":
|
|
@@ -1954,6 +1986,7 @@ function runGit(args, cwd, signal) {
|
|
|
1954
1986
|
}
|
|
1955
1987
|
var patchTool = {
|
|
1956
1988
|
name: "patch",
|
|
1989
|
+
category: "Filesystem",
|
|
1957
1990
|
description: "Apply a unified diff patch to files. Writes .orig and .rej files on failure.",
|
|
1958
1991
|
usageHint: "Set `patch` (the diff text). `directory` defaults to cwd. `strip` removes leading path components. `dry_run` previews.",
|
|
1959
1992
|
permission: "confirm",
|
|
@@ -2062,6 +2095,7 @@ function extractPatchedFiles(output) {
|
|
|
2062
2095
|
}
|
|
2063
2096
|
var jsonTool = {
|
|
2064
2097
|
name: "json",
|
|
2098
|
+
category: "Data",
|
|
2065
2099
|
description: "Parse, query, and validate JSON/JSON5/YAML. Use `query` with JMESPath-like paths to extract values.",
|
|
2066
2100
|
usageHint: 'Provide `file` path or `data` string. `query` supports dot notation (e.g. "results[0].name"). `format` outputs in specified format.',
|
|
2067
2101
|
permission: "auto",
|
|
@@ -2182,6 +2216,7 @@ function toYaml(data, indent = 0) {
|
|
|
2182
2216
|
}
|
|
2183
2217
|
var diffTool = {
|
|
2184
2218
|
name: "diff",
|
|
2219
|
+
category: "Filesystem",
|
|
2185
2220
|
description: "Show differences between files, commits, or branches. Supports staged vs working tree.",
|
|
2186
2221
|
usageHint: "Use `files` for file paths, `a`/`b` for commit refs, `staged` for git index. `mode`: unified (default), stat, side-by-side.",
|
|
2187
2222
|
permission: "auto",
|
|
@@ -2307,6 +2342,7 @@ var DEFAULT_IGNORE4 = [
|
|
|
2307
2342
|
];
|
|
2308
2343
|
var treeTool = {
|
|
2309
2344
|
name: "tree",
|
|
2345
|
+
category: "Filesystem",
|
|
2310
2346
|
description: "Display directory structure as an ASCII tree. Shows files and folders with indentation.",
|
|
2311
2347
|
usageHint: "Set `path` (default: cwd). `depth` limits nesting (default: 3). `glob` filters files. `exclude` ignores dirs. `show_files` toggles file listing (default: true).",
|
|
2312
2348
|
permission: "auto",
|
|
@@ -2541,6 +2577,7 @@ async function* spawnStream(opts) {
|
|
|
2541
2577
|
// src/lint.ts
|
|
2542
2578
|
var lintTool = {
|
|
2543
2579
|
name: "lint",
|
|
2580
|
+
category: "Code Quality",
|
|
2544
2581
|
description: "Run a linter on files. Auto-detects biome, eslint, or tslint. Use `fix` to auto-fix issues.",
|
|
2545
2582
|
usageHint: "Set `files` (glob or comma-separated). `fix` applies corrections. `linter` forces specific tool.",
|
|
2546
2583
|
permission: "confirm",
|
|
@@ -2632,6 +2669,7 @@ async function detectLinter(cwd) {
|
|
|
2632
2669
|
// src/format.ts
|
|
2633
2670
|
var formatTool = {
|
|
2634
2671
|
name: "format",
|
|
2672
|
+
category: "Code Quality",
|
|
2635
2673
|
description: "Format files with biome or prettier. Use `check` to verify without modifying.",
|
|
2636
2674
|
usageHint: "Set `files` (glob or comma-separated). `check` only validates. `fixer` forces tool.",
|
|
2637
2675
|
permission: "confirm",
|
|
@@ -2728,6 +2766,7 @@ async function detectFixer(cwd) {
|
|
|
2728
2766
|
}
|
|
2729
2767
|
var typecheckTool = {
|
|
2730
2768
|
name: "typecheck",
|
|
2769
|
+
category: "Code Quality",
|
|
2731
2770
|
description: "Run TypeScript type checking with `tsc --noEmit`. Checks for type errors without compiling.",
|
|
2732
2771
|
usageHint: "Set `project` for tsconfig path (default: nearest). `strict` enables strictest flags. `all` checks all projects in workspace.",
|
|
2733
2772
|
permission: "confirm",
|
|
@@ -2807,6 +2846,7 @@ async function findTsConfig(cwd) {
|
|
|
2807
2846
|
}
|
|
2808
2847
|
var testTool = {
|
|
2809
2848
|
name: "test",
|
|
2849
|
+
category: "Code Quality",
|
|
2810
2850
|
description: "Run tests with vitest, jest, or mocha. Returns pass/fail counts and output.",
|
|
2811
2851
|
usageHint: "Set `files` for specific tests. `watch` enables watch mode. `coverage` generates coverage report. `grep` filters by name.",
|
|
2812
2852
|
permission: "confirm",
|
|
@@ -2954,6 +2994,7 @@ function parseResult(runner, result, duration) {
|
|
|
2954
2994
|
// src/install.ts
|
|
2955
2995
|
var installTool = {
|
|
2956
2996
|
name: "install",
|
|
2997
|
+
category: "Package Management",
|
|
2957
2998
|
description: "Install npm packages. Detects pnpm/npm/yarn and uses the right package manager.",
|
|
2958
2999
|
usageHint: "Set `packages` to install. `save` as dependency type. `global` for global install. `dry_run` to preview.",
|
|
2959
3000
|
permission: "confirm",
|
|
@@ -3049,6 +3090,7 @@ async function detectPackageManager(cwd) {
|
|
|
3049
3090
|
// src/audit.ts
|
|
3050
3091
|
var auditTool = {
|
|
3051
3092
|
name: "audit",
|
|
3093
|
+
category: "Package Management",
|
|
3052
3094
|
description: "Run npm/pnpm security audit. Returns vulnerabilities sorted by severity.",
|
|
3053
3095
|
usageHint: "Set `level` to filter minimum severity. `fix` attempts auto-fix. `packages` checks specific packages.",
|
|
3054
3096
|
permission: "confirm",
|
|
@@ -3156,6 +3198,7 @@ function parseAuditOutput(json, exitCode) {
|
|
|
3156
3198
|
}
|
|
3157
3199
|
var outdatedTool = {
|
|
3158
3200
|
name: "outdated",
|
|
3201
|
+
category: "Package Management",
|
|
3159
3202
|
description: "Check for outdated npm packages. Shows current, wanted, and latest versions.",
|
|
3160
3203
|
usageHint: "Set `check` to filter specific packages. `format` as list or table. `include_deprecated` shows deprecated packages.",
|
|
3161
3204
|
permission: "auto",
|
|
@@ -3267,6 +3310,7 @@ function parseOutdatedOutput(json, exitCode) {
|
|
|
3267
3310
|
}
|
|
3268
3311
|
var logsTool = {
|
|
3269
3312
|
name: "logs",
|
|
3313
|
+
category: "Logs",
|
|
3270
3314
|
description: "Stream or fetch logs from a service or file. Supports Docker, systemd, or plain log files.",
|
|
3271
3315
|
usageHint: "Set `service` for Docker/systemd, `path` for file. `lines` limits output. `stream` for tail -f behavior. `filter` regex filters lines.",
|
|
3272
3316
|
permission: "confirm",
|
|
@@ -3444,6 +3488,7 @@ function parseLine(line) {
|
|
|
3444
3488
|
}
|
|
3445
3489
|
var documentTool = {
|
|
3446
3490
|
name: "document",
|
|
3491
|
+
category: "Project",
|
|
3447
3492
|
description: "Generate or update documentation comments for functions, classes, and types. Supports JSDoc, TSDoc, and block comments.",
|
|
3448
3493
|
usageHint: "Set `target` for what to document. `files` for paths. `style` for comment format. `overwrite` replaces existing docs.",
|
|
3449
3494
|
permission: "confirm",
|
|
@@ -3683,6 +3728,7 @@ describe('{{Name}}', () => {
|
|
|
3683
3728
|
};
|
|
3684
3729
|
var scaffoldTool = {
|
|
3685
3730
|
name: "scaffold",
|
|
3731
|
+
category: "Project",
|
|
3686
3732
|
description: "Generate boilerplate code from built-in templates or paths. Creates package.json, source files, tests.",
|
|
3687
3733
|
usageHint: "Set `template` (npm-package, cli-tool, react-component) and `name`. `vars` for template variables. `dry_run` preview.",
|
|
3688
3734
|
permission: "confirm",
|
|
@@ -3768,6 +3814,7 @@ function substituteVars(content, name, vars) {
|
|
|
3768
3814
|
// src/tool-search.ts
|
|
3769
3815
|
var toolSearchTool = {
|
|
3770
3816
|
name: "tool_search",
|
|
3817
|
+
category: "Meta",
|
|
3771
3818
|
description: "Search available tools by name, description, tags, permission level, or mutating flag.",
|
|
3772
3819
|
usageHint: "Set `query` for keyword search. `tags` to filter by category. `permission` to filter by required permission. `mutating` to filter by mutating flag.",
|
|
3773
3820
|
permission: "auto",
|
|
@@ -3835,6 +3882,7 @@ var toolSearchTool = {
|
|
|
3835
3882
|
// src/tool-use.ts
|
|
3836
3883
|
var toolUseTool = {
|
|
3837
3884
|
name: "tool_use",
|
|
3885
|
+
category: "Meta",
|
|
3838
3886
|
description: "Execute a specific tool by name with given input. Useful when the agent knows exactly which tool to call.",
|
|
3839
3887
|
usageHint: "Set `tool` with exact tool name and `input` with the tool parameters. Returns result or error.",
|
|
3840
3888
|
permission: "confirm",
|
|
@@ -3903,6 +3951,7 @@ var toolUseTool = {
|
|
|
3903
3951
|
// src/batch-tool-use.ts
|
|
3904
3952
|
var batchToolUseTool = {
|
|
3905
3953
|
name: "batch_tool_use",
|
|
3954
|
+
category: "Meta",
|
|
3906
3955
|
description: "Execute multiple tool calls in sequence or parallel. Returns all results.",
|
|
3907
3956
|
usageHint: "Set `calls` array with tool names and inputs. `stop_on_error` halts on first failure. `parallel` runs concurrently (default: true).",
|
|
3908
3957
|
permission: "confirm",
|
|
@@ -4006,6 +4055,7 @@ async function executeSingle(call, ctx, opts) {
|
|
|
4006
4055
|
// src/tool-help.ts
|
|
4007
4056
|
var toolHelpTool = {
|
|
4008
4057
|
name: "tool_help",
|
|
4058
|
+
category: "Meta",
|
|
4009
4059
|
description: "Get help and usage information for a specific tool or list all available tools.",
|
|
4010
4060
|
usageHint: "Set `tool` for specific help. Omit to list all tools. `format`: short (one-liner), full (schema), markdown (formatted).",
|
|
4011
4061
|
permission: "auto",
|
|
@@ -4128,6 +4178,7 @@ function formatAllToolsMarkdown(tools) {
|
|
|
4128
4178
|
function rememberTool(memory) {
|
|
4129
4179
|
return {
|
|
4130
4180
|
name: "remember",
|
|
4181
|
+
category: "Session",
|
|
4131
4182
|
description: "Persist a short note to project or user memory.",
|
|
4132
4183
|
usageHint: "Use sparingly. Only for facts that should outlive the session (project conventions, user preferences). Transient state belongs in `todo`. Scope defaults to project-memory.",
|
|
4133
4184
|
permission: "auto",
|
|
@@ -4152,6 +4203,7 @@ function rememberTool(memory) {
|
|
|
4152
4203
|
function forgetTool(memory) {
|
|
4153
4204
|
return {
|
|
4154
4205
|
name: "forget",
|
|
4206
|
+
category: "Session",
|
|
4155
4207
|
description: "Remove memory entries matching a substring (case-insensitive).",
|
|
4156
4208
|
usageHint: "Removes ALL matching bullet lines in the given scope. Use a unique substring.",
|
|
4157
4209
|
permission: "confirm",
|
|
@@ -4178,6 +4230,7 @@ function forgetTool(memory) {
|
|
|
4178
4230
|
function createModeTool(modeStore) {
|
|
4179
4231
|
return {
|
|
4180
4232
|
name: "mode",
|
|
4233
|
+
category: "Session",
|
|
4181
4234
|
description: "Get, list, or switch the agent mode. Modes inject role-specific prompts into the system prompt.",
|
|
4182
4235
|
usageHint: "Set `action`: `get` (current mode), `list` (all modes), `set <modeId>` (switch), `clear` (reset to default).",
|
|
4183
4236
|
permission: "confirm",
|
|
@@ -4291,6 +4344,13 @@ var builtinTools = [
|
|
|
4291
4344
|
toolHelpTool
|
|
4292
4345
|
];
|
|
4293
4346
|
|
|
4294
|
-
|
|
4347
|
+
// src/pack.ts
|
|
4348
|
+
var builtinToolsPack = {
|
|
4349
|
+
name: "builtin-tools",
|
|
4350
|
+
description: "WrongStack built-in filesystem, execution, network, lifecycle, and agent-control tools.",
|
|
4351
|
+
tools: builtinTools
|
|
4352
|
+
};
|
|
4353
|
+
|
|
4354
|
+
export { auditTool, bashTool, batchToolUseTool, builtinTools, builtinToolsPack, createModeTool, diffTool, documentTool, editTool, execTool, fetchTool, forgetTool, formatTool, gitTool, globTool, grepTool, installTool, jsonTool, lintTool, logsTool, outdatedTool, patchTool, planTool, readTool, rememberTool, replaceTool, scaffoldTool, searchTool, testTool, todoTool, toolHelpTool, toolSearchTool, toolUseTool, treeTool, typecheckTool, writeTool };
|
|
4295
4355
|
//# sourceMappingURL=index.js.map
|
|
4296
4356
|
//# sourceMappingURL=index.js.map
|