@plucky-ai/react 0.4.0 → 0.6.0
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 +7 -0
- package/dist/index.d.cts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/package.json +1 -1
- package/package.json +5 -5
package/README.md
CHANGED
|
@@ -29,7 +29,14 @@ function MyComponent(props: { temperature: number }) {
|
|
|
29
29
|
defaultLoadingText: 'Checking the weather...',
|
|
30
30
|
defaultSuccessText: 'Weather retrieved.',
|
|
31
31
|
cb: async (_, { temperature }) => {
|
|
32
|
+
// Return a string:
|
|
32
33
|
return `It's currently ${temperature} degrees.`
|
|
34
|
+
|
|
35
|
+
// Or return an object with custom success text:
|
|
36
|
+
// return {
|
|
37
|
+
// content: `It's currently ${temperature} degrees.`,
|
|
38
|
+
// successText: `Weather: ${temperature}°`,
|
|
39
|
+
// }
|
|
33
40
|
},
|
|
34
41
|
},
|
|
35
42
|
],
|
package/dist/index.d.cts
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { ToolConfig } from "@plucky-ai/chat-sdk";
|
|
2
|
-
import { PluckySettingsParams } from "@plucky-ai/loader-types";
|
|
2
|
+
import { PluckySettingsParams, ToolCallbackResult } from "@plucky-ai/loader-types";
|
|
3
3
|
|
|
4
4
|
//#region src/types.d.ts
|
|
5
5
|
type UseChatParams = PluckySettingsParams;
|
|
6
6
|
type UseToolsParams<TContext = Record<string, unknown>> = {
|
|
7
7
|
context?: TContext;
|
|
8
8
|
tools: Array<Omit<ToolConfig, 'cb'> & {
|
|
9
|
-
cb: (input: Record<string, unknown>, context: TContext) => Promise<
|
|
9
|
+
cb: (input: Record<string, unknown>, context: TContext) => Promise<ToolCallbackResult> | ToolCallbackResult;
|
|
10
10
|
}>;
|
|
11
11
|
};
|
|
12
12
|
//#endregion
|
package/dist/index.d.ts
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { ToolConfig } from "@plucky-ai/chat-sdk";
|
|
2
|
-
import { PluckySettingsParams } from "@plucky-ai/loader-types";
|
|
2
|
+
import { PluckySettingsParams, ToolCallbackResult } from "@plucky-ai/loader-types";
|
|
3
3
|
|
|
4
4
|
//#region src/types.d.ts
|
|
5
5
|
type UseChatParams = PluckySettingsParams;
|
|
6
6
|
type UseToolsParams<TContext = Record<string, unknown>> = {
|
|
7
7
|
context?: TContext;
|
|
8
8
|
tools: Array<Omit<ToolConfig, 'cb'> & {
|
|
9
|
-
cb: (input: Record<string, unknown>, context: TContext) => Promise<
|
|
9
|
+
cb: (input: Record<string, unknown>, context: TContext) => Promise<ToolCallbackResult> | ToolCallbackResult;
|
|
10
10
|
}>;
|
|
11
11
|
};
|
|
12
12
|
//#endregion
|
package/dist/package.json
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@plucky-ai/react",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.6.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"main": "./dist/index.cjs",
|
|
6
6
|
"module": "./dist/index.js",
|
|
@@ -13,16 +13,16 @@
|
|
|
13
13
|
}
|
|
14
14
|
},
|
|
15
15
|
"dependencies": {
|
|
16
|
-
"react": "19.2.
|
|
16
|
+
"react": "^19.2.3",
|
|
17
17
|
"zod": "^4.1.11",
|
|
18
|
-
"@plucky-ai/chat-sdk": "^0.
|
|
18
|
+
"@plucky-ai/chat-sdk": "^0.6.0"
|
|
19
19
|
},
|
|
20
20
|
"devDependencies": {
|
|
21
21
|
"@types/react": "19.1.13",
|
|
22
22
|
"tsdown": "^0.15.12",
|
|
23
|
-
"tsx": "^4.
|
|
23
|
+
"tsx": "^4.21.0",
|
|
24
24
|
"typescript": "^5.9.3",
|
|
25
|
-
"@plucky-ai/loader-types": "^0.
|
|
25
|
+
"@plucky-ai/loader-types": "^0.4.0"
|
|
26
26
|
},
|
|
27
27
|
"publishConfig": {
|
|
28
28
|
"access": "public",
|