mateclaw/mateclaw-server/src/main/java/vip/mate/interop/a2a/A2aProperties.java
matevip 1159dcdbf3 feat(a2a): add agent interoperability protocol support
Add an A2A JSON-RPC endpoint with authenticated message/send, message/stream, tasks/get, and tasks/cancel handling. Expose anonymous minimal Agent Cards while keeping the enabled-agent skills list behind existing Bearer authentication.

Bridge inbound calls into the existing agent runtime, add an in-memory task store with duplicate task rejection, JSON-RPC idempotency snapshots, terminal TTL cleanup, and SSE status/artifact event streaming with heartbeat comments.

Add the call_a2a_agent tool and peer adapter with Agent Card discovery fallback, blocking task polling through tasks/get, event-boundary SSE parsing, response caps, timeout limits, redirect refusal, and private-network SSRF protection.

Wire mateclaw.a2a configuration, document deployment settings in English and Chinese, mirror bundled docs, and cover task storage, JSON-RPC validation, card privacy, lifecycle/cancel behavior, SSE parsing, and outbound guardrails with focused tests.
2026-08-19 05:36:51 -04:00

28 lines
595 B
Java

package vip.mate.interop.a2a;
import lombok.Data;
import org.springframework.boot.context.properties.ConfigurationProperties;
@Data
@ConfigurationProperties(prefix = "mateclaw.a2a")
public class A2aProperties {
private boolean enabled = false;
private String baseUrl;
private long callTimeoutMs = 120_000L;
private int maxTasks = 1_000;
private long taskTtlSeconds = 3_600L;
private int maxResponseBytes = 1_048_576;
private long outboundTimeoutMs = 120_000L;
private boolean allowPrivateOutbound = false;
private long sweepIntervalMs = 60_000L;
}