@copilotkit/runtime 1.5.15-next.2 → 1.5.15-next.3
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 +7 -0
- package/dist/{chunk-4KT3HMC3.mjs → chunk-EV3MMEAZ.mjs} +29 -11
- package/dist/chunk-EV3MMEAZ.mjs.map +1 -0
- package/dist/{chunk-I33ESKDS.mjs → chunk-I2OII4XX.mjs} +2 -2
- package/dist/{chunk-OTB2F27M.mjs → chunk-KPOZF6JI.mjs} +2 -2
- package/dist/{chunk-C2HNOETE.mjs → chunk-WPJHMQDF.mjs} +2 -2
- package/dist/index.js +23 -5
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +4 -4
- package/dist/lib/index.js +23 -5
- package/dist/lib/index.js.map +1 -1
- package/dist/lib/index.mjs +4 -4
- package/dist/lib/integrations/index.js +1 -1
- package/dist/lib/integrations/index.js.map +1 -1
- package/dist/lib/integrations/index.mjs +4 -4
- package/dist/lib/integrations/nest/index.js +1 -1
- package/dist/lib/integrations/nest/index.js.map +1 -1
- package/dist/lib/integrations/nest/index.mjs +2 -2
- package/dist/lib/integrations/node-express/index.js +1 -1
- package/dist/lib/integrations/node-express/index.js.map +1 -1
- package/dist/lib/integrations/node-express/index.mjs +2 -2
- package/dist/lib/integrations/node-http/index.js +1 -1
- package/dist/lib/integrations/node-http/index.js.map +1 -1
- package/dist/lib/integrations/node-http/index.mjs +1 -1
- package/package.json +2 -2
- package/src/lib/runtime/copilot-runtime.ts +10 -0
- package/src/lib/runtime/remote-lg-action.ts +11 -2
- package/dist/chunk-4KT3HMC3.mjs.map +0 -1
- /package/dist/{chunk-I33ESKDS.mjs.map → chunk-I2OII4XX.mjs.map} +0 -0
- /package/dist/{chunk-OTB2F27M.mjs.map → chunk-KPOZF6JI.mjs.map} +0 -0
- /package/dist/{chunk-C2HNOETE.mjs.map → chunk-WPJHMQDF.mjs.map} +0 -0
package/package.json
CHANGED
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
"publishConfig": {
|
|
10
10
|
"access": "public"
|
|
11
11
|
},
|
|
12
|
-
"version": "1.5.15-next.
|
|
12
|
+
"version": "1.5.15-next.3",
|
|
13
13
|
"sideEffects": false,
|
|
14
14
|
"main": "./dist/index.js",
|
|
15
15
|
"module": "./dist/index.mjs",
|
|
@@ -58,7 +58,7 @@
|
|
|
58
58
|
"rxjs": "^7.8.1",
|
|
59
59
|
"type-graphql": "2.0.0-rc.1",
|
|
60
60
|
"zod": "^3.23.3",
|
|
61
|
-
"@copilotkit/shared": "1.5.15-next.
|
|
61
|
+
"@copilotkit/shared": "1.5.15-next.3"
|
|
62
62
|
},
|
|
63
63
|
"keywords": [
|
|
64
64
|
"copilotkit",
|
|
@@ -319,9 +319,14 @@ please use an LLM adapter instead.`,
|
|
|
319
319
|
async (acc: Promise<Agent[]>, endpoint) => {
|
|
320
320
|
const agents = await acc;
|
|
321
321
|
if (endpoint.type === EndpointType.LangGraphPlatform) {
|
|
322
|
+
const propertyHeaders = graphqlContext.properties.authorization
|
|
323
|
+
? { authorization: `Bearer ${graphqlContext.properties.authorization}` }
|
|
324
|
+
: null;
|
|
325
|
+
|
|
322
326
|
const client = new LangGraphClient({
|
|
323
327
|
apiUrl: endpoint.deploymentUrl,
|
|
324
328
|
apiKey: endpoint.langsmithApiKey,
|
|
329
|
+
defaultHeaders: { ...propertyHeaders },
|
|
325
330
|
});
|
|
326
331
|
|
|
327
332
|
const data: Array<{ assistant_id: string; graph_id: string }> =
|
|
@@ -392,9 +397,14 @@ please use an LLM adapter instead.`,
|
|
|
392
397
|
const headers = createHeaders(null, graphqlContext);
|
|
393
398
|
|
|
394
399
|
if (agentWithEndpoint.endpoint.type === EndpointType.LangGraphPlatform) {
|
|
400
|
+
const propertyHeaders = graphqlContext.properties.authorization
|
|
401
|
+
? { authorization: `Bearer ${graphqlContext.properties.authorization}` }
|
|
402
|
+
: null;
|
|
403
|
+
|
|
395
404
|
const client = new LangGraphClient({
|
|
396
405
|
apiUrl: agentWithEndpoint.endpoint.deploymentUrl,
|
|
397
406
|
apiKey: agentWithEndpoint.endpoint.langsmithApiKey,
|
|
407
|
+
defaultHeaders: { ...propertyHeaders },
|
|
398
408
|
});
|
|
399
409
|
let state: any = {};
|
|
400
410
|
try {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Client } from "@langchain/langgraph-sdk";
|
|
1
|
+
import { Client as LangGraphClient } from "@langchain/langgraph-sdk";
|
|
2
2
|
import { createHash } from "node:crypto";
|
|
3
3
|
import { randomUUID, isValidUUID } from "@copilotkit/shared";
|
|
4
4
|
import { parse as parsePartialJson } from "partial-json";
|
|
@@ -84,13 +84,22 @@ async function streamEvents(controller: ReadableStreamDefaultController, args: E
|
|
|
84
84
|
messages,
|
|
85
85
|
actions,
|
|
86
86
|
logger,
|
|
87
|
+
properties,
|
|
87
88
|
} = args;
|
|
88
89
|
|
|
89
90
|
let nodeName = initialNodeName;
|
|
90
91
|
let state = initialState;
|
|
91
92
|
const { name, assistantId: initialAssistantId } = agent;
|
|
92
93
|
|
|
93
|
-
const
|
|
94
|
+
const propertyHeaders = properties.authorization
|
|
95
|
+
? { authorization: `Bearer ${properties.authorization}` }
|
|
96
|
+
: null;
|
|
97
|
+
|
|
98
|
+
const client = new LangGraphClient({
|
|
99
|
+
apiUrl: deploymentUrl,
|
|
100
|
+
apiKey: langsmithApiKey,
|
|
101
|
+
defaultHeaders: { ...propertyHeaders },
|
|
102
|
+
});
|
|
94
103
|
|
|
95
104
|
let threadId = argsInitialThreadId ?? randomUUID();
|
|
96
105
|
if (argsInitialThreadId && argsInitialThreadId.startsWith("ck-")) {
|