import { defineHandler, useConfig } from '@kb-labs/sdk';
import { resolveCommitConfig } from '@kb-labs/commit-contracts';

// src/rest/handlers/scopes-handler.ts
var scopes_handler_default = defineHandler({
  async execute(_ctx, _input) {
    const fileConfig = await useConfig();
    const config = resolveCommitConfig(fileConfig ?? {});
    const scopes = config.scope?.scopes ?? [{ id: "root", label: "root", path: "." }];
    const defaultId = config.scope?.default ?? scopes[0]?.id ?? "root";
    return {
      value: defaultId,
      options: scopes.map((s) => ({
        value: s.id,
        label: s.label,
        description: s.description
      }))
    };
  }
});

export { scopes_handler_default as default };
//# sourceMappingURL=scopes-handler.js.map
//# sourceMappingURL=scopes-handler.js.map