@noodleseed/one 0.175.1 → 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/knowledge.d.ts.map +1 -1
- package/dist/commands/knowledge.js +4 -7
- package/dist/commands/knowledge.js.map +1 -1
- 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/dist/commands/whatsapp-ops.d.ts.map +1 -1
- package/dist/commands/whatsapp-ops.js +12 -2
- package/dist/commands/whatsapp-ops.js.map +1 -1
- package/dist/commands/whatsapp-output.d.ts.map +1 -1
- package/dist/commands/whatsapp-output.js +1 -0
- package/dist/commands/whatsapp-output.js.map +1 -1
- package/node_modules/@noodle-borg/assistant-gateway/dist/channel-coordinator.d.ts +14 -8
- package/node_modules/@noodle-borg/assistant-gateway/dist/channel-coordinator.js +11 -2
- package/node_modules/@noodle-borg/assistant-gateway/dist/channel-types.d.ts +14 -5
- package/node_modules/@noodle-borg/cli-catalog/dist/catalog-data-channels.js +5 -3
- 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/knowledge-operations/dist/executor.d.ts +3 -5
- package/node_modules/@noodle-borg/knowledge-operations/dist/executor.js +2 -7
- package/node_modules/@noodle-borg/knowledge-operations/dist/portable.d.ts +1 -1
- package/node_modules/@noodle-borg/knowledge-operations/dist/portable.js +1 -1
- package/node_modules/@noodle-borg/knowledge-operations/dist/publication.d.ts +0 -1
- package/node_modules/@noodle-borg/knowledge-operations/dist/publication.js +1 -10
- package/node_modules/@noodle-borg/knowledge-operations/dist/routes.d.ts +0 -4
- package/node_modules/@noodle-borg/knowledge-operations/dist/routes.js +1 -17
- package/node_modules/@noodle-borg/knowledge-operations/dist/search-port.d.ts +1 -2
- package/node_modules/@noodle-borg/knowledge-operations/dist/search-port.js +1 -3
- package/node_modules/@noodle-borg/knowledge-operations/dist/service-wiring.d.ts +4 -4
- package/node_modules/@noodle-borg/knowledge-operations/dist/service-wiring.js +3 -8
- package/node_modules/@noodle-borg/knowledge-operations/dist/status-routes.d.ts +1 -2
- package/node_modules/@noodle-borg/knowledge-operations/dist/status-routes.js +0 -14
- package/node_modules/@noodle-borg/protocol/dist/knowledge-tool.js +3 -5
- package/node_modules/@noodle-borg/runtime/dist/execute.d.ts +2 -3
- package/node_modules/@noodle-borg/service/dist/assistant-composition.js +9 -0
- package/node_modules/@noodle-borg/service/dist/business-information/validation.js +1 -22
- package/node_modules/@noodle-borg/service/dist/channels/360dialog.js +41 -145
- package/node_modules/@noodle-borg/service/dist/channels/composition.js +1 -0
- package/node_modules/@noodle-borg/service/dist/channels/meta-cloud.js +102 -0
- package/node_modules/@noodle-borg/service/dist/channels/provider.js +187 -0
- package/node_modules/@noodle-borg/service/dist/channels/runtime.js +49 -21
- package/node_modules/@noodle-borg/service/dist/conversation-history/capture.js +99 -0
- package/node_modules/@noodle-borg/service/dist/conversation-history/contracts.js +17 -0
- package/node_modules/@noodle-borg/service/dist/conversation-history/operator.js +184 -0
- package/node_modules/@noodle-borg/service/dist/payment-card.js +34 -0
- package/node_modules/@noodle-borg/service/dist/routes/assistant-elevation.js +2 -0
- package/node_modules/@noodle-borg/service/dist/routes/assistant-interaction-stream.js +4 -2
- package/node_modules/@noodle-borg/service/dist/routes/assistant-interactions.js +15 -0
- package/node_modules/@noodle-borg/service/dist/routes/assistant-knowledge.js +1 -3
- package/node_modules/@noodle-borg/service/dist/routes/assistant.js +8 -6
- 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/routes/whatsapp-meta.js +130 -0
- package/node_modules/@noodle-borg/service/dist/routes/whatsapp.js +18 -9
- 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/transport-http/dist/index.d.ts +1 -1
- package/node_modules/@noodle-borg/transport-http/dist/index.js +1 -1
- package/node_modules/@noodle-borg/transport-http/dist/request-body.d.ts +9 -0
- package/node_modules/@noodle-borg/transport-http/dist/request-body.js +2 -1
- 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 +31 -9
- package/node_modules/@noodle-borg/wire-contracts/dist/whatsapp.js +27 -4
- package/package.json +1 -1
|
@@ -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';
|
|
@@ -11,11 +11,21 @@ export declare const WhatsAppLimitsSchema: z.ZodObject<{
|
|
|
11
11
|
textCharacters: z.ZodNumber;
|
|
12
12
|
dailyMicroUsd: z.ZodNumber;
|
|
13
13
|
}, z.core.$strict>;
|
|
14
|
+
/** `360dialog` keeps a per-binding callback secret; `meta` names its WABA and uses the app signature. */
|
|
15
|
+
export declare const WhatsAppProviderSchema: z.ZodEnum<{
|
|
16
|
+
"360dialog": "360dialog";
|
|
17
|
+
meta: "meta";
|
|
18
|
+
}>;
|
|
14
19
|
export declare const WhatsAppConfigureRequestSchema: z.ZodObject<{
|
|
15
20
|
expectedRevision: z.ZodNumber;
|
|
21
|
+
provider: z.ZodDefault<z.ZodEnum<{
|
|
22
|
+
"360dialog": "360dialog";
|
|
23
|
+
meta: "meta";
|
|
24
|
+
}>>;
|
|
16
25
|
phoneNumberId: z.ZodString;
|
|
26
|
+
wabaId: z.ZodOptional<z.ZodString>;
|
|
17
27
|
apiKeySecret: z.ZodString;
|
|
18
|
-
webhookSecret: z.ZodString
|
|
28
|
+
webhookSecret: z.ZodOptional<z.ZodString>;
|
|
19
29
|
capabilities: z.ZodArray<z.ZodObject<{
|
|
20
30
|
kind: z.ZodEnum<{
|
|
21
31
|
tool: "tool";
|
|
@@ -86,10 +96,14 @@ export declare const WhatsAppBindingSchema: z.ZodObject<{
|
|
|
86
96
|
app: z.ZodString;
|
|
87
97
|
env: z.ZodString;
|
|
88
98
|
}, z.core.$strict>;
|
|
89
|
-
provider: z.
|
|
99
|
+
provider: z.ZodEnum<{
|
|
100
|
+
"360dialog": "360dialog";
|
|
101
|
+
meta: "meta";
|
|
102
|
+
}>;
|
|
90
103
|
phoneNumberId: z.ZodString;
|
|
104
|
+
wabaId: z.ZodOptional<z.ZodString>;
|
|
91
105
|
apiKeySecret: z.ZodString;
|
|
92
|
-
webhookSecret: z.ZodString
|
|
106
|
+
webhookSecret: z.ZodOptional<z.ZodString>;
|
|
93
107
|
deploymentId: z.ZodString;
|
|
94
108
|
capabilities: z.ZodArray<z.ZodObject<{
|
|
95
109
|
kind: z.ZodEnum<{
|
|
@@ -133,10 +147,14 @@ export declare const WhatsAppBindingResponseSchema: z.ZodObject<{
|
|
|
133
147
|
app: z.ZodString;
|
|
134
148
|
env: z.ZodString;
|
|
135
149
|
}, z.core.$strict>;
|
|
136
|
-
provider: z.
|
|
150
|
+
provider: z.ZodEnum<{
|
|
151
|
+
"360dialog": "360dialog";
|
|
152
|
+
meta: "meta";
|
|
153
|
+
}>;
|
|
137
154
|
phoneNumberId: z.ZodString;
|
|
155
|
+
wabaId: z.ZodOptional<z.ZodString>;
|
|
138
156
|
apiKeySecret: z.ZodString;
|
|
139
|
-
webhookSecret: z.ZodString
|
|
157
|
+
webhookSecret: z.ZodOptional<z.ZodString>;
|
|
140
158
|
deploymentId: z.ZodString;
|
|
141
159
|
capabilities: z.ZodArray<z.ZodObject<{
|
|
142
160
|
kind: z.ZodEnum<{
|
|
@@ -176,10 +194,14 @@ export declare const WhatsAppBindingClientResponseSchema: z.ZodObject<{
|
|
|
176
194
|
ok: z.ZodLiteral<true>;
|
|
177
195
|
data: z.ZodNullable<z.ZodObject<{
|
|
178
196
|
id: z.ZodString;
|
|
179
|
-
provider: z.
|
|
197
|
+
provider: z.ZodEnum<{
|
|
198
|
+
"360dialog": "360dialog";
|
|
199
|
+
meta: "meta";
|
|
200
|
+
}>;
|
|
180
201
|
phoneNumberId: z.ZodString;
|
|
202
|
+
wabaId: z.ZodOptional<z.ZodString>;
|
|
181
203
|
apiKeySecret: z.ZodString;
|
|
182
|
-
webhookSecret: z.ZodString
|
|
204
|
+
webhookSecret: z.ZodOptional<z.ZodString>;
|
|
183
205
|
deploymentId: z.ZodString;
|
|
184
206
|
supportEmail: z.ZodEmail;
|
|
185
207
|
revision: z.ZodNumber;
|
|
@@ -337,11 +359,11 @@ export declare const WhatsAppEventsResponseSchema: z.ZodObject<{
|
|
|
337
359
|
queued: "queued";
|
|
338
360
|
running: "running";
|
|
339
361
|
failed: "failed";
|
|
362
|
+
cancelled: "cancelled";
|
|
340
363
|
delivered: "delivered";
|
|
341
364
|
reply: "reply";
|
|
342
365
|
sending: "sending";
|
|
343
366
|
refused: "refused";
|
|
344
|
-
cancelled: "cancelled";
|
|
345
367
|
}>;
|
|
346
368
|
eventAt: z.ZodNumber;
|
|
347
369
|
receivedAt: z.ZodNumber;
|
|
@@ -364,11 +386,11 @@ export declare const WhatsAppEventsClientResponseSchema: z.ZodObject<{
|
|
|
364
386
|
queued: "queued";
|
|
365
387
|
running: "running";
|
|
366
388
|
failed: "failed";
|
|
389
|
+
cancelled: "cancelled";
|
|
367
390
|
delivered: "delivered";
|
|
368
391
|
reply: "reply";
|
|
369
392
|
sending: "sending";
|
|
370
393
|
refused: "refused";
|
|
371
|
-
cancelled: "cancelled";
|
|
372
394
|
}>;
|
|
373
395
|
eventAt: z.ZodNumber;
|
|
374
396
|
receivedAt: z.ZodNumber;
|
|
@@ -20,14 +20,36 @@ export const WhatsAppLimitsSchema = z.strictObject({
|
|
|
20
20
|
});
|
|
21
21
|
const capability = z.strictObject({ kind: z.enum(['tool', 'knowledge']), name: id });
|
|
22
22
|
const secretRef = z.string().regex(/^[A-Z][A-Z0-9_]{0,127}$/);
|
|
23
|
-
|
|
23
|
+
/** `360dialog` keeps a per-binding callback secret; `meta` names its WABA and uses the app signature. */
|
|
24
|
+
export const WhatsAppProviderSchema = z.enum(['360dialog', 'meta']);
|
|
25
|
+
export const WhatsAppConfigureRequestSchema = z
|
|
26
|
+
.strictObject({
|
|
24
27
|
expectedRevision: revision,
|
|
28
|
+
provider: WhatsAppProviderSchema.default('360dialog'),
|
|
25
29
|
phoneNumberId: id,
|
|
30
|
+
wabaId: id.optional(),
|
|
26
31
|
apiKeySecret: secretRef,
|
|
27
|
-
webhookSecret: secretRef,
|
|
32
|
+
webhookSecret: secretRef.optional(),
|
|
28
33
|
capabilities: z.array(capability).max(64),
|
|
29
34
|
supportEmail: z.email().max(254),
|
|
30
35
|
limits: WhatsAppLimitsSchema.partial().optional(),
|
|
36
|
+
})
|
|
37
|
+
.superRefine((value, context) => {
|
|
38
|
+
const meta = value.provider === 'meta';
|
|
39
|
+
if (meta ? !value.wabaId : !value.webhookSecret)
|
|
40
|
+
context.addIssue({
|
|
41
|
+
code: 'custom',
|
|
42
|
+
path: [meta ? 'wabaId' : 'webhookSecret'],
|
|
43
|
+
message: meta ? 'Meta requires wabaId' : '360dialog requires webhookSecret',
|
|
44
|
+
});
|
|
45
|
+
if (meta ? value.webhookSecret !== undefined : value.wabaId !== undefined)
|
|
46
|
+
context.addIssue({
|
|
47
|
+
code: 'custom',
|
|
48
|
+
path: [meta ? 'webhookSecret' : 'wabaId'],
|
|
49
|
+
message: meta
|
|
50
|
+
? 'Meta callbacks are authenticated by the app signature, not a webhook secret'
|
|
51
|
+
: 'wabaId applies only to the meta provider',
|
|
52
|
+
});
|
|
31
53
|
});
|
|
32
54
|
export const WhatsAppStateRequestSchema = z.strictObject({
|
|
33
55
|
expectedRevision: revision,
|
|
@@ -64,10 +86,11 @@ const tenant = z.strictObject({ org: id, app: id, env: id });
|
|
|
64
86
|
export const WhatsAppBindingSchema = z.strictObject({
|
|
65
87
|
id,
|
|
66
88
|
tenant,
|
|
67
|
-
provider:
|
|
89
|
+
provider: WhatsAppProviderSchema,
|
|
68
90
|
phoneNumberId: id,
|
|
91
|
+
wabaId: id.optional(),
|
|
69
92
|
apiKeySecret: secretRef,
|
|
70
|
-
webhookSecret: secretRef,
|
|
93
|
+
webhookSecret: secretRef.optional(),
|
|
71
94
|
deploymentId: id,
|
|
72
95
|
capabilities: z.array(capability),
|
|
73
96
|
supportEmail: z.email(),
|
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",
|