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:
@@ -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,
|
||||
});
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user