@puckeditor/plugin-ai 0.0.1

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.
@@ -0,0 +1,59 @@
1
+ import * as react_jsx_runtime from 'react/jsx-runtime';
2
+ import { UIMessage, ChatStatus } from 'ai';
3
+ import { PuckAction } from '@measured/puck';
4
+ import { ReactNode, RefObject } from 'react';
5
+
6
+ type ToolStatus = {
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
+ }>;
28
+
29
+ type ChatProps$1 = {
30
+ host?: string;
31
+ onSubmit?: (prompt: string) => void;
32
+ examplePrompts?: {
33
+ href: string;
34
+ label: string;
35
+ }[];
36
+ chatId?: string;
37
+ initialMessages?: PuckMessage[];
38
+ };
39
+
40
+ declare function createAIPlugin(opts?: ChatProps$1): {
41
+ label: string;
42
+ name: string;
43
+ render: () => react_jsx_runtime.JSX.Element;
44
+ icon: react_jsx_runtime.JSX.Element;
45
+ mobilePanelHeight: "min-content";
46
+ };
47
+
48
+ type ChatProps = {
49
+ children?: ReactNode;
50
+ examplePrompts?: ReactNode;
51
+ handleSubmit?: (prompt: string) => void;
52
+ hideInput?: boolean;
53
+ inputRef?: RefObject<HTMLTextAreaElement | null>;
54
+ status?: ChatStatus;
55
+ messages?: PuckMessage[];
56
+ };
57
+ declare function ChatBody({ children, examplePrompts, handleSubmit, hideInput, inputRef, messages, status, }: ChatProps): react_jsx_runtime.JSX.Element;
58
+
59
+ export { ChatBody, createAIPlugin as default };
@@ -0,0 +1,59 @@
1
+ import * as react_jsx_runtime from 'react/jsx-runtime';
2
+ import { UIMessage, ChatStatus } from 'ai';
3
+ import { PuckAction } from '@measured/puck';
4
+ import { ReactNode, RefObject } from 'react';
5
+
6
+ type ToolStatus = {
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
+ }>;
28
+
29
+ type ChatProps$1 = {
30
+ host?: string;
31
+ onSubmit?: (prompt: string) => void;
32
+ examplePrompts?: {
33
+ href: string;
34
+ label: string;
35
+ }[];
36
+ chatId?: string;
37
+ initialMessages?: PuckMessage[];
38
+ };
39
+
40
+ declare function createAIPlugin(opts?: ChatProps$1): {
41
+ label: string;
42
+ name: string;
43
+ render: () => react_jsx_runtime.JSX.Element;
44
+ icon: react_jsx_runtime.JSX.Element;
45
+ mobilePanelHeight: "min-content";
46
+ };
47
+
48
+ type ChatProps = {
49
+ children?: ReactNode;
50
+ examplePrompts?: ReactNode;
51
+ handleSubmit?: (prompt: string) => void;
52
+ hideInput?: boolean;
53
+ inputRef?: RefObject<HTMLTextAreaElement | null>;
54
+ status?: ChatStatus;
55
+ messages?: PuckMessage[];
56
+ };
57
+ declare function ChatBody({ children, examplePrompts, handleSubmit, hideInput, inputRef, messages, status, }: ChatProps): react_jsx_runtime.JSX.Element;
58
+
59
+ export { ChatBody, createAIPlugin as default };