(maxBudgetUsd?: number)
| 3851 | } |
| 3852 | |
| 3853 | function getMaxBudgetUsdAttachment(maxBudgetUsd?: number): Attachment[] { |
| 3854 | if (maxBudgetUsd === undefined) { |
| 3855 | return [] |
| 3856 | } |
| 3857 | |
| 3858 | const usedCost = getTotalCostUSD() |
| 3859 | const remainingBudget = maxBudgetUsd - usedCost |
| 3860 | |
| 3861 | return [ |
| 3862 | { |
| 3863 | type: 'budget_usd', |
| 3864 | used: usedCost, |
| 3865 | total: maxBudgetUsd, |
| 3866 | remaining: remainingBudget, |
| 3867 | }, |
| 3868 | ] |
| 3869 | } |
| 3870 | |
| 3871 | /** |
| 3872 | * Count human turns since plan mode exit (plan_mode_exit attachment). |
no test coverage detected