@wrongstack/tools 0.305.1 → 0.306.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/_shell-pick.d.ts +4 -5
- package/dist/_util.d.ts +22 -5
- package/dist/audit.d.ts +0 -1
- package/dist/audit.js +135 -46
- package/dist/bash.js +61 -37
- package/dist/browser/index.js +29 -9
- package/dist/browser/types.d.ts +7 -1
- package/dist/builtin.js +1279 -726
- package/dist/codebase-index/codebase-search-tool.d.ts +5 -0
- package/dist/codebase-index/index.js +223 -152
- package/dist/diff.d.ts +5 -0
- package/dist/diff.js +78 -12
- package/dist/document.js +18 -6
- package/dist/edit.js +69 -16
- package/dist/exec.js +44 -22
- package/dist/fetch.js +13 -1
- package/dist/format.d.ts +4 -2
- package/dist/format.js +81 -31
- package/dist/glob.js +12 -4
- package/dist/grep.d.ts +2 -0
- package/dist/grep.js +15 -4
- package/dist/index.js +1342 -761
- package/dist/install.js +96 -37
- package/dist/kanban-tool-types.d.ts +6 -1
- package/dist/kanban.js +60 -0
- package/dist/languages/index.js +28 -13
- package/dist/lint.js +28 -13
- package/dist/logs.d.ts +0 -1
- package/dist/logs.js +44 -13
- package/dist/memory.d.ts +8 -0
- package/dist/memory.js +23 -3
- package/dist/mode.d.ts +1 -1
- package/dist/mode.js +3 -0
- package/dist/next-steps.d.ts +2 -3
- package/dist/next-steps.js +3 -3
- package/dist/outdated.d.ts +0 -3
- package/dist/outdated.js +89 -48
- package/dist/pack.js +1279 -726
- package/dist/plan.js +76 -3
- package/dist/process-registry.d.ts +8 -2
- package/dist/process-registry.js +28 -13
- package/dist/ps-slash.js +22 -12
- package/dist/read.js +10 -3
- package/dist/replace.d.ts +4 -0
- package/dist/replace.js +104 -7
- package/dist/search.d.ts +6 -0
- package/dist/search.js +47 -26
- package/dist/skill.d.ts +6 -0
- package/dist/skill.js +9 -10
- package/dist/task.js +66 -2
- package/dist/test.js +28 -13
- package/dist/todo.js +64 -2
- package/dist/tool-icons.js +4 -2
- package/dist/tool-summary.d.ts +1 -1
- package/dist/tool-summary.js +76 -1
- package/dist/tool-tier.js +1279 -726
- package/dist/tree.js +9 -10
- package/dist/typecheck.d.ts +0 -2
- package/dist/typecheck.js +98 -31
- package/dist/write.js +58 -10
- package/package.json +4 -4
package/dist/glob.js
CHANGED
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
import * as fs2 from "node:fs/promises";
|
|
3
3
|
import * as path3 from "node:path";
|
|
4
4
|
import { compileGlob as compileGlob2, DEFAULT_WALK_IGNORE_DIRS } from "@wrongstack/core/utils";
|
|
5
|
+
import { ToolValidationError } from "@wrongstack/core/types";
|
|
5
6
|
|
|
6
7
|
// src/_concurrency.ts
|
|
7
8
|
async function mapWithConcurrency(items, limit, fn) {
|
|
@@ -143,7 +144,7 @@ var WALK_CONCURRENCY = 16;
|
|
|
143
144
|
var globTool = {
|
|
144
145
|
name: "glob",
|
|
145
146
|
category: "Filesystem",
|
|
146
|
-
description: "Find files by path pattern. Use index-backed `codebase-search` first for code symbols or concepts when it is live.",
|
|
147
|
+
description: "Find files by path pattern. Results are sorted by modification time, newest first, so when the list is truncated at `limit` it is the oldest files that are dropped (recency-biased). Use index-backed `codebase-search` first for code symbols or concepts when it is live.",
|
|
147
148
|
usageHint: "PATH DISCOVERY AND SEARCH SCOPING:\n\n- When `codebase-search` is live, use it first for code concepts; use `glob` for filenames, path patterns, and non-indexed files.\n- Combine with `path` and `limit`.\n- Default ignores common build/dependency directories.\nMuch more efficient than shell `find` for most use cases inside the agent.",
|
|
148
149
|
selection: {
|
|
149
150
|
doNotUseWhen: "you need to search inside file contents.",
|
|
@@ -154,7 +155,7 @@ var globTool = {
|
|
|
154
155
|
capabilities: ["fs.read"],
|
|
155
156
|
icon: "folder",
|
|
156
157
|
maxOutputBytes: 65536,
|
|
157
|
-
timeoutMs:
|
|
158
|
+
timeoutMs: 15e3,
|
|
158
159
|
inputSchema: {
|
|
159
160
|
type: "object",
|
|
160
161
|
properties: {
|
|
@@ -168,13 +169,20 @@ var globTool = {
|
|
|
168
169
|
},
|
|
169
170
|
limit: {
|
|
170
171
|
type: "integer",
|
|
171
|
-
|
|
172
|
+
minimum: 1,
|
|
173
|
+
maximum: 5e3,
|
|
174
|
+
description: "Maximum number of results to return (default 1000, max 5000). Results are sorted by mtime descending, so truncation keeps the most recently modified files."
|
|
172
175
|
}
|
|
173
176
|
},
|
|
174
177
|
required: ["pattern"]
|
|
175
178
|
},
|
|
176
179
|
async execute(input, ctx, opts) {
|
|
177
|
-
if (!input?.pattern)
|
|
180
|
+
if (!input?.pattern) {
|
|
181
|
+
throw new ToolValidationError({
|
|
182
|
+
message: "glob: pattern is required",
|
|
183
|
+
field: "pattern"
|
|
184
|
+
});
|
|
185
|
+
}
|
|
178
186
|
const signal = opts?.signal;
|
|
179
187
|
const base = input.path ? await safeResolveReal(input.path, ctx) : ctx.cwd;
|
|
180
188
|
const limit = Math.max(1, Math.min(input.limit ?? 1e3, 5e3));
|
package/dist/grep.d.ts
CHANGED
|
@@ -15,5 +15,7 @@ interface GrepOutput {
|
|
|
15
15
|
used: 'rg' | 'native';
|
|
16
16
|
}
|
|
17
17
|
export declare const grepTool: Tool<GrepInput, GrepOutput>;
|
|
18
|
+
/** Test-only: forget the cached rg availability so mocks can vary per test. */
|
|
19
|
+
export declare function __resetRgDetectionForTests(): void;
|
|
18
20
|
export {};
|
|
19
21
|
//# sourceMappingURL=grep.d.ts.map
|
package/dist/grep.js
CHANGED
|
@@ -358,7 +358,7 @@ var grepTool = {
|
|
|
358
358
|
field: "pattern"
|
|
359
359
|
});
|
|
360
360
|
}
|
|
361
|
-
const rgAvailable = await detectRg(
|
|
361
|
+
const rgAvailable = await detectRg();
|
|
362
362
|
if (rgAvailable) {
|
|
363
363
|
try {
|
|
364
364
|
yield* runRgStream(input, base, mode, limit, opts.signal);
|
|
@@ -371,16 +371,26 @@ var grepTool = {
|
|
|
371
371
|
yield { type: "final", output: out };
|
|
372
372
|
}
|
|
373
373
|
};
|
|
374
|
-
|
|
375
|
-
|
|
374
|
+
var rgAvailabilityCache;
|
|
375
|
+
function __resetRgDetectionForTests() {
|
|
376
|
+
rgAvailabilityCache = void 0;
|
|
377
|
+
}
|
|
378
|
+
function detectRg() {
|
|
379
|
+
rgAvailabilityCache ??= new Promise((resolve2) => {
|
|
376
380
|
try {
|
|
377
|
-
const p = spawn("rg", ["--version"], {
|
|
381
|
+
const p = spawn("rg", ["--version"], {
|
|
382
|
+
env: buildChildEnv(),
|
|
383
|
+
stdio: "ignore",
|
|
384
|
+
signal: AbortSignal.timeout(1e4),
|
|
385
|
+
windowsHide: true
|
|
386
|
+
});
|
|
378
387
|
p.on("error", () => resolve2(false));
|
|
379
388
|
p.on("close", (code) => resolve2(code === 0));
|
|
380
389
|
} catch {
|
|
381
390
|
resolve2(false);
|
|
382
391
|
}
|
|
383
392
|
});
|
|
393
|
+
return rgAvailabilityCache;
|
|
384
394
|
}
|
|
385
395
|
async function* runRgStream(input, base, mode, limit, signal) {
|
|
386
396
|
const args = ["--no-heading"];
|
|
@@ -701,6 +711,7 @@ async function runNative(input, base, mode, limit, signal) {
|
|
|
701
711
|
};
|
|
702
712
|
}
|
|
703
713
|
export {
|
|
714
|
+
__resetRgDetectionForTests,
|
|
704
715
|
grepTool
|
|
705
716
|
};
|
|
706
717
|
//# sourceMappingURL=grep.js.map
|