sproutkit-code 0.12.0 → 0.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.
package/dist/index.js CHANGED
@@ -82565,7 +82565,7 @@ var require_package = __commonJS({
82565
82565
  "package.json"(exports2, module2) {
82566
82566
  module2.exports = {
82567
82567
  name: "sproutkit-code",
82568
- version: "0.12.0",
82568
+ version: "0.13.0",
82569
82569
  description: "Sproutkit in your terminal \u2014 find leads, build sites, run outreach, all via chat.",
82570
82570
  bin: {
82571
82571
  sproutkit: "./dist/index.js"
@@ -83762,6 +83762,69 @@ async function cmdOutreach(argv) {
83762
83762
  if (result.noPhone) say(c.dim(` ${result.noPhone} had no phone number and were skipped for messaging.`));
83763
83763
  say();
83764
83764
  }
83765
+ async function cmdRegenerate(argv) {
83766
+ const { flags, rest } = parseArgs(argv);
83767
+ const json = !!flags.json;
83768
+ const id = Number(flags.id ?? rest[0]);
83769
+ const instructions = flags.instructions ? String(flags.instructions) : "";
83770
+ if (!id || Number.isNaN(id)) {
83771
+ const err = 'Usage: sproutkit regenerate <leadId> --instructions "what to change"';
83772
+ json ? emitJson({ ok: false, error: err }) : say(c.red(" " + err));
83773
+ process.exitCode = 1;
83774
+ return;
83775
+ }
83776
+ if (!instructions.trim()) {
83777
+ const err = "regenerate needs --instructions describing what to change.";
83778
+ json ? emitJson({ ok: false, error: err }) : say(c.red(" " + err));
83779
+ process.exitCode = 1;
83780
+ return;
83781
+ }
83782
+ const status = json ? void 0 : new Status();
83783
+ if (status) status.start(`Rebuilding website for lead #${id}`);
83784
+ try {
83785
+ const result = await runTool(
83786
+ "regenerate_site",
83787
+ { id, instructions },
83788
+ makeCtx({ json, status })
83789
+ );
83790
+ if (result && result.ok === false) {
83791
+ if (status) status.done(false, result.error ?? "Regenerate failed");
83792
+ if (json) emitJson(result);
83793
+ process.exitCode = 1;
83794
+ return;
83795
+ }
83796
+ if (status) status.done(true, result.url ? `Live at ${result.url}` : `Rebuilt lead #${id}`);
83797
+ autoSync();
83798
+ if (json) emitJson(result);
83799
+ } catch (e) {
83800
+ if (status) status.done(false, "Regenerate failed");
83801
+ json ? emitJson({ ok: false, error: e.message }) : say(c.red(" " + e.message));
83802
+ process.exitCode = 1;
83803
+ }
83804
+ }
83805
+ async function cmdCms(argv) {
83806
+ const { flags, rest } = parseArgs(argv);
83807
+ const json = !!flags.json;
83808
+ const id = Number(flags.id ?? rest[0]);
83809
+ if (!id || Number.isNaN(id)) {
83810
+ const err = "Usage: sproutkit cms <leadId>";
83811
+ json ? emitJson({ ok: false, error: err }) : say(c.red(" " + err));
83812
+ process.exitCode = 1;
83813
+ return;
83814
+ }
83815
+ const status = json ? void 0 : new Status();
83816
+ if (status) status.start(`Setting up CMS for lead #${id}`);
83817
+ try {
83818
+ const result = await runTool("provision_cms", { id }, makeCtx({ json, status }));
83819
+ if (status) status.done(true, result.publicUrl ? `CMS live at ${result.publicUrl}` : `CMS set up for #${id}`);
83820
+ autoSync();
83821
+ if (json) emitJson(result);
83822
+ } catch (e) {
83823
+ if (status) status.done(false, "CMS setup failed");
83824
+ json ? emitJson({ ok: false, error: e.message }) : say(c.red(" " + e.message));
83825
+ process.exitCode = 1;
83826
+ }
83827
+ }
83765
83828
  async function cmdBook(argv) {
83766
83829
  const { flags, rest } = parseArgs(argv);
83767
83830
  const json = !!flags.json;
@@ -83896,10 +83959,12 @@ When a request is missing information the command needs, ask a SHORT, STRUCTURED
83896
83959
  - Once you have the needed choices, act immediately \u2014 one command, one line of result. Don't re-confirm what they already told you.
83897
83960
 
83898
83961
  COMMANDS:
83899
- - sproutkit find "<area>" --categories "<type>,<type>" --json \u2014 find leads
83962
+ - sproutkit find "<area>" --categories "<type>,<type>" --json \u2014 find website-less leads
83900
83963
  - sproutkit list --json [--status <s>] [--city <c>] \u2014 list leads (get ids)
83901
83964
  - sproutkit build <id> --json [--instructions "..."] [--cms] \u2014 build a demo site
83902
83965
  - sproutkit build-all --json [--ids 3,5] [--concurrency 3] \u2014 build many at once
83966
+ - sproutkit regenerate <id> --instructions "..." --json \u2014 rebuild an existing site with changes
83967
+ - sproutkit cms <id> --json \u2014 add the editable CMS on top of the site we built them
83903
83968
  - sproutkit book <id> --json [--standalone] [--instructions "..."] [--archetype slots|reservation|enquiry] [--email x@y.com] \u2014 booking site (--standalone = its own URL for clients who already have a website)
83904
83969
  - sproutkit outreach --json [--ids 3,5] \u2014 prepare outreach links
83905
83970
 
@@ -84042,7 +84107,7 @@ async function main() {
84042
84107
  closeTty();
84043
84108
  return;
84044
84109
  }
84045
- if (arg === "find" || arg === "list" || arg === "build" || arg === "build-all" || arg === "book" || arg === "outreach") {
84110
+ if (arg === "find" || arg === "list" || arg === "build" || arg === "build-all" || arg === "regenerate" || arg === "cms" || arg === "book" || arg === "outreach") {
84046
84111
  const subArgs = process.argv.slice(3);
84047
84112
  const lic2 = await check();
84048
84113
  if (lic2.status !== "active") {
@@ -84057,6 +84122,8 @@ async function main() {
84057
84122
  else if (arg === "list") await cmdList(subArgs);
84058
84123
  else if (arg === "build") await cmdBuild(subArgs);
84059
84124
  else if (arg === "build-all") await cmdBuildAll(subArgs);
84125
+ else if (arg === "regenerate") await cmdRegenerate(subArgs);
84126
+ else if (arg === "cms") await cmdCms(subArgs);
84060
84127
  else if (arg === "book") await cmdBook(subArgs);
84061
84128
  else await cmdOutreach(subArgs);
84062
84129
  closeTty();
@@ -84072,6 +84139,8 @@ async function main() {
84072
84139
  say(` ${c.bold("sproutkit list")} list leads (--status, --city, --json)`);
84073
84140
  say(` ${c.bold("sproutkit build <id>")} build a website (--instructions, --cms)`);
84074
84141
  say(` ${c.bold("sproutkit build-all")} build many at once (--ids, --concurrency 3)`);
84142
+ say(` ${c.bold("sproutkit regenerate <id>")} rebuild a site (--instructions "\u2026")`);
84143
+ say(` ${c.bold("sproutkit cms <id>")} add the editable CMS to a built site`);
84075
84144
  say(` ${c.bold("sproutkit book <id>")} booking site (--standalone for own-URL)`);
84076
84145
  say(` ${c.bold("sproutkit outreach")} prep outreach links (--ids 3,5)`);
84077
84146
  say(` ${c.bold("sproutkit setup")} set or update keys, licence, backend`);
@@ -84145,17 +84214,20 @@ async function main() {
84145
84214
  }
84146
84215
  const direct = line.replace(/^\//, "");
84147
84216
  const verb = direct.split(/\s+/)[0]?.toLowerCase();
84148
- const DIRECT_VERBS = ["find", "list", "build", "build-all", "book", "outreach"];
84217
+ const DIRECT_VERBS = ["find", "list", "build", "build-all", "regenerate", "cms", "book", "outreach"];
84149
84218
  if (verb === "commands" || verb === "help" || line === "/help" || line === "/?") {
84150
84219
  say();
84151
84220
  say(c.bold(" Commands (type with or without a leading /):"));
84152
- say(` ${c.greenBold("find")} "<area>" --categories "cafe,barber" find leads`);
84153
- say(` ${c.greenBold("list")} [--status <s>] [--city <c>] list leads`);
84154
- say(` ${c.greenBold("build")} <id> [--instructions "\u2026"] [--cms] build a demo site`);
84155
- say(` ${c.greenBold("build-all")} [--ids 3,5] [--concurrency 3] build many at once`);
84156
- say(` ${c.greenBold("book")} <id> [--standalone] [--archetype \u2026] booking site`);
84221
+ say(` ${c.greenBold("find")} "<area>" --categories "cafe,barber" find website-less leads`);
84222
+ say(` ${c.greenBold("list")} [--status <s>] [--city <c>] list leads (get ids)`);
84223
+ say(` ${c.greenBold("build")} <id> [--instructions "\u2026"] [--cms] build a demo site`);
84224
+ say(` ${c.greenBold("build-all")} [--ids 3,5] [--concurrency 3] build many at once`);
84225
+ say(` ${c.greenBold("regenerate")} <id> --instructions "\u2026" rebuild a site with changes`);
84226
+ say(` ${c.greenBold("cms")} <id> add the editable CMS to a built site`);
84227
+ say(` ${c.greenBold("book")} <id> [--standalone] [--archetype slots|reservation|enquiry] [--email \u2026]`);
84228
+ say(` ${c.dim(" ")} booking on the site, or --standalone for its own URL`);
84157
84229
  say(` ${c.greenBold("outreach")} [--ids 3,5] prepare outreach links`);
84158
- say(c.dim(" /freemode \u2014 open conversation \xB7 /taskmode \u2014 precise \xB7 exit \u2014 quit"));
84230
+ say(c.dim(" /freemode \u2014 open conversation & custom tweaks \xB7 /taskmode \u2014 precise \xB7 exit \u2014 quit"));
84159
84231
  say(c.dim(" Or just talk: \u201Cfind cafes in Leeds and build the best two\u201D."));
84160
84232
  say();
84161
84233
  continue;
@@ -84168,6 +84240,8 @@ async function main() {
84168
84240
  else if (verb === "list") await cmdList(argv);
84169
84241
  else if (verb === "build") await cmdBuild(argv);
84170
84242
  else if (verb === "build-all") await cmdBuildAll(argv);
84243
+ else if (verb === "regenerate") await cmdRegenerate(argv);
84244
+ else if (verb === "cms") await cmdCms(argv);
84171
84245
  else if (verb === "book") await cmdBook(argv);
84172
84246
  else if (verb === "outreach") await cmdOutreach(argv);
84173
84247
  } catch (e) {
@@ -48,6 +48,13 @@ you can parse results reliably, then summarise them for the user in prose.
48
48
  renders the progress. One `sproutkit build-all` call is correct; N parallel
49
49
  `sproutkit build` calls via subagents is not.
50
50
 
51
+ - **Rebuild a site** — `sproutkit regenerate <leadId> --instructions "..." --json`
52
+ - Rebuilds an existing site with the requested changes. Instructions required.
53
+
54
+ - **Add the CMS** — `sproutkit cms <leadId> --json`
55
+ - Adds the editable CMS on top of a site Sproutkit already built, so the
56
+ business owner can edit their own content (the claim/on-domain flow).
57
+
51
58
  - **Add a booking site** — `sproutkit book <leadId> --json`
52
59
  - Default: adds an online booking/reservation form onto a site Sproutkit
53
60
  already built for this lead (same domain, at /book).
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "sproutkit-code",
3
- "version": "0.12.0",
3
+ "version": "0.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"