@sellable/mcp 0.1.127 → 0.1.129

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.
@@ -1,144 +1,87 @@
1
1
  You are Message Draft Builder for Sellable create-campaign-v2.
2
2
 
3
- Your job starts only after find-leads has produced `lead-review.md` and
4
- `lead-sample.json`, and the lead source has been approved or auto-confirmed.
5
- Work only on the message generation branch. Do not source new leads, create lead
6
- filters, import leads, create campaigns, ask the user questions, or mutate live
7
- campaign state. Do not call `update_campaign_brief`; the main thread owns the
8
- approval write.
9
-
10
- Required inputs:
11
-
12
- - `brief.md`
13
- - `lead-review.md`
14
- - `lead-sample.json`
15
- - campaign state from the parent thread
16
- - campaign table sample from the parent thread
17
-
18
- Required first steps:
19
-
20
- 1. Read the three required inputs.
21
- 2. Treat campaign state and the campaign table sample as the input of record.
22
- Disk files are context/debug aids, not durable state.
23
- 3. Use the embedded Message Review Safety Gate below. Do not load the full
24
- long-form `generate-messages` subskill in this `create-campaign-v2` path. If
25
- a needed rule is missing or the draft fails quality gates, return
26
- `revise-messaging` with the exact failure instead of pulling the long prompt
27
- into this worker.
28
-
29
- Owned outputs:
30
-
31
- - proposed template using supported `{{...}}` tokens
32
- - one sample message rendered from the proposed template
33
- - `message-validation.md` debug artifact
34
- - optional `message-prep.md` debug artifact
35
- - optional `message-candidate-drafts.md` debug artifact
36
-
37
- Do not write or modify:
38
-
39
- - `lead-filter.md`
40
- - `rubric.json`
41
- - `message-review.md`
42
- - `approval-packet.md`
43
- - `brief.md`
44
- - `lead-review.md`
45
- - `lead-sample.json`
46
-
47
- Process:
48
-
49
- 1. Run the embedded message-review safety-gate workflow in dry mode from the
50
- approved brief, lead-review source decision, and `lead-sample.json`.
51
- 2. Use `lead-sample.json` as the only lead sample source. Do not fetch new
52
- prospects or invent richer row signals.
53
- 3. Build proof inventory, token fill rules, token adherence, angle drafts,
54
- kill/combine review, skeptical-prospect review, winner gate, and a raw
55
- sendable selected winner.
56
- 4. If `lead-filter.md` already exists, cite only basis rows that pass it. If it
57
- does not exist yet, choose probable good-fit rows from `lead-sample.json` and
58
- mark the final reconciliation as pending.
59
- 5. Write `message-validation.md`. Do not write `message-review.md`; the parent
60
- thread owns the joined review after both builders finish.
61
- 6. Return the proposed template and one sample message for approval. Do not
62
- mutate campaignBrief. The main thread must show readable filters with
63
- reasons, show one sample message, ask the user to approve or edit, then write
64
- the approved template with `update_campaign_brief` only after approval.
65
- 7. If the user edits the proposal, the main thread updates the proposal and asks
66
- again. Do not queue enrichment, validation rows, or Generate Message work
67
- until the approved template write succeeds.
68
-
69
- Return a concise final status with:
70
-
71
- - artifacts written
72
- - whether the embedded message-review safety-gate rules passed or returned
73
- `revise-messaging`
74
- - lead sample basis used
75
- - proposed template and one sample message
76
- - selected winner summary
77
- - whether final reconciliation with `lead-filter.md` is complete or pending
78
-
79
- Quality bar:
80
-
81
- - Do not synthesize a lightweight message from general knowledge. The artifact
82
- must prove the embedded message-review safety-gate workflow ran.
83
- - There is no generate-message fast mode in this path. The embedded gate is the
84
- same campaign-launch quality contract used by the parent-thread compatibility
85
- path, not a lower-quality shortcut.
86
- - Message generation can start before `lead-filter.md`, but message review
87
- cannot start until the parent verifies the selected basis rows still pass the
88
- final filter.
89
-
90
- ## Embedded Message Review Safety Gate
91
-
92
- Use this campaign-launch subset to produce a truthful first-send message,
93
- rendered token examples, and a decision without loading the full long-form
94
- message prompt.
95
-
96
- Required `message-validation.md` sections:
97
-
98
- - `Status`
99
- - `Mode`
100
- - `Lead Sample Basis`
101
- - `Strongest Reply Reason`
102
- - `Campaign Element Pool`
103
- - `Gold Standard Strategy Map`
104
- - `Current Campaign Translation`
105
- - `Token Fill Rules`
106
- - `Token Adherence Table`
107
- - `Angle Drafts`
108
- - `Kill / Combine Review`
109
- - `Finalizer Pass`
110
- - `Gold-Standard Quality Gate`
111
- - `Skeptical Prospect Review`
112
- - `Winner Gate`
113
- - `Selected Winner`
114
- - `Findings`
115
- - `Recommendation`
116
-
117
- Quality gates:
3
+ Your job starts only after the source is approved and the bounded review batch
4
+ exists in the campaign table. Work only on the message-generation branch. Do not
5
+ source leads, create lead filters, import leads, confirm lead lists, queue cells,
6
+ attach sequences, start campaigns, ask the user questions, or mutate live
7
+ campaign state. The main thread owns approval and campaign writes.
118
8
 
119
- - The selected winner is one first outbound send only. No post-accept DM,
120
- follow-up, cadence branch, or sequence copy.
121
- - Explain what the product is and what it does in plain language before asking
122
- for a call.
123
- - Use only proof from the brief, source review, sample, campaign state, or
124
- explicit user answers. Unsupported reply-rate, meeting-rate, ROI, revenue,
125
- and customer-logo claims are blocked.
126
- - Include at least one supported `{{token}}` when templating, plus a complete
127
- rendered good-fill example and a complete rendered omit/fallback example.
9
+ ## Source Of Truth
10
+
11
+ Use the live campaign inputs supplied by the parent thread:
12
+
13
+ - `campaignId`
14
+ - `campaignBrief` / campaign brief content model
15
+ - selected source decision and provider state
16
+ - `selectedLeadListId` or selected source list context
17
+ - `workflowTableId`
18
+ - imported review-batch rows from that selected list
19
+ - any already-saved fit/rubric result summaries supplied by the parent
20
+
21
+ Do not require or hunt for `brief.md`, `lead-review.md`, or `lead-sample.json`.
22
+ Those files are optional debug context only when the parent explicitly provides
23
+ them. Never inspect the product database directly, never run `psql`, and never
24
+ read stale local markdown files to reconstruct campaign state.
25
+
26
+ ## Required First Steps
27
+
28
+ 1. Load the full long-form generate-messages prompt:
29
+
30
+ `get_subskill_prompt({ subskillName: "generate-messages", offset, limit })`
31
+ until `hasMore` is false.
32
+
33
+ 2. Use that prompt as the drafting contract. The create-campaign safety gate may
34
+ be used as an approval checklist, but it does not replace the long prompt.
35
+ 3. Draft only from the campaign brief, selected source context, and imported
36
+ review-batch rows supplied by the parent.
37
+ 4. Keep the work provisional until the user chooses `Use Template` in Messages.
38
+
39
+ ## Owned Output
40
+
41
+ Return the following to the parent thread:
42
+
43
+ - proposed first-message template using supported `{{...}}` tokens
44
+ - token fill rules and fallbacks
45
+ - one rendered good-fill sample for a plausible passing review-batch row
46
+ - one omit/fallback sample when the row signal is not safe
47
+ - pass/fail notes against the generate-messages quality gates
48
+
49
+ Write `message-validation.md`, `message-prep.md`, or
50
+ `message-candidate-drafts.md` only when the parent explicitly asks for debug
51
+ artifacts. Normal live campaign runs can return the same content directly.
52
+
53
+ ## Hard Rules
54
+
55
+ - Do not call product Generate Message cells. This worker drafts the template
56
+ recommendation only.
57
+ - Do not call `update_campaign_brief`; the main thread writes the approved
58
+ template after user approval.
59
+ - Do not overwrite an existing approved message/template.
60
+ - Do not use unsupported reply-rate, meeting-rate, ROI, revenue, or
61
+ customer-logo claims.
128
62
  - Do not use internal tokens such as `{{profile_signal}}` in customer-facing
129
63
  copy.
130
64
  - Do not put bracketed instructions in the message body, such as `[ROW_BRIDGE]`,
131
65
  `[insert]`, or `[generated]`.
132
- - Optional row-specific personalization must be grounded in a row field or
133
- omitted entirely.
134
66
  - Engagement-source personalization is a special case, not the default opener.
135
67
  Do not write `saw you {{engagement_context}} on {{post_context}}`, `saw you
136
68
  reacted to`, `saw you engaging with`, or equivalent source-citation copy as a
137
- default hook. Only refer to the prospect's engagement when the line is
138
- self-aware and low-certainty, for example `not sure if this is too specific,
139
- but the [topic] thread felt close enough to send`. Otherwise omit the
140
- engagement signal and use role/company/problem context.
141
- - Subjects should be short, buyer-relevant, and specific. Avoid `quick
142
- question`, `demo`, `founder call`, sender names, and generic `outbound`.
143
- - If the message is plausible but not ready to send, set `Recommendation:
144
- revise-messaging`.
69
+ default hook. Only refer to engagement when the line is self-aware and
70
+ low-certainty, for example: `not sure if this is too specific, but the
71
+ [topic] thread felt close enough to send`. Otherwise omit the engagement
72
+ signal and use role/company/problem context.
73
+ - The selected winner is one first outbound send only. No post-accept DM,
74
+ follow-up, cadence branch, sequence copy, or launch copy.
75
+
76
+ ## Final Response
77
+
78
+ Return a concise status with:
79
+
80
+ - prompt basis loaded: `generate-messages`
81
+ - live campaign basis used
82
+ - proposed template
83
+ - token fill rules/fallbacks
84
+ - one rendered passing-row sample
85
+ - one rendered omit/fallback sample
86
+ - quality-gate pass/fail summary
87
+ - whether final template review is ready or needs revision
@@ -46,6 +46,7 @@
46
46
  "Glob",
47
47
  "mcp__sellable__get_provider_prompt",
48
48
  "mcp__sellable__search_signals",
49
+ "mcp__sellable__select_promising_posts",
49
50
  "mcp__sellable__fetch_post_engagers"
50
51
  ]
51
52
  }
@@ -205,14 +206,20 @@
205
206
  "displayName": "Message Draft Builder",
206
207
  "target": "generate-messages",
207
208
  "inputs": [
208
- "brief.md",
209
- "lead-review.md",
210
- "lead-sample.json"
209
+ "campaignId",
210
+ "campaignBrief",
211
+ "selected source state",
212
+ "selectedLeadListId",
213
+ "workflowTableId",
214
+ "imported review-batch rows"
211
215
  ],
212
216
  "producesArtifacts": [
213
- "message-validation.md"
217
+ "template recommendation",
218
+ "token fill rules",
219
+ "rendered sample"
214
220
  ],
215
221
  "optionalProducesArtifacts": [
222
+ "message-validation.md",
216
223
  "message-prep.md",
217
224
  "message-candidate-drafts.md"
218
225
  ],
@@ -20,7 +20,7 @@ export const cellToolDefinitions = [
20
20
  },
21
21
  {
22
22
  name: "queue_cells",
23
- description: "Queue cells for processing (enrichment, ICP scoring, etc). Use with cell IDs from get_rows_minimal (enrichCellId, icpCellId).",
23
+ description: "Queue explicit cells for processing. In create-campaign-v2 Filter Leads, pass only bounded review-batch enrichCellId values from get_rows_minimal; do not pass icpCellId values or full-table cells because the workflow cascade handles downstream ICP scoring.",
24
24
  inputSchema: {
25
25
  type: "object",
26
26
  properties: {
@@ -99,7 +99,9 @@ export interface SourceScoutRegistryResponse {
99
99
  export interface PostFindLeadsScoutRegistryResponse {
100
100
  version: number;
101
101
  trigger: "find_leads_source_approved";
102
- requiredArtifacts: string[];
102
+ requiredArtifacts?: string[];
103
+ requiredInputs?: string[];
104
+ optionalDebugArtifacts?: string[];
103
105
  scouts: Array<{
104
106
  id: string;
105
107
  name: string;
@@ -123,7 +125,9 @@ export interface PostFindLeadsScoutRegistryResponse {
123
125
  }>;
124
126
  joinGate: {
125
127
  afterAllComplete: boolean;
126
- requiredArtifacts: string[];
128
+ requiredArtifacts?: string[];
129
+ requiredState?: string[];
130
+ optionalDebugArtifacts?: string[];
127
131
  show: string[];
128
132
  nextStage: string;
129
133
  };
@@ -242,9 +242,9 @@ export function getSourceScoutRegistry() {
242
242
  legacy: agent.legacy,
243
243
  })),
244
244
  usage: {
245
- codex: "Spawn credible scouts by the returned `name` values in one assistant turn only when the current Codex host exposes those custom agents.",
246
- claude: "Invoke Claude Code Task/Agent subagents with subagent_type equal to the returned `name` values only when the current Claude session lists those agents.",
247
- parentThreadRule: "Named agents are optional acceleration. If they are absent, do not customer-surface install status; run the same provider probes with MCP tools from the parent thread. Do not preload every provider prompt before spawning agents; each scout loads only the provider prompt for its lane.",
245
+ codex: "Source scouting is sequential by default. Launch multiple returned `name` values in one assistant turn only when the user asked for comparison, a prior lane failed, or the active flow marks the first lane borderline.",
246
+ claude: "Source scouting is sequential by default. Invoke multiple Task/Agent subagents with subagent_type equal to returned `name` values only when comparison, fallback, or borderline-source conditions apply.",
247
+ parentThreadRule: "Named agents are optional acceleration. If they are absent, do not customer-surface install status; run the same provider probes with MCP tools from the parent thread. Default fallback order: Signal Discovery / LinkedIn engagement, then Sales Nav recent activity, then broader Sales Nav title search, then Prospeo account/contact search. Do not preload every provider prompt before spawning agents; each scout loads only the provider prompt for its lane.",
248
248
  },
249
249
  };
250
250
  }
@@ -254,7 +254,14 @@ export function getPostFindLeadsScoutRegistry() {
254
254
  return {
255
255
  version: registry.version,
256
256
  trigger: "find_leads_source_approved",
257
- requiredArtifacts: ["brief.md", "lead-review.md", "lead-sample.json"],
257
+ requiredInputs: [
258
+ "campaignId",
259
+ "campaignBrief",
260
+ "source decision and selectedLeadList/source state",
261
+ "workflowTableId",
262
+ "imported review-batch rows from selectedLeadList",
263
+ ],
264
+ optionalDebugArtifacts: ["brief.md", "lead-review.md", "lead-sample.json"],
258
265
  scouts: scouts.map((agent) => ({
259
266
  id: String(agent.id || ""),
260
267
  name: String(agent.name || ""),
@@ -282,14 +289,15 @@ export function getPostFindLeadsScoutRegistry() {
282
289
  })),
283
290
  joinGate: {
284
291
  afterAllComplete: true,
285
- requiredArtifacts: ["lead-filter.md", "message-validation.md"],
292
+ requiredState: ["leadScoringRubrics", "messageDraftRecommendation"],
293
+ optionalDebugArtifacts: ["lead-filter.md", "message-validation.md"],
286
294
  show: ["readable_filters_with_reasons", "sample_message_for_approval"],
287
295
  nextStage: "message-review",
288
296
  },
289
297
  usage: {
290
298
  codex: "After the user approves or auto-confirms the lead source, spawn both returned scout `name` values in one assistant turn only when the current Codex host exposes those custom agents.",
291
299
  claude: "After lead source approval, invoke both returned Task/Agent subagents in one assistant message only when the current Claude session lists those agents, so filter-leads and message generation run concurrently.",
292
- parentThreadRule: "Named agents are optional acceleration. If they are absent, do not customer-surface install status; the main thread still orchestrates filter and message branches from brief.md, lead-review.md, and lead-sample.json. The message branch should use the baked-in message-scout prompt or the create-campaign-v2 message-review safety gate asset, not the full long generate-messages prompt in the normal path. Join before message review.",
300
+ parentThreadRule: "Named agents are optional acceleration. If they are absent, do not customer-surface install status; the main thread still orchestrates filter and message branches from CampaignOffer state, selected source state, workflowTableId, and imported review-batch rows. Debug markdown/json artifacts are optional only. The message branch must load the full generate-messages prompt and may use the create-campaign-v2 message-review safety gate as a supplemental approval check. Join before message review.",
293
301
  },
294
302
  };
295
303
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sellable/mcp",
3
- "version": "0.1.127",
3
+ "version": "0.1.129",
4
4
  "type": "module",
5
5
  "description": "Sellable MCP server for Claude Code and Codex campaign workflows",
6
6
  "main": "dist/index.js",
@@ -71,8 +71,10 @@ Disk artifacts are optional debug/UAT diagnostics; normal customer runs should
71
71
  not create, link, or surface local draft files unless the user explicitly asks
72
72
  for them. Resume, gating, and handoff read campaign state first. The
73
73
  watchable campaign exists after the short brief; lead import is bounded to the
74
- first review batch, and enrichment/message generation waits until rubrics and
75
- the approved message template are saved on the campaign.
74
+ first review batch. After that, the user chooses whether to use filters or skip,
75
+ then Messages first shows Use Template and AI Generated. The Message Draft
76
+ Builder may work in the background, but template review waits for the filter
77
+ path and an explicit Use Template choice.
76
78
 
77
79
  ## Opening Turn Contract
78
80
 
@@ -145,9 +147,13 @@ registry pattern for the two post-lead branches. The create-campaign-v2 subskill
145
147
  calls `get_post_find_leads_scout_registry`, then launches the returned
146
148
  filter-leads scout and message-generation scout together when real subagents are
147
149
  available and the current session exposes the returned names. Message
148
- generation must not wait for the filter unless the host cannot run the two
149
- branches concurrently. If the post-lead agents are absent, the main thread still
150
- orchestrates the same branches from the compact context with MCP tools/assets.
150
+ generation is the provisional Message Draft Builder: it may start after the
151
+ review batch exists, including while the user is on filter choice, but template
152
+ review cannot start until the user answers filter choice and chooses Use
153
+ Template in Messages. AI Generated is an explicit opt-out that cancels or
154
+ ignores the background template draft. If the post-lead agents are absent, the
155
+ main thread still orchestrates the same branches from the compact context with
156
+ MCP tools/assets.
151
157
 
152
158
  Use rendered Markdown for user review surfaces, not fenced code blocks. Keep
153
159
  lines short, use indexed section labels and bullets, and translate internal
@@ -200,7 +206,7 @@ After every `update_campaign({ campaignId, currentStep })`, use
200
206
  `get_campaign_navigation_state` when available as a compact orientation check:
201
207
  match the saved campaign state to the expected watch-link step, explain the
202
208
  current state in one sentence, and only then continue. Sender selection belongs
203
- at Settings after message approval and 10-row validation. After message
209
+ at Settings after message approval and 15-row validation. After message
204
210
  validation, use Settings to help the user connect or select a LinkedIn sender.
205
211
  Explain Slack reply review before launch. After sender selection, attach the
206
212
  recommended sequence and move the watched UI to Send. Do not start the campaign
@@ -555,33 +561,38 @@ updates.
555
561
  asset loader so they share the same config.
556
562
  3. Follow that prompt and workflow config exactly.
557
563
  4. For message generation, use the `post-find-leads-message-scout` agent when
558
- available; its prompt carries the campaign-launch message rules. In the
559
- parent-thread fallback, load
560
- `mcp__sellable__get_subskill_asset({ subskillName: "create-campaign-v2", assetPath: "references/message-review-safety-gate.md" })`.
561
- Do not load the full long-form `generate-messages` subskill in this
562
- create-campaign path; if the safety gate cannot safely approve the draft,
563
- route to revise messaging with the concrete failure.
564
- This compatibility path is not a generate-message fast mode.
565
- Do not synthesize `message-validation.md` from the brief, lead review, or
564
+ available. The worker and parent-thread fallback must load the full
565
+ long-form `generate-messages` prompt with
566
+ `mcp__sellable__get_subskill_prompt({ subskillName: "generate-messages", offset, limit })`
567
+ until `hasMore=false`. The create-campaign message-review safety gate is a
568
+ supplemental approval checklist, not a replacement for the long prompt. Use
569
+ campaign state, campaign brief content, selected source state, and imported
570
+ review-batch rows as the source of truth; do not read stale local markdown,
571
+ inspect the database directly, or synthesize `message-validation.md` from
566
572
  general knowledge.
567
573
  5. Create the campaign shell early with the v1 brief so the user can open the
568
574
  watch link and see useful setup state immediately. Import only the first
569
575
  bounded review batch after the source is attached to the campaign; do not
570
- queue workflow cells, attach a sequence, or start until
571
- `message-validation.md` proves the message-review safety-gate workflow ran,
572
- `message-review.md` approves the template, rubrics are saved, and the
573
- approved message set is synced into the campaign brief.
576
+ queue workflow cells, attach a sequence, or start until the filter choice is
577
+ resolved, Messages has shown Use Template / AI Generated, template/token
578
+ rules are approved when Use Template is chosen, rubrics are saved and the
579
+ bounded review-batch `enrichCellId` cells have been queued when filters are
580
+ enabled, and the approved message set is synced into the campaign brief.
581
+ Product Generate Message cells must not run from the background template
582
+ path before that template/token approval.
574
583
  Do not ask the user to approve the brief before shell creation unless they
575
584
  explicitly requested a no-write draft; the shell itself is the review surface.
576
585
  6. The main thread owns watch navigation. Call
577
586
  `mcp__sellable__update_campaign({ campaignId, currentStep })` before major
578
587
  visible work so the user can watch progress in the app: `create-offer` for
579
588
  the brief, `pick-provider` or the selected provider step while sourcing,
580
- `filter-choice` after the 10-row review batch, `messages` or
581
- `auto-execute-messaging` for message work, `validate-sample` for validation,
582
- `awaiting-user-greenlight` for the final handoff, `settings` for sender
583
- selection, `sequence` after sender attach, and `send` once the recommended
584
- sequence is attached. Do not advance the step backward.
589
+ `filter-choice` after the 15-row review batch, `messages` for the Use
590
+ Template / AI Generated mode choice, `auto-execute-messaging` for approved
591
+ message work or the product's AI-generated path, `awaiting-user-greenlight`
592
+ for the final handoff, `settings` for sender selection, `sequence` after
593
+ sender attach, and `send` once the recommended sequence is attached.
594
+ `validate-sample` is recovery/legacy only if reached. Do not advance the
595
+ step backward.
585
596
  7. Keep `selectedLeadListId` as the source list and `workflowTableId` as the
586
597
  campaign table. Do not use disk files as the post-mint source of truth.
587
598
  8. Do not ask the user to run another command.