@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
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
__name
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-FHD4JECV.mjs";
|
|
4
4
|
|
|
5
5
|
// src/graphql/types/base/index.ts
|
|
6
6
|
import { Field, InputType } from "type-graphql";
|
|
@@ -40,4 +40,4 @@ BaseMessageInput = _ts_decorate([
|
|
|
40
40
|
export {
|
|
41
41
|
BaseMessageInput
|
|
42
42
|
};
|
|
43
|
-
//# sourceMappingURL=chunk-
|
|
43
|
+
//# sourceMappingURL=chunk-2OZAGFV3.mjs.map
|
|
@@ -2,10 +2,10 @@ import {
|
|
|
2
2
|
getCommonConfig,
|
|
3
3
|
getRuntimeInstanceTelemetryInfo,
|
|
4
4
|
telemetry_client_default
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-2NWLEHMA.mjs";
|
|
6
6
|
import {
|
|
7
7
|
__name
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-FHD4JECV.mjs";
|
|
9
9
|
|
|
10
10
|
// src/lib/integrations/nextjs/app-router.ts
|
|
11
11
|
import { createYoga } from "graphql-yoga";
|
|
@@ -77,4 +77,4 @@ export {
|
|
|
77
77
|
config,
|
|
78
78
|
copilotRuntimeNextJSPagesRouterEndpoint
|
|
79
79
|
};
|
|
80
|
-
//# sourceMappingURL=chunk-
|
|
80
|
+
//# sourceMappingURL=chunk-326WWZNE.mjs.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
__name
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-FHD4JECV.mjs";
|
|
4
4
|
|
|
5
5
|
// src/graphql/types/response-status.type.ts
|
|
6
6
|
import { GraphQLJSON } from "graphql-scalars";
|
|
@@ -149,4 +149,4 @@ export {
|
|
|
149
149
|
MessageStreamInterruptedResponse,
|
|
150
150
|
UnknownErrorResponse
|
|
151
151
|
};
|
|
152
|
-
//# sourceMappingURL=chunk-
|
|
152
|
+
//# sourceMappingURL=chunk-5BIEM2UU.mjs.map
|
|
@@ -2,10 +2,10 @@ import {
|
|
|
2
2
|
copilotRuntimeNodeHttpEndpoint,
|
|
3
3
|
getRuntimeInstanceTelemetryInfo,
|
|
4
4
|
telemetry_client_default
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-2NWLEHMA.mjs";
|
|
6
6
|
import {
|
|
7
7
|
__name
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-FHD4JECV.mjs";
|
|
9
9
|
|
|
10
10
|
// src/lib/integrations/nest/index.ts
|
|
11
11
|
function copilotRuntimeNestEndpoint(options) {
|
|
@@ -22,4 +22,4 @@ __name(copilotRuntimeNestEndpoint, "copilotRuntimeNestEndpoint");
|
|
|
22
22
|
export {
|
|
23
23
|
copilotRuntimeNestEndpoint
|
|
24
24
|
};
|
|
25
|
-
//# sourceMappingURL=chunk-
|
|
25
|
+
//# sourceMappingURL=chunk-CJZ7QUXU.mjs.map
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
var __create = Object.create;
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
6
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
+
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
|
|
8
|
+
var __commonJS = (cb, mod) => function __require() {
|
|
9
|
+
return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
|
|
10
|
+
};
|
|
11
|
+
var __copyProps = (to, from, except, desc) => {
|
|
12
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
13
|
+
for (let key of __getOwnPropNames(from))
|
|
14
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
15
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
16
|
+
}
|
|
17
|
+
return to;
|
|
18
|
+
};
|
|
19
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
20
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
21
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
22
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
23
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
24
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
25
|
+
mod
|
|
26
|
+
));
|
|
27
|
+
|
|
28
|
+
export {
|
|
29
|
+
__name,
|
|
30
|
+
__commonJS,
|
|
31
|
+
__toESM
|
|
32
|
+
};
|
|
33
|
+
//# sourceMappingURL=chunk-FHD4JECV.mjs.map
|
|
@@ -2,10 +2,10 @@ import {
|
|
|
2
2
|
copilotRuntimeNodeHttpEndpoint,
|
|
3
3
|
getRuntimeInstanceTelemetryInfo,
|
|
4
4
|
telemetry_client_default
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-2NWLEHMA.mjs";
|
|
6
6
|
import {
|
|
7
7
|
__name
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-FHD4JECV.mjs";
|
|
9
9
|
|
|
10
10
|
// src/lib/integrations/node-express/index.ts
|
|
11
11
|
function copilotRuntimeNodeExpressEndpoint(options) {
|
|
@@ -22,4 +22,4 @@ __name(copilotRuntimeNodeExpressEndpoint, "copilotRuntimeNodeExpressEndpoint");
|
|
|
22
22
|
export {
|
|
23
23
|
copilotRuntimeNodeExpressEndpoint
|
|
24
24
|
};
|
|
25
|
-
//# sourceMappingURL=chunk-
|
|
25
|
+
//# sourceMappingURL=chunk-OS4N57XE.mjs.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
__name
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-FHD4JECV.mjs";
|
|
4
4
|
|
|
5
5
|
// src/service-adapters/langchain/langserve.ts
|
|
6
6
|
import { RemoteRunnable } from "langchain/runnables/remote";
|
|
@@ -1419,4 +1419,4 @@ export {
|
|
|
1419
1419
|
EmptyAdapter,
|
|
1420
1420
|
ExperimentalEmptyAdapter
|
|
1421
1421
|
};
|
|
1422
|
-
//# sourceMappingURL=chunk-
|
|
1422
|
+
//# sourceMappingURL=chunk-OS5YD32G.mjs.map
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import {
|
|
2
2
|
BaseMessageInput
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-2OZAGFV3.mjs";
|
|
4
4
|
import {
|
|
5
5
|
__name
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-FHD4JECV.mjs";
|
|
7
7
|
|
|
8
8
|
// src/graphql/types/converted/index.ts
|
|
9
9
|
var Message = class extends BaseMessageInput {
|
|
@@ -126,4 +126,4 @@ export {
|
|
|
126
126
|
ResultMessage,
|
|
127
127
|
AgentStateMessage
|
|
128
128
|
};
|
|
129
|
-
//# sourceMappingURL=chunk-
|
|
129
|
+
//# sourceMappingURL=chunk-RTFJTJMA.mjs.map
|
|
@@ -9,6 +9,11 @@ import { CopilotCloudOptions } from './lib/cloud/index.js';
|
|
|
9
9
|
type LogLevel = "debug" | "info" | "warn" | "error";
|
|
10
10
|
|
|
11
11
|
declare const logger: pino.Logger<never>;
|
|
12
|
+
declare const addCustomHeaderPlugin: {
|
|
13
|
+
onResponse({ response }: {
|
|
14
|
+
response: any;
|
|
15
|
+
}): void;
|
|
16
|
+
};
|
|
12
17
|
type AnyPrimitive = string | boolean | number | null;
|
|
13
18
|
type CopilotRequestContextProperties = Record<string, AnyPrimitive | Record<string, AnyPrimitive>>;
|
|
14
19
|
type GraphQLContext = YogaInitialContext & {
|
|
@@ -210,4 +215,4 @@ declare function copilotKitEndpoint(config: Omit<CopilotKitEndpoint, "type">): C
|
|
|
210
215
|
declare function langGraphPlatformEndpoint(config: Omit<LangGraphPlatformEndpoint, "type">): LangGraphPlatformEndpoint;
|
|
211
216
|
declare function resolveEndpointType(endpoint: EndpointDefinition): EndpointType;
|
|
212
217
|
|
|
213
|
-
export { CopilotRuntimeConstructorParams as C, GraphQLContext as G, CopilotRuntime as a,
|
|
218
|
+
export { CopilotRuntimeConstructorParams as C, GraphQLContext as G, CopilotRuntime as a, addCustomHeaderPlugin as b, copilotKitEndpoint as c, CopilotRequestContextProperties as d, CreateCopilotRuntimeServerOptions as e, flattenToolCallsNoDuplicates as f, createContext as g, buildSchema as h, CommonConfig as i, getCommonConfig as j, langGraphPlatformEndpoint as l, resolveEndpointType as r };
|
|
@@ -4,9 +4,9 @@ import {
|
|
|
4
4
|
Message,
|
|
5
5
|
ResultMessage,
|
|
6
6
|
TextMessage
|
|
7
|
-
} from "../../../chunk-
|
|
8
|
-
import "../../../chunk-
|
|
9
|
-
import "../../../chunk-
|
|
7
|
+
} from "../../../chunk-RTFJTJMA.mjs";
|
|
8
|
+
import "../../../chunk-2OZAGFV3.mjs";
|
|
9
|
+
import "../../../chunk-FHD4JECV.mjs";
|
|
10
10
|
export {
|
|
11
11
|
ActionExecutionMessage,
|
|
12
12
|
AgentStateMessage,
|
package/dist/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 './lib/integrations/index.js';
|
|
4
4
|
export { copilotRuntimeNodeHttpEndpoint } from './lib/integrations/node-http/index.js';
|
package/dist/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",
|
|
@@ -139,6 +139,7 @@ __export(src_exports, {
|
|
|
139
139
|
RemoteChain: () => RemoteChain,
|
|
140
140
|
UnifyAdapter: () => UnifyAdapter,
|
|
141
141
|
UnknownErrorResponse: () => UnknownErrorResponse,
|
|
142
|
+
addCustomHeaderPlugin: () => addCustomHeaderPlugin,
|
|
142
143
|
buildSchema: () => buildSchema,
|
|
143
144
|
config: () => config,
|
|
144
145
|
copilotKitEndpoint: () => copilotKitEndpoint,
|
|
@@ -2635,7 +2636,7 @@ async function streamEvents(controller, args) {
|
|
|
2635
2636
|
continue;
|
|
2636
2637
|
}
|
|
2637
2638
|
const event = chunk.data;
|
|
2638
|
-
const currentNodeName = event.
|
|
2639
|
+
const currentNodeName = event.metadata.langgraph_node;
|
|
2639
2640
|
const eventType = event.event;
|
|
2640
2641
|
const runId = event.metadata.run_id;
|
|
2641
2642
|
externalRunId = runId;
|
|
@@ -4074,7 +4075,7 @@ please use an LLM adapter instead.`
|
|
|
4074
4075
|
}
|
|
4075
4076
|
if (Object.keys(state).length === 0) {
|
|
4076
4077
|
return {
|
|
4077
|
-
threadId,
|
|
4078
|
+
threadId: threadId || "",
|
|
4078
4079
|
threadExists: false,
|
|
4079
4080
|
state: JSON.stringify({}),
|
|
4080
4081
|
messages: JSON.stringify([])
|
|
@@ -4083,7 +4084,7 @@ please use an LLM adapter instead.`
|
|
|
4083
4084
|
const { messages, ...stateWithoutMessages } = state;
|
|
4084
4085
|
const copilotkitMessages = langchainMessagesToCopilotKit(messages);
|
|
4085
4086
|
return {
|
|
4086
|
-
threadId,
|
|
4087
|
+
threadId: threadId || "",
|
|
4087
4088
|
threadExists: true,
|
|
4088
4089
|
state: JSON.stringify(stateWithoutMessages),
|
|
4089
4090
|
messages: JSON.stringify(copilotkitMessages)
|
|
@@ -5776,7 +5777,12 @@ var StateResolver = class {
|
|
|
5776
5777
|
const agents = await ctx._copilotkit.runtime.discoverAgentsFromEndpoints(ctx);
|
|
5777
5778
|
const agent = agents.find((agent2) => agent2.name === data.agentName);
|
|
5778
5779
|
if (!agent) {
|
|
5779
|
-
|
|
5780
|
+
return {
|
|
5781
|
+
threadId: data.threadId || "",
|
|
5782
|
+
threadExists: false,
|
|
5783
|
+
state: JSON.stringify({}),
|
|
5784
|
+
messages: JSON.stringify([])
|
|
5785
|
+
};
|
|
5780
5786
|
}
|
|
5781
5787
|
const state = await ctx._copilotkit.runtime.loadAgentState(ctx, data.threadId, data.agentName);
|
|
5782
5788
|
return state;
|
|
@@ -5799,7 +5805,13 @@ StateResolver = _ts_decorate22([
|
|
|
5799
5805
|
], StateResolver);
|
|
5800
5806
|
|
|
5801
5807
|
// src/lib/integrations/shared.ts
|
|
5808
|
+
var packageJson2 = __toESM(require_package());
|
|
5802
5809
|
var logger = createLogger();
|
|
5810
|
+
var addCustomHeaderPlugin = {
|
|
5811
|
+
onResponse({ response }) {
|
|
5812
|
+
response.headers.set("X-CopilotKit-Runtime-Version", packageJson2.version);
|
|
5813
|
+
}
|
|
5814
|
+
};
|
|
5803
5815
|
async function createContext(initialContext, copilotKitContext, contextLogger, properties = {}) {
|
|
5804
5816
|
logger.debug({
|
|
5805
5817
|
copilotKitContext
|
|
@@ -5865,7 +5877,8 @@ function getCommonConfig(options) {
|
|
|
5865
5877
|
}),
|
|
5866
5878
|
schema: buildSchema(),
|
|
5867
5879
|
plugins: [
|
|
5868
|
-
(0, import_plugin_defer_stream.useDeferStream)()
|
|
5880
|
+
(0, import_plugin_defer_stream.useDeferStream)(),
|
|
5881
|
+
addCustomHeaderPlugin
|
|
5869
5882
|
],
|
|
5870
5883
|
context: (ctx) => createContext(ctx, options, contextLogger, options.properties)
|
|
5871
5884
|
};
|
|
@@ -6003,6 +6016,7 @@ __name(copilotRuntimeNestEndpoint, "copilotRuntimeNestEndpoint");
|
|
|
6003
6016
|
RemoteChain,
|
|
6004
6017
|
UnifyAdapter,
|
|
6005
6018
|
UnknownErrorResponse,
|
|
6019
|
+
addCustomHeaderPlugin,
|
|
6006
6020
|
buildSchema,
|
|
6007
6021
|
config,
|
|
6008
6022
|
copilotKitEndpoint,
|