| author | |
| committer | |
| log | 77d9ffc822ac4c1f3600dc6c97e92fc94e9e12a3 |
| tree | 9b012e4a798040c97b2f2ecf144c0eb2966e08c1 |
| parent | 161715b1e4fa6d20fe3eb1cb9c91904bf83ca4c1 |
| signature | Signed by PGP key B5690EEEBB952194 |
16 files changed, 20 insertions(+), 12 deletions(-)
apps/server/integration/NetworkTransferMeasurement.integration.ts+3-3| ... | ... | @@ -120,7 +120,7 @@ function rawDataBytes(data: NodeSocket.NodeWS.RawData): number { |
| 120 | 120 | return data.byteLength; |
| 121 | 121 | } |
| 122 | 122 | |
| 123 | export function makeWebSocketTransferRecorder(): WebSocketTransferRecorder { | |
| 123 | function makeWebSocketTransferRecorder(): WebSocketTransferRecorder { | |
| 124 | 124 | let socket: NodeWebSocketWithTransport | null = null; |
| 125 | 125 | // Held separately from the WebSocket so wire totals survive a close, which |
| 126 | 126 | // is when a reconnect measurement reads them. |
| ... | ... | @@ -176,7 +176,7 @@ export function transferDelta( |
| 176 | 176 | }; |
| 177 | 177 | } |
| 178 | 178 | |
| 179 | export function countingWsRpcProtocolLayer(input: { | |
| 179 | function countingWsRpcProtocolLayer(input: { | |
| 180 | 180 | readonly url: string; |
| 181 | 181 | readonly cookie: string; |
| 182 | 182 | readonly recorder: WebSocketTransferRecorder; |
| ... | ... | @@ -194,7 +194,7 @@ export function countingWsRpcProtocolLayer(input: { |
| 194 | 194 | ); |
| 195 | 195 | } |
| 196 | 196 | |
| 197 | export const makeCountingWsRpcClient = RpcClient.make(WsRpcGroup); | |
| 197 | const makeCountingWsRpcClient = RpcClient.make(WsRpcGroup); | |
| 198 | 198 | export type CountingWsRpcClient = Effect.Success<typeof makeCountingWsRpcClient>; |
| 199 | 199 | |
| 200 | 200 | export interface MeasuredWsClient { |
apps/server/integration/TransferBudgetReport.integration.ts+1-1| ... | ... | @@ -56,7 +56,7 @@ const TRANSFER_BUDGET = { |
| 56 | 56 | measuredTurnWebSocketMessages: 21, |
| 57 | 57 | } satisfies ProviderTransferBudget; |
| 58 | 58 | |
| 59 | export const TRANSFER_BUDGETS: Readonly<Record<string, ProviderTransferBudget>> = { | |
| 59 | const TRANSFER_BUDGETS: Readonly<Record<string, ProviderTransferBudget>> = { | |
| 60 | 60 | codex: TRANSFER_BUDGET, |
| 61 | 61 | claudeAgent: TRANSFER_BUDGET, |
| 62 | 62 | }; |
apps/server/integration/TransferBudgetScenario.integration.ts+1-1| ... | ... | @@ -26,7 +26,7 @@ import { |
| 26 | 26 | TRANSFER_HISTORY_TURN_COUNT, |
| 27 | 27 | } from "./fixtures/transferBudget.ts"; |
| 28 | 28 | |
| 29 | export const TRANSFER_PROJECT_ID = ProjectId.make("transfer-budget-project"); | |
| 29 | const TRANSFER_PROJECT_ID = ProjectId.make("transfer-budget-project"); | |
| 30 | 30 | export const TRANSFER_THREAD_ID = ThreadId.make("transfer-budget-thread"); |
| 31 | 31 | export const TRANSFER_MEASURED_TURN_INDEX = TRANSFER_HISTORY_TURN_COUNT; |
| 32 | 32 |
apps/server/src/diagnostics/ProcessDiagnostics.ts+1| ... | ... | @@ -54,6 +54,7 @@ function canSignalCategory(category: ResourceTelemetryProcessCategory): boolean |
| 54 | 54 | ); |
| 55 | 55 | } |
| 56 | 56 | |
| 57 | /** @public Service construction is part of the canonical Effect module API. */ | |
| 57 | 58 | export const make = Effect.fn("makeProcessDiagnostics")(function* () { |
| 58 | 59 | const telemetry = yield* ResourceTelemetry.ResourceTelemetry; |
| 59 | 60 | const refreshedTelemetry = telemetry.refresh.pipe(Effect.catch(() => telemetry.latest)); |
apps/server/src/diagnostics/ProcessResourceMonitor.ts+1| ... | ... | @@ -28,6 +28,7 @@ function isLegacyBackendCategory(category: ResourceTelemetryProcessCategory): bo |
| 28 | 28 | ); |
| 29 | 29 | } |
| 30 | 30 | |
| 31 | /** @public Service construction is part of the canonical Effect module API. */ | |
| 31 | 32 | export const make = Effect.fn("makeProcessResourceMonitor")(function* () { |
| 32 | 33 | const telemetry = yield* ResourceTelemetry.ResourceTelemetry; |
| 33 | 34 | const readHistory: ProcessResourceMonitor["Service"]["readHistory"] = (input) => |
apps/server/src/diagnostics/TraceDiagnostics.ts+1| ... | ... | @@ -411,6 +411,7 @@ function readTraceFile( |
| 411 | 411 | ); |
| 412 | 412 | } |
| 413 | 413 | |
| 414 | /** @public Service construction is part of the canonical Effect module API. */ | |
| 414 | 415 | export const make = Effect.gen(function* () { |
| 415 | 416 | const fileSystem = yield* FileSystem.FileSystem; |
| 416 | 417 |
apps/server/src/resourceTelemetry/DesktopTelemetryReceiver.ts+1| ... | ... | @@ -327,6 +327,7 @@ export function requireDesktopTelemetryWriteProgress( |
| 327 | 327 | : Effect.fail(new DesktopTelemetryControlStalled({ fd, remainingBytes })); |
| 328 | 328 | } |
| 329 | 329 | |
| 330 | /** @public Service construction is part of the canonical Effect module API. */ | |
| 330 | 331 | export const make = Effect.fn("resourceTelemetry.desktopTelemetryReceiver.make")(function* () { |
| 331 | 332 | const config = yield* ServerConfig; |
| 332 | 333 | const serverSettings = yield* ServerSettingsService; |
apps/server/src/resourceTelemetry/Model.ts+1-1| ... | ... | @@ -68,7 +68,7 @@ export interface MergeProcessesResult { |
| 68 | 68 | readonly deltas: ReadonlyArray<ProcessDelta>; |
| 69 | 69 | } |
| 70 | 70 | |
| 71 | export const emptyGroupCounters = (): GroupCounters => ({ | |
| 71 | const emptyGroupCounters = (): GroupCounters => ({ | |
| 72 | 72 | cpuTimeMs: 0, |
| 73 | 73 | ioReadBytes: 0, |
| 74 | 74 | ioWriteBytes: 0, |
apps/server/src/resourceTelemetry/NativeTelemetryClient.ts+1| ... | ... | @@ -360,6 +360,7 @@ export function canCommandNativeTelemetrySidecar( |
| 360 | 360 | return hasHandle && (status === "healthy" || status === "degraded"); |
| 361 | 361 | } |
| 362 | 362 | |
| 363 | /** @public Service construction is part of the canonical Effect module API. */ | |
| 363 | 364 | export const make = Effect.fn("resourceTelemetry.nativeTelemetryClient.make")(function* () { |
| 364 | 365 | const binary = yield* ResourceMonitorBinary.ResourceMonitorBinary; |
| 365 | 366 | const spawner = yield* ChildProcessSpawner.ChildProcessSpawner; |
apps/server/src/resourceTelemetry/ResourceMonitorBinary.ts+2-2| ... | ... | @@ -90,7 +90,7 @@ export const ResourceMonitorHostLinuxLibc = Context.Reference<ResourceMonitorLin |
| 90 | 90 | }, |
| 91 | 91 | ); |
| 92 | 92 | |
| 93 | export function resourceMonitorPlatformKey( | |
| 93 | function resourceMonitorPlatformKey( | |
| 94 | 94 | platform: NodeJS.Platform, |
| 95 | 95 | architecture: NodeJS.Architecture, |
| 96 | 96 | ): string | undefined { |
| ... | ... | @@ -103,7 +103,7 @@ export function resourceMonitorPlatformKey( |
| 103 | 103 | return `${platform}-${architecture}`; |
| 104 | 104 | } |
| 105 | 105 | |
| 106 | export function resourceMonitorRustTarget( | |
| 106 | function resourceMonitorRustTarget( | |
| 107 | 107 | platform: NodeJS.Platform, |
| 108 | 108 | architecture: NodeJS.Architecture, |
| 109 | 109 | linuxLibc?: ResourceMonitorLinuxLibc, |
apps/server/src/resourceTelemetry/ResourceTelemetry.ts+1| ... | ... | @@ -142,6 +142,7 @@ function buildHealth(input: { |
| 142 | 142 | }; |
| 143 | 143 | } |
| 144 | 144 | |
| 145 | /** @public Service construction is part of the canonical Effect module API. */ | |
| 145 | 146 | export const make = Effect.fn("resourceTelemetry.resourceTelemetry.make")(function* () { |
| 146 | 147 | const nativeClient = yield* NativeTelemetryClient.NativeTelemetryClient; |
| 147 | 148 | const desktopReceiver = yield* DesktopTelemetryReceiver.DesktopTelemetryReceiver; |
apps/server/src/telemetry/AnalyticsService.ts+2-1| ... | ... | @@ -67,7 +67,7 @@ export class AnalyticsService extends Context.Service< |
| 67 | 67 | ); |
| 68 | 68 | } |
| 69 | 69 | |
| 70 | export function serverOsFromNodePlatform(platform: string): ClientOs { | |
| 70 | function serverOsFromNodePlatform(platform: string): ClientOs { | |
| 71 | 71 | switch (platform) { |
| 72 | 72 | case "darwin": |
| 73 | 73 | return "macOS"; |
| ... | ... | @@ -82,6 +82,7 @@ export function serverOsFromNodePlatform(platform: string): ClientOs { |
| 82 | 82 | } |
| 83 | 83 | } |
| 84 | 84 | |
| 85 | /** @public Service construction is part of the canonical Effect module API. */ | |
| 85 | 86 | export const make = Effect.gen(function* () { |
| 86 | 87 | const telemetryConfig = yield* TelemetryEnvConfig; |
| 87 | 88 | const httpClient = yield* HttpClient.HttpClient; |
apps/server/src/usage/UsageLimitSources.ts+1| ... | ... | @@ -60,6 +60,7 @@ function sourceLabel(id: string, config: UsageLimitSourceConfig): string { |
| 60 | 60 | } |
| 61 | 61 | } |
| 62 | 62 | |
| 63 | /** @public Service construction is part of the canonical Effect module API. */ | |
| 63 | 64 | export const make = Effect.gen(function* () { |
| 64 | 65 | const api = yield* makeCliproxyApi; |
| 65 | 66 | const settingsService = yield* ServerSettingsService; |
apps/server/src/usage/usageAggregation.ts+1-1| ... | ... | @@ -23,7 +23,7 @@ import { cacheSavingsUsd, priceUsage, type RateTable } from "./usagePricing.ts"; |
| 23 | 23 | * `en-CA` yields ISO-ordered parts, which is why it is used here rather than |
| 24 | 24 | * assembling the day from `Date` getters (those are host-local only). |
| 25 | 25 | */ |
| 26 | export function makeDayFormatter(timeZone: string): (timestampMs: number) => string { | |
| 26 | function makeDayFormatter(timeZone: string): (timestampMs: number) => string { | |
| 27 | 27 | let format: Intl.DateTimeFormat; |
| 28 | 28 | try { |
| 29 | 29 | format = new Intl.DateTimeFormat("en-CA", { |
apps/server/src/usage/usageScanCache.ts+1-1| ... | ... | @@ -26,7 +26,7 @@ import type { CodexScanState, UsageRecord } from "./usageTranscripts.ts"; |
| 26 | 26 | // entries would keep serving double-counted records forever. |
| 27 | 27 | // v3: entries carry the parse position and reducer state so a grown file |
| 28 | 28 | // re-parses only its appended bytes instead of starting over. |
| 29 | export const USAGE_SCAN_CACHE_VERSION = 3 as const; | |
| 29 | const USAGE_SCAN_CACHE_VERSION = 3 as const; | |
| 30 | 30 | |
| 31 | 31 | export interface CachedFile { |
| 32 | 32 | readonly size: number; |
apps/server/src/usage/usageTranscripts.ts+1-1| ... | ... | @@ -79,7 +79,7 @@ export function mightCarryUsage(line: string, provider: UsageProviderKind): bool |
| 79 | 79 | */ |
| 80 | 80 | export const GROK_COST_USD_TICKS_PER_DOLLAR = 10_000_000_000; |
| 81 | 81 | |
| 82 | export function grokCostTicksToUsd(ticks: unknown): number | null { | |
| 82 | function grokCostTicksToUsd(ticks: unknown): number | null { | |
| 83 | 83 | if (typeof ticks !== "number" || !Number.isFinite(ticks) || ticks < 0) return null; |
| 84 | 84 | return ticks / GROK_COST_USD_TICKS_PER_DOLLAR; |
| 85 | 85 | } |