mirror of
https://gitee.com/mateos/mateclaw.git
synced 2026-11-05 23:29:44 +08:00
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.
28 lines
595 B
Java
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;
|
|
}
|