@wrongstack/tools 0.306.4 → 0.307.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 (71) hide show
  1. package/dist/audit.js +14 -8
  2. package/dist/auto-proceed-loop-guard.js +8 -2
  3. package/dist/bash.js +57 -22
  4. package/dist/builtin.d.ts +6 -6
  5. package/dist/builtin.js +11302 -9305
  6. package/dist/clarify.d.ts +32 -0
  7. package/dist/codebase-index/ast-invariant-engine.d.ts +102 -0
  8. package/dist/codebase-index/ast-symbol-mutator.d.ts +28 -0
  9. package/dist/codebase-index/background-indexer.d.ts +9 -0
  10. package/dist/codebase-index/codebase-ast-replace-tool.d.ts +31 -0
  11. package/dist/codebase-index/codebase-impact-analysis-tool.d.ts +40 -0
  12. package/dist/codebase-index/codebase-invariant-check-tool.d.ts +23 -0
  13. package/dist/codebase-index/codebase-repo-map-tool.d.ts +22 -0
  14. package/dist/codebase-index/codebase-skeleton-tool.d.ts +36 -0
  15. package/dist/codebase-index/codebase-targeted-test-tool.d.ts +30 -0
  16. package/dist/codebase-index/index.d.ts +11 -1
  17. package/dist/codebase-index/index.js +4141 -1479
  18. package/dist/codebase-index/project-server-client-state.d.ts +79 -0
  19. package/dist/codebase-index/project-server-client.d.ts +3 -71
  20. package/dist/codebase-index/project-server-protocol.d.ts +1 -0
  21. package/dist/codebase-index/project-server.js +751 -909
  22. package/dist/codebase-index/repo-map.d.ts +20 -0
  23. package/dist/codebase-index/skeleton-extractor.d.ts +64 -0
  24. package/dist/codebase-index/tree-sitter-parser.d.ts +11 -0
  25. package/dist/codebase-index/worker.js +723 -891
  26. package/dist/codebase-index/writer-mutations.d.ts +26 -0
  27. package/dist/codebase-index/writer-refs.d.ts +50 -0
  28. package/dist/codebase-index/writer-search.d.ts +30 -0
  29. package/dist/codebase-index/writer.d.ts +2 -320
  30. package/dist/edit.js +8558 -349
  31. package/dist/exec.js +73 -20
  32. package/dist/fetch.js +11 -9
  33. package/dist/format.js +14 -8
  34. package/dist/glob.js +5 -1
  35. package/dist/grep.js +19 -8
  36. package/dist/index.d.ts +3 -1
  37. package/dist/index.js +11386 -9416
  38. package/dist/install.js +14 -8
  39. package/dist/json.js +88 -15
  40. package/dist/kanban-board-actions.d.ts +4 -0
  41. package/dist/kanban-lifecycle-actions.d.ts +4 -0
  42. package/dist/kanban-serializer.d.ts +21 -0
  43. package/dist/kanban.js +985 -1034
  44. package/dist/languages/index.js +14 -8
  45. package/dist/lint.js +14 -8
  46. package/dist/logs.js +13 -3
  47. package/dist/next-steps.d.ts +8 -0
  48. package/dist/next-steps.js +18 -0
  49. package/dist/outdated.js +14 -8
  50. package/dist/pack.js +11295 -9305
  51. package/dist/patch.js +8301 -78
  52. package/dist/plan.js +1231 -1281
  53. package/dist/process-registry.js +14 -8
  54. package/dist/ps-slash.js +65 -30
  55. package/dist/read.js +751 -910
  56. package/dist/replace.js +8450 -224
  57. package/dist/search.js +21 -15
  58. package/dist/security-ast-scan-tool.d.ts +43 -0
  59. package/dist/session-kanban-graph.d.ts +9 -0
  60. package/dist/session-kanban-sync.d.ts +31 -0
  61. package/dist/session-kanban.d.ts +5 -141
  62. package/dist/session-kanban.js +367 -360
  63. package/dist/task.js +1157 -1207
  64. package/dist/test.js +14 -8
  65. package/dist/todo.js +2187 -2237
  66. package/dist/tool-diff.js +6 -1
  67. package/dist/tool-summary.js +4 -2
  68. package/dist/tool-tier.js +11302 -9305
  69. package/dist/typecheck.js +14 -8
  70. package/dist/write.js +8374 -153
  71. package/package.json +7 -7
@@ -2550,13 +2550,16 @@ function killWin32Tree(pid, opts = {}) {
2550
2550
  };
2551
2551
  child.on("error", settle);
2552
2552
  child.on("close", settle);
2553
- timeout = setTimeout(() => {
2554
- try {
2555
- child.kill();
2556
- } catch {
2557
- }
2558
- settle();
2559
- }, Math.max(1, opts.timeoutMs ?? WIN32_TASKKILL_TIMEOUT_MS));
2553
+ timeout = setTimeout(
2554
+ () => {
2555
+ try {
2556
+ child.kill();
2557
+ } catch {
2558
+ }
2559
+ settle();
2560
+ },
2561
+ Math.max(1, opts.timeoutMs ?? WIN32_TASKKILL_TIMEOUT_MS)
2562
+ );
2560
2563
  timeout.unref?.();
2561
2564
  child.unref();
2562
2565
  return true;
@@ -2730,7 +2733,10 @@ var ProcessRegistryImpl = class {
2730
2733
  getBreakerCountdown() {
2731
2734
  if (this.autoKillArmedAt === null || this.autoKillResetMs <= 0) return null;
2732
2735
  const elapsed = Date.now() - this.autoKillArmedAt;
2733
- return { remainingMs: Math.max(0, this.autoKillResetMs - elapsed), totalMs: this.autoKillResetMs };
2736
+ return {
2737
+ remainingMs: Math.max(0, this.autoKillResetMs - elapsed),
2738
+ totalMs: this.autoKillResetMs
2739
+ };
2734
2740
  }
2735
2741
  /**
2736
2742
  * Subscribe to countdown arm/cancel events. Returns an unsubscribe function.
package/dist/lint.js CHANGED
@@ -422,13 +422,16 @@ function killWin32Tree(pid, opts = {}) {
422
422
  };
423
423
  child.on("error", settle);
424
424
  child.on("close", settle);
425
- timeout = setTimeout(() => {
426
- try {
427
- child.kill();
428
- } catch {
429
- }
430
- settle();
431
- }, Math.max(1, opts.timeoutMs ?? WIN32_TASKKILL_TIMEOUT_MS));
425
+ timeout = setTimeout(
426
+ () => {
427
+ try {
428
+ child.kill();
429
+ } catch {
430
+ }
431
+ settle();
432
+ },
433
+ Math.max(1, opts.timeoutMs ?? WIN32_TASKKILL_TIMEOUT_MS)
434
+ );
432
435
  timeout.unref?.();
433
436
  child.unref();
434
437
  return true;
@@ -602,7 +605,10 @@ var ProcessRegistryImpl = class {
602
605
  getBreakerCountdown() {
603
606
  if (this.autoKillArmedAt === null || this.autoKillResetMs <= 0) return null;
604
607
  const elapsed = Date.now() - this.autoKillArmedAt;
605
- return { remainingMs: Math.max(0, this.autoKillResetMs - elapsed), totalMs: this.autoKillResetMs };
608
+ return {
609
+ remainingMs: Math.max(0, this.autoKillResetMs - elapsed),
610
+ totalMs: this.autoKillResetMs
611
+ };
606
612
  }
607
613
  /**
608
614
  * Subscribe to countdown arm/cancel events. Returns an unsubscribe function.
package/dist/logs.js CHANGED
@@ -287,7 +287,13 @@ async function dockerLogs(service, lines, filterRe, cwd, signal, since) {
287
287
  clearTimeout(timer);
288
288
  resolve2(result);
289
289
  };
290
- const child = spawn("docker", args, { cwd, signal, env: buildChildEnv(), stdio: ["ignore", "pipe", "pipe"], windowsHide: true });
290
+ const child = spawn("docker", args, {
291
+ cwd,
292
+ signal,
293
+ env: buildChildEnv(),
294
+ stdio: ["ignore", "pipe", "pipe"],
295
+ windowsHide: true
296
+ });
291
297
  const timer = setTimeout(() => {
292
298
  child.kill("SIGTERM");
293
299
  finish(empty());
@@ -299,10 +305,14 @@ async function dockerLogs(service, lines, filterRe, cwd, signal, since) {
299
305
  if (stderr.length < MAX) stderr += c.toString();
300
306
  });
301
307
  child.stdout?.on("error", (e) => {
302
- console.log(JSON.stringify({ level: "debug", event: "pipe_error", stream: "stdout", error: e.message }));
308
+ console.log(
309
+ JSON.stringify({ level: "debug", event: "pipe_error", stream: "stdout", error: e.message })
310
+ );
303
311
  });
304
312
  child.stderr?.on("error", (e) => {
305
- console.log(JSON.stringify({ level: "debug", event: "pipe_error", stream: "stderr", error: e.message }));
313
+ console.log(
314
+ JSON.stringify({ level: "debug", event: "pipe_error", stream: "stderr", error: e.message })
315
+ );
306
316
  });
307
317
  child.on("close", () => {
308
318
  const output = stdout + stderr;
@@ -46,6 +46,14 @@ export interface ParseNextStepsResult {
46
46
  /** The first item's text when it has auto="true"; otherwise empty. */
47
47
  autoTexts: string[];
48
48
  }
49
+ /**
50
+ * Validate the structured input of the `nextsteps` tool for UI consumers.
51
+ *
52
+ * The runtime normally folds this input into the terminal assistant response.
53
+ * Browser clients still keep this projection as a fallback for a terminal
54
+ * response that is missing (for example after an interrupted stream).
55
+ */
56
+ export declare function projectNextStepsToolInput(input: unknown): ParsedNextStep[];
49
57
  /**
50
58
  * Whether an LLM response's stop reason means the message is the FINAL one of
51
59
  * a turn.
@@ -1,4 +1,21 @@
1
1
  // src/next-steps.ts
2
+ function projectNextStepsToolInput(input) {
3
+ if (!input || typeof input !== "object" || Array.isArray(input)) return [];
4
+ const rawSteps = input["steps"];
5
+ if (!Array.isArray(rawSteps)) return [];
6
+ const steps = [];
7
+ for (const candidate of rawSteps) {
8
+ if (!candidate || typeof candidate !== "object" || Array.isArray(candidate)) continue;
9
+ const text = candidate["text"];
10
+ if (typeof text !== "string" || !text.trim()) continue;
11
+ const auto = steps.length === 0 && candidate["auto"] === true;
12
+ steps.push(
13
+ auto ? { index: steps.length + 1, text: text.trim(), auto: true } : { index: steps.length + 1, text: text.trim() }
14
+ );
15
+ if (steps.length >= MAX_STEPS) break;
16
+ }
17
+ return steps;
18
+ }
2
19
  function isFinalTurnStopReason(stopReason) {
3
20
  return stopReason !== "tool_use" && stopReason !== "tool_call";
4
21
  }
@@ -116,6 +133,7 @@ function stripNextStepsBlock(text) {
116
133
  export {
117
134
  isFinalTurnStopReason,
118
135
  parseNextSteps,
136
+ projectNextStepsToolInput,
119
137
  stripNextStepsBlock
120
138
  };
121
139
  //# sourceMappingURL=next-steps.js.map
package/dist/outdated.js CHANGED
@@ -2790,13 +2790,16 @@ function killWin32Tree(pid, opts = {}) {
2790
2790
  };
2791
2791
  child.on("error", settle);
2792
2792
  child.on("close", settle);
2793
- timeout = setTimeout(() => {
2794
- try {
2795
- child.kill();
2796
- } catch {
2797
- }
2798
- settle();
2799
- }, Math.max(1, opts.timeoutMs ?? WIN32_TASKKILL_TIMEOUT_MS));
2793
+ timeout = setTimeout(
2794
+ () => {
2795
+ try {
2796
+ child.kill();
2797
+ } catch {
2798
+ }
2799
+ settle();
2800
+ },
2801
+ Math.max(1, opts.timeoutMs ?? WIN32_TASKKILL_TIMEOUT_MS)
2802
+ );
2800
2803
  timeout.unref?.();
2801
2804
  child.unref();
2802
2805
  return true;
@@ -2984,7 +2987,10 @@ var init_process_registry = __esm({
2984
2987
  getBreakerCountdown() {
2985
2988
  if (this.autoKillArmedAt === null || this.autoKillResetMs <= 0) return null;
2986
2989
  const elapsed = Date.now() - this.autoKillArmedAt;
2987
- return { remainingMs: Math.max(0, this.autoKillResetMs - elapsed), totalMs: this.autoKillResetMs };
2990
+ return {
2991
+ remainingMs: Math.max(0, this.autoKillResetMs - elapsed),
2992
+ totalMs: this.autoKillResetMs
2993
+ };
2988
2994
  }
2989
2995
  /**
2990
2996
  * Subscribe to countdown arm/cancel events. Returns an unsubscribe function.