@copilotkit/runtime 0.0.0-test-custom-tag-prerelease-1-20250108200215

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 (146) hide show
  1. package/.eslintrc.js +7 -0
  2. package/CHANGELOG.md +729 -0
  3. package/README.md +46 -0
  4. package/__snapshots__/schema/schema.graphql +262 -0
  5. package/dist/chunk-2WXVJKUZ.mjs +25 -0
  6. package/dist/chunk-2WXVJKUZ.mjs.map +1 -0
  7. package/dist/chunk-44O2JGUY.mjs +12 -0
  8. package/dist/chunk-44O2JGUY.mjs.map +1 -0
  9. package/dist/chunk-CLGKEUOA.mjs +1408 -0
  10. package/dist/chunk-CLGKEUOA.mjs.map +1 -0
  11. package/dist/chunk-D2WLFQS6.mjs +43 -0
  12. package/dist/chunk-D2WLFQS6.mjs.map +1 -0
  13. package/dist/chunk-DFOKBSIS.mjs +1 -0
  14. package/dist/chunk-DFOKBSIS.mjs.map +1 -0
  15. package/dist/chunk-RFF5IIZJ.mjs +66 -0
  16. package/dist/chunk-RFF5IIZJ.mjs.map +1 -0
  17. package/dist/chunk-U3V2BCGI.mjs +152 -0
  18. package/dist/chunk-U3V2BCGI.mjs.map +1 -0
  19. package/dist/chunk-UYX3NHOI.mjs +25 -0
  20. package/dist/chunk-UYX3NHOI.mjs.map +1 -0
  21. package/dist/chunk-W3GSZTZR.mjs +3281 -0
  22. package/dist/chunk-W3GSZTZR.mjs.map +1 -0
  23. package/dist/chunk-WPNQ4AMN.mjs +80 -0
  24. package/dist/chunk-WPNQ4AMN.mjs.map +1 -0
  25. package/dist/copilot-runtime-6285d897.d.ts +189 -0
  26. package/dist/graphql/types/base/index.d.ts +6 -0
  27. package/dist/graphql/types/base/index.js +63 -0
  28. package/dist/graphql/types/base/index.js.map +1 -0
  29. package/dist/graphql/types/base/index.mjs +8 -0
  30. package/dist/graphql/types/base/index.mjs.map +1 -0
  31. package/dist/graphql/types/converted/index.d.ts +2 -0
  32. package/dist/graphql/types/converted/index.js +124 -0
  33. package/dist/graphql/types/converted/index.js.map +1 -0
  34. package/dist/graphql/types/converted/index.mjs +17 -0
  35. package/dist/graphql/types/converted/index.mjs.map +1 -0
  36. package/dist/groq-adapter-15d41154.d.ts +281 -0
  37. package/dist/index-ff3fbc33.d.ts +87 -0
  38. package/dist/index.d.ts +23 -0
  39. package/dist/index.js +5039 -0
  40. package/dist/index.js.map +1 -0
  41. package/dist/index.mjs +76 -0
  42. package/dist/index.mjs.map +1 -0
  43. package/dist/langserve-48e976ac.d.ts +176 -0
  44. package/dist/lib/cloud/index.d.ts +6 -0
  45. package/dist/lib/cloud/index.js +18 -0
  46. package/dist/lib/cloud/index.js.map +1 -0
  47. package/dist/lib/cloud/index.mjs +1 -0
  48. package/dist/lib/cloud/index.mjs.map +1 -0
  49. package/dist/lib/index.d.ts +20 -0
  50. package/dist/lib/index.js +4687 -0
  51. package/dist/lib/index.js.map +1 -0
  52. package/dist/lib/index.mjs +58 -0
  53. package/dist/lib/index.mjs.map +1 -0
  54. package/dist/lib/integrations/index.d.ts +33 -0
  55. package/dist/lib/integrations/index.js +2091 -0
  56. package/dist/lib/integrations/index.js.map +1 -0
  57. package/dist/lib/integrations/index.mjs +34 -0
  58. package/dist/lib/integrations/index.mjs.map +1 -0
  59. package/dist/lib/integrations/nest/index.d.ts +14 -0
  60. package/dist/lib/integrations/nest/index.js +2000 -0
  61. package/dist/lib/integrations/nest/index.js.map +1 -0
  62. package/dist/lib/integrations/nest/index.mjs +13 -0
  63. package/dist/lib/integrations/nest/index.mjs.map +1 -0
  64. package/dist/lib/integrations/node-express/index.d.ts +14 -0
  65. package/dist/lib/integrations/node-express/index.js +2000 -0
  66. package/dist/lib/integrations/node-express/index.js.map +1 -0
  67. package/dist/lib/integrations/node-express/index.mjs +13 -0
  68. package/dist/lib/integrations/node-express/index.mjs.map +1 -0
  69. package/dist/lib/integrations/node-http/index.d.ts +14 -0
  70. package/dist/lib/integrations/node-http/index.js +1986 -0
  71. package/dist/lib/integrations/node-http/index.js.map +1 -0
  72. package/dist/lib/integrations/node-http/index.mjs +12 -0
  73. package/dist/lib/integrations/node-http/index.mjs.map +1 -0
  74. package/dist/service-adapters/index.d.ts +84 -0
  75. package/dist/service-adapters/index.js +1448 -0
  76. package/dist/service-adapters/index.js.map +1 -0
  77. package/dist/service-adapters/index.mjs +26 -0
  78. package/dist/service-adapters/index.mjs.map +1 -0
  79. package/dist/utils/index.d.ts +49 -0
  80. package/dist/utils/index.js +174 -0
  81. package/dist/utils/index.js.map +1 -0
  82. package/dist/utils/index.mjs +12 -0
  83. package/dist/utils/index.mjs.map +1 -0
  84. package/jest.config.js +5 -0
  85. package/package.json +85 -0
  86. package/scripts/generate-gql-schema.ts +13 -0
  87. package/src/agents/langgraph/event-source.ts +287 -0
  88. package/src/agents/langgraph/events.ts +338 -0
  89. package/src/graphql/inputs/action.input.ts +16 -0
  90. package/src/graphql/inputs/agent-session.input.ts +13 -0
  91. package/src/graphql/inputs/agent-state.input.ts +10 -0
  92. package/src/graphql/inputs/cloud-guardrails.input.ts +16 -0
  93. package/src/graphql/inputs/cloud.input.ts +8 -0
  94. package/src/graphql/inputs/context-property.input.ts +10 -0
  95. package/src/graphql/inputs/custom-property.input.ts +15 -0
  96. package/src/graphql/inputs/forwarded-parameters.input.ts +22 -0
  97. package/src/graphql/inputs/frontend.input.ts +14 -0
  98. package/src/graphql/inputs/generate-copilot-response.input.ts +47 -0
  99. package/src/graphql/inputs/message.input.ts +92 -0
  100. package/src/graphql/resolvers/copilot.resolver.ts +540 -0
  101. package/src/graphql/types/base/index.ts +10 -0
  102. package/src/graphql/types/converted/index.ts +70 -0
  103. package/src/graphql/types/copilot-response.type.ts +113 -0
  104. package/src/graphql/types/enums.ts +37 -0
  105. package/src/graphql/types/guardrails-result.type.ts +20 -0
  106. package/src/graphql/types/message-status.type.ts +40 -0
  107. package/src/graphql/types/response-status.type.ts +66 -0
  108. package/src/index.ts +4 -0
  109. package/src/lib/cloud/index.ts +4 -0
  110. package/src/lib/index.ts +8 -0
  111. package/src/lib/integrations/index.ts +6 -0
  112. package/src/lib/integrations/nest/index.ts +17 -0
  113. package/src/lib/integrations/nextjs/app-router.ts +40 -0
  114. package/src/lib/integrations/nextjs/pages-router.ts +49 -0
  115. package/src/lib/integrations/node-express/index.ts +17 -0
  116. package/src/lib/integrations/node-http/index.ts +34 -0
  117. package/src/lib/integrations/shared.ts +109 -0
  118. package/src/lib/logger.ts +28 -0
  119. package/src/lib/runtime/copilot-runtime.ts +412 -0
  120. package/src/lib/runtime/remote-action-constructors.ts +304 -0
  121. package/src/lib/runtime/remote-actions.ts +174 -0
  122. package/src/lib/runtime/remote-lg-action.ts +657 -0
  123. package/src/lib/telemetry-client.ts +52 -0
  124. package/src/service-adapters/anthropic/anthropic-adapter.ts +205 -0
  125. package/src/service-adapters/anthropic/utils.ts +144 -0
  126. package/src/service-adapters/conversion.ts +64 -0
  127. package/src/service-adapters/events.ts +377 -0
  128. package/src/service-adapters/experimental/empty/empty-adapter.ts +33 -0
  129. package/src/service-adapters/experimental/ollama/ollama-adapter.ts +79 -0
  130. package/src/service-adapters/google/google-genai-adapter.ts +39 -0
  131. package/src/service-adapters/groq/groq-adapter.ts +173 -0
  132. package/src/service-adapters/index.ts +16 -0
  133. package/src/service-adapters/langchain/langchain-adapter.ts +99 -0
  134. package/src/service-adapters/langchain/langserve.ts +87 -0
  135. package/src/service-adapters/langchain/types.ts +14 -0
  136. package/src/service-adapters/langchain/utils.ts +306 -0
  137. package/src/service-adapters/openai/openai-adapter.ts +210 -0
  138. package/src/service-adapters/openai/openai-assistant-adapter.ts +304 -0
  139. package/src/service-adapters/openai/utils.ts +161 -0
  140. package/src/service-adapters/service-adapter.ts +30 -0
  141. package/src/service-adapters/unify/unify-adapter.ts +145 -0
  142. package/src/utils/failed-response-status-reasons.ts +48 -0
  143. package/src/utils/index.ts +1 -0
  144. package/tsconfig.json +11 -0
  145. package/tsup.config.ts +16 -0
  146. package/typedoc.json +4 -0
package/README.md ADDED
@@ -0,0 +1,46 @@
1
+ <div align="center">
2
+ <a href="https://copilotkit.ai" target="_blank">
3
+ <img src="https://github.com/copilotkit/copilotkit/raw/main/assets/banner.png" alt="CopilotKit Logo">
4
+ </a>
5
+
6
+ <br/>
7
+
8
+ <strong>
9
+ CopilotKit is the open-source framework for integrating powerful AI Copilots into any application. Easily implement custom AI Chatbots, AI Agents, AI Textareas, and more.
10
+ </strong>
11
+ </div>
12
+
13
+ <br/>
14
+
15
+ <div align="center">
16
+ <a href="https://www.npmjs.com/package/@copilotkit/react-core" target="_blank">
17
+ <img src="https://img.shields.io/npm/v/%40copilotkit%2Freact-core?logo=npm&logoColor=%23FFFFFF&label=Version&color=%236963ff" alt="NPM">
18
+ </a>
19
+ <img src="https://img.shields.io/github/license/copilotkit/copilotkit?color=%236963ff&label=License" alt="MIT">
20
+ <a href="https://discord.gg/6dffbvGU3D" target="_blank">
21
+ <img src="https://img.shields.io/discord/1122926057641742418?logo=discord&logoColor=%23FFFFFF&label=Discord&color=%236963ff" alt="Discord">
22
+ </a>
23
+ </div>
24
+ <br/>
25
+
26
+ <div align="center">
27
+ <a href="https://discord.gg/6dffbvGU3D?ref=github_readme" target="_blank">
28
+ <img src="https://github.com/copilotkit/copilotkit/raw/main/assets/btn_discord.png" alt="CopilotKit Discord" height="40px">
29
+ </a>
30
+ <a href="https://docs.copilotkit.ai?ref=github_readme" target="_blank">
31
+ <img src="https://github.com/copilotkit/copilotkit/raw/main/assets/btn_docs.png" alt="CopilotKit GitHub" height="40px">
32
+ </a>
33
+ <a href="https://cloud.copilotkit.ai?ref=github_readme" target="_blank">
34
+ <img src="https://github.com/copilotkit/copilotkit/raw/main/assets/btn_cloud.png" alt="CopilotKit GitHub" height="40px">
35
+ </a>
36
+ </div>
37
+
38
+ <br />
39
+
40
+ <div align="center">
41
+ <img src="https://github.com/CopilotKit/CopilotKit/raw/main/assets/animated-banner.gif" alt="CopilotKit Screenshot" style="border-radius: 15px;" />
42
+ </div>
43
+
44
+ # Documentation
45
+
46
+ To get started with CopilotKit, please check out the [documentation](https://docs.copilotkit.ai).
@@ -0,0 +1,262 @@
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
+ input AgentSessionInput {
38
+ agentName: String!
39
+ nodeName: String
40
+ threadId: String
41
+ }
42
+
43
+ input AgentStateInput {
44
+ agentName: String!
45
+ state: String!
46
+ }
47
+
48
+ input AgentStateMessageInput {
49
+ active: Boolean!
50
+ agentName: String!
51
+ nodeName: String!
52
+ role: MessageRole!
53
+ runId: String!
54
+ running: Boolean!
55
+ state: String!
56
+ threadId: String!
57
+ }
58
+
59
+ type AgentStateMessageOutput implements BaseMessageOutput {
60
+ active: Boolean!
61
+ agentName: String!
62
+ createdAt: DateTimeISO!
63
+ id: String!
64
+ nodeName: String!
65
+ role: MessageRole!
66
+ runId: String!
67
+ running: Boolean!
68
+ state: String!
69
+ status: MessageStatus!
70
+ threadId: String!
71
+ }
72
+
73
+ interface BaseMessageOutput {
74
+ createdAt: DateTimeISO!
75
+ id: String!
76
+ status: MessageStatus!
77
+ }
78
+
79
+ interface BaseResponseStatus {
80
+ code: ResponseStatusCode!
81
+ }
82
+
83
+ input CloudInput {
84
+ guardrails: GuardrailsInput
85
+ }
86
+
87
+ """The type of Copilot request"""
88
+ enum CopilotRequestType {
89
+ Chat
90
+ Suggestion
91
+ Task
92
+ TextareaCompletion
93
+ TextareaPopover
94
+ }
95
+
96
+ type CopilotResponse {
97
+ messages: [BaseMessageOutput!]!
98
+ runId: String
99
+ status: ResponseStatus!
100
+ threadId: String!
101
+ }
102
+
103
+ """
104
+ 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.
105
+ """
106
+ scalar DateTimeISO
107
+
108
+ type FailedMessageStatus {
109
+ code: MessageStatusCode!
110
+ reason: String!
111
+ }
112
+
113
+ type FailedResponseStatus implements BaseResponseStatus {
114
+ code: ResponseStatusCode!
115
+ details: JSON
116
+ reason: FailedResponseStatusReason!
117
+ }
118
+
119
+ enum FailedResponseStatusReason {
120
+ GUARDRAILS_VALIDATION_FAILED
121
+ MESSAGE_STREAM_INTERRUPTED
122
+ UNKNOWN_ERROR
123
+ }
124
+
125
+ input ForwardedParametersInput {
126
+ maxTokens: Float
127
+ model: String
128
+ stop: [String!]
129
+ temperature: Float
130
+ toolChoice: String
131
+ toolChoiceFunctionName: String
132
+ }
133
+
134
+ input FrontendInput {
135
+ actions: [ActionInput!]!
136
+ toDeprecate_fullContext: String
137
+ url: String
138
+ }
139
+
140
+ input GenerateCopilotResponseInput {
141
+ agentSession: AgentSessionInput
142
+ agentState: AgentStateInput
143
+ agentStates: [AgentStateInput!]
144
+ cloud: CloudInput
145
+ forwardedParameters: ForwardedParametersInput
146
+ frontend: FrontendInput!
147
+ messages: [MessageInput!]!
148
+ metadata: GenerateCopilotResponseMetadataInput!
149
+ runId: String
150
+ threadId: String
151
+ }
152
+
153
+ input GenerateCopilotResponseMetadataInput {
154
+ requestType: CopilotRequestType
155
+ }
156
+
157
+ input GuardrailsInput {
158
+ inputValidationRules: GuardrailsRuleInput!
159
+ }
160
+
161
+ input GuardrailsRuleInput {
162
+ allowList: [String!] = []
163
+ denyList: [String!] = []
164
+ }
165
+
166
+ """
167
+ The `JSON` scalar type represents JSON values as specified by [ECMA-404](http://www.ecma-international.org/publications/files/ECMA-ST/ECMA-404.pdf).
168
+ """
169
+ scalar JSON @specifiedBy(url: "http://www.ecma-international.org/publications/files/ECMA-ST/ECMA-404.pdf")
170
+
171
+ """
172
+ The `JSONObject` scalar type represents JSON objects as specified by [ECMA-404](http://www.ecma-international.org/publications/files/ECMA-ST/ECMA-404.pdf).
173
+ """
174
+ scalar JSONObject @specifiedBy(url: "http://www.ecma-international.org/publications/files/ECMA-ST/ECMA-404.pdf")
175
+
176
+ input MessageInput {
177
+ actionExecutionMessage: ActionExecutionMessageInput
178
+ agentStateMessage: AgentStateMessageInput
179
+ createdAt: DateTimeISO!
180
+ id: String!
181
+ resultMessage: ResultMessageInput
182
+ textMessage: TextMessageInput
183
+ }
184
+
185
+ """The role of the message"""
186
+ enum MessageRole {
187
+ assistant
188
+ system
189
+ tool
190
+ user
191
+ }
192
+
193
+ union MessageStatus = FailedMessageStatus | PendingMessageStatus | SuccessMessageStatus
194
+
195
+ enum MessageStatusCode {
196
+ Failed
197
+ Pending
198
+ Success
199
+ }
200
+
201
+ type Mutation {
202
+ generateCopilotResponse(data: GenerateCopilotResponseInput!, properties: JSONObject): CopilotResponse!
203
+ }
204
+
205
+ type PendingMessageStatus {
206
+ code: MessageStatusCode!
207
+ }
208
+
209
+ type PendingResponseStatus implements BaseResponseStatus {
210
+ code: ResponseStatusCode!
211
+ }
212
+
213
+ type Query {
214
+ hello: String!
215
+ }
216
+
217
+ union ResponseStatus = FailedResponseStatus | PendingResponseStatus | SuccessResponseStatus
218
+
219
+ enum ResponseStatusCode {
220
+ Failed
221
+ Pending
222
+ Success
223
+ }
224
+
225
+ input ResultMessageInput {
226
+ actionExecutionId: String!
227
+ actionName: String!
228
+ parentMessageId: String
229
+ result: String!
230
+ }
231
+
232
+ type ResultMessageOutput implements BaseMessageOutput {
233
+ actionExecutionId: String!
234
+ actionName: String!
235
+ createdAt: DateTimeISO!
236
+ id: String!
237
+ result: String!
238
+ status: MessageStatus!
239
+ }
240
+
241
+ type SuccessMessageStatus {
242
+ code: MessageStatusCode!
243
+ }
244
+
245
+ type SuccessResponseStatus implements BaseResponseStatus {
246
+ code: ResponseStatusCode!
247
+ }
248
+
249
+ input TextMessageInput {
250
+ content: String!
251
+ parentMessageId: String
252
+ role: MessageRole!
253
+ }
254
+
255
+ type TextMessageOutput implements BaseMessageOutput {
256
+ content: [String!]!
257
+ createdAt: DateTimeISO!
258
+ id: String!
259
+ parentMessageId: String
260
+ role: MessageRole!
261
+ status: MessageStatus!
262
+ }
@@ -0,0 +1,25 @@
1
+ import {
2
+ copilotRuntimeNodeHttpEndpoint,
3
+ getRuntimeInstanceTelemetryInfo,
4
+ telemetry_client_default
5
+ } from "./chunk-W3GSZTZR.mjs";
6
+ import {
7
+ __name
8
+ } from "./chunk-44O2JGUY.mjs";
9
+
10
+ // src/lib/integrations/node-express/index.ts
11
+ function copilotRuntimeNodeExpressEndpoint(options) {
12
+ telemetry_client_default.setGlobalProperties({
13
+ runtime: {
14
+ framework: "node-express"
15
+ }
16
+ });
17
+ telemetry_client_default.capture("oss.runtime.instance_created", getRuntimeInstanceTelemetryInfo(options.runtime));
18
+ return copilotRuntimeNodeHttpEndpoint(options);
19
+ }
20
+ __name(copilotRuntimeNodeExpressEndpoint, "copilotRuntimeNodeExpressEndpoint");
21
+
22
+ export {
23
+ copilotRuntimeNodeExpressEndpoint
24
+ };
25
+ //# sourceMappingURL=chunk-2WXVJKUZ.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/lib/integrations/node-express/index.ts"],"sourcesContent":["import { CreateCopilotRuntimeServerOptions } from \"../shared\";\nimport { copilotRuntimeNodeHttpEndpoint } from \"../node-http\";\nimport telemetry, { getRuntimeInstanceTelemetryInfo } from \"../../telemetry-client\";\n\nexport function copilotRuntimeNodeExpressEndpoint(options: CreateCopilotRuntimeServerOptions) {\n telemetry.setGlobalProperties({\n runtime: {\n framework: \"node-express\",\n },\n });\n\n telemetry.capture(\n \"oss.runtime.instance_created\",\n getRuntimeInstanceTelemetryInfo(options.runtime),\n );\n return copilotRuntimeNodeHttpEndpoint(options);\n}\n"],"mappings":";;;;;;;;;;AAIO,SAASA,kCAAkCC,SAA0C;AAC1FC,2BAAUC,oBAAoB;IAC5BC,SAAS;MACPC,WAAW;IACb;EACF,CAAA;AAEAH,2BAAUI,QACR,gCACAC,gCAAgCN,QAAQG,OAAO,CAAA;AAEjD,SAAOI,+BAA+BP,OAAAA;AACxC;AAZgBD;","names":["copilotRuntimeNodeExpressEndpoint","options","telemetry","setGlobalProperties","runtime","framework","capture","getRuntimeInstanceTelemetryInfo","copilotRuntimeNodeHttpEndpoint"]}
@@ -0,0 +1,12 @@
1
+ var __defProp = Object.defineProperty;
2
+ var __getOwnPropNames = Object.getOwnPropertyNames;
3
+ var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
4
+ var __commonJS = (cb, mod) => function __require() {
5
+ return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
6
+ };
7
+
8
+ export {
9
+ __name,
10
+ __commonJS
11
+ };
12
+ //# sourceMappingURL=chunk-44O2JGUY.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}