@noodleseed/one 0.187.0 → 0.189.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.js +1 -1
- package/dist/commands/solutions-conversations.js.map +1 -1
- package/dist/commands/solutions-history.d.ts.map +1 -1
- package/dist/commands/solutions-history.js +5 -2
- package/dist/commands/solutions-history.js.map +1 -1
- package/dist/commands/whatsapp-ops.d.ts +1 -1
- package/dist/commands/whatsapp-ops.d.ts.map +1 -1
- package/dist/commands/whatsapp-ops.js +31 -9
- package/dist/commands/whatsapp-ops.js.map +1 -1
- package/dist/commands/whatsapp-output.d.ts +1 -1
- package/dist/commands/whatsapp-output.d.ts.map +1 -1
- package/dist/commands/whatsapp-output.js +8 -6
- package/dist/commands/whatsapp-output.js.map +1 -1
- package/node_modules/@noodle-borg/agent-kit/dist/behavior-skills.js +19 -35
- package/node_modules/@noodle-borg/agent-kit/dist/generated/example-files.js +2 -2
- package/node_modules/@noodle-borg/agent-kit/dist/index.d.ts +0 -1
- package/node_modules/@noodle-borg/agent-kit/dist/index.js +9 -27
- package/node_modules/@noodle-borg/agent-kit/dist/plugin-bootstrap-skill.js +1 -10
- package/node_modules/@noodle-borg/agent-kit/dist/skill-authoring-split.js +68 -0
- package/node_modules/@noodle-borg/agent-kit/dist/skill-content.js +38 -4
- package/node_modules/@noodle-borg/agent-kit/dist/skill-embedded-assistant-ref.js +7 -5
- package/node_modules/@noodle-borg/agent-kit/dist/skill-embedded-assistant-split.js +68 -0
- package/node_modules/@noodle-borg/agent-kit/dist/skill-existing-app-ref.js +1 -1
- package/node_modules/@noodle-borg/agent-kit/dist/skill-router.d.ts +3 -2
- package/node_modules/@noodle-borg/agent-kit/dist/skill-router.js +11 -99
- package/node_modules/@noodle-borg/agent-kit/dist/skill-server-playbook-ref.js +1 -1
- package/node_modules/@noodle-borg/agent-kit/dist/skill-verification-ref.js +2 -2
- package/node_modules/@noodle-borg/agent-kit/package.json +1 -1
- package/node_modules/@noodle-borg/assistant-gateway/dist/assistant-model-context.js +1 -0
- package/node_modules/@noodle-borg/assistant-gateway/dist/channel-coordinator.d.ts +89 -0
- package/node_modules/@noodle-borg/assistant-gateway/dist/channel-coordinator.js +20 -1
- package/node_modules/@noodle-borg/assistant-gateway/dist/channel-inbox.js +16 -1
- package/node_modules/@noodle-borg/assistant-gateway/dist/channel-store.d.ts +1 -1
- package/node_modules/@noodle-borg/assistant-gateway/dist/channel-types.d.ts +34 -3
- package/node_modules/@noodle-borg/assistant-gateway/dist/channel-types.js +10 -4
- package/node_modules/@noodle-borg/authoring/dist/assistant.d.ts +1 -1
- package/node_modules/@noodle-borg/authoring/dist/assistant.js +1 -1
- package/node_modules/@noodle-borg/cli-catalog/dist/catalog-data-channels.js +26 -0
- package/node_modules/@noodle-borg/cli-catalog/dist/catalog-data-solution-conversations.js +1 -1
- package/node_modules/@noodle-borg/cli-catalog/dist/catalog-data-solution-history.js +1 -0
- package/node_modules/@noodle-borg/compiler/dist/manifest/schema.d.ts +4 -0
- package/node_modules/@noodle-borg/compiler/dist/manifest/schema.js +1 -1
- package/node_modules/@noodle-borg/compiler/dist/manifest/website-projection.d.ts +1 -0
- package/node_modules/@noodle-borg/compiler/dist/manifest/website-projection.js +11 -2
- package/node_modules/@noodle-borg/runtime/dist/connector/types.d.ts +1 -1
- package/node_modules/@noodle-borg/service/dist/application-history-settings.js +2 -0
- package/node_modules/@noodle-borg/service/dist/build-info.js +1 -0
- package/node_modules/@noodle-borg/service/dist/channels/composition.js +3 -2
- package/node_modules/@noodle-borg/service/dist/channels/messaging-eligibility.js +6 -1
- package/node_modules/@noodle-borg/service/dist/channels/reply-bound.js +4 -0
- package/node_modules/@noodle-borg/service/dist/channels/runtime.js +38 -10
- package/node_modules/@noodle-borg/service/dist/channels/twilio-sms.js +188 -0
- package/node_modules/@noodle-borg/service/dist/channels/twilio-webhook.js +16 -0
- package/node_modules/@noodle-borg/service/dist/conversation-history/contracts.js +1 -0
- package/node_modules/@noodle-borg/service/dist/routes/business-information-channels.js +3 -1
- package/node_modules/@noodle-borg/service/dist/routes/service-probes.js +1 -0
- package/node_modules/@noodle-borg/service/dist/routes/sms-twilio.js +66 -0
- package/node_modules/@noodle-borg/service/dist/routes/whatsapp.js +31 -21
- package/node_modules/@noodle-borg/service/dist/service.js +2 -2
- package/node_modules/@noodle-borg/service/package.json +1 -1
- package/node_modules/@noodle-borg/wire-contracts/dist/application-channels.d.ts +33 -0
- package/node_modules/@noodle-borg/wire-contracts/dist/application-channels.js +3 -1
- package/node_modules/@noodle-borg/wire-contracts/dist/application-history-settings.d.ts +7 -0
- package/node_modules/@noodle-borg/wire-contracts/dist/application-history-settings.js +2 -1
- package/node_modules/@noodle-borg/wire-contracts/dist/conversation-history.d.ts +12 -0
- package/node_modules/@noodle-borg/wire-contracts/dist/conversation-history.js +1 -1
- 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/service-info.d.ts +2 -0
- package/node_modules/@noodle-borg/wire-contracts/dist/service-info.js +2 -0
- package/node_modules/@noodle-borg/wire-contracts/dist/sms.d.ts +176 -0
- package/node_modules/@noodle-borg/wire-contracts/dist/sms.js +41 -0
- package/node_modules/@noodle-borg/wire-contracts/dist/whatsapp.d.ts +10 -2
- package/node_modules/@noodle-borg/wire-contracts/dist/whatsapp.js +2 -1
- package/package.json +2 -2
- package/node_modules/@noodle-borg/agent-kit/dist/plan-execution-skill.d.ts +0 -10
- package/node_modules/@noodle-borg/agent-kit/dist/plan-execution-skill.js +0 -56
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import { recordChannelDelivery } from '@noodle-borg/assistant-gateway/portable';
|
|
2
|
+
import { readBodyBuffer, sendJson } from '@noodle-borg/transport-http';
|
|
3
|
+
import { TwilioSms } from '../channels/twilio-sms.js';
|
|
4
|
+
import { verifyTwilioSignature } from '../channels/twilio-webhook.js';
|
|
5
|
+
/** Per-binding routing selects only a credential candidate. Signature, account and number must all
|
|
6
|
+
* match before a callback may change durable state. The public URL comes from operator config. */
|
|
7
|
+
export async function smsWebhook(req, res, id, status, url, runtime) {
|
|
8
|
+
if (req.method !== 'POST')
|
|
9
|
+
return sendJson(res, 405, { error: 'method_not_allowed' });
|
|
10
|
+
if (url.search ||
|
|
11
|
+
req.headers['content-type']?.split(';')[0] !== 'application/x-www-form-urlencoded')
|
|
12
|
+
return sendJson(res, 400, { error: 'webhook_invalid' });
|
|
13
|
+
const binding = await runtime.channels.internal(id);
|
|
14
|
+
if (binding.channel !== 'sms')
|
|
15
|
+
return sendJson(res, 404, { error: 'not_found' });
|
|
16
|
+
const { adapter, webhookSecret } = await runtime.provider(binding);
|
|
17
|
+
const body = await readBodyBuffer(req, 65_536);
|
|
18
|
+
if (!body.ok)
|
|
19
|
+
return sendJson(res, 413, { error: 'webhook_invalid' });
|
|
20
|
+
const params = new URLSearchParams(body.buffer.toString('utf8'));
|
|
21
|
+
if ([...params.keys()].length > 100 ||
|
|
22
|
+
[...params.keys()].some((key) => params.getAll(key).length !== 1))
|
|
23
|
+
return sendJson(res, 400, { error: 'webhook_invalid' });
|
|
24
|
+
const callback = runtime.webhookUrl(req, binding) + (status ? '/status' : '');
|
|
25
|
+
if (!webhookSecret ||
|
|
26
|
+
!verifyTwilioSignature(callback, params, req.headers['x-twilio-signature'], webhookSecret))
|
|
27
|
+
return sendJson(res, 401, { error: 'unauthorized' });
|
|
28
|
+
if (params.get('AccountSid') !== binding.accountSid ||
|
|
29
|
+
params.get(status ? 'From' : 'To') !== binding.phoneNumber)
|
|
30
|
+
return sendJson(res, 400, { error: 'asset_mismatch' });
|
|
31
|
+
const sid = params.get('MessageSid');
|
|
32
|
+
if (!sid || !/^(SM|MM)[a-fA-F0-9]{32}$/.test(sid))
|
|
33
|
+
return sendJson(res, 400, { error: 'message_invalid' });
|
|
34
|
+
if (status) {
|
|
35
|
+
const state = params.get('MessageStatus');
|
|
36
|
+
const delivery = state === 'delivered'
|
|
37
|
+
? 'delivered'
|
|
38
|
+
: state === 'sent'
|
|
39
|
+
? 'sent'
|
|
40
|
+
: state === 'failed' || state === 'undelivered'
|
|
41
|
+
? 'failed'
|
|
42
|
+
: undefined;
|
|
43
|
+
if (delivery)
|
|
44
|
+
await recordChannelDelivery(runtime.channels.store, id, sid, delivery, runtime.channels.now());
|
|
45
|
+
}
|
|
46
|
+
else {
|
|
47
|
+
if (!(adapter instanceof TwilioSms))
|
|
48
|
+
return sendJson(res, 503, { error: 'provider_unavailable' });
|
|
49
|
+
const message = await adapter.receive(sid);
|
|
50
|
+
if (message.address.value !== params.get('From'))
|
|
51
|
+
return sendJson(res, 400, { error: 'asset_mismatch' });
|
|
52
|
+
const optOut = params.get('OptOutType');
|
|
53
|
+
const control = optOut === 'STOP'
|
|
54
|
+
? 'stop'
|
|
55
|
+
: optOut === 'START'
|
|
56
|
+
? 'start'
|
|
57
|
+
: optOut === 'HELP'
|
|
58
|
+
? 'help'
|
|
59
|
+
: message.control;
|
|
60
|
+
await runtime.channels.receive(id, [{ ...message, ...(control ? { control } : {}) }], await runtime.retention(binding));
|
|
61
|
+
}
|
|
62
|
+
res.writeHead(200, { 'content-type': 'text/xml; charset=utf-8' });
|
|
63
|
+
res.end('<Response/>');
|
|
64
|
+
runtime.options.worker.wake();
|
|
65
|
+
}
|
|
66
|
+
//# sourceMappingURL=sms-twilio.js.map
|
|
@@ -6,6 +6,7 @@ import { INSTAGRAM_META_CALLBACK_PATH } from '../channels/instagram-meta.js';
|
|
|
6
6
|
import { WHATSAPP_META_CALLBACK_PATH } from '../channels/meta-cloud.js';
|
|
7
7
|
import { authorizeTenantControl, developerGrantRouteAccess } from './control-plane.js';
|
|
8
8
|
import { instagramWebhook } from './instagram-meta.js';
|
|
9
|
+
import { smsWebhook } from './sms-twilio.js';
|
|
9
10
|
import { metaWebhook } from './whatsapp-meta.js';
|
|
10
11
|
const participant = /^p_[a-f0-9]{64}$/;
|
|
11
12
|
const eventId = /^e_[0-9_]+$/;
|
|
@@ -35,30 +36,33 @@ async function body(req, schema) {
|
|
|
35
36
|
}
|
|
36
37
|
export function dispatchWhatsAppRoutes(req, res, url, runtime, grants) {
|
|
37
38
|
const callback = /^\/v1\/channels\/whatsapp\/webhooks\/([a-z0-9-]+)$/.exec(url.pathname);
|
|
38
|
-
const operator = /^\/v1\/orgs\/([^/]+)\/apps\/([^/]+)\/envs\/([^/]+)\/channels\/(whatsapp|instagram)(?:\/(.*))?$/.exec(url.pathname);
|
|
39
|
+
const operator = /^\/v1\/orgs\/([^/]+)\/apps\/([^/]+)\/envs\/([^/]+)\/channels\/(whatsapp|instagram|sms)(?:\/(.*))?$/.exec(url.pathname);
|
|
40
|
+
const sms = /^\/v1\/channels\/sms\/webhooks\/([a-z0-9-]+)(\/status)?$/.exec(url.pathname);
|
|
39
41
|
const meta = url.pathname === WHATSAPP_META_CALLBACK_PATH;
|
|
40
42
|
const instagram = url.pathname === INSTAGRAM_META_CALLBACK_PATH;
|
|
41
|
-
if (!callback && !operator && !meta && !instagram)
|
|
43
|
+
if (!callback && !operator && !meta && !instagram && !sms)
|
|
42
44
|
return false;
|
|
43
45
|
res.setHeader('Cache-Control', 'no-store');
|
|
44
46
|
if (!runtime) {
|
|
45
47
|
sendJson(res, 503, {
|
|
46
|
-
error: '
|
|
47
|
-
code: '
|
|
48
|
+
error: 'Messaging is unavailable on this service',
|
|
49
|
+
code: 'channel_unavailable',
|
|
48
50
|
});
|
|
49
51
|
return true;
|
|
50
52
|
}
|
|
51
|
-
const run = Promise.resolve().then(() =>
|
|
52
|
-
?
|
|
53
|
-
:
|
|
54
|
-
?
|
|
55
|
-
:
|
|
56
|
-
?
|
|
57
|
-
:
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
53
|
+
const run = Promise.resolve().then(() => sms
|
|
54
|
+
? smsWebhook(req, res, sms[1], !!sms[2], url, runtime)
|
|
55
|
+
: meta
|
|
56
|
+
? metaWebhook(req, res, url, runtime)
|
|
57
|
+
: instagram
|
|
58
|
+
? instagramWebhook(req, res, url, runtime)
|
|
59
|
+
: callback
|
|
60
|
+
? webhook(req, res, callback[1], runtime)
|
|
61
|
+
: operate(req, res, url, {
|
|
62
|
+
org: decodeURIComponent(operator[1]),
|
|
63
|
+
app: decodeURIComponent(operator[2]),
|
|
64
|
+
env: decodeURIComponent(operator[3]),
|
|
65
|
+
}, operator[4], operator[5] ?? '', runtime, grants));
|
|
62
66
|
void run.catch((error) => {
|
|
63
67
|
const code = error instanceof ChannelError ? error.code : 'channel_unavailable';
|
|
64
68
|
const status = code === 'channel_not_found'
|
|
@@ -71,7 +75,7 @@ export function dispatchWhatsAppRoutes(req, res, url, runtime, grants) {
|
|
|
71
75
|
'deployment_changed',
|
|
72
76
|
].includes(code)
|
|
73
77
|
? 409
|
|
74
|
-
:
|
|
78
|
+
: ['channel_unavailable', 'ingress_capacity', 'provider_unavailable'].includes(code)
|
|
75
79
|
? 503
|
|
76
80
|
: 400;
|
|
77
81
|
if (!res.headersSent)
|
|
@@ -118,9 +122,11 @@ async function operate(req, res, url, tenant, channel, path, runtime, grants) {
|
|
|
118
122
|
const idempotency = typeof key === 'string' ? key : '';
|
|
119
123
|
const visible = await channels.get(tenant, channel);
|
|
120
124
|
// Every other operation's shape is channel-neutral; the binding and its configuration are not.
|
|
121
|
-
const bindingSchema = channel === '
|
|
122
|
-
? wire.
|
|
123
|
-
:
|
|
125
|
+
const bindingSchema = channel === 'sms'
|
|
126
|
+
? wire.SmsBindingResponseSchema
|
|
127
|
+
: channel === 'instagram'
|
|
128
|
+
? wire.InstagramBindingResponseSchema
|
|
129
|
+
: wire.WhatsAppBindingResponseSchema;
|
|
124
130
|
const audit = async (action) => deps.audit.emit({
|
|
125
131
|
eventType: `assistant.channel.${action}`,
|
|
126
132
|
...tenant,
|
|
@@ -136,7 +142,11 @@ async function operate(req, res, url, tenant, channel, path, runtime, grants) {
|
|
|
136
142
|
throw new ChannelError('deployment_missing');
|
|
137
143
|
const deploymentId = target.deploymentId;
|
|
138
144
|
let configured;
|
|
139
|
-
if (channel === '
|
|
145
|
+
if (channel === 'sms') {
|
|
146
|
+
const { expectedRevision, ...configuration } = await body(req, wire.SmsConfigureRequestSchema);
|
|
147
|
+
configured = await channels.configure({ ...configuration, channel, tenant, deploymentId }, identity.subject, idempotency, expectedRevision);
|
|
148
|
+
}
|
|
149
|
+
else if (channel === 'instagram') {
|
|
140
150
|
const { expectedRevision, ...configuration } = await body(req, wire.InstagramConfigureRequestSchema);
|
|
141
151
|
configured = await channels.configure({ ...configuration, channel, tenant, deploymentId }, identity.subject, idempotency, expectedRevision);
|
|
142
152
|
}
|
|
@@ -198,7 +208,7 @@ async function operate(req, res, url, tenant, channel, path, runtime, grants) {
|
|
|
198
208
|
const participantId = 'phone' in parsed && parsed.phone
|
|
199
209
|
? channelParticipantId(await channels.internal(id), {
|
|
200
210
|
kind: 'phone',
|
|
201
|
-
value: parsed.phone.slice(1),
|
|
211
|
+
value: channel === 'sms' ? parsed.phone : parsed.phone.slice(1),
|
|
202
212
|
})
|
|
203
213
|
: parsed.participantId;
|
|
204
214
|
await channels.block(id, participantId, identity.subject, idempotency, parsed.until);
|
|
@@ -200,7 +200,7 @@ export function createServiceHandler(registry, options = {}) {
|
|
|
200
200
|
logger,
|
|
201
201
|
conversationPolicy,
|
|
202
202
|
});
|
|
203
|
-
const whatsapp = createWhatsAppRuntime(options
|
|
203
|
+
const whatsapp = createWhatsAppRuntime(options, assistantDeps, {
|
|
204
204
|
allowance: moduleHost.resolveActivityHistoryAllowance,
|
|
205
205
|
installations: businessInformationStore,
|
|
206
206
|
activity,
|
|
@@ -357,7 +357,7 @@ export function createServiceHandler(registry, options = {}) {
|
|
|
357
357
|
})) {
|
|
358
358
|
return;
|
|
359
359
|
}
|
|
360
|
-
if (/\/channels\/(whatsapp|instagram)(\/|$)/.test(url.pathname)) {
|
|
360
|
+
if (/\/channels\/(whatsapp|instagram|sms)(\/|$)/.test(url.pathname)) {
|
|
361
361
|
applySecurityHeaders(res, tls);
|
|
362
362
|
if (enforceHttps(req, res, tls))
|
|
363
363
|
return;
|
|
@@ -41,7 +41,7 @@
|
|
|
41
41
|
"@noodle-borg/managed-capabilities": "0.0.0",
|
|
42
42
|
"@modelcontextprotocol/sdk": "^1.29.0",
|
|
43
43
|
"@noodle-borg/admission-limits": "0.0.0",
|
|
44
|
-
"@noodle-borg/agent-kit": "0.
|
|
44
|
+
"@noodle-borg/agent-kit": "0.113.0",
|
|
45
45
|
"@noodle-borg/app-package": "0.0.0",
|
|
46
46
|
"@noodle-borg/assistant-gateway": "0.0.0",
|
|
47
47
|
"@noodle-borg/auth": "0.0.0",
|
|
@@ -60,6 +60,17 @@ export declare const ApplicationChannelsProjectionSchema: z.ZodObject<{
|
|
|
60
60
|
capabilities: z.ZodArray<z.ZodString>;
|
|
61
61
|
reason: z.ZodOptional<z.ZodString>;
|
|
62
62
|
}, z.core.$strict>>;
|
|
63
|
+
sms: z.ZodOptional<z.ZodObject<{
|
|
64
|
+
status: z.ZodEnum<{
|
|
65
|
+
unavailable: "unavailable";
|
|
66
|
+
ready: "ready";
|
|
67
|
+
paused: "paused";
|
|
68
|
+
}>;
|
|
69
|
+
bindingId: z.ZodOptional<z.ZodString>;
|
|
70
|
+
revision: z.ZodOptional<z.ZodNumber>;
|
|
71
|
+
capabilities: z.ZodArray<z.ZodString>;
|
|
72
|
+
reason: z.ZodOptional<z.ZodString>;
|
|
73
|
+
}, z.core.$strict>>;
|
|
63
74
|
}, z.core.$strict>;
|
|
64
75
|
export type ApplicationChannelsProjection = z.infer<typeof ApplicationChannelsProjectionSchema>;
|
|
65
76
|
export declare const ApplicationChannelsResponseSchema: z.ZodObject<{
|
|
@@ -125,6 +136,17 @@ export declare const ApplicationChannelsResponseSchema: z.ZodObject<{
|
|
|
125
136
|
capabilities: z.ZodArray<z.ZodString>;
|
|
126
137
|
reason: z.ZodOptional<z.ZodString>;
|
|
127
138
|
}, z.core.$strict>>;
|
|
139
|
+
sms: z.ZodOptional<z.ZodObject<{
|
|
140
|
+
status: z.ZodEnum<{
|
|
141
|
+
unavailable: "unavailable";
|
|
142
|
+
ready: "ready";
|
|
143
|
+
paused: "paused";
|
|
144
|
+
}>;
|
|
145
|
+
bindingId: z.ZodOptional<z.ZodString>;
|
|
146
|
+
revision: z.ZodOptional<z.ZodNumber>;
|
|
147
|
+
capabilities: z.ZodArray<z.ZodString>;
|
|
148
|
+
reason: z.ZodOptional<z.ZodString>;
|
|
149
|
+
}, z.core.$strict>>;
|
|
128
150
|
}, z.core.$strict>;
|
|
129
151
|
}, z.core.$strict>;
|
|
130
152
|
export declare const ApplicationChannelsClientResponseSchema: z.ZodObject<{
|
|
@@ -166,6 +188,17 @@ export declare const ApplicationChannelsClientResponseSchema: z.ZodObject<{
|
|
|
166
188
|
capabilities: z.ZodArray<z.ZodString>;
|
|
167
189
|
reason: z.ZodOptional<z.ZodString>;
|
|
168
190
|
}, z.core.$strip>>;
|
|
191
|
+
sms: z.ZodOptional<z.ZodObject<{
|
|
192
|
+
status: z.ZodEnum<{
|
|
193
|
+
unavailable: "unavailable";
|
|
194
|
+
ready: "ready";
|
|
195
|
+
paused: "paused";
|
|
196
|
+
}>;
|
|
197
|
+
bindingId: z.ZodOptional<z.ZodString>;
|
|
198
|
+
revision: z.ZodOptional<z.ZodNumber>;
|
|
199
|
+
capabilities: z.ZodArray<z.ZodString>;
|
|
200
|
+
reason: z.ZodOptional<z.ZodString>;
|
|
201
|
+
}, z.core.$strip>>;
|
|
169
202
|
assistant: z.ZodObject<{
|
|
170
203
|
status: z.ZodEnum<{
|
|
171
204
|
unavailable: "unavailable";
|
|
@@ -39,7 +39,7 @@ const assistant = z
|
|
|
39
39
|
usage: usage.optional(),
|
|
40
40
|
})
|
|
41
41
|
.strict();
|
|
42
|
-
/** One messaging channel (WhatsApp, Instagram) of the application, without provider identifiers. */
|
|
42
|
+
/** One messaging channel (WhatsApp, Instagram, SMS) of the application, without provider identifiers. */
|
|
43
43
|
const messaging = z.strictObject({
|
|
44
44
|
status,
|
|
45
45
|
bindingId: z.string().max(256).optional(),
|
|
@@ -58,6 +58,7 @@ export const ApplicationChannelsProjectionSchema = z
|
|
|
58
58
|
assistant,
|
|
59
59
|
whatsapp: messaging.optional(),
|
|
60
60
|
instagram: messaging.optional(),
|
|
61
|
+
sms: messaging.optional(),
|
|
61
62
|
})
|
|
62
63
|
.strict();
|
|
63
64
|
export const ApplicationChannelsResponseSchema = z
|
|
@@ -70,6 +71,7 @@ export const ApplicationChannelsClientResponseSchema = z
|
|
|
70
71
|
mcp: mcp.strip(),
|
|
71
72
|
whatsapp: messaging.strip().optional(),
|
|
72
73
|
instagram: messaging.strip().optional(),
|
|
74
|
+
sms: messaging.strip().optional(),
|
|
73
75
|
assistant: assistant
|
|
74
76
|
.extend({
|
|
75
77
|
usage: usage
|
|
@@ -4,6 +4,7 @@ export declare const HistorySourcesSchema: z.ZodObject<{
|
|
|
4
4
|
signedInCustomers: z.ZodBoolean;
|
|
5
5
|
whatsapp: z.ZodBoolean;
|
|
6
6
|
instagram: z.ZodBoolean;
|
|
7
|
+
sms: z.ZodBoolean;
|
|
7
8
|
}, z.core.$strict>;
|
|
8
9
|
/** A surface the application declared `history: false` on, named by its authoring constructor. */
|
|
9
10
|
export declare const ApplicationHistoryDisabledSurfaceSchema: z.ZodEnum<{
|
|
@@ -30,6 +31,7 @@ export declare const ApplicationHistorySettingsSchema: z.ZodObject<{
|
|
|
30
31
|
signedInCustomers: z.ZodBoolean;
|
|
31
32
|
whatsapp: z.ZodBoolean;
|
|
32
33
|
instagram: z.ZodBoolean;
|
|
34
|
+
sms: z.ZodBoolean;
|
|
33
35
|
}, z.core.$strict>;
|
|
34
36
|
disabledByApplication: z.ZodOptional<z.ZodArray<z.ZodEnum<{
|
|
35
37
|
publicWebsite: "publicWebsite";
|
|
@@ -59,6 +61,7 @@ export declare const ApplicationHistorySettingsResponseSchema: z.ZodObject<{
|
|
|
59
61
|
signedInCustomers: z.ZodBoolean;
|
|
60
62
|
whatsapp: z.ZodBoolean;
|
|
61
63
|
instagram: z.ZodBoolean;
|
|
64
|
+
sms: z.ZodBoolean;
|
|
62
65
|
}, z.core.$strict>;
|
|
63
66
|
disabledByApplication: z.ZodOptional<z.ZodArray<z.ZodEnum<{
|
|
64
67
|
publicWebsite: "publicWebsite";
|
|
@@ -80,6 +83,7 @@ export declare const ApplicationHistorySettingsSaveRequestSchema: z.ZodObject<{
|
|
|
80
83
|
signedInCustomers: z.ZodOptional<z.ZodBoolean>;
|
|
81
84
|
whatsapp: z.ZodOptional<z.ZodBoolean>;
|
|
82
85
|
instagram: z.ZodOptional<z.ZodBoolean>;
|
|
86
|
+
sms: z.ZodOptional<z.ZodBoolean>;
|
|
83
87
|
}, z.core.$strict>>;
|
|
84
88
|
dryRun: z.ZodOptional<z.ZodBoolean>;
|
|
85
89
|
}, z.core.$strict>;
|
|
@@ -111,6 +115,7 @@ export declare const ApplicationHistorySettingsSaveResponseSchema: z.ZodObject<{
|
|
|
111
115
|
signedInCustomers: z.ZodBoolean;
|
|
112
116
|
whatsapp: z.ZodBoolean;
|
|
113
117
|
instagram: z.ZodBoolean;
|
|
118
|
+
sms: z.ZodBoolean;
|
|
114
119
|
}, z.core.$strict>;
|
|
115
120
|
disabledByApplication: z.ZodOptional<z.ZodArray<z.ZodEnum<{
|
|
116
121
|
publicWebsite: "publicWebsite";
|
|
@@ -131,6 +136,7 @@ export declare const ApplicationHistorySettingsClientResponseSchema: z.ZodObject
|
|
|
131
136
|
}, z.core.$strip>;
|
|
132
137
|
conversations: z.ZodObject<{
|
|
133
138
|
sources: z.ZodObject<{
|
|
139
|
+
sms: z.ZodOptional<z.ZodBoolean>;
|
|
134
140
|
websiteVisitors: z.ZodBoolean;
|
|
135
141
|
signedInCustomers: z.ZodBoolean;
|
|
136
142
|
whatsapp: z.ZodBoolean;
|
|
@@ -166,6 +172,7 @@ export declare const ApplicationHistorySettingsSaveClientResponseSchema: z.ZodOb
|
|
|
166
172
|
}, z.core.$strip>;
|
|
167
173
|
conversations: z.ZodObject<{
|
|
168
174
|
sources: z.ZodObject<{
|
|
175
|
+
sms: z.ZodOptional<z.ZodBoolean>;
|
|
169
176
|
websiteVisitors: z.ZodBoolean;
|
|
170
177
|
signedInCustomers: z.ZodBoolean;
|
|
171
178
|
whatsapp: z.ZodBoolean;
|
|
@@ -12,6 +12,7 @@ export const HistorySourcesSchema = z.strictObject({
|
|
|
12
12
|
signedInCustomers: z.boolean(),
|
|
13
13
|
whatsapp: z.boolean(),
|
|
14
14
|
instagram: z.boolean(),
|
|
15
|
+
sms: z.boolean(),
|
|
15
16
|
});
|
|
16
17
|
/** A surface the application declared `history: false` on, named by its authoring constructor. */
|
|
17
18
|
export const ApplicationHistoryDisabledSurfaceSchema = z.enum([
|
|
@@ -78,7 +79,7 @@ const ClientSettingsSchema = z.object({
|
|
|
78
79
|
activity: z.object(ApplicationHistorySettingsSchema.shape.activity.shape),
|
|
79
80
|
conversations: z.object({
|
|
80
81
|
...ApplicationHistorySettingsSchema.shape.conversations.shape,
|
|
81
|
-
sources: z.object(HistorySourcesSchema.shape),
|
|
82
|
+
sources: z.object({ ...HistorySourcesSchema.shape, sms: z.boolean().optional() }),
|
|
82
83
|
}),
|
|
83
84
|
});
|
|
84
85
|
export const ApplicationHistorySettingsClientResponseSchema = z.object({
|
|
@@ -7,6 +7,7 @@ export declare const ConversationIdSchema: z.ZodString;
|
|
|
7
7
|
export declare const ConversationChannelSchema: z.ZodEnum<{
|
|
8
8
|
whatsapp: "whatsapp";
|
|
9
9
|
instagram: "instagram";
|
|
10
|
+
sms: "sms";
|
|
10
11
|
website: "website";
|
|
11
12
|
}>;
|
|
12
13
|
/** Staff review state; a failed tool outcome sets `needs_attention` automatically. */
|
|
@@ -21,6 +22,7 @@ export declare const ConversationSummarySchema: z.ZodObject<{
|
|
|
21
22
|
channel: z.ZodEnum<{
|
|
22
23
|
whatsapp: "whatsapp";
|
|
23
24
|
instagram: "instagram";
|
|
25
|
+
sms: "sms";
|
|
24
26
|
website: "website";
|
|
25
27
|
}>;
|
|
26
28
|
subject: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
@@ -87,6 +89,7 @@ export declare const ConversationDetailSchema: z.ZodObject<{
|
|
|
87
89
|
channel: z.ZodEnum<{
|
|
88
90
|
whatsapp: "whatsapp";
|
|
89
91
|
instagram: "instagram";
|
|
92
|
+
sms: "sms";
|
|
90
93
|
website: "website";
|
|
91
94
|
}>;
|
|
92
95
|
subject: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
@@ -145,6 +148,7 @@ export declare const ConversationShowSchema: z.ZodObject<{
|
|
|
145
148
|
channel: z.ZodEnum<{
|
|
146
149
|
whatsapp: "whatsapp";
|
|
147
150
|
instagram: "instagram";
|
|
151
|
+
sms: "sms";
|
|
148
152
|
website: "website";
|
|
149
153
|
}>;
|
|
150
154
|
subject: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
@@ -173,6 +177,7 @@ export declare const ConversationListResponseSchema: z.ZodObject<{
|
|
|
173
177
|
channel: z.ZodEnum<{
|
|
174
178
|
whatsapp: "whatsapp";
|
|
175
179
|
instagram: "instagram";
|
|
180
|
+
sms: "sms";
|
|
176
181
|
website: "website";
|
|
177
182
|
}>;
|
|
178
183
|
subject: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
@@ -234,6 +239,7 @@ export declare const ConversationShowResponseSchema: z.ZodObject<{
|
|
|
234
239
|
channel: z.ZodEnum<{
|
|
235
240
|
whatsapp: "whatsapp";
|
|
236
241
|
instagram: "instagram";
|
|
242
|
+
sms: "sms";
|
|
237
243
|
website: "website";
|
|
238
244
|
}>;
|
|
239
245
|
subject: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
@@ -295,6 +301,7 @@ export declare const ConversationExportResponseSchema: z.ZodObject<{
|
|
|
295
301
|
channel: z.ZodEnum<{
|
|
296
302
|
whatsapp: "whatsapp";
|
|
297
303
|
instagram: "instagram";
|
|
304
|
+
sms: "sms";
|
|
298
305
|
website: "website";
|
|
299
306
|
}>;
|
|
300
307
|
subject: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
@@ -356,6 +363,7 @@ export declare const ConversationListClientResponseSchema: z.ZodObject<{
|
|
|
356
363
|
channel: z.ZodEnum<{
|
|
357
364
|
whatsapp: "whatsapp";
|
|
358
365
|
instagram: "instagram";
|
|
366
|
+
sms: "sms";
|
|
359
367
|
website: "website";
|
|
360
368
|
}>;
|
|
361
369
|
startedAt: z.ZodISODateTime;
|
|
@@ -416,6 +424,7 @@ export declare const ConversationShowClientResponseSchema: z.ZodObject<{
|
|
|
416
424
|
channel: z.ZodEnum<{
|
|
417
425
|
whatsapp: "whatsapp";
|
|
418
426
|
instagram: "instagram";
|
|
427
|
+
sms: "sms";
|
|
419
428
|
website: "website";
|
|
420
429
|
}>;
|
|
421
430
|
startedAt: z.ZodISODateTime;
|
|
@@ -467,6 +476,7 @@ export declare const ConversationExportClientResponseSchema: z.ZodObject<{
|
|
|
467
476
|
channel: z.ZodEnum<{
|
|
468
477
|
whatsapp: "whatsapp";
|
|
469
478
|
instagram: "instagram";
|
|
479
|
+
sms: "sms";
|
|
470
480
|
website: "website";
|
|
471
481
|
}>;
|
|
472
482
|
startedAt: z.ZodISODateTime;
|
|
@@ -512,6 +522,7 @@ export declare const AssistantConversationListResponseSchema: z.ZodObject<{
|
|
|
512
522
|
channel: z.ZodEnum<{
|
|
513
523
|
whatsapp: "whatsapp";
|
|
514
524
|
instagram: "instagram";
|
|
525
|
+
sms: "sms";
|
|
515
526
|
website: "website";
|
|
516
527
|
}>;
|
|
517
528
|
startedAt: z.ZodISODateTime;
|
|
@@ -529,6 +540,7 @@ export declare const AssistantConversationListClientResponseSchema: z.ZodObject<
|
|
|
529
540
|
channel: z.ZodEnum<{
|
|
530
541
|
whatsapp: "whatsapp";
|
|
531
542
|
instagram: "instagram";
|
|
543
|
+
sms: "sms";
|
|
532
544
|
website: "website";
|
|
533
545
|
}>;
|
|
534
546
|
startedAt: z.ZodISODateTime;
|
|
@@ -4,7 +4,7 @@ import { z } from 'zod';
|
|
|
4
4
|
* `*ClientResponseSchema` variants let older clients ignore additive fields.
|
|
5
5
|
*/
|
|
6
6
|
export const ConversationIdSchema = z.string().regex(/^cv_[A-Za-z0-9_-]{8,64}$/);
|
|
7
|
-
export const ConversationChannelSchema = z.enum(['website', 'whatsapp', 'instagram']);
|
|
7
|
+
export const ConversationChannelSchema = z.enum(['website', 'whatsapp', 'instagram', 'sms']);
|
|
8
8
|
/** Staff review state; a failed tool outcome sets `needs_attention` automatically. */
|
|
9
9
|
export const ConversationReviewStatusSchema = z.enum(['new', 'needs_attention', 'reviewed']);
|
|
10
10
|
const SubjectRefSchema = z.string().min(1).max(256);
|
|
@@ -401,5 +401,6 @@ export * from './instagram.js';
|
|
|
401
401
|
export * from './native-record-lifecycle.js';
|
|
402
402
|
export * from './operation-coordination.js';
|
|
403
403
|
export { MIXED_CUSTOMER_AUTH_FEATURE_VERSION, type ServiceInfoClientResponse, type ServiceInfoResponse, serviceInfoClientResponseSchema, serviceInfoResponseSchema, } from './service-info.js';
|
|
404
|
+
export * from './sms.js';
|
|
404
405
|
export * from './whatsapp.js';
|
|
405
406
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -240,5 +240,6 @@ export * from './instagram.js';
|
|
|
240
240
|
export * from './native-record-lifecycle.js';
|
|
241
241
|
export * from './operation-coordination.js';
|
|
242
242
|
export { MIXED_CUSTOMER_AUTH_FEATURE_VERSION, serviceInfoClientResponseSchema, serviceInfoResponseSchema, } from './service-info.js';
|
|
243
|
+
export * from './sms.js';
|
|
243
244
|
export * from './whatsapp.js';
|
|
244
245
|
//# sourceMappingURL=index.js.map
|
|
@@ -9,6 +9,7 @@ export declare const serviceInfoResponseSchema: z.ZodObject<{
|
|
|
9
9
|
mixedCustomerAuth: z.ZodLiteral<1>;
|
|
10
10
|
whatsapp: z.ZodOptional<z.ZodLiteral<1>>;
|
|
11
11
|
instagram: z.ZodOptional<z.ZodLiteral<1>>;
|
|
12
|
+
sms: z.ZodOptional<z.ZodLiteral<1>>;
|
|
12
13
|
}, z.core.$strict>;
|
|
13
14
|
ok: z.ZodLiteral<true>;
|
|
14
15
|
status: z.ZodLiteral<"ok">;
|
|
@@ -29,6 +30,7 @@ export declare const serviceInfoClientResponseSchema: z.ZodObject<{
|
|
|
29
30
|
mixedCustomerAuth: z.ZodOptional<z.ZodNumber>;
|
|
30
31
|
whatsapp: z.ZodOptional<z.ZodNumber>;
|
|
31
32
|
instagram: z.ZodOptional<z.ZodNumber>;
|
|
33
|
+
sms: z.ZodOptional<z.ZodNumber>;
|
|
32
34
|
}, z.core.$strip>>;
|
|
33
35
|
ok: z.ZodLiteral<true>;
|
|
34
36
|
status: z.ZodLiteral<"ok">;
|
|
@@ -20,6 +20,7 @@ export const serviceInfoResponseSchema = z.strictObject({
|
|
|
20
20
|
whatsapp: z.literal(1).optional(),
|
|
21
21
|
/** Instagram DMs need the channel runtime and Noodle Seed's Meta app. */
|
|
22
22
|
instagram: z.literal(1).optional(),
|
|
23
|
+
sms: z.literal(1).optional(),
|
|
23
24
|
}),
|
|
24
25
|
});
|
|
25
26
|
/** Older services may omit features; future fields are stripped at each structured metadata layer. */
|
|
@@ -31,6 +32,7 @@ export const serviceInfoClientResponseSchema = z.object({
|
|
|
31
32
|
mixedCustomerAuth: z.number().int().positive().optional(),
|
|
32
33
|
whatsapp: z.number().int().positive().optional(),
|
|
33
34
|
instagram: z.number().int().positive().optional(),
|
|
35
|
+
sms: z.number().int().positive().optional(),
|
|
34
36
|
})
|
|
35
37
|
.optional(),
|
|
36
38
|
});
|