@superdoc/mcp 1.0.1-next.3 → 1.0.1-next.4

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.
Files changed (2) hide show
  1. package/dist/index.js +20 -6
  2. package/package.json +4 -4
package/dist/index.js CHANGED
@@ -351336,7 +351336,7 @@ var init_host = __esm(() => {
351336
351336
  });
351337
351337
 
351338
351338
  // ../../packages/sdk/langs/node/src/runtime/sdk-version.generated.ts
351339
- var SDK_VERSION = "2.13.1-next.3";
351339
+ var SDK_VERSION = "2.13.1-next.4";
351340
351340
 
351341
351341
  // ../../packages/sdk/langs/node/src/runtime/embedded-platform.ts
351342
351342
  import { chmodSync, existsSync } from "node:fs";
@@ -709879,10 +709879,16 @@ function createSyncWaitQueue() {
709879
709879
  };
709880
709880
  }
709881
709881
 
709882
+ // ../../../v2/collaboration-v2/dist/sync-timeout.js
709883
+ function isValidCollaborationSyncTimeoutMs(value2) {
709884
+ return typeof value2 === "number" && Number.isFinite(value2) && value2 > 0 && value2 <= MAX_COLLABORATION_SYNC_TIMEOUT_MS;
709885
+ }
709886
+ var DEFAULT_COLLABORATION_SYNC_TIMEOUT_MS = 30000, MAX_COLLABORATION_SYNC_TIMEOUT_MS = 2147483647;
709887
+
709882
709888
  // ../../../v2/collaboration-v2/dist/single-doc/runtime.js
709883
709889
  function createSDYjsSingleDocProvider(options) {
709884
709890
  const { capabilities: capabilities3, hooks } = options;
709885
- const defaultTimeout = options.defaultSyncTimeoutMs ?? DEFAULT_SYNC_TIMEOUT_MS;
709891
+ const defaultTimeout = resolveSyncTimeoutMs(options.defaultSyncTimeoutMs, DEFAULT_COLLABORATION_SYNC_TIMEOUT_MS);
709886
709892
  let providerDestroyed = false;
709887
709893
  let connection = null;
709888
709894
  let connectedRootId = null;
@@ -709901,7 +709907,7 @@ function createSDYjsSingleDocProvider(options) {
709901
709907
  } catch {}
709902
709908
  awareness = null;
709903
709909
  }
709904
- function makeConnection(rootId) {
709910
+ function makeConnection(rootId, syncTimeoutMs) {
709905
709911
  const ydoc = new Doc2({ gc: false });
709906
709912
  const providerRoomName = encodeProviderRoomName(rootId);
709907
709913
  const stateListeners = new Set;
@@ -709911,6 +709917,7 @@ function createSDYjsSingleDocProvider(options) {
709911
709917
  let connectionFailure = null;
709912
709918
  let destroyed = false;
709913
709919
  let transport = null;
709920
+ const connectionTimeout = resolveSyncTimeoutMs(syncTimeoutMs, defaultTimeout);
709914
709921
  const notify = (next) => {
709915
709922
  currentState = next;
709916
709923
  for (const listener of Array.from(stateListeners)) {
@@ -709995,7 +710002,7 @@ function createSDYjsSingleDocProvider(options) {
709995
710002
  if (currentState === "failed") {
709996
710003
  return Promise.reject(connectionFailure ?? new CollabV2DiagnosticError(COLLAB_V2_DIAGNOSTICS.COLLAB_V2_PROVIDER_TRANSPORT_FAILED, "provider transport failed", { rootId }));
709997
710004
  }
709998
- const timeoutMs = opts?.timeoutMs ?? defaultTimeout;
710005
+ const timeoutMs = resolveSyncTimeoutMs(opts?.timeoutMs, connectionTimeout);
709999
710006
  return syncWaiters.wait(timeoutMs, () => new CollabV2DiagnosticError(COLLAB_V2_DIAGNOSTICS.COLLAB_V2_SYNC_TIMEOUT, `v2 collaboration sync timed out after ${timeoutMs}ms`, { rootId, timeoutMs }));
710000
710007
  },
710001
710008
  onStateChange(listener) {
@@ -710061,6 +710068,7 @@ function createSDYjsSingleDocProvider(options) {
710061
710068
  function connect(rawInput) {
710062
710069
  ensureProviderAlive();
710063
710070
  const rootId = deriveRootId({ documentId: rawInput.rootId });
710071
+ const syncTimeoutMs = resolveSyncTimeoutMs(rawInput.syncTimeoutMs, defaultTimeout);
710064
710072
  if (connection) {
710065
710073
  if (connectedRootId !== null && connectedRootId !== rootId) {
710066
710074
  throw new CollabV2DiagnosticError(COLLAB_V2_DIAGNOSTICS.COLLAB_V2_CONNECTION_INPUT_INVALID, "single-doc provider is pinned to one root id; cannot connect a second doc", { connectedRootId, requestedRootId: rootId });
@@ -710071,7 +710079,7 @@ function createSDYjsSingleDocProvider(options) {
710071
710079
  return connection;
710072
710080
  }
710073
710081
  connectedRootId = rootId;
710074
- connection = makeConnection(rootId);
710082
+ connection = makeConnection(rootId, syncTimeoutMs);
710075
710083
  return connection;
710076
710084
  }
710077
710085
  function getAwareness() {
@@ -710113,7 +710121,13 @@ function createSDYjsSingleDocProvider(options) {
710113
710121
  destroy
710114
710122
  };
710115
710123
  }
710116
- var DEFAULT_SYNC_TIMEOUT_MS = 1e4;
710124
+ function resolveSyncTimeoutMs(value2, fallback) {
710125
+ const resolved = value2 ?? fallback;
710126
+ if (!isValidCollaborationSyncTimeoutMs(resolved)) {
710127
+ throw new CollabV2DiagnosticError(COLLAB_V2_DIAGNOSTICS.COLLAB_V2_CONNECTION_INPUT_INVALID, "collaboration sync timeout must be a finite positive number within the JavaScript timer range", {});
710128
+ }
710129
+ return resolved;
710130
+ }
710117
710131
  var init_runtime4 = __esm(() => {
710118
710132
  init_yjs();
710119
710133
  init_diagnostics2();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@superdoc/mcp",
3
- "version": "1.0.1-next.3",
3
+ "version": "1.0.1-next.4",
4
4
  "description": "Model Context Protocol server for SuperDoc, giving an AI agent tools to read and edit .docx files.",
5
5
  "type": "module",
6
6
  "license": "AGPL-3.0",
@@ -24,13 +24,13 @@
24
24
  ],
25
25
  "dependencies": {
26
26
  "@modelcontextprotocol/sdk": "^1.26.0",
27
- "@superdoc/sdk": "2.13.1-next.3",
27
+ "@superdoc/sdk": "2.13.1-next.4",
28
28
  "debug": "^4.4.3",
29
29
  "zod": "^4.3.6"
30
30
  },
31
31
  "devDependencies": {
32
- "superdoc": "2.16.1-next.3",
33
- "@superdoc/docx-engine": "0.15.1-next.2",
32
+ "superdoc": "2.16.1-next.4",
33
+ "@superdoc/docx-engine": "0.15.1-next.3",
34
34
  "@superdoc/document-api": "0.1.0-alpha.0",
35
35
  "@types/bun": "^1.3.8",
36
36
  "@types/node": "22.19.2",