@copilotkitnext/react 1.53.1-next.2 → 1.54.0-next.4
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/hooks/use-component.cjs +4 -4
- package/dist/hooks/use-component.cjs.map +1 -1
- package/dist/hooks/use-component.d.cts +7 -7
- package/dist/hooks/use-component.d.cts.map +1 -1
- package/dist/hooks/use-component.d.mts +7 -7
- package/dist/hooks/use-component.d.mts.map +1 -1
- package/dist/hooks/use-component.mjs +4 -4
- package/dist/hooks/use-component.mjs.map +1 -1
- package/dist/hooks/use-frontend-tool.cjs +6 -14
- package/dist/hooks/use-frontend-tool.cjs.map +1 -1
- package/dist/hooks/use-frontend-tool.d.cts.map +1 -1
- package/dist/hooks/use-frontend-tool.d.mts.map +1 -1
- package/dist/hooks/use-frontend-tool.mjs +6 -14
- package/dist/hooks/use-frontend-tool.mjs.map +1 -1
- package/dist/hooks/use-human-in-the-loop.cjs +1 -6
- package/dist/hooks/use-human-in-the-loop.cjs.map +1 -1
- package/dist/hooks/use-human-in-the-loop.mjs +1 -6
- package/dist/hooks/use-human-in-the-loop.mjs.map +1 -1
- package/dist/hooks/use-render-tool.cjs +2 -7
- package/dist/hooks/use-render-tool.cjs.map +1 -1
- package/dist/hooks/use-render-tool.d.cts +13 -12
- package/dist/hooks/use-render-tool.d.cts.map +1 -1
- package/dist/hooks/use-render-tool.d.mts +13 -12
- package/dist/hooks/use-render-tool.d.mts.map +1 -1
- package/dist/hooks/use-render-tool.mjs +2 -7
- package/dist/hooks/use-render-tool.mjs.map +1 -1
- package/dist/hooks/useKatexStyles.cjs.map +1 -1
- package/dist/hooks/useKatexStyles.mjs.map +1 -1
- package/dist/index.umd.js +43 -41
- package/dist/index.umd.js.map +1 -1
- package/dist/lib/react-core.cjs +26 -1
- package/dist/lib/react-core.cjs.map +1 -1
- package/dist/lib/react-core.d.cts +5 -0
- package/dist/lib/react-core.d.cts.map +1 -1
- package/dist/lib/react-core.d.mts +5 -0
- package/dist/lib/react-core.d.mts.map +1 -1
- package/dist/lib/react-core.mjs +26 -1
- package/dist/lib/react-core.mjs.map +1 -1
- package/dist/types/defineToolCallRenderer.cjs.map +1 -1
- package/dist/types/defineToolCallRenderer.d.cts +5 -5
- package/dist/types/defineToolCallRenderer.d.cts.map +1 -1
- package/dist/types/defineToolCallRenderer.d.mts +5 -5
- package/dist/types/defineToolCallRenderer.d.mts.map +1 -1
- package/dist/types/defineToolCallRenderer.mjs.map +1 -1
- package/dist/types/react-activity-message-renderer.d.cts +2 -2
- package/dist/types/react-activity-message-renderer.d.cts.map +1 -1
- package/dist/types/react-activity-message-renderer.d.mts +2 -2
- package/dist/types/react-activity-message-renderer.d.mts.map +1 -1
- package/dist/types/react-tool-call-renderer.d.cts +2 -2
- package/dist/types/react-tool-call-renderer.d.cts.map +1 -1
- package/dist/types/react-tool-call-renderer.d.mts +2 -2
- package/dist/types/react-tool-call-renderer.d.mts.map +1 -1
- package/package.json +10 -7
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"use-render-tool.mjs","names":[],"sources":["../../src/hooks/use-render-tool.tsx"],"sourcesContent":["import { useEffect } from \"react\";\nimport type {
|
|
1
|
+
{"version":3,"file":"use-render-tool.mjs","names":[],"sources":["../../src/hooks/use-render-tool.tsx"],"sourcesContent":["import { useEffect } from \"react\";\nimport type {\n StandardSchemaV1,\n InferSchemaOutput,\n} from \"@copilotkitnext/shared\";\nimport { useCopilotKit } from \"../providers/CopilotKitProvider\";\nimport { defineToolCallRenderer } from \"../types/defineToolCallRenderer\";\n\nconst EMPTY_DEPS: ReadonlyArray<unknown> = [];\n\nexport interface RenderToolInProgressProps<S extends StandardSchemaV1> {\n name: string;\n parameters: Partial<InferSchemaOutput<S>>;\n status: \"inProgress\";\n result: undefined;\n}\n\nexport interface RenderToolExecutingProps<S extends StandardSchemaV1> {\n name: string;\n parameters: InferSchemaOutput<S>;\n status: \"executing\";\n result: undefined;\n}\n\nexport interface RenderToolCompleteProps<S extends StandardSchemaV1> {\n name: string;\n parameters: InferSchemaOutput<S>;\n status: \"complete\";\n result: string;\n}\n\nexport type RenderToolProps<S extends StandardSchemaV1> =\n | RenderToolInProgressProps<S>\n | RenderToolExecutingProps<S>\n | RenderToolCompleteProps<S>;\n\ntype RenderToolConfig<S extends StandardSchemaV1> = {\n name: string;\n parameters?: S;\n render: (props: RenderToolProps<S>) => React.ReactElement;\n agentId?: string;\n};\n\n/**\n * Registers a wildcard (`\"*\"`) renderer for tool calls.\n *\n * The wildcard renderer is used as a fallback when no exact name-matched\n * renderer is registered for a tool call.\n *\n * @param config - Wildcard renderer configuration.\n * @param deps - Optional dependencies to refresh registration.\n *\n * @example\n * ```tsx\n * useRenderTool(\n * {\n * name: \"*\",\n * render: ({ name, status }) => (\n * <div>\n * {status === \"complete\" ? \"✓\" : \"⏳\"} {name}\n * </div>\n * ),\n * },\n * [],\n * );\n * ```\n */\nexport function useRenderTool(\n config: {\n name: \"*\";\n render: (props: any) => React.ReactElement;\n agentId?: string;\n },\n deps?: ReadonlyArray<unknown>,\n): void;\n\n/**\n * Registers a name-scoped renderer for tool calls.\n *\n * The provided `parameters` schema defines the typed shape of `props.parameters`\n * in `render` for `executing` and `complete` states. Accepts any Standard Schema V1\n * compatible library (Zod, Valibot, ArkType, etc.).\n *\n * @typeParam S - Schema type describing tool call parameters.\n * @param config - Named renderer configuration.\n * @param deps - Optional dependencies to refresh registration.\n *\n * @example\n * ```tsx\n * useRenderTool(\n * {\n * name: \"searchDocs\",\n * parameters: z.object({ query: z.string() }),\n * render: ({ status, parameters, result }) => {\n * if (status === \"inProgress\") return <div>Preparing...</div>;\n * if (status === \"executing\") return <div>Searching {parameters.query}</div>;\n * return <div>{result}</div>;\n * },\n * },\n * [],\n * );\n * ```\n */\nexport function useRenderTool<S extends StandardSchemaV1>(\n config: {\n name: string;\n parameters: S;\n render: (props: RenderToolProps<S>) => React.ReactElement;\n agentId?: string;\n },\n deps?: ReadonlyArray<unknown>,\n): void;\n\n/**\n * Registers a renderer entry in CopilotKit's `renderToolCalls` registry.\n *\n * Key behavior:\n * - deduplicates by `agentId:name` (latest registration wins),\n * - keeps renderer entries on cleanup so historical chat tool calls can still render,\n * - refreshes registration when `deps` change.\n *\n * @typeParam S - Schema type describing tool call parameters.\n * @param config - Renderer config for wildcard or named tools.\n * @param deps - Optional dependencies to refresh registration.\n *\n * @example\n * ```tsx\n * useRenderTool(\n * {\n * name: \"searchDocs\",\n * parameters: z.object({ query: z.string() }),\n * render: ({ status, parameters, result }) => {\n * if (status === \"executing\") return <div>Searching {parameters.query}</div>;\n * if (status === \"complete\") return <div>{result}</div>;\n * return <div>Preparing...</div>;\n * },\n * },\n * [],\n * );\n * ```\n *\n * @example\n * ```tsx\n * useRenderTool(\n * {\n * name: \"summarize\",\n * parameters: z.object({ text: z.string() }),\n * agentId: \"research-agent\",\n * render: ({ name, status }) => <div>{name}: {status}</div>,\n * },\n * [selectedAgentId],\n * );\n * ```\n */\nexport function useRenderTool<S extends StandardSchemaV1>(\n config: RenderToolConfig<S>,\n deps?: ReadonlyArray<unknown>,\n): void {\n const { copilotkit } = useCopilotKit();\n const extraDeps = deps ?? EMPTY_DEPS;\n\n useEffect(() => {\n // Build the ReactToolCallRenderer via defineToolCallRenderer\n const renderer =\n config.name === \"*\" && !config.parameters\n ? defineToolCallRenderer({\n name: \"*\",\n render: (props) =>\n config.render({ ...props, parameters: props.args }),\n ...(config.agentId ? { agentId: config.agentId } : {}),\n })\n : defineToolCallRenderer({\n name: config.name,\n args: config.parameters!,\n render: (props) =>\n config.render({ ...props, parameters: props.args }),\n ...(config.agentId ? { agentId: config.agentId } : {}),\n });\n\n copilotkit.addHookRenderToolCall(renderer);\n\n // No cleanup removal — keeps renderer for chat history, same as useFrontendTool\n }, [config.name, copilotkit, extraDeps.length, ...extraDeps]);\n}\n"],"mappings":";;;;;AAQA,MAAM,aAAqC,EAAE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAkJ7C,SAAgB,cACd,QACA,MACM;CACN,MAAM,EAAE,eAAe,eAAe;CACtC,MAAM,YAAY,QAAQ;AAE1B,iBAAgB;EAEd,MAAM,WACJ,OAAO,SAAS,OAAO,CAAC,OAAO,aAC3B,uBAAuB;GACrB,MAAM;GACN,SAAS,UACP,OAAO,OAAO;IAAE,GAAG;IAAO,YAAY,MAAM;IAAM,CAAC;GACrD,GAAI,OAAO,UAAU,EAAE,SAAS,OAAO,SAAS,GAAG,EAAE;GACtD,CAAC,GACF,uBAAuB;GACrB,MAAM,OAAO;GACb,MAAM,OAAO;GACb,SAAS,UACP,OAAO,OAAO;IAAE,GAAG;IAAO,YAAY,MAAM;IAAM,CAAC;GACrD,GAAI,OAAO,UAAU,EAAE,SAAS,OAAO,SAAS,GAAG,EAAE;GACtD,CAAC;AAER,aAAW,sBAAsB,SAAS;IAGzC;EAAC,OAAO;EAAM;EAAY,UAAU;EAAQ,GAAG;EAAU,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useKatexStyles.cjs","names":[],"sources":["../../src/hooks/useKatexStyles.ts"],"sourcesContent":["\"use client\";\n\nimport { useEffect } from \"react\";\n\nlet injected = false;\n\n/**\n * Dynamically injects KaTeX CSS at runtime to avoid the Next.js\n * \"Global CSS cannot be imported from within node_modules\" build error.\n *\n * Uses a singleton flag so the stylesheet is only injected once.\n */\nexport function useKatexStyles(): void {\n useEffect(() => {\n if (injected || typeof document === \"undefined\") return;\n injected = true;\n\n // Dynamic import defers CSS loading to runtime, bypassing\n // Next.js static analysis that rejects global CSS from node_modules.\n
|
|
1
|
+
{"version":3,"file":"useKatexStyles.cjs","names":[],"sources":["../../src/hooks/useKatexStyles.ts"],"sourcesContent":["\"use client\";\n\nimport { useEffect } from \"react\";\n\nlet injected = false;\n\n/**\n * Dynamically injects KaTeX CSS at runtime to avoid the Next.js\n * \"Global CSS cannot be imported from within node_modules\" build error.\n *\n * Uses a singleton flag so the stylesheet is only injected once.\n */\nexport function useKatexStyles(): void {\n useEffect(() => {\n if (injected || typeof document === \"undefined\") return;\n injected = true;\n\n // Dynamic import defers CSS loading to runtime, bypassing\n // Next.js static analysis that rejects global CSS from node_modules.\n\n void import(\"katex/dist/katex.min.css\").catch(() => {\n // Silently ignore — consumers can import KaTeX CSS manually\n });\n }, []);\n}\n"],"mappings":";;;;;;AAIA,IAAI,WAAW;;;;;;;AAQf,SAAgB,iBAAuB;AACrC,4BAAgB;AACd,MAAI,YAAY,OAAO,aAAa,YAAa;AACjD,aAAW;AAKX,EAAK,OAAO,4BAA4B,YAAY,GAElD;IACD,EAAE,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useKatexStyles.mjs","names":[],"sources":["../../src/hooks/useKatexStyles.ts"],"sourcesContent":["\"use client\";\n\nimport { useEffect } from \"react\";\n\nlet injected = false;\n\n/**\n * Dynamically injects KaTeX CSS at runtime to avoid the Next.js\n * \"Global CSS cannot be imported from within node_modules\" build error.\n *\n * Uses a singleton flag so the stylesheet is only injected once.\n */\nexport function useKatexStyles(): void {\n useEffect(() => {\n if (injected || typeof document === \"undefined\") return;\n injected = true;\n\n // Dynamic import defers CSS loading to runtime, bypassing\n // Next.js static analysis that rejects global CSS from node_modules.\n
|
|
1
|
+
{"version":3,"file":"useKatexStyles.mjs","names":[],"sources":["../../src/hooks/useKatexStyles.ts"],"sourcesContent":["\"use client\";\n\nimport { useEffect } from \"react\";\n\nlet injected = false;\n\n/**\n * Dynamically injects KaTeX CSS at runtime to avoid the Next.js\n * \"Global CSS cannot be imported from within node_modules\" build error.\n *\n * Uses a singleton flag so the stylesheet is only injected once.\n */\nexport function useKatexStyles(): void {\n useEffect(() => {\n if (injected || typeof document === \"undefined\") return;\n injected = true;\n\n // Dynamic import defers CSS loading to runtime, bypassing\n // Next.js static analysis that rejects global CSS from node_modules.\n\n void import(\"katex/dist/katex.min.css\").catch(() => {\n // Silently ignore — consumers can import KaTeX CSS manually\n });\n }, []);\n}\n"],"mappings":";;;;;AAIA,IAAI,WAAW;;;;;;;AAQf,SAAgB,iBAAuB;AACrC,iBAAgB;AACd,MAAI,YAAY,OAAO,aAAa,YAAa;AACjD,aAAW;AAKX,EAAK,OAAO,4BAA4B,YAAY,GAElD;IACD,EAAE,CAAC"}
|
package/dist/index.umd.js
CHANGED
|
@@ -1943,6 +1943,8 @@ window.parent.postMessage({jsonrpc:"2.0",method:"ui/notifications/sandbox-proxy-
|
|
|
1943
1943
|
var _config$renderToolCal, _config$renderCustomM, _config$renderActivit;
|
|
1944
1944
|
super(config);
|
|
1945
1945
|
_defineProperty(this, "_renderToolCalls", []);
|
|
1946
|
+
_defineProperty(this, "_hookRenderToolCalls", /* @__PURE__ */ new Map());
|
|
1947
|
+
_defineProperty(this, "_cachedMergedRenderToolCalls", null);
|
|
1946
1948
|
_defineProperty(this, "_renderCustomMessages", []);
|
|
1947
1949
|
_defineProperty(this, "_renderActivityMessages", []);
|
|
1948
1950
|
_defineProperty(this, "_interruptElement", null);
|
|
@@ -1957,7 +1959,16 @@ window.parent.postMessage({jsonrpc:"2.0",method:"ui/notifications/sandbox-proxy-
|
|
|
1957
1959
|
return this._renderActivityMessages;
|
|
1958
1960
|
}
|
|
1959
1961
|
get renderToolCalls() {
|
|
1960
|
-
return this._renderToolCalls;
|
|
1962
|
+
if (this._hookRenderToolCalls.size === 0) return this._renderToolCalls;
|
|
1963
|
+
if (this._cachedMergedRenderToolCalls) return this._cachedMergedRenderToolCalls;
|
|
1964
|
+
const merged = /* @__PURE__ */ new Map();
|
|
1965
|
+
for (const rc of this._renderToolCalls) {
|
|
1966
|
+
var _rc$agentId;
|
|
1967
|
+
merged.set(`${(_rc$agentId = rc.agentId) !== null && _rc$agentId !== void 0 ? _rc$agentId : ""}:${rc.name}`, rc);
|
|
1968
|
+
}
|
|
1969
|
+
for (const [key, rc] of this._hookRenderToolCalls) merged.set(key, rc);
|
|
1970
|
+
this._cachedMergedRenderToolCalls = Array.from(merged.values());
|
|
1971
|
+
return this._cachedMergedRenderToolCalls;
|
|
1961
1972
|
}
|
|
1962
1973
|
setRenderActivityMessages(renderers) {
|
|
1963
1974
|
this._renderActivityMessages = renderers;
|
|
@@ -1967,6 +1978,24 @@ window.parent.postMessage({jsonrpc:"2.0",method:"ui/notifications/sandbox-proxy-
|
|
|
1967
1978
|
}
|
|
1968
1979
|
setRenderToolCalls(renderToolCalls) {
|
|
1969
1980
|
this._renderToolCalls = renderToolCalls;
|
|
1981
|
+
this._cachedMergedRenderToolCalls = null;
|
|
1982
|
+
this._notifyRenderToolCallsChanged();
|
|
1983
|
+
}
|
|
1984
|
+
addHookRenderToolCall(entry) {
|
|
1985
|
+
var _entry$agentId;
|
|
1986
|
+
const key = `${(_entry$agentId = entry.agentId) !== null && _entry$agentId !== void 0 ? _entry$agentId : ""}:${entry.name}`;
|
|
1987
|
+
this._hookRenderToolCalls.set(key, entry);
|
|
1988
|
+
this._cachedMergedRenderToolCalls = null;
|
|
1989
|
+
this._notifyRenderToolCallsChanged();
|
|
1990
|
+
}
|
|
1991
|
+
removeHookRenderToolCall(name, agentId) {
|
|
1992
|
+
const key = `${agentId !== null && agentId !== void 0 ? agentId : ""}:${name}`;
|
|
1993
|
+
if (this._hookRenderToolCalls.delete(key)) {
|
|
1994
|
+
this._cachedMergedRenderToolCalls = null;
|
|
1995
|
+
this._notifyRenderToolCallsChanged();
|
|
1996
|
+
}
|
|
1997
|
+
}
|
|
1998
|
+
_notifyRenderToolCallsChanged() {
|
|
1970
1999
|
this.notifySubscribers((subscriber) => {
|
|
1971
2000
|
const reactSubscriber = subscriber;
|
|
1972
2001
|
if (reactSubscriber.onRenderToolCallsChanged) reactSubscriber.onRenderToolCallsChanged({
|
|
@@ -2433,23 +2462,12 @@ window.parent.postMessage({jsonrpc:"2.0",method:"ui/notifications/sandbox-proxy-
|
|
|
2433
2462
|
copilotkit.removeTool(name, tool.agentId);
|
|
2434
2463
|
}
|
|
2435
2464
|
copilotkit.addTool(tool);
|
|
2436
|
-
if (tool.render) {
|
|
2437
|
-
|
|
2438
|
-
|
|
2439
|
-
|
|
2440
|
-
|
|
2441
|
-
|
|
2442
|
-
const mergedMap = /* @__PURE__ */ new Map();
|
|
2443
|
-
for (const rc of currentRenderToolCalls) mergedMap.set(keyOf(rc), rc);
|
|
2444
|
-
const newEntry = {
|
|
2445
|
-
name,
|
|
2446
|
-
args: tool.parameters,
|
|
2447
|
-
agentId: tool.agentId,
|
|
2448
|
-
render: tool.render
|
|
2449
|
-
};
|
|
2450
|
-
mergedMap.set(keyOf(newEntry), newEntry);
|
|
2451
|
-
copilotkit.setRenderToolCalls(Array.from(mergedMap.values()));
|
|
2452
|
-
}
|
|
2465
|
+
if (tool.render && tool.parameters) copilotkit.addHookRenderToolCall({
|
|
2466
|
+
name,
|
|
2467
|
+
args: tool.parameters,
|
|
2468
|
+
agentId: tool.agentId,
|
|
2469
|
+
render: tool.render
|
|
2470
|
+
});
|
|
2453
2471
|
return () => {
|
|
2454
2472
|
copilotkit.removeTool(name, tool.agentId);
|
|
2455
2473
|
};
|
|
@@ -2469,16 +2487,16 @@ window.parent.postMessage({jsonrpc:"2.0",method:"ui/notifications/sandbox-proxy-
|
|
|
2469
2487
|
*
|
|
2470
2488
|
* This hook is a convenience wrapper around `useFrontendTool` that:
|
|
2471
2489
|
* - builds a model-facing tool description,
|
|
2472
|
-
* - forwards optional
|
|
2490
|
+
* - forwards optional schema parameters (any Standard Schema V1 compatible library),
|
|
2473
2491
|
* - renders your component with tool call parameters.
|
|
2474
2492
|
*
|
|
2475
2493
|
* Use this when you want to display a typed visual component for a tool call
|
|
2476
2494
|
* without manually wiring a full frontend tool object.
|
|
2477
2495
|
*
|
|
2478
|
-
* When `parameters` is provided, render props are inferred from the schema
|
|
2479
|
-
*
|
|
2496
|
+
* When `parameters` is provided, render props are inferred from the schema.
|
|
2497
|
+
* When omitted, the render component may accept any props.
|
|
2480
2498
|
*
|
|
2481
|
-
* @typeParam TSchema -
|
|
2499
|
+
* @typeParam TSchema - Schema describing tool parameters, or `undefined` when no schema is given.
|
|
2482
2500
|
* @param config - Tool registration config.
|
|
2483
2501
|
* @param deps - Optional dependencies to refresh registration (same semantics as `useEffect`).
|
|
2484
2502
|
*
|
|
@@ -2552,7 +2570,7 @@ window.parent.postMessage({jsonrpc:"2.0",method:"ui/notifications/sandbox-proxy-
|
|
|
2552
2570
|
* - keeps renderer entries on cleanup so historical chat tool calls can still render,
|
|
2553
2571
|
* - refreshes registration when `deps` change.
|
|
2554
2572
|
*
|
|
2555
|
-
* @typeParam S -
|
|
2573
|
+
* @typeParam S - Schema type describing tool call parameters.
|
|
2556
2574
|
* @param config - Renderer config for wildcard or named tools.
|
|
2557
2575
|
* @param deps - Optional dependencies to refresh registration.
|
|
2558
2576
|
*
|
|
@@ -2605,15 +2623,7 @@ window.parent.postMessage({jsonrpc:"2.0",method:"ui/notifications/sandbox-proxy-
|
|
|
2605
2623
|
}),
|
|
2606
2624
|
...config.agentId ? { agentId: config.agentId } : {}
|
|
2607
2625
|
});
|
|
2608
|
-
|
|
2609
|
-
var _rc$agentId;
|
|
2610
|
-
return `${(_rc$agentId = rc.agentId) !== null && _rc$agentId !== void 0 ? _rc$agentId : ""}:${rc.name}`;
|
|
2611
|
-
};
|
|
2612
|
-
const currentRenderToolCalls = copilotkit.renderToolCalls;
|
|
2613
|
-
const mergedMap = /* @__PURE__ */ new Map();
|
|
2614
|
-
for (const rc of currentRenderToolCalls) mergedMap.set(keyOf(rc), rc);
|
|
2615
|
-
mergedMap.set(keyOf(renderer), renderer);
|
|
2616
|
-
copilotkit.setRenderToolCalls(Array.from(mergedMap.values()));
|
|
2626
|
+
copilotkit.addHookRenderToolCall(renderer);
|
|
2617
2627
|
}, [
|
|
2618
2628
|
config.name,
|
|
2619
2629
|
copilotkit,
|
|
@@ -2870,15 +2880,7 @@ window.parent.postMessage({jsonrpc:"2.0",method:"ui/notifications/sandbox-proxy-
|
|
|
2870
2880
|
}, deps);
|
|
2871
2881
|
(0, react.useEffect)(() => {
|
|
2872
2882
|
return () => {
|
|
2873
|
-
|
|
2874
|
-
var _rc$agentId;
|
|
2875
|
-
return `${(_rc$agentId = rc.agentId) !== null && _rc$agentId !== void 0 ? _rc$agentId : ""}:${rc.name}`;
|
|
2876
|
-
};
|
|
2877
|
-
const filtered = copilotkit.renderToolCalls.filter((rc) => keyOf(rc) !== keyOf({
|
|
2878
|
-
name: tool.name,
|
|
2879
|
-
agentId: tool.agentId
|
|
2880
|
-
}));
|
|
2881
|
-
copilotkit.setRenderToolCalls(filtered);
|
|
2883
|
+
copilotkit.removeHookRenderToolCall(tool.name, tool.agentId);
|
|
2882
2884
|
};
|
|
2883
2885
|
}, [
|
|
2884
2886
|
copilotkit,
|