@noodleseed/one 0.185.0 → 0.186.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.
@@ -3,7 +3,7 @@ const ACCOUNT_SELF_SERVICE = {
3
3
  status: 'unavailable',
4
4
  code: 'IDENTITY_NOT_ESTABLISHABLE',
5
5
  requirement: 'verified_customer',
6
- next: 'Account questions are answered as limitations until WhatsApp identity linking ships.',
6
+ next: 'Account questions are answered as limitations until messaging identity linking ships.',
7
7
  };
8
8
  export async function capabilityReport(input) {
9
9
  const { artifact } = input;
@@ -36,11 +36,11 @@ export function createWhatsAppRuntime(options, deps, history) {
36
36
  : {}),
37
37
  }, deps);
38
38
  }
39
- /** What business routes may do with WhatsApp: read its projection and erase a participant's memory. */
39
+ /** What business routes may do with messaging channels: read each one's projection and erase a participant's memory. */
40
40
  export function whatsappBusinessRoutes(whatsapp) {
41
41
  return whatsapp
42
42
  ? {
43
- readWhatsApp: whatsapp.projection.bind(whatsapp),
43
+ readMessaging: whatsapp.projection.bind(whatsapp),
44
44
  forgetWhatsApp: whatsapp.forgetParticipant.bind(whatsapp),
45
45
  }
46
46
  : {};
@@ -172,13 +172,13 @@ export class WhatsAppRuntime {
172
172
  throw new ChannelError('pause_before_webhook_change');
173
173
  await (await this.provider(binding)).adapter.configureWebhook(this.webhookUrl(req, binding));
174
174
  }
175
- async projection(tenant) {
176
- const binding = await this.channels.get(tenant, 'whatsapp');
175
+ async projection(tenant, channel) {
176
+ const binding = await this.channels.get(tenant, channel);
177
177
  if (!binding)
178
178
  return {
179
179
  status: 'unavailable',
180
180
  capabilities: [],
181
- reason: 'WhatsApp is not configured.',
181
+ reason: `${channel === 'instagram' ? 'Instagram' : 'WhatsApp'} is not configured.`,
182
182
  };
183
183
  const view = {
184
184
  bindingId: binding.id,
@@ -59,7 +59,12 @@ export async function projectBusinessChannels(installation, canEdit, base, deps)
59
59
  };
60
60
  const registered = await deps.registry.getActiveByTenant(tenant);
61
61
  const target = registered && (await resolveTargetOrigins(registered));
62
- const whatsapp = await deps.readWhatsApp?.(tenant);
62
+ const [whatsapp, instagram] = await Promise.all([
63
+ deps.readMessaging?.(tenant, 'whatsapp'),
64
+ deps.readMessaging?.(tenant, 'instagram'),
65
+ ]);
66
+ // Pausing agent channels pauses every messaging channel with them.
67
+ const intake = (view) => installation.intakeActive ? view : { ...view, status: 'paused' };
63
68
  const shared = {
64
69
  revision: installation.revision,
65
70
  active: installation.intakeActive,
@@ -67,14 +72,8 @@ export async function projectBusinessChannels(installation, canEdit, base, deps)
67
72
  ...(deps.pageOrigin
68
73
  ? { businessPageUrl: `${deps.pageOrigin}/b/${installation.publicId}` }
69
74
  : {}),
70
- ...(whatsapp
71
- ? {
72
- whatsapp: {
73
- ...whatsapp,
74
- ...(!installation.intakeActive ? { status: 'paused' } : {}),
75
- },
76
- }
77
- : {}),
75
+ ...(whatsapp ? { whatsapp: intake(whatsapp) } : {}),
76
+ ...(instagram ? { instagram: intake(instagram) } : {}),
78
77
  };
79
78
  if (!target?.deploymentId)
80
79
  return {
@@ -49,6 +49,17 @@ export declare const ApplicationChannelsProjectionSchema: z.ZodObject<{
49
49
  capabilities: z.ZodArray<z.ZodString>;
50
50
  reason: z.ZodOptional<z.ZodString>;
51
51
  }, z.core.$strict>>;
52
+ instagram: z.ZodOptional<z.ZodObject<{
53
+ status: z.ZodEnum<{
54
+ unavailable: "unavailable";
55
+ ready: "ready";
56
+ paused: "paused";
57
+ }>;
58
+ bindingId: z.ZodOptional<z.ZodString>;
59
+ revision: z.ZodOptional<z.ZodNumber>;
60
+ capabilities: z.ZodArray<z.ZodString>;
61
+ reason: z.ZodOptional<z.ZodString>;
62
+ }, z.core.$strict>>;
52
63
  }, z.core.$strict>;
53
64
  export type ApplicationChannelsProjection = z.infer<typeof ApplicationChannelsProjectionSchema>;
54
65
  export declare const ApplicationChannelsResponseSchema: z.ZodObject<{
@@ -103,6 +114,17 @@ export declare const ApplicationChannelsResponseSchema: z.ZodObject<{
103
114
  capabilities: z.ZodArray<z.ZodString>;
104
115
  reason: z.ZodOptional<z.ZodString>;
105
116
  }, z.core.$strict>>;
117
+ instagram: z.ZodOptional<z.ZodObject<{
118
+ status: z.ZodEnum<{
119
+ unavailable: "unavailable";
120
+ ready: "ready";
121
+ paused: "paused";
122
+ }>;
123
+ bindingId: z.ZodOptional<z.ZodString>;
124
+ revision: z.ZodOptional<z.ZodNumber>;
125
+ capabilities: z.ZodArray<z.ZodString>;
126
+ reason: z.ZodOptional<z.ZodString>;
127
+ }, z.core.$strict>>;
106
128
  }, z.core.$strict>;
107
129
  }, z.core.$strict>;
108
130
  export declare const ApplicationChannelsClientResponseSchema: z.ZodObject<{
@@ -133,6 +155,17 @@ export declare const ApplicationChannelsClientResponseSchema: z.ZodObject<{
133
155
  capabilities: z.ZodArray<z.ZodString>;
134
156
  reason: z.ZodOptional<z.ZodString>;
135
157
  }, z.core.$strip>>;
158
+ instagram: z.ZodOptional<z.ZodObject<{
159
+ status: z.ZodEnum<{
160
+ unavailable: "unavailable";
161
+ ready: "ready";
162
+ paused: "paused";
163
+ }>;
164
+ bindingId: z.ZodOptional<z.ZodString>;
165
+ revision: z.ZodOptional<z.ZodNumber>;
166
+ capabilities: z.ZodArray<z.ZodString>;
167
+ reason: z.ZodOptional<z.ZodString>;
168
+ }, z.core.$strip>>;
136
169
  assistant: z.ZodObject<{
137
170
  status: z.ZodEnum<{
138
171
  unavailable: "unavailable";
@@ -39,7 +39,8 @@ const assistant = z
39
39
  usage: usage.optional(),
40
40
  })
41
41
  .strict();
42
- const whatsapp = z.strictObject({
42
+ /** One messaging channel (WhatsApp, Instagram) of the application, without provider identifiers. */
43
+ const messaging = z.strictObject({
43
44
  status,
44
45
  bindingId: z.string().max(256).optional(),
45
46
  revision: z.number().int().positive().optional(),
@@ -55,7 +56,8 @@ export const ApplicationChannelsProjectionSchema = z
55
56
  deploymentId: z.string().min(1).max(256).optional(),
56
57
  mcp,
57
58
  assistant,
58
- whatsapp: whatsapp.optional(),
59
+ whatsapp: messaging.optional(),
60
+ instagram: messaging.optional(),
59
61
  })
60
62
  .strict();
61
63
  export const ApplicationChannelsResponseSchema = z
@@ -66,7 +68,8 @@ export const ApplicationChannelsClientResponseSchema = z
66
68
  ok: z.literal(true),
67
69
  data: ApplicationChannelsProjectionSchema.extend({
68
70
  mcp: mcp.strip(),
69
- whatsapp: whatsapp.strip().optional(),
71
+ whatsapp: messaging.strip().optional(),
72
+ instagram: messaging.strip().optional(),
70
73
  assistant: assistant
71
74
  .extend({
72
75
  usage: usage
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@noodleseed/one",
3
- "version": "0.185.0",
3
+ "version": "0.186.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",