@opencx/mcp 1.15.13 → 1.15.14

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.
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=phone-tools.spec.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"phone-tools.spec.d.ts","sourceRoot":"","sources":["../src/phone-tools.spec.ts"],"names":[],"mappings":""}
@@ -0,0 +1,156 @@
1
+ import { describe, it, expect, vi, beforeEach, afterEach } from 'vitest';
2
+ import { Client } from '@modelcontextprotocol/sdk/client/index.js';
3
+ import { InMemoryTransport } from '@modelcontextprotocol/sdk/inMemory.js';
4
+ import { createServer } from './server.js';
5
+ function mockResponse(body, status = 200) {
6
+ return new Response(JSON.stringify(body), { status, statusText: 'OK' });
7
+ }
8
+ function getRequestUrl(call) {
9
+ const arg = call[0];
10
+ return arg instanceof Request ? arg.url : String(arg);
11
+ }
12
+ function getRequestMethod(call) {
13
+ const arg = call[0];
14
+ if (arg instanceof Request)
15
+ return arg.method;
16
+ return call[1].method ?? 'GET';
17
+ }
18
+ async function getRequestBody(call) {
19
+ const arg = call[0];
20
+ if (arg instanceof Request) {
21
+ const text = await arg.clone().text();
22
+ return text ? JSON.parse(text) : undefined;
23
+ }
24
+ const body = call[1].body;
25
+ return body ? JSON.parse(body) : undefined;
26
+ }
27
+ const agentFixture = {
28
+ id: 'agent-1',
29
+ name: 'Agent',
30
+ model: 'oppie-vox-livekit',
31
+ actionIds: [],
32
+ transfer_destination_ids: [],
33
+ };
34
+ describe('phone tools', () => {
35
+ let client;
36
+ let cleanup;
37
+ let fetchSpy;
38
+ beforeEach(async () => {
39
+ fetchSpy = vi.fn();
40
+ vi.stubGlobal('fetch', fetchSpy);
41
+ const server = createServer('test-api-key', 'https://api.test.com');
42
+ const [clientTransport, serverTransport] = InMemoryTransport.createLinkedPair();
43
+ await server.connect(serverTransport);
44
+ client = new Client({ name: 'test-client', version: '1.0.0' });
45
+ await client.connect(clientTransport);
46
+ cleanup = async () => {
47
+ await client.close();
48
+ await server.close();
49
+ };
50
+ });
51
+ afterEach(async () => {
52
+ await cleanup();
53
+ vi.restoreAllMocks();
54
+ });
55
+ it('list_transfer_destinations reads GET /phone/transfer-destinations', async () => {
56
+ fetchSpy.mockResolvedValueOnce(mockResponse([{ id: 'dest-1', name: 'Support', type: 'phone', hasSipPassword: false }]));
57
+ const result = await client.callTool({ name: 'list_transfer_destinations', arguments: {} });
58
+ expect(result.isError).toBeFalsy();
59
+ const call = fetchSpy.mock.calls[0];
60
+ expect(getRequestUrl(call)).toBe('https://api.test.com/phone/transfer-destinations');
61
+ expect(getRequestMethod(call)).toBe('GET');
62
+ expect(JSON.stringify(result.content)).toContain('dest-1');
63
+ });
64
+ it('create_phone_agent forwards actions, destinations and voice tuning fields verbatim', async () => {
65
+ fetchSpy.mockResolvedValueOnce(mockResponse(agentFixture));
66
+ const result = await client.callTool({
67
+ name: 'create_phone_agent',
68
+ arguments: {
69
+ name: 'Agent',
70
+ actionIds: ['act-1'],
71
+ transfer_destination_ids: ['dest-1'],
72
+ failover_transfer_destination_id: 'dest-1',
73
+ tts_speed_pct: 83,
74
+ stt_keyterms: ['OpenCX'],
75
+ recording_enabled: true,
76
+ },
77
+ });
78
+ expect(result.isError).toBeFalsy();
79
+ const call = fetchSpy.mock.calls[0];
80
+ expect(getRequestUrl(call)).toBe('https://api.test.com/phone');
81
+ expect(getRequestMethod(call)).toBe('POST');
82
+ expect(await getRequestBody(call)).toEqual({
83
+ name: 'Agent',
84
+ actionIds: ['act-1'],
85
+ transfer_destination_ids: ['dest-1'],
86
+ failover_transfer_destination_id: 'dest-1',
87
+ tts_speed_pct: 83,
88
+ stt_keyterms: ['OpenCX'],
89
+ recording_enabled: true,
90
+ });
91
+ });
92
+ it('create/update no longer expose the legacy handoff_phone_number / use_org_knowledgebase inputs', async () => {
93
+ const { tools } = await client.listTools();
94
+ for (const name of ['create_phone_agent', 'update_phone_agent']) {
95
+ const tool = tools.find((t) => t.name === name);
96
+ expect(tool, name).toBeDefined();
97
+ const properties = Object.keys(tool?.inputSchema.properties ?? {});
98
+ expect(properties).not.toContain('handoff_phone_number');
99
+ expect(properties).not.toContain('use_org_knowledgebase');
100
+ expect(properties).toEqual(expect.arrayContaining(['actionIds', 'transfer_destination_ids', 'tts_speed_pct']));
101
+ }
102
+ });
103
+ it('update_phone_agent PATCHes only the supplied fields', async () => {
104
+ fetchSpy.mockResolvedValueOnce(mockResponse(agentFixture));
105
+ await client.callTool({
106
+ name: 'update_phone_agent',
107
+ arguments: { phone_agent_id: 'agent-1', transfer_destination_ids: [] },
108
+ });
109
+ const call = fetchSpy.mock.calls[0];
110
+ expect(getRequestUrl(call)).toBe('https://api.test.com/phone/agent-1');
111
+ expect(getRequestMethod(call)).toBe('PATCH');
112
+ expect(await getRequestBody(call)).toEqual({ transfer_destination_ids: [] });
113
+ });
114
+ it('make_outbound_call maps session_custom_data / extra_instructions onto the API body', async () => {
115
+ fetchSpy.mockResolvedValueOnce(mockResponse({ sessionId: 's-1', callId: 'c-1' }));
116
+ const result = await client.callTool({
117
+ name: 'make_outbound_call',
118
+ arguments: {
119
+ phone_agent_id: 'agent-1',
120
+ phone_number: '+15551234567',
121
+ session_custom_data: { npsScore: 3, business: 'Cafe', owner: true },
122
+ extra_instructions: 'Ask about the last order.',
123
+ },
124
+ });
125
+ expect(result.isError).toBeFalsy();
126
+ const call = fetchSpy.mock.calls[0];
127
+ expect(getRequestUrl(call)).toBe('https://api.test.com/phone/outbound-call');
128
+ expect(await getRequestBody(call)).toEqual({
129
+ phoneAgentId: 'agent-1',
130
+ contact: { phoneNumber: '+15551234567' },
131
+ sessionCustomData: { npsScore: 3, business: 'Cafe', owner: true },
132
+ extraInstructions: 'Ask about the last order.',
133
+ });
134
+ });
135
+ it('make_outbound_call omits the optional extras when not provided', async () => {
136
+ fetchSpy.mockResolvedValueOnce(mockResponse({ sessionId: 's-1', callId: 'c-1' }));
137
+ await client.callTool({
138
+ name: 'make_outbound_call',
139
+ arguments: { phone_agent_id: 'agent-1', contact_id: 'contact-1' },
140
+ });
141
+ const call = fetchSpy.mock.calls[0];
142
+ expect(await getRequestBody(call)).toEqual({
143
+ phoneAgentId: 'agent-1',
144
+ contact: { id: 'contact-1' },
145
+ });
146
+ });
147
+ it('make_outbound_call rejects a call with neither contact nor number without hitting the API', async () => {
148
+ const result = await client.callTool({
149
+ name: 'make_outbound_call',
150
+ arguments: { phone_agent_id: 'agent-1' },
151
+ });
152
+ expect(result.isError).toBe(true);
153
+ expect(fetchSpy).not.toHaveBeenCalled();
154
+ });
155
+ });
156
+ //# sourceMappingURL=phone-tools.spec.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"phone-tools.spec.js","sourceRoot":"","sources":["../src/phone-tools.spec.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,EAAE,EAAE,MAAM,EAAE,EAAE,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,QAAQ,CAAC;AACzE,OAAO,EAAE,MAAM,EAAE,MAAM,2CAA2C,CAAC;AACnE,OAAO,EAAE,iBAAiB,EAAE,MAAM,uCAAuC,CAAC;AAC1E,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAE3C,SAAS,YAAY,CAAC,IAAa,EAAE,MAAM,GAAG,GAAG;IAC/C,OAAO,IAAI,QAAQ,CAAC,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,EAAE,EAAE,MAAM,EAAE,UAAU,EAAE,IAAI,EAAE,CAAC,CAAC;AAC1E,CAAC;AAED,SAAS,aAAa,CAAC,IAAe;IACpC,MAAM,GAAG,GAAG,IAAI,CAAC,CAAC,CAAC,CAAC;IACpB,OAAO,GAAG,YAAY,OAAO,CAAC,CAAC,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC;AACxD,CAAC;AAED,SAAS,gBAAgB,CAAC,IAAe;IACvC,MA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AE;YACjE,iBAAiB,EAAE,2BAA2B;SAC/C,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,gEAAgE,EAAE,KAAK,IAAI,EAAE;QAC9E,QAAQ,CAAC,qBAAqB,CAAC,YAAY,CAAC,EAAE,SAAS,EAAE,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,CAAC,CAAC,CAAC;QAElF,MAAM,MAAM,CAAC,QAAQ,CAAC;YACpB,IAAI,EAAE,oBAAoB;YAC1B,SAAS,EAAE,EAAE,cAAc,EAAE,SAAS,EAAE,UAAU,EAAE,WAAW,EAAE;SAClE,CAAC,CAAC;QAEH,MAAM,IAAI,GAAG,QAAQ,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAc,CAAC;QACjD,MAAM,CAAC,MAAM,cAAc,CAAC,IAAI,CAAC,CAAC,CAAC,OAAO,CAAC;YACzC,YAAY,EAAE,SAAS;YACvB,OAAO,EAAE,EAAE,EAAE,EAAE,WAAW,EAAE;SAC7B,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,2FAA2F,EAAE,KAAK,IAAI,EAAE;QACzG,MAAM,MAAM,GAAG,MAAM,MAAM,CAAC,QAAQ,CAAC;YACnC,IAAI,EAAE,oBAAoB;YAC1B,SAAS,EAAE,EAAE,cAAc,EAAE,SAAS,EAAE;SACzC,CAAC,CAAC;QACH,MAAM,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QAClC,MAAM,CAAC,QAAQ,CAAC,CAAC,GAAG,CAAC,gBAAgB,EAAE,CAAC;IAC1C,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
package/dist/schema.d.ts CHANGED
@@ -511,6 +511,30 @@ export interface paths {
511
511
  patch?: never;
512
512
  trace?: never;
513
513
  };
514
+ "/chat/sessions/{session_id}/comments/{comment_uuid}": {
515
+ parameters: {
516
+ query?: never;
517
+ header?: never;
518
+ path?: never;
519
+ cookie?: never;
520
+ };
521
+ get?: never;
522
+ put?: never;
523
+ post?: never;
524
+ /**
525
+ * Delete a session comment
526
+ * @description Soft-deletes an internal comment. Only the comment's author may delete it. The acting agent is passed as the `agent_id` query parameter.
527
+ */
528
+ delete: operations["deleteChatSessionComment"];
529
+ options?: never;
530
+ head?: never;
531
+ /**
532
+ * Update a session comment
533
+ * @description Replaces the content of an internal comment. Only the comment's author may edit it, and a deleted comment can no longer be edited.
534
+ */
535
+ patch: operations["updateChatSessionComment"];
536
+ trace?: never;
537
+ };
514
538
  "/chat/sessions/{session_id}/history": {
515
539
  parameters: {
516
540
  query?: never;
@@ -2410,7 +2434,7 @@ export interface paths {
2410
2434
  };
2411
2435
  /**
2412
2436
  * List available voices
2413
- * @description List available voices for AI phone agents. Supports filtering by language, gender, accent, use_case, and free-text search. Use limit/offset for pagination. Use the voice_id when creating or updating a phone agent.
2437
+ * @description List the curated voices available for AI phone agents. Supports filtering by language, gender, accent, use_case, and free-text search. Use limit/offset for pagination. Use the voice_id when creating or updating a phone agent.
2414
2438
  */
2415
2439
  get: operations["listVoices"];
2416
2440
  put?: never;
@@ -2445,6 +2469,26 @@ export interface paths {
2445
2469
  patch?: never;
2446
2470
  trace?: never;
2447
2471
  };
2472
+ "/phone/transfer-destinations": {
2473
+ parameters: {
2474
+ query?: never;
2475
+ header?: never;
2476
+ path?: never;
2477
+ cookie?: never;
2478
+ };
2479
+ /**
2480
+ * List transfer destinations
2481
+ * @description List the transfer destinations configured for your organization (phone numbers, SIP endpoints, teams, or hang-up handbacks). Reference their IDs in transfer_destination_ids when creating or updating a phone agent; the agent can then transfer calls to them by name. Destinations are created and edited in the dashboard (Settings → SIP).
2482
+ */
2483
+ get: operations["listPhoneTransferDestinations"];
2484
+ put?: never;
2485
+ post?: never;
2486
+ delete?: never;
2487
+ options?: never;
2488
+ head?: never;
2489
+ patch?: never;
2490
+ trace?: never;
2491
+ };
2448
2492
  "/phone/{phone_agent_id}/knowledge-sources": {
2449
2493
  parameters: {
2450
2494
  query?: never;
@@ -2954,7 +2998,7 @@ export interface paths {
2954
2998
  put?: never;
2955
2999
  /**
2956
3000
  * Create a training directory
2957
- * @description Create a new directory for organizing trainings.
3001
+ * @description Create a new directory for organizing trainings. Pass parent_id to create it as a sub-directory.
2958
3002
  */
2959
3003
  post: operations["createTrainingDirectory"];
2960
3004
  delete?: never;
@@ -2973,7 +3017,7 @@ export interface paths {
2973
3017
  get?: never;
2974
3018
  /**
2975
3019
  * Update a training directory
2976
- * @description Rename a training directory.
3020
+ * @description Rename and/or move a training directory. parent_id null moves it to the top level. Moving a directory under itself or one of its own sub-directories is rejected.
2977
3021
  */
2978
3022
  put: operations["updateTrainingDirectory"];
2979
3023
  post?: never;
@@ -3273,6 +3317,30 @@ export interface paths {
3273
3317
  get: operations["getOrgUser"];
3274
3318
  put?: never;
3275
3319
  post?: never;
3320
+ /**
3321
+ * Remove a user from the organization
3322
+ * @description Remove a user's organization membership. Also removes their team memberships and availability in this organization and signs them out everywhere. Their account and historical activity are preserved, and memberships in other organizations are unaffected. The organization owner cannot be removed.
3323
+ */
3324
+ delete: operations["deleteOrgUser"];
3325
+ options?: never;
3326
+ head?: never;
3327
+ patch?: never;
3328
+ trace?: never;
3329
+ };
3330
+ "/users/batch-delete": {
3331
+ parameters: {
3332
+ query?: never;
3333
+ header?: never;
3334
+ path?: never;
3335
+ cookie?: never;
3336
+ };
3337
+ get?: never;
3338
+ put?: never;
3339
+ /**
3340
+ * Remove multiple users from the organization
3341
+ * @description Remove up to 25 users from the organization in one call. Users are processed independently — one failure never aborts the rest — and the response reports a status per user. Same semantics as removing a single user.
3342
+ */
3343
+ post: operations["batchDeleteOrgUsers"];
3276
3344
  delete?: never;
3277
3345
  options?: never;
3278
3346
  head?: never;
@@ -5819,6 +5887,13 @@ export interface components {
5819
5887
  agent_id: number;
5820
5888
  attachments?: components["schemas"]["ChatAttachmentInput"][];
5821
5889
  };
5890
+ UpdateSessionCommentInput: {
5891
+ /** @description Replacement comment text content */
5892
+ content: string;
5893
+ /** @description Agent user ID performing the edit. Only the note's author may edit it. */
5894
+ agent_id: number;
5895
+ attachments?: components["schemas"]["ChatAttachmentInput"][];
5896
+ };
5822
5897
  FilterSessionsPublicDto: {
5823
5898
  /** @default {} */
5824
5899
  filters: {
@@ -5976,18 +6051,24 @@ export interface components {
5976
6051
  type?: "inbound" | "outbound";
5977
6052
  /** @description Voice ID from the /phone/voices endpoint. Omit for default voice. */
5978
6053
  voice_id?: string | null;
5979
- /** @description ISO-639-1 language codes the agent should speak. A subset of {en, es, fr, de, hi, ru, pt, ja, it, nl} can be combined freely. Any other code (e.g. "ar", "tr", "zh") must be the only entry. */
6054
+ /** @description ISO-639-1 language codes the agent should speak. A subset of {en, es, fr, de, hi, ru, pt, ja, it, nl} can be combined freely. Any other code (e.g. "ar", "tr", "zh") must be the only entry; Arabic accepts dialect tags such as "ar-SA". */
5980
6055
  language?: string[];
5981
6056
  /** @description What the agent says when it picks up (default: "Hello?") */
5982
6057
  first_message?: string | null;
5983
- /** @description Training scenario IDs to attach to this agent */
6058
+ /** @description The call prompt as an array of instruction blocks. Joined in order into the system prompt at call time. Sending this on update replaces the whole array. */
5984
6059
  instructions?: string[] | null;
5985
- /** @description Phone number to transfer to when handing off to a human (E.164 format) */
5986
- handoff_phone_number?: string | null;
5987
- /** @description Whether the agent can search your knowledge base during calls (default: false) */
5988
- use_org_knowledgebase?: boolean | null;
5989
- /** @description Action IDs the agent can call during conversations */
6060
+ /** @description HTTP actions the agent can call as tools during calls (action IDs from GET /actions). The full set is replaced on every write; send [] to detach all, omit or send null to leave it unchanged. IDs must belong to your organization. */
5990
6061
  actionIds?: string[] | null;
6062
+ /** @description Transfer destinations the agent may transfer calls to (IDs from GET /phone/transfer-destinations). The full set is replaced on every write; send [] to detach all. Destinations themselves are managed in the dashboard. */
6063
+ transfer_destination_ids?: string[];
6064
+ /** @description Destination the call is transferred to if the voice pipeline fails mid-call. Any destination of your organization; null falls back to the first allowed destination, then to a graceful hangup. */
6065
+ failover_transfer_destination_id?: string | null;
6066
+ /** @description Speaking speed on a 1-100 scale (null = the voice default). Lower is slower; natural-sounding voices in some languages (e.g. Dutch) run best around 80-85. */
6067
+ tts_speed_pct?: number | null;
6068
+ /** @description Custom vocabulary to boost in speech recognition: brand and product names, jargon, spellings the transcriber typically mishears. The agent name and transfer destination names are merged in automatically. */
6069
+ stt_keyterms?: string[] | null;
6070
+ /** @description Record calls handled by this agent (default: false). */
6071
+ recording_enabled?: boolean;
5991
6072
  };
5992
6073
  UpdatePhoneAgentPublicDto: {
5993
6074
  /** @description Agent display name */
@@ -5999,18 +6080,24 @@ export interface components {
5999
6080
  type?: "inbound" | "outbound";
6000
6081
  /** @description Voice ID from the /phone/voices endpoint. Omit for default voice. */
6001
6082
  voice_id?: string | null;
6002
- /** @description ISO-639-1 language codes the agent should speak. A subset of {en, es, fr, de, hi, ru, pt, ja, it, nl} can be combined freely. Any other code (e.g. "ar", "tr", "zh") must be the only entry. */
6083
+ /** @description ISO-639-1 language codes the agent should speak. A subset of {en, es, fr, de, hi, ru, pt, ja, it, nl} can be combined freely. Any other code (e.g. "ar", "tr", "zh") must be the only entry; Arabic accepts dialect tags such as "ar-SA". */
6003
6084
  language?: string[];
6004
6085
  /** @description What the agent says when it picks up (default: "Hello?") */
6005
6086
  first_message?: string | null;
6006
- /** @description Training scenario IDs to attach to this agent */
6087
+ /** @description The call prompt as an array of instruction blocks. Joined in order into the system prompt at call time. Sending this on update replaces the whole array. */
6007
6088
  instructions?: string[] | null;
6008
- /** @description Phone number to transfer to when handing off to a human (E.164 format) */
6009
- handoff_phone_number?: string | null;
6010
- /** @description Whether the agent can search your knowledge base during calls (default: false) */
6011
- use_org_knowledgebase?: boolean | null;
6012
- /** @description Action IDs the agent can call during conversations */
6089
+ /** @description HTTP actions the agent can call as tools during calls (action IDs from GET /actions). The full set is replaced on every write; send [] to detach all, omit or send null to leave it unchanged. IDs must belong to your organization. */
6013
6090
  actionIds?: string[] | null;
6091
+ /** @description Transfer destinations the agent may transfer calls to (IDs from GET /phone/transfer-destinations). The full set is replaced on every write; send [] to detach all. Destinations themselves are managed in the dashboard. */
6092
+ transfer_destination_ids?: string[];
6093
+ /** @description Destination the call is transferred to if the voice pipeline fails mid-call. Any destination of your organization; null falls back to the first allowed destination, then to a graceful hangup. */
6094
+ failover_transfer_destination_id?: string | null;
6095
+ /** @description Speaking speed on a 1-100 scale (null = the voice default). Lower is slower; natural-sounding voices in some languages (e.g. Dutch) run best around 80-85. */
6096
+ tts_speed_pct?: number | null;
6097
+ /** @description Custom vocabulary to boost in speech recognition: brand and product names, jargon, spellings the transcriber typically mishears. The agent name and transfer destination names are merged in automatically. */
6098
+ stt_keyterms?: string[] | null;
6099
+ /** @description Record calls handled by this agent (default: false). */
6100
+ recording_enabled?: boolean;
6014
6101
  };
6015
6102
  WriteSecretInputDto: {
6016
6103
  /** @description The reference key actions and workflows use as {{secrets.<name>}}. Unique per organization, and immutable — writing the same name replaces its value rather than renaming anything. */
@@ -6119,6 +6206,10 @@ export interface components {
6119
6206
  /** @description Pre-rendered TipTap diff HTML */
6120
6207
  diff_html: string;
6121
6208
  };
6209
+ BatchDeleteOrgUsersDto: {
6210
+ /** @description Organization user IDs to remove (duplicates are collapsed) */
6211
+ user_ids: number[];
6212
+ };
6122
6213
  PublicApproveSuggestionDto: {
6123
6214
  /**
6124
6215
  * Format: uuid
@@ -6451,10 +6542,14 @@ export interface components {
6451
6542
  CreateTrainingDirectoryInputDto: {
6452
6543
  /** @description The directory name */
6453
6544
  name: string;
6545
+ /** @description Parent directory id. Omit or null for a top-level directory. */
6546
+ parent_id?: string | null;
6454
6547
  };
6455
6548
  UpdateTrainingDirectoryInputDto: {
6456
6549
  /** @description The new directory name */
6457
- name: string;
6550
+ name?: string;
6551
+ /** @description New parent directory id, or null for top level. Omit to keep the current parent. */
6552
+ parent_id?: string | null;
6458
6553
  };
6459
6554
  UpdateAiProfileInput: {
6460
6555
  name?: string;
@@ -7249,6 +7344,8 @@ export interface components {
7249
7344
  id: string;
7250
7345
  name: string;
7251
7346
  org_id: string;
7347
+ /** @description Parent folder id; null for a top-level folder. */
7348
+ parent_id: string | null;
7252
7349
  };
7253
7350
  SankeyReportResDto: {
7254
7351
  nodes: {
@@ -7348,6 +7445,24 @@ export interface components {
7348
7445
  */
7349
7446
  outcome: "unlinked" | "unchanged";
7350
7447
  };
7448
+ TransferDestinationDto: {
7449
+ /** Format: uuid */
7450
+ id: string;
7451
+ name: string;
7452
+ /** @enum {string} */
7453
+ type: "hangup" | "phone" | "sip" | "team";
7454
+ value: string | null;
7455
+ sipUsername: string | null;
7456
+ hasSipPassword: boolean;
7457
+ sipHost: string | null;
7458
+ sipPort: number | null;
7459
+ sipExtension: string | null;
7460
+ sipTransport: ("udp" | "tcp" | "tls") | null;
7461
+ sipCallerId: string | null;
7462
+ routingGroupId: string | null;
7463
+ createdAt: string;
7464
+ updatedAt: string;
7465
+ };
7351
7466
  PhoneAgentDto: {
7352
7467
  id: string;
7353
7468
  org_id: string;
@@ -7382,6 +7497,8 @@ export interface components {
7382
7497
  stt_model: ("deepgram/flux-general" | "deepgram/nova-3" | "deepgram/nova-3-medical" | "cartesia/ink-whisper" | "elevenlabs/scribe_v2_realtime" | "xai/stt-1" | "assemblyai/universal-3-5-pro" | "speechmatics/enhanced" | "soniox/stt-rt-v5") | null;
7383
7498
  tts_speed_pct: number | null;
7384
7499
  failover_transfer_destination_id: string | null;
7500
+ /** @description Transfer destinations the agent may transfer to (`transfer_call` targets). */
7501
+ transfer_destination_ids: string[];
7385
7502
  };
7386
7503
  PhoneAgentVoiceDto: {
7387
7504
  voice_id: string;
@@ -7423,6 +7540,8 @@ export interface components {
7423
7540
  KnowledgeSourceDirectoryDto: {
7424
7541
  id: string;
7425
7542
  name: string;
7543
+ /** @description Parent directory id; null for a top-level directory */
7544
+ parent_id: string | null;
7426
7545
  items: components["schemas"]["KnowledgeSourceTreeItemDto"][];
7427
7546
  /** @description Whether the entire directory is selected (all current and future instructions included) */
7428
7547
  selected: boolean;
@@ -9861,6 +9980,8 @@ export interface components {
9861
9980
  id: string;
9862
9981
  name: string;
9863
9982
  org_id: string;
9983
+ /** @description Parent folder id; null for a top-level folder. */
9984
+ parent_id: string | null;
9864
9985
  items: components["schemas"]["TrainingPublicResponseDto"][];
9865
9986
  };
9866
9987
  TrainingDirectoryTreePublicDto: {
@@ -9889,6 +10010,16 @@ export interface components {
9889
10010
  is_user_available_on_group: boolean;
9890
10011
  }[];
9891
10012
  };
10013
+ BatchDeleteOrgUsersResultDto: {
10014
+ results: {
10015
+ user_id: number;
10016
+ /**
10017
+ * @description deleted: membership removed; not_found: not a member of this organization; owner_blocked: the organization owner cannot be removed; error: removal failed, retry later
10018
+ * @enum {string}
10019
+ */
10020
+ status: "deleted" | "not_found" | "owner_blocked" | "error";
10021
+ }[];
10022
+ };
9892
10023
  PublicInsight: {
9893
10024
  /** Format: uuid */
9894
10025
  id: string;
@@ -10469,6 +10600,7 @@ export interface components {
10469
10600
  GetWorkflowRunLogsOutput: components["schemas"]["WorkflowRunLogEntryDto"][];
10470
10601
  ListVoicesOutput: components["schemas"]["PhoneAgentVoiceDto"][];
10471
10602
  ListPhoneAgentsOutput: components["schemas"]["PhoneAgentDto"][];
10603
+ ListTransferDestinationsOutput: components["schemas"]["TransferDestinationDto"][];
10472
10604
  GetSequenceOutput: components["schemas"]["SequenceDto"];
10473
10605
  ListTrainingsOutput: {
10474
10606
  items: components["schemas"]["TrainingPublicResponseDto"][];
@@ -11595,6 +11727,79 @@ export interface operations {
11595
11727
  };
11596
11728
  };
11597
11729
  };
11730
+ deleteChatSessionComment: {
11731
+ parameters: {
11732
+ query: {
11733
+ /** @description Agent user ID performing the deletion. Only the note's author may delete it. */
11734
+ agent_id: number;
11735
+ };
11736
+ header?: never;
11737
+ path: {
11738
+ /** @description The unique identifier of the chat session */
11739
+ session_id: string;
11740
+ /** @description The unique identifier of the comment */
11741
+ comment_uuid: string;
11742
+ };
11743
+ cookie?: never;
11744
+ };
11745
+ requestBody?: never;
11746
+ responses: {
11747
+ /** @description Default Response */
11748
+ 204: {
11749
+ headers: {
11750
+ [name: string]: unknown;
11751
+ };
11752
+ content?: never;
11753
+ };
11754
+ /** @description Internal Server Error */
11755
+ 500: {
11756
+ headers: {
11757
+ [name: string]: unknown;
11758
+ };
11759
+ content: {
11760
+ "application/json": components["schemas"]["ErrorDto"];
11761
+ };
11762
+ };
11763
+ };
11764
+ };
11765
+ updateChatSessionComment: {
11766
+ parameters: {
11767
+ query?: never;
11768
+ header?: never;
11769
+ path: {
11770
+ /** @description The unique identifier of the chat session */
11771
+ session_id: string;
11772
+ /** @description The unique identifier of the comment */
11773
+ comment_uuid: string;
11774
+ };
11775
+ cookie?: never;
11776
+ };
11777
+ requestBody: {
11778
+ content: {
11779
+ "application/json": components["schemas"]["UpdateSessionCommentInput"];
11780
+ };
11781
+ };
11782
+ responses: {
11783
+ /** @description Default Response */
11784
+ 200: {
11785
+ headers: {
11786
+ [name: string]: unknown;
11787
+ };
11788
+ content: {
11789
+ "application/json": components["schemas"]["ChatHistoryDto"];
11790
+ };
11791
+ };
11792
+ /** @description Internal Server Error */
11793
+ 500: {
11794
+ headers: {
11795
+ [name: string]: unknown;
11796
+ };
11797
+ content: {
11798
+ "application/json": components["schemas"]["ErrorDto"];
11799
+ };
11800
+ };
11801
+ };
11802
+ };
11598
11803
  listChatHistory: {
11599
11804
  parameters: {
11600
11805
  query?: {
@@ -15680,6 +15885,35 @@ export interface operations {
15680
15885
  };
15681
15886
  };
15682
15887
  };
15888
+ listPhoneTransferDestinations: {
15889
+ parameters: {
15890
+ query?: never;
15891
+ header?: never;
15892
+ path?: never;
15893
+ cookie?: never;
15894
+ };
15895
+ requestBody?: never;
15896
+ responses: {
15897
+ /** @description Default Response */
15898
+ 200: {
15899
+ headers: {
15900
+ [name: string]: unknown;
15901
+ };
15902
+ content: {
15903
+ "application/json": components["schemas"]["ListTransferDestinationsOutput"];
15904
+ };
15905
+ };
15906
+ /** @description Internal Server Error */
15907
+ 500: {
15908
+ headers: {
15909
+ [name: string]: unknown;
15910
+ };
15911
+ content: {
15912
+ "application/json": components["schemas"]["ErrorDto"];
15913
+ };
15914
+ };
15915
+ };
15916
+ };
15683
15917
  getPhoneAgentKnowledgeSources: {
15684
15918
  parameters: {
15685
15919
  query?: never;
@@ -17565,6 +17799,69 @@ export interface operations {
17565
17799
  };
17566
17800
  };
17567
17801
  };
17802
+ deleteOrgUser: {
17803
+ parameters: {
17804
+ query?: never;
17805
+ header?: never;
17806
+ path: {
17807
+ /** @description Organization user ID */
17808
+ user_id: number;
17809
+ };
17810
+ cookie?: never;
17811
+ };
17812
+ requestBody?: never;
17813
+ responses: {
17814
+ /** @description Default Response */
17815
+ 204: {
17816
+ headers: {
17817
+ [name: string]: unknown;
17818
+ };
17819
+ content?: never;
17820
+ };
17821
+ /** @description Internal Server Error */
17822
+ 500: {
17823
+ headers: {
17824
+ [name: string]: unknown;
17825
+ };
17826
+ content: {
17827
+ "application/json": components["schemas"]["ErrorDto"];
17828
+ };
17829
+ };
17830
+ };
17831
+ };
17832
+ batchDeleteOrgUsers: {
17833
+ parameters: {
17834
+ query?: never;
17835
+ header?: never;
17836
+ path?: never;
17837
+ cookie?: never;
17838
+ };
17839
+ requestBody: {
17840
+ content: {
17841
+ "application/json": components["schemas"]["BatchDeleteOrgUsersDto"];
17842
+ };
17843
+ };
17844
+ responses: {
17845
+ /** @description Default Response */
17846
+ 201: {
17847
+ headers: {
17848
+ [name: string]: unknown;
17849
+ };
17850
+ content: {
17851
+ "application/json": components["schemas"]["BatchDeleteOrgUsersResultDto"];
17852
+ };
17853
+ };
17854
+ /** @description Internal Server Error */
17855
+ 500: {
17856
+ headers: {
17857
+ [name: string]: unknown;
17858
+ };
17859
+ content: {
17860
+ "application/json": components["schemas"]["ErrorDto"];
17861
+ };
17862
+ };
17863
+ };
17864
+ };
17568
17865
  inviteUser: {
17569
17866
  parameters: {
17570
17867
  query?: never;