MCPcopy Create free account
hub / github.com/Noumena-Network/code / getMaxBudgetUsdAttachment

Function getMaxBudgetUsdAttachment

src/utils/attachments.ts:3853–3869  ·  view source on GitHub ↗
(maxBudgetUsd?: number)

Source from the content-addressed store, hash-verified

3851}
3852
3853function 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).

Callers 1

getAttachmentsFunction · 0.85

Calls 1

getTotalCostUSDFunction · 0.85

Tested by

no test coverage detected