feat(api): add confluence tRPC router (slots, racks, evaluation, backtest, scorecard, saveRack) + client exposure (M22 slice 6)
This commit is contained in:
@@ -1426,6 +1426,55 @@ export const api = {
|
||||
commentary: () => trpcQuery<{ shortTerm: string; longTerm: string; disclaimer: string }>("macro.commentary"),
|
||||
regimeClassify: () => trpcQuery<{ regime: string; confidence?: number; factors?: unknown }>("macro.regimeClassify"),
|
||||
},
|
||||
confluence: {
|
||||
slots: () => trpcQuery<{
|
||||
slots: Array<{ id: string; name: string; family: string; body: string; granularity: string; explain: string }>;
|
||||
slotIds: string[];
|
||||
families: string[];
|
||||
}>("confluence.slots", {}),
|
||||
racks: () => trpcQuery<{
|
||||
system: Array<{ id: string; ownerId: string | null; name: string; slotIds: string[]; description: string | null; isSystem: boolean; createdAt: string }>;
|
||||
user: Array<{ id: string; ownerId: string | null; name: string; slotIds: string[]; description: string | null; isSystem: boolean; createdAt: string }>;
|
||||
}>("confluence.racks", {}),
|
||||
evaluation: (symbol: string, opts?: { rackId?: string; limit?: number }) =>
|
||||
trpcQuery<{
|
||||
rackId: string | null;
|
||||
symbol: string;
|
||||
latest: Record<string, unknown> | null;
|
||||
history: Array<Record<string, unknown>>;
|
||||
change: {
|
||||
changed: boolean;
|
||||
changeType: string;
|
||||
current: string;
|
||||
previous: string | null;
|
||||
netEvidenceShift: number;
|
||||
flippedSlotIds: string[];
|
||||
} | null;
|
||||
}>("confluence.evaluation", { symbol, ...(opts?.rackId ? { rackId: opts.rackId } : {}), ...(opts?.limit ? { limit: opts.limit } : {}) }),
|
||||
backtest: (symbol: string, opts?: { weeks?: number }) =>
|
||||
trpcQuery<{
|
||||
symbol: string;
|
||||
fires: number;
|
||||
horizonDays: number;
|
||||
slots: Array<{
|
||||
slotId: string;
|
||||
name: string;
|
||||
body: string;
|
||||
direction: string;
|
||||
fires: number;
|
||||
resolvedFires: number;
|
||||
confirmedFires: number;
|
||||
falseAlarms: number;
|
||||
hitRate: number | null;
|
||||
reliabilityWeight: number;
|
||||
}>;
|
||||
sampleSizeCaveat: string;
|
||||
}>("confluence.backtest", { symbol, ...(opts?.weeks ? { weeks: opts.weeks } : {}) }),
|
||||
scorecard: (symbol?: string) =>
|
||||
trpcQuery<{ slots: unknown[]; note: string }>("confluence.scorecard", symbol ? { symbol } : {}),
|
||||
saveRack: (input: { id?: string; name: string; description?: string; slotIds: string[] }) =>
|
||||
trpcMutate<{ id: string; name: string; slotIds: string[]; isSystem: boolean; description: string | null }>("confluence.saveRack", input),
|
||||
},
|
||||
};
|
||||
|
||||
export interface TickerSuggestion {
|
||||
|
||||
Reference in New Issue
Block a user