@peer-agent/protocol 0.0.1-beta.46 → 0.0.1-beta.47
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/dist/usage-accounting.d.ts +21 -0
- package/package.json +1 -1
|
@@ -22,8 +22,29 @@ export interface RuntimeTurnUsage extends UsageAmounts {
|
|
|
22
22
|
readonly usageScope: 'runtime_turn';
|
|
23
23
|
readonly providerRequestCount: number;
|
|
24
24
|
}
|
|
25
|
+
/** Durable billable sum for one provider/model key inside a conversation ledger. */
|
|
26
|
+
export interface ConversationLifetimeModelUsage {
|
|
27
|
+
/** Stable provider binding id, e.g. '5198c365-...::ultimate'. */
|
|
28
|
+
readonly modelProviderId: string;
|
|
29
|
+
readonly model?: string;
|
|
30
|
+
readonly providerName?: string;
|
|
31
|
+
readonly inputTokens: number;
|
|
32
|
+
readonly outputTokens: number;
|
|
33
|
+
readonly totalTokens: number;
|
|
34
|
+
readonly cacheReadTokens: number;
|
|
35
|
+
readonly cacheWriteTokens: number;
|
|
36
|
+
readonly estimatedCostUsd: number;
|
|
37
|
+
readonly requestCount: number;
|
|
38
|
+
}
|
|
25
39
|
/** Durable billable sum across completed runtime turns in one conversation. */
|
|
26
40
|
export interface ConversationLifetimeUsage extends UsageAmounts {
|
|
27
41
|
readonly usageScope: 'conversation_lifetime';
|
|
28
42
|
readonly runtimeTurnCount?: number;
|
|
43
|
+
/**
|
|
44
|
+
* Per-model split of the same lifetime totals. Keyed by modelProviderId.
|
|
45
|
+
* Absent for conversations recorded before the byModel ledger existed
|
|
46
|
+
* (statistics then fall back to the request-level snapshot, or to the
|
|
47
|
+
* legacy "lifetime totals × current price" estimate).
|
|
48
|
+
*/
|
|
49
|
+
readonly byModel?: Readonly<Record<string, ConversationLifetimeModelUsage>>;
|
|
29
50
|
}
|