@copilotkit/runtime 1.8.10-next.1 → 1.8.10-next.3
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-2UGQMYRO.mjs → chunk-A2KFGHTN.mjs} +29 -28
- package/dist/chunk-A2KFGHTN.mjs.map +1 -0
- package/dist/{chunk-DLKNGWDL.mjs → chunk-B7ZBOJTY.mjs} +2 -2
- package/dist/{chunk-TIJIKNRW.mjs → chunk-TBRXNHCZ.mjs} +2 -2
- package/dist/{chunk-QT6WWDGM.mjs → chunk-UME6DDXP.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-2UGQMYRO.mjs.map +0 -1
- /package/dist/{chunk-DLKNGWDL.mjs.map → chunk-B7ZBOJTY.mjs.map} +0 -0
- /package/dist/{chunk-TIJIKNRW.mjs.map → chunk-TBRXNHCZ.mjs.map} +0 -0
- /package/dist/{chunk-QT6WWDGM.mjs.map → chunk-UME6DDXP.mjs.map} +0 -0
package/dist/index.mjs
CHANGED
|
@@ -3,13 +3,13 @@ import {
|
|
|
3
3
|
config,
|
|
4
4
|
copilotRuntimeNextJSAppRouterEndpoint,
|
|
5
5
|
copilotRuntimeNextJSPagesRouterEndpoint
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-TBRXNHCZ.mjs";
|
|
7
7
|
import {
|
|
8
8
|
copilotRuntimeNestEndpoint
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-UME6DDXP.mjs";
|
|
10
10
|
import {
|
|
11
11
|
copilotRuntimeNodeExpressEndpoint
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-B7ZBOJTY.mjs";
|
|
13
13
|
import {
|
|
14
14
|
CopilotRuntime,
|
|
15
15
|
addCustomHeaderPlugin,
|
|
@@ -25,7 +25,7 @@ import {
|
|
|
25
25
|
getCommonConfig,
|
|
26
26
|
langGraphPlatformEndpoint,
|
|
27
27
|
resolveEndpointType
|
|
28
|
-
} from "./chunk-
|
|
28
|
+
} from "./chunk-A2KFGHTN.mjs";
|
|
29
29
|
import {
|
|
30
30
|
AnthropicAdapter,
|
|
31
31
|
EmptyAdapter,
|
package/dist/lib/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 './integrations/index.js';
|
|
4
4
|
export { copilotRuntimeNodeHttpEndpoint } from './integrations/node-http/index.js';
|
|
5
5
|
export { copilotRuntimeNodeExpressEndpoint } from './integrations/node-express/index.js';
|
|
@@ -18,4 +18,4 @@ import 'graphql';
|
|
|
18
18
|
import 'pino';
|
|
19
19
|
import 'graphql-yoga';
|
|
20
20
|
import './cloud/index.js';
|
|
21
|
-
import '@
|
|
21
|
+
import '@ag-ui/client';
|
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.8.10-next.
|
|
47
|
+
version: "1.8.10-next.3",
|
|
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",
|
|
@@ -3001,7 +3001,7 @@ async function execute(args) {
|
|
|
3001
3001
|
}
|
|
3002
3002
|
__name(execute, "execute");
|
|
3003
3003
|
async function streamEvents(controller, args) {
|
|
3004
|
-
var _a, _b, _c, _d, _e, _f, _g, _h
|
|
3004
|
+
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
3005
3005
|
const { deploymentUrl, langsmithApiKey, threadId: argsInitialThreadId, agent, nodeName: initialNodeName, state: initialState, config: explicitConfig, messages, actions, logger: logger2, properties, metaEvents } = args;
|
|
3006
3006
|
let nodeName = initialNodeName;
|
|
3007
3007
|
let state = initialState;
|
|
@@ -3142,18 +3142,19 @@ async function streamEvents(controller, args) {
|
|
|
3142
3142
|
telemetry_client_default.capture("oss.runtime.agent_execution_stream_started", {
|
|
3143
3143
|
hashedLgcKey: streamInfo.hashedLgcKey
|
|
3144
3144
|
});
|
|
3145
|
-
for await (
|
|
3145
|
+
for await (let streamResponseChunk of streamResponse) {
|
|
3146
3146
|
if (![
|
|
3147
3147
|
"events",
|
|
3148
3148
|
"values",
|
|
3149
3149
|
"error",
|
|
3150
3150
|
"updates"
|
|
3151
|
-
].includes(
|
|
3151
|
+
].includes(streamResponseChunk.event))
|
|
3152
3152
|
continue;
|
|
3153
|
-
if (
|
|
3154
|
-
throw new Error(`Error event thrown: ${
|
|
3153
|
+
if (streamResponseChunk.event === "error") {
|
|
3154
|
+
throw new Error(`Error event thrown: ${streamResponseChunk.data.message}`);
|
|
3155
3155
|
}
|
|
3156
|
-
const
|
|
3156
|
+
const chunk = streamResponseChunk;
|
|
3157
|
+
const interruptEvents = chunk.data.__interrupt__;
|
|
3157
3158
|
if (interruptEvents == null ? void 0 : interruptEvents.length) {
|
|
3158
3159
|
activeInterruptEvent = true;
|
|
3159
3160
|
const interruptValue = interruptEvents == null ? void 0 : interruptEvents[0].value;
|
|
@@ -3174,20 +3175,20 @@ async function streamEvents(controller, args) {
|
|
|
3174
3175
|
}
|
|
3175
3176
|
continue;
|
|
3176
3177
|
}
|
|
3177
|
-
if (
|
|
3178
|
+
if (streamResponseChunk.event === "updates")
|
|
3178
3179
|
continue;
|
|
3179
|
-
if (
|
|
3180
|
+
if (streamResponseChunk.event === "values") {
|
|
3180
3181
|
latestStateValues = chunk.data;
|
|
3181
3182
|
continue;
|
|
3182
3183
|
}
|
|
3183
|
-
const
|
|
3184
|
-
const currentNodeName =
|
|
3185
|
-
const eventType =
|
|
3186
|
-
const runId =
|
|
3184
|
+
const chunkData = chunk.data;
|
|
3185
|
+
const currentNodeName = chunkData.metadata.langgraph_node;
|
|
3186
|
+
const eventType = chunkData.event;
|
|
3187
|
+
const runId = chunkData.metadata.run_id;
|
|
3187
3188
|
externalRunId = runId;
|
|
3188
|
-
const metadata =
|
|
3189
|
-
if (((
|
|
3190
|
-
streamInfo.provider = (
|
|
3189
|
+
const metadata = chunkData.metadata;
|
|
3190
|
+
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) != "") {
|
|
3191
|
+
streamInfo.provider = (_f = (_e = chunkData.data) == null ? void 0 : _e.output) == null ? void 0 : _f.model;
|
|
3191
3192
|
}
|
|
3192
3193
|
if (metadata.langgraph_host != null && metadata.langgraph_host != "") {
|
|
3193
3194
|
streamInfo.langGraphHost = metadata.langgraph_host;
|
|
@@ -3195,9 +3196,9 @@ async function streamEvents(controller, args) {
|
|
|
3195
3196
|
if (metadata.langgraph_version != null && metadata.langgraph_version != "") {
|
|
3196
3197
|
streamInfo.langGraphVersion = metadata.langgraph_version;
|
|
3197
3198
|
}
|
|
3198
|
-
shouldExit = shouldExit || eventType === LangGraphEventTypes.OnCustomEvent &&
|
|
3199
|
+
shouldExit = shouldExit || eventType === LangGraphEventTypes.OnCustomEvent && chunkData.name === CustomEventNames.CopilotKitExit;
|
|
3199
3200
|
const emitIntermediateState = metadata["copilotkit:emit-intermediate-state"];
|
|
3200
|
-
const manuallyEmitIntermediateState = eventType === LangGraphEventTypes.OnCustomEvent &&
|
|
3201
|
+
const manuallyEmitIntermediateState = eventType === LangGraphEventTypes.OnCustomEvent && chunkData.name === CustomEventNames.CopilotKitManuallyEmitIntermediateState;
|
|
3201
3202
|
const exitingNode = nodeName === currentNodeName && eventType === LangGraphEventTypes.OnChainEnd;
|
|
3202
3203
|
if (exitingNode) {
|
|
3203
3204
|
manuallyEmittedState = null;
|
|
@@ -3210,7 +3211,7 @@ async function streamEvents(controller, args) {
|
|
|
3210
3211
|
continue;
|
|
3211
3212
|
}
|
|
3212
3213
|
if (manuallyEmitIntermediateState) {
|
|
3213
|
-
manuallyEmittedState =
|
|
3214
|
+
manuallyEmittedState = chunkData.data;
|
|
3214
3215
|
emit(getStateSyncEvent({
|
|
3215
3216
|
threadId,
|
|
3216
3217
|
runId,
|
|
@@ -3230,7 +3231,7 @@ async function streamEvents(controller, args) {
|
|
|
3230
3231
|
streamingStateExtractor = new StreamingStateExtractor(emitIntermediateState);
|
|
3231
3232
|
}
|
|
3232
3233
|
if (emitIntermediateState && eventType === LangGraphEventTypes.OnChatModelStream) {
|
|
3233
|
-
streamingStateExtractor.bufferToolCalls(
|
|
3234
|
+
streamingStateExtractor.bufferToolCalls(chunkData);
|
|
3234
3235
|
}
|
|
3235
3236
|
if (emitIntermediateStateUntilEnd !== null) {
|
|
3236
3237
|
updatedState = {
|
|
@@ -3255,10 +3256,10 @@ async function streamEvents(controller, args) {
|
|
|
3255
3256
|
schemaKeys
|
|
3256
3257
|
}));
|
|
3257
3258
|
}
|
|
3258
|
-
emit(JSON.stringify(
|
|
3259
|
+
emit(JSON.stringify(chunkData) + "\n");
|
|
3259
3260
|
}
|
|
3260
3261
|
state = await client.threads.getState(threadId);
|
|
3261
|
-
const interrupts = (
|
|
3262
|
+
const interrupts = (_h = (_g = state.tasks) == null ? void 0 : _g[0]) == null ? void 0 : _h.interrupts;
|
|
3262
3263
|
nodeName = interrupts ? nodeName : Object.keys(state.metadata.writes)[0];
|
|
3263
3264
|
const isEndNode = state.next.length === 0 && !interrupts;
|
|
3264
3265
|
telemetry_client_default.capture("oss.runtime.agent_execution_stream_ended", streamInfo);
|