ultracode 5.4.0 → 5.6.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 (151) hide show
  1. package/dist/chunks/analysis-tool-handlers-GH5FDEWW.js +817 -0
  2. package/dist/chunks/analysis-tool-handlers-IXP4MWZX.js +817 -0
  3. package/dist/chunks/analysis-tool-handlers-LC2BTQYK.js +13 -0
  4. package/dist/chunks/analysis-tool-handlers-QYFKQPFL.js +817 -0
  5. package/dist/chunks/autodoc-tool-handlers-2HF6ERYN.js +1112 -0
  6. package/dist/chunks/autodoc-tool-handlers-4OGQJ7C3.js +1112 -0
  7. package/dist/chunks/autodoc-tool-handlers-N736CB56.js +138 -0
  8. package/dist/chunks/autodoc-tool-handlers-NQYBY6U4.js +1112 -0
  9. package/dist/chunks/branch-tool-handlers-KW3H4FJK.js +276 -0
  10. package/dist/chunks/branch-tool-handlers-QOUDZKJ2.js +276 -0
  11. package/dist/chunks/branch-tool-handlers-RB2U36KI.js +2 -0
  12. package/dist/chunks/branch-tool-handlers-ZHJM6PDK.js +276 -0
  13. package/dist/chunks/chunk-2Z6OQPYC.js +656 -0
  14. package/dist/chunks/chunk-3MQ7LRPN.js +322 -0
  15. package/dist/chunks/chunk-4W6QYGXZ.js +10 -0
  16. package/dist/chunks/chunk-533NFGUG.js +1 -0
  17. package/dist/chunks/chunk-5NUPOPWM.js +1 -0
  18. package/dist/chunks/chunk-AK4HIPA2.js +322 -0
  19. package/dist/chunks/chunk-B3H5NS3I.js +656 -0
  20. package/dist/chunks/chunk-DPTZHDST.js +4 -0
  21. package/dist/chunks/chunk-E5HQWLU5.js +322 -0
  22. package/dist/chunks/chunk-EOH25B5P.js +572 -0
  23. package/dist/chunks/chunk-ESV6F6E3.js +3179 -0
  24. package/dist/chunks/chunk-FPELPFER.js +924 -0
  25. package/dist/chunks/chunk-G6J42I55.js +161 -0
  26. package/dist/chunks/chunk-GCQE7ZYW.js +1 -0
  27. package/dist/chunks/chunk-GTIF6MOX.js +1 -0
  28. package/dist/chunks/chunk-I6STSSAK.js +2 -0
  29. package/dist/chunks/chunk-J2WBGTK2.js +4697 -0
  30. package/dist/chunks/chunk-KAYOX5EB.js +4697 -0
  31. package/dist/chunks/chunk-KPMTACOT.js +656 -0
  32. package/dist/chunks/chunk-L376GZ44.js +3179 -0
  33. package/dist/chunks/chunk-LCTOTHDA.js +15 -0
  34. package/dist/chunks/chunk-LEDJ7GVQ.js +316 -0
  35. package/dist/chunks/chunk-LH4OUKNZ.js +277 -0
  36. package/dist/chunks/chunk-O6IE2MEZ.js +161 -0
  37. package/dist/chunks/chunk-OEXPCY3F.js +316 -0
  38. package/dist/chunks/chunk-OMXOLFDN.js +924 -0
  39. package/dist/chunks/chunk-PLPBXWOU.js +3179 -0
  40. package/dist/chunks/chunk-PWLE5DN2.js +572 -0
  41. package/dist/chunks/chunk-PY43JPWL.js +447 -0
  42. package/dist/chunks/chunk-Q3B4EB7A.js +15 -0
  43. package/dist/chunks/chunk-Q5LPVLXA.js +337 -0
  44. package/dist/chunks/chunk-QIRZHZK2.js +5 -0
  45. package/dist/chunks/chunk-ROQ27LSL.js +924 -0
  46. package/dist/chunks/chunk-S5Q7BD6J.js +572 -0
  47. package/dist/chunks/chunk-SAMX3HJQ.js +337 -0
  48. package/dist/chunks/chunk-SV3WKUNV.js +1 -0
  49. package/dist/chunks/chunk-TCHCDCDO.js +167 -0
  50. package/dist/chunks/chunk-TR3HS7U6.js +316 -0
  51. package/dist/chunks/chunk-TUWE6FCW.js +167 -0
  52. package/dist/chunks/chunk-TVOTA7EE.js +277 -0
  53. package/dist/chunks/chunk-VS44D772.js +337 -0
  54. package/dist/chunks/chunk-WIE3G5ES.js +167 -0
  55. package/dist/chunks/chunk-XG3ACLWR.js +5 -0
  56. package/dist/chunks/chunk-XJ2Z5QQO.js +1 -0
  57. package/dist/chunks/chunk-XK2NY7RB.js +277 -0
  58. package/dist/chunks/chunk-Y4F7NZFZ.js +4700 -0
  59. package/dist/chunks/chunk-YS75L3ZS.js +161 -0
  60. package/dist/chunks/chunk-ZVG5HHI3.js +15 -0
  61. package/dist/chunks/dev-agent-DDDIVWOF.js +1 -0
  62. package/dist/chunks/dev-agent-E2VCFKXN.js +1624 -0
  63. package/dist/chunks/dev-agent-KJNSU5KQ.js +1624 -0
  64. package/dist/chunks/dev-agent-NDERYIPV.js +1624 -0
  65. package/dist/chunks/faiss-provider-7R4BQDIV.js +12 -0
  66. package/dist/chunks/faiss-provider-7ZFRSDN5.js +12 -0
  67. package/dist/chunks/faiss-provider-SXB7FTLB.js +1 -0
  68. package/dist/chunks/faiss-provider-TKLBEUSH.js +12 -0
  69. package/dist/chunks/file-tool-handlers-5DODQXGF.js +1027 -0
  70. package/dist/chunks/file-tool-handlers-KGHLE4KR.js +1027 -0
  71. package/dist/chunks/file-tool-handlers-KTOQ4NFS.js +12 -0
  72. package/dist/chunks/file-tool-handlers-V4SFUDQB.js +1027 -0
  73. package/dist/chunks/graph-metrics-tool-handlers-3AV4X4ZY.js +65 -0
  74. package/dist/chunks/graph-metrics-tool-handlers-3VMDQHJ6.js +65 -0
  75. package/dist/chunks/graph-metrics-tool-handlers-BZ6E6YHF.js +1 -0
  76. package/dist/chunks/graph-metrics-tool-handlers-IYBGSXL7.js +65 -0
  77. package/dist/chunks/graph-storage-factory-2CQ2RPDV.js +13 -0
  78. package/dist/chunks/graph-storage-factory-C5SMMYL6.js +13 -0
  79. package/dist/chunks/graph-storage-factory-EEO2V3GJ.js +1 -0
  80. package/dist/chunks/graph-storage-factory-WBCTXP34.js +13 -0
  81. package/dist/chunks/history-tool-handlers-AS7OQFZI.js +1 -0
  82. package/dist/chunks/history-tool-handlers-FSNJYXV2.js +208 -0
  83. package/dist/chunks/history-tool-handlers-JZAH4EIQ.js +208 -0
  84. package/dist/chunks/history-tool-handlers-KCSCXZ7T.js +208 -0
  85. package/dist/chunks/incremental-updater-A2EL4QXU.js +14 -0
  86. package/dist/chunks/incremental-updater-EQIKBVY2.js +14 -0
  87. package/dist/chunks/incremental-updater-JFGRPH3B.js +14 -0
  88. package/dist/chunks/incremental-updater-S5BAAGHP.js +1 -0
  89. package/dist/chunks/indexer-agent-ASKY7JPG.js +1 -0
  90. package/dist/chunks/indexer-agent-NKAOF323.js +21 -0
  91. package/dist/chunks/indexer-agent-PJN5IOKQ.js +21 -0
  92. package/dist/chunks/indexer-agent-WRJFWKZX.js +21 -0
  93. package/dist/chunks/indexing-pipeline-D4P2O72Z.js +249 -0
  94. package/dist/chunks/indexing-pipeline-L7C543N4.js +1 -0
  95. package/dist/chunks/indexing-pipeline-NHPRN3AB.js +249 -0
  96. package/dist/chunks/indexing-pipeline-ZAXCZU22.js +249 -0
  97. package/dist/chunks/layered-faiss-provider-62CNW54X.js +1 -0
  98. package/dist/chunks/layered-faiss-provider-O7L77GFX.js +12 -0
  99. package/dist/chunks/layered-faiss-provider-RVHLHLPK.js +12 -0
  100. package/dist/chunks/layered-faiss-provider-YT7EDIJI.js +12 -0
  101. package/dist/chunks/merge-agent-3RF7VFF5.js +2481 -0
  102. package/dist/chunks/merge-agent-JCKTCBCE.js +2481 -0
  103. package/dist/chunks/merge-agent-VCL7OXPN.js +2481 -0
  104. package/dist/chunks/merge-agent-ZGK24WVF.js +11 -0
  105. package/dist/chunks/merge-tool-handlers-GV2LOIKU.js +277 -0
  106. package/dist/chunks/merge-tool-handlers-TYDWU5X2.js +277 -0
  107. package/dist/chunks/merge-tool-handlers-U7X2ZO2M.js +1 -0
  108. package/dist/chunks/merge-tool-handlers-YH62ZLPJ.js +277 -0
  109. package/dist/chunks/pattern-tool-handlers-76NF5JDS.js +13 -0
  110. package/dist/chunks/pattern-tool-handlers-IJAGEIVD.js +1549 -0
  111. package/dist/chunks/pattern-tool-handlers-VA5WYA62.js +1549 -0
  112. package/dist/chunks/pattern-tool-handlers-WQ6UBMJS.js +1549 -0
  113. package/dist/chunks/query-agent-36ADGCFZ.js +1 -0
  114. package/dist/chunks/query-agent-H22CR5N5.js +191 -0
  115. package/dist/chunks/query-agent-K2UGZS4M.js +191 -0
  116. package/dist/chunks/query-agent-YJCEHOXD.js +191 -0
  117. package/dist/chunks/semantic-agent-AC7CBEDE.js +6381 -0
  118. package/dist/chunks/semantic-agent-HK5X6CKU.js +6381 -0
  119. package/dist/chunks/semantic-agent-KONIKEGW.js +6381 -0
  120. package/dist/chunks/semantic-agent-LH6IZ2L7.js +137 -0
  121. package/dist/chunks/semantic-tool-handlers-5LMSH2U7.js +3 -0
  122. package/dist/chunks/semantic-tool-handlers-735UMO7Y.js +817 -0
  123. package/dist/chunks/semantic-tool-handlers-BNUYPP7X.js +817 -0
  124. package/dist/chunks/semantic-tool-handlers-MYZPEUD2.js +817 -0
  125. package/dist/chunks/snapshot-tool-handlers-6SIHZT2F.js +201 -0
  126. package/dist/chunks/snapshot-tool-handlers-DS4P3KOT.js +201 -0
  127. package/dist/chunks/snapshot-tool-handlers-JYHRFPC7.js +201 -0
  128. package/dist/chunks/snapshot-tool-handlers-YEHMAT3L.js +1 -0
  129. package/dist/chunks/storage-paths-A3C7WHHG.js +8 -0
  130. package/dist/chunks/storage-paths-HDYH7WPM.js +1 -0
  131. package/dist/chunks/storage-paths-IMFRHBWF.js +8 -0
  132. package/dist/chunks/storage-paths-P3PUSMUD.js +8 -0
  133. package/dist/chunks/taint-tool-handlers-CWESOOMQ.js +68 -0
  134. package/dist/chunks/taint-tool-handlers-OG3NVVP3.js +1 -0
  135. package/dist/chunks/taint-tool-handlers-ON3G3FA7.js +68 -0
  136. package/dist/chunks/taint-tool-handlers-P4P5J6DB.js +68 -0
  137. package/dist/chunks/tracing-tool-handlers-4BDCXTZZ.js +3935 -0
  138. package/dist/chunks/tracing-tool-handlers-6FPNM7HX.js +3935 -0
  139. package/dist/chunks/tracing-tool-handlers-LQTQ5SKK.js +89 -0
  140. package/dist/chunks/tracing-tool-handlers-XRQX2DTS.js +3935 -0
  141. package/dist/chunks/validation-tool-handlers-DZUG7KYY.js +2 -0
  142. package/dist/chunks/validation-tool-handlers-O6TGFSH5.js +555 -0
  143. package/dist/chunks/validation-tool-handlers-RREUYKIR.js +555 -0
  144. package/dist/chunks/validation-tool-handlers-XPWSMS37.js +555 -0
  145. package/dist/index.js +13 -13
  146. package/dist/roslyn-addon/.build-hash +1 -1
  147. package/dist/roslyn-addon/ILGPU.Algorithms.dll +0 -0
  148. package/dist/roslyn-addon/ILGPU.dll +0 -0
  149. package/dist/roslyn-addon/UltraCode.CSharp.deps.json +35 -0
  150. package/dist/roslyn-addon/UltraCode.CSharp.dll +0 -0
  151. package/package.json +1 -1
@@ -0,0 +1,276 @@
1
+ import { BaseToolHandler } from './chunk-SAMX3HJQ.js';
2
+ import './chunk-WIE3G5ES.js';
3
+ import './chunk-XK2NY7RB.js';
4
+ import './chunk-HEMJHRHZ.js';
5
+ import { toError } from './chunk-5WKPA33T.js';
6
+ import { init_logging, log } from './chunk-VCCBEJQ5.js';
7
+ import './chunk-NAQKA54E.js';
8
+ import { execSync } from 'child_process';
9
+ import { z } from 'zod';
10
+
11
+ // src/tools/handlers/branch-tool-handlers.ts
12
+ init_logging();
13
+ var ListBranchesSchema = z.object({
14
+ includeStats: z.boolean().optional().default(false)
15
+ });
16
+ var ListBranchesToolHandler = class extends BaseToolHandler {
17
+ parseArgs(args) {
18
+ return ListBranchesSchema.parse(args);
19
+ }
20
+ async execute(args) {
21
+ const branchManager = await this.context.getBranchManager();
22
+ if (!branchManager) {
23
+ return {
24
+ content: [{ type: "text", text: JSON.stringify({ error: "Branch manager not available" }) }]
25
+ };
26
+ }
27
+ const branches = branchManager.getActiveBranches();
28
+ const currentBranch = branchManager.getCurrentBranch();
29
+ const result = {
30
+ currentBranch,
31
+ branches: branches.map((b) => ({
32
+ name: b.name,
33
+ isCurrent: b.name === currentBranch,
34
+ lastIndexed: b.metadata?.lastIndexedAt || b.lastAccessed
35
+ }))
36
+ };
37
+ if (args.includeStats) {
38
+ result.stats = {
39
+ totalBranches: branches.length,
40
+ indexedBranches: branches.filter((b) => b.metadata?.lastIndexedAt).length
41
+ };
42
+ }
43
+ return {
44
+ content: [{ type: "text", text: JSON.stringify(result, null, 2) }]
45
+ };
46
+ }
47
+ };
48
+ var SwitchBranchSchema = z.object({
49
+ branchName: z.string(),
50
+ createIfNotExists: z.boolean().optional().default(false),
51
+ baseBranch: z.string().optional().describe("Base branch for diff cache (default: main)")
52
+ });
53
+ var SwitchBranchToolHandler = class extends BaseToolHandler {
54
+ parseArgs(args) {
55
+ return SwitchBranchSchema.parse(args);
56
+ }
57
+ async execute(args) {
58
+ const branchManager = await this.context.getBranchManager();
59
+ if (!branchManager) {
60
+ return {
61
+ content: [{ type: "text", text: JSON.stringify({ error: "Branch manager not available" }) }]
62
+ };
63
+ }
64
+ try {
65
+ await branchManager.switchBranch(args.branchName);
66
+ const baseBranches = ["main", "master", "develop", "dev"];
67
+ if (!baseBranches.includes(args.branchName.toLowerCase())) {
68
+ try {
69
+ const storage = await this.context.getGraphStorage();
70
+ const adapter = storage.getLibSQLAdapter?.();
71
+ if (adapter?.initBranchDiff) {
72
+ const baseBranch = args.baseBranch || "main";
73
+ await adapter.initBranchDiff(baseBranch);
74
+ log.i("BRANCHTOOLS", "branch_diff_init", {
75
+ branch: args.branchName,
76
+ base: baseBranch
77
+ });
78
+ }
79
+ } catch (diffError) {
80
+ log.w("BRANCHTOOLS", "branch_diff_init_fail", {
81
+ err: diffError.message
82
+ });
83
+ }
84
+ }
85
+ return {
86
+ content: [
87
+ {
88
+ type: "text",
89
+ text: JSON.stringify({
90
+ success: true,
91
+ currentBranch: args.branchName,
92
+ message: `Switched to branch '${args.branchName}'`
93
+ })
94
+ }
95
+ ]
96
+ };
97
+ } catch (error) {
98
+ const err = toError(error);
99
+ return {
100
+ content: [{ type: "text", text: JSON.stringify({ error: err.message }) }]
101
+ };
102
+ }
103
+ }
104
+ };
105
+ var GetBranchStatusSchema = z.object({
106
+ branchName: z.string().optional()
107
+ });
108
+ var GetBranchStatusToolHandler = class extends BaseToolHandler {
109
+ parseArgs(args) {
110
+ return GetBranchStatusSchema.parse(args);
111
+ }
112
+ async execute(args) {
113
+ const branchManager = await this.context.getBranchManager();
114
+ if (!branchManager) {
115
+ return {
116
+ content: [{ type: "text", text: JSON.stringify({ error: "Branch manager not available" }) }]
117
+ };
118
+ }
119
+ const branchName = args.branchName || branchManager.getCurrentBranch() || "main";
120
+ const metadata = branchManager.getBranchMetadata(branchName);
121
+ const dbPath = branchManager.getBranchDbPath(branchName);
122
+ const hasDb = branchManager.hasBranchDatabase(branchName);
123
+ return {
124
+ content: [
125
+ {
126
+ type: "text",
127
+ text: JSON.stringify(
128
+ {
129
+ branch: branchName,
130
+ exists: hasDb,
131
+ dbPath,
132
+ metadata: metadata ? {
133
+ lastIndexedAt: metadata.lastIndexedAt,
134
+ entityCount: metadata.entityCount,
135
+ relationshipCount: metadata.relationshipCount,
136
+ fileCount: metadata.fileCount,
137
+ indexVersion: metadata.indexVersion
138
+ } : null
139
+ },
140
+ null,
141
+ 2
142
+ )
143
+ }
144
+ ]
145
+ };
146
+ }
147
+ };
148
+ var CleanupBranchesSchema = z.object({
149
+ keepCount: z.number().optional().default(10),
150
+ olderThanDays: z.number().optional(),
151
+ dryRun: z.boolean().optional().default(true)
152
+ });
153
+ var CleanupBranchesToolHandler = class extends BaseToolHandler {
154
+ parseArgs(args) {
155
+ return CleanupBranchesSchema.parse(args);
156
+ }
157
+ async execute(args) {
158
+ const branchManager = await this.context.getBranchManager();
159
+ if (!branchManager) {
160
+ return {
161
+ content: [{ type: "text", text: JSON.stringify({ error: "Branch manager not available" }) }]
162
+ };
163
+ }
164
+ const branches = branchManager.getActiveBranches();
165
+ const currentBranch = branchManager.getCurrentBranch();
166
+ const toCleanup = branches.filter((b) => b.name !== currentBranch && b.name !== "main" && b.name !== "master").slice(args.keepCount);
167
+ let deletedCount = 0;
168
+ if (!args.dryRun) {
169
+ deletedCount = await branchManager.cleanupOldBranches(args.keepCount);
170
+ }
171
+ return {
172
+ content: [
173
+ {
174
+ type: "text",
175
+ text: JSON.stringify(
176
+ {
177
+ dryRun: args.dryRun,
178
+ branchesFound: branches.length,
179
+ branchesToCleanup: args.dryRun ? toCleanup.length : deletedCount,
180
+ cleanedBranches: toCleanup.map((b) => b.name)
181
+ },
182
+ null,
183
+ 2
184
+ )
185
+ }
186
+ ]
187
+ };
188
+ }
189
+ };
190
+ var GetChangedFilesSchema = z.object({
191
+ baseBranch: z.string().optional(),
192
+ targetBranch: z.string().optional(),
193
+ includeUntracked: z.boolean().optional().default(false)
194
+ });
195
+ var GetChangedFilesToolHandler = class extends BaseToolHandler {
196
+ parseArgs(args) {
197
+ return GetChangedFilesSchema.parse(args);
198
+ }
199
+ async execute(args) {
200
+ try {
201
+ const currentBranch = execSync("git symbolic-ref --short HEAD", { encoding: "utf-8" }).trim();
202
+ const targetBranch = args.targetBranch || currentBranch;
203
+ let baseBranch = args.baseBranch;
204
+ if (!baseBranch) {
205
+ try {
206
+ baseBranch = execSync("git symbolic-ref refs/remotes/origin/HEAD", { encoding: "utf-8" }).trim().replace("refs/remotes/origin/", "");
207
+ } catch {
208
+ try {
209
+ execSync("git rev-parse --verify main", { encoding: "utf-8" });
210
+ baseBranch = "main";
211
+ } catch {
212
+ try {
213
+ execSync("git rev-parse --verify master", { encoding: "utf-8" });
214
+ baseBranch = "master";
215
+ } catch {
216
+ baseBranch = currentBranch;
217
+ }
218
+ }
219
+ }
220
+ }
221
+ const output = execSync(`git diff --name-status ${baseBranch}...${targetBranch}`, {
222
+ encoding: "utf-8",
223
+ cwd: process.cwd()
224
+ });
225
+ const changedFiles = output.split("\n").filter((line) => line.trim()).map((line) => {
226
+ const [statusCode, ...pathParts] = line.split(" ");
227
+ const path = pathParts.join(" ");
228
+ const statusMap = {
229
+ A: "added",
230
+ M: "modified",
231
+ D: "deleted",
232
+ R: "renamed"
233
+ };
234
+ const firstChar = statusCode?.[0] ?? "";
235
+ const status = firstChar ? statusMap[firstChar] || statusCode : "unknown";
236
+ return { path, status };
237
+ });
238
+ const added = changedFiles.filter((f) => f.status === "added");
239
+ const modified = changedFiles.filter((f) => f.status === "modified");
240
+ const deleted = changedFiles.filter((f) => f.status === "deleted");
241
+ const renamed = changedFiles.filter((f) => f.status === "renamed");
242
+ return {
243
+ content: [
244
+ {
245
+ type: "text",
246
+ text: JSON.stringify(
247
+ {
248
+ baseBranch,
249
+ targetBranch,
250
+ totalChanges: changedFiles.length,
251
+ summary: {
252
+ added: added.length,
253
+ modified: modified.length,
254
+ deleted: deleted.length,
255
+ renamed: renamed.length
256
+ },
257
+ files: changedFiles
258
+ },
259
+ null,
260
+ 2
261
+ )
262
+ }
263
+ ]
264
+ };
265
+ } catch (error) {
266
+ const err = toError(error);
267
+ return {
268
+ content: [{ type: "text", text: JSON.stringify({ error: err.message }) }]
269
+ };
270
+ }
271
+ }
272
+ };
273
+
274
+ export { CleanupBranchesToolHandler, GetBranchStatusToolHandler, GetChangedFilesToolHandler, ListBranchesToolHandler, SwitchBranchToolHandler };
275
+ //# sourceMappingURL=branch-tool-handlers-ZHJM6PDK.js.map
276
+ //# sourceMappingURL=branch-tool-handlers-ZHJM6PDK.js.map