a2a-source-edit: write agent.py

This commit is contained in:
a2a-cloud
2026-07-13 03:09:29 +00:00
parent cbf2464836
commit 6457d14257

View File

@@ -332,7 +332,7 @@ class AgentComplianceAuditor(A2AAgent[AgentComplianceAuditorConfig, NoAuth]):
)
@a2a.tool(description="Inventory a deployed A2A agent card, repository evidence, manifests, exposure, provenance, resources, and health", timeout_seconds=180, idempotent=True, cost_class="read-only", input_schema=_tool_schema("inventory"))
async def inventory_agent(self, ctx: RunContext[NoAuth], request: InventoryRequest) -> InventoryResult:
async def inventory_agent(self, ctx: RunContext[NoAuth], request: InventoryRequest) -> dict[str, Any]:
audit_id = _audit_id(request.target, request.options.audit_id)
await _event(ctx, "audit_started", audit_id=audit_id, skill="inventory_agent", target=request.target.agent_name)
inventory, evidence, warnings, status = await _collect_inventory(self, ctx, request.target, request.options, audit_id)
@@ -354,7 +354,7 @@ class AgentComplianceAuditor(A2AAgent[AgentComplianceAuditorConfig, NoAuth]):
return FindingResult(audit_id=audit_id, target=request.target, status="ok", output_dir=output_dir, generated_files=files, findings=findings, evidence=evidence, warnings=warnings)
@a2a.tool(description="Run bounded non-destructive runtime probes and audit deployment health without mutations", timeout_seconds=180, idempotent=True, cost_class="read-only")
async def audit_runtime(self, ctx: RunContext[NoAuth], request: AuditRuntimeRequest) -> dict[str, Any]:
async def audit_runtime(self, ctx: RunContext[NoAuth], request: AuditRuntimeRequest) -> FindingResult:
audit_id = _audit_id(request.target, request.options.audit_id)
await _event(ctx, "audit_started", audit_id=audit_id, skill="audit_runtime", target=request.target.agent_name)
inventory = request.inventory or (await _collect_inventory(self, ctx, request.target, request.options, audit_id))[0]