import 'package:oto/oto/agent/runner_capability_provider.dart';
import 'package:oto/oto/commands/command.dart';
import 'package:oto/oto/commands/command_registry.dart';

class CommandCatalogRunnerCapabilityProvider
    implements RunnerCapabilityProvider {
  final String name;
  final String version;

  const CommandCatalogRunnerCapabilityProvider({
    this.name = 'oto-runner',
    this.version = '1.0.0',
  });

  @override
  RunnerCapabilitySnapshot snapshot() {
    registerAllCommands();
    return RunnerCapabilitySnapshot(
      name: name,
      version: version,
      commandTypes: Command.catalogRows.map((row) => row['type']!),
    );
  }
}
