@arbol-ai/sdk 2.8.0 → 2.10.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.
@@ -1,5 +1,5 @@
1
1
  import { type BaseClientOptions, type RequestOptions, Transport } from "../../_/index.js";
2
- import type { ResponseMetadata } from "../../models.js";
2
+ import type { DeletedObject, ResponseMetadata } from "../../models.js";
3
3
  import type { RaizCount } from "../models.js";
4
4
  import { type RaizConversation, type RaizConversationPage } from "./models.js";
5
5
  export interface ClientOptions extends BaseClientOptions {
@@ -32,6 +32,14 @@ export interface Client {
32
32
  * use `get_report`.
33
33
  */
34
34
  count(request?: CountRequest, options?: RequestOptions): Promise<CountResponse>;
35
+ /**
36
+ * Delete a conversation
37
+ *
38
+ * Delete a closed conversation: it leaves every list and report, its
39
+ * transcript and facts are kept, and the history records who deleted it. Not
40
+ * an AI tool.
41
+ */
42
+ delete(request: DeleteRequest, options?: RequestOptions): Promise<DeleteResponse>;
35
43
  /**
36
44
  * Get a conversation
37
45
  *
@@ -197,6 +205,18 @@ export interface CountResponse {
197
205
  metadata: ResponseMetadata;
198
206
  success: true;
199
207
  }
208
+ export interface DeleteRequest {
209
+ /**
210
+ * Conversation id.
211
+ */
212
+ conversationId: string;
213
+ }
214
+ export interface DeleteResponse {
215
+ data: DeletedObject;
216
+ error: null;
217
+ metadata: ResponseMetadata;
218
+ success: true;
219
+ }
200
220
  export interface GetRequest {
201
221
  /**
202
222
  * Conversation id.
@@ -9,6 +9,7 @@ export function bind(transport) {
9
9
  return {
10
10
  continue: (request, options) => transport.send(ContinueOperation, request, options),
11
11
  count: (request, options) => transport.send(CountOperation, request, options),
12
+ delete: (request, options) => transport.send(DeleteOperation, request, options),
12
13
  get: (request, options) => transport.send(GetOperation, request, options),
13
14
  list: (request, options) => transport.send(ListOperation, request, options),
14
15
  update: (request, options) => transport.send(UpdateOperation, request, options),
@@ -28,6 +29,13 @@ const CountOperation = {
28
29
  response: null,
29
30
  errors: { "400": true, "401": true, "403": true, "404": true, "405": true, "413": true, "415": true, "429": true, "500": true, "502": true, "503": true, "504": true },
30
31
  };
32
+ const DeleteOperation = {
33
+ method: "DELETE",
34
+ route: "/v1/raiz/conversations/delete",
35
+ body: "flat",
36
+ response: null,
37
+ errors: { "400": true, "401": true, "403": true, "404": true, "405": true, "409": true, "413": true, "415": true, "429": true, "500": true, "502": true, "503": true, "504": true },
38
+ };
31
39
  const GetOperation = {
32
40
  method: "GET",
33
41
  route: "/v1/raiz/conversations/get",
@@ -1,5 +1,5 @@
1
1
  export { ApiError } from "../../_/index.js";
2
2
  export type { RequestOptions } from "../../_/index.js";
3
3
  export { createClient } from "./client.js";
4
- export type { Client, ClientOptions, ContinueRequest, ContinueResponse, CountRequest, CountResponse, GetRequest, GetResponse, ListRequest, ListResponse, UpdateRequest, UpdateResponse, } from "./client.js";
4
+ export type { Client, ClientOptions, ContinueRequest, ContinueResponse, CountRequest, CountResponse, DeleteRequest, DeleteResponse, GetRequest, GetResponse, ListRequest, ListResponse, UpdateRequest, UpdateResponse, } from "./client.js";
5
5
  export type { RaizConversation, RaizConversationPage, RaizConversationWorker, RaizMessage, RaizMessagePage, RaizSignedUrl, } from "./models.js";
@@ -8,15 +8,26 @@ export interface ClientOptions extends BaseClientOptions {
8
8
  baseUrl: string;
9
9
  }
10
10
  export interface Client {
11
+ /**
12
+ * Record Agent feedback
13
+ *
14
+ * Record internal feedback on one completed WhatsApp Agent reply: what should
15
+ * be preserved or changed, a preferred response, and whether it was
16
+ * incorrect, incomplete or could be simpler. Requires conversation write and
17
+ * Agent read access. Does not contact anyone or change live instructions.
18
+ * Repeating creation returns the existing authored case; edit it with
19
+ * updateEvalCase and expectedVersion.
20
+ */
21
+ create(request: CreateRequest, options?: RequestOptions): Promise<CreateResponse>;
11
22
  /**
12
23
  * List evaluation cases
13
24
  *
14
- * The Agents' evaluation cases, newest first: each is a WhatsApp reply the
15
- * model wrote after which a person from the business wrote in the
16
- * conversation (`correction`), with the Agent version that wrote it. Filter
17
- * by `agentId` or `status` (`open` not reviewed yet, `kept`, `dismissed`).
18
- * Read the conversation with its own operations to judge a case. Not an AI
19
- * tool.
25
+ * The Agents' evaluation cases, newest first: completed WhatsApp replies with
26
+ * explicit internal team feedback (`authored`) or a following team message
27
+ * (`correction`), and the Agent version that wrote each reply. Filter by
28
+ * agentId, replyMessageId, source or status (`open`, `kept`, `dismissed`).
29
+ * Requires conversation read authority as well as Agent read authority. Read
30
+ * the conversation with its own operations to judge a case. Not an AI tool.
20
31
  */
21
32
  list(request?: ListRequest, options?: RequestOptions): Promise<ListResponse>;
22
33
  /**
@@ -31,6 +42,33 @@ export interface Client {
31
42
  }
32
43
  export declare function createClient(options: ClientOptions): Client;
33
44
  export declare function bind(transport: Transport): Client;
45
+ export interface CreateRequest {
46
+ /**
47
+ * Conversation id.
48
+ */
49
+ conversationId: string;
50
+ /**
51
+ * What the Agent should have done instead, for whoever replays the case: a
52
+ * short rubric, never the contact's personal data.
53
+ */
54
+ expectation: string;
55
+ feedbackKind: "incorrect" | "simpler" | "incomplete";
56
+ /**
57
+ * The team's preferred reply or procedure. Private evidence, never
58
+ * automatically instructions.
59
+ */
60
+ preferredResponse: string;
61
+ /**
62
+ * Message id.
63
+ */
64
+ replyMessageId: string;
65
+ }
66
+ export interface CreateResponse {
67
+ data: RaizEvalCase;
68
+ error: null;
69
+ metadata: ResponseMetadata;
70
+ success: true;
71
+ }
34
72
  export interface ListRequest {
35
73
  /**
36
74
  * Opaque cursor returned by pageInfo; omit it to request the first page.
@@ -55,6 +93,11 @@ export interface ListRequest {
55
93
  * example).
56
94
  */
57
95
  status?: "open" | "kept" | "dismissed";
96
+ /**
97
+ * Message id.
98
+ */
99
+ replyMessageId?: string;
100
+ source?: "correction" | "sample" | "authored";
58
101
  }
59
102
  export interface ListResponse {
60
103
  data: RaizEvalCasePage;
@@ -68,6 +111,13 @@ export interface UpdateRequest {
68
111
  */
69
112
  evalCaseId: string;
70
113
  expectation?: string | null;
114
+ /**
115
+ * The `version` you read. When present, the change applies only if nobody
116
+ * changed the resource since; otherwise it fails with VERSION_CONFLICT.
117
+ */
118
+ expectedVersion?: number;
119
+ feedbackKind?: "incorrect" | "simpler" | "incomplete";
120
+ preferredResponse?: string | null;
71
121
  /**
72
122
  * `open`: not reviewed yet. `kept`: a candidate version must handle it.
73
123
  * `dismissed`: not a case (the person only continued after a handoff, for
@@ -7,14 +7,22 @@ export function createClient(options) {
7
7
  }
8
8
  export function bind(transport) {
9
9
  return {
10
+ create: (request, options) => transport.send(CreateOperation, request, options),
10
11
  list: (request, options) => transport.send(ListOperation, request, options),
11
12
  update: (request, options) => transport.send(UpdateOperation, request, options),
12
13
  };
13
14
  }
15
+ const CreateOperation = {
16
+ method: "POST",
17
+ route: "/v1/raiz/eval-cases/create",
18
+ body: "flat",
19
+ response: object([["data", null, () => RaizEvalCaseCodec]]),
20
+ errors: { "400": true, "401": true, "403": true, "404": true, "405": true, "413": true, "415": true, "429": true, "500": true, "502": true, "503": true, "504": true },
21
+ };
14
22
  const ListOperation = {
15
23
  method: "GET",
16
24
  route: "/v1/raiz/eval-cases",
17
- query: { cursor: "cursor", direction: "direction", limit: "limit", agentId: "agentId", status: "status" },
25
+ query: { cursor: "cursor", direction: "direction", limit: "limit", agentId: "agentId", status: "status", replyMessageId: "replyMessageId", source: "source" },
18
26
  response: object([["data", null, () => RaizEvalCasePageCodec]]),
19
27
  errors: { "400": true, "401": true, "403": true, "404": true, "405": true, "413": true, "415": true, "429": true, "500": true, "502": true, "503": true, "504": true },
20
28
  };
@@ -23,5 +31,5 @@ const UpdateOperation = {
23
31
  route: "/v1/raiz/eval-cases/update",
24
32
  body: "flat",
25
33
  response: object([["data", null, () => RaizEvalCaseCodec]]),
26
- errors: { "400": true, "401": true, "403": true, "404": true, "405": true, "413": true, "415": true, "429": true, "500": true, "502": true, "503": true, "504": true },
34
+ errors: { "400": true, "401": true, "403": true, "404": true, "405": true, "409": true, "413": true, "415": true, "429": true, "500": true, "502": true, "503": true, "504": true },
27
35
  };
@@ -1,5 +1,5 @@
1
1
  export { ApiError } from "../../_/index.js";
2
2
  export type { RequestOptions } from "../../_/index.js";
3
3
  export { createClient } from "./client.js";
4
- export type { Client, ClientOptions, ListRequest, ListResponse, UpdateRequest, UpdateResponse, } from "./client.js";
4
+ export type { Client, ClientOptions, CreateRequest, CreateResponse, ListRequest, ListResponse, UpdateRequest, UpdateResponse, } from "./client.js";
5
5
  export type { RaizEvalCase, RaizEvalCasePage, } from "./models.js";
@@ -15,17 +15,20 @@ export interface RaizEvalCase {
15
15
  */
16
16
  createdAt: Temporal.Instant;
17
17
  expectation: string | null;
18
+ feedbackKind: "incorrect" | "simpler" | "incomplete" | null;
18
19
  /**
19
20
  * Evaluation case id.
20
21
  */
21
22
  id: string;
23
+ latestRunId: string | null;
24
+ preferredResponse: string | null;
22
25
  /**
23
26
  * Message id.
24
27
  */
25
28
  replyMessageId: string;
26
29
  /**
27
- * `correction`: a person wrote right after the reply. `sample` and `authored`
28
- * are reserved for sampled and hand-written cases.
30
+ * `correction`: a person wrote right after the reply. `authored`: explicit
31
+ * internal team feedback. `sample`: a sampled reply.
29
32
  */
30
33
  source: "correction" | "sample" | "authored";
31
34
  /**
@@ -38,6 +41,7 @@ export interface RaizEvalCase {
38
41
  * An instant in RFC 3339 format, in UTC.
39
42
  */
40
43
  updatedAt: Temporal.Instant;
44
+ version: number;
41
45
  }
42
46
  export interface RaizEvalCasePage {
43
47
  /**
@@ -12,9 +12,13 @@ export interface Client {
12
12
  /**
13
13
  * Replay evaluation cases on a candidate
14
14
  *
15
- * Measure a candidate version of a text Agent on its kept evaluation cases
16
- * before publishing it: the WhatsApp Agent rewrites each case's reply with
17
- * the candidate's `instructions`, `skills`, `integrationSkills`, `model` and
15
+ * With feedbackCaseId, prepare conditional guidance from that kept correction
16
+ * and test it with the Agent’s newest kept cases, always including the
17
+ * source. Do not combine feedbackCaseId with candidate or caseIds. This does
18
+ * not publish. Requires conversation read access. Otherwise measure a
19
+ * candidate version of a text Agent on its kept evaluation cases before
20
+ * publishing it: the WhatsApp Agent rewrites each case's reply with the
21
+ * candidate's `instructions`, `skills`, `integrationSkills`, `model` and
18
22
  * `reasoningEffort` (omitted ones stay as the live Agent has them), without
19
23
  * running any integration tool (each answers with what it answered in the
20
24
  * original conversation) and without sending anything; then a judge model
@@ -65,6 +69,10 @@ export interface CreateRequest {
65
69
  * reply, then a small judge model per case. Send `true` to accept that cost.
66
70
  */
67
71
  confirmCost: true;
72
+ /**
73
+ * Evaluation case id.
74
+ */
75
+ feedbackCaseId?: string;
68
76
  }
69
77
  export interface CreateResponse {
70
78
  data: RaizEvalRun;
@@ -3,6 +3,7 @@ export interface RaizEvalRun {
3
3
  * Agent id.
4
4
  */
5
5
  agentId: string;
6
+ baseVersion: number | null;
6
7
  baseVersionId: string | null;
7
8
  caseIds: string[];
8
9
  /**
@@ -22,11 +23,20 @@ export interface RaizEvalRun {
22
23
  */
23
24
  errors: number;
24
25
  failed: number;
26
+ feedbackCaseId: string | null;
27
+ feedbackCaseVersion: number | null;
25
28
  /**
26
29
  * Evaluation run id.
27
30
  */
28
31
  id: string;
29
32
  passed: number;
33
+ proposal: {
34
+ appliesWhen: string;
35
+ exceptions: string;
36
+ guidance: string;
37
+ replaceText?: string | null;
38
+ } | null;
39
+ proposedInstructions: string | null;
30
40
  results: {
31
41
  caseId: string;
32
42
  createdAt: Temporal.Instant;
@@ -741,6 +741,13 @@ export interface RaizFailureResponse {
741
741
  };
742
742
  message: "A bulletin must end after it starts, and a new one must end in the future.";
743
743
  retryable: false;
744
+ } | {
745
+ code: "FEEDBACK_PROPOSAL_UNAVAILABLE";
746
+ data: {
747
+ [key: string]: unknown;
748
+ };
749
+ message: "A usable improvement could not be prepared. The Agent has not changed. Try again later.";
750
+ retryable: true;
744
751
  } | {
745
752
  code: "EVAL_CASES_UNAVAILABLE";
746
753
  data: {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@arbol-ai/sdk",
3
- "version": "2.8.0",
3
+ "version": "2.10.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.20261023.13947",
54
- "sha256": "1c5faf8f909599f3c67cb00c9370946d6ffd505ee2885a7d62170f253b3c736d"
53
+ "release": "1.20261023.60554",
54
+ "sha256": "c05fa12d8b1bed4efd2d1e6a0e29a7dae23ee0e665b8117d08c7dc1d458876d4"
55
55
  }
56
56
  }
57
57
  }