Files
OmniRoute/open-sse/services/specificityTypes.ts
backryun fee85b95c2 fix(types): preserve request rule contracts (#9135)
Validated in local merge-train (devbox-vm-06-dev002) @ combined-tip (FAST gates: typecheck/complexity/cognitive/changelog/vitest — only pre-existing audit.test.ts flake). Evidence: /home/diegosouzapw/dev/proxys/OmniRoute/.claude/worktrees/merge-train-20260805-222248-suite.log
2026-08-05 22:31:10 -03:00

45 lines
1.0 KiB
TypeScript

/**
* Query specificity / complexity detection types for Manifest routing integration.
*/
export interface SpecificityResult {
score: number;
breakdown: SpecificityBreakdown;
rulesTriggered: string[];
inputTokens: number;
confidence: number;
}
export interface SpecificityBreakdown {
codeComplexity: number;
mathComplexity: number;
reasoningDepth: number;
contextSize: number;
toolCalling: number;
domainSpecificity: number;
}
export interface SpecificityRule {
name: string;
category: keyof SpecificityBreakdown;
weight: number;
detect(input: RuleInput): RuleMatch | null;
}
export interface RuleInput {
messages: Array<{ role?: string; content?: string | unknown }>;
systemPrompt?: string;
tools?: Array<{
type?: string;
function?: { name: string; description?: string; parameters?: unknown };
}>;
model?: string;
}
export interface RuleMatch {
score: number;
evidence: string;
}
export type SpecificityLevel = "trivial" | "simple" | "moderate" | "complex" | "expert";