@agifyai/leadify-mcp 8.8.0 → 8.9.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/README.md +1 -1
- package/dist/tools/campaign_wizard.js +30 -4
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -267,7 +267,7 @@ Leadify et ne doit jamais être envoyée par un agent MCP.
|
|
|
267
267
|
| `unenroll_campaign_audience` | Désenrôler uniquement la liste complète de `lead_ids` renvoyée par le preview courant. Relit et refuse toute sélection partielle, étendue ou périmée ; aucun envoi. |
|
|
268
268
|
| `export_campaign` | Exporter les statistiques en CSV ; après clôture définitive, l'export provient du rapport final figé. |
|
|
269
269
|
| `list_playbooks` / `get_playbook` | Lister et lire les « Messages types » (playbooks du rédacteur) d’une organisation, avec leur contenu complet à la dernière version. |
|
|
270
|
-
| `publish_playbook` | Publier un message type : création, duplication ou nouvelle version (avec la version relue). Les refus du contrat du rédacteur sont rendus avec leur chemin. |
|
|
270
|
+
| `publish_playbook` | Publier un message type : création, duplication ou nouvelle version (avec la version relue), avec ses langues autorisées et sa langue de repli (`allowed_languages`, `fallback_language`, obligatoires à la création, gardées de la version précédente ou de l’original si absentes). Les refus du contrat du rédacteur sont rendus avec leur chemin. |
|
|
271
271
|
| `list_campaign_senders` | Lister les comptes d’envoi (LinkedIn, boîtes mail) de la personne qui porte la clé : les messages partent à son nom. |
|
|
272
272
|
| `get_campaign_audience_options` | Compter les personnes d’un groupe et de chacun de ses segments pour choisir l’audience d’une campagne. |
|
|
273
273
|
| `get_contact_policy` | Lire la politique de contact effective de l’organisation ou d’une campagne, en lecture seule. |
|
|
@@ -19,11 +19,14 @@ function assertReviewMode(data) {
|
|
|
19
19
|
}
|
|
20
20
|
return data;
|
|
21
21
|
}
|
|
22
|
+
/** Langues d’un message type, codes du produit Leadify (PRD-2231). */
|
|
23
|
+
const PLAYBOOK_LANGUAGES = ["fr", "en", "de", "es", "it"];
|
|
22
24
|
export function registerCampaignWizardTools(server, injectedClient) {
|
|
23
25
|
const client = () => injectedClient ?? getClient();
|
|
24
26
|
// ── Messages types (playbooks) ─────────────────────────────────────────
|
|
25
27
|
server.tool("list_playbooks", "List the organization's 'Messages types' (outreach playbooks) used by the outreach writer: id, name, kind " +
|
|
26
|
-
"(EVENT or GENERIC), latest version, validity window, linked event, channels with steps,
|
|
28
|
+
"(EVENT or GENERIC), latest version, validity window, linked event, channels with steps, campaign usage, and " +
|
|
29
|
+
"languages {allowedLanguages, fallbackLanguage} (null: the message type still follows the group's Fine Tuning languages).", {
|
|
27
30
|
organization_id: organizationId,
|
|
28
31
|
include_archived: z.boolean().optional().default(false).describe("Include archived playbooks."),
|
|
29
32
|
}, async ({ organization_id, include_archived }) => {
|
|
@@ -35,7 +38,7 @@ export function registerCampaignWizardTools(server, injectedClient) {
|
|
|
35
38
|
}
|
|
36
39
|
});
|
|
37
40
|
server.tool("get_playbook", "Read one 'Message type' at its latest version, with its full editable content (intent, eligibility, " +
|
|
38
|
-
"judgment guidance, promise, proofs, CTA, sequences and examples). Use it before publishing a new version.", {
|
|
41
|
+
"judgment guidance, promise, proofs, CTA, sequences and examples) and its languages. Use it before publishing a new version.", {
|
|
39
42
|
organization_id: organizationId,
|
|
40
43
|
playbook_id: z.string().min(1).describe("Playbook ID from list_playbooks."),
|
|
41
44
|
}, async ({ organization_id, playbook_id }) => {
|
|
@@ -52,16 +55,39 @@ export function registerCampaignWizardTools(server, injectedClient) {
|
|
|
52
55
|
"{startsAt?, endsAt?}, eligibility {all: [...]}, judgmentGuidance, promise, proofs [{id, statement, sourceUrl?}], " +
|
|
53
56
|
"cta {description, url?}, sequences [{channel: EMAIL|LINKEDIN, steps: [{step, kind: EMAIL|LINKEDIN_INVITE|LINKEDIN_MESSAGE, delayDays, purpose}]}], " +
|
|
54
57
|
"examples [{channel, step, subject?, body, commentary?}]. An EVENT playbook requires an eligibility condition " +
|
|
55
|
-
"{type: 'event_participation', eventId, status: 'VERIFIED'}.
|
|
58
|
+
"{type: 'event_participation', eventId, status: 'VERIFIED'}. Languages: the message is written in the prospect's " +
|
|
59
|
+
"preferred language when it is in allowed_languages, otherwise in fallback_language. Both are required to create a message type; " +
|
|
60
|
+
"omitted on a new version or a duplicate, the previous or source languages are kept. Contract refusals are returned with their JSON path.", {
|
|
56
61
|
organization_id: organizationId,
|
|
57
62
|
kind: z.enum(["EVENT", "GENERIC"]).describe("EVENT requires a verified event participation; GENERIC does not. Fixed after creation."),
|
|
58
63
|
content: z.record(z.unknown()).describe("Playbook content (see the tool description)."),
|
|
59
64
|
playbook_id: z.string().min(1).optional().describe("Existing playbook to publish a new version of."),
|
|
60
65
|
expected_version: z.number().int().min(1).optional().describe("Latest version read by get_playbook; required with playbook_id."),
|
|
61
66
|
duplicated_from_id: z.string().min(1).optional().describe("Playbook duplicated into a new one."),
|
|
62
|
-
|
|
67
|
+
allowed_languages: z
|
|
68
|
+
.array(z.enum(PLAYBOOK_LANGUAGES))
|
|
69
|
+
.min(1)
|
|
70
|
+
.optional()
|
|
71
|
+
.describe("Languages the message may be written in (fr, en, de, es, it). Requires fallback_language."),
|
|
72
|
+
fallback_language: z
|
|
73
|
+
.enum(PLAYBOOK_LANGUAGES)
|
|
74
|
+
.optional()
|
|
75
|
+
.describe("Language used when the prospect's preferred language is not allowed; one of allowed_languages."),
|
|
76
|
+
}, async ({ organization_id, kind, content, playbook_id, expected_version, duplicated_from_id, allowed_languages, fallback_language }) => {
|
|
63
77
|
try {
|
|
78
|
+
if ((allowed_languages === undefined) !== (fallback_language === undefined)) {
|
|
79
|
+
return handleToolError(new Error("allowed_languages and fallback_language go together: set both, or neither to keep the previous languages."));
|
|
80
|
+
}
|
|
81
|
+
if (allowed_languages === undefined && playbook_id === undefined && duplicated_from_id === undefined) {
|
|
82
|
+
return handleToolError(new Error("A new message type needs its languages: set allowed_languages and fallback_language."));
|
|
83
|
+
}
|
|
84
|
+
if (allowed_languages !== undefined && fallback_language !== undefined && !allowed_languages.includes(fallback_language)) {
|
|
85
|
+
return handleToolError(new Error("fallback_language must be one of allowed_languages."));
|
|
86
|
+
}
|
|
64
87
|
const body = { organizationId: organization_id, kind, content };
|
|
88
|
+
if (allowed_languages !== undefined && fallback_language !== undefined) {
|
|
89
|
+
body.languages = { allowedLanguages: allowed_languages, fallbackLanguage: fallback_language };
|
|
90
|
+
}
|
|
65
91
|
if (playbook_id !== undefined)
|
|
66
92
|
body.playbookId = playbook_id;
|
|
67
93
|
if (expected_version !== undefined)
|