1pub mod abort_controller;
4pub mod path;
5pub mod circular_buffer;
6pub mod combined_abort_signal;
7pub mod commit_attribution;
8pub mod concurrent;
9pub mod config;
10pub mod context;
11pub mod cwd;
12pub mod diff;
13pub mod env_utils;
14pub mod env_validation;
15pub mod errors;
16pub mod file_state_cache;
17pub mod forked_agent;
18pub mod git;
19pub mod git_diff;
20pub mod git_settings;
21pub mod github_repo_path_mapping;
22pub mod settings;
23pub mod hooks;
24pub mod messages;
25pub mod model;
26pub mod mtls;
27pub mod pdf_utils;
28pub mod permissions;
29pub mod plugins;
30pub mod process_user_input;
31pub mod query_helpers;
32pub mod shell;
33pub mod side_query;
34pub mod swarm;
35pub mod system_theme;
36pub mod task;
37pub mod task_list;
38pub mod tempfile;
39pub mod theme;
40pub mod thinking;
41pub mod tool_errors;
42pub mod ultraplan;
43pub mod user;
44pub mod user_agent;
45pub mod uuid;
46pub mod which;
47pub mod words;
48pub mod xdg;
49pub mod yaml;
50pub mod xml;
51pub mod zod_to_json_schema;
52
53pub use abort_controller::{
54 AbortController, AbortSignal, create_abort_controller, create_abort_controller_default,
55 create_child_abort_controller,
56};
57pub use config::{
58 AccountInfo, AutoUpdaterDisabledReason, DiffTool, EditorMode, GlobalConfig, InstallMethod,
59 McpServerConfig, NotificationChannel, ProjectConfig, ReleaseChannel, ThemeSetting,
60 check_has_trust_dialog_accepted, get_current_project_config, get_global_config,
61 get_global_config_path, get_or_create_user_id, is_auto_updater_disabled,
62 save_current_project_config, save_global_config,
63};
64pub use cwd::{get_cwd, get_original_cwd, pwd, run_with_cwd_override, set_cwd};
65pub use env_utils::{
66 get_aws_region, get_claude_config_home_dir, get_default_vertex_region, get_teams_dir,
67 get_user_type, get_vertex_region_for_model, has_node_option, is_ant_user, is_bare_mode,
68 is_env_defined_falsy, is_env_truthy, is_in_protected_namespace, is_running_on_homespace,
69 is_test_mode, parse_env_vars, should_maintain_project_working_dir,
70};
71pub use errors::error_message;
72pub use messages::{
73 Message, MessageContent, NormalizedMessage, extract_tag, get_last_assistant_message,
74 get_progress_messages_from_lookup, get_sibling_tool_use_ids_from_lookup, get_tool_result_ids,
75 is_classifier_denial, is_not_empty_message, is_tool_use_request_message,
76 is_tool_use_result_message, reorder_attachments_for_api,
77};
78pub use thinking::{
79 ThinkingConfig, find_thinking_trigger_positions, has_ultrathink_keyword, is_ultrathink_enabled,
80 model_supports_adaptive_thinking, model_supports_thinking, should_enable_thinking_by_default,
81};
82pub use uuid::{create_agent_id, generate_uuid, validate_uuid};
83pub use words::{generate_short_word_slug, generate_word_slug};
84
85pub use shell::{
87 BashShellProvider, PowerShellProvider,
88 shell_provider::{ShellError, ShellExecCommand},
89 shell_tool_utils::{SHELL_TYPES, ShellType},
90};
91
92pub use side_query::{
94 SideQueryMemorySelection, SideQueryOptions, side_query, side_query_simple,
95 side_query_with_tools,
96};
97
98pub use tempfile::{generate_temp_file_path, generate_temp_file_path_default};
100
101pub use which::{which, which_sync};
103
104pub use xdg::{get_user_bin_dir, get_xdg_cache_home, get_xdg_data_home, get_xdg_state_home};
106pub use yaml::parse_yaml;
107
108pub use commit_attribution::{
110 AttributionData, AttributionSnapshotMessage, AttributionState, AttributionSummary,
111 FileAttribution, FileAttributionState, FileChange, FileChangeType, SessionBaseline,
112 SurfaceBreakdown, attribution_restore_state_from_log, build_surface_key,
113 calculate_commit_attribution, compute_content_hash, create_empty_attribution_state,
114 expand_file_path, get_attribution_repo_root, get_client_surface, get_file_mtime,
115 get_repo_class_cached, get_staged_files, increment_prompt_count, is_internal_model_repo,
116 is_internal_model_repo_cached, normalize_file_path, restore_attribution_state_from_snapshots,
117 sanitize_model_name, sanitize_surface_key, state_to_snapshot_message, track_bulk_file_changes,
118 track_file_creation, track_file_deletion, track_file_modification,
119};
120
121pub use plugins::{
123 KnownMarketplace, KnownMarketplacesFile, PluginId, PluginMarketplace, PluginMarketplaceEntry,
124 PluginMarketplaceMetadata, PluginMarketplaceOwner, PluginSource, get_known_marketplace_names,
125 get_marketplace_cache_only, get_plugin_by_id_cache_only, parse_plugin_identifier,
126};
127
128pub use file_state_cache::{
130 DEFAULT_MAX_CACHE_SIZE_BYTES, FileState, FileStateCache, READ_FILE_STATE_CACHE_SIZE,
131 cache_keys, cache_to_object, clone_file_state_cache, create_file_state_cache_with_size_limit,
132 merge_file_state_caches,
133};
134
135pub use process_user_input::{
137 AgentDefinitions, ContentBlockParam, CursorPosition, EffortValue, IdeSelection,
138 ImageDimensions, ImageSource, PastedContent, ProcessUserInput, ProcessUserInputBaseResult,
139 ProcessUserInputContext, ProcessUserInputContextOptions, ProcessUserInputOptions,
140 PromptInputMode, QuerySource, QueryTracking, process_user_input,
141};
142
143pub use model::{
145 ModelName, ModelSetting, ModelShortName, ModelValidationResult, check_opus_1m_access,
146 check_sonnet_1m_access, first_party_name_to_canonical, get_best_model, get_canonical_name,
147 get_claude_ai_user_default_model_description, get_default_haiku_model,
148 get_default_main_loop_model, get_default_opus_model, get_default_sonnet_model,
149 get_main_loop_model, get_public_model_display_name, get_public_model_name,
150 get_small_fast_model, get_user_specified_model_setting, is_legacy_model_remap_enabled,
151 is_opus_1m_merge_enabled, model_display_string, normalize_model_string_for_api,
152 parse_user_specified_model, render_default_model_setting, render_model_name,
153 render_model_setting, resolve_skill_model_override, validate_model,
154};
155
156pub use swarm::{
158 AgentColorName, BackendType, CreatePaneResult, HIDDEN_SESSION_NAME, PLAN_MODE_REQUIRED_ENV_VAR,
159 PaneBackendType, PaneId, SWARM_SESSION_NAME, SWARM_VIEW_WINDOW_NAME, SystemPromptMode,
160 TEAM_LEAD_NAME, TEAMMATE_COLOR_ENV_VAR, TEAMMATE_COMMAND_ENV_VAR, TMUX_COMMAND,
161 TeammateIdentity, TeammateMessage, TeammateSpawnConfig, TeammateSpawnResult,
162 get_swarm_socket_name, is_pane_backend,
163};
164
165pub use system_theme::{
167 SystemTheme, get_system_theme_name, resolve_theme_setting, set_cached_system_theme,
168 theme_from_osc_color,
169};
170
171pub use theme::{
173 AnsiColor, DARK_ANSI_THEME, DARK_DALTONIZED_THEME, DARK_THEME, LIGHT_ANSI_THEME,
174 LIGHT_DALTONIZED_THEME, LIGHT_THEME, THEME_NAMES, Theme, ThemeColor, get_theme,
175 theme_color_to_ansi,
176};
177
178pub use user::{
180 CoreUserData, GitHubActionsMetadata, Platform, get_core_user_data, get_git_email,
181 get_user_for_analytics, reset_user_cache, set_cached_email,
182};
183
184pub use task::{
186 AppState, CircularBuffer, MAX_TASK_OUTPUT_BYTES, MAX_TASK_OUTPUT_BYTES_DISPLAY,
187 OUTPUT_FILE_TAG, PANEL_GRACE_MS, POLL_INTERVAL_MS, STATUS_TAG, STOPPED_DISPLAY_MS, SUMMARY_TAG,
188 SetAppState, TASK_ID_TAG, TASK_NOTIFICATION_TAG, TASK_TYPE_TAG, TOOL_USE_ID_TAG,
189 TaskAttachment, TaskOutput, TaskStateBase, TaskStatus, TaskType, append_task_output,
190 apply_task_offsets_and_evictions, cleanup_task_output, evict_task_output, evict_terminal_task,
191 flush_task_output, format_task_notification, generate_task_attachments, get_running_tasks,
192 get_task_output, get_task_output_delta, get_task_output_path, get_task_output_size,
193 init_task_output, init_task_output_as_symlink, is_terminal_task_status, poll_tasks,
194 register_task,
195};
196
197pub use ultraplan::{
199 TriggerPosition, find_ultraplan_trigger_positions, find_ultrareview_trigger_positions,
200 has_ultraplan_keyword, has_ultrareview_keyword, replace_ultraplan_keyword,
201};
202
203pub mod billing;
205pub mod completion_cache;
206pub mod content_array;
207pub mod cursor;
208pub mod debug;
209pub mod debug_filter;
210
211pub use billing::{
212 has_claude_ai_billing_access, has_console_billing_access, set_mock_billing_access_override,
213};
214pub use completion_cache::{ShellInfo, detect_shell, get_completion_cache_dir};
215pub use content_array::insert_block_after_tool_results;
216pub use cursor::{
217 YankPopResult, can_yank_pop, clear_kill_ring, get_kill_ring_item, get_kill_ring_size,
218 get_last_kill, is_vim_punctuation, is_vim_whitespace, is_vim_word_char, push_to_kill_ring,
219 record_yank, reset_kill_accumulation, reset_yank_state, update_yank_length, yank_pop,
220};
221pub use debug::{
222 DebugLogLevel, enable_debug_logging, get_debug_file_path, get_debug_filter, get_debug_log_path,
223 get_min_debug_log_level, is_debug_mode, is_debug_to_stderr, log_ant_error, log_for_debugging,
224};
225pub use debug_filter::{
226 DebugFilter, extract_debug_categories, parse_debug_filter, should_show_debug_categories,
227 should_show_debug_message,
228};
229pub mod gh_pr_status;
230pub mod heatmap;
231pub mod horizontal_scroll;
232pub mod http;
233pub mod hyperlink;
234pub mod ide_path_conversion;
235pub mod idle_timeout;
236pub mod image_store;
237pub mod image_validation;
238pub mod immediate_command;
239pub mod inspector;
244pub mod managed_env_constants;
245pub mod memoize;
246pub mod memory_file_detection;
247pub mod modifiers;
248pub mod native_installer;
249pub mod notebook;
250pub mod paste_store;
251pub mod plan_mode_v2;
252pub mod plans;
253pub mod powershell;
254pub mod process;
255pub mod prompt_editor;
256pub mod prompt_shell_execution;
257pub mod proxy;
258pub mod query_context;
259pub mod query_guard;
260pub mod query_profiler;
261pub mod queue_processor;
262pub mod read_edit_context;
263pub mod read_file_in_range;
264pub mod release_notes;
265pub mod render_options;
266pub mod ripgrep;
267pub mod sandbox;
268pub mod sanitization;
269pub mod screenshot_clipboard;
270pub mod sdk_event_queue;
271pub mod secure_storage;
272pub mod semantic_boolean;
273pub mod semantic_number;
274pub mod semver;
275pub mod sequential;
276pub mod session_activity;
277pub mod session_env_vars;
278pub mod session_environment;
279pub mod session_file_access_hooks;
280pub mod session_ingress_auth;
281pub mod session_restore;
282pub mod session_start;
283pub mod session_state;
284pub mod session_storage;
285pub mod session_storage_portable;
286pub mod session_title;
287pub mod session_url;
288
289pub use mtls::{
290 clear_mtls_cache, configure_mtls, get_ca_cert, get_client_cert, get_client_key, is_mtls_enabled,
291};
292pub use proxy::{
293 clear_proxy_cache, configure_global_agents, get_http_proxy, get_https_proxy, get_proxy_config,
294 should_bypass_proxy,
295};
296pub use semantic_boolean::{is_falsy, is_truthy, parse_env_bool, to_bool};
297pub use semantic_number::{format_with_suffix, parse_byte_size, parse_semantic_number};
298pub use session_env_vars::{
299 clear_session_environment, get_session_environment, set_session_environment,
300};
301
302pub use managed_env_constants::{
303 DANGEROUS_SHELL_SETTINGS, SAFE_ENV_VARS, is_provider_managed_env_var, is_safe_env_var,
304};
305pub use memoize::{memoize_with_lru, memoize_with_ttl, memoize_with_ttl_async};
306pub use memory_file_detection::{
307 detect_session_file_type, detect_session_pattern_type, is_auto_managed_memory_file,
308 is_memory_directory, is_shell_command_targeting_memory,
309};
310pub use pdf_utils::{extension_for_mime_type, is_binary_content_type, is_likely_pdf};
311pub use powershell::{escape_powershell_string, is_powershell_available};
312
313pub use modifiers::{Modifier, Shortcut};
314pub use native_installer::{install_package, is_native_installer_available};
315pub use notebook::{Notebook, extract_code_cells, is_notebook_file, parse_notebook};
316pub use paste_store::{PasteItem, PasteStore};
317pub use plan_mode_v2::{
318 get_plan_mode_v2_agent_count, get_plan_mode_v2_explore_agent_count,
319 is_plan_mode_interview_phase_enabled, is_plan_mode_v2_enabled,
320};
321pub use plans::{Plan, PlanStatus, PlanStep, StepStatus};
322pub use process::{get_process_id, get_process_info, is_running_in_container};
323pub use prompt_editor::{PromptEditorConfig, PromptTemplate};
324pub use prompt_shell_execution::{
325 FrontmatterShell, build_shell_command, execute_prompt_shell,
326 execute_shell_commands_in_prompt,
327};
328pub use query_context::{QueryContext, QueryMatch, QueryResult as QueryContextResult};
329pub use query_guard::{QueryGuard, QueryGuardError};
330pub use query_helpers::{parse_rg_output, search_with_rg};
331pub use query_profiler::QueryProfiler;
332pub use queue_processor::QueueProcessor;
333pub use read_file_in_range::{get_line_count, read_bytes_in_range, read_file_in_range};
334pub use render_options::RenderOptions;
335pub use ripgrep::{is_ripgrep_available, ripgrep_files};
336pub use sandbox::{get_sandbox_dir, is_path_in_sandbox, is_sandbox_enabled};
337pub use sanitization::escape_shell_arg;
338pub use sanitization::{escape_html, sanitize_filename, sanitize_path, truncate};
339pub use screenshot_clipboard::{copy_screenshot_to_clipboard, take_screenshot};
340pub use sdk_event_queue::{
341 DrainedSdkEvent, SdkEvent, SdkEventQueue, SdkEventType, SdkEventUsage, TaskProgressParams,
342 drain_sdk_events, emit_session_state_changed, emit_task_progress, emit_task_started,
343 emit_task_terminated_sdk, enqueue_sdk_event,
344};
345pub use secure_storage::SecureStorage;
346pub use semver::{Semver, parse_semver};
347pub use session_activity::{ActivityType, SessionActivity, SessionActivityTracker};
348pub use session_restore::{can_restore_session, restore_session};
349pub use session_start::{SessionStartConfig, create_session};
350pub use session_state::SessionState;
351pub use session_title::{clean_title_for_filename, generate_session_title};
352pub use session_url::{build_session_url, extract_session_id, is_valid_session_url};
353
354pub mod exec_file_no_throw;
356pub mod platform;
357pub mod set;
358pub mod subprocess_env;
359
360pub use exec_file_no_throw::{
361 ExecResult, exec_file_no_throw, exec_file_no_throw_sync, exec_file_no_throw_with_cwd,
362};
363pub use platform::{SUPPORTED_PLATFORMS, detect_platform, get_platform};
364pub use set::{difference, every, intersects, union};
365pub use subprocess_env::{GHA_SUBPROCESS_SCRUB, register_upstream_proxy_env_fn, subprocess_env};
366
367pub mod token_budget;
369pub mod tokens;
370pub mod analyze_context;
371pub mod collapse_read_search;