feat(workbench-ui): add practice evidence endpoint helpers
This commit is contained in:
parent
5379121613
commit
f89909c953
1 changed files with 20 additions and 0 deletions
20
workbench-ui/src/app/trace/practiceEvidenceEndpoint.ts
Normal file
20
workbench-ui/src/app/trace/practiceEvidenceEndpoint.ts
Normal file
|
|
@ -0,0 +1,20 @@
|
|||
import type { PracticeEvidence } from "../../types/practiceEvidence";
|
||||
|
||||
export function tracePracticePath(turnId: number): string {
|
||||
return `/trace/${encodeURIComponent(String(turnId))}/practice`;
|
||||
}
|
||||
|
||||
export async function fetchTracePracticeWith(
|
||||
turnId: number,
|
||||
fetcher: <T>(path: string) => Promise<T>,
|
||||
): Promise<PracticeEvidence> {
|
||||
return fetcher<PracticeEvidence>(tracePracticePath(turnId));
|
||||
}
|
||||
|
||||
export const TRACE_PRACTICE_LOADING_LABEL = "Loading sealed practice evidence...";
|
||||
export const TRACE_PRACTICE_EMPTY_LABEL = "No sealed practice evidence recorded for this turn.";
|
||||
export const TRACE_PRACTICE_ERROR_MUTATION_STATUS = "No trace mutation occurred.";
|
||||
|
||||
export function tracePracticeReproducer(turnId: number): string {
|
||||
return `curl /trace/${encodeURIComponent(String(turnId))}/practice`;
|
||||
}
|
||||
Loading…
Reference in a new issue