@copilotkit/runtime-client-gql 0.0.0-mme-load-agent-state-20250117154700

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 (92) hide show
  1. package/CHANGELOG.md +937 -0
  2. package/README.md +46 -0
  3. package/codegen.ts +22 -0
  4. package/dist/chunk-7ECCT6PK.mjs +1 -0
  5. package/dist/chunk-7ECCT6PK.mjs.map +1 -0
  6. package/dist/chunk-BBNGLVX5.mjs +38 -0
  7. package/dist/chunk-BBNGLVX5.mjs.map +1 -0
  8. package/dist/chunk-GQ2BQR46.mjs +119 -0
  9. package/dist/chunk-GQ2BQR46.mjs.map +1 -0
  10. package/dist/chunk-JGGSE6H3.mjs +20 -0
  11. package/dist/chunk-JGGSE6H3.mjs.map +1 -0
  12. package/dist/chunk-LBECNDL5.mjs +56 -0
  13. package/dist/chunk-LBECNDL5.mjs.map +1 -0
  14. package/dist/chunk-MLWD2EGY.mjs +200 -0
  15. package/dist/chunk-MLWD2EGY.mjs.map +1 -0
  16. package/dist/chunk-RHAQH56F.mjs +84 -0
  17. package/dist/chunk-RHAQH56F.mjs.map +1 -0
  18. package/dist/chunk-RIPDMDI6.mjs +77 -0
  19. package/dist/chunk-RIPDMDI6.mjs.map +1 -0
  20. package/dist/chunk-XZPL6QVK.mjs +24 -0
  21. package/dist/chunk-XZPL6QVK.mjs.map +1 -0
  22. package/dist/client/CopilotRuntimeClient.d.ts +37 -0
  23. package/dist/client/CopilotRuntimeClient.js +251 -0
  24. package/dist/client/CopilotRuntimeClient.js.map +1 -0
  25. package/dist/client/CopilotRuntimeClient.mjs +11 -0
  26. package/dist/client/CopilotRuntimeClient.mjs.map +1 -0
  27. package/dist/client/conversion.d.ts +11 -0
  28. package/dist/client/conversion.js +296 -0
  29. package/dist/client/conversion.js.map +1 -0
  30. package/dist/client/conversion.mjs +17 -0
  31. package/dist/client/conversion.mjs.map +1 -0
  32. package/dist/client/index.d.ts +8 -0
  33. package/dist/client/index.js +541 -0
  34. package/dist/client/index.js.map +1 -0
  35. package/dist/client/index.mjs +38 -0
  36. package/dist/client/index.mjs.map +1 -0
  37. package/dist/client/types.d.ts +55 -0
  38. package/dist/client/types.js +113 -0
  39. package/dist/client/types.js.map +1 -0
  40. package/dist/client/types.mjs +18 -0
  41. package/dist/client/types.mjs.map +1 -0
  42. package/dist/graphql/@generated/fragment-masking.d.ts +22 -0
  43. package/dist/graphql/@generated/fragment-masking.js +50 -0
  44. package/dist/graphql/@generated/fragment-masking.js.map +1 -0
  45. package/dist/graphql/@generated/fragment-masking.mjs +11 -0
  46. package/dist/graphql/@generated/fragment-masking.mjs.map +1 -0
  47. package/dist/graphql/@generated/gql.d.ts +53 -0
  48. package/dist/graphql/@generated/gql.js +45 -0
  49. package/dist/graphql/@generated/gql.js.map +1 -0
  50. package/dist/graphql/@generated/gql.mjs +8 -0
  51. package/dist/graphql/@generated/gql.mjs.map +1 -0
  52. package/dist/graphql/@generated/graphql.d.ts +477 -0
  53. package/dist/graphql/@generated/graphql.js +88 -0
  54. package/dist/graphql/@generated/graphql.js.map +1 -0
  55. package/dist/graphql/@generated/graphql.mjs +23 -0
  56. package/dist/graphql/@generated/graphql.mjs.map +1 -0
  57. package/dist/graphql/@generated/index.d.ts +4 -0
  58. package/dist/graphql/@generated/index.js +69 -0
  59. package/dist/graphql/@generated/index.js.map +1 -0
  60. package/dist/graphql/@generated/index.mjs +16 -0
  61. package/dist/graphql/@generated/index.mjs.map +1 -0
  62. package/dist/graphql/definitions/mutations.d.ts +9 -0
  63. package/dist/graphql/definitions/mutations.js +121 -0
  64. package/dist/graphql/definitions/mutations.js.map +1 -0
  65. package/dist/graphql/definitions/mutations.mjs +9 -0
  66. package/dist/graphql/definitions/mutations.mjs.map +1 -0
  67. package/dist/graphql/definitions/queries.d.ts +11 -0
  68. package/dist/graphql/definitions/queries.js +76 -0
  69. package/dist/graphql/definitions/queries.js.map +1 -0
  70. package/dist/graphql/definitions/queries.mjs +11 -0
  71. package/dist/graphql/definitions/queries.mjs.map +1 -0
  72. package/dist/index.d.ts +8 -0
  73. package/dist/index.js +591 -0
  74. package/dist/index.js.map +1 -0
  75. package/dist/index.mjs +57 -0
  76. package/dist/index.mjs.map +1 -0
  77. package/jest.config.js +5 -0
  78. package/package.json +77 -0
  79. package/src/client/CopilotRuntimeClient.ts +150 -0
  80. package/src/client/conversion.ts +211 -0
  81. package/src/client/index.ts +10 -0
  82. package/src/client/types.ts +127 -0
  83. package/src/graphql/@generated/fragment-masking.ts +87 -0
  84. package/src/graphql/@generated/gql.ts +52 -0
  85. package/src/graphql/@generated/graphql.ts +366 -0
  86. package/src/graphql/@generated/index.ts +2 -0
  87. package/src/graphql/definitions/mutations.ts +73 -0
  88. package/src/graphql/definitions/queries.ts +24 -0
  89. package/src/index.ts +2 -0
  90. package/tsconfig.json +16 -0
  91. package/tsup.config.ts +33 -0
  92. package/typedoc.json +4 -0
@@ -0,0 +1,366 @@
1
+ /* eslint-disable */
2
+ import type { TypedDocumentNode as DocumentNode } from '@graphql-typed-document-node/core';
3
+ export type Maybe<T> = T | null;
4
+ export type InputMaybe<T> = Maybe<T>;
5
+ export type Exact<T extends { [key: string]: unknown }> = { [K in keyof T]: T[K] };
6
+ export type MakeOptional<T, K extends keyof T> = Omit<T, K> & { [SubKey in K]?: Maybe<T[SubKey]> };
7
+ export type MakeMaybe<T, K extends keyof T> = Omit<T, K> & { [SubKey in K]: Maybe<T[SubKey]> };
8
+ export type MakeEmpty<T extends { [key: string]: unknown }, K extends keyof T> = { [_ in K]?: never };
9
+ export type Incremental<T> = T | { [P in keyof T]?: P extends ' $fragmentName' | '__typename' ? T[P] : never };
10
+ /** All built-in and custom scalars, mapped to their actual values */
11
+ export type Scalars = {
12
+ ID: { input: string; output: string; }
13
+ String: { input: string; output: string; }
14
+ Boolean: { input: boolean; output: boolean; }
15
+ Int: { input: number; output: number; }
16
+ Float: { input: number; output: number; }
17
+ /** 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. */
18
+ DateTimeISO: { input: any; output: any; }
19
+ /** The `JSON` scalar type represents JSON values as specified by [ECMA-404](http://www.ecma-international.org/publications/files/ECMA-ST/ECMA-404.pdf). */
20
+ JSON: { input: any; output: any; }
21
+ /** The `JSONObject` scalar type represents JSON objects as specified by [ECMA-404](http://www.ecma-international.org/publications/files/ECMA-ST/ECMA-404.pdf). */
22
+ JSONObject: { input: any; output: any; }
23
+ };
24
+
25
+ export type ActionExecutionMessageInput = {
26
+ arguments: Scalars['String']['input'];
27
+ name: Scalars['String']['input'];
28
+ parentMessageId?: InputMaybe<Scalars['String']['input']>;
29
+ /** @deprecated This field will be removed in a future version */
30
+ scope?: InputMaybe<Scalars['String']['input']>;
31
+ };
32
+
33
+ export type ActionExecutionMessageOutput = BaseMessageOutput & {
34
+ __typename?: 'ActionExecutionMessageOutput';
35
+ arguments: Array<Scalars['String']['output']>;
36
+ createdAt: Scalars['DateTimeISO']['output'];
37
+ id: Scalars['String']['output'];
38
+ name: Scalars['String']['output'];
39
+ parentMessageId?: Maybe<Scalars['String']['output']>;
40
+ /** @deprecated This field will be removed in a future version */
41
+ scope?: Maybe<Scalars['String']['output']>;
42
+ status: MessageStatus;
43
+ };
44
+
45
+ export type ActionInput = {
46
+ available?: InputMaybe<ActionInputAvailability>;
47
+ description: Scalars['String']['input'];
48
+ jsonSchema: Scalars['String']['input'];
49
+ name: Scalars['String']['input'];
50
+ };
51
+
52
+ /** The availability of the frontend action */
53
+ export enum ActionInputAvailability {
54
+ Disabled = 'disabled',
55
+ Enabled = 'enabled',
56
+ Remote = 'remote'
57
+ }
58
+
59
+ export type Agent = {
60
+ __typename?: 'Agent';
61
+ description: Scalars['String']['output'];
62
+ id: Scalars['String']['output'];
63
+ name: Scalars['String']['output'];
64
+ };
65
+
66
+ export type AgentSessionInput = {
67
+ agentName: Scalars['String']['input'];
68
+ nodeName?: InputMaybe<Scalars['String']['input']>;
69
+ threadId?: InputMaybe<Scalars['String']['input']>;
70
+ };
71
+
72
+ export type AgentStateInput = {
73
+ agentName: Scalars['String']['input'];
74
+ state: Scalars['String']['input'];
75
+ };
76
+
77
+ export type AgentStateMessageInput = {
78
+ active: Scalars['Boolean']['input'];
79
+ agentName: Scalars['String']['input'];
80
+ nodeName: Scalars['String']['input'];
81
+ role: MessageRole;
82
+ runId: Scalars['String']['input'];
83
+ running: Scalars['Boolean']['input'];
84
+ state: Scalars['String']['input'];
85
+ threadId: Scalars['String']['input'];
86
+ };
87
+
88
+ export type AgentStateMessageOutput = BaseMessageOutput & {
89
+ __typename?: 'AgentStateMessageOutput';
90
+ active: Scalars['Boolean']['output'];
91
+ agentName: Scalars['String']['output'];
92
+ createdAt: Scalars['DateTimeISO']['output'];
93
+ id: Scalars['String']['output'];
94
+ nodeName: Scalars['String']['output'];
95
+ role: MessageRole;
96
+ runId: Scalars['String']['output'];
97
+ running: Scalars['Boolean']['output'];
98
+ state: Scalars['String']['output'];
99
+ status: MessageStatus;
100
+ threadId: Scalars['String']['output'];
101
+ };
102
+
103
+ export type AgentsResponse = {
104
+ __typename?: 'AgentsResponse';
105
+ agents: Array<Agent>;
106
+ };
107
+
108
+ export type BaseMessageOutput = {
109
+ createdAt: Scalars['DateTimeISO']['output'];
110
+ id: Scalars['String']['output'];
111
+ status: MessageStatus;
112
+ };
113
+
114
+ export type BaseResponseStatus = {
115
+ code: ResponseStatusCode;
116
+ };
117
+
118
+ export type CloudInput = {
119
+ guardrails?: InputMaybe<GuardrailsInput>;
120
+ };
121
+
122
+ /** The type of Copilot request */
123
+ export enum CopilotRequestType {
124
+ Chat = 'Chat',
125
+ Suggestion = 'Suggestion',
126
+ Task = 'Task',
127
+ TextareaCompletion = 'TextareaCompletion',
128
+ TextareaPopover = 'TextareaPopover'
129
+ }
130
+
131
+ export type CopilotResponse = {
132
+ __typename?: 'CopilotResponse';
133
+ extensions?: Maybe<ExtensionsResponse>;
134
+ messages: Array<BaseMessageOutput>;
135
+ runId?: Maybe<Scalars['String']['output']>;
136
+ status: ResponseStatus;
137
+ threadId: Scalars['String']['output'];
138
+ };
139
+
140
+ export type ExtensionsInput = {
141
+ openaiAssistantAPI?: InputMaybe<OpenAiApiAssistantApiInput>;
142
+ };
143
+
144
+ export type ExtensionsResponse = {
145
+ __typename?: 'ExtensionsResponse';
146
+ openaiAssistantAPI?: Maybe<OpenAiApiAssistantApiResponse>;
147
+ };
148
+
149
+ export type FailedMessageStatus = {
150
+ __typename?: 'FailedMessageStatus';
151
+ code: MessageStatusCode;
152
+ reason: Scalars['String']['output'];
153
+ };
154
+
155
+ export type FailedResponseStatus = BaseResponseStatus & {
156
+ __typename?: 'FailedResponseStatus';
157
+ code: ResponseStatusCode;
158
+ details?: Maybe<Scalars['JSON']['output']>;
159
+ reason: FailedResponseStatusReason;
160
+ };
161
+
162
+ export enum FailedResponseStatusReason {
163
+ GuardrailsValidationFailed = 'GUARDRAILS_VALIDATION_FAILED',
164
+ MessageStreamInterrupted = 'MESSAGE_STREAM_INTERRUPTED',
165
+ UnknownError = 'UNKNOWN_ERROR'
166
+ }
167
+
168
+ export type ForwardedParametersInput = {
169
+ maxTokens?: InputMaybe<Scalars['Float']['input']>;
170
+ model?: InputMaybe<Scalars['String']['input']>;
171
+ stop?: InputMaybe<Array<Scalars['String']['input']>>;
172
+ temperature?: InputMaybe<Scalars['Float']['input']>;
173
+ toolChoice?: InputMaybe<Scalars['String']['input']>;
174
+ toolChoiceFunctionName?: InputMaybe<Scalars['String']['input']>;
175
+ };
176
+
177
+ export type FrontendInput = {
178
+ actions: Array<ActionInput>;
179
+ toDeprecate_fullContext?: InputMaybe<Scalars['String']['input']>;
180
+ url?: InputMaybe<Scalars['String']['input']>;
181
+ };
182
+
183
+ export type GenerateCopilotResponseInput = {
184
+ agentSession?: InputMaybe<AgentSessionInput>;
185
+ agentState?: InputMaybe<AgentStateInput>;
186
+ agentStates?: InputMaybe<Array<AgentStateInput>>;
187
+ cloud?: InputMaybe<CloudInput>;
188
+ extensions?: InputMaybe<ExtensionsInput>;
189
+ forwardedParameters?: InputMaybe<ForwardedParametersInput>;
190
+ frontend: FrontendInput;
191
+ messages: Array<MessageInput>;
192
+ metadata: GenerateCopilotResponseMetadataInput;
193
+ runId?: InputMaybe<Scalars['String']['input']>;
194
+ threadId?: InputMaybe<Scalars['String']['input']>;
195
+ };
196
+
197
+ export type GenerateCopilotResponseMetadataInput = {
198
+ requestType?: InputMaybe<CopilotRequestType>;
199
+ };
200
+
201
+ export type GuardrailsInput = {
202
+ inputValidationRules: GuardrailsRuleInput;
203
+ };
204
+
205
+ export type GuardrailsRuleInput = {
206
+ allowList?: InputMaybe<Array<Scalars['String']['input']>>;
207
+ denyList?: InputMaybe<Array<Scalars['String']['input']>>;
208
+ };
209
+
210
+ export type LoadAgentStateInput = {
211
+ agentName: Scalars['String']['input'];
212
+ threadId: Scalars['String']['input'];
213
+ };
214
+
215
+ export type LoadAgentStateResponse = {
216
+ __typename?: 'LoadAgentStateResponse';
217
+ messages: Scalars['String']['output'];
218
+ state: Scalars['String']['output'];
219
+ threadExists: Scalars['Boolean']['output'];
220
+ threadId: Scalars['String']['output'];
221
+ };
222
+
223
+ export type MessageInput = {
224
+ actionExecutionMessage?: InputMaybe<ActionExecutionMessageInput>;
225
+ agentStateMessage?: InputMaybe<AgentStateMessageInput>;
226
+ createdAt: Scalars['DateTimeISO']['input'];
227
+ id: Scalars['String']['input'];
228
+ resultMessage?: InputMaybe<ResultMessageInput>;
229
+ textMessage?: InputMaybe<TextMessageInput>;
230
+ };
231
+
232
+ /** The role of the message */
233
+ export enum MessageRole {
234
+ Assistant = 'assistant',
235
+ System = 'system',
236
+ Tool = 'tool',
237
+ User = 'user'
238
+ }
239
+
240
+ export type MessageStatus = FailedMessageStatus | PendingMessageStatus | SuccessMessageStatus;
241
+
242
+ export enum MessageStatusCode {
243
+ Failed = 'Failed',
244
+ Pending = 'Pending',
245
+ Success = 'Success'
246
+ }
247
+
248
+ export type Mutation = {
249
+ __typename?: 'Mutation';
250
+ generateCopilotResponse: CopilotResponse;
251
+ };
252
+
253
+
254
+ export type MutationGenerateCopilotResponseArgs = {
255
+ data: GenerateCopilotResponseInput;
256
+ properties?: InputMaybe<Scalars['JSONObject']['input']>;
257
+ };
258
+
259
+ export type OpenAiApiAssistantApiInput = {
260
+ runId?: InputMaybe<Scalars['String']['input']>;
261
+ threadId?: InputMaybe<Scalars['String']['input']>;
262
+ };
263
+
264
+ export type OpenAiApiAssistantApiResponse = {
265
+ __typename?: 'OpenAIApiAssistantAPIResponse';
266
+ runId?: Maybe<Scalars['String']['output']>;
267
+ threadId?: Maybe<Scalars['String']['output']>;
268
+ };
269
+
270
+ export type PendingMessageStatus = {
271
+ __typename?: 'PendingMessageStatus';
272
+ code: MessageStatusCode;
273
+ };
274
+
275
+ export type PendingResponseStatus = BaseResponseStatus & {
276
+ __typename?: 'PendingResponseStatus';
277
+ code: ResponseStatusCode;
278
+ };
279
+
280
+ export type Query = {
281
+ __typename?: 'Query';
282
+ availableAgents: AgentsResponse;
283
+ hello: Scalars['String']['output'];
284
+ loadAgentState: LoadAgentStateResponse;
285
+ };
286
+
287
+
288
+ export type QueryLoadAgentStateArgs = {
289
+ data: LoadAgentStateInput;
290
+ };
291
+
292
+ export type ResponseStatus = FailedResponseStatus | PendingResponseStatus | SuccessResponseStatus;
293
+
294
+ export enum ResponseStatusCode {
295
+ Failed = 'Failed',
296
+ Pending = 'Pending',
297
+ Success = 'Success'
298
+ }
299
+
300
+ export type ResultMessageInput = {
301
+ actionExecutionId: Scalars['String']['input'];
302
+ actionName: Scalars['String']['input'];
303
+ parentMessageId?: InputMaybe<Scalars['String']['input']>;
304
+ result: Scalars['String']['input'];
305
+ };
306
+
307
+ export type ResultMessageOutput = BaseMessageOutput & {
308
+ __typename?: 'ResultMessageOutput';
309
+ actionExecutionId: Scalars['String']['output'];
310
+ actionName: Scalars['String']['output'];
311
+ createdAt: Scalars['DateTimeISO']['output'];
312
+ id: Scalars['String']['output'];
313
+ result: Scalars['String']['output'];
314
+ status: MessageStatus;
315
+ };
316
+
317
+ export type SuccessMessageStatus = {
318
+ __typename?: 'SuccessMessageStatus';
319
+ code: MessageStatusCode;
320
+ };
321
+
322
+ export type SuccessResponseStatus = BaseResponseStatus & {
323
+ __typename?: 'SuccessResponseStatus';
324
+ code: ResponseStatusCode;
325
+ };
326
+
327
+ export type TextMessageInput = {
328
+ content: Scalars['String']['input'];
329
+ parentMessageId?: InputMaybe<Scalars['String']['input']>;
330
+ role: MessageRole;
331
+ };
332
+
333
+ export type TextMessageOutput = BaseMessageOutput & {
334
+ __typename?: 'TextMessageOutput';
335
+ content: Array<Scalars['String']['output']>;
336
+ createdAt: Scalars['DateTimeISO']['output'];
337
+ id: Scalars['String']['output'];
338
+ parentMessageId?: Maybe<Scalars['String']['output']>;
339
+ role: MessageRole;
340
+ status: MessageStatus;
341
+ };
342
+
343
+ export type GenerateCopilotResponseMutationVariables = Exact<{
344
+ data: GenerateCopilotResponseInput;
345
+ properties?: InputMaybe<Scalars['JSONObject']['input']>;
346
+ }>;
347
+
348
+
349
+ export type GenerateCopilotResponseMutation = { __typename?: 'Mutation', generateCopilotResponse: { __typename?: 'CopilotResponse', threadId: string, runId?: string | null, extensions?: { __typename?: 'ExtensionsResponse', openaiAssistantAPI?: { __typename?: 'OpenAIApiAssistantAPIResponse', runId?: string | null, threadId?: string | null } | null } | null, messages: Array<{ __typename: 'ActionExecutionMessageOutput', id: string, createdAt: any, name: string, arguments: Array<string>, parentMessageId?: string | null, status: { __typename?: 'FailedMessageStatus', code: MessageStatusCode, reason: string } | { __typename?: 'PendingMessageStatus', code: MessageStatusCode } | { __typename?: 'SuccessMessageStatus', code: MessageStatusCode } } | { __typename: 'AgentStateMessageOutput', id: string, createdAt: any, threadId: string, state: string, running: boolean, agentName: string, nodeName: string, runId: string, active: boolean, role: MessageRole, status: { __typename?: 'FailedMessageStatus', code: MessageStatusCode, reason: string } | { __typename?: 'PendingMessageStatus', code: MessageStatusCode } | { __typename?: 'SuccessMessageStatus', code: MessageStatusCode } } | { __typename: 'ResultMessageOutput', id: string, createdAt: any, result: string, actionExecutionId: string, actionName: string, status: { __typename?: 'FailedMessageStatus', code: MessageStatusCode, reason: string } | { __typename?: 'PendingMessageStatus', code: MessageStatusCode } | { __typename?: 'SuccessMessageStatus', code: MessageStatusCode } } | { __typename: 'TextMessageOutput', id: string, createdAt: any, content: Array<string>, role: MessageRole, parentMessageId?: string | null, status: { __typename?: 'FailedMessageStatus', code: MessageStatusCode, reason: string } | { __typename?: 'PendingMessageStatus', code: MessageStatusCode } | { __typename?: 'SuccessMessageStatus', code: MessageStatusCode } }> } & ({ __typename?: 'CopilotResponse', status: { __typename?: 'FailedResponseStatus', code: ResponseStatusCode, reason: FailedResponseStatusReason, details?: any | null } | { __typename?: 'PendingResponseStatus', code: ResponseStatusCode } | { __typename?: 'SuccessResponseStatus', code: ResponseStatusCode } } | { __typename?: 'CopilotResponse', status?: never }) };
350
+
351
+ export type AvailableAgentsQueryVariables = Exact<{ [key: string]: never; }>;
352
+
353
+
354
+ export type AvailableAgentsQuery = { __typename?: 'Query', availableAgents: { __typename?: 'AgentsResponse', agents: Array<{ __typename?: 'Agent', name: string, id: string, description: string }> } };
355
+
356
+ export type LoadAgentStateQueryVariables = Exact<{
357
+ data: LoadAgentStateInput;
358
+ }>;
359
+
360
+
361
+ export type LoadAgentStateQuery = { __typename?: 'Query', loadAgentState: { __typename?: 'LoadAgentStateResponse', threadId: string, threadExists: boolean, state: string, messages: string } };
362
+
363
+
364
+ export const GenerateCopilotResponseDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"mutation","name":{"kind":"Name","value":"generateCopilotResponse"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"data"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"GenerateCopilotResponseInput"}}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"properties"}},"type":{"kind":"NamedType","name":{"kind":"Name","value":"JSONObject"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"generateCopilotResponse"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"data"},"value":{"kind":"Variable","name":{"kind":"Name","value":"data"}}},{"kind":"Argument","name":{"kind":"Name","value":"properties"},"value":{"kind":"Variable","name":{"kind":"Name","value":"properties"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"threadId"}},{"kind":"Field","name":{"kind":"Name","value":"runId"}},{"kind":"Field","name":{"kind":"Name","value":"extensions"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"openaiAssistantAPI"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"runId"}},{"kind":"Field","name":{"kind":"Name","value":"threadId"}}]}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"CopilotResponse"}},"directives":[{"kind":"Directive","name":{"kind":"Name","value":"defer"}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"status"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"BaseResponseStatus"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"code"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"FailedResponseStatus"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"reason"}},{"kind":"Field","name":{"kind":"Name","value":"details"}}]}}]}}]}},{"kind":"Field","name":{"kind":"Name","value":"messages"},"directives":[{"kind":"Directive","name":{"kind":"Name","value":"stream"}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"__typename"}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"BaseMessageOutput"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"createdAt"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"BaseMessageOutput"}},"directives":[{"kind":"Directive","name":{"kind":"Name","value":"defer"}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"status"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"SuccessMessageStatus"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"code"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"FailedMessageStatus"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"code"}},{"kind":"Field","name":{"kind":"Name","value":"reason"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"PendingMessageStatus"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"code"}}]}}]}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"TextMessageOutput"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"content"},"directives":[{"kind":"Directive","name":{"kind":"Name","value":"stream"}}]},{"kind":"Field","name":{"kind":"Name","value":"role"}},{"kind":"Field","name":{"kind":"Name","value":"parentMessageId"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"ActionExecutionMessageOutput"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"arguments"},"directives":[{"kind":"Directive","name":{"kind":"Name","value":"stream"}}]},{"kind":"Field","name":{"kind":"Name","value":"parentMessageId"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"ResultMessageOutput"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"result"}},{"kind":"Field","name":{"kind":"Name","value":"actionExecutionId"}},{"kind":"Field","name":{"kind":"Name","value":"actionName"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"AgentStateMessageOutput"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"threadId"}},{"kind":"Field","name":{"kind":"Name","value":"state"}},{"kind":"Field","name":{"kind":"Name","value":"running"}},{"kind":"Field","name":{"kind":"Name","value":"agentName"}},{"kind":"Field","name":{"kind":"Name","value":"nodeName"}},{"kind":"Field","name":{"kind":"Name","value":"runId"}},{"kind":"Field","name":{"kind":"Name","value":"active"}},{"kind":"Field","name":{"kind":"Name","value":"role"}}]}}]}}]}}]}}]} as unknown as DocumentNode<GenerateCopilotResponseMutation, GenerateCopilotResponseMutationVariables>;
365
+ export const AvailableAgentsDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"availableAgents"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"availableAgents"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"agents"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"description"}}]}}]}}]}}]} as unknown as DocumentNode<AvailableAgentsQuery, AvailableAgentsQueryVariables>;
366
+ export const LoadAgentStateDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"loadAgentState"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"data"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"LoadAgentStateInput"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"loadAgentState"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"data"},"value":{"kind":"Variable","name":{"kind":"Name","value":"data"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"threadId"}},{"kind":"Field","name":{"kind":"Name","value":"threadExists"}},{"kind":"Field","name":{"kind":"Name","value":"state"}},{"kind":"Field","name":{"kind":"Name","value":"messages"}}]}}]}}]} as unknown as DocumentNode<LoadAgentStateQuery, LoadAgentStateQueryVariables>;
@@ -0,0 +1,2 @@
1
+ export * from "./fragment-masking";
2
+ export * from "./gql";
@@ -0,0 +1,73 @@
1
+ import { graphql } from "../@generated/gql";
2
+
3
+ export const generateCopilotResponseMutation = graphql(/** GraphQL **/ `
4
+ mutation generateCopilotResponse($data: GenerateCopilotResponseInput!, $properties: JSONObject) {
5
+ generateCopilotResponse(data: $data, properties: $properties) {
6
+ threadId
7
+ runId
8
+ extensions {
9
+ openaiAssistantAPI {
10
+ runId
11
+ threadId
12
+ }
13
+ }
14
+ ... on CopilotResponse @defer {
15
+ status {
16
+ ... on BaseResponseStatus {
17
+ code
18
+ }
19
+ ... on FailedResponseStatus {
20
+ reason
21
+ details
22
+ }
23
+ }
24
+ }
25
+ messages @stream {
26
+ __typename
27
+ ... on BaseMessageOutput {
28
+ id
29
+ createdAt
30
+ }
31
+ ... on BaseMessageOutput @defer {
32
+ status {
33
+ ... on SuccessMessageStatus {
34
+ code
35
+ }
36
+ ... on FailedMessageStatus {
37
+ code
38
+ reason
39
+ }
40
+ ... on PendingMessageStatus {
41
+ code
42
+ }
43
+ }
44
+ }
45
+ ... on TextMessageOutput {
46
+ content @stream
47
+ role
48
+ parentMessageId
49
+ }
50
+ ... on ActionExecutionMessageOutput {
51
+ name
52
+ arguments @stream
53
+ parentMessageId
54
+ }
55
+ ... on ResultMessageOutput {
56
+ result
57
+ actionExecutionId
58
+ actionName
59
+ }
60
+ ... on AgentStateMessageOutput {
61
+ threadId
62
+ state
63
+ running
64
+ agentName
65
+ nodeName
66
+ runId
67
+ active
68
+ role
69
+ }
70
+ }
71
+ }
72
+ }
73
+ `);
@@ -0,0 +1,24 @@
1
+ import { graphql } from "../@generated/gql";
2
+
3
+ export const getAvailableAgentsQuery = graphql(/** GraphQL **/ `
4
+ query availableAgents {
5
+ availableAgents {
6
+ agents {
7
+ name
8
+ id
9
+ description
10
+ }
11
+ }
12
+ }
13
+ `);
14
+
15
+ export const loadAgentStateQuery = graphql(/** GraphQL **/ `
16
+ query loadAgentState($data: LoadAgentStateInput!) {
17
+ loadAgentState(data: $data) {
18
+ threadId
19
+ threadExists
20
+ state
21
+ messages
22
+ }
23
+ }
24
+ `);
package/src/index.ts ADDED
@@ -0,0 +1,2 @@
1
+ export * from "./client";
2
+ export * from "./graphql/@generated/graphql";
package/tsconfig.json ADDED
@@ -0,0 +1,16 @@
1
+ {
2
+ "extends": "../../utilities/tsconfig/base.json",
3
+ "compilerOptions": {
4
+ "strictPropertyInitialization": false,
5
+ "resolveJsonModule": true
6
+ },
7
+ "include": ["."],
8
+ "exclude": [
9
+ "dist",
10
+ "build",
11
+ "node_modules",
12
+ "**/*.test.ts",
13
+ "**/*.test.tsx",
14
+ "**/__tests__/*"
15
+ ]
16
+ }
package/tsup.config.ts ADDED
@@ -0,0 +1,33 @@
1
+ import { defineConfig, Options } from "tsup";
2
+ import { Plugin } from "esbuild";
3
+ import { generate } from "@graphql-codegen/cli";
4
+ import codegenConfig from "./codegen";
5
+
6
+ const runBeforeBuildPlugin: Plugin = {
7
+ name: "run-before-build",
8
+ setup(build) {
9
+ const prefix = build.initialOptions.format;
10
+
11
+ build.onStart(async () => {
12
+ console.log(`[${prefix}] Running graphql-codegen`);
13
+ await generate(codegenConfig);
14
+ console.log(`[${prefix}] graphql-codegen completed successfully`);
15
+ });
16
+ },
17
+ };
18
+
19
+ export default defineConfig((options: Options) => ({
20
+ entry: ["src/**/*.{ts,tsx}"],
21
+ format: ["esm", "cjs"],
22
+ dts: true,
23
+ minify: false,
24
+ external: ["react"],
25
+ sourcemap: true,
26
+ exclude: [
27
+ "**/*.test.ts", // Exclude TypeScript test files
28
+ "**/*.test.tsx", // Exclude TypeScript React test files
29
+ "**/__tests__/*", // Exclude any files inside a __tests__ directory
30
+ ],
31
+ esbuildPlugins: [runBeforeBuildPlugin as any],
32
+ ...options,
33
+ }));
package/typedoc.json ADDED
@@ -0,0 +1,4 @@
1
+ {
2
+ "extends": ["../../typedoc.base.json"],
3
+ "entryPoints": ["src/index.tsx"]
4
+ }