studiograph 1.3.48-next.261 → 1.3.48-next.262

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 (175) hide show
  1. package/dist/agent/prompts/system.md +2 -2
  2. package/dist/agent/skills/artifact-canvas/skill.md +25 -37
  3. package/dist/agent/skills/paged-documents/skill.md +53 -103
  4. package/dist/agent/tools/artifact-tools.js +1 -1
  5. package/dist/agent/tools/artifact-tools.js.map +1 -1
  6. package/dist/core/artifact-columns-css.d.ts +38 -0
  7. package/dist/core/artifact-columns-css.js +157 -0
  8. package/dist/core/artifact-columns-css.js.map +1 -0
  9. package/dist/core/artifact-frame-document.d.ts +57 -15
  10. package/dist/core/artifact-frame-document.js +351 -346
  11. package/dist/core/artifact-frame-document.js.map +1 -1
  12. package/dist/mcp/tools.js +8 -8
  13. package/dist/mcp/tools.js.map +1 -1
  14. package/dist/server/routes/artifact-export-api.js +2 -3
  15. package/dist/server/routes/artifact-export-api.js.map +1 -1
  16. package/dist/services/artifact-library-sources.d.ts +1 -6
  17. package/dist/services/artifact-library-sources.js +1 -9
  18. package/dist/services/artifact-library-sources.js.map +1 -1
  19. package/dist/services/artifact-render-export.d.ts +3 -3
  20. package/dist/services/artifact-render-export.js +57 -50
  21. package/dist/services/artifact-render-export.js.map +1 -1
  22. package/dist/web/_app/immutable/chunks/2jM_FrdF.js +1 -0
  23. package/dist/web/_app/immutable/chunks/{DtXJCaQc2.js → 3Jf1z4Hy2.js} +1 -1
  24. package/dist/web/_app/immutable/chunks/3e54b3S0.js +1 -0
  25. package/dist/web/_app/immutable/chunks/7pkBLE0o.js +23 -0
  26. package/dist/web/_app/immutable/chunks/{B9VQbssY.js → B1pVemww.js} +1 -1
  27. package/dist/web/_app/immutable/chunks/{DMFH9Cnt2.js → B4K-yj0D2.js} +1 -1
  28. package/dist/web/_app/immutable/chunks/B7P31uII.js +1 -0
  29. package/dist/web/_app/immutable/chunks/B7QhSEou.js +1 -0
  30. package/dist/web/_app/immutable/chunks/{F5xZdLlB.js → B7WN6QF2.js} +1 -1
  31. package/dist/web/_app/immutable/chunks/{Cg7m1gqN.js → BBiZOxjN.js} +1 -1
  32. package/dist/web/_app/immutable/chunks/BH8Lm2ff.js +1 -0
  33. package/dist/web/_app/immutable/chunks/BLw5bIbe.js +1 -0
  34. package/dist/web/_app/immutable/chunks/{Oglnp7sm.js → BNq2--8a.js} +1 -1
  35. package/dist/web/_app/immutable/chunks/BaEbafZv.js +1 -0
  36. package/dist/web/_app/immutable/chunks/{sUAtda6y2.js → BeMEksa_2.js} +1 -1
  37. package/dist/web/_app/immutable/chunks/BksI9pEP.js +2 -0
  38. package/dist/web/_app/immutable/chunks/{CLninaDG2.js → Bncd_2iV2.js} +2 -2
  39. package/dist/web/_app/immutable/chunks/Bo6vsMxZ.js +1 -0
  40. package/dist/web/_app/immutable/chunks/{D0_Iu3Uj.js → BwZmyfEX.js} +1 -1
  41. package/dist/web/_app/immutable/chunks/{7l950wkn.js → CB2VdVc2.js} +1 -1
  42. package/dist/web/_app/immutable/chunks/CGG26Xmx.js +1 -0
  43. package/dist/web/_app/immutable/chunks/{K5YHt1WL2.js → CRANgTjw2.js} +1 -1
  44. package/dist/web/_app/immutable/chunks/{CuatNdzp.js → CSkL5wO6.js} +1 -1
  45. package/dist/web/_app/immutable/chunks/C_vyTCDY.js +1 -0
  46. package/dist/web/_app/immutable/chunks/{CQW66fYJ.js → Ca57r8F-.js} +1 -1
  47. package/dist/web/_app/immutable/chunks/CbnTIbQI2.js +915 -0
  48. package/dist/web/_app/immutable/chunks/{CR1JY_cb.js → CdvkVymz2.js} +1 -1
  49. package/dist/web/_app/immutable/chunks/{atFSAfcd2.js → Cf7pPlrJ2.js} +2 -2
  50. package/dist/web/_app/immutable/chunks/{CKwV6HKc.js → Cg5kjIaW.js} +1 -1
  51. package/dist/web/_app/immutable/chunks/{BvyVm7-j.js → CmPtL-Rn.js} +1 -1
  52. package/dist/web/_app/immutable/chunks/{B3u4QMoU.js → CnpFxw1N2.js} +1 -1
  53. package/dist/web/_app/immutable/chunks/D2G8GgRX.js +1 -0
  54. package/dist/web/_app/immutable/chunks/D3ZdQV1G2.js +66 -0
  55. package/dist/web/_app/immutable/chunks/{snCOoD78.js → D74E7DtA.js} +1 -1
  56. package/dist/web/_app/immutable/chunks/{B4PrlkmE.js → D8nBN3-t.js} +1 -1
  57. package/dist/web/_app/immutable/chunks/{Bpmx7Umc.js → DE5MFphK.js} +1 -1
  58. package/dist/web/_app/immutable/chunks/DGayKSDC.js +1 -0
  59. package/dist/web/_app/immutable/chunks/{BU5TCj7m.js → DHtwYMGu2.js} +1 -1
  60. package/dist/web/_app/immutable/chunks/DIro3eQz.js +1 -0
  61. package/dist/web/_app/immutable/chunks/{DgP0Pxes.js → DJ61sY6B.js} +1 -1
  62. package/dist/web/_app/immutable/chunks/{-MYqXlc3.js → DLFxzom2.js} +1 -1
  63. package/dist/web/_app/immutable/chunks/{BIeOkmiV.js → DOTPES0g.js} +1 -1
  64. package/dist/web/_app/immutable/chunks/DWbRq2tL.js +1 -0
  65. package/dist/web/_app/immutable/chunks/{BBrP9GiZ.js → D_iZ9buk.js} +1 -1
  66. package/dist/web/_app/immutable/chunks/Dm-W1U3E.js +1 -0
  67. package/dist/web/_app/immutable/chunks/{DhD1HF7R.js → DnUROuxo.js} +1 -1
  68. package/dist/web/_app/immutable/chunks/{B5UH1FNe.js → DqGcR20a.js} +3 -3
  69. package/dist/web/_app/immutable/chunks/{DaB0hU8_.js → DqGo4lyB2.js} +1 -1
  70. package/dist/web/_app/immutable/chunks/{ChS3kWO-.js → DrD4p8T22.js} +1 -1
  71. package/dist/web/_app/immutable/chunks/{-Tbr-96c2.js → DtsNBsm82.js} +1 -1
  72. package/dist/web/_app/immutable/chunks/{B06uE1qJ.js → DwvPlTQh.js} +1 -1
  73. package/dist/web/_app/immutable/chunks/{CZBW5wi82.js → DxPoYrW02.js} +1 -1
  74. package/dist/web/_app/immutable/chunks/DxQ5eC8d.js +1 -0
  75. package/dist/web/_app/immutable/chunks/{2z2ekE6D2.js → DzBvLWrB2.js} +2 -2
  76. package/dist/web/_app/immutable/chunks/{CcgYvk_3.js → G9YEWi42.js} +1 -1
  77. package/dist/web/_app/immutable/chunks/{CQl_RUVN2.js → HMuf07932.js} +1 -1
  78. package/dist/web/_app/immutable/chunks/{CG8YKaqc.js → HdbzGSgU.js} +1 -1
  79. package/dist/web/_app/immutable/chunks/{Cxdio_Al.js → Mozc9LAu.js} +3 -3
  80. package/dist/web/_app/immutable/chunks/{D-vvXTU3.js → Ryiz4ZhP.js} +2 -2
  81. package/dist/web/_app/immutable/chunks/{1QRy7-wo.js → gIVpw0C1.js} +1 -1
  82. package/dist/web/_app/immutable/chunks/{Cx5IiiDO2.js → gwOFYscJ2.js} +1 -1
  83. package/dist/web/_app/immutable/chunks/nacCpTNj.js +83 -0
  84. package/dist/web/_app/immutable/chunks/{PwUOTfSv.js → rSrKfaH92.js} +1 -1
  85. package/dist/web/_app/immutable/chunks/{CkivrILi.js → tvHn3XYh.js} +1 -1
  86. package/dist/web/_app/immutable/chunks/{pPsy4008.js → w53PifJt.js} +1 -1
  87. package/dist/web/_app/immutable/entry/app.D9mnvkg5.js +2 -0
  88. package/dist/web/_app/immutable/entry/start.B1L019Jv.js +1 -0
  89. package/dist/web/_app/immutable/nodes/{0.v0W5DL7W.js → 0.GCsQhZXx.js} +2 -2
  90. package/dist/web/_app/immutable/nodes/{1.81Rb3Ith.js → 1.Bai1Q_j6.js} +1 -1
  91. package/dist/web/_app/immutable/nodes/{10.CAlZNFOq.js → 10.Y-zXN2Lv.js} +1 -1
  92. package/dist/web/_app/immutable/nodes/{11.CCfUginI.js → 11.BGLbrt6p.js} +1 -1
  93. package/dist/web/_app/immutable/nodes/{12.BJLboAyk.js → 12.kkg6EDtl.js} +1 -1
  94. package/dist/web/_app/immutable/nodes/{13.Cz4UTl2G.js → 13.DVLmp3Ll.js} +1 -1
  95. package/dist/web/_app/immutable/nodes/15.B6Aw4lhr.js +1 -0
  96. package/dist/web/_app/immutable/nodes/{16.BjohAUt9.js → 16.BvduImqP.js} +1 -1
  97. package/dist/web/_app/immutable/nodes/{18.DsOT0tDo.js → 18.pwlJhpUE.js} +1 -1
  98. package/dist/web/_app/immutable/nodes/{19.BiJWLOUT.js → 19.CC1kL3Df.js} +1 -1
  99. package/dist/web/_app/immutable/nodes/2.CvV_5gfw.js +124 -0
  100. package/dist/web/_app/immutable/nodes/{3.BIT9mm9r.js → 3.DBPrinvQ.js} +1 -1
  101. package/dist/web/_app/immutable/nodes/{4.Cn7r0Poe.js → 4.A-1yULWB.js} +3 -3
  102. package/dist/web/_app/immutable/nodes/{5.CkJNdCZG.js → 5.CN9jkFSb.js} +1 -1
  103. package/dist/web/_app/immutable/nodes/{6.1rbIRQgQ.js → 6.B2TGmdUT.js} +1 -1
  104. package/dist/web/_app/immutable/nodes/{7.w17Zl36i.js → 7.DQFIEPX4.js} +1 -1
  105. package/dist/web/_app/immutable/nodes/{8.DqTsYuU-.js → 8.CsTDHJ_M.js} +1 -1
  106. package/dist/web/_app/immutable/nodes/{9.BJhYZPfc.js → 9.B9zlBMg4.js} +1 -1
  107. package/dist/web/_app/version.json +1 -1
  108. package/dist/web/index.html +17 -17
  109. package/package.json +1 -2
  110. package/dist/core/artifact-bundle.d.ts +0 -69
  111. package/dist/core/artifact-bundle.js +0 -305
  112. package/dist/core/artifact-bundle.js.map +0 -1
  113. package/dist/core/artifact-export.d.ts +0 -83
  114. package/dist/core/artifact-export.js +0 -1567
  115. package/dist/core/artifact-export.js.map +0 -1
  116. package/dist/core/artifact-frame-selectors.d.ts +0 -42
  117. package/dist/core/artifact-frame-selectors.js +0 -65
  118. package/dist/core/artifact-frame-selectors.js.map +0 -1
  119. package/dist/core/artifact-paged-css.d.ts +0 -64
  120. package/dist/core/artifact-paged-css.js +0 -253
  121. package/dist/core/artifact-paged-css.js.map +0 -1
  122. package/dist/core/field-library.d.ts +0 -62
  123. package/dist/core/field-library.js +0 -129
  124. package/dist/core/field-library.js.map +0 -1
  125. package/dist/mcp/comment-virtual-entity.d.ts +0 -36
  126. package/dist/mcp/comment-virtual-entity.js +0 -71
  127. package/dist/mcp/comment-virtual-entity.js.map +0 -1
  128. package/dist/server/routes/field-library-api.d.ts +0 -28
  129. package/dist/server/routes/field-library-api.js +0 -126
  130. package/dist/server/routes/field-library-api.js.map +0 -1
  131. package/dist/server/routes/import-batch.d.ts +0 -24
  132. package/dist/server/routes/import-batch.js +0 -33
  133. package/dist/server/routes/import-batch.js.map +0 -1
  134. package/dist/services/artifact-inspect-metadata.d.ts +0 -21
  135. package/dist/services/artifact-inspect-metadata.js +0 -66
  136. package/dist/services/artifact-inspect-metadata.js.map +0 -1
  137. package/dist/services/asset-upload-service.d.ts +0 -56
  138. package/dist/services/asset-upload-service.js +0 -200
  139. package/dist/services/asset-upload-service.js.map +0 -1
  140. package/dist/services/bookmark-import-service.d.ts +0 -49
  141. package/dist/services/bookmark-import-service.js +0 -250
  142. package/dist/services/bookmark-import-service.js.map +0 -1
  143. package/dist/web/_app/immutable/chunks/1_BWKAKA2.js +0 -23
  144. package/dist/web/_app/immutable/chunks/9Sn2PwSn2.js +0 -1025
  145. package/dist/web/_app/immutable/chunks/B2cjR0rG.js +0 -83
  146. package/dist/web/_app/immutable/chunks/BIwe25Lk.js +0 -1
  147. package/dist/web/_app/immutable/chunks/BnYohOts2.js +0 -1
  148. package/dist/web/_app/immutable/chunks/BxeOdaUQ.js +0 -1
  149. package/dist/web/_app/immutable/chunks/C6d9nn3k.js +0 -1
  150. package/dist/web/_app/immutable/chunks/C85NG5lS.js +0 -1
  151. package/dist/web/_app/immutable/chunks/CB-t1Bv-.js +0 -1
  152. package/dist/web/_app/immutable/chunks/CJbr-v9X.js +0 -1
  153. package/dist/web/_app/immutable/chunks/CKGHeJzq.js +0 -1
  154. package/dist/web/_app/immutable/chunks/CXPMb3zd.js +0 -1
  155. package/dist/web/_app/immutable/chunks/CgCz4Fj6.js +0 -1
  156. package/dist/web/_app/immutable/chunks/CuYL65Bn.js +0 -2
  157. package/dist/web/_app/immutable/chunks/D4vfNy_f.js +0 -1
  158. package/dist/web/_app/immutable/chunks/DBGaXAP8.js +0 -1
  159. package/dist/web/_app/immutable/chunks/DG7uGoZb2.js +0 -58
  160. package/dist/web/_app/immutable/chunks/DTOO9nUj.js +0 -1
  161. package/dist/web/_app/immutable/chunks/Dav8Lgyy2.js +0 -5
  162. package/dist/web/_app/immutable/chunks/DiiXREv7.js +0 -1
  163. package/dist/web/_app/immutable/chunks/DjXtgWTP.js +0 -1
  164. package/dist/web/_app/immutable/chunks/oIZupUnz.js +0 -1
  165. package/dist/web/_app/immutable/entry/app.1tcNTKI-.js +0 -2
  166. package/dist/web/_app/immutable/entry/start.BJMsySI1.js +0 -1
  167. package/dist/web/_app/immutable/nodes/15.D2mNE6C-.js +0 -1
  168. package/dist/web/_app/immutable/nodes/2.Cd72nG2V.js +0 -124
  169. /package/dist/web/_app/immutable/chunks/{B9KfEsQw2.js → B9KfEsQw.js} +0 -0
  170. /package/dist/web/_app/immutable/chunks/{BO6-nRV9.js → BO6-nRV92.js} +0 -0
  171. /package/dist/web/_app/immutable/chunks/{CcWaWbrI2.js → CcWaWbrI.js} +0 -0
  172. /package/dist/web/_app/immutable/chunks/{CsIWxmio2.js → CsIWxmio.js} +0 -0
  173. /package/dist/web/_app/immutable/chunks/{DQMWa2t7.js → DQMWa2t72.js} +0 -0
  174. /package/dist/web/_app/immutable/chunks/{MAYbL-xn2.js → MAYbL-xn.js} +0 -0
  175. /package/dist/web/_app/immutable/chunks/{MtN4vJa02.js → MtN4vJa0.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 use standard CSS Paged Media (`@page` margin boxes + `position: running()`; a full-bleed branded band runs edge-to-edge with side margins `0`, and footer/header text in the 0-margin boxes is `padding`-inset to the body column so it doesn't hit the page edge) which overrides the platform defaults. (The `furniture`/`pageMargins` frame fields are an optional shortcut for a plain inset header/footer.) 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.
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 deep CSS Paged Media reference 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.
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 general CSS Paged Media.** A `pages` document is plain HTML/CSS — design it as richly as you like (full-bleed colored bands, logos, zebra-striped tables, multi-column footers). To make content **repeat on every page** (a letterhead, running header, footer, page numbers), use **standard CSS Paged Media** in a `shared` CSS file the open, fully-flexible mechanism (Paged.js renders it). This is the PRIMARY way; aim for a real designed letterhead, not a plain text line.
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
- The platform also offers two **optional shortcuts** for the simple case; any author CSS Paged Media above overrides them, and for a full-bleed band or any non-trivial layout you should use CSS Paged Media, not these:
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) — a plain inset running header/footer: `{ 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 and never lets them overlap the body. Inset to the content column (not full-bleed). Use only when you want a plain running line and don't want to write `@page` CSS. `furniture` positions itself from `pageMargins` (or the defaults) so if you set your own `@page { margin }` in CSS, don't also use `furniture`; put your header/footer in `@page` margin boxes instead.
145
- - **`pageMargins`** (a `pages` frame field, px per side; absent sides default to top 96 / sides 72 / bottom 84) — a shortcut for `@page { margin: … }`.
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 linestyle 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 (full-bleed band via CSS Paged Media)
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 is a **running element** in a `@page` margin box, so it repeats on every page; side margins are `0` so the band runs edge-to-edge, and the band's logo/address are placed with **`position:absolute`** (flex/table collapse inside a Paged.js margin box — verified). The footer is `@bottom-left`/`@bottom-right` margin boxes **padded to the body gutter** (side margins are `0`, so without the `padding` the footer would sit on the paper edge); the page size comes from `geometry`, so there is **no `@page { size }`**.
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}.doc{padding:28px 64px}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}.band{position:running(band);height:104px;background:#16315c;color:#fff}.brand{position:absolute;left:64px;top:34px}.logo{display:inline-block;width:40px;height:40px;border-radius:8px;background:#e8492b;color:#fff;text-align:center;line-height:40px;font-weight:800;font-size:22px;vertical-align:middle;margin-right:14px}.btxt{display:inline-block;vertical-align:middle}.btxt b{font-size:20px}.btxt small{display:block;color:#9fb3d1;font-size:10px;letter-spacing:.12em}.addr{position:absolute;right:64px;top:38px;text-align:right;font-size:11px;color:#cdd9ea;line-height:1.5}.exhibit{break-before:page}@page{margin:104px 0 70px;@top-center{content:element(band)}@bottom-left{content:\"Confidential\";padding-left:64px;font-size:10px;color:#9ca3af}@bottom-right{content:\"Page \" counter(page) \" of \" counter(pages);padding-right:64px;font-size:10px;color:#9ca3af}}"
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
- "content": "<div class=\"band\"><div class=\"brand\"><span class=\"logo\">A</span><span class=\"btxt\"><b>Acme Inc.</b><small>PEOPLE &amp; TALENT</small></span></div><div class=\"addr\">1 Acme Plaza, Suite 800<br>San Francisco, CA 94105<br>hr@acmeinc.com</div></div><div class=\"doc\"><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></div>"
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 &amp; 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 running band + footer 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. (For just a plain inset header/footer with no `@page` CSS, the `furniture` shortcut is the lighter option.)
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,97 @@
1
1
  ---
2
2
  name: paged-documents
3
- description: How to author multi-page print documents (letters, contracts, proposals, reports, briefs) WELL with CSS Paged Media — the platform paginates a `pages` frame with Paged.js. Deep technical know-how for @page rules, named/cover pages, page-margin boxes, running letterhead/headers/footers, page counters, and break control, plus 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.
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 — using CSS Paged Media (Paged.js) well
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 with Paged.js (letters, contracts, proposals, agreements, reports, briefs, memos of variable / unknown length). The `artifact-canvas` skill covers the frame model; this skill is the deep, effective-use 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 Paged Media render correctly.
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
- **First check you actually need pagination.** `pages` + Paged.js 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 which skips Paged.js entirely (it's heavier and slower to load). See the router in `artifact-canvas`. Use this skill only when you want the platform to break a text stream into pages for you.
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
- 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 clipped running header, a heading stranded at a page bottom, an orphaned rule) are invisible in the source and obvious in the render.
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 **CSS Paged Media rules**. Paged.js fragments that one flowing body into as many fixed-size pages as the content needs, and repeats your letterhead/headers/footers 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; write `@page` rules for the furniture; let the platform paginate.
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 ──Paged.js──▶ page 1 │ page 2 │ page 3 │ … (real multi-page PDF)
21
- whole body each carries your @page margins + running header/footer + page number
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
- Your CSS reaches Paged.js from **shared `.css` files AND inline `<style>` in the frame `content`** both are honored for `@page` / break / named-page / running-element rules. Relative `url()` (fonts, images) is fine; the platform handles it. Then:
27
-
28
- - **Page SIZE is the frame `geometry` — ANY width × height, and the platform LOCKS it.** The page can be any size in px @96dpi, **portrait, landscape, or arbitrary** — there is no canonical "default." 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`. But a custom size is equally valid — a landscape report `1056×816`, a square `1000×1000`, a wide spread `1632×816`, a tall menu `612×1584`. Pick the geometry the document calls for. **Do NOT write `@page { size: … }`** (or `size: letter`) the platform appends the authoritative `@page { size }` (your chosen geometry) LAST, so yours is ignored. Sizing the page is the geometry's job; everything else below is relative to it.
29
- - **The platform gives you sensible defaults that your CSS overrides:** a default `@page { margin }` (from the frame's `pageMargins`, else top 96 / sides 72 / bottom 84) and a default **"Page N of M"** counter in `@bottom-right`. Write your own `@page { margin }` or your own margin-box content and yours wins.
30
- - **Cascade order:** platform defaults **your CSS** page-size lock. So your `@page`/margin/break/running rules win over the defaults; only the page size is beyond your reach.
31
- - **Fixed height is required to paginate.** A `pages` frame with a fixed height (e.g. `1056`) flows overflow onto more pages. A `pages` frame with `height: "auto"` does NOT paginate it renders as one tall continuous page. Use `auto` only for a deliberately single, non-paginated scroll.
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
+ - **A default "Page N of M"** is drawn bottom-right on every page. A `furniture.footer` you supply sits to its left, clear of it.
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
+ - **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.
33
+ - **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.
32
34
 
33
- ## `@page` rules and named pages
35
+ ## Letterhead, running headers & footers — the `furniture` field
34
36
 
35
- The base page:
37
+ `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).
36
38
 
37
- ```css
38
- @page {
39
- margin: 96px 72px 84px; /* top sides bottom — illustrative, NOT canonical */
39
+ ```jsonc
40
+ "pageMargins": { "top": 140, "right": 64, "bottom": 84, "left": 64 },
41
+ "furniture": {
42
+ "header": {
43
+ "middle": "<div class=\"lh\"><div><b>Acme Inc.</b><div class=\"sub\">PEOPLE &amp; TALENT</div></div><div class=\"addr\">1 Acme Plaza · San Francisco · hr@acmeinc.com</div></div>"
44
+ },
45
+ "footer": { "middle": "<span class=\"ft\">Confidential</span>" }
40
46
  }
41
47
  ```
42
48
 
43
- **Margins are a design choice relative to the page, not fixed numbers.** Scale them to the geometry and the document: a big page (Tabloid/A3) wants larger margins than an A5; a landscape page often wants more side margin than top/bottom; a bound document wants an asymmetric inner/outer margin (`@page :left` / `:right`). The top/bottom margins must also leave room for your running header/footer (a tall letterhead needs a taller top margin). The platform's fallback when you set none is top 96 / sides 72 / bottom 84 px — fine for a Letter-ish portrait, but choose your own for any other size. Everywhere below, **the content width is `page-width − left-margin right-margin`** and any element you size to the column should be derived from the geometry you picked, never a copied constant.
44
-
45
- **Named pages** give a specific page its own rulesthe 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
49
+ - 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).
50
+ - 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.
51
+ - **Full-bleed edge-to-edge bands are not supported in v1**furniture insets to the content column. Keep letterhead within the margins.
52
+ - A cover page that should carry NO running header: there is no per-page suppression in v1 — either keep a slim header throughout, or build a cover as a separate `artboard` frame and the body as a second `pages` frame.
56
53
 
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) }
70
- }
71
- ```
72
-
73
- **The width trap (this is the #1 document bug).** The top row's width is the page width minus the corners, **shared** among `@top-left` / `@top-center` / `@top-right`, and each box sizes to its own content. **Never put `width: 100%` (or a wide fixed width) on one margin box** — it steals the whole row and crushes the others, so their text wraps into a sliver and **clips** (a header that should read "Cooper Hewitt Brand Refresh" renders as "Hewitt / Brand / Refresh", cut off — the exact bug). Margin boxes also do NOT grow or wrap gracefully; they clip. So: keep each slot's `content` **short** (a few words), and to get a full-width underline under the header, do NOT reach for `width: 100%` — use a running element for the rule (below).
74
-
75
- ## Running elements — for ONE repeated block (band, logo, rule), not for spreading parts
76
-
77
- `position: running(name)` pulls an element out of the body flow and `content: element(name)` drops it into a margin box, repeated on every page. Use it for a **single content block**: a full-bleed colored band, a logo lockup, a centered title, or a full-width rule. It is real HTML/CSS — backgrounds, borders, a fixed height.
78
-
79
- **Verified Paged.js limitation — do not lay out multiple parts with flex inside a running element.** When the element is cloned into the margin box, its **`display:flex` / `justify-content:space-between` does NOT spread** — the children collapse to their intrinsic size, centered (`<span>Acme</span><span>Brief</span>` renders as "AcmeBrief" in the middle, not left+right). So:
80
-
81
- - **Left vs right text with NO shared background → use the two margin boxes above** (`@top-left` + `@top-right`), never a flex running element.
82
- - **A band WITH a shared background that needs left + right content (logo left, address right) → one running element, lay the parts out with `position:absolute`.** Flex and `display:table` both collapse in the clone; **absolute** children anchor to the band's box and DO render correctly. Use **fixed px offsets**, not percentages — the band's height is not definite in the clone, so `top:50%` escapes to the page; `top:34px` stays in the band. (Verified by render.)
83
-
84
- ```css
85
- .band { position: running(band); height: 104px; background: #16315c; color: #fff; }
86
- .brand { position: absolute; left: 64px; top: 34px; } /* logo + name lockup (inline-block inside is fine) */
87
- .addr { position: absolute; right: 64px; top: 38px; text-align: right; }
88
- @page {
89
- margin: 110px 0 84px; /* side margins 0 → the band spans full width */
90
- @top-center { content: element(band) }
91
- @bottom-left { content: "Confidential"; padding-left: 64px } /* inset the footer text to the column */
92
- @bottom-right{ content: counter(page); padding-right: 64px } /* (margins are 0, so pad each box) */
93
- }
94
- .doc { padding: 0 64px; } /* body supplies its own gutters */
95
- ```
96
-
97
- **The full-bleed-band footer trap.** Side margins `0` let the band bleed — but they also drop any `@bottom-left`/`@bottom-right`/`@top-*` TEXT onto the very paper edge (a page number jammed against the corner). Margin boxes accept `padding`, so **inset every text slot to your body column** with `padding-left`/`padding-right` matching the body gutter (`64px` above). Only the band is meant to bleed; the page number, confidential line, and any header text align to the column. (Verified by render — without the padding the footer sits at x≈0.)
98
-
99
- For a **first-page-only / last-page-only** variant, attach the element on a named page (`@page :first { @top-center { content: element(coverhead) } }`). Put the running element **once**, near the top of `content`; it does not appear inline.
54
+ ## Break control (the craft that separates clean from sloppy)
100
55
 
101
- Whatever you build here, **confirm it in the render** (verify loop below) margin-box and running-element layout has non-obvious behavior (the flex caveat above is exactly why), so looking at the pixels is the only way to know it landed.
56
+ - `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.)
57
+ - `break-inside: avoid` — keep a block together (a figure + caption, a table row group, a signature block, a heading + its first lines).
58
+ - `break-after: avoid` on headings — so a heading is never stranded alone at a page bottom with its content on the next page.
59
+ - `orphans` / `widows` (e.g. `p { orphans: 2; widows: 2 }`) — no single dangling line of a paragraph across a page break. Native columns honor these.
60
+ - **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
61
 
103
- ## Page counters
62
+ ## Fragment-safe hanging indents (numbered clauses)
104
63
 
105
- `counter(page)` is the current page, `counter(pages)` the total. The platform defaults to "Page N of M" bottom-right; override it with your own:
64
+ 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
65
 
107
66
  ```css
108
- @page { @bottom-right { content: counter(page); font: 7.5pt 'Brand'; color: #666 } }
67
+ .clause { position: relative; padding-left: 48px; } /* the hanging gutter */
68
+ .clause .num { position: absolute; left: 0; top: 0; } /* the number sits in the gutter */
69
+ /* the clause text flows in the padded area and continues cleanly onto the next page */
109
70
  ```
110
71
 
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
72
  ## Vertical rhythm and spacing
122
73
 
123
- Give headings real breathing room and keep spacing consistent (a single scale: e.g. space below a section heading ≥ the space between paragraphs, so headers don't read as glued to their body). A label-column layout (section label left, body right) needs the label and the body's first line to share a baseline. 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.
74
+ 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
75
 
125
76
  ## The verify loop (mandatory — not optional for documents)
126
77
 
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. Check, on the render:
78
+ 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
79
 
129
- - **Running header/footer fully visible** on every page — not clipped or wrapped (clipping a margin box is too narrow, usually a `width` hack; switch to a running element or shorten the text).
80
+ - **Furniture (letterhead/footer) fully visible** on every page — not overlapping the body (if it does, grow `pageMargins.top`/`.bottom`).
130
81
  - **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
- - **Cover/first page** furniture is suppressed if intended; page numbers run 1…N.
133
- - **Margins and the letterhead** look right on page 2+ (page 1 often differs).
82
+ - **Tables and blocks break sanely** (no row split mid-cell, no header row alone at a page bottom — use `break-inside: avoid`).
83
+ - **Numbered clauses** keep their hanging indent across page breaks (use the absolute+padding form above).
84
+ - **Page numbers** run 1…N; the page count looks right for the content.
134
85
 
135
- Do not describe the structure and stop. Render it, look at it, fix what you see. The most common real defects (clipped headers, orphaned dividers, stranded headings) are invisible in the markup and obvious in the render — one inspect pass catches them.
86
+ Do not describe the structure and stop. Render it, look at it, fix what you see.
136
87
 
137
88
  ## Quick checklist
138
89
 
139
- - [ ] ONE `pages` frame, fixed width AND height — the size the document needs (portrait, landscape, or arbitrary; via geometry, no `@page { size }`).
140
- - [ ] Margins scaled to that page size (not copied Letter numbers); top/bottom leave room for the letterhead.
141
- - [ ] Letterhead / multi-part header / full-width rule a **running element**, not margin-box `width` hacks.
142
- - [ ] Margin-box text is short and fits.
143
- - [ ] Full-bleed band (side margins `0`)? Footer/header text slots `padding`-inset to the body column, not on the page edge.
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`.
90
+ - [ ] ONE `pages` frame, fixed width AND height — the size the document needs (portrait, landscape, or arbitrary; via `geometry`, no `@page { size }`).
91
+ - [ ] `pageMargins` scaled to that page size (not copied Letter numbers); top/bottom leave room for the furniture.
92
+ - [ ] Letterhead / running header / footerthe `furniture` field (NOT `@page` margin boxes or `position:running()` — those don't render).
93
+ - [ ] 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.
94
+ - [ ] Numbered clauses use the absolute + `padding-left` hanging-indent form.
146
95
  - [ ] Consistent spacing scale (defer the exact scale to the house-style skill).
96
+ - [ ] One uniform geometry — no per-section margins.
147
97
  - [ ] **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 use standard CSS Paged Media in a shared CSS file (`@page` margin boxes + `position: running()` a full-bleed branded band runs edge-to-edge if you set the side page margins to 0 and pad the body), which overrides the platform defaults. (The "furniture" + "pageMargins" frame fields are an optional shortcut for a plain inset header/footer.) 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.',
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,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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;