salesprompter-cli 0.1.44 → 0.1.46

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 (3) hide show
  1. package/README.md +5 -1
  2. package/dist/cli.js +39 -5
  3. package/package.json +1 -1
package/README.md CHANGED
@@ -86,7 +86,10 @@ salesprompter affiliate:run \
86
86
 
87
87
  # Review the persisted sequence and enrichment summary, then activate explicitly
88
88
  salesprompter affiliate:status "$AFFILIATE_RUN_ID"
89
+ salesprompter affiliate:regenerate-sequence "$AFFILIATE_RUN_ID"
89
90
  salesprompter affiliate:enrich "$AFFILIATE_RUN_ID"
91
+ salesprompter affiliate:enrich "$AFFILIATE_RUN_ID" \
92
+ --source-audience-run-id "$NEW_AUDIENCE_RUN_ID"
90
93
  salesprompter affiliate:activate "$AFFILIATE_RUN_ID"
91
94
 
92
95
  # See included capability packs
@@ -106,7 +109,8 @@ salesprompter --help
106
109
  - Use your own authorized data access and workspace credentials.
107
110
  - Respect provider terms and customer data boundaries.
108
111
  - `affiliate:run` uses direct email enrichment first, then Phantombuster Email Finder for unresolved people before creating a draft Instantly campaign.
109
- - `affiliate:enrich` reruns email recovery and adds only newly found addresses to an existing campaign.
112
+ - Affiliate preparation automatically creates three variants per step with spintax; `affiliate:regenerate-sequence` rebuilds and syncs them through the Salesprompter app.
113
+ - `affiliate:enrich` reruns email recovery and adds only newly found addresses to an existing campaign. Pass `--source-audience-run-id` to merge a newer compatible audience into that campaign without creating a duplicate campaign.
110
114
  - A draft campaign does not send until `affiliate:activate` is run.
111
115
  - The CLI is designed for interactive users and agent-assisted workflows.
112
116
  - A repo-local Chrome extension compatibility copy is available in `chrome-extension/` for local LinkedIn session sync and popup copy/debug flows.
package/dist/cli.js CHANGED
@@ -169,7 +169,15 @@ const AffiliateOutreachRunSchema = z.object({
169
169
  subject: z.string(),
170
170
  body: z.string(),
171
171
  rationale: z.string(),
172
- delayDays: z.number().int().nonnegative()
172
+ delayDays: z.number().int().nonnegative(),
173
+ variants: z
174
+ .array(z.object({
175
+ subject: z.string(),
176
+ body: z.string()
177
+ }))
178
+ .min(1)
179
+ .max(3)
180
+ .optional()
173
181
  })),
174
182
  enriched_leads: z.array(z.object({
175
183
  rowIndex: z.number().int().nonnegative(),
@@ -6567,7 +6575,18 @@ async function activateAffiliateOutreachViaApp(session, audienceRunId) {
6567
6575
  }), AffiliateOutreachResponseSchema);
6568
6576
  return value.outreach;
6569
6577
  }
6570
- async function enrichAffiliateOutreachViaApp(session, audienceRunId) {
6578
+ async function regenerateAffiliateOutreachSequenceViaApp(session, audienceRunId) {
6579
+ const { value } = await fetchCliJson(session, (currentSession) => fetch(`${currentSession.apiBaseUrl}/api/cli/affiliate-outreach/${encodeURIComponent(audienceRunId)}/sequence`, {
6580
+ method: "POST",
6581
+ headers: {
6582
+ "Content-Type": "application/json",
6583
+ Authorization: `Bearer ${currentSession.accessToken}`
6584
+ },
6585
+ body: JSON.stringify({})
6586
+ }), AffiliateOutreachResponseSchema);
6587
+ return value.outreach;
6588
+ }
6589
+ async function enrichAffiliateOutreachViaApp(session, audienceRunId, sourceAudienceRunId) {
6571
6590
  const before = await getAffiliateOutreachViaApp(session, audienceRunId);
6572
6591
  const previousAttemptedAt = typeof before.stats.latestTopUp === "object" && before.stats.latestTopUp !== null
6573
6592
  ? String(before.stats.latestTopUp.attemptedAt ?? "")
@@ -6578,7 +6597,7 @@ async function enrichAffiliateOutreachViaApp(session, audienceRunId) {
6578
6597
  "Content-Type": "application/json",
6579
6598
  Authorization: `Bearer ${currentSession.accessToken}`
6580
6599
  },
6581
- body: JSON.stringify({})
6600
+ body: JSON.stringify({ sourceAudienceRunId })
6582
6601
  }), AffiliateOutreachEnrichStartResponseSchema);
6583
6602
  const deadline = Date.now() + 10 * 60 * 1000;
6584
6603
  const configuredPollMs = Number(process.env.SALESPROMPTER_AFFILIATE_ENRICH_POLL_MS);
@@ -13323,12 +13342,27 @@ program
13323
13342
  const outreach = await getAffiliateOutreachViaApp(session, z.string().uuid().parse(runId));
13324
13343
  printOutput({ status: "ok", outreach });
13325
13344
  });
13345
+ program
13346
+ .command("affiliate:regenerate-sequence <run-id>")
13347
+ .description("Regenerate sequence variants and spintax, then sync them to Instantly.")
13348
+ .action(async (runId) => {
13349
+ const session = await requireAuthSession();
13350
+ const outreach = await regenerateAffiliateOutreachSequenceViaApp(session, z.string().uuid().parse(runId));
13351
+ printOutput({
13352
+ status: "ok",
13353
+ outreach,
13354
+ message: "Sequence variants and spintax were regenerated and synced to Instantly."
13355
+ });
13356
+ });
13326
13357
  program
13327
13358
  .command("affiliate:enrich <run-id>")
13328
13359
  .description("Find additional verified emails and add only new leads to the campaign.")
13329
- .action(async (runId) => {
13360
+ .option("--source-audience-run-id <run-id>", "Use a newer compatible audience to top up this campaign")
13361
+ .action(async (runId, options) => {
13330
13362
  const session = await requireAuthSession();
13331
- const outreach = await enrichAffiliateOutreachViaApp(session, z.string().uuid().parse(runId));
13363
+ const outreach = await enrichAffiliateOutreachViaApp(session, z.string().uuid().parse(runId), options.sourceAudienceRunId
13364
+ ? z.string().uuid().parse(options.sourceAudienceRunId)
13365
+ : undefined);
13332
13366
  printOutput({
13333
13367
  status: "ok",
13334
13368
  outreach,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "salesprompter-cli",
3
- "version": "0.1.44",
3
+ "version": "0.1.46",
4
4
  "description": "Sales workflow CLI for guided lead generation, enrichment, scoring, and sync.",
5
5
  "author": "Daniel Sinewe <hello@danielsinewe.com>",
6
6
  "type": "module",