@copilotkit/runtime 1.3.2 → 1.3.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.
Files changed (34) hide show
  1. package/CHANGELOG.md +8 -0
  2. package/dist/{chunk-VQY3UTNK.mjs → chunk-3RSGBABY.mjs} +2 -2
  3. package/dist/{chunk-CP4IV75Q.mjs → chunk-4QVREBXP.mjs} +2 -2
  4. package/dist/{chunk-IYJBUTRQ.mjs → chunk-AOSWZOH5.mjs} +2 -2
  5. package/dist/{chunk-J3URDBS7.mjs → chunk-LQSJAQSM.mjs} +157 -72
  6. package/dist/chunk-LQSJAQSM.mjs.map +1 -0
  7. package/dist/{chunk-GJHAWL7E.mjs → chunk-TU4DA2BH.mjs} +2 -2
  8. package/dist/index.js +159 -74
  9. package/dist/index.js.map +1 -1
  10. package/dist/index.mjs +5 -5
  11. package/dist/lib/index.js +159 -74
  12. package/dist/lib/index.js.map +1 -1
  13. package/dist/lib/index.mjs +5 -5
  14. package/dist/lib/integrations/index.js +4 -2
  15. package/dist/lib/integrations/index.js.map +1 -1
  16. package/dist/lib/integrations/index.mjs +4 -4
  17. package/dist/lib/integrations/nest/index.js +4 -2
  18. package/dist/lib/integrations/nest/index.js.map +1 -1
  19. package/dist/lib/integrations/nest/index.mjs +2 -2
  20. package/dist/lib/integrations/node-express/index.js +4 -2
  21. package/dist/lib/integrations/node-express/index.js.map +1 -1
  22. package/dist/lib/integrations/node-express/index.mjs +2 -2
  23. package/dist/lib/integrations/node-http/index.js +4 -2
  24. package/dist/lib/integrations/node-http/index.js.map +1 -1
  25. package/dist/lib/integrations/node-http/index.mjs +1 -1
  26. package/package.json +7 -5
  27. package/src/agents/langgraph/event-source.ts +97 -24
  28. package/src/agents/langgraph/events.ts +10 -1
  29. package/src/lib/runtime/remote-actions.ts +52 -31
  30. package/dist/chunk-J3URDBS7.mjs.map +0 -1
  31. /package/dist/{chunk-VQY3UTNK.mjs.map → chunk-3RSGBABY.mjs.map} +0 -0
  32. /package/dist/{chunk-CP4IV75Q.mjs.map → chunk-4QVREBXP.mjs.map} +0 -0
  33. /package/dist/{chunk-IYJBUTRQ.mjs.map → chunk-AOSWZOH5.mjs.map} +0 -0
  34. /package/dist/{chunk-GJHAWL7E.mjs.map → chunk-TU4DA2BH.mjs.map} +0 -0
package/dist/index.mjs CHANGED
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  CopilotRuntime,
3
3
  flattenToolCallsNoDuplicates
4
- } from "./chunk-GJHAWL7E.mjs";
4
+ } from "./chunk-TU4DA2BH.mjs";
5
5
  import {
6
6
  AnthropicAdapter,
7
7
  GoogleGenerativeAIAdapter,
@@ -16,19 +16,19 @@ import {
16
16
  config,
17
17
  copilotRuntimeNextJSAppRouterEndpoint,
18
18
  copilotRuntimeNextJSPagesRouterEndpoint
19
- } from "./chunk-IYJBUTRQ.mjs";
19
+ } from "./chunk-AOSWZOH5.mjs";
20
20
  import {
21
21
  copilotRuntimeNestEndpoint
22
- } from "./chunk-CP4IV75Q.mjs";
22
+ } from "./chunk-4QVREBXP.mjs";
23
23
  import {
24
24
  copilotRuntimeNodeExpressEndpoint
25
- } from "./chunk-VQY3UTNK.mjs";
25
+ } from "./chunk-3RSGBABY.mjs";
26
26
  import {
27
27
  buildSchema,
28
28
  copilotRuntimeNodeHttpEndpoint,
29
29
  createContext,
30
30
  getCommonConfig
31
- } from "./chunk-J3URDBS7.mjs";
31
+ } from "./chunk-LQSJAQSM.mjs";
32
32
  import "./chunk-73NMP3DI.mjs";
33
33
  import {
34
34
  GuardrailsValidationFailureResponse,
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.2",
47
+ version: "1.3.3",
48
48
  sideEffects: false,
49
49
  main: "./dist/index.js",
50
50
  module: "./dist/index.mjs",
@@ -59,7 +59,9 @@ var require_package = __commonJS({
59
59
  test: "jest --passWithNoTests",
60
60
  "check-types": "tsc --noEmit",
61
61
  clean: "rm -rf .turbo && rm -rf node_modules && rm -rf dist && rm -rf .next && rm -rf __snapshots__",
62
- "generate-graphql-schema": "rm -rf __snapshots__ && ts-node ./scripts/generate-gql-schema.ts"
62
+ "generate-graphql-schema": "rm -rf __snapshots__ && ts-node ./scripts/generate-gql-schema.ts",
63
+ "link:global": "pnpm link --global",
64
+ "unlink:global": "pnpm unlink --global"
63
65
  },
64
66
  devDependencies: {
65
67
  "@swc/core": "1.5.28",
@@ -140,7 +142,7 @@ __export(lib_exports, {
140
142
  module.exports = __toCommonJS(lib_exports);
141
143
 
142
144
  // src/lib/runtime/copilot-runtime.ts
143
- var import_shared8 = require("@copilotkit/shared");
145
+ var import_shared9 = require("@copilotkit/shared");
144
146
 
145
147
  // src/service-adapters/langchain/langserve.ts
146
148
  var import_remote = require("langchain/runnables/remote");
@@ -1305,9 +1307,11 @@ var LangGraphEventTypes;
1305
1307
  LangGraphEventTypes2["OnToolEnd"] = "on_tool_end";
1306
1308
  LangGraphEventTypes2["OnCopilotKitStateSync"] = "on_copilotkit_state_sync";
1307
1309
  LangGraphEventTypes2["OnCopilotKitEmitMessage"] = "on_copilotkit_emit_message";
1310
+ LangGraphEventTypes2["OnCopilotKitEmitToolCall"] = "on_copilotkit_emit_tool_call";
1308
1311
  })(LangGraphEventTypes || (LangGraphEventTypes = {}));
1309
1312
 
1310
1313
  // src/agents/langgraph/event-source.ts
1314
+ var import_shared8 = require("@copilotkit/shared");
1311
1315
  var RemoteLangGraphEventSource = class {
1312
1316
  eventStream$ = new import_rxjs.ReplaySubject();
1313
1317
  async streamResponse(response) {
@@ -1334,46 +1338,67 @@ var RemoteLangGraphEventSource = class {
1334
1338
  });
1335
1339
  }
1336
1340
  __name(flushBuffer, "flushBuffer");
1337
- while (true) {
1338
- const { done, value } = await reader.read();
1339
- if (!done) {
1340
- buffer.push(decoder.decode(value, {
1341
- stream: true
1342
- }));
1343
- }
1344
- flushBuffer();
1345
- if (done) {
1346
- break;
1341
+ try {
1342
+ while (true) {
1343
+ const { done, value } = await reader.read();
1344
+ if (!done) {
1345
+ buffer.push(decoder.decode(value, {
1346
+ stream: true
1347
+ }));
1348
+ }
1349
+ flushBuffer();
1350
+ if (done) {
1351
+ break;
1352
+ }
1347
1353
  }
1354
+ } catch (error) {
1355
+ console.error("Error in stream", error);
1356
+ eventStream$.error(error);
1357
+ return;
1348
1358
  }
1349
1359
  eventStream$.complete();
1350
1360
  }
1361
+ shouldEmitToolCall(shouldEmitToolCalls, toolCallName) {
1362
+ if (typeof shouldEmitToolCalls === "boolean") {
1363
+ return shouldEmitToolCalls;
1364
+ }
1365
+ if (Array.isArray(shouldEmitToolCalls)) {
1366
+ return shouldEmitToolCalls.includes(toolCallName);
1367
+ }
1368
+ return shouldEmitToolCalls === toolCallName;
1369
+ }
1351
1370
  processLangGraphEvents() {
1371
+ let lastEventWithState = null;
1352
1372
  return this.eventStream$.pipe((0, import_rxjs.scan)((acc, event) => {
1353
- var _a, _b, _c, _d, _e, _f, _g, _h;
1373
+ var _a, _b, _c, _d, _e, _f, _g, _h, _i;
1354
1374
  if (event.event === LangGraphEventTypes.OnChatModelStream) {
1355
1375
  if ((_c = (_b = (_a = event.data) == null ? void 0 : _a.chunk) == null ? void 0 : _b.kwargs) == null ? void 0 : _c.tool_call_chunks) {
1356
- acc.prevToolCallId = acc.toolCallId;
1357
- acc.toolCallId = (_d = event.data.chunk.kwargs) == null ? void 0 : _d.id;
1376
+ acc.prevToolCallMessageId = acc.toolCallMessageId;
1377
+ acc.toolCallMessageId = (_d = event.data.chunk.kwargs) == null ? void 0 : _d.id;
1358
1378
  if ((_e = event.data.chunk.kwargs.tool_call_chunks[0]) == null ? void 0 : _e.name) {
1359
1379
  acc.toolCallName = event.data.chunk.kwargs.tool_call_chunks[0].name;
1360
1380
  }
1381
+ if ((_f = event.data.chunk.kwargs.tool_call_chunks[0]) == null ? void 0 : _f.id) {
1382
+ acc.toolCallId = event.data.chunk.kwargs.tool_call_chunks[0].id;
1383
+ }
1361
1384
  }
1362
1385
  acc.prevMessageId = acc.messageId;
1363
- acc.messageId = (_h = (_g = (_f = event.data) == null ? void 0 : _f.chunk) == null ? void 0 : _g.kwargs) == null ? void 0 : _h.id;
1386
+ acc.messageId = (_i = (_h = (_g = event.data) == null ? void 0 : _g.chunk) == null ? void 0 : _h.kwargs) == null ? void 0 : _i.id;
1364
1387
  } else {
1365
- acc.prevToolCallId = acc.toolCallId;
1366
- acc.toolCallId = null;
1388
+ acc.prevToolCallMessageId = acc.toolCallMessageId;
1389
+ acc.toolCallMessageId = null;
1367
1390
  acc.prevMessageId = acc.messageId;
1368
1391
  acc.messageId = null;
1369
1392
  acc.toolCallName = null;
1370
1393
  }
1371
1394
  acc.event = event;
1395
+ lastEventWithState = acc;
1372
1396
  return acc;
1373
1397
  }, {
1374
1398
  event: null,
1375
1399
  toolCallId: null,
1376
- prevToolCallId: null,
1400
+ toolCallMessageId: null,
1401
+ prevToolCallMessageId: null,
1377
1402
  messageId: null,
1378
1403
  toolCallName: null,
1379
1404
  prevMessageId: null
@@ -1390,7 +1415,7 @@ var RemoteLangGraphEventSource = class {
1390
1415
  shouldEmitMessages = eventWithState.event.metadata["copilotkit:emit-messages"];
1391
1416
  }
1392
1417
  }
1393
- if (eventWithState.prevToolCallId !== null && eventWithState.prevToolCallId !== eventWithState.toolCallId && shouldEmitToolCalls) {
1418
+ if (eventWithState.prevToolCallMessageId !== null && eventWithState.prevToolCallMessageId !== eventWithState.toolCallMessageId && this.shouldEmitToolCall(shouldEmitToolCalls, eventWithState.toolCallName)) {
1394
1419
  events.push({
1395
1420
  type: RuntimeEventTypes.ActionExecutionEnd
1396
1421
  });
@@ -1414,6 +1439,20 @@ var RemoteLangGraphEventSource = class {
1414
1439
  type: RuntimeEventTypes.TextMessageEnd
1415
1440
  });
1416
1441
  break;
1442
+ case LangGraphEventTypes.OnCopilotKitEmitToolCall:
1443
+ events.push({
1444
+ type: RuntimeEventTypes.ActionExecutionStart,
1445
+ actionExecutionId: eventWithState.event.id,
1446
+ actionName: eventWithState.event.name
1447
+ });
1448
+ events.push({
1449
+ type: RuntimeEventTypes.ActionExecutionArgs,
1450
+ args: JSON.stringify(eventWithState.event.args)
1451
+ });
1452
+ events.push({
1453
+ type: RuntimeEventTypes.ActionExecutionEnd
1454
+ });
1455
+ break;
1417
1456
  case LangGraphEventTypes.OnCopilotKitStateSync:
1418
1457
  events.push({
1419
1458
  type: RuntimeEventTypes.AgentStateMessage,
@@ -1430,11 +1469,11 @@ var RemoteLangGraphEventSource = class {
1430
1469
  case LangGraphEventTypes.OnToolEnd:
1431
1470
  break;
1432
1471
  case LangGraphEventTypes.OnChatModelStream:
1433
- if (eventWithState.toolCallId !== null && eventWithState.prevToolCallId !== eventWithState.toolCallId) {
1434
- if (shouldEmitToolCalls) {
1472
+ if (eventWithState.toolCallMessageId !== null && eventWithState.prevToolCallMessageId !== eventWithState.toolCallMessageId) {
1473
+ if (this.shouldEmitToolCall(shouldEmitToolCalls, eventWithState.toolCallName)) {
1435
1474
  events.push({
1436
1475
  type: RuntimeEventTypes.ActionExecutionStart,
1437
- actionExecutionId: eventWithState.toolCallId,
1476
+ actionExecutionId: eventWithState.toolCallMessageId,
1438
1477
  actionName: eventWithState.toolCallName,
1439
1478
  scope: "client"
1440
1479
  });
@@ -1450,7 +1489,7 @@ var RemoteLangGraphEventSource = class {
1450
1489
  const args = (_e = (_d = (_c = (_b = (_a = eventWithState.event.data) == null ? void 0 : _a.chunk) == null ? void 0 : _b.kwargs) == null ? void 0 : _c.tool_call_chunks) == null ? void 0 : _d[0]) == null ? void 0 : _e.args;
1451
1490
  const content = (_h = (_g = (_f = eventWithState.event.data) == null ? void 0 : _f.chunk) == null ? void 0 : _g.kwargs) == null ? void 0 : _h.content;
1452
1491
  if (args) {
1453
- if (shouldEmitToolCalls) {
1492
+ if (this.shouldEmitToolCall(shouldEmitToolCalls, eventWithState.toolCallName)) {
1454
1493
  events.push({
1455
1494
  type: RuntimeEventTypes.ActionExecutionArgs,
1456
1495
  args
@@ -1467,6 +1506,32 @@ var RemoteLangGraphEventSource = class {
1467
1506
  break;
1468
1507
  }
1469
1508
  return events;
1509
+ }), (0, import_rxjs.catchError)((error) => {
1510
+ console.error(error);
1511
+ const events = [];
1512
+ if (lastEventWithState == null ? void 0 : lastEventWithState.messageId) {
1513
+ events.push({
1514
+ type: RuntimeEventTypes.TextMessageEnd
1515
+ });
1516
+ }
1517
+ if (lastEventWithState == null ? void 0 : lastEventWithState.toolCallMessageId) {
1518
+ events.push({
1519
+ type: RuntimeEventTypes.ActionExecutionEnd
1520
+ });
1521
+ }
1522
+ const messageId = (0, import_shared8.randomId)();
1523
+ events.push({
1524
+ type: RuntimeEventTypes.TextMessageStart,
1525
+ messageId
1526
+ });
1527
+ events.push({
1528
+ type: RuntimeEventTypes.TextMessageContent,
1529
+ content: "\u274C An error occurred. Please try again."
1530
+ });
1531
+ events.push({
1532
+ type: RuntimeEventTypes.TextMessageEnd
1533
+ });
1534
+ return events;
1470
1535
  }));
1471
1536
  }
1472
1537
  };
@@ -1500,27 +1565,40 @@ async function fetchRemoteInfo({ url, onBeforeRequest, graphqlContext, logger: l
1500
1565
  url
1501
1566
  }, "Fetching actions from url");
1502
1567
  const headers = createHeaders(onBeforeRequest, graphqlContext);
1503
- const response = await fetch(`${url}/info`, {
1504
- method: "POST",
1505
- headers,
1506
- body: JSON.stringify({
1507
- properties: graphqlContext.properties,
1508
- frontendUrl
1509
- })
1510
- });
1511
- if (!response.ok) {
1568
+ try {
1569
+ const response = await fetch(`${url}/info`, {
1570
+ method: "POST",
1571
+ headers,
1572
+ body: JSON.stringify({
1573
+ properties: graphqlContext.properties,
1574
+ frontendUrl
1575
+ })
1576
+ });
1577
+ if (!response.ok) {
1578
+ logger2.error({
1579
+ url,
1580
+ status: response.status,
1581
+ body: await response.text()
1582
+ }, "Failed to fetch actions from url");
1583
+ return {
1584
+ actions: [],
1585
+ agents: []
1586
+ };
1587
+ }
1588
+ const json = await response.json();
1589
+ logger2.debug({
1590
+ json
1591
+ }, "Fetched actions from url");
1592
+ return json;
1593
+ } catch (error) {
1512
1594
  logger2.error({
1513
- url,
1514
- status: response.status,
1515
- body: await response.text()
1595
+ error: error.message ? error.message : error + ""
1516
1596
  }, "Failed to fetch actions from url");
1517
- return [];
1597
+ return {
1598
+ actions: [],
1599
+ agents: []
1600
+ };
1518
1601
  }
1519
- const json = await response.json();
1520
- logger2.debug({
1521
- json
1522
- }, "Fetched actions from url");
1523
- return json;
1524
1602
  }
1525
1603
  __name(fetchRemoteInfo, "fetchRemoteInfo");
1526
1604
  function constructRemoteActions({ json, url, onBeforeRequest, graphqlContext, logger: logger2, messages, agentStates }) {
@@ -1535,30 +1613,37 @@ function constructRemoteActions({ json, url, onBeforeRequest, graphqlContext, lo
1535
1613
  }, "Executing remote action");
1536
1614
  const headers = createHeaders(onBeforeRequest, graphqlContext);
1537
1615
  telemetry_client_default.capture("oss.runtime.remote_action_executed", {});
1538
- const response = await fetch(`${url}/actions/execute`, {
1539
- method: "POST",
1540
- headers,
1541
- body: JSON.stringify({
1542
- name: action.name,
1543
- arguments: args,
1544
- properties: graphqlContext.properties
1545
- })
1546
- });
1547
- if (!response.ok) {
1616
+ try {
1617
+ const response = await fetch(`${url}/actions/execute`, {
1618
+ method: "POST",
1619
+ headers,
1620
+ body: JSON.stringify({
1621
+ name: action.name,
1622
+ arguments: args,
1623
+ properties: graphqlContext.properties
1624
+ })
1625
+ });
1626
+ if (!response.ok) {
1627
+ logger2.error({
1628
+ url,
1629
+ status: response.status,
1630
+ body: await response.text()
1631
+ }, "Failed to execute remote action");
1632
+ return "Failed to execute remote action";
1633
+ }
1634
+ const requestResult = await response.json();
1635
+ const result = requestResult["result"];
1636
+ logger2.debug({
1637
+ actionName: action.name,
1638
+ result
1639
+ }, "Executed remote action");
1640
+ return result;
1641
+ } catch (error) {
1548
1642
  logger2.error({
1549
- url,
1550
- status: response.status,
1551
- body: await response.text()
1643
+ error: error.message ? error.message : error + ""
1552
1644
  }, "Failed to execute remote action");
1553
1645
  return "Failed to execute remote action";
1554
1646
  }
1555
- const requestResult = await response.json();
1556
- const result = requestResult["result"];
1557
- logger2.debug({
1558
- actionName: action.name,
1559
- result
1560
- }, "Executed remote action");
1561
- return result;
1562
1647
  }
1563
1648
  }));
1564
1649
  const agents = json["agents"].map((agent) => ({
@@ -1913,7 +1998,7 @@ var CopilotRuntime = class {
1913
1998
  const serverSideActionsInput = serverSideActions.map((action) => ({
1914
1999
  name: action.name,
1915
2000
  description: action.description,
1916
- jsonSchema: JSON.stringify((0, import_shared8.actionParametersToJsonSchema)(action.parameters))
2001
+ jsonSchema: JSON.stringify((0, import_shared9.actionParametersToJsonSchema)(action.parameters))
1917
2002
  }));
1918
2003
  const actionInputs = flattenToolCallsNoDuplicates([
1919
2004
  ...serverSideActionsInput,
@@ -1966,7 +2051,7 @@ var CopilotRuntime = class {
1966
2051
  async processAgentRequest(request) {
1967
2052
  var _a;
1968
2053
  const { messages: rawMessages, outputMessagesPromise, graphqlContext, agentSession } = request;
1969
- const { threadId = (0, import_shared8.randomId)(), agentName, nodeName } = agentSession;
2054
+ const { threadId = (0, import_shared9.randomId)(), agentName, nodeName } = agentSession;
1970
2055
  const serverSideActions = await this.getServerSideActions(request);
1971
2056
  const messages = convertGqlInputToMessages(rawMessages);
1972
2057
  const agent = serverSideActions.find((action) => action.name === agentName && isLangGraphAgentAction(action));
@@ -1976,7 +2061,7 @@ var CopilotRuntime = class {
1976
2061
  const serverSideActionsInput = serverSideActions.filter((action) => !isLangGraphAgentAction(action)).map((action) => ({
1977
2062
  name: action.name,
1978
2063
  description: action.description,
1979
- jsonSchema: JSON.stringify((0, import_shared8.actionParametersToJsonSchema)(action.parameters))
2064
+ jsonSchema: JSON.stringify((0, import_shared9.actionParametersToJsonSchema)(action.parameters))
1980
2065
  }));
1981
2066
  const actionInputsWithoutAgents = flattenToolCallsNoDuplicates([
1982
2067
  ...serverSideActionsInput,
@@ -3119,7 +3204,7 @@ var UnknownErrorResponse = class extends FailedResponseStatus {
3119
3204
  __name(UnknownErrorResponse, "UnknownErrorResponse");
3120
3205
 
3121
3206
  // src/graphql/resolvers/copilot.resolver.ts
3122
- var import_shared9 = require("@copilotkit/shared");
3207
+ var import_shared10 = require("@copilotkit/shared");
3123
3208
  function _ts_decorate14(decorators, target, key, desc) {
3124
3209
  var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
3125
3210
  if (typeof Reflect === "object" && typeof Reflect.decorate === "function")
@@ -3236,7 +3321,7 @@ var CopilotResolver = class {
3236
3321
  rejectOutputMessagesPromise = reject;
3237
3322
  });
3238
3323
  logger2.debug("Processing");
3239
- const { eventSource, threadId = (0, import_shared9.randomId)(), runId, serverSideActions, actionInputsWithoutAgents } = await copilotRuntime.processRuntimeRequest({
3324
+ const { eventSource, threadId = (0, import_shared10.randomId)(), runId, serverSideActions, actionInputsWithoutAgents } = await copilotRuntime.processRuntimeRequest({
3240
3325
  serviceAdapter,
3241
3326
  messages: data.messages,
3242
3327
  actions: data.frontend.actions,
@@ -3281,7 +3366,7 @@ var CopilotResolver = class {
3281
3366
  });
3282
3367
  outputMessages = [
3283
3368
  (0, import_class_transformer2.plainToInstance)(TextMessage, {
3284
- id: (0, import_shared9.randomId)(),
3369
+ id: (0, import_shared10.randomId)(),
3285
3370
  createdAt: /* @__PURE__ */ new Date(),
3286
3371
  content: result.reason,
3287
3372
  role: MessageRole.assistant
@@ -3332,7 +3417,7 @@ var CopilotResolver = class {
3332
3417
  (0, import_rxjs4.takeWhile)((e) => e.type != RuntimeEventTypes.TextMessageEnd)
3333
3418
  );
3334
3419
  const streamingTextStatus = new import_rxjs4.Subject();
3335
- const messageId = (0, import_shared9.randomId)();
3420
+ const messageId = (0, import_shared10.randomId)();
3336
3421
  pushMessage({
3337
3422
  id: messageId,
3338
3423
  status: (0, import_rxjs4.firstValueFrom)(streamingTextStatus),
@@ -3444,7 +3529,7 @@ var CopilotResolver = class {
3444
3529
  result: event.result
3445
3530
  }, "Action execution result event received");
3446
3531
  pushMessage({
3447
- id: (0, import_shared9.randomId)(),
3532
+ id: (0, import_shared10.randomId)(),
3448
3533
  status: new SuccessMessageStatus(),
3449
3534
  createdAt: /* @__PURE__ */ new Date(),
3450
3535
  actionExecutionId: event.actionExecutionId,
@@ -3452,7 +3537,7 @@ var CopilotResolver = class {
3452
3537
  result: event.result
3453
3538
  });
3454
3539
  outputMessages.push((0, import_class_transformer2.plainToInstance)(ResultMessage, {
3455
- id: (0, import_shared9.randomId)(),
3540
+ id: (0, import_shared10.randomId)(),
3456
3541
  createdAt: /* @__PURE__ */ new Date(),
3457
3542
  actionExecutionId: event.actionExecutionId,
3458
3543
  actionName: event.actionName,
@@ -3464,7 +3549,7 @@ var CopilotResolver = class {
3464
3549
  event
3465
3550
  }, "Agent message event received");
3466
3551
  pushMessage({
3467
- id: (0, import_shared9.randomId)(),
3552
+ id: (0, import_shared10.randomId)(),
3468
3553
  status: new SuccessMessageStatus(),
3469
3554
  threadId: event.threadId,
3470
3555
  agentName: event.agentName,
@@ -3477,7 +3562,7 @@ var CopilotResolver = class {
3477
3562
  createdAt: /* @__PURE__ */ new Date()
3478
3563
  });
3479
3564
  outputMessages.push((0, import_class_transformer2.plainToInstance)(AgentStateMessage, {
3480
- id: (0, import_shared9.randomId)(),
3565
+ id: (0, import_shared10.randomId)(),
3481
3566
  threadId: event.threadId,
3482
3567
  agentName: event.agentName,
3483
3568
  nodeName: event.nodeName,