@copilotkit/react-core 1.63.3-canary.rc-1 → 1.64.0
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.mjs
CHANGED
|
@@ -285,17 +285,15 @@ function useAgent({ agentId, updates, throttleMs } = {}) {
|
|
|
285
285
|
const status = copilotkit.runtimeConnectionStatus;
|
|
286
286
|
if (isRuntimeConfigured && (status === CopilotKitCoreRuntimeConnectionStatus.Disconnected || status === CopilotKitCoreRuntimeConnectionStatus.Connecting)) {
|
|
287
287
|
const cached = provisionalAgentCache.current.get(resolvedAgentId);
|
|
288
|
-
if (cached) {
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
isReady: false
|
|
293
|
-
};
|
|
294
|
-
}
|
|
288
|
+
if (cached) return {
|
|
289
|
+
agent: cached,
|
|
290
|
+
isReady: false
|
|
291
|
+
};
|
|
295
292
|
const provisional = new ProxiedCopilotRuntimeAgent({
|
|
296
293
|
runtimeUrl: copilotkit.runtimeUrl,
|
|
297
294
|
agentId: resolvedAgentId,
|
|
298
295
|
transport: copilotkit.runtimeTransport,
|
|
296
|
+
credentials: copilotkit.credentials,
|
|
299
297
|
runtimeMode: "pending"
|
|
300
298
|
});
|
|
301
299
|
copilotkit.applyHeadersToAgent(provisional);
|
|
@@ -307,17 +305,15 @@ function useAgent({ agentId, updates, throttleMs } = {}) {
|
|
|
307
305
|
}
|
|
308
306
|
if (isRuntimeConfigured && status === CopilotKitCoreRuntimeConnectionStatus.Error) {
|
|
309
307
|
const cached = provisionalAgentCache.current.get(resolvedAgentId);
|
|
310
|
-
if (cached) {
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
isReady: false
|
|
315
|
-
};
|
|
316
|
-
}
|
|
308
|
+
if (cached) return {
|
|
309
|
+
agent: cached,
|
|
310
|
+
isReady: false
|
|
311
|
+
};
|
|
317
312
|
const provisional = new ProxiedCopilotRuntimeAgent({
|
|
318
313
|
runtimeUrl: copilotkit.runtimeUrl,
|
|
319
314
|
agentId: resolvedAgentId,
|
|
320
315
|
transport: copilotkit.runtimeTransport,
|
|
316
|
+
credentials: copilotkit.credentials,
|
|
321
317
|
runtimeMode: "pending"
|
|
322
318
|
});
|
|
323
319
|
copilotkit.applyHeadersToAgent(provisional);
|
|
@@ -336,6 +332,7 @@ function useAgent({ agentId, updates, throttleMs } = {}) {
|
|
|
336
332
|
copilotkit.runtimeConnectionStatus,
|
|
337
333
|
copilotkit.runtimeUrl,
|
|
338
334
|
copilotkit.runtimeTransport,
|
|
335
|
+
copilotkit.credentials,
|
|
339
336
|
JSON.stringify(copilotkit.headers)
|
|
340
337
|
]);
|
|
341
338
|
useEffect(() => {
|
|
@@ -375,7 +372,12 @@ function useAgent({ agentId, updates, throttleMs } = {}) {
|
|
|
375
372
|
]);
|
|
376
373
|
useEffect(() => {
|
|
377
374
|
if (agent instanceof HttpAgent) copilotkit.applyHeadersToAgent(agent);
|
|
378
|
-
|
|
375
|
+
if (agent instanceof ProxiedCopilotRuntimeAgent) agent.credentials = copilotkit.credentials;
|
|
376
|
+
}, [
|
|
377
|
+
agent,
|
|
378
|
+
JSON.stringify(copilotkit.headers),
|
|
379
|
+
copilotkit.credentials
|
|
380
|
+
]);
|
|
379
381
|
const configThreadId = chatConfig?.threadId;
|
|
380
382
|
const configHasExplicitThreadId = chatConfig?.hasExplicitThreadId;
|
|
381
383
|
useEffect(() => {
|