dsh-plugin-mobile-gateway 0.7.2 → 0.7.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/PROTOCOL.md +23 -1
- package/README.md +34 -1
- package/cordis.patch.yml +8 -0
- package/docs/multi-gateway-app-integration.md +124 -0
- package/docs/multi-gateway-phase1-acceptance.md +179 -0
- package/docs/multi-gateway-todo.md +137 -0
- package/docs/runtime-architecture.architecture.json +264 -0
- package/docs/runtime-architecture.html +15001 -0
- package/docs/runtime-architecture.visual-check.html +32 -0
- package/docs/runtime-architecture.visual-check.json +548 -0
- package/lib/client.js +30 -21
- package/lib/gateway-state.mjs +57 -0
- package/lib/index.mjs +70 -20
- package/package.json +2 -2
|
@@ -0,0 +1,264 @@
|
|
|
1
|
+
{
|
|
2
|
+
"schema_version": 1,
|
|
3
|
+
"diagram_type": "architecture",
|
|
4
|
+
"meta": {
|
|
5
|
+
"title": "DSH Mobile Gateway 运行时架构",
|
|
6
|
+
"subtitle": "移动 App 经网关访问 DSH Host,并接收会话、控制与工作区的实时状态",
|
|
7
|
+
"locale": "zh-CN",
|
|
8
|
+
"output": "runtime-architecture.html",
|
|
9
|
+
"quality_profile": "showcase",
|
|
10
|
+
"visual_preset": "signal-flow",
|
|
11
|
+
"viewBox": [1300, 700],
|
|
12
|
+
"views": [
|
|
13
|
+
{
|
|
14
|
+
"id": "request-path",
|
|
15
|
+
"label": "请求主链路",
|
|
16
|
+
"focus": ["mobileApp", "gatewayIngress", "protocolAdapter", "typertGateway", "dshRuntime"],
|
|
17
|
+
"note": "查看移动请求从 WebSocket 接入到 DSH Runtime 的完整调用链。"
|
|
18
|
+
},
|
|
19
|
+
{
|
|
20
|
+
"id": "realtime-path",
|
|
21
|
+
"label": "实时状态链路",
|
|
22
|
+
"focus": ["dshRuntime", "streamBridge", "gatewayIngress", "mobileApp"],
|
|
23
|
+
"note": "查看会话事件、运行状态与工作区变化如何增量推送回 App。"
|
|
24
|
+
},
|
|
25
|
+
{
|
|
26
|
+
"id": "security-data",
|
|
27
|
+
"label": "安全与数据",
|
|
28
|
+
"focus": ["deviceRegistry", "gatewayIngress", "fileTransfer", "durableState"],
|
|
29
|
+
"note": "查看设备鉴权、Token 摘要、附件和 Host 持久化边界。"
|
|
30
|
+
}
|
|
31
|
+
]
|
|
32
|
+
},
|
|
33
|
+
"layout": {
|
|
34
|
+
"mode": "grid",
|
|
35
|
+
"origin": [40, 80],
|
|
36
|
+
"cols": 5,
|
|
37
|
+
"gapX": 70,
|
|
38
|
+
"gapY": 120,
|
|
39
|
+
"cellW": 180,
|
|
40
|
+
"cellH": 76
|
|
41
|
+
},
|
|
42
|
+
"components": [
|
|
43
|
+
{
|
|
44
|
+
"id": "mobileApp",
|
|
45
|
+
"type": "frontend",
|
|
46
|
+
"label": "移动端 App",
|
|
47
|
+
"sublabel": "控制通道 + 会话通道",
|
|
48
|
+
"pos": [40, 330],
|
|
49
|
+
"size": [150, 76]
|
|
50
|
+
},
|
|
51
|
+
{
|
|
52
|
+
"id": "dshWebUi",
|
|
53
|
+
"type": "frontend",
|
|
54
|
+
"label": "DSH WebUI",
|
|
55
|
+
"sublabel": "同进程管理界面",
|
|
56
|
+
"pos": [40, 80],
|
|
57
|
+
"size": [150, 76]
|
|
58
|
+
},
|
|
59
|
+
{
|
|
60
|
+
"id": "gatewayIngress",
|
|
61
|
+
"type": "cloud",
|
|
62
|
+
"label": "网关接入",
|
|
63
|
+
"sublabel": "WSS / LAN · /ws/mobile",
|
|
64
|
+
"tag": "Nginx 可选",
|
|
65
|
+
"pos": [250, 330],
|
|
66
|
+
"size": [180, 76]
|
|
67
|
+
},
|
|
68
|
+
{
|
|
69
|
+
"id": "deviceRegistry",
|
|
70
|
+
"type": "security",
|
|
71
|
+
"label": "设备认证",
|
|
72
|
+
"sublabel": "配对码 · Token 摘要",
|
|
73
|
+
"pos": [250, 80],
|
|
74
|
+
"size": [180, 76]
|
|
75
|
+
},
|
|
76
|
+
{
|
|
77
|
+
"id": "protocolAdapter",
|
|
78
|
+
"type": "backend",
|
|
79
|
+
"label": "协议路由与适配",
|
|
80
|
+
"sublabel": "控制 / 会话 → Host 调用",
|
|
81
|
+
"pos": [500, 330],
|
|
82
|
+
"size": [180, 76]
|
|
83
|
+
},
|
|
84
|
+
{
|
|
85
|
+
"id": "fileTransfer",
|
|
86
|
+
"type": "backend",
|
|
87
|
+
"label": "附件传输",
|
|
88
|
+
"sublabel": "上传 · 下载 · 工作区文件",
|
|
89
|
+
"pos": [250, 500],
|
|
90
|
+
"size": [180, 76]
|
|
91
|
+
},
|
|
92
|
+
{
|
|
93
|
+
"id": "streamBridge",
|
|
94
|
+
"type": "messagebus",
|
|
95
|
+
"label": "实时状态桥",
|
|
96
|
+
"sublabel": "SessionEvent · control · workspace",
|
|
97
|
+
"pos": [500, 500],
|
|
98
|
+
"size": [180, 76]
|
|
99
|
+
},
|
|
100
|
+
{
|
|
101
|
+
"id": "typertGateway",
|
|
102
|
+
"type": "backend",
|
|
103
|
+
"label": "Remote Gateway",
|
|
104
|
+
"sublabel": "invoke / stream",
|
|
105
|
+
"pos": [750, 330],
|
|
106
|
+
"size": [180, 76]
|
|
107
|
+
},
|
|
108
|
+
{
|
|
109
|
+
"id": "dshRuntime",
|
|
110
|
+
"type": "backend",
|
|
111
|
+
"label": "DSH Runtime",
|
|
112
|
+
"sublabel": "Session · Workspace · HITL",
|
|
113
|
+
"pos": [1000, 330],
|
|
114
|
+
"size": [180, 76]
|
|
115
|
+
},
|
|
116
|
+
{
|
|
117
|
+
"id": "durableState",
|
|
118
|
+
"type": "database",
|
|
119
|
+
"label": "本地持久化",
|
|
120
|
+
"sublabel": "设备 · 附件 · Session 历史",
|
|
121
|
+
"pos": [1000, 500],
|
|
122
|
+
"size": [180, 76]
|
|
123
|
+
}
|
|
124
|
+
],
|
|
125
|
+
"boundaries": [
|
|
126
|
+
{
|
|
127
|
+
"kind": "region",
|
|
128
|
+
"label": "客户端",
|
|
129
|
+
"wraps": ["mobileApp", "dshWebUi"],
|
|
130
|
+
"pad": 24
|
|
131
|
+
},
|
|
132
|
+
{
|
|
133
|
+
"kind": "region",
|
|
134
|
+
"label": "Mobile Gateway 插件进程",
|
|
135
|
+
"wraps": ["gatewayIngress", "deviceRegistry", "protocolAdapter", "fileTransfer", "streamBridge"],
|
|
136
|
+
"pad": 28
|
|
137
|
+
},
|
|
138
|
+
{
|
|
139
|
+
"kind": "region",
|
|
140
|
+
"label": "DSH Host",
|
|
141
|
+
"wraps": ["typertGateway", "dshRuntime", "durableState"],
|
|
142
|
+
"pad": 28
|
|
143
|
+
}
|
|
144
|
+
],
|
|
145
|
+
"connections": [
|
|
146
|
+
{
|
|
147
|
+
"id": "mobileTransport",
|
|
148
|
+
"from": "mobileApp",
|
|
149
|
+
"to": "gatewayIngress",
|
|
150
|
+
"label": "WS / WSS",
|
|
151
|
+
"variant": "emphasis",
|
|
152
|
+
"fromSide": "right",
|
|
153
|
+
"toSide": "left",
|
|
154
|
+
"labelAt": [220, 352]
|
|
155
|
+
},
|
|
156
|
+
{
|
|
157
|
+
"id": "webUiManagement",
|
|
158
|
+
"from": "dshWebUi",
|
|
159
|
+
"to": "gatewayIngress",
|
|
160
|
+
"label": "管理 API",
|
|
161
|
+
"fromSide": "bottom",
|
|
162
|
+
"toSide": "top",
|
|
163
|
+
"via": [[115, 230], [340, 230]]
|
|
164
|
+
},
|
|
165
|
+
{
|
|
166
|
+
"id": "deviceAuth",
|
|
167
|
+
"from": "deviceRegistry",
|
|
168
|
+
"to": "gatewayIngress",
|
|
169
|
+
"label": "鉴权",
|
|
170
|
+
"variant": "security",
|
|
171
|
+
"fromSide": "bottom",
|
|
172
|
+
"toSide": "top",
|
|
173
|
+
"labelAt": [340, 170]
|
|
174
|
+
},
|
|
175
|
+
{
|
|
176
|
+
"id": "protocolFrames",
|
|
177
|
+
"from": "gatewayIngress",
|
|
178
|
+
"to": "protocolAdapter",
|
|
179
|
+
"variant": "emphasis",
|
|
180
|
+
"fromSide": "right",
|
|
181
|
+
"toSide": "left"
|
|
182
|
+
},
|
|
183
|
+
{
|
|
184
|
+
"id": "hostCalls",
|
|
185
|
+
"from": "protocolAdapter",
|
|
186
|
+
"to": "typertGateway",
|
|
187
|
+
"variant": "emphasis",
|
|
188
|
+
"fromSide": "right",
|
|
189
|
+
"toSide": "left"
|
|
190
|
+
},
|
|
191
|
+
{
|
|
192
|
+
"id": "remoteContract",
|
|
193
|
+
"from": "typertGateway",
|
|
194
|
+
"to": "dshRuntime",
|
|
195
|
+
"variant": "emphasis",
|
|
196
|
+
"fromSide": "right",
|
|
197
|
+
"toSide": "left"
|
|
198
|
+
},
|
|
199
|
+
{
|
|
200
|
+
"id": "persistHostState",
|
|
201
|
+
"from": "dshRuntime",
|
|
202
|
+
"to": "durableState",
|
|
203
|
+
"label": "历史 / 工作区",
|
|
204
|
+
"fromSide": "bottom",
|
|
205
|
+
"toSide": "top",
|
|
206
|
+
"labelAt": [1090, 430]
|
|
207
|
+
},
|
|
208
|
+
{
|
|
209
|
+
"id": "emitRuntimeState",
|
|
210
|
+
"from": "dshRuntime",
|
|
211
|
+
"to": "streamBridge",
|
|
212
|
+
"label": "事件 / 状态",
|
|
213
|
+
"variant": "dashed",
|
|
214
|
+
"fromSide": "left",
|
|
215
|
+
"toSide": "right",
|
|
216
|
+
"via": [[950, 368], [950, 538]]
|
|
217
|
+
},
|
|
218
|
+
{
|
|
219
|
+
"id": "pushMobileState",
|
|
220
|
+
"from": "streamBridge",
|
|
221
|
+
"to": "gatewayIngress",
|
|
222
|
+
"label": "增量推送",
|
|
223
|
+
"variant": "dashed",
|
|
224
|
+
"fromSide": "top",
|
|
225
|
+
"toSide": "bottom",
|
|
226
|
+
"via": [[590, 455], [340, 455]]
|
|
227
|
+
},
|
|
228
|
+
{
|
|
229
|
+
"id": "readWorkspace",
|
|
230
|
+
"from": "fileTransfer",
|
|
231
|
+
"to": "durableState",
|
|
232
|
+
"label": "文件 I/O",
|
|
233
|
+
"fromSide": "bottom",
|
|
234
|
+
"toSide": "bottom",
|
|
235
|
+
"via": [[340, 650], [1090, 650]]
|
|
236
|
+
}
|
|
237
|
+
],
|
|
238
|
+
"cards": [
|
|
239
|
+
{
|
|
240
|
+
"dot": "cyan",
|
|
241
|
+
"title": "请求路径",
|
|
242
|
+
"items": [
|
|
243
|
+
"App 经 WSS 或局域网接入",
|
|
244
|
+
"网关鉴权、分流并调用 Host"
|
|
245
|
+
]
|
|
246
|
+
},
|
|
247
|
+
{
|
|
248
|
+
"dot": "emerald",
|
|
249
|
+
"title": "实时路径",
|
|
250
|
+
"items": [
|
|
251
|
+
"订阅 SessionEvent 与控制状态",
|
|
252
|
+
"按连接向 App 增量推送"
|
|
253
|
+
]
|
|
254
|
+
},
|
|
255
|
+
{
|
|
256
|
+
"dot": "amber",
|
|
257
|
+
"title": "安全与数据",
|
|
258
|
+
"items": [
|
|
259
|
+
"设备 Token 仅持久化摘要",
|
|
260
|
+
"附件与 Session 历史分层管理"
|
|
261
|
+
]
|
|
262
|
+
}
|
|
263
|
+
]
|
|
264
|
+
}
|