@puckeditor/plugin-ai 0.9.0-canary.e81b45a6 → 0.9.0-canary.ecc60986

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 CHANGED
@@ -4663,13 +4663,38 @@ async function postClientToolResponse(host, body) {
4663
4663
  }
4664
4664
  }
4665
4665
 
4666
+ // src/lib/to-serializable.ts
4667
+ init_react_import();
4668
+ function toSerializable(value, ancestors = []) {
4669
+ const json = typeof value === "object" && value !== null && "toJSON" in value && typeof value.toJSON === "function" ? value.toJSON() : value;
4670
+ if (typeof json !== "object" || json === null) {
4671
+ return typeof json === "function" || typeof json === "symbol" || typeof json === "bigint" ? void 0 : json;
4672
+ }
4673
+ if ("$$typeof" in json || ancestors.includes(json)) return void 0;
4674
+ ancestors.push(json);
4675
+ let copy;
4676
+ if (Array.isArray(json)) {
4677
+ copy = json.map((item) => toSerializable(item, ancestors) ?? null);
4678
+ } else {
4679
+ const record = json;
4680
+ const object = {};
4681
+ for (const key of Object.keys(record)) {
4682
+ const item = toSerializable(record[key], ancestors);
4683
+ if (item !== void 0) object[key] = item;
4684
+ }
4685
+ copy = object;
4686
+ }
4687
+ ancestors.pop();
4688
+ return copy;
4689
+ }
4690
+
4666
4691
  // src/components/Chat/index.tsx
4667
4692
  var import_jsx_runtime34 = require("react/jsx-runtime");
4668
4693
  var q = (0, import_qler.default)();
4669
4694
  var DEFAULT_API_VERSION = "v2";
4670
4695
  var BUILD_OP_DEBOUNCE_MS = 1e3 / 60;
4671
4696
  var CLIENT_TOOL_ENDPOINT_UNAVAILABLE_ERROR_MESSAGE = "Unable to verify the page data. Please enable the `/chat/tool` endpoint on the server and try again.";
4672
- var PLUGIN_AI_VERSION = true ? "0.9.0-canary.e81b45a6" : "unknown";
4697
+ var PLUGIN_AI_VERSION = true ? "0.9.0-canary.ecc60986" : "unknown";
4673
4698
  var BENCHMARK = false;
4674
4699
  var prefixedUlid = (prefix = "") => `${prefix ? `${prefix}_` : ""}${(0, import_ulid.ulid)()}`;
4675
4700
  var getClassName18 = getClassNameFactory("Chat", styles_module_default);
@@ -4983,14 +5008,14 @@ function Chat2(props) {
4983
5008
  }
4984
5009
  }
4985
5010
  };
4986
- const configWithRoot = {
5011
+ const configWithRoot = toSerializable({
4987
5012
  ...config,
4988
5013
  root,
4989
5014
  components: {
4990
5015
  ...config.components,
4991
5016
  ...getRequestComponentConfigs(appState.data)
4992
5017
  }
4993
- };
5018
+ });
4994
5019
  const defaultOptions = {
4995
5020
  headers: {
4996
5021
  ...opts.headers,
package/dist/index.mjs CHANGED
@@ -4695,13 +4695,38 @@ async function postClientToolResponse(host, body) {
4695
4695
  }
4696
4696
  }
4697
4697
 
4698
+ // src/lib/to-serializable.ts
4699
+ init_react_import();
4700
+ function toSerializable(value, ancestors = []) {
4701
+ const json = typeof value === "object" && value !== null && "toJSON" in value && typeof value.toJSON === "function" ? value.toJSON() : value;
4702
+ if (typeof json !== "object" || json === null) {
4703
+ return typeof json === "function" || typeof json === "symbol" || typeof json === "bigint" ? void 0 : json;
4704
+ }
4705
+ if ("$$typeof" in json || ancestors.includes(json)) return void 0;
4706
+ ancestors.push(json);
4707
+ let copy;
4708
+ if (Array.isArray(json)) {
4709
+ copy = json.map((item) => toSerializable(item, ancestors) ?? null);
4710
+ } else {
4711
+ const record = json;
4712
+ const object = {};
4713
+ for (const key of Object.keys(record)) {
4714
+ const item = toSerializable(record[key], ancestors);
4715
+ if (item !== void 0) object[key] = item;
4716
+ }
4717
+ copy = object;
4718
+ }
4719
+ ancestors.pop();
4720
+ return copy;
4721
+ }
4722
+
4698
4723
  // src/components/Chat/index.tsx
4699
4724
  import { Fragment as Fragment9, jsx as jsx34, jsxs as jsxs20 } from "react/jsx-runtime";
4700
4725
  var q = qler();
4701
4726
  var DEFAULT_API_VERSION = "v2";
4702
4727
  var BUILD_OP_DEBOUNCE_MS = 1e3 / 60;
4703
4728
  var CLIENT_TOOL_ENDPOINT_UNAVAILABLE_ERROR_MESSAGE = "Unable to verify the page data. Please enable the `/chat/tool` endpoint on the server and try again.";
4704
- var PLUGIN_AI_VERSION = true ? "0.9.0-canary.e81b45a6" : "unknown";
4729
+ var PLUGIN_AI_VERSION = true ? "0.9.0-canary.ecc60986" : "unknown";
4705
4730
  var BENCHMARK = false;
4706
4731
  var prefixedUlid = (prefix = "") => `${prefix ? `${prefix}_` : ""}${ulid()}`;
4707
4732
  var getClassName18 = getClassNameFactory("Chat", styles_module_default);
@@ -5015,14 +5040,14 @@ function Chat2(props) {
5015
5040
  }
5016
5041
  }
5017
5042
  };
5018
- const configWithRoot = {
5043
+ const configWithRoot = toSerializable({
5019
5044
  ...config,
5020
5045
  root,
5021
5046
  components: {
5022
5047
  ...config.components,
5023
5048
  ...getRequestComponentConfigs(appState.data)
5024
5049
  }
5025
- };
5050
+ });
5026
5051
  const defaultOptions = {
5027
5052
  headers: {
5028
5053
  ...opts.headers,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@puckeditor/plugin-ai",
3
- "version": "0.9.0-canary.e81b45a6",
3
+ "version": "0.9.0-canary.ecc60986",
4
4
  "author": "Chris Villa <chris@puckeditor.com>",
5
5
  "repository": {
6
6
  "type": "git",
@@ -52,12 +52,12 @@
52
52
  "tsup": "^8.2.4",
53
53
  "typescript": "^5.5.4",
54
54
  "vitest": "^4.1.11",
55
- "@puckeditor/platform-types": "0.9.0-canary.e81b45a6",
56
- "tsconfig": "0.9.0-canary.e81b45a6",
57
- "tsup-config": "0.9.0-canary.e81b45a6",
58
- "@puckeditor/ai-types": "0.9.0-canary.e81b45a6",
59
- "eslint-config-custom": "0.9.0-canary.e81b45a6",
60
- "reducer": "0.9.0-canary.e81b45a6"
55
+ "@puckeditor/ai-types": "0.9.0-canary.ecc60986",
56
+ "eslint-config-custom": "0.9.0-canary.ecc60986",
57
+ "reducer": "0.9.0-canary.ecc60986",
58
+ "tsconfig": "0.9.0-canary.ecc60986",
59
+ "@puckeditor/platform-types": "0.9.0-canary.ecc60986",
60
+ "tsup-config": "0.9.0-canary.ecc60986"
61
61
  },
62
62
  "peerDependencies": {
63
63
  "@puckeditor/core": "^0",