peekable 0.2.0 → 0.3.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.
@@ -25,9 +25,10 @@ export function getErrorMessage(err) {
25
25
  return getErrorMessage(err.cause);
26
26
  return err.message;
27
27
  }
28
+ // Neutralized under Early Access: the server no longer emits this code, but
29
+ // keep the branch inert-but-safe in case an old server still sends it.
28
30
  if (err instanceof ApiError && err.details.code === "trial_expired") {
29
- const upgradeUrl = typeof err.details.upgrade_url === "string" ? err.details.upgrade_url : null;
30
- return `Your Peekable trial has ended. Run \`peekable upgrade\` to keep pushing.${upgradeUrl ? ` Upgrade: ${upgradeUrl}` : ""}`;
31
+ return "This request was blocked. Run `peekable doctor` for details.";
31
32
  }
32
33
  if (err instanceof Error)
33
34
  return err.message;
@@ -198,14 +198,13 @@ export function formatDoctorReport(report) {
198
198
  return lines.join("\n");
199
199
  }
200
200
  function formatPlan(report) {
201
- if (report.planState === "trial_registered")
202
- return "trial not activated";
203
- if (report.planState === "trial_active") {
204
- const days = report.daysRemaining ?? 0;
205
- return `trial (${days} ${days === 1 ? "day" : "days"} left)`;
201
+ // trial* plan_states are all served for free during Early Access; collapse
202
+ // them to one display string and drop the upgrade nudge.
203
+ if (report.planState === "trial_registered"
204
+ || report.planState === "trial_active"
205
+ || report.planState === "trial_expired") {
206
+ return "early access";
206
207
  }
207
- if (report.planState === "trial_expired")
208
- return "trial expired — run `peekable upgrade`";
209
208
  if (report.planState === "paid")
210
209
  return "paid";
211
210
  return "free";
@@ -58,7 +58,7 @@ export const registerCommand = new Command("register")
58
58
  console.log(`API key saved to ~/.peekable/config.json`);
59
59
  console.log("Peekable CLI sends anonymous usage/failure telemetry to improve reliability. Opt out: PEEKABLE_NO_TELEMETRY=1");
60
60
  if (data.invite_source === "trial") {
61
- console.log("Trial ready 7 days start when you push your first real share. Run `peekable init`.");
61
+ console.log("Readyrun `peekable init` to get started.");
62
62
  }
63
63
  else {
64
64
  console.log(`\nNext step: run \`peekable init\` to complete setup.`);
@@ -5,7 +5,7 @@ import { CommandFailure, printCommandError } from "../command-error.js";
5
5
  import { requireConfig } from "../config.js";
6
6
  import { runWithTelemetry } from "../telemetry.js";
7
7
  export const upgradeCommand = new Command("upgrade")
8
- .description("Upgrade a Peekable trial through Stripe Checkout")
8
+ .description("Upgrade a paid Peekable account through Stripe Checkout")
9
9
  .option("--json", "Output JSON")
10
10
  .action(async (opts) => {
11
11
  await runWithTelemetry("upgrade", async () => {
@@ -25,6 +25,16 @@ export const upgradeCommand = new Command("upgrade")
25
25
  }
26
26
  }
27
27
  catch (err) {
28
+ if (err instanceof ApiError && err.details.code === "early_access_no_billing") {
29
+ const message = "Peekable is free during Early Access — nothing to upgrade yet.";
30
+ if (opts.json) {
31
+ console.log(JSON.stringify({ error: message, code: "early_access_no_billing" }));
32
+ }
33
+ else {
34
+ console.log(message);
35
+ }
36
+ return;
37
+ }
28
38
  if (!opts.json
29
39
  && err instanceof ApiError
30
40
  && (err.details.code === "billing_account_exists"
package/dist/version.d.ts CHANGED
@@ -1 +1 @@
1
- export declare const CLI_VERSION = "0.2.0";
1
+ export declare const CLI_VERSION = "0.3.0";
package/dist/version.js CHANGED
@@ -1 +1 @@
1
- export const CLI_VERSION = "0.2.0";
1
+ export const CLI_VERSION = "0.3.0";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "peekable",
3
- "version": "0.2.0",
3
+ "version": "0.3.0",
4
4
  "type": "module",
5
5
  "description": "Share HTML mockups with collaborators — CLI for peekable-server",
6
6
  "bin": {