@copilotkit/runtime 1.2.1 → 1.2.2-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 (75) hide show
  1. package/CHANGELOG.md +26 -0
  2. package/__snapshots__/schema/schema.graphql +41 -0
  3. package/dist/{chunk-YMUS43FR.mjs → chunk-2N45GS3P.mjs} +2 -2
  4. package/dist/{chunk-URMISMK2.mjs → chunk-73NMP3DI.mjs} +2 -2
  5. package/dist/{chunk-736EEICU.mjs → chunk-BJ2LVHWA.mjs} +3 -3
  6. package/dist/{chunk-DMO6FA25.mjs → chunk-T6O5FSTK.mjs} +2 -2
  7. package/dist/{chunk-GEIBJJQ4.mjs → chunk-TBZGOJJX.mjs} +14 -2
  8. package/dist/chunk-TBZGOJJX.mjs.map +1 -0
  9. package/dist/{chunk-DYF5MUAH.mjs → chunk-X5QBBMCJ.mjs} +2 -2
  10. package/dist/{chunk-Q5ZTE7WH.mjs → chunk-XROLDARH.mjs} +786 -158
  11. package/dist/chunk-XROLDARH.mjs.map +1 -0
  12. package/dist/chunk-ZNZGATLW.mjs +260 -0
  13. package/dist/chunk-ZNZGATLW.mjs.map +1 -0
  14. package/dist/{shared-c5362338.d.ts → copilot-runtime-d427e991.d.ts} +65 -38
  15. package/dist/graphql/types/converted/index.d.ts +1 -1
  16. package/dist/graphql/types/converted/index.js +13 -0
  17. package/dist/graphql/types/converted/index.js.map +1 -1
  18. package/dist/graphql/types/converted/index.mjs +3 -1
  19. package/dist/{index-aa091e3c.d.ts → index-0476e4f7.d.ts} +24 -2
  20. package/dist/{index-13aa818e.d.ts → index-079752b9.d.ts} +1 -1
  21. package/dist/index.d.ts +7 -7
  22. package/dist/index.js +982 -245
  23. package/dist/index.js.map +1 -1
  24. package/dist/index.mjs +8 -8
  25. package/dist/{langserve-a54438c6.d.ts → langserve-d6073a3b.d.ts} +24 -11
  26. package/dist/lib/index.d.ts +7 -7
  27. package/dist/lib/index.js +982 -245
  28. package/dist/lib/index.js.map +1 -1
  29. package/dist/lib/index.mjs +8 -8
  30. package/dist/lib/integrations/index.d.ts +6 -6
  31. package/dist/lib/integrations/index.js +437 -182
  32. package/dist/lib/integrations/index.js.map +1 -1
  33. package/dist/lib/integrations/index.mjs +6 -6
  34. package/dist/lib/integrations/nest/index.d.ts +5 -5
  35. package/dist/lib/integrations/nest/index.js +437 -182
  36. package/dist/lib/integrations/nest/index.js.map +1 -1
  37. package/dist/lib/integrations/nest/index.mjs +4 -4
  38. package/dist/lib/integrations/node-express/index.d.ts +5 -5
  39. package/dist/lib/integrations/node-express/index.js +437 -182
  40. package/dist/lib/integrations/node-express/index.js.map +1 -1
  41. package/dist/lib/integrations/node-express/index.mjs +4 -4
  42. package/dist/lib/integrations/node-http/index.d.ts +5 -5
  43. package/dist/lib/integrations/node-http/index.js +437 -182
  44. package/dist/lib/integrations/node-http/index.js.map +1 -1
  45. package/dist/lib/integrations/node-http/index.mjs +3 -3
  46. package/dist/service-adapters/index.d.ts +3 -3
  47. package/dist/service-adapters/index.js.map +1 -1
  48. package/dist/service-adapters/index.mjs +3 -3
  49. package/package.json +7 -5
  50. package/src/agents/langgraph/event-source.ts +222 -0
  51. package/src/agents/langgraph/events.ts +309 -0
  52. package/src/graphql/inputs/agent-session.input.ts +13 -0
  53. package/src/graphql/inputs/agent-state.input.ts +10 -0
  54. package/src/graphql/inputs/generate-copilot-response.input.ts +11 -0
  55. package/src/graphql/inputs/message.input.ts +30 -0
  56. package/src/graphql/resolvers/copilot.resolver.ts +56 -12
  57. package/src/graphql/types/converted/index.ts +15 -0
  58. package/src/graphql/types/copilot-response.type.ts +29 -0
  59. package/src/graphql/types/enums.ts +1 -0
  60. package/src/lib/index.ts +1 -1
  61. package/src/lib/integrations/shared.ts +1 -1
  62. package/src/lib/runtime/copilot-runtime.ts +360 -0
  63. package/src/lib/runtime/remote-actions.ts +241 -0
  64. package/src/service-adapters/conversion.ts +16 -0
  65. package/src/service-adapters/events.ts +101 -19
  66. package/dist/chunk-GEIBJJQ4.mjs.map +0 -1
  67. package/dist/chunk-PB24CCIJ.mjs +0 -158
  68. package/dist/chunk-PB24CCIJ.mjs.map +0 -1
  69. package/dist/chunk-Q5ZTE7WH.mjs.map +0 -1
  70. package/src/lib/copilot-runtime.ts +0 -231
  71. /package/dist/{chunk-YMUS43FR.mjs.map → chunk-2N45GS3P.mjs.map} +0 -0
  72. /package/dist/{chunk-URMISMK2.mjs.map → chunk-73NMP3DI.mjs.map} +0 -0
  73. /package/dist/{chunk-736EEICU.mjs.map → chunk-BJ2LVHWA.mjs.map} +0 -0
  74. /package/dist/{chunk-DMO6FA25.mjs.map → chunk-T6O5FSTK.mjs.map} +0 -0
  75. /package/dist/{chunk-DYF5MUAH.mjs.map → chunk-X5QBBMCJ.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.2.1",
47
+ version: "1.2.2-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",
@@ -131,14 +133,14 @@ __export(integrations_exports, {
131
133
  module.exports = __toCommonJS(integrations_exports);
132
134
 
133
135
  // src/lib/integrations/shared.ts
134
- var import_type_graphql14 = require("type-graphql");
136
+ var import_type_graphql16 = require("type-graphql");
135
137
 
136
138
  // src/graphql/resolvers/copilot.resolver.ts
137
- var import_type_graphql13 = require("type-graphql");
139
+ var import_type_graphql15 = require("type-graphql");
138
140
  var import_rxjs2 = require("rxjs");
139
141
 
140
142
  // src/graphql/inputs/generate-copilot-response.input.ts
141
- var import_type_graphql9 = require("type-graphql");
143
+ var import_type_graphql11 = require("type-graphql");
142
144
 
143
145
  // src/graphql/inputs/message.input.ts
144
146
  var import_type_graphql3 = require("type-graphql");
@@ -155,6 +157,7 @@ var ActionExecutionScope;
155
157
  (function(ActionExecutionScope2) {
156
158
  ActionExecutionScope2["server"] = "server";
157
159
  ActionExecutionScope2["client"] = "client";
160
+ ActionExecutionScope2["passThrough"] = "passThrough";
158
161
  })(ActionExecutionScope || (ActionExecutionScope = {}));
159
162
  var CopilotRequestType;
160
163
  (function(CopilotRequestType2) {
@@ -233,6 +236,7 @@ var MessageInput = class extends BaseMessage {
233
236
  textMessage;
234
237
  actionExecutionMessage;
235
238
  resultMessage;
239
+ agentStateMessage;
236
240
  };
237
241
  __name(MessageInput, "MessageInput");
238
242
  _ts_decorate2([
@@ -253,6 +257,12 @@ _ts_decorate2([
253
257
  }),
254
258
  _ts_metadata2("design:type", typeof ResultMessageInput === "undefined" ? Object : ResultMessageInput)
255
259
  ], MessageInput.prototype, "resultMessage", void 0);
260
+ _ts_decorate2([
261
+ (0, import_type_graphql3.Field)(() => AgentStateMessageInput, {
262
+ nullable: true
263
+ }),
264
+ _ts_metadata2("design:type", typeof AgentStateMessageInput === "undefined" ? Object : AgentStateMessageInput)
265
+ ], MessageInput.prototype, "agentStateMessage", void 0);
256
266
  MessageInput = _ts_decorate2([
257
267
  (0, import_type_graphql3.InputType)()
258
268
  ], MessageInput);
@@ -314,6 +324,52 @@ _ts_decorate2([
314
324
  ResultMessageInput = _ts_decorate2([
315
325
  (0, import_type_graphql3.InputType)()
316
326
  ], ResultMessageInput);
327
+ var AgentStateMessageInput = class {
328
+ threadId;
329
+ agentName;
330
+ role;
331
+ state;
332
+ running;
333
+ nodeName;
334
+ runId;
335
+ active;
336
+ };
337
+ __name(AgentStateMessageInput, "AgentStateMessageInput");
338
+ _ts_decorate2([
339
+ (0, import_type_graphql3.Field)(() => String),
340
+ _ts_metadata2("design:type", String)
341
+ ], AgentStateMessageInput.prototype, "threadId", void 0);
342
+ _ts_decorate2([
343
+ (0, import_type_graphql3.Field)(() => String),
344
+ _ts_metadata2("design:type", String)
345
+ ], AgentStateMessageInput.prototype, "agentName", void 0);
346
+ _ts_decorate2([
347
+ (0, import_type_graphql3.Field)(() => MessageRole),
348
+ _ts_metadata2("design:type", typeof MessageRole === "undefined" ? Object : MessageRole)
349
+ ], AgentStateMessageInput.prototype, "role", void 0);
350
+ _ts_decorate2([
351
+ (0, import_type_graphql3.Field)(() => String),
352
+ _ts_metadata2("design:type", String)
353
+ ], AgentStateMessageInput.prototype, "state", void 0);
354
+ _ts_decorate2([
355
+ (0, import_type_graphql3.Field)(() => Boolean),
356
+ _ts_metadata2("design:type", Boolean)
357
+ ], AgentStateMessageInput.prototype, "running", void 0);
358
+ _ts_decorate2([
359
+ (0, import_type_graphql3.Field)(() => String),
360
+ _ts_metadata2("design:type", String)
361
+ ], AgentStateMessageInput.prototype, "nodeName", void 0);
362
+ _ts_decorate2([
363
+ (0, import_type_graphql3.Field)(() => String),
364
+ _ts_metadata2("design:type", String)
365
+ ], AgentStateMessageInput.prototype, "runId", void 0);
366
+ _ts_decorate2([
367
+ (0, import_type_graphql3.Field)(() => Boolean),
368
+ _ts_metadata2("design:type", Boolean)
369
+ ], AgentStateMessageInput.prototype, "active", void 0);
370
+ AgentStateMessageInput = _ts_decorate2([
371
+ (0, import_type_graphql3.InputType)()
372
+ ], AgentStateMessageInput);
317
373
 
318
374
  // src/graphql/inputs/frontend.input.ts
319
375
  var import_type_graphql5 = require("type-graphql");
@@ -555,7 +611,8 @@ ForwardedParametersInput = _ts_decorate7([
555
611
  (0, import_type_graphql8.InputType)()
556
612
  ], ForwardedParametersInput);
557
613
 
558
- // src/graphql/inputs/generate-copilot-response.input.ts
614
+ // src/graphql/inputs/agent-session.input.ts
615
+ var import_type_graphql9 = require("type-graphql");
559
616
  function _ts_decorate8(decorators, target, key, desc) {
560
617
  var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
561
618
  if (typeof Reflect === "object" && typeof Reflect.decorate === "function")
@@ -572,18 +629,96 @@ function _ts_metadata8(k, v) {
572
629
  return Reflect.metadata(k, v);
573
630
  }
574
631
  __name(_ts_metadata8, "_ts_metadata");
632
+ var AgentSessionInput = class {
633
+ agentName;
634
+ threadId;
635
+ nodeName;
636
+ };
637
+ __name(AgentSessionInput, "AgentSessionInput");
638
+ _ts_decorate8([
639
+ (0, import_type_graphql9.Field)(() => String),
640
+ _ts_metadata8("design:type", String)
641
+ ], AgentSessionInput.prototype, "agentName", void 0);
642
+ _ts_decorate8([
643
+ (0, import_type_graphql9.Field)(() => String, {
644
+ nullable: true
645
+ }),
646
+ _ts_metadata8("design:type", String)
647
+ ], AgentSessionInput.prototype, "threadId", void 0);
648
+ _ts_decorate8([
649
+ (0, import_type_graphql9.Field)(() => String, {
650
+ nullable: true
651
+ }),
652
+ _ts_metadata8("design:type", String)
653
+ ], AgentSessionInput.prototype, "nodeName", void 0);
654
+ AgentSessionInput = _ts_decorate8([
655
+ (0, import_type_graphql9.InputType)()
656
+ ], AgentSessionInput);
657
+
658
+ // src/graphql/inputs/agent-state.input.ts
659
+ var import_type_graphql10 = require("type-graphql");
660
+ function _ts_decorate9(decorators, target, key, desc) {
661
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
662
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function")
663
+ r = Reflect.decorate(decorators, target, key, desc);
664
+ else
665
+ for (var i = decorators.length - 1; i >= 0; i--)
666
+ if (d = decorators[i])
667
+ r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
668
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
669
+ }
670
+ __name(_ts_decorate9, "_ts_decorate");
671
+ function _ts_metadata9(k, v) {
672
+ if (typeof Reflect === "object" && typeof Reflect.metadata === "function")
673
+ return Reflect.metadata(k, v);
674
+ }
675
+ __name(_ts_metadata9, "_ts_metadata");
676
+ var AgentStateInput = class {
677
+ agentName;
678
+ state;
679
+ };
680
+ __name(AgentStateInput, "AgentStateInput");
681
+ _ts_decorate9([
682
+ (0, import_type_graphql10.Field)(() => String),
683
+ _ts_metadata9("design:type", String)
684
+ ], AgentStateInput.prototype, "agentName", void 0);
685
+ _ts_decorate9([
686
+ (0, import_type_graphql10.Field)(() => String),
687
+ _ts_metadata9("design:type", String)
688
+ ], AgentStateInput.prototype, "state", void 0);
689
+ AgentStateInput = _ts_decorate9([
690
+ (0, import_type_graphql10.InputType)()
691
+ ], AgentStateInput);
692
+
693
+ // src/graphql/inputs/generate-copilot-response.input.ts
694
+ function _ts_decorate10(decorators, target, key, desc) {
695
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
696
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function")
697
+ r = Reflect.decorate(decorators, target, key, desc);
698
+ else
699
+ for (var i = decorators.length - 1; i >= 0; i--)
700
+ if (d = decorators[i])
701
+ r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
702
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
703
+ }
704
+ __name(_ts_decorate10, "_ts_decorate");
705
+ function _ts_metadata10(k, v) {
706
+ if (typeof Reflect === "object" && typeof Reflect.metadata === "function")
707
+ return Reflect.metadata(k, v);
708
+ }
709
+ __name(_ts_metadata10, "_ts_metadata");
575
710
  var GenerateCopilotResponseMetadataInput = class {
576
711
  requestType;
577
712
  };
578
713
  __name(GenerateCopilotResponseMetadataInput, "GenerateCopilotResponseMetadataInput");
579
- _ts_decorate8([
580
- (0, import_type_graphql9.Field)(() => CopilotRequestType, {
714
+ _ts_decorate10([
715
+ (0, import_type_graphql11.Field)(() => CopilotRequestType, {
581
716
  nullable: true
582
717
  }),
583
- _ts_metadata8("design:type", typeof CopilotRequestType === "undefined" ? Object : CopilotRequestType)
718
+ _ts_metadata10("design:type", typeof CopilotRequestType === "undefined" ? Object : CopilotRequestType)
584
719
  ], GenerateCopilotResponseMetadataInput.prototype, "requestType", void 0);
585
- GenerateCopilotResponseMetadataInput = _ts_decorate8([
586
- (0, import_type_graphql9.InputType)()
720
+ GenerateCopilotResponseMetadataInput = _ts_decorate10([
721
+ (0, import_type_graphql11.InputType)()
587
722
  ], GenerateCopilotResponseMetadataInput);
588
723
  var GenerateCopilotResponseInput = class {
589
724
  metadata;
@@ -593,58 +728,81 @@ var GenerateCopilotResponseInput = class {
593
728
  frontend;
594
729
  cloud;
595
730
  forwardedParameters;
731
+ agentSession;
732
+ agentState;
733
+ agentStates;
596
734
  };
597
735
  __name(GenerateCopilotResponseInput, "GenerateCopilotResponseInput");
598
- _ts_decorate8([
599
- (0, import_type_graphql9.Field)(() => GenerateCopilotResponseMetadataInput, {
736
+ _ts_decorate10([
737
+ (0, import_type_graphql11.Field)(() => GenerateCopilotResponseMetadataInput, {
600
738
  nullable: false
601
739
  }),
602
- _ts_metadata8("design:type", typeof GenerateCopilotResponseMetadataInput === "undefined" ? Object : GenerateCopilotResponseMetadataInput)
740
+ _ts_metadata10("design:type", typeof GenerateCopilotResponseMetadataInput === "undefined" ? Object : GenerateCopilotResponseMetadataInput)
603
741
  ], GenerateCopilotResponseInput.prototype, "metadata", void 0);
604
- _ts_decorate8([
605
- (0, import_type_graphql9.Field)(() => String, {
742
+ _ts_decorate10([
743
+ (0, import_type_graphql11.Field)(() => String, {
606
744
  nullable: true
607
745
  }),
608
- _ts_metadata8("design:type", String)
746
+ _ts_metadata10("design:type", String)
609
747
  ], GenerateCopilotResponseInput.prototype, "threadId", void 0);
610
- _ts_decorate8([
611
- (0, import_type_graphql9.Field)(() => String, {
748
+ _ts_decorate10([
749
+ (0, import_type_graphql11.Field)(() => String, {
612
750
  nullable: true
613
751
  }),
614
- _ts_metadata8("design:type", String)
752
+ _ts_metadata10("design:type", String)
615
753
  ], GenerateCopilotResponseInput.prototype, "runId", void 0);
616
- _ts_decorate8([
617
- (0, import_type_graphql9.Field)(() => [
754
+ _ts_decorate10([
755
+ (0, import_type_graphql11.Field)(() => [
618
756
  MessageInput
619
757
  ]),
620
- _ts_metadata8("design:type", Array)
758
+ _ts_metadata10("design:type", Array)
621
759
  ], GenerateCopilotResponseInput.prototype, "messages", void 0);
622
- _ts_decorate8([
623
- (0, import_type_graphql9.Field)(() => FrontendInput),
624
- _ts_metadata8("design:type", typeof FrontendInput === "undefined" ? Object : FrontendInput)
760
+ _ts_decorate10([
761
+ (0, import_type_graphql11.Field)(() => FrontendInput),
762
+ _ts_metadata10("design:type", typeof FrontendInput === "undefined" ? Object : FrontendInput)
625
763
  ], GenerateCopilotResponseInput.prototype, "frontend", void 0);
626
- _ts_decorate8([
627
- (0, import_type_graphql9.Field)(() => CloudInput, {
764
+ _ts_decorate10([
765
+ (0, import_type_graphql11.Field)(() => CloudInput, {
628
766
  nullable: true
629
767
  }),
630
- _ts_metadata8("design:type", typeof CloudInput === "undefined" ? Object : CloudInput)
768
+ _ts_metadata10("design:type", typeof CloudInput === "undefined" ? Object : CloudInput)
631
769
  ], GenerateCopilotResponseInput.prototype, "cloud", void 0);
632
- _ts_decorate8([
633
- (0, import_type_graphql9.Field)(() => ForwardedParametersInput, {
770
+ _ts_decorate10([
771
+ (0, import_type_graphql11.Field)(() => ForwardedParametersInput, {
634
772
  nullable: true
635
773
  }),
636
- _ts_metadata8("design:type", typeof ForwardedParametersInput === "undefined" ? Object : ForwardedParametersInput)
774
+ _ts_metadata10("design:type", typeof ForwardedParametersInput === "undefined" ? Object : ForwardedParametersInput)
637
775
  ], GenerateCopilotResponseInput.prototype, "forwardedParameters", void 0);
638
- GenerateCopilotResponseInput = _ts_decorate8([
639
- (0, import_type_graphql9.InputType)()
776
+ _ts_decorate10([
777
+ (0, import_type_graphql11.Field)(() => AgentSessionInput, {
778
+ nullable: true
779
+ }),
780
+ _ts_metadata10("design:type", typeof AgentSessionInput === "undefined" ? Object : AgentSessionInput)
781
+ ], GenerateCopilotResponseInput.prototype, "agentSession", void 0);
782
+ _ts_decorate10([
783
+ (0, import_type_graphql11.Field)(() => AgentStateInput, {
784
+ nullable: true
785
+ }),
786
+ _ts_metadata10("design:type", typeof AgentStateInput === "undefined" ? Object : AgentStateInput)
787
+ ], GenerateCopilotResponseInput.prototype, "agentState", void 0);
788
+ _ts_decorate10([
789
+ (0, import_type_graphql11.Field)(() => [
790
+ AgentStateInput
791
+ ], {
792
+ nullable: true
793
+ }),
794
+ _ts_metadata10("design:type", Array)
795
+ ], GenerateCopilotResponseInput.prototype, "agentStates", void 0);
796
+ GenerateCopilotResponseInput = _ts_decorate10([
797
+ (0, import_type_graphql11.InputType)()
640
798
  ], GenerateCopilotResponseInput);
641
799
 
642
800
  // src/graphql/types/copilot-response.type.ts
643
- var import_type_graphql12 = require("type-graphql");
801
+ var import_type_graphql14 = require("type-graphql");
644
802
 
645
803
  // src/graphql/types/message-status.type.ts
646
- var import_type_graphql10 = require("type-graphql");
647
- function _ts_decorate9(decorators, target, key, desc) {
804
+ var import_type_graphql12 = require("type-graphql");
805
+ function _ts_decorate11(decorators, target, key, desc) {
648
806
  var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
649
807
  if (typeof Reflect === "object" && typeof Reflect.decorate === "function")
650
808
  r = Reflect.decorate(decorators, target, key, desc);
@@ -654,58 +812,58 @@ function _ts_decorate9(decorators, target, key, desc) {
654
812
  r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
655
813
  return c > 3 && r && Object.defineProperty(target, key, r), r;
656
814
  }
657
- __name(_ts_decorate9, "_ts_decorate");
658
- function _ts_metadata9(k, v) {
815
+ __name(_ts_decorate11, "_ts_decorate");
816
+ function _ts_metadata11(k, v) {
659
817
  if (typeof Reflect === "object" && typeof Reflect.metadata === "function")
660
818
  return Reflect.metadata(k, v);
661
819
  }
662
- __name(_ts_metadata9, "_ts_metadata");
820
+ __name(_ts_metadata11, "_ts_metadata");
663
821
  var MessageStatusCode;
664
822
  (function(MessageStatusCode2) {
665
823
  MessageStatusCode2["Pending"] = "pending";
666
824
  MessageStatusCode2["Success"] = "success";
667
825
  MessageStatusCode2["Failed"] = "failed";
668
826
  })(MessageStatusCode || (MessageStatusCode = {}));
669
- (0, import_type_graphql10.registerEnumType)(MessageStatusCode, {
827
+ (0, import_type_graphql12.registerEnumType)(MessageStatusCode, {
670
828
  name: "MessageStatusCode"
671
829
  });
672
830
  var BaseMessageStatus = /* @__PURE__ */ __name(class BaseMessageStatus2 {
673
831
  code;
674
832
  }, "BaseMessageStatus");
675
- _ts_decorate9([
676
- (0, import_type_graphql10.Field)(() => MessageStatusCode),
677
- _ts_metadata9("design:type", String)
833
+ _ts_decorate11([
834
+ (0, import_type_graphql12.Field)(() => MessageStatusCode),
835
+ _ts_metadata11("design:type", String)
678
836
  ], BaseMessageStatus.prototype, "code", void 0);
679
- BaseMessageStatus = _ts_decorate9([
680
- (0, import_type_graphql10.ObjectType)()
837
+ BaseMessageStatus = _ts_decorate11([
838
+ (0, import_type_graphql12.ObjectType)()
681
839
  ], BaseMessageStatus);
682
840
  var PendingMessageStatus = class extends BaseMessageStatus {
683
841
  code = "pending";
684
842
  };
685
843
  __name(PendingMessageStatus, "PendingMessageStatus");
686
- PendingMessageStatus = _ts_decorate9([
687
- (0, import_type_graphql10.ObjectType)()
844
+ PendingMessageStatus = _ts_decorate11([
845
+ (0, import_type_graphql12.ObjectType)()
688
846
  ], PendingMessageStatus);
689
847
  var SuccessMessageStatus = class extends BaseMessageStatus {
690
848
  code = "success";
691
849
  };
692
850
  __name(SuccessMessageStatus, "SuccessMessageStatus");
693
- SuccessMessageStatus = _ts_decorate9([
694
- (0, import_type_graphql10.ObjectType)()
851
+ SuccessMessageStatus = _ts_decorate11([
852
+ (0, import_type_graphql12.ObjectType)()
695
853
  ], SuccessMessageStatus);
696
854
  var FailedMessageStatus = class extends BaseMessageStatus {
697
855
  code = "failed";
698
856
  reason;
699
857
  };
700
858
  __name(FailedMessageStatus, "FailedMessageStatus");
701
- _ts_decorate9([
702
- (0, import_type_graphql10.Field)(() => String),
703
- _ts_metadata9("design:type", String)
859
+ _ts_decorate11([
860
+ (0, import_type_graphql12.Field)(() => String),
861
+ _ts_metadata11("design:type", String)
704
862
  ], FailedMessageStatus.prototype, "reason", void 0);
705
- FailedMessageStatus = _ts_decorate9([
706
- (0, import_type_graphql10.ObjectType)()
863
+ FailedMessageStatus = _ts_decorate11([
864
+ (0, import_type_graphql12.ObjectType)()
707
865
  ], FailedMessageStatus);
708
- var MessageStatusUnion = (0, import_type_graphql10.createUnionType)({
866
+ var MessageStatusUnion = (0, import_type_graphql12.createUnionType)({
709
867
  name: "MessageStatus",
710
868
  types: () => [
711
869
  PendingMessageStatus,
@@ -716,8 +874,8 @@ var MessageStatusUnion = (0, import_type_graphql10.createUnionType)({
716
874
 
717
875
  // src/graphql/types/response-status.type.ts
718
876
  var import_graphql_scalars = require("graphql-scalars");
719
- var import_type_graphql11 = require("type-graphql");
720
- function _ts_decorate10(decorators, target, key, desc) {
877
+ var import_type_graphql13 = require("type-graphql");
878
+ function _ts_decorate12(decorators, target, key, desc) {
721
879
  var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
722
880
  if (typeof Reflect === "object" && typeof Reflect.decorate === "function")
723
881
  r = Reflect.decorate(decorators, target, key, desc);
@@ -727,30 +885,30 @@ function _ts_decorate10(decorators, target, key, desc) {
727
885
  r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
728
886
  return c > 3 && r && Object.defineProperty(target, key, r), r;
729
887
  }
730
- __name(_ts_decorate10, "_ts_decorate");
731
- function _ts_metadata10(k, v) {
888
+ __name(_ts_decorate12, "_ts_decorate");
889
+ function _ts_metadata12(k, v) {
732
890
  if (typeof Reflect === "object" && typeof Reflect.metadata === "function")
733
891
  return Reflect.metadata(k, v);
734
892
  }
735
- __name(_ts_metadata10, "_ts_metadata");
893
+ __name(_ts_metadata12, "_ts_metadata");
736
894
  var ResponseStatusCode;
737
895
  (function(ResponseStatusCode2) {
738
896
  ResponseStatusCode2["Pending"] = "pending";
739
897
  ResponseStatusCode2["Success"] = "success";
740
898
  ResponseStatusCode2["Failed"] = "failed";
741
899
  })(ResponseStatusCode || (ResponseStatusCode = {}));
742
- (0, import_type_graphql11.registerEnumType)(ResponseStatusCode, {
900
+ (0, import_type_graphql13.registerEnumType)(ResponseStatusCode, {
743
901
  name: "ResponseStatusCode"
744
902
  });
745
903
  var BaseResponseStatus = /* @__PURE__ */ __name(class BaseResponseStatus2 {
746
904
  code;
747
905
  }, "BaseResponseStatus");
748
- _ts_decorate10([
749
- (0, import_type_graphql11.Field)(() => ResponseStatusCode),
750
- _ts_metadata10("design:type", String)
906
+ _ts_decorate12([
907
+ (0, import_type_graphql13.Field)(() => ResponseStatusCode),
908
+ _ts_metadata12("design:type", String)
751
909
  ], BaseResponseStatus.prototype, "code", void 0);
752
- BaseResponseStatus = _ts_decorate10([
753
- (0, import_type_graphql11.InterfaceType)({
910
+ BaseResponseStatus = _ts_decorate12([
911
+ (0, import_type_graphql13.InterfaceType)({
754
912
  resolveType(value) {
755
913
  if (value.code === "success") {
756
914
  return SuccessResponseStatus;
@@ -762,14 +920,14 @@ BaseResponseStatus = _ts_decorate10([
762
920
  return void 0;
763
921
  }
764
922
  }),
765
- (0, import_type_graphql11.ObjectType)()
923
+ (0, import_type_graphql13.ObjectType)()
766
924
  ], BaseResponseStatus);
767
925
  var PendingResponseStatus = class extends BaseResponseStatus {
768
926
  code = "pending";
769
927
  };
770
928
  __name(PendingResponseStatus, "PendingResponseStatus");
771
- PendingResponseStatus = _ts_decorate10([
772
- (0, import_type_graphql11.ObjectType)({
929
+ PendingResponseStatus = _ts_decorate12([
930
+ (0, import_type_graphql13.ObjectType)({
773
931
  implements: BaseResponseStatus
774
932
  })
775
933
  ], PendingResponseStatus);
@@ -777,8 +935,8 @@ var SuccessResponseStatus = class extends BaseResponseStatus {
777
935
  code = "success";
778
936
  };
779
937
  __name(SuccessResponseStatus, "SuccessResponseStatus");
780
- SuccessResponseStatus = _ts_decorate10([
781
- (0, import_type_graphql11.ObjectType)({
938
+ SuccessResponseStatus = _ts_decorate12([
939
+ (0, import_type_graphql13.ObjectType)({
782
940
  implements: BaseResponseStatus
783
941
  })
784
942
  ], SuccessResponseStatus);
@@ -788,7 +946,7 @@ var FailedResponseStatusReason;
788
946
  FailedResponseStatusReason2["MESSAGE_STREAM_INTERRUPTED"] = "MESSAGE_STREAM_INTERRUPTED";
789
947
  FailedResponseStatusReason2["UNKNOWN_ERROR"] = "UNKNOWN_ERROR";
790
948
  })(FailedResponseStatusReason || (FailedResponseStatusReason = {}));
791
- (0, import_type_graphql11.registerEnumType)(FailedResponseStatusReason, {
949
+ (0, import_type_graphql13.registerEnumType)(FailedResponseStatusReason, {
792
950
  name: "FailedResponseStatusReason"
793
951
  });
794
952
  var FailedResponseStatus = class extends BaseResponseStatus {
@@ -797,22 +955,22 @@ var FailedResponseStatus = class extends BaseResponseStatus {
797
955
  details = null;
798
956
  };
799
957
  __name(FailedResponseStatus, "FailedResponseStatus");
800
- _ts_decorate10([
801
- (0, import_type_graphql11.Field)(() => FailedResponseStatusReason),
802
- _ts_metadata10("design:type", String)
958
+ _ts_decorate12([
959
+ (0, import_type_graphql13.Field)(() => FailedResponseStatusReason),
960
+ _ts_metadata12("design:type", String)
803
961
  ], FailedResponseStatus.prototype, "reason", void 0);
804
- _ts_decorate10([
805
- (0, import_type_graphql11.Field)(() => import_graphql_scalars.GraphQLJSON, {
962
+ _ts_decorate12([
963
+ (0, import_type_graphql13.Field)(() => import_graphql_scalars.GraphQLJSON, {
806
964
  nullable: true
807
965
  }),
808
- _ts_metadata10("design:type", typeof Record === "undefined" ? Object : Record)
966
+ _ts_metadata12("design:type", typeof Record === "undefined" ? Object : Record)
809
967
  ], FailedResponseStatus.prototype, "details", void 0);
810
- FailedResponseStatus = _ts_decorate10([
811
- (0, import_type_graphql11.ObjectType)({
968
+ FailedResponseStatus = _ts_decorate12([
969
+ (0, import_type_graphql13.ObjectType)({
812
970
  implements: BaseResponseStatus
813
971
  })
814
972
  ], FailedResponseStatus);
815
- var ResponseStatusUnion = (0, import_type_graphql11.createUnionType)({
973
+ var ResponseStatusUnion = (0, import_type_graphql13.createUnionType)({
816
974
  name: "ResponseStatus",
817
975
  types: () => [
818
976
  PendingResponseStatus,
@@ -822,7 +980,7 @@ var ResponseStatusUnion = (0, import_type_graphql11.createUnionType)({
822
980
  });
823
981
 
824
982
  // src/graphql/types/copilot-response.type.ts
825
- function _ts_decorate11(decorators, target, key, desc) {
983
+ function _ts_decorate13(decorators, target, key, desc) {
826
984
  var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
827
985
  if (typeof Reflect === "object" && typeof Reflect.decorate === "function")
828
986
  r = Reflect.decorate(decorators, target, key, desc);
@@ -832,31 +990,31 @@ function _ts_decorate11(decorators, target, key, desc) {
832
990
  r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
833
991
  return c > 3 && r && Object.defineProperty(target, key, r), r;
834
992
  }
835
- __name(_ts_decorate11, "_ts_decorate");
836
- function _ts_metadata11(k, v) {
993
+ __name(_ts_decorate13, "_ts_decorate");
994
+ function _ts_metadata13(k, v) {
837
995
  if (typeof Reflect === "object" && typeof Reflect.metadata === "function")
838
996
  return Reflect.metadata(k, v);
839
997
  }
840
- __name(_ts_metadata11, "_ts_metadata");
998
+ __name(_ts_metadata13, "_ts_metadata");
841
999
  var BaseMessageOutput = /* @__PURE__ */ __name(class BaseMessageOutput2 {
842
1000
  id;
843
1001
  createdAt;
844
1002
  status;
845
1003
  }, "BaseMessageOutput");
846
- _ts_decorate11([
847
- (0, import_type_graphql12.Field)(() => String),
848
- _ts_metadata11("design:type", String)
1004
+ _ts_decorate13([
1005
+ (0, import_type_graphql14.Field)(() => String),
1006
+ _ts_metadata13("design:type", String)
849
1007
  ], BaseMessageOutput.prototype, "id", void 0);
850
- _ts_decorate11([
851
- (0, import_type_graphql12.Field)(() => Date),
852
- _ts_metadata11("design:type", typeof Date === "undefined" ? Object : Date)
1008
+ _ts_decorate13([
1009
+ (0, import_type_graphql14.Field)(() => Date),
1010
+ _ts_metadata13("design:type", typeof Date === "undefined" ? Object : Date)
853
1011
  ], BaseMessageOutput.prototype, "createdAt", void 0);
854
- _ts_decorate11([
855
- (0, import_type_graphql12.Field)(() => MessageStatusUnion),
856
- _ts_metadata11("design:type", Object)
1012
+ _ts_decorate13([
1013
+ (0, import_type_graphql14.Field)(() => MessageStatusUnion),
1014
+ _ts_metadata13("design:type", Object)
857
1015
  ], BaseMessageOutput.prototype, "status", void 0);
858
- BaseMessageOutput = _ts_decorate11([
859
- (0, import_type_graphql12.InterfaceType)({
1016
+ BaseMessageOutput = _ts_decorate13([
1017
+ (0, import_type_graphql14.InterfaceType)({
860
1018
  resolveType(value) {
861
1019
  if (value.hasOwnProperty("content")) {
862
1020
  return TextMessageOutput;
@@ -864,6 +1022,8 @@ BaseMessageOutput = _ts_decorate11([
864
1022
  return ActionExecutionMessageOutput;
865
1023
  } else if (value.hasOwnProperty("result")) {
866
1024
  return ResultMessageOutput;
1025
+ } else if (value.hasOwnProperty("state")) {
1026
+ return AgentStateMessageOutput;
867
1027
  }
868
1028
  return void 0;
869
1029
  }
@@ -874,18 +1034,18 @@ var TextMessageOutput = class {
874
1034
  content;
875
1035
  };
876
1036
  __name(TextMessageOutput, "TextMessageOutput");
877
- _ts_decorate11([
878
- (0, import_type_graphql12.Field)(() => MessageRole),
879
- _ts_metadata11("design:type", typeof MessageRole === "undefined" ? Object : MessageRole)
1037
+ _ts_decorate13([
1038
+ (0, import_type_graphql14.Field)(() => MessageRole),
1039
+ _ts_metadata13("design:type", typeof MessageRole === "undefined" ? Object : MessageRole)
880
1040
  ], TextMessageOutput.prototype, "role", void 0);
881
- _ts_decorate11([
882
- (0, import_type_graphql12.Field)(() => [
1041
+ _ts_decorate13([
1042
+ (0, import_type_graphql14.Field)(() => [
883
1043
  String
884
1044
  ]),
885
- _ts_metadata11("design:type", Array)
1045
+ _ts_metadata13("design:type", Array)
886
1046
  ], TextMessageOutput.prototype, "content", void 0);
887
- TextMessageOutput = _ts_decorate11([
888
- (0, import_type_graphql12.ObjectType)({
1047
+ TextMessageOutput = _ts_decorate13([
1048
+ (0, import_type_graphql14.ObjectType)({
889
1049
  implements: BaseMessageOutput
890
1050
  })
891
1051
  ], TextMessageOutput);
@@ -895,22 +1055,22 @@ var ActionExecutionMessageOutput = class {
895
1055
  arguments;
896
1056
  };
897
1057
  __name(ActionExecutionMessageOutput, "ActionExecutionMessageOutput");
898
- _ts_decorate11([
899
- (0, import_type_graphql12.Field)(() => String),
900
- _ts_metadata11("design:type", String)
1058
+ _ts_decorate13([
1059
+ (0, import_type_graphql14.Field)(() => String),
1060
+ _ts_metadata13("design:type", String)
901
1061
  ], ActionExecutionMessageOutput.prototype, "name", void 0);
902
- _ts_decorate11([
903
- (0, import_type_graphql12.Field)(() => ActionExecutionScope),
904
- _ts_metadata11("design:type", typeof ActionExecutionScope === "undefined" ? Object : ActionExecutionScope)
1062
+ _ts_decorate13([
1063
+ (0, import_type_graphql14.Field)(() => ActionExecutionScope),
1064
+ _ts_metadata13("design:type", typeof ActionExecutionScope === "undefined" ? Object : ActionExecutionScope)
905
1065
  ], ActionExecutionMessageOutput.prototype, "scope", void 0);
906
- _ts_decorate11([
907
- (0, import_type_graphql12.Field)(() => [
1066
+ _ts_decorate13([
1067
+ (0, import_type_graphql14.Field)(() => [
908
1068
  String
909
1069
  ]),
910
- _ts_metadata11("design:type", Array)
1070
+ _ts_metadata13("design:type", Array)
911
1071
  ], ActionExecutionMessageOutput.prototype, "arguments", void 0);
912
- ActionExecutionMessageOutput = _ts_decorate11([
913
- (0, import_type_graphql12.ObjectType)({
1072
+ ActionExecutionMessageOutput = _ts_decorate13([
1073
+ (0, import_type_graphql14.ObjectType)({
914
1074
  implements: BaseMessageOutput
915
1075
  })
916
1076
  ], ActionExecutionMessageOutput);
@@ -920,23 +1080,71 @@ var ResultMessageOutput = class {
920
1080
  result;
921
1081
  };
922
1082
  __name(ResultMessageOutput, "ResultMessageOutput");
923
- _ts_decorate11([
924
- (0, import_type_graphql12.Field)(() => String),
925
- _ts_metadata11("design:type", String)
1083
+ _ts_decorate13([
1084
+ (0, import_type_graphql14.Field)(() => String),
1085
+ _ts_metadata13("design:type", String)
926
1086
  ], ResultMessageOutput.prototype, "actionExecutionId", void 0);
927
- _ts_decorate11([
928
- (0, import_type_graphql12.Field)(() => String),
929
- _ts_metadata11("design:type", String)
1087
+ _ts_decorate13([
1088
+ (0, import_type_graphql14.Field)(() => String),
1089
+ _ts_metadata13("design:type", String)
930
1090
  ], ResultMessageOutput.prototype, "actionName", void 0);
931
- _ts_decorate11([
932
- (0, import_type_graphql12.Field)(() => String),
933
- _ts_metadata11("design:type", String)
1091
+ _ts_decorate13([
1092
+ (0, import_type_graphql14.Field)(() => String),
1093
+ _ts_metadata13("design:type", String)
934
1094
  ], ResultMessageOutput.prototype, "result", void 0);
935
- ResultMessageOutput = _ts_decorate11([
936
- (0, import_type_graphql12.ObjectType)({
1095
+ ResultMessageOutput = _ts_decorate13([
1096
+ (0, import_type_graphql14.ObjectType)({
937
1097
  implements: BaseMessageOutput
938
1098
  })
939
1099
  ], ResultMessageOutput);
1100
+ var AgentStateMessageOutput = class {
1101
+ threadId;
1102
+ agentName;
1103
+ nodeName;
1104
+ runId;
1105
+ active;
1106
+ role;
1107
+ state;
1108
+ running;
1109
+ };
1110
+ __name(AgentStateMessageOutput, "AgentStateMessageOutput");
1111
+ _ts_decorate13([
1112
+ (0, import_type_graphql14.Field)(() => String),
1113
+ _ts_metadata13("design:type", String)
1114
+ ], AgentStateMessageOutput.prototype, "threadId", void 0);
1115
+ _ts_decorate13([
1116
+ (0, import_type_graphql14.Field)(() => String),
1117
+ _ts_metadata13("design:type", String)
1118
+ ], AgentStateMessageOutput.prototype, "agentName", void 0);
1119
+ _ts_decorate13([
1120
+ (0, import_type_graphql14.Field)(() => String),
1121
+ _ts_metadata13("design:type", String)
1122
+ ], AgentStateMessageOutput.prototype, "nodeName", void 0);
1123
+ _ts_decorate13([
1124
+ (0, import_type_graphql14.Field)(() => String),
1125
+ _ts_metadata13("design:type", String)
1126
+ ], AgentStateMessageOutput.prototype, "runId", void 0);
1127
+ _ts_decorate13([
1128
+ (0, import_type_graphql14.Field)(() => Boolean),
1129
+ _ts_metadata13("design:type", Boolean)
1130
+ ], AgentStateMessageOutput.prototype, "active", void 0);
1131
+ _ts_decorate13([
1132
+ (0, import_type_graphql14.Field)(() => MessageRole),
1133
+ _ts_metadata13("design:type", typeof MessageRole === "undefined" ? Object : MessageRole)
1134
+ ], AgentStateMessageOutput.prototype, "role", void 0);
1135
+ _ts_decorate13([
1136
+ (0, import_type_graphql14.Field)(() => String),
1137
+ _ts_metadata13("design:type", String)
1138
+ ], AgentStateMessageOutput.prototype, "state", void 0);
1139
+ _ts_decorate13([
1140
+ (0, import_type_graphql14.Field)(() => Boolean),
1141
+ _ts_metadata13("design:type", Boolean)
1142
+ ], AgentStateMessageOutput.prototype, "running", void 0);
1143
+ AgentStateMessageOutput = _ts_decorate13([
1144
+ (0, import_type_graphql14.ObjectType)({
1145
+ implements: BaseMessageOutput
1146
+ })
1147
+ ], AgentStateMessageOutput);
940
1148
  var CopilotResponse = class {
941
1149
  threadId;
942
1150
  status;
@@ -944,28 +1152,28 @@ var CopilotResponse = class {
944
1152
  messages;
945
1153
  };
946
1154
  __name(CopilotResponse, "CopilotResponse");
947
- _ts_decorate11([
948
- (0, import_type_graphql12.Field)(() => String),
949
- _ts_metadata11("design:type", String)
1155
+ _ts_decorate13([
1156
+ (0, import_type_graphql14.Field)(() => String),
1157
+ _ts_metadata13("design:type", String)
950
1158
  ], CopilotResponse.prototype, "threadId", void 0);
951
- _ts_decorate11([
952
- (0, import_type_graphql12.Field)(() => ResponseStatusUnion),
953
- _ts_metadata11("design:type", Object)
1159
+ _ts_decorate13([
1160
+ (0, import_type_graphql14.Field)(() => ResponseStatusUnion),
1161
+ _ts_metadata13("design:type", Object)
954
1162
  ], CopilotResponse.prototype, "status", void 0);
955
- _ts_decorate11([
956
- (0, import_type_graphql12.Field)({
1163
+ _ts_decorate13([
1164
+ (0, import_type_graphql14.Field)({
957
1165
  nullable: true
958
1166
  }),
959
- _ts_metadata11("design:type", String)
1167
+ _ts_metadata13("design:type", String)
960
1168
  ], CopilotResponse.prototype, "runId", void 0);
961
- _ts_decorate11([
962
- (0, import_type_graphql12.Field)(() => [
1169
+ _ts_decorate13([
1170
+ (0, import_type_graphql14.Field)(() => [
963
1171
  BaseMessageOutput
964
1172
  ]),
965
- _ts_metadata11("design:type", Array)
1173
+ _ts_metadata13("design:type", Array)
966
1174
  ], CopilotResponse.prototype, "messages", void 0);
967
- CopilotResponse = _ts_decorate11([
968
- (0, import_type_graphql12.ObjectType)()
1175
+ CopilotResponse = _ts_decorate13([
1176
+ (0, import_type_graphql14.ObjectType)()
969
1177
  ], CopilotResponse);
970
1178
 
971
1179
  // src/graphql/resolvers/copilot.resolver.ts
@@ -992,6 +1200,26 @@ var ResultMessage = class extends BaseMessage {
992
1200
  result;
993
1201
  };
994
1202
  __name(ResultMessage, "ResultMessage");
1203
+ var AgentStateMessage = class extends BaseMessage {
1204
+ threadId;
1205
+ agentName;
1206
+ nodeName;
1207
+ runId;
1208
+ active;
1209
+ role;
1210
+ state;
1211
+ running;
1212
+ };
1213
+ __name(AgentStateMessage, "AgentStateMessage");
1214
+
1215
+ // src/lib/telemetry-client.ts
1216
+ var import_shared = require("@copilotkit/shared");
1217
+ var packageJson = require_package();
1218
+ var telemetryClient = new import_shared.TelemetryClient({
1219
+ packageName: packageJson.name,
1220
+ packageVersion: packageJson.version
1221
+ });
1222
+ var telemetry_client_default = telemetryClient;
995
1223
 
996
1224
  // src/service-adapters/events.ts
997
1225
  var RuntimeEventTypes;
@@ -1003,6 +1231,7 @@ var RuntimeEventTypes;
1003
1231
  RuntimeEventTypes2["ActionExecutionArgs"] = "ActionExecutionArgs";
1004
1232
  RuntimeEventTypes2["ActionExecutionEnd"] = "ActionExecutionEnd";
1005
1233
  RuntimeEventTypes2["ActionExecutionResult"] = "ActionExecutionResult";
1234
+ RuntimeEventTypes2["AgentStateMessage"] = "AgentStateMessage";
1006
1235
  })(RuntimeEventTypes || (RuntimeEventTypes = {}));
1007
1236
 
1008
1237
  // src/graphql/resolvers/copilot.resolver.ts
@@ -1043,18 +1272,9 @@ var UnknownErrorResponse = class extends FailedResponseStatus {
1043
1272
  };
1044
1273
  __name(UnknownErrorResponse, "UnknownErrorResponse");
1045
1274
 
1046
- // src/lib/telemetry-client.ts
1047
- var import_shared = require("@copilotkit/shared");
1048
- var packageJson = require_package();
1049
- var telemetryClient = new import_shared.TelemetryClient({
1050
- packageName: packageJson.name,
1051
- packageVersion: packageJson.version
1052
- });
1053
- var telemetry_client_default = telemetryClient;
1054
-
1055
1275
  // src/graphql/resolvers/copilot.resolver.ts
1056
1276
  var import_shared2 = require("@copilotkit/shared");
1057
- function _ts_decorate12(decorators, target, key, desc) {
1277
+ function _ts_decorate14(decorators, target, key, desc) {
1058
1278
  var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
1059
1279
  if (typeof Reflect === "object" && typeof Reflect.decorate === "function")
1060
1280
  r = Reflect.decorate(decorators, target, key, desc);
@@ -1064,12 +1284,12 @@ function _ts_decorate12(decorators, target, key, desc) {
1064
1284
  r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
1065
1285
  return c > 3 && r && Object.defineProperty(target, key, r), r;
1066
1286
  }
1067
- __name(_ts_decorate12, "_ts_decorate");
1068
- function _ts_metadata12(k, v) {
1287
+ __name(_ts_decorate14, "_ts_decorate");
1288
+ function _ts_metadata14(k, v) {
1069
1289
  if (typeof Reflect === "object" && typeof Reflect.metadata === "function")
1070
1290
  return Reflect.metadata(k, v);
1071
1291
  }
1072
- __name(_ts_metadata12, "_ts_metadata");
1292
+ __name(_ts_metadata14, "_ts_metadata");
1073
1293
  function _ts_param(paramIndex, decorator) {
1074
1294
  return function(target, key) {
1075
1295
  decorator(target, key, paramIndex);
@@ -1078,7 +1298,6 @@ function _ts_param(paramIndex, decorator) {
1078
1298
  __name(_ts_param, "_ts_param");
1079
1299
  var invokeGuardrails = /* @__PURE__ */ __name(async ({ baseUrl, copilotCloudPublicApiKey, data, onResult, onError }) => {
1080
1300
  var _a;
1081
- console.log("invokeGuardrails.baseUrl", baseUrl);
1082
1301
  if (data.messages.length && ((_a = data.messages[data.messages.length - 1].textMessage) == null ? void 0 : _a.role) === MessageRole.user) {
1083
1302
  const messages = data.messages.filter((m) => m.textMessage !== void 0 && (m.textMessage.role === MessageRole.user || m.textMessage.role === MessageRole.assistant)).map((m) => ({
1084
1303
  role: m.textMessage.role,
@@ -1124,8 +1343,6 @@ var CopilotResolver = class {
1124
1343
  logger2.debug({
1125
1344
  data
1126
1345
  }, "Generating Copilot response");
1127
- const copilotRuntime = ctx._copilotkit.runtime;
1128
- const serviceAdapter = ctx._copilotkit.serviceAdapter;
1129
1346
  if (properties) {
1130
1347
  logger2.debug("Properties provided, merging with context properties");
1131
1348
  ctx.properties = {
@@ -1133,6 +1350,8 @@ var CopilotResolver = class {
1133
1350
  ...properties
1134
1351
  };
1135
1352
  }
1353
+ const copilotRuntime = ctx._copilotkit.runtime;
1354
+ const serviceAdapter = ctx._copilotkit.serviceAdapter;
1136
1355
  let copilotCloudPublicApiKey = null;
1137
1356
  let copilotCloudBaseUrl;
1138
1357
  if (data.cloud) {
@@ -1171,16 +1390,18 @@ var CopilotResolver = class {
1171
1390
  rejectOutputMessagesPromise = reject;
1172
1391
  });
1173
1392
  logger2.debug("Processing");
1174
- const { eventSource, threadId = (0, import_shared2.randomId)(), runId, actions } = await copilotRuntime.process({
1393
+ const { eventSource, threadId = (0, import_shared2.randomId)(), runId, serverSideActions, actionInputsWithoutAgents } = await copilotRuntime.processRuntimeRequest({
1175
1394
  serviceAdapter,
1176
1395
  messages: data.messages,
1177
1396
  actions: data.frontend.actions,
1178
1397
  threadId: data.threadId,
1179
1398
  runId: data.runId,
1180
1399
  publicApiKey: void 0,
1181
- properties: ctx.properties || {},
1182
1400
  outputMessagesPromise,
1401
+ graphqlContext: ctx,
1183
1402
  forwardedParameters: data.forwardedParameters,
1403
+ agentSession: data.agentSession,
1404
+ agentStates: data.agentStates,
1184
1405
  url: data.frontend.url
1185
1406
  });
1186
1407
  logger2.debug("Event source created, creating response");
@@ -1238,9 +1459,13 @@ var CopilotResolver = class {
1238
1459
  });
1239
1460
  }
1240
1461
  let eventStreamSubscription;
1241
- const eventStream = eventSource.process({
1242
- serversideActions: actions,
1243
- guardrailsResult$: ((_b2 = data.cloud) == null ? void 0 : _b2.guardrails) ? guardrailsResult$ : null
1462
+ const eventStream = eventSource.processRuntimeEvents({
1463
+ serverSideActions,
1464
+ guardrailsResult$: ((_b2 = data.cloud) == null ? void 0 : _b2.guardrails) ? guardrailsResult$ : null,
1465
+ actionInputsWithoutAgents: actionInputsWithoutAgents.filter(
1466
+ // TODO-AGENTS: do not exclude ALL server side actions
1467
+ (action) => !serverSideActions.find((serverSideAction) => serverSideAction.name == action.name)
1468
+ )
1244
1469
  }).pipe(
1245
1470
  // shareReplay() ensures that later subscribers will see the whole stream instead of
1246
1471
  // just the events that were emitted after the subscriber was added.
@@ -1388,6 +1613,36 @@ var CopilotResolver = class {
1388
1613
  result: event.result
1389
1614
  }));
1390
1615
  break;
1616
+ case RuntimeEventTypes.AgentStateMessage:
1617
+ logger2.debug({
1618
+ event
1619
+ }, "Agent message event received");
1620
+ pushMessage({
1621
+ id: (0, import_shared2.randomId)(),
1622
+ status: new SuccessMessageStatus(),
1623
+ threadId: event.threadId,
1624
+ agentName: event.agentName,
1625
+ nodeName: event.nodeName,
1626
+ runId: event.runId,
1627
+ active: event.active,
1628
+ state: event.state,
1629
+ running: event.running,
1630
+ role: MessageRole.assistant,
1631
+ createdAt: /* @__PURE__ */ new Date()
1632
+ });
1633
+ outputMessages.push((0, import_class_transformer.plainToInstance)(AgentStateMessage, {
1634
+ id: (0, import_shared2.randomId)(),
1635
+ threadId: event.threadId,
1636
+ agentName: event.agentName,
1637
+ nodeName: event.nodeName,
1638
+ runId: event.runId,
1639
+ active: event.active,
1640
+ state: event.state,
1641
+ running: event.running,
1642
+ role: MessageRole.assistant,
1643
+ createdAt: /* @__PURE__ */ new Date()
1644
+ }));
1645
+ break;
1391
1646
  }
1392
1647
  },
1393
1648
  error: (err) => {
@@ -1420,29 +1675,29 @@ var CopilotResolver = class {
1420
1675
  }
1421
1676
  };
1422
1677
  __name(CopilotResolver, "CopilotResolver");
1423
- _ts_decorate12([
1424
- (0, import_type_graphql13.Query)(() => String),
1425
- _ts_metadata12("design:type", Function),
1426
- _ts_metadata12("design:paramtypes", []),
1427
- _ts_metadata12("design:returntype", Promise)
1678
+ _ts_decorate14([
1679
+ (0, import_type_graphql15.Query)(() => String),
1680
+ _ts_metadata14("design:type", Function),
1681
+ _ts_metadata14("design:paramtypes", []),
1682
+ _ts_metadata14("design:returntype", Promise)
1428
1683
  ], CopilotResolver.prototype, "hello", null);
1429
- _ts_decorate12([
1430
- (0, import_type_graphql13.Mutation)(() => CopilotResponse),
1431
- _ts_param(0, (0, import_type_graphql13.Ctx)()),
1432
- _ts_param(1, (0, import_type_graphql13.Arg)("data")),
1433
- _ts_param(2, (0, import_type_graphql13.Arg)("properties", () => import_graphql_scalars2.GraphQLJSONObject, {
1684
+ _ts_decorate14([
1685
+ (0, import_type_graphql15.Mutation)(() => CopilotResponse),
1686
+ _ts_param(0, (0, import_type_graphql15.Ctx)()),
1687
+ _ts_param(1, (0, import_type_graphql15.Arg)("data")),
1688
+ _ts_param(2, (0, import_type_graphql15.Arg)("properties", () => import_graphql_scalars2.GraphQLJSONObject, {
1434
1689
  nullable: true
1435
1690
  })),
1436
- _ts_metadata12("design:type", Function),
1437
- _ts_metadata12("design:paramtypes", [
1691
+ _ts_metadata14("design:type", Function),
1692
+ _ts_metadata14("design:paramtypes", [
1438
1693
  typeof GraphQLContext === "undefined" ? Object : GraphQLContext,
1439
1694
  typeof GenerateCopilotResponseInput === "undefined" ? Object : GenerateCopilotResponseInput,
1440
1695
  typeof CopilotRequestContextProperties === "undefined" ? Object : CopilotRequestContextProperties
1441
1696
  ]),
1442
- _ts_metadata12("design:returntype", Promise)
1697
+ _ts_metadata14("design:returntype", Promise)
1443
1698
  ], CopilotResolver.prototype, "generateCopilotResponse", null);
1444
- CopilotResolver = _ts_decorate12([
1445
- (0, import_type_graphql13.Resolver)(() => CopilotResponse)
1699
+ CopilotResolver = _ts_decorate14([
1700
+ (0, import_type_graphql15.Resolver)(() => CopilotResponse)
1446
1701
  ], CopilotResolver);
1447
1702
 
1448
1703
  // src/lib/integrations/shared.ts
@@ -1497,7 +1752,7 @@ async function createContext(initialContext, copilotKitContext, contextLogger, p
1497
1752
  __name(createContext, "createContext");
1498
1753
  function buildSchema(options = {}) {
1499
1754
  logger.debug("Building GraphQL schema...");
1500
- const schema = (0, import_type_graphql14.buildSchemaSync)({
1755
+ const schema = (0, import_type_graphql16.buildSchemaSync)({
1501
1756
  resolvers: [
1502
1757
  CopilotResolver
1503
1758
  ],