Web pages: a page without headings is arranged by itself, and a typed address becomes a titled link

A page cut into parts by length is now arranged into titled sections by a
model when it is first read, through the same gates as s (a model, the
daily budget, the plan's limits, one request per text), once per text per
server run. EX_PAGES_ARRANGE=manual keeps it to s. The pane shows the
parts at once, says that it is arranging or why it did not, and swaps the
sections in when they arrive.

A bare http(s) address typed into a node's text is linked when the edit
ends, then replaced by the page's title once that is read; u brings the
address back. A node whose whole text is one address becomes a section
that is only a link. See docs/pages.md.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_014yB6q4BHMwptTX3YFtkRab
This commit is contained in:
thalladaandClaude Fable 5.2 committed 2026-11-18 14:19:21 -05:00
1 parent f8c6576ea1
commit 57b605e13c
19 files changed
+1095 -92

No files matched your search

+12 -1
View File
@@ -7,7 +7,8 @@
* words, links on the screenshot's cells; the articles are the mock
* Wikipedia's fixtures in server/wikiMock.ts).
*/
import { writeFileSync } from "node:fs";
import { existsSync, readFileSync, writeFileSync } from "node:fs";
import { join } from "node:path";
import { inflateSync } from "node:zlib";
import { expect, type APIRequestContext, type Page } from "@playwright/test";
@@ -261,6 +262,10 @@ export async function seedLinks(request: APIRequestContext) {
export const WEB = {
tracing: "https://tracing.example.org/posts/following-a-request",
essay: "https://essays.example.com/hundred.html",
/** Headingless, and the mock model fails to arrange it ("mockfail" in its title). */
drift: "https://notes.example.net/field/unsorted",
/** Headingless, and the mock model takes 1.5 s to arrange it ("mockslow"). */
slow: "https://tides.example.net/slow-water",
letters: "https://letters.example.net/p/on-maps",
rules: "https://software.example.com/2003/10/twelve-rules/",
phare: "https://encyclopedie.example.org/fr/Phare_de_la_Pointe",
@@ -299,6 +304,12 @@ export async function seedWeb(request: APIRequestContext) {
if (!res.ok()) throw new Error(`seeding web links failed: ${res.status()} ${await res.text()}`);
}
/** Model calls made today to arrange pages, as the e2e server counts them (<EX_DATA>/page-calls.json). */
export function pageCalls(): number {
const file = join(process.env.EX_E2E_DATA ?? "", "page-calls.json");
return existsSync(file) ? (JSON.parse(readFileSync(file, "utf8")) as { used: number }).used : 0;
}
/** A screenshot's pixels (a PNG of 8-bit RGB or RGBA, as Playwright writes them): px(x, y) is [r, g, b]. */
export function pixels(buf: Buffer): { w: number; h: number; px: (x: number, y: number) => [number, number, number] } {
let at = 8;