@softerist/heuristic-mcp 2.1.41 → 2.1.42

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.
@@ -4,6 +4,7 @@ import util from 'util';
4
4
  import path from 'path';
5
5
  import os from 'os';
6
6
  import fs from 'fs/promises';
7
+ import { fileURLToPath } from 'url';
7
8
 
8
9
  const execPromise = util.promisify(exec);
9
10
 
@@ -86,6 +87,21 @@ function getGlobalCacheDir() {
86
87
  return process.env.XDG_CACHE_HOME || path.join(os.homedir(), '.cache');
87
88
  }
88
89
 
90
+ function quoteArg(value) {
91
+ const safe = value ? String(value).replace(/"/g, '\\"') : '';
92
+ return `"${safe}"`;
93
+ }
94
+
95
+ function buildConsoleCommand(workspaceDir = null) {
96
+ const nodeBin = process.execPath;
97
+ const scriptPath = fileURLToPath(new URL('../index.js', import.meta.url));
98
+ const workspace = workspaceDir || process.cwd();
99
+ const envPrefix = process.platform === 'win32'
100
+ ? 'set SMART_CODING_VERBOSE=true &&'
101
+ : 'SMART_CODING_VERBOSE=true';
102
+ return `${envPrefix} ${quoteArg(nodeBin)} ${quoteArg(scriptPath)} --workspace ${quoteArg(workspace)}`;
103
+ }
104
+
89
105
  export async function status() {
90
106
  try {
91
107
  const home = os.homedir();
@@ -258,3 +274,8 @@ export async function status() {
258
274
  console.error(`[Lifecycle] Failed to check status: ${error.message}`);
259
275
  }
260
276
  }
277
+
278
+ export async function logs() {
279
+ console.log(`[Logs] Console logs: ${buildConsoleCommand()}`);
280
+ await status();
281
+ }
package/index.js CHANGED
@@ -1,6 +1,6 @@
1
1
  #!/usr/bin/env node
2
2
  import { Server } from "@modelcontextprotocol/sdk/server/index.js";
3
- import { stop, start, status } from "./features/lifecycle.js";
3
+ import { stop, start, status, logs } from "./features/lifecycle.js";
4
4
  import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js";
5
5
  import { CallToolRequestSchema, ListToolsRequestSchema } from "@modelcontextprotocol/sdk/types.js";
6
6
  import { pipeline } from "@xenova/transformers";
@@ -54,8 +54,7 @@ if (args.includes('--status')) {
54
54
  }
55
55
 
56
56
  if (args.includes('--logs')) {
57
- console.log("⚠️ Note: '--logs' is deprecated. Please use '--status' to see cache information.");
58
- await status();
57
+ await logs();
59
58
  process.exit(0);
60
59
  }
61
60
 
package/package.json CHANGED
@@ -1,20 +1,20 @@
1
1
  {
2
2
  "name": "@softerist/heuristic-mcp",
3
- "version": "2.1.41",
4
- "description": "An enhanced MCP server providing intelligent semantic code search with find-similar-code, recency ranking, and improved chunking. Fork of smart-coding-mcp.",
5
- "type": "module",
6
- "main": "index.js",
7
- "bin": {
8
- "heuristic-mcp": "index.js"
9
- },
10
- "scripts": {
11
- "start": "node index.js",
12
- "dev": "node --watch index.js",
13
- "test": "vitest run",
14
- "test:watch": "vitest",
15
- "clean": "node scripts/clear-cache.js",
16
- "postinstall": "node scripts/postinstall.js && node scripts/download-model.js"
17
- },
3
+ "version": "2.1.42",
4
+ "description": "An enhanced MCP server providing intelligent semantic code search with find-similar-code, recency ranking, and improved chunking. Fork of smart-coding-mcp.",
5
+ "type": "module",
6
+ "main": "index.js",
7
+ "bin": {
8
+ "heuristic-mcp": "index.js"
9
+ },
10
+ "scripts": {
11
+ "start": "node index.js",
12
+ "dev": "node --watch index.js",
13
+ "test": "vitest run",
14
+ "test:watch": "vitest",
15
+ "clean": "node scripts/clear-cache.js",
16
+ "postinstall": "node scripts/postinstall.js && node scripts/download-model.js"
17
+ },
18
18
  "keywords": [
19
19
  "mcp",
20
20
  "semantic-search",