agent-devkit 0.1.6 → 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 +13 -1
- package/package.json +1 -1
- package/runtime/README.md +53 -1
- package/runtime/agent +5 -0
- package/runtime/agents/README.md +26 -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/agent.yaml +6 -4
- package/runtime/agents/execution-reviewer/capabilities/review-agent-result/capability.yaml +1 -2
- package/runtime/agents/execution-reviewer/capabilities/review-final-output/capability.yaml +1 -2
- package/runtime/agents/execution-reviewer/capabilities/review-plan/capability.yaml +1 -2
- 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/agent.yaml +6 -4
- package/runtime/agents/local-llm-operator/capabilities/delegate-operational-task/capability.yaml +1 -2
- package/runtime/agents/local-llm-operator/capabilities/inspect-local-models/capability.yaml +1 -2
- package/runtime/agents/local-llm-operator/capabilities/select-local-worker/capability.yaml +1 -2
- 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/agent.yaml +6 -4
- package/runtime/agents/provider-configurator/capabilities/collect-provider-credentials/capability.yaml +1 -2
- package/runtime/agents/provider-configurator/capabilities/configure-provider-source/capability.yaml +1 -2
- package/runtime/agents/provider-configurator/capabilities/validate-provider-readiness/capability.yaml +1 -2
- 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/agent.yaml +25 -3
- package/runtime/agents/task-orchestrator/capabilities/plan-task/capability.yaml +1 -2
- package/runtime/agents/task-orchestrator/capabilities/select-specialists/capability.yaml +1 -2
- package/runtime/agents/technical-integration-analyst/agent.yaml +15 -2
- package/runtime/agents/topdesk-orchestrator/agent.yaml +10 -2
- package/runtime/cli/aikit/__init__.py +1 -1
- package/runtime/cli/aikit/acceptance.py +166 -0
- package/runtime/cli/aikit/agent_executor.py +26 -3
- package/runtime/cli/aikit/agent_registry.py +244 -5
- package/runtime/cli/aikit/architecture.py +84 -0
- package/runtime/cli/aikit/audit.py +172 -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/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/diagnostics.py +8 -2
- 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 +21 -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/interactive_wizard.py +79 -0
- package/runtime/cli/aikit/local_llm_operator.py +35 -1
- package/runtime/cli/aikit/main.py +9 -2834
- 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 +182 -18
- 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 +809 -119
- 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 +88 -2
- package/runtime/cli/aikit/setup_wizard_payload.py +32 -0
- package/runtime/cli/aikit/sources.py +298 -50
- package/runtime/cli/aikit/tasks.py +449 -21
- package/runtime/cli/aikit/wizard_state.py +15 -1
- 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,793 @@
|
|
|
1
|
+
"""Repository for deterministic Selenium 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
|
+
"browser",
|
|
17
|
+
"selectors",
|
|
18
|
+
"steps",
|
|
19
|
+
"auth_strategy",
|
|
20
|
+
"side_effects",
|
|
21
|
+
"selenium_reasons",
|
|
22
|
+
)
|
|
23
|
+
BROWSERS = {"chrome", "firefox", "edge"}
|
|
24
|
+
AUTH_STRATEGIES = {"none", "env", "manual", "existing-session"}
|
|
25
|
+
SIDE_EFFECTS = {"read-only", "form-submit", "external-write", "destructive"}
|
|
26
|
+
SELENIUM_REASONS = {
|
|
27
|
+
"existing-selenium",
|
|
28
|
+
"selenium-grid",
|
|
29
|
+
"remote-browser",
|
|
30
|
+
"webdriver-required",
|
|
31
|
+
"legacy-project",
|
|
32
|
+
"browser-extension",
|
|
33
|
+
"team-standard",
|
|
34
|
+
"playwright-not-allowed",
|
|
35
|
+
}
|
|
36
|
+
SELECTOR_BY_MAP = {
|
|
37
|
+
"css": "CSS_SELECTOR",
|
|
38
|
+
"id": "ID",
|
|
39
|
+
"name": "NAME",
|
|
40
|
+
"xpath": "XPATH",
|
|
41
|
+
"link_text": "LINK_TEXT",
|
|
42
|
+
"partial_link_text": "PARTIAL_LINK_TEXT",
|
|
43
|
+
"tag": "TAG_NAME",
|
|
44
|
+
}
|
|
45
|
+
FORBIDDEN_MARKER_PATTERN = re.compile(r"\b(?:SECRET|TOKEN|PASSWORD|API_KEY|PRIVATE_KEY)\b\s*[:=]")
|
|
46
|
+
KEBAB_CASE = re.compile(r"^[a-z0-9]+(?:-[a-z0-9]+)*$")
|
|
47
|
+
SLUG_PATTERN = re.compile(r"[^a-z0-9]+")
|
|
48
|
+
|
|
49
|
+
|
|
50
|
+
class SeleniumAutomationError(RuntimeError):
|
|
51
|
+
"""Raised when the builder cannot read or process an input spec."""
|
|
52
|
+
|
|
53
|
+
|
|
54
|
+
class SeleniumAutomationRepository:
|
|
55
|
+
def __init__(self, root: Path | None = None) -> None:
|
|
56
|
+
self.root = root or Path(__file__).resolve().parents[5]
|
|
57
|
+
|
|
58
|
+
def plan_selenium_automation(self, *, spec_path: Path) -> dict[str, Any]:
|
|
59
|
+
spec = self.load_spec(spec_path)
|
|
60
|
+
spec_result = self.validate_spec(spec)
|
|
61
|
+
if spec_result["status"] != "ok":
|
|
62
|
+
return spec_result
|
|
63
|
+
|
|
64
|
+
normalized = self.normalize_spec(spec)
|
|
65
|
+
blocked = self.detect_forbidden_content(normalized)
|
|
66
|
+
if blocked:
|
|
67
|
+
return blocked
|
|
68
|
+
|
|
69
|
+
reason_result = self.validate_selenium_reasons(normalized["selenium_reasons"])
|
|
70
|
+
if reason_result["status"] != "ok":
|
|
71
|
+
return reason_result
|
|
72
|
+
|
|
73
|
+
files = self.build_selenium_files(normalized)
|
|
74
|
+
return {
|
|
75
|
+
"kind": "selenium-automation-plan",
|
|
76
|
+
"status": "ok",
|
|
77
|
+
"automation": self.automation_summary(normalized),
|
|
78
|
+
"browser": normalized["browser"],
|
|
79
|
+
"side_effects": normalized["side_effects"],
|
|
80
|
+
"write_policy": "read_only",
|
|
81
|
+
"selenium_reasons": normalized["selenium_reasons"],
|
|
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_selenium_script(self, *, spec_path: Path) -> dict[str, Any]:
|
|
88
|
+
plan = self.plan_selenium_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_selenium_script(spec)
|
|
94
|
+
return {
|
|
95
|
+
"kind": "selenium-script",
|
|
96
|
+
"status": "ok",
|
|
97
|
+
"automation": self.automation_summary(spec),
|
|
98
|
+
"artifact": "selenium_automation.py",
|
|
99
|
+
"content": content,
|
|
100
|
+
"bytes": len(content.encode("utf-8")),
|
|
101
|
+
"write_policy": "output_only",
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
def generate_selenium_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_selenium_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": "selenium-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_selenium_files(spec, base_dir=spec["automation_slug"])
|
|
127
|
+
return self.write_or_plan_files(
|
|
128
|
+
kind="selenium-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_selenium_script(self, *, text: str, side_effects: str = "read-only") -> dict[str, Any]:
|
|
137
|
+
normalized_side_effects = str(side_effects or "read-only").strip()
|
|
138
|
+
findings: list[str] = []
|
|
139
|
+
if not text.strip():
|
|
140
|
+
findings.append("selenium script is empty")
|
|
141
|
+
lower_text = text.lower()
|
|
142
|
+
if "webdriverwait" not in lower_text:
|
|
143
|
+
findings.append("selenium script must use WebDriverWait explicit waits")
|
|
144
|
+
if "time.sleep" in lower_text:
|
|
145
|
+
findings.append("selenium script must not use time.sleep as primary waiting")
|
|
146
|
+
for flag in ("--dry-run", "--headless", "--browser", "--timeout", "--screenshot-dir"):
|
|
147
|
+
if flag not in text:
|
|
148
|
+
findings.append(f"selenium script must expose {flag}")
|
|
149
|
+
if "save_screenshot" not in text:
|
|
150
|
+
findings.append("selenium script must capture screenshot on failure")
|
|
151
|
+
if normalized_side_effects != "read-only" and "--confirm" not in text:
|
|
152
|
+
findings.append("selenium script with side effects must require --confirm")
|
|
153
|
+
if "return 0" not in text and "sys.exit(0)" not in text:
|
|
154
|
+
findings.append("selenium script should return a predictable success exit code")
|
|
155
|
+
if self.detect_text_forbidden_content(text):
|
|
156
|
+
findings.append("selenium script contains a secret marker")
|
|
157
|
+
|
|
158
|
+
valid = not findings
|
|
159
|
+
return {
|
|
160
|
+
"kind": "selenium-review",
|
|
161
|
+
"status": "ok" if valid else "failed",
|
|
162
|
+
"valid": valid,
|
|
163
|
+
"side_effects": normalized_side_effects,
|
|
164
|
+
"findings": findings,
|
|
165
|
+
"write_policy": "read_only",
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
def wrap_selenium_as_capability(
|
|
169
|
+
self,
|
|
170
|
+
*,
|
|
171
|
+
spec_path: Path,
|
|
172
|
+
agent_id: str,
|
|
173
|
+
capability_id: str,
|
|
174
|
+
execute: bool = False,
|
|
175
|
+
allow_overwrite: bool = False,
|
|
176
|
+
) -> dict[str, Any]:
|
|
177
|
+
plan = self.plan_selenium_automation(spec_path=spec_path)
|
|
178
|
+
if plan["status"] != "ok":
|
|
179
|
+
return plan
|
|
180
|
+
|
|
181
|
+
if not KEBAB_CASE.match(agent_id):
|
|
182
|
+
return {
|
|
183
|
+
"kind": "selenium-capability-wrapper",
|
|
184
|
+
"status": "blocked",
|
|
185
|
+
"reason": "invalid_agent_id",
|
|
186
|
+
"risks": ["agent-id must be kebab-case."],
|
|
187
|
+
}
|
|
188
|
+
if not KEBAB_CASE.match(capability_id):
|
|
189
|
+
return {
|
|
190
|
+
"kind": "selenium-capability-wrapper",
|
|
191
|
+
"status": "blocked",
|
|
192
|
+
"reason": "invalid_capability_id",
|
|
193
|
+
"risks": ["capability-id must be kebab-case."],
|
|
194
|
+
}
|
|
195
|
+
|
|
196
|
+
spec = self.normalize_spec(self.load_spec(spec_path))
|
|
197
|
+
target_project = spec.get("target_project")
|
|
198
|
+
if not target_project:
|
|
199
|
+
return {
|
|
200
|
+
"kind": "selenium-capability-wrapper",
|
|
201
|
+
"status": "needs-input",
|
|
202
|
+
"missing_fields": ["target_project"],
|
|
203
|
+
"questions": ["Qual e o caminho do projeto destino?"],
|
|
204
|
+
}
|
|
205
|
+
|
|
206
|
+
target_root = Path(str(target_project)).expanduser().resolve()
|
|
207
|
+
files = self.build_capability_wrapper_files(spec, agent_id=agent_id, capability_id=capability_id)
|
|
208
|
+
return self.write_or_plan_files(
|
|
209
|
+
kind="selenium-capability-wrapper",
|
|
210
|
+
files=files,
|
|
211
|
+
target_root=target_root,
|
|
212
|
+
execute=execute,
|
|
213
|
+
allow_overwrite=allow_overwrite,
|
|
214
|
+
extra={
|
|
215
|
+
"agent_id": agent_id,
|
|
216
|
+
"capability_id": capability_id,
|
|
217
|
+
"capability_write_policy": self.capability_write_policy(spec["side_effects"]),
|
|
218
|
+
},
|
|
219
|
+
)
|
|
220
|
+
|
|
221
|
+
def load_spec(self, path: Path) -> dict[str, Any]:
|
|
222
|
+
if not path.exists():
|
|
223
|
+
raise SeleniumAutomationError(f"spec not found: {path}")
|
|
224
|
+
text = path.read_text(encoding="utf-8")
|
|
225
|
+
if path.suffix.lower() == ".json":
|
|
226
|
+
payload = json.loads(text)
|
|
227
|
+
else:
|
|
228
|
+
payload = yaml.safe_load(text) or {}
|
|
229
|
+
if not isinstance(payload, dict):
|
|
230
|
+
raise SeleniumAutomationError("spec must be a mapping")
|
|
231
|
+
return payload
|
|
232
|
+
|
|
233
|
+
def validate_spec(self, spec: dict[str, Any]) -> dict[str, Any]:
|
|
234
|
+
missing = [
|
|
235
|
+
field
|
|
236
|
+
for field in REQUIRED_SPEC_FIELDS
|
|
237
|
+
if field not in spec or spec.get(field) is None or spec.get(field) == ""
|
|
238
|
+
]
|
|
239
|
+
if not spec.get("target_url") and not spec.get("target_description"):
|
|
240
|
+
missing.append("target_url_or_description")
|
|
241
|
+
if missing:
|
|
242
|
+
return {
|
|
243
|
+
"kind": "selenium-automation-plan",
|
|
244
|
+
"status": "needs-input",
|
|
245
|
+
"missing_fields": missing,
|
|
246
|
+
"questions": [self.question_for_missing_field(field) for field in missing],
|
|
247
|
+
}
|
|
248
|
+
for field in ("selectors", "steps", "selenium_reasons", "quality_gates"):
|
|
249
|
+
if spec.get(field) is not None and not isinstance(spec[field], list):
|
|
250
|
+
return {
|
|
251
|
+
"kind": "selenium-automation-plan",
|
|
252
|
+
"status": "blocked",
|
|
253
|
+
"reason": "invalid_list_field",
|
|
254
|
+
"field": field,
|
|
255
|
+
"risks": [f"{field} must be a list when provided."],
|
|
256
|
+
}
|
|
257
|
+
browser = str(spec.get("browser") or "").strip().lower()
|
|
258
|
+
if browser not in BROWSERS:
|
|
259
|
+
return {
|
|
260
|
+
"kind": "selenium-automation-plan",
|
|
261
|
+
"status": "blocked",
|
|
262
|
+
"reason": "unsupported_browser",
|
|
263
|
+
"supported_values": sorted(BROWSERS),
|
|
264
|
+
}
|
|
265
|
+
auth_strategy = str(spec.get("auth_strategy") or "").strip()
|
|
266
|
+
if auth_strategy not in AUTH_STRATEGIES:
|
|
267
|
+
return {
|
|
268
|
+
"kind": "selenium-automation-plan",
|
|
269
|
+
"status": "blocked",
|
|
270
|
+
"reason": "unsupported_auth_strategy",
|
|
271
|
+
"supported_values": sorted(AUTH_STRATEGIES),
|
|
272
|
+
}
|
|
273
|
+
side_effects = str(spec.get("side_effects") or "").strip()
|
|
274
|
+
if side_effects not in SIDE_EFFECTS:
|
|
275
|
+
return {
|
|
276
|
+
"kind": "selenium-automation-plan",
|
|
277
|
+
"status": "blocked",
|
|
278
|
+
"reason": "invalid_side_effects",
|
|
279
|
+
"supported_values": sorted(SIDE_EFFECTS),
|
|
280
|
+
}
|
|
281
|
+
return {"status": "ok"}
|
|
282
|
+
|
|
283
|
+
def normalize_spec(self, spec: dict[str, Any]) -> dict[str, Any]:
|
|
284
|
+
normalized = dict(spec)
|
|
285
|
+
normalized["automation_name"] = " ".join(str(spec["automation_name"]).split())
|
|
286
|
+
normalized["automation_slug"] = self.slugify(normalized["automation_name"])
|
|
287
|
+
normalized["purpose"] = " ".join(str(spec["purpose"]).split())
|
|
288
|
+
normalized["target_url"] = str(spec.get("target_url") or "").strip()
|
|
289
|
+
normalized["target_description"] = " ".join(str(spec.get("target_description") or "").split())
|
|
290
|
+
normalized["browser"] = str(spec["browser"]).strip().lower()
|
|
291
|
+
normalized["remote_url_env"] = str(spec.get("remote_url_env") or "").strip()
|
|
292
|
+
normalized["auth_strategy"] = str(spec["auth_strategy"]).strip()
|
|
293
|
+
normalized["side_effects"] = str(spec["side_effects"]).strip()
|
|
294
|
+
normalized["selenium_reasons"] = [str(item).strip() for item in spec.get("selenium_reasons") or []]
|
|
295
|
+
normalized["selectors"] = [self.normalize_selector(item) for item in spec.get("selectors") or []]
|
|
296
|
+
normalized["steps"] = [str(item).strip() for item in spec.get("steps") or []]
|
|
297
|
+
normalized["quality_gates"] = [str(item).strip() for item in spec.get("quality_gates") or []]
|
|
298
|
+
if spec.get("target_project"):
|
|
299
|
+
normalized["target_project"] = str(spec["target_project"]).strip()
|
|
300
|
+
return normalized
|
|
301
|
+
|
|
302
|
+
def validate_selenium_reasons(self, reasons: list[str]) -> dict[str, Any]:
|
|
303
|
+
if not reasons:
|
|
304
|
+
return {
|
|
305
|
+
"kind": "selenium-automation-plan",
|
|
306
|
+
"status": "needs-playwright-review",
|
|
307
|
+
"reason": "selenium_not_justified",
|
|
308
|
+
"risks": ["Selenium should not be the default for modern web automation."],
|
|
309
|
+
"next_steps": ["Use problem 27 / Playwright unless WebDriver or Selenium compatibility is required."],
|
|
310
|
+
}
|
|
311
|
+
unknown = [reason for reason in reasons if reason not in SELENIUM_REASONS]
|
|
312
|
+
if unknown:
|
|
313
|
+
return {
|
|
314
|
+
"kind": "selenium-automation-plan",
|
|
315
|
+
"status": "blocked",
|
|
316
|
+
"reason": "unsupported_selenium_reason",
|
|
317
|
+
"unsupported_values": unknown,
|
|
318
|
+
"supported_values": sorted(SELENIUM_REASONS),
|
|
319
|
+
}
|
|
320
|
+
return {"status": "ok"}
|
|
321
|
+
|
|
322
|
+
def detect_forbidden_content(self, spec: dict[str, Any]) -> dict[str, Any] | None:
|
|
323
|
+
for key, value in self.iter_key_values(spec):
|
|
324
|
+
if key in {"target_url", "remote_url_env"}:
|
|
325
|
+
continue
|
|
326
|
+
if isinstance(value, str) and self.detect_text_forbidden_content(value):
|
|
327
|
+
return {
|
|
328
|
+
"kind": "selenium-automation-plan",
|
|
329
|
+
"status": "blocked",
|
|
330
|
+
"reason": "forbidden_sensitive_marker",
|
|
331
|
+
"risks": ["Spec contains text that looks like a hardcoded secret."],
|
|
332
|
+
}
|
|
333
|
+
return None
|
|
334
|
+
|
|
335
|
+
def detect_text_forbidden_content(self, value: str) -> bool:
|
|
336
|
+
return bool(FORBIDDEN_MARKER_PATTERN.search(value))
|
|
337
|
+
|
|
338
|
+
def build_selenium_files(self, spec: dict[str, Any], *, base_dir: str = "") -> list[tuple[str, str]]:
|
|
339
|
+
prefix = f"{base_dir}/" if base_dir else ""
|
|
340
|
+
return [
|
|
341
|
+
(f"{prefix}selenium_automation.py", self.render_selenium_script(spec)),
|
|
342
|
+
(f"{prefix}README.md", self.render_readme(spec)),
|
|
343
|
+
(f"{prefix}requirements.txt", "selenium>=4.0\n"),
|
|
344
|
+
(f"{prefix}tests/test_selenium_automation.py", self.render_selenium_test(spec)),
|
|
345
|
+
]
|
|
346
|
+
|
|
347
|
+
def build_capability_wrapper_files(
|
|
348
|
+
self,
|
|
349
|
+
spec: dict[str, Any],
|
|
350
|
+
*,
|
|
351
|
+
agent_id: str,
|
|
352
|
+
capability_id: str,
|
|
353
|
+
) -> list[tuple[str, str]]:
|
|
354
|
+
base = f"agents/{agent_id}/capabilities/{capability_id}"
|
|
355
|
+
return [
|
|
356
|
+
(f"{base}/capability.yaml", self.render_capability_yaml(spec, agent_id=agent_id, capability_id=capability_id)),
|
|
357
|
+
(f"{base}/workflow.md", self.render_capability_workflow(spec, capability_id=capability_id)),
|
|
358
|
+
(f"{base}/decision-rules.md", self.render_capability_decision_rules(spec)),
|
|
359
|
+
(f"{base}/runner.py", self.render_selenium_script(spec)),
|
|
360
|
+
]
|
|
361
|
+
|
|
362
|
+
def write_or_plan_files(
|
|
363
|
+
self,
|
|
364
|
+
*,
|
|
365
|
+
kind: str,
|
|
366
|
+
files: list[tuple[str, str]],
|
|
367
|
+
target_root: Path,
|
|
368
|
+
execute: bool,
|
|
369
|
+
allow_overwrite: bool,
|
|
370
|
+
extra: dict[str, Any],
|
|
371
|
+
) -> dict[str, Any]:
|
|
372
|
+
if not target_root.exists() or not target_root.is_dir():
|
|
373
|
+
return {
|
|
374
|
+
"kind": kind,
|
|
375
|
+
"status": "blocked",
|
|
376
|
+
"reason": "target_project_missing",
|
|
377
|
+
"target_project": str(target_root),
|
|
378
|
+
"risks": ["target_project must exist before files can be written."],
|
|
379
|
+
}
|
|
380
|
+
|
|
381
|
+
checked_files = []
|
|
382
|
+
for relative_path, content in files:
|
|
383
|
+
target = (target_root / relative_path).resolve()
|
|
384
|
+
if Path(relative_path).is_absolute() or not self.is_inside(target_root, target):
|
|
385
|
+
return {
|
|
386
|
+
"kind": kind,
|
|
387
|
+
"status": "blocked",
|
|
388
|
+
"reason": "path_outside_target_project",
|
|
389
|
+
"path": relative_path,
|
|
390
|
+
"target_project": str(target_root),
|
|
391
|
+
}
|
|
392
|
+
checked_files.append((relative_path, target, content))
|
|
393
|
+
|
|
394
|
+
if not execute:
|
|
395
|
+
return {
|
|
396
|
+
"kind": kind,
|
|
397
|
+
"status": "planned",
|
|
398
|
+
"dry_run": True,
|
|
399
|
+
"target_project": str(target_root),
|
|
400
|
+
"planned_files": [
|
|
401
|
+
{
|
|
402
|
+
"path": relative_path,
|
|
403
|
+
"absolute_path": str(target),
|
|
404
|
+
"bytes": len(content.encode("utf-8")),
|
|
405
|
+
}
|
|
406
|
+
for relative_path, target, content in checked_files
|
|
407
|
+
],
|
|
408
|
+
**extra,
|
|
409
|
+
"next_steps": ["Rerun with --execute after reviewing the planned files."],
|
|
410
|
+
}
|
|
411
|
+
|
|
412
|
+
existing = [target for _relative_path, target, _content in checked_files if target.exists()]
|
|
413
|
+
if existing and not allow_overwrite:
|
|
414
|
+
return {
|
|
415
|
+
"kind": kind,
|
|
416
|
+
"status": "blocked",
|
|
417
|
+
"reason": "target_exists",
|
|
418
|
+
"target_project": str(target_root),
|
|
419
|
+
"existing_files": [str(path) for path in existing],
|
|
420
|
+
**extra,
|
|
421
|
+
"next_steps": ["Rerun with --allow-overwrite only after reviewing existing files."],
|
|
422
|
+
}
|
|
423
|
+
|
|
424
|
+
written_files = []
|
|
425
|
+
for _relative_path, target, content in checked_files:
|
|
426
|
+
target.parent.mkdir(parents=True, exist_ok=True)
|
|
427
|
+
target.write_text(content, encoding="utf-8")
|
|
428
|
+
written_files.append({"path": str(target), "bytes": len(content.encode("utf-8"))})
|
|
429
|
+
|
|
430
|
+
return {
|
|
431
|
+
"kind": kind,
|
|
432
|
+
"status": "written",
|
|
433
|
+
"dry_run": False,
|
|
434
|
+
"target_project": str(target_root),
|
|
435
|
+
"written_files": written_files,
|
|
436
|
+
**extra,
|
|
437
|
+
}
|
|
438
|
+
|
|
439
|
+
def render_selenium_script(self, spec: dict[str, Any]) -> str:
|
|
440
|
+
locators = [
|
|
441
|
+
{
|
|
442
|
+
"name": selector["name"],
|
|
443
|
+
"by": selector["by"],
|
|
444
|
+
"value": selector["value"],
|
|
445
|
+
}
|
|
446
|
+
for selector in spec["selectors"]
|
|
447
|
+
]
|
|
448
|
+
needs_confirmation = spec["side_effects"] != "read-only"
|
|
449
|
+
confirmation_block = [
|
|
450
|
+
" if args.execute and not args.confirm:",
|
|
451
|
+
" logger.error(\"real Selenium side effects require --confirm after reviewing --dry-run output\")",
|
|
452
|
+
" return 2",
|
|
453
|
+
]
|
|
454
|
+
if not needs_confirmation:
|
|
455
|
+
confirmation_block = [
|
|
456
|
+
" if args.execute and not args.confirm:",
|
|
457
|
+
" logger.info(\"--confirm not required for read-only Selenium automation\")",
|
|
458
|
+
]
|
|
459
|
+
|
|
460
|
+
return "\n".join(
|
|
461
|
+
[
|
|
462
|
+
"#!/usr/bin/env python3",
|
|
463
|
+
f'"""Selenium automation: {spec["automation_name"]}."""',
|
|
464
|
+
"",
|
|
465
|
+
"from __future__ import annotations",
|
|
466
|
+
"",
|
|
467
|
+
"import argparse",
|
|
468
|
+
"import json",
|
|
469
|
+
"import logging",
|
|
470
|
+
"import os",
|
|
471
|
+
"from pathlib import Path",
|
|
472
|
+
"",
|
|
473
|
+
f"TARGET_URL = {spec['target_url']!r}",
|
|
474
|
+
f"REMOTE_URL_ENV = {spec['remote_url_env']!r}",
|
|
475
|
+
f"LOCATORS = {locators!r}",
|
|
476
|
+
"",
|
|
477
|
+
"",
|
|
478
|
+
"def build_parser() -> argparse.ArgumentParser:",
|
|
479
|
+
f" parser = argparse.ArgumentParser(description={spec['purpose']!r})",
|
|
480
|
+
" parser.add_argument(\"--dry-run\", action=\"store_true\", help=\"show planned browser actions without opening a browser\")",
|
|
481
|
+
" parser.add_argument(\"--execute\", action=\"store_true\", help=\"open browser and run the automation\")",
|
|
482
|
+
" parser.add_argument(\"--confirm\", action=\"store_true\", help=\"confirm real browser side effects after dry-run review\")",
|
|
483
|
+
" parser.add_argument(\"--headless\", action=\"store_true\", help=\"run browser headless\")",
|
|
484
|
+
f" parser.add_argument(\"--browser\", choices={sorted(BROWSERS)!r}, default={spec['browser']!r})",
|
|
485
|
+
" parser.add_argument(\"--remote-url\", help=\"optional Selenium Remote WebDriver URL\")",
|
|
486
|
+
" parser.add_argument(\"--timeout\", type=int, default=20)",
|
|
487
|
+
" parser.add_argument(\"--screenshot-dir\", default=\"selenium-artifacts\")",
|
|
488
|
+
" return parser",
|
|
489
|
+
"",
|
|
490
|
+
"",
|
|
491
|
+
"def selenium_imports():",
|
|
492
|
+
" from selenium import webdriver",
|
|
493
|
+
" from selenium.webdriver.common.by import By",
|
|
494
|
+
" from selenium.webdriver.support import expected_conditions as EC",
|
|
495
|
+
" from selenium.webdriver.support.ui import WebDriverWait",
|
|
496
|
+
" return webdriver, By, EC, WebDriverWait",
|
|
497
|
+
"",
|
|
498
|
+
"",
|
|
499
|
+
"def by_value(by_module, selector_kind: str):",
|
|
500
|
+
" mapping = {",
|
|
501
|
+
" \"css\": by_module.CSS_SELECTOR,",
|
|
502
|
+
" \"id\": by_module.ID,",
|
|
503
|
+
" \"name\": by_module.NAME,",
|
|
504
|
+
" \"xpath\": by_module.XPATH,",
|
|
505
|
+
" \"link_text\": by_module.LINK_TEXT,",
|
|
506
|
+
" \"partial_link_text\": by_module.PARTIAL_LINK_TEXT,",
|
|
507
|
+
" \"tag\": by_module.TAG_NAME,",
|
|
508
|
+
" }",
|
|
509
|
+
" return mapping[selector_kind]",
|
|
510
|
+
"",
|
|
511
|
+
"",
|
|
512
|
+
"def build_options(webdriver, browser: str, headless: bool):",
|
|
513
|
+
" if browser == \"chrome\":",
|
|
514
|
+
" options = webdriver.ChromeOptions()",
|
|
515
|
+
" elif browser == \"firefox\":",
|
|
516
|
+
" options = webdriver.FirefoxOptions()",
|
|
517
|
+
" else:",
|
|
518
|
+
" options = webdriver.EdgeOptions()",
|
|
519
|
+
" if headless:",
|
|
520
|
+
" options.add_argument(\"--headless=new\")",
|
|
521
|
+
" return options",
|
|
522
|
+
"",
|
|
523
|
+
"",
|
|
524
|
+
"def create_driver(args):",
|
|
525
|
+
" webdriver, by_module, expected_conditions, wait_class = selenium_imports()",
|
|
526
|
+
" options = build_options(webdriver, args.browser, args.headless)",
|
|
527
|
+
" remote_url = args.remote_url or (os.environ.get(REMOTE_URL_ENV) if REMOTE_URL_ENV else None)",
|
|
528
|
+
" if remote_url:",
|
|
529
|
+
" driver = webdriver.Remote(command_executor=remote_url, options=options)",
|
|
530
|
+
" elif args.browser == \"chrome\":",
|
|
531
|
+
" driver = webdriver.Chrome(options=options)",
|
|
532
|
+
" elif args.browser == \"firefox\":",
|
|
533
|
+
" driver = webdriver.Firefox(options=options)",
|
|
534
|
+
" else:",
|
|
535
|
+
" driver = webdriver.Edge(options=options)",
|
|
536
|
+
" return driver, by_module, expected_conditions, wait_class",
|
|
537
|
+
"",
|
|
538
|
+
"",
|
|
539
|
+
"def planned_actions(args: argparse.Namespace) -> dict:",
|
|
540
|
+
" return {",
|
|
541
|
+
f" \"automation\": {spec['automation_slug']!r},",
|
|
542
|
+
" \"browser\": args.browser,",
|
|
543
|
+
" \"target_url\": TARGET_URL or \"<target-description-only>\",",
|
|
544
|
+
" \"remote\": bool(args.remote_url or (os.environ.get(REMOTE_URL_ENV) if REMOTE_URL_ENV else None)),",
|
|
545
|
+
" \"locators\": [locator[\"name\"] for locator in LOCATORS],",
|
|
546
|
+
f" \"side_effects\": {spec['side_effects']!r},",
|
|
547
|
+
" }",
|
|
548
|
+
"",
|
|
549
|
+
"",
|
|
550
|
+
"def run_browser(args: argparse.Namespace) -> dict:",
|
|
551
|
+
" driver, by_module, expected_conditions, wait_class = create_driver(args)",
|
|
552
|
+
" screenshot_dir = Path(args.screenshot_dir)",
|
|
553
|
+
" screenshot_dir.mkdir(parents=True, exist_ok=True)",
|
|
554
|
+
" try:",
|
|
555
|
+
" if TARGET_URL:",
|
|
556
|
+
" driver.get(TARGET_URL)",
|
|
557
|
+
" for locator in LOCATORS:",
|
|
558
|
+
" wait_class(driver, args.timeout).until(",
|
|
559
|
+
" expected_conditions.presence_of_element_located((",
|
|
560
|
+
" by_value(by_module, locator[\"by\"]),",
|
|
561
|
+
" locator[\"value\"],",
|
|
562
|
+
" ))",
|
|
563
|
+
" )",
|
|
564
|
+
" return {\"status\": \"ok\", \"checked_locators\": [locator[\"name\"] for locator in LOCATORS]}",
|
|
565
|
+
" except Exception as exc:",
|
|
566
|
+
" screenshot = screenshot_dir / \"failure.png\"",
|
|
567
|
+
" driver.save_screenshot(str(screenshot))",
|
|
568
|
+
" return {\"status\": \"failed\", \"error\": str(exc), \"screenshot\": str(screenshot)}",
|
|
569
|
+
" finally:",
|
|
570
|
+
" driver.quit()",
|
|
571
|
+
"",
|
|
572
|
+
"",
|
|
573
|
+
"def main(argv: list[str] | None = None) -> int:",
|
|
574
|
+
" parser = build_parser()",
|
|
575
|
+
" args = parser.parse_args(argv)",
|
|
576
|
+
" logging.basicConfig(level=logging.INFO, format=\"%(levelname)s %(message)s\")",
|
|
577
|
+
" logger = logging.getLogger(\"selenium-automation\")",
|
|
578
|
+
" if args.execute and args.dry_run:",
|
|
579
|
+
" logger.error(\"choose either --dry-run or --execute\")",
|
|
580
|
+
" return 2",
|
|
581
|
+
*confirmation_block,
|
|
582
|
+
" if not args.execute:",
|
|
583
|
+
" print(json.dumps({\"dry_run\": True, \"plan\": planned_actions(args)}, indent=2))",
|
|
584
|
+
" return 0",
|
|
585
|
+
" result = run_browser(args)",
|
|
586
|
+
" print(json.dumps(result, indent=2))",
|
|
587
|
+
" return 0 if result.get(\"status\") == \"ok\" else 1",
|
|
588
|
+
"",
|
|
589
|
+
"",
|
|
590
|
+
"if __name__ == \"__main__\":",
|
|
591
|
+
" raise SystemExit(main())",
|
|
592
|
+
"",
|
|
593
|
+
]
|
|
594
|
+
)
|
|
595
|
+
|
|
596
|
+
def render_readme(self, spec: dict[str, Any]) -> str:
|
|
597
|
+
reasons = self.markdown_list(spec["selenium_reasons"], fallback="No Selenium reason provided.")
|
|
598
|
+
selectors = self.markdown_list([selector["name"] for selector in spec["selectors"]], fallback="No selectors.")
|
|
599
|
+
gates = self.markdown_list(spec["quality_gates"], fallback="Review dry-run and screenshots.")
|
|
600
|
+
return "\n".join(
|
|
601
|
+
[
|
|
602
|
+
f"# {spec['automation_name']}",
|
|
603
|
+
"",
|
|
604
|
+
spec["purpose"],
|
|
605
|
+
"",
|
|
606
|
+
"## Why Selenium",
|
|
607
|
+
"",
|
|
608
|
+
reasons,
|
|
609
|
+
"",
|
|
610
|
+
"## Usage",
|
|
611
|
+
"",
|
|
612
|
+
"```bash",
|
|
613
|
+
"python selenium_automation.py --dry-run",
|
|
614
|
+
"python selenium_automation.py --execute --confirm --headless",
|
|
615
|
+
"```",
|
|
616
|
+
"",
|
|
617
|
+
"## Selectors",
|
|
618
|
+
"",
|
|
619
|
+
selectors,
|
|
620
|
+
"",
|
|
621
|
+
"## Quality Gates",
|
|
622
|
+
"",
|
|
623
|
+
gates,
|
|
624
|
+
"",
|
|
625
|
+
"## Guardrails",
|
|
626
|
+
"",
|
|
627
|
+
"- Use explicit waits.",
|
|
628
|
+
"- Capture screenshot on failure.",
|
|
629
|
+
"- Do not hardcode credentials.",
|
|
630
|
+
"- Prefer Playwright when Selenium/WebDriver is not required.",
|
|
631
|
+
"",
|
|
632
|
+
]
|
|
633
|
+
)
|
|
634
|
+
|
|
635
|
+
def render_selenium_test(self, spec: dict[str, Any]) -> str:
|
|
636
|
+
return "\n".join(
|
|
637
|
+
[
|
|
638
|
+
"import json",
|
|
639
|
+
"import subprocess",
|
|
640
|
+
"import sys",
|
|
641
|
+
"from pathlib import Path",
|
|
642
|
+
"",
|
|
643
|
+
"",
|
|
644
|
+
"def test_selenium_automation_dry_run_returns_plan_without_browser():",
|
|
645
|
+
" script = Path(__file__).resolve().parents[1] / \"selenium_automation.py\"",
|
|
646
|
+
" result = subprocess.run(",
|
|
647
|
+
" [sys.executable, str(script), \"--dry-run\"],",
|
|
648
|
+
" text=True,",
|
|
649
|
+
" capture_output=True,",
|
|
650
|
+
" check=False,",
|
|
651
|
+
" )",
|
|
652
|
+
" assert result.returncode == 0, result.stderr",
|
|
653
|
+
" payload = json.loads(result.stdout)",
|
|
654
|
+
" assert payload[\"dry_run\"] is True",
|
|
655
|
+
f" assert payload[\"plan\"][\"automation\"] == {spec['automation_slug']!r}",
|
|
656
|
+
"",
|
|
657
|
+
]
|
|
658
|
+
)
|
|
659
|
+
|
|
660
|
+
def render_capability_yaml(self, spec: dict[str, Any], *, agent_id: str, capability_id: str) -> str:
|
|
661
|
+
payload = {
|
|
662
|
+
"id": f"{agent_id}.{capability_id}",
|
|
663
|
+
"kind": "capability",
|
|
664
|
+
"name": self.title_from_id(capability_id),
|
|
665
|
+
"version": "0.1.0",
|
|
666
|
+
"status": "draft",
|
|
667
|
+
"purpose": spec["purpose"],
|
|
668
|
+
"entrypoint": {"runner": "runner.py", "workflow": "workflow.md"},
|
|
669
|
+
"inputs": {"required": [], "optional": ["dry-run", "execute", "confirm", "headless", "browser"]},
|
|
670
|
+
"outputs": {"artifacts": ["selenium-result.json", "failure.png"]},
|
|
671
|
+
"write_policy": self.capability_write_policy(spec["side_effects"]),
|
|
672
|
+
}
|
|
673
|
+
return yaml.safe_dump(payload, sort_keys=False, allow_unicode=False)
|
|
674
|
+
|
|
675
|
+
def render_capability_workflow(self, spec: dict[str, Any], *, capability_id: str) -> str:
|
|
676
|
+
return "\n".join(
|
|
677
|
+
[
|
|
678
|
+
"# Workflow",
|
|
679
|
+
"",
|
|
680
|
+
f"1. Executar `{capability_id}` em dry-run por padrao.",
|
|
681
|
+
"2. Revisar plano, browser, target e locators.",
|
|
682
|
+
"3. Executar com `--execute --confirm --confirm-execute` apenas apos revisar riscos.",
|
|
683
|
+
"4. Retornar JSON e screenshot em falha.",
|
|
684
|
+
"",
|
|
685
|
+
]
|
|
686
|
+
)
|
|
687
|
+
|
|
688
|
+
def render_capability_decision_rules(self, spec: dict[str, Any]) -> str:
|
|
689
|
+
return "\n".join(
|
|
690
|
+
[
|
|
691
|
+
"# Decision Rules",
|
|
692
|
+
"",
|
|
693
|
+
f"- Side effects classificados como `{spec['side_effects']}`.",
|
|
694
|
+
"- Usar waits explicitos.",
|
|
695
|
+
"- Escrita ou submissao exige confirmacao.",
|
|
696
|
+
"- Playwright deve ser preferido quando Selenium nao for requisito.",
|
|
697
|
+
"",
|
|
698
|
+
]
|
|
699
|
+
)
|
|
700
|
+
|
|
701
|
+
def normalize_selector(self, value: Any) -> dict[str, str]:
|
|
702
|
+
if not isinstance(value, dict):
|
|
703
|
+
return {"name": "invalid", "by": "css", "value": str(value)}
|
|
704
|
+
selector = {
|
|
705
|
+
"name": str(value.get("name") or "selector").strip(),
|
|
706
|
+
"by": str(value.get("by") or "css").strip(),
|
|
707
|
+
"value": str(value.get("value") or "").strip(),
|
|
708
|
+
}
|
|
709
|
+
if selector["by"] not in SELECTOR_BY_MAP:
|
|
710
|
+
selector["by"] = "css"
|
|
711
|
+
return selector
|
|
712
|
+
|
|
713
|
+
def capability_write_policy(self, side_effects: str) -> str:
|
|
714
|
+
mapping = {
|
|
715
|
+
"read-only": "read_only",
|
|
716
|
+
"form-submit": "confirm",
|
|
717
|
+
"external-write": "confirm",
|
|
718
|
+
"destructive": "blocked_by_default",
|
|
719
|
+
}
|
|
720
|
+
return mapping[side_effects]
|
|
721
|
+
|
|
722
|
+
def side_effect_guardrails(self, side_effects: str) -> list[str]:
|
|
723
|
+
guardrails = {
|
|
724
|
+
"read-only": ["Dry-run shows target and locators without opening browser."],
|
|
725
|
+
"form-submit": ["Require --execute --confirm after dry-run review."],
|
|
726
|
+
"external-write": ["Require explicit runtime confirmation and external approval."],
|
|
727
|
+
"destructive": ["Blocked by default; require separate risk decision."],
|
|
728
|
+
}
|
|
729
|
+
return guardrails[side_effects]
|
|
730
|
+
|
|
731
|
+
def automation_summary(self, spec: dict[str, Any]) -> dict[str, Any]:
|
|
732
|
+
return {
|
|
733
|
+
"name": spec["automation_name"],
|
|
734
|
+
"slug": spec["automation_slug"],
|
|
735
|
+
"purpose": spec["purpose"],
|
|
736
|
+
"target": spec["target_url"] or spec["target_description"],
|
|
737
|
+
}
|
|
738
|
+
|
|
739
|
+
def public_file_plan(self, files: list[tuple[str, str]]) -> list[dict[str, Any]]:
|
|
740
|
+
return [{"path": path, "bytes": len(content.encode("utf-8"))} for path, content in files]
|
|
741
|
+
|
|
742
|
+
def open_questions(self, spec: dict[str, Any]) -> list[str]:
|
|
743
|
+
questions: list[str] = []
|
|
744
|
+
if spec["auth_strategy"] == "env":
|
|
745
|
+
questions.append("Quais env vars de credencial serao referenciadas sem expor valores?")
|
|
746
|
+
if spec["side_effects"] != "read-only":
|
|
747
|
+
questions.append("Qual ambiente seguro confirma que a automacao nao afetara dados reais?")
|
|
748
|
+
if not spec["remote_url_env"]:
|
|
749
|
+
questions.append("Ha Selenium Grid ou browser remoto, ou a execucao sera local?")
|
|
750
|
+
return questions
|
|
751
|
+
|
|
752
|
+
def question_for_missing_field(self, field: str) -> str:
|
|
753
|
+
questions = {
|
|
754
|
+
"automation_name": "Qual sera o nome da automacao Selenium?",
|
|
755
|
+
"purpose": "Qual tarefa web a automacao deve resolver?",
|
|
756
|
+
"target_url_or_description": "Qual URL ou descricao do alvo Selenium?",
|
|
757
|
+
"browser": "Qual browser WebDriver sera usado?",
|
|
758
|
+
"selectors": "Quais seletores estaveis serao usados?",
|
|
759
|
+
"steps": "Quais passos a automacao executa?",
|
|
760
|
+
"auth_strategy": "Qual estrategia de autenticacao sera usada?",
|
|
761
|
+
"side_effects": "Qual classificacao de side effects se aplica?",
|
|
762
|
+
"selenium_reasons": "Qual motivo tecnico justifica Selenium em vez de Playwright?",
|
|
763
|
+
}
|
|
764
|
+
return questions.get(field, f"Informe o campo obrigatorio {field}.")
|
|
765
|
+
|
|
766
|
+
def markdown_list(self, values: list[str], *, fallback: str) -> str:
|
|
767
|
+
if not values:
|
|
768
|
+
return f"- {fallback}"
|
|
769
|
+
return "\n".join(f"- {value}" for value in values)
|
|
770
|
+
|
|
771
|
+
def slugify(self, value: str) -> str:
|
|
772
|
+
slug = SLUG_PATTERN.sub("-", value.strip().lower()).strip("-")
|
|
773
|
+
return slug or "selenium-automation"
|
|
774
|
+
|
|
775
|
+
def title_from_id(self, value: str) -> str:
|
|
776
|
+
return " ".join(part.capitalize() for part in value.split("-"))
|
|
777
|
+
|
|
778
|
+
def iter_key_values(self, value: Any, *, parent_key: str = ""):
|
|
779
|
+
if isinstance(value, dict):
|
|
780
|
+
for key, item in value.items():
|
|
781
|
+
yield from self.iter_key_values(item, parent_key=str(key))
|
|
782
|
+
elif isinstance(value, list):
|
|
783
|
+
for item in value:
|
|
784
|
+
yield from self.iter_key_values(item, parent_key=parent_key)
|
|
785
|
+
else:
|
|
786
|
+
yield parent_key, value
|
|
787
|
+
|
|
788
|
+
def is_inside(self, root: Path, target: Path) -> bool:
|
|
789
|
+
try:
|
|
790
|
+
target.relative_to(root)
|
|
791
|
+
return True
|
|
792
|
+
except ValueError:
|
|
793
|
+
return False
|