@copilotkit/runtime 0.0.0-feat-dynamic-copilotcloud-qa-20250117190454

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 (147) hide show
  1. package/.eslintrc.js +7 -0
  2. package/CHANGELOG.md +913 -0
  3. package/README.md +46 -0
  4. package/__snapshots__/schema/schema.graphql +273 -0
  5. package/dist/chunk-44O2JGUY.mjs +12 -0
  6. package/dist/chunk-44O2JGUY.mjs.map +1 -0
  7. package/dist/chunk-BETLEV37.mjs +25 -0
  8. package/dist/chunk-BETLEV37.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-FA5DJ2TZ.mjs +3437 -0
  16. package/dist/chunk-FA5DJ2TZ.mjs.map +1 -0
  17. package/dist/chunk-HNUNXFTW.mjs +129 -0
  18. package/dist/chunk-HNUNXFTW.mjs.map +1 -0
  19. package/dist/chunk-SFLMY3ES.mjs +80 -0
  20. package/dist/chunk-SFLMY3ES.mjs.map +1 -0
  21. package/dist/chunk-U3V2BCGI.mjs +152 -0
  22. package/dist/chunk-U3V2BCGI.mjs.map +1 -0
  23. package/dist/chunk-ZCU6UPCY.mjs +25 -0
  24. package/dist/chunk-ZCU6UPCY.mjs.map +1 -0
  25. package/dist/copilot-runtime-1a224a0f.d.ts +196 -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 +187 -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-c35c5374.d.ts +281 -0
  37. package/dist/index-24315d90.d.ts +103 -0
  38. package/dist/index.d.ts +23 -0
  39. package/dist/index.js +5258 -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-a16ef8f4.d.ts +180 -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 +4906 -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 +2229 -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 +2138 -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 +2138 -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 +2124 -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 +556 -0
  101. package/src/graphql/types/agents-response.type.ts +22 -0
  102. package/src/graphql/types/base/index.ts +10 -0
  103. package/src/graphql/types/converted/index.ts +136 -0
  104. package/src/graphql/types/copilot-response.type.ts +113 -0
  105. package/src/graphql/types/enums.ts +37 -0
  106. package/src/graphql/types/guardrails-result.type.ts +20 -0
  107. package/src/graphql/types/message-status.type.ts +40 -0
  108. package/src/graphql/types/response-status.type.ts +66 -0
  109. package/src/index.ts +4 -0
  110. package/src/lib/cloud/index.ts +4 -0
  111. package/src/lib/index.ts +8 -0
  112. package/src/lib/integrations/index.ts +6 -0
  113. package/src/lib/integrations/nest/index.ts +17 -0
  114. package/src/lib/integrations/nextjs/app-router.ts +40 -0
  115. package/src/lib/integrations/nextjs/pages-router.ts +49 -0
  116. package/src/lib/integrations/node-express/index.ts +17 -0
  117. package/src/lib/integrations/node-http/index.ts +34 -0
  118. package/src/lib/integrations/shared.ts +109 -0
  119. package/src/lib/logger.ts +28 -0
  120. package/src/lib/runtime/copilot-runtime.ts +466 -0
  121. package/src/lib/runtime/remote-action-constructors.ts +304 -0
  122. package/src/lib/runtime/remote-actions.ts +174 -0
  123. package/src/lib/runtime/remote-lg-action.ts +657 -0
  124. package/src/lib/telemetry-client.ts +52 -0
  125. package/src/service-adapters/anthropic/anthropic-adapter.ts +205 -0
  126. package/src/service-adapters/anthropic/utils.ts +144 -0
  127. package/src/service-adapters/conversion.ts +64 -0
  128. package/src/service-adapters/events.ts +419 -0
  129. package/src/service-adapters/experimental/empty/empty-adapter.ts +33 -0
  130. package/src/service-adapters/experimental/ollama/ollama-adapter.ts +79 -0
  131. package/src/service-adapters/google/google-genai-adapter.ts +39 -0
  132. package/src/service-adapters/groq/groq-adapter.ts +173 -0
  133. package/src/service-adapters/index.ts +16 -0
  134. package/src/service-adapters/langchain/langchain-adapter.ts +99 -0
  135. package/src/service-adapters/langchain/langserve.ts +87 -0
  136. package/src/service-adapters/langchain/types.ts +14 -0
  137. package/src/service-adapters/langchain/utils.ts +306 -0
  138. package/src/service-adapters/openai/openai-adapter.ts +210 -0
  139. package/src/service-adapters/openai/openai-assistant-adapter.ts +304 -0
  140. package/src/service-adapters/openai/utils.ts +161 -0
  141. package/src/service-adapters/service-adapter.ts +30 -0
  142. package/src/service-adapters/unify/unify-adapter.ts +145 -0
  143. package/src/utils/failed-response-status-reasons.ts +48 -0
  144. package/src/utils/index.ts +1 -0
  145. package/tsconfig.json +11 -0
  146. package/tsup.config.ts +16 -0
  147. package/typedoc.json +4 -0
@@ -0,0 +1,10 @@
1
+ import { Field, InputType } from "type-graphql";
2
+
3
+ @InputType()
4
+ export class ContextPropertyInput {
5
+ @Field(() => String)
6
+ value: string;
7
+
8
+ @Field(() => String)
9
+ description: string;
10
+ }
@@ -0,0 +1,15 @@
1
+ import { Field, InputType, Int, createUnionType } from "type-graphql";
2
+
3
+ const PrimitiveUnion = createUnionType({
4
+ name: "Primitive",
5
+ types: () => [String, Number, Boolean] as const,
6
+ });
7
+
8
+ @InputType()
9
+ export class CustomPropertyInput {
10
+ @Field(() => String)
11
+ key: string;
12
+
13
+ @Field(() => PrimitiveUnion)
14
+ value: string;
15
+ }
@@ -0,0 +1,22 @@
1
+ import { Field, InputType } from "type-graphql";
2
+
3
+ @InputType()
4
+ export class ForwardedParametersInput {
5
+ @Field(() => String, { nullable: true })
6
+ model?: string;
7
+
8
+ @Field(() => Number, { nullable: true })
9
+ maxTokens?: number;
10
+
11
+ @Field(() => [String], { nullable: true })
12
+ stop?: string[];
13
+
14
+ @Field(() => String, { nullable: true })
15
+ toolChoice?: String;
16
+
17
+ @Field(() => String, { nullable: true })
18
+ toolChoiceFunctionName?: string;
19
+
20
+ @Field(() => Number, { nullable: true })
21
+ temperature?: number;
22
+ }
@@ -0,0 +1,14 @@
1
+ import { Field, InputType } from "type-graphql";
2
+ import { ActionInput } from "./action.input";
3
+
4
+ @InputType()
5
+ export class FrontendInput {
6
+ @Field(() => String, { nullable: true })
7
+ toDeprecate_fullContext?: string;
8
+
9
+ @Field(() => [ActionInput])
10
+ actions: ActionInput[];
11
+
12
+ @Field(() => String, { nullable: true })
13
+ url?: string;
14
+ }
@@ -0,0 +1,47 @@
1
+ import { Field, InputType } from "type-graphql";
2
+ import { MessageInput } from "./message.input";
3
+ import { FrontendInput } from "./frontend.input";
4
+ import { CloudInput } from "./cloud.input";
5
+ import { CopilotRequestType } from "../types/enums";
6
+ import { ForwardedParametersInput } from "./forwarded-parameters.input";
7
+ import { AgentSessionInput } from "./agent-session.input";
8
+ import { AgentStateInput } from "./agent-state.input";
9
+
10
+ @InputType()
11
+ export class GenerateCopilotResponseMetadataInput {
12
+ @Field(() => CopilotRequestType, { nullable: true })
13
+ requestType: CopilotRequestType;
14
+ }
15
+
16
+ @InputType()
17
+ export class GenerateCopilotResponseInput {
18
+ @Field(() => GenerateCopilotResponseMetadataInput, { nullable: false })
19
+ metadata: GenerateCopilotResponseMetadataInput;
20
+
21
+ @Field(() => String, { nullable: true })
22
+ threadId?: string;
23
+
24
+ @Field(() => String, { nullable: true })
25
+ runId?: string;
26
+
27
+ @Field(() => [MessageInput])
28
+ messages: MessageInput[];
29
+
30
+ @Field(() => FrontendInput)
31
+ frontend: FrontendInput;
32
+
33
+ @Field(() => CloudInput, { nullable: true })
34
+ cloud?: CloudInput;
35
+
36
+ @Field(() => ForwardedParametersInput, { nullable: true })
37
+ forwardedParameters?: ForwardedParametersInput;
38
+
39
+ @Field(() => AgentSessionInput, { nullable: true })
40
+ agentSession?: AgentSessionInput;
41
+
42
+ @Field(() => AgentStateInput, { nullable: true })
43
+ agentState?: AgentStateInput;
44
+
45
+ @Field(() => [AgentStateInput], { nullable: true })
46
+ agentStates?: AgentStateInput[];
47
+ }
@@ -0,0 +1,92 @@
1
+ import { Field, InputType } from "type-graphql";
2
+ import { MessageRole } from "../types/enums";
3
+ import { BaseMessageInput } from "../types/base";
4
+
5
+ // GraphQL does not support union types in inputs, so we need to use
6
+ // optional fields for the different subtypes.
7
+ @InputType()
8
+ export class MessageInput extends BaseMessageInput {
9
+ @Field(() => TextMessageInput, { nullable: true })
10
+ textMessage?: TextMessageInput;
11
+
12
+ @Field(() => ActionExecutionMessageInput, { nullable: true })
13
+ actionExecutionMessage?: ActionExecutionMessageInput;
14
+
15
+ @Field(() => ResultMessageInput, { nullable: true })
16
+ resultMessage?: ResultMessageInput;
17
+
18
+ @Field(() => AgentStateMessageInput, { nullable: true })
19
+ agentStateMessage?: AgentStateMessageInput;
20
+ }
21
+
22
+ @InputType()
23
+ export class TextMessageInput {
24
+ @Field(() => String)
25
+ content: string;
26
+
27
+ @Field(() => String, { nullable: true })
28
+ parentMessageId?: string;
29
+
30
+ @Field(() => MessageRole)
31
+ role: MessageRole;
32
+ }
33
+
34
+ @InputType()
35
+ export class ActionExecutionMessageInput {
36
+ @Field(() => String)
37
+ name: string;
38
+
39
+ @Field(() => String)
40
+ arguments: string;
41
+
42
+ @Field(() => String, { nullable: true })
43
+ parentMessageId?: string;
44
+
45
+ @Field(() => String, {
46
+ nullable: true,
47
+ deprecationReason: "This field will be removed in a future version",
48
+ })
49
+ scope?: String;
50
+ }
51
+
52
+ @InputType()
53
+ export class ResultMessageInput {
54
+ @Field(() => String)
55
+ actionExecutionId: string;
56
+
57
+ @Field(() => String)
58
+ actionName: string;
59
+
60
+ @Field(() => String, { nullable: true })
61
+ parentMessageId?: string;
62
+
63
+ @Field(() => String)
64
+ result: string;
65
+ }
66
+
67
+ @InputType()
68
+ export class AgentStateMessageInput {
69
+ @Field(() => String)
70
+ threadId: string;
71
+
72
+ @Field(() => String)
73
+ agentName: string;
74
+
75
+ @Field(() => MessageRole)
76
+ role: MessageRole;
77
+
78
+ @Field(() => String)
79
+ state: string;
80
+
81
+ @Field(() => Boolean)
82
+ running: boolean;
83
+
84
+ @Field(() => String)
85
+ nodeName: string;
86
+
87
+ @Field(() => String)
88
+ runId: string;
89
+
90
+ @Field(() => Boolean)
91
+ active: boolean;
92
+ }