@sellable/mcp 0.1.557 → 0.1.558

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.
Files changed (63) hide show
  1. package/README.md +2 -13
  2. package/agents/registry.json +2 -2
  3. package/dist/api.js +6 -3
  4. package/dist/auth.d.ts +6 -0
  5. package/dist/auth.js +44 -2
  6. package/dist/refill-contract.d.ts +157 -0
  7. package/dist/refill-contract.js +487 -0
  8. package/dist/refill-run-client.d.ts +10 -0
  9. package/dist/refill-run-client.js +22 -0
  10. package/dist/refill-run-loop.d.ts +14 -2
  11. package/dist/refill-run-loop.js +160 -15
  12. package/dist/server.js +0 -23
  13. package/dist/tools/auth.d.ts +5 -0
  14. package/dist/tools/auth.js +49 -12
  15. package/dist/tools/campaign-message-preparation.d.ts +62 -0
  16. package/dist/tools/campaign-message-preparation.js +41 -0
  17. package/dist/tools/campaigns.js +2 -2
  18. package/dist/tools/csv-dnc.js +2 -2
  19. package/dist/tools/evergreen-refill-plan.d.ts +3 -0
  20. package/dist/tools/evergreen-refill-plan.js +29 -7
  21. package/dist/tools/leads.d.ts +32 -317
  22. package/dist/tools/leads.js +10 -171
  23. package/dist/tools/model-quality.js +6 -4
  24. package/dist/tools/prompts.d.ts +3 -3
  25. package/dist/tools/prompts.js +15 -7
  26. package/dist/tools/provider-preflight.d.ts +2 -65
  27. package/dist/tools/provider-preflight.js +10 -97
  28. package/dist/tools/readiness.d.ts +5 -89
  29. package/dist/tools/readiness.js +0 -66
  30. package/dist/tools/refill-executors.d.ts +38 -0
  31. package/dist/tools/refill-executors.js +222 -3
  32. package/dist/tools/refill-sends-v2.d.ts +118 -1
  33. package/dist/tools/refill-sends-v2.js +312 -3
  34. package/dist/tools/refill-sends.d.ts +678 -32
  35. package/dist/tools/refill-sends.js +274 -13
  36. package/dist/tools/refill-target-plan.js +486 -14
  37. package/dist/tools/registry.d.ts +115 -330
  38. package/dist/tools/registry.js +1 -7
  39. package/dist/tools/scheduler-fill-capacity.js +1 -1
  40. package/dist/tools/scheduler-run.d.ts +71 -0
  41. package/dist/tools/scheduler-run.js +203 -1
  42. package/dist/tools/setup-evergreen-campaigns.js +1 -1
  43. package/dist/tools/workspace-context.d.ts +1 -1
  44. package/dist/tools/workspace-context.js +8 -3
  45. package/dist/tools/workspace-export.js +2 -2
  46. package/dist/tools/workspaces.d.ts +48 -2
  47. package/dist/tools/workspaces.js +48 -5
  48. package/package.json +1 -1
  49. package/skills/create-campaign/SKILL.md +3 -3
  50. package/skills/create-campaign-v2/SKILL.md +1 -1
  51. package/skills/create-evergreen-campaigns/SKILL.md +16 -16
  52. package/skills/find-leads/SKILL.md +630 -48
  53. package/skills/refill-sends/SKILL.md +91 -353
  54. package/skills/refill-sends-v2/SKILL.md +6 -6
  55. package/skills/refill-sends-v2-workflow/SKILL.md +5 -5
  56. package/skills/refill-sends-v2-workflow/core/flow.v1.json +8 -8
  57. package/skills/refill-sends-workflow/SKILL.md +100 -743
  58. package/skills/refill-sends-workflow/core/contract.v2.json +543 -0
  59. package/skills/refill-sends-workflow/core/flow.v1.json +185 -1
  60. package/dist/tools/find-leads-runs.d.ts +0 -151
  61. package/dist/tools/find-leads-runs.js +0 -98
  62. package/skills/find-leads-v2/SKILL.md +0 -70
  63. package/skills/find-leads-v2/core/flow.v1.json +0 -31
@@ -3,7 +3,7 @@ import { createHash, createHmac, randomBytes } from "node:crypto";
3
3
  import { readFileSync, statSync } from "node:fs";
4
4
  import { dirname, isAbsolute, resolve } from "node:path";
5
5
  import { getApi } from "../api.js";
6
- import { getConfig } from "../auth.js";
6
+ import { getConfig, getEffectiveConfiguredWorkspaceId } from "../auth.js";
7
7
  import { resolveWorkspaceRoot } from "../utils/workspace-root.js";
8
8
  import { sanitizeCsvDomainCandidate } from "./csv-domains.js";
9
9
  import { validateAndNormalizeLinkedInUrl } from "./csv-linkedin.js";
@@ -324,7 +324,7 @@ function dedupeCandidates(candidates) {
324
324
  }
325
325
  async function getVerifiedActiveWorkspace() {
326
326
  const config = getConfig();
327
- const activeWorkspaceId = config.activeWorkspaceId || config.workspaceId;
327
+ const activeWorkspaceId = getEffectiveConfiguredWorkspaceId(config);
328
328
  if (!activeWorkspaceId) {
329
329
  throw new Error("No active workspace selected. Run list_workspaces then set_active_workspace for the exact workspace whose Sellable DNC list should be read or updated.");
330
330
  }
@@ -2,6 +2,9 @@ type GetRefillPlanV2Input = {
2
2
  workspaceId?: string;
3
3
  intent?: "auto" | "evergreen" | "plain" | "active";
4
4
  senderIds?: string[];
5
+ horizonSendDays?: number;
6
+ untilDate?: string;
7
+ targetDate?: string;
5
8
  runState?: Record<string, unknown>;
6
9
  journal?: boolean;
7
10
  journalNote?: string;
@@ -2,6 +2,7 @@ import * as path from "node:path";
2
2
  import { getApi, SellableApiError } from "../api.js";
3
3
  import { appendIndexLine, appendJournalEvent, createRunJournal, renderBootstrapSection, renderPlanSection, renderTerminalSection, } from "../refill-journal.js";
4
4
  import { readRefillWorkspaceState } from "../refill-local-state.js";
5
+ import { getRefillTargetPlan } from "./refill-target-plan.js";
5
6
  import { normalizeExplicitWorkspaceId, workspaceRequestOptions, } from "./workspace-context.js";
6
7
  const KNOWN_TOP_LEVEL_FIELDS = [
7
8
  "readOnly",
@@ -199,12 +200,24 @@ export async function getRefillPlanV2(input) {
199
200
  : buildRunStateFromLocalHints(workspaceId);
200
201
  let raw;
201
202
  try {
202
- raw = await postRefillPlanV2({
203
- workspaceId,
204
- intent: input.intent ?? "auto",
205
- senderIds: input.senderIds,
206
- runState,
207
- }, workspaceId);
203
+ const hasExplicitDateSelector = input.targetDate !== undefined ||
204
+ input.untilDate !== undefined ||
205
+ input.horizonSendDays !== undefined;
206
+ raw = hasExplicitDateSelector
207
+ ? await getRefillTargetPlan({
208
+ workspaceId,
209
+ intent: input.intent === "auto" ? undefined : (input.intent ?? undefined),
210
+ senderIds: input.senderIds,
211
+ targetDate: input.targetDate,
212
+ untilDate: input.untilDate,
213
+ horizonSendDays: input.horizonSendDays,
214
+ })
215
+ : await postRefillPlanV2({
216
+ workspaceId,
217
+ intent: input.intent ?? "auto",
218
+ senderIds: input.senderIds,
219
+ runState,
220
+ }, workspaceId);
208
221
  }
209
222
  catch (error) {
210
223
  if (!isWorkspaceAccessError(error))
@@ -238,7 +251,16 @@ export async function getRefillPlanV2(input) {
238
251
  workspaceResolution: "explicit",
239
252
  };
240
253
  }
241
- const sanitized = sanitizeEvergreenRefillPlanResult(raw);
254
+ const rawRecord = isRecord(raw) ? raw : {};
255
+ const target = isRecord(rawRecord.target) ? rawRecord.target : null;
256
+ const sanitized = sanitizeEvergreenRefillPlanResult(target
257
+ ? {
258
+ ...rawRecord,
259
+ plans: target.senderRefillPlans,
260
+ globalActionQueue: target.globalActionQueue,
261
+ packet: rawRecord,
262
+ }
263
+ : rawRecord);
242
264
  const warnings = Array.isArray(sanitized.warnings)
243
265
  ? [...sanitized.warnings]
244
266
  : [];