story-kit: merge 300_story_show_token_cost_badge_on_pipeline_board_work_items

This commit is contained in:
Dave
2026-03-19 11:00:10 +00:00
parent b6f99ce7a2
commit 36535b639f
4 changed files with 137 additions and 0 deletions

View File

@@ -143,6 +143,20 @@ export interface SearchResult {
matches: number;
}
export interface AgentCostEntry {
agent_name: string;
input_tokens: number;
output_tokens: number;
cache_creation_input_tokens: number;
cache_read_input_tokens: number;
total_cost_usd: number;
}
export interface TokenCostResponse {
total_cost_usd: number;
agents: AgentCostEntry[];
}
export interface CommandOutput {
stdout: string;
stderr: string;
@@ -316,6 +330,13 @@ export const api = {
baseUrl,
);
},
getTokenCost(storyId: string, baseUrl?: string) {
return requestJson<TokenCostResponse>(
`/work-items/${encodeURIComponent(storyId)}/token-cost`,
{},
baseUrl,
);
},
/** Approve a story in QA, moving it to merge. */
approveQa(storyId: string) {
return callMcpTool("approve_qa", { story_id: storyId });