@puckeditor/plugin-ai 0.0.1 → 0.1.0-canary.022b3ecb
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 +227 -742
- package/dist/index.d.mts +5 -24
- package/dist/index.d.ts +5 -24
- package/dist/index.js +20881 -377
- package/dist/index.mjs +20904 -396
- package/package.json +11 -8
package/dist/index.d.mts
CHANGED
|
@@ -1,30 +1,9 @@
|
|
|
1
1
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
2
|
import { UIMessage, ChatStatus } from 'ai';
|
|
3
|
-
import {
|
|
3
|
+
import { PuckProviderMetadata, PuckDataParts } from '@puckeditor/platform-types';
|
|
4
4
|
import { ReactNode, RefObject } from 'react';
|
|
5
5
|
|
|
6
|
-
type
|
|
7
|
-
loading: boolean;
|
|
8
|
-
label: string;
|
|
9
|
-
};
|
|
10
|
-
type DataToolStatus = {
|
|
11
|
-
status: ToolStatus;
|
|
12
|
-
toolCallId: string;
|
|
13
|
-
};
|
|
14
|
-
type PuckMessage = UIMessage<never, {
|
|
15
|
-
"new-chat-created": {
|
|
16
|
-
chatId: string;
|
|
17
|
-
};
|
|
18
|
-
"puck-actions": PuckAction[];
|
|
19
|
-
"tool-status": DataToolStatus;
|
|
20
|
-
"user-tool": {
|
|
21
|
-
toolCallId: string;
|
|
22
|
-
tools: {
|
|
23
|
-
name: string;
|
|
24
|
-
input: any;
|
|
25
|
-
}[];
|
|
26
|
-
};
|
|
27
|
-
}>;
|
|
6
|
+
type PuckMessage = UIMessage<PuckProviderMetadata, PuckDataParts>;
|
|
28
7
|
|
|
29
8
|
type ChatProps$1 = {
|
|
30
9
|
host?: string;
|
|
@@ -53,7 +32,9 @@ type ChatProps = {
|
|
|
53
32
|
inputRef?: RefObject<HTMLTextAreaElement | null>;
|
|
54
33
|
status?: ChatStatus;
|
|
55
34
|
messages?: PuckMessage[];
|
|
35
|
+
error?: string;
|
|
36
|
+
handleRetry?: () => void;
|
|
56
37
|
};
|
|
57
|
-
declare function ChatBody({ children, examplePrompts, handleSubmit, hideInput, inputRef, messages, status, }: ChatProps): react_jsx_runtime.JSX.Element;
|
|
38
|
+
declare function ChatBody({ children, examplePrompts, handleSubmit, hideInput, inputRef, messages, status, error, handleRetry, }: ChatProps): react_jsx_runtime.JSX.Element;
|
|
58
39
|
|
|
59
40
|
export { ChatBody, createAIPlugin as default };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,30 +1,9 @@
|
|
|
1
1
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
2
|
import { UIMessage, ChatStatus } from 'ai';
|
|
3
|
-
import {
|
|
3
|
+
import { PuckProviderMetadata, PuckDataParts } from '@puckeditor/platform-types';
|
|
4
4
|
import { ReactNode, RefObject } from 'react';
|
|
5
5
|
|
|
6
|
-
type
|
|
7
|
-
loading: boolean;
|
|
8
|
-
label: string;
|
|
9
|
-
};
|
|
10
|
-
type DataToolStatus = {
|
|
11
|
-
status: ToolStatus;
|
|
12
|
-
toolCallId: string;
|
|
13
|
-
};
|
|
14
|
-
type PuckMessage = UIMessage<never, {
|
|
15
|
-
"new-chat-created": {
|
|
16
|
-
chatId: string;
|
|
17
|
-
};
|
|
18
|
-
"puck-actions": PuckAction[];
|
|
19
|
-
"tool-status": DataToolStatus;
|
|
20
|
-
"user-tool": {
|
|
21
|
-
toolCallId: string;
|
|
22
|
-
tools: {
|
|
23
|
-
name: string;
|
|
24
|
-
input: any;
|
|
25
|
-
}[];
|
|
26
|
-
};
|
|
27
|
-
}>;
|
|
6
|
+
type PuckMessage = UIMessage<PuckProviderMetadata, PuckDataParts>;
|
|
28
7
|
|
|
29
8
|
type ChatProps$1 = {
|
|
30
9
|
host?: string;
|
|
@@ -53,7 +32,9 @@ type ChatProps = {
|
|
|
53
32
|
inputRef?: RefObject<HTMLTextAreaElement | null>;
|
|
54
33
|
status?: ChatStatus;
|
|
55
34
|
messages?: PuckMessage[];
|
|
35
|
+
error?: string;
|
|
36
|
+
handleRetry?: () => void;
|
|
56
37
|
};
|
|
57
|
-
declare function ChatBody({ children, examplePrompts, handleSubmit, hideInput, inputRef, messages, status, }: ChatProps): react_jsx_runtime.JSX.Element;
|
|
38
|
+
declare function ChatBody({ children, examplePrompts, handleSubmit, hideInput, inputRef, messages, status, error, handleRetry, }: ChatProps): react_jsx_runtime.JSX.Element;
|
|
58
39
|
|
|
59
40
|
export { ChatBody, createAIPlugin as default };
|