ugly-app 0.1.949 → 0.1.950

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 (48) hide show
  1. package/README.md +209 -211
  2. package/dist/cli/build.d.ts.map +1 -1
  3. package/dist/cli/build.js +28 -0
  4. package/dist/cli/build.js.map +1 -1
  5. package/dist/cli/version.d.ts +1 -1
  6. package/dist/cli/version.js +1 -1
  7. package/dist/client/audio/AudioPlayer.d.ts +1 -0
  8. package/dist/client/audio/AudioPlayer.d.ts.map +1 -1
  9. package/dist/client/audio/AudioPlayer.js +13 -5
  10. package/dist/client/audio/AudioPlayer.js.map +1 -1
  11. package/dist/client/audio/AudioRecorder.d.ts +1 -0
  12. package/dist/client/audio/AudioRecorder.d.ts.map +1 -1
  13. package/dist/client/audio/AudioRecorder.js +8 -2
  14. package/dist/client/audio/AudioRecorder.js.map +1 -1
  15. package/dist/client/audio/audioPlayer.worklet.js +30 -3
  16. package/dist/client/audio/audioPlayer.worklet.js.map +1 -1
  17. package/dist/client/audio/audioRecorder.worklet.js +7 -3
  18. package/dist/client/audio/audioRecorder.worklet.js.map +1 -1
  19. package/dist/client/audio/workletLoader.d.ts +16 -0
  20. package/dist/client/audio/workletLoader.d.ts.map +1 -0
  21. package/dist/client/audio/workletLoader.js +49 -0
  22. package/dist/client/audio/workletLoader.js.map +1 -0
  23. package/dist/server/App.d.ts.map +1 -1
  24. package/dist/server/App.js +7 -1
  25. package/dist/server/App.js.map +1 -1
  26. package/dist/vite/audioWorkletsPlugin.d.ts +36 -0
  27. package/dist/vite/audioWorkletsPlugin.d.ts.map +1 -0
  28. package/dist/vite/audioWorkletsPlugin.js +99 -0
  29. package/dist/vite/audioWorkletsPlugin.js.map +1 -0
  30. package/dist/vite/index.d.ts +1 -0
  31. package/dist/vite/index.d.ts.map +1 -1
  32. package/dist/vite/index.js +1 -0
  33. package/dist/vite/index.js.map +1 -1
  34. package/package.json +1 -1
  35. package/src/cli/build.ts +33 -0
  36. package/src/cli/version.ts +1 -1
  37. package/src/client/audio/AudioPlayer.ts +25 -5
  38. package/src/client/audio/AudioRecorder.ts +20 -2
  39. package/src/client/audio/audioPlayer.worklet.ts +33 -6
  40. package/src/client/audio/audioRecorder.worklet.ts +11 -7
  41. package/src/client/audio/workletLoader.test.ts +110 -0
  42. package/src/client/audio/workletLoader.ts +55 -0
  43. package/src/client/audio/workletSync.test.ts +43 -0
  44. package/src/server/App.ts +7 -1
  45. package/src/vite/audioWorkletsPlugin.test.ts +45 -0
  46. package/src/vite/audioWorkletsPlugin.ts +104 -0
  47. package/src/vite/index.ts +6 -0
  48. package/templates/vite.config.ts +11 -2
package/README.md CHANGED
@@ -1,15 +1,15 @@
1
1
  # ugly-app
2
2
 
3
- A full-stack TypeScript framework for shipping production web apps.
4
- Scaffold with `npx ugly-app init my-app` and get an opinionated Node +
5
- React + Postgres stack with type-safe RPC over WebSocket and HTTP,
6
- real-time doc subscriptions, built-in auth, AI generation, storage,
7
- workers, cron, and a CLI for every workflow.
3
+ A full-stack TypeScript framework for shipping production web apps. Scaffold
4
+ with `npx ugly-app init my-app` and get an opinionated Node + React + Postgres
5
+ stack with type-safe RPC over WebSocket and HTTP, real-time doc subscriptions,
6
+ built-in auth, AI generation, storage, workers, cron, and a CLI for every
7
+ workflow.
8
8
 
9
9
  ugly-app is designed to run against [ugly.bot](https://ugly.bot), which
10
- provides auth, infra (Postgres, Qdrant, NATS, S3-compatible object
11
- storage), AI provider keys, push, email, and deployment. Your app talks
12
- to all of it through the project's dev tunnel and its `UGLY_BOT_TOKEN`.
10
+ provides auth, infra (Postgres, Qdrant, NATS, S3-compatible object storage),
11
+ AI provider keys, push, email, and deployment. Your app talks to all of it
12
+ through the project's dev tunnel and its `UGLY_BOT_TOKEN`.
13
13
 
14
14
  ```bash
15
15
  npx ugly-app init my-app
@@ -44,8 +44,8 @@ npm run dev
44
44
 
45
45
  ## Server — `createApp()`
46
46
 
47
- Single server entry point. Returns an `App` that owns Express, the
48
- WebSocket server, the typed DB, and the RPC dispatcher.
47
+ Single server entry point. Returns an `App` that owns Express, the WebSocket
48
+ server, the typed DB, and the RPC dispatcher.
49
49
 
50
50
  ```ts
51
51
  // server/index.ts
@@ -103,29 +103,31 @@ function createApp<
103
103
  ): App<CollectionMap<typeof BUILTIN_DEFS & Defs>, RegistryPages<R>>;
104
104
  ```
105
105
 
106
- Passing `pages` in the registry (`{ requests, messages, pages }`)
107
- upgrades `app.pushSend()` to a per-route typed API. `pages` is optional;
108
- apps that only call `configurator.setPages()` still work — they just get
109
- the loose `PageRegistry` typing on `pushSend`.
106
+ Passing `pages` in the registry (`{ requests, messages, pages }`) upgrades
107
+ `app.pushSend()` to a per-route typed API. `pages` is optional; apps that only
108
+ call `configurator.setPages()` still work — they just get the loose
109
+ `PageRegistry` typing on `pushSend`.
110
110
 
111
111
  ### The returned `App`
112
112
 
113
- | Field | Description |
114
- |-------|-------------|
113
+ `App` extends `AppRouter`, so `dispatch(name, input, userId)` is available for
114
+ in-process invocation of any registered handler.
115
+
116
+ | Member | Description |
117
+ |--------|-------------|
115
118
  | `start(port?)` | Start the server (default 3000; templates use 4321). |
116
- | `db` | The `TypedDB<Map>` (map inferred from your collections + framework built-ins). |
119
+ | `db` | `TypedDB<Map>` map inferred from your collections + framework built-ins. |
117
120
  | `httpServer` | The underlying Node `http.Server`. |
118
121
  | `wss` | The main `WebSocketServer` (path set via `setWsPath`, default `/rpc`). |
119
- | `dispatch(name, input, userId)` | Invoke a registered RPC handler programmatically (inherited from `AppRouter`). |
122
+ | `dispatch(name, input, userId)` | `Promise<unknown>` invoke any registered RPC handler programmatically. |
120
123
  | `registerRoutes(fn)` | Mount additional Express routes after creation. |
121
- | `pushSend(input)` | Typed push whose click-through target is a route from this app's `pages`. The framework mints a `https://ugly.bot/l/<code>` short link so the click-through is always absolute and dock-app-routable. |
124
+ | `pushSend(input)` | Typed push whose click-through target is a route from this app's `pages`. Mints a `https://ugly.bot/l/<code>` short link so the URL is always absolute and dock-app-routable. |
122
125
 
123
- Framework services start automatically inside `app.start()`: schema
124
- drift check, NATS connection + KV buckets, data-proxy connection,
125
- event-counter flush, TTL cleanup for log tables, console/error capture,
126
- and ugly.bot log forwarding. Postgres, NATS, storage, and AI clients
127
- are loaded **lazily** — a host without `DATABASE_URL` / `NATS_URL` /
128
- `R2_BUCKET` doesn't pay their startup cost.
126
+ Framework services start inside `app.start()`: schema drift check, NATS
127
+ connection + KV buckets, data-proxy connection, event-counter flush, TTL
128
+ cleanup for log tables, console/error capture, and ugly.bot log forwarding.
129
+ Postgres, NATS, storage, and AI clients load **lazily** — a host without
130
+ `DATABASE_URL` / `NATS_URL` / `R2_BUCKET` doesn't pay their startup cost.
129
131
 
130
132
  ### `AppConfigurator`
131
133
 
@@ -156,8 +158,8 @@ Every method is optional; `setPages` is what mounts the SPA.
156
158
 
157
159
  ### Handler signatures
158
160
 
159
- Handlers are plain async functions — no context object. Access state
160
- via captured imports (`app.db`, `storage`, `pgQuery`, `uglyBotRequest`, …).
161
+ Handlers are plain async functions — no context object. Access state via
162
+ captured imports (`app.db`, `storage`, `pgQuery`, `uglyBotRequest`, …).
161
163
 
162
164
  ```ts
163
165
  // req() — public, userId may be null
@@ -169,30 +171,37 @@ getMe: async (userId: string, input) => { /* … */ }
169
171
 
170
172
  ### Built-in framework requests
171
173
 
172
- `createApp` registers several framework handlers reachable from any
173
- client via the normal RPC pipeline. App-provided handlers with the same
174
- name override the framework's defaults.
174
+ `createApp` registers several framework handlers reachable from any client via
175
+ the normal RPC pipeline. App-provided handlers with the same name override the
176
+ framework's defaults. Rate-limited handlers are marked below.
175
177
 
176
- | Name | Purpose |
177
- |------|---------|
178
+ | Name | Notes |
179
+ |------|-------|
178
180
  | `userGet` | Returns `{ userId, name, avatarUri }` for the given user (or caller). |
179
181
  | `initSession` / `captureEvent` | Session + event logging tagged with experiment branches (public — no auth). |
180
- | `textGen` / `imageGen` | AI proxies — server-validated, billed through ugly.bot. |
181
- | `kagiSearch` / `kagiSummarize` / `kagiEnrichWeb` / `kagiEnrichNews` | Web search via ugly.bot. |
182
+ | `textGen` | AI text proxy — server-validated, billed through ugly.bot. Rate-limited 20/60s. |
183
+ | `imageGen` | AI image proxy. Rate-limited 10/60s. |
184
+ | `kagiSearch` / `kagiEnrichWeb` / `kagiEnrichNews` | Web search via ugly.bot. Rate-limited 20/60s. |
185
+ | `kagiSummarize` | URL / text summary. Rate-limited 10/60s. |
182
186
  | `uploadUrl` | Issues a presigned PUT for the `temp` bucket. |
183
- | `shareLink` | Mint a `https://ugly.bot/l/<code>` short link with OG metadata. |
184
- | `feedbackReportCreateNoAuth` / `errorLogCaptureNoAuth` / `perfSnapshotCaptureNoAuth` | Same-origin, public endpoints used by browser telemetry. |
185
- | `submitFeedbackBot` / `feedbackReportResolve` | Bot-persona feedback submission; admin resolve/decline. |
187
+ | `shareLink` | Mint a `https://ugly.bot/l/<code>` short link with OG metadata. Rate-limited 60/60s. |
188
+ | `feedbackReportCreateNoAuth` | Public, same-origin feedback endpoint used by browser telemetry. Rate-limited 10/60s. |
189
+ | `errorLogCaptureNoAuth` | Public error-log capture. |
190
+ | `perfSnapshotCaptureNoAuth` | Public perf snapshot capture. Rate-limited 60/60s. |
191
+ | `submitFeedbackBot` | Bot-persona feedback submission. |
192
+ | `feedbackReportResolve` | Admin resolve/decline. Rate-limited 120/60s. |
186
193
  | `adminGetPerfLogs` | Admin-only perf telemetry read. |
187
194
  | `adminCreateTestUser` / `adminListTestUsers` / `adminDeleteTestUser` | Admin-only synthetic-user management. Gated by `setIsAdmin()`. |
188
195
  | `projectPlanList` / `projectPlanCreate` / `projectPlanUpdate` / `projectPlanDelete` | Project plan CRUD used by Studio. |
189
196
 
197
+ Add per-endpoint rate limits on your own handlers with `rateLimit: { max, window }` on the request definition (see below).
198
+
190
199
  ---
191
200
 
192
201
  ## Shared API definitions
193
202
 
194
- `shared/` is consumed by both server and client. Keep all Zod schemas,
195
- types, collections, and route declarations here.
203
+ `shared/` is consumed by both server and client. Keep all Zod schemas, types,
204
+ collections, and route declarations here.
196
205
 
197
206
  ### Requests (`shared/api.ts`)
198
207
 
@@ -222,8 +231,8 @@ export const requests = defineRequests({
222
231
  ```
223
232
 
224
233
  Every request is reachable as **both** `socket.request(name, input)`
225
- (WebSocket) and `POST /api/:name { input }` (HTTP). `z` is re-exported
226
- from Zod for convenience.
234
+ (WebSocket) and `POST /api/:name { input }` (HTTP). `z` is re-exported from
235
+ Zod for convenience.
227
236
 
228
237
  ### Collections (`shared/collections.ts`)
229
238
 
@@ -259,20 +268,19 @@ export const collections = defineCollections({
259
268
  - `public` — allow unauthenticated client reads.
260
269
  - `cascadeFrom` — parent collection: when the parent doc is deleted, docs in this collection are cascade-deleted.
261
270
  - `trackKeys?` — fields usable as NATS routing keys for scoped `trackDocs` subscriptions.
262
- - `getter?(ids)` — batch resolver for collections with no local table (framework pattern; e.g. `userPublic` resolves via ugly.bot).
271
+ - `getter?(ids)` — batch resolver for collections with no local table (e.g. `userPublic` resolves via ugly.bot).
263
272
  - `skipReadValidation?` — opt out of per-row zod validation on reads for very hot collections. Writes are always validated. Global kill-switch: `UGLY_DB_VALIDATE_READS=0`.
264
273
  - `search?: { fields, language? }` — full-text index over the named JSONB paths (Neon: Postgres FTS; D1: SQLite FTS5, ranked by bm25).
265
274
  - `vector?: { dimensions, metric?, filterable? }` — ANN index. Vector supplied out-of-band at write time (`setDoc(c, doc, { vec })`) — never stored in the doc JSON. Query with `getDocs(c, filter, { near })`.
266
275
 
267
276
  All documents extend `DBObject`: `{ _id, version, created, updated }`.
268
- Use `dbDefaults()` to stamp `version` / `created` / `updated` on
269
- inserts. **Always generate `_id` with `nanoid()`** — never
270
- `crypto.randomUUID()`, `Date.now()`, or `Math.random()` (see
271
- `CLAUDE.md`).
277
+ Use `dbDefaults()` to stamp `version` / `created` / `updated` on inserts.
278
+ **Always generate `_id` with `nanoid()`** — never `crypto.randomUUID()`,
279
+ `Date.now()`, or `Math.random()` (see `CLAUDE.md`).
272
280
 
273
- After schema changes, run `npm run db:schema-gen` then `npm run
274
- db:migrate`. The app refuses to start when drift is detected (set
275
- `SCHEMA_CHECK_SKIP=true` only as a last resort).
281
+ After schema changes, run `npm run db:schema-gen` then `npm run db:migrate`.
282
+ The app refuses to start when drift is detected (set `SCHEMA_CHECK_SKIP=true`
283
+ only as a last resort).
276
284
 
277
285
  ---
278
286
 
@@ -295,23 +303,20 @@ export const pages = definePages({
295
303
  export type AppPages = typeof pages;
296
304
  ```
297
305
 
298
- `definePage<Params>(options?)` returns a `PageDef<Params>` — a runtime
299
- object carrying `PageMeta` plus a phantom `_params` used only for
300
- TypeScript inference.
301
-
302
- **Options** (all optional):
306
+ `definePage<Params>(options?)` returns a `PageDef<Params>` — a runtime object
307
+ carrying `PageMeta` plus a phantom `_params` used only for TypeScript
308
+ inference. `PageMeta` fields:
303
309
 
304
- - `auth` (default `true`) — protected route. When `isAuthenticated()` returns false on this route, the router synchronously renders the framework's `<AuthRoot>` in place of the page (dispatches on `window.__UGLY_APP_AUTH_MODE__`: Mode A → `<LoginPopup>`, Mode B → `<MagicLinkForm>` plus optional Google button). Apps cannot override this fallback — the framework owns the login UX so no route can accidentally ship as auth-required with no way to log in.
305
- - `ssr` (default `false`) — server-render the page for SEO. `{ auth: true, ssr: true }` is silently dropped to `ssr: false` with a warning: the SSR document is served from a shared edge cache and must not depend on the viewer.
310
+ - `auth` (default `true`) — protected route. When `isAuthenticated()` returns false on this route, the router synchronously renders the framework's `<AuthRoot>` in place of the page (Mode A → `<LoginPopup>`, Mode B → `<MagicLinkForm>` plus optional Google button). Apps cannot override this fallback.
311
+ - `ssr` (default `false`) — server-render the page for SEO. `{ auth: true, ssr: true }` is silently downgraded to `ssr: false` with a warning: the SSR document is served from a shared edge cache and must not depend on the viewer.
306
312
  - `cacheQuery?: string[]` — query params that participate in the SSR edge-cache key. Anything NOT listed bypasses the cache instead of poisoning it (e.g. `cacheQuery: ['q']` on a search page).
307
- - `ssrCacheTimeout?: number` — edge cache lifetime in seconds. Default is effectively 1 year (`DEFAULT_SSR_CACHE_TIMEOUT`) because the `buildId` is part of the cache key. Override only for pages that drift between deploys.
313
+ - `ssrCacheTimeout?: number` — edge cache lifetime in seconds. Default is `DEFAULT_SSR_CACHE_TIMEOUT` (1 year) because the `buildId` is already part of the cache key. Override only for pages that drift between deploys.
308
314
 
309
315
  Path syntax: `:param` matches a single path segment; `*param` is greedy
310
- (captures slashes). Query-string params are declared in `Params` but
311
- never appear in the path template.
316
+ (captures slashes). Query-string params are declared in `Params` but never
317
+ appear in the path template.
312
318
 
313
- `definePages<T>(p)` is a pass-through identity — use it to give the
314
- registry a name.
319
+ `definePages<T>(p)` is a pass-through identity — use it to name the registry.
315
320
 
316
321
  ### `createRouter()` (`ugly-app/client`)
317
322
 
@@ -332,23 +337,23 @@ export const {
332
337
  **Config:**
333
338
  - `pages` (required) — the `PageRegistry` from `shared/pages.ts`.
334
339
  - `allPages?` — the lazy route → element map (`PageMap<Pages>`). Prefer registering via `setAllPages()` from the browser entry when the app also server-renders — the Worker bundle has no code splitting, so a static import inlines every page (and its deps) into `worker.js`.
335
- - `ssrPages?` — `Partial<{ [K]: ComponentType<Params> }>` of statically-imported components for `ssr: true` routes. Used by both the Worker's `renderToString` and the client's first hydration render so the initial paint resolves synchronously and never mismatches the server output.
340
+ - `ssrPages?: SsrPageMap<Pages>` — `Partial<{ [K]: ComponentType<Params> }>` of statically-imported components for `ssr: true` routes. Used by both the Worker's `renderToString` and the client's first hydration render so the initial paint resolves synchronously and never mismatches the server output.
336
341
 
337
342
  **Returns:**
338
343
 
339
- - **`RouterProvider`** — props: `children`, `fallback?`, `isAuthenticated?`, `initialUrl?` (`{ pathname, search }`, required for SSR + hydration). Manages route state, browser history, and the popup layer. Runs the per-route auth check synchronously — apps cannot override the login fallback.
340
- - **`RouterView`** — renders the active page with animated transitions. Props: `durationMs?`, `easing?`, `transitionComponent?` (a `React.ComponentType<RouterTransitionProps>` that replaces the default `ViewFlipper`), `renderPage?(state) => ReactElement` (sync alternative to `allPages` loaders, called with `RouterStateRaw`).
344
+ - **`RouterProvider`** — props: `children`, `fallback?`, `isAuthenticated?: () => boolean`, `initialUrl?: { pathname, search }` (required for SSR + hydration). Manages route state, browser history, and the popup layer. Runs the per-route auth check synchronously — apps cannot override the login fallback.
345
+ - **`RouterView`** — renders the active page with animated transitions. Props: `durationMs?`, `easing?: EasingFunction`, `transitionComponent?: React.ComponentType<RouterTransitionProps>` (replaces the default `ViewFlipper`), `renderPage?(state: RouterStateRaw) => ReactElement` (sync alternative to `allPages` loaders).
341
346
  - **`useRouter()`** — returns `RouterContextValue<Pages>` (typed navigation + popup API). Throws if used outside `<RouterProvider>`.
342
347
  - **`Link`** — typed SPA link bound to this router. Renders a real `<a>` (right-click / cmd-click / SEO keep working) but intercepts a plain left-click and routes through `push` / `replace`. Props: `to`, `params` (both type-checked against `pages`), `replace?`, `children`, plus common anchor attrs (`className`, `style`, `target`, `aria-label`, `data-id`, `onClick`).
343
348
  - **`setAllPages(map)`** — register the lazy `PageMap<Pages>` after construction (typically from the browser entry, so the Worker's import graph stays free of every lazy page).
344
349
 
345
- A standalone `Link` is also exported from `ugly-app/client` for code
346
- that can't easily reach the typed one; it accepts an optional `router`
347
- prop and falls back to `<RouterProvider>` context.
350
+ A standalone `Link` is also exported from `ugly-app/client` for code that
351
+ can't easily reach the typed one; it accepts an optional `router` prop and
352
+ falls back to `<RouterProvider>` context.
348
353
 
349
- **Never use a bare `<a href="/route">`** for internal navigation — it
350
- triggers a full document reload (white flash + repaint). See the "client
351
- navigation" rule in `CLAUDE.md`.
354
+ **Never use a bare `<a href="/route">`** for internal navigation — it triggers
355
+ a full document reload (white flash + repaint). See the "client navigation"
356
+ rule in `CLAUDE.md`.
352
357
 
353
358
  ### Page map — `lazyPage` / `lazyPageLoader`
354
359
 
@@ -369,10 +374,9 @@ export const allPages = {
369
374
  - **`lazyPageLoader(factory)`** — lazy-imports an async loader `(params) => Promise<ReactElement>`. Use when a route needs data fetching before render. The loader file is the chunk boundary, so it can statically import its page component.
370
375
 
371
376
  Both wrappers recover from stale-deploy chunk 404s ("Failed to fetch
372
- dynamically imported module"): on the first failure they trigger a
373
- single `window.location.reload()` (guarded by `sessionStorage` so a
374
- genuinely broken chunk can't loop) to fetch the fresh `index.html` with
375
- new chunk hashes.
377
+ dynamically imported module"): on the first failure they trigger a single
378
+ `window.location.reload()` (guarded by `sessionStorage` so a genuinely broken
379
+ chunk can't loop) to fetch fresh chunk hashes.
376
380
 
377
381
  ```ts
378
382
  // pages/SlowPageLoader.tsx
@@ -402,15 +406,15 @@ replace('search', { q: 'hello' }); // → /search?q=hello
402
406
  back(); // browser history back
403
407
  ```
404
408
 
405
- Route names and params are fully typed against `pages`. `push` /
406
- `replace` no-op with a `console.error` when `buildUrl()` produces a URL
407
- that doesn't match a registered route.
409
+ Route names and params are fully typed against `pages`. `push` / `replace`
410
+ no-op with a `console.error` when `buildUrl()` produces a URL that doesn't
411
+ match a registered route.
408
412
 
409
413
  ### Popups — `openPopup()`
410
414
 
411
- `useRouter().openPopup()` is the canonical modal / sheet / menu API.
412
- The router owns the popup layer, drives a spring animation, and stacks
413
- popups z-index-correctly above every page.
415
+ `useRouter().openPopup()` is the canonical modal / sheet / menu API. The
416
+ router owns the popup layer, drives a spring animation, and stacks popups
417
+ z-index-correctly above every page.
414
418
 
415
419
  ```tsx
416
420
  const { openPopup } = useRouter();
@@ -435,20 +439,20 @@ handle.hide(); // dismiss programmatically — same as router.closePopup(handle.
435
439
  - **`contextMenu`** — same as transient, intended for menus and pickers.
436
440
 
437
441
  `renderLayer` receives `{ content, spring, hide }`: `spring` is a
438
- `createAnimatedValue()` result driving 0 → 1; `hide` closes the popup.
439
- The default layer animates open with `easeOut` (250 ms) and closed with
440
- `easeIn` (200 ms). Popups render as siblings of the router's children
441
- (managed inside `RouterProvider`), so they stack above every page.
442
+ `createAnimatedValue()` result driving 0 → 1; `hide` closes the popup. The
443
+ default layer animates open with `easeOut` (250 ms) and closed with `easeIn`
444
+ (200 ms). Popups render as siblings of the router's children (managed inside
445
+ `RouterProvider`), so they stack above every page.
442
446
 
443
447
  ### Scroll containers
444
448
 
445
449
  `html, body, #root` are `overflow: hidden` — the document itself never
446
- scrolls, so a page that just renders tall content is clipped. For pages
447
- that own their scrolling (or render outside the normal authed chrome —
448
- e.g. a public page special-cased before the auth gate), wrap the
449
- content in `SimpleScrollView` (exported from `ugly-app/client`). For
450
- long / virtualized lists with scroll-position persistence, use the
451
- richer `ScrollView`. See the "page scrolling" rule in `CLAUDE.md`.
450
+ scrolls, so a page that just renders tall content is clipped. For pages that
451
+ own their scrolling (or render outside the normal authed chrome — e.g. a
452
+ public page special-cased before the auth gate), wrap the content in
453
+ `SimpleScrollView` (exported from `ugly-app/client`). For long / virtualized
454
+ lists with scroll-position persistence, use the richer `ScrollView`. See the
455
+ "page scrolling" rule in `CLAUDE.md`.
452
456
 
453
457
  ---
454
458
 
@@ -471,6 +475,9 @@ bootstrapApp({
471
475
  });
472
476
  ```
473
477
 
478
+ `bootstrapApp(options): void` — returns nothing; it renders directly to the
479
+ DOM.
480
+
474
481
  **`BootstrapAppOptions`:**
475
482
 
476
483
  | Field | Description |
@@ -488,28 +495,28 @@ bootstrapApp({
488
495
  | `silentSso?` | Apex-domain apps that use ugly.bot as their auth authority but don't share its cookie. When `true`, a logged-out boot attempts a top-level SSO redirect (once per tab) to adopt an existing ugly.bot session. Leave unset for `*.ugly.bot` subdomains and Mode B apps. |
489
496
  | `testMode?` | Skip ugly.bot silent SSO and trust the auth cookie the fixture set. Only honored when `UGLY_APP_TEST_MODE=1`. |
490
497
 
491
- `bootstrapApp` reads `window.__AUTH_TOKEN__` (injected by the server
492
- after cookie verification). If absent, it renders unauthenticated
493
- immediately — the router's per-route auth guard surfaces `<AuthRoot>`
494
- only when the user opens a protected route. If the token is present, it
495
- connects the socket, mounts `<AppProvider>`, and renders.
498
+ `bootstrapApp` reads `window.__AUTH_TOKEN__` (injected by the server after
499
+ cookie verification). If absent, it renders unauthenticated immediately — the
500
+ router's per-route auth guard surfaces `<AuthRoot>` only when the user opens a
501
+ protected route. If the token is present, it connects the socket, mounts
502
+ `<AppProvider>`, and renders.
496
503
 
497
504
  After render, a hidden iframe silently calls
498
- `${UGLY_BOT_URL}/oauth/silent`: if it returns a fresh code, the cookie
499
- is refreshed via `POST /auth/verify`; if the returned account differs
500
- from the current session, the page reloads onto the live account
501
- (guarded once per from→to pair to prevent loops). Any
502
- `?ugly_oauth_code=…` in the URL (redirect-fallback OAuth code from
503
- ugly.bot) is redeemed at the top of bootstrap before anything renders.
505
+ `${UGLY_BOT_URL}/oauth/silent`: if it returns a fresh code, the cookie is
506
+ refreshed via `POST /auth/verify`; if the returned account differs from the
507
+ current session, the page reloads onto the live account (guarded once per
508
+ from→to pair to prevent loops). Any `?ugly_oauth_code=…` in the URL
509
+ (redirect-fallback OAuth code from ugly.bot) is redeemed at the top of
510
+ bootstrap before anything renders.
504
511
 
505
- If `bootstrapApp` is loaded at `/auth/magic-link/verify` (Mode B), it
506
- renders `<MagicLinkCallback>` instead of the regular app shell.
512
+ If `bootstrapApp` is loaded at `/auth/magic-link/verify` (Mode B), it renders
513
+ `<MagicLinkCallback>` instead of the regular app shell.
507
514
 
508
515
  ### `AppProvider` & `useApp()`
509
516
 
510
- `bootstrapApp` mounts `<AppProvider>` automatically after socket
511
- connect. Use `useApp()` inside any page to access the active user,
512
- socket, and app-scoped services.
517
+ `bootstrapApp` mounts `<AppProvider>` automatically after socket connect. Use
518
+ `useApp()` inside any page to access the active user, socket, and app-scoped
519
+ services.
513
520
 
514
521
  ```ts
515
522
  const {
@@ -517,28 +524,26 @@ const {
517
524
  user, // UserBase doc
518
525
  socket, // AppSocket — typed RPC client
519
526
  uglyBotSocket, // UglyBotSocket | null — direct platform socket for STT/TTS
520
- showPopup, // flat overlay layer (see note) — returns popup id
521
- hidePopup,
522
- hideAllPopups,
527
+ showPopup, // (content: ReactElement) => id — flat overlay layer (see note)
528
+ hidePopup, // (id: string) => void
529
+ hideAllPopups, // () => void
523
530
  runAsync, // (label, async () => {…}, options?) — shows loading overlay
524
- splashDone, // (step: string) — mark a splash-screen step complete
531
+ splashDone, // (step: string) => void — mark a splash-screen step complete
525
532
  localizer, // (key, params?) => string — alias for useLocalizer()
526
533
  } = useApp();
527
534
  ```
528
535
 
529
- `useApp<TAsyncOptions>()` is generic in the async-options type so apps
530
- can pass a custom option through to a custom `loadingOverlay` element.
531
- `AppProvider` `cloneElement`s the overlay with `{ label, asyncOptions
532
- }` while `runAsync` is pending. `useAppOptional()` returns `null`
533
- outside the provider; `useLocalizer()` returns a localizer that prefers
534
- `<StringsProvider>` data, falls back to the `AppProvider` `localizer`
535
- prop, and finally to identity.
536
+ `useApp<TAsyncOptions>()` is generic in the async-options type so apps can
537
+ pass a custom option through to a custom `loadingOverlay` element. When
538
+ `runAsync` is pending, `AppProvider` `cloneElement`s the overlay with
539
+ `{ label, asyncOptions }`. `useAppOptional()` returns `null` outside the
540
+ provider; `useLocalizer()` prefers `<StringsProvider>` data, falls back to
541
+ the `AppProvider` `localizer` prop, and finally to identity.
536
542
 
537
543
  Two popup APIs coexist: `useRouter().openPopup()` (spring-animated,
538
- dismissible, mode-aware — **the default choice**) and
539
- `useApp().showPopup()` (a flat overlay layer returning a string id, for
540
- content that must sit *outside* the router transition). Prefer the
541
- router's.
544
+ dismissible, mode-aware — **the default choice**) and `useApp().showPopup()`
545
+ (a flat overlay layer returning a string id, for content that must sit
546
+ *outside* the router transition). Prefer the router's.
542
547
 
543
548
  ### Direct socket access
544
549
 
@@ -565,14 +570,14 @@ from `ugly-app/client`.
565
570
  ugly-app uses HttpOnly cookies and server-side JWT injection — no
566
571
  `localStorage`, no client-side token handling.
567
572
 
568
- Two modes, picked from the `auth` block in the project's `.uglyapp`
569
- config:
573
+ Two modes, picked from the `auth` block in the project's `.uglyapp` config:
570
574
 
571
575
  - **Mode A — `mode: 'uglybot'`** (default when no `auth` block is present). Auth is delegated to ugly.bot OAuth. AI / email / push proxies bill the end user's ugly.bot credits.
572
576
  - **Mode B — `mode: 'self'`**. The app issues its own sessions via magic-link email and/or Google OAuth. AI / email / push proxies bill the developer's ugly.bot account using the project's `AI_PROXY_TOKEN`.
573
577
 
574
- `window.__UGLY_APP_AUTH_MODE__` is injected into every page so client
575
- code (incl. `<AuthRoot>`) can branch correctly.
578
+ `window.__UGLY_APP_AUTH_MODE__` is injected into every page so client code
579
+ (incl. `<AuthRoot>`) can branch correctly. In Mode B with Google configured,
580
+ `window.__UGLY_APP_GOOGLE_CLIENT_ID__` is also injected.
576
581
 
577
582
  ### Mode A — ugly.bot OAuth (default)
578
583
 
@@ -584,9 +589,9 @@ code (incl. `<AuthRoot>`) can branch correctly.
584
589
 
585
590
  ### Mode B — self-issued sessions
586
591
 
587
- When `.uglyapp` sets `auth.mode: 'self'`, `buildAuth()` wires the
588
- magic-link provider as primary; if `providers.google.clientId` is
589
- configured it adds Google as an extra provider on the same router.
592
+ When `.uglyapp` sets `auth.mode: 'self'`, `buildAuth()` wires the magic-link
593
+ provider as primary; if `providers.google.clientId` is configured it adds
594
+ Google as an extra provider on the same router.
590
595
 
591
596
  - `<AuthRoot>` renders `<MagicLinkForm>` (plus the Google button when configured) instead of `<LoginPopup>`.
592
597
  - Background ugly.bot silent SSO is a no-op.
@@ -596,9 +601,9 @@ configured it adds Google as an extra provider on the same router.
596
601
 
597
602
  ### Token-in-URL embed
598
603
 
599
- Any GET request with `?token=<JWT>` will, if the token verifies, set
600
- the cookie and 302-redirect to the same URL without the token
601
- parameter — useful for embedding any page in an iframe.
604
+ Any GET request with `?token=<JWT>` will, if the token verifies, set the
605
+ cookie and 302-redirect to the same URL without the token parameter — useful
606
+ for embedding any page in an iframe.
602
607
 
603
608
  ### Built-in auth routes
604
609
 
@@ -632,8 +637,8 @@ configurator.setAuth({
632
637
  ## Database — `TypedDB`
633
638
 
634
639
  Access via `app.db`. All methods accept a `CollectionDef` (from
635
- `defineCollections()`) or, on the `raw*` / `getQuery*` variants, a
636
- plain collection name string.
640
+ `defineCollections()`) or, on the `raw*` / `getQuery*` variants, a plain
641
+ collection name string.
637
642
 
638
643
  ### Writing
639
644
 
@@ -658,10 +663,10 @@ await db.batch(async () => {
658
663
  });
659
664
  ```
660
665
 
661
- Supported update operators: `$inc`, `$addToSet`, `$pull`, `$unset`,
662
- `$set`. All keys are dot-notation, fully typed against the collection's
663
- schema. Partial updates go through optimistic concurrency to prevent
664
- lost updates on concurrent writers.
666
+ Supported update operators: `$inc`, `$addToSet`, `$pull`, `$unset`, `$set`.
667
+ All keys are dot-notation, fully typed against the collection's schema.
668
+ Partial updates go through optimistic concurrency to prevent lost updates
669
+ on concurrent writers.
665
670
 
666
671
  ### Reading
667
672
 
@@ -695,8 +700,8 @@ await db.deleteWhere(collections.note, { userId }); // typed bulk delete
695
700
  await db.deleteQuery(collections.note, { userId }); // legacy untyped bulk delete
696
701
  ```
697
702
 
698
- Pass `deleteHandlers` as the 5th argument to `createApp` to run
699
- per-collection `onDelete` callbacks.
703
+ Pass `deleteHandlers` as the 5th argument to `createApp` to run per-collection
704
+ `onDelete` callbacks.
700
705
 
701
706
  ### Search
702
707
 
@@ -745,10 +750,9 @@ Imports available from `ugly-app`:
745
750
 
746
751
  ## AI providers
747
752
 
748
- AI calls are proxied through ugly.bot — your app never holds a
749
- provider key. Pass `UGLY_BOT_TOKEN` in the environment and the
750
- framework handles routing, balance tracking, retries, and per-user
751
- billing.
753
+ AI calls are proxied through ugly.bot — your app never holds a provider key.
754
+ Pass `UGLY_BOT_TOKEN` in the environment and the framework handles routing,
755
+ balance tracking, retries, and per-user billing.
752
756
 
753
757
  ### Server-side text generation
754
758
 
@@ -770,9 +774,9 @@ const { message } = await uglyBotRequest<{ message: { content: string } }>('text
770
774
  });
771
775
  ```
772
776
 
773
- Available models are exposed via `textGenModels` / `textGenModelData`
774
- from `ugly-app` — the platform supports Claude, GPT, Gemini, Together,
775
- Groq, Fireworks, Kimi, and Kie families.
777
+ Available models are exposed via `textGenModels` / `textGenModelData` from
778
+ `ugly-app` — the platform supports Claude, GPT, Gemini, Together, Groq,
779
+ Fireworks, Kimi, and Kie families.
776
780
 
777
781
  ### Server-side image generation
778
782
 
@@ -783,8 +787,8 @@ const imageGen = createImageGen(userId);
783
787
  const url = await imageGen.generate('A red panda eating noodles', { model: 'flux_schnell' });
784
788
  ```
785
789
 
786
- `imageGenModels` / `imageGenModelData` enumerate available models
787
- (Together FLUX, FAL, Google Imagen, Wavespeed, Kie Kolors).
790
+ `imageGenModels` / `imageGenModelData` enumerate available models (Together
791
+ FLUX, FAL, Google Imagen, Wavespeed, Kie Kolors).
788
792
 
789
793
  ### Embeddings
790
794
 
@@ -809,8 +813,8 @@ await search.enrichNews({ query: 'topic' });
809
813
 
810
814
  ### Client-side AI calls
811
815
 
812
- Calls from React components go through the framework RPC pipeline — no
813
- token plumbing in the browser:
816
+ Calls from React components go through the framework RPC pipeline — no token
817
+ plumbing in the browser:
814
818
 
815
819
  ```ts
816
820
  import { callTextGen, callJsonGen, callImageGen } from 'ugly-app/client';
@@ -822,9 +826,8 @@ const image = await callImageGen({ prompt: 'a corgi astronaut', model: 'flux_sch
822
826
 
823
827
  ### STT / TTS
824
828
 
825
- Speech goes **directly** from the browser to ugly.bot — never proxied
826
- through your app server (see the "STT/TTS routes to ugly.bot" rule in
827
- `CLAUDE.md`).
829
+ Speech goes **directly** from the browser to ugly.bot — never proxied through
830
+ your app server (see the "STT/TTS routes to ugly.bot" rule in `CLAUDE.md`).
828
831
 
829
832
  ```ts
830
833
  import { useSTT, useTTS, AudioPlayer, AudioRecorder } from 'ugly-app/client';
@@ -858,24 +861,23 @@ const { uploadUrl, resultUrl } = await storage.presignedPut('temp', key);
858
861
  await storage.delete('public', destKey);
859
862
  ```
860
863
 
861
- Client-side, use `socket.uploadFile(file, key)` — it requests a
862
- presigned URL via the built-in `uploadUrl` framework request and
863
- streams the upload. In dev, uploads go through a same-origin `/_s3`
864
- proxy to avoid CORS with local MinIO.
864
+ Client-side, use `socket.uploadFile(file, key)` — it requests a presigned URL
865
+ via the built-in `uploadUrl` framework request and streams the upload. In
866
+ dev, uploads go through a same-origin `/_s3` proxy to avoid CORS with local
867
+ MinIO.
865
868
 
866
- `STORAGE_KEY_PREFIX` (env) prefixes all keys — useful for
867
- per-environment isolation.
869
+ `STORAGE_KEY_PREFIX` (env) prefixes all keys — useful for per-environment
870
+ isolation.
868
871
 
869
- On Cloudflare Workers, storage uses the R2 binding directly; presigned
870
- PUTs are not exposed (browser uploads must go through a Worker
871
- endpoint).
872
+ On Cloudflare Workers, storage uses the R2 binding directly; presigned PUTs
873
+ are not exposed (browser uploads must go through a Worker endpoint).
872
874
 
873
875
  ### Static assets — `static/`
874
876
 
875
877
  Large, rarely-changing files (3D models, textures, audio, fonts) go in the
876
878
  project-root `static/` folder. `ugly-app build:static` hashes them and
877
- generates `shared/StaticAssets.ts`; publish uploads only the files whose bytes
878
- changed.
879
+ generates `shared/StaticAssets.ts`; publish uploads only the files whose
880
+ bytes changed.
879
881
 
880
882
  ```ts
881
883
  import { staticUrl } from '../shared/StaticAssets'
@@ -885,15 +887,14 @@ const url = staticUrl('models/char2.ugm')
885
887
  ```
886
888
 
887
889
  The bucket gets its own custom domain, so **Cloudflare's CDN serves these
888
- directly** — no Worker invocation per request, and R2 answers `Range` natively
889
- for progressive loaders. (A Worker reading through the R2 binding bypasses the
890
- edge cache, which is why these do not go through it.) Publish also sets the
891
- bucket CORS policy and a `Cross-Origin-Resource-Policy: cross-origin` response
892
- rule, without which COEP `require-corp` would silently block them.
890
+ directly** — no Worker invocation per request, and R2 answers `Range`
891
+ natively for progressive loaders. Publish also sets the bucket CORS policy
892
+ and a `Cross-Origin-Resource-Policy: cross-origin` response rule, without
893
+ which COEP `require-corp` would silently block them.
893
894
 
894
895
  Unlike `/{buildId}/assets/*`, these URLs do not change when you deploy, so
895
- returning users do not re-download unchanged files. Assets that no build from
896
- the last `retentionDays` (default 7) references are deleted from R2
896
+ returning users do not re-download unchanged files. Assets that no build
897
+ from the last `retentionDays` (default 7) references are deleted from R2
897
898
  automatically, along with expired `builds/` prefixes.
898
899
 
899
900
  Requires a provisioned app domain — publish fails rather than emitting URLs
@@ -903,8 +904,8 @@ nothing serves. Configure in `.uglyapp`:
903
904
  "staticAssets": { "dir": "static", "retentionDays": 7 }
904
905
  ```
905
906
 
906
- Dev serves the same files off disk at same-origin, so a newly added asset works
907
- before it has ever been published.
907
+ Dev serves the same files off disk at same-origin, so a newly added asset
908
+ works before it has ever been published.
908
909
 
909
910
  ### `hostBundle` — serve the vite bundle from the CDN too
910
911
 
@@ -919,19 +920,20 @@ prefixed, a byte-identical chunk keeps its URL across deploys — so returning
919
920
  users re-download only what actually changed, and each deploy uploads a
920
921
  handful of KB instead of the whole bundle.
921
922
 
922
- The first deploy only provisions; the bundle moves to the CDN on the next one.
923
- That is deliberate — a single pass would point the bundle at a hostname whose
924
- TLS certificate may not have issued yet.
925
-
926
- **Workers are handled for you, but know why.** The bundle is then cross-origin,
927
- and `new Worker(url)` *rejects a cross-origin script URL outright* — that is
928
- structural, and no CORS or CORP header lifts it. `bootstrapApp` installs a
929
- shim that routes such URLs through a same-origin `blob:` importing the real
930
- script, so `new Worker(new URL('./x.worker.ts', import.meta.url))` keeps
931
- working. `SharedWorker` is **not** shimmed: every blob URL is unique, so the
932
- same trick would give each caller a private worker and break sharing. Register
933
- service workers by root-absolute path (`/sw.js`) — `register()` resolves
934
- against the document, so those stay same-origin.
923
+ The first deploy only provisions; the bundle moves to the CDN on the next
924
+ one. That is deliberate — a single pass would point the bundle at a hostname
925
+ whose TLS certificate may not have issued yet.
926
+
927
+ **Workers are handled for you, but know why.** The bundle is then
928
+ cross-origin, and `new Worker(url)` *rejects a cross-origin script URL
929
+ outright* — that is structural, and no CORS or CORP header lifts it.
930
+ `bootstrapApp` installs a shim that routes such URLs through a same-origin
931
+ `blob:` importing the real script, so `new Worker(new URL('./x.worker.ts',
932
+ import.meta.url))` keeps working. `SharedWorker` is **not** shimmed: every
933
+ blob URL is unique, so the same trick would give each caller a private
934
+ worker and break sharing. Register service workers by root-absolute path
935
+ (`/sw.js`) — `register()` resolves against the document, so those stay
936
+ same-origin.
935
937
 
936
938
  ---
937
939
 
@@ -963,16 +965,15 @@ const cronHandlers: WorkerHandlers<typeof cronTasks> = {
963
965
  configurator.setWorkers(cronTasks, cronHandlers);
964
966
  ```
965
967
 
966
- Each worker can have `inputSchema`, `outputSchema`, `schedule`,
967
- `timeout`, `description`. Workers without a schedule are still
968
- invocable via `POST /_workers/run` (auth: localhost in dev,
969
- `Authorization: Bearer $CRON_SECRET` in prod). Scheduled workers also
970
- appear in `/_cron/manifest` for the deploy orchestrator.
968
+ Each worker can have `inputSchema`, `outputSchema`, `schedule`, `timeout`,
969
+ `description`. Workers without a schedule are still invocable via
970
+ `POST /_workers/run` (auth: localhost in dev, `Authorization: Bearer $CRON_SECRET`
971
+ in prod). Scheduled workers also appear in `/_cron/manifest` for the deploy
972
+ orchestrator.
971
973
 
972
- On the Workers adapter, scheduled workers dispatch through Cloudflare
973
- Cron Triggers and durable queueing goes through Cloudflare Queues. On
974
- the Node adapter, `enqueueWorker` runs the handler inline (in-process
975
- queues only).
974
+ On the Workers adapter, scheduled workers dispatch through Cloudflare Cron
975
+ Triggers and durable queueing goes through Cloudflare Queues. On the Node
976
+ adapter, `enqueueWorker` runs the handler inline (in-process queues only).
976
977
 
977
978
  ---
978
979
 
@@ -987,9 +988,9 @@ configurator.setStrings({
987
988
  });
988
989
  ```
989
990
 
990
- The framework injects `window.__LANG__`, `window.__STRINGS_VERSION__`,
991
- and `window.__CRITICAL_STRINGS__` into SSR HTML. Use `useLocalizer()`
992
- / `useStrings()` / `useLang()` / `useChangeLanguage()` on the client.
991
+ The framework injects `window.__LANG__`, `window.__STRINGS_VERSION__`, and
992
+ `window.__CRITICAL_STRINGS__` into SSR HTML. Use `useLocalizer()` /
993
+ `useStrings()` / `useLang()` / `useChangeLanguage()` on the client.
993
994
 
994
995
  ---
995
996
 
@@ -1014,10 +1015,9 @@ export const experiments: Experiment[] = [
1014
1015
  configurator.setExperiments(experiments);
1015
1016
  ```
1016
1017
 
1017
- Bucketing is deterministic: `hash(experimentId + userId)` (or
1018
- `sessionId` for unauthenticated users). The framework's `initSession`
1019
- / `captureEvent` requests automatically tag events with the user's
1020
- branch assignments.
1018
+ Bucketing is deterministic: `hash(experimentId + userId)` (or `sessionId`
1019
+ for unauthenticated users). The framework's `initSession` / `captureEvent`
1020
+ requests automatically tag events with the user's branch assignments.
1021
1021
 
1022
1022
  ---
1023
1023
 
@@ -1043,17 +1043,15 @@ branch assignments.
1043
1043
 
1044
1044
  ## Two-adapter architecture
1045
1045
 
1046
- The same developer source compiles for two runtimes via
1047
- `src/server/adapter/`:
1046
+ The same developer source compiles for two runtimes via `src/server/adapter/`:
1048
1047
 
1049
1048
  - **Adapter A — Node + TCP** (`src/server/adapter/node/`): default for `npm run dev` and any non-Workers deploy. Wraps `pg.Pool`, `nats.js`, AWS S3 SDK.
1050
1049
  - **Adapter B — Cloudflare Workers** (`src/server/adapter/workers/`): used when the Studio publish flow deploys to Cloudflare. Hono router + Durable Objects (one `CollectionDO` per project-collection, plus a `SessionDO` per user WS) + `@neondatabase/serverless` HTTP driver + R2 binding + Cloudflare Cron Triggers + Cloudflare Queues.
1051
1050
 
1052
- Developer-facing APIs (`createTypedDB`, `subscribeDoc`,
1053
- `createStorageClient`, `setCronTasks`, `setWorkers`) don't change
1054
- between adapters. Local Workers dev boots via `npm run dev:workers`,
1055
- which starts a small Node HTTP proxy speaking Neon's wire format so
1056
- the Worker can talk to a real Postgres.
1051
+ Developer-facing APIs (`createTypedDB`, `subscribeDoc`, `createStorageClient`,
1052
+ `setCronTasks`, `setWorkers`) don't change between adapters. Local Workers dev
1053
+ boots via `npm run dev:workers`, which starts a small Node HTTP proxy speaking
1054
+ Neon's wire format so the Worker can talk to a real Postgres.
1057
1055
 
1058
1056
  ---
1059
1057
 
@@ -1108,8 +1106,8 @@ Browser-visible variables must be prefixed `VITE_` and consumed via
1108
1106
  | `ugly-app feedback:dev` / `feedback:prod` | Query user feedback. |
1109
1107
  | `ugly-app feedback:submit` / `feedback:resolve` | Manage feedback (run with `--help` for flags). |
1110
1108
 
1111
- Inside a scaffolded project, the same commands are available via `npm
1112
- run …` scripts — see `templates/CLAUDE.md`.
1109
+ Inside a scaffolded project, the same commands are available via `npm run …`
1110
+ scripts — see `templates/CLAUDE.md`.
1113
1111
 
1114
1112
  ---
1115
1113