@plitzi/sdk-mcp 0.38.2 → 0.38.4

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/CHANGELOG.md CHANGED
@@ -1,5 +1,342 @@
1
1
  # @plitzi/sdk-mcp
2
2
 
3
+ ## 0.38.4
4
+
5
+ ### Patch Changes
6
+
7
+ - 6ae4161: ## `plitzi push`: a self-hosted project back on its space
8
+
9
+ `plitzi create --from` and `plitzi pull` took a space out as a project and kept it in step; nothing put the project's
10
+ own changes back but a command per part, and no command at all for its pages. `plitzi push` is the way back
11
+ (`docs/en/projects-from-spaces.md`):
12
+
13
+ - **What changed, or what is named.** `plitzi push` sends what changed since the project last had the space — at a
14
+ terminal, offered as a ticked list to choose from (`↑/↓`, space, Enter); `plitzi push space functions` sends only
15
+ those parts: `space`, `functions`, `runtime`, `plugins`.
16
+ - **In order:** each changed plugin packed and uploaded (`pack plugin` + `upload plugin`, `--cdn`/`--bucket`), the
17
+ functions, the runtime, then the space — `src/space.ts` authored, the actions `src/actions.ts` serves and the manifests
18
+ in `src/connectors/` — as the space's draft. Never a published environment.
19
+ - **Never over the builder's work unseen.** The export now carries which state the draft is in (`SpaceExport.draft`),
20
+ recorded in `.plitzi/space.json` by `create --from` and `pull`; a push names it, and a draft edited since is refused
21
+ until `--force`. A project that never had the space may take one nobody has worked on; one holding work takes
22
+ `--force`.
23
+ - **Then `pull` follows it.** `.plitzi/space.json` records what was sent — only that, so a builder's change to a part
24
+ not pushed is still the next pull's — and a project that started on its own works with `pull` from then on.
25
+ - `@plitzi/sdk-shared/source`: `SpaceImport` / `SpaceImportResult` (`SPACE_IMPORT_FORMAT`), the push's one shape for
26
+ both ends, beside `SpaceExport`, which gains `draft`.
27
+ - `functions push`, `runtime push` and `upload plugin` keep their behaviour; their cores are what `push` runs.
28
+
29
+ ## A project's folders: `tmp/` for what it writes, `.plitzi/` committed, `public/` said to be public
30
+ - **`tmp/` is what a project writes for itself.** `@plitzi/sdk-server` keeps the plugins it builds in `tmp/.sdk-plugins`
31
+ and resized pictures in `tmp/images` by default (were `.sdk-plugins` and `.plitzi/images`). A project the CLI writes
32
+ puts the port it took (`tmp/dev-server.json`), the space as last authored while developing (`tmp/space.json`) and
33
+ Playwright's output (`tmp/visual`) there too, and its `.gitignore` ignores `tmp` — one line for all of it.
34
+ - **`.plitzi/` is committed.** The scaffold ignored it whole, so a clone lost `space.json`, `functions.json` and
35
+ `scaffold.json` — what `pull`, `push`, `functions push` and `upgrade` stand on. Now it holds only what the CLI records.
36
+ `npx plitzi upgrade --write` brings an existing project's `.gitignore` up.
37
+ - **No `space/offline-data.json`.** `npm run author` checks the space and writes nothing; the server asks it for the
38
+ documents with `--out tmp/space.json` while developing. The space is `src/space.ts`, and nothing beside it says
39
+ otherwise.
40
+ - **`public/` is on the internet.** The generated `README.md` and `AGENTS.md`, the CLI and authoring skills, the MCP
41
+ guide, `@plitzi/sdk-server`'s README and the docs now say so where data goes: never a secret, a key or data only
42
+ some visitors may read — in `public/`, or in a space's documents, which reach every visitor too.
43
+
44
+ ## An agent leaves the project clean
45
+
46
+ `AGENTS.md` gains **Keep the project clean** — nothing unused left behind, scratch work in `tmp/`, one of everything,
47
+ files a reader can find, and `author`, `typecheck`, `lint`, `format` and `check` passing — and the authoring skill's
48
+ review checklist a **Nothing left behind** section.
49
+
50
+ ## The dev tools' X-ray is the outlines too
51
+
52
+ The QA tab had **Outlines** (every element's box, its type and id when pointed at) and **X-ray** (the same boxes,
53
+ fainter, with what is wired to each). They are one tool now: the X-ray draws every box with its type and id, and marks
54
+ the wiring picked — all of it, one kind, or **Boxes only**.
55
+
56
+ ## A new space that says where to go
57
+
58
+ The space a new account and `plitzi create` start from keeps its welcome, and gains the three ways to change it — the
59
+ builder, code (with the command to run) and an agent — before the guides, which are shorter. Header, navigation, main
60
+ and footer are landmarks; the grid behind the top fades out instead of ending at an edge; the footer's line spans the
61
+ content; the links say their words and icon themselves, with no suggestion left.
62
+
63
+ ## Server data reads the same everywhere
64
+ - **One shape for a provider with a `query`.** A `runtime: 'server'` provider that only reads a JSON file the server
65
+ serves answered the body itself, while the same provider in the browser publishes `{ status, data }` — so moving it
66
+ to the server broke every binding. `publicFileResolver` and the builder's mock now answer `{ status, data }` too:
67
+ `<source>.data.<field>` whichever runtime.
68
+ - **Server data is on unless a space turns it off.** The page render read a missing `rsc` as on and the connector
69
+ resolver as off, so a server provider in a space the builder or the MCP made (neither writes `rsc`) resolved to
70
+ nothing, silently. Both read it as on now; only `rsc: { enabled: false }` turns it off (and is warned with a server
71
+ element). `authorSpace` writes `enabled: true` for a space that has one.
72
+ - **Never inside a component.** The page server resolves a page's tree and its layouts only, so a server provider in a
73
+ component rendered nothing, silently. Refused now (`server-provider-in-component`), with the fix: the provider on
74
+ the page, the rows handed in as a prop.
75
+ - **Bindings held to the data.** `authorSpace` takes `data` — what a provider's `query` answers — and
76
+ `publicData(folder)` (`@plitzi/sdk-authoring/node`) reads it from `public/`. A binding onto a path the file does not
77
+ have is warned (`path-not-in-data`) with the keys it does have. Generated projects pass it.
78
+ - **`plitzi check` reads the data too.** A binding that reads a path its provider's answer lacks, a provider that
79
+ failed (once, not as every element it left empty) and the rows each list rendered (`dataIssues`). `--ssr` names what
80
+ the server's HTML lacks that the hydrated page has. The dev tools' badge and panel (`data-plitzi-devtools`) are hidden
81
+ while `check` and `shot` look.
82
+
83
+ ## Authoring, clearer where agents tripped
84
+ - **`controls` on a button** (`aria-controls`): named by the element's id; authoring gives that element the anchor and
85
+ refuses an id the space lacks (`controls-unknown`); a saved document naming no anchor is warned
86
+ (`controls-no-anchor`). The accordion recipe uses it.
87
+ - **`live` on a container** (`aria-live`, `polite` or `assertive`) for words that change while a visitor reads them.
88
+ - **`subType: 'p'`** for a paragraph made of parts; `span-holds-block` covers it.
89
+ - **`formControl` types `search`, `url` and `tel`.**
90
+ - **Images:** no `src` draws the SDK's own placeholder (the CDN one answered 404); `resize: false` keeps a picture as
91
+ written; an SVG is never resized — `/_plitzi/img` redirects to it (`307`) instead of refusing it.
92
+ - **Messages:** an id taken by another page or layout names it and the id to write; a hyphenated source in a template
93
+ (`list_study-plans`) is explained as valid; an unknown CSS property says to write it in `customCss`; an unknown
94
+ variant on `custom` says it is never a prop of the component it hosts.
95
+ - **`plitzi explain` knows the helpers** — `bindTemplate`, `visibleWhen`, `variantFrom`, `activeOn`, `activeWhen`,
96
+ `when`, `named`, `scope`, `source`, `twig` — and `motion`, from the presets the SDK plays (`MOTION_ENTERS`,
97
+ `MOTION_TRIGGERS`, `MOTION_LOOPS`, now exported). `--list helpers` lists them.
98
+ - **`plitzi shot`** writes to `tmp/shots/` by default, and a full page shows the arrivals tied to the scroll as they
99
+ end. `inspectPage` no longer reports an image a hidden ancestor hides.
100
+ - **Style inspector:** `container-type` in Size.
101
+ - **New recipes:** `server-data.ts`, `accordion.ts`.
102
+
103
+ ## Matching a page to another, measured
104
+ - **A whole page is the whole page.** The SDK scrolls a pane of its own, so `shot`'s full-page picture was one
105
+ screen; the pane is unrolled now (`unrollPage`) — the viewport untouched, so a `100vh` hero stays one screen.
106
+ - **`plitzi shot --compare` says why, not only how much.** Every lazy picture on both pages is loaded before they are
107
+ taken (`loadImages`), so a section no longer swings between 23 % and 40 % on how many covers had arrived. Each section
108
+ is compared where it is on the other page (`alignPictures` over row profiles): a page 400 px longer is said once, with
109
+ the section the drift starts at, instead of a footer with the same styles reading 100 %. And the texts both pages
110
+ have are paired (`pageTexts`, `compareTexts`), each with what it does differently there —
111
+ `h1 "Learn CSS" — font-size 68px → 60px · y +19px` — position less the drift of its section. `comparePictures` takes
112
+ its options as an object now (`{ regions, tolerance, align }`).
113
+ - **`--scheme` is the space's theme.** A space whose default is dark painted dark under `--scheme light`, and the file
114
+ said light. `check` and `shot` now set the `theme` cookie a visitor's toggle writes; left out, the space's default is
115
+ pictured and the file is named by the theme actually painted.
116
+
117
+ ## `motion: { on: 'view' }` arrives once
118
+
119
+ `view` was tied to the scroll both ways: cards faded out again as the reader scrolled back up. Now it plays once, the
120
+ first time the element comes into view, with its `duration`, and stays — `revealOnView` (`@plitzi/sdk-shared/schema/
121
+ motionReveal`), one observer under the SDK's root, marks it `data-motion-seen`. The scroll-driven arrival is
122
+ `on: 'scroll'`. A page read without scripts shows them as they end (`@media (scripting: none)`); the builder's previews
123
+ and the MCP's local screenshots hold motion at its end. The builder's Motion tab has the three.
124
+
125
+ The builder's preview plays motion as the published page does. It held everything at its end, and nothing marked
126
+ the canvas `data-hydrated`, so neither the loops nor a space's own `[data-hydrated]` animations ever started there.
127
+ Now an arrival plays as it comes into view, and the loops and keyframes run; **▶** on the canvas being edited runs the
128
+ space's own `[data-hydrated]` loops too. The motion guide adds the rule this needs from a space: `[data-hydrated]` is for
129
+ loops; an entrance of its own that plays once (`transform`/`opacity` only) plays from the first paint with
130
+ `backwards`, as the presets do — gated on hydration it jumps when the page goes live, and a canvas that never goes
131
+ live holds it on its first frame.
132
+
133
+ ## Thirteen ways in, nine loops
134
+
135
+ `motion` grows from six arrivals and four loops to thirteen and nine, all still `opacity` and the transforms:
136
+
137
+ - **Bold arrivals:** `slide-up` (from well below), `zoom-in` (from 60%), `zoom-out` (settling from 125%), `tilt`
138
+ (rising as it turns straight), `spin-in` (half a turn as it grows).
139
+ - **Springy arrivals:** `pop` overshoots and settles; `bounce-in` falls into place and bounces.
140
+ - **Loops:** `bounce`, `wobble`, `orbit` (a slow circle round where it is), `heartbeat`, `drift`.
141
+
142
+ An arrival is now a list of frames (`MOTION_ENTER_FRAMES` in `@plitzi/sdk-shared/schema/motion`; `MOTION_ENTER_FROM`
143
+ is its first), and so is a loop (`MOTION_LOOP_FRAMES[name].frames`, replacing `transform`/`at`). Arrivals move the
144
+ individual `translate`, `scale` and `rotate`, so they still compose with an element's own `transform` and with a loop.
145
+ The builder's Motion tab previews every frame; authoring, the MCP, `explain motion` and GraphQL read the same lists.
146
+
147
+ An arrival from the side no longer scrolls the page sideways. `slide-left` starts 32px to the right of where it lands,
148
+ past a phone's 16px gutter, and until it had played the page could be dragged sideways. The SDK's root clips that way
149
+ now (`overflow-x: clip`, which keeps the window the scroller: sticky bars and scroll timelines are untouched), and the
150
+ builder's preview does the same. Content wider than the page is cut rather than scrolling the page — give it a box of
151
+ its own with `overflow-x: auto`.
152
+
153
+ **3D and the transform parts are style properties.** `transform-style`, `perspective-origin`, `backface-visibility`,
154
+ `translate`, `rotate` and `scale` join the vocabulary (they were refused as `css-property-unknown` and had to go in
155
+ `customCss`); `scale: 0.94` is a factor, not pixels.
156
+
157
+ **The builder's placeholder for an empty element is 24px** (was 50px), one size for every element that has one. It
158
+ is a minimum, so it also grew empty shapes with a size of their own — a dot, a planet — while editing; 24px is still
159
+ a box to see, pick and drop into.
160
+
161
+ The desktop app's window was blank: authoring, run in the renderer to build the rail, asked Vite's `process` shim for
162
+ a working directory it does not have. It reads one only where there is one now — and only when a class conflict is
163
+ reported, rather than for every element of every space it writes.
164
+
165
+ ## Authoring advice that knows where and when
166
+ - **`class-conflict` says where both declarations are:** `styles('md-menu-button') at src/components/dropdown.ts:12,
167
+ used by button at …, and styles('md-menu-button') at src/site/layout.ts:8, used by …` — `styles()` records its line as
168
+ an element factory does.
169
+ - **`repeated-shape` leaves controls alone.** Siblings that read different sources or write different state keys — a
170
+ menu for the language, one for the level — are not offered as a list.
171
+ - **`quiet: ['repeated-shape']`** on an element says a suggestion was left on purpose, and it is not offered again.
172
+ Only suggestions' codes (`quiet-unknown`). It is saved on the element (`definition.quiet`), so the builder's problems
173
+ panel, the MCP's `upsertElement`/`patchElement` and a project pulled back with `plitzi pull` all leave it alone.
174
+
175
+ ## What the docs say is what the code does
176
+
177
+ A pass across authoring's own messages, the skills, the MCP guide, `docs/en`, the CLI's README and the website, so an
178
+ agent reading two of them is never told two things:
179
+
180
+ - **A binding's `source` is the bound value, and only that.** With no value yet it fell back to the attribute's
181
+ current one — `sourceTo` — so `{{ source|default('…') }}` never took its default and `{{ source ? … }}` read an
182
+ element's placeholder ("Text") as an answer. It is `undefined` until the source has a value now; `sourceTo` is still
183
+ the value before.
184
+ - **`explain` writes a step the way its builder is called:** `delay(ms)`, `openModal('modal-id', data?)`,
185
+ `scrollBy('row-id', { x: '80%' })` — not `delay(…)` above the document's param names, which read as `delay({ time })`.
186
+ - **A page field nobody takes is told what it was probably for** — `seo` → `seoTitle` and `seoDescription` — instead of a
187
+ hint about keeping state appended to every one.
188
+ - Docs set straight: an element's id is `data-plitzi-el` in the page (`data-id` is the builder's, with debugging on);
189
+ a visibility condition writes nothing while its source has no value and is a yes or a no once it has one; `mobile`
190
+ is up to and including 48rem; `loadStrategy` defaults by type (`lazy` for a modal); the accessibility codes listed
191
+ in full everywhere (`embed-without-title`, `dropdown-without-control`, `controls-no-anchor`); the generated
192
+ `AGENTS.md` says a repeated block is a component and rows of data a list, as the skill does; `plitzi runtime` is
193
+ documented in the CLI's README, its skill and the website, which no longer says state across requests needs a
194
+ server of your own.
195
+
196
+ - Updated dependencies [6ae4161]
197
+ - @plitzi/sdk-authoring@0.38.4
198
+ - @plitzi/sdk-elements@0.38.4
199
+ - @plitzi/sdk-interactions@0.38.4
200
+ - @plitzi/sdk-schema@0.38.4
201
+ - @plitzi/sdk-shared@0.38.4
202
+ - @plitzi/sdk-style@0.38.4
203
+ - @plitzi/plitzi-sdk@0.38.4
204
+ - @plitzi/sdk-server@0.38.4
205
+
206
+ ## 0.38.3
207
+
208
+ ### Patch Changes
209
+
210
+ - e047e1d: ## `plitzi upgrade`: a project brought up to its CLI
211
+
212
+ A project written by an older CLI had no way up but `plitzi create` in a scratch folder and a file-by-file comparison:
213
+ `skills update` brought the skills and nothing else, so the `check` and `shot` scripts they teach did not exist.
214
+ `plitzi upgrade` (also `update`) shows what this CLI writes today for what is the CLI's in the project, and `--write`
215
+ makes it. One part or several: `plitzi upgrade skills`, `plitzi upgrade files packages`.
216
+
217
+ - **`files`:** the CLI's machinery — `author.ts`, `main.ts`, the Playwright, TypeScript and lint configs, AGENTS.md. One
218
+ nobody changed since the CLI wrote it is replaced, a missing one added; one the project made its own is shown as a
219
+ diff and left, until `--take <file>` (or `all`). `plitzi create` now records what it wrote, by digest, in
220
+ `.plitzi/scaffold.json`; a project made before that sees every file that differs as its own.
221
+ - **`packages`:** `package.json` merged, never replaced — the scripts and dependencies it lacks added, `@plitzi/*`
222
+ raised to this version, then the install (`--no-install` to leave it). A script of the project's own stays.
223
+ - **`skills`:** `.claude/skills/plitzi-*` from the packages installed, each replaced whole, and the ones a newer CLI
224
+ writes added. `plitzi skills update` is `plitzi upgrade skills --write`.
225
+ - **`renames`:** a name a version renamed with no alias, at its file and line — `canTemplate` → `canSnippet`,
226
+ `authorTemplate` → `authorSnippet` and its kin (renamed only where imported from `@plitzi/sdk-authoring`) — renamed
227
+ with `--write`.
228
+
229
+ `npm run author` says when the skills or the CLI's files are older than the SDK installed, and `plitzi --version`
230
+ prints the CLI's.
231
+
232
+ ## Page checks that can be the definition of done
233
+
234
+ `inspectPage`, `plitzi check` and the scaffold's visual test failed pages that were whole, so an agent learnt to ignore
235
+ them:
236
+
237
+ - **A breakpoint hiding an element on purpose** — the desktop navigation on a phone, a bottom bar only a phone shows —
238
+ is no longer "not visible": an element whose `display` or `visibility` a breakpoint rule sets is checked at the width
239
+ it shows at.
240
+ - **A lazy image out of sight** waits whichever side it is out of: below the fold, as before, or beside the screen in a
241
+ carousel's track — cut off by any ancestor that clips, as the browser decides when to fetch it.
242
+ - **A plugin that draws nothing** says so: `drawsNothing: true` in its declaration (a clock that fires a flow), and its
243
+ handle is `boxless`, so no check waits for it on screen.
244
+
245
+ `plitzi check --json` and `PageReport` carry `issues` beside `problems`: each with its `code` (`element-hidden`,
246
+ `image-not-loaded`, `sideways-scroll`…), the `elementId` it is about and, in `check`, the `width`.
247
+
248
+ ## Authoring
249
+ - **A link's `content` names it.** `control-without-name` read only a link's `label`, so applying the
250
+ `content-attribute` suggestion as written turned every link into a warning.
251
+ - **`plitzi fix` writes `content-attribute`** where it has one reading: a button's or link's children that are only
252
+ `text(…)` and `fontAwesome({ icon })` become its own `content` and `icon` — the words kept as written, an import left
253
+ unused taken out. A child with an id, options or a class of the space's own stays, and is said. `npm run author`'s
254
+ `[fix]` line counts these too.
255
+ - **The recipes, the skill's examples and the catalog template** hold to the suggestions as well as the warnings, and
256
+ their tests say so: six recipes and the template wrote a link's or a button's words as a child.
257
+
258
+ ## Declared motion — in code, in the builder and over MCP
259
+
260
+ An element says how it arrives and whether it keeps moving with `motion`, and the SDK's stylesheet plays it — no
261
+ keyframes to write: `{ enter: 'fade-up', on: 'view' }` arrives as it scrolls into view, `{ enter: 'scale', stagger:
262
+ 60 }` brings its children one by one (a grid, a list's rows), `{ loop: 'float' }` keeps it moving. Enters: `fade`,
263
+ `fade-up`, `fade-down`, `slide-left`, `slide-right`, `scale`; loops: `float`, `pulse`, `spin`, `sway`; `duration`,
264
+ `delay`, `stagger` in ms. Opacity and the transforms only — an arrival on `translate`/`scale`, so it composes with an
265
+ element's own `transform` — a loop held until the page is live (`data-hydrated`), and none of it for a visitor who asked
266
+ for less motion. `view` follows the scroll where the browser has scroll timelines and plays on load where not.
267
+
268
+ - **Authoring:** `motion` on any factory; refused where it cannot play (`motion-invalid`, `motion-no-tag`), and carried
269
+ by `specFromSpace` and `compareSpaces`.
270
+ - **Builder:** a **Motion** tab in an element's tools: the presets as chips, a stage that plays the one pointed at (a
271
+ loop shown stronger than the page plays it, and saying so), when and how long, children one by one, and the choices
272
+ read back as a sentence — laid out side by side once the sidebar is wide enough. The canvas holds motion still while
273
+ editing; **▶** in the header (or **Play on the canvas** in the tab) plays it from the start, restarting what already
274
+ played, and an arrival tied to the scroll plays by the clock there, where it is usually in view already.
275
+ - **MCP:** `motion` on `upsertElement` and `patchElement`, checked the same way; the guide names the presets.
276
+ - **Schema:** `definition.motion` (`ElementMotion`, `@plitzi/sdk-shared/schema/motion` — the presets, `motionProblems`,
277
+ `motionAttributes`, `isMotionAnimation`, and each preset's frames, which the stylesheet is tested against), in both
278
+ init queries. **The platform's GraphQL schema has to declare `SpaceElementMotion`
279
+ before this version's builder or SDK queries it.**
280
+
281
+ ## Dev tools QA: x-ray and motion
282
+
283
+ The **QA** tab gains an **X-ray**: every element the document wires something to — bound to data, shown on a condition,
284
+ running a flow, moving, behind a flag — outlined in its colour and named on the page, read from the space's document by
285
+ the element's name; its legend counts each kind on the page and picks one to show alone. Beside **Pause**, **Slow**
286
+ plays every animation at a quarter of its speed and **Replay** plays the declared motion again from the start, without
287
+ reloading the page.
288
+
289
+ ## Plugins that draw
290
+
291
+ `useCanvas2d`, `useWebGL`, `useWebGL2` and `useAnimationFrame` (`@plitzi/plitzi-sdk`): a canvas sized to the device (at
292
+ most 2×), followed as it resizes, animating only while somebody can see it move — a live page, no reduced motion, the
293
+ tab in front, the canvas on screen — and one still frame otherwise (the builder included). `createShaderProgram`
294
+ compiles and links, and a shader that fails throws a `ShaderError` with the driver's log, printed as
295
+ `[plugin <type> "<id>"] fragment shader failed: …` instead of an empty canvas; `error` and `ready` say where it is.
296
+ `useReducedMotion` for the rest.
297
+
298
+ ## A space re-authored without a restart
299
+
300
+ A project's `npm run start:dev` restarts for its server code and its plugins only: a save to the space is re-authored
301
+ in a process of its own and every open page loads again (`server.reloadPages()` over an SSE endpoint, on with
302
+ `createServer({ devReload: true })` — never by `devMode` alone, since every open page holds a connection for it); an
303
+ edit authoring refuses is printed and the page keeps the last space that authored. A shutdown also ends WebSockets at
304
+ once (`1001`, going away) rather than waiting out the grace — the ten seconds a restart used to wait on an open page.
305
+
306
+ ## Checks and authoring, from the stripe.com experiment
307
+ - **A component's instance** is found by its own name: its root carries `data-plitzi-instance`, and the instance's
308
+ handle selects it — `inspectPage` no longer reports every named instance as missing.
309
+ - **Hidden at this width on purpose** — the burger on a desktop, the desktop menu on a phone — is listed apart
310
+ (`hiddenAtWidth`, and a dim line under `plitzi check`'s ✓) rather than as a problem.
311
+ - **An element whose every child is conditional** — four flyouts in one list, each opening on the state that names
312
+ it — is conditional too: at rest it shows nothing, and that is it working.
313
+ - **A carousel that scrolls by itself** (`overflow-x: auto`) is not the page scrolling sideways; the page's own pane
314
+ still is.
315
+ - **Templates:** `{{ state.faq ?? -1 }}` — a sign on the right of `??` — reads.
316
+ - **A plugin attribute named as an element field** (`variant`, `class`, `id`…) is warned about
317
+ (`plugin-attribute-reserved`): a factory never hands it to the plugin. A `variant` no class or type style declares is
318
+ `unknown-variant`.
319
+ - **Lists:** a list with `items` renders as the `<ul>` (or `<ol>`) its `subType` says — it was a `<div>` — with no
320
+ markers and the same spacing, so a page looks as it did; the builder offers the list type for it too. Its rows are
321
+ `<li>`s: `list-row-not-li` warns of one that is not — a plain container is made one by `fixSpace`, a link or a button
322
+ is wrapped — and the recipes, the catalog template and the docs write rows as `listItem`.
323
+ - **CSS:** `mask-size`, `mask-position`, `mask-repeat`, `mask-composite`, `-webkit-mask-image`,
324
+ `-webkit-background-clip`, `box-decoration-break` and `-webkit-box-decoration-break`.
325
+ - **`plitzi shot`:** `--clip <element>`, `--scroll-to <element>` and `--viewport`; `--frames` takes the same framing.
326
+ - **SVG from files:** `svgFile` and `svgFiles` (`@plitzi/sdk-authoring/node`) read a logo or a folder of them,
327
+ compacted (`compactSvg`, also on the main entry), instead of strings in the space's source.
328
+ - The plugin scaffolds say that an inline `style` on `RootElement` outranks the element's classes.
329
+
330
+ - Updated dependencies [e047e1d]
331
+ - @plitzi/sdk-authoring@0.38.3
332
+ - @plitzi/sdk-elements@0.38.3
333
+ - @plitzi/sdk-interactions@0.38.3
334
+ - @plitzi/sdk-schema@0.38.3
335
+ - @plitzi/sdk-shared@0.38.3
336
+ - @plitzi/sdk-style@0.38.3
337
+ - @plitzi/plitzi-sdk@0.38.3
338
+ - @plitzi/sdk-server@0.38.3
339
+
3
340
  ## 0.38.2
4
341
 
5
342
  ### Patch Changes
@@ -1,4 +1,4 @@
1
- import { BUILTIN_TRANSFORMERS, GLOBAL_SOURCES } from "@plitzi/sdk-authoring";
1
+ import { BUILTIN_TRANSFORMERS, GLOBAL_SOURCES, MOTION_ENTERS, MOTION_LOOPS } from "@plitzi/sdk-authoring";
2
2
  //#region src/modules/mcp/helpers/guide.ts
3
3
  var GLOBALS = GLOBAL_SOURCES.map((source) => `\`${source}\``).join(", ");
4
4
  var OTHER_TRANSFORMERS = Object.keys(BUILTIN_TRANSFORMERS).filter((action) => action !== "twigTemplate").map((action) => `\`${action}\``).join(", ");
@@ -88,6 +88,12 @@ button/link needs words (an icon-only button a \`title\`), every field a \`label
88
88
  image an \`alt\` or \`decorative: true\`; clicks go on a \`button\`/\`link\`, never a container; headings step down one
89
89
  level at a time. \`plitzi_screenshot view:"accessibility"\` shows the tree and what has no name.
90
90
 
91
+ **Everything the space holds is public.** Its pages, variables, attributes, flow params and mock data ship to every
92
+ visitor's browser, and a file on a public bucket of its CDN is served to anyone who has its address. A key, a token or
93
+ data only some visitors may read never goes in any of them: a secret is a credential the owner attaches (a connector, an
94
+ action or a function names it, never carries it), and data for some visitors only comes from a \`runtime: "server"\`
95
+ provider or an action that checks who is asking.
96
+
91
97
  **Touched elements must be malformation-free.** Editing an element also checks its CURRENT stored content and BLOCKS
92
98
  the save on any \`Pre-existing malformation in element …\` error (a broken transformer, a malformed step, an attribute
93
99
  it never reads) — even parts you did not touch. These are NOT from your change (the message says so); fix them in the
@@ -234,7 +240,8 @@ space already had is not repeated on every batch — and none of them blocks any
234
240
  page being shown: the \`current\` state marks it (see *Pages & folders*).
235
241
  - \`repeated-shape\` — one structure written again with other words: a **component** with props
236
242
  (\`upsertComponent { fromRef }\` turns one copy into it), or, for sibling rows of data, one \`repeatElement\`/\`list\`.
237
- A few cards a person rewords by hand can stay cards.
243
+ A few cards a person rewords by hand can stay cards; siblings that read different data or keep different state are
244
+ controls written alike, and are not offered.
238
245
  - \`content-attribute\` — a \`button\` or \`link\` whose children are only a \`text\` and/or a \`fontAwesome\`: its words
239
246
  are its own \`content\` and the icon its \`icon\`. What the text's class adds (\`white-space: nowrap\`) moves to the
240
247
  box's class — never the class itself; the icon's class goes in the \`icon\` slot.
@@ -242,7 +249,9 @@ space already had is not repeated on every batch — and none of them blocks any
242
249
  \`states\`/\`ancestors\`, the SDK (reduced motion, the theme toggle's icons) or the space's notification look says.
243
250
  - \`heavy-animation\` — keyframes that animate a size, a position, a blur, a shadow, or a colour in a loop: they stutter
244
251
  while the page loads. Lighter, not shorter — see **Motion — good practices**.
245
- \`plitzi://explain/<code>\` explains each. Take one unless the copies are about to diverge.
252
+ \`plitzi://explain/<code>\` explains each. Take one unless the copies are about to diverge; one left on purpose is
253
+ quieted on an element it names — \`quiet: ["repeated-shape"]\` on \`upsertElement\`/\`patchElement\` (\`null\` removes it)
254
+ — and is not offered again, here, in the builder or in authoring. Suggestions' codes only.
246
255
 
247
256
  ## Readers: resources vs plitzi_search vs plitzi_read (do not confuse them)
248
257
  Three ways to read, each for a different moment — pick by what you have in hand:
@@ -269,7 +278,7 @@ runtime wires by it — there is no second key and nothing to translate. Creatin
269
278
  That name is the **wiring key**: a provider registers its data source as \`<type>_<name>\`, so a \`source\` you write
270
279
  against a name resolves to that element at runtime. Rules for a **new** name (both enforced; a violation fails the
271
280
  batch):
272
- - Charset \`[A-Za-z0-9_-]\`, **starting with a letter** (e.g. \`"products-api"\`, \`"food_item"\`). A \`.\` would split
281
+ - Charset \`[A-Za-z0-9_-]\`, **starting with a letter** and not ending in \`-\` (e.g. \`"products-api"\`, \`"food_item"\`). A \`.\` would split
273
282
  the \`<type>_<name>.<field>\` source path and the interaction target lookup, so **no dots**. An **underscore is
274
283
  allowed**: the FIRST \`_\` separates \`<type>\` from the name and element types are camelCase with none, so
275
284
  underscores inside a name are unambiguous (\`list_food_item\` → type \`list\`, name \`food_item\`).
@@ -281,7 +290,8 @@ batch):
281
290
  **Where an element renders** is its \`runtime\`, settable on \`upsertElement\`/\`patchElement\`: \`"shared"\` (the
282
291
  default, both sides), \`"client"\` (browser only) or \`"server"\` (SSR only). It matters for one thing above all — an
283
292
  \`apiContainer\` reads through a **connector** only when it is \`"server"\` (see *Connectors*). An element read
284
- reports it only when it is set.
293
+ reports it only when it is set. The page server resolves \`"server"\` elements of a page and its layouts only, never
294
+ inside a component — one there is refused; put the provider on the page and hand the component its rows as a prop.
285
295
 
286
296
  **Renaming** (\`patchElement\` with \`rename\`) moves the one key: the parent's child list, every binding source and
287
297
  every interaction target across the space that named the old one is repointed with it, so nothing comes unwired.
@@ -412,7 +422,9 @@ provider's records into a list element:
412
422
  **What an \`apiContainer\` publishes** depends on where it reads. Through a connector (\`runtime: "server"\`) it is the
413
423
  fixed shape under *Connectors* — \`.records\` or \`.record\`, \`.pageInfo\`, … With a browser \`query\` it is the
414
424
  response: \`.data\` (the parsed body — an API answering \`{ "items": [...] }\` is read as
415
- \`apiContainer_<name>.data.items\`) and \`.status\` (the HTTP status). Both add \`.isLoading\`, \`.isEmpty\`,
425
+ \`apiContainer_<name>.data.items\`) and \`.status\` (the HTTP status) — and a \`"server"\` provider with only a
426
+ \`query\` (a JSON file the deployment serves) answers in that same shape, so moving it to the server changes no
427
+ binding. Both add \`.isLoading\`, \`.isEmpty\`,
416
428
  \`.hasError\` and \`.errorMessage\`.
417
429
 
418
430
  **Source scope — a source is visible to the provider's DESCENDANTS only.** An element source named
@@ -435,7 +447,7 @@ the API needs a token or the content should be in the HTML), or a browser-side \
435
447
  \`{ action, params }\`; the runtime runs them in order and resolves each by its \`action\` alone, so an **unknown
436
448
  action is silently skipped** and the raw value passes through. Use the **exact** action names from
437
449
  \`plitzi://data-sources\` (\`transformers\`). The most common is **\`twigTemplate\`** to format a value — the incoming
438
- value is the **\`{{source}}\`** token (NOT \`{{value}}\`); \`{{sourceTo}}\` is the field's previous value. Example —
450
+ value is the **\`{{source}}\`** token (NOT \`{{value}}\`) — undefined until the source has a value, so \`{{ source|default('…') }}\` covers the wait; \`{{sourceTo}}\` is the field's previous value. Example —
439
451
  show a number with units:
440
452
  \`{ "type": "upsertBinding", "pageRef": "home", "ref": "food-item-time", "category": "attributes",
441
453
  "binding": { "to": "content", "source": "list_food-list.item.cookTimeMinutes",
@@ -538,6 +550,20 @@ Discover valid actions in \`plitzi://interactions/{env}\`: \`actions\` = observe
538
550
  node type and valid params per action. An element read lists its flows as ordered nodes (each with its \`id\` and
539
551
  \`enabled\`), so a follow-up patch/delete needs no extra read.
540
552
 
553
+ ## What is public — and where a secret goes
554
+ A space is served to anyone who opens it, and everything it is made of goes with it:
555
+
556
+ - **The documents.** Every page, layout and component, every schema and style variable, every attribute, binding,
557
+ flow param and \`mockData\` reaches the visitor's browser with the page. Hiding an element (\`visible: false\`, a
558
+ flag, a condition) does not remove it from what is sent.
559
+ - **The files.** A file on one of the space's public buckets is on the internet at its address, signed in or not —
560
+ for pictures, fonts and data every visitor may see.
561
+
562
+ So a secret — an API key, a token, a password — never goes in a document or a public file. It is a **credential**,
563
+ created by the space owner in the builder, which a connector, an action or a function **names** and never carries.
564
+ Data only some visitors may read comes from a \`runtime: "server"\` provider or a server action whose \`access\` checks
565
+ who is asking — never from a public file or a document the page filters on the client.
566
+
541
567
  ## Connectors — CMS and API integrations
542
568
  A **connector** is how a space reads real content from Strapi, WordPress, Contentful, Directus or any REST service.
543
569
  It is **a manifest, not code**: you declare the base URL, the endpoints, the auth template and the filter operators,
@@ -616,7 +642,9 @@ reads \`list_<name>.item.values.<field>\`), \`.pageInfo\` (\`page\`, \`pageCount
616
642
  instead of \`.records\` — that is what a **detail page** uses. Bind an empty-state block's visibility to \`.isEmpty\`
617
643
  and an error block's to \`.hasError\`; they are ordinary bindings, no special mechanism.
618
644
 
619
- **A list page** — provider, then a \`list\` inside it bound to the records, then the row template reading the item:
645
+ **A list page** — provider, then a \`list\` inside it bound to the records, then the row template reading the item
646
+ (a \`list\` is a \`<ul>\`, or \`<ol>\` by \`subType\`; its row a \`listItem\`, an \`<li>\` — any other row is warned
647
+ \`list-row-not-li\`):
620
648
  \`\`\`json
621
649
  { "operations": [
622
650
  { "type": "upsertElement", "pageRef": "blog", "element": {
@@ -922,7 +950,13 @@ Space-level configuration lives in \`plitzi://settings/{env}\` and is edited wit
922
950
  \`{ "type": "patchSettings", "customCss": "@keyframes spin { to { transform: rotate(360deg); } }" }\`.
923
951
 
924
952
  ## Motion — good practices
925
- Keyframes go in \`customCss\` (\`patchSettings\`), a definition names them (\`animation\`). Only \`opacity\` and
953
+ A preset first: an element's \`motion\` field (\`upsertElement\`/\`patchElement\`) —
954
+ \`{ "enter": "fade-up", "on": "view" }\`, \`"stagger": 60\` for its children one by one, \`"loop": "float"\` — is
955
+ played by the SDK, cheap and stilled for reduced motion. \`on\`: \`load\` (default), \`view\` (once, the first time it
956
+ comes into view, then it stays) or \`scroll\` (follows the scroll both ways — it fades back out as the reader scrolls
957
+ up past it; only for an effect that is about the scroll itself). Enters: ${MOTION_ENTERS.join(", ")}; loops:
958
+ ${MOTION_LOOPS.join(", ")}. Beyond them, keyframes go in \`customCss\` (\`patchSettings\`), a
959
+ definition names them (\`animation\`). Only \`opacity\` and
926
960
  \`transform\` (\`translate\`, \`scale\`, \`rotate\`) animate off the main thread: they stay smooth while the page
927
961
  hydrates and on a slow phone. Anything else repaints or lays the page out again on every frame, and freezes while the
928
962
  page's scripts run.
@@ -934,7 +968,8 @@ page's scripts run.
934
968
  pulsing glow is a static gradient whose \`opacity\` or \`scale\` changes.
935
969
  - Decoration that must animate something else (a custom property, \`background-position\`) starts paused and runs
936
970
  once the page is hydrated: \`.glow { animation: glow 8s linear infinite paused; } [data-hydrated] .glow {
937
- animation-play-state: running; }\` in \`customCss\`.
971
+ animation-play-state: running; }\` in \`customCss\`. That is for loops: an entrance of its own that plays once
972
+ (\`transform\`/\`opacity\` only) plays from the first paint with \`backwards\`, never gated on \`[data-hydrated]\`.
938
973
  - Entrances: \`opacity\` + a small \`translateY\`, under ~600ms, staggered by tens of ms.
939
974
  - One slow ambient loop per screen at most — not one per card: \`infinite\` runs on every visitor's battery.
940
975
  - Name what transitions (\`transition: transform 200ms, opacity 200ms\`), never \`all\`; \`will-change\` only on the
@@ -956,7 +991,9 @@ tree names nothing is invisible to both, however it looks. So build every page t
956
991
  no agent finds them. An empty backdrop that closes a panel is the exception (the panel's close button and Escape
957
992
  are the ways everyone has).
958
993
  - **State is said, not only styled.** A toggle sets \`ariaPressed\`, a button that opens a panel \`ariaExpanded\`
959
- (bind them like any attribute) — an "active" class alone is invisible to both readers.
994
+ (bind them like any attribute) — an "active" class alone is invisible to both readers. A button that shows and
995
+ hides a panel names it in \`controls\` (\`aria-controls\`, the panel's anchor), and words that change while a
996
+ visitor reads them — a count, a total, a status — sit in a \`container\` with \`live: "polite"\` (\`aria-live\`).
960
997
  - **A dropdown opens from a \`button\`** among its children, outside the popup (an avatar, a "⋯": the button holds it and
961
998
  has a \`title\`). The dropdown marks it and moves the focus in and out; a box or an icon alone opens nothing from a
962
999
  keyboard.
@@ -37,6 +37,9 @@ type Page = {
37
37
  value: string;
38
38
  }[]) => Promise<void>;
39
39
  evaluate: <T>(fn: () => T) => Promise<T>;
40
+ addStyleTag: (options: {
41
+ content: string;
42
+ }) => Promise<unknown>;
40
43
  screenshot: (options: Record<string, unknown>) => Promise<Buffer | Uint8Array>;
41
44
  /** Playwright's: the page's accessibility tree, already written as an outline. */
42
45
  locator?: (selector: string) => {
@@ -1,5 +1,6 @@
1
1
  import { outlineOfSnapshot, outlineOfTree } from "./accessibilityOutline.js";
2
2
  import { PREVIEW_TOKEN_PARAM } from "@plitzi/sdk-server/kernel";
3
+ import { MOTION_STILL_CSS } from "@plitzi/sdk-shared/schema/motion";
3
4
  //#region src/modules/mcp/localScreenshotClient.ts
4
5
  /**
5
6
  * Grow the window to whatever actually scrolls before shooting.
@@ -90,6 +91,7 @@ var createLocalScreenshotClient = async ({ renderBaseUrl, ignoreHttpsErrors = tr
90
91
  message: `The page answered ${response.status()}.`
91
92
  };
92
93
  await page.evaluate(FONTS_READY);
94
+ await page.addStyleTag({ content: MOTION_STILL_CSS });
93
95
  if (fullPage) {
94
96
  const height = Math.min(await page.evaluate(CONTENT_HEIGHT), MAX_HEIGHT);
95
97
  if (height > viewport.height) await setViewport(page, {
@@ -11,7 +11,7 @@ var explainResource = (uri) => {
11
11
  names: explainList(kind)
12
12
  };
13
13
  const explanations = explain(name);
14
- if (explanations.length === 0) throw new Error(`"${name}" is no element, step, trigger, code or transformer. List what there is: ${Object.values(EXPLAIN_KINDS).map((plural) => `${PREFIX}${plural}`).join(", ")}.`);
14
+ if (explanations.length === 0) throw new Error(`"${name}" is no element, step, trigger, code, transformer or helper. List what there is: ${Object.values(EXPLAIN_KINDS).map((plural) => `${PREFIX}${plural}`).join(", ")}.`);
15
15
  return {
16
16
  name,
17
17
  explanations,
@@ -69,7 +69,7 @@ var createMcpServer = async ({ adapters, getGrant, preview, screenshot, logger,
69
69
  const getSpace = () => spacePromise ??= loadSpace();
70
70
  const server = new McpServer({
71
71
  name: "plitzi-mcp",
72
- version: "0.38.2"
72
+ version: "0.38.4"
73
73
  }, { instructions: hasSpace ? serverInstructions : widgetsOnlyInstructions });
74
74
  const { getChanges } = adapters;
75
75
  registerResources(server, getSpace, MCP_ENV, log, hasSpace, getChanges ? (query) => getChanges(requireSpaceId(), MCP_ENV, query) : void 0);
@@ -56,6 +56,8 @@ export declare const applyShape: {
56
56
  }>>;
57
57
  flag: z.ZodOptional<z.ZodNullable<z.ZodString>>;
58
58
  anchor: z.ZodOptional<z.ZodNullable<z.ZodString>>;
59
+ motion: z.ZodOptional<z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodUnknown>>>;
60
+ quiet: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodString>>>;
59
61
  }, z.core.$strip>, z.ZodObject<{
60
62
  type: z.ZodLiteral<"deleteElement">;
61
63
  pageRef: z.ZodString;
@@ -52,6 +52,8 @@ export declare const documentOperation: z.ZodDiscriminatedUnion<readonly [z.ZodO
52
52
  }>>;
53
53
  flag: z.ZodOptional<z.ZodNullable<z.ZodString>>;
54
54
  anchor: z.ZodOptional<z.ZodNullable<z.ZodString>>;
55
+ motion: z.ZodOptional<z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodUnknown>>>;
56
+ quiet: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodString>>>;
55
57
  }, z.core.$strip>, z.ZodObject<{
56
58
  type: z.ZodLiteral<"deleteElement">;
57
59
  pageRef: z.ZodString;
@@ -836,6 +838,8 @@ export declare const operation: z.ZodDiscriminatedUnion<[z.ZodObject<{
836
838
  }>>;
837
839
  flag: z.ZodOptional<z.ZodNullable<z.ZodString>>;
838
840
  anchor: z.ZodOptional<z.ZodNullable<z.ZodString>>;
841
+ motion: z.ZodOptional<z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodUnknown>>>;
842
+ quiet: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodString>>>;
839
843
  }, z.core.$strip>, z.ZodObject<{
840
844
  type: z.ZodLiteral<"deleteElement">;
841
845
  pageRef: z.ZodString;
@@ -1892,6 +1896,8 @@ export declare const operations: z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject
1892
1896
  }>>;
1893
1897
  flag: z.ZodOptional<z.ZodNullable<z.ZodString>>;
1894
1898
  anchor: z.ZodOptional<z.ZodNullable<z.ZodString>>;
1899
+ motion: z.ZodOptional<z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodUnknown>>>;
1900
+ quiet: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodString>>>;
1895
1901
  }, z.core.$strip>, z.ZodObject<{
1896
1902
  type: z.ZodLiteral<"deleteElement">;
1897
1903
  pageRef: z.ZodString;
@@ -2943,6 +2949,8 @@ export declare const documentOperations: z.ZodArray<z.ZodDiscriminatedUnion<read
2943
2949
  }>>;
2944
2950
  flag: z.ZodOptional<z.ZodNullable<z.ZodString>>;
2945
2951
  anchor: z.ZodOptional<z.ZodNullable<z.ZodString>>;
2952
+ motion: z.ZodOptional<z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodUnknown>>>;
2953
+ quiet: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodString>>>;
2946
2954
  }, z.core.$strip>, z.ZodObject<{
2947
2955
  type: z.ZodLiteral<"deleteElement">;
2948
2956
  pageRef: z.ZodString;
@@ -24,6 +24,8 @@ export declare const patchElementOp: z.ZodObject<{
24
24
  }>>;
25
25
  flag: z.ZodOptional<z.ZodNullable<z.ZodString>>;
26
26
  anchor: z.ZodOptional<z.ZodNullable<z.ZodString>>;
27
+ motion: z.ZodOptional<z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodUnknown>>>;
28
+ quiet: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodString>>>;
27
29
  }, z.core.$strip>;
28
30
  export type PatchElement = z.infer<typeof patchElementOp>;
29
31
  export declare const patchElement: (space: Space, env: Env, op: PatchElement) => OpResult;
@@ -1,10 +1,11 @@
1
1
  import { findRootByRef, invalidateIndex, resolveRef } from "../../../../helpers/space.js";
2
2
  import { pageUri } from "../../../../helpers/uris.js";
3
3
  import { empty, fail } from "../../../../helpers/opResult.js";
4
- import { elementAnchor, elementFlag, elementRuntime, initialStateInput, styleRefs } from "../shared.js";
4
+ import { elementAnchor, elementFlag, elementMotion, elementQuiet, elementRuntime, initialStateInput, styleRefs } from "../shared.js";
5
5
  import { guardNewRef, writeInitialState } from "../write.js";
6
6
  import { flagGateOf } from "@plitzi/sdk-authoring";
7
7
  import { z } from "zod";
8
+ import { isMotion } from "@plitzi/sdk-shared/schema/motion";
8
9
  import { repointIds } from "@plitzi/sdk-schema/helpers/elementId";
9
10
  //#region src/modules/mcp/tools/operations/schema/elements/patchElement.ts
10
11
  var patchElementOp = z.object({
@@ -19,7 +20,9 @@ var patchElementOp = z.object({
19
20
  initialState: initialStateInput.optional().describe("Merged onto existing initialState: styleVariant overlays per class/selector, visibility overrides"),
20
21
  runtime: elementRuntime.optional(),
21
22
  flag: elementFlag.nullable().optional(),
22
- anchor: elementAnchor.nullable().optional().describe("null removes it")
23
+ anchor: elementAnchor.nullable().optional().describe("null removes it"),
24
+ motion: elementMotion.nullable().optional().describe("null removes it"),
25
+ quiet: elementQuiet.nullable().optional()
23
26
  }).describe("Partially update an EXISTING element: only the fields you pass change (props/style/initialState are merged, not replaced). Never creates — fails if ref does not resolve. Use upsertElement to create or fully replace.");
24
27
  var patchElement = (space, env, op) => {
25
28
  const page = findRootByRef(space.schema, op.pageRef);
@@ -55,6 +58,10 @@ var patchElement = (space, env, op) => {
55
58
  else if (op.flag !== void 0) el.definition.flag = flagGateOf(op.flag, `Element "${op.ref}"`);
56
59
  if (op.anchor === null) Reflect.deleteProperty(el.definition, "anchor");
57
60
  else if (op.anchor !== void 0) el.definition.anchor = op.anchor;
61
+ if (op.motion === null) Reflect.deleteProperty(el.definition, "motion");
62
+ else if (isMotion(op.motion)) el.definition.motion = op.motion;
63
+ if (op.quiet === null) Reflect.deleteProperty(el.definition, "quiet");
64
+ else if (op.quiet !== void 0) el.definition.quiet = op.quiet;
58
65
  return {
59
66
  ...empty(),
60
67
  updated: 1,
@@ -5,6 +5,7 @@ import { elementInput, position } from "../shared.js";
5
5
  import { DROP_POSITION, collectInputRefs, createElement, guardNewRef, writeInitialState } from "../write.js";
6
6
  import { flagGateOf } from "@plitzi/sdk-authoring";
7
7
  import { z } from "zod";
8
+ import { isMotion } from "@plitzi/sdk-shared/schema/motion";
8
9
  //#region src/modules/mcp/tools/operations/schema/elements/upsertElement.ts
9
10
  var upsertElementOp = z.object({
10
11
  type: z.literal("upsertElement"),
@@ -35,6 +36,8 @@ var upsertElement = (space, env, op) => {
35
36
  if (op.element.runtime !== void 0) existing.definition.runtime = op.element.runtime;
36
37
  if (op.element.flag !== void 0) existing.definition.flag = flagGateOf(op.element.flag, `Element "${op.element.ref}"`);
37
38
  if (op.element.anchor !== void 0) existing.definition.anchor = op.element.anchor;
39
+ if (isMotion(op.element.motion)) existing.definition.motion = op.element.motion;
40
+ if (op.element.quiet !== void 0) existing.definition.quiet = op.element.quiet;
38
41
  return {
39
42
  ...empty(),
40
43
  updated: 1,
@@ -52,6 +52,8 @@ export declare const elementOps: {
52
52
  }>>;
53
53
  flag: import('zod').ZodOptional<import('zod').ZodNullable<import('zod').ZodString>>;
54
54
  anchor: import('zod').ZodOptional<import('zod').ZodNullable<import('zod').ZodString>>;
55
+ motion: import('zod').ZodOptional<import('zod').ZodNullable<import('zod').ZodRecord<import('zod').ZodString, import('zod').ZodUnknown>>>;
56
+ quiet: import('zod').ZodOptional<import('zod').ZodNullable<import('zod').ZodArray<import('zod').ZodString>>>;
55
57
  }, import('zod/v4/core').$strip>;
56
58
  deleteElement: import('zod').ZodObject<{
57
59
  type: import('zod').ZodLiteral<"deleteElement">;
@@ -20,6 +20,9 @@ export interface ElementInput {
20
20
  runtime?: ElementRuntime;
21
21
  flag?: string;
22
22
  anchor?: string;
23
+ /** Checked by `motionProblems`: what arrives here is one, which `isMotion` narrows it to where it is written. */
24
+ motion?: Record<string, unknown>;
25
+ quiet?: string[];
23
26
  children?: ElementInput[];
24
27
  }
25
28
  export declare const styleRefs: z.ZodObject<{
@@ -39,6 +42,16 @@ export declare const elementRuntime: z.ZodEnum<{
39
42
  export declare const elementFlag: z.ZodString;
40
43
  /** The element's `id` in the DOM, so `/page#anchor` lands on it — the one pattern every writer holds it to. */
41
44
  export declare const elementAnchor: z.ZodString;
45
+ /**
46
+ * How an element arrives and whether it keeps moving — the presets the SDK's stylesheet plays, and nothing else.
47
+ *
48
+ * An open object, checked by `motionProblems`, rather than its fields spelled out: this schema is in every tool that
49
+ * carries the op union, and spelled out it cost the listing more than its budget had room for. A wrong preset is
50
+ * refused with the list of right ones, and the guide's Motion section names them all.
51
+ */
52
+ export declare const elementMotion: z.ZodRecord<z.ZodString, z.ZodUnknown>;
53
+ /** Suggestions' codes an element is not offered, written that way on purpose; never a problem's code. */
54
+ export declare const elementQuiet: z.ZodArray<z.ZodString>;
42
55
  export declare const initialStateInput: z.ZodObject<{
43
56
  styleVariant: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodString>]>>>>;
44
57
  visibility: z.ZodOptional<z.ZodBoolean>;
@@ -64,6 +77,8 @@ export declare const elementShape: {
64
77
  }>>;
65
78
  flag: z.ZodOptional<z.ZodString>;
66
79
  anchor: z.ZodOptional<z.ZodString>;
80
+ motion: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
81
+ quiet: z.ZodOptional<z.ZodArray<z.ZodString>>;
67
82
  };
68
83
  export declare const elementInput: z.ZodType<ElementInput>;
69
84
  export declare const position: z.ZodEnum<{
@@ -1,6 +1,8 @@
1
+ import { isSuggestionCode } from "@plitzi/sdk-authoring";
1
2
  import { z } from "zod";
2
3
  import { FLAG_GATE_PATTERN } from "@plitzi/sdk-shared/flags";
3
4
  import { ANCHOR_PATTERN } from "@plitzi/sdk-shared/schema/anchor";
5
+ import { motionProblems } from "@plitzi/sdk-shared/schema/motion";
4
6
  //#region src/modules/mcp/tools/operations/schema/shared.ts
5
7
  var combinator = z.enum(["and", "or"]);
6
8
  var operator = z.enum([
@@ -70,6 +72,26 @@ var elementRuntime = z.enum([
70
72
  var elementFlag = z.string().regex(FLAG_GATE_PATTERN).describe("Feature flag: `name` renders only while on, `!name` only while off");
71
73
  /** The element's `id` in the DOM, so `/page#anchor` lands on it — the one pattern every writer holds it to. */
72
74
  var elementAnchor = z.string().regex(ANCHOR_PATTERN).describe("Its DOM id, for `/page#anchor` and the `hash` of a link; one per page");
75
+ /**
76
+ * How an element arrives and whether it keeps moving — the presets the SDK's stylesheet plays, and nothing else.
77
+ *
78
+ * An open object, checked by `motionProblems`, rather than its fields spelled out: this schema is in every tool that
79
+ * carries the op union, and spelled out it cost the listing more than its budget had room for. A wrong preset is
80
+ * refused with the list of right ones, and the guide's Motion section names them all.
81
+ */
82
+ var elementMotion = z.record(z.string(), z.unknown()).superRefine((motion, ctx) => {
83
+ for (const problem of motionProblems(motion)) ctx.addIssue({
84
+ code: "custom",
85
+ message: problem
86
+ });
87
+ }).describe("{enter,on,duration,delay,stagger,loop} — guide: Motion");
88
+ /** Suggestions' codes an element is not offered, written that way on purpose; never a problem's code. */
89
+ var elementQuiet = z.array(z.string()).superRefine((codes, ctx) => {
90
+ for (const code of codes.filter((code) => !isSuggestionCode(code))) ctx.addIssue({
91
+ code: "custom",
92
+ message: `"${code}" is no suggestion's code`
93
+ });
94
+ }).describe("Suggestion codes not offered on it, e.g. [\"repeated-shape\"]");
73
95
  var initialStateInput = z.object({
74
96
  styleVariant: styleVariantInput.optional().describe("Variant each attached class uses: { className: { base|slot: variantName | [names] } }"),
75
97
  visibility: z.boolean().optional().describe("Initial visibility of the element")
@@ -84,7 +106,9 @@ var elementShape = {
84
106
  initialState: initialStateInput.optional().describe("Applied style variant(s) and initial visibility (see plitzi://guide styling)"),
85
107
  runtime: elementRuntime.optional(),
86
108
  flag: elementFlag.optional(),
87
- anchor: elementAnchor.optional()
109
+ anchor: elementAnchor.optional(),
110
+ motion: elementMotion.optional(),
111
+ quiet: elementQuiet.optional()
88
112
  };
89
113
  var elementInput = z.lazy(() => z.object({
90
114
  ...elementShape,
@@ -141,4 +165,4 @@ var interactionNode = z.object({
141
165
  preview: z.record(z.string(), z.unknown()).optional()
142
166
  });
143
167
  //#endregion
144
- export { bindingCategory, bindingInput, elementAnchor, elementFlag, elementInput, elementRuntime, elementShape, initialStateInput, interactionNode, interactionNodeType, position, ruleGroup, scalar, styleRefs, styleVariantInput };
168
+ export { bindingCategory, bindingInput, elementAnchor, elementFlag, elementInput, elementMotion, elementQuiet, elementRuntime, elementShape, initialStateInput, interactionNode, interactionNodeType, position, ruleGroup, scalar, styleRefs, styleVariantInput };
@@ -3,6 +3,7 @@ import { folderUri, foldersUri, layoutsUri, pageUri, pagesUri, schemaVarsUri, se
3
3
  import { fail } from "../../../helpers/opResult.js";
4
4
  import { flagGateOf } from "@plitzi/sdk-authoring";
5
5
  import { documentIds } from "@plitzi/sdk-schema/helpers/components";
6
+ import { isMotion } from "@plitzi/sdk-shared/schema/motion";
6
7
  import { elementIdConflict, isValidElementId } from "@plitzi/sdk-schema/helpers/elementId";
7
8
  import FlatMap from "@plitzi/sdk-schema/helpers/FlatMap";
8
9
  //#region src/modules/mcp/tools/operations/schema/write.ts
@@ -67,7 +68,9 @@ var createElement = (space, page, input, anchorId, drop) => {
67
68
  styleSelectors,
68
69
  ...input.runtime === void 0 ? {} : { runtime: input.runtime },
69
70
  ...input.flag === void 0 ? {} : { flag: flagGateOf(input.flag, `Element "${input.ref}"`) },
70
- ...input.anchor === void 0 ? {} : { anchor: input.anchor }
71
+ ...input.anchor === void 0 ? {} : { anchor: input.anchor },
72
+ ...isMotion(input.motion) ? { motion: input.motion } : {},
73
+ ...input.quiet === void 0 ? {} : { quiet: input.quiet }
71
74
  }
72
75
  };
73
76
  if (!new FlatMap({ flat: space.schema.flat }).addElement(el, anchorId, drop)) return false;
@@ -1,6 +1,6 @@
1
1
  import { actionAccess, actionField, actionLimits, actionNode, actionTriggerParams } from "./actions/document.js";
2
2
  import { connectorConnection, readEndpoint, writeEndpoint } from "./connectors/manifest.js";
3
- import { bindingInput, elementAnchor, elementFlag, elementInput, initialStateInput, interactionNode, position, ruleGroup, styleRefs, styleVariantInput } from "./schema/shared.js";
3
+ import { bindingInput, elementAnchor, elementFlag, elementInput, elementMotion, elementQuiet, initialStateInput, interactionNode, position, ruleGroup, styleRefs, styleVariantInput } from "./schema/shared.js";
4
4
  import { ancestors, ancestorsPatch, cssMap, cssPatchMap, definitionSlot, definitionSlotPatch, displayModeCss, displayModeCssPatch, themeValue } from "./style/shared.js";
5
5
  import { z } from "zod";
6
6
  //#region src/modules/mcp/tools/operations/schemaIds.ts
@@ -25,6 +25,8 @@ var SHARED_SCHEMAS = [
25
25
  [elementInput, "Element"],
26
26
  [elementFlag, "ElementFlag"],
27
27
  [elementAnchor, "ElementAnchor"],
28
+ [elementMotion, "ElementMotion"],
29
+ [elementQuiet, "ElementQuiet"],
28
30
  [ruleGroup, "RuleGroup"],
29
31
  [styleRefs, "StyleRefs"],
30
32
  [initialStateInput, "InitialState"],
@@ -52,6 +52,8 @@ export declare const previewShape: {
52
52
  }>>;
53
53
  flag: z.ZodOptional<z.ZodNullable<z.ZodString>>;
54
54
  anchor: z.ZodOptional<z.ZodNullable<z.ZodString>>;
55
+ motion: z.ZodOptional<z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodUnknown>>>;
56
+ quiet: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodString>>>;
55
57
  }, z.core.$strip>, z.ZodObject<{
56
58
  type: z.ZodLiteral<"deleteElement">;
57
59
  pageRef: z.ZodString;
@@ -54,6 +54,8 @@ export declare const renderShape: {
54
54
  }>>;
55
55
  flag: z.ZodOptional<z.ZodNullable<z.ZodString>>;
56
56
  anchor: z.ZodOptional<z.ZodNullable<z.ZodString>>;
57
+ motion: z.ZodOptional<z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodUnknown>>>;
58
+ quiet: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodString>>>;
57
59
  }, z.core.$strip>, z.ZodObject<{
58
60
  type: z.ZodLiteral<"deleteElement">;
59
61
  pageRef: z.ZodString;
@@ -52,6 +52,8 @@ export declare const screenshotShape: {
52
52
  }>>;
53
53
  flag: z.ZodOptional<z.ZodNullable<z.ZodString>>;
54
54
  anchor: z.ZodOptional<z.ZodNullable<z.ZodString>>;
55
+ motion: z.ZodOptional<z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodUnknown>>>;
56
+ quiet: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodString>>>;
55
57
  }, z.core.$strip>, z.ZodObject<{
56
58
  type: z.ZodLiteral<"deleteElement">;
57
59
  pageRef: z.ZodString;
@@ -53,6 +53,8 @@ export declare const validateShape: {
53
53
  }>>;
54
54
  flag: import('zod').ZodOptional<import('zod').ZodNullable<import('zod').ZodString>>;
55
55
  anchor: import('zod').ZodOptional<import('zod').ZodNullable<import('zod').ZodString>>;
56
+ motion: import('zod').ZodOptional<import('zod').ZodNullable<import('zod').ZodRecord<import('zod').ZodString, import('zod').ZodUnknown>>>;
57
+ quiet: import('zod').ZodOptional<import('zod').ZodNullable<import('zod').ZodArray<import('zod').ZodString>>>;
56
58
  }, import('zod/v4/core').$strip>, import('zod').ZodObject<{
57
59
  type: import('zod').ZodLiteral<"deleteElement">;
58
60
  pageRef: import('zod').ZodString;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@plitzi/sdk-mcp",
3
- "version": "0.38.2",
3
+ "version": "0.38.4",
4
4
  "license": "AGPL-3.0",
5
5
  "files": [
6
6
  "dist",
@@ -30,14 +30,14 @@
30
30
  "dependencies": {
31
31
  "@modelcontextprotocol/ext-apps": "^1.7.5",
32
32
  "@modelcontextprotocol/sdk": "^1.32.0",
33
- "@plitzi/plitzi-sdk": "0.38.2",
34
- "@plitzi/sdk-authoring": "0.38.2",
35
- "@plitzi/sdk-elements": "0.38.2",
36
- "@plitzi/sdk-interactions": "0.38.2",
37
- "@plitzi/sdk-schema": "0.38.2",
38
- "@plitzi/sdk-server": "0.38.2",
39
- "@plitzi/sdk-shared": "0.38.2",
40
- "@plitzi/sdk-style": "0.38.2",
33
+ "@plitzi/plitzi-sdk": "0.38.4",
34
+ "@plitzi/sdk-authoring": "0.38.4",
35
+ "@plitzi/sdk-elements": "0.38.4",
36
+ "@plitzi/sdk-interactions": "0.38.4",
37
+ "@plitzi/sdk-schema": "0.38.4",
38
+ "@plitzi/sdk-server": "0.38.4",
39
+ "@plitzi/sdk-shared": "0.38.4",
40
+ "@plitzi/sdk-style": "0.38.4",
41
41
  "ejs": "^6.0.1",
42
42
  "esbuild": "^0.28.2",
43
43
  "zod": "^4.6.5"