@copilotkit/runtime 1.3.16-mme-reset-chat.10 → 1.3.16-mme-reset-chat.11

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 (46) hide show
  1. package/CHANGELOG.md +21 -43
  2. package/dist/{chunk-2S6JGN2A.mjs → chunk-NJH4ZBXT.mjs} +2 -2
  3. package/dist/{chunk-TBNMKEWV.mjs → chunk-T2MGJXW2.mjs} +2 -2
  4. package/dist/{chunk-3XICZ4K2.mjs → chunk-XR3QOJ47.mjs} +2 -2
  5. package/dist/{chunk-ODOSADGH.mjs → chunk-YILXJQFD.mjs} +78 -57
  6. package/dist/chunk-YILXJQFD.mjs.map +1 -0
  7. package/dist/{copilot-runtime-b9715bd4.d.ts → copilot-runtime-335a610d.d.ts} +8 -8
  8. package/dist/{groq-adapter-dbfba3eb.d.ts → groq-adapter-2f8fd767.d.ts} +1 -1
  9. package/dist/index.d.ts +3 -3
  10. package/dist/index.js +80 -59
  11. package/dist/index.js.map +1 -1
  12. package/dist/index.mjs +6 -6
  13. package/dist/{langserve-f00629d2.d.ts → langserve-cc06e76e.d.ts} +1 -0
  14. package/dist/lib/index.d.ts +3 -3
  15. package/dist/lib/index.js +80 -59
  16. package/dist/lib/index.js.map +1 -1
  17. package/dist/lib/index.mjs +6 -6
  18. package/dist/lib/integrations/index.d.ts +3 -3
  19. package/dist/lib/integrations/index.js +12 -11
  20. package/dist/lib/integrations/index.js.map +1 -1
  21. package/dist/lib/integrations/index.mjs +4 -4
  22. package/dist/lib/integrations/nest/index.d.ts +2 -2
  23. package/dist/lib/integrations/nest/index.js +12 -11
  24. package/dist/lib/integrations/nest/index.js.map +1 -1
  25. package/dist/lib/integrations/nest/index.mjs +2 -2
  26. package/dist/lib/integrations/node-express/index.d.ts +2 -2
  27. package/dist/lib/integrations/node-express/index.js +12 -11
  28. package/dist/lib/integrations/node-express/index.js.map +1 -1
  29. package/dist/lib/integrations/node-express/index.mjs +2 -2
  30. package/dist/lib/integrations/node-http/index.d.ts +2 -2
  31. package/dist/lib/integrations/node-http/index.js +12 -11
  32. package/dist/lib/integrations/node-http/index.js.map +1 -1
  33. package/dist/lib/integrations/node-http/index.mjs +1 -1
  34. package/dist/service-adapters/index.d.ts +3 -3
  35. package/package.json +4 -4
  36. package/src/agents/langgraph/event-source.ts +2 -2
  37. package/src/lib/runtime/copilot-runtime.ts +40 -33
  38. package/src/lib/runtime/remote-action-constructors.ts +7 -7
  39. package/src/lib/runtime/remote-actions.ts +9 -9
  40. package/src/lib/runtime/{remote-lg-cloud-action.ts → remote-lg-action.ts} +34 -31
  41. package/src/lib/telemetry-client.ts +3 -3
  42. package/src/service-adapters/events.ts +13 -1
  43. package/dist/chunk-ODOSADGH.mjs.map +0 -1
  44. /package/dist/{chunk-2S6JGN2A.mjs.map → chunk-NJH4ZBXT.mjs.map} +0 -0
  45. /package/dist/{chunk-TBNMKEWV.mjs.map → chunk-T2MGJXW2.mjs.map} +0 -0
  46. /package/dist/{chunk-3XICZ4K2.mjs.map → chunk-XR3QOJ47.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-3XICZ4K2.mjs";
6
+ } from "./chunk-XR3QOJ47.mjs";
7
7
  import {
8
8
  copilotRuntimeNestEndpoint
9
- } from "./chunk-TBNMKEWV.mjs";
9
+ } from "./chunk-T2MGJXW2.mjs";
10
10
  import {
11
11
  copilotRuntimeNodeExpressEndpoint
12
- } from "./chunk-2S6JGN2A.mjs";
12
+ } from "./chunk-NJH4ZBXT.mjs";
13
13
  import {
14
14
  CopilotRuntime,
15
15
  buildSchema,
@@ -18,9 +18,9 @@ import {
18
18
  createContext,
19
19
  flattenToolCallsNoDuplicates,
20
20
  getCommonConfig,
21
- langGraphCloudEndpoint,
21
+ langGraphPlatformEndpoint,
22
22
  resolveEndpointType
23
- } from "./chunk-ODOSADGH.mjs";
23
+ } from "./chunk-YILXJQFD.mjs";
24
24
  import {
25
25
  AnthropicAdapter,
26
26
  GoogleGenerativeAIAdapter,
@@ -66,7 +66,7 @@ export {
66
66
  createContext,
67
67
  flattenToolCallsNoDuplicates,
68
68
  getCommonConfig,
69
- langGraphCloudEndpoint,
69
+ langGraphPlatformEndpoint,
70
70
  resolveEndpointType
71
71
  };
72
72
  //# sourceMappingURL=index.mjs.map
@@ -81,6 +81,7 @@ declare class RuntimeEventSource {
81
81
  private eventStream$;
82
82
  private callback;
83
83
  stream(callback: EventSourceCallback): Promise<void>;
84
+ sendErrorMessageToChat(): void;
84
85
  processRuntimeEvents({ serverSideActions, guardrailsResult$, actionInputsWithoutAgents, }: {
85
86
  serverSideActions: Action<any>[];
86
87
  guardrailsResult$?: Subject<GuardrailsResult>;
@@ -1,11 +1,11 @@
1
- export { h as CommonConfig, b as CopilotRequestContextProperties, a as CopilotRuntime, C as CopilotRuntimeConstructorParams, d as CreateCopilotRuntimeServerOptions, G as GraphQLContext, g as buildSchema, c as copilotKitEndpoint, e as createContext, f as flattenToolCallsNoDuplicates, i as getCommonConfig, l as langGraphCloudEndpoint, r as resolveEndpointType } from '../copilot-runtime-b9715bd4.js';
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-dbfba3eb.js';
1
+ export { h as CommonConfig, b as CopilotRequestContextProperties, a as CopilotRuntime, C as CopilotRuntimeConstructorParams, d as CreateCopilotRuntimeServerOptions, G as GraphQLContext, g as buildSchema, c as copilotKitEndpoint, e as createContext, f as flattenToolCallsNoDuplicates, i as getCommonConfig, l as langGraphPlatformEndpoint, r as resolveEndpointType } from '../copilot-runtime-335a610d.js';
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-2f8fd767.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';
6
6
  export { copilotRuntimeNestEndpoint } from './integrations/nest/index.js';
7
7
  import '@copilotkit/shared';
8
- import '../langserve-f00629d2.js';
8
+ import '../langserve-cc06e76e.js';
9
9
  import '../index-83ee522f.js';
10
10
  import '../graphql/types/base/index.js';
11
11
  import 'rxjs';
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.3.16-mme-reset-chat.10",
47
+ version: "1.3.16-mme-reset-chat.11",
48
48
  sideEffects: false,
49
49
  main: "./dist/index.js",
50
50
  module: "./dist/index.mjs",
@@ -142,13 +142,13 @@ __export(lib_exports, {
142
142
  createContext: () => createContext,
143
143
  flattenToolCallsNoDuplicates: () => flattenToolCallsNoDuplicates,
144
144
  getCommonConfig: () => getCommonConfig,
145
- langGraphCloudEndpoint: () => langGraphCloudEndpoint,
145
+ langGraphPlatformEndpoint: () => langGraphPlatformEndpoint,
146
146
  resolveEndpointType: () => resolveEndpointType
147
147
  });
148
148
  module.exports = __toCommonJS(lib_exports);
149
149
 
150
150
  // src/lib/runtime/copilot-runtime.ts
151
- var import_shared8 = require("@copilotkit/shared");
151
+ var import_shared9 = require("@copilotkit/shared");
152
152
 
153
153
  // src/service-adapters/langchain/langserve.ts
154
154
  var import_remote = require("langchain/runnables/remote");
@@ -1072,6 +1072,7 @@ var GroqAdapter = class {
1072
1072
  __name(GroqAdapter, "GroqAdapter");
1073
1073
 
1074
1074
  // src/service-adapters/events.ts
1075
+ var import_shared8 = require("@copilotkit/shared");
1075
1076
  var import_rxjs2 = require("rxjs");
1076
1077
 
1077
1078
  // src/lib/telemetry-client.ts
@@ -1134,7 +1135,7 @@ var RemoteLangGraphEventSource = class {
1134
1135
  acc.content = null;
1135
1136
  }
1136
1137
  const toolCallChunks = (
1137
- // @ts-expect-error -- LangGraph Cloud implementation stores data outside of kwargs
1138
+ // @ts-expect-error -- LangGraph Platform implementation stores data outside of kwargs
1138
1139
  ((_h = (_g = (_f = event.data) == null ? void 0 : _f.chunk) == null ? void 0 : _g.kwargs) == null ? void 0 : _h.tool_call_chunks) ?? ((_j = (_i = event.data) == null ? void 0 : _i.chunk) == null ? void 0 : _j.tool_call_chunks)
1139
1140
  );
1140
1141
  const toolCallMessageId = ((_m = (_l = (_k = event.data) == null ? void 0 : _k.chunk) == null ? void 0 : _l.kwargs) == null ? void 0 : _m.id) ?? ((_o = (_n = event.data) == null ? void 0 : _n.chunk) == null ? void 0 : _o.id);
@@ -1312,7 +1313,7 @@ var RemoteLangGraphEventSource = class {
1312
1313
  };
1313
1314
  __name(RemoteLangGraphEventSource, "RemoteLangGraphEventSource");
1314
1315
 
1315
- // src/lib/runtime/remote-lg-cloud-action.ts
1316
+ // src/lib/runtime/remote-lg-action.ts
1316
1317
  var import_langgraph_sdk = require("@langchain/langgraph-sdk");
1317
1318
  var import_node_crypto = require("crypto");
1318
1319
  var import_partial_json = require("partial-json");
@@ -1353,7 +1354,7 @@ var CopilotRequestType;
1353
1354
  description: "The type of Copilot request"
1354
1355
  });
1355
1356
 
1356
- // src/lib/runtime/remote-lg-cloud-action.ts
1357
+ // src/lib/runtime/remote-lg-action.ts
1357
1358
  async function execute(args) {
1358
1359
  return new ReadableStream({
1359
1360
  async start(controller) {
@@ -1417,7 +1418,7 @@ async function streamEvents(controller, args) {
1417
1418
  if (!assistantId) {
1418
1419
  console.error(`
1419
1420
  No agent found for the agent name specified in CopilotKit provider
1420
- Please check your available agents or provide an agent ID in the LangGraph Cloud endpoint definition.
1421
+ Please check your available agents or provide an agent ID in the LangGraph Platform endpoint definition.
1421
1422
 
1422
1423
 
1423
1424
  These are the available agents: [${assistants.map((a) => `${a.name} (ID: ${a.assistant_id})`).join(", ")}]
@@ -1441,6 +1442,7 @@ async function streamEvents(controller, args) {
1441
1442
  const emit = /* @__PURE__ */ __name((message) => controller.enqueue(new TextEncoder().encode(message)), "emit");
1442
1443
  let latestStateValues = {};
1443
1444
  let updatedState = state;
1445
+ let manuallyEmittedState = null;
1444
1446
  let streamInfo = {
1445
1447
  hashedLgcKey: (0, import_node_crypto.createHash)("sha256").update(langsmithApiKey).digest("hex")
1446
1448
  };
@@ -1481,23 +1483,25 @@ async function streamEvents(controller, args) {
1481
1483
  shouldExit = shouldExit || eventType === LangGraphEventTypes.OnCustomEvent && event.name === CustomEventNames.CopilotKitExit;
1482
1484
  const emitIntermediateState = metadata["copilotkit:emit-intermediate-state"];
1483
1485
  const manuallyEmitIntermediateState = eventType === LangGraphEventTypes.OnCustomEvent && event.name === CustomEventNames.CopilotKitManuallyEmitIntermediateState;
1486
+ const exitingNode = nodeName === currentNodeName && eventType === LangGraphEventTypes.OnChainEnd;
1487
+ if (exitingNode) {
1488
+ manuallyEmittedState = null;
1489
+ }
1484
1490
  if (graphInfo["nodes"].some((node) => node.id === currentNodeName)) {
1485
1491
  nodeName = currentNodeName;
1486
- if (eventType === LangGraphEventTypes.OnChainStart || eventType === LangGraphEventTypes.OnChainEnd) {
1487
- updatedState = latestStateValues;
1488
- }
1489
1492
  }
1493
+ updatedState = manuallyEmittedState ?? latestStateValues;
1490
1494
  if (!nodeName) {
1491
1495
  continue;
1492
1496
  }
1493
1497
  if (manuallyEmitIntermediateState) {
1494
- updatedState = event.data;
1498
+ manuallyEmittedState = event.data;
1495
1499
  emit(getStateSyncEvent({
1496
1500
  threadId,
1497
1501
  runId,
1498
1502
  agentName: agent.name,
1499
1503
  nodeName,
1500
- state: updatedState,
1504
+ state: manuallyEmittedState,
1501
1505
  running: true,
1502
1506
  active: true
1503
1507
  }));
@@ -1521,7 +1525,6 @@ async function streamEvents(controller, args) {
1521
1525
  if (!emitIntermediateState && currentNodeName === emitIntermediateStateUntilEnd && eventType === LangGraphEventTypes.OnChainEnd) {
1522
1526
  emitIntermediateStateUntilEnd = null;
1523
1527
  }
1524
- const exitingNode = nodeName === currentNodeName && eventType === LangGraphEventTypes.OnChainEnd;
1525
1528
  if (JSON.stringify(updatedState) !== JSON.stringify(state) || prevNodeName != nodeName || exitingNode) {
1526
1529
  state = updatedState;
1527
1530
  prevNodeName = nodeName;
@@ -1787,10 +1790,10 @@ function constructLGCRemoteAction({ endpoint, graphqlContext, logger: logger2, m
1787
1790
  var _a;
1788
1791
  logger2.debug({
1789
1792
  actionName: agent.name
1790
- }, "Executing LangGraph Cloud agent");
1793
+ }, "Executing LangGraph Platform agent");
1791
1794
  telemetry_client_default.capture("oss.runtime.remote_action_executed", {
1792
1795
  agentExecution: true,
1793
- type: "langgraph-cloud",
1796
+ type: "langgraph-platform",
1794
1797
  agentsAmount: endpoint.agents.length,
1795
1798
  hashedLgcKey: (0, import_node_crypto2.createHash)("sha256").update(endpoint.langsmithApiKey).digest("hex")
1796
1799
  });
@@ -1826,8 +1829,8 @@ function constructLGCRemoteAction({ endpoint, graphqlContext, logger: logger2, m
1826
1829
  url: endpoint.deploymentUrl,
1827
1830
  status: 500,
1828
1831
  body: error.message
1829
- }, "Failed to execute LangGraph Cloud agent");
1830
- throw new Error("Failed to execute LangGraph Cloud agent");
1832
+ }, "Failed to execute LangGraph Platform agent");
1833
+ throw new Error("Failed to execute LangGraph Platform agent");
1831
1834
  }
1832
1835
  }
1833
1836
  }));
@@ -2009,7 +2012,7 @@ __name(createHeaders, "createHeaders");
2009
2012
  var EndpointType;
2010
2013
  (function(EndpointType2) {
2011
2014
  EndpointType2["CopilotKit"] = "copilotKit";
2012
- EndpointType2["LangGraphCloud"] = "langgraph-cloud";
2015
+ EndpointType2["LangGraphPlatform"] = "langgraph-platform";
2013
2016
  })(EndpointType || (EndpointType = {}));
2014
2017
  function isLangGraphAgentAction(action) {
2015
2018
  if (!action) {
@@ -2067,13 +2070,13 @@ async function setupRemoteActions({ remoteEndpointDefinitions, graphqlContext, m
2067
2070
  remoteEndpointDefinitions
2068
2071
  }, "Fetching from remote endpoints");
2069
2072
  const filtered = remoteEndpointDefinitions.filter((value, index, self) => {
2070
- if (value.type === "langgraph-cloud") {
2073
+ if (value.type === "langgraph-platform") {
2071
2074
  return value;
2072
2075
  }
2073
2076
  return index === self.findIndex((t) => t.url === value.url);
2074
2077
  });
2075
2078
  const result = await Promise.all(filtered.map(async (endpoint) => {
2076
- if (endpoint.type === "langgraph-cloud") {
2079
+ if (endpoint.type === "langgraph-platform") {
2077
2080
  return constructLGCRemoteAction({
2078
2081
  endpoint,
2079
2082
  messages,
@@ -2134,7 +2137,7 @@ function getRuntimeInstanceTelemetryInfo(runtime) {
2134
2137
  ]
2135
2138
  };
2136
2139
  }
2137
- if (endpointType === EndpointType.LangGraphCloud) {
2140
+ if (endpointType === EndpointType.LangGraphPlatform) {
2138
2141
  const ep = endpoint;
2139
2142
  info = {
2140
2143
  ...info,
@@ -2249,9 +2252,20 @@ var RuntimeEventSource = class {
2249
2252
  async stream(callback) {
2250
2253
  this.callback = callback;
2251
2254
  }
2255
+ sendErrorMessageToChat() {
2256
+ const errorMessage = "\u274C An error occurred. Please try again.";
2257
+ if (!this.callback) {
2258
+ this.stream(async (eventStream$) => {
2259
+ eventStream$.sendTextMessage((0, import_shared8.randomId)(), errorMessage);
2260
+ });
2261
+ } else {
2262
+ this.eventStream$.sendTextMessage((0, import_shared8.randomId)(), errorMessage);
2263
+ }
2264
+ }
2252
2265
  processRuntimeEvents({ serverSideActions, guardrailsResult$, actionInputsWithoutAgents }) {
2253
2266
  this.callback(this.eventStream$).catch((error) => {
2254
2267
  console.error("Error in event source callback", error);
2268
+ this.sendErrorMessageToChat();
2255
2269
  });
2256
2270
  return this.eventStream$.pipe(
2257
2271
  // mark tools for server side execution
@@ -2494,37 +2508,37 @@ var CopilotRuntime = class {
2494
2508
  const remoteChain = new RemoteChain(chain);
2495
2509
  this.langserve.push(remoteChain.toAction());
2496
2510
  }
2497
- this.remoteEndpointDefinitions = (params == null ? void 0 : params.remoteEndpoints) || [];
2511
+ this.remoteEndpointDefinitions = (params == null ? void 0 : params.remoteEndpoints) ?? (params == null ? void 0 : params.remoteActions) ?? [];
2498
2512
  this.onBeforeRequest = (_a = params == null ? void 0 : params.middleware) == null ? void 0 : _a.onBeforeRequest;
2499
2513
  this.onAfterRequest = (_b = params == null ? void 0 : params.middleware) == null ? void 0 : _b.onAfterRequest;
2500
2514
  }
2501
2515
  async processRuntimeRequest(request) {
2502
2516
  var _a;
2503
2517
  const { serviceAdapter, messages: rawMessages, actions: clientSideActionsInput, threadId, runId, outputMessagesPromise, graphqlContext, forwardedParameters, agentSession, url } = request;
2504
- if (agentSession) {
2505
- return this.processAgentRequest(request);
2506
- }
2507
- const messages = rawMessages.filter((message) => !message.agentStateMessage);
2508
- const inputMessages = convertGqlInputToMessages(messages);
2509
- const serverSideActions = await this.getServerSideActions(request);
2510
- const serverSideActionsInput = serverSideActions.map((action) => ({
2511
- name: action.name,
2512
- description: action.description,
2513
- jsonSchema: JSON.stringify((0, import_shared8.actionParametersToJsonSchema)(action.parameters))
2514
- }));
2515
- const actionInputs = flattenToolCallsNoDuplicates([
2516
- ...serverSideActionsInput,
2517
- ...clientSideActionsInput
2518
- ]);
2519
- await ((_a = this.onBeforeRequest) == null ? void 0 : _a.call(this, {
2520
- threadId,
2521
- runId,
2522
- inputMessages,
2523
- properties: graphqlContext.properties,
2524
- url
2525
- }));
2518
+ const eventSource = new RuntimeEventSource();
2526
2519
  try {
2527
- const eventSource = new RuntimeEventSource();
2520
+ if (agentSession) {
2521
+ return await this.processAgentRequest(request);
2522
+ }
2523
+ const messages = rawMessages.filter((message) => !message.agentStateMessage);
2524
+ const inputMessages = convertGqlInputToMessages(messages);
2525
+ const serverSideActions = await this.getServerSideActions(request);
2526
+ const serverSideActionsInput = serverSideActions.map((action) => ({
2527
+ name: action.name,
2528
+ description: action.description,
2529
+ jsonSchema: JSON.stringify((0, import_shared9.actionParametersToJsonSchema)(action.parameters))
2530
+ }));
2531
+ const actionInputs = flattenToolCallsNoDuplicates([
2532
+ ...serverSideActionsInput,
2533
+ ...clientSideActionsInput
2534
+ ]);
2535
+ await ((_a = this.onBeforeRequest) == null ? void 0 : _a.call(this, {
2536
+ threadId,
2537
+ runId,
2538
+ inputMessages,
2539
+ properties: graphqlContext.properties,
2540
+ url
2541
+ }));
2528
2542
  const result = await serviceAdapter.process({
2529
2543
  messages: inputMessages,
2530
2544
  actions: actionInputs,
@@ -2557,7 +2571,14 @@ var CopilotRuntime = class {
2557
2571
  };
2558
2572
  } catch (error) {
2559
2573
  console.error("Error getting response:", error);
2560
- throw error;
2574
+ eventSource.sendErrorMessageToChat();
2575
+ return {
2576
+ threadId: threadId || (0, import_shared9.randomId)(),
2577
+ runId: runId || (0, import_shared9.randomId)(),
2578
+ eventSource,
2579
+ serverSideActions: [],
2580
+ actionInputsWithoutAgents: []
2581
+ };
2561
2582
  }
2562
2583
  }
2563
2584
  async processAgentRequest(request) {
@@ -2573,7 +2594,7 @@ var CopilotRuntime = class {
2573
2594
  const serverSideActionsInput = serverSideActions.filter((action) => !isLangGraphAgentAction(action)).map((action) => ({
2574
2595
  name: action.name,
2575
2596
  description: action.description,
2576
- jsonSchema: JSON.stringify((0, import_shared8.actionParametersToJsonSchema)(action.parameters))
2597
+ jsonSchema: JSON.stringify((0, import_shared9.actionParametersToJsonSchema)(action.parameters))
2577
2598
  }));
2578
2599
  const actionInputsWithoutAgents = flattenToolCallsNoDuplicates([
2579
2600
  ...serverSideActionsInput,
@@ -2677,17 +2698,17 @@ function copilotKitEndpoint(config2) {
2677
2698
  };
2678
2699
  }
2679
2700
  __name(copilotKitEndpoint, "copilotKitEndpoint");
2680
- function langGraphCloudEndpoint(config2) {
2701
+ function langGraphPlatformEndpoint(config2) {
2681
2702
  return {
2682
2703
  ...config2,
2683
- type: EndpointType.LangGraphCloud
2704
+ type: EndpointType.LangGraphPlatform
2684
2705
  };
2685
2706
  }
2686
- __name(langGraphCloudEndpoint, "langGraphCloudEndpoint");
2707
+ __name(langGraphPlatformEndpoint, "langGraphPlatformEndpoint");
2687
2708
  function resolveEndpointType(endpoint) {
2688
2709
  if (!endpoint.type) {
2689
2710
  if ("langsmithApiKey" in endpoint && "deploymentUrl" in endpoint && "agents" in endpoint) {
2690
- return EndpointType.LangGraphCloud;
2711
+ return EndpointType.LangGraphPlatform;
2691
2712
  } else {
2692
2713
  return EndpointType.CopilotKit;
2693
2714
  }
@@ -3708,7 +3729,7 @@ var UnknownErrorResponse = class extends FailedResponseStatus {
3708
3729
  __name(UnknownErrorResponse, "UnknownErrorResponse");
3709
3730
 
3710
3731
  // src/graphql/resolvers/copilot.resolver.ts
3711
- var import_shared9 = require("@copilotkit/shared");
3732
+ var import_shared10 = require("@copilotkit/shared");
3712
3733
  function _ts_decorate14(decorators, target, key, desc) {
3713
3734
  var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
3714
3735
  if (typeof Reflect === "object" && typeof Reflect.decorate === "function")
@@ -3825,7 +3846,7 @@ var CopilotResolver = class {
3825
3846
  rejectOutputMessagesPromise = reject;
3826
3847
  });
3827
3848
  logger2.debug("Processing");
3828
- const { eventSource, threadId = (0, import_shared9.randomId)(), runId, serverSideActions, actionInputsWithoutAgents } = await copilotRuntime.processRuntimeRequest({
3849
+ const { eventSource, threadId = (0, import_shared10.randomId)(), runId, serverSideActions, actionInputsWithoutAgents } = await copilotRuntime.processRuntimeRequest({
3829
3850
  serviceAdapter,
3830
3851
  messages: data.messages,
3831
3852
  actions: data.frontend.actions,
@@ -3870,7 +3891,7 @@ var CopilotResolver = class {
3870
3891
  });
3871
3892
  outputMessages = [
3872
3893
  (0, import_class_transformer2.plainToInstance)(TextMessage, {
3873
- id: (0, import_shared9.randomId)(),
3894
+ id: (0, import_shared10.randomId)(),
3874
3895
  createdAt: /* @__PURE__ */ new Date(),
3875
3896
  content: result.reason,
3876
3897
  role: MessageRole.assistant
@@ -4033,7 +4054,7 @@ var CopilotResolver = class {
4033
4054
  result: event.result
4034
4055
  }, "Action execution result event received");
4035
4056
  pushMessage({
4036
- id: (0, import_shared9.randomId)(),
4057
+ id: (0, import_shared10.randomId)(),
4037
4058
  status: new SuccessMessageStatus(),
4038
4059
  createdAt: /* @__PURE__ */ new Date(),
4039
4060
  actionExecutionId: event.actionExecutionId,
@@ -4041,7 +4062,7 @@ var CopilotResolver = class {
4041
4062
  result: event.result
4042
4063
  });
4043
4064
  outputMessages.push((0, import_class_transformer2.plainToInstance)(ResultMessage, {
4044
- id: (0, import_shared9.randomId)(),
4065
+ id: (0, import_shared10.randomId)(),
4045
4066
  createdAt: /* @__PURE__ */ new Date(),
4046
4067
  actionExecutionId: event.actionExecutionId,
4047
4068
  actionName: event.actionName,
@@ -4053,7 +4074,7 @@ var CopilotResolver = class {
4053
4074
  event
4054
4075
  }, "Agent message event received");
4055
4076
  pushMessage({
4056
- id: (0, import_shared9.randomId)(),
4077
+ id: (0, import_shared10.randomId)(),
4057
4078
  status: new SuccessMessageStatus(),
4058
4079
  threadId: event.threadId,
4059
4080
  agentName: event.agentName,
@@ -4066,7 +4087,7 @@ var CopilotResolver = class {
4066
4087
  createdAt: /* @__PURE__ */ new Date()
4067
4088
  });
4068
4089
  outputMessages.push((0, import_class_transformer2.plainToInstance)(AgentStateMessage, {
4069
- id: (0, import_shared9.randomId)(),
4090
+ id: (0, import_shared10.randomId)(),
4070
4091
  threadId: event.threadId,
4071
4092
  agentName: event.agentName,
4072
4093
  nodeName: event.nodeName,
@@ -4373,7 +4394,7 @@ __name(copilotRuntimeNestEndpoint, "copilotRuntimeNestEndpoint");
4373
4394
  createContext,
4374
4395
  flattenToolCallsNoDuplicates,
4375
4396
  getCommonConfig,
4376
- langGraphCloudEndpoint,
4397
+ langGraphPlatformEndpoint,
4377
4398
  resolveEndpointType
4378
4399
  });
4379
4400
  //# sourceMappingURL=index.js.map