@noodleseed/one 0.176.0 → 0.177.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/commands/solutions-conversations.d.ts +6 -0
- package/dist/commands/solutions-conversations.d.ts.map +1 -0
- package/dist/commands/solutions-conversations.js +137 -0
- package/dist/commands/solutions-conversations.js.map +1 -0
- package/dist/commands/solutions-ops.d.ts.map +1 -1
- package/dist/commands/solutions-ops.js +3 -0
- package/dist/commands/solutions-ops.js.map +1 -1
- package/node_modules/@noodle-borg/cli-catalog/dist/catalog-data-solution-conversations.js +97 -0
- package/node_modules/@noodle-borg/cli-catalog/dist/catalog-data-solutions.js +2 -0
- package/node_modules/@noodle-borg/service/dist/channels/provider.js +40 -4
- package/node_modules/@noodle-borg/service/dist/conversation-history/operator.js +184 -0
- package/node_modules/@noodle-borg/service/dist/routes/business-information-conversations.js +65 -0
- package/node_modules/@noodle-borg/service/dist/routes/business-information-dispatch.js +3 -0
- package/node_modules/@noodle-borg/service/dist/routes/business-information-paths.js +16 -0
- package/node_modules/@noodle-borg/service/dist/service-history-projections.js +24 -0
- package/node_modules/@noodle-borg/service/dist/service.js +3 -7
- package/node_modules/@noodle-borg/wire-contracts/dist/conversation-history.d.ts +347 -0
- package/node_modules/@noodle-borg/wire-contracts/dist/conversation-history.js +120 -0
- package/node_modules/@noodle-borg/wire-contracts/dist/index.d.ts +1 -0
- package/node_modules/@noodle-borg/wire-contracts/dist/index.js +1 -0
- package/node_modules/@noodle-borg/wire-contracts/dist/whatsapp.d.ts +2 -2
- package/package.json +1 -1
|
@@ -0,0 +1,347 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
/**
|
|
3
|
+
* Staff projection of durable conversation history (ADR 0241). Server output is strict; the tolerant
|
|
4
|
+
* `*ClientResponseSchema` variants let older clients ignore additive fields.
|
|
5
|
+
*/
|
|
6
|
+
export declare const ConversationIdSchema: z.ZodString;
|
|
7
|
+
export declare const ConversationChannelSchema: z.ZodEnum<{
|
|
8
|
+
whatsapp: "whatsapp";
|
|
9
|
+
website: "website";
|
|
10
|
+
}>;
|
|
11
|
+
export declare const ConversationSummarySchema: z.ZodObject<{
|
|
12
|
+
id: z.ZodString;
|
|
13
|
+
channel: z.ZodEnum<{
|
|
14
|
+
whatsapp: "whatsapp";
|
|
15
|
+
website: "website";
|
|
16
|
+
}>;
|
|
17
|
+
subject: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
18
|
+
kind: z.ZodLiteral<"anonymous">;
|
|
19
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
20
|
+
kind: z.ZodLiteral<"customer">;
|
|
21
|
+
ref: z.ZodString;
|
|
22
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
23
|
+
kind: z.ZodLiteral<"participant">;
|
|
24
|
+
ref: z.ZodString;
|
|
25
|
+
}, z.core.$strict>], "kind">;
|
|
26
|
+
startedAt: z.ZodISODateTime;
|
|
27
|
+
lastMessageAt: z.ZodISODateTime;
|
|
28
|
+
itemCount: z.ZodNumber;
|
|
29
|
+
}, z.core.$strict>;
|
|
30
|
+
export declare const ConversationItemSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
31
|
+
kind: z.ZodLiteral<"message">;
|
|
32
|
+
role: z.ZodEnum<{
|
|
33
|
+
assistant: "assistant";
|
|
34
|
+
user: "user";
|
|
35
|
+
}>;
|
|
36
|
+
text: z.ZodString;
|
|
37
|
+
at: z.ZodISODateTime;
|
|
38
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
39
|
+
kind: z.ZodLiteral<"outcome">;
|
|
40
|
+
interactionId: z.ZodString;
|
|
41
|
+
tool: z.ZodString;
|
|
42
|
+
status: z.ZodEnum<{
|
|
43
|
+
failed: "failed";
|
|
44
|
+
succeeded: "succeeded";
|
|
45
|
+
declined: "declined";
|
|
46
|
+
cancelled: "cancelled";
|
|
47
|
+
}>;
|
|
48
|
+
at: z.ZodISODateTime;
|
|
49
|
+
}, z.core.$strict>], "kind">;
|
|
50
|
+
export declare const ConversationDetailSchema: z.ZodObject<{
|
|
51
|
+
items: z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
52
|
+
kind: z.ZodLiteral<"message">;
|
|
53
|
+
role: z.ZodEnum<{
|
|
54
|
+
assistant: "assistant";
|
|
55
|
+
user: "user";
|
|
56
|
+
}>;
|
|
57
|
+
text: z.ZodString;
|
|
58
|
+
at: z.ZodISODateTime;
|
|
59
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
60
|
+
kind: z.ZodLiteral<"outcome">;
|
|
61
|
+
interactionId: z.ZodString;
|
|
62
|
+
tool: z.ZodString;
|
|
63
|
+
status: z.ZodEnum<{
|
|
64
|
+
failed: "failed";
|
|
65
|
+
succeeded: "succeeded";
|
|
66
|
+
declined: "declined";
|
|
67
|
+
cancelled: "cancelled";
|
|
68
|
+
}>;
|
|
69
|
+
at: z.ZodISODateTime;
|
|
70
|
+
}, z.core.$strict>], "kind">>;
|
|
71
|
+
id: z.ZodString;
|
|
72
|
+
channel: z.ZodEnum<{
|
|
73
|
+
whatsapp: "whatsapp";
|
|
74
|
+
website: "website";
|
|
75
|
+
}>;
|
|
76
|
+
subject: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
77
|
+
kind: z.ZodLiteral<"anonymous">;
|
|
78
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
79
|
+
kind: z.ZodLiteral<"customer">;
|
|
80
|
+
ref: z.ZodString;
|
|
81
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
82
|
+
kind: z.ZodLiteral<"participant">;
|
|
83
|
+
ref: z.ZodString;
|
|
84
|
+
}, z.core.$strict>], "kind">;
|
|
85
|
+
startedAt: z.ZodISODateTime;
|
|
86
|
+
lastMessageAt: z.ZodISODateTime;
|
|
87
|
+
itemCount: z.ZodNumber;
|
|
88
|
+
}, z.core.$strict>;
|
|
89
|
+
export declare const ConversationListResponseSchema: z.ZodObject<{
|
|
90
|
+
ok: z.ZodLiteral<true>;
|
|
91
|
+
data: z.ZodObject<{
|
|
92
|
+
conversations: z.ZodArray<z.ZodObject<{
|
|
93
|
+
id: z.ZodString;
|
|
94
|
+
channel: z.ZodEnum<{
|
|
95
|
+
whatsapp: "whatsapp";
|
|
96
|
+
website: "website";
|
|
97
|
+
}>;
|
|
98
|
+
subject: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
99
|
+
kind: z.ZodLiteral<"anonymous">;
|
|
100
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
101
|
+
kind: z.ZodLiteral<"customer">;
|
|
102
|
+
ref: z.ZodString;
|
|
103
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
104
|
+
kind: z.ZodLiteral<"participant">;
|
|
105
|
+
ref: z.ZodString;
|
|
106
|
+
}, z.core.$strict>], "kind">;
|
|
107
|
+
startedAt: z.ZodISODateTime;
|
|
108
|
+
lastMessageAt: z.ZodISODateTime;
|
|
109
|
+
itemCount: z.ZodNumber;
|
|
110
|
+
}, z.core.$strict>>;
|
|
111
|
+
nextCursor: z.ZodOptional<z.ZodString>;
|
|
112
|
+
}, z.core.$strict>;
|
|
113
|
+
}, z.core.$strict>;
|
|
114
|
+
export declare const ConversationShowResponseSchema: z.ZodObject<{
|
|
115
|
+
ok: z.ZodLiteral<true>;
|
|
116
|
+
data: z.ZodObject<{
|
|
117
|
+
conversation: z.ZodObject<{
|
|
118
|
+
items: z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
119
|
+
kind: z.ZodLiteral<"message">;
|
|
120
|
+
role: z.ZodEnum<{
|
|
121
|
+
assistant: "assistant";
|
|
122
|
+
user: "user";
|
|
123
|
+
}>;
|
|
124
|
+
text: z.ZodString;
|
|
125
|
+
at: z.ZodISODateTime;
|
|
126
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
127
|
+
kind: z.ZodLiteral<"outcome">;
|
|
128
|
+
interactionId: z.ZodString;
|
|
129
|
+
tool: z.ZodString;
|
|
130
|
+
status: z.ZodEnum<{
|
|
131
|
+
failed: "failed";
|
|
132
|
+
succeeded: "succeeded";
|
|
133
|
+
declined: "declined";
|
|
134
|
+
cancelled: "cancelled";
|
|
135
|
+
}>;
|
|
136
|
+
at: z.ZodISODateTime;
|
|
137
|
+
}, z.core.$strict>], "kind">>;
|
|
138
|
+
id: z.ZodString;
|
|
139
|
+
channel: z.ZodEnum<{
|
|
140
|
+
whatsapp: "whatsapp";
|
|
141
|
+
website: "website";
|
|
142
|
+
}>;
|
|
143
|
+
subject: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
144
|
+
kind: z.ZodLiteral<"anonymous">;
|
|
145
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
146
|
+
kind: z.ZodLiteral<"customer">;
|
|
147
|
+
ref: z.ZodString;
|
|
148
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
149
|
+
kind: z.ZodLiteral<"participant">;
|
|
150
|
+
ref: z.ZodString;
|
|
151
|
+
}, z.core.$strict>], "kind">;
|
|
152
|
+
startedAt: z.ZodISODateTime;
|
|
153
|
+
lastMessageAt: z.ZodISODateTime;
|
|
154
|
+
itemCount: z.ZodNumber;
|
|
155
|
+
}, z.core.$strict>;
|
|
156
|
+
}, z.core.$strict>;
|
|
157
|
+
}, z.core.$strict>;
|
|
158
|
+
export declare const ConversationExportResponseSchema: z.ZodObject<{
|
|
159
|
+
ok: z.ZodLiteral<true>;
|
|
160
|
+
data: z.ZodObject<{
|
|
161
|
+
conversations: z.ZodArray<z.ZodObject<{
|
|
162
|
+
items: z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
163
|
+
kind: z.ZodLiteral<"message">;
|
|
164
|
+
role: z.ZodEnum<{
|
|
165
|
+
assistant: "assistant";
|
|
166
|
+
user: "user";
|
|
167
|
+
}>;
|
|
168
|
+
text: z.ZodString;
|
|
169
|
+
at: z.ZodISODateTime;
|
|
170
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
171
|
+
kind: z.ZodLiteral<"outcome">;
|
|
172
|
+
interactionId: z.ZodString;
|
|
173
|
+
tool: z.ZodString;
|
|
174
|
+
status: z.ZodEnum<{
|
|
175
|
+
failed: "failed";
|
|
176
|
+
succeeded: "succeeded";
|
|
177
|
+
declined: "declined";
|
|
178
|
+
cancelled: "cancelled";
|
|
179
|
+
}>;
|
|
180
|
+
at: z.ZodISODateTime;
|
|
181
|
+
}, z.core.$strict>], "kind">>;
|
|
182
|
+
id: z.ZodString;
|
|
183
|
+
channel: z.ZodEnum<{
|
|
184
|
+
whatsapp: "whatsapp";
|
|
185
|
+
website: "website";
|
|
186
|
+
}>;
|
|
187
|
+
subject: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
188
|
+
kind: z.ZodLiteral<"anonymous">;
|
|
189
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
190
|
+
kind: z.ZodLiteral<"customer">;
|
|
191
|
+
ref: z.ZodString;
|
|
192
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
193
|
+
kind: z.ZodLiteral<"participant">;
|
|
194
|
+
ref: z.ZodString;
|
|
195
|
+
}, z.core.$strict>], "kind">;
|
|
196
|
+
startedAt: z.ZodISODateTime;
|
|
197
|
+
lastMessageAt: z.ZodISODateTime;
|
|
198
|
+
itemCount: z.ZodNumber;
|
|
199
|
+
}, z.core.$strict>>;
|
|
200
|
+
nextCursor: z.ZodOptional<z.ZodString>;
|
|
201
|
+
}, z.core.$strict>;
|
|
202
|
+
}, z.core.$strict>;
|
|
203
|
+
export declare const ConversationForgetRequestSchema: z.ZodUnion<readonly [z.ZodObject<{
|
|
204
|
+
conversationId: z.ZodString;
|
|
205
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
206
|
+
subject: z.ZodObject<{
|
|
207
|
+
kind: z.ZodEnum<{
|
|
208
|
+
customer: "customer";
|
|
209
|
+
participant: "participant";
|
|
210
|
+
}>;
|
|
211
|
+
ref: z.ZodString;
|
|
212
|
+
}, z.core.$strict>;
|
|
213
|
+
}, z.core.$strict>]>;
|
|
214
|
+
export type ConversationForgetRequest = z.infer<typeof ConversationForgetRequestSchema>;
|
|
215
|
+
export declare const ConversationForgetResponseSchema: z.ZodObject<{
|
|
216
|
+
ok: z.ZodLiteral<true>;
|
|
217
|
+
data: z.ZodObject<{
|
|
218
|
+
forgotten: z.ZodObject<{
|
|
219
|
+
conversations: z.ZodNumber;
|
|
220
|
+
items: z.ZodNumber;
|
|
221
|
+
}, z.core.$strict>;
|
|
222
|
+
}, z.core.$strict>;
|
|
223
|
+
}, z.core.$strict>;
|
|
224
|
+
export declare const ConversationListClientResponseSchema: z.ZodObject<{
|
|
225
|
+
ok: z.ZodLiteral<true>;
|
|
226
|
+
data: z.ZodObject<{
|
|
227
|
+
conversations: z.ZodArray<z.ZodObject<{
|
|
228
|
+
subject: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
229
|
+
kind: z.ZodLiteral<"anonymous">;
|
|
230
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
231
|
+
kind: z.ZodLiteral<"customer">;
|
|
232
|
+
ref: z.ZodString;
|
|
233
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
234
|
+
kind: z.ZodLiteral<"participant">;
|
|
235
|
+
ref: z.ZodString;
|
|
236
|
+
}, z.core.$strip>], "kind">;
|
|
237
|
+
id: z.ZodString;
|
|
238
|
+
channel: z.ZodEnum<{
|
|
239
|
+
whatsapp: "whatsapp";
|
|
240
|
+
website: "website";
|
|
241
|
+
}>;
|
|
242
|
+
startedAt: z.ZodISODateTime;
|
|
243
|
+
lastMessageAt: z.ZodISODateTime;
|
|
244
|
+
itemCount: z.ZodNumber;
|
|
245
|
+
}, z.core.$strip>>;
|
|
246
|
+
nextCursor: z.ZodOptional<z.ZodString>;
|
|
247
|
+
}, z.core.$strip>;
|
|
248
|
+
}, z.core.$strip>;
|
|
249
|
+
export declare const ConversationShowClientResponseSchema: z.ZodObject<{
|
|
250
|
+
ok: z.ZodLiteral<true>;
|
|
251
|
+
data: z.ZodObject<{
|
|
252
|
+
conversation: z.ZodObject<{
|
|
253
|
+
items: z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
254
|
+
kind: z.ZodLiteral<"message">;
|
|
255
|
+
role: z.ZodEnum<{
|
|
256
|
+
assistant: "assistant";
|
|
257
|
+
user: "user";
|
|
258
|
+
}>;
|
|
259
|
+
text: z.ZodString;
|
|
260
|
+
at: z.ZodISODateTime;
|
|
261
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
262
|
+
kind: z.ZodLiteral<"outcome">;
|
|
263
|
+
interactionId: z.ZodString;
|
|
264
|
+
tool: z.ZodString;
|
|
265
|
+
status: z.ZodEnum<{
|
|
266
|
+
failed: "failed";
|
|
267
|
+
succeeded: "succeeded";
|
|
268
|
+
declined: "declined";
|
|
269
|
+
cancelled: "cancelled";
|
|
270
|
+
}>;
|
|
271
|
+
at: z.ZodISODateTime;
|
|
272
|
+
}, z.core.$strip>], "kind">>;
|
|
273
|
+
subject: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
274
|
+
kind: z.ZodLiteral<"anonymous">;
|
|
275
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
276
|
+
kind: z.ZodLiteral<"customer">;
|
|
277
|
+
ref: z.ZodString;
|
|
278
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
279
|
+
kind: z.ZodLiteral<"participant">;
|
|
280
|
+
ref: z.ZodString;
|
|
281
|
+
}, z.core.$strip>], "kind">;
|
|
282
|
+
id: z.ZodString;
|
|
283
|
+
channel: z.ZodEnum<{
|
|
284
|
+
whatsapp: "whatsapp";
|
|
285
|
+
website: "website";
|
|
286
|
+
}>;
|
|
287
|
+
startedAt: z.ZodISODateTime;
|
|
288
|
+
lastMessageAt: z.ZodISODateTime;
|
|
289
|
+
itemCount: z.ZodNumber;
|
|
290
|
+
}, z.core.$strip>;
|
|
291
|
+
}, z.core.$strip>;
|
|
292
|
+
}, z.core.$strip>;
|
|
293
|
+
export declare const ConversationExportClientResponseSchema: z.ZodObject<{
|
|
294
|
+
ok: z.ZodLiteral<true>;
|
|
295
|
+
data: z.ZodObject<{
|
|
296
|
+
conversations: z.ZodArray<z.ZodObject<{
|
|
297
|
+
items: z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
298
|
+
kind: z.ZodLiteral<"message">;
|
|
299
|
+
role: z.ZodEnum<{
|
|
300
|
+
assistant: "assistant";
|
|
301
|
+
user: "user";
|
|
302
|
+
}>;
|
|
303
|
+
text: z.ZodString;
|
|
304
|
+
at: z.ZodISODateTime;
|
|
305
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
306
|
+
kind: z.ZodLiteral<"outcome">;
|
|
307
|
+
interactionId: z.ZodString;
|
|
308
|
+
tool: z.ZodString;
|
|
309
|
+
status: z.ZodEnum<{
|
|
310
|
+
failed: "failed";
|
|
311
|
+
succeeded: "succeeded";
|
|
312
|
+
declined: "declined";
|
|
313
|
+
cancelled: "cancelled";
|
|
314
|
+
}>;
|
|
315
|
+
at: z.ZodISODateTime;
|
|
316
|
+
}, z.core.$strip>], "kind">>;
|
|
317
|
+
subject: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
318
|
+
kind: z.ZodLiteral<"anonymous">;
|
|
319
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
320
|
+
kind: z.ZodLiteral<"customer">;
|
|
321
|
+
ref: z.ZodString;
|
|
322
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
323
|
+
kind: z.ZodLiteral<"participant">;
|
|
324
|
+
ref: z.ZodString;
|
|
325
|
+
}, z.core.$strip>], "kind">;
|
|
326
|
+
id: z.ZodString;
|
|
327
|
+
channel: z.ZodEnum<{
|
|
328
|
+
whatsapp: "whatsapp";
|
|
329
|
+
website: "website";
|
|
330
|
+
}>;
|
|
331
|
+
startedAt: z.ZodISODateTime;
|
|
332
|
+
lastMessageAt: z.ZodISODateTime;
|
|
333
|
+
itemCount: z.ZodNumber;
|
|
334
|
+
}, z.core.$strip>>;
|
|
335
|
+
nextCursor: z.ZodOptional<z.ZodString>;
|
|
336
|
+
}, z.core.$strip>;
|
|
337
|
+
}, z.core.$strip>;
|
|
338
|
+
export declare const ConversationForgetClientResponseSchema: z.ZodObject<{
|
|
339
|
+
ok: z.ZodLiteral<true>;
|
|
340
|
+
data: z.ZodObject<{
|
|
341
|
+
forgotten: z.ZodObject<{
|
|
342
|
+
conversations: z.ZodNumber;
|
|
343
|
+
items: z.ZodNumber;
|
|
344
|
+
}, z.core.$strip>;
|
|
345
|
+
}, z.core.$strip>;
|
|
346
|
+
}, z.core.$strip>;
|
|
347
|
+
//# sourceMappingURL=conversation-history.d.ts.map
|
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
/**
|
|
3
|
+
* Staff projection of durable conversation history (ADR 0241). Server output is strict; the tolerant
|
|
4
|
+
* `*ClientResponseSchema` variants let older clients ignore additive fields.
|
|
5
|
+
*/
|
|
6
|
+
export const ConversationIdSchema = z.string().regex(/^cv_[A-Za-z0-9_-]{8,64}$/);
|
|
7
|
+
export const ConversationChannelSchema = z.enum(['website', 'whatsapp']);
|
|
8
|
+
const SubjectRefSchema = z.string().min(1).max(256);
|
|
9
|
+
/** Anonymous handles never leave the service; verified subjects carry the reference forget uses. */
|
|
10
|
+
const ConversationSubjectSchema = z.discriminatedUnion('kind', [
|
|
11
|
+
z.strictObject({ kind: z.literal('anonymous') }),
|
|
12
|
+
z.strictObject({ kind: z.literal('customer'), ref: SubjectRefSchema }),
|
|
13
|
+
z.strictObject({ kind: z.literal('participant'), ref: SubjectRefSchema }),
|
|
14
|
+
]);
|
|
15
|
+
export const ConversationSummarySchema = z.strictObject({
|
|
16
|
+
id: ConversationIdSchema,
|
|
17
|
+
channel: ConversationChannelSchema,
|
|
18
|
+
subject: ConversationSubjectSchema,
|
|
19
|
+
startedAt: z.iso.datetime(),
|
|
20
|
+
lastMessageAt: z.iso.datetime(),
|
|
21
|
+
itemCount: z.number().int().min(1),
|
|
22
|
+
});
|
|
23
|
+
export const ConversationItemSchema = z.discriminatedUnion('kind', [
|
|
24
|
+
z.strictObject({
|
|
25
|
+
kind: z.literal('message'),
|
|
26
|
+
role: z.enum(['user', 'assistant']),
|
|
27
|
+
text: z.string().max(100_000),
|
|
28
|
+
at: z.iso.datetime(),
|
|
29
|
+
}),
|
|
30
|
+
z.strictObject({
|
|
31
|
+
kind: z.literal('outcome'),
|
|
32
|
+
interactionId: z.string().min(1).max(256),
|
|
33
|
+
tool: z.string().min(1).max(128),
|
|
34
|
+
status: z.enum(['succeeded', 'failed', 'declined', 'cancelled']),
|
|
35
|
+
at: z.iso.datetime(),
|
|
36
|
+
}),
|
|
37
|
+
]);
|
|
38
|
+
export const ConversationDetailSchema = z.strictObject({
|
|
39
|
+
...ConversationSummarySchema.shape,
|
|
40
|
+
items: z.array(ConversationItemSchema).max(10_000),
|
|
41
|
+
});
|
|
42
|
+
const NextCursorSchema = z.string().min(1).max(2048);
|
|
43
|
+
export const ConversationListResponseSchema = z.strictObject({
|
|
44
|
+
ok: z.literal(true),
|
|
45
|
+
data: z.strictObject({
|
|
46
|
+
conversations: z.array(ConversationSummarySchema).max(100),
|
|
47
|
+
nextCursor: NextCursorSchema.optional(),
|
|
48
|
+
}),
|
|
49
|
+
});
|
|
50
|
+
export const ConversationShowResponseSchema = z.strictObject({
|
|
51
|
+
ok: z.literal(true),
|
|
52
|
+
data: z.strictObject({ conversation: ConversationDetailSchema }),
|
|
53
|
+
});
|
|
54
|
+
export const ConversationExportResponseSchema = z.strictObject({
|
|
55
|
+
ok: z.literal(true),
|
|
56
|
+
data: z.strictObject({
|
|
57
|
+
conversations: z.array(ConversationDetailSchema).max(25),
|
|
58
|
+
nextCursor: NextCursorSchema.optional(),
|
|
59
|
+
}),
|
|
60
|
+
});
|
|
61
|
+
export const ConversationForgetRequestSchema = z.union([
|
|
62
|
+
z.strictObject({ conversationId: ConversationIdSchema }),
|
|
63
|
+
z.strictObject({
|
|
64
|
+
subject: z.strictObject({
|
|
65
|
+
kind: z.enum(['customer', 'participant']),
|
|
66
|
+
ref: SubjectRefSchema,
|
|
67
|
+
}),
|
|
68
|
+
}),
|
|
69
|
+
]);
|
|
70
|
+
export const ConversationForgetResponseSchema = z.strictObject({
|
|
71
|
+
ok: z.literal(true),
|
|
72
|
+
data: z.strictObject({
|
|
73
|
+
forgotten: z.strictObject({
|
|
74
|
+
conversations: z.number().int().nonnegative(),
|
|
75
|
+
items: z.number().int().nonnegative(),
|
|
76
|
+
}),
|
|
77
|
+
}),
|
|
78
|
+
});
|
|
79
|
+
const ClientSubjectSchema = z.discriminatedUnion('kind', [
|
|
80
|
+
z.object({ kind: z.literal('anonymous') }),
|
|
81
|
+
z.object({ kind: z.literal('customer'), ref: SubjectRefSchema }),
|
|
82
|
+
z.object({ kind: z.literal('participant'), ref: SubjectRefSchema }),
|
|
83
|
+
]);
|
|
84
|
+
const ClientSummarySchema = z.object({
|
|
85
|
+
...ConversationSummarySchema.shape,
|
|
86
|
+
subject: ClientSubjectSchema,
|
|
87
|
+
});
|
|
88
|
+
const ClientItemSchema = z.discriminatedUnion('kind', [
|
|
89
|
+
z.object(ConversationItemSchema.options[0].shape),
|
|
90
|
+
z.object(ConversationItemSchema.options[1].shape),
|
|
91
|
+
]);
|
|
92
|
+
const ClientDetailSchema = z.object({
|
|
93
|
+
...ClientSummarySchema.shape,
|
|
94
|
+
items: z.array(ClientItemSchema).max(10_000),
|
|
95
|
+
});
|
|
96
|
+
export const ConversationListClientResponseSchema = z.object({
|
|
97
|
+
ok: z.literal(true),
|
|
98
|
+
data: z.object({
|
|
99
|
+
conversations: z.array(ClientSummarySchema).max(100),
|
|
100
|
+
nextCursor: NextCursorSchema.optional(),
|
|
101
|
+
}),
|
|
102
|
+
});
|
|
103
|
+
export const ConversationShowClientResponseSchema = z.object({
|
|
104
|
+
ok: z.literal(true),
|
|
105
|
+
data: z.object({ conversation: ClientDetailSchema }),
|
|
106
|
+
});
|
|
107
|
+
export const ConversationExportClientResponseSchema = z.object({
|
|
108
|
+
ok: z.literal(true),
|
|
109
|
+
data: z.object({
|
|
110
|
+
conversations: z.array(ClientDetailSchema).max(25),
|
|
111
|
+
nextCursor: NextCursorSchema.optional(),
|
|
112
|
+
}),
|
|
113
|
+
});
|
|
114
|
+
export const ConversationForgetClientResponseSchema = z.object({
|
|
115
|
+
ok: z.literal(true),
|
|
116
|
+
data: z.object({
|
|
117
|
+
forgotten: z.object(ConversationForgetResponseSchema.shape.data.shape.forgotten.shape),
|
|
118
|
+
}),
|
|
119
|
+
});
|
|
120
|
+
//# sourceMappingURL=conversation-history.js.map
|
|
@@ -394,6 +394,7 @@ export * from './application-drafts.js';
|
|
|
394
394
|
export * from './application-onboarding.js';
|
|
395
395
|
export * from './billing-catalog.js';
|
|
396
396
|
export * from './business-workspaces.js';
|
|
397
|
+
export * from './conversation-history.js';
|
|
397
398
|
export * from './deployment-deletion.js';
|
|
398
399
|
export * from './native-record-lifecycle.js';
|
|
399
400
|
export * from './operation-coordination.js';
|
|
@@ -233,6 +233,7 @@ export * from './application-drafts.js';
|
|
|
233
233
|
export * from './application-onboarding.js';
|
|
234
234
|
export * from './billing-catalog.js';
|
|
235
235
|
export * from './business-workspaces.js';
|
|
236
|
+
export * from './conversation-history.js';
|
|
236
237
|
export * from './deployment-deletion.js';
|
|
237
238
|
export * from './native-record-lifecycle.js';
|
|
238
239
|
export * from './operation-coordination.js';
|
|
@@ -359,11 +359,11 @@ export declare const WhatsAppEventsResponseSchema: z.ZodObject<{
|
|
|
359
359
|
queued: "queued";
|
|
360
360
|
running: "running";
|
|
361
361
|
failed: "failed";
|
|
362
|
+
cancelled: "cancelled";
|
|
362
363
|
delivered: "delivered";
|
|
363
364
|
reply: "reply";
|
|
364
365
|
sending: "sending";
|
|
365
366
|
refused: "refused";
|
|
366
|
-
cancelled: "cancelled";
|
|
367
367
|
}>;
|
|
368
368
|
eventAt: z.ZodNumber;
|
|
369
369
|
receivedAt: z.ZodNumber;
|
|
@@ -386,11 +386,11 @@ export declare const WhatsAppEventsClientResponseSchema: z.ZodObject<{
|
|
|
386
386
|
queued: "queued";
|
|
387
387
|
running: "running";
|
|
388
388
|
failed: "failed";
|
|
389
|
+
cancelled: "cancelled";
|
|
389
390
|
delivered: "delivered";
|
|
390
391
|
reply: "reply";
|
|
391
392
|
sending: "sending";
|
|
392
393
|
refused: "refused";
|
|
393
|
-
cancelled: "cancelled";
|
|
394
394
|
}>;
|
|
395
395
|
eventAt: z.ZodNumber;
|
|
396
396
|
receivedAt: z.ZodNumber;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@noodleseed/one",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.177.0",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "Noodle CLI by Noodle Seed — author, run, and deploy declarative MCP servers. Embedding the assistant in your own web app is @noodleseed/assistant.",
|
|
6
6
|
"license": "Apache-2.0",
|