@qwik.dev/mcp 2.0.0-rc.5 → 2.0.0-rc.6

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/browser.js CHANGED
@@ -152,12 +152,20 @@ function readSerializedState(doc) {
152
152
  if (!root && !scripts.some((script) => script.hasAttribute("q:patch"))) {
153
153
  return null;
154
154
  }
155
+ const patches = scripts.filter((script) => script.hasAttribute("q:patch"));
156
+ const state = qwikInternal._isBinaryState(root?.textContent ?? patches[0]?.textContent ?? "") ? qwikInternal._binaryStateToJson(
157
+ root?.textContent,
158
+ patches.map((patch) => patch.textContent || "")
159
+ ) : readJsonState(root, patches);
160
+ return qwikInternal._dumpState(state, false, "", null).replace(/^\n/, "");
161
+ }
162
+ function readJsonState(root, patches) {
155
163
  const state = JSON.parse(root?.textContent || "[]");
156
164
  if (!Array.isArray(state)) {
157
165
  throw new Error("Invalid serialized Qwik state.");
158
166
  }
159
167
  const patchForwardRefs = [];
160
- for (const patch of scripts.filter((script) => script.hasAttribute("q:patch"))) {
168
+ for (const patch of patches) {
161
169
  const [start, entries, forwardRefs] = JSON.parse(patch.textContent || "[]");
162
170
  if (!Number.isInteger(start) || !Array.isArray(entries)) {
163
171
  throw new Error("Invalid serialized Qwik state patch.");
@@ -181,7 +189,7 @@ function readSerializedState(doc) {
181
189
  }
182
190
  }
183
191
  qwikInternal._preprocessState(state, { $forwardRefs$: null });
184
- return qwikInternal._dumpState(state, false, "", null).replace(/^\n/, "");
192
+ return state;
185
193
  }
186
194
  async function readSerializedVNodeTree(doc) {
187
195
  const clone = new DOMParser().parseFromString(doc.documentElement.outerHTML, "text/html");
package/dist/cli.js CHANGED
@@ -11,7 +11,7 @@ import { McpServer } from "@modelcontextprotocol/server";
11
11
  import { z as z2 } from "zod";
12
12
 
13
13
  // package.json
14
- var version = "2.0.0-rc.5";
14
+ var version = "2.0.0-rc.6";
15
15
 
16
16
  // src/protocol.ts
17
17
  import { z } from "zod";