@copilotkit/runtime 1.5.1-next.2 → 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.
- package/CHANGELOG.md +16 -0
- package/package.json +2 -2
- package/__snapshots__/schema/schema.graphql +0 -273
- package/dist/chunk-2FY7EQEE.mjs +0 -80
- package/dist/chunk-2FY7EQEE.mjs.map +0 -1
- package/dist/chunk-2V7BHSFE.mjs +0 -3395
- package/dist/chunk-2V7BHSFE.mjs.map +0 -1
- package/dist/chunk-2ZPE55QG.mjs +0 -25
- package/dist/chunk-2ZPE55QG.mjs.map +0 -1
- package/dist/chunk-44O2JGUY.mjs +0 -12
- package/dist/chunk-44O2JGUY.mjs.map +0 -1
- package/dist/chunk-CLGKEUOA.mjs +0 -1408
- package/dist/chunk-CLGKEUOA.mjs.map +0 -1
- package/dist/chunk-D2WLFQS6.mjs +0 -43
- package/dist/chunk-D2WLFQS6.mjs.map +0 -1
- package/dist/chunk-DFOKBSIS.mjs +0 -1
- package/dist/chunk-DFOKBSIS.mjs.map +0 -1
- package/dist/chunk-RFF5IIZJ.mjs +0 -66
- package/dist/chunk-RFF5IIZJ.mjs.map +0 -1
- package/dist/chunk-U3V2BCGI.mjs +0 -152
- package/dist/chunk-U3V2BCGI.mjs.map +0 -1
- package/dist/chunk-W6E7AVR7.mjs +0 -25
- package/dist/chunk-W6E7AVR7.mjs.map +0 -1
- package/dist/copilot-runtime-36700e00.d.ts +0 -196
- package/dist/graphql/types/base/index.d.ts +0 -6
- package/dist/graphql/types/base/index.js +0 -63
- package/dist/graphql/types/base/index.js.map +0 -1
- package/dist/graphql/types/base/index.mjs +0 -8
- package/dist/graphql/types/base/index.mjs.map +0 -1
- package/dist/graphql/types/converted/index.d.ts +0 -2
- package/dist/graphql/types/converted/index.js +0 -124
- package/dist/graphql/types/converted/index.js.map +0 -1
- package/dist/graphql/types/converted/index.mjs +0 -17
- package/dist/graphql/types/converted/index.mjs.map +0 -1
- package/dist/groq-adapter-696b5d29.d.ts +0 -281
- package/dist/index-cc2b17be.d.ts +0 -87
- package/dist/index.d.ts +0 -23
- package/dist/index.js +0 -5153
- package/dist/index.js.map +0 -1
- package/dist/index.mjs +0 -76
- package/dist/index.mjs.map +0 -1
- package/dist/langserve-9125a12e.d.ts +0 -176
- package/dist/lib/cloud/index.d.ts +0 -6
- package/dist/lib/cloud/index.js +0 -18
- package/dist/lib/cloud/index.js.map +0 -1
- package/dist/lib/cloud/index.mjs +0 -1
- package/dist/lib/cloud/index.mjs.map +0 -1
- package/dist/lib/index.d.ts +0 -20
- package/dist/lib/index.js +0 -4801
- package/dist/lib/index.js.map +0 -1
- package/dist/lib/index.mjs +0 -58
- package/dist/lib/index.mjs.map +0 -1
- package/dist/lib/integrations/index.d.ts +0 -33
- package/dist/lib/integrations/index.js +0 -2166
- package/dist/lib/integrations/index.js.map +0 -1
- package/dist/lib/integrations/index.mjs +0 -34
- package/dist/lib/integrations/index.mjs.map +0 -1
- package/dist/lib/integrations/nest/index.d.ts +0 -14
- package/dist/lib/integrations/nest/index.js +0 -2075
- package/dist/lib/integrations/nest/index.js.map +0 -1
- package/dist/lib/integrations/nest/index.mjs +0 -13
- package/dist/lib/integrations/nest/index.mjs.map +0 -1
- package/dist/lib/integrations/node-express/index.d.ts +0 -14
- package/dist/lib/integrations/node-express/index.js +0 -2075
- package/dist/lib/integrations/node-express/index.js.map +0 -1
- package/dist/lib/integrations/node-express/index.mjs +0 -13
- package/dist/lib/integrations/node-express/index.mjs.map +0 -1
- package/dist/lib/integrations/node-http/index.d.ts +0 -14
- package/dist/lib/integrations/node-http/index.js +0 -2061
- package/dist/lib/integrations/node-http/index.js.map +0 -1
- package/dist/lib/integrations/node-http/index.mjs +0 -12
- package/dist/lib/integrations/node-http/index.mjs.map +0 -1
- package/dist/service-adapters/index.d.ts +0 -84
- package/dist/service-adapters/index.js +0 -1448
- package/dist/service-adapters/index.js.map +0 -1
- package/dist/service-adapters/index.mjs +0 -26
- package/dist/service-adapters/index.mjs.map +0 -1
- package/dist/utils/index.d.ts +0 -49
- package/dist/utils/index.js +0 -174
- package/dist/utils/index.js.map +0 -1
- package/dist/utils/index.mjs +0 -12
- package/dist/utils/index.mjs.map +0 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,21 @@
|
|
|
1
1
|
# @copilotkit/runtime
|
|
2
2
|
|
|
3
|
+
## 1.5.1-next.4
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- 5c01e9e: test prerelease #4
|
|
8
|
+
- Updated dependencies [5c01e9e]
|
|
9
|
+
- @copilotkit/shared@1.5.1-next.4
|
|
10
|
+
|
|
11
|
+
## 1.5.1-next.3
|
|
12
|
+
|
|
13
|
+
### Patch Changes
|
|
14
|
+
|
|
15
|
+
- 33218fe: test prerelease #3
|
|
16
|
+
- Updated dependencies [33218fe]
|
|
17
|
+
- @copilotkit/shared@1.5.1-next.3
|
|
18
|
+
|
|
3
19
|
## 1.5.1-next.2
|
|
4
20
|
|
|
5
21
|
### Patch Changes
|
package/package.json
CHANGED
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
"publishConfig": {
|
|
10
10
|
"access": "public"
|
|
11
11
|
},
|
|
12
|
-
"version": "1.5.1-next.
|
|
12
|
+
"version": "1.5.1-next.4",
|
|
13
13
|
"sideEffects": false,
|
|
14
14
|
"main": "./dist/index.js",
|
|
15
15
|
"module": "./dist/index.mjs",
|
|
@@ -58,7 +58,7 @@
|
|
|
58
58
|
"rxjs": "^7.8.1",
|
|
59
59
|
"type-graphql": "2.0.0-rc.1",
|
|
60
60
|
"zod": "^3.23.3",
|
|
61
|
-
"@copilotkit/shared": "1.5.1-next.
|
|
61
|
+
"@copilotkit/shared": "1.5.1-next.4"
|
|
62
62
|
},
|
|
63
63
|
"keywords": [
|
|
64
64
|
"copilotkit",
|
|
@@ -1,273 +0,0 @@
|
|
|
1
|
-
# -----------------------------------------------
|
|
2
|
-
# !!! THIS FILE WAS GENERATED BY TYPE-GRAPHQL !!!
|
|
3
|
-
# !!! DO NOT MODIFY THIS FILE BY YOURSELF !!!
|
|
4
|
-
# -----------------------------------------------
|
|
5
|
-
|
|
6
|
-
input ActionExecutionMessageInput {
|
|
7
|
-
arguments: String!
|
|
8
|
-
name: String!
|
|
9
|
-
parentMessageId: String
|
|
10
|
-
scope: String @deprecated(reason: "This field will be removed in a future version")
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
type ActionExecutionMessageOutput implements BaseMessageOutput {
|
|
14
|
-
arguments: [String!]!
|
|
15
|
-
createdAt: DateTimeISO!
|
|
16
|
-
id: String!
|
|
17
|
-
name: String!
|
|
18
|
-
parentMessageId: String
|
|
19
|
-
scope: String @deprecated(reason: "This field will be removed in a future version")
|
|
20
|
-
status: MessageStatus!
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
input ActionInput {
|
|
24
|
-
available: ActionInputAvailability
|
|
25
|
-
description: String!
|
|
26
|
-
jsonSchema: String!
|
|
27
|
-
name: String!
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
"""The availability of the frontend action"""
|
|
31
|
-
enum ActionInputAvailability {
|
|
32
|
-
disabled
|
|
33
|
-
enabled
|
|
34
|
-
remote
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
type Agent {
|
|
38
|
-
description: String!
|
|
39
|
-
id: String!
|
|
40
|
-
name: String!
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
input AgentSessionInput {
|
|
44
|
-
agentName: String!
|
|
45
|
-
nodeName: String
|
|
46
|
-
threadId: String
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
input AgentStateInput {
|
|
50
|
-
agentName: String!
|
|
51
|
-
state: String!
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
input AgentStateMessageInput {
|
|
55
|
-
active: Boolean!
|
|
56
|
-
agentName: String!
|
|
57
|
-
nodeName: String!
|
|
58
|
-
role: MessageRole!
|
|
59
|
-
runId: String!
|
|
60
|
-
running: Boolean!
|
|
61
|
-
state: String!
|
|
62
|
-
threadId: String!
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
type AgentStateMessageOutput implements BaseMessageOutput {
|
|
66
|
-
active: Boolean!
|
|
67
|
-
agentName: String!
|
|
68
|
-
createdAt: DateTimeISO!
|
|
69
|
-
id: String!
|
|
70
|
-
nodeName: String!
|
|
71
|
-
role: MessageRole!
|
|
72
|
-
runId: String!
|
|
73
|
-
running: Boolean!
|
|
74
|
-
state: String!
|
|
75
|
-
status: MessageStatus!
|
|
76
|
-
threadId: String!
|
|
77
|
-
}
|
|
78
|
-
|
|
79
|
-
type AgentsResponse {
|
|
80
|
-
agents: [Agent!]!
|
|
81
|
-
}
|
|
82
|
-
|
|
83
|
-
interface BaseMessageOutput {
|
|
84
|
-
createdAt: DateTimeISO!
|
|
85
|
-
id: String!
|
|
86
|
-
status: MessageStatus!
|
|
87
|
-
}
|
|
88
|
-
|
|
89
|
-
interface BaseResponseStatus {
|
|
90
|
-
code: ResponseStatusCode!
|
|
91
|
-
}
|
|
92
|
-
|
|
93
|
-
input CloudInput {
|
|
94
|
-
guardrails: GuardrailsInput
|
|
95
|
-
}
|
|
96
|
-
|
|
97
|
-
"""The type of Copilot request"""
|
|
98
|
-
enum CopilotRequestType {
|
|
99
|
-
Chat
|
|
100
|
-
Suggestion
|
|
101
|
-
Task
|
|
102
|
-
TextareaCompletion
|
|
103
|
-
TextareaPopover
|
|
104
|
-
}
|
|
105
|
-
|
|
106
|
-
type CopilotResponse {
|
|
107
|
-
messages: [BaseMessageOutput!]!
|
|
108
|
-
runId: String
|
|
109
|
-
status: ResponseStatus!
|
|
110
|
-
threadId: String!
|
|
111
|
-
}
|
|
112
|
-
|
|
113
|
-
"""
|
|
114
|
-
A date-time string at UTC, such as 2007-12-03T10:15:30Z, compliant with the `date-time` format outlined in section 5.6 of the RFC 3339 profile of the ISO 8601 standard for representation of dates and times using the Gregorian calendar.This scalar is serialized to a string in ISO 8601 format and parsed from a string in ISO 8601 format.
|
|
115
|
-
"""
|
|
116
|
-
scalar DateTimeISO
|
|
117
|
-
|
|
118
|
-
type FailedMessageStatus {
|
|
119
|
-
code: MessageStatusCode!
|
|
120
|
-
reason: String!
|
|
121
|
-
}
|
|
122
|
-
|
|
123
|
-
type FailedResponseStatus implements BaseResponseStatus {
|
|
124
|
-
code: ResponseStatusCode!
|
|
125
|
-
details: JSON
|
|
126
|
-
reason: FailedResponseStatusReason!
|
|
127
|
-
}
|
|
128
|
-
|
|
129
|
-
enum FailedResponseStatusReason {
|
|
130
|
-
GUARDRAILS_VALIDATION_FAILED
|
|
131
|
-
MESSAGE_STREAM_INTERRUPTED
|
|
132
|
-
UNKNOWN_ERROR
|
|
133
|
-
}
|
|
134
|
-
|
|
135
|
-
input ForwardedParametersInput {
|
|
136
|
-
maxTokens: Float
|
|
137
|
-
model: String
|
|
138
|
-
stop: [String!]
|
|
139
|
-
temperature: Float
|
|
140
|
-
toolChoice: String
|
|
141
|
-
toolChoiceFunctionName: String
|
|
142
|
-
}
|
|
143
|
-
|
|
144
|
-
input FrontendInput {
|
|
145
|
-
actions: [ActionInput!]!
|
|
146
|
-
toDeprecate_fullContext: String
|
|
147
|
-
url: String
|
|
148
|
-
}
|
|
149
|
-
|
|
150
|
-
input GenerateCopilotResponseInput {
|
|
151
|
-
agentSession: AgentSessionInput
|
|
152
|
-
agentState: AgentStateInput
|
|
153
|
-
agentStates: [AgentStateInput!]
|
|
154
|
-
cloud: CloudInput
|
|
155
|
-
forwardedParameters: ForwardedParametersInput
|
|
156
|
-
frontend: FrontendInput!
|
|
157
|
-
messages: [MessageInput!]!
|
|
158
|
-
metadata: GenerateCopilotResponseMetadataInput!
|
|
159
|
-
runId: String
|
|
160
|
-
threadId: String
|
|
161
|
-
}
|
|
162
|
-
|
|
163
|
-
input GenerateCopilotResponseMetadataInput {
|
|
164
|
-
requestType: CopilotRequestType
|
|
165
|
-
}
|
|
166
|
-
|
|
167
|
-
input GuardrailsInput {
|
|
168
|
-
inputValidationRules: GuardrailsRuleInput!
|
|
169
|
-
}
|
|
170
|
-
|
|
171
|
-
input GuardrailsRuleInput {
|
|
172
|
-
allowList: [String!] = []
|
|
173
|
-
denyList: [String!] = []
|
|
174
|
-
}
|
|
175
|
-
|
|
176
|
-
"""
|
|
177
|
-
The `JSON` scalar type represents JSON values as specified by [ECMA-404](http://www.ecma-international.org/publications/files/ECMA-ST/ECMA-404.pdf).
|
|
178
|
-
"""
|
|
179
|
-
scalar JSON @specifiedBy(url: "http://www.ecma-international.org/publications/files/ECMA-ST/ECMA-404.pdf")
|
|
180
|
-
|
|
181
|
-
"""
|
|
182
|
-
The `JSONObject` scalar type represents JSON objects as specified by [ECMA-404](http://www.ecma-international.org/publications/files/ECMA-ST/ECMA-404.pdf).
|
|
183
|
-
"""
|
|
184
|
-
scalar JSONObject @specifiedBy(url: "http://www.ecma-international.org/publications/files/ECMA-ST/ECMA-404.pdf")
|
|
185
|
-
|
|
186
|
-
input MessageInput {
|
|
187
|
-
actionExecutionMessage: ActionExecutionMessageInput
|
|
188
|
-
agentStateMessage: AgentStateMessageInput
|
|
189
|
-
createdAt: DateTimeISO!
|
|
190
|
-
id: String!
|
|
191
|
-
resultMessage: ResultMessageInput
|
|
192
|
-
textMessage: TextMessageInput
|
|
193
|
-
}
|
|
194
|
-
|
|
195
|
-
"""The role of the message"""
|
|
196
|
-
enum MessageRole {
|
|
197
|
-
assistant
|
|
198
|
-
system
|
|
199
|
-
tool
|
|
200
|
-
user
|
|
201
|
-
}
|
|
202
|
-
|
|
203
|
-
union MessageStatus = FailedMessageStatus | PendingMessageStatus | SuccessMessageStatus
|
|
204
|
-
|
|
205
|
-
enum MessageStatusCode {
|
|
206
|
-
Failed
|
|
207
|
-
Pending
|
|
208
|
-
Success
|
|
209
|
-
}
|
|
210
|
-
|
|
211
|
-
type Mutation {
|
|
212
|
-
generateCopilotResponse(data: GenerateCopilotResponseInput!, properties: JSONObject): CopilotResponse!
|
|
213
|
-
}
|
|
214
|
-
|
|
215
|
-
type PendingMessageStatus {
|
|
216
|
-
code: MessageStatusCode!
|
|
217
|
-
}
|
|
218
|
-
|
|
219
|
-
type PendingResponseStatus implements BaseResponseStatus {
|
|
220
|
-
code: ResponseStatusCode!
|
|
221
|
-
}
|
|
222
|
-
|
|
223
|
-
type Query {
|
|
224
|
-
availableAgents: AgentsResponse!
|
|
225
|
-
hello: String!
|
|
226
|
-
}
|
|
227
|
-
|
|
228
|
-
union ResponseStatus = FailedResponseStatus | PendingResponseStatus | SuccessResponseStatus
|
|
229
|
-
|
|
230
|
-
enum ResponseStatusCode {
|
|
231
|
-
Failed
|
|
232
|
-
Pending
|
|
233
|
-
Success
|
|
234
|
-
}
|
|
235
|
-
|
|
236
|
-
input ResultMessageInput {
|
|
237
|
-
actionExecutionId: String!
|
|
238
|
-
actionName: String!
|
|
239
|
-
parentMessageId: String
|
|
240
|
-
result: String!
|
|
241
|
-
}
|
|
242
|
-
|
|
243
|
-
type ResultMessageOutput implements BaseMessageOutput {
|
|
244
|
-
actionExecutionId: String!
|
|
245
|
-
actionName: String!
|
|
246
|
-
createdAt: DateTimeISO!
|
|
247
|
-
id: String!
|
|
248
|
-
result: String!
|
|
249
|
-
status: MessageStatus!
|
|
250
|
-
}
|
|
251
|
-
|
|
252
|
-
type SuccessMessageStatus {
|
|
253
|
-
code: MessageStatusCode!
|
|
254
|
-
}
|
|
255
|
-
|
|
256
|
-
type SuccessResponseStatus implements BaseResponseStatus {
|
|
257
|
-
code: ResponseStatusCode!
|
|
258
|
-
}
|
|
259
|
-
|
|
260
|
-
input TextMessageInput {
|
|
261
|
-
content: String!
|
|
262
|
-
parentMessageId: String
|
|
263
|
-
role: MessageRole!
|
|
264
|
-
}
|
|
265
|
-
|
|
266
|
-
type TextMessageOutput implements BaseMessageOutput {
|
|
267
|
-
content: [String!]!
|
|
268
|
-
createdAt: DateTimeISO!
|
|
269
|
-
id: String!
|
|
270
|
-
parentMessageId: String
|
|
271
|
-
role: MessageRole!
|
|
272
|
-
status: MessageStatus!
|
|
273
|
-
}
|
package/dist/chunk-2FY7EQEE.mjs
DELETED
|
@@ -1,80 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
getCommonConfig,
|
|
3
|
-
getRuntimeInstanceTelemetryInfo,
|
|
4
|
-
telemetry_client_default
|
|
5
|
-
} from "./chunk-2V7BHSFE.mjs";
|
|
6
|
-
import {
|
|
7
|
-
__name
|
|
8
|
-
} from "./chunk-44O2JGUY.mjs";
|
|
9
|
-
|
|
10
|
-
// src/lib/integrations/nextjs/app-router.ts
|
|
11
|
-
import { createYoga } from "graphql-yoga";
|
|
12
|
-
function copilotRuntimeNextJSAppRouterEndpoint(options) {
|
|
13
|
-
var _a;
|
|
14
|
-
const commonConfig = getCommonConfig(options);
|
|
15
|
-
telemetry_client_default.setGlobalProperties({
|
|
16
|
-
runtime: {
|
|
17
|
-
framework: "nextjs-app-router"
|
|
18
|
-
}
|
|
19
|
-
});
|
|
20
|
-
if ((_a = options.properties) == null ? void 0 : _a._copilotkit) {
|
|
21
|
-
telemetry_client_default.setGlobalProperties({
|
|
22
|
-
_copilotkit: options.properties._copilotkit
|
|
23
|
-
});
|
|
24
|
-
}
|
|
25
|
-
telemetry_client_default.capture("oss.runtime.instance_created", getRuntimeInstanceTelemetryInfo(options.runtime));
|
|
26
|
-
const logger = commonConfig.logging;
|
|
27
|
-
logger.debug("Creating NextJS App Router endpoint");
|
|
28
|
-
const yoga = createYoga({
|
|
29
|
-
...commonConfig,
|
|
30
|
-
graphqlEndpoint: options.endpoint,
|
|
31
|
-
fetchAPI: {
|
|
32
|
-
Response: globalThis.Response
|
|
33
|
-
}
|
|
34
|
-
});
|
|
35
|
-
return {
|
|
36
|
-
handleRequest: yoga,
|
|
37
|
-
GET: yoga,
|
|
38
|
-
POST: yoga,
|
|
39
|
-
OPTIONS: yoga
|
|
40
|
-
};
|
|
41
|
-
}
|
|
42
|
-
__name(copilotRuntimeNextJSAppRouterEndpoint, "copilotRuntimeNextJSAppRouterEndpoint");
|
|
43
|
-
|
|
44
|
-
// src/lib/integrations/nextjs/pages-router.ts
|
|
45
|
-
import { createYoga as createYoga2 } from "graphql-yoga";
|
|
46
|
-
var config = {
|
|
47
|
-
api: {
|
|
48
|
-
bodyParser: false
|
|
49
|
-
}
|
|
50
|
-
};
|
|
51
|
-
function copilotRuntimeNextJSPagesRouterEndpoint(options) {
|
|
52
|
-
var _a;
|
|
53
|
-
const commonConfig = getCommonConfig(options);
|
|
54
|
-
telemetry_client_default.setGlobalProperties({
|
|
55
|
-
runtime: {
|
|
56
|
-
framework: "nextjs-pages-router"
|
|
57
|
-
}
|
|
58
|
-
});
|
|
59
|
-
if ((_a = options.properties) == null ? void 0 : _a._copilotkit) {
|
|
60
|
-
telemetry_client_default.setGlobalProperties({
|
|
61
|
-
_copilotkit: options.properties._copilotkit
|
|
62
|
-
});
|
|
63
|
-
}
|
|
64
|
-
telemetry_client_default.capture("oss.runtime.instance_created", getRuntimeInstanceTelemetryInfo(options.runtime));
|
|
65
|
-
const logger = commonConfig.logging;
|
|
66
|
-
logger.debug("Creating NextJS Pages Router endpoint");
|
|
67
|
-
const yoga = createYoga2({
|
|
68
|
-
...commonConfig,
|
|
69
|
-
graphqlEndpoint: options.endpoint
|
|
70
|
-
});
|
|
71
|
-
return yoga;
|
|
72
|
-
}
|
|
73
|
-
__name(copilotRuntimeNextJSPagesRouterEndpoint, "copilotRuntimeNextJSPagesRouterEndpoint");
|
|
74
|
-
|
|
75
|
-
export {
|
|
76
|
-
copilotRuntimeNextJSAppRouterEndpoint,
|
|
77
|
-
config,
|
|
78
|
-
copilotRuntimeNextJSPagesRouterEndpoint
|
|
79
|
-
};
|
|
80
|
-
//# sourceMappingURL=chunk-2FY7EQEE.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/lib/integrations/nextjs/app-router.ts","../src/lib/integrations/nextjs/pages-router.ts"],"sourcesContent":["import { createYoga } from \"graphql-yoga\";\nimport { CreateCopilotRuntimeServerOptions, getCommonConfig } from \"../shared\";\nimport telemetry, { getRuntimeInstanceTelemetryInfo } from \"../../telemetry-client\";\n\nexport function copilotRuntimeNextJSAppRouterEndpoint(options: CreateCopilotRuntimeServerOptions) {\n const commonConfig = getCommonConfig(options);\n\n telemetry.setGlobalProperties({\n runtime: {\n framework: \"nextjs-app-router\",\n },\n });\n\n if (options.properties?._copilotkit) {\n telemetry.setGlobalProperties({\n _copilotkit: options.properties._copilotkit,\n });\n }\n\n telemetry.capture(\n \"oss.runtime.instance_created\",\n getRuntimeInstanceTelemetryInfo(options.runtime),\n );\n\n const logger = commonConfig.logging;\n logger.debug(\"Creating NextJS App Router endpoint\");\n\n const yoga = createYoga({\n ...commonConfig,\n graphqlEndpoint: options.endpoint,\n fetchAPI: { Response: globalThis.Response },\n });\n\n return {\n handleRequest: yoga,\n GET: yoga as any,\n POST: yoga as any,\n OPTIONS: yoga as any,\n };\n}\n","import { YogaServerInstance, createYoga } from \"graphql-yoga\";\nimport { CreateCopilotRuntimeServerOptions, GraphQLContext, getCommonConfig } from \"../shared\";\nimport telemetry, { getRuntimeInstanceTelemetryInfo } from \"../../telemetry-client\";\n\nexport const config = {\n api: {\n bodyParser: false,\n },\n};\n\nexport type CopilotRuntimeServerInstance<T> = YogaServerInstance<T, Partial<GraphQLContext>>;\n\n// This import is needed to fix the type error\n// Fix is currently in TypeScript 5.5 beta, waiting for stable version\n// https://github.com/microsoft/TypeScript/issues/42873#issuecomment-2066874644\nexport type {} from \"@whatwg-node/server\";\n\nexport function copilotRuntimeNextJSPagesRouterEndpoint(\n options: CreateCopilotRuntimeServerOptions,\n): CopilotRuntimeServerInstance<GraphQLContext> {\n const commonConfig = getCommonConfig(options);\n\n telemetry.setGlobalProperties({\n runtime: {\n framework: \"nextjs-pages-router\",\n },\n });\n\n if (options.properties?._copilotkit) {\n telemetry.setGlobalProperties({\n _copilotkit: options.properties._copilotkit,\n });\n }\n\n telemetry.capture(\n \"oss.runtime.instance_created\",\n getRuntimeInstanceTelemetryInfo(options.runtime),\n );\n\n const logger = commonConfig.logging;\n logger.debug(\"Creating NextJS Pages Router endpoint\");\n\n const yoga = createYoga({\n ...commonConfig,\n graphqlEndpoint: options.endpoint,\n });\n\n return yoga;\n}\n"],"mappings":";;;;;;;;;;AAAA,SAASA,kBAAkB;AAIpB,SAASC,sCAAsCC,SAA0C;AAJhG;AAKE,QAAMC,eAAeC,gBAAgBF,OAAAA;AAErCG,2BAAUC,oBAAoB;IAC5BC,SAAS;MACPC,WAAW;IACb;EACF,CAAA;AAEA,OAAIN,aAAQO,eAARP,mBAAoBQ,aAAa;AACnCL,6BAAUC,oBAAoB;MAC5BI,aAAaR,QAAQO,WAAWC;IAClC,CAAA;EACF;AAEAL,2BAAUM,QACR,gCACAC,gCAAgCV,QAAQK,OAAO,CAAA;AAGjD,QAAMM,SAASV,aAAaW;AAC5BD,SAAOE,MAAM,qCAAA;AAEb,QAAMC,OAAOC,WAAW;IACtB,GAAGd;IACHe,iBAAiBhB,QAAQiB;IACzBC,UAAU;MAAEC,UAAUC,WAAWD;IAAS;EAC5C,CAAA;AAEA,SAAO;IACLE,eAAeP;IACfQ,KAAKR;IACLS,MAAMT;IACNU,SAASV;EACX;AACF;AAnCgBf;;;ACJhB,SAA6B0B,cAAAA,mBAAkB;AAIxC,IAAMC,SAAS;EACpBC,KAAK;IACHC,YAAY;EACd;AACF;AASO,SAASC,wCACdC,SAA0C;AAlB5C;AAoBE,QAAMC,eAAeC,gBAAgBF,OAAAA;AAErCG,2BAAUC,oBAAoB;IAC5BC,SAAS;MACPC,WAAW;IACb;EACF,CAAA;AAEA,OAAIN,aAAQO,eAARP,mBAAoBQ,aAAa;AACnCL,6BAAUC,oBAAoB;MAC5BI,aAAaR,QAAQO,WAAWC;IAClC,CAAA;EACF;AAEAL,2BAAUM,QACR,gCACAC,gCAAgCV,QAAQK,OAAO,CAAA;AAGjD,QAAMM,SAASV,aAAaW;AAC5BD,SAAOE,MAAM,uCAAA;AAEb,QAAMC,OAAOC,YAAW;IACtB,GAAGd;IACHe,iBAAiBhB,QAAQiB;EAC3B,CAAA;AAEA,SAAOH;AACT;AA/BgBf;","names":["createYoga","copilotRuntimeNextJSAppRouterEndpoint","options","commonConfig","getCommonConfig","telemetry","setGlobalProperties","runtime","framework","properties","_copilotkit","capture","getRuntimeInstanceTelemetryInfo","logger","logging","debug","yoga","createYoga","graphqlEndpoint","endpoint","fetchAPI","Response","globalThis","handleRequest","GET","POST","OPTIONS","createYoga","config","api","bodyParser","copilotRuntimeNextJSPagesRouterEndpoint","options","commonConfig","getCommonConfig","telemetry","setGlobalProperties","runtime","framework","properties","_copilotkit","capture","getRuntimeInstanceTelemetryInfo","logger","logging","debug","yoga","createYoga","graphqlEndpoint","endpoint"]}
|