hiloop-sdk 0.7.0 → 0.8.1
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/client.d.ts +49 -561
- package/dist/client.js +68 -710
- package/dist/index.d.ts +2 -2
- package/dist/index.js +1 -1
- package/dist/types.d.ts +30 -51
- package/dist/types.js +22 -33
- package/dist/ws.d.ts +1 -1
- package/package.json +1 -1
package/dist/client.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/** Hiloop SDK client for agents to interact with the Hiloop platform. */
|
|
2
2
|
import type { KeyPair } from "./crypto.js";
|
|
3
|
-
import type { Channel, ChannelMessage, ChannelParticipant, ConvSession, ConvSessionMessage, ConvSessionParticipant, ConvSessionRole, CreateChannelOptions, CreateConvSessionOptions,
|
|
3
|
+
import type { Channel, ChannelMessage, ChannelParticipant, ComponentNode, ConvSession, ConvSessionMessage, ConvSessionParticipant, ConvSessionRole, CreateChannelOptions, CreateConvSessionOptions, GuestToken, PaginatedResult, SessionMessage } from "./types.js";
|
|
4
4
|
export declare class HiloopError extends Error {
|
|
5
5
|
statusCode: number;
|
|
6
6
|
constructor(statusCode: number, message: string);
|
|
@@ -55,129 +55,6 @@ export declare class HiloopClient {
|
|
|
55
55
|
private request;
|
|
56
56
|
/** Fetch binary content (e.g. file download). Returns raw ArrayBuffer. */
|
|
57
57
|
private requestBinary;
|
|
58
|
-
createInteraction(opts: CreateInteractionOptions): Promise<Interaction>;
|
|
59
|
-
getInteraction(interactionId: string): Promise<Interaction>;
|
|
60
|
-
/** Try to decrypt encrypted interaction fields using content wrappings. */
|
|
61
|
-
private decryptInteractionFields;
|
|
62
|
-
cancelInteraction(interactionId: string): Promise<Interaction>;
|
|
63
|
-
/** Update description/context on an interaction. Accepts plaintext — auto-encrypts. */
|
|
64
|
-
updateInteractionContext(interactionId: string, opts: {
|
|
65
|
-
description?: string;
|
|
66
|
-
context?: string;
|
|
67
|
-
}): Promise<Record<string, unknown>>;
|
|
68
|
-
acknowledgeInteraction(interactionId: string): Promise<Interaction>;
|
|
69
|
-
/** AG-018/019: Update priority, deadline, or context metadata on a pending interaction. */
|
|
70
|
-
updateInteractionMetadata(interactionId: string, opts: {
|
|
71
|
-
priority?: string;
|
|
72
|
-
deadlineMinutes?: number;
|
|
73
|
-
encryptedContext?: string;
|
|
74
|
-
}): Promise<{
|
|
75
|
-
id: string;
|
|
76
|
-
priority: string;
|
|
77
|
-
deadlineAt: string | null;
|
|
78
|
-
updatedAt: string;
|
|
79
|
-
}>;
|
|
80
|
-
/** Get the transition log for an interaction. */
|
|
81
|
-
getInteractionTransitions(interactionId: string): Promise<{
|
|
82
|
-
transitions: Record<string, unknown>[];
|
|
83
|
-
}>;
|
|
84
|
-
/** HU-073 (agent side): Read pending task control signal (pause/resume/cancel). */
|
|
85
|
-
getTaskControl(interactionId: string): Promise<{
|
|
86
|
-
signal: string | null;
|
|
87
|
-
signalAt: string | null;
|
|
88
|
-
}>;
|
|
89
|
-
/** HU-073 (agent side): Acknowledge task control signal, clearing it. */
|
|
90
|
-
ackTaskControl(interactionId: string): Promise<{
|
|
91
|
-
acknowledged: string | null;
|
|
92
|
-
}>;
|
|
93
|
-
/** Single long-poll for a response (server-side timeout, max ~30s). */
|
|
94
|
-
awaitResponse(interactionId: string, timeout?: number): Promise<Interaction>;
|
|
95
|
-
/**
|
|
96
|
-
* Wait for a human to respond to an interaction, polling repeatedly.
|
|
97
|
-
* Returns the interaction once it has a response (status is responded/completed),
|
|
98
|
-
* or throws after the timeout expires.
|
|
99
|
-
*
|
|
100
|
-
* @param interactionId - The interaction to wait for
|
|
101
|
-
* @param timeoutSeconds - Maximum wait time in seconds (default 300, max 3600)
|
|
102
|
-
*/
|
|
103
|
-
waitForResponse(interactionId: string, timeoutSeconds?: number): Promise<Interaction>;
|
|
104
|
-
listInteractions(filters?: {
|
|
105
|
-
status?: string;
|
|
106
|
-
type?: string;
|
|
107
|
-
page?: number;
|
|
108
|
-
pageSize?: number;
|
|
109
|
-
}): Promise<PaginatedResult<Interaction>>;
|
|
110
|
-
sendMessage(interactionId: string, content: string): Promise<Message>;
|
|
111
|
-
/** Push content blocks to an interaction. */
|
|
112
|
-
pushContentBlocks(interactionId: string, blocks: Array<{
|
|
113
|
-
blockType: string;
|
|
114
|
-
data: Record<string, unknown>;
|
|
115
|
-
position?: number;
|
|
116
|
-
}>): Promise<{
|
|
117
|
-
items: Record<string, unknown>[];
|
|
118
|
-
count: number;
|
|
119
|
-
}>;
|
|
120
|
-
/** List content blocks for an interaction. */
|
|
121
|
-
listContentBlocks(interactionId: string): Promise<{
|
|
122
|
-
items: Record<string, unknown>[];
|
|
123
|
-
total: number;
|
|
124
|
-
}>;
|
|
125
|
-
/** Update a content block. */
|
|
126
|
-
updateContentBlock(interactionId: string, blockId: string, data: Record<string, unknown>): Promise<{
|
|
127
|
-
id: string;
|
|
128
|
-
blockType: string;
|
|
129
|
-
data: Record<string, unknown>;
|
|
130
|
-
position: number;
|
|
131
|
-
updatedAt: string;
|
|
132
|
-
}>;
|
|
133
|
-
/** Delete a content block. */
|
|
134
|
-
deleteContentBlock(interactionId: string, blockId: string): Promise<{
|
|
135
|
-
deleted: boolean;
|
|
136
|
-
}>;
|
|
137
|
-
/** Upload a file attachment to an interaction (base64-encoded). */
|
|
138
|
-
uploadAttachment(interactionId: string, opts: {
|
|
139
|
-
fileName: string;
|
|
140
|
-
mimeType: string;
|
|
141
|
-
content: string;
|
|
142
|
-
messageId?: string;
|
|
143
|
-
}): Promise<{
|
|
144
|
-
id: string;
|
|
145
|
-
fileName: string;
|
|
146
|
-
mimeType: string;
|
|
147
|
-
sizeBytes: number;
|
|
148
|
-
createdAt: string;
|
|
149
|
-
}>;
|
|
150
|
-
/** List attachments for an interaction, optionally filtered by messageId. */
|
|
151
|
-
listAttachments(interactionId: string, messageId?: string): Promise<{
|
|
152
|
-
items: Record<string, unknown>[];
|
|
153
|
-
total: number;
|
|
154
|
-
}>;
|
|
155
|
-
/** Download raw binary content of a specific attachment. */
|
|
156
|
-
getAttachment(interactionId: string, fileId: string): Promise<ArrayBuffer>;
|
|
157
|
-
/** List all reactions for messages in an interaction. */
|
|
158
|
-
listInteractionReactions(interactionId: string): Promise<{
|
|
159
|
-
items: Record<string, unknown>[];
|
|
160
|
-
}>;
|
|
161
|
-
/** Add a reaction emoji to a message in an interaction. */
|
|
162
|
-
addInteractionReaction(interactionId: string, messageId: string, emoji: string): Promise<{
|
|
163
|
-
id: string;
|
|
164
|
-
messageId: string;
|
|
165
|
-
emoji: string;
|
|
166
|
-
createdAt: string;
|
|
167
|
-
}>;
|
|
168
|
-
/** Remove a reaction emoji from a message in an interaction. */
|
|
169
|
-
removeInteractionReaction(interactionId: string, messageId: string, emoji: string): Promise<{
|
|
170
|
-
ok: boolean;
|
|
171
|
-
}>;
|
|
172
|
-
/** Mark all messages in an interaction as read by this agent. */
|
|
173
|
-
markInteractionRead(interactionId: string): Promise<{
|
|
174
|
-
markedRead: number;
|
|
175
|
-
}>;
|
|
176
|
-
/** Send a typing indicator for an interaction. */
|
|
177
|
-
sendInteractionTyping(interactionId: string, isTyping: boolean): Promise<{
|
|
178
|
-
ok: boolean;
|
|
179
|
-
}>;
|
|
180
|
-
listMessages(interactionId: string, page?: number, pageSize?: number): Promise<PaginatedResult<Message>>;
|
|
181
58
|
/** AD-060: Push agent telemetry activity status + plan to the platform. */
|
|
182
59
|
pushTelemetry(opts: {
|
|
183
60
|
status: string;
|
|
@@ -261,16 +138,31 @@ export declare class HiloopClient {
|
|
|
261
138
|
}): Promise<ConvSession[]>;
|
|
262
139
|
closeConvSession(sessionId: string): Promise<ConvSession>;
|
|
263
140
|
/**
|
|
264
|
-
* Send a message to a
|
|
265
|
-
*
|
|
141
|
+
* Send a message to a session. Accepts plaintext content and optional
|
|
142
|
+
* rich components. Encrypts content and components automatically.
|
|
143
|
+
*
|
|
144
|
+
* This is the primary method for agent-to-human communication.
|
|
145
|
+
*/
|
|
146
|
+
sendMessage(sessionId: string, content: string, opts?: {
|
|
147
|
+
components?: ComponentNode[];
|
|
148
|
+
priority?: string;
|
|
149
|
+
deadlineMinutes?: number;
|
|
150
|
+
replyToMessageId?: string;
|
|
151
|
+
agentName?: string;
|
|
152
|
+
}): Promise<SessionMessage>;
|
|
153
|
+
/**
|
|
154
|
+
* Long-poll for a response to a specific message.
|
|
155
|
+
* Returns the updated message once the human has responded, or after timeout.
|
|
266
156
|
*/
|
|
157
|
+
awaitResponse(sessionId: string, messageId: string, timeoutSeconds?: number): Promise<SessionMessage>;
|
|
267
158
|
/**
|
|
268
|
-
*
|
|
269
|
-
* using the session message key (`{agentPub}:{AES-GCM ciphertext}` format).
|
|
159
|
+
* Acknowledge a message (mark it as seen/handled by the agent).
|
|
270
160
|
*/
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
161
|
+
acknowledge(sessionId: string, messageId: string): Promise<SessionMessage>;
|
|
162
|
+
/**
|
|
163
|
+
* Cancel a previously sent message (e.g. withdraw an approval request).
|
|
164
|
+
*/
|
|
165
|
+
cancel(sessionId: string, messageId: string): Promise<SessionMessage>;
|
|
274
166
|
/** Send a typing indicator to a conv session (HU-034). */
|
|
275
167
|
sendConvSessionTyping(sessionId: string, typing: boolean): Promise<void>;
|
|
276
168
|
/** Edit a previously sent conv session message. */
|
|
@@ -299,46 +191,33 @@ export declare class HiloopClient {
|
|
|
299
191
|
}): Promise<GuestToken>;
|
|
300
192
|
listGuestTokens(sessionId: string): Promise<GuestToken[]>;
|
|
301
193
|
revokeGuestToken(sessionId: string, tokenId: string): Promise<void>;
|
|
302
|
-
/** AG-060: Create multiple interactions in a single API call. */
|
|
303
|
-
createInteractionBatch(interactions: CreateInteractionOptions[]): Promise<{
|
|
304
|
-
results: {
|
|
305
|
-
id: string;
|
|
306
|
-
kind: string;
|
|
307
|
-
status: string;
|
|
308
|
-
error?: string;
|
|
309
|
-
}[];
|
|
310
|
-
total: number;
|
|
311
|
-
successes: number;
|
|
312
|
-
}>;
|
|
313
194
|
/** Archive a conversation session. */
|
|
314
195
|
archiveConvSession(sessionId: string): Promise<ConvSession>;
|
|
315
|
-
/**
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
196
|
+
/** Upload an attachment to a session. Content must be base64-encoded. */
|
|
197
|
+
uploadSessionAttachment(sessionId: string, opts: {
|
|
198
|
+
fileName: string;
|
|
199
|
+
mimeType: string;
|
|
200
|
+
content: string;
|
|
201
|
+
messageId?: string;
|
|
202
|
+
}): Promise<{
|
|
320
203
|
id: string;
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
}[];
|
|
327
|
-
}>;
|
|
328
|
-
/** Add a reference from one interaction to another (AG-062). */
|
|
329
|
-
addInteractionReference(interactionId: string, targetInteractionId: string, opts?: {
|
|
330
|
-
referenceType?: string;
|
|
331
|
-
note?: string;
|
|
332
|
-
}): Promise<Record<string, unknown>>;
|
|
333
|
-
/** List all references for an interaction (AG-062). */
|
|
334
|
-
listInteractionReferences(interactionId: string): Promise<{
|
|
335
|
-
items: Record<string, unknown>[];
|
|
336
|
-
total: number;
|
|
337
|
-
}>;
|
|
338
|
-
/** Remove an interaction reference by its ID (AG-062). */
|
|
339
|
-
removeInteractionReference(interactionId: string, refId: string): Promise<{
|
|
340
|
-
deleted: boolean;
|
|
204
|
+
fileName: string;
|
|
205
|
+
mimeType: string;
|
|
206
|
+
sizeBytes: number;
|
|
207
|
+
messageId: string | null;
|
|
208
|
+
createdAt: string;
|
|
341
209
|
}>;
|
|
210
|
+
/** List attachments for a session. */
|
|
211
|
+
listSessionAttachments(sessionId: string): Promise<{
|
|
212
|
+
id: string;
|
|
213
|
+
fileName: string;
|
|
214
|
+
mimeType: string;
|
|
215
|
+
sizeBytes: number;
|
|
216
|
+
messageId: string | null;
|
|
217
|
+
createdAt: string;
|
|
218
|
+
}[]>;
|
|
219
|
+
/** Download an attachment's binary content. */
|
|
220
|
+
downloadSessionAttachment(sessionId: string, fileId: string): Promise<ArrayBuffer>;
|
|
342
221
|
/** Get public metadata for a public agent by slug. */
|
|
343
222
|
getPublicAgentInfo(slug: string): Promise<{
|
|
344
223
|
name: string;
|
|
@@ -346,64 +225,6 @@ export declare class HiloopClient {
|
|
|
346
225
|
slug: string;
|
|
347
226
|
isPublic: boolean;
|
|
348
227
|
}>;
|
|
349
|
-
/** Create an interaction as a public (anonymous) user on a public agent. */
|
|
350
|
-
createPublicInteraction(slug: string, opts: {
|
|
351
|
-
encryptedTitle: string;
|
|
352
|
-
type?: string;
|
|
353
|
-
priority?: string;
|
|
354
|
-
deadlineMinutes?: number;
|
|
355
|
-
}): Promise<{
|
|
356
|
-
id: string;
|
|
357
|
-
kind: string;
|
|
358
|
-
status: string;
|
|
359
|
-
priority: string;
|
|
360
|
-
createdAt: string;
|
|
361
|
-
}>;
|
|
362
|
-
/** Get the status of a public interaction by slug + ID. */
|
|
363
|
-
getPublicInteraction(slug: string, interactionId: string): Promise<{
|
|
364
|
-
id: string;
|
|
365
|
-
kind: string;
|
|
366
|
-
status: string;
|
|
367
|
-
priority: string;
|
|
368
|
-
encryptedTitle: string | null;
|
|
369
|
-
encryptedResponse: string | null;
|
|
370
|
-
createdAt: string;
|
|
371
|
-
updatedAt: string;
|
|
372
|
-
}>;
|
|
373
|
-
/** Long-poll for a response on a public interaction (returns when responded/completed/cancelled/expired). */
|
|
374
|
-
awaitPublicInteraction(slug: string, interactionId: string, timeoutMs?: number): Promise<{
|
|
375
|
-
id: string;
|
|
376
|
-
status: string;
|
|
377
|
-
encryptedResponse: string | null;
|
|
378
|
-
respondedAt: string | null;
|
|
379
|
-
}>;
|
|
380
|
-
/** Send a message to a public interaction as an anonymous user. */
|
|
381
|
-
sendPublicMessage(slug: string, interactionId: string, encryptedContent: string): Promise<{
|
|
382
|
-
id: string;
|
|
383
|
-
interactionId: string;
|
|
384
|
-
senderType: string;
|
|
385
|
-
encryptedContent: string;
|
|
386
|
-
createdAt: string;
|
|
387
|
-
}>;
|
|
388
|
-
/** List interactions created on a public agent (paginated). */
|
|
389
|
-
listPublicInteractions(slug: string, opts?: {
|
|
390
|
-
page?: number;
|
|
391
|
-
pageSize?: number;
|
|
392
|
-
}): Promise<{
|
|
393
|
-
items: Record<string, unknown>[];
|
|
394
|
-
total: number;
|
|
395
|
-
page: number;
|
|
396
|
-
pageSize: number;
|
|
397
|
-
}>;
|
|
398
|
-
/** Cancel a public interaction (anonymous user side). */
|
|
399
|
-
cancelPublicInteraction(slug: string, interactionId: string): Promise<{
|
|
400
|
-
id: string;
|
|
401
|
-
status: string;
|
|
402
|
-
}>;
|
|
403
|
-
/** Get the transition log for a public interaction. */
|
|
404
|
-
getPublicInteractionTransitions(slug: string, interactionId: string): Promise<{
|
|
405
|
-
transitions: Record<string, unknown>[];
|
|
406
|
-
}>;
|
|
407
228
|
/** Look up a public session by its public token (no auth required). */
|
|
408
229
|
getPublicSession(publicToken: string): Promise<{
|
|
409
230
|
session: Record<string, unknown>;
|
|
@@ -413,331 +234,6 @@ export declare class HiloopClient {
|
|
|
413
234
|
sessionId: string;
|
|
414
235
|
guestToken: string;
|
|
415
236
|
}>;
|
|
416
|
-
/** Get a human-facing interaction detail view. */
|
|
417
|
-
getHumanInteraction(interactionId: string): Promise<Record<string, unknown>>;
|
|
418
|
-
/** Mark an interaction as viewed by the authenticated user. */
|
|
419
|
-
viewInteraction(interactionId: string): Promise<{
|
|
420
|
-
id: string;
|
|
421
|
-
status: string;
|
|
422
|
-
}>;
|
|
423
|
-
/** Submit a response to an interaction. */
|
|
424
|
-
respondToHumanInteraction(interactionId: string, opts: {
|
|
425
|
-
encryptedResponse: string;
|
|
426
|
-
responseEventType?: string;
|
|
427
|
-
}): Promise<Record<string, unknown>>;
|
|
428
|
-
/** Snooze an interaction until a given ISO datetime. */
|
|
429
|
-
snoozeInteraction(interactionId: string, snoozedUntil: string): Promise<{
|
|
430
|
-
id: string;
|
|
431
|
-
snoozedUntil: string | null;
|
|
432
|
-
}>;
|
|
433
|
-
/** Toggle the pinned state of an interaction. */
|
|
434
|
-
pinInteraction(interactionId: string, pinned: boolean): Promise<{
|
|
435
|
-
id: string;
|
|
436
|
-
isPinned: boolean;
|
|
437
|
-
}>;
|
|
438
|
-
/** Get the human user's activity feed (all interactions). */
|
|
439
|
-
getFeed(opts?: {
|
|
440
|
-
page?: number;
|
|
441
|
-
pageSize?: number;
|
|
442
|
-
view?: string;
|
|
443
|
-
q?: string;
|
|
444
|
-
type?: string;
|
|
445
|
-
priority?: string;
|
|
446
|
-
pinned?: boolean;
|
|
447
|
-
agentId?: string;
|
|
448
|
-
}): Promise<{
|
|
449
|
-
items: Record<string, unknown>[];
|
|
450
|
-
total: number;
|
|
451
|
-
}>;
|
|
452
|
-
/** Get badge counts (e.g. open interactions) for the authenticated user. */
|
|
453
|
-
getBadges(): Promise<{
|
|
454
|
-
open: number;
|
|
455
|
-
}>;
|
|
456
|
-
/** Get the authenticated user's current availability status. */
|
|
457
|
-
getMyAvailability(): Promise<{
|
|
458
|
-
status: string;
|
|
459
|
-
}>;
|
|
460
|
-
/** Update the authenticated user's availability status. */
|
|
461
|
-
updateMyAvailability(status: "active" | "away" | "dnd" | "offline"): Promise<{
|
|
462
|
-
status: string;
|
|
463
|
-
}>;
|
|
464
|
-
/** List delegation rules for the authenticated user. */
|
|
465
|
-
listDelegations(): Promise<{
|
|
466
|
-
items: Record<string, unknown>[];
|
|
467
|
-
}>;
|
|
468
|
-
/** Create a delegation rule for the authenticated user. */
|
|
469
|
-
createDelegation(opts: {
|
|
470
|
-
delegateToUserId: string;
|
|
471
|
-
triggerStatus?: string;
|
|
472
|
-
delegateToTeamId?: string;
|
|
473
|
-
}): Promise<{
|
|
474
|
-
ok: boolean;
|
|
475
|
-
}>;
|
|
476
|
-
/** Remove a delegation rule by delegateId. */
|
|
477
|
-
deleteDelegation(delegateId: string): Promise<{
|
|
478
|
-
ok: boolean;
|
|
479
|
-
}>;
|
|
480
|
-
/** List sent notifications for the authenticated user. */
|
|
481
|
-
listNotifications(): Promise<{
|
|
482
|
-
items: Record<string, unknown>[];
|
|
483
|
-
total: number;
|
|
484
|
-
}>;
|
|
485
|
-
/** Get notification preferences for the authenticated user. */
|
|
486
|
-
getNotificationPreferences(): Promise<{
|
|
487
|
-
preferences: Record<string, unknown>[];
|
|
488
|
-
}>;
|
|
489
|
-
/** Update notification preference for a specific channel. */
|
|
490
|
-
updateNotificationPreference(channel: "push" | "email" | "sms" | "in_app", opts: {
|
|
491
|
-
enabled?: boolean;
|
|
492
|
-
quietHoursStart?: number;
|
|
493
|
-
quietHoursEnd?: number;
|
|
494
|
-
digestEnabled?: boolean;
|
|
495
|
-
digestFrequency?: "daily" | "weekly";
|
|
496
|
-
minPriority?: string;
|
|
497
|
-
}): Promise<Record<string, unknown>>;
|
|
498
|
-
/** Register a push token for the authenticated user's device. */
|
|
499
|
-
registerPushToken(opts: {
|
|
500
|
-
token: string;
|
|
501
|
-
platform: "fcm" | "apns" | "apns_voip";
|
|
502
|
-
deviceId?: string;
|
|
503
|
-
}): Promise<{
|
|
504
|
-
id: string;
|
|
505
|
-
token: string;
|
|
506
|
-
platform: string;
|
|
507
|
-
}>;
|
|
508
|
-
/** Remove the push token for the authenticated user's device. */
|
|
509
|
-
deletePushToken(opts: {
|
|
510
|
-
token: string;
|
|
511
|
-
platform: string;
|
|
512
|
-
}): Promise<{
|
|
513
|
-
deleted: boolean;
|
|
514
|
-
}>;
|
|
515
|
-
/** Save (upsert) a response draft for an interaction. */
|
|
516
|
-
saveDraft(interactionId: string, encryptedDraft: string): Promise<{
|
|
517
|
-
id: string;
|
|
518
|
-
updatedAt: string;
|
|
519
|
-
}>;
|
|
520
|
-
/** Get the saved response draft for an interaction. */
|
|
521
|
-
getDraft(interactionId: string): Promise<{
|
|
522
|
-
id: string;
|
|
523
|
-
encryptedDraft: string;
|
|
524
|
-
updatedAt: string;
|
|
525
|
-
} | null>;
|
|
526
|
-
/** Delete the saved response draft for an interaction. */
|
|
527
|
-
deleteDraft(interactionId: string): Promise<{
|
|
528
|
-
deleted: boolean;
|
|
529
|
-
}>;
|
|
530
|
-
/** Unsnooze an interaction before its scheduled snooze time. */
|
|
531
|
-
unsnoozeInteraction(interactionId: string): Promise<{
|
|
532
|
-
id: string;
|
|
533
|
-
snoozedUntil: null;
|
|
534
|
-
}>;
|
|
535
|
-
/** Create a milestone alert for an interaction. */
|
|
536
|
-
createMilestoneAlert(interactionId: string, opts: {
|
|
537
|
-
encryptedLabel: string;
|
|
538
|
-
triggerAt: string;
|
|
539
|
-
}): Promise<{
|
|
540
|
-
id: string;
|
|
541
|
-
triggeredAt: string | null;
|
|
542
|
-
}>;
|
|
543
|
-
/** List milestone alerts for an interaction. */
|
|
544
|
-
listMilestoneAlerts(interactionId: string): Promise<{
|
|
545
|
-
alerts: Record<string, unknown>[];
|
|
546
|
-
}>;
|
|
547
|
-
/** Delete a milestone alert. */
|
|
548
|
-
deleteMilestoneAlert(interactionId: string, alertId: string): Promise<{
|
|
549
|
-
deleted: boolean;
|
|
550
|
-
}>;
|
|
551
|
-
/** Get the approval chain for an interaction. */
|
|
552
|
-
getApprovalChain(interactionId: string): Promise<{
|
|
553
|
-
chain: Record<string, unknown>[];
|
|
554
|
-
}>;
|
|
555
|
-
/** Respond to an approval chain step. */
|
|
556
|
-
respondToApprovalChain(interactionId: string, opts: {
|
|
557
|
-
decision: string;
|
|
558
|
-
encryptedComment?: string;
|
|
559
|
-
}): Promise<{
|
|
560
|
-
ok: boolean;
|
|
561
|
-
status: string;
|
|
562
|
-
}>;
|
|
563
|
-
/** List comments on an interaction. */
|
|
564
|
-
listInteractionComments(interactionId: string): Promise<{
|
|
565
|
-
comments: Record<string, unknown>[];
|
|
566
|
-
}>;
|
|
567
|
-
/** Post a comment on an interaction. */
|
|
568
|
-
createInteractionComment(interactionId: string, opts: {
|
|
569
|
-
encryptedContent: string;
|
|
570
|
-
parentId?: string;
|
|
571
|
-
}): Promise<{
|
|
572
|
-
id: string;
|
|
573
|
-
createdAt: string;
|
|
574
|
-
}>;
|
|
575
|
-
/** Mark a comment as resolved. */
|
|
576
|
-
resolveInteractionComment(interactionId: string, commentId: string): Promise<{
|
|
577
|
-
id: string;
|
|
578
|
-
isResolved: boolean;
|
|
579
|
-
}>;
|
|
580
|
-
/** Delete a comment. */
|
|
581
|
-
deleteInteractionComment(interactionId: string, commentId: string): Promise<{
|
|
582
|
-
deleted: boolean;
|
|
583
|
-
}>;
|
|
584
|
-
/** Submit review feedback for an interaction. */
|
|
585
|
-
submitReviewFeedback(interactionId: string, opts: {
|
|
586
|
-
rating: number;
|
|
587
|
-
encryptedFeedback?: string;
|
|
588
|
-
}): Promise<{
|
|
589
|
-
id: string;
|
|
590
|
-
rating: number;
|
|
591
|
-
}>;
|
|
592
|
-
/** Cast a vote on an interaction. */
|
|
593
|
-
voteOnInteraction(interactionId: string, opts: {
|
|
594
|
-
choice: string;
|
|
595
|
-
encryptedComment?: string;
|
|
596
|
-
}): Promise<{
|
|
597
|
-
id: string;
|
|
598
|
-
choice: string;
|
|
599
|
-
}>;
|
|
600
|
-
/** Get aggregate vote results for an interaction. */
|
|
601
|
-
getVoteResults(interactionId: string): Promise<{
|
|
602
|
-
results: Record<string, number>;
|
|
603
|
-
total: number;
|
|
604
|
-
}>;
|
|
605
|
-
/** Get the current user's vote on an interaction. */
|
|
606
|
-
getMyVote(interactionId: string): Promise<{
|
|
607
|
-
choice: string | null;
|
|
608
|
-
id: string | null;
|
|
609
|
-
}>;
|
|
610
|
-
/** List tags on an interaction. */
|
|
611
|
-
getInteractionTags(interactionId: string): Promise<{
|
|
612
|
-
tags: string[];
|
|
613
|
-
}>;
|
|
614
|
-
/** Add a tag to an interaction. */
|
|
615
|
-
addInteractionTag(interactionId: string, tag: string): Promise<{
|
|
616
|
-
tags: string[];
|
|
617
|
-
}>;
|
|
618
|
-
/** Remove a tag from an interaction. */
|
|
619
|
-
deleteInteractionTag(interactionId: string, tag: string): Promise<{
|
|
620
|
-
deleted: boolean;
|
|
621
|
-
}>;
|
|
622
|
-
/** List all space-wide tags. */
|
|
623
|
-
listSpaceTags(): Promise<{
|
|
624
|
-
tags: string[];
|
|
625
|
-
}>;
|
|
626
|
-
/** List response templates for the current user. */
|
|
627
|
-
listResponseTemplates(): Promise<{
|
|
628
|
-
templates: Record<string, unknown>[];
|
|
629
|
-
}>;
|
|
630
|
-
/** Create a response template. */
|
|
631
|
-
createResponseTemplate(opts: {
|
|
632
|
-
encryptedContent: string;
|
|
633
|
-
type?: string;
|
|
634
|
-
}): Promise<{
|
|
635
|
-
id: string;
|
|
636
|
-
createdAt: string;
|
|
637
|
-
}>;
|
|
638
|
-
/** Delete a response template. */
|
|
639
|
-
deleteResponseTemplate(templateId: string): Promise<{
|
|
640
|
-
deleted: boolean;
|
|
641
|
-
}>;
|
|
642
|
-
/** Get review feedback for an interaction. */
|
|
643
|
-
getReviewFeedback(interactionId: string): Promise<{
|
|
644
|
-
feedback: Record<string, unknown>[];
|
|
645
|
-
}>;
|
|
646
|
-
/** Use a response template (increments usage count). */
|
|
647
|
-
useResponseTemplate(templateId: string): Promise<{
|
|
648
|
-
id: string;
|
|
649
|
-
encryptedContent: string;
|
|
650
|
-
}>;
|
|
651
|
-
/** List messages for a human interaction. */
|
|
652
|
-
listInteractionMessages(interactionId: string, opts?: {
|
|
653
|
-
before?: string;
|
|
654
|
-
limit?: number;
|
|
655
|
-
}): Promise<{
|
|
656
|
-
messages: Record<string, unknown>[];
|
|
657
|
-
total: number;
|
|
658
|
-
}>;
|
|
659
|
-
/** Send a message to a human interaction thread. */
|
|
660
|
-
sendInteractionMessage(interactionId: string, opts: {
|
|
661
|
-
encryptedContent: string;
|
|
662
|
-
role?: string;
|
|
663
|
-
}): Promise<{
|
|
664
|
-
id: string;
|
|
665
|
-
createdAt: string;
|
|
666
|
-
}>;
|
|
667
|
-
/** Mark messages as read for an interaction. */
|
|
668
|
-
markMessagesRead(interactionId: string): Promise<{
|
|
669
|
-
markedCount: number;
|
|
670
|
-
}>;
|
|
671
|
-
/** Get aggregated reactions for all messages in an interaction. */
|
|
672
|
-
getInteractionReactions(interactionId: string): Promise<{
|
|
673
|
-
reactions: Record<string, unknown>[];
|
|
674
|
-
}>;
|
|
675
|
-
/** Add a reaction to a specific message. */
|
|
676
|
-
addMessageReaction(interactionId: string, messageId: string, emoji: string): Promise<{
|
|
677
|
-
ok: boolean;
|
|
678
|
-
}>;
|
|
679
|
-
/** Remove a reaction from a specific message. */
|
|
680
|
-
removeMessageReaction(interactionId: string, messageId: string, emoji: string): Promise<{
|
|
681
|
-
deleted: boolean;
|
|
682
|
-
}>;
|
|
683
|
-
/** Get agent activity data for the space (for human dashboard). */
|
|
684
|
-
getAgentActivity(): Promise<{
|
|
685
|
-
agents: Record<string, unknown>[];
|
|
686
|
-
}>;
|
|
687
|
-
/** List interaction references for a human interaction. */
|
|
688
|
-
listHumanInteractionReferences(interactionId: string): Promise<{
|
|
689
|
-
references: Record<string, unknown>[];
|
|
690
|
-
}>;
|
|
691
|
-
/** Add a reference link between two interactions. */
|
|
692
|
-
addHumanInteractionReference(interactionId: string, opts: {
|
|
693
|
-
targetInteractionId: string;
|
|
694
|
-
type?: string;
|
|
695
|
-
}): Promise<{
|
|
696
|
-
id: string;
|
|
697
|
-
}>;
|
|
698
|
-
/** Get current usage and quota for the space. */
|
|
699
|
-
getUsage(): Promise<{
|
|
700
|
-
usage: Record<string, unknown>;
|
|
701
|
-
quota: Record<string, unknown>;
|
|
702
|
-
}>;
|
|
703
|
-
/** Get feature gate flags for the current user. */
|
|
704
|
-
getFeatureGates(): Promise<{
|
|
705
|
-
gates: Record<string, boolean>;
|
|
706
|
-
}>;
|
|
707
|
-
/** Track that the current user is viewing an interaction. */
|
|
708
|
-
trackInteractionViewing(interactionId: string): Promise<{
|
|
709
|
-
ok: boolean;
|
|
710
|
-
}>;
|
|
711
|
-
/** Get who is currently viewing an interaction. */
|
|
712
|
-
getInteractionViewers(interactionId: string): Promise<{
|
|
713
|
-
viewers: Record<string, unknown>[];
|
|
714
|
-
}>;
|
|
715
|
-
/** Stop tracking viewing presence for an interaction. */
|
|
716
|
-
stopTrackingViewing(interactionId: string): Promise<{
|
|
717
|
-
ok: boolean;
|
|
718
|
-
}>;
|
|
719
|
-
/** Get human-assigned tasks (interactions requiring action). */
|
|
720
|
-
getHumanTasks(opts?: {
|
|
721
|
-
page?: number;
|
|
722
|
-
pageSize?: number;
|
|
723
|
-
}): Promise<{
|
|
724
|
-
items: Record<string, unknown>[];
|
|
725
|
-
total: number;
|
|
726
|
-
}>;
|
|
727
|
-
/** List space members (humans). */
|
|
728
|
-
getHumanMembers(opts?: {
|
|
729
|
-
page?: number;
|
|
730
|
-
pageSize?: number;
|
|
731
|
-
}): Promise<{
|
|
732
|
-
members: Record<string, unknown>[];
|
|
733
|
-
total: number;
|
|
734
|
-
}>;
|
|
735
|
-
/** Get aggregated notification digest for the current user. */
|
|
736
|
-
getNotificationDigest(opts?: {
|
|
737
|
-
since?: string;
|
|
738
|
-
}): Promise<{
|
|
739
|
-
digest: Record<string, unknown>[];
|
|
740
|
-
}>;
|
|
741
237
|
/** Create a new agent-to-agent channel. */
|
|
742
238
|
createChannel(opts: CreateChannelOptions): Promise<Channel>;
|
|
743
239
|
/** Get a channel by ID. */
|
|
@@ -843,14 +339,11 @@ export declare class HiloopClient {
|
|
|
843
339
|
/** Decrypt an encrypted session message (e.g., from a webhook payload). */
|
|
844
340
|
decryptSessionMessage(encryptedContent: string): Promise<string | null>;
|
|
845
341
|
/**
|
|
846
|
-
* Decrypt
|
|
847
|
-
* Decrypts
|
|
848
|
-
* Returns the payload with added `
|
|
342
|
+
* Decrypt a webhook payload in place.
|
|
343
|
+
* Decrypts encryptedContent from session messages.
|
|
344
|
+
* Returns the payload with an added `content` field.
|
|
849
345
|
*/
|
|
850
346
|
decryptWebhookPayload<T extends Record<string, unknown>>(payload: T): Promise<T & {
|
|
851
|
-
title?: string;
|
|
852
|
-
response?: string;
|
|
853
|
-
comment?: string;
|
|
854
347
|
content?: string;
|
|
855
348
|
}>;
|
|
856
349
|
static generateKeyPair(): KeyPair;
|
|
@@ -859,8 +352,3 @@ export declare class HiloopClient {
|
|
|
859
352
|
/** Decrypt AES-256-GCM ciphertext from session messages. */
|
|
860
353
|
static decryptAes(ciphertextBase64: string, keyBase64: string): Promise<string>;
|
|
861
354
|
}
|
|
862
|
-
/**
|
|
863
|
-
* Return all wrappings as-is. Each encrypted field has its own random content
|
|
864
|
-
* key, so every wrapping is unique even when scope + recipientKeyId match.
|
|
865
|
-
* The frontend tries each wrapping until one successfully decrypts.
|
|
866
|
-
*/
|