@ultimat3/cli 31.24.0 → 31.26.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CLAUDE.md +2 -1
- package/README.md +1 -0
- package/package.json +29 -29
- package/src/cmd-db-recount.ts +7 -0
- package/src/cmd-generate-spec.ts +3 -2
- package/src/cmd-generate.ts +4 -0
- package/src/db-diagnostics.ts +6 -0
- package/src/dispatch.ts +6 -1
- package/src/framework-schema.ts +5 -4
- package/src/generate-factories.ts +4 -0
- package/src/generate-files.ts +10 -0
- package/src/generate-invite.ts +195 -0
- package/src/generate-kinds.ts +4 -0
- package/src/metrics-endpoint.ts +5 -3
- package/src/role-replicator.ts +26 -4
- package/src/runtime-liveness.ts +23 -0
- package/src/templates/invite-pages.ts +151 -0
- package/src/templates/invite-tests.ts +228 -0
- package/src/templates/invite.ts +293 -0
- package/src/templates/scaffold-container-compose.ts +3 -2
- package/src/templates/scaffold-helm-templates.ts +1 -1
- package/src/templates/scaffold-repo.ts +1 -0
- package/wiki/Agents.md +2 -5
- package/wiki/Auth.md +24 -0
- package/wiki/Building-Your-Own-Base.md +20 -0
- package/wiki/CLI-Reference.md +3 -0
- package/wiki/FAQ.md +2 -2
- package/wiki/Home.md +1 -1
- package/wiki/Interface-Rules.md +5 -0
- package/wiki/Jobs-And-Workflows.md +8 -6
- package/wiki/Known-Gaps.md +1 -2
- package/wiki/MCP-And-AI.md +102 -1
- package/wiki/Mail.md +52 -0
- package/wiki/Realtime.md +17 -1
- package/wiki/Scheduled-Tasks.md +1 -1
- package/wiki/Scraping.md +19 -4
- package/wiki/Shapes.md +3 -2
- package/wiki/Tutorial-04-Jobs-And-Realtime.md +1 -1
package/wiki/Scraping.md
CHANGED
|
@@ -89,13 +89,13 @@ One interface, three drivers, no driver type in it.
|
|
|
89
89
|
| `frame(nameOrSelector)` | re-resolves on every call; nothing hands out a stale handle |
|
|
90
90
|
| `screenshot` | `{ fullPage }` or `{ clip }`, never both |
|
|
91
91
|
| `pdf` | the print layout: `format` (`a4`, `letter`, …) or `widthMm` + `heightMm`, `marginMm`, `printBackground`, `preferCssPageSize`, `headerHtml` / `footerHtml`. Two sizes, half a size or a size beside `preferCssPageSize` is `X_SCRAPE_PDF_OPTIONS_INVALID` (422), before any driver |
|
|
92
|
-
| `download({ timeout })` |
|
|
92
|
+
| `download({ timeout })` | the file the **last** click, key or navigation produced — the newest since it, older ones cleared — or `X_SCRAPE_DOWNLOAD_TIMEOUT`. A file from an earlier trigger, or one that landed after its own `download()` timed out, never answers a later one. Off the wire on the browser driver, never a download directory, capped at `maxDownloadBytes` — see [The port is complete](#the-port-is-complete) |
|
|
93
93
|
| `cookies` / `session` | the handoff to the HTTP leg, as a value you can inspect |
|
|
94
94
|
| `query(selector)` | every match as a snapshot — tag, attributes, text, **and `visible`**. The one definition of "visible" in the framework; nothing else may compute it |
|
|
95
95
|
| `offline(enabled)` | the browser's own offline mode. **Not** `@ultimat3/testing`'s sealed network, which patches `fetch` in the *test process* and a browser's requests never traverse — a test built on that would pass against a fully online app |
|
|
96
96
|
| `focus(selector, { timeout })` | waits for `actionable`, then moves focus — the setup for a `press()` |
|
|
97
97
|
| `press(chord)` | `'Meta+K'`, `'Escape'`, `'Shift+Tab'` on whatever holds focus. Modifiers are `Meta`, `Control`, `Alt`, `Shift` in the browser's own spelling; `'Ctrl+K'` is `X_SCRAPE_KEY_INVALID` on **every** driver, offline included — the parse is the one thing an offline driver can be wrong about, so it runs there too, then stops |
|
|
98
|
-
| `accessibility(selector, { max })` | what a screen reader is told about each match —
|
|
98
|
+
| `accessibility(selector, { max })` | what a screen reader is told about each match — role and name after ARIA and label association, at most `max` (default 25) nodes, from **this handle's document**: on a `frame(…)` handle, the frame's. The browser driver answers what Chrome computed; the offline drivers answer the HTML-AAM mapping of the markup, never `role=` read alone: a `<div onclick>` maps to no role *on every driver*, and that *is* the finding |
|
|
99
99
|
| `console()` / `network()` | bounded rings, 200 entries each |
|
|
100
100
|
| `pageErrors()` / `pageErrorsDropped()` | uncaught exceptions, a **third** ring — not console lines |
|
|
101
101
|
| `activity()` | tells the wedge watchdog the run is working on a channel this page cannot see — your own CDP session, a long warm-up. Every verb above already reports; this touches the idle clock only and counts no usage. On every driver |
|
|
@@ -158,10 +158,25 @@ Response bodies are counted **as they arrive**, capped at `DEFAULT_HTTP_MAX_BYTE
|
|
|
158
158
|
| `fixtureBrowser(dir)` | committed page recordings | none |
|
|
159
159
|
| `fakeBrowser(pages)` | inline pages, for a unit test | none |
|
|
160
160
|
|
|
161
|
-
**The launcher is passed in, never imported.** `CdpLauncherLike` is two methods — `launch` and `connect` — so `puppeteer`, `puppeteer-core` or anything with the same shape satisfies it, and this package declares no browser dependency at all. A launcher with no `launch` is `X_SCRAPE_REMOTE_REQUIRED`, not a crash. The browser it hands back must expose `target().createCDPSession()` — puppeteer's does — because `allowHosts` is enforced at the browser too, on every tab a scraped page opens;
|
|
161
|
+
**The launcher is passed in, never imported.** `CdpLauncherLike` is two methods — `launch` and `connect` — so `puppeteer`, `puppeteer-core` or anything with the same shape satisfies it, and this package declares no browser dependency at all. A launcher with no `launch` is `X_SCRAPE_REMOTE_REQUIRED`, not a crash. The browser it hands back must expose `target().createCDPSession()` — puppeteer's does — because `allowHosts` is enforced at the browser too, on every tab a scraped page opens; its pages and the browser must carry every verb the page forwards to, checked when the session opens (`X_SCRAPE_LAUNCHER_INCOMPLETE`, see [The port is complete](#the-port-is-complete)).
|
|
162
162
|
|
|
163
163
|
`driver-parity.test.ts` runs one suite against all three and pins the single honest divergence: the offline drivers have no layout engine, so `ElementSnapshot.box` and `hitTarget` are absent rather than faked.
|
|
164
164
|
|
|
165
|
+
## The port is complete
|
|
166
|
+
|
|
167
|
+
**Every page verb answers on every driver; none is `X_NOT_IMPLEMENTED`** (`As of 2026-11-15`). Thirteen refusals came out of `cdp-target.ts` and `html-target.ts`: a port method one driver cannot honour is a second path, so each one was implemented there — or, for a launcher missing a method, moved to a check when the session opens. `port-complete.test.ts` calls every `ScrapeTarget` member on the offline and the browser driver, on the page and on a frame, keyed by the port's own members — a member added without a row does not compile.
|
|
168
|
+
|
|
169
|
+
| Verb | Browser driver | Offline drivers |
|
|
170
|
+
|---|---|---|
|
|
171
|
+
| `download()` | the file's bytes off the wire: the browser-level `Fetch` pause at the Response stage streams the body (`Fetch.takeResponseBodyAsStream` + `IO.read`) under a byte cap — `localBrowser({ maxDownloadBytes })`, default `DEFAULT_MAX_DOWNLOAD_BYTES` (25 MiB) — and fulfils the response with the bytes read; `Browser.downloadWillBegin` names it, and Chrome's own copy is denied. Over the cap nothing is buffered: a declared `Content-Length` over it is left to Chrome (`download()` times out), an undeclared attachment is abandoned at the cap and failed, an undeclared non-attachment is never read. Works on `remoteBrowser()`, whose disk is not yours. A script-made `blob:` download is read through the page, its size checked first | the recorded `downloads` entry the LAST click armed — a click that downloads nothing, or a key, disarms it |
|
|
172
|
+
| `offline(enabled)` | the browser's own network condition | every navigation — `goto`, a link's click — fails `X_SCRAPE_BROWSER_UNREACHABLE` while set, the code a browser's failed navigation carries. No JS runs, so an assertion on what the app's offline code renders fails rather than passing |
|
|
173
|
+
| `accessibility()` | what the browser computed — on a frame handle, scoped to the frame's document, found through the page's own session (`Page.getFrameTree` → `DOM.getFrameOwner` → its `contentDocument`). A cross-site frame under site isolation renders in another process the page session cannot read: `X_SCRAPE_FRAME_OUT_OF_PROCESS`, fixed by `localBrowser({ launcher, options: { args: ['--disable-site-isolation-trials'] } })` (measured on Chrome 157) | the HTML-AAM mapping of the markup — the frame's own markup on a frame handle: explicit `role`, else the implicit one; the name from `aria-labelledby`, `aria-label`, `<label for>`, `alt`, content, `title`, `placeholder`. CSS and script are not seen. A `<div onclick>` answers no role and no name |
|
|
174
|
+
| `press` / `focus` / `colorScheme` / `prepare` / `cookies` / `session` | `CdpPageLike` and `CdpBrowserLike` keep `keyboard`, `focus`, `createCDPSession`, `setOfflineMode`, `emulateMediaFeatures`, `evaluateOnNewDocument`, `cookies`, `setCookie` optional in the type, so a launcher written against 31.x still compiles — and checks every one **when the session opens**: a missing one is `X_SCRAPE_LAUNCHER_INCOMPLETE` naming each, and the launched browser is closed. Never a refusal on the first run that reached the verb. `CompleteLauncher` is the same shape with each required, which the built-in launchers are declared as | unchanged |
|
|
175
|
+
|
|
176
|
+
**A frame handle reads its frame.** `page.frame(…).accessibility()` answers from the frame's document on every driver; it was `X_NOT_IMPLEMENTED` on all three until 2026-11-15.
|
|
177
|
+
|
|
178
|
+
**What a browser dependency beside `scraping` still buys.** A direct `puppeteer` import for a download, an offline toggle, a keyboard chord, an accessibility read, an init script, a theme, cookies or a frame's form is now a page verb, on every driver, with `allowHosts`, robots, pacing, redaction and the wedge watchdog applied. What the port does not cover, and a direct import still does: request/response bodies of subresources, a download Chrome makes from an HTML response with no `Content-Disposition`, file uploads, and multiple tabs.
|
|
179
|
+
|
|
165
180
|
## The silent-green alarm
|
|
166
181
|
|
|
167
182
|
A scraper that returns zero rows because the site changed its markup is the failure that does not look like one.
|
|
@@ -440,7 +455,7 @@ Every owned code is split by whether the same request can succeed unchanged. `x
|
|
|
440
455
|
| `X_SCRAPE_HTTP_FAILED` | 408, 409, 425, 429, any 5xx, a deploy — transient far more often than not. **Which 4xx are permanent is `@ultimat3/core`'s `isRetryableStatus`, not this package's**, `As of 2026-08-23`: a private copy here called 408 and 425 terminal while the rest of the framework called them retryable, and a terminal classification dead-letters the run on the attempt that failed rather than spending its declared `attempts` |
|
|
441
456
|
| `X_SCRAPE_BLOCKED` | retryable **and it burns the session first**: retrying a block on the same flagged cookies re-trips it every time |
|
|
442
457
|
|
|
443
|
-
Everything else is terminal, including `X_SCRAPE_SELECTOR_MISSING` (the markup changed), `X_SCRAPE_OUTPUT_INVALID` (the rows are the wrong shape), `X_SCRAPE_YIELD_COLLAPSED`, `X_SCRAPE_SECRET_EXPOSED`, `X_SCRAPE_KEY_INVALID` (the chord is the caller's own literal), `X_SCRAPE_PROMPT_UNANSWERED`, `X_SCRAPE_BROWSER_MISSING` (there is no browser binary to launch), `X_SCRAPE_EGRESS_UNSUPPORTED` (the exit is the run's input and the driver is the deploy's constant)
|
|
458
|
+
Everything else is terminal, including `X_SCRAPE_SELECTOR_MISSING` (the markup changed), `X_SCRAPE_OUTPUT_INVALID` (the rows are the wrong shape), `X_SCRAPE_YIELD_COLLAPSED`, `X_SCRAPE_SECRET_EXPOSED`, `X_SCRAPE_KEY_INVALID` (the chord is the caller's own literal), `X_SCRAPE_PROMPT_UNANSWERED`, `X_SCRAPE_BROWSER_MISSING` (there is no browser binary to launch), `X_SCRAPE_EGRESS_UNSUPPORTED` (the exit is the run's input and the driver is the deploy's constant) `X_SCRAPE_LAUNCH_ARGS_INVALID` (the args are the deploy's literal), `X_SCRAPE_LAUNCHER_INCOMPLETE` (the launcher is the deploy's library) and `X_SCRAPE_FRAME_OUT_OF_PROCESS` (site isolation is the browser's configuration).
|
|
444
459
|
|
|
445
460
|
## Testing offline
|
|
446
461
|
|
package/wiki/Shapes.md
CHANGED
|
@@ -57,7 +57,8 @@ its output: `--dry-run` lists those runs under `data.generate`.
|
|
|
57
57
|
| `bun run setup && bun run verify` green on the first pass, then again over every generator | `scaffold-smoke` in `.github/workflows/ci.yml`, one row per shape — `scripts/ci-workflow-shape.test.ts` refuses a shape with no row |
|
|
58
58
|
|
|
59
59
|
`As of 2026-11-06`. Five shapes are planned (`saas` and `agent` beside these three); a shape is
|
|
60
|
-
listed here, and accepted by `--shape`, only once its row gates green. `saas` waits on a
|
|
61
|
-
|
|
60
|
+
listed here, and accepted by `--shape`, only once its row gates green. `saas` waits on a billing
|
|
61
|
+
seam no slice has landed — its member invite ships, as `defineMemberInvite` and `x g invite`
|
|
62
|
+
([Auth](Auth#member-invites), `As of 2026-11-14`); `agent` on a model and provider an app names by
|
|
62
63
|
environment alone, which no shipped seam takes without a provider SDK or a model row the scaffold
|
|
63
64
|
would have to invent.
|
|
@@ -252,7 +252,7 @@ The same run logs `sync reachable` with the node on `ws://localhost:3101/_x/sync
|
|
|
252
252
|
|
|
253
253
|
**Delivery.** A second run, 10,000 clients and a probe every 200ms, counting gaps in each client's received sequence: **1,666,882 channel patches received, 0 observed sequence gaps** ([`10k-restart-seq.json`](https://github.com/developerz-ai/ultimate/blob/main/scripts/bench/results/10k-restart-seq.json)). A first-patch timer cannot see a lost patch, which is why the second run exists — `As of 2026-08` it is the only one with delivery accounting. It says nothing about 50,000, and its zero is a lower bound: a gap needs a received frame on each side of it, so "no client observed a loss" is the claim, not "nothing was lost" ([Realtime](Realtime)).
|
|
254
254
|
|
|
255
|
-
Both are per-node recovery — neither run crossed NATS, so neither is a multi-node result nor a throughput figure. Detail and limits: [Realtime](Realtime).
|
|
255
|
+
Both are per-node recovery — neither run crossed NATS, so neither is a multi-node result nor a throughput figure. What *is* proven across nodes (delivery, ordering, resume, gap repair over a real bus) and what is still unmeasured (throughput, socket capacity): [Realtime](Realtime#across-nodes-over-a-real-bus). Detail and limits: [Realtime](Realtime).
|
|
256
256
|
|
|
257
257
|
Realtime tier 3 (local-first) shipped in 21.0.0, and it is declared on the **entity**, not the query: `entity(name, { persist: true })`, default `false`, keeps its records in IndexedDB beside the one outbox ([Realtime](Realtime#tier-3-shipped-in-2100)). `persist` is not a `query()` field — writing it there is a `TS2353` excess property.
|
|
258
258
|
|