Files
rea/src/cli/managedProjectGraphCommand.ts
T
morluto 735c10059c refactor(domain): split error taxonomy into thematic modules (#636)
Move each error family out of domain/errors.ts into its own module
(base, core, provider selection/adapter, browser observation,
artifact, evidence, unknown registry, hopper, configuration) and
relocate AnalysisErrorProjection to analysisErrorProjection.
Migrate all 162 importers to the owning modules and delete
errors.ts. No re-export shims; behavior is unchanged.
2026-10-06 05:57:38 +08:00

36 lines
1.4 KiB
TypeScript

import { z } from "incur";
import { projectManagedApplicationGraphEvidence } from "../application/ManagedApplicationGraphService.js";
import { CLI_COMMANDS } from "../cliCommandNames.js";
import { parseCliJsonInput } from "../cliJsonInput.js";
import { logCliCommand } from "../cliLogging.js";
import { projectAnalysisError } from "../domain/analysisErrorProjection.js";
import type { Logger } from "../logger.js";
import type { CliInstance } from "./types.js";
/** Register managed static-Evidence application graph projection. */
export const registerProjectManagedApplicationGraph = (
cli: CliInstance,
logger: Logger,
): void => {
cli.command(CLI_COMMANDS.projectManagedApplicationGraph, {
description:
"Project authenticated managed static Evidence into an application graph",
args: z.object({
inputJson: z
.string()
.describe("Inline managed application graph JSON or JSON file path"),
}),
run: ({ args }) =>
logCliCommand(logger, "project-managed-application-graph", async () => {
const input = await parseCliJsonInput(
args.inputJson,
"project-managed-application-graph",
);
if (!input.ok) return input.error;
const result = projectManagedApplicationGraphEvidence(input.value);
return result.ok ? result.value : projectAnalysisError(result.error);
}),
});
};