sproutkit-code 1.2.1 → 1.2.2

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 +15 -5
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -93694,12 +93694,19 @@ Interested?`;
93694
93694
  }
93695
93695
  case "prepare_outreach": {
93696
93696
  const explicit = input.ids;
93697
- 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("SELECT id, name, phone, email, address, city, site_url, lead_kind, booking_platform, booking_url FROM leads WHERE status = 'site_built' AND site_url IS NOT NULL AND site_url != '' ORDER BY score DESC NULLS LAST, id DESC", []);
93698
- const eligible = rows.filter((r) => r.site_url);
93697
+ 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(
93698
+ // Eligible = we have something to show them: either a demo site
93699
+ // we built (site_url) OR a booking page we built (booking_url).
93700
+ // Booking leads never get a site_url, so requiring it silently
93701
+ // excluded every one-shot booking customer.
93702
+ "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",
93703
+ []
93704
+ );
93705
+ const eligible = rows.filter((r) => r.site_url || r.booking_url);
93699
93706
  if (eligible.length === 0) {
93700
93707
  return {
93701
93708
  ok: false,
93702
- error: "No leads with a built site to contact. Build sites first, or check the leads already moved past 'ready'."
93709
+ error: "Nothing built to contact anyone about yet. Build a demo site (sproutkit build <id>) or a booking page (sproutkit book <id>) first, or check whether these leads have already moved past 'ready'."
93703
93710
  };
93704
93711
  }
93705
93712
  const channelRow = db2.get("SELECT value FROM settings WHERE key = ?", ["outreach_channel"]);
@@ -93910,7 +93917,10 @@ Interested?`;
93910
93917
  archetypeOverride: input.archetype,
93911
93918
  ownerEmail: input.ownerEmail
93912
93919
  });
93913
- db2.run("UPDATE leads SET booking_url = ? WHERE id = ?", [result.bookingUrl, leadId]);
93920
+ db2.run("UPDATE leads SET booking_url = ?, status = 'site_built' WHERE id = ?", [
93921
+ result.bookingUrl,
93922
+ leadId
93923
+ ]);
93914
93924
  return {
93915
93925
  ok: true,
93916
93926
  id: leadId,
@@ -94964,7 +94974,7 @@ var require_package2 = __commonJS({
94964
94974
  "package.json"(exports2, module2) {
94965
94975
  module2.exports = {
94966
94976
  name: "sproutkit-code",
94967
- version: "1.2.1",
94977
+ version: "1.2.2",
94968
94978
  description: "Sproutkit in your terminal \u2014 find leads, build sites, run outreach, all via chat.",
94969
94979
  bin: {
94970
94980
  sproutkit: "./dist/index.js"
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "sproutkit-code",
3
- "version": "1.2.1",
3
+ "version": "1.2.2",
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"