@plucky-ai/chat-sdk 0.0.1-alpha.1
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/README.md +49 -0
- package/bin/publish-npm +20 -0
- package/dist/index.cjs +51 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.cts +44 -0
- package/dist/index.d.ts +44 -0
- package/dist/index.js +51 -0
- package/dist/index.js.map +1 -0
- package/dist/package.json +26 -0
- package/package.json +26 -0
package/dist/index.d.cts
ADDED
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import z$1, { z, ZodObject } from 'zod';
|
|
2
|
+
|
|
3
|
+
declare const ToolResultContentBlockSchema: z.ZodObject<{
|
|
4
|
+
type: z.ZodLiteral<"tool_result">;
|
|
5
|
+
toolUseId: z.ZodString;
|
|
6
|
+
content: z.ZodString;
|
|
7
|
+
}, z.core.$strip>;
|
|
8
|
+
|
|
9
|
+
type ToolResultContentBlock = z$1.infer<typeof ToolResultContentBlockSchema>;
|
|
10
|
+
|
|
11
|
+
type Mode = 'push' | 'overlay';
|
|
12
|
+
interface ToolConfig {
|
|
13
|
+
name: string;
|
|
14
|
+
description: string;
|
|
15
|
+
inputSchema?: ZodObject | Record<string, unknown>;
|
|
16
|
+
cb?: (input: Record<string, unknown>) => Promise<string>;
|
|
17
|
+
}
|
|
18
|
+
interface InitOptions {
|
|
19
|
+
appId: string;
|
|
20
|
+
baseUrl?: string;
|
|
21
|
+
mode?: Mode;
|
|
22
|
+
containerId?: string;
|
|
23
|
+
user?: {
|
|
24
|
+
id?: string;
|
|
25
|
+
email?: string;
|
|
26
|
+
name?: string;
|
|
27
|
+
};
|
|
28
|
+
tools?: ToolConfig[];
|
|
29
|
+
}
|
|
30
|
+
interface PluckyAPI {
|
|
31
|
+
init(opts: InitOptions): PluckyAPI;
|
|
32
|
+
setMode(mode: Mode): void;
|
|
33
|
+
switchMode(mode: 'push' | 'overlay'): void;
|
|
34
|
+
open(): void;
|
|
35
|
+
close(): void;
|
|
36
|
+
on<T = any>(event: string, cb: (payload: T) => void): () => void;
|
|
37
|
+
isReady(): boolean;
|
|
38
|
+
sendMessage(content: string | Array<ToolResultContentBlock>): void;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
declare function init(opts: InitOptions): PluckyAPI;
|
|
42
|
+
declare function getAPI(): PluckyAPI;
|
|
43
|
+
|
|
44
|
+
export { type InitOptions, type PluckyAPI, getAPI, init };
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import z$1, { z, ZodObject } from 'zod';
|
|
2
|
+
|
|
3
|
+
declare const ToolResultContentBlockSchema: z.ZodObject<{
|
|
4
|
+
type: z.ZodLiteral<"tool_result">;
|
|
5
|
+
toolUseId: z.ZodString;
|
|
6
|
+
content: z.ZodString;
|
|
7
|
+
}, z.core.$strip>;
|
|
8
|
+
|
|
9
|
+
type ToolResultContentBlock = z$1.infer<typeof ToolResultContentBlockSchema>;
|
|
10
|
+
|
|
11
|
+
type Mode = 'push' | 'overlay';
|
|
12
|
+
interface ToolConfig {
|
|
13
|
+
name: string;
|
|
14
|
+
description: string;
|
|
15
|
+
inputSchema?: ZodObject | Record<string, unknown>;
|
|
16
|
+
cb?: (input: Record<string, unknown>) => Promise<string>;
|
|
17
|
+
}
|
|
18
|
+
interface InitOptions {
|
|
19
|
+
appId: string;
|
|
20
|
+
baseUrl?: string;
|
|
21
|
+
mode?: Mode;
|
|
22
|
+
containerId?: string;
|
|
23
|
+
user?: {
|
|
24
|
+
id?: string;
|
|
25
|
+
email?: string;
|
|
26
|
+
name?: string;
|
|
27
|
+
};
|
|
28
|
+
tools?: ToolConfig[];
|
|
29
|
+
}
|
|
30
|
+
interface PluckyAPI {
|
|
31
|
+
init(opts: InitOptions): PluckyAPI;
|
|
32
|
+
setMode(mode: Mode): void;
|
|
33
|
+
switchMode(mode: 'push' | 'overlay'): void;
|
|
34
|
+
open(): void;
|
|
35
|
+
close(): void;
|
|
36
|
+
on<T = any>(event: string, cb: (payload: T) => void): () => void;
|
|
37
|
+
isReady(): boolean;
|
|
38
|
+
sendMessage(content: string | Array<ToolResultContentBlock>): void;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
declare function init(opts: InitOptions): PluckyAPI;
|
|
42
|
+
declare function getAPI(): PluckyAPI;
|
|
43
|
+
|
|
44
|
+
export { type InitOptions, type PluckyAPI, getAPI, init };
|