@copilotkit/runtime 1.1.2 → 1.1.3-feat-runtime-remote-actions.0

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 (85) hide show
  1. package/CHANGELOG.md +14 -0
  2. package/README.md +32 -37
  3. package/__snapshots__/schema/schema.graphql +42 -0
  4. package/dist/chunk-4WFNRUBE.mjs +260 -0
  5. package/dist/chunk-4WFNRUBE.mjs.map +1 -0
  6. package/dist/{chunk-MKV3LEJ6.mjs → chunk-6X5MPWIC.mjs} +795 -159
  7. package/dist/chunk-6X5MPWIC.mjs.map +1 -0
  8. package/dist/{chunk-URMISMK2.mjs → chunk-73NMP3DI.mjs} +2 -2
  9. package/dist/{chunk-CUVWSISN.mjs → chunk-BJ2LVHWA.mjs} +22 -4
  10. package/dist/chunk-BJ2LVHWA.mjs.map +1 -0
  11. package/dist/{chunk-74B76SMO.mjs → chunk-HYNSUFUM.mjs} +2 -2
  12. package/dist/{chunk-6PAC74F2.mjs → chunk-JV3CSVW6.mjs} +2 -2
  13. package/dist/{chunk-NPCP4YZB.mjs → chunk-OYUVLDJF.mjs} +2 -2
  14. package/dist/{chunk-GEIBJJQ4.mjs → chunk-TBZGOJJX.mjs} +14 -2
  15. package/dist/chunk-TBZGOJJX.mjs.map +1 -0
  16. package/dist/{shared-ec6c7db5.d.ts → copilot-runtime-d427e991.d.ts} +68 -37
  17. package/dist/graphql/types/converted/index.d.ts +1 -1
  18. package/dist/graphql/types/converted/index.js +13 -0
  19. package/dist/graphql/types/converted/index.js.map +1 -1
  20. package/dist/graphql/types/converted/index.mjs +3 -1
  21. package/dist/{index-aa091e3c.d.ts → index-0476e4f7.d.ts} +24 -2
  22. package/dist/{groq-adapter-675b30c6.d.ts → index-079752b9.d.ts} +31 -1
  23. package/dist/index.d.ts +9 -9
  24. package/dist/index.js +1012 -246
  25. package/dist/index.js.map +1 -1
  26. package/dist/index.mjs +8 -8
  27. package/dist/{langserve-a54438c6.d.ts → langserve-d6073a3b.d.ts} +24 -11
  28. package/dist/lib/index.d.ts +8 -8
  29. package/dist/lib/index.js +1012 -246
  30. package/dist/lib/index.js.map +1 -1
  31. package/dist/lib/index.mjs +8 -8
  32. package/dist/lib/integrations/index.d.ts +26 -7
  33. package/dist/lib/integrations/index.js +446 -183
  34. package/dist/lib/integrations/index.js.map +1 -1
  35. package/dist/lib/integrations/index.mjs +6 -6
  36. package/dist/lib/integrations/nest/index.d.ts +5 -5
  37. package/dist/lib/integrations/nest/index.js +446 -183
  38. package/dist/lib/integrations/nest/index.js.map +1 -1
  39. package/dist/lib/integrations/nest/index.mjs +4 -4
  40. package/dist/lib/integrations/node-express/index.d.ts +5 -5
  41. package/dist/lib/integrations/node-express/index.js +446 -183
  42. package/dist/lib/integrations/node-express/index.js.map +1 -1
  43. package/dist/lib/integrations/node-express/index.mjs +4 -4
  44. package/dist/lib/integrations/node-http/index.d.ts +5 -5
  45. package/dist/lib/integrations/node-http/index.js +446 -183
  46. package/dist/lib/integrations/node-http/index.js.map +1 -1
  47. package/dist/lib/integrations/node-http/index.mjs +3 -3
  48. package/dist/service-adapters/index.d.ts +3 -3
  49. package/dist/service-adapters/index.js +19 -1
  50. package/dist/service-adapters/index.js.map +1 -1
  51. package/dist/service-adapters/index.mjs +3 -3
  52. package/dist/utils/index.d.ts +49 -1
  53. package/package.json +7 -5
  54. package/src/agents/langgraph/event-source.ts +222 -0
  55. package/src/agents/langgraph/events.ts +309 -0
  56. package/src/graphql/inputs/agent-session.input.ts +13 -0
  57. package/src/graphql/inputs/agent-state.input.ts +10 -0
  58. package/src/graphql/inputs/frontend.input.ts +3 -0
  59. package/src/graphql/inputs/generate-copilot-response.input.ts +11 -0
  60. package/src/graphql/inputs/message.input.ts +30 -0
  61. package/src/graphql/resolvers/copilot.resolver.ts +57 -12
  62. package/src/graphql/types/converted/index.ts +15 -0
  63. package/src/graphql/types/copilot-response.type.ts +29 -0
  64. package/src/graphql/types/enums.ts +1 -0
  65. package/src/lib/index.ts +1 -1
  66. package/src/lib/integrations/shared.ts +1 -1
  67. package/src/lib/runtime/copilot-runtime.ts +360 -0
  68. package/src/lib/runtime/remote-actions.ts +241 -0
  69. package/src/service-adapters/conversion.ts +16 -0
  70. package/src/service-adapters/events.ts +101 -19
  71. package/src/service-adapters/groq/groq-adapter.ts +13 -0
  72. package/src/service-adapters/openai/openai-adapter.ts +13 -0
  73. package/src/service-adapters/openai/openai-assistant-adapter.ts +14 -0
  74. package/dist/chunk-CUVWSISN.mjs.map +0 -1
  75. package/dist/chunk-GEIBJJQ4.mjs.map +0 -1
  76. package/dist/chunk-MKV3LEJ6.mjs.map +0 -1
  77. package/dist/chunk-RDEOIOQR.mjs +0 -155
  78. package/dist/chunk-RDEOIOQR.mjs.map +0 -1
  79. package/dist/failed-response-status-reasons-0ab19e06.d.ts +0 -49
  80. package/dist/pages-router-df82c666.d.ts +0 -21
  81. package/src/lib/copilot-runtime.ts +0 -225
  82. /package/dist/{chunk-URMISMK2.mjs.map → chunk-73NMP3DI.mjs.map} +0 -0
  83. /package/dist/{chunk-74B76SMO.mjs.map → chunk-HYNSUFUM.mjs.map} +0 -0
  84. /package/dist/{chunk-6PAC74F2.mjs.map → chunk-JV3CSVW6.mjs.map} +0 -0
  85. /package/dist/{chunk-NPCP4YZB.mjs.map → chunk-OYUVLDJF.mjs.map} +0 -0
@@ -12,11 +12,11 @@ var __export = (target, all) => {
12
12
  for (var name in all)
13
13
  __defProp(target, name, { get: all[name], enumerable: true });
14
14
  };
15
- var __copyProps = (to, from, except, desc) => {
16
- if (from && typeof from === "object" || typeof from === "function") {
17
- for (let key of __getOwnPropNames(from))
15
+ var __copyProps = (to, from2, except, desc) => {
16
+ if (from2 && typeof from2 === "object" || typeof from2 === "function") {
17
+ for (let key of __getOwnPropNames(from2))
18
18
  if (!__hasOwnProp.call(to, key) && key !== except)
19
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
19
+ __defProp(to, key, { get: () => from2[key], enumerable: !(desc = __getOwnPropDesc(from2, key)) || desc.enumerable });
20
20
  }
21
21
  return to;
22
22
  };
@@ -44,7 +44,7 @@ var require_package = __commonJS({
44
44
  publishConfig: {
45
45
  access: "public"
46
46
  },
47
- version: "1.1.2",
47
+ version: "1.1.3-feat-runtime-remote-actions.0",
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",
@@ -124,14 +126,14 @@ module.exports = __toCommonJS(node_http_exports);
124
126
  var import_graphql_yoga2 = require("graphql-yoga");
125
127
 
126
128
  // src/lib/integrations/shared.ts
127
- var import_type_graphql14 = require("type-graphql");
129
+ var import_type_graphql16 = require("type-graphql");
128
130
 
129
131
  // src/graphql/resolvers/copilot.resolver.ts
130
- var import_type_graphql13 = require("type-graphql");
132
+ var import_type_graphql15 = require("type-graphql");
131
133
  var import_rxjs2 = require("rxjs");
132
134
 
133
135
  // src/graphql/inputs/generate-copilot-response.input.ts
134
- var import_type_graphql9 = require("type-graphql");
136
+ var import_type_graphql11 = require("type-graphql");
135
137
 
136
138
  // src/graphql/inputs/message.input.ts
137
139
  var import_type_graphql3 = require("type-graphql");
@@ -148,6 +150,7 @@ var ActionExecutionScope;
148
150
  (function(ActionExecutionScope2) {
149
151
  ActionExecutionScope2["server"] = "server";
150
152
  ActionExecutionScope2["client"] = "client";
153
+ ActionExecutionScope2["passThrough"] = "passThrough";
151
154
  })(ActionExecutionScope || (ActionExecutionScope = {}));
152
155
  var CopilotRequestType;
153
156
  (function(CopilotRequestType2) {
@@ -226,6 +229,7 @@ var MessageInput = class extends BaseMessage {
226
229
  textMessage;
227
230
  actionExecutionMessage;
228
231
  resultMessage;
232
+ agentStateMessage;
229
233
  };
230
234
  __name(MessageInput, "MessageInput");
231
235
  _ts_decorate2([
@@ -246,6 +250,12 @@ _ts_decorate2([
246
250
  }),
247
251
  _ts_metadata2("design:type", typeof ResultMessageInput === "undefined" ? Object : ResultMessageInput)
248
252
  ], MessageInput.prototype, "resultMessage", void 0);
253
+ _ts_decorate2([
254
+ (0, import_type_graphql3.Field)(() => AgentStateMessageInput, {
255
+ nullable: true
256
+ }),
257
+ _ts_metadata2("design:type", typeof AgentStateMessageInput === "undefined" ? Object : AgentStateMessageInput)
258
+ ], MessageInput.prototype, "agentStateMessage", void 0);
249
259
  MessageInput = _ts_decorate2([
250
260
  (0, import_type_graphql3.InputType)()
251
261
  ], MessageInput);
@@ -307,6 +317,52 @@ _ts_decorate2([
307
317
  ResultMessageInput = _ts_decorate2([
308
318
  (0, import_type_graphql3.InputType)()
309
319
  ], ResultMessageInput);
320
+ var AgentStateMessageInput = class {
321
+ threadId;
322
+ agentName;
323
+ role;
324
+ state;
325
+ running;
326
+ nodeName;
327
+ runId;
328
+ active;
329
+ };
330
+ __name(AgentStateMessageInput, "AgentStateMessageInput");
331
+ _ts_decorate2([
332
+ (0, import_type_graphql3.Field)(() => String),
333
+ _ts_metadata2("design:type", String)
334
+ ], AgentStateMessageInput.prototype, "threadId", void 0);
335
+ _ts_decorate2([
336
+ (0, import_type_graphql3.Field)(() => String),
337
+ _ts_metadata2("design:type", String)
338
+ ], AgentStateMessageInput.prototype, "agentName", void 0);
339
+ _ts_decorate2([
340
+ (0, import_type_graphql3.Field)(() => MessageRole),
341
+ _ts_metadata2("design:type", typeof MessageRole === "undefined" ? Object : MessageRole)
342
+ ], AgentStateMessageInput.prototype, "role", void 0);
343
+ _ts_decorate2([
344
+ (0, import_type_graphql3.Field)(() => String),
345
+ _ts_metadata2("design:type", String)
346
+ ], AgentStateMessageInput.prototype, "state", void 0);
347
+ _ts_decorate2([
348
+ (0, import_type_graphql3.Field)(() => Boolean),
349
+ _ts_metadata2("design:type", Boolean)
350
+ ], AgentStateMessageInput.prototype, "running", void 0);
351
+ _ts_decorate2([
352
+ (0, import_type_graphql3.Field)(() => String),
353
+ _ts_metadata2("design:type", String)
354
+ ], AgentStateMessageInput.prototype, "nodeName", void 0);
355
+ _ts_decorate2([
356
+ (0, import_type_graphql3.Field)(() => String),
357
+ _ts_metadata2("design:type", String)
358
+ ], AgentStateMessageInput.prototype, "runId", void 0);
359
+ _ts_decorate2([
360
+ (0, import_type_graphql3.Field)(() => Boolean),
361
+ _ts_metadata2("design:type", Boolean)
362
+ ], AgentStateMessageInput.prototype, "active", void 0);
363
+ AgentStateMessageInput = _ts_decorate2([
364
+ (0, import_type_graphql3.InputType)()
365
+ ], AgentStateMessageInput);
310
366
 
311
367
  // src/graphql/inputs/frontend.input.ts
312
368
  var import_type_graphql5 = require("type-graphql");
@@ -371,6 +427,7 @@ __name(_ts_metadata4, "_ts_metadata");
371
427
  var FrontendInput = class {
372
428
  toDeprecate_fullContext;
373
429
  actions;
430
+ url;
374
431
  };
375
432
  __name(FrontendInput, "FrontendInput");
376
433
  _ts_decorate4([
@@ -385,6 +442,12 @@ _ts_decorate4([
385
442
  ]),
386
443
  _ts_metadata4("design:type", Array)
387
444
  ], FrontendInput.prototype, "actions", void 0);
445
+ _ts_decorate4([
446
+ (0, import_type_graphql5.Field)(() => String, {
447
+ nullable: true
448
+ }),
449
+ _ts_metadata4("design:type", String)
450
+ ], FrontendInput.prototype, "url", void 0);
388
451
  FrontendInput = _ts_decorate4([
389
452
  (0, import_type_graphql5.InputType)()
390
453
  ], FrontendInput);
@@ -541,7 +604,8 @@ ForwardedParametersInput = _ts_decorate7([
541
604
  (0, import_type_graphql8.InputType)()
542
605
  ], ForwardedParametersInput);
543
606
 
544
- // src/graphql/inputs/generate-copilot-response.input.ts
607
+ // src/graphql/inputs/agent-session.input.ts
608
+ var import_type_graphql9 = require("type-graphql");
545
609
  function _ts_decorate8(decorators, target, key, desc) {
546
610
  var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
547
611
  if (typeof Reflect === "object" && typeof Reflect.decorate === "function")
@@ -558,18 +622,96 @@ function _ts_metadata8(k, v) {
558
622
  return Reflect.metadata(k, v);
559
623
  }
560
624
  __name(_ts_metadata8, "_ts_metadata");
625
+ var AgentSessionInput = class {
626
+ agentName;
627
+ threadId;
628
+ nodeName;
629
+ };
630
+ __name(AgentSessionInput, "AgentSessionInput");
631
+ _ts_decorate8([
632
+ (0, import_type_graphql9.Field)(() => String),
633
+ _ts_metadata8("design:type", String)
634
+ ], AgentSessionInput.prototype, "agentName", void 0);
635
+ _ts_decorate8([
636
+ (0, import_type_graphql9.Field)(() => String, {
637
+ nullable: true
638
+ }),
639
+ _ts_metadata8("design:type", String)
640
+ ], AgentSessionInput.prototype, "threadId", void 0);
641
+ _ts_decorate8([
642
+ (0, import_type_graphql9.Field)(() => String, {
643
+ nullable: true
644
+ }),
645
+ _ts_metadata8("design:type", String)
646
+ ], AgentSessionInput.prototype, "nodeName", void 0);
647
+ AgentSessionInput = _ts_decorate8([
648
+ (0, import_type_graphql9.InputType)()
649
+ ], AgentSessionInput);
650
+
651
+ // src/graphql/inputs/agent-state.input.ts
652
+ var import_type_graphql10 = require("type-graphql");
653
+ function _ts_decorate9(decorators, target, key, desc) {
654
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
655
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function")
656
+ r = Reflect.decorate(decorators, target, key, desc);
657
+ else
658
+ for (var i = decorators.length - 1; i >= 0; i--)
659
+ if (d = decorators[i])
660
+ r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
661
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
662
+ }
663
+ __name(_ts_decorate9, "_ts_decorate");
664
+ function _ts_metadata9(k, v) {
665
+ if (typeof Reflect === "object" && typeof Reflect.metadata === "function")
666
+ return Reflect.metadata(k, v);
667
+ }
668
+ __name(_ts_metadata9, "_ts_metadata");
669
+ var AgentStateInput = class {
670
+ agentName;
671
+ state;
672
+ };
673
+ __name(AgentStateInput, "AgentStateInput");
674
+ _ts_decorate9([
675
+ (0, import_type_graphql10.Field)(() => String),
676
+ _ts_metadata9("design:type", String)
677
+ ], AgentStateInput.prototype, "agentName", void 0);
678
+ _ts_decorate9([
679
+ (0, import_type_graphql10.Field)(() => String),
680
+ _ts_metadata9("design:type", String)
681
+ ], AgentStateInput.prototype, "state", void 0);
682
+ AgentStateInput = _ts_decorate9([
683
+ (0, import_type_graphql10.InputType)()
684
+ ], AgentStateInput);
685
+
686
+ // src/graphql/inputs/generate-copilot-response.input.ts
687
+ function _ts_decorate10(decorators, target, key, desc) {
688
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
689
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function")
690
+ r = Reflect.decorate(decorators, target, key, desc);
691
+ else
692
+ for (var i = decorators.length - 1; i >= 0; i--)
693
+ if (d = decorators[i])
694
+ r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
695
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
696
+ }
697
+ __name(_ts_decorate10, "_ts_decorate");
698
+ function _ts_metadata10(k, v) {
699
+ if (typeof Reflect === "object" && typeof Reflect.metadata === "function")
700
+ return Reflect.metadata(k, v);
701
+ }
702
+ __name(_ts_metadata10, "_ts_metadata");
561
703
  var GenerateCopilotResponseMetadataInput = class {
562
704
  requestType;
563
705
  };
564
706
  __name(GenerateCopilotResponseMetadataInput, "GenerateCopilotResponseMetadataInput");
565
- _ts_decorate8([
566
- (0, import_type_graphql9.Field)(() => CopilotRequestType, {
707
+ _ts_decorate10([
708
+ (0, import_type_graphql11.Field)(() => CopilotRequestType, {
567
709
  nullable: true
568
710
  }),
569
- _ts_metadata8("design:type", typeof CopilotRequestType === "undefined" ? Object : CopilotRequestType)
711
+ _ts_metadata10("design:type", typeof CopilotRequestType === "undefined" ? Object : CopilotRequestType)
570
712
  ], GenerateCopilotResponseMetadataInput.prototype, "requestType", void 0);
571
- GenerateCopilotResponseMetadataInput = _ts_decorate8([
572
- (0, import_type_graphql9.InputType)()
713
+ GenerateCopilotResponseMetadataInput = _ts_decorate10([
714
+ (0, import_type_graphql11.InputType)()
573
715
  ], GenerateCopilotResponseMetadataInput);
574
716
  var GenerateCopilotResponseInput = class {
575
717
  metadata;
@@ -579,58 +721,81 @@ var GenerateCopilotResponseInput = class {
579
721
  frontend;
580
722
  cloud;
581
723
  forwardedParameters;
724
+ agentSession;
725
+ agentState;
726
+ agentStates;
582
727
  };
583
728
  __name(GenerateCopilotResponseInput, "GenerateCopilotResponseInput");
584
- _ts_decorate8([
585
- (0, import_type_graphql9.Field)(() => GenerateCopilotResponseMetadataInput, {
729
+ _ts_decorate10([
730
+ (0, import_type_graphql11.Field)(() => GenerateCopilotResponseMetadataInput, {
586
731
  nullable: false
587
732
  }),
588
- _ts_metadata8("design:type", typeof GenerateCopilotResponseMetadataInput === "undefined" ? Object : GenerateCopilotResponseMetadataInput)
733
+ _ts_metadata10("design:type", typeof GenerateCopilotResponseMetadataInput === "undefined" ? Object : GenerateCopilotResponseMetadataInput)
589
734
  ], GenerateCopilotResponseInput.prototype, "metadata", void 0);
590
- _ts_decorate8([
591
- (0, import_type_graphql9.Field)(() => String, {
735
+ _ts_decorate10([
736
+ (0, import_type_graphql11.Field)(() => String, {
592
737
  nullable: true
593
738
  }),
594
- _ts_metadata8("design:type", String)
739
+ _ts_metadata10("design:type", String)
595
740
  ], GenerateCopilotResponseInput.prototype, "threadId", void 0);
596
- _ts_decorate8([
597
- (0, import_type_graphql9.Field)(() => String, {
741
+ _ts_decorate10([
742
+ (0, import_type_graphql11.Field)(() => String, {
598
743
  nullable: true
599
744
  }),
600
- _ts_metadata8("design:type", String)
745
+ _ts_metadata10("design:type", String)
601
746
  ], GenerateCopilotResponseInput.prototype, "runId", void 0);
602
- _ts_decorate8([
603
- (0, import_type_graphql9.Field)(() => [
747
+ _ts_decorate10([
748
+ (0, import_type_graphql11.Field)(() => [
604
749
  MessageInput
605
750
  ]),
606
- _ts_metadata8("design:type", Array)
751
+ _ts_metadata10("design:type", Array)
607
752
  ], GenerateCopilotResponseInput.prototype, "messages", void 0);
608
- _ts_decorate8([
609
- (0, import_type_graphql9.Field)(() => FrontendInput),
610
- _ts_metadata8("design:type", typeof FrontendInput === "undefined" ? Object : FrontendInput)
753
+ _ts_decorate10([
754
+ (0, import_type_graphql11.Field)(() => FrontendInput),
755
+ _ts_metadata10("design:type", typeof FrontendInput === "undefined" ? Object : FrontendInput)
611
756
  ], GenerateCopilotResponseInput.prototype, "frontend", void 0);
612
- _ts_decorate8([
613
- (0, import_type_graphql9.Field)(() => CloudInput, {
757
+ _ts_decorate10([
758
+ (0, import_type_graphql11.Field)(() => CloudInput, {
614
759
  nullable: true
615
760
  }),
616
- _ts_metadata8("design:type", typeof CloudInput === "undefined" ? Object : CloudInput)
761
+ _ts_metadata10("design:type", typeof CloudInput === "undefined" ? Object : CloudInput)
617
762
  ], GenerateCopilotResponseInput.prototype, "cloud", void 0);
618
- _ts_decorate8([
619
- (0, import_type_graphql9.Field)(() => ForwardedParametersInput, {
763
+ _ts_decorate10([
764
+ (0, import_type_graphql11.Field)(() => ForwardedParametersInput, {
620
765
  nullable: true
621
766
  }),
622
- _ts_metadata8("design:type", typeof ForwardedParametersInput === "undefined" ? Object : ForwardedParametersInput)
767
+ _ts_metadata10("design:type", typeof ForwardedParametersInput === "undefined" ? Object : ForwardedParametersInput)
623
768
  ], GenerateCopilotResponseInput.prototype, "forwardedParameters", void 0);
624
- GenerateCopilotResponseInput = _ts_decorate8([
625
- (0, import_type_graphql9.InputType)()
769
+ _ts_decorate10([
770
+ (0, import_type_graphql11.Field)(() => AgentSessionInput, {
771
+ nullable: true
772
+ }),
773
+ _ts_metadata10("design:type", typeof AgentSessionInput === "undefined" ? Object : AgentSessionInput)
774
+ ], GenerateCopilotResponseInput.prototype, "agentSession", void 0);
775
+ _ts_decorate10([
776
+ (0, import_type_graphql11.Field)(() => AgentStateInput, {
777
+ nullable: true
778
+ }),
779
+ _ts_metadata10("design:type", typeof AgentStateInput === "undefined" ? Object : AgentStateInput)
780
+ ], GenerateCopilotResponseInput.prototype, "agentState", void 0);
781
+ _ts_decorate10([
782
+ (0, import_type_graphql11.Field)(() => [
783
+ AgentStateInput
784
+ ], {
785
+ nullable: true
786
+ }),
787
+ _ts_metadata10("design:type", Array)
788
+ ], GenerateCopilotResponseInput.prototype, "agentStates", void 0);
789
+ GenerateCopilotResponseInput = _ts_decorate10([
790
+ (0, import_type_graphql11.InputType)()
626
791
  ], GenerateCopilotResponseInput);
627
792
 
628
793
  // src/graphql/types/copilot-response.type.ts
629
- var import_type_graphql12 = require("type-graphql");
794
+ var import_type_graphql14 = require("type-graphql");
630
795
 
631
796
  // src/graphql/types/message-status.type.ts
632
- var import_type_graphql10 = require("type-graphql");
633
- function _ts_decorate9(decorators, target, key, desc) {
797
+ var import_type_graphql12 = require("type-graphql");
798
+ function _ts_decorate11(decorators, target, key, desc) {
634
799
  var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
635
800
  if (typeof Reflect === "object" && typeof Reflect.decorate === "function")
636
801
  r = Reflect.decorate(decorators, target, key, desc);
@@ -640,58 +805,58 @@ function _ts_decorate9(decorators, target, key, desc) {
640
805
  r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
641
806
  return c > 3 && r && Object.defineProperty(target, key, r), r;
642
807
  }
643
- __name(_ts_decorate9, "_ts_decorate");
644
- function _ts_metadata9(k, v) {
808
+ __name(_ts_decorate11, "_ts_decorate");
809
+ function _ts_metadata11(k, v) {
645
810
  if (typeof Reflect === "object" && typeof Reflect.metadata === "function")
646
811
  return Reflect.metadata(k, v);
647
812
  }
648
- __name(_ts_metadata9, "_ts_metadata");
813
+ __name(_ts_metadata11, "_ts_metadata");
649
814
  var MessageStatusCode;
650
815
  (function(MessageStatusCode2) {
651
816
  MessageStatusCode2["Pending"] = "pending";
652
817
  MessageStatusCode2["Success"] = "success";
653
818
  MessageStatusCode2["Failed"] = "failed";
654
819
  })(MessageStatusCode || (MessageStatusCode = {}));
655
- (0, import_type_graphql10.registerEnumType)(MessageStatusCode, {
820
+ (0, import_type_graphql12.registerEnumType)(MessageStatusCode, {
656
821
  name: "MessageStatusCode"
657
822
  });
658
823
  var BaseMessageStatus = /* @__PURE__ */ __name(class BaseMessageStatus2 {
659
824
  code;
660
825
  }, "BaseMessageStatus");
661
- _ts_decorate9([
662
- (0, import_type_graphql10.Field)(() => MessageStatusCode),
663
- _ts_metadata9("design:type", String)
826
+ _ts_decorate11([
827
+ (0, import_type_graphql12.Field)(() => MessageStatusCode),
828
+ _ts_metadata11("design:type", String)
664
829
  ], BaseMessageStatus.prototype, "code", void 0);
665
- BaseMessageStatus = _ts_decorate9([
666
- (0, import_type_graphql10.ObjectType)()
830
+ BaseMessageStatus = _ts_decorate11([
831
+ (0, import_type_graphql12.ObjectType)()
667
832
  ], BaseMessageStatus);
668
833
  var PendingMessageStatus = class extends BaseMessageStatus {
669
834
  code = "pending";
670
835
  };
671
836
  __name(PendingMessageStatus, "PendingMessageStatus");
672
- PendingMessageStatus = _ts_decorate9([
673
- (0, import_type_graphql10.ObjectType)()
837
+ PendingMessageStatus = _ts_decorate11([
838
+ (0, import_type_graphql12.ObjectType)()
674
839
  ], PendingMessageStatus);
675
840
  var SuccessMessageStatus = class extends BaseMessageStatus {
676
841
  code = "success";
677
842
  };
678
843
  __name(SuccessMessageStatus, "SuccessMessageStatus");
679
- SuccessMessageStatus = _ts_decorate9([
680
- (0, import_type_graphql10.ObjectType)()
844
+ SuccessMessageStatus = _ts_decorate11([
845
+ (0, import_type_graphql12.ObjectType)()
681
846
  ], SuccessMessageStatus);
682
847
  var FailedMessageStatus = class extends BaseMessageStatus {
683
848
  code = "failed";
684
849
  reason;
685
850
  };
686
851
  __name(FailedMessageStatus, "FailedMessageStatus");
687
- _ts_decorate9([
688
- (0, import_type_graphql10.Field)(() => String),
689
- _ts_metadata9("design:type", String)
852
+ _ts_decorate11([
853
+ (0, import_type_graphql12.Field)(() => String),
854
+ _ts_metadata11("design:type", String)
690
855
  ], FailedMessageStatus.prototype, "reason", void 0);
691
- FailedMessageStatus = _ts_decorate9([
692
- (0, import_type_graphql10.ObjectType)()
856
+ FailedMessageStatus = _ts_decorate11([
857
+ (0, import_type_graphql12.ObjectType)()
693
858
  ], FailedMessageStatus);
694
- var MessageStatusUnion = (0, import_type_graphql10.createUnionType)({
859
+ var MessageStatusUnion = (0, import_type_graphql12.createUnionType)({
695
860
  name: "MessageStatus",
696
861
  types: () => [
697
862
  PendingMessageStatus,
@@ -702,8 +867,8 @@ var MessageStatusUnion = (0, import_type_graphql10.createUnionType)({
702
867
 
703
868
  // src/graphql/types/response-status.type.ts
704
869
  var import_graphql_scalars = require("graphql-scalars");
705
- var import_type_graphql11 = require("type-graphql");
706
- function _ts_decorate10(decorators, target, key, desc) {
870
+ var import_type_graphql13 = require("type-graphql");
871
+ function _ts_decorate12(decorators, target, key, desc) {
707
872
  var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
708
873
  if (typeof Reflect === "object" && typeof Reflect.decorate === "function")
709
874
  r = Reflect.decorate(decorators, target, key, desc);
@@ -713,30 +878,30 @@ function _ts_decorate10(decorators, target, key, desc) {
713
878
  r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
714
879
  return c > 3 && r && Object.defineProperty(target, key, r), r;
715
880
  }
716
- __name(_ts_decorate10, "_ts_decorate");
717
- function _ts_metadata10(k, v) {
881
+ __name(_ts_decorate12, "_ts_decorate");
882
+ function _ts_metadata12(k, v) {
718
883
  if (typeof Reflect === "object" && typeof Reflect.metadata === "function")
719
884
  return Reflect.metadata(k, v);
720
885
  }
721
- __name(_ts_metadata10, "_ts_metadata");
886
+ __name(_ts_metadata12, "_ts_metadata");
722
887
  var ResponseStatusCode;
723
888
  (function(ResponseStatusCode2) {
724
889
  ResponseStatusCode2["Pending"] = "pending";
725
890
  ResponseStatusCode2["Success"] = "success";
726
891
  ResponseStatusCode2["Failed"] = "failed";
727
892
  })(ResponseStatusCode || (ResponseStatusCode = {}));
728
- (0, import_type_graphql11.registerEnumType)(ResponseStatusCode, {
893
+ (0, import_type_graphql13.registerEnumType)(ResponseStatusCode, {
729
894
  name: "ResponseStatusCode"
730
895
  });
731
896
  var BaseResponseStatus = /* @__PURE__ */ __name(class BaseResponseStatus2 {
732
897
  code;
733
898
  }, "BaseResponseStatus");
734
- _ts_decorate10([
735
- (0, import_type_graphql11.Field)(() => ResponseStatusCode),
736
- _ts_metadata10("design:type", String)
899
+ _ts_decorate12([
900
+ (0, import_type_graphql13.Field)(() => ResponseStatusCode),
901
+ _ts_metadata12("design:type", String)
737
902
  ], BaseResponseStatus.prototype, "code", void 0);
738
- BaseResponseStatus = _ts_decorate10([
739
- (0, import_type_graphql11.InterfaceType)({
903
+ BaseResponseStatus = _ts_decorate12([
904
+ (0, import_type_graphql13.InterfaceType)({
740
905
  resolveType(value) {
741
906
  if (value.code === "success") {
742
907
  return SuccessResponseStatus;
@@ -748,14 +913,14 @@ BaseResponseStatus = _ts_decorate10([
748
913
  return void 0;
749
914
  }
750
915
  }),
751
- (0, import_type_graphql11.ObjectType)()
916
+ (0, import_type_graphql13.ObjectType)()
752
917
  ], BaseResponseStatus);
753
918
  var PendingResponseStatus = class extends BaseResponseStatus {
754
919
  code = "pending";
755
920
  };
756
921
  __name(PendingResponseStatus, "PendingResponseStatus");
757
- PendingResponseStatus = _ts_decorate10([
758
- (0, import_type_graphql11.ObjectType)({
922
+ PendingResponseStatus = _ts_decorate12([
923
+ (0, import_type_graphql13.ObjectType)({
759
924
  implements: BaseResponseStatus
760
925
  })
761
926
  ], PendingResponseStatus);
@@ -763,8 +928,8 @@ var SuccessResponseStatus = class extends BaseResponseStatus {
763
928
  code = "success";
764
929
  };
765
930
  __name(SuccessResponseStatus, "SuccessResponseStatus");
766
- SuccessResponseStatus = _ts_decorate10([
767
- (0, import_type_graphql11.ObjectType)({
931
+ SuccessResponseStatus = _ts_decorate12([
932
+ (0, import_type_graphql13.ObjectType)({
768
933
  implements: BaseResponseStatus
769
934
  })
770
935
  ], SuccessResponseStatus);
@@ -774,7 +939,7 @@ var FailedResponseStatusReason;
774
939
  FailedResponseStatusReason2["MESSAGE_STREAM_INTERRUPTED"] = "MESSAGE_STREAM_INTERRUPTED";
775
940
  FailedResponseStatusReason2["UNKNOWN_ERROR"] = "UNKNOWN_ERROR";
776
941
  })(FailedResponseStatusReason || (FailedResponseStatusReason = {}));
777
- (0, import_type_graphql11.registerEnumType)(FailedResponseStatusReason, {
942
+ (0, import_type_graphql13.registerEnumType)(FailedResponseStatusReason, {
778
943
  name: "FailedResponseStatusReason"
779
944
  });
780
945
  var FailedResponseStatus = class extends BaseResponseStatus {
@@ -783,22 +948,22 @@ var FailedResponseStatus = class extends BaseResponseStatus {
783
948
  details = null;
784
949
  };
785
950
  __name(FailedResponseStatus, "FailedResponseStatus");
786
- _ts_decorate10([
787
- (0, import_type_graphql11.Field)(() => FailedResponseStatusReason),
788
- _ts_metadata10("design:type", String)
951
+ _ts_decorate12([
952
+ (0, import_type_graphql13.Field)(() => FailedResponseStatusReason),
953
+ _ts_metadata12("design:type", String)
789
954
  ], FailedResponseStatus.prototype, "reason", void 0);
790
- _ts_decorate10([
791
- (0, import_type_graphql11.Field)(() => import_graphql_scalars.GraphQLJSON, {
955
+ _ts_decorate12([
956
+ (0, import_type_graphql13.Field)(() => import_graphql_scalars.GraphQLJSON, {
792
957
  nullable: true
793
958
  }),
794
- _ts_metadata10("design:type", typeof Record === "undefined" ? Object : Record)
959
+ _ts_metadata12("design:type", typeof Record === "undefined" ? Object : Record)
795
960
  ], FailedResponseStatus.prototype, "details", void 0);
796
- FailedResponseStatus = _ts_decorate10([
797
- (0, import_type_graphql11.ObjectType)({
961
+ FailedResponseStatus = _ts_decorate12([
962
+ (0, import_type_graphql13.ObjectType)({
798
963
  implements: BaseResponseStatus
799
964
  })
800
965
  ], FailedResponseStatus);
801
- var ResponseStatusUnion = (0, import_type_graphql11.createUnionType)({
966
+ var ResponseStatusUnion = (0, import_type_graphql13.createUnionType)({
802
967
  name: "ResponseStatus",
803
968
  types: () => [
804
969
  PendingResponseStatus,
@@ -808,7 +973,7 @@ var ResponseStatusUnion = (0, import_type_graphql11.createUnionType)({
808
973
  });
809
974
 
810
975
  // src/graphql/types/copilot-response.type.ts
811
- function _ts_decorate11(decorators, target, key, desc) {
976
+ function _ts_decorate13(decorators, target, key, desc) {
812
977
  var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
813
978
  if (typeof Reflect === "object" && typeof Reflect.decorate === "function")
814
979
  r = Reflect.decorate(decorators, target, key, desc);
@@ -818,31 +983,31 @@ function _ts_decorate11(decorators, target, key, desc) {
818
983
  r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
819
984
  return c > 3 && r && Object.defineProperty(target, key, r), r;
820
985
  }
821
- __name(_ts_decorate11, "_ts_decorate");
822
- function _ts_metadata11(k, v) {
986
+ __name(_ts_decorate13, "_ts_decorate");
987
+ function _ts_metadata13(k, v) {
823
988
  if (typeof Reflect === "object" && typeof Reflect.metadata === "function")
824
989
  return Reflect.metadata(k, v);
825
990
  }
826
- __name(_ts_metadata11, "_ts_metadata");
991
+ __name(_ts_metadata13, "_ts_metadata");
827
992
  var BaseMessageOutput = /* @__PURE__ */ __name(class BaseMessageOutput2 {
828
993
  id;
829
994
  createdAt;
830
995
  status;
831
996
  }, "BaseMessageOutput");
832
- _ts_decorate11([
833
- (0, import_type_graphql12.Field)(() => String),
834
- _ts_metadata11("design:type", String)
997
+ _ts_decorate13([
998
+ (0, import_type_graphql14.Field)(() => String),
999
+ _ts_metadata13("design:type", String)
835
1000
  ], BaseMessageOutput.prototype, "id", void 0);
836
- _ts_decorate11([
837
- (0, import_type_graphql12.Field)(() => Date),
838
- _ts_metadata11("design:type", typeof Date === "undefined" ? Object : Date)
1001
+ _ts_decorate13([
1002
+ (0, import_type_graphql14.Field)(() => Date),
1003
+ _ts_metadata13("design:type", typeof Date === "undefined" ? Object : Date)
839
1004
  ], BaseMessageOutput.prototype, "createdAt", void 0);
840
- _ts_decorate11([
841
- (0, import_type_graphql12.Field)(() => MessageStatusUnion),
842
- _ts_metadata11("design:type", Object)
1005
+ _ts_decorate13([
1006
+ (0, import_type_graphql14.Field)(() => MessageStatusUnion),
1007
+ _ts_metadata13("design:type", Object)
843
1008
  ], BaseMessageOutput.prototype, "status", void 0);
844
- BaseMessageOutput = _ts_decorate11([
845
- (0, import_type_graphql12.InterfaceType)({
1009
+ BaseMessageOutput = _ts_decorate13([
1010
+ (0, import_type_graphql14.InterfaceType)({
846
1011
  resolveType(value) {
847
1012
  if (value.hasOwnProperty("content")) {
848
1013
  return TextMessageOutput;
@@ -850,6 +1015,8 @@ BaseMessageOutput = _ts_decorate11([
850
1015
  return ActionExecutionMessageOutput;
851
1016
  } else if (value.hasOwnProperty("result")) {
852
1017
  return ResultMessageOutput;
1018
+ } else if (value.hasOwnProperty("state")) {
1019
+ return AgentStateMessageOutput;
853
1020
  }
854
1021
  return void 0;
855
1022
  }
@@ -860,18 +1027,18 @@ var TextMessageOutput = class {
860
1027
  content;
861
1028
  };
862
1029
  __name(TextMessageOutput, "TextMessageOutput");
863
- _ts_decorate11([
864
- (0, import_type_graphql12.Field)(() => MessageRole),
865
- _ts_metadata11("design:type", typeof MessageRole === "undefined" ? Object : MessageRole)
1030
+ _ts_decorate13([
1031
+ (0, import_type_graphql14.Field)(() => MessageRole),
1032
+ _ts_metadata13("design:type", typeof MessageRole === "undefined" ? Object : MessageRole)
866
1033
  ], TextMessageOutput.prototype, "role", void 0);
867
- _ts_decorate11([
868
- (0, import_type_graphql12.Field)(() => [
1034
+ _ts_decorate13([
1035
+ (0, import_type_graphql14.Field)(() => [
869
1036
  String
870
1037
  ]),
871
- _ts_metadata11("design:type", Array)
1038
+ _ts_metadata13("design:type", Array)
872
1039
  ], TextMessageOutput.prototype, "content", void 0);
873
- TextMessageOutput = _ts_decorate11([
874
- (0, import_type_graphql12.ObjectType)({
1040
+ TextMessageOutput = _ts_decorate13([
1041
+ (0, import_type_graphql14.ObjectType)({
875
1042
  implements: BaseMessageOutput
876
1043
  })
877
1044
  ], TextMessageOutput);
@@ -881,22 +1048,22 @@ var ActionExecutionMessageOutput = class {
881
1048
  arguments;
882
1049
  };
883
1050
  __name(ActionExecutionMessageOutput, "ActionExecutionMessageOutput");
884
- _ts_decorate11([
885
- (0, import_type_graphql12.Field)(() => String),
886
- _ts_metadata11("design:type", String)
1051
+ _ts_decorate13([
1052
+ (0, import_type_graphql14.Field)(() => String),
1053
+ _ts_metadata13("design:type", String)
887
1054
  ], ActionExecutionMessageOutput.prototype, "name", void 0);
888
- _ts_decorate11([
889
- (0, import_type_graphql12.Field)(() => ActionExecutionScope),
890
- _ts_metadata11("design:type", typeof ActionExecutionScope === "undefined" ? Object : ActionExecutionScope)
1055
+ _ts_decorate13([
1056
+ (0, import_type_graphql14.Field)(() => ActionExecutionScope),
1057
+ _ts_metadata13("design:type", typeof ActionExecutionScope === "undefined" ? Object : ActionExecutionScope)
891
1058
  ], ActionExecutionMessageOutput.prototype, "scope", void 0);
892
- _ts_decorate11([
893
- (0, import_type_graphql12.Field)(() => [
1059
+ _ts_decorate13([
1060
+ (0, import_type_graphql14.Field)(() => [
894
1061
  String
895
1062
  ]),
896
- _ts_metadata11("design:type", Array)
1063
+ _ts_metadata13("design:type", Array)
897
1064
  ], ActionExecutionMessageOutput.prototype, "arguments", void 0);
898
- ActionExecutionMessageOutput = _ts_decorate11([
899
- (0, import_type_graphql12.ObjectType)({
1065
+ ActionExecutionMessageOutput = _ts_decorate13([
1066
+ (0, import_type_graphql14.ObjectType)({
900
1067
  implements: BaseMessageOutput
901
1068
  })
902
1069
  ], ActionExecutionMessageOutput);
@@ -906,23 +1073,71 @@ var ResultMessageOutput = class {
906
1073
  result;
907
1074
  };
908
1075
  __name(ResultMessageOutput, "ResultMessageOutput");
909
- _ts_decorate11([
910
- (0, import_type_graphql12.Field)(() => String),
911
- _ts_metadata11("design:type", String)
1076
+ _ts_decorate13([
1077
+ (0, import_type_graphql14.Field)(() => String),
1078
+ _ts_metadata13("design:type", String)
912
1079
  ], ResultMessageOutput.prototype, "actionExecutionId", void 0);
913
- _ts_decorate11([
914
- (0, import_type_graphql12.Field)(() => String),
915
- _ts_metadata11("design:type", String)
1080
+ _ts_decorate13([
1081
+ (0, import_type_graphql14.Field)(() => String),
1082
+ _ts_metadata13("design:type", String)
916
1083
  ], ResultMessageOutput.prototype, "actionName", void 0);
917
- _ts_decorate11([
918
- (0, import_type_graphql12.Field)(() => String),
919
- _ts_metadata11("design:type", String)
1084
+ _ts_decorate13([
1085
+ (0, import_type_graphql14.Field)(() => String),
1086
+ _ts_metadata13("design:type", String)
920
1087
  ], ResultMessageOutput.prototype, "result", void 0);
921
- ResultMessageOutput = _ts_decorate11([
922
- (0, import_type_graphql12.ObjectType)({
1088
+ ResultMessageOutput = _ts_decorate13([
1089
+ (0, import_type_graphql14.ObjectType)({
923
1090
  implements: BaseMessageOutput
924
1091
  })
925
1092
  ], ResultMessageOutput);
1093
+ var AgentStateMessageOutput = class {
1094
+ threadId;
1095
+ agentName;
1096
+ nodeName;
1097
+ runId;
1098
+ active;
1099
+ role;
1100
+ state;
1101
+ running;
1102
+ };
1103
+ __name(AgentStateMessageOutput, "AgentStateMessageOutput");
1104
+ _ts_decorate13([
1105
+ (0, import_type_graphql14.Field)(() => String),
1106
+ _ts_metadata13("design:type", String)
1107
+ ], AgentStateMessageOutput.prototype, "threadId", void 0);
1108
+ _ts_decorate13([
1109
+ (0, import_type_graphql14.Field)(() => String),
1110
+ _ts_metadata13("design:type", String)
1111
+ ], AgentStateMessageOutput.prototype, "agentName", void 0);
1112
+ _ts_decorate13([
1113
+ (0, import_type_graphql14.Field)(() => String),
1114
+ _ts_metadata13("design:type", String)
1115
+ ], AgentStateMessageOutput.prototype, "nodeName", void 0);
1116
+ _ts_decorate13([
1117
+ (0, import_type_graphql14.Field)(() => String),
1118
+ _ts_metadata13("design:type", String)
1119
+ ], AgentStateMessageOutput.prototype, "runId", void 0);
1120
+ _ts_decorate13([
1121
+ (0, import_type_graphql14.Field)(() => Boolean),
1122
+ _ts_metadata13("design:type", Boolean)
1123
+ ], AgentStateMessageOutput.prototype, "active", void 0);
1124
+ _ts_decorate13([
1125
+ (0, import_type_graphql14.Field)(() => MessageRole),
1126
+ _ts_metadata13("design:type", typeof MessageRole === "undefined" ? Object : MessageRole)
1127
+ ], AgentStateMessageOutput.prototype, "role", void 0);
1128
+ _ts_decorate13([
1129
+ (0, import_type_graphql14.Field)(() => String),
1130
+ _ts_metadata13("design:type", String)
1131
+ ], AgentStateMessageOutput.prototype, "state", void 0);
1132
+ _ts_decorate13([
1133
+ (0, import_type_graphql14.Field)(() => Boolean),
1134
+ _ts_metadata13("design:type", Boolean)
1135
+ ], AgentStateMessageOutput.prototype, "running", void 0);
1136
+ AgentStateMessageOutput = _ts_decorate13([
1137
+ (0, import_type_graphql14.ObjectType)({
1138
+ implements: BaseMessageOutput
1139
+ })
1140
+ ], AgentStateMessageOutput);
926
1141
  var CopilotResponse = class {
927
1142
  threadId;
928
1143
  status;
@@ -930,28 +1145,28 @@ var CopilotResponse = class {
930
1145
  messages;
931
1146
  };
932
1147
  __name(CopilotResponse, "CopilotResponse");
933
- _ts_decorate11([
934
- (0, import_type_graphql12.Field)(() => String),
935
- _ts_metadata11("design:type", String)
1148
+ _ts_decorate13([
1149
+ (0, import_type_graphql14.Field)(() => String),
1150
+ _ts_metadata13("design:type", String)
936
1151
  ], CopilotResponse.prototype, "threadId", void 0);
937
- _ts_decorate11([
938
- (0, import_type_graphql12.Field)(() => ResponseStatusUnion),
939
- _ts_metadata11("design:type", Object)
1152
+ _ts_decorate13([
1153
+ (0, import_type_graphql14.Field)(() => ResponseStatusUnion),
1154
+ _ts_metadata13("design:type", Object)
940
1155
  ], CopilotResponse.prototype, "status", void 0);
941
- _ts_decorate11([
942
- (0, import_type_graphql12.Field)({
1156
+ _ts_decorate13([
1157
+ (0, import_type_graphql14.Field)({
943
1158
  nullable: true
944
1159
  }),
945
- _ts_metadata11("design:type", String)
1160
+ _ts_metadata13("design:type", String)
946
1161
  ], CopilotResponse.prototype, "runId", void 0);
947
- _ts_decorate11([
948
- (0, import_type_graphql12.Field)(() => [
1162
+ _ts_decorate13([
1163
+ (0, import_type_graphql14.Field)(() => [
949
1164
  BaseMessageOutput
950
1165
  ]),
951
- _ts_metadata11("design:type", Array)
1166
+ _ts_metadata13("design:type", Array)
952
1167
  ], CopilotResponse.prototype, "messages", void 0);
953
- CopilotResponse = _ts_decorate11([
954
- (0, import_type_graphql12.ObjectType)()
1168
+ CopilotResponse = _ts_decorate13([
1169
+ (0, import_type_graphql14.ObjectType)()
955
1170
  ], CopilotResponse);
956
1171
 
957
1172
  // src/graphql/resolvers/copilot.resolver.ts
@@ -978,6 +1193,26 @@ var ResultMessage = class extends BaseMessage {
978
1193
  result;
979
1194
  };
980
1195
  __name(ResultMessage, "ResultMessage");
1196
+ var AgentStateMessage = class extends BaseMessage {
1197
+ threadId;
1198
+ agentName;
1199
+ nodeName;
1200
+ runId;
1201
+ active;
1202
+ role;
1203
+ state;
1204
+ running;
1205
+ };
1206
+ __name(AgentStateMessage, "AgentStateMessage");
1207
+
1208
+ // src/lib/telemetry-client.ts
1209
+ var import_shared = require("@copilotkit/shared");
1210
+ var packageJson = require_package();
1211
+ var telemetryClient = new import_shared.TelemetryClient({
1212
+ packageName: packageJson.name,
1213
+ packageVersion: packageJson.version
1214
+ });
1215
+ var telemetry_client_default = telemetryClient;
981
1216
 
982
1217
  // src/service-adapters/events.ts
983
1218
  var RuntimeEventTypes;
@@ -989,6 +1224,7 @@ var RuntimeEventTypes;
989
1224
  RuntimeEventTypes2["ActionExecutionArgs"] = "ActionExecutionArgs";
990
1225
  RuntimeEventTypes2["ActionExecutionEnd"] = "ActionExecutionEnd";
991
1226
  RuntimeEventTypes2["ActionExecutionResult"] = "ActionExecutionResult";
1227
+ RuntimeEventTypes2["AgentStateMessage"] = "AgentStateMessage";
992
1228
  })(RuntimeEventTypes || (RuntimeEventTypes = {}));
993
1229
 
994
1230
  // src/graphql/resolvers/copilot.resolver.ts
@@ -1029,18 +1265,9 @@ var UnknownErrorResponse = class extends FailedResponseStatus {
1029
1265
  };
1030
1266
  __name(UnknownErrorResponse, "UnknownErrorResponse");
1031
1267
 
1032
- // src/lib/telemetry-client.ts
1033
- var import_shared = require("@copilotkit/shared");
1034
- var packageJson = require_package();
1035
- var telemetryClient = new import_shared.TelemetryClient({
1036
- packageName: packageJson.name,
1037
- packageVersion: packageJson.version
1038
- });
1039
- var telemetry_client_default = telemetryClient;
1040
-
1041
1268
  // src/graphql/resolvers/copilot.resolver.ts
1042
1269
  var import_shared2 = require("@copilotkit/shared");
1043
- function _ts_decorate12(decorators, target, key, desc) {
1270
+ function _ts_decorate14(decorators, target, key, desc) {
1044
1271
  var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
1045
1272
  if (typeof Reflect === "object" && typeof Reflect.decorate === "function")
1046
1273
  r = Reflect.decorate(decorators, target, key, desc);
@@ -1050,12 +1277,12 @@ function _ts_decorate12(decorators, target, key, desc) {
1050
1277
  r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
1051
1278
  return c > 3 && r && Object.defineProperty(target, key, r), r;
1052
1279
  }
1053
- __name(_ts_decorate12, "_ts_decorate");
1054
- function _ts_metadata12(k, v) {
1280
+ __name(_ts_decorate14, "_ts_decorate");
1281
+ function _ts_metadata14(k, v) {
1055
1282
  if (typeof Reflect === "object" && typeof Reflect.metadata === "function")
1056
1283
  return Reflect.metadata(k, v);
1057
1284
  }
1058
- __name(_ts_metadata12, "_ts_metadata");
1285
+ __name(_ts_metadata14, "_ts_metadata");
1059
1286
  function _ts_param(paramIndex, decorator) {
1060
1287
  return function(target, key) {
1061
1288
  decorator(target, key, paramIndex);
@@ -1064,7 +1291,6 @@ function _ts_param(paramIndex, decorator) {
1064
1291
  __name(_ts_param, "_ts_param");
1065
1292
  var invokeGuardrails = /* @__PURE__ */ __name(async ({ baseUrl, copilotCloudPublicApiKey, data, onResult, onError }) => {
1066
1293
  var _a;
1067
- console.log("invokeGuardrails.baseUrl", baseUrl);
1068
1294
  if (data.messages.length && ((_a = data.messages[data.messages.length - 1].textMessage) == null ? void 0 : _a.role) === MessageRole.user) {
1069
1295
  const messages = data.messages.filter((m) => m.textMessage !== void 0 && (m.textMessage.role === MessageRole.user || m.textMessage.role === MessageRole.assistant)).map((m) => ({
1070
1296
  role: m.textMessage.role,
@@ -1110,8 +1336,6 @@ var CopilotResolver = class {
1110
1336
  logger2.debug({
1111
1337
  data
1112
1338
  }, "Generating Copilot response");
1113
- const copilotRuntime = ctx._copilotkit.runtime;
1114
- const serviceAdapter = ctx._copilotkit.serviceAdapter;
1115
1339
  if (properties) {
1116
1340
  logger2.debug("Properties provided, merging with context properties");
1117
1341
  ctx.properties = {
@@ -1119,6 +1343,8 @@ var CopilotResolver = class {
1119
1343
  ...properties
1120
1344
  };
1121
1345
  }
1346
+ const copilotRuntime = ctx._copilotkit.runtime;
1347
+ const serviceAdapter = ctx._copilotkit.serviceAdapter;
1122
1348
  let copilotCloudPublicApiKey = null;
1123
1349
  let copilotCloudBaseUrl;
1124
1350
  if (data.cloud) {
@@ -1157,16 +1383,19 @@ var CopilotResolver = class {
1157
1383
  rejectOutputMessagesPromise = reject;
1158
1384
  });
1159
1385
  logger2.debug("Processing");
1160
- const { eventSource, threadId = (0, import_shared2.randomId)(), runId, actions } = await copilotRuntime.process({
1386
+ const { eventSource, threadId = (0, import_shared2.randomId)(), runId, serverSideActions, actionInputsWithoutAgents } = await copilotRuntime.processRuntimeRequest({
1161
1387
  serviceAdapter,
1162
1388
  messages: data.messages,
1163
1389
  actions: data.frontend.actions,
1164
1390
  threadId: data.threadId,
1165
1391
  runId: data.runId,
1166
1392
  publicApiKey: void 0,
1167
- properties: ctx.properties || {},
1168
1393
  outputMessagesPromise,
1169
- forwardedParameters: data.forwardedParameters
1394
+ graphqlContext: ctx,
1395
+ forwardedParameters: data.forwardedParameters,
1396
+ agentSession: data.agentSession,
1397
+ agentStates: data.agentStates,
1398
+ url: data.frontend.url
1170
1399
  });
1171
1400
  logger2.debug("Event source created, creating response");
1172
1401
  const response = {
@@ -1223,9 +1452,13 @@ var CopilotResolver = class {
1223
1452
  });
1224
1453
  }
1225
1454
  let eventStreamSubscription;
1226
- const eventStream = eventSource.process({
1227
- serversideActions: actions,
1228
- guardrailsResult$: ((_b2 = data.cloud) == null ? void 0 : _b2.guardrails) ? guardrailsResult$ : null
1455
+ const eventStream = eventSource.processRuntimeEvents({
1456
+ serverSideActions,
1457
+ guardrailsResult$: ((_b2 = data.cloud) == null ? void 0 : _b2.guardrails) ? guardrailsResult$ : null,
1458
+ actionInputsWithoutAgents: actionInputsWithoutAgents.filter(
1459
+ // TODO-AGENTS: do not exclude ALL server side actions
1460
+ (action) => !serverSideActions.find((serverSideAction) => serverSideAction.name == action.name)
1461
+ )
1229
1462
  }).pipe(
1230
1463
  // shareReplay() ensures that later subscribers will see the whole stream instead of
1231
1464
  // just the events that were emitted after the subscriber was added.
@@ -1373,6 +1606,36 @@ var CopilotResolver = class {
1373
1606
  result: event.result
1374
1607
  }));
1375
1608
  break;
1609
+ case RuntimeEventTypes.AgentStateMessage:
1610
+ logger2.debug({
1611
+ event
1612
+ }, "Agent message event received");
1613
+ pushMessage({
1614
+ id: (0, import_shared2.randomId)(),
1615
+ status: new SuccessMessageStatus(),
1616
+ threadId: event.threadId,
1617
+ agentName: event.agentName,
1618
+ nodeName: event.nodeName,
1619
+ runId: event.runId,
1620
+ active: event.active,
1621
+ state: event.state,
1622
+ running: event.running,
1623
+ role: MessageRole.assistant,
1624
+ createdAt: /* @__PURE__ */ new Date()
1625
+ });
1626
+ outputMessages.push((0, import_class_transformer.plainToInstance)(AgentStateMessage, {
1627
+ id: (0, import_shared2.randomId)(),
1628
+ threadId: event.threadId,
1629
+ agentName: event.agentName,
1630
+ nodeName: event.nodeName,
1631
+ runId: event.runId,
1632
+ active: event.active,
1633
+ state: event.state,
1634
+ running: event.running,
1635
+ role: MessageRole.assistant,
1636
+ createdAt: /* @__PURE__ */ new Date()
1637
+ }));
1638
+ break;
1376
1639
  }
1377
1640
  },
1378
1641
  error: (err) => {
@@ -1405,29 +1668,29 @@ var CopilotResolver = class {
1405
1668
  }
1406
1669
  };
1407
1670
  __name(CopilotResolver, "CopilotResolver");
1408
- _ts_decorate12([
1409
- (0, import_type_graphql13.Query)(() => String),
1410
- _ts_metadata12("design:type", Function),
1411
- _ts_metadata12("design:paramtypes", []),
1412
- _ts_metadata12("design:returntype", Promise)
1671
+ _ts_decorate14([
1672
+ (0, import_type_graphql15.Query)(() => String),
1673
+ _ts_metadata14("design:type", Function),
1674
+ _ts_metadata14("design:paramtypes", []),
1675
+ _ts_metadata14("design:returntype", Promise)
1413
1676
  ], CopilotResolver.prototype, "hello", null);
1414
- _ts_decorate12([
1415
- (0, import_type_graphql13.Mutation)(() => CopilotResponse),
1416
- _ts_param(0, (0, import_type_graphql13.Ctx)()),
1417
- _ts_param(1, (0, import_type_graphql13.Arg)("data")),
1418
- _ts_param(2, (0, import_type_graphql13.Arg)("properties", () => import_graphql_scalars2.GraphQLJSONObject, {
1677
+ _ts_decorate14([
1678
+ (0, import_type_graphql15.Mutation)(() => CopilotResponse),
1679
+ _ts_param(0, (0, import_type_graphql15.Ctx)()),
1680
+ _ts_param(1, (0, import_type_graphql15.Arg)("data")),
1681
+ _ts_param(2, (0, import_type_graphql15.Arg)("properties", () => import_graphql_scalars2.GraphQLJSONObject, {
1419
1682
  nullable: true
1420
1683
  })),
1421
- _ts_metadata12("design:type", Function),
1422
- _ts_metadata12("design:paramtypes", [
1684
+ _ts_metadata14("design:type", Function),
1685
+ _ts_metadata14("design:paramtypes", [
1423
1686
  typeof GraphQLContext === "undefined" ? Object : GraphQLContext,
1424
1687
  typeof GenerateCopilotResponseInput === "undefined" ? Object : GenerateCopilotResponseInput,
1425
1688
  typeof CopilotRequestContextProperties === "undefined" ? Object : CopilotRequestContextProperties
1426
1689
  ]),
1427
- _ts_metadata12("design:returntype", Promise)
1690
+ _ts_metadata14("design:returntype", Promise)
1428
1691
  ], CopilotResolver.prototype, "generateCopilotResponse", null);
1429
- CopilotResolver = _ts_decorate12([
1430
- (0, import_type_graphql13.Resolver)(() => CopilotResponse)
1692
+ CopilotResolver = _ts_decorate14([
1693
+ (0, import_type_graphql15.Resolver)(() => CopilotResponse)
1431
1694
  ], CopilotResolver);
1432
1695
 
1433
1696
  // src/lib/integrations/shared.ts
@@ -1482,7 +1745,7 @@ async function createContext(initialContext, copilotKitContext, contextLogger, p
1482
1745
  __name(createContext, "createContext");
1483
1746
  function buildSchema(options = {}) {
1484
1747
  logger.debug("Building GraphQL schema...");
1485
- const schema = (0, import_type_graphql14.buildSchemaSync)({
1748
+ const schema = (0, import_type_graphql16.buildSchemaSync)({
1486
1749
  resolvers: [
1487
1750
  CopilotResolver
1488
1751
  ],