mirror of
https://github.com/morluto/rea.git
synced 2026-12-05 19:51:20 -05:00
82fd223638
Move shared function, dossier, inventory, reference and output semantics from the legacy Hopper module to native domain owners. Migrate provider, adapter, test and verifier consumers directly.
33 lines
1.1 KiB
TypeScript
33 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 type { ContainingProcedureResolution } from "../domain/native/nativeObservation.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 TraceReference = {
|
|
readonly target_address: string;
|
|
readonly source_address: string;
|
|
readonly containing_procedure: ContainingProcedureResolution;
|
|
};
|
|
|
|
/** 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 })));
|