@proteos/sdk 0.19.0 → 0.20.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/index.cjs +15 -0
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +56 -8
- package/dist/index.d.ts +56 -8
- package/dist/index.js +15 -0
- package/dist/index.js.map +1 -1
- package/package.json +3 -3
- package/src/conversation/index.ts +28 -0
- package/src/conversation/types.ts +49 -6
- package/src/index.ts +2 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@proteos/sdk",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.20.0",
|
|
4
4
|
"license": "Apache-2.0",
|
|
5
5
|
"description": "TypeScript SDK for the Proteos platform",
|
|
6
6
|
"repository": {
|
|
@@ -66,8 +66,8 @@
|
|
|
66
66
|
"tsup": "^8.3.0",
|
|
67
67
|
"typescript": "^5.7.0",
|
|
68
68
|
"vitest": "^3.0.0",
|
|
69
|
-
"@proteos/
|
|
70
|
-
"@proteos/
|
|
69
|
+
"@proteos/tsconfig": "0.0.0",
|
|
70
|
+
"@proteos/biome-config": "0.0.0"
|
|
71
71
|
},
|
|
72
72
|
"scripts": {
|
|
73
73
|
"build": "tsup",
|
|
@@ -10,6 +10,7 @@ import type {
|
|
|
10
10
|
Conversation,
|
|
11
11
|
CreateAgentListenerRequest,
|
|
12
12
|
CreateConnectionRequest,
|
|
13
|
+
DispatchMeetingBotRequest,
|
|
13
14
|
InstallConnectionResponse,
|
|
14
15
|
ListAgentListenersQuery,
|
|
15
16
|
ListConnectionsQuery,
|
|
@@ -47,6 +48,8 @@ export class ConversationClient {
|
|
|
47
48
|
readonly messages: MessageService
|
|
48
49
|
readonly agentListeners: AgentListenerService
|
|
49
50
|
readonly transcriptions: TranscriptionService
|
|
51
|
+
/** Meeting bots (Ava): dispatch into a meeting URL, remove from a meeting. */
|
|
52
|
+
readonly meetings: MeetingService
|
|
50
53
|
/** Realtime speech-to-text (dictation) — moved here from agent-service. */
|
|
51
54
|
readonly voice: VoiceService
|
|
52
55
|
|
|
@@ -56,10 +59,35 @@ export class ConversationClient {
|
|
|
56
59
|
this.messages = new MessageServiceImpl(client)
|
|
57
60
|
this.agentListeners = new AgentListenerServiceImpl(client)
|
|
58
61
|
this.transcriptions = new TranscriptionServiceImpl(client)
|
|
62
|
+
this.meetings = new MeetingServiceImpl(client)
|
|
59
63
|
this.voice = new VoiceServiceImpl(client)
|
|
60
64
|
}
|
|
61
65
|
}
|
|
62
66
|
|
|
67
|
+
/** Meeting bots (Ava) — dispatch by meeting URL and removal. */
|
|
68
|
+
export interface MeetingService {
|
|
69
|
+
/**
|
|
70
|
+
* Send Ava to a meeting URL. Resolves with the pre-minted meeting
|
|
71
|
+
* conversation (channel = the platform classified from the URL); transcript
|
|
72
|
+
* turns then stream in as inbound messages while the meeting runs.
|
|
73
|
+
*/
|
|
74
|
+
dispatch(request: DispatchMeetingBotRequest): Promise<Conversation>
|
|
75
|
+
/** Make the bot leave the meeting and end the conversation (by conversation id). */
|
|
76
|
+
remove(conversationId: string): Promise<Conversation>
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
class MeetingServiceImpl implements MeetingService {
|
|
80
|
+
constructor(private readonly client: ProteosClient) {}
|
|
81
|
+
|
|
82
|
+
dispatch(request: DispatchMeetingBotRequest): Promise<Conversation> {
|
|
83
|
+
return this.client.request('POST', `${CONVERSATION_BASE_PATH}/meetings`, request)
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
remove(conversationId: string): Promise<Conversation> {
|
|
87
|
+
return this.client.request('DELETE', `${CONVERSATION_BASE_PATH}/meetings/${encodeURIComponent(conversationId)}`)
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
|
|
63
91
|
/** Configured integration instances (Slack workspace, Gmail grant, …). */
|
|
64
92
|
export interface ConnectionService {
|
|
65
93
|
list(query?: ListConnectionsQuery): Promise<ListResponse<Connection>>
|
|
@@ -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,6 +432,8 @@ 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
|
|
@@ -587,4 +613,21 @@ export interface MaterializeTranscriptionRequest {
|
|
|
587
613
|
|
|
588
614
|
export interface ListTranscriptionsQuery extends PaginationQuery {
|
|
589
615
|
status?: string
|
|
616
|
+
/** List a conversation's transcription artifacts. */
|
|
617
|
+
conversation_id?: string
|
|
618
|
+
/** Narrow to the provider-side transcript identity. */
|
|
619
|
+
provider_request_id?: string
|
|
620
|
+
}
|
|
621
|
+
|
|
622
|
+
/**
|
|
623
|
+
* Sends a meeting bot (Ava) into a meeting through an active meeting
|
|
624
|
+
* connection (adhoc-meeting). join_at schedules the bot ahead of time (ISO
|
|
625
|
+
* instant; a scheduled bot joins reliably on time — omit to join now); title
|
|
626
|
+
* seeds the meeting conversation's subject.
|
|
627
|
+
*/
|
|
628
|
+
export interface DispatchMeetingBotRequest {
|
|
629
|
+
connection_id: string
|
|
630
|
+
meeting_url: string
|
|
631
|
+
title?: string
|
|
632
|
+
join_at?: string
|
|
590
633
|
}
|
package/src/index.ts
CHANGED
|
@@ -183,6 +183,7 @@ export type {
|
|
|
183
183
|
ConversationStatus,
|
|
184
184
|
CreateAgentListenerRequest,
|
|
185
185
|
CreateConnectionRequest,
|
|
186
|
+
DispatchMeetingBotRequest,
|
|
186
187
|
InstallConnectionResponse,
|
|
187
188
|
ListAgentListenersQuery,
|
|
188
189
|
ListConnectionsQuery,
|
|
@@ -195,6 +196,7 @@ export type {
|
|
|
195
196
|
ListRoomsQuery,
|
|
196
197
|
Message,
|
|
197
198
|
MessageDirection,
|
|
199
|
+
MeetingService,
|
|
198
200
|
MessagePreview,
|
|
199
201
|
MessageRecipient,
|
|
200
202
|
MessageService,
|