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.
@@ -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 Client({ name: "zidane", version: "1.0.0" });
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;
@@ -6,7 +6,7 @@ import {
6
6
  readFile,
7
7
  shell,
8
8
  writeFile
9
- } from "./chunk-LHCIHOCE.js";
9
+ } from "./chunk-ZCJZIZZV.js";
10
10
 
11
11
  // src/presets/basic.ts
12
12
  var basicTools = { shell, readFile, writeFile, listFiles, edit, multiEdit };
@@ -11,7 +11,7 @@ import {
11
11
  } from "./chunk-UD25QF3H.js";
12
12
  import {
13
13
  connectMcpServers
14
- } from "./chunk-6Z4UMOV4.js";
14
+ } from "./chunk-UXA7PPI5.js";
15
15
  import {
16
16
  toolOutputByteLength
17
17
  } from "./chunk-JH6IAAFA.js";
package/dist/index.js CHANGED
@@ -11,7 +11,7 @@ import {
11
11
  basicTools,
12
12
  basic_default,
13
13
  definePreset
14
- } from "./chunk-NYGFP4AV.js";
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-LHCIHOCE.js";
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-6Z4UMOV4.js";
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
@@ -3,7 +3,7 @@ import {
3
3
  normalizeMcpBlocks,
4
4
  normalizeMcpServers,
5
5
  resultToString
6
- } from "./chunk-6Z4UMOV4.js";
6
+ } from "./chunk-UXA7PPI5.js";
7
7
  import "./chunk-JH6IAAFA.js";
8
8
  export {
9
9
  connectMcpServers,
package/dist/presets.js CHANGED
@@ -2,11 +2,11 @@ import {
2
2
  basicTools,
3
3
  basic_default,
4
4
  definePreset
5
- } from "./chunk-NYGFP4AV.js";
6
- import "./chunk-LHCIHOCE.js";
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-6Z4UMOV4.js";
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-LHCIHOCE.js";
16
+ } from "./chunk-ZCJZIZZV.js";
17
17
  import "./chunk-X3VOTPVM.js";
18
18
  import "./chunk-UD25QF3H.js";
19
- import "./chunk-6Z4UMOV4.js";
19
+ import "./chunk-UXA7PPI5.js";
20
20
  import "./chunk-JH6IAAFA.js";
21
21
  import "./chunk-LNN5UTS2.js";
22
22
  export {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "zidane",
3
- "version": "3.3.4",
3
+ "version": "3.3.5",
4
4
  "description": "an agent that goes straight to the goal",
5
5
  "type": "module",
6
6
  "private": false,