openlore 2.0.8 → 2.0.10

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 (91) hide show
  1. package/README.md +51 -6
  2. package/dist/api/init.d.ts.map +1 -1
  3. package/dist/api/init.js +9 -2
  4. package/dist/api/init.js.map +1 -1
  5. package/dist/cli/commands/analyze.d.ts.map +1 -1
  6. package/dist/cli/commands/analyze.js +5 -3
  7. package/dist/cli/commands/analyze.js.map +1 -1
  8. package/dist/cli/commands/decisions.d.ts +0 -1
  9. package/dist/cli/commands/decisions.d.ts.map +1 -1
  10. package/dist/cli/commands/decisions.js +19 -31
  11. package/dist/cli/commands/decisions.js.map +1 -1
  12. package/dist/cli/commands/doctor.d.ts.map +1 -1
  13. package/dist/cli/commands/doctor.js +85 -23
  14. package/dist/cli/commands/doctor.js.map +1 -1
  15. package/dist/cli/commands/init.d.ts.map +1 -1
  16. package/dist/cli/commands/init.js +16 -3
  17. package/dist/cli/commands/init.js.map +1 -1
  18. package/dist/cli/commands/mcp.d.ts +85 -0
  19. package/dist/cli/commands/mcp.d.ts.map +1 -1
  20. package/dist/cli/commands/mcp.js +69 -53
  21. package/dist/cli/commands/mcp.js.map +1 -1
  22. package/dist/cli/commands/orient.d.ts.map +1 -1
  23. package/dist/cli/commands/orient.js +31 -2
  24. package/dist/cli/commands/orient.js.map +1 -1
  25. package/dist/cli/commands/prove.d.ts +29 -0
  26. package/dist/cli/commands/prove.d.ts.map +1 -0
  27. package/dist/cli/commands/prove.js +160 -0
  28. package/dist/cli/commands/prove.js.map +1 -0
  29. package/dist/cli/commands/setup.d.ts.map +1 -1
  30. package/dist/cli/commands/setup.js +5 -3
  31. package/dist/cli/commands/setup.js.map +1 -1
  32. package/dist/cli/index.js +2 -0
  33. package/dist/cli/index.js.map +1 -1
  34. package/dist/cli/install/adapters/claude-code.d.ts +8 -2
  35. package/dist/cli/install/adapters/claude-code.d.ts.map +1 -1
  36. package/dist/cli/install/adapters/claude-code.js +99 -35
  37. package/dist/cli/install/adapters/claude-code.js.map +1 -1
  38. package/dist/cli/install/detect.d.ts.map +1 -1
  39. package/dist/cli/install/detect.js +14 -0
  40. package/dist/cli/install/detect.js.map +1 -1
  41. package/dist/cli/install/templates/agent-instructions.md +2 -2
  42. package/dist/constants.d.ts +10 -3
  43. package/dist/constants.d.ts.map +1 -1
  44. package/dist/constants.js +10 -3
  45. package/dist/constants.js.map +1 -1
  46. package/dist/core/agent-eval/measure.d.ts +57 -0
  47. package/dist/core/agent-eval/measure.d.ts.map +1 -0
  48. package/dist/core/agent-eval/measure.js +85 -0
  49. package/dist/core/agent-eval/measure.js.map +1 -0
  50. package/dist/core/agent-eval/scorecard.d.ts +37 -0
  51. package/dist/core/agent-eval/scorecard.d.ts.map +1 -0
  52. package/dist/core/agent-eval/scorecard.js +70 -0
  53. package/dist/core/agent-eval/scorecard.js.map +1 -0
  54. package/dist/core/agent-eval/tasks.d.ts +37 -0
  55. package/dist/core/agent-eval/tasks.d.ts.map +1 -0
  56. package/dist/core/agent-eval/tasks.js +76 -0
  57. package/dist/core/agent-eval/tasks.js.map +1 -0
  58. package/dist/core/analyzer/architecture-writer.d.ts +5 -3
  59. package/dist/core/analyzer/architecture-writer.d.ts.map +1 -1
  60. package/dist/core/analyzer/architecture-writer.js +6 -4
  61. package/dist/core/analyzer/architecture-writer.js.map +1 -1
  62. package/dist/core/analyzer/call-graph.d.ts.map +1 -1
  63. package/dist/core/analyzer/call-graph.js +3 -1
  64. package/dist/core/analyzer/call-graph.js.map +1 -1
  65. package/dist/core/analyzer/spec-vector-index.d.ts.map +1 -1
  66. package/dist/core/analyzer/spec-vector-index.js +6 -2
  67. package/dist/core/analyzer/spec-vector-index.js.map +1 -1
  68. package/dist/core/services/config-manager.d.ts +17 -0
  69. package/dist/core/services/config-manager.d.ts.map +1 -1
  70. package/dist/core/services/config-manager.js +35 -1
  71. package/dist/core/services/config-manager.js.map +1 -1
  72. package/dist/core/services/mcp-handlers/orient.d.ts +1 -1
  73. package/dist/core/services/mcp-handlers/orient.d.ts.map +1 -1
  74. package/dist/core/services/mcp-handlers/orient.js +146 -109
  75. package/dist/core/services/mcp-handlers/orient.js.map +1 -1
  76. package/dist/core/services/mcp-handlers/progressive.d.ts +46 -0
  77. package/dist/core/services/mcp-handlers/progressive.d.ts.map +1 -0
  78. package/dist/core/services/mcp-handlers/progressive.js +0 -0
  79. package/dist/core/services/mcp-handlers/progressive.js.map +1 -0
  80. package/dist/core/services/mcp-handlers/semantic.d.ts +1 -1
  81. package/dist/core/services/mcp-handlers/semantic.d.ts.map +1 -1
  82. package/dist/core/services/mcp-handlers/semantic.js +39 -26
  83. package/dist/core/services/mcp-handlers/semantic.js.map +1 -1
  84. package/dist/core/services/mcp-watcher.d.ts +7 -0
  85. package/dist/core/services/mcp-watcher.d.ts.map +1 -1
  86. package/dist/core/services/mcp-watcher.js +38 -1
  87. package/dist/core/services/mcp-watcher.js.map +1 -1
  88. package/dist/core/services/project-detector.d.ts.map +1 -1
  89. package/dist/core/services/project-detector.js +45 -2
  90. package/dist/core/services/project-detector.js.map +1 -1
  91. package/package.json +1 -1
@@ -46,6 +46,11 @@ export { handleGetCallGraph, handleGetSubgraph, handleAnalyzeImpact, handleGetLo
46
46
  // ============================================================================
47
47
  // TOOL DEFINITIONS
48
48
  // ============================================================================
49
+ // Spec 28 — the `directory` param is the one input every tool shares (50×). Its
50
+ // description was a verbatim 38-char repeat on each tool; a single short shared
51
+ // constant trims that lossless repeat from the cached tools/list prefix without
52
+ // dropping the one fact that matters (it must be absolute, not relative).
53
+ const DIR_DESC = 'Absolute project path';
49
54
  export const TOOL_DEFINITIONS = [
50
55
  {
51
56
  name: 'orient',
@@ -59,7 +64,7 @@ export const TOOL_DEFINITIONS = [
59
64
  properties: {
60
65
  directory: {
61
66
  type: 'string',
62
- description: 'Absolute path to the project directory',
67
+ description: DIR_DESC,
63
68
  },
64
69
  task: {
65
70
  type: 'string',
@@ -69,6 +74,14 @@ export const TOOL_DEFINITIONS = [
69
74
  type: 'number',
70
75
  description: 'Number of relevant functions to return (default: 5)',
71
76
  },
77
+ tokenBudget: {
78
+ type: 'number',
79
+ description: 'Optional: cap relevantFunctions to ~this many tokens (highest-scored kept, exact duplicates collapsed); each item carries an `expand` handle for get_function_body',
80
+ },
81
+ lean: {
82
+ type: 'boolean',
83
+ description: 'Return only the navigation core (relevantFunctions + callPaths + specDomains); drop provenance/change-coupling/insertion-points/specs/decisions enrichment (each reachable via expand handles or dedicated tools). Lower per-call cost for shallow "who/where" lookups.',
84
+ },
72
85
  },
73
86
  required: ['directory', 'task'],
74
87
  },
@@ -97,8 +110,8 @@ export const TOOL_DEFINITIONS = [
97
110
  {
98
111
  name: 'get_architecture_overview',
99
112
  description: 'USE THIS WHEN: onboarding to an unknown codebase, or before planning a large feature. ' +
100
- 'Returns domain clusters, cross-cluster dependencies, global entry points, and critical hubs ' +
101
- 'faster than reading package.json + directory tree yourself. Run analyze_codebase first.',
113
+ 'Returns domain clusters, cross-cluster dependencies, global entry points, and critical hubs. ' +
114
+ 'Run analyze_codebase first.',
102
115
  inputSchema: {
103
116
  type: 'object',
104
117
  properties: {
@@ -131,14 +144,13 @@ export const TOOL_DEFINITIONS = [
131
144
  name: 'get_call_graph',
132
145
  description: 'Return the call graph for a project: hub functions (high fan-in), ' +
133
146
  'entry points (no internal callers), and architectural layer violations. ' +
134
- 'Supports TypeScript, JavaScript, Python, Go, Rust, Ruby, Java, C++. ' +
135
147
  'Run analyze_codebase first.',
136
148
  inputSchema: {
137
149
  type: 'object',
138
150
  properties: {
139
151
  directory: {
140
152
  type: 'string',
141
- description: 'Absolute path to the project directory',
153
+ description: DIR_DESC,
142
154
  },
143
155
  },
144
156
  required: ['directory'],
@@ -150,7 +162,7 @@ export const TOOL_DEFINITIONS = [
150
162
  'Detects Type 1 (exact clones — identical after whitespace/comment normalization), ' +
151
163
  'Type 2 (structural clones — same structure with renamed variables), and ' +
152
164
  'Type 3 (near-clones with Jaccard similarity ≥ 0.7 on token n-grams). ' +
153
- 'No LLM calls required. Run analyze_codebase first.',
165
+ 'Run analyze_codebase first.',
154
166
  inputSchema: {
155
167
  type: 'object',
156
168
  properties: {
@@ -172,7 +184,7 @@ export const TOOL_DEFINITIONS = [
172
184
  properties: {
173
185
  directory: {
174
186
  type: 'string',
175
- description: 'Absolute path to the project directory',
187
+ description: DIR_DESC,
176
188
  },
177
189
  filePattern: {
178
190
  type: 'string',
@@ -195,7 +207,7 @@ export const TOOL_DEFINITIONS = [
195
207
  properties: {
196
208
  directory: {
197
209
  type: 'string',
198
- description: 'Absolute path to the project directory',
210
+ description: DIR_DESC,
199
211
  },
200
212
  functionName: {
201
213
  type: 'string',
@@ -233,7 +245,7 @@ export const TOOL_DEFINITIONS = [
233
245
  properties: {
234
246
  directory: {
235
247
  type: 'string',
236
- description: 'Absolute path to the project directory',
248
+ description: DIR_DESC,
237
249
  },
238
250
  entryFunction: {
239
251
  type: 'string',
@@ -266,7 +278,7 @@ export const TOOL_DEFINITIONS = [
266
278
  properties: {
267
279
  directory: {
268
280
  type: 'string',
269
- description: 'Absolute path to the project directory',
281
+ description: DIR_DESC,
270
282
  },
271
283
  domain: {
272
284
  type: 'string',
@@ -331,7 +343,7 @@ export const TOOL_DEFINITIONS = [
331
343
  properties: {
332
344
  directory: {
333
345
  type: 'string',
334
- description: 'Absolute path to the project directory',
346
+ description: DIR_DESC,
335
347
  },
336
348
  symbol: {
337
349
  type: 'string',
@@ -356,7 +368,7 @@ export const TOOL_DEFINITIONS = [
356
368
  inputSchema: {
357
369
  type: 'object',
358
370
  properties: {
359
- directory: { type: 'string', description: 'Absolute path to the project directory' },
371
+ directory: { type: 'string', description: DIR_DESC },
360
372
  changedSymbols: {
361
373
  type: 'array',
362
374
  items: { type: 'string' },
@@ -382,7 +394,7 @@ export const TOOL_DEFINITIONS = [
382
394
  inputSchema: {
383
395
  type: 'object',
384
396
  properties: {
385
- directory: { type: 'string', description: 'Absolute path to the project directory' },
397
+ directory: { type: 'string', description: DIR_DESC },
386
398
  ifDeleted: { type: 'string', description: 'Symbol name — returns what becomes dead if it is deleted (delete-impact mode)' },
387
399
  maxResults: { type: 'number', description: 'Max candidate-dead results (default 100)' },
388
400
  filePattern: { type: 'string', description: 'Only report candidates whose file path contains this substring' },
@@ -401,7 +413,7 @@ export const TOOL_DEFINITIONS = [
401
413
  inputSchema: {
402
414
  type: 'object',
403
415
  properties: {
404
- directory: { type: 'string', description: 'Absolute path to the project directory' },
416
+ directory: { type: 'string', description: DIR_DESC },
405
417
  baseRef: { type: 'string', description: 'Old state to diff against (default "HEAD")' },
406
418
  headRef: { type: 'string', description: 'New state (a git ref). Omit to use the working tree.' },
407
419
  maxResults: { type: 'number', description: 'Cap reported items per category (default 200)' },
@@ -420,7 +432,7 @@ export const TOOL_DEFINITIONS = [
420
432
  inputSchema: {
421
433
  type: 'object',
422
434
  properties: {
423
- directory: { type: 'string', description: 'Absolute path to the project directory' },
435
+ directory: { type: 'string', description: DIR_DESC },
424
436
  file: { type: 'string', description: 'A file to query its coupling/volatility. Omit for the most-volatile overview.' },
425
437
  limit: { type: 'number', description: 'Cap results (default 20)' },
426
438
  },
@@ -439,7 +451,7 @@ export const TOOL_DEFINITIONS = [
439
451
  inputSchema: {
440
452
  type: 'object',
441
453
  properties: {
442
- directory: { type: 'string', description: 'Absolute path to the project directory' },
454
+ directory: { type: 'string', description: DIR_DESC },
443
455
  from: { type: 'string', description: 'Pre-edit mode: the file that would gain the import (relative or absolute). Requires "to".' },
444
456
  to: { type: 'string', description: 'Pre-edit mode: the target file path or exported symbol being imported. Requires "from".' },
445
457
  },
@@ -457,7 +469,7 @@ export const TOOL_DEFINITIONS = [
457
469
  properties: {
458
470
  directory: {
459
471
  type: 'string',
460
- description: 'Absolute path to the project directory',
472
+ description: DIR_DESC,
461
473
  },
462
474
  limit: {
463
475
  type: 'number',
@@ -482,7 +494,7 @@ export const TOOL_DEFINITIONS = [
482
494
  properties: {
483
495
  directory: {
484
496
  type: 'string',
485
- description: 'Absolute path to the project directory',
497
+ description: DIR_DESC,
486
498
  },
487
499
  limit: {
488
500
  type: 'number',
@@ -512,7 +524,7 @@ export const TOOL_DEFINITIONS = [
512
524
  properties: {
513
525
  directory: {
514
526
  type: 'string',
515
- description: 'Absolute path to the project directory',
527
+ description: DIR_DESC,
516
528
  },
517
529
  limit: {
518
530
  type: 'number',
@@ -538,7 +550,7 @@ export const TOOL_DEFINITIONS = [
538
550
  properties: {
539
551
  directory: {
540
552
  type: 'string',
541
- description: 'Absolute path to the project directory',
553
+ description: DIR_DESC,
542
554
  },
543
555
  filePath: {
544
556
  type: 'string',
@@ -559,7 +571,7 @@ export const TOOL_DEFINITIONS = [
559
571
  properties: {
560
572
  directory: {
561
573
  type: 'string',
562
- description: 'Absolute path to the project directory',
574
+ description: DIR_DESC,
563
575
  },
564
576
  filePath: {
565
577
  type: 'string',
@@ -585,7 +597,7 @@ export const TOOL_DEFINITIONS = [
585
597
  properties: {
586
598
  directory: {
587
599
  type: 'string',
588
- description: 'Absolute path to the project directory',
600
+ description: DIR_DESC,
589
601
  },
590
602
  description: {
591
603
  type: 'string',
@@ -616,7 +628,7 @@ export const TOOL_DEFINITIONS = [
616
628
  properties: {
617
629
  directory: {
618
630
  type: 'string',
619
- description: 'Absolute path to the project directory',
631
+ description: DIR_DESC,
620
632
  },
621
633
  query: {
622
634
  type: 'string',
@@ -634,6 +646,10 @@ export const TOOL_DEFINITIONS = [
634
646
  type: 'number',
635
647
  description: 'Only return functions with at least this many callers (hub filter)',
636
648
  },
649
+ tokenBudget: {
650
+ type: 'number',
651
+ description: 'Optional: cap results to ~this many tokens (highest-scored kept, exact duplicates collapsed); each hit carries an `expand` handle for get_function_body',
652
+ },
637
653
  },
638
654
  required: ['directory', 'query'],
639
655
  },
@@ -645,7 +661,7 @@ export const TOOL_DEFINITIONS = [
645
661
  inputSchema: {
646
662
  type: 'object',
647
663
  properties: {
648
- directory: { type: 'string', description: 'Absolute path to the project directory' },
664
+ directory: { type: 'string', description: DIR_DESC },
649
665
  },
650
666
  required: ['directory'],
651
667
  },
@@ -661,7 +677,7 @@ export const TOOL_DEFINITIONS = [
661
677
  properties: {
662
678
  directory: {
663
679
  type: 'string',
664
- description: 'Absolute path to the project directory',
680
+ description: DIR_DESC,
665
681
  },
666
682
  query: {
667
683
  type: 'string',
@@ -696,7 +712,7 @@ export const TOOL_DEFINITIONS = [
696
712
  properties: {
697
713
  directory: {
698
714
  type: 'string',
699
- description: 'Absolute path to the project directory',
715
+ description: DIR_DESC,
700
716
  },
701
717
  query: {
702
718
  type: 'string',
@@ -731,7 +747,7 @@ export const TOOL_DEFINITIONS = [
731
747
  inputSchema: {
732
748
  type: 'object',
733
749
  properties: {
734
- directory: { type: 'string', description: 'Absolute path to the project directory' },
750
+ directory: { type: 'string', description: DIR_DESC },
735
751
  domain: {
736
752
  type: 'string',
737
753
  description: 'Domain name as returned by list_spec_domains (e.g. "auth", "analyzer")',
@@ -749,7 +765,7 @@ export const TOOL_DEFINITIONS = [
749
765
  inputSchema: {
750
766
  type: 'object',
751
767
  properties: {
752
- directory: { type: 'string', description: 'Absolute path to the project directory' },
768
+ directory: { type: 'string', description: DIR_DESC },
753
769
  filePath: {
754
770
  type: 'string',
755
771
  description: 'File path relative to the project directory, e.g. "src/auth/jwt.ts"',
@@ -771,7 +787,7 @@ export const TOOL_DEFINITIONS = [
771
787
  inputSchema: {
772
788
  type: 'object',
773
789
  properties: {
774
- directory: { type: 'string', description: 'Absolute path to the project directory' },
790
+ directory: { type: 'string', description: DIR_DESC },
775
791
  filePath: {
776
792
  type: 'string',
777
793
  description: 'File path relative to the project root, e.g. "src/core/analyzer/vector-index.ts"',
@@ -798,7 +814,7 @@ export const TOOL_DEFINITIONS = [
798
814
  properties: {
799
815
  directory: {
800
816
  type: 'string',
801
- description: 'Absolute path to the project directory',
817
+ description: DIR_DESC,
802
818
  },
803
819
  description: {
804
820
  type: 'string',
@@ -832,7 +848,7 @@ export const TOOL_DEFINITIONS = [
832
848
  properties: {
833
849
  directory: {
834
850
  type: 'string',
835
- description: 'Absolute path to the project directory',
851
+ description: DIR_DESC,
836
852
  },
837
853
  storyFilePath: {
838
854
  type: 'string',
@@ -857,7 +873,7 @@ export const TOOL_DEFINITIONS = [
857
873
  inputSchema: {
858
874
  type: 'object',
859
875
  properties: {
860
- directory: { type: 'string', description: 'Absolute path to the project directory' },
876
+ directory: { type: 'string', description: DIR_DESC },
861
877
  query: {
862
878
  type: 'string',
863
879
  description: 'Optional text filter — returns only ADRs whose title or content contains this string',
@@ -878,7 +894,7 @@ export const TOOL_DEFINITIONS = [
878
894
  inputSchema: {
879
895
  type: 'object',
880
896
  properties: {
881
- directory: { type: 'string', description: 'Absolute path to the project directory' },
897
+ directory: { type: 'string', description: DIR_DESC },
882
898
  },
883
899
  required: ['directory'],
884
900
  },
@@ -895,7 +911,7 @@ export const TOOL_DEFINITIONS = [
895
911
  inputSchema: {
896
912
  type: 'object',
897
913
  properties: {
898
- directory: { type: 'string', description: 'Absolute path to the project directory' },
914
+ directory: { type: 'string', description: DIR_DESC },
899
915
  },
900
916
  required: ['directory'],
901
917
  },
@@ -911,7 +927,7 @@ export const TOOL_DEFINITIONS = [
911
927
  inputSchema: {
912
928
  type: 'object',
913
929
  properties: {
914
- directory: { type: 'string', description: 'Absolute path to the project directory' },
930
+ directory: { type: 'string', description: DIR_DESC },
915
931
  },
916
932
  required: ['directory'],
917
933
  },
@@ -927,7 +943,7 @@ export const TOOL_DEFINITIONS = [
927
943
  inputSchema: {
928
944
  type: 'object',
929
945
  properties: {
930
- directory: { type: 'string', description: 'Absolute path to the project directory' },
946
+ directory: { type: 'string', description: DIR_DESC },
931
947
  },
932
948
  required: ['directory'],
933
949
  },
@@ -944,7 +960,7 @@ export const TOOL_DEFINITIONS = [
944
960
  inputSchema: {
945
961
  type: 'object',
946
962
  properties: {
947
- directory: { type: 'string', description: 'Absolute path to the project directory' },
963
+ directory: { type: 'string', description: DIR_DESC },
948
964
  },
949
965
  required: ['directory'],
950
966
  },
@@ -959,7 +975,7 @@ export const TOOL_DEFINITIONS = [
959
975
  inputSchema: {
960
976
  type: 'object',
961
977
  properties: {
962
- directory: { type: 'string', description: 'Absolute path to the project directory' },
978
+ directory: { type: 'string', description: DIR_DESC },
963
979
  },
964
980
  required: ['directory'],
965
981
  },
@@ -976,7 +992,7 @@ export const TOOL_DEFINITIONS = [
976
992
  inputSchema: {
977
993
  type: 'object',
978
994
  properties: {
979
- directory: { type: 'string', description: 'Absolute path to the project directory' },
995
+ directory: { type: 'string', description: DIR_DESC },
980
996
  maxUncovered: {
981
997
  type: 'number',
982
998
  description: 'Maximum uncovered functions to return (default: 50)',
@@ -1004,7 +1020,7 @@ export const TOOL_DEFINITIONS = [
1004
1020
  properties: {
1005
1021
  directory: {
1006
1022
  type: 'string',
1007
- description: 'Absolute path to the project directory',
1023
+ description: DIR_DESC,
1008
1024
  },
1009
1025
  domains: {
1010
1026
  type: 'array',
@@ -1041,7 +1057,7 @@ export const TOOL_DEFINITIONS = [
1041
1057
  properties: {
1042
1058
  directory: {
1043
1059
  type: 'string',
1044
- description: 'Absolute path to the project directory',
1060
+ description: DIR_DESC,
1045
1061
  },
1046
1062
  domains: {
1047
1063
  type: 'array',
@@ -1066,7 +1082,7 @@ export const TOOL_DEFINITIONS = [
1066
1082
  inputSchema: {
1067
1083
  type: 'object',
1068
1084
  properties: {
1069
- directory: { type: 'string', description: 'Absolute path to the project directory' },
1085
+ directory: { type: 'string', description: DIR_DESC },
1070
1086
  functionName: { type: 'string', description: 'Exact function or method name' },
1071
1087
  filePath: {
1072
1088
  type: 'string',
@@ -1086,7 +1102,7 @@ export const TOOL_DEFINITIONS = [
1086
1102
  inputSchema: {
1087
1103
  type: 'object',
1088
1104
  properties: {
1089
- directory: { type: 'string', description: 'Absolute path to the project directory' },
1105
+ directory: { type: 'string', description: DIR_DESC },
1090
1106
  functionName: { type: 'string', description: 'Function name to look up the community for' },
1091
1107
  },
1092
1108
  required: ['directory', 'functionName'],
@@ -1103,7 +1119,7 @@ export const TOOL_DEFINITIONS = [
1103
1119
  inputSchema: {
1104
1120
  type: 'object',
1105
1121
  properties: {
1106
- directory: { type: 'string', description: 'Absolute path to the project directory' },
1122
+ directory: { type: 'string', description: DIR_DESC },
1107
1123
  base: {
1108
1124
  type: 'string',
1109
1125
  description: 'Git ref to diff against (default: HEAD). Use "HEAD~1" for last commit, "main" for branch diff.',
@@ -1122,7 +1138,7 @@ export const TOOL_DEFINITIONS = [
1122
1138
  inputSchema: {
1123
1139
  type: 'object',
1124
1140
  properties: {
1125
- directory: { type: 'string', description: 'Absolute path to the project directory' },
1141
+ directory: { type: 'string', description: DIR_DESC },
1126
1142
  title: { type: 'string', description: 'Short imperative statement, e.g. "Use UUIDs for decision IDs"' },
1127
1143
  rationale: { type: 'string', description: 'Why this decision was made' },
1128
1144
  consequences: { type: 'string', description: 'What changes as a result (optional)' },
@@ -1153,7 +1169,7 @@ export const TOOL_DEFINITIONS = [
1153
1169
  inputSchema: {
1154
1170
  type: 'object',
1155
1171
  properties: {
1156
- directory: { type: 'string', description: 'Absolute path to the project directory' },
1172
+ directory: { type: 'string', description: DIR_DESC },
1157
1173
  status: {
1158
1174
  type: 'string',
1159
1175
  enum: ['draft', 'consolidated', 'verified', 'phantom', 'approved', 'rejected', 'synced'],
@@ -1173,7 +1189,7 @@ export const TOOL_DEFINITIONS = [
1173
1189
  inputSchema: {
1174
1190
  type: 'object',
1175
1191
  properties: {
1176
- directory: { type: 'string', description: 'Absolute path to the project directory' },
1192
+ directory: { type: 'string', description: DIR_DESC },
1177
1193
  id: { type: 'string', description: '8-character decision ID from list_decisions' },
1178
1194
  note: { type: 'string', description: 'Optional review note' },
1179
1195
  },
@@ -1186,7 +1202,7 @@ export const TOOL_DEFINITIONS = [
1186
1202
  inputSchema: {
1187
1203
  type: 'object',
1188
1204
  properties: {
1189
- directory: { type: 'string', description: 'Absolute path to the project directory' },
1205
+ directory: { type: 'string', description: DIR_DESC },
1190
1206
  id: { type: 'string', description: '8-character decision ID from list_decisions' },
1191
1207
  note: { type: 'string', description: 'Optional reason for rejection' },
1192
1208
  },
@@ -1203,7 +1219,7 @@ export const TOOL_DEFINITIONS = [
1203
1219
  inputSchema: {
1204
1220
  type: 'object',
1205
1221
  properties: {
1206
- directory: { type: 'string', description: 'Absolute path to the project directory' },
1222
+ directory: { type: 'string', description: DIR_DESC },
1207
1223
  dryRun: { type: 'boolean', description: 'Preview without writing files (default: false)' },
1208
1224
  id: { type: 'string', description: 'Sync only this specific decision ID (default: all approved)' },
1209
1225
  },
@@ -1383,8 +1399,8 @@ async function startMcpServer(options = {}) {
1383
1399
  // generous overrides in MCP_TOOL_TIMEOUT_OVERRIDES.
1384
1400
  await withToolTimeout((async () => {
1385
1401
  if (name === 'orient') {
1386
- const { task, limit = 5 } = args;
1387
- result = await handleOrient(directory, task, limit);
1402
+ const { task, limit = 5, tokenBudget, lean } = args;
1403
+ result = await handleOrient(directory, task, limit, tokenBudget, lean);
1388
1404
  if (result && typeof result === 'object') {
1389
1405
  const r = result;
1390
1406
  emit(directory, 'orient', {
@@ -1482,8 +1498,8 @@ async function startMcpServer(options = {}) {
1482
1498
  result = await handleCheckSpecDrift(directory, base, files, domains, failOn, maxFiles);
1483
1499
  }
1484
1500
  else if (name === 'search_code') {
1485
- const { directory, query, limit = 10, language, minFanIn } = args;
1486
- result = await handleSearchCode(directory, query, limit, language, minFanIn);
1501
+ const { directory, query, limit = 10, language, minFanIn, tokenBudget } = args;
1502
+ result = await handleSearchCode(directory, query, limit, language, minFanIn, tokenBudget);
1487
1503
  }
1488
1504
  else if (name === 'suggest_insertion_points') {
1489
1505
  const { directory, description, limit = 5, language } = args;