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,65 @@
|
|
|
1
|
+
"""Shared manifest types for agents, tools, skills, and package bridges."""
|
|
2
|
+
|
|
3
|
+
from __future__ import annotations
|
|
4
|
+
|
|
5
|
+
from dataclasses import asdict, dataclass, field
|
|
6
|
+
from enum import Enum
|
|
7
|
+
from typing import Any, Dict, List, Optional
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
class PermissionLevel(str, Enum):
|
|
11
|
+
READ_ONLY = "read_only"
|
|
12
|
+
WORKSPACE_WRITE = "workspace_write"
|
|
13
|
+
NETWORK = "network"
|
|
14
|
+
BROKER_READ = "broker_read"
|
|
15
|
+
BROKER_TRADE = "broker_trade"
|
|
16
|
+
FULL_ACCESS = "full_access"
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
class ServiceKind(str, Enum):
|
|
20
|
+
AGENT = "agent"
|
|
21
|
+
TOOL = "tool"
|
|
22
|
+
SKILL = "skill"
|
|
23
|
+
MCP = "mcp"
|
|
24
|
+
SERVICE = "service"
|
|
25
|
+
DATA = "data"
|
|
26
|
+
INFRA = "infra"
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
@dataclass(frozen=True)
|
|
30
|
+
class PackageLink:
|
|
31
|
+
"""Optional link to an implementation package or external service."""
|
|
32
|
+
|
|
33
|
+
package: str
|
|
34
|
+
module: str = ""
|
|
35
|
+
object_name: str = ""
|
|
36
|
+
transport: str = "python"
|
|
37
|
+
optional: bool = True
|
|
38
|
+
notes: str = ""
|
|
39
|
+
|
|
40
|
+
def to_dict(self) -> Dict[str, Any]:
|
|
41
|
+
return asdict(self)
|
|
42
|
+
|
|
43
|
+
|
|
44
|
+
@dataclass(frozen=True)
|
|
45
|
+
class CapabilityManifest:
|
|
46
|
+
"""Stable capability description used by registries and MCP exposure."""
|
|
47
|
+
|
|
48
|
+
name: str
|
|
49
|
+
kind: ServiceKind
|
|
50
|
+
description: str
|
|
51
|
+
capabilities: List[str] = field(default_factory=list)
|
|
52
|
+
permissions: List[PermissionLevel] = field(default_factory=list)
|
|
53
|
+
required_services: List[str] = field(default_factory=list)
|
|
54
|
+
input_schema: Dict[str, Any] = field(default_factory=dict)
|
|
55
|
+
output_schema: Dict[str, Any] = field(default_factory=dict)
|
|
56
|
+
package_link: Optional[PackageLink] = None
|
|
57
|
+
tags: List[str] = field(default_factory=list)
|
|
58
|
+
|
|
59
|
+
def to_dict(self) -> Dict[str, Any]:
|
|
60
|
+
data = asdict(self)
|
|
61
|
+
data["kind"] = self.kind.value
|
|
62
|
+
data["permissions"] = [p.value for p in self.permissions]
|
|
63
|
+
if self.package_link:
|
|
64
|
+
data["package_link"] = self.package_link.to_dict()
|
|
65
|
+
return data
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
"""用户状态目录的唯一解析入口。
|
|
2
|
+
|
|
3
|
+
2026-08-19 起因:本仓库有三个并存的用户状态目录,同一个用户的数据被拆散在
|
|
4
|
+
不同地方:
|
|
5
|
+
|
|
6
|
+
~/.arthera/ 169MB —— providers.json(API keys) / brokers.json(券商凭证)
|
|
7
|
+
/ portfolio.db / sessions / memory / models …
|
|
8
|
+
~/.aria/ —— daemon.db / datasources.yaml / providers.yaml / task_ledger
|
|
9
|
+
~/.aria-code/ —— resolve_config_dir() 给新用户的默认目录
|
|
10
|
+
|
|
11
|
+
``apps/cli/config_paths.resolve_config_dir()`` 已经做了正确的事:认
|
|
12
|
+
``ARIA_HOME``,老用户(存在 ~/.arthera)沿用旧目录,新用户落到 ~/.aria-code。
|
|
13
|
+
问题是**只有配置文件走了那一层**——另外 38 个文件直接写死
|
|
14
|
+
``Path.home() / ".arthera"``,绕过了它。后果是一个全新用户的 config.json 会
|
|
15
|
+
落在 ~/.aria-code/,而他的 API key 和券商凭证会被写进 ~/.arthera/:两个目录,
|
|
16
|
+
同一个用户。这不是命名审美问题,是状态管理缺陷。
|
|
17
|
+
|
|
18
|
+
本模块把那套优先级抽成所有层都能 import 的单一实现:
|
|
19
|
+
|
|
20
|
+
ARIA_HOME 环境变量 > 已存在的 ~/.arthera(老用户,不迁移) > ~/.aria-code
|
|
21
|
+
|
|
22
|
+
放在 packages/aria_core 而不是 apps/cli,是因为调用方横跨 runtime/、brokers/、
|
|
23
|
+
packages/、datasources/、tools/ —— 让这些层反向 import apps/cli 是分层倒置。
|
|
24
|
+
本模块只依赖 stdlib,任何层都能安全引入。
|
|
25
|
+
|
|
26
|
+
⚠️ 对既有用户零影响:只要 ~/.arthera 存在,aria_home() 就返回它,行为与硬编码
|
|
27
|
+
时完全一致,不会移动任何文件。变化只对全新安装生效——所有状态统一落在一个
|
|
28
|
+
目录里。真正的数据迁移(把 ~/.arthera 搬到 ~/.aria-code)是另一件事,需要显式
|
|
29
|
+
的用户确认,不在本模块职责内。
|
|
30
|
+
"""
|
|
31
|
+
|
|
32
|
+
from __future__ import annotations
|
|
33
|
+
|
|
34
|
+
import os
|
|
35
|
+
from pathlib import Path
|
|
36
|
+
|
|
37
|
+
__all__ = ["aria_home", "LEGACY_HOME_NAME", "DEFAULT_HOME_NAME"]
|
|
38
|
+
|
|
39
|
+
LEGACY_HOME_NAME = ".arthera"
|
|
40
|
+
DEFAULT_HOME_NAME = ".aria-code"
|
|
41
|
+
|
|
42
|
+
|
|
43
|
+
def aria_home() -> Path:
|
|
44
|
+
"""返回用户状态根目录。不创建目录——由调用方按需 mkdir。
|
|
45
|
+
|
|
46
|
+
优先级与 apps/cli/config_paths.resolve_config_dir() 保持一致;那个函数现在
|
|
47
|
+
委托到这里,避免两处各自演化。
|
|
48
|
+
"""
|
|
49
|
+
override = os.environ.get("ARIA_HOME")
|
|
50
|
+
if override:
|
|
51
|
+
return Path(override).expanduser()
|
|
52
|
+
|
|
53
|
+
legacy = Path.home() / LEGACY_HOME_NAME
|
|
54
|
+
if legacy.exists():
|
|
55
|
+
return legacy
|
|
56
|
+
|
|
57
|
+
return Path.home() / DEFAULT_HOME_NAME
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
"""Write files that hold secrets with owner-only permissions.
|
|
2
|
+
|
|
3
|
+
Three files in this tree hold credentials and every one of them was written
|
|
4
|
+
with the process umask — typically 0644, i.e. readable by every other account
|
|
5
|
+
on the machine:
|
|
6
|
+
|
|
7
|
+
~/.arthera/brokers.json brokerage passwords, api_secret, access_token
|
|
8
|
+
~/.arthera/providers.json LLM provider API keys
|
|
9
|
+
<config_dir>/config.json auth_token and refresh_token from /login
|
|
10
|
+
|
|
11
|
+
The repo already knew to do better: model_cmds.py chmods a generated .env to
|
|
12
|
+
0600. The file holding the credentials that can move money was the one without
|
|
13
|
+
it.
|
|
14
|
+
|
|
15
|
+
chmod after create still leaves a window where the file exists with the default
|
|
16
|
+
mode, so this opens with O_CREAT|O_EXCL at 0600 where it can, and falls back to
|
|
17
|
+
write-then-chmod on an existing file. Permissions are a no-op on Windows, where
|
|
18
|
+
the ACL inherited from the user profile directory governs instead — that is
|
|
19
|
+
why failure to chmod is not fatal here.
|
|
20
|
+
"""
|
|
21
|
+
|
|
22
|
+
from __future__ import annotations
|
|
23
|
+
|
|
24
|
+
import json
|
|
25
|
+
import os
|
|
26
|
+
import stat
|
|
27
|
+
from pathlib import Path
|
|
28
|
+
from typing import Any
|
|
29
|
+
|
|
30
|
+
__all__ = ["write_secret_text", "write_secret_json", "harden_existing"]
|
|
31
|
+
|
|
32
|
+
_OWNER_ONLY = stat.S_IRUSR | stat.S_IWUSR # 0o600
|
|
33
|
+
|
|
34
|
+
|
|
35
|
+
def harden_existing(path: Path) -> None:
|
|
36
|
+
"""Restrict an existing file to the owner. Never raises."""
|
|
37
|
+
try:
|
|
38
|
+
os.chmod(path, _OWNER_ONLY)
|
|
39
|
+
except (OSError, NotImplementedError): # pragma: no cover - platform dependent
|
|
40
|
+
pass
|
|
41
|
+
|
|
42
|
+
|
|
43
|
+
def write_secret_text(path: Path, text: str, *, encoding: str = "utf-8") -> None:
|
|
44
|
+
"""Write *text* to *path* with 0600, creating the parent directory."""
|
|
45
|
+
path = Path(path)
|
|
46
|
+
path.parent.mkdir(parents=True, exist_ok=True)
|
|
47
|
+
|
|
48
|
+
# Create at the right mode rather than fixing it afterwards, so the content
|
|
49
|
+
# is never briefly world-readable.
|
|
50
|
+
if not path.exists():
|
|
51
|
+
try:
|
|
52
|
+
fd = os.open(path, os.O_CREAT | os.O_EXCL | os.O_WRONLY, _OWNER_ONLY)
|
|
53
|
+
except FileExistsError:
|
|
54
|
+
pass # raced with someone else; fall through to the normal path
|
|
55
|
+
else:
|
|
56
|
+
with os.fdopen(fd, "w", encoding=encoding) as handle:
|
|
57
|
+
handle.write(text)
|
|
58
|
+
return
|
|
59
|
+
|
|
60
|
+
path.write_text(text, encoding=encoding)
|
|
61
|
+
harden_existing(path)
|
|
62
|
+
|
|
63
|
+
|
|
64
|
+
def write_secret_json(path: Path, payload: Any, **dumps_kwargs: Any) -> None:
|
|
65
|
+
"""json.dump *payload* to *path* with 0600."""
|
|
66
|
+
dumps_kwargs.setdefault("indent", 2)
|
|
67
|
+
dumps_kwargs.setdefault("ensure_ascii", False)
|
|
68
|
+
write_secret_text(Path(path), json.dumps(payload, **dumps_kwargs))
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
"""Infrastructure helpers and external package discovery."""
|
|
2
|
+
|
|
3
|
+
from .arthera import ArtheraPackageMap, discover_arthera_packages
|
|
4
|
+
from .doctor import CheckResult, PackageDoctorReport, build_package_doctor_report
|
|
5
|
+
from .product import ProductIdentity, aria_code_identity
|
|
6
|
+
|
|
7
|
+
__all__ = [
|
|
8
|
+
"ArtheraPackageMap",
|
|
9
|
+
"CheckResult",
|
|
10
|
+
"PackageDoctorReport",
|
|
11
|
+
"ProductIdentity",
|
|
12
|
+
"aria_code_identity",
|
|
13
|
+
"build_package_doctor_report",
|
|
14
|
+
"discover_arthera_packages",
|
|
15
|
+
]
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
"""Optional discovery for the sibling Arthera monorepo packages."""
|
|
2
|
+
|
|
3
|
+
from __future__ import annotations
|
|
4
|
+
|
|
5
|
+
from dataclasses import dataclass, field
|
|
6
|
+
from pathlib import Path
|
|
7
|
+
from typing import Dict, List, Optional
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
@dataclass(frozen=True)
|
|
11
|
+
class ArtheraPackageMap:
|
|
12
|
+
root: Path
|
|
13
|
+
available: bool
|
|
14
|
+
packages: Dict[str, Path] = field(default_factory=dict)
|
|
15
|
+
mcp_servers: List[Path] = field(default_factory=list)
|
|
16
|
+
tool_dirs: List[Path] = field(default_factory=list)
|
|
17
|
+
|
|
18
|
+
def to_dict(self) -> dict:
|
|
19
|
+
return {
|
|
20
|
+
"root": str(self.root),
|
|
21
|
+
"available": self.available,
|
|
22
|
+
"packages": {name: str(path) for name, path in self.packages.items()},
|
|
23
|
+
"mcp_servers": [str(path) for path in self.mcp_servers],
|
|
24
|
+
"tool_dirs": [str(path) for path in self.tool_dirs],
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
def discover_arthera_packages(root: Optional[Path] = None) -> ArtheraPackageMap:
|
|
29
|
+
"""Discover useful Arthera package entrypoints without importing them."""
|
|
30
|
+
|
|
31
|
+
root = (root or Path.home() / "Desktop" / "Arthera" / "packages").expanduser()
|
|
32
|
+
if not root.exists():
|
|
33
|
+
return ArtheraPackageMap(root=root, available=False)
|
|
34
|
+
|
|
35
|
+
names = ["contracts", "data", "ml", "monitoring", "quant_engine", "reporting"]
|
|
36
|
+
packages = {name: root / name for name in names if (root / name).exists()}
|
|
37
|
+
mcp_servers = sorted(root.glob("**/mcp_server.py"))
|
|
38
|
+
tool_dirs = [
|
|
39
|
+
path for path in [
|
|
40
|
+
root / "quant_engine" / "tools",
|
|
41
|
+
root / "ml" / "llm" / "tools",
|
|
42
|
+
root / "ml" / "llm" / "skills",
|
|
43
|
+
]
|
|
44
|
+
if path.exists()
|
|
45
|
+
]
|
|
46
|
+
return ArtheraPackageMap(
|
|
47
|
+
root=root,
|
|
48
|
+
available=True,
|
|
49
|
+
packages=packages,
|
|
50
|
+
mcp_servers=mcp_servers,
|
|
51
|
+
tool_dirs=tool_dirs,
|
|
52
|
+
)
|
|
@@ -0,0 +1,246 @@
|
|
|
1
|
+
"""Health checks for Aria Code package bridges."""
|
|
2
|
+
|
|
3
|
+
from __future__ import annotations
|
|
4
|
+
|
|
5
|
+
from dataclasses import dataclass, field
|
|
6
|
+
from pathlib import Path
|
|
7
|
+
from typing import Any, Dict, Iterable, List
|
|
8
|
+
|
|
9
|
+
from aria_code.packages.aria_infra.arthera import ArtheraPackageMap
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
@dataclass(frozen=True)
|
|
13
|
+
class CheckResult:
|
|
14
|
+
name: str
|
|
15
|
+
status: str
|
|
16
|
+
detail: str = ""
|
|
17
|
+
remediation: str = ""
|
|
18
|
+
|
|
19
|
+
def to_dict(self) -> Dict[str, str]:
|
|
20
|
+
return {
|
|
21
|
+
"name": self.name,
|
|
22
|
+
"status": self.status,
|
|
23
|
+
"detail": self.detail,
|
|
24
|
+
"remediation": self.remediation,
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
@dataclass(frozen=True)
|
|
29
|
+
class PackageDoctorReport:
|
|
30
|
+
status: str
|
|
31
|
+
checks: List[CheckResult] = field(default_factory=list)
|
|
32
|
+
|
|
33
|
+
def to_dict(self) -> Dict[str, Any]:
|
|
34
|
+
return {
|
|
35
|
+
"status": self.status,
|
|
36
|
+
"checks": [check.to_dict() for check in self.checks],
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
|
|
40
|
+
def _overall_status(checks: List[CheckResult]) -> str:
|
|
41
|
+
if any(check.status == "fail" for check in checks):
|
|
42
|
+
return "fail"
|
|
43
|
+
if any(check.status == "warn" for check in checks):
|
|
44
|
+
return "warn"
|
|
45
|
+
return "ok"
|
|
46
|
+
|
|
47
|
+
|
|
48
|
+
def _status_value(value: Any) -> str:
|
|
49
|
+
if hasattr(value, "value"):
|
|
50
|
+
return str(value.value)
|
|
51
|
+
return str(value)
|
|
52
|
+
|
|
53
|
+
|
|
54
|
+
def build_package_doctor_report(
|
|
55
|
+
*,
|
|
56
|
+
arthera: ArtheraPackageMap,
|
|
57
|
+
mcp_status: Dict[str, Any],
|
|
58
|
+
tool_count: int,
|
|
59
|
+
manifest_can_export: bool,
|
|
60
|
+
manifest_path: Path,
|
|
61
|
+
services: Iterable[Any] = (),
|
|
62
|
+
required_services: Iterable[str] = (),
|
|
63
|
+
architecture_layers: Iterable[Any] = (),
|
|
64
|
+
required_architecture_layers: Iterable[str] = (),
|
|
65
|
+
provider_health: Iterable[Dict[str, Any]] = (),
|
|
66
|
+
) -> PackageDoctorReport:
|
|
67
|
+
"""Build package bridge health checks without doing I/O."""
|
|
68
|
+
|
|
69
|
+
checks: List[CheckResult] = []
|
|
70
|
+
checks.append(CheckResult(
|
|
71
|
+
"product_identity",
|
|
72
|
+
"ok",
|
|
73
|
+
"Aria Code is registered as an Arthera product.",
|
|
74
|
+
))
|
|
75
|
+
|
|
76
|
+
service_names = {
|
|
77
|
+
getattr(service, "name", "")
|
|
78
|
+
for service in services
|
|
79
|
+
if getattr(service, "name", "")
|
|
80
|
+
}
|
|
81
|
+
missing_required = sorted(set(required_services) - service_names)
|
|
82
|
+
if service_names and not missing_required:
|
|
83
|
+
checks.append(CheckResult(
|
|
84
|
+
"service_boundaries",
|
|
85
|
+
"ok",
|
|
86
|
+
f"{len(service_names)} service manifests registered.",
|
|
87
|
+
))
|
|
88
|
+
elif missing_required:
|
|
89
|
+
checks.append(CheckResult(
|
|
90
|
+
"service_boundaries",
|
|
91
|
+
"fail",
|
|
92
|
+
f"Missing required services: {', '.join(missing_required)}.",
|
|
93
|
+
"Register service specs in packages.aria_services.",
|
|
94
|
+
))
|
|
95
|
+
else:
|
|
96
|
+
checks.append(CheckResult(
|
|
97
|
+
"service_boundaries",
|
|
98
|
+
"warn",
|
|
99
|
+
"No service manifests registered yet.",
|
|
100
|
+
"Add Gateway/Data/Reports/Brokers service specs.",
|
|
101
|
+
))
|
|
102
|
+
|
|
103
|
+
architecture_rows = list(architecture_layers or [])
|
|
104
|
+
required_layer_names = set(required_architecture_layers or [])
|
|
105
|
+
if architecture_rows or required_layer_names:
|
|
106
|
+
layer_names = {
|
|
107
|
+
getattr(layer, "name", "")
|
|
108
|
+
for layer in architecture_rows
|
|
109
|
+
if getattr(layer, "name", "")
|
|
110
|
+
}
|
|
111
|
+
missing_layers = sorted(required_layer_names - layer_names)
|
|
112
|
+
if missing_layers:
|
|
113
|
+
checks.append(CheckResult(
|
|
114
|
+
"architecture_layers",
|
|
115
|
+
"fail",
|
|
116
|
+
f"Missing architecture layers: {', '.join(missing_layers)}.",
|
|
117
|
+
"Update packages.aria_core.architecture.",
|
|
118
|
+
))
|
|
119
|
+
else:
|
|
120
|
+
incomplete = [
|
|
121
|
+
getattr(layer, "name", "")
|
|
122
|
+
for layer in architecture_rows
|
|
123
|
+
if _status_value(getattr(layer, "status", "")).lower() != "done"
|
|
124
|
+
]
|
|
125
|
+
if incomplete:
|
|
126
|
+
checks.append(CheckResult(
|
|
127
|
+
"architecture_layers",
|
|
128
|
+
"warn",
|
|
129
|
+
f"{len(layer_names)} layers registered; incomplete: {', '.join(incomplete[:6])}.",
|
|
130
|
+
"Prioritize context, settings, runtime, safety, and channel extraction.",
|
|
131
|
+
))
|
|
132
|
+
else:
|
|
133
|
+
checks.append(CheckResult(
|
|
134
|
+
"architecture_layers",
|
|
135
|
+
"ok",
|
|
136
|
+
f"{len(layer_names)} architecture layers complete.",
|
|
137
|
+
))
|
|
138
|
+
|
|
139
|
+
provider_rows = list(provider_health or [])
|
|
140
|
+
if not provider_rows:
|
|
141
|
+
checks.append(CheckResult(
|
|
142
|
+
"data_provider_health",
|
|
143
|
+
"warn",
|
|
144
|
+
"No provider calls recorded in this session.",
|
|
145
|
+
"Run /quote, /ta, /analyze, or /report first.",
|
|
146
|
+
))
|
|
147
|
+
else:
|
|
148
|
+
unhealthy = [
|
|
149
|
+
row for row in provider_rows
|
|
150
|
+
if row.get("status") not in ("ok", "", None)
|
|
151
|
+
]
|
|
152
|
+
if unhealthy:
|
|
153
|
+
checks.append(CheckResult(
|
|
154
|
+
"data_provider_health",
|
|
155
|
+
"warn",
|
|
156
|
+
"; ".join(
|
|
157
|
+
f"{row.get('provider')}={row.get('status')}"
|
|
158
|
+
for row in unhealthy[:5]
|
|
159
|
+
),
|
|
160
|
+
"Wait for cooldown, retry later, or switch provider/API key.",
|
|
161
|
+
))
|
|
162
|
+
else:
|
|
163
|
+
checks.append(CheckResult(
|
|
164
|
+
"data_provider_health",
|
|
165
|
+
"ok",
|
|
166
|
+
f"{len(provider_rows)} providers healthy.",
|
|
167
|
+
))
|
|
168
|
+
|
|
169
|
+
if arthera.available:
|
|
170
|
+
checks.append(CheckResult(
|
|
171
|
+
"arthera_packages",
|
|
172
|
+
"ok",
|
|
173
|
+
f"Found {len(arthera.packages)} package groups at {arthera.root}.",
|
|
174
|
+
))
|
|
175
|
+
else:
|
|
176
|
+
checks.append(CheckResult(
|
|
177
|
+
"arthera_packages",
|
|
178
|
+
"warn",
|
|
179
|
+
f"Not found at {arthera.root}.",
|
|
180
|
+
"Place Arthera at ~/Desktop/Arthera or configure the MCP server manually.",
|
|
181
|
+
))
|
|
182
|
+
|
|
183
|
+
if mcp_status.get("configured"):
|
|
184
|
+
checks.append(CheckResult(
|
|
185
|
+
"mcp_config",
|
|
186
|
+
"ok",
|
|
187
|
+
f"Configured in {mcp_status.get('config_path')}.",
|
|
188
|
+
))
|
|
189
|
+
else:
|
|
190
|
+
checks.append(CheckResult(
|
|
191
|
+
"mcp_config",
|
|
192
|
+
"warn",
|
|
193
|
+
f"No arthera_quant_engine server in {mcp_status.get('config_path')}.",
|
|
194
|
+
"Run /packages connect arthera.",
|
|
195
|
+
))
|
|
196
|
+
|
|
197
|
+
if mcp_status.get("server_file_exists"):
|
|
198
|
+
checks.append(CheckResult(
|
|
199
|
+
"mcp_server_file",
|
|
200
|
+
"ok",
|
|
201
|
+
str(mcp_status.get("server_path") or ""),
|
|
202
|
+
))
|
|
203
|
+
else:
|
|
204
|
+
checks.append(CheckResult(
|
|
205
|
+
"mcp_server_file",
|
|
206
|
+
"warn",
|
|
207
|
+
str(mcp_status.get("server_path") or "server path unavailable"),
|
|
208
|
+
"Verify <ARTHERA_ROOT>/packages/quant_engine/mcp_server.py exists (set ARTHERA_ROOT env var).",
|
|
209
|
+
))
|
|
210
|
+
|
|
211
|
+
if mcp_status.get("running"):
|
|
212
|
+
checks.append(CheckResult(
|
|
213
|
+
"mcp_runtime",
|
|
214
|
+
"ok",
|
|
215
|
+
f"Running with {mcp_status.get('tool_count', 0)} tools.",
|
|
216
|
+
))
|
|
217
|
+
else:
|
|
218
|
+
checks.append(CheckResult(
|
|
219
|
+
"mcp_runtime",
|
|
220
|
+
"warn",
|
|
221
|
+
"Arthera MCP server is not running.",
|
|
222
|
+
"Run /mcp reload or /packages connect arthera --reload.",
|
|
223
|
+
))
|
|
224
|
+
|
|
225
|
+
if tool_count > 0:
|
|
226
|
+
checks.append(CheckResult(
|
|
227
|
+
"mcp_tool_manifests",
|
|
228
|
+
"ok",
|
|
229
|
+
f"{tool_count} Arthera MCP tools mapped to Aria manifests.",
|
|
230
|
+
))
|
|
231
|
+
else:
|
|
232
|
+
checks.append(CheckResult(
|
|
233
|
+
"mcp_tool_manifests",
|
|
234
|
+
"warn",
|
|
235
|
+
"No Arthera MCP tools mapped yet.",
|
|
236
|
+
"Start the MCP server, then run /packages tools arthera.",
|
|
237
|
+
))
|
|
238
|
+
|
|
239
|
+
checks.append(CheckResult(
|
|
240
|
+
"manifest_export",
|
|
241
|
+
"ok" if manifest_can_export else "fail",
|
|
242
|
+
str(manifest_path),
|
|
243
|
+
"" if manifest_can_export else "Check artifact directory permissions.",
|
|
244
|
+
))
|
|
245
|
+
|
|
246
|
+
return PackageDoctorReport(status=_overall_status(checks), checks=checks)
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
"""Product identity for Aria Code inside the Arthera product line."""
|
|
2
|
+
|
|
3
|
+
from __future__ import annotations
|
|
4
|
+
|
|
5
|
+
from dataclasses import asdict, dataclass
|
|
6
|
+
from typing import Dict, List
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
@dataclass(frozen=True)
|
|
10
|
+
class ProductIdentity:
|
|
11
|
+
company: str
|
|
12
|
+
product: str
|
|
13
|
+
package_name: str
|
|
14
|
+
version: str
|
|
15
|
+
description: str
|
|
16
|
+
product_family: List[str]
|
|
17
|
+
|
|
18
|
+
def to_dict(self) -> Dict[str, object]:
|
|
19
|
+
return asdict(self)
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
def aria_code_identity(version: str = "3.0.0") -> ProductIdentity:
|
|
23
|
+
return ProductIdentity(
|
|
24
|
+
company="Arthera",
|
|
25
|
+
product="Aria Code",
|
|
26
|
+
package_name="aria-code",
|
|
27
|
+
version=version,
|
|
28
|
+
description=(
|
|
29
|
+
"Local-first product review and coding agent by Arthera, "
|
|
30
|
+
"with optional quantitative research capabilities."
|
|
31
|
+
),
|
|
32
|
+
product_family=[
|
|
33
|
+
"Aria Code",
|
|
34
|
+
"Aria Gateway",
|
|
35
|
+
"Arthera Quant Engine",
|
|
36
|
+
"Arthera Broker Bridge",
|
|
37
|
+
"Arthera ML/LLM",
|
|
38
|
+
"Arthera Reporting",
|
|
39
|
+
],
|
|
40
|
+
)
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
"""MCP bridge facade."""
|
|
2
|
+
|
|
3
|
+
from .bridge import MCPExposure, default_exposures
|
|
4
|
+
from .config import (
|
|
5
|
+
arthera_quant_engine_server_config,
|
|
6
|
+
find_server_config,
|
|
7
|
+
load_mcp_config,
|
|
8
|
+
merge_server_config,
|
|
9
|
+
mcp_server_status,
|
|
10
|
+
write_mcp_config,
|
|
11
|
+
)
|
|
12
|
+
from .tools import mcp_tool_to_spec, mcp_tools_to_specs
|
|
13
|
+
|
|
14
|
+
__all__ = [
|
|
15
|
+
"MCPExposure",
|
|
16
|
+
"arthera_quant_engine_server_config",
|
|
17
|
+
"default_exposures",
|
|
18
|
+
"find_server_config",
|
|
19
|
+
"load_mcp_config",
|
|
20
|
+
"merge_server_config",
|
|
21
|
+
"mcp_server_status",
|
|
22
|
+
"mcp_tool_to_spec",
|
|
23
|
+
"mcp_tools_to_specs",
|
|
24
|
+
"write_mcp_config",
|
|
25
|
+
]
|