@puckeditor/cloud-client 0.1.0-canary.e666268d → 0.1.0-canary.ea51dddf
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/package.json +6 -4
- package/dist/index.d.mts +0 -41
- package/dist/index.d.ts +0 -41
- package/dist/index.js +0 -19840
- package/dist/index.mjs +0 -19808
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@puckeditor/cloud-client",
|
|
3
|
-
"version": "0.1.0-canary.
|
|
3
|
+
"version": "0.1.0-canary.ea51dddf",
|
|
4
4
|
"author": "Chris Villa <chris@puckeditor.com>",
|
|
5
5
|
"repository": "puckeditor/puck",
|
|
6
6
|
"bugs": "https://github.com/puckeditor/puck/issues",
|
|
@@ -21,16 +21,18 @@
|
|
|
21
21
|
"dist"
|
|
22
22
|
],
|
|
23
23
|
"devDependencies": {
|
|
24
|
-
"@measured/puck": "0.21.0-canary.
|
|
24
|
+
"@measured/puck": "0.21.0-canary.5c9698fb",
|
|
25
25
|
"@types/node": "^24.3.0",
|
|
26
|
-
"ai": "^5.0.29",
|
|
27
26
|
"eslint": "^7.32.0",
|
|
28
27
|
"eslint-config-custom": "workspace:*",
|
|
29
28
|
"jest": "^29.6.4",
|
|
30
29
|
"tsconfig": "workspace:*",
|
|
31
30
|
"tsup": "^8.2.4",
|
|
32
31
|
"tsup-config": "workspace:*",
|
|
33
|
-
"typescript": "^5.5.4"
|
|
32
|
+
"typescript": "^5.5.4"
|
|
33
|
+
},
|
|
34
|
+
"dependencies": {
|
|
35
|
+
"ai": "^5.0.29",
|
|
34
36
|
"zod": "^4.1.9"
|
|
35
37
|
}
|
|
36
38
|
}
|
package/dist/index.d.mts
DELETED
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
import { UIMessage } from 'ai';
|
|
2
|
-
import z from 'zod/v4';
|
|
3
|
-
import { Config, Data } from '@measured/puck';
|
|
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
|
-
type UserTool<INPUT extends z.ZodTypeAny = z.ZodTypeAny, OUTPUT extends z.ZodTypeAny = z.ZodTypeAny> = {
|
|
10
|
-
name?: string;
|
|
11
|
-
description: string;
|
|
12
|
-
inputSchema: INPUT;
|
|
13
|
-
outputSchema?: OUTPUT;
|
|
14
|
-
execute: (input: z.infer<INPUT>) => Promise<z.infer<OUTPUT>> | z.infer<OUTPUT>;
|
|
15
|
-
};
|
|
16
|
-
declare const tool: <INPUT extends z.ZodTypeAny, OUTPUT extends z.ZodTypeAny>(t: UserTool<INPUT, OUTPUT>) => UserTool<INPUT, OUTPUT>;
|
|
17
|
-
type UserToolRegistry = Record<string, UserTool>;
|
|
18
|
-
declare const endpoints: readonly ["chat"];
|
|
19
|
-
type Endpoint = (typeof endpoints)[number];
|
|
20
|
-
type PuckCatchAll = [Endpoint | string, ...string[]];
|
|
21
|
-
type ApiParams = {
|
|
22
|
-
chat: {
|
|
23
|
-
context?: string;
|
|
24
|
-
chatId?: string;
|
|
25
|
-
messages: UIMessage[];
|
|
26
|
-
config: Config;
|
|
27
|
-
pageData: Data;
|
|
28
|
-
tools?: UserToolRegistry;
|
|
29
|
-
};
|
|
30
|
-
};
|
|
31
|
-
declare const createPuckApi: ({ apiKey, host, }?: {
|
|
32
|
-
host?: string;
|
|
33
|
-
apiKey?: string;
|
|
34
|
-
}) => {
|
|
35
|
-
all: <ThisEndpoint extends Endpoint | string>(path: [ThisEndpoint | string, ...string[]] | 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
|
-
};
|
|
40
|
-
|
|
41
|
-
export { type ApiParams, type Endpoint, type PuckCatchAll, createPuckApi, createPuckApi as default, streamingFetch, tool };
|
package/dist/index.d.ts
DELETED
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
import { UIMessage } from 'ai';
|
|
2
|
-
import z from 'zod/v4';
|
|
3
|
-
import { Config, Data } from '@measured/puck';
|
|
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
|
-
type UserTool<INPUT extends z.ZodTypeAny = z.ZodTypeAny, OUTPUT extends z.ZodTypeAny = z.ZodTypeAny> = {
|
|
10
|
-
name?: string;
|
|
11
|
-
description: string;
|
|
12
|
-
inputSchema: INPUT;
|
|
13
|
-
outputSchema?: OUTPUT;
|
|
14
|
-
execute: (input: z.infer<INPUT>) => Promise<z.infer<OUTPUT>> | z.infer<OUTPUT>;
|
|
15
|
-
};
|
|
16
|
-
declare const tool: <INPUT extends z.ZodTypeAny, OUTPUT extends z.ZodTypeAny>(t: UserTool<INPUT, OUTPUT>) => UserTool<INPUT, OUTPUT>;
|
|
17
|
-
type UserToolRegistry = Record<string, UserTool>;
|
|
18
|
-
declare const endpoints: readonly ["chat"];
|
|
19
|
-
type Endpoint = (typeof endpoints)[number];
|
|
20
|
-
type PuckCatchAll = [Endpoint | string, ...string[]];
|
|
21
|
-
type ApiParams = {
|
|
22
|
-
chat: {
|
|
23
|
-
context?: string;
|
|
24
|
-
chatId?: string;
|
|
25
|
-
messages: UIMessage[];
|
|
26
|
-
config: Config;
|
|
27
|
-
pageData: Data;
|
|
28
|
-
tools?: UserToolRegistry;
|
|
29
|
-
};
|
|
30
|
-
};
|
|
31
|
-
declare const createPuckApi: ({ apiKey, host, }?: {
|
|
32
|
-
host?: string;
|
|
33
|
-
apiKey?: string;
|
|
34
|
-
}) => {
|
|
35
|
-
all: <ThisEndpoint extends Endpoint | string>(path: [ThisEndpoint | string, ...string[]] | 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
|
-
};
|
|
40
|
-
|
|
41
|
-
export { type ApiParams, type Endpoint, type PuckCatchAll, createPuckApi, createPuckApi as default, streamingFetch, tool };
|