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:
William Valentin
2026-02-07 09:09:06 -08:00
parent b9bfee9c5b
commit e052778b0a
5 changed files with 93 additions and 4 deletions
+18
View File
@@ -86,5 +86,23 @@ describe('protocol', () => {
data: { text: 'hello' },
});
});
it('creates an attachment event message', () => {
const data = { mimeType: 'image/png', data: 'iVBOR...', filename: 'screenshot.png' };
expect(makeEvent(1, 'attachment', data)).toEqual({
id: 1,
event: 'attachment',
data,
});
});
it('creates an attachment event with url', () => {
const data = { mimeType: 'application/pdf', url: 'https://example.com/doc.pdf', filename: 'doc.pdf' };
expect(makeEvent(2, 'attachment', data)).toEqual({
id: 2,
event: 'attachment',
data,
});
});
});
});