sigmap 7.2.1 → 7.3.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/llms-full.txt CHANGED
@@ -9,7 +9,7 @@ the files relevant to the task — cutting tokens ~97% while keeping answers
9
9
  grounded. Deterministic, offline, no embeddings or vector database. Works with
10
10
  Claude, Cursor, GitHub Copilot, Aider, Windsurf, local LLMs, and MCP.
11
11
 
12
- # Version: 7.2.1 | Benchmark: sigmap-v7.0-main (2026-06-14)
12
+ # Version: 7.3.0 | Benchmark: sigmap-v7.0-main (2026-06-14)
13
13
  # Source: auto-generated from package.json, version.json, src/mcp/tools.js, src/config/defaults.js
14
14
  # Regenerate: npm run generate:llms | Validate: npm run validate:llms
15
15
 
@@ -24,7 +24,7 @@ Claude, Cursor, GitHub Copilot, Aider, Windsurf, local LLMs, and MCP.
24
24
  | Task success proxy | 10% | 52.2% |
25
25
  | Prompts per task | 2.84 | 1.72 (39.4% fewer) |
26
26
  | Supported languages | — | 31 |
27
- | MCP tools | — | 11 |
27
+ | MCP tools | — | 12 |
28
28
  | npm runtime dependencies | — | 0 |
29
29
 
30
30
  ---
@@ -114,7 +114,7 @@ sigmap --version Show version
114
114
 
115
115
  ---
116
116
 
117
- ## MCP server — 11 tools
117
+ ## MCP server — 12 tools
118
118
 
119
119
  Start with `sigmap --mcp` (stdio JSON-RPC). Configure once:
120
120
 
@@ -210,6 +210,14 @@ Recall the project decision log — recent notes left by humans or agents across
210
210
  Input: { limit?: number }
211
211
  ```
212
212
 
213
+ ### get_callee_signatures
214
+
215
+ Return the EXACT current signature(s) of named symbols (functions, classes, methods) from the index — so an agent never guesses a callee's parameter types from training memory. Call this before writing code that uses a symbol. Unknown names get a closest-match suggestion.
216
+
217
+ ```
218
+ Input: { symbols: array }
219
+ ```
220
+
213
221
  ---
214
222
 
215
223
  ## Configuration (gen-context.config.json)
package/llms.txt CHANGED
@@ -9,7 +9,7 @@ the files relevant to the task — cutting tokens ~97% while keeping answers
9
9
  grounded. Deterministic, offline, no embeddings or vector database. Works with
10
10
  Claude, Cursor, GitHub Copilot, Aider, Windsurf, local LLMs, and MCP.
11
11
 
12
- # Version: 7.2.1 | Benchmark: sigmap-v7.0-main (2026-06-14)
12
+ # Version: 7.3.0 | Benchmark: sigmap-v7.0-main (2026-06-14)
13
13
  # Source: auto-generated from package.json, version.json, src/mcp/tools.js, src/config/defaults.js
14
14
  # Regenerate: npm run generate:llms | Validate: npm run validate:llms
15
15
 
@@ -27,7 +27,7 @@ Claude, Cursor, GitHub Copilot, Aider, Windsurf, local LLMs, and MCP.
27
27
  - Token reduction: 97.0% average across benchmark repos
28
28
  - Task success: 52.2% vs 10% without SigMap
29
29
  - Prompts per task: 1.72 vs 2.84 baseline (39.4% fewer)
30
- - Languages: 31 supported · MCP tools: 11
30
+ - Languages: 31 supported · MCP tools: 12
31
31
  - Dependencies: zero npm runtime dependencies · fully offline
32
32
 
33
33
  ## Quick start
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "sigmap",
3
- "version": "7.2.1",
3
+ "version": "7.3.0",
4
4
  "description": "97% token reduction for AI coding. Extracts function & class signatures with TF-IDF ranking to feed only the right files to Claude, Cursor, Copilot, Aider, Windsurf, local LLMs & MCP. Zero dependencies, runs offline via npx.",
5
5
  "main": "packages/core/index.js",
6
6
  "exports": {
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "sigmap-cli",
3
- "version": "7.2.1",
3
+ "version": "7.3.0",
4
4
  "description": "SigMap CLI wrapper — thin adapter for programmatic CLI invocation",
5
5
  "main": "index.js",
6
6
  "keywords": [
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "sigmap-core",
3
- "version": "7.2.1",
3
+ "version": "7.3.0",
4
4
  "description": "SigMap core library — zero-dependency code signature extraction, retrieval, and security scanning",
5
5
  "main": "index.js",
6
6
  "keywords": [
@@ -543,4 +543,57 @@ function readMemory(args, cwd) {
543
543
  return out.join('\n');
544
544
  }
545
545
 
546
- module.exports = { readContext, searchSignatures, getMap, createCheckpoint, getRouting, explainFile, listModules, queryContext, getImpact, getLines, readMemory };
546
+ /**
547
+ * get_callee_signatures — return the exact defining signature(s) of named
548
+ * symbols from the index, so an agent never guesses a callee's parameter types.
549
+ * Unknown names get a closest-match suggestion.
550
+ * @param {{symbols:string[]}} args
551
+ * @param {string} cwd
552
+ */
553
+ function getCalleeSignatures(args, cwd) {
554
+ const symbols = args && Array.isArray(args.symbols)
555
+ ? args.symbols.map((s) => String(s).trim()).filter(Boolean)
556
+ : null;
557
+ if (!symbols || symbols.length === 0) {
558
+ return 'Missing required argument: symbols (non-empty string[])';
559
+ }
560
+
561
+ try {
562
+ const { buildSigIndex } = require('../retrieval/ranker');
563
+ const { buildSymbolCandidates, closestMatch, formatSuggestion } = require('../verify/closest-match');
564
+ const index = buildSigIndex(cwd);
565
+ if (index.size === 0) return 'No context file found. Run: node gen-context.js';
566
+
567
+ // Extract the defining symbol name from a signature line (same rules as
568
+ // buildSymbolCandidates) so we match definitions, not param occurrences.
569
+ const defName = (sig) => {
570
+ const cleaned = String(sig).replace(/\s*:\d+(?:-\d+)?\s*$/, '');
571
+ const m = cleaned.match(/\b(?:async\s+function|function|class|def|interface|type|enum|const|let|var)\s+([A-Za-z_$][\w$]*)/)
572
+ || cleaned.match(/([A-Za-z_$][\w$]*)\s*\(/);
573
+ return m ? m[1] : null;
574
+ };
575
+
576
+ const candidates = buildSymbolCandidates(index);
577
+ const blocks = [];
578
+ for (const symbol of symbols) {
579
+ const matches = [];
580
+ for (const [file, sigs] of index.entries()) {
581
+ for (const sig of sigs) {
582
+ if (defName(sig) === symbol) matches.push(`${sig} (${file})`);
583
+ }
584
+ }
585
+ if (matches.length === 0) {
586
+ const cm = closestMatch(symbol, candidates);
587
+ const hint = cm ? ' — ' + formatSuggestion(cm) : '';
588
+ blocks.push(`### ${symbol}\n_not found in index${hint}_`);
589
+ } else {
590
+ blocks.push(`### ${symbol}\n${matches.join('\n')}`);
591
+ }
592
+ }
593
+ return blocks.join('\n\n');
594
+ } catch (err) {
595
+ return `_get_callee_signatures failed: ${err.message}_`;
596
+ }
597
+ }
598
+
599
+ module.exports = { readContext, searchSignatures, getMap, createCheckpoint, getRouting, explainFile, listModules, queryContext, getImpact, getLines, readMemory, getCalleeSignatures };
package/src/mcp/server.js CHANGED
@@ -14,11 +14,11 @@
14
14
 
15
15
  const readline = require('readline');
16
16
  const { TOOLS } = require('./tools');
17
- const { readContext, searchSignatures, getMap, createCheckpoint, getRouting, explainFile, listModules, queryContext, getImpact, getLines, readMemory } = require('./handlers');
17
+ const { readContext, searchSignatures, getMap, createCheckpoint, getRouting, explainFile, listModules, queryContext, getImpact, getLines, readMemory, getCalleeSignatures } = require('./handlers');
18
18
 
19
19
  const SERVER_INFO = {
20
20
  name: 'sigmap',
21
- version: '7.2.1',
21
+ version: '7.3.0',
22
22
  description: 'SigMap MCP server — code signatures on demand',
23
23
  };
24
24
 
@@ -77,6 +77,7 @@ function dispatch(msg, cwd) {
77
77
  else if (name === 'get_impact') text = getImpact(args, cwd);
78
78
  else if (name === 'get_lines') text = getLines(args, cwd);
79
79
  else if (name === 'read_memory') text = readMemory(args, cwd);
80
+ else if (name === 'get_callee_signatures') text = getCalleeSignatures(args, cwd);
80
81
  else {
81
82
  respondError(id, -32601, `Unknown tool: ${name}`);
82
83
  return;
package/src/mcp/tools.js CHANGED
@@ -1,9 +1,10 @@
1
1
  'use strict';
2
2
 
3
3
  /**
4
- * MCP tool definitions for SigMap (11 tools).
4
+ * MCP tool definitions for SigMap (12 tools).
5
5
  * read_context, search_signatures, get_map, create_checkpoint, get_routing,
6
- * explain_file, list_modules, query_context, get_impact, get_lines, read_memory.
6
+ * explain_file, list_modules, query_context, get_impact, get_lines, read_memory,
7
+ * get_callee_signatures.
7
8
  */
8
9
 
9
10
  const TOOLS = [
@@ -215,6 +216,25 @@ const TOOLS = [
215
216
  required: [],
216
217
  },
217
218
  },
219
+ {
220
+ name: 'get_callee_signatures',
221
+ description:
222
+ 'Return the EXACT current signature(s) of named symbols (functions, classes, ' +
223
+ "methods) from the index — so an agent never guesses a callee's parameter types " +
224
+ 'from training memory. Call this before writing code that uses a symbol. ' +
225
+ 'Unknown names get a closest-match suggestion.',
226
+ inputSchema: {
227
+ type: 'object',
228
+ properties: {
229
+ symbols: {
230
+ type: 'array',
231
+ items: { type: 'string' },
232
+ description: 'Symbol names to resolve (e.g. ["validateToken", "UserService"]).',
233
+ },
234
+ },
235
+ required: ['symbols'],
236
+ },
237
+ },
218
238
  ];
219
239
 
220
240
  module.exports = { TOOLS };