@copilotkit/runtime 1.5.17 → 1.5.18-next.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/CHANGELOG.md +15 -0
- package/dist/{chunk-HEPCIATE.mjs → chunk-2NWLEHMA.mjs} +27 -13
- package/dist/chunk-2NWLEHMA.mjs.map +1 -0
- package/dist/{chunk-D2WLFQS6.mjs → chunk-2OZAGFV3.mjs} +2 -2
- package/dist/{chunk-UHSPX2BM.mjs → chunk-326WWZNE.mjs} +3 -3
- package/dist/{chunk-U3V2BCGI.mjs → chunk-5BIEM2UU.mjs} +2 -2
- package/dist/{chunk-CPZLKCKJ.mjs → chunk-CJZ7QUXU.mjs} +3 -3
- package/dist/chunk-FHD4JECV.mjs +33 -0
- package/dist/{chunk-SPBICTJF.mjs → chunk-OS4N57XE.mjs} +3 -3
- package/dist/{chunk-S3KKBII4.mjs → chunk-OS5YD32G.mjs} +2 -2
- package/dist/{chunk-HNUNXFTW.mjs → chunk-RTFJTJMA.mjs} +3 -3
- package/dist/{copilot-runtime-3e7f1c7b.d.ts → copilot-runtime-084fb9c7.d.ts} +6 -1
- package/dist/graphql/types/base/index.mjs +2 -2
- package/dist/graphql/types/converted/index.mjs +3 -3
- package/dist/index.d.ts +1 -1
- package/dist/index.js +20 -6
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +11 -9
- package/dist/index.mjs.map +1 -1
- package/dist/lib/index.d.ts +1 -1
- package/dist/lib/index.js +20 -6
- package/dist/lib/index.js.map +1 -1
- package/dist/lib/index.mjs +11 -9
- package/dist/lib/integrations/index.d.ts +2 -2
- package/dist/lib/integrations/index.js +17 -3
- package/dist/lib/integrations/index.js.map +1 -1
- package/dist/lib/integrations/index.mjs +11 -9
- package/dist/lib/integrations/nest/index.d.ts +1 -1
- package/dist/lib/integrations/nest/index.js +15 -3
- package/dist/lib/integrations/nest/index.js.map +1 -1
- package/dist/lib/integrations/nest/index.mjs +7 -7
- package/dist/lib/integrations/node-express/index.d.ts +1 -1
- package/dist/lib/integrations/node-express/index.js +15 -3
- package/dist/lib/integrations/node-express/index.js.map +1 -1
- package/dist/lib/integrations/node-express/index.mjs +7 -7
- package/dist/lib/integrations/node-http/index.d.ts +1 -1
- package/dist/lib/integrations/node-http/index.js +15 -3
- package/dist/lib/integrations/node-http/index.js.map +1 -1
- package/dist/lib/integrations/node-http/index.mjs +6 -6
- package/dist/service-adapters/index.mjs +2 -2
- package/dist/utils/index.mjs +2 -2
- package/package.json +2 -2
- package/src/graphql/resolvers/state.resolver.ts +6 -1
- package/src/lib/integrations/shared.ts +9 -1
- package/src/lib/runtime/copilot-runtime.ts +2 -2
- package/src/lib/runtime/remote-lg-action.ts +1 -1
- package/tsconfig.json +1 -0
- package/dist/chunk-44O2JGUY.mjs +0 -12
- package/dist/chunk-HEPCIATE.mjs.map +0 -1
- /package/dist/{chunk-D2WLFQS6.mjs.map → chunk-2OZAGFV3.mjs.map} +0 -0
- /package/dist/{chunk-UHSPX2BM.mjs.map → chunk-326WWZNE.mjs.map} +0 -0
- /package/dist/{chunk-U3V2BCGI.mjs.map → chunk-5BIEM2UU.mjs.map} +0 -0
- /package/dist/{chunk-CPZLKCKJ.mjs.map → chunk-CJZ7QUXU.mjs.map} +0 -0
- /package/dist/{chunk-44O2JGUY.mjs.map → chunk-FHD4JECV.mjs.map} +0 -0
- /package/dist/{chunk-SPBICTJF.mjs.map → chunk-OS4N57XE.mjs.map} +0 -0
- /package/dist/{chunk-S3KKBII4.mjs.map → chunk-OS5YD32G.mjs.map} +0 -0
- /package/dist/{chunk-HNUNXFTW.mjs.map → chunk-RTFJTJMA.mjs.map} +0 -0
package/dist/index.mjs
CHANGED
|
@@ -3,15 +3,16 @@ import {
|
|
|
3
3
|
config,
|
|
4
4
|
copilotRuntimeNextJSAppRouterEndpoint,
|
|
5
5
|
copilotRuntimeNextJSPagesRouterEndpoint
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-326WWZNE.mjs";
|
|
7
7
|
import {
|
|
8
8
|
copilotRuntimeNestEndpoint
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-CJZ7QUXU.mjs";
|
|
10
10
|
import {
|
|
11
11
|
copilotRuntimeNodeExpressEndpoint
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-OS4N57XE.mjs";
|
|
13
13
|
import {
|
|
14
14
|
CopilotRuntime,
|
|
15
|
+
addCustomHeaderPlugin,
|
|
15
16
|
buildSchema,
|
|
16
17
|
copilotKitEndpoint,
|
|
17
18
|
copilotRuntimeNodeHttpEndpoint,
|
|
@@ -20,7 +21,7 @@ import {
|
|
|
20
21
|
getCommonConfig,
|
|
21
22
|
langGraphPlatformEndpoint,
|
|
22
23
|
resolveEndpointType
|
|
23
|
-
} from "./chunk-
|
|
24
|
+
} from "./chunk-2NWLEHMA.mjs";
|
|
24
25
|
import {
|
|
25
26
|
AnthropicAdapter,
|
|
26
27
|
EmptyAdapter,
|
|
@@ -33,15 +34,15 @@ import {
|
|
|
33
34
|
OpenAIAssistantAdapter,
|
|
34
35
|
RemoteChain,
|
|
35
36
|
UnifyAdapter
|
|
36
|
-
} from "./chunk-
|
|
37
|
+
} from "./chunk-OS5YD32G.mjs";
|
|
37
38
|
import {
|
|
38
39
|
GuardrailsValidationFailureResponse,
|
|
39
40
|
MessageStreamInterruptedResponse,
|
|
40
41
|
UnknownErrorResponse
|
|
41
|
-
} from "./chunk-
|
|
42
|
-
import "./chunk-
|
|
43
|
-
import "./chunk-
|
|
44
|
-
import "./chunk-
|
|
42
|
+
} from "./chunk-5BIEM2UU.mjs";
|
|
43
|
+
import "./chunk-RTFJTJMA.mjs";
|
|
44
|
+
import "./chunk-2OZAGFV3.mjs";
|
|
45
|
+
import "./chunk-FHD4JECV.mjs";
|
|
45
46
|
|
|
46
47
|
// src/index.ts
|
|
47
48
|
import "reflect-metadata";
|
|
@@ -61,6 +62,7 @@ export {
|
|
|
61
62
|
RemoteChain,
|
|
62
63
|
UnifyAdapter,
|
|
63
64
|
UnknownErrorResponse,
|
|
65
|
+
addCustomHeaderPlugin,
|
|
64
66
|
buildSchema,
|
|
65
67
|
config,
|
|
66
68
|
copilotKitEndpoint,
|
package/dist/index.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/index.ts"],"sourcesContent":["import \"reflect-metadata\";\nexport * from \"./lib\";\nexport * from \"./utils\";\nexport * from \"./service-adapters\";\n"],"mappings":"
|
|
1
|
+
{"version":3,"sources":["../src/index.ts"],"sourcesContent":["import \"reflect-metadata\";\nexport * from \"./lib\";\nexport * from \"./utils\";\nexport * from \"./service-adapters\";\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,OAAO;","names":[]}
|
package/dist/lib/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export {
|
|
1
|
+
export { i as CommonConfig, d as CopilotRequestContextProperties, a as CopilotRuntime, C as CopilotRuntimeConstructorParams, e as CreateCopilotRuntimeServerOptions, G as GraphQLContext, b as addCustomHeaderPlugin, h as buildSchema, c as copilotKitEndpoint, g as createContext, f as flattenToolCallsNoDuplicates, j as getCommonConfig, l as langGraphPlatformEndpoint, r as resolveEndpointType } from '../copilot-runtime-084fb9c7.js';
|
|
2
2
|
export { G as GoogleGenerativeAIAdapter, f as GroqAdapter, e as GroqAdapterParams, L as LangChainAdapter, a as OpenAIAdapter, O as OpenAIAdapterParams, c as OpenAIAssistantAdapter, b as OpenAIAssistantAdapterParams, d as UnifyAdapter, U as UnifyAdapterParams } from '../groq-adapter-3b894689.js';
|
|
3
3
|
export { CopilotRuntimeServerInstance, config, copilotRuntimeNextJSAppRouterEndpoint, copilotRuntimeNextJSPagesRouterEndpoint } from './integrations/index.js';
|
|
4
4
|
export { copilotRuntimeNodeHttpEndpoint } from './integrations/node-http/index.js';
|
package/dist/lib/index.js
CHANGED
|
@@ -44,7 +44,7 @@ var require_package = __commonJS({
|
|
|
44
44
|
publishConfig: {
|
|
45
45
|
access: "public"
|
|
46
46
|
},
|
|
47
|
-
version: "1.5.
|
|
47
|
+
version: "1.5.18-next.1",
|
|
48
48
|
sideEffects: false,
|
|
49
49
|
main: "./dist/index.js",
|
|
50
50
|
module: "./dist/index.mjs",
|
|
@@ -131,6 +131,7 @@ __export(lib_exports, {
|
|
|
131
131
|
OpenAIAdapter: () => OpenAIAdapter,
|
|
132
132
|
OpenAIAssistantAdapter: () => OpenAIAssistantAdapter,
|
|
133
133
|
UnifyAdapter: () => UnifyAdapter,
|
|
134
|
+
addCustomHeaderPlugin: () => addCustomHeaderPlugin,
|
|
134
135
|
buildSchema: () => buildSchema,
|
|
135
136
|
config: () => config,
|
|
136
137
|
copilotKitEndpoint: () => copilotKitEndpoint,
|
|
@@ -2299,7 +2300,7 @@ async function streamEvents(controller, args) {
|
|
|
2299
2300
|
continue;
|
|
2300
2301
|
}
|
|
2301
2302
|
const event = chunk.data;
|
|
2302
|
-
const currentNodeName = event.
|
|
2303
|
+
const currentNodeName = event.metadata.langgraph_node;
|
|
2303
2304
|
const eventType = event.event;
|
|
2304
2305
|
const runId = event.metadata.run_id;
|
|
2305
2306
|
externalRunId = runId;
|
|
@@ -3738,7 +3739,7 @@ please use an LLM adapter instead.`
|
|
|
3738
3739
|
}
|
|
3739
3740
|
if (Object.keys(state).length === 0) {
|
|
3740
3741
|
return {
|
|
3741
|
-
threadId,
|
|
3742
|
+
threadId: threadId || "",
|
|
3742
3743
|
threadExists: false,
|
|
3743
3744
|
state: JSON.stringify({}),
|
|
3744
3745
|
messages: JSON.stringify([])
|
|
@@ -3747,7 +3748,7 @@ please use an LLM adapter instead.`
|
|
|
3747
3748
|
const { messages, ...stateWithoutMessages } = state;
|
|
3748
3749
|
const copilotkitMessages = langchainMessagesToCopilotKit(messages);
|
|
3749
3750
|
return {
|
|
3750
|
-
threadId,
|
|
3751
|
+
threadId: threadId || "",
|
|
3751
3752
|
threadExists: true,
|
|
3752
3753
|
state: JSON.stringify(stateWithoutMessages),
|
|
3753
3754
|
messages: JSON.stringify(copilotkitMessages)
|
|
@@ -5440,7 +5441,12 @@ var StateResolver = class {
|
|
|
5440
5441
|
const agents = await ctx._copilotkit.runtime.discoverAgentsFromEndpoints(ctx);
|
|
5441
5442
|
const agent = agents.find((agent2) => agent2.name === data.agentName);
|
|
5442
5443
|
if (!agent) {
|
|
5443
|
-
|
|
5444
|
+
return {
|
|
5445
|
+
threadId: data.threadId || "",
|
|
5446
|
+
threadExists: false,
|
|
5447
|
+
state: JSON.stringify({}),
|
|
5448
|
+
messages: JSON.stringify([])
|
|
5449
|
+
};
|
|
5444
5450
|
}
|
|
5445
5451
|
const state = await ctx._copilotkit.runtime.loadAgentState(ctx, data.threadId, data.agentName);
|
|
5446
5452
|
return state;
|
|
@@ -5463,7 +5469,13 @@ StateResolver = _ts_decorate22([
|
|
|
5463
5469
|
], StateResolver);
|
|
5464
5470
|
|
|
5465
5471
|
// src/lib/integrations/shared.ts
|
|
5472
|
+
var packageJson2 = __toESM(require_package());
|
|
5466
5473
|
var logger = createLogger();
|
|
5474
|
+
var addCustomHeaderPlugin = {
|
|
5475
|
+
onResponse({ response }) {
|
|
5476
|
+
response.headers.set("X-CopilotKit-Runtime-Version", packageJson2.version);
|
|
5477
|
+
}
|
|
5478
|
+
};
|
|
5467
5479
|
async function createContext(initialContext, copilotKitContext, contextLogger, properties = {}) {
|
|
5468
5480
|
logger.debug({
|
|
5469
5481
|
copilotKitContext
|
|
@@ -5529,7 +5541,8 @@ function getCommonConfig(options) {
|
|
|
5529
5541
|
}),
|
|
5530
5542
|
schema: buildSchema(),
|
|
5531
5543
|
plugins: [
|
|
5532
|
-
(0, import_plugin_defer_stream.useDeferStream)()
|
|
5544
|
+
(0, import_plugin_defer_stream.useDeferStream)(),
|
|
5545
|
+
addCustomHeaderPlugin
|
|
5533
5546
|
],
|
|
5534
5547
|
context: (ctx) => createContext(ctx, options, contextLogger, options.properties)
|
|
5535
5548
|
};
|
|
@@ -5659,6 +5672,7 @@ __name(copilotRuntimeNestEndpoint, "copilotRuntimeNestEndpoint");
|
|
|
5659
5672
|
OpenAIAdapter,
|
|
5660
5673
|
OpenAIAssistantAdapter,
|
|
5661
5674
|
UnifyAdapter,
|
|
5675
|
+
addCustomHeaderPlugin,
|
|
5662
5676
|
buildSchema,
|
|
5663
5677
|
config,
|
|
5664
5678
|
copilotKitEndpoint,
|