@sellable/mcp 0.1.513 → 0.1.515

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/server.js CHANGED
@@ -240,7 +240,7 @@ server.setRequestHandler(CallToolRequestSchema, async (request) => {
240
240
  break;
241
241
  case "refill_sends_v2":
242
242
  case "refill_sends_evergreen":
243
- result = refillSendsV2Command(args);
243
+ result = await refillSendsV2Command(args);
244
244
  break;
245
245
  case "setup_evergreen_campaigns":
246
246
  result = await setupEvergreenCampaigns(args);
@@ -47,7 +47,7 @@ export const campaignProcessingToolDefinitions = [
47
47
  },
48
48
  {
49
49
  name: "select_campaign_cells",
50
- description: "Dry-run semantic campaign-cell selection. Returns compact counts and a tiny sample, never bulky row data. For regular refill diagnostics, use rowSelector:{type:\"needsEnrichment\"} to find the earliest unenriched rows by table position, then rowSelector:{type:\"needsApproval\"} to inspect current generated messages that are not approved. needsGeneratedMessage only sees rows that already passed rubric and can skip earlier unenriched rows; use it for generated-message repair, not top-down refill.",
50
+ description: 'Dry-run semantic campaign-cell selection. Returns compact counts and a tiny sample, never bulky row data. For regular refill diagnostics, use rowSelector:{type:"needsEnrichment"} to find the earliest unenriched rows by table position, then rowSelector:{type:"needsApproval"} to inspect current generated messages that are not approved. needsGeneratedMessage only sees rows that already passed rubric and can skip earlier unenriched rows; use it for generated-message repair, not top-down refill.',
51
51
  inputSchema: {
52
52
  type: "object",
53
53
  properties: {
@@ -94,7 +94,7 @@ export const campaignProcessingToolDefinitions = [
94
94
  },
95
95
  {
96
96
  name: "queue_campaign_cells",
97
- description: "Resolve and queue campaign cells by semantic role and row selector. Normal create-campaign tail should use this instead of fetching rows only to discover cell IDs. For regular refill enrichment, queue columnRole:\"enrich\" with rowSelector:{type:\"needsEnrichment\"} or use start_campaign_message_preparation for the full top-down prep loop. For approval, rowSelector:{type:\"needsApproval\"} selects current generated rows missing Approved=true, but mutating Approved cells still requires explicit bounded approval. Do not use needsGeneratedMessage as a refill cursor because it only selects already-passed rows. Use forceRerun:true for message-template revisions.",
97
+ description: 'Resolve and queue campaign cells by semantic role and row selector. Normal create-campaign tail should use this instead of fetching rows only to discover cell IDs. For regular refill enrichment, queue columnRole:"enrich" with rowSelector:{type:"needsEnrichment"} or use start_campaign_message_preparation for the full top-down prep loop. For approval, rowSelector:{type:"needsApproval"} selects current generated rows missing Approved=true, but mutating Approved cells still requires explicit bounded approval. Do not use needsGeneratedMessage as a refill cursor because it only selects already-passed rows. Use forceRerun:true for message-template revisions.',
98
98
  inputSchema: {
99
99
  type: "object",
100
100
  properties: {
@@ -103,7 +103,7 @@ export const campaignProcessingToolDefinitions = [
103
103
  workspaceId: { type: "string" },
104
104
  columnRole: {
105
105
  type: "string",
106
- enum: ["enrich", "generateMessage", "approved"],
106
+ enum: ["enrich", "icpScore", "generateMessage", "approved"],
107
107
  },
108
108
  rowSelector: {
109
109
  type: "object",
@@ -7,6 +7,12 @@ type GetRefillPlanV2Input = {
7
7
  journalNote?: string;
8
8
  };
9
9
  export declare function sanitizeEvergreenRefillPlanResult(value: unknown): Record<string, unknown>;
10
+ export declare function buildRunStateFromLocalHints(workspaceId: string): {
11
+ version: number;
12
+ senderCursors: never[];
13
+ laneCooldowns: import("../refill-local-state.js").RefillLaneMemoryEntry[];
14
+ passRates: import("../refill-local-state.js").RefillPassRateObservation[];
15
+ };
10
16
  export declare const refillPlanV2ToolDefinitions: {
11
17
  name: string;
12
18
  description: string;
@@ -36,7 +36,7 @@ export function sanitizeEvergreenRefillPlanResult(value) {
36
36
  }
37
37
  return sanitized;
38
38
  }
39
- function buildRunStateFromLocalHints(workspaceId) {
39
+ export function buildRunStateFromLocalHints(workspaceId) {
40
40
  const state = readRefillWorkspaceState(workspaceId);
41
41
  return {
42
42
  version: 1,
@@ -0,0 +1,178 @@
1
+ import { searchSignals } from "./leads.js";
2
+ export type RefillSendsApprovalMode = "approve" | "mark_ready";
3
+ export type PaidInmailRefreshAction = {
4
+ senderId: string;
5
+ actionKey?: string | null;
6
+ action?: Record<string, unknown>;
7
+ };
8
+ export type YoloPrimitiveExecution = {
9
+ enabled: true;
10
+ status: "no_action" | "read_only_reread" | "executed_and_reread" | "refused" | "skipped_after_paid_refresh";
11
+ selectedAction: Record<string, unknown> | null;
12
+ result?: unknown;
13
+ targetPlanReread: boolean;
14
+ refusalReason?: string;
15
+ postActionFirstAction?: unknown;
16
+ } | {
17
+ enabled: false;
18
+ status: "not_run_without_yolo";
19
+ selectedAction: null;
20
+ targetPlanReread: false;
21
+ };
22
+ export type YoloPrimitiveAttempt = {
23
+ status: "no_action" | "read_only_reread" | "executed_and_reread" | "refused";
24
+ result?: unknown;
25
+ refusalReason?: string;
26
+ };
27
+ export type UserAddedRowsLimitPayload = {
28
+ error?: string;
29
+ code: "USER_ADDED_ROWS_LIMIT_EXCEEDED";
30
+ maxRows?: number;
31
+ currentRows?: number;
32
+ requestedRows?: number;
33
+ attemptedRows?: number;
34
+ remainingRows?: number;
35
+ };
36
+ export type PrepareRowSelector = {
37
+ type: "needsEnrichment";
38
+ limit?: number;
39
+ } | {
40
+ type: "needsApproval";
41
+ limit?: number;
42
+ } | {
43
+ type: "needsGeneratedMessage";
44
+ limit?: number;
45
+ } | {
46
+ type: "reviewBatch";
47
+ limit?: number;
48
+ } | {
49
+ type: "staleGeneratedMessages";
50
+ limit?: number;
51
+ };
52
+ type SignalDiscoveryTab = {
53
+ keyword?: string | null;
54
+ posts?: Array<{
55
+ id?: string | null;
56
+ isSelected?: boolean | null;
57
+ }>;
58
+ };
59
+ export type ApproveBatchResult = {
60
+ approved: number;
61
+ failed: number;
62
+ partial?: boolean;
63
+ scope?: string;
64
+ message?: string;
65
+ };
66
+ export type StartCampaignAuthority = {
67
+ laneChainCampaignIds: string[];
68
+ pinnedCampaignId: string | null;
69
+ planRevision: string | null;
70
+ };
71
+ export type StartCampaignPrimitiveResult = {
72
+ executed: false;
73
+ refused: true;
74
+ reason: "action_type_not_start_paused_campaign" | "campaign_not_in_pinned_lane_chain";
75
+ campaignId: string | null;
76
+ laneChainCampaignIds: string[];
77
+ } | {
78
+ executed: false;
79
+ blocked: true;
80
+ reason: "start_route_rejected";
81
+ status: number;
82
+ body: string;
83
+ campaignId: string;
84
+ } | {
85
+ executed: true;
86
+ type: "start_paused_campaign";
87
+ campaignId: string;
88
+ authorizedBy: {
89
+ planRevision: string | null;
90
+ action: Record<string, unknown>;
91
+ };
92
+ result: unknown;
93
+ };
94
+ type RerunErroredCellsOperation = {
95
+ columnRole: "icpScore" | "generateMessage";
96
+ rowSelector: {
97
+ type: "rowIds";
98
+ rowIds: string[];
99
+ };
100
+ cellIds: string[];
101
+ };
102
+ export type RerunErroredCellsPrimitiveResult = {
103
+ executed: false;
104
+ refused: true;
105
+ reason: "action_type_not_rerun_errored_cells" | "missing_bounded_operations";
106
+ } | {
107
+ executed: true;
108
+ type: "rerun_errored_cells";
109
+ operations: Array<RerunErroredCellsOperation & {
110
+ result: unknown;
111
+ }>;
112
+ };
113
+ export declare function normalizeStrings(values: unknown): string[];
114
+ export declare function sleep(ms: number): Promise<unknown>;
115
+ export declare function recordValue(value: unknown): Record<string, unknown> | null;
116
+ export declare function stringValue(value: unknown): string | null;
117
+ export declare function numberValue(value: unknown): number | null;
118
+ export declare function stringArray(value: unknown): string[];
119
+ export declare function prepareRowSelectorValue(value: unknown): PrepareRowSelector | undefined;
120
+ export declare function uniqueStrings(values: Array<string | null | undefined>): string[];
121
+ export declare function userAddedRowsLimitPayloadFromError(error: unknown): UserAddedRowsLimitPayload | null;
122
+ export declare function paidRefreshActionFrom(value: unknown): PaidInmailRefreshAction | null;
123
+ export declare function collectPaidInmailRefreshActions(plan: unknown): PaidInmailRefreshAction[];
124
+ export declare function firstGlobalAction(plan: unknown): Record<string, unknown> | null;
125
+ export declare function actionIds(action: Record<string, unknown>): Record<string, unknown>;
126
+ export declare function actionToolInput(action: Record<string, unknown>): Record<string, unknown>;
127
+ export declare function actionCampaignId(action: Record<string, unknown>): string | null;
128
+ export declare function actionTableId(action: Record<string, unknown>): string | null;
129
+ export declare function actionSourceLeadListId(action: Record<string, unknown>): string | null;
130
+ export declare function actionSenderId(action: Record<string, unknown>): string | null;
131
+ export declare function actionActionType(action: Record<string, unknown>): string | null;
132
+ export declare function actionSourceFingerprint(action: Record<string, unknown>): string | null;
133
+ export declare function actionLeadSourceProvider(action: Record<string, unknown>): string | null;
134
+ export declare function normalizedSignalKeyword(value: unknown): string | null;
135
+ export declare function keywordsFromSignalTabs(tabs: SignalDiscoveryTab[]): string[];
136
+ export declare function selectedPostIdsFromSignalTabs(tabs: SignalDiscoveryTab[]): string[];
137
+ export declare function postIdsFromSignalSearch(summary: Awaited<ReturnType<typeof searchSignals>>, maxPosts: number, options?: {
138
+ excludePostIds?: string[];
139
+ }): string[];
140
+ export declare function maxSignalDiscoveryPostsForSourceLimit(sourceRowLimit: number): number;
141
+ export declare function refillPrepareRequestHash(params: {
142
+ action: Record<string, unknown>;
143
+ campaignId: string;
144
+ tableId?: string;
145
+ approvalMode: RefillSendsApprovalMode;
146
+ rowSelector?: PrepareRowSelector;
147
+ }): string;
148
+ export declare function boundedApprovalLimit(action: Record<string, unknown>): number | null;
149
+ export declare function approveGeneratedMessagesBatch(action: Record<string, unknown>, workspaceId?: string): Promise<{
150
+ status: "refused";
151
+ refusalReason: string;
152
+ result?: undefined;
153
+ } | {
154
+ status: "executed_and_reread";
155
+ result: ApproveBatchResult;
156
+ refusalReason?: undefined;
157
+ }>;
158
+ export declare function continueSignalDiscoverySource(action: Record<string, unknown>, workspaceId?: string): Promise<YoloPrimitiveAttempt>;
159
+ export declare function refreshPaidInmailCreditsWithRetry(senderId: string, workspaceId: string): Promise<{
160
+ receipt: import("./senders.js").RefreshPaidInmailCreditsResponse;
161
+ attempts: number;
162
+ errors: string[];
163
+ } | {
164
+ receipt: null;
165
+ attempts: number;
166
+ errors: string[];
167
+ }>;
168
+ export declare function executeStartCampaignPrimitive(params: {
169
+ action: Record<string, unknown>;
170
+ authority: StartCampaignAuthority;
171
+ workspaceId?: string | null;
172
+ }): Promise<StartCampaignPrimitiveResult>;
173
+ export declare function executeRerunErroredCellsPrimitive(params: {
174
+ action: Record<string, unknown>;
175
+ workspaceId?: string | null;
176
+ }): Promise<RerunErroredCellsPrimitiveResult>;
177
+ export declare function executeOneYoloPrimitive(action: Record<string, unknown> | null, workspaceId?: string): Promise<YoloPrimitiveAttempt>;
178
+ export {};