@rsc-kit/mcp 0.29.5 → 0.29.6

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.
@@ -224,11 +224,72 @@ Three rules apply to all of them:
224
224
  - `RSC_HOST_CALL_SECRET` - the renderer and the backend must change together.
225
225
  Between the two, every `rpc()` is refused, so deploy both at once.
226
226
  - `RSC_SIGNING_SECRET` - pages already open hold names signed with the old
227
- key; their watching is refused and they stop refreshing until reloaded.
228
- Nothing else breaks.
227
+ key. Set the old value as `RSC_SIGNING_SECRET_PREVIOUS` for the deploy that
228
+ rotates it: it is accepted when checking a signature and never used to make
229
+ one, so open tabs keep refreshing while every page rendered after the
230
+ rotation carries the new key. Remove it a day later. Without it, those tabs
231
+ stop refreshing until reloaded; nothing else breaks.
229
232
  - `RSC_ACTION_ENCRYPTION_KEY` - an action called from a page loaded before the
230
233
  change fails, the same window as a deploy without the key pinned.
231
234
 
235
+ ## What the build produces
236
+
237
+ A deploy that plans before building - a binary or a folder, which script to
238
+ run - asks first:
239
+
240
+ ```sh
241
+ bunx rsc-kit info --json
242
+ ```
243
+
244
+ It loads the app's own Vite config the way a build does, so an `output`
245
+ computed in the config, or `RSC_OUTPUT=export` in the environment, resolves
246
+ exactly as the build will resolve it. Then every build writes the same
247
+ answer to `.output/rsc-kit.json` as it finishes - the confirmation, from the
248
+ code that decided; refuse a deploy where the two disagree:
249
+
250
+ ```json
251
+ { "version": "0.29.6", "output": "server", "compile": "compile", "binary": "dist/app" }
252
+ ```
253
+
254
+ ```json
255
+ { "version": "0.29.6", "output": "export", "dir": "dist" }
256
+ ```
257
+
258
+ - **`output: "server"`** - run the server. `compile` and `binary` are there
259
+ when the app's `package.json` has a `compile` script: run it, and the file
260
+ its `--outfile` names is the single binary to ship.
261
+ - **`output: "export"`** - `dir` is the static site; serve it as files.
262
+
263
+ A build carries no backend address and no secret. `RSC_BACKEND`,
264
+ `RSC_HOST_CALL_SECRET` and `RSC_SIGNING_SECRET` are read when the server
265
+ runs, so one build runs against whichever backend its deployment names, and
266
+ rotating a secret is a restart, not a rebuild.
267
+
268
+ ## Is it ready
269
+
270
+ `GET /_rsc/health` says whether this renderer can serve, for a platform
271
+ deciding when to route to it - which an open port alone does not say:
272
+
273
+ ```json
274
+ { "ok": true, "version": "08f805d3", "backend": "ok" }
275
+ ```
276
+
277
+ - **200** - up. `backend` is `"ok"` when the backend answered, `"none"` for
278
+ an app without one.
279
+ - **503** - the backend did not answer within 2 seconds: unreachable, or
280
+ refusing the secret.
281
+
282
+ Why it is not ready names the app's insides, so the reason and `backend` go
283
+ only to a probe that sends the host-call secret, as `x-rsc-host-secret`.
284
+ Anyone else gets `{ "ok": true }` or `{ "ok": false }` and the status - which
285
+ is all a router needs. Not keyed on localhost: behind a reverse proxy on the
286
+ same machine, every visitor is localhost.
287
+
288
+ The backend check asks the route guards with none to run - every adapter
289
+ passes an empty list - so it runs no app code and reads no data, yet it
290
+ proves the address, the network, the shared secret and the adapter. Never
291
+ cached; `HEAD` answers with the status alone.
292
+
232
293
  ## Pages across a deploy
233
294
 
234
295
  A page from the previous build asks for a payload from the new one, whose
@@ -227,7 +227,9 @@ with the status and the `error` message. Only a deliberate refusal carries a
227
227
  `refusalStatus`: a crash leaves it out and is answered 500.
228
228
 
229
229
  Run them in order, outermost first, and stop at the first refusal: an outer
230
- guard saying no means the inner one should never have been asked.
230
+ guard saying no means the inner one should never have been asked. An empty
231
+ list passes - `{ "result": true }`: it is what the renderer's health check
232
+ asks, to prove the backend answers without running anything.
231
233
 
232
234
  ## Saying data changed
233
235
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rsc-kit/mcp",
3
- "version": "0.29.5",
3
+ "version": "0.29.6",
4
4
  "description": "An MCP server over what an rsc-kit build decided: the routes, why each one is static or not, and what it costs the browser.",
5
5
  "type": "module",
6
6
  "license": "MIT",
@@ -34,7 +34,7 @@
34
34
  },
35
35
  "dependencies": {
36
36
  "@modelcontextprotocol/sdk": "^1.30.0",
37
- "create-rsc-kit": "^0.29.5",
37
+ "create-rsc-kit": "^0.29.6",
38
38
  "zod": "^3.25"
39
39
  },
40
40
  "devDependencies": {