@superwall/cli 2.5.1 → 2.6.0-beta.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 (97) hide show
  1. package/dist/{apple-BSKxY7Gx.js → apple-Bmt_iywx.js} +14 -14
  2. package/dist/{approve-DbwsYO4s.js → approve-D2UgqaRx.js} +27 -27
  3. package/dist/{assets-CqpFg5mM.js → assets-B_quADds.js} +3 -3
  4. package/dist/auth.js +3 -3
  5. package/dist/{session-DYdxTNZf.js → base-ChTi42M0.js} +35 -35
  6. package/dist/{billing-BopwIhR3.js → billing-ZIETn0j4.js} +3 -3
  7. package/dist/{bind-DOF3o3FR.js → bind-ClFjTt0U.js} +4 -4
  8. package/dist/{build-BF22vVdV.js → build-BWjXurjs.js} +10 -10
  9. package/dist/{client-DHlsTaP1.js → client-CyrYJzBF.js} +3 -3
  10. package/dist/create-7HDW3DCl.js +20 -0
  11. package/dist/{create-CiZzZrru.js → create-BCIgjRHn.js} +6 -6
  12. package/dist/{create-CboPfAlN.js → create-C3uklw-U.js} +31 -31
  13. package/dist/{doctor-BqZGaQE5.js → doctor-D2Q1EZe8.js} +6 -6
  14. package/dist/{drivers-DkboeR1c.js → drivers-BQkO5tHs.js} +3 -3
  15. package/dist/entry.js +20 -20
  16. package/dist/{environment-FR3bcq0D.js → environment-BocmdvZ-.js} +1 -1
  17. package/dist/{existing-C6TTT6c4.js → existing-Cl5x6_5u.js} +2 -2
  18. package/dist/{selection-CWfI4a0O.js → framework-CLmf4swr.js} +50 -50
  19. package/dist/{held-C2IjAyg6.js → held-Bykbwy-m.js} +6 -6
  20. package/dist/held-Chw3BtBV.js +17 -0
  21. package/dist/{install-DoSYCwLL.js → install-dXZZ79Oe.js} +37 -37
  22. package/dist/{integrate-BSqd2wgI.js → integrate-DiSjlOjC.js} +23 -23
  23. package/dist/{types-CB6O_wjy.js → lock-DgSx-p8Y.js} +79 -79
  24. package/dist/{login-C6FcBQZg.js → login-5sWIKDI2.js} +6 -6
  25. package/dist/login-DZ8Pipf6.js +17 -0
  26. package/dist/{login-dRPPnGr7.js → login-Jp6E6d2e.js} +1 -1
  27. package/dist/{lookup-D23dAOz6.js → lookup-CWzVfPpq.js} +3 -3
  28. package/dist/{migrate-CDdUCTH3.js → migrate-BKiOUsMY.js} +29 -29
  29. package/dist/{migration-r9plM7F6.js → migration-Z69tLeHC.js} +9 -9
  30. package/dist/{notification-url-rdnENCxt.js → notification-url-BDBxbwZq.js} +2 -2
  31. package/dist/{open-DVdE3HnK.js → open-DNd49kT-.js} +2 -2
  32. package/dist/{org-DZ41muzA.js → org-Dud1rF9f.js} +3 -3
  33. package/dist/{organization-DIODPOwO.js → organization-7vJA3uy1.js} +8 -8
  34. package/dist/{orgs-BxlwcvTu.js → orgs-Z0H9WOs1.js} +1 -1
  35. package/dist/{paths-BaeoxDze.js → paths-CzTJVpfi.js} +1 -1
  36. package/dist/{playbook-B-Pdonhg.js → playbook-DJ__edOW.js} +10 -10
  37. package/dist/{project-DHU5wc3R.js → project-NoMtbMyl.js} +9 -9
  38. package/dist/{promote-Ca4URuHY.js → promote-DLtPSvmL.js} +23 -23
  39. package/dist/{pull-CQcTZxW8.js → pull-AoUmaiMK.js} +8 -8
  40. package/dist/pull-C1xm2zqG.js +36 -0
  41. package/dist/pull-D-YuT3e0.js +106 -0
  42. package/dist/push-B42D8fKf.js +22 -0
  43. package/dist/{push-BlZoIwIj.js → push-BMblzg_6.js} +9 -9
  44. package/dist/{push-DQE48h_M.js → push-BrzMFd4Z.js} +46 -46
  45. package/dist/push-Co5jk6Kr.js +30 -0
  46. package/dist/{registry-FNG-uiIt.js → registry-DDU10_Ix.js} +152 -152
  47. package/dist/resolve-DpOSDDdr.js +196 -0
  48. package/dist/{resources-COOEvqqW.js → resources-CptT7HD6.js} +2 -2
  49. package/dist/{run-DpYDOAw-.js → run-c1O2_8pp.js} +2 -2
  50. package/dist/{run-Czbb-sHR.js → run-r3foWfhV.js} +65 -65
  51. package/dist/scan-D86kLtM7.js +4 -0
  52. package/dist/{scan-BZS2FZeU.js → scan-nVQO7JLx.js} +1 -1
  53. package/dist/{scope-t_SqFN6W.js → scope-ehZ7L1nj.js} +8 -8
  54. package/dist/{scope-BJQ-KcQg.js → scope-l1qGLsgz.js} +5 -5
  55. package/dist/{sdk-CyttTnGf.js → sdk-DEfQttek.js} +7 -7
  56. package/dist/{series--Wp7TngJ.js → series-D2ZpZ8cx.js} +95 -62
  57. package/dist/server-BEcsQaPu.js +29 -0
  58. package/dist/{server-BmmOj7bh.js → server-DLARhh1k.js} +9 -9
  59. package/dist/session-Csuaw6RU.js +6 -0
  60. package/dist/{session-BpYpOgaY.js → session-Z0BeaJPf.js} +1 -1
  61. package/dist/{setup-DW50luOZ.js → setup-C6NFy14d.js} +9 -9
  62. package/dist/skills/index.json +2 -2
  63. package/dist/skills/{superwall-workspaces → superwall-artifacts}/SKILL.md +38 -29
  64. package/dist/skills/{superwall-workspaces → superwall-artifacts}/references/cli.md +31 -28
  65. package/dist/skills/{superwall-workspaces → superwall-artifacts}/references/slots.md +9 -9
  66. package/dist/{skills-Cm1j2d1W.js → skills-421SFEyF.js} +4 -4
  67. package/dist/{skills-Bbtq8V_D.js → skills-CdKwaTRS.js} +8 -8
  68. package/dist/{git-DqDPnldI.js → source-BccdO4aL.js} +95 -95
  69. package/dist/{source-push-B3c-VLfe.js → source-push-B4s6r9bB.js} +6 -6
  70. package/dist/{spinner-025_eqCX.js → spinner-DPdBlZe2.js} +3 -3
  71. package/dist/{starter-hcwocv_Z.js → starter-0OdVPH4l.js} +27 -27
  72. package/dist/{status-K1IGp6pe.js → status-Dsc7d3z2.js} +39 -39
  73. package/dist/{storage-CUMgpcVH.js → storage-DT_wxwJ8.js} +1 -1
  74. package/dist/{storekit-Cb0TkToV.js → storekit-B9M2raxe.js} +3 -3
  75. package/dist/storekit-BWZf-fNE.js +17 -0
  76. package/dist/{telemetry-ekUQuhLJ.js → telemetry-ovPiseFm.js} +1 -1
  77. package/dist/{token-B2PduqrR.js → token-Bu3FaRkv.js} +1 -1
  78. package/dist/tools.js +123 -123
  79. package/dist/{try-BUnhITXS.js → try-B8FYkTvQ.js} +29 -29
  80. package/dist/{upgrade-CI7K1UZ-.js → upgrade-B7TmvEPP.js} +2 -2
  81. package/dist/{upgrade-DfZfDljd.js → upgrade-CAHyrWUL.js} +2 -2
  82. package/package.json +2 -2
  83. package/dist/create-DAkNdEzt.js +0 -20
  84. package/dist/held-KVcYIplR.js +0 -17
  85. package/dist/login-BiwaQkXS.js +0 -17
  86. package/dist/pull-DRMIxqR8.js +0 -36
  87. package/dist/pull-_qs90vGA.js +0 -106
  88. package/dist/push-Cb4g_l1K.js +0 -30
  89. package/dist/push-DZKsd6Dp.js +0 -22
  90. package/dist/resolve-DGePiHgL.js +0 -196
  91. package/dist/scan-2WqHGkjU.js +0 -4
  92. package/dist/server-BqLPwcy9.js +0 -29
  93. package/dist/session-BHBIGscL.js +0 -6
  94. package/dist/storekit-Dewj_5qg.js +0 -17
  95. /package/dist/{design-lint-CvgcSzVg.js → design-lint-CiFc78aM.js} +0 -0
  96. /package/dist/{download-F8OtTJze.js → download-DhGd4hOB.js} +0 -0
  97. /package/dist/{reports-BZfxvenS.js → reports-HYVp169R.js} +0 -0
@@ -1,12 +1,12 @@
1
1
  ---
2
- name: superwall-workspaces
3
- description: Build and ship a Superwall workspace, a small Cloudflare Worker that adds to the Superwall dashboard, from your own machine with the `superwall workspaces` commands (`create`, `dev`, `try`, `update`, `push`, `pull`, `status`, `logs`, `share`, `approve`, `install`, `list`, `open`). Covers `superwall.json`, slots and their context, `metric()` for a chart in Charts, `readout()` for a row in a campaign's results, `fetch` for pages, panels, tabs, widgets and actions, the host bridge, scopes, and what the builder refuses. Use when the user wants a custom dashboard page, a metric or chart one query can't express, an own statistic on a campaign's results, or a panel or action on a user's page. NOT for screens shown inside an app (paywalls, onboarding), which are `superwall-framework`. For a one-off answer or a single query, use `superwall query`.
2
+ name: superwall-artifacts
3
+ description: Build and ship a Superwall artifact, a small Cloudflare Worker that adds to the Superwall dashboard, from your own machine with the `superwall artifacts` commands (`create`, `dev`, `try`, `update`, `push`, `pull`, `status`, `logs`, `share`, `approve`, `install`, `list`, `open`). Covers `superwall.json`, slots and their context, `metric()` for a chart in Charts, `readout()` for a row in a campaign's results, `fetch` for pages, panels, tabs, widgets and actions, the host bridge, scopes, and what the builder refuses. Use when the user wants a custom dashboard page, a metric or chart one query can't express, an own statistic on a campaign's results, or a panel or action on a user's page. NOT for screens shown inside an app (paywalls, onboarding), which are `superwall-framework`. For a one-off answer or a single query, use `superwall query`.
4
4
  user-invocable: true
5
5
  ---
6
6
 
7
- # Superwall workspaces
7
+ # Superwall artifacts
8
8
 
9
- A workspace is a small Cloudflare Worker that adds to the Superwall dashboard. It holds no credential:
9
+ An artifact is a small Cloudflare Worker that adds to the Superwall dashboard. It holds no credential:
10
10
  it calls Superwall as whoever is viewing it. You can build a page, a panel, a tab, a card, an action, a
11
11
  metric in Charts or a row in a campaign's results.
12
12
 
@@ -16,12 +16,12 @@ The commands need `SUPERWALL_CHANNEL=next`, and Node 20 or later. `dev` and `try
16
16
  ## The loop
17
17
 
18
18
  ```bash
19
- superwall workspaces create my-workspace # downloads the starter and installs
20
- cd my-workspace
21
- superwall workspaces dev --app <app> # http://localhost:8790, real data, read-only
22
- superwall workspaces try transactions --app <app> # a metric on the real runtime
23
- superwall workspaces try home --org <org> # a page in the dashboard
24
- superwall workspaces push --org <org> # build it; only you see it until an admin approves it
19
+ superwall artifacts create my-artifact # downloads the starter and installs
20
+ cd my-artifact
21
+ superwall artifacts dev --app <app> # http://localhost:8790, real data, read-only
22
+ superwall artifacts try transactions --app <app> # a metric on the real runtime
23
+ superwall artifacts try home --org <org> # a page in the dashboard
24
+ superwall artifacts push --org <org> # build it; only you see it until an admin approves it
25
25
  ```
26
26
 
27
27
  1. **`dev`** bundles it the way the builder does and runs it in workerd. A local page plays the
@@ -52,8 +52,8 @@ scope it knows is missing; a draft holds only the manifest's read scopes ∩ you
52
52
  | `src/worker.ts` | The code. One default export and no other exports. |
53
53
  | `wrangler.jsonc` | `name`, `main` and `compatibility_date`. No bindings of any kind. |
54
54
  | `package-lock.json` | Required, from npm. The builder installs exactly this. |
55
- | `superwall.workspace.json` | Written by the first push: which workspace this is. Commit it, so teammates push to the same one. |
56
- | `vendor/workspace-sdk` | Generated, never edited. `superwall workspaces update` refreshes it. There is no npm package. |
55
+ | `superwall.artifact.json` | Written by the first push: which artifact this is. Commit it, so teammates push to the same one. |
56
+ | `vendor/artifact-sdk` | Generated, never edited. `superwall artifacts update` refreshes it. There is no npm package. |
57
57
 
58
58
  ## A metric
59
59
 
@@ -95,8 +95,8 @@ Ids and keys are lowercase letters, digits and dashes, starting with a letter. `
95
95
  `src/worker.ts`:
96
96
 
97
97
  ```ts
98
- import type { MetricRequest, MetricSeries } from "@superwall/workspace-sdk/metrics"
99
- import { defineWorkspace, superwallFetch } from "@superwall/workspace-sdk/server"
98
+ import type { MetricRequest, MetricSeries } from "@superwall/artifact-sdk/metrics"
99
+ import { defineArtifact, superwallFetch } from "@superwall/artifact-sdk/server"
100
100
 
101
101
  const UNITS = { hour: "HOUR", day: "DAY", week: "WEEK", month: "MONTH" }
102
102
  const dateTime = (iso: string) => iso.slice(0, 19).replace("T", " ")
@@ -159,7 +159,7 @@ const metric = async ({
159
159
  }
160
160
  }
161
161
 
162
- export default defineWorkspace({
162
+ export default defineArtifact({
163
163
  fetch: () => new Response("Not found", { status: 404 }),
164
164
  metric,
165
165
  })
@@ -192,11 +192,11 @@ No build script of yours runs. The starter's page is the worked example.
192
192
 
193
193
  ```ts
194
194
  // src/worker.ts. Browser code holds no credential, so it asks this Worker, which calls Superwall as the viewer.
195
- import client from "@superwall/workspace-sdk/client-bundle"
196
- import { clientPage, defineWorkspace, superwallFetch, type WorkspaceRequest } from "@superwall/workspace-sdk/server"
197
- import type { OrgPageContextV1 } from "@superwall/workspace-sdk/slots"
195
+ import client from "@superwall/artifact-sdk/client-bundle"
196
+ import { clientPage, defineArtifact, superwallFetch, type ArtifactRequest } from "@superwall/artifact-sdk/server"
197
+ import type { OrgPageContextV1 } from "@superwall/artifact-sdk/slots"
198
198
 
199
- const serve = ({ request, context }: WorkspaceRequest) => {
199
+ const serve = ({ request, context }: ArtifactRequest) => {
200
200
  const { pathname } = new URL(request.url)
201
201
  if (pathname === "/") return clientPage(client, { title: "Projects" })
202
202
  if (pathname === "/api/projects") {
@@ -206,13 +206,13 @@ const serve = ({ request, context }: WorkspaceRequest) => {
206
206
  return new Response("Not found", { status: 404 })
207
207
  }
208
208
 
209
- export default defineWorkspace({ client, fetch: serve })
209
+ export default defineArtifact({ client, fetch: serve })
210
210
  ```
211
211
 
212
212
  ```tsx
213
213
  // src/client.tsx
214
- import type { Theme } from "@superwall/workspace-sdk/bridge"
215
- import { connect } from "@superwall/workspace-sdk/client"
214
+ import type { Theme } from "@superwall/artifact-sdk/bridge"
215
+ import { connect } from "@superwall/artifact-sdk/client"
216
216
  import { useEffect, useState } from "react"
217
217
  import { createRoot } from "react-dom/client"
218
218
  import "./styles.css"
@@ -239,24 +239,33 @@ const Home = () => {
239
239
  createRoot(document.getElementById("root")!).render(<Home />)
240
240
  ```
241
241
 
242
- `defineWorkspace({ client })` serves the bundle at `/_client/<hash>.js` and `.css`, and `clientPage` writes the
242
+ `defineArtifact({ client })` serves the bundle at `/_client/<hash>.js` and `.css`, and `clientPage` writes the
243
243
  document that loads them, with an empty `<div id="root">`. The Worker also needs the import: with no `client` in the
244
244
  manifest, it doesn't bundle.
245
245
 
246
246
  **What the build does.** React's automatic JSX, TypeScript, CSS imports, images and fonts as data URLs, one script
247
247
  and at most one stylesheet, 8 MiB together. `dev` rebuilds on any change in the project.
248
248
 
249
+ **`@/` imports work in both.** `baseUrl` and `paths` in the root `tsconfig.json` (or `jsconfig.json` when there's
250
+ none) apply to browser code and the Worker alike:
251
+
252
+ ```json
253
+ { "compilerOptions": { "jsx": "react-jsx", "paths": { "@/*": ["./src/*"] } } }
254
+ ```
255
+
256
+ Keep them in that one file. With browser code, the build refuses `extends`, a `tsconfig.json` or `jsconfig.json` in a
257
+ subfolder that covers files it bundles, a `tsconfig` key in the wrangler config, and paths outside the repo, because
258
+ each would make the Worker and the browser resolve imports differently. `dev` and `try` refuse the same.
259
+
249
260
  **What it doesn't do yet, because no customer script runs:**
250
261
 
251
262
  - PostCSS and Tailwind's build. Run them yourself and commit the CSS they make.
252
- - `paths` from `tsconfig.json` in browser code, because the build doesn't read that file. Wrangler still honors them
253
- in the Worker, so the two differ. Use relative imports in browser code.
254
263
  - Web Workers from `new URL(...)`.
255
264
 
256
265
  **A draft can be 1 MiB at most,** so a large page works in `dev` and `push` and is refused by `try`.
257
266
 
258
267
  A page with no npm packages can skip all of this: answer HTML from `fetch` and load the bridge from
259
- `@superwall/workspace-sdk/client-script` in a `<script>`.
268
+ `@superwall/artifact-sdk/client-script` in a `<script>`.
260
269
 
261
270
  ```json
262
271
  { "id": "home", "slot": "org.page@1", "title": "Projects", "path": "/" }
@@ -268,7 +277,7 @@ over it. If you write HTML yourself, escape everything that came from the API or
268
277
 
269
278
  ## What it can reach
270
279
 
271
- `https://api.workspace.internal` is the Superwall API (`superwallFetch` is a `fetch` to it). The viewer's
280
+ `https://api.artifact.internal` is the Superwall API (`superwallFetch` is a `fetch` to it). The viewer's
272
281
  own access still applies on every call, narrowed by the manifest's `scopes`.
273
282
 
274
283
  **Declare a scope for every API you call.** A route whose scope isn't declared answers a bare 403 at run
@@ -306,8 +315,8 @@ them, and an admin can't approve a version that declares secrets. If the user's
306
315
  - Any binding in `wrangler.jsonc`: KV, R2, D1, services, vars, AI, assets, Durable Objects, Workflows,
307
316
  Containers, cron triggers. Everything goes through `fetch`.
308
317
  - A custom `build.command`, `no_bundle` or `find_additional_modules`, and text, data or wasm modules. A
309
- workspace is exactly one bundled ES module, at most 10 MiB, exporting only its default handlers.
310
- - `@superwall/workspace-sdk` from anywhere but `file:vendor/workspace-sdk`.
318
+ artifact is exactly one bundled ES module, at most 10 MiB, exporting only its default handlers.
319
+ - `@superwall/artifact-sdk` from anywhere but `file:vendor/artifact-sdk`.
311
320
  - A lockfile with a package from outside `registry.npmjs.org`, or without an integrity hash.
312
321
 
313
322
  `dev` applies the bundle rules as it builds. `references/cli.md` lists what `dev` doesn't copy from the
@@ -1,6 +1,6 @@
1
1
  # The commands
2
2
 
3
- ## `superwall workspaces dev [dir]`
3
+ ## `superwall artifacts dev [dir]`
4
4
 
5
5
  | Flag | What it fills in |
6
6
  | ---------------------------- | ------------------------------------------------------------------ |
@@ -45,7 +45,7 @@ Different, so run `try` before believing these:
45
45
  draft holds only the manifest's read scopes, and answers 403. Against an API that hasn't deployed limited tokens,
46
46
  `dev` warns that its token reaches everything you can read.
47
47
  - **App narrowing.** `dev` refuses the same routes the runtime does, for the slot's narrowing, with the same 403:
48
- "Workspaces may not call this endpoint." It doesn't narrow data: on a route the slot can reach, the real runtime
48
+ "Artifacts may not call this endpoint." It doesn't narrow data: on a route the slot can reach, the real runtime
49
49
  holds it to one app, and `dev` lets it read another app in the organization. So don't rely on `dev` to catch an id
50
50
  from the wrong app.
51
51
  - **Frames** have one session per dev server, so two tabs of it share the last one opened. The local dashboard is
@@ -59,33 +59,33 @@ Different, so run `try` before believing these:
59
59
  only flags allowed are `nodejs_compat`, `nodejs_compat_v2` and `nodejs_als`.
60
60
  - **Storage, cron, events, jobs and secrets** aren't available anywhere yet. The platform host answers 501.
61
61
 
62
- ## `superwall workspaces try <entrypoint>`
62
+ ## `superwall artifacts try <entrypoint>`
63
63
 
64
64
  A metric prints each series' summary: `--app` (required), `--org`, `--dir`, `--from`, `--to`, `--days` (30),
65
65
  `--interval` (`day`), `--breakdown`, `--filter key=value` (repeats), `--points`. `--json` adds the draft id, its
66
66
  expiry, the scopes it asked for and the series.
67
67
 
68
- A frame uploads, prints a link to `/<org>/workspace-drafts/<draft>` on the dashboard and, at a terminal, opens
68
+ A frame uploads, prints a link to `/<org>/artifact-drafts/<draft>` on the dashboard and, at a terminal, opens
69
69
  it: `--org` or `--app`, `--campaign`, `--user`, `--environment`, `--no-open`. `--json` gives the link as `url`.
70
70
  A readout says to use `dev`.
71
71
 
72
72
  If your code throws, `try` shows your own message. A 403 from inside your code is a missing scope.
73
73
 
74
- ## `superwall workspaces create [dir]`
74
+ ## `superwall artifacts create [dir]`
75
75
 
76
- Downloads the starter into `dir` (`my-workspace` by default), names it after the directory and runs
76
+ Downloads the starter into `dir` (`my-artifact` by default), names it after the directory and runs
77
77
  `npm install`. `--no-install` skips the install. It refuses a directory with files in it.
78
78
 
79
- ## `superwall workspaces update [dir]`
79
+ ## `superwall artifacts update [dir]`
80
80
 
81
- Replaces `vendor/workspace-sdk` with the latest, points `package.json` at it and updates the lockfile. Commit
81
+ Replaces `vendor/artifact-sdk` with the latest, points `package.json` at it and updates the lockfile. Commit
82
82
  both. If yours is newer than the latest published one, it says so and leaves it unless you pass `--force`. `dev` and `try` say when yours is behind, and never stop you if they can't check.
83
83
 
84
- ## `superwall workspaces push [dir]`
84
+ ## `superwall artifacts push [dir]`
85
85
 
86
- `--org` (on the first push), `-m <note>`, `--overwrite-source`, `--accept-merged-commits`, `--json`. The first push creates the workspace from
86
+ `--org` (on the first push), `-m <note>`, `--overwrite-source`, `--accept-merged-commits`, `--json`. The first push creates the artifact from
87
87
  the manifest's name, or reuses the one with that slug. It waits for the build, up to 20 minutes, and a build that
88
- fails or outlasts that exits 1. `--json` gives `version_id`, `status`, `failure`, `steps` and `url` either way, and `visible_to` (`you`, `its_author`, `nobody` or `everyone`) when it builds. The link it prints is where the workspace opens, in the org's first app when it needs one: its own page for an `org.page@1`, the app's page for an `app.page@1`, Embeds for widgets, tabs, panels and actions, and Charts for metrics. `open <entrypoint> --app <id>` opens one in another app.
88
+ fails or outlasts that exits 1. `--json` gives `version_id`, `status`, `failure`, `steps` and `url` either way, and `visible_to` (`you`, `its_author`, `nobody` or `everyone`) when it builds. The link it prints is where the artifact opens, in the org's first app when it needs one: its own page for an `org.page@1`, the app's page for an `app.page@1`, Embeds for widgets, tabs, panels and actions, and Charts for metrics. `open <entrypoint> --app <id>` opens one in another app.
89
89
 
90
90
  If a teammate changed the same files, it stops and says to run `pull`. `--overwrite-source` replaces the whole
91
91
  source repo with this project, so use it only when you mean to discard what's there.
@@ -101,15 +101,15 @@ no changes of your own, whose build would be their commit. It asks once per comm
101
101
  A build can wait or stop for reasons that aren't your code:
102
102
 
103
103
  - **An organization runs three builds at once.** `push` says so and keeps trying on its own, for up to 20 minutes, with nothing to push again.
104
- - **A workspace can have 100 new versions a day.** `push` stops and says trying soon won't help. Your source is already pushed, so push again later.
104
+ - **An artifact can have 100 new versions a day.** `push` stops and says trying soon won't help. Your source is already pushed, so push again later.
105
105
  - **A failure code of `busy` or `unavailable`** means no build machine was free or the platform failed. Run `push` again in a few minutes, and it retries the same version.
106
106
 
107
- **Who can do what.** `EDITOR` and `USER` can push. Approving and installing need `OWNER` or `ADMIN`. A member with access to only some projects can't build or approve, because a workspace reaches every project, and the command shows why.
107
+ **Who can do what.** `EDITOR` and `USER` can push. Approving and installing need `OWNER` or `ADMIN`. A member with access to only some projects can't build or approve, because an artifact reaches every project, and the command shows why.
108
108
 
109
- ## `superwall workspaces pull [dir]`
109
+ ## `superwall artifacts pull [dir]`
110
110
 
111
111
  Merges teammates' pushes into this project. `--theirs` takes the source repo's version of files you both changed.
112
- `--workspace <id>` fills an empty folder with a workspace's source. The next `push` won't ask about what you pulled,
112
+ `--artifact <id>` fills an empty folder with an artifact's source. The next `push` won't ask about what you pulled,
113
113
  so read it first: your own copy runs all of it with your reads.
114
114
 
115
115
  ## `status`, `logs`, `share`, `list`, `open`
@@ -117,19 +117,19 @@ so read it first: your own copy runs all of it with your reads.
117
117
  `status` shows the state, the latest three versions and the live one, and `--all` lists them all. `logs [version]` prints the last 128 KiB of a build's log once it has
118
118
  finished. `share [version]` marks the latest built version for review. Nobody is told automatically, so for someone
119
119
  who can't approve it, it names who can, when their role can see that. `list --org` lists an organization's
120
- workspaces. `open` prints the dashboard link and opens it at a terminal; `open <entrypoint> --app <id>` opens one
120
+ artifacts. `open` prints the dashboard link and opens it at a terminal; `open <entrypoint> --app <id>` opens one
121
121
  entrypoint inside an app.
122
122
 
123
- Each takes `--workspace <id>` (or a slug with `--org`), and otherwise reads this project's `superwall.workspace.json`.
123
+ Each takes `--artifact <id>` (or a slug with `--org`), and otherwise reads this project's `superwall.artifact.json`.
124
124
 
125
- ## `superwall workspaces approve [version]` (admins)
125
+ ## `superwall artifacts approve [version]` (admins)
126
126
 
127
127
  Shows what the version can do and how it differs from what's granted, then asks. **Never run it with flags before
128
128
  a person has read that.** Without a terminal it needs `--yes`, and `--accept-changes` too when scopes, hosts,
129
129
  secrets, entrypoints, crons, events, storage or the bundle's compatibility date and flags change. `--json` with neither approves nothing, prints `manifest`
130
130
  and `diff`, and exits 1, so run that first and show the person the result.
131
131
 
132
- ## `superwall workspaces install [entrypoint]` (admins)
132
+ ## `superwall artifacts install [entrypoint]` (admins)
133
133
 
134
134
  With no entrypoint, lists what's installed. Otherwise installs it from the live version for the whole organization,
135
135
  or one app with `--app`. `--disable` turns it off and keeps its row, `--remove` deletes the row and ends open
@@ -142,33 +142,36 @@ shows only where it's installed and enabled.
142
142
  | ---------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------- |
143
143
  | `needs a browser login` | You're signed in with an API key. Run `superwall login`. |
144
144
  | `POSTs here need the header Origin` | You called the dev page's API without its `Origin` header. Add it, as in the examples above. |
145
- | `… 403 … Dev's token is read-only` | A write, or a route outside what a workspace can read, like `/v2/me`. The real runtime refuses it too. |
145
+ | `… 403 … Dev's token is read-only` | A write, or a route outside what an artifact can read, like `/v2/me`. The real runtime refuses it too. |
146
146
  | `You can't mint an Agent Token for organization …` | You aren't a member of it, or your access ended. Check `--org`. |
147
147
  | `This dev is running against organization …` | Its token reaches that one only. Restart `dev` with `--org`. |
148
- | `This would fail on the builder. …` | Your wrangler config has something a workspace can't use: `vars`, a binding, `site`, an `env` section, a build command or a key the builder doesn't know. A workspace needs `name`, `main` and `compatibility_date`, and little else. The date and flags have limits too. |
148
+ | `This would fail on the builder. …` | Your wrangler config has something an artifact can't use: `vars`, a binding, `site`, an `env` section, a build command or a key the builder doesn't know. An artifact needs `name`, `main` and `compatibility_date`, and little else. The date and flags have limits too. |
149
149
  | `The bundle reads files outside the repo …` | An import, or a link, reaches past the repo or into `.git`. Move the file into the repo. |
150
+ | `tsconfig.json: "extends" isn't supported …` | Put `baseUrl` and `paths` in the root `tsconfig.json` itself. |
151
+ | `… applies to … in the Worker's build but not in browser code` | A `tsconfig.json` in a subfolder covers browser code. Keep one at the repo root. |
152
+ | `The wrangler config's \`tsconfig\` isn't supported …` | Remove it: with browser code, both builds read the root `tsconfig.json`. |
150
153
  | `client.entry: … is not in the repo` | The path in `superwall.json` is wrong. |
151
154
  | `src/client.tsx:3:14: …` | esbuild's error in your browser code. The builder would say the same. |
152
- | `Could not resolve "@superwall/workspace-sdk/client-bundle"` | The Worker imports the bundle and `superwall.json` has no `client`. |
155
+ | `Could not resolve "@superwall/artifact-sdk/client-bundle"` | The Worker imports the bundle and `superwall.json` has no `client`. |
153
156
  | `The client bundle is … bytes` | Over 8 MiB. It lists the largest files. |
154
- | `This project's workspace SDK is too old for client.entry` | Run `superwall workspaces update`, then `npm install`. |
157
+ | `This project's artifact SDK is older than the builder's browser build` | Run `superwall artifacts update`, then `npm install`. |
155
158
  | `bundled with esbuild 0.28.2, not …` | This project's wrangler brings another esbuild. Install the wrangler the starter pins. |
156
159
  | `Refused GET https://…: dev runs like a draft` | Outside hosts are off in dev and drafts. |
157
- | `Someone else pushed changes to …` | A teammate changed the same files. Run `superwall workspaces pull`, then push again. |
158
- | `The build failed at …` | The builder's own words. `superwall workspaces logs` has the rest. A new push, or the same commit again, retries. |
160
+ | `Someone else pushed changes to …` | A teammate changed the same files. Run `superwall artifacts pull`, then push again. |
161
+ | `The build failed at …` | The builder's own words. `superwall artifacts logs` has the rest. A new push, or the same commit again, retries. |
159
162
  | `Your copy would run commits from …` | `push` would merge teammates' commits into your own copy. Run `pull` to read them, then push. |
160
163
  | `Only organization owners and admins can …` | Your role can't do this. `share` says who can, when your role can see that. |
161
- | `Building a workspace needs access to all projects` | An owner or admin has to change your project access. |
164
+ | `Building an artifact needs access to all projects` | An owner or admin has to change your project access. |
162
165
  | `… builds running` | Your organization's three builds are taken. `push` waits and retries on its own. |
163
166
  | `… pushes in the last day` | The daily limit. Trying soon won't help. |
164
167
  | `All the build machines are busy` or `… usually temporary` | Not your code. Run `push` again in a few minutes. |
165
168
  | `Nothing was approved …` | `approve` needs a person, or `--yes`, plus `--accept-changes` when what it can do changes. |
166
169
  | `… needs projects:read, which superwall.json doesn't declare` | Add it to `scopes`. It answers 403 on the real runtime. |
167
- | `Workspaces may not call this endpoint.` | The route isn't open to workspaces, or to this slot. A slot tied to one app can't reach `/v2/projects` or SQL, on the real runtime too. Use its app's routes, an `org.page@1` or a metric. |
170
+ | `Artifacts may not call this endpoint.` | The route isn't open to artifacts, or to this slot. A slot tied to one app can't reach `/v2/projects` or SQL, on the real runtime too. Use its app's routes, an `org.page@1` or a metric. |
168
171
  | `The environment must be PRODUCTION or SANDBOX` | In capitals, in `--environment`, `--context` and dev's page API. |
169
172
  | `The metric handler didn't answer within 10 seconds` | The real limit. Query an aggregated table or a narrower window. A cold first query can be slow, so run it again once. |
170
173
  | `A point's t must be an ISO 8601 date-time` | ClickHouse returned `2026-10-01 00:00:00`. Replace the space with `T` and add `Z`, as the example does. |
171
174
  | `Port … is already in use` | Something else has that port. Pick another with `--port`; dev takes the one after it too. |
172
- | `The workspace didn't start … compatibility date is too new` | Your wrangler is older than the platform's date. Run `npm install -D wrangler@latest`. |
175
+ | `The artifact didn't start … compatibility date is too new` | Your wrangler is older than the platform's date. Run `npm install -D wrangler@latest`. |
173
176
  | `exactly one ES module` or `exports …` | A text, data or wasm import, or a named export. Inline it, or export only the default. |
174
177
  | `The analytics query didn't finish`, or a 503 about row policies | A passing failure of the query endpoint. Try again. |
@@ -21,8 +21,8 @@ slot needs a `path` and takes no `metric`; a headless one needs a `metric` and t
21
21
  ## Types
22
22
 
23
23
  ```ts
24
- import type { MetricRequest, MetricSeries, ReadoutRequest, ReadoutResult } from "@superwall/workspace-sdk/metrics"
25
- import type { SlotContext, UserPanelContextV1 } from "@superwall/workspace-sdk/slots"
24
+ import type { MetricRequest, MetricSeries, ReadoutRequest, ReadoutResult } from "@superwall/artifact-sdk/metrics"
25
+ import type { SlotContext, UserPanelContextV1 } from "@superwall/artifact-sdk/slots"
26
26
  ```
27
27
 
28
28
  ## A readout
@@ -39,14 +39,14 @@ import type { SlotContext, UserPanelContextV1 } from "@superwall/workspace-sdk/s
39
39
  ```
40
40
 
41
41
  ```ts
42
- import type { ReadoutRequest, ReadoutResult } from "@superwall/workspace-sdk/metrics"
42
+ import type { ReadoutRequest, ReadoutResult } from "@superwall/artifact-sdk/metrics"
43
43
 
44
44
  const readout = async ({ context }: ReadoutRequest): Promise<ReadoutResult> => ({
45
45
  variants: context.variantIds.map((variantId) => ({ variantId, value: 0.42, interval: [0.4, 0.44] })),
46
46
  })
47
47
  ```
48
48
 
49
- Pass it to `defineWorkspace({ fetch, readout })`. `value` is null when there's nothing to show yet.
49
+ Pass it to `defineArtifact({ fetch, readout })`. `value` is null when there's nothing to show yet.
50
50
  `interval` is optional and must hold `value`. Each variant at most once, and only this audience's; one you
51
51
  leave out shows as having no value. Limits: 10 seconds, 32 KB. A readout metric takes no `breakdowns`,
52
52
  `filters` or `total`.
@@ -54,8 +54,8 @@ leave out shows as having no value. Limits: 10 seconds, 32 KB. A readout metric
54
54
  ## The bridge
55
55
 
56
56
  `connect()` waits for the host, then replies `ready`. It trusts Superwall's dashboards, and a localhost host
57
- when the frame is on localhost too (which is `dev`). Import `@superwall/workspace-sdk/client` from your
58
- `client.entry`; `client-script` gives you the same thing as `superwallWorkspace.connect` on a plain page.
57
+ when the frame is on localhost too (which is `dev`). Import `@superwall/artifact-sdk/client` from your
58
+ `client.entry`; `client-script` gives you the same thing as `superwallArtifact.connect` on a plain page.
59
59
 
60
60
  ```ts
61
61
  bridge.context // the slot's context
@@ -70,7 +70,7 @@ bridge.send({ _tag: "error", message: "What went wrong, up to 500 characters" })
70
70
  ```
71
71
 
72
72
  - `navigate` goes to `campaign` (`applicationId`, `campaignId`), `user` (`applicationId`, `appUserId`) or
73
- `workspace` (`slug`). The host builds the route; it never takes a URL.
73
+ `artifact` (`slug`). The host builds the route; it never takes a URL.
74
74
  - `actionResult` means something only in `user.action@1`, the modal slot.
75
75
  - `resize` is sent for you as the document grows, and clamped to the slot. A page and a widget fill what
76
76
  holds them and ignore it, so a widget must handle being narrow and scroll inside itself.
@@ -91,7 +91,7 @@ A manifest can ask for only these, and the viewer's own access still applies:
91
91
  `SKILL.md` has which route needs which scope. A route whose scope isn't declared answers 403. Writes do nothing
92
92
  in `dev` or a draft.
93
93
 
94
- Routes a workspace can call: reads under `/v2/projects`, `/v2/applications`, `/v2/charts`, `/v2/users`,
94
+ Routes an artifact can call: reads under `/v2/projects`, `/v2/applications`, `/v2/charts`, `/v2/users`,
95
95
  `/v3/users`, `/v2/onboarding`, `/v2/retention-onboarding` and `/v2/demand-score`; reads and, where the scope
96
96
  allows, writes under `/v2/paywalls`, `/v2/campaigns`, `/v2/products`, `/v2/entitlements`, `/v2/grants`,
97
97
  `/v2/assets`, `/v2/surveys` and the retention families. Nothing under `/v2/me`, access, tokens or transfers.
@@ -100,4 +100,4 @@ allows, writes under `/v2/paywalls`, `/v2/campaigns`, `/v2/products`, `/v2/entit
100
100
  panels and actions. They reach `/v2/campaigns`, `/v2/surveys`, the retention families, `/v2/users`, `/v3/users`,
101
101
  `/v2/charts`, `/v2/paywalls`, `/v2/applications/<id>/…`, and one product, entitlement or asset by id. They can't reach
102
102
  `/v2/projects`, SQL, or a list of products, entitlements or assets, which show sibling apps. Anything else answers 403
103
- with "Workspaces may not call this endpoint.", in `dev` too. Metrics and readouts aren't held to this list.
103
+ with "Artifacts may not call this endpoint.", in `dev` too. Metrics and readouts aren't held to this list.
@@ -1,10 +1,10 @@
1
- import { c as CHANNELS, s as CHANNEL, x as VERSION } from "./environment-FR3bcq0D.js";
1
+ import { c as CHANNELS, s as CHANNEL, x as VERSION } from "./environment-BocmdvZ-.js";
2
2
  import { c as readSkillsSync, g as writeSkillsSync } from "./config-CGcG7GOt.js";
3
- import { r as track } from "./telemetry-ekUQuhLJ.js";
3
+ import { r as track } from "./telemetry-ovPiseFm.js";
4
4
  import { r as spawnStream } from "./spawn-DmmmHIP-.js";
5
- import { n as withSpinner } from "./spinner-025_eqCX.js";
5
+ import { n as withSpinner } from "./spinner-DPdBlZe2.js";
6
6
  import { n as ui } from "./ui-D_qf3Gvw.js";
7
- import { i as packagedDir, t as AGENT_SKILLS_DIR } from "./paths-BaeoxDze.js";
7
+ import { i as packagedDir, t as AGENT_SKILLS_DIR } from "./paths-CzTJVpfi.js";
8
8
  import { existsSync, mkdtempSync, readFileSync, readdirSync, rmSync, writeFileSync } from "node:fs";
9
9
  import { tmpdir } from "node:os";
10
10
  import { join } from "node:path";
@@ -1,14 +1,14 @@
1
- import "./token-B2PduqrR.js";
1
+ import "./token-Bu3FaRkv.js";
2
2
  import "./output-Ggzq5_-t.js";
3
- import "./environment-FR3bcq0D.js";
4
- import "./storage-CUMgpcVH.js";
5
- import "./client-DHlsTaP1.js";
3
+ import "./environment-BocmdvZ-.js";
4
+ import "./storage-DT_wxwJ8.js";
5
+ import "./client-CyrYJzBF.js";
6
6
  import "./config-CGcG7GOt.js";
7
- import "./telemetry-ekUQuhLJ.js";
7
+ import "./telemetry-ovPiseFm.js";
8
8
  import "./spawn-DmmmHIP-.js";
9
- import "./spinner-025_eqCX.js";
9
+ import "./spinner-DPdBlZe2.js";
10
10
  import "./ui-D_qf3Gvw.js";
11
- import "./paths-BaeoxDze.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-Cm1j2d1W.js";
11
+ import "./paths-CzTJVpfi.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-421SFEyF.js";
13
13
 
14
14
  export { PLAYBOOKS, SKILLS_INSTALL_SOURCE, SKILLS_REF, SUPERWALL_SKILLS_SOURCE, bundledSkills, checkSkillsSync, ensureSkillsCurrent, knownSkills, normalizeSkillFrontmatter, normalizeSkillsDir, readBundledSkill, runSkills, skillSummary, skillsRefFor, updateSkills };