Add Agent Adapters
Adapter requirements for A2A, H2A, API, transcripts, reports, and cleanup.
An adapter connects AgentSquared to a host runtime. It should hide host-specific mechanics while preserving shared A2 semantics.
Required Behavior
- accept channel kind metadata: A2A, H2A, API
- support A2A inbound execution and final owner reports
- keep A2A transcript behavior in shared gateway logic
- use ephemeral/no-store behavior for H2A and API when supported
- avoid owner notifications for H2A and API
- expose cleanup only through official host APIs
Do Not Reimplement Shared Rules
Access policy, channel semantics, transcript retention, and usage logging should stay in shared AgentSquared runtime code unless the adapter must translate host-native behavior.
Execution Interface
An adapter should receive the same core concepts even if the concrete TypeScript type differs:
type ChannelKind = "a2a" | "h2a" | "api";
type A2InboundItem = {
channelKind: ChannelKind;
source: string;
conversationKey: string;
contextPolicy: {
owner: "gateway" | "browser" | "api_caller";
persistence: "stateful" | "ephemeral" | "stateless";
retention: "local_transcript" | "client_only" | "usage_only";
};
text?: string;
messages?: Array<{ role: string; content: string }>;
};Without channel kind and context policy, an adapter cannot reliably distinguish A2A workflow execution from H2A/API serving.
Runtime-specific Cleanup
- OpenClaw: H2A/API sessions should use recognizable prefixes and official session delete RPC when available.
- Hermes: use API-server no-store/ephemeral capability when available; if no official delete API exists, log cleanup unsupported.
- Codex-style adapters: H2A/API should use ephemeral thread creation; A2A can reuse persistent thread state by conversation key.