@wrongstack/tools 0.309.1 → 0.310.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/_regex.d.ts +6 -34
- package/dist/bash.js +3 -3
- package/dist/builtin.js +3011 -1677
- package/dist/codebase-index/binary-frame.d.ts +57 -8
- package/dist/codebase-index/codebase-incoming-calls-tool.d.ts +6 -0
- package/dist/codebase-index/codebase-outgoing-calls-tool.d.ts +6 -0
- package/dist/codebase-index/codebase-search-tool.d.ts +15 -5
- package/dist/codebase-index/index-service.d.ts +3 -19
- package/dist/codebase-index/index.js +2735 -1415
- package/dist/codebase-index/indexer.d.ts +3 -0
- package/dist/codebase-index/parser-batch.d.ts +53 -0
- package/dist/codebase-index/parser-dispatch.d.ts +32 -0
- package/dist/codebase-index/parser-output.d.ts +14 -0
- package/dist/codebase-index/parser-worker-pool.d.ts +57 -4
- package/dist/codebase-index/parser-worker-script.d.ts +5 -2
- package/dist/codebase-index/parser-worker-script.js +4042 -0
- package/dist/codebase-index/project-server-cache.d.ts +16 -0
- package/dist/codebase-index/project-server-client.d.ts +2 -2
- package/dist/codebase-index/project-server-query-cache.d.ts +88 -0
- package/dist/codebase-index/project-server.js +2846 -1308
- package/dist/codebase-index/py-parser.d.ts +5 -0
- package/dist/codebase-index/schema.d.ts +14 -1
- package/dist/codebase-index/sqlite-runtime.d.ts +2 -2
- package/dist/codebase-index/tree-sitter/queries.d.ts +30 -3
- package/dist/codebase-index/tree-sitter/visitor.d.ts +2 -1
- package/dist/codebase-index/vector-search.d.ts +12 -0
- package/dist/codebase-index/wal-maintenance.d.ts +58 -0
- package/dist/codebase-index/worker-protocol/contracts.d.ts +44 -0
- package/dist/codebase-index/worker-protocol.d.ts +17 -1
- package/dist/codebase-index/worker.js +2300 -1020
- package/dist/codebase-index/writer-admin.d.ts +11 -0
- package/dist/codebase-index/writer-helpers.d.ts +31 -1
- package/dist/codebase-index/writer-mutations.d.ts +0 -6
- package/dist/codebase-index/writer-schema.d.ts +2 -2
- package/dist/codebase-index/writer.d.ts +15 -0
- package/dist/edit.js +2511 -1203
- package/dist/exec.js +5 -3
- package/dist/grep.js +5 -124
- package/dist/index.js +3007 -1736
- package/dist/json.js +5 -124
- package/dist/kanban.js +130 -0
- package/dist/logs.js +5 -121
- package/dist/pack.js +3011 -1677
- package/dist/patch.js +2524 -1216
- package/dist/plan.js +106 -0
- package/dist/read.js +2506 -1198
- package/dist/replace.js +2487 -1295
- package/dist/search.js +6 -2
- package/dist/session-kanban.js +24 -16
- package/dist/task.js +106 -0
- package/dist/todo.js +106 -0
- package/dist/tool-tier.d.ts +11 -0
- package/dist/tool-tier.js +3019 -1677
- package/dist/tree.js +14 -3
- package/dist/win32.js +3 -3
- package/dist/write.js +2513 -1205
- package/package.json +5 -4
package/dist/_regex.d.ts
CHANGED
|
@@ -1,39 +1,11 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Compile a user-supplied regex with conservative bounds against ReDoS.
|
|
3
3
|
*
|
|
4
|
-
*
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
*
|
|
9
|
-
*
|
|
10
|
-
* We can't fully prevent ReDoS without an alternative engine (re2-wasm), but
|
|
11
|
-
* we can sharply limit the blast radius:
|
|
12
|
-
*
|
|
13
|
-
* 1. Cap pattern length — practically all legitimate user patterns are
|
|
14
|
-
* under 256 characters. A 4 KB pattern is almost certainly malicious
|
|
15
|
-
* or a copy-paste accident.
|
|
16
|
-
* 2. Reject patterns containing the most obvious super-linear structures.
|
|
17
|
-
* This is a coarse filter (false-positives are likely; we accept that
|
|
18
|
-
* for hostile-input contexts).
|
|
19
|
-
*
|
|
20
|
-
* Callers should additionally bound the *subject* length (e.g. by capping
|
|
21
|
-
* line size before matching).
|
|
22
|
-
*/
|
|
23
|
-
export interface CompileResult {
|
|
24
|
-
ok: true;
|
|
25
|
-
regex: RegExp;
|
|
26
|
-
}
|
|
27
|
-
export interface CompileFail {
|
|
28
|
-
ok: false;
|
|
29
|
-
reason: string;
|
|
30
|
-
}
|
|
31
|
-
export declare function compileUserRegex(pattern: string, flags: string): CompileResult | CompileFail;
|
|
32
|
-
/**
|
|
33
|
-
* Truncate a subject line to a safe length for synchronous regex eval.
|
|
34
|
-
* The cap is conservative; tools that need exact-line matching against very
|
|
35
|
-
* long lines should use ripgrep externally rather than the native walker.
|
|
4
|
+
* Canonical home since card #5: `@wrongstack/primitives/src/regex-guard.ts`.
|
|
5
|
+
* This module is now a re-export shim kept for its four importers
|
|
6
|
+
* (grep.ts, json.ts, logs.ts, replace.ts); `tools/tests/regex-guard-parity.test.ts`
|
|
7
|
+
* still pins the three historical entry points to identical verdicts —
|
|
8
|
+
* now trivially true, because all three resolve to the same code path.
|
|
36
9
|
*/
|
|
37
|
-
export
|
|
38
|
-
export declare function capSubject(line: string): string;
|
|
10
|
+
export { type CompileFail, type CompileResult, capSubject, compileUserRegex, MAX_SUBJECT_LEN, } from '@wrongstack/primitives';
|
|
39
11
|
//# sourceMappingURL=_regex.d.ts.map
|
package/dist/bash.js
CHANGED
|
@@ -1826,10 +1826,10 @@ function resolvePowerShell(cmd) {
|
|
|
1826
1826
|
if (lower !== "pwsh" && lower !== "powershell" && lower !== "pwsh.exe" && lower !== "powershell.exe") {
|
|
1827
1827
|
return resolveWin32Command(cmd);
|
|
1828
1828
|
}
|
|
1829
|
-
const primary = lower.startsWith("pwsh") ? "pwsh
|
|
1830
|
-
const fallback = lower.startsWith("pwsh") ? "powershell
|
|
1829
|
+
const primary = lower.startsWith("pwsh") ? "pwsh" : "powershell";
|
|
1830
|
+
const fallback = lower.startsWith("pwsh") ? "powershell" : "pwsh";
|
|
1831
1831
|
const resolved = resolveWin32Command(primary);
|
|
1832
|
-
if (resolved
|
|
1832
|
+
if (resolved === primary) {
|
|
1833
1833
|
const fb = resolveWin32Command(fallback);
|
|
1834
1834
|
return fb === fallback ? cmd : fb;
|
|
1835
1835
|
}
|