@drawnagency/primitives 0.1.118 → 0.1.120
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{chunk-O37AV27P.js → chunk-5JYHTHVR.js} +28 -0
- package/dist/{chunk-W72BPGR3.js → chunk-BZKHHUIN.js} +44 -8
- package/dist/{chunk-4NSOKEA7.js → chunk-HFHM4MNK.js} +12 -7
- package/dist/{chunk-CEFFP3CH.js → chunk-HZTPF6OK.js} +304 -83
- package/dist/{chunk-RIITGTV3.js → chunk-LQHBC7C6.js} +37 -2
- package/dist/{chunk-VY3IFGE3.js → chunk-QAMAIDXZ.js} +1 -1
- package/dist/{chunk-HRX3XJBU.js → chunk-RIN2QCYJ.js} +9 -11
- package/dist/{chunk-ZOTRHHUB.js → chunk-UNFPATDE.js} +8 -10
- package/dist/{chunk-ERLIL4RU.js → chunk-UZBFVVTC.js} +35 -37
- package/dist/{chunk-67P34WNW.js → chunk-ZKVQMIMJ.js} +3 -20
- package/dist/collab/rebase.js +4 -5
- package/dist/components/chat/ChatComposer.d.ts +0 -4
- package/dist/components/chat/ChatComposer.d.ts.map +1 -1
- package/dist/components/chat/ChatPanel.d.ts +2 -3
- package/dist/components/chat/ChatPanel.d.ts.map +1 -1
- package/dist/components/chat/markdown.d.ts +2 -3
- package/dist/components/chat/markdown.d.ts.map +1 -1
- package/dist/components/editor/AudienceIndicator.d.ts +3 -1
- package/dist/components/editor/AudienceIndicator.d.ts.map +1 -1
- package/dist/components/editor/IndicatorPill.d.ts +3 -1
- package/dist/components/editor/IndicatorPill.d.ts.map +1 -1
- package/dist/components/editor/PagesModal.d.ts +0 -2
- package/dist/components/editor/PagesModal.d.ts.map +1 -1
- package/dist/components/editor/SectionBulkEditModal.d.ts +25 -0
- package/dist/components/editor/SectionBulkEditModal.d.ts.map +1 -0
- package/dist/components/editor/StatusIndicator.d.ts +3 -1
- package/dist/components/editor/StatusIndicator.d.ts.map +1 -1
- package/dist/components/editor/index.js +28 -26
- package/dist/components/primitives/index.js +11 -15
- package/dist/components/sections/brand-guide.js +10 -13
- package/dist/components/sections/register-schemas.js +16 -21
- package/dist/components/sections/register.js +16 -21
- package/dist/components/shared/Popover.d.ts +1 -1
- package/dist/components/shared/Popover.d.ts.map +1 -1
- package/dist/components/shared/SectionSummaryRow.d.ts +1 -1
- package/dist/components/shell/AudienceChips.d.ts +1 -3
- package/dist/components/shell/AudienceChips.d.ts.map +1 -1
- package/dist/components/shell/EditorModal.d.ts.map +1 -1
- package/dist/components/shell/EditorShell.d.ts +0 -34
- package/dist/components/shell/EditorShell.d.ts.map +1 -1
- package/dist/components/shell/SiteSettingsModal.d.ts.map +1 -1
- package/dist/hooks/useSortableNavRow.d.ts +1 -1
- package/dist/hooks/useSortableRow.d.ts +1 -1
- package/dist/index.js +83 -90
- package/dist/lib/index-ops.js +5 -6
- package/dist/lib/index.js +27 -32
- package/dist/lib/pages.d.ts +0 -2
- package/dist/lib/pages.d.ts.map +1 -1
- package/dist/lib/sidecars.js +2 -2
- package/dist/lib/site-validation.js +13 -14
- package/dist/lib/storage-tier.js +4 -4
- package/dist/schemas/index.js +42 -45
- package/dist/schemas/site-config.d.ts +1 -277
- package/dist/schemas/site-config.d.ts.map +1 -1
- package/package.json +2 -42
- package/src/components/chat/ChatComposer.tsx +0 -4
- package/src/components/chat/ChatPanel.tsx +2 -3
- package/src/components/chat/markdown.ts +2 -3
- package/src/components/editor/AudienceIndicator.tsx +8 -4
- package/src/components/editor/IndicatorPill.tsx +4 -0
- package/src/components/editor/PagesModal.tsx +1 -15
- package/src/components/editor/SectionBulkEditModal.tsx +328 -0
- package/src/components/editor/StatusIndicator.tsx +7 -6
- package/src/components/shared/Popover.tsx +17 -4
- package/src/components/shared/SectionSummaryRow.tsx +1 -1
- package/src/components/shell/AudienceChips.tsx +1 -3
- package/src/components/shell/EditorModal.tsx +5 -2
- package/src/components/shell/EditorShell.tsx +15 -119
- package/src/components/shell/SiteSettingsModal.tsx +0 -11
- package/src/lib/pages.ts +0 -22
- package/src/schemas/index.ts +0 -4
- package/src/schemas/site-config.ts +4 -32
- package/dist/chunk-4TZJZU2T.js +0 -92
- package/dist/chunk-DIMDRBFK.js +0 -11
- package/dist/chunk-FV7JQRCN.js +0 -94
- package/dist/chunk-IIDKW7AV.js +0 -41
- package/dist/chunk-JCDZAFX2.js +0 -224
- package/dist/chunk-MM7KZS5C.js +0 -30
- package/dist/chunk-QQ3S3P5P.js +0 -38
- package/dist/chunk-TEOAKGZA.js +0 -784
- package/dist/chunk-VAYZJKVR.js +0 -209
- package/dist/components/editor/SectionOrderingModal.d.ts +0 -10
- package/dist/components/editor/SectionOrderingModal.d.ts.map +0 -1
- package/dist/components/shell/DocInspector.d.ts +0 -18
- package/dist/components/shell/DocInspector.d.ts.map +0 -1
- package/dist/components/shell/DocumentEditorOverlay.d.ts +0 -29
- package/dist/components/shell/DocumentEditorOverlay.d.ts.map +0 -1
- package/dist/components/shell/DocumentPresentOverlay.d.ts +0 -30
- package/dist/components/shell/DocumentPresentOverlay.d.ts.map +0 -1
- package/dist/components/shell/SiteSettingsDecks.d.ts +0 -13
- package/dist/components/shell/SiteSettingsDecks.d.ts.map +0 -1
- package/dist/deck/DeckComponentView.d.ts +0 -13
- package/dist/deck/DeckComponentView.d.ts.map +0 -1
- package/dist/deck/DeckPlayer.d.ts +0 -26
- package/dist/deck/DeckPlayer.d.ts.map +0 -1
- package/dist/deck/DeckSlideView.d.ts +0 -17
- package/dist/deck/DeckSlideView.d.ts.map +0 -1
- package/dist/deck/DeckStage.d.ts +0 -16
- package/dist/deck/DeckStage.d.ts.map +0 -1
- package/dist/deck/components/DeckImage.d.ts +0 -14
- package/dist/deck/components/DeckImage.d.ts.map +0 -1
- package/dist/deck/components/DeckImageGrid.d.ts +0 -27
- package/dist/deck/components/DeckImageGrid.d.ts.map +0 -1
- package/dist/deck/components/DeckRichText.d.ts +0 -22
- package/dist/deck/components/DeckRichText.d.ts.map +0 -1
- package/dist/deck/components/DeckVideo.d.ts +0 -15
- package/dist/deck/components/DeckVideo.d.ts.map +0 -1
- package/dist/deck/editing.d.ts +0 -50
- package/dist/deck/editing.d.ts.map +0 -1
- package/dist/deck/flip.d.ts +0 -11
- package/dist/deck/flip.d.ts.map +0 -1
- package/dist/deck/index.d.ts +0 -24
- package/dist/deck/index.d.ts.map +0 -1
- package/dist/deck/index.js +0 -51
- package/dist/deck/layouts/CenteredTextLayout.d.ts +0 -12
- package/dist/deck/layouts/CenteredTextLayout.d.ts.map +0 -1
- package/dist/deck/layouts/ColumnSplitLayout.d.ts +0 -14
- package/dist/deck/layouts/ColumnSplitLayout.d.ts.map +0 -1
- package/dist/deck/layouts/FullBleedImageLayout.d.ts +0 -14
- package/dist/deck/layouts/FullBleedImageLayout.d.ts.map +0 -1
- package/dist/deck/media.d.ts +0 -33
- package/dist/deck/media.d.ts.map +0 -1
- package/dist/deck/tokens.d.ts +0 -22
- package/dist/deck/tokens.d.ts.map +0 -1
- package/dist/deck/useStageScale.d.ts +0 -10
- package/dist/deck/useStageScale.d.ts.map +0 -1
- package/dist/deck-builder/DeckBuilderApp.d.ts +0 -30
- package/dist/deck-builder/DeckBuilderApp.d.ts.map +0 -1
- package/dist/deck-builder/DeckBuilderTopBar.d.ts +0 -24
- package/dist/deck-builder/DeckBuilderTopBar.d.ts.map +0 -1
- package/dist/deck-builder/DeckChatPanel.d.ts +0 -45
- package/dist/deck-builder/DeckChatPanel.d.ts.map +0 -1
- package/dist/deck-builder/DeckEditor.d.ts +0 -37
- package/dist/deck-builder/DeckEditor.d.ts.map +0 -1
- package/dist/deck-builder/DeckLibrary.d.ts +0 -22
- package/dist/deck-builder/DeckLibrary.d.ts.map +0 -1
- package/dist/deck-builder/DeckSlideSurface.d.ts +0 -31
- package/dist/deck-builder/DeckSlideSurface.d.ts.map +0 -1
- package/dist/deck-builder/deck-api.d.ts +0 -76
- package/dist/deck-builder/deck-api.d.ts.map +0 -1
- package/dist/deck-builder/deck-chat-client.d.ts +0 -44
- package/dist/deck-builder/deck-chat-client.d.ts.map +0 -1
- package/dist/deck-builder/deck-chat-history.d.ts +0 -10
- package/dist/deck-builder/deck-chat-history.d.ts.map +0 -1
- package/dist/deck-builder/index.d.ts +0 -13
- package/dist/deck-builder/index.d.ts.map +0 -1
- package/dist/deck-builder/index.js +0 -1498
- package/dist/deck-builder/starter-deck.d.ts +0 -23
- package/dist/deck-builder/starter-deck.d.ts.map +0 -1
- package/dist/deck-builder/types.d.ts +0 -29
- package/dist/deck-builder/types.d.ts.map +0 -1
- package/dist/deck-builder/useSortableSlide.d.ts +0 -29
- package/dist/deck-builder/useSortableSlide.d.ts.map +0 -1
- package/dist/document/assets/fonts/albra-grotesk-bold.woff +0 -0
- package/dist/document/assets/fonts/albra-grotesk-regular.woff +0 -0
- package/dist/document/assets/fonts/kapra-neue-expanded-medium.woff +0 -0
- package/dist/document/assets/fonts/kapra-neue-expanded-regular.woff +0 -0
- package/dist/document/components/DocCoverPage.d.ts +0 -11
- package/dist/document/components/DocCoverPage.d.ts.map +0 -1
- package/dist/document/components/DocPage.d.ts +0 -10
- package/dist/document/components/DocPage.d.ts.map +0 -1
- package/dist/document/components/DocRail.d.ts +0 -28
- package/dist/document/components/DocRail.d.ts.map +0 -1
- package/dist/document/components/DocSectionPage.d.ts +0 -12
- package/dist/document/components/DocSectionPage.d.ts.map +0 -1
- package/dist/document/components/DocViewer.d.ts +0 -21
- package/dist/document/components/DocViewer.d.ts.map +0 -1
- package/dist/document/components/Wordmark.d.ts +0 -4
- package/dist/document/components/Wordmark.d.ts.map +0 -1
- package/dist/document/components/measure.d.ts +0 -7
- package/dist/document/components/measure.d.ts.map +0 -1
- package/dist/document/components/useDocPages.d.ts +0 -12
- package/dist/document/components/useDocPages.d.ts.map +0 -1
- package/dist/document/engine/blocks.d.ts +0 -2
- package/dist/document/engine/blocks.d.ts.map +0 -1
- package/dist/document/engine/harvest.d.ts +0 -3
- package/dist/document/engine/harvest.d.ts.map +0 -1
- package/dist/document/engine/masonry.d.ts +0 -26
- package/dist/document/engine/masonry.d.ts.map +0 -1
- package/dist/document/engine/paginate.d.ts +0 -43
- package/dist/document/engine/paginate.d.ts.map +0 -1
- package/dist/document/engine/settings.d.ts +0 -91
- package/dist/document/engine/settings.d.ts.map +0 -1
- package/dist/document/engine/types.d.ts +0 -44
- package/dist/document/engine/types.d.ts.map +0 -1
- package/dist/document/index.d.ts +0 -13
- package/dist/document/index.d.ts.map +0 -1
- package/dist/document/index.js +0 -1030
- package/dist/document/styles/document.css +0 -217
- package/dist/lib/deck-access.d.ts +0 -86
- package/dist/lib/deck-access.d.ts.map +0 -1
- package/dist/lib/deck-access.js +0 -58
- package/dist/lib/deck-dexie.d.ts +0 -88
- package/dist/lib/deck-dexie.d.ts.map +0 -1
- package/dist/lib/deck-dexie.js +0 -22
- package/dist/lib/deck-edit.d.ts +0 -67
- package/dist/lib/deck-edit.d.ts.map +0 -1
- package/dist/lib/deck-media-assets.d.ts +0 -27
- package/dist/lib/deck-media-assets.d.ts.map +0 -1
- package/dist/lib/deck-media-assets.js +0 -25
- package/dist/lib/deck-media-refs.d.ts +0 -35
- package/dist/lib/deck-media-refs.d.ts.map +0 -1
- package/dist/lib/deck-media-refs.js +0 -36
- package/dist/lib/deck-tool.d.ts +0 -25
- package/dist/lib/deck-tool.d.ts.map +0 -1
- package/dist/lib/deck-tool.js +0 -58
- package/dist/lib/document-input.d.ts +0 -25
- package/dist/lib/document-input.d.ts.map +0 -1
- package/dist/schemas/deck-meta.d.ts +0 -85
- package/dist/schemas/deck-meta.d.ts.map +0 -1
- package/dist/schemas/deck-meta.js +0 -64
- package/dist/schemas/deck.d.ts +0 -954
- package/dist/schemas/deck.d.ts.map +0 -1
- package/dist/schemas/deck.js +0 -65
- package/src/components/editor/SectionOrderingModal.tsx +0 -80
- package/src/components/shell/DocInspector.tsx +0 -314
- package/src/components/shell/DocumentEditorOverlay.tsx +0 -179
- package/src/components/shell/DocumentPresentOverlay.tsx +0 -87
- package/src/components/shell/SiteSettingsDecks.tsx +0 -41
- package/src/deck/DeckComponentView.tsx +0 -28
- package/src/deck/DeckPlayer.tsx +0 -166
- package/src/deck/DeckSlideView.tsx +0 -38
- package/src/deck/DeckStage.tsx +0 -39
- package/src/deck/components/DeckImage.tsx +0 -38
- package/src/deck/components/DeckImageGrid.tsx +0 -254
- package/src/deck/components/DeckRichText.tsx +0 -111
- package/src/deck/components/DeckVideo.tsx +0 -81
- package/src/deck/editing.tsx +0 -201
- package/src/deck/flip.ts +0 -70
- package/src/deck/index.ts +0 -30
- package/src/deck/layouts/CenteredTextLayout.tsx +0 -29
- package/src/deck/layouts/ColumnSplitLayout.tsx +0 -69
- package/src/deck/layouts/FullBleedImageLayout.tsx +0 -58
- package/src/deck/media.tsx +0 -46
- package/src/deck/tokens.ts +0 -57
- package/src/deck/useStageScale.ts +0 -44
- package/src/deck-builder/DeckBuilderApp.tsx +0 -572
- package/src/deck-builder/DeckBuilderTopBar.tsx +0 -62
- package/src/deck-builder/DeckChatPanel.tsx +0 -334
- package/src/deck-builder/DeckEditor.tsx +0 -258
- package/src/deck-builder/DeckLibrary.tsx +0 -195
- package/src/deck-builder/DeckSlideSurface.tsx +0 -55
- package/src/deck-builder/deck-api.ts +0 -177
- package/src/deck-builder/deck-chat-client.ts +0 -129
- package/src/deck-builder/deck-chat-history.ts +0 -62
- package/src/deck-builder/index.ts +0 -12
- package/src/deck-builder/starter-deck.ts +0 -86
- package/src/deck-builder/types.ts +0 -24
- package/src/deck-builder/useSortableSlide.ts +0 -102
- package/src/document/assets/fonts/albra-grotesk-bold.woff +0 -0
- package/src/document/assets/fonts/albra-grotesk-regular.woff +0 -0
- package/src/document/assets/fonts/kapra-neue-expanded-medium.woff +0 -0
- package/src/document/assets/fonts/kapra-neue-expanded-regular.woff +0 -0
- package/src/document/components/DocCoverPage.tsx +0 -45
- package/src/document/components/DocPage.tsx +0 -40
- package/src/document/components/DocRail.tsx +0 -189
- package/src/document/components/DocSectionPage.tsx +0 -48
- package/src/document/components/DocViewer.tsx +0 -313
- package/src/document/components/Wordmark.tsx +0 -18
- package/src/document/components/measure.tsx +0 -133
- package/src/document/components/useDocPages.ts +0 -95
- package/src/document/engine/blocks.ts +0 -116
- package/src/document/engine/harvest.ts +0 -95
- package/src/document/engine/masonry.ts +0 -158
- package/src/document/engine/paginate.ts +0 -232
- package/src/document/engine/settings.ts +0 -125
- package/src/document/engine/types.ts +0 -64
- package/src/document/index.ts +0 -18
- package/src/document/styles/document.css +0 -217
- package/src/lib/deck-access.ts +0 -132
- package/src/lib/deck-dexie.ts +0 -190
- package/src/lib/deck-edit.ts +0 -196
- package/src/lib/deck-media-assets.ts +0 -57
- package/src/lib/deck-media-refs.ts +0 -67
- package/src/lib/deck-tool.ts +0 -95
- package/src/lib/document-input.ts +0 -57
- package/src/schemas/deck-meta.ts +0 -88
- package/src/schemas/deck.ts +0 -478
- 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
|
-
};
|
package/dist/lib/deck-tool.d.ts
DELETED
|
@@ -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"}
|
package/dist/lib/deck-tool.js
DELETED
|
@@ -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
|
-
};
|