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