// Core session management

export { discoverAndPrintModels, listModels } from "./cli/list-models.js";
// Config paths
export { getAgentDir, VERSION } from "./config.js";
export {
	AgentSession,
	type AgentSessionConfig,
	type AgentSessionEvent,
	type AgentSessionEventListener,
	type ModelCycleResult,
	type ParsedSkillBlock,
	type PromptOptions,
	parseSkillBlock,
	type SessionStats,
} from "./core/agent-session.js";

export { ArtifactManager } from "./core/artifact-manager.js";
// Auth and model registry
export {
	type ApiKeyCredential,
	type AuthCredential,
	AuthStorage,
	type AuthStorageBackend,
	FileAuthStorageBackend,
	InMemoryAuthStorageBackend,
	type OAuthCredential,
} from "./core/auth-storage.js";
// Blob and artifact storage
export {
	BlobStore,
	externalizeImageData,
	isBlobRef,
	parseBlobRef,
	resolveImageData,
} from "./core/blob-store.js";
// Compaction
export {
	type BranchPreparation,
	type BranchSummaryResult,
	type CollectEntriesResult,
	type CompactionResult,
	type CutPointResult,
	calculateContextTokens,
	collectEntriesForBranchSummary,
	compact,
	DEFAULT_COMPACTION_SETTINGS,
	estimateTokens,
	type FileOperations,
	findCutPoint,
	findTurnStartIndex,
	type GenerateBranchSummaryOptions,
	generateBranchSummary,
	generateSummary,
	getLastAssistantUsage,
	prepareBranchEntries,
	serializeConversation,
	shouldCompact,
} from "./core/compaction/index.js";
export { ModelDiscoveryCache } from "./core/discovery-cache.js";
export {
	createEventBus,
	type EventBus,
	type EventBusController,
} from "./core/event-bus.js";
// Extension system
export type {
	AdjustToolSetEvent,
	AdjustToolSetResult,
	AgentEndEvent,
	AgentStartEvent,
	AgentToolResult,
	AgentToolUpdateCallback,
	AppAction,
	BashToolCallEvent,
	BashTransformEvent,
	BashTransformEventResult,
	BeforeAgentStartEvent,
	BeforeProviderRequestEvent,
	BeforeProviderRequestEventResult,
	CompactOptions,
	ContextEvent,
	ContextUsage,
	CustomToolCallEvent,
	EditToolCallEvent,
	ExecOptions,
	ExecResult,
	Extension,
	ExtensionActions,
	ExtensionAPI,
	ExtensionCommandContext,
	ExtensionCommandContextActions,
	ExtensionContext,
	ExtensionContextActions,
	ExtensionError,
	ExtensionEvent,
	ExtensionFactory,
	ExtensionFlag,
	ExtensionHandler,
	ExtensionManifest,
	ExtensionRuntime,
	ExtensionShortcut,
	ExtensionStartupContext,
	ExtensionUIContext,
	ExtensionUIDialogOptions,
	ExtensionWidgetOptions,
	FindToolCallEvent,
	GrepToolCallEvent,
	InputEvent,
	InputEventResult,
	InputSource,
	KeybindingsManager,
	LifecycleHookContext,
	LifecycleHookHandler,
	LifecycleHookMap,
	LifecycleHookPhase,
	LifecycleHookScope,
	LoadExtensionsResult,
	LsToolCallEvent,
	MessageRenderer,
	MessageRenderOptions,
	ProviderConfig,
	ProviderModelConfig,
	ReadToolCallEvent,
	RegisteredCommand,
	RegisteredTool,
	SessionBeforeCompactEvent,
	SessionBeforeForkEvent,
	SessionBeforeSwitchEvent,
	SessionBeforeTreeEvent,
	SessionCompactEvent,
	SessionForkEvent,
	SessionShutdownEvent,
	SessionStartEvent,
	SessionSwitchEvent,
	SessionTreeEvent,
	SlashCommandInfo,
	SlashCommandLocation,
	SlashCommandSource,
	SortResult,
	SortWarning,
	TerminalInputHandler,
	ToolCallEvent,
	ToolCompatibility,
	ToolDefinition,
	ToolInfo,
	ToolRenderResultOptions,
	ToolResultEvent,
	TurnEndEvent,
	TurnStartEvent,
	UserBashEvent,
	UserBashEventResult,
	WidgetPlacement,
	WriteToolCallEvent,
} from "./core/extensions/index.js";
export {
	createExtensionRuntime,
	discoverAndLoadExtensions,
	ExtensionRunner,
	importExtensionModule,
	isToolCallEventType,
	isToolResultEventType,
	readManifest,
	readManifestFromEntryPath,
	sortExtensionPaths,
	wrapRegisteredTool,
	wrapRegisteredTools,
	wrapToolsWithExtensions,
	wrapToolWithExtensions,
} from "./core/extensions/index.js";
// Footer data provider (git branch + extension statuses - data not otherwise available to extensions)
export type { ReadonlyFooterDataProvider } from "./core/footer-data-provider.js";
// MCP connection manager
export {
	buildHttpTransportOpts,
	type ConnectionStatus,
	McpConnectionManager,
	type McpServerConfig,
	type McpToolDefinition,
	type RegisterToolFn,
	type RegisterToolParams,
} from "./core/mcp/index.js";
export { FederatedMemoryProvider } from "./core/memory/federated-memory.js";
export { convertToLlm } from "./core/messages.js";
export type {
	DiscoveredModel,
	DiscoveryResult,
	DiscoverySourceType,
	ProviderDiscoveryAdapter,
} from "./core/model-discovery.js";
export {
	getDiscoverableCatalogSources,
	getDiscoverableProviders,
	getDiscoveryAdapter,
} from "./core/model-discovery.js";
export { ModelRegistry } from "./core/model-registry.js";
export { ModelsJsonWriter } from "./core/models-json-writer.js";
export type {
	PackageCommand,
	PackageCommandOptions,
	PackageCommandRunnerOptions,
	PackageCommandRunnerResult,
} from "./core/package-commands.js";
export {
	getPackageCommandUsage,
	parsePackageCommand,
	runPackageCommand,
} from "./core/package-commands.js";
export type {
	PackageManager,
	PathMetadata,
	ProgressCallback,
	ProgressEvent,
	ResolvedPaths,
	ResolvedResource,
} from "./core/package-manager.js";
export { DefaultPackageManager } from "./core/package-manager.js";
// Native provider middleware
export {
	CUSTOM_SEARCH_TOOL_NAMES,
	MAX_NATIVE_SEARCHES_PER_SESSION,
	setPreferBraveResolver,
	stripThinkingFromHistory,
	WebSearchMiddleware,
	webSearchMiddleware,
} from "./core/providers/web-search-middleware.js";
export {
	getAllowedCommandPrefixes,
	SAFE_COMMAND_PREFIXES,
	setAllowedCommandPrefixes,
} from "./core/resolve-config-value.js";
export type {
	ResourceCollision,
	ResourceDiagnostic,
	ResourceLoader,
} from "./core/resource-loader.js";
export { DefaultResourceLoader } from "./core/resource-loader.js";
// SDK for programmatic usage
export {
	type CreateAgentSessionOptions,
	type CreateAgentSessionResult,
	CredentialCooldownError,
	// Factory
	createAgentSession,
	createBashTool,
	// Tool factories (for custom cwd)
	createCodingTools,
	createEditTool,
	createFindTool,
	createGrepTool,
	createLsTool,
	createReadOnlyTools,
	createReadTool,
	createWriteTool,
	type PromptTemplate,
	// Pre-built tools (use process.cwd())
	readOnlyTools,
} from "./core/sdk.js";
export {
	type BranchSummaryEntry,
	buildSessionContext,
	type CompactionEntry,
	CURRENT_SESSION_VERSION,
	type CustomEntry,
	type CustomMessageEntry,
	type FileEntry,
	getLatestCompactionEntry,
	type ModelChangeEntry,
	migrateSessionEntries,
	type NewSessionOptions,
	parseSessionEntries,
	type SessionContext,
	type SessionEntry,
	type SessionEntryBase,
	type SessionHeader,
	type SessionInfo,
	type SessionInfoEntry,
	SessionManager,
	type SessionMessageEntry,
	type ThinkingLevelChangeEntry,
} from "./core/session-manager.js";
export {
	type AsyncSettings,
	type BashSettings,
	type CompactionSettings,
	type ImageSettings,
	type MemorySettings,
	type PackageSource,
	type RetrySettings,
	SettingsManager,
	type TaskIsolationSettings,
} from "./core/settings-manager.js";
// Skills
export {
	ECOSYSTEM_PROJECT_SKILLS_DIR,
	ECOSYSTEM_SKILLS_DIR,
	formatSkillsForPrompt,
	getLoadedSkills,
	type LoadSkillsFromDirOptions,
	type LoadSkillsResult,
	loadSkills,
	loadSkillsFromDir,
	type Skill,
	type SkillFrontmatter,
} from "./core/skills.js";
// Subagent runner
export {
	type RunSubagentOptions,
	runSubagent,
	type SubagentConfig,
	type SubagentResult,
} from "./core/subagent-runner.js";
// Tools
export {
	type BashInterceptorRule,
	type BashOperations,
	type BashSpawnContext,
	type BashSpawnHook,
	type BashToolDetails,
	type BashToolInput,
	type BashToolOptions,
	bashTool,
	type CompiledInterceptor,
	checkBashInterception,
	codingTools,
	compileInterceptor,
	DEFAULT_BASH_INTERCEPTOR_RULES,
	DEFAULT_MAX_BYTES,
	DEFAULT_MAX_LINES,
	type EditOperations,
	type EditToolDetails,
	type EditToolInput,
	type EditToolOptions,
	editTool,
	type FindOperations,
	type FindToolDetails,
	type FindToolInput,
	type FindToolOptions,
	findTool,
	formatSize,
	type GrepOperations,
	type GrepToolDetails,
	type GrepToolInput,
	type GrepToolOptions,
	getAllToolCompatibility,
	getToolCompatibility,
	grepTool,
	type LsOperations,
	type LsToolDetails,
	type LsToolInput,
	type LsToolOptions,
	lsTool,
	type ReadOperations,
	type ReadToolDetails,
	type ReadToolInput,
	type ReadToolOptions,
	readTool,
	registerMcpToolCompatibility,
	// Tool compatibility registry (ADR-005)
	registerToolCompatibility,
	resetToolCompatibilityRegistry,
	rewriteBackgroundCommand,
	type ToolsOptions,
	type TruncationOptions,
	type TruncationResult,
	truncateHead,
	truncateLine,
	truncateTail,
	type WriteOperations,
	type WriteToolInput,
	type WriteToolOptions,
	writeTool,
} from "./core/tools/index.js";
// Main entry point
export { main } from "./main.js";
// Run modes for programmatic SDK usage
export {
	InteractiveMode,
	type InteractiveModeOptions,
	type ModelInfo,
	type PrintModeOptions,
	RpcClient,
	type RpcClientOptions,
	type RpcCommand,
	type RpcEventListener,
	type RpcInitResult,
	type RpcProtocolVersion,
	type RpcResponse,
	type RpcSessionState,
	type RpcV2Event,
	runPrintMode,
	runRpcMode,
} from "./modes/index.js";
// UI components for extensions
export {
	ArminComponent,
	AssistantMessageComponent,
	appKey,
	appKeyHint,
	BashExecutionComponent,
	BorderedLoader,
	BranchSummaryMessageComponent,
	CompactionSummaryMessageComponent,
	CustomEditor,
	CustomMessageComponent,
	DynamicBorder,
	ExtensionEditorComponent,
	ExtensionInputComponent,
	ExtensionSelectorComponent,
	editorKey,
	FooterComponent,
	keyHint,
	LoginDialogComponent,
	ModelSelectorComponent,
	OAuthSelectorComponent,
	ProviderManagerComponent,
	type RenderDiffOptions,
	rawKeyHint,
	renderDiff,
	SessionSelectorComponent,
	type SettingsCallbacks,
	type SettingsConfig,
	SettingsSelectorComponent,
	ShowImagesSelectorComponent,
	SkillInvocationMessageComponent,
	ThemeSelectorComponent,
	ThinkingSelectorComponent,
	ToolExecutionComponent,
	type ToolExecutionOptions,
	TreeSelectorComponent,
	truncateToVisualLines,
	UserMessageComponent,
	UserMessageSelectorComponent,
	type VisualTruncateResult,
} from "./modes/interactive/components/index.js";
// Theme utilities for custom tools and extensions
export {
	getLanguageFromPath,
	getMarkdownTheme,
	getSelectListTheme,
	getSettingsListTheme,
	highlightCode,
	initTheme,
	Theme,
	type ThemeColor,
} from "./modes/interactive/theme/theme.js";
// RPC JSONL utilities
export { attachJsonlLineReader, serializeJsonLine } from "./modes/rpc/jsonl.js";
// Clipboard utilities
export { copyToClipboard } from "./utils/clipboard.js";
// Pure formatting utilities (duration, token counts, sparklines, ANSI, etc.)
export {
	fileLink,
	formatDateShort,
	formatDuration,
	formatTokenCount,
	type NormalizeStringArrayOptions,
	normalizeStringArray,
	sparkline,
	stripAnsi,
	truncateWithEllipsis,
} from "./utils/format.js";
export { parseFrontmatter, stripFrontmatter } from "./utils/frontmatter.js";
// Cross-platform path display
export { toPosixPath } from "./utils/path-display.js";
// Shell utilities
export { getShellConfig, sanitizeCommand } from "./utils/shell.js";
