UNPKG

tdd-guard

Version:

TDD Guard enforces Test-Driven Development principles using Claude Code hooks

21 lines (20 loc) 723 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.SessionHandler = void 0; const FileStorage_1 = require("../storage/FileStorage"); const toolSchemas_1 = require("../contracts/schemas/toolSchemas"); class SessionHandler { storage; constructor(storage) { this.storage = storage ?? new FileStorage_1.FileStorage(); } async processSessionStart(hookData) { const parsedData = JSON.parse(hookData); const sessionStartResult = toolSchemas_1.SessionStartSchema.safeParse(parsedData); if (!sessionStartResult.success) { return; } await this.storage.clearTransientData(); } } exports.SessionHandler = SessionHandler;