smart-context-mcp 1.7.6 → 1.7.7
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/README.md +18 -0
- package/package.json +1 -1
- package/src/index-manager.js +21 -4
package/README.md
CHANGED
|
@@ -50,6 +50,24 @@ npx smart-context-init --target .
|
|
|
50
50
|
```
|
|
51
51
|
Restart your AI client. Done.
|
|
52
52
|
|
|
53
|
+
### Verify Installation
|
|
54
|
+
|
|
55
|
+
```bash
|
|
56
|
+
# Check installed version
|
|
57
|
+
npm list -g smart-context-mcp
|
|
58
|
+
|
|
59
|
+
# Should show: smart-context-mcp@1.7.6 (or later)
|
|
60
|
+
|
|
61
|
+
# Update to latest version
|
|
62
|
+
npm update -g smart-context-mcp
|
|
63
|
+
|
|
64
|
+
# Or reinstall from scratch
|
|
65
|
+
npm uninstall -g smart-context-mcp
|
|
66
|
+
npm install -g smart-context-mcp
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
**After updating:** Restart your AI client to load the new version.
|
|
70
|
+
|
|
53
71
|
---
|
|
54
72
|
|
|
55
73
|
## Task Runner
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "smart-context-mcp",
|
|
3
|
-
"version": "1.7.
|
|
3
|
+
"version": "1.7.7",
|
|
4
4
|
"description": "MCP server that reduces agent token usage by 90% with intelligent context compression, task checkpoint persistence, and workflow-aware agent guidance.",
|
|
5
5
|
"author": "Francisco Caballero Portero <fcp1978@hotmail.com>",
|
|
6
6
|
"type": "module",
|
package/src/index-manager.js
CHANGED
|
@@ -71,8 +71,25 @@ const isTestEnvironment = () => {
|
|
|
71
71
|
process.argv.some(arg => arg.includes('--test'));
|
|
72
72
|
};
|
|
73
73
|
|
|
74
|
+
const isMcpEnvironment = () => {
|
|
75
|
+
return process.env.MCP_SERVER === 'true' ||
|
|
76
|
+
process.argv.some(arg => arg.includes('devctx-server'));
|
|
77
|
+
};
|
|
78
|
+
|
|
79
|
+
const log = (message, level = 'info') => {
|
|
80
|
+
if (isTestEnvironment() || isMcpEnvironment()) {
|
|
81
|
+
return;
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
if (level === 'warn') {
|
|
85
|
+
console.warn(message);
|
|
86
|
+
} else {
|
|
87
|
+
console.log(message);
|
|
88
|
+
}
|
|
89
|
+
};
|
|
90
|
+
|
|
74
91
|
export const ensureIndexReady = async (options = {}) => {
|
|
75
|
-
const { force = false, timeoutMs = INDEX_BUILD_TIMEOUT_MS, root = projectRoot, silent =
|
|
92
|
+
const { force = false, timeoutMs = INDEX_BUILD_TIMEOUT_MS, root = projectRoot, silent = false } = options;
|
|
76
93
|
|
|
77
94
|
if (!force) {
|
|
78
95
|
const existingIndex = loadIndex(root);
|
|
@@ -85,7 +102,7 @@ export const ensureIndexReady = async (options = {}) => {
|
|
|
85
102
|
}
|
|
86
103
|
|
|
87
104
|
if (!silent) {
|
|
88
|
-
|
|
105
|
+
log('📦 Building search index (this may take 30-60s)...');
|
|
89
106
|
}
|
|
90
107
|
|
|
91
108
|
try {
|
|
@@ -103,12 +120,12 @@ export const ensureIndexReady = async (options = {}) => {
|
|
|
103
120
|
}, root);
|
|
104
121
|
|
|
105
122
|
if (!silent) {
|
|
106
|
-
|
|
123
|
+
log('✅ Index ready');
|
|
107
124
|
}
|
|
108
125
|
return { status: 'built', cached: false, fileCount: result?.files?.length || 0 };
|
|
109
126
|
} catch (error) {
|
|
110
127
|
if (!silent) {
|
|
111
|
-
|
|
128
|
+
log('⚠️ Index build failed, search will use fallback mode', 'warn');
|
|
112
129
|
}
|
|
113
130
|
return { status: 'fallback', error: error.message };
|
|
114
131
|
}
|