fix(cli): stream JSON results at the shared command boundary
Route ordinary CLI results through the bounded JSON writer after command registration, including managed member inspection. Remove JavaScript-specific output plumbing while preserving filters, envelopes, cancellation, and failure exits. Measure formatted UTF-16 expansion before Incur token counting and return resource_constraint above the runtime string limit, with recovery guidance. Validate output above the real V8 string limit by SHA-256 and exercise the compiled managed provider. Clean-worktree validation: npm run check; 76 focused tests passed, with 2 optional-provider skips; test discovery passed. Fixes #1371.
This commit is contained in:
+7
-8
@@ -31,7 +31,10 @@ import { registerJavaScriptRuntimeObservationCommands } from "./cliJavaScriptRun
|
||||
import { registerApplicationCommands } from "./cli/applicationCommands.js";
|
||||
import { presentOmittableDefaults } from "./cli/omittableDefaults.js";
|
||||
import type { CliInstance } from "./cli/types.js";
|
||||
import type { CliResultOutput } from "./cli/streamedJsonOutput.js";
|
||||
import {
|
||||
streamCliCommandResults,
|
||||
type CliResultOutput,
|
||||
} from "./cli/streamedJsonOutput.js";
|
||||
|
||||
/**
|
||||
* Build the one-shot Incur CLI without starting Hopper at import time.
|
||||
@@ -64,12 +67,7 @@ export const createCli = (
|
||||
});
|
||||
|
||||
registerSetupCommands(cli, logger, environment);
|
||||
registerCoreAnalysisCommands(
|
||||
cli,
|
||||
logger,
|
||||
analysis.runDirectAnalysis,
|
||||
resultOutput,
|
||||
);
|
||||
registerCoreAnalysisCommands(cli, logger, analysis.runDirectAnalysis);
|
||||
registerUtilityCommands(cli, logger, environment, analysis);
|
||||
registerEvmCommands(cli, logger, environment);
|
||||
registerArtifactCommands(cli, logger, analysis.runProviderAnalysis);
|
||||
@@ -89,9 +87,10 @@ export const createCli = (
|
||||
registerJavaScriptRecoveryCommands(cli, logger, environment);
|
||||
registerAdvancedBrowserCommands(cli, logger);
|
||||
registerBrowserScenarioCommands(cli, logger, environment);
|
||||
registerElectronCommands(cli, logger, environment, resultOutput);
|
||||
registerElectronCommands(cli, logger, environment);
|
||||
registerJavaScriptRuntimeObservationCommands(cli, logger);
|
||||
registerApplicationCommands(cli, logger);
|
||||
presentOmittableDefaults(cli);
|
||||
if (resultOutput !== undefined) streamCliCommandResults(cli, resultOutput);
|
||||
return cli;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user