@zhin.js/mcp-feature 1.1.1 → 1.1.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/lib/mcp-index.d.ts +3 -0
- package/lib/mcp-index.js +6 -0
- package/package.json +3 -3
- package/src/mcp-index.ts +7 -0
package/lib/mcp-index.d.ts
CHANGED
|
@@ -9,6 +9,7 @@ export interface McpDescriptor {
|
|
|
9
9
|
}
|
|
10
10
|
export declare class McpIndex {
|
|
11
11
|
#private;
|
|
12
|
+
readonly $projection: "zhin.mcp-index/1";
|
|
12
13
|
private constructor();
|
|
13
14
|
static create(slots: readonly Readonly<CapabilitySlot<McpDefinition>>[], snapshot: RuntimeSnapshot, signal: AbortSignal): Promise<McpIndex>;
|
|
14
15
|
list(): readonly McpDescriptor[];
|
|
@@ -18,3 +19,5 @@ export declare class McpIndex {
|
|
|
18
19
|
listTools(requester: PluginId, name: string): Promise<readonly McpToolDescriptor[]>;
|
|
19
20
|
callTool<TResult = unknown>(requester: PluginId, connection: string, tool: string, input: unknown): Promise<TResult>;
|
|
20
21
|
}
|
|
22
|
+
/** Recognize the versioned projection across generation module identities. */
|
|
23
|
+
export declare function isMcpIndex(value: unknown): value is McpIndex;
|
package/lib/mcp-index.js
CHANGED
|
@@ -2,6 +2,7 @@ import { DisposeStack, } from '@zhin.js/plugin-runtime';
|
|
|
2
2
|
import { OwnerCapabilityIndex, createCapabilityContext, } from '@zhin.js/feature-kit';
|
|
3
3
|
import { assertMcpClient, } from './definition.js';
|
|
4
4
|
export class McpIndex {
|
|
5
|
+
$projection = 'zhin.mcp-index/1';
|
|
5
6
|
#index;
|
|
6
7
|
#records = new Map();
|
|
7
8
|
#order;
|
|
@@ -112,3 +113,8 @@ async function stopRecords(records, primary) {
|
|
|
112
113
|
throw stopError;
|
|
113
114
|
}
|
|
114
115
|
}
|
|
116
|
+
/** Recognize the versioned projection across generation module identities. */
|
|
117
|
+
export function isMcpIndex(value) {
|
|
118
|
+
return !!value && typeof value === 'object'
|
|
119
|
+
&& value.$projection === 'zhin.mcp-index/1';
|
|
120
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@zhin.js/mcp-feature",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.3",
|
|
4
4
|
"description": "Convention-based MCP client Feature for Zhin Plugin Runtime",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./lib/index.js",
|
|
@@ -17,8 +17,8 @@
|
|
|
17
17
|
"src"
|
|
18
18
|
],
|
|
19
19
|
"dependencies": {
|
|
20
|
-
"@zhin.js/feature-kit": "1.1.
|
|
21
|
-
"@zhin.js/plugin-runtime": "1.1.
|
|
20
|
+
"@zhin.js/feature-kit": "1.1.2",
|
|
21
|
+
"@zhin.js/plugin-runtime": "1.1.11"
|
|
22
22
|
},
|
|
23
23
|
"devDependencies": {
|
|
24
24
|
"@types/node": "^26.1.2",
|
package/src/mcp-index.ts
CHANGED
|
@@ -32,6 +32,7 @@ interface McpRecord {
|
|
|
32
32
|
}
|
|
33
33
|
|
|
34
34
|
export class McpIndex {
|
|
35
|
+
readonly $projection = 'zhin.mcp-index/1' as const;
|
|
35
36
|
readonly #index: OwnerCapabilityIndex<McpDefinition>;
|
|
36
37
|
readonly #records = new Map<string, McpRecord>();
|
|
37
38
|
readonly #order: readonly McpRecord[];
|
|
@@ -163,3 +164,9 @@ async function stopRecords(records: readonly McpRecord[], primary?: unknown): Pr
|
|
|
163
164
|
throw stopError;
|
|
164
165
|
}
|
|
165
166
|
}
|
|
167
|
+
|
|
168
|
+
/** Recognize the versioned projection across generation module identities. */
|
|
169
|
+
export function isMcpIndex(value: unknown): value is McpIndex {
|
|
170
|
+
return !!value && typeof value === 'object'
|
|
171
|
+
&& (value as { readonly $projection?: unknown }).$projection === 'zhin.mcp-index/1';
|
|
172
|
+
}
|