@copilotkit/react-core 1.68.1 → 1.68.3-canary.1786716392
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/{copilotkit-BICg0AyJ.d.cts → copilotkit-B1K0Tgnz.d.cts} +47 -3
- package/dist/copilotkit-B1K0Tgnz.d.cts.map +1 -0
- package/dist/{copilotkit-BrfN8YeF.d.mts → copilotkit-CZjzQPdq.d.mts} +47 -3
- package/dist/copilotkit-CZjzQPdq.d.mts.map +1 -0
- package/dist/{copilotkit-Ck0RL8hh.mjs → copilotkit-DT2FmOwK.mjs} +263 -19
- package/dist/copilotkit-DT2FmOwK.mjs.map +1 -0
- package/dist/{copilotkit-8KSSmCH_.cjs → copilotkit-EFunREg5.cjs} +268 -18
- package/dist/copilotkit-EFunREg5.cjs.map +1 -0
- package/dist/index.cjs +14 -7
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +1 -1
- package/dist/index.d.mts +1 -1
- package/dist/index.mjs +14 -7
- package/dist/index.mjs.map +1 -1
- package/dist/index.umd.js +62 -16
- package/dist/index.umd.js.map +1 -1
- package/dist/v2/headless.cjs +2 -0
- package/dist/v2/headless.cjs.map +1 -1
- package/dist/v2/headless.d.cts +2 -0
- package/dist/v2/headless.d.cts.map +1 -1
- package/dist/v2/headless.d.mts +2 -0
- package/dist/v2/headless.d.mts.map +1 -1
- package/dist/v2/headless.mjs +2 -0
- package/dist/v2/headless.mjs.map +1 -1
- package/dist/v2/index.cjs +2 -1
- package/dist/v2/index.css +1 -1
- package/dist/v2/index.d.cts +2 -2
- package/dist/v2/index.d.mts +2 -2
- package/dist/v2/index.mjs +2 -2
- package/dist/v2/index.umd.js +262 -17
- package/dist/v2/index.umd.js.map +1 -1
- package/package.json +8 -8
- package/skills/react-core/SKILL.md +1 -1
- package/dist/copilotkit-8KSSmCH_.cjs.map +0 -1
- package/dist/copilotkit-BICg0AyJ.d.cts.map +0 -1
- package/dist/copilotkit-BrfN8YeF.d.mts.map +0 -1
- package/dist/copilotkit-Ck0RL8hh.mjs.map +0 -1
package/dist/index.cjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
4
|
-
const require_copilotkit = require('./copilotkit-
|
|
4
|
+
const require_copilotkit = require('./copilotkit-EFunREg5.cjs');
|
|
5
5
|
let react = require("react");
|
|
6
6
|
react = require_copilotkit.__toESM(react);
|
|
7
7
|
let _copilotkit_core = require("@copilotkit/core");
|
|
@@ -1139,30 +1139,37 @@ function useCopilotReadable({ description, value, convert, available = "enabled"
|
|
|
1139
1139
|
|
|
1140
1140
|
//#endregion
|
|
1141
1141
|
//#region src/hooks/use-agent-nodename.ts
|
|
1142
|
+
/**
|
|
1143
|
+
* Tracks the node the agent is currently executing.
|
|
1144
|
+
*
|
|
1145
|
+
* Backed by state rather than a ref: mutating a ref schedules no render, so
|
|
1146
|
+
* consumers such as `useCoAgent().nodeName` kept reporting whichever node was
|
|
1147
|
+
* current at their last render and never updated on their own.
|
|
1148
|
+
*/
|
|
1142
1149
|
function useAgentNodeName(agentName) {
|
|
1143
1150
|
const { agent } = require_copilotkit.useAgent({ agentId: agentName });
|
|
1144
|
-
const
|
|
1151
|
+
const [nodeName, setNodeName] = (0, react.useState)("start");
|
|
1145
1152
|
(0, react.useEffect)(() => {
|
|
1146
1153
|
if (!agent) return;
|
|
1147
1154
|
const subscription = agent.subscribe({
|
|
1148
1155
|
onStepStartedEvent: ({ event }) => {
|
|
1149
|
-
|
|
1156
|
+
setNodeName(event.stepName);
|
|
1150
1157
|
},
|
|
1151
1158
|
onRunStartedEvent: () => {
|
|
1152
|
-
|
|
1159
|
+
setNodeName("start");
|
|
1153
1160
|
},
|
|
1154
1161
|
onRunFinishedEvent: () => {
|
|
1155
|
-
|
|
1162
|
+
setNodeName("end");
|
|
1156
1163
|
},
|
|
1157
1164
|
onRunErrorEvent: () => {
|
|
1158
|
-
|
|
1165
|
+
setNodeName("end");
|
|
1159
1166
|
}
|
|
1160
1167
|
});
|
|
1161
1168
|
return () => {
|
|
1162
1169
|
subscription.unsubscribe();
|
|
1163
1170
|
};
|
|
1164
1171
|
}, [agent]);
|
|
1165
|
-
return
|
|
1172
|
+
return nodeName;
|
|
1166
1173
|
}
|
|
1167
1174
|
|
|
1168
1175
|
//#endregion
|