import{getSessionTokenUsage}from"#harness/turn-tag-state.js";function resolveRemainingSessionTokenLimits(t,n=1){let r=Math.max(1,Math.floor(n)),i=getSessionTokenUsage(t);return{maxInputTokensPerSession:grantShare(remainingQuota(t.limits?.maxInputTokensPerSession,i.inputTokens),r),maxOutputTokensPerSession:grantShare(remainingQuota(t.limits?.maxOutputTokensPerSession,i.outputTokens),r)}}function remainingQuota(e,t){return e===void 0?!1:Math.max(0,e-t)}function grantShare(e,t){return e===!1?!1:Math.floor(e/t)}export{resolveRemainingSessionTokenLimits};