@tai42/api-client 23.0.0 → 24.0.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.
Files changed (37) hide show
  1. package/dist/client/conversations-client.d.ts +190 -20
  2. package/dist/client/conversations-client.d.ts.map +1 -1
  3. package/dist/client/index.d.ts +194 -24
  4. package/dist/client/index.d.ts.map +1 -1
  5. package/dist/client/states-client.d.ts +2 -2
  6. package/dist/client/tools-client.d.ts +2 -2
  7. package/dist/generated/api-routes.d.ts +12 -0
  8. package/dist/generated/api-routes.d.ts.map +1 -1
  9. package/dist/generated/api-routes.js +3 -0
  10. package/dist/generated/api-routes.js.map +1 -1
  11. package/dist/generated/openapi-schemas.d.ts +1070 -52
  12. package/dist/generated/openapi-schemas.d.ts.map +1 -1
  13. package/dist/generated/openapi-schemas.js +24 -11
  14. package/dist/generated/openapi-schemas.js.map +1 -1
  15. package/dist/generated/served-schemas.d.ts +535 -72
  16. package/dist/generated/served-schemas.d.ts.map +1 -1
  17. package/dist/generated/served-schemas.js +501 -80
  18. package/dist/generated/served-schemas.js.map +1 -1
  19. package/dist/schemas/conversations.d.ts +360 -23
  20. package/dist/schemas/conversations.d.ts.map +1 -1
  21. package/dist/schemas/conversations.js +24 -9
  22. package/dist/schemas/conversations.js.map +1 -1
  23. package/dist/schemas/interactions.d.ts +47 -9
  24. package/dist/schemas/interactions.d.ts.map +1 -1
  25. package/dist/schemas/interactions.js +28 -7
  26. package/dist/schemas/interactions.js.map +1 -1
  27. package/dist/schemas/served.d.ts +492 -70
  28. package/dist/schemas/served.d.ts.map +1 -1
  29. package/dist/schemas/states.d.ts +4 -4
  30. package/dist/schemas/tools.d.ts +4 -4
  31. package/dist/tool-runs.d.ts +2 -2
  32. package/package.json +1 -1
  33. package/src/generated/api-routes.ts +3 -0
  34. package/src/generated/openapi-schemas.ts +44 -11
  35. package/src/generated/served-schemas.ts +503 -80
  36. package/src/schemas/conversations.ts +24 -9
  37. package/src/schemas/interactions.ts +28 -7
@@ -34,6 +34,12 @@ export type ConversationMode = z.infer<typeof conversationMode>;
34
34
  * never send. `merged` and `superseded` are the overlap-policy outcomes: this
35
35
  * record's text was carried into (`merged`) or dropped in favour of (`superseded`)
36
36
  * a later turn, named by `successor_id`; both are terminal and never send.
37
+ * A send record starts `sending` once it is written and its send has begun, and
38
+ * becomes `outcome_unknown` when the send never reported an outcome (it passed its
39
+ * bound, it was cancelled mid-call, or the process stopped), so the message may or may
40
+ * not have reached the participant; `outcome_unknown` is terminal, never re-sent, and
41
+ * surfaced as loudly as `failed`. A `sending` record is not in the thread index, so no transcript, thread
42
+ * list or search ever shows one.
37
43
  */
38
44
  export const conversationDeliveryStatus = openapi.deliveryStatus;
39
45
  export type ConversationDeliveryStatus = z.infer<typeof conversationDeliveryStatus>;
@@ -46,8 +52,10 @@ export type ConversationAnswerStatus = z.infer<typeof conversationAnswerStatus>;
46
52
 
47
53
  /**
48
54
  * Who authored a record's outgoing side. `client` is the ordinary turn the flow
49
- * answered; `operator` is a message a human sent into the thread, whose text
50
- * rides `answer` (its `inbound_text` is empty).
55
+ * answered; `operator` is a message a human sent into the thread; `send` is a
56
+ * message the platform sent on its own (a notification, an ask, a notice), named
57
+ * by `sent_by`. An `operator` or `send` record answers no message: its text rides
58
+ * `answer` and its `inbound_text` is empty.
51
59
  */
52
60
  export const conversationRecordOrigin = openapi.conversationRecordView.shape.origin;
53
61
  export type ConversationRecordOrigin = z.infer<typeof conversationRecordOrigin>;
@@ -90,13 +98,20 @@ export const conversationThreadsPage = openapi.threadSummaryEnvelope;
90
98
  export type ConversationThreadsPage = z.infer<typeof conversationThreadsPage>;
91
99
 
92
100
  /**
93
- * One exchange: the visitor's `inbound_text` — every record answers a message, so
94
- * both projections always carry it — and the agent's `answer`, plus where that
95
- * answer's delivery stands. `successor_id` names the later turn a `merged` or
96
- * `superseded` record was folded into, `null` on every other outcome. The delivery
97
- * bookkeeping fields (`channel`, `our_identity`, `provider_message_id`, `callback_url`,
98
- * `error`, `outbound_message_ids`, `attempts`) are ADMIN ONLY — the same door serves a
99
- * caller-scoped projection that withholds them, read here as `null`.
101
+ * One exchange: the visitor's `inbound_text` and the agent's `answer`, plus where
102
+ * that answer's delivery stands. An `operator` or `send` record answers no message,
103
+ * so its `inbound_text` is empty and its text rides `answer`. A send record names
104
+ * what sent it in `sent_by`, and carries `turn_message_id` when it was sent during a
105
+ * turn to that turn's own participant; an ask's send record carries `ask`, and the
106
+ * participant's reply over the channel in `ask_reply`, whose `answer` is `null` for a
107
+ * sensitive ask. `inbound_reply_to` and `ask_reply.reply_to` name the earlier message
108
+ * the visitor's message or the reply quotes, with its text when the thread holds it.
109
+ * `successor_id` names the later turn a `merged` or `superseded` record was folded
110
+ * into, `null` on every other outcome. The delivery bookkeeping fields (`channel`,
111
+ * `our_identity`, `provider_message_id`, `callback_url`, `error`, `attempts`, the
112
+ * per-part `sends`, every `ask` field but `sensitive` and every `ask_reply` field but
113
+ * `answer` and `reply_to`) are ADMIN ONLY — the same door serves a caller-scoped
114
+ * projection that withholds them, read here as `null` (`sends` as an empty list).
100
115
  */
101
116
  export const conversationMessage = openapi.conversationRecordView;
102
117
  export type ConversationMessage = z.infer<typeof conversationMessage>;
@@ -119,11 +119,26 @@ export type FormPages = z.infer<typeof formPages>;
119
119
  * One form field's platform-drawn words (`wording.form.fields[name]`): `choice_label` is
120
120
  * the placeholder of the field's picker (its empty-state prompt); `invalid` is the
121
121
  * sentence shown when the field's value does not have its declared shape (never for a
122
- * missing required value).
122
+ * missing required value: that is `required`); `required` is the sentence shown when the
123
+ * field's required value is missing (at the field or anywhere inside it); `true_label` /
124
+ * `false_label` are a boolean field's words for its two values; `length_hint` is the hint
125
+ * under a text control with a maximum length (its `{max}` token is the maximum);
126
+ * `add_item` / `remove_item` / `item_label` / `no_items` are a free-text list field's add
127
+ * button, each item's remove button, each item's label (its `{n}` token is the item's
128
+ * number) and its empty-list line. The inbox reads `choice_label`, `invalid`, `required`,
129
+ * the boolean words (in the readback) and the list words; `length_hint` parses unused.
123
130
  */
124
131
  export const fieldWording = z.object({
125
132
  choice_label: z.string().nullish(),
126
133
  invalid: z.string().nullish(),
134
+ required: z.string().nullish(),
135
+ true_label: z.string().nullish(),
136
+ false_label: z.string().nullish(),
137
+ length_hint: z.string().nullish(),
138
+ add_item: z.string().nullish(),
139
+ remove_item: z.string().nullish(),
140
+ item_label: z.string().nullish(),
141
+ no_items: z.string().nullish(),
127
142
  });
128
143
  export type FieldWording = z.infer<typeof fieldWording>;
129
144
 
@@ -131,9 +146,14 @@ export type FieldWording = z.infer<typeof fieldWording>;
131
146
  * A form's platform-drawn chrome (`wording.form`): `title` heads the form surface;
132
147
  * `open`/`cancel` label the buttons that open and close it; `back` the button that returns
133
148
  * to the previous step; `submit` the terminal button of a form with no pages;
134
- * `review_empty` the review step's line before anything is filled; `fields` carries
149
+ * `review_empty` the review step's line before anything is filled; `error_line` the one
150
+ * line shown above a refused form in place of a per-field summary; `update_failed` the
151
+ * sentence shown when the form could not update (its optional `{reason}` token is the
152
+ * reaction door's reason); `step_progress` a stepped form's progress line (its `{step}` and
153
+ * `{steps}` tokens are the current step's number and the step count); `fields` carries
135
154
  * per-field words keyed by property name. The inbox draws the form inline, so it reads
136
- * `back`, `submit` and `fields`; `title`/`open`/`cancel`/`review_empty` parse unused.
155
+ * `back`, `submit`, `update_failed`, `step_progress` and `fields`; `title`/`open`/`cancel`/
156
+ * `review_empty`/`error_line` parse unused (the inbox shows each error at its field).
137
157
  */
138
158
  export const formWording = z.object({
139
159
  title: z.string().nullish(),
@@ -142,6 +162,9 @@ export const formWording = z.object({
142
162
  back: z.string().nullish(),
143
163
  submit: z.string().nullish(),
144
164
  review_empty: z.string().nullish(),
165
+ error_line: z.string().nullish(),
166
+ update_failed: z.string().nullish(),
167
+ step_progress: z.string().nullish(),
145
168
  fields: z.record(z.string(), fieldWording).nullish(),
146
169
  });
147
170
  export type FormWording = z.infer<typeof formWording>;
@@ -201,15 +224,13 @@ export type PageCopy = z.infer<typeof pageCopy>;
201
224
 
202
225
  /**
203
226
  * The form page's own sentences (`wording.answer_page.form`): `failed` when a send did not
204
- * land, `network_error` when the browser could not reach the server, `update_failed` when a
205
- * reacting form could not refresh, `choose_one` for an empty required multi-choice, and
206
- * `date_unavailable` for a blocked date. Drawn by the callback form page; the inbox draws
227
+ * land, `network_error` when the browser could not reach the server, `choose_one` for an
228
+ * empty required multi-choice, and `date_unavailable` for a blocked date. Drawn by the callback form page; the inbox draws
207
229
  * none of them.
208
230
  */
209
231
  export const formPageWording = z.object({
210
232
  failed: z.string().nullish(),
211
233
  network_error: z.string().nullish(),
212
- update_failed: z.string().nullish(),
213
234
  choose_one: z.string().nullish(),
214
235
  date_unavailable: z.string().nullish(),
215
236
  });