@drawnagency/primitives 0.1.117 → 0.1.119

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 (263) hide show
  1. package/dist/{chunk-O37AV27P.js → chunk-5JYHTHVR.js} +28 -0
  2. package/dist/{chunk-W72BPGR3.js → chunk-BZKHHUIN.js} +44 -8
  3. package/dist/{chunk-CEFFP3CH.js → chunk-G6O3TYPJ.js} +297 -83
  4. package/dist/{chunk-L7WTERU5.js → chunk-HFHM4MNK.js} +33 -10
  5. package/dist/{chunk-RIITGTV3.js → chunk-LQHBC7C6.js} +37 -2
  6. package/dist/{chunk-VY3IFGE3.js → chunk-QAMAIDXZ.js} +1 -1
  7. package/dist/{chunk-LNQUUC2S.js → chunk-RIN2QCYJ.js} +9 -11
  8. package/dist/{chunk-HUOW3ZV2.js → chunk-UNFPATDE.js} +8 -10
  9. package/dist/{chunk-MSBHMY3C.js → chunk-YKKGVSJH.js} +35 -37
  10. package/dist/{chunk-67P34WNW.js → chunk-ZKVQMIMJ.js} +3 -20
  11. package/dist/collab/rebase.js +4 -5
  12. package/dist/components/chat/ChatComposer.d.ts +0 -4
  13. package/dist/components/chat/ChatComposer.d.ts.map +1 -1
  14. package/dist/components/chat/ChatPanel.d.ts +2 -3
  15. package/dist/components/chat/ChatPanel.d.ts.map +1 -1
  16. package/dist/components/chat/markdown.d.ts +2 -3
  17. package/dist/components/chat/markdown.d.ts.map +1 -1
  18. package/dist/components/editor/PagesModal.d.ts +0 -2
  19. package/dist/components/editor/PagesModal.d.ts.map +1 -1
  20. package/dist/components/editor/index.js +15 -19
  21. package/dist/components/primitives/EditablePlainText.d.ts.map +1 -1
  22. package/dist/components/primitives/index.js +11 -15
  23. package/dist/components/sections/brand-guide.js +10 -13
  24. package/dist/components/sections/register-schemas.js +16 -21
  25. package/dist/components/sections/register.js +16 -21
  26. package/dist/components/shell/AudienceChips.d.ts +1 -3
  27. package/dist/components/shell/AudienceChips.d.ts.map +1 -1
  28. package/dist/components/shell/AudienceDetailsPanel.d.ts +3 -1
  29. package/dist/components/shell/AudienceDetailsPanel.d.ts.map +1 -1
  30. package/dist/components/shell/EditorShell.d.ts +0 -34
  31. package/dist/components/shell/EditorShell.d.ts.map +1 -1
  32. package/dist/components/shell/SiteSettingsModal.d.ts.map +1 -1
  33. package/dist/hooks/useSortableNavRow.d.ts +1 -1
  34. package/dist/hooks/useSortableRow.d.ts +1 -1
  35. package/dist/index.js +83 -90
  36. package/dist/lib/index-ops.js +5 -6
  37. package/dist/lib/index.js +27 -32
  38. package/dist/lib/pages.d.ts +0 -2
  39. package/dist/lib/pages.d.ts.map +1 -1
  40. package/dist/lib/sidecars.js +2 -2
  41. package/dist/lib/site-validation.js +13 -14
  42. package/dist/lib/storage-tier.js +4 -4
  43. package/dist/schemas/index.js +42 -45
  44. package/dist/schemas/site-config.d.ts +1 -277
  45. package/dist/schemas/site-config.d.ts.map +1 -1
  46. package/package.json +2 -42
  47. package/src/components/chat/ChatComposer.tsx +0 -4
  48. package/src/components/chat/ChatPanel.tsx +2 -3
  49. package/src/components/chat/markdown.ts +2 -3
  50. package/src/components/editor/PagesModal.tsx +1 -15
  51. package/src/components/editor/StatusIndicator.tsx +4 -4
  52. package/src/components/primitives/EditablePlainText.tsx +27 -3
  53. package/src/components/shell/AudienceChips.tsx +1 -3
  54. package/src/components/shell/AudienceDetailsPanel.tsx +6 -4
  55. package/src/components/shell/EditorShell.tsx +18 -114
  56. package/src/components/shell/SiteSettingsModal.tsx +0 -11
  57. package/src/lib/pages.ts +0 -22
  58. package/src/schemas/index.ts +0 -4
  59. package/src/schemas/site-config.ts +4 -32
  60. package/dist/chunk-4TZJZU2T.js +0 -92
  61. package/dist/chunk-DIMDRBFK.js +0 -11
  62. package/dist/chunk-FV7JQRCN.js +0 -94
  63. package/dist/chunk-IIDKW7AV.js +0 -41
  64. package/dist/chunk-JCDZAFX2.js +0 -224
  65. package/dist/chunk-MM7KZS5C.js +0 -30
  66. package/dist/chunk-QQ3S3P5P.js +0 -38
  67. package/dist/chunk-TEOAKGZA.js +0 -784
  68. package/dist/chunk-VAYZJKVR.js +0 -209
  69. package/dist/components/shell/DocInspector.d.ts +0 -18
  70. package/dist/components/shell/DocInspector.d.ts.map +0 -1
  71. package/dist/components/shell/DocumentEditorOverlay.d.ts +0 -29
  72. package/dist/components/shell/DocumentEditorOverlay.d.ts.map +0 -1
  73. package/dist/components/shell/DocumentPresentOverlay.d.ts +0 -30
  74. package/dist/components/shell/DocumentPresentOverlay.d.ts.map +0 -1
  75. package/dist/components/shell/SiteSettingsDecks.d.ts +0 -13
  76. package/dist/components/shell/SiteSettingsDecks.d.ts.map +0 -1
  77. package/dist/deck/DeckComponentView.d.ts +0 -13
  78. package/dist/deck/DeckComponentView.d.ts.map +0 -1
  79. package/dist/deck/DeckPlayer.d.ts +0 -26
  80. package/dist/deck/DeckPlayer.d.ts.map +0 -1
  81. package/dist/deck/DeckSlideView.d.ts +0 -17
  82. package/dist/deck/DeckSlideView.d.ts.map +0 -1
  83. package/dist/deck/DeckStage.d.ts +0 -16
  84. package/dist/deck/DeckStage.d.ts.map +0 -1
  85. package/dist/deck/components/DeckImage.d.ts +0 -14
  86. package/dist/deck/components/DeckImage.d.ts.map +0 -1
  87. package/dist/deck/components/DeckImageGrid.d.ts +0 -27
  88. package/dist/deck/components/DeckImageGrid.d.ts.map +0 -1
  89. package/dist/deck/components/DeckRichText.d.ts +0 -22
  90. package/dist/deck/components/DeckRichText.d.ts.map +0 -1
  91. package/dist/deck/components/DeckVideo.d.ts +0 -15
  92. package/dist/deck/components/DeckVideo.d.ts.map +0 -1
  93. package/dist/deck/editing.d.ts +0 -50
  94. package/dist/deck/editing.d.ts.map +0 -1
  95. package/dist/deck/flip.d.ts +0 -11
  96. package/dist/deck/flip.d.ts.map +0 -1
  97. package/dist/deck/index.d.ts +0 -24
  98. package/dist/deck/index.d.ts.map +0 -1
  99. package/dist/deck/index.js +0 -51
  100. package/dist/deck/layouts/CenteredTextLayout.d.ts +0 -12
  101. package/dist/deck/layouts/CenteredTextLayout.d.ts.map +0 -1
  102. package/dist/deck/layouts/ColumnSplitLayout.d.ts +0 -14
  103. package/dist/deck/layouts/ColumnSplitLayout.d.ts.map +0 -1
  104. package/dist/deck/layouts/FullBleedImageLayout.d.ts +0 -14
  105. package/dist/deck/layouts/FullBleedImageLayout.d.ts.map +0 -1
  106. package/dist/deck/media.d.ts +0 -33
  107. package/dist/deck/media.d.ts.map +0 -1
  108. package/dist/deck/tokens.d.ts +0 -22
  109. package/dist/deck/tokens.d.ts.map +0 -1
  110. package/dist/deck/useStageScale.d.ts +0 -10
  111. package/dist/deck/useStageScale.d.ts.map +0 -1
  112. package/dist/deck-builder/DeckBuilderApp.d.ts +0 -30
  113. package/dist/deck-builder/DeckBuilderApp.d.ts.map +0 -1
  114. package/dist/deck-builder/DeckBuilderTopBar.d.ts +0 -24
  115. package/dist/deck-builder/DeckBuilderTopBar.d.ts.map +0 -1
  116. package/dist/deck-builder/DeckChatPanel.d.ts +0 -45
  117. package/dist/deck-builder/DeckChatPanel.d.ts.map +0 -1
  118. package/dist/deck-builder/DeckEditor.d.ts +0 -37
  119. package/dist/deck-builder/DeckEditor.d.ts.map +0 -1
  120. package/dist/deck-builder/DeckLibrary.d.ts +0 -22
  121. package/dist/deck-builder/DeckLibrary.d.ts.map +0 -1
  122. package/dist/deck-builder/DeckSlideSurface.d.ts +0 -31
  123. package/dist/deck-builder/DeckSlideSurface.d.ts.map +0 -1
  124. package/dist/deck-builder/deck-api.d.ts +0 -76
  125. package/dist/deck-builder/deck-api.d.ts.map +0 -1
  126. package/dist/deck-builder/deck-chat-client.d.ts +0 -44
  127. package/dist/deck-builder/deck-chat-client.d.ts.map +0 -1
  128. package/dist/deck-builder/deck-chat-history.d.ts +0 -10
  129. package/dist/deck-builder/deck-chat-history.d.ts.map +0 -1
  130. package/dist/deck-builder/index.d.ts +0 -13
  131. package/dist/deck-builder/index.d.ts.map +0 -1
  132. package/dist/deck-builder/index.js +0 -1498
  133. package/dist/deck-builder/starter-deck.d.ts +0 -23
  134. package/dist/deck-builder/starter-deck.d.ts.map +0 -1
  135. package/dist/deck-builder/types.d.ts +0 -29
  136. package/dist/deck-builder/types.d.ts.map +0 -1
  137. package/dist/deck-builder/useSortableSlide.d.ts +0 -29
  138. package/dist/deck-builder/useSortableSlide.d.ts.map +0 -1
  139. package/dist/document/assets/fonts/albra-grotesk-bold.woff +0 -0
  140. package/dist/document/assets/fonts/albra-grotesk-regular.woff +0 -0
  141. package/dist/document/assets/fonts/kapra-neue-expanded-medium.woff +0 -0
  142. package/dist/document/assets/fonts/kapra-neue-expanded-regular.woff +0 -0
  143. package/dist/document/components/DocCoverPage.d.ts +0 -11
  144. package/dist/document/components/DocCoverPage.d.ts.map +0 -1
  145. package/dist/document/components/DocPage.d.ts +0 -10
  146. package/dist/document/components/DocPage.d.ts.map +0 -1
  147. package/dist/document/components/DocRail.d.ts +0 -28
  148. package/dist/document/components/DocRail.d.ts.map +0 -1
  149. package/dist/document/components/DocSectionPage.d.ts +0 -12
  150. package/dist/document/components/DocSectionPage.d.ts.map +0 -1
  151. package/dist/document/components/DocViewer.d.ts +0 -21
  152. package/dist/document/components/DocViewer.d.ts.map +0 -1
  153. package/dist/document/components/Wordmark.d.ts +0 -4
  154. package/dist/document/components/Wordmark.d.ts.map +0 -1
  155. package/dist/document/components/measure.d.ts +0 -7
  156. package/dist/document/components/measure.d.ts.map +0 -1
  157. package/dist/document/components/useDocPages.d.ts +0 -12
  158. package/dist/document/components/useDocPages.d.ts.map +0 -1
  159. package/dist/document/engine/blocks.d.ts +0 -2
  160. package/dist/document/engine/blocks.d.ts.map +0 -1
  161. package/dist/document/engine/harvest.d.ts +0 -3
  162. package/dist/document/engine/harvest.d.ts.map +0 -1
  163. package/dist/document/engine/masonry.d.ts +0 -26
  164. package/dist/document/engine/masonry.d.ts.map +0 -1
  165. package/dist/document/engine/paginate.d.ts +0 -43
  166. package/dist/document/engine/paginate.d.ts.map +0 -1
  167. package/dist/document/engine/settings.d.ts +0 -91
  168. package/dist/document/engine/settings.d.ts.map +0 -1
  169. package/dist/document/engine/types.d.ts +0 -44
  170. package/dist/document/engine/types.d.ts.map +0 -1
  171. package/dist/document/index.d.ts +0 -13
  172. package/dist/document/index.d.ts.map +0 -1
  173. package/dist/document/index.js +0 -1030
  174. package/dist/document/styles/document.css +0 -217
  175. package/dist/lib/deck-access.d.ts +0 -86
  176. package/dist/lib/deck-access.d.ts.map +0 -1
  177. package/dist/lib/deck-access.js +0 -58
  178. package/dist/lib/deck-dexie.d.ts +0 -88
  179. package/dist/lib/deck-dexie.d.ts.map +0 -1
  180. package/dist/lib/deck-dexie.js +0 -22
  181. package/dist/lib/deck-edit.d.ts +0 -67
  182. package/dist/lib/deck-edit.d.ts.map +0 -1
  183. package/dist/lib/deck-media-assets.d.ts +0 -27
  184. package/dist/lib/deck-media-assets.d.ts.map +0 -1
  185. package/dist/lib/deck-media-assets.js +0 -25
  186. package/dist/lib/deck-media-refs.d.ts +0 -35
  187. package/dist/lib/deck-media-refs.d.ts.map +0 -1
  188. package/dist/lib/deck-media-refs.js +0 -36
  189. package/dist/lib/deck-tool.d.ts +0 -25
  190. package/dist/lib/deck-tool.d.ts.map +0 -1
  191. package/dist/lib/deck-tool.js +0 -58
  192. package/dist/lib/document-input.d.ts +0 -25
  193. package/dist/lib/document-input.d.ts.map +0 -1
  194. package/dist/schemas/deck-meta.d.ts +0 -85
  195. package/dist/schemas/deck-meta.d.ts.map +0 -1
  196. package/dist/schemas/deck-meta.js +0 -64
  197. package/dist/schemas/deck.d.ts +0 -954
  198. package/dist/schemas/deck.d.ts.map +0 -1
  199. package/dist/schemas/deck.js +0 -65
  200. package/src/components/shell/DocInspector.tsx +0 -314
  201. package/src/components/shell/DocumentEditorOverlay.tsx +0 -179
  202. package/src/components/shell/DocumentPresentOverlay.tsx +0 -87
  203. package/src/components/shell/SiteSettingsDecks.tsx +0 -41
  204. package/src/deck/DeckComponentView.tsx +0 -28
  205. package/src/deck/DeckPlayer.tsx +0 -166
  206. package/src/deck/DeckSlideView.tsx +0 -38
  207. package/src/deck/DeckStage.tsx +0 -39
  208. package/src/deck/components/DeckImage.tsx +0 -38
  209. package/src/deck/components/DeckImageGrid.tsx +0 -254
  210. package/src/deck/components/DeckRichText.tsx +0 -111
  211. package/src/deck/components/DeckVideo.tsx +0 -81
  212. package/src/deck/editing.tsx +0 -201
  213. package/src/deck/flip.ts +0 -70
  214. package/src/deck/index.ts +0 -30
  215. package/src/deck/layouts/CenteredTextLayout.tsx +0 -29
  216. package/src/deck/layouts/ColumnSplitLayout.tsx +0 -69
  217. package/src/deck/layouts/FullBleedImageLayout.tsx +0 -58
  218. package/src/deck/media.tsx +0 -46
  219. package/src/deck/tokens.ts +0 -57
  220. package/src/deck/useStageScale.ts +0 -44
  221. package/src/deck-builder/DeckBuilderApp.tsx +0 -572
  222. package/src/deck-builder/DeckBuilderTopBar.tsx +0 -62
  223. package/src/deck-builder/DeckChatPanel.tsx +0 -334
  224. package/src/deck-builder/DeckEditor.tsx +0 -258
  225. package/src/deck-builder/DeckLibrary.tsx +0 -195
  226. package/src/deck-builder/DeckSlideSurface.tsx +0 -55
  227. package/src/deck-builder/deck-api.ts +0 -177
  228. package/src/deck-builder/deck-chat-client.ts +0 -129
  229. package/src/deck-builder/deck-chat-history.ts +0 -62
  230. package/src/deck-builder/index.ts +0 -12
  231. package/src/deck-builder/starter-deck.ts +0 -86
  232. package/src/deck-builder/types.ts +0 -24
  233. package/src/deck-builder/useSortableSlide.ts +0 -102
  234. package/src/document/assets/fonts/albra-grotesk-bold.woff +0 -0
  235. package/src/document/assets/fonts/albra-grotesk-regular.woff +0 -0
  236. package/src/document/assets/fonts/kapra-neue-expanded-medium.woff +0 -0
  237. package/src/document/assets/fonts/kapra-neue-expanded-regular.woff +0 -0
  238. package/src/document/components/DocCoverPage.tsx +0 -45
  239. package/src/document/components/DocPage.tsx +0 -40
  240. package/src/document/components/DocRail.tsx +0 -189
  241. package/src/document/components/DocSectionPage.tsx +0 -48
  242. package/src/document/components/DocViewer.tsx +0 -313
  243. package/src/document/components/Wordmark.tsx +0 -18
  244. package/src/document/components/measure.tsx +0 -133
  245. package/src/document/components/useDocPages.ts +0 -95
  246. package/src/document/engine/blocks.ts +0 -116
  247. package/src/document/engine/harvest.ts +0 -95
  248. package/src/document/engine/masonry.ts +0 -158
  249. package/src/document/engine/paginate.ts +0 -232
  250. package/src/document/engine/settings.ts +0 -125
  251. package/src/document/engine/types.ts +0 -64
  252. package/src/document/index.ts +0 -18
  253. package/src/document/styles/document.css +0 -217
  254. package/src/lib/deck-access.ts +0 -132
  255. package/src/lib/deck-dexie.ts +0 -190
  256. package/src/lib/deck-edit.ts +0 -196
  257. package/src/lib/deck-media-assets.ts +0 -57
  258. package/src/lib/deck-media-refs.ts +0 -67
  259. package/src/lib/deck-tool.ts +0 -95
  260. package/src/lib/document-input.ts +0 -57
  261. package/src/schemas/deck-meta.ts +0 -88
  262. package/src/schemas/deck.ts +0 -478
  263. package/dist/{chunk-DJABADOO.js → chunk-AJ2QOAZI.js} +3 -3
@@ -1,36 +0,0 @@
1
- import "../chunk-JSBRDJBE.js";
2
-
3
- // src/lib/deck-media-refs.ts
4
- function step(path, key) {
5
- return path === "" ? key : `${path}.${key}`;
6
- }
7
- function deckMediaRefSites(deck) {
8
- const sites = [];
9
- const visit = (node, path) => {
10
- if (Array.isArray(node)) {
11
- node.forEach((item, i) => visit(item, `${path}[${i}]`));
12
- return;
13
- }
14
- if (typeof node !== "object" || node === null) return;
15
- const record = node;
16
- if (record.kind === "portal" && typeof record.id === "string" && record.id !== "") {
17
- sites.push({ path, id: record.id });
18
- }
19
- for (const [key, value] of Object.entries(record)) visit(value, step(path, key));
20
- };
21
- visit(deck, "");
22
- return sites;
23
- }
24
- function deckMediaIds(deck) {
25
- return new Set(deckMediaRefSites(deck).map((site) => site.id));
26
- }
27
- function deckUnknownMediaIssues(deck, catalogIds) {
28
- return deckMediaRefSites(deck).filter((site) => !catalogIds.has(site.id)).map(
29
- (site) => `${step(site.path, "id")}: "${site.id}" is not in the portal media catalog \u2014 use only the ids listed under "Media catalog", copied exactly.`
30
- );
31
- }
32
- export {
33
- deckMediaIds,
34
- deckMediaRefSites,
35
- deckUnknownMediaIssues
36
- };
@@ -1,25 +0,0 @@
1
- /**
2
- * The `update_deck` tool the deck-chat loop hands the model (#35, ADR 0001).
3
- *
4
- * The input schema is DERIVED from `DeckSchema` rather than written out, so the
5
- * contract cannot drift from what the server will actually accept: every
6
- * `.describe()` in the deck schema IS the LLM's documentation, and a field
7
- * added there reaches the model on the next request with no second edit here.
8
- *
9
- * Emitted INLINE (zod's default `reused: "inline"`), not with `$defs`/`$ref`.
10
- * The ref form is less than half the bytes, but names every shared node
11
- * `__schema7`, which puts the layout and component descriptions an indirection
12
- * away from the slot that uses them. The tool block sits in the cached prefix
13
- * (tools precede `system`, and the corpus block carries the cache breakpoint),
14
- * so the size is paid once per conversation while the legibility is paid on
15
- * every turn.
16
- */
17
- export declare const UPDATE_DECK_TOOL_NAME = "update_deck";
18
- export interface DeckToolDefinition {
19
- name: string;
20
- description: string;
21
- /** JSON Schema; the tool's input IS the whole deck. */
22
- input_schema: Record<string, unknown>;
23
- }
24
- export declare function updateDeckTool(): DeckToolDefinition;
25
- //# sourceMappingURL=deck-tool.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"deck-tool.d.ts","sourceRoot":"","sources":["../../src/lib/deck-tool.ts"],"names":[],"mappings":"AASA;;;;;;;;;;;;;;;GAeG;AAEH,eAAO,MAAM,qBAAqB,gBAAgB,CAAC;AAEnD,MAAM,WAAW,kBAAkB;IACjC,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,CAAC;IACpB,uDAAuD;IACvD,YAAY,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CACvC;AA8CD,wBAAgB,cAAc,IAAI,kBAAkB,CAenD"}
@@ -1,58 +0,0 @@
1
- import {
2
- DECK_COMPONENT_TYPES,
3
- DECK_LAYOUT_TYPES,
4
- DECK_MAX_SLIDES,
5
- DECK_SCHEMA_VERSION,
6
- DeckSchema
7
- } from "../chunk-VAYZJKVR.js";
8
- import "../chunk-JSBRDJBE.js";
9
-
10
- // src/lib/deck-tool.ts
11
- import { z } from "zod";
12
- var UPDATE_DECK_TOOL_NAME = "update_deck";
13
- var VOCABULARY = [
14
- `Layouts (a slide uses exactly one, and \`type\` must be one of these ${DECK_LAYOUT_TYPES.length}): ${DECK_LAYOUT_TYPES.map((t) => `\`${t}\``).join(", ")}.`,
15
- "- `centeredText` \u2014 a title card. Slot: `content` (one Component). Optional `background`: `base` or `brand`.",
16
- "- `fullBleedImage` \u2014 the image IS the slide. Takes `media` directly, plus an optional `overlay` panel whose `content` must be a `richText` Component. It has no other slots.",
17
- "- `columnSplit` \u2014 two slots, `left` and `right`, each one Component, at a `ratio` of `1-2` or `2-1`.",
18
- "",
19
- `Components (what fills a Layout slot; \`type\` must be one of these ${DECK_COMPONENT_TYPES.length}): ${DECK_COMPONENT_TYPES.map((t) => `\`${t}\``).join(", ")}.`,
20
- "- `richText` \u2014 kicker / heading / subheading / paragraphs / bullets. Text only; no media.",
21
- "- `image` \u2014 one `media` reference and an optional caption.",
22
- "- `imageGrid` \u2014 two to twelve `items`, each with its own `media`.",
23
- "- `video` \u2014 one `media` reference.",
24
- "",
25
- "There is nothing else. A `type` outside those lists is rejected, and so is a slot a Layout does not have \u2014 do not invent `body`, `columns`, `slots` or `children`."
26
- ].join("\n");
27
- var DESCRIPTION = [
28
- "Replace the ENTIRE deck with a new version. This is how every change to the deck is made \u2014 adding a slide, rewriting a line, reordering, or building the deck from nothing.",
29
- "",
30
- VOCABULARY,
31
- "",
32
- "Rules:",
33
- "- Emit the COMPLETE deck every time, including slides you are not changing. There is no patch or partial form: whatever you send becomes the deck, and anything you leave out is deleted.",
34
- `- Keep \`id\` exactly as it is in the current deck, and keep \`schemaVersion\` at ${DECK_SCHEMA_VERSION}.`,
35
- "- Reuse a slide's existing `id` when that slide survives the edit, so revisions stay diffable. Give a genuinely new slide a new lowercase-hyphen id that no other slide uses.",
36
- "- Every `media` reference must be a portal media id copied exactly from the Media catalog in your instructions. Never invent one, and never use a filename, path or URL.",
37
- `- At most ${DECK_MAX_SLIDES} slides.`,
38
- "",
39
- "Say what you changed in your reply text; do not restate the deck JSON there."
40
- ].join("\n");
41
- function updateDeckTool() {
42
- const schema = z.toJSONSchema(DeckSchema, {
43
- // `io: "input"` is what makes fields with defaults optional — under
44
- // "output" the model would be told `background` is required. `unrepresentable
45
- // : "any"` is for the superRefines (duplicate slide ids, the "a richText
46
- // needs some content" rule); they are enforced server-side by parseDeck,
47
- // and their messages are what a failed turn gets handed back.
48
- target: "draft-2020-12",
49
- io: "input",
50
- unrepresentable: "any"
51
- });
52
- delete schema.$schema;
53
- return { name: UPDATE_DECK_TOOL_NAME, description: DESCRIPTION, input_schema: schema };
54
- }
55
- export {
56
- UPDATE_DECK_TOOL_NAME,
57
- updateDeckTool
58
- };
@@ -1,25 +0,0 @@
1
- import type { MediaManifest } from "../schemas/media";
2
- import type { Page } from "../schemas/site-config";
3
- import type { LoadedSection } from "./loader";
4
- import type { DocImage, DocSourceContent } from "../document";
5
- /**
6
- * Map a media manifest to the engine's pre-resolved image dictionary. Port of
7
- * the harness's `portalImagesFrom` against the real MediaManifest type:
8
- * - only `kind === "image"` entries (videos/animated skipped);
9
- * - SVGs → `original.svg` for both preview and print;
10
- * - other images: previewFile = largest variant ≤ 1080 (else the smallest),
11
- * printFile = largest; images with zero variants are skipped.
12
- * The manifest is already schema-parsed upstream, so no tolerant re-parse here.
13
- */
14
- export declare function docImagesFrom(manifest: MediaManifest): Record<string, DocImage>;
15
- /**
16
- * Editor path: build the engine's source content from the caller's already-
17
- * selected page + its draft sections, verbatim. No status/audience filtering —
18
- * editors see everything (the shell passes in-memory draft content).
19
- */
20
- export declare function buildDraftDocumentInput(opts: {
21
- page: Page;
22
- sections: LoadedSection[];
23
- manifest: MediaManifest;
24
- }): DocSourceContent;
25
- //# sourceMappingURL=document-input.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"document-input.d.ts","sourceRoot":"","sources":["../../src/lib/document-input.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AACtD,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,wBAAwB,CAAC;AACnD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAC9C,OAAO,KAAK,EAAE,QAAQ,EAAmB,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAE/E;;;;;;;;GAQG;AACH,wBAAgB,aAAa,CAAC,QAAQ,EAAE,aAAa,GAAG,MAAM,CAAC,MAAM,EAAE,QAAQ,CAAC,CAe/E;AAMD;;;;GAIG;AACH,wBAAgB,uBAAuB,CAAC,IAAI,EAAE;IAC5C,IAAI,EAAE,IAAI,CAAC;IACX,QAAQ,EAAE,aAAa,EAAE,CAAC;IAC1B,QAAQ,EAAE,aAAa,CAAC;CACzB,GAAG,gBAAgB,CAOnB"}
@@ -1,85 +0,0 @@
1
- import { z } from "zod";
2
- /**
3
- * `decks/{deckId}/meta.json` — the sidecar beside a published deck on the
4
- * Decks Branch (ADR 0002). It carries everything a listing needs, so the list
5
- * route never reads a single `deck.json`.
6
- *
7
- * Ownership is dual-identity from day one (feasibility decision 9): a viewer
8
- * credential, an editor session, or — on env-mode standalone portals, which
9
- * have no named credentials — the audience alone. Retrofitting that later
10
- * would mean rewriting every deck's meta.
11
- */
12
- /** Bumped when the sidecar's shape changes in a way old readers can't parse. */
13
- export declare const DECK_META_SCHEMA_VERSION = 1;
14
- /**
15
- * Who owns a deck. `viewer` is the normal case (ownership is credential-keyed);
16
- * `editor` covers a deck an agency editor built; `audience` is the env-mode
17
- * standalone degradation, where a shared per-audience password means there is
18
- * no person to attribute to.
19
- */
20
- export declare const DeckOwnerSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
21
- kind: z.ZodLiteral<"viewer">;
22
- username: z.ZodString;
23
- audience: z.ZodString;
24
- }, z.core.$strip>, z.ZodObject<{
25
- kind: z.ZodLiteral<"editor">;
26
- userId: z.ZodString;
27
- }, z.core.$strip>, z.ZodObject<{
28
- kind: z.ZodLiteral<"audience">;
29
- audience: z.ZodString;
30
- }, z.core.$strip>], "kind">;
31
- /**
32
- * Deliberately a LOOSE object: grants and the Public Link token land in later
33
- * tickets (#36/#37), and a portal running an older package version must not
34
- * silently strip fields it doesn't know when it rewrites this file. This is the
35
- * same failure mode the nav sidecar exists to avoid — with unknown keys
36
- * preserved, an old writer round-trips them instead of deleting them.
37
- */
38
- export declare const DeckMetaSchema: z.ZodObject<{
39
- schemaVersion: z.ZodLiteral<1>;
40
- id: z.ZodString;
41
- /** Mirrors deck.title so a listing needs no deck body. */
42
- title: z.ZodString;
43
- /** Mirrors deck.slides.length, for the same reason. */
44
- slideCount: z.ZodNumber;
45
- owner: z.ZodDiscriminatedUnion<[z.ZodObject<{
46
- kind: z.ZodLiteral<"viewer">;
47
- username: z.ZodString;
48
- audience: z.ZodString;
49
- }, z.core.$strip>, z.ZodObject<{
50
- kind: z.ZodLiteral<"editor">;
51
- userId: z.ZodString;
52
- }, z.core.$strip>, z.ZodObject<{
53
- kind: z.ZodLiteral<"audience">;
54
- audience: z.ZodString;
55
- }, z.core.$strip>], "kind">;
56
- createdAt: z.ZodISODateTime;
57
- updatedAt: z.ZodISODateTime;
58
- /**
59
- * Bucket hashes this deck's media resolved to when it was published, and the
60
- * whole reason publish-time GC can protect them (ADR 0002).
61
- *
62
- * A deck references media by MANIFEST ID, and an id is only resolvable to a
63
- * bucket hash while the manifest still carries the entry — which is exactly
64
- * what stops being true in the case the keep-set exists for: the editor
65
- * removes the media from the library, the entry goes, and the object then
66
- * looks unreferenced to every reader. Resolving at publish time and recording
67
- * the answer here is what survives that. Absent when the deck references no
68
- * bucket-backed media, which is every deck until the media components land.
69
- */
70
- assetHashes: z.ZodOptional<z.ZodArray<z.ZodString>>;
71
- }, z.core.$loose>;
72
- export type DeckOwner = z.infer<typeof DeckOwnerSchema>;
73
- export type DeckMeta = z.infer<typeof DeckMetaSchema>;
74
- export type DeckMetaParseResult = {
75
- ok: true;
76
- meta: DeckMeta;
77
- } | {
78
- ok: false;
79
- errors: string[];
80
- };
81
- /** Parse an untrusted meta sidecar, reporting every problem at once. */
82
- export declare function parseDeckMeta(input: unknown): DeckMetaParseResult;
83
- /** Pretty-printed with a trailing newline, matching every other repo-stored JSON. */
84
- export declare function serializeDeckMeta(meta: DeckMeta): string;
85
- //# sourceMappingURL=deck-meta.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"deck-meta.d.ts","sourceRoot":"","sources":["../../src/schemas/deck-meta.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAGxB;;;;;;;;;GASG;AAEH,gFAAgF;AAChF,eAAO,MAAM,wBAAwB,IAAI,CAAC;AAE1C;;;;;GAKG;AACH,eAAO,MAAM,eAAe;;;;;;;;;;2BAgB1B,CAAC;AAEH;;;;;;GAMG;AACH,eAAO,MAAM,cAAc;;;IAGzB,0DAA0D;;IAE1D,uDAAuD;;;;;;;;;;;;;;;IAKvD;;;;;;;;;;;OAWG;;iBAEH,CAAC;AAEH,MAAM,MAAM,SAAS,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,eAAe,CAAC,CAAC;AACxD,MAAM,MAAM,QAAQ,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,cAAc,CAAC,CAAC;AAEtD,MAAM,MAAM,mBAAmB,GAAG;IAAE,EAAE,EAAE,IAAI,CAAC;IAAC,IAAI,EAAE,QAAQ,CAAA;CAAE,GAAG;IAAE,EAAE,EAAE,KAAK,CAAC;IAAC,MAAM,EAAE,MAAM,EAAE,CAAA;CAAE,CAAC;AAEjG,wEAAwE;AACxE,wBAAgB,aAAa,CAAC,KAAK,EAAE,OAAO,GAAG,mBAAmB,CAGjE;AAED,qFAAqF;AACrF,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,QAAQ,GAAG,MAAM,CAExD"}
@@ -1,64 +0,0 @@
1
- import {
2
- DeckIdSchema,
3
- formatDeckIssues
4
- } from "../chunk-VAYZJKVR.js";
5
- import "../chunk-JSBRDJBE.js";
6
-
7
- // src/schemas/deck-meta.ts
8
- import { z } from "zod";
9
- var DECK_META_SCHEMA_VERSION = 1;
10
- var DeckOwnerSchema = z.discriminatedUnion("kind", [
11
- z.object({
12
- kind: z.literal("viewer"),
13
- /** The `viewer_credentials` username — the person-level key. */
14
- username: z.string().min(1).max(200),
15
- /** The audience that credential signed in as, for editor-side context. */
16
- audience: z.string().min(1).max(200)
17
- }),
18
- z.object({
19
- kind: z.literal("editor"),
20
- userId: z.string().min(1).max(200)
21
- }),
22
- z.object({
23
- kind: z.literal("audience"),
24
- audience: z.string().min(1).max(200)
25
- })
26
- ]);
27
- var DeckMetaSchema = z.looseObject({
28
- schemaVersion: z.literal(DECK_META_SCHEMA_VERSION),
29
- id: DeckIdSchema,
30
- /** Mirrors deck.title so a listing needs no deck body. */
31
- title: z.string().min(1).max(120),
32
- /** Mirrors deck.slides.length, for the same reason. */
33
- slideCount: z.number().int().min(1),
34
- owner: DeckOwnerSchema,
35
- createdAt: z.iso.datetime(),
36
- updatedAt: z.iso.datetime(),
37
- /**
38
- * Bucket hashes this deck's media resolved to when it was published, and the
39
- * whole reason publish-time GC can protect them (ADR 0002).
40
- *
41
- * A deck references media by MANIFEST ID, and an id is only resolvable to a
42
- * bucket hash while the manifest still carries the entry — which is exactly
43
- * what stops being true in the case the keep-set exists for: the editor
44
- * removes the media from the library, the entry goes, and the object then
45
- * looks unreferenced to every reader. Resolving at publish time and recording
46
- * the answer here is what survives that. Absent when the deck references no
47
- * bucket-backed media, which is every deck until the media components land.
48
- */
49
- assetHashes: z.array(z.string().min(1)).optional()
50
- });
51
- function parseDeckMeta(input) {
52
- const result = DeckMetaSchema.safeParse(input);
53
- return result.success ? { ok: true, meta: result.data } : { ok: false, errors: formatDeckIssues(result.error) };
54
- }
55
- function serializeDeckMeta(meta) {
56
- return JSON.stringify(meta, null, 2) + "\n";
57
- }
58
- export {
59
- DECK_META_SCHEMA_VERSION,
60
- DeckMetaSchema,
61
- DeckOwnerSchema,
62
- parseDeckMeta,
63
- serializeDeckMeta
64
- };