diff --git a/docs/getting-started/cli.md b/docs/getting-started/cli.md index 2ec9c8f318..1330bc6d91 100644 --- a/docs/getting-started/cli.md +++ b/docs/getting-started/cli.md @@ -1091,6 +1091,12 @@ Choose the guide for the target and intended interaction: Runtime requests name the target and actions. Launched targets run with your user permissions; consult the chosen guide for host requirements and effects. +## Start the MCP server + +Start REA's MCP server with `rea mcp` (or `rea --mcp`). The per-command +`rea --mcp` entry has been removed; it returns `MCP_MODE_REMOVED` +and points to `rea mcp`. This is a breaking change from the earlier CLI. + ## Serve MCP over streamable HTTP `rea mcp` speaks stdio to the client that launched it. To serve the same MCP diff --git a/src/cli/cliLoader.ts b/src/cli/cliLoader.ts index f4ccc50854..28a9142fce 100644 --- a/src/cli/cliLoader.ts +++ b/src/cli/cliLoader.ts @@ -22,8 +22,8 @@ const isRegistrationId = (id: string): id is CliCommandRegistrationId => /** * The registrars the command these arguments run needs, or undefined when the * complete CLI must answer, as it does for shell completion, which has no - * global arguments. A standalone `--version` needs none: Incur answers - * it from the CLI identity alone. Help, schemas, `--llms`, completions, other + * global arguments. A standalone version or retired per-command MCP query + * needs no registrar. Help, schemas, `--llms`, completions, other * Incur builtins, unknown names ("did you mean"), and a missing or unusable * recording all describe or search every command. */ @@ -33,6 +33,7 @@ export const selectCliRegistrations = ( ): readonly CliCommandRegistrationId[] | undefined => { if (global === undefined) return undefined; const { command, flags } = global; + if (flags.has("--mcp") && command.length > 0) return []; if (command.length === 0 && flags.size === 1 && flags.has("--version")) return []; if (recorded === undefined) return undefined; @@ -54,8 +55,8 @@ export interface CliRuntime { /** * Load the command runtime for one invocation. A recorded top-level command - * loads only its registrar's module graph, a standalone version query loads - * none, and anything else loads the complete CLI. + * loads only its registrar's module graph. A standalone version or retired + * mode query loads none; anything else loads the complete CLI. */ export const loadCliRuntime = async ( global: CliGlobalArguments | undefined, diff --git a/src/cli/cliShell.ts b/src/cli/cliShell.ts index cdb86e2629..e836e3a695 100644 --- a/src/cli/cliShell.ts +++ b/src/cli/cliShell.ts @@ -30,6 +30,7 @@ import { excludeDeclaredSensitiveArguments } from "./explicitSensitiveArguments. import { CLI_CUSTOM_GLOBAL_OPTIONS, CLI_DESCRIPTION, + CLI_UPDATE_REFUSAL, serveDiscovery, } from "./discovery.js"; import { reportUnknownMcpSubcommand } from "./mcpBuiltinCommands.js"; @@ -107,12 +108,10 @@ export const createCliShell = (options: CliShellOptions): CliInstance => { }, sync: false, update: { - // Incur's update:false only suppresses notices. Reject its explicit - // installer so ambiguous flags cannot bypass REA's verified workflow. + // Incur still supplies ordinary-command notices. Keep its installer + // disabled while REA owns the update refusal and verified update command. install: () => { - throw new Error( - "Use 'rea update' to update the identified installation. The '--update' alias accepts only global output flags.", - ); + throw new Error(CLI_UPDATE_REFUSAL.message); }, }, }); diff --git a/src/cli/completions.ts b/src/cli/completions.ts index cc747d96c9..ae439be353 100644 --- a/src/cli/completions.ts +++ b/src/cli/completions.ts @@ -176,11 +176,7 @@ export const createCliCompletions = ( const selected = CLI_COMPLETION_SHELLS.find( (value) => value === command[offset + 1], ); - if ( - command[offset] !== "completions" || - selected === undefined || - command.length !== offset + 2 - ) + if (command[offset] !== "completions" || selected === undefined) return false; // Help/manifests/schema/version and server controls keep framework precedence. const values = new Set(global.outputValues.map(({ index }) => index)); diff --git a/src/cli/discovery.ts b/src/cli/discovery.ts index aec0cf909c..553640063c 100644 --- a/src/cli/discovery.ts +++ b/src/cli/discovery.ts @@ -1,9 +1,12 @@ import { z } from "zod"; import { + CLI_COMPLETION_SHELLS, + declaredSensitiveValues, parseCliGlobalArguments, type CliGlobalArguments, } from "../cliBuiltinArguments.js"; +import { redactExplicitText } from "../domain/explicitSensitiveValues.js"; import { CLI_DOCUMENT_OUTPUT_FORMATS, CLI_OUTPUT_FORMATS, @@ -52,8 +55,15 @@ export const CLI_CUSTOM_GLOBAL_OPTIONS = z.object({ export const MCP_GROUP_DESCRIPTION = "Register as MCP server"; export const COMPLETIONS_DESCRIPTION = "Generate shell completion script"; +/** REA's verified update command is the only CLI installation workflow. */ +export const CLI_UPDATE_REFUSAL = { + code: "UPDATE_FAILED", + message: + "Use 'rea update' to update the identified installation. The '--update' alias accepts only global output flags.", +} as const; + /** Shells in the order the completions page lists them. */ -const HELP_SHELLS = ["bash", "fish", "nushell", "zsh"] as const; +const HELP_SHELLS = [...CLI_COMPLETION_SHELLS].sort(); const completionsHint = (name: string): string => { const rows = [ @@ -188,7 +198,6 @@ const schemaAnswer = ( return answer(`Error: ${failure.message}`, 1); } const { format, formatExplicit } = readCliOutputArguments(global); - if (formatExplicit && format === "md") return undefined; return answer( formatCliOutput( commandSchemaDocument(entry, CLI_CUSTOM_GLOBAL_OPTIONS), @@ -205,6 +214,68 @@ interface Invocation { readonly started: number; } +/** Preserve the existing installer refusal without delegating to an installer. */ +const updateRefusalAnswer = ( + global: CliGlobalArguments, + invocation: Invocation, +): DiscoveryAnswer => { + const controls = readCliOutputArguments(global); + const failure = { + ...CLI_UPDATE_REFUSAL, + message: redactExplicitText( + CLI_UPDATE_REFUSAL.message, + declaredSensitiveValues(global.command), + ), + }; + return answer( + invocation.stdoutIsTerminal && !controls.formatExplicit + ? `Error (${failure.code}): ${failure.message}` + : formatCliOutput(failure, controls.format), + 1, + ); +}; + +/** The production MCP entry owns server startup; a command cannot start another. */ +const retiredMcpAnswer = ( + cli: CliInstance, + global: CliGlobalArguments, + invocation: Invocation, +): DiscoveryAnswer => { + const controls = readCliOutputArguments(global); + const sensitive = declaredSensitiveValues(global.command); + const text = (value: string): string => redactExplicitText(value, sensitive); + return answer( + renderFailure( + { + code: "MCP_MODE_REMOVED", + message: text( + `Per-command --mcp has been removed. Use '${cli.name} mcp' to start REA's MCP server.`, + ), + }, + { + command: text(global.command[0] ?? cli.name), + duration: `${Math.round(performance.now() - invocation.started)}ms`, + }, + { + description: text("Suggested command:"), + commands: [{ command: text(`${cli.name} mcp`) }], + }, + { + format: + controls.format === "csv" || controls.format === "tsv" + ? "json" + : controls.format, + human: invocation.stdoutIsTerminal && !controls.formatExplicit, + fullOutput: controls.fullOutput, + tokenCount: controls.tokenCount, + tokenLimit: controls.tokenLimit, + tokenOffset: controls.tokenOffset, + }, + ), + 1, + ); +}; + /** * An unknown command: the closest command name, the corrected invocation and * the help command. On a terminal without an explicit format the error is @@ -261,7 +332,8 @@ const unknownCommandAnswer = ( /** * The document an invocation asks for instead of running a command, or * undefined. Precedence (after the detached update refresh): `--update` - * without help and `--mcp` stay with the dispatcher; the LLM manifests answer + * without help is refused; per-command `--mcp` is retired and a root MCP + * entry stays with the production launcher; the LLM manifests answer * next; then the * integrations (`completions` shows its page for help or without a shell, * `mcp` shows its page without a subcommand); then `--version` without help; @@ -276,12 +348,30 @@ const discoveryAnswer = ( ): DiscoveryAnswer | undefined => { const { command, flags } = global; const help = flags.has("--help") || flags.has("-h"); - if ((flags.has("--update") && !help) || flags.has("--mcp")) return undefined; + if (flags.has("--update") && !help) + return updateRefusalAnswer(global, invocation); + if (flags.has("--mcp")) + return command.length === 0 + ? undefined + : retiredMcpAnswer(cli, global, invocation); if (flags.has("--llms") || flags.has("--llms-full")) return llmsAnswer(cli, global, flags.has("--llms-full")); const completions = integrationIndex(command, cli.name, "completions"); - if (completions >= 0) - return help || command[completions + 1] === undefined + if (completions >= 0) { + const shell = command[completions + 1]; + if ( + !help && + shell !== undefined && + !HELP_SHELLS.includes(shell as (typeof HELP_SHELLS)[number]) + ) + return answer( + redactExplicitText( + `Error (INVALID_SHELL): Unknown shell '${shell}'. Supported: ${HELP_SHELLS.join(", ")}`, + declaredSensitiveValues(global.command), + ), + 1, + ); + return help || shell === undefined ? answer( formatCommandHelp(`${cli.name} completions`, { description: COMPLETIONS_DESCRIPTION, @@ -294,6 +384,7 @@ const discoveryAnswer = ( }), ) : undefined; + } const mcp = integrationIndex(command, cli.name, "mcp"); if (mcp >= 0) { const subcommand = command[mcp + 1]; diff --git a/src/cli/outputEnvelope.ts b/src/cli/outputEnvelope.ts index 6c0defd6d7..2e6a483282 100644 --- a/src/cli/outputEnvelope.ts +++ b/src/cli/outputEnvelope.ts @@ -111,12 +111,21 @@ export const renderFailure = ( cta: CallToAction, presentation: EnvelopePresentation, ): string => { - if (presentation.human && !presentation.fullOutput) - return line(humanError(failure)) + line(humanCallToAction(cta)); const { format } = presentation; - if (presentation.tokenCount) - return line(String(estimateTokenCount(formatCliOutput(failure, format)))); const meta = { command, cta, duration }; + if (presentation.tokenCount) { + const document = presentation.fullOutput + ? { ok: false, error: failure, meta } + : { ...failure, cta }; + return line(String(estimateTokenCount(formatCliOutput(document, format)))); + } + if ( + presentation.human && + !presentation.fullOutput && + presentation.tokenLimit === undefined && + presentation.tokenOffset === undefined + ) + return line(humanError(failure)) + line(humanCallToAction(cta)); if (presentation.fullOutput) { const window = tokenWindow(formatCliOutput(failure, format), presentation); return line( diff --git a/src/cliBuiltinArguments.ts b/src/cliBuiltinArguments.ts index ee6c3ee2c6..acff2cc8f7 100644 --- a/src/cliBuiltinArguments.ts +++ b/src/cliBuiltinArguments.ts @@ -311,7 +311,11 @@ export const productionMcpDoctorArguments = ( | { readonly arguments: readonly string[]; readonly timings: boolean } | undefined => { const global = parseCliGlobalArguments(arguments_); - if (global.command[0] !== "mcp" || global.command[1] !== "doctor") + if ( + global.command[0] !== "mcp" || + global.command[1] !== "doctor" || + global.flags.has("--mcp") + ) return undefined; const removed = new Set([ global.commandIndices[0]!, diff --git a/tests/boundary/cli/builtinDispatch.test.ts b/tests/boundary/cli/builtinDispatch.test.ts new file mode 100644 index 0000000000..ca9dce5aa7 --- /dev/null +++ b/tests/boundary/cli/builtinDispatch.test.ts @@ -0,0 +1,190 @@ +import { expect, it } from "vitest"; +import { z } from "zod"; +import { estimateTokenCount } from "tokenx"; + +import { registerCliCommand } from "../../../src/cli/commandRegistry.js"; +import { createCliShell } from "../../../src/cli/cliShell.js"; +import { serveDiscovery } from "../../../src/cli/discovery.js"; +import { renderFailure } from "../../../src/cli/outputEnvelope.js"; +import { cliTest } from "../../support/cli/cliFixture.js"; +import { serveInProcessCli } from "../../support/cli/serveInProcessCli.js"; + +const shell = () => + createCliShell({ + selectedEnvironment: {}, + registrations: [ + { + module: {}, + registration: { + analysis: false, + load: async () => ({}), + register: (_module, { cli }) => { + registerCliCommand(cli, "fixture", { + options: z.object({ value: z.string().optional() }), + run: ({ options }) => ({ + selected: options.value, + "--mcp": "preserved", + }), + }); + }, + }, + }, + ], + }); + +it.for([ + ["fixture", "--mcp", "--json"], + ["--mcp", "fixture", "--json"], + ["fixture", "--mcp", "--help", "--json"], + ["fixture", "--mcp", "--schema", "--json"], + ["mcp", "add", "--mcp", "--json"], + ["mcp", "doctor", "--mcp", "--json"], + ["unknown", "--mcp", "--json"], +])("does not delegate a retired MCP invocation: %j", async (arguments_) => { + let stdout = ""; + let exitCode = 0; + const answered = serveDiscovery( + shell(), + arguments_, + { + stdout: (text) => { + stdout += text; + }, + exit: (code) => { + exitCode = code; + }, + }, + { variables: {}, platform: process.platform }, + ); + expect( + answered, + "an unanswered invocation would reach the dispatcher", + ).toBeDefined(); + await answered; + const reply = { stdout, exitCode }; + expect(reply.exitCode).toBe(1); + expect(JSON.parse(reply.stdout)).toMatchObject({ + code: "MCP_MODE_REMOVED", + message: expect.stringContaining("rea mcp"), + cta: { commands: [{ command: "rea mcp" }] }, + }); +}); + +it("preserves an option value spelled like the retired flag", async () => { + const reply = await serveInProcessCli(shell(), [ + "fixture", + "--value=--mcp", + "--json", + ]); + expect(reply.exitCode).toBe(0); + expect(JSON.parse(reply.stdout)).toEqual({ + selected: "--mcp", + "--mcp": "preserved", + }); +}); + +it("preserves a consumed output value instead of treating it as an MCP flag", async () => { + const reply = await serveInProcessCli(shell(), [ + "fixture", + "--filter-output", + "--mcp", + "--json", + ]); + expect(reply.exitCode).toBe(0); + expect(JSON.parse(reply.stdout)).toBe("preserved"); +}); + +cliTest("refuses per-command MCP through the public CLI", async ({ cli }) => { + for (const arguments_ of [ + ["doctor", "--mcp", "--json"], + ["mcp", "doctor", "--mcp", "--json"], + ["--mcp", "extra", "--json"], + ["doctor", "--mcp", "--json", "--full-output"], + ]) { + const reply = await cli.run({ arguments: arguments_ }); + expect(reply.exitCode, JSON.stringify(arguments_)).toBe(1); + const failure = { code: "MCP_MODE_REMOVED" }; + const cta = { commands: [{ command: "rea mcp" }] }; + expect(reply.json).toMatchObject( + arguments_.includes("--full-output") + ? { ok: false, error: failure, meta: { command: "doctor", cta } } + : { ...failure, cta }, + ); + } +}); + +cliTest.skipIf(process.platform === "win32")( + "keeps retired MCP diagnostics useful on a terminal", + async ({ cli }) => { + const reply = await cli.run({ + arguments: ["doctor", "--mcp"], + terminal: true, + }); + expect(reply.exitCode).toBe(1); + expect(reply.stdout).toContain("Error (MCP_MODE_REMOVED)"); + expect(reply.stdout).toContain("rea mcp"); + }, +); + +it.for([false, true])( + "counts the selected refusal document including recovery and envelope (%s)", + (fullOutput) => { + const render = (tokenCount: boolean) => + renderFailure( + { code: "MCP_MODE_REMOVED", message: "Use rea mcp" }, + { command: "doctor", duration: "0ms" }, + { + description: "Suggested command:", + commands: [{ command: "rea mcp" }], + }, + { + format: "json", + human: false, + fullOutput, + tokenCount, + tokenLimit: undefined, + tokenOffset: undefined, + }, + ); + expect(Number(render(true))).toBe( + estimateTokenCount(render(false).trimEnd()), + ); + }, +); + +cliTest.skipIf(process.platform === "win32")( + "applies token controls to terminal MCP refusals", + async ({ cli }) => { + const count = await cli.run({ + arguments: ["doctor", "--mcp", "--token-count"], + terminal: true, + }); + expect(count.exitCode).toBe(1); + expect(count.stdout.trim()).toMatch(/^\d+$/u); + const window = await cli.run({ + arguments: ["doctor", "--mcp", "--token-limit", "0"], + terminal: true, + }); + expect(window.exitCode).toBe(1); + expect(window.stdout).toMatch(/\[truncated: showing tokens 0–0 of \d+\]/u); + expect(window.stdout).not.toContain("Per-command"); + }, +); + +cliTest( + "redacts retired MCP diagnostics before token windows", + async ({ cli }) => { + const reply = await cli.run({ + arguments: [ + "analyze-javascript-application", + "--mcp", + "--sensitive-value=--mcp", + "--token-limit", + "12", + ], + }); + expect(reply.exitCode).toBe(1); + expect(reply.stdout).not.toContain("--mcp"); + expect(reply.stdout).toContain("MCP_MODE_REMOVED"); + }, +); diff --git a/tests/boundary/cli/cliLazyRegistration.test.ts b/tests/boundary/cli/cliLazyRegistration.test.ts index e88e0e5c90..10889bbeee 100644 --- a/tests/boundary/cli/cliLazyRegistration.test.ts +++ b/tests/boundary/cli/cliLazyRegistration.test.ts @@ -137,7 +137,10 @@ describe("lazy CLI registration", () => { // Help, schemas, LLM manifests and builtins describe the whole catalog. for (const flag of ["--help", "-h", "--schema", "--llms", "--llms-full"]) expect(select(["inspect-go-binary", flag]), flag).toBeUndefined(); - expect(select(["inspect-go-binary", "--mcp"])).toBeUndefined(); + // A retired mode is refused without constructing command analysis. + expect(select(["inspect-go-binary", "--mcp"])).toEqual([]); + expect(select(["unknown", "--mcp"], {}, null)).toEqual([]); + expect(select(["--mcp"])).toBeUndefined(); expect(select([])).toBeUndefined(); expect(select(["skills", "add"])).toBeUndefined(); // An unknown name needs every command for "did you mean". @@ -150,7 +153,9 @@ describe("lazy CLI registration", () => { select(["inspect-go-binary"], {}, { "inspect-go-binary": "removed" }), ).toBeUndefined(); }); +}); +describe("lazy CLI execution", () => { processTest( "runs a recorded command without loading the complete CLI", async ({ processes }) => { @@ -178,6 +183,14 @@ registerHooks({ resolve(specifier, context, next) { expect(version.exitCode, version.stderr).toBe(0); expect(version.stdout).toBe(`${PRODUCT_IDENTITY.packageVersion}\n`); expect(version.stderr).not.toContain(marker); + const retired = await run(["doctor", "--mcp", "--json", "--full-output"]); + expect(retired.exitCode, retired.stderr).toBe(1); + expect(JSON.parse(retired.stdout)).toMatchObject({ + ok: false, + error: { code: "MCP_MODE_REMOVED" }, + meta: { command: "doctor" }, + }); + expect(retired.stderr).not.toContain(marker); const complete = await run(["list-cutter-sessions", "--help"]); expect(complete.exitCode, complete.stderr).toBe(0); expect(complete.stderr).toContain(marker); diff --git a/tests/boundary/cli/cliParityGoldens.test.ts b/tests/boundary/cli/cliParityGoldens.test.ts index 2ea2eb4413..da162ee4e7 100644 --- a/tests/boundary/cli/cliParityGoldens.test.ts +++ b/tests/boundary/cli/cliParityGoldens.test.ts @@ -86,6 +86,8 @@ const NEWER_VERSION = "999.0.0"; const TERMINAL_CASES: readonly ParityCase[] = [ terminal("help-root-bare", fixed()), + terminal("error-invalid-completion-shell", fixed("completions", "bogus")), + terminal("error-command-update", fixed("doctor", "--update")), terminal("help-command", fixed("inspect-byte-entropy", "--help")), terminal("output", (w) => entropy(w, ...WINDOW)), terminal("output-explicit-format", (w) => @@ -258,6 +260,19 @@ const CASES: readonly ParityCase[] = [ arguments: fixed("no-such-command", "--token-limit", "6"), }, { name: "error-unknown-mcp-subcommand", arguments: fixed("mcp", "bogus") }, + { + name: "error-invalid-completion-shell", + arguments: fixed("completions", "bogus"), + }, + { + name: "error-invalid-completion-shell-json", + arguments: fixed("completions", "bogus", "--json"), + }, + { name: "error-command-update", arguments: fixed("doctor", "--update") }, + { + name: "error-command-update-json", + arguments: fixed("doctor", "--update", "--json"), + }, { name: "error-missing-positional", arguments: fixed("inspect-byte-entropy"), diff --git a/tests/boundary/cli/dispatcher.test.ts b/tests/boundary/cli/dispatcher.test.ts index d57c686253..6783dadc54 100644 --- a/tests/boundary/cli/dispatcher.test.ts +++ b/tests/boundary/cli/dispatcher.test.ts @@ -322,10 +322,6 @@ describe("executable dispatcher", () => { adapter: "cli", args: ["mcp", "add"], }); - await expect(invoke(["--mcp", "extra"])).resolves.toEqual({ - adapter: "cli", - args: ["--mcp", "extra"], - }); for (const args of [ ["mcp", "--http", "--port", "0"], ["--mcp", "--http"], diff --git a/tests/fixtures/cli-parity/error-command-update-json.txt b/tests/fixtures/cli-parity/error-command-update-json.txt new file mode 100644 index 0000000000..c5a2e6bc03 --- /dev/null +++ b/tests/fixtures/cli-parity/error-command-update-json.txt @@ -0,0 +1,7 @@ +$ rea doctor --update --json +exit: 1 +--- stdout +{"code":"UPDATE_FAILED","message":"Use 'rea update' to update the identified installation. The '--update' alias accepts only global output flags."} + +--- stderr + diff --git a/tests/fixtures/cli-parity/error-command-update.txt b/tests/fixtures/cli-parity/error-command-update.txt new file mode 100644 index 0000000000..884dcc5f74 --- /dev/null +++ b/tests/fixtures/cli-parity/error-command-update.txt @@ -0,0 +1,8 @@ +$ rea doctor --update +exit: 1 +--- stdout +code: UPDATE_FAILED +message: Use 'rea update' to update the identified installation. The '--update' alias accepts only global output flags. + +--- stderr + diff --git a/tests/fixtures/cli-parity/error-invalid-completion-shell-json.txt b/tests/fixtures/cli-parity/error-invalid-completion-shell-json.txt new file mode 100644 index 0000000000..c33d977ae9 --- /dev/null +++ b/tests/fixtures/cli-parity/error-invalid-completion-shell-json.txt @@ -0,0 +1,7 @@ +$ rea completions bogus --json +exit: 1 +--- stdout +Error (INVALID_SHELL): Unknown shell 'bogus'. Supported: bash, fish, nushell, zsh + +--- stderr + diff --git a/tests/fixtures/cli-parity/error-invalid-completion-shell.txt b/tests/fixtures/cli-parity/error-invalid-completion-shell.txt new file mode 100644 index 0000000000..896ff83bee --- /dev/null +++ b/tests/fixtures/cli-parity/error-invalid-completion-shell.txt @@ -0,0 +1,7 @@ +$ rea completions bogus +exit: 1 +--- stdout +Error (INVALID_SHELL): Unknown shell 'bogus'. Supported: bash, fish, nushell, zsh + +--- stderr + diff --git a/tests/fixtures/cli-parity/schema-command-md.txt b/tests/fixtures/cli-parity/schema-command-md.txt index 79e622e503..a2adf62080 100644 --- a/tests/fixtures/cli-parity/schema-command-md.txt +++ b/tests/fixtures/cli-parity/schema-command-md.txt @@ -7,16 +7,16 @@ object ## args.properties.path -| Key | Value | -|-------------|------------| -| type | string | -| minLength | 1 | -| pattern | ^[^\x00]*$ | -| description | Local file | +| Key | Value | +|-------------|----------------| +| type | string | +| minLength | 1 | +| pattern | ^\[^\\x00\]\*$ | +| description | Local file | ## args.required -path +\["path"\] ## args.additionalProperties @@ -32,10 +32,10 @@ object ## options.properties.blockSize.anyOf -| type | minimum | maximum | pattern | -|---------|---------|---------|----------| -| integer | 256 | 65536 | | -| string | | | ^[0-9]+$ | +| type | minimum | maximum | pattern | +|---------|---------|---------|------------| +| integer | 256 | 65536 | | +| string | | | ^\[0-9\]+$ | ## options.properties.blockSize.description @@ -47,10 +47,10 @@ Power-of-two block size from 256 to 65536 bytes ## options.properties.offset.anyOf -| type | minimum | maximum | pattern | -|---------|---------|------------------|----------| -| integer | 0 | 9007199254740991 | | -| string | | | ^[0-9]+$ | +| type | minimum | maximum | pattern | +|---------|---------|------------------|------------| +| integer | 0 | 9007199254740991 | | +| string | | | ^\[0-9\]+$ | ## options.properties.offset.description @@ -58,10 +58,10 @@ Window start as a decimal file byte offset ## options.properties.length.anyOf -| type | minimum | maximum | pattern | -|---------|---------|------------------|----------| -| integer | 0 | 9007199254740991 | | -| string | | | ^[0-9]+$ | +| type | minimum | maximum | pattern | +|---------|---------|------------------|------------| +| integer | 0 | 9007199254740991 | | +| string | | | ^\[0-9\]+$ | ## options.properties.length.description @@ -85,7 +85,7 @@ object ## globals.required -timings +\["timings"\] ## globals.additionalProperties diff --git a/tests/fixtures/cli-parity/terminal-error-command-update.txt b/tests/fixtures/cli-parity/terminal-error-command-update.txt new file mode 100644 index 0000000000..ac97bb8e5d --- /dev/null +++ b/tests/fixtures/cli-parity/terminal-error-command-update.txt @@ -0,0 +1,7 @@ +$ rea doctor --update # stdout is a terminal +exit: 1 +--- stdout +Error (UPDATE_FAILED): Use 'rea update' to update the identified installation. The '--update' alias accepts only global output flags. + +--- stderr + diff --git a/tests/fixtures/cli-parity/terminal-error-invalid-completion-shell.txt b/tests/fixtures/cli-parity/terminal-error-invalid-completion-shell.txt new file mode 100644 index 0000000000..5c5a8030ac --- /dev/null +++ b/tests/fixtures/cli-parity/terminal-error-invalid-completion-shell.txt @@ -0,0 +1,7 @@ +$ rea completions bogus # stdout is a terminal +exit: 1 +--- stdout +Error (INVALID_SHELL): Unknown shell 'bogus'. Supported: bash, fish, nushell, zsh + +--- stderr +