Capability-aware timing schema, validation, percentile calculation, and aggregation for comparing AI CLI providers without pretending every provider supports the same measurements. This package is not a provider framework: it does not run CLIs, parse provider protocols, manage sessions, or define a shared runtime.
npm install @bbingz/polycli-timingThe root export mirrors src/index.js:
TIMING_SCHEMA_VERSIONTIMING_METRIC_NAMESTIMING_METRIC_STATUSESTIMING_RUNTIME_PERSISTENCETIMING_MEASUREMENT_SCOPESTIMING_SCHEMA_URLreadTimingSchemavalidateTimingRecordcalculatePercentilesaggregateTimingRecords
@bbingz/polycli-timing/schema
unsupported,missing,zero, andmeasuredare distinct states and must not be collapsed.- In v1,
coldandretryare intentionally alwaysunsupported; upstream CLIs do not expose stable signals, and polycli does not fake them. runtimePersistencedistinguishesephemeral,session, anddaemonruntimes.measurementScopedistinguishesrequest,turn, andjobmeasurements.- Aggregation preserves capability-aware metric summaries plus
runtimePersistenceCountsandmeasurementScopeCounts. aggregateTimingRecords()also returns additivecohorts, keyed byprovider,kind,measurementScope,outcome, andruntimePersistence. Use a cohort's percentiles for comparisons. The backward-compatiblebyProvidersummary exposescohortCountandmixedDimensions; its pooled percentiles are not a comparable cross-cohort result whenmixedDimensionsis non-empty.
import {
validateTimingRecord,
aggregateTimingRecords,
} from "@bbingz/polycli-timing";v1.x is the first stable line. Additive exports and backward-compatible schema/aggregation behavior are minor releases. Removing exports, changing documented output shapes, or collapsing the four metric states requires a major version.
The authoritative v1 surface reference is docs/polycli-v1-public-surface.md.