@vinaverse/server 0.0.0-stage → 0.1.0-alpha.10
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/LICENSE +202 -0
- package/README.md +169 -2
- package/dist/api.cjs +546 -0
- package/dist/api.cjs.map +1 -0
- package/dist/api.d.cts +473 -0
- package/dist/api.d.ts +473 -0
- package/dist/api.js +534 -0
- package/dist/api.js.map +1 -0
- package/dist/chunk-FEEJNQXV.js +64 -0
- package/dist/chunk-FEEJNQXV.js.map +1 -0
- package/dist/chunk-GTPMQKGX.js +277 -0
- package/dist/chunk-GTPMQKGX.js.map +1 -0
- package/dist/chunk-NPXO6SMZ.js +84 -0
- package/dist/chunk-NPXO6SMZ.js.map +1 -0
- package/dist/chunk-SDJFZPHJ.js +141 -0
- package/dist/chunk-SDJFZPHJ.js.map +1 -0
- package/dist/express.cjs +397 -0
- package/dist/express.cjs.map +1 -0
- package/dist/express.d.cts +43 -0
- package/dist/express.d.ts +43 -0
- package/dist/express.js +87 -0
- package/dist/express.js.map +1 -0
- package/dist/fastify.cjs +363 -0
- package/dist/fastify.cjs.map +1 -0
- package/dist/fastify.d.cts +62 -0
- package/dist/fastify.d.ts +62 -0
- package/dist/fastify.js +54 -0
- package/dist/fastify.js.map +1 -0
- package/dist/hono.cjs +421 -0
- package/dist/hono.cjs.map +1 -0
- package/dist/hono.d.cts +21 -0
- package/dist/hono.d.ts +21 -0
- package/dist/hono.js +34 -0
- package/dist/hono.js.map +1 -0
- package/dist/index.cjs +1509 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.cts +196 -0
- package/dist/index.d.ts +196 -0
- package/dist/index.js +948 -0
- package/dist/index.js.map +1 -0
- package/dist/lambda.cjs +405 -0
- package/dist/lambda.cjs.map +1 -0
- package/dist/lambda.d.cts +53 -0
- package/dist/lambda.d.ts +53 -0
- package/dist/lambda.js +86 -0
- package/dist/lambda.js.map +1 -0
- package/dist/nonces-scwljZwl.d.cts +92 -0
- package/dist/nonces-scwljZwl.d.ts +92 -0
- package/dist/provider-CbLgJEXQ.d.ts +2193 -0
- package/dist/provider-ytczljc-.d.cts +2193 -0
- package/dist/stores.cjs +315 -0
- package/dist/stores.cjs.map +1 -0
- package/dist/stores.d.cts +52 -0
- package/dist/stores.d.ts +52 -0
- package/dist/stores.js +306 -0
- package/dist/stores.js.map +1 -0
- package/dist/testing.cjs +135 -0
- package/dist/testing.cjs.map +1 -0
- package/dist/testing.d.cts +29 -0
- package/dist/testing.d.ts +29 -0
- package/dist/testing.js +49 -0
- package/dist/testing.js.map +1 -0
- package/dist/vinaverse-v1.d-DT7a1T80.d.cts +3867 -0
- package/dist/vinaverse-v1.d-DT7a1T80.d.ts +3867 -0
- package/package.json +225 -3
|
@@ -0,0 +1,2193 @@
|
|
|
1
|
+
import { c as components$1, w as webhooks } from './vinaverse-v1.d-DT7a1T80.cjs';
|
|
2
|
+
import { c as NonceStore, a as IdempotencyStore } from './nonces-scwljZwl.cjs';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Why a delivery was refused, in the conformance vectors' words
|
|
6
|
+
* (vinaverse-contracts `conformance/webhooks.json`). Every one is answered with
|
|
7
|
+
* `400`, so Vinaverse retries it; none of them is ever a valid delivery.
|
|
8
|
+
*
|
|
9
|
+
* - `missing`: no `Vinaverse-Signature` header.
|
|
10
|
+
* - `malformed`: the header is not `t=<unix seconds>,v1=<hex>[,v1=<hex>]`
|
|
11
|
+
* (no single timestamp, or no `v1` signature).
|
|
12
|
+
* - `stale`: signed more than the tolerance (300 seconds) before or after now:
|
|
13
|
+
* a replay, or a clock far off.
|
|
14
|
+
* - `mismatch`: no `v1` signature matches the body with any secret: a wrong
|
|
15
|
+
* secret (or the secret without its `vv_whsec_` prefix), a changed body, or a
|
|
16
|
+
* body parsed and serialized again.
|
|
17
|
+
* - `invalid_body`: signed by Vinaverse, but not a webhook envelope this
|
|
18
|
+
* package can read.
|
|
19
|
+
*/
|
|
20
|
+
type WebhookErrorCode = 'missing' | 'malformed' | 'stale' | 'mismatch' | 'invalid_body';
|
|
21
|
+
interface WebhookError {
|
|
22
|
+
readonly code: WebhookErrorCode;
|
|
23
|
+
readonly message: string;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
type Schemas = components$1['schemas'];
|
|
27
|
+
/** The envelope every webhook body has. `data` depends on `type`. */
|
|
28
|
+
type WebhookEnvelope = Schemas['WebhookEnvelope'];
|
|
29
|
+
/** Every event type the targeted contract defines. */
|
|
30
|
+
type WebhookEventType = WebhookEnvelope['type'] & keyof webhooks;
|
|
31
|
+
type BodyOf<T extends WebhookEventType> = NonNullable<webhooks[T]['post']['requestBody']>['content']['application/json'];
|
|
32
|
+
/** One event of type `T`: the envelope, with `data` as the contract says. */
|
|
33
|
+
type WebhookEventOf<T extends WebhookEventType> = Omit<WebhookEnvelope, 'type' | 'data'> & {
|
|
34
|
+
type: T;
|
|
35
|
+
data: NonNullable<BodyOf<T>['data']>;
|
|
36
|
+
};
|
|
37
|
+
/** Any event this package version knows; narrow it on `type`. */
|
|
38
|
+
type WebhookEvent = {
|
|
39
|
+
[T in WebhookEventType]: WebhookEventOf<T>;
|
|
40
|
+
}[WebhookEventType];
|
|
41
|
+
type ConversationEventType = 'conversation.updated' | 'conversation.completed' | 'conversation.failed' | 'conversation.expired';
|
|
42
|
+
/** A guided-flow conversation's state changed: `data` is its `ConversationState`. */
|
|
43
|
+
type ConversationEvent = {
|
|
44
|
+
[T in ConversationEventType]: WebhookEventOf<T>;
|
|
45
|
+
}[ConversationEventType];
|
|
46
|
+
type ConversationState = Schemas['ConversationState'];
|
|
47
|
+
declare const WEBHOOK_EVENT_TYPES: readonly WebhookEventType[];
|
|
48
|
+
declare function isConversationEvent(event: WebhookEvent): event is ConversationEvent;
|
|
49
|
+
/** What a verified body is: a known event, a test delivery, or a type newer than this package. */
|
|
50
|
+
type ReadBody = {
|
|
51
|
+
kind: 'event';
|
|
52
|
+
event: WebhookEvent;
|
|
53
|
+
} | {
|
|
54
|
+
kind: 'test';
|
|
55
|
+
envelope: WebhookEnvelope;
|
|
56
|
+
} | {
|
|
57
|
+
kind: 'unrecognized';
|
|
58
|
+
envelope: WebhookEnvelope;
|
|
59
|
+
};
|
|
60
|
+
|
|
61
|
+
interface WebhookHandlerOptions {
|
|
62
|
+
/** The endpoint's signing secret, or two while rolling a new one out. */
|
|
63
|
+
secret: string | readonly string[];
|
|
64
|
+
/**
|
|
65
|
+
* Called once per verified delivery of a known event. Answer quickly (the
|
|
66
|
+
* contract allows 5 seconds) and do the work afterwards; deliveries are at
|
|
67
|
+
* least once, so deduplicate on `event.id`.
|
|
68
|
+
*/
|
|
69
|
+
onEvent(event: WebhookEvent): void | Promise<void>;
|
|
70
|
+
/** A test delivery from Studio; by default it is acknowledged and ignored. */
|
|
71
|
+
onTest?(envelope: WebhookEnvelope): void | Promise<void>;
|
|
72
|
+
/** A verified type newer than this package; by default acknowledged and ignored. */
|
|
73
|
+
onUnrecognized?(envelope: WebhookEnvelope): void | Promise<void>;
|
|
74
|
+
/** A refused delivery, for logging; it is answered 400 either way. */
|
|
75
|
+
onRejected?(error: WebhookError): void | Promise<void>;
|
|
76
|
+
/** How far from now a signature may be, in seconds; default 300. */
|
|
77
|
+
toleranceSeconds?: number;
|
|
78
|
+
/**
|
|
79
|
+
* The largest body accepted, in bytes; default 1 MiB (a conversation
|
|
80
|
+
* webhook is at most 64 KB). A larger one is answered 413 unread.
|
|
81
|
+
*/
|
|
82
|
+
maxBodyBytes?: number;
|
|
83
|
+
/** The clock; default the system clock. */
|
|
84
|
+
now?: () => Date;
|
|
85
|
+
}
|
|
86
|
+
interface WebhookResponse {
|
|
87
|
+
readonly status: 200 | 400 | 413;
|
|
88
|
+
readonly body: string;
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
declare const TOOL_OPERATIONS: {
|
|
92
|
+
readonly create_handoff: {
|
|
93
|
+
readonly id: "create_handoff";
|
|
94
|
+
readonly method: "POST";
|
|
95
|
+
readonly path: "/handoffs";
|
|
96
|
+
readonly effect: "write";
|
|
97
|
+
readonly maxResultBytes: 16384;
|
|
98
|
+
readonly successStatus: 201;
|
|
99
|
+
readonly idempotencyKey: true;
|
|
100
|
+
readonly body: true;
|
|
101
|
+
readonly pathParams: {};
|
|
102
|
+
readonly queryParams: {};
|
|
103
|
+
};
|
|
104
|
+
readonly create_proposal: {
|
|
105
|
+
readonly id: "create_proposal";
|
|
106
|
+
readonly method: "POST";
|
|
107
|
+
readonly path: "/proposals";
|
|
108
|
+
readonly effect: "propose";
|
|
109
|
+
readonly maxResultBytes: 16384;
|
|
110
|
+
readonly successStatus: 201;
|
|
111
|
+
readonly idempotencyKey: true;
|
|
112
|
+
readonly body: true;
|
|
113
|
+
readonly pathParams: {};
|
|
114
|
+
readonly queryParams: {};
|
|
115
|
+
};
|
|
116
|
+
readonly get_availability: {
|
|
117
|
+
readonly id: "get_availability";
|
|
118
|
+
readonly method: "GET";
|
|
119
|
+
readonly path: "/availability";
|
|
120
|
+
readonly effect: "read";
|
|
121
|
+
readonly maxResultBytes: 16384;
|
|
122
|
+
readonly successStatus: 200;
|
|
123
|
+
readonly idempotencyKey: false;
|
|
124
|
+
readonly body: false;
|
|
125
|
+
readonly pathParams: {};
|
|
126
|
+
readonly queryParams: {
|
|
127
|
+
readonly professional_id: {
|
|
128
|
+
readonly type: "string";
|
|
129
|
+
readonly required: true;
|
|
130
|
+
};
|
|
131
|
+
readonly service_id: {
|
|
132
|
+
readonly type: "string";
|
|
133
|
+
readonly required: true;
|
|
134
|
+
};
|
|
135
|
+
readonly from: {
|
|
136
|
+
readonly type: "string";
|
|
137
|
+
readonly required: true;
|
|
138
|
+
};
|
|
139
|
+
readonly to: {
|
|
140
|
+
readonly type: "string";
|
|
141
|
+
readonly required: true;
|
|
142
|
+
};
|
|
143
|
+
readonly limit: {
|
|
144
|
+
readonly type: "integer";
|
|
145
|
+
readonly required: false;
|
|
146
|
+
};
|
|
147
|
+
};
|
|
148
|
+
};
|
|
149
|
+
readonly get_flow_definition: {
|
|
150
|
+
readonly id: "get_flow_definition";
|
|
151
|
+
readonly method: "GET";
|
|
152
|
+
readonly path: "/flows/{flow}/definition";
|
|
153
|
+
readonly effect: "read";
|
|
154
|
+
readonly maxResultBytes: 131072;
|
|
155
|
+
readonly successStatus: 200;
|
|
156
|
+
readonly idempotencyKey: false;
|
|
157
|
+
readonly body: false;
|
|
158
|
+
readonly pathParams: {
|
|
159
|
+
readonly flow: {
|
|
160
|
+
readonly type: "string";
|
|
161
|
+
readonly required: true;
|
|
162
|
+
};
|
|
163
|
+
};
|
|
164
|
+
readonly queryParams: {
|
|
165
|
+
readonly version: {
|
|
166
|
+
readonly type: "integer";
|
|
167
|
+
readonly required: false;
|
|
168
|
+
};
|
|
169
|
+
};
|
|
170
|
+
};
|
|
171
|
+
readonly get_my_booking: {
|
|
172
|
+
readonly id: "get_my_booking";
|
|
173
|
+
readonly method: "GET";
|
|
174
|
+
readonly path: "/me/bookings/{id}";
|
|
175
|
+
readonly effect: "read";
|
|
176
|
+
readonly maxResultBytes: 16384;
|
|
177
|
+
readonly successStatus: 200;
|
|
178
|
+
readonly idempotencyKey: false;
|
|
179
|
+
readonly body: false;
|
|
180
|
+
readonly pathParams: {
|
|
181
|
+
readonly id: {
|
|
182
|
+
readonly type: "string";
|
|
183
|
+
readonly required: true;
|
|
184
|
+
};
|
|
185
|
+
};
|
|
186
|
+
readonly queryParams: {};
|
|
187
|
+
};
|
|
188
|
+
readonly get_my_kit: {
|
|
189
|
+
readonly id: "get_my_kit";
|
|
190
|
+
readonly method: "GET";
|
|
191
|
+
readonly path: "/me/kits/{id}";
|
|
192
|
+
readonly effect: "read";
|
|
193
|
+
readonly maxResultBytes: 16384;
|
|
194
|
+
readonly successStatus: 200;
|
|
195
|
+
readonly idempotencyKey: false;
|
|
196
|
+
readonly body: false;
|
|
197
|
+
readonly pathParams: {
|
|
198
|
+
readonly id: {
|
|
199
|
+
readonly type: "string";
|
|
200
|
+
readonly required: true;
|
|
201
|
+
};
|
|
202
|
+
};
|
|
203
|
+
readonly queryParams: {};
|
|
204
|
+
};
|
|
205
|
+
readonly get_my_order: {
|
|
206
|
+
readonly id: "get_my_order";
|
|
207
|
+
readonly method: "GET";
|
|
208
|
+
readonly path: "/me/orders/{id}";
|
|
209
|
+
readonly effect: "read";
|
|
210
|
+
readonly maxResultBytes: 16384;
|
|
211
|
+
readonly successStatus: 200;
|
|
212
|
+
readonly idempotencyKey: false;
|
|
213
|
+
readonly body: false;
|
|
214
|
+
readonly pathParams: {
|
|
215
|
+
readonly id: {
|
|
216
|
+
readonly type: "string";
|
|
217
|
+
readonly required: true;
|
|
218
|
+
};
|
|
219
|
+
};
|
|
220
|
+
readonly queryParams: {};
|
|
221
|
+
};
|
|
222
|
+
readonly get_policy: {
|
|
223
|
+
readonly id: "get_policy";
|
|
224
|
+
readonly method: "GET";
|
|
225
|
+
readonly path: "/policies/{topic}";
|
|
226
|
+
readonly effect: "read";
|
|
227
|
+
readonly maxResultBytes: 16384;
|
|
228
|
+
readonly successStatus: 200;
|
|
229
|
+
readonly idempotencyKey: false;
|
|
230
|
+
readonly body: false;
|
|
231
|
+
readonly pathParams: {
|
|
232
|
+
readonly topic: {
|
|
233
|
+
readonly type: "string";
|
|
234
|
+
readonly required: true;
|
|
235
|
+
};
|
|
236
|
+
};
|
|
237
|
+
readonly queryParams: {};
|
|
238
|
+
};
|
|
239
|
+
readonly get_professional: {
|
|
240
|
+
readonly id: "get_professional";
|
|
241
|
+
readonly method: "GET";
|
|
242
|
+
readonly path: "/professionals/{id}";
|
|
243
|
+
readonly effect: "read";
|
|
244
|
+
readonly maxResultBytes: 16384;
|
|
245
|
+
readonly successStatus: 200;
|
|
246
|
+
readonly idempotencyKey: false;
|
|
247
|
+
readonly body: false;
|
|
248
|
+
readonly pathParams: {
|
|
249
|
+
readonly id: {
|
|
250
|
+
readonly type: "string";
|
|
251
|
+
readonly required: true;
|
|
252
|
+
};
|
|
253
|
+
};
|
|
254
|
+
readonly queryParams: {};
|
|
255
|
+
};
|
|
256
|
+
readonly get_quote: {
|
|
257
|
+
readonly id: "get_quote";
|
|
258
|
+
readonly method: "POST";
|
|
259
|
+
readonly path: "/quotes";
|
|
260
|
+
readonly effect: "read";
|
|
261
|
+
readonly maxResultBytes: 16384;
|
|
262
|
+
readonly successStatus: 200;
|
|
263
|
+
readonly idempotencyKey: true;
|
|
264
|
+
readonly body: true;
|
|
265
|
+
readonly pathParams: {};
|
|
266
|
+
readonly queryParams: {};
|
|
267
|
+
};
|
|
268
|
+
readonly get_setup_state: {
|
|
269
|
+
readonly id: "get_setup_state";
|
|
270
|
+
readonly method: "GET";
|
|
271
|
+
readonly path: "/business/setup";
|
|
272
|
+
readonly effect: "read";
|
|
273
|
+
readonly maxResultBytes: 16384;
|
|
274
|
+
readonly successStatus: 200;
|
|
275
|
+
readonly idempotencyKey: false;
|
|
276
|
+
readonly body: false;
|
|
277
|
+
readonly pathParams: {};
|
|
278
|
+
readonly queryParams: {};
|
|
279
|
+
};
|
|
280
|
+
readonly get_workspace: {
|
|
281
|
+
readonly id: "get_workspace";
|
|
282
|
+
readonly method: "GET";
|
|
283
|
+
readonly path: "/workspaces/{id}";
|
|
284
|
+
readonly effect: "read";
|
|
285
|
+
readonly maxResultBytes: 16384;
|
|
286
|
+
readonly successStatus: 200;
|
|
287
|
+
readonly idempotencyKey: false;
|
|
288
|
+
readonly body: false;
|
|
289
|
+
readonly pathParams: {
|
|
290
|
+
readonly id: {
|
|
291
|
+
readonly type: "string";
|
|
292
|
+
readonly required: true;
|
|
293
|
+
};
|
|
294
|
+
};
|
|
295
|
+
readonly queryParams: {};
|
|
296
|
+
};
|
|
297
|
+
readonly list_my_bookings: {
|
|
298
|
+
readonly id: "list_my_bookings";
|
|
299
|
+
readonly method: "GET";
|
|
300
|
+
readonly path: "/me/bookings";
|
|
301
|
+
readonly effect: "read";
|
|
302
|
+
readonly maxResultBytes: 16384;
|
|
303
|
+
readonly successStatus: 200;
|
|
304
|
+
readonly idempotencyKey: false;
|
|
305
|
+
readonly body: false;
|
|
306
|
+
readonly pathParams: {};
|
|
307
|
+
readonly queryParams: {
|
|
308
|
+
readonly scope: {
|
|
309
|
+
readonly type: "string";
|
|
310
|
+
readonly required: false;
|
|
311
|
+
};
|
|
312
|
+
readonly limit: {
|
|
313
|
+
readonly type: "integer";
|
|
314
|
+
readonly required: false;
|
|
315
|
+
};
|
|
316
|
+
};
|
|
317
|
+
};
|
|
318
|
+
readonly list_my_kits: {
|
|
319
|
+
readonly id: "list_my_kits";
|
|
320
|
+
readonly method: "GET";
|
|
321
|
+
readonly path: "/me/kits";
|
|
322
|
+
readonly effect: "read";
|
|
323
|
+
readonly maxResultBytes: 16384;
|
|
324
|
+
readonly successStatus: 200;
|
|
325
|
+
readonly idempotencyKey: false;
|
|
326
|
+
readonly body: false;
|
|
327
|
+
readonly pathParams: {};
|
|
328
|
+
readonly queryParams: {
|
|
329
|
+
readonly scope: {
|
|
330
|
+
readonly type: "string";
|
|
331
|
+
readonly required: false;
|
|
332
|
+
};
|
|
333
|
+
readonly limit: {
|
|
334
|
+
readonly type: "integer";
|
|
335
|
+
readonly required: false;
|
|
336
|
+
};
|
|
337
|
+
};
|
|
338
|
+
};
|
|
339
|
+
readonly list_my_orders: {
|
|
340
|
+
readonly id: "list_my_orders";
|
|
341
|
+
readonly method: "GET";
|
|
342
|
+
readonly path: "/me/orders";
|
|
343
|
+
readonly effect: "read";
|
|
344
|
+
readonly maxResultBytes: 16384;
|
|
345
|
+
readonly successStatus: 200;
|
|
346
|
+
readonly idempotencyKey: false;
|
|
347
|
+
readonly body: false;
|
|
348
|
+
readonly pathParams: {};
|
|
349
|
+
readonly queryParams: {
|
|
350
|
+
readonly kit_id: {
|
|
351
|
+
readonly type: "string";
|
|
352
|
+
readonly required: false;
|
|
353
|
+
};
|
|
354
|
+
readonly limit: {
|
|
355
|
+
readonly type: "integer";
|
|
356
|
+
readonly required: false;
|
|
357
|
+
};
|
|
358
|
+
};
|
|
359
|
+
};
|
|
360
|
+
readonly list_services: {
|
|
361
|
+
readonly id: "list_services";
|
|
362
|
+
readonly method: "GET";
|
|
363
|
+
readonly path: "/catalog/services";
|
|
364
|
+
readonly effect: "read";
|
|
365
|
+
readonly maxResultBytes: 16384;
|
|
366
|
+
readonly successStatus: 200;
|
|
367
|
+
readonly idempotencyKey: false;
|
|
368
|
+
readonly body: false;
|
|
369
|
+
readonly pathParams: {};
|
|
370
|
+
readonly queryParams: {
|
|
371
|
+
readonly q: {
|
|
372
|
+
readonly type: "string";
|
|
373
|
+
readonly required: true;
|
|
374
|
+
};
|
|
375
|
+
readonly limit: {
|
|
376
|
+
readonly type: "integer";
|
|
377
|
+
readonly required: false;
|
|
378
|
+
};
|
|
379
|
+
};
|
|
380
|
+
};
|
|
381
|
+
readonly list_services_in_area: {
|
|
382
|
+
readonly id: "list_services_in_area";
|
|
383
|
+
readonly method: "GET";
|
|
384
|
+
readonly path: "/areas/services";
|
|
385
|
+
readonly effect: "read";
|
|
386
|
+
readonly maxResultBytes: 16384;
|
|
387
|
+
readonly successStatus: 200;
|
|
388
|
+
readonly idempotencyKey: false;
|
|
389
|
+
readonly body: false;
|
|
390
|
+
readonly pathParams: {};
|
|
391
|
+
readonly queryParams: {
|
|
392
|
+
readonly lat: {
|
|
393
|
+
readonly type: "number";
|
|
394
|
+
readonly required: false;
|
|
395
|
+
};
|
|
396
|
+
readonly lng: {
|
|
397
|
+
readonly type: "number";
|
|
398
|
+
readonly required: false;
|
|
399
|
+
};
|
|
400
|
+
readonly radius_miles: {
|
|
401
|
+
readonly type: "integer";
|
|
402
|
+
readonly required: false;
|
|
403
|
+
};
|
|
404
|
+
};
|
|
405
|
+
};
|
|
406
|
+
readonly resolve_place: {
|
|
407
|
+
readonly id: "resolve_place";
|
|
408
|
+
readonly method: "GET";
|
|
409
|
+
readonly path: "/places/resolve";
|
|
410
|
+
readonly effect: "read";
|
|
411
|
+
readonly maxResultBytes: 16384;
|
|
412
|
+
readonly successStatus: 200;
|
|
413
|
+
readonly idempotencyKey: false;
|
|
414
|
+
readonly body: false;
|
|
415
|
+
readonly pathParams: {};
|
|
416
|
+
readonly queryParams: {
|
|
417
|
+
readonly text: {
|
|
418
|
+
readonly type: "string";
|
|
419
|
+
readonly required: true;
|
|
420
|
+
};
|
|
421
|
+
readonly near_lat: {
|
|
422
|
+
readonly type: "number";
|
|
423
|
+
readonly required: false;
|
|
424
|
+
};
|
|
425
|
+
readonly near_lng: {
|
|
426
|
+
readonly type: "number";
|
|
427
|
+
readonly required: false;
|
|
428
|
+
};
|
|
429
|
+
};
|
|
430
|
+
};
|
|
431
|
+
readonly search_professionals: {
|
|
432
|
+
readonly id: "search_professionals";
|
|
433
|
+
readonly method: "GET";
|
|
434
|
+
readonly path: "/search/professionals";
|
|
435
|
+
readonly effect: "read";
|
|
436
|
+
readonly maxResultBytes: 16384;
|
|
437
|
+
readonly successStatus: 200;
|
|
438
|
+
readonly idempotencyKey: false;
|
|
439
|
+
readonly body: false;
|
|
440
|
+
readonly pathParams: {};
|
|
441
|
+
readonly queryParams: {
|
|
442
|
+
readonly q: {
|
|
443
|
+
readonly type: "string";
|
|
444
|
+
readonly required: false;
|
|
445
|
+
};
|
|
446
|
+
readonly category_id: {
|
|
447
|
+
readonly type: "string";
|
|
448
|
+
readonly required: false;
|
|
449
|
+
};
|
|
450
|
+
readonly service_type_id: {
|
|
451
|
+
readonly type: "string";
|
|
452
|
+
readonly required: false;
|
|
453
|
+
};
|
|
454
|
+
readonly lat: {
|
|
455
|
+
readonly type: "number";
|
|
456
|
+
readonly required: false;
|
|
457
|
+
};
|
|
458
|
+
readonly lng: {
|
|
459
|
+
readonly type: "number";
|
|
460
|
+
readonly required: false;
|
|
461
|
+
};
|
|
462
|
+
readonly radius_miles: {
|
|
463
|
+
readonly type: "integer";
|
|
464
|
+
readonly required: false;
|
|
465
|
+
};
|
|
466
|
+
readonly date: {
|
|
467
|
+
readonly type: "string";
|
|
468
|
+
readonly required: false;
|
|
469
|
+
};
|
|
470
|
+
readonly time_from: {
|
|
471
|
+
readonly type: "string";
|
|
472
|
+
readonly required: false;
|
|
473
|
+
};
|
|
474
|
+
readonly time_to: {
|
|
475
|
+
readonly type: "string";
|
|
476
|
+
readonly required: false;
|
|
477
|
+
};
|
|
478
|
+
readonly max_price: {
|
|
479
|
+
readonly type: "integer";
|
|
480
|
+
readonly required: false;
|
|
481
|
+
};
|
|
482
|
+
readonly min_rating_ppm: {
|
|
483
|
+
readonly type: "integer";
|
|
484
|
+
readonly required: false;
|
|
485
|
+
};
|
|
486
|
+
readonly sort: {
|
|
487
|
+
readonly type: "string";
|
|
488
|
+
readonly required: false;
|
|
489
|
+
};
|
|
490
|
+
readonly limit: {
|
|
491
|
+
readonly type: "integer";
|
|
492
|
+
readonly required: false;
|
|
493
|
+
};
|
|
494
|
+
readonly cursor: {
|
|
495
|
+
readonly type: "string";
|
|
496
|
+
readonly required: false;
|
|
497
|
+
};
|
|
498
|
+
};
|
|
499
|
+
};
|
|
500
|
+
readonly search_workspaces: {
|
|
501
|
+
readonly id: "search_workspaces";
|
|
502
|
+
readonly method: "GET";
|
|
503
|
+
readonly path: "/search/workspaces";
|
|
504
|
+
readonly effect: "read";
|
|
505
|
+
readonly maxResultBytes: 16384;
|
|
506
|
+
readonly successStatus: 200;
|
|
507
|
+
readonly idempotencyKey: false;
|
|
508
|
+
readonly body: false;
|
|
509
|
+
readonly pathParams: {};
|
|
510
|
+
readonly queryParams: {
|
|
511
|
+
readonly q: {
|
|
512
|
+
readonly type: "string";
|
|
513
|
+
readonly required: false;
|
|
514
|
+
};
|
|
515
|
+
readonly space_category: {
|
|
516
|
+
readonly type: "string";
|
|
517
|
+
readonly required: false;
|
|
518
|
+
};
|
|
519
|
+
readonly lat: {
|
|
520
|
+
readonly type: "number";
|
|
521
|
+
readonly required: false;
|
|
522
|
+
};
|
|
523
|
+
readonly lng: {
|
|
524
|
+
readonly type: "number";
|
|
525
|
+
readonly required: false;
|
|
526
|
+
};
|
|
527
|
+
readonly radius_miles: {
|
|
528
|
+
readonly type: "integer";
|
|
529
|
+
readonly required: false;
|
|
530
|
+
};
|
|
531
|
+
readonly max_price: {
|
|
532
|
+
readonly type: "integer";
|
|
533
|
+
readonly required: false;
|
|
534
|
+
};
|
|
535
|
+
readonly min_rating_ppm: {
|
|
536
|
+
readonly type: "integer";
|
|
537
|
+
readonly required: false;
|
|
538
|
+
};
|
|
539
|
+
readonly sort: {
|
|
540
|
+
readonly type: "string";
|
|
541
|
+
readonly required: false;
|
|
542
|
+
};
|
|
543
|
+
readonly limit: {
|
|
544
|
+
readonly type: "integer";
|
|
545
|
+
readonly required: false;
|
|
546
|
+
};
|
|
547
|
+
readonly cursor: {
|
|
548
|
+
readonly type: "string";
|
|
549
|
+
readonly required: false;
|
|
550
|
+
};
|
|
551
|
+
};
|
|
552
|
+
};
|
|
553
|
+
readonly submit_flow: {
|
|
554
|
+
readonly id: "submit_flow";
|
|
555
|
+
readonly method: "POST";
|
|
556
|
+
readonly path: "/flows/{flow}/submissions";
|
|
557
|
+
readonly effect: "write";
|
|
558
|
+
readonly maxResultBytes: 16384;
|
|
559
|
+
readonly successStatus: 200;
|
|
560
|
+
readonly idempotencyKey: false;
|
|
561
|
+
readonly body: true;
|
|
562
|
+
readonly pathParams: {
|
|
563
|
+
readonly flow: {
|
|
564
|
+
readonly type: "string";
|
|
565
|
+
readonly required: true;
|
|
566
|
+
};
|
|
567
|
+
};
|
|
568
|
+
readonly queryParams: {};
|
|
569
|
+
};
|
|
570
|
+
};
|
|
571
|
+
type ToolOperationId = keyof typeof TOOL_OPERATIONS;
|
|
572
|
+
|
|
573
|
+
interface components {
|
|
574
|
+
schemas: {
|
|
575
|
+
Money: {
|
|
576
|
+
amount: number;
|
|
577
|
+
currency: string;
|
|
578
|
+
};
|
|
579
|
+
Rating: {
|
|
580
|
+
/** @description e.g. 4.8 stars = 4800000 */
|
|
581
|
+
value_ppm: number;
|
|
582
|
+
count: number;
|
|
583
|
+
};
|
|
584
|
+
/** @description Public location only. Never a street address for a home-based professional unless the tenant shows it publicly. */
|
|
585
|
+
Area: {
|
|
586
|
+
neighborhood?: string;
|
|
587
|
+
city?: string;
|
|
588
|
+
region?: string;
|
|
589
|
+
/** @description distance × 10 from the search point, e.g. 8 = 0.8 mi */
|
|
590
|
+
distance_miles_x10?: number;
|
|
591
|
+
};
|
|
592
|
+
Place: {
|
|
593
|
+
name: string;
|
|
594
|
+
lat: number;
|
|
595
|
+
lng: number;
|
|
596
|
+
/** @enum {string} */
|
|
597
|
+
kind?: "neighborhood" | "city" | "address" | "landmark" | "region";
|
|
598
|
+
};
|
|
599
|
+
CatalogService: {
|
|
600
|
+
/** @constant */
|
|
601
|
+
type: "service_type";
|
|
602
|
+
id: string;
|
|
603
|
+
name: string;
|
|
604
|
+
category?: string;
|
|
605
|
+
category_id?: string;
|
|
606
|
+
synonyms?: string[];
|
|
607
|
+
};
|
|
608
|
+
ServiceOffer: {
|
|
609
|
+
/** @constant */
|
|
610
|
+
type: "service";
|
|
611
|
+
id: string;
|
|
612
|
+
name: string;
|
|
613
|
+
price: components["schemas"]["Money"];
|
|
614
|
+
/** @description true when the price is a starting price */
|
|
615
|
+
price_is_from?: boolean;
|
|
616
|
+
duration_minutes: number;
|
|
617
|
+
};
|
|
618
|
+
/**
|
|
619
|
+
* @description `estimate`: the tenant did not count exactly (a cached or sampled figure); the agent says "about"
|
|
620
|
+
* @enum {string}
|
|
621
|
+
*/
|
|
622
|
+
CountStatus: "exact" | "estimate";
|
|
623
|
+
InventoryService: {
|
|
624
|
+
id: string;
|
|
625
|
+
name: string;
|
|
626
|
+
count: number;
|
|
627
|
+
count_status: components["schemas"]["CountStatus"];
|
|
628
|
+
};
|
|
629
|
+
InventoryCategory: {
|
|
630
|
+
id: string;
|
|
631
|
+
name: string;
|
|
632
|
+
count: number;
|
|
633
|
+
count_status: components["schemas"]["CountStatus"];
|
|
634
|
+
services?: components["schemas"]["InventoryService"][];
|
|
635
|
+
};
|
|
636
|
+
NearbyArea: {
|
|
637
|
+
area: components["schemas"]["Area"];
|
|
638
|
+
lat?: number;
|
|
639
|
+
lng?: number;
|
|
640
|
+
count: number;
|
|
641
|
+
count_status: components["schemas"]["CountStatus"];
|
|
642
|
+
};
|
|
643
|
+
/** @description v1-draft.15, `list_services_in_area`'s result: what is represented around the place, and where else there is supply. Empty `categories` means nothing is offered within the radius; `nearest_areas` then says where there is. */
|
|
644
|
+
AreaInventory: {
|
|
645
|
+
/** @constant */
|
|
646
|
+
type: "area_inventory";
|
|
647
|
+
/**
|
|
648
|
+
* Format: date-time
|
|
649
|
+
* @description when the tenant counted
|
|
650
|
+
*/
|
|
651
|
+
as_of: string;
|
|
652
|
+
categories: components["schemas"]["InventoryCategory"][];
|
|
653
|
+
/** @description the nearest areas outside the radius that have supply, nearest first */
|
|
654
|
+
nearest_areas: components["schemas"]["NearbyArea"][];
|
|
655
|
+
};
|
|
656
|
+
/** @description v1-draft.15: one approved photo. `id` and `version` name the asset as the tenant's media store does: a new version is a new photo, and approval binds to the version, never to a mutable URL. The URL is https and starts with a prefix the manifest registers (`image_url_prefixes`), compared after the runtime parses and normalizes it: a URL with user info, a backslash, a fragment, or a `.` or `..` path segment (also percent-encoded, as `%2e`) is dropped, never resolved, so no path can step outside the approved one. `expires_at` is set only when the URL expires (a signed URL), and then the runtime drops it from a card it records after that time. */
|
|
657
|
+
ImageAsset: {
|
|
658
|
+
id: string;
|
|
659
|
+
version: string;
|
|
660
|
+
/** Format: uri */
|
|
661
|
+
url: string;
|
|
662
|
+
width?: number;
|
|
663
|
+
height?: number;
|
|
664
|
+
/** Format: date-time */
|
|
665
|
+
expires_at?: string;
|
|
666
|
+
};
|
|
667
|
+
ProfessionalSummary: {
|
|
668
|
+
/** @constant */
|
|
669
|
+
type: "professional";
|
|
670
|
+
id: string;
|
|
671
|
+
display_name: string;
|
|
672
|
+
headline?: string;
|
|
673
|
+
/** Format: uri */
|
|
674
|
+
photo_url?: string;
|
|
675
|
+
/** @description v1-draft.15, approved photos, the first the hero (`photo_url` is its URL) */
|
|
676
|
+
images?: components["schemas"]["ImageAsset"][];
|
|
677
|
+
rating?: components["schemas"]["Rating"];
|
|
678
|
+
area?: components["schemas"]["Area"];
|
|
679
|
+
/** @description v1-draft.15: the lowest price the professional asks for a service, as the tenant knows it; left out when it does not */
|
|
680
|
+
price_from?: components["schemas"]["Money"];
|
|
681
|
+
top_services?: components["schemas"]["ServiceOffer"][];
|
|
682
|
+
/** Format: date-time */
|
|
683
|
+
next_available?: string | null;
|
|
684
|
+
deep_link: string;
|
|
685
|
+
};
|
|
686
|
+
ProfessionalDetail: components["schemas"]["ProfessionalSummary"] & {
|
|
687
|
+
about?: string;
|
|
688
|
+
services?: components["schemas"]["ServiceOffer"][];
|
|
689
|
+
languages?: string[];
|
|
690
|
+
accepts_new_clients?: boolean;
|
|
691
|
+
/** @description workspace id */
|
|
692
|
+
works_at?: string | null;
|
|
693
|
+
};
|
|
694
|
+
WorkspaceSummary: {
|
|
695
|
+
/** @constant */
|
|
696
|
+
type: "workspace";
|
|
697
|
+
id: string;
|
|
698
|
+
title: string;
|
|
699
|
+
category?: string;
|
|
700
|
+
/** Format: uri */
|
|
701
|
+
photo_url?: string;
|
|
702
|
+
/** @description v1-draft.15, approved photos, the first the hero (`photo_url` is its URL) */
|
|
703
|
+
images?: components["schemas"]["ImageAsset"][];
|
|
704
|
+
rating?: components["schemas"]["Rating"];
|
|
705
|
+
area?: components["schemas"]["Area"];
|
|
706
|
+
price_from?: components["schemas"]["Money"];
|
|
707
|
+
/** @enum {string} */
|
|
708
|
+
price_unit?: "hour" | "day" | "week" | "month";
|
|
709
|
+
deep_link: string;
|
|
710
|
+
};
|
|
711
|
+
WorkspaceDetail: components["schemas"]["WorkspaceSummary"] & {
|
|
712
|
+
description?: string;
|
|
713
|
+
amenities?: string[];
|
|
714
|
+
suites_available?: number;
|
|
715
|
+
rules?: string;
|
|
716
|
+
};
|
|
717
|
+
Quote: {
|
|
718
|
+
/** @constant */
|
|
719
|
+
type: "quote";
|
|
720
|
+
id: string;
|
|
721
|
+
professional_id: string;
|
|
722
|
+
service_id: string;
|
|
723
|
+
/** Format: date-time */
|
|
724
|
+
start: string;
|
|
725
|
+
/** Format: date-time */
|
|
726
|
+
end: string;
|
|
727
|
+
total: components["schemas"]["Money"];
|
|
728
|
+
lines: {
|
|
729
|
+
/**
|
|
730
|
+
* @example Service
|
|
731
|
+
* @example Booking fee
|
|
732
|
+
* @example Tax
|
|
733
|
+
*/
|
|
734
|
+
label: string;
|
|
735
|
+
amount: components["schemas"]["Money"];
|
|
736
|
+
}[];
|
|
737
|
+
cancellation: {
|
|
738
|
+
/** Format: date-time */
|
|
739
|
+
free_until: string;
|
|
740
|
+
fee_after: components["schemas"]["Money"];
|
|
741
|
+
policy_id?: string;
|
|
742
|
+
};
|
|
743
|
+
/** Format: date-time */
|
|
744
|
+
expires_at: string;
|
|
745
|
+
/** @description opens the normal checkout for this quote */
|
|
746
|
+
deep_link?: string;
|
|
747
|
+
};
|
|
748
|
+
Booking: {
|
|
749
|
+
/** @constant */
|
|
750
|
+
type: "booking";
|
|
751
|
+
id: string;
|
|
752
|
+
/** @enum {string} */
|
|
753
|
+
status: "requested" | "confirmed" | "completed" | "cancelled_by_client" | "cancelled_by_professional" | "no_show";
|
|
754
|
+
/** Format: date-time */
|
|
755
|
+
start: string;
|
|
756
|
+
/** Format: date-time */
|
|
757
|
+
end?: string;
|
|
758
|
+
timezone?: string;
|
|
759
|
+
service_name: string;
|
|
760
|
+
professional?: {
|
|
761
|
+
id?: string;
|
|
762
|
+
display_name?: string;
|
|
763
|
+
};
|
|
764
|
+
location_summary?: string;
|
|
765
|
+
amount_paid?: components["schemas"]["Money"];
|
|
766
|
+
cancellation?: {
|
|
767
|
+
can_cancel?: boolean;
|
|
768
|
+
/** Format: date-time */
|
|
769
|
+
free_until?: string | null;
|
|
770
|
+
fee_now?: components["schemas"]["Money"];
|
|
771
|
+
};
|
|
772
|
+
deep_link: string;
|
|
773
|
+
};
|
|
774
|
+
/** @description A change the tenant holds after a `propose` call. Nothing has changed while it is `pending`. The person confirms or declines it in the tenant's app, and the runtime shows it as a `proposal` card (`confirm_mode: tenant_app`). */
|
|
775
|
+
Proposal: {
|
|
776
|
+
/** @constant */
|
|
777
|
+
type: "proposal";
|
|
778
|
+
id: string;
|
|
779
|
+
/**
|
|
780
|
+
* @description The tenant's current state of the proposal. Only `pending` can still be confirmed. The tenant is the source of truth, and `confirmed` means the change was applied.
|
|
781
|
+
* @enum {string}
|
|
782
|
+
*/
|
|
783
|
+
status: "pending" | "confirmed" | "declined" | "expired" | "superseded";
|
|
784
|
+
/** @description the older pending proposals this one superseded (they now have `status: superseded`) */
|
|
785
|
+
supersedes?: string[];
|
|
786
|
+
/**
|
|
787
|
+
* @example business_address
|
|
788
|
+
* @example opening_hours
|
|
789
|
+
* @example services
|
|
790
|
+
* @example booking
|
|
791
|
+
* @example booking_reschedule
|
|
792
|
+
* @example booking_cancellation
|
|
793
|
+
*/
|
|
794
|
+
topic: string;
|
|
795
|
+
title: string;
|
|
796
|
+
summary: string;
|
|
797
|
+
fields: components["schemas"]["ProposalField"][];
|
|
798
|
+
/**
|
|
799
|
+
* Format: date-time
|
|
800
|
+
* @description after it the tenant declines the proposal on its own
|
|
801
|
+
*/
|
|
802
|
+
expires_at: string;
|
|
803
|
+
/** @description A link into the tenant's app, to edit the change there. It must start with a prefix registered for the environment and pass the link checks (`admin-v1.yaml`, `Connector.deep_link_prefixes`). The runtime removes one that fails, and the proposal is still shown. */
|
|
804
|
+
edit_deep_link?: string;
|
|
805
|
+
} & (unknown & unknown & unknown & unknown);
|
|
806
|
+
/** @description The fields of a booking proposal (topic `booking`, `booking_reschedule` or `booking_cancellation`), whose keys are fixed so every app draws a booking card the same way (`docs/agents-guardrails-suggestions-writes.md` §3.4): `service`, `professional`, `space`, `booking`, `location`, `note` and `reason` are `text`, `services` is a `list`, `time` is a `time_range`, `place` an `address`, and `price`, `deposit`, `fee`, `cancellation_fee` and `refund` are `money_cents`. */
|
|
807
|
+
BookingFields: (unknown & unknown & unknown & unknown & unknown)[];
|
|
808
|
+
/** @description `before` is the current value, absent or null when the proposal creates it, and equal to `after` when the field does not change but says what the change is about (the booking a reschedule moves); `before` and `after` take the shape `type` names. */
|
|
809
|
+
ProposalField: {
|
|
810
|
+
key: string;
|
|
811
|
+
label: string;
|
|
812
|
+
/**
|
|
813
|
+
* @description `money_cents` is an amount in the currency's minor units (ISO 4217: cents for USD, yen for JPY, fils for BHD), never negative. `time_range` is one dated range whose `end` is after its `start`. `weekly_hours` is recurring opening hours, by weekday, in the business's time zone.
|
|
814
|
+
* @enum {string}
|
|
815
|
+
*/
|
|
816
|
+
type: "text" | "money_cents" | "time_range" | "address" | "list" | "weekly_hours";
|
|
817
|
+
before?: unknown;
|
|
818
|
+
after: unknown;
|
|
819
|
+
} & (unknown & unknown & unknown & unknown & unknown & unknown);
|
|
820
|
+
ProposalMoney: {
|
|
821
|
+
/** @description in the currency's minor units (ISO 4217) */
|
|
822
|
+
amount: number;
|
|
823
|
+
currency: string;
|
|
824
|
+
};
|
|
825
|
+
/** @description Recurring opening hours. A day absent from `entries` is closed; a day may have several entries (a lunch break), which never overlap. `end` may be `24:00` (closing at midnight), and `00:00`–`24:00` is open all day. An `end` earlier than `start` runs past midnight into the next day (a bar's `22:00`–`02:00`), and that spill counts against the next day's entries: `fri 22:00`–`02:00` and `sat 01:00`–`09:00` overlap. `end` never equals `start`. */
|
|
826
|
+
WeeklyHours: {
|
|
827
|
+
/**
|
|
828
|
+
* @description an IANA time zone name
|
|
829
|
+
* @example America/New_York
|
|
830
|
+
*/
|
|
831
|
+
time_zone: string;
|
|
832
|
+
entries: {
|
|
833
|
+
/** @enum {string} */
|
|
834
|
+
day: "mon" | "tue" | "wed" | "thu" | "fri" | "sat" | "sun";
|
|
835
|
+
start: string;
|
|
836
|
+
end: string;
|
|
837
|
+
}[];
|
|
838
|
+
};
|
|
839
|
+
TimeRange: {
|
|
840
|
+
/** Format: date-time */
|
|
841
|
+
start: string;
|
|
842
|
+
/** Format: date-time */
|
|
843
|
+
end: string;
|
|
844
|
+
};
|
|
845
|
+
PostalAddress: {
|
|
846
|
+
line1: string;
|
|
847
|
+
line2?: string;
|
|
848
|
+
city: string;
|
|
849
|
+
region?: string;
|
|
850
|
+
postal_code?: string;
|
|
851
|
+
/** @description ISO 3166-1 alpha-2 */
|
|
852
|
+
country: string;
|
|
853
|
+
};
|
|
854
|
+
TextList: string[];
|
|
855
|
+
/** @description A business's setup steps, in the order the business should do them. The steps and their state are the tenant's own record; a business with nothing left to set up has every step `done`. */
|
|
856
|
+
SetupState: {
|
|
857
|
+
steps: components["schemas"]["SetupStep"][];
|
|
858
|
+
};
|
|
859
|
+
/** @description One step of a business's setup. `title`, `body` and `label` are the tenant's own words for it, shown on the `next_step` card when the step has a `deep_link`. A `blocked` step says why in `reason`. */
|
|
860
|
+
SetupStep: {
|
|
861
|
+
/**
|
|
862
|
+
* @description the tenant's id for the step, stable across reads; the agent names a step by it
|
|
863
|
+
* @example business_name
|
|
864
|
+
* @example opening_hours
|
|
865
|
+
* @example payouts
|
|
866
|
+
*/
|
|
867
|
+
id: string;
|
|
868
|
+
/** @description the step, as the person knows it */
|
|
869
|
+
title: string;
|
|
870
|
+
/**
|
|
871
|
+
* @description `not_started` and `in_progress` are still to do, `done` is finished, and `blocked` waits on something the person cannot do in this conversation (a review, another step), named in `reason`.
|
|
872
|
+
* @enum {string}
|
|
873
|
+
*/
|
|
874
|
+
status: "not_started" | "in_progress" | "done" | "blocked";
|
|
875
|
+
/** @description what the step is for, in one or two sentences */
|
|
876
|
+
body?: string;
|
|
877
|
+
/** @description why a `blocked` step is blocked; only a `blocked` step has one */
|
|
878
|
+
reason?: string;
|
|
879
|
+
/** @description the action's words on its `next_step` card */
|
|
880
|
+
label?: string;
|
|
881
|
+
/** @description For a step finished on the tenant's own screen, a link into the tenant's app. It must start with a prefix registered for the environment and pass the link checks (`admin-v1.yaml`, `Connector.deep_link_prefixes`). The runtime removes one that fails, and the step is then shown without a card. */
|
|
882
|
+
deep_link?: string;
|
|
883
|
+
} & unknown;
|
|
884
|
+
/** @description One of the signed-in customer's kits: items a styling-kit retailer sends to try at home, each kept or returned, the kept ones charged. `status` is where the kit is in its life: `preparing` (being put together), `shipped` (on its way), `delivered` (arrived, deciding not open yet), `feedback_open` (the customer decides keep or return for each item, until `feedback_closes_at`), `feedback_closed` (the decisions are in; the items to return are due back by `return_by`), `returned` (the returned items arrived), `billed` (the kept items were charged: `order_id`), `cancelled`. A retailer whose kits skip a state (feedback opens on delivery) never sends it. "What do I still need to do" is answered by `undecided_count` and each item's `decision` before `feedback_closes_at`, and by the items to return and `return_by` after it. */
|
|
885
|
+
Kit: {
|
|
886
|
+
/** @constant */
|
|
887
|
+
type: "kit";
|
|
888
|
+
id: string;
|
|
889
|
+
/** @example October kit */
|
|
890
|
+
title?: string;
|
|
891
|
+
/** @enum {string} */
|
|
892
|
+
status: "preparing" | "shipped" | "delivered" | "feedback_open" | "feedback_closed" | "returned" | "billed" | "cancelled";
|
|
893
|
+
/** Format: date-time */
|
|
894
|
+
ordered_at?: string | null;
|
|
895
|
+
/** Format: date-time */
|
|
896
|
+
shipped_at?: string | null;
|
|
897
|
+
/** Format: date-time */
|
|
898
|
+
delivered_at?: string | null;
|
|
899
|
+
/**
|
|
900
|
+
* Format: date-time
|
|
901
|
+
* @description until when the customer decides keep or return
|
|
902
|
+
*/
|
|
903
|
+
feedback_closes_at?: string | null;
|
|
904
|
+
/**
|
|
905
|
+
* Format: date-time
|
|
906
|
+
* @description when the items to return must be sent back
|
|
907
|
+
*/
|
|
908
|
+
return_by?: string | null;
|
|
909
|
+
carrier?: string;
|
|
910
|
+
/** Format: uri */
|
|
911
|
+
tracking_url?: string;
|
|
912
|
+
delivery_area?: components["schemas"]["KitDeliveryArea"];
|
|
913
|
+
item_count?: number;
|
|
914
|
+
/** @description items the customer has not decided on yet */
|
|
915
|
+
undecided_count?: number;
|
|
916
|
+
/** @description a listed kit may leave them out; `get_my_kit` returns them */
|
|
917
|
+
items?: components["schemas"]["KitItem"][];
|
|
918
|
+
/** @description the order that charged the kept items, once billed */
|
|
919
|
+
order_id?: string;
|
|
920
|
+
/** @description the kit's screen in the tenant's app */
|
|
921
|
+
deep_link?: string;
|
|
922
|
+
};
|
|
923
|
+
KitItem: {
|
|
924
|
+
id: string;
|
|
925
|
+
name: string;
|
|
926
|
+
/** Format: uri */
|
|
927
|
+
image_url?: string;
|
|
928
|
+
price?: components["schemas"]["Money"];
|
|
929
|
+
/**
|
|
930
|
+
* @description the customer's, so far
|
|
931
|
+
* @enum {string}
|
|
932
|
+
*/
|
|
933
|
+
decision: "keep" | "return" | "undecided";
|
|
934
|
+
/**
|
|
935
|
+
* @description for an item to return, where the return is
|
|
936
|
+
* @enum {string}
|
|
937
|
+
*/
|
|
938
|
+
return_status?: "not_sent" | "in_transit" | "received";
|
|
939
|
+
};
|
|
940
|
+
/** @description Where a kit goes, as an area only. Never the street, the unit, the recipient's name or a phone number. */
|
|
941
|
+
KitDeliveryArea: {
|
|
942
|
+
suburb: string;
|
|
943
|
+
postcode: string;
|
|
944
|
+
/** @description state or province */
|
|
945
|
+
region?: string;
|
|
946
|
+
country?: string;
|
|
947
|
+
};
|
|
948
|
+
/** @description What the signed-in customer was charged or refunded, as amounts and dates: for a styling-kit retailer, the kept items of one kit. No payment instrument (card, account, wallet or token) appears in it. */
|
|
949
|
+
Order: {
|
|
950
|
+
/** @constant */
|
|
951
|
+
type: "order";
|
|
952
|
+
id: string;
|
|
953
|
+
kit_id?: string;
|
|
954
|
+
/** @enum {string} */
|
|
955
|
+
status: "pending" | "paid" | "partially_refunded" | "refunded" | "failed" | "cancelled";
|
|
956
|
+
/** Format: date-time */
|
|
957
|
+
placed_at?: string | null;
|
|
958
|
+
total: components["schemas"]["Money"];
|
|
959
|
+
charges?: components["schemas"]["OrderCharge"][];
|
|
960
|
+
/** @description the order's screen in the tenant's app */
|
|
961
|
+
deep_link?: string;
|
|
962
|
+
};
|
|
963
|
+
OrderCharge: {
|
|
964
|
+
/** @enum {string} */
|
|
965
|
+
kind: "charge" | "refund";
|
|
966
|
+
amount: components["schemas"]["Money"];
|
|
967
|
+
/** Format: date-time */
|
|
968
|
+
at: string;
|
|
969
|
+
/** @enum {string} */
|
|
970
|
+
status: "pending" | "succeeded" | "failed";
|
|
971
|
+
/** @example 2 items kept */
|
|
972
|
+
description?: string;
|
|
973
|
+
};
|
|
974
|
+
Policy: {
|
|
975
|
+
/** @constant */
|
|
976
|
+
type: "policy";
|
|
977
|
+
id: string;
|
|
978
|
+
topic: string;
|
|
979
|
+
version: string;
|
|
980
|
+
title: string;
|
|
981
|
+
/** @description plain text or simple markdown; the source of truth for answers */
|
|
982
|
+
body: string;
|
|
983
|
+
/** Format: date-time */
|
|
984
|
+
updated_at: string;
|
|
985
|
+
/** Format: uri */
|
|
986
|
+
url?: string;
|
|
987
|
+
};
|
|
988
|
+
/** @description The tenant's stable ref for a question (or a `rate_each` row), echoed in answers. */
|
|
989
|
+
QuestionId: string;
|
|
990
|
+
/** @enum {string} */
|
|
991
|
+
QuestionKind: "single_choice" | "multi_choice" | "image_choice" | "yes_no" | "list_choice" | "rate_each" | "short_text" | "long_text" | "date" | "number" | "scale" | "photo";
|
|
992
|
+
QuestionOption: {
|
|
993
|
+
/** @description The tenant's stable ref for this choice. Answers carry it, never the label. */
|
|
994
|
+
value: string;
|
|
995
|
+
label: string;
|
|
996
|
+
/**
|
|
997
|
+
* Format: uri
|
|
998
|
+
* @description on the tenant's CDN; required for `image_choice`
|
|
999
|
+
*/
|
|
1000
|
+
image_url?: string;
|
|
1001
|
+
description?: string;
|
|
1002
|
+
};
|
|
1003
|
+
FlowDefinition: {
|
|
1004
|
+
/** @description the published version; the submission echoes it */
|
|
1005
|
+
version: number;
|
|
1006
|
+
/** @description Facts the agent may use in the conversation. Nothing else about the person is sent. A field not listed here fails closed: the runtime rejects the whole definition and logs it, and the flow does not start. */
|
|
1007
|
+
context: {
|
|
1008
|
+
/** @description for the greeting */
|
|
1009
|
+
first_name?: string;
|
|
1010
|
+
};
|
|
1011
|
+
/** @description In order. Every `question_id`, rows included, is unique within the definition. */
|
|
1012
|
+
questions: components["schemas"]["FlowQuestion"][];
|
|
1013
|
+
};
|
|
1014
|
+
/** @description A question as the tenant defines it: the fields of the `question` card (`vinaverse-v1.yaml`), without the conversation's `progress`, `state` and `answer`, plus `logic` and `hints` for the agent. */
|
|
1015
|
+
FlowQuestion: {
|
|
1016
|
+
question_id: components["schemas"]["QuestionId"];
|
|
1017
|
+
kind: components["schemas"]["QuestionKind"];
|
|
1018
|
+
/** @description The question's wording. The agent phrases it conversationally unless `hints.may_rephrase` is false. */
|
|
1019
|
+
prompt: string;
|
|
1020
|
+
/** @description shown with the question */
|
|
1021
|
+
help?: string;
|
|
1022
|
+
/** @description when false the person may skip it (`answer.skipped`) */
|
|
1023
|
+
required: boolean;
|
|
1024
|
+
/** @description The choices, and for `rate_each` the columns. Choice kinds and `rate_each` need at least 2 and at most 12; `yes_no` needs exactly 2; `list_choice` allows up to 500. */
|
|
1025
|
+
options?: components["schemas"]["QuestionOption"][];
|
|
1026
|
+
/** @description fewest selections (`multi_choice`, `image_choice`) */
|
|
1027
|
+
min?: number;
|
|
1028
|
+
/** @description most selections (`multi_choice`, `image_choice`) */
|
|
1029
|
+
max?: number;
|
|
1030
|
+
/**
|
|
1031
|
+
* @description offers a free-text "Other", answered with `other_text`
|
|
1032
|
+
* @default false
|
|
1033
|
+
*/
|
|
1034
|
+
allows_other: boolean;
|
|
1035
|
+
/**
|
|
1036
|
+
* @description With `allows_other` only: the longest "Other" text (`other_text`), in Unicode code points; 500 when absent. A longer `ui.answer` is rejected with `invalid_value`, and Other text the agent takes from a typed message is held to it too: the runtime asks for a shorter one and never submits a longer one. The app enforces it as the person types.
|
|
1037
|
+
* @default 500
|
|
1038
|
+
*/
|
|
1039
|
+
other_max_length: number;
|
|
1040
|
+
/** @description an exclusive choice, answered as `values` with its `value` alone */
|
|
1041
|
+
none_of_the_above?: {
|
|
1042
|
+
value: string;
|
|
1043
|
+
label: string;
|
|
1044
|
+
};
|
|
1045
|
+
/** @description `rate_each` only: each row is rated on the `options` scale and answered on its own `question_id` */
|
|
1046
|
+
rows?: {
|
|
1047
|
+
question_id: components["schemas"]["QuestionId"];
|
|
1048
|
+
label: string;
|
|
1049
|
+
/** Format: uri */
|
|
1050
|
+
image_url?: string;
|
|
1051
|
+
}[];
|
|
1052
|
+
/** @description `short_text` (max_length at most 200) and `long_text` (at most 2000) */
|
|
1053
|
+
text?: {
|
|
1054
|
+
max_length: number;
|
|
1055
|
+
};
|
|
1056
|
+
number?: {
|
|
1057
|
+
min: number;
|
|
1058
|
+
max: number;
|
|
1059
|
+
step: number;
|
|
1060
|
+
/**
|
|
1061
|
+
* @example cm
|
|
1062
|
+
* @example kg
|
|
1063
|
+
* @example years
|
|
1064
|
+
*/
|
|
1065
|
+
unit?: string;
|
|
1066
|
+
};
|
|
1067
|
+
/** @description optional bounds, inclusive */
|
|
1068
|
+
date?: {
|
|
1069
|
+
/** Format: date */
|
|
1070
|
+
min?: string;
|
|
1071
|
+
/** Format: date */
|
|
1072
|
+
max?: string;
|
|
1073
|
+
};
|
|
1074
|
+
scale?: {
|
|
1075
|
+
min: number;
|
|
1076
|
+
max: number;
|
|
1077
|
+
step: number;
|
|
1078
|
+
min_label: string;
|
|
1079
|
+
max_label: string;
|
|
1080
|
+
};
|
|
1081
|
+
/** @description The app uploads the photo to the tenant (never through Vinaverse) and answers with the `upload_ref` the tenant issued. */
|
|
1082
|
+
photo?: {
|
|
1083
|
+
max_bytes: number;
|
|
1084
|
+
mime_types: string[];
|
|
1085
|
+
};
|
|
1086
|
+
/** @description Forward-only jumps, tested in order once this question is answered. The first rule that matches moves the conversation to `jump_to`, or ends the flow on `end`. When none matches, the next question in order follows. Questions jumped over are not asked and not submitted. */
|
|
1087
|
+
logic?: components["schemas"]["FlowJump"][];
|
|
1088
|
+
hints?: components["schemas"]["FlowHints"];
|
|
1089
|
+
} & (unknown & unknown & unknown & unknown & unknown & unknown & unknown & unknown & unknown & unknown & unknown & unknown & unknown & unknown & unknown & unknown & unknown & unknown & unknown & unknown);
|
|
1090
|
+
/** @description A condition on option values and where it leads: exactly one of `jump_to` (a question later in the definition) or `end: true`. */
|
|
1091
|
+
FlowJump: {
|
|
1092
|
+
when: {
|
|
1093
|
+
/** @description the question whose answer is tested; this one when absent, otherwise an earlier one */
|
|
1094
|
+
question_id?: components["schemas"]["QuestionId"];
|
|
1095
|
+
/**
|
|
1096
|
+
* @description `any`: at least one of `values` was selected; `all`: every one; `none`: none of them
|
|
1097
|
+
* @default any
|
|
1098
|
+
* @enum {string}
|
|
1099
|
+
*/
|
|
1100
|
+
match: "any" | "all" | "none";
|
|
1101
|
+
values: string[];
|
|
1102
|
+
};
|
|
1103
|
+
jump_to?: components["schemas"]["QuestionId"];
|
|
1104
|
+
/** @constant */
|
|
1105
|
+
end?: true;
|
|
1106
|
+
} & (unknown | unknown);
|
|
1107
|
+
/** @description For the agent only. Never shown to the person as written. */
|
|
1108
|
+
FlowHints: {
|
|
1109
|
+
/** @description what the question is for; what to explain when asked why */
|
|
1110
|
+
intent?: string;
|
|
1111
|
+
/** @default true */
|
|
1112
|
+
may_rephrase: boolean;
|
|
1113
|
+
examples?: string[];
|
|
1114
|
+
/** @description what to ask or say when an answer is vague */
|
|
1115
|
+
follow_up?: string;
|
|
1116
|
+
/** @description By option value, the words people use for it. Typed text maps to one of the card's values, to `other_text` when allowed, or to "unclear", and the agent then asks again with the options shown. */
|
|
1117
|
+
synonyms?: {
|
|
1118
|
+
[key: string]: string[];
|
|
1119
|
+
};
|
|
1120
|
+
};
|
|
1121
|
+
/** @description Exactly one of: `values` (option values, validated against the card; one for single-choice kinds), `other_text` (the free-text "Other", when `allows_other`), `text`, `number`, `date` (YYYY-MM-DD), `upload_ref` (`photo`) or `skipped` (only when the question is not `required`). The one combination is `values` with `other_text`, for a `single_choice` or `multi_choice` question that `allows_other`: the person picked options and also typed an "Other". On any other question it is refused (`not_allowed`). */
|
|
1122
|
+
QuestionAnswer: {
|
|
1123
|
+
values: string[];
|
|
1124
|
+
} | {
|
|
1125
|
+
other_text: string;
|
|
1126
|
+
} | {
|
|
1127
|
+
values: string[];
|
|
1128
|
+
other_text: string;
|
|
1129
|
+
} | {
|
|
1130
|
+
text: string;
|
|
1131
|
+
} | {
|
|
1132
|
+
number: number;
|
|
1133
|
+
} | {
|
|
1134
|
+
/** Format: date */
|
|
1135
|
+
date: string;
|
|
1136
|
+
} | {
|
|
1137
|
+
upload_ref: string;
|
|
1138
|
+
} | {
|
|
1139
|
+
/** @constant */
|
|
1140
|
+
skipped: true;
|
|
1141
|
+
};
|
|
1142
|
+
FlowSubmission: {
|
|
1143
|
+
/** @description the definition version the answers follow */
|
|
1144
|
+
version: number;
|
|
1145
|
+
/** @description Chosen by Vinaverse, once per submission attempt with a new body, and reused only to repeat the same body. The same id with a different body is `409 SUBMISSION_ID_REUSED` (see `submit_flow`). */
|
|
1146
|
+
submission_id: string;
|
|
1147
|
+
/** @description One per question on the path the person took, a `rate_each` row counting as a question, so up to 100 questions of 50 rows each. A question that was not required and that the person skipped carries `skipped: true`. Questions the logic jumped over are left out. */
|
|
1148
|
+
answers: {
|
|
1149
|
+
question_id: components["schemas"]["QuestionId"];
|
|
1150
|
+
answer: components["schemas"]["QuestionAnswer"];
|
|
1151
|
+
}[];
|
|
1152
|
+
/** @description By `question_id`, extra things the person volunteered while answering. The tenant stores them as remarks and never treats them as answers. May be empty. */
|
|
1153
|
+
remarks: {
|
|
1154
|
+
[key: string]: string;
|
|
1155
|
+
};
|
|
1156
|
+
};
|
|
1157
|
+
/**
|
|
1158
|
+
* @description A coded refusal. `question_id` names the question to ask again; it is absent only for `VERSION_NOT_ACCEPTED`. What the agent does with each code: - `REQUIRED_MISSING`: asks the question it left out; - `UNKNOWN_VALUE`: asks again with the options shown; - `TOO_LONG`: asks again, with the length limit; - `TOO_MANY`: asks again, with the most selections allowed (the question's `max`); selections only; - `TOO_FEW`: asks again, with the fewest selections allowed (the question's `min`); selections only; - `OUT_OF_RANGE`: a `number` or `scale` answer below `min`, above `max` or off `step`; asks again with
|
|
1159
|
+
* the range;
|
|
1160
|
+
* - `BAD_DATE`: asks again for a valid date, within the question's bounds; - `UPLOAD_NOT_FOUND`: asks for the photo again (the tenant has no upload under that `upload_ref`); - `VERSION_NOT_ACCEPTED`: fetches the definition again.
|
|
1161
|
+
* An unknown code is handled like `REQUIRED_MISSING` on the named question. An unknown code without a `question_id` is handled like `VERSION_NOT_ACCEPTED`: the agent fetches the definition again, walks it, and asks what is missing. If nothing is, it reports `flow.completed` with `refused` and that code.
|
|
1162
|
+
* The runtime forwards the code to the app in `flow.completed.code`, a free string. **Rollout:** send `TOO_MANY`, `TOO_FEW`, `BAD_DATE`, `UPLOAD_NOT_FOUND` and `OUT_OF_RANGE` only once the runtime release that handles them is live.
|
|
1163
|
+
*/
|
|
1164
|
+
FlowSubmissionRefusal: {
|
|
1165
|
+
/** @constant */
|
|
1166
|
+
status: 422;
|
|
1167
|
+
/** @enum {string} */
|
|
1168
|
+
code: "REQUIRED_MISSING" | "UNKNOWN_VALUE" | "TOO_LONG" | "VERSION_NOT_ACCEPTED" | "TOO_MANY" | "TOO_FEW" | "BAD_DATE" | "UPLOAD_NOT_FOUND" | "OUT_OF_RANGE";
|
|
1169
|
+
question_id?: components["schemas"]["QuestionId"];
|
|
1170
|
+
detail?: string;
|
|
1171
|
+
};
|
|
1172
|
+
/** @description The `submission_id` was already used with a different body. The second body was not stored. `stored` is the result the tenant holds for that id, which the runtime takes as that id's outcome. It submits again under a new id only when `stored` is a refusal. */
|
|
1173
|
+
FlowSubmissionConflict: {
|
|
1174
|
+
/** @constant */
|
|
1175
|
+
status: 409;
|
|
1176
|
+
/** @constant */
|
|
1177
|
+
code: "SUBMISSION_ID_REUSED";
|
|
1178
|
+
stored: {
|
|
1179
|
+
/** @enum {string} */
|
|
1180
|
+
result: "accepted" | "refused";
|
|
1181
|
+
/** @enum {string} */
|
|
1182
|
+
code?: "REQUIRED_MISSING" | "UNKNOWN_VALUE" | "TOO_LONG" | "VERSION_NOT_ACCEPTED" | "TOO_MANY" | "TOO_FEW" | "BAD_DATE" | "UPLOAD_NOT_FOUND" | "OUT_OF_RANGE";
|
|
1183
|
+
question_id?: components["schemas"]["QuestionId"];
|
|
1184
|
+
} & (unknown & unknown & unknown);
|
|
1185
|
+
detail?: string;
|
|
1186
|
+
};
|
|
1187
|
+
};
|
|
1188
|
+
responses: {
|
|
1189
|
+
/** @description Problem details. The status decides what the runtime does with the refusal, never `code`: only a `401` ends the session's tool access, a `403` fails that call only, and any other `4xx` or `5xx` fails it as the status says. `code` must agree with the status; the runtime reads it only for `IDEMPOTENCY_KEY_REUSED` (a `create_proposal` `409`), for `invalid_argument` with `field` and `example` (a `create_proposal` `422`), and, on the catalogue sweep, for `invalid_argument` with `field` (a `422` naming an input the sweep did not send skips that optional step). */
|
|
1190
|
+
Problem: {
|
|
1191
|
+
headers: {
|
|
1192
|
+
[name: string]: unknown;
|
|
1193
|
+
};
|
|
1194
|
+
content: {
|
|
1195
|
+
"application/problem+json": {
|
|
1196
|
+
status: number;
|
|
1197
|
+
/** @enum {string} */
|
|
1198
|
+
code: "not_found" | "forbidden" | "invalid_argument" | "unavailable" | "token_expired";
|
|
1199
|
+
detail?: string;
|
|
1200
|
+
/** @description `invalid_argument` on `create_proposal`: the argument at fault, as a JSON Pointer into the body (`/changes/address/postal_code`) */
|
|
1201
|
+
field?: string;
|
|
1202
|
+
/** @description `invalid_argument` on `create_proposal`: a valid value the agent can offer when it asks again */
|
|
1203
|
+
example?: string;
|
|
1204
|
+
};
|
|
1205
|
+
};
|
|
1206
|
+
};
|
|
1207
|
+
};
|
|
1208
|
+
parameters: {
|
|
1209
|
+
/** @description on every tool call in a session, a channel session's included (never on the catalogue sweep), the session's id; informational and not signed */
|
|
1210
|
+
VinaverseSession: string;
|
|
1211
|
+
/** @description on every tool call of a session that belongs to a conversation (never on the catalogue sweep), its id; informational and not signed */
|
|
1212
|
+
VinaverseConversation: string;
|
|
1213
|
+
Q: string;
|
|
1214
|
+
Lat: number;
|
|
1215
|
+
Lng: number;
|
|
1216
|
+
RadiusMiles: number;
|
|
1217
|
+
/** @description minor units */
|
|
1218
|
+
MaxPrice: number;
|
|
1219
|
+
/** @description rating × 1,000,000 */
|
|
1220
|
+
MinRatingPpm: number;
|
|
1221
|
+
Limit: number;
|
|
1222
|
+
Cursor: string;
|
|
1223
|
+
/** @description the flow's name, as registered for the tenant in Studio */
|
|
1224
|
+
Flow: string;
|
|
1225
|
+
};
|
|
1226
|
+
requestBodies: never;
|
|
1227
|
+
headers: never;
|
|
1228
|
+
pathItems: never;
|
|
1229
|
+
}
|
|
1230
|
+
interface operations {
|
|
1231
|
+
resolve_place: {
|
|
1232
|
+
parameters: {
|
|
1233
|
+
query: {
|
|
1234
|
+
text: string;
|
|
1235
|
+
near_lat?: number;
|
|
1236
|
+
near_lng?: number;
|
|
1237
|
+
};
|
|
1238
|
+
header?: {
|
|
1239
|
+
/** @description on every tool call in a session, a channel session's included (never on the catalogue sweep), the session's id; informational and not signed */
|
|
1240
|
+
"Vinaverse-Session"?: components["parameters"]["VinaverseSession"];
|
|
1241
|
+
/** @description on every tool call of a session that belongs to a conversation (never on the catalogue sweep), its id; informational and not signed */
|
|
1242
|
+
"Vinaverse-Conversation"?: components["parameters"]["VinaverseConversation"];
|
|
1243
|
+
};
|
|
1244
|
+
path?: never;
|
|
1245
|
+
cookie?: never;
|
|
1246
|
+
};
|
|
1247
|
+
requestBody?: never;
|
|
1248
|
+
responses: {
|
|
1249
|
+
/** @description OK */
|
|
1250
|
+
200: {
|
|
1251
|
+
headers: {
|
|
1252
|
+
[name: string]: unknown;
|
|
1253
|
+
};
|
|
1254
|
+
content: {
|
|
1255
|
+
"application/json": {
|
|
1256
|
+
places: components["schemas"]["Place"][];
|
|
1257
|
+
};
|
|
1258
|
+
};
|
|
1259
|
+
};
|
|
1260
|
+
default: components["responses"]["Problem"];
|
|
1261
|
+
};
|
|
1262
|
+
};
|
|
1263
|
+
list_services: {
|
|
1264
|
+
parameters: {
|
|
1265
|
+
query: {
|
|
1266
|
+
q: string;
|
|
1267
|
+
limit?: number;
|
|
1268
|
+
};
|
|
1269
|
+
header?: {
|
|
1270
|
+
/** @description on every tool call in a session, a channel session's included (never on the catalogue sweep), the session's id; informational and not signed */
|
|
1271
|
+
"Vinaverse-Session"?: components["parameters"]["VinaverseSession"];
|
|
1272
|
+
/** @description on every tool call of a session that belongs to a conversation (never on the catalogue sweep), its id; informational and not signed */
|
|
1273
|
+
"Vinaverse-Conversation"?: components["parameters"]["VinaverseConversation"];
|
|
1274
|
+
};
|
|
1275
|
+
path?: never;
|
|
1276
|
+
cookie?: never;
|
|
1277
|
+
};
|
|
1278
|
+
requestBody?: never;
|
|
1279
|
+
responses: {
|
|
1280
|
+
/** @description OK */
|
|
1281
|
+
200: {
|
|
1282
|
+
headers: {
|
|
1283
|
+
[name: string]: unknown;
|
|
1284
|
+
};
|
|
1285
|
+
content: {
|
|
1286
|
+
"application/json": {
|
|
1287
|
+
services: components["schemas"]["CatalogService"][];
|
|
1288
|
+
};
|
|
1289
|
+
};
|
|
1290
|
+
};
|
|
1291
|
+
default: components["responses"]["Problem"];
|
|
1292
|
+
};
|
|
1293
|
+
};
|
|
1294
|
+
search_professionals: {
|
|
1295
|
+
parameters: {
|
|
1296
|
+
query?: {
|
|
1297
|
+
q?: components["parameters"]["Q"];
|
|
1298
|
+
category_id?: string;
|
|
1299
|
+
service_type_id?: string;
|
|
1300
|
+
lat?: components["parameters"]["Lat"];
|
|
1301
|
+
lng?: components["parameters"]["Lng"];
|
|
1302
|
+
radius_miles?: components["parameters"]["RadiusMiles"];
|
|
1303
|
+
/** @description only professionals with an open slot that day (subject timezone) */
|
|
1304
|
+
date?: string;
|
|
1305
|
+
time_from?: string;
|
|
1306
|
+
time_to?: string;
|
|
1307
|
+
/** @description minor units */
|
|
1308
|
+
max_price?: components["parameters"]["MaxPrice"];
|
|
1309
|
+
/** @description rating × 1,000,000 */
|
|
1310
|
+
min_rating_ppm?: components["parameters"]["MinRatingPpm"];
|
|
1311
|
+
sort?: "relevance" | "nearest" | "top_rated" | "price_low";
|
|
1312
|
+
limit?: components["parameters"]["Limit"];
|
|
1313
|
+
cursor?: components["parameters"]["Cursor"];
|
|
1314
|
+
};
|
|
1315
|
+
header?: {
|
|
1316
|
+
/** @description on every tool call in a session, a channel session's included (never on the catalogue sweep), the session's id; informational and not signed */
|
|
1317
|
+
"Vinaverse-Session"?: components["parameters"]["VinaverseSession"];
|
|
1318
|
+
/** @description on every tool call of a session that belongs to a conversation (never on the catalogue sweep), its id; informational and not signed */
|
|
1319
|
+
"Vinaverse-Conversation"?: components["parameters"]["VinaverseConversation"];
|
|
1320
|
+
};
|
|
1321
|
+
path?: never;
|
|
1322
|
+
cookie?: never;
|
|
1323
|
+
};
|
|
1324
|
+
requestBody?: never;
|
|
1325
|
+
responses: {
|
|
1326
|
+
/** @description OK */
|
|
1327
|
+
200: {
|
|
1328
|
+
headers: {
|
|
1329
|
+
[name: string]: unknown;
|
|
1330
|
+
};
|
|
1331
|
+
content: {
|
|
1332
|
+
"application/json": {
|
|
1333
|
+
results: components["schemas"]["ProfessionalSummary"][];
|
|
1334
|
+
next_cursor?: string | null;
|
|
1335
|
+
total_estimate?: number;
|
|
1336
|
+
};
|
|
1337
|
+
};
|
|
1338
|
+
};
|
|
1339
|
+
default: components["responses"]["Problem"];
|
|
1340
|
+
};
|
|
1341
|
+
};
|
|
1342
|
+
list_services_in_area: {
|
|
1343
|
+
parameters: {
|
|
1344
|
+
query?: {
|
|
1345
|
+
lat?: components["parameters"]["Lat"];
|
|
1346
|
+
lng?: components["parameters"]["Lng"];
|
|
1347
|
+
radius_miles?: components["parameters"]["RadiusMiles"];
|
|
1348
|
+
};
|
|
1349
|
+
header?: {
|
|
1350
|
+
/** @description on every tool call in a session, a channel session's included (never on the catalogue sweep), the session's id; informational and not signed */
|
|
1351
|
+
"Vinaverse-Session"?: components["parameters"]["VinaverseSession"];
|
|
1352
|
+
/** @description on every tool call of a session that belongs to a conversation (never on the catalogue sweep), its id; informational and not signed */
|
|
1353
|
+
"Vinaverse-Conversation"?: components["parameters"]["VinaverseConversation"];
|
|
1354
|
+
};
|
|
1355
|
+
path?: never;
|
|
1356
|
+
cookie?: never;
|
|
1357
|
+
};
|
|
1358
|
+
requestBody?: never;
|
|
1359
|
+
responses: {
|
|
1360
|
+
/** @description OK */
|
|
1361
|
+
200: {
|
|
1362
|
+
headers: {
|
|
1363
|
+
[name: string]: unknown;
|
|
1364
|
+
};
|
|
1365
|
+
content: {
|
|
1366
|
+
"application/json": components["schemas"]["AreaInventory"];
|
|
1367
|
+
};
|
|
1368
|
+
};
|
|
1369
|
+
default: components["responses"]["Problem"];
|
|
1370
|
+
};
|
|
1371
|
+
};
|
|
1372
|
+
search_workspaces: {
|
|
1373
|
+
parameters: {
|
|
1374
|
+
query?: {
|
|
1375
|
+
q?: components["parameters"]["Q"];
|
|
1376
|
+
space_category?: string;
|
|
1377
|
+
lat?: components["parameters"]["Lat"];
|
|
1378
|
+
lng?: components["parameters"]["Lng"];
|
|
1379
|
+
radius_miles?: components["parameters"]["RadiusMiles"];
|
|
1380
|
+
/** @description minor units */
|
|
1381
|
+
max_price?: components["parameters"]["MaxPrice"];
|
|
1382
|
+
/** @description rating × 1,000,000 */
|
|
1383
|
+
min_rating_ppm?: components["parameters"]["MinRatingPpm"];
|
|
1384
|
+
sort?: "relevance" | "nearest" | "top_rated" | "price_low";
|
|
1385
|
+
limit?: components["parameters"]["Limit"];
|
|
1386
|
+
cursor?: components["parameters"]["Cursor"];
|
|
1387
|
+
};
|
|
1388
|
+
header?: {
|
|
1389
|
+
/** @description on every tool call in a session, a channel session's included (never on the catalogue sweep), the session's id; informational and not signed */
|
|
1390
|
+
"Vinaverse-Session"?: components["parameters"]["VinaverseSession"];
|
|
1391
|
+
/** @description on every tool call of a session that belongs to a conversation (never on the catalogue sweep), its id; informational and not signed */
|
|
1392
|
+
"Vinaverse-Conversation"?: components["parameters"]["VinaverseConversation"];
|
|
1393
|
+
};
|
|
1394
|
+
path?: never;
|
|
1395
|
+
cookie?: never;
|
|
1396
|
+
};
|
|
1397
|
+
requestBody?: never;
|
|
1398
|
+
responses: {
|
|
1399
|
+
/** @description OK */
|
|
1400
|
+
200: {
|
|
1401
|
+
headers: {
|
|
1402
|
+
[name: string]: unknown;
|
|
1403
|
+
};
|
|
1404
|
+
content: {
|
|
1405
|
+
"application/json": {
|
|
1406
|
+
results: components["schemas"]["WorkspaceSummary"][];
|
|
1407
|
+
next_cursor?: string | null;
|
|
1408
|
+
};
|
|
1409
|
+
};
|
|
1410
|
+
};
|
|
1411
|
+
default: components["responses"]["Problem"];
|
|
1412
|
+
};
|
|
1413
|
+
};
|
|
1414
|
+
get_professional: {
|
|
1415
|
+
parameters: {
|
|
1416
|
+
query?: never;
|
|
1417
|
+
header?: {
|
|
1418
|
+
/** @description on every tool call in a session, a channel session's included (never on the catalogue sweep), the session's id; informational and not signed */
|
|
1419
|
+
"Vinaverse-Session"?: components["parameters"]["VinaverseSession"];
|
|
1420
|
+
/** @description on every tool call of a session that belongs to a conversation (never on the catalogue sweep), its id; informational and not signed */
|
|
1421
|
+
"Vinaverse-Conversation"?: components["parameters"]["VinaverseConversation"];
|
|
1422
|
+
};
|
|
1423
|
+
path: {
|
|
1424
|
+
id: string;
|
|
1425
|
+
};
|
|
1426
|
+
cookie?: never;
|
|
1427
|
+
};
|
|
1428
|
+
requestBody?: never;
|
|
1429
|
+
responses: {
|
|
1430
|
+
/** @description OK */
|
|
1431
|
+
200: {
|
|
1432
|
+
headers: {
|
|
1433
|
+
[name: string]: unknown;
|
|
1434
|
+
};
|
|
1435
|
+
content: {
|
|
1436
|
+
"application/json": components["schemas"]["ProfessionalDetail"];
|
|
1437
|
+
};
|
|
1438
|
+
};
|
|
1439
|
+
default: components["responses"]["Problem"];
|
|
1440
|
+
};
|
|
1441
|
+
};
|
|
1442
|
+
get_workspace: {
|
|
1443
|
+
parameters: {
|
|
1444
|
+
query?: never;
|
|
1445
|
+
header?: {
|
|
1446
|
+
/** @description on every tool call in a session, a channel session's included (never on the catalogue sweep), the session's id; informational and not signed */
|
|
1447
|
+
"Vinaverse-Session"?: components["parameters"]["VinaverseSession"];
|
|
1448
|
+
/** @description on every tool call of a session that belongs to a conversation (never on the catalogue sweep), its id; informational and not signed */
|
|
1449
|
+
"Vinaverse-Conversation"?: components["parameters"]["VinaverseConversation"];
|
|
1450
|
+
};
|
|
1451
|
+
path: {
|
|
1452
|
+
id: string;
|
|
1453
|
+
};
|
|
1454
|
+
cookie?: never;
|
|
1455
|
+
};
|
|
1456
|
+
requestBody?: never;
|
|
1457
|
+
responses: {
|
|
1458
|
+
/** @description OK */
|
|
1459
|
+
200: {
|
|
1460
|
+
headers: {
|
|
1461
|
+
[name: string]: unknown;
|
|
1462
|
+
};
|
|
1463
|
+
content: {
|
|
1464
|
+
"application/json": components["schemas"]["WorkspaceDetail"];
|
|
1465
|
+
};
|
|
1466
|
+
};
|
|
1467
|
+
default: components["responses"]["Problem"];
|
|
1468
|
+
};
|
|
1469
|
+
};
|
|
1470
|
+
get_availability: {
|
|
1471
|
+
parameters: {
|
|
1472
|
+
query: {
|
|
1473
|
+
professional_id: string;
|
|
1474
|
+
service_id: string;
|
|
1475
|
+
from: string;
|
|
1476
|
+
/** @description at most 14 days after from */
|
|
1477
|
+
to: string;
|
|
1478
|
+
limit?: number;
|
|
1479
|
+
};
|
|
1480
|
+
header?: {
|
|
1481
|
+
/** @description on every tool call in a session, a channel session's included (never on the catalogue sweep), the session's id; informational and not signed */
|
|
1482
|
+
"Vinaverse-Session"?: components["parameters"]["VinaverseSession"];
|
|
1483
|
+
/** @description on every tool call of a session that belongs to a conversation (never on the catalogue sweep), its id; informational and not signed */
|
|
1484
|
+
"Vinaverse-Conversation"?: components["parameters"]["VinaverseConversation"];
|
|
1485
|
+
};
|
|
1486
|
+
path?: never;
|
|
1487
|
+
cookie?: never;
|
|
1488
|
+
};
|
|
1489
|
+
requestBody?: never;
|
|
1490
|
+
responses: {
|
|
1491
|
+
/** @description OK */
|
|
1492
|
+
200: {
|
|
1493
|
+
headers: {
|
|
1494
|
+
[name: string]: unknown;
|
|
1495
|
+
};
|
|
1496
|
+
content: {
|
|
1497
|
+
"application/json": {
|
|
1498
|
+
/** @constant */
|
|
1499
|
+
type?: "slot_list";
|
|
1500
|
+
/** @description stable id for this answer, e.g. a hash of the query */
|
|
1501
|
+
id?: string;
|
|
1502
|
+
professional_id: string;
|
|
1503
|
+
service_id: string;
|
|
1504
|
+
timezone: string;
|
|
1505
|
+
slots: {
|
|
1506
|
+
/** Format: date-time */
|
|
1507
|
+
start: string;
|
|
1508
|
+
/** Format: date-time */
|
|
1509
|
+
end: string;
|
|
1510
|
+
}[];
|
|
1511
|
+
};
|
|
1512
|
+
};
|
|
1513
|
+
};
|
|
1514
|
+
default: components["responses"]["Problem"];
|
|
1515
|
+
};
|
|
1516
|
+
};
|
|
1517
|
+
get_quote: {
|
|
1518
|
+
parameters: {
|
|
1519
|
+
query?: never;
|
|
1520
|
+
header: {
|
|
1521
|
+
/** @description on every tool call in a session, a channel session's included (never on the catalogue sweep), the session's id; informational and not signed */
|
|
1522
|
+
"Vinaverse-Session"?: components["parameters"]["VinaverseSession"];
|
|
1523
|
+
/** @description on every tool call of a session that belongs to a conversation (never on the catalogue sweep), its id; informational and not signed */
|
|
1524
|
+
"Vinaverse-Conversation"?: components["parameters"]["VinaverseConversation"];
|
|
1525
|
+
"Idempotency-Key": string;
|
|
1526
|
+
};
|
|
1527
|
+
path?: never;
|
|
1528
|
+
cookie?: never;
|
|
1529
|
+
};
|
|
1530
|
+
requestBody: {
|
|
1531
|
+
content: {
|
|
1532
|
+
"application/json": {
|
|
1533
|
+
professional_id: string;
|
|
1534
|
+
service_id: string;
|
|
1535
|
+
/** Format: date-time */
|
|
1536
|
+
start: string;
|
|
1537
|
+
};
|
|
1538
|
+
};
|
|
1539
|
+
};
|
|
1540
|
+
responses: {
|
|
1541
|
+
/** @description OK */
|
|
1542
|
+
200: {
|
|
1543
|
+
headers: {
|
|
1544
|
+
[name: string]: unknown;
|
|
1545
|
+
};
|
|
1546
|
+
content: {
|
|
1547
|
+
"application/json": components["schemas"]["Quote"];
|
|
1548
|
+
};
|
|
1549
|
+
};
|
|
1550
|
+
default: components["responses"]["Problem"];
|
|
1551
|
+
};
|
|
1552
|
+
};
|
|
1553
|
+
list_my_bookings: {
|
|
1554
|
+
parameters: {
|
|
1555
|
+
query?: {
|
|
1556
|
+
scope?: "upcoming" | "past";
|
|
1557
|
+
limit?: number;
|
|
1558
|
+
};
|
|
1559
|
+
header?: {
|
|
1560
|
+
/** @description on every tool call in a session, a channel session's included (never on the catalogue sweep), the session's id; informational and not signed */
|
|
1561
|
+
"Vinaverse-Session"?: components["parameters"]["VinaverseSession"];
|
|
1562
|
+
/** @description on every tool call of a session that belongs to a conversation (never on the catalogue sweep), its id; informational and not signed */
|
|
1563
|
+
"Vinaverse-Conversation"?: components["parameters"]["VinaverseConversation"];
|
|
1564
|
+
};
|
|
1565
|
+
path?: never;
|
|
1566
|
+
cookie?: never;
|
|
1567
|
+
};
|
|
1568
|
+
requestBody?: never;
|
|
1569
|
+
responses: {
|
|
1570
|
+
/** @description OK */
|
|
1571
|
+
200: {
|
|
1572
|
+
headers: {
|
|
1573
|
+
[name: string]: unknown;
|
|
1574
|
+
};
|
|
1575
|
+
content: {
|
|
1576
|
+
"application/json": {
|
|
1577
|
+
bookings: components["schemas"]["Booking"][];
|
|
1578
|
+
};
|
|
1579
|
+
};
|
|
1580
|
+
};
|
|
1581
|
+
default: components["responses"]["Problem"];
|
|
1582
|
+
};
|
|
1583
|
+
};
|
|
1584
|
+
get_my_booking: {
|
|
1585
|
+
parameters: {
|
|
1586
|
+
query?: never;
|
|
1587
|
+
header?: {
|
|
1588
|
+
/** @description on every tool call in a session, a channel session's included (never on the catalogue sweep), the session's id; informational and not signed */
|
|
1589
|
+
"Vinaverse-Session"?: components["parameters"]["VinaverseSession"];
|
|
1590
|
+
/** @description on every tool call of a session that belongs to a conversation (never on the catalogue sweep), its id; informational and not signed */
|
|
1591
|
+
"Vinaverse-Conversation"?: components["parameters"]["VinaverseConversation"];
|
|
1592
|
+
};
|
|
1593
|
+
path: {
|
|
1594
|
+
id: string;
|
|
1595
|
+
};
|
|
1596
|
+
cookie?: never;
|
|
1597
|
+
};
|
|
1598
|
+
requestBody?: never;
|
|
1599
|
+
responses: {
|
|
1600
|
+
/** @description OK */
|
|
1601
|
+
200: {
|
|
1602
|
+
headers: {
|
|
1603
|
+
[name: string]: unknown;
|
|
1604
|
+
};
|
|
1605
|
+
content: {
|
|
1606
|
+
"application/json": components["schemas"]["Booking"];
|
|
1607
|
+
};
|
|
1608
|
+
};
|
|
1609
|
+
default: components["responses"]["Problem"];
|
|
1610
|
+
};
|
|
1611
|
+
};
|
|
1612
|
+
list_my_kits: {
|
|
1613
|
+
parameters: {
|
|
1614
|
+
query?: {
|
|
1615
|
+
scope?: "current" | "past";
|
|
1616
|
+
limit?: number;
|
|
1617
|
+
};
|
|
1618
|
+
header?: {
|
|
1619
|
+
/** @description on every tool call in a session, a channel session's included (never on the catalogue sweep), the session's id; informational and not signed */
|
|
1620
|
+
"Vinaverse-Session"?: components["parameters"]["VinaverseSession"];
|
|
1621
|
+
/** @description on every tool call of a session that belongs to a conversation (never on the catalogue sweep), its id; informational and not signed */
|
|
1622
|
+
"Vinaverse-Conversation"?: components["parameters"]["VinaverseConversation"];
|
|
1623
|
+
};
|
|
1624
|
+
path?: never;
|
|
1625
|
+
cookie?: never;
|
|
1626
|
+
};
|
|
1627
|
+
requestBody?: never;
|
|
1628
|
+
responses: {
|
|
1629
|
+
/** @description OK */
|
|
1630
|
+
200: {
|
|
1631
|
+
headers: {
|
|
1632
|
+
[name: string]: unknown;
|
|
1633
|
+
};
|
|
1634
|
+
content: {
|
|
1635
|
+
"application/json": {
|
|
1636
|
+
kits: components["schemas"]["Kit"][];
|
|
1637
|
+
};
|
|
1638
|
+
};
|
|
1639
|
+
};
|
|
1640
|
+
default: components["responses"]["Problem"];
|
|
1641
|
+
};
|
|
1642
|
+
};
|
|
1643
|
+
get_my_kit: {
|
|
1644
|
+
parameters: {
|
|
1645
|
+
query?: never;
|
|
1646
|
+
header?: {
|
|
1647
|
+
/** @description on every tool call in a session, a channel session's included (never on the catalogue sweep), the session's id; informational and not signed */
|
|
1648
|
+
"Vinaverse-Session"?: components["parameters"]["VinaverseSession"];
|
|
1649
|
+
/** @description on every tool call of a session that belongs to a conversation (never on the catalogue sweep), its id; informational and not signed */
|
|
1650
|
+
"Vinaverse-Conversation"?: components["parameters"]["VinaverseConversation"];
|
|
1651
|
+
};
|
|
1652
|
+
path: {
|
|
1653
|
+
id: string;
|
|
1654
|
+
};
|
|
1655
|
+
cookie?: never;
|
|
1656
|
+
};
|
|
1657
|
+
requestBody?: never;
|
|
1658
|
+
responses: {
|
|
1659
|
+
/** @description OK */
|
|
1660
|
+
200: {
|
|
1661
|
+
headers: {
|
|
1662
|
+
[name: string]: unknown;
|
|
1663
|
+
};
|
|
1664
|
+
content: {
|
|
1665
|
+
"application/json": components["schemas"]["Kit"];
|
|
1666
|
+
};
|
|
1667
|
+
};
|
|
1668
|
+
default: components["responses"]["Problem"];
|
|
1669
|
+
};
|
|
1670
|
+
};
|
|
1671
|
+
list_my_orders: {
|
|
1672
|
+
parameters: {
|
|
1673
|
+
query?: {
|
|
1674
|
+
kit_id?: string;
|
|
1675
|
+
limit?: number;
|
|
1676
|
+
};
|
|
1677
|
+
header?: {
|
|
1678
|
+
/** @description on every tool call in a session, a channel session's included (never on the catalogue sweep), the session's id; informational and not signed */
|
|
1679
|
+
"Vinaverse-Session"?: components["parameters"]["VinaverseSession"];
|
|
1680
|
+
/** @description on every tool call of a session that belongs to a conversation (never on the catalogue sweep), its id; informational and not signed */
|
|
1681
|
+
"Vinaverse-Conversation"?: components["parameters"]["VinaverseConversation"];
|
|
1682
|
+
};
|
|
1683
|
+
path?: never;
|
|
1684
|
+
cookie?: never;
|
|
1685
|
+
};
|
|
1686
|
+
requestBody?: never;
|
|
1687
|
+
responses: {
|
|
1688
|
+
/** @description OK */
|
|
1689
|
+
200: {
|
|
1690
|
+
headers: {
|
|
1691
|
+
[name: string]: unknown;
|
|
1692
|
+
};
|
|
1693
|
+
content: {
|
|
1694
|
+
"application/json": {
|
|
1695
|
+
orders: components["schemas"]["Order"][];
|
|
1696
|
+
};
|
|
1697
|
+
};
|
|
1698
|
+
};
|
|
1699
|
+
default: components["responses"]["Problem"];
|
|
1700
|
+
};
|
|
1701
|
+
};
|
|
1702
|
+
get_my_order: {
|
|
1703
|
+
parameters: {
|
|
1704
|
+
query?: never;
|
|
1705
|
+
header?: {
|
|
1706
|
+
/** @description on every tool call in a session, a channel session's included (never on the catalogue sweep), the session's id; informational and not signed */
|
|
1707
|
+
"Vinaverse-Session"?: components["parameters"]["VinaverseSession"];
|
|
1708
|
+
/** @description on every tool call of a session that belongs to a conversation (never on the catalogue sweep), its id; informational and not signed */
|
|
1709
|
+
"Vinaverse-Conversation"?: components["parameters"]["VinaverseConversation"];
|
|
1710
|
+
};
|
|
1711
|
+
path: {
|
|
1712
|
+
id: string;
|
|
1713
|
+
};
|
|
1714
|
+
cookie?: never;
|
|
1715
|
+
};
|
|
1716
|
+
requestBody?: never;
|
|
1717
|
+
responses: {
|
|
1718
|
+
/** @description OK */
|
|
1719
|
+
200: {
|
|
1720
|
+
headers: {
|
|
1721
|
+
[name: string]: unknown;
|
|
1722
|
+
};
|
|
1723
|
+
content: {
|
|
1724
|
+
"application/json": components["schemas"]["Order"];
|
|
1725
|
+
};
|
|
1726
|
+
};
|
|
1727
|
+
default: components["responses"]["Problem"];
|
|
1728
|
+
};
|
|
1729
|
+
};
|
|
1730
|
+
get_policy: {
|
|
1731
|
+
parameters: {
|
|
1732
|
+
query?: never;
|
|
1733
|
+
header?: {
|
|
1734
|
+
/** @description on every tool call in a session, a channel session's included (never on the catalogue sweep), the session's id; informational and not signed */
|
|
1735
|
+
"Vinaverse-Session"?: components["parameters"]["VinaverseSession"];
|
|
1736
|
+
/** @description on every tool call of a session that belongs to a conversation (never on the catalogue sweep), its id; informational and not signed */
|
|
1737
|
+
"Vinaverse-Conversation"?: components["parameters"]["VinaverseConversation"];
|
|
1738
|
+
};
|
|
1739
|
+
path: {
|
|
1740
|
+
/** @description A marketplace's topics, and a retailer's: `shipping` (delivery times and costs), `returns`, `exchanges`, `billing` (when and how kept items are charged) and `kit_window` (how long a customer has to decide and to send items back). Answers about a rule come only from the tenant's published document. */
|
|
1741
|
+
topic: "fees" | "cancellation" | "refunds" | "no_show" | "rentals" | "classes" | "rent_links" | "payments" | "account" | "safety" | "reviews" | "shipping" | "returns" | "exchanges" | "billing" | "kit_window";
|
|
1742
|
+
};
|
|
1743
|
+
cookie?: never;
|
|
1744
|
+
};
|
|
1745
|
+
requestBody?: never;
|
|
1746
|
+
responses: {
|
|
1747
|
+
/** @description OK */
|
|
1748
|
+
200: {
|
|
1749
|
+
headers: {
|
|
1750
|
+
[name: string]: unknown;
|
|
1751
|
+
};
|
|
1752
|
+
content: {
|
|
1753
|
+
"application/json": components["schemas"]["Policy"];
|
|
1754
|
+
};
|
|
1755
|
+
};
|
|
1756
|
+
default: components["responses"]["Problem"];
|
|
1757
|
+
};
|
|
1758
|
+
};
|
|
1759
|
+
get_setup_state: {
|
|
1760
|
+
parameters: {
|
|
1761
|
+
query?: never;
|
|
1762
|
+
header?: {
|
|
1763
|
+
/** @description on every tool call in a session, a channel session's included (never on the catalogue sweep), the session's id; informational and not signed */
|
|
1764
|
+
"Vinaverse-Session"?: components["parameters"]["VinaverseSession"];
|
|
1765
|
+
/** @description on every tool call of a session that belongs to a conversation (never on the catalogue sweep), its id; informational and not signed */
|
|
1766
|
+
"Vinaverse-Conversation"?: components["parameters"]["VinaverseConversation"];
|
|
1767
|
+
};
|
|
1768
|
+
path?: never;
|
|
1769
|
+
cookie?: never;
|
|
1770
|
+
};
|
|
1771
|
+
requestBody?: never;
|
|
1772
|
+
responses: {
|
|
1773
|
+
/** @description OK */
|
|
1774
|
+
200: {
|
|
1775
|
+
headers: {
|
|
1776
|
+
[name: string]: unknown;
|
|
1777
|
+
};
|
|
1778
|
+
content: {
|
|
1779
|
+
"application/json": components["schemas"]["SetupState"];
|
|
1780
|
+
};
|
|
1781
|
+
};
|
|
1782
|
+
default: components["responses"]["Problem"];
|
|
1783
|
+
};
|
|
1784
|
+
};
|
|
1785
|
+
create_handoff: {
|
|
1786
|
+
parameters: {
|
|
1787
|
+
query?: never;
|
|
1788
|
+
header: {
|
|
1789
|
+
/** @description on every tool call in a session, a channel session's included (never on the catalogue sweep), the session's id; informational and not signed */
|
|
1790
|
+
"Vinaverse-Session"?: components["parameters"]["VinaverseSession"];
|
|
1791
|
+
/** @description on every tool call of a session that belongs to a conversation (never on the catalogue sweep), its id; informational and not signed */
|
|
1792
|
+
"Vinaverse-Conversation"?: components["parameters"]["VinaverseConversation"];
|
|
1793
|
+
"Idempotency-Key": string;
|
|
1794
|
+
};
|
|
1795
|
+
path?: never;
|
|
1796
|
+
cookie?: never;
|
|
1797
|
+
};
|
|
1798
|
+
requestBody: {
|
|
1799
|
+
content: {
|
|
1800
|
+
"application/json": {
|
|
1801
|
+
/**
|
|
1802
|
+
* @description A marketplace's categories, and a retailer's: `order_or_delivery` (a kit or order that is late, lost or wrong), `return_or_exchange`, `product_quality` (an item damaged or faulty) and `fit_or_sizing`.
|
|
1803
|
+
* @enum {string}
|
|
1804
|
+
*/
|
|
1805
|
+
category: "booking_problem" | "payment_or_refund" | "account_access" | "safety_concern" | "listing_issue" | "complaint" | "asked_for_human" | "assistant_could_not_help" | "other" | "order_or_delivery" | "return_or_exchange" | "product_quality" | "fit_or_sizing";
|
|
1806
|
+
/** @description written by the agent for the support person who picks it up */
|
|
1807
|
+
summary: string;
|
|
1808
|
+
/** @enum {string} */
|
|
1809
|
+
urgency: "normal" | "high";
|
|
1810
|
+
related?: {
|
|
1811
|
+
/** @enum {string} */
|
|
1812
|
+
type: "booking" | "professional" | "workspace" | "quote" | "kit" | "kit_item" | "order";
|
|
1813
|
+
id: string;
|
|
1814
|
+
}[];
|
|
1815
|
+
vinaverse_session_id?: string;
|
|
1816
|
+
/**
|
|
1817
|
+
* Format: uri
|
|
1818
|
+
* @description a signed Vinaverse URL, valid 30 days, where staff can read the conversation
|
|
1819
|
+
*/
|
|
1820
|
+
transcript_url?: string;
|
|
1821
|
+
};
|
|
1822
|
+
};
|
|
1823
|
+
};
|
|
1824
|
+
responses: {
|
|
1825
|
+
/** @description Created */
|
|
1826
|
+
201: {
|
|
1827
|
+
headers: {
|
|
1828
|
+
[name: string]: unknown;
|
|
1829
|
+
};
|
|
1830
|
+
content: {
|
|
1831
|
+
"application/json": {
|
|
1832
|
+
/** @constant */
|
|
1833
|
+
type: "ticket";
|
|
1834
|
+
id: string;
|
|
1835
|
+
/**
|
|
1836
|
+
* @description When and how a person will reply, as a phrase that completes the sentence the runtime says after a handoff, "I've passed this to the support team, and they'll reply {expected_response}.": `within one business day by email`, never a sentence of its own (no capital letter at the start, no full stop at the end).
|
|
1837
|
+
* @example within one business day by email
|
|
1838
|
+
* @example by email within 1 business day
|
|
1839
|
+
*/
|
|
1840
|
+
expected_response: string;
|
|
1841
|
+
};
|
|
1842
|
+
};
|
|
1843
|
+
};
|
|
1844
|
+
default: components["responses"]["Problem"];
|
|
1845
|
+
};
|
|
1846
|
+
};
|
|
1847
|
+
create_proposal: {
|
|
1848
|
+
parameters: {
|
|
1849
|
+
query?: never;
|
|
1850
|
+
header: {
|
|
1851
|
+
/** @description on every tool call in a session, a channel session's included (never on the catalogue sweep), the session's id; informational and not signed */
|
|
1852
|
+
"Vinaverse-Session"?: components["parameters"]["VinaverseSession"];
|
|
1853
|
+
/** @description on every tool call of a session that belongs to a conversation (never on the catalogue sweep), its id; informational and not signed */
|
|
1854
|
+
"Vinaverse-Conversation"?: components["parameters"]["VinaverseConversation"];
|
|
1855
|
+
"Idempotency-Key": string;
|
|
1856
|
+
};
|
|
1857
|
+
path?: never;
|
|
1858
|
+
cookie?: never;
|
|
1859
|
+
};
|
|
1860
|
+
requestBody: {
|
|
1861
|
+
content: {
|
|
1862
|
+
"application/json": {
|
|
1863
|
+
/**
|
|
1864
|
+
* @example business_address
|
|
1865
|
+
* @example opening_hours
|
|
1866
|
+
*/
|
|
1867
|
+
topic: string;
|
|
1868
|
+
/** @description by field key, the proposed value, in the shape of one of the `ProposalField` types */
|
|
1869
|
+
changes: {
|
|
1870
|
+
[key: string]: string | components["schemas"]["ProposalMoney"] | components["schemas"]["TimeRange"] | components["schemas"]["PostalAddress"] | components["schemas"]["TextList"] | components["schemas"]["WeeklyHours"];
|
|
1871
|
+
};
|
|
1872
|
+
/** @description what the person said that led to it */
|
|
1873
|
+
reason?: string;
|
|
1874
|
+
};
|
|
1875
|
+
};
|
|
1876
|
+
};
|
|
1877
|
+
responses: {
|
|
1878
|
+
/** @description Created, pending */
|
|
1879
|
+
201: {
|
|
1880
|
+
headers: {
|
|
1881
|
+
[name: string]: unknown;
|
|
1882
|
+
};
|
|
1883
|
+
content: {
|
|
1884
|
+
"application/json": components["schemas"]["Proposal"];
|
|
1885
|
+
};
|
|
1886
|
+
};
|
|
1887
|
+
/** @description The `Idempotency-Key` was already used with a different `{topic, changes}`; nothing new was created */
|
|
1888
|
+
409: {
|
|
1889
|
+
headers: {
|
|
1890
|
+
[name: string]: unknown;
|
|
1891
|
+
};
|
|
1892
|
+
content: {
|
|
1893
|
+
"application/problem+json": {
|
|
1894
|
+
/** @constant */
|
|
1895
|
+
status: 409;
|
|
1896
|
+
/** @constant */
|
|
1897
|
+
code: "IDEMPOTENCY_KEY_REUSED";
|
|
1898
|
+
proposal: components["schemas"]["Proposal"];
|
|
1899
|
+
detail?: string;
|
|
1900
|
+
};
|
|
1901
|
+
};
|
|
1902
|
+
};
|
|
1903
|
+
default: components["responses"]["Problem"];
|
|
1904
|
+
};
|
|
1905
|
+
};
|
|
1906
|
+
get_flow_definition: {
|
|
1907
|
+
parameters: {
|
|
1908
|
+
query?: {
|
|
1909
|
+
/** @description the version the conversation started on; absent, the version currently published */
|
|
1910
|
+
version?: number;
|
|
1911
|
+
};
|
|
1912
|
+
header?: {
|
|
1913
|
+
/** @description on every tool call in a session, a channel session's included (never on the catalogue sweep), the session's id; informational and not signed */
|
|
1914
|
+
"Vinaverse-Session"?: components["parameters"]["VinaverseSession"];
|
|
1915
|
+
/** @description on every tool call of a session that belongs to a conversation (never on the catalogue sweep), its id; informational and not signed */
|
|
1916
|
+
"Vinaverse-Conversation"?: components["parameters"]["VinaverseConversation"];
|
|
1917
|
+
};
|
|
1918
|
+
path: {
|
|
1919
|
+
/** @description the flow's name, as registered for the tenant in Studio */
|
|
1920
|
+
flow: components["parameters"]["Flow"];
|
|
1921
|
+
};
|
|
1922
|
+
cookie?: never;
|
|
1923
|
+
};
|
|
1924
|
+
requestBody?: never;
|
|
1925
|
+
responses: {
|
|
1926
|
+
/** @description OK */
|
|
1927
|
+
200: {
|
|
1928
|
+
headers: {
|
|
1929
|
+
[name: string]: unknown;
|
|
1930
|
+
};
|
|
1931
|
+
content: {
|
|
1932
|
+
"application/json": components["schemas"]["FlowDefinition"];
|
|
1933
|
+
};
|
|
1934
|
+
};
|
|
1935
|
+
/** @description The requested `version` is no longer accepted; fetch the current version (no `version`) */
|
|
1936
|
+
410: {
|
|
1937
|
+
headers: {
|
|
1938
|
+
[name: string]: unknown;
|
|
1939
|
+
};
|
|
1940
|
+
content: {
|
|
1941
|
+
"application/problem+json": {
|
|
1942
|
+
/** @constant */
|
|
1943
|
+
status: 410;
|
|
1944
|
+
/** @constant */
|
|
1945
|
+
code: "VERSION_GONE";
|
|
1946
|
+
detail?: string;
|
|
1947
|
+
};
|
|
1948
|
+
};
|
|
1949
|
+
};
|
|
1950
|
+
default: components["responses"]["Problem"];
|
|
1951
|
+
};
|
|
1952
|
+
};
|
|
1953
|
+
submit_flow: {
|
|
1954
|
+
parameters: {
|
|
1955
|
+
query?: never;
|
|
1956
|
+
header?: {
|
|
1957
|
+
/** @description on every tool call in a session, a channel session's included (never on the catalogue sweep), the session's id; informational and not signed */
|
|
1958
|
+
"Vinaverse-Session"?: components["parameters"]["VinaverseSession"];
|
|
1959
|
+
/** @description on every tool call of a session that belongs to a conversation (never on the catalogue sweep), its id; informational and not signed */
|
|
1960
|
+
"Vinaverse-Conversation"?: components["parameters"]["VinaverseConversation"];
|
|
1961
|
+
};
|
|
1962
|
+
path: {
|
|
1963
|
+
/** @description the flow's name, as registered for the tenant in Studio */
|
|
1964
|
+
flow: components["parameters"]["Flow"];
|
|
1965
|
+
};
|
|
1966
|
+
cookie?: never;
|
|
1967
|
+
};
|
|
1968
|
+
requestBody: {
|
|
1969
|
+
content: {
|
|
1970
|
+
"application/json": components["schemas"]["FlowSubmission"];
|
|
1971
|
+
};
|
|
1972
|
+
};
|
|
1973
|
+
responses: {
|
|
1974
|
+
/** @description Accepted */
|
|
1975
|
+
200: {
|
|
1976
|
+
headers: {
|
|
1977
|
+
[name: string]: unknown;
|
|
1978
|
+
};
|
|
1979
|
+
content: {
|
|
1980
|
+
"application/json": {
|
|
1981
|
+
/** @constant */
|
|
1982
|
+
ok: true;
|
|
1983
|
+
};
|
|
1984
|
+
};
|
|
1985
|
+
};
|
|
1986
|
+
/** @description The `submission_id` was already used with a different body; nothing new was stored */
|
|
1987
|
+
409: {
|
|
1988
|
+
headers: {
|
|
1989
|
+
[name: string]: unknown;
|
|
1990
|
+
};
|
|
1991
|
+
content: {
|
|
1992
|
+
"application/problem+json": components["schemas"]["FlowSubmissionConflict"];
|
|
1993
|
+
};
|
|
1994
|
+
};
|
|
1995
|
+
/** @description Refused; nothing was stored as accepted */
|
|
1996
|
+
422: {
|
|
1997
|
+
headers: {
|
|
1998
|
+
[name: string]: unknown;
|
|
1999
|
+
};
|
|
2000
|
+
content: {
|
|
2001
|
+
"application/problem+json": components["schemas"]["FlowSubmissionRefusal"];
|
|
2002
|
+
};
|
|
2003
|
+
};
|
|
2004
|
+
default: components["responses"]["Problem"];
|
|
2005
|
+
};
|
|
2006
|
+
};
|
|
2007
|
+
}
|
|
2008
|
+
|
|
2009
|
+
/**
|
|
2010
|
+
* Why a tool call's signature was refused, in the conformance vectors' words
|
|
2011
|
+
* (vinaverse-contracts `conformance/tool-calls.json`), checked in their order:
|
|
2012
|
+
* - `missing`: no `Vinaverse-Signature` header.
|
|
2013
|
+
* - `malformed`: no valid `t`, or no valid nonce (16 to 64 of `A-Z a-z 0-9 - _`).
|
|
2014
|
+
* - `stale`: signed more than 300 seconds from now, either way.
|
|
2015
|
+
* - `v2_required`: no `v2` (a v1-only header binds neither the token nor a nonce).
|
|
2016
|
+
* - `mismatch`: no `v2` matches with any secret: a wrong secret, or a method,
|
|
2017
|
+
* target, delegated token or body other than the ones signed.
|
|
2018
|
+
* - `replayed`: a valid signature whose nonce was already taken.
|
|
2019
|
+
*/
|
|
2020
|
+
type ToolSignatureErrorCode = 'missing' | 'malformed' | 'stale' | 'v2_required' | 'mismatch' | 'replayed';
|
|
2021
|
+
interface ToolSignatureError {
|
|
2022
|
+
readonly code: ToolSignatureErrorCode;
|
|
2023
|
+
readonly message: string;
|
|
2024
|
+
}
|
|
2025
|
+
interface ToolCallToVerify {
|
|
2026
|
+
/** The HTTP method. */
|
|
2027
|
+
method: string;
|
|
2028
|
+
/** The request target exactly as received: path and query, still percent-escaped. */
|
|
2029
|
+
target: string;
|
|
2030
|
+
/** The delegated token from the `Authorization: Bearer` header. */
|
|
2031
|
+
token: string;
|
|
2032
|
+
/** The body as received; `undefined`, `null` or empty for none. */
|
|
2033
|
+
body?: Uint8Array | null | undefined;
|
|
2034
|
+
/** The `Vinaverse-Signature` header. */
|
|
2035
|
+
header: string | null | undefined;
|
|
2036
|
+
}
|
|
2037
|
+
interface VerifyToolCallOptions {
|
|
2038
|
+
/** The tool signing secret, or two during a rotation. */
|
|
2039
|
+
secrets: readonly string[];
|
|
2040
|
+
nonces: NonceStore;
|
|
2041
|
+
now: Date;
|
|
2042
|
+
toleranceSeconds?: number;
|
|
2043
|
+
}
|
|
2044
|
+
/**
|
|
2045
|
+
* Checks a tool call's v2 signature and takes its nonce. Returns null when the
|
|
2046
|
+
* call is authentic and fresh. The nonce is claimed only after a signature
|
|
2047
|
+
* matched, so a forged header cannot burn a real call's nonce.
|
|
2048
|
+
*/
|
|
2049
|
+
declare function verifyToolCall(call: ToolCallToVerify, options: VerifyToolCallOptions): Promise<ToolSignatureError | null>;
|
|
2050
|
+
|
|
2051
|
+
type Op<K extends ToolOperationId> = operations[K];
|
|
2052
|
+
type ParamsOf<K extends ToolOperationId, Where extends string> = Op<K>['parameters'] extends Record<Where, infer P> ? [P] extends [never | undefined] ? Record<string, never> : NonNullable<P> : Record<string, never>;
|
|
2053
|
+
/** A tool's request body, as the contract types it. */
|
|
2054
|
+
type ToolBody<K extends ToolOperationId> = Op<K> extends {
|
|
2055
|
+
requestBody: {
|
|
2056
|
+
content: {
|
|
2057
|
+
'application/json': infer B;
|
|
2058
|
+
};
|
|
2059
|
+
};
|
|
2060
|
+
} ? B : Op<K> extends {
|
|
2061
|
+
requestBody?: {
|
|
2062
|
+
content: {
|
|
2063
|
+
'application/json': infer B;
|
|
2064
|
+
};
|
|
2065
|
+
};
|
|
2066
|
+
} ? B | undefined : undefined;
|
|
2067
|
+
type SuccessOf<R> = R extends {
|
|
2068
|
+
200: infer S;
|
|
2069
|
+
} ? S : R extends {
|
|
2070
|
+
201: infer S;
|
|
2071
|
+
} ? S : never;
|
|
2072
|
+
/** A tool's success result, as the contract types it. */
|
|
2073
|
+
type ToolResult<K extends ToolOperationId> = SuccessOf<Op<K>['responses']> extends {
|
|
2074
|
+
content: {
|
|
2075
|
+
'application/json': infer B;
|
|
2076
|
+
};
|
|
2077
|
+
} ? B : never;
|
|
2078
|
+
/** What a handler receives. */
|
|
2079
|
+
interface ToolCall<K extends ToolOperationId, P> {
|
|
2080
|
+
readonly operation: K;
|
|
2081
|
+
/** What `authenticate` returned for the delegated token. */
|
|
2082
|
+
readonly principal: P;
|
|
2083
|
+
/** The session's delegated token (verified as signed; its meaning is the tenant's). */
|
|
2084
|
+
readonly token: string;
|
|
2085
|
+
readonly params: ParamsOf<K, 'path'>;
|
|
2086
|
+
readonly query: ParamsOf<K, 'query'>;
|
|
2087
|
+
readonly body: ToolBody<K>;
|
|
2088
|
+
/** The informational headers Vinaverse sends (not signed). */
|
|
2089
|
+
readonly session: {
|
|
2090
|
+
readonly id?: string;
|
|
2091
|
+
readonly conversationId?: string;
|
|
2092
|
+
readonly toolCallId?: string;
|
|
2093
|
+
readonly requestId?: string;
|
|
2094
|
+
};
|
|
2095
|
+
readonly idempotencyKey?: string;
|
|
2096
|
+
}
|
|
2097
|
+
/**
|
|
2098
|
+
* A handler per served operation; one the tenant does not serve answers 404.
|
|
2099
|
+
* Handlers validate what they act on: the toolkit checks the call's origin and
|
|
2100
|
+
* shape, not the meaning of its values. A `submit_flow` handler refuses only
|
|
2101
|
+
* with `ToolRefusal.flowRefused` (the contract's `FlowSubmissionRefusal`); any
|
|
2102
|
+
* other 422 from it is answered as a 500 and reported to `onError`.
|
|
2103
|
+
*/
|
|
2104
|
+
type ToolHandlers<P> = {
|
|
2105
|
+
[K in ToolOperationId]?: (call: ToolCall<K, P>) => K extends 'submit_flow' ? Accepting : Promise<ToolResult<K>> | ToolResult<K>;
|
|
2106
|
+
};
|
|
2107
|
+
type Accepted = ToolResult<'submit_flow'>;
|
|
2108
|
+
type Accepting = Promise<void | Accepted> | void | Accepted;
|
|
2109
|
+
interface ToolProviderOptions<P> {
|
|
2110
|
+
/** The tool signing secret, or two during a rotation. */
|
|
2111
|
+
secret: string | readonly string[];
|
|
2112
|
+
/** Where nonces are taken: shared by every instance (`@vinaverse/server/stores`). */
|
|
2113
|
+
nonces: NonceStore;
|
|
2114
|
+
/** Where idempotent answers are kept: shared by every instance. */
|
|
2115
|
+
idempotency: IdempotencyStore;
|
|
2116
|
+
/**
|
|
2117
|
+
* The path of the tool base URL registered in Studio (`/api/v2/ai` for
|
|
2118
|
+
* `https://tenant.example.com/api/v2/ai`); routes are matched below it.
|
|
2119
|
+
*/
|
|
2120
|
+
basePath?: string;
|
|
2121
|
+
/**
|
|
2122
|
+
* Resolves the delegated token to the tenant's principal (the person and
|
|
2123
|
+
* what the token lets them do). Throw `ToolRefusal.tokenExpired()` for a
|
|
2124
|
+
* token that is not valid.
|
|
2125
|
+
*/
|
|
2126
|
+
authenticate(token: string, operation: ToolOperationId): Promise<P> | P;
|
|
2127
|
+
handlers: ToolHandlers<P>;
|
|
2128
|
+
/**
|
|
2129
|
+
* For `create_proposal`: the stored proposal's current state, read again on
|
|
2130
|
+
* a replay (the contract returns its current `status`). Default: as stored.
|
|
2131
|
+
*/
|
|
2132
|
+
currentProposal?(stored: ToolResult<'create_proposal'>, principal: P): Promise<ToolResult<'create_proposal'>> | ToolResult<'create_proposal'>;
|
|
2133
|
+
/**
|
|
2134
|
+
* An error the toolkit answered with a 500 (a handler's, a result over its
|
|
2135
|
+
* limit, a refusal the contract does not allow), or one it worked around (an
|
|
2136
|
+
* answer it could not store).
|
|
2137
|
+
*/
|
|
2138
|
+
onError?(error: unknown, operation: ToolOperationId | undefined): void;
|
|
2139
|
+
/**
|
|
2140
|
+
* A call whose signature was refused, with the reason (`stale`, `mismatch`,
|
|
2141
|
+
* `replayed`, …): the 403 itself says only that the signature was refused.
|
|
2142
|
+
*/
|
|
2143
|
+
onRefused?(reason: ToolSignatureErrorCode, message: string): void;
|
|
2144
|
+
/**
|
|
2145
|
+
* Scopes idempotent answers, for example to the tenant or environment of the
|
|
2146
|
+
* principal: a stored answer is replayed only to a call with the same scope.
|
|
2147
|
+
*/
|
|
2148
|
+
scope?(principal: P, operation: ToolOperationId): string;
|
|
2149
|
+
/**
|
|
2150
|
+
* How long a running call holds its idempotency key, in seconds; default 60.
|
|
2151
|
+
* Set it above the longest your handlers can run: a resend after it lapses
|
|
2152
|
+
* runs the handler again.
|
|
2153
|
+
*/
|
|
2154
|
+
leaseSeconds?: number;
|
|
2155
|
+
/** The largest request body accepted, in bytes; default 1 MiB. */
|
|
2156
|
+
maxRequestBytes?: number;
|
|
2157
|
+
toleranceSeconds?: number;
|
|
2158
|
+
now?: () => Date;
|
|
2159
|
+
}
|
|
2160
|
+
interface ToolRequest {
|
|
2161
|
+
method: string;
|
|
2162
|
+
/** The request target exactly as received: path and query, percent-escaped. */
|
|
2163
|
+
target: string;
|
|
2164
|
+
/** Header lookup by name, any case. */
|
|
2165
|
+
header(name: string): string | undefined;
|
|
2166
|
+
body: string | Uint8Array | ArrayBuffer | null | undefined;
|
|
2167
|
+
}
|
|
2168
|
+
interface ToolResponse {
|
|
2169
|
+
readonly status: number;
|
|
2170
|
+
readonly headers: Readonly<Record<string, string>>;
|
|
2171
|
+
readonly body: string;
|
|
2172
|
+
}
|
|
2173
|
+
/** How long idempotent answers are kept (seconds), and a pending call holds its key. */
|
|
2174
|
+
declare const KEEP_SECONDS: {
|
|
2175
|
+
readonly submit_flow: number;
|
|
2176
|
+
readonly create_proposal: number;
|
|
2177
|
+
readonly default: 86400;
|
|
2178
|
+
readonly pending: 60;
|
|
2179
|
+
};
|
|
2180
|
+
declare const MAX_REQUEST_BYTES: number;
|
|
2181
|
+
/** A run's idempotency lease lapsed and another run took the key: its answer was sent but not stored. */
|
|
2182
|
+
declare class LeaseLostError extends Error {
|
|
2183
|
+
constructor(operation: ToolOperationId, leaseSeconds: number);
|
|
2184
|
+
}
|
|
2185
|
+
declare class ResultTooLargeError extends Error {
|
|
2186
|
+
constructor(operation: ToolOperationId, bytes: number, limit: number);
|
|
2187
|
+
}
|
|
2188
|
+
interface ToolProvider {
|
|
2189
|
+
handle(request: ToolRequest): Promise<ToolResponse>;
|
|
2190
|
+
}
|
|
2191
|
+
declare function createToolProvider<P>(options: ToolProviderOptions<P>): ToolProvider;
|
|
2192
|
+
|
|
2193
|
+
export { verifyToolCall as A, type ConversationEvent as C, KEEP_SECONDS as K, LeaseLostError as L, MAX_REQUEST_BYTES as M, type ReadBody as R, type ToolProvider as T, type WebhookHandlerOptions as W, type WebhookError as a, type ConversationEventType as b, type ConversationState as c, ResultTooLargeError as d, TOOL_OPERATIONS as e, type ToolBody as f, type ToolCall as g, type components as h, type ToolHandlers as i, type ToolOperationId as j, type ToolProviderOptions as k, type ToolRequest as l, type ToolResponse as m, type ToolResult as n, type operations as o, type ToolSignatureError as p, type ToolSignatureErrorCode as q, WEBHOOK_EVENT_TYPES as r, type WebhookEnvelope as s, type WebhookErrorCode as t, type WebhookEvent as u, type WebhookEventOf as v, type WebhookEventType as w, type WebhookResponse as x, createToolProvider as y, isConversationEvent as z };
|