@superwall/cli 1.4.0 → 1.6.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 (103) hide show
  1. package/README.md +21 -5
  2. package/dist/{actions-EfP8phmb.js → actions-Dt35nIi8.js} +3 -2
  3. package/dist/{api-CEwXCCoC.js → api-BOR-uXZe.js} +9 -9
  4. package/dist/{app-D8mEVlQo.js → app-BU27SLPX.js} +9 -9
  5. package/dist/{asa-BFWehnTA.js → asa-2ykGnjaV.js} +11 -11
  6. package/dist/{asc-DJqQmtmR.js → asc-r3xmFT0L.js} +14 -14
  7. package/dist/{auth-CT2DWX8r.js → auth-BWZfguI8.js} +9 -9
  8. package/dist/auth.js +2 -2
  9. package/dist/{billing-BzEnVPD2.js → billing-BsQgXXYh.js} +1 -1
  10. package/dist/{bind-BZxVyt9P.js → bind-BSTAinn6.js} +5 -4
  11. package/dist/{command-DP96_gmP.js → command-DMoMn7uc.js} +39 -16
  12. package/dist/{create-Q8TqqjZt.js → create-CSo6XjSm.js} +118 -91
  13. package/dist/dev-B0MF6z3L.js +21 -0
  14. package/dist/{dev-DlCcwFu5.js → dev-CuXa3J4Z.js} +29 -24
  15. package/dist/{doctor-CJsjHpCZ.js → doctor-DXJaDqsx.js} +10 -10
  16. package/dist/{drivers-UT36AnOw.js → drivers-Cr252DOJ.js} +3 -3
  17. package/dist/entry.js +84 -50
  18. package/dist/{existing-Cak1WxWB.js → existing-Ckx_g7Be.js} +6 -3
  19. package/dist/{feedback-DDRzoqPx.js → feedback-Dt5yebMS.js} +6 -6
  20. package/dist/{hosted-CEH78QVn.js → hosted-Cjekn8oJ.js} +2 -2
  21. package/dist/{integrate-D8jyhDzk.js → integrate-DVqhvPVq.js} +25 -66
  22. package/dist/{login-kneYhhk0.js → login-Bjj8QvIN.js} +6 -6
  23. package/dist/migrate-qmvOtp3l.js +283 -0
  24. package/dist/open-studio-CpHqjovS.js +1299 -0
  25. package/dist/{org-Cg25bcsj.js → org-CV8c849b.js} +3 -3
  26. package/dist/{output-csAtR6kJ.js → output-CiELrN8w.js} +15 -2
  27. package/dist/{pipeline-DAeI9tHs.js → pipeline-DSCHL9KA.js} +482 -9
  28. package/dist/{print-skill-BHVPP9cX.js → print-skill-CaHRJ8xW.js} +7 -7
  29. package/dist/{promote-Boek5K2d.js → promote-UMTh8Q33.js} +17 -18
  30. package/dist/publish-DWX8S9yZ.js +34 -0
  31. package/dist/push-Dox4_5Dq.js +34 -0
  32. package/dist/{query-B8G6T8Ba.js → query-CnSsDZ7Q.js} +10 -10
  33. package/dist/reports-C0xHCLnt.js +27 -0
  34. package/dist/{resource-DjsWVka-.js → resource-5bgyyL9B.js} +15 -15
  35. package/dist/{resources-s64mBHaC.js → resources-Bf9O1JNM.js} +28 -2
  36. package/dist/{run-BtcQJCP8.js → run-BVeZWbXx.js} +39 -22
  37. package/dist/{scan-DJixvuHn.js → scan-CAObNRgc.js} +44 -4
  38. package/dist/skills/superwall/SKILL.md +146 -0
  39. package/dist/skills/superwall/references/api.md +275 -0
  40. package/dist/skills/superwall/references/asa.md +160 -0
  41. package/dist/skills/superwall/references/asc.md +96 -0
  42. package/dist/skills/superwall/references/dashboard-links.md +57 -0
  43. package/dist/skills/superwall/references/data-analytics.md +893 -0
  44. package/dist/skills/superwall/references/docs.md +51 -0
  45. package/dist/skills/superwall/references/sdk-integration.md +105 -0
  46. package/dist/skills/superwall/references/sdk-source.md +18 -0
  47. package/{skills/superwall-dashboard/SKILL.md → dist/skills/superwall/workflows/dashboard/playbook.md} +3 -9
  48. package/{skills/superwall-dashboard/references → dist/skills/superwall/workflows/dashboard}/setup.md +1 -3
  49. package/dist/skills/superwall/workflows/integrate/android.md +292 -0
  50. package/{skills/superwall-integrate/SKILL.md → dist/skills/superwall/workflows/integrate/playbook.md} +16 -11
  51. package/{skills/superwall-migrate/references → dist/skills/superwall/workflows/migrate}/adapty.md +4 -4
  52. package/{skills/superwall-migrate/SKILL.md → dist/skills/superwall/workflows/migrate/playbook.md} +4 -10
  53. package/{skills/superwall-migrate/references → dist/skills/superwall/workflows/migrate}/qonversion.md +4 -4
  54. package/{skills/superwall-migrate/references → dist/skills/superwall/workflows/migrate}/revenuecat.md +4 -4
  55. package/dist/skills/superwall/workflows/placements/android.md +175 -0
  56. package/{skills/superwall-placements/references → dist/skills/superwall/workflows/placements}/expo.md +1 -1
  57. package/{skills/superwall-placements/references → dist/skills/superwall/workflows/placements}/flutter.md +1 -1
  58. package/{skills/superwall-placements/references → dist/skills/superwall/workflows/placements}/ios.md +1 -1
  59. package/{skills/superwall-placements/SKILL.md → dist/skills/superwall/workflows/placements/playbook.md} +6 -10
  60. package/{skills/superwall-placements/references → dist/skills/superwall/workflows/placements}/react-native.md +2 -2
  61. package/{skills/superwall-placements/references → dist/skills/superwall/workflows/placements}/strategy.md +4 -3
  62. package/dist/skills/superwall/workflows/review/android.md +120 -0
  63. package/{skills/superwall-review/references → dist/skills/superwall/workflows/review}/expo.md +1 -1
  64. package/{skills/superwall-review/references → dist/skills/superwall/workflows/review}/flutter.md +1 -1
  65. package/{skills/superwall-review/references → dist/skills/superwall/workflows/review}/ios.md +1 -1
  66. package/{skills/superwall-review/SKILL.md → dist/skills/superwall/workflows/review/playbook.md} +2 -7
  67. package/{skills/superwall-review/references → dist/skills/superwall/workflows/review}/react-native.md +1 -1
  68. package/dist/skills/superwall-framework/SKILL.md +253 -0
  69. package/dist/skills/superwall-framework/references/cli.md +340 -0
  70. package/dist/skills/superwall-framework/references/examples.md +123 -0
  71. package/dist/skills/superwall-framework/references/layout.md +295 -0
  72. package/dist/skills/superwall-framework/references/migrate-from-editor.md +208 -0
  73. package/dist/skills/superwall-framework/references/migrate-from-native.md +193 -0
  74. package/dist/skills/superwall-framework/references/mobile-design.md +371 -0
  75. package/dist/skills/superwall-framework/references/native/android.md +83 -0
  76. package/dist/skills/superwall-framework/references/native/flutter.md +65 -0
  77. package/dist/skills/superwall-framework/references/native/ios.md +77 -0
  78. package/dist/skills/superwall-framework/references/native/react-native.md +67 -0
  79. package/dist/skills/superwall-framework/references/responsive.md +162 -0
  80. package/dist/{skills-CRG1xk0G.js → skills-Cu41i-Az.js} +12 -12
  81. package/dist/{skills-CODut1Hn.js → skills-grTDuHlc.js} +134 -36
  82. package/dist/{spinner-B9dT3DBY.js → spinner-DFctF_Jw.js} +1 -1
  83. package/dist/{telemetry-BtkMdT-5.js → telemetry-BuCbmoux.js} +3 -3
  84. package/dist/{token-hM7V1KMG.js → token-mju3Q-vc.js} +3 -3
  85. package/dist/{ui-Lqt_zFOr.js → ui-4gLyfrgl.js} +76 -46
  86. package/dist/{update-CeylIjx5.js → update-DnGfpCD7.js} +2 -2
  87. package/dist/{upgrade-DRqUfCBT.js → upgrade-PMoj3yqJ.js} +6 -6
  88. package/package.json +8 -7
  89. package/prompts/actions/paywall-migrate.xml +24 -0
  90. package/prompts/actions/screen-migrate.xml +26 -0
  91. package/dist/git-ZwA3Mx8m.js +0 -433
  92. package/dist/migrate-D_x1oyTk.js +0 -114
  93. package/dist/publish-C-zEUnO9.js +0 -35
  94. package/dist/push-DUDQG-EO.js +0 -35
  95. package/skills/README.md +0 -118
  96. /package/dist/{api-output-D9ggXQIr.js → api-output-CEhN-U_N.js} +0 -0
  97. /package/dist/{asc-products-C6MvSy8H.js → asc-products-1e1DoGeL.js} +0 -0
  98. /package/dist/{params-B1zeElGa.js → params-BxgTuCzr.js} +0 -0
  99. /package/{skills/superwall-integrate/references → dist/skills/superwall/workflows/integrate}/expo.md +0 -0
  100. /package/{skills/superwall-integrate/references → dist/skills/superwall/workflows/integrate}/flutter.md +0 -0
  101. /package/{skills/superwall-integrate/references → dist/skills/superwall/workflows/integrate}/ios.md +0 -0
  102. /package/{skills/superwall-integrate/references → dist/skills/superwall/workflows/integrate}/react-native.md +0 -0
  103. /package/dist/{storekit-DPonXSwe.js → storekit-Dlpbq5Wv.js} +0 -0
@@ -0,0 +1,21 @@
1
+ import "./output-CiELrN8w.js";
2
+ import "./telemetry-BuCbmoux.js";
3
+ import "./update-DnGfpCD7.js";
4
+ import "./token-mju3Q-vc.js";
5
+ import "./command-DMoMn7uc.js";
6
+ import "./ui-4gLyfrgl.js";
7
+ import "./skills-grTDuHlc.js";
8
+ import "./spawn-DSoTXy_j.js";
9
+ import "./login-Bjj8QvIN.js";
10
+ import "./scan-CAObNRgc.js";
11
+ import "./hosted-Cjekn8oJ.js";
12
+ import "./spinner-DFctF_Jw.js";
13
+ import "./resources-Bf9O1JNM.js";
14
+ import "./org-CV8c849b.js";
15
+ import "./bind-BSTAinn6.js";
16
+ import "./pipeline-DSCHL9KA.js";
17
+ import "./actions-Dt35nIi8.js";
18
+ import "./app-BU27SLPX.js";
19
+ import { t as runDev } from "./dev-CuXa3J4Z.js";
20
+
21
+ export { runDev };
@@ -1,25 +1,12 @@
1
- import { g as VERSION } from "./output-csAtR6kJ.js";
2
- import "./telemetry-BtkMdT-5.js";
3
- import "./update-CeylIjx5.js";
4
- import "./token-hM7V1KMG.js";
5
- import { n as ApiError, t as defineCommand } from "./command-DP96_gmP.js";
6
- import { n as ui } from "./ui-Lqt_zFOr.js";
7
- import "./skills-CODut1Hn.js";
8
- import "./spawn-DSoTXy_j.js";
9
- import "./login-kneYhhk0.js";
10
- import "./scan-DJixvuHn.js";
11
- import "./hosted-CEH78QVn.js";
12
- import "./spinner-B9dT3DBY.js";
13
- import { S as pushPaywallVersion, T as versionProducts, b as promotePaywallVersion, f as listApplications } from "./resources-s64mBHaC.js";
14
- import "./org-Cg25bcsj.js";
15
- import "./bind-BZxVyt9P.js";
16
- import { f as readLock, i as requireApi, o as writeProjectScaffold, u as resolveApps } from "./git-ZwA3Mx8m.js";
17
- import "./actions-EfP8phmb.js";
18
- import "./app-D8mEVlQo.js";
19
- import { C as syncAssets, D as writeProjectTypes, E as collectProjectDeclarations, S as requireAssets, T as loadFramework, _ as planTargets, a as projectDir, b as resolveBinding, d as pushSource, f as collectSourceFiles, h as projectForApplication, l as LAYOUT_HINT, m as fetchProducts, o as projectDirs, p as warnNotPortable, s as requireProject, w as frameworkVersion, x as assetBaseUrl, y as wantedPlatforms } from "./pipeline-DAeI9tHs.js";
1
+ import { y as VERSION } from "./output-CiELrN8w.js";
2
+ import { r as ApiError, t as defineCommand } from "./command-DMoMn7uc.js";
3
+ import { n as ui } from "./ui-4gLyfrgl.js";
4
+ import { r as openBrowser } from "./login-Bjj8QvIN.js";
5
+ import { D as versionProducts, S as promotePaywallVersion, p as listApplications, w as pushPaywallVersion } from "./resources-Bf9O1JNM.js";
6
+ import { A as requireApi, C as requireAssets, D as collectProjectDeclarations, E as loadFramework, I as readLock, M as writeProjectScaffold, O as writeProjectTypes, P as resolveApps, S as assetBaseUrl, T as frameworkVersion, a as projectDir, b as wantedPlatforms, d as pushSource, g as projectForApplication, h as fetchProducts, l as LAYOUT_HINT, m as warnNotPortable, o as projectDirs, p as collectSourceFiles, s as requireProject, v as planTargets, w as syncAssets, x as resolveBinding } from "./pipeline-DSCHL9KA.js";
20
7
  import pc from "picocolors";
21
- import * as fs from "node:fs";
22
8
  import * as path from "node:path";
9
+ import * as fs from "node:fs";
23
10
  import fg from "fast-glob";
24
11
  import { renderUnicodeCompact } from "uqr";
25
12
 
@@ -373,7 +360,8 @@ function createStudioActions(framework, project) {
373
360
  if (error instanceof ApiError && error.status === 400) return void 0;
374
361
  throw error;
375
362
  });
376
- return session?.status === "ready" ? session.pages?.[0]?.url : void 0;
363
+ if (session?.status !== "ready") return void 0;
364
+ return session.apple_review_image?.url ?? session.pages?.[0]?.url;
377
365
  },
378
366
  async status(surface) {
379
367
  try {
@@ -381,10 +369,26 @@ function createStudioActions(framework, project) {
381
369
  const bindings = (surface.kind === "paywall" ? lock.paywalls : lock.funnels)[surface.id];
382
370
  const bound = bindings === void 0 ? void 0 : Object.values(bindings)[0];
383
371
  if (!bound) return {};
384
- const paywall = await (await ensureApi()).get(`/v2/paywalls/${encodeURIComponent(bound.paywallId)}`);
372
+ const client = await ensureApi();
373
+ const id = encodeURIComponent(bound.paywallId);
374
+ const paywall = await client.get(`/v2/paywalls/${id}`);
375
+ const live = typeof paywall.paywall_url === "string" && typeof paywall.version === "number" ? [{
376
+ version: paywall.version,
377
+ url: paywall.paywall_url,
378
+ live: true
379
+ }] : [];
380
+ const listed = await client.get(`/v2/paywalls/${id}/versions`).then((response) => ({ versions: (response.data ?? []).map((entry) => ({
381
+ version: entry.version,
382
+ url: entry.url,
383
+ live: entry.live === true,
384
+ pushedAt: entry.created_at
385
+ })) }), (error) => ({
386
+ versions: live,
387
+ unreachable: reason(error)
388
+ }));
385
389
  return {
386
390
  paywallId: bound.paywallId,
387
- liveUrl: paywall.paywall_url ?? void 0,
391
+ ...listed,
388
392
  active: paywall.status === "active",
389
393
  updatedAt: paywall.updated_at,
390
394
  identifier: paywall.identifier
@@ -438,6 +442,7 @@ const runDev = defineCommand({
438
442
  return [...many ? [pc.bold(slug(one.root))] : [], ...one.surfaces.map((surface) => `${many ? " " : ""}${surface.kind}/${pc.bold(surface.id)} ` + pc.dim(`${url}${prefix}${surface.kind}/${surface.id}`))];
439
443
  });
440
444
  ui.step([`Studio ${pc.green(url)}`, ...rows].join("\n"));
445
+ if (typeof context.argv.open === "string" && context.argv.open !== "") openBrowser(`${url}${context.argv.open.replace(/^\//, "")}`);
441
446
  const network = server.resolvedUrls?.network[0];
442
447
  if (network) {
443
448
  const deviceUrl = `${network}device`;
@@ -469,4 +474,4 @@ const runDev = defineCommand({
469
474
  });
470
475
 
471
476
  //#endregion
472
- export { runDev };
477
+ export { runDev as t };
@@ -1,14 +1,14 @@
1
- import { _ as apiKeyFromEnv } from "./output-csAtR6kJ.js";
2
- import "./telemetry-BtkMdT-5.js";
3
- import "./update-CeylIjx5.js";
4
- import { i as loadSession } from "./token-hM7V1KMG.js";
5
- import { t as defineCommand } from "./command-DP96_gmP.js";
6
- import { a as THEME, n as ui, o as fg } from "./ui-Lqt_zFOr.js";
1
+ import { b as apiKeyFromEnv } from "./output-CiELrN8w.js";
2
+ import "./telemetry-BuCbmoux.js";
3
+ import "./update-DnGfpCD7.js";
4
+ import { i as loadSession } from "./token-mju3Q-vc.js";
5
+ import { t as defineCommand } from "./command-DMoMn7uc.js";
6
+ import { a as THEME, n as ui, o as fg } from "./ui-4gLyfrgl.js";
7
7
  import "./spawn-DSoTXy_j.js";
8
- import { t as scanProject } from "./scan-DJixvuHn.js";
9
- import { t as detectDrivers } from "./drivers-UT36AnOw.js";
10
- import "./hosted-CEH78QVn.js";
11
- import { t as detectExisting } from "./existing-Cak1WxWB.js";
8
+ import { t as scanProject } from "./scan-CAObNRgc.js";
9
+ import { t as detectDrivers } from "./drivers-Cr252DOJ.js";
10
+ import "./hosted-Cjekn8oJ.js";
11
+ import { t as detectExisting } from "./existing-Ckx_g7Be.js";
12
12
 
13
13
  //#region src/commands/account/doctor.ts
14
14
  const runDoctor = defineCommand({
@@ -1,8 +1,8 @@
1
- import { g as VERSION } from "./output-csAtR6kJ.js";
1
+ import { y as VERSION } from "./output-CiELrN8w.js";
2
2
  import { n as readVersion, r as spawnStream, t as onPath } from "./spawn-DSoTXy_j.js";
3
- import { n as getHostedAuthToken, r as getHostedStatus, t as getHostedAnthropicBaseUrl } from "./hosted-CEH78QVn.js";
4
- import { tmpdir } from "node:os";
3
+ import { n as getHostedAuthToken, r as getHostedStatus, t as getHostedAnthropicBaseUrl } from "./hosted-Cjekn8oJ.js";
5
4
  import { basename, join } from "node:path";
5
+ import { tmpdir } from "node:os";
6
6
  import { readFile, rm } from "node:fs/promises";
7
7
  import { query } from "@anthropic-ai/claude-agent-sdk";
8
8
 
package/dist/entry.js CHANGED
@@ -1,6 +1,6 @@
1
- import { g as VERSION, i as writeJson, u as ENV_API_KEY } from "./output-csAtR6kJ.js";
2
- import { t as flushTelemetry } from "./telemetry-BtkMdT-5.js";
3
- import { n as flushUpdateCheck } from "./update-CeylIjx5.js";
1
+ import { i as writeJson, l as CHANNEL, p as ENV_API_KEY, y as VERSION } from "./output-CiELrN8w.js";
2
+ import { t as flushTelemetry } from "./telemetry-BuCbmoux.js";
3
+ import { n as flushUpdateCheck } from "./update-DnGfpCD7.js";
4
4
  import yargs from "yargs";
5
5
  import { hideBin } from "yargs/helpers";
6
6
  import pc from "picocolors";
@@ -56,11 +56,11 @@ const registerAccountCommands = (cli) => cli.command("login", "Log in to Superwa
56
56
  hidden: true
57
57
  }
58
58
  }), (argv) => {
59
- return import("./auth-CT2DWX8r.js").then((m) => m.runLogin(argv));
59
+ return import("./auth-BWZfguI8.js").then((m) => m.runLogin(argv));
60
60
  }).command("logout", "Log out of Superwall", (y) => y, (argv) => {
61
- return import("./auth-CT2DWX8r.js").then((m) => m.runLogout(argv));
61
+ return import("./auth-BWZfguI8.js").then((m) => m.runLogout(argv));
62
62
  }).command("whoami", "Show the logged-in Superwall account", (y) => y, (argv) => {
63
- return import("./auth-CT2DWX8r.js").then((m) => m.runWhoami(argv));
63
+ return import("./auth-BWZfguI8.js").then((m) => m.runWhoami(argv));
64
64
  }).command("skills", "Install or update the Superwall agent skills for your coding agent", (y) => y.options({
65
65
  skill: {
66
66
  type: "array",
@@ -81,16 +81,16 @@ const registerAccountCommands = (cli) => cli.command("login", "Log in to Superwa
81
81
  hidden: true
82
82
  }
83
83
  }), (argv) => {
84
- return import("./skills-CRG1xk0G.js").then((m) => m.runSkills(argv));
84
+ return import("./skills-Cu41i-Az.js").then((m) => m.runSkills(argv));
85
85
  }).command("doctor", "Check the health of your Superwall integration", (y) => y.options({ ...installDirOption }), (argv) => {
86
- return import("./doctor-CJsjHpCZ.js").then((m) => m.runDoctor(argv));
86
+ return import("./doctor-DXJaDqsx.js").then((m) => m.runDoctor(argv));
87
87
  }).command("upgrade", "Update the CLI to the latest version", (y) => y, (argv) => {
88
- return import("./upgrade-DRqUfCBT.js").then((m) => m.runUpgrade(argv));
88
+ return import("./upgrade-PMoj3yqJ.js").then((m) => m.runUpgrade(argv));
89
89
  }).command("feedback [message]", "Send feedback about the CLI to the Superwall team", (y) => y.positional("message", {
90
90
  type: "string",
91
91
  describe: "Your feedback (omit to be prompted)"
92
92
  }).example("$0 feedback \"migrate crashed on Expo\"", "Send feedback").example("$0 feedback \"...\" --json", "For agents / automation"), (argv) => {
93
- return import("./feedback-DDRzoqPx.js").then((m) => m.runFeedback(argv));
93
+ return import("./feedback-Dt5yebMS.js").then((m) => m.runFeedback(argv));
94
94
  });
95
95
 
96
96
  //#endregion
@@ -99,8 +99,9 @@ function printHelp() {
99
99
  const pad = (cmd) => ` ${cmd.padEnd(30)}`;
100
100
  const row = (cmd, desc) => `${pad(cmd)}${desc}`;
101
101
  const head = (title) => pc.bold(`${title}:`);
102
+ const next = CHANNEL() === "next";
102
103
  process.stdout.write([
103
- `${pc.bold("Superwall CLI")} ${pc.dim(`v${VERSION}`)}`,
104
+ `${pc.bold("Superwall CLI")} ${pc.dim(`v${VERSION}`)}${next ? pc.dim(" · next channel") : ""}`,
104
105
  "",
105
106
  pc.bold("Usage:"),
106
107
  " superwall [command]",
@@ -108,18 +109,21 @@ function printHelp() {
108
109
  head("Workflow commands"),
109
110
  row("integrate", "Set up Superwall in your app (agent-driven)"),
110
111
  row("migrate", "Migrate from RevenueCat / Adapty / Qonversion"),
112
+ ...next ? [row("migrate <paywall-id>", "Rebuild a dashboard paywall as code with your agent"), row("migrate --screen <path>", "Rebuild a native screen as a Superwall surface")] : [],
111
113
  row("review [--fix]", "Audit an existing Superwall setup; --fix repairs issues"),
112
114
  pc.dim(" Each takes --skill to print the playbook instead of running."),
113
115
  "",
114
- head("Paywalls & funnels"),
115
- row("create [dir]", "Set up paywalls in your app - creates superwall/ inside it"),
116
- row("dev [dir..]", "Host the studio: browse and preview your paywalls and funnels"),
117
- row("push [dir]", "Build and push your paywalls and funnels as immutable versions"),
118
- row("promote [dir]", "Point production at a pushed version"),
119
- row("publish [dir]", "Push and promote in one step"),
120
- pc.dim(" push and publish take -m <note> to record why, in the source commit."),
121
- pc.dim(" All three take --platform <p> when the project pushes to several platforms."),
122
- "",
116
+ ...next ? [
117
+ head("Paywalls & funnels"),
118
+ row("create [dir]", "Set up paywalls in your app - creates superwall/ inside it"),
119
+ row("dev [dir..]", "Host the studio: browse and preview your paywalls and funnels"),
120
+ row("push [dir]", "Build and push your paywalls and funnels as immutable versions"),
121
+ row("promote [dir]", "Point production at a pushed version"),
122
+ row("publish [dir]", "Push and promote in one step"),
123
+ pc.dim(" push and publish take -m <note> to record why, in the source commit."),
124
+ pc.dim(" All three take --platform <p> when the project pushes to several platforms."),
125
+ ""
126
+ ] : [],
123
127
  head("Resource commands"),
124
128
  row("bootstrap", "Complete account tree: projects, apps, campaigns, and products"),
125
129
  row("apps", "Projects and platform apps (list, create, use)"),
@@ -171,6 +175,14 @@ const registerPaywallCommands = (cli) => cli.command("create [dir]", "Set up pay
171
175
  type: "string",
172
176
  describe: "Start from a public example by name, e.g. --example with-rive"
173
177
  },
178
+ from: {
179
+ type: "string",
180
+ describe: "Rebuild an existing dashboard paywall as code: scaffold its config.ts (products, presentation, settings) and a migration brief from the paywall id"
181
+ },
182
+ app: {
183
+ type: "string",
184
+ describe: "Connect this Superwall app by id instead of detecting or asking"
185
+ },
174
186
  yes: {
175
187
  type: "boolean",
176
188
  alias: "y",
@@ -186,8 +198,8 @@ const registerPaywallCommands = (cli) => cli.command("create [dir]", "Set up pay
186
198
  default: true,
187
199
  describe: "Connect a Superwall app when possible (--no-connect to skip)"
188
200
  }
189
- }).example("$0 create", "Set up superwall/ in the current app").example("$0 create --example with-rive", "Start from an example"), (argv) => {
190
- return import("./create-Q8TqqjZt.js").then((m) => m.runCreate(argv));
201
+ }).example("$0 create", "Set up superwall/ in the current app").example("$0 create --example with-rive", "Start from an example").example("$0 create --from 65920", "Rebuild dashboard paywall 65920 as code").example("$0 create --app 52518", "Connect a specific Superwall app"), (argv) => {
202
+ return import("./create-CSo6XjSm.js").then((m) => m.runCreate(argv));
191
203
  }).command("dev [dir..]", "Host the studio: browse and preview your paywalls and funnels", (y) => y.positional("dir", {
192
204
  type: "string",
193
205
  array: true,
@@ -203,9 +215,14 @@ const registerPaywallCommands = (cli) => cli.command("create [dir]", "Set up pay
203
215
  type: "string",
204
216
  default: "0.0.0.0",
205
217
  describe: "Host to bind"
218
+ },
219
+ open: {
220
+ type: "string",
221
+ hidden: true,
222
+ describe: "Open the browser at this studio path once the server is up"
206
223
  }
207
224
  }), (argv) => {
208
- return import("./dev-DlCcwFu5.js").then((m) => m.runDev(argv));
225
+ return import("./dev-B0MF6z3L.js").then((m) => m.runDev(argv));
209
226
  }).command("push [dir]", "Build and push your paywalls as immutable versions (production untouched)", (y) => y.positional("dir", {
210
227
  type: "string",
211
228
  describe: "Project directory (default: cwd)"
@@ -218,7 +235,7 @@ const registerPaywallCommands = (cli) => cli.command("create [dir]", "Set up pay
218
235
  platform: {
219
236
  type: "array",
220
237
  string: true,
221
- describe: "Limit to these platforms (repeatable, or comma-separated) - ios, android, web, flutter, react_native"
238
+ describe: "Limit to these platforms (repeatable, or comma-separated) - ios, android, web"
222
239
  },
223
240
  rename: {
224
241
  type: "array",
@@ -231,7 +248,7 @@ const registerPaywallCommands = (cli) => cli.command("create [dir]", "Set up pay
231
248
  describe: "Publish note recorded in the source commit (only lands when this publish creates a new source commit — unchanged source reuses the existing commit)"
232
249
  }
233
250
  }), (argv) => {
234
- return import("./push-DUDQG-EO.js").then((m) => m.runPush(argv));
251
+ return import("./push-Dox4_5Dq.js").then((m) => m.runPush(argv));
235
252
  }).command("promote [dir]", "Point production at a pushed version (the latest by default)", (y) => y.version(false).positional("dir", {
236
253
  type: "string",
237
254
  describe: "Project directory (default: cwd)"
@@ -244,7 +261,7 @@ const registerPaywallCommands = (cli) => cli.command("create [dir]", "Set up pay
244
261
  platform: {
245
262
  type: "array",
246
263
  string: true,
247
- describe: "Limit to these platforms (repeatable, or comma-separated) - ios, android, web, flutter, react_native"
264
+ describe: "Limit to these platforms (repeatable, or comma-separated) - ios, android, web"
248
265
  },
249
266
  version: {
250
267
  type: "number",
@@ -252,7 +269,7 @@ const registerPaywallCommands = (cli) => cli.command("create [dir]", "Set up pay
252
269
  describe: "Pushed version number to promote (requires a single --id)"
253
270
  }
254
271
  }), (argv) => {
255
- return import("./promote-Boek5K2d.js").then((m) => m.runPromote(argv));
272
+ return import("./promote-UMTh8Q33.js").then((m) => m.runPromote(argv));
256
273
  }).command("publish [dir]", "Push and promote in one step - build, version, and ship to production", (y) => y.positional("dir", {
257
274
  type: "string",
258
275
  describe: "Project directory (default: cwd)"
@@ -265,7 +282,7 @@ const registerPaywallCommands = (cli) => cli.command("create [dir]", "Set up pay
265
282
  platform: {
266
283
  type: "array",
267
284
  string: true,
268
- describe: "Limit to these platforms (repeatable, or comma-separated) - ios, android, web, flutter, react_native"
285
+ describe: "Limit to these platforms (repeatable, or comma-separated) - ios, android, web"
269
286
  },
270
287
  rename: {
271
288
  type: "array",
@@ -278,7 +295,7 @@ const registerPaywallCommands = (cli) => cli.command("create [dir]", "Set up pay
278
295
  describe: "Publish note recorded in the source commit (only lands when this publish creates a new source commit — unchanged source reuses the existing commit)"
279
296
  }
280
297
  }), (argv) => {
281
- return import("./publish-C-zEUnO9.js").then((m) => m.runPublish(argv));
298
+ return import("./publish-DWX8S9yZ.js").then((m) => m.runPublish(argv));
282
299
  });
283
300
 
284
301
  //#endregion
@@ -290,7 +307,7 @@ const registerPlatformCommands = (cli) => cli.command("query [sql]", "Run SQL ag
290
307
  type: "string",
291
308
  describe: "Read SQL from a .sql file"
292
309
  } }).example("$0 query \"SHOW TABLES FROM sw\"", "Run an inline query").example("$0 query --file report.sql --json", "Run a saved query"), (argv) => {
293
- return import("./query-B8G6T8Ba.js").then((m) => m.runQuery(argv));
310
+ return import("./query-CnSsDZ7Q.js").then((m) => m.runQuery(argv));
294
311
  }).command("asc <target> [value] [value2]", "Call the App Store Connect API through Superwall's signed proxy (no .p8 / JWT needed)", (y) => y.positional("target", {
295
312
  type: "string",
296
313
  describe: "get|post|patch|delete, a raw path (/v1/...), or: apps | products | subscriptions | iaps | docs | keys"
@@ -340,7 +357,7 @@ const registerPlatformCommands = (cli) => cli.command("query [sql]", "Run SQL ag
340
357
  describe: "Plan without writing"
341
358
  }
342
359
  }), (argv) => {
343
- return import("./asc-DJqQmtmR.js").then((m) => m.runAsc(argv));
360
+ return import("./asc-r3xmFT0L.js").then((m) => m.runAsc(argv));
344
361
  }).command("asa <target> [action] [value]", "Call the Apple Search Ads API through Superwall's proxy (no key or token handling)", (y) => y.positional("target", {
345
362
  type: "string",
346
363
  describe: "A resource (campaigns, adgroups, keywords, negative-keywords, ads, creatives, product-pages, ad-rejections, reports, impression-share, apps, geo, budget-orders, acls, me), get|post|put|delete, a raw path (/campaigns), docs, or keys"
@@ -552,7 +569,7 @@ const registerPlatformCommands = (cli) => cli.command("query [sql]", "Run SQL ag
552
569
  describe: "product-pages: include deleted assets"
553
570
  }
554
571
  }), (argv) => {
555
- return import("./asa-BFWehnTA.js").then((m) => m.runAsa(argv));
572
+ return import("./asa-2ykGnjaV.js").then((m) => m.runAsa(argv));
556
573
  });
557
574
 
558
575
  //#endregion
@@ -632,10 +649,10 @@ const registerResourceCommands = (input) => {
632
649
  describe: "Plan without writing"
633
650
  }
634
651
  }), (argv) => {
635
- return import("./resource-DjsWVka-.js").then((m) => m.runResource(resource)(argv));
652
+ return import("./resource-5bgyyL9B.js").then((m) => m.runResource(resource)(argv));
636
653
  });
637
654
  cli = cli.command("bootstrap", "Complete account tree: orgs, projects, apps, campaigns, placements, and products", (y) => y, (argv) => {
638
- return import("./api-CEwXCCoC.js").then((m) => m.runBootstrap(argv));
655
+ return import("./api-BOR-uXZe.js").then((m) => m.runBootstrap(argv));
639
656
  });
640
657
  for (const verb of API_VERBS) cli = cli.command(`${verb} <path>`, `Make ${verb.toUpperCase()} requests to the Superwall API`, (y) => y.positional("path", {
641
658
  type: "string",
@@ -644,13 +661,23 @@ const registerResourceCommands = (input) => {
644
661
  type: "array",
645
662
  describe: "Param, Stripe-style: -d key=value (string) or key:=value (number/bool/json); nesting via key[sub]"
646
663
  } }), (argv) => {
647
- return import("./api-CEwXCCoC.js").then((m) => m.runApi(verb)(argv));
664
+ return import("./api-BOR-uXZe.js").then((m) => m.runApi(verb)(argv));
648
665
  });
649
666
  return cli;
650
667
  };
651
668
 
652
669
  //#endregion
653
670
  //#region src/cli/workflow.ts
671
+ const migrateNextOptions = {
672
+ screen: {
673
+ type: "string",
674
+ describe: "A SwiftUI, UIKit, Kotlin (Compose or Views), React Native or Flutter file to rebuild as a Superwall screen (no path: pick from likely candidates)"
675
+ },
676
+ screenshot: {
677
+ type: "string",
678
+ describe: "A screenshot of the native screen, shown as Compare › Original in the studio"
679
+ }
680
+ };
654
681
  const registerWorkflowCommands = (cli) => cli.command("integrate", "Set up the SDK, placements, and dashboard in your app", (y) => y.options({
655
682
  ...installDirOption,
656
683
  ...apiKeyOption,
@@ -667,8 +694,8 @@ const registerWorkflowCommands = (cli) => cli.command("integrate", "Set up the S
667
694
  hidden: true
668
695
  }
669
696
  }), (argv) => {
670
- if (argv.skill) return import("./print-skill-BHVPP9cX.js").then((m) => m.runPrintSkill("integrate")(argv));
671
- return import("./integrate-D8jyhDzk.js").then((m) => m.runIntegrate(argv));
697
+ if (argv.skill) return import("./print-skill-CaHRJ8xW.js").then((m) => m.runPrintSkill("integrate")(argv));
698
+ return import("./integrate-DVqhvPVq.js").then((m) => m.runIntegrate(argv));
672
699
  }).command("review", "Review an existing Superwall setup end to end", (y) => y.options({
673
700
  ...installDirOption,
674
701
  ...dryRunOption,
@@ -679,18 +706,25 @@ const registerWorkflowCommands = (cli) => cli.command("integrate", "Set up the S
679
706
  }
680
707
  }), (argv) => {
681
708
  const id = argv.fix ? "review-fix" : "review";
682
- if (argv.skill) return import("./print-skill-BHVPP9cX.js").then((m) => m.runPrintSkill(id)(argv));
683
- return import("./integrate-D8jyhDzk.js").then((m) => m.runActionCommand(id)(argv));
684
- }).command("migrate", "Migrate from RevenueCat / Adapty / Qonversion to Superwall", (y) => y.options({
685
- ...installDirOption,
686
- "dry-run": {
687
- type: "boolean",
688
- describe: "Plan without changes"
689
- },
690
- ...skillOption
691
- }), (argv) => {
692
- if (argv.skill) return import("./print-skill-BHVPP9cX.js").then((m) => m.runPrintSkill("migrate")(argv));
693
- return import("./migrate-D_x1oyTk.js").then((m) => m.runMigrate(argv));
709
+ if (argv.skill) return import("./print-skill-CaHRJ8xW.js").then((m) => m.runPrintSkill(id)(argv));
710
+ return import("./integrate-DVqhvPVq.js").then((m) => m.runActionCommand(id)(argv));
711
+ }).command(CHANNEL() === "next" ? "migrate [paywall]" : "migrate", CHANNEL() === "next" ? "Migrate from RevenueCat / Adapty / Qonversion, or rebuild a dashboard paywall or a native screen as code" : "Migrate from RevenueCat / Adapty / Qonversion", (y) => {
712
+ const base = y.options({
713
+ ...installDirOption,
714
+ "dry-run": {
715
+ type: "boolean",
716
+ describe: "Plan without changes"
717
+ },
718
+ ...skillOption
719
+ }).example("$0 migrate", "Move this app off RevenueCat / Adapty / Qonversion");
720
+ if (CHANNEL() !== "next") return base;
721
+ return base.positional("paywall", {
722
+ type: "string",
723
+ describe: "A dashboard paywall id: scaffold it as code (if not already) and rebuild its pages with your agent, or copy the prompt"
724
+ }).options(migrateNextOptions).example("$0 migrate 65920", "Rebuild dashboard paywall 65920 as code").example("$0 migrate --screen App/UpdateRequiredView.swift", "Rebuild a native screen as a Superwall surface");
725
+ }, (argv) => {
726
+ if (argv.skill && argv.paywall === void 0 && argv.screen === void 0) return import("./print-skill-CaHRJ8xW.js").then((m) => m.runPrintSkill("migrate")(argv));
727
+ return import("./migrate-qmvOtp3l.js").then((m) => m.runMigrate(argv));
694
728
  });
695
729
 
696
730
  //#endregion
@@ -715,7 +749,7 @@ async function run() {
715
749
  cli = registerAccountCommands(cli);
716
750
  cli = registerPlatformCommands(cli);
717
751
  cli = registerResourceCommands(cli);
718
- cli = registerPaywallCommands(cli);
752
+ if (CHANNEL() === "next") cli = registerPaywallCommands(cli);
719
753
  await cli.command("$0", false, (y) => y, () => printHelp()).version(VERSION).alias("v", "version").help().alias("h", "help").recommendCommands().showHelpOnFail(false).fail((msg, err) => {
720
754
  if (err) throw err;
721
755
  const friendly = msg.replace(/^Unknown arguments?:/, "Unknown command:").replace(/^Not enough non-option arguments.*$/, "Missing a required argument.");
@@ -1,5 +1,5 @@
1
- import { d as Integration } from "./output-csAtR6kJ.js";
2
- import { n as allDeps, r as readPackageJson } from "./scan-DJixvuHn.js";
1
+ import { m as Integration } from "./output-CiELrN8w.js";
2
+ import { n as allDeps, r as readPackageJson } from "./scan-CAObNRgc.js";
3
3
  import { readFileSync } from "node:fs";
4
4
  import fg from "fast-glob";
5
5
 
@@ -39,7 +39,10 @@ function sdkInstalledFor(app) {
39
39
  "**/project.pbxproj",
40
40
  "**/Podfile",
41
41
  "**/pubspec.yaml",
42
- "**/pubspec.lock"
42
+ "**/pubspec.lock",
43
+ "**/build.gradle",
44
+ "**/build.gradle.kts",
45
+ "**/libs.versions.toml"
43
46
  ], {
44
47
  cwd: app.path,
45
48
  ignore: IGNORE,
@@ -1,9 +1,9 @@
1
- import { g as VERSION, h as TELEMETRY_KEY, m as TELEMETRY_HOST } from "./output-csAtR6kJ.js";
2
- import { a as getAnonymousId } from "./telemetry-BtkMdT-5.js";
3
- import "./update-CeylIjx5.js";
4
- import { i as loadSession } from "./token-hM7V1KMG.js";
5
- import { t as defineCommand } from "./command-DP96_gmP.js";
6
- import "./ui-Lqt_zFOr.js";
1
+ import { _ as TELEMETRY_HOST, v as TELEMETRY_KEY, y as VERSION } from "./output-CiELrN8w.js";
2
+ import { a as getAnonymousId } from "./telemetry-BuCbmoux.js";
3
+ import "./update-DnGfpCD7.js";
4
+ import { i as loadSession } from "./token-mju3Q-vc.js";
5
+ import { t as defineCommand } from "./command-DMoMn7uc.js";
6
+ import "./ui-4gLyfrgl.js";
7
7
 
8
8
  //#region src/core/feedback.ts
9
9
  function buildFeedbackEvent(message, via, distinctId, session) {
@@ -1,5 +1,5 @@
1
- import { a as API_HOST } from "./output-csAtR6kJ.js";
2
- import { i as loadSession, t as getOAuthAccessToken } from "./token-hM7V1KMG.js";
1
+ import { o as API_HOST } from "./output-CiELrN8w.js";
2
+ import { i as loadSession, t as getOAuthAccessToken } from "./token-mju3Q-vc.js";
3
3
 
4
4
  //#region src/core/agent/hosted.ts
5
5
  const STATUS_PATH = "/v2/cli-agent/status";
@@ -1,30 +1,30 @@
1
- import { _ as apiKeyFromEnv, g as VERSION, l as DASHBOARD_URL, r as formatJson, t as blocks } from "./output-csAtR6kJ.js";
2
- import { r as setTelemetryTags, s as getOnboardedApp } from "./telemetry-BtkMdT-5.js";
3
- import "./update-CeylIjx5.js";
4
- import { i as loadSession } from "./token-hM7V1KMG.js";
5
- import { i as superwallApi, t as defineCommand } from "./command-DP96_gmP.js";
6
- import { i as stripReport, n as ui } from "./ui-Lqt_zFOr.js";
7
- import { n as ensureSkillsCurrent } from "./skills-CODut1Hn.js";
1
+ import { b as apiKeyFromEnv, f as DASHBOARD_URL, r as formatJson, t as blocks, y as VERSION } from "./output-CiELrN8w.js";
2
+ import { r as setTelemetryTags, s as getOnboardedApp } from "./telemetry-BuCbmoux.js";
3
+ import "./update-DnGfpCD7.js";
4
+ import { i as loadSession } from "./token-mju3Q-vc.js";
5
+ import { a as superwallApi, t as defineCommand } from "./command-DMoMn7uc.js";
6
+ import { i as stripReport, n as ui } from "./ui-4gLyfrgl.js";
7
+ import { n as ensureSkillsCurrent } from "./skills-grTDuHlc.js";
8
8
  import "./spawn-DSoTXy_j.js";
9
- import "./login-kneYhhk0.js";
10
- import { i as SUPPORTED_LABEL, t as scanProject } from "./scan-DJixvuHn.js";
11
- import { t as detectDrivers } from "./drivers-UT36AnOw.js";
12
- import "./hosted-CEH78QVn.js";
13
- import { t as detectExisting } from "./existing-Cak1WxWB.js";
14
- import { t as withSpinner } from "./spinner-B9dT3DBY.js";
15
- import { C as rowName, f as listApplications, h as listResource, o as createProduct, y as platformLabel } from "./resources-s64mBHaC.js";
16
- import "./org-Cg25bcsj.js";
17
- import { n as resolveAppBinding, r as resolveScopeFromKey, t as platformForIntegration } from "./bind-BZxVyt9P.js";
18
- import { r as actionById } from "./actions-EfP8phmb.js";
19
- import { a as recoverUnmatchedScope, i as pickApp, n as ensureAgentDriverReady, o as stage, r as performLoginWithUi, t as chooseAction } from "./app-D8mEVlQo.js";
20
- import { c as listAscConfigs, i as listAscApps, n as fetchUnimportedAscProducts, o as createAscConfig, r as findAscAppId, t as ascTypeDisplay } from "./asc-products-C6MvSy8H.js";
21
- import { t as generateStoreKit } from "./storekit-DPonXSwe.js";
22
- import { i as saveReport, n as buildCopyPrompt, r as loadReport, t as runAction } from "./run-BtcQJCP8.js";
23
- import { t as detectBilling } from "./billing-BzEnVPD2.js";
24
- import { readFileSync, writeFileSync } from "node:fs";
25
- import { homedir } from "node:os";
9
+ import "./login-Bjj8QvIN.js";
10
+ import { i as SUPPORTED_LABEL, t as scanProject } from "./scan-CAObNRgc.js";
11
+ import { t as detectDrivers } from "./drivers-Cr252DOJ.js";
12
+ import "./hosted-Cjekn8oJ.js";
13
+ import { t as detectExisting } from "./existing-Ckx_g7Be.js";
14
+ import { t as withSpinner } from "./spinner-DFctF_Jw.js";
15
+ import { T as rowName, b as platformLabel, g as listResource, o as createProduct, p as listApplications } from "./resources-Bf9O1JNM.js";
16
+ import "./org-CV8c849b.js";
17
+ import { n as resolveAppBinding, r as resolveScopeFromKey, t as platformForIntegration } from "./bind-BSTAinn6.js";
18
+ import { r as actionById } from "./actions-Dt35nIi8.js";
19
+ import { a as recoverUnmatchedScope, i as pickApp, n as ensureAgentDriverReady, o as stage, r as performLoginWithUi, t as chooseAction } from "./app-BU27SLPX.js";
20
+ import { a as copyToClipboard, r as buildCopyPrompt, t as runAction } from "./run-BVeZWbXx.js";
21
+ import { c as listAscConfigs, i as listAscApps, n as fetchUnimportedAscProducts, o as createAscConfig, r as findAscAppId, t as ascTypeDisplay } from "./asc-products-1e1DoGeL.js";
22
+ import { t as generateStoreKit } from "./storekit-Dlpbq5Wv.js";
23
+ import { n as saveReport, t as loadReport } from "./reports-C0xHCLnt.js";
24
+ import { t as detectBilling } from "./billing-BsQgXXYh.js";
26
25
  import { basename, join } from "node:path";
27
- import { spawn } from "node:child_process";
26
+ import { homedir } from "node:os";
27
+ import { readFileSync, writeFileSync } from "node:fs";
28
28
  import fg from "fast-glob";
29
29
 
30
30
  //#region src/core/account/index.ts
@@ -406,45 +406,6 @@ async function runFallback(installDir) {
406
406
  ui.outro("Re-run `superwall integrate` after installing an agent.");
407
407
  }
408
408
 
409
- //#endregion
410
- //#region src/clipboard.ts
411
- async function copyToClipboard(text) {
412
- const cmd = clipboardCommand();
413
- if (!cmd) return false;
414
- return new Promise((resolve$1) => {
415
- try {
416
- const child = spawn(cmd.command, cmd.args, { stdio: [
417
- "pipe",
418
- "ignore",
419
- "ignore"
420
- ] });
421
- child.on("error", () => resolve$1(false));
422
- child.on("close", (code) => resolve$1(code === 0));
423
- child.stdin.on("error", () => resolve$1(false));
424
- child.stdin.write(text);
425
- child.stdin.end();
426
- } catch {
427
- resolve$1(false);
428
- }
429
- });
430
- }
431
- function clipboardCommand() {
432
- switch (process.platform) {
433
- case "darwin": return {
434
- command: "pbcopy",
435
- args: []
436
- };
437
- case "win32": return {
438
- command: "clip",
439
- args: []
440
- };
441
- default: return {
442
- command: "xclip",
443
- args: ["-selection", "clipboard"]
444
- };
445
- }
446
- }
447
-
448
409
  //#endregion
449
410
  //#region src/commands/workflow/integrate/agent.ts
450
411
  async function copyIntegrationPrompt(context) {
@@ -552,14 +513,12 @@ function campaignSummary(campaigns) {
552
513
  const runIntegrate = defineCommand({
553
514
  name: "integrate",
554
515
  auth: "optional",
555
- telemetry: "workflow",
556
516
  run: runPipeline
557
517
  });
558
518
  function runActionCommand(action) {
559
519
  return defineCommand({
560
520
  name: action,
561
521
  auth: "optional",
562
- telemetry: "workflow",
563
522
  run: (ctx) => runFlow(ctx, action)
564
523
  });
565
524
  }