feat: TypeScript telemetry client SDK v0.1.0

Standalone npm package (@mosaicstack/telemetry-client) for reporting
task-completion telemetry and querying predictions from the Mosaic
Stack Telemetry server.

- TelemetryClient with setInterval-based background flush
- EventQueue (bounded FIFO array)
- BatchSubmitter with native fetch, exponential backoff, Retry-After
- PredictionCache (Map + TTL)
- EventBuilder with auto-generated event_id/timestamp
- Zero runtime dependencies (Node 18+ native APIs)
- 43 tests, 86% branch coverage

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-02-07 23:25:31 -06:00
commit 177720e523
26 changed files with 5643 additions and 0 deletions

28
src/types/index.ts Normal file
View File

@@ -0,0 +1,28 @@
export {
TaskType,
Complexity,
Harness,
Provider,
QualityGate,
Outcome,
RepoSizeCategory,
type TaskCompletionEvent,
} from './events.js';
export {
type TokenDistribution,
type CorrectionFactors,
type QualityPrediction,
type PredictionData,
type PredictionMetadata,
type PredictionResponse,
type PredictionQuery,
} from './predictions.js';
export {
type BatchEventRequest,
type BatchEventResult,
type BatchEventResponse,
type BatchPredictionRequest,
type BatchPredictionResponse,
} from './common.js';