/** * Forgen Usage Telemetry — ADR-008 §"테마 A unattended resilience" * * 5h / weekly window 의 tool call 수를 sliding window 로 추적하여 statusline * (`forgen me`) 에 노출. rate-limit hit 전에 사용자가 사용량을 가시화할 수 있도록. * * 정책: * - 각 PostToolUse 마다 append-only JSONL 에 timestamp 한 줄 기록 * - read 시 sliding window 로 필터 + 카운트 (스트리밍 — 메모리 절약) * - 10K 엔트리 누적 시 weekly cap 밖 엔트리 prune (rewrite once) * - fail-open: 모든 I/O 실패는 로그 후 무시, 호출 측 차단 안 함 * * 0.4.6 신설. limit prediction 은 의도적으로 제외 — Anthropic 의 실제 limit 가 * 계정/플랜별 가변이라 hard-code 부정확. raw count 만 노출하고 사용자가 판단. */ import type { HostId } from './trust-layer-intent.js'; export interface UsageStats { hour5: { claude: number; codex: number; total: number; }; week: { claude: number; codex: number; total: number; }; } /** * @deprecated ADR-010 W2-2 (2026-07-16): native `/usage` 가 plan limit 를 * skill/subagent/plugin/MCP 별로 정확히 분해하므로 forgen 의 raw count 는 * 중복 표면. 기록 중단(no-op shim — API 만 유지), v0.6.0 에서 모듈 삭제 예정. */ export declare function recordToolCall(_runtime?: HostId): void; /** * sliding window count. fail-open: 파일 미존재/parse 실패는 0 반환. * * @param now epoch ms (테스트 결정성) */ export declare function getUsageStats(now?: number): UsageStats;