sigmap 6.0.3 → 6.1.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/AGENTS.md +81 -70
- package/CHANGELOG.md +8 -0
- package/README.md +3 -3
- package/gen-context.js +60 -6
- package/package.json +1 -1
- package/packages/adapters/claude.js +6 -0
- package/packages/adapters/codex.js +13 -1
- package/packages/adapters/copilot.js +8 -0
- package/packages/adapters/cursor.js +4 -0
- package/packages/adapters/gemini.js +1 -0
- package/packages/adapters/openai.js +1 -0
- package/packages/adapters/windsurf.js +4 -0
- package/packages/cli/package.json +1 -1
- package/packages/core/package.json +1 -1
- package/src/mcp/server.js +1 -1
package/AGENTS.md
CHANGED
|
@@ -13,10 +13,25 @@ Use this marker block for all appendable context files:
|
|
|
13
13
|
<!-- Updated by gen-context.js -->
|
|
14
14
|
# Code signatures
|
|
15
15
|
|
|
16
|
-
##
|
|
16
|
+
## SigMap commands
|
|
17
|
+
|
|
18
|
+
| When | Command |
|
|
19
|
+
|------|---------|
|
|
20
|
+
| Before answering a question | `sigmap ask "<your question>"` |
|
|
21
|
+
| After code changes | `sigmap validate` |
|
|
22
|
+
| To query by topic | `sigmap --query "<topic>"` |
|
|
23
|
+
|
|
24
|
+
Always run `sigmap ask` or `sigmap --query` before searching for files relevant to a task.
|
|
25
|
+
## changes (last 5 commits — 31 minutes ago)
|
|
17
26
|
```
|
|
18
|
-
src/
|
|
27
|
+
src/learning/weights.js +exportWeights +importWeights ~resetWeights
|
|
19
28
|
packages/adapters/codex.js ~format
|
|
29
|
+
packages/adapters/gemini.js ~format
|
|
30
|
+
packages/adapters/copilot.js ~format
|
|
31
|
+
packages/adapters/openai.js ~format
|
|
32
|
+
packages/adapters/claude.js ~format
|
|
33
|
+
packages/adapters/cursor.js ~format
|
|
34
|
+
packages/adapters/windsurf.js ~format
|
|
20
35
|
```
|
|
21
36
|
|
|
22
37
|
## packages
|
|
@@ -44,39 +59,62 @@ function format(context, opts)
|
|
|
44
59
|
function write(context, cwd, opts)
|
|
45
60
|
```
|
|
46
61
|
|
|
47
|
-
### packages/
|
|
62
|
+
### packages/core/README.md
|
|
48
63
|
```
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
64
|
+
h1 sigmap-core
|
|
65
|
+
h2 Installation
|
|
66
|
+
h2 Quick start
|
|
67
|
+
h2 API reference
|
|
68
|
+
h3 `extract(src, language)` → `string[]`
|
|
69
|
+
h3 `rank(query, sigIndex, opts?)` → `Result[]`
|
|
70
|
+
h3 `buildSigIndex(cwd)` → `Map<string, string[]>`
|
|
71
|
+
h3 `scan(sigs, filePath)` → `{ safe: string[], redacted: boolean }`
|
|
72
|
+
h3 `score(cwd)` → `HealthResult`
|
|
73
|
+
h2 Migration from v2.3 and earlier
|
|
74
|
+
h2 v3.0 — Multi-Adapter Architecture (released)
|
|
75
|
+
h2 Zero dependencies
|
|
76
|
+
code-fence bash
|
|
77
|
+
code-fence plain
|
|
78
|
+
code-fence js
|
|
79
|
+
code-fence ---
|
|
54
80
|
```
|
|
55
81
|
|
|
56
|
-
### packages/
|
|
82
|
+
### packages/core/index.js
|
|
83
|
+
```
|
|
84
|
+
module.exports = { extract, rank, buildSigIndex, scan, score, adapt }
|
|
85
|
+
function _resolveExtractor(language)
|
|
86
|
+
function extract(src, language) → string[]
|
|
87
|
+
function rank(query, sigIndex, opts) → { file: string, score: nu
|
|
88
|
+
function buildSigIndex(cwd) → Map<string, string[]>
|
|
89
|
+
function scan(sigs, filePath) → { safe: string[], redacte
|
|
90
|
+
function score(cwd) → { * score: number, * grad
|
|
91
|
+
function adapt(context, adapterName, opts = {}) → string
|
|
92
|
+
```
|
|
93
|
+
|
|
94
|
+
### packages/adapters/codex.js
|
|
57
95
|
```
|
|
58
96
|
module.exports = { name, format, outputPath, write }
|
|
59
97
|
function format(context, opts = {}) → string
|
|
60
|
-
function _confidenceMeta(opts)
|
|
61
98
|
function outputPath(cwd) → string
|
|
62
99
|
function write(context, cwd, opts = {})
|
|
63
100
|
```
|
|
64
101
|
|
|
65
|
-
### packages/adapters/
|
|
102
|
+
### packages/adapters/gemini.js
|
|
66
103
|
```
|
|
67
|
-
module.exports = { name, format, outputPath }
|
|
104
|
+
module.exports = { name, format, outputPath, write }
|
|
68
105
|
function format(context, opts = {}) → string
|
|
69
|
-
function _confidenceMeta(opts)
|
|
70
106
|
function outputPath(cwd) → string
|
|
107
|
+
function write(context, cwd, opts = {})
|
|
108
|
+
function _confidenceMeta(opts)
|
|
71
109
|
```
|
|
72
110
|
|
|
73
|
-
### packages/adapters/
|
|
111
|
+
### packages/adapters/copilot.js
|
|
74
112
|
```
|
|
75
113
|
module.exports = { name, format, outputPath, write }
|
|
76
114
|
function format(context, opts = {}) → string
|
|
115
|
+
function _confidenceMeta(opts)
|
|
77
116
|
function outputPath(cwd) → string
|
|
78
117
|
function write(context, cwd, opts = {})
|
|
79
|
-
function _confidenceMeta(opts)
|
|
80
118
|
```
|
|
81
119
|
|
|
82
120
|
### packages/adapters/openai.js
|
|
@@ -87,62 +125,33 @@ function outputPath(cwd) → string
|
|
|
87
125
|
function _confidenceMeta(opts)
|
|
88
126
|
```
|
|
89
127
|
|
|
90
|
-
### packages/adapters/
|
|
128
|
+
### packages/adapters/claude.js
|
|
91
129
|
```
|
|
92
|
-
module.exports = { name, format, outputPath }
|
|
130
|
+
module.exports = { name, format, outputPath, write }
|
|
93
131
|
function format(context, opts = {}) → string
|
|
94
132
|
function _confidenceMeta(opts)
|
|
95
133
|
function outputPath(cwd) → string
|
|
134
|
+
function write(context, cwd, opts = {})
|
|
96
135
|
```
|
|
97
136
|
|
|
98
|
-
### packages/
|
|
99
|
-
```
|
|
100
|
-
h1 sigmap-core
|
|
101
|
-
h2 Installation
|
|
102
|
-
h2 Quick start
|
|
103
|
-
h2 API reference
|
|
104
|
-
h3 `extract(src, language)` → `string[]`
|
|
105
|
-
h3 `rank(query, sigIndex, opts?)` → `Result[]`
|
|
106
|
-
h3 `buildSigIndex(cwd)` → `Map<string, string[]>`
|
|
107
|
-
h3 `scan(sigs, filePath)` → `{ safe: string[], redacted: boolean }`
|
|
108
|
-
h3 `score(cwd)` → `HealthResult`
|
|
109
|
-
h2 Migration from v2.3 and earlier
|
|
110
|
-
h2 v3.0 — Multi-Adapter Architecture (released)
|
|
111
|
-
h2 Zero dependencies
|
|
112
|
-
code-fence bash
|
|
113
|
-
code-fence plain
|
|
114
|
-
code-fence js
|
|
115
|
-
code-fence ---
|
|
116
|
-
```
|
|
117
|
-
|
|
118
|
-
### packages/core/index.js
|
|
137
|
+
### packages/adapters/cursor.js
|
|
119
138
|
```
|
|
120
|
-
module.exports = {
|
|
121
|
-
function
|
|
122
|
-
function
|
|
123
|
-
function
|
|
124
|
-
function buildSigIndex(cwd) → Map<string, string[]>
|
|
125
|
-
function scan(sigs, filePath) → { safe: string[], redacte
|
|
126
|
-
function score(cwd) → { * score: number, * grad
|
|
127
|
-
function adapt(context, adapterName, opts = {}) → string
|
|
139
|
+
module.exports = { name, format, outputPath }
|
|
140
|
+
function format(context, opts = {}) → string
|
|
141
|
+
function _confidenceMeta(opts)
|
|
142
|
+
function outputPath(cwd) → string
|
|
128
143
|
```
|
|
129
144
|
|
|
130
|
-
### packages/adapters/
|
|
145
|
+
### packages/adapters/windsurf.js
|
|
131
146
|
```
|
|
132
|
-
module.exports = { name, format, outputPath
|
|
147
|
+
module.exports = { name, format, outputPath }
|
|
133
148
|
function format(context, opts = {}) → string
|
|
149
|
+
function _confidenceMeta(opts)
|
|
134
150
|
function outputPath(cwd) → string
|
|
135
|
-
function write(context, cwd, opts = {})
|
|
136
151
|
```
|
|
137
152
|
|
|
138
153
|
## src
|
|
139
154
|
|
|
140
|
-
### src/routing/hints.js
|
|
141
|
-
```
|
|
142
|
-
module.exports = { TIERS, formatRoutingSection }
|
|
143
|
-
function formatRoutingSection(groups) → string
|
|
144
|
-
```
|
|
145
|
-
|
|
146
155
|
### src/security/patterns.js
|
|
147
156
|
```
|
|
148
157
|
module.exports = { PATTERNS }
|
|
@@ -551,21 +560,6 @@ function extractContextFiles(context, cwd)
|
|
|
551
560
|
function judge(response, context, opts = {})
|
|
552
561
|
```
|
|
553
562
|
|
|
554
|
-
### src/learning/weights.js
|
|
555
|
-
```
|
|
556
|
-
module.exports = { BASELINE, DECAY, MAX_MULT, MIN_MULT, weightsPath, clampMultiplier, normalizeFile, loadWeights, saveWeights, updateWeights, boostFiles, penalizeFiles, resetWeights }
|
|
557
|
-
function weightsPath(cwd)
|
|
558
|
-
function clampMultiplier(value)
|
|
559
|
-
function normalizeFile(cwd, filePath)
|
|
560
|
-
function sanitizeWeights(cwd, weights)
|
|
561
|
-
function loadWeights(cwd)
|
|
562
|
-
function saveWeights(cwd, weights)
|
|
563
|
-
function updateWeights(cwd, opts = {})
|
|
564
|
-
function boostFiles(cwd, files, amount = 0.15)
|
|
565
|
-
function penalizeFiles(cwd, files, amount = 0.10)
|
|
566
|
-
function resetWeights(cwd)
|
|
567
|
-
```
|
|
568
|
-
|
|
569
563
|
### src/format/benchmark-report.js
|
|
570
564
|
```
|
|
571
565
|
module.exports = { loadBenchmarkReports, buildBenchmarkSummary, generateBenchmarkReportHtml, writeBenchmarkReport }
|
|
@@ -654,6 +648,23 @@ function extractClassMembers(block)
|
|
|
654
648
|
function normalizeParams(params)
|
|
655
649
|
```
|
|
656
650
|
|
|
651
|
+
### src/learning/weights.js
|
|
652
|
+
```
|
|
653
|
+
module.exports = { BASELINE, DECAY, MAX_MULT, MIN_MULT, weightsPath, clampMultiplier, normalizeFile, loadWeights, saveWeights, updateWeights, boostFiles, penalizeFiles, resetWeights, exportWeights, importWeights }
|
|
654
|
+
function weightsPath(cwd)
|
|
655
|
+
function clampMultiplier(value)
|
|
656
|
+
function normalizeFile(cwd, filePath)
|
|
657
|
+
function sanitizeWeights(cwd, weights)
|
|
658
|
+
function loadWeights(cwd)
|
|
659
|
+
function saveWeights(cwd, weights)
|
|
660
|
+
function updateWeights(cwd, opts = {})
|
|
661
|
+
function boostFiles(cwd, files, amount = 0.15)
|
|
662
|
+
function penalizeFiles(cwd, files, amount = 0.10)
|
|
663
|
+
function resetWeights(cwd)
|
|
664
|
+
function exportWeights(cwd, outputPath)
|
|
665
|
+
function importWeights(cwd, importPath, replace)
|
|
666
|
+
```
|
|
667
|
+
|
|
657
668
|
### src/mcp/server.js
|
|
658
669
|
```
|
|
659
670
|
module.exports = { start }
|
package/CHANGELOG.md
CHANGED
|
@@ -10,6 +10,14 @@ Format: [Semantic Versioning](https://semver.org/)
|
|
|
10
10
|
|
|
11
11
|
---
|
|
12
12
|
|
|
13
|
+
## [6.1.0] — 2026-04-22
|
|
14
|
+
|
|
15
|
+
### Added
|
|
16
|
+
|
|
17
|
+
- **Tool instructions in every adapter (Level 1)** — each adapter's `format()` now embeds native-format SigMap command guidance: markdown table (copilot, codex), bullet list (claude), `#` comments (cursor, windsurf), instruction sentence (openai, gemini). Agents get `sigmap ask`, `sigmap validate`, and `sigmap judge` hints automatically in every generated context file.
|
|
18
|
+
|
|
19
|
+
---
|
|
20
|
+
|
|
13
21
|
## [6.0.3] — 2026-04-21
|
|
14
22
|
|
|
15
23
|
### Added
|
package/README.md
CHANGED
|
@@ -76,14 +76,14 @@ Ask → Rank → Context → Validate → Judge → Learn
|
|
|
76
76
|
## Benchmark
|
|
77
77
|
|
|
78
78
|
```
|
|
79
|
-
Benchmark : sigmap-
|
|
79
|
+
Benchmark : sigmap-v6.0-main
|
|
80
80
|
Date : 2026-04-19
|
|
81
81
|
|
|
82
|
-
Hit@5 : 80.0% (baseline 13.6% — 5.
|
|
82
|
+
Hit@5 : 80.0% (baseline 13.6% — 5.8× lift)
|
|
83
83
|
Prompt reduction : 40.8%
|
|
84
84
|
Task success : 52.2% (baseline 10%)
|
|
85
85
|
Prompts / task : 1.68 (baseline 2.84)
|
|
86
|
-
Token reduction: 40–98% (avg
|
|
86
|
+
Token reduction: 40–98% (avg 96.9% across 18 real repos)
|
|
87
87
|
```
|
|
88
88
|
|
|
89
89
|
Measured on 90 coding tasks across 18 real public repos. No LLM API — fully reproducible.
|
package/gen-context.js
CHANGED
|
@@ -5387,7 +5387,7 @@ __factories["./src/mcp/server"] = function(module, exports) {
|
|
|
5387
5387
|
|
|
5388
5388
|
const SERVER_INFO = {
|
|
5389
5389
|
name: 'sigmap',
|
|
5390
|
-
version: '6.0
|
|
5390
|
+
version: '6.1.0',
|
|
5391
5391
|
description: 'SigMap MCP server — code signatures on demand',
|
|
5392
5392
|
};
|
|
5393
5393
|
|
|
@@ -6753,6 +6753,14 @@ __factories["./packages/adapters/copilot"] = function(module, exports) {
|
|
|
6753
6753
|
`<!-- Updated: ${timestamp} -->`,
|
|
6754
6754
|
`<!-- Do not edit below — regenerate with: node gen-context.js -->`,
|
|
6755
6755
|
'',
|
|
6756
|
+
'## SigMap commands',
|
|
6757
|
+
'',
|
|
6758
|
+
'| When | Command |',
|
|
6759
|
+
'|------|---------|',
|
|
6760
|
+
'| Before answering a question about code | `sigmap ask "<your question>"` |',
|
|
6761
|
+
'| After changing config or source dirs | `sigmap validate` |',
|
|
6762
|
+
'| To verify an AI answer is grounded | `sigmap judge --response <file>` |',
|
|
6763
|
+
'',
|
|
6756
6764
|
'# Code signatures',
|
|
6757
6765
|
'',
|
|
6758
6766
|
context,
|
|
@@ -6785,7 +6793,17 @@ __factories["./packages/adapters/claude"] = function(module, exports) {
|
|
|
6785
6793
|
if (!context || typeof context !== 'string') return '';
|
|
6786
6794
|
const version = (opts && opts.version) || 'unknown';
|
|
6787
6795
|
const timestamp = new Date().toISOString();
|
|
6788
|
-
return [
|
|
6796
|
+
return [
|
|
6797
|
+
'## SigMap',
|
|
6798
|
+
'- Before searching for files, run `sigmap ask "<query>"` — ranks by TF-IDF relevance',
|
|
6799
|
+
'- After config changes, run `sigmap validate` to confirm coverage',
|
|
6800
|
+
'- To verify answer groundedness, run `sigmap judge --response <file> --context CLAUDE.md`',
|
|
6801
|
+
'- For PR-scoped context, run `sigmap --diff`',
|
|
6802
|
+
'',
|
|
6803
|
+
`<!-- Generated by SigMap v${version} — ${timestamp} -->`,
|
|
6804
|
+
'',
|
|
6805
|
+
context,
|
|
6806
|
+
].join('\n');
|
|
6789
6807
|
}
|
|
6790
6808
|
function outputPath(cwd) { return path.join(cwd, 'CLAUDE.md'); }
|
|
6791
6809
|
function write(context, cwd, opts = {}) {
|
|
@@ -6810,7 +6828,17 @@ __factories["./packages/adapters/cursor"] = function(module, exports) {
|
|
|
6810
6828
|
if (!context || typeof context !== 'string') return '';
|
|
6811
6829
|
const version = (opts && opts.version) || 'unknown';
|
|
6812
6830
|
const timestamp = new Date().toISOString();
|
|
6813
|
-
return [
|
|
6831
|
+
return [
|
|
6832
|
+
`# Code signatures — generated by SigMap v${version}`,
|
|
6833
|
+
`# Updated: ${timestamp}`,
|
|
6834
|
+
`# Regenerate: node gen-context.js`,
|
|
6835
|
+
'#',
|
|
6836
|
+
'# SigMap: before answering, run: sigmap ask "<query>" — finds relevant files',
|
|
6837
|
+
'# SigMap: after config changes, run: sigmap validate',
|
|
6838
|
+
'# SigMap: to verify answers, run: sigmap judge --response <file>',
|
|
6839
|
+
'',
|
|
6840
|
+
context,
|
|
6841
|
+
].join('\n');
|
|
6814
6842
|
}
|
|
6815
6843
|
function outputPath(cwd) { return path.join(cwd, '.cursorrules'); }
|
|
6816
6844
|
module.exports = { name, format, outputPath };
|
|
@@ -6824,7 +6852,17 @@ __factories["./packages/adapters/windsurf"] = function(module, exports) {
|
|
|
6824
6852
|
if (!context || typeof context !== 'string') return '';
|
|
6825
6853
|
const version = (opts && opts.version) || 'unknown';
|
|
6826
6854
|
const timestamp = new Date().toISOString();
|
|
6827
|
-
return [
|
|
6855
|
+
return [
|
|
6856
|
+
`# Code signatures — generated by SigMap v${version}`,
|
|
6857
|
+
`# Updated: ${timestamp}`,
|
|
6858
|
+
`# Regenerate: node gen-context.js`,
|
|
6859
|
+
'#',
|
|
6860
|
+
'# SigMap: before answering, run: sigmap ask "<query>" — finds relevant files',
|
|
6861
|
+
'# SigMap: after config changes, run: sigmap validate',
|
|
6862
|
+
'# SigMap: to verify answers, run: sigmap judge --response <file>',
|
|
6863
|
+
'',
|
|
6864
|
+
context,
|
|
6865
|
+
].join('\n');
|
|
6828
6866
|
}
|
|
6829
6867
|
function outputPath(cwd) { return path.join(cwd, '.windsurfrules'); }
|
|
6830
6868
|
module.exports = { name, format, outputPath };
|
|
@@ -6844,6 +6882,8 @@ __factories["./packages/adapters/openai"] = function(module, exports) {
|
|
|
6844
6882
|
`Below are the code signatures extracted by SigMap v${version} on ${timestamp}.`,
|
|
6845
6883
|
projectLine,
|
|
6846
6884
|
`Use these signatures to answer questions about the code accurately.`,
|
|
6885
|
+
`When the user asks about a specific file or function, refer to the signatures below.`,
|
|
6886
|
+
`Before answering questions about specific code areas, prefer running \`sigmap ask "<query>"\` to get the most relevant files. After config changes, \`sigmap validate\` confirms coverage.`,
|
|
6847
6887
|
``,
|
|
6848
6888
|
`## Code Signatures`,
|
|
6849
6889
|
``,
|
|
@@ -6870,6 +6910,8 @@ __factories["./packages/adapters/gemini"] = function(module, exports) {
|
|
|
6870
6910
|
`The following code signatures were extracted by SigMap v${version} on ${timestamp}.`,
|
|
6871
6911
|
projectLine,
|
|
6872
6912
|
`These signatures represent every public function, class, and type in the project.`,
|
|
6913
|
+
`Refer to them when answering questions about code structure, APIs, and implementation.`,
|
|
6914
|
+
`Before answering questions about specific code areas, suggest running \`sigmap ask "<query>"\` to get the most relevant files. After config changes, \`sigmap validate\` confirms coverage.`,
|
|
6873
6915
|
``,
|
|
6874
6916
|
`## Code Signatures`,
|
|
6875
6917
|
``,
|
|
@@ -6901,7 +6943,19 @@ __factories["./packages/adapters/codex"] = function(module, exports) {
|
|
|
6901
6943
|
const CODEX_MARKER = '\n\n## Auto-generated signatures\n<!-- Updated by gen-context.js -->\n';
|
|
6902
6944
|
function format(context, opts = {}) {
|
|
6903
6945
|
if (!context || typeof context !== 'string' || !context.trim()) return '';
|
|
6904
|
-
|
|
6946
|
+
const toolBlock = [
|
|
6947
|
+
'## SigMap commands',
|
|
6948
|
+
'',
|
|
6949
|
+
'| When | Command |',
|
|
6950
|
+
'|------|---------|',
|
|
6951
|
+
'| Before answering a question | `sigmap ask "<your question>"` |',
|
|
6952
|
+
'| After code changes | `sigmap validate` |',
|
|
6953
|
+
'| To query by topic | `sigmap --query "<topic>"` |',
|
|
6954
|
+
'',
|
|
6955
|
+
'Always run `sigmap ask` or `sigmap --query` before searching for files relevant to a task.',
|
|
6956
|
+
'',
|
|
6957
|
+
].join('\n');
|
|
6958
|
+
return '# Code signatures\n\n' + toolBlock + context;
|
|
6905
6959
|
}
|
|
6906
6960
|
function outputPath(cwd) { return path.join(cwd, 'AGENTS.md'); }
|
|
6907
6961
|
function write(context, cwd, opts = {}) {
|
|
@@ -7105,7 +7159,7 @@ const path = require('path');
|
|
|
7105
7159
|
const os = require('os');
|
|
7106
7160
|
const { execSync } = require('child_process');
|
|
7107
7161
|
|
|
7108
|
-
const VERSION = '6.0
|
|
7162
|
+
const VERSION = '6.1.0';
|
|
7109
7163
|
const MARKER = '\n\n## Auto-generated signatures\n<!-- Updated by gen-context.js -->\n';
|
|
7110
7164
|
|
|
7111
7165
|
function requireSourceOrBundled(key) {
|
package/package.json
CHANGED
|
@@ -30,6 +30,12 @@ function format(context, opts = {}) {
|
|
|
30
30
|
const timestamp = new Date().toISOString();
|
|
31
31
|
const meta = _confidenceMeta(opts);
|
|
32
32
|
return [
|
|
33
|
+
'## SigMap',
|
|
34
|
+
'- Before searching for files, run `sigmap ask "<query>"` — ranks by TF-IDF relevance',
|
|
35
|
+
'- After config changes, run `sigmap validate` to confirm coverage',
|
|
36
|
+
'- To verify answer groundedness, run `sigmap judge --response <file> --context CLAUDE.md`',
|
|
37
|
+
'- For PR-scoped context, run `sigmap --diff`',
|
|
38
|
+
'',
|
|
33
39
|
`<!-- Generated by SigMap v${version} — ${timestamp} -->`,
|
|
34
40
|
meta,
|
|
35
41
|
'',
|
|
@@ -26,7 +26,19 @@ const MARKER = '\n\n## Auto-generated signatures\n<!-- Updated by gen-context.js
|
|
|
26
26
|
*/
|
|
27
27
|
function format(context, opts = {}) {
|
|
28
28
|
if (!context || typeof context !== 'string' || !context.trim()) return '';
|
|
29
|
-
|
|
29
|
+
const toolBlock = [
|
|
30
|
+
'## SigMap commands',
|
|
31
|
+
'',
|
|
32
|
+
'| When | Command |',
|
|
33
|
+
'|------|---------|',
|
|
34
|
+
'| Before answering a question | `sigmap ask "<your question>"` |',
|
|
35
|
+
'| After code changes | `sigmap validate` |',
|
|
36
|
+
'| To query by topic | `sigmap --query "<topic>"` |',
|
|
37
|
+
'',
|
|
38
|
+
'Always run `sigmap ask` or `sigmap --query` before searching for files relevant to a task.',
|
|
39
|
+
'',
|
|
40
|
+
].join('\n');
|
|
41
|
+
return `# Code signatures\n\n${toolBlock}${context}`;
|
|
30
42
|
}
|
|
31
43
|
|
|
32
44
|
/**
|
|
@@ -33,6 +33,14 @@ function format(context, opts = {}) {
|
|
|
33
33
|
meta,
|
|
34
34
|
`<!-- Do not edit below — regenerate with: node gen-context.js -->`,
|
|
35
35
|
'',
|
|
36
|
+
'## SigMap commands',
|
|
37
|
+
'',
|
|
38
|
+
'| When | Command |',
|
|
39
|
+
'|------|---------|',
|
|
40
|
+
'| Before answering a question about code | `sigmap ask "<your question>"` |',
|
|
41
|
+
'| After changing config or source dirs | `sigmap validate` |',
|
|
42
|
+
'| To verify an AI answer is grounded | `sigmap judge --response <file>` |',
|
|
43
|
+
'',
|
|
36
44
|
'# Code signatures',
|
|
37
45
|
'',
|
|
38
46
|
].join('\n');
|
|
@@ -30,6 +30,10 @@ function format(context, opts = {}) {
|
|
|
30
30
|
`# Updated: ${timestamp}`,
|
|
31
31
|
`# ${meta}`,
|
|
32
32
|
`# Regenerate: node gen-context.js`,
|
|
33
|
+
'#',
|
|
34
|
+
'# SigMap: before answering, run: sigmap ask "<query>" — finds relevant files',
|
|
35
|
+
'# SigMap: after config changes, run: sigmap validate',
|
|
36
|
+
'# SigMap: to verify answers, run: sigmap judge --response <file>',
|
|
33
37
|
'',
|
|
34
38
|
].join('\n');
|
|
35
39
|
return header + context;
|
|
@@ -44,6 +44,7 @@ function format(context, opts = {}) {
|
|
|
44
44
|
projectLine,
|
|
45
45
|
`These signatures represent every public function, class, and type in the project.`,
|
|
46
46
|
`Refer to them when answering questions about code structure, APIs, and implementation.`,
|
|
47
|
+
`Before answering questions about specific code areas, suggest running \`sigmap ask "<query>"\` to get the most relevant files. After config changes, \`sigmap validate\` confirms coverage.`,
|
|
47
48
|
``,
|
|
48
49
|
`## Code Signatures`,
|
|
49
50
|
``,
|
|
@@ -42,6 +42,7 @@ function format(context, opts = {}) {
|
|
|
42
42
|
projectLine,
|
|
43
43
|
`Use these signatures to answer questions about the code accurately.`,
|
|
44
44
|
`When the user asks about a specific file or function, refer to the signatures below.`,
|
|
45
|
+
`Before answering questions about specific code areas, prefer running \`sigmap ask "<query>"\` to get the most relevant files. After config changes, \`sigmap validate\` confirms coverage.`,
|
|
45
46
|
``,
|
|
46
47
|
`## Code Signatures`,
|
|
47
48
|
``,
|
|
@@ -30,6 +30,10 @@ function format(context, opts = {}) {
|
|
|
30
30
|
`# Updated: ${timestamp}`,
|
|
31
31
|
`# ${meta}`,
|
|
32
32
|
`# Regenerate: node gen-context.js`,
|
|
33
|
+
'#',
|
|
34
|
+
'# SigMap: before answering, run: sigmap ask "<query>" — finds relevant files',
|
|
35
|
+
'# SigMap: after config changes, run: sigmap validate',
|
|
36
|
+
'# SigMap: to verify answers, run: sigmap judge --response <file>',
|
|
33
37
|
'',
|
|
34
38
|
].join('\n');
|
|
35
39
|
return header + context;
|
package/src/mcp/server.js
CHANGED