@copilotkitnext/runtime 0.0.10 → 0.0.12
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/index.js +19 -2
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +19 -2
- package/dist/index.mjs.map +1 -1
- package/package.json +2 -2
package/dist/index.mjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// package.json
|
|
2
2
|
var package_default = {
|
|
3
3
|
name: "@copilotkitnext/runtime",
|
|
4
|
-
version: "0.0.
|
|
4
|
+
version: "0.0.12",
|
|
5
5
|
description: "Server-side runtime package for CopilotKit2",
|
|
6
6
|
main: "dist/index.js",
|
|
7
7
|
types: "dist/index.d.ts",
|
|
@@ -494,7 +494,24 @@ async function handleRunAgent({
|
|
|
494
494
|
}
|
|
495
495
|
);
|
|
496
496
|
}
|
|
497
|
-
const
|
|
497
|
+
const registeredAgent = agents[agentId];
|
|
498
|
+
const agent = registeredAgent.clone();
|
|
499
|
+
if (agent && "headers" in agent) {
|
|
500
|
+
const shouldForward = (headerName) => {
|
|
501
|
+
const lower = headerName.toLowerCase();
|
|
502
|
+
return lower === "authorization" || lower.startsWith("x-");
|
|
503
|
+
};
|
|
504
|
+
const forwardableHeaders = {};
|
|
505
|
+
request.headers.forEach((value, key) => {
|
|
506
|
+
if (shouldForward(key)) {
|
|
507
|
+
forwardableHeaders[key] = value;
|
|
508
|
+
}
|
|
509
|
+
});
|
|
510
|
+
agent.headers = {
|
|
511
|
+
...agent.headers,
|
|
512
|
+
...forwardableHeaders
|
|
513
|
+
};
|
|
514
|
+
}
|
|
498
515
|
const stream = new TransformStream();
|
|
499
516
|
const writer = stream.writable.getWriter();
|
|
500
517
|
const encoder = new EventEncoder();
|