@puckeditor/cloud-client 0.1.0-canary.ea51dddf → 0.1.0-canary.eeb9c902

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,33 @@
1
+ import { UIMessage } from 'ai';
2
+ import z from 'zod/v4';
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
+ type UserToolRegistry = Record<string, UserTool>;
14
+ declare const endpoints: readonly ["chat"];
15
+ type Endpoint = (typeof endpoints)[number];
16
+ type PuckCatchAll = [Endpoint | string, ...string[]];
17
+ type ChatParams = {
18
+ context?: string;
19
+ chatId?: string;
20
+ messages: UIMessage[];
21
+ config: Config;
22
+ pageData: Data;
23
+ tools?: UserToolRegistry;
24
+ host?: string;
25
+ apiKey?: string;
26
+ };
27
+ type ApiParams = {
28
+ chat: ChatParams;
29
+ };
30
+ declare function chat({ chatId, context, messages: initialMessages, config, pageData, tools, apiKey, host, }: ApiParams["chat"]): Response;
31
+ declare function all<ThisEndpoint extends Endpoint | string>(path: [ThisEndpoint | string, ...string[]] | string[] | string, body: ThisEndpoint extends Endpoint ? ApiParams[ThisEndpoint] : any): Promise<Response>;
32
+
33
+ export { type ApiParams, type ChatParams, type Endpoint, type PuckCatchAll, all, chat, tool };
@@ -0,0 +1,33 @@
1
+ import { UIMessage } from 'ai';
2
+ import z from 'zod/v4';
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
+ type UserToolRegistry = Record<string, UserTool>;
14
+ declare const endpoints: readonly ["chat"];
15
+ type Endpoint = (typeof endpoints)[number];
16
+ type PuckCatchAll = [Endpoint | string, ...string[]];
17
+ type ChatParams = {
18
+ context?: string;
19
+ chatId?: string;
20
+ messages: UIMessage[];
21
+ config: Config;
22
+ pageData: Data;
23
+ tools?: UserToolRegistry;
24
+ host?: string;
25
+ apiKey?: string;
26
+ };
27
+ type ApiParams = {
28
+ chat: ChatParams;
29
+ };
30
+ declare function chat({ chatId, context, messages: initialMessages, config, pageData, tools, apiKey, host, }: ApiParams["chat"]): Response;
31
+ declare function all<ThisEndpoint extends Endpoint | string>(path: [ThisEndpoint | string, ...string[]] | string[] | string, body: ThisEndpoint extends Endpoint ? ApiParams[ThisEndpoint] : any): Promise<Response>;
32
+
33
+ export { type ApiParams, type ChatParams, type Endpoint, type PuckCatchAll, all, chat, tool };