@puckeditor/plugin-ai 0.8.0-canary.fdb02235 → 0.8.0
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.css +337 -310
- package/dist/index.d.mts +16 -1
- package/dist/index.d.ts +16 -1
- package/dist/index.js +995 -6214
- package/dist/index.mjs +1034 -6251
- package/package.json +25 -25
package/dist/index.d.mts
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import * as react from 'react';
|
|
2
|
+
import { ReactNode } from 'react';
|
|
2
3
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
3
4
|
import { PuckAction, Data, Config } from '@puckeditor/core';
|
|
4
|
-
import { LanguageModelUsage, UIMessage, CreateUIMessage, DataUIPart, ChatStatus } from 'ai';
|
|
5
|
+
import { LanguageModelUsage, UIMessage, CreateUIMessage, DataUIPart, ChatStatus, ChatOnFinishCallback } from 'ai';
|
|
5
6
|
|
|
6
7
|
type _JSONSchema = boolean | JSONSchema;
|
|
7
8
|
type JSONSchema = {
|
|
@@ -164,6 +165,7 @@ type TokenUsage = {
|
|
|
164
165
|
totalTokens: number | undefined;
|
|
165
166
|
reasoningTokens?: number | undefined;
|
|
166
167
|
cachedInputTokens?: number | undefined;
|
|
168
|
+
cacheWriteTokens?: number | undefined;
|
|
167
169
|
};
|
|
168
170
|
type DataFinish = {
|
|
169
171
|
totalCost: number;
|
|
@@ -231,6 +233,13 @@ type PuckDataParts = {
|
|
|
231
233
|
"subagent-event": SubagentEvent;
|
|
232
234
|
finish: DataFinish;
|
|
233
235
|
page: Data;
|
|
236
|
+
"version-notice": {
|
|
237
|
+
package: string;
|
|
238
|
+
message: string;
|
|
239
|
+
currentVersion: string;
|
|
240
|
+
latestVersion: string;
|
|
241
|
+
blogUrl: string;
|
|
242
|
+
};
|
|
234
243
|
};
|
|
235
244
|
type PuckProviderMetadata = {
|
|
236
245
|
tokenUsage?: LanguageModelUsage;
|
|
@@ -266,11 +275,16 @@ type AiPluginProps = {
|
|
|
266
275
|
type: "file";
|
|
267
276
|
}>[];
|
|
268
277
|
}) => void | Promise<void>;
|
|
278
|
+
onFinish?: ChatOnFinishCallback<PuckMessage>;
|
|
269
279
|
examplePrompts?: {
|
|
270
280
|
label: string;
|
|
271
281
|
href?: string;
|
|
272
282
|
onClick?: () => void;
|
|
273
283
|
}[];
|
|
284
|
+
placeholder?: ReactNode;
|
|
285
|
+
actions?: ReactNode | ((state: {
|
|
286
|
+
disabled: boolean;
|
|
287
|
+
}) => ReactNode);
|
|
274
288
|
};
|
|
275
289
|
scrollTracking?: boolean;
|
|
276
290
|
prepareRequest?: (opts: RequestOptions) => RequestOptions | Promise<RequestOptions>;
|
|
@@ -286,6 +300,7 @@ declare global {
|
|
|
286
300
|
setMessages: (_messages: PuckMessage[]) => void;
|
|
287
301
|
processData: (_messages: DataUIPart<PuckDataParts>) => void;
|
|
288
302
|
setStatus: (_status: ChatStatus) => void;
|
|
303
|
+
focus: () => void;
|
|
289
304
|
};
|
|
290
305
|
}
|
|
291
306
|
}
|
package/dist/index.d.ts
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import * as react from 'react';
|
|
2
|
+
import { ReactNode } from 'react';
|
|
2
3
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
3
4
|
import { PuckAction, Data, Config } from '@puckeditor/core';
|
|
4
|
-
import { LanguageModelUsage, UIMessage, CreateUIMessage, DataUIPart, ChatStatus } from 'ai';
|
|
5
|
+
import { LanguageModelUsage, UIMessage, CreateUIMessage, DataUIPart, ChatStatus, ChatOnFinishCallback } from 'ai';
|
|
5
6
|
|
|
6
7
|
type _JSONSchema = boolean | JSONSchema;
|
|
7
8
|
type JSONSchema = {
|
|
@@ -164,6 +165,7 @@ type TokenUsage = {
|
|
|
164
165
|
totalTokens: number | undefined;
|
|
165
166
|
reasoningTokens?: number | undefined;
|
|
166
167
|
cachedInputTokens?: number | undefined;
|
|
168
|
+
cacheWriteTokens?: number | undefined;
|
|
167
169
|
};
|
|
168
170
|
type DataFinish = {
|
|
169
171
|
totalCost: number;
|
|
@@ -231,6 +233,13 @@ type PuckDataParts = {
|
|
|
231
233
|
"subagent-event": SubagentEvent;
|
|
232
234
|
finish: DataFinish;
|
|
233
235
|
page: Data;
|
|
236
|
+
"version-notice": {
|
|
237
|
+
package: string;
|
|
238
|
+
message: string;
|
|
239
|
+
currentVersion: string;
|
|
240
|
+
latestVersion: string;
|
|
241
|
+
blogUrl: string;
|
|
242
|
+
};
|
|
234
243
|
};
|
|
235
244
|
type PuckProviderMetadata = {
|
|
236
245
|
tokenUsage?: LanguageModelUsage;
|
|
@@ -266,11 +275,16 @@ type AiPluginProps = {
|
|
|
266
275
|
type: "file";
|
|
267
276
|
}>[];
|
|
268
277
|
}) => void | Promise<void>;
|
|
278
|
+
onFinish?: ChatOnFinishCallback<PuckMessage>;
|
|
269
279
|
examplePrompts?: {
|
|
270
280
|
label: string;
|
|
271
281
|
href?: string;
|
|
272
282
|
onClick?: () => void;
|
|
273
283
|
}[];
|
|
284
|
+
placeholder?: ReactNode;
|
|
285
|
+
actions?: ReactNode | ((state: {
|
|
286
|
+
disabled: boolean;
|
|
287
|
+
}) => ReactNode);
|
|
274
288
|
};
|
|
275
289
|
scrollTracking?: boolean;
|
|
276
290
|
prepareRequest?: (opts: RequestOptions) => RequestOptions | Promise<RequestOptions>;
|
|
@@ -286,6 +300,7 @@ declare global {
|
|
|
286
300
|
setMessages: (_messages: PuckMessage[]) => void;
|
|
287
301
|
processData: (_messages: DataUIPart<PuckDataParts>) => void;
|
|
288
302
|
setStatus: (_status: ChatStatus) => void;
|
|
303
|
+
focus: () => void;
|
|
289
304
|
};
|
|
290
305
|
}
|
|
291
306
|
}
|