@sellable/mcp 0.1.557 → 0.1.559
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/README.md +2 -13
- package/agents/registry.json +2 -2
- package/dist/api.js +6 -3
- package/dist/auth.d.ts +6 -0
- package/dist/auth.js +44 -2
- package/dist/refill-contract.d.ts +157 -0
- package/dist/refill-contract.js +487 -0
- package/dist/refill-run-client.d.ts +10 -0
- package/dist/refill-run-client.js +22 -0
- package/dist/refill-run-loop.d.ts +14 -2
- package/dist/refill-run-loop.js +169 -18
- package/dist/server.js +0 -23
- package/dist/tools/auth.d.ts +5 -0
- package/dist/tools/auth.js +49 -12
- package/dist/tools/campaign-message-preparation.d.ts +62 -0
- package/dist/tools/campaign-message-preparation.js +41 -0
- package/dist/tools/campaigns.js +2 -2
- package/dist/tools/csv-dnc.js +2 -2
- package/dist/tools/evergreen-refill-plan.d.ts +3 -0
- package/dist/tools/evergreen-refill-plan.js +29 -7
- package/dist/tools/leads.d.ts +32 -317
- package/dist/tools/leads.js +10 -171
- package/dist/tools/model-quality.js +6 -4
- package/dist/tools/prompts.d.ts +3 -3
- package/dist/tools/prompts.js +15 -7
- package/dist/tools/provider-preflight.d.ts +2 -65
- package/dist/tools/provider-preflight.js +10 -97
- package/dist/tools/readiness.d.ts +5 -89
- package/dist/tools/readiness.js +0 -66
- package/dist/tools/refill-executors.d.ts +38 -0
- package/dist/tools/refill-executors.js +222 -3
- package/dist/tools/refill-sends-v2.d.ts +118 -1
- package/dist/tools/refill-sends-v2.js +312 -3
- package/dist/tools/refill-sends.d.ts +678 -32
- package/dist/tools/refill-sends.js +274 -13
- package/dist/tools/refill-target-plan.js +486 -14
- package/dist/tools/registry.d.ts +115 -330
- package/dist/tools/registry.js +1 -7
- package/dist/tools/scheduler-fill-capacity.js +1 -1
- package/dist/tools/scheduler-run.d.ts +71 -0
- package/dist/tools/scheduler-run.js +203 -1
- package/dist/tools/setup-evergreen-campaigns.js +1 -1
- package/dist/tools/workspace-context.d.ts +1 -1
- package/dist/tools/workspace-context.js +8 -3
- package/dist/tools/workspace-export.js +2 -2
- package/dist/tools/workspaces.d.ts +48 -2
- package/dist/tools/workspaces.js +48 -5
- package/package.json +1 -1
- package/skills/create-campaign/SKILL.md +3 -3
- package/skills/create-campaign-v2/SKILL.md +1 -1
- package/skills/create-evergreen-campaigns/SKILL.md +16 -16
- package/skills/find-leads/SKILL.md +630 -48
- package/skills/refill-sends/SKILL.md +94 -353
- package/skills/refill-sends-v2/SKILL.md +6 -6
- package/skills/refill-sends-v2-workflow/SKILL.md +5 -5
- package/skills/refill-sends-v2-workflow/core/flow.v1.json +8 -8
- package/skills/refill-sends-workflow/SKILL.md +100 -743
- package/skills/refill-sends-workflow/core/contract.v2.json +543 -0
- package/skills/refill-sends-workflow/core/flow.v1.json +185 -1
- package/dist/tools/find-leads-runs.d.ts +0 -151
- package/dist/tools/find-leads-runs.js +0 -98
- package/skills/find-leads-v2/SKILL.md +0 -70
- package/skills/find-leads-v2/core/flow.v1.json +0 -31
package/dist/tools/campaigns.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { getApi } from "../api.js";
|
|
2
|
-
import { getConfig } from "../auth.js";
|
|
2
|
+
import { getConfig, getEffectiveConfiguredWorkspaceId } from "../auth.js";
|
|
3
3
|
import { assertCreateCampaignPromptLoaded, assertNetNewCreateCampaignResearchReady, } from "./flow-preflight.js";
|
|
4
4
|
import { setCampaignInteractionMode, } from "./interaction-mode.js";
|
|
5
5
|
import { isLinkedInProfileInput, normalizeLinkedInProfileInput, } from "./linkedin-url.js";
|
|
@@ -114,7 +114,7 @@ function normalizeLeadSourceProvider(input) {
|
|
|
114
114
|
: null;
|
|
115
115
|
}
|
|
116
116
|
export function buildWatchUrl(config, path) {
|
|
117
|
-
const workspaceId = config
|
|
117
|
+
const workspaceId = getEffectiveConfiguredWorkspaceId(config);
|
|
118
118
|
const url = new URL(path, config.apiUrl);
|
|
119
119
|
if (workspaceId && !url.searchParams.has("workspaceId")) {
|
|
120
120
|
url.searchParams.set("workspaceId", workspaceId);
|
package/dist/tools/csv-dnc.js
CHANGED
|
@@ -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
|
|
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
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
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
|
|
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
|
: [];
|