@copilotkit/react-core 1.10.6-next.1 → 1.10.6-next.2
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/CHANGELOG.md +8 -0
- package/dist/{chunk-YH6JKJML.mjs → chunk-6GPVUMBU.mjs} +1 -1
- package/dist/chunk-6GPVUMBU.mjs.map +1 -0
- package/dist/{chunk-CV2PDTC7.mjs → chunk-AKR2SSUJ.mjs} +2 -2
- package/dist/chunk-AKR2SSUJ.mjs.map +1 -0
- package/dist/{chunk-33OKWHPL.mjs → chunk-EVVO67QO.mjs} +2 -2
- package/dist/chunk-EVVO67QO.mjs.map +1 -0
- package/dist/hooks/index.js +2 -2
- package/dist/hooks/index.js.map +1 -1
- package/dist/hooks/index.mjs +3 -3
- package/dist/hooks/use-frontend-tool.d.ts +4 -1
- package/dist/hooks/use-frontend-tool.js.map +1 -1
- package/dist/hooks/use-frontend-tool.mjs +1 -1
- package/dist/hooks/use-human-in-the-loop.d.ts +4 -2
- package/dist/hooks/use-human-in-the-loop.js +1 -1
- package/dist/hooks/use-human-in-the-loop.js.map +1 -1
- package/dist/hooks/use-human-in-the-loop.mjs +1 -1
- package/dist/hooks/use-render-tool-call.d.ts +4 -1
- package/dist/hooks/use-render-tool-call.js +1 -1
- package/dist/hooks/use-render-tool-call.js.map +1 -1
- package/dist/hooks/use-render-tool-call.mjs +1 -1
- package/dist/index.js +2 -2
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +3 -3
- package/package.json +3 -3
- package/src/hooks/use-frontend-tool.ts +8 -4
- package/src/hooks/use-human-in-the-loop.ts +7 -4
- package/src/hooks/use-render-tool-call.ts +7 -3
- package/dist/chunk-33OKWHPL.mjs.map +0 -1
- package/dist/chunk-CV2PDTC7.mjs.map +0 -1
- package/dist/chunk-YH6JKJML.mjs.map +0 -1
package/dist/index.mjs
CHANGED
|
@@ -14,7 +14,7 @@ import {
|
|
|
14
14
|
} from "./chunk-BBUQMG45.mjs";
|
|
15
15
|
import {
|
|
16
16
|
useRenderToolCall
|
|
17
|
-
} from "./chunk-
|
|
17
|
+
} from "./chunk-AKR2SSUJ.mjs";
|
|
18
18
|
import {
|
|
19
19
|
useCopilotReadable
|
|
20
20
|
} from "./chunk-HDOG2RTM.mjs";
|
|
@@ -23,10 +23,10 @@ import {
|
|
|
23
23
|
} from "./chunk-MQYWH4E6.mjs";
|
|
24
24
|
import {
|
|
25
25
|
useFrontendTool
|
|
26
|
-
} from "./chunk-
|
|
26
|
+
} from "./chunk-6GPVUMBU.mjs";
|
|
27
27
|
import {
|
|
28
28
|
useHumanInTheLoop
|
|
29
|
-
} from "./chunk-
|
|
29
|
+
} from "./chunk-EVVO67QO.mjs";
|
|
30
30
|
import {
|
|
31
31
|
useCoAgentStateRender
|
|
32
32
|
} from "./chunk-GT5WI3AF.mjs";
|
package/package.json
CHANGED
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
"publishConfig": {
|
|
10
10
|
"access": "public"
|
|
11
11
|
},
|
|
12
|
-
"version": "1.10.6-next.
|
|
12
|
+
"version": "1.10.6-next.2",
|
|
13
13
|
"sideEffects": false,
|
|
14
14
|
"main": "./dist/index.js",
|
|
15
15
|
"module": "./dist/index.mjs",
|
|
@@ -47,8 +47,8 @@
|
|
|
47
47
|
"@scarf/scarf": "^1.3.0",
|
|
48
48
|
"react-markdown": "^8.0.7",
|
|
49
49
|
"untruncate-json": "^0.0.1",
|
|
50
|
-
"@copilotkit/runtime-client-gql": "1.10.6-next.
|
|
51
|
-
"@copilotkit/shared": "1.10.6-next.
|
|
50
|
+
"@copilotkit/runtime-client-gql": "1.10.6-next.2",
|
|
51
|
+
"@copilotkit/shared": "1.10.6-next.2"
|
|
52
52
|
},
|
|
53
53
|
"keywords": [
|
|
54
54
|
"copilotkit",
|
|
@@ -2,11 +2,15 @@ import { useCopilotAction } from "./use-copilot-action";
|
|
|
2
2
|
import { FrontendAction } from "../types/frontend-action";
|
|
3
3
|
import { Parameter } from "@copilotkit/shared";
|
|
4
4
|
|
|
5
|
+
type UseToolCallArgs<T extends Parameter[] | [] = []> = {
|
|
6
|
+
available?: "disabled" | "enabled";
|
|
7
|
+
} & Pick<
|
|
8
|
+
FrontendAction<T>,
|
|
9
|
+
"name" | "description" | "parameters" | "handler" | "followUp" | "render"
|
|
10
|
+
>;
|
|
11
|
+
|
|
5
12
|
export function useFrontendTool<const T extends Parameter[] | [] = []>(
|
|
6
|
-
tool:
|
|
7
|
-
FrontendAction<T>,
|
|
8
|
-
"name" | "description" | "parameters" | "handler" | "followUp" | "render"
|
|
9
|
-
>,
|
|
13
|
+
tool: UseToolCallArgs<T>,
|
|
10
14
|
dependencies?: any[],
|
|
11
15
|
) {
|
|
12
16
|
// Use the existing useCopilotAction hook
|
|
@@ -2,10 +2,13 @@ import { useCopilotAction } from "./use-copilot-action";
|
|
|
2
2
|
import { FrontendAction } from "../types";
|
|
3
3
|
import { Parameter } from "@copilotkit/shared";
|
|
4
4
|
|
|
5
|
+
type UseToolCallArgs<T extends Parameter[] | [] = []> = {
|
|
6
|
+
available?: "disabled" | "enabled";
|
|
7
|
+
render: FrontendAction<T>["renderAndWaitForResponse"];
|
|
8
|
+
} & Pick<FrontendAction<T>, "name" | "description" | "parameters">;
|
|
9
|
+
|
|
5
10
|
export function useHumanInTheLoop<const T extends Parameter[] | [] = []>(
|
|
6
|
-
tool:
|
|
7
|
-
render: FrontendAction<T>["renderAndWaitForResponse"];
|
|
8
|
-
},
|
|
11
|
+
tool: UseToolCallArgs<T>,
|
|
9
12
|
dependencies?: any[],
|
|
10
13
|
) {
|
|
11
14
|
const { render, ...toolRest } = tool;
|
|
@@ -13,7 +16,7 @@ export function useHumanInTheLoop<const T extends Parameter[] | [] = []>(
|
|
|
13
16
|
useCopilotAction(
|
|
14
17
|
{
|
|
15
18
|
...toolRest,
|
|
16
|
-
available: "remote",
|
|
19
|
+
available: tool.available === "disabled" ? tool.available : "remote",
|
|
17
20
|
renderAndWaitForResponse: render,
|
|
18
21
|
},
|
|
19
22
|
dependencies,
|
|
@@ -1,15 +1,19 @@
|
|
|
1
1
|
import { useCopilotAction } from "./use-copilot-action";
|
|
2
|
-
import { FrontendAction } from "../types";
|
|
2
|
+
import { FrontendAction, FrontendActionAvailability } from "../types";
|
|
3
3
|
import { Parameter } from "@copilotkit/shared";
|
|
4
4
|
|
|
5
|
+
type UseToolCallArgs<T extends Parameter[] | [] = []> = {
|
|
6
|
+
available?: "disabled" | "enabled";
|
|
7
|
+
} & Pick<FrontendAction<T>, "name" | "description" | "parameters" | "render">;
|
|
8
|
+
|
|
5
9
|
export function useRenderToolCall<const T extends Parameter[] | [] = []>(
|
|
6
|
-
tool:
|
|
10
|
+
tool: UseToolCallArgs<T>,
|
|
7
11
|
dependencies?: any[],
|
|
8
12
|
) {
|
|
9
13
|
useCopilotAction<T>(
|
|
10
14
|
{
|
|
11
15
|
...tool,
|
|
12
|
-
available: "frontend",
|
|
16
|
+
available: tool.available === "disabled" ? tool.available : "frontend",
|
|
13
17
|
},
|
|
14
18
|
dependencies,
|
|
15
19
|
);
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/hooks/use-human-in-the-loop.ts"],"sourcesContent":["import { useCopilotAction } from \"./use-copilot-action\";\nimport { FrontendAction } from \"../types\";\nimport { Parameter } from \"@copilotkit/shared\";\n\nexport function useHumanInTheLoop<const T extends Parameter[] | [] = []>(\n tool: Pick<FrontendAction<T>, \"name\" | \"description\" | \"parameters\"> & {\n render: FrontendAction<T>[\"renderAndWaitForResponse\"];\n },\n dependencies?: any[],\n) {\n const { render, ...toolRest } = tool;\n\n useCopilotAction(\n {\n ...toolRest,\n available: \"remote\",\n renderAndWaitForResponse: render,\n },\n dependencies,\n );\n}\n"],"mappings":";;;;;;;;;;AAIO,SAAS,kBACd,MAGA,cACA;AACA,QAAgC,WAAxB,SAVV,IAUkC,IAAb,qBAAa,IAAb,CAAX;AAER;AAAA,IACE,iCACK,WADL;AAAA,MAEE,WAAW;AAAA,MACX,0BAA0B;AAAA,IAC5B;AAAA,IACA;AAAA,EACF;AACF;","names":[]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/hooks/use-render-tool-call.ts"],"sourcesContent":["import { useCopilotAction } from \"./use-copilot-action\";\nimport { FrontendAction } from \"../types\";\nimport { Parameter } from \"@copilotkit/shared\";\n\nexport function useRenderToolCall<const T extends Parameter[] | [] = []>(\n tool: Pick<FrontendAction<T>, \"name\" | \"description\" | \"parameters\" | \"render\">,\n dependencies?: any[],\n) {\n useCopilotAction<T>(\n {\n ...tool,\n available: \"frontend\",\n },\n dependencies,\n );\n}\n"],"mappings":";;;;;;;;;AAIO,SAAS,kBACd,MACA,cACA;AACA;AAAA,IACE,iCACK,OADL;AAAA,MAEE,WAAW;AAAA,IACb;AAAA,IACA;AAAA,EACF;AACF;","names":[]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/hooks/use-frontend-tool.ts"],"sourcesContent":["import { useCopilotAction } from \"./use-copilot-action\";\nimport { FrontendAction } from \"../types/frontend-action\";\nimport { Parameter } from \"@copilotkit/shared\";\n\nexport function useFrontendTool<const T extends Parameter[] | [] = []>(\n tool: Pick<\n FrontendAction<T>,\n \"name\" | \"description\" | \"parameters\" | \"handler\" | \"followUp\" | \"render\"\n >,\n dependencies?: any[],\n) {\n // Use the existing useCopilotAction hook\n useCopilotAction<T>(tool, dependencies);\n}\n"],"mappings":";;;;;AAIO,SAAS,gBACd,MAIA,cACA;AAEA,mBAAoB,MAAM,YAAY;AACxC;","names":[]}
|