@plitzi/sdk-style 0.38.14 → 0.38.16

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/CHANGELOG.md +173 -0
  2. package/package.json +4 -4
package/CHANGELOG.md CHANGED
@@ -1,5 +1,178 @@
1
1
  # @plitzi/sdk-style
2
2
 
3
+ ## 0.38.16
4
+
5
+ ### Patch Changes
6
+
7
+ - 9cfdccb: ## Security
8
+
9
+ - **A site's credential reads nothing of the space over MCP** (`@plitzi/sdk-mcp`): the `render` token every published
10
+ page embeds — and a self-hosting `host` key — resolved to a grant naming the space, and the MCP served every read
11
+ under it: the unpublished draft, the change history with who made each change and every value before and after, the
12
+ functions' source, the space's private data, its action documents and connectors. Only an `agent` grant attaches a
13
+ space now; any other is a connection with no space (`plitzi_render` and the public guides), told so in the words
14
+ `NO_SPACE_ATTACHED` already uses. A deployment whose `getGrant` answered other scopes for reading must issue agent
15
+ grants for them.
16
+
17
+ ## Agents
18
+ - **`plitzi space watch`** (`@plitzi/cli`): the space read again on every save of `src/space/`, `src/plugins/`,
19
+ `src/data/` or `public/data/`, and only what changed said — what the save did to the space element by element, the
20
+ findings and warnings it brought and fixed (one that only moved down its file is the same one), a save that changed
21
+ nothing, or that the space stopped authoring and why. `--json` is one event a line (`ready`, `pass`, `refused`,
22
+ `error`), for an agent to run in the background instead of `author` and `space lint` after every edit. Each pass reads
23
+ the space in a process of its own (`space watch-pass`, hidden). `space lint`'s reading is `spaceFindings`, shared.
24
+ - **A space's activity, followed** (`@plitzi/sdk-shared`, `@plitzi/sdk-mcp`, `@plitzi/cli`): what happened on a space
25
+ after a cursor — its draft changed (a person in the builder, an agent, the autofix), a version went out, a server
26
+ action failed or was refused — and, with nothing yet, waited for, up to 50 s. One vocabulary,
27
+ `@plitzi/sdk-shared/activity` (`SpaceActivity`, `SpaceActivityPage`, `activityLine`, `isSpaceActivityPage`, the
28
+ limits); the reader's own writes left out and counted (`skippedMine`), `mine` keeps them.
29
+ - **`plitzi_activity { after, wait, limit, mine }`** (`@plitzi/sdk-mcp`), on the new `getActivity` adapter
30
+ (`SSRAdapters`). The listing budget is 78k (was 77k) for it.
31
+ - **`plitzi space activity [--follow] [--after <cursor>] [--mine] [--limit <n>] [--json]`** (`@plitzi/cli`), over
32
+ the platform's `GET /spaces/:spaceId/activity`; `--follow` stays, one page a line with `--json`, and asks again
33
+ when the platform does not answer.
34
+ - **The people in the builder see the agent work** (`@plitzi/sdk-server`, `@plitzi/sdk-shared`, `@plitzi/sdk-mcp`,
35
+ `@plitzi/plitzi-builder`): an agent grant carries the application the member connected (`Grant.client`,
36
+ `StoredSpaceToken.client`, `SSRGrant.client`), and every MCP write `SSRWriteContext.client` — the history's
37
+ `client` for an agent, which was never set. A collaborator may be an agent (`SubscriptionCollaborator.agent`): the
38
+ builder draws it as a robot, names it `Claude · for ana` (`collaboratorTitle`) in the header, on the canvas and in
39
+ its notices. The deployment announces it — Plitzi's joins it on a write, selects what it changed, and lets it go
40
+ after a minute of nothing. `activityLine` names it the same way (`Claude for ana over the MCP, …`), so
41
+ `plitzi space activity` says which application wrote.
42
+ - A tool may declare `documents: false` (`ToolSpec`): the host loads none of the space for it, and passes the call's
43
+ abort signal through `ToolContext.activity`.
44
+
45
+ ## Authoring
46
+ - **A file that does not parse is said at its line under any loader** (`@plitzi/sdk-authoring`): `moduleProblem` read
47
+ the first line of the error, and an esbuild transform (tsx, vitest) puts only `Transform failed with 1 error:` there
48
+ — the file, line and what is wrong are on the next. A line of the message that points at a file of the project is
49
+ now the problem (`src/space/hero.ts:139: Expected "}" but found ";"`), the project's root matched as given and as it
50
+ is on disk (`/var/…` and `/private/var/…` on macOS).
51
+
52
+ ## Testing
53
+ - **`unusedPort` is chosen where the system never hands one out** (`@plitzi/sdk-server`): it answered a port the system
54
+ had just handed out (`listen(0)`), from the ephemeral range every outgoing connection takes its local port from — so
55
+ another worker's request could take it before the test listened, and CI failed `runtime.test.ts` with `EADDRINUSE`
56
+ (the page server then ends the process). It is a free port below that range now, at random, checked first.
57
+
58
+ ## Docs
59
+ - **A self-hosted runtime's endpoints go in `data`**, as 0.38.15 moved them: `docs/en/runtimes.md`, the
60
+ `10-runtime` example and the website still put `served.stage` in `preAuth`, before the cross-site guard.
61
+ - New: `docs/en/activity.md`; `space watch` in `docs/en/agent-tooling.md`'s loop; the CLI README, the CLI skill, the
62
+ generated project's `AGENTS.md`, the MCP guide and README.
63
+
64
+ - Updated dependencies [9cfdccb]
65
+ - @plitzi/sdk-event-bridge@0.38.16
66
+ - @plitzi/sdk-shared@0.38.16
67
+ - @plitzi/sdk-variables@0.38.16
68
+
69
+ ## 0.38.15
70
+
71
+ ### Patch Changes
72
+
73
+ - 6cdd5cf: ## Security
74
+
75
+ - **A write another site caused is refused, cookie or none** (`@plitzi/sdk-server`, `@plitzi/sdk-shared`): the page
76
+ server guarded nothing it answers past `/auth` — a server action (`/_action`), a realtime publish, a space's `/fn/`
77
+ route, its runtime's endpoints, the deployment's own `data` stages, the adapter-only `loginPath`, `logoutPath` and
78
+ `exchangePath`. A plain `text/plain` POST from any page open in the same browser ran them, with the visitor's session
79
+ cookie when there was one (`SameSite=None` off this machine) and, in a project nobody signs in to, as whoever holds
80
+ the server's own credentials. Every unsafe request a browser says another site caused (`Sec-Fetch-Site: cross-site`,
81
+ or a foreign `Origin`) is now refused `403 reason: 'foreign'`, saying how to allow it: `crossSiteWrites.origins`
82
+ (with `auth`, `identity.platformOrigins` too) and `crossSiteWrites.paths` for a form other sites post to by design.
83
+ `Authorization`, and callers that are not browsers — webhooks, scripts — pass as before. One rule for this and the
84
+ sign-in check (`crossSiteRequest`, `csrf.ts`). A self-hosted runtime's endpoints now sit where the platform forwards a
85
+ space's — after the auth chain and this guard (`data`, was `preAuth`).
86
+
87
+ ## Testing
88
+ - **`page check` and `page shot` anywhere the project is served** (`@plitzi/cli`): `--url <origin>` for a second server
89
+ of it, staging or a deploy, instead of `npm start`'s port; `page check --space <module>` holds the pages to that space
90
+ instead of the project's — an agent's page — authored with `authorIsolated`.
91
+ - **A route with a query is checked as its page** (`@plitzi/cli`): `page check "/?v=2"` matched the query as part of
92
+ the path, found no page, and checked the space's "not found" page in its place.
93
+
94
+ - **What an element that chooses its children draws is checked** (`@plitzi/sdk-authoring`, `@plitzi/cli`): with
95
+ `choosesChildren`, the page checks owed none of its children — and checked none of them either: a dashboard drawing
96
+ three panels reported `checked: 1`. Each child it may draw, and what is inside one under no condition of its own,
97
+ now carries `shownWith` (the child it comes with) on its handle: once that child is on screen it and everything
98
+ named in it are owed like the rest of the page, and `checked` counts them. `onScreenIfChosen(handles, page)` lists
99
+ them.
100
+ - **A page that met a server error is looked at once more** (`@plitzi/cli`): `page check` and `verify` failed a page
101
+ for a `500` from somebody else's service having a bad second (`/fn/<space>/weather`), and passed on the next run with
102
+ nothing changed. A page whose requests got a `5xx` is checked again once; its report is the second look, and says
103
+ what failed the first time (`retriedAfter`). A `4xx` fails the same way twice, and is never retried.
104
+
105
+ ## Plugins
106
+ - **`useNotify`** (`@plitzi/plitzi-sdk`): a plugin shows the page's notifications — `notify('Deleted 79 recordings', {
107
+ appearance: 'danger' })` — the same toasts an `addNotification` step shows, in the space's theme and `notifications`
108
+ look, with no trigger, flow or `window` event of the space's to wire. The step's vocabulary (`NOTIFICATION_PLACEMENTS`,
109
+ `NOTIFICATION_APPEARANCES`, `NOTIFICATION_DEFAULTS`) is one list in `@plitzi/sdk-shared`, read by both.
110
+ - **`appearance: 'danger'` looks like one** (`@plitzi/plitzi-sdk`): it reached the toast library as a type it does not
111
+ know, so a danger notification showed neither the error icon nor the colour `notifications.danger` sets.
112
+ A value a notification does not take — from a flow, or a plugin in plain JavaScript — is set aside by name and said
113
+ in the console, rather than shown as the default in silence (`readNotificationOptions`, `@plitzi/sdk-shared`).
114
+ - **`useServerAction`** (`@plitzi/plitzi-sdk`, `@plitzi/sdk-authoring`, `@plitzi/sdk-interactions`,
115
+ `@plitzi/sdk-server`): a plugin runs one of the space's server actions, awaited —
116
+ `useServerAction<typeof habitDone>('habits-done')({ id })` answers `{ ok, output }` or `{ ok: false, reason, error }`
117
+ — through the `runServerAction` step itself: the same access, refusals, session handling and dev-tools entry.
118
+ `defineAction` keeps the literal types of its `call` way in, so the input is typed by the fields it declares (the
119
+ required ones required); `taskAction` types both ends from the task's `run`, and `FunctionTask<T, R>` takes what
120
+ `run` answers. `CallInputOf` / `CallOutputOf` read them. One operation is one action, never a `case` in one route.
121
+ What a run answers is typed (`ServerActionStatus`): a status the server never uses reads as a run that did not
122
+ complete, never as one that did.
123
+ The key those types ride under (`CALL_TYPES`) is exported, by `@plitzi/sdk-shared` and `@plitzi/sdk-authoring` with
124
+ `TypedActionEntry`, `CallInputOf` and `CallOutputOf`: a package that emits declarations could not write the type of an
125
+ action it exports (`TS4023` on every `export const actions = [defineAction(…)]`).
126
+ - **A plugin is drawn on the server first** (docs): a preference per device belongs in kept state (`keepState`,
127
+ `paintedState`) as a bound prop, never read from `localStorage` while rendering — React discards the whole tree on the
128
+ mismatch, and only in the browser of whoever saved something. `@plitzi/plitzi-ui` is not the page's: a plugin
129
+ importing it bundles its own copy, with its own contexts and its own look. The authoring skill's `plugin-reach.md`
130
+ says what a plugin says and to whom: a notification, another element (an event and the space's flow), a server
131
+ action, shared state, other pages.
132
+
133
+ ## Realtime
134
+ - **A channel that retains** (`@plitzi/sdk-shared`, `@plitzi/sdk-server`, `@plitzi/sdk-elements`): declared
135
+ `retain: true` (with `publish: 'server'`, which authoring requires), the server keeps the latest message of each type
136
+ on a topic — said by `ctx.publish` or a flow's `realtime.publish` — and hands them to every page that joins, marked
137
+ `retained`. A page reads them as `<channel>.retained.<type>`, a plugin as `useChannel(topic).retained`, the newest of
138
+ a type holding whichever order they arrive in; `null` forgets a type. Kept in the store the actions' `kv` uses (beside
139
+ the grants, by compare-and-swap), so every replica hands out the same; a topic keeps at most 64 types and 512 KB, and
140
+ a publish past that is refused before anything is sent. State every screen shares is one publish and one binding —
141
+ no kv key, initial read or copy in `state` of the project's own. The fleet store `realtime.grants` is now
142
+ `realtime.kv`.
143
+ - **The MCP writes every field a channel takes** (`@plitzi/sdk-mcp`): `patchSettings`'s channel had no `grant` — which
144
+ the guide taught — nor `retain` or the limits, so an agent could not declare a private channel at all. All are there
145
+ now, and the guide says what `retain` is for and that `channel_<id>.retained` holds it.
146
+
147
+ ## Authoring
148
+ - **`plitzi explain` knows every `@plitzi` package installed** (`@plitzi/cli`): a name that was not
149
+ `@plitzi/sdk-authoring`'s (`createServer`, `createJsonAdapters`, `useChannel`) was answered as the project's own code,
150
+ to `grep` in `src/`. It is read from the published types of every one installed, through their re-exports and entry
151
+ points (`@plitzi/sdk-server/handlers`), and a name two packages export — `createServer` is sdk-server's and sdk-mcp's
152
+ — is answered with both.
153
+
154
+ - **A space module somebody else wrote, authored where it reaches nothing** (`@plitzi/sdk-authoring`):
155
+ `authorIsolated(file, { timeoutMs })` of `@plitzi/sdk-authoring/node` runs `authorSpace` on it in a process Node's
156
+ permission model holds to reading the module's folder and its packages — no file written, no process started, no
157
+ variable of the caller's environment — kills one that runs too long, and validates what it answers again, so a forged
158
+ answer gains nothing. A refusal comes back as `authorSpace` says it, with the problems as data.
159
+ - **Pages an agent writes, served** (`@plitzi/sdk-server`): `createAuthoringHost({ dir, frameAncestors })` serves each
160
+ space it is handed at an address of its own (`put(space, { id }) → /?__pt=<id>`) as a draft of its one space, kept in
161
+ `dir` across restarts; `drop(id)` forgets one, and anything else answers `404` saying where the pages are.
162
+ - **A space is chosen by host or credential** (`@plitzi/sdk-server`, docs): `getSpaceDeployment` is asked on every
163
+ request, and what a page fetches after it carries nothing of its address but the host — a space chosen by the page's
164
+ query or path lost everything it asked for, and `/_plitzi/space/<hash>.json` answered a bare `404`. The contract and
165
+ the README say so (the README offered "by path prefix"), and that `404` says why.
166
+
167
+ - **`plitzi explain on` says how to read what a trigger carries** (`@plitzi/sdk-authoring`): its doc sat above a
168
+ helper, so `explain` printed only the signature. It now leads with `[named('picked', on('onPick')), …('{{ picked.seat
169
+ }}')]`, and the CLI skill's plugin section says the same.
170
+
171
+ - Updated dependencies [6cdd5cf]
172
+ - @plitzi/sdk-event-bridge@0.38.15
173
+ - @plitzi/sdk-shared@0.38.15
174
+ - @plitzi/sdk-variables@0.38.15
175
+
3
176
  ## 0.38.14
4
177
 
5
178
  ### Patch Changes
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@plitzi/sdk-style",
3
- "version": "0.38.14",
3
+ "version": "0.38.16",
4
4
  "license": "AGPL-3.0",
5
5
  "files": [
6
6
  "dist"
@@ -1149,9 +1149,9 @@
1149
1149
  },
1150
1150
  "dependencies": {
1151
1151
  "@plitzi/plitzi-ui": "^1.6.33",
1152
- "@plitzi/sdk-event-bridge": "0.38.14",
1153
- "@plitzi/sdk-shared": "0.38.14",
1154
- "@plitzi/sdk-variables": "0.38.14",
1152
+ "@plitzi/sdk-event-bridge": "0.38.16",
1153
+ "@plitzi/sdk-shared": "0.38.16",
1154
+ "@plitzi/sdk-variables": "0.38.16",
1155
1155
  "clsx": "^2.1.1",
1156
1156
  "immer": "^11.1.21",
1157
1157
  "zod": "^4.6.5"