dsh-model-everything 0.0.0-stage → 0.1.0

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.
Files changed (130) hide show
  1. package/LICENSE +21 -0
  2. package/README.en-US.md +319 -0
  3. package/README.md +319 -3
  4. package/cordis.patch.yml +20 -0
  5. package/examples/README.md +48 -0
  6. package/examples/control-dispatcher.json +113 -0
  7. package/examples/control-dispatcher.overbudget.json +113 -0
  8. package/examples/ecommerce-data-model.json +185 -0
  9. package/examples/order-state-machine.after.json +116 -0
  10. package/examples/order-state-machine.before.json +101 -0
  11. package/examples/user-migration.after.json +29 -0
  12. package/examples/user-migration.before.json +29 -0
  13. package/gate/locale/en.json +6 -0
  14. package/gate/locale/zh.json +6 -0
  15. package/gate/package.json +5 -0
  16. package/lib/baseline.js +249 -0
  17. package/lib/compose-tool.js +76 -0
  18. package/lib/concurrency-tool.js +40 -0
  19. package/lib/concurrency.js +206 -0
  20. package/lib/data-engine.js +1141 -0
  21. package/lib/data-tool.js +79 -0
  22. package/lib/design-engine.js +1149 -0
  23. package/lib/design-tool.js +55 -0
  24. package/lib/engine.js +4343 -0
  25. package/lib/export-tool.js +78 -0
  26. package/lib/exporters.js +434 -0
  27. package/lib/gate.js +274 -0
  28. package/lib/granularity.js +237 -0
  29. package/lib/index.js +237 -0
  30. package/lib/json-value.js +18 -0
  31. package/lib/option-shape.js +62 -0
  32. package/lib/report-diff-tool.js +63 -0
  33. package/lib/report-view.js +408 -0
  34. package/lib/structure-tool.js +91 -0
  35. package/lib/structure.js +711 -0
  36. package/lib/tool.js +85 -0
  37. package/lib/types/baseline.d.ts +65 -0
  38. package/lib/types/compose-tool.d.ts +7 -0
  39. package/lib/types/concurrency-tool.d.ts +8 -0
  40. package/lib/types/concurrency.d.ts +37 -0
  41. package/lib/types/data-engine.d.ts +211 -0
  42. package/lib/types/data-tool.d.ts +10 -0
  43. package/lib/types/design-engine.d.ts +215 -0
  44. package/lib/types/design-tool.d.ts +11 -0
  45. package/lib/types/engine.d.ts +494 -0
  46. package/lib/types/export-tool.d.ts +7 -0
  47. package/lib/types/exporters.d.ts +37 -0
  48. package/lib/types/gate.d.ts +91 -0
  49. package/lib/types/granularity.d.ts +106 -0
  50. package/lib/types/index.d.ts +45 -0
  51. package/lib/types/json-value.d.ts +21 -0
  52. package/lib/types/option-shape.d.ts +22 -0
  53. package/lib/types/report-diff-tool.d.ts +8 -0
  54. package/lib/types/report-view.d.ts +43 -0
  55. package/lib/types/structure-tool.d.ts +10 -0
  56. package/lib/types/structure.d.ts +152 -0
  57. package/lib/types/tool.d.ts +11 -0
  58. package/lib/types/uml-communication.d.ts +109 -0
  59. package/lib/types/uml-composite.d.ts +107 -0
  60. package/lib/types/uml-interaction-overview.d.ts +91 -0
  61. package/lib/types/uml-profile.d.ts +112 -0
  62. package/lib/types/uml-structure.d.ts +53 -0
  63. package/lib/types/uml-syntax.d.ts +296 -0
  64. package/lib/types/uml-timing.d.ts +152 -0
  65. package/lib/types/uml-tool.d.ts +12 -0
  66. package/lib/types/uml-usecase.d.ts +58 -0
  67. package/lib/types/uml.d.ts +303 -0
  68. package/lib/uml-communication.js +353 -0
  69. package/lib/uml-composite.js +442 -0
  70. package/lib/uml-interaction-overview.js +277 -0
  71. package/lib/uml-profile.js +373 -0
  72. package/lib/uml-structure.js +306 -0
  73. package/lib/uml-syntax.js +545 -0
  74. package/lib/uml-timing.js +974 -0
  75. package/lib/uml-tool.js +213 -0
  76. package/lib/uml-usecase.js +532 -0
  77. package/lib/uml.js +2110 -0
  78. package/locale/en.json +6 -0
  79. package/locale/zh.json +6 -0
  80. package/package.json +124 -6
  81. package/skills/model-everything/SKILL.md +482 -0
  82. package/skills/model-everything/references/dsh-model-schema.md +437 -0
  83. package/skills/model-everything/references/gap-routing-guide.md +42 -0
  84. package/skills/model-everything/references/hash-spec.md +152 -0
  85. package/skills/model-everything/references/logic-verification-guide.md +422 -0
  86. package/skills/model-everything-datamodel/SKILL.md +130 -0
  87. package/skills/model-everything-datamodel/references/data-model-guide.md +84 -0
  88. package/skills/model-everything-datamodel/references/data-model-schema.md +128 -0
  89. package/skills/model-everything-design/SKILL.md +115 -0
  90. package/skills/model-everything-interleaving/SKILL.md +63 -0
  91. package/skills/model-everything-interleaving/SKILL.zh-CN.md +60 -0
  92. package/skills/model-everything-interleaving/references/concurrency-risk-guide.md +63 -0
  93. package/skills/model-everything-report-reading/SKILL.md +137 -0
  94. package/skills/model-everything-report-reading/references/reading-a-report.md +166 -0
  95. package/skills/model-everything-report-reading/references/reading-a-report.mmd +59 -0
  96. package/skills/model-everything-structure/SKILL.md +96 -0
  97. package/skills/model-everything-structure/references/structure-review-guide.md +201 -0
  98. package/skills/model-everything-uml/SKILL.md +60 -0
  99. package/skills/model-everything-uml/references/uml-modeling-guide.md +551 -0
  100. package/src/baseline.ts +288 -0
  101. package/src/compose-tool.ts +78 -0
  102. package/src/concurrency-tool.ts +44 -0
  103. package/src/concurrency.ts +254 -0
  104. package/src/data-engine.ts +1208 -0
  105. package/src/data-tool.ts +83 -0
  106. package/src/design-engine.ts +1263 -0
  107. package/src/design-tool.ts +60 -0
  108. package/src/engine.ts +4564 -0
  109. package/src/export-tool.ts +81 -0
  110. package/src/exporters.ts +399 -0
  111. package/src/gate.ts +330 -0
  112. package/src/granularity.ts +312 -0
  113. package/src/index.ts +289 -0
  114. package/src/json-value.ts +20 -0
  115. package/src/option-shape.ts +64 -0
  116. package/src/report-diff-tool.ts +67 -0
  117. package/src/report-view.ts +451 -0
  118. package/src/structure-tool.ts +93 -0
  119. package/src/structure.ts +786 -0
  120. package/src/tool.ts +94 -0
  121. package/src/uml-communication.ts +428 -0
  122. package/src/uml-composite.ts +520 -0
  123. package/src/uml-interaction-overview.ts +321 -0
  124. package/src/uml-profile.ts +439 -0
  125. package/src/uml-structure.ts +317 -0
  126. package/src/uml-syntax.ts +764 -0
  127. package/src/uml-timing.ts +1106 -0
  128. package/src/uml-tool.ts +230 -0
  129. package/src/uml-usecase.ts +566 -0
  130. package/src/uml.ts +2139 -0
@@ -0,0 +1,185 @@
1
+ {
2
+ "schemaVersion": 1,
3
+ "entities": [
4
+ {
5
+ "name": "Customer",
6
+ "fields": [
7
+ {
8
+ "name": "id",
9
+ "type": "uuid",
10
+ "required": true
11
+ },
12
+ {
13
+ "name": "email",
14
+ "type": "string",
15
+ "required": true,
16
+ "unique": true
17
+ },
18
+ {
19
+ "name": "name",
20
+ "type": "string",
21
+ "required": true
22
+ }
23
+ ],
24
+ "primaryKey": [
25
+ "id"
26
+ ]
27
+ },
28
+ {
29
+ "name": "Product",
30
+ "fields": [
31
+ {
32
+ "name": "id",
33
+ "type": "uuid",
34
+ "required": true
35
+ },
36
+ {
37
+ "name": "sku",
38
+ "type": "string",
39
+ "required": true,
40
+ "unique": true
41
+ },
42
+ {
43
+ "name": "price",
44
+ "type": "number",
45
+ "required": true,
46
+ "min": 0
47
+ }
48
+ ],
49
+ "primaryKey": [
50
+ "id"
51
+ ]
52
+ },
53
+ {
54
+ "name": "Order",
55
+ "fields": [
56
+ {
57
+ "name": "id",
58
+ "type": "uuid",
59
+ "required": true
60
+ },
61
+ {
62
+ "name": "customerId",
63
+ "type": "uuid",
64
+ "required": true,
65
+ "ref": "Customer.id"
66
+ },
67
+ {
68
+ "name": "status",
69
+ "type": "enum",
70
+ "required": true,
71
+ "enum": [
72
+ "new",
73
+ "paid",
74
+ "shipped",
75
+ "cancelled"
76
+ ]
77
+ }
78
+ ],
79
+ "primaryKey": [
80
+ "id"
81
+ ]
82
+ },
83
+ {
84
+ "name": "OrderItem",
85
+ "fields": [
86
+ {
87
+ "name": "id",
88
+ "type": "uuid",
89
+ "required": true
90
+ },
91
+ {
92
+ "name": "orderId",
93
+ "type": "uuid",
94
+ "required": true,
95
+ "ref": "Order.id"
96
+ },
97
+ {
98
+ "name": "productId",
99
+ "type": "uuid",
100
+ "required": true,
101
+ "ref": "Product.id"
102
+ },
103
+ {
104
+ "name": "quantity",
105
+ "type": "integer",
106
+ "required": true,
107
+ "min": 1
108
+ }
109
+ ],
110
+ "primaryKey": [
111
+ "id"
112
+ ]
113
+ }
114
+ ],
115
+ "relationships": [
116
+ {
117
+ "fromEntity": "Order",
118
+ "fromField": "customerId",
119
+ "toEntity": "Customer",
120
+ "toField": "id",
121
+ "onDelete": "restrict"
122
+ },
123
+ {
124
+ "fromEntity": "OrderItem",
125
+ "fromField": "orderId",
126
+ "toEntity": "Order",
127
+ "toField": "id",
128
+ "onDelete": "cascade"
129
+ },
130
+ {
131
+ "fromEntity": "OrderItem",
132
+ "fromField": "productId",
133
+ "toEntity": "Product",
134
+ "toField": "id",
135
+ "onDelete": "restrict"
136
+ }
137
+ ],
138
+ "invariants": [
139
+ {
140
+ "id": "customer-email-unique",
141
+ "description": "customer email unique",
142
+ "kind": "unique",
143
+ "entity": "Customer",
144
+ "fields": [
145
+ "email"
146
+ ]
147
+ },
148
+ {
149
+ "id": "order-customer-ref",
150
+ "description": "order customer reference",
151
+ "kind": "referential-integrity",
152
+ "entity": "Order",
153
+ "field": "customerId",
154
+ "refEntity": "Customer"
155
+ },
156
+ {
157
+ "id": "quantity-positive",
158
+ "description": "quantity positive",
159
+ "kind": "range",
160
+ "entity": "OrderItem",
161
+ "field": "quantity",
162
+ "min": 1
163
+ }
164
+ ],
165
+ "boundaryChecks": [
166
+ {
167
+ "entity": "Product",
168
+ "field": "price",
169
+ "values": [
170
+ -1,
171
+ 0,
172
+ 999.99
173
+ ]
174
+ },
175
+ {
176
+ "entity": "OrderItem",
177
+ "field": "quantity",
178
+ "values": [
179
+ 0,
180
+ 1,
181
+ 100
182
+ ]
183
+ }
184
+ ]
185
+ }
@@ -0,0 +1,116 @@
1
+ {
2
+ "schemaVersion": 1,
3
+ "init": "NEW",
4
+ "states": [
5
+ {
6
+ "id": "NEW"
7
+ },
8
+ {
9
+ "id": "PAID"
10
+ },
11
+ {
12
+ "id": "VERIFY"
13
+ },
14
+ {
15
+ "id": "SHIPPED"
16
+ },
17
+ {
18
+ "id": "DONE",
19
+ "terminal": true
20
+ },
21
+ {
22
+ "id": "CANCELLED",
23
+ "terminal": true
24
+ }
25
+ ],
26
+ "transitions": [
27
+ {
28
+ "from": "NEW",
29
+ "event": "pay",
30
+ "to": "PAID"
31
+ },
32
+ {
33
+ "from": "PAID",
34
+ "event": "verify",
35
+ "to": "VERIFY"
36
+ },
37
+ {
38
+ "from": "VERIFY",
39
+ "event": "ship",
40
+ "to": "SHIPPED"
41
+ },
42
+ {
43
+ "from": "SHIPPED",
44
+ "event": "deliver",
45
+ "to": "DONE"
46
+ },
47
+ {
48
+ "from": "NEW",
49
+ "event": "cancel",
50
+ "to": "CANCELLED"
51
+ },
52
+ {
53
+ "from": "PAID",
54
+ "event": "cancel",
55
+ "to": "CANCELLED"
56
+ }
57
+ ],
58
+ "invariants": [
59
+ {
60
+ "id": "pay-before-shipped",
61
+ "description": "pay must precede SHIPPED",
62
+ "kind": "event-before-state",
63
+ "event": "pay",
64
+ "state": "SHIPPED"
65
+ }
66
+ ],
67
+ "narrative": {
68
+ "states": {
69
+ "NEW": "订单已创建,等待支付",
70
+ "PAID": "已支付,等待风控核验",
71
+ "VERIFY": "风控核验中,等待通过后发货",
72
+ "SHIPPED": "已发货,等待签收",
73
+ "DONE": "已完成(终态)",
74
+ "CANCELLED": "已取消(终态)"
75
+ },
76
+ "events": {
77
+ "pay": "买家完成支付",
78
+ "verify": "风控核验通过",
79
+ "ship": "仓库发货",
80
+ "deliver": "买家签收",
81
+ "cancel": "取消订单"
82
+ },
83
+ "scenarios": [
84
+ {
85
+ "from": "NEW",
86
+ "event": "pay",
87
+ "scenario": "下单后支付成功,订单进入待核验"
88
+ },
89
+ {
90
+ "from": "PAID",
91
+ "event": "verify",
92
+ "scenario": "风控核验通过,可以发货"
93
+ },
94
+ {
95
+ "from": "VERIFY",
96
+ "event": "ship",
97
+ "scenario": "核验通过后发货,进入运输中"
98
+ },
99
+ {
100
+ "from": "SHIPPED",
101
+ "event": "deliver",
102
+ "scenario": "签收完成,订单结束"
103
+ },
104
+ {
105
+ "from": "NEW",
106
+ "event": "cancel",
107
+ "scenario": "未支付订单被取消"
108
+ },
109
+ {
110
+ "from": "PAID",
111
+ "event": "cancel",
112
+ "scenario": "已支付订单取消并退款"
113
+ }
114
+ ]
115
+ }
116
+ }
@@ -0,0 +1,101 @@
1
+ {
2
+ "schemaVersion": 1,
3
+ "init": "NEW",
4
+ "states": [
5
+ {
6
+ "id": "NEW"
7
+ },
8
+ {
9
+ "id": "PAID"
10
+ },
11
+ {
12
+ "id": "SHIPPED"
13
+ },
14
+ {
15
+ "id": "DONE",
16
+ "terminal": true
17
+ },
18
+ {
19
+ "id": "CANCELLED",
20
+ "terminal": true
21
+ }
22
+ ],
23
+ "transitions": [
24
+ {
25
+ "from": "NEW",
26
+ "event": "pay",
27
+ "to": "PAID"
28
+ },
29
+ {
30
+ "from": "PAID",
31
+ "event": "ship",
32
+ "to": "SHIPPED"
33
+ },
34
+ {
35
+ "from": "SHIPPED",
36
+ "event": "deliver",
37
+ "to": "DONE"
38
+ },
39
+ {
40
+ "from": "NEW",
41
+ "event": "cancel",
42
+ "to": "CANCELLED"
43
+ },
44
+ {
45
+ "from": "PAID",
46
+ "event": "cancel",
47
+ "to": "CANCELLED"
48
+ }
49
+ ],
50
+ "invariants": [
51
+ {
52
+ "id": "pay-before-shipped",
53
+ "description": "pay must precede SHIPPED",
54
+ "kind": "event-before-state",
55
+ "event": "pay",
56
+ "state": "SHIPPED"
57
+ }
58
+ ],
59
+ "narrative": {
60
+ "states": {
61
+ "NEW": "订单已创建,等待支付",
62
+ "PAID": "已支付,等待发货",
63
+ "SHIPPED": "已发货,等待签收",
64
+ "DONE": "已完成(终态)",
65
+ "CANCELLED": "已取消(终态)"
66
+ },
67
+ "events": {
68
+ "pay": "买家完成支付",
69
+ "ship": "仓库发货",
70
+ "deliver": "买家签收",
71
+ "cancel": "取消订单"
72
+ },
73
+ "scenarios": [
74
+ {
75
+ "from": "NEW",
76
+ "event": "pay",
77
+ "scenario": "下单后支付成功,订单进入待发货"
78
+ },
79
+ {
80
+ "from": "PAID",
81
+ "event": "ship",
82
+ "scenario": "已支付订单发货,进入运输中"
83
+ },
84
+ {
85
+ "from": "SHIPPED",
86
+ "event": "deliver",
87
+ "scenario": "签收完成,订单结束"
88
+ },
89
+ {
90
+ "from": "NEW",
91
+ "event": "cancel",
92
+ "scenario": "未支付订单被取消"
93
+ },
94
+ {
95
+ "from": "PAID",
96
+ "event": "cancel",
97
+ "scenario": "已支付订单取消并退款"
98
+ }
99
+ ]
100
+ }
101
+ }
@@ -0,0 +1,29 @@
1
+ {
2
+ "schemaVersion": 1,
3
+ "entities": [
4
+ {
5
+ "name": "User",
6
+ "fields": [
7
+ {
8
+ "name": "id",
9
+ "type": "uuid",
10
+ "required": true
11
+ },
12
+ {
13
+ "name": "fullName",
14
+ "type": "string",
15
+ "required": true
16
+ },
17
+ {
18
+ "name": "email",
19
+ "type": "string",
20
+ "required": true,
21
+ "unique": true
22
+ }
23
+ ],
24
+ "primaryKey": [
25
+ "id"
26
+ ]
27
+ }
28
+ ]
29
+ }
@@ -0,0 +1,29 @@
1
+ {
2
+ "schemaVersion": 1,
3
+ "entities": [
4
+ {
5
+ "name": "User",
6
+ "fields": [
7
+ {
8
+ "name": "id",
9
+ "type": "uuid",
10
+ "required": true
11
+ },
12
+ {
13
+ "name": "name",
14
+ "type": "string",
15
+ "required": true
16
+ },
17
+ {
18
+ "name": "email",
19
+ "type": "string",
20
+ "required": true,
21
+ "unique": true
22
+ }
23
+ ],
24
+ "primaryKey": [
25
+ "id"
26
+ ]
27
+ }
28
+ ]
29
+ }
@@ -0,0 +1,6 @@
1
+ {
2
+ "meta": {
3
+ "title": "Injected routing prompt",
4
+ "description": "Injects a routing message into the first model step of a session: which skill to load, what each tool does and what it does not prove, and how to read a report. On by default; the Plugins page switches it off."
5
+ }
6
+ }
@@ -0,0 +1,6 @@
1
+ {
2
+ "meta": {
3
+ "title": "提示词注入增强",
4
+ "description": "在会话的第一条模型步注入一条路由提示:先加载哪个技能、每个工具做什么以及它不证明什么、怎么读一份报告。默认开,可在插件页关掉。"
5
+ }
6
+ }
@@ -0,0 +1,5 @@
1
+ {
2
+ "name": "Injected routing prompt",
3
+ "description": "Injects a routing message into the first model step of a session: which skill to load, what each tool does and what it does not prove, and how to read a report. On by default.",
4
+ "type": "module"
5
+ }