@plitzi/sdk-schema 0.38.6 → 0.38.8

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,394 @@
1
1
  # @plitzi/sdk-schema
2
2
 
3
+ ## 0.38.8
4
+
5
+ ### Patch Changes
6
+
7
+ - 1b45aae: ## The CLI's commands are named after what they act on
8
+
9
+ Every command sits under the thing it acts on — `plitzi element move`, never a bare `move` that could mean anything —
10
+ and only what acts on the project as a whole or the account stays at the top:
11
+
12
+ | Before | Now |
13
+ | -------------------------------------------- | ------------------------------------------------------------------ |
14
+ | `where`, `edit`, `remove`, `move` | `element where`, `element edit`, `element remove`, `element move` |
15
+ | `check`, `shot`, `import` | `page check`, `page shot`, `page import` |
16
+ | `space`, `pull`, `push`, `lint`, `fix` | `space use`, `space pull`, `space push`, `space lint`, `space fix` |
17
+ | `add plugin`, `pack plugin`, `upload plugin` | `plugin add`, `plugin pack`, `plugin upload` |
18
+ | `add runtime` | `runtime add` |
19
+ | `pack source` | `source pack` |
20
+ | `update` (alias of `upgrade`) | `upgrade` |
21
+
22
+ `create`, `verify`, `doctor`, `upgrade`, `explain`, `feedback`, `login`, `logout` and `whoami` stay at the top, beside
23
+ `functions`, `runtime`, `data` and `skills`. There are no aliases: a name asked for at the top that is a group's command
24
+ answers where it is — `There is no plitzi push: it is one of plitzi space push, plitzi runtime push, plitzi functions
25
+ push` — read off the commands themselves. A project's scripts (`lint:space`, `check`, `shot`) call the new names;
26
+ `plitzi upgrade --write` updates the ones the CLI wrote.
27
+
28
+ ## Agents load less to do the same (RFC 0025)
29
+ - **The MCP lists the operations vocabulary once.** A connection with a space listed ~69k tokens of tools before an
30
+ agent did anything — the operations schema five times. `plitzi_apply` carries it; `plitzi_render` lists only its
31
+ operations' types beside it (and keeps the whole schema on a guest connection, where it is alone). The listing is
32
+ now ~18k tokens.
33
+ - **`plitzi_validate` is `plitzi_apply`'s `dryRun`**, which already answered the same; the `validate` function, its
34
+ `validateShape` and `ValidateInput` are gone from `@plitzi/sdk-mcp`.
35
+ - **`plitzi_apply` looks at the page it would leave**: `look: 'html' | 'image' | 'accessibility' | 'both'` (with
36
+ `pageRef`, `viewport`, `fullPage`) renders it — with `dryRun`, as the batch would leave it, nothing saved; without, as
37
+ saved. Check, look and save with the operations written twice, not four times.
38
+ - **`plitzi_look` is the one way to see a saved page** — its accessibility outline (the default: text, cheap), its HTML
39
+ or a PNG; `plitzi_preview` and `plitzi_screenshot` are gone. It is always offered: without a browser service it answers
40
+ the HTML and says so.
41
+ - **`plitzi_describe_operation { type }`** answers one operation's schema, or every type there is; a type that does not
42
+ exist is answered with the nearest one.
43
+ - `closest` is exported from `@plitzi/sdk-authoring`: the nearest of a closed list of names.
44
+ - **`plitzi element where <id | class | words>`** answers where the project's code writes an element — the file, the line and
45
+ the call itself — asked of the code as it is now, so it follows an element wherever somebody moved it. A class is
46
+ found by its name or by the variable that holds it (`nav-link`, `navLink`).
47
+ - **`plitzi element edit <id> --set key=value --remove key`** writes attributes in that call (`content` where the factory takes
48
+ it first), keeping each one's kind, formatted as the project formats, and keeps the change only if the space still
49
+ authors with every value there. Behind both, `locateElements` in `@plitzi/sdk-authoring`: every element with the call
50
+ that wrote it.
51
+ - A generated project's `AGENTS.md` says to ask `where` instead of keeping a note of where things are.
52
+ - **`plitzi doctor` says one fact once**: packages installed from the same place, and packages behind the same version,
53
+ are one line each — on a project installed from local tarballs, ~1,050 tokens of output became ~330.
54
+ - **A mistake costs one line.** An operation type that does not exist is answered with the nearest one; a field an
55
+ operation, an element, a binding or a flow step does not have is refused naming the one meant — it used to be dropped,
56
+ and `prop` for `props` answered success having applied nothing. An element type spelt with other capitals
57
+ (`Heading`) is read as the catalog spells it and said in `warnings`.
58
+ - **The same batch refused twice is not run a third time** (`REPEATED_BATCH`), and the second refusal says so; `plitzi
59
+ edit` does the same, kept in the project's `tmp/refusals.json`.
60
+ - **`plitzi_apply`'s `look` renders a batch through the path a save takes** (`draftBatch`): a
61
+ `repeatElement` expanded, what has one reading read, the same refusals.
62
+ - **Each skill is a core an agent reads every time, and references it opens when the task names one.** The core —
63
+ what it is for, the rules that go wrong most, a table routing each task to its one file — is held to 1,500 tokens:
64
+ `plitzi-authoring` went from ~4,000 to ~920 (every rule kept in `reference/rules.md`, the recipes indexed in
65
+ `reference/recipes.md`, every reference in `reference/index.md`), `plitzi-cli` from ~4,000 to ~820 (projects,
66
+ plugins and troubleshooting are references of their own), `plitzi-render` from ~3,100 to ~1,050.
67
+ - **Intent tools on the MCP**: `plitzi_set_attributes`, `plitzi_set_classes` (classes added or removed, the rest
68
+ kept), `plitzi_bind_attribute`, `plitzi_place_component`, `plitzi_add_page` — a few parameters, the element by its ref alone (the
69
+ page is found, a ref that does not exist answered with the nearest), checked and saved as `plitzi_apply` saves, and
70
+ answered in a line with the next step.
71
+ - **An element may only wear a class the space has, or the batch declares**: `plitzi_apply` used to save one nothing
72
+ defines — rendered unstyled, said by nobody. It is refused naming the nearest class.
73
+ - **`plitzi explain` answers any export of `@plitzi/sdk-authoring`** — `pageFamily`, `styles`, `SpaceSpec` — with its
74
+ signature and the first paragraph of its doc, read from the `.d.ts` the project installed: a few dozen tokens where an
75
+ agent used to search ~180k of published types.
76
+ - **`plitzi element where --by id|class|text`** reads a query one way; without it, the first reading that matches is answered
77
+ and every other one that matched is said with its count and the command for it — a query that means two things is
78
+ never answered as one. `plitzi element edit` reads its element by id alone.
79
+ - **A helper written once and called for many elements** is told apart: `locateElements` answers each element's
80
+ `through` — the calls of the author's code that led to the one that wrote it — so `plitzi element where` says which other
81
+ elements the same call writes and the call that leads to this one alone, and `plitzi element edit` changes a value the helper
82
+ is handed where it is handed (`pageHead('about-head', 'About us')`), refuses an edit of a call that writes several
83
+ elements unless `--every` says so, and never writes `content` beside words given as the factory's first argument.
84
+ - `plitzi explain` of a name that is the project's own says where to read it.
85
+ - **Nothing a write does is silent.** `plitzi_apply` answers `effects`: every change the batch made, read off the space
86
+ before and after it (elements added or removed by subtree, attributes, classes, moves, styles, settings, connectors,
87
+ actions), with a note where a changed attribute is one a binding computes; a batch that changed nothing says so, and
88
+ a store with no persister leads the warnings as `NOT saved: …`. The intent tools answer those `effects`, whether it
89
+ was `saved` and what was already so, refuse to take off a class the element does not wear and to write a value under
90
+ a binding. `plitzi element edit` reads the whole space before and after the edit (`plitzi element readings`, in a fresh process),
91
+ prints every change, and puts the files back when anything changed that was not asked, naming it; it refuses an
92
+ attribute a binding computes, and `plitzi element where` marks those `Bound`. `canonicalJson` (`@plitzi/sdk-shared`) is
93
+ what every before-and-after comparison is made with. Authoring keeps deep enough a call stack (64 frames) that a
94
+ helper inside a helper is still told apart.
95
+ - `locateElements` answers the parts of every component too, in the component (`rootId` is its id): `plitzi element where`
96
+ and `plitzi element edit` reach an element inside a component as they reach one on a page or a layout.
97
+
98
+ ## Fixed
99
+ - **A layout no longer mounts twice when the page hydrates.** An element with `runtime: 'server'` was wrapped in its
100
+ static shell while hydrating and handed back without it — under another key — on the next render, so React tore
101
+ down everything under it and built it again. With a server provider around a layout (an `apiContainer` that draws
102
+ no markup of its own), the whole layout's DOM was replaced on every page, and every `motion` arrival in it played
103
+ twice: a visible flicker on load. The shell now stays around the element on both sides of hydration, under the same
104
+ key, and only stops freezing (`frozen`).
105
+ - **A component's instance is written somewhere.** `component(…)` — and each child it places in a slot — rebuilt its
106
+ spec with a spread and lost the marker of where the author wrote it: `plitzi element where` could not place an instance and
107
+ `plitzi element edit` refused it. The original marker is carried (`carryWrittenAt`); `where` finds the words an instance
108
+ hands its component, and `edit` writes an instance's props.
109
+ - `plitzi element edit` follows a value read off a list the call is repeated for (`item.question` in
110
+ `QUESTIONS.flatMap(item => …)`) to the one entry that holds it, in the file the list is written in; when the shared
111
+ value is not a literal it says where it comes from instead of offering `--every`.
112
+ - **`plitzi page check --element` says which class wins.** Each property more than one of the element's classes sets, at
113
+ rest: the value shown, the class it comes from and what the others say — or that they all set it so. Which wins is
114
+ asked of the page, each class taken off for a moment; a style change is verified in text, not with a picture.
115
+ - **`plitzi element where` reads more.** By words it finds every word an element says (`words` on `WrittenElement`: content,
116
+ `label`, `title`, `alt`, `placeholder`, binding templates, an instance's props); by class it says where the class
117
+ is declared (`locateClasses` in `@plitzi/sdk-authoring`); an element repeated over a list says which list, and its
118
+ file; a page or a layout is placed at the object it is declared as.
119
+ - **`plitzi element edit` edits a page** by the attributes `where` shows (`seoPageTitle` written as `seoTitle`;
120
+ `PAGE_SPEC_FIELDS` in `@plitzi/sdk-authoring`), refusing `layout` and `seoEnabled`, which are no field of their own;
121
+ and a value read in more than one place (a list entry a nav and a menu both draw) changes them all only with
122
+ `--every`, each named.
123
+ - **A component prop of a type that does not exist is refused** (`prop-type-unknown`, with the types there are):
124
+ `type: 'string'` was accepted at run time, offered by no editor and checked against nothing. `BUILTIN_PARAM_TYPES`
125
+ in `@plitzi/sdk-shared` is the list, and `BuiltinParamType` is derived from it.
126
+ - **`plitzi element remove <id>` and `plitzi element move <id> --before|--after <id>`** take an element out of the code that writes
127
+ it, or reorder it among its siblings — following a section a helper returns to the helper's call — checked as
128
+ `edit` is: a removal may take only the element and what it holds, a move only reorder its parent, or the file goes
129
+ back. Styles and imports only the removed call used go with it, named; a helper left unread is said.
130
+ - **`plitzi verify`** runs the project's checks — author (no warning), lint:space, typecheck, lint, format — and every
131
+ page with no parameter, and prints only what fails; a page it could not open is said as not checked. Generated
132
+ projects get `npm run verify`, and their `AGENTS.md` names it as the way to leave the project passing.
133
+ - **A component's refusal says where it is written** (by its root's call).
134
+ - **`check --element`** says a class changes nothing on the element only when every property it sets stays without
135
+ it, and names the other elements the class is on: changing the class changes them; taking it off this element does
136
+ not.
137
+ - **An element's generated selector and binding ids are named after its id**, under its parent's place, not after its
138
+ position among its siblings: a move renames nothing. Every space written in code gets new generated names once —
139
+ the same rules, so nothing a visitor sees changes.
140
+ - A change of an element's children is said as what came, went or moved (`faq moved — now after hero, before pricing`).
141
+ - **`plitzi page check --click <id>`** clicks one element and says what changed — flows run and how each step ended, the
142
+ page it went to, what scrolled, what is shown now and what no longer is, the state — or that nothing did, in those words; a flow that
143
+ succeeded while nothing on the page changed is said as that. A click that could not be made, or a flow that failed,
144
+ fails the check.
145
+ - **A refusal of the authored space's gate says where**: each of the validator's errors (`UNRESOLVED_INTERACTION_TARGET`,
146
+ `UNRESOLVED_BINDING_SOURCE`, …) carries the file and line of the element it is about, and a name nothing answers to is
147
+ offered the nearest element that answers the step it was for (`openModal('search')` → `search-modal`, not the
148
+ `search-q` field), or the few that do. `SchemaValidationError` gains `missing` and `wantedBy` (`@plitzi/sdk-schema`).
149
+ - **`plitzi element where` finds the words a list's rows show** when the list is handed them as data (`items:
150
+ [...PLANS]`), and says the list they are the entries of and its file (`Its rows are the entries of PLANS
151
+ (src/space/enterprise/content.ts)`).
152
+ - `plitzi page check --click` says what is **shown** now and what no longer is (drawn, wherever the page is scrolled),
153
+ not "on screen".
154
+ - `plitzi upgrade` says packages installed locally in one line past three, and a skill rewritten within the same
155
+ version as that, not `0.38.7 → 0.38.7`.
156
+ - **What `element edit`, `remove` and `move` read back goes through the gate `npm run author` does**: a change that
157
+ leaves the space refused — a flow still opening a modal that was removed — is put back, the refusal said with where.
158
+ `element remove` refuses before writing when another element's flows act on what it takes away, and says what it
159
+ took once, by the outermost element (`search-modal removed, with 18 inside`). Moving an element beside itself is
160
+ refused as nothing to do.
161
+ - **An id, a plugin folder or a data file written a letter off is offered the nearest one** (`element where`, `edit`,
162
+ `remove`, `move`, `plugin pack`, `data describe`).
163
+ - **A project file that does not load is said at its file and line** — `src/space/hero.ts:139: Expected ','` — by the
164
+ server, `npm run author` and every CLI command, never as a stack (`ProjectModuleError` and `moduleProblem` in
165
+ `@plitzi/sdk-authoring/node`).
166
+ - **`plitzi verify` stops at the first failure** — one broken file fails every later step the same way — and says the
167
+ rest as not run (`--keep-going` runs them anyway); `--no-pages` no longer fails a run that passed.
168
+ - **`plitzi space fix` no longer drops attributes written one level too deep**: `attributes: { value: 5 }` where
169
+ `value: 5` was meant is put in its place (a new `unwrap` fix), not removed with what it said.
170
+ - **`plitzi explain <type>` explains the project's own elements** (`src/plugins/`), and `plugin add` prints how to place
171
+ one with the attributes it was declared with.
172
+ - **`plitzi data describe` says an object keyed by data once**, as a map of one shape with how many keys, so a file of
173
+ five hundred articles reads as one.
174
+ - **`plitzi page check` says a path no page answers before opening it**, with the paths the pages do answer — never a
175
+ redirect home read as a page for signed-in visitors.
176
+ - **`copyToClipboard(text)`**, a utility step (`@plitzi/sdk-interactions`, built with `copyToClipboard` in
177
+ `@plitzi/sdk-authoring`): a "Copy link" button had no step to write with. A browser that gives the page no clipboard
178
+ fails the step, so a toast after it is never said of a copy that was not made.
179
+ - **`plitzi explain` lists the values a param takes only when it is a choice** (`select`): `setState`'s `value` read
180
+ as `'true' | 'false'`, the examples of a free value taken for its only ones.
181
+ - **`plitzi page check --click` says what the page said** — a toast or an alert, `said: "Link copied"` — and **a form
182
+ the browser held back**, with the field and the browser's reason, never as a click that changed nothing.
183
+ - **`plitzi page check --click <id> --fill <id>=<value>`** fills fields before the click as a visitor does (typed, an
184
+ option chosen, a box ticked), so a form's success flow is checked, not only its refusal when empty. A container of
185
+ several fields is refused with their ids; a field filled inside another element says whose it is.
186
+
187
+ - Updated dependencies [1b45aae]
188
+ - @plitzi/sdk-shared@0.38.8
189
+ - @plitzi/sdk-style@0.38.8
190
+
191
+ ## 0.38.7
192
+
193
+ ### Patch Changes
194
+
195
+ - c7bbc2b: ## A server project's `src/main.ts` is a few lines
196
+
197
+ - **`serveProject` from `@plitzi/sdk-server/project`**: the generated `src/main.ts` hands the space, its actions and
198
+ its options to the server, and the rest comes with the package — the port, the plugins of `src/plugins` and
199
+ `vendor/plugins`, the functions and runtime, `public/`, `src/data/`, the `kv` in `state/kv.json`, `/health`,
200
+ `tmp/dev-server.json` and the reloads while developing. A fix there arrives with `npm update`, not `plitzi upgrade`.
201
+ - **No more `tmp/space.json` while developing**: a saved space is authored again in its own process and handed to the
202
+ server over IPC (`plitzi/author.ts --ipc`, in place of `--out`); the server swaps it in memory and the open pages
203
+ reload, and a refused space keeps the last one that authored. `plitzi doctor` reports a leftover `tmp/space.json`.
204
+ - **`projectAuthoring()` in `@plitzi/sdk-authoring/node`**: what a project's space is checked against — its plugins'
205
+ declarations, its built plugins, its data files — once, for the server and `npm run author` alike. Neither it nor
206
+ `serveProject` takes a root: it is the working directory, where every script runs (`projectAuthoringAt(root)` for a
207
+ tool working on another folder).
208
+ - **`authorProjectSpace` and `projectSpace()` in `@plitzi/sdk-authoring/node`**: the project's space read from
209
+ `src/space/index.ts` — `dist/space/index.js` when the server runs built — once its root and layout are checked, and
210
+ authored. `src/main.ts` is `serveProject({ space: authorProjectSpace, actions, connectors, serverOptions })`, with no
211
+ import of the space; `plitzi/author.ts`, the visual tests and the CLI's checks read it the same way. A module that
212
+ exports no `space` is refused saying what to export (`ProjectSpaceError`).
213
+ - **`.env` lives at the root and Node reads it** as each script starts (`--env-file-if-exists=.env`; `start:dev`
214
+ preloads `@plitzi/sdk-server/env`, since a watched process would restart on every change beside the file). Settings
215
+ read at the top level of `src/config/serverOptions.ts` or the actions are set. Every project gets `.env` and
216
+ `.env.example`; `plitzi upgrade` removes the old `src/env.ts`.
217
+ - **One check of a project's layout** (`@plitzi/sdk-shared/project/layout`): a plugin folder with no entry, a
218
+ JavaScript entry, `src/plugin/` for `src/plugins/`, a `.env` inside `src/`, a space exported by default, a broken
219
+ `vendor/` plugin… The server refuses to boot listing every error with its fix, `npm run author` and the CLI's checks
220
+ refuse with the same words, `plitzi doctor` lists them under `layout` and `--fix` makes the ones with a single fix,
221
+ and `plitzi lint` points at doctor. A plugin folder added broken while developing is reported in the terminal
222
+ instead of failing in esbuild. Plugins may start at `index.tsx`.
223
+ - **`createJsonAdapters` serves documents held in memory**: `offlineData` may be a function returning them, not only a
224
+ path.
225
+ - **One source for a project's layout**, `@plitzi/sdk-shared/project/paths`; `src/config/serverOptions.ts` is typed
226
+ `ProjectServerOptions`. `plitzi upgrade files --write` brings an existing project's `main.ts` and `author.ts` up.
227
+ - **`npm run build` no longer fails on a plugin's stylesheet**: `tsconfig.build.json` includes `plitzi/assets.d.ts`,
228
+ which a space importing a plugin's declaration reaches through its component.
229
+
230
+ ## A write refreshes what shows it
231
+ - **Writes now refresh server-driven providers.** `runServerAction`, `webHook`, `writeRecord` and the
232
+ `invalidateQueries` step reach `runtime: 'server'` api containers by id, by `query` URL, or all of them, just as
233
+ they reach cached browser requests. Before, they reached only the browser's query cache, so a saved write left the
234
+ page showing the old value until a reload. Hidden providers refresh when they are shown.
235
+ - **A refresh because something changed asks around every cache.** `performQuery`, writes and invalidations send
236
+ `Cache-Control: no-cache`; `/_rsc` resolves such a request again instead of serving its cached slice, and keeps the
237
+ new answer. A `refreshSeconds` timer and a "load more" page still go through the caches.
238
+ - **`refreshRsc`'s fourth argument is an options object**, `{ location?, fresh? }`.
239
+
240
+ ## A space's functions read its data
241
+ - **`ctx.data('products.json')`** reads one file of the space's data (a project's `src/data/`), parsed and read-only,
242
+ as of the run's version. Plugins' functions are refused it.
243
+ - **Self-hosted servers read `dataDir` through the same lookup as the platform**, so `/data/<file>` providers and
244
+ `ctx.data` read the same files; `plitzi functions dev` reads `src/data`. `/data/../x.json` is now the provider's
245
+ error state instead of falling through to `publicDir`.
246
+ - **Importing a file outside `functions/` names the boundary and the fix**: read the space's data with
247
+ `ctx.data('<file>')`.
248
+
249
+ ## Signing in on a self-hosted server
250
+ - **`createServer({ auth })` tells the pages it renders where to sign in** (`server.auth`: provider, endpoints and
251
+ the session hint cookie), so a space signs in with no auth settings declared. Settings a space does declare still
252
+ win, and a space that names another provider ignores the server's description. New `pageAuth` server option, for a
253
+ deployment whose `/auth` flows are served by another host.
254
+ - **A page with no auth provider no longer offers `auth.login` / `auth.logout`**, and a sign-in that cannot work says
255
+ why in the console (`[plitzi] auth.login: …`) instead of failing silently. What a visitor keeps there
256
+ (`keepState`, `paintedState`) is the browser's, as on any space without accounts: what was kept as a guest's on such
257
+ a page before is let go once, on the first visit after the upgrade.
258
+ - **Renewal verifies the refresh token itself.** `findByRefreshToken` no longer has to report `refreshExpiresAt`; when
259
+ it does, it overrides the token's own expiry.
260
+ - **New authoring reference `auth.md`**: providers, `authLogin` and its result, `authLogout`, `{{ auth.* }}`,
261
+ `accessLevel`, visitor roles, action `access` and `ctx.user`.
262
+
263
+ ## Flows
264
+ - **Authoring refuses a `when` that asks a step for a key it never publishes** (`condition-field-unpublished`).
265
+ `whenSucceeded` / `whenFailed` after `authLogin` always ran the failure branch: they read a server action's
266
+ `status`. The message names what the step publishes and suggests testing `signedIn.ok` with `when`.
267
+ - **`explain` lists what a step publishes** (`Reads:`) and finds the auth steps by their builders (`authLogin`,
268
+ `authLogout`, `authRefreshDetails`). `authLogin({ username, password })` no longer needs `mode`.
269
+
270
+ ## Elements
271
+ - **Images no longer default to a 140×140 square**: they are 140px wide and as tall as their ratio, so `width` or
272
+ `aspect-ratio` on a class just works. `object-fit` shows in the builder too.
273
+ - **`formControl` with `subType: 'switch'` renders an on/off switch** (`role="switch"`) — it rendered only its label.
274
+ Checkboxes and switches show a `true` default or binding as ticked.
275
+ - **The theme toggle drops the native button look**, and the **`current` style state covers the chosen item of any
276
+ set**: the link to the page shown, a pressed toggle, a selected tab. The exported `CURRENT_PAGE_SELECTOR` is now
277
+ `CURRENT_SELECTOR`.
278
+ - **Element defaults in the style inspector and the MCP catalogue match what the SDK renders**, held by a test. The
279
+ dialog's `bodyContainer` and `headerCloseButton` slots now reach the page; pagination lays out as declared.
280
+ - **Markdown takes a class for each part of the document** through its own slot (`heading`, `paragraph`, `link`,
281
+ `list`, `listItem`, `quote`, `code`, `codeBlock`, `image`, `table`, `anchor`), and `headingLinks: false` drops the
282
+ link each heading offers to itself while keeping its id, so `/page#anchor` links still work. Its description spells
283
+ out the HTML it outputs.
284
+ - **Tabs show every trigger.** The SDK hid every inactive tab item, the header's included, so a set of tabs showed
285
+ one tab and no way to the others; only the body's panels take turns now.
286
+ - **A link that names a query is current only on that query**: of `/?window=6h` and `/?window=24h`, the one shown
287
+ carries `aria-current` — with the path alone, every one of them did. A link with no query is still current on its
288
+ page whatever the query.
289
+
290
+ ## The style language says what `customCss` used to
291
+ - **Pseudo-elements on a class**: `pseudos: { after: { css: { content: '"→"' }, states: { hover: { … } } } }` —
292
+ `before`, `after`, `marker`, `placeholder`, `first-letter`, `first-line`, `selection`, each in the class's states and
293
+ variants. Authoring refuses what draws nothing: a `before`/`after` with no `content`, a `content` without its quotes,
294
+ a property the browser drops on that pseudo-element.
295
+ - **Conditions on a class**: `conditions: { 'motion-reduce': { … }, 'container card (max-width: 30rem)': { … } }` —
296
+ reduced or allowed motion, and container widths, each with its states and pseudo-elements.
297
+ - **The space's `keyframes`**, validated and written at the top of `customCss`; an `animation-name` no keyframes declare
298
+ is warned (`animation-name-unknown`).
299
+ - **New states**: `expanded` (`aria-expanded`), `first`, `last`, `odd`, `even`; the tab panel on show is `current`, and
300
+ the theme toggle's icon of the scheme in use is `current` on its `icon` slot.
301
+ - **`ancestors['>']`** is the parent, whatever it wears — a closed component's part reacting to the element around it.
302
+ - The builder's style inspector, the MCP's definition ops (`pseudos`, `conditions`, and variants with their states) and
303
+ the export to code read and write all of it; an MCP `patchDefinition` no longer drops what it did not name. Rules in
304
+ `customCss` a class can hold now — `.link::after`, one under `@media (prefers-reduced-motion: reduce)`, `.row:first-child`,
305
+ `.row:nth-child(even)`, `.toggle[aria-expanded='true']` — are folded into the class on export and suggested by
306
+ `custom-css-class`.
307
+
308
+ ## Elements take a class for each part
309
+ - **`formControl`**: `field` (the `<input>` itself), `icon` (the show-password button) and `requiredMark` slots; a switch's
310
+ knob reads in dark mode and takes `--plitzi-switch-thumb`, `--plitzi-switch-thumb-checked`, `--plitzi-switch-thumb-shadow`.
311
+ - **`pagination`**: `previous`, `page` (the one shown is its `current` state), `next`, `loadMore`.
312
+ - **`richText`** and **`markdown`**: a slot per part — `heading` and `heading1`…`heading6`, `strong`, `emphasis`,
313
+ `divider`, `tableHead`, `tableRow`, `tableHeaderCell`, `tableCell`, and the code block's frame, header, language and
314
+ copy button. Both heading slots dress one `<h3>`, so `heading-level-overridden` warns when they set the same property
315
+ and the stylesheet's order makes the general one win. A document is drawn by the SDK's own renderer
316
+ (`MarkdownDocument` in `@plitzi/sdk-elements`) — plitzi-ui's `Markdown` keeps GitHub's stylesheet for a library's
317
+ consumers — and reads as a document unstyled: headings, lists, code, tables and quotes get their type from the SDK's
318
+ base layer, at no weight (`:where()`), so a class on a part's slot replaces what it sets property by property. A
319
+ `richText` body reads the same.
320
+ - `custom-css-slot` suggests the slot for a `customCss` rule on a part's SDK class — only where a class on the slot can
321
+ say the rest of the selector (a state, a pseudo-element); `element-slot-unknown` warns of a slot an element does not
322
+ have.
323
+
324
+ ## Links, refreshes and toasts
325
+ - **`current: 'section'` on a link** keeps it current on its page and every page under its path (`aria-current="true"`
326
+ there), styled by the `current` state — no `activeOn` binding for a section.
327
+ - **A refresh asks only about elements the page shown holds**: a provider on the page being left no longer sends a
328
+ `/_rsc` about the new address.
329
+ - **The toasts' parts are `notifications` fields**: `minHeight`, `fontWeight`, `lineHeight`, `iconSize`, `iconGap`,
330
+ `closeColor`, `closeOpacity`, `progressHeight`.
331
+ - **A page asked for with its space's token hydrates its own space.** On a host serving many spaces
332
+ (`?access-token=`), the space document fetched beside the page went without the token, so the host's own space
333
+ answered it and the browser hydrated another space's document over the page — a hydration error, and its tree
334
+ rebuilt. The document's address now carries the token the page was asked for with.
335
+ - **The SDK's stylesheet carries the space's variables from the server's HTML.** It read them from what a provider
336
+ below it publishes while the page renders, which the server had not done yet when it wrote the sheet; it now
337
+ resolves them from the document itself (`useResolvedVariables` of `@plitzi/sdk-shared/dataSource/hooks`), the same
338
+ on both sides.
339
+ - **A realtime message the pub/sub cannot deliver is answered, not fatal.** A publish that Redis refuses — a timeout under
340
+ load — is answered `503` with `reason: 'unavailable'`, by the `POST` and in the WebSocket's `ack` alike; a connect,
341
+ a disconnect or a revoke that fails is logged, on either transport. Each used to reject with nobody waiting, and the server's `unhandledRejection` handler
342
+ shut the whole process down.
343
+
344
+ ## Reporting to Plitzi
345
+ - **`plitzi feedback`** starts a report of what broke, misled or cost time: it writes the page the report is laid out
346
+ in (`tmp/feedback/`) with the installed versions, the project and what `doctor` finds already in it, and tells the
347
+ agent how to fill it — each finding reproduced first, with evidence, impact, workaround and fix, no secrets — and to
348
+ publish it as an artifact whose link the developer sends. `--previous <url>` continues an earlier report.
349
+
350
+ ## Pages that load on every browser
351
+ - **The import map comes before anything that loads a module**, in the page server's HTML, a published site's
352
+ (`index.hbs` on the platform), the SDK's and the builder's. React's `modulepreload` links came first, and a browser
353
+ that had fetched a module already — Chrome before 133 — ignored the map: every bare `import "react"` failed
354
+ ("Failed to resolve module specifier") and the page never hydrated.
355
+
356
+ ## The dev tools
357
+ - **A page loads the React its dev tools need.** The development build only while the visitor has the dev tools on
358
+ (shift+F12, within what the deployment allows); turned off, the next load is a production page, React included. It
359
+ followed the authorization alone, so a space that allowed debugging always shipped development React.
360
+
361
+ ## check and lint
362
+ - **`plitzi check`, `push`, `lint` and `fix` hold the space to what `npm run author` and the server do**: its data
363
+ files too, so `push` no longer sends a space whose browser provider reads `src/data/` (`server-data-in-browser`).
364
+ - **`plitzi check` lists each list's rows as drawn and as held in its source** (`feed 4 of 8 rows`,
365
+ `hits not rendered (16 in its source)`). In `--json`, `lists` is now `{ id: { rendered, source } }`.
366
+ - **`plitzi check` no longer reports bindings inside a container the page isn't showing**, nor text "in the colour
367
+ behind it" because of a bar painted over it or a pane that clips it.
368
+ - **`window.__plitzi.sources()` no longer turns a shared array into `'[…]'`**, and a list row no longer replaces its
369
+ list's `items`.
370
+ - **`plitzi lint` says authoring suggestions are quieted with `quiet` on the element**, and reports a
371
+ `plitzi-lint-disable` comment that names one (`disable-names-suggestion`).
372
+ - **`plitzi check` says when a page sent the browser elsewhere** (a page for signed-in visitors, to the sign-in) instead
373
+ of reporting every element missing, and `--as <username>` signs in first through the server's `/auth` routes, the
374
+ password from `PLITZI_CHECK_PASSWORD`.
375
+ - **`plitzi upgrade` never replaces @plitzi packages installed locally** — a tarball, a link, a portal, an override: it
376
+ leaves them and the install, and says which and the command that would install the registry's.
377
+ - **`plitzi explain` covers every code**: authoring's, `plitzi lint`'s and the project layout's.
378
+ - **Authoring reads the global sources' fields**: `auth.authenticated` in a condition is refused with "did you mean
379
+ `isAuthenticated`?" (`global-field-unknown`), and `invalidateElements` must name providers that exist
380
+ (`element-ids-target`). A template's reads of `computed`, `flags` and the global sources come off the parsed
381
+ template: a string inside it (`'https://auth.acme.com'`) is no longer read as `auth.acme`.
382
+ - **`custom-css-notifications` no longer reads the rules `notifications` itself writes** as toasts dressed by hand.
383
+ - **A refused space or layout is a report, not a stack**: the server's entry point imports the space once the layout is
384
+ checked, and `npm start` and `npm run author` print every problem and exit with 1.
385
+ - **New authoring suggestion `class-overrides-class`**: one class's shorthand (`padding`) silently erases a longhand
386
+ (`padding-top`) another class on the same element writes out.
387
+
388
+ - Updated dependencies [c7bbc2b]
389
+ - @plitzi/sdk-shared@0.38.7
390
+ - @plitzi/sdk-style@0.38.7
391
+
3
392
  ## 0.38.6
4
393
 
5
394
  ### Patch Changes
@@ -17,6 +17,10 @@ export type SchemaValidationError = {
17
17
  elementId?: string;
18
18
  /** The component whose tree the error is in; absent for the pages' tree. */
19
19
  componentId?: string;
20
+ /** The name an element points at that no element answers to — what a suggestion of the nearest one is made from. */
21
+ missing?: string;
22
+ /** The step the missing element was to answer (`openModal`): a suggestion is drawn from the elements that do. */
23
+ wantedBy?: string;
20
24
  details?: unknown;
21
25
  };
22
26
  export type SchemaValidationResult = {
@@ -307,6 +307,7 @@ var i = /* @__PURE__ */ new Set([
307
307
  code: "UNRESOLVED_BINDING_SOURCE",
308
308
  message: `${f}, but no element answers to the name "${d}"`,
309
309
  elementId: i.id,
310
+ missing: d,
310
311
  details: {
311
312
  source: o.source,
312
313
  elementId: d
@@ -357,7 +358,9 @@ var i = /* @__PURE__ */ new Set([
357
358
  }), a.type === "callback" && a.elementId && !t.has(a.elementId) && s.push({
358
359
  code: "UNRESOLVED_INTERACTION_TARGET",
359
360
  message: `Interaction "${a.id}" on element "${n.id}" runs against "${a.elementId}", but no element answers to that name`,
360
- elementId: n.id
361
+ elementId: n.id,
362
+ missing: a.elementId,
363
+ wantedBy: a.action
361
364
  });
362
365
  let o = a.type === "trigger" && a.action === "onSubmit" && a.enabled ? g(a.elementId ?? n.id) : void 0;
363
366
  o?.definition.type === "form" && o.attributes.managedByInteractions !== !0 && c.push({
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@plitzi/sdk-schema",
3
- "version": "0.38.6",
3
+ "version": "0.38.8",
4
4
  "license": "AGPL-3.0",
5
5
  "files": [
6
6
  "dist"
@@ -60,9 +60,9 @@
60
60
  "build:prod": "vite build && node ../sdk-shared/scripts/generate-exports.mjs"
61
61
  },
62
62
  "dependencies": {
63
- "@plitzi/plitzi-ui": "^1.6.31",
64
- "@plitzi/sdk-shared": "0.38.6",
65
- "@plitzi/sdk-style": "0.38.6",
63
+ "@plitzi/plitzi-ui": "^1.6.32",
64
+ "@plitzi/sdk-shared": "0.38.8",
65
+ "@plitzi/sdk-style": "0.38.8",
66
66
  "immer": "^11.1.21"
67
67
  },
68
68
  "devDependencies": {