@wrongstack/tools 0.319.1 → 1.0.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 (203) hide show
  1. package/dist/_danger-detect.d.ts +8 -0
  2. package/dist/_syntax-check.d.ts +1 -2
  3. package/dist/audit.d.ts +4 -5
  4. package/dist/audit.js +8 -8
  5. package/dist/auto-proceed-loop-guard.js +9 -160
  6. package/dist/bash-kill-guard.d.ts +2 -3
  7. package/dist/bash.d.ts +2 -3
  8. package/dist/bash.js +6 -6
  9. package/dist/batch-tool-use.d.ts +2 -3
  10. package/dist/batch-tool-use.js +1 -1
  11. package/dist/browser/index.d.ts +1 -1
  12. package/dist/browser/index.js +1 -1
  13. package/dist/browser/tools.d.ts +56 -45
  14. package/dist/builtin.js +55 -55
  15. package/dist/{chunk-RJZQWEMS.js → chunk-24T5XIJU.js} +3 -2
  16. package/dist/{chunk-DTQ75VBC.js → chunk-2CTZW6JQ.js} +2 -2
  17. package/dist/chunk-37QKUQ2Z.js +171 -0
  18. package/dist/{chunk-LOBRWKCR.js → chunk-3D5DJWOE.js} +3 -3
  19. package/dist/{chunk-YOKD4GWJ.js → chunk-4ERMPDHV.js} +14 -8
  20. package/dist/{chunk-5EUJF3WC.js → chunk-4WPBS45A.js} +4 -5
  21. package/dist/{chunk-42BHI7TN.js → chunk-5ITQPCLC.js} +2 -2
  22. package/dist/{chunk-B4HTSV6Z.js → chunk-5KS24LTS.js} +11 -11
  23. package/dist/{chunk-QPNYDH5B.js → chunk-62OAECEQ.js} +29 -7
  24. package/dist/{chunk-IYKXK356.js → chunk-6GOZTS6F.js} +4 -4
  25. package/dist/{chunk-OG2BEUBY.js → chunk-7HL23T3T.js} +73 -16
  26. package/dist/{chunk-HFXSNKCV.js → chunk-7JJFC6CT.js} +1 -1
  27. package/dist/{chunk-TTZOK6IY.js → chunk-7N5U2RAU.js} +2 -2
  28. package/dist/{chunk-QBV725YG.js → chunk-7ODZTPCU.js} +2 -2
  29. package/dist/{chunk-OTINMOKK.js → chunk-AB2CAUOP.js} +66 -55
  30. package/dist/{chunk-6AAOT4PW.js → chunk-AQ5YBURX.js} +16 -4
  31. package/dist/{chunk-JDPQOR7C.js → chunk-ASEXQRA7.js} +19 -19
  32. package/dist/{chunk-FRN7TIAA.js → chunk-B3MGJBFI.js} +1 -1
  33. package/dist/{chunk-IWS56OY7.js → chunk-CGXTR34H.js} +63 -4
  34. package/dist/{chunk-IU4DV2PA.js → chunk-CHEK3ASV.js} +6 -3
  35. package/dist/{chunk-GOIZNNOA.js → chunk-DJYLI7EW.js} +1 -1
  36. package/dist/{chunk-CFLJFDYV.js → chunk-DK4J2WMH.js} +14 -11
  37. package/dist/{chunk-ZHH3BEWU.js → chunk-DRRY6SCM.js} +49 -22
  38. package/dist/{chunk-BK732J7I.js → chunk-FBUP524S.js} +4 -4
  39. package/dist/{chunk-WHIIIREL.js → chunk-FVM3O4JQ.js} +7 -3
  40. package/dist/chunk-FYDBUVQD.js +244 -0
  41. package/dist/{chunk-UDVKRX5R.js → chunk-GDDXX27P.js} +50 -50
  42. package/dist/{chunk-O44IMQCN.js → chunk-GKSG5CPH.js} +6 -6
  43. package/dist/{chunk-3PVYQFRQ.js → chunk-HDYUBRMF.js} +5 -3
  44. package/dist/{chunk-ELRRTWNP.js → chunk-IXIS7RSG.js} +2 -2
  45. package/dist/{chunk-X5FOFGXX.js → chunk-IYH4OHBP.js} +6 -6
  46. package/dist/{chunk-MNP3GE7H.js → chunk-JDOO4P6Z.js} +21 -16
  47. package/dist/{chunk-BSJSNVGA.js → chunk-KDEXUQY7.js} +24 -11
  48. package/dist/{chunk-V43EQ6VR.js → chunk-KE7A76VC.js} +3 -2
  49. package/dist/{chunk-2OXHS3KZ.js → chunk-KLJZ4WV4.js} +4 -3
  50. package/dist/{chunk-3M7LLN7W.js → chunk-LQSOU63Z.js} +12 -11
  51. package/dist/{chunk-DC4KMPJO.js → chunk-M6UV67BH.js} +2 -2
  52. package/dist/{chunk-C2DQKVLO.js → chunk-MJSJWXBF.js} +1 -1
  53. package/dist/{chunk-RNWUCZ2U.js → chunk-MK2JK35J.js} +29 -12
  54. package/dist/{chunk-FQZOHLG3.js → chunk-MSOAX3GC.js} +3 -2
  55. package/dist/{chunk-KY4PXYSO.js → chunk-N3K2SFEI.js} +534 -494
  56. package/dist/{chunk-EADULOZV.js → chunk-NJX2RXKJ.js} +50 -7
  57. package/dist/{chunk-AKHYMB4V.js → chunk-NN2SNP2R.js} +6 -6
  58. package/dist/{chunk-CMOUCKGC.js → chunk-NU2IZ72J.js} +6 -6
  59. package/dist/{chunk-RLMX75EM.js → chunk-O6BY43ZB.js} +29 -8
  60. package/dist/{chunk-NKNOBUBU.js → chunk-PVCB7RUZ.js} +2 -2
  61. package/dist/{chunk-UQQS3VNT.js → chunk-QA6IASYX.js} +8 -8
  62. package/dist/{chunk-VPALDFYM.js → chunk-RV7BVTDG.js} +1 -1
  63. package/dist/chunk-S57CDR2H.js +288 -0
  64. package/dist/{chunk-2VSZC6QM.js → chunk-SCMRM6NL.js} +6 -4
  65. package/dist/{chunk-W2CECGTG.js → chunk-SMARDKAC.js} +1 -1
  66. package/dist/{chunk-45JPRMC2.js → chunk-SOR7OCYP.js} +7 -3
  67. package/dist/{chunk-ATSKPZUK.js → chunk-T3SMFF5Q.js} +11 -5
  68. package/dist/{chunk-4BHUSMNL.js → chunk-UI3ZJIG3.js} +1 -1
  69. package/dist/{chunk-WXJY3BKV.js → chunk-VBF2YXUW.js} +2 -2
  70. package/dist/{chunk-FQNXYA6W.js → chunk-VU3QBYL4.js} +36 -5
  71. package/dist/{chunk-IIF5HIVF.js → chunk-VVZPQPTY.js} +2 -2
  72. package/dist/{chunk-VD2LV5WO.js → chunk-VZGPASGD.js} +37 -12
  73. package/dist/{chunk-64VIJPFV.js → chunk-WEEVSWQB.js} +17 -6
  74. package/dist/chunk-XXRMF2BC.js +186 -0
  75. package/dist/{chunk-RTZWBNTY.js → chunk-YEISRT4S.js} +7 -12
  76. package/dist/{chunk-Q5JPPCZC.js → chunk-YJTXRH5Y.js} +3 -2
  77. package/dist/{chunk-GMZYW52L.js → chunk-YULVUTK5.js} +6 -3
  78. package/dist/{chunk-NWZ6XGBJ.js → chunk-ZBMANLYH.js} +5 -3
  79. package/dist/{chunk-DP6CXMJZ.js → chunk-ZTCJCYLN.js} +3 -3
  80. package/dist/circuit-breaker.d.ts +1 -0
  81. package/dist/circuit-breaker.js +1 -1
  82. package/dist/clarify.d.ts +1 -0
  83. package/dist/codebase-index/codebase-ast-replace-tool.d.ts +2 -3
  84. package/dist/codebase-index/codebase-impact-analysis-tool.d.ts +5 -4
  85. package/dist/codebase-index/codebase-incoming-calls-tool.d.ts +4 -3
  86. package/dist/codebase-index/codebase-index-tool.d.ts +2 -3
  87. package/dist/codebase-index/codebase-invariant-check-tool.d.ts +2 -3
  88. package/dist/codebase-index/codebase-outgoing-calls-tool.d.ts +4 -3
  89. package/dist/codebase-index/codebase-repo-map-tool.d.ts +2 -3
  90. package/dist/codebase-index/codebase-search-tool.d.ts +2 -3
  91. package/dist/codebase-index/codebase-skeleton-tool.d.ts +2 -3
  92. package/dist/codebase-index/codebase-stats-tool.d.ts +9 -3
  93. package/dist/codebase-index/codebase-targeted-test-tool.d.ts +4 -3
  94. package/dist/codebase-index/index.d.ts +11 -11
  95. package/dist/codebase-index/index.js +12 -12
  96. package/dist/codebase-index/parser-worker-script.js +3 -3
  97. package/dist/codebase-index/project-server-framing.d.ts +29 -0
  98. package/dist/codebase-index/project-server-lifecycle.d.ts +20 -0
  99. package/dist/codebase-index/project-server-operations.d.ts +37 -0
  100. package/dist/codebase-index/project-server-types.d.ts +30 -0
  101. package/dist/codebase-index/project-server-watcher.d.ts +25 -0
  102. package/dist/codebase-index/project-server.js +451 -394
  103. package/dist/codebase-index/worker.js +5 -5
  104. package/dist/codebase-index/writer-init.d.ts +13 -0
  105. package/dist/codebase-index/writer-maintenance.d.ts +14 -0
  106. package/dist/codebase-index/writer.d.ts +0 -15
  107. package/dist/design.d.ts +2 -2
  108. package/dist/design.js +1 -1
  109. package/dist/diff.d.ts +4 -4
  110. package/dist/diff.js +2 -2
  111. package/dist/document.d.ts +3 -4
  112. package/dist/document.js +1 -1
  113. package/dist/e2e.d.ts +1 -1
  114. package/dist/e2e.js +1 -1
  115. package/dist/edit.d.ts +3 -3
  116. package/dist/edit.js +9 -9
  117. package/dist/exec.d.ts +2 -3
  118. package/dist/exec.js +6 -6
  119. package/dist/fetch.d.ts +4 -3
  120. package/dist/fetch.js +1 -1
  121. package/dist/format.d.ts +17 -45
  122. package/dist/format.js +14 -10
  123. package/dist/git.d.ts +3 -3
  124. package/dist/git.js +1 -1
  125. package/dist/glob.d.ts +2 -3
  126. package/dist/glob.js +3 -3
  127. package/dist/{go-parser-IKHW67WE.js → go-parser-D7ELWQ7F.js} +2 -2
  128. package/dist/grep.d.ts +7 -5
  129. package/dist/grep.js +4 -4
  130. package/dist/index.d.ts +54 -45
  131. package/dist/index.js +122 -63
  132. package/dist/install.d.ts +7 -55
  133. package/dist/install.js +8 -8
  134. package/dist/{json-parser-2EOVP5MR.js → json-parser-34DHYCPW.js} +1 -18
  135. package/dist/json.d.ts +3 -4
  136. package/dist/json.js +2 -2
  137. package/dist/kanban-tool-types.d.ts +1 -2
  138. package/dist/kanban.d.ts +3 -19
  139. package/dist/kanban.js +1 -1
  140. package/dist/languages/execute-tool.d.ts +2 -3
  141. package/dist/languages/index.d.ts +2 -2
  142. package/dist/languages/index.js +6 -6
  143. package/dist/languages/tool.d.ts +3 -4
  144. package/dist/legacy-bridge-YXANP5QB.js +18 -0
  145. package/dist/lint.d.ts +5 -4
  146. package/dist/lint.js +8 -8
  147. package/dist/logs.d.ts +3 -4
  148. package/dist/logs.js +2 -2
  149. package/dist/memory.d.ts +7 -8
  150. package/dist/memory.js +1 -1
  151. package/dist/mode.d.ts +3 -4
  152. package/dist/mode.js +1 -1
  153. package/dist/next-steps-tool.d.ts +2 -3
  154. package/dist/next-steps.d.ts +11 -0
  155. package/dist/next-steps.js +10 -132
  156. package/dist/outdated.d.ts +5 -29
  157. package/dist/outdated.js +4 -4
  158. package/dist/pack.js +56 -56
  159. package/dist/{parser-dispatch-QGC4HSP5.js → parser-dispatch-BDVCJXTV.js} +4 -4
  160. package/dist/patch.d.ts +2 -3
  161. package/dist/patch.js +8 -8
  162. package/dist/plan.d.ts +4 -4
  163. package/dist/plan.js +3 -3
  164. package/dist/process-registry.js +2 -2
  165. package/dist/ps-slash.js +4 -4
  166. package/dist/pwsh.d.ts +1 -0
  167. package/dist/{py-parser-RFWG2HYI.js → py-parser-QC6MR4GB.js} +3 -3
  168. package/dist/read.d.ts +5 -5
  169. package/dist/read.js +8 -8
  170. package/dist/replace.d.ts +2 -3
  171. package/dist/replace.js +10 -10
  172. package/dist/scaffold.d.ts +7 -3
  173. package/dist/scaffold.js +3 -1
  174. package/dist/search.d.ts +17 -3
  175. package/dist/search.js +5 -1
  176. package/dist/set-working-dir.d.ts +2 -3
  177. package/dist/skill.d.ts +4 -5
  178. package/dist/skill.js +1 -1
  179. package/dist/task.d.ts +6 -6
  180. package/dist/task.js +3 -3
  181. package/dist/test.d.ts +5 -4
  182. package/dist/test.js +8 -8
  183. package/dist/todo.d.ts +8 -8
  184. package/dist/todo.js +2 -2
  185. package/dist/tool-diff.js +11 -230
  186. package/dist/tool-help.d.ts +2 -3
  187. package/dist/tool-help.js +1 -1
  188. package/dist/tool-search.d.ts +2 -3
  189. package/dist/tool-search.js +1 -1
  190. package/dist/tool-summary.js +5 -281
  191. package/dist/tool-tier.js +57 -57
  192. package/dist/tool-use.d.ts +2 -3
  193. package/dist/tool-use.js +1 -1
  194. package/dist/tree.d.ts +5 -3
  195. package/dist/tree.js +5 -1
  196. package/dist/typecheck.d.ts +3 -3
  197. package/dist/typecheck.js +8 -8
  198. package/dist/win32.js +1 -1
  199. package/dist/write.d.ts +2 -3
  200. package/dist/write.js +9 -9
  201. package/package.json +5 -5
  202. package/dist/legacy-bridge-3T7SR4SK.js +0 -18
  203. package/dist/spawn-background.d.ts +0 -80
@@ -33,6 +33,14 @@ export interface DangerAssessment {
33
33
  /** Stable id of the matched rule, for tests and config-override. */
34
34
  matchedRule?: string;
35
35
  }
36
+ export interface DangerRule {
37
+ id: string;
38
+ level: DangerLevel;
39
+ /** Match a (cmd, args) pair. Return true if this rule fires. */
40
+ test: (cmd: string, args: readonly string[]) => boolean;
41
+ /** Human-readable explanation, joined with "; " in the output. */
42
+ reason: string;
43
+ }
36
44
  /**
37
45
  * Evaluate the danger level of a (cmd, args) pair.
38
46
  *
@@ -1,4 +1,4 @@
1
- interface SyntaxCheckResult {
1
+ export interface SyntaxCheckResult {
2
2
  /** Parse errors in the new content (capped at {@link MAX_ERRORS}). */
3
3
  errors: string[];
4
4
  /** True when the pre-edit content already failed to parse — the edit did
@@ -13,5 +13,4 @@ interface SyntaxCheckResult {
13
13
  * pre-existing ones.
14
14
  */
15
15
  export declare function checkSyntax(filePath: string, content: string, previousContent?: string): Promise<SyntaxCheckResult | undefined>;
16
- export {};
17
16
  //# sourceMappingURL=_syntax-check.d.ts.map
package/dist/audit.d.ts CHANGED
@@ -1,16 +1,16 @@
1
1
  import type { Tool, ToolStreamEvent } from '@wrongstack/core/types';
2
- interface AuditInput {
2
+ export interface AuditInput {
3
3
  cwd?: string | undefined;
4
4
  level?: 'low' | 'moderate' | 'high' | 'critical' | undefined;
5
5
  fix?: boolean | undefined;
6
6
  }
7
- interface AuditVulnerability {
7
+ export interface AuditVulnerability {
8
8
  severity: string;
9
9
  package: string;
10
10
  title: string;
11
11
  url: string;
12
12
  }
13
- interface AuditOutput {
13
+ export interface AuditOutput {
14
14
  exit_code: number;
15
15
  vulnerabilities: AuditVulnerability[];
16
16
  total: number;
@@ -18,7 +18,7 @@ interface AuditOutput {
18
18
  output: string;
19
19
  truncated: boolean;
20
20
  }
21
- type AuditContext = Parameters<Tool<AuditInput, AuditOutput>['execute']>[1];
21
+ export type AuditContext = Parameters<Tool<AuditInput, AuditOutput>['execute']>[1];
22
22
  export declare const auditTool: {
23
23
  name: string;
24
24
  category: string;
@@ -54,5 +54,4 @@ export declare const auditTool: {
54
54
  signal: AbortSignal;
55
55
  }): AsyncGenerator<ToolStreamEvent<AuditOutput>>;
56
56
  };
57
- export {};
58
57
  //# sourceMappingURL=audit.d.ts.map
package/dist/audit.js CHANGED
@@ -1,13 +1,13 @@
1
1
  import {
2
2
  auditTool
3
- } from "./chunk-64VIJPFV.js";
4
- import "./chunk-ATSKPZUK.js";
5
- import "./chunk-TTZOK6IY.js";
6
- import "./chunk-ZHH3BEWU.js";
7
- import "./chunk-2VSZC6QM.js";
8
- import "./chunk-3PVYQFRQ.js";
9
- import "./chunk-HFXSNKCV.js";
10
- import "./chunk-V43EQ6VR.js";
3
+ } from "./chunk-WEEVSWQB.js";
4
+ import "./chunk-T3SMFF5Q.js";
5
+ import "./chunk-7N5U2RAU.js";
6
+ import "./chunk-DRRY6SCM.js";
7
+ import "./chunk-SCMRM6NL.js";
8
+ import "./chunk-HDYUBRMF.js";
9
+ import "./chunk-7JJFC6CT.js";
10
+ import "./chunk-KE7A76VC.js";
11
11
  import "./chunk-ZUFHAHTE.js";
12
12
  export {
13
13
  auditTool
@@ -1,163 +1,12 @@
1
- // src/auto-proceed-loop-guard.ts
2
- function normalizeForRepetition(prompt) {
3
- return prompt.replace(/\s+/g, " ").trim().toLowerCase();
4
- }
5
- var GROUNDED_NO_PROGRESS_STEER = [
6
- "NOTE: The todo board has not changed since the previous automatic continuation \u2014 this exact instruction is being repeated.",
7
- "Before anything else, bring the board up to date so the loop stays grounded:",
8
- "- mark work that is actually finished as completed,",
9
- "- split the current item into smaller concrete sub-items if it needs more than one turn,",
10
- "- remove or reword items that no longer apply.",
11
- "Then continue the work. If you are blocked, state exactly what is blocking you instead of repeating the same turn."
12
- ].join("\n");
13
- function createContinuationAttemptTracker() {
14
- const attempts = /* @__PURE__ */ new Map();
15
- const skipped = /* @__PURE__ */ new Set();
16
- return {
17
- recordAttempt(todoId) {
18
- const count = (attempts.get(todoId) ?? 0) + 1;
19
- attempts.set(todoId, count);
20
- return count;
21
- },
22
- getAttempts(todoId) {
23
- return attempts.get(todoId) ?? 0;
24
- },
25
- markSkipped(todoId) {
26
- skipped.add(todoId);
27
- },
28
- isSkipped(todoId) {
29
- return skipped.has(todoId);
30
- },
31
- reset() {
32
- attempts.clear();
33
- skipped.clear();
34
- },
35
- snapshot() {
36
- const result = {};
37
- const allIds = /* @__PURE__ */ new Set([...attempts.keys(), ...skipped]);
38
- for (const id of allIds) {
39
- result[id] = { attempts: attempts.get(id) ?? 0, skipped: skipped.has(id) };
40
- }
41
- return result;
42
- }
43
- };
44
- }
45
- var ADVANCE_PREAMBLES = [
46
- "Pivoting to the next open item \u2014 previous todo still pending after {attempts} attempt(s).",
47
- "Shifting focus to a different task while the previous item ({label}) remains open after {attempts} attempt(s).",
48
- "No board progress on the current item after {attempts} attempt(s). Continuing with the next todo.",
49
- "The previous item is still unresolved after {attempts} try(ies). Moving on down the list.",
50
- "Advancing to the next piece of work after {attempts} unproductive attempt(s) on the prior one.",
51
- "Taking a different angle \u2014 the stalled item ({label}) stays open after {attempts} attempt(s). Pressing ahead.",
52
- "The todo board shows no movement on the current task after {attempts} attempt(s). Switching gears.",
53
- "No change on the board from the last {attempts} continuation(s). Proceeding to the next open item."
54
- ];
55
- function generateAdvancementPrompt(stalledTodo, nextTodo, attemptCount, todos) {
56
- const idx = Math.max(0, Math.min(attemptCount - 1, ADVANCE_PREAMBLES.length - 1));
57
- const preamble = ADVANCE_PREAMBLES[idx].replace(
58
- /\{attempts\}/g,
59
- () => String(attemptCount)
60
- ).replace(/\{label\}/g, () => stalledTodo.content.slice(0, 72));
61
- if (!nextTodo) {
62
- return [
63
- preamble,
64
- "",
65
- "No more open items remain on the todo list. What has been accomplished and what should I do next?"
66
- ].join("\n");
67
- }
68
- const itemLabel = nextTodo.status === "in_progress" && nextTodo.activeForm ? nextTodo.activeForm : nextTodo.content;
69
- const done = todos.filter((t) => t.status === "completed").length;
70
- const total = todos.length;
71
- const lines = [preamble, "", `Proceed with: ${itemLabel}`];
72
- if (total > 0) {
73
- lines.push("", `Todo board (${done}/${total} done):`);
74
- lines.push(
75
- ...todos.slice(0, 20).map((t) => {
76
- const mark = t.status === "completed" ? "[x]" : t.status === "in_progress" ? "[~]" : "[ ]";
77
- const flat = t.content.replace(/\n|\r/g, " ");
78
- return ` ${mark} ${flat}`;
79
- })
80
- );
81
- }
82
- lines.push(
83
- "",
84
- "If this item is already done, mark it complete and move to the next open todo. Keep the board honest as you work."
85
- );
86
- return lines.join("\n");
87
- }
88
- function matchTodoIdFromPrompt(todos, prompt) {
89
- if (todos.length === 0 || !prompt) return null;
90
- const lowerPrompt = prompt.toLowerCase();
91
- const inProgress = todos.find((t) => t.status === "in_progress");
92
- if (inProgress) {
93
- const label = (inProgress.activeForm ?? inProgress.content).toLowerCase();
94
- if (label.length > 5 && lowerPrompt.includes(label)) {
95
- return { id: inProgress.id, content: inProgress.activeForm ?? inProgress.content };
96
- }
97
- }
98
- for (const t of todos) {
99
- if (t.status === "completed") continue;
100
- if (inProgress && t.id === inProgress.id) continue;
101
- const label = (t.activeForm ?? t.content).toLowerCase();
102
- if (label.length > 5 && lowerPrompt.includes(label)) {
103
- return { id: t.id, content: t.activeForm ?? t.content };
104
- }
105
- }
106
- const firstOpen = todos.find((t) => t.status !== "completed");
107
- return firstOpen ? { id: firstOpen.id, content: firstOpen.activeForm ?? firstOpen.content } : null;
108
- }
109
- var MAX_ADVANCEMENT_ATTEMPTS = 9;
110
- function createAutoProceedLoopGuard(options = {}) {
111
- const safeIntegerOption = (value, fallback) => {
112
- if (value === void 0) return fallback;
113
- if (!Number.isFinite(value)) return fallback;
114
- return Math.floor(value);
115
- };
116
- const repeatThreshold = Math.max(2, safeIntegerOption(options.repeatThreshold, 2));
117
- const windowSize = Math.max(repeatThreshold, safeIntegerOption(options.windowSize, 3));
118
- let buffer = [];
119
- let steeredFor = null;
120
- function record(prompt) {
121
- const normalized = normalizeForRepetition(prompt);
122
- buffer.push(normalized);
123
- if (buffer.length > windowSize) {
124
- buffer = buffer.slice(buffer.length - windowSize);
125
- }
126
- let runLength = 0;
127
- for (let i = buffer.length - 1; i >= 0; i--) {
128
- if (buffer[i] === normalized) runLength++;
129
- else break;
130
- }
131
- return {
132
- normalized,
133
- runLength,
134
- shouldHalt: runLength >= repeatThreshold
135
- };
136
- }
137
- function recordGrounded(prompt) {
138
- const signal = record(prompt);
139
- if (!signal.shouldHalt) {
140
- steeredFor = null;
141
- return { ...signal, shouldHalt: false, action: "feed" };
142
- }
143
- if (steeredFor === signal.normalized) {
144
- return { ...signal, action: "halt" };
145
- }
146
- steeredFor = signal.normalized;
147
- return { ...signal, shouldHalt: false, action: "steer" };
148
- }
149
- function reset() {
150
- buffer = [];
151
- steeredFor = null;
152
- }
153
- function history() {
154
- return buffer.slice();
155
- }
156
- function size() {
157
- return buffer.length;
158
- }
159
- return { record, recordGrounded, reset, history, size };
160
- }
1
+ import {
2
+ GROUNDED_NO_PROGRESS_STEER,
3
+ MAX_ADVANCEMENT_ATTEMPTS,
4
+ createAutoProceedLoopGuard,
5
+ createContinuationAttemptTracker,
6
+ generateAdvancementPrompt,
7
+ matchTodoIdFromPrompt,
8
+ normalizeForRepetition
9
+ } from "./chunk-37QKUQ2Z.js";
161
10
  export {
162
11
  GROUNDED_NO_PROGRESS_STEER,
163
12
  MAX_ADVANCEMENT_ATTEMPTS,
@@ -40,7 +40,7 @@
40
40
  * destructive detection as the primary controls; this guard is a best-effort
41
41
  * fast path for the common non-obfuscated forms.
42
42
  */
43
- interface KillCommand {
43
+ export interface KillCommand {
44
44
  pid?: number;
45
45
  name?: string;
46
46
  signal?: string;
@@ -48,7 +48,7 @@ interface KillCommand {
48
48
  isAllKill: boolean;
49
49
  originalCommand: string;
50
50
  }
51
- interface KillCheckResult {
51
+ export interface KillCheckResult {
52
52
  blocked: boolean;
53
53
  reason?: string;
54
54
  }
@@ -65,5 +65,4 @@ export declare function checkAndBlockKillCommand(command: string): Promise<KillC
65
65
  * Get a safe error message for blocked kill commands.
66
66
  */
67
67
  export declare function getBlockedKillMessage(pid: number, signal?: string): string;
68
- export {};
69
68
  //# sourceMappingURL=bash-kill-guard.d.ts.map
package/dist/bash.d.ts CHANGED
@@ -1,10 +1,10 @@
1
1
  import type { Tool } from '@wrongstack/core/types';
2
- interface BashInput {
2
+ export interface BashInput {
3
3
  command: string;
4
4
  timeout_ms?: number | undefined;
5
5
  background?: boolean | undefined;
6
6
  }
7
- interface BashOutput {
7
+ export interface BashOutput {
8
8
  output: string;
9
9
  exit_code: number | null;
10
10
  timed_out: boolean;
@@ -12,5 +12,4 @@ interface BashOutput {
12
12
  error?: string | undefined;
13
13
  }
14
14
  export declare const bashTool: Tool<BashInput, BashOutput>;
15
- export type { BashInput, BashOutput };
16
15
  //# sourceMappingURL=bash.d.ts.map
package/dist/bash.js CHANGED
@@ -1,12 +1,12 @@
1
1
  import {
2
2
  bashTool
3
- } from "./chunk-AKHYMB4V.js";
3
+ } from "./chunk-NN2SNP2R.js";
4
4
  import "./chunk-BTSFTGIL.js";
5
- import "./chunk-NKNOBUBU.js";
6
- import "./chunk-2VSZC6QM.js";
7
- import "./chunk-3PVYQFRQ.js";
8
- import "./chunk-HFXSNKCV.js";
9
- import "./chunk-V43EQ6VR.js";
5
+ import "./chunk-PVCB7RUZ.js";
6
+ import "./chunk-SCMRM6NL.js";
7
+ import "./chunk-HDYUBRMF.js";
8
+ import "./chunk-7JJFC6CT.js";
9
+ import "./chunk-KE7A76VC.js";
10
10
  import "./chunk-ZUFHAHTE.js";
11
11
  export {
12
12
  bashTool
@@ -1,5 +1,5 @@
1
1
  import { type Tool } from '@wrongstack/core/types';
2
- interface BatchToolUseInput {
2
+ export interface BatchToolUseInput {
3
3
  calls: {
4
4
  tool: string;
5
5
  input: Record<string, unknown>;
@@ -7,7 +7,7 @@ interface BatchToolUseInput {
7
7
  stop_on_error?: boolean | undefined;
8
8
  parallel?: boolean | undefined;
9
9
  }
10
- interface BatchToolUseOutput {
10
+ export interface BatchToolUseOutput {
11
11
  results: {
12
12
  tool: string;
13
13
  success: boolean;
@@ -21,5 +21,4 @@ interface BatchToolUseOutput {
21
21
  stop_on_error: boolean;
22
22
  }
23
23
  export declare const batchToolUseTool: Tool<BatchToolUseInput, BatchToolUseOutput>;
24
- export {};
25
24
  //# sourceMappingURL=batch-tool-use.d.ts.map
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  batchToolUseTool
3
- } from "./chunk-WXJY3BKV.js";
3
+ } from "./chunk-VBF2YXUW.js";
4
4
  export {
5
5
  batchToolUseTool
6
6
  };
@@ -2,6 +2,6 @@ export { BrowserArtifactStore } from './artifacts.js';
2
2
  export { type BrowserLauncher, BrowserSessionManager, browserInstallationDiagnostics, } from './manager.js';
3
3
  export { BrowserNetworkGuardProxy } from './network-guard-proxy.js';
4
4
  export { assertBrowserUrlAllowed, type BrowserDnsLookup, type BrowserResolvedTarget, parsePrivateOriginAllowlist, redactBrowserText, resolvePinnedBrowserTarget, safeBrowserUrl, } from './security.js';
5
- export { browserClickTool, browserCloseTool, browserDragTool, browserEvaluateTool, browserHoverTool, browserListTool, browserNavigateTool, browserOpenTool, browserPressTool, browserScreenshotTool, browserSelectTool, browserSnapshotTool, browserStatusTool, browserTools, browserTypeTool, browserUploadTool, browserWaitTool, shutdownBrowserTools, } from './tools.js';
5
+ export { browserClickTool, browserCloseTool, browserDragTool, browserEvaluateTool, browserHoverTool, browserListTool, browserNavigateTool, browserOpenTool, browserPressTool, browserScreenshotTool, browserSelectTool, browserSnapshotTool, browserStatusTool, browserTools, browserTypeTool, browserUploadTool, browserWaitTool, shutdownBrowserTools, type BrowserCloseInput, type BrowserDragInput, type BrowserEvaluateInput, type BrowserNavigateInput, type BrowserOpenInput, type BrowserPressInput, type BrowserScreenshotInput, type BrowserSelectInput, type BrowserSelectorInput, type BrowserSnapshotInput, type BrowserTypeInput, type BrowserUploadInput, type BrowserWaitInput, } from './tools.js';
6
6
  export type { BrowserArtifact, BrowserArtifactKind, BrowserConsoleEntry, BrowserManagerOptions, BrowserNetworkEntry, BrowserOpenOptions, BrowserSessionSummary, BrowserSnapshot, } from './types.js';
7
7
  //# sourceMappingURL=index.d.ts.map
@@ -27,7 +27,7 @@ import {
27
27
  resolvePinnedBrowserTarget,
28
28
  safeBrowserUrl,
29
29
  shutdownBrowserTools
30
- } from "../chunk-45JPRMC2.js";
30
+ } from "../chunk-SOR7OCYP.js";
31
31
  export {
32
32
  BrowserArtifactStore,
33
33
  BrowserNetworkGuardProxy,
@@ -1,77 +1,88 @@
1
1
  import type { Context } from '@wrongstack/core/agent';
2
2
  import type { Tool } from '@wrongstack/core/types';
3
- export declare const browserOpenTool: Tool<{
3
+ export interface BrowserOpenInput {
4
4
  url?: string | undefined;
5
5
  width?: number | undefined;
6
6
  height?: number | undefined;
7
7
  trace?: boolean | undefined;
8
- }>;
9
- export declare const browserListTool: {
10
- name: string;
11
- description: string;
12
- permission: "auto";
13
- mutating: false;
14
- riskTier: "safe";
15
- capabilities: "net.outbound"[];
16
- inputSchema: {
17
- type: string;
18
- properties: {};
19
- };
20
- execute(_input: Record<string, never>, ctx: Context, _opts?: {
21
- signal: AbortSignal;
22
- }): Promise<string>;
23
- };
24
- export declare const browserStatusTool: Tool<Record<string, never>>;
25
- export declare const browserNavigateTool: Tool<{
8
+ }
9
+ export interface BrowserNavigateInput {
26
10
  sessionId: string;
27
11
  url: string;
28
- }>;
29
- export declare const browserSnapshotTool: Tool<{
12
+ }
13
+ export interface BrowserSnapshotInput {
30
14
  sessionId: string;
31
- }>;
32
- export declare const browserScreenshotTool: Tool<{
15
+ }
16
+ export interface BrowserScreenshotInput {
33
17
  sessionId: string;
34
18
  fullPage?: boolean | undefined;
35
19
  selector?: string | undefined;
36
- }>;
37
- type SelectorInput = {
20
+ }
21
+ export interface BrowserSelectorInput {
38
22
  sessionId: string;
39
23
  selector: string;
40
- };
41
- export declare const browserClickTool: Tool<SelectorInput, unknown>;
42
- export declare const browserHoverTool: Tool<SelectorInput, unknown>;
43
- export declare const browserTypeTool: Tool<SelectorInput & {
24
+ }
25
+ export interface BrowserTypeInput extends BrowserSelectorInput {
44
26
  text?: string | undefined;
45
27
  secretEnv?: string | undefined;
46
- }>;
47
- export declare const browserSelectTool: Tool<SelectorInput & {
28
+ }
29
+ export interface BrowserSelectInput extends BrowserSelectorInput {
48
30
  value: string;
49
- }>;
50
- export declare const browserPressTool: Tool<{
31
+ }
32
+ export interface BrowserPressInput {
51
33
  sessionId: string;
52
34
  key: string;
53
- }>;
54
- export declare const browserDragTool: Tool<{
35
+ }
36
+ export interface BrowserDragInput {
55
37
  sessionId: string;
56
38
  from: string;
57
39
  to: string;
58
- }>;
59
- export declare const browserWaitTool: Tool<{
40
+ }
41
+ export interface BrowserWaitInput {
60
42
  sessionId: string;
61
43
  selector?: string | undefined;
62
44
  timeoutMs?: number | undefined;
63
- }>;
64
- export declare const browserEvaluateTool: Tool<{
45
+ }
46
+ export interface BrowserEvaluateInput {
65
47
  sessionId: string;
66
48
  expression: string;
67
- }>;
68
- export declare const browserUploadTool: Tool<SelectorInput & {
49
+ }
50
+ export interface BrowserUploadInput extends BrowserSelectorInput {
69
51
  files: string[];
70
- }>;
71
- export declare const browserCloseTool: Tool<{
52
+ }
53
+ export interface BrowserCloseInput {
72
54
  sessionId: string;
73
- }>;
55
+ }
56
+ export declare const browserOpenTool: Tool<BrowserOpenInput>;
57
+ export declare const browserListTool: {
58
+ name: string;
59
+ description: string;
60
+ permission: "auto";
61
+ mutating: false;
62
+ riskTier: "safe";
63
+ capabilities: "net.outbound"[];
64
+ inputSchema: {
65
+ type: string;
66
+ properties: {};
67
+ };
68
+ execute(_input: Record<string, never>, ctx: Context, _opts?: {
69
+ signal: AbortSignal;
70
+ }): Promise<string>;
71
+ };
72
+ export declare const browserStatusTool: Tool<Record<string, never>>;
73
+ export declare const browserNavigateTool: Tool<BrowserNavigateInput>;
74
+ export declare const browserSnapshotTool: Tool<BrowserSnapshotInput>;
75
+ export declare const browserScreenshotTool: Tool<BrowserScreenshotInput>;
76
+ export declare const browserClickTool: Tool<BrowserSelectorInput, unknown>;
77
+ export declare const browserHoverTool: Tool<BrowserSelectorInput, unknown>;
78
+ export declare const browserTypeTool: Tool<BrowserTypeInput>;
79
+ export declare const browserSelectTool: Tool<BrowserSelectInput>;
80
+ export declare const browserPressTool: Tool<BrowserPressInput>;
81
+ export declare const browserDragTool: Tool<BrowserDragInput>;
82
+ export declare const browserWaitTool: Tool<BrowserWaitInput>;
83
+ export declare const browserEvaluateTool: Tool<BrowserEvaluateInput>;
84
+ export declare const browserUploadTool: Tool<BrowserUploadInput>;
85
+ export declare const browserCloseTool: Tool<BrowserCloseInput>;
74
86
  export declare const browserTools: Tool[];
75
87
  export declare function shutdownBrowserTools(): Promise<void>;
76
- export {};
77
88
  //# sourceMappingURL=tools.d.ts.map
package/dist/builtin.js CHANGED
@@ -6,68 +6,68 @@ import {
6
6
  TIER2_TOOLS,
7
7
  TIER3_TOOLS,
8
8
  builtinTools
9
- } from "./chunk-OTINMOKK.js";
10
- import "./chunk-VPALDFYM.js";
11
- import "./chunk-RTZWBNTY.js";
9
+ } from "./chunk-AB2CAUOP.js";
10
+ import "./chunk-RV7BVTDG.js";
11
+ import "./chunk-YEISRT4S.js";
12
12
  import "./chunk-XRNN44QY.js";
13
- import "./chunk-B4HTSV6Z.js";
14
- import "./chunk-3M7LLN7W.js";
15
- import "./chunk-RJZQWEMS.js";
16
- import "./chunk-FRN7TIAA.js";
17
- import "./chunk-WXJY3BKV.js";
18
- import "./chunk-QBV725YG.js";
19
- import "./chunk-ELRRTWNP.js";
20
- import "./chunk-UQQS3VNT.js";
21
- import "./chunk-RLMX75EM.js";
22
- import "./chunk-64VIJPFV.js";
23
- import "./chunk-IYKXK356.js";
24
- import "./chunk-FQNXYA6W.js";
25
- import "./chunk-IU4DV2PA.js";
26
- import "./chunk-2OXHS3KZ.js";
27
- import "./chunk-6AAOT4PW.js";
28
- import "./chunk-IWS56OY7.js";
29
- import "./chunk-VD2LV5WO.js";
30
- import "./chunk-OG2BEUBY.js";
31
- import "./chunk-MNP3GE7H.js";
32
- import "./chunk-LOBRWKCR.js";
33
- import "./chunk-EADULOZV.js";
34
- import "./chunk-5EUJF3WC.js";
35
- import "./chunk-ATSKPZUK.js";
36
- import "./chunk-TTZOK6IY.js";
37
- import "./chunk-ZHH3BEWU.js";
38
- import "./chunk-X5FOFGXX.js";
39
- import "./chunk-JDPQOR7C.js";
40
- import "./chunk-YOKD4GWJ.js";
41
- import "./chunk-Q5JPPCZC.js";
42
- import "./chunk-NWZ6XGBJ.js";
43
- import "./chunk-AKHYMB4V.js";
44
- import "./chunk-BSJSNVGA.js";
13
+ import "./chunk-5KS24LTS.js";
14
+ import "./chunk-LQSOU63Z.js";
15
+ import "./chunk-24T5XIJU.js";
16
+ import "./chunk-B3MGJBFI.js";
17
+ import "./chunk-VBF2YXUW.js";
18
+ import "./chunk-7ODZTPCU.js";
19
+ import "./chunk-IXIS7RSG.js";
20
+ import "./chunk-QA6IASYX.js";
21
+ import "./chunk-O6BY43ZB.js";
22
+ import "./chunk-WEEVSWQB.js";
23
+ import "./chunk-6GOZTS6F.js";
24
+ import "./chunk-VU3QBYL4.js";
25
+ import "./chunk-CHEK3ASV.js";
26
+ import "./chunk-KLJZ4WV4.js";
27
+ import "./chunk-AQ5YBURX.js";
28
+ import "./chunk-CGXTR34H.js";
29
+ import "./chunk-VZGPASGD.js";
30
+ import "./chunk-7HL23T3T.js";
31
+ import "./chunk-JDOO4P6Z.js";
32
+ import "./chunk-3D5DJWOE.js";
33
+ import "./chunk-NJX2RXKJ.js";
34
+ import "./chunk-4WPBS45A.js";
35
+ import "./chunk-T3SMFF5Q.js";
36
+ import "./chunk-7N5U2RAU.js";
37
+ import "./chunk-DRRY6SCM.js";
38
+ import "./chunk-IYH4OHBP.js";
39
+ import "./chunk-ASEXQRA7.js";
40
+ import "./chunk-4ERMPDHV.js";
41
+ import "./chunk-YJTXRH5Y.js";
42
+ import "./chunk-ZBMANLYH.js";
43
+ import "./chunk-NN2SNP2R.js";
44
+ import "./chunk-KDEXUQY7.js";
45
45
  import "./chunk-BTSFTGIL.js";
46
- import "./chunk-NKNOBUBU.js";
47
- import "./chunk-2VSZC6QM.js";
48
- import "./chunk-3PVYQFRQ.js";
49
- import "./chunk-HFXSNKCV.js";
50
- import "./chunk-C2DQKVLO.js";
51
- import "./chunk-QPNYDH5B.js";
46
+ import "./chunk-PVCB7RUZ.js";
47
+ import "./chunk-SCMRM6NL.js";
48
+ import "./chunk-HDYUBRMF.js";
49
+ import "./chunk-7JJFC6CT.js";
50
+ import "./chunk-MJSJWXBF.js";
51
+ import "./chunk-62OAECEQ.js";
52
52
  import "./chunk-NBDZMMG2.js";
53
- import "./chunk-BK732J7I.js";
54
- import "./chunk-W2CECGTG.js";
53
+ import "./chunk-FBUP524S.js";
54
+ import "./chunk-SMARDKAC.js";
55
55
  import "./chunk-X6KXNHUO.js";
56
- import "./chunk-45JPRMC2.js";
57
- import "./chunk-RNWUCZ2U.js";
58
- import "./chunk-O44IMQCN.js";
59
- import "./chunk-CFLJFDYV.js";
60
- import "./chunk-FQZOHLG3.js";
61
- import "./chunk-DP6CXMJZ.js";
62
- import "./chunk-UDVKRX5R.js";
63
- import "./chunk-KY4PXYSO.js";
64
- import "./chunk-CMOUCKGC.js";
65
- import "./chunk-IIF5HIVF.js";
56
+ import "./chunk-SOR7OCYP.js";
57
+ import "./chunk-MK2JK35J.js";
58
+ import "./chunk-GKSG5CPH.js";
59
+ import "./chunk-DK4J2WMH.js";
60
+ import "./chunk-MSOAX3GC.js";
61
+ import "./chunk-ZTCJCYLN.js";
62
+ import "./chunk-GDDXX27P.js";
63
+ import "./chunk-N3K2SFEI.js";
64
+ import "./chunk-NU2IZ72J.js";
65
+ import "./chunk-VVZPQPTY.js";
66
66
  import "./chunk-6IEBD27U.js";
67
67
  import "./chunk-UCYQTZ7F.js";
68
68
  import "./chunk-YOHO4DVT.js";
69
- import "./chunk-DTQ75VBC.js";
70
- import "./chunk-V43EQ6VR.js";
69
+ import "./chunk-2CTZW6JQ.js";
70
+ import "./chunk-KE7A76VC.js";
71
71
  import "./chunk-ZUFHAHTE.js";
72
72
  export {
73
73
  BUILTIN_TOOL_DESCRIPTIONS,
@@ -39,7 +39,8 @@ var toolSearchTool = {
39
39
  }
40
40
  },
41
41
  async execute(input, ctx) {
42
- const limit = Math.min(input.limit ?? 20, 100);
42
+ const rawLimit = typeof input.limit === "number" && Number.isFinite(input.limit) ? input.limit : 20;
43
+ const limit = Math.max(1, Math.min(Math.floor(rawLimit), 100));
43
44
  const tools = ctx.catalogTools ?? ctx.tools;
44
45
  const query = input.query?.toLowerCase() ?? "";
45
46
  const filtered = tools.filter((t) => {
@@ -81,4 +82,4 @@ var toolSearchTool = {
81
82
  export {
82
83
  toolSearchTool
83
84
  };
84
- //# sourceMappingURL=chunk-RJZQWEMS.js.map
85
+ //# sourceMappingURL=chunk-24T5XIJU.js.map
@@ -35,7 +35,7 @@ function compileGitignore(lines) {
35
35
  }
36
36
  const hasNegation = rules.some((r) => r.negated);
37
37
  return (relPath, isDir) => {
38
- const p = relPath.includes("\\") || relPath.startsWith("/") ? relPath.replace(/\\/g, "/").replace(/^\/+/, "") : relPath;
38
+ const p = relPath.replace(/\\/g, "/").replace(/^\.\//, "").replace(/^\/+/, "");
39
39
  let ignored = false;
40
40
  for (const r of rules) {
41
41
  const re = r.dirOnly && !isDir ? r.under : r.eqOrUnder;
@@ -61,4 +61,4 @@ export {
61
61
  compileGitignore,
62
62
  loadGitignoreMatcher
63
63
  };
64
- //# sourceMappingURL=chunk-DTQ75VBC.js.map
64
+ //# sourceMappingURL=chunk-2CTZW6JQ.js.map