a2a-source-edit: write agent.py

This commit is contained in:
a2a-cloud
2026-07-13 03:28:57 +00:00
parent f48d5a4cf2
commit f1d68754d0

View File

@@ -522,7 +522,7 @@ class CustomerIntegrationEngineer(A2AAgent[CustomerIntegrationEngineerConfig, No
) )
@a2a.tool(description="Generate a minimal workspace-contained connector scaffold with no deployment or repository mutation", input_schema=_GENERATE_INPUT_SCHEMA, timeout_seconds=120, idempotent=True, max_retries=0, cost_class="deterministic", grant_outputs_prefix="outputs", grant_write_prefixes=("outputs/integrations",)) @a2a.tool(description="Generate a minimal workspace-contained connector scaffold with no deployment or repository mutation", input_schema=_GENERATE_INPUT_SCHEMA, timeout_seconds=120, idempotent=True, max_retries=0, cost_class="deterministic", grant_outputs_prefix="outputs", grant_write_prefixes=("outputs/integrations",))
async def generate_connector(self, ctx: RunContext[NoAuth], request: GenerateConnectorRequest) -> dict[str, Any]: async def generate_connector(self, ctx: RunContext[NoAuth], request: GenerateConnectorRequest) -> GenerateConnectorResult:
req = request.requirements.model_copy( req = request.requirements.model_copy(
update={"dry_run": _effective_dry_run(self, request.dry_run, request.requirements.dry_run)} update={"dry_run": _effective_dry_run(self, request.dry_run, request.requirements.dry_run)}
) )
@@ -669,7 +669,7 @@ class CustomerIntegrationEngineer(A2AAgent[CustomerIntegrationEngineerConfig, No
) )
@a2a.tool(description="Prepare rollout, rollback, monitoring, and operator handoff documentation with approval-gated delivery planning", input_schema=_HANDOFF_INPUT_SCHEMA, timeout_seconds=120, idempotent=True, max_retries=0, cost_class="deterministic", grant_outputs_prefix="outputs", grant_write_prefixes=("outputs/integrations",)) @a2a.tool(description="Prepare rollout, rollback, monitoring, and operator handoff documentation with approval-gated delivery planning", input_schema=_HANDOFF_INPUT_SCHEMA, timeout_seconds=120, idempotent=True, max_retries=0, cost_class="deterministic", grant_outputs_prefix="outputs", grant_write_prefixes=("outputs/integrations",))
async def prepare_handoff(self, ctx: RunContext[NoAuth], request: PrepareHandoffRequest) -> PrepareHandoffResult: async def prepare_handoff(self, ctx: RunContext[NoAuth], request: PrepareHandoffRequest) -> dict[str, Any]:
dry_run = _effective_dry_run(self, request.dry_run) dry_run = _effective_dry_run(self, request.dry_run)
audit = [_audit("handoff_started", request.integration_id, {"dry_run": dry_run, "delivery_actions": len(request.delivery_actions)})] audit = [_audit("handoff_started", request.integration_id, {"dry_run": dry_run, "delivery_actions": len(request.delivery_actions)})]
await _emit(ctx, audit[-1]) await _emit(ctx, audit[-1])