@arbol-ai/sdk 2.4.0 → 2.5.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.
@@ -12,14 +12,20 @@ export interface Client {
12
12
  /**
13
13
  * Add a channel
14
14
  *
15
- * Add a channel. `whatsapp` creates a pending channel and a setup link
16
- * (`setup.url`) where the business connects its WhatsApp number; call
17
- * `verify_channel` once that is done. `voice` connects a platform phone
18
- * number (`platform_number`) or the organization's own carrier over SIP
19
- * (`sip_trunk`) at once (SIP credentials are passed on once and never
20
- * stored). `web` creates the chat widget with its configuration. With an
21
- * Agent, traffic is on by default. Done in Settings → Channels or the REST
22
- * API; not an AI tool.
15
+ * Add a channel. `web` creates a website chat or form (the widget) from its
16
+ * complete configuration (`widget`: mode, texts, fields, colors and fonts,
17
+ * allowed origins, `publicLink` for its own hosted page); it is the one kind
18
+ * an AI tool creates. Create it with `inboundEnabled: false` to review it
19
+ * before publishing, then publish or pause it with `update_channel`;
20
+ * `publication` says whether visitors can reach it and where. `whatsapp`
21
+ * creates a pending channel and a setup link (`setup.url`) where the business
22
+ * connects its WhatsApp number; call `verify_channel` once that is done.
23
+ * `voice` connects a platform phone number (`platform_number`) or the
24
+ * organization's own carrier over SIP (`sip_trunk`) at once (SIP credentials
25
+ * are passed on once and never stored). A person adds WhatsApp and voice
26
+ * channels in Settings → Channels or with the REST API: over MCP they fail
27
+ * with CHANNEL_CREATION_IN_APP. With an Agent, traffic is on by default. Not
28
+ * idempotent: after an unknown outcome, `list_channels` before trying again.
23
29
  */
24
30
  create(request: CreateRequest, options?: RequestOptions): Promise<CreateResponse>;
25
31
  /**
@@ -2,4 +2,4 @@ export { ApiError } from "../../_/index.js";
2
2
  export type { RequestOptions } from "../../_/index.js";
3
3
  export { createClient } from "./client.js";
4
4
  export type { Client, ClientOptions, CreateRequest, CreateResponse, DeleteRequest, DeleteResponse, GetRequest, GetResponse, ListRequest, ListResponse, RenewSetupRequest, RenewSetupResponse, UpdateRequest, UpdateResponse, VerifyRequest, VerifyResponse, } from "./client.js";
5
- export type { RaizChannel, RaizChannelAgent, RaizChannelPage, RaizWidgetAgentChoice, RaizWidgetClientTool, RaizWidgetCopy, RaizWidgetField, RaizWidgetSettings, RaizWidgetSettingsInput, RaizWidgetTranslations, } from "./models.js";
5
+ export type { RaizChannel, RaizChannelAgent, RaizChannelPage, RaizWidgetAgentChoice, RaizWidgetClientTool, RaizWidgetCopy, RaizWidgetField, RaizWidgetPublication, RaizWidgetSettings, RaizWidgetSettingsInput, RaizWidgetTranslations, } from "./models.js";
@@ -52,6 +52,7 @@ export interface RaizChannel {
52
52
  */
53
53
  provider: "phone" | "sip" | "whatsapp" | "web";
54
54
  providerAccountId: string | null;
55
+ publication: RaizWidgetPublication | null;
55
56
  /**
56
57
  * Active with enabled traffic; WhatsApp outbound notifications do not need an
57
58
  * Agent.
@@ -132,12 +133,35 @@ export interface RaizWidgetCopy {
132
133
  welcomeTitle?: string;
133
134
  }
134
135
  export interface RaizWidgetField {
136
+ /**
137
+ * Help shown under the label.
138
+ */
139
+ description?: string;
135
140
  label: string;
136
141
  name: string;
137
142
  options?: string[];
138
143
  placeholder?: string;
139
144
  required: boolean;
140
- type: "text" | "textarea" | "email" | "tel" | "number" | "date" | "select" | "checkbox";
145
+ type: "text" | "textarea" | "email" | "tel" | "number" | "date" | "select" | "radio" | "checkbox" | "url";
146
+ /**
147
+ * `half` sets two consecutive half fields side by side on wide screens.
148
+ */
149
+ width?: "full" | "half";
150
+ }
151
+ export interface RaizWidgetPublication {
152
+ /**
153
+ * Visitors can start now: no `problems`. The hosted page answers at `url`,
154
+ * and the widget runs on its `allowedOrigins`.
155
+ */
156
+ live: boolean;
157
+ /**
158
+ * Why it is not live: `CHANNEL_INACTIVE` (the channel is not active),
159
+ * `PAUSED` (`inboundEnabled` is off), `AGENT_REQUIRED` (no Agent assigned),
160
+ * `AGENT_PAUSED` (its Agent is paused), `NOT_PLACED` (no hosted page and no
161
+ * https site may embed it).
162
+ */
163
+ problems: ("CHANNEL_INACTIVE" | "PAUSED" | "AGENT_REQUIRED" | "AGENT_PAUSED" | "NOT_PLACED")[];
164
+ url: string | null;
141
165
  }
142
166
  export interface RaizWidgetSettings {
143
167
  /**
@@ -160,9 +184,15 @@ export interface RaizWidgetSettings {
160
184
  */
161
185
  askFirstMessage?: boolean;
162
186
  /**
163
- * A color in `#RRGGBB` form.
187
+ * Background behind the Agent's messages; the background color shows them as
188
+ * plain text. A color in `#RRGGBB` form.
164
189
  */
165
190
  assistantColor?: string;
191
+ /**
192
+ * Text of the Agent's messages; null: `textColor`. A color in `#RRGGBB` form,
193
+ * or null to derive it.
194
+ */
195
+ assistantTextColor?: string | null;
166
196
  attachmentTypes?: ("image/png" | "image/jpeg" | "application/pdf" | "text/plain")[];
167
197
  attachmentsEnabled?: boolean;
168
198
  avatarUrl?: RaizHttpsUrl | null;
@@ -180,17 +210,35 @@ export interface RaizWidgetSettings {
180
210
  */
181
211
  clientTools?: RaizWidgetClientTool[];
182
212
  consentText?: string;
213
+ /**
214
+ * Corner radius of fields and buttons, in pixels; 24 makes pill-shaped
215
+ * buttons. Null: derived from `radius`.
216
+ */
217
+ controlRadius?: number | null;
183
218
  /**
184
219
  * A stylesheet applied inside the panel only; the launcher uses the style
185
220
  * fields.
186
221
  */
187
222
  customCss?: string;
188
223
  /**
189
- * Up to 12 pre-chat form fields with unique names.
224
+ * Field errors and failures the visitor must see. A color in `#RRGGBB` form.
225
+ */
226
+ errorColor?: string;
227
+ /**
228
+ * Up to 40 form fields with unique names, asked before the conversation (or
229
+ * alone, in `form` mode).
190
230
  */
191
231
  fields?: RaizWidgetField[];
192
232
  firstMessageLabel?: string;
233
+ /**
234
+ * The text typeface: `arbol` (bundled), `system` (the device's), `serif`,
235
+ * `rounded`, `page` (the embedding page's) or `custom` (`fontFamily`, with an
236
+ * optional `fontUrl`).
237
+ */
193
238
  font?: "arbol" | "system" | "serif" | "rounded" | "page" | "custom";
239
+ /**
240
+ * The CSS font-family of `font: custom`.
241
+ */
194
242
  fontFamily?: string;
195
243
  fontSize?: number;
196
244
  fontUrl?: RaizHttpsUrl | null;
@@ -204,6 +252,30 @@ export interface RaizWidgetSettings {
204
252
  * A color in `#RRGGBB` form.
205
253
  */
206
254
  headerTextColor?: string;
255
+ /**
256
+ * The headings' typeface: `text` (the same as `font`) or one of `font`'s
257
+ * choices, with `headingFontFamily` and `headingFontUrl` for `custom`.
258
+ */
259
+ headingFont?: "text" | "arbol" | "system" | "serif" | "rounded" | "page" | "custom";
260
+ /**
261
+ * The CSS font-family of `headingFont: custom`.
262
+ */
263
+ headingFontFamily?: string;
264
+ headingFontUrl?: RaizHttpsUrl | null;
265
+ /**
266
+ * The headings' weight, from 300 (light) to 800 (heavy).
267
+ */
268
+ headingWeight?: number;
269
+ /**
270
+ * The border of form fields and of the message box. A color in `#RRGGBB`
271
+ * form, or null to derive it.
272
+ */
273
+ inputBorderColor?: string | null;
274
+ /**
275
+ * The background of form fields and of the message box. A color in `#RRGGBB`
276
+ * form, or null to derive it.
277
+ */
278
+ inputColor?: string | null;
207
279
  /**
208
280
  * The visitor interface language when the browser asks for none of the
209
281
  * translated ones.
@@ -216,6 +288,11 @@ export interface RaizWidgetSettings {
216
288
  * accessible name.
217
289
  */
218
290
  launcherStyle?: "icon" | "label";
291
+ /**
292
+ * Links; null: `primaryColor`. A color in `#RRGGBB` form, or null to derive
293
+ * it.
294
+ */
295
+ linkColor?: string | null;
219
296
  logoObjectKey?: string | null;
220
297
  /**
221
298
  * Visitor messages per session.
@@ -227,6 +304,11 @@ export interface RaizWidgetSettings {
227
304
  * `form-chat`: the form, then the conversation.
228
305
  */
229
306
  mode?: "chat" | "form" | "form-chat";
307
+ /**
308
+ * Secondary text: descriptions, hints and times. A color in `#RRGGBB` form,
309
+ * or null to derive it.
310
+ */
311
+ mutedTextColor?: string | null;
230
312
  /**
231
313
  * Increases when a policy field, the channel's Agent or its inbound switch
232
314
  * changes; sessions opened under an older revision end.
@@ -275,9 +357,25 @@ export interface RaizWidgetSettings {
275
357
  translations?: RaizWidgetTranslations;
276
358
  turnsPerDay?: number;
277
359
  /**
278
- * A color in `#RRGGBB` form.
360
+ * Text on `primaryColor`: buttons and the launcher. A color in `#RRGGBB`
361
+ * form.
279
362
  */
280
363
  userTextColor?: string;
364
+ /**
365
+ * Background of the visitor's own messages; null: a light tint of
366
+ * `textColor`. A color in `#RRGGBB` form, or null to derive it.
367
+ */
368
+ visitorColor?: string | null;
369
+ /**
370
+ * Text of the visitor's own messages; null: `textColor`. A color in `#RRGGBB`
371
+ * form, or null to derive it.
372
+ */
373
+ visitorTextColor?: string | null;
374
+ /**
375
+ * Let visitors record a voice message; Raíz transcribes it and the Agent
376
+ * answers the transcript.
377
+ */
378
+ voiceMessages?: boolean;
281
379
  welcomeText?: string;
282
380
  welcomeTitle?: string;
283
381
  }
@@ -302,9 +400,15 @@ export interface RaizWidgetSettingsInput {
302
400
  */
303
401
  askFirstMessage?: boolean;
304
402
  /**
305
- * A color in `#RRGGBB` form.
403
+ * Background behind the Agent's messages; the background color shows them as
404
+ * plain text. A color in `#RRGGBB` form.
306
405
  */
307
406
  assistantColor?: string;
407
+ /**
408
+ * Text of the Agent's messages; null: `textColor`. A color in `#RRGGBB` form,
409
+ * or null to derive it.
410
+ */
411
+ assistantTextColor?: string | null;
308
412
  attachmentTypes?: ("image/png" | "image/jpeg" | "application/pdf" | "text/plain")[];
309
413
  attachmentsEnabled?: boolean;
310
414
  avatarUrl?: RaizHttpsUrl | null;
@@ -322,17 +426,35 @@ export interface RaizWidgetSettingsInput {
322
426
  */
323
427
  clientTools?: RaizWidgetClientTool[];
324
428
  consentText?: string;
429
+ /**
430
+ * Corner radius of fields and buttons, in pixels; 24 makes pill-shaped
431
+ * buttons. Null: derived from `radius`.
432
+ */
433
+ controlRadius?: number | null;
325
434
  /**
326
435
  * A stylesheet applied inside the panel only; the launcher uses the style
327
436
  * fields.
328
437
  */
329
438
  customCss?: string;
330
439
  /**
331
- * Up to 12 pre-chat form fields with unique names.
440
+ * Field errors and failures the visitor must see. A color in `#RRGGBB` form.
441
+ */
442
+ errorColor?: string;
443
+ /**
444
+ * Up to 40 form fields with unique names, asked before the conversation (or
445
+ * alone, in `form` mode).
332
446
  */
333
447
  fields?: RaizWidgetField[];
334
448
  firstMessageLabel?: string;
449
+ /**
450
+ * The text typeface: `arbol` (bundled), `system` (the device's), `serif`,
451
+ * `rounded`, `page` (the embedding page's) or `custom` (`fontFamily`, with an
452
+ * optional `fontUrl`).
453
+ */
335
454
  font?: "arbol" | "system" | "serif" | "rounded" | "page" | "custom";
455
+ /**
456
+ * The CSS font-family of `font: custom`.
457
+ */
336
458
  fontFamily?: string;
337
459
  fontSize?: number;
338
460
  fontUrl?: RaizHttpsUrl | null;
@@ -346,6 +468,30 @@ export interface RaizWidgetSettingsInput {
346
468
  * A color in `#RRGGBB` form.
347
469
  */
348
470
  headerTextColor?: string;
471
+ /**
472
+ * The headings' typeface: `text` (the same as `font`) or one of `font`'s
473
+ * choices, with `headingFontFamily` and `headingFontUrl` for `custom`.
474
+ */
475
+ headingFont?: "text" | "arbol" | "system" | "serif" | "rounded" | "page" | "custom";
476
+ /**
477
+ * The CSS font-family of `headingFont: custom`.
478
+ */
479
+ headingFontFamily?: string;
480
+ headingFontUrl?: RaizHttpsUrl | null;
481
+ /**
482
+ * The headings' weight, from 300 (light) to 800 (heavy).
483
+ */
484
+ headingWeight?: number;
485
+ /**
486
+ * The border of form fields and of the message box. A color in `#RRGGBB`
487
+ * form, or null to derive it.
488
+ */
489
+ inputBorderColor?: string | null;
490
+ /**
491
+ * The background of form fields and of the message box. A color in `#RRGGBB`
492
+ * form, or null to derive it.
493
+ */
494
+ inputColor?: string | null;
349
495
  /**
350
496
  * The visitor interface language when the browser asks for none of the
351
497
  * translated ones.
@@ -358,6 +504,11 @@ export interface RaizWidgetSettingsInput {
358
504
  * accessible name.
359
505
  */
360
506
  launcherStyle?: "icon" | "label";
507
+ /**
508
+ * Links; null: `primaryColor`. A color in `#RRGGBB` form, or null to derive
509
+ * it.
510
+ */
511
+ linkColor?: string | null;
361
512
  logoObjectKey?: string | null;
362
513
  /**
363
514
  * Visitor messages per session.
@@ -369,6 +520,11 @@ export interface RaizWidgetSettingsInput {
369
520
  * `form-chat`: the form, then the conversation.
370
521
  */
371
522
  mode?: "chat" | "form" | "form-chat";
523
+ /**
524
+ * Secondary text: descriptions, hints and times. A color in `#RRGGBB` form,
525
+ * or null to derive it.
526
+ */
527
+ mutedTextColor?: string | null;
372
528
  position?: "left" | "right";
373
529
  /**
374
530
  * A color in `#RRGGBB` form.
@@ -412,9 +568,25 @@ export interface RaizWidgetSettingsInput {
412
568
  translations?: RaizWidgetTranslations;
413
569
  turnsPerDay?: number;
414
570
  /**
415
- * A color in `#RRGGBB` form.
571
+ * Text on `primaryColor`: buttons and the launcher. A color in `#RRGGBB`
572
+ * form.
416
573
  */
417
574
  userTextColor?: string;
575
+ /**
576
+ * Background of the visitor's own messages; null: a light tint of
577
+ * `textColor`. A color in `#RRGGBB` form, or null to derive it.
578
+ */
579
+ visitorColor?: string | null;
580
+ /**
581
+ * Text of the visitor's own messages; null: `textColor`. A color in `#RRGGBB`
582
+ * form, or null to derive it.
583
+ */
584
+ visitorTextColor?: string | null;
585
+ /**
586
+ * Let visitors record a voice message; Raíz transcribes it and the Agent
587
+ * answers the transcript.
588
+ */
589
+ voiceMessages?: boolean;
418
590
  welcomeText?: string;
419
591
  welcomeTitle?: string;
420
592
  }
@@ -456,6 +456,13 @@ export interface RaizFailureResponse {
456
456
  };
457
457
  message: "This Agent cannot serve this channel: voice channels need a voice Agent; WhatsApp and web channels need a text Agent.";
458
458
  retryable: false;
459
+ } | {
460
+ code: "CHANNEL_CREATION_IN_APP";
461
+ data: {
462
+ [key: string]: unknown;
463
+ };
464
+ message: "An AI tool creates website chats and forms only. A person adds WhatsApp numbers and phone numbers in Settings → Channels, or through the REST API.";
465
+ retryable: false;
459
466
  } | {
460
467
  code: "CHANNEL_AGENT_REQUIRED";
461
468
  data: {
@@ -813,6 +820,13 @@ export interface RaizFailureResponse {
813
820
  };
814
821
  message: "This widget session is unavailable.";
815
822
  retryable: false;
823
+ } | {
824
+ code: "WIDGET_VOICE_UNHEARD";
825
+ data: {
826
+ [key: string]: unknown;
827
+ };
828
+ message: "The voice message could not be understood. Record it again or write the message.";
829
+ retryable: false;
816
830
  } | {
817
831
  code: "ADDRESS_IN_USE";
818
832
  data: {
@@ -14,12 +14,14 @@ export interface Client {
14
14
  * Get the numbers behind a question. `name`: `conversations_daily`
15
15
  * (conversations the AI took part in, per day), `booking_outcomes` (verified
16
16
  * saved booking receipts by completion day and integration, excluding tests,
17
- * imports and deleted conversations; new bookings, reschedules,
18
- * cancellations, failures, pending and unverified results separately),
19
- * `tool_calls_daily` (Agent tool calls per day), `tool_calls` (each call,
20
- * newest first), `assessment_results_daily` (assessment results per day),
21
- * each over days in the organization's time zone (`from`, `to`; the last 30
22
- * days by default), or `campaign_progress`. Narrow with `agentId`,
17
+ * imports and deleted conversations; createdCount counts new appointments
18
+ * created by the AI, not confirmations of existing appointments;
19
+ * confirmedCount is its compatibility alias and must not be added again;
20
+ * reschedules, cancellations, failures, pending and unverified results
21
+ * separately), `tool_calls_daily` (Agent tool calls per day), `tool_calls`
22
+ * (each call, newest first), `assessment_results_daily` (assessment results
23
+ * per day), each over days in the organization's time zone (`from`, `to`; the
24
+ * last 30 days by default), or `campaign_progress`. Narrow with `agentId`,
23
25
  * `channelType`, `campaignId` or `definitionId`; unsupported filters fail. At
24
26
  * most 1000 rows: `hasMore` means split the range or filter. Booking outcomes
25
27
  * return no partial totals when their evidence scan exceeds its bound.
@@ -63,6 +63,7 @@ export type RaizReport = {
63
63
  agentName: string | null;
64
64
  cancelledCount: number;
65
65
  confirmedCount: number;
66
+ createdCount: number;
66
67
  day: Temporal.PlainDate;
67
68
  duplicateCount: number;
68
69
  failedCount: number;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@arbol-ai/sdk",
3
- "version": "2.4.0",
3
+ "version": "2.5.0",
4
4
  "description": "The Arbol API for TypeScript and JavaScript, generated by Cloudflare Forge from the platform's public OpenAPI.",
5
5
  "keywords": [
6
6
  "arbol",
@@ -50,8 +50,8 @@
50
50
  "packageManager": "bun@1.4.3",
51
51
  "arbol": {
52
52
  "openapi": {
53
- "release": "1.20261020.162831",
54
- "sha256": "3c0996ddbfb92924b8d8bc8f0ccaef401eb19e2f6168ec412558a37cf0709240"
53
+ "release": "1.20261021.53505",
54
+ "sha256": "3dbd465d9ddac7ecd1b00c5694419214ef02e6aa3925085dabaea80077fbfcca"
55
55
  }
56
56
  }
57
57
  }