@hasura/promptql 2.0.0-alpha.1 → 2.0.0-alpha.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +19 -82
- package/dist/index.d.mts +4426 -0
- package/dist/index.d.ts +4426 -0
- package/dist/index.js +1 -0
- package/dist/index.mjs +1 -0
- package/package.json +2 -2
- package/src/auth/auth.test.ts +0 -24
- package/src/auth/auth.ts +0 -130
- package/src/auth/index.ts +0 -2
- package/src/auth/types.ts +0 -56
- package/src/generated/ChatV2ServerSchema.json +0 -5841
- package/src/generated/ChatV2ServerTypes.ts +0 -2747
- package/src/generated/ThreadEvents.example.json +0 -1645
- package/src/generated/graphql.ts +0 -12121
- package/src/graphql/README.md +0 -70
- package/src/graphql/mutations/sendThreadMessage.gql +0 -16
- package/src/graphql/mutations/startThread.gql +0 -19
- package/src/graphql/queries/getProjectInfo.gql +0 -7
- package/src/graphql/queries/thread.gql +0 -39
- package/src/graphql/subscriptions/subscribeThreadEventsByThreadId.gql +0 -7
- package/src/index.ts +0 -13
- package/src/sdk/apollo.ts +0 -63
- package/src/sdk/client.ts +0 -273
- package/src/sdk/index.ts +0 -4
- package/src/sdk/types.ts +0 -254
- package/src/sdk/utils.ts +0 -684
- package/src/utils.ts +0 -16
package/src/sdk/types.ts
DELETED
|
@@ -1,254 +0,0 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
AgentUpdate,
|
|
3
|
-
ContextExplorerUpdate,
|
|
4
|
-
MessageProcessingUpdate,
|
|
5
|
-
OrchestratorUpdate,
|
|
6
|
-
PlanningDecisionUpdate,
|
|
7
|
-
SchemaTasksGenerationUpdate,
|
|
8
|
-
ThreadEvent as ThreadEventData,
|
|
9
|
-
} from "../generated/ChatV2ServerTypes";
|
|
10
|
-
import type {
|
|
11
|
-
SendThreadMessageMutation,
|
|
12
|
-
StartThreadMutation,
|
|
13
|
-
SubscribeThreadEventsSubscription,
|
|
14
|
-
} from "../generated/graphql";
|
|
15
|
-
|
|
16
|
-
/**
|
|
17
|
-
* Options to initialize a PromptQL SDK client.
|
|
18
|
-
*/
|
|
19
|
-
export type PromptQLSdkOptions = {
|
|
20
|
-
/**
|
|
21
|
-
* Host of the auth service that is used for a custom self-hosted control plane only.
|
|
22
|
-
*/
|
|
23
|
-
authHost?: string;
|
|
24
|
-
/**
|
|
25
|
-
* Project ID of the PromptQL project. You can find it in Project Settings > General Settings tab on https://promptql.console.hasura.io.
|
|
26
|
-
*/
|
|
27
|
-
projectId: string;
|
|
28
|
-
/**
|
|
29
|
-
* Base URL of the PromptQL data plane. You can find it in Project Settings > PromptQL > PromptQL API on https://promptql.console.hasura.io.
|
|
30
|
-
* The base URL must remove the request path, For example: https://promptql.ddn.hasura.app.
|
|
31
|
-
*/
|
|
32
|
-
promptqlBaseUrl?: string;
|
|
33
|
-
/**
|
|
34
|
-
* Service account token of the PromptQL project.
|
|
35
|
-
* Check out Hasura docs https://hasura.io/docs/3.0/project-configuration/project-management/service-accounts/#how-to-create-service-account to know how to create a token.
|
|
36
|
-
*/
|
|
37
|
-
serviceAccountToken: string;
|
|
38
|
-
/**
|
|
39
|
-
* A function to use instead of calling the Fetch API directly when sending HTTP requests to your GraphQL endpoint. The function must conform to the signature of fetch.
|
|
40
|
-
* By default, the Fetch API is used unless it isn't available in your runtime environment.
|
|
41
|
-
*/
|
|
42
|
-
fetch?: typeof fetch;
|
|
43
|
-
/**
|
|
44
|
-
* An object representing headers to include in every HTTP request.
|
|
45
|
-
*/
|
|
46
|
-
headers?: Record<string, string>;
|
|
47
|
-
/**
|
|
48
|
-
* An [IANA timezone](https://data.iana.org/time-zones/tzdb-2021a/zone1970.tab) for interpreting time-based queries. Default is the timezone from the client config.
|
|
49
|
-
*/
|
|
50
|
-
timezone?: string;
|
|
51
|
-
/**
|
|
52
|
-
* UUID of the DDN build. Default is the applied build.
|
|
53
|
-
*/
|
|
54
|
-
buildId?: string;
|
|
55
|
-
};
|
|
56
|
-
|
|
57
|
-
/**
|
|
58
|
-
* Request arguments of the startThread mutation.
|
|
59
|
-
*/
|
|
60
|
-
export type StartThreadArguments = {
|
|
61
|
-
/**
|
|
62
|
-
* Message prompt
|
|
63
|
-
*/
|
|
64
|
-
message: string;
|
|
65
|
-
/**
|
|
66
|
-
* An [IANA timezone](https://data.iana.org/time-zones/tzdb-2021a/zone1970.tab) for interpreting time-based queries. Default is the timezone from the client config.
|
|
67
|
-
*/
|
|
68
|
-
timezone?: string;
|
|
69
|
-
/**
|
|
70
|
-
* UUID of the DDN build. Default is the applied build.
|
|
71
|
-
*/
|
|
72
|
-
buildId?: string;
|
|
73
|
-
};
|
|
74
|
-
|
|
75
|
-
/**
|
|
76
|
-
* Output of the startThread mutation.
|
|
77
|
-
*/
|
|
78
|
-
export type StartThreadOutput = NonNullable<
|
|
79
|
-
StartThreadMutation["start_thread"]
|
|
80
|
-
>;
|
|
81
|
-
|
|
82
|
-
/**
|
|
83
|
-
* Request arguments of the continueThread mutation.
|
|
84
|
-
*/
|
|
85
|
-
export type SendMessageToThreadArguments = {
|
|
86
|
-
/**
|
|
87
|
-
* Thread ID to continue th
|
|
88
|
-
*/
|
|
89
|
-
threadId: string;
|
|
90
|
-
/**
|
|
91
|
-
* Message prompt
|
|
92
|
-
*/
|
|
93
|
-
message: string;
|
|
94
|
-
/**
|
|
95
|
-
* An [IANA timezone](https://data.iana.org/time-zones/tzdb-2021a/zone1970.tab) for interpreting time-based queries. Default is the timezone from the client config.
|
|
96
|
-
*/
|
|
97
|
-
timezone?: string;
|
|
98
|
-
};
|
|
99
|
-
|
|
100
|
-
/**
|
|
101
|
-
* Output of the continueThread mutation.
|
|
102
|
-
*/
|
|
103
|
-
export type SendMessageToThreadOutput = NonNullable<
|
|
104
|
-
SendThreadMessageMutation["send_thread_message"]
|
|
105
|
-
>;
|
|
106
|
-
|
|
107
|
-
/**
|
|
108
|
-
* Output of the thread events subscription.
|
|
109
|
-
*/
|
|
110
|
-
export type ThreadEvent = Omit<
|
|
111
|
-
SubscribeThreadEventsSubscription["thread_events"][0],
|
|
112
|
-
"__typename" | "event_data"
|
|
113
|
-
> & {
|
|
114
|
-
event_data: ThreadEventData;
|
|
115
|
-
};
|
|
116
|
-
|
|
117
|
-
// Generic type to extract a specific variant from ThreadEvent union by key
|
|
118
|
-
// biome-ignore lint/suspicious/noExplicitAny: infer type.
|
|
119
|
-
export type KeysOfUnion<T> = T extends any ? keyof T : never;
|
|
120
|
-
|
|
121
|
-
export type EventOfKind<T, K extends KeysOfUnion<T>> = Extract<
|
|
122
|
-
T,
|
|
123
|
-
// biome-ignore lint/suspicious/noExplicitAny: infer type
|
|
124
|
-
Record<K, any>
|
|
125
|
-
>[K];
|
|
126
|
-
|
|
127
|
-
/**
|
|
128
|
-
* The decision made by the agent.
|
|
129
|
-
*/
|
|
130
|
-
export type InteractionDecision = EventOfKind<
|
|
131
|
-
MessageProcessingUpdate,
|
|
132
|
-
"InteractionDecision"
|
|
133
|
-
>["decision"];
|
|
134
|
-
|
|
135
|
-
/**
|
|
136
|
-
* The specific schema exploration update.
|
|
137
|
-
*/
|
|
138
|
-
export type SchemaExplorerUpdate = EventOfKind<
|
|
139
|
-
ContextExplorerUpdate,
|
|
140
|
-
"SchemaExplorerUpdate"
|
|
141
|
-
>["update"];
|
|
142
|
-
|
|
143
|
-
/**
|
|
144
|
-
* The specific wiki exploration update.
|
|
145
|
-
*/
|
|
146
|
-
export type WikiExplorerUpdate = EventOfKind<
|
|
147
|
-
ContextExplorerUpdate,
|
|
148
|
-
"WikiExplorerUpdate"
|
|
149
|
-
>["update"];
|
|
150
|
-
|
|
151
|
-
/**
|
|
152
|
-
* The specific step update.
|
|
153
|
-
*/
|
|
154
|
-
export type StepUpdate = EventOfKind<OrchestratorUpdate, "StepUpdate">;
|
|
155
|
-
|
|
156
|
-
export type CodeExecutionComplete = EventOfKind<
|
|
157
|
-
SchemaExplorerUpdate,
|
|
158
|
-
"CodeExecutionComplete"
|
|
159
|
-
>;
|
|
160
|
-
export type SchemaExplored = EventOfKind<
|
|
161
|
-
SchemaExplorerUpdate,
|
|
162
|
-
"SchemaExplored"
|
|
163
|
-
>;
|
|
164
|
-
export type GeneratedCode = EventOfKind<SchemaExplorerUpdate, "GeneratedCode">;
|
|
165
|
-
export type CodeOutputAnalyzed = EventOfKind<
|
|
166
|
-
SchemaExplorerUpdate,
|
|
167
|
-
"CodeOutputAnalyzed"
|
|
168
|
-
>;
|
|
169
|
-
export type SchemaExplorerStarted = EventOfKind<
|
|
170
|
-
SchemaExplorerUpdate,
|
|
171
|
-
"Started"
|
|
172
|
-
>;
|
|
173
|
-
export type SchemaExplorerCompleted = EventOfKind<
|
|
174
|
-
SchemaExplorerUpdate,
|
|
175
|
-
"Completed"
|
|
176
|
-
>;
|
|
177
|
-
export type TasksGenerated = EventOfKind<
|
|
178
|
-
SchemaTasksGenerationUpdate,
|
|
179
|
-
"TasksGenerated"
|
|
180
|
-
>;
|
|
181
|
-
export type SchemaTasksGenerationStarted = EventOfKind<
|
|
182
|
-
SchemaTasksGenerationUpdate,
|
|
183
|
-
"Started"
|
|
184
|
-
>;
|
|
185
|
-
export type SchemaTasksGenerationCompleted = EventOfKind<
|
|
186
|
-
SchemaTasksGenerationUpdate,
|
|
187
|
-
"Completed"
|
|
188
|
-
>;
|
|
189
|
-
export type UserMessageEvent = EventOfKind<ThreadEventData, "UserMessage">;
|
|
190
|
-
export type UserCancelEvent = EventOfKind<ThreadEventData, "UserCancel">;
|
|
191
|
-
|
|
192
|
-
export type PlanGenerationStarted = EventOfKind<
|
|
193
|
-
OrchestratorUpdate,
|
|
194
|
-
"PlanGenerationStarted"
|
|
195
|
-
>;
|
|
196
|
-
|
|
197
|
-
export type PlanStepGenerated = EventOfKind<
|
|
198
|
-
OrchestratorUpdate,
|
|
199
|
-
"PlanStepGenerated"
|
|
200
|
-
>;
|
|
201
|
-
|
|
202
|
-
export type GeneratedResponse = EventOfKind<
|
|
203
|
-
OrchestratorUpdate,
|
|
204
|
-
"GeneratedResponse"
|
|
205
|
-
>;
|
|
206
|
-
|
|
207
|
-
export type MessageProcessingStarted = EventOfKind<
|
|
208
|
-
MessageProcessingUpdate,
|
|
209
|
-
"ProcessingStarted"
|
|
210
|
-
>;
|
|
211
|
-
|
|
212
|
-
export type InteractionDecisionAccept = EventOfKind<
|
|
213
|
-
InteractionDecision,
|
|
214
|
-
"AcceptInteraction"
|
|
215
|
-
>;
|
|
216
|
-
|
|
217
|
-
export type InteractionDecisionDecline = EventOfKind<
|
|
218
|
-
InteractionDecision,
|
|
219
|
-
"DeclineInteraction"
|
|
220
|
-
>;
|
|
221
|
-
|
|
222
|
-
export type PlanningDecisionStarted = EventOfKind<
|
|
223
|
-
PlanningDecisionUpdate,
|
|
224
|
-
"Started"
|
|
225
|
-
>;
|
|
226
|
-
export type PlanningDecisionCompleted = EventOfKind<
|
|
227
|
-
PlanningDecisionUpdate,
|
|
228
|
-
"Completed"
|
|
229
|
-
>;
|
|
230
|
-
export type PlanningDecisionPlanningRequired = EventOfKind<
|
|
231
|
-
PlanningDecisionUpdate,
|
|
232
|
-
"PlanningRequired"
|
|
233
|
-
>;
|
|
234
|
-
export type StartingOrchestrator = EventOfKind<
|
|
235
|
-
AgentUpdate,
|
|
236
|
-
"StartingOrchestrator"
|
|
237
|
-
>;
|
|
238
|
-
export type ContextExplorerStarted = EventOfKind<
|
|
239
|
-
ContextExplorerUpdate,
|
|
240
|
-
"Started"
|
|
241
|
-
>;
|
|
242
|
-
export type ContextExplorerCompleted = EventOfKind<
|
|
243
|
-
ContextExplorerUpdate,
|
|
244
|
-
"Completed"
|
|
245
|
-
>;
|
|
246
|
-
export type WikiExplorerStarted = EventOfKind<WikiExplorerUpdate, "Started">;
|
|
247
|
-
export type WikiInfoGenerated = EventOfKind<
|
|
248
|
-
WikiExplorerUpdate,
|
|
249
|
-
"WikiInfoGenerated"
|
|
250
|
-
>;
|
|
251
|
-
export type WikiExplorerCompleted = EventOfKind<
|
|
252
|
-
WikiExplorerUpdate,
|
|
253
|
-
"Completed"
|
|
254
|
-
>;
|