claude-autopm 2.8.1 → 2.8.3
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 +399 -529
- package/bin/autopm.js +2 -0
- package/bin/commands/plugin.js +395 -0
- package/bin/commands/team.js +184 -10
- package/install/install.js +223 -4
- package/lib/plugins/PluginManager.js +1328 -0
- package/lib/plugins/PluginManager.old.js +400 -0
- package/package.json +5 -1
- package/packages/plugin-ai/LICENSE +21 -0
- package/packages/plugin-ai/README.md +316 -0
- package/packages/plugin-ai/agents/anthropic-claude-expert.md +579 -0
- package/packages/plugin-ai/agents/azure-openai-expert.md +1411 -0
- package/packages/plugin-ai/agents/google-a2a-expert.md +1445 -0
- package/packages/plugin-ai/agents/huggingface-expert.md +2131 -0
- package/packages/plugin-ai/agents/langchain-expert.md +1427 -0
- package/packages/plugin-ai/commands/a2a-setup.md +886 -0
- package/packages/plugin-ai/commands/ai-model-deployment.md +481 -0
- package/packages/plugin-ai/commands/anthropic-optimize.md +793 -0
- package/packages/plugin-ai/commands/huggingface-deploy.md +789 -0
- package/packages/plugin-ai/commands/langchain-optimize.md +807 -0
- package/packages/plugin-ai/commands/llm-optimize.md +348 -0
- package/packages/plugin-ai/commands/openai-optimize.md +863 -0
- package/packages/plugin-ai/commands/rag-optimize.md +841 -0
- package/packages/plugin-ai/commands/rag-setup-scaffold.md +382 -0
- package/packages/plugin-ai/package.json +66 -0
- package/packages/plugin-ai/plugin.json +519 -0
- package/packages/plugin-ai/rules/ai-model-standards.md +449 -0
- package/packages/plugin-ai/rules/prompt-engineering-standards.md +509 -0
- package/packages/plugin-ai/scripts/examples/huggingface-inference-example.py +145 -0
- package/packages/plugin-ai/scripts/examples/langchain-rag-example.py +366 -0
- package/packages/plugin-ai/scripts/examples/mlflow-tracking-example.py +224 -0
- package/packages/plugin-ai/scripts/examples/openai-chat-example.py +425 -0
- package/packages/plugin-cloud/README.md +268 -0
- package/packages/plugin-cloud/agents/gemini-api-expert.md +880 -0
- package/packages/plugin-cloud/agents/openai-python-expert.md +1087 -0
- package/packages/plugin-cloud/commands/cloud-cost-optimize.md +243 -0
- package/packages/plugin-cloud/commands/cloud-validate.md +196 -0
- package/packages/plugin-cloud/hooks/pre-cloud-deploy.js +456 -0
- package/packages/plugin-cloud/package.json +64 -0
- package/packages/plugin-cloud/plugin.json +338 -0
- package/packages/plugin-cloud/rules/cloud-security-compliance.md +313 -0
- package/packages/plugin-cloud/scripts/examples/aws-validate.sh +30 -0
- package/packages/plugin-cloud/scripts/examples/azure-setup.sh +33 -0
- package/packages/plugin-cloud/scripts/examples/gcp-setup.sh +39 -0
- package/packages/plugin-cloud/scripts/examples/k8s-validate.sh +40 -0
- package/packages/plugin-cloud/scripts/examples/terraform-init.sh +26 -0
- package/packages/plugin-core/README.md +274 -0
- package/packages/plugin-core/commands/code-rabbit.md +128 -0
- package/packages/plugin-core/commands/prompt.md +9 -0
- package/packages/plugin-core/commands/re-init.md +9 -0
- package/packages/plugin-core/hooks/context7-reminder.md +29 -0
- package/packages/plugin-core/hooks/enforce-agents.js +125 -0
- package/packages/plugin-core/hooks/enforce-agents.sh +35 -0
- package/packages/plugin-core/hooks/pre-agent-context7.js +224 -0
- package/packages/plugin-core/hooks/pre-command-context7.js +229 -0
- package/packages/plugin-core/hooks/strict-enforce-agents.sh +39 -0
- package/packages/plugin-core/hooks/test-hook.sh +21 -0
- package/packages/plugin-core/hooks/unified-context7-enforcement.sh +38 -0
- package/packages/plugin-core/package.json +45 -0
- package/packages/plugin-core/plugin.json +387 -0
- package/packages/plugin-core/rules/agent-coordination.md +549 -0
- package/packages/plugin-core/rules/agent-mandatory.md +170 -0
- package/packages/plugin-core/rules/command-pipelines.md +208 -0
- package/packages/plugin-core/rules/context-optimization.md +176 -0
- package/packages/plugin-core/rules/context7-enforcement.md +327 -0
- package/packages/plugin-core/rules/datetime.md +122 -0
- package/packages/plugin-core/rules/definition-of-done.md +272 -0
- package/packages/plugin-core/rules/development-environments.md +19 -0
- package/packages/plugin-core/rules/development-workflow.md +198 -0
- package/packages/plugin-core/rules/framework-path-rules.md +180 -0
- package/packages/plugin-core/rules/frontmatter-operations.md +64 -0
- package/packages/plugin-core/rules/git-strategy.md +237 -0
- package/packages/plugin-core/rules/golden-rules.md +181 -0
- package/packages/plugin-core/rules/naming-conventions.md +111 -0
- package/packages/plugin-core/rules/no-pr-workflow.md +183 -0
- package/packages/plugin-core/rules/pipeline-mandatory.md +109 -0
- package/packages/plugin-core/rules/security-checklist.md +318 -0
- package/packages/plugin-core/rules/standard-patterns.md +197 -0
- package/packages/plugin-core/rules/strip-frontmatter.md +85 -0
- package/packages/plugin-core/rules/tdd.enforcement.md +103 -0
- package/packages/plugin-core/rules/use-ast-grep.md +113 -0
- package/packages/plugin-core/scripts/lib/datetime-utils.sh +254 -0
- package/packages/plugin-core/scripts/lib/frontmatter-utils.sh +294 -0
- package/packages/plugin-core/scripts/lib/github-utils.sh +221 -0
- package/packages/plugin-core/scripts/lib/logging-utils.sh +199 -0
- package/packages/plugin-core/scripts/lib/validation-utils.sh +339 -0
- package/packages/plugin-core/scripts/mcp/add.sh +7 -0
- package/packages/plugin-core/scripts/mcp/disable.sh +12 -0
- package/packages/plugin-core/scripts/mcp/enable.sh +12 -0
- package/packages/plugin-core/scripts/mcp/list.sh +7 -0
- package/packages/plugin-core/scripts/mcp/sync.sh +8 -0
- package/packages/plugin-data/README.md +315 -0
- package/packages/plugin-data/agents/airflow-orchestration-expert.md +158 -0
- package/packages/plugin-data/agents/kedro-pipeline-expert.md +304 -0
- package/packages/plugin-data/agents/langgraph-workflow-expert.md +530 -0
- package/packages/plugin-data/commands/airflow-dag-scaffold.md +413 -0
- package/packages/plugin-data/commands/kafka-pipeline-scaffold.md +503 -0
- package/packages/plugin-data/package.json +66 -0
- package/packages/plugin-data/plugin.json +294 -0
- package/packages/plugin-data/rules/data-quality-standards.md +373 -0
- package/packages/plugin-data/rules/etl-pipeline-standards.md +255 -0
- package/packages/plugin-data/scripts/examples/airflow-dag-example.py +245 -0
- package/packages/plugin-data/scripts/examples/dbt-transform-example.sql +238 -0
- package/packages/plugin-data/scripts/examples/kafka-streaming-example.py +257 -0
- package/packages/plugin-data/scripts/examples/pandas-etl-example.py +332 -0
- package/packages/plugin-databases/README.md +330 -0
- package/{autopm/.claude/agents/databases → packages/plugin-databases/agents}/bigquery-expert.md +24 -15
- package/{autopm/.claude/agents/databases → packages/plugin-databases/agents}/cosmosdb-expert.md +22 -15
- package/{autopm/.claude/agents/databases → packages/plugin-databases/agents}/mongodb-expert.md +24 -15
- package/{autopm/.claude/agents/databases → packages/plugin-databases/agents}/postgresql-expert.md +23 -15
- package/{autopm/.claude/agents/databases → packages/plugin-databases/agents}/redis-expert.md +29 -7
- package/packages/plugin-databases/commands/db-optimize.md +612 -0
- package/packages/plugin-databases/package.json +60 -0
- package/packages/plugin-databases/plugin.json +237 -0
- package/packages/plugin-databases/rules/database-management-strategy.md +146 -0
- package/packages/plugin-databases/rules/database-pipeline.md +316 -0
- package/packages/plugin-databases/scripts/examples/bigquery-cost-analyze.sh +160 -0
- package/packages/plugin-databases/scripts/examples/cosmosdb-ru-optimize.sh +163 -0
- package/packages/plugin-databases/scripts/examples/mongodb-shard-check.sh +120 -0
- package/packages/plugin-databases/scripts/examples/postgres-index-analyze.sh +95 -0
- package/packages/plugin-databases/scripts/examples/redis-cache-stats.sh +121 -0
- package/packages/plugin-devops/README.md +367 -0
- package/{autopm/.claude/agents/devops → packages/plugin-devops/agents}/github-operations-specialist.md +1 -1
- package/packages/plugin-devops/commands/ci-pipeline-create.md +581 -0
- package/packages/plugin-devops/commands/docker-optimize.md +493 -0
- package/packages/plugin-devops/hooks/pre-docker-build.js +472 -0
- package/packages/plugin-devops/package.json +61 -0
- package/packages/plugin-devops/plugin.json +302 -0
- package/packages/plugin-devops/rules/github-operations.md +92 -0
- package/packages/plugin-devops/scripts/examples/docker-build-multistage.sh +43 -0
- package/packages/plugin-devops/scripts/examples/docker-compose-validate.sh +74 -0
- package/packages/plugin-devops/scripts/examples/github-workflow-validate.sh +48 -0
- package/packages/plugin-devops/scripts/examples/prometheus-health-check.sh +58 -0
- package/packages/plugin-devops/scripts/examples/ssh-key-setup.sh +74 -0
- package/packages/plugin-frameworks/README.md +309 -0
- package/{autopm/.claude/agents/frameworks → packages/plugin-frameworks/agents}/e2e-test-engineer.md +219 -0
- package/{autopm/.claude/agents/frameworks → packages/plugin-frameworks/agents}/react-frontend-engineer.md +176 -0
- package/{autopm/.claude/agents/frameworks → packages/plugin-frameworks/agents}/tailwindcss-expert.md +251 -0
- package/packages/plugin-frameworks/commands/nextjs-optimize.md +692 -0
- package/packages/plugin-frameworks/commands/react-optimize.md +583 -0
- package/packages/plugin-frameworks/package.json +59 -0
- package/packages/plugin-frameworks/plugin.json +224 -0
- package/packages/plugin-frameworks/rules/performance-guidelines.md +403 -0
- package/packages/plugin-frameworks/scripts/examples/react-component-perf.sh +34 -0
- package/packages/plugin-frameworks/scripts/examples/tailwind-optimize.sh +44 -0
- package/packages/plugin-frameworks/scripts/examples/vue-composition-check.sh +41 -0
- package/packages/plugin-languages/README.md +333 -0
- package/packages/plugin-languages/commands/javascript-optimize.md +636 -0
- package/packages/plugin-languages/commands/nodejs-api-scaffold.md +341 -0
- package/packages/plugin-languages/commands/nodejs-optimize.md +689 -0
- package/packages/plugin-languages/commands/python-api-scaffold.md +261 -0
- package/packages/plugin-languages/commands/python-optimize.md +593 -0
- package/packages/plugin-languages/package.json +65 -0
- package/packages/plugin-languages/plugin.json +265 -0
- package/packages/plugin-languages/rules/code-quality-standards.md +496 -0
- package/packages/plugin-languages/rules/testing-standards.md +768 -0
- package/packages/plugin-languages/scripts/examples/bash-production-script.sh +520 -0
- package/packages/plugin-languages/scripts/examples/javascript-es6-patterns.js +291 -0
- package/packages/plugin-languages/scripts/examples/nodejs-async-iteration.js +360 -0
- package/packages/plugin-languages/scripts/examples/python-async-patterns.py +289 -0
- package/packages/plugin-languages/scripts/examples/typescript-patterns.ts +432 -0
- package/packages/plugin-ml/README.md +430 -0
- package/packages/plugin-ml/agents/automl-expert.md +326 -0
- package/packages/plugin-ml/agents/computer-vision-expert.md +550 -0
- package/packages/plugin-ml/agents/gradient-boosting-expert.md +455 -0
- package/packages/plugin-ml/agents/neural-network-architect.md +1228 -0
- package/packages/plugin-ml/agents/nlp-transformer-expert.md +584 -0
- package/packages/plugin-ml/agents/pytorch-expert.md +412 -0
- package/packages/plugin-ml/agents/reinforcement-learning-expert.md +2088 -0
- package/packages/plugin-ml/agents/scikit-learn-expert.md +228 -0
- package/packages/plugin-ml/agents/tensorflow-keras-expert.md +509 -0
- package/packages/plugin-ml/agents/time-series-expert.md +303 -0
- package/packages/plugin-ml/commands/ml-automl.md +572 -0
- package/packages/plugin-ml/commands/ml-train-optimize.md +657 -0
- package/packages/plugin-ml/package.json +52 -0
- package/packages/plugin-ml/plugin.json +338 -0
- package/packages/plugin-pm/README.md +368 -0
- package/packages/plugin-pm/claudeautopm-plugin-pm-2.0.0.tgz +0 -0
- package/packages/plugin-pm/commands/github/workflow-create.md +42 -0
- package/packages/plugin-pm/package.json +57 -0
- package/packages/plugin-pm/plugin.json +503 -0
- package/packages/plugin-testing/README.md +401 -0
- package/{autopm/.claude/agents/testing → packages/plugin-testing/agents}/frontend-testing-engineer.md +373 -0
- package/packages/plugin-testing/commands/jest-optimize.md +800 -0
- package/packages/plugin-testing/commands/playwright-optimize.md +887 -0
- package/packages/plugin-testing/commands/test-coverage.md +512 -0
- package/packages/plugin-testing/commands/test-performance.md +1041 -0
- package/packages/plugin-testing/commands/test-setup.md +414 -0
- package/packages/plugin-testing/package.json +40 -0
- package/packages/plugin-testing/plugin.json +197 -0
- package/packages/plugin-testing/rules/test-coverage-requirements.md +581 -0
- package/packages/plugin-testing/rules/testing-standards.md +529 -0
- package/packages/plugin-testing/scripts/examples/react-testing-example.test.jsx +460 -0
- package/packages/plugin-testing/scripts/examples/vitest-config-example.js +352 -0
- package/packages/plugin-testing/scripts/examples/vue-testing-example.test.js +586 -0
- package/scripts/publish-plugins.sh +166 -0
- package/autopm/.claude/agents/data/airflow-orchestration-expert.md +0 -52
- package/autopm/.claude/agents/data/kedro-pipeline-expert.md +0 -50
- package/autopm/.claude/agents/integration/message-queue-engineer.md +0 -794
- package/autopm/.claude/commands/ai/langgraph-workflow.md +0 -65
- package/autopm/.claude/commands/ai/openai-chat.md +0 -65
- package/autopm/.claude/commands/playwright/test-scaffold.md +0 -38
- package/autopm/.claude/commands/python/api-scaffold.md +0 -50
- package/autopm/.claude/commands/python/docs-query.md +0 -48
- package/autopm/.claude/commands/testing/prime.md +0 -314
- package/autopm/.claude/commands/testing/run.md +0 -125
- package/autopm/.claude/commands/ui/bootstrap-scaffold.md +0 -65
- package/autopm/.claude/rules/database-management-strategy.md +0 -17
- package/autopm/.claude/rules/database-pipeline.md +0 -94
- package/autopm/.claude/rules/ux-design-rules.md +0 -209
- package/autopm/.claude/rules/visual-testing.md +0 -223
- package/autopm/.claude/scripts/azure/README.md +0 -192
- package/autopm/.claude/scripts/azure/active-work.js +0 -524
- package/autopm/.claude/scripts/azure/active-work.sh +0 -20
- package/autopm/.claude/scripts/azure/blocked.js +0 -520
- package/autopm/.claude/scripts/azure/blocked.sh +0 -20
- package/autopm/.claude/scripts/azure/daily.js +0 -533
- package/autopm/.claude/scripts/azure/daily.sh +0 -20
- package/autopm/.claude/scripts/azure/dashboard.js +0 -970
- package/autopm/.claude/scripts/azure/dashboard.sh +0 -20
- package/autopm/.claude/scripts/azure/feature-list.js +0 -254
- package/autopm/.claude/scripts/azure/feature-list.sh +0 -20
- package/autopm/.claude/scripts/azure/feature-show.js +0 -7
- package/autopm/.claude/scripts/azure/feature-show.sh +0 -20
- package/autopm/.claude/scripts/azure/feature-status.js +0 -604
- package/autopm/.claude/scripts/azure/feature-status.sh +0 -20
- package/autopm/.claude/scripts/azure/help.js +0 -342
- package/autopm/.claude/scripts/azure/help.sh +0 -20
- package/autopm/.claude/scripts/azure/next-task.js +0 -508
- package/autopm/.claude/scripts/azure/next-task.sh +0 -20
- package/autopm/.claude/scripts/azure/search.js +0 -469
- package/autopm/.claude/scripts/azure/search.sh +0 -20
- package/autopm/.claude/scripts/azure/setup.js +0 -745
- package/autopm/.claude/scripts/azure/setup.sh +0 -20
- package/autopm/.claude/scripts/azure/sprint-report.js +0 -1012
- package/autopm/.claude/scripts/azure/sprint-report.sh +0 -20
- package/autopm/.claude/scripts/azure/sync.js +0 -563
- package/autopm/.claude/scripts/azure/sync.sh +0 -20
- package/autopm/.claude/scripts/azure/us-list.js +0 -210
- package/autopm/.claude/scripts/azure/us-list.sh +0 -20
- package/autopm/.claude/scripts/azure/us-status.js +0 -238
- package/autopm/.claude/scripts/azure/us-status.sh +0 -20
- package/autopm/.claude/scripts/azure/validate.js +0 -626
- package/autopm/.claude/scripts/azure/validate.sh +0 -20
- package/autopm/.claude/scripts/azure/wrapper-template.sh +0 -20
- package/autopm/.claude/scripts/github/dependency-tracker.js +0 -554
- package/autopm/.claude/scripts/github/dependency-validator.js +0 -545
- package/autopm/.claude/scripts/github/dependency-visualizer.js +0 -477
- package/bin/node/azure-feature-show.js +0 -7
- /package/{autopm/.claude/agents/cloud → packages/plugin-ai/agents}/gemini-api-expert.md +0 -0
- /package/{autopm/.claude/agents/data → packages/plugin-ai/agents}/langgraph-workflow-expert.md +0 -0
- /package/{autopm/.claude/agents/cloud → packages/plugin-ai/agents}/openai-python-expert.md +0 -0
- /package/{autopm/.claude/agents/cloud → packages/plugin-cloud/agents}/README.md +0 -0
- /package/{autopm/.claude/agents/cloud → packages/plugin-cloud/agents}/aws-cloud-architect.md +0 -0
- /package/{autopm/.claude/agents/cloud → packages/plugin-cloud/agents}/azure-cloud-architect.md +0 -0
- /package/{autopm/.claude/agents/cloud → packages/plugin-cloud/agents}/gcp-cloud-architect.md +0 -0
- /package/{autopm/.claude/agents/cloud → packages/plugin-cloud/agents}/gcp-cloud-functions-engineer.md +0 -0
- /package/{autopm/.claude/agents/cloud → packages/plugin-cloud/agents}/kubernetes-orchestrator.md +0 -0
- /package/{autopm/.claude/agents/cloud → packages/plugin-cloud/agents}/terraform-infrastructure-expert.md +0 -0
- /package/{autopm/.claude/commands/cloud → packages/plugin-cloud/commands}/infra-deploy.md +0 -0
- /package/{autopm/.claude/commands/kubernetes/deploy.md → packages/plugin-cloud/commands/k8s-deploy.md} +0 -0
- /package/{autopm/.claude/commands/infrastructure → packages/plugin-cloud/commands}/ssh-security.md +0 -0
- /package/{autopm/.claude/commands/infrastructure → packages/plugin-cloud/commands}/traefik-setup.md +0 -0
- /package/{autopm/.claude → packages/plugin-cloud}/rules/infrastructure-pipeline.md +0 -0
- /package/{autopm/.claude → packages/plugin-core}/agents/core/agent-manager.md +0 -0
- /package/{autopm/.claude → packages/plugin-core}/agents/core/code-analyzer.md +0 -0
- /package/{autopm/.claude → packages/plugin-core}/agents/core/file-analyzer.md +0 -0
- /package/{autopm/.claude → packages/plugin-core}/agents/core/test-runner.md +0 -0
- /package/{autopm/.claude → packages/plugin-core}/rules/ai-integration-patterns.md +0 -0
- /package/{autopm/.claude → packages/plugin-core}/rules/performance-guidelines.md +0 -0
- /package/{autopm/.claude/agents/databases → packages/plugin-databases/agents}/README.md +0 -0
- /package/{autopm/.claude/agents/devops → packages/plugin-devops/agents}/README.md +0 -0
- /package/{autopm/.claude/agents/devops → packages/plugin-devops/agents}/azure-devops-specialist.md +0 -0
- /package/{autopm/.claude/agents/devops → packages/plugin-devops/agents}/docker-containerization-expert.md +0 -0
- /package/{autopm/.claude/agents/devops → packages/plugin-devops/agents}/mcp-context-manager.md +0 -0
- /package/{autopm/.claude/agents/devops → packages/plugin-devops/agents}/observability-engineer.md +0 -0
- /package/{autopm/.claude/agents/devops → packages/plugin-devops/agents}/ssh-operations-expert.md +0 -0
- /package/{autopm/.claude/agents/devops → packages/plugin-devops/agents}/traefik-proxy-expert.md +0 -0
- /package/{autopm/.claude/commands/github → packages/plugin-devops/commands}/workflow-create.md +0 -0
- /package/{autopm/.claude → packages/plugin-devops}/rules/ci-cd-kubernetes-strategy.md +0 -0
- /package/{autopm/.claude → packages/plugin-devops}/rules/devops-troubleshooting-playbook.md +0 -0
- /package/{autopm/.claude → packages/plugin-devops}/rules/docker-first-development.md +0 -0
- /package/{autopm/.claude/agents/frameworks → packages/plugin-frameworks/agents}/README.md +0 -0
- /package/{autopm/.claude/agents/frameworks → packages/plugin-frameworks/agents}/nats-messaging-expert.md +0 -0
- /package/{autopm/.claude/agents/frameworks → packages/plugin-frameworks/agents}/react-ui-expert.md +0 -0
- /package/{autopm/.claude/agents/frameworks → packages/plugin-frameworks/agents}/ux-design-expert.md +0 -0
- /package/{autopm/.claude/commands/react → packages/plugin-frameworks/commands}/app-scaffold.md +0 -0
- /package/{autopm/.claude/commands/ui → packages/plugin-frameworks/commands}/tailwind-system.md +0 -0
- /package/{autopm/.claude → packages/plugin-frameworks}/rules/ui-development-standards.md +0 -0
- /package/{autopm/.claude → packages/plugin-frameworks}/rules/ui-framework-rules.md +0 -0
- /package/{autopm/.claude/agents/languages → packages/plugin-languages/agents}/README.md +0 -0
- /package/{autopm/.claude/agents/languages → packages/plugin-languages/agents}/bash-scripting-expert.md +0 -0
- /package/{autopm/.claude/agents/languages → packages/plugin-languages/agents}/javascript-frontend-engineer.md +0 -0
- /package/{autopm/.claude/agents/languages → packages/plugin-languages/agents}/nodejs-backend-engineer.md +0 -0
- /package/{autopm/.claude/agents/languages → packages/plugin-languages/agents}/python-backend-engineer.md +0 -0
- /package/{autopm/.claude/agents/languages → packages/plugin-languages/agents}/python-backend-expert.md +0 -0
- /package/{autopm/.claude → packages/plugin-pm}/commands/azure/COMMANDS.md +0 -0
- /package/{autopm/.claude → packages/plugin-pm}/commands/azure/COMMAND_MAPPING.md +0 -0
- /package/{autopm/.claude → packages/plugin-pm}/commands/azure/INTEGRATION_FIX.md +0 -0
- /package/{autopm/.claude → packages/plugin-pm}/commands/azure/README.md +0 -0
- /package/{autopm/.claude → packages/plugin-pm}/commands/azure/active-work.md +0 -0
- /package/{autopm/.claude → packages/plugin-pm}/commands/azure/aliases.md +0 -0
- /package/{autopm/.claude → packages/plugin-pm}/commands/azure/blocked-items.md +0 -0
- /package/{autopm/.claude → packages/plugin-pm}/commands/azure/clean.md +0 -0
- /package/{autopm/.claude → packages/plugin-pm}/commands/azure/docs-query.md +0 -0
- /package/{autopm/.claude → packages/plugin-pm}/commands/azure/feature-decompose.md +0 -0
- /package/{autopm/.claude → packages/plugin-pm}/commands/azure/feature-list.md +0 -0
- /package/{autopm/.claude → packages/plugin-pm}/commands/azure/feature-new.md +0 -0
- /package/{autopm/.claude → packages/plugin-pm}/commands/azure/feature-show.md +0 -0
- /package/{autopm/.claude → packages/plugin-pm}/commands/azure/feature-start.md +0 -0
- /package/{autopm/.claude → packages/plugin-pm}/commands/azure/fix-integration-example.md +0 -0
- /package/{autopm/.claude → packages/plugin-pm}/commands/azure/help.md +0 -0
- /package/{autopm/.claude → packages/plugin-pm}/commands/azure/import-us.md +0 -0
- /package/{autopm/.claude → packages/plugin-pm}/commands/azure/init.md +0 -0
- /package/{autopm/.claude → packages/plugin-pm}/commands/azure/next-task.md +0 -0
- /package/{autopm/.claude → packages/plugin-pm}/commands/azure/search.md +0 -0
- /package/{autopm/.claude → packages/plugin-pm}/commands/azure/sprint-status.md +0 -0
- /package/{autopm/.claude → packages/plugin-pm}/commands/azure/standup.md +0 -0
- /package/{autopm/.claude → packages/plugin-pm}/commands/azure/sync-all.md +0 -0
- /package/{autopm/.claude → packages/plugin-pm}/commands/azure/task-analyze.md +0 -0
- /package/{autopm/.claude → packages/plugin-pm}/commands/azure/task-close.md +0 -0
- /package/{autopm/.claude → packages/plugin-pm}/commands/azure/task-edit.md +0 -0
- /package/{autopm/.claude → packages/plugin-pm}/commands/azure/task-list.md +0 -0
- /package/{autopm/.claude → packages/plugin-pm}/commands/azure/task-new.md +0 -0
- /package/{autopm/.claude → packages/plugin-pm}/commands/azure/task-reopen.md +0 -0
- /package/{autopm/.claude → packages/plugin-pm}/commands/azure/task-show.md +0 -0
- /package/{autopm/.claude → packages/plugin-pm}/commands/azure/task-start.md +0 -0
- /package/{autopm/.claude → packages/plugin-pm}/commands/azure/task-status.md +0 -0
- /package/{autopm/.claude → packages/plugin-pm}/commands/azure/task-sync.md +0 -0
- /package/{autopm/.claude → packages/plugin-pm}/commands/azure/us-edit.md +0 -0
- /package/{autopm/.claude → packages/plugin-pm}/commands/azure/us-list.md +0 -0
- /package/{autopm/.claude → packages/plugin-pm}/commands/azure/us-new.md +0 -0
- /package/{autopm/.claude → packages/plugin-pm}/commands/azure/us-parse.md +0 -0
- /package/{autopm/.claude → packages/plugin-pm}/commands/azure/us-show.md +0 -0
- /package/{autopm/.claude → packages/plugin-pm}/commands/azure/us-status.md +0 -0
- /package/{autopm/.claude → packages/plugin-pm}/commands/azure/validate.md +0 -0
- /package/{autopm/.claude → packages/plugin-pm}/commands/azure/work-item-sync.md +0 -0
- /package/{autopm/.claude/commands/pm → packages/plugin-pm/commands}/blocked.md +0 -0
- /package/{autopm/.claude/commands/pm → packages/plugin-pm/commands}/clean.md +0 -0
- /package/{autopm/.claude/commands/pm → packages/plugin-pm/commands}/context-create.md +0 -0
- /package/{autopm/.claude/commands/pm → packages/plugin-pm/commands}/context-prime.md +0 -0
- /package/{autopm/.claude/commands/pm → packages/plugin-pm/commands}/context-update.md +0 -0
- /package/{autopm/.claude/commands/pm → packages/plugin-pm/commands}/context.md +0 -0
- /package/{autopm/.claude/commands/pm → packages/plugin-pm/commands}/epic-close.md +0 -0
- /package/{autopm/.claude/commands/pm → packages/plugin-pm/commands}/epic-decompose.md +0 -0
- /package/{autopm/.claude/commands/pm → packages/plugin-pm/commands}/epic-edit.md +0 -0
- /package/{autopm/.claude/commands/pm → packages/plugin-pm/commands}/epic-list.md +0 -0
- /package/{autopm/.claude/commands/pm → packages/plugin-pm/commands}/epic-merge.md +0 -0
- /package/{autopm/.claude/commands/pm → packages/plugin-pm/commands}/epic-oneshot.md +0 -0
- /package/{autopm/.claude/commands/pm → packages/plugin-pm/commands}/epic-refresh.md +0 -0
- /package/{autopm/.claude/commands/pm → packages/plugin-pm/commands}/epic-show.md +0 -0
- /package/{autopm/.claude/commands/pm → packages/plugin-pm/commands}/epic-split.md +0 -0
- /package/{autopm/.claude/commands/pm → packages/plugin-pm/commands}/epic-start.md +0 -0
- /package/{autopm/.claude/commands/pm → packages/plugin-pm/commands}/epic-status.md +0 -0
- /package/{autopm/.claude/commands/pm → packages/plugin-pm/commands}/epic-sync-modular.md +0 -0
- /package/{autopm/.claude/commands/pm → packages/plugin-pm/commands}/epic-sync-original.md +0 -0
- /package/{autopm/.claude/commands/pm → packages/plugin-pm/commands}/epic-sync.md +0 -0
- /package/{autopm/.claude/commands/pm → packages/plugin-pm/commands}/help.md +0 -0
- /package/{autopm/.claude/commands/pm → packages/plugin-pm/commands}/import.md +0 -0
- /package/{autopm/.claude/commands/pm → packages/plugin-pm/commands}/in-progress.md +0 -0
- /package/{autopm/.claude/commands/pm → packages/plugin-pm/commands}/init.md +0 -0
- /package/{autopm/.claude/commands/pm → packages/plugin-pm/commands}/issue-analyze.md +0 -0
- /package/{autopm/.claude/commands/pm → packages/plugin-pm/commands}/issue-close.md +0 -0
- /package/{autopm/.claude/commands/pm → packages/plugin-pm/commands}/issue-edit.md +0 -0
- /package/{autopm/.claude/commands/pm → packages/plugin-pm/commands}/issue-reopen.md +0 -0
- /package/{autopm/.claude/commands/pm → packages/plugin-pm/commands}/issue-show.md +0 -0
- /package/{autopm/.claude/commands/pm → packages/plugin-pm/commands}/issue-start.md +0 -0
- /package/{autopm/.claude/commands/pm → packages/plugin-pm/commands}/issue-status.md +0 -0
- /package/{autopm/.claude/commands/pm → packages/plugin-pm/commands}/issue-sync.md +0 -0
- /package/{autopm/.claude/commands/pm → packages/plugin-pm/commands}/next.md +0 -0
- /package/{autopm/.claude/commands/pm → packages/plugin-pm/commands}/prd-edit.md +0 -0
- /package/{autopm/.claude/commands/pm → packages/plugin-pm/commands}/prd-list.md +0 -0
- /package/{autopm/.claude/commands/pm → packages/plugin-pm/commands}/prd-new.md +0 -0
- /package/{autopm/.claude/commands/pm → packages/plugin-pm/commands}/prd-parse.md +0 -0
- /package/{autopm/.claude/commands/pm → packages/plugin-pm/commands}/prd-status.md +0 -0
- /package/{autopm/.claude/commands/pm → packages/plugin-pm/commands}/search.md +0 -0
- /package/{autopm/.claude/commands/pm → packages/plugin-pm/commands}/standup.md +0 -0
- /package/{autopm/.claude/commands/pm → packages/plugin-pm/commands}/status.md +0 -0
- /package/{autopm/.claude/commands/pm → packages/plugin-pm/commands}/sync.md +0 -0
- /package/{autopm/.claude/commands/pm → packages/plugin-pm/commands}/test-reference-update.md +0 -0
- /package/{autopm/.claude/commands/pm → packages/plugin-pm/commands}/validate.md +0 -0
- /package/{autopm/.claude/commands/pm → packages/plugin-pm/commands}/what-next.md +0 -0
- /package/{autopm/.claude → packages/plugin-pm}/scripts/pm/analytics.js +0 -0
- /package/{autopm/.claude → packages/plugin-pm}/scripts/pm/blocked.js +0 -0
- /package/{autopm/.claude → packages/plugin-pm}/scripts/pm/blocked.sh +0 -0
- /package/{autopm/.claude → packages/plugin-pm}/scripts/pm/clean.js +0 -0
- /package/{autopm/.claude → packages/plugin-pm}/scripts/pm/context-create.js +0 -0
- /package/{autopm/.claude → packages/plugin-pm}/scripts/pm/context-prime.js +0 -0
- /package/{autopm/.claude → packages/plugin-pm}/scripts/pm/context-update.js +0 -0
- /package/{autopm/.claude → packages/plugin-pm}/scripts/pm/context.js +0 -0
- /package/{autopm/.claude → packages/plugin-pm}/scripts/pm/epic-close.js +0 -0
- /package/{autopm/.claude → packages/plugin-pm}/scripts/pm/epic-edit.js +0 -0
- /package/{autopm/.claude → packages/plugin-pm}/scripts/pm/epic-list.js +0 -0
- /package/{autopm/.claude → packages/plugin-pm}/scripts/pm/epic-list.sh +0 -0
- /package/{autopm/.claude → packages/plugin-pm}/scripts/pm/epic-show.js +0 -0
- /package/{autopm/.claude → packages/plugin-pm}/scripts/pm/epic-show.sh +0 -0
- /package/{autopm/.claude → packages/plugin-pm}/scripts/pm/epic-split.js +0 -0
- /package/{autopm/.claude → packages/plugin-pm}/scripts/pm/epic-start/epic-start.js +0 -0
- /package/{autopm/.claude → packages/plugin-pm}/scripts/pm/epic-start/epic-start.sh +0 -0
- /package/{autopm/.claude → packages/plugin-pm}/scripts/pm/epic-status.js +0 -0
- /package/{autopm/.claude → packages/plugin-pm}/scripts/pm/epic-status.sh +0 -0
- /package/{autopm/.claude → packages/plugin-pm}/scripts/pm/epic-sync/README.md +0 -0
- /package/{autopm/.claude → packages/plugin-pm}/scripts/pm/epic-sync/create-epic-issue.sh +0 -0
- /package/{autopm/.claude → packages/plugin-pm}/scripts/pm/epic-sync/create-task-issues.sh +0 -0
- /package/{autopm/.claude → packages/plugin-pm}/scripts/pm/epic-sync/update-epic-file.sh +0 -0
- /package/{autopm/.claude → packages/plugin-pm}/scripts/pm/epic-sync/update-references.sh +0 -0
- /package/{autopm/.claude → packages/plugin-pm}/scripts/pm/epic-sync.sh +0 -0
- /package/{autopm/.claude → packages/plugin-pm}/scripts/pm/help.js +0 -0
- /package/{autopm/.claude → packages/plugin-pm}/scripts/pm/help.sh +0 -0
- /package/{autopm/.claude → packages/plugin-pm}/scripts/pm/in-progress.js +0 -0
- /package/{autopm/.claude → packages/plugin-pm}/scripts/pm/in-progress.sh +0 -0
- /package/{autopm/.claude → packages/plugin-pm}/scripts/pm/init.js +0 -0
- /package/{autopm/.claude → packages/plugin-pm}/scripts/pm/init.sh +0 -0
- /package/{autopm/.claude → packages/plugin-pm}/scripts/pm/issue-close.js +0 -0
- /package/{autopm/.claude → packages/plugin-pm}/scripts/pm/issue-edit.js +0 -0
- /package/{autopm/.claude → packages/plugin-pm}/scripts/pm/issue-show.js +0 -0
- /package/{autopm/.claude → packages/plugin-pm}/scripts/pm/issue-start.js +0 -0
- /package/{autopm/.claude → packages/plugin-pm}/scripts/pm/issue-sync/format-comment.sh +0 -0
- /package/{autopm/.claude → packages/plugin-pm}/scripts/pm/issue-sync/gather-updates.sh +0 -0
- /package/{autopm/.claude → packages/plugin-pm}/scripts/pm/issue-sync/post-comment.sh +0 -0
- /package/{autopm/.claude → packages/plugin-pm}/scripts/pm/issue-sync/preflight-validation.sh +0 -0
- /package/{autopm/.claude → packages/plugin-pm}/scripts/pm/issue-sync/update-frontmatter.sh +0 -0
- /package/{autopm/.claude → packages/plugin-pm}/scripts/pm/lib/README.md +0 -0
- /package/{autopm/.claude → packages/plugin-pm}/scripts/pm/lib/epic-discovery.js +0 -0
- /package/{autopm/.claude → packages/plugin-pm}/scripts/pm/lib/logger.js +0 -0
- /package/{autopm/.claude → packages/plugin-pm}/scripts/pm/next.js +0 -0
- /package/{autopm/.claude → packages/plugin-pm}/scripts/pm/next.sh +0 -0
- /package/{autopm/.claude → packages/plugin-pm}/scripts/pm/optimize.js +0 -0
- /package/{autopm/.claude → packages/plugin-pm}/scripts/pm/pr-create.js +0 -0
- /package/{autopm/.claude → packages/plugin-pm}/scripts/pm/pr-list.js +0 -0
- /package/{autopm/.claude → packages/plugin-pm}/scripts/pm/prd-list.js +0 -0
- /package/{autopm/.claude → packages/plugin-pm}/scripts/pm/prd-list.sh +0 -0
- /package/{autopm/.claude → packages/plugin-pm}/scripts/pm/prd-new.js +0 -0
- /package/{autopm/.claude → packages/plugin-pm}/scripts/pm/prd-parse.js +0 -0
- /package/{autopm/.claude → packages/plugin-pm}/scripts/pm/prd-status.js +0 -0
- /package/{autopm/.claude → packages/plugin-pm}/scripts/pm/prd-status.sh +0 -0
- /package/{autopm/.claude → packages/plugin-pm}/scripts/pm/release.js +0 -0
- /package/{autopm/.claude → packages/plugin-pm}/scripts/pm/search.js +0 -0
- /package/{autopm/.claude → packages/plugin-pm}/scripts/pm/search.sh +0 -0
- /package/{autopm/.claude → packages/plugin-pm}/scripts/pm/standup.js +0 -0
- /package/{autopm/.claude → packages/plugin-pm}/scripts/pm/standup.sh +0 -0
- /package/{autopm/.claude → packages/plugin-pm}/scripts/pm/status.js +0 -0
- /package/{autopm/.claude → packages/plugin-pm}/scripts/pm/status.sh +0 -0
- /package/{autopm/.claude → packages/plugin-pm}/scripts/pm/sync-batch.js +0 -0
- /package/{autopm/.claude → packages/plugin-pm}/scripts/pm/sync.js +0 -0
- /package/{autopm/.claude → packages/plugin-pm}/scripts/pm/template-list.js +0 -0
- /package/{autopm/.claude → packages/plugin-pm}/scripts/pm/template-new.js +0 -0
- /package/{autopm/.claude → packages/plugin-pm}/scripts/pm/validate.js +0 -0
- /package/{autopm/.claude → packages/plugin-pm}/scripts/pm/validate.sh +0 -0
- /package/{autopm/.claude → packages/plugin-pm}/scripts/pm/what-next.js +0 -0
|
@@ -0,0 +1,886 @@
|
|
|
1
|
+
---
|
|
2
|
+
allowed-tools: Bash, Read, Write, LS
|
|
3
|
+
---
|
|
4
|
+
|
|
5
|
+
# a2a:setup
|
|
6
|
+
|
|
7
|
+
Setup Google A2A (Agent-to-Agent) protocol with Context7-verified Vertex AI Agent Builder configuration and multi-agent orchestration.
|
|
8
|
+
|
|
9
|
+
## Description
|
|
10
|
+
|
|
11
|
+
Comprehensive A2A protocol implementation following Google Cloud best practices:
|
|
12
|
+
- Vertex AI Agent Builder configuration
|
|
13
|
+
- A2A protocol implementation (gRPC/REST)
|
|
14
|
+
- Multi-agent orchestration patterns
|
|
15
|
+
- Agent discovery and registration
|
|
16
|
+
- Message passing and state management
|
|
17
|
+
- Tool sharing between agents
|
|
18
|
+
- Observability and monitoring
|
|
19
|
+
|
|
20
|
+
## Required Documentation Access
|
|
21
|
+
|
|
22
|
+
**MANDATORY:** Before setup, query Context7 for Google A2A best practices:
|
|
23
|
+
|
|
24
|
+
**Documentation Queries:**
|
|
25
|
+
- `mcp://context7/googleapis/google-cloud-python/vertexai` - Vertex AI Agent Builder
|
|
26
|
+
- `mcp://context7/google-cloud/agent-builder` - Agent creation and management
|
|
27
|
+
- `mcp://context7/google-cloud/a2a-protocol` - A2A protocol specification
|
|
28
|
+
- `mcp://context7/google-cloud/multi-agent` - Multi-agent orchestration
|
|
29
|
+
- `mcp://context7/google-cloud/grpc-patterns` - gRPC communication patterns
|
|
30
|
+
- `mcp://context7/langchain/google-vertex` - LangChain Vertex AI integration
|
|
31
|
+
|
|
32
|
+
**Why This is Required:**
|
|
33
|
+
- Ensures setup follows official Google Cloud documentation
|
|
34
|
+
- Applies proven A2A protocol patterns
|
|
35
|
+
- Validates agent orchestration strategies
|
|
36
|
+
- Prevents integration issues
|
|
37
|
+
- Implements proper security and auth
|
|
38
|
+
- Optimizes multi-agent performance
|
|
39
|
+
|
|
40
|
+
## Usage
|
|
41
|
+
|
|
42
|
+
```bash
|
|
43
|
+
/a2a:setup [options]
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
## Options
|
|
47
|
+
|
|
48
|
+
- `--protocol <grpc|rest>` - Communication protocol (default: grpc)
|
|
49
|
+
- `--region <us-central1|europe-west1>` - GCP region (default: us-central1)
|
|
50
|
+
- `--project-id <id>` - GCP project ID
|
|
51
|
+
- `--output <file>` - Write setup report
|
|
52
|
+
|
|
53
|
+
## Examples
|
|
54
|
+
|
|
55
|
+
### Full A2A Setup
|
|
56
|
+
```bash
|
|
57
|
+
/a2a:setup --project-id my-project --region us-central1
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
### REST Protocol Setup
|
|
61
|
+
```bash
|
|
62
|
+
/a2a:setup --protocol rest --project-id my-project
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
### Generate Configuration
|
|
66
|
+
```bash
|
|
67
|
+
/a2a:setup --output a2a-config.yaml
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
## Setup Categories
|
|
71
|
+
|
|
72
|
+
### 1. Vertex AI Agent Builder Configuration (Context7-Verified)
|
|
73
|
+
|
|
74
|
+
**Pattern from Context7 (/googleapis/google-cloud-python/vertexai):**
|
|
75
|
+
|
|
76
|
+
#### Create Agent with Vertex AI
|
|
77
|
+
```python
|
|
78
|
+
from google.cloud import aiplatform
|
|
79
|
+
from vertexai.preview.agents import Agent
|
|
80
|
+
|
|
81
|
+
# Initialize Vertex AI
|
|
82
|
+
aiplatform.init(
|
|
83
|
+
project="my-project-id",
|
|
84
|
+
location="us-central1"
|
|
85
|
+
)
|
|
86
|
+
|
|
87
|
+
# Create agent
|
|
88
|
+
agent = Agent.create(
|
|
89
|
+
display_name="research-agent",
|
|
90
|
+
description="Agent for research and information gathering",
|
|
91
|
+
instructions="""
|
|
92
|
+
You are a research assistant that helps users find and summarize information.
|
|
93
|
+
You have access to web search and document retrieval tools.
|
|
94
|
+
Always cite your sources.
|
|
95
|
+
""",
|
|
96
|
+
model="gemini-2.0-flash-exp",
|
|
97
|
+
tools=[
|
|
98
|
+
{"google_search": {}},
|
|
99
|
+
{"code_interpreter": {}},
|
|
100
|
+
{"function_declarations": [
|
|
101
|
+
{
|
|
102
|
+
"name": "search_documents",
|
|
103
|
+
"description": "Search internal document database",
|
|
104
|
+
"parameters": {
|
|
105
|
+
"type": "object",
|
|
106
|
+
"properties": {
|
|
107
|
+
"query": {"type": "string"},
|
|
108
|
+
"limit": {"type": "integer", "default": 10}
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
]}
|
|
113
|
+
]
|
|
114
|
+
)
|
|
115
|
+
|
|
116
|
+
print(f"Agent created: {agent.resource_name}")
|
|
117
|
+
print(f"Agent ID: {agent.name}")
|
|
118
|
+
```
|
|
119
|
+
|
|
120
|
+
**Agent Configuration:**
|
|
121
|
+
- Models: gemini-2.0-flash-exp, gemini-1.5-pro, gemini-1.5-flash
|
|
122
|
+
- Built-in tools: Google Search, Code Interpreter
|
|
123
|
+
- Custom tools: Function declarations, HTTP endpoints
|
|
124
|
+
- Instructions: System prompt for agent behavior
|
|
125
|
+
|
|
126
|
+
#### List and Manage Agents
|
|
127
|
+
```python
|
|
128
|
+
# List all agents
|
|
129
|
+
agents = Agent.list()
|
|
130
|
+
|
|
131
|
+
for agent in agents:
|
|
132
|
+
print(f"Agent: {agent.display_name}")
|
|
133
|
+
print(f" ID: {agent.name}")
|
|
134
|
+
print(f" Model: {agent.model}")
|
|
135
|
+
|
|
136
|
+
# Get specific agent
|
|
137
|
+
agent = Agent.get("projects/123/locations/us-central1/agents/456")
|
|
138
|
+
|
|
139
|
+
# Update agent
|
|
140
|
+
agent.instructions = "Updated instructions..."
|
|
141
|
+
agent.update()
|
|
142
|
+
|
|
143
|
+
# Delete agent
|
|
144
|
+
agent.delete()
|
|
145
|
+
```
|
|
146
|
+
|
|
147
|
+
### 2. A2A Protocol Implementation (Context7-Verified)
|
|
148
|
+
|
|
149
|
+
**Pattern from Context7 (/google-cloud/a2a-protocol):**
|
|
150
|
+
|
|
151
|
+
#### A2A Message Format (Protocol Buffers)
|
|
152
|
+
```protobuf
|
|
153
|
+
// a2a.proto
|
|
154
|
+
syntax = "proto3";
|
|
155
|
+
|
|
156
|
+
package a2a;
|
|
157
|
+
|
|
158
|
+
// Agent-to-Agent message
|
|
159
|
+
message A2AMessage {
|
|
160
|
+
string sender_id = 1; // Sending agent ID
|
|
161
|
+
string receiver_id = 2; // Target agent ID
|
|
162
|
+
string conversation_id = 3; // Conversation context
|
|
163
|
+
MessageType type = 4;
|
|
164
|
+
oneof content {
|
|
165
|
+
Request request = 5;
|
|
166
|
+
Response response = 6;
|
|
167
|
+
Event event = 7;
|
|
168
|
+
}
|
|
169
|
+
map<string, string> metadata = 8;
|
|
170
|
+
int64 timestamp = 9;
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
enum MessageType {
|
|
174
|
+
REQUEST = 0;
|
|
175
|
+
RESPONSE = 1;
|
|
176
|
+
EVENT = 2;
|
|
177
|
+
ERROR = 3;
|
|
178
|
+
}
|
|
179
|
+
|
|
180
|
+
message Request {
|
|
181
|
+
string action = 1; // Action to perform
|
|
182
|
+
map<string, string> params = 2;
|
|
183
|
+
}
|
|
184
|
+
|
|
185
|
+
message Response {
|
|
186
|
+
bool success = 1;
|
|
187
|
+
string result = 2;
|
|
188
|
+
string error = 3;
|
|
189
|
+
}
|
|
190
|
+
|
|
191
|
+
message Event {
|
|
192
|
+
string event_type = 1;
|
|
193
|
+
string data = 2;
|
|
194
|
+
}
|
|
195
|
+
```
|
|
196
|
+
|
|
197
|
+
#### gRPC A2A Service
|
|
198
|
+
```python
|
|
199
|
+
import grpc
|
|
200
|
+
from concurrent import futures
|
|
201
|
+
import a2a_pb2
|
|
202
|
+
import a2a_pb2_grpc
|
|
203
|
+
|
|
204
|
+
class A2AService(a2a_pb2_grpc.A2AServiceServicer):
|
|
205
|
+
"""Agent-to-Agent communication service."""
|
|
206
|
+
|
|
207
|
+
def __init__(self, agent_registry):
|
|
208
|
+
self.agent_registry = agent_registry
|
|
209
|
+
|
|
210
|
+
def SendMessage(self, request, context):
|
|
211
|
+
"""Send message from one agent to another."""
|
|
212
|
+
sender_id = request.sender_id
|
|
213
|
+
receiver_id = request.receiver_id
|
|
214
|
+
|
|
215
|
+
# Validate agents exist
|
|
216
|
+
if not self.agent_registry.exists(sender_id):
|
|
217
|
+
context.abort(grpc.StatusCode.NOT_FOUND, f"Sender {sender_id} not found")
|
|
218
|
+
|
|
219
|
+
if not self.agent_registry.exists(receiver_id):
|
|
220
|
+
context.abort(grpc.StatusCode.NOT_FOUND, f"Receiver {receiver_id} not found")
|
|
221
|
+
|
|
222
|
+
# Route message to receiver
|
|
223
|
+
receiver_agent = self.agent_registry.get(receiver_id)
|
|
224
|
+
response = receiver_agent.handle_message(request)
|
|
225
|
+
|
|
226
|
+
return response
|
|
227
|
+
|
|
228
|
+
def StreamMessages(self, request_iterator, context):
|
|
229
|
+
"""Bidirectional streaming for real-time communication."""
|
|
230
|
+
for message in request_iterator:
|
|
231
|
+
# Process message
|
|
232
|
+
receiver = self.agent_registry.get(message.receiver_id)
|
|
233
|
+
response = receiver.handle_message(message)
|
|
234
|
+
yield response
|
|
235
|
+
|
|
236
|
+
# Start gRPC server
|
|
237
|
+
def serve():
|
|
238
|
+
server = grpc.server(futures.ThreadPoolExecutor(max_workers=10))
|
|
239
|
+
|
|
240
|
+
agent_registry = AgentRegistry()
|
|
241
|
+
a2a_service = A2AService(agent_registry)
|
|
242
|
+
|
|
243
|
+
a2a_pb2_grpc.add_A2AServiceServicer_to_server(a2a_service, server)
|
|
244
|
+
|
|
245
|
+
server.add_insecure_port('[::]:50051')
|
|
246
|
+
server.start()
|
|
247
|
+
print("A2A gRPC server listening on port 50051")
|
|
248
|
+
server.wait_for_termination()
|
|
249
|
+
|
|
250
|
+
if __name__ == '__main__':
|
|
251
|
+
serve()
|
|
252
|
+
```
|
|
253
|
+
|
|
254
|
+
#### A2A Client (Agent Communication)
|
|
255
|
+
```python
|
|
256
|
+
import grpc
|
|
257
|
+
import a2a_pb2
|
|
258
|
+
import a2a_pb2_grpc
|
|
259
|
+
|
|
260
|
+
class A2AClient:
|
|
261
|
+
"""Client for agent-to-agent communication."""
|
|
262
|
+
|
|
263
|
+
def __init__(self, server_address='localhost:50051'):
|
|
264
|
+
self.channel = grpc.insecure_channel(server_address)
|
|
265
|
+
self.stub = a2a_pb2_grpc.A2AServiceStub(self.channel)
|
|
266
|
+
|
|
267
|
+
def send_message(self, sender_id, receiver_id, action, params):
|
|
268
|
+
"""Send message to another agent."""
|
|
269
|
+
message = a2a_pb2.A2AMessage(
|
|
270
|
+
sender_id=sender_id,
|
|
271
|
+
receiver_id=receiver_id,
|
|
272
|
+
conversation_id="conv-123",
|
|
273
|
+
type=a2a_pb2.REQUEST,
|
|
274
|
+
request=a2a_pb2.Request(
|
|
275
|
+
action=action,
|
|
276
|
+
params=params
|
|
277
|
+
)
|
|
278
|
+
)
|
|
279
|
+
|
|
280
|
+
response = self.stub.SendMessage(message)
|
|
281
|
+
return response
|
|
282
|
+
|
|
283
|
+
def stream_conversation(self, messages):
|
|
284
|
+
"""Stream bidirectional messages."""
|
|
285
|
+
def message_generator():
|
|
286
|
+
for msg in messages:
|
|
287
|
+
yield msg
|
|
288
|
+
|
|
289
|
+
responses = self.stub.StreamMessages(message_generator())
|
|
290
|
+
|
|
291
|
+
for response in responses:
|
|
292
|
+
yield response
|
|
293
|
+
|
|
294
|
+
# Usage
|
|
295
|
+
client = A2AClient()
|
|
296
|
+
|
|
297
|
+
# Research agent asks data-analyst agent for analysis
|
|
298
|
+
response = client.send_message(
|
|
299
|
+
sender_id="research-agent",
|
|
300
|
+
receiver_id="data-analyst-agent",
|
|
301
|
+
action="analyze_data",
|
|
302
|
+
params={"dataset": "sales_2024.csv", "metrics": ["revenue", "growth"]}
|
|
303
|
+
)
|
|
304
|
+
|
|
305
|
+
print(f"Analysis result: {response.response.result}")
|
|
306
|
+
```
|
|
307
|
+
|
|
308
|
+
**Benefits:**
|
|
309
|
+
- Type-safe communication with Protocol Buffers
|
|
310
|
+
- Bidirectional streaming for real-time collaboration
|
|
311
|
+
- Built-in error handling and retries
|
|
312
|
+
- Production-ready scalability
|
|
313
|
+
|
|
314
|
+
### 3. Multi-Agent Orchestration (Context7-Verified)
|
|
315
|
+
|
|
316
|
+
**Pattern from Context7 (/google-cloud/multi-agent):**
|
|
317
|
+
|
|
318
|
+
#### Agent Registry
|
|
319
|
+
```python
|
|
320
|
+
from dataclasses import dataclass
|
|
321
|
+
from typing import Dict, List, Optional
|
|
322
|
+
|
|
323
|
+
@dataclass
|
|
324
|
+
class AgentCapability:
|
|
325
|
+
"""Agent capability definition."""
|
|
326
|
+
name: str
|
|
327
|
+
description: str
|
|
328
|
+
parameters: Dict
|
|
329
|
+
|
|
330
|
+
@dataclass
|
|
331
|
+
class AgentInfo:
|
|
332
|
+
"""Agent registration information."""
|
|
333
|
+
agent_id: str
|
|
334
|
+
name: str
|
|
335
|
+
description: str
|
|
336
|
+
capabilities: List[AgentCapability]
|
|
337
|
+
endpoint: str
|
|
338
|
+
status: str # active, inactive, error
|
|
339
|
+
|
|
340
|
+
class AgentRegistry:
|
|
341
|
+
"""Central registry for agent discovery."""
|
|
342
|
+
|
|
343
|
+
def __init__(self):
|
|
344
|
+
self.agents: Dict[str, AgentInfo] = {}
|
|
345
|
+
|
|
346
|
+
def register(self, agent_info: AgentInfo):
|
|
347
|
+
"""Register new agent."""
|
|
348
|
+
self.agents[agent_info.agent_id] = agent_info
|
|
349
|
+
print(f"Registered agent: {agent_info.name} ({agent_info.agent_id})")
|
|
350
|
+
|
|
351
|
+
def unregister(self, agent_id: str):
|
|
352
|
+
"""Unregister agent."""
|
|
353
|
+
if agent_id in self.agents:
|
|
354
|
+
del self.agents[agent_id]
|
|
355
|
+
print(f"Unregistered agent: {agent_id}")
|
|
356
|
+
|
|
357
|
+
def discover(self, capability: str) -> List[AgentInfo]:
|
|
358
|
+
"""Find agents with specific capability."""
|
|
359
|
+
matching = []
|
|
360
|
+
|
|
361
|
+
for agent in self.agents.values():
|
|
362
|
+
for cap in agent.capabilities:
|
|
363
|
+
if cap.name == capability:
|
|
364
|
+
matching.append(agent)
|
|
365
|
+
break
|
|
366
|
+
|
|
367
|
+
return matching
|
|
368
|
+
|
|
369
|
+
def get(self, agent_id: str) -> Optional[AgentInfo]:
|
|
370
|
+
"""Get agent by ID."""
|
|
371
|
+
return self.agents.get(agent_id)
|
|
372
|
+
|
|
373
|
+
def exists(self, agent_id: str) -> bool:
|
|
374
|
+
"""Check if agent exists."""
|
|
375
|
+
return agent_id in self.agents
|
|
376
|
+
|
|
377
|
+
# Usage
|
|
378
|
+
registry = AgentRegistry()
|
|
379
|
+
|
|
380
|
+
# Register research agent
|
|
381
|
+
registry.register(AgentInfo(
|
|
382
|
+
agent_id="research-agent-1",
|
|
383
|
+
name="Research Assistant",
|
|
384
|
+
description="Searches and summarizes information",
|
|
385
|
+
capabilities=[
|
|
386
|
+
AgentCapability("web_search", "Search the web", {}),
|
|
387
|
+
AgentCapability("document_retrieval", "Retrieve documents", {})
|
|
388
|
+
],
|
|
389
|
+
endpoint="localhost:50051",
|
|
390
|
+
status="active"
|
|
391
|
+
))
|
|
392
|
+
|
|
393
|
+
# Register data analyst agent
|
|
394
|
+
registry.register(AgentInfo(
|
|
395
|
+
agent_id="data-analyst-1",
|
|
396
|
+
name="Data Analyst",
|
|
397
|
+
description="Analyzes datasets and generates insights",
|
|
398
|
+
capabilities=[
|
|
399
|
+
AgentCapability("data_analysis", "Analyze data", {}),
|
|
400
|
+
AgentCapability("visualization", "Create charts", {})
|
|
401
|
+
],
|
|
402
|
+
endpoint="localhost:50052",
|
|
403
|
+
status="active"
|
|
404
|
+
))
|
|
405
|
+
|
|
406
|
+
# Discover agents with web_search capability
|
|
407
|
+
agents = registry.discover("web_search")
|
|
408
|
+
print(f"Found {len(agents)} agents with web_search capability")
|
|
409
|
+
```
|
|
410
|
+
|
|
411
|
+
#### Orchestrator (Supervisor Agent)
|
|
412
|
+
```python
|
|
413
|
+
class Orchestrator:
|
|
414
|
+
"""Orchestrates multi-agent workflows."""
|
|
415
|
+
|
|
416
|
+
def __init__(self, registry: AgentRegistry, a2a_client: A2AClient):
|
|
417
|
+
self.registry = registry
|
|
418
|
+
self.a2a = a2a_client
|
|
419
|
+
|
|
420
|
+
async def execute_workflow(self, task: str) -> str:
|
|
421
|
+
"""
|
|
422
|
+
Execute multi-agent workflow.
|
|
423
|
+
|
|
424
|
+
Example: "Research AI trends and create a report with visualizations"
|
|
425
|
+
|
|
426
|
+
Steps:
|
|
427
|
+
1. Research agent: Gather information
|
|
428
|
+
2. Data analyst agent: Analyze trends
|
|
429
|
+
3. Report agent: Generate report
|
|
430
|
+
"""
|
|
431
|
+
# Step 1: Research
|
|
432
|
+
research_agents = self.registry.discover("web_search")
|
|
433
|
+
if not research_agents:
|
|
434
|
+
raise ValueError("No research agents available")
|
|
435
|
+
|
|
436
|
+
research_result = self.a2a.send_message(
|
|
437
|
+
sender_id="orchestrator",
|
|
438
|
+
receiver_id=research_agents[0].agent_id,
|
|
439
|
+
action="research",
|
|
440
|
+
params={"topic": "AI trends 2025"}
|
|
441
|
+
)
|
|
442
|
+
|
|
443
|
+
# Step 2: Analysis
|
|
444
|
+
analyst_agents = self.registry.discover("data_analysis")
|
|
445
|
+
if not analyst_agents:
|
|
446
|
+
raise ValueError("No analyst agents available")
|
|
447
|
+
|
|
448
|
+
analysis_result = self.a2a.send_message(
|
|
449
|
+
sender_id="orchestrator",
|
|
450
|
+
receiver_id=analyst_agents[0].agent_id,
|
|
451
|
+
action="analyze",
|
|
452
|
+
params={"data": research_result.response.result}
|
|
453
|
+
)
|
|
454
|
+
|
|
455
|
+
# Step 3: Report generation
|
|
456
|
+
report_agents = self.registry.discover("report_generation")
|
|
457
|
+
if not report_agents:
|
|
458
|
+
# Fallback: Generate report ourselves
|
|
459
|
+
return self._generate_simple_report(analysis_result.response.result)
|
|
460
|
+
|
|
461
|
+
report_result = self.a2a.send_message(
|
|
462
|
+
sender_id="orchestrator",
|
|
463
|
+
receiver_id=report_agents[0].agent_id,
|
|
464
|
+
action="generate_report",
|
|
465
|
+
params={"analysis": analysis_result.response.result}
|
|
466
|
+
)
|
|
467
|
+
|
|
468
|
+
return report_result.response.result
|
|
469
|
+
|
|
470
|
+
def _generate_simple_report(self, analysis: str) -> str:
|
|
471
|
+
"""Fallback report generation."""
|
|
472
|
+
return f"# AI Trends Report\n\n{analysis}"
|
|
473
|
+
|
|
474
|
+
# Usage
|
|
475
|
+
orchestrator = Orchestrator(registry, a2a_client)
|
|
476
|
+
|
|
477
|
+
result = await orchestrator.execute_workflow(
|
|
478
|
+
"Research AI trends and create analysis report"
|
|
479
|
+
)
|
|
480
|
+
|
|
481
|
+
print(result)
|
|
482
|
+
```
|
|
483
|
+
|
|
484
|
+
**Benefits:**
|
|
485
|
+
- Dynamic agent discovery
|
|
486
|
+
- Fault tolerance (fallback agents)
|
|
487
|
+
- Parallel execution where possible
|
|
488
|
+
- Centralized orchestration
|
|
489
|
+
|
|
490
|
+
### 4. State Management (Context7-Verified)
|
|
491
|
+
|
|
492
|
+
**Pattern from Context7:**
|
|
493
|
+
|
|
494
|
+
#### Conversation State
|
|
495
|
+
```python
|
|
496
|
+
from dataclasses import dataclass, field
|
|
497
|
+
from typing import List, Dict
|
|
498
|
+
import json
|
|
499
|
+
|
|
500
|
+
@dataclass
|
|
501
|
+
class Message:
|
|
502
|
+
"""Single message in conversation."""
|
|
503
|
+
sender_id: str
|
|
504
|
+
content: str
|
|
505
|
+
timestamp: float
|
|
506
|
+
metadata: Dict = field(default_factory=dict)
|
|
507
|
+
|
|
508
|
+
@dataclass
|
|
509
|
+
class ConversationState:
|
|
510
|
+
"""Conversation state between agents."""
|
|
511
|
+
conversation_id: str
|
|
512
|
+
participants: List[str]
|
|
513
|
+
messages: List[Message] = field(default_factory=list)
|
|
514
|
+
shared_context: Dict = field(default_factory=dict)
|
|
515
|
+
status: str = "active" # active, paused, completed, error
|
|
516
|
+
|
|
517
|
+
def add_message(self, message: Message):
|
|
518
|
+
"""Add message to conversation."""
|
|
519
|
+
self.messages.append(message)
|
|
520
|
+
|
|
521
|
+
def get_context(self) -> Dict:
|
|
522
|
+
"""Get shared context."""
|
|
523
|
+
return self.shared_context
|
|
524
|
+
|
|
525
|
+
def update_context(self, key: str, value):
|
|
526
|
+
"""Update shared context."""
|
|
527
|
+
self.shared_context[key] = value
|
|
528
|
+
|
|
529
|
+
def to_json(self) -> str:
|
|
530
|
+
"""Serialize to JSON."""
|
|
531
|
+
return json.dumps({
|
|
532
|
+
"conversation_id": self.conversation_id,
|
|
533
|
+
"participants": self.participants,
|
|
534
|
+
"messages": [
|
|
535
|
+
{
|
|
536
|
+
"sender_id": m.sender_id,
|
|
537
|
+
"content": m.content,
|
|
538
|
+
"timestamp": m.timestamp,
|
|
539
|
+
"metadata": m.metadata
|
|
540
|
+
}
|
|
541
|
+
for m in self.messages
|
|
542
|
+
],
|
|
543
|
+
"shared_context": self.shared_context,
|
|
544
|
+
"status": self.status
|
|
545
|
+
}, indent=2)
|
|
546
|
+
|
|
547
|
+
class StateManager:
|
|
548
|
+
"""Manage conversation states."""
|
|
549
|
+
|
|
550
|
+
def __init__(self):
|
|
551
|
+
self.states: Dict[str, ConversationState] = {}
|
|
552
|
+
|
|
553
|
+
def create_conversation(self, conversation_id: str, participants: List[str]) -> ConversationState:
|
|
554
|
+
"""Create new conversation."""
|
|
555
|
+
state = ConversationState(
|
|
556
|
+
conversation_id=conversation_id,
|
|
557
|
+
participants=participants
|
|
558
|
+
)
|
|
559
|
+
self.states[conversation_id] = state
|
|
560
|
+
return state
|
|
561
|
+
|
|
562
|
+
def get_conversation(self, conversation_id: str) -> Optional[ConversationState]:
|
|
563
|
+
"""Get conversation state."""
|
|
564
|
+
return self.states.get(conversation_id)
|
|
565
|
+
|
|
566
|
+
def save_state(self, conversation_id: str, storage_path: str):
|
|
567
|
+
"""Persist conversation state."""
|
|
568
|
+
state = self.states.get(conversation_id)
|
|
569
|
+
if state:
|
|
570
|
+
with open(f"{storage_path}/{conversation_id}.json", "w") as f:
|
|
571
|
+
f.write(state.to_json())
|
|
572
|
+
|
|
573
|
+
# Usage
|
|
574
|
+
state_manager = StateManager()
|
|
575
|
+
|
|
576
|
+
# Create conversation between research and analyst agents
|
|
577
|
+
conv = state_manager.create_conversation(
|
|
578
|
+
"conv-123",
|
|
579
|
+
["research-agent-1", "data-analyst-1"]
|
|
580
|
+
)
|
|
581
|
+
|
|
582
|
+
# Add messages
|
|
583
|
+
conv.add_message(Message(
|
|
584
|
+
sender_id="research-agent-1",
|
|
585
|
+
content="I found 5 articles about AI trends",
|
|
586
|
+
timestamp=1234567890.0
|
|
587
|
+
))
|
|
588
|
+
|
|
589
|
+
# Update shared context
|
|
590
|
+
conv.update_context("research_complete", True)
|
|
591
|
+
conv.update_context("articles_count", 5)
|
|
592
|
+
|
|
593
|
+
# Persist state
|
|
594
|
+
state_manager.save_state("conv-123", "/tmp/conversations")
|
|
595
|
+
```
|
|
596
|
+
|
|
597
|
+
### 5. Tool Sharing (Context7-Verified)
|
|
598
|
+
|
|
599
|
+
**Pattern from Context7:**
|
|
600
|
+
|
|
601
|
+
#### Shared Tool Registry
|
|
602
|
+
```python
|
|
603
|
+
from typing import Callable, Dict, Any
|
|
604
|
+
|
|
605
|
+
class Tool:
|
|
606
|
+
"""Shared tool definition."""
|
|
607
|
+
|
|
608
|
+
def __init__(self, name: str, description: str, function: Callable, parameters: Dict):
|
|
609
|
+
self.name = name
|
|
610
|
+
self.description = description
|
|
611
|
+
self.function = function
|
|
612
|
+
self.parameters = parameters
|
|
613
|
+
|
|
614
|
+
def execute(self, **kwargs) -> Any:
|
|
615
|
+
"""Execute tool."""
|
|
616
|
+
return self.function(**kwargs)
|
|
617
|
+
|
|
618
|
+
class ToolRegistry:
|
|
619
|
+
"""Registry for shared tools."""
|
|
620
|
+
|
|
621
|
+
def __init__(self):
|
|
622
|
+
self.tools: Dict[str, Tool] = {}
|
|
623
|
+
|
|
624
|
+
def register(self, tool: Tool):
|
|
625
|
+
"""Register tool."""
|
|
626
|
+
self.tools[tool.name] = tool
|
|
627
|
+
|
|
628
|
+
def get(self, name: str) -> Optional[Tool]:
|
|
629
|
+
"""Get tool by name."""
|
|
630
|
+
return self.tools.get(name)
|
|
631
|
+
|
|
632
|
+
def list_tools(self) -> List[str]:
|
|
633
|
+
"""List all tool names."""
|
|
634
|
+
return list(self.tools.keys())
|
|
635
|
+
|
|
636
|
+
# Define shared tools
|
|
637
|
+
def search_web(query: str) -> str:
|
|
638
|
+
"""Search the web."""
|
|
639
|
+
# Implementation
|
|
640
|
+
return f"Search results for: {query}"
|
|
641
|
+
|
|
642
|
+
def analyze_data(data: str) -> Dict:
|
|
643
|
+
"""Analyze dataset."""
|
|
644
|
+
# Implementation
|
|
645
|
+
return {"summary": "Analysis complete", "insights": []}
|
|
646
|
+
|
|
647
|
+
# Register tools
|
|
648
|
+
tool_registry = ToolRegistry()
|
|
649
|
+
|
|
650
|
+
tool_registry.register(Tool(
|
|
651
|
+
name="web_search",
|
|
652
|
+
description="Search the web for information",
|
|
653
|
+
function=search_web,
|
|
654
|
+
parameters={"query": "string"}
|
|
655
|
+
))
|
|
656
|
+
|
|
657
|
+
tool_registry.register(Tool(
|
|
658
|
+
name="data_analysis",
|
|
659
|
+
description="Analyze datasets",
|
|
660
|
+
function=analyze_data,
|
|
661
|
+
parameters={"data": "string"}
|
|
662
|
+
))
|
|
663
|
+
|
|
664
|
+
# Agents can discover and use shared tools
|
|
665
|
+
class AgentWithTools:
|
|
666
|
+
def __init__(self, agent_id: str, tool_registry: ToolRegistry):
|
|
667
|
+
self.agent_id = agent_id
|
|
668
|
+
self.tools = tool_registry
|
|
669
|
+
|
|
670
|
+
def use_tool(self, tool_name: str, **kwargs):
|
|
671
|
+
"""Use a shared tool."""
|
|
672
|
+
tool = self.tools.get(tool_name)
|
|
673
|
+
if not tool:
|
|
674
|
+
raise ValueError(f"Tool {tool_name} not found")
|
|
675
|
+
|
|
676
|
+
return tool.execute(**kwargs)
|
|
677
|
+
|
|
678
|
+
# Usage
|
|
679
|
+
agent = AgentWithTools("research-agent-1", tool_registry)
|
|
680
|
+
result = agent.use_tool("web_search", query="AI trends 2025")
|
|
681
|
+
```
|
|
682
|
+
|
|
683
|
+
### 6. Observability (Context7-Verified)
|
|
684
|
+
|
|
685
|
+
**Pattern from Context7:**
|
|
686
|
+
|
|
687
|
+
#### Tracing and Monitoring
|
|
688
|
+
```python
|
|
689
|
+
from opentelemetry import trace
|
|
690
|
+
from opentelemetry.sdk.trace import TracerProvider
|
|
691
|
+
from opentelemetry.sdk.trace.export import ConsoleSpanExporter, SimpleSpanProcessor
|
|
692
|
+
import time
|
|
693
|
+
|
|
694
|
+
# Setup tracing
|
|
695
|
+
trace.set_tracer_provider(TracerProvider())
|
|
696
|
+
tracer = trace.get_tracer(__name__)
|
|
697
|
+
|
|
698
|
+
# Add console exporter (use OTLP for production)
|
|
699
|
+
trace.get_tracer_provider().add_span_processor(
|
|
700
|
+
SimpleSpanProcessor(ConsoleSpanExporter())
|
|
701
|
+
)
|
|
702
|
+
|
|
703
|
+
class TracedAgent:
|
|
704
|
+
"""Agent with distributed tracing."""
|
|
705
|
+
|
|
706
|
+
def __init__(self, agent_id: str):
|
|
707
|
+
self.agent_id = agent_id
|
|
708
|
+
|
|
709
|
+
def process_request(self, request: str) -> str:
|
|
710
|
+
"""Process request with tracing."""
|
|
711
|
+
with tracer.start_as_current_span("process_request") as span:
|
|
712
|
+
span.set_attribute("agent.id", self.agent_id)
|
|
713
|
+
span.set_attribute("request.content", request)
|
|
714
|
+
|
|
715
|
+
# Simulate processing
|
|
716
|
+
time.sleep(0.5)
|
|
717
|
+
|
|
718
|
+
result = f"Processed: {request}"
|
|
719
|
+
|
|
720
|
+
span.set_attribute("response.content", result)
|
|
721
|
+
span.add_event("processing_complete")
|
|
722
|
+
|
|
723
|
+
return result
|
|
724
|
+
|
|
725
|
+
# Trace A2A communication
|
|
726
|
+
def send_traced_message(sender_id: str, receiver_id: str, message: str):
|
|
727
|
+
"""Send message with distributed tracing."""
|
|
728
|
+
with tracer.start_as_current_span("a2a_communication") as span:
|
|
729
|
+
span.set_attribute("sender.id", sender_id)
|
|
730
|
+
span.set_attribute("receiver.id", receiver_id)
|
|
731
|
+
span.set_attribute("message.content", message)
|
|
732
|
+
|
|
733
|
+
# Send message
|
|
734
|
+
client = A2AClient()
|
|
735
|
+
response = client.send_message(sender_id, receiver_id, "process", {"data": message})
|
|
736
|
+
|
|
737
|
+
span.set_attribute("response.status", "success" if response.response.success else "error")
|
|
738
|
+
|
|
739
|
+
return response
|
|
740
|
+
```
|
|
741
|
+
|
|
742
|
+
**Benefits:**
|
|
743
|
+
- Distributed tracing across agents
|
|
744
|
+
- Performance monitoring
|
|
745
|
+
- Error tracking
|
|
746
|
+
- Request flow visualization
|
|
747
|
+
|
|
748
|
+
## Setup Output
|
|
749
|
+
|
|
750
|
+
```
|
|
751
|
+
🔗 Google A2A Protocol Setup
|
|
752
|
+
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
753
|
+
|
|
754
|
+
Project: my-project-id
|
|
755
|
+
Region: us-central1
|
|
756
|
+
Protocol: gRPC
|
|
757
|
+
|
|
758
|
+
📊 Configuration
|
|
759
|
+
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
760
|
+
|
|
761
|
+
Vertex AI Agent Builder:
|
|
762
|
+
- Enabled ✓
|
|
763
|
+
- Model: gemini-2.0-flash-exp
|
|
764
|
+
- Tools: Google Search, Code Interpreter
|
|
765
|
+
- Custom functions: Configured
|
|
766
|
+
|
|
767
|
+
A2A Protocol:
|
|
768
|
+
- Protocol: gRPC (port 50051)
|
|
769
|
+
- Message format: Protocol Buffers
|
|
770
|
+
- Bidirectional streaming: Enabled
|
|
771
|
+
- Error handling: Configured
|
|
772
|
+
|
|
773
|
+
Agent Registry:
|
|
774
|
+
- Service: Running on port 8080
|
|
775
|
+
- Discovery: Enabled
|
|
776
|
+
- Health checks: Configured
|
|
777
|
+
|
|
778
|
+
Orchestration:
|
|
779
|
+
- Supervisor agent: Configured
|
|
780
|
+
- Workflow engine: Enabled
|
|
781
|
+
- State management: Redis-backed
|
|
782
|
+
|
|
783
|
+
🎯 Agents Registered
|
|
784
|
+
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
785
|
+
|
|
786
|
+
1. Research Agent (research-agent-1)
|
|
787
|
+
- Capabilities: web_search, document_retrieval
|
|
788
|
+
- Status: Active
|
|
789
|
+
- Endpoint: localhost:50051
|
|
790
|
+
|
|
791
|
+
2. Data Analyst (data-analyst-1)
|
|
792
|
+
- Capabilities: data_analysis, visualization
|
|
793
|
+
- Status: Active
|
|
794
|
+
- Endpoint: localhost:50052
|
|
795
|
+
|
|
796
|
+
3. Report Generator (report-agent-1)
|
|
797
|
+
- Capabilities: report_generation, summarization
|
|
798
|
+
- Status: Active
|
|
799
|
+
- Endpoint: localhost:50053
|
|
800
|
+
|
|
801
|
+
✅ Setup Complete
|
|
802
|
+
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
803
|
+
|
|
804
|
+
Next Steps:
|
|
805
|
+
1. Test agent communication: python test_a2a.py
|
|
806
|
+
2. Deploy to production: gcloud deploy
|
|
807
|
+
3. Monitor agents: open http://localhost:8080/metrics
|
|
808
|
+
|
|
809
|
+
Configuration saved to: a2a-config.yaml
|
|
810
|
+
```
|
|
811
|
+
|
|
812
|
+
## Implementation
|
|
813
|
+
|
|
814
|
+
This command uses the **@google-a2a-expert** agent with orchestration expertise:
|
|
815
|
+
|
|
816
|
+
1. Query Context7 for Google A2A patterns
|
|
817
|
+
2. Setup Vertex AI Agent Builder
|
|
818
|
+
3. Configure A2A protocol (gRPC/REST)
|
|
819
|
+
4. Implement agent registry
|
|
820
|
+
5. Setup orchestrator
|
|
821
|
+
6. Configure state management
|
|
822
|
+
7. Enable observability
|
|
823
|
+
|
|
824
|
+
## Best Practices Applied
|
|
825
|
+
|
|
826
|
+
Based on Context7 documentation from `/googleapis/google-cloud-python/vertexai`:
|
|
827
|
+
|
|
828
|
+
1. **Vertex AI Agent Builder** - Managed agent infrastructure
|
|
829
|
+
2. **gRPC Protocol** - High-performance communication
|
|
830
|
+
3. **Agent Registry** - Dynamic discovery
|
|
831
|
+
4. **State Management** - Persistent conversation state
|
|
832
|
+
5. **Tool Sharing** - Reusable capabilities
|
|
833
|
+
6. **Distributed Tracing** - Observability across agents
|
|
834
|
+
7. **Fault Tolerance** - Fallback and retry logic
|
|
835
|
+
|
|
836
|
+
## Related Commands
|
|
837
|
+
|
|
838
|
+
- `/ai:model-deployment` - Model deployment
|
|
839
|
+
- `/rag:setup-scaffold` - RAG system setup
|
|
840
|
+
- `/openai:optimize` - OpenAI optimization
|
|
841
|
+
|
|
842
|
+
## Troubleshooting
|
|
843
|
+
|
|
844
|
+
### Agent Communication Fails
|
|
845
|
+
- Check gRPC server is running (port 50051)
|
|
846
|
+
- Verify agent is registered in registry
|
|
847
|
+
- Check network connectivity
|
|
848
|
+
- Review firewall rules
|
|
849
|
+
|
|
850
|
+
### High Latency
|
|
851
|
+
- Use gRPC instead of REST (3x faster)
|
|
852
|
+
- Enable bidirectional streaming
|
|
853
|
+
- Optimize message size
|
|
854
|
+
- Add caching layer
|
|
855
|
+
|
|
856
|
+
### State Loss
|
|
857
|
+
- Enable Redis for state persistence
|
|
858
|
+
- Implement checkpoint/restore
|
|
859
|
+
- Use conversation logging
|
|
860
|
+
- Add retry logic
|
|
861
|
+
|
|
862
|
+
## Installation
|
|
863
|
+
|
|
864
|
+
```bash
|
|
865
|
+
# Install Google Cloud SDK
|
|
866
|
+
pip install google-cloud-aiplatform
|
|
867
|
+
|
|
868
|
+
# Install gRPC
|
|
869
|
+
pip install grpcio grpcio-tools
|
|
870
|
+
|
|
871
|
+
# Install observability
|
|
872
|
+
pip install opentelemetry-api opentelemetry-sdk
|
|
873
|
+
|
|
874
|
+
# Generate Protocol Buffer code
|
|
875
|
+
python -m grpc_tools.protoc -I. --python_out=. --grpc_python_out=. a2a.proto
|
|
876
|
+
```
|
|
877
|
+
|
|
878
|
+
## Version History
|
|
879
|
+
|
|
880
|
+
- v2.0.0 - Initial Schema v2.0 release with Context7 integration
|
|
881
|
+
- Vertex AI Agent Builder integration
|
|
882
|
+
- gRPC A2A protocol implementation
|
|
883
|
+
- Multi-agent orchestration patterns
|
|
884
|
+
- Agent registry and discovery
|
|
885
|
+
- State management with Redis
|
|
886
|
+
- Distributed tracing support
|