@copilotkit/runtime 1.5.1-next.3 → 1.5.1-next.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (82) hide show
  1. package/CHANGELOG.md +10 -2
  2. package/package.json +2 -2
  3. package/__snapshots__/schema/schema.graphql +0 -263
  4. package/dist/chunk-44O2JGUY.mjs +0 -12
  5. package/dist/chunk-44O2JGUY.mjs.map +0 -1
  6. package/dist/chunk-B74M7FXG.mjs +0 -65
  7. package/dist/chunk-B74M7FXG.mjs.map +0 -1
  8. package/dist/chunk-D2WLFQS6.mjs +0 -43
  9. package/dist/chunk-D2WLFQS6.mjs.map +0 -1
  10. package/dist/chunk-DFOKBSIS.mjs +0 -1
  11. package/dist/chunk-DFOKBSIS.mjs.map +0 -1
  12. package/dist/chunk-M4QD67S3.mjs +0 -80
  13. package/dist/chunk-M4QD67S3.mjs.map +0 -1
  14. package/dist/chunk-OKQVDDJ2.mjs +0 -1173
  15. package/dist/chunk-OKQVDDJ2.mjs.map +0 -1
  16. package/dist/chunk-U3AYI5XZ.mjs +0 -25
  17. package/dist/chunk-U3AYI5XZ.mjs.map +0 -1
  18. package/dist/chunk-U3V2BCGI.mjs +0 -152
  19. package/dist/chunk-U3V2BCGI.mjs.map +0 -1
  20. package/dist/chunk-U75F2RAQ.mjs +0 -25
  21. package/dist/chunk-U75F2RAQ.mjs.map +0 -1
  22. package/dist/chunk-ZSWCEADS.mjs +0 -3147
  23. package/dist/chunk-ZSWCEADS.mjs.map +0 -1
  24. package/dist/copilot-runtime-12e7ac40.d.ts +0 -189
  25. package/dist/graphql/types/base/index.d.ts +0 -6
  26. package/dist/graphql/types/base/index.js +0 -63
  27. package/dist/graphql/types/base/index.js.map +0 -1
  28. package/dist/graphql/types/base/index.mjs +0 -8
  29. package/dist/graphql/types/base/index.mjs.map +0 -1
  30. package/dist/graphql/types/converted/index.d.ts +0 -2
  31. package/dist/graphql/types/converted/index.js +0 -123
  32. package/dist/graphql/types/converted/index.js.map +0 -1
  33. package/dist/graphql/types/converted/index.mjs +0 -17
  34. package/dist/graphql/types/converted/index.mjs.map +0 -1
  35. package/dist/groq-adapter-24abe931.d.ts +0 -281
  36. package/dist/index-10b1c870.d.ts +0 -88
  37. package/dist/index.d.ts +0 -23
  38. package/dist/index.js +0 -4667
  39. package/dist/index.js.map +0 -1
  40. package/dist/index.mjs +0 -72
  41. package/dist/index.mjs.map +0 -1
  42. package/dist/langserve-f021ab9c.d.ts +0 -136
  43. package/dist/lib/cloud/index.d.ts +0 -6
  44. package/dist/lib/cloud/index.js +0 -18
  45. package/dist/lib/cloud/index.js.map +0 -1
  46. package/dist/lib/cloud/index.mjs +0 -1
  47. package/dist/lib/cloud/index.mjs.map +0 -1
  48. package/dist/lib/index.d.ts +0 -20
  49. package/dist/lib/index.js +0 -4392
  50. package/dist/lib/index.js.map +0 -1
  51. package/dist/lib/index.mjs +0 -58
  52. package/dist/lib/index.mjs.map +0 -1
  53. package/dist/lib/integrations/index.d.ts +0 -33
  54. package/dist/lib/integrations/index.js +0 -2043
  55. package/dist/lib/integrations/index.js.map +0 -1
  56. package/dist/lib/integrations/index.mjs +0 -34
  57. package/dist/lib/integrations/index.mjs.map +0 -1
  58. package/dist/lib/integrations/nest/index.d.ts +0 -14
  59. package/dist/lib/integrations/nest/index.js +0 -1952
  60. package/dist/lib/integrations/nest/index.js.map +0 -1
  61. package/dist/lib/integrations/nest/index.mjs +0 -13
  62. package/dist/lib/integrations/nest/index.mjs.map +0 -1
  63. package/dist/lib/integrations/node-express/index.d.ts +0 -14
  64. package/dist/lib/integrations/node-express/index.js +0 -1952
  65. package/dist/lib/integrations/node-express/index.js.map +0 -1
  66. package/dist/lib/integrations/node-express/index.mjs +0 -13
  67. package/dist/lib/integrations/node-express/index.mjs.map +0 -1
  68. package/dist/lib/integrations/node-http/index.d.ts +0 -14
  69. package/dist/lib/integrations/node-http/index.js +0 -1938
  70. package/dist/lib/integrations/node-http/index.js.map +0 -1
  71. package/dist/lib/integrations/node-http/index.mjs +0 -12
  72. package/dist/lib/integrations/node-http/index.mjs.map +0 -1
  73. package/dist/service-adapters/index.d.ts +0 -53
  74. package/dist/service-adapters/index.js +0 -1211
  75. package/dist/service-adapters/index.js.map +0 -1
  76. package/dist/service-adapters/index.mjs +0 -22
  77. package/dist/service-adapters/index.mjs.map +0 -1
  78. package/dist/utils/index.d.ts +0 -49
  79. package/dist/utils/index.js +0 -174
  80. package/dist/utils/index.js.map +0 -1
  81. package/dist/utils/index.mjs +0 -12
  82. package/dist/utils/index.mjs.map +0 -1
@@ -1,2043 +0,0 @@
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.4.1-pre.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
- "@swc/core": "1.5.28",
68
- "@types/express": "^4.17.21",
69
- "@types/jest": "^29.5.4",
70
- "@types/node": "^18.11.17",
71
- "@whatwg-node/server": "^0.9.34",
72
- eslint: "^8.56.0",
73
- "eslint-config-custom": "workspace:*",
74
- jest: "^29.6.4",
75
- nodemon: "^3.1.3",
76
- "ts-jest": "^29.1.1",
77
- "ts-node": "^10.9.2",
78
- tsconfig: "workspace:*",
79
- tsup: "^6.7.0",
80
- typescript: "^5.2.3",
81
- "zod-to-json-schema": "^3.23.5"
82
- },
83
- dependencies: {
84
- "@anthropic-ai/sdk": "^0.27.3",
85
- "@copilotkit/shared": "workspace:*",
86
- "@graphql-yoga/plugin-defer-stream": "^3.3.1",
87
- "@langchain/community": "^0.0.53",
88
- "@langchain/core": "^0.3.13",
89
- "@langchain/google-gauth": "^0.1.0",
90
- "@langchain/langgraph-sdk": "^0.0.16",
91
- "@langchain/openai": "^0.0.28",
92
- "class-transformer": "^0.5.1",
93
- express: "^4.19.2",
94
- graphql: "^16.8.1",
95
- "graphql-scalars": "^1.23.0",
96
- "graphql-yoga": "^5.3.1",
97
- "groq-sdk": "^0.5.0",
98
- langchain: "^0.3.3",
99
- openai: "^4.50.0",
100
- "partial-json": "^0.1.7",
101
- pino: "^9.2.0",
102
- "pino-pretty": "^11.2.1",
103
- "reflect-metadata": "^0.2.2",
104
- rxjs: "^7.8.1",
105
- "type-graphql": "2.0.0-rc.1",
106
- zod: "^3.23.3"
107
- },
108
- keywords: [
109
- "copilotkit",
110
- "copilot",
111
- "react",
112
- "nextjs",
113
- "nodejs",
114
- "ai",
115
- "assistant",
116
- "javascript",
117
- "automation",
118
- "textarea"
119
- ]
120
- };
121
- }
122
- });
123
-
124
- // src/lib/integrations/index.ts
125
- var integrations_exports = {};
126
- __export(integrations_exports, {
127
- buildSchema: () => buildSchema,
128
- config: () => config,
129
- copilotRuntimeNestEndpoint: () => copilotRuntimeNestEndpoint,
130
- copilotRuntimeNextJSAppRouterEndpoint: () => copilotRuntimeNextJSAppRouterEndpoint,
131
- copilotRuntimeNextJSPagesRouterEndpoint: () => copilotRuntimeNextJSPagesRouterEndpoint,
132
- copilotRuntimeNodeExpressEndpoint: () => copilotRuntimeNodeExpressEndpoint,
133
- copilotRuntimeNodeHttpEndpoint: () => copilotRuntimeNodeHttpEndpoint,
134
- createContext: () => createContext,
135
- getCommonConfig: () => getCommonConfig
136
- });
137
- module.exports = __toCommonJS(integrations_exports);
138
-
139
- // src/lib/integrations/shared.ts
140
- var import_type_graphql16 = require("type-graphql");
141
-
142
- // src/graphql/resolvers/copilot.resolver.ts
143
- var import_type_graphql15 = require("type-graphql");
144
- var import_rxjs3 = require("rxjs");
145
-
146
- // src/graphql/inputs/generate-copilot-response.input.ts
147
- var import_type_graphql11 = require("type-graphql");
148
-
149
- // src/graphql/inputs/message.input.ts
150
- var import_type_graphql3 = require("type-graphql");
151
-
152
- // src/graphql/types/enums.ts
153
- var import_type_graphql = require("type-graphql");
154
- var MessageRole;
155
- (function(MessageRole2) {
156
- MessageRole2["user"] = "user";
157
- MessageRole2["assistant"] = "assistant";
158
- MessageRole2["system"] = "system";
159
- MessageRole2["tool"] = "tool";
160
- })(MessageRole || (MessageRole = {}));
161
- var ActionExecutionScope;
162
- (function(ActionExecutionScope2) {
163
- ActionExecutionScope2["server"] = "server";
164
- ActionExecutionScope2["client"] = "client";
165
- ActionExecutionScope2["passThrough"] = "passThrough";
166
- })(ActionExecutionScope || (ActionExecutionScope = {}));
167
- var CopilotRequestType;
168
- (function(CopilotRequestType2) {
169
- CopilotRequestType2["Chat"] = "Chat";
170
- CopilotRequestType2["Task"] = "Task";
171
- CopilotRequestType2["TextareaCompletion"] = "TextareaCompletion";
172
- CopilotRequestType2["TextareaPopover"] = "TextareaPopover";
173
- CopilotRequestType2["Suggestion"] = "Suggestion";
174
- })(CopilotRequestType || (CopilotRequestType = {}));
175
- var ActionInputAvailability;
176
- (function(ActionInputAvailability2) {
177
- ActionInputAvailability2["disabled"] = "disabled";
178
- ActionInputAvailability2["enabled"] = "enabled";
179
- ActionInputAvailability2["remote"] = "remote";
180
- })(ActionInputAvailability || (ActionInputAvailability = {}));
181
- (0, import_type_graphql.registerEnumType)(MessageRole, {
182
- name: "MessageRole",
183
- description: "The role of the message"
184
- });
185
- (0, import_type_graphql.registerEnumType)(ActionExecutionScope, {
186
- name: "ActionExecutionScope",
187
- description: "The scope of the action"
188
- });
189
- (0, import_type_graphql.registerEnumType)(CopilotRequestType, {
190
- name: "CopilotRequestType",
191
- description: "The type of Copilot request"
192
- });
193
- (0, import_type_graphql.registerEnumType)(ActionInputAvailability, {
194
- name: "ActionInputAvailability",
195
- description: "The availability of the frontend action"
196
- });
197
-
198
- // src/graphql/types/base/index.ts
199
- var import_type_graphql2 = require("type-graphql");
200
- function _ts_decorate(decorators, target, key, desc) {
201
- var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
202
- if (typeof Reflect === "object" && typeof Reflect.decorate === "function")
203
- r = Reflect.decorate(decorators, target, key, desc);
204
- else
205
- for (var i = decorators.length - 1; i >= 0; i--)
206
- if (d = decorators[i])
207
- r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
208
- return c > 3 && r && Object.defineProperty(target, key, r), r;
209
- }
210
- __name(_ts_decorate, "_ts_decorate");
211
- function _ts_metadata(k, v) {
212
- if (typeof Reflect === "object" && typeof Reflect.metadata === "function")
213
- return Reflect.metadata(k, v);
214
- }
215
- __name(_ts_metadata, "_ts_metadata");
216
- var BaseMessageInput = class {
217
- id;
218
- createdAt;
219
- };
220
- __name(BaseMessageInput, "BaseMessageInput");
221
- _ts_decorate([
222
- (0, import_type_graphql2.Field)(() => String),
223
- _ts_metadata("design:type", String)
224
- ], BaseMessageInput.prototype, "id", void 0);
225
- _ts_decorate([
226
- (0, import_type_graphql2.Field)(() => Date),
227
- _ts_metadata("design:type", typeof Date === "undefined" ? Object : Date)
228
- ], BaseMessageInput.prototype, "createdAt", void 0);
229
- BaseMessageInput = _ts_decorate([
230
- (0, import_type_graphql2.InputType)()
231
- ], BaseMessageInput);
232
-
233
- // src/graphql/inputs/message.input.ts
234
- function _ts_decorate2(decorators, target, key, desc) {
235
- var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
236
- if (typeof Reflect === "object" && typeof Reflect.decorate === "function")
237
- r = Reflect.decorate(decorators, target, key, desc);
238
- else
239
- for (var i = decorators.length - 1; i >= 0; i--)
240
- if (d = decorators[i])
241
- r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
242
- return c > 3 && r && Object.defineProperty(target, key, r), r;
243
- }
244
- __name(_ts_decorate2, "_ts_decorate");
245
- function _ts_metadata2(k, v) {
246
- if (typeof Reflect === "object" && typeof Reflect.metadata === "function")
247
- return Reflect.metadata(k, v);
248
- }
249
- __name(_ts_metadata2, "_ts_metadata");
250
- var MessageInput = class extends BaseMessageInput {
251
- textMessage;
252
- actionExecutionMessage;
253
- resultMessage;
254
- agentStateMessage;
255
- };
256
- __name(MessageInput, "MessageInput");
257
- _ts_decorate2([
258
- (0, import_type_graphql3.Field)(() => TextMessageInput, {
259
- nullable: true
260
- }),
261
- _ts_metadata2("design:type", typeof TextMessageInput === "undefined" ? Object : TextMessageInput)
262
- ], MessageInput.prototype, "textMessage", void 0);
263
- _ts_decorate2([
264
- (0, import_type_graphql3.Field)(() => ActionExecutionMessageInput, {
265
- nullable: true
266
- }),
267
- _ts_metadata2("design:type", typeof ActionExecutionMessageInput === "undefined" ? Object : ActionExecutionMessageInput)
268
- ], MessageInput.prototype, "actionExecutionMessage", void 0);
269
- _ts_decorate2([
270
- (0, import_type_graphql3.Field)(() => ResultMessageInput, {
271
- nullable: true
272
- }),
273
- _ts_metadata2("design:type", typeof ResultMessageInput === "undefined" ? Object : ResultMessageInput)
274
- ], MessageInput.prototype, "resultMessage", void 0);
275
- _ts_decorate2([
276
- (0, import_type_graphql3.Field)(() => AgentStateMessageInput, {
277
- nullable: true
278
- }),
279
- _ts_metadata2("design:type", typeof AgentStateMessageInput === "undefined" ? Object : AgentStateMessageInput)
280
- ], MessageInput.prototype, "agentStateMessage", void 0);
281
- MessageInput = _ts_decorate2([
282
- (0, import_type_graphql3.InputType)()
283
- ], MessageInput);
284
- var TextMessageInput = class {
285
- content;
286
- role;
287
- };
288
- __name(TextMessageInput, "TextMessageInput");
289
- _ts_decorate2([
290
- (0, import_type_graphql3.Field)(() => String),
291
- _ts_metadata2("design:type", String)
292
- ], TextMessageInput.prototype, "content", void 0);
293
- _ts_decorate2([
294
- (0, import_type_graphql3.Field)(() => MessageRole),
295
- _ts_metadata2("design:type", typeof MessageRole === "undefined" ? Object : MessageRole)
296
- ], TextMessageInput.prototype, "role", void 0);
297
- TextMessageInput = _ts_decorate2([
298
- (0, import_type_graphql3.InputType)()
299
- ], TextMessageInput);
300
- var ActionExecutionMessageInput = class {
301
- name;
302
- arguments;
303
- scope;
304
- };
305
- __name(ActionExecutionMessageInput, "ActionExecutionMessageInput");
306
- _ts_decorate2([
307
- (0, import_type_graphql3.Field)(() => String),
308
- _ts_metadata2("design:type", String)
309
- ], ActionExecutionMessageInput.prototype, "name", void 0);
310
- _ts_decorate2([
311
- (0, import_type_graphql3.Field)(() => String),
312
- _ts_metadata2("design:type", String)
313
- ], ActionExecutionMessageInput.prototype, "arguments", void 0);
314
- _ts_decorate2([
315
- (0, import_type_graphql3.Field)(() => ActionExecutionScope),
316
- _ts_metadata2("design:type", typeof ActionExecutionScope === "undefined" ? Object : ActionExecutionScope)
317
- ], ActionExecutionMessageInput.prototype, "scope", void 0);
318
- ActionExecutionMessageInput = _ts_decorate2([
319
- (0, import_type_graphql3.InputType)()
320
- ], ActionExecutionMessageInput);
321
- var ResultMessageInput = class {
322
- actionExecutionId;
323
- actionName;
324
- result;
325
- };
326
- __name(ResultMessageInput, "ResultMessageInput");
327
- _ts_decorate2([
328
- (0, import_type_graphql3.Field)(() => String),
329
- _ts_metadata2("design:type", String)
330
- ], ResultMessageInput.prototype, "actionExecutionId", void 0);
331
- _ts_decorate2([
332
- (0, import_type_graphql3.Field)(() => String),
333
- _ts_metadata2("design:type", String)
334
- ], ResultMessageInput.prototype, "actionName", void 0);
335
- _ts_decorate2([
336
- (0, import_type_graphql3.Field)(() => String),
337
- _ts_metadata2("design:type", String)
338
- ], ResultMessageInput.prototype, "result", void 0);
339
- ResultMessageInput = _ts_decorate2([
340
- (0, import_type_graphql3.InputType)()
341
- ], ResultMessageInput);
342
- var AgentStateMessageInput = class {
343
- threadId;
344
- agentName;
345
- role;
346
- state;
347
- running;
348
- nodeName;
349
- runId;
350
- active;
351
- };
352
- __name(AgentStateMessageInput, "AgentStateMessageInput");
353
- _ts_decorate2([
354
- (0, import_type_graphql3.Field)(() => String),
355
- _ts_metadata2("design:type", String)
356
- ], AgentStateMessageInput.prototype, "threadId", void 0);
357
- _ts_decorate2([
358
- (0, import_type_graphql3.Field)(() => String),
359
- _ts_metadata2("design:type", String)
360
- ], AgentStateMessageInput.prototype, "agentName", void 0);
361
- _ts_decorate2([
362
- (0, import_type_graphql3.Field)(() => MessageRole),
363
- _ts_metadata2("design:type", typeof MessageRole === "undefined" ? Object : MessageRole)
364
- ], AgentStateMessageInput.prototype, "role", void 0);
365
- _ts_decorate2([
366
- (0, import_type_graphql3.Field)(() => String),
367
- _ts_metadata2("design:type", String)
368
- ], AgentStateMessageInput.prototype, "state", void 0);
369
- _ts_decorate2([
370
- (0, import_type_graphql3.Field)(() => Boolean),
371
- _ts_metadata2("design:type", Boolean)
372
- ], AgentStateMessageInput.prototype, "running", void 0);
373
- _ts_decorate2([
374
- (0, import_type_graphql3.Field)(() => String),
375
- _ts_metadata2("design:type", String)
376
- ], AgentStateMessageInput.prototype, "nodeName", void 0);
377
- _ts_decorate2([
378
- (0, import_type_graphql3.Field)(() => String),
379
- _ts_metadata2("design:type", String)
380
- ], AgentStateMessageInput.prototype, "runId", void 0);
381
- _ts_decorate2([
382
- (0, import_type_graphql3.Field)(() => Boolean),
383
- _ts_metadata2("design:type", Boolean)
384
- ], AgentStateMessageInput.prototype, "active", void 0);
385
- AgentStateMessageInput = _ts_decorate2([
386
- (0, import_type_graphql3.InputType)()
387
- ], AgentStateMessageInput);
388
-
389
- // src/graphql/inputs/frontend.input.ts
390
- var import_type_graphql5 = require("type-graphql");
391
-
392
- // src/graphql/inputs/action.input.ts
393
- var import_type_graphql4 = require("type-graphql");
394
- function _ts_decorate3(decorators, target, key, desc) {
395
- var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
396
- if (typeof Reflect === "object" && typeof Reflect.decorate === "function")
397
- r = Reflect.decorate(decorators, target, key, desc);
398
- else
399
- for (var i = decorators.length - 1; i >= 0; i--)
400
- if (d = decorators[i])
401
- r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
402
- return c > 3 && r && Object.defineProperty(target, key, r), r;
403
- }
404
- __name(_ts_decorate3, "_ts_decorate");
405
- function _ts_metadata3(k, v) {
406
- if (typeof Reflect === "object" && typeof Reflect.metadata === "function")
407
- return Reflect.metadata(k, v);
408
- }
409
- __name(_ts_metadata3, "_ts_metadata");
410
- var ActionInput = class {
411
- name;
412
- description;
413
- jsonSchema;
414
- available;
415
- };
416
- __name(ActionInput, "ActionInput");
417
- _ts_decorate3([
418
- (0, import_type_graphql4.Field)(() => String),
419
- _ts_metadata3("design:type", String)
420
- ], ActionInput.prototype, "name", void 0);
421
- _ts_decorate3([
422
- (0, import_type_graphql4.Field)(() => String),
423
- _ts_metadata3("design:type", String)
424
- ], ActionInput.prototype, "description", void 0);
425
- _ts_decorate3([
426
- (0, import_type_graphql4.Field)(() => String),
427
- _ts_metadata3("design:type", String)
428
- ], ActionInput.prototype, "jsonSchema", void 0);
429
- _ts_decorate3([
430
- (0, import_type_graphql4.Field)(() => ActionInputAvailability, {
431
- nullable: true
432
- }),
433
- _ts_metadata3("design:type", typeof ActionInputAvailability === "undefined" ? Object : ActionInputAvailability)
434
- ], ActionInput.prototype, "available", void 0);
435
- ActionInput = _ts_decorate3([
436
- (0, import_type_graphql4.InputType)()
437
- ], ActionInput);
438
-
439
- // src/graphql/inputs/frontend.input.ts
440
- function _ts_decorate4(decorators, target, key, desc) {
441
- var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
442
- if (typeof Reflect === "object" && typeof Reflect.decorate === "function")
443
- r = Reflect.decorate(decorators, target, key, desc);
444
- else
445
- for (var i = decorators.length - 1; i >= 0; i--)
446
- if (d = decorators[i])
447
- r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
448
- return c > 3 && r && Object.defineProperty(target, key, r), r;
449
- }
450
- __name(_ts_decorate4, "_ts_decorate");
451
- function _ts_metadata4(k, v) {
452
- if (typeof Reflect === "object" && typeof Reflect.metadata === "function")
453
- return Reflect.metadata(k, v);
454
- }
455
- __name(_ts_metadata4, "_ts_metadata");
456
- var FrontendInput = class {
457
- toDeprecate_fullContext;
458
- actions;
459
- url;
460
- };
461
- __name(FrontendInput, "FrontendInput");
462
- _ts_decorate4([
463
- (0, import_type_graphql5.Field)(() => String, {
464
- nullable: true
465
- }),
466
- _ts_metadata4("design:type", String)
467
- ], FrontendInput.prototype, "toDeprecate_fullContext", void 0);
468
- _ts_decorate4([
469
- (0, import_type_graphql5.Field)(() => [
470
- ActionInput
471
- ]),
472
- _ts_metadata4("design:type", Array)
473
- ], FrontendInput.prototype, "actions", void 0);
474
- _ts_decorate4([
475
- (0, import_type_graphql5.Field)(() => String, {
476
- nullable: true
477
- }),
478
- _ts_metadata4("design:type", String)
479
- ], FrontendInput.prototype, "url", void 0);
480
- FrontendInput = _ts_decorate4([
481
- (0, import_type_graphql5.InputType)()
482
- ], FrontendInput);
483
-
484
- // src/graphql/inputs/cloud.input.ts
485
- var import_type_graphql7 = require("type-graphql");
486
-
487
- // src/graphql/inputs/cloud-guardrails.input.ts
488
- var import_type_graphql6 = require("type-graphql");
489
- function _ts_decorate5(decorators, target, key, desc) {
490
- var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
491
- if (typeof Reflect === "object" && typeof Reflect.decorate === "function")
492
- r = Reflect.decorate(decorators, target, key, desc);
493
- else
494
- for (var i = decorators.length - 1; i >= 0; i--)
495
- if (d = decorators[i])
496
- r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
497
- return c > 3 && r && Object.defineProperty(target, key, r), r;
498
- }
499
- __name(_ts_decorate5, "_ts_decorate");
500
- function _ts_metadata5(k, v) {
501
- if (typeof Reflect === "object" && typeof Reflect.metadata === "function")
502
- return Reflect.metadata(k, v);
503
- }
504
- __name(_ts_metadata5, "_ts_metadata");
505
- var GuardrailsRuleInput = class {
506
- allowList = [];
507
- denyList = [];
508
- };
509
- __name(GuardrailsRuleInput, "GuardrailsRuleInput");
510
- _ts_decorate5([
511
- (0, import_type_graphql6.Field)(() => [
512
- String
513
- ], {
514
- nullable: true
515
- }),
516
- _ts_metadata5("design:type", Array)
517
- ], GuardrailsRuleInput.prototype, "allowList", void 0);
518
- _ts_decorate5([
519
- (0, import_type_graphql6.Field)(() => [
520
- String
521
- ], {
522
- nullable: true
523
- }),
524
- _ts_metadata5("design:type", Array)
525
- ], GuardrailsRuleInput.prototype, "denyList", void 0);
526
- GuardrailsRuleInput = _ts_decorate5([
527
- (0, import_type_graphql6.InputType)()
528
- ], GuardrailsRuleInput);
529
- var GuardrailsInput = class {
530
- inputValidationRules;
531
- };
532
- __name(GuardrailsInput, "GuardrailsInput");
533
- _ts_decorate5([
534
- (0, import_type_graphql6.Field)(() => GuardrailsRuleInput, {
535
- nullable: false
536
- }),
537
- _ts_metadata5("design:type", typeof GuardrailsRuleInput === "undefined" ? Object : GuardrailsRuleInput)
538
- ], GuardrailsInput.prototype, "inputValidationRules", void 0);
539
- GuardrailsInput = _ts_decorate5([
540
- (0, import_type_graphql6.InputType)()
541
- ], GuardrailsInput);
542
-
543
- // src/graphql/inputs/cloud.input.ts
544
- function _ts_decorate6(decorators, target, key, desc) {
545
- var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
546
- if (typeof Reflect === "object" && typeof Reflect.decorate === "function")
547
- r = Reflect.decorate(decorators, target, key, desc);
548
- else
549
- for (var i = decorators.length - 1; i >= 0; i--)
550
- if (d = decorators[i])
551
- r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
552
- return c > 3 && r && Object.defineProperty(target, key, r), r;
553
- }
554
- __name(_ts_decorate6, "_ts_decorate");
555
- function _ts_metadata6(k, v) {
556
- if (typeof Reflect === "object" && typeof Reflect.metadata === "function")
557
- return Reflect.metadata(k, v);
558
- }
559
- __name(_ts_metadata6, "_ts_metadata");
560
- var CloudInput = class {
561
- guardrails;
562
- };
563
- __name(CloudInput, "CloudInput");
564
- _ts_decorate6([
565
- (0, import_type_graphql7.Field)(() => GuardrailsInput, {
566
- nullable: true
567
- }),
568
- _ts_metadata6("design:type", typeof GuardrailsInput === "undefined" ? Object : GuardrailsInput)
569
- ], CloudInput.prototype, "guardrails", void 0);
570
- CloudInput = _ts_decorate6([
571
- (0, import_type_graphql7.InputType)()
572
- ], CloudInput);
573
-
574
- // src/graphql/inputs/forwarded-parameters.input.ts
575
- var import_type_graphql8 = require("type-graphql");
576
- function _ts_decorate7(decorators, target, key, desc) {
577
- var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
578
- if (typeof Reflect === "object" && typeof Reflect.decorate === "function")
579
- r = Reflect.decorate(decorators, target, key, desc);
580
- else
581
- for (var i = decorators.length - 1; i >= 0; i--)
582
- if (d = decorators[i])
583
- r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
584
- return c > 3 && r && Object.defineProperty(target, key, r), r;
585
- }
586
- __name(_ts_decorate7, "_ts_decorate");
587
- function _ts_metadata7(k, v) {
588
- if (typeof Reflect === "object" && typeof Reflect.metadata === "function")
589
- return Reflect.metadata(k, v);
590
- }
591
- __name(_ts_metadata7, "_ts_metadata");
592
- var ForwardedParametersInput = class {
593
- model;
594
- maxTokens;
595
- stop;
596
- toolChoice;
597
- toolChoiceFunctionName;
598
- };
599
- __name(ForwardedParametersInput, "ForwardedParametersInput");
600
- _ts_decorate7([
601
- (0, import_type_graphql8.Field)(() => String, {
602
- nullable: true
603
- }),
604
- _ts_metadata7("design:type", String)
605
- ], ForwardedParametersInput.prototype, "model", void 0);
606
- _ts_decorate7([
607
- (0, import_type_graphql8.Field)(() => Number, {
608
- nullable: true
609
- }),
610
- _ts_metadata7("design:type", Number)
611
- ], ForwardedParametersInput.prototype, "maxTokens", void 0);
612
- _ts_decorate7([
613
- (0, import_type_graphql8.Field)(() => [
614
- String
615
- ], {
616
- nullable: true
617
- }),
618
- _ts_metadata7("design:type", Array)
619
- ], ForwardedParametersInput.prototype, "stop", void 0);
620
- _ts_decorate7([
621
- (0, import_type_graphql8.Field)(() => String, {
622
- nullable: true
623
- }),
624
- _ts_metadata7("design:type", typeof String === "undefined" ? Object : String)
625
- ], ForwardedParametersInput.prototype, "toolChoice", void 0);
626
- _ts_decorate7([
627
- (0, import_type_graphql8.Field)(() => String, {
628
- nullable: true
629
- }),
630
- _ts_metadata7("design:type", String)
631
- ], ForwardedParametersInput.prototype, "toolChoiceFunctionName", void 0);
632
- ForwardedParametersInput = _ts_decorate7([
633
- (0, import_type_graphql8.InputType)()
634
- ], ForwardedParametersInput);
635
-
636
- // src/graphql/inputs/agent-session.input.ts
637
- var import_type_graphql9 = require("type-graphql");
638
- function _ts_decorate8(decorators, target, key, desc) {
639
- var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
640
- if (typeof Reflect === "object" && typeof Reflect.decorate === "function")
641
- r = Reflect.decorate(decorators, target, key, desc);
642
- else
643
- for (var i = decorators.length - 1; i >= 0; i--)
644
- if (d = decorators[i])
645
- r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
646
- return c > 3 && r && Object.defineProperty(target, key, r), r;
647
- }
648
- __name(_ts_decorate8, "_ts_decorate");
649
- function _ts_metadata8(k, v) {
650
- if (typeof Reflect === "object" && typeof Reflect.metadata === "function")
651
- return Reflect.metadata(k, v);
652
- }
653
- __name(_ts_metadata8, "_ts_metadata");
654
- var AgentSessionInput = class {
655
- agentName;
656
- threadId;
657
- nodeName;
658
- };
659
- __name(AgentSessionInput, "AgentSessionInput");
660
- _ts_decorate8([
661
- (0, import_type_graphql9.Field)(() => String),
662
- _ts_metadata8("design:type", String)
663
- ], AgentSessionInput.prototype, "agentName", void 0);
664
- _ts_decorate8([
665
- (0, import_type_graphql9.Field)(() => String, {
666
- nullable: true
667
- }),
668
- _ts_metadata8("design:type", String)
669
- ], AgentSessionInput.prototype, "threadId", void 0);
670
- _ts_decorate8([
671
- (0, import_type_graphql9.Field)(() => String, {
672
- nullable: true
673
- }),
674
- _ts_metadata8("design:type", String)
675
- ], AgentSessionInput.prototype, "nodeName", void 0);
676
- AgentSessionInput = _ts_decorate8([
677
- (0, import_type_graphql9.InputType)()
678
- ], AgentSessionInput);
679
-
680
- // src/graphql/inputs/agent-state.input.ts
681
- var import_type_graphql10 = require("type-graphql");
682
- function _ts_decorate9(decorators, target, key, desc) {
683
- var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
684
- if (typeof Reflect === "object" && typeof Reflect.decorate === "function")
685
- r = Reflect.decorate(decorators, target, key, desc);
686
- else
687
- for (var i = decorators.length - 1; i >= 0; i--)
688
- if (d = decorators[i])
689
- r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
690
- return c > 3 && r && Object.defineProperty(target, key, r), r;
691
- }
692
- __name(_ts_decorate9, "_ts_decorate");
693
- function _ts_metadata9(k, v) {
694
- if (typeof Reflect === "object" && typeof Reflect.metadata === "function")
695
- return Reflect.metadata(k, v);
696
- }
697
- __name(_ts_metadata9, "_ts_metadata");
698
- var AgentStateInput = class {
699
- agentName;
700
- state;
701
- };
702
- __name(AgentStateInput, "AgentStateInput");
703
- _ts_decorate9([
704
- (0, import_type_graphql10.Field)(() => String),
705
- _ts_metadata9("design:type", String)
706
- ], AgentStateInput.prototype, "agentName", void 0);
707
- _ts_decorate9([
708
- (0, import_type_graphql10.Field)(() => String),
709
- _ts_metadata9("design:type", String)
710
- ], AgentStateInput.prototype, "state", void 0);
711
- AgentStateInput = _ts_decorate9([
712
- (0, import_type_graphql10.InputType)()
713
- ], AgentStateInput);
714
-
715
- // src/graphql/inputs/generate-copilot-response.input.ts
716
- function _ts_decorate10(decorators, target, key, desc) {
717
- var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
718
- if (typeof Reflect === "object" && typeof Reflect.decorate === "function")
719
- r = Reflect.decorate(decorators, target, key, desc);
720
- else
721
- for (var i = decorators.length - 1; i >= 0; i--)
722
- if (d = decorators[i])
723
- r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
724
- return c > 3 && r && Object.defineProperty(target, key, r), r;
725
- }
726
- __name(_ts_decorate10, "_ts_decorate");
727
- function _ts_metadata10(k, v) {
728
- if (typeof Reflect === "object" && typeof Reflect.metadata === "function")
729
- return Reflect.metadata(k, v);
730
- }
731
- __name(_ts_metadata10, "_ts_metadata");
732
- var GenerateCopilotResponseMetadataInput = class {
733
- requestType;
734
- };
735
- __name(GenerateCopilotResponseMetadataInput, "GenerateCopilotResponseMetadataInput");
736
- _ts_decorate10([
737
- (0, import_type_graphql11.Field)(() => CopilotRequestType, {
738
- nullable: true
739
- }),
740
- _ts_metadata10("design:type", typeof CopilotRequestType === "undefined" ? Object : CopilotRequestType)
741
- ], GenerateCopilotResponseMetadataInput.prototype, "requestType", void 0);
742
- GenerateCopilotResponseMetadataInput = _ts_decorate10([
743
- (0, import_type_graphql11.InputType)()
744
- ], GenerateCopilotResponseMetadataInput);
745
- var GenerateCopilotResponseInput = class {
746
- metadata;
747
- threadId;
748
- runId;
749
- messages;
750
- frontend;
751
- cloud;
752
- forwardedParameters;
753
- agentSession;
754
- agentState;
755
- agentStates;
756
- };
757
- __name(GenerateCopilotResponseInput, "GenerateCopilotResponseInput");
758
- _ts_decorate10([
759
- (0, import_type_graphql11.Field)(() => GenerateCopilotResponseMetadataInput, {
760
- nullable: false
761
- }),
762
- _ts_metadata10("design:type", typeof GenerateCopilotResponseMetadataInput === "undefined" ? Object : GenerateCopilotResponseMetadataInput)
763
- ], GenerateCopilotResponseInput.prototype, "metadata", void 0);
764
- _ts_decorate10([
765
- (0, import_type_graphql11.Field)(() => String, {
766
- nullable: true
767
- }),
768
- _ts_metadata10("design:type", String)
769
- ], GenerateCopilotResponseInput.prototype, "threadId", void 0);
770
- _ts_decorate10([
771
- (0, import_type_graphql11.Field)(() => String, {
772
- nullable: true
773
- }),
774
- _ts_metadata10("design:type", String)
775
- ], GenerateCopilotResponseInput.prototype, "runId", void 0);
776
- _ts_decorate10([
777
- (0, import_type_graphql11.Field)(() => [
778
- MessageInput
779
- ]),
780
- _ts_metadata10("design:type", Array)
781
- ], GenerateCopilotResponseInput.prototype, "messages", void 0);
782
- _ts_decorate10([
783
- (0, import_type_graphql11.Field)(() => FrontendInput),
784
- _ts_metadata10("design:type", typeof FrontendInput === "undefined" ? Object : FrontendInput)
785
- ], GenerateCopilotResponseInput.prototype, "frontend", void 0);
786
- _ts_decorate10([
787
- (0, import_type_graphql11.Field)(() => CloudInput, {
788
- nullable: true
789
- }),
790
- _ts_metadata10("design:type", typeof CloudInput === "undefined" ? Object : CloudInput)
791
- ], GenerateCopilotResponseInput.prototype, "cloud", void 0);
792
- _ts_decorate10([
793
- (0, import_type_graphql11.Field)(() => ForwardedParametersInput, {
794
- nullable: true
795
- }),
796
- _ts_metadata10("design:type", typeof ForwardedParametersInput === "undefined" ? Object : ForwardedParametersInput)
797
- ], GenerateCopilotResponseInput.prototype, "forwardedParameters", void 0);
798
- _ts_decorate10([
799
- (0, import_type_graphql11.Field)(() => AgentSessionInput, {
800
- nullable: true
801
- }),
802
- _ts_metadata10("design:type", typeof AgentSessionInput === "undefined" ? Object : AgentSessionInput)
803
- ], GenerateCopilotResponseInput.prototype, "agentSession", void 0);
804
- _ts_decorate10([
805
- (0, import_type_graphql11.Field)(() => AgentStateInput, {
806
- nullable: true
807
- }),
808
- _ts_metadata10("design:type", typeof AgentStateInput === "undefined" ? Object : AgentStateInput)
809
- ], GenerateCopilotResponseInput.prototype, "agentState", void 0);
810
- _ts_decorate10([
811
- (0, import_type_graphql11.Field)(() => [
812
- AgentStateInput
813
- ], {
814
- nullable: true
815
- }),
816
- _ts_metadata10("design:type", Array)
817
- ], GenerateCopilotResponseInput.prototype, "agentStates", void 0);
818
- GenerateCopilotResponseInput = _ts_decorate10([
819
- (0, import_type_graphql11.InputType)()
820
- ], GenerateCopilotResponseInput);
821
-
822
- // src/graphql/types/copilot-response.type.ts
823
- var import_type_graphql14 = require("type-graphql");
824
-
825
- // src/graphql/types/message-status.type.ts
826
- var import_type_graphql12 = require("type-graphql");
827
- function _ts_decorate11(decorators, target, key, desc) {
828
- var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
829
- if (typeof Reflect === "object" && typeof Reflect.decorate === "function")
830
- r = Reflect.decorate(decorators, target, key, desc);
831
- else
832
- for (var i = decorators.length - 1; i >= 0; i--)
833
- if (d = decorators[i])
834
- r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
835
- return c > 3 && r && Object.defineProperty(target, key, r), r;
836
- }
837
- __name(_ts_decorate11, "_ts_decorate");
838
- function _ts_metadata11(k, v) {
839
- if (typeof Reflect === "object" && typeof Reflect.metadata === "function")
840
- return Reflect.metadata(k, v);
841
- }
842
- __name(_ts_metadata11, "_ts_metadata");
843
- var MessageStatusCode;
844
- (function(MessageStatusCode2) {
845
- MessageStatusCode2["Pending"] = "pending";
846
- MessageStatusCode2["Success"] = "success";
847
- MessageStatusCode2["Failed"] = "failed";
848
- })(MessageStatusCode || (MessageStatusCode = {}));
849
- (0, import_type_graphql12.registerEnumType)(MessageStatusCode, {
850
- name: "MessageStatusCode"
851
- });
852
- var BaseMessageStatus = /* @__PURE__ */ __name(class BaseMessageStatus2 {
853
- code;
854
- }, "BaseMessageStatus");
855
- _ts_decorate11([
856
- (0, import_type_graphql12.Field)(() => MessageStatusCode),
857
- _ts_metadata11("design:type", String)
858
- ], BaseMessageStatus.prototype, "code", void 0);
859
- BaseMessageStatus = _ts_decorate11([
860
- (0, import_type_graphql12.ObjectType)()
861
- ], BaseMessageStatus);
862
- var PendingMessageStatus = class extends BaseMessageStatus {
863
- code = "pending";
864
- };
865
- __name(PendingMessageStatus, "PendingMessageStatus");
866
- PendingMessageStatus = _ts_decorate11([
867
- (0, import_type_graphql12.ObjectType)()
868
- ], PendingMessageStatus);
869
- var SuccessMessageStatus = class extends BaseMessageStatus {
870
- code = "success";
871
- };
872
- __name(SuccessMessageStatus, "SuccessMessageStatus");
873
- SuccessMessageStatus = _ts_decorate11([
874
- (0, import_type_graphql12.ObjectType)()
875
- ], SuccessMessageStatus);
876
- var FailedMessageStatus = class extends BaseMessageStatus {
877
- code = "failed";
878
- reason;
879
- };
880
- __name(FailedMessageStatus, "FailedMessageStatus");
881
- _ts_decorate11([
882
- (0, import_type_graphql12.Field)(() => String),
883
- _ts_metadata11("design:type", String)
884
- ], FailedMessageStatus.prototype, "reason", void 0);
885
- FailedMessageStatus = _ts_decorate11([
886
- (0, import_type_graphql12.ObjectType)()
887
- ], FailedMessageStatus);
888
- var MessageStatusUnion = (0, import_type_graphql12.createUnionType)({
889
- name: "MessageStatus",
890
- types: () => [
891
- PendingMessageStatus,
892
- SuccessMessageStatus,
893
- FailedMessageStatus
894
- ]
895
- });
896
-
897
- // src/graphql/types/response-status.type.ts
898
- var import_graphql_scalars = require("graphql-scalars");
899
- var import_type_graphql13 = require("type-graphql");
900
- function _ts_decorate12(decorators, target, key, desc) {
901
- var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
902
- if (typeof Reflect === "object" && typeof Reflect.decorate === "function")
903
- r = Reflect.decorate(decorators, target, key, desc);
904
- else
905
- for (var i = decorators.length - 1; i >= 0; i--)
906
- if (d = decorators[i])
907
- r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
908
- return c > 3 && r && Object.defineProperty(target, key, r), r;
909
- }
910
- __name(_ts_decorate12, "_ts_decorate");
911
- function _ts_metadata12(k, v) {
912
- if (typeof Reflect === "object" && typeof Reflect.metadata === "function")
913
- return Reflect.metadata(k, v);
914
- }
915
- __name(_ts_metadata12, "_ts_metadata");
916
- var ResponseStatusCode;
917
- (function(ResponseStatusCode2) {
918
- ResponseStatusCode2["Pending"] = "pending";
919
- ResponseStatusCode2["Success"] = "success";
920
- ResponseStatusCode2["Failed"] = "failed";
921
- })(ResponseStatusCode || (ResponseStatusCode = {}));
922
- (0, import_type_graphql13.registerEnumType)(ResponseStatusCode, {
923
- name: "ResponseStatusCode"
924
- });
925
- var BaseResponseStatus = /* @__PURE__ */ __name(class BaseResponseStatus2 {
926
- code;
927
- }, "BaseResponseStatus");
928
- _ts_decorate12([
929
- (0, import_type_graphql13.Field)(() => ResponseStatusCode),
930
- _ts_metadata12("design:type", String)
931
- ], BaseResponseStatus.prototype, "code", void 0);
932
- BaseResponseStatus = _ts_decorate12([
933
- (0, import_type_graphql13.InterfaceType)({
934
- resolveType(value) {
935
- if (value.code === "success") {
936
- return SuccessResponseStatus;
937
- } else if (value.code === "failed") {
938
- return FailedResponseStatus;
939
- } else if (value.code === "pending") {
940
- return PendingResponseStatus;
941
- }
942
- return void 0;
943
- }
944
- }),
945
- (0, import_type_graphql13.ObjectType)()
946
- ], BaseResponseStatus);
947
- var PendingResponseStatus = class extends BaseResponseStatus {
948
- code = "pending";
949
- };
950
- __name(PendingResponseStatus, "PendingResponseStatus");
951
- PendingResponseStatus = _ts_decorate12([
952
- (0, import_type_graphql13.ObjectType)({
953
- implements: BaseResponseStatus
954
- })
955
- ], PendingResponseStatus);
956
- var SuccessResponseStatus = class extends BaseResponseStatus {
957
- code = "success";
958
- };
959
- __name(SuccessResponseStatus, "SuccessResponseStatus");
960
- SuccessResponseStatus = _ts_decorate12([
961
- (0, import_type_graphql13.ObjectType)({
962
- implements: BaseResponseStatus
963
- })
964
- ], SuccessResponseStatus);
965
- var FailedResponseStatusReason;
966
- (function(FailedResponseStatusReason2) {
967
- FailedResponseStatusReason2["GUARDRAILS_VALIDATION_FAILED"] = "GUARDRAILS_VALIDATION_FAILED";
968
- FailedResponseStatusReason2["MESSAGE_STREAM_INTERRUPTED"] = "MESSAGE_STREAM_INTERRUPTED";
969
- FailedResponseStatusReason2["UNKNOWN_ERROR"] = "UNKNOWN_ERROR";
970
- })(FailedResponseStatusReason || (FailedResponseStatusReason = {}));
971
- (0, import_type_graphql13.registerEnumType)(FailedResponseStatusReason, {
972
- name: "FailedResponseStatusReason"
973
- });
974
- var FailedResponseStatus = class extends BaseResponseStatus {
975
- code = "failed";
976
- reason;
977
- details = null;
978
- };
979
- __name(FailedResponseStatus, "FailedResponseStatus");
980
- _ts_decorate12([
981
- (0, import_type_graphql13.Field)(() => FailedResponseStatusReason),
982
- _ts_metadata12("design:type", String)
983
- ], FailedResponseStatus.prototype, "reason", void 0);
984
- _ts_decorate12([
985
- (0, import_type_graphql13.Field)(() => import_graphql_scalars.GraphQLJSON, {
986
- nullable: true
987
- }),
988
- _ts_metadata12("design:type", typeof Record === "undefined" ? Object : Record)
989
- ], FailedResponseStatus.prototype, "details", void 0);
990
- FailedResponseStatus = _ts_decorate12([
991
- (0, import_type_graphql13.ObjectType)({
992
- implements: BaseResponseStatus
993
- })
994
- ], FailedResponseStatus);
995
- var ResponseStatusUnion = (0, import_type_graphql13.createUnionType)({
996
- name: "ResponseStatus",
997
- types: () => [
998
- PendingResponseStatus,
999
- SuccessResponseStatus,
1000
- FailedResponseStatus
1001
- ]
1002
- });
1003
-
1004
- // src/graphql/types/copilot-response.type.ts
1005
- function _ts_decorate13(decorators, target, key, desc) {
1006
- var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
1007
- if (typeof Reflect === "object" && typeof Reflect.decorate === "function")
1008
- r = Reflect.decorate(decorators, target, key, desc);
1009
- else
1010
- for (var i = decorators.length - 1; i >= 0; i--)
1011
- if (d = decorators[i])
1012
- r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
1013
- return c > 3 && r && Object.defineProperty(target, key, r), r;
1014
- }
1015
- __name(_ts_decorate13, "_ts_decorate");
1016
- function _ts_metadata13(k, v) {
1017
- if (typeof Reflect === "object" && typeof Reflect.metadata === "function")
1018
- return Reflect.metadata(k, v);
1019
- }
1020
- __name(_ts_metadata13, "_ts_metadata");
1021
- var BaseMessageOutput = /* @__PURE__ */ __name(class BaseMessageOutput2 {
1022
- id;
1023
- createdAt;
1024
- status;
1025
- }, "BaseMessageOutput");
1026
- _ts_decorate13([
1027
- (0, import_type_graphql14.Field)(() => String),
1028
- _ts_metadata13("design:type", String)
1029
- ], BaseMessageOutput.prototype, "id", void 0);
1030
- _ts_decorate13([
1031
- (0, import_type_graphql14.Field)(() => Date),
1032
- _ts_metadata13("design:type", typeof Date === "undefined" ? Object : Date)
1033
- ], BaseMessageOutput.prototype, "createdAt", void 0);
1034
- _ts_decorate13([
1035
- (0, import_type_graphql14.Field)(() => MessageStatusUnion),
1036
- _ts_metadata13("design:type", Object)
1037
- ], BaseMessageOutput.prototype, "status", void 0);
1038
- BaseMessageOutput = _ts_decorate13([
1039
- (0, import_type_graphql14.InterfaceType)({
1040
- resolveType(value) {
1041
- if (value.hasOwnProperty("content")) {
1042
- return TextMessageOutput;
1043
- } else if (value.hasOwnProperty("name")) {
1044
- return ActionExecutionMessageOutput;
1045
- } else if (value.hasOwnProperty("result")) {
1046
- return ResultMessageOutput;
1047
- } else if (value.hasOwnProperty("state")) {
1048
- return AgentStateMessageOutput;
1049
- }
1050
- return void 0;
1051
- }
1052
- })
1053
- ], BaseMessageOutput);
1054
- var TextMessageOutput = class {
1055
- role;
1056
- content;
1057
- };
1058
- __name(TextMessageOutput, "TextMessageOutput");
1059
- _ts_decorate13([
1060
- (0, import_type_graphql14.Field)(() => MessageRole),
1061
- _ts_metadata13("design:type", typeof MessageRole === "undefined" ? Object : MessageRole)
1062
- ], TextMessageOutput.prototype, "role", void 0);
1063
- _ts_decorate13([
1064
- (0, import_type_graphql14.Field)(() => [
1065
- String
1066
- ]),
1067
- _ts_metadata13("design:type", Array)
1068
- ], TextMessageOutput.prototype, "content", void 0);
1069
- TextMessageOutput = _ts_decorate13([
1070
- (0, import_type_graphql14.ObjectType)({
1071
- implements: BaseMessageOutput
1072
- })
1073
- ], TextMessageOutput);
1074
- var ActionExecutionMessageOutput = class {
1075
- name;
1076
- scope;
1077
- arguments;
1078
- };
1079
- __name(ActionExecutionMessageOutput, "ActionExecutionMessageOutput");
1080
- _ts_decorate13([
1081
- (0, import_type_graphql14.Field)(() => String),
1082
- _ts_metadata13("design:type", String)
1083
- ], ActionExecutionMessageOutput.prototype, "name", void 0);
1084
- _ts_decorate13([
1085
- (0, import_type_graphql14.Field)(() => ActionExecutionScope),
1086
- _ts_metadata13("design:type", typeof ActionExecutionScope === "undefined" ? Object : ActionExecutionScope)
1087
- ], ActionExecutionMessageOutput.prototype, "scope", void 0);
1088
- _ts_decorate13([
1089
- (0, import_type_graphql14.Field)(() => [
1090
- String
1091
- ]),
1092
- _ts_metadata13("design:type", Array)
1093
- ], ActionExecutionMessageOutput.prototype, "arguments", void 0);
1094
- ActionExecutionMessageOutput = _ts_decorate13([
1095
- (0, import_type_graphql14.ObjectType)({
1096
- implements: BaseMessageOutput
1097
- })
1098
- ], ActionExecutionMessageOutput);
1099
- var ResultMessageOutput = class {
1100
- actionExecutionId;
1101
- actionName;
1102
- result;
1103
- };
1104
- __name(ResultMessageOutput, "ResultMessageOutput");
1105
- _ts_decorate13([
1106
- (0, import_type_graphql14.Field)(() => String),
1107
- _ts_metadata13("design:type", String)
1108
- ], ResultMessageOutput.prototype, "actionExecutionId", void 0);
1109
- _ts_decorate13([
1110
- (0, import_type_graphql14.Field)(() => String),
1111
- _ts_metadata13("design:type", String)
1112
- ], ResultMessageOutput.prototype, "actionName", void 0);
1113
- _ts_decorate13([
1114
- (0, import_type_graphql14.Field)(() => String),
1115
- _ts_metadata13("design:type", String)
1116
- ], ResultMessageOutput.prototype, "result", void 0);
1117
- ResultMessageOutput = _ts_decorate13([
1118
- (0, import_type_graphql14.ObjectType)({
1119
- implements: BaseMessageOutput
1120
- })
1121
- ], ResultMessageOutput);
1122
- var AgentStateMessageOutput = class {
1123
- threadId;
1124
- agentName;
1125
- nodeName;
1126
- runId;
1127
- active;
1128
- role;
1129
- state;
1130
- running;
1131
- };
1132
- __name(AgentStateMessageOutput, "AgentStateMessageOutput");
1133
- _ts_decorate13([
1134
- (0, import_type_graphql14.Field)(() => String),
1135
- _ts_metadata13("design:type", String)
1136
- ], AgentStateMessageOutput.prototype, "threadId", void 0);
1137
- _ts_decorate13([
1138
- (0, import_type_graphql14.Field)(() => String),
1139
- _ts_metadata13("design:type", String)
1140
- ], AgentStateMessageOutput.prototype, "agentName", void 0);
1141
- _ts_decorate13([
1142
- (0, import_type_graphql14.Field)(() => String),
1143
- _ts_metadata13("design:type", String)
1144
- ], AgentStateMessageOutput.prototype, "nodeName", void 0);
1145
- _ts_decorate13([
1146
- (0, import_type_graphql14.Field)(() => String),
1147
- _ts_metadata13("design:type", String)
1148
- ], AgentStateMessageOutput.prototype, "runId", void 0);
1149
- _ts_decorate13([
1150
- (0, import_type_graphql14.Field)(() => Boolean),
1151
- _ts_metadata13("design:type", Boolean)
1152
- ], AgentStateMessageOutput.prototype, "active", void 0);
1153
- _ts_decorate13([
1154
- (0, import_type_graphql14.Field)(() => MessageRole),
1155
- _ts_metadata13("design:type", typeof MessageRole === "undefined" ? Object : MessageRole)
1156
- ], AgentStateMessageOutput.prototype, "role", void 0);
1157
- _ts_decorate13([
1158
- (0, import_type_graphql14.Field)(() => String),
1159
- _ts_metadata13("design:type", String)
1160
- ], AgentStateMessageOutput.prototype, "state", void 0);
1161
- _ts_decorate13([
1162
- (0, import_type_graphql14.Field)(() => Boolean),
1163
- _ts_metadata13("design:type", Boolean)
1164
- ], AgentStateMessageOutput.prototype, "running", void 0);
1165
- AgentStateMessageOutput = _ts_decorate13([
1166
- (0, import_type_graphql14.ObjectType)({
1167
- implements: BaseMessageOutput
1168
- })
1169
- ], AgentStateMessageOutput);
1170
- var CopilotResponse = class {
1171
- threadId;
1172
- status;
1173
- runId;
1174
- messages;
1175
- };
1176
- __name(CopilotResponse, "CopilotResponse");
1177
- _ts_decorate13([
1178
- (0, import_type_graphql14.Field)(() => String),
1179
- _ts_metadata13("design:type", String)
1180
- ], CopilotResponse.prototype, "threadId", void 0);
1181
- _ts_decorate13([
1182
- (0, import_type_graphql14.Field)(() => ResponseStatusUnion),
1183
- _ts_metadata13("design:type", Object)
1184
- ], CopilotResponse.prototype, "status", void 0);
1185
- _ts_decorate13([
1186
- (0, import_type_graphql14.Field)({
1187
- nullable: true
1188
- }),
1189
- _ts_metadata13("design:type", String)
1190
- ], CopilotResponse.prototype, "runId", void 0);
1191
- _ts_decorate13([
1192
- (0, import_type_graphql14.Field)(() => [
1193
- BaseMessageOutput
1194
- ]),
1195
- _ts_metadata13("design:type", Array)
1196
- ], CopilotResponse.prototype, "messages", void 0);
1197
- CopilotResponse = _ts_decorate13([
1198
- (0, import_type_graphql14.ObjectType)()
1199
- ], CopilotResponse);
1200
-
1201
- // src/graphql/resolvers/copilot.resolver.ts
1202
- var import_graphql_yoga = require("graphql-yoga");
1203
-
1204
- // src/service-adapters/events.ts
1205
- var import_shared3 = require("@copilotkit/shared");
1206
- var import_rxjs2 = require("rxjs");
1207
-
1208
- // src/lib/telemetry-client.ts
1209
- var import_shared2 = require("@copilotkit/shared");
1210
-
1211
- // src/lib/runtime/remote-actions.ts
1212
- var EndpointType;
1213
- (function(EndpointType2) {
1214
- EndpointType2["CopilotKit"] = "copilotKit";
1215
- EndpointType2["LangGraphPlatform"] = "langgraph-platform";
1216
- })(EndpointType || (EndpointType = {}));
1217
-
1218
- // src/lib/telemetry-client.ts
1219
- var import_node_crypto = require("crypto");
1220
-
1221
- // src/lib/runtime/copilot-runtime.ts
1222
- var import_shared = require("@copilotkit/shared");
1223
-
1224
- // src/graphql/types/converted/index.ts
1225
- var Message = class extends BaseMessageInput {
1226
- type;
1227
- isTextMessage() {
1228
- return this.type === "TextMessage";
1229
- }
1230
- isActionExecutionMessage() {
1231
- return this.type === "ActionExecutionMessage";
1232
- }
1233
- isResultMessage() {
1234
- return this.type === "ResultMessage";
1235
- }
1236
- isAgentStateMessage() {
1237
- return this.type === "AgentStateMessage";
1238
- }
1239
- };
1240
- __name(Message, "Message");
1241
- var TextMessage = class extends Message {
1242
- type = "TextMessage";
1243
- content;
1244
- role;
1245
- };
1246
- __name(TextMessage, "TextMessage");
1247
- var ActionExecutionMessage = class extends Message {
1248
- type = "ActionExecutionMessage";
1249
- name;
1250
- arguments;
1251
- scope;
1252
- };
1253
- __name(ActionExecutionMessage, "ActionExecutionMessage");
1254
- var ResultMessage = class extends Message {
1255
- type = "ResultMessage";
1256
- actionExecutionId;
1257
- actionName;
1258
- result;
1259
- };
1260
- __name(ResultMessage, "ResultMessage");
1261
- var AgentStateMessage = class extends Message {
1262
- type = "AgentStateMessage";
1263
- threadId;
1264
- agentName;
1265
- nodeName;
1266
- runId;
1267
- active;
1268
- role;
1269
- state;
1270
- running;
1271
- };
1272
- __name(AgentStateMessage, "AgentStateMessage");
1273
-
1274
- // src/lib/runtime/copilot-runtime.ts
1275
- var import_rxjs = require("rxjs");
1276
- function resolveEndpointType(endpoint) {
1277
- if (!endpoint.type) {
1278
- if ("langsmithApiKey" in endpoint && "deploymentUrl" in endpoint && "agents" in endpoint) {
1279
- return EndpointType.LangGraphPlatform;
1280
- } else {
1281
- return EndpointType.CopilotKit;
1282
- }
1283
- }
1284
- return endpoint.type;
1285
- }
1286
- __name(resolveEndpointType, "resolveEndpointType");
1287
-
1288
- // src/lib/telemetry-client.ts
1289
- var packageJson = require_package();
1290
- var telemetryClient = new import_shared2.TelemetryClient({
1291
- packageName: packageJson.name,
1292
- packageVersion: packageJson.version
1293
- });
1294
- function getRuntimeInstanceTelemetryInfo(runtime) {
1295
- const endpointsInfo = runtime.remoteEndpointDefinitions.reduce((acc, endpoint) => {
1296
- let info = {
1297
- ...acc
1298
- };
1299
- const endpointType = resolveEndpointType(endpoint);
1300
- if (!info.endpointTypes.includes(endpointType)) {
1301
- info = {
1302
- ...info,
1303
- endpointTypes: [
1304
- ...info.endpointTypes,
1305
- endpointType
1306
- ]
1307
- };
1308
- }
1309
- if (endpointType === EndpointType.LangGraphPlatform) {
1310
- const ep = endpoint;
1311
- info = {
1312
- ...info,
1313
- agentsAmount: ep.agents.length,
1314
- hashedKey: (0, import_node_crypto.createHash)("sha256").update(ep.langsmithApiKey).digest("hex")
1315
- };
1316
- }
1317
- return info;
1318
- }, {
1319
- endpointTypes: [],
1320
- agentsAmount: null,
1321
- hashedKey: null
1322
- });
1323
- return {
1324
- actionsAmount: runtime.actions.length,
1325
- endpointsAmount: runtime.remoteEndpointDefinitions.length,
1326
- endpointTypes: endpointsInfo.endpointTypes,
1327
- agentsAmount: endpointsInfo.agentsAmount,
1328
- hashedLgcKey: endpointsInfo.hashedKey
1329
- };
1330
- }
1331
- __name(getRuntimeInstanceTelemetryInfo, "getRuntimeInstanceTelemetryInfo");
1332
- var telemetry_client_default = telemetryClient;
1333
-
1334
- // src/service-adapters/events.ts
1335
- var RuntimeEventTypes;
1336
- (function(RuntimeEventTypes2) {
1337
- RuntimeEventTypes2["TextMessageStart"] = "TextMessageStart";
1338
- RuntimeEventTypes2["TextMessageContent"] = "TextMessageContent";
1339
- RuntimeEventTypes2["TextMessageEnd"] = "TextMessageEnd";
1340
- RuntimeEventTypes2["ActionExecutionStart"] = "ActionExecutionStart";
1341
- RuntimeEventTypes2["ActionExecutionArgs"] = "ActionExecutionArgs";
1342
- RuntimeEventTypes2["ActionExecutionEnd"] = "ActionExecutionEnd";
1343
- RuntimeEventTypes2["ActionExecutionResult"] = "ActionExecutionResult";
1344
- RuntimeEventTypes2["AgentStateMessage"] = "AgentStateMessage";
1345
- })(RuntimeEventTypes || (RuntimeEventTypes = {}));
1346
-
1347
- // src/graphql/resolvers/copilot.resolver.ts
1348
- var import_graphql_scalars2 = require("graphql-scalars");
1349
- var import_class_transformer = require("class-transformer");
1350
- var import_graphql = require("graphql");
1351
-
1352
- // src/utils/failed-response-status-reasons.ts
1353
- var GuardrailsValidationFailureResponse = class extends FailedResponseStatus {
1354
- reason = FailedResponseStatusReason.GUARDRAILS_VALIDATION_FAILED;
1355
- constructor({ guardrailsReason }) {
1356
- super();
1357
- this.details = {
1358
- guardrailsReason
1359
- };
1360
- }
1361
- };
1362
- __name(GuardrailsValidationFailureResponse, "GuardrailsValidationFailureResponse");
1363
- var MessageStreamInterruptedResponse = class extends FailedResponseStatus {
1364
- reason = FailedResponseStatusReason.MESSAGE_STREAM_INTERRUPTED;
1365
- constructor({ messageId }) {
1366
- super();
1367
- this.details = {
1368
- messageId,
1369
- description: "Check the message for mode details"
1370
- };
1371
- }
1372
- };
1373
- __name(MessageStreamInterruptedResponse, "MessageStreamInterruptedResponse");
1374
- var UnknownErrorResponse = class extends FailedResponseStatus {
1375
- reason = FailedResponseStatusReason.UNKNOWN_ERROR;
1376
- constructor({ description }) {
1377
- super();
1378
- this.details = {
1379
- description
1380
- };
1381
- }
1382
- };
1383
- __name(UnknownErrorResponse, "UnknownErrorResponse");
1384
-
1385
- // src/graphql/resolvers/copilot.resolver.ts
1386
- var import_shared4 = require("@copilotkit/shared");
1387
- function _ts_decorate14(decorators, target, key, desc) {
1388
- var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
1389
- if (typeof Reflect === "object" && typeof Reflect.decorate === "function")
1390
- r = Reflect.decorate(decorators, target, key, desc);
1391
- else
1392
- for (var i = decorators.length - 1; i >= 0; i--)
1393
- if (d = decorators[i])
1394
- r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
1395
- return c > 3 && r && Object.defineProperty(target, key, r), r;
1396
- }
1397
- __name(_ts_decorate14, "_ts_decorate");
1398
- function _ts_metadata14(k, v) {
1399
- if (typeof Reflect === "object" && typeof Reflect.metadata === "function")
1400
- return Reflect.metadata(k, v);
1401
- }
1402
- __name(_ts_metadata14, "_ts_metadata");
1403
- function _ts_param(paramIndex, decorator) {
1404
- return function(target, key) {
1405
- decorator(target, key, paramIndex);
1406
- };
1407
- }
1408
- __name(_ts_param, "_ts_param");
1409
- var invokeGuardrails = /* @__PURE__ */ __name(async ({ baseUrl, copilotCloudPublicApiKey, data, onResult, onError }) => {
1410
- var _a;
1411
- if (data.messages.length && ((_a = data.messages[data.messages.length - 1].textMessage) == null ? void 0 : _a.role) === MessageRole.user) {
1412
- const messages = data.messages.filter((m) => m.textMessage !== void 0 && (m.textMessage.role === MessageRole.user || m.textMessage.role === MessageRole.assistant)).map((m) => ({
1413
- role: m.textMessage.role,
1414
- content: m.textMessage.content
1415
- }));
1416
- const lastMessage = messages[messages.length - 1];
1417
- const restOfMessages = messages.slice(0, -1);
1418
- const body = {
1419
- input: lastMessage.content,
1420
- validTopics: data.cloud.guardrails.inputValidationRules.allowList,
1421
- invalidTopics: data.cloud.guardrails.inputValidationRules.denyList,
1422
- messages: restOfMessages
1423
- };
1424
- const guardrailsResult = await fetch(`${baseUrl}/guardrails/validate`, {
1425
- method: "POST",
1426
- headers: {
1427
- "Content-Type": "application/json",
1428
- "X-CopilotCloud-Public-API-Key": copilotCloudPublicApiKey
1429
- },
1430
- body: JSON.stringify(body)
1431
- });
1432
- if (guardrailsResult.ok) {
1433
- const resultJson = await guardrailsResult.json();
1434
- onResult(resultJson);
1435
- } else {
1436
- onError(await guardrailsResult.json());
1437
- }
1438
- }
1439
- }, "invokeGuardrails");
1440
- var CopilotResolver = class {
1441
- async hello() {
1442
- return "Hello World";
1443
- }
1444
- async generateCopilotResponse(ctx, data, properties) {
1445
- var _a, _b, _c;
1446
- telemetry_client_default.capture("oss.runtime.copilot_request_created", {
1447
- "cloud.guardrails.enabled": ((_a = data.cloud) == null ? void 0 : _a.guardrails) !== void 0,
1448
- requestType: data.metadata.requestType
1449
- });
1450
- let logger2 = ctx.logger.child({
1451
- component: "CopilotResolver.generateCopilotResponse"
1452
- });
1453
- logger2.debug({
1454
- data
1455
- }, "Generating Copilot response");
1456
- if (properties) {
1457
- logger2.debug("Properties provided, merging with context properties");
1458
- ctx.properties = {
1459
- ...ctx.properties,
1460
- ...properties
1461
- };
1462
- }
1463
- const copilotRuntime = ctx._copilotkit.runtime;
1464
- const serviceAdapter = ctx._copilotkit.serviceAdapter;
1465
- let copilotCloudPublicApiKey = null;
1466
- let copilotCloudBaseUrl;
1467
- if (data.cloud) {
1468
- logger2 = logger2.child({
1469
- cloud: true
1470
- });
1471
- logger2.debug("Cloud configuration provided, checking for public API key in headers");
1472
- const key = ctx.request.headers.get("x-copilotcloud-public-api-key");
1473
- if (key) {
1474
- logger2.debug("Public API key found in headers");
1475
- copilotCloudPublicApiKey = key;
1476
- } else {
1477
- logger2.error("Public API key not found in headers");
1478
- throw new import_graphql.GraphQLError("X-CopilotCloud-Public-API-Key header is required");
1479
- }
1480
- if (process.env.COPILOT_CLOUD_BASE_URL) {
1481
- copilotCloudBaseUrl = process.env.COPILOT_CLOUD_BASE_URL;
1482
- } else if ((_b = ctx._copilotkit.cloud) == null ? void 0 : _b.baseUrl) {
1483
- copilotCloudBaseUrl = (_c = ctx._copilotkit.cloud) == null ? void 0 : _c.baseUrl;
1484
- } else {
1485
- copilotCloudBaseUrl = "https://api.cloud.copilotkit.ai";
1486
- }
1487
- logger2 = logger2.child({
1488
- copilotCloudBaseUrl
1489
- });
1490
- }
1491
- logger2.debug("Setting up subjects");
1492
- const responseStatus$ = new import_rxjs3.ReplaySubject();
1493
- const interruptStreaming$ = new import_rxjs3.ReplaySubject();
1494
- const guardrailsResult$ = new import_rxjs3.ReplaySubject();
1495
- let outputMessages = [];
1496
- let resolveOutputMessagesPromise;
1497
- let rejectOutputMessagesPromise;
1498
- const outputMessagesPromise = new Promise((resolve, reject) => {
1499
- resolveOutputMessagesPromise = resolve;
1500
- rejectOutputMessagesPromise = reject;
1501
- });
1502
- logger2.debug("Processing");
1503
- const { eventSource, threadId = (0, import_shared4.randomId)(), runId, serverSideActions, actionInputsWithoutAgents } = await copilotRuntime.processRuntimeRequest({
1504
- serviceAdapter,
1505
- messages: data.messages,
1506
- actions: data.frontend.actions.filter((action) => action.available !== ActionInputAvailability.disabled),
1507
- threadId: data.threadId,
1508
- runId: data.runId,
1509
- publicApiKey: void 0,
1510
- outputMessagesPromise,
1511
- graphqlContext: ctx,
1512
- forwardedParameters: data.forwardedParameters,
1513
- agentSession: data.agentSession,
1514
- agentStates: data.agentStates,
1515
- url: data.frontend.url
1516
- });
1517
- logger2.debug("Event source created, creating response");
1518
- const response = {
1519
- threadId,
1520
- runId,
1521
- status: (0, import_rxjs3.firstValueFrom)(responseStatus$),
1522
- messages: new import_graphql_yoga.Repeater(async (pushMessage, stopStreamingMessages) => {
1523
- var _a2, _b2;
1524
- logger2.debug("Messages repeater created");
1525
- if ((_a2 = data.cloud) == null ? void 0 : _a2.guardrails) {
1526
- logger2 = logger2.child({
1527
- guardrails: true
1528
- });
1529
- logger2.debug("Guardrails is enabled, validating input");
1530
- invokeGuardrails({
1531
- baseUrl: copilotCloudBaseUrl,
1532
- copilotCloudPublicApiKey,
1533
- data,
1534
- onResult: (result) => {
1535
- logger2.debug({
1536
- status: result.status
1537
- }, "Guardrails validation done");
1538
- guardrailsResult$.next(result);
1539
- if (result.status === "denied") {
1540
- responseStatus$.next(new GuardrailsValidationFailureResponse({
1541
- guardrailsReason: result.reason
1542
- }));
1543
- interruptStreaming$.next({
1544
- reason: `Interrupted due to Guardrails validation failure. Reason: ${result.reason}`
1545
- });
1546
- outputMessages = [
1547
- (0, import_class_transformer.plainToInstance)(TextMessage, {
1548
- id: (0, import_shared4.randomId)(),
1549
- createdAt: /* @__PURE__ */ new Date(),
1550
- content: result.reason,
1551
- role: MessageRole.assistant
1552
- })
1553
- ];
1554
- resolveOutputMessagesPromise(outputMessages);
1555
- }
1556
- },
1557
- onError: (err) => {
1558
- logger2.error({
1559
- err
1560
- }, "Error in guardrails validation");
1561
- responseStatus$.next(new UnknownErrorResponse({
1562
- description: `An unknown error has occurred in the guardrails validation`
1563
- }));
1564
- interruptStreaming$.next({
1565
- reason: `Interrupted due to unknown error in guardrails validation`
1566
- });
1567
- rejectOutputMessagesPromise(err);
1568
- }
1569
- });
1570
- }
1571
- let eventStreamSubscription;
1572
- const eventStream = eventSource.processRuntimeEvents({
1573
- serverSideActions,
1574
- guardrailsResult$: ((_b2 = data.cloud) == null ? void 0 : _b2.guardrails) ? guardrailsResult$ : null,
1575
- actionInputsWithoutAgents: actionInputsWithoutAgents.filter(
1576
- // TODO-AGENTS: do not exclude ALL server side actions
1577
- (action) => !serverSideActions.find((serverSideAction) => serverSideAction.name == action.name)
1578
- )
1579
- }).pipe(
1580
- // shareReplay() ensures that later subscribers will see the whole stream instead of
1581
- // just the events that were emitted after the subscriber was added.
1582
- (0, import_rxjs3.shareReplay)(),
1583
- (0, import_rxjs3.finalize)(() => {
1584
- logger2.debug("Event stream finalized");
1585
- })
1586
- );
1587
- logger2.debug("Event stream created, subscribing to event stream");
1588
- eventStreamSubscription = eventStream.subscribe({
1589
- next: async (event) => {
1590
- switch (event.type) {
1591
- case RuntimeEventTypes.TextMessageStart:
1592
- const textMessageContentStream = eventStream.pipe(
1593
- // skip until this message start event
1594
- (0, import_rxjs3.skipWhile)((e) => e !== event),
1595
- // take until the message end event
1596
- (0, import_rxjs3.takeWhile)((e) => e.type != RuntimeEventTypes.TextMessageEnd)
1597
- );
1598
- const streamingTextStatus = new import_rxjs3.Subject();
1599
- const messageId = event.messageId;
1600
- pushMessage({
1601
- id: messageId,
1602
- status: (0, import_rxjs3.firstValueFrom)(streamingTextStatus),
1603
- createdAt: /* @__PURE__ */ new Date(),
1604
- role: MessageRole.assistant,
1605
- content: new import_graphql_yoga.Repeater(async (pushTextChunk, stopStreamingText) => {
1606
- logger2.debug("Text message content repeater created");
1607
- const textChunks = [];
1608
- let textSubscription;
1609
- interruptStreaming$.pipe((0, import_rxjs3.shareReplay)(), (0, import_rxjs3.take)(1), (0, import_rxjs3.tap)(({ reason, messageId: messageId2 }) => {
1610
- logger2.debug({
1611
- reason,
1612
- messageId: messageId2
1613
- }, "Text streaming interrupted");
1614
- streamingTextStatus.next((0, import_class_transformer.plainToInstance)(FailedMessageStatus, {
1615
- reason
1616
- }));
1617
- responseStatus$.next(new MessageStreamInterruptedResponse({
1618
- messageId: messageId2
1619
- }));
1620
- stopStreamingText();
1621
- textSubscription == null ? void 0 : textSubscription.unsubscribe();
1622
- })).subscribe();
1623
- logger2.debug("Subscribing to text message content stream");
1624
- textSubscription = textMessageContentStream.subscribe({
1625
- next: async (e) => {
1626
- if (e.type == RuntimeEventTypes.TextMessageContent) {
1627
- await pushTextChunk(e.content);
1628
- textChunks.push(e.content);
1629
- }
1630
- },
1631
- error: (err) => {
1632
- logger2.error({
1633
- err
1634
- }, "Error in text message content stream");
1635
- interruptStreaming$.next({
1636
- reason: "Error streaming message content",
1637
- messageId
1638
- });
1639
- stopStreamingText();
1640
- textSubscription == null ? void 0 : textSubscription.unsubscribe();
1641
- },
1642
- complete: () => {
1643
- logger2.debug("Text message content stream completed");
1644
- streamingTextStatus.next(new SuccessMessageStatus());
1645
- stopStreamingText();
1646
- textSubscription == null ? void 0 : textSubscription.unsubscribe();
1647
- outputMessages.push((0, import_class_transformer.plainToInstance)(TextMessage, {
1648
- id: messageId,
1649
- createdAt: /* @__PURE__ */ new Date(),
1650
- content: textChunks.join(""),
1651
- role: MessageRole.assistant
1652
- }));
1653
- }
1654
- });
1655
- })
1656
- });
1657
- break;
1658
- case RuntimeEventTypes.ActionExecutionStart:
1659
- logger2.debug("Action execution start event received");
1660
- const actionExecutionArgumentStream = eventStream.pipe((0, import_rxjs3.skipWhile)((e) => e !== event), (0, import_rxjs3.takeWhile)((e) => e.type != RuntimeEventTypes.ActionExecutionEnd));
1661
- const streamingArgumentsStatus = new import_rxjs3.Subject();
1662
- pushMessage({
1663
- id: event.actionExecutionId,
1664
- status: (0, import_rxjs3.firstValueFrom)(streamingArgumentsStatus),
1665
- createdAt: /* @__PURE__ */ new Date(),
1666
- name: event.actionName,
1667
- scope: event.scope,
1668
- arguments: new import_graphql_yoga.Repeater(async (pushArgumentsChunk, stopStreamingArguments) => {
1669
- logger2.debug("Action execution argument stream created");
1670
- const argumentChunks = [];
1671
- let actionExecutionArgumentSubscription;
1672
- actionExecutionArgumentSubscription = actionExecutionArgumentStream.subscribe({
1673
- next: async (e) => {
1674
- if (e.type == RuntimeEventTypes.ActionExecutionArgs) {
1675
- await pushArgumentsChunk(e.args);
1676
- argumentChunks.push(e.args);
1677
- }
1678
- },
1679
- error: (err) => {
1680
- logger2.error({
1681
- err
1682
- }, "Error in action execution argument stream");
1683
- streamingArgumentsStatus.next((0, import_class_transformer.plainToInstance)(FailedMessageStatus, {
1684
- reason: "An unknown error has occurred in the action execution argument stream"
1685
- }));
1686
- stopStreamingArguments();
1687
- actionExecutionArgumentSubscription == null ? void 0 : actionExecutionArgumentSubscription.unsubscribe();
1688
- },
1689
- complete: () => {
1690
- logger2.debug("Action execution argument stream completed");
1691
- streamingArgumentsStatus.next(new SuccessMessageStatus());
1692
- stopStreamingArguments();
1693
- actionExecutionArgumentSubscription == null ? void 0 : actionExecutionArgumentSubscription.unsubscribe();
1694
- outputMessages.push((0, import_class_transformer.plainToInstance)(ActionExecutionMessage, {
1695
- id: event.actionExecutionId,
1696
- createdAt: /* @__PURE__ */ new Date(),
1697
- name: event.actionName,
1698
- scope: event.scope,
1699
- arguments: argumentChunks.join("")
1700
- }));
1701
- }
1702
- });
1703
- })
1704
- });
1705
- break;
1706
- case RuntimeEventTypes.ActionExecutionResult:
1707
- logger2.debug({
1708
- result: event.result
1709
- }, "Action execution result event received");
1710
- pushMessage({
1711
- id: (0, import_shared4.randomId)(),
1712
- status: new SuccessMessageStatus(),
1713
- createdAt: /* @__PURE__ */ new Date(),
1714
- actionExecutionId: event.actionExecutionId,
1715
- actionName: event.actionName,
1716
- result: event.result
1717
- });
1718
- outputMessages.push((0, import_class_transformer.plainToInstance)(ResultMessage, {
1719
- id: (0, import_shared4.randomId)(),
1720
- createdAt: /* @__PURE__ */ new Date(),
1721
- actionExecutionId: event.actionExecutionId,
1722
- actionName: event.actionName,
1723
- result: event.result
1724
- }));
1725
- break;
1726
- case RuntimeEventTypes.AgentStateMessage:
1727
- logger2.debug({
1728
- event
1729
- }, "Agent message event received");
1730
- pushMessage({
1731
- id: (0, import_shared4.randomId)(),
1732
- status: new SuccessMessageStatus(),
1733
- threadId: event.threadId,
1734
- agentName: event.agentName,
1735
- nodeName: event.nodeName,
1736
- runId: event.runId,
1737
- active: event.active,
1738
- state: event.state,
1739
- running: event.running,
1740
- role: MessageRole.assistant,
1741
- createdAt: /* @__PURE__ */ new Date()
1742
- });
1743
- outputMessages.push((0, import_class_transformer.plainToInstance)(AgentStateMessage, {
1744
- id: (0, import_shared4.randomId)(),
1745
- threadId: event.threadId,
1746
- agentName: event.agentName,
1747
- nodeName: event.nodeName,
1748
- runId: event.runId,
1749
- active: event.active,
1750
- state: event.state,
1751
- running: event.running,
1752
- role: MessageRole.assistant,
1753
- createdAt: /* @__PURE__ */ new Date()
1754
- }));
1755
- break;
1756
- }
1757
- },
1758
- error: (err) => {
1759
- logger2.error({
1760
- err
1761
- }, "Error in event stream");
1762
- responseStatus$.next(new UnknownErrorResponse({
1763
- description: `An unknown error has occurred in the event stream`
1764
- }));
1765
- eventStreamSubscription == null ? void 0 : eventStreamSubscription.unsubscribe();
1766
- stopStreamingMessages();
1767
- rejectOutputMessagesPromise(err);
1768
- },
1769
- complete: async () => {
1770
- var _a3;
1771
- logger2.debug("Event stream completed");
1772
- if ((_a3 = data.cloud) == null ? void 0 : _a3.guardrails) {
1773
- logger2.debug("Guardrails is enabled, waiting for guardrails result");
1774
- await (0, import_rxjs3.firstValueFrom)(guardrailsResult$);
1775
- }
1776
- responseStatus$.next(new SuccessResponseStatus());
1777
- eventStreamSubscription == null ? void 0 : eventStreamSubscription.unsubscribe();
1778
- stopStreamingMessages();
1779
- resolveOutputMessagesPromise(outputMessages);
1780
- }
1781
- });
1782
- })
1783
- };
1784
- return response;
1785
- }
1786
- };
1787
- __name(CopilotResolver, "CopilotResolver");
1788
- _ts_decorate14([
1789
- (0, import_type_graphql15.Query)(() => String),
1790
- _ts_metadata14("design:type", Function),
1791
- _ts_metadata14("design:paramtypes", []),
1792
- _ts_metadata14("design:returntype", Promise)
1793
- ], CopilotResolver.prototype, "hello", null);
1794
- _ts_decorate14([
1795
- (0, import_type_graphql15.Mutation)(() => CopilotResponse),
1796
- _ts_param(0, (0, import_type_graphql15.Ctx)()),
1797
- _ts_param(1, (0, import_type_graphql15.Arg)("data")),
1798
- _ts_param(2, (0, import_type_graphql15.Arg)("properties", () => import_graphql_scalars2.GraphQLJSONObject, {
1799
- nullable: true
1800
- })),
1801
- _ts_metadata14("design:type", Function),
1802
- _ts_metadata14("design:paramtypes", [
1803
- typeof GraphQLContext === "undefined" ? Object : GraphQLContext,
1804
- typeof GenerateCopilotResponseInput === "undefined" ? Object : GenerateCopilotResponseInput,
1805
- typeof CopilotRequestContextProperties === "undefined" ? Object : CopilotRequestContextProperties
1806
- ]),
1807
- _ts_metadata14("design:returntype", Promise)
1808
- ], CopilotResolver.prototype, "generateCopilotResponse", null);
1809
- CopilotResolver = _ts_decorate14([
1810
- (0, import_type_graphql15.Resolver)(() => CopilotResponse)
1811
- ], CopilotResolver);
1812
-
1813
- // src/lib/integrations/shared.ts
1814
- var import_plugin_defer_stream = require("@graphql-yoga/plugin-defer-stream");
1815
-
1816
- // src/lib/logger.ts
1817
- var import_pino = __toESM(require("pino"));
1818
- var import_pino_pretty = __toESM(require("pino-pretty"));
1819
- function createLogger(options) {
1820
- const { level, component } = options || {};
1821
- const stream = (0, import_pino_pretty.default)({
1822
- colorize: true
1823
- });
1824
- const logger2 = (0, import_pino.default)({
1825
- level: process.env.LOG_LEVEL || level || "error",
1826
- redact: {
1827
- paths: [
1828
- "pid",
1829
- "hostname"
1830
- ],
1831
- remove: true
1832
- }
1833
- }, stream);
1834
- if (component) {
1835
- return logger2.child({
1836
- component
1837
- });
1838
- } else {
1839
- return logger2;
1840
- }
1841
- }
1842
- __name(createLogger, "createLogger");
1843
-
1844
- // src/lib/integrations/shared.ts
1845
- var logger = createLogger();
1846
- async function createContext(initialContext, copilotKitContext, contextLogger, properties = {}) {
1847
- logger.debug({
1848
- copilotKitContext
1849
- }, "Creating GraphQL context");
1850
- const ctx = {
1851
- ...initialContext,
1852
- _copilotkit: {
1853
- ...copilotKitContext
1854
- },
1855
- properties: {
1856
- ...properties
1857
- },
1858
- logger: contextLogger
1859
- };
1860
- return ctx;
1861
- }
1862
- __name(createContext, "createContext");
1863
- function buildSchema(options = {}) {
1864
- logger.debug("Building GraphQL schema...");
1865
- const schema = (0, import_type_graphql16.buildSchemaSync)({
1866
- resolvers: [
1867
- CopilotResolver
1868
- ],
1869
- emitSchemaFile: options.emitSchemaFile
1870
- });
1871
- logger.debug("GraphQL schema built successfully");
1872
- return schema;
1873
- }
1874
- __name(buildSchema, "buildSchema");
1875
- function getCommonConfig(options) {
1876
- var _a;
1877
- const logLevel = process.env.LOG_LEVEL || options.logLevel || "error";
1878
- const logger2 = createLogger({
1879
- level: logLevel,
1880
- component: "getCommonConfig"
1881
- });
1882
- const contextLogger = createLogger({
1883
- level: logLevel
1884
- });
1885
- if (options.cloud) {
1886
- telemetry_client_default.setCloudConfiguration({
1887
- publicApiKey: options.cloud.publicApiKey,
1888
- baseUrl: options.cloud.baseUrl
1889
- });
1890
- }
1891
- if ((_a = options.properties) == null ? void 0 : _a._copilotkit) {
1892
- telemetry_client_default.setGlobalProperties({
1893
- _copilotkit: {
1894
- ...options.properties._copilotkit
1895
- }
1896
- });
1897
- }
1898
- telemetry_client_default.setGlobalProperties({
1899
- runtime: {
1900
- serviceAdapter: options.serviceAdapter.constructor.name
1901
- }
1902
- });
1903
- return {
1904
- logging: createLogger({
1905
- component: "Yoga GraphQL",
1906
- level: logLevel
1907
- }),
1908
- schema: buildSchema(),
1909
- plugins: [
1910
- (0, import_plugin_defer_stream.useDeferStream)()
1911
- ],
1912
- context: (ctx) => createContext(ctx, options, contextLogger, options.properties)
1913
- };
1914
- }
1915
- __name(getCommonConfig, "getCommonConfig");
1916
-
1917
- // src/lib/integrations/nextjs/app-router.ts
1918
- var import_graphql_yoga2 = require("graphql-yoga");
1919
- function copilotRuntimeNextJSAppRouterEndpoint(options) {
1920
- var _a;
1921
- const commonConfig = getCommonConfig(options);
1922
- telemetry_client_default.setGlobalProperties({
1923
- runtime: {
1924
- framework: "nextjs-app-router"
1925
- }
1926
- });
1927
- if ((_a = options.properties) == null ? void 0 : _a._copilotkit) {
1928
- telemetry_client_default.setGlobalProperties({
1929
- _copilotkit: options.properties._copilotkit
1930
- });
1931
- }
1932
- telemetry_client_default.capture("oss.runtime.instance_created", getRuntimeInstanceTelemetryInfo(options.runtime));
1933
- const logger2 = commonConfig.logging;
1934
- logger2.debug("Creating NextJS App Router endpoint");
1935
- const yoga = (0, import_graphql_yoga2.createYoga)({
1936
- ...commonConfig,
1937
- graphqlEndpoint: options.endpoint,
1938
- fetchAPI: {
1939
- Response: globalThis.Response
1940
- }
1941
- });
1942
- return {
1943
- handleRequest: yoga,
1944
- GET: yoga,
1945
- POST: yoga,
1946
- OPTIONS: yoga
1947
- };
1948
- }
1949
- __name(copilotRuntimeNextJSAppRouterEndpoint, "copilotRuntimeNextJSAppRouterEndpoint");
1950
-
1951
- // src/lib/integrations/nextjs/pages-router.ts
1952
- var import_graphql_yoga3 = require("graphql-yoga");
1953
- var config = {
1954
- api: {
1955
- bodyParser: false
1956
- }
1957
- };
1958
- function copilotRuntimeNextJSPagesRouterEndpoint(options) {
1959
- var _a;
1960
- const commonConfig = getCommonConfig(options);
1961
- telemetry_client_default.setGlobalProperties({
1962
- runtime: {
1963
- framework: "nextjs-pages-router"
1964
- }
1965
- });
1966
- if ((_a = options.properties) == null ? void 0 : _a._copilotkit) {
1967
- telemetry_client_default.setGlobalProperties({
1968
- _copilotkit: options.properties._copilotkit
1969
- });
1970
- }
1971
- telemetry_client_default.capture("oss.runtime.instance_created", getRuntimeInstanceTelemetryInfo(options.runtime));
1972
- const logger2 = commonConfig.logging;
1973
- logger2.debug("Creating NextJS Pages Router endpoint");
1974
- const yoga = (0, import_graphql_yoga3.createYoga)({
1975
- ...commonConfig,
1976
- graphqlEndpoint: options.endpoint
1977
- });
1978
- return yoga;
1979
- }
1980
- __name(copilotRuntimeNextJSPagesRouterEndpoint, "copilotRuntimeNextJSPagesRouterEndpoint");
1981
-
1982
- // src/lib/integrations/node-http/index.ts
1983
- var import_graphql_yoga4 = require("graphql-yoga");
1984
- function copilotRuntimeNodeHttpEndpoint(options) {
1985
- var _a;
1986
- const commonConfig = getCommonConfig(options);
1987
- telemetry_client_default.setGlobalProperties({
1988
- runtime: {
1989
- framework: "node-http"
1990
- }
1991
- });
1992
- if ((_a = options.properties) == null ? void 0 : _a._copilotkit) {
1993
- telemetry_client_default.setGlobalProperties({
1994
- _copilotkit: options.properties._copilotkit
1995
- });
1996
- }
1997
- telemetry_client_default.capture("oss.runtime.instance_created", getRuntimeInstanceTelemetryInfo(options.runtime));
1998
- const logger2 = commonConfig.logging;
1999
- logger2.debug("Creating Node HTTP endpoint");
2000
- const yoga = (0, import_graphql_yoga4.createYoga)({
2001
- ...commonConfig,
2002
- graphqlEndpoint: options.endpoint
2003
- });
2004
- return yoga;
2005
- }
2006
- __name(copilotRuntimeNodeHttpEndpoint, "copilotRuntimeNodeHttpEndpoint");
2007
-
2008
- // src/lib/integrations/node-express/index.ts
2009
- function copilotRuntimeNodeExpressEndpoint(options) {
2010
- telemetry_client_default.setGlobalProperties({
2011
- runtime: {
2012
- framework: "node-express"
2013
- }
2014
- });
2015
- telemetry_client_default.capture("oss.runtime.instance_created", getRuntimeInstanceTelemetryInfo(options.runtime));
2016
- return copilotRuntimeNodeHttpEndpoint(options);
2017
- }
2018
- __name(copilotRuntimeNodeExpressEndpoint, "copilotRuntimeNodeExpressEndpoint");
2019
-
2020
- // src/lib/integrations/nest/index.ts
2021
- function copilotRuntimeNestEndpoint(options) {
2022
- telemetry_client_default.setGlobalProperties({
2023
- runtime: {
2024
- framework: "nest"
2025
- }
2026
- });
2027
- telemetry_client_default.capture("oss.runtime.instance_created", getRuntimeInstanceTelemetryInfo(options.runtime));
2028
- return copilotRuntimeNodeHttpEndpoint(options);
2029
- }
2030
- __name(copilotRuntimeNestEndpoint, "copilotRuntimeNestEndpoint");
2031
- // Annotate the CommonJS export names for ESM import in node:
2032
- 0 && (module.exports = {
2033
- buildSchema,
2034
- config,
2035
- copilotRuntimeNestEndpoint,
2036
- copilotRuntimeNextJSAppRouterEndpoint,
2037
- copilotRuntimeNextJSPagesRouterEndpoint,
2038
- copilotRuntimeNodeExpressEndpoint,
2039
- copilotRuntimeNodeHttpEndpoint,
2040
- createContext,
2041
- getCommonConfig
2042
- });
2043
- //# sourceMappingURL=index.js.map