@puckeditor/plugin-ai 0.10.0-canary.8d2c27d9 → 0.10.0-canary.b000f643
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 +4 -2
- package/dist/index.mjs +4 -2
- package/package.json +7 -7
package/dist/index.js
CHANGED
|
@@ -4596,7 +4596,7 @@ var usePuck2 = (0, import_core5.createUsePuck)();
|
|
|
4596
4596
|
var DEFAULT_API_VERSION = "v2";
|
|
4597
4597
|
var BUILD_OP_DEBOUNCE_MS = 1e3 / 60;
|
|
4598
4598
|
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.";
|
|
4599
|
-
var PLUGIN_AI_VERSION = true ? "0.10.0-canary.
|
|
4599
|
+
var PLUGIN_AI_VERSION = true ? "0.10.0-canary.b000f643" : "unknown";
|
|
4600
4600
|
var prefixedUlid = (prefix = "") => `${prefix ? `${prefix}_` : ""}${(0, import_ulid.ulid)()}`;
|
|
4601
4601
|
async function prepareRequestOptions(defaults, prepareRequest) {
|
|
4602
4602
|
if (!prepareRequest) return defaults;
|
|
@@ -5003,14 +5003,16 @@ function usePuckAiInternal({
|
|
|
5003
5003
|
body?.error ?? `Puck AI request failed: ${response.status} ${response.statusText}`
|
|
5004
5004
|
);
|
|
5005
5005
|
}
|
|
5006
|
+
let chatId;
|
|
5006
5007
|
for await (const part of iterateSSE(response.body)) {
|
|
5007
5008
|
if (controller.signal.aborted) throw abortError();
|
|
5008
5009
|
if (part.type === "error") throw new Error(part.errorText);
|
|
5010
|
+
if (part.type === "data-new-chat-created") chatId = part.data.chatId;
|
|
5009
5011
|
if (part.type === "data-build-op" || part.type === "data-puck-actions") {
|
|
5010
5012
|
changed = true;
|
|
5011
5013
|
}
|
|
5012
5014
|
await untilAborted(
|
|
5013
|
-
applyToEditor(part, { signal: controller.signal }),
|
|
5015
|
+
applyToEditor(part, { chatId, signal: controller.signal }),
|
|
5014
5016
|
controller.signal
|
|
5015
5017
|
);
|
|
5016
5018
|
}
|
package/dist/index.mjs
CHANGED
|
@@ -4627,7 +4627,7 @@ var usePuck2 = createUsePuck2();
|
|
|
4627
4627
|
var DEFAULT_API_VERSION = "v2";
|
|
4628
4628
|
var BUILD_OP_DEBOUNCE_MS = 1e3 / 60;
|
|
4629
4629
|
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.";
|
|
4630
|
-
var PLUGIN_AI_VERSION = true ? "0.10.0-canary.
|
|
4630
|
+
var PLUGIN_AI_VERSION = true ? "0.10.0-canary.b000f643" : "unknown";
|
|
4631
4631
|
var prefixedUlid = (prefix = "") => `${prefix ? `${prefix}_` : ""}${ulid()}`;
|
|
4632
4632
|
async function prepareRequestOptions(defaults, prepareRequest) {
|
|
4633
4633
|
if (!prepareRequest) return defaults;
|
|
@@ -5034,14 +5034,16 @@ function usePuckAiInternal({
|
|
|
5034
5034
|
body?.error ?? `Puck AI request failed: ${response.status} ${response.statusText}`
|
|
5035
5035
|
);
|
|
5036
5036
|
}
|
|
5037
|
+
let chatId;
|
|
5037
5038
|
for await (const part of iterateSSE(response.body)) {
|
|
5038
5039
|
if (controller.signal.aborted) throw abortError();
|
|
5039
5040
|
if (part.type === "error") throw new Error(part.errorText);
|
|
5041
|
+
if (part.type === "data-new-chat-created") chatId = part.data.chatId;
|
|
5040
5042
|
if (part.type === "data-build-op" || part.type === "data-puck-actions") {
|
|
5041
5043
|
changed = true;
|
|
5042
5044
|
}
|
|
5043
5045
|
await untilAborted(
|
|
5044
|
-
applyToEditor(part, { signal: controller.signal }),
|
|
5046
|
+
applyToEditor(part, { chatId, signal: controller.signal }),
|
|
5045
5047
|
controller.signal
|
|
5046
5048
|
);
|
|
5047
5049
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@puckeditor/plugin-ai",
|
|
3
|
-
"version": "0.10.0-canary.
|
|
3
|
+
"version": "0.10.0-canary.b000f643",
|
|
4
4
|
"author": "Chris Villa <chris@puckeditor.com>",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -54,12 +54,12 @@
|
|
|
54
54
|
"typescript": "^5.5.4",
|
|
55
55
|
"vite-tsconfig-paths": "^5.1.4",
|
|
56
56
|
"vitest": "^4.1.12",
|
|
57
|
-
"@puckeditor/ai-types": "0.10.0-canary.
|
|
58
|
-
"
|
|
59
|
-
"
|
|
60
|
-
"
|
|
61
|
-
"
|
|
62
|
-
"
|
|
57
|
+
"@puckeditor/ai-types": "0.10.0-canary.b000f643",
|
|
58
|
+
"@puckeditor/platform-types": "0.10.0-canary.b000f643",
|
|
59
|
+
"eslint-config-custom": "0.10.0-canary.b000f643",
|
|
60
|
+
"reducer": "0.10.0-canary.b000f643",
|
|
61
|
+
"tsconfig": "0.10.0-canary.b000f643",
|
|
62
|
+
"tsup-config": "0.10.0-canary.b000f643"
|
|
63
63
|
},
|
|
64
64
|
"peerDependencies": {
|
|
65
65
|
"@puckeditor/core": "^0",
|