ugly-app 0.1.871 → 0.1.873

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 (54) hide show
  1. package/README.md +58 -97
  2. package/dist/agent/client/runAgent.d.ts +9 -2
  3. package/dist/agent/client/runAgent.d.ts.map +1 -1
  4. package/dist/agent/client/runAgent.js +8 -1
  5. package/dist/agent/client/runAgent.js.map +1 -1
  6. package/dist/cli/version.d.ts +1 -1
  7. package/dist/cli/version.js +1 -1
  8. package/dist/native/server/taskHost/index.d.ts +11 -0
  9. package/dist/native/server/taskHost/index.d.ts.map +1 -0
  10. package/dist/native/server/taskHost/index.js +14 -0
  11. package/dist/native/server/taskHost/index.js.map +1 -0
  12. package/dist/native/server/taskHost/process-reaper.d.ts +51 -0
  13. package/dist/native/server/taskHost/process-reaper.d.ts.map +1 -0
  14. package/dist/native/server/taskHost/process-reaper.js +127 -0
  15. package/dist/native/server/taskHost/process-reaper.js.map +1 -0
  16. package/dist/native/server/taskHost/taskChild.d.ts +28 -0
  17. package/dist/native/server/taskHost/taskChild.d.ts.map +1 -0
  18. package/dist/native/server/taskHost/taskChild.js +224 -0
  19. package/dist/native/server/taskHost/taskChild.js.map +1 -0
  20. package/dist/native/server/taskHost/taskCpuTree.mjs +49 -0
  21. package/dist/native/server/taskHost/taskHostTypes.d.ts +17 -0
  22. package/dist/native/server/taskHost/taskHostTypes.d.ts.map +1 -0
  23. package/dist/native/server/taskHost/taskHostTypes.js +4 -0
  24. package/dist/native/server/taskHost/taskHostTypes.js.map +1 -0
  25. package/dist/native/server/taskHost/taskManager.d.ts +203 -0
  26. package/dist/native/server/taskHost/taskManager.d.ts.map +1 -0
  27. package/dist/native/server/taskHost/taskManager.js +356 -0
  28. package/dist/native/server/taskHost/taskManager.js.map +1 -0
  29. package/dist/native/server/taskHost/taskRunner.mjs +359 -0
  30. package/dist/playwright/real-native.d.ts +23 -5
  31. package/dist/playwright/real-native.d.ts.map +1 -1
  32. package/dist/playwright/real-native.js +76 -7
  33. package/dist/playwright/real-native.js.map +1 -1
  34. package/dist/server/adapter/workers/createWorkersApp.js +17 -0
  35. package/dist/server/adapter/workers/createWorkersApp.js.map +1 -1
  36. package/dist/shared/ProxyOps.d.ts +2 -0
  37. package/dist/shared/ProxyOps.d.ts.map +1 -1
  38. package/dist/shared/TextGen.d.ts +12 -1
  39. package/dist/shared/TextGen.d.ts.map +1 -1
  40. package/dist/shared/TextGen.js +3 -0
  41. package/dist/shared/TextGen.js.map +1 -1
  42. package/package.json +2 -2
  43. package/src/agent/client/runAgent.ts +19 -3
  44. package/src/cli/version.ts +1 -1
  45. package/src/native/server/taskHost/index.ts +19 -0
  46. package/src/native/server/taskHost/process-reaper.ts +152 -0
  47. package/src/native/server/taskHost/taskChild.ts +268 -0
  48. package/src/native/server/taskHost/taskCpuTree.mjs +49 -0
  49. package/src/native/server/taskHost/taskHostTypes.ts +21 -0
  50. package/src/native/server/taskHost/taskManager.ts +522 -0
  51. package/src/native/server/taskHost/taskRunner.mjs +359 -0
  52. package/src/playwright/real-native.ts +242 -121
  53. package/src/server/adapter/workers/createWorkersApp.ts +22 -0
  54. package/src/shared/TextGen.ts +16 -1
package/README.md CHANGED
@@ -2,18 +2,18 @@
2
2
 
3
3
  A full-stack TypeScript framework for shipping production web apps with one CLI. Scaffold with `npx ugly-app init my-app` and get an opinionated Express + React + PostgreSQL stack with built-in auth, type-safe RPC over WebSocket and HTTP, real-time document tracking, AI generation, storage, and a CLI for every workflow.
4
4
 
5
- ugly-app is designed to be deployed and operated through [ugly.bot](https://ugly.bot) — the platform handles auth, infra (PostgreSQL, Qdrant, NATS, S3-compatible object storage), AI provider keys, and deployment. Your app talks to all of it through the project's dev tunnel and the per-app `UGLY_BOT_TOKEN`.
5
+ ugly-app is designed to be deployed and operated through [ugly.bot](https://ugly.bot) — the platform handles auth, infra (PostgreSQL, Qdrant, NATS, S3-compatible object storage), AI provider keys, and deployment. Your app talks to all of this through the project's dev tunnel and the per-app `UGLY_BOT_TOKEN`.
6
6
 
7
7
  ## What's included
8
8
 
9
9
  - **Server**: Express + WebSocket with type-safe RPC and Zod validation
10
10
  - **Client**: React + Vite with typed routing, lazy pages, animated transitions, popup management
11
11
  - **Database**: PostgreSQL (JSONB) via the data proxy, with full-text search (`search`) and vector search (Qdrant `vector`)
12
- - **Auth**: HttpOnly cookies + JWT, ugly.bot OAuth out of the box, magic-link + Google when self-hosting sessions
12
+ - **Auth**: HttpOnly cookies + JWT, ugly.bot OAuth out of the box, extensible via `AuthProvider`
13
13
  - **AI**: Text, image, embeddings, web search — all proxied through ugly.bot (no per-provider keys in your app)
14
- - **Realtime**: NATS pub/sub and live document subscriptions (`trackDoc` / `trackDocs`)
14
+ - **Realtime**: NATS pub/sub and document change subscriptions (`trackDoc` / `trackDocs`)
15
15
  - **Storage**: S3-compatible buckets with presigned uploads
16
- - **Workers & cron**: `setWorkers()` registers named async tasks with optional Zod schemas and cron schedules
16
+ - **Workers & cron**: `setWorkers()` registers named async tasks with optional Zod input schemas and cron schedules
17
17
  - **Localization**: Strings tables with critical-string SSR injection
18
18
  - **Experiments**: Deterministic A/B bucketing tied to event logging
19
19
  - **CLI**: `ugly-app` commands for dev, build, deploy, migrations, logs, AI, and auth
@@ -26,7 +26,7 @@ cd my-app
26
26
  npm run dev
27
27
  ```
28
28
 
29
- The scaffold gives you a working app at `http://localhost:4321` with todo CRUD, AI chat, file upload, auth demo, collab editing, and ~20 other test pages.
29
+ The scaffold gives you a working app at `http://localhost:4321` with todo CRUD, AI chat, file upload, auth demo, collab editing, and ~20 other test pages wired up.
30
30
 
31
31
  ---
32
32
 
@@ -70,24 +70,24 @@ await app.start(parseInt(process.env['PORT'] ?? '4321'));
70
70
 
71
71
  ```typescript
72
72
  function createApp<R extends AppRegistryBase, Defs extends CollectionDefRegistry>(
73
- registry: R, // { requests, messages, pages? }
73
+ registry: R, // { requests, messages }
74
74
  requests: Partial<RequestHandlers<R['requests']>>, // handler implementations
75
75
  appDefs: Defs, // collections from defineCollections()
76
76
  configure?: (c: AppConfigurator) => void,
77
77
  deleteHandlers?: DeleteHandlers<Defs>, // per-collection onDelete hooks
78
- ): App<CollectionMap<typeof BUILTIN_DEFS & Defs>, RegistryPages<R>>;
78
+ ): App<CollectionMap<typeof BUILTIN_DEFS & Defs>>;
79
79
  ```
80
80
 
81
- The returned `App`:
81
+ The returned `App` object has:
82
82
  - `start(port?)` — start the server (default port 3000; templates use 4321)
83
83
  - `db` — the `TypedDB` instance
84
84
  - `httpServer` — the underlying Node `http.Server`
85
85
  - `wss` — the main `WebSocketServer` (path set by `setWsPath`, default `/rpc`)
86
86
  - `dispatch(name, input, userId)` — invoke an RPC handler programmatically
87
- - `registerRoutes(fn)` — mount additional Express routes after creation
88
- - `pushSend({ userId, page, query, ...notification })` — send a push notification whose click-through target is a route in this app's `pages` table. `page` is type-checked against route keys (when `pages` is on the createApp registry), `query` against that route's params.
87
+ - `registerRoutes(fn)` — mount more Express routes after creation
88
+ - `pushSend({ userId, page, query, ...notification })` — send a push notification whose click-through target is a route from this app's `pages` table. `page` is type-checked against route keys (when `pages` is provided on the createApp registry), `query` against that route's params. The framework builds the absolute URL and stamps project identity so the client can open the dock app.
89
89
 
90
- Framework-managed background services start automatically: schema drift check, NATS connection + KV buckets (`TTS`, `RATELIMIT`), data-proxy connection, event counter flush, TTL cleanup for log tables, console/error capture, and ugly.bot log forwarding.
90
+ Framework-managed background services start automatically: schema drift check, NATS connection + KV buckets (`TTS`, `RATELIMIT`), data-proxy connection, event counter flush, TTL cleanup for log tables, console / error capture, and ugly.bot log forwarding.
91
91
 
92
92
  ### `AppConfigurator`
93
93
 
@@ -95,23 +95,23 @@ Passed to the optional fourth argument of `createApp`. Every method is optional.
95
95
 
96
96
  | Method | Description |
97
97
  |--------|-------------|
98
- | `setPages({ pages, renderPage?, clientDistPath? })` | Mount the SPA. In dev runs Vite in middleware mode; in prod serves `dist/client`. Provide `renderPage` to SSR routes with `ssr: true`. |
99
- | `setUserHelper(helper)` | Customize how the framework reads/writes the `user` collection during WebSocket auth. |
100
- | `setOnUserCreate(handler)` | Called on first login with `(userId, { email?, phone? }, db)`. |
101
- | `setAuth(provider)` | Replace the default auth provider (must implement `verify(code)` and `authUrl(origin)`). |
98
+ | `setPages({ pages, renderPage?, clientDistPath? })` | Mount the SPA. In dev, runs Vite in middleware mode; in prod, serves `dist/client`. Provide `renderPage` for SSR on pages with `ssr: true`. |
99
+ | `setUserHelper(helper)` | Customize how the framework reads / writes the `user` collection during WebSocket auth (default looks up by id in a generic `user` collection). |
100
+ | `setOnUserCreate(handler)` | Called on first login with `(userId, { email?, phone? }, db)` — your chance to create the user record. |
101
+ | `setAuth(provider)` | Replace the default ugly.bot OAuth provider. Must implement `verify(code)` and `authUrl(origin)`. |
102
102
  | `setOnSocketMessage(handler)` | Single raw-WebSocket message handler. Return `true` to consume, `false` to fall through. |
103
103
  | `addSocketMessageHandler(handler)` | Append to the handler chain; first to return `true` wins. |
104
104
  | `setWsPath(path)` | Override the WebSocket path (default `/rpc`). |
105
105
  | `setOnWsAuth(handler)` | `(ws, userId, req) => void` — fires after a socket session authenticates. |
106
106
  | `setOnAfterStart(handler)` | `(db) => Promise<void>` — called once after data-proxy + NATS are ready. |
107
- | `setOnMinuteTick(fn)` / `setOnHourlyTick(fn)` | Periodic callbacks. Only fire when `CLOCK_ENABLED=true`. |
107
+ | `setOnMinuteTick(fn)` / `setOnHourlyTick(fn)` | Framework-managed periodic callbacks. Only fire when `CLOCK_ENABLED=true`. |
108
108
  | `setHealthHandler(fn)` | Override the default `GET /health` response. |
109
109
  | `setExperiments(experiments)` | Register `Experiment` definitions for `initSession` / `captureEvent` bucketing. |
110
- | `setIsAdmin(fn)` | `(userId, db) => boolean \| Promise<boolean>` — gate for admin-only framework requests. Defaults to matching `MAINTAIN_BOT_USER_ID`. |
111
- | `setOnEmail(handler)` | Handle inbound emails routed to `{domain}@ugly.bot`. |
110
+ | `setIsAdmin(fn)` | `(userId, db) => boolean \| Promise<boolean>` — gate for admin-only framework requests (`adminCreateTestUser` / `list` / `delete`). Defaults to matching `MAINTAIN_BOT_USER_ID`. |
111
+ | `setOnEmail(handler)` | Handle inbound emails routed to `{domain}@ugly.bot` (called via internal HTTP). |
112
112
  | `setCronTasks(tasks, handlers)` | Legacy cron-only registry. Prefer `setWorkers()`. |
113
113
  | `setWorkers(workers, handlers)` | Register named async tasks with optional Zod input schema and cron schedule. Powers `/_workers/manifest`, `POST /_workers/run`, and the cron orchestrator. |
114
- | `setStrings(config)` | Localization config — framework injects language + critical strings into SSR HTML. |
114
+ | `setStrings(config)` | Localization config — framework injects language + critical strings into SSR HTML and exposes `resolveLanguage` / `getCriticalStrings`. |
115
115
  | `registerRoutes(fn)` | Mount custom Express routes. |
116
116
  | `setWorkerQueue(queue)` | Register a `WorkerQueue` with `start()` / `stop()` for app lifecycle management. |
117
117
 
@@ -131,7 +131,7 @@ Inside a handler, access state via captured imports — `app.db`, `storage`, `pg
131
131
 
132
132
  ### Built-in framework requests
133
133
 
134
- `createApp` automatically registers several framework handlers, reachable from any client via the normal RPC pipeline:
134
+ `createApp` automatically registers several framework handlers, accessible from any client via the normal RPC pipeline:
135
135
 
136
136
  | Name | Purpose |
137
137
  |------|---------|
@@ -141,10 +141,10 @@ Inside a handler, access state via captured imports — `app.db`, `storage`, `pg
141
141
  | `textGen` / `imageGen` | AI proxies — server-validated, billed through ugly.bot. |
142
142
  | `kagiSearch` / `kagiSummarize` / `kagiEnrichWeb` / `kagiEnrichNews` | Web search via ugly.bot. |
143
143
  | `uploadUrl` | Issues a presigned PUT for the `temp` bucket. |
144
- | `shareLink` | Mint a `https://ugly.bot/l/<code>` short link with OpenGraph metadata. |
145
- | `feedbackReportCreateNoAuth` / `errorLogCaptureNoAuth` | Same-origin, public endpoints used by the built-in browser telemetry. |
144
+ | `shareLink` | Mint a `https://ugly.bot/l/<code>` short link with OG metadata (see the "sharing links" rule in `CLAUDE.md`). |
145
+ | `feedbackReportCreateNoAuth` / `errorLogCaptureNoAuth` | Same-origin, public endpoints used by the built-in browser telemetry (feedback + client-side error capture) to write into the project's own Postgres. |
146
146
  | `submitFeedbackBot` | Forwards `db.captureFeedback` writes for the maintain-bot persona. |
147
- | `feedbackReportResolve` | Admin-only — resolve or decline a feedback report. |
147
+ | `feedbackReportResolve` | Admin-only — resolve or decline a feedback report (Workers-only via D1 telemetry). |
148
148
  | `adminCreateTestUser` / `adminListTestUsers` / `adminDeleteTestUser` | Admin-only — synthetic-user management. Gated by `setIsAdmin()` (or `MAINTAIN_BOT_USER_ID`). |
149
149
 
150
150
  App-provided handlers with the same name override the framework's defaults.
@@ -161,7 +161,7 @@ App-provided handlers with the same name override the framework's defaults.
161
161
  import { authReq, defineRequests, req, z } from 'ugly-app/shared';
162
162
 
163
163
  export const requests = defineRequests({
164
- // Public — handler: (userId: string | null, input) => Promise<output>
164
+ // Public — handler signature: (userId: string | null, input) => Promise<output>
165
165
  getPublicData: req({
166
166
  input: z.object({ id: z.string() }),
167
167
  output: z.object({ data: z.string() }),
@@ -173,7 +173,7 @@ export const requests = defineRequests({
173
173
  output: z.object({ userId: z.string(), email: z.string().optional() }),
174
174
  }),
175
175
 
176
- // Per-endpoint rate limiting (enforced before handler runs)
176
+ // With per-endpoint rate limiting (enforced before handler runs)
177
177
  submitFeedback: authReq({
178
178
  input: z.object({ type: z.enum(['bug', 'design', 'feature']), message: z.string() }),
179
179
  output: z.object({ id: z.string() }),
@@ -214,9 +214,9 @@ export const collections = defineCollections({
214
214
  - `search?: { fields, language? }` — PostgreSQL full-text search columns.
215
215
  - `vector?: { dimensions, source }` — Qdrant vector index over the named JSONB path.
216
216
 
217
- All documents extend `DBObject`: `{ _id, version, created, updated }`. Use `dbDefaults()` to stamp `version`/`created`/`updated` on inserts, and `nanoid()` for `_id` — never `crypto.randomUUID()`, `Date.now()`, or a counter.
217
+ All documents extend `DBObject`: `{ _id, version, created, updated }`. Use `dbDefaults()` to stamp the latter three on inserts.
218
218
 
219
- After schema changes, run `npm run db:schema-gen` then `npm run db:migrate`. The app refuses to start when drift is detected (set `SCHEMA_CHECK_SKIP=true` only as a last resort).
219
+ After schema changes, run `npm run db:schema-gen` and then `npm run db:migrate`. The app refuses to start when drift is detected (set `SCHEMA_CHECK_SKIP=true` only as a last resort).
220
220
 
221
221
  ### Pages (`shared/pages.ts`)
222
222
 
@@ -233,7 +233,7 @@ export type AppPages = typeof pages;
233
233
  ```
234
234
 
235
235
  - `:param` matches a single path segment; `*param` is greedy (captures slashes).
236
- - The generic on `definePage<Params>()` is **phantom** — never set at runtime, used purely for client-side type inference.
236
+ - The generic on `definePage<Params>()` is **phantom** — never set at runtime, used for client-side type inference.
237
237
  - `auth` defaults to `true`. `ssr` defaults to `false`. `{ auth: true, ssr: true }` is dropped to `ssr: false` with a warning — SSR output is served from a shared edge cache and must not depend on the viewer.
238
238
  - `cacheQuery?: string[]` — query params that participate in the SSR edge-cache key. Unlisted params bypass the cache rather than poison it (e.g. `cacheQuery: ['q']` on a search page).
239
239
  - `ssrCacheTimeout?: number` — override the default 1-year edge TTL for pages whose content drifts between deploys.
@@ -270,12 +270,12 @@ bootstrapApp({
270
270
  | `messages?` | Your `MessageRegistry` (merged with framework messages). |
271
271
  | `RouterProvider` | The `RouterProvider` returned from `createRouter()`. |
272
272
  | `render` | Callback returning the app's UI tree (typically `<RouterView />`). |
273
- | `root?` | Root element / CSS selector (default `'#root'`). |
274
- | `fallback?` | UI for unmatched routes (default: a tiny 404). |
273
+ | `root?` | Root element / selector (default `'#root'`). |
274
+ | `fallback?` | UI for unmatched routes (default: tiny "404"). |
275
275
  | `socketUrl?` | Override the WebSocket path (default `/rpc`). |
276
- | `strings?` | Localization config — wraps the tree with `<StringsProvider>` when present. |
276
+ | `strings?` | Localization config — when present, wraps the tree with `<StringsProvider>`. |
277
277
  | `keyboard?: false` | Disable the framework `<KeyboardProvider>` wrapper. |
278
- | `silentSso?` | Apex-domain apps (ugly.chat, ugly.press, …) that use ugly.bot as their auth authority but don't share its cookie. When true, a logged-out boot attempts a non-blocking top-level SSO redirect to adopt an existing ugly.bot session. Leave unset for `*.ugly.bot` subdomains and Mode B apps. |
278
+ | `silentSso?` | Apex-domain apps (ugly.chat, ugly.press, …) that use ugly.bot as their auth authority but don't share its cookie. When true, a logged-out boot attempts a non-blocking top-level SSO redirect to adopt an existing ugly.bot session. Leave unset for `*.ugly.bot` subdomains and Mode B (self-auth) apps. |
279
279
 
280
280
  `bootstrapApp` reads `window.__AUTH_TOKEN__` (injected by the server after cookie verification). If absent, it renders unauthenticated immediately — the router's per-route auth guard surfaces the framework's `<AuthRoot>` (Mode A → `<LoginPopup>`; Mode B → magic-link form + optional Google button) when a user opens a protected route. If the token is present, it connects the socket, mounts `<AppProvider>`, and renders.
281
281
 
@@ -291,7 +291,7 @@ import { createRouter } from 'ugly-app/client';
291
291
  import { pages } from '../shared/pages';
292
292
  import { allPages } from './allPages';
293
293
 
294
- export const { RouterProvider, RouterView, useRouter, Link, setAllPages } = createRouter({
294
+ export const { RouterProvider, RouterView, useRouter } = createRouter({
295
295
  pages,
296
296
  allPages,
297
297
  });
@@ -301,27 +301,12 @@ Config: `pages` (required), `allPages?` (lazy route → element map; may be regi
301
301
 
302
302
  `createRouter` returns:
303
303
 
304
- - **`RouterProvider`** — props: `children`, `fallback?`, `isAuthenticated?`, `initialUrl?` (`{ pathname, search }`; required for SSR, used on the client during hydration so the first render matches the server's). Manages route state, browser history, and the popup layer. When `isAuthenticated()` returns false and the current route declares `auth: true`, the framework's `<AuthRoot>` renders synchronously in place of the page — apps cannot override this fallback.
304
+ - **`RouterProvider`** — props: `children`, `fallback?`, `isAuthenticated?`, `initialUrl?` (`{ pathname, search }`; required for SSR, used on the client during hydration so the first render matches the server's). Manages route state, browser history, and the popup layer. When `isAuthenticated()` returns false and the current route declares `auth: true`, the framework's `<AuthRoot>` renders in place of the page synchronously — apps cannot override this fallback. (Silent SSO happens in `bootstrapApp`, not in the router — the previous first-paint-blocking `<AutoLoginGate>` iframe was removed so logged-out landing pages paint immediately.)
305
305
  - **`RouterView`** — renders the active page with animated transitions. Props: `durationMs?`, `easing?`, `transitionComponent?` (replaces `ViewFlipper`), `renderPage?` (sync alternative to `allPages` loaders, called with `RouterStateRaw`).
306
306
  - **`useRouter()`** — returns the router context (see below).
307
307
  - **`Link`** — typed SPA link bound to this router's pages. 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 the usual anchor attrs.
308
308
  - **`setAllPages(map)`** — register the lazy `PageMap<Pages>` after construction (typically from the browser entry). Lets the Worker bundle skip every lazy page's import graph while the client still gets code-split routes.
309
309
 
310
- ### `definePage` — page metadata
311
-
312
- Re-exported from `ugly-app/shared`. Runtime shape:
313
-
314
- ```typescript
315
- interface PageMeta {
316
- auth: boolean; // default: true
317
- ssr: boolean; // default: false
318
- cacheQuery?: string[]; // edge-cache key participants
319
- ssrCacheTimeout?: number; // seconds; default 31_536_000 (1yr)
320
- }
321
- ```
322
-
323
- The `<Params>` generic on `definePage<Params>()` is a phantom type — used only by TypeScript for route-param inference in `useRouter()`, `Link`, and `pushSend`.
324
-
325
310
  ### Page map — `lazyPage` / `lazyPageLoader`
326
311
 
327
312
  ```typescript
@@ -340,8 +325,6 @@ export const allPages = {
340
325
  - **`lazyPage(factory)`** — lazy-imports a default-exported `React.ComponentType<Params>`. The page receives route params as props.
341
326
  - **`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.
342
327
 
343
- Both wrap the `import()` in a one-shot reload guard: on a stale-deploy chunk 404 the framework reloads the page once (guarded by sessionStorage) so cached `index.html` picks up the new chunk hashes instead of wedging the SPA.
344
-
345
328
  Example loader:
346
329
 
347
330
  ```typescript
@@ -375,11 +358,11 @@ current.routeName; // typed union of all route keys
375
358
  current.params; // typed params for the current route
376
359
  ```
377
360
 
378
- All route names and params are fully typed against `pages`. Internally `push` / `replace` log a `console.error` (no-op) when `buildUrl()` produces a URL that doesn't match a registered route.
361
+ All route names and params are fully typed against `pages`. Internally `push` / `replace` are no-ops when `buildUrl()` produces a URL that doesn't match a registered route (and emit a `console.error`).
379
362
 
380
363
  ### Popups — `openPopup()`
381
364
 
382
- Always use `useRouter().openPopup()` for modals, sheets, and menus. The router owns the popup layer, drives the spring animation, and stacks popups z-index-correctly.
365
+ Always use `useRouter().openPopup()` for modals, sheets, and menus. The router owns the popup layer, manages the spring animation, and stacks popups z-index-correctly.
383
366
 
384
367
  ```tsx
385
368
  const { openPopup } = useRouter();
@@ -391,7 +374,7 @@ const handle = openPopup(<MyContent />, {
391
374
  containerStyle: { /* CSS for the content wrapper */ },
392
375
  backgroundStyle: { /* CSS for the backdrop */ },
393
376
  animConfig: { duration: 300, easing: myEasingFn },
394
- renderLayer: (props) => <CustomLayer {...props} />, // fully replace the layer
377
+ renderLayer: (props) => <CustomLayer {...props} />, // fully replace the layer renderer
395
378
  });
396
379
 
397
380
  handle.hide(); // dismiss programmatically
@@ -406,7 +389,7 @@ Modes:
406
389
 
407
390
  ### `AppProvider` & `useApp()`
408
391
 
409
- `bootstrapApp` mounts `<AppProvider>` automatically after the socket connects. Use `useApp()` inside any page to reach the active user and socket:
392
+ `bootstrapApp` mounts `<AppProvider>` automatically after socket connect. Use `useApp()` inside any page to access the active user and socket.
410
393
 
411
394
  ```typescript
412
395
  const {
@@ -417,20 +400,21 @@ const {
417
400
  showPopup, // legacy popup API (prefer useRouter().openPopup)
418
401
  hidePopup,
419
402
  hideAllPopups,
420
- runAsync, // runAsync(label, async () => {...}, options?) — shows loading overlay while pending
403
+ runAsync, // runAsync(label, async () => { ... }, options?) — shows loading overlay while pending
421
404
  splashDone, // mark a splash-screen step complete
422
- localizer, // (key, params?) => string
405
+ localizer, // (key, params?) => string — alias for useLocalizer
423
406
  } = useApp();
424
407
  ```
425
408
 
426
- `useApp` is generic in `TAsyncOptions` so apps can pass an option type through to a custom `loadingOverlay` element. `useAppOptional()` returns `null` outside the provider; `useLocalizer()` prefers `<StringsProvider>` data, falls back to the `AppProvider` localizer prop, and finally to identity.
409
+ `useApp` is generic in `TAsyncOptions` so apps can pass an option type through to a custom `loadingOverlay` element. `useAppOptional()` returns `null` outside the provider; `useLocalizer()` returns a localizer that prefers `<StringsProvider>` data, falls back to the `AppProvider` localizer prop, and finally to identity.
427
410
 
428
411
  ### `Link` component
429
412
 
430
- Prefer the typed `Link` returned by `createRouter()` — no `router` prop, `to` / `params` checked against your pages, uses the enclosing `<RouterProvider>` context automatically.
413
+ Prefer the typed `Link` returned by `createRouter()` — no `router` prop, `to` / `params` are checked against your pages, and it uses the enclosing `<RouterProvider>` context automatically.
431
414
 
432
415
  ```tsx
433
416
  // Typed Link — from your `client/router.ts`
417
+ const { Link } = createRouter({ pages, allPages });
434
418
  <Link to="user/:userId" params={{ userId: '123' }}>View profile</Link>
435
419
  ```
436
420
 
@@ -447,7 +431,7 @@ Never use a bare `<a href="/route">` for internal navigation — it triggers a f
447
431
  | `request(name, input)` | Invoke a typed RPC handler. |
448
432
  | `getDoc(collection, id)` | Server-mediated doc fetch. |
449
433
  | `getDocs(collection, filter?, opts?)` | Filtered query. |
450
- | `trackDoc(collection, id, cb)` | Live subscription — returns unsubscribe. Sends an initial snapshot then relays mutations. |
434
+ | `trackDoc(collection, id, cb)` | Live subscription — returns unsubscribe. |
451
435
  | `trackDocs(collection, params, cb)` | Live filtered subscription. |
452
436
  | `uploadFile(file, key)` | Presigned upload to the `temp` bucket. |
453
437
  | `connectionState` | `'connecting' \| 'connected' \| 'reconnecting' \| 'disconnected' \| 'idle-disconnected'`. |
@@ -466,22 +450,22 @@ Two modes, picked from the `auth` block in the project's `.uglyapp` config:
466
450
  - **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.
467
451
  - **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`.
468
452
 
469
- `window.__UGLY_APP_AUTH_MODE__` is injected into every page so client code (`<AuthRoot>`, magic-link form, silent-SSO iframe) can branch correctly.
453
+ `window.__UGLY_APP_AUTH_MODE__` is injected into every page so client code (incl. `<AuthRoot>` and the router's `<AutoLoginGate>`) can branch correctly.
470
454
 
471
455
  ### Mode A — ugly.bot OAuth (default)
472
456
 
473
457
  1. Every page request: the server checks the `auth_token` cookie. If it verifies through `${UGLY_BOT_URL}/verify`, the server injects `window.__AUTH_TOKEN__` into the HTML.
474
458
  2. Client boot: if `__AUTH_TOKEN__` is present, `bootstrapApp` opens the WebSocket with the token. Otherwise it renders logged-out immediately (no first-paint block).
475
- 3. Background account-sync (always): `bootstrapApp` opens a hidden iframe to `${UGLY_BOT_URL}/oauth/silent`. If it returns a one-time code, the client POSTs `/auth/verify` to refresh the cookie. If the refreshed account's `userId` differs from the current session, the client calls `/auth/logout` and reloads onto the live account (guarded once per from→to pair to prevent loops).
476
- 4. Apex apps (`silentSso: true`): if the hidden iframe can't read ugly.bot's cookie (Safari / third-party-cookie blocking), a **top-level** redirect to `/oauth/silent` (first-party, bypasses 3p blocking) runs instead — one-shot, marked done so it can't loop.
477
- 5. Manual login: on protected routes, the per-route auth guard surfaces `<AuthRoot>` → `<LoginPopup>`, which opens `${UGLY_BOT_URL}/oauth` in a popup. On completion, the platform redirects back with either a `postMessage` code or `?ugly_oauth_code=…`.
459
+ 3. Background account-sync (always): `bootstrapApp` opens a hidden iframe to `${UGLY_BOT_URL}/oauth/silent` on every load. If it returns a one-time code, the client POSTs `/auth/verify` to refresh the cookie. If the refreshed account's `userId` differs from the current session, the client calls `/auth/logout` and reloads onto the live account (guarded once per from→to pair to prevent loops).
460
+ 4. Apex apps (`silentSso: true` in `bootstrapApp`): if the hidden iframe can't read ugly.bot's cookie (Safari / 3p-cookie blocking), a **top-level** redirect to `/oauth/silent` (first-party, bypasses 3p blocking) runs instead — one-shot, marked done so it can't loop. Skipped for accounts already confirmed live.
461
+ 5. Manual login: on protected routes, the per-route auth guard surfaces `<AuthRoot>` → `<LoginPopup>`, which opens `${UGLY_BOT_URL}/oauth` in a popup. On completion, the platform redirects back with either a `postMessage` code or `?ugly_oauth_code=…`; `bootstrapApp` redeems either at the top of boot.
478
462
 
479
463
  ### Mode B — Self-issued sessions
480
464
 
481
465
  When `.uglyapp` sets `auth.mode: 'self'`, `buildAuth()` wires the magic-link provider as primary; if `providers.google.clientId` is configured it adds Google as an extra provider on the same router.
482
466
 
483
467
  - `<AuthRoot>` renders `<MagicLinkForm>` (plus the Google button when configured) instead of `<LoginPopup>`.
484
- - Background ugly.bot silent SSO is a no-op — the ugly.bot iframe would either silently fail or set a cookie that wouldn't verify against the local session.
468
+ - Background ugly.bot silent SSO is a no-op — the ugly.bot iframe would either silently fail or set a cookie that won't verify against the local session.
485
469
  - `POST /auth/magic-link/request` accepts an email, mints a one-time token (default 15 min lifetime, configurable via `auth.magicLinkExpiresMin`), and emails a link.
486
470
  - `GET /auth/magic-link/verify?token=…` validates the token, calls `onUserCreate` on first login, sets the session cookie, and redirects.
487
471
  - Google login lives at `GET /auth/google/url` + `POST /auth/google/callback` when enabled.
@@ -523,7 +507,7 @@ configurator.setAuth({
523
507
 
524
508
  ## Database — `TypedDB`
525
509
 
526
- Access via `app.db`. All methods accept a `CollectionDef` (from `defineCollections`) or a plain collection name string.
510
+ Access via `app.db` or via `import { app } from './your-app-module'`. All methods accept a `CollectionDef` (from `defineCollections`) or a plain collection name string.
527
511
 
528
512
  ### Writing
529
513
 
@@ -594,10 +578,9 @@ const k = db.cacheKey('prefix', id);
594
578
 
595
579
  ```typescript
596
580
  import { createUserHelper, dbDefaults } from 'ugly-app';
597
- import { nanoid } from 'nanoid';
598
581
 
599
- const newDoc = { _id: nanoid(), ...dbDefaults(), title: 'Hi' };
600
- // ^^^^^^^^^^^^^^^ { version: 1, created, updated }
582
+ const newDoc = { _id: crypto.randomUUID(), ...dbDefaults(), title: 'Hi' };
583
+ // ^^^^^^^^^^^^^^^ { version: 1, created, updated }
601
584
 
602
585
  const userHelper = createUserHelper<User>(collections.user);
603
586
  const user = await userHelper.get(db, userId);
@@ -617,7 +600,7 @@ Imports available from `ugly-app`:
617
600
 
618
601
  ## AI
619
602
 
620
- AI calls are proxied through ugly.bot — your app never holds an AI provider key. Set `UGLY_BOT_TOKEN` in the environment and the framework handles routing, balance tracking, retries, and per-user billing.
603
+ AI calls are proxied through ugly.bot — your app never holds an AI provider key. Pass `UGLY_BOT_TOKEN` in the environment and the framework handles routing, balance tracking, retries, and per-user billing.
621
604
 
622
605
  ### Server-side text generation
623
606
 
@@ -795,28 +778,6 @@ Bucketing is deterministic: `hash(experimentId + userId)` (or `sessionId` for un
795
778
 
796
779
  ---
797
780
 
798
- ## Sharing links
799
-
800
- Never hand-build outbound URLs. Mint through the central helper — the returned `https://ugly.bot/l/<code>` short link deep-links into native + dock apps, renders an OpenGraph card, and can optionally gate humans behind login:
801
-
802
- ```typescript
803
- import { shareLink } from 'ugly-app'; // server
804
- const url = await shareLink({
805
- target: `/article/${id}`,
806
- og: { title, description, image },
807
- requireAuth: false,
808
- });
809
- ```
810
-
811
- ```typescript
812
- import { shareLink } from 'ugly-app/client'; // client
813
- const url = await shareLink({ target: location.pathname, og: { title } });
814
- ```
815
-
816
- Do **not** route unsubscribe or other single-use, token-bearing URLs through `shareLink()` — those must remain direct app URLs.
817
-
818
- ---
819
-
820
781
  ## Built-in endpoints
821
782
 
822
783
  | Endpoint | Description |
@@ -843,14 +804,14 @@ Do **not** route unsubscribe or other single-use, token-bearing URLs through `sh
843
804
  |-------------|-------------|
844
805
  | `ugly-app` | Server: `createApp`, `TypedDB`, auth, AI clients, NATS, storage, email, push, workers. |
845
806
  | `ugly-app/shared` | Cross-tier: `defineRequests`, `defineCollections`, `definePage`, `defineWorkers`, Zod, experiments, time constants. |
846
- | `ugly-app/client` | React: `bootstrapApp`, `createRouter`, `lazyPage`, `lazyPageLoader`, `AppProvider`, components, animations, audio, AI helpers. |
807
+ | `ugly-app/client` | React: `bootstrapApp`, `createRouter`, `lazyPage`, `AppProvider`, components, animations, audio, AI helpers. |
847
808
  | `ugly-app/conversation/{shared,server,client}` | AI chat sessions with persisted history. |
848
809
  | `ugly-app/collab/{server,client}` | Yjs-based collaborative editing. |
849
810
  | `ugly-app/markdown/{shared,client}` | Markdown rendering + editor. |
850
811
  | `ugly-app/webrtc`, `ugly-app/webrtc/server` | WebRTC video rooms. |
851
812
  | `ugly-app/three/{server,client}` | Three.js scene helpers. |
852
813
  | `ugly-app/worker` | Worker queue runtime. |
853
- | `ugly-app/playwright` | Test utilities (`inspectWindow`, `expectClean`, `simulateKeyboard`, `waitForApp`). |
814
+ | `ugly-app/playwright` | Test utilities. |
854
815
  | `ugly-app/vite`, `ugly-app/eslint` | Build-tool plugins. |
855
816
 
856
817
  ---
@@ -870,7 +831,7 @@ Do **not** route unsubscribe or other single-use, token-bearing URLs through `sh
870
831
  | `NATS_PREFIX` / `COMPOSE_PROJECT_NAME` | NATS subject prefix for per-env isolation. |
871
832
  | `CLOCK_ENABLED` | `true` to enable `setOnMinuteTick` / `setOnHourlyTick`. |
872
833
  | `CRON_SECRET` | Bearer secret for `POST /api/_cron/:taskName` and prod `POST /_workers/run`. |
873
- | `MAINTAIN_BOT_USER_ID` | User id allowed to access admin-only handlers (fallback when `setIsAdmin` unset). |
834
+ | `MAINTAIN_BOT_USER_ID` | User id allowed to access admin-only handlers. |
874
835
  | `INTERNAL_EMAIL_SECRET` | Shared secret for `/internal/email-callback`. |
875
836
  | `JWT_SECRET` | Required when using `getRequestUser()` for the per-project session cookie. |
876
837
  | `APP_DOMAIN` | App domain; combined with `NATS_PREFIX` for `getRequestUser()` validation. |
@@ -901,9 +862,9 @@ Browser-visible variables must be prefixed `VITE_` and consumed via `import.meta
901
862
  | `ugly-app error:dev` / `error:prod` | Query error logs (your tunnel / production). |
902
863
  | `ugly-app perf:dev` / `perf:prod` | Query performance metrics. |
903
864
  | `ugly-app feedback:dev` / `feedback:prod` | Query user feedback. |
904
- | `ugly-app feedback:submit` / `feedback:resolve` | Manage feedback (`--help` for flags). |
865
+ | `ugly-app feedback:submit` / `feedback:resolve` | Manage feedback (run with `--help` for flags). |
905
866
 
906
- Inside a scaffolded project, the same commands are available via `npm run …` scripts.
867
+ Inside a scaffolded project, the same commands are available via `npm run …` scripts — see `templates/CLAUDE.md` for the full list.
907
868
 
908
869
  ---
909
870
 
@@ -70,8 +70,15 @@ export interface RunAgentConfig {
70
70
  model: string;
71
71
  systemPrompt?: string;
72
72
  tools?: TextGenTool[];
73
- /** name → handler returning the tool_result string. */
74
- toolHandlers: Record<string, (input: unknown) => Promise<string>>;
73
+ /**
74
+ * name → handler returning the tool_result. A plain string is the model-visible content;
75
+ * the `{ content, metadata }` form additionally attaches an OUT-OF-BAND, UI-only payload to
76
+ * the tool_result part (e.g. an edit's removed lines for the card) that the model never sees.
77
+ */
78
+ toolHandlers: Record<string, (input: unknown) => Promise<string | {
79
+ content: string;
80
+ metadata?: unknown;
81
+ }>>;
75
82
  options?: Record<string, unknown>;
76
83
  /** The request name registered in the app (default `agentTurn`). */
77
84
  requestName?: string;
@@ -1 +1 @@
1
- {"version":3,"file":"runAgent.d.ts","sourceRoot":"","sources":["../../../src/agent/client/runAgent.ts"],"names":[],"mappings":"AAaA,OAAO,KAAK,EAAE,WAAW,EAAE,OAAO,EAAE,MAAM,yBAAyB,CAAC;AACpE,OAAO,EAGL,KAAK,gBAAgB,EACrB,KAAK,eAAe,EAEpB,KAAK,YAAY,EACjB,KAAK,WAAW,EAChB,KAAK,UAAU,EAChB,MAAM,0BAA0B,CAAC;AAClC,OAAO,EAGL,KAAK,YAAY,EACjB,KAAK,iBAAiB,EACtB,KAAK,oBAAoB,EAC1B,MAAM,2BAA2B,CAAC;AACnC,OAAO,EAAmB,KAAK,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AAEzE,MA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BAAgB,QAAQ,CAAC,MAAM,EAAE,cAAc,GAAG,eAAe,CA0YhE"}
@@ -156,7 +156,14 @@ export function runAgent(config) {
156
156
  content: `Error: no handler for tool "${use.name}".`,
157
157
  };
158
158
  const result = await handler(use.input);
159
- return { type: 'tool_result', tool_use_id: use.id, content: result };
159
+ const content = typeof result === 'string' ? result : result.content;
160
+ const metadata = typeof result === 'string' ? undefined : result.metadata;
161
+ return {
162
+ type: 'tool_result',
163
+ tool_use_id: use.id,
164
+ content,
165
+ ...(metadata !== undefined && { metadata }),
166
+ };
160
167
  }
161
168
  catch (err) {
162
169
  return {
@@ -1 +1 @@
1
- {"version":3,"file":"runAgent.js","sourceRoot":"","sources":["../../../src/agent/client/runAgent.ts"],"names":[],"mappings":"AAAA,oEAAoE;AACpE,EAAE;AACF,qEAAqE;AACrE,4EAA4E;AAC5E,8EAA8E;AAC9E,+EAA+E;AAC/E,gFAAgF;AAChF,gCAAgC;AAChC,EAAE;AACF,8EAA8E;AAC9E,4EAA4E;AAC5E,gDAAgD;AAGhD,OAAO,EACL,uBAAuB,EACvB,sBAAsB,GAOvB,MAAM,0BAA0B,CAAC;AAClC,OAAO,EACL,eAAe,EACf,oBAAoB,GAIrB,MAAM,2BAA2B,CAAC;AACnC,OAAO,EAAE,eAAe,EAAyB,MAAM,iBAAiB,CAAC;AA4GzE,MAAM,eAAe,GAAG,CAAC,CAAC;AAC1B,MAAM,KAAK,GAAG,CAAC,EAAU,EAAiB,EAAE,CAC1C,IAAI,OAAO,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,UAAU,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC;AAExC,SAAS,MAAM;IACb,OAAO,IAAI,CAAC,GAAG,EAAE,CAAC,QAAQ,CAAC,EAAE,CAAC,GAAG,IAAI,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC;AAC3E,CAAC;AAED,SA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Ac,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;gBAC1C,IAAI,IAAI,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;oBACpB,MAAM,OAAO,GAAG,MAAM,YAAY,CAAC,IAAI,CAAC,CAAC;oBACzC,QAAQ,GAAG,CAAC,GAAG,QAAQ,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,OAAO,EAAE,CAAC,CAAC;oBAC7D,MAAM,OAAO,CAAC,SAAS,CAAC,CAAC;oBACzB,MAAM,IAAI,EAAE,CAAC;gBACf,CAAC;YACH,CAAC;QACH,CAAC;QACD,KAAK;YACH,OAAO,CAAC,KAAK,EAAE,CAAC;QAClB,CAAC;QACD,WAAW;YACT,OAAO,QAAQ,CAAC;QAClB,CAAC;QACD,kBAAkB;YAChB,OAAO,MAAM,CAAC;QAChB,CAAC;QACD,OAAO;YACL,OAAO,CAAC,KAAK,EAAE,CAAC;YAChB,KAAK,EAAE,CAAC;QACV,CAAC;KACF,CAAC;AACJ,CAAC;AAED,MAAM,UAAW,SAAQ,KAAK;IAC5B;QACE,KAAK,CAAC,SAAS,CAAC,CAAC;QACjB,IAAI,CAAC,IAAI,GAAG,YAAY,CAAC;IAC3B,CAAC;CACF"}
@@ -1,2 +1,2 @@
1
- export declare const CLI_VERSION = "0.1.871";
1
+ export declare const CLI_VERSION = "0.1.873";
2
2
  //# sourceMappingURL=version.d.ts.map
@@ -1,3 +1,3 @@
1
1
  // Auto-generated by prebuild — do not edit manually
2
- export const CLI_VERSION = "0.1.871";
2
+ export const CLI_VERSION = "0.1.873";
3
3
  //# sourceMappingURL=version.js.map
@@ -0,0 +1,11 @@
1
+ export { TaskManager } from './taskManager.js';
2
+ export { forkTaskChild } from './taskChild.js';
3
+ export type { TaskChild } from './taskManager.js';
4
+ export type { Emit, Subscription, TaskGateway } from './taskHostTypes.js';
5
+ /**
6
+ * Absolute path to the forked task-child runner. Resolves next to this compiled module in
7
+ * `dist/native/server/taskHost/taskRunner.mjs` (copied there by ugly-app's build). Pass as
8
+ * `forkTaskChild`'s `runnerPath`.
9
+ */
10
+ export declare const TASK_RUNNER: string;
11
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/native/server/taskHost/index.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAC/C,OAAO,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AAC/C,YAAY,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAClD,YAAY,EAAE,IAAI,EAAE,YAAY,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AAE1E;;;;GAIG;AACH,eAAO,MAAM,WAAW,QAEvB,CAAC"}
@@ -0,0 +1,14 @@
1
+ // Electron-free task host — forks + manages background task children (the coding session is
2
+ // one), ported from ugly-studio's hostHub so ANY app's Playwright harness can run task-driven
3
+ // flows (coding turns, APPLY, preview) via `window.UglyNative.task.*` without the Studio shell.
4
+ // Wired into the harness by `installRealNative({ tasks: true })`.
5
+ import { fileURLToPath } from 'node:url';
6
+ export { TaskManager } from './taskManager.js';
7
+ export { forkTaskChild } from './taskChild.js';
8
+ /**
9
+ * Absolute path to the forked task-child runner. Resolves next to this compiled module in
10
+ * `dist/native/server/taskHost/taskRunner.mjs` (copied there by ugly-app's build). Pass as
11
+ * `forkTaskChild`'s `runnerPath`.
12
+ */
13
+ export const TASK_RUNNER = fileURLToPath(new URL('./taskRunner.mjs', import.meta.url));
14
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/native/server/taskHost/index.ts"],"names":[],"mappings":"AAAA,4FAA4F;AAC5F,8FAA8F;AAC9F,gGAAgG;AAChG,kEAAkE;AAClE,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAEzC,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAC/C,OAAO,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AAI/C;;;;GAIG;AACH,MAAM,CAAC,MAAM,WAAW,GAAG,aAAa,CACtC,IAAI,GAAG,CAAC,kBAAkB,EAAE,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAC7C,CAAC"}