genclass 0.3.5 → 0.3.6

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/CHANGELOG.md CHANGED
@@ -1,5 +1,21 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.3.6
4
+
5
+ The paid plan is Pro (it was called Team), with 3 days free:
6
+
7
+ - **Free shows the totals and one suggestion.** `problems`, `events`, `report` and `fix` say what Pro adds, its
8
+ trial and price, and `genclass upgrade`; `dashboard` shows the headline numbers with the same box; `ask` is Pro's.
9
+ - **`genclass suggest` on Free: the first suggestion and how many more**, counting the checks, the model's own ideas
10
+ and website designs. A Free app is shown that same plan again on later runs (with its date) until it has Pro.
11
+ - **On Pro, suggest also prints the model's ideas** (marked as not measured) **and website designs**: each one is
12
+ inspired by a real site that fits what the company does, with a complete prompt to paste into Claude. The hand-off
13
+ menu copies a design's prompt in one key.
14
+ - The digest sent for a plan now includes what the site says it is about (its title and description), shown before
15
+ it is sent.
16
+ - The plan card and the Free line name the trial: 3 days free, then $15 a project a month.
17
+ - Suggest's lines fit 58 columns.
18
+
3
19
  ## 0.3.5
4
20
 
5
21
  For onboarding paying customers:
package/README.md CHANGED
@@ -11,7 +11,7 @@ Run it in your web app's folder. It shows where the project stands and walks you
11
11
  per step. Stop at any point and run it again: it continues from what is true now.
12
12
 
13
13
  ```text
14
- ╭─ GenClass ────────────────────────────────────────────── v0.3.5 ─╮
14
+ ╭─ GenClass ────────────────────────────────────────────── v0.3.6 ─╮
15
15
  │ │
16
16
  │ Welcome back, Ada! │
17
17
  │ │
package/dist/genclass.mjs CHANGED
@@ -12,7 +12,7 @@ var __export = (target, all) => {
12
12
  var define_GENCLASS_BUILD_default;
13
13
  var init_define_GENCLASS_BUILD = __esm({
14
14
  "<define:__GENCLASS_BUILD__>"() {
15
- define_GENCLASS_BUILD_default = { version: "0.3.5", runtimeVersion: "0.3.0-beta.6", mcpVersion: "0.2.2", workflow: `# GenClass on your existing Playwright suite: no change to your tests or your playwright.config.
15
+ define_GENCLASS_BUILD_default = { version: "0.3.6", runtimeVersion: "0.3.0-beta.6", mcpVersion: "0.2.2", workflow: `# GenClass on your existing Playwright suite: no change to your tests or your playwright.config.
16
16
  # Copy to .github/workflows/genclass.yml.
17
17
  #
18
18
  # Assumes "npx playwright test" works on a fresh checkout with dependencies installed, which usually
@@ -3599,7 +3599,8 @@ function offerOf(o, host) {
3599
3599
  summary: str(o.summary, 200),
3600
3600
  features: (Array.isArray(o.features) ? o.features : []).filter((x) => typeof x === "string" && x.trim()).slice(0, 12).map((x) => x.slice(0, 120)),
3601
3601
  checkoutUrl,
3602
- free: { name: str(f.name, 40) ?? "Free", apps: num(f.apps), historyDays: num(f.history_days), suggestionsShown: num(f.suggestions_shown), liveFixes: num(f.live_fixes) }
3602
+ free: { name: str(f.name, 40) ?? "Free", apps: num(f.apps), historyDays: num(f.history_days), suggestionsShown: num(f.suggestions_shown), liveFixes: num(f.live_fixes) },
3603
+ trialDays: num(o.trial_days)
3603
3604
  };
3604
3605
  }
3605
3606
  async function fetchRepoStatus(creds, repo, opts = {}) {
@@ -3621,7 +3622,7 @@ async function fetchRepoStatus(creds, repo, opts = {}) {
3621
3622
  };
3622
3623
  }
3623
3624
  async function requestPlan(creds, digest, opts = {}) {
3624
- const r = await request("/api/cli/suggest", { method: "POST", token: creds.access_token, host: creds.host, body: digest, fetchFn: opts.fetchFn, timeoutMs: opts.timeoutMs ?? 45e3 });
3625
+ const r = await request("/api/cli/suggest", { method: "POST", token: creds.access_token, host: creds.host, body: digest, fetchFn: opts.fetchFn, timeoutMs: opts.timeoutMs ?? 12e4 });
3625
3626
  if (!r.ok) return { ok: false, status: r.status, reason: failure(r), ...r.status === 404 ? { missing: true } : {} };
3626
3627
  const j = r.json ?? {};
3627
3628
  const items = (Array.isArray(j.items) ? j.items : []).filter((i) => i && typeof i === "object" && /^[a-z0-9-]{1,40}$/.test(String(i.id ?? ""))).slice(0, 80).map((i) => ({ id: String(i.id), why: str(i.why, 600), step: str(i.step, 400), prompt: str(i.prompt, 1200) }));
@@ -3635,7 +3636,15 @@ async function requestPlan(creds, digest, opts = {}) {
3635
3636
  lockedIds: (Array.isArray(j.locked_ids) ? j.locked_ids : []).filter((x) => typeof x === "string" && /^[a-z0-9-]{1,40}$/.test(x)).slice(0, 80),
3636
3637
  upgradeUrl: sameOrigin2(j.upgrade_url, creds.host),
3637
3638
  remainingToday: Number.isFinite(Number(j.remaining_today)) && j.remaining_today !== null ? Number(j.remaining_today) : null,
3638
- limited: j.limited === true
3639
+ limited: j.limited === true,
3640
+ /** the model's own ideas (not measured) and website designs: Pro gets them, Free their counts */
3641
+ ideas: (Array.isArray(j.ideas) ? j.ideas : []).filter((i) => i && typeof i === "object" && str(i.title, 120)).slice(0, 20).map((i) => ({ title: str(i.title, 120), why: str(i.why, 600), step: str(i.step, 400), prompt: str(i.prompt, 1200) })),
3642
+ designs: (Array.isArray(j.designs) ? j.designs : []).filter((d) => d && typeof d === "object" && str(d.title, 120) && /^https:\/\/[a-z0-9.-]+\.[a-z]{2,}(\/\S*)?$/i.test(String(d.inspired_by ?? "")) && str(d.prompt, 4e3)).slice(0, 4).map((d) => ({ title: str(d.title, 120), inspiredBy: String(d.inspired_by).slice(0, 200), why: str(d.why, 600), prompt: str(d.prompt, 4e3) })),
3643
+ ideasLocked: Number.isFinite(Number(j.ideas_locked)) ? Math.max(0, Number(j.ideas_locked)) : 0,
3644
+ designsLocked: Number.isFinite(Number(j.designs_locked)) ? Math.max(0, Number(j.designs_locked)) : 0,
3645
+ /** this answer was kept from an earlier run (Free sees its first one again until it pays) */
3646
+ cachedAt: str(j.cached_at, 40),
3647
+ upgradePlan: j.upgrade_plan && typeof j.upgrade_plan === "object" ? { plan: str(j.upgrade_plan.name, 40), price: str(j.upgrade_plan.price, 60), trialDays: Number.isInteger(j.upgrade_plan.trial_days) && j.upgrade_plan.trial_days > 0 ? j.upgrade_plan.trial_days : null } : null
3639
3648
  };
3640
3649
  }
3641
3650
  async function signInIsOld(creds, opts = {}) {
@@ -3646,6 +3655,11 @@ async function signInIsOld(creds, opts = {}) {
3646
3655
  if (newest.ok || newest.status !== 404) return false;
3647
3656
  return old(await ask3("/api/cli/app?id=-&range=24h"));
3648
3657
  }
3658
+ function lockOf(l, host) {
3659
+ if (!l || typeof l !== "object") return null;
3660
+ const days = Number(l.trial_days);
3661
+ return { plan: str(l.plan, 40), trialDays: Number.isInteger(days) && days > 0 ? days : null, price: str(l.price, 60), upgradeUrl: sameOrigin2(l.upgrade_url, host) };
3662
+ }
3649
3663
  function liveUsage(u) {
3650
3664
  if (!u || typeof u !== "object" || !Number.isFinite(Number(u.used))) return null;
3651
3665
  const lim = u.limit === null || u.limit === void 0 || !Number.isFinite(Number(u.limit)) ? null : Math.max(0, Math.round(Number(u.limit)));
@@ -3679,6 +3693,8 @@ async function fetchApp(creds, id, range = "7d", opts = {}) {
3679
3693
  visitorsPlan: lock ? { plan: str(lock.plan, 40), upgradeUrl: sameOrigin2(lock.upgrade_url, creds.host) } : null,
3680
3694
  agent: { found: count(st.found), reproduced: count(st.reproduced), fixed: count(st.fixed), closed: count(st.closed), open: count(st.open), last: str(j.agent?.last, 40) },
3681
3695
  dashboardUrl: sameOrigin2(j.dashboard_url, creds.host),
3696
+ /** Free sees the totals only: the plan that shows the problems, its trial and price, and its page */
3697
+ problemsPlan: lockOf(j.locked?.problems, creds.host),
3682
3698
  /** the problems fixed live this month against the app's plan: past its limit GenClass observes only */
3683
3699
  usage: liveUsage(j.usage),
3684
3700
  /** the app's plan page (plans per project) */
@@ -3859,7 +3875,9 @@ var init_api = __esm({
3859
3875
  // 404 with its own sentence ("slack is not set up for this app") is an answer, and is shown
3860
3876
  ...r.status === 404 && (typeof r.json?.error !== "string" || r.json.error === "not found") ? { missing: true } : {},
3861
3877
  ...r.json?.reauth === true ? { reauth: true } : {},
3862
- ...sameOrigin2(r.json?.upgrade_url, host) ? { upgradeUrl: sameOrigin2(r.json.upgrade_url, host) } : {}
3878
+ ...sameOrigin2(r.json?.upgrade_url, host) ? { upgradeUrl: sameOrigin2(r.json.upgrade_url, host) } : {},
3879
+ // a part of the paid plan: which plan, its trial and price (the Pro box)
3880
+ ...r.json?.locked === true ? { lock: lockOf(r.json, host) } : {}
3863
3881
  });
3864
3882
  numOrNull = (v) => Number.isFinite(Number(v)) && v !== null ? Number(v) : null;
3865
3883
  person = (x) => ({ label: str(x?.email, 120) ?? (str(x?.github_login, 60) ? `@${str(x.github_login, 60)}` : "a GenClass account"), joined: str(x?.joined, 40), active: x?.active !== false });
@@ -4083,6 +4101,15 @@ function card(h = {}) {
4083
4101
  }
4084
4102
  out();
4085
4103
  }
4104
+ function proBox(what, lock = {}) {
4105
+ const plan2 = clean(lock.plan ?? "Pro", 20);
4106
+ out();
4107
+ out(` ${badge(plan2.toUpperCase())}`);
4108
+ for (const l of wrap2(clean(what, 300), width() - 6)) out(` ${c.bold(l)}`);
4109
+ const terms = lock.trialDays ? `${lock.trialDays} days free, then ${clean(lock.price ?? "the monthly price", 40)}. Cancel any time.` : lock.price ? `${clean(lock.price, 40)}.` : "";
4110
+ for (const l of wrap2(`${terms ? `${terms} ` : ""}Start: npx genclass upgrade`, width() - 6)) out(` ${l}`);
4111
+ if (lock.upgradeUrl) out(` ${c.cyan(clean(lock.upgradeUrl, 200))}`);
4112
+ }
4086
4113
  function planCard(offer, app) {
4087
4114
  const inner = width() - 6;
4088
4115
  const B = unicode2 ? { tl: "\u256D", tr: "\u256E", bl: "\u2570", br: "\u256F", h: "\u2500", v: "\u2502" } : { tl: "+", tr: "+", bl: "+", br: "+", h: "-", v: "|" };
@@ -4100,6 +4127,7 @@ function planCard(offer, app) {
4100
4127
  row3(price);
4101
4128
  }
4102
4129
  if (offer.summary) for (const l of wrap2(clean(offer.summary, 200), room3)) row3(c.gray(l));
4130
+ if (offer.trialDays) for (const l of wrap2(`${offer.trialDays} days free, then ${clean(offer.price, 40)}. Cancel any time.`, room3)) row3(c.green(l));
4103
4131
  row3();
4104
4132
  for (const f of offer.features) {
4105
4133
  const [first = "", ...rest] = wrap2(clean(f, 120), room3 - 2);
@@ -4517,7 +4545,7 @@ async function readState(o = {}, deps = {}) {
4517
4545
  else if (!repo || !repo.ok) Object.assign(gh, repo?.missing ? { state: "waiting", detail: "check it at genclass.dev/account/github", run: null } : { detail: `could not check${repo ? ` (${repo.reason})` : ""}` });
4518
4546
  else if (!repo.known) Object.assign(gh, { detail: "continue with GitHub to check", human: "install the GitHub App and continue with GitHub in your browser" });
4519
4547
  else if (!repo.installed) Object.assign(gh, { detail: `not on ${git.github} yet`, human: "install the GitHub App on this repository" });
4520
- else if (repo.needsPlan) Object.assign(gh, { state: "waiting", detail: "private repository: reviews come with the Team plan", run: null });
4548
+ else if (repo.needsPlan) Object.assign(gh, { state: "waiting", detail: "private repository: reviews come with Pro", run: null });
4521
4549
  else if (repo.paused) Object.assign(gh, { state: "waiting", detail: "paused on your GitHub page at genclass.dev", run: null });
4522
4550
  else if (repo.evidence) Object.assign(gh, { state: "done", detail: repo.prs ? `reviewing \xB7 ${repo.prs} pull request${repo.prs === 1 ? "" : "s"} so far` : "reviewing" });
4523
4551
  else Object.assign(gh, { state: "waiting", detail: "installed \xB7 open a pull request and the first review appears", run: null, human: workflows.length ? "commit the workflow file and open a pull request" : "open a pull request" });
@@ -5095,7 +5123,8 @@ function render(app, state, o = {}) {
5095
5123
  out();
5096
5124
  out(` ${c.green(sym.ok)} No problems found in this period.`);
5097
5125
  }
5098
- table("Problems", rows(app.problems), all ? 200 : 5, KINDS, all);
5126
+ if (app.problemsPlan) proBox("The problems, the pages they happen on and a fix prompt for each come with Pro. Free shows the totals.", app.problemsPlan);
5127
+ else table("Problems", rows(app.problems), all ? 200 : 5, KINDS, all);
5099
5128
  if (all) table("Possible problems (lower confidence)", rows(app.possible), 200, KINDS, all);
5100
5129
  table("Visual checks", rows(app.checks), all ? 200 : 3, null, all);
5101
5130
  if (all && app.recent.length) {
@@ -5114,7 +5143,7 @@ function render(app, state, o = {}) {
5114
5143
  const bounce = v.visits ? ` \xB7 ${Math.round(v.bounces / v.visits * 100)}% left after one page` : "";
5115
5144
  part2("Visitors", v.visits ? `${plural(v.visits, "visit")} \xB7 ${plural(v.pages, "page view")}${bounce}` : c.gray("none counted in this period (analytics is opt-in: genclass.dev/docs)"));
5116
5145
  if (v.visits && v.entry.length) for (const l of wrap2(`came in on ${v.entry.slice(0, all ? 10 : 3).map((e) => `${clean(e.key, 30)} (${n(e.count)})`).join(", ")}`, width() - 4 - 15)) out(` ${" ".repeat(15)}${c.gray(l)}`);
5117
- } else if (app.visitorsPlan) part2("Visitors", c.gray(`visitor analytics come with the ${clean(app.visitorsPlan.plan ?? "Team", 20)} plan${app.visitorsPlan.upgradeUrl ? `: ${app.visitorsPlan.upgradeUrl}` : ""}`));
5146
+ } else if (app.visitorsPlan) part2("Visitors", c.gray(`visitor analytics come with the ${clean(app.visitorsPlan.plan ?? "Pro", 20)} plan${app.visitorsPlan.upgradeUrl ? `: ${app.visitorsPlan.upgradeUrl}` : ""}`));
5118
5147
  if (u && u.limit !== null) part2("Live fixes", u.observeOnly ? c.yellow(`${n(u.used)} of ${n(u.limit)} this month \xB7 observing only`) : `${n(u.used)} of ${n(u.limit)} this month`);
5119
5148
  else if (u?.used) part2("Live fixes", `${n(u.used)} this month \xB7 no limit`);
5120
5149
  const a = app.agent;
@@ -5220,14 +5249,24 @@ async function appView(o = {}, deps = {}, view) {
5220
5249
  return 1;
5221
5250
  }
5222
5251
  if (o.json) {
5252
+ if (app.problemsPlan && PRO_VIEWS[view.name]) {
5253
+ out(JSON.stringify({ ok: false, locked: true, error: `${PRO_VIEWS[view.name]}`, plan: app.problemsPlan.plan, trial_days: app.problemsPlan.trialDays, upgrade_url: app.problemsPlan.upgradeUrl, run: "npx genclass upgrade" }, null, 2));
5254
+ return 0;
5255
+ }
5223
5256
  out(JSON.stringify((view.json ?? ((a, st, t) => ({ ok: true, app: t.name, ...a })))(app, state, target), null, 2));
5224
5257
  return 0;
5225
5258
  }
5259
+ if (app.problemsPlan && PRO_VIEWS[view.name]) {
5260
+ header({ app: target.name, framework: state.app.token === target.token ? state.app.framework : null, account: state.account?.label, plan: state.account?.plan?.name, host: state.host });
5261
+ proBox(PRO_VIEWS[view.name], app.problemsPlan);
5262
+ out();
5263
+ return 0;
5264
+ }
5226
5265
  if (!view.plain) header({ app: target.name, framework: state.app.token === target.token ? state.app.framework : null, account: state.account?.label, plan: state.account?.plan?.name, host: state.host });
5227
5266
  const code = await view.show(app, state, target, readCredentialsFor().creds ?? creds);
5228
5267
  return typeof code === "number" ? code : 0;
5229
5268
  }
5230
- var monthDay, KINDS, RANGE_WORDS, BARS, n, plural, rows, appLabel, appArg;
5269
+ var PRO_VIEWS, monthDay, KINDS, RANGE_WORDS, BARS, n, plural, rows, appLabel, appArg;
5231
5270
  var init_app = __esm({
5232
5271
  "src/app.mjs"() {
5233
5272
  init_define_GENCLASS_BUILD();
@@ -5238,6 +5277,12 @@ var init_app = __esm({
5238
5277
  init_api();
5239
5278
  init_state();
5240
5279
  init_tui();
5280
+ PRO_VIEWS = {
5281
+ problems: "Every problem, the pages it happens on and what GenClass did come with Pro.",
5282
+ events: "The latest events, one per line, come with Pro.",
5283
+ report: "The period as Markdown comes with Pro.",
5284
+ fix: "Handing problems to your coding agent, with a fix prompt for each, comes with Pro."
5285
+ };
5241
5286
  monthDay = (iso) => {
5242
5287
  const d = new Date(iso);
5243
5288
  return Number.isNaN(d.getTime()) ? String(iso).slice(0, 10) : d.toLocaleDateString("en-US", { month: "short", day: "numeric", timeZone: "UTC" });
@@ -6427,7 +6472,7 @@ function renderAnalytics(app, o = {}) {
6427
6472
  period(app, o.now);
6428
6473
  if (app.visitorsPlan) {
6429
6474
  out();
6430
- out(` ${c.bold(`Visitor analytics come with the ${clean(app.visitorsPlan.plan ?? "Team", 20)} plan.`)}`);
6475
+ out(` ${c.bold(`Visitor analytics come with the ${clean(app.visitorsPlan.plan ?? "Pro", 20)} plan.`)}`);
6431
6476
  note("What your visitors do is already being counted, so it shows from the day you switch: visits, pages, time on a page, where people come from, what they click, funnels.");
6432
6477
  out(` ${c.cyan("npx genclass plan")}`);
6433
6478
  out();
@@ -7805,7 +7850,9 @@ function buildDigest(app, results) {
7805
7850
  framework: app.framework ? clean(app.framework, 60) : null,
7806
7851
  site: app.site ? clean(app.site, 200) : null,
7807
7852
  payments: app.payments ? clean(app.payments, 30) : null,
7808
- hosting: app.hosting ? clean(app.hosting, 30) : null
7853
+ hosting: app.hosting ? clean(app.hosting, 30) : null,
7854
+ // what the site says it is about (its title and meta description): the design ideas fit the company with it
7855
+ about: app.about ? clean(app.about, 300) : null
7809
7856
  },
7810
7857
  checks: failed.map((r) => ({ id: r.id, area: r.area, title: clean(r.title, 100), weight: r.weight, evidence: (r.evidence ?? []).slice(0, 3).map((e) => clean(e, 160)).filter(Boolean) })),
7811
7858
  passed: results.filter((r) => r.status === "pass").length,
@@ -7813,11 +7860,11 @@ function buildDigest(app, results) {
7813
7860
  };
7814
7861
  }
7815
7862
  function describeDigest(d) {
7816
- const about = [d.app.name && "its name", d.app.framework && "its framework", d.app.site && "its address", d.app.payments && "its payment provider", d.app.hosting && "its host"].filter(Boolean);
7863
+ const about = [d.app.name && "its name", d.app.framework && "its framework", d.app.site && "its address", d.app.about && "its site's title and description", d.app.payments && "its payment provider", d.app.hosting && "its host"].filter(Boolean);
7817
7864
  return [
7818
7865
  `The ${d.checks.length} check${d.checks.length === 1 ? "" : "s"} that failed, each with its title and the evidence lines printed below.`,
7819
7866
  about.length ? `About the app: ${about.join(", ")}.` : null,
7820
- "No source code, no file contents and no secrets. genclass.dev passes this to the model that writes the plan and keeps none of it."
7867
+ "No source code, no file contents and no secrets. genclass.dev passes this to the model that writes the plan, and keeps the plan it writes for this app, not what was sent."
7821
7868
  ].filter(Boolean);
7822
7869
  }
7823
7870
  var MAX_CHECKS;
@@ -9243,16 +9290,18 @@ function layOut(results, plan2) {
9243
9290
  }
9244
9291
  function printItem(i, full) {
9245
9292
  out();
9246
- const title = ` ${c.bold(String(i.n).padStart(2))} ${c.bold(clean(i.title, 90))}`;
9247
9293
  const tag = `${c.gray(`${AREAS[i.area] ?? i.area} ${sym.dot}`)} ${dots(i.weight)}`;
9248
- if (visible(title) + 2 + visible(tag) <= width()) out(`${title} ${tag}`);
9294
+ const [first = "", ...more] = wrap2(clean(i.title, 90), width() - 8);
9295
+ const title = ` ${c.bold(String(i.n).padStart(2))} ${c.bold(first)}`;
9296
+ if (!more.length && visible(title) + 2 + visible(tag) <= width() - 2) out(`${title} ${tag}`);
9249
9297
  else {
9250
9298
  out(title);
9299
+ for (const l of more) out(` ${c.bold(l)}`);
9251
9300
  out(` ${tag}`);
9252
9301
  }
9253
9302
  for (const e of i.evidence ?? []) {
9254
- const [first = "", ...rest] = wrap2(clean(e, 400), width() - 10);
9255
- out(` ${c.gray(`${sym.arrow} ${first}`)}`);
9303
+ const [first2 = "", ...rest] = wrap2(clean(e, 400), width() - 10);
9304
+ out(` ${c.gray(`${sym.arrow} ${first2}`)}`);
9256
9305
  for (const l of rest) out(` ${c.gray(l)}`);
9257
9306
  }
9258
9307
  if (!full) return;
@@ -9261,6 +9310,38 @@ function printItem(i, full) {
9261
9310
  out(` ${c.cyan("Ask your agent")}`);
9262
9311
  para(clean(i.prompt, 1e3), " ", c.gray);
9263
9312
  }
9313
+ function printIdeas(ideas, all) {
9314
+ out();
9315
+ rule();
9316
+ out(` ${c.bold("Ideas from the model")}`);
9317
+ note("Not measured: judged from your app and its site.");
9318
+ ideas.forEach((d, i) => {
9319
+ out();
9320
+ out(` ${c.bold(String(i + 1).padStart(2))} ${c.bold(clean(d.title, 90))}`);
9321
+ if (!all && i >= 5) return;
9322
+ if (d.why) para(clean(d.why, 600), " ");
9323
+ if (d.step) out(` ${c.cyan("Do")} ${wrap2(clean(d.step, 400), width() - 12).join("\n ")}`);
9324
+ if (d.prompt) {
9325
+ out(` ${c.cyan("Ask your agent")}`);
9326
+ para(clean(d.prompt, 1e3), " ", c.gray);
9327
+ }
9328
+ });
9329
+ if (!all && ideas.length > 6) note(`Ideas 7 and after are listed by title: ${c.cyan("npx genclass suggest --all")} prints each one in full.`);
9330
+ }
9331
+ function printDesigns(designs) {
9332
+ out();
9333
+ rule();
9334
+ out(` ${c.bold("Website designs")}`);
9335
+ note("The model's choice of sites that fit what you do.");
9336
+ designs.forEach((d, i) => {
9337
+ out();
9338
+ out(` ${c.bold(String(i + 1).padStart(2))} ${c.bold(clean(d.title, 90))}`);
9339
+ out(` ${c.gray("Inspired by")} ${c.cyan(clean(d.inspiredBy, 200))}`);
9340
+ if (d.why) para(clean(d.why, 600), " ");
9341
+ out(` ${c.cyan("Prompt for Claude")} ${c.gray("(copy it all)")}`);
9342
+ para(clean(d.prompt, 4e3), " ", c.gray);
9343
+ });
9344
+ }
9264
9345
  function suggestionsPrompt(items, url = null) {
9265
9346
  const lines = [
9266
9347
  `GenClass checked this repository${url ? ` and the live site ${url}` : ""} and found ${items.length} thing${items.length === 1 ? "" : "s"} to fix, most important first. Work through them one at a time, in this order. After each one, run \`npx genclass suggest --json\` and check that it no longer lists it.`,
@@ -9297,7 +9378,9 @@ async function handToAgent(items, url, cwd, o, deps, plan2) {
9297
9378
  ["Copy the prompt", async () => await (deps.copy ?? copyText)(prompt) ? good("Copied. Paste it into your coding agent.") : out(prompt)],
9298
9379
  ["Print the prompt", async () => out(`
9299
9380
  ${prompt}
9300
- `)]
9381
+ `)],
9382
+ // each website design's own prompt, to paste into Claude whole
9383
+ ...(plan2?.designs ?? []).map((d) => [`Copy the design prompt: ${clean(d.title, 40)}`, async () => await (deps.copy ?? copyText)(d.prompt) ? good("Copied. Paste it into Claude in your repository.") : out(d.prompt)])
9301
9384
  ];
9302
9385
  choices.forEach(([label], i) => out(` ${c.gray(String(i + 1).padStart(2))} ${label}`));
9303
9386
  if (!agents.length) note("No coding agent's command found here (claude, codex, cursor-agent, gemini).");
@@ -9334,13 +9417,14 @@ async function suggest(o = {}, deps = {}) {
9334
9417
  const failed = results.filter((r) => r.status === "fail");
9335
9418
  const passed = results.filter((r) => r.status === "pass");
9336
9419
  const unknown2 = results.filter((r) => r.status === "unknown");
9337
- const app = { name: repo.name ?? null, framework: st.project.label || null, site: site?.reachable ? url : null, payments: repo.payments?.provider ?? null, hosting: repo.hosting?.provider ?? null };
9420
+ const about = site?.reachable ? [site.defaultTitle ? null : site.title, site.description].filter(Boolean).join(". ") || null : null;
9421
+ const app = { name: repo.name ?? null, framework: st.project.label || null, site: site?.reachable ? url : null, about, payments: repo.payments?.provider ?? null, hosting: repo.hosting?.provider ?? null };
9338
9422
  const digest = buildDigest(app, results);
9339
9423
  const creds = readCredentials();
9340
9424
  let plan2 = null;
9341
9425
  let planNote = null;
9342
9426
  if (o.noModel) planNote = "Ordered by the checks' own weights (--no-model: nothing was sent).";
9343
- else if (!failed.length) planNote = null;
9427
+ else if (!failed.length && !app.site) planNote = null;
9344
9428
  else if (!creds) planNote = `Ordered by the checks' own weights. Sign in (${c.cyan("npx genclass login")}) and the order and the reasons are written for your app.`;
9345
9429
  else {
9346
9430
  let agreed = o.yes || notes.sendOk === true;
@@ -9353,11 +9437,11 @@ async function suggest(o = {}, deps = {}) {
9353
9437
  }
9354
9438
  if (!agreed) planNote = `Ordered by the checks' own weights: nothing was sent. ${quiet || !interactive() ? "Pass --yes to send the failed checks to genclass.dev for a plan written for your app." : ""}`.trim();
9355
9439
  else {
9356
- const sp = quiet ? null : spinner("Writing the plan for your app");
9440
+ const sp = quiet ? null : spinner("Writing the plan for your app (up to a minute)");
9357
9441
  const r = await requestPlan(creds, digest, { fetchFn: deps.fetchFn });
9358
9442
  if (r.ok) {
9359
9443
  plan2 = { ...r, lockedIds: r.lockedIds ?? [] };
9360
- sp?.stop("ok", r.source === "model" ? "The plan is written for your app." : r.limited ? "Today's plans are used up, so this one is ordered by the checks' own weights." : "Ordered by the checks' own weights.");
9444
+ sp?.stop("ok", r.cachedAt ? `Your plan from ${day(r.cachedAt)}.` : r.source === "model" ? "The plan is written for your app." : r.limited ? "Today's plans are used up, so this one is ordered by the checks' own weights." : "Ordered by the checks' own weights.");
9361
9445
  } else {
9362
9446
  sp?.stop("warn", r.missing ? "This genclass.dev has no suggestions yet: ordered by the checks' own weights." : `No plan from genclass.dev (${clean(r.reason, 120)}): ordered by the checks' own weights.`);
9363
9447
  }
@@ -9374,9 +9458,14 @@ async function suggest(o = {}, deps = {}) {
9374
9458
  source: plan2?.source ?? "checks",
9375
9459
  plan: plan2?.plan ?? null,
9376
9460
  passed: passed.length,
9377
- failed: items.map((i) => ({ n: i.n, id: i.id, area: i.area, title: i.title, weight: i.weight, evidence: i.evidence, ...i.open ? { why: i.why, do: i.step, prompt: i.prompt } : { locked: true } })),
9461
+ failed: items.filter((i) => i.open).map((i) => ({ n: i.n, id: i.id, area: i.area, title: i.title, weight: i.weight, evidence: i.evidence, why: i.why, do: i.step, prompt: i.prompt })),
9462
+ // what the plan does not show is counted, not listed (Free: the first suggestion only)
9463
+ more: { checks: locked.length, ideas: plan2?.ideasLocked ?? 0, designs: plan2?.designsLocked ?? 0 },
9464
+ ideas: plan2?.ideas ?? [],
9465
+ designs: (plan2?.designs ?? []).map((d) => ({ title: d.title, inspired_by: d.inspiredBy, why: d.why, prompt: d.prompt })),
9466
+ cached_at: plan2?.cachedAt ?? null,
9378
9467
  not_checked: unknown2.map((r) => r.id),
9379
- upgrade_url: locked.length ? plan2?.upgradeUrl ?? null : null
9468
+ upgrade_url: locked.length || plan2?.ideasLocked || plan2?.designsLocked ? plan2?.upgradeUrl ?? null : null
9380
9469
  },
9381
9470
  null,
9382
9471
  2
@@ -9390,16 +9479,23 @@ async function suggest(o = {}, deps = {}) {
9390
9479
  if (planNote) note(planNote);
9391
9480
  if (!site?.reachable) note(url ? "The site could not be read, so only the repository was checked." : `Only the repository was checked. With the site's address there is more: ${c.cyan("npx genclass suggest https://your-site.com")}`);
9392
9481
  const fullCount = o.all ? items.length : 5;
9393
- for (const i of items) printItem(i, i.open && i.n <= fullCount);
9482
+ for (const i of items.filter((x) => x.open)) printItem(i, i.n <= fullCount);
9394
9483
  if (items.some((i) => i.open && i.n > fullCount)) {
9395
9484
  out();
9396
9485
  note(`Items ${fullCount + 1} and after are listed by title. ${c.cyan("npx genclass suggest --all")} prints each one's reason, first step and prompt.`);
9397
9486
  }
9398
- if (locked.length) {
9487
+ if (plan2?.ideas?.length) printIdeas(plan2.ideas, o.all);
9488
+ if (plan2?.designs?.length) printDesigns(plan2.designs);
9489
+ const hiddenIdeas = plan2?.ideasLocked ?? 0;
9490
+ const hiddenDesigns = plan2?.designsLocked ?? 0;
9491
+ const more = locked.length + hiddenIdeas + hiddenDesigns;
9492
+ if (more) {
9399
9493
  out();
9400
9494
  rule();
9401
- out(` ${c.bold(`The reason, the first step and the agent prompt for the other ${locked.length} come with the Team plan.`)}`);
9402
- note(`${plan2?.plan?.name ?? "Free"} shows the plan for the first ${items.length - locked.length}. Every check above is measured for free. Plans: ${c.cyan(plan2?.upgradeUrl ?? "https://genclass.dev/pricing")}`);
9495
+ const parts = [locked.length && `${locked.length} from your checks`, hiddenIdeas && `${hiddenIdeas} idea${hiddenIdeas === 1 ? "" : "s"} from the model`, hiddenDesigns && `${hiddenDesigns} website design${hiddenDesigns === 1 ? "" : "s"} inspired by sites like yours`].filter(Boolean);
9496
+ const up = plan2?.upgradePlan ?? {};
9497
+ proBox(`${more} more suggestion${more === 1 ? "" : "s"} for this app: ${parts.join(", ")}, each with a prompt for your coding agent.`, { plan: up.plan ?? "Pro", trialDays: up.trialDays ?? null, price: up.price ?? null, upgradeUrl: plan2?.upgradeUrl ?? null });
9498
+ if (plan2?.cachedAt) note(`This is your plan from ${day(plan2.cachedAt)}: on Free it stays this one. Pro writes it again every time you run this.`);
9403
9499
  }
9404
9500
  if (unknown2.length) {
9405
9501
  out();
@@ -9407,16 +9503,16 @@ async function suggest(o = {}, deps = {}) {
9407
9503
  else note(`${unknown2.length} check${unknown2.length === 1 ? "" : "s"} could not be measured on this site this time.`);
9408
9504
  }
9409
9505
  out();
9410
- if (failed.length) {
9411
- good("Fix one, then run it again: everything is measured afresh.");
9506
+ if (failed.length && !more) {
9507
+ good("Fix one, then run this again: it measures afresh.");
9412
9508
  out(` ${c.cyan("npx genclass suggest")}`);
9413
9509
  note(`With a coding agent: paste an "Ask your agent" block, or tell it to run ${c.cyan("npx genclass suggest --json")} and work through the list.`);
9414
9510
  }
9415
- if (items.length && interactive() && !o.yes) await handToAgent(items, site?.reachable ? url : null, cwd, o, deps, plan2);
9511
+ if ((items.some((i) => i.open) || plan2?.designs?.length) && interactive() && !o.yes) await handToAgent(items.filter((i) => i.open), site?.reachable ? url : null, cwd, o, deps, plan2);
9416
9512
  out();
9417
9513
  return url && site && !site.reachable && o.url ? 1 : 0;
9418
9514
  }
9419
- var FREE_SHOWN, dots;
9515
+ var FREE_SHOWN, dots, day;
9420
9516
  var init_suggest = __esm({
9421
9517
  "src/suggest/index.mjs"() {
9422
9518
  init_define_GENCLASS_BUILD();
@@ -9431,8 +9527,12 @@ var init_suggest = __esm({
9431
9527
  init_digest();
9432
9528
  init_repo();
9433
9529
  init_site();
9434
- FREE_SHOWN = 3;
9530
+ FREE_SHOWN = 1;
9435
9531
  dots = (weight) => weight >= 5 ? c.red("urgent") : weight >= 4 ? c.yellow("important") : weight >= 3 ? c.gray("worth doing") : c.gray("polish");
9532
+ day = (iso) => {
9533
+ const d = new Date(iso);
9534
+ return Number.isNaN(d.getTime()) ? String(iso).slice(0, 10) : d.toLocaleDateString("en-US", { month: "short", day: "numeric" });
9535
+ };
9436
9536
  }
9437
9537
  });
9438
9538
 
@@ -9458,10 +9558,8 @@ function refused2(r, ctx) {
9458
9558
  out();
9459
9559
  if (r.reauth) warn(`This sign-in is from before the command could do this. Run ${c.cyan("npx genclass login")} once, then ${c.cyan(`npx genclass ${ctx.command}`)}.`);
9460
9560
  else if (r.upgradeUrl) {
9461
- out(` ${c.bold(`${ctx.what} comes with the ${clean(ctx.plan ?? "Team", 20)} plan.`)}`);
9462
- note("Everything GenClass finds stays free. The plan adds this, and it starts from here:");
9463
- out(` ${c.cyan("npx genclass plan")}`);
9464
- out(` ${c.gray("In the browser")} ${c.cyan(r.upgradeUrl)}`);
9561
+ const lock = r.lock ?? { plan: ctx.plan ?? null, upgradeUrl: r.upgradeUrl };
9562
+ proBox(`${ctx.what} comes with ${clean(lock.plan ?? ctx.plan ?? "Pro", 20)}.`, { ...lock, upgradeUrl: lock.upgradeUrl ?? r.upgradeUrl });
9465
9563
  } else if (r.missing) note("This genclass.dev cannot do this from the terminal yet.");
9466
9564
  else bad(`${ctx.what}: ${clean(r.reason ?? "it did not work", 240)}`);
9467
9565
  if (ctx.browserUrl && !r.upgradeUrl) out(` ${c.gray("In the browser")} ${c.cyan(ctx.browserUrl)}`);
@@ -9595,7 +9693,7 @@ async function plan(o = {}, deps = {}) {
9595
9693
  if (a.reauth) note("For its limits and what is used: npx genclass login, once (this sign-in is from before the command could show them).");
9596
9694
  } else {
9597
9695
  row2("Plan", `${c.bold(clean(a.plan.name, 20))}${a.plan.price ? c.gray(` ${clean(a.plan.price, 40)}`) : ""}${a.access === "comp" ? c.gray(" granted by GenClass") : ""}`);
9598
- if (a.subscription.periodEnd && a.access === "paid") row2(a.subscription.cancels ? "Ends" : "Renews", day(a.subscription.periodEnd));
9696
+ if (a.subscription.periodEnd && a.access === "paid") row2(a.subscription.cancels ? "Ends" : "Renews", day2(a.subscription.periodEnd));
9599
9697
  if (a.subscription.status && !["active", "trialing"].includes(a.subscription.status)) row2("Payment", c.yellow(clean(a.subscription.status.replace(/_/g, " "), 30)));
9600
9698
  row2("Apps", a.limits.apps === null ? `${n(a.used.apps)} ${sym.dot} no limit` : `${n(a.used.apps)} of ${n(a.limits.apps)}`);
9601
9699
  row2("History", a.limits.historyDays === null ? "" : `${n(a.limits.historyDays)} days`);
@@ -9663,7 +9761,7 @@ async function freeLine(o = {}, deps = {}) {
9663
9761
  const offer = upgradeOffer(state);
9664
9762
  if (!offer) return false;
9665
9763
  const lim = freeWords(offer.free);
9666
- const [first = "", ...rest] = wrap2(`You are on Free, which has limits${lim ? ` (${lim})` : ""}. ${clean(offer.plan.name, 20)} has none, for ${clean(offer.price, 40)}. Upgrade now: npx genclass upgrade`, width() - 6);
9764
+ const [first = "", ...rest] = wrap2(`You are on Free, which has limits${lim ? ` (${lim})` : ""}. ${clean(offer.plan.name, 20)} has none, ${offer.trialDays ? `${offer.trialDays} days free, then ${clean(offer.price, 40)}` : `for ${clean(offer.price, 40)}`}. Upgrade now: npx genclass upgrade`, width() - 6);
9667
9765
  out();
9668
9766
  out(` ${c.yellow(sym.warn)} ${c.bold(first)}`);
9669
9767
  for (const l of rest) out(` ${l}`);
@@ -9761,7 +9859,7 @@ async function team(o = {}, deps = {}) {
9761
9859
  top(state);
9762
9860
  good("An invite link, for one person:");
9763
9861
  out(` ${c.cyan(r.url)}`);
9764
- note(`It works once${r.expires ? `, until ${day(r.expires)}` : ""}, and is shown only now. Whoever opens it signs in and joins your team: they can open your apps' dashboards, not change them.`);
9862
+ note(`It works once${r.expires ? `, until ${day2(r.expires)}` : ""}, and is shown only now. Whoever opens it signs in and joins your team: they can open your apps' dashboards, not change them.`);
9765
9863
  out();
9766
9864
  }
9767
9865
  return 0;
@@ -9780,12 +9878,12 @@ async function team(o = {}, deps = {}) {
9780
9878
  out(` ${c.bold("Team")} ${c.gray(t.seats === null ? `${n(t.used)} ${t.used === 1 ? "person" : "people"}` : `${n(t.used)} of ${n(t.seats)} seat${t.seats === 1 ? "" : "s"} used`)}`);
9781
9879
  out(` ${clean(state.account?.label ?? "you", 50)} ${c.gray("owner")}`);
9782
9880
  for (const m of t.members) out(` ${clean(m.label, 50)} ${c.gray(`${m.joined ? `joined ${ago(m.joined, deps.now)}` : "member"}${m.active ? "" : ` ${sym.dot} over the seats, cannot open dashboards`}`)}`);
9783
- for (const i of t.invites) out(` ${c.gray(`an invite link is open${i.expires ? ` until ${day(i.expires)}` : ""}`)}`);
9881
+ for (const i of t.invites) out(` ${c.gray(`an invite link is open${i.expires ? ` until ${day2(i.expires)}` : ""}`)}`);
9784
9882
  for (const m of t.memberships) out(` ${c.gray("You are also in the team of")} ${clean(m.label, 50)}${m.active ? "" : c.gray(" (not active)")}`);
9785
9883
  out();
9786
9884
  if (t.seats !== null && t.seats <= 1) {
9787
9885
  out(` ${c.bold(`${clean(a.plan.name, 20)} is for one person.`)}`);
9788
- note("A team comes with Team: everyone you invite opens the same dashboards.");
9886
+ note("A team comes with Pro: everyone you invite opens the same dashboards.");
9789
9887
  out(` ${c.cyan("npx genclass plan")}`);
9790
9888
  } else {
9791
9889
  out(` ${c.gray("Invite someone:")} ${c.cyan("npx genclass team invite")}`);
@@ -9910,7 +10008,7 @@ async function connections(o = {}, deps = {}) {
9910
10008
  }
9911
10009
  if (!r.forwarding) {
9912
10010
  out();
9913
- out(` ${c.bold(`Alerts come with the ${clean(r.plan ?? "Team", 20)} plan.`)} ${c.cyan("npx genclass plan")}`);
10011
+ out(` ${c.bold(`Alerts come with the ${clean(r.plan ?? "Pro", 20)} plan.`)} ${c.cyan("npx genclass plan")}`);
9914
10012
  } else {
9915
10013
  out();
9916
10014
  out(` ${c.gray("Set one up:")} ${c.cyan("npx genclass connections add slack")}`);
@@ -9956,7 +10054,7 @@ async function exportEvents(o = {}, deps = {}) {
9956
10054
  if (!r.ok) {
9957
10055
  sp?.stop(null);
9958
10056
  if (toStd && !o.json) {
9959
- process.stderr.write(`genclass export: ${r.reauth ? "sign in again: npx genclass login" : r.upgradeUrl ? "the stored events as a file come with the Team plan: npx genclass plan" : r.reason ?? "it did not work"}
10057
+ process.stderr.write(`genclass export: ${r.reauth ? "sign in again: npx genclass login" : r.upgradeUrl ? "the stored events as a file come with Pro: npx genclass plan" : r.reason ?? "it did not work"}
9960
10058
  `);
9961
10059
  return 1;
9962
10060
  }
@@ -10122,7 +10220,7 @@ async function runQuiet(cmd, args, cwd) {
10122
10220
  }
10123
10221
  });
10124
10222
  }
10125
- var room2, row2, top, day, freeWords, DESTINATIONS, destName, POSTHOG, DAY, isDay, slug, claudeAdd;
10223
+ var room2, row2, top, day2, freeWords, DESTINATIONS, destName, POSTHOG, DAY, isDay, slug, claudeAdd;
10126
10224
  var init_manage = __esm({
10127
10225
  "src/manage.mjs"() {
10128
10226
  init_define_GENCLASS_BUILD();
@@ -10144,7 +10242,7 @@ var init_manage = __esm({
10144
10242
  for (const l of rest) out(` ${" ".repeat(w)}${l}`);
10145
10243
  };
10146
10244
  top = (state, target = null) => header({ app: target?.name ?? state.app.name, framework: !target || state.app.token === target.token ? state.app.framework : null, account: state.account?.label, plan: state.account?.plan?.name, host: state.host });
10147
- day = (iso) => String(iso ?? "").slice(0, 10);
10245
+ day2 = (iso) => String(iso ?? "").slice(0, 10);
10148
10246
  freeWords = (free) => [free?.apps ? `${free.apps} apps` : null, free?.liveFixes ? `${free.liveFixes} live fixes a month` : null, free?.historyDays ? `${free.historyDays} days of history` : null].filter(Boolean).join(", ");
10149
10247
  DESTINATIONS = {
10150
10248
  slack: ["Slack", [["url", "Slack incoming webhook URL", true]]],
@@ -10240,7 +10338,7 @@ async function ask2(o = {}, deps = {}) {
10240
10338
  if (r.answer === null) {
10241
10339
  if (r.why === "limit") {
10242
10340
  warn(`Today's ${r.perDay === null ? "" : `${n(r.perDay)} `}model runs are used (ask and suggest share them). They come back tomorrow.`);
10243
- if (r.upgradeUrl) out(` ${c.gray("More a day with the Team plan:")} ${c.cyan("npx genclass plan")}`);
10341
+ if (r.upgradeUrl) out(` ${c.gray("More a day with Pro:")} ${c.cyan("npx genclass upgrade")}`);
10244
10342
  } else if (r.why === "no-model") note("This genclass.dev has no model to ask, so there is no answer in words.");
10245
10343
  else warn("The model did not answer this time. Asking again in a moment usually works.");
10246
10344
  out(` ${c.gray("The numbers themselves:")} ${c.cyan("npx genclass problems")}`);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "genclass",
3
- "version": "0.3.5",
3
+ "version": "0.3.6",
4
4
  "description": "GenClass CLI: one command that sets GenClass up, shows your app in the terminal (problems, analytics, events), hands problems to your coding agent, answers questions about your app and tells you what it is missing.",
5
5
  "type": "module",
6
6
  "license": "Apache-2.0",