sigmap 3.3.1 → 3.3.3

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.
@@ -0,0 +1,74 @@
1
+ 'use strict';
2
+
3
+ /**
4
+ * Extract signatures from Terraform (.tf / .tfvars) configuration files.
5
+ * Captures resource, data, module, variable, output, locals, provider,
6
+ * terraform blocks, and moved/import blocks.
7
+ *
8
+ * @param {string} src - Raw Terraform content
9
+ * @returns {string[]} Array of signature strings
10
+ */
11
+ function extract(src) {
12
+ if (!src || typeof src !== 'string') return [];
13
+ const sigs = [];
14
+
15
+ // Strip single-line comments
16
+ const stripped = src
17
+ .replace(/\/\/[^\n]*/g, '')
18
+ .replace(/#[^\n]*/g, '')
19
+ .replace(/\/\*[\s\S]*?\*\//g, '');
20
+
21
+ // resource "<type>" "<name>" { ... }
22
+ for (const m of stripped.matchAll(/\bresource\s+"([^"]+)"\s+"([^"]+)"\s*\{/g)) {
23
+ sigs.push(`resource "${m[1]}" "${m[2]}"`);
24
+ }
25
+
26
+ // data "<type>" "<name>" { ... }
27
+ for (const m of stripped.matchAll(/\bdata\s+"([^"]+)"\s+"([^"]+)"\s*\{/g)) {
28
+ sigs.push(`data "${m[1]}" "${m[2]}"`);
29
+ }
30
+
31
+ // module "<name>" { ... }
32
+ for (const m of stripped.matchAll(/\bmodule\s+"([^"]+)"\s*\{/g)) {
33
+ sigs.push(`module "${m[1]}"`);
34
+ }
35
+
36
+ // variable "<name>" { ... }
37
+ for (const m of stripped.matchAll(/\bvariable\s+"([^"]+)"\s*\{/g)) {
38
+ sigs.push(`variable "${m[1]}"`);
39
+ }
40
+
41
+ // output "<name>" { ... }
42
+ for (const m of stripped.matchAll(/\boutput\s+"([^"]+)"\s*\{/g)) {
43
+ sigs.push(`output "${m[1]}"`);
44
+ }
45
+
46
+ // provider "<name>" { ... }
47
+ for (const m of stripped.matchAll(/\bprovider\s+"([^"]+)"\s*\{/g)) {
48
+ sigs.push(`provider "${m[1]}"`);
49
+ }
50
+
51
+ // locals { ... } (just mark presence; key names too noisy to enumerate)
52
+ if (/\blocals\s*\{/.test(stripped)) {
53
+ sigs.push('locals { ... }');
54
+ }
55
+
56
+ // terraform { required_providers / backend }
57
+ if (/\bterraform\s*\{/.test(stripped)) {
58
+ sigs.push('terraform { ... }');
59
+ }
60
+
61
+ // moved block
62
+ for (const m of stripped.matchAll(/\bmoved\s*\{[\s\S]*?from\s*=\s*([^\n]+)/g)) {
63
+ sigs.push(`moved from ${m[1].trim()}`);
64
+ }
65
+
66
+ // import block (Terraform 1.5+)
67
+ for (const m of stripped.matchAll(/\bimport\s*\{[\s\S]*?to\s*=\s*([^\n]+)/g)) {
68
+ sigs.push(`import to ${m[1].trim()}`);
69
+ }
70
+
71
+ return sigs;
72
+ }
73
+
74
+ module.exports = { extract };
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.2.1',
21
+ version: '3.3.2',
22
22
  description: 'SigMap MCP server — code signatures on demand',
23
23
  };
24
24