sproutkit-code 1.12.0 → 1.13.0

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 (2) hide show
  1. package/dist/index.js +64 -5
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -97,7 +97,8 @@ var require_runtime = __commonJS({
97
97
  "report_key",
98
98
  "smtp_pass",
99
99
  "imap_pass",
100
- "stripe_secret_key"
100
+ "stripe_secret_key",
101
+ "elevenlabs_key"
101
102
  ]);
102
103
  function isSecretSetting(key) {
103
104
  return SECRET_SETTINGS.has(key);
@@ -394,6 +395,30 @@ var require_db = __commonJS({
394
395
  handed_over_at TEXT
395
396
  );
396
397
  `);
398
+ for (const col of [
399
+ "domain_choice TEXT",
400
+ "domain_price_pence INTEGER",
401
+ "domain_cost_usd REAL",
402
+ "domain_status TEXT",
403
+ "domain_order_id TEXT"
404
+ ]) {
405
+ try {
406
+ db2.exec(`ALTER TABLE leads ADD COLUMN ${col}`);
407
+ } catch {
408
+ }
409
+ }
410
+ for (const col of ["pitch_video_url TEXT", "pitch_poster_url TEXT", "pitch_script TEXT"]) {
411
+ try {
412
+ db2.exec(`ALTER TABLE leads ADD COLUMN ${col}`);
413
+ } catch {
414
+ }
415
+ }
416
+ for (const col of ["domain TEXT", "domain_pence INTEGER NOT NULL DEFAULT 0"]) {
417
+ try {
418
+ db2.exec(`ALTER TABLE deals ADD COLUMN ${col}`);
419
+ } catch {
420
+ }
421
+ }
397
422
  }
398
423
  function getDb2() {
399
424
  return db2;
@@ -84437,6 +84462,30 @@ Reply with only this, no other text:
84437
84462
  }
84438
84463
  });
84439
84464
 
84465
+ // ../desktop/dist/main/lib/pitch-text.js
84466
+ var require_pitch_text = __commonJS({
84467
+ "../desktop/dist/main/lib/pitch-text.js"(exports2) {
84468
+ "use strict";
84469
+ Object.defineProperty(exports2, "__esModule", { value: true });
84470
+ exports2.withVideo = withVideo;
84471
+ function withVideo(message, videoUrl) {
84472
+ if (!videoUrl)
84473
+ return message.replace(/\n?[^\n]*\{video\}[^\n]*/g, "");
84474
+ if (message.includes("{video}"))
84475
+ return message.replace(/\{video\}/g, videoUrl);
84476
+ const line = `I also recorded a short video walking you through it: ${videoUrl}`;
84477
+ const lines = message.split("\n");
84478
+ const at = lines.findIndex((l) => /https?:\/\//.test(l));
84479
+ if (at < 0)
84480
+ return `${message}
84481
+
84482
+ ${line}`;
84483
+ lines.splice(at + 1, 0, "", line);
84484
+ return lines.join("\n");
84485
+ }
84486
+ }
84487
+ });
84488
+
84440
84489
  // ../desktop/dist/main/lib/followup.js
84441
84490
  var require_followup = __commonJS({
84442
84491
  "../desktop/dist/main/lib/followup.js"(exports2) {
@@ -97260,6 +97309,7 @@ var require_chat_tools = __commonJS({
97260
97309
  var builder_1 = require_builder();
97261
97310
  var lead_search_1 = require_lead_search();
97262
97311
  var ai_search_1 = require_ai_search();
97312
+ var pitch_text_1 = require_pitch_text();
97263
97313
  var places_1 = require_places();
97264
97314
  var booking_detect_1 = require_booking_detect();
97265
97315
  var site_audit_1 = require_site_audit();
@@ -97957,12 +98007,12 @@ If you'd rather not hear from me again, just reply and let me know.`;
97957
98007
  }
97958
98008
  case "prepare_outreach": {
97959
98009
  const explicit = input.ids;
97960
- const rows = explicit && explicit.length > 0 ? db2.all(`SELECT id, name, phone, email, address, city, site_url, lead_kind, booking_platform, booking_url FROM leads WHERE id IN (${explicit.map(() => "?").join(",")})`, explicit) : db2.all(
98010
+ const rows = explicit && explicit.length > 0 ? db2.all(`SELECT id, name, phone, email, address, city, site_url, lead_kind, booking_platform, booking_url, pitch_video_url FROM leads WHERE id IN (${explicit.map(() => "?").join(",")})`, explicit) : db2.all(
97961
98011
  // Eligible = we have something to show them: either a demo site
97962
98012
  // we built (site_url) OR a booking page we built (booking_url).
97963
98013
  // Booking leads never get a site_url, so requiring it silently
97964
98014
  // excluded every one-shot booking customer.
97965
- "SELECT id, name, phone, email, address, city, site_url, lead_kind, booking_platform, booking_url FROM leads WHERE status IN ('site_built','discovered') AND ((site_url IS NOT NULL AND site_url != '') OR (booking_url IS NOT NULL AND booking_url != '')) ORDER BY score DESC NULLS LAST, id DESC",
98015
+ "SELECT id, name, phone, email, address, city, site_url, lead_kind, booking_platform, booking_url, pitch_video_url FROM leads WHERE status IN ('site_built','discovered') AND ((site_url IS NOT NULL AND site_url != '') OR (booking_url IS NOT NULL AND booking_url != '')) ORDER BY score DESC NULLS LAST, id DESC",
97966
98016
  []
97967
98017
  );
97968
98018
  const eligible = rows.filter((r) => r.site_url || r.booking_url);
@@ -97984,7 +98034,16 @@ If you'd rather not hear from me again, just reply and let me know.`;
97984
98034
  let harvested = 0;
97985
98035
  for (const r of eligible) {
97986
98036
  const isBookingLead = r.lead_kind === "no_booking";
97987
- const message = (isBookingLead ? bookingTemplate : template).replace(/\{name\}/g, r.name).replace(/\{site_url\}/g, (isBookingLead ? r.booking_url : r.site_url) ?? r.site_url ?? "").replace(/\{booking_how\}/g, r.booking_platform || "WhatsApp/phone");
98037
+ let videoUrl = r.pitch_video_url ?? null;
98038
+ if (!isBookingLead && !videoUrl && r.site_url && getDecryptedSetting("pitch_auto") === "1") {
98039
+ ctx.emitProgress?.({ channel: "outreach:progress", payload: { msg: `Recording a video for ${r.name}\u2026` } });
98040
+ try {
98041
+ videoUrl = (await ctx.invokeIpc("pitch:make", r.id)).url;
98042
+ } catch {
98043
+ videoUrl = null;
98044
+ }
98045
+ }
98046
+ const message = (0, pitch_text_1.withVideo)((isBookingLead ? bookingTemplate : template).replace(/\{name\}/g, r.name).replace(/\{site_url\}/g, (isBookingLead ? r.booking_url : r.site_url) ?? r.site_url ?? "").replace(/\{booking_how\}/g, r.booking_platform || "WhatsApp/phone"), isBookingLead ? null : videoUrl);
97988
98047
  const e164 = toE164(r.phone ?? "");
97989
98048
  if (!r.email && smtp && (preferEmail || !e164)) {
97990
98049
  ctx.emitProgress?.({
@@ -99995,7 +100054,7 @@ var require_package2 = __commonJS({
99995
100054
  "package.json"(exports2, module2) {
99996
100055
  module2.exports = {
99997
100056
  name: "sproutkit-code",
99998
- version: "1.12.0",
100057
+ version: "1.13.0",
99999
100058
  description: "Sproutkit in your terminal \u2014 find leads, build sites, run outreach, all via chat.",
100000
100059
  bin: {
100001
100060
  sproutkit: "./dist/index.js"
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "sproutkit-code",
3
- "version": "1.12.0",
3
+ "version": "1.13.0",
4
4
  "description": "Sproutkit in your terminal — find leads, build sites, run outreach, all via chat.",
5
5
  "bin": {
6
6
  "sproutkit": "./dist/index.js"