9.3 KiB
9.3 KiB
Streaming UI Contract
1. Назначение документа
Этот документ фиксирует точный UI-контракт для настройки потоковых операций.
Цель:
- определить экраны и блоки wizard;
- перечислить все поля;
- перечислить валидации;
- определить protocol-specific visibility rules;
- зафиксировать UX states, warnings и system messages.
2. Основные экраны
Потоковая конфигурация живет в:
Operations WizardOperation DetailTest RunAgent Tool PreviewLogs/Usageobservability surfaces
Дополнительно админские страницы:
Stream SessionsAsync Jobs
Для test-run UX:
- wizard status block должен различать
unary,window,session,async_job; windowпоказывает bounded flagswindow_complete,truncated,has_more;sessionпоказываетsession_id,poll_after_msи переводит оператора к страницеStream Sessions;async_jobпоказываетjob_idи переводит оператора к страницеAsync Jobs;- request/response preview textareas остаются общими для всех режимов.
3. Wizard information architecture
3.1. Shared wizard structure
Шаги:
ProtocolUpstreamRequest / SubscriptionExecution ModeInput SchemaOutput / AggregationSafety and LimitsTool FamilyTest RunPublish
3.2. Step Execution Mode
Поля:
ModeUnaryWindowSessionAsync Job
Transport behaviorRequest / responseServer stream
Подсказки:
Unaryдля обычных request-response integrations.Windowдля bounded snapshots из stream или feed.Sessionдля follow-style tools сstart/poll/stop.Async Jobдля long-running operations сstatus/result/cancel.
Валидации:
Transport behavior=server_streamне может использоваться с protocol, который его не поддерживает.WebSocketне может бытьUnary.SOAPв первой волне не может бытьSession.
3.3. Step Input Schema
Поля:
Input schema source- manual
- sample-derived
- descriptor/wsdl-derived
Input fieldsRequired fieldsDefaultsMapping preview
3.4. Step Output / Aggregation
Поля:
Aggregation modeRaw itemsSummary onlySummary + samplesStatsLatest state
Items pathSummary pathCursor pathStatus pathDone pathOutput mapping
Валидации:
Items pathобязателен дляRaw itemsиSummary + samples.Summary pathобязателен дляSummary only,Summary + samples,Stats,Latest state.Done pathобязателен дляAsync Job, если upstream status не выражается отдельным field set.
3.5. Step Safety and Limits
Поля:
Window durationPoll intervalUpstream timeoutIdle timeoutSession lifetimeMax itemsMax bytesMax field lengthDrop duplicatesSampling rateRedacted paths
Валидации:
Window durationобязателен дляWindow.Poll intervalобязателен дляSession.Idle timeoutобязателен дляSession.Session lifetimeобязателен дляSession.Max items> 0.Max bytes> 0.Sampling rate> 0 and <= 1.
3.6. Step Tool Family
Показывается только для:
SessionAsync Job
Для Session:
Start tool namePoll tool nameStop tool name
Для Async Job:
Start tool nameStatus tool nameResult tool nameCancel tool name
Валидации:
- имена обязательны;
- имена должны быть уникальны в пределах agent;
- имена не должны конфликтовать с already bound tools.
4. Protocol-specific UI
4.1. REST
Поля:
Base URLHTTP methodPath templateHeadersQuery mappingBody mappingSSE enabledSSE event filter
Visibility:
SSE enabledпоказывается только если method/endpoint допускают stream use case;WindowиSessionдоступны, если оператор включает stream behavior.
4.2. GraphQL
Поля:
EndpointOperation typeOperation nameQuery templateVariables schemaResponse path
Visibility:
Window,Session,Async Jobскрыты в текущей продуктовой волне;SubscriptionUI не показывается.
4.3. gRPC
Поля:
Server addressPackageServiceMethodDescriptor sourceStream kindUnaryServer streaming
Visibility:
Window,Session,Async Jobдоступны только дляServer streaming;Client streamingиBidirectionalне показываются вообще.
4.4. WebSocket
Поля:
WebSocket URLSubprotocolsConnect timeoutHeartbeat intervalSubscribe message templateUnsubscribe message templateMessage envelope path
Visibility:
Unaryне показывается;Window,Session,Async Jobдоступны всегда;Subscribe message templateобязательно дляWindowиSession.
4.5. SOAP
Поля:
WSDL sourceServicePortOperationSOAP versionSOAPActionEndpoint overrideHeader config
Visibility:
Sessionскрыт;Windowскрыт по умолчанию и включается только для polling-style enterprise workflows;UnaryиAsync Jobдоступны.
5. Test Run UX
5.1. Window
UI должен показывать:
StatusDurationItems countBytes countWindow completeTruncatedHas moreSummaryItems previewCursor
Кнопки:
Run window testRepeatSave config
5.2. Session
UI должен показывать:
Session idStatusExpires atPoll afterSummary previewItems preview
Кнопки:
Start sessionPoll next chunkStop session
5.3. Async Job
UI должен показывать:
Job idStatusProgressStarted atFinished atResult preview
Кнопки:
Start jobRefresh statusGet resultCancel job
6. Page-level states
Каждый streaming-aware экран обязан поддерживать:
idlevalidatingsavingtestingrunningcompletedfailedstoppedexpired
7. Warnings and messages
7.1. Validation warnings
This mode will truncate responses above the configured byte limit.Current protocol does not support the selected execution mode.Session lifetime is shorter than idle timeout.Aggregation mode summary_only hides raw items from the final tool output.WebSocket reconnect may duplicate events if upstream does not provide cursor semantics.SOAP async mode requires a separate status/result contract.
7.2. Confirmations
Stop current session?Cancel running job?Switching execution mode will reset protocol-specific fields.
7.3. Errors
Streaming configuration is invalid.Test session expired.Upstream did not return any messages within the configured window.The collected stream payload was truncated by size limits.This protocol does not support the selected execution mode.
8. Stream Sessions page
Колонки:
Session IDOperationAgentModeStatusCreatedLast pollExpires
Actions:
OpenStopDelete
Detail view:
Session metadataCursor previewState summaryRecent events summary
9. Async Jobs page
Колонки:
Job IDOperationAgentStatusProgressCreatedUpdatedFinished
Actions:
OpenCancelGet result
Detail view:
Job metadataProgress payloadResult previewError preview
10. Exact frontend adapters
Ожидаемые frontend modules:
streaming-form.jsstreaming-validation.jsstream-test-run.jsstream-sessions.jsasync-jobs.js
Ожидаемые frontend functions:
loadProtocolCapabilities()applyStreamingPreset()validateStreamingConfig()serializeStreamingConfig()deserializeStreamingConfig()startWindowTest()startSessionTest()pollSessionTest()stopSessionTest()startAsyncJobTest()refreshAsyncJobStatus()loadAsyncJobResult()
11. Shared UI rules
- UI никогда не должен предлагать unsupported mode;
- UI должен строить availability по
protocol-capabilities, а не по hardcoded if-else; - UI должен явно объяснять, почему поле скрыто или disabled;
- UI должен всегда показывать итоговую tool topology:
1 tool3 tools start/poll/stop4 tools start/status/result/cancel