@runa-cmd/mcp 0.2.0-beta.6 → 0.2.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/CHANGELOG.md CHANGED
@@ -1,5 +1,481 @@
1
1
  # @runa-cmd/mcp
2
2
 
3
+ ## 0.2.0
4
+
5
+ ### Minor Changes
6
+
7
+ - 5f03fdf: Production hardening for the first beta. Five behavior changes, one platform change, and a set of additive APIs. Read the migration notes — two of the changes can turn previously-silent misbehavior into hard errors.
8
+
9
+ **Behavior changes (migration guidance included)**
10
+
11
+ 1. **Unknown options are now rejected (exit 2)** — previously a typo'd flag (`--forse`) was silently ignored. Parsing now fails with `Unknown option: --forse` plus a did-you-mean suggestion when a defined flag is within edit distance 3. Escape hatch: `defineCLI({ ..., strictOptions: false })` restores the old lenient behavior one line at a time while you fix call sites.
12
+
13
+ 2. **Empty-string values for number options are now rejected (exit 2)** — previously `--port ""`, an empty env var, or an empty config value coerced to `0` (`Number('') === 0`). All three resolution sources (CLI arg, env var, config file) now fail with `Invalid value for --port: expected number`. No escape hatch: the old behavior fabricated data. A legitimate `0` (e.g. `--port 0` or a config number `0`) still passes.
14
+
15
+ 3. **`helpPlugin()` no longer calls `process.exit(0)`** — after rendering help it short-circuits the lifecycle and lets the process exit naturally with code 0. Terminal users see no difference; embedders (tests, MCP hosts, programmatic `cli.run()` callers) now get the promise resolved and cleanup hooks always run. Restore the old forced exit with `helpPlugin({ exitOnHelp: true })`.
16
+
17
+ 4. **Tokens after `--` are no longer positionals** — everything after the first standalone `--` is delivered verbatim in the new `ctx.rest: string[]` (empty array when no `--` is present), unvalidated and exempt from strict option checking. Global flags after `--` are no longer intercepted (`mycli exec -- --help` runs `exec` instead of rendering help). CLIs that accidentally relied on post-`--` tokens filling schema-validated positionals must drop the `--`.
18
+
19
+ 5. **Global/command option collisions now throw at startup** — if a plugin-registered (or statically declared) global option's name or alias overlaps any command's option name or alias, `cli.run()` fails fast with a `RunaError` (code `OPTION_COLLISION`, exit 1) naming the option, the plugin, and the command — previously the global extractor silently stole the token. Fix: rename one of the two options or drop the conflicting alias.
20
+
21
+ **Platform change**
22
+
23
+ 6. **Node >= 24 required** — `engines` is now `">=24.0.0"` across all packages. Node 18, 20, and 22 are dropped: 18 and 20 are end-of-life, and the toolchain floor (vitest 4) cannot even test them. CI runs the full suite on Linux and Windows under Node 24.
24
+
25
+ **Additive API surface**
26
+
27
+ - `ctx.rest: string[]` on `RunContext` — pass-through tokens after `--`.
28
+ - `CLIConfig.strictOptions?: boolean` (default `true`) — the rollback hatch for change 1.
29
+ - `HelpPluginOptions.exitOnHelp?: boolean` (default `false`) — the rollback hatch for change 3.
30
+ - `SchemaAdapter` / `SchemaDescription` exported as types from `@runa-cmd/core` — Zod v4 introspection is now confined behind an adapter seam (internal refactor, no public behavior change).
31
+ - `OPTION_COLLISION` error code on `RunaError` (change 5).
32
+ - Failures inside `onError` and `cleanup` hook handlers are now logged to stderr (`runa: onError handler threw: ...`) instead of being silently swallowed; the original error still drives the exit code and cleanup still runs.
33
+
34
+ - 1ddc91c: Boolean options now follow CLI > env > config > default.
35
+
36
+ - **Env and config are honored.** A boolean with `.default()` used to ignore both silently: `MINIFY=true` gave `false`. The schema default no longer reaches `parseArgs`, so it applies last.
37
+ - **Booleans accept `true`, `1`, `false` and `0`,** in any case, from every source. `MINIFY=true` on an optional boolean used to fail, and `--minify=false` used to exit 2.
38
+ - **Any other value is a usage error (exit 2).** Before, `MINIFY=quizas` on a boolean with a default was silently ignored.
39
+
40
+ **Migration:** an env var or config value that was being ignored now takes effect, and an invalid one now fails. Check the boolean options of your CLI that declare `env`.
41
+
42
+ - 1d071a9: Each package now ships its `CHANGELOG.md`, so you can read what changed from `node_modules`.
43
+ - 763a1a2: Authors now choose what an MCP server exposes. `mcpPlugin({ exclude: ['deploy'] })` removes a tool, so it can't be listed or called. Per tool, `tools: { deploy: { description, annotations } }` replaces what the model reads and passes MCP annotations like `destructiveHint` to the client.
44
+
45
+ Annotations are hints, not access control: `exclude` is the only real boundary. An unknown name in `exclude`, an excluded tool with settings, or a tool both read-only and destructive stop the server at startup.
46
+
47
+ - edfb79e: Clearer usage errors, and an API where every field does something.
48
+
49
+ - **Missing values are reported as such.** `--label` without a value now says `Option --label requires a value`. `--tag --force` no longer takes `--force` as the value of `--tag`; it used to drop the flag silently.
50
+ - **Extra positionals on a command without args exit 2** instead of 1, with the usual message.
51
+ - **Suggestions scale with the input,** so `--nope` no longer suggests `--size`, while real typos still get one.
52
+ - **Shorter errors:** `Missing required argument: <content>`, without repeating the name or the description. The same goes for missing options.
53
+ - **Usage errors point to the next step** with `Run '<cli> --help' for usage.`
54
+ - **Invalid `output` names the command and the field** instead of dumping Zod's JSON. It uses the code `INVALID_OUTPUT`.
55
+ - **`deprecated` warns when the option is used,** from the CLI, env or config. The command still runs.
56
+ - **Help omits `[default: false]`.**
57
+
58
+ **Breaking changes in the API**
59
+
60
+ - **`hint` is gone** from `OptionMeta` and `OptionSchema`: it had no effect. Remove it from your `meta.options`.
61
+ - **`PluginMeta.version` is optional,** and the official plugins no longer declare it. Nothing reads it; use `peerDependencies` for compatibility.
62
+
63
+ **Migration:** a value that looks like a registered flag now needs the `=` form: `--label=--force`. If you match error text, note the shorter messages.
64
+
65
+ - 2b3d392: Hooks, middleware and `run()` now get the whole path of the command, as `command.path`. `tag add` and `add` both had the name `add`, so a permissions or audit plugin couldn't tell them apart. Middleware also gets `command`, which it didn't have. `command.name` doesn't change.
66
+ - 4b6b197: `tool: false` keeps a command out of the MCP server, from its definition. It's for commands that only make sense at a terminal.
67
+
68
+ **Breaking:** `completions` is no longer a tool. A shell script means nothing to a model, and it took an `exclude` to hide it. An `exclude` that names it stays valid, and settings for it in `tools` now fail at startup.
69
+
70
+ - 6ae4563: Completions now work the way they're suggested, with any text.
71
+
72
+ `eval "$(tool completions zsh)"` used to fail on every shell start. The script now registers itself with `compdef`, so it works in a `.zshrc` after `compinit`, as well as from a file in `fpath`.
73
+
74
+ In zsh, a `]` in a description used to end it early, and what followed was run as a command when pressing TAB, so `Mode [x]: fast` left the option without completion and could run `mode`. Brackets and colons are now escaped.
75
+
76
+ An enum value with a space, like `very slow`, used to be split in two candidates in bash, zsh and fish. It's now one.
77
+
78
+ CI runs the generated scripts in the real shells.
79
+
80
+ - eed18ff: A value in the config file now reaches one command, and nothing is ignored. A key used to apply to every option with that name: `{"force":true}` turned on `--force` in any command.
81
+
82
+ **Breaking:** the shape of the file changed. A key at the root is a global option or a command, and groups nest. With `runCLI`, options stay at the root.
83
+
84
+ **Migration:** move each option under its command.
85
+
86
+ ```json
87
+ // Before
88
+ { "force": true, "priority": "high" }
89
+
90
+ // After
91
+ { "clear": { "force": true }, "tag": { "add": { "priority": "high" } } }
92
+ ```
93
+
94
+ An unknown key now exits with 2, naming the file and the key, with a suggestion if there's a close one. `$schema` is accepted. An invalid value names the file and the key too, as in `notes.config.json: invalid value for 'list.priority'`, and broken JSON is reported as a problem of the file, not as an unexpected error.
95
+
96
+ A global option can't share a name with a command in a CLI with a config file: it fails at startup with `CONFIG_COLLISION`. Rename one.
97
+
98
+ Global options now read the config file. They used to ignore it without a word, even with a value of the wrong type, so a `store` in the file left the CLI writing somewhere else. They follow the same order as any option: CLI, env, config, default.
99
+
100
+ `meta.options.<key>.configurable: false` keeps an option out of the file, so a guardrail can't be turned off by a file in the current directory. `--mcp` uses it: only the terminal can start a server.
101
+
102
+ `api.getConfigValues(path)` returns the values of one command. `@runa-cmd/mcp` uses it, so a value only keeps the option of that tool away from the model.
103
+
104
+ - ee5d2ef: An option that declares `env` never reaches an MCP tool's schema, even if the variable isn't set. A forgotten `API_TOKEN` no longer becomes a parameter a model can ask a person for: the call fails with the usual error.
105
+
106
+ **Migration:** to let the model choose an option that declares `env`, add it to `mcpPlugin({ tools: { deploy: { expose: ['env'] } } })`.
107
+
108
+ - 7fd5dd6: Error codes are now a list you can import. `ERROR_CODES` from `@runa-cmd/core` has every code core throws, and the README says when each one comes up. `isRunaError(error, code?)` tells if something is a `RunaError` with that code, and works even when two copies of `@runa-cmd/core` are installed, where `instanceof` fails. It takes your own codes too, as a `CommandError`'s:
109
+
110
+ ```ts
111
+ if (isRunaError(error, ERROR_CODES.INVALID_CONFIG)) {
112
+ /* the config file is wrong */
113
+ }
114
+ if (isRunaError(error, "DEPLOY_FAILED")) {
115
+ /* your own code */
116
+ }
117
+ ```
118
+
119
+ `@runa-cmd/mcp` exports `ERROR_CLASSES`, the `class` values of a failed call, and `MCP_ERROR_CODES`, its own startup codes. Its README lists each class with its `effect`.
120
+
121
+ **Breaking:** three codes are renamed, before they're fixed for 1.0.
122
+
123
+ | Before | Now |
124
+ | ----------------------------------------------------------------- | ----------------------------------- |
125
+ | `CONFIG_INVALID` (a `ConfigError`) | `INVALID_CONFIG` |
126
+ | `OPTION_NAME`, when two keys give the same flag | `OPTION_COLLISION`, as with globals |
127
+ | `OPTION_NAME`, when a boolean `noCache` clashes with `--no-cache` | `INVALID_OPTION_NAME` |
128
+
129
+ **Migration:** compare against the new names, or against `ERROR_CODES`. Messages and exit codes don't change.
130
+
131
+ - 1ed131e: A failed MCP tool call now says what happened to the command's effects, so a model doesn't repeat what already ran. The text ends with that sentence, and `_meta['runa/error']` carries `{ class, effect, safeToRetry }`, where `effect` is `none`, `unknown` or `completed`. A command that fails partway reports `unknown`, and an invalid `output` reports that the command already ran.
132
+
133
+ Tool errors no longer include hints for people, like `RUNA_DEBUG` or `--help`, unless the operator sets `RUNA_DEBUG`. A call whose `run()` finished is now an error if the process exits with an error afterwards, and a skipped command reads `did not run` instead of `did not finish`.
134
+
135
+ - e367c5c: Cleanup always runs, and no failure exits silently.
136
+
137
+ - **`cleanup` runs on unhandled errors.** The `cleanup` hook and plugin `cleanup()` used to be skipped because `process.exit` ran first. They now finish, including async ones, before the process exits.
138
+ - **Every failure explains itself.** Typed errors (`RunaError` and subclasses) print as written. Any other error prints `Unexpected error in '<command>': <message>` and how to see more. An error without a message prints `'<command>' failed without an error message (<type>)` instead of nothing.
139
+ - **`RUNA_DEBUG=1`** adds the stack trace, error code and cause.
140
+ - **`ctx.handled` only controls the output.** Marking an error as handled used to exit 0, reporting a failure as success. The run now keeps the error's exit code. A plugin that truly recovered can set `process.exitCode = 0` in `onError`.
141
+
142
+ **Migration:** if your `onError` sets `ctx.handled = true` and your scripts rely on exit 0, set `process.exitCode = 0` there. If you match the exact text of an unexpected error on stderr, it now has a prefix.
143
+
144
+ - 8b3b8b4: A failed tool call now says what happened, not what to do. An expected `CommandError` used to tell the model "it may have taken effect. Check before retrying", even in a read-only tool, and `safeToRetry` said nothing about how often or when.
145
+
146
+ **Breaking:** `_meta['runa/error']` no longer has `safeToRetry`. It keeps `class` and `effect`.
147
+
148
+ The text only states facts: `The command did not run.`, `The command already ran.` or `The command did not finish.`. A `CommandError` reaches the model as you wrote it, with `effect: "unknown"`.
149
+
150
+ **Migration:** a client that read `safeToRetry` can read `effect`, where `none` means `run()` never started. To guide a model, say it in your error message. Retrying is up to you and whoever approves the calls: if a command fails partway, a model may run it again, so make that safe.
151
+
152
+ - ab1321c: `format` now receives the args and options, as `format(result, { args, options })`, with their types. An option that only changes the display, like `--no-truncate`, no longer has to travel in what `run()` returns, where a model and `--json` would get it too. `format(result)` keeps working.
153
+ - e92ca91: `--help` and `-h` now work with no plugin: `tool --help` and `tool db migrate --help` show plain help, with the global options that work on that command. Help and completions list `--help`, and `--version` when the CLI has a version. Usage errors always end with `Run '<cli> --help' for usage.`
154
+
155
+ A command that declares `-h` or `--help` keeps it, and the CLI starts, with or without `@runa-cmd/help`. Each flag yields separately, so `--help` still shows help on a command that took `-h`.
156
+
157
+ `getSchema()` now includes `help`, and `version` when the CLI has one, in `globalOptions`.
158
+
159
+ **Migration:** `helpPlugin` no longer registers a `help` global option, so `ctx.globalOptions.help` is gone: a plugin that read it to show its own help now uses `api.replaceHelp(show)`, with the `replaceHelp` capability. `@runa-cmd/help` no longer has `zod` as a peer dependency.
160
+
161
+ - ce76e51: The help of a command can now be copied and run. It used to show `USAGE deploy [options]`, without the CLI: now it's `tool deploy [options]`, in the built-in help and in the plugin. A variadic shows its dots, as in `<files...>`.
162
+
163
+ `styled()` and the help plugin no longer write escape codes to a pipe or with `NO_COLOR`. Colors were left out, but bold, dim, italic and underline weren't, so `tool --help > file` or `| less` got raw codes. Padding stays: it's layout.
164
+
165
+ `detectColorDepth(stream)` takes the stream to ask about, and the plugin asks about the one it writes to, which is stderr when there was nothing to run.
166
+
167
+ `CommandSchema.commandLine` says what a person types to run a command. It's set for help: `fullPath` doesn't change.
168
+
169
+ - 4d81cd4: Hooks can tell where a run comes from: `ctx.invocation` is `{ surface: 'cli' }`, or `{ surface: 'tool', tool }` for a tool call. Selecting the command and its values is now separate from running it, which doesn't change how a CLI behaves.
170
+ - 9040481: Option keys in camelCase now become kebab-case flags: `darkColor` is `--dark-color`, and `outputURL` is `--output-url`. `run()`, config files and MCP tools keep the key. A key with hyphens stays as written. Help, errors and completions show the flag, which `getSchema()` exposes in the new `flag` field of each option.
171
+
172
+ **Breaking:** `--darkColor` no longer works: it's a usage error that points to `--dark-color`. Scripts that use the camelCase form need the new one.
173
+
174
+ A boolean named `noCache` now stops the CLI at startup, because `--no-cache` already negates `cache`. Two keys that give the same flag do too.
175
+
176
+ **Migration:** rename a boolean like `noCache: z.boolean().default(false)` to `cache: z.boolean().default(true)`. Code that builds an `OptionSchema` by hand now has to include `flag`.
177
+
178
+ - a6bdd11: `@runa-cmd/mcp` leaves beta at `0.2.0`, and requires `@runa-cmd/core` `^1.0.0`. It stays at `0.x` while the rest of Runa reaches 1.0, because MCP is where the API may still change: until its own 1.0, a minor version may change its contract, as its error `class` values and its codes, and its changelog says how to migrate. It reaches 1.0 after four weeks without such changes.
179
+ - 5a40030: **Upgrading from `0.2.0-beta.0`.** Update all four packages together: `help`, `mcp` and `completions` now require this version of `core`, and npm refuses an older one.
180
+
181
+ **What people typing your CLI will notice**
182
+
183
+ | Before | Now | What to do |
184
+ | ---------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------- |
185
+ | `--darkColor` for a key `darkColor` | `--dark-color`; the camelCase form is a usage error that points to it | Update scripts and docs |
186
+ | Ctrl+C ended the process at once, with no `cleanup` | Runs `cleanup` and exits with 130; `SIGTERM` exits with 143. A command that ignores `signal` is waited for 2 seconds, and a second Ctrl+C leaves at once | Pass `signal` to what your command starts |
187
+ | `tool` with no command, or `tool db` on a group, exited with 127 | Help on stderr, exit 2 | Check scripts that compare the exit code |
188
+ | `--tag --force` took `--force` as the value of `--tag` | `Option --tag requires a value` | Use `--tag=--force` for that value |
189
+ | An extra positional on a command without args exited with 1 | Exit 2 | Check scripts that compare the exit code |
190
+ | Exact text of usage errors | Shorter, and they end with `Run '<cli> --help' for usage.` | Update anything that matches this text |
191
+
192
+ **What you need to change in your code**
193
+
194
+ | Before | Now | What to do |
195
+ | ------------------------------------------------------------------------ | ------------------------------------------------- | ------------------------------------------------------------- |
196
+ | `runCLI(cmd, argv)` | `runCLI(cmd, { argv })` | Change the call |
197
+ | A boolean named `noCache` | The CLI stops at startup | Declare `cache: z.boolean().default(true)` |
198
+ | `hint` in `meta.options` | Removed: it had no effect | Delete it |
199
+ | `ctx.globalOptions.help` | Gone: `helpPlugin` no longer adds a global option | Use `api.replaceHelp(show)` with the `replaceHelp` capability |
200
+ | `RunContext`, `HookContext` or `OptionSchema` built by hand, as in tests | They now require `signal`, and `flag` | Add them |
201
+ | `onError` with `ctx.handled = true` exited with 0 | Keeps the error's exit code | Set `process.exitCode = 0` if the plugin truly recovered |
202
+ | `defineCLI` with a single command | Still works, and warns once | Move to `runCLI`: it will be removed before 1.0 |
203
+
204
+ **Values that used to be ignored**
205
+
206
+ | Before | Now | What to do |
207
+ | -------------------------------------------------- | ------------------------------------------------------- | ------------------------------------------------ |
208
+ | A boolean with `.default()` ignored env and config | They take effect, and an invalid value exits with 2 | Check boolean options that declare `env` |
209
+ | `exec [target] -- ls -la` left `ls` in `ctx.rest` | `ls` fills `target`, and what's left goes to `ctx.rest` | Don't declare a positional for a wrapped command |
210
+ | `z.array()` options always failed | They repeat, and env splits by commas | Nothing, unless a value in env has a comma |
211
+
212
+ **If you expose your CLI over MCP**
213
+
214
+ | Before | Now | What to do |
215
+ | --------------------------------------- | ----------------------------------------------------------------------------- | -------------------------------------------------------------------- |
216
+ | Tools ran inside the server | Each call runs your CLI as a new process, about 140 ms in a minimal CLI | Don't count on state between calls |
217
+ | Options with `env` were tool parameters | They never reach the schema | Use `tools.<name>.expose` for those the model should choose |
218
+ | Output had no limit | 100 KiB by default, and a larger returned value fails with `output_too_large` | Set `maxOutput` if you need more |
219
+ | Every command was a tool | Still the default, now with `exclude` | Review which commands an agent should have, plugin commands included |
220
+
221
+ - 8030fbb: With nothing to run, a CLI now shows help on stderr and exits with 2, instead of failing with 127. That covers `tool` on a CLI with several commands, and `tool db` on a group. A name that doesn't exist is still a 127, with its suggestion.
222
+
223
+ Help now uses the same routing as running a command, so what it shows can't differ from what would run. `defineCLI` with a single command shows that command's help, and `--help` and `--version` work even if a required global option is missing.
224
+
225
+ A process stopped by a signal now exits with 130 or 143 also when the lifecycle ended early, as an MCP server does.
226
+
227
+ **Migration:** `api.replaceHelp` handlers receive a second argument, the stream to write to. Write there instead of to `process.stdout`.
228
+
229
+ - 64d3962: `defineCLI` no longer skips the command name when there's only one command. That mode depended on counting commands, so adding a plugin with a command of its own broke `tool hola`, and `tool tool` took a value for the name. It was deprecated with `RUNA_IMPLICIT_SINGLE_COMMAND`.
230
+
231
+ **Breaking:** a `defineCLI` with one command now routes as any other: `tool hola` exits with 127.
232
+
233
+ **Migration:** for a CLI of one command, use `runCLI`.
234
+
235
+ ```ts
236
+ // Before
237
+ await defineCLI({ meta: { name: "tool" }, commands: { tool } }).run();
238
+
239
+ // After
240
+ await runCLI(tool);
241
+ ```
242
+
243
+ If you'd rather keep `defineCLI`, write the command name: `tool tool hola`.
244
+
245
+ - 30e962f: A command now has one name, its key, written the same way everywhere. `meta.name` used to be required and do nothing in `defineCLI`: `commands: { withOutput }` ran as `withOutput`, whatever `meta.name` said.
246
+
247
+ **Breaking:** a key only takes lowercase letters, numbers and dashes, and anything else fails at startup with `INVALID_COMMAND_NAME`, saying the right form. `meta.name` has to match the key if you write it. An MCP tool takes the name of its command, so a renamed command is a renamed tool.
248
+
249
+ **Migration:** rename the keys that don't fit.
250
+
251
+ ```ts
252
+ // Before
253
+ commands: { withOutput }
254
+
255
+ // After
256
+ commands: { 'with-output': withOutput }
257
+ ```
258
+
259
+ `meta.name` is now optional in `defineCLI`, and `run()` and hooks still get `command.name`. `runCLI` requires it, because it names the CLI.
260
+
261
+ Options don't change: `run()` reads them by key, so `darkColor` is still `--dark-color`.
262
+
263
+ - 03f4e76: In MCP, whoever starts the server beats the model.
264
+
265
+ - **Fixed values leave the tool's schema.** An option with a value from an env var or the config file is hidden, and if a model sends it anyway, it's dropped. A required option that already has a value no longer asks the model for anything.
266
+ - **`mcpPlugin({ tools })` adjusts this per tool:** `expose` leaves an option to the model, and `serverOnly` makes the server refuse to start without a value.
267
+ - **Fixed values are redacted** from the stdout and stderr returned to the model, when they have 8 characters or more. So are the global options the server started with. What `run()` returns is left as it is.
268
+ - **`api.getConfigValues()`** lets a plugin read the config file of the CLI.
269
+
270
+ **Migration:** an option an agent used to set may disappear from its tool if env or config give it a value. Use `tools.<name>.expose` to keep it.
271
+
272
+ - db60a2d: A tool call that's missing a value only the operator gives, as an option's env var, now fails with `class: "not_configured"`, not `invalid_input`. Its text starts with `The operator of this server has to set NOTES_FILE. It isn't a value you can send.`, so a model doesn't take it as its own mistake, nor ask the user for it. The server also says it at startup, on stderr, one line per tool, and keeps serving:
273
+
274
+ ```
275
+ mcpPlugin: tool 'add' can't run until the operator sets NOTES_FILE (--file).
276
+ ```
277
+
278
+ An input error the model can fix names the key it sent, as `Invalid value for 'limit': must be greater than 0`, instead of `--limit`, a flag it never saw. The line about an operator's value still names the flag and the variable, for whoever runs the server.
279
+
280
+ **Breaking:** a plain `Error` thrown from `run()` is now `class: "crashed"`, with `The command did not finish.`, instead of `command_failed`. Only a `CommandError` is `command_failed`, with its message as you wrote it. A client can now tell a failure you foresaw from a bug, as the README always said.
281
+
282
+ **Migration:** to have the model read your message as is, throw a `CommandError`.
283
+
284
+ - ba4bdee: **Breaking:** a tool call that fails because a value the operator gave breaks its schema, in env or in the config file, now comes with `class: "not_configured"`, as a missing value does, instead of `invalid_input`. Its text says what the operator has to fix, never the value, so a model doesn't take it as its own mistake:
285
+
286
+ ```
287
+ The operator of this server has to fix 'deploy.replicas' in the config file. It isn't a value you can send.
288
+ ```
289
+
290
+ The server also says it at startup, on stderr, with the reason, and keeps serving the other tools:
291
+
292
+ ```
293
+ mcpPlugin: tool 'deploy' can't run until the operator fixes DEPLOY_ENV (--env): expected one of: staging, production.
294
+ ```
295
+
296
+ Values are checked with the rules the CLI uses, so `"5"` for a number in the config file is fine.
297
+
298
+ - 1b0d6c1: `z.array()` options now work: `--tag a --tag b` gives `['a', 'b']`, and each element is converted to its type, so `z.array(z.number())` gives numbers. Before, they always failed, even with one value.
299
+
300
+ Env values are split by commas and trimmed, so `TAGS=a, b` gives `['a', 'b']` and `TAGS=` gives `[]`. Config files use a JSON array. Each source replaces the ones below it, without adding up.
301
+
302
+ Help shows `--tag <string>...`. zsh keeps offering the option, fish says it can be repeated, and bash and fish offer the values of a `z.array(z.enum(...))`. `getSchema()` adds `itemType` to these options.
303
+
304
+ - d31ad33: A positional now gets the type of its schema. `args: { id: z.number() }` used to fail at the terminal with `expected number, received string`, although TypeScript said it was a number and it worked through MCP.
305
+
306
+ Numbers and booleans convert as in an option, in each item of a variadic too, and an empty string is still never read as 0. An invalid value says `Invalid value for <id>: expected number`.
307
+
308
+ **Migration:** if you used `z.coerce.number()` as a workaround, `z.number()` is enough now.
309
+
310
+ - 67e3865: **Breaking:** a tool call that sends an option the operator fixed now fails, and nothing runs:
311
+
312
+ ```
313
+ 'replicas' is set by the operator of this server, so it can't be sent.
314
+
315
+ The command did not run.
316
+ ```
317
+
318
+ It comes with `class: "invalid_input"` and `effect: "none"`, and never shows the operator's value. Before, the value was dropped and the call answered success with the operator's value: a model that sent `replicas: 5` got back a deploy with 2, and believed it had done what it was asked. An option that declares `env`, or has a value in the config file, is the operator's. To let the model choose it, list it in `expose`.
319
+
320
+ - b158ee6: What's left after `--` is now a usage error, unless the command asks for it. `tool a -- b` used to ignore `b` with exit 0, so data got lost in silence. `--` still fills empty positionals.
321
+
322
+ **Breaking:** a command that reads `ctx.rest` has to declare `rest: true`. Without it, `ctx.rest` is empty and the extra tokens exit with 2 and `Unexpected positional argument`.
323
+
324
+ **Migration:** add `rest: true` to commands that wrap another program. If you validated `ctx.rest` by hand to reject extras, delete that code.
325
+
326
+ `meta.options.<key>.valueName` names the value in help: `valueName: 'hex'` shows `--color <hex>` instead of `--color <string>`. It works in the built-in help and in `@runa-cmd/help`.
327
+
328
+ Clearer errors for mistyped flags:
329
+
330
+ - `--no-color` on an unknown option now says `Unknown option: --no-color`, not `--color`.
331
+ - `--no-style` on an option that takes a value now says it can't be negated.
332
+ - A typo in `--help` or `--version` gets a suggestion, and so does `-V`, which points to `--version`.
333
+
334
+ - f15d0cd: What a command returns now reaches the terminal. It used to reach MCP tools only, so at the terminal a command that returned data showed nothing and exited with 0.
335
+
336
+ A string goes to stdout as it is, and anything else as JSON. `run()` can return a value without `output`: this used to be a type error, even though it worked.
337
+
338
+ `format: (result) => string` says what a person reads. It receives the type of what `run()` returned, doesn't run for a tool, and gives the command a `--json` flag that prints the data. A command with `format` that returns nothing fails with `MISSING_RESULT`.
339
+
340
+ **Breaking:** a command that prints and also returns shows both. A command with `format` can't declare an option called `json`, and no global option can take that name while such a command exists.
341
+
342
+ **Migration:** move the printing to `format`, and delete your own `json` option.
343
+
344
+ ```ts
345
+ // Before
346
+ options: { json: z.boolean().default(false) },
347
+ run({ options }) {
348
+ const status = read();
349
+ console.log(options.json ? JSON.stringify(status) : `Port ${status.port}`);
350
+ return status;
351
+ },
352
+
353
+ // After
354
+ run: () => read(),
355
+ format: (status) => `Port ${status.port}`,
356
+ ```
357
+
358
+ Progress belongs on stderr, with `console.error`, so `--json` stays clean to pipe.
359
+
360
+ - 81ac2d6: A CLI made of one command is now first class, with `--version` and a POSIX `--`.
361
+
362
+ - **`runCLI(command, options?)` takes plugins,** plus `middleware`, `config`, `globalOptions`, `globalMeta` and `strictOptions`. Help, MCP and completions all work with it.
363
+ - **`runCLI` runs in an explicit root mode.** A value equal to the command name is data: `tool tool` passes `"tool"`. A subcommand added by a plugin routes by name, and `--` passes that name as data.
364
+ - **`--version` is built in** when `meta.version` is set, in `defineCLI` and `runCLI`. It has no short alias, and a command's own `--version` option wins.
365
+ - **`--` fills empty positionals,** as POSIX operands. A variadic counts as one, and what's left goes to `ctx.rest`.
366
+ - **`defineCLI` with one command is deprecated** when it routes implicitly. It keeps working and warns once. It will be removed before 1.0.
367
+
368
+ `CLISchema` gains an optional `root`, and `RunCLIOptions` is exported.
369
+
370
+ **Migration:**
371
+
372
+ - `runCLI(cmd, argv)` is now `runCLI(cmd, { argv })`.
373
+ - With `exec [target] -- ls -la`, `ls` now fills `target`. Commands that wrap another one should declare no positional for it, or read it from `ctx.rest`.
374
+ - With a variadic and nothing before `--`, as in `lint -- --fix`, the token now lands in the variadic instead of `ctx.rest`.
375
+
376
+ - 374b25f: Stopping a run now reaches everything it started. `run()` and hooks receive `signal`, an `AbortSignal` that fires on `SIGINT`, `SIGTERM` or a cancelled tool. `cleanup` runs in all those cases, and a CLI exits with 130 or 143.
377
+
378
+ **Behavior change:** Ctrl+C no longer ends a CLI at once. A command that ignores `signal` stops being waited for after 2 seconds, the process ends after 5 at most, and a second Ctrl+C leaves at once. A command that blocks the event loop can't react until it yields: `Ctrl+\` still ends it.
379
+
380
+ **Migration:** code that builds a `RunContext` or a `HookContext` by hand, as in unit tests, now has to include `signal`.
381
+
382
+ In MCP, cancelling a call or closing the server ends the child and what it started, and a child stops by itself if the server dies. Tool output is limited to 100 KiB by default: longer output keeps its start and end with a notice, and `maxOutput` changes the limit globally or per tool. A returned value over the limit fails with `output_too_large`.
383
+
384
+ - 0b62ebb: `testCLI()`, from `@runa-cmd/core/testing`, runs a CLI or a command through its real lifecycle without ending the process. A failing command used to kill the test runner, and capturing its output took a page of patches.
385
+
386
+ It returns the exit code, stdout, stderr, what `run()` returned, the original error, and a `trace` of what happened: where each value came from, which hooks ran and for how long, and everything written, in order. It takes `env` and `config` instead of reading the machine, and several runs can share a process without mixing their output, with `node --test` and with Vitest. A value from env stays out of `trace`, because it can be a secret.
387
+
388
+ `RUNA_DEBUG=1` now shows those steps on stderr while they happen. It never prints a value.
389
+
390
+ - 25ce70b: MCP tools now run as a child process of your own CLI, so a tool is the same command a person runs.
391
+
392
+ - **The whole lifecycle applies:** env vars, config files, startup global options, hooks and middleware. A middleware can reject a call.
393
+ - **Commands can print.** What they write no longer reaches the protocol. A returned value is the result, and without one, stdout is.
394
+ - **Calls are isolated.** Simultaneous calls don't mix, and a `process.exit` in a command only ends that call.
395
+ - **No false success.** If a command never finished, as when a middleware skips it, the tool returns an error.
396
+ - **Any input travels intact,** including arrays, objects and large values, and validation runs once, in the same place as the CLI.
397
+ - **`cleanup` runs when the server closes,** not before the first call.
398
+ - **The server checks at startup that it can run itself.** `mcpPlugin({ selfCommand })` sets how, if the check fails.
399
+
400
+ **Migration:** each call is a new process, so don't count on state shared between calls. A call now takes about 140 ms in a minimal CLI, plus whatever your CLI takes to start. `exports` of `@runa-cmd/core` gains `./internal`, which is not public API.
401
+
402
+ - b7a504b: A flag where a command should be is now a usage error. `tool --bogus` used to say `Command not found: '--bogus'` and exit with 127.
403
+
404
+ **Breaking:** it now says `Unknown option: --bogus` and exits with 2, with the same suggestions as a flag after a command, so `--verison` points to `--version`. A script that checked for 127 here has to check for 2. An unknown command still exits with 127.
405
+
406
+ ### Patch Changes
407
+
408
+ - 2d372e1: The built-in help no longer shows `(default: false)`, as `@runa-cmd/help` already didn't.
409
+ - 2ceaa41: Depends on `@modelcontextprotocol/sdk` `^1.32.2`, up from `^1.29.0`.
410
+ - 6592957: Each plugin requires the `@runa-cmd/core` it was released with. The peer of `help` was `^0.2.0-beta.1`, so npm could install it with an older `core` where `defaultDescription` and the `GLOBAL OPTIONS` section did nothing, without a warning. Until 1.0, the peer is always core's current version.
411
+
412
+ ## 0.2.0-beta.7
413
+
414
+ ### Minor Changes
415
+
416
+ - 7fd5dd6: Error codes are now a list you can import. `ERROR_CODES` from `@runa-cmd/core` has every code core throws, and the README says when each one comes up. `isRunaError(error, code?)` tells if something is a `RunaError` with that code, and works even when two copies of `@runa-cmd/core` are installed, where `instanceof` fails. It takes your own codes too, as a `CommandError`'s:
417
+
418
+ ```ts
419
+ if (isRunaError(error, ERROR_CODES.INVALID_CONFIG)) {
420
+ /* the config file is wrong */
421
+ }
422
+ if (isRunaError(error, "DEPLOY_FAILED")) {
423
+ /* your own code */
424
+ }
425
+ ```
426
+
427
+ `@runa-cmd/mcp` exports `ERROR_CLASSES`, the `class` values of a failed call, and `MCP_ERROR_CODES`, its own startup codes. Its README lists each class with its `effect`.
428
+
429
+ **Breaking:** three codes are renamed, before they're fixed for 1.0.
430
+
431
+ | Before | Now |
432
+ | ----------------------------------------------------------------- | ----------------------------------- |
433
+ | `CONFIG_INVALID` (a `ConfigError`) | `INVALID_CONFIG` |
434
+ | `OPTION_NAME`, when two keys give the same flag | `OPTION_COLLISION`, as with globals |
435
+ | `OPTION_NAME`, when a boolean `noCache` clashes with `--no-cache` | `INVALID_OPTION_NAME` |
436
+
437
+ **Migration:** compare against the new names, or against `ERROR_CODES`. Messages and exit codes don't change.
438
+
439
+ - db60a2d: A tool call that's missing a value only the operator gives, as an option's env var, now fails with `class: "not_configured"`, not `invalid_input`. Its text starts with `The operator of this server has to set NOTES_FILE. It isn't a value you can send.`, so a model doesn't take it as its own mistake, nor ask the user for it. The server also says it at startup, on stderr, one line per tool, and keeps serving:
440
+
441
+ ```
442
+ mcpPlugin: tool 'add' can't run until the operator sets NOTES_FILE (--file).
443
+ ```
444
+
445
+ An input error the model can fix names the key it sent, as `Invalid value for 'limit': must be greater than 0`, instead of `--limit`, a flag it never saw. The line about an operator's value still names the flag and the variable, for whoever runs the server.
446
+
447
+ **Breaking:** a plain `Error` thrown from `run()` is now `class: "crashed"`, with `The command did not finish.`, instead of `command_failed`. Only a `CommandError` is `command_failed`, with its message as you wrote it. A client can now tell a failure you foresaw from a bug, as the README always said.
448
+
449
+ **Migration:** to have the model read your message as is, throw a `CommandError`.
450
+
451
+ - ba4bdee: **Breaking:** a tool call that fails because a value the operator gave breaks its schema, in env or in the config file, now comes with `class: "not_configured"`, as a missing value does, instead of `invalid_input`. Its text says what the operator has to fix, never the value, so a model doesn't take it as its own mistake:
452
+
453
+ ```
454
+ The operator of this server has to fix 'deploy.replicas' in the config file. It isn't a value you can send.
455
+ ```
456
+
457
+ The server also says it at startup, on stderr, with the reason, and keeps serving the other tools:
458
+
459
+ ```
460
+ mcpPlugin: tool 'deploy' can't run until the operator fixes DEPLOY_ENV (--env): expected one of: staging, production.
461
+ ```
462
+
463
+ Values are checked with the rules the CLI uses, so `"5"` for a number in the config file is fine.
464
+
465
+ - 67e3865: **Breaking:** a tool call that sends an option the operator fixed now fails, and nothing runs:
466
+
467
+ ```
468
+ 'replicas' is set by the operator of this server, so it can't be sent.
469
+
470
+ The command did not run.
471
+ ```
472
+
473
+ It comes with `class: "invalid_input"` and `effect: "none"`, and never shows the operator's value. Before, the value was dropped and the call answered success with the operator's value: a model that sent `replicas: 5` got back a deploy with 2, and believed it had done what it was asked. An option that declares `env`, or has a value in the config file, is the operator's. To let the model choose it, list it in `expose`.
474
+
475
+ ### Patch Changes
476
+
477
+ - 6592957: Each plugin requires the `@runa-cmd/core` it was released with. The peer of `help` was `^0.2.0-beta.1`, so npm could install it with an older `core` where `defaultDescription` and the `GLOBAL OPTIONS` section did nothing, without a warning. Until 1.0, the peer is always core's current version.
478
+
3
479
  ## 0.2.0-beta.6
4
480
 
5
481
  ## 0.2.0-beta.5
package/README.md CHANGED
@@ -7,11 +7,15 @@ Every command becomes an MCP tool. Zod schemas pass directly to the MCP SDK —
7
7
  ## Install
8
8
 
9
9
  ```bash
10
- pnpm add @runa-cmd/mcp@beta
10
+ pnpm add @runa-cmd/mcp
11
11
  ```
12
12
 
13
- > Peer dependencies: `@runa-cmd/core` and `zod ^4.0.0`.
14
- > Runtime dependency: `@modelcontextprotocol/sdk ^1.29.0`.
13
+ > **Still at `0.x`.** The rest of Runa is at 1.0, and this package isn't yet: until its own 1.0, a minor version may change its contract, as its error `class` values and codes, and its changelog says how to migrate. A patch never does.
14
+
15
+ > Peer dependencies: `@runa-cmd/core ^1.0.0` and `zod ^4.0.0`.
16
+ > Runtime dependency: `@modelcontextprotocol/sdk ^1.32.2`.
17
+ >
18
+ > **New to it?** [Your CLI as an agent's tools](https://github.com/jrodrigopuca/runa-cmd/blob/main/guides/mcp.md) builds a CLI for agents step by step, and tests it as a client does.
15
19
 
16
20
  ## Quick Start
17
21
 
@@ -109,6 +113,35 @@ A failed call says what happened, not what to do next. `_meta['runa/error']` tel
109
113
 
110
114
  A `CommandError` is the exception: the model reads your message as you wrote it, with `effect: "unknown"`, because only you know what the command did. To guide the model, say it there: `throw new CommandError('The proxy is off. Start it first.')`.
111
115
 
116
+ The `class` says what failed. Each one is part of the [contract](../../VERSIONING.md), and `ERROR_CLASSES` lists them:
117
+
118
+ | `class` | `effect` | When |
119
+ |---|---|---|
120
+ | `unknown_tool` | `none` | No tool has that name, or it's excluded |
121
+ | `invalid_input` | `none` | An argument or option the model sent is missing or breaks its schema |
122
+ | `not_configured` | `none` | A value only the operator gives is missing, as an option's env var, or breaks its schema, in env or in the config file. The model can't send it nor fix it, so the text says what the operator has to set or fix |
123
+ | `rejected` | `none` | The call failed before `run()`, as in a hook or a middleware |
124
+ | `not_run` | `none` | The call ended well without running the command, because a hook or a middleware skipped it |
125
+ | `command_failed` | `unknown` | `run()` threw a `CommandError`: the failure you wrote, with your message as is |
126
+ | `crashed` | `none` or `unknown` | `run()` threw any other error, as a plain `Error`: a bug, not a failure you foresaw. Also when the process ends without saying why |
127
+ | `invalid_output` | `completed` | `run()` returned a value its `output` schema rejects |
128
+ | `output_too_large` | `completed` | The result is over `maxOutput` |
129
+ | `after_run_failed` | `completed` | Something failed after `run()` returned, as an `afterRun` hook |
130
+ | `cancelled` | `unknown` | The client cancelled the call, or the server closed |
131
+
132
+ ```ts
133
+ import { ERROR_CLASSES, type ErrorClass } from '@runa-cmd/mcp';
134
+
135
+ const retryable = (found: ErrorClass) => found === ERROR_CLASSES.CANCELLED;
136
+ ```
137
+
138
+ These stop the server at startup, with exit 1, and `MCP_ERROR_CODES` lists them. The rest of the codes are [core's](../core/README.md#error-codes):
139
+
140
+ | Code | When |
141
+ |---|---|
142
+ | `MCP_INVALID_TOOLS` | The tool settings can't be met: `exclude` or `tools` names a tool or option that doesn't exist, an excluded tool has settings, a tool is read-only and destructive, an option is exposed and server-only, a `maxOutput` isn't a positive number, or a server-only option has no value |
143
+ | `MCP_SELF_CHECK_FAILED` | The CLI can't start itself as a subprocess, as a compiled binary without `selfCommand` |
144
+
112
145
  **Retrying is up to you and whoever approves the calls.** Runa knows how far a command got, not whether repeating it is a good idea. If a command fails partway, a model only sees `unknown` and may run it again, so make that safe, or say so in your message.
113
146
 
114
147
  ### Cancellation
@@ -151,7 +184,9 @@ An unknown name in `exclude`, an excluded tool with settings, or a tool both rea
151
184
 
152
185
  ## What the Operator Decides
153
186
 
154
- Whoever starts the server beats the model. An option that declares `env`, or has a value for that command in the config file, stays out of the tool's schema, and if a model sends it anyway, it's dropped. This holds even if the env var isn't set: a missing required value fails the call, so a model can't ask anyone for it.
187
+ Whoever starts the server beats the model. An option that declares `env`, or has a value for that command in the config file, stays out of the tool's schema. If a model sends it anyway, the call fails with `class: "invalid_input"` and nothing runs: `'replicas' is set by the operator of this server, so it can't be sent.` The text never shows the operator's value. To let the model choose, list the option in `expose`. This holds even if the env var isn't set: a missing required value fails the call with `class: "not_configured"`, and its text tells the model that the operator has to set it, so it doesn't take it as its own mistake. The server also says it at startup, on stderr, which clients show in their logs: `mcpPlugin: tool 'deploy' can't run until the operator sets DEPLOY_TOKEN (--token).` It keeps serving, because the other tools work.
188
+
189
+ A value the operator gave that breaks its schema works the same way, checked with the rules the CLI uses, so `"5"` for a number is fine. The call fails with `not_configured`, and the server says at startup what to fix, without the value: `mcpPlugin: tool 'deploy' can't run until the operator fixes DEPLOY_ENV (--env): expected one of: staging, production.`, or `fixes 'deploy.replicas' in the config file: expected number.`
155
190
 
156
191
  ```ts
157
192
  mcpPlugin({
@@ -242,7 +277,7 @@ $ my-tool --mcp # Machine-readable MCP server
242
277
 
243
278
  - **Transport**: stdio (stdin/stdout JSON-RPC)
244
279
  - **Graceful shutdown**: Handles SIGINT and SIGTERM
245
- - **SDK**: Uses `@modelcontextprotocol/sdk` v1.29+ with `McpServer` API
280
+ - **SDK**: Uses `@modelcontextprotocol/sdk` v1.32+ with `McpServer` API
246
281
  - **Zod v4 native**: Zod v4 implements [Standard Schema](https://github.com/standard-schema/standard-schema), so schemas pass directly to `registerTool()` — no conversion layer
247
282
 
248
283
  ### Testing with MCP Inspector
@@ -0,0 +1,42 @@
1
+ /**
2
+ * What a failed tool call reports in `_meta['runa/error']`, and the codes this
3
+ * plugin throws at startup. Both are contract; the README lists when each one
4
+ * comes up. Core's own codes are in `ERROR_CODES` from `@runa-cmd/core`.
5
+ */
6
+ /** The `class` of a failed call: what failed. */
7
+ export declare const ERROR_CLASSES: {
8
+ /** No tool has that name, or it's excluded */
9
+ readonly UNKNOWN_TOOL: 'unknown_tool';
10
+ /** An argument or option the model sent is missing or breaks its schema */
11
+ readonly INVALID_INPUT: 'invalid_input';
12
+ /** A value only the operator gives is missing, as an option's env var */
13
+ readonly NOT_CONFIGURED: 'not_configured';
14
+ /** The call failed before run(), as in a hook or a middleware */
15
+ readonly REJECTED: 'rejected';
16
+ /** The call ended well without running the command */
17
+ readonly NOT_RUN: 'not_run';
18
+ /** run() threw a CommandError: the failure the author wrote */
19
+ readonly COMMAND_FAILED: 'command_failed';
20
+ /** run() threw any other error, or the process ended without saying why */
21
+ readonly CRASHED: 'crashed';
22
+ /** run() returned a value its output schema rejects */
23
+ readonly INVALID_OUTPUT: 'invalid_output';
24
+ /** The result is over maxOutput */
25
+ readonly OUTPUT_TOO_LARGE: 'output_too_large';
26
+ /** Something failed after run() returned */
27
+ readonly AFTER_RUN_FAILED: 'after_run_failed';
28
+ /** The client cancelled the call, or the server closed */
29
+ readonly CANCELLED: 'cancelled';
30
+ };
31
+ /** One of the classes of a failed call. */
32
+ export type ErrorClass = (typeof ERROR_CLASSES)[keyof typeof ERROR_CLASSES];
33
+ /** The codes mcpPlugin throws at startup, with exit 1. */
34
+ export declare const MCP_ERROR_CODES: {
35
+ /** The tool settings can't be met */
36
+ readonly MCP_INVALID_TOOLS: 'MCP_INVALID_TOOLS';
37
+ /** The CLI can't start itself as a subprocess */
38
+ readonly MCP_SELF_CHECK_FAILED: 'MCP_SELF_CHECK_FAILED';
39
+ };
40
+ /** One of mcpPlugin's error codes. */
41
+ export type McpErrorCode = (typeof MCP_ERROR_CODES)[keyof typeof MCP_ERROR_CODES];
42
+ //# sourceMappingURL=errors.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../src/errors.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,iDAAiD;AACjD,eAAO,MAAM,aAAa;IACzB,8CAA8C;aAC9C,YAAY,EAAE,cAAc;IAC5B,2EAA2E;aAC3E,aAAa,EAAE,eAAe;IAC9B,yEAAyE;aACzE,cAAc,EAAE,gBAAgB;IAChC,iEAAiE;aACjE,QAAQ,EAAE,UAAU;IACpB,sDAAsD;aACtD,OAAO,EAAE,SAAS;IAClB,+DAA+D;aAC/D,cAAc,EAAE,gBAAgB;IAChC,2EAA2E;aAC3E,OAAO,EAAE,SAAS;IAClB,uDAAuD;aACvD,cAAc,EAAE,gBAAgB;IAChC,mCAAmC;aACnC,gBAAgB,EAAE,kBAAkB;IACpC,4CAA4C;aAC5C,gBAAgB,EAAE,kBAAkB;IACpC,0DAA0D;aAC1D,SAAS,EAAE,WAAW;CACb,CAAC;AAEX,2CAA2C;AAC3C,MAAM,MAAM,UAAU,GAAG,CAAC,OAAO,aAAa,CAAC,CAAC,MAAM,OAAO,aAAa,CAAC,CAAC;AAE5E,0DAA0D;AAC1D,eAAO,MAAM,eAAe;IAC3B,qCAAqC;aACrC,iBAAiB,EAAE,mBAAmB;IACtC,iDAAiD;aACjD,qBAAqB,EAAE,uBAAuB;CACrC,CAAC;AAEX,sCAAsC;AACtC,MAAM,MAAM,YAAY,GAAG,CAAC,OAAO,eAAe,CAAC,CAAC,MAAM,OAAO,eAAe,CAAC,CAAC"}
package/dist/errors.js ADDED
@@ -0,0 +1,38 @@
1
+ /**
2
+ * What a failed tool call reports in `_meta['runa/error']`, and the codes this
3
+ * plugin throws at startup. Both are contract; the README lists when each one
4
+ * comes up. Core's own codes are in `ERROR_CODES` from `@runa-cmd/core`.
5
+ */
6
+ /** The `class` of a failed call: what failed. */
7
+ export const ERROR_CLASSES = {
8
+ /** No tool has that name, or it's excluded */
9
+ UNKNOWN_TOOL: 'unknown_tool',
10
+ /** An argument or option the model sent is missing or breaks its schema */
11
+ INVALID_INPUT: 'invalid_input',
12
+ /** A value only the operator gives is missing, as an option's env var */
13
+ NOT_CONFIGURED: 'not_configured',
14
+ /** The call failed before run(), as in a hook or a middleware */
15
+ REJECTED: 'rejected',
16
+ /** The call ended well without running the command */
17
+ NOT_RUN: 'not_run',
18
+ /** run() threw a CommandError: the failure the author wrote */
19
+ COMMAND_FAILED: 'command_failed',
20
+ /** run() threw any other error, or the process ended without saying why */
21
+ CRASHED: 'crashed',
22
+ /** run() returned a value its output schema rejects */
23
+ INVALID_OUTPUT: 'invalid_output',
24
+ /** The result is over maxOutput */
25
+ OUTPUT_TOO_LARGE: 'output_too_large',
26
+ /** Something failed after run() returned */
27
+ AFTER_RUN_FAILED: 'after_run_failed',
28
+ /** The client cancelled the call, or the server closed */
29
+ CANCELLED: 'cancelled',
30
+ };
31
+ /** The codes mcpPlugin throws at startup, with exit 1. */
32
+ export const MCP_ERROR_CODES = {
33
+ /** The tool settings can't be met */
34
+ MCP_INVALID_TOOLS: 'MCP_INVALID_TOOLS',
35
+ /** The CLI can't start itself as a subprocess */
36
+ MCP_SELF_CHECK_FAILED: 'MCP_SELF_CHECK_FAILED',
37
+ };
38
+ //# sourceMappingURL=errors.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"errors.js","sourceRoot":"","sources":["../src/errors.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,iDAAiD;AACjD,MAAM,CAAC,MAAM,aAAa,GAAG;IAC5B,8CAA8C;IAC9C,YAAY,EAAE,cAAc;IAC5B,2EAA2E;IAC3E,aAAa,EAAE,eAAe;IAC9B,yEAAyE;IACzE,cAAc,EAAE,gBAAgB;IAChC,iEAAiE;IACjE,QAAQ,EAAE,UAAU;IACpB,sDAAsD;IACtD,OAAO,EAAE,SAAS;IAClB,+DAA+D;IAC/D,cAAc,EAAE,gBAAgB;IAChC,2EAA2E;IAC3E,OAAO,EAAE,SAAS;IAClB,uDAAuD;IACvD,cAAc,EAAE,gBAAgB;IAChC,mCAAmC;IACnC,gBAAgB,EAAE,kBAAkB;IACpC,4CAA4C;IAC5C,gBAAgB,EAAE,kBAAkB;IACpC,0DAA0D;IAC1D,SAAS,EAAE,WAAW;CACb,CAAC;AAKX,0DAA0D;AAC1D,MAAM,CAAC,MAAM,eAAe,GAAG;IAC9B,qCAAqC;IACrC,iBAAiB,EAAE,mBAAmB;IACtC,iDAAiD;IACjD,qBAAqB,EAAE,uBAAuB;CACrC,CAAC"}
package/dist/index.d.ts CHANGED
@@ -3,6 +3,7 @@
3
3
  *
4
4
  * Barrel re-exports for the MCP plugin package.
5
5
  */
6
+ export { ERROR_CLASSES, type ErrorClass, MCP_ERROR_CODES, type McpErrorCode } from './errors.js';
6
7
  export { mcpPlugin } from './plugin.js';
7
8
  export type { McpPluginOptions, ToolOptions } from './types.js';
8
9
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AACxC,YAAY,EAAE,gBAAgB,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,OAAO,EAAE,aAAa,EAAE,KAAK,UAAU,EAAE,eAAe,EAAE,KAAK,YAAY,EAAE,MAAM,aAAa,CAAC;AACjG,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AACxC,YAAY,EAAE,gBAAgB,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC"}
package/dist/index.js CHANGED
@@ -3,5 +3,6 @@
3
3
  *
4
4
  * Barrel re-exports for the MCP plugin package.
5
5
  */
6
+ export { ERROR_CLASSES, MCP_ERROR_CODES } from './errors.js';
6
7
  export { mcpPlugin } from './plugin.js';
7
8
  //# sourceMappingURL=index.js.map
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,OAAO,EAAE,aAAa,EAAmB,eAAe,EAAqB,MAAM,aAAa,CAAC;AACjG,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC"}
@@ -10,6 +10,15 @@ export interface OperatorValues {
10
10
  type ExposureOptions = Pick<McpPluginOptions, 'exclude' | 'tools' | 'maxOutput'>;
11
11
  /** The tools as the model will see them. Fails at startup on an invalid setup. */
12
12
  export declare function applyOperatorValues(registrations: ToolRegistration[], options: ExposureOptions, values: OperatorValues): ToolRegistration[];
13
+ export declare function missingValues(reg: ToolRegistration, withFlags?: boolean): string;
14
+ /** What the model reads first: what the operator has to set, and what to fix. */
15
+ export declare function operatorNote(reg: ToolRegistration): string;
16
+ /**
17
+ * What the operator has to set or fix before each tool can run. Said at
18
+ * startup, so it doesn't wait for a model to call the tool, and the server
19
+ * keeps serving: the other tools work.
20
+ */
21
+ export declare function unconfiguredWarnings(registrations: ToolRegistration[]): string[];
13
22
  /** Hide fixed values from text a command wrote without meaning to expose them. */
14
23
  export declare function redact(text: string, values: string[]): string;
15
24
  export {};
@@ -1 +1 @@
1
- {"version":3,"file":"operator.d.ts","sourceRoot":"","sources":["../src/operator.ts"],"names":[],"mappings":"AAWA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AACpD,OAAO,KAAK,EAAE,gBAAgB,EAAe,MAAM,YAAY,CAAC;AAOhE,MAAM,WAAW,cAAc;IAC9B,0DAA0D;IAC1D,YAAY,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,SAAS,CAAC,CAAC;IACnE,GAAG,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,SAAS,CAAC,CAAC;IACxC,6CAA6C;IAC7C,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CACjC;AAED,KAAK,eAAe,GAAG,IAAI,CAAC,gBAAgB,EAAE,SAAS,GAAG,OAAO,GAAG,WAAW,CAAC,CAAC;AA4GjF,kFAAkF;AAClF,wBAAgB,mBAAmB,CAClC,aAAa,EAAE,gBAAgB,EAAE,EACjC,OAAO,EAAE,eAAe,EACxB,MAAM,EAAE,cAAc,GACpB,gBAAgB,EAAE,CAapB;AAED,kFAAkF;AAClF,wBAAgB,MAAM,CAAC,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,GAAG,MAAM,CAE7D"}
1
+ {"version":3,"file":"operator.d.ts","sourceRoot":"","sources":["../src/operator.ts"],"names":[],"mappings":"AAYA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AACpD,OAAO,KAAK,EAAE,gBAAgB,EAAe,MAAM,YAAY,CAAC;AAOhE,MAAM,WAAW,cAAc;IAC9B,0DAA0D;IAC1D,YAAY,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,SAAS,CAAC,CAAC;IACnE,GAAG,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,SAAS,CAAC,CAAC;IACxC,6CAA6C;IAC7C,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CACjC;AAED,KAAK,eAAe,GAAG,IAAI,CAAC,gBAAgB,EAAE,SAAS,GAAG,OAAO,GAAG,WAAW,CAAC,CAAC;AAqIjF,kFAAkF;AAClF,wBAAgB,mBAAmB,CAClC,aAAa,EAAE,gBAAgB,EAAE,EACjC,OAAO,EAAE,eAAe,EACxB,MAAM,EAAE,cAAc,GACpB,gBAAgB,EAAE,CAapB;AAMD,wBAAgB,aAAa,CAAC,GAAG,EAAE,gBAAgB,EAAE,SAAS,UAAQ,GAAG,MAAM,CAI9E;AAWD,iFAAiF;AACjF,wBAAgB,YAAY,CAAC,GAAG,EAAE,gBAAgB,GAAG,MAAM,CAK1D;AAED;;;;GAIG;AACH,wBAAgB,oBAAoB,CAAC,aAAa,EAAE,gBAAgB,EAAE,GAAG,MAAM,EAAE,CAUhF;AAED,kFAAkF;AAClF,wBAAgB,MAAM,CAAC,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,GAAG,MAAM,CAE7D"}
package/dist/operator.js CHANGED
@@ -8,12 +8,13 @@
8
8
  * turn into a parameter the model can ask a person for.
9
9
  */
10
10
  import { RunaError } from '@runa-cmd/core';
11
- import { longFlag } from '@runa-cmd/core/internal';
11
+ import { longFlag, operatorValueProblem } from '@runa-cmd/core/internal';
12
+ import { MCP_ERROR_CODES } from './errors.js';
12
13
  const REDACTION = '[redacted]';
13
14
  /** Shorter values could be any word, and replacing them would mangle the text. */
14
15
  const MIN_REDACTED_LENGTH = 8;
15
16
  function invalidTools(message) {
16
- return new RunaError(`mcpPlugin: ${message}`, { code: 'MCP_INVALID_TOOLS' });
17
+ return new RunaError(`mcpPlugin: ${message}`, { code: MCP_ERROR_CODES.MCP_INVALID_TOOLS });
17
18
  }
18
19
  function assertValidLimit(limit, owner) {
19
20
  if (limit === undefined || (Number.isInteger(limit) && limit > 0))
@@ -66,6 +67,8 @@ function applyToTool(reg, options, maxOutput, values) {
66
67
  const inputShape = { ...reg.inputShape };
67
68
  const fixed = new Set();
68
69
  const fixedValues = [];
70
+ const unconfigured = [];
71
+ const misconfigured = [];
69
72
  for (const key of reg.optionKeys) {
70
73
  if (options.expose?.includes(key))
71
74
  continue;
@@ -75,9 +78,26 @@ function applyToTool(reg, options, maxOutput, values) {
75
78
  throw invalidTools(`option ${longFlag(key)} of tool '${reg.name}' is server-only and has no value. ` +
76
79
  'Set it through its env var or the config file.');
77
80
  }
78
- const belongsToOperator = value !== undefined || envNameOf(key, reg) !== undefined;
81
+ const envName = envNameOf(key, reg);
82
+ const belongsToOperator = value !== undefined || envName !== undefined;
79
83
  if (!belongsToOperator)
80
84
  continue;
85
+ // A model can't send it, so without a value no call can run (T-236)
86
+ const schema = inputShape[key];
87
+ const required = schema?.safeParse(undefined).success === false;
88
+ if (value === undefined && envName !== undefined && required) {
89
+ unconfigured.push({ key, env: envName });
90
+ }
91
+ // Nor with a value that breaks its schema: checked as the CLI checks it (T-255)
92
+ if (value !== undefined && schema) {
93
+ const fromEnv = envName !== undefined && values.env[envName] !== undefined;
94
+ const reason = operatorValueProblem(schema, value, fromEnv ? 'env' : 'config');
95
+ if (reason !== undefined) {
96
+ misconfigured.push(fromEnv
97
+ ? { key, env: envName, reason }
98
+ : { key, configKey: [...reg.path, key].join('.'), reason });
99
+ }
100
+ }
81
101
  delete inputShape[key];
82
102
  fixed.add(key);
83
103
  if (value !== undefined)
@@ -89,6 +109,8 @@ function applyToTool(reg, options, maxOutput, values) {
89
109
  annotations: options.annotations,
90
110
  inputShape,
91
111
  fixed,
112
+ unconfigured,
113
+ misconfigured,
92
114
  redactions: redactable([...fixedValues, ...Object.values(values.globals)]),
93
115
  maxOutput: options.maxOutput ?? maxOutput ?? reg.maxOutput,
94
116
  };
@@ -105,6 +127,37 @@ export function applyOperatorValues(registrations, options, values) {
105
127
  .filter((reg) => !exclude.includes(reg.name))
106
128
  .map((reg) => applyToTool(reg, tools[reg.name] ?? {}, maxOutput, values));
107
129
  }
130
+ /** The variables, as `NOTES_FILE` or `A (--a) and B (--b)` with their flags. */
131
+ const listOf = (names) => names.length > 1 ? `${names.slice(0, -1).join(', ')} and ${names.at(-1)}` : `${names[0]}`;
132
+ export function missingValues(reg, withFlags = false) {
133
+ return listOf(reg.unconfigured.map(({ key, env }) => (withFlags ? `${env} (${longFlag(key)})` : env)));
134
+ }
135
+ /** Where a wrong value is: its variable, or its key in the config file. Never the value. */
136
+ function wrongValueAt({ key, env, configKey }, withFlags) {
137
+ if (env !== undefined)
138
+ return withFlags ? `${env} (${longFlag(key)})` : env;
139
+ return `'${configKey}' in the config file`;
140
+ }
141
+ /** What the model reads first: what the operator has to set, and what to fix. */
142
+ export function operatorNote(reg) {
143
+ const set = reg.unconfigured.length > 0 ? [`set ${missingValues(reg)}`] : [];
144
+ const wrong = reg.misconfigured.map((item) => wrongValueAt(item, false));
145
+ const fix = wrong.length > 0 ? [`fix ${listOf(wrong)}`] : [];
146
+ return `The operator of this server has to ${[...set, ...fix].join(' and ')}. It isn't a value you can send.`;
147
+ }
148
+ /**
149
+ * What the operator has to set or fix before each tool can run. Said at
150
+ * startup, so it doesn't wait for a model to call the tool, and the server
151
+ * keeps serving: the other tools work.
152
+ */
153
+ export function unconfiguredWarnings(registrations) {
154
+ return registrations.flatMap((reg) => {
155
+ const prefix = `mcpPlugin: tool '${reg.name}' can't run until the operator`;
156
+ const missing = reg.unconfigured.length > 0 ? [`${prefix} sets ${missingValues(reg, true)}.`] : [];
157
+ const wrong = reg.misconfigured.map((item) => `${prefix} fixes ${wrongValueAt(item, true)}: ${item.reason}.`);
158
+ return [...missing, ...wrong];
159
+ });
160
+ }
108
161
  /** Hide fixed values from text a command wrote without meaning to expose them. */
109
162
  export function redact(text, values) {
110
163
  return values.reduce((result, value) => result.replaceAll(value, REDACTION), text);
@@ -1 +1 @@
1
- {"version":3,"file":"operator.js","sourceRoot":"","sources":["../src/operator.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AACH,OAAO,EAAmB,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAC5D,OAAO,EAAE,QAAQ,EAAE,MAAM,yBAAyB,CAAC;AAInD,MAAM,SAAS,GAAG,YAAY,CAAC;AAE/B,kFAAkF;AAClF,MAAM,mBAAmB,GAAG,CAAC,CAAC;AAY9B,SAAS,YAAY,CAAC,OAAe;IACpC,OAAO,IAAI,SAAS,CAAC,cAAc,OAAO,EAAE,EAAE,EAAE,IAAI,EAAE,mBAAmB,EAAE,CAAC,CAAC;AAC9E,CAAC;AAED,SAAS,gBAAgB,CAAC,KAAyB,EAAE,KAAa;IACjE,IAAI,KAAK,KAAK,SAAS,IAAI,CAAC,MAAM,CAAC,SAAS,CAAC,KAAK,CAAC,IAAI,KAAK,GAAG,CAAC,CAAC;QAAE,OAAO;IAC1E,MAAM,YAAY,CAAC,gBAAgB,KAAK,sCAAsC,CAAC,CAAC;AACjF,CAAC;AAED,SAAS,kBAAkB,CAC1B,EAAE,OAAO,GAAG,EAAE,EAAE,KAAK,GAAG,EAAE,EAAmB,EAC7C,aAAiC;IAEjC,KAAK,MAAM,IAAI,IAAI,OAAO,EAAE,CAAC;QAC5B,IAAI,CAAC,aAAa,CAAC,I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CAAC;AACpF,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"plugin.d.ts","sourceRoot":"","sources":["../src/plugin.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,OAAO,KAAK,EAAe,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAMhE,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAC;AAOnD;;;;GAIG;AACH,wBAAgB,SAAS,CAAC,IAAI,GAAE,gBAAqB,GAAG,YAAY,CAgDnE"}
1
+ {"version":3,"file":"plugin.d.ts","sourceRoot":"","sources":["../src/plugin.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,OAAO,KAAK,EAAe,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAMhE,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAC;AAOnD;;;;GAIG;AACH,wBAAgB,SAAS,CAAC,IAAI,GAAE,gBAAqB,GAAG,YAAY,CAkDnE"}
package/dist/plugin.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import { definePlugin } from '@runa-cmd/core';
2
2
  import { z } from 'zod';
3
- import { applyOperatorValues } from './operator.js';
3
+ import { applyOperatorValues, unconfiguredWarnings } from './operator.js';
4
4
  import { defaultSelfCommand } from './runner.js';
5
5
  import { buildToolRegistrations } from './schema.js';
6
6
  /** What a child repeats from the server's own start: everything but `--mcp`. */
@@ -36,6 +36,9 @@ export function mcpPlugin(opts = {}) {
36
36
  env: process.env,
37
37
  globals: ctx.globalOptions,
38
38
  });
39
+ // stderr reaches the client's logs, and stdout is the protocol
40
+ for (const warning of unconfiguredWarnings(registrations))
41
+ console.error(warning);
39
42
  // Loaded here so a plain CLI run doesn't pay for the MCP SDK
40
43
  const { serve } = await import('./server.js');
41
44
  await serve(registrations, {
@@ -1 +1 @@
1
- {"version":3,"file":"plugin.js","sourceRoot":"","sources":["../src/plugin.ts"],"names":[],"mappings":"AAQA,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB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AAG,CAAC,eAAe,CAAC,IAAI,CAAC,IAAI,CAAC,CAAU,CAAC,CACrF,CAAC;gBACF,MAAM,aAAa,GAAG,mBAAmB,CAAC,KAAK,EAAE,IAAI,EAAE;oBACtD,YAAY,EAAE,MAAM,CAAC,WAAW,CAAC,YAAY,CAAC;oBAC9C,GAAG,EAAE,OAAO,CAAC,GAAG;oBAChB,OAAO,EAAE,GAAG,CAAC,aAAa;iBAC1B,CAAC,CAAC;gBACH,+DAA+D;gBAC/D,KAAK,MAAM,OAAO,IAAI,oBAAoB,CAAC,aAAa,CAAC;oBAAE,OAAO,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;gBAElF,6DAA6D;gBAC7D,MAAM,EAAE,KAAK,EAAE,GAAG,MAAM,MAAM,CAAC,aAAa,CAAC,CAAC;gBAE9C,MAAM,KAAK,CAAC,aAAa,EAAE;oBAC1B,IAAI,EAAE,IAAI,CAAC,IAAI,IAAI,MAAM,CAAC,IAAI,CAAC,IAAI;oBACnC,OAAO,EAAE,IAAI,CAAC,OAAO,IAAI,MAAM,CAAC,IAAI,CAAC,OAAO,IAAI,OAAO;oBACvD,YAAY,EAAE,IAAI,CAAC,YAAY;oBAC/B,WAAW,EAAE,IAAI,CAAC,WAAW,IAAI,kBAAkB,EAAE;oBACrD,IAAI,EAAE,WAAW,EAAE;iBACnB,CAAC,CAAC;gBAEH,gDAAgD;gBAChD,GAAG,CAAC,YAAY,EAAE,EAAE,CAAC;YACtB,CAAC,CAAC,CAAC;QACJ,CAAC;KACD,CAAC,CAAC;AACJ,CAAC"}
package/dist/schema.d.ts CHANGED
@@ -29,6 +29,18 @@ export interface ToolRegistration {
29
29
  optionKeys: Set<string>;
30
30
  /** Options the operator fixed: out of the schema, and dropped from any call */
31
31
  fixed: Set<string>;
32
+ /** Required options only the operator can give, still without a value: the tool can't run */
33
+ unconfigured: Array<{
34
+ key: string;
35
+ env: string;
36
+ }>;
37
+ /** Values the operator gave that break their schema: the tool can't run either (T-255) */
38
+ misconfigured: Array<{
39
+ key: string;
40
+ env?: string;
41
+ configKey?: string;
42
+ reason: string;
43
+ }>;
32
44
  /** Text to hide from what the command writes */
33
45
  redactions: string[];
34
46
  /** Most bytes of output this tool can answer with */
@@ -1 +1 @@
1
- {"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["../src/schema.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,oCAAoC,CAAC;AAC1E,OAAO,KAAK,EAAE,SAAS,EAAE,OAAO,EAAiB,WAAW,EAAE,MAAM,gBAAgB,CAAC;AACrF,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,KAAK,CAAC;AAKnC;;GAEG;AACH,MAAM,WAAW,gBAAgB;IAChC,yCAAyC;IACzC,IAAI,EAAE,MAAM,CAAC;IACb,yDAAyD;IACzD,IAAI,EAAE,MAAM,EAAE,CAAC;IACf,6CAA6C;IAC7C,WAAW,EAAE,MAAM,CAAC;IACpB,qEAAqE;IACrE,UAAU,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACpC,uCAAuC;IACvC,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,mDAAmD;IACnD,OAAO,EAAE,OAAO,CAAC;IACjB,wEAAwE;IACxE,OAAO,EAAE,GAAG,CAAC,MAAM,CAAC,CAAC;IACrB,kCAAkC;IAClC,UAAU,EAAE,GAAG,CAAC,MAAM,CAAC,CAAC;IACxB,+EAA+E;IAC/E,KAAK,EAAE,GAAG,CAAC,MAAM,CAAC,CAAC;IACnB,gDAAgD;IAChD,UAAU,EAAE,MAAM,EAAE,CAAC;IACrB,qDAAqD;IACrD,SAAS,EAAE,MAAM,CAAC;IAClB,6DAA6D;IAC7D,WAAW,CAAC,EAAE,eAAe,CAAC;CAC9B;AA6FD;;;;;;;GAOG;AACH,wBAAgB,sBAAsB,CACrC,QAAQ,EAAE,WAAW,EACrB,MAAM,EAAE,SAAS,GACf,gBAAgB,EAAE,C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AAC;IAClB,6DAA6D;IAC7D,WAAW,CAAC,EAAE,eAAe,CAAC;CAC9B;AA+FD;;;;;;;GAOG;AACH,wBAAgB,sBAAsB,CACrC,QAAQ,EAAE,WAAW,EACrB,MAAM,EAAE,SAAS,GACf,gBAAgB,EAAE,CAEpB"}
package/dist/schema.js CHANGED
@@ -61,6 +61,8 @@ function walkTree(tree, parentPath, cliSchema) {
61
61
  argKeys,
62
62
  optionKeys,
63
63
  fixed: new Set(),
64
+ unconfigured: [],
65
+ misconfigured: [],
64
66
  redactions: [],
65
67
  maxOutput: DEFAULT_MAX_OUTPUT,
66
68
  });
@@ -1 +1 @@
1
- {"version":3,"file":"schema.js","sourceRoot":"","sources":["../src/schema.ts"],"names":[],"mappings":"AASA,OAAO,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAC;AAkCjD,+DAA+D;AAE/D,SAAS,SAAS,CAAC,KAA4B;IAC9C,OAAO,OAAO,IAAI,KAAK,IAAI,KAAK,CAAC,KAAK,KAAK,cAAc,CAAC;AAC3D,CAAC;AAED;;GAEG;AACH,SAAS,iBAAiB,CACzB,OAAwB,EACxB,QAAkB;IAElB,KAAK,MAAM,MAAM,IAAI,OAAO,EAAE,CAAC;QAC9B,IAAI,UAAU,CAAC,MAAM,CAAC,QAAQ,EAAE,QAAQ,CAAC;YAAE,OAAO,MAAM,CAAC;QACzD,IAAI,MAAM,CAAC,WAAW,EAAE,CAAC;YACxB,MAAM,KAAK,GAAG,iBAAiB,CAAC,MAAM,CAAC,WAAW,EAAE,QAAQ,CAAC,CAAC;YAC9D,IAAI,KAAK;gBAAE,OAAO,KAAK,CAAC;QACzB,CAAC;IACF,CAAC;IACD,OAAO,SAAS,CAAC;AAClB,CAAC;AAED,SAAS,UAAU,CAAC,CAAW,EAAE,CAAW;IAC3C,IAAI,CAAC,CAAC,MAAM,KAAK,CAAC,CAAC,MAAM;QAAE,OAAO,KAAK,CAAC;IACxC,OAAO,CAAC,CAAC,KAAK,CAAC,CAAC,OAA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,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"server.d.ts","sourceRoot":"","sources":["../src/server.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAGH,OAAO,EAAE,MAAM,EAAE,MAAM,2CAA2C,CAAC;AAEnE,OAAO,EAEN,KAAK,cAAc,EAEnB,KAAK,IAAI,EACT,MAAM,oCAAoC,CAAC;AAI5C,OAAO,KAAK,EAAE,YAAY,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAE5D,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAgBpD,wBAAgB,cAAc,CAAC,GAAG,EAAE,gBAAgB,GAAG,IAAI,CAS1D;AA8FD;;;GAGG;AACH,wBAAgB,YAAY,CAAC,GAAG,EAAE,gBAAgB,EAAE,OAAO,EAAE,YAAY,GAAG,cAAc,CAiBzF;AAID,MAAM,WAAW,YAAa,SAAQ,UAAU;IAC/C,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;IAChB,YAAY,CAAC,EAAE,MAAM,CAAC;CACtB;AAiBD,wBAAgB,eAAe,CAAC,aAAa,EAAE,gBAAgB,EAAE,EAAE,OAAO,EAAE,YAAY,GAAG,MAAM,CAkChG;AAED;;;GAGG;AACH,wBAAsB,KAAK,CAC1B,aAAa,EAAE,gBAAgB,EAAE,EACjC,OAAO,EAAE,YAAY,GACnB,OAAO,CAAC,IAAI,CAAC,CAuBf"}
1
+ {"version":3,"file":"server.d.ts","sourceRoot":"","sources":["../src/server.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAGH,OAAO,EAAE,MAAM,EAAE,MAAM,2CAA2C,CAAC;AAEnE,OAAO,EAEN,KAAK,cAAc,EAEnB,KAAK,IAAI,EACT,MAAM,oCAAoC,CAAC;AAM5C,OAAO,KAAK,EAAE,YAAY,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAE5D,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAgBpD,wBAAgB,cAAc,CAAC,GAAG,EAAE,gBAAgB,GAAG,IAAI,CAS1D;AAmHD;;;GAGG;AACH,wBAAgB,YAAY,CAAC,GAAG,EAAE,gBAAgB,EAAE,OAAO,EAAE,YAAY,GAAG,cAAc,CAiBzF;AAID,MAAM,WAAW,YAAa,SAAQ,UAAU;IAC/C,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;IAChB,YAAY,CAAC,EAAE,MAAM,CAAC;CACtB;AAiBD,wBAAgB,eAAe,CAAC,aAAa,EAAE,gBAAgB,EAAE,EAAE,OAAO,EAAE,YAAY,GAAG,MAAM,CAsChG;AAED;;;GAGG;AACH,wBAAsB,KAAK,CAC1B,aAAa,EAAE,gBAAgB,EAAE,EACjC,OAAO,EAAE,YAAY,GACnB,OAAO,CAAC,IAAI,CAAC,CAuBf"}
package/dist/server.js CHANGED
@@ -11,6 +11,8 @@ import { StdioServerTransport } from '@modelcontextprotocol/sdk/server/stdio.js'
11
11
  import { CallToolRequestSchema, ListToolsRequestSchema, } from '@modelcontextprotocol/sdk/types.js';
12
12
  import { RunaError } from '@runa-cmd/core';
13
13
  import { z } from 'zod';
14
+ import { ERROR_CLASSES, MCP_ERROR_CODES } from './errors.js';
15
+ import { operatorNote } from './operator.js';
14
16
  import { childrenFinished, runChild } from './runner.js';
15
17
  const SELF_CHECK_TIMEOUT_MS = 10_000;
16
18
  // ─── Tool definitions ───────────────────────────────────────
@@ -44,29 +46,37 @@ const EFFECT_TEXT = {
44
46
  * The reports say how far the command got. Without one, a command may have done
45
47
  * anything: the safe reading of the unknown is never that nothing happened.
46
48
  */
47
- function findFailure({ reports, status, cancelled }) {
49
+ function findFailure({ reports, status, cancelled }, reg) {
48
50
  const reached = (kind) => reports.some((report) => report.kind === kind);
49
51
  const failed = reports.find((report) => report.kind === 'failed');
52
+ const { AFTER_RUN_FAILED, CANCELLED, COMMAND_FAILED, CRASHED, INVALID_INPUT } = ERROR_CLASSES;
53
+ const { INVALID_OUTPUT, NOT_CONFIGURED, NOT_RUN, OUTPUT_TOO_LARGE, REJECTED } = ERROR_CLASSES;
50
54
  if (cancelled)
51
- return { class: 'cancelled', effect: 'unknown' };
55
+ return { class: CANCELLED, effect: 'unknown' };
52
56
  if (reached('oversized'))
53
- return { class: 'output_too_large', effect: 'completed' };
57
+ return { class: OUTPUT_TOO_LARGE, effect: 'completed' };
54
58
  if (reached('result')) {
55
59
  if (!failed && status === 0)
56
60
  return undefined;
57
- return { class: 'after_run_failed', effect: 'completed' };
61
+ return { class: AFTER_RUN_FAILED, effect: 'completed' };
58
62
  }
59
63
  if (reached('ran')) {
60
64
  const invalid = failed?.reason === 'output';
61
- return { class: invalid ? 'invalid_output' : 'after_run_failed', effect: 'completed' };
65
+ return { class: invalid ? INVALID_OUTPUT : AFTER_RUN_FAILED, effect: 'completed' };
62
66
  }
63
67
  if (reached('running')) {
64
- return { class: failed ? 'command_failed' : 'crashed', effect: 'unknown' };
68
+ // Only a CommandError is a failure the author wrote: anything else is a bug
69
+ return { class: failed?.reason === 'command' ? COMMAND_FAILED : CRASHED, effect: 'unknown' };
65
70
  }
66
- if (failed) {
67
- return { class: failed.reason === 'input' ? 'invalid_input' : 'rejected', effect: 'none' };
71
+ if (failed?.reason === 'input') {
72
+ // What the operator didn't set is what's missing first, whatever the model sent
73
+ // Missing or wrong, a value of the operator is the operator's to fix (T-255)
74
+ const configured = reg.unconfigured.length === 0 && reg.misconfigured.length === 0;
75
+ return { class: configured ? INVALID_INPUT : NOT_CONFIGURED, effect: 'none' };
68
76
  }
69
- return { class: status === 0 ? 'not_run' : 'crashed', effect: 'none' };
77
+ if (failed)
78
+ return { class: REJECTED, effect: 'none' };
79
+ return { class: status === 0 ? NOT_RUN : CRASHED, effect: 'none' };
70
80
  }
71
81
  /** Anything the model has to read goes in the text: `_meta` is for the client. */
72
82
  const failure = (reason, found) => ({
@@ -75,11 +85,21 @@ const failure = (reason, found) => ({
75
85
  content: [
76
86
  {
77
87
  type: 'text',
78
- text: found.class === 'command_failed' ? reason : `${reason}\n\n${EFFECT_TEXT[found.effect]}`,
88
+ text: found.class === ERROR_CLASSES.COMMAND_FAILED
89
+ ? reason
90
+ : `${reason}\n\n${EFFECT_TEXT[found.effect]}`,
79
91
  },
80
92
  ],
81
93
  _meta: { 'runa/error': found },
82
94
  });
95
+ /** A call that sends options the operator fixed. It names them, never their values. */
96
+ function operatorSets(keys) {
97
+ const names = keys.map((key) => `'${key}'`);
98
+ const list = names.length > 1 ? `${names.slice(0, -1).join(', ')} and ${names.at(-1)}` : names[0];
99
+ const verb = names.length > 1 ? 'are' : 'is';
100
+ const pronoun = names.length > 1 ? 'they' : 'it';
101
+ return failure(`${list} ${verb} set by the operator of this server, so ${pronoun} can't be sent.`, { class: ERROR_CLASSES.INVALID_INPUT, effect: 'none' });
102
+ }
83
103
  function failedChild(reg, outcome, found) {
84
104
  const oversized = outcome.reports.find((report) => report.kind === 'oversized');
85
105
  if (oversized) {
@@ -87,10 +107,15 @@ function failedChild(reg, outcome, found) {
87
107
  }
88
108
  const written = outcome.stderr.trim();
89
109
  const printed = outcome.stdout.trim();
90
- return failure(written || printed || silentFailure(reg, outcome, found), found);
110
+ const reason = written || printed || silentFailure(reg, outcome, found);
111
+ if (found.class !== ERROR_CLASSES.NOT_CONFIGURED)
112
+ return failure(reason, found);
113
+ // The model reads this: it can't send the value, nor ask the user for it
114
+ const note = operatorNote(reg);
115
+ return failure(`${note}\n\n${reason}`, found);
91
116
  }
92
117
  function silentFailure(reg, outcome, found) {
93
- if (found.class === 'cancelled')
118
+ if (found.class === ERROR_CLASSES.CANCELLED)
94
119
  return `Command '${reg.name}' was cancelled.`;
95
120
  if (outcome.status !== 0)
96
121
  return `Command '${reg.name}' exited with code ${outcome.status}.`;
@@ -101,7 +126,7 @@ function silentFailure(reg, outcome, found) {
101
126
  * can exit on its own. Only the reports say how far it got.
102
127
  */
103
128
  export function toToolResult(reg, outcome) {
104
- const found = findFailure(outcome);
129
+ const found = findFailure(outcome, reg);
105
130
  if (found)
106
131
  return failedChild(reg, outcome, found);
107
132
  const finished = outcome.reports.find((report) => report.kind === 'result');
@@ -122,7 +147,7 @@ async function assertCanRunItself(options) {
122
147
  if (reports.some((report) => report.kind === 'pong'))
123
148
  return;
124
149
  throw new RunaError(`Cannot run this CLI as a subprocess with: ${options.selfCommand.join(' ')}. ` +
125
- 'If it is a compiled binary, set mcpPlugin({ selfCommand }).', { code: 'MCP_SELF_CHECK_FAILED' });
150
+ 'If it is a compiled binary, set mcpPlugin({ selfCommand }).', { code: MCP_ERROR_CODES.MCP_SELF_CHECK_FAILED });
126
151
  }
127
152
  export function createMcpServer(registrations, options) {
128
153
  const server = new Server({ name: options.name, version: options.version }, { capabilities: { tools: {} }, instructions: options.instructions });
@@ -132,10 +157,17 @@ export function createMcpServer(registrations, options) {
132
157
  server.setRequestHandler(CallToolRequestSchema, async ({ params }, extra) => {
133
158
  const reg = registrations.find((candidate) => candidate.name === params.name);
134
159
  if (!reg) {
135
- return failure(`Unknown tool: ${params.name}`, { class: 'unknown_tool', effect: 'none' });
160
+ return failure(`Unknown tool: ${params.name}`, {
161
+ class: ERROR_CLASSES.UNKNOWN_TOOL,
162
+ effect: 'none',
163
+ });
136
164
  }
137
- // A fixed option stays what the operator set, whatever the call says
138
- const input = Object.fromEntries(Object.entries(params.arguments ?? {}).filter(([key]) => !reg.fixed.has(key)));
165
+ // The operator's value wins, and the model has to know its own isn't used:
166
+ // running with another value and answering success told it otherwise (ADR-0049)
167
+ const input = params.arguments ?? {};
168
+ const fixed = Object.keys(input).filter((key) => reg.fixed.has(key));
169
+ if (fixed.length > 0)
170
+ return operatorSets(fixed);
139
171
  const outcome = await runChild({ kind: 'call', path: reg.path, input, maxResultBytes: reg.maxOutput }, {
140
172
  ...options,
141
173
  signal: options.signal ? AbortSignal.any([extra.signal, options.signal]) : extra.signal,
@@ -1 +1 @@
1
- {"version":3,"file":"server.js","sourceRoot":"","sources":["../src/server.ts"],"names":[],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
+ "version": "0.2.0",
4
4
  "description": "MCP (Model Context Protocol) server mode for Runa CLIs. Turn commands into AI-callable tools.",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -25,7 +25,7 @@
25
25
  "@modelcontextprotocol/sdk": "^1.32.2"
26
26
  },
27
27
  "peerDependencies": {
28
- "@runa-cmd/core": "^0.2.0-beta.4",
28
+ "@runa-cmd/core": "^1.0.0",
29
29
  "zod": "^4.0.0"
30
30
  },
31
31
  "engines": {
@@ -52,12 +52,12 @@
52
52
  "@types/node": "^24.19.2",
53
53
  "typescript": "^7.0.2",
54
54
  "zod": "^4.6.7",
55
- "@runa-cmd/core": "0.2.0-beta.6"
55
+ "@runa-cmd/core": "1.0.0"
56
56
  },
57
57
  "scripts": {
58
58
  "build": "tsc",
59
59
  "dev": "tsc --watch --preserveWatchOutput",
60
- "typecheck": "tsc --noEmit",
60
+ "typecheck": "tsc --noEmit && tsc -p tsconfig.test.json",
61
61
  "test": "vitest run",
62
62
  "test:watch": "vitest",
63
63
  "lint": "biome check .",