@proteos/sdk 0.60.0 → 0.75.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/{chunk-OOOTPEJK.js → chunk-3VQQEJV6.js} +71 -11
- package/dist/chunk-3VQQEJV6.js.map +1 -0
- package/dist/{chunk-25PD6TYH.cjs → chunk-C4CH6CEY.cjs} +75 -10
- package/dist/chunk-C4CH6CEY.cjs.map +1 -0
- package/dist/index.cjs +379 -130
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +813 -81
- package/dist/index.d.ts +813 -81
- package/dist/index.js +250 -13
- package/dist/index.js.map +1 -1
- package/dist/meta/index.cjs +109 -89
- package/dist/meta/index.d.cts +1 -1
- package/dist/meta/index.d.ts +1 -1
- package/dist/meta/index.js +1 -1
- package/dist/{types-DQmqR_G8.d.cts → types-Dp-AB2QZ.d.cts} +561 -48
- package/dist/{types-DQmqR_G8.d.ts → types-Dp-AB2QZ.d.ts} +561 -48
- package/package.json +1 -1
- package/src/agent/session-types.ts +8 -1
- package/src/agent/sessions.ts +6 -4
- package/src/agent/types.ts +9 -0
- package/src/auth/platform-entities.ts +6 -0
- package/src/client.ts +28 -4
- package/src/conversation/index.ts +327 -15
- package/src/conversation/types.ts +594 -5
- package/src/data/entity-indexes.ts +54 -0
- package/src/data/index.ts +12 -0
- package/src/data/types.ts +66 -0
- package/src/errors.ts +5 -0
- package/src/index.ts +57 -0
- package/src/meta/components.ts +23 -3
- package/src/meta/index.ts +8 -0
- package/src/meta/layout/common-props.ts +9 -0
- package/src/meta/layout/elements.ts +57 -0
- package/src/meta/layout/index.ts +5 -0
- package/src/meta/layout/page-layout.ts +15 -3
- package/src/meta/types.ts +206 -21
- package/src/scheduling/types.ts +5 -1
- package/src/workflow/types.ts +10 -2
- package/dist/chunk-25PD6TYH.cjs.map +0 -1
- package/dist/chunk-OOOTPEJK.js.map +0 -1
package/package.json
CHANGED
|
@@ -149,9 +149,16 @@ export interface ResultBlock {
|
|
|
149
149
|
// Event payloads (discriminated by the sibling event `type`)
|
|
150
150
|
// ---------------------------------------------------------------------------
|
|
151
151
|
|
|
152
|
-
/**
|
|
152
|
+
/**
|
|
153
|
+
* A user message body (text + file blocks). `context` is what the launching
|
|
154
|
+
* surface hands the model alongside the message (a call's summary and linked
|
|
155
|
+
* records, say): stored with the event, sent to the model as an extra text
|
|
156
|
+
* block, never rendered as part of the person's message. Not for secrets —
|
|
157
|
+
* the session owner can read it back through the events API.
|
|
158
|
+
*/
|
|
153
159
|
export interface UserMessagePayload {
|
|
154
160
|
content: ContentBlock[]
|
|
161
|
+
context?: string
|
|
155
162
|
}
|
|
156
163
|
|
|
157
164
|
/** An agent message body (text blocks only). */
|
package/src/agent/sessions.ts
CHANGED
|
@@ -61,11 +61,12 @@ export interface SessionService {
|
|
|
61
61
|
* attachments. Each {@link FileBlock} carries the storage-service `file_id`; the
|
|
62
62
|
* backend uploads it to the model provider and mounts it into the agent's sandbox
|
|
63
63
|
* at send time. Pass `turnId` (a UUID) for optimistic rendering. At least one of
|
|
64
|
-
* `text` / `files` should be present.
|
|
64
|
+
* `text` / `files` should be present. `context` rides the payload for the model
|
|
65
|
+
* only (see {@link UserMessagePayload.context}).
|
|
65
66
|
*/
|
|
66
67
|
sendUserMessage(
|
|
67
68
|
id: string,
|
|
68
|
-
input: { text?: string; files?: FileBlock[]; turnId?: string },
|
|
69
|
+
input: { text?: string; files?: FileBlock[]; turnId?: string; context?: string },
|
|
69
70
|
): Promise<SessionEvent>
|
|
70
71
|
/** Convenience: appends a `user.interrupt` to halt the running turn. */
|
|
71
72
|
interrupt(id: string): Promise<SessionEvent>
|
|
@@ -149,7 +150,7 @@ export class SessionServiceImpl implements SessionService {
|
|
|
149
150
|
|
|
150
151
|
async sendUserMessage(
|
|
151
152
|
id: string,
|
|
152
|
-
input: { text?: string; files?: FileBlock[]; turnId?: string },
|
|
153
|
+
input: { text?: string; files?: FileBlock[]; turnId?: string; context?: string },
|
|
153
154
|
): Promise<SessionEvent> {
|
|
154
155
|
const content: ContentBlock[] = []
|
|
155
156
|
const text = input.text?.trim()
|
|
@@ -157,10 +158,11 @@ export class SessionServiceImpl implements SessionService {
|
|
|
157
158
|
for (const file of input.files ?? []) {
|
|
158
159
|
content.push({ type: 'file', ...file })
|
|
159
160
|
}
|
|
161
|
+
const context = input.context?.trim()
|
|
160
162
|
return this.appendEvent(id, {
|
|
161
163
|
type: 'user.message',
|
|
162
164
|
...(input.turnId ? { turn_id: input.turnId } : {}),
|
|
163
|
-
payload: { content },
|
|
165
|
+
payload: { content, ...(context ? { context } : {}) },
|
|
164
166
|
})
|
|
165
167
|
}
|
|
166
168
|
|
package/src/agent/types.ts
CHANGED
|
@@ -68,6 +68,13 @@ export interface Agent extends AuditFields {
|
|
|
68
68
|
toolsets: string[]
|
|
69
69
|
/** Marks the single agent surfaced by default for the org (at most one). */
|
|
70
70
|
is_org_default: boolean
|
|
71
|
+
/**
|
|
72
|
+
* Runs beside the tabbed workspace in the web app: the platform appends the
|
|
73
|
+
* workspace-mode instructions (open_tab / switch_tab / close_tab, app context) to
|
|
74
|
+
* the synced system prompt and the web client offers the tab tools instead of
|
|
75
|
+
* navigate / open_record.
|
|
76
|
+
*/
|
|
77
|
+
has_workspace: boolean
|
|
71
78
|
version: number
|
|
72
79
|
}
|
|
73
80
|
|
|
@@ -84,6 +91,7 @@ export interface CreateAgentRequest {
|
|
|
84
91
|
mcp_servers?: string[]
|
|
85
92
|
toolsets?: string[]
|
|
86
93
|
is_org_default?: boolean
|
|
94
|
+
has_workspace?: boolean
|
|
87
95
|
}
|
|
88
96
|
|
|
89
97
|
export interface UpdateAgentRequest {
|
|
@@ -98,6 +106,7 @@ export interface UpdateAgentRequest {
|
|
|
98
106
|
mcp_servers?: string[]
|
|
99
107
|
toolsets?: string[]
|
|
100
108
|
is_org_default?: boolean
|
|
109
|
+
has_workspace?: boolean
|
|
101
110
|
}
|
|
102
111
|
|
|
103
112
|
export type ListAgentsOptions = AgentResourceListOptions
|
|
@@ -107,12 +107,18 @@ export const PLATFORM_ENTITIES: readonly PlatformEntity[] = [
|
|
|
107
107
|
{ slug: 'channel-events', name: 'Channel Events' },
|
|
108
108
|
// Conversation briefs: guidance prepared ahead of a conversation (call, meeting) with a contact.
|
|
109
109
|
{ slug: 'conversation-briefs', name: 'Conversation Briefs' },
|
|
110
|
+
// Conversation notes: what a person recorded about a conversation (append log, author-stamped).
|
|
111
|
+
{ slug: 'conversation-notes', name: 'Conversation Notes' },
|
|
110
112
|
// Conversation intelligence: the typed questions asked of conversations
|
|
111
113
|
// (definitions), where/when they are evaluated (sets), and the observations
|
|
112
114
|
// they produce incl. their evaluation history (tags).
|
|
113
115
|
{ slug: 'conversation-tag-definitions', name: 'Conversation Tag Definitions' },
|
|
114
116
|
{ slug: 'conversation-tag-sets', name: 'Conversation Tag Sets' },
|
|
115
117
|
{ slug: 'conversation-tags', name: 'Conversation Tags' },
|
|
118
|
+
// Conversation objectives: what a conversation should achieve (definitions)
|
|
119
|
+
// and each definition's standing per conversation (objectives, read-only ledger).
|
|
120
|
+
{ slug: 'conversation-objective-definitions', name: 'Conversation Objective Definitions' },
|
|
121
|
+
{ slug: 'conversation-objectives', name: 'Conversation Objectives' },
|
|
116
122
|
// Connectors (connector-service). `connections` above is shared; this is the
|
|
117
123
|
// manifest catalog.
|
|
118
124
|
{ slug: 'connectors', name: 'Connectors' },
|
package/src/client.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { type EventSourceMessage, fetchEventSource } from '@microsoft/fetch-event-source'
|
|
2
|
-
import { ProteosError, parseErrorResponse } from './errors.js'
|
|
2
|
+
import { ErrorCode, ProteosError, parseErrorResponse } from './errors.js'
|
|
3
3
|
import { toQueryParams } from './http/query-params.js'
|
|
4
4
|
import {
|
|
5
5
|
type ClientOptions,
|
|
@@ -132,6 +132,30 @@ export class ProteosClient {
|
|
|
132
132
|
return AbortSignal.timeout(timeout)
|
|
133
133
|
}
|
|
134
134
|
|
|
135
|
+
/**
|
|
136
|
+
* Runs fetch and turns a transport failure — DNS, connection refused, the
|
|
137
|
+
* network being down, the timeout signal firing — into a ProteosError with
|
|
138
|
+
* httpStatus 0, so callers can tell "the server said no" from "the server
|
|
139
|
+
* was never reached" (the latter is worth retrying). An abort the caller
|
|
140
|
+
* asked for is theirs and passes through untouched.
|
|
141
|
+
*/
|
|
142
|
+
private async send(url: string, init: RequestInit): Promise<Response> {
|
|
143
|
+
try {
|
|
144
|
+
return await this.options.fetch(url, init)
|
|
145
|
+
} catch (error) {
|
|
146
|
+
if (error instanceof Error && error.name === 'AbortError') throw error
|
|
147
|
+
const message = error instanceof Error ? error.message : 'Network request failed'
|
|
148
|
+
const isTimeout =
|
|
149
|
+
error instanceof Error &&
|
|
150
|
+
(error.name === 'TimeoutError' || error.message.startsWith('Request timeout'))
|
|
151
|
+
throw new ProteosError(
|
|
152
|
+
message,
|
|
153
|
+
0,
|
|
154
|
+
isTimeout ? ErrorCode.REQUEST_TIMEOUT : ErrorCode.NETWORK_ERROR,
|
|
155
|
+
)
|
|
156
|
+
}
|
|
157
|
+
}
|
|
158
|
+
|
|
135
159
|
/**
|
|
136
160
|
* Performs an HTTP request and decodes the JSON response.
|
|
137
161
|
*
|
|
@@ -182,7 +206,7 @@ export class ProteosClient {
|
|
|
182
206
|
const headers = await this.buildHeaders(requestOptions)
|
|
183
207
|
const signal = this.createTimeoutSignal(requestOptions)
|
|
184
208
|
|
|
185
|
-
const response = await this.
|
|
209
|
+
const response = await this.send(url, {
|
|
186
210
|
method,
|
|
187
211
|
headers,
|
|
188
212
|
body: body !== undefined ? JSON.stringify(body) : null,
|
|
@@ -247,7 +271,7 @@ export class ProteosClient {
|
|
|
247
271
|
|
|
248
272
|
const signal = this.createTimeoutSignal(requestOptions)
|
|
249
273
|
|
|
250
|
-
const response = await this.
|
|
274
|
+
const response = await this.send(url, {
|
|
251
275
|
method,
|
|
252
276
|
headers,
|
|
253
277
|
body: formData,
|
|
@@ -287,7 +311,7 @@ export class ProteosClient {
|
|
|
287
311
|
const headers = await this.buildHeaders(requestOptions)
|
|
288
312
|
const signal = this.createTimeoutSignal(requestOptions)
|
|
289
313
|
|
|
290
|
-
const response = await this.
|
|
314
|
+
const response = await this.send(url, {
|
|
291
315
|
method,
|
|
292
316
|
headers,
|
|
293
317
|
body: body !== undefined ? JSON.stringify(body) : null,
|
|
@@ -21,11 +21,18 @@ import type {
|
|
|
21
21
|
ConversationBrief,
|
|
22
22
|
ConversationFilter,
|
|
23
23
|
ConversationFilterEvent,
|
|
24
|
+
ConversationNote,
|
|
25
|
+
ConversationObjective,
|
|
26
|
+
ConversationObjectiveDefinition,
|
|
27
|
+
ConversationObjectiveProgress,
|
|
28
|
+
ConversationOutcomeOption,
|
|
24
29
|
ConversationTag,
|
|
25
30
|
ConversationTagDefinition,
|
|
26
31
|
ConversationTagEvaluation,
|
|
27
32
|
ConversationTagSet,
|
|
28
33
|
ConversationType,
|
|
34
|
+
CountConversationObjectivesQuery,
|
|
35
|
+
CountConversationObjectivesResponse,
|
|
29
36
|
CountConversationTagsQuery,
|
|
30
37
|
CountConversationTagsResponse,
|
|
31
38
|
CreateAgentListenerRequest,
|
|
@@ -35,6 +42,8 @@ import type {
|
|
|
35
42
|
CreateContactRequest,
|
|
36
43
|
CreateConversationBriefRequest,
|
|
37
44
|
CreateConversationFilterRequest,
|
|
45
|
+
CreateConversationNoteRequest,
|
|
46
|
+
CreateConversationObjectiveDefinitionRequest,
|
|
38
47
|
CreateConversationTagDefinitionRequest,
|
|
39
48
|
CreateConversationTagRequest,
|
|
40
49
|
CreateConversationTagSetRequest,
|
|
@@ -53,6 +62,8 @@ import type {
|
|
|
53
62
|
EmailSuppressionKind,
|
|
54
63
|
EvaluateConversationTagsRequest,
|
|
55
64
|
GetConnectionHealthQuery,
|
|
65
|
+
GetManyConversationObjectiveDefinitionsQuery,
|
|
66
|
+
GetManyConversationObjectivesQuery,
|
|
56
67
|
GlossaryTerm,
|
|
57
68
|
InstallConnectionRequest,
|
|
58
69
|
InstallConnectionResponse,
|
|
@@ -66,8 +77,10 @@ import type {
|
|
|
66
77
|
ListContactRecordLinksQuery,
|
|
67
78
|
ListContactsQuery,
|
|
68
79
|
ListConversationBriefsQuery,
|
|
80
|
+
ListMeetingBotsQuery,
|
|
69
81
|
ListConversationFilterEventsQuery,
|
|
70
82
|
ListConversationFiltersQuery,
|
|
83
|
+
ListConversationNotesQuery,
|
|
71
84
|
ListConversationsQuery,
|
|
72
85
|
ListConversationTagDefinitionsQuery,
|
|
73
86
|
ListConversationTagEvaluationsQuery,
|
|
@@ -88,6 +101,7 @@ import type {
|
|
|
88
101
|
MaterializeTranscriptionRequest,
|
|
89
102
|
MergeContactsRequest,
|
|
90
103
|
Message,
|
|
104
|
+
MeetingBot,
|
|
91
105
|
MintCallTokenRequest,
|
|
92
106
|
MistranscribedTerm,
|
|
93
107
|
PerformChannelActionRequest,
|
|
@@ -102,6 +116,7 @@ import type {
|
|
|
102
116
|
SendingLimitPreset,
|
|
103
117
|
SendingRule,
|
|
104
118
|
SendMessageRequest,
|
|
119
|
+
SetCallRecordingRequest,
|
|
105
120
|
SetDefaultSenderRequest,
|
|
106
121
|
SyncConnectionRequest,
|
|
107
122
|
ToneProfile,
|
|
@@ -114,6 +129,8 @@ import type {
|
|
|
114
129
|
UpdateContactRequest,
|
|
115
130
|
UpdateConversationBriefRequest,
|
|
116
131
|
UpdateConversationFilterRequest,
|
|
132
|
+
UpdateConversationNoteRequest,
|
|
133
|
+
UpdateConversationObjectiveDefinitionRequest,
|
|
117
134
|
UpdateConversationRequest,
|
|
118
135
|
UpdateConversationTagDefinitionRequest,
|
|
119
136
|
UpdateConversationTagRequest,
|
|
@@ -167,6 +184,10 @@ export class ConversationClient {
|
|
|
167
184
|
readonly conversationTagSets: ConversationTagSetService
|
|
168
185
|
/** Conversation intelligence: the observations produced + their evaluation history. */
|
|
169
186
|
readonly conversationTags: ConversationTagService
|
|
187
|
+
/** Conversation objectives: WHAT a conversation should achieve (config, keyed, module-deployable). */
|
|
188
|
+
readonly conversationObjectiveDefinitions: ConversationObjectiveDefinitionService
|
|
189
|
+
/** Conversation objectives: the org-wide ledger of standings + grouped counts (read-only). */
|
|
190
|
+
readonly conversationObjectives: ConversationObjectiveService
|
|
170
191
|
/** Generic audience taxonomy; membership lives on the contact. */
|
|
171
192
|
readonly contactGroups: ContactGroupService
|
|
172
193
|
/** Tone-of-voice synthesis: per-user setups + the generated profiles. */
|
|
@@ -174,13 +195,17 @@ export class ConversationClient {
|
|
|
174
195
|
readonly transcriptions: TranscriptionService
|
|
175
196
|
/** Review-pass findings: likely misheard terms awaiting accept/reject. */
|
|
176
197
|
readonly mistranscribedTerms: MistranscribedTermService
|
|
177
|
-
/** Meeting bots (Ava): dispatch into a meeting URL,
|
|
198
|
+
/** Meeting bots (Ava): dispatch into a meeting URL, summaries. */
|
|
178
199
|
readonly meetings: MeetingService
|
|
200
|
+
/** Ava's bots as remembered by the platform: list them, withdraw her from a meeting. */
|
|
201
|
+
readonly meetingBots: MeetingBotService
|
|
179
202
|
/** Realtime speech-to-text (dictation) — moved here from agent-service. */
|
|
180
203
|
readonly voice: VoiceService
|
|
181
204
|
readonly calls: CallService
|
|
182
205
|
/** Conversation briefs: guidance prepared ahead of a conversation (call, meeting) with a contact. */
|
|
183
206
|
readonly conversationBriefs: ConversationBriefService
|
|
207
|
+
/** Conversation notes: what a person recorded about a conversation (append log, author-stamped). */
|
|
208
|
+
readonly conversationNotes: ConversationNoteService
|
|
184
209
|
|
|
185
210
|
constructor(client: ProteosClient) {
|
|
186
211
|
this.connections = new ConnectionServiceImpl(client)
|
|
@@ -197,18 +222,77 @@ export class ConversationClient {
|
|
|
197
222
|
this.conversationTagDefinitions = new ConversationTagDefinitionServiceImpl(client)
|
|
198
223
|
this.conversationTagSets = new ConversationTagSetServiceImpl(client)
|
|
199
224
|
this.conversationTags = new ConversationTagServiceImpl(client)
|
|
225
|
+
this.conversationObjectiveDefinitions = new ConversationObjectiveDefinitionServiceImpl(client)
|
|
226
|
+
this.conversationObjectives = new ConversationObjectiveServiceImpl(client)
|
|
200
227
|
this.contactGroups = new ContactGroupServiceImpl(client)
|
|
201
228
|
this.toneProfiles = new ToneProfileServiceImpl(client)
|
|
202
229
|
this.transcriptions = new TranscriptionServiceImpl(client)
|
|
203
230
|
this.mistranscribedTerms = new MistranscribedTermServiceImpl(client)
|
|
204
231
|
this.meetings = new MeetingServiceImpl(client)
|
|
232
|
+
this.meetingBots = new MeetingBotServiceImpl(client)
|
|
205
233
|
this.voice = new VoiceServiceImpl(client)
|
|
206
234
|
this.calls = new CallServiceImpl(client)
|
|
207
235
|
this.conversationBriefs = new ConversationBriefServiceImpl(client)
|
|
236
|
+
this.conversationNotes = new ConversationNoteServiceImpl(client)
|
|
208
237
|
}
|
|
209
238
|
}
|
|
210
239
|
|
|
211
|
-
/**
|
|
240
|
+
/** Conversation notes — what a person recorded about a conversation. */
|
|
241
|
+
export interface ConversationNoteService {
|
|
242
|
+
/** A conversation's notes, oldest first by default. */
|
|
243
|
+
list(
|
|
244
|
+
conversationId: string,
|
|
245
|
+
query?: ListConversationNotesQuery,
|
|
246
|
+
): Promise<ListResponse<ConversationNote>>
|
|
247
|
+
create(conversationId: string, request: CreateConversationNoteRequest): Promise<ConversationNote>
|
|
248
|
+
/** Author only (403 `conversation_note_not_author`). */
|
|
249
|
+
update(id: string, request: UpdateConversationNoteRequest): Promise<ConversationNote>
|
|
250
|
+
/** Author only (403 `conversation_note_not_author`). */
|
|
251
|
+
delete(id: string): Promise<void>
|
|
252
|
+
}
|
|
253
|
+
|
|
254
|
+
class ConversationNoteServiceImpl implements ConversationNoteService {
|
|
255
|
+
constructor(private readonly client: ProteosClient) {}
|
|
256
|
+
|
|
257
|
+
list(
|
|
258
|
+
conversationId: string,
|
|
259
|
+
query: ListConversationNotesQuery = {},
|
|
260
|
+
): Promise<ListResponse<ConversationNote>> {
|
|
261
|
+
return this.client.requestWithQuery(
|
|
262
|
+
'GET',
|
|
263
|
+
`${CONVERSATION_BASE_PATH}/conversations/${encodeURIComponent(conversationId)}/notes`,
|
|
264
|
+
query,
|
|
265
|
+
)
|
|
266
|
+
}
|
|
267
|
+
|
|
268
|
+
create(
|
|
269
|
+
conversationId: string,
|
|
270
|
+
request: CreateConversationNoteRequest,
|
|
271
|
+
): Promise<ConversationNote> {
|
|
272
|
+
return this.client.request(
|
|
273
|
+
'POST',
|
|
274
|
+
`${CONVERSATION_BASE_PATH}/conversations/${encodeURIComponent(conversationId)}/notes`,
|
|
275
|
+
request,
|
|
276
|
+
)
|
|
277
|
+
}
|
|
278
|
+
|
|
279
|
+
update(id: string, request: UpdateConversationNoteRequest): Promise<ConversationNote> {
|
|
280
|
+
return this.client.request(
|
|
281
|
+
'PATCH',
|
|
282
|
+
`${CONVERSATION_BASE_PATH}/conversation-notes/${encodeURIComponent(id)}`,
|
|
283
|
+
request,
|
|
284
|
+
)
|
|
285
|
+
}
|
|
286
|
+
|
|
287
|
+
delete(id: string): Promise<void> {
|
|
288
|
+
return this.client.request(
|
|
289
|
+
'DELETE',
|
|
290
|
+
`${CONVERSATION_BASE_PATH}/conversation-notes/${encodeURIComponent(id)}`,
|
|
291
|
+
)
|
|
292
|
+
}
|
|
293
|
+
}
|
|
294
|
+
|
|
295
|
+
/** Meeting bots (Ava) — dispatch by meeting URL, summaries. */
|
|
212
296
|
export interface MeetingService {
|
|
213
297
|
/**
|
|
214
298
|
* Send Ava to a meeting URL. Resolves with the pre-minted meeting
|
|
@@ -216,8 +300,6 @@ export interface MeetingService {
|
|
|
216
300
|
* turns then stream in as inbound messages while the meeting runs.
|
|
217
301
|
*/
|
|
218
302
|
dispatch(request: DispatchMeetingBotRequest): Promise<Conversation>
|
|
219
|
-
/** Make the bot leave the meeting and end the conversation (by conversation id). */
|
|
220
|
-
remove(conversationId: string): Promise<Conversation>
|
|
221
303
|
/**
|
|
222
304
|
* START regenerating this meeting conversation's markdown summary from its
|
|
223
305
|
* stored transcript, overwriting any existing one when it lands. Generation
|
|
@@ -241,17 +323,42 @@ class MeetingServiceImpl implements MeetingService {
|
|
|
241
323
|
return this.client.request('POST', `${CONVERSATION_BASE_PATH}/meetings`, request)
|
|
242
324
|
}
|
|
243
325
|
|
|
244
|
-
|
|
326
|
+
summarize(conversationId: string): Promise<Conversation> {
|
|
245
327
|
return this.client.request(
|
|
246
|
-
'
|
|
247
|
-
`${CONVERSATION_BASE_PATH}/meetings/${encodeURIComponent(conversationId)}`,
|
|
328
|
+
'POST',
|
|
329
|
+
`${CONVERSATION_BASE_PATH}/meetings/${encodeURIComponent(conversationId)}/summarize`,
|
|
248
330
|
)
|
|
249
331
|
}
|
|
332
|
+
}
|
|
250
333
|
|
|
251
|
-
|
|
334
|
+
/**
|
|
335
|
+
* Ava's bots as the platform remembers them: what a client shows as "Ava joins"
|
|
336
|
+
* for a meeting, and the door to withdraw her.
|
|
337
|
+
*/
|
|
338
|
+
export interface MeetingBotService {
|
|
339
|
+
/** The bots the caller may see, soonest meeting first. */
|
|
340
|
+
list(query?: ListMeetingBotsQuery): Promise<ListResponse<MeetingBot>>
|
|
341
|
+
/**
|
|
342
|
+
* Withdraw Ava from the meeting this bot belongs to: every bot of that
|
|
343
|
+
* meeting instance the caller may act on (scheduled from their connection,
|
|
344
|
+
* or on a meeting they are invited to) is cancelled (scheduled) or leaves
|
|
345
|
+
* the call (live), the rows become `removed`, and the calendar will not
|
|
346
|
+
* schedule her again. Re-add her explicitly with `meetings.dispatch`.
|
|
347
|
+
*/
|
|
348
|
+
remove(id: string): Promise<MeetingBot>
|
|
349
|
+
}
|
|
350
|
+
|
|
351
|
+
class MeetingBotServiceImpl implements MeetingBotService {
|
|
352
|
+
constructor(private readonly client: ProteosClient) {}
|
|
353
|
+
|
|
354
|
+
list(query: ListMeetingBotsQuery = {}): Promise<ListResponse<MeetingBot>> {
|
|
355
|
+
return this.client.requestWithQuery('GET', `${CONVERSATION_BASE_PATH}/meeting-bots`, query)
|
|
356
|
+
}
|
|
357
|
+
|
|
358
|
+
remove(id: string): Promise<MeetingBot> {
|
|
252
359
|
return this.client.request(
|
|
253
|
-
'
|
|
254
|
-
`${CONVERSATION_BASE_PATH}/
|
|
360
|
+
'DELETE',
|
|
361
|
+
`${CONVERSATION_BASE_PATH}/meeting-bots/${encodeURIComponent(id)}`,
|
|
255
362
|
)
|
|
256
363
|
}
|
|
257
364
|
}
|
|
@@ -654,6 +761,18 @@ export interface ConversationService {
|
|
|
654
761
|
get(id: string): Promise<Conversation>
|
|
655
762
|
/** Patch the user-editable surface (subject, summary, status, metadata). */
|
|
656
763
|
update(id: string, request: UpdateConversationRequest): Promise<Conversation>
|
|
764
|
+
/**
|
|
765
|
+
* What the conversation may end with: its type's outcomes, then its
|
|
766
|
+
* channel's system outcomes — the picker's list and the valid
|
|
767
|
+
* `outcome_key` values for `update`.
|
|
768
|
+
*/
|
|
769
|
+
listOutcomes(id: string): Promise<{ data: ConversationOutcomeOption[] }>
|
|
770
|
+
/**
|
|
771
|
+
* Where the conversation stands against its objectives: the current phase,
|
|
772
|
+
* every phase's status, every applicable objective's standing and the
|
|
773
|
+
* definitions they reference — the checklist from one read.
|
|
774
|
+
*/
|
|
775
|
+
getObjectiveProgress(id: string): Promise<ConversationObjectiveProgress>
|
|
657
776
|
end(id: string): Promise<Conversation>
|
|
658
777
|
/**
|
|
659
778
|
* Hard-delete the conversation, its thread children, and every dependent
|
|
@@ -682,6 +801,21 @@ class ConversationServiceImpl implements ConversationService {
|
|
|
682
801
|
)
|
|
683
802
|
}
|
|
684
803
|
|
|
804
|
+
listOutcomes(id: string): Promise<{ data: ConversationOutcomeOption[] }> {
|
|
805
|
+
return this.client.request(
|
|
806
|
+
'GET',
|
|
807
|
+
`${CONVERSATION_BASE_PATH}/conversations/${encodeURIComponent(id)}/outcomes`,
|
|
808
|
+
)
|
|
809
|
+
}
|
|
810
|
+
|
|
811
|
+
async getObjectiveProgress(id: string): Promise<ConversationObjectiveProgress> {
|
|
812
|
+
const response = await this.client.request<{ data: ConversationObjectiveProgress }>(
|
|
813
|
+
'GET',
|
|
814
|
+
`${CONVERSATION_BASE_PATH}/conversations/${encodeURIComponent(id)}/objective-progress`,
|
|
815
|
+
)
|
|
816
|
+
return response.data
|
|
817
|
+
}
|
|
818
|
+
|
|
685
819
|
update(id: string, request: UpdateConversationRequest): Promise<Conversation> {
|
|
686
820
|
return this.client.request(
|
|
687
821
|
'PATCH',
|
|
@@ -1259,6 +1393,14 @@ export interface ConversationTagService {
|
|
|
1259
1393
|
list(query?: ListConversationTagsQuery): Promise<ListResponse<ConversationTag>>
|
|
1260
1394
|
/** Grouped counts for dashboards — `group_by` is a comma-joined string. */
|
|
1261
1395
|
counts(query?: CountConversationTagsQuery): Promise<CountConversationTagsResponse>
|
|
1396
|
+
/**
|
|
1397
|
+
* The enabled definitions the enabled sets select for the conversation right
|
|
1398
|
+
* now (`evaluate_on` ignored, like a manual evaluation) — what a person may
|
|
1399
|
+
* tag it with, incl. its outcome definition(s) (`role === 'outcome'`).
|
|
1400
|
+
*/
|
|
1401
|
+
listApplicableDefinitions(
|
|
1402
|
+
conversationId: string,
|
|
1403
|
+
): Promise<ListResponse<ConversationTagDefinition>>
|
|
1262
1404
|
}
|
|
1263
1405
|
|
|
1264
1406
|
class ConversationTagServiceImpl implements ConversationTagService {
|
|
@@ -1283,6 +1425,15 @@ class ConversationTagServiceImpl implements ConversationTagService {
|
|
|
1283
1425
|
)
|
|
1284
1426
|
}
|
|
1285
1427
|
|
|
1428
|
+
listApplicableDefinitions(
|
|
1429
|
+
conversationId: string,
|
|
1430
|
+
): Promise<ListResponse<ConversationTagDefinition>> {
|
|
1431
|
+
return this.client.request(
|
|
1432
|
+
'GET',
|
|
1433
|
+
`${CONVERSATION_BASE_PATH}/conversations/${encodeURIComponent(conversationId)}/tag-definitions`,
|
|
1434
|
+
)
|
|
1435
|
+
}
|
|
1436
|
+
|
|
1286
1437
|
evaluate(
|
|
1287
1438
|
conversationId: string,
|
|
1288
1439
|
request: EvaluateConversationTagsRequest = {},
|
|
@@ -1333,6 +1484,143 @@ class ConversationTagServiceImpl implements ConversationTagService {
|
|
|
1333
1484
|
}
|
|
1334
1485
|
}
|
|
1335
1486
|
|
|
1487
|
+
/**
|
|
1488
|
+
* Conversation objective definitions: WHAT a conversation should achieve —
|
|
1489
|
+
* "confirm the budget", "book the demo" — org-wide or per conversation type,
|
|
1490
|
+
* optionally pinned to one of the type's phases, optionally MEASURED (a tag
|
|
1491
|
+
* value condition or an outcome set) so the platform can tell when it was
|
|
1492
|
+
* achieved. Keyed by `key` (not id); `upsert` is the idempotent module-deploy
|
|
1493
|
+
* door.
|
|
1494
|
+
*/
|
|
1495
|
+
export interface ConversationObjectiveDefinitionService {
|
|
1496
|
+
list(
|
|
1497
|
+
query?: GetManyConversationObjectiveDefinitionsQuery,
|
|
1498
|
+
): Promise<ListResponse<ConversationObjectiveDefinition>>
|
|
1499
|
+
/** One page, explicitly (`query.page`) — the door a page walker calls; same wire call as `list`. */
|
|
1500
|
+
listPage(
|
|
1501
|
+
query?: GetManyConversationObjectiveDefinitionsQuery,
|
|
1502
|
+
): Promise<ListResponse<ConversationObjectiveDefinition>>
|
|
1503
|
+
get(key: string): Promise<ConversationObjectiveDefinition>
|
|
1504
|
+
create(
|
|
1505
|
+
request: CreateConversationObjectiveDefinitionRequest,
|
|
1506
|
+
): Promise<ConversationObjectiveDefinition>
|
|
1507
|
+
/** Partial update; `measure: null` clears the measure (guidance only). */
|
|
1508
|
+
update(
|
|
1509
|
+
key: string,
|
|
1510
|
+
request: UpdateConversationObjectiveDefinitionRequest,
|
|
1511
|
+
): Promise<ConversationObjectiveDefinition>
|
|
1512
|
+
/** Idempotent create-or-update by key (PUT) — what `pro module deploy` calls. */
|
|
1513
|
+
upsert(
|
|
1514
|
+
key: string,
|
|
1515
|
+
request: CreateConversationObjectiveDefinitionRequest,
|
|
1516
|
+
): Promise<ConversationObjectiveDefinition>
|
|
1517
|
+
delete(key: string): Promise<void>
|
|
1518
|
+
}
|
|
1519
|
+
|
|
1520
|
+
class ConversationObjectiveDefinitionServiceImpl implements ConversationObjectiveDefinitionService {
|
|
1521
|
+
constructor(private readonly client: ProteosClient) {}
|
|
1522
|
+
|
|
1523
|
+
list(
|
|
1524
|
+
query: GetManyConversationObjectiveDefinitionsQuery = {},
|
|
1525
|
+
): Promise<ListResponse<ConversationObjectiveDefinition>> {
|
|
1526
|
+
return this.listPage(query)
|
|
1527
|
+
}
|
|
1528
|
+
|
|
1529
|
+
listPage(
|
|
1530
|
+
query: GetManyConversationObjectiveDefinitionsQuery = {},
|
|
1531
|
+
): Promise<ListResponse<ConversationObjectiveDefinition>> {
|
|
1532
|
+
return this.client.requestWithQuery(
|
|
1533
|
+
'GET',
|
|
1534
|
+
`${CONVERSATION_BASE_PATH}/conversation-objective-definitions`,
|
|
1535
|
+
query,
|
|
1536
|
+
)
|
|
1537
|
+
}
|
|
1538
|
+
|
|
1539
|
+
get(key: string): Promise<ConversationObjectiveDefinition> {
|
|
1540
|
+
return this.client.request(
|
|
1541
|
+
'GET',
|
|
1542
|
+
`${CONVERSATION_BASE_PATH}/conversation-objective-definitions/${encodeURIComponent(key)}`,
|
|
1543
|
+
)
|
|
1544
|
+
}
|
|
1545
|
+
|
|
1546
|
+
create(
|
|
1547
|
+
request: CreateConversationObjectiveDefinitionRequest,
|
|
1548
|
+
): Promise<ConversationObjectiveDefinition> {
|
|
1549
|
+
return this.client.request(
|
|
1550
|
+
'POST',
|
|
1551
|
+
`${CONVERSATION_BASE_PATH}/conversation-objective-definitions`,
|
|
1552
|
+
request,
|
|
1553
|
+
)
|
|
1554
|
+
}
|
|
1555
|
+
|
|
1556
|
+
update(
|
|
1557
|
+
key: string,
|
|
1558
|
+
request: UpdateConversationObjectiveDefinitionRequest,
|
|
1559
|
+
): Promise<ConversationObjectiveDefinition> {
|
|
1560
|
+
return this.client.request(
|
|
1561
|
+
'PATCH',
|
|
1562
|
+
`${CONVERSATION_BASE_PATH}/conversation-objective-definitions/${encodeURIComponent(key)}`,
|
|
1563
|
+
request,
|
|
1564
|
+
)
|
|
1565
|
+
}
|
|
1566
|
+
|
|
1567
|
+
upsert(
|
|
1568
|
+
key: string,
|
|
1569
|
+
request: CreateConversationObjectiveDefinitionRequest,
|
|
1570
|
+
): Promise<ConversationObjectiveDefinition> {
|
|
1571
|
+
return this.client.request(
|
|
1572
|
+
'PUT',
|
|
1573
|
+
`${CONVERSATION_BASE_PATH}/conversation-objective-definitions/${encodeURIComponent(key)}`,
|
|
1574
|
+
{ ...request, key },
|
|
1575
|
+
)
|
|
1576
|
+
}
|
|
1577
|
+
|
|
1578
|
+
async delete(key: string): Promise<void> {
|
|
1579
|
+
await this.client.request(
|
|
1580
|
+
'DELETE',
|
|
1581
|
+
`${CONVERSATION_BASE_PATH}/conversation-objective-definitions/${encodeURIComponent(key)}`,
|
|
1582
|
+
)
|
|
1583
|
+
}
|
|
1584
|
+
}
|
|
1585
|
+
|
|
1586
|
+
/**
|
|
1587
|
+
* Conversation objectives: the org-wide ledger of every applicable
|
|
1588
|
+
* definition's standing on every conversation (open rows included), plus
|
|
1589
|
+
* grouped counts for dashboards. Read-only — a standing is resolved by the
|
|
1590
|
+
* service from the conversation's tags and outcome; the per-conversation
|
|
1591
|
+
* checklist is `conversations.getObjectiveProgress`.
|
|
1592
|
+
*/
|
|
1593
|
+
export interface ConversationObjectiveService {
|
|
1594
|
+
/** The ledger (filter by conversation, definition, type, phase, channel, status, source, time window on `recorded_at`). */
|
|
1595
|
+
list(query?: GetManyConversationObjectivesQuery): Promise<ListResponse<ConversationObjective>>
|
|
1596
|
+
/** Grouped counts for dashboards — `group_by` is a comma-joined string. */
|
|
1597
|
+
counts(query?: CountConversationObjectivesQuery): Promise<CountConversationObjectivesResponse>
|
|
1598
|
+
}
|
|
1599
|
+
|
|
1600
|
+
class ConversationObjectiveServiceImpl implements ConversationObjectiveService {
|
|
1601
|
+
constructor(private readonly client: ProteosClient) {}
|
|
1602
|
+
|
|
1603
|
+
list(
|
|
1604
|
+
query: GetManyConversationObjectivesQuery = {},
|
|
1605
|
+
): Promise<ListResponse<ConversationObjective>> {
|
|
1606
|
+
return this.client.requestWithQuery(
|
|
1607
|
+
'GET',
|
|
1608
|
+
`${CONVERSATION_BASE_PATH}/conversation-objectives`,
|
|
1609
|
+
query,
|
|
1610
|
+
)
|
|
1611
|
+
}
|
|
1612
|
+
|
|
1613
|
+
counts(
|
|
1614
|
+
query: CountConversationObjectivesQuery = {},
|
|
1615
|
+
): Promise<CountConversationObjectivesResponse> {
|
|
1616
|
+
return this.client.requestWithQuery(
|
|
1617
|
+
'GET',
|
|
1618
|
+
`${CONVERSATION_BASE_PATH}/conversation-objectives/counts`,
|
|
1619
|
+
query,
|
|
1620
|
+
)
|
|
1621
|
+
}
|
|
1622
|
+
}
|
|
1623
|
+
|
|
1336
1624
|
/**
|
|
1337
1625
|
* Contact groups: the generic org-shared audience taxonomy. Membership lives
|
|
1338
1626
|
* on the contact (`Contact.group_key`, one group per contact — assign via
|
|
@@ -1624,6 +1912,14 @@ class MistranscribedTermServiceImpl implements MistranscribedTermService {
|
|
|
1624
1912
|
*/
|
|
1625
1913
|
export interface CallService {
|
|
1626
1914
|
mintToken(request: MintCallTokenRequest): Promise<CallTokenResponse>
|
|
1915
|
+
/**
|
|
1916
|
+
* The conversation a provider call became — the softphone's outbound
|
|
1917
|
+
* browser-leg CallSid. 404 `call_not_found` until the call-start callback
|
|
1918
|
+
* minted it (poll briefly).
|
|
1919
|
+
*/
|
|
1920
|
+
getCallConversation(connectionId: string, externalCallId: string): Promise<Conversation>
|
|
1921
|
+
/** Start / resume (true) or pause (false) the recording of a live phone conversation. */
|
|
1922
|
+
setRecording(conversationId: string, request: SetCallRecordingRequest): Promise<Conversation>
|
|
1627
1923
|
/** A phone connection's provider numbers with status + routing. */
|
|
1628
1924
|
listPhoneNumbers(connectionId: string): Promise<{ data: PhoneNumber[] }>
|
|
1629
1925
|
/** Replace one number's routing (who it rings). Returns the refreshed list. */
|
|
@@ -1651,6 +1947,21 @@ class CallServiceImpl implements CallService {
|
|
|
1651
1947
|
return this.client.request('POST', `${CONVERSATION_BASE_PATH}/calls/token`, request)
|
|
1652
1948
|
}
|
|
1653
1949
|
|
|
1950
|
+
getCallConversation(connectionId: string, externalCallId: string): Promise<Conversation> {
|
|
1951
|
+
return this.client.request(
|
|
1952
|
+
'GET',
|
|
1953
|
+
`${CONVERSATION_BASE_PATH}/connections/${encodeURIComponent(connectionId)}/calls/${encodeURIComponent(externalCallId)}`,
|
|
1954
|
+
)
|
|
1955
|
+
}
|
|
1956
|
+
|
|
1957
|
+
setRecording(conversationId: string, request: SetCallRecordingRequest): Promise<Conversation> {
|
|
1958
|
+
return this.client.request(
|
|
1959
|
+
'PUT',
|
|
1960
|
+
`${CONVERSATION_BASE_PATH}/conversations/${encodeURIComponent(conversationId)}/recording`,
|
|
1961
|
+
request,
|
|
1962
|
+
)
|
|
1963
|
+
}
|
|
1964
|
+
|
|
1654
1965
|
listPhoneNumbers(connectionId: string): Promise<{ data: PhoneNumber[] }> {
|
|
1655
1966
|
return this.client.request(
|
|
1656
1967
|
'GET',
|
|
@@ -1703,11 +2014,12 @@ export type {
|
|
|
1703
2014
|
/**
|
|
1704
2015
|
* Conversation briefs — guidance prepared ahead of a conversation ("talk to
|
|
1705
2016
|
* these people about this"; the conversation sibling of message drafts).
|
|
1706
|
-
* Binding is explicit: the softphone carries the brief id into the call,
|
|
1707
|
-
*
|
|
1708
|
-
*
|
|
1709
|
-
*
|
|
1710
|
-
*
|
|
2017
|
+
* Binding is explicit: the softphone carries the brief id into the call, a
|
|
2018
|
+
* brief naming a calendar event attaches to that meeting's conversation when
|
|
2019
|
+
* the meeting bot starts, or `attach` names the conversation. Any number of
|
|
2020
|
+
* briefs may be open for the same people or meeting, and a conversation may
|
|
2021
|
+
* carry several. Edits/attach on a non-open brief fail 409
|
|
2022
|
+
* `conversation_brief_not_editable`.
|
|
1711
2023
|
*/
|
|
1712
2024
|
export interface ConversationBriefService {
|
|
1713
2025
|
list(query?: ListConversationBriefsQuery): Promise<ListResponse<ConversationBrief>>
|