agent-devkit 0.1.5 → 0.2.0
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.
- package/README.md +14 -2
- package/package.json +1 -1
- package/runtime/README.md +127 -6
- package/runtime/agent +5 -0
- package/runtime/agents/README.md +34 -0
- package/runtime/agents/agent-devkit-agent-builder/AGENTS.md +24 -0
- package/runtime/agents/agent-devkit-agent-builder/README.md +37 -0
- package/runtime/agents/agent-devkit-agent-builder/agent.yaml +46 -0
- package/runtime/agents/agent-devkit-agent-builder/capabilities/plan-agent/capability.yaml +29 -0
- package/runtime/agents/agent-devkit-agent-builder/capabilities/plan-agent/decision-rules.md +7 -0
- package/runtime/agents/agent-devkit-agent-builder/capabilities/plan-agent/runner.py +33 -0
- package/runtime/agents/agent-devkit-agent-builder/capabilities/plan-agent/workflow.md +8 -0
- package/runtime/agents/agent-devkit-agent-builder/capabilities/scaffold-agent/capability.yaml +31 -0
- package/runtime/agents/agent-devkit-agent-builder/capabilities/scaffold-agent/decision-rules.md +9 -0
- package/runtime/agents/agent-devkit-agent-builder/capabilities/scaffold-agent/runner.py +39 -0
- package/runtime/agents/agent-devkit-agent-builder/capabilities/scaffold-agent/workflow.md +8 -0
- package/runtime/agents/agent-devkit-agent-builder/capabilities/validate-agent-contract/capability.yaml +28 -0
- package/runtime/agents/agent-devkit-agent-builder/capabilities/validate-agent-contract/decision-rules.md +6 -0
- package/runtime/agents/agent-devkit-agent-builder/capabilities/validate-agent-contract/runner.py +33 -0
- package/runtime/agents/agent-devkit-agent-builder/capabilities/validate-agent-contract/workflow.md +7 -0
- package/runtime/agents/agent-devkit-agent-builder/infra/integrations/agent-devkit/agent_builder_repository.py +527 -0
- package/runtime/agents/agent-devkit-agent-builder/knowledge/context.md +15 -0
- package/runtime/agents/agent-devkit-agent-builder/knowledge/policies.yaml +11 -0
- package/runtime/agents/agent-devkit-agent-builder/knowledge/system.md +11 -0
- package/runtime/agents/agent-devkit-agent-builder/templates/agent-plan-output.md +20 -0
- package/runtime/agents/agent-devkit-agent-builder/templates/scaffold-plan-output.md +13 -0
- package/runtime/agents/agent-devkit-agent-builder/templates/validation-report-output.md +13 -0
- package/runtime/agents/agent-devkit-agent-builder/tests/test_runners.py +188 -0
- package/runtime/agents/automation-architect/AGENTS.md +11 -0
- package/runtime/agents/automation-architect/README.md +27 -0
- package/runtime/agents/automation-architect/agent.yaml +57 -0
- package/runtime/agents/automation-architect/capabilities/classify-automation-request/capability.yaml +35 -0
- package/runtime/agents/automation-architect/capabilities/classify-automation-request/decision-rules.md +10 -0
- package/runtime/agents/automation-architect/capabilities/classify-automation-request/runner.py +37 -0
- package/runtime/agents/automation-architect/capabilities/classify-automation-request/workflow.md +7 -0
- package/runtime/agents/automation-architect/capabilities/delegate-automation-build/capability.yaml +34 -0
- package/runtime/agents/automation-architect/capabilities/delegate-automation-build/decision-rules.md +7 -0
- package/runtime/agents/automation-architect/capabilities/delegate-automation-build/runner.py +37 -0
- package/runtime/agents/automation-architect/capabilities/delegate-automation-build/workflow.md +6 -0
- package/runtime/agents/automation-architect/capabilities/plan-automation-solution/capability.yaml +35 -0
- package/runtime/agents/automation-architect/capabilities/plan-automation-solution/decision-rules.md +7 -0
- package/runtime/agents/automation-architect/capabilities/plan-automation-solution/runner.py +37 -0
- package/runtime/agents/automation-architect/capabilities/plan-automation-solution/workflow.md +7 -0
- package/runtime/agents/automation-architect/capabilities/review-automation-solution/capability.yaml +36 -0
- package/runtime/agents/automation-architect/capabilities/review-automation-solution/decision-rules.md +7 -0
- package/runtime/agents/automation-architect/capabilities/review-automation-solution/runner.py +39 -0
- package/runtime/agents/automation-architect/capabilities/review-automation-solution/workflow.md +7 -0
- package/runtime/agents/automation-architect/infra/integrations/automation-architecture/automation_architecture_repository.py +481 -0
- package/runtime/agents/automation-architect/knowledge/context.md +22 -0
- package/runtime/agents/automation-architect/knowledge/policies.yaml +20 -0
- package/runtime/agents/automation-architect/knowledge/system.md +8 -0
- package/runtime/agents/automation-architect/templates/automation-classification.md +6 -0
- package/runtime/agents/automation-architect/templates/automation-plan.md +5 -0
- package/runtime/agents/automation-architect/tests/test_runners.py +135 -0
- package/runtime/agents/aws-architecture-analyst/agent.yaml +17 -4
- package/runtime/agents/aws-cloudwatch-log-analyzer/agent.yaml +12 -2
- package/runtime/agents/aws-cloudwatch-log-analyzer/capabilities/analyze-service-error/capability.yaml +16 -0
- package/runtime/agents/aws-lambda-builder/AGENTS.md +27 -0
- package/runtime/agents/aws-lambda-builder/README.md +21 -0
- package/runtime/agents/aws-lambda-builder/agent.yaml +46 -0
- package/runtime/agents/aws-lambda-builder/capabilities/deploy-lambda-plan/capability.yaml +18 -0
- package/runtime/agents/aws-lambda-builder/capabilities/deploy-lambda-plan/decision-rules.md +6 -0
- package/runtime/agents/aws-lambda-builder/capabilities/deploy-lambda-plan/runner.py +33 -0
- package/runtime/agents/aws-lambda-builder/capabilities/deploy-lambda-plan/workflow.md +6 -0
- package/runtime/agents/aws-lambda-builder/capabilities/generate-lambda-project/capability.yaml +20 -0
- package/runtime/agents/aws-lambda-builder/capabilities/generate-lambda-project/decision-rules.md +6 -0
- package/runtime/agents/aws-lambda-builder/capabilities/generate-lambda-project/runner.py +39 -0
- package/runtime/agents/aws-lambda-builder/capabilities/generate-lambda-project/workflow.md +7 -0
- package/runtime/agents/aws-lambda-builder/capabilities/package-lambda/capability.yaml +22 -0
- package/runtime/agents/aws-lambda-builder/capabilities/package-lambda/decision-rules.md +6 -0
- package/runtime/agents/aws-lambda-builder/capabilities/package-lambda/runner.py +41 -0
- package/runtime/agents/aws-lambda-builder/capabilities/package-lambda/workflow.md +6 -0
- package/runtime/agents/aws-lambda-builder/capabilities/plan-lambda/capability.yaml +18 -0
- package/runtime/agents/aws-lambda-builder/capabilities/plan-lambda/decision-rules.md +7 -0
- package/runtime/agents/aws-lambda-builder/capabilities/plan-lambda/runner.py +33 -0
- package/runtime/agents/aws-lambda-builder/capabilities/plan-lambda/workflow.md +6 -0
- package/runtime/agents/aws-lambda-builder/capabilities/review-lambda-security/capability.yaml +18 -0
- package/runtime/agents/aws-lambda-builder/capabilities/review-lambda-security/decision-rules.md +7 -0
- package/runtime/agents/aws-lambda-builder/capabilities/review-lambda-security/runner.py +33 -0
- package/runtime/agents/aws-lambda-builder/capabilities/review-lambda-security/workflow.md +5 -0
- package/runtime/agents/aws-lambda-builder/infra/integrations/aws-lambda/aws_lambda_repository.py +688 -0
- package/runtime/agents/aws-lambda-builder/knowledge/context.md +12 -0
- package/runtime/agents/aws-lambda-builder/knowledge/policies.yaml +23 -0
- package/runtime/agents/aws-lambda-builder/knowledge/system.md +10 -0
- package/runtime/agents/aws-lambda-builder/templates/lambda-deploy-plan.md +3 -0
- package/runtime/agents/aws-lambda-builder/templates/lambda-package.md +3 -0
- package/runtime/agents/aws-lambda-builder/templates/lambda-plan.md +3 -0
- package/runtime/agents/aws-lambda-builder/templates/lambda-readme.md +3 -0
- package/runtime/agents/aws-lambda-builder/templates/lambda-security-review.md +3 -0
- package/runtime/agents/aws-lambda-builder/tests/test_runners.py +355 -0
- package/runtime/agents/aws-operations-operator/agent.yaml +18 -6
- package/runtime/agents/aws-security-governance-auditor/agent.yaml +17 -5
- package/runtime/agents/azure-devops-orchestrator/agent.yaml +15 -2
- package/runtime/agents/azure-devops-orchestrator/capabilities/read-card/capability.yaml +29 -0
- package/runtime/agents/bpo-analyser/agent.yaml +12 -2
- package/runtime/agents/bpo-analyser/knowledge/policies.yaml +2 -2
- package/runtime/agents/data-scientist-analyst/agent.yaml +16 -4
- package/runtime/agents/data-scientist-analyst/capabilities/generate-data-report/capability.yaml +1 -1
- package/runtime/agents/data-scientist-analyst/capabilities/generate-reconciliation-report/capability.yaml +1 -1
- package/runtime/agents/data-scientist-analyst/capabilities/run-data-pipeline/capability.yaml +1 -1
- package/runtime/agents/data-scientist-analyst/infra/integrations/agent-bridge/methods/analyze-sql-source.yaml +1 -1
- package/runtime/agents/data-scientist-analyst/knowledge/policies.yaml +4 -4
- package/runtime/agents/data-scientist-analyst/knowledge/system.md +1 -1
- package/runtime/agents/data-scientist-analyst/tests/test_runners.py +1 -1
- package/runtime/agents/database-change-operator/agent.yaml +12 -1
- package/runtime/agents/docker-container-builder/AGENTS.md +27 -0
- package/runtime/agents/docker-container-builder/README.md +21 -0
- package/runtime/agents/docker-container-builder/agent.yaml +52 -0
- package/runtime/agents/docker-container-builder/capabilities/analyze-containerization-target/capability.yaml +18 -0
- package/runtime/agents/docker-container-builder/capabilities/analyze-containerization-target/decision-rules.md +6 -0
- package/runtime/agents/docker-container-builder/capabilities/analyze-containerization-target/runner.py +32 -0
- package/runtime/agents/docker-container-builder/capabilities/analyze-containerization-target/workflow.md +6 -0
- package/runtime/agents/docker-container-builder/capabilities/generate-compose/capability.yaml +18 -0
- package/runtime/agents/docker-container-builder/capabilities/generate-compose/decision-rules.md +7 -0
- package/runtime/agents/docker-container-builder/capabilities/generate-compose/runner.py +32 -0
- package/runtime/agents/docker-container-builder/capabilities/generate-compose/workflow.md +6 -0
- package/runtime/agents/docker-container-builder/capabilities/generate-container-project-files/capability.yaml +20 -0
- package/runtime/agents/docker-container-builder/capabilities/generate-container-project-files/decision-rules.md +7 -0
- package/runtime/agents/docker-container-builder/capabilities/generate-container-project-files/runner.py +38 -0
- package/runtime/agents/docker-container-builder/capabilities/generate-container-project-files/workflow.md +7 -0
- package/runtime/agents/docker-container-builder/capabilities/generate-dockerfile/capability.yaml +18 -0
- package/runtime/agents/docker-container-builder/capabilities/generate-dockerfile/decision-rules.md +6 -0
- package/runtime/agents/docker-container-builder/capabilities/generate-dockerfile/runner.py +32 -0
- package/runtime/agents/docker-container-builder/capabilities/generate-dockerfile/workflow.md +7 -0
- package/runtime/agents/docker-container-builder/capabilities/plan-image-build/capability.yaml +18 -0
- package/runtime/agents/docker-container-builder/capabilities/plan-image-build/decision-rules.md +6 -0
- package/runtime/agents/docker-container-builder/capabilities/plan-image-build/runner.py +32 -0
- package/runtime/agents/docker-container-builder/capabilities/plan-image-build/workflow.md +6 -0
- package/runtime/agents/docker-container-builder/capabilities/review-docker-security/capability.yaml +21 -0
- package/runtime/agents/docker-container-builder/capabilities/review-docker-security/decision-rules.md +6 -0
- package/runtime/agents/docker-container-builder/capabilities/review-docker-security/runner.py +43 -0
- package/runtime/agents/docker-container-builder/capabilities/review-docker-security/workflow.md +5 -0
- package/runtime/agents/docker-container-builder/infra/integrations/docker-container/docker_container_repository.py +837 -0
- package/runtime/agents/docker-container-builder/knowledge/context.md +21 -0
- package/runtime/agents/docker-container-builder/knowledge/policies.yaml +13 -0
- package/runtime/agents/docker-container-builder/knowledge/system.md +21 -0
- package/runtime/agents/docker-container-builder/templates/container-plan.md +4 -0
- package/runtime/agents/docker-container-builder/templates/container-review.md +4 -0
- package/runtime/agents/docker-container-builder/templates/docker-compose.md +5 -0
- package/runtime/agents/docker-container-builder/templates/docker-readme.md +3 -0
- package/runtime/agents/docker-container-builder/templates/dockerfile.md +5 -0
- package/runtime/agents/docker-container-builder/tests/test_runners.py +255 -0
- package/runtime/agents/drawio-diagram-builder/agent.yaml +11 -2
- package/runtime/agents/drawio-diagram-builder/capabilities/execute-diagram-delivery/capability.yaml +1 -1
- package/runtime/agents/drawio-diagram-builder/capabilities/read-azure-card-context/capability.yaml +1 -1
- package/runtime/agents/elasticsearch-log-analyzer/agent.yaml +14 -2
- package/runtime/agents/elasticsearch-log-analyzer/capabilities/analyze-service-errors/capability.yaml +14 -0
- package/runtime/agents/excel-workbook-builder/agent.yaml +10 -0
- package/runtime/agents/excel-workbook-builder/capabilities/create-template/capability.yaml +1 -1
- package/runtime/agents/excel-workbook-builder/capabilities/create-template/workflow.md +1 -1
- package/runtime/agents/excel-workbook-builder/capabilities/create-template-version/capability.yaml +1 -1
- package/runtime/agents/excel-workbook-builder/capabilities/generate-template-input-file/capability.yaml +1 -2
- package/runtime/agents/excel-workbook-builder/capabilities/refine-template/capability.yaml +1 -1
- package/runtime/agents/excel-workbook-builder/capabilities/register-template/capability.yaml +1 -2
- package/runtime/agents/excel-workbook-builder/capabilities/register-template/workflow.md +1 -1
- package/runtime/agents/execution-loop-builder/AGENTS.md +24 -0
- package/runtime/agents/execution-loop-builder/README.md +19 -0
- package/runtime/agents/execution-loop-builder/agent.yaml +49 -0
- package/runtime/agents/execution-loop-builder/capabilities/generate-loop-project-files/capability.yaml +20 -0
- package/runtime/agents/execution-loop-builder/capabilities/generate-loop-project-files/decision-rules.md +6 -0
- package/runtime/agents/execution-loop-builder/capabilities/generate-loop-project-files/runner.py +38 -0
- package/runtime/agents/execution-loop-builder/capabilities/generate-loop-project-files/workflow.md +7 -0
- package/runtime/agents/execution-loop-builder/capabilities/generate-loop-runner/capability.yaml +18 -0
- package/runtime/agents/execution-loop-builder/capabilities/generate-loop-runner/decision-rules.md +5 -0
- package/runtime/agents/execution-loop-builder/capabilities/generate-loop-runner/runner.py +32 -0
- package/runtime/agents/execution-loop-builder/capabilities/generate-loop-runner/workflow.md +6 -0
- package/runtime/agents/execution-loop-builder/capabilities/plan-execution-loop/capability.yaml +18 -0
- package/runtime/agents/execution-loop-builder/capabilities/plan-execution-loop/decision-rules.md +6 -0
- package/runtime/agents/execution-loop-builder/capabilities/plan-execution-loop/runner.py +32 -0
- package/runtime/agents/execution-loop-builder/capabilities/plan-execution-loop/workflow.md +6 -0
- package/runtime/agents/execution-loop-builder/capabilities/register-loop-task/capability.yaml +19 -0
- package/runtime/agents/execution-loop-builder/capabilities/register-loop-task/decision-rules.md +6 -0
- package/runtime/agents/execution-loop-builder/capabilities/register-loop-task/runner.py +36 -0
- package/runtime/agents/execution-loop-builder/capabilities/register-loop-task/workflow.md +6 -0
- package/runtime/agents/execution-loop-builder/capabilities/review-loop-safety/capability.yaml +19 -0
- package/runtime/agents/execution-loop-builder/capabilities/review-loop-safety/decision-rules.md +6 -0
- package/runtime/agents/execution-loop-builder/capabilities/review-loop-safety/runner.py +39 -0
- package/runtime/agents/execution-loop-builder/capabilities/review-loop-safety/workflow.md +5 -0
- package/runtime/agents/execution-loop-builder/infra/integrations/execution-loop/execution_loop_repository.py +608 -0
- package/runtime/agents/execution-loop-builder/knowledge/context.md +26 -0
- package/runtime/agents/execution-loop-builder/knowledge/policies.yaml +13 -0
- package/runtime/agents/execution-loop-builder/knowledge/system.md +19 -0
- package/runtime/agents/execution-loop-builder/templates/loop-plan.md +3 -0
- package/runtime/agents/execution-loop-builder/templates/loop-readme.md +3 -0
- package/runtime/agents/execution-loop-builder/templates/loop-review.md +3 -0
- package/runtime/agents/execution-loop-builder/templates/loop-runner.py +2 -0
- package/runtime/agents/execution-loop-builder/tests/test_runners.py +274 -0
- package/runtime/agents/execution-reviewer/AGENTS.md +8 -0
- package/runtime/agents/execution-reviewer/README.md +13 -0
- package/runtime/agents/execution-reviewer/agent.yaml +27 -0
- package/runtime/agents/execution-reviewer/capabilities/review-agent-result/capability.yaml +14 -0
- package/runtime/agents/execution-reviewer/capabilities/review-agent-result/decision-rules.md +6 -0
- package/runtime/agents/execution-reviewer/capabilities/review-agent-result/workflow.md +7 -0
- package/runtime/agents/execution-reviewer/capabilities/review-final-output/capability.yaml +14 -0
- package/runtime/agents/execution-reviewer/capabilities/review-final-output/decision-rules.md +6 -0
- package/runtime/agents/execution-reviewer/capabilities/review-final-output/workflow.md +7 -0
- package/runtime/agents/execution-reviewer/capabilities/review-plan/capability.yaml +14 -0
- package/runtime/agents/execution-reviewer/capabilities/review-plan/decision-rules.md +6 -0
- package/runtime/agents/execution-reviewer/capabilities/review-plan/workflow.md +7 -0
- package/runtime/agents/execution-reviewer/infra/README.md +4 -0
- package/runtime/agents/execution-reviewer/knowledge/context.md +6 -0
- package/runtime/agents/execution-reviewer/knowledge/system.md +18 -0
- package/runtime/agents/execution-reviewer/templates/README.md +4 -0
- package/runtime/agents/figma-ui-ux-product-designer/agent.yaml +17 -5
- package/runtime/agents/figma-ui-ux-product-designer/capabilities/analyze-product-context/capability.yaml +1 -1
- package/runtime/agents/figma-ui-ux-product-designer/capabilities/conduct-design-interview/capability.yaml +1 -1
- package/runtime/agents/figma-ui-ux-product-designer/capabilities/conduct-design-review-session/capability.yaml +1 -1
- package/runtime/agents/figma-ui-ux-product-designer/capabilities/generate-dev-handoff/capability.yaml +1 -1
- package/runtime/agents/figma-ui-ux-product-designer/capabilities/generate-user-journey-diagram/capability.yaml +1 -1
- package/runtime/agents/figma-ui-ux-product-designer/capabilities/ingest-design-source/capability.yaml +1 -1
- package/runtime/agents/figma-ui-ux-product-designer/capabilities/triage-design-feedback/capability.yaml +1 -1
- package/runtime/agents/generic-agent-builder/AGENTS.md +20 -0
- package/runtime/agents/generic-agent-builder/README.md +40 -0
- package/runtime/agents/generic-agent-builder/agent.yaml +43 -0
- package/runtime/agents/generic-agent-builder/capabilities/generate-agent-instructions/capability.yaml +18 -0
- package/runtime/agents/generic-agent-builder/capabilities/generate-agent-instructions/decision-rules.md +5 -0
- package/runtime/agents/generic-agent-builder/capabilities/generate-agent-instructions/runner.py +33 -0
- package/runtime/agents/generic-agent-builder/capabilities/generate-agent-instructions/workflow.md +6 -0
- package/runtime/agents/generic-agent-builder/capabilities/generate-project-agent-files/capability.yaml +20 -0
- package/runtime/agents/generic-agent-builder/capabilities/generate-project-agent-files/decision-rules.md +6 -0
- package/runtime/agents/generic-agent-builder/capabilities/generate-project-agent-files/runner.py +39 -0
- package/runtime/agents/generic-agent-builder/capabilities/generate-project-agent-files/workflow.md +7 -0
- package/runtime/agents/generic-agent-builder/capabilities/generate-skill/capability.yaml +18 -0
- package/runtime/agents/generic-agent-builder/capabilities/generate-skill/decision-rules.md +5 -0
- package/runtime/agents/generic-agent-builder/capabilities/generate-skill/runner.py +33 -0
- package/runtime/agents/generic-agent-builder/capabilities/generate-skill/workflow.md +5 -0
- package/runtime/agents/generic-agent-builder/capabilities/plan-generic-agent/capability.yaml +18 -0
- package/runtime/agents/generic-agent-builder/capabilities/plan-generic-agent/decision-rules.md +6 -0
- package/runtime/agents/generic-agent-builder/capabilities/plan-generic-agent/runner.py +33 -0
- package/runtime/agents/generic-agent-builder/capabilities/plan-generic-agent/workflow.md +6 -0
- package/runtime/agents/generic-agent-builder/capabilities/review-generic-agent/capability.yaml +20 -0
- package/runtime/agents/generic-agent-builder/capabilities/review-generic-agent/decision-rules.md +6 -0
- package/runtime/agents/generic-agent-builder/capabilities/review-generic-agent/runner.py +40 -0
- package/runtime/agents/generic-agent-builder/capabilities/review-generic-agent/workflow.md +7 -0
- package/runtime/agents/generic-agent-builder/infra/integrations/generic-agent/generic_agent_repository.py +445 -0
- package/runtime/agents/generic-agent-builder/knowledge/context.md +11 -0
- package/runtime/agents/generic-agent-builder/knowledge/policies.yaml +12 -0
- package/runtime/agents/generic-agent-builder/knowledge/system.md +17 -0
- package/runtime/agents/generic-agent-builder/templates/generic-agent-instructions.md +17 -0
- package/runtime/agents/generic-agent-builder/templates/generic-review-report.md +13 -0
- package/runtime/agents/generic-agent-builder/templates/generic-skill.md +14 -0
- package/runtime/agents/generic-agent-builder/tests/test_runners.py +220 -0
- package/runtime/agents/github-pr-reviewer/agent.yaml +17 -5
- package/runtime/agents/github-pr-reviewer/capabilities/create-review-automation/capability.yaml +1 -1
- package/runtime/agents/github-pr-reviewer/capabilities/inspect-pr/capability.yaml +1 -1
- package/runtime/agents/github-pr-reviewer/capabilities/list-review-requests/capability.yaml +1 -1
- package/runtime/agents/github-pr-reviewer/capabilities/review-pr-diff/capability.yaml +1 -1
- package/runtime/agents/knowledge-generator/agent.yaml +13 -3
- package/runtime/agents/knowledge-generator/capabilities/generate-knowledge/capability.yaml +1 -1
- package/runtime/agents/local-llm-operator/AGENTS.md +8 -0
- package/runtime/agents/local-llm-operator/README.md +12 -0
- package/runtime/agents/local-llm-operator/agent.yaml +28 -0
- package/runtime/agents/local-llm-operator/capabilities/delegate-operational-task/capability.yaml +14 -0
- package/runtime/agents/local-llm-operator/capabilities/delegate-operational-task/decision-rules.md +6 -0
- package/runtime/agents/local-llm-operator/capabilities/delegate-operational-task/workflow.md +7 -0
- package/runtime/agents/local-llm-operator/capabilities/inspect-local-models/capability.yaml +14 -0
- package/runtime/agents/local-llm-operator/capabilities/inspect-local-models/decision-rules.md +5 -0
- package/runtime/agents/local-llm-operator/capabilities/inspect-local-models/workflow.md +6 -0
- package/runtime/agents/local-llm-operator/capabilities/select-local-worker/capability.yaml +14 -0
- package/runtime/agents/local-llm-operator/capabilities/select-local-worker/decision-rules.md +6 -0
- package/runtime/agents/local-llm-operator/capabilities/select-local-worker/workflow.md +7 -0
- package/runtime/agents/local-llm-operator/infra/README.md +4 -0
- package/runtime/agents/local-llm-operator/knowledge/context.md +6 -0
- package/runtime/agents/local-llm-operator/knowledge/system.md +18 -0
- package/runtime/agents/local-llm-operator/templates/README.md +4 -0
- package/runtime/agents/n1-support-agent/agent.yaml +40 -1
- package/runtime/agents/n2-support-agent/agent.yaml +41 -2
- package/runtime/agents/n2-support-agent/knowledge/policies.yaml +2 -2
- package/runtime/agents/notification-operator/AGENTS.md +11 -0
- package/runtime/agents/notification-operator/README.md +15 -0
- package/runtime/agents/notification-operator/agent.yaml +43 -0
- package/runtime/agents/notification-operator/capabilities/configure-notification-channel/capability.yaml +19 -0
- package/runtime/agents/notification-operator/capabilities/configure-notification-channel/decision-rules.md +6 -0
- package/runtime/agents/notification-operator/capabilities/configure-notification-channel/runner.py +33 -0
- package/runtime/agents/notification-operator/capabilities/configure-notification-channel/workflow.md +6 -0
- package/runtime/agents/notification-operator/capabilities/format-task-completion-notification/capability.yaml +25 -0
- package/runtime/agents/notification-operator/capabilities/format-task-completion-notification/decision-rules.md +7 -0
- package/runtime/agents/notification-operator/capabilities/format-task-completion-notification/runner.py +49 -0
- package/runtime/agents/notification-operator/capabilities/format-task-completion-notification/workflow.md +6 -0
- package/runtime/agents/notification-operator/capabilities/send-task-completion-notification/capability.yaml +27 -0
- package/runtime/agents/notification-operator/capabilities/send-task-completion-notification/decision-rules.md +6 -0
- package/runtime/agents/notification-operator/capabilities/send-task-completion-notification/runner.py +68 -0
- package/runtime/agents/notification-operator/capabilities/send-task-completion-notification/workflow.md +7 -0
- package/runtime/agents/notification-operator/infra/README.md +6 -0
- package/runtime/agents/notification-operator/knowledge/context.md +10 -0
- package/runtime/agents/notification-operator/knowledge/policies.yaml +9 -0
- package/runtime/agents/notification-operator/knowledge/system.md +7 -0
- package/runtime/agents/notification-operator/templates/README.md +6 -0
- package/runtime/agents/notification-operator/tests/test_runners.py +108 -0
- package/runtime/agents/playwright-automation-builder/AGENTS.md +23 -0
- package/runtime/agents/playwright-automation-builder/README.md +43 -0
- package/runtime/agents/playwright-automation-builder/agent.yaml +48 -0
- package/runtime/agents/playwright-automation-builder/capabilities/generate-playwright-project-files/capability.yaml +20 -0
- package/runtime/agents/playwright-automation-builder/capabilities/generate-playwright-project-files/decision-rules.md +6 -0
- package/runtime/agents/playwright-automation-builder/capabilities/generate-playwright-project-files/runner.py +38 -0
- package/runtime/agents/playwright-automation-builder/capabilities/generate-playwright-project-files/workflow.md +6 -0
- package/runtime/agents/playwright-automation-builder/capabilities/generate-playwright-script/capability.yaml +18 -0
- package/runtime/agents/playwright-automation-builder/capabilities/generate-playwright-script/decision-rules.md +6 -0
- package/runtime/agents/playwright-automation-builder/capabilities/generate-playwright-script/runner.py +32 -0
- package/runtime/agents/playwright-automation-builder/capabilities/generate-playwright-script/workflow.md +6 -0
- package/runtime/agents/playwright-automation-builder/capabilities/plan-playwright-automation/capability.yaml +18 -0
- package/runtime/agents/playwright-automation-builder/capabilities/plan-playwright-automation/decision-rules.md +6 -0
- package/runtime/agents/playwright-automation-builder/capabilities/plan-playwright-automation/runner.py +32 -0
- package/runtime/agents/playwright-automation-builder/capabilities/plan-playwright-automation/workflow.md +6 -0
- package/runtime/agents/playwright-automation-builder/capabilities/review-playwright-artifacts/capability.yaml +19 -0
- package/runtime/agents/playwright-automation-builder/capabilities/review-playwright-artifacts/decision-rules.md +6 -0
- package/runtime/agents/playwright-automation-builder/capabilities/review-playwright-artifacts/runner.py +33 -0
- package/runtime/agents/playwright-automation-builder/capabilities/review-playwright-artifacts/workflow.md +6 -0
- package/runtime/agents/playwright-automation-builder/capabilities/run-playwright-check/capability.yaml +22 -0
- package/runtime/agents/playwright-automation-builder/capabilities/run-playwright-check/decision-rules.md +6 -0
- package/runtime/agents/playwright-automation-builder/capabilities/run-playwright-check/runner.py +40 -0
- package/runtime/agents/playwright-automation-builder/capabilities/run-playwright-check/workflow.md +6 -0
- package/runtime/agents/playwright-automation-builder/capabilities/wrap-playwright-as-capability/capability.yaml +22 -0
- package/runtime/agents/playwright-automation-builder/capabilities/wrap-playwright-as-capability/decision-rules.md +6 -0
- package/runtime/agents/playwright-automation-builder/capabilities/wrap-playwright-as-capability/runner.py +42 -0
- package/runtime/agents/playwright-automation-builder/capabilities/wrap-playwright-as-capability/workflow.md +6 -0
- package/runtime/agents/playwright-automation-builder/infra/integrations/playwright-automation/playwright_automation_repository.py +865 -0
- package/runtime/agents/playwright-automation-builder/knowledge/context.md +19 -0
- package/runtime/agents/playwright-automation-builder/knowledge/policies.yaml +25 -0
- package/runtime/agents/playwright-automation-builder/knowledge/system.md +19 -0
- package/runtime/agents/playwright-automation-builder/templates/capability-wrapper.md +4 -0
- package/runtime/agents/playwright-automation-builder/templates/playwright-automation.py +12 -0
- package/runtime/agents/playwright-automation-builder/templates/playwright-readme.md +13 -0
- package/runtime/agents/playwright-automation-builder/templates/playwright-review-report.md +9 -0
- package/runtime/agents/playwright-automation-builder/templates/playwright-test.py +2 -0
- package/runtime/agents/playwright-automation-builder/tests/test_runners.py +261 -0
- package/runtime/agents/postgres-data-analyzer/agent.yaml +13 -2
- package/runtime/agents/presentation-deck-builder/agent.yaml +14 -3
- package/runtime/agents/presentation-deck-builder/capabilities/create-template/capability.yaml +1 -1
- package/runtime/agents/presentation-deck-builder/capabilities/create-template-version/capability.yaml +1 -1
- package/runtime/agents/presentation-deck-builder/capabilities/generate-template-input-file/capability.yaml +1 -1
- package/runtime/agents/presentation-deck-builder/capabilities/refine-template/capability.yaml +1 -1
- package/runtime/agents/presentation-deck-builder/capabilities/register-template/capability.yaml +1 -1
- package/runtime/agents/presentation-deck-builder/knowledge/prompts/create-template.md +1 -1
- package/runtime/agents/presentation-deck-builder/knowledge/prompts/generate-template-input-file.md +1 -1
- package/runtime/agents/provider-configurator/AGENTS.md +8 -0
- package/runtime/agents/provider-configurator/README.md +5 -0
- package/runtime/agents/provider-configurator/agent.yaml +27 -0
- package/runtime/agents/provider-configurator/capabilities/collect-provider-credentials/capability.yaml +14 -0
- package/runtime/agents/provider-configurator/capabilities/collect-provider-credentials/decision-rules.md +6 -0
- package/runtime/agents/provider-configurator/capabilities/collect-provider-credentials/workflow.md +7 -0
- package/runtime/agents/provider-configurator/capabilities/configure-provider-source/capability.yaml +14 -0
- package/runtime/agents/provider-configurator/capabilities/configure-provider-source/decision-rules.md +6 -0
- package/runtime/agents/provider-configurator/capabilities/configure-provider-source/workflow.md +8 -0
- package/runtime/agents/provider-configurator/capabilities/validate-provider-readiness/capability.yaml +14 -0
- package/runtime/agents/provider-configurator/capabilities/validate-provider-readiness/decision-rules.md +6 -0
- package/runtime/agents/provider-configurator/capabilities/validate-provider-readiness/workflow.md +7 -0
- package/runtime/agents/provider-configurator/infra/README.md +5 -0
- package/runtime/agents/provider-configurator/knowledge/context.md +8 -0
- package/runtime/agents/provider-configurator/knowledge/system.md +19 -0
- package/runtime/agents/provider-configurator/templates/README.md +4 -0
- package/runtime/agents/pyautogui-automation-builder/AGENTS.md +32 -0
- package/runtime/agents/pyautogui-automation-builder/README.md +44 -0
- package/runtime/agents/pyautogui-automation-builder/agent.yaml +45 -0
- package/runtime/agents/pyautogui-automation-builder/capabilities/generate-pyautogui-project-files/capability.yaml +20 -0
- package/runtime/agents/pyautogui-automation-builder/capabilities/generate-pyautogui-project-files/decision-rules.md +6 -0
- package/runtime/agents/pyautogui-automation-builder/capabilities/generate-pyautogui-project-files/runner.py +39 -0
- package/runtime/agents/pyautogui-automation-builder/capabilities/generate-pyautogui-project-files/workflow.md +7 -0
- package/runtime/agents/pyautogui-automation-builder/capabilities/generate-pyautogui-script/capability.yaml +18 -0
- package/runtime/agents/pyautogui-automation-builder/capabilities/generate-pyautogui-script/decision-rules.md +7 -0
- package/runtime/agents/pyautogui-automation-builder/capabilities/generate-pyautogui-script/runner.py +33 -0
- package/runtime/agents/pyautogui-automation-builder/capabilities/generate-pyautogui-script/workflow.md +7 -0
- package/runtime/agents/pyautogui-automation-builder/capabilities/plan-desktop-automation/capability.yaml +18 -0
- package/runtime/agents/pyautogui-automation-builder/capabilities/plan-desktop-automation/decision-rules.md +8 -0
- package/runtime/agents/pyautogui-automation-builder/capabilities/plan-desktop-automation/runner.py +33 -0
- package/runtime/agents/pyautogui-automation-builder/capabilities/plan-desktop-automation/workflow.md +9 -0
- package/runtime/agents/pyautogui-automation-builder/capabilities/review-pyautogui-script/capability.yaml +20 -0
- package/runtime/agents/pyautogui-automation-builder/capabilities/review-pyautogui-script/decision-rules.md +8 -0
- package/runtime/agents/pyautogui-automation-builder/capabilities/review-pyautogui-script/runner.py +43 -0
- package/runtime/agents/pyautogui-automation-builder/capabilities/review-pyautogui-script/workflow.md +7 -0
- package/runtime/agents/pyautogui-automation-builder/capabilities/wrap-pyautogui-as-capability/capability.yaml +22 -0
- package/runtime/agents/pyautogui-automation-builder/capabilities/wrap-pyautogui-as-capability/decision-rules.md +6 -0
- package/runtime/agents/pyautogui-automation-builder/capabilities/wrap-pyautogui-as-capability/runner.py +43 -0
- package/runtime/agents/pyautogui-automation-builder/capabilities/wrap-pyautogui-as-capability/workflow.md +7 -0
- package/runtime/agents/pyautogui-automation-builder/infra/integrations/pyautogui-automation/pyautogui_automation_repository.py +856 -0
- package/runtime/agents/pyautogui-automation-builder/knowledge/context.md +17 -0
- package/runtime/agents/pyautogui-automation-builder/knowledge/policies.yaml +24 -0
- package/runtime/agents/pyautogui-automation-builder/knowledge/system.md +13 -0
- package/runtime/agents/pyautogui-automation-builder/templates/capability-wrapper.md +3 -0
- package/runtime/agents/pyautogui-automation-builder/templates/pyautogui-automation.py +12 -0
- package/runtime/agents/pyautogui-automation-builder/templates/pyautogui-readme.md +3 -0
- package/runtime/agents/pyautogui-automation-builder/templates/pyautogui-review-report.md +3 -0
- package/runtime/agents/pyautogui-automation-builder/templates/pyautogui-test.py +2 -0
- package/runtime/agents/pyautogui-automation-builder/tests/test_runners.py +376 -0
- package/runtime/agents/python-automation-builder/AGENTS.md +25 -0
- package/runtime/agents/python-automation-builder/README.md +43 -0
- package/runtime/agents/python-automation-builder/agent.yaml +45 -0
- package/runtime/agents/python-automation-builder/capabilities/generate-automation-project-files/capability.yaml +20 -0
- package/runtime/agents/python-automation-builder/capabilities/generate-automation-project-files/decision-rules.md +6 -0
- package/runtime/agents/python-automation-builder/capabilities/generate-automation-project-files/runner.py +39 -0
- package/runtime/agents/python-automation-builder/capabilities/generate-automation-project-files/workflow.md +7 -0
- package/runtime/agents/python-automation-builder/capabilities/generate-python-automation/capability.yaml +18 -0
- package/runtime/agents/python-automation-builder/capabilities/generate-python-automation/decision-rules.md +5 -0
- package/runtime/agents/python-automation-builder/capabilities/generate-python-automation/runner.py +33 -0
- package/runtime/agents/python-automation-builder/capabilities/generate-python-automation/workflow.md +5 -0
- package/runtime/agents/python-automation-builder/capabilities/plan-python-automation/capability.yaml +18 -0
- package/runtime/agents/python-automation-builder/capabilities/plan-python-automation/decision-rules.md +6 -0
- package/runtime/agents/python-automation-builder/capabilities/plan-python-automation/runner.py +33 -0
- package/runtime/agents/python-automation-builder/capabilities/plan-python-automation/workflow.md +6 -0
- package/runtime/agents/python-automation-builder/capabilities/review-python-automation/capability.yaml +20 -0
- package/runtime/agents/python-automation-builder/capabilities/review-python-automation/decision-rules.md +6 -0
- package/runtime/agents/python-automation-builder/capabilities/review-python-automation/runner.py +43 -0
- package/runtime/agents/python-automation-builder/capabilities/review-python-automation/workflow.md +5 -0
- package/runtime/agents/python-automation-builder/capabilities/wrap-automation-as-capability/capability.yaml +22 -0
- package/runtime/agents/python-automation-builder/capabilities/wrap-automation-as-capability/decision-rules.md +6 -0
- package/runtime/agents/python-automation-builder/capabilities/wrap-automation-as-capability/runner.py +43 -0
- package/runtime/agents/python-automation-builder/capabilities/wrap-automation-as-capability/workflow.md +6 -0
- package/runtime/agents/python-automation-builder/infra/integrations/python-automation/python_automation_repository.py +717 -0
- package/runtime/agents/python-automation-builder/knowledge/context.md +15 -0
- package/runtime/agents/python-automation-builder/knowledge/policies.yaml +12 -0
- package/runtime/agents/python-automation-builder/knowledge/system.md +19 -0
- package/runtime/agents/python-automation-builder/templates/automation-readme.md +13 -0
- package/runtime/agents/python-automation-builder/templates/automation-review-report.md +13 -0
- package/runtime/agents/python-automation-builder/templates/automation-test.py +9 -0
- package/runtime/agents/python-automation-builder/templates/automation.py +19 -0
- package/runtime/agents/python-automation-builder/templates/capability-wrapper.md +4 -0
- package/runtime/agents/python-automation-builder/tests/test_runners.py +292 -0
- package/runtime/agents/selenium-automation-builder/AGENTS.md +27 -0
- package/runtime/agents/selenium-automation-builder/README.md +40 -0
- package/runtime/agents/selenium-automation-builder/agent.yaml +45 -0
- package/runtime/agents/selenium-automation-builder/capabilities/generate-selenium-project-files/capability.yaml +20 -0
- package/runtime/agents/selenium-automation-builder/capabilities/generate-selenium-project-files/decision-rules.md +6 -0
- package/runtime/agents/selenium-automation-builder/capabilities/generate-selenium-project-files/runner.py +39 -0
- package/runtime/agents/selenium-automation-builder/capabilities/generate-selenium-project-files/workflow.md +7 -0
- package/runtime/agents/selenium-automation-builder/capabilities/generate-selenium-script/capability.yaml +18 -0
- package/runtime/agents/selenium-automation-builder/capabilities/generate-selenium-script/decision-rules.md +6 -0
- package/runtime/agents/selenium-automation-builder/capabilities/generate-selenium-script/runner.py +33 -0
- package/runtime/agents/selenium-automation-builder/capabilities/generate-selenium-script/workflow.md +6 -0
- package/runtime/agents/selenium-automation-builder/capabilities/plan-selenium-automation/capability.yaml +18 -0
- package/runtime/agents/selenium-automation-builder/capabilities/plan-selenium-automation/decision-rules.md +6 -0
- package/runtime/agents/selenium-automation-builder/capabilities/plan-selenium-automation/runner.py +33 -0
- package/runtime/agents/selenium-automation-builder/capabilities/plan-selenium-automation/workflow.md +6 -0
- package/runtime/agents/selenium-automation-builder/capabilities/review-selenium-script/capability.yaml +20 -0
- package/runtime/agents/selenium-automation-builder/capabilities/review-selenium-script/decision-rules.md +6 -0
- package/runtime/agents/selenium-automation-builder/capabilities/review-selenium-script/runner.py +40 -0
- package/runtime/agents/selenium-automation-builder/capabilities/review-selenium-script/workflow.md +6 -0
- package/runtime/agents/selenium-automation-builder/capabilities/wrap-selenium-as-capability/capability.yaml +22 -0
- package/runtime/agents/selenium-automation-builder/capabilities/wrap-selenium-as-capability/decision-rules.md +6 -0
- package/runtime/agents/selenium-automation-builder/capabilities/wrap-selenium-as-capability/runner.py +43 -0
- package/runtime/agents/selenium-automation-builder/capabilities/wrap-selenium-as-capability/workflow.md +6 -0
- package/runtime/agents/selenium-automation-builder/infra/integrations/selenium-automation/selenium_automation_repository.py +793 -0
- package/runtime/agents/selenium-automation-builder/knowledge/context.md +15 -0
- package/runtime/agents/selenium-automation-builder/knowledge/policies.yaml +17 -0
- package/runtime/agents/selenium-automation-builder/knowledge/system.md +18 -0
- package/runtime/agents/selenium-automation-builder/templates/capability-wrapper.md +4 -0
- package/runtime/agents/selenium-automation-builder/templates/selenium-automation.py +20 -0
- package/runtime/agents/selenium-automation-builder/templates/selenium-readme.md +13 -0
- package/runtime/agents/selenium-automation-builder/templates/selenium-review-report.md +13 -0
- package/runtime/agents/selenium-automation-builder/templates/selenium-test.py +9 -0
- package/runtime/agents/selenium-automation-builder/tests/test_runners.py +282 -0
- package/runtime/agents/software-specification-analyst/agent.yaml +17 -4
- package/runtime/agents/software-specification-analyst/capabilities/analyze-multiple-projects/capability.yaml +1 -1
- package/runtime/agents/software-specification-analyst/capabilities/analyze-project-context/capability.yaml +1 -1
- package/runtime/agents/software-specification-analyst/capabilities/conduct-requirements-interview/capability.yaml +1 -1
- package/runtime/agents/software-specification-analyst/capabilities/create-complete-spec/capability.yaml +1 -1
- package/runtime/agents/software-specification-analyst/capabilities/create-final-spec-from-analysis/capability.yaml +1 -1
- package/runtime/agents/software-specification-analyst/capabilities/create-functional-spec/capability.yaml +11 -0
- package/runtime/agents/software-specification-analyst/capabilities/create-technical-spec/capability.yaml +12 -0
- package/runtime/agents/software-specification-analyst/capabilities/refine-analysis-with-feedback/capability.yaml +1 -1
- package/runtime/agents/software-specification-analyst/capabilities/write-user-stories/capability.yaml +12 -0
- package/runtime/agents/sqlserver-change-operator/agent.yaml +12 -1
- package/runtime/agents/sqlserver-data-analyzer/agent.yaml +13 -2
- package/runtime/agents/supabase-project-analyst/AGENTS.md +29 -0
- package/runtime/agents/supabase-project-analyst/README.md +23 -0
- package/runtime/agents/supabase-project-analyst/agent.yaml +53 -0
- package/runtime/agents/supabase-project-analyst/capabilities/audit-auth-security/capability.yaml +18 -0
- package/runtime/agents/supabase-project-analyst/capabilities/audit-auth-security/decision-rules.md +5 -0
- package/runtime/agents/supabase-project-analyst/capabilities/audit-auth-security/runner.py +32 -0
- package/runtime/agents/supabase-project-analyst/capabilities/audit-auth-security/workflow.md +6 -0
- package/runtime/agents/supabase-project-analyst/capabilities/audit-rls-policies/capability.yaml +18 -0
- package/runtime/agents/supabase-project-analyst/capabilities/audit-rls-policies/decision-rules.md +6 -0
- package/runtime/agents/supabase-project-analyst/capabilities/audit-rls-policies/runner.py +32 -0
- package/runtime/agents/supabase-project-analyst/capabilities/audit-rls-policies/workflow.md +7 -0
- package/runtime/agents/supabase-project-analyst/capabilities/audit-storage-policies/capability.yaml +18 -0
- package/runtime/agents/supabase-project-analyst/capabilities/audit-storage-policies/decision-rules.md +5 -0
- package/runtime/agents/supabase-project-analyst/capabilities/audit-storage-policies/runner.py +32 -0
- package/runtime/agents/supabase-project-analyst/capabilities/audit-storage-policies/workflow.md +6 -0
- package/runtime/agents/supabase-project-analyst/capabilities/generate-supabase-report/capability.yaml +18 -0
- package/runtime/agents/supabase-project-analyst/capabilities/generate-supabase-report/decision-rules.md +6 -0
- package/runtime/agents/supabase-project-analyst/capabilities/generate-supabase-report/runner.py +32 -0
- package/runtime/agents/supabase-project-analyst/capabilities/generate-supabase-report/workflow.md +6 -0
- package/runtime/agents/supabase-project-analyst/capabilities/inspect-supabase-project/capability.yaml +19 -0
- package/runtime/agents/supabase-project-analyst/capabilities/inspect-supabase-project/decision-rules.md +6 -0
- package/runtime/agents/supabase-project-analyst/capabilities/inspect-supabase-project/runner.py +36 -0
- package/runtime/agents/supabase-project-analyst/capabilities/inspect-supabase-project/workflow.md +7 -0
- package/runtime/agents/supabase-project-analyst/capabilities/plan-supabase-fix/capability.yaml +18 -0
- package/runtime/agents/supabase-project-analyst/capabilities/plan-supabase-fix/decision-rules.md +6 -0
- package/runtime/agents/supabase-project-analyst/capabilities/plan-supabase-fix/runner.py +32 -0
- package/runtime/agents/supabase-project-analyst/capabilities/plan-supabase-fix/workflow.md +6 -0
- package/runtime/agents/supabase-project-analyst/capabilities/review-migrations/capability.yaml +18 -0
- package/runtime/agents/supabase-project-analyst/capabilities/review-migrations/decision-rules.md +6 -0
- package/runtime/agents/supabase-project-analyst/capabilities/review-migrations/runner.py +32 -0
- package/runtime/agents/supabase-project-analyst/capabilities/review-migrations/workflow.md +5 -0
- package/runtime/agents/supabase-project-analyst/infra/integrations/supabase-project/supabase_project_repository.py +589 -0
- package/runtime/agents/supabase-project-analyst/knowledge/context.md +11 -0
- package/runtime/agents/supabase-project-analyst/knowledge/policies.yaml +24 -0
- package/runtime/agents/supabase-project-analyst/knowledge/system.md +10 -0
- package/runtime/agents/supabase-project-analyst/templates/supabase-audit.md +3 -0
- package/runtime/agents/supabase-project-analyst/templates/supabase-fix-plan.md +3 -0
- package/runtime/agents/supabase-project-analyst/templates/supabase-inspection.md +3 -0
- package/runtime/agents/supabase-project-analyst/templates/supabase-report.md +3 -0
- package/runtime/agents/supabase-project-analyst/tests/test_runners.py +239 -0
- package/runtime/agents/task-orchestrator/AGENTS.md +8 -0
- package/runtime/agents/task-orchestrator/README.md +7 -0
- package/runtime/agents/task-orchestrator/agent.yaml +53 -0
- package/runtime/agents/task-orchestrator/capabilities/coordinate-execution/capability.yaml +15 -0
- package/runtime/agents/task-orchestrator/capabilities/coordinate-execution/decision-rules.md +6 -0
- package/runtime/agents/task-orchestrator/capabilities/coordinate-execution/workflow.md +7 -0
- package/runtime/agents/task-orchestrator/capabilities/plan-task/capability.yaml +14 -0
- package/runtime/agents/task-orchestrator/capabilities/plan-task/decision-rules.md +6 -0
- package/runtime/agents/task-orchestrator/capabilities/plan-task/workflow.md +8 -0
- package/runtime/agents/task-orchestrator/capabilities/select-specialists/capability.yaml +14 -0
- package/runtime/agents/task-orchestrator/capabilities/select-specialists/decision-rules.md +6 -0
- package/runtime/agents/task-orchestrator/capabilities/select-specialists/workflow.md +7 -0
- package/runtime/agents/task-orchestrator/infra/README.md +5 -0
- package/runtime/agents/task-orchestrator/knowledge/context.md +9 -0
- package/runtime/agents/task-orchestrator/knowledge/system.md +20 -0
- package/runtime/agents/task-orchestrator/templates/README.md +4 -0
- package/runtime/agents/technical-integration-analyst/agent.yaml +15 -2
- package/runtime/agents/topdesk-orchestrator/agent.yaml +10 -2
- package/runtime/cli/README.md +76 -11
- package/runtime/cli/aikit/__init__.py +1 -1
- package/runtime/cli/aikit/acceptance.py +166 -0
- package/runtime/cli/aikit/agent_executor.py +89 -0
- package/runtime/cli/aikit/agent_registry.py +319 -0
- package/runtime/cli/aikit/app_home.py +87 -2
- package/runtime/cli/aikit/architecture.py +84 -0
- package/runtime/cli/aikit/audit.py +216 -3
- package/runtime/cli/aikit/autonomy.py +237 -0
- package/runtime/cli/aikit/capability_runtime.py +522 -0
- package/runtime/cli/aikit/catalog.py +246 -0
- package/runtime/cli/aikit/cli_dispatch.py +1078 -0
- package/runtime/cli/aikit/cli_parser.py +409 -0
- package/runtime/cli/aikit/collaboration.py +359 -0
- package/runtime/cli/aikit/configuration_orchestrator.py +52 -26
- package/runtime/cli/aikit/contribution.py +105 -0
- package/runtime/cli/aikit/control_router.py +298 -0
- package/runtime/cli/aikit/core/__init__.py +1 -0
- package/runtime/cli/aikit/core/capability_contract.py +112 -0
- package/runtime/cli/aikit/core/requests.py +69 -0
- package/runtime/cli/aikit/core/runtime.py +64 -0
- package/runtime/cli/aikit/decision_store.py +17 -0
- package/runtime/cli/aikit/diagnostics.py +10 -3
- package/runtime/cli/aikit/doctor_runtime.py +79 -0
- package/runtime/cli/aikit/errors.py +7 -0
- package/runtime/cli/aikit/eval.py +158 -0
- package/runtime/cli/aikit/execution_reviewer.py +195 -0
- package/runtime/cli/aikit/extensions.py +140 -0
- package/runtime/cli/aikit/fallback.py +1 -0
- package/runtime/cli/aikit/github_pr.py +23 -0
- package/runtime/cli/aikit/guardrails.py +25 -10
- package/runtime/cli/aikit/human_output.py +1026 -0
- package/runtime/cli/aikit/impact_map.py +294 -0
- package/runtime/cli/aikit/install.py +4 -3
- package/runtime/cli/aikit/interactive_wizard.py +79 -0
- package/runtime/cli/aikit/local_llm_operator.py +146 -0
- package/runtime/cli/aikit/lock.py +4 -1
- package/runtime/cli/aikit/main.py +11 -2561
- package/runtime/cli/aikit/mcp_manifest.py +229 -0
- package/runtime/cli/aikit/mcp_server.py +132 -0
- package/runtime/cli/aikit/mcp_tools.py +262 -0
- package/runtime/cli/aikit/mini_brain.py +227 -0
- package/runtime/cli/aikit/model_router.py +193 -20
- package/runtime/cli/aikit/module_controller.py +335 -0
- package/runtime/cli/aikit/natural_prompt_runtime.py +538 -0
- package/runtime/cli/aikit/notifications.py +716 -2
- package/runtime/cli/aikit/ollama.py +1 -0
- package/runtime/cli/aikit/orchestrator.py +1225 -0
- package/runtime/cli/aikit/output.py +63 -2
- package/runtime/cli/aikit/permissions.py +14 -4
- package/runtime/cli/aikit/prompt_injection.py +57 -0
- package/runtime/cli/aikit/review_gate.py +38 -6
- package/runtime/cli/aikit/roadmap.py +195 -0
- package/runtime/cli/aikit/roadmap_cli.py +70 -0
- package/runtime/cli/aikit/router.py +41 -12
- package/runtime/cli/aikit/router_explain.py +152 -0
- package/runtime/cli/aikit/runtime_paths.py +11 -0
- package/runtime/cli/aikit/secrets.py +113 -0
- package/runtime/cli/aikit/sessions.py +125 -2
- package/runtime/cli/aikit/setup_wizard_payload.py +32 -0
- package/runtime/cli/aikit/sources.py +298 -46
- package/runtime/cli/aikit/tasks.py +449 -21
- package/runtime/cli/aikit/wizard_state.py +517 -0
- package/runtime/cli/aikit/workflows.py +115 -0
- package/runtime/cli/aikit/write_policy.py +108 -0
- package/runtime/plugins/claude-code-ai-devkit/README.md +17 -0
- package/runtime/plugins/claude-code-ai-devkit/agents/README.md +29 -2
- package/runtime/plugins/claude-code-ai-devkit/agents/agent-devkit-db-analyst.md +44 -0
- package/runtime/plugins/claude-code-ai-devkit/agents/agent-devkit-execution-reviewer.md +38 -0
- package/runtime/plugins/claude-code-ai-devkit/agents/agent-devkit-pr-reviewer.md +42 -0
- package/runtime/plugins/claude-code-ai-devkit/agents/agent-devkit-repo-explorer.md +40 -0
- package/runtime/plugins/claude-code-ai-devkit/agents/agent-devkit-support-triage.md +43 -0
- package/runtime/plugins/claude-code-ai-devkit/plugin.json +1 -1
- package/runtime/plugins/claude-code-ai-devkit/skills/ai-devkit-router/SKILL.md +16 -0
- package/runtime/plugins/claude-skill-ai-devkit/ai-devkit/SKILL.md +1 -0
- package/runtime/plugins/claude-skill-ai-devkit/ai-devkit/references/subagents.md +21 -0
- package/runtime/plugins/claude-skill-ai-devkit/plugin.json +1 -1
- package/runtime/providers/azure-devops.yaml +9 -0
- package/runtime/providers/github.yaml +4 -0
- package/runtime/providers/local-notification.yaml +5 -2
- package/runtime/providers/local-scheduler.yaml +1 -1
- package/runtime/providers/supabase.yaml +46 -0
- package/runtime/scripts/release-catalog-snapshot.json +543 -0
- package/runtime/scripts/release-gate.py +141 -1
- package/runtime/scripts/validate-repo.py +312 -0
- package/runtime/vendor/skills/napkin/napkin.md +15 -9
|
@@ -0,0 +1,856 @@
|
|
|
1
|
+
"""Repository for deterministic PyAutoGUI desktop automation generation."""
|
|
2
|
+
|
|
3
|
+
from __future__ import annotations
|
|
4
|
+
|
|
5
|
+
import json
|
|
6
|
+
import re
|
|
7
|
+
from pathlib import Path
|
|
8
|
+
from typing import Any
|
|
9
|
+
|
|
10
|
+
import yaml
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
REQUIRED_SPEC_FIELDS = (
|
|
14
|
+
"automation_name",
|
|
15
|
+
"purpose",
|
|
16
|
+
"target_app",
|
|
17
|
+
"target_window",
|
|
18
|
+
"platform",
|
|
19
|
+
"steps",
|
|
20
|
+
"screen_preconditions",
|
|
21
|
+
"verification_strategy",
|
|
22
|
+
"safer_alternatives_checked",
|
|
23
|
+
"user_accepts_visual_risk",
|
|
24
|
+
"side_effects",
|
|
25
|
+
"coordinates_policy",
|
|
26
|
+
)
|
|
27
|
+
PLATFORMS = {"macos", "windows", "linux", "cross-platform"}
|
|
28
|
+
SIDE_EFFECTS = {"read-only", "navigation", "data-entry", "external-write", "destructive"}
|
|
29
|
+
COORDINATES_POLICIES = {"relative", "image-recognition", "window-relative", "absolute-last-resort"}
|
|
30
|
+
SAFER_ALTERNATIVES = {
|
|
31
|
+
"api",
|
|
32
|
+
"cli",
|
|
33
|
+
"mcp",
|
|
34
|
+
"playwright",
|
|
35
|
+
"selenium",
|
|
36
|
+
"applescript",
|
|
37
|
+
"windows-ui-automation",
|
|
38
|
+
}
|
|
39
|
+
UNAVAILABLE_MARKERS = {"none", "not-available", "unavailable", "checked-none-available"}
|
|
40
|
+
FORBIDDEN_MARKER_PATTERN = re.compile(r"\b(?:SECRET|TOKEN|PASSWORD|API_KEY|PRIVATE_KEY)\b\s*[:=]")
|
|
41
|
+
COORDINATE_CALL_PATTERN = re.compile(r"\b(?:click|moveTo|dragTo)\s*\(\s*\d+\s*,\s*\d+")
|
|
42
|
+
KEBAB_CASE = re.compile(r"^[a-z0-9]+(?:-[a-z0-9]+)*$")
|
|
43
|
+
SLUG_PATTERN = re.compile(r"[^a-z0-9]+")
|
|
44
|
+
|
|
45
|
+
|
|
46
|
+
class PyAutoGUIAutomationError(RuntimeError):
|
|
47
|
+
"""Raised when the builder cannot read or process an input spec."""
|
|
48
|
+
|
|
49
|
+
|
|
50
|
+
class PyAutoGUIAutomationRepository:
|
|
51
|
+
def __init__(self, root: Path | None = None) -> None:
|
|
52
|
+
self.root = root or Path(__file__).resolve().parents[5]
|
|
53
|
+
|
|
54
|
+
def plan_desktop_automation(self, *, spec_path: Path) -> dict[str, Any]:
|
|
55
|
+
spec = self.load_spec(spec_path)
|
|
56
|
+
spec_result = self.validate_spec(spec)
|
|
57
|
+
if spec_result["status"] != "ok":
|
|
58
|
+
return spec_result
|
|
59
|
+
|
|
60
|
+
normalized = self.normalize_spec(spec)
|
|
61
|
+
blocked = self.detect_forbidden_content(normalized)
|
|
62
|
+
if blocked:
|
|
63
|
+
return blocked
|
|
64
|
+
|
|
65
|
+
alternative_result = self.validate_safer_alternatives(normalized["safer_alternatives_checked"])
|
|
66
|
+
if alternative_result["status"] != "ok":
|
|
67
|
+
return alternative_result
|
|
68
|
+
|
|
69
|
+
risk_result = self.validate_visual_risk(normalized)
|
|
70
|
+
if risk_result["status"] != "ok":
|
|
71
|
+
return risk_result
|
|
72
|
+
|
|
73
|
+
files = self.build_pyautogui_files(normalized)
|
|
74
|
+
return {
|
|
75
|
+
"kind": "desktop-automation-plan",
|
|
76
|
+
"status": "ok",
|
|
77
|
+
"automation": self.automation_summary(normalized),
|
|
78
|
+
"platform": normalized["platform"],
|
|
79
|
+
"side_effects": normalized["side_effects"],
|
|
80
|
+
"coordinates_policy": normalized["coordinates_policy"],
|
|
81
|
+
"write_policy": "read_only",
|
|
82
|
+
"planned_artifacts": self.public_file_plan(files),
|
|
83
|
+
"guardrails": self.side_effect_guardrails(normalized["side_effects"]),
|
|
84
|
+
"questions": self.open_questions(normalized),
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
def generate_pyautogui_script(self, *, spec_path: Path) -> dict[str, Any]:
|
|
88
|
+
plan = self.plan_desktop_automation(spec_path=spec_path)
|
|
89
|
+
if plan["status"] != "ok":
|
|
90
|
+
return plan
|
|
91
|
+
|
|
92
|
+
spec = self.normalize_spec(self.load_spec(spec_path))
|
|
93
|
+
content = self.render_pyautogui_script(spec)
|
|
94
|
+
return {
|
|
95
|
+
"kind": "pyautogui-script",
|
|
96
|
+
"status": "ok",
|
|
97
|
+
"automation": self.automation_summary(spec),
|
|
98
|
+
"artifact": "pyautogui_automation.py",
|
|
99
|
+
"content": content,
|
|
100
|
+
"bytes": len(content.encode("utf-8")),
|
|
101
|
+
"write_policy": "output_only",
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
def generate_pyautogui_project_files(
|
|
105
|
+
self,
|
|
106
|
+
*,
|
|
107
|
+
spec_path: Path,
|
|
108
|
+
execute: bool = False,
|
|
109
|
+
allow_overwrite: bool = False,
|
|
110
|
+
) -> dict[str, Any]:
|
|
111
|
+
plan = self.plan_desktop_automation(spec_path=spec_path)
|
|
112
|
+
if plan["status"] != "ok":
|
|
113
|
+
return plan
|
|
114
|
+
|
|
115
|
+
spec = self.normalize_spec(self.load_spec(spec_path))
|
|
116
|
+
target_project = spec.get("target_project")
|
|
117
|
+
if not target_project:
|
|
118
|
+
return {
|
|
119
|
+
"kind": "pyautogui-project-files",
|
|
120
|
+
"status": "needs-input",
|
|
121
|
+
"missing_fields": ["target_project"],
|
|
122
|
+
"questions": ["Qual e o caminho do projeto destino?"],
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
target_root = Path(str(target_project)).expanduser().resolve()
|
|
126
|
+
files = self.build_pyautogui_files(spec, base_dir=spec["automation_slug"])
|
|
127
|
+
return self.write_or_plan_files(
|
|
128
|
+
kind="pyautogui-project-files",
|
|
129
|
+
files=files,
|
|
130
|
+
target_root=target_root,
|
|
131
|
+
execute=execute,
|
|
132
|
+
allow_overwrite=allow_overwrite,
|
|
133
|
+
extra={"automation": self.automation_summary(spec), "side_effects": spec["side_effects"]},
|
|
134
|
+
)
|
|
135
|
+
|
|
136
|
+
def review_pyautogui_script(self, *, text: str, side_effects: str = "navigation") -> dict[str, Any]:
|
|
137
|
+
normalized_side_effects = str(side_effects or "navigation").strip()
|
|
138
|
+
findings: list[str] = []
|
|
139
|
+
if not text.strip():
|
|
140
|
+
findings.append("pyautogui script is empty")
|
|
141
|
+
lower_text = text.lower()
|
|
142
|
+
if "pyautogui.failsafe = true" not in lower_text and ".failsafe = true" not in lower_text:
|
|
143
|
+
findings.append("pyautogui script must set pyautogui.FAILSAFE = True")
|
|
144
|
+
for flag in ("--dry-run", "--execute", "--confirm", "--screenshot-dir", "--timeout", "--abort-file"):
|
|
145
|
+
if flag not in text:
|
|
146
|
+
findings.append(f"pyautogui script must expose {flag}")
|
|
147
|
+
if "screenshot" not in lower_text:
|
|
148
|
+
findings.append("pyautogui script must capture screenshots")
|
|
149
|
+
if "before.png" not in lower_text or "after.png" not in lower_text or "error.png" not in lower_text:
|
|
150
|
+
findings.append("pyautogui script should capture before, after and error screenshots")
|
|
151
|
+
if "target_window" not in lower_text and "--target-window" not in text:
|
|
152
|
+
findings.append("pyautogui script should validate target window or expose --target-window")
|
|
153
|
+
if normalized_side_effects != "read-only" and "--confirm" not in text:
|
|
154
|
+
findings.append("pyautogui script with side effects must require --confirm")
|
|
155
|
+
if "return 0" not in text and "sys.exit(0)" not in text:
|
|
156
|
+
findings.append("pyautogui script should return a predictable success exit code")
|
|
157
|
+
if self.detect_text_forbidden_content(text):
|
|
158
|
+
findings.append("pyautogui script contains a secret marker")
|
|
159
|
+
if COORDINATE_CALL_PATTERN.search(text) and "--region" not in text and "region" not in lower_text:
|
|
160
|
+
findings.append("absolute coordinates require region/window-relative guardrails")
|
|
161
|
+
|
|
162
|
+
valid = not findings
|
|
163
|
+
return {
|
|
164
|
+
"kind": "pyautogui-review",
|
|
165
|
+
"status": "ok" if valid else "failed",
|
|
166
|
+
"valid": valid,
|
|
167
|
+
"side_effects": normalized_side_effects,
|
|
168
|
+
"findings": findings,
|
|
169
|
+
"write_policy": "read_only",
|
|
170
|
+
}
|
|
171
|
+
|
|
172
|
+
def wrap_pyautogui_as_capability(
|
|
173
|
+
self,
|
|
174
|
+
*,
|
|
175
|
+
spec_path: Path,
|
|
176
|
+
agent_id: str,
|
|
177
|
+
capability_id: str,
|
|
178
|
+
execute: bool = False,
|
|
179
|
+
allow_overwrite: bool = False,
|
|
180
|
+
) -> dict[str, Any]:
|
|
181
|
+
plan = self.plan_desktop_automation(spec_path=spec_path)
|
|
182
|
+
if plan["status"] != "ok":
|
|
183
|
+
return plan
|
|
184
|
+
|
|
185
|
+
if not KEBAB_CASE.match(agent_id):
|
|
186
|
+
return {
|
|
187
|
+
"kind": "pyautogui-capability-wrapper",
|
|
188
|
+
"status": "blocked",
|
|
189
|
+
"reason": "invalid_agent_id",
|
|
190
|
+
"risks": ["agent-id must be kebab-case."],
|
|
191
|
+
}
|
|
192
|
+
if not KEBAB_CASE.match(capability_id):
|
|
193
|
+
return {
|
|
194
|
+
"kind": "pyautogui-capability-wrapper",
|
|
195
|
+
"status": "blocked",
|
|
196
|
+
"reason": "invalid_capability_id",
|
|
197
|
+
"risks": ["capability-id must be kebab-case."],
|
|
198
|
+
}
|
|
199
|
+
|
|
200
|
+
spec = self.normalize_spec(self.load_spec(spec_path))
|
|
201
|
+
target_project = spec.get("target_project")
|
|
202
|
+
if not target_project:
|
|
203
|
+
return {
|
|
204
|
+
"kind": "pyautogui-capability-wrapper",
|
|
205
|
+
"status": "needs-input",
|
|
206
|
+
"missing_fields": ["target_project"],
|
|
207
|
+
"questions": ["Qual e o caminho do projeto destino?"],
|
|
208
|
+
}
|
|
209
|
+
|
|
210
|
+
target_root = Path(str(target_project)).expanduser().resolve()
|
|
211
|
+
files = self.build_capability_wrapper_files(spec, agent_id=agent_id, capability_id=capability_id)
|
|
212
|
+
return self.write_or_plan_files(
|
|
213
|
+
kind="pyautogui-capability-wrapper",
|
|
214
|
+
files=files,
|
|
215
|
+
target_root=target_root,
|
|
216
|
+
execute=execute,
|
|
217
|
+
allow_overwrite=allow_overwrite,
|
|
218
|
+
extra={
|
|
219
|
+
"agent_id": agent_id,
|
|
220
|
+
"capability_id": capability_id,
|
|
221
|
+
"capability_write_policy": self.capability_write_policy(spec["side_effects"]),
|
|
222
|
+
},
|
|
223
|
+
)
|
|
224
|
+
|
|
225
|
+
def load_spec(self, path: Path) -> dict[str, Any]:
|
|
226
|
+
if not path.exists():
|
|
227
|
+
raise PyAutoGUIAutomationError(f"spec not found: {path}")
|
|
228
|
+
text = path.read_text(encoding="utf-8")
|
|
229
|
+
if path.suffix.lower() == ".json":
|
|
230
|
+
payload = json.loads(text)
|
|
231
|
+
else:
|
|
232
|
+
payload = yaml.safe_load(text) or {}
|
|
233
|
+
if not isinstance(payload, dict):
|
|
234
|
+
raise PyAutoGUIAutomationError("spec must be a mapping")
|
|
235
|
+
return payload
|
|
236
|
+
|
|
237
|
+
def validate_spec(self, spec: dict[str, Any]) -> dict[str, Any]:
|
|
238
|
+
missing = [
|
|
239
|
+
field
|
|
240
|
+
for field in REQUIRED_SPEC_FIELDS
|
|
241
|
+
if field not in spec or spec.get(field) is None or spec.get(field) == ""
|
|
242
|
+
]
|
|
243
|
+
if missing:
|
|
244
|
+
return {
|
|
245
|
+
"kind": "desktop-automation-plan",
|
|
246
|
+
"status": "needs-input",
|
|
247
|
+
"missing_fields": missing,
|
|
248
|
+
"questions": [self.question_for_missing_field(field) for field in missing],
|
|
249
|
+
}
|
|
250
|
+
for field in ("steps", "screen_preconditions", "quality_gates", "safer_alternatives_checked"):
|
|
251
|
+
if spec.get(field) is not None and not isinstance(spec[field], list):
|
|
252
|
+
return {
|
|
253
|
+
"kind": "desktop-automation-plan",
|
|
254
|
+
"status": "blocked",
|
|
255
|
+
"reason": "invalid_list_field",
|
|
256
|
+
"field": field,
|
|
257
|
+
"risks": [f"{field} must be a list when provided."],
|
|
258
|
+
}
|
|
259
|
+
platform = str(spec.get("platform") or "").strip().lower()
|
|
260
|
+
if platform not in PLATFORMS:
|
|
261
|
+
return {
|
|
262
|
+
"kind": "desktop-automation-plan",
|
|
263
|
+
"status": "blocked",
|
|
264
|
+
"reason": "unsupported_platform",
|
|
265
|
+
"supported_values": sorted(PLATFORMS),
|
|
266
|
+
}
|
|
267
|
+
side_effects = str(spec.get("side_effects") or "").strip()
|
|
268
|
+
if side_effects not in SIDE_EFFECTS:
|
|
269
|
+
return {
|
|
270
|
+
"kind": "desktop-automation-plan",
|
|
271
|
+
"status": "blocked",
|
|
272
|
+
"reason": "invalid_side_effects",
|
|
273
|
+
"supported_values": sorted(SIDE_EFFECTS),
|
|
274
|
+
}
|
|
275
|
+
coordinates_policy = str(spec.get("coordinates_policy") or "").strip()
|
|
276
|
+
if coordinates_policy not in COORDINATES_POLICIES:
|
|
277
|
+
return {
|
|
278
|
+
"kind": "desktop-automation-plan",
|
|
279
|
+
"status": "blocked",
|
|
280
|
+
"reason": "invalid_coordinates_policy",
|
|
281
|
+
"supported_values": sorted(COORDINATES_POLICIES),
|
|
282
|
+
}
|
|
283
|
+
return {"status": "ok"}
|
|
284
|
+
|
|
285
|
+
def normalize_spec(self, spec: dict[str, Any]) -> dict[str, Any]:
|
|
286
|
+
normalized = dict(spec)
|
|
287
|
+
normalized["automation_name"] = " ".join(str(spec["automation_name"]).split())
|
|
288
|
+
normalized["automation_slug"] = self.slugify(normalized["automation_name"])
|
|
289
|
+
normalized["purpose"] = " ".join(str(spec["purpose"]).split())
|
|
290
|
+
normalized["target_app"] = " ".join(str(spec["target_app"]).split())
|
|
291
|
+
normalized["target_window"] = " ".join(str(spec["target_window"]).split())
|
|
292
|
+
normalized["platform"] = str(spec["platform"]).strip().lower()
|
|
293
|
+
normalized["side_effects"] = str(spec["side_effects"]).strip()
|
|
294
|
+
normalized["coordinates_policy"] = str(spec["coordinates_policy"]).strip()
|
|
295
|
+
normalized["steps"] = [str(item).strip() for item in spec.get("steps") or []]
|
|
296
|
+
normalized["screen_preconditions"] = [str(item).strip() for item in spec.get("screen_preconditions") or []]
|
|
297
|
+
normalized["quality_gates"] = [str(item).strip() for item in spec.get("quality_gates") or []]
|
|
298
|
+
normalized["safer_alternatives_checked"] = [
|
|
299
|
+
str(item).strip().lower() for item in spec.get("safer_alternatives_checked") or []
|
|
300
|
+
]
|
|
301
|
+
normalized["verification_strategy"] = " ".join(str(spec["verification_strategy"]).split())
|
|
302
|
+
normalized["user_accepts_visual_risk"] = self.as_bool(spec["user_accepts_visual_risk"])
|
|
303
|
+
normalized["absolute_coordinate_justification"] = " ".join(
|
|
304
|
+
str(spec.get("absolute_coordinate_justification") or "").split()
|
|
305
|
+
)
|
|
306
|
+
if spec.get("target_project"):
|
|
307
|
+
normalized["target_project"] = str(spec["target_project"]).strip()
|
|
308
|
+
return normalized
|
|
309
|
+
|
|
310
|
+
def validate_safer_alternatives(self, checked: list[str]) -> dict[str, Any]:
|
|
311
|
+
if not checked:
|
|
312
|
+
return {
|
|
313
|
+
"kind": "desktop-automation-plan",
|
|
314
|
+
"status": "needs-safer-alternative-review",
|
|
315
|
+
"reason": "safer_alternatives_not_checked",
|
|
316
|
+
"risks": ["PyAutoGUI cannot be selected before safer alternatives are reviewed."],
|
|
317
|
+
"next_steps": ["Check API, CLI, MCP, browser automation and native OS automation first."],
|
|
318
|
+
}
|
|
319
|
+
available = sorted({item for item in checked if item in SAFER_ALTERNATIVES})
|
|
320
|
+
if available:
|
|
321
|
+
return {
|
|
322
|
+
"kind": "desktop-automation-plan",
|
|
323
|
+
"status": "needs-safer-alternative-review",
|
|
324
|
+
"reason": "safer_alternative_available",
|
|
325
|
+
"available_alternatives": available,
|
|
326
|
+
"risks": ["PyAutoGUI should not be used while a safer automation path is available."],
|
|
327
|
+
}
|
|
328
|
+
unknown = sorted({item for item in checked if item not in UNAVAILABLE_MARKERS})
|
|
329
|
+
if unknown:
|
|
330
|
+
return {
|
|
331
|
+
"kind": "desktop-automation-plan",
|
|
332
|
+
"status": "blocked",
|
|
333
|
+
"reason": "unsupported_safer_alternative_marker",
|
|
334
|
+
"unsupported_values": unknown,
|
|
335
|
+
"supported_unavailable_markers": sorted(UNAVAILABLE_MARKERS),
|
|
336
|
+
}
|
|
337
|
+
return {"status": "ok"}
|
|
338
|
+
|
|
339
|
+
def validate_visual_risk(self, spec: dict[str, Any]) -> dict[str, Any]:
|
|
340
|
+
if not spec["user_accepts_visual_risk"]:
|
|
341
|
+
return {
|
|
342
|
+
"kind": "desktop-automation-plan",
|
|
343
|
+
"status": "needs-input",
|
|
344
|
+
"missing_fields": ["user_accepts_visual_risk"],
|
|
345
|
+
"questions": ["O usuario aceita explicitamente o risco de automacao visual PyAutoGUI?"],
|
|
346
|
+
}
|
|
347
|
+
if spec["side_effects"] == "destructive":
|
|
348
|
+
return {
|
|
349
|
+
"kind": "desktop-automation-plan",
|
|
350
|
+
"status": "blocked",
|
|
351
|
+
"reason": "destructive_desktop_automation_blocked",
|
|
352
|
+
"risks": ["Destructive desktop automation is blocked by default for PyAutoGUI."],
|
|
353
|
+
}
|
|
354
|
+
if spec["coordinates_policy"] == "absolute-last-resort" and not spec["absolute_coordinate_justification"]:
|
|
355
|
+
return {
|
|
356
|
+
"kind": "desktop-automation-plan",
|
|
357
|
+
"status": "blocked",
|
|
358
|
+
"reason": "absolute_coordinates_need_justification",
|
|
359
|
+
"risks": ["Absolute coordinates require a last-resort justification and region guardrails."],
|
|
360
|
+
}
|
|
361
|
+
return {"status": "ok"}
|
|
362
|
+
|
|
363
|
+
def detect_forbidden_content(self, spec: dict[str, Any]) -> dict[str, Any] | None:
|
|
364
|
+
for _key, value in self.iter_key_values(spec):
|
|
365
|
+
if isinstance(value, str) and self.detect_text_forbidden_content(value):
|
|
366
|
+
return {
|
|
367
|
+
"kind": "desktop-automation-plan",
|
|
368
|
+
"status": "blocked",
|
|
369
|
+
"reason": "forbidden_sensitive_marker",
|
|
370
|
+
"risks": ["Spec contains text that looks like a hardcoded secret."],
|
|
371
|
+
}
|
|
372
|
+
return None
|
|
373
|
+
|
|
374
|
+
def detect_text_forbidden_content(self, value: str) -> bool:
|
|
375
|
+
return bool(FORBIDDEN_MARKER_PATTERN.search(value))
|
|
376
|
+
|
|
377
|
+
def build_pyautogui_files(self, spec: dict[str, Any], *, base_dir: str = "") -> list[tuple[str, str]]:
|
|
378
|
+
prefix = f"{base_dir}/" if base_dir else ""
|
|
379
|
+
return [
|
|
380
|
+
(f"{prefix}pyautogui_automation.py", self.render_pyautogui_script(spec)),
|
|
381
|
+
(f"{prefix}README.md", self.render_readme(spec)),
|
|
382
|
+
(f"{prefix}requirements.txt", "pyautogui>=0.9.54\n"),
|
|
383
|
+
(f"{prefix}tests/test_pyautogui_automation.py", self.render_pyautogui_test(spec)),
|
|
384
|
+
]
|
|
385
|
+
|
|
386
|
+
def build_capability_wrapper_files(
|
|
387
|
+
self,
|
|
388
|
+
spec: dict[str, Any],
|
|
389
|
+
*,
|
|
390
|
+
agent_id: str,
|
|
391
|
+
capability_id: str,
|
|
392
|
+
) -> list[tuple[str, str]]:
|
|
393
|
+
base = f"agents/{agent_id}/capabilities/{capability_id}"
|
|
394
|
+
return [
|
|
395
|
+
(f"{base}/capability.yaml", self.render_capability_yaml(spec, agent_id=agent_id, capability_id=capability_id)),
|
|
396
|
+
(f"{base}/workflow.md", self.render_capability_workflow(spec, capability_id=capability_id)),
|
|
397
|
+
(f"{base}/decision-rules.md", self.render_capability_decision_rules(spec)),
|
|
398
|
+
(f"{base}/runner.py", self.render_pyautogui_script(spec)),
|
|
399
|
+
]
|
|
400
|
+
|
|
401
|
+
def write_or_plan_files(
|
|
402
|
+
self,
|
|
403
|
+
*,
|
|
404
|
+
kind: str,
|
|
405
|
+
files: list[tuple[str, str]],
|
|
406
|
+
target_root: Path,
|
|
407
|
+
execute: bool,
|
|
408
|
+
allow_overwrite: bool,
|
|
409
|
+
extra: dict[str, Any],
|
|
410
|
+
) -> dict[str, Any]:
|
|
411
|
+
if not target_root.exists() or not target_root.is_dir():
|
|
412
|
+
return {
|
|
413
|
+
"kind": kind,
|
|
414
|
+
"status": "blocked",
|
|
415
|
+
"reason": "target_project_missing",
|
|
416
|
+
"target_project": str(target_root),
|
|
417
|
+
"risks": ["target_project must exist before files can be written."],
|
|
418
|
+
}
|
|
419
|
+
|
|
420
|
+
checked_files = []
|
|
421
|
+
for relative_path, content in files:
|
|
422
|
+
target = (target_root / relative_path).resolve()
|
|
423
|
+
if Path(relative_path).is_absolute() or not self.is_inside(target_root, target):
|
|
424
|
+
return {
|
|
425
|
+
"kind": kind,
|
|
426
|
+
"status": "blocked",
|
|
427
|
+
"reason": "path_outside_target_project",
|
|
428
|
+
"path": relative_path,
|
|
429
|
+
"target_project": str(target_root),
|
|
430
|
+
}
|
|
431
|
+
checked_files.append((relative_path, target, content))
|
|
432
|
+
|
|
433
|
+
if not execute:
|
|
434
|
+
return {
|
|
435
|
+
"kind": kind,
|
|
436
|
+
"status": "planned",
|
|
437
|
+
"dry_run": True,
|
|
438
|
+
"target_project": str(target_root),
|
|
439
|
+
"planned_files": [
|
|
440
|
+
{
|
|
441
|
+
"path": relative_path,
|
|
442
|
+
"absolute_path": str(target),
|
|
443
|
+
"bytes": len(content.encode("utf-8")),
|
|
444
|
+
}
|
|
445
|
+
for relative_path, target, content in checked_files
|
|
446
|
+
],
|
|
447
|
+
**extra,
|
|
448
|
+
"next_steps": ["Rerun with --execute after reviewing the planned files."],
|
|
449
|
+
}
|
|
450
|
+
|
|
451
|
+
existing = [target for _relative_path, target, _content in checked_files if target.exists()]
|
|
452
|
+
if existing and not allow_overwrite:
|
|
453
|
+
return {
|
|
454
|
+
"kind": kind,
|
|
455
|
+
"status": "blocked",
|
|
456
|
+
"reason": "target_exists",
|
|
457
|
+
"target_project": str(target_root),
|
|
458
|
+
"existing_files": [str(path) for path in existing],
|
|
459
|
+
**extra,
|
|
460
|
+
"next_steps": ["Rerun with --allow-overwrite only after reviewing existing files."],
|
|
461
|
+
}
|
|
462
|
+
|
|
463
|
+
written_files = []
|
|
464
|
+
for _relative_path, target, content in checked_files:
|
|
465
|
+
target.parent.mkdir(parents=True, exist_ok=True)
|
|
466
|
+
target.write_text(content, encoding="utf-8")
|
|
467
|
+
written_files.append({"path": str(target), "bytes": len(content.encode("utf-8"))})
|
|
468
|
+
|
|
469
|
+
return {
|
|
470
|
+
"kind": kind,
|
|
471
|
+
"status": "written",
|
|
472
|
+
"dry_run": False,
|
|
473
|
+
"target_project": str(target_root),
|
|
474
|
+
"written_files": written_files,
|
|
475
|
+
**extra,
|
|
476
|
+
}
|
|
477
|
+
|
|
478
|
+
def render_pyautogui_script(self, spec: dict[str, Any]) -> str:
|
|
479
|
+
confirmation_block = [
|
|
480
|
+
" if args.execute and not args.confirm:",
|
|
481
|
+
" logger.error(\"real PyAutoGUI actions require --confirm after reviewing --dry-run output\")",
|
|
482
|
+
" return 2",
|
|
483
|
+
]
|
|
484
|
+
return "\n".join(
|
|
485
|
+
[
|
|
486
|
+
"#!/usr/bin/env python3",
|
|
487
|
+
f'"""PyAutoGUI desktop automation: {spec["automation_name"]}."""',
|
|
488
|
+
"",
|
|
489
|
+
"from __future__ import annotations",
|
|
490
|
+
"",
|
|
491
|
+
"import argparse",
|
|
492
|
+
"import json",
|
|
493
|
+
"import logging",
|
|
494
|
+
"import time",
|
|
495
|
+
"from pathlib import Path",
|
|
496
|
+
"",
|
|
497
|
+
f"TARGET_APP = {spec['target_app']!r}",
|
|
498
|
+
f"TARGET_WINDOW = {spec['target_window']!r}",
|
|
499
|
+
f"STEPS = {spec['steps']!r}",
|
|
500
|
+
f"SCREEN_PRECONDITIONS = {spec['screen_preconditions']!r}",
|
|
501
|
+
f"VERIFICATION_STRATEGY = {spec['verification_strategy']!r}",
|
|
502
|
+
f"SIDE_EFFECTS = {spec['side_effects']!r}",
|
|
503
|
+
f"COORDINATES_POLICY = {spec['coordinates_policy']!r}",
|
|
504
|
+
"",
|
|
505
|
+
"",
|
|
506
|
+
"def build_parser() -> argparse.ArgumentParser:",
|
|
507
|
+
f" parser = argparse.ArgumentParser(description={spec['purpose']!r})",
|
|
508
|
+
" parser.add_argument(\"--dry-run\", action=\"store_true\", help=\"show planned desktop actions without touching UI\")",
|
|
509
|
+
" parser.add_argument(\"--execute\", action=\"store_true\", help=\"run real PyAutoGUI actions\")",
|
|
510
|
+
" parser.add_argument(\"--confirm\", action=\"store_true\", help=\"confirm real UI side effects after dry-run review\")",
|
|
511
|
+
" parser.add_argument(\"--screenshot-dir\", default=\"pyautogui-artifacts\")",
|
|
512
|
+
" parser.add_argument(\"--target-window\", default=TARGET_WINDOW)",
|
|
513
|
+
" parser.add_argument(\"--pause\", type=float, default=0.2)",
|
|
514
|
+
" parser.add_argument(\"--timeout\", type=int, default=20)",
|
|
515
|
+
" parser.add_argument(\"--abort-file\", default=\"ABORT_PYAUTOGUI\")",
|
|
516
|
+
" parser.add_argument(\"--region\", help=\"optional x,y,width,height region guardrail\")",
|
|
517
|
+
" return parser",
|
|
518
|
+
"",
|
|
519
|
+
"",
|
|
520
|
+
"def pyautogui_import():",
|
|
521
|
+
" import pyautogui",
|
|
522
|
+
" pyautogui.FAILSAFE = True",
|
|
523
|
+
" return pyautogui",
|
|
524
|
+
"",
|
|
525
|
+
"",
|
|
526
|
+
"def planned_actions(args: argparse.Namespace) -> dict:",
|
|
527
|
+
" return {",
|
|
528
|
+
f" \"automation\": {spec['automation_slug']!r},",
|
|
529
|
+
" \"target_app\": TARGET_APP,",
|
|
530
|
+
" \"target_window\": args.target_window,",
|
|
531
|
+
" \"side_effects\": SIDE_EFFECTS,",
|
|
532
|
+
" \"coordinates_policy\": COORDINATES_POLICY,",
|
|
533
|
+
" \"screen_preconditions\": SCREEN_PRECONDITIONS,",
|
|
534
|
+
" \"verification_strategy\": VERIFICATION_STRATEGY,",
|
|
535
|
+
" \"steps\": STEPS,",
|
|
536
|
+
" }",
|
|
537
|
+
"",
|
|
538
|
+
"",
|
|
539
|
+
"def ensure_abort_not_requested(args: argparse.Namespace) -> None:",
|
|
540
|
+
" abort_path = Path(args.abort_file)",
|
|
541
|
+
" if abort_path.exists():",
|
|
542
|
+
" raise RuntimeError(f\"abort file exists: {abort_path}\")",
|
|
543
|
+
"",
|
|
544
|
+
"",
|
|
545
|
+
"def capture_screenshot(pyautogui, screenshot_dir: Path, name: str, region: tuple[int, int, int, int] | None) -> str:",
|
|
546
|
+
" screenshot_dir.mkdir(parents=True, exist_ok=True)",
|
|
547
|
+
" path = screenshot_dir / name",
|
|
548
|
+
" image = pyautogui.screenshot(region=region)",
|
|
549
|
+
" image.save(path)",
|
|
550
|
+
" return str(path)",
|
|
551
|
+
"",
|
|
552
|
+
"",
|
|
553
|
+
"def parse_region(value: str | None) -> tuple[int, int, int, int] | None:",
|
|
554
|
+
" if not value:",
|
|
555
|
+
" return None",
|
|
556
|
+
" parts = [int(part.strip()) for part in value.split(\",\")]",
|
|
557
|
+
" if len(parts) != 4:",
|
|
558
|
+
" raise ValueError(\"--region must be x,y,width,height\")",
|
|
559
|
+
" return tuple(parts)",
|
|
560
|
+
"",
|
|
561
|
+
"",
|
|
562
|
+
"def validate_target_window(pyautogui, expected: str) -> dict:",
|
|
563
|
+
" if not expected:",
|
|
564
|
+
" return {\"status\": \"warning\", \"reason\": \"target_window_not_provided\"}",
|
|
565
|
+
" get_active_window = getattr(pyautogui, \"getActiveWindow\", None)",
|
|
566
|
+
" if get_active_window is None:",
|
|
567
|
+
" return {\"status\": \"warning\", \"reason\": \"active_window_check_unavailable\"}",
|
|
568
|
+
" active = get_active_window()",
|
|
569
|
+
" title = getattr(active, \"title\", \"\") if active else \"\"",
|
|
570
|
+
" if expected.lower() not in title.lower():",
|
|
571
|
+
" raise RuntimeError(f\"active window mismatch: expected {expected!r}, got {title!r}\")",
|
|
572
|
+
" return {\"status\": \"ok\", \"active_window\": title}",
|
|
573
|
+
"",
|
|
574
|
+
"",
|
|
575
|
+
"def run_desktop(args: argparse.Namespace) -> dict:",
|
|
576
|
+
" pyautogui = pyautogui_import()",
|
|
577
|
+
" pyautogui.PAUSE = args.pause",
|
|
578
|
+
" screenshot_dir = Path(args.screenshot_dir)",
|
|
579
|
+
" region = parse_region(args.region)",
|
|
580
|
+
" started_at = time.monotonic()",
|
|
581
|
+
" result = {\"status\": \"ok\", \"screenshots\": {}, \"steps\": []}",
|
|
582
|
+
" try:",
|
|
583
|
+
" ensure_abort_not_requested(args)",
|
|
584
|
+
" result[\"window_check\"] = validate_target_window(pyautogui, args.target_window)",
|
|
585
|
+
" result[\"screenshots\"][\"before\"] = capture_screenshot(pyautogui, screenshot_dir, \"before.png\", region)",
|
|
586
|
+
" for index, step in enumerate(STEPS, start=1):",
|
|
587
|
+
" ensure_abort_not_requested(args)",
|
|
588
|
+
" if time.monotonic() - started_at > args.timeout:",
|
|
589
|
+
" raise TimeoutError(\"PyAutoGUI automation timed out\")",
|
|
590
|
+
" result[\"steps\"].append({\"index\": index, \"description\": step, \"status\": \"manual-review-required\"})",
|
|
591
|
+
" result[\"screenshots\"][\"after\"] = capture_screenshot(pyautogui, screenshot_dir, \"after.png\", region)",
|
|
592
|
+
" return result",
|
|
593
|
+
" except Exception as exc:",
|
|
594
|
+
" try:",
|
|
595
|
+
" result[\"screenshots\"][\"error\"] = capture_screenshot(pyautogui, screenshot_dir, \"error.png\", region)",
|
|
596
|
+
" except Exception as screenshot_exc:",
|
|
597
|
+
" result[\"screenshot_error\"] = str(screenshot_exc)",
|
|
598
|
+
" result[\"status\"] = \"failed\"",
|
|
599
|
+
" result[\"error\"] = str(exc)",
|
|
600
|
+
" return result",
|
|
601
|
+
"",
|
|
602
|
+
"",
|
|
603
|
+
"def main(argv: list[str] | None = None) -> int:",
|
|
604
|
+
" parser = build_parser()",
|
|
605
|
+
" args = parser.parse_args(argv)",
|
|
606
|
+
" logging.basicConfig(level=logging.INFO, format=\"%(levelname)s %(message)s\")",
|
|
607
|
+
" logger = logging.getLogger(\"pyautogui-automation\")",
|
|
608
|
+
" if args.execute and args.dry_run:",
|
|
609
|
+
" logger.error(\"choose either --dry-run or --execute\")",
|
|
610
|
+
" return 2",
|
|
611
|
+
*confirmation_block,
|
|
612
|
+
" if not args.execute:",
|
|
613
|
+
" print(json.dumps({\"dry_run\": True, \"plan\": planned_actions(args)}, indent=2))",
|
|
614
|
+
" return 0",
|
|
615
|
+
" result = run_desktop(args)",
|
|
616
|
+
" print(json.dumps(result, indent=2))",
|
|
617
|
+
" return 0 if result.get(\"status\") == \"ok\" else 1",
|
|
618
|
+
"",
|
|
619
|
+
"",
|
|
620
|
+
"if __name__ == \"__main__\":",
|
|
621
|
+
" raise SystemExit(main())",
|
|
622
|
+
"",
|
|
623
|
+
]
|
|
624
|
+
)
|
|
625
|
+
|
|
626
|
+
def render_readme(self, spec: dict[str, Any]) -> str:
|
|
627
|
+
steps = self.markdown_list(spec["steps"], fallback="No steps.")
|
|
628
|
+
preconditions = self.markdown_list(spec["screen_preconditions"], fallback="No screen preconditions.")
|
|
629
|
+
gates = self.markdown_list(spec["quality_gates"], fallback="Review dry-run, target window and screenshots.")
|
|
630
|
+
alternatives = self.markdown_list(
|
|
631
|
+
spec["safer_alternatives_checked"],
|
|
632
|
+
fallback="No safer alternatives were recorded.",
|
|
633
|
+
)
|
|
634
|
+
return "\n".join(
|
|
635
|
+
[
|
|
636
|
+
f"# {spec['automation_name']}",
|
|
637
|
+
"",
|
|
638
|
+
spec["purpose"],
|
|
639
|
+
"",
|
|
640
|
+
"## Target",
|
|
641
|
+
"",
|
|
642
|
+
f"- App: `{spec['target_app']}`",
|
|
643
|
+
f"- Window: `{spec['target_window']}`",
|
|
644
|
+
f"- Platform: `{spec['platform']}`",
|
|
645
|
+
"",
|
|
646
|
+
"## Usage",
|
|
647
|
+
"",
|
|
648
|
+
"```bash",
|
|
649
|
+
"python pyautogui_automation.py --dry-run",
|
|
650
|
+
"python pyautogui_automation.py --execute --confirm --screenshot-dir artifacts",
|
|
651
|
+
"```",
|
|
652
|
+
"",
|
|
653
|
+
"## Steps",
|
|
654
|
+
"",
|
|
655
|
+
steps,
|
|
656
|
+
"",
|
|
657
|
+
"## Screen Preconditions",
|
|
658
|
+
"",
|
|
659
|
+
preconditions,
|
|
660
|
+
"",
|
|
661
|
+
"## Verification",
|
|
662
|
+
"",
|
|
663
|
+
spec["verification_strategy"],
|
|
664
|
+
"",
|
|
665
|
+
"## Safer Alternatives Checked",
|
|
666
|
+
"",
|
|
667
|
+
alternatives,
|
|
668
|
+
"",
|
|
669
|
+
"## Quality Gates",
|
|
670
|
+
"",
|
|
671
|
+
gates,
|
|
672
|
+
"",
|
|
673
|
+
"## Guardrails",
|
|
674
|
+
"",
|
|
675
|
+
"- PyAutoGUI is a last-resort path.",
|
|
676
|
+
"- Real UI actions require `--execute --confirm`.",
|
|
677
|
+
"- `pyautogui.FAILSAFE = True` is enabled.",
|
|
678
|
+
"- Screenshots are captured before, after and on error.",
|
|
679
|
+
"- Do not hardcode credentials or secrets.",
|
|
680
|
+
"",
|
|
681
|
+
]
|
|
682
|
+
)
|
|
683
|
+
|
|
684
|
+
def render_pyautogui_test(self, spec: dict[str, Any]) -> str:
|
|
685
|
+
return "\n".join(
|
|
686
|
+
[
|
|
687
|
+
"import json",
|
|
688
|
+
"import subprocess",
|
|
689
|
+
"import sys",
|
|
690
|
+
"from pathlib import Path",
|
|
691
|
+
"",
|
|
692
|
+
"",
|
|
693
|
+
"def test_pyautogui_automation_dry_run_returns_plan_without_pyautogui():",
|
|
694
|
+
" script = Path(__file__).resolve().parents[1] / \"pyautogui_automation.py\"",
|
|
695
|
+
" result = subprocess.run(",
|
|
696
|
+
" [sys.executable, str(script), \"--dry-run\"],",
|
|
697
|
+
" text=True,",
|
|
698
|
+
" capture_output=True,",
|
|
699
|
+
" check=False,",
|
|
700
|
+
" )",
|
|
701
|
+
" assert result.returncode == 0, result.stderr",
|
|
702
|
+
" payload = json.loads(result.stdout)",
|
|
703
|
+
" assert payload[\"dry_run\"] is True",
|
|
704
|
+
f" assert payload[\"plan\"][\"automation\"] == {spec['automation_slug']!r}",
|
|
705
|
+
"",
|
|
706
|
+
]
|
|
707
|
+
)
|
|
708
|
+
|
|
709
|
+
def render_capability_yaml(self, spec: dict[str, Any], *, agent_id: str, capability_id: str) -> str:
|
|
710
|
+
payload = {
|
|
711
|
+
"id": f"{agent_id}.{capability_id}",
|
|
712
|
+
"kind": "capability",
|
|
713
|
+
"name": self.title_from_id(capability_id),
|
|
714
|
+
"version": "0.1.0",
|
|
715
|
+
"status": "draft",
|
|
716
|
+
"purpose": spec["purpose"],
|
|
717
|
+
"entrypoint": {"runner": "runner.py", "workflow": "workflow.md"},
|
|
718
|
+
"inputs": {
|
|
719
|
+
"required": [],
|
|
720
|
+
"optional": [
|
|
721
|
+
"dry-run",
|
|
722
|
+
"execute",
|
|
723
|
+
"confirm",
|
|
724
|
+
"screenshot-dir",
|
|
725
|
+
"target-window",
|
|
726
|
+
"pause",
|
|
727
|
+
"timeout",
|
|
728
|
+
"abort-file",
|
|
729
|
+
"region",
|
|
730
|
+
],
|
|
731
|
+
},
|
|
732
|
+
"outputs": {"artifacts": ["pyautogui-result.json", "before.png", "after.png", "error.png"]},
|
|
733
|
+
"write_policy": self.capability_write_policy(spec["side_effects"]),
|
|
734
|
+
}
|
|
735
|
+
return yaml.safe_dump(payload, sort_keys=False, allow_unicode=False)
|
|
736
|
+
|
|
737
|
+
def render_capability_workflow(self, spec: dict[str, Any], *, capability_id: str) -> str:
|
|
738
|
+
return "\n".join(
|
|
739
|
+
[
|
|
740
|
+
"# Workflow",
|
|
741
|
+
"",
|
|
742
|
+
f"1. Executar `{capability_id}` em dry-run por padrao.",
|
|
743
|
+
"2. Revisar janela alvo, regiao, pre-condicoes e screenshots esperados.",
|
|
744
|
+
"3. Executar com `--execute --confirm` apenas apos revisao humana.",
|
|
745
|
+
"4. Interromper criando o arquivo de abort configurado por `--abort-file`.",
|
|
746
|
+
"5. Retornar JSON e screenshots antes/depois/erro.",
|
|
747
|
+
"",
|
|
748
|
+
]
|
|
749
|
+
)
|
|
750
|
+
|
|
751
|
+
def render_capability_decision_rules(self, spec: dict[str, Any]) -> str:
|
|
752
|
+
return "\n".join(
|
|
753
|
+
[
|
|
754
|
+
"# Decision Rules",
|
|
755
|
+
"",
|
|
756
|
+
f"- Side effects classificados como `{spec['side_effects']}`.",
|
|
757
|
+
"- PyAutoGUI e ultimo recurso; preferir API, CLI, MCP ou automacao nativa quando disponivel.",
|
|
758
|
+
"- Escrita real exige confirmacao.",
|
|
759
|
+
"- Operacoes destrutivas permanecem bloqueadas por padrao.",
|
|
760
|
+
"- Coordenadas devem ser region/window-relative quando possivel.",
|
|
761
|
+
"",
|
|
762
|
+
]
|
|
763
|
+
)
|
|
764
|
+
|
|
765
|
+
def capability_write_policy(self, side_effects: str) -> str:
|
|
766
|
+
mapping = {
|
|
767
|
+
"read-only": "read_only",
|
|
768
|
+
"navigation": "confirm",
|
|
769
|
+
"data-entry": "confirm",
|
|
770
|
+
"external-write": "confirm",
|
|
771
|
+
"destructive": "blocked_by_default",
|
|
772
|
+
}
|
|
773
|
+
return mapping[side_effects]
|
|
774
|
+
|
|
775
|
+
def side_effect_guardrails(self, side_effects: str) -> list[str]:
|
|
776
|
+
guardrails = {
|
|
777
|
+
"read-only": ["Dry-run shows target, window and planned visual checks."],
|
|
778
|
+
"navigation": ["Require --execute --confirm after dry-run and target-window review."],
|
|
779
|
+
"data-entry": ["Require confirmation, screenshots and no plaintext credentials."],
|
|
780
|
+
"external-write": ["Require explicit runtime confirmation and external approval."],
|
|
781
|
+
"destructive": ["Blocked by default; require separate risk decision."],
|
|
782
|
+
}
|
|
783
|
+
return guardrails[side_effects]
|
|
784
|
+
|
|
785
|
+
def automation_summary(self, spec: dict[str, Any]) -> dict[str, Any]:
|
|
786
|
+
return {
|
|
787
|
+
"name": spec["automation_name"],
|
|
788
|
+
"slug": spec["automation_slug"],
|
|
789
|
+
"purpose": spec["purpose"],
|
|
790
|
+
"target_app": spec["target_app"],
|
|
791
|
+
"target_window": spec["target_window"],
|
|
792
|
+
}
|
|
793
|
+
|
|
794
|
+
def public_file_plan(self, files: list[tuple[str, str]]) -> list[dict[str, Any]]:
|
|
795
|
+
return [{"path": path, "bytes": len(content.encode("utf-8"))} for path, content in files]
|
|
796
|
+
|
|
797
|
+
def open_questions(self, spec: dict[str, Any]) -> list[str]:
|
|
798
|
+
questions: list[str] = []
|
|
799
|
+
if spec["coordinates_policy"] == "absolute-last-resort":
|
|
800
|
+
questions.append("Qual regiao segura limita as coordenadas absolutas?")
|
|
801
|
+
if spec["side_effects"] != "read-only":
|
|
802
|
+
questions.append("Qual ambiente seguro valida que a automacao nao alterara dados reais indevidamente?")
|
|
803
|
+
if not spec["screen_preconditions"]:
|
|
804
|
+
questions.append("Quais sinais visuais confirmam que a tela alvo esta pronta?")
|
|
805
|
+
return questions
|
|
806
|
+
|
|
807
|
+
def question_for_missing_field(self, field: str) -> str:
|
|
808
|
+
questions = {
|
|
809
|
+
"automation_name": "Qual sera o nome da automacao desktop?",
|
|
810
|
+
"purpose": "Qual tarefa desktop a automacao deve resolver?",
|
|
811
|
+
"target_app": "Qual aplicativo desktop sera controlado?",
|
|
812
|
+
"target_window": "Qual titulo ou identificador da janela alvo?",
|
|
813
|
+
"platform": "Qual plataforma sera usada: macos, windows, linux ou cross-platform?",
|
|
814
|
+
"steps": "Quais passos visuais a automacao executa?",
|
|
815
|
+
"screen_preconditions": "Quais pre-condicoes visuais devem existir antes da execucao?",
|
|
816
|
+
"verification_strategy": "Como o script verifica que a acao produziu o estado esperado?",
|
|
817
|
+
"safer_alternatives_checked": "Quais alternativas mais seguras foram checadas e indisponibilizadas?",
|
|
818
|
+
"user_accepts_visual_risk": "O usuario aceitou explicitamente o risco visual?",
|
|
819
|
+
"side_effects": "Qual classe de side effects sera usada?",
|
|
820
|
+
"coordinates_policy": "Qual politica de coordenadas sera usada?",
|
|
821
|
+
}
|
|
822
|
+
return questions.get(field, f"Informe o campo `{field}`.")
|
|
823
|
+
|
|
824
|
+
def markdown_list(self, values: list[str], *, fallback: str) -> str:
|
|
825
|
+
clean = [value for value in values if value]
|
|
826
|
+
if not clean:
|
|
827
|
+
return f"- {fallback}"
|
|
828
|
+
return "\n".join(f"- {value}" for value in clean)
|
|
829
|
+
|
|
830
|
+
def title_from_id(self, value: str) -> str:
|
|
831
|
+
return " ".join(part.capitalize() for part in value.split("-"))
|
|
832
|
+
|
|
833
|
+
def slugify(self, value: str) -> str:
|
|
834
|
+
slug = SLUG_PATTERN.sub("-", value.lower()).strip("-")
|
|
835
|
+
return slug or "pyautogui-automation"
|
|
836
|
+
|
|
837
|
+
def as_bool(self, value: Any) -> bool:
|
|
838
|
+
if isinstance(value, bool):
|
|
839
|
+
return value
|
|
840
|
+
return str(value).strip().lower() in {"1", "true", "yes", "sim"}
|
|
841
|
+
|
|
842
|
+
def iter_key_values(self, value: Any):
|
|
843
|
+
if isinstance(value, dict):
|
|
844
|
+
for key, child in value.items():
|
|
845
|
+
yield str(key), child
|
|
846
|
+
yield from self.iter_key_values(child)
|
|
847
|
+
elif isinstance(value, list):
|
|
848
|
+
for child in value:
|
|
849
|
+
yield from self.iter_key_values(child)
|
|
850
|
+
|
|
851
|
+
def is_inside(self, root: Path, target: Path) -> bool:
|
|
852
|
+
try:
|
|
853
|
+
target.relative_to(root.resolve())
|
|
854
|
+
return True
|
|
855
|
+
except ValueError:
|
|
856
|
+
return False
|