diff options
| author | soryu <soryu@soryu.co> | 2026-01-25 02:55:45 +0000 |
|---|---|---|
| committer | soryu <soryu@soryu.co> | 2026-01-25 02:55:45 +0000 |
| commit | b58a7a92f86784620bd5eb214d7f191c6f68f4d3 (patch) | |
| tree | c927ff7a2796de8f92cd7b8ebcf2a79c63c75901 /makima/frontend/src/lib | |
| parent | 579c983d3efb8f1414ffb45b9e031f741cce5f76 (diff) | |
| download | soryu-b58a7a92f86784620bd5eb214d7f191c6f68f4d3.tar.gz soryu-b58a7a92f86784620bd5eb214d7f191c6f68f4d3.zip | |
[WIP] Heartbeat checkpoint - 2026-01-25 02:55:45 UTCmakima/task-task-418149db-418149db
Diffstat (limited to 'makima/frontend/src/lib')
| -rw-r--r-- | makima/frontend/src/lib/api.ts | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/makima/frontend/src/lib/api.ts b/makima/frontend/src/lib/api.ts index 76ee4d4..9af7f3c 100644 --- a/makima/frontend/src/lib/api.ts +++ b/makima/frontend/src/lib/api.ts @@ -1507,6 +1507,43 @@ export function getDefaultPhase(contractType: ContractType): ContractPhase { return "research"; } +// ============================================================================= +// Contract Type Templates +// ============================================================================= + +/** Contract type template returned by the API */ +export interface ContractTypeTemplate { + /** Template identifier (e.g., "simple", "specification") */ + id: string; + /** Display name */ + name: string; + /** Description of the contract type workflow */ + description: string; + /** Ordered list of phases for this contract type */ + phases: ContractPhase[]; + /** Default starting phase */ + defaultPhase: ContractPhase; + /** Whether this is a built-in type (always available) */ + isBuiltin: boolean; +} + +/** Response from list contract types endpoint */ +export interface ListContractTypesResponse { + types: ContractTypeTemplate[]; +} + +/** + * List available contract types/templates. + * Returns built-in types (simple, specification) and any custom types. + */ +export async function listContractTypes(): Promise<ListContractTypesResponse> { + const res = await authFetch(`${API_BASE}/api/v1/contract-types`); + if (!res.ok) { + throw new Error(`Failed to list contract types: ${res.statusText}`); + } + return res.json(); +} + export interface ContractRepository { id: string; contractId: string; |
