@puckeditor/cloud-client 0.1.0-canary.9bbf5396 → 0.1.0-canary.a2742ff6
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 +21 -16
- package/dist/index.d.ts +21 -16
- package/dist/index.js +163 -19697
- package/dist/index.mjs +154 -19689
- package/package.json +6 -4
package/dist/index.d.mts
CHANGED
|
@@ -2,6 +2,10 @@ import { UIMessage } from 'ai';
|
|
|
2
2
|
import z from 'zod/v4';
|
|
3
3
|
import { Config, Data } from '@measured/puck';
|
|
4
4
|
|
|
5
|
+
/**
|
|
6
|
+
* Generator function that streams the response body from a fetch request.
|
|
7
|
+
*/
|
|
8
|
+
declare function streamingFetch(input: RequestInfo | URL, init?: RequestInit): AsyncGenerator<string, void, unknown>;
|
|
5
9
|
type UserTool<INPUT extends z.ZodTypeAny = z.ZodTypeAny, OUTPUT extends z.ZodTypeAny = z.ZodTypeAny> = {
|
|
6
10
|
name?: string;
|
|
7
11
|
description: string;
|
|
@@ -11,23 +15,24 @@ type UserTool<INPUT extends z.ZodTypeAny = z.ZodTypeAny, OUTPUT extends z.ZodTyp
|
|
|
11
15
|
};
|
|
12
16
|
declare const tool: <INPUT extends z.ZodTypeAny, OUTPUT extends z.ZodTypeAny>(t: UserTool<INPUT, OUTPUT>) => UserTool<INPUT, OUTPUT>;
|
|
13
17
|
type UserToolRegistry = Record<string, UserTool>;
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
18
|
+
type ApiParams = {
|
|
19
|
+
chat: {
|
|
20
|
+
instructions?: string;
|
|
21
|
+
chatId?: string;
|
|
22
|
+
messages: UIMessage[];
|
|
23
|
+
config: Config;
|
|
24
|
+
pageData: Data;
|
|
25
|
+
tools?: UserToolRegistry;
|
|
26
|
+
};
|
|
27
|
+
};
|
|
28
|
+
declare const createPuckApi: ({ apiKey, host, }?: {
|
|
24
29
|
host?: string;
|
|
25
30
|
apiKey?: string;
|
|
31
|
+
}) => {
|
|
32
|
+
auto: (path: string[], request: Request) => Promise<Response>;
|
|
33
|
+
ai: {
|
|
34
|
+
chat: ({ chatId, instructions, messages: initialMessages, config, pageData, tools, }: ApiParams["chat"]) => Promise<Response>;
|
|
35
|
+
};
|
|
26
36
|
};
|
|
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
37
|
|
|
33
|
-
export { type ApiParams,
|
|
38
|
+
export { type ApiParams, createPuckApi, streamingFetch, tool };
|
package/dist/index.d.ts
CHANGED
|
@@ -2,6 +2,10 @@ import { UIMessage } from 'ai';
|
|
|
2
2
|
import z from 'zod/v4';
|
|
3
3
|
import { Config, Data } from '@measured/puck';
|
|
4
4
|
|
|
5
|
+
/**
|
|
6
|
+
* Generator function that streams the response body from a fetch request.
|
|
7
|
+
*/
|
|
8
|
+
declare function streamingFetch(input: RequestInfo | URL, init?: RequestInit): AsyncGenerator<string, void, unknown>;
|
|
5
9
|
type UserTool<INPUT extends z.ZodTypeAny = z.ZodTypeAny, OUTPUT extends z.ZodTypeAny = z.ZodTypeAny> = {
|
|
6
10
|
name?: string;
|
|
7
11
|
description: string;
|
|
@@ -11,23 +15,24 @@ type UserTool<INPUT extends z.ZodTypeAny = z.ZodTypeAny, OUTPUT extends z.ZodTyp
|
|
|
11
15
|
};
|
|
12
16
|
declare const tool: <INPUT extends z.ZodTypeAny, OUTPUT extends z.ZodTypeAny>(t: UserTool<INPUT, OUTPUT>) => UserTool<INPUT, OUTPUT>;
|
|
13
17
|
type UserToolRegistry = Record<string, UserTool>;
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
18
|
+
type ApiParams = {
|
|
19
|
+
chat: {
|
|
20
|
+
instructions?: string;
|
|
21
|
+
chatId?: string;
|
|
22
|
+
messages: UIMessage[];
|
|
23
|
+
config: Config;
|
|
24
|
+
pageData: Data;
|
|
25
|
+
tools?: UserToolRegistry;
|
|
26
|
+
};
|
|
27
|
+
};
|
|
28
|
+
declare const createPuckApi: ({ apiKey, host, }?: {
|
|
24
29
|
host?: string;
|
|
25
30
|
apiKey?: string;
|
|
31
|
+
}) => {
|
|
32
|
+
auto: (path: string[], request: Request) => Promise<Response>;
|
|
33
|
+
ai: {
|
|
34
|
+
chat: ({ chatId, instructions, messages: initialMessages, config, pageData, tools, }: ApiParams["chat"]) => Promise<Response>;
|
|
35
|
+
};
|
|
26
36
|
};
|
|
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
37
|
|
|
33
|
-
export { type ApiParams,
|
|
38
|
+
export { type ApiParams, createPuckApi, streamingFetch, tool };
|