aria-code 0.52.0__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- aria_code/__init__.py +42 -0
- aria_code/_version.py +20 -0
- aria_code/adk_apps/__init__.py +1 -0
- aria_code/adk_apps/aria_code_review/__init__.py +1 -0
- aria_code/adk_apps/aria_code_review/agent.py +32 -0
- aria_code/adk_apps/aria_research/__init__.py +1 -0
- aria_code/adk_apps/aria_research/agent.py +31 -0
- aria_code/agents/__init__.py +34 -0
- aria_code/agents/base.py +318 -0
- aria_code/agents/code_review.py +200 -0
- aria_code/agents/deep/__init__.py +37 -0
- aria_code/agents/deep/calibration_loop.py +144 -0
- aria_code/agents/deep/critic.py +125 -0
- aria_code/agents/deep/deepen.py +193 -0
- aria_code/agents/deep/models.py +149 -0
- aria_code/agents/deep/pipeline.py +164 -0
- aria_code/agents/deep/quant_fusion.py +192 -0
- aria_code/agents/deep/themes.py +95 -0
- aria_code/agents/deep/tiers.py +106 -0
- aria_code/agents/engineering/__init__.py +14 -0
- aria_code/agents/engineering/coder.py +222 -0
- aria_code/agents/engineering/tester.py +145 -0
- aria_code/agents/financial/__init__.py +21 -0
- aria_code/agents/financial/cashflow_burn.py +119 -0
- aria_code/agents/financial/catalyst.py +279 -0
- aria_code/agents/financial/corporate_finance.py +175 -0
- aria_code/agents/financial/debate.py +224 -0
- aria_code/agents/financial/earnings.py +303 -0
- aria_code/agents/financial/fundamental.py +191 -0
- aria_code/agents/financial/macro.py +99 -0
- aria_code/agents/financial/news.py +207 -0
- aria_code/agents/financial/risk.py +165 -0
- aria_code/agents/financial/sector.py +279 -0
- aria_code/agents/financial/strategist.py +121 -0
- aria_code/agents/financial/stripe_revenue.py +127 -0
- aria_code/agents/financial/synthesis.py +274 -0
- aria_code/agents/financial/technical.py +258 -0
- aria_code/agents/orchestrator.py +44 -0
- aria_code/agents/portfolio_agent.py +363 -0
- aria_code/agents/realty/__init__.py +62 -0
- aria_code/agents/realty/asset_diagnosis.py +152 -0
- aria_code/agents/realty/business_match.py +166 -0
- aria_code/agents/realty/cashflow_verify.py +209 -0
- aria_code/agents/realty/contract_rules.py +210 -0
- aria_code/agents/realty/energy_anomaly.py +189 -0
- aria_code/agents/realty/exit_settlement.py +208 -0
- aria_code/agents/realty/fulfillment_risk.py +206 -0
- aria_code/agents/realty/ops_optimize.py +160 -0
- aria_code/agents/realty/revenue_share.py +215 -0
- aria_code/agents/registry.py +158 -0
- aria_code/agents/signal_scheme.py +111 -0
- aria_code/agents/sports/__init__.py +0 -0
- aria_code/agents/sports/football_agent.py +197 -0
- aria_code/agents/supervisor.py +113 -0
- aria_code/agents/team.py +492 -0
- aria_code/agents/warehouse/__init__.py +25 -0
- aria_code/agents/warehouse/contracts.py +26 -0
- aria_code/agents/warehouse/dashboard.py +155 -0
- aria_code/agents/warehouse/fulfillment_leadtime.py +95 -0
- aria_code/agents/warehouse/inbound_exceptions.py +25 -0
- aria_code/agents/warehouse/inventory_health.py +24 -0
- aria_code/agents/warehouse/local_run.py +71 -0
- aria_code/agents/warehouse/local_snapshot.py +132 -0
- aria_code/agents/warehouse/logistics_cost.py +84 -0
- aria_code/agents/warehouse/logistics_sync.py +21 -0
- aria_code/agents/warehouse/workflow.py +31 -0
- aria_code/aliyun_data_client.py +4 -0
- aria_code/apps/README.md +12 -0
- aria_code/apps/__init__.py +2 -0
- aria_code/apps/channels/README.md +15 -0
- aria_code/apps/channels/__init__.py +17 -0
- aria_code/apps/channels/intake.py +92 -0
- aria_code/apps/channels/registry.py +95 -0
- aria_code/apps/channels/tradingview.py +94 -0
- aria_code/apps/cli/README.md +13 -0
- aria_code/apps/cli/__init__.py +2 -0
- aria_code/apps/cli/_optional.py +120 -0
- aria_code/apps/cli/bootstrap.py +145 -0
- aria_code/apps/cli/broker_render.py +206 -0
- aria_code/apps/cli/codegen_paths.py +29 -0
- aria_code/apps/cli/commands/__init__.py +16 -0
- aria_code/apps/cli/commands/_business_render.py +78 -0
- aria_code/apps/cli/commands/_ui.py +71 -0
- aria_code/apps/cli/commands/analysis_cmds.py +369 -0
- aria_code/apps/cli/commands/ashare_prediction_cmds.py +327 -0
- aria_code/apps/cli/commands/auth_cmds.py +239 -0
- aria_code/apps/cli/commands/backtest_cmds.py +2543 -0
- aria_code/apps/cli/commands/broker_cmds.py +1234 -0
- aria_code/apps/cli/commands/business_workflow_cmds.py +319 -0
- aria_code/apps/cli/commands/canvas_cmds.py +77 -0
- aria_code/apps/cli/commands/catalog.py +87 -0
- aria_code/apps/cli/commands/core_cmds.py +2520 -0
- aria_code/apps/cli/commands/data_cmds.py +457 -0
- aria_code/apps/cli/commands/diagnostic_cmds.py +230 -0
- aria_code/apps/cli/commands/diagnostic_ops_cmds.py +813 -0
- aria_code/apps/cli/commands/file_cmds.py +312 -0
- aria_code/apps/cli/commands/finance_service_cmds.py +60 -0
- aria_code/apps/cli/commands/fx_commodity_cmds.py +123 -0
- aria_code/apps/cli/commands/market.py +434 -0
- aria_code/apps/cli/commands/market_cmds.py +1381 -0
- aria_code/apps/cli/commands/market_context.py +425 -0
- aria_code/apps/cli/commands/market_render.py +7 -0
- aria_code/apps/cli/commands/model_cmds.py +2153 -0
- aria_code/apps/cli/commands/ops_cmds.py +721 -0
- aria_code/apps/cli/commands/orchestrator_cmds.py +179 -0
- aria_code/apps/cli/commands/pdf_export_cmds.py +125 -0
- aria_code/apps/cli/commands/portfolio_cmds.py +1278 -0
- aria_code/apps/cli/commands/report.py +437 -0
- aria_code/apps/cli/commands/scaffold_templates.py +617 -0
- aria_code/apps/cli/commands/session_cmds.py +236 -0
- aria_code/apps/cli/commands/session_ux_cmds.py +359 -0
- aria_code/apps/cli/commands/team.py +669 -0
- aria_code/apps/cli/commands/team_render.py +8 -0
- aria_code/apps/cli/commands/ui_cmds.py +401 -0
- aria_code/apps/cli/commands/warehouse_cmds.py +79 -0
- aria_code/apps/cli/commands/workflow_cmds.py +480 -0
- aria_code/apps/cli/commands/workspace_cmds.py +1494 -0
- aria_code/apps/cli/config_paths.py +73 -0
- aria_code/apps/cli/config_store.py +78 -0
- aria_code/apps/cli/constants.py +88 -0
- aria_code/apps/cli/context.py +34 -0
- aria_code/apps/cli/deterministic.py +191 -0
- aria_code/apps/cli/direct.py +48 -0
- aria_code/apps/cli/finance_service_catalog.py +111 -0
- aria_code/apps/cli/football_reports.py +231 -0
- aria_code/apps/cli/github_app_auth.py +135 -0
- aria_code/apps/cli/google_login.py +196 -0
- aria_code/apps/cli/handlers/__init__.py +11 -0
- aria_code/apps/cli/handlers/broker_handlers.py +122 -0
- aria_code/apps/cli/handlers/chart_handlers.py +1309 -0
- aria_code/apps/cli/handlers/market_handlers.py +2513 -0
- aria_code/apps/cli/handlers/realty_handlers.py +114 -0
- aria_code/apps/cli/handlers/sports_handlers.py +22 -0
- aria_code/apps/cli/handlers/strategy_advice.py +82 -0
- aria_code/apps/cli/helpers.py +302 -0
- aria_code/apps/cli/hooks.py +180 -0
- aria_code/apps/cli/i18n.py +297 -0
- aria_code/apps/cli/intent.py +136 -0
- aria_code/apps/cli/intent_router.py +276 -0
- aria_code/apps/cli/intent_signals.py +344 -0
- aria_code/apps/cli/lifecycle_hooks.py +48 -0
- aria_code/apps/cli/local_tool_schemas.py +536 -0
- aria_code/apps/cli/main.py +29 -0
- aria_code/apps/cli/market_metadata.py +135 -0
- aria_code/apps/cli/market_universe.py +487 -0
- aria_code/apps/cli/message_processing.py +310 -0
- aria_code/apps/cli/model_catalog.py +620 -0
- aria_code/apps/cli/pdf_report.py +977 -0
- aria_code/apps/cli/plan_mode.py +139 -0
- aria_code/apps/cli/plotly_html.py +15 -0
- aria_code/apps/cli/prediction_feedback.py +202 -0
- aria_code/apps/cli/preflight.py +502 -0
- aria_code/apps/cli/project_aria.py +60 -0
- aria_code/apps/cli/prompt_assembly.py +59 -0
- aria_code/apps/cli/prompts/__init__.py +0 -0
- aria_code/apps/cli/prompts/coding.py +53 -0
- aria_code/apps/cli/prompts/select.py +142 -0
- aria_code/apps/cli/prompts/system_prompts.py +552 -0
- aria_code/apps/cli/prompts/ui.py +436 -0
- aria_code/apps/cli/provider_endpoints.py +237 -0
- aria_code/apps/cli/provider_keys.py +73 -0
- aria_code/apps/cli/providers/__init__.py +1 -0
- aria_code/apps/cli/providers/base.py +521 -0
- aria_code/apps/cli/providers/chat_routing.py +128 -0
- aria_code/apps/cli/providers/collaboration.py +98 -0
- aria_code/apps/cli/providers/llm/__init__.py +1 -0
- aria_code/apps/cli/providers/llm/offline_responses.py +68 -0
- aria_code/apps/cli/providers/llm/ollama_stream.py +1594 -0
- aria_code/apps/cli/providers/llm/response_cache.py +60 -0
- aria_code/apps/cli/providers/llm/sse_stream.py +257 -0
- aria_code/apps/cli/providers/runtime_bridge.py +353 -0
- aria_code/apps/cli/providers/vertexai_stream.py +316 -0
- aria_code/apps/cli/runtime_consumer.py +657 -0
- aria_code/apps/cli/sandbox.py +32 -0
- aria_code/apps/cli/session_export.py +120 -0
- aria_code/apps/cli/session_jsonl.py +208 -0
- aria_code/apps/cli/session_store.py +112 -0
- aria_code/apps/cli/skills_catalog.py +273 -0
- aria_code/apps/cli/todo_tracker.py +190 -0
- aria_code/apps/cli/tool_executor.py +823 -0
- aria_code/apps/cli/tool_registry.py +34 -0
- aria_code/apps/cli/tool_scope.py +106 -0
- aria_code/apps/cli/tools/__init__.py +40 -0
- aria_code/apps/cli/tools/context.py +46 -0
- aria_code/apps/cli/tools/file_tools.py +180 -0
- aria_code/apps/cli/tools/market_tools.py +620 -0
- aria_code/apps/cli/tools/notebook_tools.py +111 -0
- aria_code/apps/cli/tools/system_tools.py +726 -0
- aria_code/apps/cli/tools/write_tools.py +845 -0
- aria_code/apps/cli/tradingview_bridge.py +529 -0
- aria_code/apps/cli/turn_planning.py +137 -0
- aria_code/apps/cli/update_check.py +153 -0
- aria_code/apps/cli/utils/__init__.py +0 -0
- aria_code/apps/cli/utils/market_detect.py +1597 -0
- aria_code/apps/daemon/README.md +14 -0
- aria_code/apps/vscode/README.md +115 -0
- aria_code/apps/vscode/package.json +70 -0
- aria_code/aria_cli.py +6743 -0
- aria_code/aria_daemon.py +1398 -0
- aria_code/aria_feishu_bot.py +1423 -0
- aria_code/aria_mcp_server.py +7 -0
- aria_code/aria_relay_client.py +4 -0
- aria_code/aria_relay_server.py +490 -0
- aria_code/aria_telegram_bot.py +202 -0
- aria_code/ariarc.py +385 -0
- aria_code/artifacts.py +581 -0
- aria_code/backtest_engine.py +4 -0
- aria_code/backtest_report.py +4 -0
- aria_code/brokers/__init__.py +78 -0
- aria_code/brokers/automation.py +193 -0
- aria_code/brokers/base.py +231 -0
- aria_code/brokers/capabilities.py +264 -0
- aria_code/brokers/cn/__init__.py +10 -0
- aria_code/brokers/cn/easytrader_broker.py +193 -0
- aria_code/brokers/cn/futu_broker.py +194 -0
- aria_code/brokers/cn/longbridge_broker.py +190 -0
- aria_code/brokers/cn/tiger_broker.py +196 -0
- aria_code/brokers/cn/xtquant_broker.py +225 -0
- aria_code/brokers/config.py +414 -0
- aria_code/brokers/intl/__init__.py +5 -0
- aria_code/brokers/intl/alpaca_broker.py +183 -0
- aria_code/brokers/intl/ibkr_broker.py +215 -0
- aria_code/brokers/intl/trading212_broker.py +183 -0
- aria_code/brokers/intl/webull_broker.py +156 -0
- aria_code/brokers/paper_broker.py +266 -0
- aria_code/brokers/planning.py +296 -0
- aria_code/brokers/registry.py +213 -0
- aria_code/brokers/trading.py +267 -0
- aria_code/canva_client.py +4 -0
- aria_code/change_store.py +127 -0
- aria_code/clients/__init__.py +0 -0
- aria_code/clients/aliyun_data_client.py +660 -0
- aria_code/clients/aria_relay_client.py +182 -0
- aria_code/clients/canva_client.py +284 -0
- aria_code/clients/figma_client.py +100 -0
- aria_code/clients/football_data_client.py +1671 -0
- aria_code/clients/kling_video_client.py +182 -0
- aria_code/clients/market_data_client.py +1976 -0
- aria_code/clients/openai_image_client.py +242 -0
- aria_code/clients/runway_video_client.py +157 -0
- aria_code/clients/warehouse_erp_client.py +105 -0
- aria_code/cloud_memory.py +181 -0
- aria_code/command_safety.py +19 -0
- aria_code/computer_use_tools.py +4 -0
- aria_code/dashboard_generator.py +579 -0
- aria_code/data_analysis_tools.py +4 -0
- aria_code/data_cleaner.py +483 -0
- aria_code/data_service.py +513 -0
- aria_code/datasources/__init__.py +23 -0
- aria_code/datasources/base.py +166 -0
- aria_code/datasources/router.py +253 -0
- aria_code/datasources/sources/__init__.py +15 -0
- aria_code/datasources/sources/akshare_source.py +269 -0
- aria_code/datasources/sources/alpha_vantage_source.py +203 -0
- aria_code/datasources/sources/edgar_source.py +219 -0
- aria_code/datasources/sources/finnhub_source.py +198 -0
- aria_code/datasources/sources/fred_source.py +223 -0
- aria_code/datasources/sources/tushare_source.py +143 -0
- aria_code/datasources/sources/web_scraper_source.py +278 -0
- aria_code/datasources/sources/world_bank_source.py +206 -0
- aria_code/datasources/sources/yfinance_source.py +152 -0
- aria_code/demo_player.py +207 -0
- aria_code/doctor.py +813 -0
- aria_code/domain/__init__.py +0 -0
- aria_code/domain/backtest_engine.py +354 -0
- aria_code/domain/backtest_report.py +472 -0
- aria_code/domain/finance_formulas.py +389 -0
- aria_code/domain/portfolio_ledger.py +307 -0
- aria_code/domain/strategy_vault.py +421 -0
- aria_code/evals/__init__.py +37 -0
- aria_code/evals/harness.py +598 -0
- aria_code/evals/runner.py +238 -0
- aria_code/external_agent_runner.py +115 -0
- aria_code/figma_client.py +4 -0
- aria_code/file_analysis_tools.py +4 -0
- aria_code/finance_formulas.py +4 -0
- aria_code/football_data_client.py +4 -0
- aria_code/image_gen_tools.py +4 -0
- aria_code/intent_classifier.py +386 -0
- aria_code/kling_video_client.py +4 -0
- aria_code/licensing.py +151 -0
- aria_code/local_finance_tools.py +4 -0
- aria_code/local_image_provider.py +4 -0
- aria_code/local_llm_provider.py +4 -0
- aria_code/macro_tools.py +4 -0
- aria_code/markdown_pdf.py +289 -0
- aria_code/market_data_client.py +4 -0
- aria_code/mcp_client.py +639 -0
- aria_code/memory_manager.py +246 -0
- aria_code/model_capability.py +486 -0
- aria_code/notification_tools.py +4 -0
- aria_code/openai_image_client.py +4 -0
- aria_code/packages/__init__.py +23 -0
- aria_code/packages/adk_bridge/__init__.py +11 -0
- aria_code/packages/adk_bridge/code_review_tools.py +49 -0
- aria_code/packages/adk_bridge/market_tools.py +125 -0
- aria_code/packages/aria_agents/__init__.py +5 -0
- aria_code/packages/aria_agents/manifest.py +78 -0
- aria_code/packages/aria_core/__init__.py +34 -0
- aria_code/packages/aria_core/architecture.py +269 -0
- aria_code/packages/aria_core/export.py +147 -0
- aria_code/packages/aria_core/manifest.py +65 -0
- aria_code/packages/aria_core/paths.py +57 -0
- aria_code/packages/aria_core/secure_file.py +68 -0
- aria_code/packages/aria_infra/__init__.py +15 -0
- aria_code/packages/aria_infra/arthera.py +52 -0
- aria_code/packages/aria_infra/doctor.py +246 -0
- aria_code/packages/aria_infra/product.py +40 -0
- aria_code/packages/aria_mcp/__init__.py +25 -0
- aria_code/packages/aria_mcp/bridge.py +201 -0
- aria_code/packages/aria_mcp/circuit.py +82 -0
- aria_code/packages/aria_mcp/config.py +111 -0
- aria_code/packages/aria_mcp/installer.py +95 -0
- aria_code/packages/aria_mcp/server.py +1550 -0
- aria_code/packages/aria_mcp/tools.py +81 -0
- aria_code/packages/aria_sdk/__init__.py +19 -0
- aria_code/packages/aria_sdk/client.py +396 -0
- aria_code/packages/aria_sdk/providers.py +70 -0
- aria_code/packages/aria_sdk/streaming.py +79 -0
- aria_code/packages/aria_sdk/types.py +86 -0
- aria_code/packages/aria_services/__init__.py +92 -0
- aria_code/packages/aria_services/cache.py +60 -0
- aria_code/packages/aria_services/context.py +356 -0
- aria_code/packages/aria_services/context_checkpoints.py +157 -0
- aria_code/packages/aria_services/data.py +11 -0
- aria_code/packages/aria_services/provider_health.py +268 -0
- aria_code/packages/aria_services/references.py +247 -0
- aria_code/packages/aria_services/registry.py +249 -0
- aria_code/packages/aria_services/research_protocol.py +57 -0
- aria_code/packages/aria_services/research_quality.py +186 -0
- aria_code/packages/aria_services/settings.py +157 -0
- aria_code/packages/aria_services/usage.py +151 -0
- aria_code/packages/aria_skills/__init__.py +46 -0
- aria_code/packages/aria_skills/catalog.py +149 -0
- aria_code/packages/aria_skills/loader.py +455 -0
- aria_code/packages/aria_skills/registry.py +84 -0
- aria_code/packages/aria_tools/__init__.py +5 -0
- aria_code/packages/aria_tools/financial/__init__.py +8 -0
- aria_code/packages/aria_tools/financial/_paths.py +130 -0
- aria_code/packages/aria_tools/financial/compliance.py +31 -0
- aria_code/packages/aria_tools/financial/factors.py +33 -0
- aria_code/packages/aria_tools/financial/risk_tools.py +33 -0
- aria_code/packages/aria_tools/financial/strategy.py +31 -0
- aria_code/packages/aria_tools/registry.py +128 -0
- aria_code/packages/quant_engine/__init__.py +34 -0
- aria_code/packages/quant_engine/_namespace.py +62 -0
- aria_code/packages/quant_engine/backtest/__init__.py +14 -0
- aria_code/packages/quant_engine/backtest/core.py +53 -0
- aria_code/packages/quant_engine/backtest/engine.py +96 -0
- aria_code/packages/quant_engine/portfolio/__init__.py +13 -0
- aria_code/packages/quant_engine/portfolio/optimizer.py +85 -0
- aria_code/packages/quant_engine/sports/__init__.py +80 -0
- aria_code/packages/quant_engine/sports/calibrator.py +354 -0
- aria_code/packages/quant_engine/sports/dixon_coles.py +234 -0
- aria_code/packages/quant_engine/sports/elo.py +300 -0
- aria_code/packages/quant_engine/sports/form.py +188 -0
- aria_code/packages/quant_engine/sports/h2h.py +195 -0
- aria_code/packages/quant_engine/sports/ml_model.py +377 -0
- aria_code/packages/quant_engine/sports/predictor.py +312 -0
- aria_code/packages/quant_engine/sports/tracker.py +665 -0
- aria_code/packages/quant_engine/stochastic/__init__.py +35 -0
- aria_code/packages/quant_engine/stochastic/gbm_enhanced.py +195 -0
- aria_code/packages/quant_engine/stochastic/ito_calculus.py +477 -0
- aria_code/packages/quant_engine/stochastic/kelly_criterion.py +181 -0
- aria_code/packages/quant_engine/stochastic/monte_carlo_advanced.py +95 -0
- aria_code/packages/quant_engine/stochastic/options_pricing.py +576 -0
- aria_code/packages/quant_engine/stochastic/stochastic_processes.py +90 -0
- aria_code/packs/__init__.py +85 -0
- aria_code/packs/base.py +168 -0
- aria_code/packs/finance/__init__.py +250 -0
- aria_code/packs/logistics/__init__.py +169 -0
- aria_code/packs/payments/__init__.py +139 -0
- aria_code/packs/realty/__init__.py +190 -0
- aria_code/packs/registry.py +202 -0
- aria_code/packs/rules.py +90 -0
- aria_code/plan_utils.py +194 -0
- aria_code/plugin_loader.py +328 -0
- aria_code/portfolio_ledger.py +4 -0
- aria_code/preview_server.py +449 -0
- aria_code/privacy/__init__.py +5 -0
- aria_code/privacy/feedback.py +123 -0
- aria_code/project_review.py +278 -0
- aria_code/project_review_api.py +235 -0
- aria_code/project_review_server.py +18 -0
- aria_code/project_tools.py +4 -0
- aria_code/providers/__init__.py +30 -0
- aria_code/providers/llm/__init__.py +19 -0
- aria_code/providers/llm/anthropic.py +184 -0
- aria_code/providers/llm/autoconfig.py +213 -0
- aria_code/providers/llm/base.py +139 -0
- aria_code/providers/llm/custom.py +158 -0
- aria_code/providers/llm/ollama.py +129 -0
- aria_code/providers/llm/openai_compat.py +313 -0
- aria_code/providers/llm/registry.py +444 -0
- aria_code/providers/local_image_provider.py +202 -0
- aria_code/providers/local_llm_provider.py +589 -0
- aria_code/realty_data_tools.py +4 -0
- aria_code/report_exporters.py +150 -0
- aria_code/report_generator.py +1764 -0
- aria_code/runtime/__init__.py +169 -0
- aria_code/runtime/acceptance.py +481 -0
- aria_code/runtime/agent_loop.py +1520 -0
- aria_code/runtime/approval.py +57 -0
- aria_code/runtime/budget.py +232 -0
- aria_code/runtime/checkpoints.py +432 -0
- aria_code/runtime/crash_report.py +174 -0
- aria_code/runtime/events.py +113 -0
- aria_code/runtime/gateway.py +150 -0
- aria_code/runtime/lsp.py +484 -0
- aria_code/runtime/orchestrator.py +55 -0
- aria_code/runtime/repo_map.py +700 -0
- aria_code/runtime/run_state.py +127 -0
- aria_code/runtime/run_store.py +450 -0
- aria_code/runtime/self_healing.py +422 -0
- aria_code/runtime/subagent.py +547 -0
- aria_code/runtime/task_ledger.py +86 -0
- aria_code/runtime/task_orchestrator.py +90 -0
- aria_code/runtime/tool_executor.py +217 -0
- aria_code/runtime/tool_policy.py +107 -0
- aria_code/runtime/worktrees.py +215 -0
- aria_code/runway_video_client.py +4 -0
- aria_code/safety/__init__.py +23 -0
- aria_code/safety/permissions.py +306 -0
- aria_code/safety/service.py +102 -0
- aria_code/setup_wizard.py +673 -0
- aria_code/spreadsheet_tools.py +4 -0
- aria_code/strategy_vault.py +4 -0
- aria_code/tools/__init__.py +0 -0
- aria_code/tools/artifact_tools.py +252 -0
- aria_code/tools/broker_tools.py +92 -0
- aria_code/tools/build_quant_engine.py +97 -0
- aria_code/tools/code_audit_tools.py +192 -0
- aria_code/tools/computer_use_tools.py +504 -0
- aria_code/tools/data_analysis_tools.py +809 -0
- aria_code/tools/enterprise_finance_tools.py +156 -0
- aria_code/tools/extended_tools.py +240 -0
- aria_code/tools/file_analysis_tools.py +885 -0
- aria_code/tools/image_gen_tools.py +114 -0
- aria_code/tools/local_finance_tools.py +3417 -0
- aria_code/tools/logistics_tools.py +135 -0
- aria_code/tools/macro_tools.py +369 -0
- aria_code/tools/notification_tools.py +249 -0
- aria_code/tools/project_tools.py +525 -0
- aria_code/tools/realty_data_tools.py +659 -0
- aria_code/tools/spreadsheet_tools.py +388 -0
- aria_code/tools/stripe_tools.py +115 -0
- aria_code/ui/__init__.py +105 -0
- aria_code/ui/banner.py +508 -0
- aria_code/ui/completer.py +501 -0
- aria_code/ui/console.py +281 -0
- aria_code/ui/image_render.py +243 -0
- aria_code/ui/input_box.py +488 -0
- aria_code/ui/picker.py +201 -0
- aria_code/ui/render/__init__.py +11 -0
- aria_code/ui/render/finance.py +1705 -0
- aria_code/ui/render/market.py +225 -0
- aria_code/ui/render/output.py +775 -0
- aria_code/ui/render/responsive.py +75 -0
- aria_code/ui/render/team.py +354 -0
- aria_code/ui/robot.py +235 -0
- aria_code/ui/startup_dashboard.py +109 -0
- aria_code/utils/vscode_uri.py +37 -0
- aria_code/video_analysis.py +147 -0
- aria_code/video_editor.py +271 -0
- aria_code/workspace/__init__.py +6 -0
- aria_code/workspace/files.py +193 -0
- aria_code/workspace/verify.py +113 -0
- aria_code/workspace_changes.py +199 -0
- aria_code/workspace_context.py +233 -0
- aria_code/workspace_service.py +196 -0
- aria_code/workspace_tools.py +150 -0
- aria_code-0.52.0.dist-info/METADATA +237 -0
- aria_code-0.52.0.dist-info/RECORD +478 -0
- aria_code-0.52.0.dist-info/WHEEL +5 -0
- aria_code-0.52.0.dist-info/entry_points.txt +3 -0
- aria_code-0.52.0.dist-info/licenses/LICENSE +201 -0
- aria_code-0.52.0.dist-info/licenses/NOTICE +49 -0
- aria_code-0.52.0.dist-info/top_level.txt +1 -0
|
@@ -0,0 +1,620 @@
|
|
|
1
|
+
"""模型目录 —— 从 aria_cli.py 抽出的纯数据。
|
|
2
|
+
|
|
3
|
+
MODELS / MODEL_ALIASES / _MODEL_FALLBACK_PREFIXES 三个字面量原本在
|
|
4
|
+
aria_cli.py 的 1158-1551 行,合计约 390 行,占该文件的 4.5%,且完全没有
|
|
5
|
+
行为——已用 AST 核实过:零外部名字引用、零 lambda、零函数调用。
|
|
6
|
+
|
|
7
|
+
与 football_reports / broker_render 不同,这里**不需要**
|
|
8
|
+
_rebind_module_function_globals:那套机制解决的是函数 __globals__ 的绑定
|
|
9
|
+
问题,而这里是数据。aria_cli 用普通 `from ... import` 就会把名字放进自己的
|
|
10
|
+
命名空间,diagnostic_cmds / model_cmds 等 mixin 的裸名引用照常解析。
|
|
11
|
+
"""
|
|
12
|
+
|
|
13
|
+
from __future__ import annotations
|
|
14
|
+
|
|
15
|
+
MODELS = {
|
|
16
|
+
# ════════════════════════════════════════════════════════════════════
|
|
17
|
+
# ── Google Gemini 平台核心默认模型(Google Cloud)───────────────────────
|
|
18
|
+
# ════════════════════════════════════════════════════════════════════
|
|
19
|
+
"gemini-pro": {
|
|
20
|
+
"id": "google/gemini-2.5-pro",
|
|
21
|
+
"name": "Gemini Pro",
|
|
22
|
+
"version": "2.5",
|
|
23
|
+
"tag": "Platform",
|
|
24
|
+
"speed": "★★★★★",
|
|
25
|
+
"intelligence": "★★★★★",
|
|
26
|
+
"description": "平台内置:Google Cloud 旗舰多模态、百万级上下文、量化核心",
|
|
27
|
+
"capabilities": ["multimodal", "1M context", "tool calls", "quant", "code"],
|
|
28
|
+
"thinking": True, "tools": True,
|
|
29
|
+
"max_tokens": 8192, "num_ctx": 1048576, "temperature": 0.2,
|
|
30
|
+
"badge": "Default",
|
|
31
|
+
},
|
|
32
|
+
"gemini-flash": {
|
|
33
|
+
"id": "google/gemini-2.5-flash",
|
|
34
|
+
"name": "Gemini Flash",
|
|
35
|
+
"version": "2.5",
|
|
36
|
+
"tag": "Platform",
|
|
37
|
+
"speed": "★★★★★",
|
|
38
|
+
"intelligence": "★★★★",
|
|
39
|
+
"description": "极速默认:超低延迟、毫秒级响应、代码与实时行情",
|
|
40
|
+
"capabilities": ["fast inference", "1M context", "tool calls", "low latency"],
|
|
41
|
+
"thinking": False, "tools": True,
|
|
42
|
+
"max_tokens": 8192, "num_ctx": 1048576, "temperature": 0.2,
|
|
43
|
+
"badge": "Fast",
|
|
44
|
+
},
|
|
45
|
+
# ════════════════════════════════════════════════════════════════════
|
|
46
|
+
# ── Qwen 家族(阿里巴巴)────────────────────────────────────────────
|
|
47
|
+
# ════════════════════════════════════════════════════════════════════
|
|
48
|
+
"qwen7b": {
|
|
49
|
+
"id": "qwen2.5:7b",
|
|
50
|
+
"name": "Qwen 2.5",
|
|
51
|
+
"version": "7B",
|
|
52
|
+
"tag": "Default",
|
|
53
|
+
"speed": "★★★★",
|
|
54
|
+
"intelligence": "★★★★★",
|
|
55
|
+
"description": "主力推荐:中英双语最强 7B,工具调用稳定,金融/代码俱佳",
|
|
56
|
+
"capabilities": ["chat", "tool calls", "financial analysis", "coding", "Chinese"],
|
|
57
|
+
"thinking": False, "tools": True,
|
|
58
|
+
"max_tokens": 4096, "num_ctx": 32768, "temperature": 0.3,
|
|
59
|
+
"badge": "Default",
|
|
60
|
+
},
|
|
61
|
+
"qwen-coder": {
|
|
62
|
+
"id": "qwen2.5-coder:7b",
|
|
63
|
+
"name": "Qwen Coder",
|
|
64
|
+
"version": "7B",
|
|
65
|
+
"tag": "Code",
|
|
66
|
+
"speed": "★★★★",
|
|
67
|
+
"intelligence": "★★★★★",
|
|
68
|
+
"description": "代码专精:量化策略生成、回测脚本、Python 金融工具",
|
|
69
|
+
"capabilities": ["strategy code", "backtest", "Python", "quant development"],
|
|
70
|
+
"thinking": False, "tools": True,
|
|
71
|
+
"max_tokens": 4096, "num_ctx": 32768, "temperature": 0.2,
|
|
72
|
+
"badge": "Code",
|
|
73
|
+
},
|
|
74
|
+
"qwen14b": {
|
|
75
|
+
"id": "qwen2.5:14b",
|
|
76
|
+
"name": "Qwen 2.5",
|
|
77
|
+
"version": "14B",
|
|
78
|
+
"tag": "Pro",
|
|
79
|
+
"speed": "★★★",
|
|
80
|
+
"intelligence": "★★★★★",
|
|
81
|
+
"description": "高质量推理:需 ~10GB VRAM,复杂分析/长文档首选",
|
|
82
|
+
"capabilities": ["complex analysis", "long context", "Chinese"],
|
|
83
|
+
"thinking": False, "tools": True,
|
|
84
|
+
"max_tokens": 8192, "num_ctx": 32768, "temperature": 0.3,
|
|
85
|
+
"badge": "Pro",
|
|
86
|
+
},
|
|
87
|
+
"qwen32b": {
|
|
88
|
+
"id": "qwen2.5:32b",
|
|
89
|
+
"name": "Qwen 2.5",
|
|
90
|
+
"version": "32B",
|
|
91
|
+
"tag": "Max",
|
|
92
|
+
"speed": "★★",
|
|
93
|
+
"intelligence": "★★★★★",
|
|
94
|
+
"description": "旗舰本地:需 ~20GB VRAM,媲美 GPT-4o 水平",
|
|
95
|
+
"capabilities": ["flagship reasoning", "long context", "deep analysis"],
|
|
96
|
+
"thinking": False, "tools": True,
|
|
97
|
+
"max_tokens": 8192, "num_ctx": 32768, "temperature": 0.3,
|
|
98
|
+
"badge": "Max",
|
|
99
|
+
},
|
|
100
|
+
"qwen3-8b": {
|
|
101
|
+
"id": "qwen3:8b",
|
|
102
|
+
"name": "Qwen 3",
|
|
103
|
+
"version": "8B",
|
|
104
|
+
"tag": "Latest",
|
|
105
|
+
"speed": "★★★★",
|
|
106
|
+
"intelligence": "★★★★★",
|
|
107
|
+
"description": "Qwen3 最新一代:混合推理模式,/think 开启深度思考",
|
|
108
|
+
"capabilities": ["hybrid reasoning", "thinking mode", "chat", "code"],
|
|
109
|
+
"thinking": True, "tools": True,
|
|
110
|
+
"max_tokens": 8192, "num_ctx": 32768, "temperature": 0.6,
|
|
111
|
+
"badge": "Latest",
|
|
112
|
+
},
|
|
113
|
+
"qwen3-30b": {
|
|
114
|
+
"id": "qwen3:30b-a3b",
|
|
115
|
+
"name": "Qwen 3 MoE",
|
|
116
|
+
"version": "30B-A3B",
|
|
117
|
+
"tag": "MoE",
|
|
118
|
+
"speed": "★★★★",
|
|
119
|
+
"intelligence": "★★★★★",
|
|
120
|
+
"description": "混合专家 MoE:30B参数激活3B,速度与质量双赢",
|
|
121
|
+
"capabilities": ["MoE", "fast reasoning", "tool calls"],
|
|
122
|
+
"thinking": True, "tools": True,
|
|
123
|
+
"max_tokens": 8192, "num_ctx": 32768, "temperature": 0.6,
|
|
124
|
+
"badge": "MoE",
|
|
125
|
+
},
|
|
126
|
+
"qwen-fast": {
|
|
127
|
+
"id": "qwen2.5-coder:1.5b",
|
|
128
|
+
"name": "Qwen Fast",
|
|
129
|
+
"version": "1.5B",
|
|
130
|
+
"tag": "Fast",
|
|
131
|
+
"speed": "★★★★★",
|
|
132
|
+
"intelligence": "★★★",
|
|
133
|
+
"description": "超快响应:简单问答、实时报价、快速指令,~1GB RAM",
|
|
134
|
+
"capabilities": ["fast chat", "simple queries", "ultra-low latency"],
|
|
135
|
+
"thinking": False, "tools": False,
|
|
136
|
+
"max_tokens": 2048, "num_ctx": 8192, "temperature": 0.3,
|
|
137
|
+
"badge": "Fast",
|
|
138
|
+
},
|
|
139
|
+
# ════════════════════════════════════════════════════════════════════
|
|
140
|
+
# ── DeepSeek 家族──────────────────────────────────────────────────
|
|
141
|
+
# ════════════════════════════════════════════════════════════════════
|
|
142
|
+
"deepseek-r1": {
|
|
143
|
+
"id": "deepseek-r1:7b",
|
|
144
|
+
"name": "DeepSeek R1",
|
|
145
|
+
"version": "7B",
|
|
146
|
+
"tag": "Think",
|
|
147
|
+
"speed": "★★★",
|
|
148
|
+
"intelligence": "★★★★★",
|
|
149
|
+
"description": "深度推理:复杂投资决策、多步骤分析、Chain-of-Thought",
|
|
150
|
+
"capabilities": ["deep reasoning", "chain-of-thought", "complex quant"],
|
|
151
|
+
"thinking": True, "tools": False,
|
|
152
|
+
"max_tokens": 4096, "num_ctx": 32768, "temperature": 0.3,
|
|
153
|
+
"badge": "Think",
|
|
154
|
+
},
|
|
155
|
+
"deepseek-r1-1.5b": {
|
|
156
|
+
"id": "deepseek-r1:1.5b",
|
|
157
|
+
"name": "DeepSeek R1",
|
|
158
|
+
"version": "1.5B",
|
|
159
|
+
"tag": "Tiny",
|
|
160
|
+
"speed": "★★★★★",
|
|
161
|
+
"intelligence": "★★★",
|
|
162
|
+
"description": "最小推理模型:~1GB,边缘设备/低内存机器首选",
|
|
163
|
+
"capabilities": ["lightweight reasoning", "simple CoT"],
|
|
164
|
+
"thinking": True, "tools": False,
|
|
165
|
+
"max_tokens": 2048, "num_ctx": 8192, "temperature": 0.3,
|
|
166
|
+
"badge": "Fast",
|
|
167
|
+
},
|
|
168
|
+
"deepseek-r1-14b": {
|
|
169
|
+
"id": "deepseek-r1:14b",
|
|
170
|
+
"name": "DeepSeek R1",
|
|
171
|
+
"version": "14B",
|
|
172
|
+
"tag": "Pro",
|
|
173
|
+
"speed": "★★★",
|
|
174
|
+
"intelligence": "★★★★★",
|
|
175
|
+
"description": "强化推理 14B:数学/代码/金融逻辑最强本地选择",
|
|
176
|
+
"capabilities": ["strong reasoning", "math", "code analysis"],
|
|
177
|
+
"thinking": True, "tools": False,
|
|
178
|
+
"max_tokens": 8192, "num_ctx": 32768, "temperature": 0.3,
|
|
179
|
+
"badge": "Think",
|
|
180
|
+
},
|
|
181
|
+
# ════════════════════════════════════════════════════════════════════
|
|
182
|
+
# ── Meta Llama 家族 ───────────────────────────────────────────────
|
|
183
|
+
# ════════════════════════════════════════════════════════════════════
|
|
184
|
+
"llama3.2-3b": {
|
|
185
|
+
"id": "llama3.2:3b",
|
|
186
|
+
"name": "Llama 3.2",
|
|
187
|
+
"version": "3B",
|
|
188
|
+
"tag": "Light",
|
|
189
|
+
"speed": "★★★★★",
|
|
190
|
+
"intelligence": "★★★",
|
|
191
|
+
"description": "Meta 轻量级:~2GB,快速对话,英文性能出色",
|
|
192
|
+
"capabilities": ["fast chat", "English", "summarization"],
|
|
193
|
+
"thinking": False, "tools": True,
|
|
194
|
+
"max_tokens": 4096, "num_ctx": 8192, "temperature": 0.3,
|
|
195
|
+
"badge": "Fast",
|
|
196
|
+
},
|
|
197
|
+
"llama3.1-8b": {
|
|
198
|
+
"id": "llama3.1:8b",
|
|
199
|
+
"name": "Llama 3.1",
|
|
200
|
+
"version": "8B",
|
|
201
|
+
"tag": "Standard",
|
|
202
|
+
"speed": "★★★★",
|
|
203
|
+
"intelligence": "★★★★",
|
|
204
|
+
"description": "Meta 主力 8B:英文任务顶级,工具调用完整支持",
|
|
205
|
+
"capabilities": ["chat", "tool calls", "English", "reasoning"],
|
|
206
|
+
"thinking": False, "tools": True,
|
|
207
|
+
"max_tokens": 4096, "num_ctx": 131072, "temperature": 0.3,
|
|
208
|
+
"badge": "Default",
|
|
209
|
+
},
|
|
210
|
+
"llama3.3-70b": {
|
|
211
|
+
"id": "llama3.3:70b",
|
|
212
|
+
"name": "Llama 3.3",
|
|
213
|
+
"version": "70B",
|
|
214
|
+
"tag": "Large",
|
|
215
|
+
"speed": "★★",
|
|
216
|
+
"intelligence": "★★★★★",
|
|
217
|
+
"description": "Meta 最强开源:70B 需 ~40GB VRAM,媲美 GPT-4o",
|
|
218
|
+
"capabilities": ["flagship English", "complex reasoning", "long context"],
|
|
219
|
+
"thinking": False, "tools": True,
|
|
220
|
+
"max_tokens": 8192, "num_ctx": 131072, "temperature": 0.3,
|
|
221
|
+
"badge": "Pro",
|
|
222
|
+
},
|
|
223
|
+
# ════════════════════════════════════════════════════════════════════
|
|
224
|
+
# ── Mistral / Mixtral 家族 ────────────────────────────────────────
|
|
225
|
+
# ════════════════════════════════════════════════════════════════════
|
|
226
|
+
"mistral-7b": {
|
|
227
|
+
"id": "mistral:7b",
|
|
228
|
+
"name": "Mistral",
|
|
229
|
+
"version": "7B",
|
|
230
|
+
"tag": "EU",
|
|
231
|
+
"speed": "★★★★",
|
|
232
|
+
"intelligence": "★★★★",
|
|
233
|
+
"description": "欧洲顶级开源:结构化输出强,JSON 工具调用稳定",
|
|
234
|
+
"capabilities": ["structured output", "tool calls", "JSON", "English"],
|
|
235
|
+
"thinking": False, "tools": True,
|
|
236
|
+
"max_tokens": 4096, "num_ctx": 32768, "temperature": 0.3,
|
|
237
|
+
"badge": "Default",
|
|
238
|
+
},
|
|
239
|
+
"mistral-nemo": {
|
|
240
|
+
"id": "mistral-nemo:12b",
|
|
241
|
+
"name": "Mistral Nemo",
|
|
242
|
+
"version": "12B",
|
|
243
|
+
"tag": "Balanced",
|
|
244
|
+
"speed": "★★★★",
|
|
245
|
+
"intelligence": "★★★★★",
|
|
246
|
+
"description": "Mistral × Nvidia:128K上下文,多语言支持佳",
|
|
247
|
+
"capabilities": ["long context", "multilingual", "tool calls"],
|
|
248
|
+
"thinking": False, "tools": True,
|
|
249
|
+
"max_tokens": 8192, "num_ctx": 131072, "temperature": 0.3,
|
|
250
|
+
"badge": "Pro",
|
|
251
|
+
},
|
|
252
|
+
# ════════════════════════════════════════════════════════════════════
|
|
253
|
+
# ── Microsoft Phi 家族 ────────────────────────────────────────────
|
|
254
|
+
# ════════════════════════════════════════════════════════════════════
|
|
255
|
+
"phi4": {
|
|
256
|
+
"id": "phi4:14b",
|
|
257
|
+
"name": "Phi-4",
|
|
258
|
+
"version": "14B",
|
|
259
|
+
"tag": "STEM",
|
|
260
|
+
"speed": "★★★",
|
|
261
|
+
"intelligence": "★★★★★",
|
|
262
|
+
"description": "微软 STEM 旗舰:数学/代码/科学推理超越同级,14B 需 ~8GB",
|
|
263
|
+
"capabilities": ["math", "STEM", "code", "science reasoning"],
|
|
264
|
+
"thinking": False, "tools": True,
|
|
265
|
+
"max_tokens": 8192, "num_ctx": 16384, "temperature": 0.3,
|
|
266
|
+
"badge": "STEM",
|
|
267
|
+
},
|
|
268
|
+
"phi4-mini": {
|
|
269
|
+
"id": "phi4-mini:3.8b",
|
|
270
|
+
"name": "Phi-4 Mini",
|
|
271
|
+
"version": "3.8B",
|
|
272
|
+
"tag": "Compact",
|
|
273
|
+
"speed": "★★★★★",
|
|
274
|
+
"intelligence": "★★★★",
|
|
275
|
+
"description": "微软精简版:3.8B 打败多数 7B,数学/代码能力突出",
|
|
276
|
+
"capabilities": ["math", "code", "compact", "fast"],
|
|
277
|
+
"thinking": False, "tools": True,
|
|
278
|
+
"max_tokens": 4096, "num_ctx": 16384, "temperature": 0.3,
|
|
279
|
+
"badge": "Fast",
|
|
280
|
+
},
|
|
281
|
+
# ════════════════════════════════════════════════════════════════════
|
|
282
|
+
# ── Google Gemma 3 家族 ───────────────────────────────────────────
|
|
283
|
+
# ════════════════════════════════════════════════════════════════════
|
|
284
|
+
"gemma3-4b": {
|
|
285
|
+
"id": "gemma3:4b",
|
|
286
|
+
"name": "Gemma 3",
|
|
287
|
+
"version": "4B",
|
|
288
|
+
"tag": "Google",
|
|
289
|
+
"speed": "★★★★★",
|
|
290
|
+
"intelligence": "★★★★",
|
|
291
|
+
"description": "Google 轻量:4B 支持图像理解,多模态能力出色",
|
|
292
|
+
"capabilities": ["multimodal", "vision", "fast chat", "Google"],
|
|
293
|
+
"vision": True, "thinking": False, "tools": True,
|
|
294
|
+
"max_tokens": 4096, "num_ctx": 8192, "temperature": 0.3,
|
|
295
|
+
"badge": "Fast",
|
|
296
|
+
},
|
|
297
|
+
"gemma3-12b": {
|
|
298
|
+
"id": "gemma3:12b",
|
|
299
|
+
"name": "Gemma 3",
|
|
300
|
+
"version": "12B",
|
|
301
|
+
"tag": "Vision",
|
|
302
|
+
"speed": "★★★★",
|
|
303
|
+
"intelligence": "★★★★★",
|
|
304
|
+
"description": "Google 中型:12B 视觉+文本综合能力强,~8GB VRAM",
|
|
305
|
+
"capabilities": ["multimodal", "vision", "reasoning", "multilingual"],
|
|
306
|
+
"vision": True, "thinking": False, "tools": True,
|
|
307
|
+
"max_tokens": 8192, "num_ctx": 16384, "temperature": 0.3,
|
|
308
|
+
"badge": "Vision",
|
|
309
|
+
},
|
|
310
|
+
# ════════════════════════════════════════════════════════════════════
|
|
311
|
+
# ── Cloud 路由(需订阅或 API Key)────────────────────────────────
|
|
312
|
+
# ════════════════════════════════════════════════════════════════════
|
|
313
|
+
"gpt-oss-120b": {
|
|
314
|
+
"id": "gpt-oss:120b-cloud",
|
|
315
|
+
"name": "GPT-OSS",
|
|
316
|
+
"version": "120B",
|
|
317
|
+
"tag": "Cloud·120B",
|
|
318
|
+
"speed": "★★★",
|
|
319
|
+
"intelligence": "★★★★★",
|
|
320
|
+
"description": "云端 120B 中继:机构级分析,复杂金融报告",
|
|
321
|
+
"capabilities": ["institutional analysis", "long-form reports", "complex reasoning"],
|
|
322
|
+
"thinking": True, "tools": True,
|
|
323
|
+
"max_tokens": 8192, "num_ctx": 131072, "temperature": 0.3,
|
|
324
|
+
"badge": "Cloud",
|
|
325
|
+
},
|
|
326
|
+
"deepseek-v3-cloud": {
|
|
327
|
+
"id": "deepseek-v3.1:671b-cloud",
|
|
328
|
+
"name": "DeepSeek V3",
|
|
329
|
+
"version": "671B",
|
|
330
|
+
"tag": "Cloud·671B",
|
|
331
|
+
"speed": "★★★",
|
|
332
|
+
"intelligence": "★★★★★",
|
|
333
|
+
"description": "云端 671B 旗舰:最强推理,研报级分析,需订阅",
|
|
334
|
+
"capabilities": ["flagship reasoning", "research report", "quant strategy"],
|
|
335
|
+
"thinking": True, "tools": True,
|
|
336
|
+
"max_tokens": 8192, "num_ctx": 163840, "temperature": 0.3,
|
|
337
|
+
"badge": "Cloud",
|
|
338
|
+
},
|
|
339
|
+
}
|
|
340
|
+
|
|
341
|
+
# Model aliases: short names / Ollama IDs → MODELS key
|
|
342
|
+
MODEL_ALIASES = {
|
|
343
|
+
# ── Google Gemini ─────────────────────────────────────────────────
|
|
344
|
+
"gemini": "gemini-pro", "gemini-pro": "gemini-pro", "gemini2.5": "gemini-pro", "gpro": "gemini-pro",
|
|
345
|
+
"gemini-flash": "gemini-flash", "gflash": "gemini-flash", "flash": "gemini-flash",
|
|
346
|
+
# ── Qwen 2.5 ──────────────────────────────────────────────────────
|
|
347
|
+
"qwen7b": "qwen7b", "q7": "qwen7b", "sonata": "qwen7b", "s": "qwen7b",
|
|
348
|
+
"qwen14b": "qwen14b", "q14": "qwen14b",
|
|
349
|
+
"qwen32b": "qwen32b", "q32": "qwen32b",
|
|
350
|
+
"qwen-coder": "qwen-coder", "coder": "qwen-coder", "c": "qwen-coder",
|
|
351
|
+
"qwen-fast": "qwen-fast", "fast": "qwen-fast", "prelude": "qwen-fast", "p": "qwen-fast",
|
|
352
|
+
# ── Qwen 3 ────────────────────────────────────────────────────────
|
|
353
|
+
"qwen3": "qwen3-8b", "q3": "qwen3-8b", "qwen3-8b": "qwen3-8b",
|
|
354
|
+
"qwen3-30b": "qwen3-30b", "q3-moe": "qwen3-30b", "moe": "qwen3-30b",
|
|
355
|
+
# ── DeepSeek ──────────────────────────────────────────────────────
|
|
356
|
+
"deepseek-r1": "deepseek-r1", "r1": "deepseek-r1", "r1-7b": "deepseek-r1",
|
|
357
|
+
"r1-1.5b": "deepseek-r1-1.5b", "r1-tiny": "deepseek-r1-1.5b",
|
|
358
|
+
"r1-14b": "deepseek-r1-14b", "r1-pro": "deepseek-r1-14b",
|
|
359
|
+
# ── Llama ─────────────────────────────────────────────────────────
|
|
360
|
+
"llama3.2": "llama3.2-3b", "llama3": "llama3.2-3b", "l3": "llama3.2-3b",
|
|
361
|
+
"llama3.1": "llama3.1-8b", "llama3.1-8b": "llama3.1-8b", "l31": "llama3.1-8b",
|
|
362
|
+
"llama3.3": "llama3.3-70b", "llama70b": "llama3.3-70b", "l33": "llama3.3-70b",
|
|
363
|
+
# ── Mistral ───────────────────────────────────────────────────────
|
|
364
|
+
"mistral": "mistral-7b", "m7": "mistral-7b",
|
|
365
|
+
"nemo": "mistral-nemo", "mistral12b": "mistral-nemo",
|
|
366
|
+
# ── Phi (Microsoft) ───────────────────────────────────────────────
|
|
367
|
+
"phi4": "phi4", "phi": "phi4",
|
|
368
|
+
"phi4-mini": "phi4-mini", "phi-mini": "phi4-mini",
|
|
369
|
+
# ── Gemma (Google) ────────────────────────────────────────────────
|
|
370
|
+
"gemma": "gemma3-4b", "gemma3": "gemma3-4b", "g4": "gemma3-4b",
|
|
371
|
+
"gemma12b": "gemma3-12b", "gemma3-12b": "gemma3-12b",
|
|
372
|
+
# ── Cloud relay ───────────────────────────────────────────────────
|
|
373
|
+
"gpt-oss": "gpt-oss-120b", "120b": "gpt-oss-120b",
|
|
374
|
+
"deepseek-v3": "deepseek-v3-cloud", "v3": "deepseek-v3-cloud", "671b": "deepseek-v3-cloud",
|
|
375
|
+
# ── 旧名向后兼容 ──────────────────────────────────────────────────
|
|
376
|
+
"sonata-thinking": "deepseek-r1", "st": "deepseek-r1",
|
|
377
|
+
"sonata-verbose": "qwen7b", "sv": "qwen7b",
|
|
378
|
+
# ── Ollama model ID → registry key ────────────────────────────────
|
|
379
|
+
"qwen2.5:7b": "qwen7b",
|
|
380
|
+
"qwen2.5:14b": "qwen14b",
|
|
381
|
+
"qwen2.5:32b": "qwen32b",
|
|
382
|
+
"qwen2.5:3b": "qwen-fast",
|
|
383
|
+
"qwen2.5-coder:7b": "qwen-coder",
|
|
384
|
+
"qwen2.5-coder:14b": "qwen-coder",
|
|
385
|
+
"qwen2.5-coder:1.5b": "qwen-fast",
|
|
386
|
+
"qwen3:8b": "qwen3-8b",
|
|
387
|
+
"qwen3:30b-a3b": "qwen3-30b",
|
|
388
|
+
"deepseek-r1:7b": "deepseek-r1",
|
|
389
|
+
"deepseek-r1:1.5b": "deepseek-r1-1.5b",
|
|
390
|
+
"deepseek-r1:14b": "deepseek-r1-14b",
|
|
391
|
+
"llama3.2:3b": "llama3.2-3b",
|
|
392
|
+
"llama3.1:8b": "llama3.1-8b",
|
|
393
|
+
"llama3.3:70b": "llama3.3-70b",
|
|
394
|
+
"mistral:7b": "mistral-7b",
|
|
395
|
+
"mistral-nemo:12b": "mistral-nemo",
|
|
396
|
+
"phi4:14b": "phi4",
|
|
397
|
+
"phi4-mini:3.8b": "phi4-mini",
|
|
398
|
+
"gemma3:4b": "gemma3-4b",
|
|
399
|
+
"gemma3:12b": "gemma3-12b",
|
|
400
|
+
"gpt-oss:120b-cloud": "gpt-oss-120b",
|
|
401
|
+
"deepseek-v3.1:671b-cloud": "deepseek-v3-cloud",
|
|
402
|
+
# ── 旧 aria 模型 ID ───────────────────────────────────────────────
|
|
403
|
+
"aria-sonata:4.5": "qwen7b",
|
|
404
|
+
"aria-sonata:4.5-thinking": "deepseek-r1",
|
|
405
|
+
"aria-sonata:4.5-verbose": "qwen7b",
|
|
406
|
+
"aria-sonata:4.6": "qwen7b",
|
|
407
|
+
"aria-sonata:4.6-thinking": "deepseek-r1",
|
|
408
|
+
"aria-prelude:4.3": "qwen-fast",
|
|
409
|
+
"aria-prelude:1.5b": "qwen-fast",
|
|
410
|
+
}
|
|
411
|
+
|
|
412
|
+
# ── 模型降级优先级(单一事实源:预检 / 运行时 fallback 共用)────────────────
|
|
413
|
+
# 按能力/稳定性排序:先选大容量本地模型,再退化到轻量模型
|
|
414
|
+
_MODEL_FALLBACK_PREFIXES = [
|
|
415
|
+
# 首选:7B+ 本地全能模型
|
|
416
|
+
"qwen3:8b", # Qwen3 最新,混合推理
|
|
417
|
+
"qwen3:30b-a3b", # Qwen3 MoE,快速
|
|
418
|
+
"qwen2.5:14b", # Qwen2.5 高质量
|
|
419
|
+
"qwen2.5:7b", # Qwen2.5 主力
|
|
420
|
+
"qwen2.5-coder:7b", # 代码专精
|
|
421
|
+
# 次选:其他家族本地模型
|
|
422
|
+
"llama3.3:70b", # Meta 旗舰(需大 VRAM)
|
|
423
|
+
"llama3.1:8b", # Meta 8B 稳定
|
|
424
|
+
"mistral-nemo:12b", # Mistral 12B
|
|
425
|
+
"mistral:7b", # Mistral 7B
|
|
426
|
+
"phi4:14b", # Microsoft Phi-4
|
|
427
|
+
"phi4-mini:3.8b", # Microsoft Phi-4 Mini
|
|
428
|
+
"gemma3:12b", # Google Gemma 12B
|
|
429
|
+
"gemma3:4b", # Google Gemma 4B
|
|
430
|
+
"deepseek-r1:14b", # DeepSeek R1 推理
|
|
431
|
+
"deepseek-r1:7b", # DeepSeek R1 7B
|
|
432
|
+
# 轻量回落
|
|
433
|
+
"qwen2.5-coder:3b", # 小模型
|
|
434
|
+
"qwen2.5:3b", # 小模型
|
|
435
|
+
"llama3.2:3b", # Meta 轻量
|
|
436
|
+
"deepseek-r1:1.5b", # 极小推理
|
|
437
|
+
# Cloud relay(需订阅)
|
|
438
|
+
"gpt-oss",
|
|
439
|
+
"deepseek-v3.1",
|
|
440
|
+
]
|
|
441
|
+
|
|
442
|
+
|
|
443
|
+
# ── Lookups ───────────────────────────────────────────────────────────────────
|
|
444
|
+
# These two read MODELS / MODEL_ALIASES and nothing else from aria_cli, so they
|
|
445
|
+
# belong beside the data rather than in the CLI module. Four mixins were
|
|
446
|
+
# importing them from aria_cli purely because that is where they were written.
|
|
447
|
+
#
|
|
448
|
+
# model_capability is optional, guarded the same way aria_cli guards it. The
|
|
449
|
+
# bare import form is deliberate: it is the form every other caller in the tree
|
|
450
|
+
# uses, and the package is reachable under two roots whose module objects are
|
|
451
|
+
# distinct.
|
|
452
|
+
try:
|
|
453
|
+
from model_capability import get_model_capability
|
|
454
|
+
|
|
455
|
+
_HAS_MODEL_CAP = True
|
|
456
|
+
except ImportError: # pragma: no cover - exercised only without model_capability
|
|
457
|
+
get_model_capability = None # type: ignore[assignment]
|
|
458
|
+
_HAS_MODEL_CAP = False
|
|
459
|
+
|
|
460
|
+
|
|
461
|
+
_MODEL_ID_INDEX: dict[str, str] | None = None
|
|
462
|
+
|
|
463
|
+
|
|
464
|
+
def _model_id_index() -> dict[str, str]:
|
|
465
|
+
"""Lazily build a lowercase {model id -> MODELS key} index.
|
|
466
|
+
|
|
467
|
+
The config stores the provider-qualified *id* ("google/gemini-2.5-pro")
|
|
468
|
+
while MODELS is keyed by short name ("gemini-pro"), so without this lookup
|
|
469
|
+
a registered model resolves to "_community_" and its own registry entry is
|
|
470
|
+
never used.
|
|
471
|
+
|
|
472
|
+
Measured, rather than assumed: when model_capability knows the model it
|
|
473
|
+
guesses the same tools/context, so the visible damage is limited. The real
|
|
474
|
+
exposure is a model model_capability does not know, or an install without
|
|
475
|
+
it at all (_HAS_MODEL_CAP False), where get_model_cfg falls back to
|
|
476
|
+
sonata's settings for an unrelated model.
|
|
477
|
+
"""
|
|
478
|
+
global _MODEL_ID_INDEX
|
|
479
|
+
if _MODEL_ID_INDEX is None:
|
|
480
|
+
index: dict[str, str] = {}
|
|
481
|
+
for key, cfg in MODELS.items():
|
|
482
|
+
model_id = str(cfg.get("id") or "").strip().lower()
|
|
483
|
+
if model_id and model_id not in index:
|
|
484
|
+
index[model_id] = key
|
|
485
|
+
_MODEL_ID_INDEX = index
|
|
486
|
+
return _MODEL_ID_INDEX
|
|
487
|
+
|
|
488
|
+
|
|
489
|
+
def resolve_model_key(model_str: str) -> str:
|
|
490
|
+
"""Resolve any model alias/ID/key to a MODELS key.
|
|
491
|
+
|
|
492
|
+
Lookup order: exact key -> alias -> registered model id (case-insensitive).
|
|
493
|
+
|
|
494
|
+
For community Ollama models (qwen2.5-coder, llama3.2, deepseek-r1, etc.)
|
|
495
|
+
that are NOT in the MODELS registry, returns the sentinel "_community_"
|
|
496
|
+
so callers know to use model_capability.get_model_capability() instead
|
|
497
|
+
of falling back to hardcoded "prelude" settings.
|
|
498
|
+
"""
|
|
499
|
+
if model_str in MODELS:
|
|
500
|
+
return model_str
|
|
501
|
+
if model_str in MODEL_ALIASES:
|
|
502
|
+
return MODEL_ALIASES[model_str]
|
|
503
|
+
normalized = str(model_str or "").strip().lower()
|
|
504
|
+
if normalized in MODELS:
|
|
505
|
+
return normalized
|
|
506
|
+
if normalized in MODEL_ALIASES:
|
|
507
|
+
return MODEL_ALIASES[normalized]
|
|
508
|
+
mapped = _model_id_index().get(normalized)
|
|
509
|
+
if mapped:
|
|
510
|
+
return mapped
|
|
511
|
+
# Community/custom Ollama model — not in registry
|
|
512
|
+
return "_community_"
|
|
513
|
+
|
|
514
|
+
|
|
515
|
+
def get_model_cfg(model_str: str) -> dict:
|
|
516
|
+
"""Return the best available config dict for *model_str*.
|
|
517
|
+
|
|
518
|
+
For registered models (MODELS table): returns the table entry.
|
|
519
|
+
For community Ollama models: synthesizes a config from model_capability.
|
|
520
|
+
Never silently falls back to 'prelude' settings for an unrelated model.
|
|
521
|
+
"""
|
|
522
|
+
key = resolve_model_key(model_str)
|
|
523
|
+
if key in MODELS:
|
|
524
|
+
return MODELS[key]
|
|
525
|
+
# Community model — build config from model_capability registry
|
|
526
|
+
if _HAS_MODEL_CAP:
|
|
527
|
+
cap = get_model_capability(model_str)
|
|
528
|
+
return {
|
|
529
|
+
"id": model_str,
|
|
530
|
+
"name": model_str,
|
|
531
|
+
"num_ctx": cap.context_window,
|
|
532
|
+
"temperature": cap.temperature,
|
|
533
|
+
"max_tokens": min(cap.context_window // 4, 8192),
|
|
534
|
+
"thinking": cap.thinking,
|
|
535
|
+
"tools": cap.tool_calls,
|
|
536
|
+
}
|
|
537
|
+
# Last resort fallback — use qwen7b (sonata) settings as a safe default
|
|
538
|
+
return MODELS.get("sonata", MODELS.get("qwen7b", next(iter(MODELS.values()))))
|
|
539
|
+
|
|
540
|
+
|
|
541
|
+
# ── Choosing a local model when the configured one is not installed ──────────
|
|
542
|
+
# This used to live in aria_cli as _pick_best_installed_model, and it ended with
|
|
543
|
+
# `return sorted(installed)[0]`. Two things went wrong with that.
|
|
544
|
+
#
|
|
545
|
+
# First, the caller in print_header() asks "is config['model'] in the set Ollama
|
|
546
|
+
# reports?" — and a cloud id is NEVER in that set, because Ollama only lists
|
|
547
|
+
# local models. So for anyone running google/gemini-2.5-pro (the shipped
|
|
548
|
+
# default) with Ollama installed, the answer was always no, the "heal" branch
|
|
549
|
+
# always fired, and print_header() then persisted the result with save_config().
|
|
550
|
+
# A deliberate `/model google/gemini-2.5-pro` was overwritten on every startup.
|
|
551
|
+
#
|
|
552
|
+
# Second, the alphabetical last resort answered with whatever sorted first.
|
|
553
|
+
# Measured before the fix, with google/gemini-2.5-pro configured:
|
|
554
|
+
#
|
|
555
|
+
# installed {qwen2.5:7b, llama3.2:3b} -> qwen2.5:7b
|
|
556
|
+
# installed {aardvark-tiny:1b, zzz-exp:0.5b} -> aardvark-tiny:1b
|
|
557
|
+
# installed {llama3.2:1b}, claude-sonnet-4 cfg -> llama3.2:1b
|
|
558
|
+
#
|
|
559
|
+
# A 0.5B model that sorts early becoming the agent's brain is not a fallback,
|
|
560
|
+
# it is a silent downgrade to something that cannot hold a tool call together.
|
|
561
|
+
#
|
|
562
|
+
# So: cloud choices are never healed from a local list, and a model only
|
|
563
|
+
# qualifies if the capability registry says it can handle coding. When nothing
|
|
564
|
+
# qualifies, this returns None and the caller leaves the configuration alone.
|
|
565
|
+
|
|
566
|
+
def is_provider_qualified(model: str) -> bool:
|
|
567
|
+
"""True for ids that name their own provider ("google/gemini-2.5-pro").
|
|
568
|
+
|
|
569
|
+
Ollama serves namespaced community models such as "hf.co/user/model", whose
|
|
570
|
+
first segment is a host rather than a backend — those are local, so the
|
|
571
|
+
check is against the known provider prefixes, not merely against "/".
|
|
572
|
+
"""
|
|
573
|
+
name = (model or "").strip().lower()
|
|
574
|
+
if "/" not in name:
|
|
575
|
+
return False
|
|
576
|
+
head = name.split("/", 1)[0]
|
|
577
|
+
return head in _KNOWN_PROVIDER_PREFIXES
|
|
578
|
+
|
|
579
|
+
|
|
580
|
+
_KNOWN_PROVIDER_PREFIXES = frozenset({
|
|
581
|
+
"openai", "anthropic", "google", "xai", "deepseek", "groq", "together",
|
|
582
|
+
"dashscope", "lmstudio", "siliconflow", "moonshot", "zhipu", "mistral",
|
|
583
|
+
"cohere", "perplexity", "baidu", "ernie", "qianfan", "ollama",
|
|
584
|
+
})
|
|
585
|
+
|
|
586
|
+
|
|
587
|
+
def _is_capable_enough(model: str) -> bool:
|
|
588
|
+
"""True if the capability registry vouches for *model* on coding work."""
|
|
589
|
+
if not _HAS_MODEL_CAP:
|
|
590
|
+
# Without the registry there is no basis for vouching, so don't.
|
|
591
|
+
return False
|
|
592
|
+
from model_capability import can_handle_coding, is_unknown_model
|
|
593
|
+
|
|
594
|
+
cap = get_model_capability(model)
|
|
595
|
+
return not is_unknown_model(cap) and can_handle_coding(cap)
|
|
596
|
+
|
|
597
|
+
|
|
598
|
+
def pick_best_installed_model(installed, preferred: str = "") -> str | None:
|
|
599
|
+
"""Pick a local model to use when *preferred* is not installed.
|
|
600
|
+
|
|
601
|
+
Returns None — meaning "leave the configuration alone" — when *preferred*
|
|
602
|
+
names a cloud provider, or when no installed model is one the capability
|
|
603
|
+
registry vouches for.
|
|
604
|
+
"""
|
|
605
|
+
if not installed:
|
|
606
|
+
return None
|
|
607
|
+
if preferred and preferred in installed:
|
|
608
|
+
return preferred
|
|
609
|
+
# A cloud model's absence from the local list says nothing about the user's
|
|
610
|
+
# intent, so it is not grounds for switching them to a local model.
|
|
611
|
+
if is_provider_qualified(preferred):
|
|
612
|
+
return None
|
|
613
|
+
for prefix in _MODEL_FALLBACK_PREFIXES:
|
|
614
|
+
match = next((m for m in sorted(installed) if m.startswith(prefix)), None)
|
|
615
|
+
if match:
|
|
616
|
+
return match
|
|
617
|
+
# No curated match. Take a capable installed model if there is one, in a
|
|
618
|
+
# deterministic order; otherwise decline rather than guess.
|
|
619
|
+
capable = sorted(m for m in installed if _is_capable_enough(m))
|
|
620
|
+
return capable[0] if capable else None
|