@copilotkit/runtime 1.50.0-beta.13 → 1.50.0-beta.15

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 (180) hide show
  1. package/CHANGELOG.md +22 -0
  2. package/dist/{chunk-45RCC3ZS.mjs → chunk-BJEYMRDD.mjs} +2 -2
  3. package/dist/{chunk-OFSV5GET.mjs → chunk-DZV4ZIAR.mjs} +6 -17
  4. package/dist/chunk-DZV4ZIAR.mjs.map +1 -0
  5. package/dist/{chunk-AQG2SVCA.mjs → chunk-FMU55SEU.mjs} +2 -2
  6. package/dist/{chunk-DCEEHMLJ.mjs → chunk-SBCOROE4.mjs} +1 -16
  7. package/dist/chunk-SBCOROE4.mjs.map +1 -0
  8. package/dist/{chunk-ERUOA47O.mjs → chunk-TTUAEJLD.mjs} +2 -11
  9. package/dist/chunk-TTUAEJLD.mjs.map +1 -0
  10. package/dist/{chunk-4KES76K3.mjs → chunk-Z752VE75.mjs} +2 -2
  11. package/dist/graphql/types/converted/index.d.ts +1 -1
  12. package/dist/graphql/types/converted/index.js +110 -16
  13. package/dist/graphql/types/converted/index.js.map +1 -1
  14. package/dist/graphql/types/converted/index.mjs +3 -2
  15. package/dist/{groq-adapter-a6f5e9d2.d.ts → groq-adapter-50bc6e4a.d.ts} +1 -6
  16. package/dist/index.js +5 -3
  17. package/dist/index.js.map +1 -1
  18. package/dist/index.mjs +5 -3
  19. package/dist/index.mjs.map +1 -1
  20. package/dist/{langserve-9fc76ce5.d.ts → langserve-74a52292.d.ts} +0 -1
  21. package/dist/lib/index.d.ts +59 -5
  22. package/dist/lib/index.js +779 -3678
  23. package/dist/lib/index.js.map +1 -1
  24. package/dist/lib/index.mjs +18 -20
  25. package/dist/lib/integrations/index.d.ts +9 -15
  26. package/dist/lib/integrations/index.js +187 -215
  27. package/dist/lib/integrations/index.js.map +1 -1
  28. package/dist/lib/integrations/index.mjs +7 -8
  29. package/dist/lib/integrations/nest/index.d.ts +6 -5
  30. package/dist/lib/integrations/nest/index.js +175 -197
  31. package/dist/lib/integrations/nest/index.js.map +1 -1
  32. package/dist/lib/integrations/nest/index.mjs +5 -6
  33. package/dist/lib/integrations/node-express/index.d.ts +6 -5
  34. package/dist/lib/integrations/node-express/index.js +175 -197
  35. package/dist/lib/integrations/node-express/index.js.map +1 -1
  36. package/dist/lib/integrations/node-express/index.mjs +5 -6
  37. package/dist/lib/integrations/node-http/index.d.ts +6 -5
  38. package/dist/lib/integrations/node-http/index.js +175 -197
  39. package/dist/lib/integrations/node-http/index.js.map +1 -1
  40. package/dist/lib/integrations/node-http/index.mjs +4 -5
  41. package/dist/service-adapters/index.d.ts +11 -7
  42. package/dist/service-adapters/index.js +21 -8
  43. package/dist/service-adapters/index.js.map +1 -1
  44. package/dist/service-adapters/index.mjs +4 -2
  45. package/dist/{shared-35c6eb04.d.ts → shared-f6d43ef8.d.ts} +1 -3
  46. package/package.json +2 -2
  47. package/src/lib/runtime/copilot-runtime.ts +4 -4
  48. package/src/lib/runtime/telemetry-agent-runner.ts +10 -5
  49. package/dist/chunk-27JKTS6P.mjs +0 -1704
  50. package/dist/chunk-27JKTS6P.mjs.map +0 -1
  51. package/dist/chunk-2GPTVDTO.mjs +0 -25
  52. package/dist/chunk-3AJVKDZX.mjs +0 -3097
  53. package/dist/chunk-3AJVKDZX.mjs.map +0 -1
  54. package/dist/chunk-4EHJ4XFJ.mjs +0 -25
  55. package/dist/chunk-4EHJ4XFJ.mjs.map +0 -1
  56. package/dist/chunk-4IANB4TC.mjs +0 -25
  57. package/dist/chunk-4IANB4TC.mjs.map +0 -1
  58. package/dist/chunk-4OGE3SLW.mjs +0 -3100
  59. package/dist/chunk-4OGE3SLW.mjs.map +0 -1
  60. package/dist/chunk-54YJBMCP.mjs +0 -3097
  61. package/dist/chunk-54YJBMCP.mjs.map +0 -1
  62. package/dist/chunk-6ER4SZYH.mjs +0 -74
  63. package/dist/chunk-6ER4SZYH.mjs.map +0 -1
  64. package/dist/chunk-6TNSLHVR.mjs +0 -74
  65. package/dist/chunk-6TNSLHVR.mjs.map +0 -1
  66. package/dist/chunk-7V4BK7TZ.mjs +0 -25
  67. package/dist/chunk-7V4BK7TZ.mjs.map +0 -1
  68. package/dist/chunk-7YZIEXD2.mjs +0 -74
  69. package/dist/chunk-7YZIEXD2.mjs.map +0 -1
  70. package/dist/chunk-A4XHOAFU.mjs +0 -25
  71. package/dist/chunk-A4XHOAFU.mjs.map +0 -1
  72. package/dist/chunk-A555KEAD.mjs +0 -6020
  73. package/dist/chunk-A555KEAD.mjs.map +0 -1
  74. package/dist/chunk-AF73TFTX.mjs +0 -74
  75. package/dist/chunk-AF73TFTX.mjs.map +0 -1
  76. package/dist/chunk-AQG2SVCA.mjs.map +0 -1
  77. package/dist/chunk-BJZHMXND.mjs +0 -74
  78. package/dist/chunk-BJZHMXND.mjs.map +0 -1
  79. package/dist/chunk-CB2OJXF6.mjs +0 -25
  80. package/dist/chunk-CB2OJXF6.mjs.map +0 -1
  81. package/dist/chunk-CEOMFPJU.mjs +0 -6020
  82. package/dist/chunk-CEOMFPJU.mjs.map +0 -1
  83. package/dist/chunk-CZVLR7CC.mjs +0 -175
  84. package/dist/chunk-CZVLR7CC.mjs.map +0 -1
  85. package/dist/chunk-DCEEHMLJ.mjs.map +0 -1
  86. package/dist/chunk-DE3CLKUG.mjs +0 -25
  87. package/dist/chunk-DE3CLKUG.mjs.map +0 -1
  88. package/dist/chunk-DTPRUTNV.mjs +0 -25
  89. package/dist/chunk-DTPRUTNV.mjs.map +0 -1
  90. package/dist/chunk-ERUOA47O.mjs.map +0 -1
  91. package/dist/chunk-ESSRC64W.mjs +0 -74
  92. package/dist/chunk-ESSRC64W.mjs.map +0 -1
  93. package/dist/chunk-GRAN6K6N.mjs +0 -25
  94. package/dist/chunk-GRAN6K6N.mjs.map +0 -1
  95. package/dist/chunk-I27F2UPA.mjs +0 -175
  96. package/dist/chunk-I27F2UPA.mjs.map +0 -1
  97. package/dist/chunk-IAZKTOQW.mjs +0 -25
  98. package/dist/chunk-IAZKTOQW.mjs.map +0 -1
  99. package/dist/chunk-J6XZ5MFB.mjs +0 -25
  100. package/dist/chunk-J6XZ5MFB.mjs.map +0 -1
  101. package/dist/chunk-JJ32MA4C.mjs +0 -73
  102. package/dist/chunk-JJ32MA4C.mjs.map +0 -1
  103. package/dist/chunk-JJY4ZTHQ.mjs +0 -25
  104. package/dist/chunk-JJY4ZTHQ.mjs.map +0 -1
  105. package/dist/chunk-KEYLBFU2.mjs +0 -3117
  106. package/dist/chunk-KEYLBFU2.mjs.map +0 -1
  107. package/dist/chunk-KQ53L4WZ.mjs +0 -3094
  108. package/dist/chunk-KQ53L4WZ.mjs.map +0 -1
  109. package/dist/chunk-KTELVQ67.mjs +0 -3098
  110. package/dist/chunk-KTELVQ67.mjs.map +0 -1
  111. package/dist/chunk-LPEPX6NH.mjs +0 -25
  112. package/dist/chunk-LPEPX6NH.mjs.map +0 -1
  113. package/dist/chunk-MDXE55DK.mjs +0 -3117
  114. package/dist/chunk-MDXE55DK.mjs.map +0 -1
  115. package/dist/chunk-MMFUVOXH.mjs +0 -73
  116. package/dist/chunk-MMFUVOXH.mjs.map +0 -1
  117. package/dist/chunk-N3Y4U66N.mjs +0 -253
  118. package/dist/chunk-N3Y4U66N.mjs.map +0 -1
  119. package/dist/chunk-O7UYB4MH.mjs +0 -25
  120. package/dist/chunk-O7UYB4MH.mjs.map +0 -1
  121. package/dist/chunk-OFNVQHNM.mjs +0 -3089
  122. package/dist/chunk-OFNVQHNM.mjs.map +0 -1
  123. package/dist/chunk-OFSV5GET.mjs.map +0 -1
  124. package/dist/chunk-OMRST67R.mjs +0 -25
  125. package/dist/chunk-OMRST67R.mjs.map +0 -1
  126. package/dist/chunk-PRZHE74A.mjs +0 -25
  127. package/dist/chunk-PRZHE74A.mjs.map +0 -1
  128. package/dist/chunk-PTYRVXXP.mjs +0 -80
  129. package/dist/chunk-PTYRVXXP.mjs.map +0 -1
  130. package/dist/chunk-R22B5CCO.mjs +0 -25
  131. package/dist/chunk-R22B5CCO.mjs.map +0 -1
  132. package/dist/chunk-SHBDMA63.mjs +0 -141
  133. package/dist/chunk-SHBDMA63.mjs.map +0 -1
  134. package/dist/chunk-SPVXBPRA.mjs +0 -74
  135. package/dist/chunk-SPVXBPRA.mjs.map +0 -1
  136. package/dist/chunk-T72G46ME.mjs +0 -25
  137. package/dist/chunk-T72G46ME.mjs.map +0 -1
  138. package/dist/chunk-TGELROPU.mjs +0 -25
  139. package/dist/chunk-TGELROPU.mjs.map +0 -1
  140. package/dist/chunk-UNX4IAAD.mjs +0 -25
  141. package/dist/chunk-UNX4IAAD.mjs.map +0 -1
  142. package/dist/chunk-V4DHVC7M.mjs +0 -3085
  143. package/dist/chunk-V4DHVC7M.mjs.map +0 -1
  144. package/dist/chunk-VVRFOB66.mjs +0 -25
  145. package/dist/chunk-VVRFOB66.mjs.map +0 -1
  146. package/dist/chunk-W6NVBYM6.mjs +0 -80
  147. package/dist/chunk-W6NVBYM6.mjs.map +0 -1
  148. package/dist/chunk-W7MBACGC.mjs +0 -74
  149. package/dist/chunk-W7MBACGC.mjs.map +0 -1
  150. package/dist/chunk-WMD4XZZS.mjs +0 -25
  151. package/dist/chunk-WMD4XZZS.mjs.map +0 -1
  152. package/dist/chunk-WX2ZNCRT.mjs +0 -74
  153. package/dist/chunk-WX2ZNCRT.mjs.map +0 -1
  154. package/dist/chunk-Y2Z62E2T.mjs +0 -74
  155. package/dist/chunk-Y2Z62E2T.mjs.map +0 -1
  156. package/dist/chunk-YO4I6RVI.mjs +0 -25
  157. package/dist/chunk-YO4I6RVI.mjs.map +0 -1
  158. package/dist/chunk-Z6Q5IW6I.mjs +0 -3098
  159. package/dist/chunk-Z6Q5IW6I.mjs.map +0 -1
  160. package/dist/chunk-Z726O3G2.mjs +0 -25
  161. package/dist/chunk-Z726O3G2.mjs.map +0 -1
  162. package/dist/chunk-ZE4SMZZR.mjs +0 -3097
  163. package/dist/chunk-ZE4SMZZR.mjs.map +0 -1
  164. package/dist/chunk-ZULZB33C.mjs +0 -73
  165. package/dist/chunk-ZULZB33C.mjs.map +0 -1
  166. package/dist/chunk-ZVRGXMY7.mjs +0 -25
  167. package/dist/chunk-ZVRGXMY7.mjs.map +0 -1
  168. package/dist/chunk-ZZ35WBYQ.mjs +0 -25
  169. package/dist/chunk-ZZ35WBYQ.mjs.map +0 -1
  170. package/dist/groq-adapter-540da9c3.d.ts +0 -331
  171. package/dist/groq-adapter-c8aec5c5.d.ts +0 -321
  172. package/dist/index-96b330da.d.ts +0 -119
  173. package/dist/langserve-0c6100e3.d.ts +0 -257
  174. package/dist/langserve-978d5790.d.ts +0 -243
  175. package/dist/shared-0a7346ce.d.ts +0 -466
  176. package/dist/shared-9ed1dc31.d.ts +0 -414
  177. package/dist/shared-da5708fe.d.ts +0 -449
  178. /package/dist/{chunk-45RCC3ZS.mjs.map → chunk-BJEYMRDD.mjs.map} +0 -0
  179. /package/dist/{chunk-2GPTVDTO.mjs.map → chunk-FMU55SEU.mjs.map} +0 -0
  180. /package/dist/{chunk-4KES76K3.mjs.map → chunk-Z752VE75.mjs.map} +0 -0
@@ -1,119 +0,0 @@
1
- import { BaseMessageInput } from './graphql/types/base/index.js';
2
-
3
- declare enum MessageRole {
4
- user = "user",
5
- assistant = "assistant",
6
- system = "system",
7
- tool = "tool",
8
- developer = "developer"
9
- }
10
- declare enum ActionInputAvailability {
11
- disabled = "disabled",
12
- enabled = "enabled",
13
- remote = "remote"
14
- }
15
-
16
- declare class MessageInput extends BaseMessageInput {
17
- textMessage?: TextMessageInput;
18
- actionExecutionMessage?: ActionExecutionMessageInput;
19
- resultMessage?: ResultMessageInput;
20
- agentStateMessage?: AgentStateMessageInput;
21
- imageMessage?: ImageMessageInput;
22
- }
23
- declare class TextMessageInput {
24
- content: string;
25
- parentMessageId?: string;
26
- role: MessageRole;
27
- }
28
- declare class ActionExecutionMessageInput {
29
- name: string;
30
- arguments: string;
31
- parentMessageId?: string;
32
- scope?: String;
33
- }
34
- declare class ResultMessageInput {
35
- actionExecutionId: string;
36
- actionName: string;
37
- parentMessageId?: string;
38
- result: string;
39
- }
40
- declare class AgentStateMessageInput {
41
- threadId: string;
42
- agentName: string;
43
- role: MessageRole;
44
- state: string;
45
- running: boolean;
46
- nodeName: string;
47
- runId: string;
48
- active: boolean;
49
- }
50
- declare class ImageMessageInput {
51
- format: string;
52
- bytes: string;
53
- parentMessageId?: string;
54
- role: MessageRole;
55
- }
56
-
57
- type MessageType = "TextMessage" | "ActionExecutionMessage" | "ResultMessage" | "AgentStateMessage" | "ImageMessage";
58
- declare class Message extends BaseMessageInput {
59
- type: MessageType;
60
- isTextMessage(): this is TextMessage;
61
- isActionExecutionMessage(): this is ActionExecutionMessage;
62
- isResultMessage(): this is ResultMessage;
63
- isAgentStateMessage(): this is AgentStateMessage;
64
- isImageMessage(): this is ImageMessage;
65
- }
66
- declare class TextMessage extends Message implements TextMessageInput {
67
- type: MessageType;
68
- content: string;
69
- role: MessageRole;
70
- parentMessageId?: string;
71
- }
72
- declare class ActionExecutionMessage extends Message implements Omit<ActionExecutionMessageInput, "arguments" | "scope"> {
73
- type: MessageType;
74
- name: string;
75
- arguments: Record<string, any>;
76
- parentMessageId?: string;
77
- }
78
- declare class ResultMessage extends Message implements ResultMessageInput {
79
- type: MessageType;
80
- actionExecutionId: string;
81
- actionName: string;
82
- result: string;
83
- static encodeResult(result: any, error?: {
84
- code: string;
85
- message: string;
86
- } | string | Error): string;
87
- static decodeResult(result: string): {
88
- error?: {
89
- code: string;
90
- message: string;
91
- };
92
- result: string;
93
- };
94
- hasError(): boolean;
95
- getError(): {
96
- code: string;
97
- message: string;
98
- } | undefined;
99
- }
100
- declare class AgentStateMessage extends Message implements Omit<AgentStateMessageInput, "state"> {
101
- type: MessageType;
102
- threadId: string;
103
- agentName: string;
104
- nodeName: string;
105
- runId: string;
106
- active: boolean;
107
- role: MessageRole;
108
- state: any;
109
- running: boolean;
110
- }
111
- declare class ImageMessage extends Message implements ImageMessageInput {
112
- type: MessageType;
113
- format: string;
114
- bytes: string;
115
- role: MessageRole;
116
- parentMessageId?: string;
117
- }
118
-
119
- export { ActionInputAvailability as A, ImageMessage as I, Message as M, ResultMessage as R, TextMessage as T, ActionExecutionMessage as a, MessageInput as b, MessageType as c, AgentStateMessage as d };
@@ -1,257 +0,0 @@
1
- import { A as ActionInputAvailability, T as TextMessage, a as ActionExecutionMessage, R as ResultMessage, M as Message } from './index-96b330da.js';
2
- import * as rxjs from 'rxjs';
3
- import { Subject, ReplaySubject } from 'rxjs';
4
- import { Action, Parameter } from '@copilotkit/shared';
5
-
6
- declare class ActionInput {
7
- name: string;
8
- description: string;
9
- jsonSchema: string;
10
- available?: ActionInputAvailability;
11
- }
12
-
13
- declare enum GuardrailsResultStatus {
14
- ALLOWED = "allowed",
15
- DENIED = "denied"
16
- }
17
- declare class GuardrailsResult {
18
- status: GuardrailsResultStatus;
19
- reason?: string;
20
- }
21
-
22
- declare enum RuntimeEventTypes {
23
- TextMessageStart = "TextMessageStart",
24
- TextMessageContent = "TextMessageContent",
25
- TextMessageEnd = "TextMessageEnd",
26
- ActionExecutionStart = "ActionExecutionStart",
27
- ActionExecutionArgs = "ActionExecutionArgs",
28
- ActionExecutionEnd = "ActionExecutionEnd",
29
- ActionExecutionResult = "ActionExecutionResult",
30
- AgentStateMessage = "AgentStateMessage",
31
- MetaEvent = "MetaEvent",
32
- RunError = "RunError"
33
- }
34
- declare enum RuntimeMetaEventName {
35
- LangGraphInterruptEvent = "LangGraphInterruptEvent",
36
- LangGraphInterruptResumeEvent = "LangGraphInterruptResumeEvent",
37
- CopilotKitLangGraphInterruptEvent = "CopilotKitLangGraphInterruptEvent"
38
- }
39
- type RunTimeMetaEvent = {
40
- type: RuntimeEventTypes.MetaEvent;
41
- name: RuntimeMetaEventName.LangGraphInterruptEvent;
42
- value: string;
43
- } | {
44
- type: RuntimeEventTypes.MetaEvent;
45
- name: RuntimeMetaEventName.CopilotKitLangGraphInterruptEvent;
46
- data: {
47
- value: string;
48
- messages: (TextMessage | ActionExecutionMessage | ResultMessage)[];
49
- };
50
- } | {
51
- type: RuntimeEventTypes.MetaEvent;
52
- name: RuntimeMetaEventName.LangGraphInterruptResumeEvent;
53
- data: string;
54
- };
55
- type RuntimeErrorEvent = {
56
- type: RuntimeEventTypes.RunError;
57
- message: string;
58
- code?: string;
59
- };
60
- type RuntimeEvent = {
61
- type: RuntimeEventTypes.TextMessageStart;
62
- messageId: string;
63
- parentMessageId?: string;
64
- } | {
65
- type: RuntimeEventTypes.TextMessageContent;
66
- messageId: string;
67
- content: string;
68
- } | {
69
- type: RuntimeEventTypes.TextMessageEnd;
70
- messageId: string;
71
- } | {
72
- type: RuntimeEventTypes.ActionExecutionStart;
73
- actionExecutionId: string;
74
- actionName: string;
75
- parentMessageId?: string;
76
- } | {
77
- type: RuntimeEventTypes.ActionExecutionArgs;
78
- actionExecutionId: string;
79
- args: string;
80
- } | {
81
- type: RuntimeEventTypes.ActionExecutionEnd;
82
- actionExecutionId: string;
83
- } | {
84
- type: RuntimeEventTypes.ActionExecutionResult;
85
- actionName: string;
86
- actionExecutionId: string;
87
- result: string;
88
- } | {
89
- type: RuntimeEventTypes.AgentStateMessage;
90
- threadId: string;
91
- agentName: string;
92
- nodeName: string;
93
- runId: string;
94
- active: boolean;
95
- role: string;
96
- state: string;
97
- running: boolean;
98
- } | RunTimeMetaEvent | RuntimeErrorEvent;
99
- type EventSourceCallback = (eventStream$: RuntimeEventSubject) => Promise<void>;
100
- declare class RuntimeEventSubject extends ReplaySubject<RuntimeEvent> {
101
- constructor();
102
- sendTextMessageStart({ messageId, parentMessageId, }: {
103
- messageId: string;
104
- parentMessageId?: string;
105
- }): void;
106
- sendTextMessageContent({ messageId, content }: {
107
- messageId: string;
108
- content: string;
109
- }): void;
110
- sendTextMessageEnd({ messageId }: {
111
- messageId: string;
112
- }): void;
113
- sendTextMessage(messageId: string, content: string): void;
114
- sendActionExecutionStart({ actionExecutionId, actionName, parentMessageId, }: {
115
- actionExecutionId: string;
116
- actionName: string;
117
- parentMessageId?: string;
118
- }): void;
119
- sendActionExecutionArgs({ actionExecutionId, args, }: {
120
- actionExecutionId: string;
121
- args: string;
122
- }): void;
123
- sendActionExecutionEnd({ actionExecutionId }: {
124
- actionExecutionId: string;
125
- }): void;
126
- sendActionExecution({ actionExecutionId, actionName, args, parentMessageId, }: {
127
- actionExecutionId: string;
128
- actionName: string;
129
- args: string;
130
- parentMessageId?: string;
131
- }): void;
132
- sendActionExecutionResult({ actionExecutionId, actionName, result, error, }: {
133
- actionExecutionId: string;
134
- actionName: string;
135
- result?: string;
136
- error?: {
137
- code: string;
138
- message: string;
139
- };
140
- }): void;
141
- sendAgentStateMessage({ threadId, agentName, nodeName, runId, active, role, state, running, }: {
142
- threadId: string;
143
- agentName: string;
144
- nodeName: string;
145
- runId: string;
146
- active: boolean;
147
- role: string;
148
- state: string;
149
- running: boolean;
150
- }): void;
151
- }
152
- declare class RuntimeEventSource {
153
- private eventStream$;
154
- private callback;
155
- private errorHandler?;
156
- private errorContext?;
157
- constructor(params?: {
158
- errorHandler?: (error: any, context: any) => Promise<void>;
159
- errorContext?: any;
160
- });
161
- stream(callback: EventSourceCallback): Promise<void>;
162
- sendErrorMessageToChat(message?: string): void;
163
- processRuntimeEvents({ serverSideActions, guardrailsResult$, actionInputsWithoutAgents, threadId, }: {
164
- serverSideActions: Action<any>[];
165
- guardrailsResult$?: Subject<GuardrailsResult>;
166
- actionInputsWithoutAgents: ActionInput[];
167
- threadId: string;
168
- }): rxjs.Observable<RuntimeEvent>;
169
- }
170
-
171
- declare class ForwardedParametersInput {
172
- model?: string;
173
- maxTokens?: number;
174
- stop?: string[];
175
- toolChoice?: String;
176
- toolChoiceFunctionName?: string;
177
- temperature?: number;
178
- }
179
-
180
- /**
181
- * The extensions input is used to pass additional information to the copilot runtime, specific to a
182
- * service adapter or agent framework.
183
- */
184
- declare class ExtensionsInput {
185
- openaiAssistantAPI?: OpenAIApiAssistantAPIInput;
186
- }
187
- declare class OpenAIApiAssistantAPIInput {
188
- runId?: string;
189
- threadId?: string;
190
- }
191
-
192
- /**
193
- * The extensions response is used to receive additional information from the copilot runtime, specific to a
194
- * service adapter or agent framework.
195
- *
196
- * Next time a request to the runtime is made, the extensions response will be included in the request as input.
197
- */
198
- declare class ExtensionsResponse {
199
- openaiAssistantAPI?: OpenAIApiAssistantAPIResponse;
200
- }
201
- declare class OpenAIApiAssistantAPIResponse {
202
- runId?: string;
203
- threadId?: string;
204
- }
205
-
206
- declare class AgentSessionInput {
207
- agentName: string;
208
- threadId?: string;
209
- nodeName?: string;
210
- }
211
-
212
- declare class AgentStateInput {
213
- agentName: string;
214
- state: string;
215
- config?: string;
216
- }
217
-
218
- interface CopilotRuntimeChatCompletionRequest {
219
- eventSource: RuntimeEventSource;
220
- messages: Message[];
221
- actions: ActionInput[];
222
- model?: string;
223
- threadId?: string;
224
- runId?: string;
225
- forwardedParameters?: ForwardedParametersInput;
226
- extensions?: ExtensionsInput;
227
- agentSession?: AgentSessionInput;
228
- agentStates?: AgentStateInput[];
229
- }
230
- interface CopilotRuntimeChatCompletionResponse {
231
- threadId: string;
232
- runId?: string;
233
- extensions?: ExtensionsResponse;
234
- }
235
- interface CopilotServiceAdapter {
236
- process(request: CopilotRuntimeChatCompletionRequest): Promise<CopilotRuntimeChatCompletionResponse>;
237
- }
238
-
239
- interface RemoteChainParameters {
240
- name: string;
241
- description: string;
242
- chainUrl: string;
243
- parameters?: Parameter[];
244
- parameterType?: "single" | "multi";
245
- }
246
- declare class RemoteChain {
247
- name: string;
248
- description: string;
249
- chainUrl: string;
250
- parameters?: Parameter[];
251
- parameterType: "single" | "multi";
252
- constructor(options: RemoteChainParameters);
253
- toAction(): Promise<Action<any>>;
254
- inferLangServeParameters(): Promise<void>;
255
- }
256
-
257
- export { ActionInput as A, CopilotRuntimeChatCompletionRequest as C, ExtensionsInput as E, ForwardedParametersInput as F, RemoteChainParameters as R, CopilotRuntimeChatCompletionResponse as a, CopilotServiceAdapter as b, RemoteChain as c, AgentSessionInput as d, AgentStateInput as e, RuntimeEventSource as f, ExtensionsResponse as g };
@@ -1,243 +0,0 @@
1
- import { T as TextMessage, A as ActionExecutionMessage, R as ResultMessage, b as ActionInputAvailability, M as Message } from './index-adbd78f1.js';
2
- import { ReplaySubject } from 'rxjs';
3
- import { Parameter, Action } from '@copilotkit/shared';
4
-
5
- /**
6
- * The extensions response is used to receive additional information from the copilot runtime, specific to a
7
- * service adapter or agent framework.
8
- *
9
- * Next time a request to the runtime is made, the extensions response will be included in the request as input.
10
- */
11
- declare class ExtensionsResponse {
12
- openaiAssistantAPI?: OpenAIApiAssistantAPIResponse;
13
- }
14
- declare class OpenAIApiAssistantAPIResponse {
15
- runId?: string;
16
- threadId?: string;
17
- }
18
-
19
- declare enum RuntimeEventTypes {
20
- TextMessageStart = "TextMessageStart",
21
- TextMessageContent = "TextMessageContent",
22
- TextMessageEnd = "TextMessageEnd",
23
- ActionExecutionStart = "ActionExecutionStart",
24
- ActionExecutionArgs = "ActionExecutionArgs",
25
- ActionExecutionEnd = "ActionExecutionEnd",
26
- ActionExecutionResult = "ActionExecutionResult",
27
- AgentStateMessage = "AgentStateMessage",
28
- MetaEvent = "MetaEvent",
29
- RunError = "RunError"
30
- }
31
- declare enum RuntimeMetaEventName {
32
- LangGraphInterruptEvent = "LangGraphInterruptEvent",
33
- LangGraphInterruptResumeEvent = "LangGraphInterruptResumeEvent",
34
- CopilotKitLangGraphInterruptEvent = "CopilotKitLangGraphInterruptEvent"
35
- }
36
- type RunTimeMetaEvent = {
37
- type: RuntimeEventTypes.MetaEvent;
38
- name: RuntimeMetaEventName.LangGraphInterruptEvent;
39
- value: string;
40
- } | {
41
- type: RuntimeEventTypes.MetaEvent;
42
- name: RuntimeMetaEventName.CopilotKitLangGraphInterruptEvent;
43
- data: {
44
- value: string;
45
- messages: (TextMessage | ActionExecutionMessage | ResultMessage)[];
46
- };
47
- } | {
48
- type: RuntimeEventTypes.MetaEvent;
49
- name: RuntimeMetaEventName.LangGraphInterruptResumeEvent;
50
- data: string;
51
- };
52
- type RuntimeErrorEvent = {
53
- type: RuntimeEventTypes.RunError;
54
- message: string;
55
- code?: string;
56
- };
57
- type RuntimeEvent = {
58
- type: RuntimeEventTypes.TextMessageStart;
59
- messageId: string;
60
- parentMessageId?: string;
61
- } | {
62
- type: RuntimeEventTypes.TextMessageContent;
63
- messageId: string;
64
- content: string;
65
- } | {
66
- type: RuntimeEventTypes.TextMessageEnd;
67
- messageId: string;
68
- } | {
69
- type: RuntimeEventTypes.ActionExecutionStart;
70
- actionExecutionId: string;
71
- actionName: string;
72
- parentMessageId?: string;
73
- } | {
74
- type: RuntimeEventTypes.ActionExecutionArgs;
75
- actionExecutionId: string;
76
- args: string;
77
- } | {
78
- type: RuntimeEventTypes.ActionExecutionEnd;
79
- actionExecutionId: string;
80
- } | {
81
- type: RuntimeEventTypes.ActionExecutionResult;
82
- actionName: string;
83
- actionExecutionId: string;
84
- result: string;
85
- } | {
86
- type: RuntimeEventTypes.AgentStateMessage;
87
- threadId: string;
88
- agentName: string;
89
- nodeName: string;
90
- runId: string;
91
- active: boolean;
92
- role: string;
93
- state: string;
94
- running: boolean;
95
- } | RunTimeMetaEvent | RuntimeErrorEvent;
96
- type EventSourceCallback = (eventStream$: RuntimeEventSubject) => Promise<void>;
97
- declare class RuntimeEventSubject extends ReplaySubject<RuntimeEvent> {
98
- constructor();
99
- sendTextMessageStart({ messageId, parentMessageId, }: {
100
- messageId: string;
101
- parentMessageId?: string;
102
- }): void;
103
- sendTextMessageContent({ messageId, content }: {
104
- messageId: string;
105
- content: string;
106
- }): void;
107
- sendTextMessageEnd({ messageId }: {
108
- messageId: string;
109
- }): void;
110
- sendTextMessage(messageId: string, content: string): void;
111
- sendActionExecutionStart({ actionExecutionId, actionName, parentMessageId, }: {
112
- actionExecutionId: string;
113
- actionName: string;
114
- parentMessageId?: string;
115
- }): void;
116
- sendActionExecutionArgs({ actionExecutionId, args, }: {
117
- actionExecutionId: string;
118
- args: string;
119
- }): void;
120
- sendActionExecutionEnd({ actionExecutionId }: {
121
- actionExecutionId: string;
122
- }): void;
123
- sendActionExecution({ actionExecutionId, actionName, args, parentMessageId, }: {
124
- actionExecutionId: string;
125
- actionName: string;
126
- args: string;
127
- parentMessageId?: string;
128
- }): void;
129
- sendActionExecutionResult({ actionExecutionId, actionName, result, error, }: {
130
- actionExecutionId: string;
131
- actionName: string;
132
- result?: string;
133
- error?: {
134
- code: string;
135
- message: string;
136
- };
137
- }): void;
138
- sendAgentStateMessage({ threadId, agentName, nodeName, runId, active, role, state, running, }: {
139
- threadId: string;
140
- agentName: string;
141
- nodeName: string;
142
- runId: string;
143
- active: boolean;
144
- role: string;
145
- state: string;
146
- running: boolean;
147
- }): void;
148
- }
149
- declare class RuntimeEventSource {
150
- private eventStream$;
151
- private callback;
152
- private errorHandler?;
153
- private errorContext?;
154
- constructor(params?: {
155
- errorHandler?: (error: any, context: any) => Promise<void>;
156
- errorContext?: any;
157
- });
158
- stream(callback: EventSourceCallback): Promise<void>;
159
- }
160
-
161
- declare class ActionInput {
162
- name: string;
163
- description: string;
164
- jsonSchema: string;
165
- available?: ActionInputAvailability;
166
- }
167
-
168
- declare class ForwardedParametersInput {
169
- model?: string;
170
- maxTokens?: number;
171
- stop?: string[];
172
- toolChoice?: String;
173
- toolChoiceFunctionName?: string;
174
- temperature?: number;
175
- }
176
-
177
- /**
178
- * The extensions input is used to pass additional information to the copilot runtime, specific to a
179
- * service adapter or agent framework.
180
- */
181
- declare class ExtensionsInput {
182
- openaiAssistantAPI?: OpenAIApiAssistantAPIInput;
183
- }
184
- declare class OpenAIApiAssistantAPIInput {
185
- runId?: string;
186
- threadId?: string;
187
- }
188
-
189
- declare class AgentSessionInput {
190
- agentName: string;
191
- threadId?: string;
192
- nodeName?: string;
193
- }
194
-
195
- declare class AgentStateInput {
196
- agentName: string;
197
- state: string;
198
- config?: string;
199
- }
200
-
201
- interface CopilotRuntimeChatCompletionRequest {
202
- eventSource: RuntimeEventSource;
203
- messages: Message[];
204
- actions: ActionInput[];
205
- model?: string;
206
- threadId?: string;
207
- runId?: string;
208
- forwardedParameters?: ForwardedParametersInput;
209
- extensions?: ExtensionsInput;
210
- agentSession?: AgentSessionInput;
211
- agentStates?: AgentStateInput[];
212
- }
213
- interface CopilotRuntimeChatCompletionResponse {
214
- threadId: string;
215
- runId?: string;
216
- extensions?: ExtensionsResponse;
217
- }
218
- interface CopilotServiceAdapter {
219
- provider?: string;
220
- model?: string;
221
- process(request: CopilotRuntimeChatCompletionRequest): Promise<CopilotRuntimeChatCompletionResponse>;
222
- name?: string;
223
- }
224
-
225
- interface RemoteChainParameters {
226
- name: string;
227
- description: string;
228
- chainUrl: string;
229
- parameters?: Parameter[];
230
- parameterType?: "single" | "multi";
231
- }
232
- declare class RemoteChain {
233
- name: string;
234
- description: string;
235
- chainUrl: string;
236
- parameters?: Parameter[];
237
- parameterType: "single" | "multi";
238
- constructor(options: RemoteChainParameters);
239
- toAction(): Promise<Action<any>>;
240
- inferLangServeParameters(): Promise<void>;
241
- }
242
-
243
- export { CopilotRuntimeChatCompletionRequest as C, RemoteChainParameters as R, CopilotRuntimeChatCompletionResponse as a, CopilotServiceAdapter as b, RemoteChain as c };