mirror of
https://github.com/morluto/rea.git
synced 2026-11-16 19:53:50 +00:00
refactor: consolidate shared analysis boundaries (#10293)
This commit is contained in:
1 parent
6878a84796
commit
c836f57b7d
70 files changed
+1240
-1131
No files matched your search
+8
-18
@@ -1,8 +1,7 @@
|
||||
import { inspectGpuCodeObjectsInputSchema } from "../domain/gpu/gpuCodeObjects.js";
|
||||
import { analysisInputErrorFromIssues } from "../domain/inputIssueProjection.js";
|
||||
import { AnalysisInputError } from "../domain/analysisErrorCore.js";
|
||||
import { projectAnalysisError } from "../domain/analysisErrorProjection.js";
|
||||
import { safeParseJson } from "../domain/safeJson.js";
|
||||
import { parseCliJsonOption } from "./cliJsonOption.js";
|
||||
import { z } from "incur";
|
||||
import type { Logger } from "pino";
|
||||
import type { CliInstance } from "./types.js";
|
||||
@@ -61,22 +60,13 @@ export const registerGpuCommands = (cli: CliInstance, logger: Logger): void => {
|
||||
for (const name of ["object_ids", "targets", "view"] as const) {
|
||||
const value = options[name];
|
||||
if (value === undefined) continue;
|
||||
const decoded = safeParseJson(value);
|
||||
if (!decoded.ok) {
|
||||
return projectAnalysisError(
|
||||
new AnalysisInputError(
|
||||
"inspect_gpu_code_objects",
|
||||
{ cause: decoded.cause },
|
||||
[
|
||||
{
|
||||
path: [name],
|
||||
reason: "invalid_format",
|
||||
message: `${name} must be valid JSON`,
|
||||
},
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
const decoded = parseCliJsonOption(
|
||||
"inspect_gpu_code_objects",
|
||||
name,
|
||||
value,
|
||||
`${name} must be valid JSON`,
|
||||
);
|
||||
if (!decoded.ok) return projectAnalysisError(decoded.error);
|
||||
selectors[name] = decoded.value;
|
||||
}
|
||||
const rawInput = {
|
||||
|
||||
Reference in new issue
Block a user