zidane 3.3.4 → 3.3.5
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/dist/{chunk-6Z4UMOV4.js → chunk-UXA7PPI5.js} +57 -2
- package/dist/{chunk-NYGFP4AV.js → chunk-VC3PM4QB.js} +1 -1
- package/dist/{chunk-LHCIHOCE.js → chunk-ZCJZIZZV.js} +1 -1
- package/dist/index.js +3 -3
- package/dist/mcp.d.ts +1 -1
- package/dist/mcp.js +1 -1
- package/dist/presets.js +3 -3
- package/dist/tools.js +2 -2
- package/package.json +1 -1
|
@@ -4,10 +4,65 @@ import {
|
|
|
4
4
|
|
|
5
5
|
// src/mcp/index.ts
|
|
6
6
|
import { Buffer } from "buffer";
|
|
7
|
-
import { Client } from "@modelcontextprotocol/sdk/client/index.js";
|
|
8
7
|
import { SSEClientTransport } from "@modelcontextprotocol/sdk/client/sse.js";
|
|
9
8
|
import { getDefaultEnvironment, StdioClientTransport } from "@modelcontextprotocol/sdk/client/stdio.js";
|
|
10
9
|
import { StreamableHTTPClientTransport } from "@modelcontextprotocol/sdk/client/streamableHttp.js";
|
|
10
|
+
|
|
11
|
+
// src/mcp/tolerant-client.ts
|
|
12
|
+
import { Client } from "@modelcontextprotocol/sdk/client/index.js";
|
|
13
|
+
import { Protocol } from "@modelcontextprotocol/sdk/shared/protocol.js";
|
|
14
|
+
import {
|
|
15
|
+
InitializeResultSchema,
|
|
16
|
+
LATEST_PROTOCOL_VERSION,
|
|
17
|
+
SUPPORTED_PROTOCOL_VERSIONS
|
|
18
|
+
} from "@modelcontextprotocol/sdk/types.js";
|
|
19
|
+
var TolerantMcpClient = class extends Client {
|
|
20
|
+
async connect(transport, options) {
|
|
21
|
+
await Protocol.prototype.connect.call(this, transport);
|
|
22
|
+
if (transport.sessionId !== void 0)
|
|
23
|
+
return;
|
|
24
|
+
const self = this;
|
|
25
|
+
try {
|
|
26
|
+
const result = await this.request(
|
|
27
|
+
{
|
|
28
|
+
method: "initialize",
|
|
29
|
+
params: {
|
|
30
|
+
protocolVersion: LATEST_PROTOCOL_VERSION,
|
|
31
|
+
capabilities: self._capabilities,
|
|
32
|
+
clientInfo: self._clientInfo
|
|
33
|
+
}
|
|
34
|
+
},
|
|
35
|
+
InitializeResultSchema,
|
|
36
|
+
options
|
|
37
|
+
);
|
|
38
|
+
if (result === void 0)
|
|
39
|
+
throw new Error(`Server sent invalid initialize result: ${result}`);
|
|
40
|
+
if (!SUPPORTED_PROTOCOL_VERSIONS.includes(result.protocolVersion))
|
|
41
|
+
throw new Error(`Server's protocol version is not supported: ${result.protocolVersion}`);
|
|
42
|
+
self._serverCapabilities = result.capabilities;
|
|
43
|
+
self._serverVersion = result.serverInfo;
|
|
44
|
+
const setProtocolVersion = transport.setProtocolVersion;
|
|
45
|
+
if (setProtocolVersion)
|
|
46
|
+
setProtocolVersion.call(transport, result.protocolVersion);
|
|
47
|
+
self._instructions = result.instructions;
|
|
48
|
+
try {
|
|
49
|
+
await this.notification({ method: "notifications/initialized" });
|
|
50
|
+
} catch (notifyError) {
|
|
51
|
+
const msg = notifyError instanceof Error ? notifyError.message : String(notifyError);
|
|
52
|
+
console.warn(`[zidane:mcp] server rejected notifications/initialized (continuing): ${msg}`);
|
|
53
|
+
}
|
|
54
|
+
if (self._pendingListChangedConfig) {
|
|
55
|
+
self._setupListChangedHandlers(self._pendingListChangedConfig);
|
|
56
|
+
self._pendingListChangedConfig = void 0;
|
|
57
|
+
}
|
|
58
|
+
} catch (error) {
|
|
59
|
+
void this.close();
|
|
60
|
+
throw error;
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
};
|
|
64
|
+
|
|
65
|
+
// src/mcp/index.ts
|
|
11
66
|
var DEFAULT_MCP_BOOTSTRAP_TIMEOUT_MS = 1e4;
|
|
12
67
|
function inferTransport(raw) {
|
|
13
68
|
if (raw.transport === "stdio" || raw.transport === "sse" || raw.transport === "streamable-http")
|
|
@@ -220,7 +275,7 @@ async function bootstrapServer(config, _clientFactory, hooks) {
|
|
|
220
275
|
await hooks?.callHook("mcp:bootstrap:start", { name: config.name, transport: config.transport });
|
|
221
276
|
let client = null;
|
|
222
277
|
try {
|
|
223
|
-
client = _clientFactory ? _clientFactory() : new
|
|
278
|
+
client = _clientFactory ? _clientFactory() : new TolerantMcpClient({ name: "zidane", version: "1.0.0" });
|
|
224
279
|
const currentClient = client;
|
|
225
280
|
const transport = createTransport(config);
|
|
226
281
|
const bootstrapTimeout = config.bootstrapTimeout ?? DEFAULT_MCP_BOOTSTRAP_TIMEOUT_MS;
|
package/dist/index.js
CHANGED
|
@@ -11,7 +11,7 @@ import {
|
|
|
11
11
|
basicTools,
|
|
12
12
|
basic_default,
|
|
13
13
|
definePreset
|
|
14
|
-
} from "./chunk-
|
|
14
|
+
} from "./chunk-VC3PM4QB.js";
|
|
15
15
|
import {
|
|
16
16
|
createAgent,
|
|
17
17
|
createInteractionTool,
|
|
@@ -24,7 +24,7 @@ import {
|
|
|
24
24
|
grep,
|
|
25
25
|
multiEdit,
|
|
26
26
|
validateToolArgs
|
|
27
|
-
} from "./chunk-
|
|
27
|
+
} from "./chunk-ZCJZIZZV.js";
|
|
28
28
|
import {
|
|
29
29
|
IMPLICITLY_ALLOWED_SKILL_TOOLS,
|
|
30
30
|
buildCatalog,
|
|
@@ -53,7 +53,7 @@ import {
|
|
|
53
53
|
normalizeMcpBlocks,
|
|
54
54
|
normalizeMcpServers,
|
|
55
55
|
resultToString
|
|
56
|
-
} from "./chunk-
|
|
56
|
+
} from "./chunk-UXA7PPI5.js";
|
|
57
57
|
import {
|
|
58
58
|
toolOutputByteLength,
|
|
59
59
|
toolResultToText
|
package/dist/mcp.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
+
import '@modelcontextprotocol/sdk/client/index.js';
|
|
1
2
|
import 'hookable';
|
|
2
3
|
export { M as McpConnection, p as McpServerConfig, ar as connectMcpServers, aC as normalizeMcpBlocks, aD as normalizeMcpServers, aH as resultToString } from './agent-LEf7zjw6.js';
|
|
3
|
-
import '@modelcontextprotocol/sdk/client/index.js';
|
|
4
4
|
import './types-vA1a_ZX7.js';
|
package/dist/mcp.js
CHANGED
package/dist/presets.js
CHANGED
|
@@ -2,11 +2,11 @@ import {
|
|
|
2
2
|
basicTools,
|
|
3
3
|
basic_default,
|
|
4
4
|
definePreset
|
|
5
|
-
} from "./chunk-
|
|
6
|
-
import "./chunk-
|
|
5
|
+
} from "./chunk-VC3PM4QB.js";
|
|
6
|
+
import "./chunk-ZCJZIZZV.js";
|
|
7
7
|
import "./chunk-X3VOTPVM.js";
|
|
8
8
|
import "./chunk-UD25QF3H.js";
|
|
9
|
-
import "./chunk-
|
|
9
|
+
import "./chunk-UXA7PPI5.js";
|
|
10
10
|
import "./chunk-JH6IAAFA.js";
|
|
11
11
|
import "./chunk-LNN5UTS2.js";
|
|
12
12
|
export {
|
package/dist/tools.js
CHANGED
|
@@ -13,10 +13,10 @@ import {
|
|
|
13
13
|
shell,
|
|
14
14
|
validateToolArgs,
|
|
15
15
|
writeFile
|
|
16
|
-
} from "./chunk-
|
|
16
|
+
} from "./chunk-ZCJZIZZV.js";
|
|
17
17
|
import "./chunk-X3VOTPVM.js";
|
|
18
18
|
import "./chunk-UD25QF3H.js";
|
|
19
|
-
import "./chunk-
|
|
19
|
+
import "./chunk-UXA7PPI5.js";
|
|
20
20
|
import "./chunk-JH6IAAFA.js";
|
|
21
21
|
import "./chunk-LNN5UTS2.js";
|
|
22
22
|
export {
|