@lobehub/lobehub 2.0.0-next.46 → 2.0.0-next.48
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/.env.example +11 -0
- package/CHANGELOG.md +42 -0
- package/apps/desktop/src/main/controllers/AuthCtr.ts +27 -2
- package/apps/desktop/src/main/core/infrastructure/ProtocolManager.ts +9 -4
- package/changelog/v1.json +14 -0
- package/docs/development/database-schema.dbml +2 -0
- package/docs/self-hosting/environment-variables/basic.mdx +49 -3
- package/docs/self-hosting/environment-variables/basic.zh-CN.mdx +49 -4
- package/locales/ar/discover.json +45 -0
- package/locales/ar/marketAuth.json +42 -0
- package/locales/ar/setting.json +94 -1
- package/locales/bg-BG/discover.json +45 -0
- package/locales/bg-BG/marketAuth.json +42 -0
- package/locales/bg-BG/setting.json +94 -1
- package/locales/de-DE/discover.json +45 -0
- package/locales/de-DE/marketAuth.json +42 -0
- package/locales/de-DE/setting.json +94 -1
- package/locales/en-US/discover.json +45 -0
- package/locales/en-US/marketAuth.json +42 -0
- package/locales/en-US/setting.json +94 -1
- package/locales/es-ES/discover.json +45 -0
- package/locales/es-ES/marketAuth.json +42 -0
- package/locales/es-ES/setting.json +94 -1
- package/locales/fa-IR/discover.json +45 -0
- package/locales/fa-IR/marketAuth.json +42 -0
- package/locales/fa-IR/setting.json +94 -1
- package/locales/fr-FR/discover.json +45 -0
- package/locales/fr-FR/marketAuth.json +42 -0
- package/locales/fr-FR/setting.json +94 -1
- package/locales/it-IT/discover.json +45 -0
- package/locales/it-IT/marketAuth.json +42 -0
- package/locales/it-IT/setting.json +94 -1
- package/locales/ja-JP/discover.json +45 -0
- package/locales/ja-JP/marketAuth.json +42 -0
- package/locales/ja-JP/setting.json +94 -1
- package/locales/ko-KR/discover.json +45 -0
- package/locales/ko-KR/marketAuth.json +42 -0
- package/locales/ko-KR/setting.json +94 -1
- package/locales/nl-NL/discover.json +45 -0
- package/locales/nl-NL/marketAuth.json +42 -0
- package/locales/nl-NL/setting.json +94 -1
- package/locales/pl-PL/discover.json +45 -0
- package/locales/pl-PL/marketAuth.json +42 -0
- package/locales/pl-PL/setting.json +94 -1
- package/locales/pt-BR/discover.json +45 -0
- package/locales/pt-BR/marketAuth.json +42 -0
- package/locales/pt-BR/setting.json +94 -1
- package/locales/ru-RU/discover.json +45 -0
- package/locales/ru-RU/marketAuth.json +42 -0
- package/locales/ru-RU/setting.json +94 -1
- package/locales/tr-TR/discover.json +45 -0
- package/locales/tr-TR/marketAuth.json +42 -0
- package/locales/tr-TR/setting.json +94 -1
- package/locales/vi-VN/discover.json +45 -0
- package/locales/vi-VN/marketAuth.json +42 -0
- package/locales/vi-VN/setting.json +94 -1
- package/locales/zh-CN/discover.json +45 -0
- package/locales/zh-CN/marketAuth.json +42 -0
- package/locales/zh-CN/setting.json +94 -1
- package/locales/zh-TW/discover.json +45 -0
- package/locales/zh-TW/marketAuth.json +42 -0
- package/locales/zh-TW/setting.json +94 -1
- package/package.json +27 -26
- package/packages/const/src/url.ts +1 -0
- package/packages/database/migrations/0044_add_tool_intervention.sql +1 -0
- package/packages/database/migrations/0044_high_toxin.sql +1 -0
- package/packages/database/migrations/0045_add_tool_intervention.sql +1 -0
- package/packages/database/migrations/meta/0039_snapshot.json +1 -1
- package/packages/database/migrations/meta/0044_snapshot.json +7813 -0
- package/packages/database/migrations/meta/0045_snapshot.json +8431 -0
- package/packages/database/migrations/meta/_journal.json +14 -0
- package/packages/database/src/core/migrations.json +36 -7
- package/packages/database/src/models/file.ts +15 -1
- package/packages/database/src/models/message.ts +1 -1
- package/packages/database/src/models/session.ts +42 -1
- package/packages/database/src/repositories/aiInfra/index.test.ts +1 -1
- package/packages/database/src/repositories/dataExporter/index.test.ts +1 -1
- package/packages/database/src/repositories/tableViewer/index.test.ts +1 -1
- package/packages/database/src/schemas/agent.ts +1 -0
- package/packages/database/src/schemas/message.ts +5 -8
- package/packages/electron-client-ipc/src/events/index.ts +6 -1
- package/packages/electron-client-ipc/src/events/remoteServer.ts +8 -0
- package/packages/fetch-sse/package.json +29 -0
- package/packages/{utils/src/fetch → fetch-sse/src}/__tests__/fetchSSE.test.ts +4 -4
- package/packages/{utils/src/fetch → fetch-sse/src}/__tests__/parseError.test.ts +7 -4
- package/packages/{utils/src/fetch → fetch-sse/src}/fetchSSE.ts +2 -2
- package/packages/{utils/src/fetch → fetch-sse/src}/parseError.ts +3 -3
- package/packages/model-bank/src/aiModels/mistral.ts +2 -1
- package/packages/model-runtime/src/core/contextBuilders/anthropic.test.ts +17 -11
- package/packages/model-runtime/src/core/contextBuilders/anthropic.ts +1 -1
- package/packages/model-runtime/src/core/contextBuilders/google.test.ts +1 -1
- package/packages/model-runtime/src/core/contextBuilders/google.ts +3 -6
- package/packages/model-runtime/src/core/contextBuilders/openai.test.ts +4 -2
- package/packages/model-runtime/src/core/contextBuilders/openai.ts +1 -1
- package/packages/model-runtime/src/core/openaiCompatibleFactory/createImage.test.ts +1 -1
- package/packages/model-runtime/src/core/openaiCompatibleFactory/createImage.ts +1 -1
- package/packages/model-runtime/src/core/openaiCompatibleFactory/index.test.ts +3 -6
- package/packages/model-runtime/src/core/streams/openai/responsesStream.test.ts +1 -1
- package/packages/model-runtime/src/helpers/mergeChatMethodOptions.ts +2 -1
- package/packages/model-runtime/src/providers/aihubmix/index.test.ts +1 -1
- package/packages/model-runtime/src/providers/anthropic/generateObject.test.ts +1 -1
- package/packages/model-runtime/src/providers/anthropic/index.test.ts +1 -1
- package/packages/model-runtime/src/providers/baichuan/index.test.ts +1 -1
- package/packages/model-runtime/src/providers/bedrock/index.test.ts +1 -1
- package/packages/model-runtime/src/providers/bfl/createImage.test.ts +4 -4
- package/packages/model-runtime/src/providers/bfl/createImage.ts +1 -1
- package/packages/model-runtime/src/providers/cloudflare/index.test.ts +1 -1
- package/packages/model-runtime/src/providers/cohere/index.test.ts +1 -1
- package/packages/model-runtime/src/providers/google/createImage.test.ts +2 -2
- package/packages/model-runtime/src/providers/google/createImage.ts +1 -1
- package/packages/model-runtime/src/providers/google/generateObject.test.ts +1 -1
- package/packages/model-runtime/src/providers/google/index.test.ts +1 -4
- package/packages/model-runtime/src/providers/groq/index.test.ts +1 -1
- package/packages/model-runtime/src/providers/hunyuan/index.test.ts +1 -1
- package/packages/model-runtime/src/providers/minimax/createImage.test.ts +1 -1
- package/packages/model-runtime/src/providers/mistral/index.test.ts +1 -1
- package/packages/model-runtime/src/providers/moonshot/index.test.ts +1 -1
- package/packages/model-runtime/src/providers/novita/index.test.ts +1 -1
- package/packages/model-runtime/src/providers/ollama/index.test.ts +43 -32
- package/packages/model-runtime/src/providers/ollama/index.ts +31 -7
- package/packages/model-runtime/src/providers/openrouter/index.test.ts +1 -1
- package/packages/model-runtime/src/providers/perplexity/index.test.ts +1 -1
- package/packages/model-runtime/src/providers/ppio/index.test.ts +1 -1
- package/packages/model-runtime/src/providers/qwen/createImage.test.ts +1 -1
- package/packages/model-runtime/src/providers/search1api/index.test.ts +1 -1
- package/packages/model-runtime/src/providers/siliconcloud/createImage.ts +1 -1
- package/packages/model-runtime/src/providers/taichu/index.test.ts +1 -1
- package/packages/model-runtime/src/providers/wenxin/index.test.ts +1 -1
- package/packages/model-runtime/src/providers/zhipu/index.test.ts +1 -1
- package/packages/model-runtime/src/utils/errorResponse.test.ts +1 -1
- package/packages/ssrf-safe-fetch/index.browser.ts +14 -0
- package/packages/ssrf-safe-fetch/package.json +8 -1
- package/packages/types/src/aiProvider.ts +1 -1
- package/packages/types/src/discover/assistants.ts +16 -0
- package/packages/types/src/document/index.ts +38 -38
- package/packages/types/src/exportConfig.ts +15 -15
- package/packages/types/src/generation/index.ts +5 -5
- package/packages/types/src/index.ts +1 -0
- package/packages/types/src/message/common/tools.ts +10 -0
- package/packages/types/src/message/db/item.ts +15 -1
- package/packages/types/src/message/ui/params.ts +15 -1
- package/packages/types/src/meta.ts +4 -0
- package/packages/types/src/openai/chat.ts +15 -15
- package/packages/types/src/plugins/mcp.ts +29 -29
- package/packages/types/src/plugins/protocol.ts +43 -43
- package/packages/types/src/search.ts +4 -4
- package/packages/types/src/session/agentSession.ts +2 -0
- package/packages/types/src/tool/plugin.ts +3 -3
- package/packages/utils/src/imageToBase64.ts +17 -10
- package/packages/utils/src/index.ts +1 -1
- package/src/app/(backend)/f/[id]/route.ts +55 -0
- package/src/app/(backend)/market/agent/[[...segments]]/route.ts +153 -0
- package/src/app/(backend)/market/oidc/[[...segments]]/route.ts +207 -0
- package/src/app/[variants]/(main)/(mobile)/me/settings/features/useCategory.tsx +1 -0
- package/src/app/[variants]/(main)/_layout/Desktop/SideBar/PinList/index.tsx +4 -2
- package/src/app/[variants]/(main)/chat/settings/features/AgentInfoDescription/index.tsx +349 -0
- package/src/app/[variants]/(main)/chat/settings/features/HeaderContent.tsx +2 -2
- package/src/app/[variants]/(main)/chat/settings/features/PublishResultModal/index.tsx +64 -0
- package/src/app/[variants]/(main)/chat/settings/features/SmartAgentActionButton/MarketPublishButton.tsx +196 -0
- package/src/app/[variants]/(main)/chat/settings/features/SmartAgentActionButton/MarketPublishModal.tsx +358 -0
- package/src/app/[variants]/(main)/chat/settings/features/SmartAgentActionButton/index.tsx +75 -0
- package/src/app/[variants]/(main)/discover/(detail)/assistant/AssistantDetailPage.tsx +11 -2
- package/src/app/[variants]/(main)/discover/(detail)/assistant/[...slugs]/Client.tsx +12 -1
- package/src/app/[variants]/(main)/discover/(detail)/assistant/[...slugs]/features/Details/Nav.tsx +19 -12
- package/src/app/[variants]/(main)/discover/(detail)/assistant/[...slugs]/features/Details/Overview/TagList.tsx +14 -5
- package/src/app/[variants]/(main)/discover/(detail)/assistant/[...slugs]/features/Details/Overview/index.tsx +2 -0
- package/src/app/[variants]/(main)/discover/(detail)/assistant/[...slugs]/features/Details/Related/index.tsx +14 -5
- package/src/app/[variants]/(main)/discover/(detail)/assistant/[...slugs]/features/Details/SystemRole/TagList.tsx +14 -5
- package/src/app/[variants]/(main)/discover/(detail)/assistant/[...slugs]/features/Details/SystemRole/index.tsx +43 -29
- package/src/app/[variants]/(main)/discover/(detail)/assistant/[...slugs]/features/Details/Versions/index.tsx +137 -0
- package/src/app/[variants]/(main)/discover/(detail)/assistant/[...slugs]/features/Details/index.tsx +2 -0
- package/src/app/[variants]/(main)/discover/(detail)/assistant/[...slugs]/features/Header.tsx +9 -10
- package/src/app/[variants]/(main)/discover/(detail)/assistant/[...slugs]/features/Sidebar/ActionButton/AddAgent.tsx +105 -14
- package/src/app/[variants]/(main)/discover/(detail)/assistant/[...slugs]/features/Sidebar/Related/index.tsx +20 -6
- package/src/app/[variants]/(main)/discover/(detail)/assistant/[...slugs]/features/StatusPage/index.tsx +113 -0
- package/src/app/[variants]/(main)/discover/(detail)/features/Breadcrumb.tsx +4 -3
- package/src/app/[variants]/(main)/discover/(list)/_layout/Desktop/Nav.tsx +3 -1
- package/src/app/[variants]/(main)/discover/(list)/assistant/AssistantPage.tsx +4 -1
- package/src/app/[variants]/(main)/discover/(list)/assistant/Client.tsx +6 -2
- package/src/app/[variants]/(main)/discover/(list)/assistant/features/Category/index.tsx +7 -3
- package/src/app/[variants]/(main)/discover/(list)/assistant/features/List/Item.tsx +13 -2
- package/src/app/[variants]/(main)/discover/(list)/assistant/features/MarketSourceSwitch.tsx +64 -0
- package/src/app/[variants]/(main)/discover/(list)/features/SortButton/index.tsx +26 -7
- package/src/app/[variants]/(main)/profile/_layout/Desktop/index.tsx +10 -10
- package/src/app/[variants]/(main)/settings/_layout/type.ts +1 -1
- package/src/app/[variants]/(main)/settings/agent/index.tsx +11 -10
- package/src/app/[variants]/(main)/settings/common/index.tsx +1 -1
- package/src/app/[variants]/(main)/settings/page.tsx +13 -10
- package/src/app/[variants]/(main)/settings/provider/ProviderMenu/Item.tsx +35 -36
- package/src/app/[variants]/(main)/settings/provider/ProviderMenu/SearchResult.tsx +5 -5
- package/src/app/[variants]/(main)/settings/provider/_layout/Desktop/Container.tsx +10 -4
- package/src/app/market-auth-callback/layout.tsx +15 -0
- package/src/app/market-auth-callback/page.tsx +196 -0
- package/src/envs/app.ts +4 -3
- package/src/features/AgentSetting/AgentPrompt/TokenTag.tsx +3 -2
- package/src/features/AgentSetting/AgentTTS/SelectWithTTSPreview.tsx +1 -1
- package/src/features/AgentSetting/store/action.ts +1 -1
- package/src/features/ChatInput/ActionBar/STT/browser.tsx +1 -1
- package/src/features/ChatInput/ActionBar/STT/openai.tsx +1 -1
- package/src/features/Conversation/components/Extras/TTS/InitPlayer.tsx +1 -1
- package/src/features/Conversation/components/VirtualizedList/index.tsx +2 -1
- package/src/features/PluginTag/PluginStatus.tsx +1 -1
- package/src/features/PluginsUI/Render/MCPType/index.tsx +26 -6
- package/src/hooks/useAgentOwnershipCheck.ts +143 -0
- package/src/instrumentation.node.ts +3 -2
- package/src/layout/AuthProvider/MarketAuth/MarketAuthProvider.tsx +364 -0
- package/src/layout/AuthProvider/MarketAuth/errors.ts +75 -0
- package/src/layout/AuthProvider/MarketAuth/index.ts +2 -0
- package/src/layout/AuthProvider/MarketAuth/oidc.ts +382 -0
- package/src/layout/AuthProvider/MarketAuth/types.ts +64 -0
- package/src/layout/AuthProvider/index.tsx +17 -4
- package/src/locales/default/discover.ts +46 -0
- package/src/locales/default/index.ts +2 -0
- package/src/locales/default/marketAuth.ts +42 -0
- package/src/locales/default/setting.ts +94 -1
- package/src/server/globalConfig/genServerAiProviderConfig.test.ts +5 -5
- package/src/server/globalConfig/genServerAiProviderConfig.ts +1 -1
- package/src/server/routers/desktop/mcp.ts +23 -8
- package/src/server/routers/lambda/market/index.ts +36 -14
- package/src/server/routers/lambda/message.ts +2 -2
- package/src/server/routers/tools/mcp.ts +24 -4
- package/src/server/services/discover/index.test.ts +153 -11
- package/src/server/services/discover/index.ts +339 -40
- package/src/server/services/file/impls/local.ts +4 -1
- package/src/server/services/file/index.ts +96 -1
- package/src/server/services/mcp/contentProcessor.ts +101 -0
- package/src/server/services/mcp/index.test.ts +52 -10
- package/src/server/services/mcp/index.ts +29 -26
- package/src/server/sitemap.ts +49 -35
- package/src/services/_url.ts +15 -1
- package/src/services/chat/chat.test.ts +5 -5
- package/src/services/chat/clientModelRuntime.test.ts +1 -1
- package/src/services/chat/index.ts +6 -6
- package/src/services/chat/types.ts +1 -2
- package/src/services/discover.ts +16 -5
- package/src/services/electron/remoteServer.ts +8 -1
- package/src/services/marketApi.ts +124 -0
- package/src/services/models.ts +2 -1
- package/src/services/session/index.ts +0 -14
- package/src/store/discover/slices/assistant/action.ts +20 -7
- package/{packages/utils/src → src/utils}/electron/desktopRemoteRPCFetch.ts +1 -1
- package/{packages/utils/src → src/utils/server}/parseModels.ts +1 -2
- package/src/utils/server/routeVariants.test.ts +340 -0
- package/vitest.config.mts +2 -0
- package/packages/model-runtime/src/utils/imageToBase64.test.ts +0 -91
- package/packages/model-runtime/src/utils/imageToBase64.ts +0 -62
- package/src/app/[variants]/(main)/chat/settings/features/SubmitAgentButton/SubmitAgentModal.tsx +0 -98
- package/src/app/[variants]/(main)/chat/settings/features/SubmitAgentButton/index.tsx +0 -35
- package/src/app/[variants]/(main)/chat/settings/features/SubmitAgentButton/style.ts +0 -47
- /package/packages/{utils/src/fetch → fetch-sse/src}/headers.ts +0 -0
- /package/packages/{utils/src/fetch → fetch-sse/src}/index.ts +0 -0
- /package/packages/{utils/src/fetch → fetch-sse/src}/request.ts +0 -0
- /package/{packages/utils/src → src/utils/server}/__snapshots__/parseModels.test.ts.snap +0 -0
- /package/{packages/utils/src → src/utils/server}/parseModels.test.ts +0 -0
|
@@ -1,62 +0,0 @@
|
|
|
1
|
-
export const imageToBase64 = ({
|
|
2
|
-
size,
|
|
3
|
-
img,
|
|
4
|
-
type = 'image/webp',
|
|
5
|
-
}: {
|
|
6
|
-
img: HTMLImageElement;
|
|
7
|
-
size: number;
|
|
8
|
-
type?: string;
|
|
9
|
-
}) => {
|
|
10
|
-
const canvas = document.createElement('canvas');
|
|
11
|
-
const ctx = canvas.getContext('2d') as CanvasRenderingContext2D;
|
|
12
|
-
let startX = 0;
|
|
13
|
-
let startY = 0;
|
|
14
|
-
|
|
15
|
-
if (img.width > img.height) {
|
|
16
|
-
startX = (img.width - img.height) / 2;
|
|
17
|
-
} else {
|
|
18
|
-
startY = (img.height - img.width) / 2;
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
canvas.width = size;
|
|
22
|
-
canvas.height = size;
|
|
23
|
-
|
|
24
|
-
ctx.drawImage(
|
|
25
|
-
img,
|
|
26
|
-
startX,
|
|
27
|
-
startY,
|
|
28
|
-
Math.min(img.width, img.height),
|
|
29
|
-
Math.min(img.width, img.height),
|
|
30
|
-
0,
|
|
31
|
-
0,
|
|
32
|
-
size,
|
|
33
|
-
size,
|
|
34
|
-
);
|
|
35
|
-
|
|
36
|
-
return canvas.toDataURL(type);
|
|
37
|
-
};
|
|
38
|
-
|
|
39
|
-
export const imageUrlToBase64 = async (
|
|
40
|
-
imageUrl: string,
|
|
41
|
-
): Promise<{ base64: string; mimeType: string }> => {
|
|
42
|
-
try {
|
|
43
|
-
const res = await fetch(imageUrl);
|
|
44
|
-
const blob = await res.blob();
|
|
45
|
-
const arrayBuffer = await blob.arrayBuffer();
|
|
46
|
-
|
|
47
|
-
const base64 =
|
|
48
|
-
typeof btoa === 'function'
|
|
49
|
-
? btoa(
|
|
50
|
-
new Uint8Array(arrayBuffer).reduce(
|
|
51
|
-
(data, byte) => data + String.fromCharCode(byte),
|
|
52
|
-
'',
|
|
53
|
-
),
|
|
54
|
-
)
|
|
55
|
-
: Buffer.from(arrayBuffer).toString('base64');
|
|
56
|
-
|
|
57
|
-
return { base64, mimeType: blob.type };
|
|
58
|
-
} catch (error) {
|
|
59
|
-
console.error('Error converting image to base64:', error);
|
|
60
|
-
throw error;
|
|
61
|
-
}
|
|
62
|
-
};
|
package/src/app/[variants]/(main)/chat/settings/features/SubmitAgentButton/SubmitAgentModal.tsx
DELETED
|
@@ -1,98 +0,0 @@
|
|
|
1
|
-
'use client';
|
|
2
|
-
|
|
3
|
-
import { Alert, Button, Input, Modal, type ModalProps } from '@lobehub/ui';
|
|
4
|
-
import { Divider } from 'antd';
|
|
5
|
-
import { useTheme } from 'antd-style';
|
|
6
|
-
import isEqual from 'fast-deep-equal';
|
|
7
|
-
import { kebabCase } from 'lodash-es';
|
|
8
|
-
import qs from 'query-string';
|
|
9
|
-
import { memo, useState } from 'react';
|
|
10
|
-
import { useTranslation } from 'react-i18next';
|
|
11
|
-
import { Flexbox } from 'react-layout-kit';
|
|
12
|
-
|
|
13
|
-
import { AGENTS_INDEX_GITHUB_ISSUE } from '@/const/url';
|
|
14
|
-
import AgentInfo from '@/features/AgentInfo';
|
|
15
|
-
import { useAgentStore } from '@/store/agent';
|
|
16
|
-
import { agentSelectors } from '@/store/agent/selectors';
|
|
17
|
-
import { useGlobalStore } from '@/store/global';
|
|
18
|
-
import { globalGeneralSelectors } from '@/store/global/selectors';
|
|
19
|
-
import { useSessionStore } from '@/store/session';
|
|
20
|
-
import { sessionMetaSelectors } from '@/store/session/selectors';
|
|
21
|
-
|
|
22
|
-
const SubmitAgentModal = memo<ModalProps>(({ open, onCancel }) => {
|
|
23
|
-
const { t } = useTranslation('setting');
|
|
24
|
-
const [identifier, setIdentifier] = useState('');
|
|
25
|
-
const systemRole = useAgentStore(agentSelectors.currentAgentSystemRole);
|
|
26
|
-
const theme = useTheme();
|
|
27
|
-
const meta = useSessionStore(sessionMetaSelectors.currentAgentMeta, isEqual);
|
|
28
|
-
const language = useGlobalStore(globalGeneralSelectors.currentLanguage);
|
|
29
|
-
|
|
30
|
-
const isMetaPass = Boolean(
|
|
31
|
-
meta && meta.title && meta.description && (meta.tags as string[])?.length > 0 && meta.avatar,
|
|
32
|
-
);
|
|
33
|
-
|
|
34
|
-
const handleSubmit = () => {
|
|
35
|
-
const body = [
|
|
36
|
-
'### systemRole',
|
|
37
|
-
systemRole,
|
|
38
|
-
'### identifier',
|
|
39
|
-
kebabCase(identifier),
|
|
40
|
-
'### avatar',
|
|
41
|
-
meta.avatar,
|
|
42
|
-
'### title',
|
|
43
|
-
meta.title,
|
|
44
|
-
'### description',
|
|
45
|
-
meta.description,
|
|
46
|
-
'### tags',
|
|
47
|
-
(meta.tags as string[]).join(', '),
|
|
48
|
-
'### locale',
|
|
49
|
-
language,
|
|
50
|
-
].join('\n\n');
|
|
51
|
-
|
|
52
|
-
const url = qs.stringifyUrl({
|
|
53
|
-
query: { body, labels: '🤖 Agent PR', title: `[Agent] ${meta.title}` },
|
|
54
|
-
url: AGENTS_INDEX_GITHUB_ISSUE,
|
|
55
|
-
});
|
|
56
|
-
|
|
57
|
-
window.open(url, '_blank');
|
|
58
|
-
};
|
|
59
|
-
|
|
60
|
-
return (
|
|
61
|
-
<Modal
|
|
62
|
-
allowFullscreen
|
|
63
|
-
footer={
|
|
64
|
-
<Button
|
|
65
|
-
block
|
|
66
|
-
disabled={!isMetaPass || !identifier}
|
|
67
|
-
onClick={handleSubmit}
|
|
68
|
-
size={'large'}
|
|
69
|
-
type={'primary'}
|
|
70
|
-
>
|
|
71
|
-
{t('submitAgentModal.button')}
|
|
72
|
-
</Button>
|
|
73
|
-
}
|
|
74
|
-
onCancel={onCancel}
|
|
75
|
-
open={open}
|
|
76
|
-
title={t('submitAgentModal.tooltips')}
|
|
77
|
-
>
|
|
78
|
-
<Flexbox gap={16}>
|
|
79
|
-
{!isMetaPass && (
|
|
80
|
-
<Alert message={t('submitAgentModal.metaMiss')} showIcon type={'warning'} />
|
|
81
|
-
)}
|
|
82
|
-
<AgentInfo meta={meta} systemRole={systemRole} />
|
|
83
|
-
<Divider style={{ margin: '8px 0' }} />
|
|
84
|
-
<strong>
|
|
85
|
-
<span style={{ color: theme.colorError, marginRight: 4 }}>*</span>
|
|
86
|
-
{t('submitAgentModal.identifier')}
|
|
87
|
-
</strong>
|
|
88
|
-
<Input
|
|
89
|
-
onChange={(e) => setIdentifier(e.target.value)}
|
|
90
|
-
placeholder={t('submitAgentModal.placeholder')}
|
|
91
|
-
value={identifier}
|
|
92
|
-
/>
|
|
93
|
-
</Flexbox>
|
|
94
|
-
</Modal>
|
|
95
|
-
);
|
|
96
|
-
});
|
|
97
|
-
|
|
98
|
-
export default SubmitAgentModal;
|
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
import { ActionIcon, Button } from '@lobehub/ui';
|
|
2
|
-
import { Share2 } from 'lucide-react';
|
|
3
|
-
import { memo, useState } from 'react';
|
|
4
|
-
import { useTranslation } from 'react-i18next';
|
|
5
|
-
|
|
6
|
-
import { HEADER_ICON_SIZE } from '@/const/layoutTokens';
|
|
7
|
-
import { useServerConfigStore } from '@/store/serverConfig';
|
|
8
|
-
|
|
9
|
-
import SubmitAgentModal from './SubmitAgentModal';
|
|
10
|
-
|
|
11
|
-
const SubmitAgentButton = memo<{ modal?: boolean }>(({ modal }) => {
|
|
12
|
-
const { t } = useTranslation('setting');
|
|
13
|
-
const mobile = useServerConfigStore((s) => s.isMobile);
|
|
14
|
-
const [isModalOpen, setIsModalOpen] = useState(false);
|
|
15
|
-
|
|
16
|
-
return (
|
|
17
|
-
<>
|
|
18
|
-
{modal ? (
|
|
19
|
-
<Button block icon={Share2} onClick={() => setIsModalOpen(true)} variant={'filled'}>
|
|
20
|
-
{t('submitAgentModal.tooltips')}
|
|
21
|
-
</Button>
|
|
22
|
-
) : (
|
|
23
|
-
<ActionIcon
|
|
24
|
-
icon={Share2}
|
|
25
|
-
onClick={() => setIsModalOpen(true)}
|
|
26
|
-
size={HEADER_ICON_SIZE(mobile)}
|
|
27
|
-
title={t('submitAgentModal.tooltips')}
|
|
28
|
-
/>
|
|
29
|
-
)}
|
|
30
|
-
<SubmitAgentModal onCancel={() => setIsModalOpen(false)} open={isModalOpen} />
|
|
31
|
-
</>
|
|
32
|
-
);
|
|
33
|
-
});
|
|
34
|
-
|
|
35
|
-
export default SubmitAgentButton;
|
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
import { createStyles } from 'antd-style';
|
|
2
|
-
|
|
3
|
-
export const useStyles = createStyles(({ css, token, prefixCls }) => ({
|
|
4
|
-
author: css`
|
|
5
|
-
font-size: 12px;
|
|
6
|
-
`,
|
|
7
|
-
|
|
8
|
-
avatar: css`
|
|
9
|
-
flex: none;
|
|
10
|
-
`,
|
|
11
|
-
container: css`
|
|
12
|
-
position: relative;
|
|
13
|
-
padding-block: 16px 24px;
|
|
14
|
-
padding-inline: 16px;
|
|
15
|
-
border-block-end: 1px solid ${token.colorBorderSecondary};
|
|
16
|
-
`,
|
|
17
|
-
date: css`
|
|
18
|
-
font-size: 12px;
|
|
19
|
-
color: ${token.colorTextDescription};
|
|
20
|
-
`,
|
|
21
|
-
desc: css`
|
|
22
|
-
color: ${token.colorTextDescription};
|
|
23
|
-
text-align: center;
|
|
24
|
-
`,
|
|
25
|
-
loading: css`
|
|
26
|
-
.${prefixCls}-skeleton-content {
|
|
27
|
-
display: flex;
|
|
28
|
-
flex-direction: column;
|
|
29
|
-
}
|
|
30
|
-
`,
|
|
31
|
-
nav: css`
|
|
32
|
-
padding-block-start: 4px;
|
|
33
|
-
|
|
34
|
-
.${prefixCls}-tabs-tab {
|
|
35
|
-
margin: 4px !important;
|
|
36
|
-
|
|
37
|
-
+ .${prefixCls}-tabs-tab {
|
|
38
|
-
margin: 4px !important;
|
|
39
|
-
}
|
|
40
|
-
}
|
|
41
|
-
`,
|
|
42
|
-
title: css`
|
|
43
|
-
font-size: 20px;
|
|
44
|
-
font-weight: 600;
|
|
45
|
-
text-align: center;
|
|
46
|
-
`,
|
|
47
|
-
}));
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|