@puckeditor/cloud-client 0.1.0-canary.9761de95 → 0.1.0-canary.9ab34cf9
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.d.mts +16 -13
- package/dist/index.d.ts +16 -13
- package/dist/index.js +2402 -2444
- package/dist/index.mjs +2335 -2379
- package/package.json +3 -2
package/dist/index.d.mts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { UIMessage } from 'ai';
|
|
2
1
|
import z from 'zod/v4';
|
|
2
|
+
import { UIMessage } from 'ai';
|
|
3
3
|
import { Config, Data } from '@measured/puck';
|
|
4
4
|
|
|
5
5
|
type UserTool<INPUT extends z.ZodTypeAny = z.ZodTypeAny, OUTPUT extends z.ZodTypeAny = z.ZodTypeAny> = {
|
|
@@ -10,24 +10,27 @@ type UserTool<INPUT extends z.ZodTypeAny = z.ZodTypeAny, OUTPUT extends z.ZodTyp
|
|
|
10
10
|
execute: (input: z.infer<INPUT>) => Promise<z.infer<OUTPUT>> | z.infer<OUTPUT>;
|
|
11
11
|
};
|
|
12
12
|
declare const tool: <INPUT extends z.ZodTypeAny, OUTPUT extends z.ZodTypeAny>(t: UserTool<INPUT, OUTPUT>) => UserTool<INPUT, OUTPUT>;
|
|
13
|
-
|
|
14
|
-
declare const endpoints: readonly ["chat"];
|
|
15
|
-
type Endpoint = (typeof endpoints)[number];
|
|
16
|
-
type PuckCatchAll = [Endpoint | string, ...string[]];
|
|
13
|
+
|
|
17
14
|
type ChatParams = {
|
|
18
|
-
context?: string;
|
|
19
15
|
chatId?: string;
|
|
20
16
|
messages: UIMessage[];
|
|
21
17
|
config: Config;
|
|
22
18
|
pageData: Data;
|
|
23
|
-
|
|
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
|
+
};
|
|
24
31
|
host?: string;
|
|
25
32
|
apiKey?: string;
|
|
26
33
|
};
|
|
27
|
-
type
|
|
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>;
|
|
34
|
+
type UserToolRegistry = Record<string, UserTool>;
|
|
32
35
|
|
|
33
|
-
export { type
|
|
36
|
+
export { type ChatParams, type Endpoint, type PuckCloudOptions, type UserTool, type UserToolRegistry, chat, endpoints, puckHandler, tool };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { UIMessage } from 'ai';
|
|
2
1
|
import z from 'zod/v4';
|
|
2
|
+
import { UIMessage } from 'ai';
|
|
3
3
|
import { Config, Data } from '@measured/puck';
|
|
4
4
|
|
|
5
5
|
type UserTool<INPUT extends z.ZodTypeAny = z.ZodTypeAny, OUTPUT extends z.ZodTypeAny = z.ZodTypeAny> = {
|
|
@@ -10,24 +10,27 @@ type UserTool<INPUT extends z.ZodTypeAny = z.ZodTypeAny, OUTPUT extends z.ZodTyp
|
|
|
10
10
|
execute: (input: z.infer<INPUT>) => Promise<z.infer<OUTPUT>> | z.infer<OUTPUT>;
|
|
11
11
|
};
|
|
12
12
|
declare const tool: <INPUT extends z.ZodTypeAny, OUTPUT extends z.ZodTypeAny>(t: UserTool<INPUT, OUTPUT>) => UserTool<INPUT, OUTPUT>;
|
|
13
|
-
|
|
14
|
-
declare const endpoints: readonly ["chat"];
|
|
15
|
-
type Endpoint = (typeof endpoints)[number];
|
|
16
|
-
type PuckCatchAll = [Endpoint | string, ...string[]];
|
|
13
|
+
|
|
17
14
|
type ChatParams = {
|
|
18
|
-
context?: string;
|
|
19
15
|
chatId?: string;
|
|
20
16
|
messages: UIMessage[];
|
|
21
17
|
config: Config;
|
|
22
18
|
pageData: Data;
|
|
23
|
-
|
|
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
|
+
};
|
|
24
31
|
host?: string;
|
|
25
32
|
apiKey?: string;
|
|
26
33
|
};
|
|
27
|
-
type
|
|
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>;
|
|
34
|
+
type UserToolRegistry = Record<string, UserTool>;
|
|
32
35
|
|
|
33
|
-
export { type
|
|
36
|
+
export { type ChatParams, type Endpoint, type PuckCloudOptions, type UserTool, type UserToolRegistry, chat, endpoints, puckHandler, tool };
|