@rsc-kit/mcp 0.39.0 → 0.41.0

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/guides/admin.md CHANGED
@@ -214,14 +214,14 @@ backend's generated actions instead of `form`, and the source keeps only
214
214
  `list`, `find` and `delete`:
215
215
 
216
216
  ```ts title="src/admin/resources/products.ts"
217
- import { productsStore, productsUpdate } from '@/actions/products'
217
+ import { store, update } from '../../server-actions/products'
218
218
 
219
219
  export const products = defineResource<Product>()({
220
220
  name: 'products',
221
221
  key: 'id',
222
222
  title: 'name',
223
223
  source: { list: (q) => rpc('Products.list', q), find: (id) => rpc('Products.find', id), delete: (id) => rpc('Products.delete', id) },
224
- actions: { create: productsStore, update: productsUpdate },
224
+ actions: { create: store, update },
225
225
  fields: { category_id: { relation: 'categories' } },
226
226
  table: (col) => [col.text('name'), col.money('price')],
227
227
  })
@@ -267,7 +267,7 @@ import { defineBlueprint } from '@rsc-kit/press/forms'
267
267
  export const product = defineBlueprint({
268
268
  name: 'product',
269
269
  theme: shadcn,
270
- actions: { create: productsStore, update: productsUpdate },
270
+ actions: { create: store, update },
271
271
  fields: { category_id: { relation: 'categories' } },
272
272
  })
273
273
 
@@ -187,13 +187,15 @@ The backend writes `rsc-host.json` at the project root, beside
187
187
 
188
188
  ```json title="rsc-host.json"
189
189
  {
190
- "actions": { "ordersCreate": "Orders.create" },
190
+ "actions": { "orders": { "create": "Orders.create" } },
191
191
  "functions": ["Orders.create", "Orders.recent"]
192
192
  }
193
193
  ```
194
194
 
195
- `actions` are its server actions, by the name the app imports them under; the
196
- build writes a `"use server"` stub for each in `src/server-actions.generated.ts`.
195
+ `actions` are its server actions, by module and then by the name the app
196
+ imports them under; the build writes a `"use server"` module for each, here
197
+ `src/server-actions/orders.ts` exporting `create`. A class's `__invoke`, or a
198
+ Go function with no method, is the module's `default`.
197
199
  `functions` are the names `rpc()` may be called with, and become the type of
198
200
  its first argument, so `rpc('Orders.recnet')` fails the typecheck.
199
201
 
@@ -171,16 +171,17 @@ exist fails at startup.
171
171
  Give it the backend's actions, and the form needs no schema of its own. The
172
172
  backend already says what each takes, so the fields and the browser's checks
173
173
  come from there, and every check that counts is the backend's. The actions are
174
- the ones the build generated, imported like any other:
174
+ the ones the build generated, one module per backend class, imported like any
175
+ other:
175
176
 
176
177
  ```ts title="resources/js/forms/contact.ts"
177
178
  import { defineBlueprint } from '@rsc-kit/press/forms'
178
179
  import { shadcn } from '@rsc-kit/press/shadcn'
179
- import { contactSend } from '../server-actions.generated'
180
+ import { send } from '../server-actions/contact'
180
181
 
181
182
  export const contact = defineBlueprint({
182
183
  name: 'contact',
183
- actions: { create: contactSend },
184
+ actions: { create: send },
184
185
  fields: { message: { type: 'textarea' } },
185
186
  theme: shadcn,
186
187
  submit: 'Send message',
@@ -195,7 +196,7 @@ the record's key after the values: `update(UpdateProfile $request, string
195
196
  $user)` in Laravel, where `$this->route('user')` reads it in `rules()` and
196
197
  `authorize()`, and `func(ctx, in ProfileInput, id string)` in Go.
197
198
 
198
- You need not write it: `bunx rsc-kit make:form contactSend` writes this file
199
+ You need not write it: `bunx rsc-kit make:form Contact.send` writes this file
199
200
  from the action, and it is yours to edit from then on.
200
201
 
201
202
  An action that is not there fails the import, and a field `fields` names that
@@ -216,7 +217,7 @@ a schema and call the backend yourself:
216
217
 
217
218
  ```ts
218
219
  form: z.object({ email: z.email() }),
219
- handle: (values) => contactSend(values),
220
+ handle: (values) => send(values),
220
221
  ```
221
222
 
222
223
  The schema's checks then run first, so a submission it refuses never reaches the
@@ -275,7 +276,8 @@ and call `Validator::make($values, [...])->validate()`, or throw
275
276
  Either lands the same way.
276
277
 
277
278
  Keep the class under `app/Rsc/Actions`, where every public method is an action:
278
- `Contact::send` is `contactSend`, generated at the next build.
279
+ `Contact::send` is `send` in `server-actions/contact`, generated at the next
280
+ build.
279
281
 
280
282
  The form's fields are read from `rules()`, in order, at build time: `required`,
281
283
  the type rules, `email`, `url`, `date`, `min`, `max`, `size`, `between`, and
@@ -302,7 +304,7 @@ type ContactInput struct {
302
304
  Message string `json:"message"`
303
305
  }
304
306
 
305
- reg.HandleAction("contactSend", "Contact.send", func(ctx context.Context, in ContactInput) error {
307
+ reg.HandleAction("Contact.send", func(ctx context.Context, in ContactInput) error {
306
308
  if blocked(in.Email) {
307
309
  return rsckit.InvalidField("email", "That address is blocked.")
308
310
  }
@@ -321,7 +323,7 @@ return rsckit.Invalid(map[string][]string{
321
323
  ```
322
324
 
323
325
  `reg.WriteManifest("rsc-host.json")` puts it in the manifest, and the build
324
- generates `contactSend` from it, as for any action.
326
+ generates `send` in `server-actions/contact` from it, as for any action.
325
327
 
326
328
  The form's fields are the struct's, in its order, and a field is required unless
327
329
  its `json` tag says `omitempty`. A `validate` tag, in go-playground/validator's
@@ -52,7 +52,7 @@ out of `package.json` when the last page that imports them is gone.
52
52
  | `<Link href={route('orders.show', id)}>` (Ziggy) | `<Link href="/orders/1">` from `@rsc-kit/core/Link` — `href` is typed to the route tree, so Ziggy and `@routes` go |
53
53
  | `router.visit()`, `router.get()` | `visit(url)` from `@rsc-kit/core/router` |
54
54
  | `router.reload({ only: ['orders'] })` | `revalidate('orders')` from the action re-renders the [section](/guides/sections) and sends it back with the answer — one request, the rest of the page untouched |
55
- | `router.post()`, `useForm().post('/orders')` | a server action: `php artisan make:rsc-action Orders --method=create`, and `<Form action={ordersCreate}>` — [below](#forms) |
55
+ | `router.post()`, `useForm().post('/orders')` | a server action: `php artisan make:rsc-action Orders --method=create`, and `<Form action={orders.create}>` — [below](#forms) |
56
56
  | `useForm().errors`, `.processing`, `.recentlySuccessful` | `<Form>`'s `error('field')`, `pending` and `recentlySucceeded` — a `FormRequest`'s `ValidationException` lands on the fields |
57
57
  | `->middleware(['auth', 'verified'])` on the route | `export const middleware = ['auth', 'verified']` in a `middleware.ts` beside or above the page — Laravel's names, run through Laravel's pipeline, before anything below it renders |
58
58
  | `Inertia::defer(fn () => …)`, `<WhenVisible>`, `Inertia::lazy()` | `<Suspense>` around the component that awaits the slow read; the shell streams first — [Partial prerendering](/guides/ppr) |
@@ -144,11 +144,11 @@ class Orders
144
144
  ```tsx title="resources/js/app/orders/NewOrder.tsx"
145
145
  'use client'
146
146
  import { Form } from '@rsc-kit/core/form'
147
- import { ordersCreate } from '../../server-actions.generated'
147
+ import * as orders from '../../server-actions/orders'
148
148
 
149
149
  export function NewOrder() {
150
150
  return (
151
- <Form action={ordersCreate}>
151
+ <Form action={orders.create}>
152
152
  {({ pending, error }) => (
153
153
  <>
154
154
  <input name="number" />
package/guides/forms.md CHANGED
@@ -123,7 +123,7 @@ which is why this one is not called that.
123
123
  fails `tsc` rather than silently never matching:
124
124
 
125
125
  ```tsx
126
- <Form action={ordersCreate}>
126
+ <Form action={orders.create}>
127
127
  {({ error }) => (
128
128
  <>
129
129
  {error('name')} {/* ok */}
@@ -168,7 +168,7 @@ once the team is bound. A form fills the struct parameter, the one after
168
168
  whatever you bound, and the generated stub keeps its field names:
169
169
 
170
170
  ```tsx
171
- const create = appsCreate.bind(null, team) // once, not inline
171
+ const create = apps.create.bind(null, team) // once, not inline
172
172
 
173
173
  <Form action={create}>{({ error }) => error('name')}</Form>
174
174
  ```
@@ -199,7 +199,7 @@ A component below the form types its own prop with `FieldNamesOf`:
199
199
  ```tsx
200
200
  import type { FieldNamesOf } from '@rsc-kit/core/form'
201
201
 
202
- type Props = { name: FieldNamesOf<typeof ordersCreate> }
202
+ type Props = { name: FieldNamesOf<typeof orders.create> }
203
203
  ```
204
204
 
205
205
  ## Validation errors
@@ -367,10 +367,14 @@ any component that ends up rendering a real form control is already compatible:
367
367
  `Input`, `Textarea`, `Button` and `Label` are styled native elements, so `name`
368
368
  does what it always does.
369
369
 
370
- **`Select`, `Checkbox`, `Switch` and `RadioGroup` also work** — they are Radix
371
- underneath, and Radix renders a hidden native control whenever you give it a
372
- `name`, for exactly this. Omit the `name` and it is invisible to the form; that
373
- is the only thing to remember.
370
+ **`Select`, `Checkbox`, `Switch` and `RadioGroup` also work**, whether your
371
+ shadcn is built on Base UI or on Radix. Both render a hidden native control
372
+ whenever you give the component a `name`, for exactly this. Omit the `name` and
373
+ it is invisible to the form; that is the only thing to remember.
374
+
375
+ A pick in a Base UI `Select` changes its hidden control without firing an
376
+ event. `<Form>` watches its own controls, so `dirty` and `valid()` still see
377
+ the change.
374
378
 
375
379
  :::caution[Not shadcn's own `<Form>`]
376
380
  shadcn's `<Form>`, `<FormField>` and `<FormControl>` are wrappers around
@@ -559,7 +563,7 @@ It gives you `{ name, value, onChange, onBlur }` — the same four things
559
563
  `<Controller>` does, for the same reason.
560
564
 
561
565
  `onChange` takes either a DOM event or a bare value, so a native input and a
562
- Radix `Select` both work without a wrapper. A bound field is still an ordinary
566
+ `Select` from Base UI or Radix both work without a wrapper. A bound field is still an ordinary
563
567
  named input, so it arrives in `FormData` with everything else: there is one
564
568
  source of truth, and nothing merges.
565
569
 
@@ -578,6 +582,71 @@ It works on ordinary uncontrolled fields too — the form listens for `focusout`
578
582
  rather than each field listening for `blur`, so `<Input name="title" />` is
579
583
  covered without being bound to anything.
580
584
 
585
+ ### Checked by the server before it is submitted
586
+
587
+ A schema in the browser cannot know that an email is already subscribed, or
588
+ that a coupon has expired. The server can, and `<Form>` asks it: when a field
589
+ is left **having changed**, the form sends what it holds to the action marked
590
+ as a check. The action's guards and validation run for that field; the action
591
+ itself does not. Its answer lands on `error()` like any other.
592
+
593
+ Nothing to opt into. Which actions can be asked:
594
+
595
+ - a `createActionClient()` action with an input schema - its middleware and
596
+ schema run, its handler is skipped;
597
+ - a backend function the backend says it can check without running - in
598
+ Laravel, any action whose first parameter is a form request (its
599
+ `authorize()` and `rules()`, filtered to the field, as Laravel's
600
+ Precognition does);
601
+ - nothing else. A plain `"use server"` function cannot be stopped before its
602
+ body, so it is never called to check, and the form stops asking after the
603
+ first answer says so.
604
+
605
+ A field the browser's schema already refuses costs no round trip, a field
606
+ passed through without being changed is not asked about again, and a file goes
607
+ only when its own field is the one being checked.
608
+
609
+ #### When a blur is not the moment
610
+
611
+ `validate()` asks now, about the fields you name - or every field, with none.
612
+ It resolves `true` when they pass. That is a wizard's step:
613
+
614
+ ```tsx
615
+ <Form action={register}>
616
+ {({ validate, validating, valid, error }) => (
617
+ <>
618
+ {step === 1 && (
619
+ <>
620
+ <Input name="email" />
621
+ {valid('email') && <Check />}
622
+ {error('email') && <p>{error('email')}</p>}
623
+ <Button
624
+ type="button"
625
+ disabled={validating}
626
+ onClick={async () => (await validate('email', 'name')) && setStep(2)}
627
+ >
628
+ Next
629
+ </Button>
630
+ </>
631
+ )}
632
+ {/* ... */}
633
+ </>
634
+ )}
635
+ </Form>
636
+ ```
637
+
638
+ A step's fields stay in the form while hidden (render them with `hidden`
639
+ rather than not at all), so the last step's submit sends every one.
640
+
641
+ `*` stands for one segment of a nested name, as in Laravel: `validate('items.*.sku')`.
642
+ For a field checked as it is typed, call `validate('handle')` from its
643
+ `onChange` - and debounce it yourself; the form does not decide how often you
644
+ may ask.
645
+
646
+ `validating` is true while a check is out. `valid(name)` is true once a check
647
+ of that field passed and it has not been edited since - for a tick beside it,
648
+ not for deciding anything.
649
+
581
650
  ### After a successful submit
582
651
 
583
652
  ```tsx
package/guides/go.md CHANGED
@@ -302,7 +302,7 @@ counts it once.
302
302
  ## Server actions
303
303
 
304
304
  ```go
305
- reg.HandleAction("ordersCancel", "Orders.cancel", func(ctx context.Context, id int) error {
305
+ reg.HandleAction("Orders.cancel", func(ctx context.Context, id int) error {
306
306
  if err := orders.Cancel(ctx, id); err != nil {
307
307
  return err
308
308
  }
@@ -318,15 +318,15 @@ reg.WriteManifest("rsc-host.json")
318
318
 
319
319
  ```tsx title="src/app/orders/CancelButton.tsx"
320
320
  'use client'
321
- import { ordersCancel } from '../../server-actions.generated'
321
+ import * as orders from '../../server-actions/orders'
322
322
 
323
323
  export function CancelButton({ id }: { id: number }) {
324
- return <button onClick={() => ordersCancel(id)}>Cancel</button>
324
+ return <button onClick={() => orders.cancel(id)}>Cancel</button>
325
325
  }
326
326
  ```
327
327
 
328
328
  The stub is typed from the Go function, plus the one answer Go can give it that
329
- is not its result: `ordersCancel(id: number): Promise<void | Redirected>`. An
329
+ is not its result: `cancel(id: number): Promise<void | Redirected>`. An
330
330
  action that returns `rsckit.Redirect("/login")` (or a guard that does, for an
331
331
  expired session) resolves the call with `{ redirected }` once the browser is on
332
332
  its way, so narrow with `isRedirected` before reading a value or reporting
@@ -345,10 +345,10 @@ refuses under `type`, so `error('type')` is a type error on a bound stub. A tag
345
345
  (`json:"type"`) gives the form, the manifest and the refusal one spelling.
346
346
  Where tags are not an option, `fields` adds the other names on top.
347
347
 
348
- A form can post to an action directly, `<Form action={ordersCreate}>`, and its
348
+ A form can post to an action directly, `<Form action={orders.create}>`, and its
349
349
  fields arrive as the struct parameter: the first, or the one after the
350
350
  arguments you bound. An action scoped to a team, `func(ctx, team string, in NewApp)`,
351
- is `<Form action={appsCreate.bind(null, team)}>`. Numbers and booleans are
351
+ is `<Form action={apps.create.bind(null, team)}>`. Numbers and booleans are
352
352
  coerced by the struct's types and a repeated field is a slice.
353
353
 
354
354
  An admin resource takes the generated actions in place of a schema, its create
@@ -470,7 +470,7 @@ type ContactInput struct {
470
470
  Message string `json:"message" validate:"required,min=10,max=2000"`
471
471
  }
472
472
 
473
- reg.HandleAction("contactSend", "Contact.send", func(ctx context.Context, in ContactInput) error {
473
+ reg.HandleAction("Contact.send", func(ctx context.Context, in ContactInput) error {
474
474
  if blocked(in.Email) {
475
475
  return rsckit.InvalidField("email", "That address is blocked.")
476
476
  }
@@ -482,17 +482,18 @@ reg.HandleAction("contactSend", "Contact.send", func(ctx context.Context, in Con
482
482
  The tag is read, never run: check what was sent in the function too, since a
483
483
  post need not come from a browser.
484
484
 
485
- **2. The form.** The build generates `contactSend` from the manifest, and
486
- `bunx rsc-kit make:form contactSend` writes the form around it:
485
+ **2. The form.** The build generates `server-actions/contact.ts` from the
486
+ manifest, exporting `send`, and
487
+ `bunx rsc-kit make:form Contact.send` writes the form around it:
487
488
 
488
489
  ```ts title="src/forms/contact.ts"
489
490
  import { defineBlueprint } from '@rsc-kit/press/forms'
490
491
  import { shadcn } from '@rsc-kit/press/shadcn'
491
- import { contactSend } from '../server-actions.generated'
492
+ import { send } from '../server-actions/contact'
492
493
 
493
494
  export const contact = defineBlueprint({
494
495
  name: 'contact',
495
- actions: { create: contactSend },
496
+ actions: { create: send },
496
497
  fields: { message: { type: 'textarea' } },
497
498
  theme: shadcn,
498
499
  done: 'Thanks - we will be in touch.',
package/guides/laravel.md CHANGED
@@ -364,10 +364,10 @@ class Orders
364
364
 
365
365
  ```tsx title="resources/js/app/orders/CancelButton.tsx"
366
366
  'use client'
367
- import { ordersCancel } from '../../server-actions.generated'
367
+ import * as orders from '../../server-actions/orders'
368
368
 
369
369
  export function CancelButton({ id }: { id: number }) {
370
- return <button onClick={() => ordersCancel(id)}>Cancel</button>
370
+ return <button onClick={() => orders.cancel(id)}>Cancel</button>
371
371
  }
372
372
  ```
373
373
 
@@ -517,17 +517,18 @@ class Contact
517
517
  }
518
518
  ```
519
519
 
520
- **3. The form.** The build generates `contactSend` from the method, and
521
- `bunx rsc-kit make:form contactSend` writes the form around it:
520
+ **3. The form.** The build generates `server-actions/contact.ts` from the
521
+ class, exporting `send`, and
522
+ `bunx rsc-kit make:form Contact.send` writes the form around it:
522
523
 
523
524
  ```ts title="resources/js/forms/contact.ts"
524
525
  import { defineBlueprint } from '@rsc-kit/press/forms'
525
526
  import { shadcn } from '@rsc-kit/press/shadcn'
526
- import { contactSend } from '../server-actions.generated'
527
+ import { send } from '../server-actions/contact'
527
528
 
528
529
  export const contact = defineBlueprint({
529
530
  name: 'contact',
530
- actions: { create: contactSend },
531
+ actions: { create: send },
531
532
  fields: { message: { type: 'textarea' } },
532
533
  theme: shadcn,
533
534
  done: 'Thanks - we will be in touch.',
package/guides/testing.md CHANGED
@@ -185,10 +185,10 @@ import { act } from 'react'
185
185
  import { createRoot } from 'react-dom/client'
186
186
  import { afterAll, expect, mock, test } from 'bun:test'
187
187
 
188
- let appsPause = async (): Promise<unknown> => {}
188
+ let pause = async (): Promise<unknown> => {}
189
189
 
190
190
  // The module the component imports its stubs from. `vi.mock` does the same.
191
- mock.module('../src/server-actions.generated', () => ({ appsPause: () => appsPause() }))
191
+ mock.module('../src/server-actions/apps', () => ({ pause: () => pause() }))
192
192
 
193
193
  const { Pause } = await import('../src/app/Pause')
194
194
 
@@ -210,7 +210,7 @@ test('says paused when the call worked', async () => {
210
210
  })
211
211
 
212
212
  test('says nothing when the call redirected', async () => {
213
- appsPause = async () => ({ redirected: '/login' })
213
+ pause = async () => ({ redirected: '/login' })
214
214
 
215
215
  expect(await clicked()).toBe('Pause')
216
216
  })
@@ -346,6 +346,10 @@ Nitro's own `latest` tag is a dated prerelease, and it sorts **above** the plain
346
346
  complaint and then answers 404 to every route. TanStack Start pins a dated beta
347
347
  for the same reason.
348
348
 
349
+ That version is also the oldest rsc-kit runs on. The build stops with the line to
350
+ change if the app has an older Nitro, `3.0.0` included. A later dated release
351
+ passes.
352
+
349
353
  ## Assets are Nitro's
350
354
 
351
355
  The build writes browser assets to `.output/public`, and Nitro serves them from
@@ -351,12 +351,14 @@ Without the variable, do nothing.
351
351
 
352
352
  A `"use server"` function the browser can call is a name the renderer forwards
353
353
  to you. Write `rsc-host.json` at the project root, beside `vite.config.ts`:
354
- `actions` maps the JavaScript name to whatever your side dispatches on, and
355
- `functions` lists every name `rpc()` may call.
354
+ `actions` maps a module - one per class, its path under `server-actions/` -
355
+ to the names it exports, each to whatever your side dispatches on, and
356
+ `functions` lists every name `rpc()` may call. A class's single action, an
357
+ `__invoke`, is the module's `default`.
356
358
 
357
359
  ```json title="rsc-host.json"
358
360
  {
359
- "actions": { "ordersCancel": "Orders.cancel", "profileUpdate": "Profile.update" },
361
+ "actions": { "orders": { "cancel": "Orders.cancel" }, "profile": { "update": "Profile.update" } },
360
362
  "functions": ["Orders.cancel", "Orders.recent", "Profile.update"]
361
363
  }
362
364
  ```
@@ -378,14 +380,42 @@ types: `required`, `format` (`email`, `date`), `minLength`, `maxLength`,
378
380
  properties are drawn in the order written. If your language's JSON sorts a map,
379
381
  say the order with `"x-order": ["name", "email"]` beside them.
380
382
 
381
- The build writes `server-actions.generated.ts` in the source directory
382
- exporting each action, so a client component imports `ordersCancel` and
383
- calls it, and types `rpc()`'s first argument with the functions. Have Vite
383
+ The build writes a module per class under `server-actions/` in the source
384
+ directory, `server-actions/orders.ts` exporting `cancel`, so a client
385
+ component imports `* as orders` from it and calls `orders.cancel`, and types `rpc()`'s first argument with the functions. Have Vite
384
386
  run the command that writes it, `rscKit({ hostManifest: { command } })`, so
385
387
  it cannot go stale: a stale one names a method since renamed, and nothing
386
388
  fails until the browser calls it. Laravel's `rsc:host-manifest` is this
387
389
  step; a Go registry's `WriteManifest` writes the same file.
388
390
 
391
+ ### Checking a form before it is submitted
392
+
393
+ `<Form>` asks whether a field would pass before the form is sent, and an
394
+ action whose validation runs before its body can answer without running.
395
+ List those functions in `rsc-host.json` - a function not listed is never sent
396
+ a check, because a backend that has never heard of one would run the call:
397
+
398
+ ```json
399
+ "validates": ["Profile.update"]
400
+ ```
401
+
402
+ The check is an ordinary call with `validate` beside its `args`, never in a
403
+ batch: the fields to check, `*` matching one segment of a dotted name, and an
404
+ empty list meaning every field.
405
+
406
+ ```json
407
+ { "function": "Profile.update", "args": [{ "email": "taken@example.com" }], "validate": ["email"] }
408
+ ```
409
+
410
+ Run what would refuse the call - authentication, authorization, validation,
411
+ limited to those fields - and stop there. Fields that pass answer
412
+ `{ "result": null }`; fields that do not answer the [422 with
413
+ `validationErrors`](#the-reply) a submit would. Nothing may be written. Any
414
+ other refusal is no verdict on the fields, and the form shows nothing for it.
415
+
416
+ Laravel does this for a function whose first parameter is a form request,
417
+ with Precognition's own rule filtering.
418
+
389
419
  ### A message for the next page
390
420
 
391
421
  `useFlash()` on the page shows what an action leaves for the next one. Your
@@ -532,6 +562,19 @@ It exits non-zero on any failure, so it can gate your CI. The Go adapter's
532
562
  `cmd/conformance` and Laravel's `tests/Conformance` are working fixtures to
533
563
  copy.
534
564
 
565
+ ## The imports for adapter authors
566
+
567
+ An app never imports these. An adapter written in JavaScript, or a host that
568
+ embeds the engine, does:
569
+
570
+ - `@rsc-kit/core/adapter/host-calls`: `httpHostCalls`, the renderer's side
571
+ of this protocol, and the `HostCallReply` and batch types it reads.
572
+ - `@rsc-kit/core/adapter/conformance`: `runConformance` and `report`, the
573
+ suite above as a function, for a test runner that drives it itself.
574
+ - `@rsc-kit/core/adapter/manifest`: `RouteManifest`, the type of the
575
+ `routes.json` the build writes, for a backend that registers the app's
576
+ urls as routes of its own.
577
+
535
578
  ## Proposing an adapter
536
579
 
537
580
  rsc-kit standardises on adapters: a backend in a language rsc-kit has none
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rsc-kit/mcp",
3
- "version": "0.39.0",
3
+ "version": "0.41.0",
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.39.0",
37
+ "create-rsc-kit": "^0.41.0",
38
38
  "zod": "^3.25"
39
39
  },
40
40
  "devDependencies": {