@tencentcloud/sdk-mcp 1.6.0-beta.2 → 1.6.0-beta.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.
package/knowledge/build-index.js
CHANGED
|
@@ -4,7 +4,7 @@ import { fileURLToPath } from 'url';
|
|
|
4
4
|
import { chunkMarkdown, toManifestChunk } from './chunker.js';
|
|
5
5
|
import { inferPathMeta } from './path-meta.js';
|
|
6
6
|
const __dirname = path.dirname(fileURLToPath(import.meta.url));
|
|
7
|
-
const RESOURCE_ROOT = path.resolve(__dirname, '
|
|
7
|
+
const RESOURCE_ROOT = path.resolve(__dirname, '../resource');
|
|
8
8
|
function walkMarkdownFiles(dir, baseRel) {
|
|
9
9
|
if (!fs.existsSync(dir))
|
|
10
10
|
return [];
|
|
@@ -4,8 +4,8 @@ import { fileURLToPath } from 'url';
|
|
|
4
4
|
const __dirname = path.dirname(fileURLToPath(import.meta.url));
|
|
5
5
|
const fileCache = new Map();
|
|
6
6
|
function resolveResourceRoot() {
|
|
7
|
-
// dist/knowledge/ →
|
|
8
|
-
return path.resolve(__dirname, '
|
|
7
|
+
// npm: knowledge/ → ../resource/ 到包根;dev: dist/knowledge/ → ../resource/ 到 dist/resource/
|
|
8
|
+
return path.resolve(__dirname, '../resource');
|
|
9
9
|
}
|
|
10
10
|
function readSourceFile(source) {
|
|
11
11
|
const cached = fileCache.get(source);
|
|
@@ -2,7 +2,7 @@ import fs from 'fs';
|
|
|
2
2
|
import path from 'path';
|
|
3
3
|
import { fileURLToPath } from 'url';
|
|
4
4
|
const __dirname = path.dirname(fileURLToPath(import.meta.url));
|
|
5
|
-
const SCHEMA_ROOT = path.resolve(__dirname, '
|
|
5
|
+
const SCHEMA_ROOT = path.resolve(__dirname, '../../resource/_schema');
|
|
6
6
|
export const DOC_PATH_MAP = {
|
|
7
7
|
android: {
|
|
8
8
|
core_api: 'TRTCCloud',
|
|
@@ -146,7 +146,7 @@ export function runExactLookup(prompt, pool, norm) {
|
|
|
146
146
|
}
|
|
147
147
|
// E3: component slugs
|
|
148
148
|
const componentSlugs = loadJson('../index/component-slugs.json', {});
|
|
149
|
-
const indexPath = path.resolve(__dirname, '
|
|
149
|
+
const indexPath = path.resolve(__dirname, '../../resource/index/component-slugs.json');
|
|
150
150
|
const slugs = fs.existsSync(indexPath)
|
|
151
151
|
? JSON.parse(fs.readFileSync(indexPath, 'utf-8'))
|
|
152
152
|
: componentSlugs;
|
|
@@ -10,15 +10,7 @@ import { requiresFramework } from './requires-framework.js';
|
|
|
10
10
|
const __dirname = path.dirname(fileURLToPath(import.meta.url));
|
|
11
11
|
let cachedManifest = null;
|
|
12
12
|
function resolveResourcePath(...segments) {
|
|
13
|
-
|
|
14
|
-
path.resolve(__dirname, '../../../resource', ...segments),
|
|
15
|
-
path.resolve(__dirname, '../../resource', ...segments),
|
|
16
|
-
];
|
|
17
|
-
for (const candidate of candidates) {
|
|
18
|
-
if (fs.existsSync(candidate))
|
|
19
|
-
return candidate;
|
|
20
|
-
}
|
|
21
|
-
return candidates[0];
|
|
13
|
+
return path.resolve(__dirname, '../../resource', ...segments);
|
|
22
14
|
}
|
|
23
15
|
function loadManifest() {
|
|
24
16
|
if (cachedManifest)
|
package/package.json
CHANGED