@wrongstack/tools 0.309.1 → 0.310.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.
Files changed (58) hide show
  1. package/dist/_regex.d.ts +6 -34
  2. package/dist/bash.js +3 -3
  3. package/dist/builtin.d.ts +17 -14
  4. package/dist/builtin.js +3028 -1675
  5. package/dist/codebase-index/binary-frame.d.ts +57 -8
  6. package/dist/codebase-index/codebase-incoming-calls-tool.d.ts +6 -0
  7. package/dist/codebase-index/codebase-outgoing-calls-tool.d.ts +6 -0
  8. package/dist/codebase-index/codebase-search-tool.d.ts +15 -5
  9. package/dist/codebase-index/index-service.d.ts +3 -19
  10. package/dist/codebase-index/index.js +2735 -1415
  11. package/dist/codebase-index/indexer.d.ts +3 -0
  12. package/dist/codebase-index/parser-batch.d.ts +53 -0
  13. package/dist/codebase-index/parser-dispatch.d.ts +32 -0
  14. package/dist/codebase-index/parser-output.d.ts +14 -0
  15. package/dist/codebase-index/parser-worker-pool.d.ts +57 -4
  16. package/dist/codebase-index/parser-worker-script.d.ts +5 -2
  17. package/dist/codebase-index/parser-worker-script.js +4042 -0
  18. package/dist/codebase-index/project-server-cache.d.ts +16 -0
  19. package/dist/codebase-index/project-server-client.d.ts +2 -2
  20. package/dist/codebase-index/project-server-query-cache.d.ts +88 -0
  21. package/dist/codebase-index/project-server.js +2846 -1308
  22. package/dist/codebase-index/py-parser.d.ts +5 -0
  23. package/dist/codebase-index/schema.d.ts +14 -1
  24. package/dist/codebase-index/sqlite-runtime.d.ts +2 -2
  25. package/dist/codebase-index/tree-sitter/queries.d.ts +30 -3
  26. package/dist/codebase-index/tree-sitter/visitor.d.ts +2 -1
  27. package/dist/codebase-index/vector-search.d.ts +12 -0
  28. package/dist/codebase-index/wal-maintenance.d.ts +58 -0
  29. package/dist/codebase-index/worker-protocol/contracts.d.ts +44 -0
  30. package/dist/codebase-index/worker-protocol.d.ts +17 -1
  31. package/dist/codebase-index/worker.js +2300 -1020
  32. package/dist/codebase-index/writer-admin.d.ts +11 -0
  33. package/dist/codebase-index/writer-helpers.d.ts +31 -1
  34. package/dist/codebase-index/writer-mutations.d.ts +0 -6
  35. package/dist/codebase-index/writer-schema.d.ts +2 -2
  36. package/dist/codebase-index/writer.d.ts +15 -0
  37. package/dist/edit.js +2511 -1203
  38. package/dist/exec.js +5 -3
  39. package/dist/grep.js +5 -124
  40. package/dist/index.js +3028 -1738
  41. package/dist/json.js +5 -124
  42. package/dist/kanban.js +130 -0
  43. package/dist/logs.js +5 -121
  44. package/dist/pack.js +3028 -1675
  45. package/dist/patch.js +2524 -1216
  46. package/dist/plan.js +106 -0
  47. package/dist/read.js +2506 -1198
  48. package/dist/replace.js +2487 -1295
  49. package/dist/search.js +6 -2
  50. package/dist/session-kanban.js +24 -16
  51. package/dist/task.js +106 -0
  52. package/dist/todo.js +106 -0
  53. package/dist/tool-tier.d.ts +11 -0
  54. package/dist/tool-tier.js +3040 -1679
  55. package/dist/tree.js +14 -3
  56. package/dist/win32.js +3 -3
  57. package/dist/write.js +2513 -1205
  58. 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
  }
package/dist/builtin.d.ts CHANGED
@@ -18,25 +18,28 @@ export declare const OPTIONAL_TOOLS: Tool[];
18
18
  export declare const OFF_ONLY_TOOLS: Tool[];
19
19
  /**
20
20
  * Tier 1 (Token Saving) tool set — the absolute minimum for useful work.
21
- * 15 tools covering core file ops, indexed project discovery, shell, search,
22
- * and utilities. Codebase index lifecycle tools stay available at every tier
23
- * so token saving does not force broad filesystem scans.
24
- * Saves ~3500-5500 tokens vs full mode by omitting specialized schemas from
25
- * direct provider exposure; hosts may retain those tools in a lazy catalog.
21
+ * 23 tools covering core file ops, indexed project discovery, structured
22
+ * edits, shell, search, and utilities. Codebase index lifecycle tools stay
23
+ * available at every tier so token saving does not force broad filesystem
24
+ * scans. Saves ~3500-5500 tokens vs full mode by omitting specialized
25
+ * schemas from direct provider exposure; hosts may retain those tools in a
26
+ * lazy catalog.
26
27
  *
27
28
  * Tier 1 tools:
28
- * read, write, edit — file operations
29
- * codebase-stats, codebase-search/index — indexed project discovery
30
- * bash, grep, glob — shell + exact/path fallback
31
- * diff, patch, json — utility
32
- * search web research
29
+ * read, write, edit, clarify — file operations
30
+ * codebase-stats/search/index/skeleton/repo-map/impact/targeted-test/
31
+ * incoming-calls/outgoing-calls/ast-replace/invariant-check,
32
+ * security-ast-scan — indexed project discovery
33
+ * bash, grep, glob shell + exact/path fallback
34
+ * diff, patch, json — utility
35
+ * search — web research
33
36
  */
34
37
  export declare const TIER1_TOOLS: Tool[];
35
38
  /**
36
39
  * Tier 2 tool set — standard development tools useful for non-trivial work.
37
- * Adds 19 tools: replace, exec, fetch, git, tree, lint, format, typecheck,
38
- * test, languageInfo, language, languagePackage, todo, plan, kanban, task,
39
- * install, audit, design.
40
+ * Adds 20 tools: replace, exec, pwsh, fetch, git, tree, lint, format,
41
+ * typecheck, test, languageInfo, language, languagePackage, todo, plan,
42
+ * kanban, task, install, audit, design.
40
43
  *
41
44
  * These tools are used regularly during development but are not essential for
42
45
  * every turn. Omitting them in minimal/light tier saves ~900 tokens per prompt.
@@ -44,7 +47,7 @@ export declare const TIER1_TOOLS: Tool[];
44
47
  export declare const TIER2_TOOLS: Tool[];
45
48
  /**
46
49
  * Tier 3 tool set — specialized, administrative, and exploratory tools.
47
- * Adds 12 tools: outdated, logs, document, scaffold, dead-code-scan,
50
+ * Adds 10 tools: outdated, logs, document, scaffold, dead-code-scan,
48
51
  * tool-search, tool-use, batch-tool-use, tool-help, set-working-dir.
49
52
  *
50
53
  * These tools are situational (e.g. documentation generation, scaffolding,