feat: add gateway protocol attachment support
Extends the gateway wire protocol with GatewayAttachment type and attachment event. agent.send handler now accepts optional attachments parameter and converts them for the agent pipeline. Includes 5 new tests for protocol and handler layers.
This commit is contained in:
@@ -29,12 +29,27 @@ export interface GatewayEvent {
|
||||
data: unknown;
|
||||
}
|
||||
|
||||
// ── Attachment data for gateway protocol messages ───────────────
|
||||
|
||||
/** Attachment data sent in agent.send params or emitted as events. */
|
||||
export interface GatewayAttachment {
|
||||
/** MIME type (e.g. "image/jpeg", "audio/ogg") */
|
||||
mimeType: string;
|
||||
/** Base64-encoded data */
|
||||
data?: string;
|
||||
/** URL to the resource */
|
||||
url?: string;
|
||||
/** Filename hint */
|
||||
filename?: string;
|
||||
}
|
||||
|
||||
// ── Event types emitted during agent.send ──────────────────────
|
||||
|
||||
export type EventType =
|
||||
| 'content'
|
||||
| 'tool_start'
|
||||
| 'tool_end'
|
||||
| 'attachment'
|
||||
| 'done'
|
||||
| 'error';
|
||||
|
||||
@@ -56,6 +71,13 @@ export interface ToolEndEventData {
|
||||
};
|
||||
}
|
||||
|
||||
export interface AttachmentEventData {
|
||||
mimeType: string;
|
||||
data?: string;
|
||||
url?: string;
|
||||
filename?: string;
|
||||
}
|
||||
|
||||
export interface DoneEventData {
|
||||
content: string;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user