@superdoc/mcp 1.11.0-next.8 → 1.11.0-next.9
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/index.js +34 -15
- package/package.json +4 -4
package/dist/index.js
CHANGED
|
@@ -31630,7 +31630,7 @@ var init_host = __esm(() => {
|
|
|
31630
31630
|
});
|
|
31631
31631
|
|
|
31632
31632
|
// ../../packages/sdk/langs/node/src/runtime/sdk-version.generated.ts
|
|
31633
|
-
var SDK_VERSION = "2.24.0-next.
|
|
31633
|
+
var SDK_VERSION = "2.24.0-next.9";
|
|
31634
31634
|
|
|
31635
31635
|
// ../../packages/sdk/langs/node/src/runtime/embedded-platform.ts
|
|
31636
31636
|
import { accessSync, chmodSync, constants, existsSync, statSync } from "node:fs";
|
|
@@ -509196,6 +509196,12 @@ async function openV2CollaborativeDocumentSession(options) {
|
|
|
509196
509196
|
}));
|
|
509197
509197
|
}
|
|
509198
509198
|
if (openIntent.mode === "create") {
|
|
509199
|
+
session = await openSourceSession(options, trace);
|
|
509200
|
+
await assertSourceOpenedForSeed(session, options.runtime.rootId);
|
|
509201
|
+
await session.waitForSourceComplete();
|
|
509202
|
+
trace.mark("source-complete");
|
|
509203
|
+
trace.sessionSnapshot("after-source-complete", session);
|
|
509204
|
+
await assertSourceOpenedForSeed(session, options.runtime.rootId);
|
|
509199
509205
|
stopBootstrapHeartbeat = startBootstrapHeartbeat(rootConn.ydoc, bootstrapClaimerId, () => rootConn.state);
|
|
509200
509206
|
}
|
|
509201
509207
|
const bootstrapBytes = resolveBootstrapBytes(openIntent, options.buffer);
|
|
@@ -509235,20 +509241,15 @@ async function openV2CollaborativeDocumentSession(options) {
|
|
|
509235
509241
|
joinedFromEmbeddedMigrationCarrier = true;
|
|
509236
509242
|
joinedRoomStillMatchesInitialContent = verifyRoomInitialContentDigest(rootConn.ydoc).ok;
|
|
509237
509243
|
}
|
|
509238
|
-
session
|
|
509239
|
-
|
|
509240
|
-
|
|
509241
|
-
|
|
509242
|
-
|
|
509243
|
-
|
|
509244
|
-
|
|
509245
|
-
|
|
509246
|
-
|
|
509247
|
-
await session.waitForSourceComplete();
|
|
509248
|
-
trace.mark("source-complete");
|
|
509249
|
-
trace.sessionSnapshot("after-source-complete", session);
|
|
509250
|
-
} else {
|
|
509251
|
-
trace.mark("source-complete-deferred");
|
|
509244
|
+
if (!session) {
|
|
509245
|
+
session = await openSourceSession(options, trace);
|
|
509246
|
+
if (initialReadiness === "full-projection") {
|
|
509247
|
+
await session.waitForSourceComplete();
|
|
509248
|
+
trace.mark("source-complete");
|
|
509249
|
+
trace.sessionSnapshot("after-source-complete", session);
|
|
509250
|
+
} else {
|
|
509251
|
+
trace.mark("source-complete-deferred");
|
|
509252
|
+
}
|
|
509252
509253
|
}
|
|
509253
509254
|
if (ownsPreparedBootstrap) {
|
|
509254
509255
|
const current = readRoomManifest(rootConn.ydoc);
|
|
@@ -509506,6 +509507,24 @@ async function openV2CollaborativeDocumentSession(options) {
|
|
|
509506
509507
|
throw error50;
|
|
509507
509508
|
}
|
|
509508
509509
|
}
|
|
509510
|
+
async function openSourceSession(options, trace) {
|
|
509511
|
+
const session = await openSDDocumentSession({
|
|
509512
|
+
...options,
|
|
509513
|
+
buffer: options.buffer,
|
|
509514
|
+
autoStartSourceLoading: true
|
|
509515
|
+
});
|
|
509516
|
+
trace.mark("open-session");
|
|
509517
|
+
trace.sessionSnapshot("after-open-session", session);
|
|
509518
|
+
return session;
|
|
509519
|
+
}
|
|
509520
|
+
async function assertSourceOpenedForSeed(session, rootId) {
|
|
509521
|
+
const { readiness } = await session.getReadiness();
|
|
509522
|
+
if (readiness !== "failed" && readiness !== "blocked")
|
|
509523
|
+
return;
|
|
509524
|
+
const diagnostics = await session.getDiagnostics();
|
|
509525
|
+
const reason = diagnostics.find((diagnostic2) => diagnostic2.severity === "error")?.message ?? `readiness=${readiness}`;
|
|
509526
|
+
throw new CollabV2DiagnosticError(COLLAB_V2_DIAGNOSTICS.COLLAB_V2_BOOTSTRAP_SOURCE_INVALID, `document could not be opened, so the collaboration room was not created (${reason}); fix the document and create the room again`, { rootId, readiness, reason });
|
|
509527
|
+
}
|
|
509509
509528
|
async function prepareRoomReplacement(options, operationId, expectedSourceSha256) {
|
|
509510
509529
|
const provider = createSDYjsSingleDocProvider({
|
|
509511
509530
|
capabilities: COLLAB_V2_CAPABILITY_MATRIX["y-websocket"],
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@superdoc/mcp",
|
|
3
|
-
"version": "1.11.0-next.
|
|
3
|
+
"version": "1.11.0-next.9",
|
|
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.24.0-next.
|
|
27
|
+
"@superdoc/sdk": "2.24.0-next.9",
|
|
28
28
|
"debug": "^4.4.3",
|
|
29
29
|
"zod": "^4.3.6"
|
|
30
30
|
},
|
|
31
31
|
"devDependencies": {
|
|
32
|
-
"superdoc": "2.27.0-next.
|
|
33
|
-
"@superdoc/docx-engine": "0.26.0-next.
|
|
32
|
+
"superdoc": "2.27.0-next.9",
|
|
33
|
+
"@superdoc/docx-engine": "0.26.0-next.9",
|
|
34
34
|
"@superdoc/document-api": "0.1.0-alpha.0",
|
|
35
35
|
"@types/bun": "^1.3.8",
|
|
36
36
|
"@types/node": "22.19.2",
|