@sellable/mcp 0.1.510 → 0.1.512

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.
@@ -183,7 +183,9 @@ function sanitizeActionCandidate(candidate) {
183
183
  : undefined,
184
184
  activeJobId: stringValue(candidate.activeJobId) ?? null,
185
185
  activeImportStatus: stringValue(candidate.activeImportStatus) ?? null,
186
- targetRows: typeof candidate.targetRows === "number" ? candidate.targetRows : undefined,
186
+ targetRows: typeof candidate.targetRows === "number"
187
+ ? candidate.targetRows
188
+ : undefined,
187
189
  columnRole: stringValue(candidate.columnRole),
188
190
  rowSelector: sanitizeRowSelector(candidate.rowSelector),
189
191
  actionKey: stringValue(candidate.actionKey),
@@ -209,7 +211,9 @@ function sanitizeRowSelector(value) {
209
211
  return {
210
212
  type: value.type,
211
213
  ...(typeof value.limit === "number" ? { limit: value.limit } : {}),
212
- ...(Array.isArray(value.rowIds) ? { rowIds: stringArray(value.rowIds) } : {}),
214
+ ...(Array.isArray(value.rowIds)
215
+ ? { rowIds: stringArray(value.rowIds) }
216
+ : {}),
213
217
  };
214
218
  }
215
219
  function sanitizeToolInput(value) {
@@ -451,11 +455,15 @@ function sanitizeStructuredSenderPlans(value, selectedBySender) {
451
455
  selectedDays: Array.isArray(plan.horizon.selectedDays)
452
456
  ? plan.horizon.selectedDays
453
457
  : [],
458
+ requestedTarget: numberValue(plan.horizon.requestedTarget),
454
459
  grossTarget: numberValue(plan.horizon.grossTarget),
455
460
  schedulerFillableSlots: typeof plan.horizon.schedulerFillableSlots === "number"
456
461
  ? plan.horizon.schedulerFillableSlots
457
462
  : null,
458
463
  schedulerFillableSlotsKnown: plan.horizon.schedulerFillableSlotsKnown === true,
464
+ schedulerCapacityTarget: typeof plan.horizon.schedulerCapacityTarget === "number"
465
+ ? plan.horizon.schedulerCapacityTarget
466
+ : null,
459
467
  capacityConfidence: stringValue(plan.horizon.capacityConfidence) ?? "unknown",
460
468
  schedulerCapacityMode: stringValue(plan.horizon.schedulerCapacityMode),
461
469
  }
@@ -517,7 +525,9 @@ function emptyUnsupportedResult(result) {
517
525
  eligibleSenderLedger: [],
518
526
  senderRefillPlans: [],
519
527
  globalActionQueue: [],
528
+ requestedTarget: 0,
520
529
  grossTarget: 0,
530
+ effectiveTarget: 0,
521
531
  sent: 0,
522
532
  scheduled: 0,
523
533
  projected: 0,
@@ -564,7 +574,7 @@ function sanitizeBlockers(blockers, selectedKeys) {
564
574
  if (!actionType)
565
575
  return true;
566
576
  const senderId = parts[0];
567
- return selectedKeys.size === 0 || selectedKeys.has(`${senderId}:${actionType}`);
577
+ return (selectedKeys.size === 0 || selectedKeys.has(`${senderId}:${actionType}`));
568
578
  });
569
579
  }
570
580
  function sanitizeRefillTargetPlanResult(result) {
@@ -626,6 +636,13 @@ function sanitizeRefillTargetPlanResult(result) {
626
636
  };
627
637
  });
628
638
  const grossTarget = senderPlans.reduce((sum, plan) => sum + numberValue(plan.grossTarget), 0);
639
+ const requestedTarget = senderPlans.reduce((sum, plan) => sum + numberValue(plan.requestedTarget), 0);
640
+ const effectiveTarget = senderPlans.reduce((sum, plan) => {
641
+ const target = typeof plan.schedulerCapacityTarget === "number"
642
+ ? plan.schedulerCapacityTarget
643
+ : numberValue(plan.grossTarget);
644
+ return sum + target;
645
+ }, 0);
629
646
  const sent = senderPlans.reduce((sum, plan) => sum + numberValue(plan.sent), 0);
630
647
  const scheduled = senderPlans.reduce((sum, plan) => sum + numberValue(plan.scheduled), 0);
631
648
  const projected = sent + scheduled;
@@ -662,7 +679,9 @@ function sanitizeRefillTargetPlanResult(result) {
662
679
  eligibleSenderLedger,
663
680
  senderRefillPlans,
664
681
  globalActionQueue,
682
+ requestedTarget,
665
683
  grossTarget,
684
+ effectiveTarget,
666
685
  sent,
667
686
  scheduled,
668
687
  projected,
@@ -236,7 +236,7 @@ export declare const allTools: ({
236
236
  properties: {
237
237
  subskillName: {
238
238
  type: string;
239
- enum: readonly ["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", "foundation", "generate-messages", "interview", "load-voice", "refresh-sender-engagement", "refill-sends", "refill-sends-workflow", "research", "research-prospect", "research-sender", "weekly-campaign-summary", "workflow-sequences"];
239
+ enum: readonly ["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", "foundation", "generate-messages", "interview", "load-voice", "refresh-sender-engagement", "refill-sends", "refill-sends-evergreen", "refill-sends-evergreen-workflow", "refill-sends-workflow", "research", "research-prospect", "research-sender", "weekly-campaign-summary", "workflow-sequences"];
240
240
  description: string;
241
241
  };
242
242
  offset: {
@@ -271,7 +271,7 @@ export declare const allTools: ({
271
271
  properties: {
272
272
  subskillName: {
273
273
  type: string;
274
- enum: readonly ["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", "foundation", "generate-messages", "interview", "load-voice", "refresh-sender-engagement", "refill-sends", "refill-sends-workflow", "research", "research-prospect", "research-sender", "weekly-campaign-summary", "workflow-sequences"];
274
+ enum: readonly ["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", "foundation", "generate-messages", "interview", "load-voice", "refresh-sender-engagement", "refill-sends", "refill-sends-evergreen", "refill-sends-evergreen-workflow", "refill-sends-workflow", "research", "research-prospect", "research-sender", "weekly-campaign-summary", "workflow-sequences"];
275
275
  description: string;
276
276
  };
277
277
  assetPath: {
@@ -474,39 +474,6 @@ export declare const allTools: ({
474
474
  required: string[];
475
475
  additionalProperties: boolean;
476
476
  };
477
- } | {
478
- name: string;
479
- description: string;
480
- inputSchema: {
481
- type: string;
482
- properties: {
483
- intent: {
484
- type: string;
485
- enum: string[];
486
- description: string;
487
- };
488
- campaignId: {
489
- type: string;
490
- description: string;
491
- };
492
- tableId: {
493
- type: string;
494
- description: string;
495
- };
496
- limit: {
497
- type: string;
498
- minimum: number;
499
- maximum: number;
500
- description: string;
501
- };
502
- workspaceId: {
503
- type: string;
504
- description: string;
505
- };
506
- };
507
- required: string[];
508
- additionalProperties: boolean;
509
- };
510
477
  } | {
511
478
  name: string;
512
479
  description: string;
@@ -624,45 +591,6 @@ export declare const allTools: ({
624
591
  inputSchema: {
625
592
  type: string;
626
593
  properties: {
627
- capacityRequests: {
628
- type: string;
629
- minItems: number;
630
- items: {
631
- type: string;
632
- properties: {
633
- senderId: {
634
- type: string;
635
- description: string;
636
- };
637
- actionType: {
638
- type: string;
639
- enum: string[];
640
- description: string;
641
- };
642
- cellId: {
643
- type: string;
644
- description: string;
645
- };
646
- columnId: {
647
- type: string;
648
- description: string;
649
- };
650
- };
651
- required: string[];
652
- additionalProperties: boolean;
653
- };
654
- description: string;
655
- };
656
- targetDate: {
657
- type: string;
658
- pattern: string;
659
- description: string;
660
- };
661
- mode: {
662
- type: string;
663
- enum: string[];
664
- description: string;
665
- };
666
594
  workspaceId: {
667
595
  type: string;
668
596
  description: string;
@@ -1079,7 +1007,6 @@ export declare const allTools: ({
1079
1007
  useMessagingTemplate?: undefined;
1080
1008
  rubric?: undefined;
1081
1009
  flowVersion?: undefined;
1082
- workspaceId?: undefined;
1083
1010
  };
1084
1011
  required: string[];
1085
1012
  additionalProperties: boolean;
@@ -1118,7 +1045,6 @@ export declare const allTools: ({
1118
1045
  useMessagingTemplate?: undefined;
1119
1046
  rubric?: undefined;
1120
1047
  flowVersion?: undefined;
1121
- workspaceId?: undefined;
1122
1048
  };
1123
1049
  required: never[];
1124
1050
  additionalProperties?: undefined;
@@ -1157,7 +1083,6 @@ export declare const allTools: ({
1157
1083
  useMessagingTemplate?: undefined;
1158
1084
  rubric?: undefined;
1159
1085
  flowVersion?: undefined;
1160
- workspaceId?: undefined;
1161
1086
  };
1162
1087
  required: string[];
1163
1088
  additionalProperties?: undefined;
@@ -1239,7 +1164,6 @@ export declare const allTools: ({
1239
1164
  useMessagingTemplate?: undefined;
1240
1165
  rubric?: undefined;
1241
1166
  flowVersion?: undefined;
1242
- workspaceId?: undefined;
1243
1167
  };
1244
1168
  required: string[];
1245
1169
  additionalProperties: boolean;
@@ -1434,7 +1358,6 @@ export declare const allTools: ({
1434
1358
  useMessagingTemplate?: undefined;
1435
1359
  rubric?: undefined;
1436
1360
  flowVersion?: undefined;
1437
- workspaceId?: undefined;
1438
1361
  };
1439
1362
  required: never[];
1440
1363
  additionalProperties?: undefined;
@@ -1640,49 +1563,6 @@ export declare const allTools: ({
1640
1563
  clientProspectId?: undefined;
1641
1564
  senderLinkedinUrl?: undefined;
1642
1565
  messageGenerationMode?: undefined;
1643
- workspaceId?: undefined;
1644
- };
1645
- required: string[];
1646
- additionalProperties?: undefined;
1647
- };
1648
- } | {
1649
- name: string;
1650
- description: string;
1651
- inputSchema: {
1652
- type: string;
1653
- properties: {
1654
- campaignId: {
1655
- type: string;
1656
- description: string;
1657
- };
1658
- workspaceId: {
1659
- type: string;
1660
- description: string;
1661
- };
1662
- limit?: undefined;
1663
- tableId?: undefined;
1664
- leadLimit?: undefined;
1665
- page?: undefined;
1666
- filters?: undefined;
1667
- name?: undefined;
1668
- clientProspectId?: undefined;
1669
- senderLinkedinUrl?: undefined;
1670
- offerPositioning?: undefined;
1671
- campaignBrief?: undefined;
1672
- messageGenerationMode?: undefined;
1673
- currentStep?: undefined;
1674
- watchNarration?: undefined;
1675
- leadSourceType?: undefined;
1676
- leadSourceProvider?: undefined;
1677
- selectedLeadListId?: undefined;
1678
- senderIds?: undefined;
1679
- currentStepTransition?: undefined;
1680
- clearCurrentStepIfMatches?: undefined;
1681
- interactionMode?: undefined;
1682
- enableICPFilters?: undefined;
1683
- useMessagingTemplate?: undefined;
1684
- rubric?: undefined;
1685
- flowVersion?: undefined;
1686
1566
  };
1687
1567
  required: string[];
1688
1568
  additionalProperties?: undefined;
@@ -1724,7 +1604,6 @@ export declare const allTools: ({
1724
1604
  useMessagingTemplate?: undefined;
1725
1605
  rubric?: undefined;
1726
1606
  flowVersion?: undefined;
1727
- workspaceId?: undefined;
1728
1607
  };
1729
1608
  required: string[];
1730
1609
  additionalProperties?: undefined;
@@ -2430,24 +2309,6 @@ export declare const allTools: ({
2430
2309
  };
2431
2310
  required: string[];
2432
2311
  };
2433
- } | {
2434
- name: string;
2435
- description: string;
2436
- inputSchema: {
2437
- type: string;
2438
- properties: {
2439
- senderId: {
2440
- type: string;
2441
- description: string;
2442
- };
2443
- workspaceId: {
2444
- type: string;
2445
- description: string;
2446
- };
2447
- };
2448
- required: string[];
2449
- additionalProperties: boolean;
2450
- };
2451
2312
  } | {
2452
2313
  name: string;
2453
2314
  description: string;
@@ -3080,6 +2941,7 @@ export declare const allTools: ({
3080
2941
  previewOnly?: undefined;
3081
2942
  companySearchToken?: undefined;
3082
2943
  selectedCompanyIds?: undefined;
2944
+ workspaceId?: undefined;
3083
2945
  domainFilterId?: undefined;
3084
2946
  type?: undefined;
3085
2947
  profileUrl?: undefined;
@@ -3276,6 +3138,7 @@ export declare const allTools: ({
3276
3138
  previewOnly?: undefined;
3277
3139
  companySearchToken?: undefined;
3278
3140
  selectedCompanyIds?: undefined;
3141
+ workspaceId?: undefined;
3279
3142
  domainFilterId?: undefined;
3280
3143
  type?: undefined;
3281
3144
  profileUrl?: undefined;
@@ -3371,6 +3234,7 @@ export declare const allTools: ({
3371
3234
  previewOnly?: undefined;
3372
3235
  companySearchToken?: undefined;
3373
3236
  selectedCompanyIds?: undefined;
3237
+ workspaceId?: undefined;
3374
3238
  domainFilterId?: undefined;
3375
3239
  type?: undefined;
3376
3240
  profileUrl?: undefined;
@@ -3538,6 +3402,7 @@ export declare const allTools: ({
3538
3402
  previewOnly?: undefined;
3539
3403
  companySearchToken?: undefined;
3540
3404
  selectedCompanyIds?: undefined;
3405
+ workspaceId?: undefined;
3541
3406
  domainFilterId?: undefined;
3542
3407
  type?: undefined;
3543
3408
  profileUrl?: undefined;
@@ -3647,6 +3512,7 @@ export declare const allTools: ({
3647
3512
  previewOnly?: undefined;
3648
3513
  companySearchToken?: undefined;
3649
3514
  selectedCompanyIds?: undefined;
3515
+ workspaceId?: undefined;
3650
3516
  domainFilterId?: undefined;
3651
3517
  type?: undefined;
3652
3518
  profileUrl?: undefined;
@@ -3765,6 +3631,7 @@ export declare const allTools: ({
3765
3631
  previewOnly?: undefined;
3766
3632
  companySearchToken?: undefined;
3767
3633
  selectedCompanyIds?: undefined;
3634
+ workspaceId?: undefined;
3768
3635
  domainFilterId?: undefined;
3769
3636
  type?: undefined;
3770
3637
  profileUrl?: undefined;
@@ -3872,6 +3739,7 @@ export declare const allTools: ({
3872
3739
  previewOnly?: undefined;
3873
3740
  companySearchToken?: undefined;
3874
3741
  selectedCompanyIds?: undefined;
3742
+ workspaceId?: undefined;
3875
3743
  domainFilterId?: undefined;
3876
3744
  type?: undefined;
3877
3745
  profileUrl?: undefined;
@@ -3984,6 +3852,7 @@ export declare const allTools: ({
3984
3852
  previewOnly?: undefined;
3985
3853
  companySearchToken?: undefined;
3986
3854
  selectedCompanyIds?: undefined;
3855
+ workspaceId?: undefined;
3987
3856
  domainFilterId?: undefined;
3988
3857
  type?: undefined;
3989
3858
  profileUrl?: undefined;
@@ -4084,6 +3953,7 @@ export declare const allTools: ({
4084
3953
  previewOnly?: undefined;
4085
3954
  companySearchToken?: undefined;
4086
3955
  selectedCompanyIds?: undefined;
3956
+ workspaceId?: undefined;
4087
3957
  domainFilterId?: undefined;
4088
3958
  type?: undefined;
4089
3959
  profileUrl?: undefined;
@@ -4976,6 +4846,7 @@ export declare const allTools: ({
4976
4846
  exclude?: undefined;
4977
4847
  companySearchToken?: undefined;
4978
4848
  selectedCompanyIds?: undefined;
4849
+ workspaceId?: undefined;
4979
4850
  domainFilterId?: undefined;
4980
4851
  type?: undefined;
4981
4852
  profileUrl?: undefined;
@@ -5085,6 +4956,7 @@ export declare const allTools: ({
5085
4956
  seedDomains?: undefined;
5086
4957
  sort?: undefined;
5087
4958
  previewOnly?: undefined;
4959
+ workspaceId?: undefined;
5088
4960
  domainFilterId?: undefined;
5089
4961
  type?: undefined;
5090
4962
  profileUrl?: undefined;
@@ -6071,6 +5943,10 @@ export declare const allTools: ({
6071
5943
  type: string;
6072
5944
  description: string;
6073
5945
  };
5946
+ workspaceId: {
5947
+ type: string;
5948
+ description: string;
5949
+ };
6074
5950
  searchName: {
6075
5951
  type: string;
6076
5952
  description: string;
@@ -6295,6 +6171,7 @@ export declare const allTools: ({
6295
6171
  previewOnly?: undefined;
6296
6172
  companySearchToken?: undefined;
6297
6173
  selectedCompanyIds?: undefined;
6174
+ workspaceId?: undefined;
6298
6175
  domainFilterId?: undefined;
6299
6176
  sourceLeadListId?: undefined;
6300
6177
  targetLeadCount?: undefined;
@@ -6327,6 +6204,10 @@ export declare const allTools: ({
6327
6204
  type: string;
6328
6205
  description: string;
6329
6206
  };
6207
+ workspaceId: {
6208
+ type: string;
6209
+ description: string;
6210
+ };
6330
6211
  provider: {
6331
6212
  type: string;
6332
6213
  enum: string[];
@@ -6470,6 +6351,10 @@ export declare const allTools: ({
6470
6351
  type: string;
6471
6352
  description: string;
6472
6353
  };
6354
+ workspaceId: {
6355
+ type: string;
6356
+ description: string;
6357
+ };
6473
6358
  tableId: {
6474
6359
  type: string;
6475
6360
  description: string;
@@ -6568,6 +6453,10 @@ export declare const allTools: ({
6568
6453
  type: string;
6569
6454
  description: string;
6570
6455
  };
6456
+ workspaceId: {
6457
+ type: string;
6458
+ description: string;
6459
+ };
6571
6460
  sourceLeadListId: {
6572
6461
  type: string;
6573
6462
  description: string;
@@ -6800,6 +6689,7 @@ export declare const allTools: ({
6800
6689
  previewOnly?: undefined;
6801
6690
  companySearchToken?: undefined;
6802
6691
  selectedCompanyIds?: undefined;
6692
+ workspaceId?: undefined;
6803
6693
  domainFilterId?: undefined;
6804
6694
  type?: undefined;
6805
6695
  profileUrl?: undefined;
@@ -6897,6 +6787,7 @@ export declare const allTools: ({
6897
6787
  previewOnly?: undefined;
6898
6788
  companySearchToken?: undefined;
6899
6789
  selectedCompanyIds?: undefined;
6790
+ workspaceId?: undefined;
6900
6791
  domainFilterId?: undefined;
6901
6792
  type?: undefined;
6902
6793
  profileUrl?: undefined;
@@ -33,6 +33,8 @@ import { onDemandToolDefinitions } from "./one-off.js";
33
33
  import { processingToolDefinitions } from "./processing.js";
34
34
  import { promptToolDefinitions } from "./prompts.js";
35
35
  import { readinessToolDefinitions } from "./readiness.js";
36
+ import { evergreenRefillPlanToolDefinitions } from "./evergreen-refill-plan.js";
37
+ import { refillSendsEvergreenToolDefinitions } from "./refill-sends-evergreen.js";
36
38
  import { refillTargetPlanToolDefinitions } from "./refill-target-plan.js";
37
39
  import { refillSendsToolDefinitions } from "./refill-sends.js";
38
40
  import { rowToolDefinitions } from "./rows.js";
@@ -52,9 +54,11 @@ export const allTools = [
52
54
  ...campaignAbTestToolDefinitions,
53
55
  ...campaignFillRoutingToolDefinitions,
54
56
  ...campaignRefillStateToolDefinitions,
57
+ ...evergreenRefillPlanToolDefinitions,
55
58
  ...refillTargetPlanToolDefinitions,
56
59
  ...schedulerFillCapacityToolDefinitions,
57
60
  ...refillSendsToolDefinitions,
61
+ ...refillSendsEvergreenToolDefinitions,
58
62
  ...setupEvergreenCampaignsToolDefinitions,
59
63
  ...campaignHorizonFillToolDefinitions,
60
64
  ...campaignMessagePreparationToolDefinitions,
@@ -34,7 +34,7 @@ export type SenderDetailResponse = {
34
34
  };
35
35
  export type RefreshPaidInmailCreditsInput = {
36
36
  senderId: string;
37
- workspaceId?: string;
37
+ workspaceId: string;
38
38
  };
39
39
  export type PaidInmailCreditStatus = {
40
40
  available: number;
@@ -47,6 +47,7 @@ export type RefreshPaidInmailCreditsResponse = {
47
47
  senderId: string;
48
48
  refreshed: true;
49
49
  credits: PaidInmailCreditStatus;
50
+ receipt?: unknown;
50
51
  sideEffects: {
51
52
  refreshedLinkedInDerivedCreditFacts: true;
52
53
  updatedSenderCreditCache: true;
@@ -136,20 +136,20 @@ export const senderToolDefinitions = [
136
136
  },
137
137
  {
138
138
  name: "refresh_paid_inmail_credits",
139
- description: "Refresh the cached paid InMail credit facts for one exact sender in the active workspace by calling Sellable's product credit refresh path. This updates only the sender credit cache (balance, sentSince, checkedAt) and returns the fresh status. It does not mutate campaigns, lower thresholds, approve messages, schedule sends, start campaigns, send messages, spend InMail credits, or write scheduler fields. refill_sends --yolo normally handles get_refill_target_plan refresh_paid_inmail_credits candidates internally; use this standalone tool for manual diagnostics or explicit one-off refreshes, then rerun get_refill_target_plan before any refill mutation.",
139
+ description: "Refresh the cached paid InMail credit facts for one exact sender in the explicit request-scoped workspace by calling Sellable's scoped MCP credit refresh path. This updates only the sender credit cache/attempt metadata (balance, sentSince, checkedAt, last attempted/error/lease) and returns the sanitized coordinator receipt. It does not mutate campaigns, lower thresholds, approve messages, schedule sends, start campaigns, send messages, spend InMail credits, or write scheduler fields. refill_sends --yolo normally handles get_refill_target_plan refresh_paid_inmail_credits candidates internally; use this standalone tool for manual diagnostics or explicit one-off refreshes, then rerun get_refill_target_plan before any refill mutation.",
140
140
  inputSchema: {
141
141
  type: "object",
142
142
  properties: {
143
143
  senderId: {
144
144
  type: "string",
145
- description: "Exact Sender.id to refresh. The API verifies the sender belongs to the active workspace.",
145
+ description: "Exact Sender.id to refresh. The API verifies the sender belongs to the explicit workspace.",
146
146
  },
147
147
  workspaceId: {
148
148
  type: "string",
149
149
  description: "Explicit request-scoped workspace id for scheduled/yolo refill automation. Pass this instead of switching the shared active workspace.",
150
150
  },
151
151
  },
152
- required: ["senderId"],
152
+ required: ["senderId", "workspaceId"],
153
153
  additionalProperties: false,
154
154
  },
155
155
  },
@@ -209,15 +209,17 @@ export async function refreshPaidInmailCredits(input) {
209
209
  }
210
210
  const api = getApi();
211
211
  const workspaceId = normalizeExplicitWorkspaceId(input.workspaceId);
212
+ if (!workspaceId) {
213
+ throw new Error("workspaceId is required.");
214
+ }
212
215
  const requestOptions = workspaceRequestOptions(workspaceId);
213
- const body = workspaceId ? { workspaceId } : {};
214
- const result = requestOptions
215
- ? await api.post(`/api/v3/senders/${encodeURIComponent(senderId)}/refresh-inmail-credits`, body, requestOptions)
216
- : await api.post(`/api/v3/senders/${encodeURIComponent(senderId)}/refresh-inmail-credits`, body);
216
+ const body = { workspaceId };
217
+ const result = await api.post(`/api/v3/mcp/senders/${encodeURIComponent(senderId)}/refresh-inmail-credits`, body, requestOptions);
217
218
  return {
218
219
  senderId,
219
220
  refreshed: true,
220
221
  credits: normalizeCreditStatus(result?.credits),
222
+ receipt: result?.receipt,
221
223
  sideEffects: {
222
224
  refreshedLinkedInDerivedCreditFacts: true,
223
225
  updatedSenderCreditCache: true,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sellable/mcp",
3
- "version": "0.1.510",
3
+ "version": "0.1.512",
4
4
  "type": "module",
5
5
  "description": "Sellable MCP server for Claude Code and Codex campaign workflows",
6
6
  "main": "dist/index.js",
@@ -7,6 +7,7 @@ allowed-tools:
7
7
  - mcp__sellable__get_refill_target_plan
8
8
  - mcp__sellable__get_scheduler_fill_capacity
9
9
  - mcp__sellable__refresh_paid_inmail_credits
10
+ - mcp__sellable__get_subskill_asset
10
11
  - mcp__sellable__get_auth_status
11
12
  - mcp__sellable__start_cli_login
12
13
  - mcp__sellable__wait_for_cli_login
@@ -151,19 +152,23 @@ explicitly stops/statuses the run, or a concrete non-scheduler blocker appears.
151
152
  Do not call the goal complete or blocked only because the current state is
152
153
  `awaiting_scheduler_after_ready_buffer`; treat it as loaded, awaiting scheduler.
153
154
 
154
- Load the internal workflow prompt before taking any operational step:
155
+ Load the internal workflow prompt and deterministic flow asset before taking
156
+ any operational step:
155
157
 
156
158
  ```text
157
159
  get_subskill_prompt({ subskillName: "refill-sends-workflow" })
160
+ get_subskill_asset({ subskillName: "refill-sends-workflow", assetPath: "core/flow.v1.json" })
158
161
  ```
159
162
 
160
- Then follow that workflow exactly. The default path is read-only research:
161
- compute the refill target plan first, resolve the route, identify the
162
- sender-relevant campaign that most recently had scheduler-owned sends, read
163
- refill state for that target, report the next safe step using campaign names
164
- first, and stop before mutation unless the user has explicitly approved the
165
- exact workspace, campaign/table/source ids, caps/dates, approval mode, expected
166
- side effects, and stop/rollback condition.
163
+ Continue both loads until `hasMore:false`; parse the flow JSON and verify
164
+ `workflow:"refill-sends-workflow"` with a `v1` version. Then follow that
165
+ workflow exactly. The default path is read-only research: compute the refill
166
+ target plan first, resolve the route, identify the sender-relevant campaign
167
+ that most recently had scheduler-owned sends, read refill state for that target,
168
+ report the next safe step using campaign names first, and stop before mutation
169
+ unless the user has explicitly approved the exact workspace,
170
+ campaign/table/source ids, caps/dates, approval mode, expected side effects,
171
+ and stop/rollback condition.
167
172
 
168
173
  Immediately after loading the internal workflow, call
169
174
  `get_refill_target_plan`. The target plan is the canonical first fact receipt:
@@ -223,6 +228,20 @@ threshold, below-threshold paid-InMail facts fall back to an existing connection
223
228
  lane, the same Sales Nav cascade campaign's connection branch, or a manual
224
229
  continuation.
225
230
 
231
+ Freshness gate precedes scheduler wait: if any selected
232
+ `target.senderRefillPlans[].paidInmail.status` is `missing_credit_facts` or
233
+ `stale_credit_facts`, or the target plan contains a
234
+ `refresh_paid_inmail_credits` candidate, do not enter `wait_for_scheduler` even
235
+ when `remainingReadyOrProjectedGap:0`. Refresh the exact selected sender credit
236
+ facts once, rerun `get_refill_target_plan`, and only then decide whether
237
+ scheduler wait is the next safe action. If facts remain missing/stale after the
238
+ single refresh attempt, stop with a paid-InMail freshness blocker instead of
239
+ waiting on scheduler pickup.
240
+ The standalone MCP refresh surface is the scoped route
241
+ `/api/v3/mcp/senders/:senderId/refresh-inmail-credits` with explicit
242
+ `workspaceId`; do not use active-workspace mutation as the automation control
243
+ path.
244
+
226
245
  Compact refill lessons: sender-level target plan is final truth; trust
227
246
  `schedulerGate.sendable` and scheduler gate blockers, not raw
228
247
  `unipileAccountStatus` labels alone; use compact prep status checks for
@@ -239,8 +258,9 @@ will try to place and does not import, approve, schedule, refresh credits, or
239
258
  mutate.
240
259
  If the target plan is complete by projected coverage, report that the selected
241
260
  target is already filled and no-op without asking for approval. If the ready
242
- buffer covers the projected gap but scheduled coverage is still short, keep the
243
- run open in a persistent read-only scheduler wait loop. Poll
261
+ buffer covers the projected gap, paid InMail credit facts are fresh for every
262
+ selected paid-InMail lane, but scheduled coverage is still short, keep the run
263
+ open in a persistent read-only scheduler wait loop. Poll
244
264
  `get_refill_target_plan` every 60-120 seconds, or on the host's next continuation
245
265
  interval, until projected coverage fills the target, a concrete non-scheduler
246
266
  blocker appears, or Christian explicitly asks to stop or only receive a status