@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.
Files changed (57) hide show
  1. package/dist/_regex.d.ts +6 -34
  2. package/dist/bash.js +3 -3
  3. package/dist/builtin.js +3011 -1677
  4. package/dist/codebase-index/binary-frame.d.ts +57 -8
  5. package/dist/codebase-index/codebase-incoming-calls-tool.d.ts +6 -0
  6. package/dist/codebase-index/codebase-outgoing-calls-tool.d.ts +6 -0
  7. package/dist/codebase-index/codebase-search-tool.d.ts +15 -5
  8. package/dist/codebase-index/index-service.d.ts +3 -19
  9. package/dist/codebase-index/index.js +2735 -1415
  10. package/dist/codebase-index/indexer.d.ts +3 -0
  11. package/dist/codebase-index/parser-batch.d.ts +53 -0
  12. package/dist/codebase-index/parser-dispatch.d.ts +32 -0
  13. package/dist/codebase-index/parser-output.d.ts +14 -0
  14. package/dist/codebase-index/parser-worker-pool.d.ts +57 -4
  15. package/dist/codebase-index/parser-worker-script.d.ts +5 -2
  16. package/dist/codebase-index/parser-worker-script.js +4042 -0
  17. package/dist/codebase-index/project-server-cache.d.ts +16 -0
  18. package/dist/codebase-index/project-server-client.d.ts +2 -2
  19. package/dist/codebase-index/project-server-query-cache.d.ts +88 -0
  20. package/dist/codebase-index/project-server.js +2846 -1308
  21. package/dist/codebase-index/py-parser.d.ts +5 -0
  22. package/dist/codebase-index/schema.d.ts +14 -1
  23. package/dist/codebase-index/sqlite-runtime.d.ts +2 -2
  24. package/dist/codebase-index/tree-sitter/queries.d.ts +30 -3
  25. package/dist/codebase-index/tree-sitter/visitor.d.ts +2 -1
  26. package/dist/codebase-index/vector-search.d.ts +12 -0
  27. package/dist/codebase-index/wal-maintenance.d.ts +58 -0
  28. package/dist/codebase-index/worker-protocol/contracts.d.ts +44 -0
  29. package/dist/codebase-index/worker-protocol.d.ts +17 -1
  30. package/dist/codebase-index/worker.js +2300 -1020
  31. package/dist/codebase-index/writer-admin.d.ts +11 -0
  32. package/dist/codebase-index/writer-helpers.d.ts +31 -1
  33. package/dist/codebase-index/writer-mutations.d.ts +0 -6
  34. package/dist/codebase-index/writer-schema.d.ts +2 -2
  35. package/dist/codebase-index/writer.d.ts +15 -0
  36. package/dist/edit.js +2511 -1203
  37. package/dist/exec.js +5 -3
  38. package/dist/grep.js +5 -124
  39. package/dist/index.js +3007 -1736
  40. package/dist/json.js +5 -124
  41. package/dist/kanban.js +130 -0
  42. package/dist/logs.js +5 -121
  43. package/dist/pack.js +3011 -1677
  44. package/dist/patch.js +2524 -1216
  45. package/dist/plan.js +106 -0
  46. package/dist/read.js +2506 -1198
  47. package/dist/replace.js +2487 -1295
  48. package/dist/search.js +6 -2
  49. package/dist/session-kanban.js +24 -16
  50. package/dist/task.js +106 -0
  51. package/dist/todo.js +106 -0
  52. package/dist/tool-tier.d.ts +11 -0
  53. package/dist/tool-tier.js +3019 -1677
  54. package/dist/tree.js +14 -3
  55. package/dist/win32.js +3 -3
  56. package/dist/write.js +2513 -1205
  57. 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
- * Node's regex engine (V8) is backtracking-based and cannot interrupt a
5
- * synchronous match a pattern like `(a+)+$` against a sufficiently long
6
- * line will pin a worker for seconds. The executor's outer `timeoutMs` only
7
- * fires between async boundaries, so a long regex eval inside a sync loop
8
- * is uninterruptible.
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 declare const MAX_SUBJECT_LEN: number;
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.exe" : "powershell.exe";
1830
- const fallback = lower.startsWith("pwsh") ? "powershell.exe" : "pwsh.exe";
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 !== primary) {
1832
+ if (resolved === primary) {
1833
1833
  const fb = resolveWin32Command(fallback);
1834
1834
  return fb === fallback ? cmd : fb;
1835
1835
  }