wip: desparate models fucking around

This commit is contained in:
2026-02-26 00:13:52 +01:00
parent 021cddefa3
commit 2a923c7e48
16 changed files with 684 additions and 113 deletions

View File

@@ -44,9 +44,34 @@ describe('pythonApiContractV1', () => {
});
});
it('documents chat.sendMessage protocol envelope return contract and metadata input', () => {
expect(getPythonApiMethodContract('chat.sendMessage')).toEqual({
method: 'chat.sendMessage',
description: 'Send message to chat conversation.',
params: [
{
name: 'conversationId',
type: 'string',
required: true,
},
{
name: 'message',
type: 'string',
required: true,
},
{
name: 'metadata',
type: 'object',
required: false,
},
],
returns: "{ success: boolean; message?: string; envelope?: ProtocolResponseEnvelope; protocolVersion?: '2.0'; traceId?: string; warnings?: string[]; error?: string }",
});
});
it('contains semantic version metadata for compatibility checks', () => {
expect(BDS_PYTHON_API_CONTRACT_V1).toMatchObject({
version: '1.4.0',
version: '1.5.0',
generatedAt: expect.any(String),
});
});
@@ -56,6 +81,7 @@ describe('pythonApiContractV1', () => {
expect.objectContaining({ name: 'PostData' }),
expect.objectContaining({ name: 'MediaData' }),
expect.objectContaining({ name: 'ProjectData' }),
expect.objectContaining({ name: 'ProtocolResponseEnvelope' }),
expect.objectContaining({ name: 'ProtocolTelemetrySnapshot' }),
]));
});
@@ -76,7 +102,7 @@ describe('generatePythonApiModuleV1', () => {
expect(moduleCode).toContain('async def search(self, query):');
expect(moduleCode).toContain('async def get_project_metadata(self):');
expect(moduleCode).toContain('async def get_conversations(self):');
expect(moduleCode).toContain('async def send_message(self, conversation_id, message):');
expect(moduleCode).toContain('async def send_message(self, conversation_id, message, metadata=None):');
expect(moduleCode).toContain('class BdsApi:');
expect(moduleCode).toContain('bds = BdsApi(_transport)');
});