Files
reverse-engineering-anything/src/application/EnhancedToolTypes.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

37 lines
1.1 KiB
TypeScript

import type { z } from "zod";
import { AnalysisInputError } from "../domain/analysisErrorCore.js";
import { type AnalysisError } from "../domain/analysisErrorBase.js";
import type { JsonValue } from "../domain/jsonValue.js";
import { err, type Result } from "../domain/result.js";
import {
enhancedInputSchemas,
type EnhancedToolName,
} from "../contracts/enhancedInputs.js";
export type EnhancedResult = Promise<Result<JsonValue, AnalysisError>>;
export type TraceMatch = {
readonly type: string;
readonly address: string;
readonly value: string;
};
export type TraceReference = {
readonly target_address: string;
readonly source_address: string;
readonly containing_procedure: JsonValue;
};
/** One enhanced call whose input was parsed at its owning adapter boundary. */
export type ValidatedEnhancedCall = {
[Name in EnhancedToolName]: {
readonly name: Name;
readonly input: z.output<(typeof enhancedInputSchemas)[Name]>;
};
}[EnhancedToolName];
export const invalidEnhancedInput = (
name: EnhancedToolName,
cause: Error,
): EnhancedResult =>
Promise.resolve(err(new AnalysisInputError(name, { cause })));