refactor(app): split session and CLI workflows

This commit is contained in:
morluto committed 2026-07-18 05:49:14 +00:00
1 parent 3e61a63a10
commit c6ee0049c4
88 files changed
+7428 -6024

No files matched your search

+35
View File
@@ -0,0 +1,35 @@
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/errors.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);
}),
});
};