@ragbits/api-client 1.5.0 → 1.6.0
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/dist/autogen.types.d.ts +45 -3
- package/dist/index.cjs +15 -2
- package/dist/index.js +13 -1
- package/package.json +1 -1
package/dist/autogen.types.d.ts
CHANGED
|
@@ -30,6 +30,18 @@ export declare const MessageRole: {
|
|
|
30
30
|
readonly System: "system";
|
|
31
31
|
};
|
|
32
32
|
export type MessageRole = TypeFrom<typeof MessageRole>;
|
|
33
|
+
/**
|
|
34
|
+
* Represents the TaskStatus enum
|
|
35
|
+
*/
|
|
36
|
+
export declare const TaskStatus: {
|
|
37
|
+
readonly Pending: "pending";
|
|
38
|
+
readonly InProgress: "in_progress";
|
|
39
|
+
readonly Completed: "completed";
|
|
40
|
+
readonly Failed: "failed";
|
|
41
|
+
readonly Cancelled: "cancelled";
|
|
42
|
+
readonly Retrying: "retrying";
|
|
43
|
+
};
|
|
44
|
+
export type TaskStatus = TypeFrom<typeof TaskStatus>;
|
|
33
45
|
/**
|
|
34
46
|
* Represents the AuthType enum
|
|
35
47
|
*/
|
|
@@ -50,9 +62,9 @@ export interface ChatContext {
|
|
|
50
62
|
user: User | null;
|
|
51
63
|
session_id: string | null;
|
|
52
64
|
/**
|
|
53
|
-
* List of confirmed/declined
|
|
65
|
+
* List of confirmed/declined tools from the frontend
|
|
54
66
|
*/
|
|
55
|
-
|
|
67
|
+
confirmed_tools: {
|
|
56
68
|
[k: string]: unknown;
|
|
57
69
|
}[] | null;
|
|
58
70
|
/**
|
|
@@ -147,6 +159,22 @@ export interface MessageUsage {
|
|
|
147
159
|
completion_tokens: number;
|
|
148
160
|
total_tokens: number;
|
|
149
161
|
}
|
|
162
|
+
/**
|
|
163
|
+
* Simple task representation.
|
|
164
|
+
*/
|
|
165
|
+
export interface Task {
|
|
166
|
+
id: string;
|
|
167
|
+
description: string;
|
|
168
|
+
/**
|
|
169
|
+
* Task status options.
|
|
170
|
+
*/
|
|
171
|
+
status: 'pending' | 'in_progress' | 'completed' | 'failed' | 'cancelled' | 'retrying';
|
|
172
|
+
order: number;
|
|
173
|
+
summary: string | null;
|
|
174
|
+
parent_id: string | null;
|
|
175
|
+
full_response: string | null;
|
|
176
|
+
dependencies: string[];
|
|
177
|
+
}
|
|
150
178
|
/**
|
|
151
179
|
* Represents a tool confirmation request sent to the user.
|
|
152
180
|
*/
|
|
@@ -196,6 +224,12 @@ export interface UsageContent {
|
|
|
196
224
|
[k: string]: MessageUsage;
|
|
197
225
|
};
|
|
198
226
|
}
|
|
227
|
+
/**
|
|
228
|
+
* Plan item content wrapper.
|
|
229
|
+
*/
|
|
230
|
+
export interface PlanItemContent {
|
|
231
|
+
task: Task;
|
|
232
|
+
}
|
|
199
233
|
/**
|
|
200
234
|
* Confirmation request content wrapper.
|
|
201
235
|
*/
|
|
@@ -237,6 +271,10 @@ export interface UICustomization {
|
|
|
237
271
|
* Custom welcome message to be displayed on the UI. It supports Markdown.
|
|
238
272
|
*/
|
|
239
273
|
welcome_message: string | null;
|
|
274
|
+
/**
|
|
275
|
+
* Starter questions displayed as clickable buttons on the welcome screen before any conversation.
|
|
276
|
+
*/
|
|
277
|
+
starter_questions: string[] | null;
|
|
240
278
|
/**
|
|
241
279
|
* Custom meta properties customization
|
|
242
280
|
*/
|
|
@@ -495,6 +533,10 @@ export interface ClearMessageChatResponse {
|
|
|
495
533
|
type: 'clear_message';
|
|
496
534
|
content: unknown;
|
|
497
535
|
}
|
|
536
|
+
export interface PlanItemChatResponse {
|
|
537
|
+
type: 'plan_item';
|
|
538
|
+
content: PlanItemContent;
|
|
539
|
+
}
|
|
498
540
|
export interface ConversationSummaryResponse {
|
|
499
541
|
type: 'conversation_summary';
|
|
500
542
|
content: ConversationSummaryContent;
|
|
@@ -514,4 +556,4 @@ export interface ChunkedChatResponse {
|
|
|
514
556
|
/**
|
|
515
557
|
* Typed chat response union
|
|
516
558
|
*/
|
|
517
|
-
export type ChatResponse = TextChatResponse | ReferenceChatResponse | MessageIdChatResponse | ConversationIdChatResponse | StateUpdateChatResponse | LiveUpdateChatResponse | FollowupMessagesChatResponse | ImageChatResponse | MessageUsageChatResponse | ClearMessageChatResponse | ConversationSummaryResponse | ConfirmationRequestChatResponse | ErrorChatResponse;
|
|
559
|
+
export type ChatResponse = TextChatResponse | ReferenceChatResponse | MessageIdChatResponse | ConversationIdChatResponse | StateUpdateChatResponse | LiveUpdateChatResponse | FollowupMessagesChatResponse | ImageChatResponse | MessageUsageChatResponse | ClearMessageChatResponse | PlanItemChatResponse | ConversationSummaryResponse | ConfirmationRequestChatResponse | ErrorChatResponse;
|
package/dist/index.cjs
CHANGED
|
@@ -24,7 +24,8 @@ __export(index_exports, {
|
|
|
24
24
|
FeedbackType: () => FeedbackType,
|
|
25
25
|
LiveUpdateType: () => LiveUpdateType,
|
|
26
26
|
MessageRole: () => MessageRole,
|
|
27
|
-
RagbitsClient: () => RagbitsClient
|
|
27
|
+
RagbitsClient: () => RagbitsClient,
|
|
28
|
+
TaskStatus: () => TaskStatus
|
|
28
29
|
});
|
|
29
30
|
module.exports = __toCommonJS(index_exports);
|
|
30
31
|
|
|
@@ -42,6 +43,14 @@ var MessageRole = {
|
|
|
42
43
|
Assistant: "assistant",
|
|
43
44
|
System: "system"
|
|
44
45
|
};
|
|
46
|
+
var TaskStatus = {
|
|
47
|
+
Pending: "pending",
|
|
48
|
+
InProgress: "in_progress",
|
|
49
|
+
Completed: "completed",
|
|
50
|
+
Failed: "failed",
|
|
51
|
+
Cancelled: "cancelled",
|
|
52
|
+
Retrying: "retrying"
|
|
53
|
+
};
|
|
45
54
|
var AuthType = {
|
|
46
55
|
Credentials: "credentials",
|
|
47
56
|
Oauth2: "oauth2"
|
|
@@ -212,6 +221,9 @@ var RagbitsClient = class {
|
|
|
212
221
|
continue;
|
|
213
222
|
}
|
|
214
223
|
await callbacks.onMessage(parsedData);
|
|
224
|
+
await new Promise(
|
|
225
|
+
(resolve) => setTimeout(resolve, 0)
|
|
226
|
+
);
|
|
215
227
|
} catch (parseError) {
|
|
216
228
|
console.error("Error parsing JSON:", parseError);
|
|
217
229
|
await callbacks.onError(
|
|
@@ -343,5 +355,6 @@ var RagbitsClient = class {
|
|
|
343
355
|
FeedbackType,
|
|
344
356
|
LiveUpdateType,
|
|
345
357
|
MessageRole,
|
|
346
|
-
RagbitsClient
|
|
358
|
+
RagbitsClient,
|
|
359
|
+
TaskStatus
|
|
347
360
|
});
|
package/dist/index.js
CHANGED
|
@@ -12,6 +12,14 @@ var MessageRole = {
|
|
|
12
12
|
Assistant: "assistant",
|
|
13
13
|
System: "system"
|
|
14
14
|
};
|
|
15
|
+
var TaskStatus = {
|
|
16
|
+
Pending: "pending",
|
|
17
|
+
InProgress: "in_progress",
|
|
18
|
+
Completed: "completed",
|
|
19
|
+
Failed: "failed",
|
|
20
|
+
Cancelled: "cancelled",
|
|
21
|
+
Retrying: "retrying"
|
|
22
|
+
};
|
|
15
23
|
var AuthType = {
|
|
16
24
|
Credentials: "credentials",
|
|
17
25
|
Oauth2: "oauth2"
|
|
@@ -182,6 +190,9 @@ var RagbitsClient = class {
|
|
|
182
190
|
continue;
|
|
183
191
|
}
|
|
184
192
|
await callbacks.onMessage(parsedData);
|
|
193
|
+
await new Promise(
|
|
194
|
+
(resolve) => setTimeout(resolve, 0)
|
|
195
|
+
);
|
|
185
196
|
} catch (parseError) {
|
|
186
197
|
console.error("Error parsing JSON:", parseError);
|
|
187
198
|
await callbacks.onError(
|
|
@@ -312,5 +323,6 @@ export {
|
|
|
312
323
|
FeedbackType,
|
|
313
324
|
LiveUpdateType,
|
|
314
325
|
MessageRole,
|
|
315
|
-
RagbitsClient
|
|
326
|
+
RagbitsClient,
|
|
327
|
+
TaskStatus
|
|
316
328
|
};
|