@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.
- package/README.md +10 -0
- package/dist/{apple-D79LBw5E.js → apple-Bx_fm5M-.js} +14 -14
- package/dist/{assets-Diivv88t.js → assets-W5yvyf0V.js} +3 -3
- package/dist/auth.js +3 -3
- package/dist/{billing-CCuMv6mh.js → billing-C4lXR0xG.js} +3 -3
- package/dist/{bind-CVRlFlRo.js → bind-82oTpHZ3.js} +4 -4
- package/dist/{build-BCq0cGh-.js → build-7_8cBgBm.js} +8 -8
- package/dist/{client-CYtQvWJR.js → client-ltxxHuxn.js} +3 -3
- package/dist/{config-BO1Y87kV.js → config-CGcG7GOt.js} +9 -1
- package/dist/create-CBCDWuyo.js +19 -0
- package/dist/{create-BZyUW60x.js → create-DEyveHS6.js} +29 -29
- package/dist/{create-BaP6hoQ1.js → create-Dk8U_B49.js} +6 -6
- package/dist/{doctor-kx01VvQX.js → doctor-Df2GwS4K.js} +6 -6
- package/dist/{drivers-D0818zGc.js → drivers-CTyYdBL7.js} +4 -4
- package/dist/entry.js +63 -28
- package/dist/{environment-a7W-0wg0.js → environment-djS0ik60.js} +8 -2
- package/dist/{existing-B7qxYiUX.js → existing-Das3PHGG.js} +2 -2
- package/dist/{held-CEyXc1SI.js → held-B8EFWDEc.js} +6 -6
- package/dist/held-BL4oizD6.js +16 -0
- package/dist/{integrate-RK5U0GTQ.js → integrate-Cz48dm_h.js} +23 -23
- package/dist/{log-NVhVe_oe.js → log-C0MDCfA2.js} +1 -1
- package/dist/{login-DrMLxlF4.js → login-CiK5T4w8.js} +7 -7
- package/dist/login-DdrOmi6m.js +16 -0
- package/dist/{login-NxCl2WuU.js → login-girc324T.js} +1 -1
- package/dist/{lookup-Dor6ch5A.js → lookup-us5vu5od.js} +3 -3
- package/dist/{migrate-CjSpcnNu.js → migrate-DaVwhdov.js} +27 -27
- package/dist/{migration-MlzZHGP-.js → migration-cS6UGeUj.js} +10 -10
- package/dist/{notification-url-C_QXtljc.js → notification-url-Hg42tAbW.js} +2 -2
- package/dist/{open-CBW0Cuog.js → open-BIuOZ9ka.js} +2 -2
- package/dist/{org-BJCyaL1b.js → org-BrR4HGvl.js} +2 -2
- package/dist/{paths-Cp_lgyWO.js → paths-CdwjySxK.js} +2 -2
- package/dist/{playbook-VqV7546k.js → playbook-BJ3opYIS.js} +11 -11
- package/dist/{promote-BSckFPwZ.js → promote-BQO-1ScY.js} +19 -19
- package/dist/{pull-DEumBwvc.js → pull-BhRswq6x.js} +24 -24
- package/dist/push-B3Onn_mL.js +24 -0
- package/dist/{push-D-dewDd1.js → push-CR110qRh.js} +7 -7
- package/dist/{registry-D6M1JxYC.js → registry-DZsWoWqH.js} +239 -130
- package/dist/{resources-DKn4itf3.js → resources-BMspgZO1.js} +2 -2
- package/dist/{run-Ccv5egCC.js → run-D4V6mq8_.js} +2 -2
- package/dist/{scan-Be17rMcQ.js → scan-CRexsHOE.js} +1 -1
- package/dist/scan-DUQjxOZf.js +4 -0
- package/dist/{scope-92neiQ2q.js → scope-Ct0_HoNq.js} +5 -5
- package/dist/{selection-C5ZY23dQ.js → selection-CgZJJ3FD.js} +2 -2
- package/dist/server-Cv-Ug9JF.js +24 -0
- package/dist/{server-DZ7L28w4.js → server-Dv1VwbNh.js} +8 -8
- package/dist/session-BCQuMcQ0.js +6 -0
- package/dist/{session-CdnUL4zt.js → session-CV0P8BjK.js} +7 -7
- package/dist/{session-gTuw2_8i.js → session-UiPlLFn6.js} +1 -1
- package/dist/{setup-esb3_a7N.js → setup-UWLhQG3M.js} +8 -8
- package/dist/skills/superwall-framework/SKILL.md +4 -3
- package/dist/skills/superwall-framework/references/onboarding-state.md +21 -14
- package/dist/{skills-miJDcjQ2.js → skills-CiWxt6vS.js} +15 -9
- package/dist/skills-DzOvse9L.js +14 -0
- package/dist/{source-push-NVrs53Uo.js → source-push-CX_k_yZD.js} +5 -5
- package/dist/{spinner-D6phP4Af.js → spinner-1uuKKZMc.js} +4 -4
- package/dist/{storage-BcvKhvzZ.js → storage-CrXGgIbS.js} +1 -1
- package/dist/storekit-B675ZNiA.js +16 -0
- package/dist/{storekit-Di3BkafX.js → storekit-CptdG4RJ.js} +3 -3
- package/dist/{telemetry-BpYXL-z3.js → telemetry-BqaPbM0k.js} +2 -2
- package/dist/{token-4dQOfOaK.js → token-zjjlkNDF.js} +1 -1
- package/dist/tools.js +125 -50
- package/dist/upgrade-AdyF7wXk.js +7 -0
- package/dist/upgrade-BBnmcyY2.js +206 -0
- package/package.json +2 -2
- package/prompts/commandments.xml +2 -0
- package/dist/create-DNfuZ9os.js +0 -19
- package/dist/held-C4BiAQ_X.js +0 -16
- package/dist/login-DV70XgZO.js +0 -16
- package/dist/push-YEPqa6hs.js +0 -24
- package/dist/scan-CocGVPe0.js +0 -4
- package/dist/server-1pOxW1GJ.js +0 -24
- package/dist/session-Cm0U68t3.js +0 -6
- package/dist/skills-B_oH2dYK.js +0 -14
- package/dist/storekit-D1A5VHT1.js +0 -16
- package/dist/upgrade-BnOq32zn.js +0 -7
- package/dist/upgrade-Cb6f4S_c.js +0 -117
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { n as ApiUnreachableError, t as ApiError } from "./client-
|
|
2
|
-
import {
|
|
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 {
|
|
2
|
-
import { i as packagedDir } from "./paths-
|
|
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 {
|
|
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";
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { t as apiCall, u as currentHost } from "./spinner-
|
|
3
|
-
import { F as orgIdOf, L as organizationOf, N as listOrgGroups, l as findPaywall, m as listProjects, y as platformLabel } from "./resources-
|
|
4
|
-
import { t as chooseOrgOfApps } from "./org-
|
|
5
|
-
import { n as findApplication, r as findProject, t as appNotFound } from "./lookup-
|
|
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-
|
|
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 {
|
|
2
|
-
import { t as ApiError } from "./client-
|
|
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-
|
|
5
|
-
import { o as openBrowser } from "./login-
|
|
6
|
-
import { n as requireAssets, r as syncAssets, t as assetBaseUrl } from "./assets-
|
|
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-
|
|
8
|
-
import { d as writeProjectScaffold, h as wantedPlatforms, l as collectSourceFiles, n as requireApi, p as planTargets, v as resolveApps } from "./session-
|
|
9
|
-
import { i as listApplicationCatalogue, l as resolveBinding, n as pushSource, o as listProjectProducts, r as warnNotPortable, s as projectForApplication } from "./source-push-
|
|
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";
|
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { n as readSession } from "./storage-
|
|
3
|
-
import { r as createSuperwallApi } from "./client-
|
|
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-
|
|
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-
|
|
7
|
-
import { n as performLoginWithUi } from "./login-
|
|
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-
|
|
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-
|
|
2
|
-
import { t as detectExisting } from "./existing-
|
|
3
|
-
import { m as listProjects, p as listApplications, r as createApplication, y as platformLabel } from "./resources-
|
|
4
|
-
import { n as findApplication } from "./lookup-
|
|
5
|
-
import { r as resolveScopeFromKey } from "./bind-
|
|
6
|
-
import { j as writeApp } from "./selection-
|
|
7
|
-
import { _ as requirePlatform, n as requireApi, r as gitAvailable, u as projectPackageName } from "./session-
|
|
8
|
-
import { r as isSuperwallProject } from "./migration-
|
|
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
|
-
|
|
240
|
-
|
|
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
|
|
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
|
|
30
|
-
|
|
31
|
-
on that stack: the resumed page is the
|
|
32
|
-
animates, and nothing outside the stack
|
|
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
|
|
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
|
|
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
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
`
|
|
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 {
|
|
2
|
-
import {
|
|
3
|
-
import { r as track } from "./telemetry-
|
|
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-
|
|
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-
|
|
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-
|
|
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-
|
|
4
|
-
import { n as findApplication } from "./lookup-
|
|
5
|
-
import { M as writeBinding, k as readLock } from "./selection-
|
|
6
|
-
import { a as pushSourceTree, c as writeSourceBase, r as gitAvailable, s as readSourceBase } from "./session-
|
|
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-
|
|
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 {
|
|
4
|
-
import { t as ApiError } from "./client-
|
|
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-
|
|
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-
|
|
3
|
-
import { h as listResource } from "./resources-
|
|
4
|
-
import { a as pickScope } from "./scope-
|
|
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 {
|
|
2
|
-
import {
|
|
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 = {};
|