@puckeditor/cloud-client 0.0.2-canary.53ffa8a3 → 0.1.0-canary.027b6f23

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,36 @@
1
+ import z from 'zod/v4';
2
+ import { UIMessage } from 'ai';
3
+ import { Config, Data } from '@measured/puck';
4
+
5
+ type UserTool<INPUT extends z.ZodTypeAny = z.ZodTypeAny, OUTPUT extends z.ZodTypeAny = z.ZodTypeAny> = {
6
+ name?: string;
7
+ description: string;
8
+ inputSchema: INPUT;
9
+ outputSchema?: OUTPUT;
10
+ execute: (input: z.infer<INPUT>) => Promise<z.infer<OUTPUT>> | z.infer<OUTPUT>;
11
+ };
12
+ declare const tool: <INPUT extends z.ZodTypeAny, OUTPUT extends z.ZodTypeAny>(t: UserTool<INPUT, OUTPUT>) => UserTool<INPUT, OUTPUT>;
13
+
14
+ type ChatParams = {
15
+ chatId?: string;
16
+ messages: UIMessage[];
17
+ config: Config;
18
+ pageData: Data;
19
+ };
20
+ declare function chat({ chatId, messages: initialMessages, config, pageData }: ChatParams, { ai, apiKey, host, }: PuckCloudOptions): Response;
21
+
22
+ declare function puckHandler(request: Request, options: PuckCloudOptions): Promise<Response>;
23
+
24
+ declare const endpoints: readonly ["chat"];
25
+ type Endpoint = (typeof endpoints)[number];
26
+ type PuckCloudOptions = {
27
+ ai?: {
28
+ context?: string;
29
+ tools?: UserToolRegistry;
30
+ };
31
+ host?: string;
32
+ apiKey?: string;
33
+ };
34
+ type UserToolRegistry = Record<string, UserTool>;
35
+
36
+ export { type ChatParams, type Endpoint, type PuckCloudOptions, type UserTool, type UserToolRegistry, chat, endpoints, puckHandler, tool };
@@ -0,0 +1,36 @@
1
+ import z from 'zod/v4';
2
+ import { UIMessage } from 'ai';
3
+ import { Config, Data } from '@measured/puck';
4
+
5
+ type UserTool<INPUT extends z.ZodTypeAny = z.ZodTypeAny, OUTPUT extends z.ZodTypeAny = z.ZodTypeAny> = {
6
+ name?: string;
7
+ description: string;
8
+ inputSchema: INPUT;
9
+ outputSchema?: OUTPUT;
10
+ execute: (input: z.infer<INPUT>) => Promise<z.infer<OUTPUT>> | z.infer<OUTPUT>;
11
+ };
12
+ declare const tool: <INPUT extends z.ZodTypeAny, OUTPUT extends z.ZodTypeAny>(t: UserTool<INPUT, OUTPUT>) => UserTool<INPUT, OUTPUT>;
13
+
14
+ type ChatParams = {
15
+ chatId?: string;
16
+ messages: UIMessage[];
17
+ config: Config;
18
+ pageData: Data;
19
+ };
20
+ declare function chat({ chatId, messages: initialMessages, config, pageData }: ChatParams, { ai, apiKey, host, }: PuckCloudOptions): Response;
21
+
22
+ declare function puckHandler(request: Request, options: PuckCloudOptions): Promise<Response>;
23
+
24
+ declare const endpoints: readonly ["chat"];
25
+ type Endpoint = (typeof endpoints)[number];
26
+ type PuckCloudOptions = {
27
+ ai?: {
28
+ context?: string;
29
+ tools?: UserToolRegistry;
30
+ };
31
+ host?: string;
32
+ apiKey?: string;
33
+ };
34
+ type UserToolRegistry = Record<string, UserTool>;
35
+
36
+ export { type ChatParams, type Endpoint, type PuckCloudOptions, type UserTool, type UserToolRegistry, chat, endpoints, puckHandler, tool };