@superwall/cli 2.3.0 → 2.4.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 (76) hide show
  1. package/README.md +10 -0
  2. package/dist/{apple-D79LBw5E.js → apple-Bx_fm5M-.js} +14 -14
  3. package/dist/{assets-Diivv88t.js → assets-W5yvyf0V.js} +3 -3
  4. package/dist/auth.js +3 -3
  5. package/dist/{billing-CCuMv6mh.js → billing-C4lXR0xG.js} +3 -3
  6. package/dist/{bind-CVRlFlRo.js → bind-82oTpHZ3.js} +4 -4
  7. package/dist/{build-BCq0cGh-.js → build-7_8cBgBm.js} +8 -8
  8. package/dist/{client-CYtQvWJR.js → client-ltxxHuxn.js} +3 -3
  9. package/dist/{config-BO1Y87kV.js → config-CGcG7GOt.js} +9 -1
  10. package/dist/create-CBCDWuyo.js +19 -0
  11. package/dist/{create-BZyUW60x.js → create-DEyveHS6.js} +29 -29
  12. package/dist/{create-BaP6hoQ1.js → create-Dk8U_B49.js} +6 -6
  13. package/dist/{doctor-kx01VvQX.js → doctor-Df2GwS4K.js} +6 -6
  14. package/dist/{drivers-D0818zGc.js → drivers-CTyYdBL7.js} +4 -4
  15. package/dist/entry.js +63 -28
  16. package/dist/{environment-a7W-0wg0.js → environment-djS0ik60.js} +8 -2
  17. package/dist/{existing-B7qxYiUX.js → existing-Das3PHGG.js} +2 -2
  18. package/dist/{held-CEyXc1SI.js → held-B8EFWDEc.js} +6 -6
  19. package/dist/held-BL4oizD6.js +16 -0
  20. package/dist/{integrate-RK5U0GTQ.js → integrate-Cz48dm_h.js} +23 -23
  21. package/dist/{log-NVhVe_oe.js → log-C0MDCfA2.js} +1 -1
  22. package/dist/{login-DrMLxlF4.js → login-CiK5T4w8.js} +7 -7
  23. package/dist/login-DdrOmi6m.js +16 -0
  24. package/dist/{login-NxCl2WuU.js → login-girc324T.js} +1 -1
  25. package/dist/{lookup-Dor6ch5A.js → lookup-us5vu5od.js} +3 -3
  26. package/dist/{migrate-CjSpcnNu.js → migrate-DaVwhdov.js} +27 -27
  27. package/dist/{migration-MlzZHGP-.js → migration-cS6UGeUj.js} +10 -10
  28. package/dist/{notification-url-C_QXtljc.js → notification-url-Hg42tAbW.js} +2 -2
  29. package/dist/{open-CBW0Cuog.js → open-BIuOZ9ka.js} +2 -2
  30. package/dist/{org-BJCyaL1b.js → org-BrR4HGvl.js} +2 -2
  31. package/dist/{paths-Cp_lgyWO.js → paths-CdwjySxK.js} +2 -2
  32. package/dist/{playbook-VqV7546k.js → playbook-BJ3opYIS.js} +11 -11
  33. package/dist/{promote-BSckFPwZ.js → promote-BQO-1ScY.js} +19 -19
  34. package/dist/{pull-DEumBwvc.js → pull-BhRswq6x.js} +24 -24
  35. package/dist/push-B3Onn_mL.js +24 -0
  36. package/dist/{push-D-dewDd1.js → push-CR110qRh.js} +7 -7
  37. package/dist/{registry-D6M1JxYC.js → registry-DZsWoWqH.js} +239 -130
  38. package/dist/{resources-DKn4itf3.js → resources-BMspgZO1.js} +2 -2
  39. package/dist/{run-Ccv5egCC.js → run-D4V6mq8_.js} +2 -2
  40. package/dist/{scan-Be17rMcQ.js → scan-CRexsHOE.js} +1 -1
  41. package/dist/scan-DUQjxOZf.js +4 -0
  42. package/dist/{scope-92neiQ2q.js → scope-Ct0_HoNq.js} +5 -5
  43. package/dist/{selection-C5ZY23dQ.js → selection-CgZJJ3FD.js} +2 -2
  44. package/dist/server-Cv-Ug9JF.js +24 -0
  45. package/dist/{server-DZ7L28w4.js → server-Dv1VwbNh.js} +8 -8
  46. package/dist/session-BCQuMcQ0.js +6 -0
  47. package/dist/{session-CdnUL4zt.js → session-CV0P8BjK.js} +7 -7
  48. package/dist/{session-gTuw2_8i.js → session-UiPlLFn6.js} +1 -1
  49. package/dist/{setup-esb3_a7N.js → setup-UWLhQG3M.js} +8 -8
  50. package/dist/skills/superwall-framework/SKILL.md +4 -3
  51. package/dist/skills/superwall-framework/references/onboarding-state.md +21 -14
  52. package/dist/{skills-miJDcjQ2.js → skills-CiWxt6vS.js} +15 -9
  53. package/dist/skills-DzOvse9L.js +14 -0
  54. package/dist/{source-push-NVrs53Uo.js → source-push-CX_k_yZD.js} +5 -5
  55. package/dist/{spinner-D6phP4Af.js → spinner-1uuKKZMc.js} +4 -4
  56. package/dist/{storage-BcvKhvzZ.js → storage-CrXGgIbS.js} +1 -1
  57. package/dist/storekit-B675ZNiA.js +16 -0
  58. package/dist/{storekit-Di3BkafX.js → storekit-CptdG4RJ.js} +3 -3
  59. package/dist/{telemetry-BpYXL-z3.js → telemetry-BqaPbM0k.js} +2 -2
  60. package/dist/{token-4dQOfOaK.js → token-zjjlkNDF.js} +1 -1
  61. package/dist/tools.js +125 -50
  62. package/dist/upgrade-AdyF7wXk.js +7 -0
  63. package/dist/upgrade-BBnmcyY2.js +206 -0
  64. package/package.json +2 -2
  65. package/prompts/commandments.xml +2 -0
  66. package/dist/create-DNfuZ9os.js +0 -19
  67. package/dist/held-C4BiAQ_X.js +0 -16
  68. package/dist/login-DV70XgZO.js +0 -16
  69. package/dist/push-YEPqa6hs.js +0 -24
  70. package/dist/scan-CocGVPe0.js +0 -4
  71. package/dist/server-1pOxW1GJ.js +0 -24
  72. package/dist/session-Cm0U68t3.js +0 -6
  73. package/dist/skills-B_oH2dYK.js +0 -14
  74. package/dist/storekit-D1A5VHT1.js +0 -16
  75. package/dist/upgrade-BnOq32zn.js +0 -7
  76. package/dist/upgrade-Cb6f4S_c.js +0 -117
@@ -1,5 +1,5 @@
1
- import { n as ApiUnreachableError, t as ApiError } from "./client-CYtQvWJR.js";
2
- import { o as readOpenedOrgs, p as writeOpenedOrgs } from "./config-BO1Y87kV.js";
1
+ import { n as ApiUnreachableError, t as ApiError } from "./client-ltxxHuxn.js";
2
+ import { h as writeOpenedOrgs, s as readOpenedOrgs } from "./config-CGcG7GOt.js";
3
3
 
4
4
  //#region src/core/api/orgs.ts
5
5
  async function listOrganizations(api) {
@@ -1,5 +1,5 @@
1
- import { c as DASHBOARD_URL } from "./environment-a7W-0wg0.js";
2
- import { i as packagedDir } from "./paths-Cp_lgyWO.js";
1
+ import { u as DASHBOARD_URL } from "./environment-djS0ik60.js";
2
+ import { i as packagedDir } from "./paths-CdwjySxK.js";
3
3
  import { spawn } from "node:child_process";
4
4
  import { readFileSync } from "node:fs";
5
5
  import { join } from "node:path";
@@ -1,4 +1,4 @@
1
- import { f as Integration } from "./environment-a7W-0wg0.js";
1
+ import { m as Integration } from "./environment-djS0ik60.js";
2
2
  import { existsSync, readFileSync } from "node:fs";
3
3
  import { basename, dirname, join, relative, sep } from "node:path";
4
4
  import fg from "fast-glob";
@@ -0,0 +1,4 @@
1
+ import "./environment-djS0ik60.js";
2
+ import { t as scanProject } from "./scan-CRexsHOE.js";
3
+
4
+ export { scanProject };
@@ -1,8 +1,8 @@
1
- import { n as readDefaultApp, u as writeDefaultApp } from "./config-BO1Y87kV.js";
2
- import { t as apiCall, u as currentHost } from "./spinner-D6phP4Af.js";
3
- import { F as orgIdOf, L as organizationOf, N as listOrgGroups, l as findPaywall, m as listProjects, y as platformLabel } from "./resources-DKn4itf3.js";
4
- import { t as chooseOrgOfApps } from "./org-BJCyaL1b.js";
5
- import { n as findApplication, r as findProject, t as appNotFound } from "./lookup-Dor6ch5A.js";
1
+ import { f as writeDefaultApp, r as readDefaultApp } from "./config-CGcG7GOt.js";
2
+ import { t as apiCall, u as currentHost } from "./spinner-1uuKKZMc.js";
3
+ import { F as orgIdOf, L as organizationOf, N as listOrgGroups, l as findPaywall, m as listProjects, y as platformLabel } from "./resources-BMspgZO1.js";
4
+ import { t as chooseOrgOfApps } from "./org-BrR4HGvl.js";
5
+ import { n as findApplication, r as findProject, t as appNotFound } from "./lookup-us5vu5od.js";
6
6
 
7
7
  //#region src/core/account/scope.ts
8
8
  function moveFirst(items, match) {
@@ -1,11 +1,11 @@
1
- import { n as billingPlanOf } from "./resources-DKn4itf3.js";
1
+ import { n as billingPlanOf } from "./resources-BMspgZO1.js";
2
2
  import { createRequire } from "node:module";
3
3
  import * as fs from "node:fs";
4
4
  import { globSync, readFileSync, statSync } from "node:fs";
5
5
  import * as path from "node:path";
6
6
  import { join, resolve } from "node:path";
7
- import pc from "picocolors";
8
7
  import { pathToFileURL } from "node:url";
8
+ import pc from "picocolors";
9
9
 
10
10
  //#region src/core/paywalls/project/framework.ts
11
11
  var FrameworkNotFoundError = class extends Error {
@@ -0,0 +1,24 @@
1
+ import "./token-zjjlkNDF.js";
2
+ import "./output-Ggzq5_-t.js";
3
+ import "./environment-djS0ik60.js";
4
+ import "./storage-CrXGgIbS.js";
5
+ import "./client-ltxxHuxn.js";
6
+ import "./config-CGcG7GOt.js";
7
+ import "./telemetry-BqaPbM0k.js";
8
+ import "./spawn-DmmmHIP-.js";
9
+ import "./spinner-1uuKKZMc.js";
10
+ import "./ui-D_qf3Gvw.js";
11
+ import "./scan-CRexsHOE.js";
12
+ import "./paths-CdwjySxK.js";
13
+ import "./resources-BMspgZO1.js";
14
+ import "./lookup-us5vu5od.js";
15
+ import "./login-CiK5T4w8.js";
16
+ import "./skills-CiWxt6vS.js";
17
+ import "./assets-W5yvyf0V.js";
18
+ import "./selection-CgZJJ3FD.js";
19
+ import "./session-CV0P8BjK.js";
20
+ import "./source-push-CX_k_yZD.js";
21
+ import "./login-girc324T.js";
22
+ import { t as runStudio } from "./server-Dv1VwbNh.js";
23
+
24
+ export { runStudio };
@@ -1,12 +1,12 @@
1
- import { v as VERSION } from "./environment-a7W-0wg0.js";
2
- import { t as ApiError } from "./client-CYtQvWJR.js";
1
+ import { b as VERSION } from "./environment-djS0ik60.js";
2
+ import { t as ApiError } from "./client-ltxxHuxn.js";
3
3
  import { n as ui } from "./ui-D_qf3Gvw.js";
4
- import { C as pushPaywallVersion, D as versionProducts, p as listApplications, x as promotePaywallVersion } from "./resources-DKn4itf3.js";
5
- import { o as openBrowser } from "./login-DrMLxlF4.js";
6
- import { n as requireAssets, r as syncAssets, t as assetBaseUrl } from "./assets-Diivv88t.js";
7
- import { R as frameworkVersion, b as writeProjectTypes, i as requireProject, k as readLock, o as resolveProjectDirs, u as LAYOUT_HINT, y as collectProjectDeclarations, z as resolveFramework } from "./selection-C5ZY23dQ.js";
8
- import { d as writeProjectScaffold, h as wantedPlatforms, l as collectSourceFiles, n as requireApi, p as planTargets, v as resolveApps } from "./session-CdnUL4zt.js";
9
- import { i as listApplicationCatalogue, l as resolveBinding, n as pushSource, o as listProjectProducts, r as warnNotPortable, s as projectForApplication } from "./source-push-NVrs53Uo.js";
4
+ import { C as pushPaywallVersion, D as versionProducts, p as listApplications, x as promotePaywallVersion } from "./resources-BMspgZO1.js";
5
+ import { o as openBrowser } from "./login-CiK5T4w8.js";
6
+ import { n as requireAssets, r as syncAssets, t as assetBaseUrl } from "./assets-W5yvyf0V.js";
7
+ import { R as frameworkVersion, b as writeProjectTypes, i as requireProject, k as readLock, o as resolveProjectDirs, u as LAYOUT_HINT, y as collectProjectDeclarations, z as resolveFramework } from "./selection-CgZJJ3FD.js";
8
+ import { d as writeProjectScaffold, h as wantedPlatforms, l as collectSourceFiles, n as requireApi, p as planTargets, v as resolveApps } from "./session-CV0P8BjK.js";
9
+ import { i as listApplicationCatalogue, l as resolveBinding, n as pushSource, o as listProjectProducts, r as warnNotPortable, s as projectForApplication } from "./source-push-CX_k_yZD.js";
10
10
  import { execFile } from "node:child_process";
11
11
  import * as fs from "node:fs";
12
12
  import * as path from "node:path";
@@ -0,0 +1,6 @@
1
+ import "./output-Ggzq5_-t.js";
2
+ import "./environment-djS0ik60.js";
3
+ import "./storage-CrXGgIbS.js";
4
+ import { n as runWhoami, t as runLogout } from "./session-UiPlLFn6.js";
5
+
6
+ export { runLogout, runWhoami };
@@ -1,15 +1,15 @@
1
- import { l as ENV_API_KEY, t as API_HOST, y as apiKeyFromEnv } from "./environment-a7W-0wg0.js";
2
- import { n as readSession } from "./storage-BcvKhvzZ.js";
3
- import { r as createSuperwallApi } from "./client-CYtQvWJR.js";
1
+ import { d as ENV_API_KEY, t as API_HOST, x as apiKeyFromEnv } from "./environment-djS0ik60.js";
2
+ import { n as readSession } from "./storage-CrXGgIbS.js";
3
+ import { r as createSuperwallApi } from "./client-ltxxHuxn.js";
4
4
  import { n as ui } from "./ui-D_qf3Gvw.js";
5
- import { k as isRecord, p as listApplications, y as platformLabel } from "./resources-DKn4itf3.js";
6
- import { C as formatLock, D as parseLock, E as originKey, L as writeSources, O as parseSources, j as writeApp, k as readLock, v as TYPES_FILE, w as formatSharedLock, x as NewerLockError } from "./selection-C5ZY23dQ.js";
7
- import { n as performLoginWithUi } from "./login-NxCl2WuU.js";
5
+ import { k as isRecord, p as listApplications, y as platformLabel } from "./resources-BMspgZO1.js";
6
+ import { C as formatLock, D as parseLock, E as originKey, L as writeSources, O as parseSources, j as writeApp, k as readLock, v as TYPES_FILE, w as formatSharedLock, x as NewerLockError } from "./selection-CgZJJ3FD.js";
7
+ import { n as performLoginWithUi } from "./login-girc324T.js";
8
8
  import { execFile } from "node:child_process";
9
9
  import * as fs from "node:fs";
10
+ import * as os$1 from "node:os";
10
11
  import * as path from "node:path";
11
12
  import { promisify } from "node:util";
12
- import * as os$1 from "node:os";
13
13
  import fg from "fast-glob";
14
14
 
15
15
  //#region src/core/paywalls/binding/apps.ts
@@ -1,4 +1,4 @@
1
- import { a as resolveApiHost, i as removeSession, n as readSession, o as serializeSession, s as sessionOrgName } from "./storage-BcvKhvzZ.js";
1
+ import { a as resolveApiHost, i as removeSession, n as readSession, o as serializeSession, s as sessionOrgName } from "./storage-CrXGgIbS.js";
2
2
 
3
3
  //#region src/core/account/session.ts
4
4
  function runWhoami(ctx) {
@@ -1,11 +1,11 @@
1
- import { i as readPackageJson, r as allDeps, t as scanProject } from "./scan-Be17rMcQ.js";
2
- import { t as detectExisting } from "./existing-B7qxYiUX.js";
3
- import { m as listProjects, p as listApplications, r as createApplication, y as platformLabel } from "./resources-DKn4itf3.js";
4
- import { n as findApplication } from "./lookup-Dor6ch5A.js";
5
- import { r as resolveScopeFromKey } from "./bind-CVRlFlRo.js";
6
- import { j as writeApp } from "./selection-C5ZY23dQ.js";
7
- import { _ as requirePlatform, n as requireApi, r as gitAvailable, u as projectPackageName } from "./session-CdnUL4zt.js";
8
- import { r as isSuperwallProject } from "./migration-MlzZHGP-.js";
1
+ import { i as readPackageJson, r as allDeps, t as scanProject } from "./scan-CRexsHOE.js";
2
+ import { t as detectExisting } from "./existing-Das3PHGG.js";
3
+ import { m as listProjects, p as listApplications, r as createApplication, y as platformLabel } from "./resources-BMspgZO1.js";
4
+ import { n as findApplication } from "./lookup-us5vu5od.js";
5
+ import { r as resolveScopeFromKey } from "./bind-82oTpHZ3.js";
6
+ import { j as writeApp } from "./selection-CgZJJ3FD.js";
7
+ import { _ as requirePlatform, n as requireApi, r as gitAvailable, u as projectPackageName } from "./session-CV0P8BjK.js";
8
+ import { r as isSuperwallProject } from "./migration-cS6UGeUj.js";
9
9
  import { execFile } from "node:child_process";
10
10
  import * as fs from "node:fs";
11
11
  import * as path from "node:path";
@@ -236,8 +236,9 @@ Docs beyond the framework (dashboard, SDKs, web checkout setup):
236
236
  the buttons push what it returns, and `app/layout.tsx` exports `entry`,
237
237
  which replays it with `replayStack` (every answered page, then the first
238
238
  unanswered one, down the branch the user actually took). `entry` runs
239
- once with the host's attributes already in, so that page is the first
240
- thing that paints. Never keep answers only in React state, a module or
239
+ with the host's attributes already in, so that page is the first thing
240
+ that paints, and runs again each time the paywall closes, so a reopened
241
+ paywall resumes from the saved answers too. Never keep answers only in React state, a module or
241
242
  `layout.tsx` (they die with the paywall), and never store the step or
242
243
  page index: store the answers. Keys are stable snake_case meant to be
243
244
  queried (`onboarding_goal`), values are enum ids read through
@@ -255,7 +256,7 @@ Docs beyond the framework (dashboard, SDKs, web checkout setup):
255
256
  const to = next("goal", { ...user, onboarding_goal: value });
256
257
  if (to) router.push(to);
257
258
  };
258
- // app/layout.tsx: the stack to open on, replayed once from the attributes
259
+ // app/layout.tsx: the stack to open on, replayed from the attributes
259
260
  export const entry: Entry = ({ user }) =>
260
261
  replayStack("index", (route) => next(route, user), (route) => answered(route, user));
261
262
  ```
@@ -26,10 +26,11 @@ page one. The `onboarding-quiz` example is the reference implementation.
26
26
  5. **Resume with `entry` and `replayStack`.** `app/layout.tsx` exports
27
27
  `entry`, which returns `replayStack(start, next, answered)`: the stack
28
28
  the user would have built by tapping through, walking `next` from the
29
- first screen while each page is answered. The framework calls it once,
30
- after the host has sent its state and before the first render, and opens
31
- on that stack: the resumed page is the first thing that paints, nothing
32
- animates, and nothing outside the stack mounts. Back walks down the
29
+ first screen while each page is answered. The framework calls it after
30
+ the host has sent its state and before the first render, and again each
31
+ time the paywall closes, and opens on that stack: the resumed page is the
32
+ first thing that paints, nothing animates, and nothing outside the stack
33
+ mounts. Back walks down the
33
34
  branch the user actually took, with the normal transitions, and "Start
34
35
  over" works.
35
36
  6. **A question page shows its saved answer as selected** (the hook's
@@ -159,13 +160,16 @@ Why each piece is there:
159
160
  - **The answers are there when `entry` runs.** Under a host a flow with
160
161
  `entry` renders nothing until the host's first state (user attributes, device,
161
162
  products) has arrived, with a three-second fallback for a host that never
162
- answers, and `entry` runs after that wait, once. It gets `{ user, device,
163
+ answers, and `entry` runs after that wait. It gets `{ user, device,
163
164
  params }`; it is not a component, so it takes them as arguments rather
164
165
  than calling hooks.
165
166
  - **It opens on the stack; it does not navigate to it.** The resumed page is
166
167
  the first frame, with no transition, and only the routes in the stack
167
168
  mount. Going back from it animates like any other back. One `page_view`
168
- (`entry`) is reported, for the top of the stack.
169
+ (`entry`) is reported, for the top of the stack. In an SDK host it goes
170
+ out on `paywall_open`, not on mount, and again on every re-presentation;
171
+ no page views are sent while the paywall is closed. Outside a host (a web
172
+ funnel, the teleport page) it goes out at once.
169
173
  - **The whole stack, not only the target.** `["level"]` alone would leave
170
174
  back with nowhere to go and make "Start over" (`router.dismissAll()`) land
171
175
  on the resumed question instead of the start.
@@ -194,16 +198,19 @@ Why each piece is there:
194
198
  - **Order of events.** The SDK loads the paywall into its webview, often
195
199
  long before it is shown (it preloads at start-up). The paywall pings, the
196
200
  host answers with its state, a flow with `entry` renders nothing until then (or
197
- three seconds, if the host never answers), `entry` runs once, and its stack
201
+ three seconds, if the host never answers), `entry` runs, and its stack
198
202
  is the first frame. A flow without `entry` never waits. On iOS the SDK
199
203
  reveals the webview only after the state is sent, so the wait is unseen.
200
- - **Once per load, not per presentation.** The iOS SDK keeps a loaded
201
- paywall with its pages, so closing on question four and reopening in the
202
- same session lands on question four with no `entry` call. The next load
203
- (a relaunch, a paywall refresh) decides again from the saved attributes.
204
- Attributes the app sets after the paywall loaded are not seen by
205
- `entry`; a decision that depends on them goes in the page, where
206
- `useUserAttribute` re-renders.
204
+ The `entry` page view waits for `paywall_open`, when the paywall is
205
+ actually shown.
206
+ - **Again on every close.** The SDK keeps a loaded paywall between
207
+ presentations, and on `paywall_close` the router resets to the entry
208
+ stack: a `?sw_nav=` stack if the URL has one, otherwise `entry` runs again
209
+ against the current user attributes. Closing on question four and
210
+ reopening resumes from the saved answers through `replayStack`, and
211
+ attributes the app set after the load are seen at the next presentation.
212
+ A decision that depends on attributes set while the paywall is open still
213
+ goes in the page, where `useUserAttribute` re-renders.
207
214
  - **Pure, and pages only.** StrictMode in development may call it twice. No
208
215
  attribute writes, `fetch` or analytics in it; work that should happen
209
216
  when a flow opens goes in an effect in `layout.tsx`.
@@ -1,13 +1,13 @@
1
- import { a as CHANNEL, o as CHANNELS, v as VERSION } from "./environment-a7W-0wg0.js";
2
- import { m as writeSkillsSync, s as readSkillsSync } from "./config-BO1Y87kV.js";
3
- import { r as track } from "./telemetry-BpYXL-z3.js";
1
+ import { b as VERSION, c as CHANNELS, s as CHANNEL } from "./environment-djS0ik60.js";
2
+ import { c as readSkillsSync, g as writeSkillsSync } from "./config-CGcG7GOt.js";
3
+ import { r as track } from "./telemetry-BqaPbM0k.js";
4
4
  import { r as spawnStream } from "./spawn-DmmmHIP-.js";
5
- import { n as withSpinner } from "./spinner-D6phP4Af.js";
5
+ import { n as withSpinner } from "./spinner-1uuKKZMc.js";
6
6
  import { n as ui } from "./ui-D_qf3Gvw.js";
7
- import { i as packagedDir, t as AGENT_SKILLS_DIR } from "./paths-Cp_lgyWO.js";
7
+ import { i as packagedDir, t as AGENT_SKILLS_DIR } from "./paths-CdwjySxK.js";
8
8
  import { existsSync, mkdtempSync, readFileSync, readdirSync, rmSync, writeFileSync } from "node:fs";
9
- import { join } from "node:path";
10
9
  import { tmpdir } from "node:os";
10
+ import { join } from "node:path";
11
11
 
12
12
  //#region src/core/support/skills.ts
13
13
  const SUPERWALL_SKILLS_SOURCE = "superwall/skills";
@@ -256,11 +256,11 @@ async function selectSourceSha() {
256
256
  return null;
257
257
  }
258
258
  }
259
- async function skillsOutOfDate() {
259
+ async function skillsOutOfDate(verify = false) {
260
260
  const sync = readSkillsSync();
261
261
  const check = checkSkillsSync(sync, VERSION, SKILLS_REF(), Date.now());
262
262
  if (!sync || check === "stale") return true;
263
- if (check === "fresh") return false;
263
+ if (check === "fresh" && !verify) return false;
264
264
  const head = await selectSourceSha();
265
265
  if (!head) return false;
266
266
  if (head !== sync.sourceSha) return true;
@@ -292,6 +292,7 @@ async function syncSkills(opts = {}) {
292
292
  }
293
293
  return {
294
294
  ok,
295
+ current: pub.ok,
295
296
  commands: [bundled.command, pub.command]
296
297
  };
297
298
  }
@@ -303,6 +304,11 @@ async function ensureSkillsCurrent(required = false, trigger = "workflow") {
303
304
  spin.stop(ok ? required ? "Superwall skills installed" : "Superwall skills up to date" : "Skill install skipped");
304
305
  if (required && !ok) throw new Error("The integration completed, but the Superwall skills could not be installed.");
305
306
  }
307
+ async function updateSkills() {
308
+ if (!await skillsOutOfDate(true)) return "current";
309
+ const { ok, current } = await syncSkills({ trigger: "upgrade" });
310
+ return ok && current ? "updated" : "failed";
311
+ }
306
312
  async function runSkills(ctx, { flags }) {
307
313
  ui.intro("Superwall agent skills");
308
314
  const named = flags.skill.filter(Boolean);
@@ -348,4 +354,4 @@ async function runSkills(ctx, { flags }) {
348
354
  }
349
355
 
350
356
  //#endregion
351
- export { bundledSkills as a, knownSkills as c, readBundledSkill as d, runSkills as f, 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 };
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 };
@@ -0,0 +1,14 @@
1
+ import "./token-zjjlkNDF.js";
2
+ import "./output-Ggzq5_-t.js";
3
+ import "./environment-djS0ik60.js";
4
+ import "./storage-CrXGgIbS.js";
5
+ import "./client-ltxxHuxn.js";
6
+ import "./config-CGcG7GOt.js";
7
+ import "./telemetry-BqaPbM0k.js";
8
+ import "./spawn-DmmmHIP-.js";
9
+ import "./spinner-1uuKKZMc.js";
10
+ import "./ui-D_qf3Gvw.js";
11
+ import "./paths-CdwjySxK.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-CiWxt6vS.js";
13
+
14
+ export { PLAYBOOKS, SKILLS_INSTALL_SOURCE, SKILLS_REF, SUPERWALL_SKILLS_SOURCE, bundledSkills, checkSkillsSync, ensureSkillsCurrent, knownSkills, normalizeSkillFrontmatter, normalizeSkillsDir, readBundledSkill, runSkills, skillSummary, skillsRefFor, updateSkills };
@@ -1,9 +1,9 @@
1
- import { n as ApiUnreachableError, t as ApiError } from "./client-CYtQvWJR.js";
1
+ import { n as ApiUnreachableError, t as ApiError } from "./client-ltxxHuxn.js";
2
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-DKn4itf3.js";
4
- import { n as findApplication } from "./lookup-Dor6ch5A.js";
5
- import { M as writeBinding, k as readLock } from "./selection-C5ZY23dQ.js";
6
- import { a as pushSourceTree, c as writeSourceBase, r as gitAvailable, s as readSourceBase } from "./session-CdnUL4zt.js";
3
+ import { d as linkSourceCommit, f as listAppPaywalls, o as createHeadlessPaywall, v as mintSourceAccess } from "./resources-BMspgZO1.js";
4
+ import { n as findApplication } from "./lookup-us5vu5od.js";
5
+ import { M as writeBinding, k as readLock } from "./selection-CgZJJ3FD.js";
6
+ import { a as pushSourceTree, c as writeSourceBase, r as gitAvailable, s as readSourceBase } from "./session-CV0P8BjK.js";
7
7
  import { setTimeout } from "node:timers/promises";
8
8
  import { productVariables } from "@superwall/studio/products";
9
9
 
@@ -1,7 +1,7 @@
1
- import { r as NotLoggedInError } from "./token-4dQOfOaK.js";
1
+ import { r as NotLoggedInError } from "./token-zjjlkNDF.js";
2
2
  import { i as writeJson, n as createCommandOutput } from "./output-Ggzq5_-t.js";
3
- import { a as CHANNEL } from "./environment-a7W-0wg0.js";
4
- import { t as ApiError } from "./client-CYtQvWJR.js";
3
+ import { s as CHANNEL } from "./environment-djS0ik60.js";
4
+ import { t as ApiError } from "./client-ltxxHuxn.js";
5
5
  import { n as ui, r as useRenderer } from "./ui-D_qf3Gvw.js";
6
6
  import pc from "picocolors";
7
7
 
@@ -100,7 +100,7 @@ async function runLifecycle(description, input, runtime, work) {
100
100
  offInterrupt?.();
101
101
  if (outputMode === "rich" && host.waitForPaint) await new Promise((done) => setTimeout(done, 50));
102
102
  ui$1.stop();
103
- host.finishing(stdout, outputMode, description.name);
103
+ host.finishing(stdout, outputMode, description.name, input.update !== false);
104
104
  }
105
105
  }
106
106
  function resolveApi(policy, factory) {
@@ -1,5 +1,5 @@
1
1
  import { l as readJson, r as formatJson, u as state } from "./output-Ggzq5_-t.js";
2
- import { n as API_HOST_OVERRIDE, t as API_HOST } from "./environment-a7W-0wg0.js";
2
+ import { n as API_HOST_OVERRIDE, t as API_HOST } from "./environment-djS0ik60.js";
3
3
 
4
4
  //#region src/core/account/storage.ts
5
5
  const sessionOrgName = (session) => {
@@ -0,0 +1,16 @@
1
+ import "./token-zjjlkNDF.js";
2
+ import "./output-Ggzq5_-t.js";
3
+ import "./environment-djS0ik60.js";
4
+ import "./storage-CrXGgIbS.js";
5
+ import "./client-ltxxHuxn.js";
6
+ import "./config-CGcG7GOt.js";
7
+ import "./spinner-1uuKKZMc.js";
8
+ import "./ui-D_qf3Gvw.js";
9
+ import "./resources-BMspgZO1.js";
10
+ import "./org-BrR4HGvl.js";
11
+ import "./lookup-us5vu5od.js";
12
+ import "./scope-Ct0_HoNq.js";
13
+ import "./input-vi0bou04.js";
14
+ import { n as writeStoreKit, t as generateStoreKit } from "./storekit-CptdG4RJ.js";
15
+
16
+ export { generateStoreKit, writeStoreKit };
@@ -1,7 +1,7 @@
1
1
  import { r as formatJson } from "./output-Ggzq5_-t.js";
2
- import { t as apiCall } from "./spinner-D6phP4Af.js";
3
- import { h as listResource } from "./resources-DKn4itf3.js";
4
- import { a as pickScope } from "./scope-92neiQ2q.js";
2
+ import { t as apiCall } from "./spinner-1uuKKZMc.js";
3
+ import { h as listResource } from "./resources-BMspgZO1.js";
4
+ import { a as pickScope } from "./scope-Ct0_HoNq.js";
5
5
  import { r as textOf } from "./input-vi0bou04.js";
6
6
  import { writeFileSync } from "node:fs";
7
7
 
@@ -1,5 +1,5 @@
1
- import { S as isNonInteractive, g as TELEMETRY_KEY, h as TELEMETRY_HOST, v as VERSION } from "./environment-a7W-0wg0.js";
2
- import { h as writeTelemetryNoticeShown, l as telemetryNoticeShown, t as readAnonymousId } from "./config-BO1Y87kV.js";
1
+ import { _ as TELEMETRY_HOST, b as VERSION, v as TELEMETRY_KEY, w as isNonInteractive } from "./environment-djS0ik60.js";
2
+ import { _ as writeTelemetryNoticeShown, t as readAnonymousId, u as telemetryNoticeShown } from "./config-CGcG7GOt.js";
3
3
 
4
4
  //#region src/core/support/telemetry.ts
5
5
  const tags = {};
@@ -1,4 +1,4 @@
1
- import { l as writeSession, n as readSession } from "./storage-BcvKhvzZ.js";
1
+ import { l as writeSession, n as readSession } from "./storage-CrXGgIbS.js";
2
2
 
3
3
  //#region src/core/account/errors.ts
4
4
  var NotLoggedInError = class extends Error {