/**
 * Commands Module
 *
 * Provides a command palette system with:
 * - Sequential input collection
 * - Visual feedback during input
 * - Keyboard shortcuts
 * - Extensible command registry
 */

// Types (only export command-specific types; InputMode, Point, SelectOption, FeedbackState come from core)
export type {
	InputType,
	InputDefinition,
	CommandFeedback,
	CreateNodePayload,
	CreateEdgePayload,
	CommandContext,
	CommandCategory,
	CommandDefinition,
	CommandLineState,
	UINodeState,
} from './types';

// Registry
export { commandRegistry, registerCommand } from './registry';

// Store atoms (inputModeAtom, pendingInputResolverAtom, provideInputAtom come from core)
export {
	// Core state (command-specific)
	commandLineVisibleAtom,
	commandLineStateAtom,
	commandFeedbackAtom,
	commandHistoryAtom,
	selectedSuggestionIndexAtom,
	// Action atoms
	openCommandLineAtom,
	closeCommandLineAtom,
	updateSearchQueryAtom,
	selectCommandAtom,
	skipInputAtom,
	goBackInputAtom,
	setCommandErrorAtom,
	clearCommandErrorAtom,
	// Derived atoms
	isCommandActiveAtom,
	currentInputAtom,
	commandProgressAtom,
} from './store';

// Keyboard
export { useGlobalKeyboard, useKeyState, DEFAULT_SHORTCUTS } from './keyboard';

// Executor
export {
	collectInput,
	executeCommandInteractive,
	handlePickedPoint,
	handlePickedNode,
	cancelCommand,
} from './executor';

// Provider
export { CommandProvider, useCommandContext, useExecuteCommand, type CommandProviderProps } from './CommandProvider';

// Built-in commands
export {
	// Viewport commands
	fitToViewCommand,
	fitSelectionCommand,
	resetViewportCommand,
	zoomInCommand,
	zoomOutCommand,
	registerViewportCommands,
	// Selection commands
	selectAllCommand,
	clearSelectionCommand,
	invertSelectionCommand,
	registerSelectionCommands,
	// History commands
	undoCommand,
	redoCommand,
	registerHistoryCommands,
	// Layout commands
	forceLayoutCommand,
	registerLayoutCommands,
	// Clipboard commands
	copyCommand,
	cutCommand,
	pasteCommand,
	duplicateCommand,
	deleteSelectedCommand,
	registerClipboardCommands,
	// Register all at once
	registerBuiltinCommands,
} from './builtins';
