@opencx/mcp 1.15.16 → 1.15.22

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.
Files changed (65) hide show
  1. package/dist/campaign-tools.spec.d.ts +2 -0
  2. package/dist/campaign-tools.spec.d.ts.map +1 -0
  3. package/dist/campaign-tools.spec.js +508 -0
  4. package/dist/campaign-tools.spec.js.map +1 -0
  5. package/dist/phone-caller-number-tool.spec.d.ts +2 -0
  6. package/dist/phone-caller-number-tool.spec.d.ts.map +1 -0
  7. package/dist/phone-caller-number-tool.spec.js +97 -0
  8. package/dist/phone-caller-number-tool.spec.js.map +1 -0
  9. package/dist/schema.d.ts +10802 -7640
  10. package/dist/schema.d.ts.map +1 -1
  11. package/dist/server.d.ts.map +1 -1
  12. package/dist/server.js +12 -2
  13. package/dist/server.js.map +1 -1
  14. package/dist/slack-tools.spec.d.ts +2 -0
  15. package/dist/slack-tools.spec.d.ts.map +1 -0
  16. package/dist/slack-tools.spec.js +148 -0
  17. package/dist/slack-tools.spec.js.map +1 -0
  18. package/dist/tools/campaign-channel.d.ts +4 -0
  19. package/dist/tools/campaign-channel.d.ts.map +1 -0
  20. package/dist/tools/campaign-channel.js +250 -0
  21. package/dist/tools/campaign-channel.js.map +1 -0
  22. package/dist/tools/campaign-discovery.d.ts +4 -0
  23. package/dist/tools/campaign-discovery.d.ts.map +1 -0
  24. package/dist/tools/campaign-discovery.js +70 -0
  25. package/dist/tools/campaign-discovery.js.map +1 -0
  26. package/dist/tools/campaign-qualification.d.ts +4 -0
  27. package/dist/tools/campaign-qualification.d.ts.map +1 -0
  28. package/dist/tools/campaign-qualification.js +289 -0
  29. package/dist/tools/campaign-qualification.js.map +1 -0
  30. package/dist/tools/campaign-spine.d.ts +4 -0
  31. package/dist/tools/campaign-spine.d.ts.map +1 -0
  32. package/dist/tools/campaign-spine.js +630 -0
  33. package/dist/tools/campaign-spine.js.map +1 -0
  34. package/dist/tools/macros.js +1 -1
  35. package/dist/tools/macros.js.map +1 -1
  36. package/dist/tools/media.js +1 -1
  37. package/dist/tools/media.js.map +1 -1
  38. package/dist/tools/phone.d.ts.map +1 -1
  39. package/dist/tools/phone.js +54 -2
  40. package/dist/tools/phone.js.map +1 -1
  41. package/dist/tools/reports.d.ts.map +1 -1
  42. package/dist/tools/reports.js +1 -0
  43. package/dist/tools/reports.js.map +1 -1
  44. package/dist/tools/sessions.js +1 -1
  45. package/dist/tools/sessions.js.map +1 -1
  46. package/dist/tools/sla.d.ts.map +1 -1
  47. package/dist/tools/sla.js +3 -3
  48. package/dist/tools/sla.js.map +1 -1
  49. package/dist/tools/slack.d.ts +4 -0
  50. package/dist/tools/slack.d.ts.map +1 -0
  51. package/dist/tools/slack.js +76 -0
  52. package/dist/tools/slack.js.map +1 -0
  53. package/dist/tools/structured-fields.d.ts +4 -0
  54. package/dist/tools/structured-fields.d.ts.map +1 -0
  55. package/dist/tools/structured-fields.js +107 -0
  56. package/dist/tools/structured-fields.js.map +1 -0
  57. package/dist/utils/session-channel.d.ts +2 -2
  58. package/dist/utils/session-channel.d.ts.map +1 -1
  59. package/dist/utils/session-channel.js +1 -0
  60. package/dist/utils/session-channel.js.map +1 -1
  61. package/package.json +1 -1
  62. package/dist/tools/sequences.d.ts +0 -4
  63. package/dist/tools/sequences.d.ts.map +0 -1
  64. package/dist/tools/sequences.js +0 -182
  65. package/dist/tools/sequences.js.map +0 -1
@@ -0,0 +1,630 @@
1
+ import { z } from 'zod';
2
+ import { ApiError, jsonContent } from '../api-client.js';
3
+ // The sequence spine: create → enroll → launch, plus the lifecycle around it.
4
+ //
5
+ // These had NO tools until now, only HTTP endpoints, and the skill told the
6
+ // agent to reach them with curl. The cost was visible in a real session: six
7
+ // consecutive ToolSearch queries hunting for `create_campaign` (one returning
8
+ // "No matching deferred tools found", the rest offering `create_office_hours`
9
+ // and the LEGACY `create_sequence`), then a hand-built curl, then a guessed
10
+ // `POST /sequences/{id}/recipients` that 404'd before it found `/enroll`.
11
+ //
12
+ // An operation with no tool isn't unavailable — it's available badly. The agent
13
+ // improvises a URL, and the only feedback it gets is a 404.
14
+ //
15
+ // Enrolment is the ONE place a Bash fallback still earns its keep, for bulk
16
+ // people who are not already in the agent's context (a CSV on disk, an Apollo
17
+ // or LinkedIn pull). See the tool description and the skill.
18
+ const sequenceId = z.string().describe('The sequence id');
19
+ // ── Step shapes (mirror the API's campaignStepSchema exactly — bounds
20
+ // included, so nothing these tools accept can then 400 on the wire) ─────────
21
+ const stepVariableBinding = z.object({
22
+ source: z
23
+ .enum(['display_name', 'phone', 'email'])
24
+ .describe('Which person column fills this variable.'),
25
+ fallback: z
26
+ .string()
27
+ .optional()
28
+ .describe('Used when the source column is empty. No fallback + no value = the person parks ' +
29
+ '(needs_data) — generic filler is never sent.'),
30
+ });
31
+ const whatsappStepContent = z.object({
32
+ type: z.literal('whatsapp_template'),
33
+ template_name: z.string().min(1).describe('A template from list_whatsapp_templates.'),
34
+ template_language: z.string().min(1),
35
+ variables: z
36
+ .record(z.string(), stepVariableBinding)
37
+ .describe('Keyed by Meta\'s positional variable index ("1", "2", …).'),
38
+ });
39
+ const voiceStepContent = z.object({
40
+ type: z.literal('voice_call'),
41
+ extra_instructions: z
42
+ .string()
43
+ .min(1)
44
+ .max(8_000)
45
+ .optional()
46
+ .describe('The CALL BRIEF: why we are calling THIS person. Named {{token}}s resolve via ' +
47
+ '`variables`. The agent bound as sender carries the persona — the brief never ' +
48
+ 'overrides it. Optional: an agent whose persona carries the whole mission needs no ' +
49
+ 'step text.'),
50
+ variables: z
51
+ .record(z.string().min(1).max(64), stepVariableBinding)
52
+ .optional()
53
+ .describe('Keyed by token name ({{first_name}} → "first_name").'),
54
+ });
55
+ const emailStepContent = z
56
+ .object({
57
+ type: z.literal('email'),
58
+ subject: z.string().min(1).describe('Rendered per person; named {{token}}s allowed.'),
59
+ html: z.string().min(1).describe('The HTML body.'),
60
+ text: z
61
+ .string()
62
+ .min(1)
63
+ .describe('Plain-text alternative — REQUIRED, a real rendition of the message: HTML-only ' +
64
+ 'mail is a spam signal and renders blank in text clients.'),
65
+ variables: z
66
+ .record(z.string(), stepVariableBinding)
67
+ .default({})
68
+ .describe('Keyed by token name ({{first_name}} → "first_name"). Every token used anywhere in ' +
69
+ 'subject/html/text needs an entry — except {{signature}}, filled from the sending ' +
70
+ "mailbox's identity."),
71
+ })
72
+ // Mirror of the API's unbound-placeholder refusal (the guard against
73
+ // shipping `Hi {{firstname}},` to a whole list) — here so the agent reads
74
+ // the unbound names at the tool boundary instead of a wire 400.
75
+ .superRefine((content, ctx) => {
76
+ const used = new Set();
77
+ for (const body of [content.subject, content.html, content.text]) {
78
+ for (const match of body.matchAll(/\{\{\s*([\w.-]+)\s*\}\}/g)) {
79
+ if (match[1])
80
+ used.add(match[1]);
81
+ }
82
+ }
83
+ used.delete('signature');
84
+ const unbound = [...used].filter((name) => !Object.hasOwn(content.variables, name));
85
+ if (unbound.length > 0) {
86
+ ctx.addIssue({
87
+ code: z.ZodIssueCode.custom,
88
+ message: `unbound placeholders: ${unbound.join(', ')}`,
89
+ path: ['variables'],
90
+ });
91
+ }
92
+ });
93
+ const campaignStep = z.discriminatedUnion('channel', [
94
+ z.object({
95
+ channel: z.literal('whatsapp'),
96
+ content: whatsappStepContent,
97
+ delay_minutes: z.number().int().min(0).max(129_600),
98
+ }),
99
+ z.object({
100
+ channel: z.literal('voice'),
101
+ content: voiceStepContent,
102
+ delay_minutes: z.number().int().min(0).max(129_600),
103
+ }),
104
+ z.object({
105
+ channel: z.literal('email'),
106
+ content: emailStepContent,
107
+ delay_minutes: z.number().int().min(0).max(129_600),
108
+ }),
109
+ ]);
110
+ const stepEdit = z.discriminatedUnion('op', [
111
+ z.object({
112
+ op: z.literal('update'),
113
+ step_index: z.number().int().min(0),
114
+ content: z
115
+ .union([whatsappStepContent, voiceStepContent, emailStepContent])
116
+ .optional()
117
+ .describe('New content. Must keep the step on its current channel.'),
118
+ delay_minutes: z.number().int().min(0).max(129_600).optional(),
119
+ }),
120
+ z.object({
121
+ op: z.literal('append'),
122
+ steps: z.array(campaignStep).min(1).max(20).describe('Steps added at the END, in order.'),
123
+ }),
124
+ z.object({ op: z.literal('remove'), step_index: z.number().int().min(0) }),
125
+ ]);
126
+ /** The DTO's array-level rules, mirrored here so nothing this tool accepts
127
+ * can then 400 on the wire (this package is on zod 3, where a refined object
128
+ * can't sit inside a discriminatedUnion — so both rules ride the array). */
129
+ const stepEdits = z
130
+ .array(stepEdit)
131
+ .min(1)
132
+ .max(50)
133
+ .refine((edits) => edits.every((edit) => edit.op !== 'update' || edit.content !== undefined || edit.delay_minutes !== undefined), { message: 'an update edit must change content, delay_minutes, or both' })
134
+ .refine((edits) => {
135
+ const removeIndices = edits.flatMap((e) => (e.op === 'remove' ? [e.step_index] : []));
136
+ return new Set(removeIndices).size === removeIndices.length;
137
+ }, {
138
+ message: 'two remove edits name the same step_index — each step can be removed once per batch',
139
+ });
140
+ /** Every tool here funnels API errors back as data. A thrown error reads to the
141
+ * agent as "the tool is broken" and invites a curl retry — which is exactly the
142
+ * behaviour these tools exist to remove. A 403/404 returned as JSON is
143
+ * something it can explain to the user instead. */
144
+ function handle(e) {
145
+ if (e instanceof ApiError)
146
+ return jsonContent({ ok: false, status: e.status, error: e.body });
147
+ throw e;
148
+ }
149
+ export function registerCampaignSpineTools(server, client) {
150
+ server.registerTool('create_sequence', {
151
+ description: 'Create an outbound sequence (draft). Creating it opens the sequence beside the chat, ' +
152
+ 'live, so the user watches it fill in. ' +
153
+ 'Steps are authored LATER, with set_sequence_steps — create the shell, add and ' +
154
+ 'qualify a real audience first, then write messages against people who exist.',
155
+ inputSchema: {
156
+ name: z
157
+ .string()
158
+ .describe('How the user will refer to it, e.g. "Win back quiet merchants".'),
159
+ brief: z
160
+ .string()
161
+ .optional()
162
+ .describe('What this is about and who it targets, in plain sentences. The judge reads it, the reply handler reads it, and the user reads it at the top of the People stage — write it for a colleague, not as a prompt.'),
163
+ criteria: z
164
+ .object({
165
+ // `label` is the short name the dashboard shows; `text` is the long
166
+ // instruction the judge reads. See judge_people for why they split.
167
+ // Bounds mirror the API exactly, so nothing this tool accepts can
168
+ // then 400 on the wire.
169
+ must: z.array(z.object({
170
+ label: z.string().min(2).max(60),
171
+ text: z.string().min(3).max(500),
172
+ })),
173
+ nice: z.array(z.object({
174
+ label: z.string().min(2).max(60),
175
+ text: z.string().min(3).max(500),
176
+ grade: z.enum(['high', 'medium', 'low']),
177
+ })),
178
+ })
179
+ .optional()
180
+ .describe('Can come later — judge_people also accepts and saves them.'),
181
+ reply_instructions: z
182
+ .string()
183
+ .optional()
184
+ .describe('How to handle replies to this sequence.'),
185
+ },
186
+ }, async (params) => {
187
+ try {
188
+ const { data } = await client.POST('/sequences', {
189
+ body: {
190
+ name: params.name,
191
+ ...(params.brief !== undefined ? { brief: params.brief } : {}),
192
+ ...(params.criteria !== undefined ? { criteria: params.criteria } : {}),
193
+ ...(params.reply_instructions !== undefined
194
+ ? { reply_instructions: params.reply_instructions }
195
+ : {}),
196
+ },
197
+ });
198
+ return jsonContent(data);
199
+ }
200
+ catch (e) {
201
+ return handle(e);
202
+ }
203
+ });
204
+ server.registerTool('list_sequences', {
205
+ description: 'Every outbound sequence in the org with its status and headline stats (people, ' +
206
+ 'will_send, might_send, sent, replied, and `busy` when a qualification run is in ' +
207
+ 'flight). The audience a launch reaches is will_send + might_send — never-judged ' +
208
+ 'people arm too. Use to find the one the user means before acting on it.',
209
+ inputSchema: {},
210
+ }, async () => {
211
+ try {
212
+ const { data } = await client.GET('/sequences', {});
213
+ return jsonContent(data);
214
+ }
215
+ catch (e) {
216
+ return handle(e);
217
+ }
218
+ });
219
+ server.registerTool('get_sequence', {
220
+ description: 'One sequence in full: status, brief, criteria, steps (with their waits), settings and ' +
221
+ 'the People-table columns. Read it before changing anything you did not just write.',
222
+ inputSchema: { sequence_id: sequenceId },
223
+ }, async (params) => {
224
+ try {
225
+ const { data } = await client.GET('/sequences/{sequenceId}', {
226
+ params: { path: { sequenceId: params.sequence_id } },
227
+ });
228
+ return jsonContent(data);
229
+ }
230
+ catch (e) {
231
+ return handle(e);
232
+ }
233
+ });
234
+ server.registerTool('set_sequence_steps', {
235
+ description: 'Write the step list of a DRAFT sequence (full replace). The authoring order is ' +
236
+ 'enroll-first: create the shell, enroll and qualify the audience, THEN author steps. ' +
237
+ 'Steps run in order; each step is one message (WhatsApp or email) or one placed call. ' +
238
+ 'delay_minutes is the ' +
239
+ 'wait after the PREVIOUS step actually sent — step 0 must be 0. For voice: the engine ' +
240
+ 'never auto-retries a no-answer, so reaching people means authoring retry steps ' +
241
+ '(attempt 2, attempt 3) with waits; an ANSWERED call ends the journey. For email: the ' +
242
+ 'copy is inline (subject/html/text, all three required) and every {{token}} needs a ' +
243
+ 'variables binding — {{signature}} exempt, the mailbox fills it. On a launched ' +
244
+ 'sequence this refuses — use edit_sequence_steps there.',
245
+ inputSchema: {
246
+ sequence_id: sequenceId,
247
+ steps: z.array(campaignStep).describe('The full step list, replacing what is stored.'),
248
+ },
249
+ }, async (params) => {
250
+ try {
251
+ const { data } = await client.PUT('/sequences/{sequenceId}/steps', {
252
+ params: { path: { sequenceId: params.sequence_id } },
253
+ body: { steps: params.steps },
254
+ });
255
+ return jsonContent(data);
256
+ }
257
+ catch (e) {
258
+ return handle(e);
259
+ }
260
+ });
261
+ server.registerTool('edit_sequence_steps', {
262
+ description: 'Surgically edit the steps of a sequence in ANY status — the live-edit tool. One ' +
263
+ 'transactional batch: any illegal edit rejects everything, named by its position. ' +
264
+ 'The rule is "past is frozen, future is editable": content/delay updates work on any ' +
265
+ 'step (people already past it keep what they received; people yet to reach it get the ' +
266
+ 'new version), append always works (people who already finished do NOT revive), and ' +
267
+ 'remove only works on a step nobody has reached yet. Execution order is fixed: ' +
268
+ 'removes (highest index first) → appends → updates; indices address the array AFTER ' +
269
+ "the earlier phases of the same batch. An update cannot change a step's channel — " +
270
+ 'that is remove + append.',
271
+ inputSchema: {
272
+ sequence_id: sequenceId,
273
+ edits: stepEdits,
274
+ },
275
+ }, async (params) => {
276
+ try {
277
+ const { data } = await client.PATCH('/sequences/{sequenceId}/steps', {
278
+ params: { path: { sequenceId: params.sequence_id } },
279
+ body: { edits: params.edits },
280
+ });
281
+ return jsonContent(data);
282
+ }
283
+ catch (e) {
284
+ return handle(e);
285
+ }
286
+ });
287
+ server.registerTool('update_sequence', {
288
+ description: "Update a sequence's meta and settings — partial, only what you pass changes. " +
289
+ 'Settings merge field-wise over the stored value; office_hours_id: null clears the ' +
290
+ 'pointer back to the org default. This is how a sequence is pointed at a calling ' +
291
+ 'schedule (create_office_hours → update_sequence with office_hours_id) and how ' +
292
+ 'respect_office_hours is verified ON — get_sequence shows the effective settings. ' +
293
+ 'Steps are NOT edited here: use set_sequence_steps / edit_sequence_steps.',
294
+ inputSchema: {
295
+ sequence_id: sequenceId,
296
+ name: z.string().min(1).max(200).optional(),
297
+ brief: z.string().max(10_000).optional(),
298
+ reply_instructions: z.string().optional(),
299
+ criteria: z
300
+ .object({
301
+ must: z.array(z.object({ label: z.string().min(2).max(60), text: z.string().min(3).max(500) })),
302
+ nice: z.array(z.object({
303
+ label: z.string().min(2).max(60),
304
+ text: z.string().min(3).max(500),
305
+ grade: z.enum(['high', 'medium', 'low']),
306
+ })),
307
+ })
308
+ .optional()
309
+ .describe('Replaces the checklist. Future judge runs default to it.'),
310
+ settings: z
311
+ .object({
312
+ block_active_elsewhere: z.boolean().optional(),
313
+ block_contacted_before: z.boolean().optional(),
314
+ respect_office_hours: z.boolean().optional(),
315
+ office_hours_id: z
316
+ .string()
317
+ .nullable()
318
+ .optional()
319
+ .describe('An office-hours config id (list_office_hours) this sequence sends within — ' +
320
+ 'null clears back to the org default.'),
321
+ })
322
+ .optional(),
323
+ },
324
+ }, async (params) => {
325
+ try {
326
+ const { data } = await client.PATCH('/sequences/{sequenceId}', {
327
+ params: { path: { sequenceId: params.sequence_id } },
328
+ body: {
329
+ ...(params.name !== undefined ? { name: params.name } : {}),
330
+ ...(params.brief !== undefined ? { brief: params.brief } : {}),
331
+ ...(params.reply_instructions !== undefined
332
+ ? { reply_instructions: params.reply_instructions }
333
+ : {}),
334
+ ...(params.criteria !== undefined ? { criteria: params.criteria } : {}),
335
+ ...(params.settings !== undefined ? { settings: params.settings } : {}),
336
+ },
337
+ });
338
+ return jsonContent(data);
339
+ }
340
+ catch (e) {
341
+ return handle(e);
342
+ }
343
+ });
344
+ server.registerTool('add_sequence_contacts', {
345
+ description: 'Add people to a sequence. THE NORMAL PATH — use this whenever the people are already ' +
346
+ 'in front of you (discovery results, a handful of contacts, anything you can name). ' +
347
+ 'Always pass a `batch_key` labelling the wave ("wave-1-invoicing"): every later step ' +
348
+ 'scopes to exactly that group. Returns a per-person outcome — enrolled, skipped, or ' +
349
+ 'dropped with the reason; nothing is silently lost. ' +
350
+ 'ONLY fall back to the HTTP API from Bash when the people are NOT already in your ' +
351
+ 'context — a CSV on disk, an Apollo/LinkedIn pull — where a script can transform and ' +
352
+ 'pipe them without their ever becoming tokens. Re-typing ids you already hold into a ' +
353
+ 'file saves nothing and costs a round trip.',
354
+ inputSchema: {
355
+ sequence_id: sequenceId,
356
+ contacts: z
357
+ .array(z.object({
358
+ contact_id: z
359
+ .string()
360
+ .optional()
361
+ .describe('A known contact — its handles and name fill anything omitted.'),
362
+ phone_number: z.string().optional(),
363
+ email: z.string().optional(),
364
+ whatsapp_user_id: z
365
+ .string()
366
+ .optional()
367
+ .describe('WhatsApp BSUID, for a phone-hidden contact.'),
368
+ display_name: z.string().optional(),
369
+ timezone: z.string().optional().describe('IANA zone; invalid values are dropped.'),
370
+ avatar_url: z
371
+ .string()
372
+ .optional()
373
+ .describe('Picture URL for people from OUTSIDE the org (a prospecting pull). Must be http(s). People linked to a contact get theirs filled automatically — omit it for those.'),
374
+ extra_data: z
375
+ .record(z.string(), z.unknown())
376
+ .optional()
377
+ .describe("Anything you know about this person that the org's own data does not — CSV columns you mapped, fields from an external pull, discovery provenance (as readable fields, not raw id dumps). Free-form JSON; the judge reads it as facts and People-table columns can project $.extra_data.* paths from it. Re-enrolling merges per key. Attach what you are already holding; never reconstruct data just to fill it."),
378
+ }))
379
+ .min(1)
380
+ .describe('Each person needs at least one reachable identity.'),
381
+ batch_key: z
382
+ .string()
383
+ .optional()
384
+ .describe('Wave label stamped on every row this call touches. Omitted, rows keep their existing key. Never auto-generated — name it.'),
385
+ source_detail: z
386
+ .string()
387
+ .optional()
388
+ .describe('Where these people came from, e.g. "discovery: invoicing complaints".'),
389
+ },
390
+ }, async (params) => {
391
+ try {
392
+ const { data } = await client.POST('/sequences/{sequenceId}/contacts', {
393
+ params: { path: { sequenceId: params.sequence_id } },
394
+ body: {
395
+ contacts: params.contacts,
396
+ source: 'companion',
397
+ ...(params.batch_key !== undefined ? { batch_key: params.batch_key } : {}),
398
+ ...(params.source_detail !== undefined ? { source_detail: params.source_detail } : {}),
399
+ },
400
+ });
401
+ return jsonContent(data);
402
+ }
403
+ catch (e) {
404
+ return handle(e);
405
+ }
406
+ });
407
+ server.registerTool('get_launch_preview', {
408
+ description: 'What launching WOULD do, without doing it: `will_send` (a forecast, not a promise — ' +
409
+ 'consent is re-checked per message), `held` with the reason each group is staying put ' +
410
+ '(held back is a place to look, never an error), `blockers` — the things launch refuses ' +
411
+ 'on: no messages, no sender, paused, or a REJECTED/DISABLED template — and ' +
412
+ '`pending_templates`: templates still in review, which do NOT block. Launching on a ' +
413
+ 'pending template is fine — people arm now and sends start the moment it clears; say ' +
414
+ 'so instead of waiting. ALWAYS read this and report it to the user before launching.',
415
+ inputSchema: { sequence_id: sequenceId },
416
+ }, async (params) => {
417
+ try {
418
+ const { data } = await client.GET('/sequences/{sequenceId}/launch-preview', {
419
+ params: { path: { sequenceId: params.sequence_id } },
420
+ });
421
+ return jsonContent(data);
422
+ }
423
+ catch (e) {
424
+ return handle(e);
425
+ }
426
+ });
427
+ server.registerTool('launch_sequence', {
428
+ description: 'START SENDING REAL MESSAGES TO REAL PEOPLE. Arms every qualified candidate; the first ' +
429
+ 'step goes out as its wait allows. Never call this unprompted — read get_launch_preview, ' +
430
+ 'report the forecast, and wait for the user to say go. Refuses (400) while any ' +
431
+ 'referenced template is REJECTED or DISABLED; a template still PENDING review does not ' +
432
+ 'block — people arm and sends start when it clears. Already-sending people are not ' +
433
+ 'touched. To stop afterwards, use pause_sequence.',
434
+ inputSchema: { sequence_id: sequenceId },
435
+ }, async (params) => {
436
+ try {
437
+ const { data } = await client.POST('/sequences/{sequenceId}/launch', {
438
+ params: { path: { sequenceId: params.sequence_id } },
439
+ });
440
+ return jsonContent(data);
441
+ }
442
+ catch (e) {
443
+ return handle(e);
444
+ }
445
+ });
446
+ server.registerTool('pause_sequence', {
447
+ description: 'Stop sending now. People keep their place in the sequence and resume from it — pausing ' +
448
+ 'is the stop button, not an undo. Use it the moment the user asks to stop.',
449
+ inputSchema: { sequence_id: sequenceId },
450
+ }, async (params) => {
451
+ try {
452
+ const { data } = await client.POST('/sequences/{sequenceId}/pause', {
453
+ params: { path: { sequenceId: params.sequence_id } },
454
+ });
455
+ return jsonContent(data);
456
+ }
457
+ catch (e) {
458
+ return handle(e);
459
+ }
460
+ });
461
+ server.registerTool('resume_sequence', {
462
+ description: 'Resume a paused sequence. People carry on from where they stopped; nobody restarts.',
463
+ inputSchema: { sequence_id: sequenceId },
464
+ }, async (params) => {
465
+ try {
466
+ const { data } = await client.POST('/sequences/{sequenceId}/resume', {
467
+ params: { path: { sequenceId: params.sequence_id } },
468
+ });
469
+ return jsonContent(data);
470
+ }
471
+ catch (e) {
472
+ return handle(e);
473
+ }
474
+ });
475
+ server.registerTool('list_qualification_runs', {
476
+ description: "A sequence's enrich/judge runs, latest first — what was run, over what scope, and how " +
477
+ 'it finished. Use to pick up where a previous turn left off; read_qualification_run for ' +
478
+ 'one run in full.',
479
+ inputSchema: {
480
+ sequence_id: sequenceId,
481
+ limit: z.number().int().min(1).max(100).optional(),
482
+ },
483
+ }, async (params) => {
484
+ try {
485
+ const { data } = await client.GET('/sequences/{sequenceId}/qualification-runs', {
486
+ params: {
487
+ path: { sequenceId: params.sequence_id },
488
+ query: params.limit !== undefined ? { limit: params.limit } : {},
489
+ },
490
+ });
491
+ return jsonContent(data);
492
+ }
493
+ catch (e) {
494
+ return handle(e);
495
+ }
496
+ });
497
+ server.registerTool('list_sequence_senders', {
498
+ description: 'Which senders this sequence is currently bound to. list_whatsapp_senders shows what it ' +
499
+ 'COULD use; this shows what it will actually send from.',
500
+ inputSchema: { sequence_id: sequenceId },
501
+ }, async (params) => {
502
+ try {
503
+ const { data } = await client.GET('/sequences/{sequenceId}/senders', {
504
+ params: { path: { sequenceId: params.sequence_id } },
505
+ });
506
+ return jsonContent(data);
507
+ }
508
+ catch (e) {
509
+ return handle(e);
510
+ }
511
+ });
512
+ server.registerTool('update_sequence_step_delay', {
513
+ description: 'Change how long a step waits before sending — MINUTES after the previous step. Step 0 ' +
514
+ 'is armed by launch or enrolment rather than by a delay, so it must stay 0. The user ' +
515
+ 'can also change this in the dashboard, so re-read the sequence before assuming your ' +
516
+ 'value still holds.',
517
+ inputSchema: {
518
+ sequence_id: sequenceId,
519
+ step_index: z.number().int().min(0).describe('Zero-based position in the steps.'),
520
+ delay_minutes: z
521
+ .number()
522
+ .int()
523
+ .min(0)
524
+ .max(129_600)
525
+ .describe('Minutes to wait — 30 for half an hour, 1440 for a day. Max 90 days.'),
526
+ },
527
+ }, async (params) => {
528
+ try {
529
+ const { data } = await client.PATCH('/sequences/{sequenceId}/steps/{stepIndex}/delay', {
530
+ params: {
531
+ path: { sequenceId: params.sequence_id, stepIndex: params.step_index },
532
+ },
533
+ body: { delay_minutes: params.delay_minutes },
534
+ });
535
+ return jsonContent(data);
536
+ }
537
+ catch (e) {
538
+ return handle(e);
539
+ }
540
+ });
541
+ // The two overrides of the engine's judgement. Both are the USER's call, not
542
+ // yours: use them when they tell you someone does or doesn't belong, never to
543
+ // tidy up a list you personally doubt. The fit cutoff is loosened by editing
544
+ // criteria and re-judging, never by overriding person by person.
545
+ server.registerTool('update_sequence_contact', {
546
+ description: "Correct one person's name or the handles the sequence sends to — a mistyped number, a " +
547
+ 'missing email. Only works while they are a candidate or parked: once someone is sending, ' +
548
+ 'a message may already be addressed to the handle on their row, so the sequence has to be ' +
549
+ 'paused first. Pass only the fields that change; null clears one. A handle already held ' +
550
+ 'by someone else in the same sequence is refused, naming them.',
551
+ inputSchema: {
552
+ sequence_id: sequenceId,
553
+ contact_id: z
554
+ .string()
555
+ .describe("The person's contact id, from the people list or enroll results."),
556
+ display_name: z.string().nullable().optional(),
557
+ phone: z.string().nullable().optional(),
558
+ email: z.string().nullable().optional(),
559
+ whatsapp_user_id: z.string().nullable().optional().describe('WhatsApp BSUID.'),
560
+ },
561
+ }, async (params) => {
562
+ try {
563
+ const body = {};
564
+ for (const key of ['display_name', 'phone', 'email', 'whatsapp_user_id']) {
565
+ if (params[key] !== undefined)
566
+ body[key] = params[key] ?? null;
567
+ }
568
+ const { data } = await client.PATCH('/sequences/{sequenceId}/contacts/{contactId}', {
569
+ params: {
570
+ path: { sequenceId: params.sequence_id, contactId: params.contact_id },
571
+ },
572
+ body,
573
+ });
574
+ return jsonContent(data);
575
+ }
576
+ catch (e) {
577
+ return handle(e);
578
+ }
579
+ });
580
+ server.registerTool('exit_sequence_contact', {
581
+ description: "Take someone out of the sequence, recording the reason IN THE USER'S OWN WORDS. " +
582
+ 'They stop receiving steps and LEAVE the list — adding them again later starts them ' +
583
+ 'over from the first step rather than resuming. What was already sent to them is kept. ' +
584
+ 'Use when the user says someone does not belong. Do NOT use it to prune people you ' +
585
+ 'doubt: that is what the criteria are for.',
586
+ inputSchema: {
587
+ sequence_id: sequenceId,
588
+ contact_id: z
589
+ .string()
590
+ .describe("The person's contact id, from the people list or enroll results."),
591
+ reason: z.string().describe("Why, in the user's words."),
592
+ },
593
+ }, async (params) => {
594
+ try {
595
+ const { data } = await client.POST('/sequences/{sequenceId}/contacts/exit', {
596
+ params: { path: { sequenceId: params.sequence_id } },
597
+ body: { contact_id: params.contact_id, reason: params.reason },
598
+ });
599
+ return jsonContent(data);
600
+ }
601
+ catch (e) {
602
+ return handle(e);
603
+ }
604
+ });
605
+ server.registerTool('include_sequence_contact', {
606
+ description: 'Override a below-cutoff judgement ("include anyway") for ONE person the user names. ' +
607
+ 'Clears their fit so they arm at the next launch; the verdicts stay on record and the ' +
608
+ 'override is written to the ledger. If several people are wrongly held back, the ' +
609
+ 'criteria are wrong — fix those and re-judge instead of overriding one by one.',
610
+ inputSchema: {
611
+ sequence_id: sequenceId,
612
+ contact_id: z
613
+ .string()
614
+ .describe("The person's contact id, from the people list or enroll results."),
615
+ },
616
+ }, async (params) => {
617
+ try {
618
+ const { data } = await client.POST('/sequences/{sequenceId}/contacts/{contactId}/include', {
619
+ params: {
620
+ path: { sequenceId: params.sequence_id, contactId: params.contact_id },
621
+ },
622
+ });
623
+ return jsonContent(data);
624
+ }
625
+ catch (e) {
626
+ return handle(e);
627
+ }
628
+ });
629
+ }
630
+ //# sourceMappingURL=campaign-spine.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"campaign-spine.js","sourceRoot":"","sources":["../../src/tools/campaign-spine.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,QAAQ,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAGzD,8EAA8E;AAC9E,EAAE;AACF,4EAA4E;AAC5E,6EAA6E;AAC7E,8EAA8E;AAC9E,8EAA8E;AAC9E,4EAA4E;AAC5E,0EAA0E;AAC1E,EAAE;AACF,gFAAgF;AAChF,4DAA4D;AAC5D,EAAE;AACF,4EAA4E;AAC5E,8EAA8E;AAC9E,6DAA6D;AAE7D,MAAM,UAAU,GAAG,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,iBAAiB,CAAC,CAAC;AAE1D,uEAAuE;AACvE,8EAA8E;AAE9E,MAAM,mBAAmB,GAAG,CAAC,CAAC,MAAM,CAAC;IACnC,MAAM,EA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