@proteos/sdk 0.19.0 → 0.20.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/index.cjs +40 -0
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +106 -8
- package/dist/index.d.ts +106 -8
- package/dist/index.js +40 -0
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/src/auth/platform-entities.ts +1 -0
- package/src/conversation/index.ts +73 -0
- package/src/conversation/types.ts +88 -6
- package/src/index.ts +7 -0
package/package.json
CHANGED
|
@@ -62,6 +62,7 @@ export const PLATFORM_ENTITIES: readonly PlatformEntity[] = [
|
|
|
62
62
|
{ slug: 'messages', name: 'Messages' },
|
|
63
63
|
{ slug: 'agent-listeners', name: 'Agent Listeners' },
|
|
64
64
|
{ slug: 'transcriptions', name: 'Transcriptions' },
|
|
65
|
+
{ slug: 'glossary-terms', name: 'Glossary Terms' },
|
|
65
66
|
// Connectors (connector-service). `connections` above is shared; this is the
|
|
66
67
|
// manifest catalog.
|
|
67
68
|
{ slug: 'connectors', name: 'Connectors' },
|
|
@@ -10,9 +10,13 @@ import type {
|
|
|
10
10
|
Conversation,
|
|
11
11
|
CreateAgentListenerRequest,
|
|
12
12
|
CreateConnectionRequest,
|
|
13
|
+
CreateGlossaryTermRequest,
|
|
14
|
+
DispatchMeetingBotRequest,
|
|
15
|
+
GlossaryTerm,
|
|
13
16
|
InstallConnectionResponse,
|
|
14
17
|
ListAgentListenersQuery,
|
|
15
18
|
ListConnectionsQuery,
|
|
19
|
+
ListGlossaryTermsQuery,
|
|
16
20
|
ListConversationsQuery,
|
|
17
21
|
ListMessagesQuery,
|
|
18
22
|
ListParticipantsQuery,
|
|
@@ -27,6 +31,7 @@ import type {
|
|
|
27
31
|
UnreadCounts,
|
|
28
32
|
UpdateAgentListenerRequest,
|
|
29
33
|
UpdateConnectionRequest,
|
|
34
|
+
UpdateGlossaryTermRequest,
|
|
30
35
|
} from './types.js'
|
|
31
36
|
|
|
32
37
|
const CONVERSATION_BASE_PATH = '/conversations/v1'
|
|
@@ -46,7 +51,11 @@ export class ConversationClient {
|
|
|
46
51
|
readonly conversations: ConversationService
|
|
47
52
|
readonly messages: MessageService
|
|
48
53
|
readonly agentListeners: AgentListenerService
|
|
54
|
+
/** Per-org glossary: custom vocabulary that boosts transcription accuracy. */
|
|
55
|
+
readonly glossaryTerms: GlossaryTermService
|
|
49
56
|
readonly transcriptions: TranscriptionService
|
|
57
|
+
/** Meeting bots (Ava): dispatch into a meeting URL, remove from a meeting. */
|
|
58
|
+
readonly meetings: MeetingService
|
|
50
59
|
/** Realtime speech-to-text (dictation) — moved here from agent-service. */
|
|
51
60
|
readonly voice: VoiceService
|
|
52
61
|
|
|
@@ -55,11 +64,37 @@ export class ConversationClient {
|
|
|
55
64
|
this.conversations = new ConversationServiceImpl(client)
|
|
56
65
|
this.messages = new MessageServiceImpl(client)
|
|
57
66
|
this.agentListeners = new AgentListenerServiceImpl(client)
|
|
67
|
+
this.glossaryTerms = new GlossaryTermServiceImpl(client)
|
|
58
68
|
this.transcriptions = new TranscriptionServiceImpl(client)
|
|
69
|
+
this.meetings = new MeetingServiceImpl(client)
|
|
59
70
|
this.voice = new VoiceServiceImpl(client)
|
|
60
71
|
}
|
|
61
72
|
}
|
|
62
73
|
|
|
74
|
+
/** Meeting bots (Ava) — dispatch by meeting URL and removal. */
|
|
75
|
+
export interface MeetingService {
|
|
76
|
+
/**
|
|
77
|
+
* Send Ava to a meeting URL. Resolves with the pre-minted meeting
|
|
78
|
+
* conversation (channel = the platform classified from the URL); transcript
|
|
79
|
+
* turns then stream in as inbound messages while the meeting runs.
|
|
80
|
+
*/
|
|
81
|
+
dispatch(request: DispatchMeetingBotRequest): Promise<Conversation>
|
|
82
|
+
/** Make the bot leave the meeting and end the conversation (by conversation id). */
|
|
83
|
+
remove(conversationId: string): Promise<Conversation>
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
class MeetingServiceImpl implements MeetingService {
|
|
87
|
+
constructor(private readonly client: ProteosClient) {}
|
|
88
|
+
|
|
89
|
+
dispatch(request: DispatchMeetingBotRequest): Promise<Conversation> {
|
|
90
|
+
return this.client.request('POST', `${CONVERSATION_BASE_PATH}/meetings`, request)
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
remove(conversationId: string): Promise<Conversation> {
|
|
94
|
+
return this.client.request('DELETE', `${CONVERSATION_BASE_PATH}/meetings/${encodeURIComponent(conversationId)}`)
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
|
|
63
98
|
/** Configured integration instances (Slack workspace, Gmail grant, …). */
|
|
64
99
|
export interface ConnectionService {
|
|
65
100
|
list(query?: ListConnectionsQuery): Promise<ListResponse<Connection>>
|
|
@@ -249,6 +284,44 @@ class AgentListenerServiceImpl implements AgentListenerService {
|
|
|
249
284
|
}
|
|
250
285
|
}
|
|
251
286
|
|
|
287
|
+
/**
|
|
288
|
+
* Per-org glossary: custom-vocabulary terms that boost transcription accuracy.
|
|
289
|
+
* A term feeds the transcription provider's keyterm prompting; `priority` ranks
|
|
290
|
+
* a term (prioritized terms are injected first, then unprioritized), which
|
|
291
|
+
* decides the top 100 sent when an org stores more than the provider's cap.
|
|
292
|
+
*/
|
|
293
|
+
export interface GlossaryTermService {
|
|
294
|
+
list(query?: ListGlossaryTermsQuery): Promise<ListResponse<GlossaryTerm>>
|
|
295
|
+
get(id: string): Promise<GlossaryTerm>
|
|
296
|
+
create(request: CreateGlossaryTermRequest): Promise<GlossaryTerm>
|
|
297
|
+
update(id: string, request: UpdateGlossaryTermRequest): Promise<GlossaryTerm>
|
|
298
|
+
delete(id: string): Promise<void>
|
|
299
|
+
}
|
|
300
|
+
|
|
301
|
+
class GlossaryTermServiceImpl implements GlossaryTermService {
|
|
302
|
+
constructor(private readonly client: ProteosClient) {}
|
|
303
|
+
|
|
304
|
+
list(query: ListGlossaryTermsQuery = {}): Promise<ListResponse<GlossaryTerm>> {
|
|
305
|
+
return this.client.requestWithQuery('GET', `${CONVERSATION_BASE_PATH}/glossary-terms`, query)
|
|
306
|
+
}
|
|
307
|
+
|
|
308
|
+
get(id: string): Promise<GlossaryTerm> {
|
|
309
|
+
return this.client.request('GET', `${CONVERSATION_BASE_PATH}/glossary-terms/${encodeURIComponent(id)}`)
|
|
310
|
+
}
|
|
311
|
+
|
|
312
|
+
create(request: CreateGlossaryTermRequest): Promise<GlossaryTerm> {
|
|
313
|
+
return this.client.request('POST', `${CONVERSATION_BASE_PATH}/glossary-terms`, request)
|
|
314
|
+
}
|
|
315
|
+
|
|
316
|
+
update(id: string, request: UpdateGlossaryTermRequest): Promise<GlossaryTerm> {
|
|
317
|
+
return this.client.request('PATCH', `${CONVERSATION_BASE_PATH}/glossary-terms/${encodeURIComponent(id)}`, request)
|
|
318
|
+
}
|
|
319
|
+
|
|
320
|
+
async delete(id: string): Promise<void> {
|
|
321
|
+
await this.client.request('DELETE', `${CONVERSATION_BASE_PATH}/glossary-terms/${encodeURIComponent(id)}`)
|
|
322
|
+
}
|
|
323
|
+
}
|
|
324
|
+
|
|
252
325
|
/** Batch transcription of stored audio files + materialization. */
|
|
253
326
|
export interface TranscriptionService {
|
|
254
327
|
/**
|
|
@@ -5,16 +5,26 @@
|
|
|
5
5
|
|
|
6
6
|
import type { FileRef } from '../types/common.js'
|
|
7
7
|
|
|
8
|
-
/**
|
|
8
|
+
/**
|
|
9
|
+
* Platform medium a conversation lives on (closed enum; platform identity).
|
|
10
|
+
* Where a provider brand spans both a chat product and a meeting platform the
|
|
11
|
+
* channel is suffixed -chat / -meeting (teams-chat vs teams-meeting). The
|
|
12
|
+
* *-meeting channels are the platforms the Ava meeting-bot family serves;
|
|
13
|
+
* `meeting` stays the generic fallback for unclassified platforms.
|
|
14
|
+
*/
|
|
9
15
|
export type Channel =
|
|
10
16
|
| 'slack'
|
|
11
17
|
| 'email'
|
|
12
18
|
| 'linkedin'
|
|
13
19
|
| 'sms'
|
|
14
|
-
| 'teams'
|
|
20
|
+
| 'teams-chat'
|
|
15
21
|
| 'telegram'
|
|
16
22
|
| 'whatsapp'
|
|
17
23
|
| 'meeting'
|
|
24
|
+
| 'zoom-meeting'
|
|
25
|
+
| 'google-meet'
|
|
26
|
+
| 'teams-meeting'
|
|
27
|
+
| 'webex-meeting'
|
|
18
28
|
| 'adhoc'
|
|
19
29
|
| 'instagram'
|
|
20
30
|
| 'messenger'
|
|
@@ -24,7 +34,9 @@ export type Channel =
|
|
|
24
34
|
* Concrete integration serving a channel (typed union — one value per shipped
|
|
25
35
|
* connector; runtime availability is decided by the service's registry).
|
|
26
36
|
* The unipile-* family serves the six messaging systems aggregated through
|
|
27
|
-
* Unipile — one key per messaging system.
|
|
37
|
+
* Unipile — one key per messaging system. The meeting keys are the Ava
|
|
38
|
+
* meeting-bot family: adhoc-meeting dispatches by meeting URL; the calendar
|
|
39
|
+
* keys auto-join through a user's connected calendar.
|
|
28
40
|
*/
|
|
29
41
|
export type ConnectorKey =
|
|
30
42
|
| 'slack'
|
|
@@ -36,13 +48,17 @@ export type ConnectorKey =
|
|
|
36
48
|
| 'unipile-instagram'
|
|
37
49
|
| 'unipile-messenger'
|
|
38
50
|
| 'unipile-x'
|
|
51
|
+
| 'adhoc-meeting'
|
|
52
|
+
| 'google-calendar-meeting'
|
|
53
|
+
| 'microsoft-calendar-meeting'
|
|
39
54
|
|
|
40
55
|
/**
|
|
41
56
|
* Who operates the integration mechanics behind a connector: Proteos' own
|
|
42
|
-
* integration (native)
|
|
43
|
-
* Computed on connection reads; the UI
|
|
57
|
+
* integration (native), an account aggregated through Unipile (unipile), or
|
|
58
|
+
* the Ava meeting-bot family (ava). Computed on connection reads; the UI
|
|
59
|
+
* groups the connector catalog by it.
|
|
44
60
|
*/
|
|
45
|
-
export type ConnectorProvider = 'native' | 'unipile'
|
|
61
|
+
export type ConnectorProvider = 'native' | 'unipile' | 'ava'
|
|
46
62
|
|
|
47
63
|
export type MessageDirection = 'inbound' | 'outbound'
|
|
48
64
|
export type MessageStatus = 'received' | 'pending' | 'sent' | 'failed'
|
|
@@ -325,6 +341,12 @@ export interface AgentListener {
|
|
|
325
341
|
agent_key: string
|
|
326
342
|
trigger_type: AgentListenerTriggerType
|
|
327
343
|
trigger_config: AgentListenerTriggerConfig
|
|
344
|
+
/**
|
|
345
|
+
* When set, gates the listener behind a wake word: the trigger stays dormant
|
|
346
|
+
* until a message containing this phrase starts a session; once a session is
|
|
347
|
+
* connected the trigger drives it normally. Empty/absent ⇒ no gate.
|
|
348
|
+
*/
|
|
349
|
+
wake_phrase?: string
|
|
328
350
|
/** The user the dispatcher acts as when driving the agent. */
|
|
329
351
|
acting_user: UserRef
|
|
330
352
|
is_enabled: boolean
|
|
@@ -396,6 +418,8 @@ export interface CreateAgentListenerRequest {
|
|
|
396
418
|
agent_key: string
|
|
397
419
|
trigger_type: AgentListenerTriggerType
|
|
398
420
|
trigger_config?: AgentListenerTriggerConfig
|
|
421
|
+
/** Gate the listener behind a wake word; omit or leave empty for no gate. */
|
|
422
|
+
wake_phrase?: string
|
|
399
423
|
/** A bare user id; the service wraps it into a person UserRef. */
|
|
400
424
|
acting_user_id: string
|
|
401
425
|
/** Omit to default to enabled. */
|
|
@@ -408,11 +432,52 @@ export interface UpdateAgentListenerRequest {
|
|
|
408
432
|
agent_key?: string
|
|
409
433
|
trigger_type?: AgentListenerTriggerType
|
|
410
434
|
trigger_config?: AgentListenerTriggerConfig
|
|
435
|
+
/** Set to gate the listener; pass "" to clear an existing wake phrase. */
|
|
436
|
+
wake_phrase?: string
|
|
411
437
|
acting_user_id?: string
|
|
412
438
|
is_enabled?: boolean
|
|
413
439
|
priority?: number
|
|
414
440
|
}
|
|
415
441
|
|
|
442
|
+
/**
|
|
443
|
+
* A per-org glossary term: custom vocabulary that improves transcription
|
|
444
|
+
* accuracy. `term` is the boost phrase injected into the provider's keyterm
|
|
445
|
+
* prompting; `definition` is human/agent documentation only. `priority` ranks a
|
|
446
|
+
* term for injection (prioritized terms outrank unprioritized; lower number
|
|
447
|
+
* first) and decides which terms win when the org exceeds the provider's 100-term
|
|
448
|
+
* per-request cap.
|
|
449
|
+
*/
|
|
450
|
+
export interface GlossaryTerm {
|
|
451
|
+
id: string
|
|
452
|
+
org_id: string
|
|
453
|
+
term: string
|
|
454
|
+
definition?: string
|
|
455
|
+
priority?: number
|
|
456
|
+
created_at: string
|
|
457
|
+
created_by: UserRef
|
|
458
|
+
updated_at: string
|
|
459
|
+
updated_by: UserRef
|
|
460
|
+
}
|
|
461
|
+
|
|
462
|
+
export interface CreateGlossaryTermRequest {
|
|
463
|
+
term: string
|
|
464
|
+
definition?: string
|
|
465
|
+
priority?: number
|
|
466
|
+
}
|
|
467
|
+
|
|
468
|
+
export interface UpdateGlossaryTermRequest {
|
|
469
|
+
term?: string
|
|
470
|
+
definition?: string
|
|
471
|
+
priority?: number
|
|
472
|
+
/** Removes the term's priority (unprioritizes it) regardless of `priority`. */
|
|
473
|
+
is_priority_cleared?: boolean
|
|
474
|
+
}
|
|
475
|
+
|
|
476
|
+
export interface ListGlossaryTermsQuery extends PaginationQuery {
|
|
477
|
+
/** Case-insensitive substring match on the term text. */
|
|
478
|
+
search?: string
|
|
479
|
+
}
|
|
480
|
+
|
|
416
481
|
export interface PaginationQuery {
|
|
417
482
|
page?: number
|
|
418
483
|
page_size?: number
|
|
@@ -587,4 +652,21 @@ export interface MaterializeTranscriptionRequest {
|
|
|
587
652
|
|
|
588
653
|
export interface ListTranscriptionsQuery extends PaginationQuery {
|
|
589
654
|
status?: string
|
|
655
|
+
/** List a conversation's transcription artifacts. */
|
|
656
|
+
conversation_id?: string
|
|
657
|
+
/** Narrow to the provider-side transcript identity. */
|
|
658
|
+
provider_request_id?: string
|
|
659
|
+
}
|
|
660
|
+
|
|
661
|
+
/**
|
|
662
|
+
* Sends a meeting bot (Ava) into a meeting through an active meeting
|
|
663
|
+
* connection (adhoc-meeting). join_at schedules the bot ahead of time (ISO
|
|
664
|
+
* instant; a scheduled bot joins reliably on time — omit to join now); title
|
|
665
|
+
* seeds the meeting conversation's subject.
|
|
666
|
+
*/
|
|
667
|
+
export interface DispatchMeetingBotRequest {
|
|
668
|
+
connection_id: string
|
|
669
|
+
meeting_url: string
|
|
670
|
+
title?: string
|
|
671
|
+
join_at?: string
|
|
590
672
|
}
|
package/src/index.ts
CHANGED
|
@@ -183,9 +183,14 @@ export type {
|
|
|
183
183
|
ConversationStatus,
|
|
184
184
|
CreateAgentListenerRequest,
|
|
185
185
|
CreateConnectionRequest,
|
|
186
|
+
CreateGlossaryTermRequest,
|
|
187
|
+
DispatchMeetingBotRequest,
|
|
188
|
+
GlossaryTerm,
|
|
189
|
+
GlossaryTermService,
|
|
186
190
|
InstallConnectionResponse,
|
|
187
191
|
ListAgentListenersQuery,
|
|
188
192
|
ListConnectionsQuery,
|
|
193
|
+
ListGlossaryTermsQuery,
|
|
189
194
|
ListConversationsQuery,
|
|
190
195
|
ListMessagesQuery,
|
|
191
196
|
ListParticipantsQuery,
|
|
@@ -195,6 +200,7 @@ export type {
|
|
|
195
200
|
ListRoomsQuery,
|
|
196
201
|
Message,
|
|
197
202
|
MessageDirection,
|
|
203
|
+
MeetingService,
|
|
198
204
|
MessagePreview,
|
|
199
205
|
MessageRecipient,
|
|
200
206
|
MessageService,
|
|
@@ -216,6 +222,7 @@ export type {
|
|
|
216
222
|
UnreadCounts,
|
|
217
223
|
UpdateAgentListenerRequest,
|
|
218
224
|
UpdateConnectionRequest,
|
|
225
|
+
UpdateGlossaryTermRequest,
|
|
219
226
|
VoiceService,
|
|
220
227
|
VoiceTranscriptionStream,
|
|
221
228
|
} from './conversation/index.js'
|