spec-gen-cli 1.2.5 → 1.2.7

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 (76) hide show
  1. package/README.md +66 -6
  2. package/dist/api/analyze.d.ts.map +1 -1
  3. package/dist/api/analyze.js +6 -1
  4. package/dist/api/analyze.js.map +1 -1
  5. package/dist/api/audit.d.ts +10 -0
  6. package/dist/api/audit.d.ts.map +1 -0
  7. package/dist/api/audit.js +117 -0
  8. package/dist/api/audit.js.map +1 -0
  9. package/dist/api/generate.d.ts.map +1 -1
  10. package/dist/api/generate.js +9 -1
  11. package/dist/api/generate.js.map +1 -1
  12. package/dist/api/index.d.ts +3 -2
  13. package/dist/api/index.d.ts.map +1 -1
  14. package/dist/api/index.js +1 -0
  15. package/dist/api/index.js.map +1 -1
  16. package/dist/api/run.d.ts.map +1 -1
  17. package/dist/api/run.js +5 -1
  18. package/dist/api/run.js.map +1 -1
  19. package/dist/api/types.d.ts +13 -4
  20. package/dist/api/types.d.ts.map +1 -1
  21. package/dist/cli/commands/audit.d.ts +9 -0
  22. package/dist/cli/commands/audit.d.ts.map +1 -0
  23. package/dist/cli/commands/audit.js +98 -0
  24. package/dist/cli/commands/audit.js.map +1 -0
  25. package/dist/cli/commands/generate.d.ts.map +1 -1
  26. package/dist/cli/commands/generate.js +4 -2
  27. package/dist/cli/commands/generate.js.map +1 -1
  28. package/dist/cli/commands/mcp.d.ts +327 -2
  29. package/dist/cli/commands/mcp.d.ts.map +1 -1
  30. package/dist/cli/commands/mcp.js +147 -3
  31. package/dist/cli/commands/mcp.js.map +1 -1
  32. package/dist/cli/commands/refresh-stories.d.ts +10 -0
  33. package/dist/cli/commands/refresh-stories.d.ts.map +1 -0
  34. package/dist/cli/commands/refresh-stories.js +314 -0
  35. package/dist/cli/commands/refresh-stories.js.map +1 -0
  36. package/dist/cli/index.js +4 -0
  37. package/dist/cli/index.js.map +1 -1
  38. package/dist/constants.d.ts +4 -0
  39. package/dist/constants.d.ts.map +1 -1
  40. package/dist/constants.js +4 -0
  41. package/dist/constants.js.map +1 -1
  42. package/dist/core/analyzer/spec-snapshot-generator.d.ts +17 -0
  43. package/dist/core/analyzer/spec-snapshot-generator.d.ts.map +1 -0
  44. package/dist/core/analyzer/spec-snapshot-generator.js +201 -0
  45. package/dist/core/analyzer/spec-snapshot-generator.js.map +1 -0
  46. package/dist/core/analyzer/unified-search.d.ts +107 -0
  47. package/dist/core/analyzer/unified-search.d.ts.map +1 -0
  48. package/dist/core/analyzer/unified-search.js +237 -0
  49. package/dist/core/analyzer/unified-search.js.map +1 -0
  50. package/dist/core/generator/openspec-format-generator.js +1 -1
  51. package/dist/core/generator/openspec-format-generator.js.map +1 -1
  52. package/dist/core/services/chat-tools.d.ts.map +1 -1
  53. package/dist/core/services/chat-tools.js +54 -6
  54. package/dist/core/services/chat-tools.js.map +1 -1
  55. package/dist/core/services/llm-service.d.ts +18 -1
  56. package/dist/core/services/llm-service.d.ts.map +1 -1
  57. package/dist/core/services/llm-service.js +112 -4
  58. package/dist/core/services/llm-service.js.map +1 -1
  59. package/dist/core/services/mcp-handlers/analysis.d.ts +5 -0
  60. package/dist/core/services/mcp-handlers/analysis.d.ts.map +1 -1
  61. package/dist/core/services/mcp-handlers/analysis.js +20 -0
  62. package/dist/core/services/mcp-handlers/analysis.js.map +1 -1
  63. package/dist/core/services/mcp-handlers/change.d.ts +14 -0
  64. package/dist/core/services/mcp-handlers/change.d.ts.map +1 -0
  65. package/dist/core/services/mcp-handlers/change.js +416 -0
  66. package/dist/core/services/mcp-handlers/change.js.map +1 -0
  67. package/dist/core/services/mcp-handlers/semantic.d.ts +4 -0
  68. package/dist/core/services/mcp-handlers/semantic.d.ts.map +1 -1
  69. package/dist/core/services/mcp-handlers/semantic.js +101 -32
  70. package/dist/core/services/mcp-handlers/semantic.js.map +1 -1
  71. package/dist/types/index.d.ts +70 -1
  72. package/dist/types/index.d.ts.map +1 -1
  73. package/package.json +4 -1
  74. package/src/viewer/InteractiveGraphViewer.jsx +46 -4
  75. package/src/viewer/components/ChatPanel.jsx +2 -3
  76. package/src/viewer/components/ClusterGraph.jsx +22 -6
@@ -20,9 +20,9 @@ import { Command } from 'commander';
20
20
  import { sanitizeMcpError, validateDirectory } from '../../core/services/mcp-handlers/utils.js';
21
21
  import { handleGetCallGraph, handleGetSubgraph, handleAnalyzeImpact, handleGetLowRiskRefactorCandidates, handleGetLeafFunctions, handleGetCriticalHubs, handleGetGodFunctions, handleGetFileDependencies, handleTraceExecutionPath } from '../../core/services/mcp-handlers/graph.js';
22
22
  import { handleSearchCode, handleSuggestInsertionPoints, handleSearchSpecs } from '../../core/services/mcp-handlers/semantic.js';
23
- import { handleAnalyzeCodebase, handleGetArchitectureOverview, handleGetRefactorReport, handleGetDuplicateReport, handleGetSignatures, handleGetMapping, handleCheckSpecDrift, handleGetFunctionSkeleton } from '../../core/services/mcp-handlers/analysis.js';
23
+ import { handleAnalyzeCodebase, handleGetArchitectureOverview, handleGetRefactorReport, handleGetDuplicateReport, handleGetSignatures, handleGetMapping, handleCheckSpecDrift, handleGetFunctionSkeleton, handleAuditSpecCoverage } from '../../core/services/mcp-handlers/analysis.js';
24
24
  export { sanitizeMcpError, validateDirectory };
25
- export { handleGetCallGraph, handleGetSubgraph, handleAnalyzeImpact, handleGetLowRiskRefactorCandidates, handleGetLeafFunctions, handleGetCriticalHubs, handleGetGodFunctions, handleGetFileDependencies, handleTraceExecutionPath, handleSearchCode, handleSuggestInsertionPoints, handleSearchSpecs, handleAnalyzeCodebase, handleGetArchitectureOverview, handleGetRefactorReport, handleGetDuplicateReport, handleGetSignatures, handleGetMapping, handleCheckSpecDrift, handleGetFunctionSkeleton, };
25
+ export { handleGetCallGraph, handleGetSubgraph, handleAnalyzeImpact, handleGetLowRiskRefactorCandidates, handleGetLeafFunctions, handleGetCriticalHubs, handleGetGodFunctions, handleGetFileDependencies, handleTraceExecutionPath, handleSearchCode, handleSuggestInsertionPoints, handleSearchSpecs, handleAnalyzeCodebase, handleGetArchitectureOverview, handleGetRefactorReport, handleGetDuplicateReport, handleGetSignatures, handleGetMapping, handleCheckSpecDrift, handleGetFunctionSkeleton, handleAuditSpecCoverage, };
26
26
  export declare const TOOL_DEFINITIONS: ({
27
27
  name: string;
28
28
  description: string;
@@ -67,6 +67,11 @@ export declare const TOOL_DEFINITIONS: ({
67
67
  language?: undefined;
68
68
  query?: undefined;
69
69
  section?: undefined;
70
+ slug?: undefined;
71
+ storyContent?: undefined;
72
+ storyFilePath?: undefined;
73
+ maxUncovered?: undefined;
74
+ hubThreshold?: undefined;
70
75
  };
71
76
  required: string[];
72
77
  };
@@ -111,6 +116,11 @@ export declare const TOOL_DEFINITIONS: ({
111
116
  language?: undefined;
112
117
  query?: undefined;
113
118
  section?: undefined;
119
+ slug?: undefined;
120
+ storyContent?: undefined;
121
+ storyFilePath?: undefined;
122
+ maxUncovered?: undefined;
123
+ hubThreshold?: undefined;
114
124
  };
115
125
  required: string[];
116
126
  };
@@ -152,6 +162,11 @@ export declare const TOOL_DEFINITIONS: ({
152
162
  language?: undefined;
153
163
  query?: undefined;
154
164
  section?: undefined;
165
+ slug?: undefined;
166
+ storyContent?: undefined;
167
+ storyFilePath?: undefined;
168
+ maxUncovered?: undefined;
169
+ hubThreshold?: undefined;
155
170
  };
156
171
  required: string[];
157
172
  };
@@ -196,6 +211,11 @@ export declare const TOOL_DEFINITIONS: ({
196
211
  language?: undefined;
197
212
  query?: undefined;
198
213
  section?: undefined;
214
+ slug?: undefined;
215
+ storyContent?: undefined;
216
+ storyFilePath?: undefined;
217
+ maxUncovered?: undefined;
218
+ hubThreshold?: undefined;
199
219
  };
200
220
  required: string[];
201
221
  };
@@ -251,6 +271,11 @@ export declare const TOOL_DEFINITIONS: ({
251
271
  language?: undefined;
252
272
  query?: undefined;
253
273
  section?: undefined;
274
+ slug?: undefined;
275
+ storyContent?: undefined;
276
+ storyFilePath?: undefined;
277
+ maxUncovered?: undefined;
278
+ hubThreshold?: undefined;
254
279
  };
255
280
  required: string[];
256
281
  };
@@ -304,6 +329,11 @@ export declare const TOOL_DEFINITIONS: ({
304
329
  language?: undefined;
305
330
  query?: undefined;
306
331
  section?: undefined;
332
+ slug?: undefined;
333
+ storyContent?: undefined;
334
+ storyFilePath?: undefined;
335
+ maxUncovered?: undefined;
336
+ hubThreshold?: undefined;
307
337
  };
308
338
  required: string[];
309
339
  };
@@ -351,6 +381,11 @@ export declare const TOOL_DEFINITIONS: ({
351
381
  language?: undefined;
352
382
  query?: undefined;
353
383
  section?: undefined;
384
+ slug?: undefined;
385
+ storyContent?: undefined;
386
+ storyFilePath?: undefined;
387
+ maxUncovered?: undefined;
388
+ hubThreshold?: undefined;
354
389
  };
355
390
  required: string[];
356
391
  };
@@ -414,6 +449,11 @@ export declare const TOOL_DEFINITIONS: ({
414
449
  language?: undefined;
415
450
  query?: undefined;
416
451
  section?: undefined;
452
+ slug?: undefined;
453
+ storyContent?: undefined;
454
+ storyFilePath?: undefined;
455
+ maxUncovered?: undefined;
456
+ hubThreshold?: undefined;
417
457
  };
418
458
  required: string[];
419
459
  };
@@ -461,6 +501,11 @@ export declare const TOOL_DEFINITIONS: ({
461
501
  language?: undefined;
462
502
  query?: undefined;
463
503
  section?: undefined;
504
+ slug?: undefined;
505
+ storyContent?: undefined;
506
+ storyFilePath?: undefined;
507
+ maxUncovered?: undefined;
508
+ hubThreshold?: undefined;
464
509
  };
465
510
  required: string[];
466
511
  };
@@ -508,6 +553,11 @@ export declare const TOOL_DEFINITIONS: ({
508
553
  language?: undefined;
509
554
  query?: undefined;
510
555
  section?: undefined;
556
+ slug?: undefined;
557
+ storyContent?: undefined;
558
+ storyFilePath?: undefined;
559
+ maxUncovered?: undefined;
560
+ hubThreshold?: undefined;
511
561
  };
512
562
  required: string[];
513
563
  };
@@ -559,6 +609,11 @@ export declare const TOOL_DEFINITIONS: ({
559
609
  language?: undefined;
560
610
  query?: undefined;
561
611
  section?: undefined;
612
+ slug?: undefined;
613
+ storyContent?: undefined;
614
+ storyFilePath?: undefined;
615
+ maxUncovered?: undefined;
616
+ hubThreshold?: undefined;
562
617
  };
563
618
  required: string[];
564
619
  };
@@ -606,6 +661,11 @@ export declare const TOOL_DEFINITIONS: ({
606
661
  language?: undefined;
607
662
  query?: undefined;
608
663
  section?: undefined;
664
+ slug?: undefined;
665
+ storyContent?: undefined;
666
+ storyFilePath?: undefined;
667
+ maxUncovered?: undefined;
668
+ hubThreshold?: undefined;
609
669
  };
610
670
  required: string[];
611
671
  };
@@ -650,6 +710,11 @@ export declare const TOOL_DEFINITIONS: ({
650
710
  language?: undefined;
651
711
  query?: undefined;
652
712
  section?: undefined;
713
+ slug?: undefined;
714
+ storyContent?: undefined;
715
+ storyFilePath?: undefined;
716
+ maxUncovered?: undefined;
717
+ hubThreshold?: undefined;
653
718
  };
654
719
  required: string[];
655
720
  };
@@ -697,6 +762,11 @@ export declare const TOOL_DEFINITIONS: ({
697
762
  language?: undefined;
698
763
  query?: undefined;
699
764
  section?: undefined;
765
+ slug?: undefined;
766
+ storyContent?: undefined;
767
+ storyFilePath?: undefined;
768
+ maxUncovered?: undefined;
769
+ hubThreshold?: undefined;
700
770
  };
701
771
  required: string[];
702
772
  };
@@ -747,6 +817,11 @@ export declare const TOOL_DEFINITIONS: ({
747
817
  fanOutThreshold?: undefined;
748
818
  query?: undefined;
749
819
  section?: undefined;
820
+ slug?: undefined;
821
+ storyContent?: undefined;
822
+ storyFilePath?: undefined;
823
+ maxUncovered?: undefined;
824
+ hubThreshold?: undefined;
750
825
  };
751
826
  required: string[];
752
827
  };
@@ -800,6 +875,11 @@ export declare const TOOL_DEFINITIONS: ({
800
875
  fanOutThreshold?: undefined;
801
876
  description?: undefined;
802
877
  section?: undefined;
878
+ slug?: undefined;
879
+ storyContent?: undefined;
880
+ storyFilePath?: undefined;
881
+ maxUncovered?: undefined;
882
+ hubThreshold?: undefined;
803
883
  };
804
884
  required: string[];
805
885
  };
@@ -853,6 +933,72 @@ export declare const TOOL_DEFINITIONS: ({
853
933
  fanOutThreshold?: undefined;
854
934
  description?: undefined;
855
935
  language?: undefined;
936
+ slug?: undefined;
937
+ storyContent?: undefined;
938
+ storyFilePath?: undefined;
939
+ maxUncovered?: undefined;
940
+ hubThreshold?: undefined;
941
+ };
942
+ required: string[];
943
+ };
944
+ } | {
945
+ name: string;
946
+ description: string;
947
+ inputSchema: {
948
+ type: string;
949
+ properties: {
950
+ directory: {
951
+ type: string;
952
+ description: string;
953
+ };
954
+ query: {
955
+ type: string;
956
+ description: string;
957
+ };
958
+ limit: {
959
+ type: string;
960
+ description: string;
961
+ };
962
+ language: {
963
+ type: string;
964
+ description: string;
965
+ };
966
+ domain: {
967
+ type: string;
968
+ description: string;
969
+ };
970
+ section: {
971
+ type: string;
972
+ description: string;
973
+ };
974
+ task?: undefined;
975
+ force?: undefined;
976
+ filePattern?: undefined;
977
+ functionName?: undefined;
978
+ direction?: undefined;
979
+ maxDepth?: undefined;
980
+ format?: undefined;
981
+ entryFunction?: undefined;
982
+ targetFunction?: undefined;
983
+ maxPaths?: undefined;
984
+ orphansOnly?: undefined;
985
+ base?: undefined;
986
+ files?: undefined;
987
+ domains?: undefined;
988
+ failOn?: undefined;
989
+ maxFiles?: undefined;
990
+ symbol?: undefined;
991
+ depth?: undefined;
992
+ sortBy?: undefined;
993
+ minFanIn?: undefined;
994
+ filePath?: undefined;
995
+ fanOutThreshold?: undefined;
996
+ description?: undefined;
997
+ slug?: undefined;
998
+ storyContent?: undefined;
999
+ storyFilePath?: undefined;
1000
+ maxUncovered?: undefined;
1001
+ hubThreshold?: undefined;
856
1002
  };
857
1003
  required: string[];
858
1004
  };
@@ -897,6 +1043,11 @@ export declare const TOOL_DEFINITIONS: ({
897
1043
  language?: undefined;
898
1044
  query?: undefined;
899
1045
  section?: undefined;
1046
+ slug?: undefined;
1047
+ storyContent?: undefined;
1048
+ storyFilePath?: undefined;
1049
+ maxUncovered?: undefined;
1050
+ hubThreshold?: undefined;
900
1051
  };
901
1052
  required: string[];
902
1053
  };
@@ -944,6 +1095,11 @@ export declare const TOOL_DEFINITIONS: ({
944
1095
  language?: undefined;
945
1096
  query?: undefined;
946
1097
  section?: undefined;
1098
+ slug?: undefined;
1099
+ storyContent?: undefined;
1100
+ storyFilePath?: undefined;
1101
+ maxUncovered?: undefined;
1102
+ hubThreshold?: undefined;
947
1103
  };
948
1104
  required: string[];
949
1105
  };
@@ -992,6 +1148,118 @@ export declare const TOOL_DEFINITIONS: ({
992
1148
  language?: undefined;
993
1149
  query?: undefined;
994
1150
  section?: undefined;
1151
+ slug?: undefined;
1152
+ storyContent?: undefined;
1153
+ storyFilePath?: undefined;
1154
+ maxUncovered?: undefined;
1155
+ hubThreshold?: undefined;
1156
+ };
1157
+ required: string[];
1158
+ };
1159
+ } | {
1160
+ name: string;
1161
+ description: string;
1162
+ inputSchema: {
1163
+ type: string;
1164
+ properties: {
1165
+ directory: {
1166
+ type: string;
1167
+ description: string;
1168
+ };
1169
+ description: {
1170
+ type: string;
1171
+ description: string;
1172
+ };
1173
+ slug: {
1174
+ type: string;
1175
+ description: string;
1176
+ };
1177
+ storyContent: {
1178
+ type: string;
1179
+ description: string;
1180
+ };
1181
+ task?: undefined;
1182
+ limit?: undefined;
1183
+ force?: undefined;
1184
+ filePattern?: undefined;
1185
+ functionName?: undefined;
1186
+ direction?: undefined;
1187
+ maxDepth?: undefined;
1188
+ format?: undefined;
1189
+ entryFunction?: undefined;
1190
+ targetFunction?: undefined;
1191
+ maxPaths?: undefined;
1192
+ domain?: undefined;
1193
+ orphansOnly?: undefined;
1194
+ base?: undefined;
1195
+ files?: undefined;
1196
+ domains?: undefined;
1197
+ failOn?: undefined;
1198
+ maxFiles?: undefined;
1199
+ symbol?: undefined;
1200
+ depth?: undefined;
1201
+ sortBy?: undefined;
1202
+ minFanIn?: undefined;
1203
+ filePath?: undefined;
1204
+ fanOutThreshold?: undefined;
1205
+ language?: undefined;
1206
+ query?: undefined;
1207
+ section?: undefined;
1208
+ storyFilePath?: undefined;
1209
+ maxUncovered?: undefined;
1210
+ hubThreshold?: undefined;
1211
+ };
1212
+ required: string[];
1213
+ };
1214
+ } | {
1215
+ name: string;
1216
+ description: string;
1217
+ inputSchema: {
1218
+ type: string;
1219
+ properties: {
1220
+ directory: {
1221
+ type: string;
1222
+ description: string;
1223
+ };
1224
+ storyFilePath: {
1225
+ type: string;
1226
+ description: string;
1227
+ };
1228
+ description: {
1229
+ type: string;
1230
+ description: string;
1231
+ };
1232
+ task?: undefined;
1233
+ limit?: undefined;
1234
+ force?: undefined;
1235
+ filePattern?: undefined;
1236
+ functionName?: undefined;
1237
+ direction?: undefined;
1238
+ maxDepth?: undefined;
1239
+ format?: undefined;
1240
+ entryFunction?: undefined;
1241
+ targetFunction?: undefined;
1242
+ maxPaths?: undefined;
1243
+ domain?: undefined;
1244
+ orphansOnly?: undefined;
1245
+ base?: undefined;
1246
+ files?: undefined;
1247
+ domains?: undefined;
1248
+ failOn?: undefined;
1249
+ maxFiles?: undefined;
1250
+ symbol?: undefined;
1251
+ depth?: undefined;
1252
+ sortBy?: undefined;
1253
+ minFanIn?: undefined;
1254
+ filePath?: undefined;
1255
+ fanOutThreshold?: undefined;
1256
+ language?: undefined;
1257
+ query?: undefined;
1258
+ section?: undefined;
1259
+ slug?: undefined;
1260
+ storyContent?: undefined;
1261
+ maxUncovered?: undefined;
1262
+ hubThreshold?: undefined;
995
1263
  };
996
1264
  required: string[];
997
1265
  };
@@ -1036,6 +1304,63 @@ export declare const TOOL_DEFINITIONS: ({
1036
1304
  description?: undefined;
1037
1305
  language?: undefined;
1038
1306
  section?: undefined;
1307
+ slug?: undefined;
1308
+ storyContent?: undefined;
1309
+ storyFilePath?: undefined;
1310
+ maxUncovered?: undefined;
1311
+ hubThreshold?: undefined;
1312
+ };
1313
+ required: string[];
1314
+ };
1315
+ } | {
1316
+ name: string;
1317
+ description: string;
1318
+ inputSchema: {
1319
+ type: string;
1320
+ properties: {
1321
+ directory: {
1322
+ type: string;
1323
+ description: string;
1324
+ };
1325
+ maxUncovered: {
1326
+ type: string;
1327
+ description: string;
1328
+ };
1329
+ hubThreshold: {
1330
+ type: string;
1331
+ description: string;
1332
+ };
1333
+ task?: undefined;
1334
+ limit?: undefined;
1335
+ force?: undefined;
1336
+ filePattern?: undefined;
1337
+ functionName?: undefined;
1338
+ direction?: undefined;
1339
+ maxDepth?: undefined;
1340
+ format?: undefined;
1341
+ entryFunction?: undefined;
1342
+ targetFunction?: undefined;
1343
+ maxPaths?: undefined;
1344
+ domain?: undefined;
1345
+ orphansOnly?: undefined;
1346
+ base?: undefined;
1347
+ files?: undefined;
1348
+ domains?: undefined;
1349
+ failOn?: undefined;
1350
+ maxFiles?: undefined;
1351
+ symbol?: undefined;
1352
+ depth?: undefined;
1353
+ sortBy?: undefined;
1354
+ minFanIn?: undefined;
1355
+ filePath?: undefined;
1356
+ fanOutThreshold?: undefined;
1357
+ description?: undefined;
1358
+ language?: undefined;
1359
+ query?: undefined;
1360
+ section?: undefined;
1361
+ slug?: undefined;
1362
+ storyContent?: undefined;
1363
+ storyFilePath?: undefined;
1039
1364
  };
1040
1365
  required: string[];
1041
1366
  };
@@ -1 +1 @@
1
- {"version":3,"file":"mcp.d.ts","sourceRoot":"","sources":["../../../src/cli/commands/mcp.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AAEH,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAQpC,OAAO,EAAE,gBAAgB,EAAE,iBAAiB,EAAE,MAAM,2CAA2C,CAAC;AAEhG,OAAO,EACL,kBAAkB,EAClB,iBAAiB,EACjB,mBAAmB,EACnB,kCAAkC,EAClC,sBAAsB,EACtB,qBAAqB,EACrB,qBAAqB,EACrB,yBAAyB,EACzB,wBAAwB,EACzB,MAAM,2CAA2C,CAAC;AACnD,OAAO,EACL,gBAAgB,EAChB,4BAA4B,EAC5B,iBAAiB,EAGlB,MAAM,8CAA8C,CAAC;AAEtD,OAAO,EACL,qBAAqB,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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IA8wB5B,CAAC;AAmMF,eAAO,MAAM,UAAU,SAK0C,CAAC"}
@@ -23,13 +23,14 @@ import { CallToolRequestSchema, ListToolsRequestSchema, } from '@modelcontextpro
23
23
  import { sanitizeMcpError, validateDirectory } from '../../core/services/mcp-handlers/utils.js';
24
24
  import { DEFAULT_DRIFT_MAX_FILES } from '../../constants.js';
25
25
  import { handleGetCallGraph, handleGetSubgraph, handleAnalyzeImpact, handleGetLowRiskRefactorCandidates, handleGetLeafFunctions, handleGetCriticalHubs, handleGetGodFunctions, handleGetFileDependencies, handleTraceExecutionPath, } from '../../core/services/mcp-handlers/graph.js';
26
- import { handleSearchCode, handleSuggestInsertionPoints, handleSearchSpecs, handleListSpecDomains, handleGetSpec, } from '../../core/services/mcp-handlers/semantic.js';
26
+ import { handleSearchCode, handleSuggestInsertionPoints, handleSearchSpecs, handleListSpecDomains, handleGetSpec, handleUnifiedSearch, } from '../../core/services/mcp-handlers/semantic.js';
27
27
  import { handleOrient } from '../../core/services/mcp-handlers/orient.js';
28
- import { handleAnalyzeCodebase, handleGetArchitectureOverview, handleGetRefactorReport, handleGetDuplicateReport, handleGetSignatures, handleGetMapping, handleCheckSpecDrift, handleGetFunctionSkeleton, handleGetFunctionBody, handleGetDecisions, } from '../../core/services/mcp-handlers/analysis.js';
28
+ import { handleGenerateChangeProposal, handleAnnotateStory } from '../../core/services/mcp-handlers/change.js';
29
+ import { handleAnalyzeCodebase, handleGetArchitectureOverview, handleGetRefactorReport, handleGetDuplicateReport, handleGetSignatures, handleGetMapping, handleCheckSpecDrift, handleGetFunctionSkeleton, handleGetFunctionBody, handleGetDecisions, handleAuditSpecCoverage, } from '../../core/services/mcp-handlers/analysis.js';
29
30
  // Re-export utilities for tests
30
31
  export { sanitizeMcpError, validateDirectory };
31
32
  // Re-export handlers for use by chat-tools.ts and tests
32
- export { handleGetCallGraph, handleGetSubgraph, handleAnalyzeImpact, handleGetLowRiskRefactorCandidates, handleGetLeafFunctions, handleGetCriticalHubs, handleGetGodFunctions, handleGetFileDependencies, handleTraceExecutionPath, handleSearchCode, handleSuggestInsertionPoints, handleSearchSpecs, handleAnalyzeCodebase, handleGetArchitectureOverview, handleGetRefactorReport, handleGetDuplicateReport, handleGetSignatures, handleGetMapping, handleCheckSpecDrift, handleGetFunctionSkeleton, };
33
+ export { handleGetCallGraph, handleGetSubgraph, handleAnalyzeImpact, handleGetLowRiskRefactorCandidates, handleGetLeafFunctions, handleGetCriticalHubs, handleGetGodFunctions, handleGetFileDependencies, handleTraceExecutionPath, handleSearchCode, handleSuggestInsertionPoints, handleSearchSpecs, handleAnalyzeCodebase, handleGetArchitectureOverview, handleGetRefactorReport, handleGetDuplicateReport, handleGetSignatures, handleGetMapping, handleCheckSpecDrift, handleGetFunctionSkeleton, handleAuditSpecCoverage, };
33
34
  // ============================================================================
34
35
  // TOOL DEFINITIONS
35
36
  // ============================================================================
@@ -569,6 +570,45 @@ export const TOOL_DEFINITIONS = [
569
570
  required: ['directory', 'query'],
570
571
  },
571
572
  },
573
+ {
574
+ name: 'search_unified',
575
+ description: 'USE THIS WHEN: you want to find where something is implemented AND what the spec says about it ' +
576
+ 'in a single call. Searches both code functions and spec requirements simultaneously, then ' +
577
+ 'cross-boosts results that are linked through mapping.json — so a function that implements a ' +
578
+ 'matching requirement ranks higher than one found by code search alone. ' +
579
+ 'Returns results with type "code", "spec", or "both" and a mappingBoost score. ' +
580
+ 'Requires "spec-gen analyze --embed" and a prior "spec-gen generate" run.',
581
+ inputSchema: {
582
+ type: 'object',
583
+ properties: {
584
+ directory: {
585
+ type: 'string',
586
+ description: 'Absolute path to the project directory',
587
+ },
588
+ query: {
589
+ type: 'string',
590
+ description: 'Natural language query, e.g. "validate user authentication"',
591
+ },
592
+ limit: {
593
+ type: 'number',
594
+ description: 'Maximum number of results to return (default: 10)',
595
+ },
596
+ language: {
597
+ type: 'string',
598
+ description: 'Filter code results by language (e.g. "TypeScript")',
599
+ },
600
+ domain: {
601
+ type: 'string',
602
+ description: 'Filter spec results by domain name',
603
+ },
604
+ section: {
605
+ type: 'string',
606
+ description: 'Filter spec results by section type: "requirements", "purpose", etc.',
607
+ },
608
+ },
609
+ required: ['directory', 'query'],
610
+ },
611
+ },
572
612
  {
573
613
  name: 'get_spec',
574
614
  description: 'Return the full content of a spec domain\'s specification file (spec.md) and the ' +
@@ -632,6 +672,69 @@ export const TOOL_DEFINITIONS = [
632
672
  required: ['directory', 'filePath'],
633
673
  },
634
674
  },
675
+ {
676
+ name: 'generate_change_proposal',
677
+ description: 'USE THIS WHEN: you have a BMAD story, a feature description, or a spec delta request, ' +
678
+ 'and want to create a structured OpenSpec change proposal before writing any code. ' +
679
+ 'Combines orient + search_specs + analyze_impact to produce a pre-filled ' +
680
+ 'openspec/changes/{slug}/proposal.md — no LLM required. ' +
681
+ 'Output includes affected domains, touched requirements, risk scores, and insertion points. ' +
682
+ 'Run analyze_codebase first; spec index optional (degrades gracefully).',
683
+ inputSchema: {
684
+ type: 'object',
685
+ properties: {
686
+ directory: {
687
+ type: 'string',
688
+ description: 'Absolute path to the project directory',
689
+ },
690
+ description: {
691
+ type: 'string',
692
+ description: 'Intent of the change — story title + primary AC, or a free-form feature description. ' +
693
+ 'e.g. "add retry logic to payment processing — must retry up to 3 times on timeout"',
694
+ },
695
+ slug: {
696
+ type: 'string',
697
+ description: 'Change identifier used as the directory name, e.g. "add-payment-retry". ' +
698
+ 'Will be lowercased and hyphenated automatically.',
699
+ },
700
+ storyContent: {
701
+ type: 'string',
702
+ description: 'Optional: full BMAD story content (markdown). If provided, it is embedded verbatim ' +
703
+ 'in the proposal for traceability.',
704
+ },
705
+ },
706
+ required: ['directory', 'description', 'slug'],
707
+ },
708
+ },
709
+ {
710
+ name: 'annotate_story',
711
+ description: 'USE THIS WHEN: you have a BMAD story file and want to auto-populate its risk_context ' +
712
+ 'section with structural analysis from the codebase. ' +
713
+ 'Reads the story file, runs orient + analyze_impact, writes the risk_context block ' +
714
+ 'directly into the file (replaces existing section or inserts it). ' +
715
+ 'Run by the Architect Agent after writing stories — eliminates manual copy-paste of ' +
716
+ 'generate_change_proposal output. Run analyze_codebase first.',
717
+ inputSchema: {
718
+ type: 'object',
719
+ properties: {
720
+ directory: {
721
+ type: 'string',
722
+ description: 'Absolute path to the project directory',
723
+ },
724
+ storyFilePath: {
725
+ type: 'string',
726
+ description: 'Path to the BMAD story markdown file — relative to the project directory ' +
727
+ 'or absolute. e.g. ".bmad-method/stories/001-add-payment-retry.md"',
728
+ },
729
+ description: {
730
+ type: 'string',
731
+ description: 'Story intent for structural analysis — use story title + primary AC. ' +
732
+ 'e.g. "add payment retry — must retry up to 3 times on timeout"',
733
+ },
734
+ },
735
+ required: ['directory', 'storyFilePath', 'description'],
736
+ },
737
+ },
635
738
  {
636
739
  name: 'get_decisions',
637
740
  description: 'List or search Architecture Decision Records (ADRs) stored in openspec/decisions/. ' +
@@ -650,6 +753,31 @@ export const TOOL_DEFINITIONS = [
650
753
  required: ['directory'],
651
754
  },
652
755
  },
756
+ {
757
+ name: 'audit_spec_coverage',
758
+ description: 'Parity audit: report spec coverage gaps without any LLM call. ' +
759
+ 'Returns uncovered functions (exist in call graph but have no spec), ' +
760
+ 'hub gaps (high fan-in functions with no spec), ' +
761
+ 'orphan requirements (spec requirements with no mapped implementation), ' +
762
+ 'and stale domains (source files changed after spec was last written). ' +
763
+ 'Use this before starting a new feature to understand what needs specs, ' +
764
+ 'or to audit coverage health. Requires "spec-gen analyze" to have been run.',
765
+ inputSchema: {
766
+ type: 'object',
767
+ properties: {
768
+ directory: { type: 'string', description: 'Absolute path to the project directory' },
769
+ maxUncovered: {
770
+ type: 'number',
771
+ description: 'Maximum uncovered functions to return (default: 50)',
772
+ },
773
+ hubThreshold: {
774
+ type: 'number',
775
+ description: 'Minimum fanIn to flag a function as a hub gap (default: 5)',
776
+ },
777
+ },
778
+ required: ['directory'],
779
+ },
780
+ },
653
781
  ];
654
782
  async function startMcpServer(options = {}) {
655
783
  const server = new Server({ name: 'spec-gen', version: '1.0.0' }, { capabilities: { tools: {} } });
@@ -758,6 +886,10 @@ async function startMcpServer(options = {}) {
758
886
  const { directory, query, limit = 10, domain, section } = args;
759
887
  result = await handleSearchSpecs(directory, query, limit, domain, section);
760
888
  }
889
+ else if (name === 'search_unified') {
890
+ const { directory, query, limit = 10, language, domain, section } = args;
891
+ result = await handleUnifiedSearch(directory, query, limit, language, domain, section);
892
+ }
761
893
  else if (name === 'list_spec_domains') {
762
894
  const { directory } = args;
763
895
  result = await handleListSpecDomains(directory);
@@ -774,10 +906,22 @@ async function startMcpServer(options = {}) {
774
906
  const { directory, filePath, direction = 'both' } = args;
775
907
  result = await handleGetFileDependencies(directory, filePath, direction);
776
908
  }
909
+ else if (name === 'generate_change_proposal') {
910
+ const { directory, description, slug, storyContent } = args;
911
+ result = await handleGenerateChangeProposal(directory, description, slug, storyContent);
912
+ }
913
+ else if (name === 'annotate_story') {
914
+ const { directory, storyFilePath, description } = args;
915
+ result = await handleAnnotateStory(directory, storyFilePath, description);
916
+ }
777
917
  else if (name === 'get_decisions') {
778
918
  const { directory, query } = args;
779
919
  result = await handleGetDecisions(directory, query);
780
920
  }
921
+ else if (name === 'audit_spec_coverage') {
922
+ const { directory, maxUncovered = 50, hubThreshold = 5 } = args;
923
+ result = await handleAuditSpecCoverage(directory, maxUncovered, hubThreshold);
924
+ }
781
925
  else {
782
926
  return {
783
927
  content: [{ type: 'text', text: `Unknown tool: ${name}` }],