@agifyai/leadify-mcp 9.7.2 → 9.8.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 CHANGED
@@ -505,7 +505,8 @@ moment pour une personne, avec au plus un message Gmail et un message ou une
505
505
  invitation LinkedIn. Aucune séquence ni étape future. Le MCP ne contacte jamais
506
506
  Gmail ou Unipile pour envoyer : Leadify contrôle et exécute les dépôts acceptés.
507
507
 
508
- `get_mcp_runtime_info` annonce les 16 capacités du paquet et les versions serveur
508
+ `get_mcp_runtime_info` annonce les 30 capacités du paquet, les 13 modules du
509
+ contexte de rédaction (`outreach.contextModules`) et les versions serveur
509
510
  attendues. `probe_outreach: true` vérifie en plus le contrat des programmes dans
510
511
  l'organisation choisie, sans lire de prospect. `PROGRAM_CONTRACT_VERIFIED` ne
511
512
  prouve ni les autres routes ni une autorisation commerciale. Chaque réponse
@@ -533,7 +534,9 @@ Les tests de contrat et de transport sont dans `test/agent-outreach.test.mjs` ;
533
534
  | Sélection avant pagination | `query_outreach_prospects` | R | POST A/prospects/query | filtres complets, pages, erreurs |
534
535
  | Résumé d'une personne | `get_outreach_prospect_summary` | R | GET A/prospects/:leadId | identité explicite |
535
536
  | Historique des contacts | `get_outreach_contact_history` | R | GET A/contacts/:leadId | comptes accessibles, couverture |
536
- | Contexte frais de rédaction | `get_outreach_prospect_context` | R | GET C/people/:leadId/context | contrat, versions, état prêt ou attente |
537
+ | Contexte de rédaction, entrée légère | `get_outreach_context_summary` | R | GET C/people/:leadId/context/summary | versions, état prêt ou attente, 13 modules avec taille et empreinte, `decisionContext` |
538
+ | Contexte de rédaction, un module | `get_outreach_context_<module>` (13 outils) | R | GET C/people/:leadId/context/modules/:module | module, empreinte, `readAt`, curseur pour `signals` et `history` |
539
+ | Contexte entier (ancien) | `get_outreach_prospect_context` | R | GET C/people/:leadId/context | contrat, versions ; environ 90 Ko, à éviter |
537
540
  | Fil exact | `get_outreach_thread` | R | GET C/people/:leadId/thread | account_key, thread_id, curseur |
538
541
  | Décisions présentes | `submit_outreach_messages` | W | POST A/messages/batch | schéma, texte intact, reprises, lot partiel |
539
542
  | Messages de cette clé | `list_outreach_messages` | read + organisation | GET A/messages | pagination, projection sûre |
@@ -587,10 +590,55 @@ droits est refusé ; aucun redémarrage caché n'a lieu. Programmes, messages et
587
590
  conversations utilisent `after_id` pour leur page suivante. Les événements et les
588
591
  fils utilisent `cursor`. Les curseurs sont opaques et ne doivent pas être inventés.
589
592
 
590
- `get_outreach_prospect_summary` est un résumé. Avant d'écrire, lire
591
- `get_outreach_prospect_context`, vérifier `readiness.ready`, puis les fils exacts
592
- nécessaires avec `get_outreach_thread`. Un corps indisponible ou un simple extrait
593
- ne vaut pas une conversation complète. Le contexte n'effectue aucune qualification.
593
+ `get_outreach_prospect_summary` est un résumé de la sélection, pas le contexte de
594
+ rédaction. Avant d'écrire, lire `get_outreach_context_summary`, vérifier
595
+ `readiness.ready`, puis chaque module dans l'ordre de `readOrder`, puis les fils
596
+ exacts nécessaires avec `get_outreach_thread`. Un corps indisponible ou un simple
597
+ extrait ne vaut pas une conversation complète. Le contexte n'effectue aucune
598
+ qualification.
599
+
600
+ #### Contexte de rédaction par modules (PRD-2632)
601
+
602
+ La lecture entière `get_outreach_prospect_context` pèse près de 90 Ko. Un agent dont
603
+ l'exécution écarte tout résultat d'outil de plus de 50 000 caractères (Hermès) ne la
604
+ voit jamais. Elle est conservée mais déconseillée : lire le sommaire, puis un module
605
+ à la fois. Toutes ces réponses sont en JSON compact, sur une seule ligne.
606
+
607
+ `get_outreach_context_summary` rend, en quelques Ko : les identifiants, `readiness`,
608
+ les huit `versions`, `contextVersion`, `factsVersion`, `readAt`, `readOrder`, la liste
609
+ des treize modules (`module`, `version` = empreinte, `characters`, `pages`, `purpose`),
610
+ les `warnings` (module trop grand, historique incomplet) et `decisionContext`, le bloc
611
+ à recopier dans le `context` de chaque décision déposée.
612
+
613
+ Les treize outils `get_outreach_context_<module>`, dans l'ordre de lecture utile :
614
+
615
+ | Module | Contenu | Pages |
616
+ |---|---|---|
617
+ | `prospect` | identité, coordonnées, langue, poste | 1 |
618
+ | `company` | employeur et fiches entreprise qualifiées | 1 |
619
+ | `workspace` | choix du groupe : persona, verticale, offre, expéditeur, appel à l'action | 1 |
620
+ | `company_brain` | Company Brain de l'organisation qui prospecte | 1 |
621
+ | `vertical` | verticale du persona | 1 |
622
+ | `offers` | offre retenue (trois au plus) | 1 |
623
+ | `persona` | persona et son contrat de rédaction | 1 |
624
+ | `playbook` | playbook commercial publié | 1 |
625
+ | `qualification` | fiche de qualification de la personne | 1 |
626
+ | `signals` | signaux récents, le plus récent d'abord | curseur |
627
+ | `history` | messages échangés avec leur texte, fils connus | curseur |
628
+ | `crm` | statut CRM, exclusion, réception, prise en main humaine | 1 |
629
+ | `authorization` | état du programme, plafonds, expéditeurs, droits | 1 |
630
+
631
+ Chaque réponse contient `module`, `version` (l'empreinte du module), `readAt`, `data`
632
+ et `page` (null, ou `nextCursor` à repasser tel quel dans `cursor`). Un module paginé
633
+ rend son en-tête avec la première page seulement ; une page tient sous environ
634
+ 25 000 caractères. Si `version` diffère de celle du sommaire, le contexte a changé
635
+ entre deux lectures : repartir du sommaire. Un curseur lié à une empreinte périmée est
636
+ refusé (`VERSION_CONFLICT`).
637
+
638
+ Au dépôt, `context.modules` reprend `decisionContext.modules` à l'identique (les treize
639
+ empreintes). Il est facultatif pour les anciens clients et strict quand il est présent.
640
+ Les huit `versions` restent obligatoires. Si une empreinte a bougé depuis la lecture,
641
+ Leadify refuse avec `CONTEXT_STALE` et nomme les modules (`CONTEXT_MODULE_CHANGED:<module>`).
594
642
 
595
643
  ### Dépôt et reprise
596
644
 
@@ -601,7 +649,9 @@ et `messages` (1 à 2, un par canal).
601
649
 
602
650
  Le contexte transmis comporte `contract_version: "agent-writing-context.v1"`,
603
651
  `context_version`, `facts_version`, `read_at` et l'objet `versions` exact reçu du
604
- serveur. Les clés de cet objet restent inchangées, dont `contactState`. Un message
652
+ serveur. Les clés de cet objet restent inchangées, dont `contactState`. Quand la
653
+ rédaction vient du contexte par modules, `modules` (les treize empreintes de
654
+ `decisionContext.modules`) l'accompagne. Un message
605
655
  contient `channel`, `action`, `sender_id`, `account_key`, `recipient`, `subject`,
606
656
  `body`, `thread_id`, `expected_inbound_id`, `technical_parts` (signature et
607
657
  unsubscribe). Les champs nullables doivent être présents. Une réponse désigne
@@ -2,7 +2,13 @@ import type { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
2
2
  import { type LeadifyClient } from "../client.js";
3
3
  import { type ToolResult } from "../types.js";
4
4
  export declare const OUTREACH_MCP_CONTRACT = "leadify-outreach-mcp.v1";
5
- export declare const OUTREACH_TOOL_NAMES: readonly ["list_outreach_programs", "get_outreach_program_context", "query_outreach_prospects", "get_outreach_prospect_summary", "get_outreach_contact_history", "get_outreach_prospect_context", "get_outreach_thread", "submit_outreach_messages", "list_outreach_messages", "get_outreach_message", "cancel_outreach_message", "list_outreach_events", "acknowledge_outreach_events", "get_outreach_reception_health", "list_outreach_conversations", "get_outreach_conversation"];
5
+ /** PRD-2632 : writing context read in pieces. Same order as the server's `readOrder`. */
6
+ export declare const OUTREACH_CONTEXT_MODULES: readonly ["prospect", "company", "workspace", "company_brain", "vertical", "offers", "persona", "playbook", "qualification", "signals", "history", "crm", "authorization"];
7
+ export type OutreachContextModule = typeof OUTREACH_CONTEXT_MODULES[number];
8
+ /** Only these modules are long lists the server pages; every other module is one answer. */
9
+ export declare const OUTREACH_CONTEXT_PAGED_MODULES: readonly ["signals", "history"];
10
+ export declare const OUTREACH_CONTEXT_TOOL_NAMES: readonly ["get_outreach_context_summary", "get_outreach_context_prospect", "get_outreach_context_company", "get_outreach_context_workspace", "get_outreach_context_company_brain", "get_outreach_context_vertical", "get_outreach_context_offers", "get_outreach_context_persona", "get_outreach_context_playbook", "get_outreach_context_qualification", "get_outreach_context_signals", "get_outreach_context_history", "get_outreach_context_crm", "get_outreach_context_authorization"];
11
+ export declare const OUTREACH_TOOL_NAMES: readonly ["list_outreach_programs", "get_outreach_program_context", "query_outreach_prospects", "get_outreach_prospect_summary", "get_outreach_contact_history", "get_outreach_prospect_context", "get_outreach_context_summary", "get_outreach_context_prospect", "get_outreach_context_company", "get_outreach_context_workspace", "get_outreach_context_company_brain", "get_outreach_context_vertical", "get_outreach_context_offers", "get_outreach_context_persona", "get_outreach_context_playbook", "get_outreach_context_qualification", "get_outreach_context_signals", "get_outreach_context_history", "get_outreach_context_crm", "get_outreach_context_authorization", "get_outreach_thread", "submit_outreach_messages", "list_outreach_messages", "get_outreach_message", "cancel_outreach_message", "list_outreach_events", "acknowledge_outreach_events", "get_outreach_reception_health", "list_outreach_conversations", "get_outreach_conversation"];
6
12
  export declare const OUTREACH_SERVER_CONTRACTS: {
7
13
  readonly program: "1.0.0";
8
14
  readonly selection: "1.0.0";
@@ -3,8 +3,17 @@ import { getClient } from "../client.js";
3
3
  import { LeadifyApiError, toolResult, toolError, handleToolError } from "../types.js";
4
4
  import { identifier, scope, querySchema, queryBody, submitSchema, decisionBody, acknowledgeSchema } from "./agent_outreach_schemas.js";
5
5
  export const OUTREACH_MCP_CONTRACT = "leadify-outreach-mcp.v1";
6
+ /** PRD-2632 : writing context read in pieces. Same order as the server's `readOrder`. */
7
+ export const OUTREACH_CONTEXT_MODULES = ["prospect", "company", "workspace", "company_brain", "vertical", "offers", "persona", "playbook",
8
+ "qualification", "signals", "history", "crm", "authorization"];
9
+ /** Only these modules are long lists the server pages; every other module is one answer. */
10
+ export const OUTREACH_CONTEXT_PAGED_MODULES = ["signals", "history"];
11
+ export const OUTREACH_CONTEXT_TOOL_NAMES = ["get_outreach_context_summary", "get_outreach_context_prospect", "get_outreach_context_company",
12
+ "get_outreach_context_workspace", "get_outreach_context_company_brain", "get_outreach_context_vertical", "get_outreach_context_offers",
13
+ "get_outreach_context_persona", "get_outreach_context_playbook", "get_outreach_context_qualification", "get_outreach_context_signals",
14
+ "get_outreach_context_history", "get_outreach_context_crm", "get_outreach_context_authorization"];
6
15
  export const OUTREACH_TOOL_NAMES = ["list_outreach_programs", "get_outreach_program_context", "query_outreach_prospects",
7
- "get_outreach_prospect_summary", "get_outreach_contact_history", "get_outreach_prospect_context", "get_outreach_thread",
16
+ "get_outreach_prospect_summary", "get_outreach_contact_history", "get_outreach_prospect_context", ...OUTREACH_CONTEXT_TOOL_NAMES, "get_outreach_thread",
8
17
  "submit_outreach_messages", "list_outreach_messages", "get_outreach_message", "cancel_outreach_message", "list_outreach_events",
9
18
  "acknowledge_outreach_events", "get_outreach_reception_health", "list_outreach_conversations", "get_outreach_conversation"];
10
19
  export const OUTREACH_SERVER_CONTRACTS = { program: "1.0.0", selection: "1.0.0", context: "agent-writing-context.v1", receipt: "agent-message-receipt.v1", journal: "1.0.0" };
@@ -52,11 +61,29 @@ export function projectOutreachMessage(data) {
52
61
  });
53
62
  return result;
54
63
  }
64
+ /** One line of JSON: the writing-context tools are read by a runtime that sets aside results above 50,000 characters. */
65
+ const compactResult = (data) => ({ content: [{ type: "text", text: JSON.stringify(data) }] });
66
+ const CONTEXT_MODULE_DESCRIPTION = {
67
+ prospect: "WHO the person is: identity, contact details, language, job title (the employer is in the company module).",
68
+ company: "Her EMPLOYER: the employer record and the qualified company cards (each with its document).",
69
+ workspace: "WHICH choices were made for this group: selected persona, vertical and offer, sender, call to action, plus workspace status and schema readiness. The long texts are in company_brain, vertical, offers, persona and playbook.",
70
+ company_brain: "The Company Brain of the organisation that prospects: who it is, positioning, vocabulary allowed or forbidden. Read it before writing a word.",
71
+ vertical: "The VERTICAL attached to the persona: target market and its content.",
72
+ offers: "The OFFER(S) retained for this group (three at most): what is sold and its limits.",
73
+ persona: "The PERSONA written to: who she is, her writing contract and description.",
74
+ playbook: "The published sales PLAYBOOK (GTM) of the organisation.",
75
+ qualification: "What is KNOWN about the person: qualification document, freshness, failures and any refresh requested. Read the company module for the company cards.",
76
+ signals: "WHY NOW: recent signals about the person and her company, newest first. Paged.",
77
+ history: "What was ALREADY SAID: messages exchanged with their text, known threads, the program's own messages, coverage. Newest first. Paged.",
78
+ crm: "CRM situation, exclusion and contact state: commercial status, reception, human takeover, thread-read readiness, last confirmed outbound and inbound. Check it before any first contact.",
79
+ authorization: "What is PERMITTED: program state, caps, senders and the key's rights, with the authorization revision to copy into the decision.",
80
+ };
55
81
  export function registerAgentOutreachTools(server, client = getClient()) {
56
- function register(name, description, schema, action, write = false) {
82
+ function register(name, description, schema, action, write = false, compact = false) {
57
83
  server.registerTool(name, { description: description + readNotice, inputSchema: schema,
58
84
  annotations: { readOnlyHint: !write && name !== "query_outreach_prospects", destructiveHint: false, idempotentHint: name !== "query_outreach_prospects", openWorldHint: true } }, (async (input) => { try {
59
- return toolResult(await action(schema.parse(input)));
85
+ const data = await action(schema.parse(input));
86
+ return compact ? compactResult(data) : toolResult(data);
60
87
  }
61
88
  catch (e) {
62
89
  return outreachError(e);
@@ -68,7 +95,24 @@ export function registerAgentOutreachTools(server, client = getClient()) {
68
95
  const personSchema = z.object({ ...scope, lead_id: identifier }).strict();
69
96
  register("get_outreach_prospect_summary", "Read a selected person's compact identity, contact counts and selection reasons. This is NOT the writing context: use get_outreach_prospect_context before drafting.", personSchema, v => client.get(`${programPath(v.program_id)}/prospects/${encoded(v.lead_id)}`, params(v.organization_id)));
70
97
  register("get_outreach_contact_history", "Read confirmed contact evidence for one person across accessible accounts, including pending, unknown and manual activity. Coverage limits remain explicit.", personSchema, v => client.get(`${programPath(v.program_id)}/contacts/${encoded(v.lead_id)}`, params(v.organization_id)));
71
- register("get_outreach_prospect_context", "Read fresh writing context, full-thread readiness, identity, qualification, signals, exclusion, authorizations and Context Workspace. Draft only when readiness.ready=true; WAIT requires resolving the stated reasons. Copy all versions, factsVersion, contextVersion and readAt into the current decision. Never starts qualification. A human takeover can only be resumed by a human in Leadify.", personSchema, async (v) => requireOutreachVersion(await client.get(`${programPath(v.program_id, true)}/people/${encoded(v.lead_id)}/context`, params(v.organization_id)), "agent-writing-context.v1"));
98
+ register("get_outreach_prospect_context", "LEGACY whole writing context, about 90 KB: runtimes that set aside tool results above 50,000 characters never see it. Agents must NOT call it: read get_outreach_context_summary, then the get_outreach_context_<module> tools. Kept for clients that can read very large results. Draft only when readiness.ready=true; WAIT requires resolving the stated reasons. Copy all versions, factsVersion, contextVersion and readAt into the current decision. Never starts qualification. A human takeover can only be resumed by a human in Leadify.", personSchema, async (v) => requireOutreachVersion(await client.get(`${programPath(v.program_id, true)}/people/${encoded(v.lead_id)}/context`, params(v.organization_id)), "agent-writing-context.v1"));
99
+ // PRD-2632 : the same context in pieces. Summary first, then one tool per module.
100
+ const contextPath = (v, tail) => `${programPath(v.program_id, true)}/people/${encoded(v.lead_id)}/context/${tail}`;
101
+ const expectKind = (data, kind, module) => {
102
+ const read = requireOutreachVersion(data, "agent-writing-context.v1");
103
+ if (object(read).responseKind !== kind || (module !== undefined && object(read).module !== module))
104
+ throw new LeadifyApiError(409, { code: "OUTREACH_CONTRACT_INCOMPATIBLE",
105
+ error: "Le serveur n'a pas rendu la lecture de contexte attendue. Vérifiez sa version avant de continuer.", expected: { responseKind: kind, module: module ?? null },
106
+ received: { responseKind: object(read).responseKind ?? null, module: object(read).module ?? null } });
107
+ return read;
108
+ };
109
+ register("get_outreach_context_summary", "START HERE to write for one person. Light read (about 7 KB): ids, readiness, the eight versions, contextVersion, factsVersion, the 13 modules in reading order (readOrder) with characters, pages and fingerprint, warnings, and decisionContext, the block to copy into the context of each deposited decision (modules included). Replaces get_outreach_prospect_context, whose 90 KB result is set aside by agent runtimes. Draft only when readiness.ready=true; otherwise WAIT with the stated reasons. Then read the modules, in readOrder, with get_outreach_context_<module>; each module answer carries its own version, which must equal modules[].version here, else the context moved: restart from this summary. Never starts qualification.", personSchema, async (v) => expectKind(await client.get(contextPath(v, "summary"), params(v.organization_id)), "summary"), false, true);
110
+ const pagedModules = new Set(OUTREACH_CONTEXT_PAGED_MODULES);
111
+ for (const module of OUTREACH_CONTEXT_MODULES) {
112
+ const paged = pagedModules.has(module);
113
+ const schema = paged ? z.object({ ...scope, lead_id: identifier, cursor: z.string().min(1).max(2000).optional().describe("page.nextCursor from the previous page, unchanged. Omit for the first page.") }).strict() : personSchema;
114
+ register(`get_outreach_context_${module}`, `Writing context, module ${module}: ${CONTEXT_MODULE_DESCRIPTION[module]} Read get_outreach_context_summary first. Answer: {module, version, readAt, data, page}; compact JSON, kept under about 25,000 characters per page. Compare version with the summary's modules[].version: if it differs, the context moved, restart from the summary.${paged ? " Pass page.nextCursor unchanged as cursor until it is null; the header comes with the first page only." : ""} Never starts qualification.`, schema, async (v) => expectKind(await client.get(contextPath(v, `modules/${module}`), params(v.organization_id, { cursor: v.cursor })), "module", module), false, true);
115
+ }
72
116
  register("get_outreach_thread", "Read one exact person's account/thread with complete bodies or explicit unavailable coverage. Pass nextCursor unchanged as cursor. An excerpt is not a complete conversation.", z.object({ ...scope, lead_id: identifier, account_key: z.string().min(1).max(1000), thread_id: identifier, cursor: z.string().min(1).max(8000).optional(), limit: z.number().int().min(1).max(100).default(50) }).strict(), v => client.get(`${programPath(v.program_id, true)}/people/${encoded(v.lead_id)}/thread`, params(v.organization_id, { accountKey: v.account_key, threadId: v.thread_id, cursor: v.cursor, limit: v.limit })));
73
117
  register("submit_outreach_messages", "Deposit 1–20 fresh decisions to Leadify for now, at most one message per channel per person/decision, never a sequence or scheduled steps. Preserve authored text exactly. A reply requires thread_id and expected_inbound_id. Use the SAME request_key and identical payload after interruption; a changed payload needs a new decision after rereading context. Inspect EVERY receipt: a successful call may contain ACCEPTED, WAIT and REFUSED decisions." + receiptNotice, submitSchema, async (v) => requireOutreachVersion(await client.post(postPath(`${programPath(v.program_id)}/messages/batch`, v.organization_id), { decisions: v.decisions.map(decisionBody) }), "agent-message-receipt.v1"), true);
74
118
  register("list_outreach_messages", "List this key's deposited messages and decision receipts, including after sender grant revocation. Pagination uses nextCursor as after_id." + receiptNotice, z.object({ ...scope, after_id: identifier.optional(), limit: z.number().int().min(1).max(50).default(25) }).strict(), async (v) => {
@@ -152,6 +152,49 @@ export declare const filters: z.ZodObject<{
152
152
  reply?: "TO_HANDLE" | "WAITING" | "NONE" | undefined;
153
153
  excluded?: boolean | undefined;
154
154
  }>;
155
+ export declare const contextModules: z.ZodObject<{
156
+ prospect: z.ZodString;
157
+ company: z.ZodString;
158
+ workspace: z.ZodString;
159
+ company_brain: z.ZodString;
160
+ vertical: z.ZodString;
161
+ offers: z.ZodString;
162
+ persona: z.ZodString;
163
+ playbook: z.ZodString;
164
+ qualification: z.ZodString;
165
+ signals: z.ZodString;
166
+ history: z.ZodString;
167
+ crm: z.ZodString;
168
+ authorization: z.ZodString;
169
+ }, "strict", z.ZodTypeAny, {
170
+ prospect: string;
171
+ company: string;
172
+ workspace: string;
173
+ company_brain: string;
174
+ vertical: string;
175
+ offers: string;
176
+ persona: string;
177
+ playbook: string;
178
+ qualification: string;
179
+ signals: string;
180
+ history: string;
181
+ crm: string;
182
+ authorization: string;
183
+ }, {
184
+ prospect: string;
185
+ company: string;
186
+ workspace: string;
187
+ company_brain: string;
188
+ vertical: string;
189
+ offers: string;
190
+ persona: string;
191
+ playbook: string;
192
+ qualification: string;
193
+ signals: string;
194
+ history: string;
195
+ crm: string;
196
+ authorization: string;
197
+ }>;
155
198
  export declare const context: z.ZodObject<{
156
199
  contract_version: z.ZodLiteral<"agent-writing-context.v1">;
157
200
  context_version: z.ZodString;
@@ -167,54 +210,127 @@ export declare const context: z.ZodObject<{
167
210
  authorization: z.ZodString;
168
211
  workspace: z.ZodString;
169
212
  }, "strict", z.ZodTypeAny, {
170
- identity: string;
213
+ workspace: string;
171
214
  qualification: string;
172
215
  signals: string;
216
+ authorization: string;
217
+ identity: string;
173
218
  conversation: string;
174
219
  contactState: string;
175
220
  exclusion: string;
176
- authorization: string;
177
- workspace: string;
178
221
  }, {
179
- identity: string;
222
+ workspace: string;
180
223
  qualification: string;
181
224
  signals: string;
225
+ authorization: string;
226
+ identity: string;
182
227
  conversation: string;
183
228
  contactState: string;
184
229
  exclusion: string;
230
+ }>;
231
+ modules: z.ZodOptional<z.ZodObject<{
232
+ prospect: z.ZodString;
233
+ company: z.ZodString;
234
+ workspace: z.ZodString;
235
+ company_brain: z.ZodString;
236
+ vertical: z.ZodString;
237
+ offers: z.ZodString;
238
+ persona: z.ZodString;
239
+ playbook: z.ZodString;
240
+ qualification: z.ZodString;
241
+ signals: z.ZodString;
242
+ history: z.ZodString;
243
+ crm: z.ZodString;
244
+ authorization: z.ZodString;
245
+ }, "strict", z.ZodTypeAny, {
246
+ prospect: string;
247
+ company: string;
248
+ workspace: string;
249
+ company_brain: string;
250
+ vertical: string;
251
+ offers: string;
252
+ persona: string;
253
+ playbook: string;
254
+ qualification: string;
255
+ signals: string;
256
+ history: string;
257
+ crm: string;
185
258
  authorization: string;
259
+ }, {
260
+ prospect: string;
261
+ company: string;
186
262
  workspace: string;
187
- }>;
263
+ company_brain: string;
264
+ vertical: string;
265
+ offers: string;
266
+ persona: string;
267
+ playbook: string;
268
+ qualification: string;
269
+ signals: string;
270
+ history: string;
271
+ crm: string;
272
+ authorization: string;
273
+ }>>;
188
274
  }, "strict", z.ZodTypeAny, {
189
275
  contract_version: "agent-writing-context.v1";
190
276
  context_version: string;
191
277
  facts_version: string;
192
278
  read_at: string;
193
279
  versions: {
194
- identity: string;
280
+ workspace: string;
195
281
  qualification: string;
196
282
  signals: string;
283
+ authorization: string;
284
+ identity: string;
197
285
  conversation: string;
198
286
  contactState: string;
199
287
  exclusion: string;
200
- authorization: string;
201
- workspace: string;
202
288
  };
289
+ modules?: {
290
+ prospect: string;
291
+ company: string;
292
+ workspace: string;
293
+ company_brain: string;
294
+ vertical: string;
295
+ offers: string;
296
+ persona: string;
297
+ playbook: string;
298
+ qualification: string;
299
+ signals: string;
300
+ history: string;
301
+ crm: string;
302
+ authorization: string;
303
+ } | undefined;
203
304
  }, {
204
305
  contract_version: "agent-writing-context.v1";
205
306
  context_version: string;
206
307
  facts_version: string;
207
308
  read_at: string;
208
309
  versions: {
209
- identity: string;
310
+ workspace: string;
210
311
  qualification: string;
211
312
  signals: string;
313
+ authorization: string;
314
+ identity: string;
212
315
  conversation: string;
213
316
  contactState: string;
214
317
  exclusion: string;
215
- authorization: string;
216
- workspace: string;
217
318
  };
319
+ modules?: {
320
+ prospect: string;
321
+ company: string;
322
+ workspace: string;
323
+ company_brain: string;
324
+ vertical: string;
325
+ offers: string;
326
+ persona: string;
327
+ playbook: string;
328
+ qualification: string;
329
+ signals: string;
330
+ history: string;
331
+ crm: string;
332
+ authorization: string;
333
+ } | undefined;
218
334
  }>;
219
335
  export declare const message: z.ZodEffects<z.ZodObject<{
220
336
  channel: z.ZodEnum<["GMAIL", "LINKEDIN"]>;
@@ -325,54 +441,127 @@ export declare const decision: z.ZodEffects<z.ZodObject<{
325
441
  authorization: z.ZodString;
326
442
  workspace: z.ZodString;
327
443
  }, "strict", z.ZodTypeAny, {
328
- identity: string;
444
+ workspace: string;
329
445
  qualification: string;
330
446
  signals: string;
447
+ authorization: string;
448
+ identity: string;
331
449
  conversation: string;
332
450
  contactState: string;
333
451
  exclusion: string;
334
- authorization: string;
335
- workspace: string;
336
452
  }, {
337
- identity: string;
453
+ workspace: string;
338
454
  qualification: string;
339
455
  signals: string;
456
+ authorization: string;
457
+ identity: string;
340
458
  conversation: string;
341
459
  contactState: string;
342
460
  exclusion: string;
461
+ }>;
462
+ modules: z.ZodOptional<z.ZodObject<{
463
+ prospect: z.ZodString;
464
+ company: z.ZodString;
465
+ workspace: z.ZodString;
466
+ company_brain: z.ZodString;
467
+ vertical: z.ZodString;
468
+ offers: z.ZodString;
469
+ persona: z.ZodString;
470
+ playbook: z.ZodString;
471
+ qualification: z.ZodString;
472
+ signals: z.ZodString;
473
+ history: z.ZodString;
474
+ crm: z.ZodString;
475
+ authorization: z.ZodString;
476
+ }, "strict", z.ZodTypeAny, {
477
+ prospect: string;
478
+ company: string;
479
+ workspace: string;
480
+ company_brain: string;
481
+ vertical: string;
482
+ offers: string;
483
+ persona: string;
484
+ playbook: string;
485
+ qualification: string;
486
+ signals: string;
487
+ history: string;
488
+ crm: string;
343
489
  authorization: string;
490
+ }, {
491
+ prospect: string;
492
+ company: string;
344
493
  workspace: string;
345
- }>;
494
+ company_brain: string;
495
+ vertical: string;
496
+ offers: string;
497
+ persona: string;
498
+ playbook: string;
499
+ qualification: string;
500
+ signals: string;
501
+ history: string;
502
+ crm: string;
503
+ authorization: string;
504
+ }>>;
346
505
  }, "strict", z.ZodTypeAny, {
347
506
  contract_version: "agent-writing-context.v1";
348
507
  context_version: string;
349
508
  facts_version: string;
350
509
  read_at: string;
351
510
  versions: {
352
- identity: string;
511
+ workspace: string;
353
512
  qualification: string;
354
513
  signals: string;
514
+ authorization: string;
515
+ identity: string;
355
516
  conversation: string;
356
517
  contactState: string;
357
518
  exclusion: string;
358
- authorization: string;
359
- workspace: string;
360
519
  };
520
+ modules?: {
521
+ prospect: string;
522
+ company: string;
523
+ workspace: string;
524
+ company_brain: string;
525
+ vertical: string;
526
+ offers: string;
527
+ persona: string;
528
+ playbook: string;
529
+ qualification: string;
530
+ signals: string;
531
+ history: string;
532
+ crm: string;
533
+ authorization: string;
534
+ } | undefined;
361
535
  }, {
362
536
  contract_version: "agent-writing-context.v1";
363
537
  context_version: string;
364
538
  facts_version: string;
365
539
  read_at: string;
366
540
  versions: {
367
- identity: string;
541
+ workspace: string;
368
542
  qualification: string;
369
543
  signals: string;
544
+ authorization: string;
545
+ identity: string;
370
546
  conversation: string;
371
547
  contactState: string;
372
548
  exclusion: string;
373
- authorization: string;
374
- workspace: string;
375
549
  };
550
+ modules?: {
551
+ prospect: string;
552
+ company: string;
553
+ workspace: string;
554
+ company_brain: string;
555
+ vertical: string;
556
+ offers: string;
557
+ persona: string;
558
+ playbook: string;
559
+ qualification: string;
560
+ signals: string;
561
+ history: string;
562
+ crm: string;
563
+ authorization: string;
564
+ } | undefined;
376
565
  }>;
377
566
  authorization_revision: z.ZodNumber;
378
567
  messages: z.ZodArray<z.ZodEffects<z.ZodObject<{
@@ -468,15 +657,30 @@ export declare const decision: z.ZodEffects<z.ZodObject<{
468
657
  facts_version: string;
469
658
  read_at: string;
470
659
  versions: {
471
- identity: string;
660
+ workspace: string;
472
661
  qualification: string;
473
662
  signals: string;
663
+ authorization: string;
664
+ identity: string;
474
665
  conversation: string;
475
666
  contactState: string;
476
667
  exclusion: string;
477
- authorization: string;
478
- workspace: string;
479
668
  };
669
+ modules?: {
670
+ prospect: string;
671
+ company: string;
672
+ workspace: string;
673
+ company_brain: string;
674
+ vertical: string;
675
+ offers: string;
676
+ persona: string;
677
+ playbook: string;
678
+ qualification: string;
679
+ signals: string;
680
+ history: string;
681
+ crm: string;
682
+ authorization: string;
683
+ } | undefined;
480
684
  };
481
685
  authorization_revision: number;
482
686
  messages: {
@@ -511,15 +715,30 @@ export declare const decision: z.ZodEffects<z.ZodObject<{
511
715
  facts_version: string;
512
716
  read_at: string;
513
717
  versions: {
514
- identity: string;
718
+ workspace: string;
515
719
  qualification: string;
516
720
  signals: string;
721
+ authorization: string;
722
+ identity: string;
517
723
  conversation: string;
518
724
  contactState: string;
519
725
  exclusion: string;
520
- authorization: string;
521
- workspace: string;
522
726
  };
727
+ modules?: {
728
+ prospect: string;
729
+ company: string;
730
+ workspace: string;
731
+ company_brain: string;
732
+ vertical: string;
733
+ offers: string;
734
+ persona: string;
735
+ playbook: string;
736
+ qualification: string;
737
+ signals: string;
738
+ history: string;
739
+ crm: string;
740
+ authorization: string;
741
+ } | undefined;
523
742
  };
524
743
  authorization_revision: number;
525
744
  messages: {
@@ -554,15 +773,30 @@ export declare const decision: z.ZodEffects<z.ZodObject<{
554
773
  facts_version: string;
555
774
  read_at: string;
556
775
  versions: {
557
- identity: string;
776
+ workspace: string;
558
777
  qualification: string;
559
778
  signals: string;
779
+ authorization: string;
780
+ identity: string;
560
781
  conversation: string;
561
782
  contactState: string;
562
783
  exclusion: string;
563
- authorization: string;
564
- workspace: string;
565
784
  };
785
+ modules?: {
786
+ prospect: string;
787
+ company: string;
788
+ workspace: string;
789
+ company_brain: string;
790
+ vertical: string;
791
+ offers: string;
792
+ persona: string;
793
+ playbook: string;
794
+ qualification: string;
795
+ signals: string;
796
+ history: string;
797
+ crm: string;
798
+ authorization: string;
799
+ } | undefined;
566
800
  };
567
801
  authorization_revision: number;
568
802
  messages: {
@@ -597,15 +831,30 @@ export declare const decision: z.ZodEffects<z.ZodObject<{
597
831
  facts_version: string;
598
832
  read_at: string;
599
833
  versions: {
600
- identity: string;
834
+ workspace: string;
601
835
  qualification: string;
602
836
  signals: string;
837
+ authorization: string;
838
+ identity: string;
603
839
  conversation: string;
604
840
  contactState: string;
605
841
  exclusion: string;
606
- authorization: string;
607
- workspace: string;
608
842
  };
843
+ modules?: {
844
+ prospect: string;
845
+ company: string;
846
+ workspace: string;
847
+ company_brain: string;
848
+ vertical: string;
849
+ offers: string;
850
+ persona: string;
851
+ playbook: string;
852
+ qualification: string;
853
+ signals: string;
854
+ history: string;
855
+ crm: string;
856
+ authorization: string;
857
+ } | undefined;
609
858
  };
610
859
  authorization_revision: number;
611
860
  messages: {
@@ -878,54 +1127,127 @@ export declare const submitSchema: z.ZodObject<{
878
1127
  authorization: z.ZodString;
879
1128
  workspace: z.ZodString;
880
1129
  }, "strict", z.ZodTypeAny, {
881
- identity: string;
1130
+ workspace: string;
882
1131
  qualification: string;
883
1132
  signals: string;
1133
+ authorization: string;
1134
+ identity: string;
884
1135
  conversation: string;
885
1136
  contactState: string;
886
1137
  exclusion: string;
887
- authorization: string;
888
- workspace: string;
889
1138
  }, {
890
- identity: string;
1139
+ workspace: string;
891
1140
  qualification: string;
892
1141
  signals: string;
1142
+ authorization: string;
1143
+ identity: string;
893
1144
  conversation: string;
894
1145
  contactState: string;
895
1146
  exclusion: string;
1147
+ }>;
1148
+ modules: z.ZodOptional<z.ZodObject<{
1149
+ prospect: z.ZodString;
1150
+ company: z.ZodString;
1151
+ workspace: z.ZodString;
1152
+ company_brain: z.ZodString;
1153
+ vertical: z.ZodString;
1154
+ offers: z.ZodString;
1155
+ persona: z.ZodString;
1156
+ playbook: z.ZodString;
1157
+ qualification: z.ZodString;
1158
+ signals: z.ZodString;
1159
+ history: z.ZodString;
1160
+ crm: z.ZodString;
1161
+ authorization: z.ZodString;
1162
+ }, "strict", z.ZodTypeAny, {
1163
+ prospect: string;
1164
+ company: string;
1165
+ workspace: string;
1166
+ company_brain: string;
1167
+ vertical: string;
1168
+ offers: string;
1169
+ persona: string;
1170
+ playbook: string;
1171
+ qualification: string;
1172
+ signals: string;
1173
+ history: string;
1174
+ crm: string;
896
1175
  authorization: string;
1176
+ }, {
1177
+ prospect: string;
1178
+ company: string;
897
1179
  workspace: string;
898
- }>;
1180
+ company_brain: string;
1181
+ vertical: string;
1182
+ offers: string;
1183
+ persona: string;
1184
+ playbook: string;
1185
+ qualification: string;
1186
+ signals: string;
1187
+ history: string;
1188
+ crm: string;
1189
+ authorization: string;
1190
+ }>>;
899
1191
  }, "strict", z.ZodTypeAny, {
900
1192
  contract_version: "agent-writing-context.v1";
901
1193
  context_version: string;
902
1194
  facts_version: string;
903
1195
  read_at: string;
904
1196
  versions: {
905
- identity: string;
1197
+ workspace: string;
906
1198
  qualification: string;
907
1199
  signals: string;
1200
+ authorization: string;
1201
+ identity: string;
908
1202
  conversation: string;
909
1203
  contactState: string;
910
1204
  exclusion: string;
911
- authorization: string;
912
- workspace: string;
913
1205
  };
1206
+ modules?: {
1207
+ prospect: string;
1208
+ company: string;
1209
+ workspace: string;
1210
+ company_brain: string;
1211
+ vertical: string;
1212
+ offers: string;
1213
+ persona: string;
1214
+ playbook: string;
1215
+ qualification: string;
1216
+ signals: string;
1217
+ history: string;
1218
+ crm: string;
1219
+ authorization: string;
1220
+ } | undefined;
914
1221
  }, {
915
1222
  contract_version: "agent-writing-context.v1";
916
1223
  context_version: string;
917
1224
  facts_version: string;
918
1225
  read_at: string;
919
1226
  versions: {
920
- identity: string;
1227
+ workspace: string;
921
1228
  qualification: string;
922
1229
  signals: string;
1230
+ authorization: string;
1231
+ identity: string;
923
1232
  conversation: string;
924
1233
  contactState: string;
925
1234
  exclusion: string;
926
- authorization: string;
927
- workspace: string;
928
1235
  };
1236
+ modules?: {
1237
+ prospect: string;
1238
+ company: string;
1239
+ workspace: string;
1240
+ company_brain: string;
1241
+ vertical: string;
1242
+ offers: string;
1243
+ persona: string;
1244
+ playbook: string;
1245
+ qualification: string;
1246
+ signals: string;
1247
+ history: string;
1248
+ crm: string;
1249
+ authorization: string;
1250
+ } | undefined;
929
1251
  }>;
930
1252
  authorization_revision: z.ZodNumber;
931
1253
  messages: z.ZodArray<z.ZodEffects<z.ZodObject<{
@@ -1021,15 +1343,30 @@ export declare const submitSchema: z.ZodObject<{
1021
1343
  facts_version: string;
1022
1344
  read_at: string;
1023
1345
  versions: {
1024
- identity: string;
1346
+ workspace: string;
1025
1347
  qualification: string;
1026
1348
  signals: string;
1349
+ authorization: string;
1350
+ identity: string;
1027
1351
  conversation: string;
1028
1352
  contactState: string;
1029
1353
  exclusion: string;
1030
- authorization: string;
1031
- workspace: string;
1032
1354
  };
1355
+ modules?: {
1356
+ prospect: string;
1357
+ company: string;
1358
+ workspace: string;
1359
+ company_brain: string;
1360
+ vertical: string;
1361
+ offers: string;
1362
+ persona: string;
1363
+ playbook: string;
1364
+ qualification: string;
1365
+ signals: string;
1366
+ history: string;
1367
+ crm: string;
1368
+ authorization: string;
1369
+ } | undefined;
1033
1370
  };
1034
1371
  authorization_revision: number;
1035
1372
  messages: {
@@ -1064,15 +1401,30 @@ export declare const submitSchema: z.ZodObject<{
1064
1401
  facts_version: string;
1065
1402
  read_at: string;
1066
1403
  versions: {
1067
- identity: string;
1404
+ workspace: string;
1068
1405
  qualification: string;
1069
1406
  signals: string;
1407
+ authorization: string;
1408
+ identity: string;
1070
1409
  conversation: string;
1071
1410
  contactState: string;
1072
1411
  exclusion: string;
1073
- authorization: string;
1074
- workspace: string;
1075
1412
  };
1413
+ modules?: {
1414
+ prospect: string;
1415
+ company: string;
1416
+ workspace: string;
1417
+ company_brain: string;
1418
+ vertical: string;
1419
+ offers: string;
1420
+ persona: string;
1421
+ playbook: string;
1422
+ qualification: string;
1423
+ signals: string;
1424
+ history: string;
1425
+ crm: string;
1426
+ authorization: string;
1427
+ } | undefined;
1076
1428
  };
1077
1429
  authorization_revision: number;
1078
1430
  messages: {
@@ -1107,15 +1459,30 @@ export declare const submitSchema: z.ZodObject<{
1107
1459
  facts_version: string;
1108
1460
  read_at: string;
1109
1461
  versions: {
1110
- identity: string;
1462
+ workspace: string;
1111
1463
  qualification: string;
1112
1464
  signals: string;
1465
+ authorization: string;
1466
+ identity: string;
1113
1467
  conversation: string;
1114
1468
  contactState: string;
1115
1469
  exclusion: string;
1116
- authorization: string;
1117
- workspace: string;
1118
1470
  };
1471
+ modules?: {
1472
+ prospect: string;
1473
+ company: string;
1474
+ workspace: string;
1475
+ company_brain: string;
1476
+ vertical: string;
1477
+ offers: string;
1478
+ persona: string;
1479
+ playbook: string;
1480
+ qualification: string;
1481
+ signals: string;
1482
+ history: string;
1483
+ crm: string;
1484
+ authorization: string;
1485
+ } | undefined;
1119
1486
  };
1120
1487
  authorization_revision: number;
1121
1488
  messages: {
@@ -1150,15 +1517,30 @@ export declare const submitSchema: z.ZodObject<{
1150
1517
  facts_version: string;
1151
1518
  read_at: string;
1152
1519
  versions: {
1153
- identity: string;
1520
+ workspace: string;
1154
1521
  qualification: string;
1155
1522
  signals: string;
1523
+ authorization: string;
1524
+ identity: string;
1156
1525
  conversation: string;
1157
1526
  contactState: string;
1158
1527
  exclusion: string;
1159
- authorization: string;
1160
- workspace: string;
1161
1528
  };
1529
+ modules?: {
1530
+ prospect: string;
1531
+ company: string;
1532
+ workspace: string;
1533
+ company_brain: string;
1534
+ vertical: string;
1535
+ offers: string;
1536
+ persona: string;
1537
+ playbook: string;
1538
+ qualification: string;
1539
+ signals: string;
1540
+ history: string;
1541
+ crm: string;
1542
+ authorization: string;
1543
+ } | undefined;
1162
1544
  };
1163
1545
  authorization_revision: number;
1164
1546
  messages: {
@@ -1199,15 +1581,30 @@ export declare const submitSchema: z.ZodObject<{
1199
1581
  facts_version: string;
1200
1582
  read_at: string;
1201
1583
  versions: {
1202
- identity: string;
1584
+ workspace: string;
1203
1585
  qualification: string;
1204
1586
  signals: string;
1587
+ authorization: string;
1588
+ identity: string;
1205
1589
  conversation: string;
1206
1590
  contactState: string;
1207
1591
  exclusion: string;
1208
- authorization: string;
1209
- workspace: string;
1210
1592
  };
1593
+ modules?: {
1594
+ prospect: string;
1595
+ company: string;
1596
+ workspace: string;
1597
+ company_brain: string;
1598
+ vertical: string;
1599
+ offers: string;
1600
+ persona: string;
1601
+ playbook: string;
1602
+ qualification: string;
1603
+ signals: string;
1604
+ history: string;
1605
+ crm: string;
1606
+ authorization: string;
1607
+ } | undefined;
1211
1608
  };
1212
1609
  authorization_revision: number;
1213
1610
  messages: {
@@ -1246,15 +1643,30 @@ export declare const submitSchema: z.ZodObject<{
1246
1643
  facts_version: string;
1247
1644
  read_at: string;
1248
1645
  versions: {
1249
- identity: string;
1646
+ workspace: string;
1250
1647
  qualification: string;
1251
1648
  signals: string;
1649
+ authorization: string;
1650
+ identity: string;
1252
1651
  conversation: string;
1253
1652
  contactState: string;
1254
1653
  exclusion: string;
1255
- authorization: string;
1256
- workspace: string;
1257
1654
  };
1655
+ modules?: {
1656
+ prospect: string;
1657
+ company: string;
1658
+ workspace: string;
1659
+ company_brain: string;
1660
+ vertical: string;
1661
+ offers: string;
1662
+ persona: string;
1663
+ playbook: string;
1664
+ qualification: string;
1665
+ signals: string;
1666
+ history: string;
1667
+ crm: string;
1668
+ authorization: string;
1669
+ } | undefined;
1258
1670
  };
1259
1671
  authorization_revision: number;
1260
1672
  messages: {
@@ -1362,19 +1774,34 @@ export declare function decisionBody(d: z.infer<typeof decision>): {
1362
1774
  url: string;
1363
1775
  }[];
1364
1776
  context: {
1777
+ modules?: {
1778
+ prospect: string;
1779
+ company: string;
1780
+ workspace: string;
1781
+ company_brain: string;
1782
+ vertical: string;
1783
+ offers: string;
1784
+ persona: string;
1785
+ playbook: string;
1786
+ qualification: string;
1787
+ signals: string;
1788
+ history: string;
1789
+ crm: string;
1790
+ authorization: string;
1791
+ } | undefined;
1365
1792
  contractVersion: "agent-writing-context.v1";
1366
1793
  contextVersion: string;
1367
1794
  factsVersion: string;
1368
1795
  readAt: string;
1369
1796
  versions: {
1370
- identity: string;
1797
+ workspace: string;
1371
1798
  qualification: string;
1372
1799
  signals: string;
1800
+ authorization: string;
1801
+ identity: string;
1373
1802
  conversation: string;
1374
1803
  contactState: string;
1375
1804
  exclusion: string;
1376
- authorization: string;
1377
- workspace: string;
1378
1805
  };
1379
1806
  };
1380
1807
  authorizationRevision: number;
@@ -22,11 +22,16 @@ export const filters = z.object({
22
22
  counts: z.array(count).max(6).optional(), never_on: z.array(target).max(3).optional(),
23
23
  pending: z.boolean().optional(), unknown: z.boolean().optional(), reply: z.enum(["TO_HANDLE", "WAITING", "NONE"]).optional(), excluded: z.boolean().optional(),
24
24
  }).strict();
25
+ // PRD-2632 : one fingerprint per module, copied from get_outreach_context_summary.decisionContext.modules.
26
+ export const contextModules = z.object({ prospect: version, company: version, workspace: version, company_brain: version, vertical: version, offers: version,
27
+ persona: version, playbook: version, qualification: version, signals: version, history: version, crm: version, authorization: version }).strict();
25
28
  export const context = z.object({
26
29
  contract_version: z.literal("agent-writing-context.v1"), context_version: version, facts_version: version, read_at: date,
27
30
  versions: z.object({ identity: version, qualification: version, signals: version, conversation: version,
28
31
  contactState: version, exclusion: version, authorization: version, workspace: version }).strict()
29
- .describe("Copy the versions object from get_outreach_prospect_context unchanged, including contactState."),
32
+ .describe("Copy the versions object from get_outreach_context_summary (or get_outreach_prospect_context) unchanged, including contactState."),
33
+ modules: contextModules.optional()
34
+ .describe("Copy decisionContext.modules from get_outreach_context_summary unchanged, all 13 fingerprints. Always send it when you wrote from modules: Leadify then refuses the decision, naming the modules, if one changed after you read it."),
30
35
  }).strict();
31
36
  export const message = z.object({
32
37
  channel, action: z.enum(["MESSAGE", "INVITATION"]), sender_id: identifier, account_key: z.string().min(1).max(1000),
@@ -89,7 +94,7 @@ export function queryBody(v) {
89
94
  export function decisionBody(d) {
90
95
  return { ...(d.agent_cycle_id !== undefined ? { agentCycleId: d.agent_cycle_id } : {}), requestKey: d.request_key, leadId: d.lead_id, personId: d.person_id, purpose: d.purpose, reason: d.reason, sources: d.sources,
91
96
  context: { contractVersion: d.context.contract_version, contextVersion: d.context.context_version, factsVersion: d.context.facts_version,
92
- readAt: d.context.read_at, versions: d.context.versions }, authorizationRevision: d.authorization_revision,
97
+ readAt: d.context.read_at, versions: d.context.versions, ...(d.context.modules ? { modules: d.context.modules } : {}) }, authorizationRevision: d.authorization_revision,
93
98
  messages: d.messages.map(m => ({ channel: m.channel, action: m.action, senderId: m.sender_id, accountKey: m.account_key,
94
99
  recipient: m.recipient, subject: m.subject, body: m.body, threadId: m.thread_id, expectedInboundId: m.expected_inbound_id, technicalParts: m.technical_parts })) };
95
100
  }
@@ -1,4 +1,4 @@
1
- import { OUTREACH_MCP_CONTRACT, OUTREACH_SERVER_CONTRACTS, OUTREACH_TOOL_NAMES, requireOutreachVersion, outreachError } from "./agent_outreach.js";
1
+ import { OUTREACH_MCP_CONTRACT, OUTREACH_SERVER_CONTRACTS, OUTREACH_TOOL_NAMES, OUTREACH_CONTEXT_MODULES, requireOutreachVersion, outreachError } from "./agent_outreach.js";
2
2
  import { getClient } from "../client.js";
3
3
  import { toolResult, handleToolError } from "../types.js";
4
4
  import { z } from "zod";
@@ -13,7 +13,7 @@ export function projectMcpRuntimeInfo(data, organizationId) {
13
13
  version: MCP_VERSION,
14
14
  organization: organization ? { id: organization.id, name: organization.name ?? null, slug: organization.slug ?? null } : null,
15
15
  organizationAccessible: Boolean(organization),
16
- outreach: { contract: OUTREACH_MCP_CONTRACT, tools: OUTREACH_TOOL_NAMES, expectedServerContracts: OUTREACH_SERVER_CONTRACTS, serverCompatibility: "NOT_CHECKED", administrativeAuthority: false },
16
+ outreach: { contract: OUTREACH_MCP_CONTRACT, tools: OUTREACH_TOOL_NAMES, contextModules: OUTREACH_CONTEXT_MODULES, expectedServerContracts: OUTREACH_SERVER_CONTRACTS, serverCompatibility: "NOT_CHECKED", administrativeAuthority: false },
17
17
  readOnly: true,
18
18
  writes: 0,
19
19
  sends: 0,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@agifyai/leadify-mcp",
3
- "version": "9.7.2",
3
+ "version": "9.8.0",
4
4
  "description": "MCP server for Leadify lead management API",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",