mirror of
https://github.com/morluto/rea.git
synced 2026-12-03 21:46:01 +00:00
perf(cli): decouple lazy CLI startup from AnalysisView, session contracts, and MCP registration (#13435)
* perf(cli): decouple lazy CLI startup from AnalysisView, session contracts, and MCP registration * test(cli): use bundled CLI runs for heavy startup positive controls
This commit is contained in:
1 parent
365bbd9008
commit
3f83c87201
11 files changed
+206
-95
No files matched your search
+10
-8
@@ -15,8 +15,10 @@ import type { CliResultOutput } from "./cliResultOutput.js";
|
||||
import { runCliCommand } from "./runCliCommand.js";
|
||||
import { completionHelpNote, createCliCompletions } from "./completions.js";
|
||||
import { serveDiscovery } from "./discovery.js";
|
||||
import { reportUnknownMcpSubcommand } from "./mcpBuiltinCommands.js";
|
||||
import { serveMcpRegistration } from "./mcpRegistration.js";
|
||||
import {
|
||||
isMcpRegistrationCommand,
|
||||
reportUnknownMcpSubcommand,
|
||||
} from "./mcpBuiltinCommands.js";
|
||||
import { presentOmittableDefaults } from "./omittableDefaults.js";
|
||||
import type { CliInstance, CliServeOptions } from "./types.js";
|
||||
|
||||
@@ -108,12 +110,12 @@ export const createCliShell = (options: CliShellOptions): CliInstance => {
|
||||
const global = parseCliGlobalArguments(arguments_);
|
||||
if (completions.writeScript(global, serveOptions ?? {}))
|
||||
return Promise.resolve();
|
||||
const registration = serveMcpRegistration(
|
||||
global,
|
||||
environment,
|
||||
serveOptions ?? {},
|
||||
);
|
||||
if (registration !== undefined) return registration;
|
||||
if (isMcpRegistrationCommand(global))
|
||||
return import("./mcpRegistration.js").then(
|
||||
({ serveMcpRegistration }) =>
|
||||
serveMcpRegistration(global, environment, serveOptions ?? {}) ??
|
||||
Promise.resolve(),
|
||||
);
|
||||
const result = reportUnknownMcpSubcommand(
|
||||
cli.name,
|
||||
global,
|
||||
|
||||
Reference in new issue
Block a user