@sellable/mcp 0.1.513 → 0.1.514
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/dist/refill-journal.d.ts +26 -0
- package/dist/refill-journal.js +69 -1
- package/dist/refill-local-state.d.ts +21 -0
- package/dist/refill-local-state.js +177 -1
- package/dist/refill-run-client.d.ts +62 -0
- package/dist/refill-run-client.js +101 -0
- package/dist/refill-run-loop.d.ts +100 -0
- package/dist/refill-run-loop.js +1238 -0
- package/dist/server.js +1 -1
- package/dist/tools/campaign-processing.js +3 -3
- package/dist/tools/evergreen-refill-plan.d.ts +6 -0
- package/dist/tools/evergreen-refill-plan.js +1 -1
- package/dist/tools/refill-executors.d.ts +178 -0
- package/dist/tools/refill-executors.js +788 -0
- package/dist/tools/refill-sends-v2.d.ts +94 -7
- package/dist/tools/refill-sends-v2.js +143 -30
- package/dist/tools/refill-sends.js +2 -657
- package/dist/tools/registry.d.ts +168 -0
- package/package.json +1 -1
- package/skills/refill-sends-v2/SKILL.md +113 -53
- package/skills/refill-sends-v2-workflow/SKILL.md +112 -101
- package/skills/refill-sends-v2-workflow/core/flow.v1.json +137 -31
|
@@ -1,9 +1,21 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": "v1.0",
|
|
3
3
|
"workflow": "refill-sends-v2-workflow",
|
|
4
|
-
"principle": "
|
|
5
|
-
"laneSources": [
|
|
6
|
-
|
|
4
|
+
"principle": "Execute refill sends v2 through a fenced run record: bootstrap, plan, execute, verify, and report. Dry runs stay read-only; real runs execute only packet-named bounded work.",
|
|
5
|
+
"laneSources": [
|
|
6
|
+
"managed_waterfall",
|
|
7
|
+
"dashboard_evergreen",
|
|
8
|
+
"active_campaign"
|
|
9
|
+
],
|
|
10
|
+
"terminalReasons": [
|
|
11
|
+
"complete",
|
|
12
|
+
"capped_by_scheduler",
|
|
13
|
+
"loaded_awaiting_scheduler",
|
|
14
|
+
"lanes_exhausted",
|
|
15
|
+
"blocked",
|
|
16
|
+
"no_refillable_campaigns",
|
|
17
|
+
"not_an_evergreen_workspace"
|
|
18
|
+
],
|
|
7
19
|
"blockers": ["workspace_access"],
|
|
8
20
|
"enumeratedRungs": [
|
|
9
21
|
"start_campaign",
|
|
@@ -11,16 +23,41 @@
|
|
|
11
23
|
"wait_for_active_work",
|
|
12
24
|
"enrich_more",
|
|
13
25
|
"reconcile_source_copy",
|
|
26
|
+
"rerun_errored_cells",
|
|
14
27
|
"add_leads_same_source",
|
|
15
28
|
"paid_lane_fallback",
|
|
16
29
|
"next_campaign",
|
|
17
30
|
"wait_for_scheduler",
|
|
18
31
|
"done"
|
|
19
32
|
],
|
|
33
|
+
"rungLabels": {
|
|
34
|
+
"start_campaign": "start the paused campaign so ready rows can schedule",
|
|
35
|
+
"approve_messages": "approve generated messages that are ready for review",
|
|
36
|
+
"wait_for_active_work": "wait for active campaign work to finish",
|
|
37
|
+
"enrich_more": "enrich the next batch of unenriched rows",
|
|
38
|
+
"reconcile_source_copy": "copy leads already found into the campaign table",
|
|
39
|
+
"add_leads_same_source": "find more leads via this campaign's original source",
|
|
40
|
+
"paid_lane_fallback": "move paid InMail demand to the connection fallback lane",
|
|
41
|
+
"next_campaign": "move to the next campaign in the lane",
|
|
42
|
+
"wait_for_scheduler": "wait for the scheduler to pick up ready rows",
|
|
43
|
+
"done": "finish the refill run",
|
|
44
|
+
"rerun_errored_cells": "re-run errored enrichment/message cells"
|
|
45
|
+
},
|
|
46
|
+
"hardRules": [
|
|
47
|
+
"dry-runs write journals only and never create run records",
|
|
48
|
+
"execute only the packet fingerprint captured at the last plan gate",
|
|
49
|
+
"validate packet coherence before dispatch; replan once, then block packet_incoherent",
|
|
50
|
+
"repair rungs come from the plan packet; the loop bounds and refuses, never self-emits repair actions",
|
|
51
|
+
"capped_by_scheduler is complete, never poll",
|
|
52
|
+
"awaiting scheduler is not an end state; window-closed reports name remaining-ready, expected pickup time, and resume handle",
|
|
53
|
+
"honest-rubric-fail means a human updates the rubric or changes lead source",
|
|
54
|
+
"source replenishment beyond same-source-automatic is a scoped create-campaign handoff, never refill-owned provider search",
|
|
55
|
+
"no campaign creation, provider-family switch, threshold lowering, scheduler writes, sends, archives, deletes, or brief/filter/message/sequence/sender mutation without a separate approval packet"
|
|
56
|
+
],
|
|
20
57
|
"requiredBootstrap": [
|
|
21
58
|
{
|
|
22
59
|
"tool": "get_auth_status",
|
|
23
|
-
"purpose": "Confirm MCP auth before reading workspace or
|
|
60
|
+
"purpose": "Confirm MCP auth before reading workspace or starting a refill run."
|
|
24
61
|
},
|
|
25
62
|
{
|
|
26
63
|
"tool": "get_active_workspace",
|
|
@@ -32,8 +69,8 @@
|
|
|
32
69
|
"workspaceId": "{workspaceId}"
|
|
33
70
|
},
|
|
34
71
|
"requiredOutput": [
|
|
35
|
-
"
|
|
36
|
-
"
|
|
72
|
+
"terminal, in_progress, blocked, or dry_run status",
|
|
73
|
+
"resume handle {runId, fence, gate} when in_progress"
|
|
37
74
|
]
|
|
38
75
|
},
|
|
39
76
|
{
|
|
@@ -61,10 +98,12 @@
|
|
|
61
98
|
"states",
|
|
62
99
|
"gateOrder",
|
|
63
100
|
"enumeratedRungs",
|
|
101
|
+
"rungLabels",
|
|
64
102
|
"verification",
|
|
65
103
|
"laneSources",
|
|
66
104
|
"terminalReasons",
|
|
67
|
-
"blockers"
|
|
105
|
+
"blockers",
|
|
106
|
+
"hardRules"
|
|
68
107
|
]
|
|
69
108
|
}
|
|
70
109
|
},
|
|
@@ -77,17 +116,17 @@
|
|
|
77
116
|
"requiredOutput": [
|
|
78
117
|
"planRevision or workspace_access blocker",
|
|
79
118
|
"stateRevision",
|
|
80
|
-
"packet",
|
|
81
|
-
"
|
|
119
|
+
"packet with supplyCensus/censusReason when available",
|
|
120
|
+
"pipelineDiagnosis checklist when blocked",
|
|
82
121
|
"sideEffects"
|
|
83
122
|
]
|
|
84
123
|
}
|
|
85
124
|
],
|
|
86
|
-
"gateOrder": ["bootstrap", "plan", "report"],
|
|
125
|
+
"gateOrder": ["bootstrap", "plan", "execute", "verify", "report"],
|
|
87
126
|
"states": [
|
|
88
127
|
{
|
|
89
128
|
"id": "bootstrap",
|
|
90
|
-
"description": "Load the
|
|
129
|
+
"description": "Load the command contract, workflow prompt, flow asset, and workspace facts. A real run starts or resumes a fenced run record; dryRun:true stays read-only and journal-only.",
|
|
91
130
|
"allowedTools": [
|
|
92
131
|
"get_auth_status",
|
|
93
132
|
"get_active_workspace",
|
|
@@ -121,12 +160,14 @@
|
|
|
121
160
|
}
|
|
122
161
|
],
|
|
123
162
|
"transitions": {
|
|
124
|
-
"contract_loaded": "plan"
|
|
163
|
+
"contract_loaded": "plan",
|
|
164
|
+
"resume_handle_loaded": "verify",
|
|
165
|
+
"dry_run_requested": "report"
|
|
125
166
|
}
|
|
126
167
|
},
|
|
127
168
|
{
|
|
128
169
|
"id": "plan",
|
|
129
|
-
"description": "
|
|
170
|
+
"description": "Read a fresh get_refill_plan_v2 packet with runState fed back from the run record. The loop captures planRevision, stateRevision, and targetShapeRevision, then validates packet coherence before dispatch. The packet's supplyCensus, censusReason, and pipelineDiagnosis checklist explain the rung choice. If packet_incoherent appears, replan once; a second incoherent packet blocks.",
|
|
130
171
|
"allowedTools": ["get_refill_plan_v2"],
|
|
131
172
|
"onEnter": [
|
|
132
173
|
{
|
|
@@ -142,12 +183,12 @@
|
|
|
142
183
|
}
|
|
143
184
|
],
|
|
144
185
|
"requiredOutput": [
|
|
145
|
-
"sideEffects all false",
|
|
146
186
|
"planRevision starts with pr1: unless blocker is workspace_access",
|
|
147
|
-
"
|
|
148
|
-
"chosen evergreenRung is in enumeratedRungs",
|
|
149
|
-
"
|
|
150
|
-
"
|
|
187
|
+
"stateRevision and targetShapeRevision captured",
|
|
188
|
+
"chosen label (evergreenRung token) is in enumeratedRungs",
|
|
189
|
+
"supplyCensus and censusReason justify prep/source/repair choices",
|
|
190
|
+
"pipelineDiagnosis checklist names firstFailing when blocked",
|
|
191
|
+
"terminal doneReason maps to terminalReasons"
|
|
151
192
|
],
|
|
152
193
|
"allowedRungsSource": "enumeratedRungs",
|
|
153
194
|
"doNotAllow": [
|
|
@@ -229,17 +270,79 @@
|
|
|
229
270
|
"upsert_rubric"
|
|
230
271
|
],
|
|
231
272
|
"transitions": {
|
|
232
|
-
"
|
|
233
|
-
"
|
|
273
|
+
"work_named": "execute",
|
|
274
|
+
"terminal_doneReason": "report",
|
|
275
|
+
"workspace_access": "report",
|
|
276
|
+
"packet_incoherent_replan": "plan",
|
|
277
|
+
"packet_incoherent_blocked": "report"
|
|
234
278
|
}
|
|
235
279
|
},
|
|
280
|
+
{
|
|
281
|
+
"id": "execute",
|
|
282
|
+
"description": "Execute exactly the packet head action through refill_sends_v2 internals. Bounded approvals, message preparation, same-source copies, rerun_errored_cells, saved signal continuations, paid-credit refreshes, and pinned-lane starts are allowed only when named by the packet. Execute only the fingerprint captured at the last plan gate; stale packets refuse and return to plan.",
|
|
283
|
+
"allowedTools": [
|
|
284
|
+
"refill_sends_v2",
|
|
285
|
+
"start_campaign_message_preparation",
|
|
286
|
+
"confirm_lead_list",
|
|
287
|
+
"import_leads",
|
|
288
|
+
"search_signals",
|
|
289
|
+
"select_promising_posts",
|
|
290
|
+
"start_campaign",
|
|
291
|
+
"queue_campaign_cells"
|
|
292
|
+
],
|
|
293
|
+
"doNotAllow": [
|
|
294
|
+
"create_campaign",
|
|
295
|
+
"create_on_demand_campaign",
|
|
296
|
+
"setup_evergreen_campaigns",
|
|
297
|
+
"set_campaign_waterfall_order",
|
|
298
|
+
"refresh_paid_inmail_credits",
|
|
299
|
+
"send_inbox_draft",
|
|
300
|
+
"send_inbox_manual_reply",
|
|
301
|
+
"update_campaign_brief",
|
|
302
|
+
"set_headline_icp_criteria",
|
|
303
|
+
"set_sender_routing"
|
|
304
|
+
],
|
|
305
|
+
"transitions": {
|
|
306
|
+
"planned_recorded": "verify",
|
|
307
|
+
"stale_packet": "plan",
|
|
308
|
+
"non_yolo_continuation": "report",
|
|
309
|
+
"lease_lost": "report"
|
|
310
|
+
}
|
|
311
|
+
},
|
|
312
|
+
{
|
|
313
|
+
"id": "verify",
|
|
314
|
+
"description": "Verify whole-row outcomes before another plan read. Reattach to an own active prep job by requestSource/requestHash; never re-dispatch prep while a matching job is active. Foreign prep waits until clear or blocks foreign_prep_active. wait_for_active_work and wait_for_source_import reread the plan on bounded cadence. wait_for_scheduler is cross-invocation: each tool call polls briefly under the host guard, heartbeats the lease, and returns in_progress sweep guidance so the agent re-invokes refill_sends_v2 with {runId,fence}. The approximately five minute scheduler budget is cumulative at the run level.",
|
|
315
|
+
"allowedTools": ["refill_sends_v2", "get_refill_plan_v2"],
|
|
316
|
+
"onEnter": [
|
|
317
|
+
{
|
|
318
|
+
"tool": "refill_sends_v2",
|
|
319
|
+
"requiredFields": ["workspaceId", "runId", "fence"]
|
|
320
|
+
}
|
|
321
|
+
],
|
|
322
|
+
"hardRules": [
|
|
323
|
+
"do not re-dispatch prep when an own active job exists; reattach and poll status",
|
|
324
|
+
"capped_by_scheduler is complete",
|
|
325
|
+
"replan-driven repair: the planner names rerun_errored_cells, approve_messages, start_campaign, or source work; the loop bounds and refuses",
|
|
326
|
+
"conversion verdict is journaled from packet facts after the first prep batch; the plan gate withholds a second unproven prep batch",
|
|
327
|
+
"zero pickup after a confirmed sweep is debugged from pipelineDiagnosis, not waited out forever",
|
|
328
|
+
"Sales Nav and Prospeo continuation packets render a scoped $sellable:create-campaign [campaignId] handoff for same saved-search identity, import mode add into the same source list, source work only"
|
|
329
|
+
],
|
|
330
|
+
"transitions": {
|
|
331
|
+
"verify_poll": "verify",
|
|
332
|
+
"verified": "plan",
|
|
333
|
+
"in_progress_resume": "verify",
|
|
334
|
+
"terminal": "report",
|
|
335
|
+
"blocked": "report"
|
|
336
|
+
},
|
|
337
|
+
"repeatUntil": "terminal_or_in_progress_resume_or_blocked"
|
|
338
|
+
},
|
|
236
339
|
{
|
|
237
340
|
"id": "report",
|
|
238
|
-
"description": "Present
|
|
341
|
+
"description": "Present the terminal or blocked report. Terminal proof is the run record at g4_terminal with a doneReason plus journal planned->did->outcome lines and a terminal block. loaded_awaiting_scheduler keeps the token for run-record compatibility, but report copy must include remaining-ready count, exact expected pickup time, and the resume handle; never render bare loaded, awaiting scheduler copy. Blocked Sales Nav and Prospeo packets reprint the scoped $sellable:create-campaign [campaignId] handoff text.",
|
|
239
342
|
"allowedTools": [],
|
|
240
343
|
"onEnter": [
|
|
241
344
|
{
|
|
242
|
-
"action": "
|
|
345
|
+
"action": "present_run_terminal_or_resume_report"
|
|
243
346
|
}
|
|
244
347
|
],
|
|
245
348
|
"terminal": true
|
|
@@ -247,20 +350,23 @@
|
|
|
247
350
|
],
|
|
248
351
|
"verification": {
|
|
249
352
|
"requiredProof": [
|
|
250
|
-
"
|
|
353
|
+
"run record reached g4_terminal with a named doneReason",
|
|
354
|
+
"journal contains planned -> did -> outcome lines",
|
|
355
|
+
"journal contains terminal block and index line",
|
|
251
356
|
"planRevision has pr1: prefix unless blocker is workspace_access",
|
|
252
|
-
"
|
|
253
|
-
"
|
|
254
|
-
"lane source belongs to managed_waterfall, dashboard_evergreen, active_campaign",
|
|
357
|
+
"chosen evergreenRung belongs to enumeratedRungs and has a plain-language rungLabels entry",
|
|
358
|
+
"managed_waterfall, dashboard_evergreen, or active_campaign lane source recorded",
|
|
255
359
|
"laneChain recorded when active_campaign chain is selected",
|
|
256
|
-
"
|
|
257
|
-
"
|
|
360
|
+
"supplyCensus/censusReason and pipelineDiagnosis checklist reviewed when present",
|
|
361
|
+
"in_progress results include runId, fence, gate, and sweep or wait guidance"
|
|
258
362
|
],
|
|
259
363
|
"notCompletionProof": [
|
|
260
364
|
"called get_refill_plan_v2 alone",
|
|
261
|
-
"
|
|
262
|
-
"
|
|
263
|
-
"
|
|
365
|
+
"plan packet alone",
|
|
366
|
+
"action queue exists but no planned/did/outcome journal evidence",
|
|
367
|
+
"in_progress continuation without {runId,fence,gate}",
|
|
368
|
+
"journal absence",
|
|
369
|
+
"bare loaded awaiting scheduler report without expected pickup time"
|
|
264
370
|
]
|
|
265
371
|
}
|
|
266
372
|
}
|