@agifyai/leadify-mcp 8.5.4 → 8.6.1
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 +27 -24
- package/dist/server.js +2 -0
- package/dist/tools/campaigns.js +58 -24
- package/dist/tools/context_entities.d.ts +668 -0
- package/dist/tools/context_entities.js +528 -0
- package/dist/tools/context_workspace.js +104 -49
- package/dist/tools/personas.js +142 -100
- package/dist/tools/pipeline.d.ts +4 -1
- package/dist/tools/pipeline.js +26 -35
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/package.json +1 -1
- package/dist/tools/dataroom.d.ts +0 -2
- package/dist/tools/dataroom.js +0 -889
package/dist/tools/pipeline.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
2
|
import { getClient } from "../client.js";
|
|
3
3
|
import { toolResult, toolError, handleToolError } from "../types.js";
|
|
4
|
-
export function registerPipelineTools(server) {
|
|
4
|
+
export function registerPipelineTools(server, client = getClient()) {
|
|
5
5
|
// ── trigger_outreach ─────────────────────────────────────────────────────
|
|
6
6
|
server.tool("trigger_outreach", "Generate the outreach message SEQUENCE for a lead via the Trigger.dev agent " +
|
|
7
7
|
"(Leadify v3 writer). The agent is a PURE MESSAGE WRITER: it produces a multi-touch " +
|
|
@@ -28,13 +28,11 @@ export function registerPipelineTools(server) {
|
|
|
28
28
|
"traceUrl. In dry-run (dryrun=true) the call is safe to retry, since nothing is " +
|
|
29
29
|
"persisted; for production writes (dryrun=false) prefer following the trace over " +
|
|
30
30
|
"blindly retrying to avoid duplicate generation. " +
|
|
31
|
-
"
|
|
32
|
-
"
|
|
33
|
-
"
|
|
34
|
-
"
|
|
35
|
-
"
|
|
36
|
-
"card_linkedin_two, card_linkedin_three, card_email_one, card_email_one_subject, " +
|
|
37
|
-
"card_email_two, card_email_two_subject, card_email_three, card_email_three_subject.", {
|
|
31
|
+
"FREE WRITER: context_selection extends this same runtime with one explicit " +
|
|
32
|
+
"Vertical, Offer and Persona triplet. The backend requires all three objects to be " +
|
|
33
|
+
"ACTIVE, tenant-scoped and linked; no default is inferred. Omit context_selection " +
|
|
34
|
+
"to use the Lead Group-owned selection. The exact message-card set always comes " +
|
|
35
|
+
"from Fine Tuning and cannot be selected through technical card names.", {
|
|
38
36
|
lead_id: z.string().describe("ID of the lead to generate a message for."),
|
|
39
37
|
dryrun: z
|
|
40
38
|
.boolean()
|
|
@@ -49,28 +47,17 @@ export function registerPipelineTools(server) {
|
|
|
49
47
|
.default(false)
|
|
50
48
|
.describe("true = bypass the 'already has a message?' check so you can re-generate. " +
|
|
51
49
|
"false (default) = normal behaviour: skip leads that already have card_message."),
|
|
52
|
-
|
|
53
|
-
.
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
"card_email_one_subject",
|
|
60
|
-
"card_email_two",
|
|
61
|
-
"card_email_two_subject",
|
|
62
|
-
"card_email_three",
|
|
63
|
-
"card_email_three_subject",
|
|
64
|
-
]))
|
|
65
|
-
.min(1)
|
|
50
|
+
context_selection: z
|
|
51
|
+
.object({
|
|
52
|
+
vertical_id: z.string().trim().min(1),
|
|
53
|
+
offer_id: z.string().trim().min(1),
|
|
54
|
+
persona_id: z.string().trim().min(1),
|
|
55
|
+
})
|
|
56
|
+
.strict()
|
|
66
57
|
.optional()
|
|
67
|
-
.describe("Optional
|
|
68
|
-
"
|
|
69
|
-
|
|
70
|
-
"['card_connexion', 'card_linkedin_one', 'card_email_one', 'card_email_one_subject']. " +
|
|
71
|
-
"Subject fields must always accompany their body card. Cards for channels the " +
|
|
72
|
-
"lead doesn't have (e.g. email when no email address) are silently dropped."),
|
|
73
|
-
}, async ({ lead_id, dryrun, force, cards_to_generate }) => {
|
|
58
|
+
.describe("Optional explicit free-writer context. Supply vertical_id, offer_id and " +
|
|
59
|
+
"persona_id together. Omit to inherit the Lead Group context."),
|
|
60
|
+
}, async ({ lead_id, dryrun, force, context_selection }) => {
|
|
74
61
|
try {
|
|
75
62
|
// Resolve leadGroupId server-side. The Trigger.dev task payload requires
|
|
76
63
|
// `leadGroupId`, but the lead_id alone is enough on the MCP side — we
|
|
@@ -79,7 +66,7 @@ export function registerPipelineTools(server) {
|
|
|
79
66
|
// 10–60s Trigger.dev wait that follows.
|
|
80
67
|
const leadParams = new URLSearchParams();
|
|
81
68
|
leadParams.set("id", lead_id);
|
|
82
|
-
const leadRes = (await
|
|
69
|
+
const leadRes = (await client.get("/get-lead", leadParams));
|
|
83
70
|
const leadGroupId = leadRes?.lead?.groupId;
|
|
84
71
|
if (!leadGroupId) {
|
|
85
72
|
return toolError(`Cannot resolve leadGroupId for lead "${lead_id}". ` +
|
|
@@ -96,10 +83,14 @@ export function registerPipelineTools(server) {
|
|
|
96
83
|
dryrun,
|
|
97
84
|
force,
|
|
98
85
|
};
|
|
99
|
-
if (
|
|
100
|
-
body.
|
|
86
|
+
if (context_selection) {
|
|
87
|
+
body.contextSelection = {
|
|
88
|
+
verticalId: context_selection.vertical_id,
|
|
89
|
+
offerId: context_selection.offer_id,
|
|
90
|
+
personaId: context_selection.persona_id,
|
|
91
|
+
};
|
|
101
92
|
}
|
|
102
|
-
const data = (await
|
|
93
|
+
const data = (await client.post("/api/trigger-outreach", body));
|
|
103
94
|
// Decorate the response with a Trigger.dev run deep-link when the
|
|
104
95
|
// backend didn't ship one. Applies to BOTH success and failure paths
|
|
105
96
|
// so the skill operator can always jump to the trace.
|
|
@@ -133,7 +124,7 @@ export function registerPipelineTools(server) {
|
|
|
133
124
|
.describe("Separator between old and new content. Default: '\\n\\n---\\n\\n'."),
|
|
134
125
|
}, async ({ lead_group_id, section, content, separator }) => {
|
|
135
126
|
try {
|
|
136
|
-
const data = await
|
|
127
|
+
const data = await client.post("/api/pipeline/append-fine-tuning", {
|
|
137
128
|
leadGroupId: lead_group_id,
|
|
138
129
|
section,
|
|
139
130
|
content,
|
|
@@ -166,7 +157,7 @@ export function registerPipelineTools(server) {
|
|
|
166
157
|
.describe("Maximum number of leads to return (1-5, default 1)."),
|
|
167
158
|
}, async ({ lead_group_id, exclude_lead_ids, limit }) => {
|
|
168
159
|
try {
|
|
169
|
-
const data = await
|
|
160
|
+
const data = await client.post("/api/pipeline/next-lead", {
|
|
170
161
|
leadGroupId: lead_group_id,
|
|
171
162
|
excludeLeadIds: exclude_lead_ids,
|
|
172
163
|
limit,
|
package/dist/version.d.ts
CHANGED
package/dist/version.js
CHANGED
package/package.json
CHANGED
package/dist/tools/dataroom.d.ts
DELETED