@zokizuan/satori-mcp 3.4.0 → 3.5.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/README.md +1 -1
- package/dist/core/call-graph.js +10 -10
- package/dist/core/handlers.js +5 -5
- package/dist/tools/call_graph.js +1 -1
- package/dist/tools/read_file.js +2 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -85,7 +85,7 @@ Unified semantic search with runtime/docs scope control, grouped/raw output mode
|
|
|
85
85
|
|
|
86
86
|
### `call_graph`
|
|
87
87
|
|
|
88
|
-
Traverse the prebuilt TS/Python call graph sidecar for callers/callees/bidirectional symbol relationships.
|
|
88
|
+
Traverse the prebuilt TS/JS/Python call graph sidecar for callers/callees/bidirectional symbol relationships.
|
|
89
89
|
|
|
90
90
|
| Parameter | Type | Required | Default | Description |
|
|
91
91
|
|---|---|---|---|---|
|
package/dist/core/call-graph.js
CHANGED
|
@@ -3,9 +3,10 @@ import * as os from 'node:os';
|
|
|
3
3
|
import * as path from 'node:path';
|
|
4
4
|
import crypto from 'node:crypto';
|
|
5
5
|
import ignore from 'ignore';
|
|
6
|
-
import { AstCodeSplitter } from '@zokizuan/satori-core';
|
|
7
|
-
const SUPPORTED_SOURCE_EXTENSIONS = new Set(
|
|
8
|
-
const QUERY_SUPPORTED_EXTENSIONS = new Set(
|
|
6
|
+
import { AstCodeSplitter, getLanguageIdFromExtension, getSupportedExtensionsForCapability, getSupportedLanguageIdsForCapability, } from '@zokizuan/satori-core';
|
|
7
|
+
const SUPPORTED_SOURCE_EXTENSIONS = new Set(getSupportedExtensionsForCapability('callGraphBuild'));
|
|
8
|
+
const QUERY_SUPPORTED_EXTENSIONS = new Set(getSupportedExtensionsForCapability('callGraphQuery'));
|
|
9
|
+
const QUERY_SUPPORTED_LANGUAGE_IDS = getSupportedLanguageIdsForCapability('callGraphQuery');
|
|
9
10
|
const DEFAULT_IGNORE_PATTERNS = ['**/node_modules/**', '**/.git/**', '**/dist/**', '**/build/**', '**/coverage/**', '**/.next/**'];
|
|
10
11
|
const CALL_KEYWORDS = new Set([
|
|
11
12
|
'if', 'for', 'while', 'switch', 'catch', 'return', 'new', 'typeof', 'function', 'class', 'def', 'await', 'with', 'from', 'import',
|
|
@@ -478,11 +479,9 @@ export class CallGraphSidecarManager {
|
|
|
478
479
|
}
|
|
479
480
|
getSplitLanguage(relativePath) {
|
|
480
481
|
const ext = path.extname(relativePath).toLowerCase();
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
if (ext === '.ts' || ext === '.tsx' || ext === '.js' || ext === '.jsx' || ext === '.mjs' || ext === '.cjs') {
|
|
485
|
-
return ext === '.js' || ext === '.jsx' || ext === '.mjs' || ext === '.cjs' ? 'javascript' : 'typescript';
|
|
482
|
+
const language = getLanguageIdFromExtension(ext, 'unknown');
|
|
483
|
+
if (language === 'python' || language === 'typescript' || language === 'javascript') {
|
|
484
|
+
return language;
|
|
486
485
|
}
|
|
487
486
|
return 'unknown';
|
|
488
487
|
}
|
|
@@ -495,8 +494,9 @@ export class CallGraphSidecarManager {
|
|
|
495
494
|
supported: false,
|
|
496
495
|
reason: 'unsupported_language',
|
|
497
496
|
hints: {
|
|
498
|
-
supportedExtensions:
|
|
499
|
-
|
|
497
|
+
supportedExtensions: Array.from(QUERY_SUPPORTED_EXTENSIONS).sort((a, b) => a.localeCompare(b)),
|
|
498
|
+
supportedLanguages: QUERY_SUPPORTED_LANGUAGE_IDS,
|
|
499
|
+
message: 'call_graph currently supports TypeScript, JavaScript, and Python symbols.',
|
|
500
500
|
},
|
|
501
501
|
};
|
|
502
502
|
}
|
package/dist/core/handlers.js
CHANGED
|
@@ -2,7 +2,7 @@ import * as fs from "fs";
|
|
|
2
2
|
import * as path from "path";
|
|
3
3
|
import crypto from "node:crypto";
|
|
4
4
|
import ignore from "ignore";
|
|
5
|
-
import { COLLECTION_LIMIT_MESSAGE } from "@zokizuan/satori-core";
|
|
5
|
+
import { COLLECTION_LIMIT_MESSAGE, getSupportedExtensionsForCapability, isLanguageCapabilitySupportedForExtension, isLanguageCapabilitySupportedForLanguage, } from "@zokizuan/satori-core";
|
|
6
6
|
import { ensureAbsolutePath, truncateContent, trackCodebasePath } from "../utils.js";
|
|
7
7
|
import { SEARCH_MAX_CANDIDATES, SEARCH_PROXIMITY_WINDOW, SEARCH_RRF_K, SCOPE_PATH_MULTIPLIERS, STALENESS_THRESHOLDS_MS } from "./search-constants.js";
|
|
8
8
|
import { CallGraphSidecarManager } from "./call-graph.js";
|
|
@@ -14,6 +14,7 @@ const COLLECTION_LIMIT_PATTERNS = [
|
|
|
14
14
|
];
|
|
15
15
|
const SATORI_COLLECTION_PREFIXES = ['code_chunks_', 'hybrid_code_chunks_'];
|
|
16
16
|
const ZILLIZ_FREE_TIER_COLLECTION_LIMIT = 5;
|
|
17
|
+
const OUTLINE_SUPPORTED_EXTENSIONS = getSupportedExtensionsForCapability('fileOutline');
|
|
17
18
|
function collectErrorFragments(value, output, visited, depth = 0) {
|
|
18
19
|
if (value === null || value === undefined || depth > 4 || output.length >= 8) {
|
|
19
20
|
return;
|
|
@@ -473,13 +474,12 @@ export class ToolHandlers {
|
|
|
473
474
|
return `grp_${digest}`;
|
|
474
475
|
}
|
|
475
476
|
isCallGraphLanguageSupported(language, file) {
|
|
476
|
-
|
|
477
|
-
if (normalized === 'typescript' || normalized === 'ts' || normalized === 'python' || normalized === 'py') {
|
|
477
|
+
if (isLanguageCapabilitySupportedForLanguage(language, 'callGraphQuery')) {
|
|
478
478
|
return true;
|
|
479
479
|
}
|
|
480
480
|
if (typeof file === 'string') {
|
|
481
481
|
const ext = path.extname(file).toLowerCase();
|
|
482
|
-
return ext
|
|
482
|
+
return isLanguageCapabilitySupportedForExtension(ext, 'callGraphQuery');
|
|
483
483
|
}
|
|
484
484
|
return false;
|
|
485
485
|
}
|
|
@@ -1805,7 +1805,7 @@ To force rebuild from scratch: call manage_index with {"action":"create","path":
|
|
|
1805
1805
|
file: normalizedFile,
|
|
1806
1806
|
outline: null,
|
|
1807
1807
|
hasMore: false,
|
|
1808
|
-
message: `File '${normalizedFile}' is not supported for sidecar outline. Supported extensions: .
|
|
1808
|
+
message: `File '${normalizedFile}' is not supported for sidecar outline. Supported extensions: ${OUTLINE_SUPPORTED_EXTENSIONS.join(', ')}.`
|
|
1809
1809
|
};
|
|
1810
1810
|
return {
|
|
1811
1811
|
content: [{ type: "text", text: JSON.stringify(payload, null, 2) }]
|
package/dist/tools/call_graph.js
CHANGED
|
@@ -18,7 +18,7 @@ const callGraphInputSchema = z.object({
|
|
|
18
18
|
});
|
|
19
19
|
export const callGraphTool = {
|
|
20
20
|
name: 'call_graph',
|
|
21
|
-
description: () => 'Traverse the prebuilt TS/Python call graph sidecar for callers/callees/bidirectional symbol relationships.',
|
|
21
|
+
description: () => 'Traverse the prebuilt TS/JS/Python call graph sidecar for callers/callees/bidirectional symbol relationships.',
|
|
22
22
|
inputSchemaZod: () => callGraphInputSchema,
|
|
23
23
|
execute: async (args, ctx) => {
|
|
24
24
|
const normalizedArgs = (args && typeof args === 'object')
|
package/dist/tools/read_file.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import fs from "node:fs";
|
|
2
2
|
import path from "node:path";
|
|
3
3
|
import { z } from "zod";
|
|
4
|
+
import { isLanguageCapabilitySupportedForExtension } from "@zokizuan/satori-core";
|
|
4
5
|
import { formatZodError } from "./types.js";
|
|
5
6
|
import { ensureAbsolutePath } from "../utils.js";
|
|
6
7
|
const readFileInputSchema = z.object({
|
|
@@ -27,7 +28,7 @@ function normalizeRelativePath(value) {
|
|
|
27
28
|
}
|
|
28
29
|
function isOutlineSupportedFile(absolutePath) {
|
|
29
30
|
const ext = path.extname(absolutePath).toLowerCase();
|
|
30
|
-
return ext
|
|
31
|
+
return isLanguageCapabilitySupportedForExtension(ext, "fileOutline");
|
|
31
32
|
}
|
|
32
33
|
function resolveCodebaseRootForFile(absolutePath, ctx) {
|
|
33
34
|
const allCodebases = typeof ctx.snapshotManager?.getAllCodebases === "function"
|