@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/lib/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
|
GoogleGenerativeAIAdapter,
|
|
26
27
|
GroqAdapter,
|
|
@@ -28,11 +29,11 @@ import {
|
|
|
28
29
|
OpenAIAdapter,
|
|
29
30
|
OpenAIAssistantAdapter,
|
|
30
31
|
UnifyAdapter
|
|
31
|
-
} from "../chunk-
|
|
32
|
-
import "../chunk-
|
|
33
|
-
import "../chunk-
|
|
34
|
-
import "../chunk-
|
|
35
|
-
import "../chunk-
|
|
32
|
+
} from "../chunk-OS5YD32G.mjs";
|
|
33
|
+
import "../chunk-5BIEM2UU.mjs";
|
|
34
|
+
import "../chunk-RTFJTJMA.mjs";
|
|
35
|
+
import "../chunk-2OZAGFV3.mjs";
|
|
36
|
+
import "../chunk-FHD4JECV.mjs";
|
|
36
37
|
export {
|
|
37
38
|
CopilotRuntime,
|
|
38
39
|
GoogleGenerativeAIAdapter,
|
|
@@ -41,6 +42,7 @@ export {
|
|
|
41
42
|
OpenAIAdapter,
|
|
42
43
|
OpenAIAssistantAdapter,
|
|
43
44
|
UnifyAdapter,
|
|
45
|
+
addCustomHeaderPlugin,
|
|
44
46
|
buildSchema,
|
|
45
47
|
config,
|
|
46
48
|
copilotKitEndpoint,
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export {
|
|
1
|
+
import { e as CreateCopilotRuntimeServerOptions, G as GraphQLContext } from '../../copilot-runtime-084fb9c7.js';
|
|
2
|
+
export { i as CommonConfig, d as CopilotRequestContextProperties, b as addCustomHeaderPlugin, h as buildSchema, g as createContext, j as getCommonConfig } from '../../copilot-runtime-084fb9c7.js';
|
|
3
3
|
import * as graphql_yoga from 'graphql-yoga';
|
|
4
4
|
import { YogaServerInstance } from 'graphql-yoga';
|
|
5
5
|
export { copilotRuntimeNodeHttpEndpoint } from './node-http/index.js';
|
|
@@ -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",
|
|
@@ -124,6 +124,7 @@ var require_package = __commonJS({
|
|
|
124
124
|
// src/lib/integrations/index.ts
|
|
125
125
|
var integrations_exports = {};
|
|
126
126
|
__export(integrations_exports, {
|
|
127
|
+
addCustomHeaderPlugin: () => addCustomHeaderPlugin,
|
|
127
128
|
buildSchema: () => buildSchema,
|
|
128
129
|
config: () => config,
|
|
129
130
|
copilotRuntimeNestEndpoint: () => copilotRuntimeNestEndpoint,
|
|
@@ -2538,7 +2539,12 @@ var StateResolver = class {
|
|
|
2538
2539
|
const agents = await ctx._copilotkit.runtime.discoverAgentsFromEndpoints(ctx);
|
|
2539
2540
|
const agent = agents.find((agent2) => agent2.name === data.agentName);
|
|
2540
2541
|
if (!agent) {
|
|
2541
|
-
|
|
2542
|
+
return {
|
|
2543
|
+
threadId: data.threadId || "",
|
|
2544
|
+
threadExists: false,
|
|
2545
|
+
state: JSON.stringify({}),
|
|
2546
|
+
messages: JSON.stringify([])
|
|
2547
|
+
};
|
|
2542
2548
|
}
|
|
2543
2549
|
const state = await ctx._copilotkit.runtime.loadAgentState(ctx, data.threadId, data.agentName);
|
|
2544
2550
|
return state;
|
|
@@ -2561,7 +2567,13 @@ StateResolver = _ts_decorate22([
|
|
|
2561
2567
|
], StateResolver);
|
|
2562
2568
|
|
|
2563
2569
|
// src/lib/integrations/shared.ts
|
|
2570
|
+
var packageJson2 = __toESM(require_package());
|
|
2564
2571
|
var logger = createLogger();
|
|
2572
|
+
var addCustomHeaderPlugin = {
|
|
2573
|
+
onResponse({ response }) {
|
|
2574
|
+
response.headers.set("X-CopilotKit-Runtime-Version", packageJson2.version);
|
|
2575
|
+
}
|
|
2576
|
+
};
|
|
2565
2577
|
async function createContext(initialContext, copilotKitContext, contextLogger, properties = {}) {
|
|
2566
2578
|
logger.debug({
|
|
2567
2579
|
copilotKitContext
|
|
@@ -2627,7 +2639,8 @@ function getCommonConfig(options) {
|
|
|
2627
2639
|
}),
|
|
2628
2640
|
schema: buildSchema(),
|
|
2629
2641
|
plugins: [
|
|
2630
|
-
(0, import_plugin_defer_stream.useDeferStream)()
|
|
2642
|
+
(0, import_plugin_defer_stream.useDeferStream)(),
|
|
2643
|
+
addCustomHeaderPlugin
|
|
2631
2644
|
],
|
|
2632
2645
|
context: (ctx) => createContext(ctx, options, contextLogger, options.properties)
|
|
2633
2646
|
};
|
|
@@ -2750,6 +2763,7 @@ function copilotRuntimeNestEndpoint(options) {
|
|
|
2750
2763
|
__name(copilotRuntimeNestEndpoint, "copilotRuntimeNestEndpoint");
|
|
2751
2764
|
// Annotate the CommonJS export names for ESM import in node:
|
|
2752
2765
|
0 && (module.exports = {
|
|
2766
|
+
addCustomHeaderPlugin,
|
|
2753
2767
|
buildSchema,
|
|
2754
2768
|
config,
|
|
2755
2769
|
copilotRuntimeNestEndpoint,
|