@copilotkit/runtime 1.8.10-next.0 → 1.8.10-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 +13 -0
- package/dist/{chunk-MSBLW6TU.mjs → chunk-34Z6UB6N.mjs} +2 -2
- package/dist/{chunk-F2DLMRBK.mjs → chunk-L57B2EB7.mjs} +2 -2
- package/dist/{chunk-2ICQTCH3.mjs → chunk-R3Z3JTED.mjs} +29 -28
- package/dist/chunk-R3Z3JTED.mjs.map +1 -0
- package/dist/{chunk-PRF2YJTA.mjs → chunk-WOYBKZKY.mjs} +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.js +28 -27
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +4 -4
- package/dist/lib/index.d.ts +2 -2
- package/dist/lib/index.js +28 -27
- package/dist/lib/index.js.map +1 -1
- package/dist/lib/index.mjs +4 -4
- package/dist/lib/integrations/index.d.ts +3 -3
- package/dist/lib/integrations/index.js +6 -6
- package/dist/lib/integrations/index.js.map +1 -1
- package/dist/lib/integrations/index.mjs +4 -4
- package/dist/lib/integrations/nest/index.d.ts +2 -2
- package/dist/lib/integrations/nest/index.js +6 -6
- 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.d.ts +2 -2
- package/dist/lib/integrations/node-express/index.js +6 -6
- 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.d.ts +2 -2
- package/dist/lib/integrations/node-http/index.js +6 -6
- package/dist/lib/integrations/node-http/index.js.map +1 -1
- package/dist/lib/integrations/node-http/index.mjs +1 -1
- package/dist/{shared-a7b30781.d.ts → shared-ede87417.d.ts} +1 -1
- package/package.json +7 -7
- package/src/lib/runtime/agentwire-action.ts +7 -9
- package/src/lib/runtime/copilot-runtime.ts +1 -1
- package/src/lib/runtime/remote-actions.ts +1 -1
- package/src/lib/runtime/remote-lg-action.ts +37 -24
- package/dist/chunk-2ICQTCH3.mjs.map +0 -1
- /package/dist/{chunk-MSBLW6TU.mjs.map → chunk-34Z6UB6N.mjs.map} +0 -0
- /package/dist/{chunk-F2DLMRBK.mjs.map → chunk-L57B2EB7.mjs.map} +0 -0
- /package/dist/{chunk-PRF2YJTA.mjs.map → chunk-WOYBKZKY.mjs.map} +0 -0
|
@@ -2,7 +2,7 @@ import {
|
|
|
2
2
|
copilotRuntimeNodeHttpEndpoint,
|
|
3
3
|
getRuntimeInstanceTelemetryInfo,
|
|
4
4
|
telemetry_client_default
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-R3Z3JTED.mjs";
|
|
6
6
|
import {
|
|
7
7
|
__name
|
|
8
8
|
} from "./chunk-FHD4JECV.mjs";
|
|
@@ -22,4 +22,4 @@ __name(copilotRuntimeNodeExpressEndpoint, "copilotRuntimeNodeExpressEndpoint");
|
|
|
22
22
|
export {
|
|
23
23
|
copilotRuntimeNodeExpressEndpoint
|
|
24
24
|
};
|
|
25
|
-
//# sourceMappingURL=chunk-
|
|
25
|
+
//# sourceMappingURL=chunk-WOYBKZKY.mjs.map
|
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
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-4848f8e8.js';
|
|
2
|
-
export { e as CommonConfig, C as CopilotRequestContextProperties, k as CopilotRuntime, j as CopilotRuntimeConstructorParams, f as CopilotRuntimeLogger, i as CopilotRuntimeRequest, b as CreateCopilotRuntimeServerOptions, G as GraphQLContext, L as LogLevel, o as MCPClient, p as MCPEndpointConfig, M as MCPTool, a as addCustomHeaderPlugin, d as buildSchema, s as convertMCPToolsToActions, m as copilotKitEndpoint, c as createContext, h as createLogger, q as extractParametersFromSchema, l as flattenToolCallsNoDuplicates, t as generateMcpToolInstructions, g as getCommonConfig, n as langGraphPlatformEndpoint, r as resolveEndpointType } from './shared-
|
|
2
|
+
export { e as CommonConfig, C as CopilotRequestContextProperties, k as CopilotRuntime, j as CopilotRuntimeConstructorParams, f as CopilotRuntimeLogger, i as CopilotRuntimeRequest, b as CreateCopilotRuntimeServerOptions, G as GraphQLContext, L as LogLevel, o as MCPClient, p as MCPEndpointConfig, M as MCPTool, a as addCustomHeaderPlugin, d as buildSchema, s as convertMCPToolsToActions, m as copilotKitEndpoint, c as createContext, h as createLogger, q as extractParametersFromSchema, l as flattenToolCallsNoDuplicates, t as generateMcpToolInstructions, g as getCommonConfig, n as langGraphPlatformEndpoint, r as resolveEndpointType } from './shared-ede87417.js';
|
|
3
3
|
export { CopilotRuntimeServerInstance, config, copilotRuntimeNextJSAppRouterEndpoint, copilotRuntimeNextJSPagesRouterEndpoint } from './lib/integrations/index.js';
|
|
4
4
|
export { copilotRuntimeNodeHttpEndpoint } from './lib/integrations/node-http/index.js';
|
|
5
5
|
export { copilotRuntimeNodeExpressEndpoint } from './lib/integrations/node-express/index.js';
|
|
@@ -19,6 +19,6 @@ import '@copilotkit/shared';
|
|
|
19
19
|
import './index-d4614f9b.js';
|
|
20
20
|
import './graphql/types/base/index.js';
|
|
21
21
|
import './lib/cloud/index.js';
|
|
22
|
-
import '@
|
|
22
|
+
import '@ag-ui/client';
|
|
23
23
|
import 'rxjs';
|
|
24
24
|
import '@anthropic-ai/sdk';
|
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.8.10-next.
|
|
47
|
+
version: "1.8.10-next.2",
|
|
48
48
|
sideEffects: false,
|
|
49
49
|
main: "./dist/index.js",
|
|
50
50
|
module: "./dist/index.mjs",
|
|
@@ -81,17 +81,17 @@ var require_package = __commonJS({
|
|
|
81
81
|
"zod-to-json-schema": "^3.23.5"
|
|
82
82
|
},
|
|
83
83
|
dependencies: {
|
|
84
|
-
"@
|
|
85
|
-
"@
|
|
86
|
-
"@
|
|
87
|
-
"@
|
|
84
|
+
"@ag-ui/client": "^0.0.27",
|
|
85
|
+
"@ag-ui/core": "^0.0.27",
|
|
86
|
+
"@ag-ui/encoder": "^0.0.27",
|
|
87
|
+
"@ag-ui/proto": "^0.0.27",
|
|
88
88
|
"@anthropic-ai/sdk": "^0.27.3",
|
|
89
89
|
"@copilotkit/shared": "workspace:*",
|
|
90
90
|
"@graphql-yoga/plugin-defer-stream": "^3.3.1",
|
|
91
91
|
"@langchain/community": "^0.3.29",
|
|
92
92
|
"@langchain/core": "^0.3.38",
|
|
93
93
|
"@langchain/google-gauth": "^0.1.0",
|
|
94
|
-
"@langchain/langgraph-sdk": "^0.0.
|
|
94
|
+
"@langchain/langgraph-sdk": "^0.0.70",
|
|
95
95
|
"@langchain/openai": "^0.4.2",
|
|
96
96
|
"class-transformer": "^0.5.1",
|
|
97
97
|
"class-validator": "^0.14.1",
|
|
@@ -3010,7 +3010,7 @@ async function execute(args) {
|
|
|
3010
3010
|
}
|
|
3011
3011
|
__name(execute, "execute");
|
|
3012
3012
|
async function streamEvents(controller, args) {
|
|
3013
|
-
var _a, _b, _c, _d, _e, _f, _g, _h
|
|
3013
|
+
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
3014
3014
|
const { deploymentUrl, langsmithApiKey, threadId: argsInitialThreadId, agent, nodeName: initialNodeName, state: initialState, config: explicitConfig, messages, actions, logger: logger2, properties, metaEvents } = args;
|
|
3015
3015
|
let nodeName = initialNodeName;
|
|
3016
3016
|
let state = initialState;
|
|
@@ -3151,18 +3151,19 @@ async function streamEvents(controller, args) {
|
|
|
3151
3151
|
telemetry_client_default.capture("oss.runtime.agent_execution_stream_started", {
|
|
3152
3152
|
hashedLgcKey: streamInfo.hashedLgcKey
|
|
3153
3153
|
});
|
|
3154
|
-
for await (
|
|
3154
|
+
for await (let streamResponseChunk of streamResponse) {
|
|
3155
3155
|
if (![
|
|
3156
3156
|
"events",
|
|
3157
3157
|
"values",
|
|
3158
3158
|
"error",
|
|
3159
3159
|
"updates"
|
|
3160
|
-
].includes(
|
|
3160
|
+
].includes(streamResponseChunk.event))
|
|
3161
3161
|
continue;
|
|
3162
|
-
if (
|
|
3163
|
-
throw new Error(`Error event thrown: ${
|
|
3162
|
+
if (streamResponseChunk.event === "error") {
|
|
3163
|
+
throw new Error(`Error event thrown: ${streamResponseChunk.data.message}`);
|
|
3164
3164
|
}
|
|
3165
|
-
const
|
|
3165
|
+
const chunk = streamResponseChunk;
|
|
3166
|
+
const interruptEvents = chunk.data.__interrupt__;
|
|
3166
3167
|
if (interruptEvents == null ? void 0 : interruptEvents.length) {
|
|
3167
3168
|
activeInterruptEvent = true;
|
|
3168
3169
|
const interruptValue = interruptEvents == null ? void 0 : interruptEvents[0].value;
|
|
@@ -3183,20 +3184,20 @@ async function streamEvents(controller, args) {
|
|
|
3183
3184
|
}
|
|
3184
3185
|
continue;
|
|
3185
3186
|
}
|
|
3186
|
-
if (
|
|
3187
|
+
if (streamResponseChunk.event === "updates")
|
|
3187
3188
|
continue;
|
|
3188
|
-
if (
|
|
3189
|
+
if (streamResponseChunk.event === "values") {
|
|
3189
3190
|
latestStateValues = chunk.data;
|
|
3190
3191
|
continue;
|
|
3191
3192
|
}
|
|
3192
|
-
const
|
|
3193
|
-
const currentNodeName =
|
|
3194
|
-
const eventType =
|
|
3195
|
-
const runId =
|
|
3193
|
+
const chunkData = chunk.data;
|
|
3194
|
+
const currentNodeName = chunkData.metadata.langgraph_node;
|
|
3195
|
+
const eventType = chunkData.event;
|
|
3196
|
+
const runId = chunkData.metadata.run_id;
|
|
3196
3197
|
externalRunId = runId;
|
|
3197
|
-
const metadata =
|
|
3198
|
-
if (((
|
|
3199
|
-
streamInfo.provider = (
|
|
3198
|
+
const metadata = chunkData.metadata;
|
|
3199
|
+
if (((_b = (_a = chunkData.data) == null ? void 0 : _a.output) == null ? void 0 : _b.model) != null && ((_d = (_c = chunkData.data) == null ? void 0 : _c.output) == null ? void 0 : _d.model) != "") {
|
|
3200
|
+
streamInfo.provider = (_f = (_e = chunkData.data) == null ? void 0 : _e.output) == null ? void 0 : _f.model;
|
|
3200
3201
|
}
|
|
3201
3202
|
if (metadata.langgraph_host != null && metadata.langgraph_host != "") {
|
|
3202
3203
|
streamInfo.langGraphHost = metadata.langgraph_host;
|
|
@@ -3204,9 +3205,9 @@ async function streamEvents(controller, args) {
|
|
|
3204
3205
|
if (metadata.langgraph_version != null && metadata.langgraph_version != "") {
|
|
3205
3206
|
streamInfo.langGraphVersion = metadata.langgraph_version;
|
|
3206
3207
|
}
|
|
3207
|
-
shouldExit = shouldExit || eventType === LangGraphEventTypes.OnCustomEvent &&
|
|
3208
|
+
shouldExit = shouldExit || eventType === LangGraphEventTypes.OnCustomEvent && chunkData.name === CustomEventNames.CopilotKitExit;
|
|
3208
3209
|
const emitIntermediateState = metadata["copilotkit:emit-intermediate-state"];
|
|
3209
|
-
const manuallyEmitIntermediateState = eventType === LangGraphEventTypes.OnCustomEvent &&
|
|
3210
|
+
const manuallyEmitIntermediateState = eventType === LangGraphEventTypes.OnCustomEvent && chunkData.name === CustomEventNames.CopilotKitManuallyEmitIntermediateState;
|
|
3210
3211
|
const exitingNode = nodeName === currentNodeName && eventType === LangGraphEventTypes.OnChainEnd;
|
|
3211
3212
|
if (exitingNode) {
|
|
3212
3213
|
manuallyEmittedState = null;
|
|
@@ -3219,7 +3220,7 @@ async function streamEvents(controller, args) {
|
|
|
3219
3220
|
continue;
|
|
3220
3221
|
}
|
|
3221
3222
|
if (manuallyEmitIntermediateState) {
|
|
3222
|
-
manuallyEmittedState =
|
|
3223
|
+
manuallyEmittedState = chunkData.data;
|
|
3223
3224
|
emit(getStateSyncEvent({
|
|
3224
3225
|
threadId,
|
|
3225
3226
|
runId,
|
|
@@ -3239,7 +3240,7 @@ async function streamEvents(controller, args) {
|
|
|
3239
3240
|
streamingStateExtractor = new StreamingStateExtractor(emitIntermediateState);
|
|
3240
3241
|
}
|
|
3241
3242
|
if (emitIntermediateState && eventType === LangGraphEventTypes.OnChatModelStream) {
|
|
3242
|
-
streamingStateExtractor.bufferToolCalls(
|
|
3243
|
+
streamingStateExtractor.bufferToolCalls(chunkData);
|
|
3243
3244
|
}
|
|
3244
3245
|
if (emitIntermediateStateUntilEnd !== null) {
|
|
3245
3246
|
updatedState = {
|
|
@@ -3264,10 +3265,10 @@ async function streamEvents(controller, args) {
|
|
|
3264
3265
|
schemaKeys
|
|
3265
3266
|
}));
|
|
3266
3267
|
}
|
|
3267
|
-
emit(JSON.stringify(
|
|
3268
|
+
emit(JSON.stringify(chunkData) + "\n");
|
|
3268
3269
|
}
|
|
3269
3270
|
state = await client.threads.getState(threadId);
|
|
3270
|
-
const interrupts = (
|
|
3271
|
+
const interrupts = (_h = (_g = state.tasks) == null ? void 0 : _g[0]) == null ? void 0 : _h.interrupts;
|
|
3271
3272
|
nodeName = interrupts ? nodeName : Object.keys(state.metadata.writes)[0];
|
|
3272
3273
|
const isEndNode = state.next.length === 0 && !interrupts;
|
|
3273
3274
|
telemetry_client_default.capture("oss.runtime.agent_execution_stream_ended", streamInfo);
|