@sellable/mcp 0.1.768 → 0.1.769

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.
@@ -3,7 +3,7 @@
3
3
  * manifests. Keep this free of tool implementation imports so Next can bundle
4
4
  * it; registry parity is enforced in sellable-agent-tool-policy.test.ts.
5
5
  */
6
- export declare const SELLABLE_MCP_TOOL_NAMES: readonly ["add_column", "add_on_demand_leads", "add_rubric_item", "add_teammate", "add_to_comment_campaign", "add_to_connection_campaign", "add_to_inmail_campaign", "archive_campaign", "attach_recommended_sequence", "attach_sequence", "bootstrap_create_campaign", "bootstrap_engage", "bootstrap_engage_multi", "bootstrap_find_leads", "bulk_enrich_with_prospeo", "calculate_linkedin_hook_preview", "cancel_campaign_message_preparation", "cancel_find_leads", "cancel_lead_import", "capture_post_idea", "check_inbox_reply_eligibility", "check_rubric", "commit_blueprint", "complete_sender_research", "confirm_harvest_job_companies", "confirm_lead_list", "confirm_prospeo_company_accounts", "copy_sender_config", "create_campaign", "create_on_demand_campaign", "create_on_demand_table", "create_workflow_table", "create_workspace", "delete_column", "delete_rubric_item", "draft_rubrics", "duplicate_campaign", "enrich_with_prospeo", "export_table_csv", "export_workspace_csv", "fetch_company", "fetch_company_posts", "fetch_linkedin_posts", "fetch_linkedin_profile", "fetch_post_engagers", "fill_campaign_horizon", "get_active_workspace", "get_auth_status", "get_campaign", "get_campaign_context", "get_campaign_framework", "get_campaign_message_preparation_status", "get_campaign_messages_preview", "get_campaign_navigation_state", "get_campaign_refill_state", "get_campaign_table_schema", "get_campaign_waterfall", "get_campaigns", "get_column_schema", "get_company_info", "get_engage_memory", "get_engage_state", "get_engaged_posts", "get_find_leads_run", "get_inbox_thread", "get_linkedin_profile", "get_or_create_direct_campaign_table", "get_post_draft", "get_post_find_leads_scout_registry", "get_post_idea", "get_prospeo_credits", "get_provider_prompt", "get_published_post", "get_refill_plan_v2", "get_refill_target_plan", "get_rows", "get_rows_minimal", "get_runtime_identity", "get_scheduler_fill_capacity", "get_sender", "get_sender_routing", "get_source_scout_registry", "get_subskill_asset", "get_subskill_prompt", "get_table_rows", "get_user_posts", "get_workspace", "import_leads", "init_on_demand_sequence", "integrations_call_tool", "integrations_describe_tool", "integrations_list_tools", "list_column_types", "list_dnc_entries", "list_post_draft_iterations", "list_post_drafts", "list_post_ideas", "list_published_posts", "list_senders", "list_subskill_prompts", "list_tables", "list_workspaces", "load_csv_dnc_entries", "load_csv_domains", "load_csv_linkedin_leads", "lookup_sales_nav_filter", "mark_post_published", "migrate_flat_configs", "pause_campaign", "pause_direct_campaign", "pause_on_demand_campaign", "preflight_find_leads_provider", "prepare_campaign_ab_test", "queue_campaign_cells", "queue_cells", "record_campaign_review_batch", "record_engage_proven_search", "refill_sends", "refill_sends_v2", "refresh_paid_inmail_credits", "refresh_sender_engagement", "reissue_find_leads_watch_link", "render_linkedin_post_preview", "reorder_columns", "resolve_campaign_fill_route", "revise_message_template_and_rerun", "run_scheduler_sweep", "save_domain_filters", "save_hook_research", "save_post_draft", "save_rubrics", "search_apollo", "search_engagement_posts", "search_harvest_jobs", "search_inbox_threads", "search_prospeo", "search_prospeo_companies", "search_sales_nav", "search_signals", "search_subskill_prompts", "select_campaign_cells", "select_necessary_rubrics", "select_promising_posts", "send_inbox_draft", "send_inbox_manual_reply", "set_active_workspace", "set_campaign_waterfall_order", "set_company_info", "set_engage_state", "set_engage_style_guide", "set_headline_icp_criteria", "set_sender_calendar_link", "set_sender_routing", "setup_evergreen_campaigns", "start_campaign", "start_campaign_message_preparation", "start_cli_login", "start_direct_campaign", "start_on_demand_campaign", "update_campaign", "update_campaign_brief", "update_cell", "update_column", "update_find_leads_run", "update_inbox_draft", "update_post_draft", "update_published_post_metrics", "update_rubric_item", "upsert_engage_tracked_person", "upsert_rubric", "validate_campaign1_kickoff_handoff", "verify_table_row", "wait_for_campaign_processing", "wait_for_campaign_table_ready", "wait_for_cli_login", "wait_for_find_leads_run", "wait_for_lead_list_ready", "wait_for_rubric_results"];
6
+ export declare const SELLABLE_MCP_TOOL_NAMES: readonly ["add_column", "add_on_demand_leads", "add_rubric_item", "add_teammate", "add_to_comment_campaign", "add_to_connection_campaign", "add_to_inmail_campaign", "archive_campaign", "attach_recommended_sequence", "attach_sequence", "bootstrap_create_campaign", "bootstrap_engage", "bootstrap_engage_multi", "bootstrap_find_leads", "bulk_enrich_with_prospeo", "calculate_linkedin_hook_preview", "cancel_campaign_message_preparation", "cancel_find_leads", "cancel_lead_import", "capture_post_idea", "check_inbox_reply_eligibility", "check_rubric", "commit_blueprint", "complete_sender_research", "confirm_harvest_job_companies", "confirm_lead_list", "confirm_prospeo_company_accounts", "copy_sender_config", "create_campaign", "create_on_demand_campaign", "create_on_demand_table", "create_workflow_table", "create_workspace", "delete_column", "delete_rubric_item", "draft_rubrics", "duplicate_campaign", "enrich_with_prospeo", "export_table_csv", "export_workspace_csv", "fetch_company", "fetch_company_posts", "fetch_linkedin_posts", "fetch_linkedin_profile", "fetch_post_engagers", "fill_campaign_horizon", "get_active_workspace", "get_auth_status", "get_campaign", "get_campaign_context", "get_campaign_framework", "get_campaign_message_preparation_status", "get_campaign_messages_preview", "get_campaign_navigation_state", "get_campaign_refill_state", "get_campaign_table_schema", "get_campaign_waterfall", "get_campaigns", "get_column_schema", "get_company_info", "get_engage_memory", "get_engage_state", "get_engaged_posts", "get_find_leads_run", "get_inbox_thread", "get_linkedin_profile", "get_or_create_direct_campaign_table", "get_post_draft", "get_post_find_leads_scout_registry", "get_post_idea", "get_prospeo_credits", "get_provider_prompt", "get_published_post", "get_refill_target_plan", "get_rows", "get_rows_minimal", "get_runtime_identity", "get_scheduler_fill_capacity", "get_sender", "get_sender_routing", "get_source_scout_registry", "get_subskill_asset", "get_subskill_prompt", "get_table_rows", "get_user_posts", "get_workspace", "import_leads", "init_on_demand_sequence", "integrations_call_tool", "integrations_describe_tool", "integrations_list_tools", "list_column_types", "list_dnc_entries", "list_post_draft_iterations", "list_post_drafts", "list_post_ideas", "list_published_posts", "list_senders", "list_subskill_prompts", "list_tables", "list_workspaces", "load_csv_dnc_entries", "load_csv_domains", "load_csv_linkedin_leads", "lookup_sales_nav_filter", "mark_post_published", "migrate_flat_configs", "pause_campaign", "pause_direct_campaign", "pause_on_demand_campaign", "preflight_find_leads_provider", "prepare_campaign_ab_test", "queue_campaign_cells", "queue_cells", "record_campaign_review_batch", "record_engage_proven_search", "refill_sends", "refresh_paid_inmail_credits", "refresh_sender_engagement", "reissue_find_leads_watch_link", "render_linkedin_post_preview", "reorder_columns", "resolve_campaign_fill_route", "revise_message_template_and_rerun", "run_scheduler_sweep", "save_domain_filters", "save_hook_research", "save_post_draft", "save_rubrics", "search_apollo", "search_engagement_posts", "search_harvest_jobs", "search_inbox_threads", "search_prospeo", "search_prospeo_companies", "search_sales_nav", "search_signals", "search_subskill_prompts", "select_campaign_cells", "select_necessary_rubrics", "select_promising_posts", "send_inbox_draft", "send_inbox_manual_reply", "set_active_workspace", "set_campaign_waterfall_order", "set_company_info", "set_engage_state", "set_engage_style_guide", "set_headline_icp_criteria", "set_sender_calendar_link", "set_sender_routing", "setup_evergreen_campaigns", "start_campaign", "start_campaign_message_preparation", "start_cli_login", "start_direct_campaign", "start_on_demand_campaign", "update_campaign", "update_campaign_brief", "update_cell", "update_column", "update_find_leads_run", "update_inbox_draft", "update_post_draft", "update_published_post_metrics", "update_rubric_item", "upsert_engage_tracked_person", "upsert_rubric", "validate_campaign1_kickoff_handoff", "verify_table_row", "wait_for_campaign_processing", "wait_for_campaign_table_ready", "wait_for_cli_login", "wait_for_find_leads_run", "wait_for_lead_list_ready", "wait_for_rubric_results"];
7
7
  /**
8
8
  * Explicit mutation classification lives beside (but outside) the flat tool
9
9
  * registry. Neither this list nor `isMutatingTool` is an input to
@@ -77,7 +77,6 @@ export const SELLABLE_MCP_TOOL_NAMES = [
77
77
  "get_prospeo_credits",
78
78
  "get_provider_prompt",
79
79
  "get_published_post",
80
- "get_refill_plan_v2",
81
80
  "get_refill_target_plan",
82
81
  "get_rows",
83
82
  "get_rows_minimal",
@@ -122,7 +121,6 @@ export const SELLABLE_MCP_TOOL_NAMES = [
122
121
  "record_campaign_review_batch",
123
122
  "record_engage_proven_search",
124
123
  "refill_sends",
125
- "refill_sends_v2",
126
124
  "refresh_paid_inmail_credits",
127
125
  "refresh_sender_engagement",
128
126
  "reissue_find_leads_watch_link",
@@ -2,7 +2,7 @@ import { createHash } from "node:crypto";
2
2
  import { SellableApiError } from "./api.js";
3
3
  import { decodeRefillReadinessAuthority, refillReadinessExpectationInput, refillReadinessFingerprint, } from "./refill-readiness.js";
4
4
  import { normalizeMessageTemplateRevision, normalizeRefillRunHandle, normalizeRefillTargetConfig, } from "./tools/campaign-processing.js";
5
- import { buildRunStateFromLocalHints } from "./tools/evergreen-refill-plan.js";
5
+ import { buildRunStateFromLocalHints } from "./tools/refill-execution-plan.js";
6
6
  import { classifyPaidInmailRefreshReceipt, prepareRowSelectorValue as defaultPrepareRowSelectorValue, refillPrepareRequestHash as defaultRefillPrepareRequestHash, validateAgentSuppliedBroadenKeywords, } from "./tools/refill-executors.js";
7
7
  import { sanitizeRefillReportingContextProjection, sanitizeRefillReportingProjection, } from "./tools/refill-target-plan.js";
8
8
  /**
@@ -699,7 +699,7 @@ function isSelectedSenderOwnedPostEngagersLane(plan, action) {
699
699
  stringValue(actionToolInput(action).campaignName) ??
700
700
  stringValue(targetCampaign?.campaignName) ??
701
701
  stringValue(targetCampaign?.name);
702
- // Exact v2 packets retain target.campaigns identity even when a plain
702
+ // Exact refill packets retain target.campaigns identity even when a plain
703
703
  // active-campaign route omits the optional evergreen lane projection.
704
704
  // Prefer that authority so a resumed g3 checkpoint never falls through to
705
705
  // the generic agent-keyword gate for a sender-owned Post Engagers campaign.
@@ -2446,7 +2446,7 @@ async function gateBootstrap(input, deps, ctx) {
2446
2446
  input.reportingContext = issuedReportingContext;
2447
2447
  }
2448
2448
  const pinnedRunState = pinInitialSenderLaneChains(plan, ctx.runState);
2449
- // Exact fenced plans are projected by projectedV2Packet(), whose legacy
2449
+ // Exact fenced plans are projected by projectedRefillExecutionPacket(), whose
2450
2450
  // bootstrap.paidCredit array is intentionally empty. The canonical refresh
2451
2451
  // authority is packet.target.globalActionQueue; reading the bootstrap array
2452
2452
  // minted `{ version: 2, receipts: [] }` on every run, which made the next
@@ -2557,7 +2557,7 @@ async function gateBootstrap(input, deps, ctx) {
2557
2557
  })
2558
2558
  : runStateWithoutCreditTrust;
2559
2559
  await safeJournalAppend(ctx, deps, deps.journal.renderBootstrapSection({
2560
- summary: "Refill v2 execution bootstrap",
2560
+ summary: "Refill exact-run execution bootstrap",
2561
2561
  senderSummary: safeJson(recordValue(plan.bootstrap)?.senders ?? []),
2562
2562
  laneSummary: safeJson(recordValue(plan.bootstrap)?.laneOrder ?? []),
2563
2563
  targetSummary: safeJson(recordValue(plan.bootstrap)?.target ?? []),
package/dist/server.js CHANGED
@@ -3,10 +3,10 @@ import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js"
3
3
  import { CallToolRequestSchema, GetPromptRequestSchema, ListPromptsRequestSchema, ListToolsRequestSchema, } from "@modelcontextprotocol/sdk/types.js";
4
4
  import { HttpAgentApprovalEffectPort } from "./agent-approval-effect-port.js";
5
5
  import { AGENT_INTEGRATION_CONTEXT_REQUIRED_ERROR, agentIntegrationRequestActor, } from "./agent-integration-request-context.js";
6
+ import { ensureAgentScope, getAgentScope, hasRecordedAgentScope, } from "./agent-scope.js";
6
7
  import { createMcpCredentialBoundary, resolveMcpCredentialIntent, } from "./agent-service-auth.js";
7
- import { compileAgentToolPolicy, createAgentMcpAuthorizationHandlers, } from "./agent-tool-policy.js";
8
8
  import { crossWorkspaceMutationRefusal } from "./agent-tool-names.js";
9
- import { ensureAgentScope, getAgentScope, hasRecordedAgentScope, } from "./agent-scope.js";
9
+ import { compileAgentToolPolicy, createAgentMcpAuthorizationHandlers, } from "./agent-tool-policy.js";
10
10
  import { getApi } from "./api.js";
11
11
  import { getConfig, getConfiguredCredentialIntent } from "./auth.js";
12
12
  import { MCP_RUNTIME_IDENTITY } from "./runtime-identity.js";
@@ -37,7 +37,6 @@ import { searchEngagementPosts } from "./tools/engage-discovery.js";
37
37
  import { copySenderConfigTool, getEngageMemoryTool, migrateFlatConfigsTool, recordEngageProvenSearchTool, setEngageStyleGuideTool, upsertEngageTrackedPersonTool, } from "./tools/engage-memory.js";
38
38
  import { getEngageStateTool, setEngageStateTool, } from "./tools/engage-state.js";
39
39
  import { bulkEnrichWithProspeo, enrichWithProspeo, getProspeoCredits, } from "./tools/enrichment.js";
40
- import { getRefillPlanV2 } from "./tools/evergreen-refill-plan.js";
41
40
  import { bootstrapFindLeads, cancelFindLeads, getFindLeadsRun, reissueFindLeadsWatchLink, updateFindLeadsRun, waitForFindLeadsRun, } from "./tools/find-leads-runs.js";
42
41
  import { getCampaignFramework } from "./tools/framework.js";
43
42
  import { confirmHarvestJobCompanies, searchHarvestJobs, } from "./tools/harvest-jobs.js";
@@ -51,7 +50,6 @@ import { upsertRubric } from "./tools/processing.js";
51
50
  import { completeSenderResearch, getPostFindLeadsScoutRegistry, getSourceScoutRegistry, getSubskillAsset, getSubskillPrompt, listSubskillPrompts, searchSubskillPrompts, } from "./tools/prompts.js";
52
51
  import { preflightFindLeadsProvider } from "./tools/provider-preflight.js";
53
52
  import { waitForCampaignTableReady, waitForLeadListReady, } from "./tools/readiness.js";
54
- import { refillSendsV2Command } from "./tools/refill-sends-v2.js";
55
53
  import { executeRefillSendsCommand } from "./tools/refill-sends.js";
56
54
  import { getRefillTargetPlan } from "./tools/refill-target-plan.js";
57
55
  import { refreshSenderEngagementCommand } from "./tools/refresh-sender-engagement.js";
@@ -384,10 +382,6 @@ server.setRequestHandler(CallToolRequestSchema, async (request) => {
384
382
  case "get_campaign_refill_state":
385
383
  result = await getCampaignRefillState(args);
386
384
  break;
387
- case "get_refill_plan_v2":
388
- case "get_evergreen_refill_plan":
389
- result = await getRefillPlanV2(args);
390
- break;
391
385
  case "get_refill_target_plan":
392
386
  result = await getRefillTargetPlan(args);
393
387
  break;
@@ -403,10 +397,6 @@ server.setRequestHandler(CallToolRequestSchema, async (request) => {
403
397
  case "refill_sends":
404
398
  result = await executeRefillSendsCommand(args);
405
399
  break;
406
- case "refill_sends_v2":
407
- case "refill_sends_evergreen":
408
- result = await refillSendsV2Command(args);
409
- break;
410
400
  case "setup_evergreen_campaigns":
411
401
  result = await setupEvergreenCampaigns(args);
412
402
  markEvergreenSetupCampaignsDirty(args);
@@ -146,31 +146,15 @@ export interface PostFindLeadsScoutRegistryResponse {
146
146
  export declare const DEFAULT_SUBSKILL_PROMPT_CHUNK_CHARS = 48000;
147
147
  export declare const MAX_SUBSKILL_PROMPT_CHUNK_CHARS = 48000;
148
148
  export declare const DEPRECATED_SUBSKILL_PROMPT_REPLACEMENTS: Record<string, string>;
149
- export declare const ALLOWED_SUBSKILL_PROMPT_NAMES: readonly ["avoid-ai-writing", "building-gtm-tables", "content", "create-ab-test", "create-campaign", "create-campaign-brief", "create-campaign-v2", "create-campaign-v2-tail", "create-campaign-v2-validation", "create-evergreen-campaigns", "create-post", "create-rubric", "engage", "enrich-prospects", "fill-send-horizon", "find-leads", "find-leads-v2", "foundation", "generate-messages", "interview", "load-voice", "refresh-sender-engagement", "refill-sends", "refill-sends-evergreen", "refill-sends-evergreen-workflow", "refill-sends-v2", "refill-sends-v2-workflow", "refill-sends-workflow", "research", "research-prospect", "research-sender", "weekly-campaign-summary", "workflow-sequences"];
149
+ export declare const ALLOWED_SUBSKILL_PROMPT_NAMES: readonly ["avoid-ai-writing", "building-gtm-tables", "content", "create-ab-test", "create-campaign", "create-campaign-brief", "create-campaign-v2", "create-campaign-v2-tail", "create-campaign-v2-validation", "create-evergreen-campaigns", "create-post", "create-rubric", "engage", "enrich-prospects", "fill-send-horizon", "find-leads", "find-leads-v2", "foundation", "generate-messages", "interview", "load-voice", "refresh-sender-engagement", "refill-sends", "refill-sends-workflow", "research", "research-prospect", "research-sender", "weekly-campaign-summary", "workflow-sequences"];
150
150
  export declare const REFILL_PROJECTION_PROMPT_INVENTORY: readonly [{
151
151
  readonly name: "refill-sends";
152
152
  readonly assetPath: "SKILL.md";
153
153
  readonly visibility: "public";
154
- }, {
155
- readonly name: "refill-sends-v2";
156
- readonly assetPath: "SKILL.md";
157
- readonly visibility: "public";
158
- }, {
159
- readonly name: "refill-sends-evergreen";
160
- readonly assetPath: "SKILL.md";
161
- readonly visibility: "public";
162
154
  }, {
163
155
  readonly name: "refill-sends-workflow";
164
156
  readonly assetPath: "core/flow.v1.json";
165
157
  readonly visibility: "internal";
166
- }, {
167
- readonly name: "refill-sends-v2-workflow";
168
- readonly assetPath: "core/flow.v1.json";
169
- readonly visibility: "internal";
170
- }, {
171
- readonly name: "refill-sends-evergreen-workflow";
172
- readonly assetPath: "core/flow.v1.json";
173
- readonly visibility: "internal";
174
158
  }];
175
159
  export declare const promptToolDefinitions: ({
176
160
  name: string;
@@ -215,7 +199,7 @@ export declare const promptToolDefinitions: ({
215
199
  properties: {
216
200
  subskillName: {
217
201
  type: string;
218
- enum: readonly ["avoid-ai-writing", "building-gtm-tables", "content", "create-ab-test", "create-campaign", "create-campaign-brief", "create-campaign-v2", "create-campaign-v2-tail", "create-campaign-v2-validation", "create-evergreen-campaigns", "create-post", "create-rubric", "engage", "enrich-prospects", "fill-send-horizon", "find-leads", "find-leads-v2", "foundation", "generate-messages", "interview", "load-voice", "refresh-sender-engagement", "refill-sends", "refill-sends-evergreen", "refill-sends-evergreen-workflow", "refill-sends-v2", "refill-sends-v2-workflow", "refill-sends-workflow", "research", "research-prospect", "research-sender", "weekly-campaign-summary", "workflow-sequences"];
202
+ enum: readonly ["avoid-ai-writing", "building-gtm-tables", "content", "create-ab-test", "create-campaign", "create-campaign-brief", "create-campaign-v2", "create-campaign-v2-tail", "create-campaign-v2-validation", "create-evergreen-campaigns", "create-post", "create-rubric", "engage", "enrich-prospects", "fill-send-horizon", "find-leads", "find-leads-v2", "foundation", "generate-messages", "interview", "load-voice", "refresh-sender-engagement", "refill-sends", "refill-sends-workflow", "research", "research-prospect", "research-sender", "weekly-campaign-summary", "workflow-sequences"];
219
203
  description: string;
220
204
  };
221
205
  offset: {
@@ -250,7 +234,7 @@ export declare const promptToolDefinitions: ({
250
234
  properties: {
251
235
  subskillName: {
252
236
  type: string;
253
- enum: readonly ["avoid-ai-writing", "building-gtm-tables", "content", "create-ab-test", "create-campaign", "create-campaign-brief", "create-campaign-v2", "create-campaign-v2-tail", "create-campaign-v2-validation", "create-evergreen-campaigns", "create-post", "create-rubric", "engage", "enrich-prospects", "fill-send-horizon", "find-leads", "find-leads-v2", "foundation", "generate-messages", "interview", "load-voice", "refresh-sender-engagement", "refill-sends", "refill-sends-evergreen", "refill-sends-evergreen-workflow", "refill-sends-v2", "refill-sends-v2-workflow", "refill-sends-workflow", "research", "research-prospect", "research-sender", "weekly-campaign-summary", "workflow-sequences"];
237
+ enum: readonly ["avoid-ai-writing", "building-gtm-tables", "content", "create-ab-test", "create-campaign", "create-campaign-brief", "create-campaign-v2", "create-campaign-v2-tail", "create-campaign-v2-validation", "create-evergreen-campaigns", "create-post", "create-rubric", "engage", "enrich-prospects", "fill-send-horizon", "find-leads", "find-leads-v2", "foundation", "generate-messages", "interview", "load-voice", "refresh-sender-engagement", "refill-sends", "refill-sends-workflow", "research", "research-prospect", "research-sender", "weekly-campaign-summary", "workflow-sequences"];
254
238
  description: string;
255
239
  };
256
240
  assetPath: {
@@ -15,8 +15,6 @@ export const DEFAULT_SUBSKILL_PROMPT_CHUNK_CHARS = 48_000;
15
15
  export const MAX_SUBSKILL_PROMPT_CHUNK_CHARS = 48_000;
16
16
  export const DEPRECATED_SUBSKILL_PROMPT_REPLACEMENTS = {
17
17
  "generate-messages-compact": "generate-messages",
18
- "refill-sends-evergreen": "refill-sends-v2",
19
- "refill-sends-evergreen-workflow": "refill-sends-v2-workflow",
20
18
  };
21
19
  export const ALLOWED_SUBSKILL_PROMPT_NAMES = [
22
20
  "avoid-ai-writing",
@@ -42,10 +40,6 @@ export const ALLOWED_SUBSKILL_PROMPT_NAMES = [
42
40
  "load-voice",
43
41
  "refresh-sender-engagement",
44
42
  "refill-sends",
45
- "refill-sends-evergreen",
46
- "refill-sends-evergreen-workflow",
47
- "refill-sends-v2",
48
- "refill-sends-v2-workflow",
49
43
  "refill-sends-workflow",
50
44
  "research",
51
45
  "research-prospect",
@@ -55,27 +49,11 @@ export const ALLOWED_SUBSKILL_PROMPT_NAMES = [
55
49
  ];
56
50
  export const REFILL_PROJECTION_PROMPT_INVENTORY = [
57
51
  { name: "refill-sends", assetPath: "SKILL.md", visibility: "public" },
58
- { name: "refill-sends-v2", assetPath: "SKILL.md", visibility: "public" },
59
- {
60
- name: "refill-sends-evergreen",
61
- assetPath: "SKILL.md",
62
- visibility: "public",
63
- },
64
52
  {
65
53
  name: "refill-sends-workflow",
66
54
  assetPath: "core/flow.v1.json",
67
55
  visibility: "internal",
68
56
  },
69
- {
70
- name: "refill-sends-v2-workflow",
71
- assetPath: "core/flow.v1.json",
72
- visibility: "internal",
73
- },
74
- {
75
- name: "refill-sends-evergreen-workflow",
76
- assetPath: "core/flow.v1.json",
77
- visibility: "internal",
78
- },
79
57
  ];
80
58
  export const promptToolDefinitions = [
81
59
  {
@@ -406,7 +384,7 @@ export function getPostFindLeadsScoutRegistry() {
406
384
  claude: "After confirm_lead_list copies source rows and the initial campaign-table execution slice exists, ask the filter-choice question immediately. Do not invoke any Task/Agent before that question. After the answer, invoke only Message Drafting. If filters are chosen, parent drafts/saves rubrics with MCP tools while Message Drafting runs, asks filter approval, then joins Message Drafting. If filters are skipped, invoke only Message Drafting and move to Messages/message review.",
407
385
  parentThreadRule: 'Named agents are optional acceleration, but message drafting is not optional. The only normal background worker is Message Drafting. The filter-choice answer is the campaign-scoped go-ahead for this single post-import worker; do not ask another question to start it in step-wise or YOLO mode. If a named agent is unavailable, use a generic gpt-5.6-sol high Message Drafting background agent. source work and filter work stay in the parent thread with MCP tools. If post-find-leads-message-scout is available, run it as the background Message Draft Builder after the filter-choice answer. The registry lookup is not a launch: get_post_find_leads_scout_registry only identifies the worker, and Message Drafting counts as started only after Task/spawn_agent or the host background-agent tool is invoked, or after the parent begins the same full message branch inline because no background-agent tool is callable. This launch must happen before loading filter-leads.md, save_rubrics, filter approval, or skip-filter message review; currentStep=messages is not proof of launch. If post-find-leads-message-scout is absent, do not customer-surface install status. Do not silently treat message drafting as started; the main thread must either launch the background worker or execute the same message branch from CampaignOffer state, selected source state, workflowTableId, and initial campaign-table execution slice rows. For a spawned worker, record workerDetails.messageDraftBuilder with statusSource branch / status branch-running, runId, startedAt, updatedAt, and basis containing campaignId, selectedLeadListId, workflowTableId, filterChoice, and reviewBatchRowHash or reviewBatchRowIds. workerStatuses.messageDraftBuilder is optional simple badge text only ("running", "ready", "blocked", "idle"); never put runId/statusSource/basis under workerStatuses and never use workerStatuses.messageDrafting. If no background-agent tool is callable, start that same full message branch inline before filter drafting or before skip-filter message review, record workerDetails.messageDraftBuilder with statusSource parent-thread-fallback / status fallback-active then ready, and require the same live context, prompt, assets, and validation gate before message review; do not report that as a background worker failure. If neither branch nor inline fallback can run, return blocked/retry-needed; do not wait until filters are saved and then call the registry. The Message Drafting handoff must be lean. Do not paste copied row counts, brief hashes, review-batch hashes, full reviewBatchRowIds, broad row data, or local debug artifacts into the spawn prompt. Local markdown/json files are not normal-path inputs. The filter-choice question is the first post-import user gate; do not load post-lead registries or filter references before it. Message drafting starts after the filter-choice answer, must load get_subskill_prompt({ subskillName: "generate-messages" }), and must load every required message asset named by generate-messages Mode 0 through get_subskill_asset before drafting. Reference Asset Loading means loading the required pre-draft reference pack before drafting; return blocked/retry-needed if required assets cannot be loaded; load ai-tells.md because it is never optional. The branch or parent-thread fallback loads the full generate-messages prompt and every referenced asset through get_subskill_asset. After generating/revising the candidate and before returning ready, must load get_subskill_prompt({ subskillName: "create-campaign-v2-validation" }) as the final internal validation gate, must read live campaign table state through scoped MCP/product tools, and must reject mismatched selectedLeadListId/workflowTableId/campaign/workspace input. Do not block when filters were chosen but leadScoringRubrics are not yet visible in the branch read; the parent owns save_rubrics and filter approval in parallel, so Message Drafting should return status ready with basisStatus usable_initial when campaign/list/table identity and the non-empty execution slice match. Do not use any alternate, local-artifact, or examples-only message prompt. User copy feedback, message QA, or rewrite requests before approve-message must be routed back to Message Drafting with the current recommendation, lean campaign/table basis, and latest user text; the parent must not rewrite or QA the template from memory and must not call update_campaign_brief before approve-message. The worker validates internally and returns only templateRecommendation, tokenFillRules, renderedGoodSample, status, approveOrReviseRecommendation, validationStatus, outputAt, outputHash, and blocked/retry detail. Do not render renderedFallbackSample, risk notes, or a qaReceipt on the normal happy path. On the filter path, save_rubrics keeps the browser on Filter Rules after save_rubrics so the user can approve the saved criteria; after saved-filter approval, move to Filter Leads with currentStep=apply-icp-rubric whether Message Drafting is ready or still running. Wait there for message approval. Enrichment, filtering, Generate Message cells, sender setup, sequence attach, and launch wait for template approval on the Use Template path. On the skip path, move to Messages/message review after Message Drafting has started or is ready and wait for message approval before enrichment or Settings. Do not render message review from checklist or shortcut instructions; message review requires a messageDraftRecommendation whose basis proves the generate-messages prompt, required message assets, and validation gate ran for the current campaign/table execution slice. Do not automatically rerun Message Drafting after filters/enrichment finish; show the initial draft by default and offer an enriched rewrite only with explicit user opt-in. Handoff and recommendation output are Markdown with labeled fields, not raw JSON.',
408
386
  refillCoverageRenderingRule: "Render both Still need to schedule and Still need to prepare for every refill sender; never render an unlabeled Still need value. For run_scheduler_sweep approval/yolo packets, show workspaceWide:true and the action reason so the operator sees the same-date workspace-wide scheduling caveat.",
409
- refillCoordinatorTerminalRule: "Continue wait_for_scheduler only through exact refill_sends continuation arguments. Once refill dispatches a scheduler sweep, keep the same runId/fence and request key active until the scheduler returns an official terminal receipt; a host or transport wait bound yields status in_progress and never loaded_awaiting_scheduler. After that receipt, perform the authoritative target-plan reread and return complete or the exact receipt-backed retryable scheduler blocker. A loaded_awaiting_scheduler terminal is valid only when no refill-owned scheduler request is active.",
387
+ refillCoordinatorTerminalRule: "This rule supersedes generic keep-polling language in older refill guidance: continue wait_for_scheduler only through exact refill_sends continuation arguments. Once refill dispatches a scheduler sweep, keep the same runId/fence and request key active until the scheduler returns an official terminal receipt; a host or transport wait bound yields status in_progress and never loaded_awaiting_scheduler. After that receipt, perform the authoritative target-plan reread and return complete or the exact receipt-backed retryable scheduler blocker. A loaded_awaiting_scheduler terminal is valid only when no refill-owned scheduler request is active.",
410
388
  revisionApprovalContinuationRule: 'After a committed dispatched refill template-revision receipt, use only the planner-derived approve_messages continuation with approvalMode:"approve", the exact revision cohort in rowSelector:{type:"rowIds",rowIds:[...]}, the fresh compiled readiness identity, and canonical reportingContext. Never queue Approved cells directly because that path cannot mint the authoritative approval/lane-scope receipt. Require laneScope in the preparation receipt before treating the first-touch lane as approved. A disconnected or zero-capacity sender still blocks scheduling and never authorizes reconnection, campaign start, or direct send.',
411
389
  schedulerRunReceiptRule: "For refill prompt handoffs, scheduler-run receipt interpretation is mandatory: cellsConsidered is allocation-attempt count, not total ready supply, while readyCellsFound is ready inventory found before prefilters. Inspect campaignScopeSummary before assuming the selected refill campaign/table was included. Interpret prefiltered, skipped, and deferred separately. For ready closed-InMail cells with stale paid-credit prefilter/defer reasons, route to refresh_paid_inmail_credits_then_rerun once, then rerun/status. wait_for_capacity_or_window means report loaded/capped/waiting and do not source or prep more rows. no_ready_cells_continue_refill_prep means return to the refill/prep ladder. Do not treat cellsScheduled:0 alone as failure. For an active scheduler request, honor the persisted requestKey and re-invoke only the exact refill_sends continuation until its official terminal receipt. Never blindly sleep, redispatch an active/uncertain key, or convert a host wait bound into loaded_awaiting_scheduler.",
412
390
  prepareMessagesRule: `Default create-campaign stays on the existing reviewBatchLimit:15 first campaign-table execution slice. For plain post-mint fill/load/refill requests, load get_subskill_prompt({ subskillName: "refill-sends-workflow" }) and get_subskill_asset({ subskillName: "refill-sends-workflow", assetPath: "core/flow.v1.json" }) to hasMore:false before operational steps, then call resolve_campaign_fill_route({ intent:"plain" }), list_senders, and get_campaign_refill_state for enough candidate campaigns to identify the campaign that most recently had scheduler-owned sends for the relevant sender set before any mutation. Route outcomes are route:"evergreen_horizon", route:"active_campaigns", and route:"ask_create"; if a plain managed-waterfall route has archived/completed skipped slots or does not cover the named sender set, immediately refetch with resolve_campaign_fill_route({ intent:"active" }) and inspect current dashboard-active ACTIVE/PAUSED campaign-backed sequence campaigns before declaring a sender blocked; stay in the same campaignOfferId/campaignId context after minting. Plain fill is not an alias for fill_campaign_horizon or campaign creation. fill_campaign_horizon is evergreen-only and is not the generic regular-campaign fill path. Campaign creation is allowed only after route:"ask_create" and explicit user selection; it is never the default response to plain fill. Treat "fill up/load sends" as capacity-fill preparation, and treat "refill senders", "fill senders", "max out senders", and "load everyone up" as sender-scoped capacity-fill preparation. For sender-scoped requests with no named senders, --yolo means all eligible healthy senders enrolled in active campaign-backed sequence campaigns in the active workspace; without --yolo, ask which eligible enrolled senders to refill before choosing campaigns or mutating. In non-yolo interactive Codex or Claude Code sessions, post the full sender/campaign/action approval packet in normal chat as Markdown first, then ask request_user_input/AskUserQuestion with exactly Accept and Decline and a compact body that refers back to the posted packet; do not duplicate the campaign table or full operator packet inside the structured question. The chat packet must show workspace, sender scope, a campaign-by-campaign table, exact ids/caps/dates, side effects, forbidden actions, and stop condition before mutation. Default --yolo target is the scheduler-forward 48-hour target window: sender-local send days whose configured sending windows overlap the rolling target window, skipping no-send-hour days. For campaign-scoped fill/refill, select the best recent-send campaign and calculate the bounded gap from healthy sender daily capacity minus projected coverage (actual sent plus future scheduler-owned scheduled sends) and ready-to-schedule rows, then prepare only that gap. For sender-scoped fill/refill, calculate the bounded gap per eligible sender across active enrolled campaigns, counting actual sent coverage, future scheduled rows, and ready-to-schedule rows across those campaigns, then choose the best same-sender campaign to fill each sender gap: prefer recent/future scheduler-owned sends for that sender, then strongest recent result evidence, then source health. Maintain a target-window saturation ledger per selected sender with selected send days, gross capacity, actual sent counts, future scheduler-owned scheduled counts, projected coverage, ready-to-schedule buffer, remaining projected gap, paid-InMail threshold feasibility, and the next MCP primitive. The structured packet lives in target.senderRefillPlans[] with target.eligibleSenderLedger, campaignRanking.options, sourcePlan, nextActions, manualAlternates, and target.globalActionQueue; preserve Need to prepare, Goal, Already sent, Scheduled, Ready and waiting to be scheduled, and Still need labels. In --yolo, execute exactly one globally ranked primitive from the post-refresh target.globalActionQueue[0], then rerun get_refill_target_plan before choosing another action. Refill action ladder: approve generated rows only when an explicit bounded approval gate exists, process all existing same-campaign unenriched/unprepared rows in bounded batches before any source work, then copy bounded net-new rows from the selected source (selectedLeadListId, provider, and source fingerprint preserved), then use provider-aligned source-more. A new source or provider switch changes the reply-rate baseline and is a manual alternate, not a --yolo side effect. The refill_sends MCP command maintains a run-local refreshedPaidInmailSenderIds set: if the first target plan contains refresh_paid_inmail_credits for stale/missing paid-InMail facts, refill_sends refreshes each selected paid-InMail sender at most once, reruns get_refill_target_plan, and returns autoPaidInmailRefresh plus the post-refresh targetPlan before the operator chooses prep/source-copy/bounded-approval/read-only wait. Freshness gate precedes scheduler wait: if any selected target.senderRefillPlans[].paidInmail.status is missing_credit_facts or stale_credit_facts, or the target plan contains refresh_paid_inmail_credits, do not enter wait_for_scheduler even when remainingReadyOrProjectedGap is 0; refresh exact sender credit facts once, reread get_refill_target_plan, then choose scheduler wait only if freshness is clean. Do not present paid-credit refresh as the next operator action after refill_sends has returned a post-refresh targetPlan. Do not stop after filling only one sender when the request was sender-scoped. In --yolo, continue through every safe selected sender/campaign action covered by the rendered packet, reread after each terminal apply/prep/source-copy/bounded-approval/read-only wait result, recompute the target-window saturation ledger, and keep going until projected coverage (sent + scheduled) fills the scheduler-forward target window or a concrete non-scheduler blocker is proven. Ready-to-schedule rows are buffer, not completion; if ready covers the projected gap but scheduled cells do not, report loaded, awaiting scheduler and run a persistent read-only scheduler wait/reread loop and keep the run open while awaiting_scheduler_after_ready_buffer is the only remaining state. Paid-InMail threshold changes and connection-campaign creation are explicit continuation options, never --yolo side effects. When no safe in-packet action remains return concrete continuation options with campaign names, exact ids, and which options require a new approval packet; do not return final completion for scheduler wait unless Christian explicitly asks for status or stops the run. Use the refill workflow to decide whether to enrich/prep more rows in that same recent-send/best-result campaign, add/import more rows to that same campaign/source path, use a different existing campaign only when the selected same-sender lane is blocked/exhausted/already loaded while the sender still has a gap, or ask what to create. Do not create warm-post-engager side campaigns. Surface sender-health blockers and paid-InMail threshold blockers separately from prepared/approved/scheduled counts. User-facing refill decisions must be campaign-name-first and sender-name-first, with ids as proof/execution targets only. Trust schedulerGate.sendable and scheduler blockers over raw unipileAccountStatus labels alone. For long-running prep use compact prep status checks, reread target plans after prep or cancel, avoid huge parallel target-plan reads when output is large, and if prepared/ready rows grow but sender-level projected coverage does not move after one bounded settle loop, pivot to compact prep status or a scheduler-proven lane instead of waiting on campaign-level ready counts. For already-running regular campaigns that need Signal Discovery source replenishment, use the guarded currentStep clear with clearCurrentStepIfMatches:"running", campaign-scoped provider prompt/search/select, and import_leads with the existing sourceLeadListId when a newly approved selected-post scrape would otherwise return reusedExistingSourceList. Before prep, inspect get_campaign_refill_state.preparationFrontier. If hasLaterPreparedIsland:true or earliestUnpreparedRow exists before later successful enrichment, use rowSelector:{type:"needsEnrichment"} with columnRole:"enrich" in table-position order or start_campaign_message_preparation adaptive defaults; do not use the UI Jump anchor or needsGeneratedMessage as the refill cursor. After confirm_lead_list copies rows into an existing table, avoid fixed maxRowsToCheck:100; if confirm_lead_list returns USER_ADDED_ROWS_LIMIT_EXCEEDED, create a bounded same-source split from selectedLeadListId with get_rows_minimal/load_csv_linkedin_leads, confirm that smaller source list into the same campaign, and inspect reviewBatch only as diagnostics unless the approved packet explicitly prioritizes the just-copied split and earlier needsEnrichment rows are exhausted, dependency-blocked, or excluded. For approval diagnostics use rowSelector:{type:"needsApproval"} after current generated messages exist; mutating Approved cells still requires approvalMode:approve and exact bounded approval. Do not interpret checkedRows as enriched rows; it is only the table cursor. Prepared, approved, and ready_to_schedule rows are intermediate states; never call them scheduled unless a re-read proves scheduler-owned scheduled cells with non-null scheduledFor contribute to projected coverage, and never call them complete unless a final re-read proves projected coverage fills the scheduler-forward target window. Before source import, prep, approval, or selected paused campaign start, require exact visible approval or --yolo packet auto-accept and a fresh get_campaign_refill_state reread; stop if freshness.stateHash or exact ids changed. For "approve X messages", use approvalMode:approve only when explicitly requested. For "schedule X sends" or "fill sender sends", approve only when explicitly requested, then re-read campaign/table scheduled counts; if projected coverage does not fill the horizon, keep polling when ready buffer covers the gap and report only interim prepared/approved/ready - awaiting scheduler status if Christian asks. Do not call start_campaign as part of fill/schedule horizon. start_campaign is allowed in refill only for exact selected PAUSED, dashboard-active, campaign-backed sequence targets named in the bounded packet, and the packet must state that starting can let the product scheduler schedule/send approved eligible sequence actions. Never start unrelated, archived, completed, draft, direct, or non-selected campaigns, never broad approve-all, and never use direct scheduler writes. campaignId is CampaignOffer.id. If the user asks to stop preparation, the target is wrong, or status shows the wrong campaign/table, use cancel_campaign_message_preparation only for the exact active job. Low-level selectors are diagnostics and recovery only for this lane.`,
@@ -0,0 +1,123 @@
1
+ import { type MessageTemplateRevisionV1, type RefillReportingContextV2, type RefillRunHandleV1, type RefillTargetConfigV1 } from "./campaign-processing.js";
2
+ type RefillExactRunInput = {
3
+ workspaceId?: string;
4
+ runId?: string;
5
+ fence?: number;
6
+ runHandle?: RefillRunHandleV1;
7
+ targetConfig?: RefillTargetConfigV1;
8
+ reportingContext?: RefillReportingContextV2;
9
+ messageTemplateRevision?: MessageTemplateRevisionV1;
10
+ dryRun?: boolean;
11
+ approvalMode?: "approve" | "mark_ready";
12
+ senderIds?: string[];
13
+ actionTypes?: Array<"send_invite" | "send_inmail_closed">;
14
+ intent?: "auto" | "evergreen" | "plain" | "active";
15
+ targetDate?: string;
16
+ untilDate?: string;
17
+ horizonSendDays?: number;
18
+ agentKeywords?: string[];
19
+ runState?: Record<string, unknown>;
20
+ };
21
+ export declare function executeRefillExactRun(inputRaw: RefillExactRunInput): Promise<{
22
+ status: "blocked";
23
+ blocker: string;
24
+ guidance: string;
25
+ conflicts: string[];
26
+ runId: string | undefined;
27
+ readOnly: boolean;
28
+ forbiddenActions: string[];
29
+ boundedAuthority: string;
30
+ } | {
31
+ readOnly: boolean;
32
+ mode: string;
33
+ forbiddenActions: string[];
34
+ boundedAuthority: string;
35
+ blocker: string;
36
+ workspaceId: string;
37
+ guidance: string;
38
+ warnings: string[];
39
+ journalPath: string | null;
40
+ text: string;
41
+ workspaceResolution: string;
42
+ status?: undefined;
43
+ conflicts?: undefined;
44
+ runId?: undefined;
45
+ } | {
46
+ readOnly: boolean;
47
+ mode: string;
48
+ forbiddenActions: string[];
49
+ boundedAuthority: string;
50
+ warnings: any[];
51
+ journalPath: string | null;
52
+ text: string;
53
+ workspaceId: string;
54
+ workspaceResolution: string;
55
+ blocker?: undefined;
56
+ guidance?: undefined;
57
+ status?: undefined;
58
+ conflicts?: undefined;
59
+ runId?: undefined;
60
+ } | {
61
+ runSnapshot: unknown;
62
+ readOnly: boolean;
63
+ forbiddenActions: string[];
64
+ boundedAuthority: string;
65
+ status: "dry_run";
66
+ plan: Record<string, unknown>;
67
+ blocker?: undefined;
68
+ guidance?: undefined;
69
+ conflicts?: undefined;
70
+ runId?: undefined;
71
+ } | {
72
+ runSnapshot: unknown;
73
+ readOnly: boolean;
74
+ forbiddenActions: string[];
75
+ boundedAuthority: string;
76
+ status: "in_progress";
77
+ runId: string;
78
+ fence: number;
79
+ gate: import("../refill-run-loop.js").RefillLoopGate;
80
+ guidance: string;
81
+ journalPath?: string | null;
82
+ targetConfig?: RefillTargetConfigV1;
83
+ runHandle?: RefillRunHandleV1;
84
+ refillReporting?: Record<string, unknown>;
85
+ blocker?: undefined;
86
+ conflicts?: undefined;
87
+ } | {
88
+ runSnapshot: unknown;
89
+ readOnly: boolean;
90
+ forbiddenActions: string[];
91
+ boundedAuthority: string;
92
+ status: "blocked";
93
+ blocker: string;
94
+ runId?: string;
95
+ fence?: number;
96
+ gate?: import("../refill-run-loop.js").RefillLoopGate;
97
+ guidance: string;
98
+ holderRunId?: string;
99
+ report?: Record<string, unknown>;
100
+ journalPath?: string | null;
101
+ targetConfig?: RefillTargetConfigV1;
102
+ runHandle?: RefillRunHandleV1;
103
+ refillReporting?: Record<string, unknown>;
104
+ conflicts?: undefined;
105
+ } | {
106
+ runSnapshot: unknown;
107
+ readOnly: boolean;
108
+ forbiddenActions: string[];
109
+ boundedAuthority: string;
110
+ status: "terminal";
111
+ doneReason: string;
112
+ report: Record<string, unknown>;
113
+ runId: string;
114
+ guidance?: string;
115
+ journalPath?: string | null;
116
+ targetConfig?: RefillTargetConfigV1;
117
+ runHandle?: RefillRunHandleV1;
118
+ refillReporting?: Record<string, unknown>;
119
+ runState?: Record<string, unknown>;
120
+ blocker?: undefined;
121
+ conflicts?: undefined;
122
+ }>;
123
+ export {};
@@ -3,8 +3,8 @@ import { writeRefillWorkspaceState } from "../refill-local-state.js";
3
3
  import { advanceRefillRunGateRemote, completeRefillRun, heartbeatRefillRun, recordRunOutcome, recordRunPlanned, refillRunStatus, startRefillRunRemote, } from "../refill-run-client.js";
4
4
  import { runRefillV2Loop } from "../refill-run-loop.js";
5
5
  import { getPrepareCampaignMessagesStatus } from "./campaign-message-preparation.js";
6
- import { MESSAGE_TEMPLATE_REVISION_INPUT_SCHEMA, REFILL_REPORTING_CONTEXT_INPUT_SCHEMA, REFILL_RUN_HANDLE_INPUT_SCHEMA, REFILL_TARGET_CONFIG_INPUT_SCHEMA, normalizeMessageTemplateRevision, normalizeRefillRunHandle, normalizeRefillTargetConfig, } from "./campaign-processing.js";
7
- import { getRefillPlanV2 } from "./evergreen-refill-plan.js";
6
+ import { normalizeMessageTemplateRevision, normalizeRefillRunHandle, normalizeRefillTargetConfig, } from "./campaign-processing.js";
7
+ import { getRefillExecutionPlan } from "./refill-execution-plan.js";
8
8
  import { executeOneYoloPrimitive, executeStartCampaignPrimitive, prepareRowSelectorValue, refillPrepareRequestHash, refreshPaidInmailCreditsWithRetry, } from "./refill-executors.js";
9
9
  import { sanitizeRefillReportingContextProjection } from "./refill-target-plan.js";
10
10
  import { runSchedulerSweep } from "./scheduler-run.js";
@@ -17,69 +17,9 @@ const FORBIDDEN_ACTIONS = [
17
17
  "Do not write scheduler fields.",
18
18
  ];
19
19
  const BOUNDED_AUTHORITY = "Within the refill run, bounded approvals, preparation jobs, source copies, saved signal continuations, planner-ranked transitions to existing campaigns/lanes/source families, pinned-lane campaign starts, and paid-credit refreshes may execute only when named by the current packet and logged planned -> did -> outcome. New campaign creation is never refill authority.";
20
- export const refillSendsV2ToolDefinitions = [
21
- {
22
- name: "refill_sends_v2",
23
- description: "Execute the refill sends v2 loop with run-record fencing, packet re-planning, shared refill executors, and resumable dry-run/real-run modes.",
24
- inputSchema: {
25
- type: "object",
26
- properties: {
27
- workspaceId: {
28
- type: "string",
29
- description: "Explicit request-scoped workspace id.",
30
- },
31
- runId: {
32
- type: "string",
33
- description: "Optional refill run id to resume.",
34
- },
35
- fence: {
36
- type: "number",
37
- description: "Optional refill run fence to resume.",
38
- },
39
- runHandle: REFILL_RUN_HANDLE_INPUT_SCHEMA,
40
- targetConfig: REFILL_TARGET_CONFIG_INPUT_SCHEMA,
41
- reportingContext: REFILL_REPORTING_CONTEXT_INPUT_SCHEMA,
42
- messageTemplateRevision: MESSAGE_TEMPLATE_REVISION_INPUT_SCHEMA,
43
- dryRun: {
44
- type: "boolean",
45
- description: "When true, read the v2 packet and write only a dry-run journal.",
46
- },
47
- approvalMode: {
48
- type: "string",
49
- enum: ["approve", "mark_ready"],
50
- description: 'Message approval behavior for packet-named prep/approval actions. Defaults to "approve".',
51
- },
52
- senderIds: {
53
- type: "array",
54
- items: { type: "string" },
55
- },
56
- actionTypes: {
57
- type: "array",
58
- items: {
59
- type: "string",
60
- enum: ["send_invite", "send_inmail_closed"],
61
- },
62
- },
63
- intent: {
64
- type: "string",
65
- enum: ["auto", "evergreen", "plain", "active"],
66
- },
67
- agentKeywords: {
68
- type: "array",
69
- items: { type: "string" },
70
- minItems: 3,
71
- maxItems: 5,
72
- description: "Operator-agent keywords for a pending broaden_signal_search agent_supplied round: 3-5 concrete NEW GTM-topic keywords not in the blocked action's searchedKeywords negative list, validated and consumed once by the fenced run.",
73
- },
74
- },
75
- required: ["workspaceId"],
76
- additionalProperties: false,
77
- },
78
- },
79
- ];
80
20
  function normalizeWorkspaceId(workspaceId) {
81
21
  if (!workspaceId?.trim()) {
82
- throw new Error("workspaceId is required for refill_sends_v2.");
22
+ throw new Error("workspaceId is required for the exact refill run.");
83
23
  }
84
24
  return workspaceId.trim();
85
25
  }
@@ -181,7 +121,7 @@ async function reconcileResumeFillWindow(input, workspaceId) {
181
121
  }
182
122
  return { ok: true, input: merged };
183
123
  }
184
- export async function refillSendsV2Command(inputRaw) {
124
+ export async function executeRefillExactRun(inputRaw) {
185
125
  const workspaceId = normalizeWorkspaceId(inputRaw.workspaceId);
186
126
  const exactInput = {
187
127
  ...inputRaw,
@@ -212,7 +152,7 @@ export async function refillSendsV2Command(inputRaw) {
212
152
  }
213
153
  const input = reconciled.input;
214
154
  if (input.dryRun) {
215
- const plan = await getRefillPlanV2({
155
+ const plan = await getRefillExecutionPlan({
216
156
  workspaceId,
217
157
  intent: input.intent,
218
158
  senderIds: input.senderIds,
@@ -268,7 +208,7 @@ export async function refillSendsV2Command(inputRaw) {
268
208
  completeRefillRun,
269
209
  },
270
210
  readPlan: async (planInput) => {
271
- const plan = await getRefillPlanV2({
211
+ const plan = await getRefillExecutionPlan({
272
212
  workspaceId: planInput.workspaceId,
273
213
  intent: planInput.intent,
274
214
  senderIds: planInput.senderIds,
@@ -1,5 +1,5 @@
1
1
  import { type MessageTemplateRevisionV1, type RefillReportingContextV2, type RefillRunHandleV1, type RefillTargetConfigV1 } from "./campaign-processing.js";
2
- type GetRefillPlanV2Input = {
2
+ type GetRefillExecutionPlanInput = {
3
3
  workspaceId?: string;
4
4
  intent?: "auto" | "evergreen" | "plain" | "active";
5
5
  senderIds?: string[];
@@ -16,8 +16,8 @@ type GetRefillPlanV2Input = {
16
16
  journal?: boolean;
17
17
  journalNote?: string;
18
18
  };
19
- export declare function sanitizeEvergreenRefillPlanResult(value: unknown): Record<string, unknown>;
20
- export declare function projectedV2Packet(packet: Record<string, unknown>): {
19
+ export declare function sanitizeRefillExecutionPlanResult(value: unknown): Record<string, unknown>;
20
+ export declare function projectedRefillExecutionPacket(packet: Record<string, unknown>): {
21
21
  sideEffects: {
22
22
  scheduled: boolean;
23
23
  mutated: boolean;
@@ -57,57 +57,7 @@ export declare function buildRunStateFromLocalHints(workspaceId: string): {
57
57
  laneCooldowns: import("../refill-local-state.js").RefillLaneMemoryEntry[];
58
58
  passRates: import("../refill-local-state.js").RefillPassRateObservation[];
59
59
  };
60
- export declare const refillPlanV2ToolDefinitions: {
61
- name: string;
62
- description: string;
63
- inputSchema: {
64
- type: string;
65
- properties: {
66
- workspaceId: {
67
- type: string;
68
- description: string;
69
- };
70
- senderIds: {
71
- type: string;
72
- items: {
73
- type: string;
74
- };
75
- };
76
- actionTypes: {
77
- type: string;
78
- items: {
79
- type: string;
80
- enum: string[];
81
- };
82
- description: string;
83
- };
84
- approvalMode: {
85
- type: string;
86
- enum: string[];
87
- };
88
- runState: {
89
- type: string;
90
- description: string;
91
- };
92
- intent: {
93
- type: string;
94
- enum: string[];
95
- description: string;
96
- };
97
- journal: {
98
- type: string;
99
- description: string;
100
- };
101
- journalNote: {
102
- type: string;
103
- description: string;
104
- };
105
- };
106
- required: string[];
107
- additionalProperties: boolean;
108
- };
109
- }[];
110
- export declare function getRefillPlanV2(input: GetRefillPlanV2Input): Promise<{
60
+ export declare function getRefillExecutionPlan(input: GetRefillExecutionPlanInput): Promise<{
111
61
  readOnly: boolean;
112
62
  blocker: string;
113
63
  workspaceId: string;
@@ -126,6 +76,4 @@ export declare function getRefillPlanV2(input: GetRefillPlanV2Input): Promise<{
126
76
  blocker?: undefined;
127
77
  guidance?: undefined;
128
78
  }>;
129
- /** @deprecated Use getRefillPlanV2. */
130
- export declare const getEvergreenRefillPlan: typeof getRefillPlanV2;
131
79
  export {};