@puckeditor/cloud-client 0.3.0-canary.41e65b36 → 0.3.0-canary.78ff547c
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 +14 -3
- package/dist/index.d.ts +14 -3
- package/dist/index.js +313 -264
- package/dist/index.mjs +312 -264
- package/package.json +2 -2
package/dist/index.d.mts
CHANGED
|
@@ -7,7 +7,7 @@ type UserTool<INPUT extends z.ZodTypeAny = z.ZodTypeAny, OUTPUT extends z.ZodTyp
|
|
|
7
7
|
description: string;
|
|
8
8
|
inputSchema: INPUT;
|
|
9
9
|
outputSchema?: OUTPUT;
|
|
10
|
-
execute: (
|
|
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
13
|
|
|
@@ -17,7 +17,18 @@ type ChatParams = {
|
|
|
17
17
|
config: Config;
|
|
18
18
|
pageData: Data;
|
|
19
19
|
};
|
|
20
|
-
declare function chat({ chatId, messages
|
|
20
|
+
declare function chat({ chatId, messages, config, pageData }: ChatParams, options?: PuckCloudOptions | undefined): Response;
|
|
21
|
+
|
|
22
|
+
type GenerateParams = {
|
|
23
|
+
prompt: string;
|
|
24
|
+
config: Config;
|
|
25
|
+
pageData: Data;
|
|
26
|
+
context?: string;
|
|
27
|
+
tools?: UserToolRegistry;
|
|
28
|
+
host?: string;
|
|
29
|
+
apiKey?: string;
|
|
30
|
+
};
|
|
31
|
+
declare function generate({ prompt, config, pageData, context, tools, apiKey, host, }: GenerateParams): Promise<null>;
|
|
21
32
|
|
|
22
33
|
declare function puckHandler(request: Request, options: PuckCloudOptions): Promise<Response>;
|
|
23
34
|
|
|
@@ -33,4 +44,4 @@ type PuckCloudOptions = {
|
|
|
33
44
|
};
|
|
34
45
|
type UserToolRegistry = Record<string, UserTool>;
|
|
35
46
|
|
|
36
|
-
export { type ChatParams, type Endpoint, type PuckCloudOptions, type UserTool, type UserToolRegistry, chat, endpoints, puckHandler, tool };
|
|
47
|
+
export { type ChatParams, type Endpoint, type GenerateParams, type PuckCloudOptions, type UserTool, type UserToolRegistry, chat, endpoints, generate, puckHandler, tool };
|
package/dist/index.d.ts
CHANGED
|
@@ -7,7 +7,7 @@ type UserTool<INPUT extends z.ZodTypeAny = z.ZodTypeAny, OUTPUT extends z.ZodTyp
|
|
|
7
7
|
description: string;
|
|
8
8
|
inputSchema: INPUT;
|
|
9
9
|
outputSchema?: OUTPUT;
|
|
10
|
-
execute: (
|
|
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
13
|
|
|
@@ -17,7 +17,18 @@ type ChatParams = {
|
|
|
17
17
|
config: Config;
|
|
18
18
|
pageData: Data;
|
|
19
19
|
};
|
|
20
|
-
declare function chat({ chatId, messages
|
|
20
|
+
declare function chat({ chatId, messages, config, pageData }: ChatParams, options?: PuckCloudOptions | undefined): Response;
|
|
21
|
+
|
|
22
|
+
type GenerateParams = {
|
|
23
|
+
prompt: string;
|
|
24
|
+
config: Config;
|
|
25
|
+
pageData: Data;
|
|
26
|
+
context?: string;
|
|
27
|
+
tools?: UserToolRegistry;
|
|
28
|
+
host?: string;
|
|
29
|
+
apiKey?: string;
|
|
30
|
+
};
|
|
31
|
+
declare function generate({ prompt, config, pageData, context, tools, apiKey, host, }: GenerateParams): Promise<null>;
|
|
21
32
|
|
|
22
33
|
declare function puckHandler(request: Request, options: PuckCloudOptions): Promise<Response>;
|
|
23
34
|
|
|
@@ -33,4 +44,4 @@ type PuckCloudOptions = {
|
|
|
33
44
|
};
|
|
34
45
|
type UserToolRegistry = Record<string, UserTool>;
|
|
35
46
|
|
|
36
|
-
export { type ChatParams, type Endpoint, type PuckCloudOptions, type UserTool, type UserToolRegistry, chat, endpoints, puckHandler, tool };
|
|
47
|
+
export { type ChatParams, type Endpoint, type GenerateParams, type PuckCloudOptions, type UserTool, type UserToolRegistry, chat, endpoints, generate, puckHandler, tool };
|