PraisonAI 3.0.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.
- praisonai/__init__.py +54 -0
- praisonai/__main__.py +15 -0
- praisonai/acp/__init__.py +54 -0
- praisonai/acp/config.py +159 -0
- praisonai/acp/server.py +587 -0
- praisonai/acp/session.py +219 -0
- praisonai/adapters/__init__.py +50 -0
- praisonai/adapters/readers.py +395 -0
- praisonai/adapters/rerankers.py +315 -0
- praisonai/adapters/retrievers.py +394 -0
- praisonai/adapters/vector_stores.py +409 -0
- praisonai/agent_scheduler.py +337 -0
- praisonai/agents_generator.py +903 -0
- praisonai/api/call.py +292 -0
- praisonai/auto.py +1197 -0
- praisonai/capabilities/__init__.py +275 -0
- praisonai/capabilities/a2a.py +140 -0
- praisonai/capabilities/assistants.py +283 -0
- praisonai/capabilities/audio.py +320 -0
- praisonai/capabilities/batches.py +469 -0
- praisonai/capabilities/completions.py +336 -0
- praisonai/capabilities/container_files.py +155 -0
- praisonai/capabilities/containers.py +93 -0
- praisonai/capabilities/embeddings.py +158 -0
- praisonai/capabilities/files.py +467 -0
- praisonai/capabilities/fine_tuning.py +293 -0
- praisonai/capabilities/guardrails.py +182 -0
- praisonai/capabilities/images.py +330 -0
- praisonai/capabilities/mcp.py +190 -0
- praisonai/capabilities/messages.py +270 -0
- praisonai/capabilities/moderations.py +154 -0
- praisonai/capabilities/ocr.py +217 -0
- praisonai/capabilities/passthrough.py +204 -0
- praisonai/capabilities/rag.py +207 -0
- praisonai/capabilities/realtime.py +160 -0
- praisonai/capabilities/rerank.py +165 -0
- praisonai/capabilities/responses.py +266 -0
- praisonai/capabilities/search.py +109 -0
- praisonai/capabilities/skills.py +133 -0
- praisonai/capabilities/vector_store_files.py +334 -0
- praisonai/capabilities/vector_stores.py +304 -0
- praisonai/capabilities/videos.py +141 -0
- praisonai/chainlit_ui.py +304 -0
- praisonai/chat/__init__.py +106 -0
- praisonai/chat/app.py +125 -0
- praisonai/cli/__init__.py +26 -0
- praisonai/cli/app.py +213 -0
- praisonai/cli/commands/__init__.py +75 -0
- praisonai/cli/commands/acp.py +70 -0
- praisonai/cli/commands/completion.py +333 -0
- praisonai/cli/commands/config.py +166 -0
- praisonai/cli/commands/debug.py +142 -0
- praisonai/cli/commands/diag.py +55 -0
- praisonai/cli/commands/doctor.py +166 -0
- praisonai/cli/commands/environment.py +179 -0
- praisonai/cli/commands/lsp.py +112 -0
- praisonai/cli/commands/mcp.py +210 -0
- praisonai/cli/commands/profile.py +457 -0
- praisonai/cli/commands/run.py +228 -0
- praisonai/cli/commands/schedule.py +150 -0
- praisonai/cli/commands/serve.py +97 -0
- praisonai/cli/commands/session.py +212 -0
- praisonai/cli/commands/traces.py +145 -0
- praisonai/cli/commands/version.py +101 -0
- praisonai/cli/configuration/__init__.py +18 -0
- praisonai/cli/configuration/loader.py +353 -0
- praisonai/cli/configuration/paths.py +114 -0
- praisonai/cli/configuration/schema.py +164 -0
- praisonai/cli/features/__init__.py +268 -0
- praisonai/cli/features/acp.py +236 -0
- praisonai/cli/features/action_orchestrator.py +546 -0
- praisonai/cli/features/agent_scheduler.py +773 -0
- praisonai/cli/features/agent_tools.py +474 -0
- praisonai/cli/features/agents.py +375 -0
- praisonai/cli/features/at_mentions.py +471 -0
- praisonai/cli/features/auto_memory.py +182 -0
- praisonai/cli/features/autonomy_mode.py +490 -0
- praisonai/cli/features/background.py +356 -0
- praisonai/cli/features/base.py +168 -0
- praisonai/cli/features/capabilities.py +1326 -0
- praisonai/cli/features/checkpoints.py +338 -0
- praisonai/cli/features/code_intelligence.py +652 -0
- praisonai/cli/features/compaction.py +294 -0
- praisonai/cli/features/compare.py +534 -0
- praisonai/cli/features/cost_tracker.py +514 -0
- praisonai/cli/features/debug.py +810 -0
- praisonai/cli/features/deploy.py +517 -0
- praisonai/cli/features/diag.py +289 -0
- praisonai/cli/features/doctor/__init__.py +63 -0
- praisonai/cli/features/doctor/checks/__init__.py +24 -0
- praisonai/cli/features/doctor/checks/acp_checks.py +240 -0
- praisonai/cli/features/doctor/checks/config_checks.py +366 -0
- praisonai/cli/features/doctor/checks/db_checks.py +366 -0
- praisonai/cli/features/doctor/checks/env_checks.py +543 -0
- praisonai/cli/features/doctor/checks/lsp_checks.py +199 -0
- praisonai/cli/features/doctor/checks/mcp_checks.py +349 -0
- praisonai/cli/features/doctor/checks/memory_checks.py +268 -0
- praisonai/cli/features/doctor/checks/network_checks.py +251 -0
- praisonai/cli/features/doctor/checks/obs_checks.py +328 -0
- praisonai/cli/features/doctor/checks/performance_checks.py +235 -0
- praisonai/cli/features/doctor/checks/permissions_checks.py +259 -0
- praisonai/cli/features/doctor/checks/selftest_checks.py +322 -0
- praisonai/cli/features/doctor/checks/serve_checks.py +426 -0
- praisonai/cli/features/doctor/checks/skills_checks.py +231 -0
- praisonai/cli/features/doctor/checks/tools_checks.py +371 -0
- praisonai/cli/features/doctor/engine.py +266 -0
- praisonai/cli/features/doctor/formatters.py +310 -0
- praisonai/cli/features/doctor/handler.py +397 -0
- praisonai/cli/features/doctor/models.py +264 -0
- praisonai/cli/features/doctor/registry.py +239 -0
- praisonai/cli/features/endpoints.py +1019 -0
- praisonai/cli/features/eval.py +560 -0
- praisonai/cli/features/external_agents.py +231 -0
- praisonai/cli/features/fast_context.py +410 -0
- praisonai/cli/features/flow_display.py +566 -0
- praisonai/cli/features/git_integration.py +651 -0
- praisonai/cli/features/guardrail.py +171 -0
- praisonai/cli/features/handoff.py +185 -0
- praisonai/cli/features/hooks.py +583 -0
- praisonai/cli/features/image.py +384 -0
- praisonai/cli/features/interactive_runtime.py +585 -0
- praisonai/cli/features/interactive_tools.py +380 -0
- praisonai/cli/features/interactive_tui.py +603 -0
- praisonai/cli/features/jobs.py +632 -0
- praisonai/cli/features/knowledge.py +531 -0
- praisonai/cli/features/lite.py +244 -0
- praisonai/cli/features/lsp_cli.py +225 -0
- praisonai/cli/features/mcp.py +169 -0
- praisonai/cli/features/message_queue.py +587 -0
- praisonai/cli/features/metrics.py +211 -0
- praisonai/cli/features/n8n.py +673 -0
- praisonai/cli/features/observability.py +293 -0
- praisonai/cli/features/ollama.py +361 -0
- praisonai/cli/features/output_style.py +273 -0
- praisonai/cli/features/package.py +631 -0
- praisonai/cli/features/performance.py +308 -0
- praisonai/cli/features/persistence.py +636 -0
- praisonai/cli/features/profile.py +226 -0
- praisonai/cli/features/profiler/__init__.py +81 -0
- praisonai/cli/features/profiler/core.py +558 -0
- praisonai/cli/features/profiler/optimizations.py +652 -0
- praisonai/cli/features/profiler/suite.py +386 -0
- praisonai/cli/features/profiling.py +350 -0
- praisonai/cli/features/queue/__init__.py +73 -0
- praisonai/cli/features/queue/manager.py +395 -0
- praisonai/cli/features/queue/models.py +286 -0
- praisonai/cli/features/queue/persistence.py +564 -0
- praisonai/cli/features/queue/scheduler.py +484 -0
- praisonai/cli/features/queue/worker.py +372 -0
- praisonai/cli/features/recipe.py +1723 -0
- praisonai/cli/features/recipes.py +449 -0
- praisonai/cli/features/registry.py +229 -0
- praisonai/cli/features/repo_map.py +860 -0
- praisonai/cli/features/router.py +466 -0
- praisonai/cli/features/sandbox_executor.py +515 -0
- praisonai/cli/features/serve.py +829 -0
- praisonai/cli/features/session.py +222 -0
- praisonai/cli/features/skills.py +856 -0
- praisonai/cli/features/slash_commands.py +650 -0
- praisonai/cli/features/telemetry.py +179 -0
- praisonai/cli/features/templates.py +1384 -0
- praisonai/cli/features/thinking.py +305 -0
- praisonai/cli/features/todo.py +334 -0
- praisonai/cli/features/tools.py +680 -0
- praisonai/cli/features/tui/__init__.py +83 -0
- praisonai/cli/features/tui/app.py +580 -0
- praisonai/cli/features/tui/cli.py +566 -0
- praisonai/cli/features/tui/debug.py +511 -0
- praisonai/cli/features/tui/events.py +99 -0
- praisonai/cli/features/tui/mock_provider.py +328 -0
- praisonai/cli/features/tui/orchestrator.py +652 -0
- praisonai/cli/features/tui/screens/__init__.py +50 -0
- praisonai/cli/features/tui/screens/main.py +245 -0
- praisonai/cli/features/tui/screens/queue.py +174 -0
- praisonai/cli/features/tui/screens/session.py +124 -0
- praisonai/cli/features/tui/screens/settings.py +148 -0
- praisonai/cli/features/tui/widgets/__init__.py +56 -0
- praisonai/cli/features/tui/widgets/chat.py +261 -0
- praisonai/cli/features/tui/widgets/composer.py +224 -0
- praisonai/cli/features/tui/widgets/queue_panel.py +200 -0
- praisonai/cli/features/tui/widgets/status.py +167 -0
- praisonai/cli/features/tui/widgets/tool_panel.py +248 -0
- praisonai/cli/features/workflow.py +720 -0
- praisonai/cli/legacy.py +236 -0
- praisonai/cli/main.py +5559 -0
- praisonai/cli/schedule_cli.py +54 -0
- praisonai/cli/state/__init__.py +31 -0
- praisonai/cli/state/identifiers.py +161 -0
- praisonai/cli/state/sessions.py +313 -0
- praisonai/code/__init__.py +93 -0
- praisonai/code/agent_tools.py +344 -0
- praisonai/code/diff/__init__.py +21 -0
- praisonai/code/diff/diff_strategy.py +432 -0
- praisonai/code/tools/__init__.py +27 -0
- praisonai/code/tools/apply_diff.py +221 -0
- praisonai/code/tools/execute_command.py +275 -0
- praisonai/code/tools/list_files.py +274 -0
- praisonai/code/tools/read_file.py +206 -0
- praisonai/code/tools/search_replace.py +248 -0
- praisonai/code/tools/write_file.py +217 -0
- praisonai/code/utils/__init__.py +46 -0
- praisonai/code/utils/file_utils.py +307 -0
- praisonai/code/utils/ignore_utils.py +308 -0
- praisonai/code/utils/text_utils.py +276 -0
- praisonai/db/__init__.py +64 -0
- praisonai/db/adapter.py +531 -0
- praisonai/deploy/__init__.py +62 -0
- praisonai/deploy/api.py +231 -0
- praisonai/deploy/docker.py +454 -0
- praisonai/deploy/doctor.py +367 -0
- praisonai/deploy/main.py +327 -0
- praisonai/deploy/models.py +179 -0
- praisonai/deploy/providers/__init__.py +33 -0
- praisonai/deploy/providers/aws.py +331 -0
- praisonai/deploy/providers/azure.py +358 -0
- praisonai/deploy/providers/base.py +101 -0
- praisonai/deploy/providers/gcp.py +314 -0
- praisonai/deploy/schema.py +208 -0
- praisonai/deploy.py +185 -0
- praisonai/endpoints/__init__.py +53 -0
- praisonai/endpoints/a2u_server.py +410 -0
- praisonai/endpoints/discovery.py +165 -0
- praisonai/endpoints/providers/__init__.py +28 -0
- praisonai/endpoints/providers/a2a.py +253 -0
- praisonai/endpoints/providers/a2u.py +208 -0
- praisonai/endpoints/providers/agents_api.py +171 -0
- praisonai/endpoints/providers/base.py +231 -0
- praisonai/endpoints/providers/mcp.py +263 -0
- praisonai/endpoints/providers/recipe.py +206 -0
- praisonai/endpoints/providers/tools_mcp.py +150 -0
- praisonai/endpoints/registry.py +131 -0
- praisonai/endpoints/server.py +161 -0
- praisonai/inbuilt_tools/__init__.py +24 -0
- praisonai/inbuilt_tools/autogen_tools.py +117 -0
- praisonai/inc/__init__.py +2 -0
- praisonai/inc/config.py +96 -0
- praisonai/inc/models.py +155 -0
- praisonai/integrations/__init__.py +56 -0
- praisonai/integrations/base.py +303 -0
- praisonai/integrations/claude_code.py +270 -0
- praisonai/integrations/codex_cli.py +255 -0
- praisonai/integrations/cursor_cli.py +195 -0
- praisonai/integrations/gemini_cli.py +222 -0
- praisonai/jobs/__init__.py +67 -0
- praisonai/jobs/executor.py +425 -0
- praisonai/jobs/models.py +230 -0
- praisonai/jobs/router.py +314 -0
- praisonai/jobs/server.py +186 -0
- praisonai/jobs/store.py +203 -0
- praisonai/llm/__init__.py +66 -0
- praisonai/llm/registry.py +382 -0
- praisonai/mcp_server/__init__.py +152 -0
- praisonai/mcp_server/adapters/__init__.py +74 -0
- praisonai/mcp_server/adapters/agents.py +128 -0
- praisonai/mcp_server/adapters/capabilities.py +168 -0
- praisonai/mcp_server/adapters/cli_tools.py +568 -0
- praisonai/mcp_server/adapters/extended_capabilities.py +462 -0
- praisonai/mcp_server/adapters/knowledge.py +93 -0
- praisonai/mcp_server/adapters/memory.py +104 -0
- praisonai/mcp_server/adapters/prompts.py +306 -0
- praisonai/mcp_server/adapters/resources.py +124 -0
- praisonai/mcp_server/adapters/tools_bridge.py +280 -0
- praisonai/mcp_server/auth/__init__.py +48 -0
- praisonai/mcp_server/auth/api_key.py +291 -0
- praisonai/mcp_server/auth/oauth.py +460 -0
- praisonai/mcp_server/auth/oidc.py +289 -0
- praisonai/mcp_server/auth/scopes.py +260 -0
- praisonai/mcp_server/cli.py +852 -0
- praisonai/mcp_server/elicitation.py +445 -0
- praisonai/mcp_server/icons.py +302 -0
- praisonai/mcp_server/recipe_adapter.py +573 -0
- praisonai/mcp_server/recipe_cli.py +824 -0
- praisonai/mcp_server/registry.py +703 -0
- praisonai/mcp_server/sampling.py +422 -0
- praisonai/mcp_server/server.py +490 -0
- praisonai/mcp_server/tasks.py +443 -0
- praisonai/mcp_server/transports/__init__.py +18 -0
- praisonai/mcp_server/transports/http_stream.py +376 -0
- praisonai/mcp_server/transports/stdio.py +132 -0
- praisonai/persistence/__init__.py +84 -0
- praisonai/persistence/config.py +238 -0
- praisonai/persistence/conversation/__init__.py +25 -0
- praisonai/persistence/conversation/async_mysql.py +427 -0
- praisonai/persistence/conversation/async_postgres.py +410 -0
- praisonai/persistence/conversation/async_sqlite.py +371 -0
- praisonai/persistence/conversation/base.py +151 -0
- praisonai/persistence/conversation/json_store.py +250 -0
- praisonai/persistence/conversation/mysql.py +387 -0
- praisonai/persistence/conversation/postgres.py +401 -0
- praisonai/persistence/conversation/singlestore.py +240 -0
- praisonai/persistence/conversation/sqlite.py +341 -0
- praisonai/persistence/conversation/supabase.py +203 -0
- praisonai/persistence/conversation/surrealdb.py +287 -0
- praisonai/persistence/factory.py +301 -0
- praisonai/persistence/hooks/__init__.py +18 -0
- praisonai/persistence/hooks/agent_hooks.py +297 -0
- praisonai/persistence/knowledge/__init__.py +26 -0
- praisonai/persistence/knowledge/base.py +144 -0
- praisonai/persistence/knowledge/cassandra.py +232 -0
- praisonai/persistence/knowledge/chroma.py +295 -0
- praisonai/persistence/knowledge/clickhouse.py +242 -0
- praisonai/persistence/knowledge/cosmosdb_vector.py +438 -0
- praisonai/persistence/knowledge/couchbase.py +286 -0
- praisonai/persistence/knowledge/lancedb.py +216 -0
- praisonai/persistence/knowledge/langchain_adapter.py +291 -0
- praisonai/persistence/knowledge/lightrag_adapter.py +212 -0
- praisonai/persistence/knowledge/llamaindex_adapter.py +256 -0
- praisonai/persistence/knowledge/milvus.py +277 -0
- praisonai/persistence/knowledge/mongodb_vector.py +306 -0
- praisonai/persistence/knowledge/pgvector.py +335 -0
- praisonai/persistence/knowledge/pinecone.py +253 -0
- praisonai/persistence/knowledge/qdrant.py +301 -0
- praisonai/persistence/knowledge/redis_vector.py +291 -0
- praisonai/persistence/knowledge/singlestore_vector.py +299 -0
- praisonai/persistence/knowledge/surrealdb_vector.py +309 -0
- praisonai/persistence/knowledge/upstash_vector.py +266 -0
- praisonai/persistence/knowledge/weaviate.py +223 -0
- praisonai/persistence/migrations/__init__.py +10 -0
- praisonai/persistence/migrations/manager.py +251 -0
- praisonai/persistence/orchestrator.py +406 -0
- praisonai/persistence/state/__init__.py +21 -0
- praisonai/persistence/state/async_mongodb.py +200 -0
- praisonai/persistence/state/base.py +107 -0
- praisonai/persistence/state/dynamodb.py +226 -0
- praisonai/persistence/state/firestore.py +175 -0
- praisonai/persistence/state/gcs.py +155 -0
- praisonai/persistence/state/memory.py +245 -0
- praisonai/persistence/state/mongodb.py +158 -0
- praisonai/persistence/state/redis.py +190 -0
- praisonai/persistence/state/upstash.py +144 -0
- praisonai/persistence/tests/__init__.py +3 -0
- praisonai/persistence/tests/test_all_backends.py +633 -0
- praisonai/profiler.py +1214 -0
- praisonai/recipe/__init__.py +134 -0
- praisonai/recipe/bridge.py +278 -0
- praisonai/recipe/core.py +893 -0
- praisonai/recipe/exceptions.py +54 -0
- praisonai/recipe/history.py +402 -0
- praisonai/recipe/models.py +266 -0
- praisonai/recipe/operations.py +440 -0
- praisonai/recipe/policy.py +422 -0
- praisonai/recipe/registry.py +849 -0
- praisonai/recipe/runtime.py +214 -0
- praisonai/recipe/security.py +711 -0
- praisonai/recipe/serve.py +859 -0
- praisonai/recipe/server.py +613 -0
- praisonai/scheduler/__init__.py +45 -0
- praisonai/scheduler/agent_scheduler.py +552 -0
- praisonai/scheduler/base.py +124 -0
- praisonai/scheduler/daemon_manager.py +225 -0
- praisonai/scheduler/state_manager.py +155 -0
- praisonai/scheduler/yaml_loader.py +193 -0
- praisonai/scheduler.py +194 -0
- praisonai/setup/__init__.py +1 -0
- praisonai/setup/build.py +21 -0
- praisonai/setup/post_install.py +23 -0
- praisonai/setup/setup_conda_env.py +25 -0
- praisonai/setup.py +16 -0
- praisonai/templates/__init__.py +116 -0
- praisonai/templates/cache.py +364 -0
- praisonai/templates/dependency_checker.py +358 -0
- praisonai/templates/discovery.py +391 -0
- praisonai/templates/loader.py +564 -0
- praisonai/templates/registry.py +511 -0
- praisonai/templates/resolver.py +206 -0
- praisonai/templates/security.py +327 -0
- praisonai/templates/tool_override.py +498 -0
- praisonai/templates/tools_doctor.py +256 -0
- praisonai/test.py +105 -0
- praisonai/train.py +562 -0
- praisonai/train_vision.py +306 -0
- praisonai/ui/agents.py +824 -0
- praisonai/ui/callbacks.py +57 -0
- praisonai/ui/chainlit_compat.py +246 -0
- praisonai/ui/chat.py +532 -0
- praisonai/ui/code.py +717 -0
- praisonai/ui/colab.py +474 -0
- praisonai/ui/colab_chainlit.py +81 -0
- praisonai/ui/components/aicoder.py +284 -0
- praisonai/ui/context.py +283 -0
- praisonai/ui/database_config.py +56 -0
- praisonai/ui/db.py +294 -0
- praisonai/ui/realtime.py +488 -0
- praisonai/ui/realtimeclient/__init__.py +756 -0
- praisonai/ui/realtimeclient/tools.py +242 -0
- praisonai/ui/sql_alchemy.py +710 -0
- praisonai/upload_vision.py +140 -0
- praisonai/version.py +1 -0
- praisonai-3.0.0.dist-info/METADATA +3493 -0
- praisonai-3.0.0.dist-info/RECORD +393 -0
- praisonai-3.0.0.dist-info/WHEEL +5 -0
- praisonai-3.0.0.dist-info/entry_points.txt +4 -0
- praisonai-3.0.0.dist-info/top_level.txt +1 -0
|
@@ -0,0 +1,366 @@
|
|
|
1
|
+
"""
|
|
2
|
+
Configuration checks for the Doctor CLI module.
|
|
3
|
+
|
|
4
|
+
Validates YAML configuration files like agents.yaml and workflow.yaml.
|
|
5
|
+
"""
|
|
6
|
+
|
|
7
|
+
import os
|
|
8
|
+
from pathlib import Path
|
|
9
|
+
|
|
10
|
+
from ..models import (
|
|
11
|
+
CheckCategory,
|
|
12
|
+
CheckResult,
|
|
13
|
+
CheckStatus,
|
|
14
|
+
CheckSeverity,
|
|
15
|
+
DoctorConfig,
|
|
16
|
+
)
|
|
17
|
+
from ..registry import register_check
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
def _find_config_file(config: DoctorConfig, default_names: list) -> str:
|
|
21
|
+
"""Find a configuration file."""
|
|
22
|
+
if config.config_file:
|
|
23
|
+
return config.config_file
|
|
24
|
+
|
|
25
|
+
cwd = Path.cwd()
|
|
26
|
+
for name in default_names:
|
|
27
|
+
path = cwd / name
|
|
28
|
+
if path.exists():
|
|
29
|
+
return str(path)
|
|
30
|
+
|
|
31
|
+
return ""
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
def _validate_yaml_syntax(file_path: str) -> tuple:
|
|
35
|
+
"""Validate YAML syntax and return (valid, data, error)."""
|
|
36
|
+
try:
|
|
37
|
+
import yaml
|
|
38
|
+
with open(file_path, 'r') as f:
|
|
39
|
+
data = yaml.safe_load(f)
|
|
40
|
+
return True, data, None
|
|
41
|
+
except ImportError:
|
|
42
|
+
return False, None, "PyYAML not installed"
|
|
43
|
+
except yaml.YAMLError as e:
|
|
44
|
+
return False, None, f"YAML syntax error: {e}"
|
|
45
|
+
except Exception as e:
|
|
46
|
+
return False, None, str(e)
|
|
47
|
+
|
|
48
|
+
|
|
49
|
+
@register_check(
|
|
50
|
+
id="agents_yaml_exists",
|
|
51
|
+
title="agents.yaml Exists",
|
|
52
|
+
description="Check if agents.yaml configuration file exists",
|
|
53
|
+
category=CheckCategory.CONFIG,
|
|
54
|
+
severity=CheckSeverity.MEDIUM,
|
|
55
|
+
)
|
|
56
|
+
def check_agents_yaml_exists(config: DoctorConfig) -> CheckResult:
|
|
57
|
+
"""Check if agents.yaml exists."""
|
|
58
|
+
file_path = _find_config_file(config, ["agents.yaml", "agents.yml"])
|
|
59
|
+
|
|
60
|
+
if file_path and os.path.exists(file_path):
|
|
61
|
+
return CheckResult(
|
|
62
|
+
id="agents_yaml_exists",
|
|
63
|
+
title="agents.yaml Exists",
|
|
64
|
+
category=CheckCategory.CONFIG,
|
|
65
|
+
status=CheckStatus.PASS,
|
|
66
|
+
message=f"Found: {file_path}",
|
|
67
|
+
metadata={"path": file_path},
|
|
68
|
+
)
|
|
69
|
+
else:
|
|
70
|
+
return CheckResult(
|
|
71
|
+
id="agents_yaml_exists",
|
|
72
|
+
title="agents.yaml Exists",
|
|
73
|
+
category=CheckCategory.CONFIG,
|
|
74
|
+
status=CheckStatus.SKIP,
|
|
75
|
+
message="No agents.yaml found in current directory (optional)",
|
|
76
|
+
details="agents.yaml is only required when running YAML-based workflows",
|
|
77
|
+
)
|
|
78
|
+
|
|
79
|
+
|
|
80
|
+
@register_check(
|
|
81
|
+
id="agents_yaml_syntax",
|
|
82
|
+
title="agents.yaml Syntax",
|
|
83
|
+
description="Validate agents.yaml YAML syntax",
|
|
84
|
+
category=CheckCategory.CONFIG,
|
|
85
|
+
severity=CheckSeverity.HIGH,
|
|
86
|
+
dependencies=["agents_yaml_exists"],
|
|
87
|
+
)
|
|
88
|
+
def check_agents_yaml_syntax(config: DoctorConfig) -> CheckResult:
|
|
89
|
+
"""Validate agents.yaml YAML syntax."""
|
|
90
|
+
file_path = _find_config_file(config, ["agents.yaml", "agents.yml"])
|
|
91
|
+
|
|
92
|
+
if not file_path or not os.path.exists(file_path):
|
|
93
|
+
return CheckResult(
|
|
94
|
+
id="agents_yaml_syntax",
|
|
95
|
+
title="agents.yaml Syntax",
|
|
96
|
+
category=CheckCategory.CONFIG,
|
|
97
|
+
status=CheckStatus.SKIP,
|
|
98
|
+
message="No agents.yaml to validate",
|
|
99
|
+
)
|
|
100
|
+
|
|
101
|
+
valid, data, error = _validate_yaml_syntax(file_path)
|
|
102
|
+
|
|
103
|
+
if valid:
|
|
104
|
+
return CheckResult(
|
|
105
|
+
id="agents_yaml_syntax",
|
|
106
|
+
title="agents.yaml Syntax",
|
|
107
|
+
category=CheckCategory.CONFIG,
|
|
108
|
+
status=CheckStatus.PASS,
|
|
109
|
+
message="YAML syntax is valid",
|
|
110
|
+
metadata={"path": file_path},
|
|
111
|
+
)
|
|
112
|
+
else:
|
|
113
|
+
return CheckResult(
|
|
114
|
+
id="agents_yaml_syntax",
|
|
115
|
+
title="agents.yaml Syntax",
|
|
116
|
+
category=CheckCategory.CONFIG,
|
|
117
|
+
status=CheckStatus.FAIL,
|
|
118
|
+
message=f"Invalid YAML: {error}",
|
|
119
|
+
remediation="Fix the YAML syntax errors in agents.yaml",
|
|
120
|
+
severity=CheckSeverity.HIGH,
|
|
121
|
+
)
|
|
122
|
+
|
|
123
|
+
|
|
124
|
+
@register_check(
|
|
125
|
+
id="agents_yaml_schema",
|
|
126
|
+
title="agents.yaml Schema",
|
|
127
|
+
description="Validate agents.yaml schema structure",
|
|
128
|
+
category=CheckCategory.CONFIG,
|
|
129
|
+
severity=CheckSeverity.MEDIUM,
|
|
130
|
+
dependencies=["agents_yaml_syntax"],
|
|
131
|
+
)
|
|
132
|
+
def check_agents_yaml_schema(config: DoctorConfig) -> CheckResult:
|
|
133
|
+
"""Validate agents.yaml schema structure."""
|
|
134
|
+
file_path = _find_config_file(config, ["agents.yaml", "agents.yml"])
|
|
135
|
+
|
|
136
|
+
if not file_path or not os.path.exists(file_path):
|
|
137
|
+
return CheckResult(
|
|
138
|
+
id="agents_yaml_schema",
|
|
139
|
+
title="agents.yaml Schema",
|
|
140
|
+
category=CheckCategory.CONFIG,
|
|
141
|
+
status=CheckStatus.SKIP,
|
|
142
|
+
message="No agents.yaml to validate",
|
|
143
|
+
)
|
|
144
|
+
|
|
145
|
+
valid, data, error = _validate_yaml_syntax(file_path)
|
|
146
|
+
|
|
147
|
+
if not valid:
|
|
148
|
+
return CheckResult(
|
|
149
|
+
id="agents_yaml_schema",
|
|
150
|
+
title="agents.yaml Schema",
|
|
151
|
+
category=CheckCategory.CONFIG,
|
|
152
|
+
status=CheckStatus.SKIP,
|
|
153
|
+
message="Skipped due to syntax errors",
|
|
154
|
+
)
|
|
155
|
+
|
|
156
|
+
if not isinstance(data, dict):
|
|
157
|
+
return CheckResult(
|
|
158
|
+
id="agents_yaml_schema",
|
|
159
|
+
title="agents.yaml Schema",
|
|
160
|
+
category=CheckCategory.CONFIG,
|
|
161
|
+
status=CheckStatus.FAIL,
|
|
162
|
+
message="agents.yaml must be a YAML mapping (dictionary)",
|
|
163
|
+
remediation="Ensure agents.yaml starts with key-value pairs",
|
|
164
|
+
)
|
|
165
|
+
|
|
166
|
+
warnings = []
|
|
167
|
+
|
|
168
|
+
# Check for common fields
|
|
169
|
+
if "framework" in data:
|
|
170
|
+
framework = data["framework"]
|
|
171
|
+
if framework not in ["praisonai", "crewai", "autogen"]:
|
|
172
|
+
warnings.append(f"Unknown framework: {framework}")
|
|
173
|
+
|
|
174
|
+
# Check for agents section
|
|
175
|
+
agents = data.get("agents") or data.get("roles")
|
|
176
|
+
if agents:
|
|
177
|
+
if isinstance(agents, list):
|
|
178
|
+
for i, agent in enumerate(agents):
|
|
179
|
+
if isinstance(agent, dict):
|
|
180
|
+
if not agent.get("name") and not agent.get("role"):
|
|
181
|
+
warnings.append(f"Agent {i+1}: missing 'name' or 'role'")
|
|
182
|
+
elif isinstance(agents, dict):
|
|
183
|
+
for name, agent_config in agents.items():
|
|
184
|
+
if isinstance(agent_config, dict):
|
|
185
|
+
if not agent_config.get("role") and not agent_config.get("goal"):
|
|
186
|
+
warnings.append(f"Agent '{name}': missing 'role' or 'goal'")
|
|
187
|
+
|
|
188
|
+
# Check for tasks/steps
|
|
189
|
+
tasks = data.get("tasks") or data.get("steps")
|
|
190
|
+
if tasks and isinstance(tasks, list):
|
|
191
|
+
for i, task in enumerate(tasks):
|
|
192
|
+
if isinstance(task, dict):
|
|
193
|
+
if not task.get("description") and not task.get("action"):
|
|
194
|
+
warnings.append(f"Task {i+1}: missing 'description' or 'action'")
|
|
195
|
+
|
|
196
|
+
if warnings:
|
|
197
|
+
return CheckResult(
|
|
198
|
+
id="agents_yaml_schema",
|
|
199
|
+
title="agents.yaml Schema",
|
|
200
|
+
category=CheckCategory.CONFIG,
|
|
201
|
+
status=CheckStatus.WARN,
|
|
202
|
+
message=f"Schema valid with {len(warnings)} warning(s)",
|
|
203
|
+
details="; ".join(warnings[:3]) + ("..." if len(warnings) > 3 else ""),
|
|
204
|
+
metadata={"warnings": warnings},
|
|
205
|
+
)
|
|
206
|
+
else:
|
|
207
|
+
return CheckResult(
|
|
208
|
+
id="agents_yaml_schema",
|
|
209
|
+
title="agents.yaml Schema",
|
|
210
|
+
category=CheckCategory.CONFIG,
|
|
211
|
+
status=CheckStatus.PASS,
|
|
212
|
+
message="Schema structure is valid",
|
|
213
|
+
)
|
|
214
|
+
|
|
215
|
+
|
|
216
|
+
@register_check(
|
|
217
|
+
id="workflow_yaml_exists",
|
|
218
|
+
title="workflow.yaml Exists",
|
|
219
|
+
description="Check if workflow.yaml configuration file exists",
|
|
220
|
+
category=CheckCategory.CONFIG,
|
|
221
|
+
severity=CheckSeverity.LOW,
|
|
222
|
+
)
|
|
223
|
+
def check_workflow_yaml_exists(config: DoctorConfig) -> CheckResult:
|
|
224
|
+
"""Check if workflow.yaml exists."""
|
|
225
|
+
file_path = _find_config_file(config, ["workflow.yaml", "workflow.yml"])
|
|
226
|
+
|
|
227
|
+
if file_path and os.path.exists(file_path):
|
|
228
|
+
return CheckResult(
|
|
229
|
+
id="workflow_yaml_exists",
|
|
230
|
+
title="workflow.yaml Exists",
|
|
231
|
+
category=CheckCategory.CONFIG,
|
|
232
|
+
status=CheckStatus.PASS,
|
|
233
|
+
message=f"Found: {file_path}",
|
|
234
|
+
metadata={"path": file_path},
|
|
235
|
+
)
|
|
236
|
+
else:
|
|
237
|
+
return CheckResult(
|
|
238
|
+
id="workflow_yaml_exists",
|
|
239
|
+
title="workflow.yaml Exists",
|
|
240
|
+
category=CheckCategory.CONFIG,
|
|
241
|
+
status=CheckStatus.SKIP,
|
|
242
|
+
message="No workflow.yaml found (optional)",
|
|
243
|
+
)
|
|
244
|
+
|
|
245
|
+
|
|
246
|
+
@register_check(
|
|
247
|
+
id="workflow_yaml_syntax",
|
|
248
|
+
title="workflow.yaml Syntax",
|
|
249
|
+
description="Validate workflow.yaml YAML syntax",
|
|
250
|
+
category=CheckCategory.CONFIG,
|
|
251
|
+
severity=CheckSeverity.HIGH,
|
|
252
|
+
dependencies=["workflow_yaml_exists"],
|
|
253
|
+
)
|
|
254
|
+
def check_workflow_yaml_syntax(config: DoctorConfig) -> CheckResult:
|
|
255
|
+
"""Validate workflow.yaml YAML syntax."""
|
|
256
|
+
file_path = _find_config_file(config, ["workflow.yaml", "workflow.yml"])
|
|
257
|
+
|
|
258
|
+
if not file_path or not os.path.exists(file_path):
|
|
259
|
+
return CheckResult(
|
|
260
|
+
id="workflow_yaml_syntax",
|
|
261
|
+
title="workflow.yaml Syntax",
|
|
262
|
+
category=CheckCategory.CONFIG,
|
|
263
|
+
status=CheckStatus.SKIP,
|
|
264
|
+
message="No workflow.yaml to validate",
|
|
265
|
+
)
|
|
266
|
+
|
|
267
|
+
valid, data, error = _validate_yaml_syntax(file_path)
|
|
268
|
+
|
|
269
|
+
if valid:
|
|
270
|
+
return CheckResult(
|
|
271
|
+
id="workflow_yaml_syntax",
|
|
272
|
+
title="workflow.yaml Syntax",
|
|
273
|
+
category=CheckCategory.CONFIG,
|
|
274
|
+
status=CheckStatus.PASS,
|
|
275
|
+
message="YAML syntax is valid",
|
|
276
|
+
)
|
|
277
|
+
else:
|
|
278
|
+
return CheckResult(
|
|
279
|
+
id="workflow_yaml_syntax",
|
|
280
|
+
title="workflow.yaml Syntax",
|
|
281
|
+
category=CheckCategory.CONFIG,
|
|
282
|
+
status=CheckStatus.FAIL,
|
|
283
|
+
message=f"Invalid YAML: {error}",
|
|
284
|
+
remediation="Fix the YAML syntax errors in workflow.yaml",
|
|
285
|
+
severity=CheckSeverity.HIGH,
|
|
286
|
+
)
|
|
287
|
+
|
|
288
|
+
|
|
289
|
+
@register_check(
|
|
290
|
+
id="praison_config_dir",
|
|
291
|
+
title=".praison Config Directory",
|
|
292
|
+
description="Check .praison configuration directory",
|
|
293
|
+
category=CheckCategory.CONFIG,
|
|
294
|
+
severity=CheckSeverity.INFO,
|
|
295
|
+
)
|
|
296
|
+
def check_praison_config_dir(config: DoctorConfig) -> CheckResult:
|
|
297
|
+
"""Check .praison configuration directory."""
|
|
298
|
+
home_dir = Path.home()
|
|
299
|
+
cwd = Path.cwd()
|
|
300
|
+
|
|
301
|
+
locations = [
|
|
302
|
+
cwd / ".praison",
|
|
303
|
+
home_dir / ".praison",
|
|
304
|
+
home_dir / ".config" / "praison",
|
|
305
|
+
]
|
|
306
|
+
|
|
307
|
+
found = []
|
|
308
|
+
for loc in locations:
|
|
309
|
+
if loc.exists():
|
|
310
|
+
found.append(str(loc))
|
|
311
|
+
|
|
312
|
+
if found:
|
|
313
|
+
return CheckResult(
|
|
314
|
+
id="praison_config_dir",
|
|
315
|
+
title=".praison Config Directory",
|
|
316
|
+
category=CheckCategory.CONFIG,
|
|
317
|
+
status=CheckStatus.PASS,
|
|
318
|
+
message=f"Found {len(found)} config location(s)",
|
|
319
|
+
details=", ".join(found),
|
|
320
|
+
metadata={"locations": found},
|
|
321
|
+
)
|
|
322
|
+
else:
|
|
323
|
+
return CheckResult(
|
|
324
|
+
id="praison_config_dir",
|
|
325
|
+
title=".praison Config Directory",
|
|
326
|
+
category=CheckCategory.CONFIG,
|
|
327
|
+
status=CheckStatus.SKIP,
|
|
328
|
+
message="No .praison config directory found (will be created on first use)",
|
|
329
|
+
)
|
|
330
|
+
|
|
331
|
+
|
|
332
|
+
@register_check(
|
|
333
|
+
id="env_file",
|
|
334
|
+
title=".env File",
|
|
335
|
+
description="Check for .env file",
|
|
336
|
+
category=CheckCategory.CONFIG,
|
|
337
|
+
severity=CheckSeverity.INFO,
|
|
338
|
+
)
|
|
339
|
+
def check_env_file(config: DoctorConfig) -> CheckResult:
|
|
340
|
+
"""Check for .env file."""
|
|
341
|
+
cwd = Path.cwd()
|
|
342
|
+
env_files = [".env", ".env.local", ".env.development"]
|
|
343
|
+
|
|
344
|
+
found = []
|
|
345
|
+
for name in env_files:
|
|
346
|
+
path = cwd / name
|
|
347
|
+
if path.exists():
|
|
348
|
+
found.append(name)
|
|
349
|
+
|
|
350
|
+
if found:
|
|
351
|
+
return CheckResult(
|
|
352
|
+
id="env_file",
|
|
353
|
+
title=".env File",
|
|
354
|
+
category=CheckCategory.CONFIG,
|
|
355
|
+
status=CheckStatus.PASS,
|
|
356
|
+
message=f"Found: {', '.join(found)}",
|
|
357
|
+
metadata={"files": found},
|
|
358
|
+
)
|
|
359
|
+
else:
|
|
360
|
+
return CheckResult(
|
|
361
|
+
id="env_file",
|
|
362
|
+
title=".env File",
|
|
363
|
+
category=CheckCategory.CONFIG,
|
|
364
|
+
status=CheckStatus.SKIP,
|
|
365
|
+
message="No .env file found (environment variables can be set directly)",
|
|
366
|
+
)
|