@copilotkit/react-core 1.50.0-beta.8 → 1.50.0-beta.9
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 +12 -0
- package/dist/{chunk-EKDPRKZT.mjs → chunk-3775VM7Y.mjs} +14 -26
- package/dist/chunk-3775VM7Y.mjs.map +1 -0
- package/dist/{chunk-BLDHD6Q2.mjs → chunk-7SHWECGN.mjs} +2 -2
- package/dist/{chunk-Y2L7KDVW.mjs → chunk-B5ELMVT7.mjs} +2 -2
- package/dist/{chunk-ZU6ZBX4E.mjs → chunk-FYMZKPOL.mjs} +4 -4
- package/dist/chunk-XDFVCQD3.mjs +27 -0
- package/dist/chunk-XDFVCQD3.mjs.map +1 -0
- package/dist/{chunk-KYY2WZSR.mjs → chunk-YJGPIN3R.mjs} +2 -2
- package/dist/{chunk-RQ6LWR6S.mjs → chunk-Z6JV2LRY.mjs} +1 -1
- package/dist/chunk-Z6JV2LRY.mjs.map +1 -0
- package/dist/components/copilot-provider/copilotkit.mjs +4 -4
- package/dist/components/copilot-provider/index.mjs +4 -4
- package/dist/components/index.mjs +4 -4
- package/dist/hooks/index.d.ts +1 -1
- package/dist/hooks/index.js +121 -149
- package/dist/hooks/index.js.map +1 -1
- package/dist/hooks/index.mjs +24 -24
- package/dist/hooks/use-copilot-chat-headless_c.js +39 -82
- package/dist/hooks/use-copilot-chat-headless_c.js.map +1 -1
- package/dist/hooks/use-copilot-chat-headless_c.mjs +3 -4
- package/dist/hooks/{use-configure-chat-suggestions.d.ts → use-copilot-chat-suggestions.d.ts} +2 -3
- package/dist/hooks/{use-configure-chat-suggestions.js → use-copilot-chat-suggestions.js} +10 -29
- package/dist/hooks/use-copilot-chat-suggestions.js.map +1 -0
- package/dist/hooks/use-copilot-chat-suggestions.mjs +8 -0
- package/dist/hooks/use-copilot-chat.js +37 -80
- package/dist/hooks/use-copilot-chat.js.map +1 -1
- package/dist/hooks/use-copilot-chat.mjs +3 -4
- package/dist/hooks/use-copilot-chat_internal.d.ts +17 -0
- package/dist/hooks/use-copilot-chat_internal.js +37 -80
- package/dist/hooks/use-copilot-chat_internal.js.map +1 -1
- package/dist/hooks/use-copilot-chat_internal.mjs +2 -3
- package/dist/hooks/use-copilot-readable.d.ts +2 -3
- package/dist/hooks/use-copilot-readable.js.map +1 -1
- package/dist/hooks/use-copilot-readable.mjs +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +114 -142
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +32 -32
- package/dist/lib/copilot-task.mjs +5 -5
- package/dist/lib/index.mjs +5 -5
- package/dist/types/index.mjs +1 -1
- package/dist/utils/index.mjs +3 -3
- package/package.json +5 -5
- package/src/hooks/index.ts +2 -2
- package/src/hooks/use-copilot-chat-suggestions.tsx +124 -0
- package/src/hooks/use-copilot-chat_internal.ts +29 -29
- package/src/hooks/use-copilot-readable.ts +2 -4
- package/dist/chunk-EKDPRKZT.mjs.map +0 -1
- package/dist/chunk-FBVI3LQ6.mjs +0 -48
- package/dist/chunk-FBVI3LQ6.mjs.map +0 -1
- package/dist/chunk-RQ6LWR6S.mjs.map +0 -1
- package/dist/hooks/use-configure-chat-suggestions.js.map +0 -1
- package/dist/hooks/use-configure-chat-suggestions.mjs +0 -8
- package/src/hooks/use-configure-chat-suggestions.tsx +0 -86
- /package/dist/{chunk-BLDHD6Q2.mjs.map → chunk-7SHWECGN.mjs.map} +0 -0
- /package/dist/{chunk-Y2L7KDVW.mjs.map → chunk-B5ELMVT7.mjs.map} +0 -0
- /package/dist/{chunk-ZU6ZBX4E.mjs.map → chunk-FYMZKPOL.mjs.map} +0 -0
- /package/dist/{chunk-KYY2WZSR.mjs.map → chunk-YJGPIN3R.mjs.map} +0 -0
- /package/dist/hooks/{use-configure-chat-suggestions.mjs.map → use-copilot-chat-suggestions.mjs.map} +0 -0
package/dist/hooks/index.js
CHANGED
|
@@ -81,13 +81,13 @@ var hooks_exports = {};
|
|
|
81
81
|
__export(hooks_exports, {
|
|
82
82
|
useCoAgent: () => useCoAgent,
|
|
83
83
|
useCoAgentStateRender: () => useCoAgentStateRender,
|
|
84
|
-
useConfigureChatSuggestions: () => useConfigureChatSuggestions,
|
|
85
84
|
useCopilotAction: () => useCopilotAction,
|
|
86
85
|
useCopilotAdditionalInstructions: () => useCopilotAdditionalInstructions,
|
|
87
86
|
useCopilotAuthenticatedAction_c: () => useCopilotAuthenticatedAction_c,
|
|
88
87
|
useCopilotChat: () => useCopilotChat,
|
|
89
88
|
useCopilotChatHeadless_c: () => useCopilotChatHeadless_c,
|
|
90
89
|
useCopilotChatInternal: () => useCopilotChatInternal,
|
|
90
|
+
useCopilotChatSuggestions: () => useCopilotChatSuggestions,
|
|
91
91
|
useCopilotReadable: () => useCopilotReadable,
|
|
92
92
|
useCopilotRuntimeClient: () => useCopilotRuntimeClient,
|
|
93
93
|
useDefaultTool: () => useDefaultTool,
|
|
@@ -102,7 +102,7 @@ __export(hooks_exports, {
|
|
|
102
102
|
module.exports = __toCommonJS(hooks_exports);
|
|
103
103
|
|
|
104
104
|
// src/hooks/use-copilot-chat_internal.ts
|
|
105
|
-
var
|
|
105
|
+
var import_react13 = require("react");
|
|
106
106
|
|
|
107
107
|
// src/context/copilot-context.tsx
|
|
108
108
|
var import_react = __toESM(require("react"));
|
|
@@ -491,7 +491,7 @@ function useLangGraphInterruptRender(agent) {
|
|
|
491
491
|
}
|
|
492
492
|
|
|
493
493
|
// src/hooks/use-copilot-chat_internal.ts
|
|
494
|
-
var
|
|
494
|
+
var import_react14 = require("@copilotkitnext/react");
|
|
495
495
|
|
|
496
496
|
// src/hooks/use-lazy-tool-renderer.tsx
|
|
497
497
|
var import_react9 = require("@copilotkitnext/react");
|
|
@@ -518,40 +518,6 @@ function useLazyToolRenderer() {
|
|
|
518
518
|
);
|
|
519
519
|
}
|
|
520
520
|
|
|
521
|
-
// src/hooks/use-configure-chat-suggestions.tsx
|
|
522
|
-
var import_react11 = require("@copilotkitnext/react");
|
|
523
|
-
var import_react12 = require("react");
|
|
524
|
-
function useConfigureChatSuggestions(config, dependencies = []) {
|
|
525
|
-
var _a;
|
|
526
|
-
const existingConfig = (0, import_react11.useCopilotChatConfiguration)();
|
|
527
|
-
const resolvedAgentId = (_a = existingConfig == null ? void 0 : existingConfig.agentId) != null ? _a : "default";
|
|
528
|
-
const { copilotkit } = (0, import_react11.useCopilotKit)();
|
|
529
|
-
const available = config.available === "enabled" ? "always" : config.available;
|
|
530
|
-
const finalSuggestionConfig = __spreadProps(__spreadValues({}, config), {
|
|
531
|
-
available,
|
|
532
|
-
consumerAgentId: resolvedAgentId
|
|
533
|
-
// Use chatConfig.agentId here
|
|
534
|
-
});
|
|
535
|
-
(0, import_react11.useConfigureSuggestions)(finalSuggestionConfig, dependencies);
|
|
536
|
-
const result = (0, import_react11.useSuggestions)({ agentId: resolvedAgentId });
|
|
537
|
-
(0, import_react12.useEffect)(() => {
|
|
538
|
-
if (finalSuggestionConfig.available === "disabled")
|
|
539
|
-
return;
|
|
540
|
-
const subscription = copilotkit.subscribe({
|
|
541
|
-
onAgentsChanged: () => {
|
|
542
|
-
const agent = copilotkit.getAgent(resolvedAgentId);
|
|
543
|
-
if (agent && !agent.isRunning && !result.suggestions.length) {
|
|
544
|
-
copilotkit.reloadSuggestions(resolvedAgentId);
|
|
545
|
-
}
|
|
546
|
-
}
|
|
547
|
-
});
|
|
548
|
-
return () => {
|
|
549
|
-
subscription.unsubscribe();
|
|
550
|
-
};
|
|
551
|
-
}, [resolvedAgentId]);
|
|
552
|
-
return result;
|
|
553
|
-
}
|
|
554
|
-
|
|
555
521
|
// ../../node_modules/.pnpm/@ag-ui+core@0.0.42/node_modules/@ag-ui/core/dist/index.mjs
|
|
556
522
|
var import_zod = require("zod");
|
|
557
523
|
var import_zod2 = require("zod");
|
|
@@ -958,8 +924,8 @@ var EventSchemas = import_zod2.z.discriminatedUnion("type", [
|
|
|
958
924
|
]);
|
|
959
925
|
|
|
960
926
|
// src/hooks/use-coagent-state-render-bridge.tsx
|
|
961
|
-
var
|
|
962
|
-
var
|
|
927
|
+
var import_react11 = require("@copilotkitnext/react");
|
|
928
|
+
var import_react12 = require("react");
|
|
963
929
|
var import_shared3 = require("@copilotkit/shared");
|
|
964
930
|
function getStateWithoutConstantKeys(state) {
|
|
965
931
|
if (!state)
|
|
@@ -986,11 +952,11 @@ function useCoagentStateRenderBridge(agentId, props) {
|
|
|
986
952
|
var _a;
|
|
987
953
|
const { stateSnapshot, messageIndexInRun, message } = props;
|
|
988
954
|
const { coAgentStateRenders, claimsRef } = useCoAgentStateRenders();
|
|
989
|
-
const { agent } = (0,
|
|
990
|
-
const [nodeName, setNodeName] = (0,
|
|
955
|
+
const { agent } = (0, import_react11.useAgent)({ agentId });
|
|
956
|
+
const [nodeName, setNodeName] = (0, import_react12.useState)(void 0);
|
|
991
957
|
const runId = (_a = props.runId) != null ? _a : message.runId;
|
|
992
958
|
const effectiveRunId = runId || "pending";
|
|
993
|
-
(0,
|
|
959
|
+
(0, import_react12.useEffect)(() => {
|
|
994
960
|
if (!agent)
|
|
995
961
|
return;
|
|
996
962
|
const subscriber = {
|
|
@@ -1010,7 +976,7 @@ function useCoagentStateRenderBridge(agentId, props) {
|
|
|
1010
976
|
unsubscribe();
|
|
1011
977
|
};
|
|
1012
978
|
}, [agentId, nodeName]);
|
|
1013
|
-
const getStateRender = (0,
|
|
979
|
+
const getStateRender = (0, import_react12.useCallback)(
|
|
1014
980
|
(messageId) => {
|
|
1015
981
|
return Object.entries(coAgentStateRenders).find(([stateRenderId, stateRender]) => {
|
|
1016
982
|
if (claimsRef.current[messageId]) {
|
|
@@ -1052,7 +1018,7 @@ function useCoagentStateRenderBridge(agentId, props) {
|
|
|
1052
1018
|
claimsRef.current[messageId] = { stateRenderId, runId: runId2 };
|
|
1053
1019
|
return true;
|
|
1054
1020
|
};
|
|
1055
|
-
return (0,
|
|
1021
|
+
return (0, import_react12.useMemo)(() => {
|
|
1056
1022
|
var _a2, _b, _c;
|
|
1057
1023
|
if (messageIndexInRun !== 0) {
|
|
1058
1024
|
return null;
|
|
@@ -1112,35 +1078,17 @@ function CoAgentStateRenderBridge(props) {
|
|
|
1112
1078
|
}
|
|
1113
1079
|
|
|
1114
1080
|
// src/hooks/use-copilot-chat_internal.ts
|
|
1115
|
-
function useConfigureSuggestions2(suggestions) {
|
|
1116
|
-
let suggestionsConfig;
|
|
1117
|
-
if (Array.isArray(suggestions)) {
|
|
1118
|
-
suggestionsConfig = {
|
|
1119
|
-
suggestions,
|
|
1120
|
-
available: "always"
|
|
1121
|
-
};
|
|
1122
|
-
} else if (suggestions === "auto") {
|
|
1123
|
-
suggestionsConfig = {
|
|
1124
|
-
available: suggestions === "auto" ? "always" : "disabled",
|
|
1125
|
-
instructions: "Suggest what the user could say next. Provide clear, highly relevant suggestions. Do not literally suggest function calls."
|
|
1126
|
-
};
|
|
1127
|
-
} else {
|
|
1128
|
-
suggestionsConfig = { available: "disabled" };
|
|
1129
|
-
}
|
|
1130
|
-
useConfigureChatSuggestions(suggestionsConfig);
|
|
1131
|
-
}
|
|
1132
1081
|
function useCopilotChatInternal({
|
|
1133
1082
|
suggestions
|
|
1134
1083
|
} = {}) {
|
|
1135
1084
|
var _a, _b, _c;
|
|
1136
|
-
const { copilotkit } = (0,
|
|
1085
|
+
const { copilotkit } = (0, import_react14.useCopilotKit)();
|
|
1137
1086
|
const { threadId, agentSession } = useCopilotContext();
|
|
1138
|
-
const existingConfig = (0,
|
|
1139
|
-
const [agentAvailable, setAgentAvailable] = (0,
|
|
1140
|
-
useConfigureSuggestions2(suggestions);
|
|
1087
|
+
const existingConfig = (0, import_react14.useCopilotChatConfiguration)();
|
|
1088
|
+
const [agentAvailable, setAgentAvailable] = (0, import_react13.useState)(false);
|
|
1141
1089
|
const resolvedAgentId = (_a = existingConfig == null ? void 0 : existingConfig.agentId) != null ? _a : "default";
|
|
1142
|
-
const { agent } = (0,
|
|
1143
|
-
(0,
|
|
1090
|
+
const { agent } = (0, import_react14.useAgent)({ agentId: resolvedAgentId });
|
|
1091
|
+
(0, import_react13.useEffect)(() => {
|
|
1144
1092
|
const connect = (agent2) => __async(this, null, function* () {
|
|
1145
1093
|
setAgentAvailable(false);
|
|
1146
1094
|
try {
|
|
@@ -1165,7 +1113,7 @@ function useCopilotChatInternal({
|
|
|
1165
1113
|
agent == null ? void 0 : agent.setMessages([]);
|
|
1166
1114
|
agent == null ? void 0 : agent.setState(null);
|
|
1167
1115
|
};
|
|
1168
|
-
const deleteMessage = (0,
|
|
1116
|
+
const deleteMessage = (0, import_react13.useCallback)(
|
|
1169
1117
|
(messageId) => {
|
|
1170
1118
|
var _a2;
|
|
1171
1119
|
const filteredMessages = ((_a2 = agent == null ? void 0 : agent.messages) != null ? _a2 : []).filter(
|
|
@@ -1176,13 +1124,13 @@ function useCopilotChatInternal({
|
|
|
1176
1124
|
[agent == null ? void 0 : agent.setMessages, agent == null ? void 0 : agent.messages]
|
|
1177
1125
|
);
|
|
1178
1126
|
const latestDelete = useUpdatedRef(deleteMessage);
|
|
1179
|
-
const latestDeleteFunc = (0,
|
|
1127
|
+
const latestDeleteFunc = (0, import_react13.useCallback)(
|
|
1180
1128
|
(messageId) => {
|
|
1181
1129
|
return latestDelete.current(messageId);
|
|
1182
1130
|
},
|
|
1183
1131
|
[latestDelete]
|
|
1184
1132
|
);
|
|
1185
|
-
const currentSuggestions = (0,
|
|
1133
|
+
const currentSuggestions = (0, import_react14.useSuggestions)({ agentId: resolvedAgentId });
|
|
1186
1134
|
const reload = useAsyncCallback(
|
|
1187
1135
|
(reloadMessageId) => __async(this, null, function* () {
|
|
1188
1136
|
var _a2;
|
|
@@ -1249,7 +1197,7 @@ function useCopilotChatInternal({
|
|
|
1249
1197
|
}),
|
|
1250
1198
|
[latestSendMessageFunc]
|
|
1251
1199
|
);
|
|
1252
|
-
const latestSetMessagesFunc = (0,
|
|
1200
|
+
const latestSetMessagesFunc = (0, import_react13.useCallback)(
|
|
1253
1201
|
(messages) => {
|
|
1254
1202
|
var _a2, _b2;
|
|
1255
1203
|
if (messages.every((message) => message instanceof import_runtime_client_gql2.Message)) {
|
|
@@ -1266,16 +1214,16 @@ function useCopilotChatInternal({
|
|
|
1266
1214
|
}),
|
|
1267
1215
|
[latestReload]
|
|
1268
1216
|
);
|
|
1269
|
-
const latestStopFunc = (0,
|
|
1217
|
+
const latestStopFunc = (0, import_react13.useCallback)(() => {
|
|
1270
1218
|
var _a2;
|
|
1271
1219
|
return (_a2 = agent == null ? void 0 : agent.abortRun) == null ? void 0 : _a2.call(agent);
|
|
1272
1220
|
}, [agent == null ? void 0 : agent.abortRun]);
|
|
1273
1221
|
const latestReset = useUpdatedRef(reset);
|
|
1274
|
-
const latestResetFunc = (0,
|
|
1222
|
+
const latestResetFunc = (0, import_react13.useCallback)(() => {
|
|
1275
1223
|
return latestReset.current();
|
|
1276
1224
|
}, [latestReset]);
|
|
1277
1225
|
const lazyToolRendered = useLazyToolRenderer();
|
|
1278
|
-
const renderCustomMessage = (0,
|
|
1226
|
+
const renderCustomMessage = (0, import_react14.useRenderCustomMessages)();
|
|
1279
1227
|
const legacyCustomMessageRenderer = useLegacyCoagentRenderer({
|
|
1280
1228
|
copilotkit,
|
|
1281
1229
|
agent,
|
|
@@ -1283,7 +1231,7 @@ function useCopilotChatInternal({
|
|
|
1283
1231
|
threadId: (_b = existingConfig == null ? void 0 : existingConfig.threadId) != null ? _b : threadId
|
|
1284
1232
|
});
|
|
1285
1233
|
const allMessages = (_c = agent == null ? void 0 : agent.messages) != null ? _c : [];
|
|
1286
|
-
const resolvedMessages = (0,
|
|
1234
|
+
const resolvedMessages = (0, import_react13.useMemo)(() => {
|
|
1287
1235
|
let processedMessages = allMessages.map((message) => {
|
|
1288
1236
|
if (message.role !== "assistant") {
|
|
1289
1237
|
return message;
|
|
@@ -1320,6 +1268,15 @@ function useCopilotChatInternal({
|
|
|
1320
1268
|
// legacyCustomMessageRenderer,
|
|
1321
1269
|
resolvedAgentId
|
|
1322
1270
|
]);
|
|
1271
|
+
const renderedSuggestions = (0, import_react13.useMemo)(() => {
|
|
1272
|
+
if (Array.isArray(suggestions)) {
|
|
1273
|
+
return {
|
|
1274
|
+
suggestions: suggestions.map((s) => __spreadProps(__spreadValues({}, s), { isLoading: false })),
|
|
1275
|
+
isLoading: false
|
|
1276
|
+
};
|
|
1277
|
+
}
|
|
1278
|
+
return currentSuggestions;
|
|
1279
|
+
}, [suggestions, currentSuggestions]);
|
|
1323
1280
|
return {
|
|
1324
1281
|
messages: resolvedMessages,
|
|
1325
1282
|
sendMessage: latestSendMessageFunc,
|
|
@@ -1333,21 +1290,21 @@ function useCopilotChatInternal({
|
|
|
1333
1290
|
isLoading: Boolean(agent == null ? void 0 : agent.isRunning),
|
|
1334
1291
|
// mcpServers,
|
|
1335
1292
|
// setMcpServers,
|
|
1336
|
-
suggestions:
|
|
1293
|
+
suggestions: renderedSuggestions.suggestions,
|
|
1337
1294
|
setSuggestions: (suggestions2) => copilotkit.addSuggestionsConfig({ suggestions: suggestions2 }),
|
|
1338
1295
|
generateSuggestions: () => __async(this, null, function* () {
|
|
1339
1296
|
return copilotkit.reloadSuggestions(resolvedAgentId);
|
|
1340
1297
|
}),
|
|
1341
1298
|
resetSuggestions: () => copilotkit.clearSuggestions(resolvedAgentId),
|
|
1342
|
-
isLoadingSuggestions:
|
|
1299
|
+
isLoadingSuggestions: renderedSuggestions.isLoading,
|
|
1343
1300
|
interrupt,
|
|
1344
1301
|
agent,
|
|
1345
1302
|
threadId
|
|
1346
1303
|
};
|
|
1347
1304
|
}
|
|
1348
1305
|
function useUpdatedRef(value) {
|
|
1349
|
-
const ref = (0,
|
|
1350
|
-
(0,
|
|
1306
|
+
const ref = (0, import_react13.useRef)(value);
|
|
1307
|
+
(0, import_react13.useEffect)(() => {
|
|
1351
1308
|
ref.current = value;
|
|
1352
1309
|
}, [value]);
|
|
1353
1310
|
return ref;
|
|
@@ -1358,7 +1315,7 @@ function useLegacyCoagentRenderer({
|
|
|
1358
1315
|
agentId,
|
|
1359
1316
|
threadId
|
|
1360
1317
|
}) {
|
|
1361
|
-
return (0,
|
|
1318
|
+
return (0, import_react13.useMemo)(() => {
|
|
1362
1319
|
if (!copilotkit || !agent) {
|
|
1363
1320
|
return null;
|
|
1364
1321
|
}
|
|
@@ -1381,7 +1338,7 @@ function useLegacyCoagentRenderer({
|
|
|
1381
1338
|
agentId,
|
|
1382
1339
|
stateSnapshot: message.state
|
|
1383
1340
|
};
|
|
1384
|
-
return (0,
|
|
1341
|
+
return (0, import_react13.createElement)(CoAgentStateRenderBridge, bridgeProps);
|
|
1385
1342
|
};
|
|
1386
1343
|
}, [agent, agentId, copilotkit, threadId]);
|
|
1387
1344
|
}
|
|
@@ -1415,7 +1372,7 @@ function useCopilotChat(options = {}) {
|
|
|
1415
1372
|
}
|
|
1416
1373
|
|
|
1417
1374
|
// src/hooks/use-copilot-chat-headless_c.ts
|
|
1418
|
-
var
|
|
1375
|
+
var import_react15 = require("react");
|
|
1419
1376
|
var import_shared4 = require("@copilotkit/shared");
|
|
1420
1377
|
var createNonFunctionalReturn = () => ({
|
|
1421
1378
|
visibleMessages: [],
|
|
@@ -1456,7 +1413,7 @@ function useCopilotChatHeadless_c(options = {}) {
|
|
|
1456
1413
|
const { copilotApiConfig, setBannerError } = useCopilotContext();
|
|
1457
1414
|
const hasPublicApiKey = Boolean(copilotApiConfig.publicApiKey);
|
|
1458
1415
|
const internalResult = useCopilotChatInternal(options);
|
|
1459
|
-
(0,
|
|
1416
|
+
(0, import_react15.useEffect)(() => {
|
|
1460
1417
|
if (!hasPublicApiKey) {
|
|
1461
1418
|
setBannerError(
|
|
1462
1419
|
new import_shared4.CopilotKitError({
|
|
@@ -1481,13 +1438,13 @@ function useCopilotChatHeadless_c(options = {}) {
|
|
|
1481
1438
|
}
|
|
1482
1439
|
|
|
1483
1440
|
// src/hooks/use-copilot-action.ts
|
|
1484
|
-
var
|
|
1441
|
+
var import_react22 = require("react");
|
|
1485
1442
|
|
|
1486
1443
|
// src/hooks/use-frontend-tool.ts
|
|
1487
|
-
var
|
|
1444
|
+
var import_react16 = __toESM(require("react"));
|
|
1488
1445
|
var import_shared5 = require("@copilotkit/shared");
|
|
1489
1446
|
var import_shared6 = require("@copilotkit/shared");
|
|
1490
|
-
var
|
|
1447
|
+
var import_react17 = require("@copilotkitnext/react");
|
|
1491
1448
|
function useFrontendTool(tool, dependencies) {
|
|
1492
1449
|
const { name, description, parameters, render, followUp } = tool;
|
|
1493
1450
|
const zodParameters = (0, import_shared5.getZodParameters)(parameters);
|
|
@@ -1497,8 +1454,8 @@ function useFrontendTool(tool, dependencies) {
|
|
|
1497
1454
|
}
|
|
1498
1455
|
if (typeof render === "string") {
|
|
1499
1456
|
const staticRender = render;
|
|
1500
|
-
return () =>
|
|
1501
|
-
|
|
1457
|
+
return () => import_react16.default.createElement(
|
|
1458
|
+
import_react16.default.Fragment,
|
|
1502
1459
|
null,
|
|
1503
1460
|
staticRender
|
|
1504
1461
|
);
|
|
@@ -1509,12 +1466,12 @@ function useFrontendTool(tool, dependencies) {
|
|
|
1509
1466
|
});
|
|
1510
1467
|
const rendered = render(renderArgs);
|
|
1511
1468
|
if (typeof rendered === "string") {
|
|
1512
|
-
return
|
|
1469
|
+
return import_react16.default.createElement(import_react16.default.Fragment, null, rendered);
|
|
1513
1470
|
}
|
|
1514
1471
|
return rendered != null ? rendered : null;
|
|
1515
1472
|
};
|
|
1516
1473
|
})();
|
|
1517
|
-
(0,
|
|
1474
|
+
(0, import_react17.useFrontendTool)({
|
|
1518
1475
|
name,
|
|
1519
1476
|
description,
|
|
1520
1477
|
parameters: zodParameters,
|
|
@@ -1526,23 +1483,23 @@ function useFrontendTool(tool, dependencies) {
|
|
|
1526
1483
|
|
|
1527
1484
|
// src/hooks/use-render-tool-call.ts
|
|
1528
1485
|
var import_shared7 = require("@copilotkit/shared");
|
|
1529
|
-
var
|
|
1530
|
-
var
|
|
1486
|
+
var import_react18 = require("react");
|
|
1487
|
+
var import_react19 = require("@copilotkitnext/react");
|
|
1531
1488
|
var import_shared8 = require("@copilotkit/shared");
|
|
1532
1489
|
function useRenderToolCall2(tool, dependencies) {
|
|
1533
|
-
const { copilotkit } = (0,
|
|
1534
|
-
const hasAddedRef = (0,
|
|
1535
|
-
(0,
|
|
1490
|
+
const { copilotkit } = (0, import_react19.useCopilotKit)();
|
|
1491
|
+
const hasAddedRef = (0, import_react18.useRef)(false);
|
|
1492
|
+
(0, import_react18.useEffect)(() => {
|
|
1536
1493
|
const { name, parameters, render } = tool;
|
|
1537
1494
|
const zodParameters = (0, import_shared7.getZodParameters)(parameters);
|
|
1538
|
-
const renderToolCall = name === "*" ? (0,
|
|
1495
|
+
const renderToolCall = name === "*" ? (0, import_react19.defineToolCallRenderer)({
|
|
1539
1496
|
name: "*",
|
|
1540
1497
|
render: (args) => {
|
|
1541
1498
|
return render(__spreadProps(__spreadValues({}, args), {
|
|
1542
1499
|
result: args.result ? (0, import_shared8.parseJson)(args.result, args.result) : args.result
|
|
1543
1500
|
}));
|
|
1544
1501
|
}
|
|
1545
|
-
}) : (0,
|
|
1502
|
+
}) : (0, import_react19.defineToolCallRenderer)({
|
|
1546
1503
|
name,
|
|
1547
1504
|
args: zodParameters,
|
|
1548
1505
|
render: (args) => {
|
|
@@ -1571,18 +1528,18 @@ function useRenderToolCall2(tool, dependencies) {
|
|
|
1571
1528
|
|
|
1572
1529
|
// src/hooks/use-human-in-the-loop.ts
|
|
1573
1530
|
var import_shared9 = require("@copilotkit/shared");
|
|
1574
|
-
var
|
|
1531
|
+
var import_react20 = require("@copilotkitnext/react");
|
|
1575
1532
|
var import_core = require("@copilotkitnext/core");
|
|
1576
|
-
var
|
|
1533
|
+
var import_react21 = __toESM(require("react"));
|
|
1577
1534
|
function useHumanInTheLoop(tool, dependencies) {
|
|
1578
1535
|
const _a = tool, { render } = _a, toolRest = __objRest(_a, ["render"]);
|
|
1579
1536
|
const { name, description, parameters, followUp } = toolRest;
|
|
1580
1537
|
const zodParameters = (0, import_shared9.getZodParameters)(parameters);
|
|
1581
|
-
const renderRef = (0,
|
|
1582
|
-
(0,
|
|
1538
|
+
const renderRef = (0, import_react21.useRef)(null);
|
|
1539
|
+
(0, import_react21.useEffect)(() => {
|
|
1583
1540
|
renderRef.current = (args) => {
|
|
1584
1541
|
if (typeof render === "string") {
|
|
1585
|
-
return
|
|
1542
|
+
return import_react21.default.createElement(import_react21.default.Fragment, null, render);
|
|
1586
1543
|
}
|
|
1587
1544
|
if (!render) {
|
|
1588
1545
|
return null;
|
|
@@ -1622,12 +1579,12 @@ function useHumanInTheLoop(tool, dependencies) {
|
|
|
1622
1579
|
})();
|
|
1623
1580
|
const rendered = render(renderProps);
|
|
1624
1581
|
if (typeof rendered === "string") {
|
|
1625
|
-
return
|
|
1582
|
+
return import_react21.default.createElement(import_react21.default.Fragment, null, rendered);
|
|
1626
1583
|
}
|
|
1627
1584
|
return rendered != null ? rendered : null;
|
|
1628
1585
|
};
|
|
1629
1586
|
}, [render, ...dependencies != null ? dependencies : []]);
|
|
1630
|
-
(0,
|
|
1587
|
+
(0, import_react20.useHumanInTheLoop)({
|
|
1631
1588
|
name,
|
|
1632
1589
|
description,
|
|
1633
1590
|
followUp,
|
|
@@ -1683,7 +1640,7 @@ function getActionConfig(action) {
|
|
|
1683
1640
|
throw new Error("Invalid action configuration");
|
|
1684
1641
|
}
|
|
1685
1642
|
function useCopilotAction(action, dependencies) {
|
|
1686
|
-
const [initialActionConfig] = (0,
|
|
1643
|
+
const [initialActionConfig] = (0, import_react22.useState)(getActionConfig(action));
|
|
1687
1644
|
const currentActionConfig = getActionConfig(action);
|
|
1688
1645
|
if (initialActionConfig.type !== currentActionConfig.type) {
|
|
1689
1646
|
throw new Error("Action configuration changed between renders");
|
|
@@ -1701,14 +1658,14 @@ function useCopilotAction(action, dependencies) {
|
|
|
1701
1658
|
}
|
|
1702
1659
|
|
|
1703
1660
|
// src/hooks/use-coagent-state-render.ts
|
|
1704
|
-
var
|
|
1661
|
+
var import_react23 = require("react");
|
|
1705
1662
|
var import_shared10 = require("@copilotkit/shared");
|
|
1706
1663
|
function useCoAgentStateRender(action, dependencies) {
|
|
1707
|
-
const { chatComponentsCache, availableAgents } = (0,
|
|
1664
|
+
const { chatComponentsCache, availableAgents } = (0, import_react23.useContext)(CopilotContext);
|
|
1708
1665
|
const { setCoAgentStateRender, removeCoAgentStateRender, coAgentStateRenders } = useCoAgentStateRenders();
|
|
1709
|
-
const idRef = (0,
|
|
1666
|
+
const idRef = (0, import_react23.useRef)((0, import_shared10.randomId)());
|
|
1710
1667
|
const { setBannerError, addToast } = useToast();
|
|
1711
|
-
(0,
|
|
1668
|
+
(0, import_react23.useEffect)(() => {
|
|
1712
1669
|
if ((availableAgents == null ? void 0 : availableAgents.length) && !availableAgents.some((a) => a.name === action.name)) {
|
|
1713
1670
|
const message = `(useCoAgentStateRender): Agent "${action.name}" not found. Make sure the agent exists and is properly configured.`;
|
|
1714
1671
|
const agentError = new import_shared10.CopilotKitAgentDiscoveryError({
|
|
@@ -1729,7 +1686,7 @@ function useCoAgentStateRender(action, dependencies) {
|
|
|
1729
1686
|
}
|
|
1730
1687
|
}
|
|
1731
1688
|
}
|
|
1732
|
-
(0,
|
|
1689
|
+
(0, import_react23.useEffect)(() => {
|
|
1733
1690
|
const currentId = idRef.current;
|
|
1734
1691
|
const hasDuplicate = Object.entries(coAgentStateRenders).some(([id, otherAction]) => {
|
|
1735
1692
|
if (id === currentId)
|
|
@@ -1753,7 +1710,7 @@ function useCoAgentStateRender(action, dependencies) {
|
|
|
1753
1710
|
});
|
|
1754
1711
|
}
|
|
1755
1712
|
}, [coAgentStateRenders]);
|
|
1756
|
-
(0,
|
|
1713
|
+
(0, import_react23.useEffect)(() => {
|
|
1757
1714
|
setCoAgentStateRender(idRef.current, action);
|
|
1758
1715
|
if (chatComponentsCache.current !== null && action.render !== void 0) {
|
|
1759
1716
|
chatComponentsCache.current.coAgentStateRenders[key] = action.render;
|
|
@@ -1773,11 +1730,11 @@ function useCoAgentStateRender(action, dependencies) {
|
|
|
1773
1730
|
}
|
|
1774
1731
|
|
|
1775
1732
|
// src/hooks/use-make-copilot-document-readable.ts
|
|
1776
|
-
var
|
|
1733
|
+
var import_react24 = require("react");
|
|
1777
1734
|
function useMakeCopilotDocumentReadable(document, categories, dependencies = []) {
|
|
1778
1735
|
const { addDocumentContext, removeDocumentContext } = useCopilotContext();
|
|
1779
|
-
const idRef = (0,
|
|
1780
|
-
(0,
|
|
1736
|
+
const idRef = (0, import_react24.useRef)(void 0);
|
|
1737
|
+
(0, import_react24.useEffect)(() => {
|
|
1781
1738
|
const id = addDocumentContext(document, categories);
|
|
1782
1739
|
idRef.current = id;
|
|
1783
1740
|
return () => {
|
|
@@ -1788,12 +1745,12 @@ function useMakeCopilotDocumentReadable(document, categories, dependencies = [])
|
|
|
1788
1745
|
}
|
|
1789
1746
|
|
|
1790
1747
|
// src/hooks/use-copilot-readable.ts
|
|
1791
|
-
var
|
|
1792
|
-
var
|
|
1748
|
+
var import_react25 = require("@copilotkitnext/react");
|
|
1749
|
+
var import_react26 = require("react");
|
|
1793
1750
|
function useCopilotReadable({ description, value, convert, available }, dependencies) {
|
|
1794
|
-
const { copilotkit } = (0,
|
|
1795
|
-
const ctxIdRef = (0,
|
|
1796
|
-
(0,
|
|
1751
|
+
const { copilotkit } = (0, import_react25.useCopilotKit)();
|
|
1752
|
+
const ctxIdRef = (0, import_react26.useRef)(void 0);
|
|
1753
|
+
(0, import_react26.useEffect)(() => {
|
|
1797
1754
|
if (!copilotkit)
|
|
1798
1755
|
return;
|
|
1799
1756
|
const found = Object.entries(copilotkit.context).find(([id, ctxItem]) => {
|
|
@@ -1821,13 +1778,13 @@ function useCopilotReadable({ description, value, convert, available }, dependen
|
|
|
1821
1778
|
}
|
|
1822
1779
|
|
|
1823
1780
|
// src/hooks/use-coagent.ts
|
|
1824
|
-
var
|
|
1825
|
-
var
|
|
1781
|
+
var import_react27 = require("react");
|
|
1782
|
+
var import_react28 = require("@copilotkitnext/react");
|
|
1826
1783
|
function useCoAgent(options) {
|
|
1827
|
-
const { agent } = (0,
|
|
1828
|
-
const { copilotkit } = (0,
|
|
1784
|
+
const { agent } = (0, import_react28.useAgent)({ agentId: options.name });
|
|
1785
|
+
const { copilotkit } = (0, import_react28.useCopilotKit)();
|
|
1829
1786
|
const nodeName = useAgentNodeName(options.name);
|
|
1830
|
-
const handleStateUpdate = (0,
|
|
1787
|
+
const handleStateUpdate = (0, import_react27.useCallback)(
|
|
1831
1788
|
(newState) => {
|
|
1832
1789
|
if (!agent)
|
|
1833
1790
|
return;
|
|
@@ -1840,7 +1797,7 @@ function useCoAgent(options) {
|
|
|
1840
1797
|
},
|
|
1841
1798
|
[agent == null ? void 0 : agent.state, agent == null ? void 0 : agent.setState]
|
|
1842
1799
|
);
|
|
1843
|
-
(0,
|
|
1800
|
+
(0, import_react27.useEffect)(() => {
|
|
1844
1801
|
var _a;
|
|
1845
1802
|
if (!options.config && !options.configurable)
|
|
1846
1803
|
return;
|
|
@@ -1852,22 +1809,22 @@ function useCoAgent(options) {
|
|
|
1852
1809
|
}
|
|
1853
1810
|
copilotkit.setProperties(config);
|
|
1854
1811
|
}, [options.config, options.configurable]);
|
|
1855
|
-
const externalStateStr = (0,
|
|
1812
|
+
const externalStateStr = (0, import_react27.useMemo)(
|
|
1856
1813
|
() => isExternalStateManagement(options) ? JSON.stringify(options.state) : void 0,
|
|
1857
1814
|
[isExternalStateManagement(options) ? JSON.stringify(options.state) : void 0]
|
|
1858
1815
|
);
|
|
1859
|
-
(0,
|
|
1816
|
+
(0, import_react27.useEffect)(() => {
|
|
1860
1817
|
if ((agent == null ? void 0 : agent.state) && isExternalStateManagement(options) && JSON.stringify(options.state) !== JSON.stringify(agent.state)) {
|
|
1861
1818
|
handleStateUpdate(options.state);
|
|
1862
1819
|
}
|
|
1863
1820
|
}, [agent, externalStateStr, handleStateUpdate]);
|
|
1864
|
-
const hasStateValues = (0,
|
|
1821
|
+
const hasStateValues = (0, import_react27.useCallback)((value) => {
|
|
1865
1822
|
return Boolean(value && Object.keys(value).length);
|
|
1866
1823
|
}, []);
|
|
1867
|
-
const initialStateRef = (0,
|
|
1824
|
+
const initialStateRef = (0, import_react27.useRef)(
|
|
1868
1825
|
isExternalStateManagement(options) ? options.state : "initialState" in options ? options.initialState : void 0
|
|
1869
1826
|
);
|
|
1870
|
-
(0,
|
|
1827
|
+
(0, import_react27.useEffect)(() => {
|
|
1871
1828
|
if (isExternalStateManagement(options)) {
|
|
1872
1829
|
initialStateRef.current = options.state;
|
|
1873
1830
|
} else if ("initialState" in options) {
|
|
@@ -1876,7 +1833,7 @@ function useCoAgent(options) {
|
|
|
1876
1833
|
}, [
|
|
1877
1834
|
isExternalStateManagement(options) ? JSON.stringify(options.state) : "initialState" in options ? JSON.stringify(options.initialState) : void 0
|
|
1878
1835
|
]);
|
|
1879
|
-
(0,
|
|
1836
|
+
(0, import_react27.useEffect)(() => {
|
|
1880
1837
|
if (!agent)
|
|
1881
1838
|
return;
|
|
1882
1839
|
const subscriber = {
|
|
@@ -1904,7 +1861,7 @@ function useCoAgent(options) {
|
|
|
1904
1861
|
subscription.unsubscribe();
|
|
1905
1862
|
};
|
|
1906
1863
|
}, [agent, handleStateUpdate, hasStateValues]);
|
|
1907
|
-
return (0,
|
|
1864
|
+
return (0, import_react27.useMemo)(() => {
|
|
1908
1865
|
var _a, _b, _c;
|
|
1909
1866
|
if (!agent) {
|
|
1910
1867
|
const noop = () => {
|
|
@@ -1960,12 +1917,12 @@ var isExternalStateManagement = (options) => {
|
|
|
1960
1917
|
|
|
1961
1918
|
// src/hooks/use-copilot-runtime-client.ts
|
|
1962
1919
|
var import_runtime_client_gql3 = require("@copilotkit/runtime-client-gql");
|
|
1963
|
-
var
|
|
1920
|
+
var import_react29 = require("react");
|
|
1964
1921
|
var import_shared11 = require("@copilotkit/shared");
|
|
1965
1922
|
var useCopilotRuntimeClient = (options) => {
|
|
1966
1923
|
const { setBannerError } = useToast();
|
|
1967
1924
|
const _a = options, { showDevConsole, onError } = _a, runtimeOptions = __objRest(_a, ["showDevConsole", "onError"]);
|
|
1968
|
-
const lastStructuredErrorRef = (0,
|
|
1925
|
+
const lastStructuredErrorRef = (0, import_react29.useRef)(null);
|
|
1969
1926
|
const traceUIError = (error, originalError) => __async(void 0, null, function* () {
|
|
1970
1927
|
try {
|
|
1971
1928
|
const errorEvent = {
|
|
@@ -1991,7 +1948,7 @@ var useCopilotRuntimeClient = (options) => {
|
|
|
1991
1948
|
console.error("Error in onError handler:", error2);
|
|
1992
1949
|
}
|
|
1993
1950
|
});
|
|
1994
|
-
const runtimeClient = (0,
|
|
1951
|
+
const runtimeClient = (0, import_react29.useMemo)(() => {
|
|
1995
1952
|
return new import_runtime_client_gql3.CopilotRuntimeClient(__spreadProps(__spreadValues({}, runtimeOptions), {
|
|
1996
1953
|
handleGQLErrors: (error) => {
|
|
1997
1954
|
var _a2;
|
|
@@ -2070,28 +2027,28 @@ function createStructuredError(gqlError) {
|
|
|
2070
2027
|
}
|
|
2071
2028
|
|
|
2072
2029
|
// src/hooks/use-copilot-authenticated-action.ts
|
|
2073
|
-
var
|
|
2074
|
-
var
|
|
2030
|
+
var import_react30 = require("react");
|
|
2031
|
+
var import_react31 = __toESM(require("react"));
|
|
2075
2032
|
function useCopilotAuthenticatedAction_c(action, dependencies) {
|
|
2076
2033
|
const { authConfig_c, authStates_c, setAuthStates_c } = useCopilotContext();
|
|
2077
|
-
const pendingActionRef = (0,
|
|
2078
|
-
const executeAction = (0,
|
|
2034
|
+
const pendingActionRef = (0, import_react30.useRef)(null);
|
|
2035
|
+
const executeAction = (0, import_react30.useCallback)(
|
|
2079
2036
|
(props) => {
|
|
2080
2037
|
if (typeof action.render === "function") {
|
|
2081
2038
|
return action.render(props);
|
|
2082
2039
|
}
|
|
2083
|
-
return action.render ||
|
|
2040
|
+
return action.render || import_react31.default.createElement(import_react30.Fragment);
|
|
2084
2041
|
},
|
|
2085
2042
|
[action]
|
|
2086
2043
|
);
|
|
2087
|
-
const wrappedRender = (0,
|
|
2044
|
+
const wrappedRender = (0, import_react30.useCallback)(
|
|
2088
2045
|
(props) => {
|
|
2089
2046
|
const isAuthenticated = Object.values(authStates_c || {}).some(
|
|
2090
2047
|
(state) => state.status === "authenticated"
|
|
2091
2048
|
);
|
|
2092
2049
|
if (!isAuthenticated) {
|
|
2093
2050
|
pendingActionRef.current = props;
|
|
2094
|
-
return (authConfig_c == null ? void 0 : authConfig_c.SignInComponent) ?
|
|
2051
|
+
return (authConfig_c == null ? void 0 : authConfig_c.SignInComponent) ? import_react31.default.createElement(authConfig_c.SignInComponent, {
|
|
2095
2052
|
onSignInComplete: (authState) => {
|
|
2096
2053
|
setAuthStates_c == null ? void 0 : setAuthStates_c((prev) => __spreadProps(__spreadValues({}, prev), { [action.name]: authState }));
|
|
2097
2054
|
if (pendingActionRef.current) {
|
|
@@ -2099,7 +2056,7 @@ function useCopilotAuthenticatedAction_c(action, dependencies) {
|
|
|
2099
2056
|
pendingActionRef.current = null;
|
|
2100
2057
|
}
|
|
2101
2058
|
}
|
|
2102
|
-
}) :
|
|
2059
|
+
}) : import_react31.default.createElement(import_react30.Fragment);
|
|
2103
2060
|
}
|
|
2104
2061
|
return executeAction(props);
|
|
2105
2062
|
},
|
|
@@ -2114,13 +2071,13 @@ function useCopilotAuthenticatedAction_c(action, dependencies) {
|
|
|
2114
2071
|
}
|
|
2115
2072
|
|
|
2116
2073
|
// src/hooks/use-langgraph-interrupt.ts
|
|
2117
|
-
var
|
|
2074
|
+
var import_react32 = require("react");
|
|
2118
2075
|
var import_shared12 = require("@copilotkit/shared");
|
|
2119
2076
|
function useLangGraphInterrupt(action, dependencies) {
|
|
2120
|
-
const { setInterruptAction, removeInterruptAction, interruptActions, threadId } = (0,
|
|
2077
|
+
const { setInterruptAction, removeInterruptAction, interruptActions, threadId } = (0, import_react32.useContext)(CopilotContext);
|
|
2121
2078
|
const { addToast } = useToast();
|
|
2122
2079
|
const actionId = (0, import_shared12.dataToUUID)(action, "lgAction");
|
|
2123
|
-
(0,
|
|
2080
|
+
(0, import_react32.useEffect)(() => {
|
|
2124
2081
|
if (!action)
|
|
2125
2082
|
return;
|
|
2126
2083
|
setInterruptAction(__spreadProps(__spreadValues({}, action), { id: actionId }));
|
|
@@ -2131,10 +2088,10 @@ function useLangGraphInterrupt(action, dependencies) {
|
|
|
2131
2088
|
}
|
|
2132
2089
|
|
|
2133
2090
|
// src/hooks/use-copilot-additional-instructions.ts
|
|
2134
|
-
var
|
|
2091
|
+
var import_react33 = require("react");
|
|
2135
2092
|
function useCopilotAdditionalInstructions({ instructions, available = "enabled" }, dependencies) {
|
|
2136
2093
|
const { setAdditionalInstructions } = useCopilotContext();
|
|
2137
|
-
(0,
|
|
2094
|
+
(0, import_react33.useEffect)(() => {
|
|
2138
2095
|
if (available === "disabled")
|
|
2139
2096
|
return;
|
|
2140
2097
|
setAdditionalInstructions((prevInstructions) => [...prevInstructions || [], instructions]);
|
|
@@ -2150,17 +2107,32 @@ function useCopilotAdditionalInstructions({ instructions, available = "enabled"
|
|
|
2150
2107
|
function useDefaultTool(tool, dependencies) {
|
|
2151
2108
|
useCopilotAction(__spreadProps(__spreadValues({}, tool), { name: "*" }), dependencies);
|
|
2152
2109
|
}
|
|
2110
|
+
|
|
2111
|
+
// src/hooks/use-copilot-chat-suggestions.tsx
|
|
2112
|
+
var import_react34 = require("@copilotkitnext/react");
|
|
2113
|
+
function useCopilotChatSuggestions(config, dependencies = []) {
|
|
2114
|
+
var _a, _b;
|
|
2115
|
+
const existingConfig = (0, import_react34.useCopilotChatConfiguration)();
|
|
2116
|
+
const resolvedAgentId = (_a = existingConfig == null ? void 0 : existingConfig.agentId) != null ? _a : "default";
|
|
2117
|
+
const available = (_b = config.available === "enabled" ? "always" : config.available) != null ? _b : "before-first-message";
|
|
2118
|
+
const finalSuggestionConfig = __spreadProps(__spreadValues({}, config), {
|
|
2119
|
+
available,
|
|
2120
|
+
consumerAgentId: resolvedAgentId
|
|
2121
|
+
// Use chatConfig.agentId here
|
|
2122
|
+
});
|
|
2123
|
+
(0, import_react34.useConfigureSuggestions)(finalSuggestionConfig, dependencies);
|
|
2124
|
+
}
|
|
2153
2125
|
// Annotate the CommonJS export names for ESM import in node:
|
|
2154
2126
|
0 && (module.exports = {
|
|
2155
2127
|
useCoAgent,
|
|
2156
2128
|
useCoAgentStateRender,
|
|
2157
|
-
useConfigureChatSuggestions,
|
|
2158
2129
|
useCopilotAction,
|
|
2159
2130
|
useCopilotAdditionalInstructions,
|
|
2160
2131
|
useCopilotAuthenticatedAction_c,
|
|
2161
2132
|
useCopilotChat,
|
|
2162
2133
|
useCopilotChatHeadless_c,
|
|
2163
2134
|
useCopilotChatInternal,
|
|
2135
|
+
useCopilotChatSuggestions,
|
|
2164
2136
|
useCopilotReadable,
|
|
2165
2137
|
useCopilotRuntimeClient,
|
|
2166
2138
|
useDefaultTool,
|