studiograph 1.3.48-next.261 → 1.3.48-next.263
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/dist/agent/prompts/system.md +2 -2
- package/dist/agent/skills/artifact-canvas/skill.md +25 -37
- package/dist/agent/skills/paged-documents/skill.md +74 -104
- package/dist/agent/tools/artifact-tools.js +1 -1
- package/dist/agent/tools/artifact-tools.js.map +1 -1
- package/dist/core/artifact-columns-css.d.ts +38 -0
- package/dist/core/artifact-columns-css.js +157 -0
- package/dist/core/artifact-columns-css.js.map +1 -0
- package/dist/core/artifact-frame-document.d.ts +57 -15
- package/dist/core/artifact-frame-document.js +396 -356
- package/dist/core/artifact-frame-document.js.map +1 -1
- package/dist/core/artifact-frame-model.d.ts +42 -1
- package/dist/core/artifact-frame-model.js +102 -1
- package/dist/core/artifact-frame-model.js.map +1 -1
- package/dist/mcp/tools.js +8 -8
- package/dist/mcp/tools.js.map +1 -1
- package/dist/server/routes/artifact-export-api.js +2 -3
- package/dist/server/routes/artifact-export-api.js.map +1 -1
- package/dist/server/routes/chat-turn-outcome.d.ts +36 -0
- package/dist/server/routes/chat-turn-outcome.js +17 -0
- package/dist/server/routes/chat-turn-outcome.js.map +1 -0
- package/dist/services/artifact-library-sources.d.ts +1 -6
- package/dist/services/artifact-library-sources.js +1 -9
- package/dist/services/artifact-library-sources.js.map +1 -1
- package/dist/services/artifact-render-export.d.ts +3 -3
- package/dist/services/artifact-render-export.js +57 -50
- package/dist/services/artifact-render-export.js.map +1 -1
- package/dist/web/_app/immutable/chunks/{Cg7m1gqN.js → 1Av0cjjM.js} +1 -1
- package/dist/web/_app/immutable/chunks/7C_XQ_V22.js +949 -0
- package/dist/web/_app/immutable/chunks/{Bpmx7Umc.js → 7dxFJmtT.js} +1 -1
- package/dist/web/_app/immutable/chunks/{CR1JY_cb.js → B3TQ2v3O.js} +1 -1
- package/dist/web/_app/immutable/chunks/{CZBW5wi82.js → BKJo_vcH2.js} +1 -1
- package/dist/web/_app/immutable/chunks/{Cx5IiiDO2.js → BLjaRsry2.js} +1 -1
- package/dist/web/_app/immutable/chunks/{snCOoD78.js → BWM7Fyds.js} +1 -1
- package/dist/web/_app/immutable/chunks/{CQl_RUVN2.js → BZrDj1Yc2.js} +1 -1
- package/dist/web/_app/immutable/chunks/{D0_Iu3Uj.js → B_EIjYsb.js} +1 -1
- package/dist/web/_app/immutable/chunks/{DaB0hU8_.js → BaVciYXp.js} +1 -1
- package/dist/web/_app/immutable/chunks/{CQW66fYJ.js → BkWTUZUm.js} +1 -1
- package/dist/web/_app/immutable/chunks/{BU5TCj7m.js → BzEpkiVx.js} +1 -1
- package/dist/web/_app/immutable/chunks/{CkivrILi.js → CFQ_EH_P.js} +1 -1
- package/dist/web/_app/immutable/chunks/CL_APTyv.js +1 -0
- package/dist/web/_app/immutable/chunks/{2z2ekE6D2.js → COK5qG3L2.js} +2 -2
- package/dist/web/_app/immutable/chunks/{BIeOkmiV.js → CRwWneZ-.js} +1 -1
- package/dist/web/_app/immutable/chunks/{1QRy7-wo.js → CW2H4JII.js} +1 -1
- package/dist/web/_app/immutable/chunks/{pPsy4008.js → CWeviCpk.js} +1 -1
- package/dist/web/_app/immutable/chunks/{DMFH9Cnt2.js → CXOqnNsj2.js} +1 -1
- package/dist/web/_app/immutable/chunks/{oIZupUnz.js → CX_WuP2f.js} +1 -1
- package/dist/web/_app/immutable/chunks/{BIwe25Lk.js → CY5xLE5F.js} +1 -1
- package/dist/web/_app/immutable/chunks/{D-vvXTU3.js → CeUT6lMf.js} +2 -2
- package/dist/web/_app/immutable/chunks/{B5UH1FNe.js → CgmH6rPv.js} +3 -3
- package/dist/web/_app/immutable/chunks/{-Tbr-96c2.js → CkOWeGhc2.js} +1 -1
- package/dist/web/_app/immutable/chunks/{K5YHt1WL2.js → CkPu5VTd2.js} +1 -1
- package/dist/web/_app/immutable/chunks/ClSRVrsW.js +1 -0
- package/dist/web/_app/immutable/chunks/{CcgYvk_3.js → Cmq7bKUh.js} +1 -1
- package/dist/web/_app/immutable/chunks/{F5xZdLlB.js → CnR_G-ce.js} +1 -1
- package/dist/web/_app/immutable/chunks/{CuYL65Bn.js → CzSx91mJ.js} +1 -1
- package/dist/web/_app/immutable/chunks/D-a94Hdg.js +1 -0
- package/dist/web/_app/immutable/chunks/DAcMjPms.js +2 -0
- package/dist/web/_app/immutable/chunks/{B06uE1qJ.js → DC2fTKy0.js} +1 -1
- package/dist/web/_app/immutable/chunks/{atFSAfcd2.js → DDfqLzbz2.js} +2 -2
- package/dist/web/_app/immutable/chunks/{DhD1HF7R.js → DFLuHkej.js} +1 -1
- package/dist/web/_app/immutable/chunks/{PwUOTfSv.js → DOZR4-gy.js} +1 -1
- package/dist/web/_app/immutable/chunks/DO_V9Cgc.js +1 -0
- package/dist/web/_app/immutable/chunks/{Cxdio_Al.js → DPI7dnke.js} +3 -3
- package/dist/web/_app/immutable/chunks/{CG8YKaqc.js → DVcmIzo2.js} +1 -1
- package/dist/web/_app/immutable/chunks/DZ2Zr5zb.js +1 -0
- package/dist/web/_app/immutable/chunks/{ChS3kWO-.js → DiGsqyRs.js} +1 -1
- package/dist/web/_app/immutable/chunks/{CKwV6HKc.js → DmzyKw-k.js} +1 -1
- package/dist/web/_app/immutable/chunks/Dvj33Rn2.js +1 -0
- package/dist/web/_app/immutable/chunks/{B9VQbssY.js → MDb5bFUr.js} +1 -1
- package/dist/web/_app/immutable/chunks/mYfi0ijf2.js +66 -0
- package/dist/web/_app/immutable/chunks/{CuatNdzp.js → nkOOikT2.js} +1 -1
- package/dist/web/_app/immutable/chunks/{CLninaDG2.js → qU6V8dVT2.js} +2 -2
- package/dist/web/_app/immutable/chunks/{DtXJCaQc2.js → qtwjrlYo2.js} +1 -1
- package/dist/web/_app/immutable/chunks/{B3u4QMoU.js → vR5HiNz9.js} +1 -1
- package/dist/web/_app/immutable/chunks/{7l950wkn.js → xhwwouQZ.js} +1 -1
- package/dist/web/_app/immutable/chunks/{BBrP9GiZ.js → yKBXs2Vl.js} +1 -1
- package/dist/web/_app/immutable/chunks/{sUAtda6y2.js → zMLQbXeR2.js} +1 -1
- package/dist/web/_app/immutable/entry/{app.1tcNTKI-.js → app.CRvuxoVJ.js} +2 -2
- package/dist/web/_app/immutable/entry/start.CRSlQSAo.js +1 -0
- package/dist/web/_app/immutable/nodes/{0.v0W5DL7W.js → 0.DCtO9hJz.js} +2 -2
- package/dist/web/_app/immutable/nodes/{1.81Rb3Ith.js → 1.CU0Xk0hX.js} +1 -1
- package/dist/web/_app/immutable/nodes/{10.CAlZNFOq.js → 10.BQ_I0U3h.js} +1 -1
- package/dist/web/_app/immutable/nodes/{11.CCfUginI.js → 11.D8W7J9oj.js} +1 -1
- package/dist/web/_app/immutable/nodes/{12.BJLboAyk.js → 12.shu8hSiJ.js} +1 -1
- package/dist/web/_app/immutable/nodes/{13.Cz4UTl2G.js → 13.CqSie9pj.js} +1 -1
- package/dist/web/_app/immutable/nodes/15.CRTNtmaK.js +1 -0
- package/dist/web/_app/immutable/nodes/{16.BjohAUt9.js → 16.CLnfWtVJ.js} +1 -1
- package/dist/web/_app/immutable/nodes/{18.DsOT0tDo.js → 18.L6u3xca6.js} +1 -1
- package/dist/web/_app/immutable/nodes/{19.BiJWLOUT.js → 19.BfT4fpP2.js} +1 -1
- package/dist/web/_app/immutable/nodes/{2.Cd72nG2V.js → 2.Cywkr3cW.js} +4 -4
- package/dist/web/_app/immutable/nodes/{3.BIT9mm9r.js → 3.C5-yIMEM.js} +1 -1
- package/dist/web/_app/immutable/nodes/{4.Cn7r0Poe.js → 4.LWwxRkzM.js} +3 -3
- package/dist/web/_app/immutable/nodes/{5.CkJNdCZG.js → 5.CwRllvWS.js} +1 -1
- package/dist/web/_app/immutable/nodes/{6.1rbIRQgQ.js → 6.BcR9vQIF.js} +1 -1
- package/dist/web/_app/immutable/nodes/{7.w17Zl36i.js → 7.Bm0Ie3c3.js} +1 -1
- package/dist/web/_app/immutable/nodes/{8.DqTsYuU-.js → 8.Dj0JJcTw.js} +1 -1
- package/dist/web/_app/immutable/nodes/{9.BJhYZPfc.js → 9.9MiRRKIu.js} +1 -1
- package/dist/web/_app/version.json +1 -1
- package/dist/web/index.html +14 -14
- package/package.json +1 -2
- package/dist/web/_app/immutable/chunks/9Sn2PwSn2.js +0 -1025
- package/dist/web/_app/immutable/chunks/AFZSy-Vk.js +0 -2
- package/dist/web/_app/immutable/chunks/B4PrlkmE.js +0 -1
- package/dist/web/_app/immutable/chunks/C85NG5lS.js +0 -1
- package/dist/web/_app/immutable/chunks/CJbr-v9X.js +0 -1
- package/dist/web/_app/immutable/chunks/D4vfNy_f.js +0 -1
- package/dist/web/_app/immutable/chunks/DG7uGoZb2.js +0 -58
- package/dist/web/_app/immutable/chunks/DTOO9nUj.js +0 -1
- package/dist/web/_app/immutable/chunks/Dav8Lgyy2.js +0 -5
- package/dist/web/_app/immutable/chunks/DjXtgWTP.js +0 -1
- package/dist/web/_app/immutable/entry/start.BJMsySI1.js +0 -1
- package/dist/web/_app/immutable/nodes/15.D2mNE6C-.js +0 -1
- /package/dist/web/_app/immutable/chunks/{Oglnp7sm.js → Oglnp7sm2.js} +0 -0
|
@@ -239,12 +239,12 @@ You have access to tools in the following categories:
|
|
|
239
239
|
|
|
240
240
|
The platform owns arrangement, stepping, and pagination — so **match the artifact type to its frame structure** and never hand-roll a stepper, filmstrip, pagination, or page grid inside one frame:
|
|
241
241
|
- **Slide deck** → N `slides` frames, one per slide (e.g. 1280×720 or 1920×1080).
|
|
242
|
-
- **Designed document** (a letter, contract, proposal, or report the user wants laid out *on letterhead / as a formatted PDF* — NOT a plain prose draft, which is a `document` entry per the gate above) → ONE `pages` frame whose `content` is the WHOLE document body at a fixed page size (US-Letter `816×1056`; also Legal `816×1344`, Tabloid `1056×1632`, A4 `794×1123`, A3 `1123×1587`, A5 `559×794`). The platform flows the text across as many pages as needed, numbers them, and exports a real multi-page PDF. Style it as rich HTML/CSS; for repeating letterhead/headers/footers
|
|
242
|
+
- **Designed document** (a letter, contract, proposal, or report the user wants laid out *on letterhead / as a formatted PDF* — NOT a plain prose draft, which is a `document` entry per the gate above) → ONE `pages` frame whose `content` is the WHOLE document body at a fixed page size (US-Letter `816×1056`; also Legal `816×1344`, Tabloid `1056×1632`, A4 `794×1123`, A3 `1123×1587`, A5 `559×794`). The platform flows the text across as many pages as needed, numbers them, and exports a real multi-page PDF. Style it as rich HTML/CSS; for repeating letterhead/headers/footers set the frame's `furniture` field (`{header?, footer?}`, each with `first`/`middle`/`last` HTML, repeated on every page and inset to the content column) plus `pageMargins` (px per side; defaults top 96 / sides 72 / bottom 84), and force a page break with `break-before: column`. The platform paginates with **native CSS multi-column**, so author `@page` margin boxes and `position: running()` no longer render — use `furniture`/`pageMargins` instead, and keep **one uniform page geometry per document** (per-section `@page` margins are not expressible). NEVER set a document's height to `auto`, NEVER split it into one frame per page, and NEVER build a page grid inside an `app`/`artboard` frame.
|
|
243
243
|
- **Graphic / poster / diagram** → `artboard` frame(s) at a fixed size.
|
|
244
244
|
- **App / prototype** → a single `app` frame with fill geometry.
|
|
245
245
|
- **Whiteboard** → a single `whiteboard` frame.
|
|
246
246
|
|
|
247
|
-
After `create_artifact` / `patch_artifact`, the result reports the resolved frame structure (manifest) and any warnings — verify the frame count and per-frame layouts match what the user asked for (a deck is N `slides` frames, not one `app` frame); if they don't, or a warning fired, fix it before responding. Load the `artifact-canvas` skill before creating a canvas artifact, and additionally the `paged-documents` skill before creating or editing a multi-page document (a `pages` frame) — it is the
|
|
247
|
+
After `create_artifact` / `patch_artifact`, the result reports the resolved frame structure (manifest) and any warnings — verify the frame count and per-frame layouts match what the user asked for (a deck is N `slides` frames, not one `app` frame); if they don't, or a warning fired, fix it before responding. Load the `artifact-canvas` skill before creating a canvas artifact, and additionally the `paged-documents` skill before creating or editing a multi-page document (a `pages` frame) — it is the reference for the native-columns letterhead model (`furniture`/`pageMargins`, `break-before:column`) and requires you to render-and-inspect the result. Canvas artifacts are graph entries that open in the center content well, with PDF, PNG, and HTML downloads available from the artifact toolbar. For 3D, data visualization, and animation, request curated local libraries in the bundle (`three`, `d3`, `motion`) rather than embedding CDN dependencies.
|
|
248
248
|
|
|
249
249
|
### Tool Selection
|
|
250
250
|
|
|
@@ -109,40 +109,23 @@ Each frame:
|
|
|
109
109
|
}
|
|
110
110
|
```
|
|
111
111
|
|
|
112
|
-
**Letterhead, running headers & footers — use
|
|
113
|
-
|
|
114
|
-
> **Building a multi-page document, load the `paged-documents` skill first.** It is the deep, effective-use reference for the pagination layer — `@page` rules, named/cover pages, the page-margin-box **width** mechanics that decide whether a running header clips, running elements for real letterhead, page counters, break control, and the mandatory render-and-inspect verify loop. The summary below gets you started; that skill is how you do it *well*.
|
|
115
|
-
|
|
116
|
-
- Mark an element as *running* and pull it into a page-margin box. Put the element once at the top of the frame `content`; it renders in the margin of EVERY page:
|
|
117
|
-
```css
|
|
118
|
-
.letterhead { position: running(lh); }
|
|
119
|
-
@page {
|
|
120
|
-
margin: 132px 64px 90px; /* room for the running header/footer */
|
|
121
|
-
@top-center { content: element(lh); }
|
|
122
|
-
@bottom-center { content: element(ft); }
|
|
123
|
-
@bottom-right { content: "Page " counter(page) " of " counter(pages); }
|
|
124
|
-
}
|
|
125
|
-
```
|
|
126
|
-
You get the full surface: any of the 16 margin boxes (`@top-left`/`@bottom-right`/…), `:first`/`:left`/`:right` page selectors, named pages, counters.
|
|
127
|
-
- **Full-bleed branded band** (a colored letterhead that runs edge-to-edge): set the side page margins to `0`, give the running element a background + fixed height, and position its left/right parts with **`position:absolute`**. Do NOT use flex/table to spread them: that layout does NOT survive Paged.js's clone into the margin box (the parts collapse stacked + centered) — absolute children anchor to the band's edges and DO render correctly. (Verified by render.) **Footer/header TEXT needs its own inset when side margins are `0`:** the band is meant to bleed, but `@bottom-left`/`@bottom-right`/`@top-*` text in a 0-margin page sits flush against the paper edge. Margin boxes accept `padding`, so pad each text slot to your body gutter (`padding-left`/`padding-right: 64px`) — only the band bleeds; the furniture aligns to the column.
|
|
128
|
-
```css
|
|
129
|
-
@page {
|
|
130
|
-
margin: 104px 0 64px; /* side margins 0 → the band bleeds */
|
|
131
|
-
@top-center { content: element(band); }
|
|
132
|
-
@bottom-left { content: "Confidential"; padding-left: 64px; } /* inset the text to the column */
|
|
133
|
-
@bottom-right{ content: counter(page); padding-right: 64px; } /* (margins are 0, so pad each box) */
|
|
134
|
-
}
|
|
135
|
-
.band { position: running(band); height:104px; background:#16315c; color:#fff; }
|
|
136
|
-
.brand { position:absolute; left:64px; top:50%; transform:translateY(-50%); }
|
|
137
|
-
.addr { position:absolute; right:64px; top:50%; transform:translateY(-50%); text-align:right; }
|
|
138
|
-
.doc { padding: 0 64px; } /* the body supplies its own side gutters */
|
|
139
|
-
```
|
|
140
|
-
- Anything you author this way **overrides the platform defaults** (the default margins + the auto page number) — you are in full control.
|
|
112
|
+
**Letterhead, running headers & footers — use the `furniture` + `pageMargins` fields.** A `pages` document is plain HTML/CSS — design the body as richly as you like (logos, zebra-striped tables, multi-column layouts). To make content **repeat on every page** (a letterhead, running header, footer), set the frame's `furniture` field; the platform draws it in the page margins on every page. The platform paginates with **native CSS multi-column**, so author `@page` margin boxes and `position: running()` no longer render — `furniture` + `pageMargins` is the mechanism.
|
|
141
113
|
|
|
142
|
-
|
|
114
|
+
> **Building a multi-page document, load the `paged-documents` skill first.** It is the reference for the native-columns letterhead model — the `furniture` header/footer slots, `pageMargins`, `break-before: column`, the uniform-geometry constraint, fragment-safe patterns, and the mandatory render-and-inspect verify loop.
|
|
143
115
|
|
|
144
|
-
- **`furniture`** (a `pages` frame field) —
|
|
145
|
-
|
|
116
|
+
- **`furniture`** (a `pages` frame field) — running header/footer HTML, repeated on every page: `{ header?, footer? }`, each with `first` (page 1) / `middle` (the rest + fallback) / `last` (final page) HTML. The platform tucks the header into the top margin and the footer into the bottom, never letting them overlap the body, inset to the content column. Put **real designed HTML** here (a logo lockup, an address block, a rule), not just a plain text line — style it from a `shared` CSS file (classes resolve globally):
|
|
117
|
+
```jsonc
|
|
118
|
+
"furniture": {
|
|
119
|
+
"header": { "middle": "<div class=\"lh\"><b>SCHEMA</b><span>123 Main St · hello@schema.com</span></div>" },
|
|
120
|
+
"footer": { "middle": "<span>Confidential</span>" }
|
|
121
|
+
}
|
|
122
|
+
```
|
|
123
|
+
A default **"Page N of M"** number is drawn bottom-right on every page (a footer you supply sits to its left, clear of it).
|
|
124
|
+
- **`pageMargins`** (a `pages` frame field, px per side; absent sides default to top 96 / sides 72 / bottom 84) — the page margins. Grow the top/bottom to make room for a tall letterhead/footer (furniture is out-of-flow and can't reserve its own space).
|
|
125
|
+
- **Forced page break**: `break-before: column` (or `break-after: column`) on an element starts a new page (legacy `break-before: page` is auto-mapped to `column`); `break-inside: avoid` keeps a block together.
|
|
126
|
+
- **One uniform page geometry per document** — every page shares the frame `geometry` + `pageMargins`; per-section page margins (e.g. a different top margin for an appendix) are NOT expressible under native columns.
|
|
127
|
+
- **Full-bleed edge-to-edge bands are not supported in v1** — furniture insets to the content column. Keep letterhead within the margins for now.
|
|
128
|
+
- **Cross-browser**: the on-screen page breaks are native to the viewing browser; the exported PDF (always Chromium) is the canonical pagination. Content is correct everywhere.
|
|
146
129
|
|
|
147
130
|
- **`content` is a fragment**, not a full document. The platform assembles ONE sandboxed document: it injects `tokens` as `:root` custom properties, the `shared.head`, every `shared.files` stylesheet/script, then each frame's `content`. So a class defined in a `shared` CSS file is available to every frame — you do not write `<link>`/`<style>`/`<head>` yourself (put shared CSS/JS in `shared.files`, not inline `<style>` repeated per frame).
|
|
148
131
|
- **Order is the meaning**: it is the present/export/pagination sequence. Reordering is a list move.
|
|
@@ -230,9 +213,9 @@ Do not request framework/component kits (shadcn, Bits UI, React, Tailwind runtim
|
|
|
230
213
|
|
|
231
214
|
Each slide is one `slides` frame; the shared `deck.css` styles every frame; the platform steps and exports them — there is no hand-rolled navigation or grid.
|
|
232
215
|
|
|
233
|
-
## Example — a flowing letterhead document (
|
|
216
|
+
## Example — a flowing letterhead document (furniture header/footer)
|
|
234
217
|
|
|
235
|
-
A *flowing* letter, contract, or proposal is ONE `pages` frame at a fixed page size; the `content` is the whole body and the platform flows it across pages. (A single fixed page or a multi-page document you compose by hand is an `artboard` instead — see the router; this example is the auto-flow case.) The letterhead
|
|
218
|
+
A *flowing* letter, contract, or proposal is ONE `pages` frame at a fixed page size; the `content` is the whole body and the platform flows it across pages. (A single fixed page or a multi-page document you compose by hand is an `artboard` instead — see the router; this example is the auto-flow case.) The letterhead + footer are the frame's `furniture` (repeated on every page, inset to the content column); `pageMargins` reserves room for them; the page size comes from `geometry`. The "Conditions" exhibit starts a fresh page with `break-before: column`.
|
|
236
219
|
|
|
237
220
|
```json
|
|
238
221
|
{
|
|
@@ -240,7 +223,7 @@ A *flowing* letter, contract, or proposal is ONE `pages` frame at a fixed page s
|
|
|
240
223
|
"title": "Offer of Employment",
|
|
241
224
|
"shared": {
|
|
242
225
|
"files": {
|
|
243
|
-
"doc.css": "*{box-sizing:border-box}body{margin:0;font:14px/1.6 -apple-system,Segoe UI,Roboto,sans-serif;color:#1f2937}
|
|
226
|
+
"doc.css": "*{box-sizing:border-box}body{margin:0;font:14px/1.6 -apple-system,Segoe UI,Roboto,sans-serif;color:#1f2937}h2{color:#16315c;font-size:13px;letter-spacing:.06em;text-transform:uppercase;border-bottom:1px solid #e5e7eb;padding-bottom:6px;margin:22px 0 12px}p{margin:0 0 12px}table{width:100%;border-collapse:collapse;font-size:13px}td{padding:9px 12px;border-bottom:1px solid #eef2f7}tr:nth-child(odd) td{background:#f7f9fc}.exhibit{break-before:column}.lh{display:flex;justify-content:space-between;align-items:flex-end;color:#16315c}.lh b{font-size:16px;letter-spacing:.04em}.lh .sub{font-size:10px;letter-spacing:.12em;color:#6b7280}.lh .addr{text-align:right;font-size:11px;color:#6b7280;line-height:1.5}.ft{font-size:10px;color:#9ca3af}"
|
|
244
227
|
}
|
|
245
228
|
},
|
|
246
229
|
"frames": [
|
|
@@ -248,10 +231,15 @@ A *flowing* letter, contract, or proposal is ONE `pages` frame at a fixed page s
|
|
|
248
231
|
"id": "letter",
|
|
249
232
|
"layout": "pages",
|
|
250
233
|
"geometry": { "width": 816, "height": 1056 },
|
|
251
|
-
"
|
|
234
|
+
"pageMargins": { "top": 140, "right": 64, "bottom": 84, "left": 64 },
|
|
235
|
+
"furniture": {
|
|
236
|
+
"header": { "middle": "<div class=\"lh\"><div><b>Acme Inc.</b><div class=\"sub\">PEOPLE & TALENT</div></div><div class=\"addr\">1 Acme Plaza, Suite 800<br>San Francisco, CA 94105<br>hr@acmeinc.com</div></div>" },
|
|
237
|
+
"footer": { "middle": "<span class=\"ft\">Confidential</span>" }
|
|
238
|
+
},
|
|
239
|
+
"content": "<p style=\"color:#6b7280\">June 17, 2026</p><p><b>Jordan Lee</b><br>742 Evergreen Terrace<br>Portland, OR 97201</p><p>Dear Jordan,</p><p>On behalf of the entire team at Acme Inc., it is our great pleasure to extend this offer…</p><h2>Position Details</h2><table><tr><td>Job Title</td><td>Senior Product Manager</td></tr><tr><td>Start Date</td><td>July 14, 2026</td></tr></table><section class=\"exhibit\"><h2>Conditions of Employment</h2><p>…</p></section>"
|
|
252
240
|
}
|
|
253
241
|
]
|
|
254
242
|
}
|
|
255
243
|
```
|
|
256
244
|
|
|
257
|
-
ONE `pages` frame, fixed `816×1056`; the platform paginates the body into as many pages as the content needs and the
|
|
245
|
+
ONE `pages` frame, fixed `816×1056`; the platform paginates the body into as many pages as the content needs and the furniture header/footer + the auto "Page N of M" repeat on every page. For a different size set `geometry` to a preset (A4 `794×1123`, Tabloid `1056×1632`, …). Never make one frame per page, and never simulate pages with a CSS grid. Author `@page`/`position:running()` CSS is ignored — letterhead lives in `furniture`.
|
|
@@ -1,147 +1,117 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: paged-documents
|
|
3
|
-
description: How to author multi-page print documents (letters, contracts, proposals, reports, briefs) WELL
|
|
3
|
+
description: How to author multi-page print documents (letters, contracts, proposals, reports, briefs) WELL on the native-columns pagination engine — the platform flows a `pages` frame across pages with CSS multi-column. Reference for the `furniture` letterhead/header/footer model, `pageMargins`, `break-before:column`, the uniform-geometry constraint, fragment-safe patterns, and the mandatory render-and-inspect verify loop. Load this whenever you build or edit a paginated document (a `pages` frame); it is the layer beneath any house-style skill.
|
|
4
4
|
loading: on-demand
|
|
5
5
|
---
|
|
6
6
|
|
|
7
|
-
# Paged documents —
|
|
7
|
+
# Paged documents — authoring for the native-columns engine
|
|
8
8
|
|
|
9
|
-
Load this when you build or edit a **flowing** document: a single `pages` frame whose continuous text the platform fragments across pages
|
|
9
|
+
Load this when you build or edit a **flowing** document: a single `pages` frame whose continuous text the platform fragments across pages (letters, contracts, proposals, agreements, reports, briefs, memos of variable / unknown length). The `artifact-canvas` skill covers the frame model; this skill is the reference for the pagination layer. A workspace **house-style** skill (if one exists) sits ON TOP of this — that one carries the org's specific letterhead, type scale, and conventions; this one is the universal craft of making a flowing document render correctly.
|
|
10
10
|
|
|
11
|
-
**
|
|
11
|
+
> **Engine note.** The platform paginates a `pages` frame with **native CSS multi-column** (no paginator library). It lays the whole body out as one tall multi-column flow — one column == one page — and materializes a discrete page tile per page. The practical consequence for authoring: **CSS Paged Media is NOT the mechanism.** Author `@page` rules, `@page` margin boxes (`@top-center` / `@bottom-right` / …), named pages, and `position: running()` **do not render**. Use the `furniture` + `pageMargins` frame fields for repeating letterhead/headers/footers, and `break-before: column` for forced breaks. (Legacy author `break-before: page` is auto-mapped to `column`, so an old doc still breaks; but author NEW docs with `column`.)
|
|
12
12
|
|
|
13
|
-
|
|
13
|
+
**First check you actually need pagination.** A flowing `pages` frame is for AUTO-FLOWING a continuous stream across pages. If the document is a **single fixed page** (flyer, poster, invoice, certificate, one-pager) or a **multi-page document you compose page by page** (brochure, multi-page form, designed report), build it as `artboard` frame(s) instead — one frame per page. See the router in `artifact-canvas`. Use this skill only when you want the platform to break a text stream into pages for you.
|
|
14
|
+
|
|
15
|
+
The single most important habit: **a document is print-bound — you cannot eyeball it like a deck. You MUST render and inspect it, then fix what the render shows, before you say it's done.** See "The verify loop" at the end. Most document defects (a stranded heading, an orphaned rule, a clipped footer) are invisible in the source and obvious in the render.
|
|
14
16
|
|
|
15
17
|
## Mental model
|
|
16
18
|
|
|
17
|
-
You author **one ordinary HTML document body** plus
|
|
19
|
+
You author **one ordinary HTML document body** plus a `furniture` letterhead/footer. The platform fragments that one flowing body into as many fixed-size pages as the content needs, and repeats the furniture on every page. You do NOT build pages by hand — no per-page frames, no page-height spacer divs, no manual page grid. Write the body once; set `furniture` for the running chrome; let the platform paginate.
|
|
18
20
|
|
|
19
21
|
```
|
|
20
|
-
ONE <pages> frame ──
|
|
21
|
-
whole body
|
|
22
|
+
ONE <pages> frame ──native columns──▶ page 1 │ page 2 │ page 3 │ … (real multi-page PDF)
|
|
23
|
+
whole body each carries pageMargins + furniture header/footer + "Page N of M"
|
|
22
24
|
```
|
|
23
25
|
|
|
24
26
|
## The platform contract (what we give you, what is fixed)
|
|
25
27
|
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
- **Page
|
|
29
|
-
- **
|
|
30
|
-
- **
|
|
31
|
-
- **Fixed height is required to paginate.** A `pages` frame with a fixed height (e.g. `1056`) flows overflow onto more pages.
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
**Named pages** give a specific page its own rules — the classic use is a **cover page with no running header/footer**, then a forced break into the body:
|
|
46
|
-
|
|
47
|
-
```css
|
|
48
|
-
@page cover { margin: 0; } /* full-bleed cover */
|
|
49
|
-
@page cover { @top-left { content: none } @top-right { content: none } @bottom-right { content: none } }
|
|
50
|
-
.cover { page: cover; break-after: page; } /* this element is the cover; body starts on the next page */
|
|
51
|
-
```
|
|
52
|
-
|
|
53
|
-
`@page :first`, `@page :left`, `@page :right`, and `@page :blank` also work (e.g. mirrored margins for a bound document, or suppressing furniture on the first page).
|
|
54
|
-
|
|
55
|
-
## Page-margin boxes — left/right header text, and the width trap
|
|
56
|
-
|
|
57
|
-
A running header/footer of **short text** lives directly in margin-box slots. The top edge has these (the bottom mirrors them); each slot positions itself, so left + right text needs no layout work:
|
|
58
|
-
|
|
59
|
-
```
|
|
60
|
-
@top-left-corner │ @top-left │ @top-center │ @top-right │ @top-right-corner
|
|
61
|
-
```
|
|
62
|
-
|
|
63
|
-
**The reliable two-part header — separate slots, no width:**
|
|
64
|
-
|
|
65
|
-
```css
|
|
66
|
-
@page {
|
|
67
|
-
@top-left { content: "Acme Inc." } /* sits at the left of the top margin */
|
|
68
|
-
@top-right { content: "Project Brief" } /* sits at the right */
|
|
69
|
-
@bottom-right { content: counter(page) }
|
|
28
|
+
- **Page SIZE is the frame `geometry` — ANY width × height, portrait, landscape, or arbitrary.** Common print presets (portrait; swap width↔height for landscape): US-Letter `816×1056`, Legal `816×1344`, Tabloid `1056×1632`, A4 `794×1123`, A3 `1123×1587`, A5 `559×794`. A custom size is equally valid (a landscape report `1056×816`, a square `1000×1000`). Pick the geometry the document calls for. Do NOT write `@page { size }` — it is ignored; geometry is the size.
|
|
29
|
+
- **`pageMargins`** (a `pages` frame field, px per side; absent sides default to top 96 / sides 72 / bottom 84) sets the page margins. The content area is `width − left − right` by `height − top − bottom`. Scale margins to the page size, and make the top/bottom big enough for the furniture (a tall letterhead needs a taller top margin — furniture is out-of-flow and can't reserve its own space).
|
|
30
|
+
- **Page numbers** default to "Page N of M" bottom-right on every page; the **`pageNumbers`** frame field controls them — hide them (`{ "show": false }`), restyle the text (`"format": "{n}"` for a bare numeral; `{n}` = page, `{m}` = last page), move to any corner/edge (`"position": "top-center"`), skip the cover (`"showOnFirst": false`), or pin near the page edge (`"offset"`). A `furniture.footer` clears the *default* bottom-right counter automatically; if you MOVE the number (e.g. `bottom-left`, `top-center`), make sure it doesn't collide with furniture in that same corner — clearance is only automatic for the default position.
|
|
31
|
+
- **ONE uniform page geometry per document.** Every page shares the same `geometry` + `pageMargins`. Per-section page margins (a different top margin for an appendix vs the cover) are NOT expressible under native columns — pick one geometry that works for the whole document. This is the one real constraint vs the old `@page`-per-section model.
|
|
32
|
+
- **The page-box model (know this — it explains margin behavior).** `pageMargins.top` reserves a band the **body cannot write into** (body starts at the content edge; content pushed above it is clipped, not drawn into the margin). Furniture by default anchors at that content edge, so with a deep top margin a header sits LOW (just above the body). To put a masthead HIGH while keeping a deep body margin, anchor the furniture to the page edge (`furniture.header.anchor: "page"`, below).
|
|
33
|
+
- **Fixed height is required to paginate.** A `pages` frame with a fixed height (e.g. `1056`) flows overflow onto more pages. `height: "auto"` does NOT paginate — it renders as one tall continuous page. Use `auto` only for a deliberately single, non-paginated scroll.
|
|
34
|
+
- **Cross-browser.** On-screen page breaks are computed by the *viewing* browser's native fragmentation, so a Safari/Firefox user may see breaks fall a line differently than Chrome. The exported PDF (always Chromium) is the **canonical** pagination. Content is correct everywhere; don't hand-tune to one browser's break positions.
|
|
35
|
+
|
|
36
|
+
## Letterhead, running headers & footers — the `furniture` field
|
|
37
|
+
|
|
38
|
+
`furniture` is `{ header?, footer? }`; each region has `first` (page 1), `middle` (the rest, and the fallback), and `last` (final page) HTML. The platform tucks the header into the top margin and the footer into the bottom on every page, inset to the content column, never overlapping the body. Style the furniture HTML from a `shared` CSS file (classes resolve globally).
|
|
39
|
+
|
|
40
|
+
```jsonc
|
|
41
|
+
"pageMargins": { "top": 140, "right": 64, "bottom": 84, "left": 64 },
|
|
42
|
+
"furniture": {
|
|
43
|
+
"header": {
|
|
44
|
+
"middle": "<div class=\"lh\"><div><b>Acme Inc.</b><div class=\"sub\">PEOPLE & TALENT</div></div><div class=\"addr\">1 Acme Plaza · San Francisco · hr@acmeinc.com</div></div>"
|
|
45
|
+
},
|
|
46
|
+
"footer": { "middle": "<span class=\"ft\">Confidential</span>" }
|
|
70
47
|
}
|
|
71
48
|
```
|
|
72
49
|
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
}
|
|
94
|
-
.doc { padding: 0 64px; } /* body supplies its own gutters */
|
|
50
|
+
- Put **real designed HTML** in furniture (a logo lockup, an address block, a rule) — aim for a designed letterhead, not a plain text line. Lay multi-part headers out with flex or absolute positioning inside the furniture HTML; it is normal in-margin HTML (no Paged.js clone caveats).
|
|
51
|
+
- Use **`first`** to vary page 1 (e.g. a fuller masthead on page 1, a slim running header on the rest) and **`last`** for a closing line.
|
|
52
|
+
- **`anchor` + `offset` per region** place it in the margin band: `"anchor": "content"` (default) hugs the body edge (a running header just above the text); `"anchor": "page"` pins it to the page's outer edge, `"offset"` px in. Use `header.anchor: "page"` for a **letterhead masthead that rides high** even with a deep `pageMargins.top` — the body keeps the deep margin while the masthead sits at the top edge. Put a final-page contact block in `header.last` with `anchor: "page"` to ride high on the last page only.
|
|
53
|
+
- **Per-page variation is first-class:** `first`/`middle`/`last` slots for different furniture per page, a `first`-only header for a masthead on page 1 only, and `pageNumbers.showOnFirst: false` to drop the number on a cover.
|
|
54
|
+
- **Full-bleed edge-to-edge bands are not supported in v1** — furniture insets to the content column. Keep letterhead within the margins.
|
|
55
|
+
|
|
56
|
+
### Letterhead the clean way (masthead high, body low, bare numeral up top)
|
|
57
|
+
|
|
58
|
+
A classic letter: deep top margin for the body, masthead riding high on page 1, a bare numeral top-center on pages 2+, contact block high on the last page.
|
|
59
|
+
|
|
60
|
+
```jsonc
|
|
61
|
+
"pageMargins": { "top": 192, "right": 96, "bottom": 96, "left": 96 }, // ~2in body margin
|
|
62
|
+
"furniture": {
|
|
63
|
+
"header": {
|
|
64
|
+
"first": "<div class=\"mast\">…masthead…</div>", // page 1 only
|
|
65
|
+
"last": "<div class=\"contact\">…contact block…</div>", // last page only (top-left)
|
|
66
|
+
"anchor": "page", "offset": 28 // both ride high at the top edge
|
|
67
|
+
}
|
|
68
|
+
},
|
|
69
|
+
"pageNumbers": { "position": "top-center", "format": "{n}", "showOnFirst": false, "offset": 28 }
|
|
95
70
|
```
|
|
96
71
|
|
|
97
|
-
|
|
72
|
+
The body sits at the deep 2in margin on every page (uniform geometry, unchanged); the masthead/contact ride at the page edge via `anchor: "page"`; the numeral is a bare `{n}` top-center, skipped on the cover.
|
|
98
73
|
|
|
99
|
-
|
|
74
|
+
## Break control (the craft that separates clean from sloppy)
|
|
100
75
|
|
|
101
|
-
|
|
76
|
+
- `break-before: column` / `break-after: column` — start a section/exhibit on a fresh page. (Author `column`; `page` is auto-mapped but `column` is the native value.)
|
|
77
|
+
- `break-inside: avoid` — keep a block together (a figure + caption, a table row group, a signature block, a heading + its first lines).
|
|
78
|
+
- `break-after: avoid` on headings — so a heading is never stranded alone at a page bottom with its content on the next page.
|
|
79
|
+
- `orphans` / `widows` (e.g. `p { orphans: 2; widows: 2 }`) — no single dangling line of a paragraph across a page break. Native columns honor these.
|
|
80
|
+
- **Do NOT emit a divider (`<hr>`, a `border-top` separator) immediately before a forced `break-before` section.** The page break already IS the separator; the divider lands orphaned at the bottom of the prior page.
|
|
102
81
|
|
|
103
|
-
##
|
|
82
|
+
## Fragment-safe hanging indents (numbered clauses)
|
|
104
83
|
|
|
105
|
-
|
|
84
|
+
A numbered-clause / hanging-indent layout (`1. … text …`) must survive a mid-clause page break. The **float** form (`.num{float:left}` + `.txt{margin-left}`) collapses on a continuation fragment. Use the **absolute + padding** form — `padding-left` survives fragmentation, so a clause that breaks across a page keeps its indent on the continuation:
|
|
106
85
|
|
|
107
86
|
```css
|
|
108
|
-
|
|
87
|
+
.clause { position: relative; padding-left: 48px; } /* the hanging gutter */
|
|
88
|
+
.clause .num { position: absolute; left: 0; top: 0; } /* the number sits in the gutter */
|
|
89
|
+
/* the clause text flows in the padded area and continues cleanly onto the next page */
|
|
109
90
|
```
|
|
110
91
|
|
|
111
|
-
`target-counter(attr(href url), page)` resolves the page of a target — use it for a table of contents or cross-references ("see p. 4").
|
|
112
|
-
|
|
113
|
-
## Break control (the craft that separates clean from sloppy)
|
|
114
|
-
|
|
115
|
-
- `break-before: page` / `break-after: page` — start a section/exhibit on a fresh page.
|
|
116
|
-
- `break-inside: avoid` — keep a block together (a figure + caption, a table row, a signature block, a heading + its first lines).
|
|
117
|
-
- `break-after: avoid` on headings — so a heading is never stranded alone at the bottom of a page with its content on the next.
|
|
118
|
-
- `orphans` / `widows` (e.g. `p { orphans: 2; widows: 2 }`) — no single dangling line of a paragraph across a page break.
|
|
119
|
-
- **Do NOT emit a divider (`<hr>`, a `border-top` separator) immediately before a forced `break-before` section.** The page break already IS the separator; the divider lands orphaned at the bottom of the prior page. Put separators BETWEEN in-flow sections only, not where a page break does the dividing.
|
|
120
|
-
|
|
121
92
|
## Vertical rhythm and spacing
|
|
122
93
|
|
|
123
|
-
Give headings real breathing room and keep spacing consistent (
|
|
94
|
+
Give headings real breathing room and keep spacing consistent (one scale: space below a section heading ≥ space between paragraphs, so headers don't read as glued to their body). The EXACT scale (sizes, leading, margins) is **house style** — defer to the workspace house-style skill if one exists; absent that, pick one scale and apply it everywhere rather than ad-hoc values per section.
|
|
124
95
|
|
|
125
96
|
## The verify loop (mandatory — not optional for documents)
|
|
126
97
|
|
|
127
|
-
After `create_artifact` / `patch_artifact`, **`inspect_artifact` the document and READ the rendered pages**, then fix and re-inspect until clean. A `pages` frame paginates rather than cropping, so it never appears in `framesOverflowing` — that is exactly why you must look at the pixels.
|
|
98
|
+
After `create_artifact` / `patch_artifact`, **`inspect_artifact` the document and READ the rendered pages**, then fix and re-inspect until clean. A `pages` frame paginates rather than cropping, so it never appears in `framesOverflowing` — that is exactly why you must look at the pixels. The inspect result also carries a `documentPagination` signal: if `ran:false`, the compositor did not paginate (it threw on the document's CSS — check the page console/errors) and the render shows page 1 only; fix the CSS and re-inspect. On the render, check:
|
|
128
99
|
|
|
129
|
-
- **
|
|
100
|
+
- **Furniture (letterhead/footer) fully visible** on every page — not overlapping the body (if it does, grow `pageMargins.top`/`.bottom`).
|
|
130
101
|
- **No stranded headings** at page bottoms and **no orphaned rules/dividers** at page edges.
|
|
131
|
-
- **Tables and blocks break sanely** (no row split mid-cell, no header row alone at a page bottom).
|
|
132
|
-
- **
|
|
133
|
-
- **
|
|
102
|
+
- **Tables and blocks break sanely** (no row split mid-cell, no header row alone at a page bottom — use `break-inside: avoid`).
|
|
103
|
+
- **Numbered clauses** keep their hanging indent across page breaks (use the absolute+padding form above).
|
|
104
|
+
- **Page numbers** run 1…N; the page count looks right for the content.
|
|
134
105
|
|
|
135
|
-
Do not describe the structure and stop. Render it, look at it, fix what you see.
|
|
106
|
+
Do not describe the structure and stop. Render it, look at it, fix what you see.
|
|
136
107
|
|
|
137
108
|
## Quick checklist
|
|
138
109
|
|
|
139
|
-
- [ ] ONE `pages` frame, fixed width AND height — the size the document needs (portrait, landscape, or arbitrary; via geometry
|
|
140
|
-
- [ ]
|
|
141
|
-
- [ ] Letterhead /
|
|
142
|
-
- [ ]
|
|
143
|
-
- [ ]
|
|
144
|
-
- [ ] Cover/first page handled with a named page if it differs.
|
|
145
|
-
- [ ] `break-inside: avoid` on blocks that must stay together; `break-after: avoid` on headings; no divider right before a `break-before`.
|
|
110
|
+
- [ ] ONE `pages` frame, fixed width AND height — the size the document needs (portrait, landscape, or arbitrary; via `geometry`, no `@page { size }`).
|
|
111
|
+
- [ ] `pageMargins` scaled to that page size (not copied Letter numbers); top/bottom leave room for the furniture.
|
|
112
|
+
- [ ] Letterhead / running header / footer → the `furniture` field (NOT `@page` margin boxes or `position:running()` — those don't render).
|
|
113
|
+
- [ ] Forced breaks use `break-before: column`; `break-inside: avoid` on blocks that must stay together; `break-after: avoid` on headings; no divider right before a break.
|
|
114
|
+
- [ ] Numbered clauses use the absolute + `padding-left` hanging-indent form.
|
|
146
115
|
- [ ] Consistent spacing scale (defer the exact scale to the house-style skill).
|
|
116
|
+
- [ ] One uniform geometry — no per-section margins.
|
|
147
117
|
- [ ] **Rendered and inspected; the pages actually look right.**
|
|
@@ -64,7 +64,7 @@ export function createArtifactTools(onArtifact, options = {}) {
|
|
|
64
64
|
{
|
|
65
65
|
name: 'create_artifact',
|
|
66
66
|
label: 'Create Artifact',
|
|
67
|
-
description: 'Create or update a persisted sandboxed canvas artifact from an ordered list of frames (each a fragment of HTML/CSS/JS). Use this for DESIGNED, laid-out, visual outputs: slide decks, social graphics, prototypes, diagrams, whiteboards, and documents the user wants DESIGNED on letterhead / as a formatted PDF. A plain prose draft of a proposal, contract, memo, or report is a "document" ENTRY (create_entity), NOT an artifact — build a document artifact only when the user signals a designed/print output (on letterhead, a formatted PDF, "design a…"); when ambiguous, prefer the document entry or ask. Match the artifact TYPE to its frame structure: a slide DECK is N "slides" frames, one per slide (e.g. 1280×720); a designed DOCUMENT — a letter, contract, proposal, or report laid out on letterhead — is ONE "pages" frame whose content is the WHOLE document body at a fixed page size (US-Letter 816×1056; also Legal 816×1344, Tabloid 1056×1632, A4 794×1123, A3 1123×1587, A5 559×794): the platform flows the text across as many pages as needed, numbers them, and exports a real multi-page PDF — so do NOT set a document\'s height to "auto", do NOT split it into one frame per page, and do NOT build a page grid inside an "app"/"artboard" frame. Style the document as rich HTML/CSS; for repeating letterhead/headers/footers
|
|
67
|
+
description: 'Create or update a persisted sandboxed canvas artifact from an ordered list of frames (each a fragment of HTML/CSS/JS). Use this for DESIGNED, laid-out, visual outputs: slide decks, social graphics, prototypes, diagrams, whiteboards, and documents the user wants DESIGNED on letterhead / as a formatted PDF. A plain prose draft of a proposal, contract, memo, or report is a "document" ENTRY (create_entity), NOT an artifact — build a document artifact only when the user signals a designed/print output (on letterhead, a formatted PDF, "design a…"); when ambiguous, prefer the document entry or ask. Match the artifact TYPE to its frame structure: a slide DECK is N "slides" frames, one per slide (e.g. 1280×720); a designed DOCUMENT — a letter, contract, proposal, or report laid out on letterhead — is ONE "pages" frame whose content is the WHOLE document body at a fixed page size (US-Letter 816×1056; also Legal 816×1344, Tabloid 1056×1632, A4 794×1123, A3 1123×1587, A5 559×794): the platform flows the text across as many pages as needed, numbers them, and exports a real multi-page PDF — so do NOT set a document\'s height to "auto", do NOT split it into one frame per page, and do NOT build a page grid inside an "app"/"artboard" frame. Style the document as rich HTML/CSS; for repeating letterhead/headers/footers set the frame\'s "furniture" field ({header?,footer?}, each {first?,middle?,last?} HTML, repeated on every page, inset to the content column) plus "pageMargins" (px per side; defaults top 96 / sides 72 / bottom 84), and force a page break with "break-before:column". The platform paginates with NATIVE CSS multi-column, so author "@page" margin boxes and "position:running()" no longer render — use furniture/pageMargins instead, and keep ONE uniform page geometry per document (no per-section page margins). A GRAPHIC, poster, or diagram is "artboard" frame(s) at a fixed size; an APP or prototype is a single "app" frame with fill geometry; a WHITEBOARD is a single "whiteboard" frame. Never hand-roll a stepper, filmstrip, pagination, or page grid inside one frame — emit the right frames and let the platform arrange, step, and paginate. When chat is scoped to an artifact entry, this updates that canvas. If the user references another EXISTING artifact entry, pass target.entityId and target.repo when known. To create a SEPARATE new artifact while the chat is scoped to one, pass createNew: true (optionally with target.repo to pick the destination folder) — the scoped canvas is left untouched. Otherwise this creates a new artifact entry. To EDIT an existing artifact, first call read_artifact to get the current source and its hash, modify the full bundle, and pass that hash as baseHash so a concurrent change is detected instead of silently overwritten. The result reports the resolved frame structure (manifest) and any warnings — check the frame count and per-frame layouts against what the user asked for (a deck is N "slides" frames, not one "app" frame) and fix it before responding.',
|
|
68
68
|
parameters: T.Object({
|
|
69
69
|
bundle: T.Object({}, {
|
|
70
70
|
description: 'ArtifactBundle object with artifactId, title, and frames: an ordered, non-empty array of { id, title?, layout (slides|pages|artboard|app|whiteboard), geometry ({ width, height }), content (the frame\'s HTML fragment), background? (neutral|transparent|a safe CSS color or gradient — set it to the design\'s real surface so a dark/colored frame does not render white) }. A "pages" (document) frame also accepts furniture ({ header?: {first?,middle?,last?}, footer?: {first?,middle?,last?} } — per-page running header/footer for letterhead) and pageMargins ({ top?, right?, bottom?, left? } in px). Optional bundle-level: shared ({ files, head }) for code shared across frames, tokens (CSS design variables), libraries (three, d3, motion).',
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"artifact-tools.js","sourceRoot":"","sources":["../../../src/agent/tools/artifact-tools.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,UAAU,EAAE,MAAM,QAAQ,CAAC;AACpC,OAAO,EAAE,IAAI,IAAI,CAAC,EAAE,MAAM,SAAS,CAAC;AACpC,OAAO,EAAE,sBAAsB,EAAuB,MAAM,oCAAoC,CAAC;AACjG,OAAO,EAAE,kBAAkB,EAAE,kBAAkB,EAAE,MAAM,8BAA8B,CAAC;AACtF,OAAO,EAAE,qBAAqB,EAAE,MAAM,iCAAiC,CAAC;AACxE,OAAO,EAAE,sBAAsB,EAAE,MAAM,iCAAiC,CAAC;AACzE,OAAO,EACL,oCAAoC,EACpC,qBAAqB,EACrB,wBAAwB,GAGzB,MAAM,0CAA0C,CAAC;AAClD,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAwDlD;;oFAEoF;AACpF,MAAM,UAAU,gBAAgB,CAAC,IAAY;IAC3C,OAAO,UAAU,CAAC,QAAQ,CAAC,CAAC,MAAM,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,KAAK,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC;AAC9E,CAAC;AAED;;;;4EAI4E;AAC5E,MAAM,CAAC,MAAM,yBAAyB,GAAG,IAAI,GAAG,CAAC,CAAC,iBAAiB,EAAE,gBAAgB,CAAC,CAAC,CAAC;AAExF;mFACmF;AACnF,MAAM,UAAU,4BAA4B,CAAC,QAAgB;IAC3D,MAAM,IAAI,GAAG,QAAQ,KAAK,gBAAgB,CAAC,CAAC,CAAC,OA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AC,EAAE,OAAO,EAAE,KAAK,EAAE,KAAK,EAAE,GAAG,YAAY,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;gBACrG,CAAC;gBACD,IAAI,CAAC;oBACH,MAAM,QAAQ,GAAG,qBAAqB,CAAC,IAAI,CAAC,MAAM,EAAE,EAAE,OAAO,EAAE,MAAM,CAAC,OAAO,EAAE,CAAC,CAAC;oBACjF,OAAO,cAAc,CAAC,EAAE,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,CAAC,IAAI,EAAE,SAAS,EAAE,IAAI,CAAC,SAAS,EAAE,GAAG,QAAQ,EAAE,CAAC,CAAC;gBACpG,CAAC;gBAAC,OAAO,GAAG,EAAE,CAAC;oBACb,iEAAiE;oBACjE,OAAO,cAAc,CAAC,EAAE,OAAO,EAAE,KAAK,EAAE,KAAK,EAAE,GAAG,YAAY,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;gBACrG,CAAC;YACH,CAAC;SACF;KACF,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Rewrite author CSS so a `pages` document's flowing content paginates under
|
|
3
|
+
* NATIVE CSS multi-column (the columns compositor) instead of Paged.js.
|
|
4
|
+
*
|
|
5
|
+
* WHY: the compositor lays the document body out as one tall multi-column flow
|
|
6
|
+
* (`column-width` = the page content width); each column == one page. Two author
|
|
7
|
+
* CSS idioms were written for Paged.js's `@page` model and DON'T translate:
|
|
8
|
+
* 1. Forced PAGE breaks (`break-before:page`, legacy `page-break-*:always`, …)
|
|
9
|
+
* do nothing inside a multicol container — they must become COLUMN breaks.
|
|
10
|
+
* 2. `position:running(name)` elements (the source for `@page` margin-box
|
|
11
|
+
* running headers) are inert outside `@page`; left in the body flow they
|
|
12
|
+
* render as stray in-flow content. They must be removed from the flow.
|
|
13
|
+
*
|
|
14
|
+
* This is a BUILD-TIME transform (run once on the emitted shared CSS + each
|
|
15
|
+
* paginated frame's inline `<style>` blocks), so there is no sandboxed-runtime
|
|
16
|
+
* twin to keep in lock-step — unlike the former Paged.js url() sanitizer.
|
|
17
|
+
*
|
|
18
|
+
* PARSER, NOT BARE REGEX: a naive `String.replace` would corrupt a
|
|
19
|
+
* `content:"break-before:page"` string literal, a `/* break-before:page */`
|
|
20
|
+
* comment, or text inside a `url()`. So we first SEGMENT the CSS — copying
|
|
21
|
+
* comments, string literals, and `url()` tokens through VERBATIM — and apply the
|
|
22
|
+
* property/value rewrites ONLY to the "normal" CSS runs between them. The
|
|
23
|
+
* segmenter mirrors the skip logic of the (removed) `artifact-paged-css.ts` url
|
|
24
|
+
* scanner: it honors `\` escapes and never matches `url(` inside a comment or
|
|
25
|
+
* string.
|
|
26
|
+
*
|
|
27
|
+
* Scope: `@page` blocks and the `page:` property are left untouched — they are
|
|
28
|
+
* simply ignored by the screen render (and the PDF export composites the page
|
|
29
|
+
* tiles, so it never consults the author's `@page`). Named-page break values are
|
|
30
|
+
* not real `break-before` keywords, so they need no mapping.
|
|
31
|
+
*/
|
|
32
|
+
/**
|
|
33
|
+
* Token-aware rewrite of author CSS for the native-columns compositor. Copies
|
|
34
|
+
* comments / string literals / `url()` tokens through verbatim; rewrites forced
|
|
35
|
+
* page breaks → column breaks and neutralizes `position:running()` only in the
|
|
36
|
+
* normal CSS between them. Idempotent (a second pass finds nothing to change).
|
|
37
|
+
*/
|
|
38
|
+
export declare function rewriteAuthorCssForColumns(css: string): string;
|