Skip to content
Source
Sign inSign up
pingdotgg/t3code

feat(usage): split usage per provider instance home #5738

ClosedzenDevNomad(GitHub profile, opens in a new tab)wants to merge 2 commits intomain fromrefs/pull/5738/headopened View on GitHub

Showing 14 changed files with 107 additions and 14 deletions (loading 11).

x
0 of 14 viewed, 14 left
74 additions and 10 deletionsapps/server/src/usage/UsageService.tsModified
View file
@@ -14,6 +14,8 @@
import * as NodeOS from "node:os";
​
import {
+ ClaudeSettings,
+ CodexSettings,
USAGE_CONTRACT_VERSION,
type UsageProviderKind,
type UsageSource,
@@ -37,6 +39,12 @@
import * as ServerSettings from "../serverSettings.ts";
import { resolveClaudeHomePath } from "../provider/Drivers/ClaudeHome.ts";
import { resolveCodexHomeLayout } from "../provider/Drivers/CodexHomeLayout.ts";
+import {
+ dedupeUsageHomes,
+ listProviderHomeCandidates,
+ scanHomePath,
+ type ResolvedUsageHome,
+} from "./usageHomes.ts";
import { UsageAggregator } from "./usageAggregation.ts";
import { parseRateTable, type RateTable } from "./usagePricing.ts";
import {
@@ -85,6 +93,9 @@
const decodeScanCacheFile = Schema.decodeUnknownEffect(ScanCacheJson);
const encodeScanCacheFile = Schema.encodeEffect(ScanCacheJson);
​
+const decodeClaudeSettings = Schema.decodeUnknownEffect(ClaudeSettings);
+const decodeCodexSettings = Schema.decodeUnknownEffect(CodexSettings);