@copilotkit/react-core 0.0.0-feat-use-frontend-component-20260218215423 → 0.0.0-feat-use-frontend-component-20260219223758
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 +25 -5
- package/dist/index.cjs +3 -2
- package/dist/index.cjs.map +1 -1
- package/dist/index.mjs +3 -2
- package/dist/index.mjs.map +1 -1
- package/dist/index.umd.js +3 -2
- package/dist/index.umd.js.map +1 -1
- package/dist/v2/index.css +3 -3
- package/package.json +10 -8
- package/src/hooks/__tests__/use-frontend-tool-available.test.tsx +72 -0
- package/src/hooks/use-frontend-tool.ts +2 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,16 +1,36 @@
|
|
|
1
1
|
# ui
|
|
2
2
|
|
|
3
|
-
## 0.0.0-feat-use-frontend-component-
|
|
3
|
+
## 0.0.0-feat-use-frontend-component-20260219223758
|
|
4
4
|
|
|
5
5
|
### Patch Changes
|
|
6
6
|
|
|
7
7
|
- ef0f539: Add reasoning support and default components for reasoning messages
|
|
8
|
+
- 412965a: Introducing available prop to useFrontendTool()
|
|
8
9
|
- Updated dependencies [ea7c2f7]
|
|
9
10
|
- Updated dependencies [ef0f539]
|
|
10
|
-
- @copilotkitnext/react@0.0.0-feat-use-frontend-component-
|
|
11
|
-
- @copilotkit/shared@0.0.0-feat-use-frontend-component-
|
|
12
|
-
- @copilotkitnext/core@0.0.0-feat-use-frontend-component-
|
|
13
|
-
- @copilotkit/runtime-client-gql@0.0.0-feat-use-frontend-component-
|
|
11
|
+
- @copilotkitnext/react@0.0.0-feat-use-frontend-component-20260219223758
|
|
12
|
+
- @copilotkit/shared@0.0.0-feat-use-frontend-component-20260219223758
|
|
13
|
+
- @copilotkitnext/core@0.0.0-feat-use-frontend-component-20260219223758
|
|
14
|
+
- @copilotkit/runtime-client-gql@0.0.0-feat-use-frontend-component-20260219223758
|
|
15
|
+
|
|
16
|
+
## 1.51.5-next.2
|
|
17
|
+
|
|
18
|
+
### Patch Changes
|
|
19
|
+
|
|
20
|
+
- @copilotkit/runtime-client-gql@1.51.5-next.2
|
|
21
|
+
- @copilotkit/shared@1.51.5-next.2
|
|
22
|
+
- @copilotkitnext/core@1.51.5-next.2
|
|
23
|
+
- @copilotkitnext/react@1.51.5-next.2
|
|
24
|
+
|
|
25
|
+
## 1.51.5-next.1
|
|
26
|
+
|
|
27
|
+
### Patch Changes
|
|
28
|
+
|
|
29
|
+
- 412965a: Introducing available prop to useFrontendTool()
|
|
30
|
+
- @copilotkit/runtime-client-gql@1.51.5-next.1
|
|
31
|
+
- @copilotkit/shared@1.51.5-next.1
|
|
32
|
+
- @copilotkitnext/core@1.51.5-next.1
|
|
33
|
+
- @copilotkitnext/react@1.51.5-next.1
|
|
14
34
|
|
|
15
35
|
## 1.51.5-next.0
|
|
16
36
|
|
package/dist/index.cjs
CHANGED
|
@@ -2750,7 +2750,7 @@ function useCopilotChatHeadless_c(options = {}) {
|
|
|
2750
2750
|
//#endregion
|
|
2751
2751
|
//#region src/hooks/use-frontend-tool.ts
|
|
2752
2752
|
function useFrontendTool(tool, dependencies) {
|
|
2753
|
-
const { name, description, parameters, render, followUp } = tool;
|
|
2753
|
+
const { name, description, parameters, render, followUp, available } = tool;
|
|
2754
2754
|
const zodParameters = (0, _copilotkit_shared.getZodParameters)(parameters);
|
|
2755
2755
|
const renderRef = (0, react.useRef)(render);
|
|
2756
2756
|
(0, react.useEffect)(() => {
|
|
@@ -2780,7 +2780,8 @@ function useFrontendTool(tool, dependencies) {
|
|
|
2780
2780
|
parameters: zodParameters,
|
|
2781
2781
|
handler: tool.handler ? (args) => handlerRef.current?.(args) : void 0,
|
|
2782
2782
|
followUp,
|
|
2783
|
-
render: normalizedRender
|
|
2783
|
+
render: normalizedRender,
|
|
2784
|
+
available: available === void 0 ? void 0 : available !== "disabled"
|
|
2784
2785
|
});
|
|
2785
2786
|
}
|
|
2786
2787
|
|