@yyc3/ai-family-kernel 2.55.0 → 2.57.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/src/02-/344/272/221/346/236/242/346/240/270/345/277/203/345/274/225/346/223/216/mcp-adapter/server/protocol.d.ts +2 -0
- package/dist/src/02-/344/272/221/346/236/242/346/240/270/345/277/203/345/274/225/346/223/216/mcp-adapter/server/protocol.js +12 -2
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -9,4 +9,4 @@ import { NineLayerRegistry } from '@yyc3/ai-family-kernel/layer-registry';
|
|
|
9
9
|
|
|
10
10
|
插拔点全景见根仓《可复用性分析》(15 端口)。子路径导出见 `exports`。
|
|
11
11
|
|
|
12
|
-
> 由 `scripts/pack-npm.mjs` 确定性装配(M31 · 复用路线 R1/R2);版本与根仓同步(2.
|
|
12
|
+
> 由 `scripts/pack-npm.mjs` 确定性装配(M31 · 复用路线 R1/R2);版本与根仓同步(2.57.0)。零运行时依赖。
|
|
@@ -10,6 +10,8 @@
|
|
|
10
10
|
*/
|
|
11
11
|
/** 本实现锚定的 MCP 规范版本(2026-07-28:无状态核心 + 可缓存列表)。 */
|
|
12
12
|
export declare const MCP_PROTOCOL_VERSION = "2026-07-28";
|
|
13
|
+
/** 支持回显的协议版本集(H6 协商:实现面为跨版本稳定子集——initialize/ping/tools/list/tools/call 语义一致)。 */
|
|
14
|
+
export declare const MCP_SUPPORTED_PROTOCOL_VERSIONS: readonly string[];
|
|
13
15
|
/** MCP 工具描述符(tools/list 单项)。 */
|
|
14
16
|
export interface McpToolDescriptor {
|
|
15
17
|
/** 工具名:MCP 规范要求 `^[a-zA-Z0-9_-]+$`(家族 id 的 `.` 由部署侧映射为 `__`)。 */
|
|
@@ -10,6 +10,8 @@
|
|
|
10
10
|
*/
|
|
11
11
|
/** 本实现锚定的 MCP 规范版本(2026-07-28:无状态核心 + 可缓存列表)。 */
|
|
12
12
|
export const MCP_PROTOCOL_VERSION = '2026-07-28';
|
|
13
|
+
/** 支持回显的协议版本集(H6 协商:实现面为跨版本稳定子集——initialize/ping/tools/list/tools/call 语义一致)。 */
|
|
14
|
+
export const MCP_SUPPORTED_PROTOCOL_VERSIONS = ['2026-07-28', '2025-11-25', '2025-06-18', '2024-11-05'];
|
|
13
15
|
const TRACEPARENT_RE = /^([0-9a-f]{2})-([0-9a-f]{32})-([0-9a-f]{16})-([0-9a-f]{2})$/;
|
|
14
16
|
/**
|
|
15
17
|
* 严格解析 W3C `traceparent`(M21 关联维):`00-<32hex traceId>-<16hex spanId>-<2hex flags>`;
|
|
@@ -130,8 +132,16 @@ export function createMcpRequestHandler(options) {
|
|
|
130
132
|
const isRequest = 'id' in msg && id !== undefined && id !== null;
|
|
131
133
|
const respond = (result) => isRequest ? JSON.stringify({ jsonrpc: '2.0', id, result }) : null;
|
|
132
134
|
switch (method) {
|
|
133
|
-
case 'initialize':
|
|
134
|
-
|
|
135
|
+
case 'initialize': {
|
|
136
|
+
// H6 协议协商:client 请求版本在支持集内则**原样回显**——host(如 ZCode)对
|
|
137
|
+
// 「服务端改报他版」不降级兼容(实测报 protocol version not supported);
|
|
138
|
+
// 请求缺失或未知版本回本实现锚定版本(规范缺省语义)。
|
|
139
|
+
const requested = params?.protocolVersion;
|
|
140
|
+
const negotiated = requested && MCP_SUPPORTED_PROTOCOL_VERSIONS.includes(requested)
|
|
141
|
+
? requested
|
|
142
|
+
: initializeResult.protocolVersion;
|
|
143
|
+
return respond({ ...initializeResult, protocolVersion: negotiated });
|
|
144
|
+
}
|
|
135
145
|
case 'ping':
|
|
136
146
|
return respond({});
|
|
137
147
|
case 'tools/list':
|