Files
OmniRoute/src/lib/memory/schemas.ts
Diego Rodrigues de Sa e Souza 0adae00c7b Release v3.8.42 (#5459)
Release v3.8.42 — full CHANGELOG in CHANGELOG.md.

CI: 103 checks green incl. CodeQL (all languages), Semgrep, all 8 unit shards,
coverage, Node 24 compat, and integration tests. Full unit suite validated
locally: 19437 pass / 0 fail. The 3 red checks are advisory and do not gate
main (no required status checks): SonarCloud/SonarQube new-code coverage gate,
and PR Test Policy (test-masking detector flagging the legitimate dead-Phind
provider removal in #5530 — reviewed, correct).

Includes cycle-close reconciliation + repair of inherited base-red tests from
#5480/#5527/#5427/#5521 that the PR->release fast-path did not exercise.
2026-06-30 06:54:29 -03:00

40 lines
1.1 KiB
TypeScript

import { z } from "zod";
import { MemoryType } from "./types";
/**
* MemoryConfig schema - validates memory system configuration settings
*/
export const MemoryConfigSchema = z.object({
enabled: z.boolean(),
maxTokens: z.number().int().nonnegative(),
retrievalStrategy: z.enum(["exact", "semantic", "hybrid"]).optional(),
autoSummarize: z.boolean(),
persistAcrossModels: z.boolean(),
retentionDays: z.number().int().positive(),
scope: z.enum(["session", "apiKey", "global"]).optional(),
});
/**
* MemoryCreateInput schema - validates input for creating new memories
*/
export const MemoryCreateInputSchema = z
.object({
type: z.nativeEnum(MemoryType),
key: z.string().min(1),
content: z.string().min(1),
metadata: z.record(z.string(), z.unknown()).optional(),
})
.strict();
/**
* MemoryUpdateInput schema - validates input for partially updating existing memories
*/
export const MemoryUpdateInputSchema = z
.object({
type: z.nativeEnum(MemoryType).optional(),
key: z.string().min(1).optional(),
content: z.string().min(1).optional(),
metadata: z.record(z.string(), z.unknown()).optional(),
})
.strict();