@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.
- package/README.md +6 -0
- package/dist/activitySnapshot.d.ts +676 -0
- package/dist/activitySnapshot.js +1220 -0
- package/dist/activitySnapshotCache.d.ts +54 -0
- package/dist/activitySnapshotCache.js +489 -0
- package/dist/discovery.d.ts +6 -2
- package/dist/discovery.js +36 -14
- package/dist/glance.d.ts +6 -2
- package/dist/glance.js +62 -13
- package/dist/index.d.ts +4 -0
- package/dist/index.js +4 -0
- package/dist/localAgentLogs.d.ts +68 -2
- package/dist/localAgentLogs.js +972 -59
- package/dist/modelPricing.js +0 -1
- package/dist/providerConnectors.d.ts +13 -2
- package/dist/providerConnectors.js +708 -95
- package/dist/sampleData.js +4 -3
- package/dist/schema.d.ts +31 -29
- package/dist/schema.js +27 -3
- package/dist/sourceRegistry.d.ts +30 -5
- package/dist/sourceRegistry.js +250 -21
- package/dist/sourceStatus.d.ts +65 -0
- package/dist/sourceStatus.js +147 -0
- package/dist/stateTrust.d.ts +37 -0
- package/dist/stateTrust.js +277 -0
- package/package.json +1 -1
- package/samples/openai-usage.csv +2 -2
package/dist/modelPricing.js
CHANGED
|
@@ -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;
|
|
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;
|