@wrongstack/tools 0.299.0 → 0.301.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 (53) hide show
  1. package/dist/audit.js +6 -2
  2. package/dist/bash.js +6 -2
  3. package/dist/batch-tool-use.js +3 -1
  4. package/dist/browser/index.js +1 -1
  5. package/dist/builtin.d.ts +3 -2
  6. package/dist/builtin.js +1781 -376
  7. package/dist/codebase-index/bm25.d.ts +7 -1
  8. package/dist/codebase-index/import-extractor.d.ts +39 -0
  9. package/dist/codebase-index/index.js +1418 -267
  10. package/dist/codebase-index/languages.d.ts +24 -0
  11. package/dist/codebase-index/module-resolver.d.ts +78 -0
  12. package/dist/codebase-index/module-roots.d.ts +81 -0
  13. package/dist/codebase-index/parser-output.d.ts +29 -0
  14. package/dist/codebase-index/project-server.js +1402 -249
  15. package/dist/codebase-index/rs-parser.d.ts +22 -0
  16. package/dist/codebase-index/schema.d.ts +24 -1
  17. package/dist/codebase-index/worker.js +1401 -250
  18. package/dist/codebase-index/writer-graph-helpers.d.ts +17 -5
  19. package/dist/codebase-index/writer-ref-mapper.d.ts +3 -0
  20. package/dist/codebase-index/writer-schema.d.ts +15 -3
  21. package/dist/codebase-index/writer.d.ts +76 -3
  22. package/dist/exec.js +35 -2
  23. package/dist/format.js +6 -2
  24. package/dist/git.js +2 -5
  25. package/dist/glob.js +2 -2
  26. package/dist/grep.js +118 -3
  27. package/dist/index.d.ts +1 -0
  28. package/dist/index.js +1925 -415
  29. package/dist/install.js +6 -2
  30. package/dist/json.js +132 -2
  31. package/dist/languages/index.js +6 -2
  32. package/dist/lint.js +6 -2
  33. package/dist/logs.js +81 -0
  34. package/dist/next-steps-tool.d.ts +26 -0
  35. package/dist/outdated.js +6 -2
  36. package/dist/pack.js +1781 -376
  37. package/dist/patch.js +206 -45
  38. package/dist/process-registry.d.ts +6 -0
  39. package/dist/process-registry.js +6 -2
  40. package/dist/ps-slash.js +6 -2
  41. package/dist/read.js +1410 -257
  42. package/dist/replace.js +81 -0
  43. package/dist/skill.js +51 -2
  44. package/dist/test.js +6 -2
  45. package/dist/tool-help.js +2 -2
  46. package/dist/tool-search.js +1 -1
  47. package/dist/tool-tier.d.ts +1 -1
  48. package/dist/tool-tier.js +1786 -397
  49. package/dist/tool-use.js +1 -1
  50. package/dist/tree.js +13 -3
  51. package/dist/typecheck.js +6 -2
  52. package/package.json +3 -3
  53. package/dist/codebase-index/refs-extractor.d.ts +0 -11
package/dist/tool-use.js CHANGED
@@ -40,7 +40,7 @@ var toolUseTool = {
40
40
  executionMs: 0
41
41
  };
42
42
  }
43
- const tool = ctx.tools.find((t) => t.name === input.tool);
43
+ const tool = (ctx.catalogTools ?? ctx.tools).find((t) => t.name === input.tool);
44
44
  if (!tool) {
45
45
  return {
46
46
  tool: input.tool,
package/dist/tree.js CHANGED
@@ -29,7 +29,13 @@ function safeResolve(input, ctx) {
29
29
  }
30
30
 
31
31
  // src/tree.ts
32
- var DEFAULT_IGNORE = [...DEFAULT_WALK_IGNORE_DIRS, ".wrongstack", ".ssh", ".gnupg", ".aws"];
32
+ var DEFAULT_IGNORE = /* @__PURE__ */ new Set([
33
+ ...DEFAULT_WALK_IGNORE_DIRS,
34
+ ".wrongstack",
35
+ ".ssh",
36
+ ".gnupg",
37
+ ".aws"
38
+ ]);
33
39
  var DEFAULT_MAX_ENTRIES = 5e3;
34
40
  var MAX_TREE_OUTPUT_BYTES = 256 * 1024;
35
41
  var treeTool = {
@@ -190,8 +196,12 @@ async function walkDir(dir, depth, opts) {
190
196
  return true;
191
197
  });
192
198
  if (depth > 0) {
193
- const dirCount = filtered.filter((e) => e.isDirectory()).length;
194
- const fileCount = filtered.filter((e) => e.isFile()).length;
199
+ let dirCount = 0;
200
+ let fileCount = 0;
201
+ for (const e of filtered) {
202
+ if (e.isDirectory()) dirCount++;
203
+ else if (e.isFile()) fileCount++;
204
+ }
195
205
  opts.totalDirs.value += dirCount;
196
206
  opts.totalFiles.value += fileCount;
197
207
  opts.onProgress?.();
package/dist/typecheck.js CHANGED
@@ -669,7 +669,7 @@ var ProcessRegistryImpl = class {
669
669
  const p = this.processes.get(pid);
670
670
  if (!p) return false;
671
671
  if (p.killed) return true;
672
- if (p.protected) return false;
672
+ if (p.protected && opts.includeProtected !== true) return false;
673
673
  if (opts.preserveBackground && p.background) return false;
674
674
  const { force = false, graceMs = DEFAULT_GRACE_MS } = opts;
675
675
  const isWin2 = os.platform() === "win32";
@@ -720,9 +720,13 @@ var ProcessRegistryImpl = class {
720
720
  killAll(opts = {}) {
721
721
  const pids = Array.from(this.processes.keys());
722
722
  const killed = [];
723
+ const includeProtected = opts.includeProtected === true;
723
724
  for (const pid of pids) {
724
725
  const p = this.processes.get(pid);
725
- if (p && !p.protected && this.kill(pid, opts)) killed.push(pid);
726
+ if (!p) continue;
727
+ if (p.protected && !includeProtected) continue;
728
+ if (opts.preserveBackground && p.background) continue;
729
+ if (this.kill(pid, opts)) killed.push(pid);
726
730
  }
727
731
  return killed;
728
732
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wrongstack/tools",
3
- "version": "0.299.0",
3
+ "version": "0.301.0",
4
4
  "license": "MIT",
5
5
  "description": "WrongStack built-in tools: read/write/edit, bash/exec, grep/glob, git, fetch, test, lint, and more.",
6
6
  "repository": {
@@ -250,8 +250,8 @@
250
250
  "@typescript/typescript6": "^6.0.2",
251
251
  "turndown": "^7.2.4",
252
252
  "undici": "^8.9.0",
253
- "@wrongstack/core": "0.299.0",
254
- "@wrongstack/kanban": "0.299.0"
253
+ "@wrongstack/core": "0.301.0",
254
+ "@wrongstack/kanban": "0.301.0"
255
255
  },
256
256
  "devDependencies": {
257
257
  "@types/node": "^26.1.2",
@@ -1,11 +0,0 @@
1
- /** Cross-reference extraction for languages not handled by ts-parser.ts. */
2
- import type { Ref, SymbolLang } from './schema.js';
3
- export interface ExtractRefsOptions {
4
- file: string;
5
- /** Reserved — not yet consumed by extractRefs. Passed through in callers for future use. */
6
- content: string;
7
- lang: SymbolLang;
8
- }
9
- /** Return refs with `fromId: 0`; the indexer replaces it with the owning symbol id. */
10
- export declare function extractRefs(opts: ExtractRefsOptions): Promise<Ref[]>;
11
- //# sourceMappingURL=refs-extractor.d.ts.map