@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
@@ -3,7 +3,7 @@ import {
3
3
  } from "./chunk-FQZOHLG3.js";
4
4
  import {
5
5
  enqueueReindex
6
- } from "./chunk-QDQY7NQ2.js";
6
+ } from "./chunk-VZLX2JZG.js";
7
7
  import {
8
8
  safeResolveReal,
9
9
  sha256hex,
@@ -280,6 +280,8 @@ var editTool = {
280
280
  if (!input?.path) {
281
281
  throw new ToolValidationError({ message: "edit: path is required", field: "path" });
282
282
  }
283
+ const signal = opts?.signal ?? ctx?.signal;
284
+ signal?.throwIfAborted();
283
285
  if (input.old_string === void 0) {
284
286
  throw new ToolValidationError({
285
287
  message: "edit: old_string is required",
@@ -364,10 +366,10 @@ var editTool = {
364
366
  note: autoReadNote
365
367
  };
366
368
  }
367
- opts?.signal?.throwIfAborted();
369
+ signal?.throwIfAborted();
368
370
  const ladder = findLadderMatches(fileLf, oldLf);
369
371
  if (!ladder) {
370
- opts?.signal?.throwIfAborted();
372
+ signal?.throwIfAborted();
371
373
  throw noMatchError(input.path, fileLf, oldLf);
372
374
  }
373
375
  const { tier, matches } = ladder;
@@ -398,7 +400,7 @@ var editTool = {
398
400
  let newFileLf;
399
401
  let tierNote;
400
402
  if (tier === "exact") {
401
- newFileLf = input.replace_all ? fileLf.split(oldLf).join(newLf) : fileLf.replace(oldLf, newLf);
403
+ newFileLf = input.replace_all ? fileLf.split(oldLf).join(newLf) : fileLf.replace(oldLf, () => newLf);
402
404
  } else {
403
405
  let replacement = newLf;
404
406
  let indentSuffix = "";
@@ -419,7 +421,7 @@ var editTool = {
419
421
  tierNote = `old_string did not match exactly; applied via ${TIER_LABEL[tier]} at line ${matches[0].startLine} (confidence: ${TIER_CONFIDENCE[tier]}${scoreSuffix}${indentSuffix}). Review the diff to confirm the intended target was edited.`;
420
422
  }
421
423
  const newFile = toStyle(newFileLf, style);
422
- opts?.signal?.throwIfAborted();
424
+ signal?.throwIfAborted();
423
425
  await atomicWrite(absPath, newFile, { mode: updated.mode & 511 });
424
426
  try {
425
427
  enqueueReindex({ projectRoot: ctx.projectRoot, files: [absPath] });
@@ -433,7 +435,7 @@ var editTool = {
433
435
  before: original,
434
436
  after: newFile
435
437
  });
436
- opts?.signal?.throwIfAborted();
438
+ signal?.throwIfAborted();
437
439
  const { text: diff, truncated: diffTruncated } = truncateDiffPayload(
438
440
  unifiedDiff(original, newFile, {
439
441
  fromFile: input.path,
@@ -471,4 +473,4 @@ Compare this against your old_string and retry with the file's actual text.` : "
471
473
  export {
472
474
  editTool
473
475
  };
474
- //# sourceMappingURL=chunk-U6DZWHBA.js.map
476
+ //# sourceMappingURL=chunk-CIFAIIHI.js.map
@@ -3,7 +3,7 @@ import {
3
3
  } from "./chunk-Q5JPPCZC.js";
4
4
  import {
5
5
  enqueueReindex
6
- } from "./chunk-QDQY7NQ2.js";
6
+ } from "./chunk-VZLX2JZG.js";
7
7
  import {
8
8
  isBinaryBuffer,
9
9
  safeResolveReal,
@@ -64,7 +64,7 @@ var replaceTool = {
64
64
  },
65
65
  required: ["pattern", "replacement", "files"]
66
66
  },
67
- async execute(input, ctx) {
67
+ async execute(input, ctx, opts) {
68
68
  if (!input?.pattern) {
69
69
  throw new ToolValidationError({
70
70
  message: "replace: pattern is required",
@@ -83,6 +83,8 @@ var replaceTool = {
83
83
  field: "files"
84
84
  });
85
85
  }
86
+ const signal = opts?.signal ?? ctx.signal;
87
+ signal?.throwIfAborted();
86
88
  const replaceAll = input.replace_all ?? true;
87
89
  const compiled = compileUserRegex(input.pattern, "g");
88
90
  if (!compiled.ok) {
@@ -103,6 +105,7 @@ var replaceTool = {
103
105
  let diffsOmitted = 0;
104
106
  let diffsTruncated = 0;
105
107
  for (const absPath of fileList) {
108
+ signal?.throwIfAborted();
106
109
  const lstat2 = await fs.lstat(absPath).catch((err) => {
107
110
  if (err.code === "ENOENT") return null;
108
111
  throw err;
@@ -226,25 +229,32 @@ function expandReplacement(template, match) {
226
229
  }
227
230
  return out;
228
231
  }
229
- function passesExtraGlob(extraGlob, name, full) {
232
+ function passesExtraGlob(extraGlob, name, full, base) {
230
233
  extraGlob.lastIndex = 0;
231
- const nameMatch = extraGlob.test(name);
234
+ if (extraGlob.test(name)) return true;
235
+ if (base) {
236
+ const rel = path.relative(base, full);
237
+ const posixRel = !rel || rel.startsWith("..") || path.isAbsolute(rel) ? full.split(path.sep).join("/") : rel.split(path.sep).join("/");
238
+ extraGlob.lastIndex = 0;
239
+ if (extraGlob.test(posixRel)) return true;
240
+ }
241
+ const posixFull = full.split(path.sep).join("/");
232
242
  extraGlob.lastIndex = 0;
233
- const fullMatch = extraGlob.test(full);
243
+ if (extraGlob.test(posixFull)) return true;
234
244
  extraGlob.lastIndex = 0;
235
- return nameMatch || fullMatch;
245
+ return extraGlob.test(full);
236
246
  }
237
247
  async function resolveFiles(filesInput, ctx, extraGlob) {
238
248
  const base = ctx.cwd;
239
- const normalized = filesInput.trim();
240
- if (normalized.startsWith("**/") || normalized.startsWith("*") || normalized.includes("**")) {
241
- return await globFiles(normalized, base, extraGlob);
242
- }
243
- const parts = normalized.split(",").map((s) => s.trim()).filter(Boolean);
249
+ const parts = filesInput.trim().split(",").map((s) => s.trim()).filter(Boolean);
244
250
  const resolved = [];
245
251
  for (const p of parts) {
252
+ if (p.includes("*") || p.includes("?")) {
253
+ resolved.push(...await globFiles(p, base, extraGlob));
254
+ continue;
255
+ }
246
256
  const absPath = await safeResolveReal(p, ctx);
247
- if (extraGlob && !passesExtraGlob(extraGlob, path.basename(absPath), absPath)) continue;
257
+ if (extraGlob && !passesExtraGlob(extraGlob, path.basename(absPath), absPath, base)) continue;
248
258
  const stat2 = await fs.stat(absPath).catch(() => null);
249
259
  if (stat2?.isFile()) {
250
260
  resolved.push(absPath);
@@ -259,7 +269,7 @@ async function globFiles(pattern, base, extraGlob) {
259
269
  const { promise } = spawnRgFind(pattern, base);
260
270
  const files = await promise;
261
271
  if (extraGlob) {
262
- return files.filter((f) => passesExtraGlob(extraGlob, path.basename(f), f));
272
+ return files.filter((f) => passesExtraGlob(extraGlob, path.basename(f), f, base));
263
273
  }
264
274
  return files;
265
275
  } catch {
@@ -290,6 +300,12 @@ function checkRg() {
290
300
  function spawnRgFind(pattern, base) {
291
301
  const args = ["--files", "--glob", pattern, base];
292
302
  const child = spawn("rg", args, {
303
+ // Anchored globs (`src/*.ts`) are matched by rg against paths relative to
304
+ // ITS cwd, not the search root. Without this the child inherits the
305
+ // process cwd, so `files: "src/*.ts"` silently matches nothing whenever
306
+ // the tool's base differs from the cwd of the host process and the native
307
+ // walker never engages (the rg call resolves, just empty).
308
+ cwd: base,
293
309
  signal: AbortSignal.timeout(3e4),
294
310
  env: buildChildEnv(),
295
311
  stdio: ["ignore", "pipe", "pipe"],
@@ -339,12 +355,14 @@ async function globNative(pattern, base, extraGlob) {
339
355
  await walk(full);
340
356
  } else if (e.isFile()) {
341
357
  const name = e.name;
342
- if (globRe.test(name) || globRe.test(full)) {
343
- if (extraGlob && !extraGlob.test(name) && !extraGlob.test(full)) continue;
358
+ const rel = path.relative(base, full).split(path.sep).join("/");
359
+ if (globRe.test(name) || globRe.test(rel) || globRe.test(full)) {
360
+ if (extraGlob && !passesExtraGlob(extraGlob, name, full, base)) {
361
+ continue;
362
+ }
344
363
  results.push(full);
345
364
  }
346
365
  globRe.lastIndex = 0;
347
- if (extraGlob) extraGlob.lastIndex = 0;
348
366
  }
349
367
  }
350
368
  };
@@ -356,4 +374,4 @@ export {
356
374
  replaceTool,
357
375
  __resetRgDetectionForTests
358
376
  };
359
- //# sourceMappingURL=chunk-HPEO4EA7.js.map
377
+ //# sourceMappingURL=chunk-CISOLTOP.js.map
@@ -50,6 +50,7 @@ var logsTool = {
50
50
  },
51
51
  async execute(input, ctx, opts) {
52
52
  const cwd = input.cwd ? await safeResolveReal(input.cwd, ctx) : ctx.cwd;
53
+ const signal = opts?.signal ?? ctx.signal ?? new AbortController().signal;
53
54
  const lines = input.lines ?? 100;
54
55
  let filterRe = null;
55
56
  if (input.filter) {
@@ -60,7 +61,7 @@ var logsTool = {
60
61
  filterRe = compiled.regex;
61
62
  }
62
63
  if (input.service) {
63
- return await dockerLogs(input.service, lines, filterRe, cwd, opts.signal, input.since);
64
+ return await dockerLogs(input.service, lines, filterRe, cwd, signal, input.since);
64
65
  }
65
66
  if (input.path) {
66
67
  return await fileLogs(await safeResolveReal(input.path, ctx), lines, filterRe);
@@ -228,4 +229,4 @@ function parseLine(line) {
228
229
  export {
229
230
  logsTool
230
231
  };
231
- //# sourceMappingURL=chunk-RGISBZBD.js.map
232
+ //# sourceMappingURL=chunk-CPSAF2AU.js.map
@@ -1,9 +1,9 @@
1
1
  import {
2
2
  tryLegacyCodeOperation
3
- } from "./chunk-PQKK5JH7.js";
3
+ } from "./chunk-4E42D7UF.js";
4
4
  import {
5
5
  spawnStream
6
- } from "./chunk-22B7GE5T.js";
6
+ } from "./chunk-ZHH3BEWU.js";
7
7
  import {
8
8
  normalizeCommandOutput,
9
9
  safeResolveReal
@@ -56,12 +56,13 @@ var testTool = {
56
56
  },
57
57
  async *executeStream(input, ctx, opts) {
58
58
  const cwd = input.cwd ? await safeResolveReal(input.cwd, ctx) : ctx.cwd;
59
+ const signal = opts?.signal ?? ctx.signal ?? new AbortController().signal;
59
60
  const runner = input.runner ?? "auto";
60
61
  if (runner === "auto") {
61
62
  const bridge = await tryLegacyCodeOperation("test", {
62
63
  cwd,
63
64
  projectRoot: ctx.projectRoot,
64
- signal: opts.signal
65
+ signal
65
66
  });
66
67
  if (bridge?.run) {
67
68
  const run = bridge.run;
@@ -105,7 +106,7 @@ var testTool = {
105
106
  cmd: detected,
106
107
  args,
107
108
  cwd,
108
- signal: opts.signal,
109
+ signal,
109
110
  maxBytes: 2e5
110
111
  });
111
112
  const duration = Date.now() - start;
@@ -196,4 +197,4 @@ function parseResult(runner, result, duration) {
196
197
  export {
197
198
  testTool
198
199
  };
199
- //# sourceMappingURL=chunk-BSLVR56S.js.map
200
+ //# sourceMappingURL=chunk-CPVLVQYT.js.map
@@ -1,9 +1,9 @@
1
1
  import {
2
2
  tryLegacyPackageOperation
3
- } from "./chunk-PQKK5JH7.js";
3
+ } from "./chunk-4E42D7UF.js";
4
4
  import {
5
5
  spawnStream
6
- } from "./chunk-22B7GE5T.js";
6
+ } from "./chunk-ZHH3BEWU.js";
7
7
  import {
8
8
  COMMAND_OUTPUT_MAX_BYTES,
9
9
  detectPackageManager,
@@ -61,10 +61,11 @@ var auditTool = {
61
61
  );
62
62
  }
63
63
  const cwd = input.cwd ? await safeResolveReal(input.cwd, ctx) : ctx.cwd;
64
+ const signal = opts?.signal ?? ctx.signal ?? new AbortController().signal;
64
65
  const bridge = await tryLegacyPackageOperation("package-audit", {
65
66
  cwd,
66
67
  projectRoot: ctx.projectRoot,
67
- signal: opts.signal
68
+ signal
68
69
  });
69
70
  if (bridge?.outcome) {
70
71
  const outcome = bridge.outcome;
@@ -99,7 +100,7 @@ var auditTool = {
99
100
  cmd: manager,
100
101
  args,
101
102
  cwd,
102
- signal: opts.signal,
103
+ signal,
103
104
  maxBytes: 1e5
104
105
  });
105
106
  yield {
@@ -187,4 +188,4 @@ function extractAdvisories(data) {
187
188
  export {
188
189
  auditTool
189
190
  };
190
- //# sourceMappingURL=chunk-VJNHFZ7J.js.map
191
+ //# sourceMappingURL=chunk-CVALEVGA.js.map
@@ -910,7 +910,7 @@ async function rebindSessionKanbanTask(context) {
910
910
  return null;
911
911
  }
912
912
  if (!best) return null;
913
- context.setCurrentKanbanTask(best.taskId, best.boardId);
913
+ context.setCurrentKanbanTask?.(best.taskId, best.boardId);
914
914
  return { boardId: best.boardId, taskId: best.taskId };
915
915
  }
916
916
  var degradationReason;
@@ -937,15 +937,15 @@ async function hydrateSessionKanbanBoard(context, id) {
937
937
  fireAndForget("prune-session-boards", pruneSessionBoards(context.projectRoot));
938
938
  }
939
939
  let board = await ensureSessionKanbanBoard(context.projectRoot, id);
940
- if (context.todos.length) {
940
+ if (context.todos?.length) {
941
941
  board = await projectSessionTodosToKanban(context.projectRoot, context.todos, id);
942
942
  }
943
- const planPath = context.meta["plan.path"];
943
+ const planPath = context.meta?.["plan.path"];
944
944
  if (typeof planPath === "string" && planPath) {
945
945
  const plan = await loadPlan(planPath);
946
946
  if (plan) board = await projectSessionPlanToKanban(context.projectRoot, plan.items, id);
947
947
  }
948
- const taskPath = context.meta["task.path"];
948
+ const taskPath = context.meta?.["task.path"];
949
949
  if (typeof taskPath === "string" && taskPath) {
950
950
  const tasks = await loadTasks(taskPath);
951
951
  if (tasks) board = await projectSessionTasksToKanban(context.projectRoot, tasks.tasks, id);
@@ -997,4 +997,4 @@ export {
997
997
  applyManagedKanbanBoardToTodos2 as applyManagedKanbanBoardToTodos,
998
998
  applySessionKanbanTaskToSource2 as applySessionKanbanTaskToSource
999
999
  };
1000
- //# sourceMappingURL=chunk-PY2IOS7C.js.map
1000
+ //# sourceMappingURL=chunk-CWALNI6K.js.map
@@ -33,12 +33,16 @@ function compileGitignore(lines) {
33
33
  dirOnly
34
34
  });
35
35
  }
36
+ const hasNegation = rules.some((r) => r.negated);
36
37
  return (relPath, isDir) => {
37
- const p = relPath.replace(/\\/g, "/").replace(/^\/+/, "");
38
+ const p = relPath.includes("\\") || relPath.startsWith("/") ? relPath.replace(/\\/g, "/").replace(/^\/+/, "") : relPath;
38
39
  let ignored = false;
39
40
  for (const r of rules) {
40
41
  const re = r.dirOnly && !isDir ? r.under : r.eqOrUnder;
41
- if (re.test(p)) ignored = !r.negated;
42
+ if (re.test(p)) {
43
+ ignored = !r.negated;
44
+ if (!hasNegation && ignored) return true;
45
+ }
42
46
  }
43
47
  return ignored;
44
48
  };
@@ -54,6 +58,7 @@ async function loadGitignoreMatcher(projectRoot) {
54
58
  }
55
59
 
56
60
  export {
61
+ compileGitignore,
57
62
  loadGitignoreMatcher
58
63
  };
59
- //# sourceMappingURL=chunk-LIJQMYYX.js.map
64
+ //# sourceMappingURL=chunk-DTQ75VBC.js.map
@@ -4,10 +4,10 @@ import {
4
4
  } from "./chunk-Q5JPPCZC.js";
5
5
  import {
6
6
  mapWithConcurrency
7
- } from "./chunk-U4D5S3VQ.js";
7
+ } from "./chunk-NWZ6XGBJ.js";
8
8
  import {
9
9
  loadGitignoreMatcher
10
- } from "./chunk-LIJQMYYX.js";
10
+ } from "./chunk-DTQ75VBC.js";
11
11
  import {
12
12
  isBinaryBuffer,
13
13
  safeResolveReal
@@ -107,16 +107,17 @@ var grepTool = {
107
107
  field: "pattern"
108
108
  });
109
109
  }
110
+ const signal = opts?.signal ?? ctx.signal ?? new AbortController().signal;
110
111
  const rgAvailable = await detectRg();
111
112
  if (rgAvailable) {
112
113
  try {
113
- yield* runRgStream(input, base, mode, limit, opts.signal);
114
+ yield* runRgStream(input, base, mode, limit, signal);
114
115
  return;
115
116
  } catch {
116
117
  }
117
118
  }
118
119
  yield { type: "log", text: "Falling back to native grep\u2026" };
119
- const out = await runNative(input, base, mode, limit, opts.signal);
120
+ const out = await runNative(input, base, mode, limit, signal);
120
121
  yield { type: "final", output: out };
121
122
  }
122
123
  };
@@ -151,7 +152,7 @@ async function* runRgStream(input, base, mode, limit, signal) {
151
152
  if (input.context_lines) args.push("-C", String(input.context_lines));
152
153
  }
153
154
  for (const ignored of DEFAULT_IGNORE) {
154
- args.push("--glob", `!${ignored}/**`, "--glob", `!**/${ignored}/**`);
155
+ args.push("--glob", `!**/${ignored}/**`);
155
156
  }
156
157
  const gitignorePath = path.join(base, ".gitignore");
157
158
  if (await fs.access(gitignorePath).then(
@@ -475,4 +476,4 @@ export {
475
476
  grepTool,
476
477
  __resetRgDetectionForTests
477
478
  };
478
- //# sourceMappingURL=chunk-553IQUMO.js.map
479
+ //# sourceMappingURL=chunk-EOOFNYIT.js.map
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  applySessionKanbanTaskToSource,
3
3
  taskFileToSerializedGraph
4
- } from "./chunk-PY2IOS7C.js";
4
+ } from "./chunk-CWALNI6K.js";
5
5
 
6
6
  // src/kanban.ts
7
7
  import { stripLifecycleIssues as stripLifecycleIssues2 } from "@wrongstack/kanban";
@@ -156,7 +156,7 @@ async function requireBoard(projectRoot, boardId) {
156
156
  // src/kanban-board-actions.ts
157
157
  async function handleKanbanBoardAction(projectRoot, input, ctx) {
158
158
  const eventContext = {
159
- sessionId: ctx.eventSessionId(),
159
+ sessionId: ctx.eventSessionId?.() ?? ctx.session?.id ?? "default-session",
160
160
  ...ctx.agentId !== void 0 ? { actor: ctx.agentId } : {}
161
161
  };
162
162
  switch (input.action) {
@@ -575,7 +575,7 @@ function recordKanbanVerificationEvidence(ctx, report) {
575
575
  // src/kanban-decomposition-actions.ts
576
576
  async function handleKanbanDecompositionAction(projectRoot, input, ctx) {
577
577
  const eventContext = {
578
- sessionId: ctx.eventSessionId(),
578
+ sessionId: ctx.eventSessionId?.() ?? ctx.session?.id ?? "default-session",
579
579
  ...ctx.agentId !== void 0 ? { actor: ctx.agentId } : {}
580
580
  };
581
581
  switch (input.action) {
@@ -677,7 +677,7 @@ import {
677
677
  } from "@wrongstack/kanban";
678
678
  async function handleKanbanDetailAction(projectRoot, input, ctx) {
679
679
  const eventContext = {
680
- sessionId: ctx.eventSessionId(),
680
+ sessionId: ctx.eventSessionId?.() ?? ctx.session?.id ?? "default-session",
681
681
  ...ctx.agentId !== void 0 ? { actor: ctx.agentId } : {}
682
682
  };
683
683
  switch (input.action) {
@@ -1055,7 +1055,7 @@ async function syncContextTask(ctx, task, options = {}) {
1055
1055
  }
1056
1056
  async function handleKanbanLifecycleAction(projectRoot, input, ctx) {
1057
1057
  const eventContext = {
1058
- sessionId: ctx.eventSessionId(),
1058
+ sessionId: ctx.eventSessionId?.() ?? ctx.session?.id ?? "default-session",
1059
1059
  ...ctx.agentId !== void 0 ? { actor: ctx.agentId } : {}
1060
1060
  };
1061
1061
  switch (input.action) {
@@ -2069,7 +2069,7 @@ var kanbanTool = {
2069
2069
  icon: "task",
2070
2070
  timeoutMs: 3e4,
2071
2071
  inputSchema: KANBAN_INPUT_SCHEMA,
2072
- async execute(input, ctx) {
2072
+ async execute(input, ctx, _opts) {
2073
2073
  const projectRoot = ctx.projectRoot;
2074
2074
  if (!projectRoot) return fail("No project root is available.");
2075
2075
  const withPresence = createKanbanPresenceWrapper(projectRoot, input, ctx);
@@ -2085,7 +2085,7 @@ var kanbanTool = {
2085
2085
  projectRoot,
2086
2086
  input,
2087
2087
  input.author ?? input.agentId,
2088
- ctx.eventSessionId()
2088
+ ctx.eventSessionId?.() ?? ctx.session?.id ?? "default-session"
2089
2089
  );
2090
2090
  if (contractResult !== void 0) return contractResult;
2091
2091
  const detailResult = await handleKanbanDetailAction(projectRoot, input, ctx);
@@ -2108,4 +2108,4 @@ export {
2108
2108
  recordKanbanVerificationEvidence,
2109
2109
  kanbanTool
2110
2110
  };
2111
- //# sourceMappingURL=chunk-JNNVRHMV.js.map
2111
+ //# sourceMappingURL=chunk-FJEQZHZN.js.map
@@ -65,7 +65,7 @@ var toolUseTool = {
65
65
  executionMs: Date.now() - start
66
66
  };
67
67
  }
68
- const governedExecute = ctx.meta[GOVERNED_TOOL_EXECUTOR_META_KEY];
68
+ const governedExecute = ctx.meta?.[GOVERNED_TOOL_EXECUTOR_META_KEY];
69
69
  if (typeof governedExecute !== "function") {
70
70
  return {
71
71
  tool: input.tool,
@@ -96,4 +96,4 @@ var toolUseTool = {
96
96
  export {
97
97
  toolUseTool
98
98
  };
99
- //# sourceMappingURL=chunk-S5CCLZL3.js.map
99
+ //# sourceMappingURL=chunk-FRN7TIAA.js.map
@@ -1,9 +1,9 @@
1
1
  import {
2
2
  todoTool
3
- } from "./chunk-7EY5DCRO.js";
3
+ } from "./chunk-5ZYEGP2P.js";
4
4
  import {
5
5
  projectSessionPlanToKanban
6
- } from "./chunk-PY2IOS7C.js";
6
+ } from "./chunk-CWALNI6K.js";
7
7
 
8
8
  // src/plan.ts
9
9
  import { randomUUID } from "node:crypto";
@@ -363,4 +363,4 @@ function mkResult(plan, ok, message, todos) {
363
363
  export {
364
364
  planTool
365
365
  };
366
- //# sourceMappingURL=chunk-NKJW5GFO.js.map
366
+ //# sourceMappingURL=chunk-H6AWAZ2Y.js.map
@@ -604,6 +604,7 @@ var bashTool = {
604
604
  const args = [...plan.argv, plan.commandArg];
605
605
  const env = buildChildEnv(ctx.session?.id);
606
606
  const spawnCwd = ctx.workingDir ?? ctx.projectRoot;
607
+ const callerSignal = opts?.signal ?? ctx.signal ?? new AbortController().signal;
607
608
  const detached = !isWin2;
608
609
  const startedAt = Date.now();
609
610
  if (input.background) {
@@ -691,7 +692,7 @@ var bashTool = {
691
692
  stdio: ["ignore", "pipe", "pipe"],
692
693
  detached,
693
694
  windowsHide: true,
694
- ...isWin2 ? {} : { signal: opts.signal }
695
+ ...isWin2 ? {} : { signal: callerSignal }
695
696
  });
696
697
  const pid = child.pid;
697
698
  let stdoutBytes = 0;
@@ -779,8 +780,8 @@ var bashTool = {
779
780
  timer.unref?.();
780
781
  const onAbort = () => killWithTimeout(child, 2e3);
781
782
  if (isWin2) {
782
- if (opts.signal.aborted) onAbort();
783
- else opts.signal.addEventListener("abort", onAbort, { once: true });
783
+ if (callerSignal.aborted) onAbort();
784
+ else callerSignal.addEventListener("abort", onAbort, { once: true });
784
785
  }
785
786
  const queue = [];
786
787
  let resolveNext = null;
@@ -900,7 +901,7 @@ ${hint}` : "") + pipeToShellNote,
900
901
  } finally {
901
902
  for (const t of timers) clearTimeout(t);
902
903
  spool.finalize();
903
- if (isWin2) opts.signal.removeEventListener("abort", onAbort);
904
+ if (isWin2) callerSignal.removeEventListener("abort", onAbort);
904
905
  child.stdout?.off("data", onStdoutData);
905
906
  child.stderr?.off("data", onStderrData);
906
907
  child.stdout?.destroy();
@@ -952,4 +953,4 @@ export {
952
953
  checkAndBlockKillCommand,
953
954
  bashTool
954
955
  };
955
- //# sourceMappingURL=chunk-IVWV2UM6.js.map
956
+ //# sourceMappingURL=chunk-HTYEO67J.js.map
@@ -824,27 +824,27 @@ async function dispatch(file, content, lang) {
824
824
  case "tsx":
825
825
  case "js":
826
826
  case "jsx": {
827
- const { parseSymbols } = await import("./ts-parser-RCTYKSVI.js");
827
+ const { parseSymbols } = await import("./ts-parser-7W26YB26.js");
828
828
  return parseSymbols({ file, content, lang });
829
829
  }
830
830
  case "go": {
831
- const { parseSymbols } = await import("./go-parser-JXYKJHRC.js");
831
+ const { parseSymbols } = await import("./go-parser-IKHW67WE.js");
832
832
  return parseSymbols({ file, content, lang: "go" });
833
833
  }
834
834
  case "py": {
835
- const { parseSymbols } = await import("./py-parser-IS4HKYMF.js");
835
+ const { parseSymbols } = await import("./py-parser-TDXSQZBC.js");
836
836
  return parseSymbols({ file, content, lang: "py" });
837
837
  }
838
838
  case "rs": {
839
- const { parseSymbols } = await import("./rs-parser-XHUUO2KZ.js");
839
+ const { parseSymbols } = await import("./rs-parser-GIWPUA3T.js");
840
840
  return parseSymbols({ file, content, lang: "rs" });
841
841
  }
842
842
  case "json": {
843
- const { parseSymbols } = await import("./json-parser-IBHZ4BZC.js");
843
+ const { parseSymbols } = await import("./json-parser-2EOVP5MR.js");
844
844
  return parseSymbols({ file, content, lang: "json" });
845
845
  }
846
846
  case "yaml": {
847
- const { parseSymbols } = await import("./yaml-parser-4SAXV3PL.js");
847
+ const { parseSymbols } = await import("./yaml-parser-RGBXEZE4.js");
848
848
  return parseSymbols({ file, content, lang: "yaml" });
849
849
  }
850
850
  // Phase 1: ten languages now route through the Tree-Sitter WASM
@@ -889,4 +889,4 @@ export {
889
889
  parseFileContent,
890
890
  parseFilesContent
891
891
  };
892
- //# sourceMappingURL=chunk-IYK7XGDZ.js.map
892
+ //# sourceMappingURL=chunk-JJQB6R7Y.js.map