@@ -20,19 +20,25 @@ export enum Chapters {
20
20
xrobot = "/xrobot/" ,
21
21
// guide
22
22
xrobot_guide = "/xrobot/guide/" ,
23
+ xrobot_guide_quick_start = "/xrobot/guide/quick-start/" ,
24
+ xrobot_guide_xiaozhi_firmware = "/xrobot/guide/xiaozhi-firmware/" ,
25
+ xrobot_guide_xiaozhi_hardware = "/xrobot/guide/xiaozhi-hardware/" ,
26
+ xrobot_guide_platform_mp = "/xrobot/guide/platform-mp/" ,
23
27
// api
24
28
xrobot_api = "/xrobot/api/" ,
25
29
xrobot_api_server = "/xrobot/api/server/" ,
26
30
// xrobot_api_client = "/xrobot/api/client/",
27
31
xrobot_api_protocol = "/xrobot/api/protocol/" ,
32
+ xrobot_api_mcp = "/xrobot/api/mcp/" ,
28
33
// platform
29
34
xrobot_platform = "/xrobot/platform/" ,
30
35
xrobot_platform_esp32 = "/xrobot/platform/esp32/" ,
31
36
xrobot_platform_others = "/xrobot/platform/others/" ,
32
37
xrobot_platform_others_mp = "/xrobot/platform/others/mini-program/" ,
33
38
xrobot_platform_others_console = "/xrobot/platform/others/console/" ,
34
39
xrobot_platform_others_device = "/xrobot/platform/others/device/" ,
35
- xrobot_platform_others_device_net_config = "/xrobot/platform/others/net-config/" ,
40
+ xrobot_platform_others_device_net_config = "/xrobot/platform/others/device/net-config/" ,
41
+ xrobot_platform_others_device_device_bind = "/xrobot/platform/others/device/device-bind/" ,
36
42
// faq
37
43
xrobot_faq = "/xrobot/faq/" ,
38
44
}
@@ -77,7 +83,7 @@ export function apply_prefix(item: ChapterItem, prefix: Chapters) {
77
83
return { ...item , link : prefix + item . link } ;
78
84
}
79
85
80
- export const items_xrobot_api_server = [
86
+ const items_xrobot_api_server = [
81
87
{
82
88
text : "平台接入API" ,
83
89
collapsed : true ,
@@ -91,7 +97,7 @@ export const items_xrobot_api_server = [
91
97
} ,
92
98
] ;
93
99
94
- // export const items_xrobot_api_client = [
100
+ // const items_xrobot_api_client = [
95
101
// {
96
102
// text: "设备接入协议",
97
103
// collapsed: true,
@@ -100,7 +106,7 @@ export const items_xrobot_api_server = [
100
106
// },
101
107
// ];
102
108
103
- export const items_xrobot_api_protocol = [
109
+ const items_xrobot_api_protocol = [
104
110
{
105
111
text : "设备接入协议" ,
106
112
collapsed : true ,
@@ -113,20 +119,29 @@ export const items_xrobot_api_protocol = [
113
119
} ,
114
120
] ;
115
121
116
- export const items_xrobot_api = [
122
+ const items_xrobot_api_mcp = [
123
+ {
124
+ text : "MCP接入" ,
125
+ link : Chapters . xrobot_api_mcp ,
126
+ items : [ ] . map ( ( item ) => apply_prefix ( item , Chapters . xrobot_api_mcp ) ) ,
127
+ } ,
128
+ ] ;
129
+
130
+ const items_xrobot_api = [
117
131
{
118
132
text : "API参考" ,
119
- collapsed : false ,
133
+ // collapsed: false,
120
134
link : Chapters . xrobot_api ,
121
135
items : [
122
136
...items_xrobot_api_server ,
123
137
// ...items_xrobot_api_client,
124
138
...items_xrobot_api_protocol ,
139
+ ...items_xrobot_api_mcp ,
125
140
] ,
126
141
} ,
127
142
] ;
128
143
129
- export const items_xrobot_platform_mp = [
144
+ const items_xrobot_platform_mp = [
130
145
{
131
146
text : "微信小程序" ,
132
147
link : Chapters . xrobot_platform_others_mp ,
@@ -154,7 +169,21 @@ const items_xrobot_platform_net_config = [
154
169
} ,
155
170
] ;
156
171
157
- export const items_xrobot_platform_device = [
172
+ const items_xrobot_platform_device_bind = [
173
+ {
174
+ text : "绑定设备" ,
175
+ link : Chapters . xrobot_platform_others_device_device_bind ,
176
+ collapsed : true ,
177
+ items : [
178
+ { text : "通过微信小程序" , link : "mp" } ,
179
+ { text : "通过浏览器" , link : "browser" } ,
180
+ ] . map ( ( item ) =>
181
+ apply_prefix ( item , Chapters . xrobot_platform_others_device_device_bind )
182
+ ) ,
183
+ } ,
184
+ ] ;
185
+
186
+ const items_xrobot_platform_device = [
158
187
{
159
188
text : "设备配置与使用" ,
160
189
link : Chapters . xrobot_platform_others_device ,
@@ -164,6 +193,7 @@ export const items_xrobot_platform_device = [
164
193
apply_prefix ( item , Chapters . xrobot_platform_others_device )
165
194
) ,
166
195
...items_xrobot_platform_net_config ,
196
+ ...items_xrobot_platform_device_bind ,
167
197
] ,
168
198
} ,
169
199
] ;
@@ -183,7 +213,72 @@ const items_xrobot_platform_console = [
183
213
} ,
184
214
] ;
185
215
186
- export const items_xrobot_guide = [ ] ;
216
+ const items_xrobot_guide_quick_start = [
217
+ {
218
+ text : "快速入门" ,
219
+ link : Chapters . xrobot_guide_quick_start ,
220
+ collapsed : false ,
221
+ items : [ { text : "创建智能体" , link : "create-agent" } ] . map ( ( item ) =>
222
+ apply_prefix ( item , Chapters . xrobot_guide_quick_start )
223
+ ) ,
224
+ } ,
225
+ ] ;
226
+
227
+ const items_xrobot_guide_xiaozhi_firmware = [
228
+ {
229
+ text : "小智固件接入" ,
230
+ link : Chapters . xrobot_guide_xiaozhi_firmware ,
231
+ collapsed : true ,
232
+ items : [
233
+ ...[
234
+ { text : "编译小智固件" , link : "compile" } ,
235
+ { text : "配网高级选项" , link : "advanced-options" } ,
236
+ ] . map ( ( item ) =>
237
+ apply_prefix ( item , Chapters . xrobot_guide_xiaozhi_firmware )
238
+ ) ,
239
+ ...items_xrobot_guide_quick_start . flatMap ( ( item ) => ( {
240
+ text : item . text ,
241
+ link : item . link ,
242
+ } ) ) ,
243
+ ] ,
244
+ } ,
245
+ ] ;
246
+
247
+ const items_xrobot_guide_xiaozhi_hardware = [
248
+ {
249
+ text : "小智硬件接入" ,
250
+ link : Chapters . xrobot_guide_xiaozhi_hardware ,
251
+ collapsed : true ,
252
+ items : [ ] . map ( ( item ) =>
253
+ apply_prefix ( item , Chapters . xrobot_guide_xiaozhi_hardware )
254
+ ) ,
255
+ } ,
256
+ ] ;
257
+ const items_xrobot_guide_platform_mp = [
258
+ {
259
+ text : "平台小程序接入" ,
260
+ link : Chapters . xrobot_guide_platform_mp ,
261
+ collapsed : true ,
262
+ items : [ ] . map ( ( item ) =>
263
+ apply_prefix ( item , Chapters . xrobot_guide_platform_mp )
264
+ ) ,
265
+ } ,
266
+ ] ;
267
+
268
+ const items_xrobot_guide = [
269
+ {
270
+ text : "最佳实践" ,
271
+ link : Chapters . xrobot_guide ,
272
+ collapsed : false ,
273
+ items : [
274
+ ...items_xrobot_guide_quick_start ,
275
+ ...items_xrobot_guide_xiaozhi_firmware ,
276
+ ...items_xrobot_guide_xiaozhi_hardware ,
277
+ ...items_xrobot_guide_platform_mp ,
278
+ ] ,
279
+ // .map((item) => apply_prefix(item, Chapters.xrobot_guide)),
280
+ } ,
281
+ ] ;
187
282
188
283
const items_xrobot_platform_esp32 = [
189
284
{
@@ -197,7 +292,6 @@ const items_xrobot_platform_esp32 = [
197
292
} ,
198
293
] ;
199
294
200
- // todo: 调整guide内容位置
201
295
const items_xrobot_platform_others = [
202
296
{
203
297
text : "厂商接入指南" ,
@@ -215,7 +309,7 @@ const items_xrobot_platform = [
215
309
{
216
310
text : "最佳实践" ,
217
311
link : Chapters . xrobot_platform ,
218
- collapsed : false ,
312
+ // collapsed: false,
219
313
items : [ ...items_xrobot_platform_esp32 , ...items_xrobot_platform_others ] ,
220
314
} ,
221
315
] ;
@@ -271,8 +365,28 @@ export const ChapterItems: Record<Chapters, ChapterItem[]> = {
271
365
gobackItem ( Chapters . xrobot_api ) ,
272
366
...items_xrobot_api_protocol ,
273
367
] ,
368
+ [ Chapters . xrobot_api_mcp ] : [
369
+ gobackItem ( Chapters . xrobot_api ) ,
370
+ ...items_xrobot_api_mcp ,
371
+ ] ,
274
372
// guide
275
373
[ Chapters . xrobot_guide ] : [ gobackItem ( Chapters . xrobot ) , ...items_xrobot_guide ] ,
374
+ [ Chapters . xrobot_guide_quick_start ] : [
375
+ gobackItem ( Chapters . xrobot ) ,
376
+ ...items_xrobot_guide_quick_start ,
377
+ ] ,
378
+ [ Chapters . xrobot_guide_xiaozhi_firmware ] : [
379
+ gobackItem ( Chapters . xrobot ) ,
380
+ ...items_xrobot_guide_xiaozhi_firmware ,
381
+ ] ,
382
+ [ Chapters . xrobot_guide_xiaozhi_hardware ] : [
383
+ gobackItem ( Chapters . xrobot ) ,
384
+ ...items_xrobot_guide_xiaozhi_hardware ,
385
+ ] ,
386
+ [ Chapters . xrobot_guide_platform_mp ] : [
387
+ gobackItem ( Chapters . xrobot ) ,
388
+ ...items_xrobot_guide_platform_mp ,
389
+ ] ,
276
390
// platform
277
391
[ Chapters . xrobot_platform ] : [
278
392
gobackItem ( Chapters . xrobot ) ,
@@ -304,6 +418,11 @@ export const ChapterItems: Record<Chapters, ChapterItem[]> = {
304
418
gobackItem ( Chapters . xrobot_platform_others ) ,
305
419
...items_xrobot_platform_net_config ,
306
420
] ,
421
+ [ Chapters . xrobot_platform_others_device_device_bind ] : [
422
+ gobackItem ( Chapters . xrobot_platform_others ) ,
423
+ ...items_xrobot_platform_device_bind ,
424
+ ] ,
425
+ // platform - others END
307
426
// faq
308
427
[ Chapters . xrobot_faq ] : [ gobackItem ( Chapters . xrobot ) , ...items_xrobot_faq ] ,
309
428
} ;
0 commit comments