mirror of
https://github.com/morluto/rea.git
synced 2026-11-05 14:26:07 +00:00
refactor(javascript): group domain semantics and contracts (#907)
This commit is contained in:
1 parent
d5f28fb29c
commit
f6a58f1062
253 files changed
+432
-410
No files matched your search
@@ -0,0 +1,28 @@
|
||||
import { z } from "zod";
|
||||
|
||||
import { evidenceSchema } from "../evidence.js";
|
||||
import {
|
||||
javaScriptSemanticQueryInputSchema,
|
||||
javaScriptSemanticQueryResultSchema,
|
||||
} from "./javascriptSemanticQuerySchemas.js";
|
||||
import { prefixedDigestSchema } from "../digests.js";
|
||||
|
||||
const evidenceIdSchema = prefixedDigestSchema("ev");
|
||||
|
||||
/** Authenticated application Evidence plus one bounded semantic query. */
|
||||
export const traceJavaScriptSemanticsInputSchema = z.strictObject({
|
||||
application: evidenceSchema,
|
||||
query: javaScriptSemanticQueryInputSchema,
|
||||
});
|
||||
|
||||
/** Evidence-linked semantic query result shared by CLI and MCP. */
|
||||
export const javaScriptSemanticTraceResultSchema =
|
||||
javaScriptSemanticQueryResultSchema.extend({
|
||||
source_evidence_id: evidenceIdSchema,
|
||||
evidence_links: z.array(evidenceIdSchema).length(1),
|
||||
});
|
||||
|
||||
/** Validated Evidence-linked semantic trace result. */
|
||||
export type JavaScriptSemanticTraceResult = z.infer<
|
||||
typeof javaScriptSemanticTraceResultSchema
|
||||
>;
|
||||
Reference in new issue
Block a user