@hol-org/rb-client 0.1.182 → 0.1.184
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/index.cjs +84 -0
- package/dist/index.d.cts +327 -29
- package/dist/index.d.ts +327 -29
- package/dist/index.js +77 -0
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -39,6 +39,13 @@ __export(src_exports, {
|
|
|
39
39
|
buildPaymentApproveMessage: () => buildPaymentApproveMessage,
|
|
40
40
|
buildPaymentDeclineMessage: () => buildPaymentDeclineMessage,
|
|
41
41
|
canonicalizeLedgerNetwork: () => canonicalizeLedgerNetwork,
|
|
42
|
+
chatDeliveryStateSchema: () => chatDeliveryStateSchema,
|
|
43
|
+
chatErrorCodeSchema: () => chatErrorCodeSchema,
|
|
44
|
+
chatReadinessStatusSchema: () => chatReadinessStatusSchema,
|
|
45
|
+
chatReplyModeSchema: () => chatReplyModeSchema,
|
|
46
|
+
chatRouteTypeSchema: () => chatRouteTypeSchema,
|
|
47
|
+
chatSessionStateSchema: () => chatSessionStateSchema,
|
|
48
|
+
chatTimelineEntrySchema: () => chatTimelineEntrySchema,
|
|
42
49
|
closeUaidConnection: () => closeUaidConnection,
|
|
43
50
|
createPrivateKeySigner: () => createPrivateKeySigner,
|
|
44
51
|
createPrivateKeySignerAsync: () => createPrivateKeySignerAsync,
|
|
@@ -311,6 +318,40 @@ var chatDeliveryStateSchema = import_zod2.z.enum([
|
|
|
311
318
|
"timeout",
|
|
312
319
|
"cancelled"
|
|
313
320
|
]);
|
|
321
|
+
var chatAttachmentStateSchema = import_zod2.z.object({
|
|
322
|
+
supported: import_zod2.z.boolean(),
|
|
323
|
+
status: import_zod2.z.enum([
|
|
324
|
+
"unsupported",
|
|
325
|
+
"available",
|
|
326
|
+
"selected",
|
|
327
|
+
"uploading",
|
|
328
|
+
"scanning",
|
|
329
|
+
"ready",
|
|
330
|
+
"failed",
|
|
331
|
+
"rejected"
|
|
332
|
+
]),
|
|
333
|
+
maxBytes: import_zod2.z.number().nullable().optional(),
|
|
334
|
+
acceptedMimeTypes: import_zod2.z.array(import_zod2.z.string()).optional(),
|
|
335
|
+
reason: import_zod2.z.string().optional()
|
|
336
|
+
});
|
|
337
|
+
var chatTimelineEntrySchema = import_zod2.z.object({
|
|
338
|
+
messageId: import_zod2.z.string(),
|
|
339
|
+
kind: import_zod2.z.enum([
|
|
340
|
+
"user",
|
|
341
|
+
"assistant",
|
|
342
|
+
"system",
|
|
343
|
+
"tool",
|
|
344
|
+
"payment",
|
|
345
|
+
"delivery",
|
|
346
|
+
"error"
|
|
347
|
+
]),
|
|
348
|
+
content: import_zod2.z.string(),
|
|
349
|
+
timestamp: import_zod2.z.string(),
|
|
350
|
+
deliveryState: chatDeliveryStateSchema.optional(),
|
|
351
|
+
errorCode: import_zod2.z.string().optional(),
|
|
352
|
+
metadata: import_zod2.z.record(jsonValueSchema).optional(),
|
|
353
|
+
attachment: chatAttachmentStateSchema.optional()
|
|
354
|
+
});
|
|
314
355
|
var chatReadinessStatusSchema = import_zod2.z.enum([
|
|
315
356
|
"responsive",
|
|
316
357
|
"delivery_only",
|
|
@@ -408,6 +449,17 @@ var chatReadinessResponseSchema = import_zod2.z.object({
|
|
|
408
449
|
details: import_zod2.z.string().optional()
|
|
409
450
|
}).optional()
|
|
410
451
|
});
|
|
452
|
+
var chatSessionResumeResponseSchema = import_zod2.z.object({
|
|
453
|
+
sessionId: import_zod2.z.string(),
|
|
454
|
+
uaid: import_zod2.z.string().nullable().optional(),
|
|
455
|
+
agentUrl: import_zod2.z.string().nullable().optional(),
|
|
456
|
+
route: chatRouteSummarySchema,
|
|
457
|
+
transport: import_zod2.z.string(),
|
|
458
|
+
history: import_zod2.z.array(chatHistoryEntrySchema),
|
|
459
|
+
historyTtlSeconds: import_zod2.z.number().optional(),
|
|
460
|
+
visibility: import_zod2.z.enum(["private", "public"]).optional(),
|
|
461
|
+
state: chatSessionStateSchema
|
|
462
|
+
});
|
|
411
463
|
var metadataFacetSchema = import_zod2.z.record(
|
|
412
464
|
import_zod2.z.union([
|
|
413
465
|
import_zod2.z.array(jsonValueSchema),
|
|
@@ -3117,6 +3169,7 @@ function createChatApi(client, encryptedManager) {
|
|
|
3117
3169
|
start: (options) => client.startChat(options),
|
|
3118
3170
|
readiness: (payload) => client.checkChatReadiness(payload),
|
|
3119
3171
|
createSession: (payload) => client.createSession(payload),
|
|
3172
|
+
resumeSession: (sessionId) => client.resumeSession(sessionId),
|
|
3120
3173
|
sendMessage: (payload) => client.sendMessage(payload),
|
|
3121
3174
|
retryMessage: (messageId, payload) => client.retryMessage(messageId, payload),
|
|
3122
3175
|
cancelSession: (sessionId) => client.cancelSession(sessionId),
|
|
@@ -3144,6 +3197,9 @@ async function checkChatReadiness(client, payload) {
|
|
|
3144
3197
|
if (agentUrl) {
|
|
3145
3198
|
body.agentUrl = agentUrl;
|
|
3146
3199
|
}
|
|
3200
|
+
if (payload.forceRefresh !== void 0) {
|
|
3201
|
+
body.forceRefresh = payload.forceRefresh;
|
|
3202
|
+
}
|
|
3147
3203
|
const raw = await client.requestJson("/chat/readiness", {
|
|
3148
3204
|
method: "POST",
|
|
3149
3205
|
body,
|
|
@@ -3178,6 +3234,9 @@ async function createSession(client, payload, allowHistoryAutoTopUp = true) {
|
|
|
3178
3234
|
if (payload.visibility) {
|
|
3179
3235
|
body.visibility = payload.visibility;
|
|
3180
3236
|
}
|
|
3237
|
+
if (payload.idempotencyKey) {
|
|
3238
|
+
body.idempotencyKey = payload.idempotencyKey;
|
|
3239
|
+
}
|
|
3181
3240
|
try {
|
|
3182
3241
|
const raw = await client.requestJson("/chat/session", {
|
|
3183
3242
|
method: "POST",
|
|
@@ -3198,6 +3257,21 @@ async function createSession(client, payload, allowHistoryAutoTopUp = true) {
|
|
|
3198
3257
|
throw error;
|
|
3199
3258
|
}
|
|
3200
3259
|
}
|
|
3260
|
+
async function resumeSession(client, sessionId) {
|
|
3261
|
+
const normalized = sessionId.trim();
|
|
3262
|
+
if (!normalized) {
|
|
3263
|
+
throw new Error("sessionId is required to resume a chat session");
|
|
3264
|
+
}
|
|
3265
|
+
const raw = await client.requestJson(
|
|
3266
|
+
`/chat/session/${encodeURIComponent(normalized)}/resume`,
|
|
3267
|
+
{ method: "GET" }
|
|
3268
|
+
);
|
|
3269
|
+
return client.parseWithSchema(
|
|
3270
|
+
raw,
|
|
3271
|
+
chatSessionResumeResponseSchema,
|
|
3272
|
+
"chat session resume response"
|
|
3273
|
+
);
|
|
3274
|
+
}
|
|
3201
3275
|
async function startChat(client, encryptedManager, options) {
|
|
3202
3276
|
if ("uaid" in options && options.uaid) {
|
|
3203
3277
|
return startConversation(client, encryptedManager, {
|
|
@@ -7278,6 +7352,9 @@ var RegistryBrokerClient = class _RegistryBrokerClient {
|
|
|
7278
7352
|
async createSession(payload, allowHistoryAutoTopUp = true) {
|
|
7279
7353
|
return createSession(this, payload, allowHistoryAutoTopUp);
|
|
7280
7354
|
}
|
|
7355
|
+
async resumeSession(sessionId) {
|
|
7356
|
+
return resumeSession(this, sessionId);
|
|
7357
|
+
}
|
|
7281
7358
|
async checkChatReadiness(payload) {
|
|
7282
7359
|
return checkChatReadiness(this, payload);
|
|
7283
7360
|
}
|
|
@@ -7649,6 +7726,13 @@ var buildJobStatusMessage = (input) => JSON.stringify({
|
|
|
7649
7726
|
buildPaymentApproveMessage,
|
|
7650
7727
|
buildPaymentDeclineMessage,
|
|
7651
7728
|
canonicalizeLedgerNetwork,
|
|
7729
|
+
chatDeliveryStateSchema,
|
|
7730
|
+
chatErrorCodeSchema,
|
|
7731
|
+
chatReadinessStatusSchema,
|
|
7732
|
+
chatReplyModeSchema,
|
|
7733
|
+
chatRouteTypeSchema,
|
|
7734
|
+
chatSessionStateSchema,
|
|
7735
|
+
chatTimelineEntrySchema,
|
|
7652
7736
|
closeUaidConnection,
|
|
7653
7737
|
createPrivateKeySigner,
|
|
7654
7738
|
createPrivateKeySignerAsync,
|