@agent-finops/core 0.8.0 → 0.9.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.
Files changed (49) hide show
  1. package/README.md +5 -3
  2. package/dist/actionPlanner.d.ts +140 -0
  3. package/dist/actionPlanner.js +938 -0
  4. package/dist/actionVerification.d.ts +1240 -0
  5. package/dist/actionVerification.js +1028 -0
  6. package/dist/activitySnapshot.d.ts +101 -9
  7. package/dist/activitySnapshot.js +145 -6
  8. package/dist/activitySnapshotCache.d.ts +8 -1
  9. package/dist/activitySnapshotCache.js +103 -7
  10. package/dist/agentEconomicsReceipt.d.ts +58 -58
  11. package/dist/analyze.js +3 -1
  12. package/dist/cutList.js +1 -1
  13. package/dist/glance.d.ts +30 -2
  14. package/dist/glance.js +265 -84
  15. package/dist/index.d.ts +11 -2
  16. package/dist/index.js +10 -1
  17. package/dist/insights.js +3 -1
  18. package/dist/localAgentFormats/gemini.js +2 -2
  19. package/dist/localAgentFormats/registry.js +6 -2
  20. package/dist/localAgentFormats/runtimeRegistry.js +5 -2
  21. package/dist/localAgentFormats/types.d.ts +2 -1
  22. package/dist/localAgentLogs.d.ts +362 -3
  23. package/dist/localAgentLogs.js +1964 -165
  24. package/dist/modelPricing.d.ts +1 -1
  25. package/dist/modelPricing.js +4 -1
  26. package/dist/planMath.js +12 -7
  27. package/dist/projectEconomics.d.ts +617 -0
  28. package/dist/projectEconomics.js +620 -0
  29. package/dist/projectEconomicsBuilder.d.ts +89 -0
  30. package/dist/projectEconomicsBuilder.js +473 -0
  31. package/dist/projectIndexStore.d.ts +545 -0
  32. package/dist/projectIndexStore.js +606 -0
  33. package/dist/providerConnectors.d.ts +59 -1
  34. package/dist/providerConnectors.js +192 -12
  35. package/dist/qualitativeIndexCache.d.ts +494 -0
  36. package/dist/qualitativeIndexCache.js +930 -0
  37. package/dist/resultCard.d.ts +350 -0
  38. package/dist/resultCard.js +604 -0
  39. package/dist/runtimeCommands.d.ts +21 -0
  40. package/dist/runtimeCommands.js +27 -0
  41. package/dist/scanGuard.d.ts +3 -1
  42. package/dist/scanGuard.js +164 -4
  43. package/dist/schema.d.ts +31 -31
  44. package/dist/sessionVitals.d.ts +145 -0
  45. package/dist/sessionVitals.js +521 -0
  46. package/dist/sourceRegistry.js +90 -52
  47. package/dist/toolInvocations.d.ts +40 -1
  48. package/dist/toolInvocations.js +101 -20
  49. package/package.json +1 -1
@@ -7,7 +7,7 @@
7
7
  * matched top-down; first match wins. Unknown models return undefined so
8
8
  * callers can label the record "missing" instead of inventing a number.
9
9
  */
10
- export declare const PRICING_TABLE_AS_OF = "2026-08-13";
10
+ export declare const PRICING_TABLE_AS_OF = "2026-08-16";
11
11
  export type TokenUsage = {
12
12
  /** Billable, uncached input tokens. */
13
13
  inputTokens: number;
@@ -7,10 +7,13 @@
7
7
  * matched top-down; first match wins. Unknown models return undefined so
8
8
  * callers can label the record "missing" instead of inventing a number.
9
9
  */
10
- export const PRICING_TABLE_AS_OF = "2026-08-13";
10
+ export const PRICING_TABLE_AS_OF = "2026-08-16";
11
11
  const pricingRules = [
12
12
  // Anthropic
13
13
  { match: /^claude-fable-5/i, inputPerM: 10, outputPerM: 50 },
14
+ { match: /^claude-mythos-5/i, inputPerM: 10, outputPerM: 50 },
15
+ { match: /^claude-opus-5/i, inputPerM: 5, outputPerM: 25 },
16
+ { match: /^claude-sonnet-5/i, inputPerM: 2, outputPerM: 10 },
14
17
  { match: /^claude-opus-4-[5-9]/i, inputPerM: 5, outputPerM: 25 },
15
18
  { match: /^claude-opus-4(-[01])?$/i, inputPerM: 15, outputPerM: 75 },
16
19
  { match: /^claude-sonnet-4/i, inputPerM: 3, outputPerM: 15 },
package/dist/planMath.js CHANGED
@@ -54,9 +54,9 @@ export function computePlanChecks(records, detectedPlans = []) {
54
54
  const savingsVsApi = roundMoney(monthly - detectedKnown.monthlyUsd);
55
55
  effectiveSavings = savingsVsApi > 0 ? savingsVsApi : undefined;
56
56
  headline =
57
- `${agent}: ~$${monthly.toFixed(2)}/mo at API rates (${basis}) — compared with ${detectedKnown.name} ` +
57
+ `${agent}: ~${formatUsd(monthly)}/mo at API rates (${basis}) — compared with ${detectedKnown.name} ` +
58
58
  `($${detectedKnown.monthlyUsd}/mo; label detected locally): ~${valueMultiple}× the plan price in API-equivalent usage` +
59
- (effectiveSavings ? `, a ~$${effectiveSavings.toFixed(2)}/mo value difference to investigate.` : `.`);
59
+ (effectiveSavings ? `, a ~${formatUsd(effectiveSavings)}/mo value difference to investigate.` : `.`);
60
60
  if (monthly > detectedKnown.coversUpToUsd) {
61
61
  const nextTier = subscriptionPlans.find((plan) => plan.agent === agent && plan.coversUpToUsd > detectedKnown.coversUpToUsd);
62
62
  // A local limit signal upgrades "might hit limits" to hard evidence.
@@ -75,7 +75,7 @@ export function computePlanChecks(records, detectedPlans = []) {
75
75
  // Detected a plan we can't price (e.g. an unrecognized tier): state the
76
76
  // fact, then fall back to suggestion math without pretending certainty.
77
77
  headline =
78
- `${agent}: ~$${monthly.toFixed(2)}/mo at API rates (${basis}) — compared with ${detected.planLabel} ` +
78
+ `${agent}: ~${formatUsd(monthly)}/mo at API rates (${basis}) — compared with ${detected.planLabel} ` +
79
79
  `(label detected locally; price not in our table)` +
80
80
  (suggested ? `; reference listed plan: ${suggested.name} ($${suggested.monthlyUsd}/mo).` : `.`);
81
81
  }
@@ -84,13 +84,13 @@ export function computePlanChecks(records, detectedPlans = []) {
84
84
  valueMultiple = covered ? Math.round((monthly / suggested.monthlyUsd) * 10) / 10 : undefined;
85
85
  effectiveSavings = covered ? savings : undefined;
86
86
  if (!suggested) {
87
- headline = `${agent}: ~$${monthly.toFixed(2)}/mo at API rates (${basis}).`;
87
+ headline = `${agent}: ~${formatUsd(monthly)}/mo at API rates (${basis}).`;
88
88
  }
89
89
  else if (covered) {
90
- headline = `${agent}: ~$${monthly.toFixed(2)}/mo at API rates (${basis}) — ${suggested.name} is a $${suggested.monthlyUsd}/mo reference point. That is ~${valueMultiple}× the plan price in API-equivalent usage, a ~$${savings.toFixed(2)}/mo value difference to investigate; it does not prove plan coverage.`;
90
+ headline = `${agent}: ~${formatUsd(monthly)}/mo at API rates (${basis}) — ${suggested.name} is a $${suggested.monthlyUsd}/mo reference point. That is ~${valueMultiple}× the plan price in API-equivalent usage, a ~${formatUsd(savings)}/mo value difference to investigate; it does not prove plan coverage.`;
91
91
  }
92
92
  else {
93
- headline = `${agent}: ~$${monthly.toFixed(2)}/mo at API rates (${basis}) — below the $${suggested.monthlyUsd}/mo price of ${suggested.name}; compare account benefits and provider-reported charges before changing plans.`;
93
+ headline = `${agent}: ~${formatUsd(monthly)}/mo at API rates (${basis}) — below the $${suggested.monthlyUsd}/mo price of ${suggested.name}; compare account benefits and provider-reported charges before changing plans.`;
94
94
  }
95
95
  }
96
96
  checks.push({
@@ -108,6 +108,11 @@ export function computePlanChecks(records, detectedPlans = []) {
108
108
  return checks.sort((left, right) => right.apiEquivalentMonthlyUsd - left.apiEquivalentMonthlyUsd);
109
109
  }
110
110
  function roundMoney(value) {
111
- return Math.round(value * 100) / 100;
111
+ return Math.round(value * 10_000) / 10_000;
112
+ }
113
+ function formatUsd(value) {
114
+ if (value > 0 && value < 0.01)
115
+ return "<$0.01";
116
+ return `$${value.toFixed(2)}`;
112
117
  }
113
118
  //# sourceMappingURL=planMath.js.map