@copilotkit/react-core 1.63.3-canary.rc-1 → 1.64.1
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-BE1n5tSI.d.mts.map +1 -1
- package/dist/copilotkit-CXvuYw_F.d.cts.map +1 -1
- package/dist/{copilotkit-DL0LvmwQ.mjs → copilotkit-D_Ao1X-u.mjs} +49 -36
- package/dist/copilotkit-D_Ao1X-u.mjs.map +1 -0
- package/dist/{copilotkit-rYTwMndy.cjs → copilotkit-DiLTL1ZM.cjs} +49 -36
- package/dist/copilotkit-DiLTL1ZM.cjs.map +1 -0
- package/dist/index.cjs +1 -1
- package/dist/index.mjs +1 -1
- package/dist/index.umd.js +17 -15
- package/dist/index.umd.js.map +1 -1
- package/dist/v2/headless.cjs +17 -15
- package/dist/v2/headless.cjs.map +1 -1
- package/dist/v2/headless.mjs +17 -15
- package/dist/v2/headless.mjs.map +1 -1
- package/dist/v2/index.cjs +1 -1
- package/dist/v2/index.mjs +1 -1
- package/dist/v2/index.umd.js +48 -35
- package/dist/v2/index.umd.js.map +1 -1
- package/package.json +7 -7
- package/skills/react-core/references/threads.md +1 -2
- package/dist/copilotkit-DL0LvmwQ.mjs.map +0 -1
- package/dist/copilotkit-rYTwMndy.cjs.map +0 -1
package/dist/v2/headless.cjs
CHANGED
|
@@ -314,17 +314,15 @@ function useAgent({ agentId, updates, throttleMs } = {}) {
|
|
|
314
314
|
const status = copilotkit.runtimeConnectionStatus;
|
|
315
315
|
if (isRuntimeConfigured && (status === _copilotkit_core.CopilotKitCoreRuntimeConnectionStatus.Disconnected || status === _copilotkit_core.CopilotKitCoreRuntimeConnectionStatus.Connecting)) {
|
|
316
316
|
const cached = provisionalAgentCache.current.get(resolvedAgentId);
|
|
317
|
-
if (cached) {
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
isReady: false
|
|
322
|
-
};
|
|
323
|
-
}
|
|
317
|
+
if (cached) return {
|
|
318
|
+
agent: cached,
|
|
319
|
+
isReady: false
|
|
320
|
+
};
|
|
324
321
|
const provisional = new _copilotkit_core.ProxiedCopilotRuntimeAgent({
|
|
325
322
|
runtimeUrl: copilotkit.runtimeUrl,
|
|
326
323
|
agentId: resolvedAgentId,
|
|
327
324
|
transport: copilotkit.runtimeTransport,
|
|
325
|
+
credentials: copilotkit.credentials,
|
|
328
326
|
runtimeMode: "pending"
|
|
329
327
|
});
|
|
330
328
|
copilotkit.applyHeadersToAgent(provisional);
|
|
@@ -336,17 +334,15 @@ function useAgent({ agentId, updates, throttleMs } = {}) {
|
|
|
336
334
|
}
|
|
337
335
|
if (isRuntimeConfigured && status === _copilotkit_core.CopilotKitCoreRuntimeConnectionStatus.Error) {
|
|
338
336
|
const cached = provisionalAgentCache.current.get(resolvedAgentId);
|
|
339
|
-
if (cached) {
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
isReady: false
|
|
344
|
-
};
|
|
345
|
-
}
|
|
337
|
+
if (cached) return {
|
|
338
|
+
agent: cached,
|
|
339
|
+
isReady: false
|
|
340
|
+
};
|
|
346
341
|
const provisional = new _copilotkit_core.ProxiedCopilotRuntimeAgent({
|
|
347
342
|
runtimeUrl: copilotkit.runtimeUrl,
|
|
348
343
|
agentId: resolvedAgentId,
|
|
349
344
|
transport: copilotkit.runtimeTransport,
|
|
345
|
+
credentials: copilotkit.credentials,
|
|
350
346
|
runtimeMode: "pending"
|
|
351
347
|
});
|
|
352
348
|
copilotkit.applyHeadersToAgent(provisional);
|
|
@@ -365,6 +361,7 @@ function useAgent({ agentId, updates, throttleMs } = {}) {
|
|
|
365
361
|
copilotkit.runtimeConnectionStatus,
|
|
366
362
|
copilotkit.runtimeUrl,
|
|
367
363
|
copilotkit.runtimeTransport,
|
|
364
|
+
copilotkit.credentials,
|
|
368
365
|
JSON.stringify(copilotkit.headers)
|
|
369
366
|
]);
|
|
370
367
|
(0, react.useEffect)(() => {
|
|
@@ -404,7 +401,12 @@ function useAgent({ agentId, updates, throttleMs } = {}) {
|
|
|
404
401
|
]);
|
|
405
402
|
(0, react.useEffect)(() => {
|
|
406
403
|
if (agent instanceof _ag_ui_client.HttpAgent) copilotkit.applyHeadersToAgent(agent);
|
|
407
|
-
|
|
404
|
+
if (agent instanceof _copilotkit_core.ProxiedCopilotRuntimeAgent) agent.credentials = copilotkit.credentials;
|
|
405
|
+
}, [
|
|
406
|
+
agent,
|
|
407
|
+
JSON.stringify(copilotkit.headers),
|
|
408
|
+
copilotkit.credentials
|
|
409
|
+
]);
|
|
408
410
|
const configThreadId = chatConfig?.threadId;
|
|
409
411
|
const configHasExplicitThreadId = chatConfig?.hasExplicitThreadId;
|
|
410
412
|
(0, react.useEffect)(() => {
|