@copilotkit/runtime 1.50.0-beta.8 → 1.50.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 +168 -0
- package/dist/chunk-27JKTS6P.mjs +1704 -0
- package/dist/chunk-27JKTS6P.mjs.map +1 -0
- package/dist/chunk-2GPTVDTO.mjs +25 -0
- package/dist/chunk-2GPTVDTO.mjs.map +1 -0
- package/dist/chunk-2OZAGFV3.mjs +43 -0
- package/dist/chunk-2OZAGFV3.mjs.map +1 -0
- package/dist/chunk-3AJVKDZX.mjs +3097 -0
- package/dist/chunk-3AJVKDZX.mjs.map +1 -0
- package/dist/chunk-45RCC3ZS.mjs +25 -0
- package/dist/chunk-45RCC3ZS.mjs.map +1 -0
- package/dist/chunk-4EHJ4XFJ.mjs +25 -0
- package/dist/chunk-4EHJ4XFJ.mjs.map +1 -0
- package/dist/chunk-4IANB4TC.mjs +25 -0
- package/dist/chunk-4IANB4TC.mjs.map +1 -0
- package/dist/chunk-4KES76K3.mjs +74 -0
- package/dist/chunk-4KES76K3.mjs.map +1 -0
- package/dist/chunk-4OGE3SLW.mjs +3100 -0
- package/dist/chunk-4OGE3SLW.mjs.map +1 -0
- package/dist/chunk-54YJBMCP.mjs +3097 -0
- package/dist/chunk-54YJBMCP.mjs.map +1 -0
- package/dist/chunk-62NE5S6M.mjs +226 -0
- package/dist/chunk-62NE5S6M.mjs.map +1 -0
- package/dist/chunk-6ER4SZYH.mjs +74 -0
- package/dist/chunk-6ER4SZYH.mjs.map +1 -0
- package/dist/chunk-6TNSLHVR.mjs +74 -0
- package/dist/chunk-6TNSLHVR.mjs.map +1 -0
- package/dist/chunk-6XRUR5UK.mjs +1 -0
- package/dist/chunk-6XRUR5UK.mjs.map +1 -0
- package/dist/chunk-7V4BK7TZ.mjs +25 -0
- package/dist/chunk-7V4BK7TZ.mjs.map +1 -0
- package/dist/chunk-7YZIEXD2.mjs +74 -0
- package/dist/chunk-7YZIEXD2.mjs.map +1 -0
- package/dist/chunk-A4XHOAFU.mjs +25 -0
- package/dist/chunk-A4XHOAFU.mjs.map +1 -0
- package/dist/chunk-A555KEAD.mjs +6020 -0
- package/dist/chunk-A555KEAD.mjs.map +1 -0
- package/dist/chunk-AF73TFTX.mjs +74 -0
- package/dist/chunk-AF73TFTX.mjs.map +1 -0
- package/dist/chunk-AMUJQ6IR.mjs +50 -0
- package/dist/chunk-AMUJQ6IR.mjs.map +1 -0
- package/dist/chunk-AQG2SVCA.mjs +25 -0
- package/dist/chunk-AQG2SVCA.mjs.map +1 -0
- package/dist/chunk-BJZHMXND.mjs +74 -0
- package/dist/chunk-BJZHMXND.mjs.map +1 -0
- package/dist/chunk-CB2OJXF6.mjs +25 -0
- package/dist/chunk-CB2OJXF6.mjs.map +1 -0
- package/dist/chunk-CEOMFPJU.mjs +6020 -0
- package/dist/chunk-CEOMFPJU.mjs.map +1 -0
- package/dist/chunk-CZVLR7CC.mjs +175 -0
- package/dist/chunk-CZVLR7CC.mjs.map +1 -0
- package/dist/chunk-DCEEHMLJ.mjs +1127 -0
- package/dist/chunk-DCEEHMLJ.mjs.map +1 -0
- package/dist/chunk-DE3CLKUG.mjs +25 -0
- package/dist/chunk-DE3CLKUG.mjs.map +1 -0
- package/dist/chunk-DTPRUTNV.mjs +25 -0
- package/dist/chunk-DTPRUTNV.mjs.map +1 -0
- package/dist/chunk-ERUOA47O.mjs +626 -0
- package/dist/chunk-ERUOA47O.mjs.map +1 -0
- package/dist/chunk-ESSRC64W.mjs +74 -0
- package/dist/chunk-ESSRC64W.mjs.map +1 -0
- package/dist/chunk-FHD4JECV.mjs +33 -0
- package/dist/chunk-FHD4JECV.mjs.map +1 -0
- package/dist/chunk-GRAN6K6N.mjs +25 -0
- package/dist/chunk-GRAN6K6N.mjs.map +1 -0
- package/dist/chunk-I27F2UPA.mjs +175 -0
- package/dist/chunk-I27F2UPA.mjs.map +1 -0
- package/dist/chunk-IAZKTOQW.mjs +25 -0
- package/dist/chunk-IAZKTOQW.mjs.map +1 -0
- package/dist/chunk-J6XZ5MFB.mjs +25 -0
- package/dist/chunk-J6XZ5MFB.mjs.map +1 -0
- package/dist/chunk-JJ32MA4C.mjs +73 -0
- package/dist/chunk-JJ32MA4C.mjs.map +1 -0
- package/dist/chunk-JJY4ZTHQ.mjs +25 -0
- package/dist/chunk-JJY4ZTHQ.mjs.map +1 -0
- package/dist/chunk-KEYLBFU2.mjs +3117 -0
- package/dist/chunk-KEYLBFU2.mjs.map +1 -0
- package/dist/chunk-KQ53L4WZ.mjs +3094 -0
- package/dist/chunk-KQ53L4WZ.mjs.map +1 -0
- package/dist/chunk-KTELVQ67.mjs +3098 -0
- package/dist/chunk-KTELVQ67.mjs.map +1 -0
- package/dist/chunk-LPEPX6NH.mjs +25 -0
- package/dist/chunk-LPEPX6NH.mjs.map +1 -0
- package/dist/chunk-MDXE55DK.mjs +3117 -0
- package/dist/chunk-MDXE55DK.mjs.map +1 -0
- package/dist/chunk-MMFUVOXH.mjs +73 -0
- package/dist/chunk-MMFUVOXH.mjs.map +1 -0
- package/dist/chunk-N3Y4U66N.mjs +253 -0
- package/dist/chunk-N3Y4U66N.mjs.map +1 -0
- package/dist/chunk-O7UYB4MH.mjs +25 -0
- package/dist/chunk-O7UYB4MH.mjs.map +1 -0
- package/dist/chunk-OFNVQHNM.mjs +3089 -0
- package/dist/chunk-OFNVQHNM.mjs.map +1 -0
- package/dist/chunk-OFSV5GET.mjs +3074 -0
- package/dist/chunk-OFSV5GET.mjs.map +1 -0
- package/dist/chunk-OMRST67R.mjs +25 -0
- package/dist/chunk-OMRST67R.mjs.map +1 -0
- package/dist/chunk-OWIGJONH.mjs +275 -0
- package/dist/chunk-OWIGJONH.mjs.map +1 -0
- package/dist/chunk-PRZHE74A.mjs +25 -0
- package/dist/chunk-PRZHE74A.mjs.map +1 -0
- package/dist/chunk-PTYRVXXP.mjs +80 -0
- package/dist/chunk-PTYRVXXP.mjs.map +1 -0
- package/dist/chunk-R22B5CCO.mjs +25 -0
- package/dist/chunk-R22B5CCO.mjs.map +1 -0
- package/dist/chunk-SHBDMA63.mjs +141 -0
- package/dist/chunk-SHBDMA63.mjs.map +1 -0
- package/dist/chunk-SPVXBPRA.mjs +74 -0
- package/dist/chunk-SPVXBPRA.mjs.map +1 -0
- package/dist/chunk-T72G46ME.mjs +25 -0
- package/dist/chunk-T72G46ME.mjs.map +1 -0
- package/dist/chunk-TGELROPU.mjs +25 -0
- package/dist/chunk-TGELROPU.mjs.map +1 -0
- package/dist/chunk-UNX4IAAD.mjs +25 -0
- package/dist/chunk-UNX4IAAD.mjs.map +1 -0
- package/dist/chunk-V4DHVC7M.mjs +3085 -0
- package/dist/chunk-V4DHVC7M.mjs.map +1 -0
- package/dist/chunk-VVRFOB66.mjs +25 -0
- package/dist/chunk-VVRFOB66.mjs.map +1 -0
- package/dist/chunk-W6NVBYM6.mjs +80 -0
- package/dist/chunk-W6NVBYM6.mjs.map +1 -0
- package/dist/chunk-W7MBACGC.mjs +74 -0
- package/dist/chunk-W7MBACGC.mjs.map +1 -0
- package/dist/chunk-WMD4XZZS.mjs +25 -0
- package/dist/chunk-WMD4XZZS.mjs.map +1 -0
- package/dist/chunk-WX2ZNCRT.mjs +74 -0
- package/dist/chunk-WX2ZNCRT.mjs.map +1 -0
- package/dist/chunk-XWBDEXDA.mjs +153 -0
- package/dist/chunk-XWBDEXDA.mjs.map +1 -0
- package/dist/chunk-Y2Z62E2T.mjs +74 -0
- package/dist/chunk-Y2Z62E2T.mjs.map +1 -0
- package/dist/chunk-YO4I6RVI.mjs +25 -0
- package/dist/chunk-YO4I6RVI.mjs.map +1 -0
- package/dist/chunk-Z6Q5IW6I.mjs +3098 -0
- package/dist/chunk-Z6Q5IW6I.mjs.map +1 -0
- package/dist/chunk-Z726O3G2.mjs +25 -0
- package/dist/chunk-Z726O3G2.mjs.map +1 -0
- package/dist/chunk-ZE4SMZZR.mjs +3097 -0
- package/dist/chunk-ZE4SMZZR.mjs.map +1 -0
- package/dist/chunk-ZULZB33C.mjs +73 -0
- package/dist/chunk-ZULZB33C.mjs.map +1 -0
- package/dist/chunk-ZVRGXMY7.mjs +25 -0
- package/dist/chunk-ZVRGXMY7.mjs.map +1 -0
- package/dist/chunk-ZZ35WBYQ.mjs +25 -0
- package/dist/chunk-ZZ35WBYQ.mjs.map +1 -0
- package/dist/graphql/message-conversion/index.d.ts +18 -0
- package/dist/graphql/message-conversion/index.js +725 -0
- package/dist/graphql/message-conversion/index.js.map +1 -0
- package/dist/graphql/message-conversion/index.mjs +245 -0
- package/dist/graphql/message-conversion/index.mjs.map +1 -0
- package/dist/graphql/types/base/index.d.ts +6 -0
- package/dist/graphql/types/base/index.js +63 -0
- package/dist/graphql/types/base/index.js.map +1 -0
- package/dist/graphql/types/base/index.mjs +8 -0
- package/dist/graphql/types/base/index.mjs.map +1 -0
- package/dist/graphql/types/converted/index.d.ts +2 -0
- package/dist/graphql/types/converted/index.js +200 -0
- package/dist/graphql/types/converted/index.js.map +1 -0
- package/dist/graphql/types/converted/index.mjs +19 -0
- package/dist/graphql/types/converted/index.mjs.map +1 -0
- package/dist/groq-adapter-540da9c3.d.ts +331 -0
- package/dist/groq-adapter-a6f5e9d2.d.ts +331 -0
- package/dist/groq-adapter-c8aec5c5.d.ts +321 -0
- package/dist/index-96b330da.d.ts +119 -0
- package/dist/index-adbd78f1.d.ts +154 -0
- package/dist/index.d.ts +67 -8
- package/dist/index.js +118 -28
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +120 -31
- package/dist/index.mjs.map +1 -1
- package/dist/langserve-0c6100e3.d.ts +257 -0
- package/dist/langserve-978d5790.d.ts +243 -0
- package/dist/langserve-9fc76ce5.d.ts +243 -0
- package/dist/lib/cloud/index.d.ts +6 -0
- package/dist/lib/cloud/index.js +18 -0
- package/dist/lib/cloud/index.js.map +1 -0
- package/dist/lib/cloud/index.mjs +1 -0
- package/dist/lib/cloud/index.mjs.map +1 -0
- package/dist/lib/index.d.ts +212 -0
- package/dist/lib/index.js +7843 -0
- package/dist/lib/index.js.map +1 -0
- package/dist/lib/index.mjs +76 -0
- package/dist/lib/index.mjs.map +1 -0
- package/dist/lib/integrations/index.d.ts +34 -0
- package/dist/lib/integrations/index.js +3052 -0
- package/dist/lib/integrations/index.js.map +1 -0
- package/dist/lib/integrations/index.mjs +37 -0
- package/dist/lib/integrations/index.mjs.map +1 -0
- package/dist/lib/integrations/nest/index.d.ts +15 -0
- package/dist/lib/integrations/nest/index.js +2959 -0
- package/dist/lib/integrations/nest/index.js.map +1 -0
- package/dist/lib/integrations/nest/index.mjs +14 -0
- package/dist/lib/integrations/nest/index.mjs.map +1 -0
- package/dist/lib/integrations/node-express/index.d.ts +15 -0
- package/dist/lib/integrations/node-express/index.js +2959 -0
- package/dist/lib/integrations/node-express/index.js.map +1 -0
- package/dist/lib/integrations/node-express/index.mjs +14 -0
- package/dist/lib/integrations/node-express/index.mjs.map +1 -0
- package/dist/lib/integrations/node-http/index.d.ts +15 -0
- package/dist/lib/integrations/node-http/index.js +2945 -0
- package/dist/lib/integrations/node-http/index.js.map +1 -0
- package/dist/lib/integrations/node-http/index.mjs +13 -0
- package/dist/lib/integrations/node-http/index.mjs.map +1 -0
- package/dist/service-adapters/index.d.ts +162 -0
- package/dist/service-adapters/index.js +1787 -0
- package/dist/service-adapters/index.js.map +1 -0
- package/dist/service-adapters/index.mjs +34 -0
- package/dist/service-adapters/index.mjs.map +1 -0
- package/dist/service-adapters/shared/index.d.ts +9 -0
- package/dist/service-adapters/shared/index.js +72 -0
- package/dist/service-adapters/shared/index.js.map +1 -0
- package/dist/service-adapters/shared/index.mjs +8 -0
- package/dist/service-adapters/shared/index.mjs.map +1 -0
- package/dist/shared-0a7346ce.d.ts +466 -0
- package/dist/shared-35c6eb04.d.ts +448 -0
- package/dist/shared-9ed1dc31.d.ts +414 -0
- package/dist/shared-da5708fe.d.ts +449 -0
- package/dist/utils/index.d.ts +65 -0
- package/dist/utils/index.js +175 -0
- package/dist/utils/index.js.map +1 -0
- package/dist/utils/index.mjs +12 -0
- package/dist/utils/index.mjs.map +1 -0
- package/package.json +14 -20
- package/src/lib/index.ts +7 -6
- package/src/lib/runtime/copilot-runtime.ts +62 -26
- package/src/lib/runtime/telemetry-agent-runner.ts +139 -0
|
@@ -0,0 +1,2945 @@
|
|
|
1
|
+
var __create = Object.create;
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
6
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
+
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
|
|
8
|
+
var __commonJS = (cb, mod) => function __require() {
|
|
9
|
+
return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
|
|
10
|
+
};
|
|
11
|
+
var __export = (target, all) => {
|
|
12
|
+
for (var name in all)
|
|
13
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
14
|
+
};
|
|
15
|
+
var __copyProps = (to, from3, except, desc) => {
|
|
16
|
+
if (from3 && typeof from3 === "object" || typeof from3 === "function") {
|
|
17
|
+
for (let key of __getOwnPropNames(from3))
|
|
18
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
19
|
+
__defProp(to, key, { get: () => from3[key], enumerable: !(desc = __getOwnPropDesc(from3, key)) || desc.enumerable });
|
|
20
|
+
}
|
|
21
|
+
return to;
|
|
22
|
+
};
|
|
23
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
24
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
25
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
26
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
27
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
28
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
29
|
+
mod
|
|
30
|
+
));
|
|
31
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
32
|
+
|
|
33
|
+
// package.json
|
|
34
|
+
var require_package = __commonJS({
|
|
35
|
+
"package.json"(exports, module2) {
|
|
36
|
+
module2.exports = {
|
|
37
|
+
name: "@copilotkit/runtime",
|
|
38
|
+
private: false,
|
|
39
|
+
homepage: "https://github.com/CopilotKit/CopilotKit",
|
|
40
|
+
repository: {
|
|
41
|
+
type: "git",
|
|
42
|
+
url: "https://github.com/CopilotKit/CopilotKit.git"
|
|
43
|
+
},
|
|
44
|
+
publishConfig: {
|
|
45
|
+
access: "public"
|
|
46
|
+
},
|
|
47
|
+
version: "1.10.6",
|
|
48
|
+
sideEffects: false,
|
|
49
|
+
main: "./dist/index.js",
|
|
50
|
+
module: "./dist/index.mjs",
|
|
51
|
+
exports: {
|
|
52
|
+
".": "./dist/index.js"
|
|
53
|
+
},
|
|
54
|
+
types: "./dist/index.d.ts",
|
|
55
|
+
license: "MIT",
|
|
56
|
+
scripts: {
|
|
57
|
+
build: 'tsup --onSuccess "pnpm run generate-graphql-schema"',
|
|
58
|
+
dev: 'tsup --watch --onSuccess "pnpm run generate-graphql-schema"',
|
|
59
|
+
test: "jest --passWithNoTests",
|
|
60
|
+
"check-types": "tsc --noEmit",
|
|
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",
|
|
63
|
+
"link:global": "pnpm link --global",
|
|
64
|
+
"unlink:global": "pnpm unlink --global"
|
|
65
|
+
},
|
|
66
|
+
devDependencies: {
|
|
67
|
+
"@jest/globals": "^29.7.0",
|
|
68
|
+
"@swc/core": "1.5.28",
|
|
69
|
+
"@types/express": "^4.17.21",
|
|
70
|
+
"@types/jest": "^29.5.12",
|
|
71
|
+
"@types/node": "^18.11.17",
|
|
72
|
+
"@whatwg-node/server": "^0.9.34",
|
|
73
|
+
eslint: "^8.56.0",
|
|
74
|
+
"eslint-config-custom": "workspace:*",
|
|
75
|
+
jest: "^29.6.4",
|
|
76
|
+
nodemon: "^3.1.3",
|
|
77
|
+
"ts-jest": "^29.1.1",
|
|
78
|
+
"ts-node": "^10.9.2",
|
|
79
|
+
tsconfig: "workspace:*",
|
|
80
|
+
tsup: "^6.7.0",
|
|
81
|
+
typescript: "^5.2.3",
|
|
82
|
+
"zod-to-json-schema": "^3.23.5"
|
|
83
|
+
},
|
|
84
|
+
dependencies: {
|
|
85
|
+
"@anthropic-ai/sdk": "^0.57.0",
|
|
86
|
+
"@copilotkit/shared": "workspace:*",
|
|
87
|
+
"@graphql-yoga/plugin-defer-stream": "^3.3.1",
|
|
88
|
+
"@langchain/aws": "^0.1.9",
|
|
89
|
+
"@langchain/community": "^0.3.29",
|
|
90
|
+
"@langchain/core": "^0.3.38",
|
|
91
|
+
"@langchain/google-gauth": "^0.1.0",
|
|
92
|
+
"@langchain/langgraph-sdk": "^0.0.70",
|
|
93
|
+
"@langchain/openai": "^0.4.2",
|
|
94
|
+
"@scarf/scarf": "^1.3.0",
|
|
95
|
+
"class-transformer": "^0.5.1",
|
|
96
|
+
"class-validator": "^0.14.1",
|
|
97
|
+
express: "^4.19.2",
|
|
98
|
+
graphql: "^16.8.1",
|
|
99
|
+
"graphql-scalars": "^1.23.0",
|
|
100
|
+
"graphql-yoga": "^5.3.1",
|
|
101
|
+
"groq-sdk": "^0.5.0",
|
|
102
|
+
langchain: "^0.3.3",
|
|
103
|
+
openai: "^4.85.1",
|
|
104
|
+
"partial-json": "^0.1.7",
|
|
105
|
+
pino: "^9.2.0",
|
|
106
|
+
"pino-pretty": "^11.2.1",
|
|
107
|
+
"reflect-metadata": "^0.2.2",
|
|
108
|
+
rxjs: "7.8.1",
|
|
109
|
+
"type-graphql": "2.0.0-rc.1",
|
|
110
|
+
zod: "^3.23.3"
|
|
111
|
+
},
|
|
112
|
+
peerDependencies: {
|
|
113
|
+
"@ag-ui/client": ">=0.0.39",
|
|
114
|
+
"@ag-ui/core": ">=0.0.39",
|
|
115
|
+
"@ag-ui/encoder": ">=0.0.39",
|
|
116
|
+
"@ag-ui/langgraph": ">=0.0.18",
|
|
117
|
+
"@ag-ui/proto": ">=0.0.39"
|
|
118
|
+
},
|
|
119
|
+
keywords: [
|
|
120
|
+
"copilotkit",
|
|
121
|
+
"copilot",
|
|
122
|
+
"react",
|
|
123
|
+
"nextjs",
|
|
124
|
+
"nodejs",
|
|
125
|
+
"ai",
|
|
126
|
+
"assistant",
|
|
127
|
+
"javascript",
|
|
128
|
+
"automation",
|
|
129
|
+
"textarea"
|
|
130
|
+
]
|
|
131
|
+
};
|
|
132
|
+
}
|
|
133
|
+
});
|
|
134
|
+
|
|
135
|
+
// src/lib/integrations/node-http/index.ts
|
|
136
|
+
var node_http_exports = {};
|
|
137
|
+
__export(node_http_exports, {
|
|
138
|
+
copilotRuntimeNodeHttpEndpoint: () => copilotRuntimeNodeHttpEndpoint
|
|
139
|
+
});
|
|
140
|
+
module.exports = __toCommonJS(node_http_exports);
|
|
141
|
+
var import_graphql_yoga2 = require("graphql-yoga");
|
|
142
|
+
|
|
143
|
+
// src/lib/integrations/shared.ts
|
|
144
|
+
var import_type_graphql27 = require("type-graphql");
|
|
145
|
+
|
|
146
|
+
// src/graphql/resolvers/copilot.resolver.ts
|
|
147
|
+
var import_type_graphql21 = require("type-graphql");
|
|
148
|
+
var import_rxjs3 = require("rxjs");
|
|
149
|
+
|
|
150
|
+
// src/graphql/inputs/generate-copilot-response.input.ts
|
|
151
|
+
var import_type_graphql19 = require("type-graphql");
|
|
152
|
+
|
|
153
|
+
// src/graphql/inputs/message.input.ts
|
|
154
|
+
var import_type_graphql3 = require("type-graphql");
|
|
155
|
+
|
|
156
|
+
// src/graphql/types/enums.ts
|
|
157
|
+
var import_type_graphql = require("type-graphql");
|
|
158
|
+
var MessageRole;
|
|
159
|
+
(function(MessageRole2) {
|
|
160
|
+
MessageRole2["user"] = "user";
|
|
161
|
+
MessageRole2["assistant"] = "assistant";
|
|
162
|
+
MessageRole2["system"] = "system";
|
|
163
|
+
MessageRole2["tool"] = "tool";
|
|
164
|
+
MessageRole2["developer"] = "developer";
|
|
165
|
+
})(MessageRole || (MessageRole = {}));
|
|
166
|
+
var CopilotRequestType;
|
|
167
|
+
(function(CopilotRequestType2) {
|
|
168
|
+
CopilotRequestType2["Chat"] = "Chat";
|
|
169
|
+
CopilotRequestType2["Task"] = "Task";
|
|
170
|
+
CopilotRequestType2["TextareaCompletion"] = "TextareaCompletion";
|
|
171
|
+
CopilotRequestType2["TextareaPopover"] = "TextareaPopover";
|
|
172
|
+
CopilotRequestType2["Suggestion"] = "Suggestion";
|
|
173
|
+
})(CopilotRequestType || (CopilotRequestType = {}));
|
|
174
|
+
var ActionInputAvailability;
|
|
175
|
+
(function(ActionInputAvailability2) {
|
|
176
|
+
ActionInputAvailability2["disabled"] = "disabled";
|
|
177
|
+
ActionInputAvailability2["enabled"] = "enabled";
|
|
178
|
+
ActionInputAvailability2["remote"] = "remote";
|
|
179
|
+
})(ActionInputAvailability || (ActionInputAvailability = {}));
|
|
180
|
+
(0, import_type_graphql.registerEnumType)(MessageRole, {
|
|
181
|
+
name: "MessageRole",
|
|
182
|
+
description: "The role of the message"
|
|
183
|
+
});
|
|
184
|
+
(0, import_type_graphql.registerEnumType)(CopilotRequestType, {
|
|
185
|
+
name: "CopilotRequestType",
|
|
186
|
+
description: "The type of Copilot request"
|
|
187
|
+
});
|
|
188
|
+
(0, import_type_graphql.registerEnumType)(ActionInputAvailability, {
|
|
189
|
+
name: "ActionInputAvailability",
|
|
190
|
+
description: "The availability of the frontend action"
|
|
191
|
+
});
|
|
192
|
+
|
|
193
|
+
// src/graphql/types/base/index.ts
|
|
194
|
+
var import_type_graphql2 = require("type-graphql");
|
|
195
|
+
function _ts_decorate(decorators, target, key, desc) {
|
|
196
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
197
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function")
|
|
198
|
+
r = Reflect.decorate(decorators, target, key, desc);
|
|
199
|
+
else
|
|
200
|
+
for (var i = decorators.length - 1; i >= 0; i--)
|
|
201
|
+
if (d = decorators[i])
|
|
202
|
+
r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
203
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
204
|
+
}
|
|
205
|
+
__name(_ts_decorate, "_ts_decorate");
|
|
206
|
+
function _ts_metadata(k, v) {
|
|
207
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function")
|
|
208
|
+
return Reflect.metadata(k, v);
|
|
209
|
+
}
|
|
210
|
+
__name(_ts_metadata, "_ts_metadata");
|
|
211
|
+
var BaseMessageInput = class {
|
|
212
|
+
id;
|
|
213
|
+
createdAt;
|
|
214
|
+
};
|
|
215
|
+
__name(BaseMessageInput, "BaseMessageInput");
|
|
216
|
+
_ts_decorate([
|
|
217
|
+
(0, import_type_graphql2.Field)(() => String),
|
|
218
|
+
_ts_metadata("design:type", String)
|
|
219
|
+
], BaseMessageInput.prototype, "id", void 0);
|
|
220
|
+
_ts_decorate([
|
|
221
|
+
(0, import_type_graphql2.Field)(() => Date),
|
|
222
|
+
_ts_metadata("design:type", typeof Date === "undefined" ? Object : Date)
|
|
223
|
+
], BaseMessageInput.prototype, "createdAt", void 0);
|
|
224
|
+
BaseMessageInput = _ts_decorate([
|
|
225
|
+
(0, import_type_graphql2.InputType)()
|
|
226
|
+
], BaseMessageInput);
|
|
227
|
+
|
|
228
|
+
// src/graphql/inputs/message.input.ts
|
|
229
|
+
function _ts_decorate2(decorators, target, key, desc) {
|
|
230
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
231
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function")
|
|
232
|
+
r = Reflect.decorate(decorators, target, key, desc);
|
|
233
|
+
else
|
|
234
|
+
for (var i = decorators.length - 1; i >= 0; i--)
|
|
235
|
+
if (d = decorators[i])
|
|
236
|
+
r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
237
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
238
|
+
}
|
|
239
|
+
__name(_ts_decorate2, "_ts_decorate");
|
|
240
|
+
function _ts_metadata2(k, v) {
|
|
241
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function")
|
|
242
|
+
return Reflect.metadata(k, v);
|
|
243
|
+
}
|
|
244
|
+
__name(_ts_metadata2, "_ts_metadata");
|
|
245
|
+
var MessageInput = class extends BaseMessageInput {
|
|
246
|
+
textMessage;
|
|
247
|
+
actionExecutionMessage;
|
|
248
|
+
resultMessage;
|
|
249
|
+
agentStateMessage;
|
|
250
|
+
imageMessage;
|
|
251
|
+
};
|
|
252
|
+
__name(MessageInput, "MessageInput");
|
|
253
|
+
_ts_decorate2([
|
|
254
|
+
(0, import_type_graphql3.Field)(() => TextMessageInput, {
|
|
255
|
+
nullable: true
|
|
256
|
+
}),
|
|
257
|
+
_ts_metadata2("design:type", typeof TextMessageInput === "undefined" ? Object : TextMessageInput)
|
|
258
|
+
], MessageInput.prototype, "textMessage", void 0);
|
|
259
|
+
_ts_decorate2([
|
|
260
|
+
(0, import_type_graphql3.Field)(() => ActionExecutionMessageInput, {
|
|
261
|
+
nullable: true
|
|
262
|
+
}),
|
|
263
|
+
_ts_metadata2("design:type", typeof ActionExecutionMessageInput === "undefined" ? Object : ActionExecutionMessageInput)
|
|
264
|
+
], MessageInput.prototype, "actionExecutionMessage", void 0);
|
|
265
|
+
_ts_decorate2([
|
|
266
|
+
(0, import_type_graphql3.Field)(() => ResultMessageInput, {
|
|
267
|
+
nullable: true
|
|
268
|
+
}),
|
|
269
|
+
_ts_metadata2("design:type", typeof ResultMessageInput === "undefined" ? Object : ResultMessageInput)
|
|
270
|
+
], MessageInput.prototype, "resultMessage", void 0);
|
|
271
|
+
_ts_decorate2([
|
|
272
|
+
(0, import_type_graphql3.Field)(() => AgentStateMessageInput, {
|
|
273
|
+
nullable: true
|
|
274
|
+
}),
|
|
275
|
+
_ts_metadata2("design:type", typeof AgentStateMessageInput === "undefined" ? Object : AgentStateMessageInput)
|
|
276
|
+
], MessageInput.prototype, "agentStateMessage", void 0);
|
|
277
|
+
_ts_decorate2([
|
|
278
|
+
(0, import_type_graphql3.Field)(() => ImageMessageInput, {
|
|
279
|
+
nullable: true
|
|
280
|
+
}),
|
|
281
|
+
_ts_metadata2("design:type", typeof ImageMessageInput === "undefined" ? Object : ImageMessageInput)
|
|
282
|
+
], MessageInput.prototype, "imageMessage", void 0);
|
|
283
|
+
MessageInput = _ts_decorate2([
|
|
284
|
+
(0, import_type_graphql3.InputType)()
|
|
285
|
+
], MessageInput);
|
|
286
|
+
var TextMessageInput = class {
|
|
287
|
+
content;
|
|
288
|
+
parentMessageId;
|
|
289
|
+
role;
|
|
290
|
+
};
|
|
291
|
+
__name(TextMessageInput, "TextMessageInput");
|
|
292
|
+
_ts_decorate2([
|
|
293
|
+
(0, import_type_graphql3.Field)(() => String),
|
|
294
|
+
_ts_metadata2("design:type", String)
|
|
295
|
+
], TextMessageInput.prototype, "content", void 0);
|
|
296
|
+
_ts_decorate2([
|
|
297
|
+
(0, import_type_graphql3.Field)(() => String, {
|
|
298
|
+
nullable: true
|
|
299
|
+
}),
|
|
300
|
+
_ts_metadata2("design:type", String)
|
|
301
|
+
], TextMessageInput.prototype, "parentMessageId", void 0);
|
|
302
|
+
_ts_decorate2([
|
|
303
|
+
(0, import_type_graphql3.Field)(() => MessageRole),
|
|
304
|
+
_ts_metadata2("design:type", typeof MessageRole === "undefined" ? Object : MessageRole)
|
|
305
|
+
], TextMessageInput.prototype, "role", void 0);
|
|
306
|
+
TextMessageInput = _ts_decorate2([
|
|
307
|
+
(0, import_type_graphql3.InputType)()
|
|
308
|
+
], TextMessageInput);
|
|
309
|
+
var ActionExecutionMessageInput = class {
|
|
310
|
+
name;
|
|
311
|
+
arguments;
|
|
312
|
+
parentMessageId;
|
|
313
|
+
scope;
|
|
314
|
+
};
|
|
315
|
+
__name(ActionExecutionMessageInput, "ActionExecutionMessageInput");
|
|
316
|
+
_ts_decorate2([
|
|
317
|
+
(0, import_type_graphql3.Field)(() => String),
|
|
318
|
+
_ts_metadata2("design:type", String)
|
|
319
|
+
], ActionExecutionMessageInput.prototype, "name", void 0);
|
|
320
|
+
_ts_decorate2([
|
|
321
|
+
(0, import_type_graphql3.Field)(() => String),
|
|
322
|
+
_ts_metadata2("design:type", String)
|
|
323
|
+
], ActionExecutionMessageInput.prototype, "arguments", void 0);
|
|
324
|
+
_ts_decorate2([
|
|
325
|
+
(0, import_type_graphql3.Field)(() => String, {
|
|
326
|
+
nullable: true
|
|
327
|
+
}),
|
|
328
|
+
_ts_metadata2("design:type", String)
|
|
329
|
+
], ActionExecutionMessageInput.prototype, "parentMessageId", void 0);
|
|
330
|
+
_ts_decorate2([
|
|
331
|
+
(0, import_type_graphql3.Field)(() => String, {
|
|
332
|
+
nullable: true,
|
|
333
|
+
deprecationReason: "This field will be removed in a future version"
|
|
334
|
+
}),
|
|
335
|
+
_ts_metadata2("design:type", typeof String === "undefined" ? Object : String)
|
|
336
|
+
], ActionExecutionMessageInput.prototype, "scope", void 0);
|
|
337
|
+
ActionExecutionMessageInput = _ts_decorate2([
|
|
338
|
+
(0, import_type_graphql3.InputType)()
|
|
339
|
+
], ActionExecutionMessageInput);
|
|
340
|
+
var ResultMessageInput = class {
|
|
341
|
+
actionExecutionId;
|
|
342
|
+
actionName;
|
|
343
|
+
parentMessageId;
|
|
344
|
+
result;
|
|
345
|
+
};
|
|
346
|
+
__name(ResultMessageInput, "ResultMessageInput");
|
|
347
|
+
_ts_decorate2([
|
|
348
|
+
(0, import_type_graphql3.Field)(() => String),
|
|
349
|
+
_ts_metadata2("design:type", String)
|
|
350
|
+
], ResultMessageInput.prototype, "actionExecutionId", void 0);
|
|
351
|
+
_ts_decorate2([
|
|
352
|
+
(0, import_type_graphql3.Field)(() => String),
|
|
353
|
+
_ts_metadata2("design:type", String)
|
|
354
|
+
], ResultMessageInput.prototype, "actionName", void 0);
|
|
355
|
+
_ts_decorate2([
|
|
356
|
+
(0, import_type_graphql3.Field)(() => String, {
|
|
357
|
+
nullable: true
|
|
358
|
+
}),
|
|
359
|
+
_ts_metadata2("design:type", String)
|
|
360
|
+
], ResultMessageInput.prototype, "parentMessageId", void 0);
|
|
361
|
+
_ts_decorate2([
|
|
362
|
+
(0, import_type_graphql3.Field)(() => String),
|
|
363
|
+
_ts_metadata2("design:type", String)
|
|
364
|
+
], ResultMessageInput.prototype, "result", void 0);
|
|
365
|
+
ResultMessageInput = _ts_decorate2([
|
|
366
|
+
(0, import_type_graphql3.InputType)()
|
|
367
|
+
], ResultMessageInput);
|
|
368
|
+
var AgentStateMessageInput = class {
|
|
369
|
+
threadId;
|
|
370
|
+
agentName;
|
|
371
|
+
role;
|
|
372
|
+
state;
|
|
373
|
+
running;
|
|
374
|
+
nodeName;
|
|
375
|
+
runId;
|
|
376
|
+
active;
|
|
377
|
+
};
|
|
378
|
+
__name(AgentStateMessageInput, "AgentStateMessageInput");
|
|
379
|
+
_ts_decorate2([
|
|
380
|
+
(0, import_type_graphql3.Field)(() => String),
|
|
381
|
+
_ts_metadata2("design:type", String)
|
|
382
|
+
], AgentStateMessageInput.prototype, "threadId", void 0);
|
|
383
|
+
_ts_decorate2([
|
|
384
|
+
(0, import_type_graphql3.Field)(() => String),
|
|
385
|
+
_ts_metadata2("design:type", String)
|
|
386
|
+
], AgentStateMessageInput.prototype, "agentName", void 0);
|
|
387
|
+
_ts_decorate2([
|
|
388
|
+
(0, import_type_graphql3.Field)(() => MessageRole),
|
|
389
|
+
_ts_metadata2("design:type", typeof MessageRole === "undefined" ? Object : MessageRole)
|
|
390
|
+
], AgentStateMessageInput.prototype, "role", void 0);
|
|
391
|
+
_ts_decorate2([
|
|
392
|
+
(0, import_type_graphql3.Field)(() => String),
|
|
393
|
+
_ts_metadata2("design:type", String)
|
|
394
|
+
], AgentStateMessageInput.prototype, "state", void 0);
|
|
395
|
+
_ts_decorate2([
|
|
396
|
+
(0, import_type_graphql3.Field)(() => Boolean),
|
|
397
|
+
_ts_metadata2("design:type", Boolean)
|
|
398
|
+
], AgentStateMessageInput.prototype, "running", void 0);
|
|
399
|
+
_ts_decorate2([
|
|
400
|
+
(0, import_type_graphql3.Field)(() => String),
|
|
401
|
+
_ts_metadata2("design:type", String)
|
|
402
|
+
], AgentStateMessageInput.prototype, "nodeName", void 0);
|
|
403
|
+
_ts_decorate2([
|
|
404
|
+
(0, import_type_graphql3.Field)(() => String),
|
|
405
|
+
_ts_metadata2("design:type", String)
|
|
406
|
+
], AgentStateMessageInput.prototype, "runId", void 0);
|
|
407
|
+
_ts_decorate2([
|
|
408
|
+
(0, import_type_graphql3.Field)(() => Boolean),
|
|
409
|
+
_ts_metadata2("design:type", Boolean)
|
|
410
|
+
], AgentStateMessageInput.prototype, "active", void 0);
|
|
411
|
+
AgentStateMessageInput = _ts_decorate2([
|
|
412
|
+
(0, import_type_graphql3.InputType)()
|
|
413
|
+
], AgentStateMessageInput);
|
|
414
|
+
var ImageMessageInput = class {
|
|
415
|
+
format;
|
|
416
|
+
bytes;
|
|
417
|
+
parentMessageId;
|
|
418
|
+
role;
|
|
419
|
+
};
|
|
420
|
+
__name(ImageMessageInput, "ImageMessageInput");
|
|
421
|
+
_ts_decorate2([
|
|
422
|
+
(0, import_type_graphql3.Field)(() => String),
|
|
423
|
+
_ts_metadata2("design:type", String)
|
|
424
|
+
], ImageMessageInput.prototype, "format", void 0);
|
|
425
|
+
_ts_decorate2([
|
|
426
|
+
(0, import_type_graphql3.Field)(() => String),
|
|
427
|
+
_ts_metadata2("design:type", String)
|
|
428
|
+
], ImageMessageInput.prototype, "bytes", void 0);
|
|
429
|
+
_ts_decorate2([
|
|
430
|
+
(0, import_type_graphql3.Field)(() => String, {
|
|
431
|
+
nullable: true
|
|
432
|
+
}),
|
|
433
|
+
_ts_metadata2("design:type", String)
|
|
434
|
+
], ImageMessageInput.prototype, "parentMessageId", void 0);
|
|
435
|
+
_ts_decorate2([
|
|
436
|
+
(0, import_type_graphql3.Field)(() => MessageRole),
|
|
437
|
+
_ts_metadata2("design:type", typeof MessageRole === "undefined" ? Object : MessageRole)
|
|
438
|
+
], ImageMessageInput.prototype, "role", void 0);
|
|
439
|
+
ImageMessageInput = _ts_decorate2([
|
|
440
|
+
(0, import_type_graphql3.InputType)()
|
|
441
|
+
], ImageMessageInput);
|
|
442
|
+
|
|
443
|
+
// src/graphql/inputs/frontend.input.ts
|
|
444
|
+
var import_type_graphql5 = require("type-graphql");
|
|
445
|
+
|
|
446
|
+
// src/graphql/inputs/action.input.ts
|
|
447
|
+
var import_type_graphql4 = require("type-graphql");
|
|
448
|
+
function _ts_decorate3(decorators, target, key, desc) {
|
|
449
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
450
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function")
|
|
451
|
+
r = Reflect.decorate(decorators, target, key, desc);
|
|
452
|
+
else
|
|
453
|
+
for (var i = decorators.length - 1; i >= 0; i--)
|
|
454
|
+
if (d = decorators[i])
|
|
455
|
+
r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
456
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
457
|
+
}
|
|
458
|
+
__name(_ts_decorate3, "_ts_decorate");
|
|
459
|
+
function _ts_metadata3(k, v) {
|
|
460
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function")
|
|
461
|
+
return Reflect.metadata(k, v);
|
|
462
|
+
}
|
|
463
|
+
__name(_ts_metadata3, "_ts_metadata");
|
|
464
|
+
var ActionInput = class {
|
|
465
|
+
name;
|
|
466
|
+
description;
|
|
467
|
+
jsonSchema;
|
|
468
|
+
available;
|
|
469
|
+
};
|
|
470
|
+
__name(ActionInput, "ActionInput");
|
|
471
|
+
_ts_decorate3([
|
|
472
|
+
(0, import_type_graphql4.Field)(() => String),
|
|
473
|
+
_ts_metadata3("design:type", String)
|
|
474
|
+
], ActionInput.prototype, "name", void 0);
|
|
475
|
+
_ts_decorate3([
|
|
476
|
+
(0, import_type_graphql4.Field)(() => String),
|
|
477
|
+
_ts_metadata3("design:type", String)
|
|
478
|
+
], ActionInput.prototype, "description", void 0);
|
|
479
|
+
_ts_decorate3([
|
|
480
|
+
(0, import_type_graphql4.Field)(() => String),
|
|
481
|
+
_ts_metadata3("design:type", String)
|
|
482
|
+
], ActionInput.prototype, "jsonSchema", void 0);
|
|
483
|
+
_ts_decorate3([
|
|
484
|
+
(0, import_type_graphql4.Field)(() => ActionInputAvailability, {
|
|
485
|
+
nullable: true
|
|
486
|
+
}),
|
|
487
|
+
_ts_metadata3("design:type", typeof ActionInputAvailability === "undefined" ? Object : ActionInputAvailability)
|
|
488
|
+
], ActionInput.prototype, "available", void 0);
|
|
489
|
+
ActionInput = _ts_decorate3([
|
|
490
|
+
(0, import_type_graphql4.InputType)()
|
|
491
|
+
], ActionInput);
|
|
492
|
+
|
|
493
|
+
// src/graphql/inputs/frontend.input.ts
|
|
494
|
+
function _ts_decorate4(decorators, target, key, desc) {
|
|
495
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
496
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function")
|
|
497
|
+
r = Reflect.decorate(decorators, target, key, desc);
|
|
498
|
+
else
|
|
499
|
+
for (var i = decorators.length - 1; i >= 0; i--)
|
|
500
|
+
if (d = decorators[i])
|
|
501
|
+
r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
502
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
503
|
+
}
|
|
504
|
+
__name(_ts_decorate4, "_ts_decorate");
|
|
505
|
+
function _ts_metadata4(k, v) {
|
|
506
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function")
|
|
507
|
+
return Reflect.metadata(k, v);
|
|
508
|
+
}
|
|
509
|
+
__name(_ts_metadata4, "_ts_metadata");
|
|
510
|
+
var FrontendInput = class {
|
|
511
|
+
toDeprecate_fullContext;
|
|
512
|
+
actions;
|
|
513
|
+
url;
|
|
514
|
+
};
|
|
515
|
+
__name(FrontendInput, "FrontendInput");
|
|
516
|
+
_ts_decorate4([
|
|
517
|
+
(0, import_type_graphql5.Field)(() => String, {
|
|
518
|
+
nullable: true
|
|
519
|
+
}),
|
|
520
|
+
_ts_metadata4("design:type", String)
|
|
521
|
+
], FrontendInput.prototype, "toDeprecate_fullContext", void 0);
|
|
522
|
+
_ts_decorate4([
|
|
523
|
+
(0, import_type_graphql5.Field)(() => [
|
|
524
|
+
ActionInput
|
|
525
|
+
]),
|
|
526
|
+
_ts_metadata4("design:type", Array)
|
|
527
|
+
], FrontendInput.prototype, "actions", void 0);
|
|
528
|
+
_ts_decorate4([
|
|
529
|
+
(0, import_type_graphql5.Field)(() => String, {
|
|
530
|
+
nullable: true
|
|
531
|
+
}),
|
|
532
|
+
_ts_metadata4("design:type", String)
|
|
533
|
+
], FrontendInput.prototype, "url", void 0);
|
|
534
|
+
FrontendInput = _ts_decorate4([
|
|
535
|
+
(0, import_type_graphql5.InputType)()
|
|
536
|
+
], FrontendInput);
|
|
537
|
+
|
|
538
|
+
// src/graphql/inputs/cloud.input.ts
|
|
539
|
+
var import_type_graphql7 = require("type-graphql");
|
|
540
|
+
|
|
541
|
+
// src/graphql/inputs/cloud-guardrails.input.ts
|
|
542
|
+
var import_type_graphql6 = require("type-graphql");
|
|
543
|
+
function _ts_decorate5(decorators, target, key, desc) {
|
|
544
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
545
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function")
|
|
546
|
+
r = Reflect.decorate(decorators, target, key, desc);
|
|
547
|
+
else
|
|
548
|
+
for (var i = decorators.length - 1; i >= 0; i--)
|
|
549
|
+
if (d = decorators[i])
|
|
550
|
+
r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
551
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
552
|
+
}
|
|
553
|
+
__name(_ts_decorate5, "_ts_decorate");
|
|
554
|
+
function _ts_metadata5(k, v) {
|
|
555
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function")
|
|
556
|
+
return Reflect.metadata(k, v);
|
|
557
|
+
}
|
|
558
|
+
__name(_ts_metadata5, "_ts_metadata");
|
|
559
|
+
var GuardrailsRuleInput = class {
|
|
560
|
+
allowList = [];
|
|
561
|
+
denyList = [];
|
|
562
|
+
};
|
|
563
|
+
__name(GuardrailsRuleInput, "GuardrailsRuleInput");
|
|
564
|
+
_ts_decorate5([
|
|
565
|
+
(0, import_type_graphql6.Field)(() => [
|
|
566
|
+
String
|
|
567
|
+
], {
|
|
568
|
+
nullable: true
|
|
569
|
+
}),
|
|
570
|
+
_ts_metadata5("design:type", Array)
|
|
571
|
+
], GuardrailsRuleInput.prototype, "allowList", void 0);
|
|
572
|
+
_ts_decorate5([
|
|
573
|
+
(0, import_type_graphql6.Field)(() => [
|
|
574
|
+
String
|
|
575
|
+
], {
|
|
576
|
+
nullable: true
|
|
577
|
+
}),
|
|
578
|
+
_ts_metadata5("design:type", Array)
|
|
579
|
+
], GuardrailsRuleInput.prototype, "denyList", void 0);
|
|
580
|
+
GuardrailsRuleInput = _ts_decorate5([
|
|
581
|
+
(0, import_type_graphql6.InputType)()
|
|
582
|
+
], GuardrailsRuleInput);
|
|
583
|
+
var GuardrailsInput = class {
|
|
584
|
+
inputValidationRules;
|
|
585
|
+
};
|
|
586
|
+
__name(GuardrailsInput, "GuardrailsInput");
|
|
587
|
+
_ts_decorate5([
|
|
588
|
+
(0, import_type_graphql6.Field)(() => GuardrailsRuleInput, {
|
|
589
|
+
nullable: false
|
|
590
|
+
}),
|
|
591
|
+
_ts_metadata5("design:type", typeof GuardrailsRuleInput === "undefined" ? Object : GuardrailsRuleInput)
|
|
592
|
+
], GuardrailsInput.prototype, "inputValidationRules", void 0);
|
|
593
|
+
GuardrailsInput = _ts_decorate5([
|
|
594
|
+
(0, import_type_graphql6.InputType)()
|
|
595
|
+
], GuardrailsInput);
|
|
596
|
+
|
|
597
|
+
// src/graphql/inputs/cloud.input.ts
|
|
598
|
+
function _ts_decorate6(decorators, target, key, desc) {
|
|
599
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
600
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function")
|
|
601
|
+
r = Reflect.decorate(decorators, target, key, desc);
|
|
602
|
+
else
|
|
603
|
+
for (var i = decorators.length - 1; i >= 0; i--)
|
|
604
|
+
if (d = decorators[i])
|
|
605
|
+
r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
606
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
607
|
+
}
|
|
608
|
+
__name(_ts_decorate6, "_ts_decorate");
|
|
609
|
+
function _ts_metadata6(k, v) {
|
|
610
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function")
|
|
611
|
+
return Reflect.metadata(k, v);
|
|
612
|
+
}
|
|
613
|
+
__name(_ts_metadata6, "_ts_metadata");
|
|
614
|
+
var CloudInput = class {
|
|
615
|
+
guardrails;
|
|
616
|
+
};
|
|
617
|
+
__name(CloudInput, "CloudInput");
|
|
618
|
+
_ts_decorate6([
|
|
619
|
+
(0, import_type_graphql7.Field)(() => GuardrailsInput, {
|
|
620
|
+
nullable: true
|
|
621
|
+
}),
|
|
622
|
+
_ts_metadata6("design:type", typeof GuardrailsInput === "undefined" ? Object : GuardrailsInput)
|
|
623
|
+
], CloudInput.prototype, "guardrails", void 0);
|
|
624
|
+
CloudInput = _ts_decorate6([
|
|
625
|
+
(0, import_type_graphql7.InputType)()
|
|
626
|
+
], CloudInput);
|
|
627
|
+
|
|
628
|
+
// src/graphql/inputs/forwarded-parameters.input.ts
|
|
629
|
+
var import_type_graphql8 = require("type-graphql");
|
|
630
|
+
function _ts_decorate7(decorators, target, key, desc) {
|
|
631
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
632
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function")
|
|
633
|
+
r = Reflect.decorate(decorators, target, key, desc);
|
|
634
|
+
else
|
|
635
|
+
for (var i = decorators.length - 1; i >= 0; i--)
|
|
636
|
+
if (d = decorators[i])
|
|
637
|
+
r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
638
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
639
|
+
}
|
|
640
|
+
__name(_ts_decorate7, "_ts_decorate");
|
|
641
|
+
function _ts_metadata7(k, v) {
|
|
642
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function")
|
|
643
|
+
return Reflect.metadata(k, v);
|
|
644
|
+
}
|
|
645
|
+
__name(_ts_metadata7, "_ts_metadata");
|
|
646
|
+
var ForwardedParametersInput = class {
|
|
647
|
+
model;
|
|
648
|
+
maxTokens;
|
|
649
|
+
stop;
|
|
650
|
+
toolChoice;
|
|
651
|
+
toolChoiceFunctionName;
|
|
652
|
+
temperature;
|
|
653
|
+
};
|
|
654
|
+
__name(ForwardedParametersInput, "ForwardedParametersInput");
|
|
655
|
+
_ts_decorate7([
|
|
656
|
+
(0, import_type_graphql8.Field)(() => String, {
|
|
657
|
+
nullable: true
|
|
658
|
+
}),
|
|
659
|
+
_ts_metadata7("design:type", String)
|
|
660
|
+
], ForwardedParametersInput.prototype, "model", void 0);
|
|
661
|
+
_ts_decorate7([
|
|
662
|
+
(0, import_type_graphql8.Field)(() => Number, {
|
|
663
|
+
nullable: true
|
|
664
|
+
}),
|
|
665
|
+
_ts_metadata7("design:type", Number)
|
|
666
|
+
], ForwardedParametersInput.prototype, "maxTokens", void 0);
|
|
667
|
+
_ts_decorate7([
|
|
668
|
+
(0, import_type_graphql8.Field)(() => [
|
|
669
|
+
String
|
|
670
|
+
], {
|
|
671
|
+
nullable: true
|
|
672
|
+
}),
|
|
673
|
+
_ts_metadata7("design:type", Array)
|
|
674
|
+
], ForwardedParametersInput.prototype, "stop", void 0);
|
|
675
|
+
_ts_decorate7([
|
|
676
|
+
(0, import_type_graphql8.Field)(() => String, {
|
|
677
|
+
nullable: true
|
|
678
|
+
}),
|
|
679
|
+
_ts_metadata7("design:type", typeof String === "undefined" ? Object : String)
|
|
680
|
+
], ForwardedParametersInput.prototype, "toolChoice", void 0);
|
|
681
|
+
_ts_decorate7([
|
|
682
|
+
(0, import_type_graphql8.Field)(() => String, {
|
|
683
|
+
nullable: true
|
|
684
|
+
}),
|
|
685
|
+
_ts_metadata7("design:type", String)
|
|
686
|
+
], ForwardedParametersInput.prototype, "toolChoiceFunctionName", void 0);
|
|
687
|
+
_ts_decorate7([
|
|
688
|
+
(0, import_type_graphql8.Field)(() => Number, {
|
|
689
|
+
nullable: true
|
|
690
|
+
}),
|
|
691
|
+
_ts_metadata7("design:type", Number)
|
|
692
|
+
], ForwardedParametersInput.prototype, "temperature", void 0);
|
|
693
|
+
ForwardedParametersInput = _ts_decorate7([
|
|
694
|
+
(0, import_type_graphql8.InputType)()
|
|
695
|
+
], ForwardedParametersInput);
|
|
696
|
+
|
|
697
|
+
// src/graphql/inputs/agent-session.input.ts
|
|
698
|
+
var import_type_graphql9 = require("type-graphql");
|
|
699
|
+
function _ts_decorate8(decorators, target, key, desc) {
|
|
700
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
701
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function")
|
|
702
|
+
r = Reflect.decorate(decorators, target, key, desc);
|
|
703
|
+
else
|
|
704
|
+
for (var i = decorators.length - 1; i >= 0; i--)
|
|
705
|
+
if (d = decorators[i])
|
|
706
|
+
r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
707
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
708
|
+
}
|
|
709
|
+
__name(_ts_decorate8, "_ts_decorate");
|
|
710
|
+
function _ts_metadata8(k, v) {
|
|
711
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function")
|
|
712
|
+
return Reflect.metadata(k, v);
|
|
713
|
+
}
|
|
714
|
+
__name(_ts_metadata8, "_ts_metadata");
|
|
715
|
+
var AgentSessionInput = class {
|
|
716
|
+
agentName;
|
|
717
|
+
threadId;
|
|
718
|
+
nodeName;
|
|
719
|
+
};
|
|
720
|
+
__name(AgentSessionInput, "AgentSessionInput");
|
|
721
|
+
_ts_decorate8([
|
|
722
|
+
(0, import_type_graphql9.Field)(() => String),
|
|
723
|
+
_ts_metadata8("design:type", String)
|
|
724
|
+
], AgentSessionInput.prototype, "agentName", void 0);
|
|
725
|
+
_ts_decorate8([
|
|
726
|
+
(0, import_type_graphql9.Field)(() => String, {
|
|
727
|
+
nullable: true
|
|
728
|
+
}),
|
|
729
|
+
_ts_metadata8("design:type", String)
|
|
730
|
+
], AgentSessionInput.prototype, "threadId", void 0);
|
|
731
|
+
_ts_decorate8([
|
|
732
|
+
(0, import_type_graphql9.Field)(() => String, {
|
|
733
|
+
nullable: true
|
|
734
|
+
}),
|
|
735
|
+
_ts_metadata8("design:type", String)
|
|
736
|
+
], AgentSessionInput.prototype, "nodeName", void 0);
|
|
737
|
+
AgentSessionInput = _ts_decorate8([
|
|
738
|
+
(0, import_type_graphql9.InputType)()
|
|
739
|
+
], AgentSessionInput);
|
|
740
|
+
|
|
741
|
+
// src/graphql/inputs/agent-state.input.ts
|
|
742
|
+
var import_type_graphql10 = require("type-graphql");
|
|
743
|
+
function _ts_decorate9(decorators, target, key, desc) {
|
|
744
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
745
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function")
|
|
746
|
+
r = Reflect.decorate(decorators, target, key, desc);
|
|
747
|
+
else
|
|
748
|
+
for (var i = decorators.length - 1; i >= 0; i--)
|
|
749
|
+
if (d = decorators[i])
|
|
750
|
+
r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
751
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
752
|
+
}
|
|
753
|
+
__name(_ts_decorate9, "_ts_decorate");
|
|
754
|
+
function _ts_metadata9(k, v) {
|
|
755
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function")
|
|
756
|
+
return Reflect.metadata(k, v);
|
|
757
|
+
}
|
|
758
|
+
__name(_ts_metadata9, "_ts_metadata");
|
|
759
|
+
var AgentStateInput = class {
|
|
760
|
+
agentName;
|
|
761
|
+
state;
|
|
762
|
+
config;
|
|
763
|
+
};
|
|
764
|
+
__name(AgentStateInput, "AgentStateInput");
|
|
765
|
+
_ts_decorate9([
|
|
766
|
+
(0, import_type_graphql10.Field)(() => String),
|
|
767
|
+
_ts_metadata9("design:type", String)
|
|
768
|
+
], AgentStateInput.prototype, "agentName", void 0);
|
|
769
|
+
_ts_decorate9([
|
|
770
|
+
(0, import_type_graphql10.Field)(() => String),
|
|
771
|
+
_ts_metadata9("design:type", String)
|
|
772
|
+
], AgentStateInput.prototype, "state", void 0);
|
|
773
|
+
_ts_decorate9([
|
|
774
|
+
(0, import_type_graphql10.Field)(() => String, {
|
|
775
|
+
nullable: true
|
|
776
|
+
}),
|
|
777
|
+
_ts_metadata9("design:type", String)
|
|
778
|
+
], AgentStateInput.prototype, "config", void 0);
|
|
779
|
+
AgentStateInput = _ts_decorate9([
|
|
780
|
+
(0, import_type_graphql10.InputType)()
|
|
781
|
+
], AgentStateInput);
|
|
782
|
+
|
|
783
|
+
// src/graphql/inputs/extensions.input.ts
|
|
784
|
+
var import_type_graphql11 = require("type-graphql");
|
|
785
|
+
function _ts_decorate10(decorators, target, key, desc) {
|
|
786
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
787
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function")
|
|
788
|
+
r = Reflect.decorate(decorators, target, key, desc);
|
|
789
|
+
else
|
|
790
|
+
for (var i = decorators.length - 1; i >= 0; i--)
|
|
791
|
+
if (d = decorators[i])
|
|
792
|
+
r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
793
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
794
|
+
}
|
|
795
|
+
__name(_ts_decorate10, "_ts_decorate");
|
|
796
|
+
function _ts_metadata10(k, v) {
|
|
797
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function")
|
|
798
|
+
return Reflect.metadata(k, v);
|
|
799
|
+
}
|
|
800
|
+
__name(_ts_metadata10, "_ts_metadata");
|
|
801
|
+
var ExtensionsInput = class {
|
|
802
|
+
openaiAssistantAPI;
|
|
803
|
+
};
|
|
804
|
+
__name(ExtensionsInput, "ExtensionsInput");
|
|
805
|
+
_ts_decorate10([
|
|
806
|
+
(0, import_type_graphql11.Field)(() => OpenAIApiAssistantAPIInput, {
|
|
807
|
+
nullable: true
|
|
808
|
+
}),
|
|
809
|
+
_ts_metadata10("design:type", typeof OpenAIApiAssistantAPIInput === "undefined" ? Object : OpenAIApiAssistantAPIInput)
|
|
810
|
+
], ExtensionsInput.prototype, "openaiAssistantAPI", void 0);
|
|
811
|
+
ExtensionsInput = _ts_decorate10([
|
|
812
|
+
(0, import_type_graphql11.InputType)()
|
|
813
|
+
], ExtensionsInput);
|
|
814
|
+
var OpenAIApiAssistantAPIInput = class {
|
|
815
|
+
runId;
|
|
816
|
+
threadId;
|
|
817
|
+
};
|
|
818
|
+
__name(OpenAIApiAssistantAPIInput, "OpenAIApiAssistantAPIInput");
|
|
819
|
+
_ts_decorate10([
|
|
820
|
+
(0, import_type_graphql11.Field)(() => String, {
|
|
821
|
+
nullable: true
|
|
822
|
+
}),
|
|
823
|
+
_ts_metadata10("design:type", String)
|
|
824
|
+
], OpenAIApiAssistantAPIInput.prototype, "runId", void 0);
|
|
825
|
+
_ts_decorate10([
|
|
826
|
+
(0, import_type_graphql11.Field)(() => String, {
|
|
827
|
+
nullable: true
|
|
828
|
+
}),
|
|
829
|
+
_ts_metadata10("design:type", String)
|
|
830
|
+
], OpenAIApiAssistantAPIInput.prototype, "threadId", void 0);
|
|
831
|
+
OpenAIApiAssistantAPIInput = _ts_decorate10([
|
|
832
|
+
(0, import_type_graphql11.InputType)()
|
|
833
|
+
], OpenAIApiAssistantAPIInput);
|
|
834
|
+
|
|
835
|
+
// src/graphql/inputs/meta-event.input.ts
|
|
836
|
+
var import_type_graphql17 = require("type-graphql");
|
|
837
|
+
|
|
838
|
+
// src/graphql/types/meta-events.type.ts
|
|
839
|
+
var import_type_graphql16 = require("type-graphql");
|
|
840
|
+
|
|
841
|
+
// src/graphql/types/copilot-response.type.ts
|
|
842
|
+
var import_type_graphql15 = require("type-graphql");
|
|
843
|
+
|
|
844
|
+
// src/graphql/types/message-status.type.ts
|
|
845
|
+
var import_type_graphql12 = require("type-graphql");
|
|
846
|
+
function _ts_decorate11(decorators, target, key, desc) {
|
|
847
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
848
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function")
|
|
849
|
+
r = Reflect.decorate(decorators, target, key, desc);
|
|
850
|
+
else
|
|
851
|
+
for (var i = decorators.length - 1; i >= 0; i--)
|
|
852
|
+
if (d = decorators[i])
|
|
853
|
+
r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
854
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
855
|
+
}
|
|
856
|
+
__name(_ts_decorate11, "_ts_decorate");
|
|
857
|
+
function _ts_metadata11(k, v) {
|
|
858
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function")
|
|
859
|
+
return Reflect.metadata(k, v);
|
|
860
|
+
}
|
|
861
|
+
__name(_ts_metadata11, "_ts_metadata");
|
|
862
|
+
var MessageStatusCode;
|
|
863
|
+
(function(MessageStatusCode2) {
|
|
864
|
+
MessageStatusCode2["Pending"] = "pending";
|
|
865
|
+
MessageStatusCode2["Success"] = "success";
|
|
866
|
+
MessageStatusCode2["Failed"] = "failed";
|
|
867
|
+
})(MessageStatusCode || (MessageStatusCode = {}));
|
|
868
|
+
(0, import_type_graphql12.registerEnumType)(MessageStatusCode, {
|
|
869
|
+
name: "MessageStatusCode"
|
|
870
|
+
});
|
|
871
|
+
var BaseMessageStatus = /* @__PURE__ */ __name(class BaseMessageStatus2 {
|
|
872
|
+
code;
|
|
873
|
+
}, "BaseMessageStatus");
|
|
874
|
+
_ts_decorate11([
|
|
875
|
+
(0, import_type_graphql12.Field)(() => MessageStatusCode),
|
|
876
|
+
_ts_metadata11("design:type", String)
|
|
877
|
+
], BaseMessageStatus.prototype, "code", void 0);
|
|
878
|
+
BaseMessageStatus = _ts_decorate11([
|
|
879
|
+
(0, import_type_graphql12.ObjectType)()
|
|
880
|
+
], BaseMessageStatus);
|
|
881
|
+
var PendingMessageStatus = class extends BaseMessageStatus {
|
|
882
|
+
code = "pending";
|
|
883
|
+
};
|
|
884
|
+
__name(PendingMessageStatus, "PendingMessageStatus");
|
|
885
|
+
PendingMessageStatus = _ts_decorate11([
|
|
886
|
+
(0, import_type_graphql12.ObjectType)()
|
|
887
|
+
], PendingMessageStatus);
|
|
888
|
+
var SuccessMessageStatus = class extends BaseMessageStatus {
|
|
889
|
+
code = "success";
|
|
890
|
+
};
|
|
891
|
+
__name(SuccessMessageStatus, "SuccessMessageStatus");
|
|
892
|
+
SuccessMessageStatus = _ts_decorate11([
|
|
893
|
+
(0, import_type_graphql12.ObjectType)()
|
|
894
|
+
], SuccessMessageStatus);
|
|
895
|
+
var FailedMessageStatus = class extends BaseMessageStatus {
|
|
896
|
+
code = "failed";
|
|
897
|
+
reason;
|
|
898
|
+
};
|
|
899
|
+
__name(FailedMessageStatus, "FailedMessageStatus");
|
|
900
|
+
_ts_decorate11([
|
|
901
|
+
(0, import_type_graphql12.Field)(() => String),
|
|
902
|
+
_ts_metadata11("design:type", String)
|
|
903
|
+
], FailedMessageStatus.prototype, "reason", void 0);
|
|
904
|
+
FailedMessageStatus = _ts_decorate11([
|
|
905
|
+
(0, import_type_graphql12.ObjectType)()
|
|
906
|
+
], FailedMessageStatus);
|
|
907
|
+
var MessageStatusUnion = (0, import_type_graphql12.createUnionType)({
|
|
908
|
+
name: "MessageStatus",
|
|
909
|
+
types: () => [
|
|
910
|
+
PendingMessageStatus,
|
|
911
|
+
SuccessMessageStatus,
|
|
912
|
+
FailedMessageStatus
|
|
913
|
+
]
|
|
914
|
+
});
|
|
915
|
+
|
|
916
|
+
// src/graphql/types/response-status.type.ts
|
|
917
|
+
var import_graphql_scalars = require("graphql-scalars");
|
|
918
|
+
var import_type_graphql13 = require("type-graphql");
|
|
919
|
+
function _ts_decorate12(decorators, target, key, desc) {
|
|
920
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
921
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function")
|
|
922
|
+
r = Reflect.decorate(decorators, target, key, desc);
|
|
923
|
+
else
|
|
924
|
+
for (var i = decorators.length - 1; i >= 0; i--)
|
|
925
|
+
if (d = decorators[i])
|
|
926
|
+
r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
927
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
928
|
+
}
|
|
929
|
+
__name(_ts_decorate12, "_ts_decorate");
|
|
930
|
+
function _ts_metadata12(k, v) {
|
|
931
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function")
|
|
932
|
+
return Reflect.metadata(k, v);
|
|
933
|
+
}
|
|
934
|
+
__name(_ts_metadata12, "_ts_metadata");
|
|
935
|
+
var ResponseStatusCode;
|
|
936
|
+
(function(ResponseStatusCode2) {
|
|
937
|
+
ResponseStatusCode2["Pending"] = "pending";
|
|
938
|
+
ResponseStatusCode2["Success"] = "success";
|
|
939
|
+
ResponseStatusCode2["Failed"] = "failed";
|
|
940
|
+
})(ResponseStatusCode || (ResponseStatusCode = {}));
|
|
941
|
+
(0, import_type_graphql13.registerEnumType)(ResponseStatusCode, {
|
|
942
|
+
name: "ResponseStatusCode"
|
|
943
|
+
});
|
|
944
|
+
var BaseResponseStatus = /* @__PURE__ */ __name(class BaseResponseStatus2 {
|
|
945
|
+
code;
|
|
946
|
+
}, "BaseResponseStatus");
|
|
947
|
+
_ts_decorate12([
|
|
948
|
+
(0, import_type_graphql13.Field)(() => ResponseStatusCode),
|
|
949
|
+
_ts_metadata12("design:type", String)
|
|
950
|
+
], BaseResponseStatus.prototype, "code", void 0);
|
|
951
|
+
BaseResponseStatus = _ts_decorate12([
|
|
952
|
+
(0, import_type_graphql13.InterfaceType)({
|
|
953
|
+
resolveType(value) {
|
|
954
|
+
if (value.code === "success") {
|
|
955
|
+
return SuccessResponseStatus;
|
|
956
|
+
} else if (value.code === "failed") {
|
|
957
|
+
return FailedResponseStatus;
|
|
958
|
+
} else if (value.code === "pending") {
|
|
959
|
+
return PendingResponseStatus;
|
|
960
|
+
}
|
|
961
|
+
return void 0;
|
|
962
|
+
}
|
|
963
|
+
}),
|
|
964
|
+
(0, import_type_graphql13.ObjectType)()
|
|
965
|
+
], BaseResponseStatus);
|
|
966
|
+
var PendingResponseStatus = class extends BaseResponseStatus {
|
|
967
|
+
code = "pending";
|
|
968
|
+
};
|
|
969
|
+
__name(PendingResponseStatus, "PendingResponseStatus");
|
|
970
|
+
PendingResponseStatus = _ts_decorate12([
|
|
971
|
+
(0, import_type_graphql13.ObjectType)({
|
|
972
|
+
implements: BaseResponseStatus
|
|
973
|
+
})
|
|
974
|
+
], PendingResponseStatus);
|
|
975
|
+
var SuccessResponseStatus = class extends BaseResponseStatus {
|
|
976
|
+
code = "success";
|
|
977
|
+
};
|
|
978
|
+
__name(SuccessResponseStatus, "SuccessResponseStatus");
|
|
979
|
+
SuccessResponseStatus = _ts_decorate12([
|
|
980
|
+
(0, import_type_graphql13.ObjectType)({
|
|
981
|
+
implements: BaseResponseStatus
|
|
982
|
+
})
|
|
983
|
+
], SuccessResponseStatus);
|
|
984
|
+
var FailedResponseStatusReason;
|
|
985
|
+
(function(FailedResponseStatusReason2) {
|
|
986
|
+
FailedResponseStatusReason2["GUARDRAILS_VALIDATION_FAILED"] = "GUARDRAILS_VALIDATION_FAILED";
|
|
987
|
+
FailedResponseStatusReason2["MESSAGE_STREAM_INTERRUPTED"] = "MESSAGE_STREAM_INTERRUPTED";
|
|
988
|
+
FailedResponseStatusReason2["UNKNOWN_ERROR"] = "UNKNOWN_ERROR";
|
|
989
|
+
})(FailedResponseStatusReason || (FailedResponseStatusReason = {}));
|
|
990
|
+
(0, import_type_graphql13.registerEnumType)(FailedResponseStatusReason, {
|
|
991
|
+
name: "FailedResponseStatusReason"
|
|
992
|
+
});
|
|
993
|
+
var FailedResponseStatus = class extends BaseResponseStatus {
|
|
994
|
+
code = "failed";
|
|
995
|
+
reason;
|
|
996
|
+
details = null;
|
|
997
|
+
};
|
|
998
|
+
__name(FailedResponseStatus, "FailedResponseStatus");
|
|
999
|
+
_ts_decorate12([
|
|
1000
|
+
(0, import_type_graphql13.Field)(() => FailedResponseStatusReason),
|
|
1001
|
+
_ts_metadata12("design:type", String)
|
|
1002
|
+
], FailedResponseStatus.prototype, "reason", void 0);
|
|
1003
|
+
_ts_decorate12([
|
|
1004
|
+
(0, import_type_graphql13.Field)(() => import_graphql_scalars.GraphQLJSON, {
|
|
1005
|
+
nullable: true
|
|
1006
|
+
}),
|
|
1007
|
+
_ts_metadata12("design:type", typeof Record === "undefined" ? Object : Record)
|
|
1008
|
+
], FailedResponseStatus.prototype, "details", void 0);
|
|
1009
|
+
FailedResponseStatus = _ts_decorate12([
|
|
1010
|
+
(0, import_type_graphql13.ObjectType)({
|
|
1011
|
+
implements: BaseResponseStatus
|
|
1012
|
+
})
|
|
1013
|
+
], FailedResponseStatus);
|
|
1014
|
+
var ResponseStatusUnion = (0, import_type_graphql13.createUnionType)({
|
|
1015
|
+
name: "ResponseStatus",
|
|
1016
|
+
types: () => [
|
|
1017
|
+
PendingResponseStatus,
|
|
1018
|
+
SuccessResponseStatus,
|
|
1019
|
+
FailedResponseStatus
|
|
1020
|
+
]
|
|
1021
|
+
});
|
|
1022
|
+
|
|
1023
|
+
// src/graphql/types/extensions-response.type.ts
|
|
1024
|
+
var import_type_graphql14 = require("type-graphql");
|
|
1025
|
+
function _ts_decorate13(decorators, target, key, desc) {
|
|
1026
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
1027
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function")
|
|
1028
|
+
r = Reflect.decorate(decorators, target, key, desc);
|
|
1029
|
+
else
|
|
1030
|
+
for (var i = decorators.length - 1; i >= 0; i--)
|
|
1031
|
+
if (d = decorators[i])
|
|
1032
|
+
r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
1033
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
1034
|
+
}
|
|
1035
|
+
__name(_ts_decorate13, "_ts_decorate");
|
|
1036
|
+
function _ts_metadata13(k, v) {
|
|
1037
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function")
|
|
1038
|
+
return Reflect.metadata(k, v);
|
|
1039
|
+
}
|
|
1040
|
+
__name(_ts_metadata13, "_ts_metadata");
|
|
1041
|
+
var ExtensionsResponse = class {
|
|
1042
|
+
openaiAssistantAPI;
|
|
1043
|
+
};
|
|
1044
|
+
__name(ExtensionsResponse, "ExtensionsResponse");
|
|
1045
|
+
_ts_decorate13([
|
|
1046
|
+
(0, import_type_graphql14.Field)(() => OpenAIApiAssistantAPIResponse, {
|
|
1047
|
+
nullable: true
|
|
1048
|
+
}),
|
|
1049
|
+
_ts_metadata13("design:type", typeof OpenAIApiAssistantAPIResponse === "undefined" ? Object : OpenAIApiAssistantAPIResponse)
|
|
1050
|
+
], ExtensionsResponse.prototype, "openaiAssistantAPI", void 0);
|
|
1051
|
+
ExtensionsResponse = _ts_decorate13([
|
|
1052
|
+
(0, import_type_graphql14.ObjectType)()
|
|
1053
|
+
], ExtensionsResponse);
|
|
1054
|
+
var OpenAIApiAssistantAPIResponse = class {
|
|
1055
|
+
runId;
|
|
1056
|
+
threadId;
|
|
1057
|
+
};
|
|
1058
|
+
__name(OpenAIApiAssistantAPIResponse, "OpenAIApiAssistantAPIResponse");
|
|
1059
|
+
_ts_decorate13([
|
|
1060
|
+
(0, import_type_graphql14.Field)(() => String, {
|
|
1061
|
+
nullable: true
|
|
1062
|
+
}),
|
|
1063
|
+
_ts_metadata13("design:type", String)
|
|
1064
|
+
], OpenAIApiAssistantAPIResponse.prototype, "runId", void 0);
|
|
1065
|
+
_ts_decorate13([
|
|
1066
|
+
(0, import_type_graphql14.Field)(() => String, {
|
|
1067
|
+
nullable: true
|
|
1068
|
+
}),
|
|
1069
|
+
_ts_metadata13("design:type", String)
|
|
1070
|
+
], OpenAIApiAssistantAPIResponse.prototype, "threadId", void 0);
|
|
1071
|
+
OpenAIApiAssistantAPIResponse = _ts_decorate13([
|
|
1072
|
+
(0, import_type_graphql14.ObjectType)()
|
|
1073
|
+
], OpenAIApiAssistantAPIResponse);
|
|
1074
|
+
|
|
1075
|
+
// src/graphql/types/copilot-response.type.ts
|
|
1076
|
+
function _ts_decorate14(decorators, target, key, desc) {
|
|
1077
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
1078
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function")
|
|
1079
|
+
r = Reflect.decorate(decorators, target, key, desc);
|
|
1080
|
+
else
|
|
1081
|
+
for (var i = decorators.length - 1; i >= 0; i--)
|
|
1082
|
+
if (d = decorators[i])
|
|
1083
|
+
r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
1084
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
1085
|
+
}
|
|
1086
|
+
__name(_ts_decorate14, "_ts_decorate");
|
|
1087
|
+
function _ts_metadata14(k, v) {
|
|
1088
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function")
|
|
1089
|
+
return Reflect.metadata(k, v);
|
|
1090
|
+
}
|
|
1091
|
+
__name(_ts_metadata14, "_ts_metadata");
|
|
1092
|
+
var BaseMessageOutput = class {
|
|
1093
|
+
id;
|
|
1094
|
+
createdAt;
|
|
1095
|
+
status;
|
|
1096
|
+
};
|
|
1097
|
+
__name(BaseMessageOutput, "BaseMessageOutput");
|
|
1098
|
+
_ts_decorate14([
|
|
1099
|
+
(0, import_type_graphql15.Field)(() => String),
|
|
1100
|
+
_ts_metadata14("design:type", String)
|
|
1101
|
+
], BaseMessageOutput.prototype, "id", void 0);
|
|
1102
|
+
_ts_decorate14([
|
|
1103
|
+
(0, import_type_graphql15.Field)(() => Date),
|
|
1104
|
+
_ts_metadata14("design:type", typeof Date === "undefined" ? Object : Date)
|
|
1105
|
+
], BaseMessageOutput.prototype, "createdAt", void 0);
|
|
1106
|
+
_ts_decorate14([
|
|
1107
|
+
(0, import_type_graphql15.Field)(() => MessageStatusUnion),
|
|
1108
|
+
_ts_metadata14("design:type", Object)
|
|
1109
|
+
], BaseMessageOutput.prototype, "status", void 0);
|
|
1110
|
+
BaseMessageOutput = _ts_decorate14([
|
|
1111
|
+
(0, import_type_graphql15.InterfaceType)({
|
|
1112
|
+
resolveType(value) {
|
|
1113
|
+
if (value.hasOwnProperty("content")) {
|
|
1114
|
+
return TextMessageOutput;
|
|
1115
|
+
} else if (value.hasOwnProperty("name")) {
|
|
1116
|
+
return ActionExecutionMessageOutput;
|
|
1117
|
+
} else if (value.hasOwnProperty("result")) {
|
|
1118
|
+
return ResultMessageOutput;
|
|
1119
|
+
} else if (value.hasOwnProperty("state")) {
|
|
1120
|
+
return AgentStateMessageOutput;
|
|
1121
|
+
} else if (value.hasOwnProperty("format") && value.hasOwnProperty("bytes")) {
|
|
1122
|
+
return ImageMessageOutput;
|
|
1123
|
+
}
|
|
1124
|
+
return void 0;
|
|
1125
|
+
}
|
|
1126
|
+
})
|
|
1127
|
+
], BaseMessageOutput);
|
|
1128
|
+
var TextMessageOutput = class {
|
|
1129
|
+
role;
|
|
1130
|
+
content;
|
|
1131
|
+
parentMessageId;
|
|
1132
|
+
};
|
|
1133
|
+
__name(TextMessageOutput, "TextMessageOutput");
|
|
1134
|
+
_ts_decorate14([
|
|
1135
|
+
(0, import_type_graphql15.Field)(() => MessageRole),
|
|
1136
|
+
_ts_metadata14("design:type", typeof MessageRole === "undefined" ? Object : MessageRole)
|
|
1137
|
+
], TextMessageOutput.prototype, "role", void 0);
|
|
1138
|
+
_ts_decorate14([
|
|
1139
|
+
(0, import_type_graphql15.Field)(() => [
|
|
1140
|
+
String
|
|
1141
|
+
]),
|
|
1142
|
+
_ts_metadata14("design:type", Array)
|
|
1143
|
+
], TextMessageOutput.prototype, "content", void 0);
|
|
1144
|
+
_ts_decorate14([
|
|
1145
|
+
(0, import_type_graphql15.Field)(() => String, {
|
|
1146
|
+
nullable: true
|
|
1147
|
+
}),
|
|
1148
|
+
_ts_metadata14("design:type", String)
|
|
1149
|
+
], TextMessageOutput.prototype, "parentMessageId", void 0);
|
|
1150
|
+
TextMessageOutput = _ts_decorate14([
|
|
1151
|
+
(0, import_type_graphql15.ObjectType)({
|
|
1152
|
+
implements: BaseMessageOutput
|
|
1153
|
+
})
|
|
1154
|
+
], TextMessageOutput);
|
|
1155
|
+
var ActionExecutionMessageOutput = class {
|
|
1156
|
+
name;
|
|
1157
|
+
scope;
|
|
1158
|
+
arguments;
|
|
1159
|
+
parentMessageId;
|
|
1160
|
+
};
|
|
1161
|
+
__name(ActionExecutionMessageOutput, "ActionExecutionMessageOutput");
|
|
1162
|
+
_ts_decorate14([
|
|
1163
|
+
(0, import_type_graphql15.Field)(() => String),
|
|
1164
|
+
_ts_metadata14("design:type", String)
|
|
1165
|
+
], ActionExecutionMessageOutput.prototype, "name", void 0);
|
|
1166
|
+
_ts_decorate14([
|
|
1167
|
+
(0, import_type_graphql15.Field)(() => String, {
|
|
1168
|
+
nullable: true,
|
|
1169
|
+
deprecationReason: "This field will be removed in a future version"
|
|
1170
|
+
}),
|
|
1171
|
+
_ts_metadata14("design:type", String)
|
|
1172
|
+
], ActionExecutionMessageOutput.prototype, "scope", void 0);
|
|
1173
|
+
_ts_decorate14([
|
|
1174
|
+
(0, import_type_graphql15.Field)(() => [
|
|
1175
|
+
String
|
|
1176
|
+
]),
|
|
1177
|
+
_ts_metadata14("design:type", Array)
|
|
1178
|
+
], ActionExecutionMessageOutput.prototype, "arguments", void 0);
|
|
1179
|
+
_ts_decorate14([
|
|
1180
|
+
(0, import_type_graphql15.Field)(() => String, {
|
|
1181
|
+
nullable: true
|
|
1182
|
+
}),
|
|
1183
|
+
_ts_metadata14("design:type", String)
|
|
1184
|
+
], ActionExecutionMessageOutput.prototype, "parentMessageId", void 0);
|
|
1185
|
+
ActionExecutionMessageOutput = _ts_decorate14([
|
|
1186
|
+
(0, import_type_graphql15.ObjectType)({
|
|
1187
|
+
implements: BaseMessageOutput
|
|
1188
|
+
})
|
|
1189
|
+
], ActionExecutionMessageOutput);
|
|
1190
|
+
var ResultMessageOutput = class {
|
|
1191
|
+
actionExecutionId;
|
|
1192
|
+
actionName;
|
|
1193
|
+
result;
|
|
1194
|
+
};
|
|
1195
|
+
__name(ResultMessageOutput, "ResultMessageOutput");
|
|
1196
|
+
_ts_decorate14([
|
|
1197
|
+
(0, import_type_graphql15.Field)(() => String),
|
|
1198
|
+
_ts_metadata14("design:type", String)
|
|
1199
|
+
], ResultMessageOutput.prototype, "actionExecutionId", void 0);
|
|
1200
|
+
_ts_decorate14([
|
|
1201
|
+
(0, import_type_graphql15.Field)(() => String),
|
|
1202
|
+
_ts_metadata14("design:type", String)
|
|
1203
|
+
], ResultMessageOutput.prototype, "actionName", void 0);
|
|
1204
|
+
_ts_decorate14([
|
|
1205
|
+
(0, import_type_graphql15.Field)(() => String),
|
|
1206
|
+
_ts_metadata14("design:type", String)
|
|
1207
|
+
], ResultMessageOutput.prototype, "result", void 0);
|
|
1208
|
+
ResultMessageOutput = _ts_decorate14([
|
|
1209
|
+
(0, import_type_graphql15.ObjectType)({
|
|
1210
|
+
implements: BaseMessageOutput
|
|
1211
|
+
})
|
|
1212
|
+
], ResultMessageOutput);
|
|
1213
|
+
var AgentStateMessageOutput = class {
|
|
1214
|
+
threadId;
|
|
1215
|
+
agentName;
|
|
1216
|
+
nodeName;
|
|
1217
|
+
runId;
|
|
1218
|
+
active;
|
|
1219
|
+
role;
|
|
1220
|
+
state;
|
|
1221
|
+
running;
|
|
1222
|
+
};
|
|
1223
|
+
__name(AgentStateMessageOutput, "AgentStateMessageOutput");
|
|
1224
|
+
_ts_decorate14([
|
|
1225
|
+
(0, import_type_graphql15.Field)(() => String),
|
|
1226
|
+
_ts_metadata14("design:type", String)
|
|
1227
|
+
], AgentStateMessageOutput.prototype, "threadId", void 0);
|
|
1228
|
+
_ts_decorate14([
|
|
1229
|
+
(0, import_type_graphql15.Field)(() => String),
|
|
1230
|
+
_ts_metadata14("design:type", String)
|
|
1231
|
+
], AgentStateMessageOutput.prototype, "agentName", void 0);
|
|
1232
|
+
_ts_decorate14([
|
|
1233
|
+
(0, import_type_graphql15.Field)(() => String),
|
|
1234
|
+
_ts_metadata14("design:type", String)
|
|
1235
|
+
], AgentStateMessageOutput.prototype, "nodeName", void 0);
|
|
1236
|
+
_ts_decorate14([
|
|
1237
|
+
(0, import_type_graphql15.Field)(() => String),
|
|
1238
|
+
_ts_metadata14("design:type", String)
|
|
1239
|
+
], AgentStateMessageOutput.prototype, "runId", void 0);
|
|
1240
|
+
_ts_decorate14([
|
|
1241
|
+
(0, import_type_graphql15.Field)(() => Boolean),
|
|
1242
|
+
_ts_metadata14("design:type", Boolean)
|
|
1243
|
+
], AgentStateMessageOutput.prototype, "active", void 0);
|
|
1244
|
+
_ts_decorate14([
|
|
1245
|
+
(0, import_type_graphql15.Field)(() => MessageRole),
|
|
1246
|
+
_ts_metadata14("design:type", typeof MessageRole === "undefined" ? Object : MessageRole)
|
|
1247
|
+
], AgentStateMessageOutput.prototype, "role", void 0);
|
|
1248
|
+
_ts_decorate14([
|
|
1249
|
+
(0, import_type_graphql15.Field)(() => String),
|
|
1250
|
+
_ts_metadata14("design:type", String)
|
|
1251
|
+
], AgentStateMessageOutput.prototype, "state", void 0);
|
|
1252
|
+
_ts_decorate14([
|
|
1253
|
+
(0, import_type_graphql15.Field)(() => Boolean),
|
|
1254
|
+
_ts_metadata14("design:type", Boolean)
|
|
1255
|
+
], AgentStateMessageOutput.prototype, "running", void 0);
|
|
1256
|
+
AgentStateMessageOutput = _ts_decorate14([
|
|
1257
|
+
(0, import_type_graphql15.ObjectType)({
|
|
1258
|
+
implements: BaseMessageOutput
|
|
1259
|
+
})
|
|
1260
|
+
], AgentStateMessageOutput);
|
|
1261
|
+
var ImageMessageOutput = class {
|
|
1262
|
+
format;
|
|
1263
|
+
bytes;
|
|
1264
|
+
role;
|
|
1265
|
+
parentMessageId;
|
|
1266
|
+
};
|
|
1267
|
+
__name(ImageMessageOutput, "ImageMessageOutput");
|
|
1268
|
+
_ts_decorate14([
|
|
1269
|
+
(0, import_type_graphql15.Field)(() => String),
|
|
1270
|
+
_ts_metadata14("design:type", String)
|
|
1271
|
+
], ImageMessageOutput.prototype, "format", void 0);
|
|
1272
|
+
_ts_decorate14([
|
|
1273
|
+
(0, import_type_graphql15.Field)(() => String),
|
|
1274
|
+
_ts_metadata14("design:type", String)
|
|
1275
|
+
], ImageMessageOutput.prototype, "bytes", void 0);
|
|
1276
|
+
_ts_decorate14([
|
|
1277
|
+
(0, import_type_graphql15.Field)(() => MessageRole),
|
|
1278
|
+
_ts_metadata14("design:type", typeof MessageRole === "undefined" ? Object : MessageRole)
|
|
1279
|
+
], ImageMessageOutput.prototype, "role", void 0);
|
|
1280
|
+
_ts_decorate14([
|
|
1281
|
+
(0, import_type_graphql15.Field)(() => String, {
|
|
1282
|
+
nullable: true
|
|
1283
|
+
}),
|
|
1284
|
+
_ts_metadata14("design:type", String)
|
|
1285
|
+
], ImageMessageOutput.prototype, "parentMessageId", void 0);
|
|
1286
|
+
ImageMessageOutput = _ts_decorate14([
|
|
1287
|
+
(0, import_type_graphql15.ObjectType)({
|
|
1288
|
+
implements: BaseMessageOutput
|
|
1289
|
+
})
|
|
1290
|
+
], ImageMessageOutput);
|
|
1291
|
+
var CopilotResponse = class {
|
|
1292
|
+
threadId;
|
|
1293
|
+
status;
|
|
1294
|
+
runId;
|
|
1295
|
+
messages;
|
|
1296
|
+
extensions;
|
|
1297
|
+
metaEvents;
|
|
1298
|
+
};
|
|
1299
|
+
__name(CopilotResponse, "CopilotResponse");
|
|
1300
|
+
_ts_decorate14([
|
|
1301
|
+
(0, import_type_graphql15.Field)(() => String),
|
|
1302
|
+
_ts_metadata14("design:type", String)
|
|
1303
|
+
], CopilotResponse.prototype, "threadId", void 0);
|
|
1304
|
+
_ts_decorate14([
|
|
1305
|
+
(0, import_type_graphql15.Field)(() => ResponseStatusUnion),
|
|
1306
|
+
_ts_metadata14("design:type", Object)
|
|
1307
|
+
], CopilotResponse.prototype, "status", void 0);
|
|
1308
|
+
_ts_decorate14([
|
|
1309
|
+
(0, import_type_graphql15.Field)({
|
|
1310
|
+
nullable: true
|
|
1311
|
+
}),
|
|
1312
|
+
_ts_metadata14("design:type", String)
|
|
1313
|
+
], CopilotResponse.prototype, "runId", void 0);
|
|
1314
|
+
_ts_decorate14([
|
|
1315
|
+
(0, import_type_graphql15.Field)(() => [
|
|
1316
|
+
BaseMessageOutput
|
|
1317
|
+
]),
|
|
1318
|
+
_ts_metadata14("design:type", Array)
|
|
1319
|
+
], CopilotResponse.prototype, "messages", void 0);
|
|
1320
|
+
_ts_decorate14([
|
|
1321
|
+
(0, import_type_graphql15.Field)(() => ExtensionsResponse, {
|
|
1322
|
+
nullable: true
|
|
1323
|
+
}),
|
|
1324
|
+
_ts_metadata14("design:type", typeof ExtensionsResponse === "undefined" ? Object : ExtensionsResponse)
|
|
1325
|
+
], CopilotResponse.prototype, "extensions", void 0);
|
|
1326
|
+
_ts_decorate14([
|
|
1327
|
+
(0, import_type_graphql15.Field)(() => [
|
|
1328
|
+
BaseMetaEvent
|
|
1329
|
+
], {
|
|
1330
|
+
nullable: true
|
|
1331
|
+
}),
|
|
1332
|
+
_ts_metadata14("design:type", Array)
|
|
1333
|
+
], CopilotResponse.prototype, "metaEvents", void 0);
|
|
1334
|
+
CopilotResponse = _ts_decorate14([
|
|
1335
|
+
(0, import_type_graphql15.ObjectType)()
|
|
1336
|
+
], CopilotResponse);
|
|
1337
|
+
|
|
1338
|
+
// src/graphql/types/meta-events.type.ts
|
|
1339
|
+
function _ts_decorate15(decorators, target, key, desc) {
|
|
1340
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
1341
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function")
|
|
1342
|
+
r = Reflect.decorate(decorators, target, key, desc);
|
|
1343
|
+
else
|
|
1344
|
+
for (var i = decorators.length - 1; i >= 0; i--)
|
|
1345
|
+
if (d = decorators[i])
|
|
1346
|
+
r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
1347
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
1348
|
+
}
|
|
1349
|
+
__name(_ts_decorate15, "_ts_decorate");
|
|
1350
|
+
function _ts_metadata15(k, v) {
|
|
1351
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function")
|
|
1352
|
+
return Reflect.metadata(k, v);
|
|
1353
|
+
}
|
|
1354
|
+
__name(_ts_metadata15, "_ts_metadata");
|
|
1355
|
+
var MetaEventName;
|
|
1356
|
+
(function(MetaEventName2) {
|
|
1357
|
+
MetaEventName2["LangGraphInterruptEvent"] = "LangGraphInterruptEvent";
|
|
1358
|
+
MetaEventName2["CopilotKitLangGraphInterruptEvent"] = "CopilotKitLangGraphInterruptEvent";
|
|
1359
|
+
})(MetaEventName || (MetaEventName = {}));
|
|
1360
|
+
(0, import_type_graphql16.registerEnumType)(MetaEventName, {
|
|
1361
|
+
name: "MetaEventName",
|
|
1362
|
+
description: "Meta event types"
|
|
1363
|
+
});
|
|
1364
|
+
var BaseMetaEvent = class {
|
|
1365
|
+
type = "MetaEvent";
|
|
1366
|
+
name;
|
|
1367
|
+
};
|
|
1368
|
+
__name(BaseMetaEvent, "BaseMetaEvent");
|
|
1369
|
+
_ts_decorate15([
|
|
1370
|
+
(0, import_type_graphql16.Field)(() => String),
|
|
1371
|
+
_ts_metadata15("design:type", String)
|
|
1372
|
+
], BaseMetaEvent.prototype, "type", void 0);
|
|
1373
|
+
_ts_decorate15([
|
|
1374
|
+
(0, import_type_graphql16.Field)(() => MetaEventName),
|
|
1375
|
+
_ts_metadata15("design:type", String)
|
|
1376
|
+
], BaseMetaEvent.prototype, "name", void 0);
|
|
1377
|
+
BaseMetaEvent = _ts_decorate15([
|
|
1378
|
+
(0, import_type_graphql16.InterfaceType)({
|
|
1379
|
+
resolveType(value) {
|
|
1380
|
+
if (value.name === "LangGraphInterruptEvent") {
|
|
1381
|
+
return LangGraphInterruptEvent;
|
|
1382
|
+
} else if (value.name === "CopilotKitLangGraphInterruptEvent") {
|
|
1383
|
+
return CopilotKitLangGraphInterruptEvent;
|
|
1384
|
+
}
|
|
1385
|
+
return void 0;
|
|
1386
|
+
}
|
|
1387
|
+
}),
|
|
1388
|
+
(0, import_type_graphql16.InterfaceType)()
|
|
1389
|
+
], BaseMetaEvent);
|
|
1390
|
+
var CopilotKitLangGraphInterruptEventData = class {
|
|
1391
|
+
value;
|
|
1392
|
+
messages;
|
|
1393
|
+
};
|
|
1394
|
+
__name(CopilotKitLangGraphInterruptEventData, "CopilotKitLangGraphInterruptEventData");
|
|
1395
|
+
_ts_decorate15([
|
|
1396
|
+
(0, import_type_graphql16.Field)(() => String),
|
|
1397
|
+
_ts_metadata15("design:type", String)
|
|
1398
|
+
], CopilotKitLangGraphInterruptEventData.prototype, "value", void 0);
|
|
1399
|
+
_ts_decorate15([
|
|
1400
|
+
(0, import_type_graphql16.Field)(() => [
|
|
1401
|
+
BaseMessageOutput
|
|
1402
|
+
]),
|
|
1403
|
+
_ts_metadata15("design:type", Array)
|
|
1404
|
+
], CopilotKitLangGraphInterruptEventData.prototype, "messages", void 0);
|
|
1405
|
+
CopilotKitLangGraphInterruptEventData = _ts_decorate15([
|
|
1406
|
+
(0, import_type_graphql16.ObjectType)()
|
|
1407
|
+
], CopilotKitLangGraphInterruptEventData);
|
|
1408
|
+
var LangGraphInterruptEvent = class {
|
|
1409
|
+
name = "LangGraphInterruptEvent";
|
|
1410
|
+
value;
|
|
1411
|
+
response;
|
|
1412
|
+
};
|
|
1413
|
+
__name(LangGraphInterruptEvent, "LangGraphInterruptEvent");
|
|
1414
|
+
_ts_decorate15([
|
|
1415
|
+
(0, import_type_graphql16.Field)(() => MetaEventName),
|
|
1416
|
+
_ts_metadata15("design:type", typeof MetaEventName === "undefined" || false ? Object : "LangGraphInterruptEvent")
|
|
1417
|
+
], LangGraphInterruptEvent.prototype, "name", void 0);
|
|
1418
|
+
_ts_decorate15([
|
|
1419
|
+
(0, import_type_graphql16.Field)(() => String),
|
|
1420
|
+
_ts_metadata15("design:type", String)
|
|
1421
|
+
], LangGraphInterruptEvent.prototype, "value", void 0);
|
|
1422
|
+
_ts_decorate15([
|
|
1423
|
+
(0, import_type_graphql16.Field)(() => String, {
|
|
1424
|
+
nullable: true
|
|
1425
|
+
}),
|
|
1426
|
+
_ts_metadata15("design:type", String)
|
|
1427
|
+
], LangGraphInterruptEvent.prototype, "response", void 0);
|
|
1428
|
+
LangGraphInterruptEvent = _ts_decorate15([
|
|
1429
|
+
(0, import_type_graphql16.ObjectType)({
|
|
1430
|
+
implements: BaseMetaEvent
|
|
1431
|
+
})
|
|
1432
|
+
], LangGraphInterruptEvent);
|
|
1433
|
+
var CopilotKitLangGraphInterruptEvent = class {
|
|
1434
|
+
name = "CopilotKitLangGraphInterruptEvent";
|
|
1435
|
+
data;
|
|
1436
|
+
response;
|
|
1437
|
+
};
|
|
1438
|
+
__name(CopilotKitLangGraphInterruptEvent, "CopilotKitLangGraphInterruptEvent");
|
|
1439
|
+
_ts_decorate15([
|
|
1440
|
+
(0, import_type_graphql16.Field)(() => MetaEventName),
|
|
1441
|
+
_ts_metadata15("design:type", typeof MetaEventName === "undefined" || false ? Object : "CopilotKitLangGraphInterruptEvent")
|
|
1442
|
+
], CopilotKitLangGraphInterruptEvent.prototype, "name", void 0);
|
|
1443
|
+
_ts_decorate15([
|
|
1444
|
+
(0, import_type_graphql16.Field)(() => CopilotKitLangGraphInterruptEventData),
|
|
1445
|
+
_ts_metadata15("design:type", typeof CopilotKitLangGraphInterruptEventData === "undefined" ? Object : CopilotKitLangGraphInterruptEventData)
|
|
1446
|
+
], CopilotKitLangGraphInterruptEvent.prototype, "data", void 0);
|
|
1447
|
+
_ts_decorate15([
|
|
1448
|
+
(0, import_type_graphql16.Field)(() => String, {
|
|
1449
|
+
nullable: true
|
|
1450
|
+
}),
|
|
1451
|
+
_ts_metadata15("design:type", String)
|
|
1452
|
+
], CopilotKitLangGraphInterruptEvent.prototype, "response", void 0);
|
|
1453
|
+
CopilotKitLangGraphInterruptEvent = _ts_decorate15([
|
|
1454
|
+
(0, import_type_graphql16.ObjectType)({
|
|
1455
|
+
implements: BaseMetaEvent
|
|
1456
|
+
})
|
|
1457
|
+
], CopilotKitLangGraphInterruptEvent);
|
|
1458
|
+
|
|
1459
|
+
// src/graphql/inputs/meta-event.input.ts
|
|
1460
|
+
function _ts_decorate16(decorators, target, key, desc) {
|
|
1461
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
1462
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function")
|
|
1463
|
+
r = Reflect.decorate(decorators, target, key, desc);
|
|
1464
|
+
else
|
|
1465
|
+
for (var i = decorators.length - 1; i >= 0; i--)
|
|
1466
|
+
if (d = decorators[i])
|
|
1467
|
+
r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
1468
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
1469
|
+
}
|
|
1470
|
+
__name(_ts_decorate16, "_ts_decorate");
|
|
1471
|
+
function _ts_metadata16(k, v) {
|
|
1472
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function")
|
|
1473
|
+
return Reflect.metadata(k, v);
|
|
1474
|
+
}
|
|
1475
|
+
__name(_ts_metadata16, "_ts_metadata");
|
|
1476
|
+
var MetaEventInput = class {
|
|
1477
|
+
name;
|
|
1478
|
+
value;
|
|
1479
|
+
response;
|
|
1480
|
+
messages;
|
|
1481
|
+
};
|
|
1482
|
+
__name(MetaEventInput, "MetaEventInput");
|
|
1483
|
+
_ts_decorate16([
|
|
1484
|
+
(0, import_type_graphql17.Field)(() => MetaEventName),
|
|
1485
|
+
_ts_metadata16("design:type", typeof MetaEventName === "undefined" ? Object : MetaEventName)
|
|
1486
|
+
], MetaEventInput.prototype, "name", void 0);
|
|
1487
|
+
_ts_decorate16([
|
|
1488
|
+
(0, import_type_graphql17.Field)(() => String),
|
|
1489
|
+
_ts_metadata16("design:type", String)
|
|
1490
|
+
], MetaEventInput.prototype, "value", void 0);
|
|
1491
|
+
_ts_decorate16([
|
|
1492
|
+
(0, import_type_graphql17.Field)(() => String, {
|
|
1493
|
+
nullable: true
|
|
1494
|
+
}),
|
|
1495
|
+
_ts_metadata16("design:type", String)
|
|
1496
|
+
], MetaEventInput.prototype, "response", void 0);
|
|
1497
|
+
_ts_decorate16([
|
|
1498
|
+
(0, import_type_graphql17.Field)(() => [
|
|
1499
|
+
MessageInput
|
|
1500
|
+
], {
|
|
1501
|
+
nullable: true
|
|
1502
|
+
}),
|
|
1503
|
+
_ts_metadata16("design:type", Array)
|
|
1504
|
+
], MetaEventInput.prototype, "messages", void 0);
|
|
1505
|
+
MetaEventInput = _ts_decorate16([
|
|
1506
|
+
(0, import_type_graphql17.InputType)()
|
|
1507
|
+
], MetaEventInput);
|
|
1508
|
+
|
|
1509
|
+
// src/graphql/inputs/copilot-context.input.ts
|
|
1510
|
+
var import_type_graphql18 = require("type-graphql");
|
|
1511
|
+
function _ts_decorate17(decorators, target, key, desc) {
|
|
1512
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
1513
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function")
|
|
1514
|
+
r = Reflect.decorate(decorators, target, key, desc);
|
|
1515
|
+
else
|
|
1516
|
+
for (var i = decorators.length - 1; i >= 0; i--)
|
|
1517
|
+
if (d = decorators[i])
|
|
1518
|
+
r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
1519
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
1520
|
+
}
|
|
1521
|
+
__name(_ts_decorate17, "_ts_decorate");
|
|
1522
|
+
function _ts_metadata17(k, v) {
|
|
1523
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function")
|
|
1524
|
+
return Reflect.metadata(k, v);
|
|
1525
|
+
}
|
|
1526
|
+
__name(_ts_metadata17, "_ts_metadata");
|
|
1527
|
+
var CopilotContextInput = class {
|
|
1528
|
+
description;
|
|
1529
|
+
value;
|
|
1530
|
+
};
|
|
1531
|
+
__name(CopilotContextInput, "CopilotContextInput");
|
|
1532
|
+
_ts_decorate17([
|
|
1533
|
+
(0, import_type_graphql18.Field)(() => String),
|
|
1534
|
+
_ts_metadata17("design:type", String)
|
|
1535
|
+
], CopilotContextInput.prototype, "description", void 0);
|
|
1536
|
+
_ts_decorate17([
|
|
1537
|
+
(0, import_type_graphql18.Field)(() => String),
|
|
1538
|
+
_ts_metadata17("design:type", String)
|
|
1539
|
+
], CopilotContextInput.prototype, "value", void 0);
|
|
1540
|
+
CopilotContextInput = _ts_decorate17([
|
|
1541
|
+
(0, import_type_graphql18.InputType)()
|
|
1542
|
+
], CopilotContextInput);
|
|
1543
|
+
|
|
1544
|
+
// src/graphql/inputs/generate-copilot-response.input.ts
|
|
1545
|
+
function _ts_decorate18(decorators, target, key, desc) {
|
|
1546
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
1547
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function")
|
|
1548
|
+
r = Reflect.decorate(decorators, target, key, desc);
|
|
1549
|
+
else
|
|
1550
|
+
for (var i = decorators.length - 1; i >= 0; i--)
|
|
1551
|
+
if (d = decorators[i])
|
|
1552
|
+
r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
1553
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
1554
|
+
}
|
|
1555
|
+
__name(_ts_decorate18, "_ts_decorate");
|
|
1556
|
+
function _ts_metadata18(k, v) {
|
|
1557
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function")
|
|
1558
|
+
return Reflect.metadata(k, v);
|
|
1559
|
+
}
|
|
1560
|
+
__name(_ts_metadata18, "_ts_metadata");
|
|
1561
|
+
var GenerateCopilotResponseMetadataInput = class {
|
|
1562
|
+
requestType;
|
|
1563
|
+
};
|
|
1564
|
+
__name(GenerateCopilotResponseMetadataInput, "GenerateCopilotResponseMetadataInput");
|
|
1565
|
+
_ts_decorate18([
|
|
1566
|
+
(0, import_type_graphql19.Field)(() => CopilotRequestType, {
|
|
1567
|
+
nullable: true
|
|
1568
|
+
}),
|
|
1569
|
+
_ts_metadata18("design:type", typeof CopilotRequestType === "undefined" ? Object : CopilotRequestType)
|
|
1570
|
+
], GenerateCopilotResponseMetadataInput.prototype, "requestType", void 0);
|
|
1571
|
+
GenerateCopilotResponseMetadataInput = _ts_decorate18([
|
|
1572
|
+
(0, import_type_graphql19.InputType)()
|
|
1573
|
+
], GenerateCopilotResponseMetadataInput);
|
|
1574
|
+
var GenerateCopilotResponseInput = class {
|
|
1575
|
+
metadata;
|
|
1576
|
+
threadId;
|
|
1577
|
+
runId;
|
|
1578
|
+
messages;
|
|
1579
|
+
frontend;
|
|
1580
|
+
cloud;
|
|
1581
|
+
forwardedParameters;
|
|
1582
|
+
agentSession;
|
|
1583
|
+
agentState;
|
|
1584
|
+
agentStates;
|
|
1585
|
+
extensions;
|
|
1586
|
+
metaEvents;
|
|
1587
|
+
context;
|
|
1588
|
+
};
|
|
1589
|
+
__name(GenerateCopilotResponseInput, "GenerateCopilotResponseInput");
|
|
1590
|
+
_ts_decorate18([
|
|
1591
|
+
(0, import_type_graphql19.Field)(() => GenerateCopilotResponseMetadataInput, {
|
|
1592
|
+
nullable: false
|
|
1593
|
+
}),
|
|
1594
|
+
_ts_metadata18("design:type", typeof GenerateCopilotResponseMetadataInput === "undefined" ? Object : GenerateCopilotResponseMetadataInput)
|
|
1595
|
+
], GenerateCopilotResponseInput.prototype, "metadata", void 0);
|
|
1596
|
+
_ts_decorate18([
|
|
1597
|
+
(0, import_type_graphql19.Field)(() => String, {
|
|
1598
|
+
nullable: true
|
|
1599
|
+
}),
|
|
1600
|
+
_ts_metadata18("design:type", String)
|
|
1601
|
+
], GenerateCopilotResponseInput.prototype, "threadId", void 0);
|
|
1602
|
+
_ts_decorate18([
|
|
1603
|
+
(0, import_type_graphql19.Field)(() => String, {
|
|
1604
|
+
nullable: true
|
|
1605
|
+
}),
|
|
1606
|
+
_ts_metadata18("design:type", String)
|
|
1607
|
+
], GenerateCopilotResponseInput.prototype, "runId", void 0);
|
|
1608
|
+
_ts_decorate18([
|
|
1609
|
+
(0, import_type_graphql19.Field)(() => [
|
|
1610
|
+
MessageInput
|
|
1611
|
+
]),
|
|
1612
|
+
_ts_metadata18("design:type", Array)
|
|
1613
|
+
], GenerateCopilotResponseInput.prototype, "messages", void 0);
|
|
1614
|
+
_ts_decorate18([
|
|
1615
|
+
(0, import_type_graphql19.Field)(() => FrontendInput),
|
|
1616
|
+
_ts_metadata18("design:type", typeof FrontendInput === "undefined" ? Object : FrontendInput)
|
|
1617
|
+
], GenerateCopilotResponseInput.prototype, "frontend", void 0);
|
|
1618
|
+
_ts_decorate18([
|
|
1619
|
+
(0, import_type_graphql19.Field)(() => CloudInput, {
|
|
1620
|
+
nullable: true
|
|
1621
|
+
}),
|
|
1622
|
+
_ts_metadata18("design:type", typeof CloudInput === "undefined" ? Object : CloudInput)
|
|
1623
|
+
], GenerateCopilotResponseInput.prototype, "cloud", void 0);
|
|
1624
|
+
_ts_decorate18([
|
|
1625
|
+
(0, import_type_graphql19.Field)(() => ForwardedParametersInput, {
|
|
1626
|
+
nullable: true
|
|
1627
|
+
}),
|
|
1628
|
+
_ts_metadata18("design:type", typeof ForwardedParametersInput === "undefined" ? Object : ForwardedParametersInput)
|
|
1629
|
+
], GenerateCopilotResponseInput.prototype, "forwardedParameters", void 0);
|
|
1630
|
+
_ts_decorate18([
|
|
1631
|
+
(0, import_type_graphql19.Field)(() => AgentSessionInput, {
|
|
1632
|
+
nullable: true
|
|
1633
|
+
}),
|
|
1634
|
+
_ts_metadata18("design:type", typeof AgentSessionInput === "undefined" ? Object : AgentSessionInput)
|
|
1635
|
+
], GenerateCopilotResponseInput.prototype, "agentSession", void 0);
|
|
1636
|
+
_ts_decorate18([
|
|
1637
|
+
(0, import_type_graphql19.Field)(() => AgentStateInput, {
|
|
1638
|
+
nullable: true
|
|
1639
|
+
}),
|
|
1640
|
+
_ts_metadata18("design:type", typeof AgentStateInput === "undefined" ? Object : AgentStateInput)
|
|
1641
|
+
], GenerateCopilotResponseInput.prototype, "agentState", void 0);
|
|
1642
|
+
_ts_decorate18([
|
|
1643
|
+
(0, import_type_graphql19.Field)(() => [
|
|
1644
|
+
AgentStateInput
|
|
1645
|
+
], {
|
|
1646
|
+
nullable: true
|
|
1647
|
+
}),
|
|
1648
|
+
_ts_metadata18("design:type", Array)
|
|
1649
|
+
], GenerateCopilotResponseInput.prototype, "agentStates", void 0);
|
|
1650
|
+
_ts_decorate18([
|
|
1651
|
+
(0, import_type_graphql19.Field)(() => ExtensionsInput, {
|
|
1652
|
+
nullable: true
|
|
1653
|
+
}),
|
|
1654
|
+
_ts_metadata18("design:type", typeof ExtensionsInput === "undefined" ? Object : ExtensionsInput)
|
|
1655
|
+
], GenerateCopilotResponseInput.prototype, "extensions", void 0);
|
|
1656
|
+
_ts_decorate18([
|
|
1657
|
+
(0, import_type_graphql19.Field)(() => [
|
|
1658
|
+
MetaEventInput
|
|
1659
|
+
], {
|
|
1660
|
+
nullable: true
|
|
1661
|
+
}),
|
|
1662
|
+
_ts_metadata18("design:type", Array)
|
|
1663
|
+
], GenerateCopilotResponseInput.prototype, "metaEvents", void 0);
|
|
1664
|
+
_ts_decorate18([
|
|
1665
|
+
(0, import_type_graphql19.Field)(() => [
|
|
1666
|
+
CopilotContextInput
|
|
1667
|
+
], {
|
|
1668
|
+
nullable: true
|
|
1669
|
+
}),
|
|
1670
|
+
_ts_metadata18("design:type", Array)
|
|
1671
|
+
], GenerateCopilotResponseInput.prototype, "context", void 0);
|
|
1672
|
+
GenerateCopilotResponseInput = _ts_decorate18([
|
|
1673
|
+
(0, import_type_graphql19.InputType)()
|
|
1674
|
+
], GenerateCopilotResponseInput);
|
|
1675
|
+
|
|
1676
|
+
// src/graphql/resolvers/copilot.resolver.ts
|
|
1677
|
+
var import_graphql_yoga = require("graphql-yoga");
|
|
1678
|
+
|
|
1679
|
+
// src/service-adapters/events.ts
|
|
1680
|
+
var import_shared5 = require("@copilotkit/shared");
|
|
1681
|
+
var import_class_transformer = require("class-transformer");
|
|
1682
|
+
var import_rxjs2 = require("rxjs");
|
|
1683
|
+
|
|
1684
|
+
// src/graphql/types/converted/index.ts
|
|
1685
|
+
var Message = class extends BaseMessageInput {
|
|
1686
|
+
type;
|
|
1687
|
+
isTextMessage() {
|
|
1688
|
+
return this.type === "TextMessage";
|
|
1689
|
+
}
|
|
1690
|
+
isActionExecutionMessage() {
|
|
1691
|
+
return this.type === "ActionExecutionMessage";
|
|
1692
|
+
}
|
|
1693
|
+
isResultMessage() {
|
|
1694
|
+
return this.type === "ResultMessage";
|
|
1695
|
+
}
|
|
1696
|
+
isAgentStateMessage() {
|
|
1697
|
+
return this.type === "AgentStateMessage";
|
|
1698
|
+
}
|
|
1699
|
+
isImageMessage() {
|
|
1700
|
+
return this.type === "ImageMessage";
|
|
1701
|
+
}
|
|
1702
|
+
};
|
|
1703
|
+
__name(Message, "Message");
|
|
1704
|
+
var TextMessage = class extends Message {
|
|
1705
|
+
type = "TextMessage";
|
|
1706
|
+
content;
|
|
1707
|
+
role;
|
|
1708
|
+
parentMessageId;
|
|
1709
|
+
};
|
|
1710
|
+
__name(TextMessage, "TextMessage");
|
|
1711
|
+
var ActionExecutionMessage = class extends Message {
|
|
1712
|
+
type = "ActionExecutionMessage";
|
|
1713
|
+
name;
|
|
1714
|
+
arguments;
|
|
1715
|
+
parentMessageId;
|
|
1716
|
+
};
|
|
1717
|
+
__name(ActionExecutionMessage, "ActionExecutionMessage");
|
|
1718
|
+
var ResultMessage = class extends Message {
|
|
1719
|
+
type = "ResultMessage";
|
|
1720
|
+
actionExecutionId;
|
|
1721
|
+
actionName;
|
|
1722
|
+
result;
|
|
1723
|
+
static encodeResult(result, error) {
|
|
1724
|
+
const errorObj = error ? typeof error === "string" ? {
|
|
1725
|
+
code: "ERROR",
|
|
1726
|
+
message: error
|
|
1727
|
+
} : error instanceof Error ? {
|
|
1728
|
+
code: "ERROR",
|
|
1729
|
+
message: error.message
|
|
1730
|
+
} : error : void 0;
|
|
1731
|
+
if (errorObj) {
|
|
1732
|
+
return JSON.stringify({
|
|
1733
|
+
error: errorObj,
|
|
1734
|
+
result: result || ""
|
|
1735
|
+
});
|
|
1736
|
+
}
|
|
1737
|
+
if (result === void 0) {
|
|
1738
|
+
return "";
|
|
1739
|
+
}
|
|
1740
|
+
return typeof result === "string" ? result : JSON.stringify(result);
|
|
1741
|
+
}
|
|
1742
|
+
static decodeResult(result) {
|
|
1743
|
+
if (!result) {
|
|
1744
|
+
return {
|
|
1745
|
+
result: ""
|
|
1746
|
+
};
|
|
1747
|
+
}
|
|
1748
|
+
try {
|
|
1749
|
+
const parsed = JSON.parse(result);
|
|
1750
|
+
if (parsed && typeof parsed === "object") {
|
|
1751
|
+
if ("error" in parsed) {
|
|
1752
|
+
return {
|
|
1753
|
+
error: parsed.error,
|
|
1754
|
+
result: parsed.result || ""
|
|
1755
|
+
};
|
|
1756
|
+
}
|
|
1757
|
+
return {
|
|
1758
|
+
result: JSON.stringify(parsed)
|
|
1759
|
+
};
|
|
1760
|
+
}
|
|
1761
|
+
return {
|
|
1762
|
+
result
|
|
1763
|
+
};
|
|
1764
|
+
} catch (e) {
|
|
1765
|
+
return {
|
|
1766
|
+
result
|
|
1767
|
+
};
|
|
1768
|
+
}
|
|
1769
|
+
}
|
|
1770
|
+
hasError() {
|
|
1771
|
+
try {
|
|
1772
|
+
const { error } = ResultMessage.decodeResult(this.result);
|
|
1773
|
+
return !!error;
|
|
1774
|
+
} catch {
|
|
1775
|
+
return false;
|
|
1776
|
+
}
|
|
1777
|
+
}
|
|
1778
|
+
getError() {
|
|
1779
|
+
try {
|
|
1780
|
+
const { error } = ResultMessage.decodeResult(this.result);
|
|
1781
|
+
return error;
|
|
1782
|
+
} catch {
|
|
1783
|
+
return void 0;
|
|
1784
|
+
}
|
|
1785
|
+
}
|
|
1786
|
+
};
|
|
1787
|
+
__name(ResultMessage, "ResultMessage");
|
|
1788
|
+
var AgentStateMessage = class extends Message {
|
|
1789
|
+
type = "AgentStateMessage";
|
|
1790
|
+
threadId;
|
|
1791
|
+
agentName;
|
|
1792
|
+
nodeName;
|
|
1793
|
+
runId;
|
|
1794
|
+
active;
|
|
1795
|
+
role;
|
|
1796
|
+
state;
|
|
1797
|
+
running;
|
|
1798
|
+
};
|
|
1799
|
+
__name(AgentStateMessage, "AgentStateMessage");
|
|
1800
|
+
|
|
1801
|
+
// src/lib/runtime/remote-actions.ts
|
|
1802
|
+
var import_shared3 = require("@copilotkit/shared");
|
|
1803
|
+
|
|
1804
|
+
// src/lib/telemetry-client.ts
|
|
1805
|
+
var import_shared2 = require("@copilotkit/shared");
|
|
1806
|
+
var import_node_crypto = require("crypto");
|
|
1807
|
+
|
|
1808
|
+
// src/lib/runtime/copilot-runtime.ts
|
|
1809
|
+
var import_shared = require("@copilotkit/shared");
|
|
1810
|
+
var import_rxjs = require("rxjs");
|
|
1811
|
+
var import_langgraph_sdk = require("@langchain/langgraph-sdk");
|
|
1812
|
+
|
|
1813
|
+
// src/agents/langgraph/events.ts
|
|
1814
|
+
var LangGraphEventTypes;
|
|
1815
|
+
(function(LangGraphEventTypes2) {
|
|
1816
|
+
LangGraphEventTypes2["OnChainStart"] = "on_chain_start";
|
|
1817
|
+
LangGraphEventTypes2["OnChainStream"] = "on_chain_stream";
|
|
1818
|
+
LangGraphEventTypes2["OnChainEnd"] = "on_chain_end";
|
|
1819
|
+
LangGraphEventTypes2["OnChatModelStart"] = "on_chat_model_start";
|
|
1820
|
+
LangGraphEventTypes2["OnChatModelStream"] = "on_chat_model_stream";
|
|
1821
|
+
LangGraphEventTypes2["OnChatModelEnd"] = "on_chat_model_end";
|
|
1822
|
+
LangGraphEventTypes2["OnToolStart"] = "on_tool_start";
|
|
1823
|
+
LangGraphEventTypes2["OnToolEnd"] = "on_tool_end";
|
|
1824
|
+
LangGraphEventTypes2["OnCopilotKitStateSync"] = "on_copilotkit_state_sync";
|
|
1825
|
+
LangGraphEventTypes2["OnCopilotKitEmitMessage"] = "on_copilotkit_emit_message";
|
|
1826
|
+
LangGraphEventTypes2["OnCopilotKitEmitToolCall"] = "on_copilotkit_emit_tool_call";
|
|
1827
|
+
LangGraphEventTypes2["OnCustomEvent"] = "on_custom_event";
|
|
1828
|
+
LangGraphEventTypes2["OnInterrupt"] = "on_interrupt";
|
|
1829
|
+
LangGraphEventTypes2["OnCopilotKitInterrupt"] = "on_copilotkit_interrupt";
|
|
1830
|
+
LangGraphEventTypes2["OnCopilotKitError"] = "on_copilotkit_error";
|
|
1831
|
+
})(LangGraphEventTypes || (LangGraphEventTypes = {}));
|
|
1832
|
+
var MetaEventNames;
|
|
1833
|
+
(function(MetaEventNames2) {
|
|
1834
|
+
MetaEventNames2["LangGraphInterruptEvent"] = "LangGraphInterruptEvent";
|
|
1835
|
+
MetaEventNames2["CopilotKitLangGraphInterruptEvent"] = "CopilotKitLangGraphInterruptEvent";
|
|
1836
|
+
})(MetaEventNames || (MetaEventNames = {}));
|
|
1837
|
+
var CustomEventNames;
|
|
1838
|
+
(function(CustomEventNames2) {
|
|
1839
|
+
CustomEventNames2["CopilotKitManuallyEmitMessage"] = "copilotkit_manually_emit_message";
|
|
1840
|
+
CustomEventNames2["CopilotKitManuallyEmitToolCall"] = "copilotkit_manually_emit_tool_call";
|
|
1841
|
+
CustomEventNames2["CopilotKitManuallyEmitIntermediateState"] = "copilotkit_manually_emit_intermediate_state";
|
|
1842
|
+
CustomEventNames2["CopilotKitExit"] = "copilotkit_exit";
|
|
1843
|
+
})(CustomEventNames || (CustomEventNames = {}));
|
|
1844
|
+
|
|
1845
|
+
// src/lib/runtime/copilot-runtime.ts
|
|
1846
|
+
function resolveEndpointType(endpoint) {
|
|
1847
|
+
if (!endpoint.type) {
|
|
1848
|
+
if ("deploymentUrl" in endpoint && "agents" in endpoint) {
|
|
1849
|
+
return EndpointType.LangGraphPlatform;
|
|
1850
|
+
} else {
|
|
1851
|
+
return EndpointType.CopilotKit;
|
|
1852
|
+
}
|
|
1853
|
+
}
|
|
1854
|
+
return endpoint.type;
|
|
1855
|
+
}
|
|
1856
|
+
__name(resolveEndpointType, "resolveEndpointType");
|
|
1857
|
+
|
|
1858
|
+
// src/lib/telemetry-client.ts
|
|
1859
|
+
var packageJson = require_package();
|
|
1860
|
+
var telemetryClient = new import_shared2.TelemetryClient({
|
|
1861
|
+
packageName: packageJson.name,
|
|
1862
|
+
packageVersion: packageJson.version
|
|
1863
|
+
});
|
|
1864
|
+
function getRuntimeInstanceTelemetryInfo(options) {
|
|
1865
|
+
var _a, _b;
|
|
1866
|
+
const runtime = options.runtime;
|
|
1867
|
+
const endpointsInfo = runtime.remoteEndpointDefinitions.reduce((acc, endpoint) => {
|
|
1868
|
+
let info = {
|
|
1869
|
+
...acc
|
|
1870
|
+
};
|
|
1871
|
+
const endpointType = resolveEndpointType(endpoint);
|
|
1872
|
+
if (!info.endpointTypes.includes(endpointType)) {
|
|
1873
|
+
info = {
|
|
1874
|
+
...info,
|
|
1875
|
+
endpointTypes: [
|
|
1876
|
+
...info.endpointTypes,
|
|
1877
|
+
endpointType
|
|
1878
|
+
]
|
|
1879
|
+
};
|
|
1880
|
+
}
|
|
1881
|
+
if (endpointType === EndpointType.LangGraphPlatform) {
|
|
1882
|
+
const ep = endpoint;
|
|
1883
|
+
info = {
|
|
1884
|
+
...info,
|
|
1885
|
+
agentsAmount: ep.agents.length,
|
|
1886
|
+
hashedKey: ep.langsmithApiKey ? (0, import_node_crypto.createHash)("sha256").update(ep.langsmithApiKey).digest("hex") : null
|
|
1887
|
+
};
|
|
1888
|
+
}
|
|
1889
|
+
return info;
|
|
1890
|
+
}, {
|
|
1891
|
+
endpointTypes: [],
|
|
1892
|
+
agentsAmount: null,
|
|
1893
|
+
hashedKey: null
|
|
1894
|
+
});
|
|
1895
|
+
const publicApiKey = (_a = options.cloud) == null ? void 0 : _a.publicApiKey;
|
|
1896
|
+
const apiKeyProvided = !!publicApiKey && publicApiKey.trim().length > 0;
|
|
1897
|
+
return {
|
|
1898
|
+
actionsAmount: runtime.actions.length,
|
|
1899
|
+
endpointsAmount: runtime.remoteEndpointDefinitions.length,
|
|
1900
|
+
endpointTypes: endpointsInfo.endpointTypes,
|
|
1901
|
+
agentsAmount: endpointsInfo.agentsAmount,
|
|
1902
|
+
hashedLgcKey: endpointsInfo.hashedKey,
|
|
1903
|
+
"cloud.api_key_provided": apiKeyProvided,
|
|
1904
|
+
...apiKeyProvided ? {
|
|
1905
|
+
"cloud.public_api_key": publicApiKey
|
|
1906
|
+
} : {},
|
|
1907
|
+
...((_b = options.cloud) == null ? void 0 : _b.baseUrl) ? {
|
|
1908
|
+
"cloud.base_url": options.cloud.baseUrl
|
|
1909
|
+
} : {}
|
|
1910
|
+
};
|
|
1911
|
+
}
|
|
1912
|
+
__name(getRuntimeInstanceTelemetryInfo, "getRuntimeInstanceTelemetryInfo");
|
|
1913
|
+
var telemetry_client_default = telemetryClient;
|
|
1914
|
+
|
|
1915
|
+
// src/lib/runtime/remote-actions.ts
|
|
1916
|
+
var import_shared4 = require("@copilotkit/shared");
|
|
1917
|
+
var EndpointType;
|
|
1918
|
+
(function(EndpointType2) {
|
|
1919
|
+
EndpointType2["CopilotKit"] = "copilotKit";
|
|
1920
|
+
EndpointType2["LangGraphPlatform"] = "langgraph-platform";
|
|
1921
|
+
})(EndpointType || (EndpointType = {}));
|
|
1922
|
+
|
|
1923
|
+
// src/service-adapters/events.ts
|
|
1924
|
+
var RuntimeEventTypes;
|
|
1925
|
+
(function(RuntimeEventTypes2) {
|
|
1926
|
+
RuntimeEventTypes2["TextMessageStart"] = "TextMessageStart";
|
|
1927
|
+
RuntimeEventTypes2["TextMessageContent"] = "TextMessageContent";
|
|
1928
|
+
RuntimeEventTypes2["TextMessageEnd"] = "TextMessageEnd";
|
|
1929
|
+
RuntimeEventTypes2["ActionExecutionStart"] = "ActionExecutionStart";
|
|
1930
|
+
RuntimeEventTypes2["ActionExecutionArgs"] = "ActionExecutionArgs";
|
|
1931
|
+
RuntimeEventTypes2["ActionExecutionEnd"] = "ActionExecutionEnd";
|
|
1932
|
+
RuntimeEventTypes2["ActionExecutionResult"] = "ActionExecutionResult";
|
|
1933
|
+
RuntimeEventTypes2["AgentStateMessage"] = "AgentStateMessage";
|
|
1934
|
+
RuntimeEventTypes2["MetaEvent"] = "MetaEvent";
|
|
1935
|
+
RuntimeEventTypes2["RunError"] = "RunError";
|
|
1936
|
+
})(RuntimeEventTypes || (RuntimeEventTypes = {}));
|
|
1937
|
+
var RuntimeMetaEventName;
|
|
1938
|
+
(function(RuntimeMetaEventName2) {
|
|
1939
|
+
RuntimeMetaEventName2["LangGraphInterruptEvent"] = "LangGraphInterruptEvent";
|
|
1940
|
+
RuntimeMetaEventName2["LangGraphInterruptResumeEvent"] = "LangGraphInterruptResumeEvent";
|
|
1941
|
+
RuntimeMetaEventName2["CopilotKitLangGraphInterruptEvent"] = "CopilotKitLangGraphInterruptEvent";
|
|
1942
|
+
})(RuntimeMetaEventName || (RuntimeMetaEventName = {}));
|
|
1943
|
+
|
|
1944
|
+
// src/graphql/resolvers/copilot.resolver.ts
|
|
1945
|
+
var import_graphql_scalars2 = require("graphql-scalars");
|
|
1946
|
+
var import_class_transformer2 = require("class-transformer");
|
|
1947
|
+
var import_graphql = require("graphql");
|
|
1948
|
+
|
|
1949
|
+
// src/utils/failed-response-status-reasons.ts
|
|
1950
|
+
var GuardrailsValidationFailureResponse = class extends FailedResponseStatus {
|
|
1951
|
+
reason = FailedResponseStatusReason.GUARDRAILS_VALIDATION_FAILED;
|
|
1952
|
+
constructor({ guardrailsReason }) {
|
|
1953
|
+
super();
|
|
1954
|
+
this.details = {
|
|
1955
|
+
guardrailsReason
|
|
1956
|
+
};
|
|
1957
|
+
}
|
|
1958
|
+
};
|
|
1959
|
+
__name(GuardrailsValidationFailureResponse, "GuardrailsValidationFailureResponse");
|
|
1960
|
+
var MessageStreamInterruptedResponse = class extends FailedResponseStatus {
|
|
1961
|
+
reason = FailedResponseStatusReason.MESSAGE_STREAM_INTERRUPTED;
|
|
1962
|
+
constructor({ messageId }) {
|
|
1963
|
+
super();
|
|
1964
|
+
this.details = {
|
|
1965
|
+
messageId,
|
|
1966
|
+
description: "Check the message for mode details"
|
|
1967
|
+
};
|
|
1968
|
+
}
|
|
1969
|
+
};
|
|
1970
|
+
__name(MessageStreamInterruptedResponse, "MessageStreamInterruptedResponse");
|
|
1971
|
+
var UnknownErrorResponse = class extends FailedResponseStatus {
|
|
1972
|
+
reason = FailedResponseStatusReason.UNKNOWN_ERROR;
|
|
1973
|
+
constructor({ description, originalError }) {
|
|
1974
|
+
super();
|
|
1975
|
+
this.details = {
|
|
1976
|
+
description,
|
|
1977
|
+
originalError
|
|
1978
|
+
};
|
|
1979
|
+
}
|
|
1980
|
+
};
|
|
1981
|
+
__name(UnknownErrorResponse, "UnknownErrorResponse");
|
|
1982
|
+
|
|
1983
|
+
// src/graphql/resolvers/copilot.resolver.ts
|
|
1984
|
+
var import_shared6 = require("@copilotkit/shared");
|
|
1985
|
+
|
|
1986
|
+
// src/graphql/types/agents-response.type.ts
|
|
1987
|
+
var import_type_graphql20 = require("type-graphql");
|
|
1988
|
+
function _ts_decorate19(decorators, target, key, desc) {
|
|
1989
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
1990
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function")
|
|
1991
|
+
r = Reflect.decorate(decorators, target, key, desc);
|
|
1992
|
+
else
|
|
1993
|
+
for (var i = decorators.length - 1; i >= 0; i--)
|
|
1994
|
+
if (d = decorators[i])
|
|
1995
|
+
r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
1996
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
1997
|
+
}
|
|
1998
|
+
__name(_ts_decorate19, "_ts_decorate");
|
|
1999
|
+
function _ts_metadata19(k, v) {
|
|
2000
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function")
|
|
2001
|
+
return Reflect.metadata(k, v);
|
|
2002
|
+
}
|
|
2003
|
+
__name(_ts_metadata19, "_ts_metadata");
|
|
2004
|
+
var Agent = class {
|
|
2005
|
+
id;
|
|
2006
|
+
name;
|
|
2007
|
+
description;
|
|
2008
|
+
};
|
|
2009
|
+
__name(Agent, "Agent");
|
|
2010
|
+
_ts_decorate19([
|
|
2011
|
+
(0, import_type_graphql20.Field)(() => String),
|
|
2012
|
+
_ts_metadata19("design:type", String)
|
|
2013
|
+
], Agent.prototype, "id", void 0);
|
|
2014
|
+
_ts_decorate19([
|
|
2015
|
+
(0, import_type_graphql20.Field)(() => String),
|
|
2016
|
+
_ts_metadata19("design:type", String)
|
|
2017
|
+
], Agent.prototype, "name", void 0);
|
|
2018
|
+
_ts_decorate19([
|
|
2019
|
+
(0, import_type_graphql20.Field)(() => String),
|
|
2020
|
+
_ts_metadata19("design:type", String)
|
|
2021
|
+
], Agent.prototype, "description", void 0);
|
|
2022
|
+
Agent = _ts_decorate19([
|
|
2023
|
+
(0, import_type_graphql20.ObjectType)()
|
|
2024
|
+
], Agent);
|
|
2025
|
+
var AgentsResponse = class {
|
|
2026
|
+
agents;
|
|
2027
|
+
};
|
|
2028
|
+
__name(AgentsResponse, "AgentsResponse");
|
|
2029
|
+
_ts_decorate19([
|
|
2030
|
+
(0, import_type_graphql20.Field)(() => [
|
|
2031
|
+
Agent
|
|
2032
|
+
]),
|
|
2033
|
+
_ts_metadata19("design:type", Array)
|
|
2034
|
+
], AgentsResponse.prototype, "agents", void 0);
|
|
2035
|
+
AgentsResponse = _ts_decorate19([
|
|
2036
|
+
(0, import_type_graphql20.ObjectType)()
|
|
2037
|
+
], AgentsResponse);
|
|
2038
|
+
|
|
2039
|
+
// src/graphql/resolvers/copilot.resolver.ts
|
|
2040
|
+
var import_shared7 = require("@copilotkit/shared");
|
|
2041
|
+
function _ts_decorate20(decorators, target, key, desc) {
|
|
2042
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
2043
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function")
|
|
2044
|
+
r = Reflect.decorate(decorators, target, key, desc);
|
|
2045
|
+
else
|
|
2046
|
+
for (var i = decorators.length - 1; i >= 0; i--)
|
|
2047
|
+
if (d = decorators[i])
|
|
2048
|
+
r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
2049
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
2050
|
+
}
|
|
2051
|
+
__name(_ts_decorate20, "_ts_decorate");
|
|
2052
|
+
function _ts_metadata20(k, v) {
|
|
2053
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function")
|
|
2054
|
+
return Reflect.metadata(k, v);
|
|
2055
|
+
}
|
|
2056
|
+
__name(_ts_metadata20, "_ts_metadata");
|
|
2057
|
+
function _ts_param(paramIndex, decorator) {
|
|
2058
|
+
return function(target, key) {
|
|
2059
|
+
decorator(target, key, paramIndex);
|
|
2060
|
+
};
|
|
2061
|
+
}
|
|
2062
|
+
__name(_ts_param, "_ts_param");
|
|
2063
|
+
var invokeGuardrails = /* @__PURE__ */ __name(async ({ baseUrl, copilotCloudPublicApiKey, data, onResult, onError }) => {
|
|
2064
|
+
var _a;
|
|
2065
|
+
if (data.messages.length && ((_a = data.messages[data.messages.length - 1].textMessage) == null ? void 0 : _a.role) === MessageRole.user) {
|
|
2066
|
+
const messages = data.messages.filter((m) => m.textMessage !== void 0 && (m.textMessage.role === MessageRole.user || m.textMessage.role === MessageRole.assistant)).map((m) => ({
|
|
2067
|
+
role: m.textMessage.role,
|
|
2068
|
+
content: m.textMessage.content
|
|
2069
|
+
}));
|
|
2070
|
+
const lastMessage = messages[messages.length - 1];
|
|
2071
|
+
const restOfMessages = messages.slice(0, -1);
|
|
2072
|
+
const body = {
|
|
2073
|
+
input: lastMessage.content,
|
|
2074
|
+
validTopics: data.cloud.guardrails.inputValidationRules.allowList,
|
|
2075
|
+
invalidTopics: data.cloud.guardrails.inputValidationRules.denyList,
|
|
2076
|
+
messages: restOfMessages
|
|
2077
|
+
};
|
|
2078
|
+
const guardrailsResult = await fetch(`${baseUrl}/guardrails/validate`, {
|
|
2079
|
+
method: "POST",
|
|
2080
|
+
headers: {
|
|
2081
|
+
"Content-Type": "application/json",
|
|
2082
|
+
"X-CopilotCloud-Public-API-Key": copilotCloudPublicApiKey
|
|
2083
|
+
},
|
|
2084
|
+
body: JSON.stringify(body)
|
|
2085
|
+
});
|
|
2086
|
+
if (guardrailsResult.ok) {
|
|
2087
|
+
const resultJson = await guardrailsResult.json();
|
|
2088
|
+
onResult(resultJson);
|
|
2089
|
+
} else {
|
|
2090
|
+
onError(await guardrailsResult.json());
|
|
2091
|
+
}
|
|
2092
|
+
}
|
|
2093
|
+
}, "invokeGuardrails");
|
|
2094
|
+
var CopilotResolver = class {
|
|
2095
|
+
async hello() {
|
|
2096
|
+
return "Hello World";
|
|
2097
|
+
}
|
|
2098
|
+
async availableAgents(ctx) {
|
|
2099
|
+
let logger2 = ctx.logger.child({
|
|
2100
|
+
component: "CopilotResolver.availableAgents"
|
|
2101
|
+
});
|
|
2102
|
+
logger2.debug("Processing");
|
|
2103
|
+
const agentsWithEndpoints = await ctx._copilotkit.runtime.discoverAgentsFromEndpoints(ctx);
|
|
2104
|
+
logger2.debug("Event source created, creating response");
|
|
2105
|
+
return {
|
|
2106
|
+
agents: agentsWithEndpoints.map(({ endpoint, ...agentWithoutEndpoint }) => agentWithoutEndpoint)
|
|
2107
|
+
};
|
|
2108
|
+
}
|
|
2109
|
+
async generateCopilotResponse(ctx, data, properties) {
|
|
2110
|
+
var _a, _b, _c, _d, _e, _f, _g;
|
|
2111
|
+
telemetry_client_default.capture("oss.runtime.copilot_request_created", {
|
|
2112
|
+
"cloud.guardrails.enabled": ((_a = data.cloud) == null ? void 0 : _a.guardrails) !== void 0,
|
|
2113
|
+
requestType: data.metadata.requestType,
|
|
2114
|
+
"cloud.api_key_provided": !!ctx.request.headers.get("x-copilotcloud-public-api-key"),
|
|
2115
|
+
...ctx.request.headers.get("x-copilotcloud-public-api-key") ? {
|
|
2116
|
+
"cloud.public_api_key": ctx.request.headers.get("x-copilotcloud-public-api-key")
|
|
2117
|
+
} : {},
|
|
2118
|
+
...ctx._copilotkit.baseUrl ? {
|
|
2119
|
+
"cloud.base_url": ctx._copilotkit.baseUrl
|
|
2120
|
+
} : {
|
|
2121
|
+
"cloud.base_url": "https://api.cloud.copilotkit.ai"
|
|
2122
|
+
}
|
|
2123
|
+
});
|
|
2124
|
+
let logger2 = ctx.logger.child({
|
|
2125
|
+
component: "CopilotResolver.generateCopilotResponse"
|
|
2126
|
+
});
|
|
2127
|
+
logger2.debug({
|
|
2128
|
+
data
|
|
2129
|
+
}, "Generating Copilot response");
|
|
2130
|
+
if (properties) {
|
|
2131
|
+
logger2.debug("Properties provided, merging with context properties");
|
|
2132
|
+
ctx.properties = {
|
|
2133
|
+
...ctx.properties,
|
|
2134
|
+
...properties
|
|
2135
|
+
};
|
|
2136
|
+
}
|
|
2137
|
+
const copilotRuntime = ctx._copilotkit.runtime;
|
|
2138
|
+
const serviceAdapter = ctx._copilotkit.serviceAdapter;
|
|
2139
|
+
let copilotCloudPublicApiKey = null;
|
|
2140
|
+
let copilotCloudBaseUrl;
|
|
2141
|
+
const publicApiKeyFromHeaders = ctx.request.headers.get("x-copilotcloud-public-api-key");
|
|
2142
|
+
if (publicApiKeyFromHeaders) {
|
|
2143
|
+
copilotCloudPublicApiKey = publicApiKeyFromHeaders;
|
|
2144
|
+
}
|
|
2145
|
+
if (data.cloud) {
|
|
2146
|
+
logger2 = logger2.child({
|
|
2147
|
+
cloud: true
|
|
2148
|
+
});
|
|
2149
|
+
logger2.debug("Cloud configuration provided, checking for public API key in headers");
|
|
2150
|
+
if (!copilotCloudPublicApiKey) {
|
|
2151
|
+
logger2.error("Public API key not found in headers");
|
|
2152
|
+
await copilotRuntime.errorGraphQLError({
|
|
2153
|
+
message: "X-CopilotCloud-Public-API-Key header is required",
|
|
2154
|
+
code: "MISSING_PUBLIC_API_KEY",
|
|
2155
|
+
type: "GraphQLError"
|
|
2156
|
+
}, {
|
|
2157
|
+
operation: "generateCopilotResponse",
|
|
2158
|
+
cloudConfigPresent: Boolean(data.cloud),
|
|
2159
|
+
guardrailsEnabled: Boolean((_b = data.cloud) == null ? void 0 : _b.guardrails)
|
|
2160
|
+
});
|
|
2161
|
+
throw new import_graphql.GraphQLError("X-CopilotCloud-Public-API-Key header is required");
|
|
2162
|
+
}
|
|
2163
|
+
if (process.env.COPILOT_CLOUD_BASE_URL) {
|
|
2164
|
+
copilotCloudBaseUrl = process.env.COPILOT_CLOUD_BASE_URL;
|
|
2165
|
+
} else if ((_c = ctx._copilotkit.cloud) == null ? void 0 : _c.baseUrl) {
|
|
2166
|
+
copilotCloudBaseUrl = (_d = ctx._copilotkit.cloud) == null ? void 0 : _d.baseUrl;
|
|
2167
|
+
} else {
|
|
2168
|
+
copilotCloudBaseUrl = "https://api.cloud.copilotkit.ai";
|
|
2169
|
+
}
|
|
2170
|
+
logger2 = logger2.child({
|
|
2171
|
+
copilotCloudBaseUrl
|
|
2172
|
+
});
|
|
2173
|
+
}
|
|
2174
|
+
logger2.debug("Setting up subjects");
|
|
2175
|
+
const responseStatus$ = new import_rxjs3.ReplaySubject();
|
|
2176
|
+
const interruptStreaming$ = new import_rxjs3.ReplaySubject();
|
|
2177
|
+
const guardrailsResult$ = new import_rxjs3.ReplaySubject();
|
|
2178
|
+
let outputMessages = [];
|
|
2179
|
+
let resolveOutputMessagesPromise;
|
|
2180
|
+
let rejectOutputMessagesPromise;
|
|
2181
|
+
const outputMessagesPromise = new Promise((resolve, reject) => {
|
|
2182
|
+
resolveOutputMessagesPromise = resolve;
|
|
2183
|
+
rejectOutputMessagesPromise = reject;
|
|
2184
|
+
});
|
|
2185
|
+
if (copilotCloudPublicApiKey) {
|
|
2186
|
+
ctx.properties["copilotCloudPublicApiKey"] = copilotCloudPublicApiKey;
|
|
2187
|
+
}
|
|
2188
|
+
logger2.debug("Processing");
|
|
2189
|
+
let runtimeResponse;
|
|
2190
|
+
try {
|
|
2191
|
+
runtimeResponse = await copilotRuntime.processRuntimeRequest({
|
|
2192
|
+
serviceAdapter,
|
|
2193
|
+
messages: data.messages,
|
|
2194
|
+
actions: data.frontend.actions.filter((action) => action.available !== ActionInputAvailability.disabled),
|
|
2195
|
+
threadId: data.threadId,
|
|
2196
|
+
runId: data.runId,
|
|
2197
|
+
publicApiKey: copilotCloudPublicApiKey,
|
|
2198
|
+
outputMessagesPromise,
|
|
2199
|
+
graphqlContext: ctx,
|
|
2200
|
+
forwardedParameters: data.forwardedParameters,
|
|
2201
|
+
agentSession: data.agentSession,
|
|
2202
|
+
agentStates: data.agentStates,
|
|
2203
|
+
url: data.frontend.url,
|
|
2204
|
+
extensions: data.extensions,
|
|
2205
|
+
metaEvents: data.metaEvents,
|
|
2206
|
+
context: data.context
|
|
2207
|
+
});
|
|
2208
|
+
} catch (error) {
|
|
2209
|
+
if ((0, import_shared7.isStructuredCopilotKitError)(error) || ((_e = error == null ? void 0 : error.extensions) == null ? void 0 : _e.visibility)) {
|
|
2210
|
+
throw new import_graphql.GraphQLError(error.message || "Agent error occurred", {
|
|
2211
|
+
extensions: {
|
|
2212
|
+
...error.extensions,
|
|
2213
|
+
code: error.code || ((_f = error.extensions) == null ? void 0 : _f.code) || "AGENT_ERROR",
|
|
2214
|
+
originalError: error
|
|
2215
|
+
}
|
|
2216
|
+
});
|
|
2217
|
+
}
|
|
2218
|
+
throw error;
|
|
2219
|
+
}
|
|
2220
|
+
const { eventSource, threadId = (0, import_shared6.randomId)(), runId, serverSideActions, actionInputsWithoutAgents, extensions } = runtimeResponse;
|
|
2221
|
+
logger2.debug("Event source created, creating response");
|
|
2222
|
+
const eventStream = eventSource.processRuntimeEvents({
|
|
2223
|
+
serverSideActions,
|
|
2224
|
+
guardrailsResult$: ((_g = data.cloud) == null ? void 0 : _g.guardrails) ? guardrailsResult$ : null,
|
|
2225
|
+
actionInputsWithoutAgents: actionInputsWithoutAgents.filter(
|
|
2226
|
+
// TODO-AGENTS: do not exclude ALL server side actions
|
|
2227
|
+
(action) => !serverSideActions.find((serverSideAction) => serverSideAction.name == action.name)
|
|
2228
|
+
),
|
|
2229
|
+
threadId
|
|
2230
|
+
}).pipe(
|
|
2231
|
+
// shareReplay() ensures that later subscribers will see the whole stream instead of
|
|
2232
|
+
// just the events that were emitted after the subscriber was added.
|
|
2233
|
+
(0, import_rxjs3.shareReplay)(),
|
|
2234
|
+
(0, import_rxjs3.finalize)(() => {
|
|
2235
|
+
logger2.debug("Event stream finalized");
|
|
2236
|
+
})
|
|
2237
|
+
);
|
|
2238
|
+
const response = {
|
|
2239
|
+
threadId,
|
|
2240
|
+
runId,
|
|
2241
|
+
status: (0, import_rxjs3.firstValueFrom)(responseStatus$),
|
|
2242
|
+
extensions,
|
|
2243
|
+
metaEvents: new import_graphql_yoga.Repeater(async (push, stop) => {
|
|
2244
|
+
let eventStreamSubscription;
|
|
2245
|
+
eventStreamSubscription = eventStream.subscribe({
|
|
2246
|
+
next: async (event) => {
|
|
2247
|
+
if (event.type != RuntimeEventTypes.MetaEvent) {
|
|
2248
|
+
return;
|
|
2249
|
+
}
|
|
2250
|
+
switch (event.name) {
|
|
2251
|
+
case LangGraphEventTypes.OnInterrupt:
|
|
2252
|
+
push((0, import_class_transformer2.plainToInstance)(LangGraphInterruptEvent, {
|
|
2253
|
+
// @ts-ignore
|
|
2254
|
+
type: event.type,
|
|
2255
|
+
// @ts-ignore
|
|
2256
|
+
name: RuntimeMetaEventName.LangGraphInterruptEvent,
|
|
2257
|
+
// @ts-ignore
|
|
2258
|
+
value: event.value
|
|
2259
|
+
}));
|
|
2260
|
+
break;
|
|
2261
|
+
case RuntimeMetaEventName.LangGraphInterruptEvent:
|
|
2262
|
+
push((0, import_class_transformer2.plainToInstance)(LangGraphInterruptEvent, {
|
|
2263
|
+
type: event.type,
|
|
2264
|
+
name: event.name,
|
|
2265
|
+
value: event.value
|
|
2266
|
+
}));
|
|
2267
|
+
break;
|
|
2268
|
+
case RuntimeMetaEventName.CopilotKitLangGraphInterruptEvent:
|
|
2269
|
+
push((0, import_class_transformer2.plainToInstance)(CopilotKitLangGraphInterruptEvent, {
|
|
2270
|
+
type: event.type,
|
|
2271
|
+
name: event.name,
|
|
2272
|
+
data: {
|
|
2273
|
+
value: event.data.value,
|
|
2274
|
+
messages: event.data.messages.map((message) => {
|
|
2275
|
+
if (message.type === "TextMessage" || "content" in message && "role" in message) {
|
|
2276
|
+
return (0, import_class_transformer2.plainToInstance)(TextMessage, {
|
|
2277
|
+
id: message.id,
|
|
2278
|
+
createdAt: /* @__PURE__ */ new Date(),
|
|
2279
|
+
content: [
|
|
2280
|
+
message.content
|
|
2281
|
+
],
|
|
2282
|
+
role: message.role,
|
|
2283
|
+
status: new SuccessMessageStatus()
|
|
2284
|
+
});
|
|
2285
|
+
}
|
|
2286
|
+
if ("arguments" in message) {
|
|
2287
|
+
return (0, import_class_transformer2.plainToInstance)(ActionExecutionMessage, {
|
|
2288
|
+
name: message.name,
|
|
2289
|
+
id: message.id,
|
|
2290
|
+
arguments: [
|
|
2291
|
+
JSON.stringify(message.arguments)
|
|
2292
|
+
],
|
|
2293
|
+
createdAt: /* @__PURE__ */ new Date(),
|
|
2294
|
+
status: new SuccessMessageStatus()
|
|
2295
|
+
});
|
|
2296
|
+
}
|
|
2297
|
+
throw new Error("Unknown message in metaEvents copilot resolver");
|
|
2298
|
+
})
|
|
2299
|
+
}
|
|
2300
|
+
}));
|
|
2301
|
+
break;
|
|
2302
|
+
}
|
|
2303
|
+
},
|
|
2304
|
+
error: (err) => {
|
|
2305
|
+
var _a2, _b2;
|
|
2306
|
+
if (((_a2 = err == null ? void 0 : err.name) == null ? void 0 : _a2.includes("CopilotKit")) || ((_b2 = err == null ? void 0 : err.extensions) == null ? void 0 : _b2.visibility)) {
|
|
2307
|
+
responseStatus$.next(new UnknownErrorResponse({
|
|
2308
|
+
description: err.message || "Agent error occurred"
|
|
2309
|
+
}));
|
|
2310
|
+
} else {
|
|
2311
|
+
responseStatus$.next(new UnknownErrorResponse({
|
|
2312
|
+
description: `An unknown error has occurred in the event stream`
|
|
2313
|
+
}));
|
|
2314
|
+
}
|
|
2315
|
+
eventStreamSubscription == null ? void 0 : eventStreamSubscription.unsubscribe();
|
|
2316
|
+
stop();
|
|
2317
|
+
},
|
|
2318
|
+
complete: async () => {
|
|
2319
|
+
logger2.debug("Meta events stream completed");
|
|
2320
|
+
responseStatus$.next(new SuccessResponseStatus());
|
|
2321
|
+
eventStreamSubscription == null ? void 0 : eventStreamSubscription.unsubscribe();
|
|
2322
|
+
stop();
|
|
2323
|
+
}
|
|
2324
|
+
});
|
|
2325
|
+
}),
|
|
2326
|
+
messages: new import_graphql_yoga.Repeater(async (pushMessage, stopStreamingMessages) => {
|
|
2327
|
+
var _a2;
|
|
2328
|
+
logger2.debug("Messages repeater created");
|
|
2329
|
+
if ((_a2 = data.cloud) == null ? void 0 : _a2.guardrails) {
|
|
2330
|
+
logger2 = logger2.child({
|
|
2331
|
+
guardrails: true
|
|
2332
|
+
});
|
|
2333
|
+
logger2.debug("Guardrails is enabled, validating input");
|
|
2334
|
+
invokeGuardrails({
|
|
2335
|
+
baseUrl: copilotCloudBaseUrl,
|
|
2336
|
+
copilotCloudPublicApiKey,
|
|
2337
|
+
data,
|
|
2338
|
+
onResult: (result) => {
|
|
2339
|
+
logger2.debug({
|
|
2340
|
+
status: result.status
|
|
2341
|
+
}, "Guardrails validation done");
|
|
2342
|
+
guardrailsResult$.next(result);
|
|
2343
|
+
if (result.status === "denied") {
|
|
2344
|
+
responseStatus$.next(new GuardrailsValidationFailureResponse({
|
|
2345
|
+
guardrailsReason: result.reason
|
|
2346
|
+
}));
|
|
2347
|
+
interruptStreaming$.next({
|
|
2348
|
+
reason: `Interrupted due to Guardrails validation failure. Reason: ${result.reason}`
|
|
2349
|
+
});
|
|
2350
|
+
outputMessages = [
|
|
2351
|
+
(0, import_class_transformer2.plainToInstance)(TextMessage, {
|
|
2352
|
+
id: (0, import_shared6.randomId)(),
|
|
2353
|
+
createdAt: /* @__PURE__ */ new Date(),
|
|
2354
|
+
content: result.reason,
|
|
2355
|
+
role: MessageRole.assistant
|
|
2356
|
+
})
|
|
2357
|
+
];
|
|
2358
|
+
resolveOutputMessagesPromise(outputMessages);
|
|
2359
|
+
}
|
|
2360
|
+
},
|
|
2361
|
+
onError: (err) => {
|
|
2362
|
+
logger2.error({
|
|
2363
|
+
err
|
|
2364
|
+
}, "Error in guardrails validation");
|
|
2365
|
+
responseStatus$.next(new UnknownErrorResponse({
|
|
2366
|
+
description: `An unknown error has occurred in the guardrails validation`
|
|
2367
|
+
}));
|
|
2368
|
+
interruptStreaming$.next({
|
|
2369
|
+
reason: `Interrupted due to unknown error in guardrails validation`
|
|
2370
|
+
});
|
|
2371
|
+
rejectOutputMessagesPromise(err);
|
|
2372
|
+
}
|
|
2373
|
+
});
|
|
2374
|
+
}
|
|
2375
|
+
let eventStreamSubscription;
|
|
2376
|
+
logger2.debug("Event stream created, subscribing to event stream");
|
|
2377
|
+
eventStreamSubscription = eventStream.subscribe({
|
|
2378
|
+
next: async (event) => {
|
|
2379
|
+
switch (event.type) {
|
|
2380
|
+
case RuntimeEventTypes.MetaEvent:
|
|
2381
|
+
break;
|
|
2382
|
+
case RuntimeEventTypes.TextMessageStart:
|
|
2383
|
+
const textMessageContentStream = eventStream.pipe(
|
|
2384
|
+
// skip until this message start event
|
|
2385
|
+
(0, import_rxjs3.skipWhile)((e) => e !== event),
|
|
2386
|
+
// take until the message end event
|
|
2387
|
+
(0, import_rxjs3.takeWhile)((e) => !(e.type === RuntimeEventTypes.TextMessageEnd && e.messageId == event.messageId)),
|
|
2388
|
+
// filter out any other message events or message ids
|
|
2389
|
+
(0, import_rxjs3.filter)((e) => e.type == RuntimeEventTypes.TextMessageContent && e.messageId == event.messageId)
|
|
2390
|
+
);
|
|
2391
|
+
const streamingTextStatus = new import_rxjs3.Subject();
|
|
2392
|
+
const messageId = event.messageId;
|
|
2393
|
+
pushMessage({
|
|
2394
|
+
id: messageId,
|
|
2395
|
+
parentMessageId: event.parentMessageId,
|
|
2396
|
+
status: (0, import_rxjs3.firstValueFrom)(streamingTextStatus),
|
|
2397
|
+
createdAt: /* @__PURE__ */ new Date(),
|
|
2398
|
+
role: MessageRole.assistant,
|
|
2399
|
+
content: new import_graphql_yoga.Repeater(async (pushTextChunk, stopStreamingText) => {
|
|
2400
|
+
logger2.debug("Text message content repeater created");
|
|
2401
|
+
const textChunks = [];
|
|
2402
|
+
let textSubscription;
|
|
2403
|
+
interruptStreaming$.pipe((0, import_rxjs3.shareReplay)(), (0, import_rxjs3.take)(1), (0, import_rxjs3.tap)(({ reason, messageId: messageId2 }) => {
|
|
2404
|
+
logger2.debug({
|
|
2405
|
+
reason,
|
|
2406
|
+
messageId: messageId2
|
|
2407
|
+
}, "Text streaming interrupted");
|
|
2408
|
+
streamingTextStatus.next((0, import_class_transformer2.plainToInstance)(FailedMessageStatus, {
|
|
2409
|
+
reason
|
|
2410
|
+
}));
|
|
2411
|
+
responseStatus$.next(new MessageStreamInterruptedResponse({
|
|
2412
|
+
messageId: messageId2
|
|
2413
|
+
}));
|
|
2414
|
+
stopStreamingText();
|
|
2415
|
+
textSubscription == null ? void 0 : textSubscription.unsubscribe();
|
|
2416
|
+
})).subscribe();
|
|
2417
|
+
logger2.debug("Subscribing to text message content stream");
|
|
2418
|
+
textSubscription = textMessageContentStream.subscribe({
|
|
2419
|
+
next: async (e) => {
|
|
2420
|
+
if (e.type == RuntimeEventTypes.TextMessageContent) {
|
|
2421
|
+
await pushTextChunk(e.content);
|
|
2422
|
+
textChunks.push(e.content);
|
|
2423
|
+
}
|
|
2424
|
+
},
|
|
2425
|
+
error: (err) => {
|
|
2426
|
+
logger2.error({
|
|
2427
|
+
err
|
|
2428
|
+
}, "Error in text message content stream");
|
|
2429
|
+
interruptStreaming$.next({
|
|
2430
|
+
reason: "Error streaming message content",
|
|
2431
|
+
messageId
|
|
2432
|
+
});
|
|
2433
|
+
stopStreamingText();
|
|
2434
|
+
textSubscription == null ? void 0 : textSubscription.unsubscribe();
|
|
2435
|
+
},
|
|
2436
|
+
complete: () => {
|
|
2437
|
+
logger2.debug("Text message content stream completed");
|
|
2438
|
+
streamingTextStatus.next(new SuccessMessageStatus());
|
|
2439
|
+
stopStreamingText();
|
|
2440
|
+
textSubscription == null ? void 0 : textSubscription.unsubscribe();
|
|
2441
|
+
outputMessages.push((0, import_class_transformer2.plainToInstance)(TextMessage, {
|
|
2442
|
+
id: messageId,
|
|
2443
|
+
createdAt: /* @__PURE__ */ new Date(),
|
|
2444
|
+
content: textChunks.join(""),
|
|
2445
|
+
role: MessageRole.assistant
|
|
2446
|
+
}));
|
|
2447
|
+
}
|
|
2448
|
+
});
|
|
2449
|
+
})
|
|
2450
|
+
});
|
|
2451
|
+
break;
|
|
2452
|
+
case RuntimeEventTypes.ActionExecutionStart:
|
|
2453
|
+
logger2.debug("Action execution start event received");
|
|
2454
|
+
const actionExecutionArgumentStream = eventStream.pipe(
|
|
2455
|
+
(0, import_rxjs3.skipWhile)((e) => e !== event),
|
|
2456
|
+
// take until the action execution end event
|
|
2457
|
+
(0, import_rxjs3.takeWhile)((e) => !(e.type === RuntimeEventTypes.ActionExecutionEnd && e.actionExecutionId == event.actionExecutionId)),
|
|
2458
|
+
// filter out any other action execution events or action execution ids
|
|
2459
|
+
(0, import_rxjs3.filter)((e) => e.type == RuntimeEventTypes.ActionExecutionArgs && e.actionExecutionId == event.actionExecutionId)
|
|
2460
|
+
);
|
|
2461
|
+
const streamingArgumentsStatus = new import_rxjs3.Subject();
|
|
2462
|
+
pushMessage({
|
|
2463
|
+
id: event.actionExecutionId,
|
|
2464
|
+
parentMessageId: event.parentMessageId,
|
|
2465
|
+
status: (0, import_rxjs3.firstValueFrom)(streamingArgumentsStatus),
|
|
2466
|
+
createdAt: /* @__PURE__ */ new Date(),
|
|
2467
|
+
name: event.actionName,
|
|
2468
|
+
arguments: new import_graphql_yoga.Repeater(async (pushArgumentsChunk, stopStreamingArguments) => {
|
|
2469
|
+
logger2.debug("Action execution argument stream created");
|
|
2470
|
+
const argumentChunks = [];
|
|
2471
|
+
let actionExecutionArgumentSubscription;
|
|
2472
|
+
actionExecutionArgumentSubscription = actionExecutionArgumentStream.subscribe({
|
|
2473
|
+
next: async (e) => {
|
|
2474
|
+
if (e.type == RuntimeEventTypes.ActionExecutionArgs) {
|
|
2475
|
+
await pushArgumentsChunk(e.args);
|
|
2476
|
+
argumentChunks.push(e.args);
|
|
2477
|
+
}
|
|
2478
|
+
},
|
|
2479
|
+
error: (err) => {
|
|
2480
|
+
logger2.error({
|
|
2481
|
+
err
|
|
2482
|
+
}, "Error in action execution argument stream");
|
|
2483
|
+
streamingArgumentsStatus.next((0, import_class_transformer2.plainToInstance)(FailedMessageStatus, {
|
|
2484
|
+
reason: "An unknown error has occurred in the action execution argument stream"
|
|
2485
|
+
}));
|
|
2486
|
+
stopStreamingArguments();
|
|
2487
|
+
actionExecutionArgumentSubscription == null ? void 0 : actionExecutionArgumentSubscription.unsubscribe();
|
|
2488
|
+
},
|
|
2489
|
+
complete: () => {
|
|
2490
|
+
logger2.debug("Action execution argument stream completed");
|
|
2491
|
+
streamingArgumentsStatus.next(new SuccessMessageStatus());
|
|
2492
|
+
stopStreamingArguments();
|
|
2493
|
+
actionExecutionArgumentSubscription == null ? void 0 : actionExecutionArgumentSubscription.unsubscribe();
|
|
2494
|
+
outputMessages.push((0, import_class_transformer2.plainToInstance)(ActionExecutionMessage, {
|
|
2495
|
+
id: event.actionExecutionId,
|
|
2496
|
+
createdAt: /* @__PURE__ */ new Date(),
|
|
2497
|
+
name: event.actionName,
|
|
2498
|
+
arguments: argumentChunks.join("")
|
|
2499
|
+
}));
|
|
2500
|
+
}
|
|
2501
|
+
});
|
|
2502
|
+
})
|
|
2503
|
+
});
|
|
2504
|
+
break;
|
|
2505
|
+
case RuntimeEventTypes.ActionExecutionResult:
|
|
2506
|
+
logger2.debug({
|
|
2507
|
+
result: event.result
|
|
2508
|
+
}, "Action execution result event received");
|
|
2509
|
+
pushMessage({
|
|
2510
|
+
id: "result-" + event.actionExecutionId,
|
|
2511
|
+
status: new SuccessMessageStatus(),
|
|
2512
|
+
createdAt: /* @__PURE__ */ new Date(),
|
|
2513
|
+
actionExecutionId: event.actionExecutionId,
|
|
2514
|
+
actionName: event.actionName,
|
|
2515
|
+
result: event.result
|
|
2516
|
+
});
|
|
2517
|
+
outputMessages.push((0, import_class_transformer2.plainToInstance)(ResultMessage, {
|
|
2518
|
+
id: "result-" + event.actionExecutionId,
|
|
2519
|
+
createdAt: /* @__PURE__ */ new Date(),
|
|
2520
|
+
actionExecutionId: event.actionExecutionId,
|
|
2521
|
+
actionName: event.actionName,
|
|
2522
|
+
result: event.result
|
|
2523
|
+
}));
|
|
2524
|
+
break;
|
|
2525
|
+
case RuntimeEventTypes.AgentStateMessage:
|
|
2526
|
+
logger2.debug({
|
|
2527
|
+
event
|
|
2528
|
+
}, "Agent message event received");
|
|
2529
|
+
pushMessage({
|
|
2530
|
+
id: (0, import_shared6.randomId)(),
|
|
2531
|
+
status: new SuccessMessageStatus(),
|
|
2532
|
+
threadId: event.threadId,
|
|
2533
|
+
agentName: event.agentName,
|
|
2534
|
+
nodeName: event.nodeName,
|
|
2535
|
+
runId: event.runId,
|
|
2536
|
+
active: event.active,
|
|
2537
|
+
state: event.state,
|
|
2538
|
+
running: event.running,
|
|
2539
|
+
role: MessageRole.assistant,
|
|
2540
|
+
createdAt: /* @__PURE__ */ new Date()
|
|
2541
|
+
});
|
|
2542
|
+
outputMessages.push((0, import_class_transformer2.plainToInstance)(AgentStateMessage, {
|
|
2543
|
+
id: (0, import_shared6.randomId)(),
|
|
2544
|
+
threadId: event.threadId,
|
|
2545
|
+
agentName: event.agentName,
|
|
2546
|
+
nodeName: event.nodeName,
|
|
2547
|
+
runId: event.runId,
|
|
2548
|
+
active: event.active,
|
|
2549
|
+
state: event.state,
|
|
2550
|
+
running: event.running,
|
|
2551
|
+
role: MessageRole.assistant,
|
|
2552
|
+
createdAt: /* @__PURE__ */ new Date()
|
|
2553
|
+
}));
|
|
2554
|
+
break;
|
|
2555
|
+
}
|
|
2556
|
+
},
|
|
2557
|
+
error: (err) => {
|
|
2558
|
+
var _a3, _b2, _c2, _d2, _e2, _f2;
|
|
2559
|
+
if (err instanceof import_shared7.CopilotKitError || err instanceof import_shared7.CopilotKitLowLevelError || err instanceof Error && err.name && err.name.includes("CopilotKit") || ((_a3 = err == null ? void 0 : err.extensions) == null ? void 0 : _a3.visibility)) {
|
|
2560
|
+
responseStatus$.next(new UnknownErrorResponse({
|
|
2561
|
+
description: err.message || "Agent error occurred",
|
|
2562
|
+
// Include original error information for frontend to extract
|
|
2563
|
+
originalError: {
|
|
2564
|
+
code: err.code || ((_b2 = err.extensions) == null ? void 0 : _b2.code),
|
|
2565
|
+
statusCode: err.statusCode || ((_c2 = err.extensions) == null ? void 0 : _c2.statusCode),
|
|
2566
|
+
severity: err.severity || ((_d2 = err.extensions) == null ? void 0 : _d2.severity),
|
|
2567
|
+
visibility: err.visibility || ((_e2 = err.extensions) == null ? void 0 : _e2.visibility),
|
|
2568
|
+
originalErrorType: err.originalErrorType || ((_f2 = err.extensions) == null ? void 0 : _f2.originalErrorType),
|
|
2569
|
+
extensions: err.extensions
|
|
2570
|
+
}
|
|
2571
|
+
}));
|
|
2572
|
+
eventStreamSubscription == null ? void 0 : eventStreamSubscription.unsubscribe();
|
|
2573
|
+
rejectOutputMessagesPromise(err);
|
|
2574
|
+
stopStreamingMessages();
|
|
2575
|
+
return;
|
|
2576
|
+
}
|
|
2577
|
+
responseStatus$.next(new UnknownErrorResponse({
|
|
2578
|
+
description: `An unknown error has occurred in the event stream`
|
|
2579
|
+
}));
|
|
2580
|
+
eventStreamSubscription == null ? void 0 : eventStreamSubscription.unsubscribe();
|
|
2581
|
+
stopStreamingMessages();
|
|
2582
|
+
rejectOutputMessagesPromise(err);
|
|
2583
|
+
},
|
|
2584
|
+
complete: async () => {
|
|
2585
|
+
var _a3;
|
|
2586
|
+
logger2.debug("Event stream completed");
|
|
2587
|
+
if ((_a3 = data.cloud) == null ? void 0 : _a3.guardrails) {
|
|
2588
|
+
logger2.debug("Guardrails is enabled, waiting for guardrails result");
|
|
2589
|
+
await (0, import_rxjs3.firstValueFrom)(guardrailsResult$);
|
|
2590
|
+
}
|
|
2591
|
+
responseStatus$.next(new SuccessResponseStatus());
|
|
2592
|
+
eventStreamSubscription == null ? void 0 : eventStreamSubscription.unsubscribe();
|
|
2593
|
+
stopStreamingMessages();
|
|
2594
|
+
resolveOutputMessagesPromise(outputMessages);
|
|
2595
|
+
}
|
|
2596
|
+
});
|
|
2597
|
+
})
|
|
2598
|
+
};
|
|
2599
|
+
return response;
|
|
2600
|
+
}
|
|
2601
|
+
};
|
|
2602
|
+
__name(CopilotResolver, "CopilotResolver");
|
|
2603
|
+
_ts_decorate20([
|
|
2604
|
+
(0, import_type_graphql21.Query)(() => String),
|
|
2605
|
+
_ts_metadata20("design:type", Function),
|
|
2606
|
+
_ts_metadata20("design:paramtypes", []),
|
|
2607
|
+
_ts_metadata20("design:returntype", Promise)
|
|
2608
|
+
], CopilotResolver.prototype, "hello", null);
|
|
2609
|
+
_ts_decorate20([
|
|
2610
|
+
(0, import_type_graphql21.Query)(() => AgentsResponse),
|
|
2611
|
+
_ts_param(0, (0, import_type_graphql21.Ctx)()),
|
|
2612
|
+
_ts_metadata20("design:type", Function),
|
|
2613
|
+
_ts_metadata20("design:paramtypes", [
|
|
2614
|
+
typeof GraphQLContext === "undefined" ? Object : GraphQLContext
|
|
2615
|
+
]),
|
|
2616
|
+
_ts_metadata20("design:returntype", Promise)
|
|
2617
|
+
], CopilotResolver.prototype, "availableAgents", null);
|
|
2618
|
+
_ts_decorate20([
|
|
2619
|
+
(0, import_type_graphql21.Mutation)(() => CopilotResponse),
|
|
2620
|
+
_ts_param(0, (0, import_type_graphql21.Ctx)()),
|
|
2621
|
+
_ts_param(1, (0, import_type_graphql21.Arg)("data")),
|
|
2622
|
+
_ts_param(2, (0, import_type_graphql21.Arg)("properties", () => import_graphql_scalars2.GraphQLJSONObject, {
|
|
2623
|
+
nullable: true
|
|
2624
|
+
})),
|
|
2625
|
+
_ts_metadata20("design:type", Function),
|
|
2626
|
+
_ts_metadata20("design:paramtypes", [
|
|
2627
|
+
typeof GraphQLContext === "undefined" ? Object : GraphQLContext,
|
|
2628
|
+
typeof GenerateCopilotResponseInput === "undefined" ? Object : GenerateCopilotResponseInput,
|
|
2629
|
+
typeof CopilotRequestContextProperties === "undefined" ? Object : CopilotRequestContextProperties
|
|
2630
|
+
]),
|
|
2631
|
+
_ts_metadata20("design:returntype", Promise)
|
|
2632
|
+
], CopilotResolver.prototype, "generateCopilotResponse", null);
|
|
2633
|
+
CopilotResolver = _ts_decorate20([
|
|
2634
|
+
(0, import_type_graphql21.Resolver)(() => CopilotResponse)
|
|
2635
|
+
], CopilotResolver);
|
|
2636
|
+
|
|
2637
|
+
// src/lib/integrations/shared.ts
|
|
2638
|
+
var import_plugin_defer_stream = require("@graphql-yoga/plugin-defer-stream");
|
|
2639
|
+
|
|
2640
|
+
// src/lib/logger.ts
|
|
2641
|
+
var import_pino = __toESM(require("pino"));
|
|
2642
|
+
var import_pino_pretty = __toESM(require("pino-pretty"));
|
|
2643
|
+
function createLogger(options) {
|
|
2644
|
+
const { level, component } = options || {};
|
|
2645
|
+
const stream = (0, import_pino_pretty.default)({
|
|
2646
|
+
colorize: true
|
|
2647
|
+
});
|
|
2648
|
+
const logger2 = (0, import_pino.default)({
|
|
2649
|
+
level: process.env.LOG_LEVEL || level || "error",
|
|
2650
|
+
redact: {
|
|
2651
|
+
paths: [
|
|
2652
|
+
"pid",
|
|
2653
|
+
"hostname"
|
|
2654
|
+
],
|
|
2655
|
+
remove: true
|
|
2656
|
+
}
|
|
2657
|
+
}, stream);
|
|
2658
|
+
if (component) {
|
|
2659
|
+
return logger2.child({
|
|
2660
|
+
component
|
|
2661
|
+
});
|
|
2662
|
+
} else {
|
|
2663
|
+
return logger2;
|
|
2664
|
+
}
|
|
2665
|
+
}
|
|
2666
|
+
__name(createLogger, "createLogger");
|
|
2667
|
+
|
|
2668
|
+
// src/graphql/resolvers/state.resolver.ts
|
|
2669
|
+
var import_type_graphql24 = require("type-graphql");
|
|
2670
|
+
var import_type_graphql25 = require("type-graphql");
|
|
2671
|
+
var import_type_graphql26 = require("type-graphql");
|
|
2672
|
+
|
|
2673
|
+
// src/graphql/types/load-agent-state-response.type.ts
|
|
2674
|
+
var import_type_graphql22 = require("type-graphql");
|
|
2675
|
+
function _ts_decorate21(decorators, target, key, desc) {
|
|
2676
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
2677
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function")
|
|
2678
|
+
r = Reflect.decorate(decorators, target, key, desc);
|
|
2679
|
+
else
|
|
2680
|
+
for (var i = decorators.length - 1; i >= 0; i--)
|
|
2681
|
+
if (d = decorators[i])
|
|
2682
|
+
r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
2683
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
2684
|
+
}
|
|
2685
|
+
__name(_ts_decorate21, "_ts_decorate");
|
|
2686
|
+
function _ts_metadata21(k, v) {
|
|
2687
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function")
|
|
2688
|
+
return Reflect.metadata(k, v);
|
|
2689
|
+
}
|
|
2690
|
+
__name(_ts_metadata21, "_ts_metadata");
|
|
2691
|
+
var LoadAgentStateResponse = class {
|
|
2692
|
+
threadId;
|
|
2693
|
+
threadExists;
|
|
2694
|
+
state;
|
|
2695
|
+
messages;
|
|
2696
|
+
};
|
|
2697
|
+
__name(LoadAgentStateResponse, "LoadAgentStateResponse");
|
|
2698
|
+
_ts_decorate21([
|
|
2699
|
+
(0, import_type_graphql22.Field)(() => String),
|
|
2700
|
+
_ts_metadata21("design:type", String)
|
|
2701
|
+
], LoadAgentStateResponse.prototype, "threadId", void 0);
|
|
2702
|
+
_ts_decorate21([
|
|
2703
|
+
(0, import_type_graphql22.Field)(() => Boolean),
|
|
2704
|
+
_ts_metadata21("design:type", Boolean)
|
|
2705
|
+
], LoadAgentStateResponse.prototype, "threadExists", void 0);
|
|
2706
|
+
_ts_decorate21([
|
|
2707
|
+
(0, import_type_graphql22.Field)(() => String),
|
|
2708
|
+
_ts_metadata21("design:type", String)
|
|
2709
|
+
], LoadAgentStateResponse.prototype, "state", void 0);
|
|
2710
|
+
_ts_decorate21([
|
|
2711
|
+
(0, import_type_graphql22.Field)(() => String),
|
|
2712
|
+
_ts_metadata21("design:type", String)
|
|
2713
|
+
], LoadAgentStateResponse.prototype, "messages", void 0);
|
|
2714
|
+
LoadAgentStateResponse = _ts_decorate21([
|
|
2715
|
+
(0, import_type_graphql22.ObjectType)()
|
|
2716
|
+
], LoadAgentStateResponse);
|
|
2717
|
+
|
|
2718
|
+
// src/graphql/inputs/load-agent-state.input.ts
|
|
2719
|
+
var import_type_graphql23 = require("type-graphql");
|
|
2720
|
+
function _ts_decorate22(decorators, target, key, desc) {
|
|
2721
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
2722
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function")
|
|
2723
|
+
r = Reflect.decorate(decorators, target, key, desc);
|
|
2724
|
+
else
|
|
2725
|
+
for (var i = decorators.length - 1; i >= 0; i--)
|
|
2726
|
+
if (d = decorators[i])
|
|
2727
|
+
r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
2728
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
2729
|
+
}
|
|
2730
|
+
__name(_ts_decorate22, "_ts_decorate");
|
|
2731
|
+
function _ts_metadata22(k, v) {
|
|
2732
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function")
|
|
2733
|
+
return Reflect.metadata(k, v);
|
|
2734
|
+
}
|
|
2735
|
+
__name(_ts_metadata22, "_ts_metadata");
|
|
2736
|
+
var LoadAgentStateInput = class {
|
|
2737
|
+
threadId;
|
|
2738
|
+
agentName;
|
|
2739
|
+
};
|
|
2740
|
+
__name(LoadAgentStateInput, "LoadAgentStateInput");
|
|
2741
|
+
_ts_decorate22([
|
|
2742
|
+
(0, import_type_graphql23.Field)(() => String),
|
|
2743
|
+
_ts_metadata22("design:type", String)
|
|
2744
|
+
], LoadAgentStateInput.prototype, "threadId", void 0);
|
|
2745
|
+
_ts_decorate22([
|
|
2746
|
+
(0, import_type_graphql23.Field)(() => String),
|
|
2747
|
+
_ts_metadata22("design:type", String)
|
|
2748
|
+
], LoadAgentStateInput.prototype, "agentName", void 0);
|
|
2749
|
+
LoadAgentStateInput = _ts_decorate22([
|
|
2750
|
+
(0, import_type_graphql23.InputType)()
|
|
2751
|
+
], LoadAgentStateInput);
|
|
2752
|
+
|
|
2753
|
+
// src/graphql/resolvers/state.resolver.ts
|
|
2754
|
+
var import_shared8 = require("@copilotkit/shared");
|
|
2755
|
+
function _ts_decorate23(decorators, target, key, desc) {
|
|
2756
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
2757
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function")
|
|
2758
|
+
r = Reflect.decorate(decorators, target, key, desc);
|
|
2759
|
+
else
|
|
2760
|
+
for (var i = decorators.length - 1; i >= 0; i--)
|
|
2761
|
+
if (d = decorators[i])
|
|
2762
|
+
r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
2763
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
2764
|
+
}
|
|
2765
|
+
__name(_ts_decorate23, "_ts_decorate");
|
|
2766
|
+
function _ts_metadata23(k, v) {
|
|
2767
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function")
|
|
2768
|
+
return Reflect.metadata(k, v);
|
|
2769
|
+
}
|
|
2770
|
+
__name(_ts_metadata23, "_ts_metadata");
|
|
2771
|
+
function _ts_param2(paramIndex, decorator) {
|
|
2772
|
+
return function(target, key) {
|
|
2773
|
+
decorator(target, key, paramIndex);
|
|
2774
|
+
};
|
|
2775
|
+
}
|
|
2776
|
+
__name(_ts_param2, "_ts_param");
|
|
2777
|
+
var StateResolver = class {
|
|
2778
|
+
async loadAgentState(ctx, data) {
|
|
2779
|
+
const agents = await ctx._copilotkit.runtime.getAllAgents(ctx);
|
|
2780
|
+
const hasAgent = agents.some((agent) => agent.name === data.agentName);
|
|
2781
|
+
if (!hasAgent) {
|
|
2782
|
+
throw new import_shared8.CopilotKitAgentDiscoveryError({
|
|
2783
|
+
agentName: data.agentName,
|
|
2784
|
+
availableAgents: agents.map((a) => ({
|
|
2785
|
+
name: a.name,
|
|
2786
|
+
id: a.name
|
|
2787
|
+
}))
|
|
2788
|
+
});
|
|
2789
|
+
}
|
|
2790
|
+
const state = await ctx._copilotkit.runtime.loadAgentState(ctx, data.threadId, data.agentName);
|
|
2791
|
+
return state;
|
|
2792
|
+
}
|
|
2793
|
+
};
|
|
2794
|
+
__name(StateResolver, "StateResolver");
|
|
2795
|
+
_ts_decorate23([
|
|
2796
|
+
(0, import_type_graphql26.Query)(() => LoadAgentStateResponse),
|
|
2797
|
+
_ts_param2(0, (0, import_type_graphql25.Ctx)()),
|
|
2798
|
+
_ts_param2(1, (0, import_type_graphql24.Arg)("data")),
|
|
2799
|
+
_ts_metadata23("design:type", Function),
|
|
2800
|
+
_ts_metadata23("design:paramtypes", [
|
|
2801
|
+
typeof GraphQLContext === "undefined" ? Object : GraphQLContext,
|
|
2802
|
+
typeof LoadAgentStateInput === "undefined" ? Object : LoadAgentStateInput
|
|
2803
|
+
]),
|
|
2804
|
+
_ts_metadata23("design:returntype", Promise)
|
|
2805
|
+
], StateResolver.prototype, "loadAgentState", null);
|
|
2806
|
+
StateResolver = _ts_decorate23([
|
|
2807
|
+
(0, import_type_graphql24.Resolver)(() => LoadAgentStateResponse)
|
|
2808
|
+
], StateResolver);
|
|
2809
|
+
|
|
2810
|
+
// src/lib/integrations/shared.ts
|
|
2811
|
+
var packageJson2 = __toESM(require_package());
|
|
2812
|
+
var import_shared9 = require("@copilotkit/shared");
|
|
2813
|
+
var logger = createLogger();
|
|
2814
|
+
var addCustomHeaderPlugin = {
|
|
2815
|
+
onResponse({ response }) {
|
|
2816
|
+
response.headers.set("X-CopilotKit-Runtime-Version", packageJson2.version);
|
|
2817
|
+
}
|
|
2818
|
+
};
|
|
2819
|
+
async function createContext(initialContext, copilotKitContext, contextLogger, properties = {}) {
|
|
2820
|
+
logger.debug({
|
|
2821
|
+
copilotKitContext
|
|
2822
|
+
}, "Creating GraphQL context");
|
|
2823
|
+
const ctx = {
|
|
2824
|
+
...initialContext,
|
|
2825
|
+
_copilotkit: {
|
|
2826
|
+
...copilotKitContext
|
|
2827
|
+
},
|
|
2828
|
+
properties: {
|
|
2829
|
+
...properties
|
|
2830
|
+
},
|
|
2831
|
+
logger: contextLogger
|
|
2832
|
+
};
|
|
2833
|
+
return ctx;
|
|
2834
|
+
}
|
|
2835
|
+
__name(createContext, "createContext");
|
|
2836
|
+
function buildSchema(options = {}) {
|
|
2837
|
+
logger.debug("Building GraphQL schema...");
|
|
2838
|
+
const schema = (0, import_type_graphql27.buildSchemaSync)({
|
|
2839
|
+
resolvers: [
|
|
2840
|
+
CopilotResolver,
|
|
2841
|
+
StateResolver
|
|
2842
|
+
],
|
|
2843
|
+
emitSchemaFile: options.emitSchemaFile
|
|
2844
|
+
});
|
|
2845
|
+
logger.debug("GraphQL schema built successfully");
|
|
2846
|
+
return schema;
|
|
2847
|
+
}
|
|
2848
|
+
__name(buildSchema, "buildSchema");
|
|
2849
|
+
function getCommonConfig(options) {
|
|
2850
|
+
var _a;
|
|
2851
|
+
const logLevel = process.env.LOG_LEVEL || options.logLevel || "error";
|
|
2852
|
+
const logger2 = createLogger({
|
|
2853
|
+
level: logLevel,
|
|
2854
|
+
component: "getCommonConfig"
|
|
2855
|
+
});
|
|
2856
|
+
const contextLogger = createLogger({
|
|
2857
|
+
level: logLevel
|
|
2858
|
+
});
|
|
2859
|
+
if (options.cloud) {
|
|
2860
|
+
telemetry_client_default.setCloudConfiguration({
|
|
2861
|
+
publicApiKey: options.cloud.publicApiKey,
|
|
2862
|
+
baseUrl: options.cloud.baseUrl
|
|
2863
|
+
});
|
|
2864
|
+
}
|
|
2865
|
+
if ((_a = options.properties) == null ? void 0 : _a._copilotkit) {
|
|
2866
|
+
telemetry_client_default.setGlobalProperties({
|
|
2867
|
+
_copilotkit: {
|
|
2868
|
+
...options.properties._copilotkit
|
|
2869
|
+
}
|
|
2870
|
+
});
|
|
2871
|
+
}
|
|
2872
|
+
telemetry_client_default.setGlobalProperties({
|
|
2873
|
+
runtime: {
|
|
2874
|
+
serviceAdapter: options.serviceAdapter.constructor.name
|
|
2875
|
+
}
|
|
2876
|
+
});
|
|
2877
|
+
const userErrorCodes = [
|
|
2878
|
+
import_shared9.CopilotKitErrorCode.AGENT_NOT_FOUND,
|
|
2879
|
+
import_shared9.CopilotKitErrorCode.API_NOT_FOUND,
|
|
2880
|
+
import_shared9.CopilotKitErrorCode.REMOTE_ENDPOINT_NOT_FOUND,
|
|
2881
|
+
import_shared9.CopilotKitErrorCode.CONFIGURATION_ERROR,
|
|
2882
|
+
import_shared9.CopilotKitErrorCode.MISSING_PUBLIC_API_KEY_ERROR
|
|
2883
|
+
];
|
|
2884
|
+
return {
|
|
2885
|
+
logging: createLogger({
|
|
2886
|
+
component: "Yoga GraphQL",
|
|
2887
|
+
level: logLevel
|
|
2888
|
+
}),
|
|
2889
|
+
schema: buildSchema(),
|
|
2890
|
+
plugins: [
|
|
2891
|
+
(0, import_plugin_defer_stream.useDeferStream)(),
|
|
2892
|
+
addCustomHeaderPlugin
|
|
2893
|
+
],
|
|
2894
|
+
context: (ctx) => createContext(ctx, options, contextLogger, options.properties),
|
|
2895
|
+
// Suppress logging for user configuration errors
|
|
2896
|
+
maskedErrors: {
|
|
2897
|
+
maskError: (error, message, isDev) => {
|
|
2898
|
+
const originalError = error.originalError || error;
|
|
2899
|
+
const extensions = error.extensions;
|
|
2900
|
+
const errorCode = extensions == null ? void 0 : extensions.code;
|
|
2901
|
+
if (errorCode && userErrorCodes.includes(errorCode)) {
|
|
2902
|
+
console.debug("User configuration error:", error.message);
|
|
2903
|
+
return error;
|
|
2904
|
+
}
|
|
2905
|
+
if (originalError instanceof import_shared9.CopilotKitError && userErrorCodes.includes(originalError.code)) {
|
|
2906
|
+
console.debug("User configuration error:", error.message);
|
|
2907
|
+
return error;
|
|
2908
|
+
}
|
|
2909
|
+
console.error("Application error:", error);
|
|
2910
|
+
return error;
|
|
2911
|
+
}
|
|
2912
|
+
}
|
|
2913
|
+
};
|
|
2914
|
+
}
|
|
2915
|
+
__name(getCommonConfig, "getCommonConfig");
|
|
2916
|
+
|
|
2917
|
+
// src/lib/integrations/node-http/index.ts
|
|
2918
|
+
function copilotRuntimeNodeHttpEndpoint(options) {
|
|
2919
|
+
var _a;
|
|
2920
|
+
const commonConfig = getCommonConfig(options);
|
|
2921
|
+
telemetry_client_default.setGlobalProperties({
|
|
2922
|
+
runtime: {
|
|
2923
|
+
framework: "node-http"
|
|
2924
|
+
}
|
|
2925
|
+
});
|
|
2926
|
+
if ((_a = options.properties) == null ? void 0 : _a._copilotkit) {
|
|
2927
|
+
telemetry_client_default.setGlobalProperties({
|
|
2928
|
+
_copilotkit: options.properties._copilotkit
|
|
2929
|
+
});
|
|
2930
|
+
}
|
|
2931
|
+
telemetry_client_default.capture("oss.runtime.instance_created", getRuntimeInstanceTelemetryInfo(options));
|
|
2932
|
+
const logger2 = commonConfig.logging;
|
|
2933
|
+
logger2.debug("Creating Node HTTP endpoint");
|
|
2934
|
+
const yoga = (0, import_graphql_yoga2.createYoga)({
|
|
2935
|
+
...commonConfig,
|
|
2936
|
+
graphqlEndpoint: options.endpoint
|
|
2937
|
+
});
|
|
2938
|
+
return yoga;
|
|
2939
|
+
}
|
|
2940
|
+
__name(copilotRuntimeNodeHttpEndpoint, "copilotRuntimeNodeHttpEndpoint");
|
|
2941
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
2942
|
+
0 && (module.exports = {
|
|
2943
|
+
copilotRuntimeNodeHttpEndpoint
|
|
2944
|
+
});
|
|
2945
|
+
//# sourceMappingURL=index.js.map
|