@shun-js/aibaiban-server 0.5.2 → 0.5.4
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/package.json +2 -2
- package/server/util/llm.js +4 -2
- package/server/util/prompt-draw.md +38 -34
- package/views/index.html +2 -2
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@shun-js/aibaiban-server",
|
|
3
|
-
"version": "0.5.
|
|
3
|
+
"version": "0.5.4",
|
|
4
4
|
"description": "aibaiban.com server",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"ai aibaiban"
|
|
@@ -44,5 +44,5 @@
|
|
|
44
44
|
"access": "public",
|
|
45
45
|
"registry": "https://registry.npmjs.org/"
|
|
46
46
|
},
|
|
47
|
-
"gitHead": "
|
|
47
|
+
"gitHead": "9ec4b45e3bf4021ffb4d477868dee75167e5bc53"
|
|
48
48
|
}
|
package/server/util/llm.js
CHANGED
|
@@ -83,9 +83,11 @@ const drawJsonSchema = (() => {
|
|
|
83
83
|
id: z.string().describe('节点唯一标识符,使用驼峰命名法,如 userService, mysqlDB'),
|
|
84
84
|
label: z.string().describe('节点显示文本,支持 \\n 换行'),
|
|
85
85
|
type: z
|
|
86
|
-
.enum(['rectangle', 'ellipse', 'diamond'
|
|
86
|
+
.enum(['rectangle', 'ellipse', 'diamond'])
|
|
87
87
|
.optional()
|
|
88
|
-
.describe(
|
|
88
|
+
.describe(
|
|
89
|
+
'形状类型:rectangle=矩形(组件/服务), ellipse=椭圆(数据库/云), diamond=菱形(判断/中间件),默认 rectangle',
|
|
90
|
+
),
|
|
89
91
|
color: z
|
|
90
92
|
.enum(['blue', 'green', 'purple', 'orange', 'red', 'gray', 'yellow', 'pink', 'black'])
|
|
91
93
|
.optional()
|
|
@@ -16,14 +16,18 @@
|
|
|
16
16
|
|
|
17
17
|
你可以创建以下类型的形状节点:
|
|
18
18
|
|
|
19
|
-
| 类型 | 说明 | 适用场景
|
|
20
|
-
| ----------- | -------------- |
|
|
21
|
-
| `rectangle` | 矩形(带圆角) |
|
|
22
|
-
| `ellipse` | 椭圆/圆形 |
|
|
23
|
-
| `diamond` | 菱形 |
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
19
|
+
| 类型 | 说明 | 适用场景 |
|
|
20
|
+
| ----------- | -------------- | ---------------------------------------------- |
|
|
21
|
+
| `rectangle` | 矩形(带圆角) | 系统模块、功能块、组件、服务、外部服务、API |
|
|
22
|
+
| `ellipse` | 椭圆/圆形 | 数据库、存储、开始/结束、状态、云服务 |
|
|
23
|
+
| `diamond` | 菱形 | 判断节点、决策点、网关、数据处理、转换、中间件 |
|
|
24
|
+
|
|
25
|
+
**重要提示**:
|
|
26
|
+
|
|
27
|
+
- 只使用这三种类型:`rectangle`、`ellipse`、`diamond`
|
|
28
|
+
- 数据库、数据仓库、持久化 → 使用 `ellipse`
|
|
29
|
+
- 数据处理、转换、中间件、缓存 → 使用 `diamond`
|
|
30
|
+
- 云服务、外部服务 → 使用 `rectangle`
|
|
27
31
|
|
|
28
32
|
#### 连接关系(Connections)
|
|
29
33
|
|
|
@@ -343,7 +347,7 @@
|
|
|
343
347
|
{
|
|
344
348
|
"id": "cdn",
|
|
345
349
|
"label": "CDN\n静态资源",
|
|
346
|
-
"type": "
|
|
350
|
+
"type": "rectangle",
|
|
347
351
|
"color": "red"
|
|
348
352
|
},
|
|
349
353
|
{
|
|
@@ -373,7 +377,7 @@
|
|
|
373
377
|
{
|
|
374
378
|
"id": "mysql",
|
|
375
379
|
"label": "MySQL\n数据库",
|
|
376
|
-
"type": "
|
|
380
|
+
"type": "ellipse",
|
|
377
381
|
"color": "purple"
|
|
378
382
|
},
|
|
379
383
|
{
|
|
@@ -454,7 +458,7 @@
|
|
|
454
458
|
{
|
|
455
459
|
"id": "serviceDiscovery",
|
|
456
460
|
"label": "服务发现\nConsul/Eureka",
|
|
457
|
-
"type": "
|
|
461
|
+
"type": "diamond",
|
|
458
462
|
"color": "orange"
|
|
459
463
|
},
|
|
460
464
|
{
|
|
@@ -484,31 +488,31 @@
|
|
|
484
488
|
{
|
|
485
489
|
"id": "messageQueue",
|
|
486
490
|
"label": "消息队列\nRabbitMQ/Kafka",
|
|
487
|
-
"type": "
|
|
491
|
+
"type": "diamond",
|
|
488
492
|
"color": "orange"
|
|
489
493
|
},
|
|
490
494
|
{
|
|
491
495
|
"id": "db1",
|
|
492
496
|
"label": "User DB",
|
|
493
|
-
"type": "
|
|
497
|
+
"type": "ellipse",
|
|
494
498
|
"color": "purple"
|
|
495
499
|
},
|
|
496
500
|
{
|
|
497
501
|
"id": "db2",
|
|
498
502
|
"label": "Order DB",
|
|
499
|
-
"type": "
|
|
503
|
+
"type": "ellipse",
|
|
500
504
|
"color": "purple"
|
|
501
505
|
},
|
|
502
506
|
{
|
|
503
507
|
"id": "db3",
|
|
504
508
|
"label": "Product DB",
|
|
505
|
-
"type": "
|
|
509
|
+
"type": "ellipse",
|
|
506
510
|
"color": "purple"
|
|
507
511
|
},
|
|
508
512
|
{
|
|
509
513
|
"id": "monitoring",
|
|
510
514
|
"label": "监控\nPrometheus",
|
|
511
|
-
"type": "
|
|
515
|
+
"type": "rectangle",
|
|
512
516
|
"color": "red"
|
|
513
517
|
}
|
|
514
518
|
],
|
|
@@ -598,7 +602,7 @@
|
|
|
598
602
|
{
|
|
599
603
|
"id": "database",
|
|
600
604
|
"label": "数据库",
|
|
601
|
-
"type": "
|
|
605
|
+
"type": "ellipse",
|
|
602
606
|
"color": "purple"
|
|
603
607
|
}
|
|
604
608
|
],
|
|
@@ -697,9 +701,9 @@ interface SimplifiedDiagram {
|
|
|
697
701
|
interface DiagramNode {
|
|
698
702
|
id: string; // 唯一标识符
|
|
699
703
|
label: string; // 显示文本(支持 \n 换行)
|
|
700
|
-
type?: 'rectangle' | 'ellipse' | 'diamond'
|
|
704
|
+
type?: 'rectangle' | 'ellipse' | 'diamond';
|
|
701
705
|
color?: 'blue' | 'green' | 'purple' | 'orange' | 'red' | 'gray' | 'yellow' | 'pink' | 'black';
|
|
702
|
-
//
|
|
706
|
+
// 可选的位置和尺寸(��指定则自动布局)
|
|
703
707
|
x?: number;
|
|
704
708
|
y?: number;
|
|
705
709
|
width?: number;
|
|
@@ -794,13 +798,13 @@ interface FreedrawElement {
|
|
|
794
798
|
{
|
|
795
799
|
"id": "cdn",
|
|
796
800
|
"label": "CDN",
|
|
797
|
-
"type": "
|
|
801
|
+
"type": "rectangle",
|
|
798
802
|
"color": "red"
|
|
799
803
|
},
|
|
800
804
|
{
|
|
801
805
|
"id": "loadBalancer",
|
|
802
806
|
"label": "负载均衡\nNginx",
|
|
803
|
-
"type": "
|
|
807
|
+
"type": "diamond",
|
|
804
808
|
"color": "orange"
|
|
805
809
|
},
|
|
806
810
|
{
|
|
@@ -842,13 +846,13 @@ interface FreedrawElement {
|
|
|
842
846
|
{
|
|
843
847
|
"id": "mysqlMaster",
|
|
844
848
|
"label": "MySQL主库",
|
|
845
|
-
"type": "
|
|
849
|
+
"type": "ellipse",
|
|
846
850
|
"color": "purple"
|
|
847
851
|
},
|
|
848
852
|
{
|
|
849
853
|
"id": "mysqlSlave",
|
|
850
854
|
"label": "MySQL从库",
|
|
851
|
-
"type": "
|
|
855
|
+
"type": "ellipse",
|
|
852
856
|
"color": "purple"
|
|
853
857
|
},
|
|
854
858
|
{
|
|
@@ -860,19 +864,19 @@ interface FreedrawElement {
|
|
|
860
864
|
{
|
|
861
865
|
"id": "elasticsearch",
|
|
862
866
|
"label": "Elasticsearch\n搜索引擎",
|
|
863
|
-
"type": "
|
|
867
|
+
"type": "ellipse",
|
|
864
868
|
"color": "purple"
|
|
865
869
|
},
|
|
866
870
|
{
|
|
867
871
|
"id": "messageQueue",
|
|
868
872
|
"label": "消息队列\nKafka",
|
|
869
|
-
"type": "
|
|
873
|
+
"type": "diamond",
|
|
870
874
|
"color": "orange"
|
|
871
875
|
},
|
|
872
876
|
{
|
|
873
877
|
"id": "ossStorage",
|
|
874
878
|
"label": "对象存储\nOSS",
|
|
875
|
-
"type": "
|
|
879
|
+
"type": "rectangle",
|
|
876
880
|
"color": "red"
|
|
877
881
|
}
|
|
878
882
|
],
|
|
@@ -999,9 +1003,9 @@ interface FreedrawElement {
|
|
|
999
1003
|
### 节点类型速查
|
|
1000
1004
|
|
|
1001
1005
|
- 流程:rectangle, diamond, ellipse
|
|
1002
|
-
- 数据:
|
|
1003
|
-
- 处理:
|
|
1004
|
-
- 外部:
|
|
1006
|
+
- 数据:ellipse
|
|
1007
|
+
- 处理:diamond, rectangle
|
|
1008
|
+
- 外部:rectangle
|
|
1005
1009
|
- 判断:diamond
|
|
1006
1010
|
|
|
1007
1011
|
### 连接类型速查
|
|
@@ -1013,11 +1017,11 @@ interface FreedrawElement {
|
|
|
1013
1017
|
|
|
1014
1018
|
### 颜色速查
|
|
1015
1019
|
|
|
1016
|
-
-
|
|
1017
|
-
-
|
|
1018
|
-
-
|
|
1019
|
-
-
|
|
1020
|
-
-
|
|
1020
|
+
- 蓝色:前端、用户、UI
|
|
1021
|
+
- 绿色:后端、服务、处理逻辑
|
|
1022
|
+
- 紫色:数据库、存储、持久化
|
|
1023
|
+
- 橙色:中间件、缓存、队列、网关
|
|
1024
|
+
- 红色:外部服务、告警、CDN
|
|
1021
1025
|
- 灰色:中性、说明
|
|
1022
1026
|
|
|
1023
1027
|
---
|
package/views/index.html
CHANGED
|
@@ -56,9 +56,9 @@
|
|
|
56
56
|
<script
|
|
57
57
|
type="module"
|
|
58
58
|
crossorigin
|
|
59
|
-
src="https://static-small.vincentqiao.com/aibaiban/static/index-
|
|
59
|
+
src="https://static-small.vincentqiao.com/aibaiban/static/index-B1ghe60d.js"
|
|
60
60
|
></script>
|
|
61
|
-
<link rel="stylesheet" crossorigin href="https://static-small.vincentqiao.com/aibaiban/static/index-
|
|
61
|
+
<link rel="stylesheet" crossorigin href="https://static-small.vincentqiao.com/aibaiban/static/index-CbnkZ4JF.css" />
|
|
62
62
|
</head>
|
|
63
63
|
<body>
|
|
64
64
|
<div id="root"></div>
|