@puckeditor/cloud-client 0.1.0-canary.cc0c9a13 → 0.1.0-canary.dfd624ec
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 +13 -21
- package/dist/index.d.ts +13 -21
- package/dist/index.js +19697 -162
- package/dist/index.mjs +19680 -144
- package/package.json +4 -6
package/dist/index.d.mts
CHANGED
|
@@ -2,10 +2,6 @@ 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>;
|
|
9
5
|
type UserTool<INPUT extends z.ZodTypeAny = z.ZodTypeAny, OUTPUT extends z.ZodTypeAny = z.ZodTypeAny> = {
|
|
10
6
|
name?: string;
|
|
11
7
|
description: string;
|
|
@@ -18,24 +14,20 @@ type UserToolRegistry = Record<string, UserTool>;
|
|
|
18
14
|
declare const endpoints: readonly ["chat"];
|
|
19
15
|
type Endpoint = (typeof endpoints)[number];
|
|
20
16
|
type PuckCatchAll = [Endpoint | string, ...string[]];
|
|
21
|
-
type
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
tools?: UserToolRegistry;
|
|
29
|
-
};
|
|
30
|
-
};
|
|
31
|
-
declare const createPuckApi: ({ apiKey, host, }?: {
|
|
17
|
+
type ChatParams = {
|
|
18
|
+
context?: string;
|
|
19
|
+
chatId?: string;
|
|
20
|
+
messages: UIMessage[];
|
|
21
|
+
config: Config;
|
|
22
|
+
pageData: Data;
|
|
23
|
+
tools?: UserToolRegistry;
|
|
32
24
|
host?: string;
|
|
33
25
|
apiKey?: string;
|
|
34
|
-
}) => {
|
|
35
|
-
all: <ThisEndpoint extends Endpoint | string>(path: [ThisEndpoint | string, ...string[]], body: ThisEndpoint extends Endpoint ? ApiParams[ThisEndpoint] : any) => Promise<Response>;
|
|
36
|
-
ai: {
|
|
37
|
-
chat: ({ chatId, context, messages: initialMessages, config, pageData, tools, }: ApiParams["chat"]) => Promise<Response>;
|
|
38
|
-
};
|
|
39
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>;
|
|
40
32
|
|
|
41
|
-
export { type ApiParams, type Endpoint, type PuckCatchAll,
|
|
33
|
+
export { type ApiParams, type ChatParams, type Endpoint, type PuckCatchAll, all, chat, tool };
|
package/dist/index.d.ts
CHANGED
|
@@ -2,10 +2,6 @@ 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>;
|
|
9
5
|
type UserTool<INPUT extends z.ZodTypeAny = z.ZodTypeAny, OUTPUT extends z.ZodTypeAny = z.ZodTypeAny> = {
|
|
10
6
|
name?: string;
|
|
11
7
|
description: string;
|
|
@@ -18,24 +14,20 @@ type UserToolRegistry = Record<string, UserTool>;
|
|
|
18
14
|
declare const endpoints: readonly ["chat"];
|
|
19
15
|
type Endpoint = (typeof endpoints)[number];
|
|
20
16
|
type PuckCatchAll = [Endpoint | string, ...string[]];
|
|
21
|
-
type
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
tools?: UserToolRegistry;
|
|
29
|
-
};
|
|
30
|
-
};
|
|
31
|
-
declare const createPuckApi: ({ apiKey, host, }?: {
|
|
17
|
+
type ChatParams = {
|
|
18
|
+
context?: string;
|
|
19
|
+
chatId?: string;
|
|
20
|
+
messages: UIMessage[];
|
|
21
|
+
config: Config;
|
|
22
|
+
pageData: Data;
|
|
23
|
+
tools?: UserToolRegistry;
|
|
32
24
|
host?: string;
|
|
33
25
|
apiKey?: string;
|
|
34
|
-
}) => {
|
|
35
|
-
all: <ThisEndpoint extends Endpoint | string>(path: [ThisEndpoint | string, ...string[]], body: ThisEndpoint extends Endpoint ? ApiParams[ThisEndpoint] : any) => Promise<Response>;
|
|
36
|
-
ai: {
|
|
37
|
-
chat: ({ chatId, context, messages: initialMessages, config, pageData, tools, }: ApiParams["chat"]) => Promise<Response>;
|
|
38
|
-
};
|
|
39
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>;
|
|
40
32
|
|
|
41
|
-
export { type ApiParams, type Endpoint, type PuckCatchAll,
|
|
33
|
+
export { type ApiParams, type ChatParams, type Endpoint, type PuckCatchAll, all, chat, tool };
|