feat(plugins): add hosted web search client

This commit is contained in:
2026-09-01 02:03:17 +08:00
parent f3874e9070
commit fc68cf2951
9 changed files with 1558 additions and 0 deletions

View File

@@ -106,6 +106,33 @@ describe('Conversation product contracts', () => {
})).toBeNull();
});
it('round-trips the Main-only receipt-unavailable billing state without an amount', () => {
const envelope = {
schema: 'makelore-capability.v1',
plugin_id: 'makelore.web-search',
plugin_version: '1.0.0',
capability_id: 'web-search.search',
operation: 'search',
request_id: 'pi:run-a:resource-a',
success: false,
status: 503,
code: 'plugin_receipt_unavailable',
error: 'Web Search billing status could not be synchronized; do not retry automatically',
retryable: false,
billing: { mode: 'platform_metered', status: 'receipt_unavailable' },
payload_schema: 'web-search.v1',
data: null,
};
expect(productToolDetails(envelope)).toMatchObject({
plugin_id: 'makelore.web-search',
billing: { mode: 'platform_metered', status: 'receipt_unavailable' },
data: null,
});
expect(productToolDetails({ ...envelope, billing: {
mode: 'platform_metered', status: 'receipt_unavailable', reserved_points: '0.00',
} })).toBeNull();
});
it('accepts schema v1 snapshots and fail-closes unknown schemas until replacement', () => {
const snapshot = createProductSnapshot();
expect(isConversationSnapshot(snapshot)).toBe(true);