@wrongstack/tools 0.317.0 → 0.318.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 (110) hide show
  1. package/dist/_spawn-stream.d.ts +1 -1
  2. package/dist/audit.d.ts +37 -2
  3. package/dist/audit.js +4 -4
  4. package/dist/bash.js +1 -1
  5. package/dist/batch-tool-use.js +1 -1
  6. package/dist/browser/index.js +1 -1
  7. package/dist/browser/tools.d.ts +16 -1
  8. package/dist/builtin.js +43 -43
  9. package/dist/{chunk-SDLVH5RZ.js → chunk-3QQSBUXR.js} +6 -5
  10. package/dist/{chunk-YGG6X57C.js → chunk-3U4H6ZRF.js} +12 -9
  11. package/dist/{chunk-K3WNSHUF.js → chunk-45JPRMC2.js} +62 -36
  12. package/dist/{chunk-EJWSCQ6D.js → chunk-4AEZIFOW.js} +6 -5
  13. package/dist/{chunk-PQKK5JH7.js → chunk-4E42D7UF.js} +2 -2
  14. package/dist/{chunk-JRJJX3L5.js → chunk-5WNDJHT6.js} +3 -2
  15. package/dist/{chunk-7EY5DCRO.js → chunk-5ZYEGP2P.js} +4 -4
  16. package/dist/{chunk-VGBUDLW4.js → chunk-6GVXZCQV.js} +7 -6
  17. package/dist/{chunk-UNSKG6DC.js → chunk-6GZPSWP3.js} +10 -15
  18. package/dist/{chunk-5OAOKALG.js → chunk-AGUSOFNI.js} +4 -3
  19. package/dist/{chunk-TRDX25UH.js → chunk-BLCSYKNN.js} +293 -86
  20. package/dist/{chunk-U6DZWHBA.js → chunk-CIFAIIHI.js} +9 -7
  21. package/dist/{chunk-HPEO4EA7.js → chunk-CISOLTOP.js} +35 -17
  22. package/dist/{chunk-RGISBZBD.js → chunk-CPSAF2AU.js} +3 -2
  23. package/dist/{chunk-BSLVR56S.js → chunk-CPVLVQYT.js} +6 -5
  24. package/dist/{chunk-VJNHFZ7J.js → chunk-CVALEVGA.js} +6 -5
  25. package/dist/{chunk-PY2IOS7C.js → chunk-CWALNI6K.js} +5 -5
  26. package/dist/{chunk-LIJQMYYX.js → chunk-DTQ75VBC.js} +8 -3
  27. package/dist/{chunk-553IQUMO.js → chunk-EOOFNYIT.js} +7 -6
  28. package/dist/{chunk-JNNVRHMV.js → chunk-FJEQZHZN.js} +8 -8
  29. package/dist/{chunk-S5CCLZL3.js → chunk-FRN7TIAA.js} +2 -2
  30. package/dist/{chunk-NKJW5GFO.js → chunk-H6AWAZ2Y.js} +3 -3
  31. package/dist/{chunk-IVWV2UM6.js → chunk-HTYEO67J.js} +6 -5
  32. package/dist/{chunk-IYK7XGDZ.js → chunk-JJQB6R7Y.js} +7 -7
  33. package/dist/{chunk-DSEANA2W.js → chunk-K23JNFE3.js} +37 -36
  34. package/dist/{chunk-LWKUTMD5.js → chunk-MRZOVQ5D.js} +6 -5
  35. package/dist/{chunk-PCHQ6YRR.js → chunk-MX25MTDJ.js} +2 -2
  36. package/dist/{chunk-U4D5S3VQ.js → chunk-NWZ6XGBJ.js} +2 -1
  37. package/dist/{chunk-UKU2ZX4C.js → chunk-P7ZQ2FAJ.js} +27 -17
  38. package/dist/{chunk-4I4LWFOO.js → chunk-PQTONQ4P.js} +16 -11
  39. package/dist/{chunk-P7FYFZ6M.js → chunk-S2GBLQ5S.js} +11 -7
  40. package/dist/{chunk-OUBDL3WH.js → chunk-SOG7XIRF.js} +11 -8
  41. package/dist/{chunk-AHHDWNXC.js → chunk-TKA4VEX2.js} +2 -2
  42. package/dist/{chunk-5H4GSJAI.js → chunk-UE3UBMCP.js} +7 -6
  43. package/dist/{chunk-IXMNTNW5.js → chunk-UKGMDCXT.js} +4 -3
  44. package/dist/{chunk-QDQY7NQ2.js → chunk-VZLX2JZG.js} +5 -5
  45. package/dist/{chunk-T2F4S7U4.js → chunk-WI3VDXHD.js} +18 -8
  46. package/dist/{chunk-O4MBV4AX.js → chunk-WJYXMB2R.js} +6 -5
  47. package/dist/{chunk-U4VAATKP.js → chunk-WXJY3BKV.js} +16 -6
  48. package/dist/{chunk-DR7JOQTC.js → chunk-X5K3U6GI.js} +3 -3
  49. package/dist/{chunk-JQRIR762.js → chunk-YF3D5INN.js} +27 -19
  50. package/dist/{chunk-TEBQ4VPZ.js → chunk-YOHO4DVT.js} +6 -5
  51. package/dist/{chunk-RXISBFR5.js → chunk-ZE6KLBUO.js} +5 -4
  52. package/dist/{chunk-22B7GE5T.js → chunk-ZHH3BEWU.js} +13 -12
  53. package/dist/{chunk-XGHMUZ77.js → chunk-ZZT45EHF.js} +3 -3
  54. package/dist/codebase-index/bm25.d.ts +14 -1
  55. package/dist/codebase-index/index.d.ts +1 -0
  56. package/dist/codebase-index/index.js +13 -8
  57. package/dist/codebase-index/json-parser.d.ts +4 -0
  58. package/dist/codebase-index/parser-worker-script.js +2 -2
  59. package/dist/codebase-index/project-server.js +48 -9
  60. package/dist/codebase-index/worker.js +4 -4
  61. package/dist/codebase-index/writer-bulk-insert.d.ts +0 -1
  62. package/dist/codebase-index/writer-schema.d.ts +1 -1
  63. package/dist/codebase-index/writer.d.ts +38 -0
  64. package/dist/diff.js +1 -1
  65. package/dist/e2e.d.ts +40 -1
  66. package/dist/e2e.js +1 -1
  67. package/dist/edit.js +7 -7
  68. package/dist/exec.js +1 -1
  69. package/dist/fetch.js +1 -1
  70. package/dist/format.d.ts +42 -2
  71. package/dist/format.js +4 -4
  72. package/dist/git.d.ts +70 -1
  73. package/dist/git.js +1 -1
  74. package/dist/glob.js +3 -3
  75. package/dist/{go-parser-JXYKJHRC.js → go-parser-IKHW67WE.js} +2 -2
  76. package/dist/grep.js +3 -3
  77. package/dist/index.js +45 -45
  78. package/dist/install.d.ts +51 -2
  79. package/dist/install.js +4 -4
  80. package/dist/{json-parser-IBHZ4BZC.js → json-parser-2EOVP5MR.js} +81 -15
  81. package/dist/kanban.d.ts +19 -1
  82. package/dist/kanban.js +2 -2
  83. package/dist/languages/index.js +2 -2
  84. package/dist/{legacy-bridge-7M6QLUQN.js → legacy-bridge-SFNXIRAP.js} +4 -4
  85. package/dist/lint.js +4 -4
  86. package/dist/logs.js +1 -1
  87. package/dist/outdated.d.ts +25 -1
  88. package/dist/outdated.js +1 -1
  89. package/dist/pack.js +44 -44
  90. package/dist/{parser-dispatch-QH4XPGG6.js → parser-dispatch-X62UWXJS.js} +3 -3
  91. package/dist/patch.js +7 -7
  92. package/dist/plan.js +4 -4
  93. package/dist/{py-parser-IS4HKYMF.js → py-parser-TDXSQZBC.js} +2 -2
  94. package/dist/read.js +7 -7
  95. package/dist/replace.js +7 -7
  96. package/dist/{rs-parser-XHUUO2KZ.js → rs-parser-GIWPUA3T.js} +2 -2
  97. package/dist/scaffold.js +1 -1
  98. package/dist/search.js +1 -1
  99. package/dist/session-kanban.js +1 -1
  100. package/dist/task.js +4 -4
  101. package/dist/test.js +4 -4
  102. package/dist/todo.js +3 -3
  103. package/dist/tool-diff.js +1 -1
  104. package/dist/tool-tier.js +45 -45
  105. package/dist/tool-use.js +1 -1
  106. package/dist/{ts-parser-RCTYKSVI.js → ts-parser-7W26YB26.js} +2 -2
  107. package/dist/typecheck.js +4 -4
  108. package/dist/write.js +7 -7
  109. package/dist/{yaml-parser-4SAXV3PL.js → yaml-parser-RGBXEZE4.js} +2 -2
  110. package/package.json +5 -5
@@ -1,12 +1,12 @@
1
1
  import {
2
2
  kanbanTool
3
- } from "./chunk-JNNVRHMV.js";
3
+ } from "./chunk-FJEQZHZN.js";
4
4
  import {
5
5
  applyManagedKanbanBoardToTodos,
6
6
  blockingTitles,
7
7
  mirrorSessionTodosToKanban,
8
8
  takeSessionMirrorFailure
9
- } from "./chunk-PY2IOS7C.js";
9
+ } from "./chunk-CWALNI6K.js";
10
10
 
11
11
  // src/todo.ts
12
12
  import {
@@ -80,7 +80,7 @@ async function createMissingManagedCards(items, board, ctx, warnings) {
80
80
  description: item.activeForm?.trim() || `Added from the session todo list: ${item.content}`
81
81
  },
82
82
  // The card mirrors this session's todo row, so the session owns it.
83
- { sessionId: ctx.eventSessionId(), actor: "todo" }
83
+ { sessionId: ctx.eventSessionId?.() ?? ctx.session?.id ?? "default-session", actor: "todo" }
84
84
  );
85
85
  if (!result) {
86
86
  warnings.push(`Could not open a Kanban card for "${item.content}": board not found.`);
@@ -431,4 +431,4 @@ var todoTool = {
431
431
  export {
432
432
  todoTool
433
433
  };
434
- //# sourceMappingURL=chunk-7EY5DCRO.js.map
434
+ //# sourceMappingURL=chunk-5ZYEGP2P.js.map
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  resolveIndexDir
3
- } from "./chunk-TRDX25UH.js";
3
+ } from "./chunk-BLCSYKNN.js";
4
4
 
5
5
  // src/codebase-index/binary-frame.ts
6
6
  import { decode, encode } from "@msgpack/msgpack";
@@ -12,10 +12,11 @@ function isBinaryFrame(firstByte) {
12
12
  }
13
13
  function encodeBinaryFrame(message) {
14
14
  const payload = encode(normalizeUndefined(message));
15
- const header = Buffer.allocUnsafe(5);
16
- header[0] = BINARY_FRAME_MAGIC;
17
- header.writeUInt32BE(payload.length, 1);
18
- return Buffer.concat([header, payload], 5 + payload.length);
15
+ const frame = Buffer.allocUnsafe(5 + payload.length);
16
+ frame[0] = BINARY_FRAME_MAGIC;
17
+ frame.writeUInt32BE(payload.length, 1);
18
+ frame.set(payload, 5);
19
+ return frame;
19
20
  }
20
21
  function normalizeUndefined(value) {
21
22
  if (value instanceof Date) {
@@ -119,4 +120,4 @@ export {
119
120
  PROJECT_INDEX_SERVER_MAX_FRAME_CHARS,
120
121
  encodeProjectServerMessage
121
122
  };
122
- //# sourceMappingURL=chunk-VGBUDLW4.js.map
123
+ //# sourceMappingURL=chunk-6GVXZCQV.js.map
@@ -1,9 +1,9 @@
1
1
  import {
2
2
  mapWithConcurrency
3
- } from "./chunk-U4D5S3VQ.js";
3
+ } from "./chunk-NWZ6XGBJ.js";
4
4
  import {
5
5
  loadGitignoreMatcher
6
- } from "./chunk-LIJQMYYX.js";
6
+ } from "./chunk-DTQ75VBC.js";
7
7
  import {
8
8
  assertRealInsideRoot,
9
9
  safeResolveReal
@@ -58,7 +58,10 @@ var globTool = {
58
58
  field: "pattern"
59
59
  });
60
60
  }
61
- const signal = opts?.signal;
61
+ const signal = opts?.signal ?? ctx?.signal;
62
+ if (signal?.aborted) {
63
+ return { files: [], truncated: true };
64
+ }
62
65
  const base = input.path ? await safeResolveReal(input.path, ctx) : ctx.cwd;
63
66
  const limit = Math.max(1, Math.min(input.limit ?? 1e3, 5e3));
64
67
  const isGitIgnored = await loadGitignoreMatcher(base);
@@ -66,7 +69,7 @@ var globTool = {
66
69
  const results = [];
67
70
  let truncated = false;
68
71
  const pushResult = async (full) => {
69
- if (truncated || results.length >= limit) {
72
+ if (signal?.aborted || truncated || results.length >= limit) {
70
73
  truncated = true;
71
74
  return;
72
75
  }
@@ -108,11 +111,7 @@ var globTool = {
108
111
  subdirs.push({ full, rel });
109
112
  } else if (e.isFile()) {
110
113
  if (isGitIgnored(rel, false)) continue;
111
- re.lastIndex = 0;
112
- const relMatch = re.test(rel);
113
- re.lastIndex = 0;
114
- const nameMatch = re.test(name);
115
- if (relMatch || nameMatch) {
114
+ if (re.test(rel) || re.test(name)) {
116
115
  matchedFiles.push(full);
117
116
  }
118
117
  } else if (e.isSymbolicLink()) {
@@ -127,11 +126,7 @@ var globTool = {
127
126
  if (isGitIgnored(rel, false)) continue;
128
127
  const real = await fs.realpath(full);
129
128
  await assertRealInsideRoot(real, ctx);
130
- re.lastIndex = 0;
131
- const relMatch = re.test(rel);
132
- re.lastIndex = 0;
133
- const nameMatch = re.test(name);
134
- if (relMatch || nameMatch) matchedFiles.push(full);
129
+ if (re.test(rel) || re.test(name)) matchedFiles.push(full);
135
130
  }
136
131
  } catch {
137
132
  }
@@ -156,4 +151,4 @@ var globTool = {
156
151
  export {
157
152
  globTool
158
153
  };
159
- //# sourceMappingURL=chunk-UNSKG6DC.js.map
154
+ //# sourceMappingURL=chunk-6GZPSWP3.js.map
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  enqueueReindex
3
- } from "./chunk-QDQY7NQ2.js";
3
+ } from "./chunk-VZLX2JZG.js";
4
4
  import {
5
5
  resolveRealInsideRoot,
6
6
  safeResolveReal,
@@ -43,6 +43,7 @@ var patchTool = {
43
43
  },
44
44
  async execute(input, ctx, opts) {
45
45
  if (!input?.patch) throw new Error("patch: patch content is required");
46
+ const signal = opts?.signal ?? ctx.signal ?? new AbortController().signal;
46
47
  const strip = Math.max(1, input.strip ?? 1);
47
48
  const dryRun = input.dry_run ?? false;
48
49
  const refuse = (message) => ({
@@ -96,7 +97,7 @@ var patchTool = {
96
97
  const patchFile = path.join(tmpDir, "in.diff");
97
98
  await fs.writeFile(patchFile, input.patch, { mode: 384 });
98
99
  const args = [`-p${strip}`, "--merge", ...dryRun ? ["--dry-run"] : [], "-i", patchFile];
99
- const result = await runPatch(args, dir, opts.signal, {
100
+ const result = await runPatch(args, dir, signal, {
100
101
  patchFile,
101
102
  strip,
102
103
  dryRun
@@ -312,4 +313,4 @@ function extractPatchedFiles(output) {
312
313
  export {
313
314
  patchTool
314
315
  };
315
- //# sourceMappingURL=chunk-5OAOKALG.js.map
316
+ //# sourceMappingURL=chunk-AGUSOFNI.js.map