import { defineHandler } from '@kb-labs/sdk';
import { loadHistory, getPackageTimeline } from '@kb-labs/qa-core';

// src/rest/handlers/package-timeline-handler.ts
var package_timeline_handler_default = defineHandler({
  async execute(ctx, input) {
    const packageName = input.params?.name;
    if (!packageName) {
      throw new Error("Package name is required (path param :name)");
    }
    const history = loadHistory(ctx.cwd);
    return getPackageTimeline(history, packageName);
  }
});

export { package_timeline_handler_default as default };
//# sourceMappingURL=package-timeline-handler.js.map
//# sourceMappingURL=package-timeline-handler.js.map