Skip to content

Commit 2950083

Browse files
author
linyuan.yang
committed
整理代码结构
1 parent 065caa1 commit 2950083

5 files changed

Lines changed: 16 additions & 7 deletions

File tree

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,14 @@
1-
export * from './types';
1+
export * from './mcp';
22
export {
33
truncateMCPToolResult,
44
type TruncateToolResultOptions,
55
} from './truncateToolResult';
6+
export {
7+
walkTree,
8+
formatWalkSummary,
9+
formatWalkTree,
10+
DEFAULT_WALK_MAX_DEPTH,
11+
DEFAULT_WALK_LIMIT,
12+
type WalkTreeOptions,
13+
type WalkTreeResult,
14+
} from './walkTree';

packages/scorpio.ai/src/Tools/Core/types.ts renamed to packages/scorpio.ai/src/Tools/Core/mcp.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/**
2-
* MCP 标准内容类型定义
2+
* MCP 标准内容与工具结果的基础定义
33
* 基于 @modelcontextprotocol/sdk 的类型定义,扩展支持 OpenAI 格式
44
*/
55

‎packages/scorpio.ai/src/Tools/Core/truncateToolResult.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import * as fs from 'fs/promises';
22
import * as path from 'path';
3-
import { MCPContentType, type MCPContent, type MCPToolResult } from './types';
3+
import { MCPContentType, type MCPContent, type MCPToolResult } from './mcp';
44

55
const MAX_CHARS = 32 * 1024;
66

packages/scorpio.ai/src/Tools/walkTree.ts renamed to packages/scorpio.ai/src/Tools/Core/walkTree.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import fs from 'fs';
22
import path from 'path';
33

4-
/** 工具 schema 的统一默认值,供两端 schema 共用以保持一致 */
4+
/** 目录遍历 schema 的统一默认值,供两端 schema 共用以保持一致 */
55
export const DEFAULT_WALK_MAX_DEPTH = 3;
66
export const DEFAULT_WALK_LIMIT = 200;
77

‎packages/scorpio.ai/src/Tools/index.ts‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/**
22
* Tools 模块导出
3-
* 提供 MCP 标准类型定义
3+
* 提供 MCP 标准定义与通用工具能力
44
*/
55
export {
66
MCPContentType,
@@ -20,7 +20,7 @@ export {
2020
createErrorResult,
2121
isMCPToolResult,
2222
normalizeToMCPResult,
23-
} from './Core/types';
23+
} from './Core/mcp';
2424

2525
export {
2626
createDispatchTaskTool,
@@ -59,7 +59,7 @@ export {
5959
DEFAULT_WALK_LIMIT,
6060
type WalkTreeOptions,
6161
type WalkTreeResult,
62-
} from './walkTree';
62+
} from './Core/walkTree';
6363

6464
export {
6565
truncateMCPToolResult,

0 commit comments

Comments
 (0)