@agent-finops/core 0.5.9 → 0.6.1

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.
@@ -52,7 +52,6 @@ const pricingRules = [
52
52
  // Open-weight models with NO canonical price (llama, qwen, mistral, glm):
53
53
  // hosting rates vary several-fold by provider, so we deliberately return
54
54
  // undefined -> costConfidence "missing" instead of inventing a number.
55
- { match: /codex/i, inputPerM: 1.25, outputPerM: 10, cacheReadPerM: 0.125 }
56
55
  ];
57
56
  export function findPricingRule(model) {
58
57
  return pricingRules.find((rule) => rule.match.test(model));
@@ -8,6 +8,7 @@ type ProviderResponse = {
8
8
  get: (name: string) => string | null;
9
9
  };
10
10
  json: () => Promise<unknown>;
11
+ text?: () => Promise<string>;
11
12
  };
12
13
  export type ProviderQaPagination = {
13
14
  label: string;
@@ -19,6 +20,15 @@ export type ProviderQaPagination = {
19
20
  note?: string;
20
21
  };
21
22
  export type ProviderCoverageStatus = "complete" | "partial";
23
+ /**
24
+ * Exact provider interval requested by a sync. It is intentionally absent
25
+ * when the caller leaves the end open: a successful narrow/open-ended read
26
+ * must never be promoted into an assumed 30-day coverage claim.
27
+ */
28
+ export type ProviderCoverageInterval = {
29
+ coverageStart: string;
30
+ coverageEnd: string;
31
+ };
22
32
  export type ProviderFinancialSummary = {
23
33
  providerReportedBilledUsd: number | null;
24
34
  apiEquivalentEstimatedUsd: number | null;
@@ -64,6 +74,7 @@ export type ProviderConnectorResult = {
64
74
  records: UsageRecord[];
65
75
  fetchedAt: string;
66
76
  coverage: ProviderCoverageStatus;
77
+ coverageInterval?: ProviderCoverageInterval;
67
78
  financials: ProviderFinancialSummary;
68
79
  completeness: "verified" | "estimated" | "detected_unverified" | "missing";
69
80
  qa: ProviderQaSummary;
@@ -73,9 +84,9 @@ export type CreateProviderConnectionInput = {
73
84
  sourceId?: string;
74
85
  authReference: string;
75
86
  verifiedRecordCount: number;
76
- totalUsd: number;
87
+ totalUsd: number | null;
77
88
  fetchedAt?: Date;
78
- /** Record-derived completeness; the source's verification label mirrors it. */
89
+ /** Record-derived completeness; this controls financial evidence, not connector validation. */
79
90
  completeness?: ProviderConnectorResult["completeness"];
80
91
  };
81
92
  export type TokenResolver = (reference: string) => string;