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.
- package/dist/chunks/analysis-tool-handlers-GH5FDEWW.js +817 -0
- package/dist/chunks/analysis-tool-handlers-IXP4MWZX.js +817 -0
- package/dist/chunks/analysis-tool-handlers-LC2BTQYK.js +13 -0
- package/dist/chunks/analysis-tool-handlers-QYFKQPFL.js +817 -0
- package/dist/chunks/autodoc-tool-handlers-2HF6ERYN.js +1112 -0
- package/dist/chunks/autodoc-tool-handlers-4OGQJ7C3.js +1112 -0
- package/dist/chunks/autodoc-tool-handlers-N736CB56.js +138 -0
- package/dist/chunks/autodoc-tool-handlers-NQYBY6U4.js +1112 -0
- package/dist/chunks/branch-tool-handlers-KW3H4FJK.js +276 -0
- package/dist/chunks/branch-tool-handlers-QOUDZKJ2.js +276 -0
- package/dist/chunks/branch-tool-handlers-RB2U36KI.js +2 -0
- package/dist/chunks/branch-tool-handlers-ZHJM6PDK.js +276 -0
- package/dist/chunks/chunk-2Z6OQPYC.js +656 -0
- package/dist/chunks/chunk-3MQ7LRPN.js +322 -0
- package/dist/chunks/chunk-4W6QYGXZ.js +10 -0
- package/dist/chunks/chunk-533NFGUG.js +1 -0
- package/dist/chunks/chunk-5NUPOPWM.js +1 -0
- package/dist/chunks/chunk-AK4HIPA2.js +322 -0
- package/dist/chunks/chunk-B3H5NS3I.js +656 -0
- package/dist/chunks/chunk-DPTZHDST.js +4 -0
- package/dist/chunks/chunk-E5HQWLU5.js +322 -0
- package/dist/chunks/chunk-EOH25B5P.js +572 -0
- package/dist/chunks/chunk-ESV6F6E3.js +3179 -0
- package/dist/chunks/chunk-FPELPFER.js +924 -0
- package/dist/chunks/chunk-G6J42I55.js +161 -0
- package/dist/chunks/chunk-GCQE7ZYW.js +1 -0
- package/dist/chunks/chunk-GTIF6MOX.js +1 -0
- package/dist/chunks/chunk-I6STSSAK.js +2 -0
- package/dist/chunks/chunk-J2WBGTK2.js +4697 -0
- package/dist/chunks/chunk-KAYOX5EB.js +4697 -0
- package/dist/chunks/chunk-KPMTACOT.js +656 -0
- package/dist/chunks/chunk-L376GZ44.js +3179 -0
- package/dist/chunks/chunk-LCTOTHDA.js +15 -0
- package/dist/chunks/chunk-LEDJ7GVQ.js +316 -0
- package/dist/chunks/chunk-LH4OUKNZ.js +277 -0
- package/dist/chunks/chunk-O6IE2MEZ.js +161 -0
- package/dist/chunks/chunk-OEXPCY3F.js +316 -0
- package/dist/chunks/chunk-OMXOLFDN.js +924 -0
- package/dist/chunks/chunk-PLPBXWOU.js +3179 -0
- package/dist/chunks/chunk-PWLE5DN2.js +572 -0
- package/dist/chunks/chunk-PY43JPWL.js +447 -0
- package/dist/chunks/chunk-Q3B4EB7A.js +15 -0
- package/dist/chunks/chunk-Q5LPVLXA.js +337 -0
- package/dist/chunks/chunk-QIRZHZK2.js +5 -0
- package/dist/chunks/chunk-ROQ27LSL.js +924 -0
- package/dist/chunks/chunk-S5Q7BD6J.js +572 -0
- package/dist/chunks/chunk-SAMX3HJQ.js +337 -0
- package/dist/chunks/chunk-SV3WKUNV.js +1 -0
- package/dist/chunks/chunk-TCHCDCDO.js +167 -0
- package/dist/chunks/chunk-TR3HS7U6.js +316 -0
- package/dist/chunks/chunk-TUWE6FCW.js +167 -0
- package/dist/chunks/chunk-TVOTA7EE.js +277 -0
- package/dist/chunks/chunk-VS44D772.js +337 -0
- package/dist/chunks/chunk-WIE3G5ES.js +167 -0
- package/dist/chunks/chunk-XG3ACLWR.js +5 -0
- package/dist/chunks/chunk-XJ2Z5QQO.js +1 -0
- package/dist/chunks/chunk-XK2NY7RB.js +277 -0
- package/dist/chunks/chunk-Y4F7NZFZ.js +4700 -0
- package/dist/chunks/chunk-YS75L3ZS.js +161 -0
- package/dist/chunks/chunk-ZVG5HHI3.js +15 -0
- package/dist/chunks/dev-agent-DDDIVWOF.js +1 -0
- package/dist/chunks/dev-agent-E2VCFKXN.js +1624 -0
- package/dist/chunks/dev-agent-KJNSU5KQ.js +1624 -0
- package/dist/chunks/dev-agent-NDERYIPV.js +1624 -0
- package/dist/chunks/faiss-provider-7R4BQDIV.js +12 -0
- package/dist/chunks/faiss-provider-7ZFRSDN5.js +12 -0
- package/dist/chunks/faiss-provider-SXB7FTLB.js +1 -0
- package/dist/chunks/faiss-provider-TKLBEUSH.js +12 -0
- package/dist/chunks/file-tool-handlers-5DODQXGF.js +1027 -0
- package/dist/chunks/file-tool-handlers-KGHLE4KR.js +1027 -0
- package/dist/chunks/file-tool-handlers-KTOQ4NFS.js +12 -0
- package/dist/chunks/file-tool-handlers-V4SFUDQB.js +1027 -0
- package/dist/chunks/graph-metrics-tool-handlers-3AV4X4ZY.js +65 -0
- package/dist/chunks/graph-metrics-tool-handlers-3VMDQHJ6.js +65 -0
- package/dist/chunks/graph-metrics-tool-handlers-BZ6E6YHF.js +1 -0
- package/dist/chunks/graph-metrics-tool-handlers-IYBGSXL7.js +65 -0
- package/dist/chunks/graph-storage-factory-2CQ2RPDV.js +13 -0
- package/dist/chunks/graph-storage-factory-C5SMMYL6.js +13 -0
- package/dist/chunks/graph-storage-factory-EEO2V3GJ.js +1 -0
- package/dist/chunks/graph-storage-factory-WBCTXP34.js +13 -0
- package/dist/chunks/history-tool-handlers-AS7OQFZI.js +1 -0
- package/dist/chunks/history-tool-handlers-FSNJYXV2.js +208 -0
- package/dist/chunks/history-tool-handlers-JZAH4EIQ.js +208 -0
- package/dist/chunks/history-tool-handlers-KCSCXZ7T.js +208 -0
- package/dist/chunks/incremental-updater-A2EL4QXU.js +14 -0
- package/dist/chunks/incremental-updater-EQIKBVY2.js +14 -0
- package/dist/chunks/incremental-updater-JFGRPH3B.js +14 -0
- package/dist/chunks/incremental-updater-S5BAAGHP.js +1 -0
- package/dist/chunks/indexer-agent-ASKY7JPG.js +1 -0
- package/dist/chunks/indexer-agent-NKAOF323.js +21 -0
- package/dist/chunks/indexer-agent-PJN5IOKQ.js +21 -0
- package/dist/chunks/indexer-agent-WRJFWKZX.js +21 -0
- package/dist/chunks/indexing-pipeline-D4P2O72Z.js +249 -0
- package/dist/chunks/indexing-pipeline-L7C543N4.js +1 -0
- package/dist/chunks/indexing-pipeline-NHPRN3AB.js +249 -0
- package/dist/chunks/indexing-pipeline-ZAXCZU22.js +249 -0
- package/dist/chunks/layered-faiss-provider-62CNW54X.js +1 -0
- package/dist/chunks/layered-faiss-provider-O7L77GFX.js +12 -0
- package/dist/chunks/layered-faiss-provider-RVHLHLPK.js +12 -0
- package/dist/chunks/layered-faiss-provider-YT7EDIJI.js +12 -0
- package/dist/chunks/merge-agent-3RF7VFF5.js +2481 -0
- package/dist/chunks/merge-agent-JCKTCBCE.js +2481 -0
- package/dist/chunks/merge-agent-VCL7OXPN.js +2481 -0
- package/dist/chunks/merge-agent-ZGK24WVF.js +11 -0
- package/dist/chunks/merge-tool-handlers-GV2LOIKU.js +277 -0
- package/dist/chunks/merge-tool-handlers-TYDWU5X2.js +277 -0
- package/dist/chunks/merge-tool-handlers-U7X2ZO2M.js +1 -0
- package/dist/chunks/merge-tool-handlers-YH62ZLPJ.js +277 -0
- package/dist/chunks/pattern-tool-handlers-76NF5JDS.js +13 -0
- package/dist/chunks/pattern-tool-handlers-IJAGEIVD.js +1549 -0
- package/dist/chunks/pattern-tool-handlers-VA5WYA62.js +1549 -0
- package/dist/chunks/pattern-tool-handlers-WQ6UBMJS.js +1549 -0
- package/dist/chunks/query-agent-36ADGCFZ.js +1 -0
- package/dist/chunks/query-agent-H22CR5N5.js +191 -0
- package/dist/chunks/query-agent-K2UGZS4M.js +191 -0
- package/dist/chunks/query-agent-YJCEHOXD.js +191 -0
- package/dist/chunks/semantic-agent-AC7CBEDE.js +6381 -0
- package/dist/chunks/semantic-agent-HK5X6CKU.js +6381 -0
- package/dist/chunks/semantic-agent-KONIKEGW.js +6381 -0
- package/dist/chunks/semantic-agent-LH6IZ2L7.js +137 -0
- package/dist/chunks/semantic-tool-handlers-5LMSH2U7.js +3 -0
- package/dist/chunks/semantic-tool-handlers-735UMO7Y.js +817 -0
- package/dist/chunks/semantic-tool-handlers-BNUYPP7X.js +817 -0
- package/dist/chunks/semantic-tool-handlers-MYZPEUD2.js +817 -0
- package/dist/chunks/snapshot-tool-handlers-6SIHZT2F.js +201 -0
- package/dist/chunks/snapshot-tool-handlers-DS4P3KOT.js +201 -0
- package/dist/chunks/snapshot-tool-handlers-JYHRFPC7.js +201 -0
- package/dist/chunks/snapshot-tool-handlers-YEHMAT3L.js +1 -0
- package/dist/chunks/storage-paths-A3C7WHHG.js +8 -0
- package/dist/chunks/storage-paths-HDYH7WPM.js +1 -0
- package/dist/chunks/storage-paths-IMFRHBWF.js +8 -0
- package/dist/chunks/storage-paths-P3PUSMUD.js +8 -0
- package/dist/chunks/taint-tool-handlers-CWESOOMQ.js +68 -0
- package/dist/chunks/taint-tool-handlers-OG3NVVP3.js +1 -0
- package/dist/chunks/taint-tool-handlers-ON3G3FA7.js +68 -0
- package/dist/chunks/taint-tool-handlers-P4P5J6DB.js +68 -0
- package/dist/chunks/tracing-tool-handlers-4BDCXTZZ.js +3935 -0
- package/dist/chunks/tracing-tool-handlers-6FPNM7HX.js +3935 -0
- package/dist/chunks/tracing-tool-handlers-LQTQ5SKK.js +89 -0
- package/dist/chunks/tracing-tool-handlers-XRQX2DTS.js +3935 -0
- package/dist/chunks/validation-tool-handlers-DZUG7KYY.js +2 -0
- package/dist/chunks/validation-tool-handlers-O6TGFSH5.js +555 -0
- package/dist/chunks/validation-tool-handlers-RREUYKIR.js +555 -0
- package/dist/chunks/validation-tool-handlers-XPWSMS37.js +555 -0
- package/dist/index.js +13 -13
- package/dist/roslyn-addon/.build-hash +1 -1
- package/dist/roslyn-addon/ILGPU.Algorithms.dll +0 -0
- package/dist/roslyn-addon/ILGPU.dll +0 -0
- package/dist/roslyn-addon/UltraCode.CSharp.deps.json +35 -0
- package/dist/roslyn-addon/UltraCode.CSharp.dll +0 -0
- package/package.json +1 -1
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import { BaseToolHandler } from './chunk-SAMX3HJQ.js';
|
|
2
|
+
import './chunk-WIE3G5ES.js';
|
|
3
|
+
import './chunk-XK2NY7RB.js';
|
|
4
|
+
import './chunk-HEMJHRHZ.js';
|
|
5
|
+
import './chunk-VCCBEJQ5.js';
|
|
6
|
+
import './chunk-NAQKA54E.js';
|
|
7
|
+
import { z } from 'zod';
|
|
8
|
+
|
|
9
|
+
var GraphMetricsSchema = z.object({
|
|
10
|
+
projectPath: z.string().optional(),
|
|
11
|
+
metric: z.enum(["pagerank", "louvain", "centrality", "bus_factor"]),
|
|
12
|
+
topN: z.number().optional().default(20),
|
|
13
|
+
minCommunitySize: z.number().optional().default(2),
|
|
14
|
+
persist: z.boolean().optional().default(false)
|
|
15
|
+
});
|
|
16
|
+
var GraphMetricsToolHandler = class extends BaseToolHandler {
|
|
17
|
+
parseArgs(args) {
|
|
18
|
+
return GraphMetricsSchema.parse(args);
|
|
19
|
+
}
|
|
20
|
+
async execute(args) {
|
|
21
|
+
const projectPath = this.resolveProjectPath(args);
|
|
22
|
+
const storage = await this.ensureGraphStorageForProject(args.projectPath);
|
|
23
|
+
const { GraphMetricsAnalyzer } = await import('./graph-metrics-P5IGB3AU.js');
|
|
24
|
+
const { GraphMetricsFormatter } = await import('./graph-metrics-P5IGB3AU.js');
|
|
25
|
+
const analyzer = new GraphMetricsAnalyzer(storage);
|
|
26
|
+
const result = await analyzer.analyze({
|
|
27
|
+
projectPath,
|
|
28
|
+
metric: args.metric,
|
|
29
|
+
topN: args.topN,
|
|
30
|
+
minCommunitySize: args.minCommunitySize,
|
|
31
|
+
persist: args.persist
|
|
32
|
+
});
|
|
33
|
+
const summary = GraphMetricsFormatter.toSummary(result);
|
|
34
|
+
const text = GraphMetricsFormatter.formatAsText(result);
|
|
35
|
+
let totalItems = 0;
|
|
36
|
+
if (result.metric === "pagerank" || result.metric === "centrality") {
|
|
37
|
+
totalItems = result.entries.length;
|
|
38
|
+
} else if (result.metric === "louvain") {
|
|
39
|
+
totalItems = result.communities.length;
|
|
40
|
+
} else if (result.metric === "bus_factor") {
|
|
41
|
+
totalItems = result.byFile.length;
|
|
42
|
+
}
|
|
43
|
+
return {
|
|
44
|
+
content: [
|
|
45
|
+
{
|
|
46
|
+
type: "text",
|
|
47
|
+
text: JSON.stringify(
|
|
48
|
+
{
|
|
49
|
+
summary,
|
|
50
|
+
formatted: text,
|
|
51
|
+
metric: args.metric,
|
|
52
|
+
totalItems
|
|
53
|
+
},
|
|
54
|
+
null,
|
|
55
|
+
2
|
|
56
|
+
)
|
|
57
|
+
}
|
|
58
|
+
]
|
|
59
|
+
};
|
|
60
|
+
}
|
|
61
|
+
};
|
|
62
|
+
|
|
63
|
+
export { GraphMetricsToolHandler };
|
|
64
|
+
//# sourceMappingURL=graph-metrics-tool-handlers-3AV4X4ZY.js.map
|
|
65
|
+
//# sourceMappingURL=graph-metrics-tool-handlers-3AV4X4ZY.js.map
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import { BaseToolHandler } from './chunk-VS44D772.js';
|
|
2
|
+
import './chunk-TUWE6FCW.js';
|
|
3
|
+
import './chunk-TVOTA7EE.js';
|
|
4
|
+
import './chunk-HEMJHRHZ.js';
|
|
5
|
+
import './chunk-VCCBEJQ5.js';
|
|
6
|
+
import './chunk-NAQKA54E.js';
|
|
7
|
+
import { z } from 'zod';
|
|
8
|
+
|
|
9
|
+
var GraphMetricsSchema = z.object({
|
|
10
|
+
projectPath: z.string().optional(),
|
|
11
|
+
metric: z.enum(["pagerank", "louvain", "centrality", "bus_factor"]),
|
|
12
|
+
topN: z.number().optional().default(20),
|
|
13
|
+
minCommunitySize: z.number().optional().default(2),
|
|
14
|
+
persist: z.boolean().optional().default(false)
|
|
15
|
+
});
|
|
16
|
+
var GraphMetricsToolHandler = class extends BaseToolHandler {
|
|
17
|
+
parseArgs(args) {
|
|
18
|
+
return GraphMetricsSchema.parse(args);
|
|
19
|
+
}
|
|
20
|
+
async execute(args) {
|
|
21
|
+
const projectPath = this.resolveProjectPath(args);
|
|
22
|
+
const storage = await this.ensureGraphStorageForProject(args.projectPath);
|
|
23
|
+
const { GraphMetricsAnalyzer } = await import('./graph-metrics-P5IGB3AU.js');
|
|
24
|
+
const { GraphMetricsFormatter } = await import('./graph-metrics-P5IGB3AU.js');
|
|
25
|
+
const analyzer = new GraphMetricsAnalyzer(storage);
|
|
26
|
+
const result = await analyzer.analyze({
|
|
27
|
+
projectPath,
|
|
28
|
+
metric: args.metric,
|
|
29
|
+
topN: args.topN,
|
|
30
|
+
minCommunitySize: args.minCommunitySize,
|
|
31
|
+
persist: args.persist
|
|
32
|
+
});
|
|
33
|
+
const summary = GraphMetricsFormatter.toSummary(result);
|
|
34
|
+
const text = GraphMetricsFormatter.formatAsText(result);
|
|
35
|
+
let totalItems = 0;
|
|
36
|
+
if (result.metric === "pagerank" || result.metric === "centrality") {
|
|
37
|
+
totalItems = result.entries.length;
|
|
38
|
+
} else if (result.metric === "louvain") {
|
|
39
|
+
totalItems = result.communities.length;
|
|
40
|
+
} else if (result.metric === "bus_factor") {
|
|
41
|
+
totalItems = result.byFile.length;
|
|
42
|
+
}
|
|
43
|
+
return {
|
|
44
|
+
content: [
|
|
45
|
+
{
|
|
46
|
+
type: "text",
|
|
47
|
+
text: JSON.stringify(
|
|
48
|
+
{
|
|
49
|
+
summary,
|
|
50
|
+
formatted: text,
|
|
51
|
+
metric: args.metric,
|
|
52
|
+
totalItems
|
|
53
|
+
},
|
|
54
|
+
null,
|
|
55
|
+
2
|
|
56
|
+
)
|
|
57
|
+
}
|
|
58
|
+
]
|
|
59
|
+
};
|
|
60
|
+
}
|
|
61
|
+
};
|
|
62
|
+
|
|
63
|
+
export { GraphMetricsToolHandler };
|
|
64
|
+
//# sourceMappingURL=graph-metrics-tool-handlers-3VMDQHJ6.js.map
|
|
65
|
+
//# sourceMappingURL=graph-metrics-tool-handlers-3VMDQHJ6.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import {d}from'./chunk-XG3ACLWR.js';import'./chunk-XJ2Z5QQO.js';import'./chunk-SV3WKUNV.js';import'./chunk-PZF7YC35.js';import'./chunk-4BI7EBPQ.js';import'./chunk-DXB73IDG.js';import {z}from'zod';var u=z.object({projectPath:z.string().optional(),metric:z.enum(["pagerank","louvain","centrality","bus_factor"]),topN:z.number().optional().default(20),minCommunitySize:z.number().optional().default(2),persist:z.boolean().optional().default(false)}),a=class extends d{parseArgs(t){return u.parse(t)}async execute(t){let c=this.resolveProjectPath(t),s=await this.ensureGraphStorageForProject(t.projectPath),{GraphMetricsAnalyzer:m}=await import('./graph-metrics-32VYWSIZ.js'),{GraphMetricsFormatter:i}=await import('./graph-metrics-32VYWSIZ.js'),e=await new m(s).analyze({projectPath:c,metric:t.metric,topN:t.topN,minCommunitySize:t.minCommunitySize,persist:t.persist}),l=i.toSummary(e),p=i.formatAsText(e),o=0;return e.metric==="pagerank"||e.metric==="centrality"?o=e.entries.length:e.metric==="louvain"?o=e.communities.length:e.metric==="bus_factor"&&(o=e.byFile.length),{content:[{type:"text",text:JSON.stringify({summary:l,formatted:p,metric:t.metric,totalItems:o},null,2)}]}}};export{a as GraphMetricsToolHandler};
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import { BaseToolHandler } from './chunk-Q5LPVLXA.js';
|
|
2
|
+
import './chunk-TCHCDCDO.js';
|
|
3
|
+
import './chunk-LH4OUKNZ.js';
|
|
4
|
+
import './chunk-HEMJHRHZ.js';
|
|
5
|
+
import './chunk-VCCBEJQ5.js';
|
|
6
|
+
import './chunk-NAQKA54E.js';
|
|
7
|
+
import { z } from 'zod';
|
|
8
|
+
|
|
9
|
+
var GraphMetricsSchema = z.object({
|
|
10
|
+
projectPath: z.string().optional(),
|
|
11
|
+
metric: z.enum(["pagerank", "louvain", "centrality", "bus_factor"]),
|
|
12
|
+
topN: z.number().optional().default(20),
|
|
13
|
+
minCommunitySize: z.number().optional().default(2),
|
|
14
|
+
persist: z.boolean().optional().default(false)
|
|
15
|
+
});
|
|
16
|
+
var GraphMetricsToolHandler = class extends BaseToolHandler {
|
|
17
|
+
parseArgs(args) {
|
|
18
|
+
return GraphMetricsSchema.parse(args);
|
|
19
|
+
}
|
|
20
|
+
async execute(args) {
|
|
21
|
+
const projectPath = this.resolveProjectPath(args);
|
|
22
|
+
const storage = await this.ensureGraphStorageForProject(args.projectPath);
|
|
23
|
+
const { GraphMetricsAnalyzer } = await import('./graph-metrics-P5IGB3AU.js');
|
|
24
|
+
const { GraphMetricsFormatter } = await import('./graph-metrics-P5IGB3AU.js');
|
|
25
|
+
const analyzer = new GraphMetricsAnalyzer(storage);
|
|
26
|
+
const result = await analyzer.analyze({
|
|
27
|
+
projectPath,
|
|
28
|
+
metric: args.metric,
|
|
29
|
+
topN: args.topN,
|
|
30
|
+
minCommunitySize: args.minCommunitySize,
|
|
31
|
+
persist: args.persist
|
|
32
|
+
});
|
|
33
|
+
const summary = GraphMetricsFormatter.toSummary(result);
|
|
34
|
+
const text = GraphMetricsFormatter.formatAsText(result);
|
|
35
|
+
let totalItems = 0;
|
|
36
|
+
if (result.metric === "pagerank" || result.metric === "centrality") {
|
|
37
|
+
totalItems = result.entries.length;
|
|
38
|
+
} else if (result.metric === "louvain") {
|
|
39
|
+
totalItems = result.communities.length;
|
|
40
|
+
} else if (result.metric === "bus_factor") {
|
|
41
|
+
totalItems = result.byFile.length;
|
|
42
|
+
}
|
|
43
|
+
return {
|
|
44
|
+
content: [
|
|
45
|
+
{
|
|
46
|
+
type: "text",
|
|
47
|
+
text: JSON.stringify(
|
|
48
|
+
{
|
|
49
|
+
summary,
|
|
50
|
+
formatted: text,
|
|
51
|
+
metric: args.metric,
|
|
52
|
+
totalItems
|
|
53
|
+
},
|
|
54
|
+
null,
|
|
55
|
+
2
|
|
56
|
+
)
|
|
57
|
+
}
|
|
58
|
+
]
|
|
59
|
+
};
|
|
60
|
+
}
|
|
61
|
+
};
|
|
62
|
+
|
|
63
|
+
export { GraphMetricsToolHandler };
|
|
64
|
+
//# sourceMappingURL=graph-metrics-tool-handlers-IYBGSXL7.js.map
|
|
65
|
+
//# sourceMappingURL=graph-metrics-tool-handlers-IYBGSXL7.js.map
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export { configureGraphStorage, getGraphStorage, getLibSQLAdapter, handleDatabaseCorruption, initializeGraphStorage, isDatabaseCorruptionError, isStorageReady, resetGraphStorage, setGlobalProjectContext } from './chunk-KAYOX5EB.js';
|
|
2
|
+
import './chunk-HNDYLCWI.js';
|
|
3
|
+
import './chunk-CTXFPNDA.js';
|
|
4
|
+
import './chunk-TJSOOFXA.js';
|
|
5
|
+
import './chunk-AIZUHUK6.js';
|
|
6
|
+
import './chunk-G6J42I55.js';
|
|
7
|
+
import './chunk-TVOTA7EE.js';
|
|
8
|
+
import './chunk-HEMJHRHZ.js';
|
|
9
|
+
import './chunk-VCCBEJQ5.js';
|
|
10
|
+
export { DatabaseCorruptionError, SUPPORTED_DIMENSIONS, getEmbeddingColumn, normalizeToSupportedDimension } from './chunk-UN27MREV.js';
|
|
11
|
+
import './chunk-NAQKA54E.js';
|
|
12
|
+
//# sourceMappingURL=graph-storage-factory-2CQ2RPDV.js.map
|
|
13
|
+
//# sourceMappingURL=graph-storage-factory-2CQ2RPDV.js.map
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export { configureGraphStorage, getGraphStorage, getLibSQLAdapter, handleDatabaseCorruption, initializeGraphStorage, isDatabaseCorruptionError, isStorageReady, resetGraphStorage, setGlobalProjectContext } from './chunk-Y4F7NZFZ.js';
|
|
2
|
+
import './chunk-HNDYLCWI.js';
|
|
3
|
+
import './chunk-CTXFPNDA.js';
|
|
4
|
+
import './chunk-TJSOOFXA.js';
|
|
5
|
+
import './chunk-AIZUHUK6.js';
|
|
6
|
+
import './chunk-O6IE2MEZ.js';
|
|
7
|
+
import './chunk-LH4OUKNZ.js';
|
|
8
|
+
import './chunk-HEMJHRHZ.js';
|
|
9
|
+
import './chunk-VCCBEJQ5.js';
|
|
10
|
+
export { DatabaseCorruptionError, SUPPORTED_DIMENSIONS, getEmbeddingColumn, normalizeToSupportedDimension } from './chunk-UN27MREV.js';
|
|
11
|
+
import './chunk-NAQKA54E.js';
|
|
12
|
+
//# sourceMappingURL=graph-storage-factory-C5SMMYL6.js.map
|
|
13
|
+
//# sourceMappingURL=graph-storage-factory-C5SMMYL6.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export{c as configureGraphStorage,d as getGraphStorage,f as getLibSQLAdapter,j as handleDatabaseCorruption,e as initializeGraphStorage,k as isDatabaseCorruptionError,i as isStorageReady,g as resetGraphStorage,h as setGlobalProjectContext}from'./chunk-PY43JPWL.js';import'./chunk-RK5TLU72.js';import'./chunk-LESND2CW.js';import'./chunk-QUO46LUP.js';import'./chunk-3IFLFBQ4.js';import'./chunk-I6STSSAK.js';import'./chunk-SV3WKUNV.js';import'./chunk-PZF7YC35.js';import'./chunk-4BI7EBPQ.js';export{g as DatabaseCorruptionError,b as SUPPORTED_DIMENSIONS,c as getEmbeddingColumn,d as normalizeToSupportedDimension}from'./chunk-F45ISXCP.js';import'./chunk-DXB73IDG.js';
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export { configureGraphStorage, getGraphStorage, getLibSQLAdapter, handleDatabaseCorruption, initializeGraphStorage, isDatabaseCorruptionError, isStorageReady, resetGraphStorage, setGlobalProjectContext } from './chunk-J2WBGTK2.js';
|
|
2
|
+
import './chunk-HNDYLCWI.js';
|
|
3
|
+
import './chunk-CTXFPNDA.js';
|
|
4
|
+
import './chunk-TJSOOFXA.js';
|
|
5
|
+
import './chunk-AIZUHUK6.js';
|
|
6
|
+
import './chunk-YS75L3ZS.js';
|
|
7
|
+
import './chunk-XK2NY7RB.js';
|
|
8
|
+
import './chunk-HEMJHRHZ.js';
|
|
9
|
+
import './chunk-VCCBEJQ5.js';
|
|
10
|
+
export { DatabaseCorruptionError, SUPPORTED_DIMENSIONS, getEmbeddingColumn, normalizeToSupportedDimension } from './chunk-UN27MREV.js';
|
|
11
|
+
import './chunk-NAQKA54E.js';
|
|
12
|
+
//# sourceMappingURL=graph-storage-factory-WBCTXP34.js.map
|
|
13
|
+
//# sourceMappingURL=graph-storage-factory-WBCTXP34.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import {a,b,c as c$1,d as d$2}from'./chunk-NI6OXODU.js';import'./chunk-W5ZEGGQZ.js';import {d}from'./chunk-XG3ACLWR.js';import'./chunk-XJ2Z5QQO.js';import'./chunk-RK5TLU72.js';import {d as d$1,c}from'./chunk-3IFLFBQ4.js';import'./chunk-SV3WKUNV.js';import'./chunk-PZF7YC35.js';import {R,I}from'./chunk-4BI7EBPQ.js';import'./chunk-DXB73IDG.js';R();function n(l){return {content:[{type:"text",text:JSON.stringify({error:l})}]}}var x=class extends d{parseArgs(e){return a.parse(e)}async execute(e){let o=(await this.ensureGraphStorageForProject(e.projectPath)).getLibSQLAdapter?.();if(!o?.getProllyNodeStore||!o?.getCommitManager)return n("Prolly Tree not available - ensure project is indexed");let s=o.getProllyNodeStore(),i=o.getCommitManager();if(!s||!i)return n("Prolly Tree components not initialized");let a=new d$1(s,i);try{let t=await a.getEntityHistory(e.entityId,e.limit);return {content:[{type:"text",text:JSON.stringify({entityId:e.entityId,changes:t.map(r=>({commitHash:r.commitHash,changeType:r.changeType,timestamp:new Date(r.timestamp).toISOString(),entitySnapshot:r.newValue?c(r.newValue):null})),totalChanges:t.length},null,2)}]}}catch(t){return I.e("HISTORY","get_entity_history_failed",{error:t.message}),n(`Failed to get entity history: ${t.message}`)}}},P=class extends d{parseArgs(e){return b.parse(e)}async execute(e){let o=(await this.ensureGraphStorageForProject(e.projectPath)).getLibSQLAdapter?.();if(!o?.getProllyNodeStore||!o?.getCommitManager)return n("Prolly Tree not available - ensure project is indexed");let s=o.getProllyNodeStore(),i=o.getCommitManager();if(!s||!i)return n("Prolly Tree components not initialized");let a=new d$1(s,i);try{let t=e.commitB;if(!t){let c=await i.getBranchHead();if(!c)return n("No commits found - index the project first");t=c.commitHash;}let r=await a.diffCommits(e.commitA,t);if(!r)return n("Failed to diff commits: one or both commits not found");let m={commitA:e.commitA,commitB:t,summary:{added:r.treeDiff.added.length,modified:r.treeDiff.modified.length,deleted:r.treeDiff.deleted.length}};return e.includeEntities&&(m.added=r.treeDiff.added.map(c=>({key:c.key})),m.modified=r.treeDiff.modified.map(c=>({key:c.key})),m.deleted=r.treeDiff.deleted.map(c=>({key:c.key}))),{content:[{type:"text",text:JSON.stringify(m,null,2)}]}}catch(t){return I.e("HISTORY","diff_commits_failed",{error:t.message}),n(`Failed to diff commits: ${t.message}`)}}},w=class extends d{parseArgs(e){return c$1.parse(e)}async execute(e){let o=(await this.ensureGraphStorageForProject(e.projectPath)).getLibSQLAdapter?.();if(!o?.getProllyNodeStore||!o?.getCommitManager)return n("Prolly Tree not available - ensure project is indexed");let s=o.getProllyNodeStore(),i=o.getCommitManager();if(!s||!i)return n("Prolly Tree components not initialized");let a=new d$1(s,i);try{let t=await i.getCommit(e.commitHash);if(!t)return n(`Commit not found: ${e.commitHash}`);let r={commit:{hash:t.commitHash,message:t.message,entityCount:t.entityCount,relationshipCount:t.relationshipCount,createdAt:new Date(t.createdAt).toISOString(),parentHash:t.parentHash}};if(e.entityId){let m=await a.getEntityAt(e.entityId,e.commitHash);r.entity=m;}if(e.query){let m=await a.searchEntitiesAt(e.commitHash,e.query,e.limit);r.entities=m.slice(e.offset,e.offset+e.limit),r.totalMatches=m.length;}return {content:[{type:"text",text:JSON.stringify(r,null,2)}]}}catch(t){return I.e("HISTORY","checkout_commit_failed",{error:t.message}),n(`Failed to checkout commit: ${t.message}`)}}},T=class extends d{parseArgs(e){return d$2.parse(e)}async execute(e){let o=(await this.ensureGraphStorageForProject(e.projectPath)).getLibSQLAdapter?.();if(!o?.getCommitManager)return n("Prolly Tree not available - ensure project is indexed");let s=o.getCommitManager();if(!s)return n("Prolly Tree components not initialized");try{let i=await s.getHistory(e.limit);return {content:[{type:"text",text:JSON.stringify({commits:i.map(a=>({hash:a.commitHash,message:a.message,entityCount:a.entityCount,relationshipCount:a.relationshipCount,createdAt:new Date(a.createdAt).toISOString(),parentHash:a.parentHash?.slice(0,8)||null})),total:i.length},null,2)}]}}catch(i){return I.e("HISTORY","list_commits_failed",{error:i.message}),n(`Failed to list commits: ${i.message}`)}}};export{w as CheckoutCommitToolHandler,P as DiffCommitsToolHandler,x as GetEntityHistoryToolHandler,T as ListCommitsToolHandler};
|
|
@@ -0,0 +1,208 @@
|
|
|
1
|
+
import { GetEntityHistorySchema, DiffCommitsSchema, CheckoutCommitSchema, ListCommitsSchema } from './chunk-LVCP3H3F.js';
|
|
2
|
+
import './chunk-NJUB245U.js';
|
|
3
|
+
import { BaseToolHandler } from './chunk-VS44D772.js';
|
|
4
|
+
import './chunk-TUWE6FCW.js';
|
|
5
|
+
import './chunk-HNDYLCWI.js';
|
|
6
|
+
import { TimeTravelManager, deserializeEntity } from './chunk-AIZUHUK6.js';
|
|
7
|
+
import './chunk-TVOTA7EE.js';
|
|
8
|
+
import './chunk-HEMJHRHZ.js';
|
|
9
|
+
import { init_logging, log } from './chunk-VCCBEJQ5.js';
|
|
10
|
+
import './chunk-NAQKA54E.js';
|
|
11
|
+
|
|
12
|
+
// src/tools/handlers/history-tool-handlers.ts
|
|
13
|
+
init_logging();
|
|
14
|
+
function errorResult(message) {
|
|
15
|
+
return { content: [{ type: "text", text: JSON.stringify({ error: message }) }] };
|
|
16
|
+
}
|
|
17
|
+
var GetEntityHistoryToolHandler = class extends BaseToolHandler {
|
|
18
|
+
parseArgs(args) {
|
|
19
|
+
return GetEntityHistorySchema.parse(args);
|
|
20
|
+
}
|
|
21
|
+
async execute(args) {
|
|
22
|
+
const storage = await this.ensureGraphStorageForProject(args.projectPath);
|
|
23
|
+
const adapter = storage.getLibSQLAdapter?.();
|
|
24
|
+
if (!adapter?.getProllyNodeStore || !adapter?.getCommitManager) {
|
|
25
|
+
return errorResult("Prolly Tree not available - ensure project is indexed");
|
|
26
|
+
}
|
|
27
|
+
const nodeStore = adapter.getProllyNodeStore();
|
|
28
|
+
const commitManager = adapter.getCommitManager();
|
|
29
|
+
if (!nodeStore || !commitManager) {
|
|
30
|
+
return errorResult("Prolly Tree components not initialized");
|
|
31
|
+
}
|
|
32
|
+
const timeTravel = new TimeTravelManager(nodeStore, commitManager);
|
|
33
|
+
try {
|
|
34
|
+
const history = await timeTravel.getEntityHistory(args.entityId, args.limit);
|
|
35
|
+
return {
|
|
36
|
+
content: [
|
|
37
|
+
{
|
|
38
|
+
type: "text",
|
|
39
|
+
text: JSON.stringify(
|
|
40
|
+
{
|
|
41
|
+
entityId: args.entityId,
|
|
42
|
+
changes: history.map((h) => ({
|
|
43
|
+
commitHash: h.commitHash,
|
|
44
|
+
changeType: h.changeType,
|
|
45
|
+
timestamp: new Date(h.timestamp).toISOString(),
|
|
46
|
+
entitySnapshot: h.newValue ? deserializeEntity(h.newValue) : null
|
|
47
|
+
})),
|
|
48
|
+
totalChanges: history.length
|
|
49
|
+
},
|
|
50
|
+
null,
|
|
51
|
+
2
|
|
52
|
+
)
|
|
53
|
+
}
|
|
54
|
+
]
|
|
55
|
+
};
|
|
56
|
+
} catch (error) {
|
|
57
|
+
log.e("HISTORY", "get_entity_history_failed", { error: error.message });
|
|
58
|
+
return errorResult(`Failed to get entity history: ${error.message}`);
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
};
|
|
62
|
+
var DiffCommitsToolHandler = class extends BaseToolHandler {
|
|
63
|
+
parseArgs(args) {
|
|
64
|
+
return DiffCommitsSchema.parse(args);
|
|
65
|
+
}
|
|
66
|
+
async execute(args) {
|
|
67
|
+
const storage = await this.ensureGraphStorageForProject(args.projectPath);
|
|
68
|
+
const adapter = storage.getLibSQLAdapter?.();
|
|
69
|
+
if (!adapter?.getProllyNodeStore || !adapter?.getCommitManager) {
|
|
70
|
+
return errorResult("Prolly Tree not available - ensure project is indexed");
|
|
71
|
+
}
|
|
72
|
+
const nodeStore = adapter.getProllyNodeStore();
|
|
73
|
+
const commitManager = adapter.getCommitManager();
|
|
74
|
+
if (!nodeStore || !commitManager) {
|
|
75
|
+
return errorResult("Prolly Tree components not initialized");
|
|
76
|
+
}
|
|
77
|
+
const timeTravel = new TimeTravelManager(nodeStore, commitManager);
|
|
78
|
+
try {
|
|
79
|
+
let commitB = args.commitB;
|
|
80
|
+
if (!commitB) {
|
|
81
|
+
const head = await commitManager.getBranchHead();
|
|
82
|
+
if (!head) return errorResult("No commits found - index the project first");
|
|
83
|
+
commitB = head.commitHash;
|
|
84
|
+
}
|
|
85
|
+
const diff = await timeTravel.diffCommits(args.commitA, commitB);
|
|
86
|
+
if (!diff) {
|
|
87
|
+
return errorResult(`Failed to diff commits: one or both commits not found`);
|
|
88
|
+
}
|
|
89
|
+
const result = {
|
|
90
|
+
commitA: args.commitA,
|
|
91
|
+
commitB,
|
|
92
|
+
summary: {
|
|
93
|
+
added: diff.treeDiff.added.length,
|
|
94
|
+
modified: diff.treeDiff.modified.length,
|
|
95
|
+
deleted: diff.treeDiff.deleted.length
|
|
96
|
+
}
|
|
97
|
+
};
|
|
98
|
+
if (args.includeEntities) {
|
|
99
|
+
result["added"] = diff.treeDiff.added.map((e) => ({ key: e.key }));
|
|
100
|
+
result["modified"] = diff.treeDiff.modified.map((e) => ({ key: e.key }));
|
|
101
|
+
result["deleted"] = diff.treeDiff.deleted.map((e) => ({ key: e.key }));
|
|
102
|
+
}
|
|
103
|
+
return {
|
|
104
|
+
content: [{ type: "text", text: JSON.stringify(result, null, 2) }]
|
|
105
|
+
};
|
|
106
|
+
} catch (error) {
|
|
107
|
+
log.e("HISTORY", "diff_commits_failed", { error: error.message });
|
|
108
|
+
return errorResult(`Failed to diff commits: ${error.message}`);
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
};
|
|
112
|
+
var CheckoutCommitToolHandler = class extends BaseToolHandler {
|
|
113
|
+
parseArgs(args) {
|
|
114
|
+
return CheckoutCommitSchema.parse(args);
|
|
115
|
+
}
|
|
116
|
+
async execute(args) {
|
|
117
|
+
const storage = await this.ensureGraphStorageForProject(args.projectPath);
|
|
118
|
+
const adapter = storage.getLibSQLAdapter?.();
|
|
119
|
+
if (!adapter?.getProllyNodeStore || !adapter?.getCommitManager) {
|
|
120
|
+
return errorResult("Prolly Tree not available - ensure project is indexed");
|
|
121
|
+
}
|
|
122
|
+
const nodeStore = adapter.getProllyNodeStore();
|
|
123
|
+
const commitManager = adapter.getCommitManager();
|
|
124
|
+
if (!nodeStore || !commitManager) {
|
|
125
|
+
return errorResult("Prolly Tree components not initialized");
|
|
126
|
+
}
|
|
127
|
+
const timeTravel = new TimeTravelManager(nodeStore, commitManager);
|
|
128
|
+
try {
|
|
129
|
+
const commit = await commitManager.getCommit(args.commitHash);
|
|
130
|
+
if (!commit) {
|
|
131
|
+
return errorResult(`Commit not found: ${args.commitHash}`);
|
|
132
|
+
}
|
|
133
|
+
const result = {
|
|
134
|
+
commit: {
|
|
135
|
+
hash: commit.commitHash,
|
|
136
|
+
message: commit.message,
|
|
137
|
+
entityCount: commit.entityCount,
|
|
138
|
+
relationshipCount: commit.relationshipCount,
|
|
139
|
+
createdAt: new Date(commit.createdAt).toISOString(),
|
|
140
|
+
parentHash: commit.parentHash
|
|
141
|
+
}
|
|
142
|
+
};
|
|
143
|
+
if (args.entityId) {
|
|
144
|
+
const entity = await timeTravel.getEntityAt(args.entityId, args.commitHash);
|
|
145
|
+
result["entity"] = entity;
|
|
146
|
+
}
|
|
147
|
+
if (args.query) {
|
|
148
|
+
const entities = await timeTravel.searchEntitiesAt(args.commitHash, args.query, args.limit);
|
|
149
|
+
result["entities"] = entities.slice(args.offset, args.offset + args.limit);
|
|
150
|
+
result["totalMatches"] = entities.length;
|
|
151
|
+
}
|
|
152
|
+
return {
|
|
153
|
+
content: [{ type: "text", text: JSON.stringify(result, null, 2) }]
|
|
154
|
+
};
|
|
155
|
+
} catch (error) {
|
|
156
|
+
log.e("HISTORY", "checkout_commit_failed", { error: error.message });
|
|
157
|
+
return errorResult(`Failed to checkout commit: ${error.message}`);
|
|
158
|
+
}
|
|
159
|
+
}
|
|
160
|
+
};
|
|
161
|
+
var ListCommitsToolHandler = class extends BaseToolHandler {
|
|
162
|
+
parseArgs(args) {
|
|
163
|
+
return ListCommitsSchema.parse(args);
|
|
164
|
+
}
|
|
165
|
+
async execute(args) {
|
|
166
|
+
const storage = await this.ensureGraphStorageForProject(args.projectPath);
|
|
167
|
+
const adapter = storage.getLibSQLAdapter?.();
|
|
168
|
+
if (!adapter?.getCommitManager) {
|
|
169
|
+
return errorResult("Prolly Tree not available - ensure project is indexed");
|
|
170
|
+
}
|
|
171
|
+
const commitManager = adapter.getCommitManager();
|
|
172
|
+
if (!commitManager) {
|
|
173
|
+
return errorResult("Prolly Tree components not initialized");
|
|
174
|
+
}
|
|
175
|
+
try {
|
|
176
|
+
const history = await commitManager.getHistory(args.limit);
|
|
177
|
+
return {
|
|
178
|
+
content: [
|
|
179
|
+
{
|
|
180
|
+
type: "text",
|
|
181
|
+
text: JSON.stringify(
|
|
182
|
+
{
|
|
183
|
+
commits: history.map((c) => ({
|
|
184
|
+
hash: c.commitHash,
|
|
185
|
+
message: c.message,
|
|
186
|
+
entityCount: c.entityCount,
|
|
187
|
+
relationshipCount: c.relationshipCount,
|
|
188
|
+
createdAt: new Date(c.createdAt).toISOString(),
|
|
189
|
+
parentHash: c.parentHash?.slice(0, 8) || null
|
|
190
|
+
})),
|
|
191
|
+
total: history.length
|
|
192
|
+
},
|
|
193
|
+
null,
|
|
194
|
+
2
|
|
195
|
+
)
|
|
196
|
+
}
|
|
197
|
+
]
|
|
198
|
+
};
|
|
199
|
+
} catch (error) {
|
|
200
|
+
log.e("HISTORY", "list_commits_failed", { error: error.message });
|
|
201
|
+
return errorResult(`Failed to list commits: ${error.message}`);
|
|
202
|
+
}
|
|
203
|
+
}
|
|
204
|
+
};
|
|
205
|
+
|
|
206
|
+
export { CheckoutCommitToolHandler, DiffCommitsToolHandler, GetEntityHistoryToolHandler, ListCommitsToolHandler };
|
|
207
|
+
//# sourceMappingURL=history-tool-handlers-FSNJYXV2.js.map
|
|
208
|
+
//# sourceMappingURL=history-tool-handlers-FSNJYXV2.js.map
|
|
@@ -0,0 +1,208 @@
|
|
|
1
|
+
import { GetEntityHistorySchema, DiffCommitsSchema, CheckoutCommitSchema, ListCommitsSchema } from './chunk-LVCP3H3F.js';
|
|
2
|
+
import './chunk-NJUB245U.js';
|
|
3
|
+
import { BaseToolHandler } from './chunk-Q5LPVLXA.js';
|
|
4
|
+
import './chunk-TCHCDCDO.js';
|
|
5
|
+
import './chunk-HNDYLCWI.js';
|
|
6
|
+
import { TimeTravelManager, deserializeEntity } from './chunk-AIZUHUK6.js';
|
|
7
|
+
import './chunk-LH4OUKNZ.js';
|
|
8
|
+
import './chunk-HEMJHRHZ.js';
|
|
9
|
+
import { init_logging, log } from './chunk-VCCBEJQ5.js';
|
|
10
|
+
import './chunk-NAQKA54E.js';
|
|
11
|
+
|
|
12
|
+
// src/tools/handlers/history-tool-handlers.ts
|
|
13
|
+
init_logging();
|
|
14
|
+
function errorResult(message) {
|
|
15
|
+
return { content: [{ type: "text", text: JSON.stringify({ error: message }) }] };
|
|
16
|
+
}
|
|
17
|
+
var GetEntityHistoryToolHandler = class extends BaseToolHandler {
|
|
18
|
+
parseArgs(args) {
|
|
19
|
+
return GetEntityHistorySchema.parse(args);
|
|
20
|
+
}
|
|
21
|
+
async execute(args) {
|
|
22
|
+
const storage = await this.ensureGraphStorageForProject(args.projectPath);
|
|
23
|
+
const adapter = storage.getLibSQLAdapter?.();
|
|
24
|
+
if (!adapter?.getProllyNodeStore || !adapter?.getCommitManager) {
|
|
25
|
+
return errorResult("Prolly Tree not available - ensure project is indexed");
|
|
26
|
+
}
|
|
27
|
+
const nodeStore = adapter.getProllyNodeStore();
|
|
28
|
+
const commitManager = adapter.getCommitManager();
|
|
29
|
+
if (!nodeStore || !commitManager) {
|
|
30
|
+
return errorResult("Prolly Tree components not initialized");
|
|
31
|
+
}
|
|
32
|
+
const timeTravel = new TimeTravelManager(nodeStore, commitManager);
|
|
33
|
+
try {
|
|
34
|
+
const history = await timeTravel.getEntityHistory(args.entityId, args.limit);
|
|
35
|
+
return {
|
|
36
|
+
content: [
|
|
37
|
+
{
|
|
38
|
+
type: "text",
|
|
39
|
+
text: JSON.stringify(
|
|
40
|
+
{
|
|
41
|
+
entityId: args.entityId,
|
|
42
|
+
changes: history.map((h) => ({
|
|
43
|
+
commitHash: h.commitHash,
|
|
44
|
+
changeType: h.changeType,
|
|
45
|
+
timestamp: new Date(h.timestamp).toISOString(),
|
|
46
|
+
entitySnapshot: h.newValue ? deserializeEntity(h.newValue) : null
|
|
47
|
+
})),
|
|
48
|
+
totalChanges: history.length
|
|
49
|
+
},
|
|
50
|
+
null,
|
|
51
|
+
2
|
|
52
|
+
)
|
|
53
|
+
}
|
|
54
|
+
]
|
|
55
|
+
};
|
|
56
|
+
} catch (error) {
|
|
57
|
+
log.e("HISTORY", "get_entity_history_failed", { error: error.message });
|
|
58
|
+
return errorResult(`Failed to get entity history: ${error.message}`);
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
};
|
|
62
|
+
var DiffCommitsToolHandler = class extends BaseToolHandler {
|
|
63
|
+
parseArgs(args) {
|
|
64
|
+
return DiffCommitsSchema.parse(args);
|
|
65
|
+
}
|
|
66
|
+
async execute(args) {
|
|
67
|
+
const storage = await this.ensureGraphStorageForProject(args.projectPath);
|
|
68
|
+
const adapter = storage.getLibSQLAdapter?.();
|
|
69
|
+
if (!adapter?.getProllyNodeStore || !adapter?.getCommitManager) {
|
|
70
|
+
return errorResult("Prolly Tree not available - ensure project is indexed");
|
|
71
|
+
}
|
|
72
|
+
const nodeStore = adapter.getProllyNodeStore();
|
|
73
|
+
const commitManager = adapter.getCommitManager();
|
|
74
|
+
if (!nodeStore || !commitManager) {
|
|
75
|
+
return errorResult("Prolly Tree components not initialized");
|
|
76
|
+
}
|
|
77
|
+
const timeTravel = new TimeTravelManager(nodeStore, commitManager);
|
|
78
|
+
try {
|
|
79
|
+
let commitB = args.commitB;
|
|
80
|
+
if (!commitB) {
|
|
81
|
+
const head = await commitManager.getBranchHead();
|
|
82
|
+
if (!head) return errorResult("No commits found - index the project first");
|
|
83
|
+
commitB = head.commitHash;
|
|
84
|
+
}
|
|
85
|
+
const diff = await timeTravel.diffCommits(args.commitA, commitB);
|
|
86
|
+
if (!diff) {
|
|
87
|
+
return errorResult(`Failed to diff commits: one or both commits not found`);
|
|
88
|
+
}
|
|
89
|
+
const result = {
|
|
90
|
+
commitA: args.commitA,
|
|
91
|
+
commitB,
|
|
92
|
+
summary: {
|
|
93
|
+
added: diff.treeDiff.added.length,
|
|
94
|
+
modified: diff.treeDiff.modified.length,
|
|
95
|
+
deleted: diff.treeDiff.deleted.length
|
|
96
|
+
}
|
|
97
|
+
};
|
|
98
|
+
if (args.includeEntities) {
|
|
99
|
+
result["added"] = diff.treeDiff.added.map((e) => ({ key: e.key }));
|
|
100
|
+
result["modified"] = diff.treeDiff.modified.map((e) => ({ key: e.key }));
|
|
101
|
+
result["deleted"] = diff.treeDiff.deleted.map((e) => ({ key: e.key }));
|
|
102
|
+
}
|
|
103
|
+
return {
|
|
104
|
+
content: [{ type: "text", text: JSON.stringify(result, null, 2) }]
|
|
105
|
+
};
|
|
106
|
+
} catch (error) {
|
|
107
|
+
log.e("HISTORY", "diff_commits_failed", { error: error.message });
|
|
108
|
+
return errorResult(`Failed to diff commits: ${error.message}`);
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
};
|
|
112
|
+
var CheckoutCommitToolHandler = class extends BaseToolHandler {
|
|
113
|
+
parseArgs(args) {
|
|
114
|
+
return CheckoutCommitSchema.parse(args);
|
|
115
|
+
}
|
|
116
|
+
async execute(args) {
|
|
117
|
+
const storage = await this.ensureGraphStorageForProject(args.projectPath);
|
|
118
|
+
const adapter = storage.getLibSQLAdapter?.();
|
|
119
|
+
if (!adapter?.getProllyNodeStore || !adapter?.getCommitManager) {
|
|
120
|
+
return errorResult("Prolly Tree not available - ensure project is indexed");
|
|
121
|
+
}
|
|
122
|
+
const nodeStore = adapter.getProllyNodeStore();
|
|
123
|
+
const commitManager = adapter.getCommitManager();
|
|
124
|
+
if (!nodeStore || !commitManager) {
|
|
125
|
+
return errorResult("Prolly Tree components not initialized");
|
|
126
|
+
}
|
|
127
|
+
const timeTravel = new TimeTravelManager(nodeStore, commitManager);
|
|
128
|
+
try {
|
|
129
|
+
const commit = await commitManager.getCommit(args.commitHash);
|
|
130
|
+
if (!commit) {
|
|
131
|
+
return errorResult(`Commit not found: ${args.commitHash}`);
|
|
132
|
+
}
|
|
133
|
+
const result = {
|
|
134
|
+
commit: {
|
|
135
|
+
hash: commit.commitHash,
|
|
136
|
+
message: commit.message,
|
|
137
|
+
entityCount: commit.entityCount,
|
|
138
|
+
relationshipCount: commit.relationshipCount,
|
|
139
|
+
createdAt: new Date(commit.createdAt).toISOString(),
|
|
140
|
+
parentHash: commit.parentHash
|
|
141
|
+
}
|
|
142
|
+
};
|
|
143
|
+
if (args.entityId) {
|
|
144
|
+
const entity = await timeTravel.getEntityAt(args.entityId, args.commitHash);
|
|
145
|
+
result["entity"] = entity;
|
|
146
|
+
}
|
|
147
|
+
if (args.query) {
|
|
148
|
+
const entities = await timeTravel.searchEntitiesAt(args.commitHash, args.query, args.limit);
|
|
149
|
+
result["entities"] = entities.slice(args.offset, args.offset + args.limit);
|
|
150
|
+
result["totalMatches"] = entities.length;
|
|
151
|
+
}
|
|
152
|
+
return {
|
|
153
|
+
content: [{ type: "text", text: JSON.stringify(result, null, 2) }]
|
|
154
|
+
};
|
|
155
|
+
} catch (error) {
|
|
156
|
+
log.e("HISTORY", "checkout_commit_failed", { error: error.message });
|
|
157
|
+
return errorResult(`Failed to checkout commit: ${error.message}`);
|
|
158
|
+
}
|
|
159
|
+
}
|
|
160
|
+
};
|
|
161
|
+
var ListCommitsToolHandler = class extends BaseToolHandler {
|
|
162
|
+
parseArgs(args) {
|
|
163
|
+
return ListCommitsSchema.parse(args);
|
|
164
|
+
}
|
|
165
|
+
async execute(args) {
|
|
166
|
+
const storage = await this.ensureGraphStorageForProject(args.projectPath);
|
|
167
|
+
const adapter = storage.getLibSQLAdapter?.();
|
|
168
|
+
if (!adapter?.getCommitManager) {
|
|
169
|
+
return errorResult("Prolly Tree not available - ensure project is indexed");
|
|
170
|
+
}
|
|
171
|
+
const commitManager = adapter.getCommitManager();
|
|
172
|
+
if (!commitManager) {
|
|
173
|
+
return errorResult("Prolly Tree components not initialized");
|
|
174
|
+
}
|
|
175
|
+
try {
|
|
176
|
+
const history = await commitManager.getHistory(args.limit);
|
|
177
|
+
return {
|
|
178
|
+
content: [
|
|
179
|
+
{
|
|
180
|
+
type: "text",
|
|
181
|
+
text: JSON.stringify(
|
|
182
|
+
{
|
|
183
|
+
commits: history.map((c) => ({
|
|
184
|
+
hash: c.commitHash,
|
|
185
|
+
message: c.message,
|
|
186
|
+
entityCount: c.entityCount,
|
|
187
|
+
relationshipCount: c.relationshipCount,
|
|
188
|
+
createdAt: new Date(c.createdAt).toISOString(),
|
|
189
|
+
parentHash: c.parentHash?.slice(0, 8) || null
|
|
190
|
+
})),
|
|
191
|
+
total: history.length
|
|
192
|
+
},
|
|
193
|
+
null,
|
|
194
|
+
2
|
|
195
|
+
)
|
|
196
|
+
}
|
|
197
|
+
]
|
|
198
|
+
};
|
|
199
|
+
} catch (error) {
|
|
200
|
+
log.e("HISTORY", "list_commits_failed", { error: error.message });
|
|
201
|
+
return errorResult(`Failed to list commits: ${error.message}`);
|
|
202
|
+
}
|
|
203
|
+
}
|
|
204
|
+
};
|
|
205
|
+
|
|
206
|
+
export { CheckoutCommitToolHandler, DiffCommitsToolHandler, GetEntityHistoryToolHandler, ListCommitsToolHandler };
|
|
207
|
+
//# sourceMappingURL=history-tool-handlers-JZAH4EIQ.js.map
|
|
208
|
+
//# sourceMappingURL=history-tool-handlers-JZAH4EIQ.js.map
|