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