2026-04-05 20:23:16 +08:00
|
|
|
mod auth;
|
|
|
|
|
mod converter;
|
|
|
|
|
mod credentials;
|
|
|
|
|
mod headers;
|
|
|
|
|
mod policy;
|
|
|
|
|
mod refresh;
|
|
|
|
|
mod request;
|
|
|
|
|
mod url;
|
|
|
|
|
|
2026-05-08 02:34:45 +08:00
|
|
|
use crate::provider_types::{
|
|
|
|
|
ProviderApiFormatInheritance, ProviderLocalEmbeddingSupport, ProviderRuntimePolicy,
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
pub const RUNTIME_POLICY: ProviderRuntimePolicy = ProviderRuntimePolicy {
|
|
|
|
|
fixed_provider: true,
|
|
|
|
|
api_format_inheritance: ProviderApiFormatInheritance::OAuthOrConfiguredBearer,
|
|
|
|
|
enable_format_conversion_by_default: true,
|
|
|
|
|
allow_auth_channel_mismatch_by_default: true,
|
|
|
|
|
oauth_is_bearer_like: true,
|
2026-05-08 13:24:27 +08:00
|
|
|
supports_model_fetch: true,
|
2026-05-08 02:34:45 +08:00
|
|
|
supports_local_openai_chat_transport: false,
|
|
|
|
|
supports_local_same_format_transport: false,
|
|
|
|
|
local_embedding_support: ProviderLocalEmbeddingSupport::None,
|
|
|
|
|
};
|
|
|
|
|
|
2026-04-05 20:23:16 +08:00
|
|
|
pub use auth::{
|
2026-05-02 13:23:54 +08:00
|
|
|
build_kiro_request_auth_from_config, is_kiro_claude_messages_transport,
|
|
|
|
|
is_kiro_provider_transport, resolve_local_kiro_bearer_auth, resolve_local_kiro_request_auth,
|
|
|
|
|
supports_local_kiro_auth_prerequisites, supports_local_kiro_request_auth_resolution,
|
|
|
|
|
KiroBearerAuth, KiroRequestAuth, KIRO_AUTH_HEADER, PROVIDER_TYPE,
|
2026-04-05 20:23:16 +08:00
|
|
|
};
|
|
|
|
|
pub use converter::convert_claude_messages_to_conversation_state;
|
2026-09-04 03:45:52 +08:00
|
|
|
pub use credentials::{
|
|
|
|
|
generate_machine_id, is_valid_kiro_region, normalize_kiro_region, normalize_machine_id,
|
|
|
|
|
KiroAuthConfig,
|
|
|
|
|
};
|
2026-04-27 12:20:26 +08:00
|
|
|
pub use headers::{
|
2026-05-08 13:24:27 +08:00
|
|
|
build_generate_assistant_headers, build_list_available_models_headers, build_mcp_headers,
|
|
|
|
|
AWS_EVENTSTREAM_CONTENT_TYPE, KIRO_EXTERNAL_IDP_TOKEN_TYPE, KIRO_PROFILE_ARN_HEADER,
|
|
|
|
|
KIRO_TOKEN_TYPE_HEADER,
|
2026-04-27 12:20:26 +08:00
|
|
|
};
|
2026-04-05 20:23:16 +08:00
|
|
|
pub use policy::{
|
2026-04-19 21:45:57 +08:00
|
|
|
local_kiro_request_transport_unsupported_reason_with_network,
|
2026-04-05 20:23:16 +08:00
|
|
|
supports_local_kiro_request_transport, supports_local_kiro_request_transport_with_network,
|
|
|
|
|
};
|
|
|
|
|
pub use refresh::KiroOAuthRefreshAdapter;
|
|
|
|
|
pub use request::{
|
2026-05-06 23:48:31 +08:00
|
|
|
apply_local_body_rules_with_request_headers, apply_local_header_rules_with_request_headers,
|
|
|
|
|
body_rules_are_locally_supported, build_kiro_provider_headers,
|
|
|
|
|
build_kiro_provider_request_body, header_rules_are_locally_supported,
|
|
|
|
|
supports_local_kiro_request_shape, KiroProviderHeadersInput,
|
2026-04-05 20:23:16 +08:00
|
|
|
};
|
|
|
|
|
pub use url::{
|
2026-05-08 13:24:27 +08:00
|
|
|
build_kiro_generate_assistant_response_url, build_kiro_list_available_models_url,
|
|
|
|
|
build_kiro_mcp_url, build_kiro_mcp_url_from_resolved_url, resolve_kiro_base_url,
|
|
|
|
|
GENERATE_ASSISTANT_RESPONSE_PATH, KIRO_ENVELOPE_NAME, LIST_AVAILABLE_MODELS_PATH, MCP_PATH,
|
|
|
|
|
MCP_STREAM_PATH,
|
2026-04-05 20:23:16 +08:00
|
|
|
};
|