@noodleseed/one 0.177.0 → 0.178.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-activity.d.ts.map +1 -1
- package/dist/commands/solutions-activity.js +9 -35
- package/dist/commands/solutions-activity.js.map +1 -1
- package/dist/commands/solutions-conversations.d.ts.map +1 -1
- package/dist/commands/solutions-conversations.js +60 -6
- package/dist/commands/solutions-conversations.js.map +1 -1
- package/dist/commands/solutions-history.d.ts +9 -0
- package/dist/commands/solutions-history.d.ts.map +1 -0
- package/dist/commands/solutions-history.js +166 -0
- package/dist/commands/solutions-history.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/dist/commands/whatsapp-ops.d.ts.map +1 -1
- package/dist/commands/whatsapp-ops.js +0 -7
- package/dist/commands/whatsapp-ops.js.map +1 -1
- package/node_modules/@noodle-borg/agent-kit/dist/generated/example-files.js +1 -1
- package/node_modules/@noodle-borg/agent-kit/dist/skill-embedded-assistant-ref.js +14 -0
- package/node_modules/@noodle-borg/agent-kit/package.json +1 -1
- package/node_modules/@noodle-borg/assistant-gateway/dist/public-surface.d.ts +6 -0
- package/node_modules/@noodle-borg/assistant-gateway/dist/public-surface.js +5 -2
- package/node_modules/@noodle-borg/assistant-gateway/package.json +1 -1
- package/node_modules/@noodle-borg/authoring/dist/assistant.d.ts +18 -0
- package/node_modules/@noodle-borg/authoring/dist/assistant.js +14 -1
- package/node_modules/@noodle-borg/cli-catalog/dist/catalog-data-channels.js +0 -3
- package/node_modules/@noodle-borg/cli-catalog/dist/catalog-data-solution-conversations.js +50 -5
- package/node_modules/@noodle-borg/cli-catalog/dist/catalog-data-solution-history.js +82 -0
- package/node_modules/@noodle-borg/cli-catalog/dist/catalog-data-solutions.js +3 -42
- package/node_modules/@noodle-borg/compiler/dist/manifest/schema.d.ts +8 -0
- package/node_modules/@noodle-borg/compiler/dist/manifest/schema.js +7 -0
- package/node_modules/@noodle-borg/service/dist/application-activity.js +76 -21
- package/node_modules/@noodle-borg/service/dist/application-history-settings.js +108 -0
- package/node_modules/@noodle-borg/service/dist/assistant-composition.js +11 -2
- package/node_modules/@noodle-borg/service/dist/channels/composition.js +10 -1
- package/node_modules/@noodle-borg/service/dist/channels/provider.js +13 -13
- package/node_modules/@noodle-borg/service/dist/channels/runtime.js +31 -5
- package/node_modules/@noodle-borg/service/dist/conversation-history/capture.js +63 -7
- package/node_modules/@noodle-borg/service/dist/conversation-history/contracts.js +13 -0
- package/node_modules/@noodle-borg/service/dist/conversation-history/customer.js +118 -0
- package/node_modules/@noodle-borg/service/dist/conversation-history/operator.js +133 -24
- package/node_modules/@noodle-borg/service/dist/routes/assistant-conversations.js +52 -0
- package/node_modules/@noodle-borg/service/dist/routes/assistant-dispatch.js +6 -0
- package/node_modules/@noodle-borg/service/dist/routes/assistant-elevation.js +3 -0
- package/node_modules/@noodle-borg/service/dist/routes/assistant-interaction-stream.js +2 -1
- package/node_modules/@noodle-borg/service/dist/routes/assistant-interactions.js +6 -11
- package/node_modules/@noodle-borg/service/dist/routes/assistant-public-session.js +6 -0
- package/node_modules/@noodle-borg/service/dist/routes/assistant-route-http.js +16 -0
- package/node_modules/@noodle-borg/service/dist/routes/assistant.js +5 -17
- package/node_modules/@noodle-borg/service/dist/routes/business-information-activity.js +6 -5
- package/node_modules/@noodle-borg/service/dist/routes/business-information-conversations.js +36 -11
- package/node_modules/@noodle-borg/service/dist/routes/business-information-dispatch.js +4 -2
- package/node_modules/@noodle-borg/service/dist/routes/business-information-paths.js +4 -2
- package/node_modules/@noodle-borg/service/dist/routes/business-information.js +4 -0
- package/node_modules/@noodle-borg/service/dist/routes/whatsapp.js +0 -10
- package/node_modules/@noodle-borg/service/dist/service-history-projections.js +32 -4
- package/node_modules/@noodle-borg/service/dist/service-resource-cleanup.js +32 -0
- package/node_modules/@noodle-borg/service/dist/service.js +4 -3
- package/node_modules/@noodle-borg/service/package.json +1 -1
- package/node_modules/@noodle-borg/wire-contracts/dist/application-activity.d.ts +0 -28
- package/node_modules/@noodle-borg/wire-contracts/dist/application-activity.js +0 -18
- package/node_modules/@noodle-borg/wire-contracts/dist/application-history-settings.d.ts +190 -0
- package/node_modules/@noodle-borg/wire-contracts/dist/application-history-settings.js +92 -0
- package/node_modules/@noodle-borg/wire-contracts/dist/assistant.d.ts +3 -0
- package/node_modules/@noodle-borg/wire-contracts/dist/assistant.js +6 -0
- package/node_modules/@noodle-borg/wire-contracts/dist/conversation-history.d.ts +176 -0
- package/node_modules/@noodle-borg/wire-contracts/dist/conversation-history.js +74 -2
- 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/@noodleseed/assistant/README.md +19 -0
- package/node_modules/@noodleseed/assistant/package.json +1 -1
- package/package.json +2 -2
|
@@ -31,6 +31,9 @@ export declare const assistantSessionResponseSchema: z.ZodObject<{
|
|
|
31
31
|
tool: z.ZodString;
|
|
32
32
|
}, z.core.$strip>>;
|
|
33
33
|
continuedAfterAuthentication: z.ZodOptional<z.ZodLiteral<true>>;
|
|
34
|
+
history: z.ZodOptional<z.ZodObject<{
|
|
35
|
+
retentionDays: z.ZodNumber;
|
|
36
|
+
}, z.core.$strip>>;
|
|
34
37
|
}, z.core.$strip>;
|
|
35
38
|
export type AssistantSessionResponse = z.infer<typeof assistantSessionResponseSchema>;
|
|
36
39
|
/** MCP-Apps-shaped, author-selected renderer summary included on one assistant turn. */
|
|
@@ -61,6 +61,12 @@ export const assistantSessionResponseSchema = z.object({
|
|
|
61
61
|
resume: z.object({ tool: z.string().min(1) }).optional(),
|
|
62
62
|
/** Additive elevation marker; the client renders one bounded continuation status. */
|
|
63
63
|
continuedAfterAuthentication: z.literal(true).optional(),
|
|
64
|
+
/**
|
|
65
|
+
* Additive retention notice (ADR 0241 decision 17): present only when this caller's conversation
|
|
66
|
+
* is recorded. Top level, never inside `configuration`, whose strict browser schema would make an
|
|
67
|
+
* older widget drop its whole appearance; older widgets ignore unknown top-level keys.
|
|
68
|
+
*/
|
|
69
|
+
history: z.object({ retentionDays: z.number().int().min(1).max(365) }).optional(),
|
|
64
70
|
});
|
|
65
71
|
const recoverableViewSchema = z
|
|
66
72
|
.object({
|
|
@@ -8,6 +8,13 @@ export declare const ConversationChannelSchema: z.ZodEnum<{
|
|
|
8
8
|
whatsapp: "whatsapp";
|
|
9
9
|
website: "website";
|
|
10
10
|
}>;
|
|
11
|
+
/** Staff review state; a failed tool outcome sets `needs_attention` automatically. */
|
|
12
|
+
export declare const ConversationReviewStatusSchema: z.ZodEnum<{
|
|
13
|
+
new: "new";
|
|
14
|
+
needs_attention: "needs_attention";
|
|
15
|
+
reviewed: "reviewed";
|
|
16
|
+
}>;
|
|
17
|
+
export type ConversationReviewStatus = z.infer<typeof ConversationReviewStatusSchema>;
|
|
11
18
|
export declare const ConversationSummarySchema: z.ZodObject<{
|
|
12
19
|
id: z.ZodString;
|
|
13
20
|
channel: z.ZodEnum<{
|
|
@@ -26,6 +33,11 @@ export declare const ConversationSummarySchema: z.ZodObject<{
|
|
|
26
33
|
startedAt: z.ZodISODateTime;
|
|
27
34
|
lastMessageAt: z.ZodISODateTime;
|
|
28
35
|
itemCount: z.ZodNumber;
|
|
36
|
+
reviewStatus: z.ZodEnum<{
|
|
37
|
+
new: "new";
|
|
38
|
+
needs_attention: "needs_attention";
|
|
39
|
+
reviewed: "reviewed";
|
|
40
|
+
}>;
|
|
29
41
|
}, z.core.$strict>;
|
|
30
42
|
export declare const ConversationItemSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
31
43
|
kind: z.ZodLiteral<"message">;
|
|
@@ -48,6 +60,64 @@ export declare const ConversationItemSchema: z.ZodDiscriminatedUnion<[z.ZodObjec
|
|
|
48
60
|
at: z.ZodISODateTime;
|
|
49
61
|
}, z.core.$strict>], "kind">;
|
|
50
62
|
export declare const ConversationDetailSchema: z.ZodObject<{
|
|
63
|
+
expiresAt: z.ZodISODateTime;
|
|
64
|
+
items: z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
65
|
+
kind: z.ZodLiteral<"message">;
|
|
66
|
+
role: z.ZodEnum<{
|
|
67
|
+
assistant: "assistant";
|
|
68
|
+
user: "user";
|
|
69
|
+
}>;
|
|
70
|
+
text: z.ZodString;
|
|
71
|
+
at: z.ZodISODateTime;
|
|
72
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
73
|
+
kind: z.ZodLiteral<"outcome">;
|
|
74
|
+
interactionId: z.ZodString;
|
|
75
|
+
tool: z.ZodString;
|
|
76
|
+
status: z.ZodEnum<{
|
|
77
|
+
failed: "failed";
|
|
78
|
+
succeeded: "succeeded";
|
|
79
|
+
declined: "declined";
|
|
80
|
+
cancelled: "cancelled";
|
|
81
|
+
}>;
|
|
82
|
+
at: z.ZodISODateTime;
|
|
83
|
+
}, z.core.$strict>], "kind">>;
|
|
84
|
+
id: z.ZodString;
|
|
85
|
+
channel: z.ZodEnum<{
|
|
86
|
+
whatsapp: "whatsapp";
|
|
87
|
+
website: "website";
|
|
88
|
+
}>;
|
|
89
|
+
subject: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
90
|
+
kind: z.ZodLiteral<"anonymous">;
|
|
91
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
92
|
+
kind: z.ZodLiteral<"customer">;
|
|
93
|
+
ref: z.ZodString;
|
|
94
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
95
|
+
kind: z.ZodLiteral<"participant">;
|
|
96
|
+
ref: z.ZodString;
|
|
97
|
+
}, z.core.$strict>], "kind">;
|
|
98
|
+
startedAt: z.ZodISODateTime;
|
|
99
|
+
lastMessageAt: z.ZodISODateTime;
|
|
100
|
+
itemCount: z.ZodNumber;
|
|
101
|
+
reviewStatus: z.ZodEnum<{
|
|
102
|
+
new: "new";
|
|
103
|
+
needs_attention: "needs_attention";
|
|
104
|
+
reviewed: "reviewed";
|
|
105
|
+
}>;
|
|
106
|
+
}, z.core.$strict>;
|
|
107
|
+
/** A private staff note: never sent to the customer, never exported, removed with its conversation. */
|
|
108
|
+
export declare const ConversationNoteSchema: z.ZodObject<{
|
|
109
|
+
author: z.ZodString;
|
|
110
|
+
text: z.ZodString;
|
|
111
|
+
at: z.ZodISODateTime;
|
|
112
|
+
}, z.core.$strict>;
|
|
113
|
+
/** Show adds the private notes that export leaves out. */
|
|
114
|
+
export declare const ConversationShowSchema: z.ZodObject<{
|
|
115
|
+
notes: z.ZodArray<z.ZodObject<{
|
|
116
|
+
author: z.ZodString;
|
|
117
|
+
text: z.ZodString;
|
|
118
|
+
at: z.ZodISODateTime;
|
|
119
|
+
}, z.core.$strict>>;
|
|
120
|
+
expiresAt: z.ZodISODateTime;
|
|
51
121
|
items: z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
52
122
|
kind: z.ZodLiteral<"message">;
|
|
53
123
|
role: z.ZodEnum<{
|
|
@@ -85,6 +155,11 @@ export declare const ConversationDetailSchema: z.ZodObject<{
|
|
|
85
155
|
startedAt: z.ZodISODateTime;
|
|
86
156
|
lastMessageAt: z.ZodISODateTime;
|
|
87
157
|
itemCount: z.ZodNumber;
|
|
158
|
+
reviewStatus: z.ZodEnum<{
|
|
159
|
+
new: "new";
|
|
160
|
+
needs_attention: "needs_attention";
|
|
161
|
+
reviewed: "reviewed";
|
|
162
|
+
}>;
|
|
88
163
|
}, z.core.$strict>;
|
|
89
164
|
export declare const ConversationListResponseSchema: z.ZodObject<{
|
|
90
165
|
ok: z.ZodLiteral<true>;
|
|
@@ -107,14 +182,26 @@ export declare const ConversationListResponseSchema: z.ZodObject<{
|
|
|
107
182
|
startedAt: z.ZodISODateTime;
|
|
108
183
|
lastMessageAt: z.ZodISODateTime;
|
|
109
184
|
itemCount: z.ZodNumber;
|
|
185
|
+
reviewStatus: z.ZodEnum<{
|
|
186
|
+
new: "new";
|
|
187
|
+
needs_attention: "needs_attention";
|
|
188
|
+
reviewed: "reviewed";
|
|
189
|
+
}>;
|
|
110
190
|
}, z.core.$strict>>;
|
|
111
191
|
nextCursor: z.ZodOptional<z.ZodString>;
|
|
112
192
|
}, z.core.$strict>;
|
|
113
193
|
}, z.core.$strict>;
|
|
194
|
+
/** Show and review both answer with the conversation as staff now see it. */
|
|
114
195
|
export declare const ConversationShowResponseSchema: z.ZodObject<{
|
|
115
196
|
ok: z.ZodLiteral<true>;
|
|
116
197
|
data: z.ZodObject<{
|
|
117
198
|
conversation: z.ZodObject<{
|
|
199
|
+
notes: z.ZodArray<z.ZodObject<{
|
|
200
|
+
author: z.ZodString;
|
|
201
|
+
text: z.ZodString;
|
|
202
|
+
at: z.ZodISODateTime;
|
|
203
|
+
}, z.core.$strict>>;
|
|
204
|
+
expiresAt: z.ZodISODateTime;
|
|
118
205
|
items: z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
119
206
|
kind: z.ZodLiteral<"message">;
|
|
120
207
|
role: z.ZodEnum<{
|
|
@@ -152,13 +239,29 @@ export declare const ConversationShowResponseSchema: z.ZodObject<{
|
|
|
152
239
|
startedAt: z.ZodISODateTime;
|
|
153
240
|
lastMessageAt: z.ZodISODateTime;
|
|
154
241
|
itemCount: z.ZodNumber;
|
|
242
|
+
reviewStatus: z.ZodEnum<{
|
|
243
|
+
new: "new";
|
|
244
|
+
needs_attention: "needs_attention";
|
|
245
|
+
reviewed: "reviewed";
|
|
246
|
+
}>;
|
|
155
247
|
}, z.core.$strict>;
|
|
156
248
|
}, z.core.$strict>;
|
|
157
249
|
}, z.core.$strict>;
|
|
250
|
+
/** Review status needs `records:status`, a note `records:note`; at least one is required. */
|
|
251
|
+
export declare const ConversationReviewRequestSchema: z.ZodObject<{
|
|
252
|
+
reviewStatus: z.ZodOptional<z.ZodEnum<{
|
|
253
|
+
new: "new";
|
|
254
|
+
needs_attention: "needs_attention";
|
|
255
|
+
reviewed: "reviewed";
|
|
256
|
+
}>>;
|
|
257
|
+
note: z.ZodOptional<z.ZodString>;
|
|
258
|
+
}, z.core.$strict>;
|
|
259
|
+
export type ConversationReviewRequest = z.infer<typeof ConversationReviewRequestSchema>;
|
|
158
260
|
export declare const ConversationExportResponseSchema: z.ZodObject<{
|
|
159
261
|
ok: z.ZodLiteral<true>;
|
|
160
262
|
data: z.ZodObject<{
|
|
161
263
|
conversations: z.ZodArray<z.ZodObject<{
|
|
264
|
+
expiresAt: z.ZodISODateTime;
|
|
162
265
|
items: z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
163
266
|
kind: z.ZodLiteral<"message">;
|
|
164
267
|
role: z.ZodEnum<{
|
|
@@ -196,6 +299,11 @@ export declare const ConversationExportResponseSchema: z.ZodObject<{
|
|
|
196
299
|
startedAt: z.ZodISODateTime;
|
|
197
300
|
lastMessageAt: z.ZodISODateTime;
|
|
198
301
|
itemCount: z.ZodNumber;
|
|
302
|
+
reviewStatus: z.ZodEnum<{
|
|
303
|
+
new: "new";
|
|
304
|
+
needs_attention: "needs_attention";
|
|
305
|
+
reviewed: "reviewed";
|
|
306
|
+
}>;
|
|
199
307
|
}, z.core.$strict>>;
|
|
200
308
|
nextCursor: z.ZodOptional<z.ZodString>;
|
|
201
309
|
}, z.core.$strict>;
|
|
@@ -242,6 +350,11 @@ export declare const ConversationListClientResponseSchema: z.ZodObject<{
|
|
|
242
350
|
startedAt: z.ZodISODateTime;
|
|
243
351
|
lastMessageAt: z.ZodISODateTime;
|
|
244
352
|
itemCount: z.ZodNumber;
|
|
353
|
+
reviewStatus: z.ZodEnum<{
|
|
354
|
+
new: "new";
|
|
355
|
+
needs_attention: "needs_attention";
|
|
356
|
+
reviewed: "reviewed";
|
|
357
|
+
}>;
|
|
245
358
|
}, z.core.$strip>>;
|
|
246
359
|
nextCursor: z.ZodOptional<z.ZodString>;
|
|
247
360
|
}, z.core.$strip>;
|
|
@@ -250,6 +363,12 @@ export declare const ConversationShowClientResponseSchema: z.ZodObject<{
|
|
|
250
363
|
ok: z.ZodLiteral<true>;
|
|
251
364
|
data: z.ZodObject<{
|
|
252
365
|
conversation: z.ZodObject<{
|
|
366
|
+
notes: z.ZodArray<z.ZodObject<{
|
|
367
|
+
author: z.ZodString;
|
|
368
|
+
text: z.ZodString;
|
|
369
|
+
at: z.ZodISODateTime;
|
|
370
|
+
}, z.core.$strip>>;
|
|
371
|
+
expiresAt: z.ZodISODateTime;
|
|
253
372
|
items: z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
254
373
|
kind: z.ZodLiteral<"message">;
|
|
255
374
|
role: z.ZodEnum<{
|
|
@@ -287,6 +406,11 @@ export declare const ConversationShowClientResponseSchema: z.ZodObject<{
|
|
|
287
406
|
startedAt: z.ZodISODateTime;
|
|
288
407
|
lastMessageAt: z.ZodISODateTime;
|
|
289
408
|
itemCount: z.ZodNumber;
|
|
409
|
+
reviewStatus: z.ZodEnum<{
|
|
410
|
+
new: "new";
|
|
411
|
+
needs_attention: "needs_attention";
|
|
412
|
+
reviewed: "reviewed";
|
|
413
|
+
}>;
|
|
290
414
|
}, z.core.$strip>;
|
|
291
415
|
}, z.core.$strip>;
|
|
292
416
|
}, z.core.$strip>;
|
|
@@ -294,6 +418,7 @@ export declare const ConversationExportClientResponseSchema: z.ZodObject<{
|
|
|
294
418
|
ok: z.ZodLiteral<true>;
|
|
295
419
|
data: z.ZodObject<{
|
|
296
420
|
conversations: z.ZodArray<z.ZodObject<{
|
|
421
|
+
expiresAt: z.ZodISODateTime;
|
|
297
422
|
items: z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
298
423
|
kind: z.ZodLiteral<"message">;
|
|
299
424
|
role: z.ZodEnum<{
|
|
@@ -331,6 +456,11 @@ export declare const ConversationExportClientResponseSchema: z.ZodObject<{
|
|
|
331
456
|
startedAt: z.ZodISODateTime;
|
|
332
457
|
lastMessageAt: z.ZodISODateTime;
|
|
333
458
|
itemCount: z.ZodNumber;
|
|
459
|
+
reviewStatus: z.ZodEnum<{
|
|
460
|
+
new: "new";
|
|
461
|
+
needs_attention: "needs_attention";
|
|
462
|
+
reviewed: "reviewed";
|
|
463
|
+
}>;
|
|
334
464
|
}, z.core.$strip>>;
|
|
335
465
|
nextCursor: z.ZodOptional<z.ZodString>;
|
|
336
466
|
}, z.core.$strip>;
|
|
@@ -344,4 +474,50 @@ export declare const ConversationForgetClientResponseSchema: z.ZodObject<{
|
|
|
344
474
|
}, z.core.$strip>;
|
|
345
475
|
}, z.core.$strip>;
|
|
346
476
|
}, z.core.$strip>;
|
|
477
|
+
export declare const ASSISTANT_CONVERSATION_PAGE_MAXIMUM = 50;
|
|
478
|
+
export declare const ASSISTANT_CONVERSATION_PREVIEW_MAXIMUM = 120;
|
|
479
|
+
export declare const AssistantConversationListRequestSchema: z.ZodObject<{
|
|
480
|
+
user: z.ZodObject<{
|
|
481
|
+
id: z.ZodString;
|
|
482
|
+
}, z.core.$strict>;
|
|
483
|
+
limit: z.ZodOptional<z.ZodNumber>;
|
|
484
|
+
cursor: z.ZodOptional<z.ZodString>;
|
|
485
|
+
}, z.core.$strict>;
|
|
486
|
+
export declare const AssistantConversationForgetUserRequestSchema: z.ZodObject<{
|
|
487
|
+
user: z.ZodObject<{
|
|
488
|
+
id: z.ZodString;
|
|
489
|
+
}, z.core.$strict>;
|
|
490
|
+
}, z.core.$strict>;
|
|
491
|
+
export declare const AssistantConversationListResponseSchema: z.ZodObject<{
|
|
492
|
+
ok: z.ZodLiteral<true>;
|
|
493
|
+
data: z.ZodObject<{
|
|
494
|
+
conversations: z.ZodArray<z.ZodObject<{
|
|
495
|
+
id: z.ZodString;
|
|
496
|
+
channel: z.ZodEnum<{
|
|
497
|
+
whatsapp: "whatsapp";
|
|
498
|
+
website: "website";
|
|
499
|
+
}>;
|
|
500
|
+
startedAt: z.ZodISODateTime;
|
|
501
|
+
lastMessageAt: z.ZodISODateTime;
|
|
502
|
+
preview: z.ZodOptional<z.ZodString>;
|
|
503
|
+
}, z.core.$strict>>;
|
|
504
|
+
nextCursor: z.ZodOptional<z.ZodString>;
|
|
505
|
+
}, z.core.$strict>;
|
|
506
|
+
}, z.core.$strict>;
|
|
507
|
+
export declare const AssistantConversationListClientResponseSchema: z.ZodObject<{
|
|
508
|
+
ok: z.ZodLiteral<true>;
|
|
509
|
+
data: z.ZodObject<{
|
|
510
|
+
conversations: z.ZodArray<z.ZodObject<{
|
|
511
|
+
id: z.ZodString;
|
|
512
|
+
channel: z.ZodEnum<{
|
|
513
|
+
whatsapp: "whatsapp";
|
|
514
|
+
website: "website";
|
|
515
|
+
}>;
|
|
516
|
+
startedAt: z.ZodISODateTime;
|
|
517
|
+
lastMessageAt: z.ZodISODateTime;
|
|
518
|
+
preview: z.ZodOptional<z.ZodString>;
|
|
519
|
+
}, z.core.$strip>>;
|
|
520
|
+
nextCursor: z.ZodOptional<z.ZodString>;
|
|
521
|
+
}, z.core.$strip>;
|
|
522
|
+
}, z.core.$strip>;
|
|
347
523
|
//# sourceMappingURL=conversation-history.d.ts.map
|
|
@@ -5,6 +5,8 @@ import { z } from 'zod';
|
|
|
5
5
|
*/
|
|
6
6
|
export const ConversationIdSchema = z.string().regex(/^cv_[A-Za-z0-9_-]{8,64}$/);
|
|
7
7
|
export const ConversationChannelSchema = z.enum(['website', 'whatsapp']);
|
|
8
|
+
/** Staff review state; a failed tool outcome sets `needs_attention` automatically. */
|
|
9
|
+
export const ConversationReviewStatusSchema = z.enum(['new', 'needs_attention', 'reviewed']);
|
|
8
10
|
const SubjectRefSchema = z.string().min(1).max(256);
|
|
9
11
|
/** Anonymous handles never leave the service; verified subjects carry the reference forget uses. */
|
|
10
12
|
const ConversationSubjectSchema = z.discriminatedUnion('kind', [
|
|
@@ -19,6 +21,7 @@ export const ConversationSummarySchema = z.strictObject({
|
|
|
19
21
|
startedAt: z.iso.datetime(),
|
|
20
22
|
lastMessageAt: z.iso.datetime(),
|
|
21
23
|
itemCount: z.number().int().min(1),
|
|
24
|
+
reviewStatus: ConversationReviewStatusSchema,
|
|
22
25
|
});
|
|
23
26
|
export const ConversationItemSchema = z.discriminatedUnion('kind', [
|
|
24
27
|
z.strictObject({
|
|
@@ -37,8 +40,22 @@ export const ConversationItemSchema = z.discriminatedUnion('kind', [
|
|
|
37
40
|
]);
|
|
38
41
|
export const ConversationDetailSchema = z.strictObject({
|
|
39
42
|
...ConversationSummarySchema.shape,
|
|
43
|
+
/** When the last visible item is removed automatically under the live retention window. */
|
|
44
|
+
expiresAt: z.iso.datetime(),
|
|
40
45
|
items: z.array(ConversationItemSchema).max(10_000),
|
|
41
46
|
});
|
|
47
|
+
const NoteTextSchema = z.string().trim().min(1).max(2000);
|
|
48
|
+
/** A private staff note: never sent to the customer, never exported, removed with its conversation. */
|
|
49
|
+
export const ConversationNoteSchema = z.strictObject({
|
|
50
|
+
author: z.string().min(1).max(500),
|
|
51
|
+
text: NoteTextSchema,
|
|
52
|
+
at: z.iso.datetime(),
|
|
53
|
+
});
|
|
54
|
+
/** Show adds the private notes that export leaves out. */
|
|
55
|
+
export const ConversationShowSchema = z.strictObject({
|
|
56
|
+
...ConversationDetailSchema.shape,
|
|
57
|
+
notes: z.array(ConversationNoteSchema).max(100),
|
|
58
|
+
});
|
|
42
59
|
const NextCursorSchema = z.string().min(1).max(2048);
|
|
43
60
|
export const ConversationListResponseSchema = z.strictObject({
|
|
44
61
|
ok: z.literal(true),
|
|
@@ -47,9 +64,19 @@ export const ConversationListResponseSchema = z.strictObject({
|
|
|
47
64
|
nextCursor: NextCursorSchema.optional(),
|
|
48
65
|
}),
|
|
49
66
|
});
|
|
67
|
+
/** Show and review both answer with the conversation as staff now see it. */
|
|
50
68
|
export const ConversationShowResponseSchema = z.strictObject({
|
|
51
69
|
ok: z.literal(true),
|
|
52
|
-
data: z.strictObject({ conversation:
|
|
70
|
+
data: z.strictObject({ conversation: ConversationShowSchema }),
|
|
71
|
+
});
|
|
72
|
+
/** Review status needs `records:status`, a note `records:note`; at least one is required. */
|
|
73
|
+
export const ConversationReviewRequestSchema = z
|
|
74
|
+
.strictObject({
|
|
75
|
+
reviewStatus: ConversationReviewStatusSchema.optional(),
|
|
76
|
+
note: NoteTextSchema.optional(),
|
|
77
|
+
})
|
|
78
|
+
.refine((value) => value.reviewStatus !== undefined || value.note !== undefined, {
|
|
79
|
+
message: 'Set a review status or add a note.',
|
|
53
80
|
});
|
|
54
81
|
export const ConversationExportResponseSchema = z.strictObject({
|
|
55
82
|
ok: z.literal(true),
|
|
@@ -91,6 +118,7 @@ const ClientItemSchema = z.discriminatedUnion('kind', [
|
|
|
91
118
|
]);
|
|
92
119
|
const ClientDetailSchema = z.object({
|
|
93
120
|
...ClientSummarySchema.shape,
|
|
121
|
+
expiresAt: ConversationDetailSchema.shape.expiresAt,
|
|
94
122
|
items: z.array(ClientItemSchema).max(10_000),
|
|
95
123
|
});
|
|
96
124
|
export const ConversationListClientResponseSchema = z.object({
|
|
@@ -102,7 +130,12 @@ export const ConversationListClientResponseSchema = z.object({
|
|
|
102
130
|
});
|
|
103
131
|
export const ConversationShowClientResponseSchema = z.object({
|
|
104
132
|
ok: z.literal(true),
|
|
105
|
-
data: z.object({
|
|
133
|
+
data: z.object({
|
|
134
|
+
conversation: z.object({
|
|
135
|
+
...ClientDetailSchema.shape,
|
|
136
|
+
notes: z.array(z.object(ConversationNoteSchema.shape)).max(100),
|
|
137
|
+
}),
|
|
138
|
+
}),
|
|
106
139
|
});
|
|
107
140
|
export const ConversationExportClientResponseSchema = z.object({
|
|
108
141
|
ok: z.literal(true),
|
|
@@ -117,4 +150,43 @@ export const ConversationForgetClientResponseSchema = z.object({
|
|
|
117
150
|
forgotten: z.object(ConversationForgetResponseSchema.shape.data.shape.forgotten.shape),
|
|
118
151
|
}),
|
|
119
152
|
});
|
|
153
|
+
/**
|
|
154
|
+
* The customer-backend projection (ADR 0241 decision 12): an embed client lists or forgets one of its
|
|
155
|
+
* own verified users, by the same `user.id` its session exchange sent. The tenant comes from the client
|
|
156
|
+
* credential, never the body; rows carry no subject and at most a short preview of the first question.
|
|
157
|
+
*/
|
|
158
|
+
const CustomerUserSchema = z.strictObject({ id: z.string().min(1).max(240) });
|
|
159
|
+
export const ASSISTANT_CONVERSATION_PAGE_MAXIMUM = 50;
|
|
160
|
+
export const ASSISTANT_CONVERSATION_PREVIEW_MAXIMUM = 120;
|
|
161
|
+
export const AssistantConversationListRequestSchema = z.strictObject({
|
|
162
|
+
user: CustomerUserSchema,
|
|
163
|
+
limit: z.number().int().min(1).max(ASSISTANT_CONVERSATION_PAGE_MAXIMUM).optional(),
|
|
164
|
+
cursor: NextCursorSchema.optional(),
|
|
165
|
+
});
|
|
166
|
+
export const AssistantConversationForgetUserRequestSchema = z.strictObject({
|
|
167
|
+
user: CustomerUserSchema,
|
|
168
|
+
});
|
|
169
|
+
const AssistantConversationRowSchema = z.strictObject({
|
|
170
|
+
id: ConversationIdSchema,
|
|
171
|
+
channel: ConversationChannelSchema,
|
|
172
|
+
startedAt: z.iso.datetime(),
|
|
173
|
+
lastMessageAt: z.iso.datetime(),
|
|
174
|
+
preview: z.string().min(1).max(ASSISTANT_CONVERSATION_PREVIEW_MAXIMUM).optional(),
|
|
175
|
+
});
|
|
176
|
+
export const AssistantConversationListResponseSchema = z.strictObject({
|
|
177
|
+
ok: z.literal(true),
|
|
178
|
+
data: z.strictObject({
|
|
179
|
+
conversations: z.array(AssistantConversationRowSchema).max(ASSISTANT_CONVERSATION_PAGE_MAXIMUM),
|
|
180
|
+
nextCursor: NextCursorSchema.optional(),
|
|
181
|
+
}),
|
|
182
|
+
});
|
|
183
|
+
export const AssistantConversationListClientResponseSchema = z.object({
|
|
184
|
+
ok: z.literal(true),
|
|
185
|
+
data: z.object({
|
|
186
|
+
conversations: z
|
|
187
|
+
.array(z.object(AssistantConversationRowSchema.shape))
|
|
188
|
+
.max(ASSISTANT_CONVERSATION_PAGE_MAXIMUM),
|
|
189
|
+
nextCursor: NextCursorSchema.optional(),
|
|
190
|
+
}),
|
|
191
|
+
});
|
|
120
192
|
//# sourceMappingURL=conversation-history.js.map
|
|
@@ -391,6 +391,7 @@ export * from './application-activity.js';
|
|
|
391
391
|
export * from './application-connections.js';
|
|
392
392
|
export * from './application-draft-validation.js';
|
|
393
393
|
export * from './application-drafts.js';
|
|
394
|
+
export * from './application-history-settings.js';
|
|
394
395
|
export * from './application-onboarding.js';
|
|
395
396
|
export * from './billing-catalog.js';
|
|
396
397
|
export * from './business-workspaces.js';
|
|
@@ -230,6 +230,7 @@ export * from './application-activity.js';
|
|
|
230
230
|
export * from './application-connections.js';
|
|
231
231
|
export * from './application-draft-validation.js';
|
|
232
232
|
export * from './application-drafts.js';
|
|
233
|
+
export * from './application-history-settings.js';
|
|
233
234
|
export * from './application-onboarding.js';
|
|
234
235
|
export * from './billing-catalog.js';
|
|
235
236
|
export * from './business-workspaces.js';
|
|
@@ -626,6 +626,25 @@ replay across sessions. React applications may observe recovery and structured f
|
|
|
626
626
|
`createAssistantSession` returns the opaque token, expiry, resolved non-secret configuration, and explicit
|
|
627
627
|
turn/interaction endpoint URLs. Forward that response unchanged to the component or headless client.
|
|
628
628
|
|
|
629
|
+
#### Your users' conversation history
|
|
630
|
+
|
|
631
|
+
When the business records conversations, the same backend credential lists or erases one signed-in user's
|
|
632
|
+
chats. Pass the exact `user.id` your session exchange sends; the client's application environment is the
|
|
633
|
+
only scope, so one customer's backend never reaches another's history.
|
|
634
|
+
|
|
635
|
+
```ts
|
|
636
|
+
import { forgetUser, listConversations } from "@noodleseed/assistant/server";
|
|
637
|
+
|
|
638
|
+
const credentials = { serviceUrl, clientId, clientSecret };
|
|
639
|
+
// A "your chats" view: newest first, each with a short preview of the first question.
|
|
640
|
+
const page = await listConversations({ ...credentials, user: { id: account.id }, limit: 20 });
|
|
641
|
+
// In your own account deletion. Idempotent, so a retry after a 5xx is safe.
|
|
642
|
+
await forgetUser({ ...credentials, user: { id: account.id } });
|
|
643
|
+
```
|
|
644
|
+
|
|
645
|
+
`forgetUser` erases stored conversation history only; a live session's short-lived working memory is not
|
|
646
|
+
touched and expires within two hours. Failures throw `AssistantConversationsError` with a typed `detail` (`status`, `retryable`, `serviceCode`).
|
|
647
|
+
|
|
629
648
|
The MCP server's top-level `branding` block is the portable deployment source for identity and colors shared
|
|
630
649
|
by widgets and the assistant. The embedding application may use the typed `appearance` object when it needs
|
|
631
650
|
exact control over assistant-specific roles:
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@noodleseed/assistant",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.37.0",
|
|
4
4
|
"description": "Embed the Noodle Seed customer-branded assistant in your web app with managed or framework-owned UI, a framework-neutral MCP App host, a DOM-free client, and a backend session helper. Authoring and deploying the server is @noodleseed/one.",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"repository": {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@noodleseed/one",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.178.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",
|
|
@@ -236,7 +236,7 @@
|
|
|
236
236
|
"@modelcontextprotocol/client": "2.0.0",
|
|
237
237
|
"@modelcontextprotocol/server": "2.0.0",
|
|
238
238
|
"@noodle-borg/admission-limits": "0.0.0",
|
|
239
|
-
"@noodle-borg/agent-kit": "0.
|
|
239
|
+
"@noodle-borg/agent-kit": "0.108.0",
|
|
240
240
|
"@noodle-borg/app-audit": "0.0.0",
|
|
241
241
|
"@noodle-borg/app-package": "0.0.0",
|
|
242
242
|
"@noodle-borg/assistant-gateway": "0.0.0",
|