@wrongstack/tools 0.316.2 → 0.317.2

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 (109) 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-K3WNSHUF.js → chunk-45JPRMC2.js} +62 -36
  11. package/dist/{chunk-EJWSCQ6D.js → chunk-4AEZIFOW.js} +6 -5
  12. package/dist/{chunk-PQKK5JH7.js → chunk-4E42D7UF.js} +2 -2
  13. package/dist/{chunk-JRJJX3L5.js → chunk-5WNDJHT6.js} +3 -2
  14. package/dist/{chunk-7EY5DCRO.js → chunk-5ZYEGP2P.js} +4 -4
  15. package/dist/{chunk-MZZN7VCD.js → chunk-6RR5VX6U.js} +35 -17
  16. package/dist/{chunk-HYX2TZ7O.js → chunk-A2PX7M7A.js} +5 -5
  17. package/dist/{chunk-L25CVUVR.js → chunk-AK2K4KHR.js} +30 -22
  18. package/dist/{chunk-VFKPWSOX.js → chunk-BANPF4LY.js} +11 -7
  19. package/dist/{chunk-RGISBZBD.js → chunk-CPSAF2AU.js} +3 -2
  20. package/dist/{chunk-BSLVR56S.js → chunk-CPVLVQYT.js} +6 -5
  21. package/dist/{chunk-VJNHFZ7J.js → chunk-CVALEVGA.js} +6 -5
  22. package/dist/{chunk-PY2IOS7C.js → chunk-CWALNI6K.js} +5 -5
  23. package/dist/{chunk-LIJQMYYX.js → chunk-ELFFQ4RU.js} +7 -3
  24. package/dist/{chunk-JNNVRHMV.js → chunk-FJEQZHZN.js} +8 -8
  25. package/dist/{chunk-S5CCLZL3.js → chunk-FRN7TIAA.js} +2 -2
  26. package/dist/{chunk-I64BS3VC.js → chunk-FYDKHXN7.js} +2 -2
  27. package/dist/{chunk-NKJW5GFO.js → chunk-H6AWAZ2Y.js} +3 -3
  28. package/dist/{chunk-IVWV2UM6.js → chunk-HTYEO67J.js} +6 -5
  29. package/dist/{chunk-UNSKG6DC.js → chunk-ICAXDRP6.js} +10 -15
  30. package/dist/{chunk-IYK7XGDZ.js → chunk-JJQB6R7Y.js} +7 -7
  31. package/dist/{chunk-LWKUTMD5.js → chunk-MRZOVQ5D.js} +6 -5
  32. package/dist/{chunk-JOHXDF3D.js → chunk-NKX4SJ5R.js} +12 -9
  33. package/dist/{chunk-U4D5S3VQ.js → chunk-NWZ6XGBJ.js} +2 -1
  34. package/dist/{chunk-UKU2ZX4C.js → chunk-P7ZQ2FAJ.js} +27 -17
  35. package/dist/{chunk-4I4LWFOO.js → chunk-PQTONQ4P.js} +16 -11
  36. package/dist/{chunk-MQX2KXVW.js → chunk-RMB76PDS.js} +3 -3
  37. package/dist/{chunk-QZQSPUBF.js → chunk-RUOMW2I6.js} +4 -3
  38. package/dist/{chunk-553IQUMO.js → chunk-S2JRYDYG.js} +7 -6
  39. package/dist/{chunk-OUBDL3WH.js → chunk-SOG7XIRF.js} +11 -8
  40. package/dist/{chunk-ZJQ4IGXK.js → chunk-TDLZIDCY.js} +9 -7
  41. package/dist/{chunk-DA4KNE2H.js → chunk-TFEGJDH5.js} +303 -99
  42. package/dist/{chunk-AHHDWNXC.js → chunk-TKA4VEX2.js} +2 -2
  43. package/dist/{chunk-5H4GSJAI.js → chunk-UE3UBMCP.js} +7 -6
  44. package/dist/{chunk-IXMNTNW5.js → chunk-UKGMDCXT.js} +4 -3
  45. package/dist/{chunk-4UESMQDP.js → chunk-UOXX4SQZ.js} +7 -6
  46. package/dist/{chunk-T2F4S7U4.js → chunk-WI3VDXHD.js} +18 -8
  47. package/dist/{chunk-O4MBV4AX.js → chunk-WJYXMB2R.js} +6 -5
  48. package/dist/{chunk-U4VAATKP.js → chunk-WXJY3BKV.js} +16 -6
  49. package/dist/{chunk-DR7JOQTC.js → chunk-X5K3U6GI.js} +3 -3
  50. package/dist/{chunk-VXECAJJ7.js → chunk-XVGB6KYU.js} +37 -36
  51. package/dist/{chunk-TEBQ4VPZ.js → chunk-YOHO4DVT.js} +6 -5
  52. package/dist/{chunk-RXISBFR5.js → chunk-ZE6KLBUO.js} +5 -4
  53. package/dist/{chunk-22B7GE5T.js → chunk-ZHH3BEWU.js} +13 -12
  54. package/dist/codebase-index/bm25.d.ts +14 -1
  55. package/dist/codebase-index/index.js +8 -8
  56. package/dist/codebase-index/json-parser.d.ts +4 -0
  57. package/dist/codebase-index/parser-worker-script.js +2 -2
  58. package/dist/codebase-index/project-server.js +48 -9
  59. package/dist/codebase-index/worker.js +4 -4
  60. package/dist/codebase-index/writer-bulk-insert.d.ts +0 -1
  61. package/dist/codebase-index/writer-schema.d.ts +1 -1
  62. package/dist/codebase-index/writer.d.ts +38 -0
  63. package/dist/diff.js +1 -1
  64. package/dist/e2e.d.ts +40 -1
  65. package/dist/e2e.js +1 -1
  66. package/dist/edit.js +7 -7
  67. package/dist/exec.js +1 -1
  68. package/dist/fetch.js +1 -1
  69. package/dist/format.d.ts +42 -2
  70. package/dist/format.js +4 -4
  71. package/dist/git.d.ts +70 -1
  72. package/dist/git.js +1 -1
  73. package/dist/glob.js +3 -3
  74. package/dist/{go-parser-JXYKJHRC.js → go-parser-IKHW67WE.js} +2 -2
  75. package/dist/grep.js +3 -3
  76. package/dist/index.js +63 -45
  77. package/dist/install.d.ts +51 -2
  78. package/dist/install.js +4 -4
  79. package/dist/{json-parser-IBHZ4BZC.js → json-parser-2EOVP5MR.js} +81 -15
  80. package/dist/kanban.d.ts +19 -1
  81. package/dist/kanban.js +2 -2
  82. package/dist/languages/index.js +2 -2
  83. package/dist/{legacy-bridge-7M6QLUQN.js → legacy-bridge-SFNXIRAP.js} +4 -4
  84. package/dist/lint.js +4 -4
  85. package/dist/logs.js +1 -1
  86. package/dist/outdated.d.ts +25 -1
  87. package/dist/outdated.js +1 -1
  88. package/dist/pack.js +44 -44
  89. package/dist/{parser-dispatch-QH4XPGG6.js → parser-dispatch-X62UWXJS.js} +3 -3
  90. package/dist/patch.js +7 -7
  91. package/dist/plan.js +4 -4
  92. package/dist/{py-parser-IS4HKYMF.js → py-parser-TDXSQZBC.js} +2 -2
  93. package/dist/read.js +7 -7
  94. package/dist/replace.js +7 -7
  95. package/dist/{rs-parser-XHUUO2KZ.js → rs-parser-GIWPUA3T.js} +2 -2
  96. package/dist/scaffold.js +1 -1
  97. package/dist/search.js +1 -1
  98. package/dist/session-kanban.js +1 -1
  99. package/dist/task.js +4 -4
  100. package/dist/test.js +4 -4
  101. package/dist/todo.js +3 -3
  102. package/dist/tool-diff.js +1 -1
  103. package/dist/tool-tier.js +45 -45
  104. package/dist/tool-use.js +1 -1
  105. package/dist/{ts-parser-RCTYKSVI.js → ts-parser-7W26YB26.js} +2 -2
  106. package/dist/typecheck.js +4 -4
  107. package/dist/write.js +7 -7
  108. package/dist/{yaml-parser-4SAXV3PL.js → yaml-parser-RGBXEZE4.js} +2 -2
  109. package/package.json +5 -5
package/dist/index.js CHANGED
@@ -22,10 +22,10 @@ import "./chunk-Z6DAKQ3U.js";
22
22
  import {
23
23
  registerBuiltinToolTier,
24
24
  selectBuiltinToolsForTier
25
- } from "./chunk-MQX2KXVW.js";
25
+ } from "./chunk-RMB76PDS.js";
26
26
  import {
27
27
  builtinToolsPack
28
- } from "./chunk-I64BS3VC.js";
28
+ } from "./chunk-FYDKHXN7.js";
29
29
  import {
30
30
  OFF_ONLY_TOOLS,
31
31
  OPTIONAL_TOOLS,
@@ -38,11 +38,11 @@ import {
38
38
  clarifyTool,
39
39
  pwshTool,
40
40
  securityAstScanTool
41
- } from "./chunk-VXECAJJ7.js";
41
+ } from "./chunk-XVGB6KYU.js";
42
42
  import {
43
43
  discoverE2EProjects,
44
44
  e2ePlanTool
45
- } from "./chunk-JRJJX3L5.js";
45
+ } from "./chunk-5WNDJHT6.js";
46
46
  import {
47
47
  codebaseAstReplaceTool,
48
48
  codebaseImpactAnalysisTool,
@@ -59,23 +59,23 @@ import {
59
59
  generateRepoMap,
60
60
  replaceSymbolInFile,
61
61
  runDeadCodeScan
62
- } from "./chunk-L25CVUVR.js";
62
+ } from "./chunk-AK2K4KHR.js";
63
63
  import "./chunk-EEOFQDT6.js";
64
64
  import {
65
65
  planTool
66
- } from "./chunk-NKJW5GFO.js";
66
+ } from "./chunk-H6AWAZ2Y.js";
67
67
  import {
68
68
  taskTool
69
- } from "./chunk-DR7JOQTC.js";
69
+ } from "./chunk-X5K3U6GI.js";
70
70
  import {
71
71
  toolSearchTool
72
72
  } from "./chunk-RJZQWEMS.js";
73
73
  import {
74
74
  toolUseTool
75
- } from "./chunk-S5CCLZL3.js";
75
+ } from "./chunk-FRN7TIAA.js";
76
76
  import {
77
77
  batchToolUseTool
78
- } from "./chunk-U4VAATKP.js";
78
+ } from "./chunk-WXJY3BKV.js";
79
79
  import {
80
80
  toolHelpTool
81
81
  } from "./chunk-QBV725YG.js";
@@ -84,50 +84,50 @@ import {
84
84
  } from "./chunk-6RNIFLG4.js";
85
85
  import {
86
86
  testTool
87
- } from "./chunk-BSLVR56S.js";
87
+ } from "./chunk-CPVLVQYT.js";
88
88
  import {
89
89
  installTool
90
- } from "./chunk-5H4GSJAI.js";
90
+ } from "./chunk-UE3UBMCP.js";
91
91
  import {
92
92
  auditTool
93
- } from "./chunk-VJNHFZ7J.js";
93
+ } from "./chunk-CVALEVGA.js";
94
94
  import {
95
95
  outdatedTool
96
- } from "./chunk-LWKUTMD5.js";
96
+ } from "./chunk-MRZOVQ5D.js";
97
97
  import {
98
98
  logsTool
99
- } from "./chunk-RGISBZBD.js";
99
+ } from "./chunk-CPSAF2AU.js";
100
100
  import {
101
101
  documentTool
102
102
  } from "./chunk-EMRGN4KM.js";
103
103
  import {
104
104
  scaffoldTool
105
- } from "./chunk-AHHDWNXC.js";
105
+ } from "./chunk-TKA4VEX2.js";
106
106
  import {
107
107
  gitTool
108
- } from "./chunk-RXISBFR5.js";
108
+ } from "./chunk-ZE6KLBUO.js";
109
109
  import {
110
110
  patchTool
111
- } from "./chunk-QZQSPUBF.js";
111
+ } from "./chunk-RUOMW2I6.js";
112
112
  import {
113
113
  jsonTool
114
114
  } from "./chunk-VB3MJGCV.js";
115
115
  import {
116
116
  diffTool
117
- } from "./chunk-UKU2ZX4C.js";
117
+ } from "./chunk-P7ZQ2FAJ.js";
118
118
  import {
119
119
  treeTool
120
120
  } from "./chunk-J5SKD6LN.js";
121
121
  import {
122
122
  lintTool
123
- } from "./chunk-O4MBV4AX.js";
123
+ } from "./chunk-WJYXMB2R.js";
124
124
  import {
125
125
  formatTool
126
- } from "./chunk-SDLVH5RZ.js";
126
+ } from "./chunk-3QQSBUXR.js";
127
127
  import {
128
128
  typecheckTool
129
- } from "./chunk-EJWSCQ6D.js";
130
- import "./chunk-PQKK5JH7.js";
129
+ } from "./chunk-4AEZIFOW.js";
130
+ import "./chunk-4E42D7UF.js";
131
131
  import {
132
132
  ADDITIONAL_LANGUAGE_PROFILES,
133
133
  LanguageProfileRegistry,
@@ -145,22 +145,22 @@ import {
145
145
  planLanguageOperation,
146
146
  validateCommandPlan,
147
147
  validateLanguageProfile
148
- } from "./chunk-OUBDL3WH.js";
149
- import "./chunk-22B7GE5T.js";
148
+ } from "./chunk-SOG7XIRF.js";
149
+ import "./chunk-ZHH3BEWU.js";
150
150
  import {
151
151
  replaceTool
152
- } from "./chunk-MZZN7VCD.js";
152
+ } from "./chunk-6RR5VX6U.js";
153
153
  import {
154
154
  globTool
155
- } from "./chunk-UNSKG6DC.js";
155
+ } from "./chunk-ICAXDRP6.js";
156
156
  import {
157
157
  grepTool
158
- } from "./chunk-553IQUMO.js";
158
+ } from "./chunk-S2JRYDYG.js";
159
159
  import "./chunk-Q5JPPCZC.js";
160
- import "./chunk-U4D5S3VQ.js";
160
+ import "./chunk-NWZ6XGBJ.js";
161
161
  import {
162
162
  bashTool
163
- } from "./chunk-IVWV2UM6.js";
163
+ } from "./chunk-HTYEO67J.js";
164
164
  import {
165
165
  checkExecKillCommand,
166
166
  configureDangerBypass,
@@ -172,7 +172,7 @@ import {
172
172
  isExecCommandAllowed,
173
173
  resetDangerBypass,
174
174
  resetExecPolicy
175
- } from "./chunk-T2F4S7U4.js";
175
+ } from "./chunk-WI3VDXHD.js";
176
176
  import "./chunk-BTSFTGIL.js";
177
177
  import {
178
178
  getPersistentProcessRegistry,
@@ -188,20 +188,20 @@ import {
188
188
  } from "./chunk-HFXSNKCV.js";
189
189
  import {
190
190
  fetchTool
191
- } from "./chunk-IXMNTNW5.js";
191
+ } from "./chunk-UKGMDCXT.js";
192
192
  import {
193
193
  searchTool
194
- } from "./chunk-4I4LWFOO.js";
194
+ } from "./chunk-PQTONQ4P.js";
195
195
  import "./chunk-NBDZMMG2.js";
196
196
  import {
197
197
  todoTool
198
- } from "./chunk-7EY5DCRO.js";
198
+ } from "./chunk-5ZYEGP2P.js";
199
199
  import {
200
200
  kanbanEvidenceKey,
201
201
  kanbanEvidencePointer,
202
202
  kanbanTool,
203
203
  recordKanbanVerificationEvidence
204
- } from "./chunk-JNNVRHMV.js";
204
+ } from "./chunk-FJEQZHZN.js";
205
205
  import {
206
206
  SESSION_KANBAN_COLUMNS,
207
207
  applySessionKanbanBoardToTodos,
@@ -216,7 +216,7 @@ import {
216
216
  projectSessionTasksToKanban,
217
217
  projectSessionTodosToKanban,
218
218
  rebindSessionKanbanTask
219
- } from "./chunk-PY2IOS7C.js";
219
+ } from "./chunk-CWALNI6K.js";
220
220
  import {
221
221
  BrowserArtifactStore,
222
222
  BrowserNetworkGuardProxy,
@@ -245,16 +245,16 @@ import {
245
245
  resolvePinnedBrowserTarget,
246
246
  safeBrowserUrl,
247
247
  shutdownBrowserTools
248
- } from "./chunk-K3WNSHUF.js";
248
+ } from "./chunk-45JPRMC2.js";
249
249
  import {
250
250
  readTool
251
- } from "./chunk-JOHXDF3D.js";
251
+ } from "./chunk-NKX4SJ5R.js";
252
252
  import {
253
253
  writeTool
254
- } from "./chunk-VFKPWSOX.js";
254
+ } from "./chunk-BANPF4LY.js";
255
255
  import {
256
256
  editTool
257
- } from "./chunk-ZJQ4IGXK.js";
257
+ } from "./chunk-TDLZIDCY.js";
258
258
  import "./chunk-FQZOHLG3.js";
259
259
  import {
260
260
  cancelPendingReindexes,
@@ -275,21 +275,21 @@ import {
275
275
  shutdownCodebaseIndexHost,
276
276
  shutdownCodebaseIndexServer,
277
277
  symbolGraphService
278
- } from "./chunk-HYX2TZ7O.js";
279
- import "./chunk-4UESMQDP.js";
278
+ } from "./chunk-A2PX7M7A.js";
279
+ import "./chunk-UOXX4SQZ.js";
280
280
  import {
281
281
  CircuitOpenError,
282
282
  IndexCircuitBreaker,
283
283
  IndexTimeoutError,
284
284
  indexCircuitBreaker,
285
285
  resetIndexCircuitBreaker
286
- } from "./chunk-DA4KNE2H.js";
287
- import "./chunk-IYK7XGDZ.js";
286
+ } from "./chunk-TFEGJDH5.js";
287
+ import "./chunk-JJQB6R7Y.js";
288
288
  import "./chunk-ZLTFLC25.js";
289
289
  import "./chunk-A6BRWIXN.js";
290
290
  import "./chunk-UCYQTZ7F.js";
291
- import "./chunk-TEBQ4VPZ.js";
292
- import "./chunk-LIJQMYYX.js";
291
+ import "./chunk-YOHO4DVT.js";
292
+ import "./chunk-ELFFQ4RU.js";
293
293
  import {
294
294
  resolveWin32Command
295
295
  } from "./chunk-V43EQ6VR.js";
@@ -683,15 +683,21 @@ var TOOL_ICON_MAP = {
683
683
  read: "file",
684
684
  write: "file",
685
685
  create: "file",
686
+ view_file: "file",
687
+ write_to_file: "file",
686
688
  // File modification
687
689
  edit: "edit",
688
690
  patch: "edit",
689
691
  replace: "edit",
692
+ replace_file_content: "edit",
690
693
  // Content search
691
694
  grep: "search",
692
695
  search: "search",
696
+ grep_search: "search",
693
697
  // File discovery
694
698
  glob: "folder",
699
+ find_by_name: "folder",
700
+ find_files: "folder",
695
701
  // Shell/command execution
696
702
  bash: "terminal",
697
703
  exec: "terminal",
@@ -700,17 +706,23 @@ var TOOL_ICON_MAP = {
700
706
  run: "terminal",
701
707
  command: "terminal",
702
708
  shell: "terminal",
709
+ run_command: "terminal",
703
710
  // Network
704
711
  fetch: "web",
705
712
  curl: "web",
706
713
  http: "web",
707
714
  request: "web",
715
+ read_url_content: "web",
716
+ search_web: "web",
717
+ web_search: "web",
708
718
  // Version control
709
719
  git: "git",
710
720
  // Directory structure
711
721
  tree: "tree",
712
722
  ls: "tree",
713
723
  list: "tree",
724
+ list_dir: "tree",
725
+ list_directory: "tree",
714
726
  // Code quality
715
727
  lint: "code",
716
728
  format: "code",
@@ -796,6 +808,12 @@ var TOOL_ICON_MAP = {
796
808
  reason: "brain",
797
809
  analyze: "brain",
798
810
  reasoning: "brain",
811
+ invoke_subagent: "brain",
812
+ define_subagent: "brain",
813
+ manage_subagents: "brain",
814
+ ask_question: "document",
815
+ generate_image: "scaffold",
816
+ schedule: "settings",
799
817
  // Language intelligence
800
818
  lsp_diagnostics: "code",
801
819
  lsp_definition: "search",
package/dist/install.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import type { Tool } from '@wrongstack/core/types';
1
+ import type { Tool, ToolStreamEvent } from '@wrongstack/core/types';
2
2
  interface InstallInput {
3
3
  packages?: string | string[] | undefined;
4
4
  save?: 'dependency' | 'dev' | 'optional' | undefined;
@@ -20,6 +20,55 @@ interface InstallOutput {
20
20
  dry_run: boolean;
21
21
  truncated: boolean;
22
22
  }
23
- export declare const installTool: Tool<InstallInput, InstallOutput>;
23
+ type InstallContext = Parameters<Tool<InstallInput, InstallOutput>['execute']>[1];
24
+ export declare const installTool: {
25
+ name: string;
26
+ category: string;
27
+ description: string;
28
+ usageHint: string;
29
+ permission: "confirm";
30
+ subjectKey: string;
31
+ mutating: true;
32
+ riskTier: "standard";
33
+ icon: "package";
34
+ timeoutMs: number;
35
+ capabilities: string[];
36
+ inputSchema: {
37
+ type: string;
38
+ properties: {
39
+ packages: {
40
+ type: string;
41
+ description: string;
42
+ };
43
+ save: {
44
+ type: string;
45
+ enum: string[];
46
+ description: string;
47
+ };
48
+ cwd: {
49
+ type: string;
50
+ description: string;
51
+ };
52
+ dry_run: {
53
+ type: string;
54
+ description: string;
55
+ };
56
+ global: {
57
+ type: string;
58
+ description: string;
59
+ };
60
+ lifecycleScripts: {
61
+ type: string;
62
+ description: string;
63
+ };
64
+ };
65
+ };
66
+ execute(input: InstallInput, ctx: InstallContext, opts?: {
67
+ signal: AbortSignal;
68
+ }): Promise<InstallOutput>;
69
+ executeStream(input: InstallInput, ctx: InstallContext, opts?: {
70
+ signal: AbortSignal;
71
+ }): AsyncGenerator<ToolStreamEvent<InstallOutput>>;
72
+ };
24
73
  export {};
25
74
  //# sourceMappingURL=install.d.ts.map
package/dist/install.js CHANGED
@@ -1,9 +1,9 @@
1
1
  import {
2
2
  installTool
3
- } from "./chunk-5H4GSJAI.js";
4
- import "./chunk-PQKK5JH7.js";
5
- import "./chunk-OUBDL3WH.js";
6
- import "./chunk-22B7GE5T.js";
3
+ } from "./chunk-UE3UBMCP.js";
4
+ import "./chunk-4E42D7UF.js";
5
+ import "./chunk-SOG7XIRF.js";
6
+ import "./chunk-ZHH3BEWU.js";
7
7
  import "./chunk-2VSZC6QM.js";
8
8
  import "./chunk-3PVYQFRQ.js";
9
9
  import "./chunk-HFXSNKCV.js";
@@ -1,21 +1,74 @@
1
1
  import {
2
2
  detectLang
3
- } from "./chunk-TEBQ4VPZ.js";
3
+ } from "./chunk-YOHO4DVT.js";
4
4
 
5
5
  // src/codebase-index/json-parser.ts
6
6
  import { expectDefined } from "@wrongstack/core/utils";
7
7
  import * as path from "node:path";
8
+ var JSON_MAX_SYMBOLS_DEFAULT = 1e3;
8
9
  function parseSymbols(opts) {
9
10
  const { file, content, lang } = opts;
10
11
  try {
11
- return regexParse({ file, content, lang });
12
+ return regexParse({ file, content, lang, maxSymbols: opts.maxSymbols });
12
13
  } catch {
13
14
  return { file, lang, symbols: [], mtimeMs: Date.now() };
14
15
  }
15
16
  }
17
+ function topLevelKeys(content) {
18
+ const keys = [];
19
+ const stack = [];
20
+ let inString = false;
21
+ for (let i = 0; i < content.length; i++) {
22
+ const ch = content[i];
23
+ if (inString) {
24
+ if (ch === "\\") {
25
+ i++;
26
+ } else if (ch === '"') {
27
+ inString = false;
28
+ }
29
+ continue;
30
+ }
31
+ if (ch === "/" && content[i + 1] === "/") {
32
+ while (i < content.length && content[i] !== "\n") i++;
33
+ continue;
34
+ }
35
+ if (ch === "/" && content[i + 1] === "*") {
36
+ i += 2;
37
+ while (i < content.length && !(content[i] === "*" && content[i + 1] === "/")) i++;
38
+ i++;
39
+ continue;
40
+ }
41
+ if (ch === '"') {
42
+ inString = true;
43
+ if (stack.length === 1 && stack[0] === "{") {
44
+ let j = i + 1;
45
+ while (j < content.length && content[j] !== '"') {
46
+ if (content[j] === "\\") j++;
47
+ j++;
48
+ }
49
+ if (j < content.length) {
50
+ const key = content.slice(i + 1, j);
51
+ let k = j + 1;
52
+ while (k < content.length && /\s/.test(content[k] ?? "")) k++;
53
+ if (content[k] === ":") keys.push({ key, offset: i });
54
+ i = j;
55
+ inString = false;
56
+ }
57
+ }
58
+ continue;
59
+ }
60
+ if (ch === "{" || ch === "[") stack.push(ch);
61
+ else if (ch === "}" || ch === "]") stack.pop();
62
+ }
63
+ return keys;
64
+ }
16
65
  function regexParse(opts) {
17
66
  const { file, content, lang } = opts;
67
+ const maxSymbols = opts.maxSymbols ?? JSON_MAX_SYMBOLS_DEFAULT;
18
68
  const symbols = [];
69
+ const pushSymbol = (symbol) => {
70
+ if (symbols.length < maxSymbols) symbols.push(symbol);
71
+ };
19
72
  const basename2 = path.basename(file).toLowerCase();
20
73
  const isPackageJson = basename2 === "package.json";
21
74
  const isTsconfig = basename2 === "tsconfig.json" || basename2 === "tsconfig.build.json";
@@ -40,7 +93,7 @@ function regexParse(opts) {
40
93
  if (rootMatch) {
41
94
  const offset = expectDefined(rootMatch.index);
42
95
  const line = lineFromOffset(offset);
43
- symbols.push(
96
+ pushSymbol(
44
97
  makeSymbol({
45
98
  name: path.basename(file),
46
99
  kind: "object",
@@ -52,10 +105,8 @@ function regexParse(opts) {
52
105
  })
53
106
  );
54
107
  }
55
- const topLevelKeyRegex = /^\s*"([^"]+)"\s*:/gm;
56
- for (let match = topLevelKeyRegex.exec(content); match !== null; match = topLevelKeyRegex.exec(content)) {
57
- const key = expectDefined(match[1]);
58
- const offset = match.index ?? 0;
108
+ for (const { key, offset } of topLevelKeys(content)) {
109
+ if (symbols.length >= maxSymbols) break;
59
110
  const line = lineFromOffset(offset);
60
111
  const col = offset - (lineOffsets[line - 1] ?? 0);
61
112
  let kind = "property";
@@ -80,7 +131,7 @@ function regexParse(opts) {
80
131
  signature = `"$ref": "..."`;
81
132
  }
82
133
  }
83
- symbols.push(
134
+ pushSymbol(
84
135
  makeSymbol({
85
136
  name: key,
86
137
  kind,
@@ -92,10 +143,19 @@ function regexParse(opts) {
92
143
  })
93
144
  );
94
145
  if (isPackageJson && key === "scripts") {
95
- extractPackageScripts(content, symbols, file, lang, lineOffsets, lineFromOffset);
146
+ extractPackageScripts(content, symbols, file, lang, lineOffsets, lineFromOffset, maxSymbols);
96
147
  }
97
148
  if (isTsconfig && key === "compilerOptions") {
98
- extractCompilerOptions(content, symbols, file, lang, lineOffsets, line, lineFromOffset);
149
+ extractCompilerOptions(
150
+ content,
151
+ symbols,
152
+ file,
153
+ lang,
154
+ lineOffsets,
155
+ line,
156
+ lineFromOffset,
157
+ maxSymbols
158
+ );
99
159
  }
100
160
  }
101
161
  const defsRegex = /"\$defs"\s*:|"\$defs"\s*:/g;
@@ -103,7 +163,7 @@ function regexParse(opts) {
103
163
  if (defsMatch !== null) {
104
164
  const offset = expectDefined(defsMatch.index);
105
165
  const line = lineFromOffset(offset);
106
- symbols.push(
166
+ pushSymbol(
107
167
  makeSymbol({
108
168
  name: "$defs",
109
169
  kind: "property",
@@ -124,10 +184,11 @@ function regexParse(opts) {
124
184
  for (const pat of defsPatterns) {
125
185
  pat.lastIndex = 0;
126
186
  for (let match = pat.exec(content); match !== null; match = pat.exec(content)) {
187
+ if (symbols.length >= maxSymbols) break;
127
188
  const offset = match.index ?? 0;
128
189
  const line = lineFromOffset(offset);
129
190
  const key = match[0]?.match(/"([^"]+)"/)?.[1] ?? expectDefined(match[0]);
130
- symbols.push(
191
+ pushSymbol(
131
192
  makeSymbol({
132
193
  name: key,
133
194
  kind: "property",
@@ -142,13 +203,15 @@ function regexParse(opts) {
142
203
  }
143
204
  return { file, lang, symbols, mtimeMs: Date.now() };
144
205
  }
145
- function extractPackageScripts(content, symbols, file, lang, lineOffsets, lineFromOffset) {
206
+ function extractPackageScripts(content, symbols, file, lang, lineOffsets, lineFromOffset, maxSymbols) {
146
207
  const scriptsBlockRegex = /"scripts"\s*:\s*\{([^}]+)\}/g;
147
208
  for (let match = scriptsBlockRegex.exec(content); match !== null; match = scriptsBlockRegex.exec(content)) {
209
+ if (symbols.length >= maxSymbols) return;
148
210
  const blockContent = expectDefined(match[0]);
149
211
  const blockOffset = match.index ?? 0;
150
212
  const scriptKeyRegex = /"(\w[\w-]*)"\s*:/g;
151
213
  for (let scriptMatch = scriptKeyRegex.exec(blockContent); scriptMatch !== null; scriptMatch = scriptKeyRegex.exec(blockContent)) {
214
+ if (symbols.length >= maxSymbols) return;
152
215
  const key = expectDefined(scriptMatch[1]);
153
216
  const keyOffset = blockOffset + expectDefined(scriptMatch.index);
154
217
  const line = lineFromOffset(keyOffset);
@@ -166,13 +229,15 @@ function extractPackageScripts(content, symbols, file, lang, lineOffsets, lineFr
166
229
  }
167
230
  }
168
231
  }
169
- function extractCompilerOptions(content, symbols, file, lang, lineOffsets, parentLine, lineFromOffset) {
232
+ function extractCompilerOptions(content, symbols, file, lang, lineOffsets, parentLine, lineFromOffset, maxSymbols) {
170
233
  const optsBlockRegex = /"compilerOptions"\s*:\s*\{([^}]+)\}/g;
171
234
  for (let match = optsBlockRegex.exec(content); match !== null; match = optsBlockRegex.exec(content)) {
235
+ if (symbols.length >= maxSymbols) return;
172
236
  const blockContent = expectDefined(match[0]);
173
237
  const blockOffset = match.index ?? 0;
174
238
  const optKeyRegex = /"(\w[\w]*)"\s*:/g;
175
239
  for (let optMatch = optKeyRegex.exec(blockContent); optMatch !== null; optMatch = optKeyRegex.exec(blockContent)) {
240
+ if (symbols.length >= maxSymbols) return;
176
241
  const key = expectDefined(optMatch[1]);
177
242
  const keyOffset = blockOffset + expectDefined(optMatch.index);
178
243
  const line = lineFromOffset(keyOffset);
@@ -207,7 +272,8 @@ function makeSymbol(opts) {
207
272
  };
208
273
  }
209
274
  export {
275
+ JSON_MAX_SYMBOLS_DEFAULT,
210
276
  detectLang,
211
277
  parseSymbols
212
278
  };
213
- //# sourceMappingURL=json-parser-IBHZ4BZC.js.map
279
+ //# sourceMappingURL=json-parser-2EOVP5MR.js.map
package/dist/kanban.d.ts CHANGED
@@ -1,4 +1,22 @@
1
1
  import type { Tool } from '@wrongstack/core/types';
2
2
  import type { KanbanToolInput, KanbanToolOutput } from './kanban-tool-types.js';
3
- export declare const kanbanTool: Tool<KanbanToolInput, KanbanToolOutput>;
3
+ type KanbanContext = Parameters<Tool<KanbanToolInput, KanbanToolOutput>['execute']>[1];
4
+ export declare const kanbanTool: {
5
+ name: string;
6
+ category: string;
7
+ description: string;
8
+ usageHint: string;
9
+ permission: "confirm";
10
+ subjectKey: string;
11
+ mutating: true;
12
+ capabilities: string[];
13
+ icon: "task";
14
+ timeoutMs: number;
15
+ inputSchema: import("@wrongstack/core/types").JSONSchema;
16
+ execute(input: KanbanToolInput, ctx: KanbanContext, _opts?: {
17
+ signal: AbortSignal;
18
+ }): Promise<KanbanToolOutput>;
19
+ serialize(output: KanbanToolOutput, input: KanbanToolInput): string;
20
+ };
21
+ export {};
4
22
  //# sourceMappingURL=kanban.d.ts.map
package/dist/kanban.js CHANGED
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  kanbanTool
3
- } from "./chunk-JNNVRHMV.js";
4
- import "./chunk-PY2IOS7C.js";
3
+ } from "./chunk-FJEQZHZN.js";
4
+ import "./chunk-CWALNI6K.js";
5
5
  export {
6
6
  kanbanTool
7
7
  };
@@ -15,8 +15,8 @@ import {
15
15
  planLanguageOperation,
16
16
  validateCommandPlan,
17
17
  validateLanguageProfile
18
- } from "../chunk-OUBDL3WH.js";
19
- import "../chunk-22B7GE5T.js";
18
+ } from "../chunk-SOG7XIRF.js";
19
+ import "../chunk-ZHH3BEWU.js";
20
20
  import "../chunk-2VSZC6QM.js";
21
21
  import "../chunk-3PVYQFRQ.js";
22
22
  import "../chunk-HFXSNKCV.js";
@@ -2,9 +2,9 @@ import {
2
2
  detectNonJsEcosystem,
3
3
  tryLegacyCodeOperation,
4
4
  tryLegacyPackageOperation
5
- } from "./chunk-PQKK5JH7.js";
6
- import "./chunk-OUBDL3WH.js";
7
- import "./chunk-22B7GE5T.js";
5
+ } from "./chunk-4E42D7UF.js";
6
+ import "./chunk-SOG7XIRF.js";
7
+ import "./chunk-ZHH3BEWU.js";
8
8
  import "./chunk-2VSZC6QM.js";
9
9
  import "./chunk-3PVYQFRQ.js";
10
10
  import "./chunk-HFXSNKCV.js";
@@ -15,4 +15,4 @@ export {
15
15
  tryLegacyCodeOperation,
16
16
  tryLegacyPackageOperation
17
17
  };
18
- //# sourceMappingURL=legacy-bridge-7M6QLUQN.js.map
18
+ //# sourceMappingURL=legacy-bridge-SFNXIRAP.js.map
package/dist/lint.js CHANGED
@@ -1,9 +1,9 @@
1
1
  import {
2
2
  lintTool
3
- } from "./chunk-O4MBV4AX.js";
4
- import "./chunk-PQKK5JH7.js";
5
- import "./chunk-OUBDL3WH.js";
6
- import "./chunk-22B7GE5T.js";
3
+ } from "./chunk-WJYXMB2R.js";
4
+ import "./chunk-4E42D7UF.js";
5
+ import "./chunk-SOG7XIRF.js";
6
+ import "./chunk-ZHH3BEWU.js";
7
7
  import "./chunk-2VSZC6QM.js";
8
8
  import "./chunk-3PVYQFRQ.js";
9
9
  import "./chunk-HFXSNKCV.js";
package/dist/logs.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  logsTool
3
- } from "./chunk-RGISBZBD.js";
3
+ } from "./chunk-CPSAF2AU.js";
4
4
  import "./chunk-Q5JPPCZC.js";
5
5
  import "./chunk-D33S4RQG.js";
6
6
  export {