capable-kit 0.0.1-alpha.3 → 0.0.1-alpha.4

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 (57) hide show
  1. package/README.md +21 -3
  2. package/dist/bin.mjs +14 -13
  3. package/dist/bin.mjs.map +1 -1
  4. package/dist/http.d.mts +1 -1
  5. package/dist/http.mjs +1 -1
  6. package/dist/{index-AqKbVZ8Z.d.mts → index-DCrxWCTv.d.mts} +2 -2
  7. package/dist/{index-B2ru1zGQ.d.mts → index-DJ--zcWG.d.mts} +4 -4
  8. package/dist/mcp.d.mts +1 -1
  9. package/dist/mcp.mjs +1 -1
  10. package/dist/{mount--YHrgRHJ.mjs → mount-BEBJ2Tss.mjs} +13 -19
  11. package/dist/mount-BEBJ2Tss.mjs.map +1 -0
  12. package/dist/runtime-support.d.mts +1 -1
  13. package/dist/runtime-support.mjs +5 -5
  14. package/dist/runtime-support.mjs.map +1 -1
  15. package/dist/server.d.mts +2 -2
  16. package/dist/server.mjs +2 -2
  17. package/dist/{src-DtSY5fzY.mjs → src-ChDFqZaE.mjs} +6 -6
  18. package/dist/{src-DtSY5fzY.mjs.map → src-ChDFqZaE.mjs.map} +1 -1
  19. package/dist/{src-DX2xrplP.mjs → src-D9pLpfeO.mjs} +2 -2
  20. package/dist/src-D9pLpfeO.mjs.map +1 -0
  21. package/docs/CONTEXT.md +108 -0
  22. package/docs/README.md +28 -0
  23. package/docs/internal/README.md +16 -0
  24. package/docs/internal/adr/0001-capability-is-the-semantic-boundary.md +24 -0
  25. package/docs/internal/architecture.md +126 -0
  26. package/docs/internal/capability-first-model.md +154 -0
  27. package/docs/internal/implementation-friction.md +674 -0
  28. package/docs/internal/why-capable.md +94 -0
  29. package/docs/site/capable-orpc-and-trpc.mdx +133 -0
  30. package/docs/site/concepts/apps.mdx +217 -0
  31. package/docs/site/concepts/architecture.mdx +75 -0
  32. package/docs/site/concepts/capabilities.mdx +249 -0
  33. package/docs/site/concepts/errors.mdx +93 -0
  34. package/docs/site/hosting/any-fetch-host.mdx +74 -0
  35. package/docs/site/hosting/next-js.mdx +77 -0
  36. package/docs/site/hosting/standalone-server.mdx +94 -0
  37. package/docs/site/introduction.mdx +142 -0
  38. package/docs/site/patterns/composition.mdx +142 -0
  39. package/docs/site/patterns/remote-apps.mdx +117 -0
  40. package/docs/site/patterns/subscriptions.mdx +87 -0
  41. package/docs/site/quickstart.mdx +293 -0
  42. package/docs/site/reference/packages-and-entry-points.mdx +70 -0
  43. package/docs/site/reference/surface-metadata.mdx +84 -0
  44. package/docs/site/reference/the-cap-cli.mdx +81 -0
  45. package/docs/site/surfaces/ai-sdk.mdx +94 -0
  46. package/docs/site/surfaces/cli.mdx +138 -0
  47. package/docs/site/surfaces/eve.mdx +121 -0
  48. package/docs/site/surfaces/http-and-openapi.mdx +111 -0
  49. package/docs/site/surfaces/mcp.mdx +97 -0
  50. package/docs/site/surfaces/react-query.mdx +80 -0
  51. package/docs/site/surfaces/typescript.mdx +123 -0
  52. package/docs/site/surfaces.mdx +78 -0
  53. package/docs/site/why-capable.mdx +99 -0
  54. package/package.json +13 -3
  55. package/src/package.test.ts +101 -0
  56. package/dist/mount--YHrgRHJ.mjs.map +0 -1
  57. package/dist/src-DX2xrplP.mjs.map +0 -1
@@ -0,0 +1,142 @@
1
+ ---
2
+ title: "Introduction"
3
+ description: "Capable turns one typed capability into a typed client, an HTTP API, a CLI, and agent tools."
4
+ ---
5
+
6
+ import { DocsPage, docMetadata } from "./_components/docs-page";
7
+ import { Card, Cards } from "./_components/cards";
8
+
9
+ export const metadata = docMetadata("/", frontmatter);
10
+
11
+ <DocsPage href="/" frontmatter={frontmatter}>
12
+
13
+ Most applications end up implementing the same capability several times: once for the product UI, once as a public HTTP route, once as a CLI command, and once as a tool for an agent. Capable gives that capability a single definition — a **capability** — and lets you use it across every surface.
14
+
15
+ ## Define one capability [#capability]
16
+
17
+ Start with an id, an optional input schema, and a handler. TypeScript infers the handler's output type. Schemas use the Standard Schema interface, so Capable is not tied to the Zod authoring API shown here. A capability has no HTTP method, no command name, and no framework attached.
18
+
19
+ ```ts title="capable.app.ts"
20
+ import { defineApp, capability } from "capable-kit";
21
+ import { z } from "zod";
22
+
23
+ const createTodo = capability({
24
+ id: "todos.create",
25
+ input: z.object({ title: z.string().min(1) }),
26
+ handler: ({ input }) => ({ id: "1", title: input.title }),
27
+ });
28
+
29
+ export default defineApp({
30
+ name: "Todos",
31
+ version: "1.0.0",
32
+ capabilities: {
33
+ todos: { create: createTodo },
34
+ },
35
+ });
36
+ ```
37
+
38
+ Add a portable `output` schema, effect metadata, declared errors, middleware, descriptions, or presentation metadata only when the capability needs the behavior they enable.
39
+
40
+ Capabilities are composed into an _app_: an ordinary named object tree. The path `todos.create` is how callers navigate to the capability. The id `todos.create` is its permanent execution identity, which is what remote calls and conflict detection use. Add context, errors, middleware, and `group()` only when a subtree needs them.
41
+
42
+ ## Run it [#run]
43
+
44
+ `cap dev` discovers `capable.app.ts` and serves the derived surfaces.
45
+
46
+ ```sh title="terminal"
47
+ $ cap dev
48
+
49
+ ◆ Todos 1.0.0
50
+
51
+ Local http://localhost:3000
52
+ Capable /_capable
53
+ HTTP /api
54
+ OpenAPI /openapi.json
55
+ MCP /mcp
56
+
57
+ ✓ 1 capability ready, watching for changes
58
+ ```
59
+
60
+ The same `title` input reaches the capability through a flag or a JSON body — no extra code to write.
61
+
62
+ ```sh title="terminal"
63
+ # The capability as a command
64
+ cap cli todos create --title "Read the docs"
65
+
66
+ # The same capability as a derived HTTP route
67
+ curl -X POST localhost:3000/api/todos/create \
68
+ -H 'content-type: application/json' \
69
+ -d '{"title":"Read the docs"}'
70
+ ```
71
+
72
+ That one file is also an MCP endpoint at `/mcp`, so an agent can connect and call `todos__create` with the same input schema. Every surface reads the same tree and contracts, so one capability shows up consistently everywhere:
73
+
74
+ | Surface | What todos.create becomes |
75
+ | --- | --- |
76
+ | TypeScript | `await app.todos.create({ title })` |
77
+ | HTTP | `POST /api/todos/create` |
78
+ | OpenAPI | `/openapi.json` |
79
+ | CLI | `todos create --title "..."` |
80
+ | MCP | `todos__create` |
81
+ | React Query | `query.todos.create.mutationOptions()` |
82
+
83
+ Nothing is exposed implicitly. A surface exists because you mounted it, and you can narrow the tree per boundary with `selectApp()`.
84
+
85
+ ## Use it programmatically [#programmatic]
86
+
87
+ No toolchain required. The app is an ordinary typed object — call it from a script, a server action, or a test, and the same validation, middleware, and errors apply.
88
+
89
+ ```ts title="app.ts"
90
+ import { createApp } from "capable-kit";
91
+ import definition from "./capable.app";
92
+
93
+ const app = createApp(definition);
94
+
95
+ const todo = await app.todos.create({ title: "Read the docs" });
96
+ ```
97
+
98
+ To get a surface instead of a call, hand the same `app` to `createCli`, `createMcp`, or `createReactQuery`. A surface is just a function that takes an app.
99
+
100
+ To call a deployed app instead, swap `createApp` for `createRemoteApp`. Types come from a type-only import of the definition, so there is still no generated client, and every surface works the same over a transport.
101
+
102
+ ```ts title="remote.ts"
103
+ import { createRemoteApp } from "capable-kit";
104
+ import { createHttpTransport } from "capable-kit/http";
105
+ import type definition from "./capable.app";
106
+
107
+ const app = createRemoteApp<typeof definition>(
108
+ createHttpTransport({ url: "https://todos.example.com/_capable/" }),
109
+ );
110
+
111
+ // Identical call, executed on the server.
112
+ const todo = await app.todos.create({ title: "Read the docs" });
113
+ ```
114
+
115
+ ## What Capable is not [#scope]
116
+
117
+ - **Not a replacement for your web framework.** Mount Capable in Next.js, Hono, H3, or any Fetch-compatible server — or run it as a standalone service.
118
+ - **No generated client required.** Typed calls, commands, and tools are derived from the same capability definitions and schemas.
119
+ - **Not tied to one protocol.** HTTP, the Capable transport, MCP, CLI, and in-process tools are projections of the same protocol-neutral capabilities.
120
+
121
+ > **Early development**
122
+ >
123
+ > The documented APIs are implemented and tested, but breaking changes are expected.
124
+
125
+ ## Where to go next [#next]
126
+
127
+ <Cards>
128
+ <Card href="/quickstart" title="Quickstart">
129
+ Build, run, and deploy an app in four steps.
130
+ </Card>
131
+ <Card href="/concepts/capabilities" title="Capabilities">
132
+ The execution lifecycle every caller shares.
133
+ </Card>
134
+ <Card href="/surfaces" title="Surfaces">
135
+ Pick the interfaces your product actually needs.
136
+ </Card>
137
+ <Card href="/why-capable" title="Why Capable">
138
+ The problem this model is trying to remove.
139
+ </Card>
140
+ </Cards>
141
+
142
+ </DocsPage>
@@ -0,0 +1,142 @@
1
+ ---
2
+ title: "Composition"
3
+ description: "Merge local and remote apps into one typed tree, and narrow it per boundary."
4
+ ---
5
+
6
+ import { DocsPage, docMetadata } from "../../_components/docs-page";
7
+
8
+ export const metadata = docMetadata("/patterns/composition", frontmatter);
9
+
10
+ <DocsPage href="/patterns/composition" frontmatter={frontmatter}>
11
+
12
+ A remote app and a local app are the same thing — a typed callable tree — backed by different sources. You merge them when one process needs both: a CLI that drives a server API but also touches this machine's files, credentials, or processes.
13
+
14
+ ## The remote app [#remote]
15
+
16
+ The product API, on a server. `createRemoteApp()` takes the server definition as a type parameter, so the client is typed without code generation. It returns immediately; the Capable transport manifest is fetched and validated on the first call. See [remote apps](/patterns/remote-apps).
17
+
18
+ ```ts title="remote.ts"
19
+ import { createRemoteApp } from "capable-kit";
20
+ import { createHttpTransport } from "capable-kit/http";
21
+ import type definition from "../server/capable.app";
22
+
23
+ // The product API, running on a server. Typed from the server
24
+ // definition, no client generated. Talks to the Capable transport.
25
+ export const remote = createRemoteApp<typeof definition>(
26
+ createHttpTransport({ url: "https://todos.example.com/_capable/" }),
27
+ );
28
+ ```
29
+
30
+ ## The local app [#local]
31
+
32
+ A capability that _must_ run here. Reading a file from disk, writing a token to `~/.config`, or starting a local process can't live on the server, so they become local capabilities. A local capability can still orchestrate the remote app through its typed tree.
33
+
34
+ ```ts title="import-todos.ts"
35
+ import { capability } from "capable-kit";
36
+ import { readFile } from "node:fs/promises";
37
+ import { z } from "zod";
38
+ import { remote } from "./remote";
39
+
40
+ // This Capability reads a file on this machine, then calls the server.
41
+ // It cannot live on the server — the file is not there.
42
+ const localTodoCapability = capability.withContext<{
43
+ remote: typeof remote;
44
+ }>();
45
+
46
+ export const importTodos = localTodoCapability({
47
+ id: "todos.import",
48
+ title: "Import todos from a file",
49
+ effect: "write",
50
+ input: z.object({ file: z.string() }),
51
+ meta: { cli: { positional: ["file"] } },
52
+ handler: async ({ input, context }) => {
53
+ const lines = (await readFile(input.file, "utf8"))
54
+ .split("\n")
55
+ .filter(Boolean);
56
+ for (const title of lines) {
57
+ await context.remote.todos.create({ title });
58
+ }
59
+ return { imported: lines.length };
60
+ },
61
+ });
62
+ ```
63
+
64
+ ```ts title="local.ts"
65
+ import { createApp, defineApp } from "capable-kit";
66
+ import { importTodos } from "./import-todos";
67
+ import { remote } from "./remote";
68
+
69
+ const localDefinition = defineApp({
70
+ name: "Local",
71
+ capabilities: {
72
+ todos: {
73
+ import: importTodos,
74
+ },
75
+ },
76
+ });
77
+
78
+ export const local = createApp(localDefinition, {
79
+ context: () => ({ remote }),
80
+ });
81
+ ```
82
+
83
+ Both definitions compose named capabilities under the same `todos` path. When the apps are merged, those branches combine — `todos list` and `todos create` from the server, `todos import` from here.
84
+
85
+ ## Merge them into one CLI [#merge]
86
+
87
+ `mergeApps()` combines the two apps into one. Calls dispatch by capability id to whichever app owns them. No proxy server, no logic moved — the import runs in this process, the creates run on the server.
88
+
89
+ ```ts title="cli.ts"
90
+ import { mergeApps } from "capable-kit";
91
+ import { createCli } from "capable-kit/cli";
92
+ import { remote } from "./remote";
93
+ import { local } from "./local";
94
+
95
+ // One command tree. Calls dispatch by capability id to whichever
96
+ // app owns them — the server for list and create, this process for import.
97
+ const app = mergeApps(remote, local);
98
+
99
+ process.exit(
100
+ await createCli(app, { invocationName: "mycli" }).run(process.argv.slice(2)),
101
+ );
102
+ ```
103
+
104
+ ```sh title="terminal"
105
+ mycli todos --help
106
+
107
+ todos
108
+
109
+ Usage
110
+ mycli todos <command> [options]
111
+
112
+ Commands
113
+ list List todos # runs on the server
114
+ create Create a todo # runs on the server
115
+ import <file> Import todos from a file # runs here
116
+
117
+ mycli todos import ./todos.txt
118
+ # { "imported": 2 }
119
+ ```
120
+
121
+ Path collisions, duplicate ids, and leaf/subtree conflicts fail when the merged manifest first resolves, not at call time. Namespaces belong in the app definitions, so the final command tree stays visible in source.
122
+
123
+ > **Placement stays explicit**
124
+ >
125
+ > Merging makes calling uniform, not location-transparent. Each capability still executes where it was created — behind the server's context and policy, or in this process. The CLI does not hide which is which; the source code does.
126
+
127
+ ## Narrow what a surface sees [#select]
128
+
129
+ The same merged tree can feed more than one surface. Before handing it to an agent, narrow it with `selectApp()`. An omitted `include` means everything; `exclude` wins.
130
+
131
+ ```ts title="agent-surface.ts"
132
+ import { selectApp } from "capable-kit";
133
+
134
+ // Keep destructive capabilities away from this surface.
135
+ const agentApp = selectApp(app, {
136
+ include: { todos: { list: true, get: true } },
137
+ });
138
+
139
+ await createMcp(agentApp);
140
+ ```
141
+
142
+ </DocsPage>
@@ -0,0 +1,117 @@
1
+ ---
2
+ title: "Remote Apps"
3
+ description: "Use the same typed tree when capabilities execute in another process or deployment."
4
+ ---
5
+
6
+ import { DocsPage, docMetadata } from "../../_components/docs-page";
7
+
8
+ export const metadata = docMetadata("/patterns/remote-apps", frontmatter);
9
+
10
+ <DocsPage href="/patterns/remote-apps" frontmatter={frontmatter}>
11
+
12
+ A capability describes what something does. It says nothing about where it runs. That is why the same definition can be instantiated as a local app in one process and as a remote app in another, and why the caller writes the same line of code in both.
13
+
14
+ ## Local and remote placement [#two-instantiations]
15
+
16
+ `createApp()` places the capabilities in this process. `createRemoteApp()` places them somewhere else, behind a transport. Both return the same typed tree.
17
+
18
+ ```ts title="apps.ts"
19
+ import { createApp, createRemoteApp } from "capable-kit";
20
+ import { createHttpTransport } from "capable-kit/http";
21
+ import type definition from "./capable.app";
22
+
23
+ // Runs here, in this process.
24
+ const local = createApp(definition);
25
+
26
+ // Runs there, behind someone else's context and policy.
27
+ const remote = createRemoteApp<typeof definition>(
28
+ createHttpTransport({ url: "https://todos.example.com/_capable/" }),
29
+ );
30
+
31
+ // The calling code cannot tell them apart.
32
+ export async function openTodos(app: typeof local | typeof remote) {
33
+ return app.todos.list({ status: "open" });
34
+ }
35
+ ```
36
+
37
+ | | createApp() | createRemoteApp() |
38
+ | --- | --- | --- |
39
+ | Needs | The implementation, and context only if one is declared | A transport, and the definition as a type |
40
+ | Executes | In this process | Wherever the server placed it |
41
+ | Manifest | Derived from the definition | Fetched once, then cached, on first call |
42
+ | Failure mode | Throws from the handler | Also transport errors |
43
+
44
+ > **No code generation**
45
+ >
46
+ > The consumer imports `type definition`only. Types are erased at build time, so no server code, no dependency, and no generated client ends up in the caller. Ship the definition's types in a package and any consumer can be typed against it.
47
+
48
+ ## What crosses the boundary [#boundary]
49
+
50
+ Two things: the [manifest](/concepts/apps#manifest), which describes the tree — ids, titles, effects, JSON Schemas, declared errors — and individual calls addressed by capability id. Paths are navigation, so renaming a group does not break a client; the id is the contract.
51
+
52
+ A server exposes both with the `protocol()` mount. Nothing else is required to make an app consumable from anywhere.
53
+
54
+ ```ts title="capable.server.ts"
55
+ import { protocol, createServer } from "capable-kit/server";
56
+ import definition from "./capable.app";
57
+
58
+ export default createServer(definition, {
59
+ context: ({ request }) => contextFromRequest(request),
60
+ mounts: [protocol({ path: "/_capable" })],
61
+ });
62
+ ```
63
+
64
+ Because surfaces are built from the manifest, a remote app can produce the same [CLI](/surfaces/cli), [MCP tools](/surfaces/mcp), or [React Query](/surfaces/react-query) bindings as a local one. The projection never learns where execution happens.
65
+
66
+ ## Transports [#transports]
67
+
68
+ HTTP is the transport that ships, but it is not privileged. `ApplicationTransport` is an interface with `manifest()`, `call()`, and `subscribe()`, so "remote" can mean a worker, a child process, a message queue, a browser extension port, or a stub in a test.
69
+
70
+ ```ts title="worker-transport.ts"
71
+ import type { ApplicationTransport } from "capable-kit/app";
72
+
73
+ // Three methods. Anything that can move JSON can back an App.
74
+ export function createWorkerTransport(worker: Worker): ApplicationTransport {
75
+ return {
76
+ manifest: (options) => send(worker, { kind: "manifest" }, options),
77
+ call: (call) => send(worker, { kind: "call", call }),
78
+ subscribe: (call) => stream(worker, call),
79
+ };
80
+ }
81
+ ```
82
+
83
+ ```ts title="main.ts"
84
+ import { createRemoteApp } from "capable-kit";
85
+ import type definition from "./capable.app";
86
+
87
+ const app = createRemoteApp<typeof definition>(
88
+ createWorkerTransport(new Worker("./worker.js")),
89
+ );
90
+
91
+ await app.image.resize({ url, width: 512 }); // runs off the main thread
92
+ ```
93
+
94
+ ## Credentials and base URLs [#credentials]
95
+
96
+ The transport owns everything about reaching the server, so capabilities never see tokens or hostnames. Both `url` and `headers` accept a function, which is resolved per request — enough for token refresh, environment switching, or per-tenant routing.
97
+
98
+ ```ts title="transport.ts"
99
+ createHttpTransport({
100
+ url: () => `${process.env.API_URL}/_capable/`,
101
+ headers: async () => ({ authorization: `Bearer ${await accessToken()}` }),
102
+ });
103
+ ```
104
+
105
+ ## Choosing where a capability runs [#honesty]
106
+
107
+ Calling is uniform; placement is still a decision you make in source. A remote call is a network call, with the latency and failure modes that implies, and it runs under the server's context and policy rather than yours. Capable does not pretend otherwise — it only removes the boilerplate between the two.
108
+
109
+ | Put it here | Put it there |
110
+ | --- | --- |
111
+ | It touches this machine: files, credentials, local processes | It touches shared state: a database, a queue, another service |
112
+ | It needs to work offline or without a server | It enforces authorization the client must not be trusted with |
113
+ | Latency per call matters more than trust | The implementation must not ship to the caller |
114
+
115
+ When one process needs both, merge them: [composition](/patterns/composition) combines a remote app and a local app into a single tree that dispatches each call to whichever app owns it.
116
+
117
+ </DocsPage>
@@ -0,0 +1,87 @@
1
+ ---
2
+ title: "Subscriptions"
3
+ description: "Give a read capability a second execution mode that emits complete replacements."
4
+ ---
5
+
6
+ import { DocsPage, docMetadata } from "../../_components/docs-page";
7
+
8
+ export const metadata = docMetadata("/patterns/subscriptions", frontmatter);
9
+
10
+ <DocsPage href="/patterns/subscriptions" frontmatter={frontmatter}>
11
+
12
+ A `read` capability can define `subscribe` beside its `handler`. Both modes share one id, input, output, error set, middleware, placement, and metadata — so a subscription is not a second capability, it is a second way to execute the same one.
13
+
14
+ ## Add a subscriber [#define]
15
+
16
+ `watchQuery()` is the common shape: read a snapshot, then re-read it whenever an invalidation source signals a change. It pulls the invalidation iterator before reading the first snapshot, so a change that races with the read produces another snapshot instead of being lost.
17
+
18
+ ```ts title="capabilities.ts"
19
+ import { capability, watchQuery } from "capable-kit";
20
+ import { z } from "zod";
21
+
22
+ const todoCapability = capability.withContext<TodoContext>();
23
+
24
+ export const listTodos = todoCapability({
25
+ id: "todos.list",
26
+ effect: "read",
27
+ output: z.array(Todo),
28
+ handler: ({ context }) => context.todos.list(),
29
+ subscribe: ({ context, signal }) =>
30
+ watchQuery({
31
+ snapshot: () => context.todos.list(),
32
+ invalidations: () => context.todos.changes({ signal }),
33
+ signal,
34
+ }),
35
+ });
36
+ ```
37
+
38
+ An async generator works too when there is nothing to watch:
39
+
40
+ ```ts title="capabilities.ts"
41
+ subscribe: async function* ({ signal }) {
42
+ while (!signal.aborted) {
43
+ yield { now: new Date().toISOString() };
44
+ await wait(1000, signal);
45
+ }
46
+ },
47
+ ```
48
+
49
+ ## Consume it [#consume]
50
+
51
+ `subscribe()` takes a capability call from an app, which keeps app navigation free of extra method names. It works the same against local, remote, merged, and selected apps.
52
+
53
+ ```ts title="watch.ts"
54
+ import { subscribe } from "capable-kit";
55
+
56
+ const updates = subscribe(app.todos.list, {}, { signal });
57
+
58
+ for await (const todos of updates) {
59
+ render(todos); // a complete, validated list every time
60
+ }
61
+ ```
62
+
63
+ Input is parsed once. Every emitted item is validated against the output schema, middleware encloses the whole iterator lifetime, and cancelling the signal aborts the subscriber before cleanup runs.
64
+
65
+ ## Over the wire [#transport]
66
+
67
+ The Capable transport encodes subscriptions as server-sent events at `POST /_capable/subscribe/:id`. Errors raised before the first replacement are ordinary HTTP errors; a terminal error after streaming began arrives as a typed SSE error frame.
68
+
69
+ ```sh title="terminal"
70
+ curl -N -X POST \
71
+ -H 'accept: text/event-stream' \
72
+ -H 'content-type: application/json' \
73
+ --data '{"input":{}}' \
74
+ http://localhost:3000/_capable/subscribe/todos.list
75
+ ```
76
+
77
+ The CLI exposes the same mode with `--watch`, and [React Query](/surfaces/react-query) exposes it as `liveQueryOptions()`. MCP always calls the unary snapshot.
78
+
79
+ ## What this is not [#scope]
80
+
81
+ > **Deliberately out of scope**
82
+ >
83
+ > Replacement subscriptions are not an event system. There are no patches, no domain events, no buffering, no replay, no resumption, no delivery guarantees, and no reconnection policy. Every item is a complete replacement of the canonical output.
84
+
85
+ That constraint is what keeps one capability honest across surfaces: a consumer that can render the unary result can render every update without additional state.
86
+
87
+ </DocsPage>