@copilotkit/runtime 1.8.10-next.1 → 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.
Files changed (40) hide show
  1. package/CHANGELOG.md +7 -0
  2. package/dist/{chunk-TIJIKNRW.mjs → chunk-34Z6UB6N.mjs} +2 -2
  3. package/dist/{chunk-QT6WWDGM.mjs → chunk-L57B2EB7.mjs} +2 -2
  4. package/dist/{chunk-2UGQMYRO.mjs → chunk-R3Z3JTED.mjs} +29 -28
  5. package/dist/chunk-R3Z3JTED.mjs.map +1 -0
  6. package/dist/{chunk-DLKNGWDL.mjs → chunk-WOYBKZKY.mjs} +2 -2
  7. package/dist/index.d.ts +2 -2
  8. package/dist/index.js +28 -27
  9. package/dist/index.js.map +1 -1
  10. package/dist/index.mjs +4 -4
  11. package/dist/lib/index.d.ts +2 -2
  12. package/dist/lib/index.js +28 -27
  13. package/dist/lib/index.js.map +1 -1
  14. package/dist/lib/index.mjs +4 -4
  15. package/dist/lib/integrations/index.d.ts +3 -3
  16. package/dist/lib/integrations/index.js +6 -6
  17. package/dist/lib/integrations/index.js.map +1 -1
  18. package/dist/lib/integrations/index.mjs +4 -4
  19. package/dist/lib/integrations/nest/index.d.ts +2 -2
  20. package/dist/lib/integrations/nest/index.js +6 -6
  21. package/dist/lib/integrations/nest/index.js.map +1 -1
  22. package/dist/lib/integrations/nest/index.mjs +2 -2
  23. package/dist/lib/integrations/node-express/index.d.ts +2 -2
  24. package/dist/lib/integrations/node-express/index.js +6 -6
  25. package/dist/lib/integrations/node-express/index.js.map +1 -1
  26. package/dist/lib/integrations/node-express/index.mjs +2 -2
  27. package/dist/lib/integrations/node-http/index.d.ts +2 -2
  28. package/dist/lib/integrations/node-http/index.js +6 -6
  29. package/dist/lib/integrations/node-http/index.js.map +1 -1
  30. package/dist/lib/integrations/node-http/index.mjs +1 -1
  31. package/dist/{shared-a7b30781.d.ts → shared-ede87417.d.ts} +1 -1
  32. package/package.json +7 -7
  33. package/src/lib/runtime/agentwire-action.ts +7 -9
  34. package/src/lib/runtime/copilot-runtime.ts +1 -1
  35. package/src/lib/runtime/remote-actions.ts +1 -1
  36. package/src/lib/runtime/remote-lg-action.ts +37 -24
  37. package/dist/chunk-2UGQMYRO.mjs.map +0 -1
  38. /package/dist/{chunk-TIJIKNRW.mjs.map → chunk-34Z6UB6N.mjs.map} +0 -0
  39. /package/dist/{chunk-QT6WWDGM.mjs.map → chunk-L57B2EB7.mjs.map} +0 -0
  40. /package/dist/{chunk-DLKNGWDL.mjs.map → chunk-WOYBKZKY.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-TIJIKNRW.mjs";
6
+ } from "./chunk-34Z6UB6N.mjs";
7
7
  import {
8
8
  copilotRuntimeNestEndpoint
9
- } from "./chunk-QT6WWDGM.mjs";
9
+ } from "./chunk-L57B2EB7.mjs";
10
10
  import {
11
11
  copilotRuntimeNodeExpressEndpoint
12
- } from "./chunk-DLKNGWDL.mjs";
12
+ } from "./chunk-WOYBKZKY.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-2UGQMYRO.mjs";
28
+ } from "./chunk-R3Z3JTED.mjs";
29
29
  import {
30
30
  AnthropicAdapter,
31
31
  EmptyAdapter,
@@ -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-a7b30781.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-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 '@agentwire/client';
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.1",
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
- "@agentwire/client": "0.0.26",
85
- "@agentwire/proto": "0.0.26",
86
- "@agentwire/core": "0.0.26",
87
- "@agentwire/encoder": "0.0.26",
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.36",
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, _i;
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 (const chunk of streamResponse) {
3145
+ for await (let streamResponseChunk of streamResponse) {
3146
3146
  if (![
3147
3147
  "events",
3148
3148
  "values",
3149
3149
  "error",
3150
3150
  "updates"
3151
- ].includes(chunk.event))
3151
+ ].includes(streamResponseChunk.event))
3152
3152
  continue;
3153
- if (chunk.event === "error") {
3154
- throw new Error(`Error event thrown: ${chunk.data.message}`);
3153
+ if (streamResponseChunk.event === "error") {
3154
+ throw new Error(`Error event thrown: ${streamResponseChunk.data.message}`);
3155
3155
  }
3156
- const interruptEvents = (_a = chunk.data) == null ? void 0 : _a.__interrupt__;
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 (chunk.event === "updates")
3178
+ if (streamResponseChunk.event === "updates")
3178
3179
  continue;
3179
- if (chunk.event === "values") {
3180
+ if (streamResponseChunk.event === "values") {
3180
3181
  latestStateValues = chunk.data;
3181
3182
  continue;
3182
3183
  }
3183
- const event = chunk.data;
3184
- const currentNodeName = event.metadata.langgraph_node;
3185
- const eventType = event.event;
3186
- const runId = event.metadata.run_id;
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 = event.metadata;
3189
- if (((_c = (_b = event.data) == null ? void 0 : _b.output) == null ? void 0 : _c.model) != null && ((_e = (_d = event.data) == null ? void 0 : _d.output) == null ? void 0 : _e.model) != "") {
3190
- streamInfo.provider = (_g = (_f = event.data) == null ? void 0 : _f.output) == null ? void 0 : _g.model;
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 && event.name === CustomEventNames.CopilotKitExit;
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 && event.name === CustomEventNames.CopilotKitManuallyEmitIntermediateState;
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 = event.data;
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(event);
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(event) + "\n");
3259
+ emit(JSON.stringify(chunkData) + "\n");
3259
3260
  }
3260
3261
  state = await client.threads.getState(threadId);
3261
- const interrupts = (_i = (_h = state.tasks) == null ? void 0 : _h[0]) == null ? void 0 : _i.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);