@allbluecn/shared 0.3.13 → 0.4.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.
- package/dist/config-CcbSbJoC.js +6344 -0
- package/dist/constants/perf.d.ts +6 -0
- package/dist/constants/perf.js +6 -0
- package/dist/constants-C3hGP_ru.d.ts +33 -0
- package/dist/i18n/client.d.ts +5 -0
- package/dist/i18n/client.js +34 -0
- package/dist/i18n/config.d.ts +6270 -0
- package/dist/i18n/config.js +2 -0
- package/dist/i18n/detect.d.ts +5 -0
- package/dist/i18n/detect.js +35 -0
- package/dist/i18n/server.d.ts +6 -0
- package/dist/i18n/server.js +19 -0
- package/dist/i18n/types.d.ts +3 -0
- package/dist/i18n/types.js +0 -0
- package/dist/index.d.ts +18 -0
- package/dist/index.js +14 -0
- package/dist/infrastructure/ai/adapter.d.ts +8 -0
- package/dist/infrastructure/ai/adapter.js +32 -0
- package/dist/infrastructure/ai/cli-detector.d.ts +6 -0
- package/dist/infrastructure/ai/cli-detector.js +121 -0
- package/dist/infrastructure/ip-location.d.ts +9 -0
- package/dist/infrastructure/ip-location.js +48 -0
- package/dist/infrastructure/references/engine.d.ts +7 -0
- package/dist/infrastructure/references/engine.js +64 -0
- package/dist/infrastructure/ua-parser.d.ts +20 -0
- package/dist/infrastructure/ua-parser.js +69 -0
- package/dist/interfaces/ai.d.ts +27 -0
- package/dist/interfaces/ai.js +0 -0
- package/dist/interfaces/avatar.d.ts +6 -0
- package/dist/interfaces/avatar.js +0 -0
- package/dist/interfaces/module.d.ts +45 -0
- package/dist/interfaces/module.js +0 -0
- package/dist/interfaces/references.d.ts +27 -0
- package/dist/interfaces/references.js +0 -0
- package/dist/interfaces/transport.d.ts +11 -0
- package/dist/interfaces/transport.js +0 -0
- package/dist/lib/annotation-template.d.ts +9 -0
- package/dist/lib/annotation-template.js +14 -0
- package/dist/lib/comment-utils.d.ts +7 -0
- package/dist/lib/comment-utils.js +27 -0
- package/dist/lib/datetime.d.ts +25 -0
- package/dist/lib/datetime.js +73 -0
- package/dist/lib/desktop-detect.d.ts +13 -0
- package/dist/lib/desktop-detect.js +23 -0
- package/dist/lib/outline-utils.d.ts +6 -0
- package/dist/lib/outline-utils.js +46 -0
- package/dist/lib/pacer.d.ts +45 -0
- package/dist/lib/pacer.js +70 -0
- package/dist/lib/prd/stack-layout.d.ts +18 -0
- package/dist/lib/prd/stack-layout.js +24 -0
- package/dist/lib/prd-tree-utils.d.ts +21 -0
- package/dist/lib/prd-tree-utils.js +62 -0
- package/dist/lib/prototype-registry.d.ts +2 -0
- package/dist/lib/prototype-registry.js +2 -0
- package/dist/lib/query-client-seam.d.ts +6 -0
- package/dist/lib/query-client-seam.js +11 -0
- package/dist/lib/share-events.d.ts +7 -0
- package/dist/lib/share-events.js +47 -0
- package/dist/lib/sidebar-utils.d.ts +4 -0
- package/dist/lib/sidebar-utils.js +7 -0
- package/dist/lib/stores/prd-canvas-store.d.ts +16 -0
- package/dist/lib/stores/prd-canvas-store.js +42 -0
- package/dist/lib/tag-colors.d.ts +12 -0
- package/dist/lib/tag-colors.js +74 -0
- package/dist/lib/time-format.d.ts +4 -0
- package/dist/lib/time-format.js +20 -0
- package/dist/modules/ai-providers/constants.d.ts +2 -0
- package/dist/modules/ai-providers/constants.js +125 -0
- package/dist/modules/ai-providers/index.d.ts +4 -0
- package/dist/modules/ai-providers/index.js +4 -0
- package/dist/modules/ai-providers/seed-data.d.ts +2 -0
- package/dist/modules/ai-providers/seed-data.js +408 -0
- package/dist/modules/ai-providers/types.d.ts +2 -0
- package/dist/modules/ai-providers/types.js +10 -0
- package/dist/modules/billing/feature-registry.d.ts +72 -0
- package/dist/modules/billing/feature-registry.js +67 -0
- package/dist/modules/billing/plan-features-schema.d.ts +6 -0
- package/dist/modules/billing/plan-features-schema.js +6 -0
- package/dist/modules/billing/resource-registry.d.ts +59 -0
- package/dist/modules/billing/resource-registry.js +47 -0
- package/dist/modules/definitions/plugin.module.d.ts +5 -0
- package/dist/modules/definitions/plugin.module.js +24 -0
- package/dist/modules/definitions/prd.module.d.ts +5 -0
- package/dist/modules/definitions/prd.module.js +26 -0
- package/dist/modules/definitions/prototype.module.d.ts +5 -0
- package/dist/modules/definitions/prototype.module.js +20 -0
- package/dist/modules/dependencies/index.d.ts +92 -0
- package/dist/modules/dependencies/index.js +334 -0
- package/dist/modules/register-defaults.d.ts +4 -0
- package/dist/modules/register-defaults.js +12 -0
- package/dist/modules/registry.d.ts +17 -0
- package/dist/modules/registry.js +27 -0
- package/dist/seed-data-BK0cl93n.d.ts +6 -0
- package/dist/server-seam.d.ts +19 -0
- package/dist/server-seam.js +11 -0
- package/dist/types/outline.d.ts +10 -0
- package/dist/types/outline.js +0 -0
- package/dist/types/prd.d.ts +48 -0
- package/dist/types/prd.js +37 -0
- package/dist/types/prototype.d.ts +2 -0
- package/dist/types/prototype.js +2 -0
- package/dist/types-dopOMFRC.d.ts +61 -0
- package/dist/virtual.d.ts +1 -0
- package/package.json +133 -37
- package/src/constants/perf.ts +0 -21
- package/src/i18n/client.ts +0 -32
- package/src/i18n/config.ts +0 -104
- package/src/i18n/detect.ts +0 -43
- package/src/i18n/locales/en/agents.json +0 -134
- package/src/i18n/locales/en/apps.json +0 -6
- package/src/i18n/locales/en/auth.json +0 -88
- package/src/i18n/locales/en/billing.json +0 -78
- package/src/i18n/locales/en/chat.json +0 -194
- package/src/i18n/locales/en/common.json +0 -203
- package/src/i18n/locales/en/dashboard.json +0 -38
- package/src/i18n/locales/en/design.json +0 -70
- package/src/i18n/locales/en/desktop.json +0 -35
- package/src/i18n/locales/en/display.json +0 -37
- package/src/i18n/locales/en/editor.json +0 -304
- package/src/i18n/locales/en/enterprise.json +0 -1
- package/src/i18n/locales/en/invite.json +0 -11
- package/src/i18n/locales/en/knowledge.json +0 -451
- package/src/i18n/locales/en/mindmap.json +0 -28
- package/src/i18n/locales/en/prd.json +0 -43
- package/src/i18n/locales/en/projects.json +0 -133
- package/src/i18n/locales/en/settings.json +0 -375
- package/src/i18n/locales/en/share.json +0 -20
- package/src/i18n/locales/en/story.json +0 -785
- package/src/i18n/locales/en/tags.json +0 -42
- package/src/i18n/locales/en/workspace.json +0 -90
- package/src/i18n/locales/zh/agents.json +0 -134
- package/src/i18n/locales/zh/apps.json +0 -6
- package/src/i18n/locales/zh/auth.json +0 -88
- package/src/i18n/locales/zh/billing.json +0 -78
- package/src/i18n/locales/zh/chat.json +0 -194
- package/src/i18n/locales/zh/common.json +0 -203
- package/src/i18n/locales/zh/dashboard.json +0 -38
- package/src/i18n/locales/zh/design.json +0 -70
- package/src/i18n/locales/zh/desktop.json +0 -35
- package/src/i18n/locales/zh/display.json +0 -37
- package/src/i18n/locales/zh/editor.json +0 -304
- package/src/i18n/locales/zh/enterprise.json +0 -1
- package/src/i18n/locales/zh/invite.json +0 -11
- package/src/i18n/locales/zh/knowledge.json +0 -451
- package/src/i18n/locales/zh/mindmap.json +0 -28
- package/src/i18n/locales/zh/prd.json +0 -43
- package/src/i18n/locales/zh/projects.json +0 -133
- package/src/i18n/locales/zh/settings.json +0 -375
- package/src/i18n/locales/zh/share.json +0 -20
- package/src/i18n/locales/zh/story.json +0 -785
- package/src/i18n/locales/zh/tags.json +0 -42
- package/src/i18n/locales/zh/workspace.json +0 -90
- package/src/i18n/server.ts +0 -18
- package/src/i18n/types.ts +0 -5
- package/src/index.ts +0 -90
- package/src/infrastructure/ai/adapter.ts +0 -59
- package/src/infrastructure/ai/cli-detector.ts +0 -64
- package/src/infrastructure/ip-location.ts +0 -76
- package/src/infrastructure/references/engine.ts +0 -104
- package/src/infrastructure/ua-parser.ts +0 -107
- package/src/interfaces/ai.ts +0 -38
- package/src/interfaces/avatar.ts +0 -22
- package/src/interfaces/module.ts +0 -60
- package/src/interfaces/references.ts +0 -44
- package/src/interfaces/transport.ts +0 -26
- package/src/lib/annotation-template.ts +0 -33
- package/src/lib/comment-utils.ts +0 -47
- package/src/lib/datetime.ts +0 -115
- package/src/lib/desktop-detect.ts +0 -27
- package/src/lib/outline-utils.ts +0 -57
- package/src/lib/pacer.ts +0 -96
- package/src/lib/prd/stack-layout.ts +0 -53
- package/src/lib/prd-tree-utils.ts +0 -94
- package/src/lib/prototype-registry.ts +0 -24
- package/src/lib/query-client-seam.ts +0 -14
- package/src/lib/share-events.ts +0 -78
- package/src/lib/sidebar-utils.ts +0 -21
- package/src/lib/stores/prd-canvas-store.ts +0 -69
- package/src/lib/tag-colors.ts +0 -35
- package/src/lib/time-format.ts +0 -50
- package/src/modules/ai-providers/constants.ts +0 -79
- package/src/modules/ai-providers/index.ts +0 -21
- package/src/modules/ai-providers/seed-data.ts +0 -222
- package/src/modules/ai-providers/types.ts +0 -95
- package/src/modules/billing/feature-registry.ts +0 -63
- package/src/modules/billing/plan-features-schema.ts +0 -11
- package/src/modules/billing/resource-registry.ts +0 -80
- package/src/modules/definitions/plugin.module.ts +0 -38
- package/src/modules/definitions/prd.module.ts +0 -45
- package/src/modules/definitions/prototype.module.ts +0 -38
- package/src/modules/dependencies/index.ts +0 -186
- package/src/modules/register-defaults.ts +0 -27
- package/src/modules/registry.ts +0 -53
- package/src/server-seam.ts +0 -51
- package/src/types/outline.ts +0 -26
- package/src/types/prd.ts +0 -90
- package/src/types/prototype.ts +0 -12
- package/src/virtual.d.ts +0 -4
|
@@ -0,0 +1,334 @@
|
|
|
1
|
+
//#region src/modules/dependencies/index.ts
|
|
2
|
+
/** 依赖分类元信息 */
|
|
3
|
+
const DEPENDENCY_CATEGORIES = [
|
|
4
|
+
{
|
|
5
|
+
value: "framework",
|
|
6
|
+
label: "框架核心",
|
|
7
|
+
description: "TanStack Start / React / Vite / Prisma 等基础设施"
|
|
8
|
+
},
|
|
9
|
+
{
|
|
10
|
+
value: "ui",
|
|
11
|
+
label: "UI 组件",
|
|
12
|
+
description: "radix / motion / lucide / tailwind 等界面库"
|
|
13
|
+
},
|
|
14
|
+
{
|
|
15
|
+
value: "editor",
|
|
16
|
+
label: "编辑器",
|
|
17
|
+
description: "TipTap / mind-elixir / lowlight 等富文本/思维导图"
|
|
18
|
+
},
|
|
19
|
+
{
|
|
20
|
+
value: "ai",
|
|
21
|
+
label: "AI 能力",
|
|
22
|
+
description: "@tanstack/ai / openai 等 LLM 集成"
|
|
23
|
+
},
|
|
24
|
+
{
|
|
25
|
+
value: "state",
|
|
26
|
+
label: "状态管理",
|
|
27
|
+
description: "react-query / react-form 等状态/数据层"
|
|
28
|
+
},
|
|
29
|
+
{
|
|
30
|
+
value: "auth",
|
|
31
|
+
label: "认证",
|
|
32
|
+
description: "start-authjs / @auth/core / bcryptjs"
|
|
33
|
+
},
|
|
34
|
+
{
|
|
35
|
+
value: "tool",
|
|
36
|
+
label: "工具库",
|
|
37
|
+
description: "zod / nanoid / i18next 等通用工具"
|
|
38
|
+
},
|
|
39
|
+
{
|
|
40
|
+
value: "other",
|
|
41
|
+
label: "其他",
|
|
42
|
+
description: "未分类依赖"
|
|
43
|
+
}
|
|
44
|
+
];
|
|
45
|
+
const DEPENDENCY_PRIORITIES = [
|
|
46
|
+
{
|
|
47
|
+
value: "high",
|
|
48
|
+
label: "高"
|
|
49
|
+
},
|
|
50
|
+
{
|
|
51
|
+
value: "normal",
|
|
52
|
+
label: "中"
|
|
53
|
+
},
|
|
54
|
+
{
|
|
55
|
+
value: "low",
|
|
56
|
+
label: "低"
|
|
57
|
+
}
|
|
58
|
+
];
|
|
59
|
+
const DEFAULT_WATCHED_DEPENDENCIES = [
|
|
60
|
+
{
|
|
61
|
+
name: "@tanstack/react-start",
|
|
62
|
+
displayName: "TanStack Start",
|
|
63
|
+
description: "全栈 React 框架,文件路由 + SSR/SSG",
|
|
64
|
+
homepage: "https://tanstack.com/start",
|
|
65
|
+
category: "framework",
|
|
66
|
+
priority: "high"
|
|
67
|
+
},
|
|
68
|
+
{
|
|
69
|
+
name: "@tanstack/react-router",
|
|
70
|
+
displayName: "TanStack Router",
|
|
71
|
+
description: "类型安全的路由库,支持文件路由与代码拆分",
|
|
72
|
+
homepage: "https://tanstack.com/router",
|
|
73
|
+
category: "framework",
|
|
74
|
+
priority: "high"
|
|
75
|
+
},
|
|
76
|
+
{
|
|
77
|
+
name: "vite",
|
|
78
|
+
displayName: "Vite",
|
|
79
|
+
description: "下一代前端构建工具,ESM 原生 + 极速 HMR",
|
|
80
|
+
homepage: "https://vite.dev",
|
|
81
|
+
category: "framework",
|
|
82
|
+
priority: "high"
|
|
83
|
+
},
|
|
84
|
+
{
|
|
85
|
+
name: "react",
|
|
86
|
+
displayName: "React",
|
|
87
|
+
description: "声明式 UI 库,组件化开发基础",
|
|
88
|
+
homepage: "https://react.dev",
|
|
89
|
+
category: "framework",
|
|
90
|
+
priority: "high"
|
|
91
|
+
},
|
|
92
|
+
{
|
|
93
|
+
name: "react-dom",
|
|
94
|
+
displayName: "React DOM",
|
|
95
|
+
description: "React 的 DOM 渲染器",
|
|
96
|
+
homepage: "https://react.dev",
|
|
97
|
+
category: "framework",
|
|
98
|
+
priority: "high"
|
|
99
|
+
},
|
|
100
|
+
{
|
|
101
|
+
name: "prisma",
|
|
102
|
+
displayName: "Prisma",
|
|
103
|
+
description: "TypeScript ORM,Schema 优先的数据库工具链",
|
|
104
|
+
homepage: "https://prisma.io",
|
|
105
|
+
category: "framework",
|
|
106
|
+
priority: "high"
|
|
107
|
+
},
|
|
108
|
+
{
|
|
109
|
+
name: "@prisma/client",
|
|
110
|
+
displayName: "Prisma Client",
|
|
111
|
+
description: "Prisma 自动生成的类型安全查询客户端",
|
|
112
|
+
homepage: "https://prisma.io",
|
|
113
|
+
category: "framework",
|
|
114
|
+
priority: "high"
|
|
115
|
+
},
|
|
116
|
+
{
|
|
117
|
+
name: "start-authjs",
|
|
118
|
+
displayName: "start-authjs",
|
|
119
|
+
description: "TanStack Start 的 Auth.js 集成,提供登录态管理",
|
|
120
|
+
homepage: "https://github.com/kophzeior/start-authjs",
|
|
121
|
+
category: "auth",
|
|
122
|
+
priority: "high"
|
|
123
|
+
},
|
|
124
|
+
{
|
|
125
|
+
name: "@auth/core",
|
|
126
|
+
displayName: "Auth.js Core",
|
|
127
|
+
description: "Auth.js 核心,支持 Credentials/OAuth 等多种登录方式",
|
|
128
|
+
homepage: "https://authjs.dev",
|
|
129
|
+
category: "auth",
|
|
130
|
+
priority: "normal"
|
|
131
|
+
},
|
|
132
|
+
{
|
|
133
|
+
name: "@tiptap/core",
|
|
134
|
+
displayName: "TipTap Core",
|
|
135
|
+
description: "无头(headless)富文本编辑器核心,可扩展",
|
|
136
|
+
homepage: "https://tiptap.dev",
|
|
137
|
+
category: "editor",
|
|
138
|
+
priority: "high"
|
|
139
|
+
},
|
|
140
|
+
{
|
|
141
|
+
name: "@tiptap/react",
|
|
142
|
+
displayName: "TipTap React",
|
|
143
|
+
description: "TipTap 编辑器的 React 绑定",
|
|
144
|
+
homepage: "https://tiptap.dev",
|
|
145
|
+
category: "editor",
|
|
146
|
+
priority: "high"
|
|
147
|
+
},
|
|
148
|
+
{
|
|
149
|
+
name: "@tiptap/starter-kit",
|
|
150
|
+
displayName: "TipTap Starter Kit",
|
|
151
|
+
description: "TipTap 预置扩展集合(段落/列表/历史等)",
|
|
152
|
+
homepage: "https://tiptap.dev",
|
|
153
|
+
category: "editor",
|
|
154
|
+
priority: "normal"
|
|
155
|
+
},
|
|
156
|
+
{
|
|
157
|
+
name: "mind-elixir",
|
|
158
|
+
displayName: "Mind Elixir",
|
|
159
|
+
description: "轻量思维导图库,支持节点编辑与导出",
|
|
160
|
+
homepage: "https://github.com/ssshooter/mind-elixir",
|
|
161
|
+
category: "editor",
|
|
162
|
+
priority: "high"
|
|
163
|
+
},
|
|
164
|
+
{
|
|
165
|
+
name: "lowlight",
|
|
166
|
+
displayName: "Lowlight",
|
|
167
|
+
description: "基于 highlight.js 的语法高亮解析器",
|
|
168
|
+
homepage: "https://github.com/wooorm/lowlight",
|
|
169
|
+
category: "editor",
|
|
170
|
+
priority: "normal"
|
|
171
|
+
},
|
|
172
|
+
{
|
|
173
|
+
name: "@tanstack/ai",
|
|
174
|
+
displayName: "TanStack AI",
|
|
175
|
+
description: "类型安全的 LLM SDK,支持流式输出与工具调用",
|
|
176
|
+
homepage: "https://tanstack.com/ai",
|
|
177
|
+
category: "ai",
|
|
178
|
+
priority: "high"
|
|
179
|
+
},
|
|
180
|
+
{
|
|
181
|
+
name: "@tanstack/ai-react",
|
|
182
|
+
displayName: "TanStack AI React",
|
|
183
|
+
description: "TanStack AI 的 React hooks(useChat 等)",
|
|
184
|
+
homepage: "https://tanstack.com/ai",
|
|
185
|
+
category: "ai",
|
|
186
|
+
priority: "normal"
|
|
187
|
+
},
|
|
188
|
+
{
|
|
189
|
+
name: "@tanstack/ai-openai",
|
|
190
|
+
displayName: "TanStack AI OpenAI Adapter",
|
|
191
|
+
description: "TanStack AI 的 OpenAI 官方模型适配器",
|
|
192
|
+
homepage: "https://tanstack.com/ai",
|
|
193
|
+
category: "ai",
|
|
194
|
+
priority: "normal"
|
|
195
|
+
},
|
|
196
|
+
{
|
|
197
|
+
name: "@tanstack/ai-anthropic",
|
|
198
|
+
displayName: "TanStack AI Anthropic Adapter",
|
|
199
|
+
description: "TanStack AI 的 Anthropic Claude 适配器",
|
|
200
|
+
homepage: "https://tanstack.com/ai",
|
|
201
|
+
category: "ai",
|
|
202
|
+
priority: "normal"
|
|
203
|
+
},
|
|
204
|
+
{
|
|
205
|
+
name: "@tanstack/ai-openrouter",
|
|
206
|
+
displayName: "TanStack AI OpenRouter Adapter",
|
|
207
|
+
description: "OpenRouter 多模型聚合适配器",
|
|
208
|
+
homepage: "https://tanstack.com/ai",
|
|
209
|
+
category: "ai",
|
|
210
|
+
priority: "normal"
|
|
211
|
+
},
|
|
212
|
+
{
|
|
213
|
+
name: "openai",
|
|
214
|
+
displayName: "OpenAI SDK",
|
|
215
|
+
description: "OpenAI 官方 SDK,本项目用于 embedding 生成",
|
|
216
|
+
homepage: "https://openai.com",
|
|
217
|
+
category: "ai",
|
|
218
|
+
priority: "normal"
|
|
219
|
+
},
|
|
220
|
+
{
|
|
221
|
+
name: "radix-ui",
|
|
222
|
+
displayName: "Radix UI",
|
|
223
|
+
description: "无样式可访问组件库统一入口(dialog/menu 等)",
|
|
224
|
+
homepage: "https://radix-ui.com",
|
|
225
|
+
category: "ui",
|
|
226
|
+
priority: "high"
|
|
227
|
+
},
|
|
228
|
+
{
|
|
229
|
+
name: "motion",
|
|
230
|
+
displayName: "Motion",
|
|
231
|
+
description: "React 动画库(原 framer-motion),声明式动画",
|
|
232
|
+
homepage: "https://motion.dev",
|
|
233
|
+
category: "ui",
|
|
234
|
+
priority: "normal"
|
|
235
|
+
},
|
|
236
|
+
{
|
|
237
|
+
name: "lucide-react",
|
|
238
|
+
displayName: "Lucide React",
|
|
239
|
+
description: "Lucide 图标库的 React 版本",
|
|
240
|
+
homepage: "https://lucide.dev",
|
|
241
|
+
category: "ui",
|
|
242
|
+
priority: "normal"
|
|
243
|
+
},
|
|
244
|
+
{
|
|
245
|
+
name: "next-themes",
|
|
246
|
+
displayName: "Next Themes",
|
|
247
|
+
description: "主题切换库,支持暗黑模式持久化",
|
|
248
|
+
homepage: "https://github.com/pacocoursey/next-themes",
|
|
249
|
+
category: "ui",
|
|
250
|
+
priority: "normal"
|
|
251
|
+
},
|
|
252
|
+
{
|
|
253
|
+
name: "tailwindcss",
|
|
254
|
+
displayName: "Tailwind CSS",
|
|
255
|
+
description: "原子化 CSS 框架,工具类优先",
|
|
256
|
+
homepage: "https://tailwindcss.com",
|
|
257
|
+
category: "ui",
|
|
258
|
+
priority: "high"
|
|
259
|
+
},
|
|
260
|
+
{
|
|
261
|
+
name: "shadcn",
|
|
262
|
+
displayName: "shadcn",
|
|
263
|
+
description: "可复制粘贴的组件集合 CLI,项目 UI 组件来源",
|
|
264
|
+
homepage: "https://ui.shadcn.com",
|
|
265
|
+
category: "ui",
|
|
266
|
+
priority: "normal"
|
|
267
|
+
},
|
|
268
|
+
{
|
|
269
|
+
name: "sonner",
|
|
270
|
+
displayName: "Sonner",
|
|
271
|
+
description: "Toast 通知组件,项目消息提示",
|
|
272
|
+
homepage: "https://sonner.emilkowal.ski",
|
|
273
|
+
category: "ui",
|
|
274
|
+
priority: "normal"
|
|
275
|
+
},
|
|
276
|
+
{
|
|
277
|
+
name: "@tanstack/react-query",
|
|
278
|
+
displayName: "TanStack Query",
|
|
279
|
+
description: "服务端状态管理与缓存,数据获取利器",
|
|
280
|
+
homepage: "https://tanstack.com/query",
|
|
281
|
+
category: "state",
|
|
282
|
+
priority: "high"
|
|
283
|
+
},
|
|
284
|
+
{
|
|
285
|
+
name: "@tanstack/react-form",
|
|
286
|
+
displayName: "TanStack Form",
|
|
287
|
+
description: "类型安全的表单管理库",
|
|
288
|
+
homepage: "https://tanstack.com/form",
|
|
289
|
+
category: "state",
|
|
290
|
+
priority: "normal"
|
|
291
|
+
},
|
|
292
|
+
{
|
|
293
|
+
name: "zod",
|
|
294
|
+
displayName: "Zod",
|
|
295
|
+
description: "TypeScript 优先的 Schema 校验库",
|
|
296
|
+
homepage: "https://zod.dev",
|
|
297
|
+
category: "tool",
|
|
298
|
+
priority: "high"
|
|
299
|
+
},
|
|
300
|
+
{
|
|
301
|
+
name: "i18next",
|
|
302
|
+
displayName: "i18next",
|
|
303
|
+
description: "国际化框架,多语言文案管理",
|
|
304
|
+
homepage: "https://www.i18next.com",
|
|
305
|
+
category: "tool",
|
|
306
|
+
priority: "normal"
|
|
307
|
+
},
|
|
308
|
+
{
|
|
309
|
+
name: "react-i18next",
|
|
310
|
+
displayName: "React i18next",
|
|
311
|
+
description: "i18next 的 React 绑定",
|
|
312
|
+
homepage: "https://react.i18next.com",
|
|
313
|
+
category: "tool",
|
|
314
|
+
priority: "normal"
|
|
315
|
+
},
|
|
316
|
+
{
|
|
317
|
+
name: "nanoid",
|
|
318
|
+
displayName: "Nano ID",
|
|
319
|
+
description: "轻量 URL 友好的唯一 ID 生成器",
|
|
320
|
+
homepage: "https://github.com/ai/nanoid",
|
|
321
|
+
category: "tool",
|
|
322
|
+
priority: "low"
|
|
323
|
+
},
|
|
324
|
+
{
|
|
325
|
+
name: "bcryptjs",
|
|
326
|
+
displayName: "bcryptjs",
|
|
327
|
+
description: "密码哈希库,纯 JS 实现",
|
|
328
|
+
homepage: "https://github.com/dcodeIO/bcrypt.js",
|
|
329
|
+
category: "auth",
|
|
330
|
+
priority: "normal"
|
|
331
|
+
}
|
|
332
|
+
];
|
|
333
|
+
//#endregion
|
|
334
|
+
export { DEFAULT_WATCHED_DEPENDENCIES, DEPENDENCY_CATEGORIES, DEPENDENCY_PRIORITIES };
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { moduleRegistry } from "./registry.js";
|
|
2
|
+
import { prdModule } from "./definitions/prd.module.js";
|
|
3
|
+
import { prototypeModule } from "./definitions/prototype.module.js";
|
|
4
|
+
import { pluginModule } from "./definitions/plugin.module.js";
|
|
5
|
+
//#region src/modules/register-defaults.ts
|
|
6
|
+
function registerDefaultModules() {
|
|
7
|
+
moduleRegistry.register(prdModule);
|
|
8
|
+
moduleRegistry.register(prototypeModule);
|
|
9
|
+
moduleRegistry.register(pluginModule);
|
|
10
|
+
}
|
|
11
|
+
//#endregion
|
|
12
|
+
export { registerDefaultModules };
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { AICommandDef, AllBlueModule } from "../interfaces/module.js";
|
|
2
|
+
//#region src/modules/registry.d.ts
|
|
3
|
+
declare class ModuleRegistry {
|
|
4
|
+
private modules;
|
|
5
|
+
register(mod: AllBlueModule): void;
|
|
6
|
+
getModule(id: string): AllBlueModule | undefined;
|
|
7
|
+
getAll(): AllBlueModule[];
|
|
8
|
+
getAICommands(): AICommandDef[];
|
|
9
|
+
getSearchFields(): {
|
|
10
|
+
module: string;
|
|
11
|
+
type: string;
|
|
12
|
+
fields: string[];
|
|
13
|
+
}[];
|
|
14
|
+
}
|
|
15
|
+
declare const moduleRegistry: ModuleRegistry;
|
|
16
|
+
//#endregion
|
|
17
|
+
export { moduleRegistry };
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
//#region src/modules/registry.ts
|
|
2
|
+
var ModuleRegistry = class {
|
|
3
|
+
modules = /* @__PURE__ */ new Map();
|
|
4
|
+
register(mod) {
|
|
5
|
+
if (this.modules.has(mod.id)) console.warn(`[ModuleRegistry] "${mod.id}" already registered, overwriting`);
|
|
6
|
+
this.modules.set(mod.id, mod);
|
|
7
|
+
}
|
|
8
|
+
getModule(id) {
|
|
9
|
+
return this.modules.get(id);
|
|
10
|
+
}
|
|
11
|
+
getAll() {
|
|
12
|
+
return [...this.modules.values()];
|
|
13
|
+
}
|
|
14
|
+
getAICommands() {
|
|
15
|
+
return [...this.modules.values()].flatMap((m) => m.aiCommands);
|
|
16
|
+
}
|
|
17
|
+
getSearchFields() {
|
|
18
|
+
return [...this.modules.values()].flatMap((m) => m.entities.map((e) => ({
|
|
19
|
+
module: m.id,
|
|
20
|
+
type: e.type,
|
|
21
|
+
fields: e.searchFields
|
|
22
|
+
})));
|
|
23
|
+
}
|
|
24
|
+
};
|
|
25
|
+
const moduleRegistry = new ModuleRegistry();
|
|
26
|
+
//#endregion
|
|
27
|
+
export { moduleRegistry };
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
//#region src/server-seam.d.ts
|
|
2
|
+
/**
|
|
3
|
+
* PrismaSeam — 注入式 prisma 接入点
|
|
4
|
+
*
|
|
5
|
+
* 解决 shared → database (prisma) → shared 的循环依赖:
|
|
6
|
+
* shared 包声明 seam 接口,database 包启动时注册实现。
|
|
7
|
+
* 复用 kernel 的 ServerSeam 注入模式。
|
|
8
|
+
*/
|
|
9
|
+
interface PrismaSeam {
|
|
10
|
+
reference: {
|
|
11
|
+
create: (data: unknown) => Promise<unknown>;
|
|
12
|
+
findMany: (where: unknown) => Promise<unknown[]>;
|
|
13
|
+
};
|
|
14
|
+
$queryRawUnsafe: <T = Record<string, unknown>>(sql: string, ...params: unknown[]) => Promise<T[]>;
|
|
15
|
+
}
|
|
16
|
+
declare function registerPrismaSeam(seam: PrismaSeam): void;
|
|
17
|
+
declare function getPrismaSeam(): PrismaSeam;
|
|
18
|
+
//#endregion
|
|
19
|
+
export { PrismaSeam, getPrismaSeam, registerPrismaSeam };
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
//#region src/server-seam.ts
|
|
2
|
+
let _seam = null;
|
|
3
|
+
function registerPrismaSeam(seam) {
|
|
4
|
+
_seam = seam;
|
|
5
|
+
}
|
|
6
|
+
function getPrismaSeam() {
|
|
7
|
+
if (!_seam) throw new Error("[@allbluecn/shared] PrismaSeam not registered. Call registerPrismaSeam(prisma) before using reference engine.");
|
|
8
|
+
return _seam;
|
|
9
|
+
}
|
|
10
|
+
//#endregion
|
|
11
|
+
export { getPrismaSeam, registerPrismaSeam };
|
|
File without changes
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
//#region src/types/prd.d.ts
|
|
2
|
+
interface PRD {
|
|
3
|
+
id: string;
|
|
4
|
+
name: string;
|
|
5
|
+
icon: string;
|
|
6
|
+
description?: string | null;
|
|
7
|
+
prdTags?: {
|
|
8
|
+
tag: {
|
|
9
|
+
id: string;
|
|
10
|
+
name: string;
|
|
11
|
+
color: number;
|
|
12
|
+
};
|
|
13
|
+
}[];
|
|
14
|
+
}
|
|
15
|
+
interface PRDDetail extends PRD {
|
|
16
|
+
createdAt: Date;
|
|
17
|
+
updatedAt: Date;
|
|
18
|
+
}
|
|
19
|
+
interface PRDVersionBase {
|
|
20
|
+
id: string;
|
|
21
|
+
versionLabel: string;
|
|
22
|
+
notes: string | null;
|
|
23
|
+
createdAt: string;
|
|
24
|
+
updatedAt?: string | null;
|
|
25
|
+
}
|
|
26
|
+
interface PRDVersionWithPages extends PRDVersionBase {
|
|
27
|
+
pageVersions: {
|
|
28
|
+
pageId: string;
|
|
29
|
+
pageName: string;
|
|
30
|
+
type?: "folder" | "page";
|
|
31
|
+
parentId?: string | null;
|
|
32
|
+
version: number;
|
|
33
|
+
pageVersionId?: string | null;
|
|
34
|
+
canvas?: any;
|
|
35
|
+
content?: any;
|
|
36
|
+
isPlaceholder?: boolean;
|
|
37
|
+
}[];
|
|
38
|
+
}
|
|
39
|
+
interface PRDVersionWithSemver extends PRDVersionBase {
|
|
40
|
+
major: number;
|
|
41
|
+
minor: number;
|
|
42
|
+
patch: number;
|
|
43
|
+
}
|
|
44
|
+
declare const ICON_MAP: Record<string, React.ComponentType<{
|
|
45
|
+
className?: string;
|
|
46
|
+
}>>;
|
|
47
|
+
//#endregion
|
|
48
|
+
export { ICON_MAP, PRD, PRDDetail, PRDVersionBase, PRDVersionWithPages, PRDVersionWithSemver };
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { BadgeDollarSign, BarChart3, Bell, Brain, Building2, Calendar, CircleStar, Database, Earth, FileText, Fish, Folder, GraduationCap, HandFist, Heart, HeartHandshake, Link, LoaderPinwheel, MessageSquare, Music4, Package, PartyPopper, PencilRuler, Settings, ShoppingCart, Shrimp, Sparkles, SquareChartGantt, ToolCase, Users, VenetianMask } from "lucide-react";
|
|
2
|
+
//#region src/types/prd.ts
|
|
3
|
+
const ICON_MAP = {
|
|
4
|
+
folder: Folder,
|
|
5
|
+
file: FileText,
|
|
6
|
+
chart: BarChart3,
|
|
7
|
+
users: Users,
|
|
8
|
+
settings: Settings,
|
|
9
|
+
package: Package,
|
|
10
|
+
database: Database,
|
|
11
|
+
cart: ShoppingCart,
|
|
12
|
+
heart: Heart,
|
|
13
|
+
sparkles: Sparkles,
|
|
14
|
+
link: Link,
|
|
15
|
+
message: MessageSquare,
|
|
16
|
+
calendar: Calendar,
|
|
17
|
+
bell: Bell,
|
|
18
|
+
building2: Building2,
|
|
19
|
+
squareChartGantt: SquareChartGantt,
|
|
20
|
+
heartHandshake: HeartHandshake,
|
|
21
|
+
shrimp: Shrimp,
|
|
22
|
+
fish: Fish,
|
|
23
|
+
venetianMask: VenetianMask,
|
|
24
|
+
graduationCap: GraduationCap,
|
|
25
|
+
handFist: HandFist,
|
|
26
|
+
loaderPinwheel: LoaderPinwheel,
|
|
27
|
+
toolCase: ToolCase,
|
|
28
|
+
partyPopper: PartyPopper,
|
|
29
|
+
pencilRuler: PencilRuler,
|
|
30
|
+
circleStar: CircleStar,
|
|
31
|
+
brain: Brain,
|
|
32
|
+
badgeDollarSign: BadgeDollarSign,
|
|
33
|
+
earth: Earth,
|
|
34
|
+
music4: Music4
|
|
35
|
+
};
|
|
36
|
+
//#endregion
|
|
37
|
+
export { ICON_MAP };
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import { CanvasElement, ComponentCategory, ComponentSource, DEVICE_SIZES, DeviceType, EditableFieldType, EditablePropField, PrototypeComponentConfig, ResizeDirection, ResizeMode } from "@allbluecn/prototype";
|
|
2
|
+
export { type CanvasElement, type ComponentCategory, type ComponentSource, DEVICE_SIZES, type DeviceType, type EditableFieldType, type EditablePropField, type PrototypeComponentConfig, type ResizeDirection, type ResizeMode };
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
//#region src/modules/ai-providers/types.d.ts
|
|
2
|
+
type AdapterKind = 'openai' | 'anthropic' | 'gemini' | 'groq' | 'grok' | 'openrouter' | 'ollama' | 'openai-compatible';
|
|
3
|
+
type ProviderCategory = 'recommended' | 'popular' | 'local';
|
|
4
|
+
type ModelCapability = 'text' | 'vision' | 'tools' | 'reasoning' | 'audio';
|
|
5
|
+
interface AiModelMeta {
|
|
6
|
+
/** 模型 ID(传给 adapter 的 model 字符串) */
|
|
7
|
+
id: string;
|
|
8
|
+
/** 显示名 */
|
|
9
|
+
displayName: string;
|
|
10
|
+
/** 上下文窗口(tokens) */
|
|
11
|
+
contextWindow?: number;
|
|
12
|
+
/** 能力标签 */
|
|
13
|
+
capabilities?: ModelCapability[];
|
|
14
|
+
/** 是否默认勾选 */
|
|
15
|
+
defaultEnabled?: boolean;
|
|
16
|
+
/** 模型图标 slug(后台配置,@lobehub/icons PascalCase 导出名),未配置时 fallback 到服务商图标 */
|
|
17
|
+
iconSlug?: string;
|
|
18
|
+
/** 发布日期 YYYY-MM-DD */
|
|
19
|
+
releaseDate?: string;
|
|
20
|
+
/** 输入价格($/百万 tokens) */
|
|
21
|
+
inputPrice?: number;
|
|
22
|
+
/** 输出价格($/百万 tokens) */
|
|
23
|
+
outputPrice?: number;
|
|
24
|
+
/** 自定义标签(如「旗舰」「快速」),区别于 capabilities 能力标签 */
|
|
25
|
+
tags?: string[];
|
|
26
|
+
}
|
|
27
|
+
/** 服务商完整元数据(admin 表单 + DB 行 + 前端展示共用) */
|
|
28
|
+
interface AiProviderMeta {
|
|
29
|
+
/** 业务标识("openai" "anthropic" 等),与数据库 providerId 字段对应 */
|
|
30
|
+
providerId: string;
|
|
31
|
+
displayName: string;
|
|
32
|
+
brandName: string;
|
|
33
|
+
description: string;
|
|
34
|
+
category: ProviderCategory;
|
|
35
|
+
iconSlug: string;
|
|
36
|
+
brandColor: string;
|
|
37
|
+
/** 卡片角标文案(如「推荐」「热门」「NEW」),admin 可配,留空则不显示 */
|
|
38
|
+
badge?: string;
|
|
39
|
+
adapterKind: AdapterKind;
|
|
40
|
+
defaultBaseUrl?: string;
|
|
41
|
+
keyUrl?: string;
|
|
42
|
+
docsUrl?: string;
|
|
43
|
+
keyPlaceholder?: string;
|
|
44
|
+
isLocal?: boolean;
|
|
45
|
+
models: AiModelMeta[];
|
|
46
|
+
}
|
|
47
|
+
/** admin 表格行:DB 行 + 关联用户配置数 */
|
|
48
|
+
interface AiProviderRow extends AiProviderMeta {
|
|
49
|
+
/** DB 主键 */
|
|
50
|
+
id: string;
|
|
51
|
+
enabled: boolean;
|
|
52
|
+
sortOrder: number;
|
|
53
|
+
/** 已配置此服务商的用户数 */
|
|
54
|
+
configCount: number;
|
|
55
|
+
createdAt: string;
|
|
56
|
+
updatedAt: string;
|
|
57
|
+
}
|
|
58
|
+
/** 卡片角标的预设颜色(按文案匹配),admin 也可自由输入文案 */
|
|
59
|
+
declare const PROVIDER_BADGE_STYLES: Record<string, string>;
|
|
60
|
+
//#endregion
|
|
61
|
+
export { ModelCapability as a, AiProviderRow as i, AiModelMeta as n, PROVIDER_BADGE_STYLES as o, AiProviderMeta as r, ProviderCategory as s, AdapterKind as t };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {}
|