@superwall/cli 2.6.0-beta.2 → 2.6.1

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 (152) hide show
  1. package/README.md +47 -16
  2. package/dist/{apple-Dc5pOPms.js → apple-BE1GBJFP.js} +17 -19
  3. package/dist/{approve-BSbdmOez.js → approve-yRZmvkCj.js} +9 -11
  4. package/dist/{assets-C_RjojkK.js → assets-DTAgbWw0.js} +3 -3
  5. package/dist/auth.d.ts +11 -4
  6. package/dist/auth.js +4 -5
  7. package/dist/base-zc1wl_9b.js +82 -0
  8. package/dist/{billing-B6HK-F_a.js → billing-C1LV4-BN.js} +3 -3
  9. package/dist/{build-DK88pTMW.js → build-CQd-pf7O.js} +35 -16
  10. package/dist/{client-x08fpvay.js → config-DCqRQTJ4.js} +162 -15
  11. package/dist/create-CSHGZDfB.js +18 -0
  12. package/dist/{create-kpqEhqkk.js → create-Costu6UT.js} +9 -9
  13. package/dist/{create-B6-Dr3GZ.js → create-wlCp83IH.js} +41 -41
  14. package/dist/{doctor-DYbm8IKQ.js → doctor-Bd9ffg51.js} +50 -10
  15. package/dist/entry.js +45 -40
  16. package/dist/{environment-BFNzLLPN.js → environment-Dn7irhZr.js} +1 -1
  17. package/dist/{drivers-Dyi-y9Jn.js → existing-BQMB_2AG.js} +305 -8
  18. package/dist/framework-DW5fqjh4.js +65 -0
  19. package/dist/{source-BccdO4aL.js → git-Hf9Wc7Hp.js} +34 -92
  20. package/dist/{held-sKq3xrsT.js → held-D5wSX2Mf.js} +9 -9
  21. package/dist/held-Dmf5SR3p.js +15 -0
  22. package/dist/{install-DsIsif39.js → install-CxyqfKFe.js} +15 -17
  23. package/dist/{integrate-B8eA676b.js → integrate-MkyDDzI5.js} +33 -38
  24. package/dist/{login-BlpfYapG.js → login-B7IqDafm.js} +3 -3
  25. package/dist/{login-Blhxi20A.js → login-BMHDhxAx.js} +8 -9
  26. package/dist/login-Cp0-BgDZ.js +13 -0
  27. package/dist/{lookup-Dg55W9S7.js → lookup-DkcT4E-5.js} +28 -4
  28. package/dist/{migrate-DoRb9jmA.js → migrate-CdFoZipj.js} +66 -45
  29. package/dist/{notification-url-D82msWF5.js → notification-url-D6KKeXnk.js} +4 -4
  30. package/dist/{open-BAqLpTSI.js → open-COJE6ryI.js} +2 -2
  31. package/dist/{org-C4G7WjTV.js → org-BV8wwxwc.js} +4 -4
  32. package/dist/{organization-CmuQwcKN.js → organization-9R_1PJKk.js} +4 -4
  33. package/dist/{orgs-1OzwUtpT.js → orgs-ltP8H0Nl.js} +1 -2
  34. package/dist/{paths-gBbqgkS7.js → paths-Cb1RfjaX.js} +1 -1
  35. package/dist/{playbook-BKqlv77S.js → playbook-CVGolez9.js} +10 -14
  36. package/dist/{products-Cqq59DBQ.js → products-CJq_iXv5.js} +1 -1
  37. package/dist/{promote-D0i8A0CO.js → promote-B_HnFEbX.js} +27 -28
  38. package/dist/{pull-DgQ_UmGv.js → pull-DF4KYVcP.js} +72 -26
  39. package/dist/pull-JxiMyRwY.js +30 -0
  40. package/dist/{pull-CiIrJ5ik.js → pull-lYRULo4v.js} +33 -39
  41. package/dist/push-B5py7h5y.js +29 -0
  42. package/dist/{push-7N4XIVtg.js → push-BZN1Qpkq.js} +23 -12
  43. package/dist/{push-BWsXO7FN.js → push-BnllH2Rd.js} +8 -7
  44. package/dist/push-DHlUMkbf.js +21 -0
  45. package/dist/registry-BGEYCWyD.js +22 -0
  46. package/dist/{registry-aAR_8VOw.js → registry-CqePfigB.js} +1287 -902
  47. package/dist/{resolve-CcOpO_5s.js → resolve-B4bd3Qjl.js} +4 -4
  48. package/dist/{resources-DNwvf8rg.js → resources-BaURbSpY.js} +15 -2
  49. package/dist/{run-tVYJ3V5j.js → run-Bme4Egyl.js} +15 -17
  50. package/dist/{scan-dv0rrY4C.js → scan-DugxddUU.js} +1 -1
  51. package/dist/scan-J2DILUNE.js +4 -0
  52. package/dist/{scope-ehZ7L1nj.js → scope-Cg1AdAfO.js} +33 -3
  53. package/dist/{scope-BXoQo30_.js → scope-DDYLQeZw.js} +24 -18
  54. package/dist/screenshot-file-Dix2Qynm.js +127 -0
  55. package/dist/{sdk-DEfQttek.js → sdk-BFunw4Hc.js} +1 -1
  56. package/dist/{framework-JFLjmD5Y.js → selection-C439nEhn.js} +4 -54
  57. package/dist/{series-D2ZpZ8cx.js → series-B8NJK4yS.js} +1 -1
  58. package/dist/{server-CcZGdYjE.js → server-C_aMxzvS.js} +40 -18
  59. package/dist/server-Cif9w5lM.js +33 -0
  60. package/dist/{session-dHBtgSN0.js → session-B7frlXXQ.js} +1 -1
  61. package/dist/{base-83ZTv6up.js → session-CfG3gzko.js} +8 -83
  62. package/dist/session-DvaPyOuH.js +5 -0
  63. package/dist/{migration-BUedsREQ.js → setup-DQEasPhx.js} +290 -28
  64. package/dist/skills/index.json +5 -0
  65. package/dist/skills/superwall/SKILL.md +37 -10
  66. package/dist/skills/superwall/references/api.md +66 -21
  67. package/dist/skills/superwall/references/asa.md +109 -64
  68. package/dist/skills/superwall/references/dashboard-links.md +65 -28
  69. package/dist/skills/superwall/references/data-analytics.md +1 -1
  70. package/dist/skills/superwall/workflows/dashboard/setup.md +15 -5
  71. package/dist/skills/superwall/workflows/integrate/flutter.md +9 -7
  72. package/dist/skills/superwall-framework/SKILL.md +248 -36
  73. package/dist/skills/superwall-framework/references/cli.md +98 -7
  74. package/dist/skills/superwall-framework/references/examples.md +2 -2
  75. package/dist/skills/superwall-framework/references/layout.md +30 -2
  76. package/dist/skills/superwall-framework/references/migrate-from-editor.md +5 -0
  77. package/dist/skills/superwall-framework/references/migrate-from-native.md +5 -0
  78. package/dist/skills/teleport/SKILL.md +154 -0
  79. package/dist/skills/teleport/references/experiments.md +328 -0
  80. package/dist/skills/teleport/references/setup.md +157 -0
  81. package/dist/{skills-Q7xB784d.js → skills-DnegE1A6.js} +139 -9
  82. package/dist/{skills-Bqz2l_bx.js → skills-MmF7IyTg.js} +8 -12
  83. package/dist/source-DQs6iLtC.js +82 -0
  84. package/dist/{source-push-CG948HrX.js → source-push-MbJjh4Ki.js} +38 -14
  85. package/dist/{spinner-IA6hV8nI.js → spinner-Dcr-Dqdi.js} +7 -5
  86. package/dist/{starter-BtUUQWhd.js → starter-BlJ_InZJ.js} +2 -2
  87. package/dist/{status-CB_MrFu5.js → status-DHRxg1ZA.js} +9 -11
  88. package/dist/{output-Ggzq5_-t.js → storage-DdIAHolY.js} +40 -1
  89. package/dist/storekit-De998QOt.js +203 -0
  90. package/dist/storekit-iBCWmeKn.js +15 -0
  91. package/dist/{bind-DcWIIPgk.js → theme-BrUrye-c.js} +29 -6
  92. package/dist/token-CKCBQ4I8.js +100 -0
  93. package/dist/tools-skills/animate-onboarding/SKILL.md +1 -1
  94. package/dist/tools-skills/mobile-design/SKILL.md +1 -1
  95. package/dist/tools-skills/onboarding-questions/SKILL.md +1 -1
  96. package/dist/tools-skills/superwall/SKILL.md +43 -17
  97. package/dist/tools-skills/superwall/references/api.md +74 -24
  98. package/dist/tools-skills/superwall/references/asa.md +109 -64
  99. package/dist/tools-skills/superwall/references/dashboard-links.md +65 -28
  100. package/dist/tools-skills/superwall/references/data-analytics.md +1 -1
  101. package/dist/tools-skills/superwall/workflows/dashboard/playbook.md +4 -3
  102. package/dist/tools-skills/superwall/workflows/dashboard/setup.md +21 -8
  103. package/dist/tools-skills/superwall/workflows/integrate/flutter.md +9 -7
  104. package/dist/tools-skills/superwall/workflows/migrate/adapty.md +4 -3
  105. package/dist/tools-skills/superwall/workflows/migrate/playbook.md +2 -2
  106. package/dist/tools-skills/superwall/workflows/migrate/qonversion.md +4 -3
  107. package/dist/tools-skills/superwall/workflows/migrate/revenuecat.md +4 -3
  108. package/dist/tools-skills/superwall-editor/SKILL.md +2 -3
  109. package/dist/tools-skills/teleport/SKILL.md +154 -0
  110. package/dist/tools-skills/teleport/references/experiments.md +328 -0
  111. package/dist/tools-skills/teleport/references/setup.md +157 -0
  112. package/dist/tools.d.ts +1 -1
  113. package/dist/tools.js +1232 -746
  114. package/dist/{try-CS3jLyoP.js → try-C8QQbG0b.js} +17 -19
  115. package/dist/{lock-DgSx-p8Y.js → types-Dc9U_4kp.js} +86 -80
  116. package/dist/upgrade-CYFdpVpi.js +27 -0
  117. package/dist/upgrade-D0thxCA4.js +348 -0
  118. package/package.json +11 -3
  119. package/dist/config-CGcG7GOt.js +0 -113
  120. package/dist/create-Du8Fx7W5.js +0 -20
  121. package/dist/existing-WQ3pz94o.js +0 -97
  122. package/dist/held-DmOhszHR.js +0 -17
  123. package/dist/log-C0MDCfA2.js +0 -62
  124. package/dist/login-D9jfRO8w.js +0 -17
  125. package/dist/pull-CO5HlqBe.js +0 -36
  126. package/dist/push-BIhGDNpL.js +0 -30
  127. package/dist/push-BgqTddLA.js +0 -22
  128. package/dist/run-B-YoyB-a.js +0 -100
  129. package/dist/scan-BU41gcQY.js +0 -4
  130. package/dist/screenshot-file-XAS0Xy0e.js +0 -16
  131. package/dist/server-BemmM1FV.js +0 -29
  132. package/dist/session-4aITGsF1.js +0 -6
  133. package/dist/setup-m94dpT3t.js +0 -217
  134. package/dist/spawn-DmmmHIP-.js +0 -71
  135. package/dist/storage-pR0Wb0d9.js +0 -41
  136. package/dist/storekit-BMxyYAHj.js +0 -17
  137. package/dist/storekit-CQnwlpKV.js +0 -47
  138. package/dist/telemetry-DU56L7Cy.js +0 -56
  139. package/dist/theme-DUsCh-Vd.js +0 -25
  140. package/dist/token-BbUeExGJ.js +0 -70
  141. package/dist/upgrade-CKn88PZD.js +0 -206
  142. package/dist/upgrade-DfD3-ClG.js +0 -7
  143. /package/dist/{browser-Bp3yRKlU.js → browser-BVjaf98V.js} +0 -0
  144. /package/dist/{client-BJQXl62Q.js → client-BwYhzITp.js} +0 -0
  145. /package/dist/{design-lint-CiFc78aM.js → design-lint-mgO-2SGS.js} +0 -0
  146. /package/dist/{devtools-ByZ6XYnn.js → devtools-B6Vp6HMy.js} +0 -0
  147. /package/dist/{input-MDd67UIp.js → input-DOT_2Zvb.js} +0 -0
  148. /package/dist/{project-NoMtbMyl.js → project-BomArwSj.js} +0 -0
  149. /package/dist/{reports-HYVp169R.js → reports-hbxsd3Zo.js} +0 -0
  150. /package/dist/{storage-Bdz5AmqS.d.ts → storage-Bh3wT1Rn.d.ts} +0 -0
  151. /package/dist/{timing-Ca0TXY-A.js → timing-BKEEIBij.js} +0 -0
  152. /package/dist/{ui-D_qf3Gvw.js → ui-hFgji1e8.js} +0 -0
@@ -1,14 +1,143 @@
1
- import { c as CHANNELS, s as CHANNEL, x as VERSION } from "./environment-BFNzLLPN.js";
2
- import { c as readSkillsSync, g as writeSkillsSync } from "./config-CGcG7GOt.js";
3
- import { r as track } from "./telemetry-DU56L7Cy.js";
4
- import { r as spawnStream } from "./spawn-DmmmHIP-.js";
5
- import { n as withSpinner } from "./spinner-IA6hV8nI.js";
6
- import { n as ui } from "./ui-D_qf3Gvw.js";
7
- import { i as packagedDir, t as AGENT_SKILLS_DIR } from "./paths-gBbqgkS7.js";
8
- import { existsSync, mkdtempSync, readFileSync, readdirSync, rmSync, writeFileSync } from "node:fs";
1
+ import { T as isNonInteractive, c as CHANNELS, s as CHANNEL, v as TELEMETRY_HOST, x as VERSION, y as TELEMETRY_KEY } from "./environment-Dn7irhZr.js";
2
+ import { _ as writeTelemetryNoticeShown, c as readSkillsSync, g as writeSkillsSync, t as readAnonymousId, u as telemetryNoticeShown } from "./config-DCqRQTJ4.js";
3
+ import { n as ui } from "./ui-hFgji1e8.js";
4
+ import { n as withSpinner } from "./spinner-Dcr-Dqdi.js";
5
+ import { i as packagedDir, t as AGENT_SKILLS_DIR } from "./paths-Cb1RfjaX.js";
6
+ import { execFile, spawn } from "node:child_process";
7
+ import { appendFileSync, existsSync, mkdtempSync, readFileSync, readdirSync, rmSync, writeFileSync } from "node:fs";
9
8
  import { tmpdir } from "node:os";
10
9
  import { join } from "node:path";
10
+ import { createInterface } from "node:readline";
11
+ import { promisify } from "node:util";
11
12
 
13
+ //#region src/core/support/telemetry.ts
14
+ const tags = {};
15
+ const pending = [];
16
+ function updateTelemetryTags(next) {
17
+ Object.assign(tags, next);
18
+ }
19
+ function isTelemetryEnabled(env, key) {
20
+ return Boolean(key) && !env.DO_NOT_TRACK && !env.SUPERWALL_TELEMETRY_DISABLED && !env.NODE_TEST_CONTEXT;
21
+ }
22
+ function telemetryEnabled() {
23
+ return isTelemetryEnabled(process.env, TELEMETRY_KEY());
24
+ }
25
+ function buildEvent(event, props, distinctId) {
26
+ return {
27
+ api_key: TELEMETRY_KEY(),
28
+ event,
29
+ distinct_id: distinctId,
30
+ timestamp: (/* @__PURE__ */ new Date()).toISOString(),
31
+ properties: {
32
+ $process_person_profile: false,
33
+ cli_version: VERSION,
34
+ platform: process.platform,
35
+ ci: process.env.CI === "true",
36
+ interactive: !isNonInteractive(),
37
+ ...tags,
38
+ ...props
39
+ }
40
+ };
41
+ }
42
+ function track(event, props = {}) {
43
+ if (!telemetryEnabled()) return;
44
+ try {
45
+ const payload = buildEvent(event, props, readAnonymousId());
46
+ pending.push(fetch(`${TELEMETRY_HOST()}/capture/`, {
47
+ method: "POST",
48
+ headers: { "content-type": "application/json" },
49
+ body: JSON.stringify(payload),
50
+ signal: AbortSignal.timeout(1500)
51
+ }).catch(() => {}));
52
+ } catch {}
53
+ }
54
+ async function flushTelemetry(capMs = 2e3) {
55
+ if (pending.length === 0) return;
56
+ await Promise.race([Promise.allSettled(pending), new Promise((done) => setTimeout(done, capMs).unref())]);
57
+ }
58
+ function maybeShowTelemetryNotice(ui$1) {
59
+ if (!telemetryEnabled() || telemetryNoticeShown()) return;
60
+ writeTelemetryNoticeShown();
61
+ ui$1.info("The CLI collects anonymous usage data - no personal data, ever (see the README). Opt out with `SUPERWALL_TELEMETRY_DISABLED=1`.");
62
+ }
63
+
64
+ //#endregion
65
+ //#region src/core/workflows/agent/drivers/spawn.ts
66
+ const execFileAsync = promisify(execFile);
67
+ function writeTranscript(line) {
68
+ const transcript = process.env.SW_BENCH_TRANSCRIPT;
69
+ if (!transcript) return;
70
+ try {
71
+ appendFileSync(transcript, line + "\n");
72
+ } catch {
73
+ return;
74
+ }
75
+ }
76
+ async function readVersion(bin) {
77
+ try {
78
+ const { stdout } = await execFileAsync(bin, ["--version"], { timeout: 5e3 });
79
+ return stdout.trim().split("\n")[0];
80
+ } catch {
81
+ return;
82
+ }
83
+ }
84
+ async function onPath(bin) {
85
+ const probe = process.platform === "win32" ? "where" : "command";
86
+ const args = process.platform === "win32" ? [bin] : ["-v", bin];
87
+ try {
88
+ await execFileAsync(probe, args, {
89
+ timeout: 5e3,
90
+ shell: process.platform !== "win32"
91
+ });
92
+ return true;
93
+ } catch {
94
+ return false;
95
+ }
96
+ }
97
+ const CMD_META = /([()\][%!^"`<>&|;, *?])/g;
98
+ function escapeCmdCommand(bin) {
99
+ return bin.replace(CMD_META, "^$1");
100
+ }
101
+ function escapeCmdShimArgument(arg) {
102
+ return `"${arg.replace(/(\\*)"/g, "$1$1\\\"").replace(/(\\*)$/, "$1$1")}"`.replace(CMD_META, "^$1").replace(CMD_META, "^$1");
103
+ }
104
+ function spawnStream(opts) {
105
+ return new Promise((resolve$1, reject) => {
106
+ const options = {
107
+ cwd: opts.cwd,
108
+ signal: opts.signal,
109
+ stdio: [
110
+ "ignore",
111
+ "pipe",
112
+ "pipe"
113
+ ]
114
+ };
115
+ const child = opts.cmdShim && process.platform === "win32" ? spawn([escapeCmdCommand(opts.bin), ...opts.args.map(escapeCmdShimArgument)].join(" "), {
116
+ ...options,
117
+ shell: true
118
+ }) : spawn(opts.bin, opts.args, options);
119
+ createInterface({ input: child.stdout }).on("line", (line) => {
120
+ if (line.length) {
121
+ writeTranscript(line);
122
+ opts.onStdoutLine(line);
123
+ }
124
+ });
125
+ const { onStderrLine } = opts;
126
+ if (onStderrLine) createInterface({ input: child.stderr }).on("line", (line) => {
127
+ if (line.length) onStderrLine(line);
128
+ });
129
+ child.on("error", (e) => {
130
+ if (e.name === "AbortError") {
131
+ resolve$1({ code: null });
132
+ return;
133
+ }
134
+ reject(e);
135
+ });
136
+ child.on("close", (code) => resolve$1({ code }));
137
+ });
138
+ }
139
+
140
+ //#endregion
12
141
  //#region src/core/support/skills.ts
13
142
  const SUPERWALL_SKILLS_SOURCE = "superwall/skills";
14
143
  const skillsRefFor = (channel) => CHANNELS[channel].skillsRef;
@@ -226,6 +355,7 @@ async function runInstall(args, opts) {
226
355
  };
227
356
  const { code } = await spawnStream({
228
357
  bin: "npx",
358
+ cmdShim: true,
229
359
  args,
230
360
  cwd: process.cwd(),
231
361
  onStdoutLine: () => {},
@@ -354,4 +484,4 @@ async function runSkills(ctx, { flags }) {
354
484
  }
355
485
 
356
486
  //#endregion
357
- export { bundledSkills as a, knownSkills as c, readBundledSkill as d, runSkills as f, updateSkills as h, SUPERWALL_SKILLS_SOURCE as i, normalizeSkillFrontmatter as l, skillsRefFor as m, SKILLS_INSTALL_SOURCE as n, checkSkillsSync as o, skillSummary as p, SKILLS_REF as r, ensureSkillsCurrent as s, PLAYBOOKS as t, normalizeSkillsDir as u };
487
+ export { updateTelemetryTags as S, readVersion as _, bundledSkills as a, maybeShowTelemetryNotice as b, knownSkills as c, readBundledSkill as d, runSkills as f, onPath as g, updateSkills as h, SUPERWALL_SKILLS_SOURCE as i, normalizeSkillFrontmatter as l, skillsRefFor as m, SKILLS_INSTALL_SOURCE as n, checkSkillsSync as o, skillSummary as p, SKILLS_REF as r, ensureSkillsCurrent as s, PLAYBOOKS as t, normalizeSkillsDir as u, spawnStream as v, track as x, flushTelemetry as y };
@@ -1,14 +1,10 @@
1
- import "./token-BbUeExGJ.js";
2
- import "./output-Ggzq5_-t.js";
3
- import "./environment-BFNzLLPN.js";
4
- import "./storage-pR0Wb0d9.js";
5
- import "./client-x08fpvay.js";
6
- import "./config-CGcG7GOt.js";
7
- import "./telemetry-DU56L7Cy.js";
8
- import "./spawn-DmmmHIP-.js";
9
- import "./spinner-IA6hV8nI.js";
10
- import "./ui-D_qf3Gvw.js";
11
- import "./paths-gBbqgkS7.js";
12
- import { a as bundledSkills, c as knownSkills, d as readBundledSkill, f as runSkills, h as updateSkills, i as SUPERWALL_SKILLS_SOURCE, l as normalizeSkillFrontmatter, m as skillsRefFor, n as SKILLS_INSTALL_SOURCE, o as checkSkillsSync, p as skillSummary, r as SKILLS_REF, s as ensureSkillsCurrent, t as PLAYBOOKS, u as normalizeSkillsDir } from "./skills-Q7xB784d.js";
1
+ import "./token-CKCBQ4I8.js";
2
+ import "./storage-DdIAHolY.js";
3
+ import "./environment-Dn7irhZr.js";
4
+ import "./config-DCqRQTJ4.js";
5
+ import { a as bundledSkills, c as knownSkills, d as readBundledSkill, f as runSkills, h as updateSkills, i as SUPERWALL_SKILLS_SOURCE, l as normalizeSkillFrontmatter, m as skillsRefFor, n as SKILLS_INSTALL_SOURCE, o as checkSkillsSync, p as skillSummary, r as SKILLS_REF, s as ensureSkillsCurrent, t as PLAYBOOKS, u as normalizeSkillsDir } from "./skills-DnegE1A6.js";
6
+ import "./ui-hFgji1e8.js";
7
+ import "./spinner-Dcr-Dqdi.js";
8
+ import "./paths-Cb1RfjaX.js";
13
9
 
14
10
  export { PLAYBOOKS, SKILLS_INSTALL_SOURCE, SKILLS_REF, SUPERWALL_SKILLS_SOURCE, bundledSkills, checkSkillsSync, ensureSkillsCurrent, knownSkills, normalizeSkillFrontmatter, normalizeSkillsDir, readBundledSkill, runSkills, skillSummary, skillsRefFor, updateSkills };
@@ -0,0 +1,82 @@
1
+ import { s as formatSharedLock } from "./types-Dc9U_4kp.js";
2
+ import * as fs from "node:fs";
3
+ import * as path from "node:path";
4
+ import fg from "fast-glob";
5
+
6
+ //#region src/core/paywalls/source/source.ts
7
+ const HARD_EXCLUDES = [
8
+ ".superwall/**",
9
+ "**/node_modules/**",
10
+ ".git/**",
11
+ "**/.env*",
12
+ "**/.DS_Store",
13
+ "**/.npmrc",
14
+ "**/.netrc",
15
+ "**/*.pem",
16
+ "**/*.p8",
17
+ "**/*.p12",
18
+ "**/*.key",
19
+ "**/*.keystore",
20
+ "**/*.jks",
21
+ "**/google-services.json",
22
+ "**/GoogleService-Info.plist"
23
+ ];
24
+ const LOCK_FILE = "superwall.lock";
25
+ const SOURCE_LIMIT_BYTES = 250 * 1024 * 1024;
26
+ const LARGEST_SHOWN = 3;
27
+ const megabytes = (bytes) => `${(bytes / 1024 / 1024).toFixed(1)} MB`;
28
+ function gitignoreExcludes(superwallDir) {
29
+ let text;
30
+ try {
31
+ text = fs.readFileSync(path.join(superwallDir, ".gitignore"), "utf8");
32
+ } catch {
33
+ return [];
34
+ }
35
+ const excludes = [];
36
+ for (const raw of text.split("\n")) {
37
+ const line = raw.trim();
38
+ if (line === "" || line.startsWith("#") || line.startsWith("!")) continue;
39
+ const anchored = line.startsWith("/");
40
+ const body = (anchored ? line.slice(1) : line).replace(/\/+$/, "");
41
+ if (body === "") continue;
42
+ const base = anchored || body.includes("/") ? body : `**/${body}`;
43
+ excludes.push(base, `${base}/**`);
44
+ }
45
+ return excludes;
46
+ }
47
+ const readFramework = (superwallDir, relative$1) => relative$1 === LOCK_FILE ? Buffer.from(formatSharedLock(superwallDir)) : fs.readFileSync(path.join(superwallDir, relative$1));
48
+ async function collectSourceFiles(superwallDir, read = readFramework) {
49
+ const entries = await fg("**/*", {
50
+ cwd: superwallDir,
51
+ dot: true,
52
+ onlyFiles: true,
53
+ followSymbolicLinks: false,
54
+ ignore: [...HARD_EXCLUDES, ...gitignoreExcludes(superwallDir)]
55
+ });
56
+ if (entries.length === 0) return {
57
+ ok: false,
58
+ reason: `No source files found in ${superwallDir}.`
59
+ };
60
+ const sizes = entries.map((relative$1) => ({
61
+ path: relative$1,
62
+ bytes: fs.statSync(path.join(superwallDir, relative$1)).size
63
+ }));
64
+ const total = sizes.reduce((sum, entry) => sum + entry.bytes, 0);
65
+ if (total > SOURCE_LIMIT_BYTES) {
66
+ const largest = sizes.sort((a, b) => b.bytes - a.bytes).slice(0, LARGEST_SHOWN).map((entry) => `${entry.path} (${megabytes(entry.bytes)})`).join(", ");
67
+ return {
68
+ ok: false,
69
+ reason: `The source in ${superwallDir} is ${megabytes(total)}, over the ${SOURCE_LIMIT_BYTES / 1024 / 1024} MB limit. Largest: ${largest}. Add what doesn't belong to .gitignore, then push again.`
70
+ };
71
+ }
72
+ return {
73
+ ok: true,
74
+ files: entries.sort().map((relative$1) => ({
75
+ path: relative$1,
76
+ content: read(superwallDir, relative$1)
77
+ }))
78
+ };
79
+ }
80
+
81
+ //#endregion
82
+ export { collectSourceFiles as t };
@@ -1,10 +1,13 @@
1
- import { n as ApiUnreachableError, t as ApiError } from "./client-x08fpvay.js";
2
- import { n as ui } from "./ui-D_qf3Gvw.js";
3
- import { d as linkSourceCommit, f as listAppPaywalls, o as createHeadlessPaywall, v as mintSourceAccess } from "./resources-DNwvf8rg.js";
4
- import { n as findApplication } from "./lookup-Dg55W9S7.js";
5
- import { f as writeBinding, l as readLock } from "./lock-DgSx-p8Y.js";
6
- import { n as writeSourceBase, t as readSourceBase } from "./base-83ZTv6up.js";
7
- import { i as pushSourceTree, n as gitAvailable } from "./source-BccdO4aL.js";
1
+ import { b as ApiUnreachableError, y as ApiError } from "./config-DCqRQTJ4.js";
2
+ import { d as linkSourceCommit, f as listAppPaywalls, o as createHeadlessPaywall, v as mintSourceAccess } from "./resources-BaURbSpY.js";
3
+ import { n as ui } from "./ui-hFgji1e8.js";
4
+ import { n as findApplication } from "./lookup-DkcT4E-5.js";
5
+ import { f as readLock, h as writeBinding, s as formatSharedLock } from "./types-Dc9U_4kp.js";
6
+ import { r as pushSourceTree, t as gitAvailable } from "./git-Hf9Wc7Hp.js";
7
+ import { i as LOCK_FILE } from "./scope-Cg1AdAfO.js";
8
+ import { n as writeSourceBase, t as readSourceBase } from "./base-zc1wl_9b.js";
9
+ import * as fs from "node:fs";
10
+ import * as path from "node:path";
8
11
  import { setTimeout } from "node:timers/promises";
9
12
  import { productVariables } from "@superwall/studio/products";
10
13
 
@@ -89,9 +92,11 @@ async function listProjectCatalogue(api, projectId) {
89
92
  const rows = await api.list(`/v2/products?project_id=${encodeURIComponent(projectId)}`);
90
93
  const variables = /* @__PURE__ */ new Map();
91
94
  const stores = /* @__PURE__ */ new Map();
95
+ const names = /* @__PURE__ */ new Map();
92
96
  for (const row of rows) {
93
97
  if (!row.identifier) continue;
94
98
  variables.set(row.identifier, productVariables(row));
99
+ if (typeof row.name === "string" && row.name !== "" && !names.has(row.identifier)) names.set(row.identifier, row.name);
95
100
  const store = storeOf(row);
96
101
  if (store === void 0) continue;
97
102
  const known = stores.get(row.identifier) ?? [];
@@ -99,17 +104,22 @@ async function listProjectCatalogue(api, projectId) {
99
104
  }
100
105
  return {
101
106
  variables: Object.fromEntries(variables),
102
- stores: Object.fromEntries(stores)
107
+ stores: Object.fromEntries(stores),
108
+ names: Object.fromEntries(names)
103
109
  };
104
110
  }
105
- async function listProjectProducts(api, projectId) {
106
- return (await listProjectCatalogue(api, projectId)).variables;
111
+ function productListings(catalogue) {
112
+ return Object.fromEntries(Object.keys(catalogue.variables).map((identifier) => [identifier, {
113
+ ...Object.hasOwn(catalogue.names, identifier) ? { name: catalogue.names[identifier] } : {},
114
+ ...Object.hasOwn(catalogue.stores, identifier) ? { stores: catalogue.stores[identifier] } : {}
115
+ }]));
107
116
  }
108
117
  async function listApplicationCatalogue(api, applicationId) {
109
118
  const projectId = await projectForApplication(api, applicationId);
110
119
  if (projectId === void 0) return {
111
120
  variables: {},
112
- stores: {}
121
+ stores: {},
122
+ names: {}
113
123
  };
114
124
  return listProjectCatalogue(api, projectId);
115
125
  }
@@ -155,13 +165,27 @@ var GitRequiredError = class extends Error {
155
165
  async function assertGit(hasGit = gitAvailable) {
156
166
  if (!await hasGit()) throw new GitRequiredError();
157
167
  }
168
+ function withCurrentLock(superwallDir, files, landing) {
169
+ const others = files.filter((file) => file.path !== LOCK_FILE);
170
+ if (!fs.existsSync(path.join(superwallDir, LOCK_FILE))) return others;
171
+ const lock = {
172
+ path: LOCK_FILE,
173
+ content: Buffer.from(formatSharedLock(superwallDir, landing))
174
+ };
175
+ return [...others, lock].sort((a, b) => a.path < b.path ? -1 : a.path > b.path ? 1 : 0);
176
+ }
158
177
  async function syncSource(input, message) {
159
178
  const access = await mintSourceAccess(input.api, input.paywallId);
179
+ const landing = message.kind === "paywall" || message.kind === "funnel" ? {
180
+ kind: message.kind,
181
+ id: message.surface,
182
+ paywallId: input.paywallId
183
+ } : void 0;
160
184
  const pushed = await pushSourceTree({
161
185
  access,
162
186
  base: readSourceBase(input.superwallDir, access.repo),
163
187
  overwrite: input.overwrite,
164
- files: input.files,
188
+ files: withCurrentLock(input.superwallDir, input.files, landing),
165
189
  message
166
190
  });
167
191
  if (pushed.syncedTo) writeSourceBase(input.superwallDir, access.repo, pushed.syncedTo);
@@ -217,7 +241,7 @@ async function linkCommit(input, access, commitSha) {
217
241
  await setTimeout(LINK_RETRY_DELAY_MS);
218
242
  }
219
243
  }
220
- const isTransient = (error) => error instanceof ApiUnreachableError || error instanceof ApiError && error.status >= 500;
244
+ const isTransient = (error) => error instanceof ApiUnreachableError && !error.timedOut || error instanceof ApiError && error.status >= 500;
221
245
 
222
246
  //#endregion
223
- export { listApplicationCatalogue as a, projectForApplication as c, warnNotPortable as i, requireProducts as l, pushProjectSource as n, listProjectCatalogue as o, pushSource as r, listProjectProducts as s, assertGit as t, resolveBinding as u };
247
+ export { listApplicationCatalogue as a, projectForApplication as c, warnNotPortable as i, requireProducts as l, pushProjectSource as n, listProjectCatalogue as o, pushSource as r, productListings as s, assertGit as t, resolveBinding as u };
@@ -1,8 +1,8 @@
1
- import { r as NotLoggedInError } from "./token-BbUeExGJ.js";
2
- import { i as writeJson, n as createCommandOutput } from "./output-Ggzq5_-t.js";
3
- import { s as CHANNEL } from "./environment-BFNzLLPN.js";
4
- import { t as ApiError } from "./client-x08fpvay.js";
5
- import { n as ui, r as useRenderer } from "./ui-D_qf3Gvw.js";
1
+ import { i as NotLoggedInError } from "./token-CKCBQ4I8.js";
2
+ import { d as createCommandOutput, p as writeJson } from "./storage-DdIAHolY.js";
3
+ import { s as CHANNEL } from "./environment-Dn7irhZr.js";
4
+ import { y as ApiError } from "./config-DCqRQTJ4.js";
5
+ import { n as ui, r as useRenderer } from "./ui-hFgji1e8.js";
6
6
  import pc from "picocolors";
7
7
 
8
8
  //#region src/program/host.ts
@@ -267,9 +267,11 @@ function defineCatalog(spec) {
267
267
  mcp: spec.mcp,
268
268
  channel: spec.channel,
269
269
  flags: spec.flags ?? {},
270
+ strictFlags: spec.strictFlags ?? false,
270
271
  operations: spec.operations,
271
272
  help: spec.help,
272
273
  tools: spec.tools,
274
+ commandFor: spec.commandFor,
273
275
  execute: (input, runtime = {}) => {
274
276
  return runLifecycle(spec, input, runtime, (ctx) => {
275
277
  return spec.run(ctx, {
@@ -1,6 +1,6 @@
1
- import { n as MANIFEST_FILE, o as readManifest, r as VENDORED_SDK, t as ArtifactError } from "./project-NoMtbMyl.js";
1
+ import { n as MANIFEST_FILE, o as readManifest, r as VENDORED_SDK, t as ArtifactError } from "./project-BomArwSj.js";
2
2
  import { i as downloadRepoDir, n as PUBLIC_REPO, r as RepoDownloadError } from "./download-DhGd4hOB.js";
3
- import { n as compareVersions, r as vendoredVersion, t as STARTER_DIR } from "./sdk-DEfQttek.js";
3
+ import { n as compareVersions, r as vendoredVersion, t as STARTER_DIR } from "./sdk-BFunw4Hc.js";
4
4
  import { execFile } from "node:child_process";
5
5
  import * as fs from "node:fs";
6
6
  import * as os$1 from "node:os";
@@ -1,14 +1,12 @@
1
- import "./token-BbUeExGJ.js";
2
- import "./output-Ggzq5_-t.js";
3
- import "./environment-BFNzLLPN.js";
4
- import "./storage-pR0Wb0d9.js";
5
- import { t as ApiError } from "./client-x08fpvay.js";
6
- import "./config-CGcG7GOt.js";
7
- import "./orgs-1OzwUtpT.js";
8
- import { D as requestDeploy, T as listVersions, a as latestManifest, b as getBuild, c as openLink, d as resolveArtifact, f as roleCanApprove, l as pickVersion, n as awaitingInstall, o as newestFirst, p as visibilityOf, w as listMembers, x as getMe } from "./resolve-CcOpO_5s.js";
9
- import { t as ArtifactError } from "./project-NoMtbMyl.js";
10
- import "./lock-DgSx-p8Y.js";
11
- import "./scope-ehZ7L1nj.js";
1
+ import "./token-CKCBQ4I8.js";
2
+ import "./storage-DdIAHolY.js";
3
+ import "./environment-Dn7irhZr.js";
4
+ import { y as ApiError } from "./config-DCqRQTJ4.js";
5
+ import "./orgs-ltP8H0Nl.js";
6
+ import "./types-Dc9U_4kp.js";
7
+ import "./scope-Cg1AdAfO.js";
8
+ import { D as requestDeploy, T as listVersions, a as latestManifest, b as getBuild, c as openLink, d as resolveArtifact, f as roleCanApprove, l as pickVersion, n as awaitingInstall, o as newestFirst, p as visibilityOf, w as listMembers, x as getMe } from "./resolve-B4bd3Qjl.js";
9
+ import { t as ArtifactError } from "./project-BomArwSj.js";
12
10
 
13
11
  //#region src/core/artifacts/status.ts
14
12
  const SHOWN_VERSIONS = 3;
@@ -1,3 +1,5 @@
1
+ import { n as API_HOST_OVERRIDE, t as API_HOST } from "./environment-Dn7irhZr.js";
2
+
1
3
  //#region src/core/state/store.ts
2
4
  function memoryStore() {
3
5
  const files = /* @__PURE__ */ new Map();
@@ -119,4 +121,41 @@ function renderBlock(renderer, block) {
119
121
  }
120
122
 
121
123
  //#endregion
122
- export { stripAnsi as a, memoryStore as c, useStores as d, writeJson as i, readJson as l, createCommandOutput as n, cache as o, formatJson as r, emptyStore as s, blocks as t, state as u };
124
+ //#region src/core/account/storage.ts
125
+ const sessionOrgName = (session) => {
126
+ return session?.authMethod === "api_key" ? session.orgName : void 0;
127
+ };
128
+ const FILE = "auth.json";
129
+ const PENDING_FILE = "pending-login.json";
130
+ function writePendingLogin(pending) {
131
+ state().write(PENDING_FILE, `${formatJson(pending)}\n`);
132
+ }
133
+ function readPendingLogin() {
134
+ return readJson(state(), PENDING_FILE) ?? null;
135
+ }
136
+ function removePendingLogin() {
137
+ state().remove(PENDING_FILE);
138
+ }
139
+ function writeSession(session) {
140
+ state().write(FILE, `${formatJson(session)}\n`);
141
+ }
142
+ function readSession() {
143
+ return readJson(state(), FILE) ?? null;
144
+ }
145
+ function removeSession() {
146
+ state().remove(FILE);
147
+ }
148
+ function resolveApiHost(session) {
149
+ return API_HOST_OVERRIDE() ?? session.host ?? API_HOST();
150
+ }
151
+ function serializeSession(session) {
152
+ return {
153
+ authenticated: true,
154
+ user: { email: session.userEmail ?? null },
155
+ credential: { type: session.apiKey ? "api_key" : session.accessToken ? "oauth" : "unknown" },
156
+ host: resolveApiHost(session)
157
+ };
158
+ }
159
+
160
+ //#endregion
161
+ export { memoryStore as _, resolveApiHost as a, useStores as b, writePendingLogin as c, createCommandOutput as d, formatJson as f, emptyStore as g, cache as h, removeSession as i, writeSession as l, stripAnsi as m, readSession as n, serializeSession as o, writeJson as p, removePendingLogin as r, sessionOrgName as s, readPendingLogin as t, blocks as u, readJson as v, state as y };