cntx-ui 3.1.13 → 3.1.15

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.
@@ -256,6 +256,10 @@ This agent is **stateful**. All interactions in this directory are logged to a p
256
256
  }
257
257
  inferBundlePurpose(name, files) {
258
258
  const n = name.toLowerCase();
259
+ if (n === 'master')
260
+ return 'Full Project Index (Source of Truth)';
261
+ if (n.startsWith('smart:'))
262
+ return 'Auto-grouped Code Structures (' + n.split('-').pop() + ')';
259
263
  if (n.includes('component') || n.includes('ui') || n.includes('view') || n.includes('screen'))
260
264
  return 'UI Components & Views';
261
265
  if (n.includes('api') || n.includes('server') || n.includes('backend') || n.includes('netlify'))
@@ -40,10 +40,7 @@ export default class SemanticSplitter {
40
40
  rust: new Parser(),
41
41
  json: new Parser(),
42
42
  css: new Parser(),
43
- html: new Parser(),
44
- sql: new LegacyParser(),
45
- markdown: new LegacyParser(),
46
- toml: new LegacyParser()
43
+ html: new Parser()
47
44
  };
48
45
  this.parsers.javascript.setLanguage(JavaScript);
49
46
  this.parsers.typescript.setLanguage(TypeScript.typescript);
@@ -52,9 +49,28 @@ export default class SemanticSplitter {
52
49
  this.parsers.json.setLanguage(Json);
53
50
  this.parsers.css.setLanguage(Css);
54
51
  this.parsers.html.setLanguage(Html);
55
- this.parsers.sql.setLanguage(Sql);
56
- this.parsers.markdown.setLanguage(Markdown);
57
- this.parsers.toml.setLanguage(Toml);
52
+ // Optional legacy parsers (native bindings often fail in global npm installs)
53
+ try {
54
+ this.parsers.sql = new LegacyParser();
55
+ this.parsers.sql.setLanguage(Sql);
56
+ }
57
+ catch (e) {
58
+ this.log('⚠️ SQL parser unavailable (native binding missing). Skipping SQL semantic analysis.');
59
+ }
60
+ try {
61
+ this.parsers.markdown = new LegacyParser();
62
+ this.parsers.markdown.setLanguage(Markdown);
63
+ }
64
+ catch (e) {
65
+ this.log('⚠️ Markdown parser unavailable. Skipping MD semantic analysis.');
66
+ }
67
+ try {
68
+ this.parsers.toml = new LegacyParser();
69
+ this.parsers.toml.setLanguage(Toml);
70
+ }
71
+ catch (e) {
72
+ this.log('⚠️ TOML parser unavailable. Skipping TOML semantic analysis.');
73
+ }
58
74
  this.heuristicsManager = new HeuristicsManager();
59
75
  }
60
76
  log(message) {
@@ -66,21 +82,43 @@ export default class SemanticSplitter {
66
82
  }
67
83
  }
68
84
  getParser(filePath) {
69
- const ext = extname(filePath);
85
+ const ext = extname(filePath).toLowerCase();
86
+ let parser;
70
87
  switch (ext) {
71
- case '.json': return this.parsers.json;
72
- case '.css': return this.parsers.css;
73
- case '.scss': return this.parsers.css;
74
- case '.html': return this.parsers.html;
75
- case '.sql': return this.parsers.sql;
76
- case '.md': return this.parsers.markdown;
77
- case '.toml': return this.parsers.toml;
78
- case '.jsx': return this.parsers.javascript;
79
- case '.ts': return this.parsers.typescript;
80
- case '.tsx': return this.parsers.tsx;
81
- case '.rs': return this.parsers.rust;
82
- default: return this.parsers.javascript;
83
- }
88
+ case '.json':
89
+ parser = this.parsers.json;
90
+ break;
91
+ case '.css':
92
+ case '.scss':
93
+ parser = this.parsers.css;
94
+ break;
95
+ case '.html':
96
+ parser = this.parsers.html;
97
+ break;
98
+ case '.sql':
99
+ parser = this.parsers.sql;
100
+ break;
101
+ case '.md':
102
+ parser = this.parsers.markdown;
103
+ break;
104
+ case '.toml':
105
+ parser = this.parsers.toml;
106
+ break;
107
+ case '.jsx':
108
+ parser = this.parsers.javascript;
109
+ break;
110
+ case '.ts':
111
+ parser = this.parsers.typescript;
112
+ break;
113
+ case '.tsx':
114
+ parser = this.parsers.tsx;
115
+ break;
116
+ case '.rs':
117
+ parser = this.parsers.rust;
118
+ break;
119
+ default: parser = this.parsers.javascript;
120
+ }
121
+ return parser || null;
84
122
  }
85
123
  /**
86
124
  * Main entry point - extract semantic chunks from project
@@ -125,6 +163,12 @@ export default class SemanticSplitter {
125
163
  return [];
126
164
  }
127
165
  const parser = this.getParser(relativePath);
166
+ if (!parser) {
167
+ if (this.options.verbose) {
168
+ this.log(`⚠️ No parser available for ${relativePath}, skipping.`);
169
+ }
170
+ return [];
171
+ }
128
172
  try {
129
173
  const tree = parser.parse(content);
130
174
  const root = tree.rootNode;
package/dist/server.js CHANGED
@@ -227,7 +227,7 @@ export class CntxServer {
227
227
  }
228
228
  async listen(port = 3333, host = 'localhost') {
229
229
  if (this.isMcp) {
230
- this.log('Mode: MCP (stdio) - Skipping HTTP server start');
230
+ this.log('Mode: MCP (stdio) - Skipping HTTP server (no port fallback required)');
231
231
  return null;
232
232
  }
233
233
  const server = createServer((req, res) => {
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "cntx-ui",
3
3
  "type": "module",
4
- "version": "3.1.13",
4
+ "version": "3.1.15",
5
5
  "description": "Autonomous Repository Intelligence engine with web UI and MCP server. Unified semantic code understanding, local RAG, and agent working memory.",
6
6
  "keywords": [
7
7
  "repository-intelligence",