mirror of
https://github.com/fawney19/Aether.git
synced 2026-09-02 01:10:23 +08:00
264 lines
15 KiB
Rust
264 lines
15 KiB
Rust
pub use crate::contracts::{
|
|
core_error_background_report_kind, core_error_default_client_api_format,
|
|
core_success_background_report_kind, implicit_sync_finalize_report_kind,
|
|
is_openai_responses_stream_plan_kind, is_openai_responses_sync_plan_kind, AiControlPlanRequest,
|
|
ExecutionRuntimeAuthContext, CLAUDE_CHAT_STREAM_PLAN_KIND,
|
|
CLAUDE_CHAT_STREAM_SUCCESS_REPORT_KIND, CLAUDE_CHAT_SYNC_ERROR_REPORT_KIND,
|
|
CLAUDE_CHAT_SYNC_FINALIZE_REPORT_KIND, CLAUDE_CHAT_SYNC_PLAN_KIND,
|
|
CLAUDE_CHAT_SYNC_SUCCESS_REPORT_KIND, CLAUDE_CLI_STREAM_PLAN_KIND,
|
|
CLAUDE_CLI_STREAM_SUCCESS_REPORT_KIND, CLAUDE_CLI_SYNC_ERROR_REPORT_KIND,
|
|
CLAUDE_CLI_SYNC_FINALIZE_REPORT_KIND, CLAUDE_CLI_SYNC_PLAN_KIND,
|
|
CLAUDE_CLI_SYNC_SUCCESS_REPORT_KIND, EXECUTION_RUNTIME_STREAM_ACTION,
|
|
EXECUTION_RUNTIME_STREAM_DECISION_ACTION, EXECUTION_RUNTIME_SYNC_ACTION,
|
|
EXECUTION_RUNTIME_SYNC_DECISION_ACTION, GEMINI_CHAT_STREAM_PLAN_KIND,
|
|
GEMINI_CHAT_STREAM_SUCCESS_REPORT_KIND, GEMINI_CHAT_SYNC_ERROR_REPORT_KIND,
|
|
GEMINI_CHAT_SYNC_FINALIZE_REPORT_KIND, GEMINI_CHAT_SYNC_PLAN_KIND,
|
|
GEMINI_CHAT_SYNC_SUCCESS_REPORT_KIND, GEMINI_CLI_STREAM_PLAN_KIND,
|
|
GEMINI_CLI_STREAM_SUCCESS_REPORT_KIND, GEMINI_CLI_SYNC_ERROR_REPORT_KIND,
|
|
GEMINI_CLI_SYNC_FINALIZE_REPORT_KIND, GEMINI_CLI_SYNC_PLAN_KIND,
|
|
GEMINI_CLI_SYNC_SUCCESS_REPORT_KIND, GEMINI_EMBEDDING_SYNC_PLAN_KIND,
|
|
GEMINI_EMBEDDING_SYNC_SUCCESS_REPORT_KIND, GEMINI_FILES_DELETE_PLAN_KIND,
|
|
GEMINI_FILES_DOWNLOAD_PLAN_KIND, GEMINI_FILES_GET_PLAN_KIND, GEMINI_FILES_LIST_PLAN_KIND,
|
|
GEMINI_FILES_UPLOAD_PLAN_KIND, GEMINI_VIDEO_CANCEL_SYNC_PLAN_KIND,
|
|
GEMINI_VIDEO_CREATE_SYNC_FINALIZE_REPORT_KIND, GEMINI_VIDEO_CREATE_SYNC_PLAN_KIND,
|
|
OPENAI_CHAT_STREAM_PLAN_KIND, OPENAI_CHAT_STREAM_SUCCESS_REPORT_KIND,
|
|
OPENAI_CHAT_SYNC_ERROR_REPORT_KIND, OPENAI_CHAT_SYNC_FINALIZE_REPORT_KIND,
|
|
OPENAI_CHAT_SYNC_PLAN_KIND, OPENAI_CHAT_SYNC_SUCCESS_REPORT_KIND,
|
|
OPENAI_EMBEDDING_SYNC_ERROR_REPORT_KIND, OPENAI_EMBEDDING_SYNC_FINALIZE_REPORT_KIND,
|
|
OPENAI_EMBEDDING_SYNC_PLAN_KIND, OPENAI_EMBEDDING_SYNC_SUCCESS_REPORT_KIND,
|
|
OPENAI_IMAGE_STREAM_PLAN_KIND, OPENAI_IMAGE_STREAM_SUCCESS_REPORT_KIND,
|
|
OPENAI_IMAGE_SYNC_ERROR_REPORT_KIND, OPENAI_IMAGE_SYNC_FINALIZE_REPORT_KIND,
|
|
OPENAI_IMAGE_SYNC_PLAN_KIND, OPENAI_IMAGE_SYNC_SUCCESS_REPORT_KIND,
|
|
OPENAI_RERANK_SYNC_PLAN_KIND, OPENAI_RESPONSES_COMPACT_STREAM_PLAN_KIND,
|
|
OPENAI_RESPONSES_COMPACT_STREAM_SUCCESS_REPORT_KIND,
|
|
OPENAI_RESPONSES_COMPACT_SYNC_ERROR_REPORT_KIND,
|
|
OPENAI_RESPONSES_COMPACT_SYNC_FINALIZE_REPORT_KIND, OPENAI_RESPONSES_COMPACT_SYNC_PLAN_KIND,
|
|
OPENAI_RESPONSES_COMPACT_SYNC_SUCCESS_REPORT_KIND, OPENAI_RESPONSES_STREAM_PLAN_KIND,
|
|
OPENAI_RESPONSES_STREAM_SUCCESS_REPORT_KIND, OPENAI_RESPONSES_SYNC_ERROR_REPORT_KIND,
|
|
OPENAI_RESPONSES_SYNC_FINALIZE_REPORT_KIND, OPENAI_RESPONSES_SYNC_PLAN_KIND,
|
|
OPENAI_RESPONSES_SYNC_SUCCESS_REPORT_KIND, OPENAI_VIDEO_CANCEL_SYNC_PLAN_KIND,
|
|
OPENAI_VIDEO_CONTENT_PLAN_KIND, OPENAI_VIDEO_CREATE_SYNC_FINALIZE_REPORT_KIND,
|
|
OPENAI_VIDEO_CREATE_SYNC_PLAN_KIND, OPENAI_VIDEO_DELETE_SYNC_PLAN_KIND,
|
|
OPENAI_VIDEO_REMIX_SYNC_PLAN_KIND,
|
|
};
|
|
pub use crate::formats::claude::messages::stream::{ClaudeClientEmitter, ClaudeProviderState};
|
|
pub use crate::formats::gemini::generate_content::stream::{
|
|
GeminiClientEmitter, GeminiProviderState,
|
|
};
|
|
pub use crate::formats::openai::chat::stream::{
|
|
OpenAIChatClientEmitter, OpenAIChatProviderState, OpenAIResponsesClientEmitter,
|
|
OpenAIResponsesProviderState,
|
|
};
|
|
pub use crate::formats::openai::image::stream::{
|
|
maybe_build_openai_image_sync_finalize_product, OpenAiImageStreamState,
|
|
OpenAiImageSyncFinalizeProduct,
|
|
};
|
|
pub use crate::formats::openai::shared::{
|
|
copy_request_number_field, copy_request_number_field_as,
|
|
map_openai_reasoning_effort_to_claude_output, map_openai_reasoning_effort_to_gemini_budget,
|
|
parse_openai_stop_sequences, resolve_openai_chat_max_tokens, value_as_u64,
|
|
};
|
|
pub use crate::formats::shared::error_body::{
|
|
build_core_error_body_for_client_format, is_core_error_finalize_kind, LocalCoreSyncErrorKind,
|
|
};
|
|
pub use crate::formats::shared::image_bridge::{
|
|
build_gemini_image_request_body_from_openai_image_request,
|
|
build_gemini_image_response_from_openai_image_response,
|
|
build_gemini_image_response_from_openai_responses_image_response,
|
|
build_openai_image_provider_body_from_response_stream_sync_body,
|
|
build_openai_image_request_body_from_gemini_image_request,
|
|
build_openai_image_response_from_gemini_response,
|
|
build_openai_image_response_from_response_stream_sync_body, gemini_request_is_image_generation,
|
|
resolve_requested_gemini_image_model_for_request, GeminiImageRequestForOpenAi,
|
|
OpenAiImageRequestForGemini,
|
|
};
|
|
pub use crate::formats::shared::model_directives::{
|
|
apply_model_directive_mapping_patch, apply_model_directive_overrides_from_model,
|
|
apply_model_directive_overrides_from_request, claude_model_uses_adaptive_effort,
|
|
extract_gemini_model_from_path, gemini_model_uses_thinking_level, model_directive_base_model,
|
|
normalize_model_directive_model, parse_model_directive, ModelDirective, ModelOverride,
|
|
ReasoningEffort,
|
|
};
|
|
pub use crate::formats::shared::passthrough::{
|
|
resolve_stream_spec as resolve_local_same_format_stream_spec,
|
|
resolve_sync_spec as resolve_local_same_format_sync_spec, LocalSameFormatProviderFamily,
|
|
LocalSameFormatProviderSpec,
|
|
};
|
|
pub use crate::formats::shared::request::{
|
|
endpoint_config_forces_upstream_stream_policy, enforce_request_body_stream_field,
|
|
force_upstream_streaming_for_provider, parse_direct_request_body,
|
|
resolve_upstream_is_stream_from_endpoint_config,
|
|
};
|
|
pub use crate::formats::shared::request_matrix::{
|
|
build_standard_request_body_from_canonical,
|
|
build_standard_request_body_from_canonical_with_model_directives,
|
|
};
|
|
pub use crate::formats::shared::response::{
|
|
build_generated_tool_call_id, build_local_success_background_report,
|
|
build_local_success_conversion_background_report, canonicalize_tool_arguments,
|
|
prepare_local_success_response_parts, prepare_local_success_response_parts_owned,
|
|
LocalSyncReportParts,
|
|
};
|
|
pub use crate::formats::shared::routing::{
|
|
is_matching_stream_http_request, is_matching_stream_request,
|
|
request_path_implies_stream_request, resolve_execution_runtime_stream_plan_kind,
|
|
resolve_execution_runtime_sync_plan_kind, sanitize_request_path,
|
|
sanitize_request_path_and_query, sanitize_request_query_string,
|
|
supports_stream_execution_decision_kind, supports_sync_execution_decision_kind,
|
|
};
|
|
pub use crate::formats::shared::sse::{encode_done_sse, encode_json_sse, map_claude_stop_reason};
|
|
pub use crate::formats::shared::standard_matrix::normalize_standard_request_to_openai_chat_request;
|
|
pub use crate::formats::shared::stream_core::common::*;
|
|
pub use crate::formats::shared::stream_core::{
|
|
CanonicalStreamFrame, StreamingStandardFormatMatrix, StreamingStandardTerminalObserver,
|
|
};
|
|
pub use crate::formats::shared::sync_products::{
|
|
aggregate_claude_stream_sync_response, aggregate_gemini_stream_sync_response,
|
|
aggregate_openai_chat_stream_sync_response, aggregate_openai_responses_stream_sync_response,
|
|
aggregate_standard_chat_stream_sync_response, aggregate_standard_cli_stream_sync_response,
|
|
convert_standard_chat_response, convert_standard_cli_response,
|
|
maybe_build_openai_chat_cross_format_sync_product_from_normalized_payload,
|
|
maybe_build_openai_responses_cross_format_sync_product_from_normalized_payload,
|
|
maybe_build_openai_responses_same_family_sync_body_from_normalized_payload,
|
|
maybe_build_standard_cross_format_sync_product,
|
|
maybe_build_standard_cross_format_sync_product_from_normalized_payload,
|
|
maybe_build_standard_same_format_sync_body_from_normalized_payload,
|
|
maybe_build_standard_sync_finalize_product_from_normalized_payload,
|
|
StandardCrossFormatSyncProduct, StandardSyncFinalizeNormalizedProduct,
|
|
};
|
|
pub use crate::formats::shared::sync_to_stream::{
|
|
maybe_bridge_standard_sync_json_to_stream, SyncToStreamBridgeOutcome,
|
|
};
|
|
pub use crate::formats::shared::{
|
|
maybe_build_ai_surface_stream_rewriter, resolve_finalize_stream_rewrite_mode,
|
|
AiSurfaceFinalizeError, AiSurfaceStreamRewriter, FinalizeStreamRewriteMode,
|
|
};
|
|
pub use crate::formats::{
|
|
claude::messages::{
|
|
resolve_stream_spec as resolve_claude_stream_spec,
|
|
resolve_sync_spec as resolve_claude_sync_spec,
|
|
},
|
|
gemini::generate_content::{
|
|
resolve_stream_spec as resolve_gemini_stream_spec,
|
|
resolve_sync_spec as resolve_gemini_sync_spec,
|
|
},
|
|
openai::{
|
|
embedding::spec::resolve_sync_spec as resolve_openai_embedding_sync_spec,
|
|
responses::{
|
|
codex::{
|
|
apply_codex_openai_responses_chat_body_edits,
|
|
apply_codex_openai_responses_special_body_edits,
|
|
apply_codex_openai_responses_special_headers,
|
|
apply_openai_responses_compact_special_body_edits,
|
|
CODEX_OPENAI_IMAGE_DEFAULT_MODEL, CODEX_OPENAI_IMAGE_DEFAULT_OUTPUT_FORMAT,
|
|
CODEX_OPENAI_IMAGE_DEFAULT_VARIATION_MODEL,
|
|
CODEX_OPENAI_IMAGE_DEFAULT_VARIATION_PROMPT, CODEX_OPENAI_IMAGE_INTERNAL_MODEL,
|
|
},
|
|
spec::{
|
|
resolve_stream_spec as resolve_openai_responses_stream_spec,
|
|
resolve_sync_spec as resolve_openai_responses_sync_spec, LocalOpenAiResponsesSpec,
|
|
},
|
|
},
|
|
},
|
|
shared::{
|
|
family::{LocalStandardSourceFamily, LocalStandardSourceMode, LocalStandardSpec},
|
|
standard_matrix::{
|
|
build_standard_request_body, build_standard_request_body_with_model_directives,
|
|
build_standard_request_body_with_model_directives_and_request_headers,
|
|
},
|
|
standard_normalize::{
|
|
build_cross_format_openai_chat_request_body,
|
|
build_cross_format_openai_chat_request_body_with_model_directives,
|
|
build_cross_format_openai_responses_request_body,
|
|
build_cross_format_openai_responses_request_body_with_model_directives,
|
|
build_local_openai_chat_request_body,
|
|
build_local_openai_chat_request_body_with_model_directives,
|
|
build_local_openai_responses_request_body,
|
|
build_local_openai_responses_request_body_with_model_directives,
|
|
},
|
|
},
|
|
};
|
|
pub use crate::formats::{
|
|
gemini::files::spec::{
|
|
resolve_stream_spec as resolve_gemini_files_stream_spec,
|
|
resolve_sync_spec as resolve_gemini_files_sync_spec, LocalGeminiFilesSpec,
|
|
},
|
|
openai::image::{
|
|
request::{
|
|
build_chatgpt_web_image_request_body, build_openai_image_provider_request_body,
|
|
default_model_for_openai_image_operation, is_openai_image_stream_request,
|
|
normalize_openai_image_request, openai_image_operation_from_path,
|
|
resolve_requested_openai_image_model_for_request, ChatGptWebImageRequestError,
|
|
NormalizedOpenAiImageRequest, OpenAiImageOperation, OpenAiImageResponseFormat,
|
|
},
|
|
spec::{
|
|
resolve_stream_spec as resolve_local_image_stream_spec,
|
|
resolve_sync_spec as resolve_local_image_sync_spec, LocalOpenAiImageSpec,
|
|
},
|
|
},
|
|
shared::video::{
|
|
resolve_sync_spec as resolve_local_video_sync_spec, LocalVideoCreateFamily,
|
|
LocalVideoCreateSpec,
|
|
},
|
|
};
|
|
pub use crate::provider_compat::kiro_stream::{
|
|
build_kiro_final_message_sse_events, build_kiro_initial_sse_events,
|
|
build_kiro_stream_error_sse_events, calculate_kiro_context_input_tokens,
|
|
encode_kiro_sse_events, estimate_kiro_tokens, find_kiro_real_thinking_end_tag,
|
|
find_kiro_real_thinking_end_tag_at_buffer_end, find_kiro_real_thinking_start_tag, kiro_crc32,
|
|
KiroToClaudeCliStreamState, KIRO_MAX_THINKING_BUFFER,
|
|
};
|
|
pub use crate::provider_compat::private_envelope::{
|
|
maybe_build_provider_private_stream_normalizer, normalize_provider_private_report_context,
|
|
normalize_provider_private_response_value, provider_private_response_allows_sync_finalize,
|
|
stream_body_contains_error_event, transform_provider_private_stream_line,
|
|
ProviderPrivateStreamNormalizer,
|
|
};
|
|
pub use crate::provider_compat::surfaces::{
|
|
provider_adaptation_allows_sync_finalize_envelope, provider_adaptation_anchor_api_format,
|
|
provider_adaptation_descriptor_for_envelope, provider_adaptation_descriptor_for_provider_type,
|
|
provider_adaptation_requires_eventstream_accept,
|
|
provider_adaptation_should_unwrap_stream_envelope, ProviderAdaptationDescriptor,
|
|
ProviderAdaptationSurface, ANTIGRAVITY_V1INTERNAL_ENVELOPE_NAME,
|
|
GEMINI_CLI_V1INTERNAL_ENVELOPE_NAME, KIRO_ENVELOPE_NAME,
|
|
};
|
|
pub use aether_ai_formats::formats::conversion::request::{
|
|
convert_openai_chat_request_to_claude_request, convert_openai_chat_request_to_gemini_request,
|
|
convert_openai_chat_request_to_openai_responses_request, extract_openai_text_content,
|
|
normalize_claude_request_to_openai_chat_request,
|
|
normalize_gemini_request_to_openai_chat_request,
|
|
normalize_openai_responses_request_to_openai_chat_request, parse_openai_tool_result_content,
|
|
};
|
|
pub use aether_ai_formats::formats::conversion::response::{
|
|
build_openai_responses_response, build_openai_responses_response_with_content,
|
|
build_openai_responses_response_with_reasoning, convert_claude_chat_response_to_openai_chat,
|
|
convert_claude_response_to_openai_responses, convert_gemini_chat_response_to_openai_chat,
|
|
convert_gemini_response_to_openai_responses, convert_openai_chat_response_to_claude_chat,
|
|
convert_openai_chat_response_to_gemini_chat, convert_openai_chat_response_to_openai_responses,
|
|
convert_openai_responses_response_to_openai_chat, OpenAiResponsesResponseUsage,
|
|
};
|
|
pub use aether_ai_formats::{
|
|
api_format_alias_matches, api_format_storage_aliases, is_openai_responses_compact_format,
|
|
is_openai_responses_family_format, is_openai_responses_format, normalize_api_format_alias,
|
|
};
|
|
pub use aether_ai_formats::{
|
|
canonical_request_unknown_block_count, canonical_response_unknown_block_count,
|
|
canonical_to_claude_request, canonical_to_claude_response, canonical_to_gemini_request,
|
|
canonical_to_gemini_response, canonical_to_openai_chat_request,
|
|
canonical_to_openai_chat_response, canonical_to_openai_responses_compact_request,
|
|
canonical_to_openai_responses_compact_response, canonical_to_openai_responses_request,
|
|
canonical_to_openai_responses_response, canonical_unknown_block_count, convert_request,
|
|
convert_response, from_claude_to_canonical_request, from_claude_to_canonical_response,
|
|
from_gemini_to_canonical_request, from_gemini_to_canonical_response,
|
|
from_openai_chat_to_canonical_request, from_openai_chat_to_canonical_response,
|
|
from_openai_responses_to_canonical_request, from_openai_responses_to_canonical_response,
|
|
request_candidate_api_format_preference, request_candidate_api_formats,
|
|
request_conversion_kind, request_conversion_requires_enable_flag,
|
|
sync_chat_response_conversion_kind, sync_cli_response_conversion_kind, CanonicalContentBlock,
|
|
CanonicalGenerationConfig, CanonicalInstruction, CanonicalMessage, CanonicalRequest,
|
|
CanonicalResponse, CanonicalResponseFormat, CanonicalResponseOutput, CanonicalRole,
|
|
CanonicalStopReason, CanonicalThinkingConfig, CanonicalToolChoice, CanonicalToolDefinition,
|
|
CanonicalUsage, FormatContext, FormatError, FormatFamily, FormatId, FormatProfile,
|
|
RequestConversionKind, SyncChatResponseConversionKind, SyncCliResponseConversionKind,
|
|
};
|