ui: polish websocket wizard test runs
This commit is contained in:
@@ -213,6 +213,74 @@ function buildRestWindowOperationPayload(name) {
|
||||
};
|
||||
}
|
||||
|
||||
function buildWebsocketWindowOperationPayload(name, overrides = {}) {
|
||||
const streaming = Object.assign({
|
||||
mode: 'window',
|
||||
transport_behavior: 'server_stream',
|
||||
window_duration_ms: 1000,
|
||||
upstream_timeout_ms: 1000,
|
||||
max_items: 3,
|
||||
max_bytes: 16384,
|
||||
aggregation_mode: 'summary_plus_samples',
|
||||
items_path: '$.items',
|
||||
done_path: '$.done',
|
||||
redacted_paths: [],
|
||||
truncate_item_fields: false,
|
||||
drop_duplicates: false,
|
||||
tool_family: {},
|
||||
}, overrides.streaming || {});
|
||||
|
||||
const websocketOptions = Object.assign({
|
||||
heartbeat_interval_ms: 250,
|
||||
reconnect_max_attempts: 1,
|
||||
reconnect_backoff_ms: 10,
|
||||
}, overrides.websocketOptions || {});
|
||||
|
||||
return {
|
||||
name,
|
||||
display_name: 'Playwright WebSocket Window',
|
||||
category: 'streaming',
|
||||
protocol: 'websocket',
|
||||
target: {
|
||||
kind: 'websocket',
|
||||
url: `ws://127.0.0.1:${STREAM_FIXTURE_PORT}/events`,
|
||||
subprotocols: [],
|
||||
subscribe_message_template: null,
|
||||
unsubscribe_message_template: null,
|
||||
static_headers: {},
|
||||
},
|
||||
input_schema: schemaObject({
|
||||
topic: schemaString(false),
|
||||
}),
|
||||
output_schema: schemaObject({}),
|
||||
input_mapping: {
|
||||
rules: [
|
||||
{
|
||||
source: '$.mcp.topic',
|
||||
target: '$.request.body.topic',
|
||||
required: false,
|
||||
default_value: 'telemetry',
|
||||
},
|
||||
],
|
||||
},
|
||||
output_mapping: { rules: [] },
|
||||
execution_config: {
|
||||
timeout_ms: 1000,
|
||||
headers: {},
|
||||
protocol_options: {
|
||||
websocket: websocketOptions,
|
||||
},
|
||||
streaming,
|
||||
},
|
||||
tool_description: {
|
||||
title: 'Playwright WebSocket Window',
|
||||
description: 'Collects a bounded WebSocket event window from the local fixture.',
|
||||
tags: ['playwright', 'streaming', 'websocket', 'window'],
|
||||
examples: [{ input: {} }],
|
||||
},
|
||||
};
|
||||
}
|
||||
|
||||
const SOAP_TEST_WSDL = `<?xml version="1.0"?>
|
||||
<definitions xmlns="http://schemas.xmlsoap.org/wsdl/"
|
||||
xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
|
||||
@@ -558,6 +626,7 @@ module.exports = {
|
||||
buildRestAsyncJobOperationPayload,
|
||||
buildRestWindowOperationPayload,
|
||||
buildSoapOperationPayload,
|
||||
buildWebsocketWindowOperationPayload,
|
||||
createAgent,
|
||||
createOperation,
|
||||
createPlatformApiKey,
|
||||
|
||||
Reference in New Issue
Block a user