sigmap 3.1.0 → 3.2.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/CHANGELOG.md CHANGED
@@ -10,6 +10,27 @@ Format: [Semantic Versioning](https://semver.org/)
10
10
 
11
11
  ---
12
12
 
13
+ ## [3.2.0] — Planned — Phase A: Cross-Platform Standalone Binaries
14
+
15
+ ### Added
16
+ - **Standalone binaries** — macOS (arm64 + x64), Linux x64, Windows x64 built via Node.js SEA
17
+ - No Node.js or npm required to run SigMap
18
+ - Download from GitHub Releases: `sigmap-darwin-arm64`, `sigmap-darwin-x64`, `sigmap-linux-x64`, `sigmap-win32-x64.exe`
19
+ - SHA-256 checksums in `sigmap-checksums.txt` attached to every release
20
+ - **`scripts/build-binary.mjs`** — reproducible local binary build for the current platform
21
+ - **`scripts/verify-binary.mjs`** — smoke tests `--version`, `--help`, default generate, `--health`, `--report` against a fixture repo
22
+ - **`.github/workflows/release-binaries.yml`** — GHA matrix builds all 4 targets on tag push; attaches artifacts to the GitHub Release
23
+ - **`test/fixtures/binary-smoke/`** — minimal fixture project used by CI smoke tests
24
+ - **`docs/binaries.md`** — install guide covering download, `chmod +x`, macOS Gatekeeper, Windows SmartScreen, and checksum verification
25
+
26
+ ### Technical
27
+ - Uses [Node.js SEA](https://nodejs.org/api/single-executable-applications.html) (Node 20 `--experimental-sea-config` + `postject`)
28
+ - `gen-context.js` was updated to include previously-missing `src/` modules (`todos`, `coverage`, `prdiff`) in the SEA bundle; existing `requireSourceOrBundled()` fallback and DEFAULTS fallback in `writeInitConfig()` remain SEA-compatible
29
+ - Binary builds run natively per OS in GHA (no cross-compilation)
30
+ - `release-attach` job waits for the npm-publish Release to exist before uploading binary assets
31
+
32
+ ---
33
+
13
34
  ## [3.1.0] — 2026-04-07 — Global Command Detection & VS Code Prerelease Fix
14
35
 
15
36
  ### Added
package/README.md CHANGED
@@ -6,7 +6,7 @@
6
6
 
7
7
  <p>
8
8
  Every coding agent session starts with full codebase context at under 4K tokens.<br>
9
- No <code>npm install</code>. No setup. Runs on any machine with Node.js 18+.
9
+ Multiple install options. Zero runtime dependencies. Requires only Node.js 18+.
10
10
  </p>
11
11
 
12
12
  <!-- Status -->
@@ -38,7 +38,8 @@
38
38
  | | |
39
39
  |---|---|
40
40
  | [What it does](#-what-it-does) | Token reduction table, pipeline overview |
41
- | [Quick start](#-quick-start) | Get running in 60 seconds |
41
+ | [Quick start](#-quick-start) | Install (binary or npm), generate in 60 seconds |
42
+ | [Standalone binaries](docs/binaries.md) | macOS, Linux, Windows — no Node required |
42
43
  | [VS Code extension](#-vs-code-extension) | Status bar, stale alerts, commands |
43
44
  | [JetBrains plugin](#-jetbrains-plugin) | IntelliJ IDEA, WebStorm, PyCharm support |
44
45
  | [Languages supported](#-languages-supported) | 21 languages |
@@ -47,6 +48,7 @@
47
48
  | [CLI reference](#-cli-reference) | All flags |
48
49
  | [Configuration](#-configuration) | Config file + .contextignore |
49
50
  | [Observability](#-observability) | Health score, reports, CI |
51
+ | [Programmatic API](#-programmatic-api) | Use as a Node.js library |
50
52
  | [Testing](#-testing) | Run the test suite |
51
53
  | [Project structure](#-project-structure) | File-by-file map |
52
54
  | [Principles](#-principles) | Design decisions |
@@ -88,58 +90,96 @@ AI agent session starts with full context
88
90
 
89
91
  ---
90
92
 
91
- ## 🆕 What's new in 2.4
93
+ ## Installation
92
94
 
93
- | Feature | Description |
94
- |---|---|
95
- | **Programmatic API** | `require('sigmap')` — use `extract`, `rank`, `buildSigIndex`, `scan`, `score` directly, no CLI subprocess |
96
- | **`packages/core/`** | New `sigmap-core` package with stable API surface for third-party integrations |
97
- | **`packages/cli/`** | Thin `sigmap-cli` forward-compat shim for the v3.0 adapter architecture |
98
- | **15 new tests** | `core-api.test.js` covers all exported functions, edge cases, and backward compat |
95
+ Pick the method that fits your workflow — all produce the same output.
99
96
 
100
- ## 🆕 What's new in 2.3
97
+ <details open>
98
+ <summary><strong>npx — try without installing</strong></summary>
101
99
 
102
- | Feature | Description |
103
- |---|---|
104
- | **`--query "<text>"` CLI** | Rank all context files by relevance to a free-text query — scored table + top-3 signature blocks |
105
- | **`--query --json`** | Machine-readable ranked results (`{ query, results[], totalResults }`) |
106
- | **`--query --top <n>`** | Limit results (default 10, configurable via `retrieval.topK`) |
107
- | **`query_context` MCP tool** | 8th MCP tool — `{ query, topK? }` returns ranked file list, usable live in any MCP session |
108
- | **`--analyze` / `--diagnose-extractors`** | Per-file breakdown of sigs/tokens/extractor/coverage; self-tests all 21 extractors (v2.2) |
109
- | **`--benchmark` / `--eval`** | Measure hit@5 and MRR retrieval quality against a JSONL task file (v2.1) |
100
+ ```bash
101
+ npx sigmap
102
+ ```
110
103
 
111
- > **Previous v2.0 additions:** enriched signatures, dependency map, TODO/FIXME section, test coverage markers, structural diff mode, impact radius hints. See [CHANGELOG.md](CHANGELOG.md) for the full history.
104
+ Runs the latest version without any permanent install. Great for a quick try.
112
105
 
113
- ---
106
+ </details>
114
107
 
115
- ## 🔭 What's next — v2.10 (in progress · [#25](https://github.com/manojmallick/sigmap/issues/25))
108
+ <details>
109
+ <summary><strong>npm global — install once, run anywhere</strong></summary>
116
110
 
117
- ### v2.10 — Reporting: Charts + Advanced Metrics
111
+ ```bash
112
+ npm install -g sigmap
113
+ sigmap
114
+ ```
118
115
 
119
- | Feature | Description |
120
- |---|---|
121
- | **Charts in reports** | Visualize token reduction, signature counts, and budget usage per run |
122
- | **Advanced retrieval metrics** | Add precision@K, recall@K, MRR trend, and query-level diagnostics |
123
- | **Evaluation dashboard output** | Generate shareable HTML/JSON benchmark summaries from CLI runs |
124
- | **CI-friendly metrics export** | Persist machine-readable metrics for release gates and regression tracking |
125
- | **Release quality gates** | Add pass/fail thresholds for hit@5 and precision before publish |
116
+ Available from any directory on your machine.
126
117
 
127
- ## 🔌 v3.0 — Platform: Multi-Adapter Architecture
118
+ </details>
128
119
 
129
- SigMap is now an **adapter platform**. Any AI assistant — Copilot, Claude, Cursor, Windsurf, OpenAI, or Gemini — plugs in through a standard interface.
120
+ <details>
121
+ <summary><strong>npm local — per-project, version-pinned</strong></summary>
130
122
 
131
123
  ```bash
132
- # Generate for a specific AI assistant
133
- node gen-context.js --adapter copilot # → .github/copilot-instructions.md
134
- node gen-context.js --adapter openai # → .github/openai-context.md
135
- node gen-context.js --adapter gemini # → .github/gemini-context.md
136
- node gen-context.js --adapter claude # → CLAUDE.md (append)
124
+ npm install --save-dev sigmap
137
125
  ```
138
126
 
139
- ```js
140
- // Programmatic API — fully semver-stable from v3.0
141
- const { adapt } = require('sigmap');
142
- const systemPrompt = adapt(context, 'openai', { version: '3.0.0' });
127
+ Add to `package.json` scripts for team consistency:
128
+
129
+ ```json
130
+ {
131
+ "scripts": {
132
+ "context": "sigmap",
133
+ "context:watch": "sigmap --watch"
134
+ }
135
+ }
136
+ ```
137
+
138
+ Run with `npm run context`. Version is pinned per project.
139
+
140
+ </details>
141
+
142
+ <details>
143
+ <summary><strong>Volta — team-friendly, auto-pinned version</strong></summary>
144
+
145
+ ```bash
146
+ volta install sigmap
147
+ sigmap
148
+ ```
149
+
150
+ [Volta](https://volta.sh) pins the exact version in `package.json` — every team member runs the same version automatically without configuration.
151
+
152
+ </details>
153
+
154
+ <details>
155
+ <summary><strong>Single-file download — no npm, any machine</strong></summary>
156
+
157
+ ```bash
158
+ curl -O https://raw.githubusercontent.com/manojmallick/sigmap/main/gen-context.js
159
+ node gen-context.js
160
+ ```
161
+
162
+ No npm, no `node_modules`. Drop `gen-context.js` into any project and run it directly. Requires only Node.js 18+. Ideal for CI, locked-down environments, or one-off use.
163
+
164
+ </details>
165
+
166
+ > **Note:** When using the single-file download, replace `sigmap` with `node gen-context.js` in all commands below.
167
+
168
+ ---
169
+
170
+ ## 🚀 Features
171
+
172
+ ### Multi-adapter output
173
+
174
+ Generate context for any AI assistant from a single run:
175
+
176
+ ```bash
177
+ sigmap --adapter copilot # → .github/copilot-instructions.md
178
+ sigmap --adapter claude # → CLAUDE.md (appended below marker)
179
+ sigmap --adapter cursor # → .cursorrules
180
+ sigmap --adapter windsurf # → .windsurfrules
181
+ sigmap --adapter openai # → .github/openai-context.md
182
+ sigmap --adapter gemini # → .github/gemini-context.md
143
183
  ```
144
184
 
145
185
  | Adapter | Output file | AI assistant |
@@ -151,45 +191,80 @@ const systemPrompt = adapt(context, 'openai', { version: '3.0.0' });
151
191
  | `openai` | `.github/openai-context.md` | Any OpenAI model |
152
192
  | `gemini` | `.github/gemini-context.md` | Google Gemini |
153
193
 
154
- **Backward compat:** existing `outputs` config key silently maps to `adapters` — no migration needed.
194
+ Configure multiple adapters at once in `gen-context.config.json`:
195
+
196
+ ```json
197
+ { "outputs": ["copilot", "claude", "cursor"] }
198
+ ```
199
+
200
+ ### Programmatic API
201
+
202
+ Use SigMap as a Node.js library without spawning a subprocess. See the [full API reference](#-programmatic-api) below.
203
+
204
+ ### Query-aware retrieval
205
+
206
+ Find the most relevant files for any task without reading the whole codebase:
155
207
 
156
- See full roadmap: [manojmallick.github.io/sigmap/roadmap.html](https://manojmallick.github.io/sigmap/roadmap.html)
208
+ ```bash
209
+ sigmap --query "authentication middleware" # ranked file list
210
+ sigmap --query "auth" --json # machine-readable output
211
+ sigmap --query "auth" --top 5 # top 5 results only
212
+ ```
213
+
214
+ ### Diagnostic and evaluation tools
215
+
216
+ ```bash
217
+ sigmap --analyze # per-file: sigs, tokens, extractor, coverage
218
+ sigmap --analyze --slow # include extraction timing
219
+ sigmap --diagnose-extractors # self-test all 21 extractors against fixtures
220
+ sigmap --benchmark # hit@5 and MRR retrieval quality
221
+ sigmap --benchmark --json # machine-readable benchmark results
222
+ ```
157
223
 
158
224
  ---
159
225
 
160
226
  ## ⚡ Quick start
161
227
 
162
- Download the single-file CLI and generate context immediately:
228
+ ### Install
163
229
 
164
- ```bash
165
- # 1. Download
166
- curl -O https://raw.githubusercontent.com/manojmallick/sigmap/main/gen-context.js
230
+ **Standalone binary** — no Node.js or npm required:
167
231
 
168
- # 2. Generate your context file
169
- node gen-context.js
232
+ | Platform | Download |
233
+ |---|---|
234
+ | macOS Apple Silicon | [`sigmap-darwin-arm64`](https://github.com/manojmallick/sigmap/releases/latest/download/sigmap-darwin-arm64) |
235
+ | macOS Intel | [`sigmap-darwin-x64`](https://github.com/manojmallick/sigmap/releases/latest/download/sigmap-darwin-x64) |
236
+ | Linux x64 | [`sigmap-linux-x64`](https://github.com/manojmallick/sigmap/releases/latest/download/sigmap-linux-x64) |
237
+ | Windows x64 | [`sigmap-win32-x64.exe`](https://github.com/manojmallick/sigmap/releases/latest/download/sigmap-win32-x64.exe) |
170
238
 
171
- # 3. Output: .github/copilot-instructions.md
172
- # That file is auto-read by GitHub Copilot in VS Code
239
+ ```bash
240
+ # macOS / Linux
241
+ chmod +x ./sigmap-darwin-arm64
242
+ ./sigmap-darwin-arm64
173
243
  ```
174
244
 
175
- Or via npm (globally):
245
+ See [docs/binaries.md](docs/binaries.md) for Gatekeeper / SmartScreen notes and checksum verification.
246
+
247
+ **npm** (requires Node.js 18+):
176
248
 
177
249
  ```bash
178
- npx sigmap # run once without installing
179
- npm install -g sigmap # install globally
180
- sigmap # then use anywhere
250
+ npx sigmap # run once without installing
251
+ npm install -g sigmap # install globally
181
252
  ```
182
253
 
183
- ### Common workflows
254
+ ---
255
+
256
+ ### Generate context
257
+
258
+ Download the single-file CLI and generate context immediately:
184
259
 
185
260
  ```bash
186
- node gen-context.js # generate once and exit
187
- node gen-context.js --watch # regenerate on every file save
188
- node gen-context.js --setup # generate + install git hook + start watcher
189
- node gen-context.js --diff # context for git-changed files only (PR mode)
190
- node gen-context.js --diff --staged # staged files only (pre-commit check)
191
- node gen-context.js --health # show context health score (grade A–D)
192
- node gen-context.js --mcp # start MCP server on stdio
261
+ sigmap # generate once and exit
262
+ sigmap --watch # regenerate on every file save
263
+ sigmap --setup # generate + install git hook + start watcher
264
+ sigmap --diff # context for git-changed files only (PR mode)
265
+ sigmap --diff --staged # staged files only (pre-commit check)
266
+ sigmap --health # show context health score (grade A–D)
267
+ sigmap --mcp # start MCP server on stdio
193
268
  ```
194
269
 
195
270
  ### Companion tool: Repomix
@@ -202,8 +277,8 @@ SigMap and [Repomix](https://github.com/yamadashy/repomix) are **complementary,
202
277
  | **Repomix** | On-demand deep sessions, full file content, broader language support |
203
278
 
204
279
  ```bash
205
- node gen-context.js --setup # always-on context
206
- npx repomix --compress # deep dive sessions
280
+ sigmap --setup # always-on context
281
+ npx repomix --compress # deep dive sessions
207
282
  ```
208
283
 
209
284
  *"SigMap for daily always-on context; Repomix for deep one-off sessions — use both."*
@@ -212,8 +287,6 @@ npx repomix --compress # deep dive sessions
212
287
 
213
288
  ## 🧩 VS Code extension
214
289
 
215
- > Introduced in v1.5 — zero runtime npm dependencies.
216
-
217
290
  The `vscode-extension/` directory contains a first-party VS Code extension that keeps you informed without any manual commands.
218
291
 
219
292
  | Feature | Detail |
@@ -232,8 +305,6 @@ Activate on startup (`onStartupFinished`) — loads within 3 s, never blocks edi
232
305
 
233
306
  ## 🔧 JetBrains plugin
234
307
 
235
- > Introduced in v2.9 — brings SigMap to IntelliJ IDEA, WebStorm, PyCharm, and all JetBrains IDEs.
236
-
237
308
  The `jetbrains-plugin/` directory contains a Kotlin-based plugin for JetBrains IDEs with the same core features as the VS Code extension.
238
309
 
239
310
  | Feature | Detail |
@@ -287,7 +358,7 @@ Compatible with **IntelliJ IDEA 2024.1+** (Community & Ultimate), **WebStorm**,
287
358
 
288
359
  ## 🗂 Context strategies
289
360
 
290
- > Introduced in v1.1. Reduce always-injected tokens by 70–90%.
361
+ > Reduce always-injected tokens by 70–90%.
291
362
 
292
363
  Set `"strategy"` in `gen-context.config.json`:
293
364
 
@@ -334,8 +405,6 @@ Recently committed files are **hot** (auto-injected). Everything else is **cold*
334
405
 
335
406
  ## 🔌 MCP server
336
407
 
337
- > Introduced in v0.3, expanded to 8 tools through v2.3.
338
-
339
408
  Start the MCP server on stdio:
340
409
 
341
410
  ```bash
@@ -353,7 +422,7 @@ node gen-context.js --mcp
353
422
  | `list_modules` | — | Token-count table of all top-level module directories |
354
423
  | `create_checkpoint` | `{ summary: string }` | Write a session checkpoint to `.context/` |
355
424
  | `get_routing` | — | Full model routing table |
356
- | `query_context` | `{ query: string, topK?: number }` | Files ranked by relevance to the query (v2.3) |
425
+ | `query_context` | `{ query: string, topK?: number }` | Files ranked by relevance to the query |
357
426
 
358
427
  Reads files on every call — no stale state, no restart needed.
359
428
 
@@ -363,7 +432,7 @@ Reads files on every call — no stale state, no restart needed.
363
432
 
364
433
  ## ⚙️ CLI reference
365
434
 
366
- > All flags live in v1.5. See [CHANGELOG.md](CHANGELOG.md) for when each shipped.
435
+ > See [CHANGELOG.md](CHANGELOG.md) for the full history.
367
436
 
368
437
  ```
369
438
  node gen-context.js Generate once and exit
@@ -548,7 +617,7 @@ node gen-context.js --format cache
548
617
 
549
618
  ---
550
619
 
551
- ## 📦 Programmatic API (v2.4+)
620
+ ## 📦 Programmatic API
552
621
 
553
622
  Use SigMap as a library — no CLI subprocess needed:
554
623
 
@@ -683,61 +752,6 @@ sigmap/
683
752
 
684
753
  ---
685
754
 
686
- ## 📦 Publishing to npm
687
-
688
- Releases are published automatically via GitHub Actions whenever a version tag is pushed.
689
-
690
- ### One-time setup
691
-
692
- 1. **Create an npm account** at [npmjs.com](https://www.npmjs.com) (if you haven't already).
693
-
694
- 2. **Generate an npm access token**:
695
- - npmjs.com → Account → Access Tokens → Generate New Token → **Granular Access Token** (or Classic Automation token)
696
- - Scope: `sigmap` package, permission: **Read and Write**
697
-
698
- 3. **Add the secret to GitHub**:
699
- ```
700
- GitHub repo → Settings → Secrets and variables → Actions → New repository secret
701
- Name: NPM_TOKEN
702
- Value: <paste token>
703
- ```
704
-
705
- ### Releasing a new version
706
-
707
- ```bash
708
- # 1. Bump version in package.json
709
- npm version patch # or minor / major
710
-
711
- # 2. Push the commit AND the new tag
712
- git push && git push --tags
713
- ```
714
-
715
- The [npm-publish workflow](.github/workflows/npm-publish.yml) will:
716
- 1. Run the full test suite
717
- 2. Verify `package.json` version matches the pushed tag
718
- 3. Publish to npm with provenance attestation
719
- 4. Create a GitHub Release with auto-generated notes
720
-
721
- ### Backfilling historical versions
722
-
723
- Tags that existed before the workflow was set up can be published retroactively:
724
-
725
- ```bash
726
- # Dry run first — see what would be published
727
- ./scripts/backfill-npm.sh
728
-
729
- # Actually publish all historical tags
730
- export NPM_TOKEN=npm_xxxxxxxxxxxx
731
- ./scripts/backfill-npm.sh --publish
732
-
733
- # Start from a specific tag
734
- ./scripts/backfill-npm.sh --publish --from v0.5.0
735
- ```
736
-
737
- The script assigns `dist-tag: legacy` to all versions except `v1.5.0` (which gets `latest`), so `npm install sigmap` always resolves to the current release.
738
-
739
- ---
740
-
741
755
  ## 🤝 Contributing
742
756
 
743
757
  See [CONTRIBUTING.md](CONTRIBUTING.md) for how to add a language extractor or new feature.
package/gen-context.js CHANGED
@@ -1892,6 +1892,152 @@ __factories["./src/extractors/yaml"] = function(module, exports) {
1892
1892
 
1893
1893
  };
1894
1894
 
1895
+ // ── ./src/extractors/todos ──
1896
+ __factories["./src/extractors/todos"] = function(module, exports) {
1897
+
1898
+ 'use strict';
1899
+
1900
+ /**
1901
+ * Extract TODO/FIXME/HACK/XXX comments from source text.
1902
+ * @param {string} src - Raw file content
1903
+ * @returns {{line:number, tag:string, text:string}[]}
1904
+ */
1905
+ function extractTodos(src) {
1906
+ if (!src || typeof src !== 'string') return [];
1907
+ const todos = [];
1908
+ const lines = src.split('\n');
1909
+
1910
+ for (let i = 0; i < lines.length; i++) {
1911
+ const m = lines[i].match(/(?:\/\/|#)\s*(TODO|FIXME|HACK|XXX)\s*:?\s*(.+)/i);
1912
+ if (!m) continue;
1913
+ todos.push({
1914
+ line: i + 1,
1915
+ tag: m[1].toUpperCase(),
1916
+ text: m[2].trim().slice(0, 70),
1917
+ });
1918
+ }
1919
+
1920
+ return todos;
1921
+ }
1922
+
1923
+ module.exports = { extractTodos };
1924
+
1925
+ };
1926
+
1927
+ // ── ./src/extractors/coverage ──
1928
+ __factories["./src/extractors/coverage"] = function(module, exports) {
1929
+
1930
+ 'use strict';
1931
+
1932
+ const fs = require('fs');
1933
+ const path = require('path');
1934
+
1935
+ function walkFiles(dir) {
1936
+ let out = [];
1937
+ let entries;
1938
+ try {
1939
+ entries = fs.readdirSync(dir, { withFileTypes: true });
1940
+ } catch (_) {
1941
+ return out;
1942
+ }
1943
+ for (const entry of entries) {
1944
+ const full = path.join(dir, entry.name);
1945
+ if (entry.isDirectory()) out = out.concat(walkFiles(full));
1946
+ else if (entry.isFile()) out.push(full);
1947
+ }
1948
+ return out;
1949
+ }
1950
+
1951
+ function buildTestIndex(cwd, testDirs) {
1952
+ const dirs = Array.isArray(testDirs) && testDirs.length ? testDirs : ['tests', 'test', '__tests__', 'spec'];
1953
+ const names = new Set();
1954
+
1955
+ for (const dir of dirs) {
1956
+ const abs = path.join(cwd, dir);
1957
+ if (!fs.existsSync(abs)) continue;
1958
+ for (const file of walkFiles(abs)) {
1959
+ let src = '';
1960
+ try {
1961
+ src = fs.readFileSync(file, 'utf8');
1962
+ } catch (_) {
1963
+ continue;
1964
+ }
1965
+
1966
+ for (const m of src.matchAll(/\b(?:test_|it\(|test\(|describe\()\s*['"`]?([\w_]+)/g)) {
1967
+ if (m[1] && m[1].length >= 3) names.add(m[1].toLowerCase());
1968
+ }
1969
+
1970
+ for (const m of src.matchAll(/\b([a-zA-Z_][a-zA-Z0-9_]*)\b/g)) {
1971
+ if (m[1] && m[1].length >= 4) names.add(m[1].toLowerCase());
1972
+ }
1973
+ }
1974
+ }
1975
+
1976
+ return names;
1977
+ }
1978
+
1979
+ function isTested(funcName, testIndex) {
1980
+ if (!funcName || funcName.length < 3 || !testIndex || testIndex.size === 0) return false;
1981
+ const lower = funcName.toLowerCase();
1982
+ if (testIndex.has(lower) || testIndex.has(`test_${lower}`)) return true;
1983
+ return false;
1984
+ }
1985
+
1986
+ module.exports = { buildTestIndex, isTested };
1987
+
1988
+ };
1989
+
1990
+ // ── ./src/extractors/prdiff ──
1991
+ __factories["./src/extractors/prdiff"] = function(module, exports) {
1992
+
1993
+ 'use strict';
1994
+
1995
+ /**
1996
+ * Compare signature arrays and produce compact diff markers.
1997
+ * @param {string[]} baseSigs
1998
+ * @param {string[]} currentSigs
1999
+ * @returns {{added:string[], removed:string[], modified:string[]}}
2000
+ */
2001
+ function diffSignatures(baseSigs, currentSigs) {
2002
+ const base = new Set(baseSigs || []);
2003
+ const curr = new Set(currentSigs || []);
2004
+
2005
+ const added = [...curr].filter((s) => !base.has(s));
2006
+ const removed = [...base].filter((s) => !curr.has(s));
2007
+
2008
+ const byName = (arr) => {
2009
+ const m = new Map();
2010
+ for (const s of arr) {
2011
+ const n = extractName(s);
2012
+ if (!n) continue;
2013
+ if (!m.has(n)) m.set(n, []);
2014
+ m.get(n).push(s);
2015
+ }
2016
+ return m;
2017
+ };
2018
+
2019
+ const aBy = byName(added);
2020
+ const rBy = byName(removed);
2021
+ const modified = [];
2022
+
2023
+ for (const [name] of aBy) {
2024
+ if (rBy.has(name)) modified.push(name);
2025
+ }
2026
+
2027
+ return { added, removed, modified };
2028
+ }
2029
+
2030
+ function extractName(sig) {
2031
+ if (!sig) return '';
2032
+ const t = sig.trim();
2033
+ const m = t.match(/(?:def|function|func|class|interface|trait|struct|enum|record)?\s*([A-Za-z_][A-Za-z0-9_]*)\s*(?:\(|$)/);
2034
+ return m ? m[1] : '';
2035
+ }
2036
+
2037
+ module.exports = { diffSignatures, extractName };
2038
+
2039
+ };
2040
+
1895
2041
  // ── ./src/format/cache ──
1896
2042
  __factories["./src/format/cache"] = function(module, exports) {
1897
2043
 
@@ -3554,7 +3700,7 @@ __factories["./src/mcp/server"] = function(module, exports) {
3554
3700
 
3555
3701
  const SERVER_INFO = {
3556
3702
  name: 'sigmap',
3557
- version: '2.10.0',
3703
+ version: '3.2.0',
3558
3704
  description: 'SigMap MCP server — code signatures on demand',
3559
3705
  };
3560
3706
 
@@ -4903,7 +5049,7 @@ const path = require('path');
4903
5049
  const os = require('os');
4904
5050
  const { execSync } = require('child_process');
4905
5051
 
4906
- const VERSION = '3.0.1';
5052
+ const VERSION = '3.2.0';
4907
5053
  const MARKER = '\n\n## Auto-generated signatures\n<!-- Updated by gen-context.js -->\n';
4908
5054
 
4909
5055
  function requireSourceOrBundled(key) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "sigmap",
3
- "version": "3.1.0",
3
+ "version": "3.2.0",
4
4
  "description": "Zero-dependency AI context engine — 97% token reduction. No npm install. Runs on Node 18+.",
5
5
  "main": "gen-context.js",
6
6
  "exports": {
@@ -25,7 +25,9 @@
25
25
  "report": "node gen-context.js --report",
26
26
  "health": "node gen-context.js --health",
27
27
  "map": "node gen-project-map.js",
28
- "mcp": "node gen-context.js --mcp"
28
+ "mcp": "node gen-context.js --mcp",
29
+ "build:binary": "node scripts/build-binary.mjs",
30
+ "verify:binary": "node scripts/verify-binary.mjs"
29
31
  },
30
32
  "files": [
31
33
  "gen-context.js",
package/src/mcp/server.js CHANGED
@@ -18,7 +18,7 @@ const { readContext, searchSignatures, getMap, createCheckpoint, getRouting, exp
18
18
 
19
19
  const SERVER_INFO = {
20
20
  name: 'sigmap',
21
- version: '3.0.1',
21
+ version: '3.2.0',
22
22
  description: 'SigMap MCP server — code signatures on demand',
23
23
  };
24
24