@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,74 @@
|
|
|
1
|
+
//#region src/lib/tag-colors.ts
|
|
2
|
+
const TAG_COLORS = [
|
|
3
|
+
{
|
|
4
|
+
bg: "bg-blue-100 dark:bg-blue-900/30",
|
|
5
|
+
text: "text-blue-700 dark:text-blue-300",
|
|
6
|
+
border: "border-blue-200 dark:border-blue-700",
|
|
7
|
+
selected: "border-blue-500",
|
|
8
|
+
check: "text-blue-700 dark:text-blue-300",
|
|
9
|
+
label: "蓝色"
|
|
10
|
+
},
|
|
11
|
+
{
|
|
12
|
+
bg: "bg-emerald-100 dark:bg-emerald-900/30",
|
|
13
|
+
text: "text-emerald-700 dark:text-emerald-300",
|
|
14
|
+
border: "border-emerald-200 dark:border-emerald-700",
|
|
15
|
+
selected: "border-emerald-500",
|
|
16
|
+
check: "text-emerald-700 dark:text-emerald-300",
|
|
17
|
+
label: "绿色"
|
|
18
|
+
},
|
|
19
|
+
{
|
|
20
|
+
bg: "bg-violet-100 dark:bg-violet-900/30",
|
|
21
|
+
text: "text-violet-700 dark:text-violet-300",
|
|
22
|
+
border: "border-violet-200 dark:border-violet-700",
|
|
23
|
+
selected: "border-violet-500",
|
|
24
|
+
check: "text-violet-700 dark:text-violet-300",
|
|
25
|
+
label: "紫色"
|
|
26
|
+
},
|
|
27
|
+
{
|
|
28
|
+
bg: "bg-amber-100 dark:bg-amber-900/30",
|
|
29
|
+
text: "text-amber-700 dark:text-amber-300",
|
|
30
|
+
border: "border-amber-200 dark:border-amber-700",
|
|
31
|
+
selected: "border-amber-500",
|
|
32
|
+
check: "text-amber-700 dark:text-amber-300",
|
|
33
|
+
label: "琥珀"
|
|
34
|
+
},
|
|
35
|
+
{
|
|
36
|
+
bg: "bg-rose-100 dark:bg-rose-900/30",
|
|
37
|
+
text: "text-rose-700 dark:text-rose-300",
|
|
38
|
+
border: "border-rose-200 dark:border-rose-700",
|
|
39
|
+
selected: "border-rose-500",
|
|
40
|
+
check: "text-rose-700 dark:text-rose-300",
|
|
41
|
+
label: "玫红"
|
|
42
|
+
},
|
|
43
|
+
{
|
|
44
|
+
bg: "bg-cyan-100 dark:bg-cyan-900/30",
|
|
45
|
+
text: "text-cyan-700 dark:text-cyan-300",
|
|
46
|
+
border: "border-cyan-200 dark:border-cyan-700",
|
|
47
|
+
selected: "border-cyan-500",
|
|
48
|
+
check: "text-cyan-700 dark:text-cyan-300",
|
|
49
|
+
label: "青色"
|
|
50
|
+
},
|
|
51
|
+
{
|
|
52
|
+
bg: "bg-orange-100 dark:bg-orange-900/30",
|
|
53
|
+
text: "text-orange-700 dark:text-orange-300",
|
|
54
|
+
border: "border-orange-200 dark:border-orange-700",
|
|
55
|
+
selected: "border-orange-500",
|
|
56
|
+
check: "text-orange-700 dark:text-orange-300",
|
|
57
|
+
label: "橙色"
|
|
58
|
+
},
|
|
59
|
+
{
|
|
60
|
+
bg: "bg-pink-100 dark:bg-pink-900/30",
|
|
61
|
+
text: "text-pink-700 dark:text-pink-300",
|
|
62
|
+
border: "border-pink-200 dark:border-pink-700",
|
|
63
|
+
selected: "border-pink-500",
|
|
64
|
+
check: "text-pink-700 dark:text-pink-300",
|
|
65
|
+
label: "粉色"
|
|
66
|
+
}
|
|
67
|
+
];
|
|
68
|
+
function hashColorIndex(name) {
|
|
69
|
+
let hash = 0;
|
|
70
|
+
for (let i = 0; i < name.length; i++) hash = (hash << 5) - hash + name.charCodeAt(i);
|
|
71
|
+
return Math.abs(hash) % TAG_COLORS.length;
|
|
72
|
+
}
|
|
73
|
+
//#endregion
|
|
74
|
+
export { TAG_COLORS, hashColorIndex };
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { formatDate } from "./datetime.js";
|
|
2
|
+
//#region src/lib/time-format.ts
|
|
3
|
+
function isSameDay(a, b, timezone) {
|
|
4
|
+
return formatDate(a, timezone, "yyyy-MM-dd") === formatDate(b, timezone, "yyyy-MM-dd");
|
|
5
|
+
}
|
|
6
|
+
function formatSaveTime(savedAt, type, timezone) {
|
|
7
|
+
const now = /* @__PURE__ */ new Date();
|
|
8
|
+
const time = formatDate(savedAt, timezone, "HH:mm");
|
|
9
|
+
const label = type === "auto" ? "自动保存" : "手动保存";
|
|
10
|
+
if (isSameDay(savedAt, now, timezone)) return `${time} ${label}`;
|
|
11
|
+
const yesterday = new Date(now);
|
|
12
|
+
yesterday.setDate(yesterday.getDate() - 1);
|
|
13
|
+
if (isSameDay(savedAt, yesterday, timezone)) return `昨日 ${time} ${label}`;
|
|
14
|
+
const oneYearAgo = new Date(now);
|
|
15
|
+
oneYearAgo.setFullYear(oneYearAgo.getFullYear() - 1);
|
|
16
|
+
if (savedAt > oneYearAgo) return `${formatDate(savedAt, timezone, "MM")}-${formatDate(savedAt, timezone, "dd")} ${time} ${label}`;
|
|
17
|
+
return `1年前 ${label}`;
|
|
18
|
+
}
|
|
19
|
+
//#endregion
|
|
20
|
+
export { formatSaveTime };
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import { a as MODEL_TABS, c as PROVIDER_CATEGORY_VALUES, i as MODEL_CAPABILITY_OPTIONS, n as ADAPTER_KIND_VALUES, o as ModelTab, r as LOBE_ICON_MAP, s as PROVIDER_CATEGORIES, t as ADAPTER_KINDS } from "../../constants-C3hGP_ru.js";
|
|
2
|
+
export { ADAPTER_KINDS, ADAPTER_KIND_VALUES, LOBE_ICON_MAP, MODEL_CAPABILITY_OPTIONS, MODEL_TABS, ModelTab, PROVIDER_CATEGORIES, PROVIDER_CATEGORY_VALUES };
|
|
@@ -0,0 +1,125 @@
|
|
|
1
|
+
//#region src/modules/ai-providers/constants.ts
|
|
2
|
+
const ADAPTER_KINDS = [
|
|
3
|
+
{
|
|
4
|
+
value: "openai",
|
|
5
|
+
label: "OpenAI 官方",
|
|
6
|
+
description: "GPT 系列,OpenAI 协议"
|
|
7
|
+
},
|
|
8
|
+
{
|
|
9
|
+
value: "anthropic",
|
|
10
|
+
label: "Anthropic",
|
|
11
|
+
description: "Claude 系列,Anthropic 协议"
|
|
12
|
+
},
|
|
13
|
+
{
|
|
14
|
+
value: "gemini",
|
|
15
|
+
label: "Google Gemini",
|
|
16
|
+
description: "Gemini 系列,Google 协议"
|
|
17
|
+
},
|
|
18
|
+
{
|
|
19
|
+
value: "groq",
|
|
20
|
+
label: "Groq",
|
|
21
|
+
description: "Groq 极速推理引擎"
|
|
22
|
+
},
|
|
23
|
+
{
|
|
24
|
+
value: "grok",
|
|
25
|
+
label: "xAI Grok",
|
|
26
|
+
description: "Grok 系列,xAI 协议"
|
|
27
|
+
},
|
|
28
|
+
{
|
|
29
|
+
value: "openrouter",
|
|
30
|
+
label: "OpenRouter 聚合",
|
|
31
|
+
description: "一个 Key 访问 200+ 模型"
|
|
32
|
+
},
|
|
33
|
+
{
|
|
34
|
+
value: "ollama",
|
|
35
|
+
label: "Ollama 本地",
|
|
36
|
+
description: "本地部署开源模型,无需 API Key"
|
|
37
|
+
},
|
|
38
|
+
{
|
|
39
|
+
value: "openai-compatible",
|
|
40
|
+
label: "OpenAI 兼容",
|
|
41
|
+
description: "DeepSeek/Moonshot/Mistral 等兼容协议"
|
|
42
|
+
}
|
|
43
|
+
];
|
|
44
|
+
const PROVIDER_CATEGORIES = [
|
|
45
|
+
{
|
|
46
|
+
value: "recommended",
|
|
47
|
+
label: "推荐"
|
|
48
|
+
},
|
|
49
|
+
{
|
|
50
|
+
value: "popular",
|
|
51
|
+
label: "热门"
|
|
52
|
+
},
|
|
53
|
+
{
|
|
54
|
+
value: "local",
|
|
55
|
+
label: "本地"
|
|
56
|
+
}
|
|
57
|
+
];
|
|
58
|
+
const ADAPTER_KIND_VALUES = ADAPTER_KINDS.map((k) => k.value);
|
|
59
|
+
const PROVIDER_CATEGORY_VALUES = PROVIDER_CATEGORIES.map((c) => c.value);
|
|
60
|
+
const MODEL_CAPABILITY_OPTIONS = [
|
|
61
|
+
{
|
|
62
|
+
value: "text",
|
|
63
|
+
label: "文本"
|
|
64
|
+
},
|
|
65
|
+
{
|
|
66
|
+
value: "vision",
|
|
67
|
+
label: "视觉"
|
|
68
|
+
},
|
|
69
|
+
{
|
|
70
|
+
value: "tools",
|
|
71
|
+
label: "工具"
|
|
72
|
+
},
|
|
73
|
+
{
|
|
74
|
+
value: "reasoning",
|
|
75
|
+
label: "推理"
|
|
76
|
+
},
|
|
77
|
+
{
|
|
78
|
+
value: "audio",
|
|
79
|
+
label: "音频"
|
|
80
|
+
}
|
|
81
|
+
];
|
|
82
|
+
const MODEL_TABS = [
|
|
83
|
+
{
|
|
84
|
+
value: "all",
|
|
85
|
+
label: "全部"
|
|
86
|
+
},
|
|
87
|
+
{
|
|
88
|
+
value: "text",
|
|
89
|
+
label: "文本"
|
|
90
|
+
},
|
|
91
|
+
{
|
|
92
|
+
value: "reasoning",
|
|
93
|
+
label: "推理"
|
|
94
|
+
},
|
|
95
|
+
{
|
|
96
|
+
value: "tools",
|
|
97
|
+
label: "对话"
|
|
98
|
+
},
|
|
99
|
+
{
|
|
100
|
+
value: "vision",
|
|
101
|
+
label: "图片"
|
|
102
|
+
},
|
|
103
|
+
{
|
|
104
|
+
value: "video",
|
|
105
|
+
label: "视频"
|
|
106
|
+
}
|
|
107
|
+
];
|
|
108
|
+
/**
|
|
109
|
+
* our providerId → @lobehub/icons PascalCase 导出名
|
|
110
|
+
* 未知 providerId 返回 null,调用方 fallback 到首字母
|
|
111
|
+
*/
|
|
112
|
+
const LOBE_ICON_MAP = {
|
|
113
|
+
openai: "OpenAI",
|
|
114
|
+
anthropic: "Anthropic",
|
|
115
|
+
google: "Gemini",
|
|
116
|
+
deepseek: "DeepSeek",
|
|
117
|
+
groq: "Groq",
|
|
118
|
+
xai: "XAI",
|
|
119
|
+
openrouter: "OpenRouter",
|
|
120
|
+
mistral: "Mistral",
|
|
121
|
+
ollama: "Ollama",
|
|
122
|
+
moonshot: "Moonshot"
|
|
123
|
+
};
|
|
124
|
+
//#endregion
|
|
125
|
+
export { ADAPTER_KINDS, ADAPTER_KIND_VALUES, LOBE_ICON_MAP, MODEL_CAPABILITY_OPTIONS, MODEL_TABS, PROVIDER_CATEGORIES, PROVIDER_CATEGORY_VALUES };
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { a as ModelCapability, i as AiProviderRow, n as AiModelMeta, o as PROVIDER_BADGE_STYLES, r as AiProviderMeta, s as ProviderCategory, t as AdapterKind } from "../../types-dopOMFRC.js";
|
|
2
|
+
import { a as MODEL_TABS, c as PROVIDER_CATEGORY_VALUES, i as MODEL_CAPABILITY_OPTIONS, n as ADAPTER_KIND_VALUES, o as ModelTab, r as LOBE_ICON_MAP, s as PROVIDER_CATEGORIES, t as ADAPTER_KINDS } from "../../constants-C3hGP_ru.js";
|
|
3
|
+
import { t as SEED_AI_PROVIDERS } from "../../seed-data-BK0cl93n.js";
|
|
4
|
+
export { ADAPTER_KINDS, ADAPTER_KIND_VALUES, AdapterKind, AiModelMeta, AiProviderMeta, AiProviderRow, LOBE_ICON_MAP, MODEL_CAPABILITY_OPTIONS, MODEL_TABS, ModelCapability, ModelTab, PROVIDER_BADGE_STYLES, PROVIDER_CATEGORIES, PROVIDER_CATEGORY_VALUES, ProviderCategory, SEED_AI_PROVIDERS };
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { PROVIDER_BADGE_STYLES } from "./types.js";
|
|
2
|
+
import { ADAPTER_KINDS, ADAPTER_KIND_VALUES, LOBE_ICON_MAP, MODEL_CAPABILITY_OPTIONS, MODEL_TABS, PROVIDER_CATEGORIES, PROVIDER_CATEGORY_VALUES } from "./constants.js";
|
|
3
|
+
import { SEED_AI_PROVIDERS } from "./seed-data.js";
|
|
4
|
+
export { ADAPTER_KINDS, ADAPTER_KIND_VALUES, LOBE_ICON_MAP, MODEL_CAPABILITY_OPTIONS, MODEL_TABS, PROVIDER_BADGE_STYLES, PROVIDER_CATEGORIES, PROVIDER_CATEGORY_VALUES, SEED_AI_PROVIDERS };
|
|
@@ -0,0 +1,408 @@
|
|
|
1
|
+
//#region src/modules/ai-providers/seed-data.ts
|
|
2
|
+
/** 10 个最受欢迎 AI 服务商的种子数据,admin 可在其基础上增删改 */
|
|
3
|
+
const SEED_AI_PROVIDERS = [
|
|
4
|
+
{
|
|
5
|
+
providerId: "openai",
|
|
6
|
+
displayName: "OpenAI",
|
|
7
|
+
brandName: "OpenAI",
|
|
8
|
+
description: "GPT 系列模型,业界领先的通用对话与推理能力",
|
|
9
|
+
category: "recommended",
|
|
10
|
+
iconSlug: "openai",
|
|
11
|
+
brandColor: "#10A37F",
|
|
12
|
+
badge: "推荐",
|
|
13
|
+
adapterKind: "openai",
|
|
14
|
+
defaultBaseUrl: "https://api.openai.com/v1",
|
|
15
|
+
keyUrl: "https://platform.openai.com/api-keys",
|
|
16
|
+
docsUrl: "https://platform.openai.com/docs",
|
|
17
|
+
keyPlaceholder: "sk-...",
|
|
18
|
+
models: [
|
|
19
|
+
{
|
|
20
|
+
id: "gpt-4o",
|
|
21
|
+
displayName: "GPT-4o",
|
|
22
|
+
contextWindow: 128e3,
|
|
23
|
+
capabilities: [
|
|
24
|
+
"text",
|
|
25
|
+
"vision",
|
|
26
|
+
"tools"
|
|
27
|
+
],
|
|
28
|
+
defaultEnabled: true
|
|
29
|
+
},
|
|
30
|
+
{
|
|
31
|
+
id: "gpt-4o-mini",
|
|
32
|
+
displayName: "GPT-4o mini",
|
|
33
|
+
contextWindow: 128e3,
|
|
34
|
+
capabilities: [
|
|
35
|
+
"text",
|
|
36
|
+
"vision",
|
|
37
|
+
"tools"
|
|
38
|
+
],
|
|
39
|
+
defaultEnabled: true
|
|
40
|
+
},
|
|
41
|
+
{
|
|
42
|
+
id: "o1",
|
|
43
|
+
displayName: "o1",
|
|
44
|
+
contextWindow: 2e5,
|
|
45
|
+
capabilities: ["text", "reasoning"]
|
|
46
|
+
},
|
|
47
|
+
{
|
|
48
|
+
id: "o1-mini",
|
|
49
|
+
displayName: "o1-mini",
|
|
50
|
+
contextWindow: 128e3,
|
|
51
|
+
capabilities: ["text", "reasoning"]
|
|
52
|
+
},
|
|
53
|
+
{
|
|
54
|
+
id: "o3-mini",
|
|
55
|
+
displayName: "o3-mini",
|
|
56
|
+
contextWindow: 2e5,
|
|
57
|
+
capabilities: [
|
|
58
|
+
"text",
|
|
59
|
+
"reasoning",
|
|
60
|
+
"tools"
|
|
61
|
+
],
|
|
62
|
+
defaultEnabled: true
|
|
63
|
+
}
|
|
64
|
+
]
|
|
65
|
+
},
|
|
66
|
+
{
|
|
67
|
+
providerId: "anthropic",
|
|
68
|
+
displayName: "Anthropic",
|
|
69
|
+
brandName: "Claude",
|
|
70
|
+
description: "Claude 系列模型,擅长长文本理解与代码生成",
|
|
71
|
+
category: "recommended",
|
|
72
|
+
iconSlug: "anthropic",
|
|
73
|
+
brandColor: "#D97757",
|
|
74
|
+
badge: "推荐",
|
|
75
|
+
adapterKind: "anthropic",
|
|
76
|
+
defaultBaseUrl: "https://api.anthropic.com",
|
|
77
|
+
keyUrl: "https://console.anthropic.com/settings/keys",
|
|
78
|
+
docsUrl: "https://docs.anthropic.com",
|
|
79
|
+
keyPlaceholder: "sk-ant-...",
|
|
80
|
+
models: [
|
|
81
|
+
{
|
|
82
|
+
id: "claude-sonnet-4-5",
|
|
83
|
+
displayName: "Claude Sonnet 4.5",
|
|
84
|
+
contextWindow: 2e5,
|
|
85
|
+
capabilities: [
|
|
86
|
+
"text",
|
|
87
|
+
"vision",
|
|
88
|
+
"tools",
|
|
89
|
+
"reasoning"
|
|
90
|
+
],
|
|
91
|
+
defaultEnabled: true
|
|
92
|
+
},
|
|
93
|
+
{
|
|
94
|
+
id: "claude-opus-4-1",
|
|
95
|
+
displayName: "Claude Opus 4.1",
|
|
96
|
+
contextWindow: 2e5,
|
|
97
|
+
capabilities: [
|
|
98
|
+
"text",
|
|
99
|
+
"vision",
|
|
100
|
+
"tools",
|
|
101
|
+
"reasoning"
|
|
102
|
+
]
|
|
103
|
+
},
|
|
104
|
+
{
|
|
105
|
+
id: "claude-haiku-4-5",
|
|
106
|
+
displayName: "Claude Haiku 4.5",
|
|
107
|
+
contextWindow: 2e5,
|
|
108
|
+
capabilities: [
|
|
109
|
+
"text",
|
|
110
|
+
"vision",
|
|
111
|
+
"tools"
|
|
112
|
+
],
|
|
113
|
+
defaultEnabled: true
|
|
114
|
+
}
|
|
115
|
+
]
|
|
116
|
+
},
|
|
117
|
+
{
|
|
118
|
+
providerId: "gemini",
|
|
119
|
+
displayName: "Google Gemini",
|
|
120
|
+
brandName: "Gemini",
|
|
121
|
+
description: "Google 推出的多模态大模型,支持文本、图像、视频",
|
|
122
|
+
category: "recommended",
|
|
123
|
+
iconSlug: "googlegemini",
|
|
124
|
+
brandColor: "#4285F4",
|
|
125
|
+
badge: "推荐",
|
|
126
|
+
adapterKind: "gemini",
|
|
127
|
+
defaultBaseUrl: "https://generativelanguage.googleapis.com",
|
|
128
|
+
keyUrl: "https://aistudio.google.com/apikey",
|
|
129
|
+
docsUrl: "https://ai.google.dev/gemini-api/docs",
|
|
130
|
+
keyPlaceholder: "AIza...",
|
|
131
|
+
models: [{
|
|
132
|
+
id: "gemini-2.5-pro",
|
|
133
|
+
displayName: "Gemini 2.5 Pro",
|
|
134
|
+
contextWindow: 2e6,
|
|
135
|
+
capabilities: [
|
|
136
|
+
"text",
|
|
137
|
+
"vision",
|
|
138
|
+
"tools",
|
|
139
|
+
"reasoning"
|
|
140
|
+
],
|
|
141
|
+
defaultEnabled: true
|
|
142
|
+
}, {
|
|
143
|
+
id: "gemini-2.5-flash",
|
|
144
|
+
displayName: "Gemini 2.5 Flash",
|
|
145
|
+
contextWindow: 1e6,
|
|
146
|
+
capabilities: [
|
|
147
|
+
"text",
|
|
148
|
+
"vision",
|
|
149
|
+
"tools"
|
|
150
|
+
],
|
|
151
|
+
defaultEnabled: true
|
|
152
|
+
}]
|
|
153
|
+
},
|
|
154
|
+
{
|
|
155
|
+
providerId: "deepseek",
|
|
156
|
+
displayName: "DeepSeek",
|
|
157
|
+
brandName: "DeepSeek",
|
|
158
|
+
description: "国产开源模型,性价比极高,支持推理模式",
|
|
159
|
+
category: "popular",
|
|
160
|
+
iconSlug: "deepseek",
|
|
161
|
+
brandColor: "#4D6BFE",
|
|
162
|
+
badge: "热门",
|
|
163
|
+
adapterKind: "openai-compatible",
|
|
164
|
+
defaultBaseUrl: "https://api.deepseek.com/v1",
|
|
165
|
+
keyUrl: "https://platform.deepseek.com/api_keys",
|
|
166
|
+
docsUrl: "https://api-docs.deepseek.com",
|
|
167
|
+
keyPlaceholder: "sk-...",
|
|
168
|
+
models: [{
|
|
169
|
+
id: "deepseek-chat",
|
|
170
|
+
displayName: "DeepSeek Chat (V3)",
|
|
171
|
+
contextWindow: 64e3,
|
|
172
|
+
capabilities: ["text", "tools"],
|
|
173
|
+
defaultEnabled: true
|
|
174
|
+
}, {
|
|
175
|
+
id: "deepseek-reasoner",
|
|
176
|
+
displayName: "DeepSeek Reasoner (R1)",
|
|
177
|
+
contextWindow: 64e3,
|
|
178
|
+
capabilities: ["text", "reasoning"],
|
|
179
|
+
defaultEnabled: true
|
|
180
|
+
}]
|
|
181
|
+
},
|
|
182
|
+
{
|
|
183
|
+
providerId: "groq",
|
|
184
|
+
displayName: "Groq",
|
|
185
|
+
brandName: "Groq",
|
|
186
|
+
description: "基于 LPU 的极速推理引擎,延迟低至毫秒级",
|
|
187
|
+
category: "popular",
|
|
188
|
+
iconSlug: "groq",
|
|
189
|
+
brandColor: "#F55036",
|
|
190
|
+
badge: "热门",
|
|
191
|
+
adapterKind: "groq",
|
|
192
|
+
defaultBaseUrl: "https://api.groq.com/openai/v1",
|
|
193
|
+
keyUrl: "https://console.groq.com/keys",
|
|
194
|
+
docsUrl: "https://console.groq.com/docs",
|
|
195
|
+
keyPlaceholder: "gsk_...",
|
|
196
|
+
models: [{
|
|
197
|
+
id: "llama-3.3-70b-versatile",
|
|
198
|
+
displayName: "Llama 3.3 70B",
|
|
199
|
+
contextWindow: 128e3,
|
|
200
|
+
capabilities: ["text", "tools"],
|
|
201
|
+
defaultEnabled: true
|
|
202
|
+
}, {
|
|
203
|
+
id: "llama-3.1-8b-instant",
|
|
204
|
+
displayName: "Llama 3.1 8B Instant",
|
|
205
|
+
contextWindow: 128e3,
|
|
206
|
+
capabilities: ["text"]
|
|
207
|
+
}]
|
|
208
|
+
},
|
|
209
|
+
{
|
|
210
|
+
providerId: "xai",
|
|
211
|
+
displayName: "xAI",
|
|
212
|
+
brandName: "Grok",
|
|
213
|
+
description: "Elon Musk 的 xAI 推出的 Grok 系列模型",
|
|
214
|
+
category: "popular",
|
|
215
|
+
iconSlug: "x",
|
|
216
|
+
brandColor: "#000000",
|
|
217
|
+
badge: "热门",
|
|
218
|
+
adapterKind: "grok",
|
|
219
|
+
defaultBaseUrl: "https://api.x.ai",
|
|
220
|
+
keyUrl: "https://x.ai/api",
|
|
221
|
+
docsUrl: "https://docs.x.ai",
|
|
222
|
+
keyPlaceholder: "xai-...",
|
|
223
|
+
models: [{
|
|
224
|
+
id: "grok-4",
|
|
225
|
+
displayName: "Grok 4",
|
|
226
|
+
contextWindow: 256e3,
|
|
227
|
+
capabilities: [
|
|
228
|
+
"text",
|
|
229
|
+
"vision",
|
|
230
|
+
"tools",
|
|
231
|
+
"reasoning"
|
|
232
|
+
],
|
|
233
|
+
defaultEnabled: true
|
|
234
|
+
}, {
|
|
235
|
+
id: "grok-3",
|
|
236
|
+
displayName: "Grok 3",
|
|
237
|
+
contextWindow: 131072,
|
|
238
|
+
capabilities: ["text", "tools"]
|
|
239
|
+
}]
|
|
240
|
+
},
|
|
241
|
+
{
|
|
242
|
+
providerId: "openrouter",
|
|
243
|
+
displayName: "OpenRouter",
|
|
244
|
+
brandName: "OpenRouter",
|
|
245
|
+
description: "聚合 200+ 模型的统一路由,一个 Key 访问所有厂商",
|
|
246
|
+
category: "recommended",
|
|
247
|
+
iconSlug: "openrouter",
|
|
248
|
+
brandColor: "#6467F2",
|
|
249
|
+
badge: "推荐",
|
|
250
|
+
adapterKind: "openrouter",
|
|
251
|
+
defaultBaseUrl: "https://openrouter.ai/api/v1",
|
|
252
|
+
keyUrl: "https://openrouter.ai/keys",
|
|
253
|
+
docsUrl: "https://openrouter.ai/docs",
|
|
254
|
+
keyPlaceholder: "sk-or-...",
|
|
255
|
+
models: [
|
|
256
|
+
{
|
|
257
|
+
id: "openai/gpt-4o-mini",
|
|
258
|
+
displayName: "GPT-4o mini",
|
|
259
|
+
contextWindow: 128e3,
|
|
260
|
+
capabilities: [
|
|
261
|
+
"text",
|
|
262
|
+
"vision",
|
|
263
|
+
"tools"
|
|
264
|
+
],
|
|
265
|
+
defaultEnabled: true
|
|
266
|
+
},
|
|
267
|
+
{
|
|
268
|
+
id: "openai/gpt-4o",
|
|
269
|
+
displayName: "GPT-4o",
|
|
270
|
+
contextWindow: 128e3,
|
|
271
|
+
capabilities: [
|
|
272
|
+
"text",
|
|
273
|
+
"vision",
|
|
274
|
+
"tools"
|
|
275
|
+
]
|
|
276
|
+
},
|
|
277
|
+
{
|
|
278
|
+
id: "anthropic/claude-sonnet-4.5",
|
|
279
|
+
displayName: "Claude Sonnet 4.5",
|
|
280
|
+
contextWindow: 2e5,
|
|
281
|
+
capabilities: [
|
|
282
|
+
"text",
|
|
283
|
+
"vision",
|
|
284
|
+
"tools",
|
|
285
|
+
"reasoning"
|
|
286
|
+
],
|
|
287
|
+
defaultEnabled: true
|
|
288
|
+
},
|
|
289
|
+
{
|
|
290
|
+
id: "google/gemini-2.5-flash",
|
|
291
|
+
displayName: "Gemini 2.5 Flash",
|
|
292
|
+
contextWindow: 1e6,
|
|
293
|
+
capabilities: [
|
|
294
|
+
"text",
|
|
295
|
+
"vision",
|
|
296
|
+
"tools"
|
|
297
|
+
],
|
|
298
|
+
defaultEnabled: true
|
|
299
|
+
},
|
|
300
|
+
{
|
|
301
|
+
id: "deepseek/deepseek-chat",
|
|
302
|
+
displayName: "DeepSeek V3",
|
|
303
|
+
contextWindow: 64e3,
|
|
304
|
+
capabilities: ["text", "tools"]
|
|
305
|
+
}
|
|
306
|
+
]
|
|
307
|
+
},
|
|
308
|
+
{
|
|
309
|
+
providerId: "mistral",
|
|
310
|
+
displayName: "Mistral AI",
|
|
311
|
+
brandName: "Mistral",
|
|
312
|
+
description: "欧洲开源大模型,擅长多语言与代码",
|
|
313
|
+
category: "popular",
|
|
314
|
+
iconSlug: "mistralai",
|
|
315
|
+
brandColor: "#FF7000",
|
|
316
|
+
badge: "热门",
|
|
317
|
+
adapterKind: "openai-compatible",
|
|
318
|
+
defaultBaseUrl: "https://api.mistral.ai/v1",
|
|
319
|
+
keyUrl: "https://console.mistral.ai/api-keys",
|
|
320
|
+
docsUrl: "https://docs.mistral.ai",
|
|
321
|
+
keyPlaceholder: "...",
|
|
322
|
+
models: [{
|
|
323
|
+
id: "mistral-large-latest",
|
|
324
|
+
displayName: "Mistral Large",
|
|
325
|
+
contextWindow: 128e3,
|
|
326
|
+
capabilities: [
|
|
327
|
+
"text",
|
|
328
|
+
"vision",
|
|
329
|
+
"tools"
|
|
330
|
+
],
|
|
331
|
+
defaultEnabled: true
|
|
332
|
+
}, {
|
|
333
|
+
id: "mistral-small-latest",
|
|
334
|
+
displayName: "Mistral Small",
|
|
335
|
+
contextWindow: 32e3,
|
|
336
|
+
capabilities: ["text", "tools"],
|
|
337
|
+
defaultEnabled: true
|
|
338
|
+
}]
|
|
339
|
+
},
|
|
340
|
+
{
|
|
341
|
+
providerId: "moonshot",
|
|
342
|
+
displayName: "Moonshot AI",
|
|
343
|
+
brandName: "Kimi",
|
|
344
|
+
description: "月之暗面 Kimi,国产长文本之王",
|
|
345
|
+
category: "popular",
|
|
346
|
+
iconSlug: "moonshot",
|
|
347
|
+
brandColor: "#16161A",
|
|
348
|
+
badge: "热门",
|
|
349
|
+
adapterKind: "openai-compatible",
|
|
350
|
+
defaultBaseUrl: "https://api.moonshot.cn/v1",
|
|
351
|
+
keyUrl: "https://platform.moonshot.cn/console/api-keys",
|
|
352
|
+
docsUrl: "https://platform.moonshot.cn/docs",
|
|
353
|
+
keyPlaceholder: "sk-...",
|
|
354
|
+
models: [{
|
|
355
|
+
id: "moonshot-v1-128k",
|
|
356
|
+
displayName: "Moonshot v1 128K",
|
|
357
|
+
contextWindow: 128e3,
|
|
358
|
+
capabilities: ["text", "tools"],
|
|
359
|
+
defaultEnabled: true
|
|
360
|
+
}, {
|
|
361
|
+
id: "kimi-k2-0905-preview",
|
|
362
|
+
displayName: "Kimi K2",
|
|
363
|
+
contextWindow: 128e3,
|
|
364
|
+
capabilities: ["text", "tools"],
|
|
365
|
+
defaultEnabled: true
|
|
366
|
+
}]
|
|
367
|
+
},
|
|
368
|
+
{
|
|
369
|
+
providerId: "ollama",
|
|
370
|
+
displayName: "Ollama",
|
|
371
|
+
brandName: "Ollama",
|
|
372
|
+
description: "本地部署开源模型,零成本零延迟(需先本地安装 Ollama)",
|
|
373
|
+
category: "local",
|
|
374
|
+
iconSlug: "ollama",
|
|
375
|
+
brandColor: "#FFFFFF",
|
|
376
|
+
badge: "本地",
|
|
377
|
+
adapterKind: "ollama",
|
|
378
|
+
defaultBaseUrl: "http://localhost:11434",
|
|
379
|
+
keyUrl: "https://ollama.com/download",
|
|
380
|
+
docsUrl: "https://ollama.com/library",
|
|
381
|
+
keyPlaceholder: "本地部署无需 API Key",
|
|
382
|
+
isLocal: true,
|
|
383
|
+
models: [
|
|
384
|
+
{
|
|
385
|
+
id: "llama3.3",
|
|
386
|
+
displayName: "Llama 3.3",
|
|
387
|
+
contextWindow: 128e3,
|
|
388
|
+
capabilities: ["text", "tools"],
|
|
389
|
+
defaultEnabled: true
|
|
390
|
+
},
|
|
391
|
+
{
|
|
392
|
+
id: "qwen2.5",
|
|
393
|
+
displayName: "Qwen 2.5",
|
|
394
|
+
contextWindow: 128e3,
|
|
395
|
+
capabilities: ["text"],
|
|
396
|
+
defaultEnabled: true
|
|
397
|
+
},
|
|
398
|
+
{
|
|
399
|
+
id: "deepseek-r1",
|
|
400
|
+
displayName: "DeepSeek R1",
|
|
401
|
+
contextWindow: 128e3,
|
|
402
|
+
capabilities: ["text", "reasoning"]
|
|
403
|
+
}
|
|
404
|
+
]
|
|
405
|
+
}
|
|
406
|
+
];
|
|
407
|
+
//#endregion
|
|
408
|
+
export { SEED_AI_PROVIDERS };
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import { a as ModelCapability, i as AiProviderRow, n as AiModelMeta, o as PROVIDER_BADGE_STYLES, r as AiProviderMeta, s as ProviderCategory, t as AdapterKind } from "../../types-dopOMFRC.js";
|
|
2
|
+
export { AdapterKind, AiModelMeta, AiProviderMeta, AiProviderRow, ModelCapability, PROVIDER_BADGE_STYLES, ProviderCategory };
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
//#region src/modules/ai-providers/types.ts
|
|
2
|
+
/** 卡片角标的预设颜色(按文案匹配),admin 也可自由输入文案 */
|
|
3
|
+
const PROVIDER_BADGE_STYLES = {
|
|
4
|
+
推荐: "bg-primary/10 text-primary border-primary/30",
|
|
5
|
+
热门: "bg-orange-500/10 text-orange-600 dark:text-orange-400 border-orange-500/30",
|
|
6
|
+
NEW: "bg-emerald-500/10 text-emerald-600 dark:text-emerald-400 border-emerald-500/30",
|
|
7
|
+
本地: "bg-blue-500/10 text-blue-600 dark:text-blue-400 border-blue-500/30"
|
|
8
|
+
};
|
|
9
|
+
//#endregion
|
|
10
|
+
export { PROVIDER_BADGE_STYLES };
|