@adminide-stack/yantra-mobile 12.0.183 → 12.0.184-alpha.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -28,24 +28,25 @@ const creditsPerUsdNow = () => reportedCreditsPerUsd != null ? reportedCreditsPe
28
28
  const toCredits = (usd, creditsPerUsd = creditsPerUsdNow()) => Math.round(Math.max(0, usd) * creditsPerUsd);
29
29
  const HOUR_MS = 36e5;
30
30
  const DAY_MS = 24 * HOUR_MS;
31
- function formatReset(resetAt, now = Date.now()) {
32
- if (!resetAt) return null;
33
- const d = new Date(resetAt);
34
- if (Number.isNaN(d.getTime())) return null;
35
- const ms = d.getTime() - now;
36
- if (ms <= 0) return "Your free credits refresh shortly.";
31
+ const plural = (n) => n === 1 ? "" : "s";
32
+ function fromNow(at, now = Date.now()) {
33
+ const ms = at - now;
34
+ if (!(ms > 0)) return "";
37
35
  const hours = Math.round(ms / HOUR_MS);
38
36
  if (hours < 1) {
39
37
  const mins = Math.max(1, Math.round(ms / 6e4));
40
- return `Refreshes in about ${mins} minute${mins === 1 ? "" : "s"}.`;
38
+ return `in about ${mins} minute${plural(mins)}`;
41
39
  }
42
- if (hours < 24) return `Refreshes in about ${hours} hour${hours === 1 ? "" : "s"}.`;
40
+ if (hours < 24) return `in about ${hours} hour${plural(hours)}`;
43
41
  const days = Math.round(hours / 24);
44
- if (days <= 1) return "Refreshes tomorrow.";
45
- return `Refreshes on ${d.toLocaleDateString(void 0, {
46
- month: "short",
47
- day: "numeric"
48
- })}.`;
42
+ return days <= 1 ? "tomorrow" : `in ${days} days`;
43
+ }
44
+ function formatReset(resetAt, now = Date.now()) {
45
+ if (!resetAt) return null;
46
+ const at = new Date(resetAt).getTime();
47
+ if (Number.isNaN(at)) return null;
48
+ const when = fromNow(at, now);
49
+ return when ? `Refreshes ${when}.` : "Your credits refresh shortly.";
49
50
  }
50
51
  const DAY_WINDOW_MAX_MS = DAY_MS + 6e4;
51
52
  function instantOf(iso) {
@@ -148,4 +149,4 @@ function creditsLine(summary) {
148
149
  detail: summary.long
149
150
  };
150
151
  }
151
- const meterWidth = (left) => left > 0 ? Math.max(3, left * 100) : 0;export{CREDITS_PER_USD,LOW_CREDITS_PCT,creditsLeftLabel,creditsLine,creditsPerUsdNow,creditsSummary,formatReset,meterWidth,rememberCreditsPerUsd,toCredits,withWindowStart};//# sourceMappingURL=credits.js.map
152
+ const meterWidth = (left) => left > 0 ? Math.max(3, left * 100) : 0;export{CREDITS_PER_USD,LOW_CREDITS_PCT,creditsLeftLabel,creditsLine,creditsPerUsdNow,creditsSummary,formatReset,fromNow,meterWidth,rememberCreditsPerUsd,toCredits,withWindowStart};//# sourceMappingURL=credits.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"credits.js","sources":["../../../src/features/credits/credits.ts"],"sourcesContent":["/**\n * The web's credits arithmetic (account/browser features/chat/credits.ts) and its sidebar footer's\n * line (features/chat/sidebar/sidebarModel.ts `creditsLine`), so the phone words the same verdict\n * the same way.\n *\n * The backend accounts allowance in USD; the product speaks in credits at the rate the\n * backend reports (`creditRate.creditsPerUsd`, MODEL_CREDITS_PER_USD_MONTH in\n * billing-api-server): 1,000 / $1 since 2026-10-29, 500 / $1 before its switch migration ran.\n */\nexport const CREDITS_PER_USD = 1_000;\n\n/** The last rate the backend reported, and when; every surface converts with it once one has been read. */\nlet reportedCreditsPerUsd: number | null = null;\nlet reportedAt = 0;\n/** When a read last brought back no rate. */\nlet failedAt = Number.NEGATIVE_INFINITY;\n\n/** The rate changes once (the 2026-10-29 switch), so a reported one is re-read only this often. */\nexport const CREDITS_RATE_REREAD_MS = 10 * 60_000;\n\n/** A read that brought back no rate (the network, a failing backend) is not repeated for this long. */\nexport const CREDITS_RATE_RETRY_MS = 60_000;\n\n/** Keeps the rate the backend reported; a read without one (not a positive number) is noted as failed. */\nexport function rememberCreditsPerUsd(rate: number | null | undefined, now: number = Date.now()): void {\n if (typeof rate === 'number' && Number.isFinite(rate) && rate > 0) {\n reportedCreditsPerUsd = rate;\n reportedAt = now;\n failedAt = Number.NEGATIVE_INFINITY;\n } else {\n failedAt = now;\n }\n}\n\n/** Whether the backend's rate was read recently enough, or failed recently enough, not to ask again. */\nexport const creditsPerUsdIsFresh = (now: number = Date.now()): boolean =>\n (reportedCreditsPerUsd !== null && now - reportedAt < CREDITS_RATE_REREAD_MS) ||\n now - failedAt < CREDITS_RATE_RETRY_MS;\n\n/** Credits per $1 to convert with: the backend's rate once read, else {@link CREDITS_PER_USD}. */\nexport const creditsPerUsdNow = (): number => reportedCreditsPerUsd ?? CREDITS_PER_USD;\n\nexport const toCredits = (usd: number, creditsPerUsd: number = creditsPerUsdNow()): number =>\n Math.round(Math.max(0, usd) * creditsPerUsd);\n\n/** The slice of a checkLLMSpend verdict the credit displays read. */\nexport interface CreditsVerdict {\n includedUsd?: number | null;\n remainingUsd?: number | null;\n resetAt?: string | null;\n /**\n * When the window began (checkLLMSpend.periodStart, read apart from the verdict: see\n * withWindowStart). With resetAt it names the window; without it the reset alone does.\n */\n periodStart?: string | null;\n}\n\nexport type CreditsPeriod = 'today' | 'this month' | 'this period';\n\nexport interface CreditsSummary {\n /** The plan's credits for the period (0 when it includes none). */\n total: number;\n used: number;\n remaining: number;\n /** Credit pack credits left: they never expire and are spent after the plan's credits. */\n packCredits: number;\n /** Everything that can still be spent: the plan's credits left plus the packs. */\n available: number;\n /** Whole percent of the allowance used, 0-100. */\n pct: number;\n /** Credits per $1 the figures are in (the backend's rate): \"1,000 credits = $1\". */\n creditsPerUsd: number;\n period: CreditsPeriod;\n /** \"Refreshes in about 5 hours.\" - null when the verdict carries no reset. */\n resetText: string | null;\n /** Chip label: \"1,000 left today\". */\n short: string;\n /** Tooltip / subtitle: \"0 of 1,000 credits used today. Refreshes in about 5 hours.\" */\n long: string;\n}\n\nconst HOUR_MS = 3_600_000;\nconst DAY_MS = 24 * HOUR_MS;\n\n/** Human \"refreshes in…\" line from the reset timestamp; null when unknown. */\nexport function formatReset(resetAt?: string | null, now: number = Date.now()): string | null {\n if (!resetAt) return null;\n const d = new Date(resetAt);\n if (Number.isNaN(d.getTime())) return null;\n const ms = d.getTime() - now;\n if (ms <= 0) return 'Your free credits refresh shortly.';\n const hours = Math.round(ms / HOUR_MS);\n if (hours < 1) {\n const mins = Math.max(1, Math.round(ms / 60_000));\n return `Refreshes in about ${mins} minute${mins === 1 ? '' : 's'}.`;\n }\n if (hours < 24) return `Refreshes in about ${hours} hour${hours === 1 ? '' : 's'}.`;\n const days = Math.round(hours / 24);\n if (days <= 1) return 'Refreshes tomorrow.';\n return `Refreshes on ${d.toLocaleDateString(undefined, { month: 'short', day: 'numeric' })}.`;\n}\n\n/** The window a credit allowance is counted over, as checkLLMSpend reports it. */\nexport interface CreditWindow {\n periodStart?: string | null;\n resetAt?: string | null;\n}\n\n/** The longest window named \"today\": a day, with a minute to spare. */\nconst DAY_WINDOW_MAX_MS = DAY_MS + 60_000;\n\n/** The instant an ISO timestamp names; null when it is missing or unreadable. */\nfunction instantOf(iso: string | null | undefined): number | null {\n if (!iso) return null;\n const t = new Date(iso).getTime();\n return Number.isNaN(t) ? null : t;\n}\n\n/**\n * A window's start and end (epoch ms); null without both, with an unreadable one, or when it\n * does not end after it starts.\n */\nfunction boundsOf(window: CreditWindow | null | undefined): { start: number; end: number } | null {\n const start = instantOf(window?.periodStart);\n const end = instantOf(window?.resetAt);\n return start !== null && end !== null && end > start ? { start, end } : null;\n}\n\n/**\n * Which window the allowance belongs to, named from its span, never from the time left in it:\n * the free daily drip is a UTC day, \"today\"; the free monthly pot a UTC calendar month, \"this\n * month\", on its last day too, when it refills within hours as a day's would; anything else\n * \"this period\" - a paid plan's billing period, or the month of a yearly plan's term, which run\n * from the second the subscription started, the last day included.\n */\nfunction periodOfSpan({ start, end }: { start: number; end: number }): CreditsPeriod {\n if (end - start <= DAY_WINDOW_MAX_MS) return 'today';\n const from = new Date(start);\n const oneUtcMonth =\n start === Date.UTC(from.getUTCFullYear(), from.getUTCMonth(), 1) &&\n end === Date.UTC(from.getUTCFullYear(), from.getUTCMonth() + 1, 1);\n return oneUtcMonth ? 'this month' : 'this period';\n}\n\n/**\n * Which window the allowance belongs to, read off the reset instant alone, for a backend that\n * does not send the window's start: the free daily drip resets at the next UTC midnight (under\n * a day away), the free monthly cap on the first of next month, and a paid plan at its billing\n * period end (a yearly plan's at the end of the month of its term) - the second its\n * subscription started, so a paid plan's last day is still \"this period\", not \"today\". The\n * monthly cap's last day reads \"today\" here: its reset is as near as a day's.\n */\nfunction periodOfReset(resetAt: string | null | undefined, now: number): CreditsPeriod {\n if (!resetAt) return 'this period';\n const t = new Date(resetAt).getTime();\n if (Number.isNaN(t)) return 'this period';\n const d = new Date(t);\n const utcMidnight =\n d.getUTCHours() === 0 && d.getUTCMinutes() === 0 && d.getUTCSeconds() === 0 && d.getUTCMilliseconds() === 0;\n if (!utcMidnight) return 'this period';\n if (t - now <= DAY_MS) return 'today';\n return d.getUTCDate() === 1 ? 'this month' : 'this period';\n}\n\n/** The window's word: from its span when the backend names its start, else from its reset alone. */\nfunction periodOf(window: CreditWindow | null | undefined, now: number): CreditsPeriod {\n const bounds = boundsOf(window);\n return bounds ? periodOfSpan(bounds) : periodOfReset(window?.resetAt, now);\n}\n\n/**\n * The verdict with the start of its window, which is read apart from it (checkLLMSpend\n * { periodStart resetAt }: a backend that predates periodStart rejects the field, and that must\n * never cost the verdict). Only when that window ends where the verdict resets, so the two always\n * describe one window: a verdict and a window read either side of a reset are never paired.\n * Otherwise the verdict as it is, named from its reset alone.\n */\nexport function withWindowStart(\n verdict: CreditsVerdict | null,\n window: CreditWindow | null | undefined,\n): CreditsVerdict | null {\n if (!verdict || !window?.periodStart) return verdict;\n const end = instantOf(window.resetAt);\n return end !== null && end === instantOf(verdict.resetAt)\n ? { ...verdict, periodStart: window.periodStart }\n : verdict;\n}\n\n/** The span the Usage page reports spend over. */\nexport interface UsageWindow {\n start: Date;\n end: Date;\n /** True when this is the AI-credit window, so spend can be measured against the allowance. */\n creditPeriod: boolean;\n}\n\nfunction calendarMonth(now: Date): UsageWindow {\n return {\n start: new Date(now.getFullYear(), now.getMonth(), 1),\n end: new Date(now.getFullYear(), now.getMonth() + 1, 0, 23, 59, 59, 999),\n creditPeriod: false,\n };\n}\n\n/**\n * The window the Usage page reports on: the AI-credit window when the backend names one\n * longer than a day - a paid plan's billing period, the month of a yearly plan's term, the\n * free tier's month - so the page's spend and its budget describe the same span as the\n * allowance (a plan billed from the 9th showed calendar-month spend of $49.60 against a $10\n * allowance whose period began that day). Otherwise the calendar month: a daily free-tier\n * window (the one the credits are \"today\" in) is too short to report history on, and an\n * older backend does not name the window at all.\n */\nexport function usageWindow(window: CreditWindow | null | undefined, now: Date = new Date()): UsageWindow {\n const bounds = boundsOf(window);\n if (bounds && periodOfSpan(bounds) !== 'today') {\n return { start: new Date(bounds.start), end: new Date(bounds.end), creditPeriod: true };\n }\n return calendarMonth(now);\n}\n\n/** Pack credits from USD, floored so a balance never shows a credit it cannot pay for. */\nconst toPackCredits = (usd: number | null | undefined, creditsPerUsd: number): number =>\n Math.floor(Math.max(0, usd ?? 0) * creditsPerUsd + 1e-6);\n\n/**\n * Credits view of a verdict and the credit pack balance, or null when there is nothing to\n * spend from at all - no allowance and no packs - which is the out-of-credits dialog's case,\n * not a meter's.\n */\nexport function creditsSummary(\n verdict: CreditsVerdict | null | undefined,\n now: number = Date.now(),\n packRemainingUsd: number | null = null,\n creditsPerUsd: number = creditsPerUsdNow(),\n): CreditsSummary | null {\n const includedUsd = verdict?.includedUsd ?? 0;\n const packCredits = toPackCredits(packRemainingUsd, creditsPerUsd);\n const packLine = packCredits > 0 ? `${packCredits.toLocaleString()} pack credits left, which never expire.` : '';\n\n if (includedUsd <= 0) {\n if (packCredits <= 0) return null;\n return {\n total: 0,\n used: 0,\n remaining: 0,\n packCredits,\n available: packCredits,\n pct: 0,\n creditsPerUsd,\n period: 'this period',\n resetText: null,\n short: `${packCredits.toLocaleString()} pack credits left`,\n long: packLine,\n };\n }\n\n const total = toCredits(includedUsd, creditsPerUsd);\n const remaining = Math.min(total, toCredits(verdict?.remainingUsd ?? 0, creditsPerUsd));\n const used = total - remaining;\n const pct = Math.min(100, Math.round((used / total) * 100));\n const period = periodOf(verdict, now);\n const resetText = formatReset(verdict?.resetAt, now);\n const available = remaining + packCredits;\n\n return {\n total,\n used,\n remaining,\n packCredits,\n available,\n pct,\n creditsPerUsd,\n period,\n resetText,\n short: packCredits > 0 ? `${available.toLocaleString()} left` : `${remaining.toLocaleString()} left ${period}`,\n long: `${used.toLocaleString()} of ${total.toLocaleString()} credits used ${period}.${resetText ? ` ${resetText}` : ''}${packLine ? ` ${packLine}` : ''}`,\n };\n}\n\n/** \"1 credit left\", \"1,250 credits left\". */\nexport function creditsLeftLabel(count: number): string {\n const credits = Math.max(0, Math.floor(count));\n return `${credits.toLocaleString()} ${credits === 1 ? 'credit' : 'credits'} left`;\n}\n\n/** Used from here on, credits are running low: the Usage page's amber line. */\nexport const LOW_CREDITS_PCT = 80;\n\nexport interface CreditsLine {\n /** \"1 credit left\": everything that can still be spent, the plan's and the packs'. */\n label: string;\n /** Share of the plan's credits still left, 0-1, for the meter. Null with packs on hand, or a plan with none. */\n left: number | null;\n /** Nothing left, or most of the plan's credits used with no packs behind them: \"Top up\" shows. */\n low: boolean;\n /** \"980 of 1,000 credits used today. Refreshes in about 5 hours.\" */\n detail: string;\n}\n\nexport function creditsLine(summary: CreditsSummary): CreditsLine {\n const packs = summary.packCredits > 0;\n return {\n label: creditsLeftLabel(summary.available),\n left: !packs && summary.total > 0 ? Math.min(1, Math.max(0, summary.remaining / summary.total)) : null,\n low: summary.available <= 0 || (!packs && summary.pct >= LOW_CREDITS_PCT),\n detail: summary.long,\n };\n}\n\n/** The meter never draws a sliver too thin to see while anything is left. */\nexport const meterWidth = (left: number) => (left > 0 ? Math.max(3, left * 100) : 0);\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;AASO,MAAM,eAAkB,GAAA;AAG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AI,CAAA,CAAA,EAAG,IAAO,GAAA,GAAG,CAAI,GAAA"}
1
+ {"version":3,"file":"credits.js","sources":["../../../src/features/credits/credits.ts"],"sourcesContent":["/**\n * The web's credits arithmetic (account/browser features/chat/credits.ts) and its sidebar footer's\n * line (features/chat/sidebar/sidebarModel.ts `creditsLine`), so the phone words the same verdict\n * the same way.\n *\n * The backend accounts allowance in USD; the product speaks in credits at the rate the\n * backend reports (`creditRate.creditsPerUsd`, MODEL_CREDITS_PER_USD_MONTH in\n * billing-api-server): 1,000 / $1 since 2026-10-29, 500 / $1 before its switch migration ran.\n */\nexport const CREDITS_PER_USD = 1_000;\n\n/** The last rate the backend reported, and when; every surface converts with it once one has been read. */\nlet reportedCreditsPerUsd: number | null = null;\nlet reportedAt = 0;\n/** When a read last brought back no rate. */\nlet failedAt = Number.NEGATIVE_INFINITY;\n\n/** The rate changes once (the 2026-10-29 switch), so a reported one is re-read only this often. */\nexport const CREDITS_RATE_REREAD_MS = 10 * 60_000;\n\n/** A read that brought back no rate (the network, a failing backend) is not repeated for this long. */\nexport const CREDITS_RATE_RETRY_MS = 60_000;\n\n/** Keeps the rate the backend reported; a read without one (not a positive number) is noted as failed. */\nexport function rememberCreditsPerUsd(rate: number | null | undefined, now: number = Date.now()): void {\n if (typeof rate === 'number' && Number.isFinite(rate) && rate > 0) {\n reportedCreditsPerUsd = rate;\n reportedAt = now;\n failedAt = Number.NEGATIVE_INFINITY;\n } else {\n failedAt = now;\n }\n}\n\n/** Whether the backend's rate was read recently enough, or failed recently enough, not to ask again. */\nexport const creditsPerUsdIsFresh = (now: number = Date.now()): boolean =>\n (reportedCreditsPerUsd !== null && now - reportedAt < CREDITS_RATE_REREAD_MS) ||\n now - failedAt < CREDITS_RATE_RETRY_MS;\n\n/** Credits per $1 to convert with: the backend's rate once read, else {@link CREDITS_PER_USD}. */\nexport const creditsPerUsdNow = (): number => reportedCreditsPerUsd ?? CREDITS_PER_USD;\n\nexport const toCredits = (usd: number, creditsPerUsd: number = creditsPerUsdNow()): number =>\n Math.round(Math.max(0, usd) * creditsPerUsd);\n\n/** The slice of a checkLLMSpend verdict the credit displays read. */\nexport interface CreditsVerdict {\n includedUsd?: number | null;\n remainingUsd?: number | null;\n resetAt?: string | null;\n /**\n * When the window began (checkLLMSpend.periodStart, read apart from the verdict: see\n * withWindowStart). With resetAt it names the window; without it the reset alone does.\n */\n periodStart?: string | null;\n}\n\nexport type CreditsPeriod = 'today' | 'this month' | 'this period';\n\nexport interface CreditsSummary {\n /** The plan's credits for the period (0 when it includes none). */\n total: number;\n used: number;\n remaining: number;\n /** Credit pack credits left: they never expire and are spent after the plan's credits. */\n packCredits: number;\n /** Everything that can still be spent: the plan's credits left plus the packs. */\n available: number;\n /** Whole percent of the allowance used, 0-100. */\n pct: number;\n /** Credits per $1 the figures are in (the backend's rate): \"1,000 credits = $1\". */\n creditsPerUsd: number;\n period: CreditsPeriod;\n /** \"Refreshes in about 5 hours.\" - null when the verdict carries no reset. */\n resetText: string | null;\n /** Chip label: \"1,000 left today\". */\n short: string;\n /** Tooltip / subtitle: \"0 of 1,000 credits used today. Refreshes in about 5 hours.\" */\n long: string;\n}\n\nconst HOUR_MS = 3_600_000;\nconst DAY_MS = 24 * HOUR_MS;\n\nconst plural = (n: number): string => (n === 1 ? '' : 's');\n\n/**\n * How long from `now` until `at`, counted and never written as a date: \"in about 12 minutes\",\n * \"in about 5 hours\", \"tomorrow\", \"in 6 days\", \"in 31 days\". A date is written in some time zone:\n * a reset at 00:00 UTC on Nov 19 is still Nov 18 in New York, so the agent's \"on Nov 19\" and a\n * viewer's \"on Nov 18\" read as two days. cdecli words the same reset with clicore.FromNow, and this\n * rounds as it does: to the nearest minute under half an hour, the nearest hour under a day, then\n * the nearest day, one rounded day being \"tomorrow\". '' when `at` is not after `now`.\n */\nexport function fromNow(at: number, now: number = Date.now()): string {\n const ms = at - now;\n if (!(ms > 0)) return '';\n const hours = Math.round(ms / HOUR_MS);\n if (hours < 1) {\n const mins = Math.max(1, Math.round(ms / 60_000));\n return `in about ${mins} minute${plural(mins)}`;\n }\n if (hours < 24) return `in about ${hours} hour${plural(hours)}`;\n const days = Math.round(hours / 24);\n return days <= 1 ? 'tomorrow' : `in ${days} days`;\n}\n\n/** \"Refreshes in 6 days.\" (counted from now, as cdecli says it); null when the reset is unknown. */\nexport function formatReset(resetAt?: string | null, now: number = Date.now()): string | null {\n if (!resetAt) return null;\n const at = new Date(resetAt).getTime();\n if (Number.isNaN(at)) return null;\n const when = fromNow(at, now);\n return when ? `Refreshes ${when}.` : 'Your credits refresh shortly.';\n}\n\n/** The window a credit allowance is counted over, as checkLLMSpend reports it. */\nexport interface CreditWindow {\n periodStart?: string | null;\n resetAt?: string | null;\n}\n\n/** The longest window named \"today\": a day, with a minute to spare. */\nconst DAY_WINDOW_MAX_MS = DAY_MS + 60_000;\n\n/** The instant an ISO timestamp names; null when it is missing or unreadable. */\nfunction instantOf(iso: string | null | undefined): number | null {\n if (!iso) return null;\n const t = new Date(iso).getTime();\n return Number.isNaN(t) ? null : t;\n}\n\n/**\n * A window's start and end (epoch ms); null without both, with an unreadable one, or when it\n * does not end after it starts.\n */\nfunction boundsOf(window: CreditWindow | null | undefined): { start: number; end: number } | null {\n const start = instantOf(window?.periodStart);\n const end = instantOf(window?.resetAt);\n return start !== null && end !== null && end > start ? { start, end } : null;\n}\n\n/**\n * Which window the allowance belongs to, named from its span, never from the time left in it:\n * the free daily drip is a UTC day, \"today\"; the free monthly pot a UTC calendar month, \"this\n * month\", on its last day too, when it refills within hours as a day's would; anything else\n * \"this period\" - a paid plan's billing period, or the month of a yearly plan's term, which run\n * from the second the subscription started, the last day included.\n */\nfunction periodOfSpan({ start, end }: { start: number; end: number }): CreditsPeriod {\n if (end - start <= DAY_WINDOW_MAX_MS) return 'today';\n const from = new Date(start);\n const oneUtcMonth =\n start === Date.UTC(from.getUTCFullYear(), from.getUTCMonth(), 1) &&\n end === Date.UTC(from.getUTCFullYear(), from.getUTCMonth() + 1, 1);\n return oneUtcMonth ? 'this month' : 'this period';\n}\n\n/**\n * Which window the allowance belongs to, read off the reset instant alone, for a backend that\n * does not send the window's start: the free daily drip resets at the next UTC midnight (under\n * a day away), the free monthly cap on the first of next month, and a paid plan at its billing\n * period end (a yearly plan's at the end of the month of its term) - the second its\n * subscription started, so a paid plan's last day is still \"this period\", not \"today\". The\n * monthly cap's last day reads \"today\" here: its reset is as near as a day's.\n */\nfunction periodOfReset(resetAt: string | null | undefined, now: number): CreditsPeriod {\n if (!resetAt) return 'this period';\n const t = new Date(resetAt).getTime();\n if (Number.isNaN(t)) return 'this period';\n const d = new Date(t);\n const utcMidnight =\n d.getUTCHours() === 0 && d.getUTCMinutes() === 0 && d.getUTCSeconds() === 0 && d.getUTCMilliseconds() === 0;\n if (!utcMidnight) return 'this period';\n if (t - now <= DAY_MS) return 'today';\n return d.getUTCDate() === 1 ? 'this month' : 'this period';\n}\n\n/** The window's word: from its span when the backend names its start, else from its reset alone. */\nfunction periodOf(window: CreditWindow | null | undefined, now: number): CreditsPeriod {\n const bounds = boundsOf(window);\n return bounds ? periodOfSpan(bounds) : periodOfReset(window?.resetAt, now);\n}\n\n/**\n * The verdict with the start of its window, which is read apart from it (checkLLMSpend\n * { periodStart resetAt }: a backend that predates periodStart rejects the field, and that must\n * never cost the verdict). Only when that window ends where the verdict resets, so the two always\n * describe one window: a verdict and a window read either side of a reset are never paired.\n * Otherwise the verdict as it is, named from its reset alone.\n */\nexport function withWindowStart(\n verdict: CreditsVerdict | null,\n window: CreditWindow | null | undefined,\n): CreditsVerdict | null {\n if (!verdict || !window?.periodStart) return verdict;\n const end = instantOf(window.resetAt);\n return end !== null && end === instantOf(verdict.resetAt)\n ? { ...verdict, periodStart: window.periodStart }\n : verdict;\n}\n\n/** The span the Usage page reports spend over. */\nexport interface UsageWindow {\n start: Date;\n end: Date;\n /** True when this is the AI-credit window, so spend can be measured against the allowance. */\n creditPeriod: boolean;\n}\n\nfunction calendarMonth(now: Date): UsageWindow {\n return {\n start: new Date(now.getFullYear(), now.getMonth(), 1),\n end: new Date(now.getFullYear(), now.getMonth() + 1, 0, 23, 59, 59, 999),\n creditPeriod: false,\n };\n}\n\n/**\n * The window the Usage page reports on: the AI-credit window when the backend names one\n * longer than a day - a paid plan's billing period, the month of a yearly plan's term, the\n * free tier's month - so the page's spend and its budget describe the same span as the\n * allowance (a plan billed from the 9th showed calendar-month spend of $49.60 against a $10\n * allowance whose period began that day). Otherwise the calendar month: a daily free-tier\n * window (the one the credits are \"today\" in) is too short to report history on, and an\n * older backend does not name the window at all.\n */\nexport function usageWindow(window: CreditWindow | null | undefined, now: Date = new Date()): UsageWindow {\n const bounds = boundsOf(window);\n if (bounds && periodOfSpan(bounds) !== 'today') {\n return { start: new Date(bounds.start), end: new Date(bounds.end), creditPeriod: true };\n }\n return calendarMonth(now);\n}\n\n/** Pack credits from USD, floored so a balance never shows a credit it cannot pay for. */\nconst toPackCredits = (usd: number | null | undefined, creditsPerUsd: number): number =>\n Math.floor(Math.max(0, usd ?? 0) * creditsPerUsd + 1e-6);\n\n/**\n * Credits view of a verdict and the credit pack balance, or null when there is nothing to\n * spend from at all - no allowance and no packs - which is the out-of-credits dialog's case,\n * not a meter's.\n */\nexport function creditsSummary(\n verdict: CreditsVerdict | null | undefined,\n now: number = Date.now(),\n packRemainingUsd: number | null = null,\n creditsPerUsd: number = creditsPerUsdNow(),\n): CreditsSummary | null {\n const includedUsd = verdict?.includedUsd ?? 0;\n const packCredits = toPackCredits(packRemainingUsd, creditsPerUsd);\n const packLine = packCredits > 0 ? `${packCredits.toLocaleString()} pack credits left, which never expire.` : '';\n\n if (includedUsd <= 0) {\n if (packCredits <= 0) return null;\n return {\n total: 0,\n used: 0,\n remaining: 0,\n packCredits,\n available: packCredits,\n pct: 0,\n creditsPerUsd,\n period: 'this period',\n resetText: null,\n short: `${packCredits.toLocaleString()} pack credits left`,\n long: packLine,\n };\n }\n\n const total = toCredits(includedUsd, creditsPerUsd);\n const remaining = Math.min(total, toCredits(verdict?.remainingUsd ?? 0, creditsPerUsd));\n const used = total - remaining;\n const pct = Math.min(100, Math.round((used / total) * 100));\n const period = periodOf(verdict, now);\n const resetText = formatReset(verdict?.resetAt, now);\n const available = remaining + packCredits;\n\n return {\n total,\n used,\n remaining,\n packCredits,\n available,\n pct,\n creditsPerUsd,\n period,\n resetText,\n short: packCredits > 0 ? `${available.toLocaleString()} left` : `${remaining.toLocaleString()} left ${period}`,\n long: `${used.toLocaleString()} of ${total.toLocaleString()} credits used ${period}.${resetText ? ` ${resetText}` : ''}${packLine ? ` ${packLine}` : ''}`,\n };\n}\n\n/** \"1 credit left\", \"1,250 credits left\". */\nexport function creditsLeftLabel(count: number): string {\n const credits = Math.max(0, Math.floor(count));\n return `${credits.toLocaleString()} ${credits === 1 ? 'credit' : 'credits'} left`;\n}\n\n/** Used from here on, credits are running low: the Usage page's amber line. */\nexport const LOW_CREDITS_PCT = 80;\n\nexport interface CreditsLine {\n /** \"1 credit left\": everything that can still be spent, the plan's and the packs'. */\n label: string;\n /** Share of the plan's credits still left, 0-1, for the meter. Null with packs on hand, or a plan with none. */\n left: number | null;\n /** Nothing left, or most of the plan's credits used with no packs behind them: \"Top up\" shows. */\n low: boolean;\n /** \"980 of 1,000 credits used today. Refreshes in about 5 hours.\" */\n detail: string;\n}\n\nexport function creditsLine(summary: CreditsSummary): CreditsLine {\n const packs = summary.packCredits > 0;\n return {\n label: creditsLeftLabel(summary.available),\n left: !packs && summary.total > 0 ? Math.min(1, Math.max(0, summary.remaining / summary.total)) : null,\n low: summary.available <= 0 || (!packs && summary.pct >= LOW_CREDITS_PCT),\n detail: summary.long,\n };\n}\n\n/** The meter never draws a sliver too thin to see while anything is left. */\nexport const meterWidth = (left: number) => (left > 0 ? Math.max(3, left * 100) : 0);\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;AASO,MAAM,eAAkB,GAAA;AAG/B,IAAI,qBAAuC,GAAA,IAAA;AAYpC,SAAS,qBAAsB,CAAA,IAAA,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,CAAA;AAAA,GAClB;AACF;AAGa,MAAA,UAAA,GAAa,CAAC,IAAA,KAAiB,IAAO,GAAA,CAAA,GAAI,KAAK,GAAI,CAAA,CAAA,EAAG,IAAO,GAAA,GAAG,CAAI,GAAA"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@adminide-stack/yantra-mobile",
3
- "version": "12.0.183",
3
+ "version": "12.0.184-alpha.0",
4
4
  "description": "Sample core for higher packages to depend on",
5
5
  "license": "ISC",
6
6
  "author": "CDMBase LLC",
@@ -27,7 +27,7 @@
27
27
  "uuid": "^9.0.0"
28
28
  },
29
29
  "devDependencies": {
30
- "common": "12.0.175",
30
+ "common": "12.0.184-alpha.0",
31
31
  "libphonenumber-js": "^1.13.3"
32
32
  },
33
33
  "peerDependencies": {
@@ -45,7 +45,7 @@
45
45
  "@messenger-box/platform-mobile": "*",
46
46
  "@react-native-async-storage/async-storage": "*",
47
47
  "@react-navigation/native": "*",
48
- "common": "12.0.175",
48
+ "common": "12.0.175-alpha.1",
49
49
  "expo-background-task": "*",
50
50
  "expo-camera": "*",
51
51
  "expo-constants": "*",
@@ -68,5 +68,5 @@
68
68
  "typescript": {
69
69
  "definition": "lib/index.d.ts"
70
70
  },
71
- "gitHead": "849a3ce2d2cfa826d802cc4db78859a4ee9ae20a"
71
+ "gitHead": "2349edf8c15b6cc188cf7b5724cedac96fdfcaff"
72
72
  }