@copilotkit/runtime 1.5.16-next.0 → 1.5.16-next.2
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-D2WLFQS6.mjs → chunk-2OZAGFV3.mjs} +2 -2
- package/dist/{chunk-U3V2BCGI.mjs → chunk-5BIEM2UU.mjs} +2 -2
- package/dist/chunk-FHD4JECV.mjs +33 -0
- package/dist/{chunk-4TED7LNT.mjs → chunk-ISPCKW3E.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/{chunk-COJRNPCX.mjs → chunk-TBPOHFA4.mjs} +3 -3
- package/dist/{chunk-P5J3JGOI.mjs → chunk-U5OA7VEB.mjs} +35 -18
- package/dist/chunk-U5OA7VEB.mjs.map +1 -0
- package/dist/{chunk-PIUZJXE7.mjs → chunk-UHUC2NVB.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 +28 -11
- 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 +28 -11
- 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 +15 -6
- 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 +13 -6
- 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 +13 -6
- 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 +13 -6
- 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 +5 -5
- package/src/graphql/resolvers/copilot.resolver.ts +1 -4
- package/src/lib/integrations/shared.ts +9 -1
- package/src/lib/runtime/remote-lg-action.ts +13 -3
- package/tsconfig.json +1 -0
- package/dist/chunk-44O2JGUY.mjs +0 -12
- package/dist/chunk-P5J3JGOI.mjs.map +0 -1
- /package/dist/{chunk-D2WLFQS6.mjs.map → chunk-2OZAGFV3.mjs.map} +0 -0
- /package/dist/{chunk-U3V2BCGI.mjs.map → chunk-5BIEM2UU.mjs.map} +0 -0
- /package/dist/{chunk-44O2JGUY.mjs.map → chunk-FHD4JECV.mjs.map} +0 -0
- /package/dist/{chunk-4TED7LNT.mjs.map → chunk-ISPCKW3E.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/{chunk-COJRNPCX.mjs.map → chunk-TBPOHFA4.mjs.map} +0 -0
- /package/dist/{chunk-PIUZJXE7.mjs.map → chunk-UHUC2NVB.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-UHUC2NVB.mjs";
|
|
7
7
|
import {
|
|
8
8
|
copilotRuntimeNestEndpoint
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-ISPCKW3E.mjs";
|
|
10
10
|
import {
|
|
11
11
|
copilotRuntimeNodeExpressEndpoint
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-TBPOHFA4.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-U5OA7VEB.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.16-next.
|
|
47
|
+
version: "1.5.16-next.2",
|
|
48
48
|
sideEffects: false,
|
|
49
49
|
main: "./dist/index.js",
|
|
50
50
|
module: "./dist/index.mjs",
|
|
@@ -84,11 +84,11 @@ var require_package = __commonJS({
|
|
|
84
84
|
"@anthropic-ai/sdk": "^0.27.3",
|
|
85
85
|
"@copilotkit/shared": "workspace:*",
|
|
86
86
|
"@graphql-yoga/plugin-defer-stream": "^3.3.1",
|
|
87
|
-
"@langchain/community": "^0.
|
|
88
|
-
"@langchain/core": "^0.3.
|
|
87
|
+
"@langchain/community": "^0.3.29",
|
|
88
|
+
"@langchain/core": "^0.3.38",
|
|
89
89
|
"@langchain/google-gauth": "^0.1.0",
|
|
90
90
|
"@langchain/langgraph-sdk": "^0.0.36",
|
|
91
|
-
"@langchain/openai": "^0.
|
|
91
|
+
"@langchain/openai": "^0.4.2",
|
|
92
92
|
"class-transformer": "^0.5.1",
|
|
93
93
|
express: "^4.19.2",
|
|
94
94
|
graphql: "^16.8.1",
|
|
@@ -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,
|
|
@@ -2207,9 +2208,16 @@ async function streamEvents(controller, args) {
|
|
|
2207
2208
|
};
|
|
2208
2209
|
}
|
|
2209
2210
|
if (lgInterruptMetaEvent == null ? void 0 : lgInterruptMetaEvent.response) {
|
|
2210
|
-
|
|
2211
|
-
|
|
2212
|
-
|
|
2211
|
+
let response = lgInterruptMetaEvent.response;
|
|
2212
|
+
try {
|
|
2213
|
+
payload.command = {
|
|
2214
|
+
resume: JSON.parse(response)
|
|
2215
|
+
};
|
|
2216
|
+
} catch (e) {
|
|
2217
|
+
payload.command = {
|
|
2218
|
+
resume: response
|
|
2219
|
+
};
|
|
2220
|
+
}
|
|
2213
2221
|
}
|
|
2214
2222
|
if (mode === "continue" && !activeInterruptEvent) {
|
|
2215
2223
|
await client.threads.updateState(threadId, {
|
|
@@ -2269,17 +2277,18 @@ async function streamEvents(controller, args) {
|
|
|
2269
2277
|
activeInterruptEvent = true;
|
|
2270
2278
|
const interruptValue = interruptEvents == null ? void 0 : interruptEvents[0].value;
|
|
2271
2279
|
if (typeof interruptValue != "string" && "__copilotkit_interrupt_value__" in interruptValue) {
|
|
2280
|
+
const evValue = interruptValue.__copilotkit_interrupt_value__;
|
|
2272
2281
|
emit(JSON.stringify({
|
|
2273
2282
|
event: LangGraphEventTypes.OnCopilotKitInterrupt,
|
|
2274
2283
|
data: {
|
|
2275
|
-
value:
|
|
2284
|
+
value: typeof evValue === "string" ? evValue : JSON.stringify(evValue),
|
|
2276
2285
|
messages: langchainMessagesToCopilotKit(interruptValue.__copilotkit_messages__)
|
|
2277
2286
|
}
|
|
2278
2287
|
}) + "\n");
|
|
2279
2288
|
} else {
|
|
2280
2289
|
emit(JSON.stringify({
|
|
2281
2290
|
event: LangGraphEventTypes.OnInterrupt,
|
|
2282
|
-
value: interruptValue
|
|
2291
|
+
value: typeof interruptValue === "string" ? interruptValue : JSON.stringify(interruptValue)
|
|
2283
2292
|
}) + "\n");
|
|
2284
2293
|
}
|
|
2285
2294
|
continue;
|
|
@@ -4944,7 +4953,7 @@ var CopilotResolver = class {
|
|
|
4944
4953
|
type: event.type,
|
|
4945
4954
|
name: event.name,
|
|
4946
4955
|
data: {
|
|
4947
|
-
value:
|
|
4956
|
+
value: event.data.value,
|
|
4948
4957
|
messages: event.data.messages.map((message) => {
|
|
4949
4958
|
if (message.type === "TextMessage" || "content" in message && "role" in message) {
|
|
4950
4959
|
return (0, import_class_transformer3.plainToInstance)(TextMessage, {
|
|
@@ -5455,7 +5464,13 @@ StateResolver = _ts_decorate22([
|
|
|
5455
5464
|
], StateResolver);
|
|
5456
5465
|
|
|
5457
5466
|
// src/lib/integrations/shared.ts
|
|
5467
|
+
var packageJson2 = __toESM(require_package());
|
|
5458
5468
|
var logger = createLogger();
|
|
5469
|
+
var addCustomHeaderPlugin = {
|
|
5470
|
+
onResponse({ response }) {
|
|
5471
|
+
response.headers.set("X-CopilotKit-Runtime-Version", packageJson2.version);
|
|
5472
|
+
}
|
|
5473
|
+
};
|
|
5459
5474
|
async function createContext(initialContext, copilotKitContext, contextLogger, properties = {}) {
|
|
5460
5475
|
logger.debug({
|
|
5461
5476
|
copilotKitContext
|
|
@@ -5521,7 +5536,8 @@ function getCommonConfig(options) {
|
|
|
5521
5536
|
}),
|
|
5522
5537
|
schema: buildSchema(),
|
|
5523
5538
|
plugins: [
|
|
5524
|
-
(0, import_plugin_defer_stream.useDeferStream)()
|
|
5539
|
+
(0, import_plugin_defer_stream.useDeferStream)(),
|
|
5540
|
+
addCustomHeaderPlugin
|
|
5525
5541
|
],
|
|
5526
5542
|
context: (ctx) => createContext(ctx, options, contextLogger, options.properties)
|
|
5527
5543
|
};
|
|
@@ -5651,6 +5667,7 @@ __name(copilotRuntimeNestEndpoint, "copilotRuntimeNestEndpoint");
|
|
|
5651
5667
|
OpenAIAdapter,
|
|
5652
5668
|
OpenAIAssistantAdapter,
|
|
5653
5669
|
UnifyAdapter,
|
|
5670
|
+
addCustomHeaderPlugin,
|
|
5654
5671
|
buildSchema,
|
|
5655
5672
|
config,
|
|
5656
5673
|
copilotKitEndpoint,
|