@plitzi/sdk-schema 0.38.7 → 0.38.9

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,201 @@
1
1
  # @plitzi/sdk-schema
2
2
 
3
+ ## 0.38.9
4
+
5
+ ### Patch Changes
6
+
7
+ - Updated dependencies [64f4cd6]
8
+ - @plitzi/sdk-shared@0.38.9
9
+ - @plitzi/sdk-style@0.38.9
10
+
11
+ ## 0.38.8
12
+
13
+ ### Patch Changes
14
+
15
+ - 1b45aae: ## The CLI's commands are named after what they act on
16
+
17
+ Every command sits under the thing it acts on — `plitzi element move`, never a bare `move` that could mean anything —
18
+ and only what acts on the project as a whole or the account stays at the top:
19
+
20
+ | Before | Now |
21
+ | -------------------------------------------- | ------------------------------------------------------------------ |
22
+ | `where`, `edit`, `remove`, `move` | `element where`, `element edit`, `element remove`, `element move` |
23
+ | `check`, `shot`, `import` | `page check`, `page shot`, `page import` |
24
+ | `space`, `pull`, `push`, `lint`, `fix` | `space use`, `space pull`, `space push`, `space lint`, `space fix` |
25
+ | `add plugin`, `pack plugin`, `upload plugin` | `plugin add`, `plugin pack`, `plugin upload` |
26
+ | `add runtime` | `runtime add` |
27
+ | `pack source` | `source pack` |
28
+ | `update` (alias of `upgrade`) | `upgrade` |
29
+
30
+ `create`, `verify`, `doctor`, `upgrade`, `explain`, `feedback`, `login`, `logout` and `whoami` stay at the top, beside
31
+ `functions`, `runtime`, `data` and `skills`. There are no aliases: a name asked for at the top that is a group's command
32
+ answers where it is — `There is no plitzi push: it is one of plitzi space push, plitzi runtime push, plitzi functions
33
+ push` — read off the commands themselves. A project's scripts (`lint:space`, `check`, `shot`) call the new names;
34
+ `plitzi upgrade --write` updates the ones the CLI wrote.
35
+
36
+ ## Agents load less to do the same (RFC 0025)
37
+ - **The MCP lists the operations vocabulary once.** A connection with a space listed ~69k tokens of tools before an
38
+ agent did anything — the operations schema five times. `plitzi_apply` carries it; `plitzi_render` lists only its
39
+ operations' types beside it (and keeps the whole schema on a guest connection, where it is alone). The listing is
40
+ now ~18k tokens.
41
+ - **`plitzi_validate` is `plitzi_apply`'s `dryRun`**, which already answered the same; the `validate` function, its
42
+ `validateShape` and `ValidateInput` are gone from `@plitzi/sdk-mcp`.
43
+ - **`plitzi_apply` looks at the page it would leave**: `look: 'html' | 'image' | 'accessibility' | 'both'` (with
44
+ `pageRef`, `viewport`, `fullPage`) renders it — with `dryRun`, as the batch would leave it, nothing saved; without, as
45
+ saved. Check, look and save with the operations written twice, not four times.
46
+ - **`plitzi_look` is the one way to see a saved page** — its accessibility outline (the default: text, cheap), its HTML
47
+ or a PNG; `plitzi_preview` and `plitzi_screenshot` are gone. It is always offered: without a browser service it answers
48
+ the HTML and says so.
49
+ - **`plitzi_describe_operation { type }`** answers one operation's schema, or every type there is; a type that does not
50
+ exist is answered with the nearest one.
51
+ - `closest` is exported from `@plitzi/sdk-authoring`: the nearest of a closed list of names.
52
+ - **`plitzi element where <id | class | words>`** answers where the project's code writes an element — the file, the line and
53
+ the call itself — asked of the code as it is now, so it follows an element wherever somebody moved it. A class is
54
+ found by its name or by the variable that holds it (`nav-link`, `navLink`).
55
+ - **`plitzi element edit <id> --set key=value --remove key`** writes attributes in that call (`content` where the factory takes
56
+ it first), keeping each one's kind, formatted as the project formats, and keeps the change only if the space still
57
+ authors with every value there. Behind both, `locateElements` in `@plitzi/sdk-authoring`: every element with the call
58
+ that wrote it.
59
+ - A generated project's `AGENTS.md` says to ask `where` instead of keeping a note of where things are.
60
+ - **`plitzi doctor` says one fact once**: packages installed from the same place, and packages behind the same version,
61
+ are one line each — on a project installed from local tarballs, ~1,050 tokens of output became ~330.
62
+ - **A mistake costs one line.** An operation type that does not exist is answered with the nearest one; a field an
63
+ operation, an element, a binding or a flow step does not have is refused naming the one meant — it used to be dropped,
64
+ and `prop` for `props` answered success having applied nothing. An element type spelt with other capitals
65
+ (`Heading`) is read as the catalog spells it and said in `warnings`.
66
+ - **The same batch refused twice is not run a third time** (`REPEATED_BATCH`), and the second refusal says so; `plitzi
67
+ edit` does the same, kept in the project's `tmp/refusals.json`.
68
+ - **`plitzi_apply`'s `look` renders a batch through the path a save takes** (`draftBatch`): a
69
+ `repeatElement` expanded, what has one reading read, the same refusals.
70
+ - **Each skill is a core an agent reads every time, and references it opens when the task names one.** The core —
71
+ 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:
72
+ `plitzi-authoring` went from ~4,000 to ~920 (every rule kept in `reference/rules.md`, the recipes indexed in
73
+ `reference/recipes.md`, every reference in `reference/index.md`), `plitzi-cli` from ~4,000 to ~820 (projects,
74
+ plugins and troubleshooting are references of their own), `plitzi-render` from ~3,100 to ~1,050.
75
+ - **Intent tools on the MCP**: `plitzi_set_attributes`, `plitzi_set_classes` (classes added or removed, the rest
76
+ kept), `plitzi_bind_attribute`, `plitzi_place_component`, `plitzi_add_page` — a few parameters, the element by its ref alone (the
77
+ page is found, a ref that does not exist answered with the nearest), checked and saved as `plitzi_apply` saves, and
78
+ answered in a line with the next step.
79
+ - **An element may only wear a class the space has, or the batch declares**: `plitzi_apply` used to save one nothing
80
+ defines — rendered unstyled, said by nobody. It is refused naming the nearest class.
81
+ - **`plitzi explain` answers any export of `@plitzi/sdk-authoring`** — `pageFamily`, `styles`, `SpaceSpec` — with its
82
+ signature and the first paragraph of its doc, read from the `.d.ts` the project installed: a few dozen tokens where an
83
+ agent used to search ~180k of published types.
84
+ - **`plitzi element where --by id|class|text`** reads a query one way; without it, the first reading that matches is answered
85
+ and every other one that matched is said with its count and the command for it — a query that means two things is
86
+ never answered as one. `plitzi element edit` reads its element by id alone.
87
+ - **A helper written once and called for many elements** is told apart: `locateElements` answers each element's
88
+ `through` — the calls of the author's code that led to the one that wrote it — so `plitzi element where` says which other
89
+ elements the same call writes and the call that leads to this one alone, and `plitzi element edit` changes a value the helper
90
+ is handed where it is handed (`pageHead('about-head', 'About us')`), refuses an edit of a call that writes several
91
+ elements unless `--every` says so, and never writes `content` beside words given as the factory's first argument.
92
+ - `plitzi explain` of a name that is the project's own says where to read it.
93
+ - **Nothing a write does is silent.** `plitzi_apply` answers `effects`: every change the batch made, read off the space
94
+ before and after it (elements added or removed by subtree, attributes, classes, moves, styles, settings, connectors,
95
+ actions), with a note where a changed attribute is one a binding computes; a batch that changed nothing says so, and
96
+ a store with no persister leads the warnings as `NOT saved: …`. The intent tools answer those `effects`, whether it
97
+ was `saved` and what was already so, refuse to take off a class the element does not wear and to write a value under
98
+ a binding. `plitzi element edit` reads the whole space before and after the edit (`plitzi element readings`, in a fresh process),
99
+ prints every change, and puts the files back when anything changed that was not asked, naming it; it refuses an
100
+ attribute a binding computes, and `plitzi element where` marks those `Bound`. `canonicalJson` (`@plitzi/sdk-shared`) is
101
+ what every before-and-after comparison is made with. Authoring keeps deep enough a call stack (64 frames) that a
102
+ helper inside a helper is still told apart.
103
+ - `locateElements` answers the parts of every component too, in the component (`rootId` is its id): `plitzi element where`
104
+ and `plitzi element edit` reach an element inside a component as they reach one on a page or a layout.
105
+
106
+ ## Fixed
107
+ - **A layout no longer mounts twice when the page hydrates.** An element with `runtime: 'server'` was wrapped in its
108
+ static shell while hydrating and handed back without it — under another key — on the next render, so React tore
109
+ down everything under it and built it again. With a server provider around a layout (an `apiContainer` that draws
110
+ no markup of its own), the whole layout's DOM was replaced on every page, and every `motion` arrival in it played
111
+ twice: a visible flicker on load. The shell now stays around the element on both sides of hydration, under the same
112
+ key, and only stops freezing (`frozen`).
113
+ - **A component's instance is written somewhere.** `component(…)` — and each child it places in a slot — rebuilt its
114
+ spec with a spread and lost the marker of where the author wrote it: `plitzi element where` could not place an instance and
115
+ `plitzi element edit` refused it. The original marker is carried (`carryWrittenAt`); `where` finds the words an instance
116
+ hands its component, and `edit` writes an instance's props.
117
+ - `plitzi element edit` follows a value read off a list the call is repeated for (`item.question` in
118
+ `QUESTIONS.flatMap(item => …)`) to the one entry that holds it, in the file the list is written in; when the shared
119
+ value is not a literal it says where it comes from instead of offering `--every`.
120
+ - **`plitzi page check --element` says which class wins.** Each property more than one of the element's classes sets, at
121
+ rest: the value shown, the class it comes from and what the others say — or that they all set it so. Which wins is
122
+ asked of the page, each class taken off for a moment; a style change is verified in text, not with a picture.
123
+ - **`plitzi element where` reads more.** By words it finds every word an element says (`words` on `WrittenElement`: content,
124
+ `label`, `title`, `alt`, `placeholder`, binding templates, an instance's props); by class it says where the class
125
+ is declared (`locateClasses` in `@plitzi/sdk-authoring`); an element repeated over a list says which list, and its
126
+ file; a page or a layout is placed at the object it is declared as.
127
+ - **`plitzi element edit` edits a page** by the attributes `where` shows (`seoPageTitle` written as `seoTitle`;
128
+ `PAGE_SPEC_FIELDS` in `@plitzi/sdk-authoring`), refusing `layout` and `seoEnabled`, which are no field of their own;
129
+ and a value read in more than one place (a list entry a nav and a menu both draw) changes them all only with
130
+ `--every`, each named.
131
+ - **A component prop of a type that does not exist is refused** (`prop-type-unknown`, with the types there are):
132
+ `type: 'string'` was accepted at run time, offered by no editor and checked against nothing. `BUILTIN_PARAM_TYPES`
133
+ in `@plitzi/sdk-shared` is the list, and `BuiltinParamType` is derived from it.
134
+ - **`plitzi element remove <id>` and `plitzi element move <id> --before|--after <id>`** take an element out of the code that writes
135
+ it, or reorder it among its siblings — following a section a helper returns to the helper's call — checked as
136
+ `edit` is: a removal may take only the element and what it holds, a move only reorder its parent, or the file goes
137
+ back. Styles and imports only the removed call used go with it, named; a helper left unread is said.
138
+ - **`plitzi verify`** runs the project's checks — author (no warning), lint:space, typecheck, lint, format — and every
139
+ page with no parameter, and prints only what fails; a page it could not open is said as not checked. Generated
140
+ projects get `npm run verify`, and their `AGENTS.md` names it as the way to leave the project passing.
141
+ - **A component's refusal says where it is written** (by its root's call).
142
+ - **`check --element`** says a class changes nothing on the element only when every property it sets stays without
143
+ it, and names the other elements the class is on: changing the class changes them; taking it off this element does
144
+ not.
145
+ - **An element's generated selector and binding ids are named after its id**, under its parent's place, not after its
146
+ position among its siblings: a move renames nothing. Every space written in code gets new generated names once —
147
+ the same rules, so nothing a visitor sees changes.
148
+ - A change of an element's children is said as what came, went or moved (`faq moved — now after hero, before pricing`).
149
+ - **`plitzi page check --click <id>`** clicks one element and says what changed — flows run and how each step ended, the
150
+ 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
151
+ succeeded while nothing on the page changed is said as that. A click that could not be made, or a flow that failed,
152
+ fails the check.
153
+ - **A refusal of the authored space's gate says where**: each of the validator's errors (`UNRESOLVED_INTERACTION_TARGET`,
154
+ `UNRESOLVED_BINDING_SOURCE`, …) carries the file and line of the element it is about, and a name nothing answers to is
155
+ offered the nearest element that answers the step it was for (`openModal('search')` → `search-modal`, not the
156
+ `search-q` field), or the few that do. `SchemaValidationError` gains `missing` and `wantedBy` (`@plitzi/sdk-schema`).
157
+ - **`plitzi element where` finds the words a list's rows show** when the list is handed them as data (`items:
158
+ [...PLANS]`), and says the list they are the entries of and its file (`Its rows are the entries of PLANS
159
+ (src/space/enterprise/content.ts)`).
160
+ - `plitzi page check --click` says what is **shown** now and what no longer is (drawn, wherever the page is scrolled),
161
+ not "on screen".
162
+ - `plitzi upgrade` says packages installed locally in one line past three, and a skill rewritten within the same
163
+ version as that, not `0.38.7 → 0.38.7`.
164
+ - **What `element edit`, `remove` and `move` read back goes through the gate `npm run author` does**: a change that
165
+ leaves the space refused — a flow still opening a modal that was removed — is put back, the refusal said with where.
166
+ `element remove` refuses before writing when another element's flows act on what it takes away, and says what it
167
+ took once, by the outermost element (`search-modal removed, with 18 inside`). Moving an element beside itself is
168
+ refused as nothing to do.
169
+ - **An id, a plugin folder or a data file written a letter off is offered the nearest one** (`element where`, `edit`,
170
+ `remove`, `move`, `plugin pack`, `data describe`).
171
+ - **A project file that does not load is said at its file and line** — `src/space/hero.ts:139: Expected ','` — by the
172
+ server, `npm run author` and every CLI command, never as a stack (`ProjectModuleError` and `moduleProblem` in
173
+ `@plitzi/sdk-authoring/node`).
174
+ - **`plitzi verify` stops at the first failure** — one broken file fails every later step the same way — and says the
175
+ rest as not run (`--keep-going` runs them anyway); `--no-pages` no longer fails a run that passed.
176
+ - **`plitzi space fix` no longer drops attributes written one level too deep**: `attributes: { value: 5 }` where
177
+ `value: 5` was meant is put in its place (a new `unwrap` fix), not removed with what it said.
178
+ - **`plitzi explain <type>` explains the project's own elements** (`src/plugins/`), and `plugin add` prints how to place
179
+ one with the attributes it was declared with.
180
+ - **`plitzi data describe` says an object keyed by data once**, as a map of one shape with how many keys, so a file of
181
+ five hundred articles reads as one.
182
+ - **`plitzi page check` says a path no page answers before opening it**, with the paths the pages do answer — never a
183
+ redirect home read as a page for signed-in visitors.
184
+ - **`copyToClipboard(text)`**, a utility step (`@plitzi/sdk-interactions`, built with `copyToClipboard` in
185
+ `@plitzi/sdk-authoring`): a "Copy link" button had no step to write with. A browser that gives the page no clipboard
186
+ fails the step, so a toast after it is never said of a copy that was not made.
187
+ - **`plitzi explain` lists the values a param takes only when it is a choice** (`select`): `setState`'s `value` read
188
+ as `'true' | 'false'`, the examples of a free value taken for its only ones.
189
+ - **`plitzi page check --click` says what the page said** — a toast or an alert, `said: "Link copied"` — and **a form
190
+ the browser held back**, with the field and the browser's reason, never as a click that changed nothing.
191
+ - **`plitzi page check --click <id> --fill <id>=<value>`** fills fields before the click as a visitor does (typed, an
192
+ option chosen, a box ticked), so a form's success flow is checked, not only its refusal when empty. A container of
193
+ several fields is refused with their ids; a field filled inside another element says whose it is.
194
+
195
+ - Updated dependencies [1b45aae]
196
+ - @plitzi/sdk-shared@0.38.8
197
+ - @plitzi/sdk-style@0.38.8
198
+
3
199
  ## 0.38.7
4
200
 
5
201
  ### 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.7",
3
+ "version": "0.38.9",
4
4
  "license": "AGPL-3.0",
5
5
  "files": [
6
6
  "dist"
@@ -61,8 +61,8 @@
61
61
  },
62
62
  "dependencies": {
63
63
  "@plitzi/plitzi-ui": "^1.6.32",
64
- "@plitzi/sdk-shared": "0.38.7",
65
- "@plitzi/sdk-style": "0.38.7",
64
+ "@plitzi/sdk-shared": "0.38.9",
65
+ "@plitzi/sdk-style": "0.38.9",
66
66
  "immer": "^11.1.21"
67
67
  },
68
68
  "devDependencies": {